@arcgis/map-components 5.2.0-next.33 → 5.2.0-next.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/{PXZ7GYGB.js → 2FBLF35H.js} +1 -1
- package/dist/cdn/{I5MVHBKV.js → 2GQUMXRP.js} +1 -1
- package/dist/cdn/{VLXRN5II.js → 2TWSQAFW.js} +1 -1
- package/dist/cdn/{KIQMUMR7.js → 32VPFWAU.js} +1 -1
- package/dist/cdn/{UMJTWBQ3.js → 3TV4AW2U.js} +1 -1
- package/dist/cdn/{TMOESX4H.js → 3XN5WC3E.js} +1 -1
- package/dist/cdn/{6EKV3B5S.js → 43E5Q7SX.js} +1 -1
- package/dist/cdn/{N3JXA7DZ.js → 4CIY4MDE.js} +1 -1
- package/dist/cdn/{RKXL42SK.js → 4LXXTKLF.js} +1 -1
- package/dist/cdn/{USDF674A.js → 4PLVKLIO.js} +1 -1
- package/dist/cdn/{4NMNJIYV.js → 4RYRGSLZ.js} +1 -1
- package/dist/cdn/{YUV3XEWE.js → 5EO47VPH.js} +1 -1
- package/dist/cdn/{TSL4BZHI.js → 6NVBAMUC.js} +1 -1
- package/dist/cdn/6Z4HUEBW.js +2 -0
- package/dist/cdn/{NAWH5P73.js → 737FF4ZH.js} +1 -1
- package/dist/cdn/{OPP5DWFT.js → 7DJQ6AV3.js} +1 -1
- package/dist/cdn/{EVYO2SIO.js → 7EYV5QCR.js} +1 -1
- package/dist/cdn/7GTMLYFP.js +2 -0
- package/dist/cdn/{TCYTMU4A.js → 7NXADBPZ.js} +1 -1
- package/dist/cdn/{DUDVPO32.js → 7SS6YS6U.js} +1 -1
- package/dist/cdn/{ENSUS3VL.js → ACB6VKEU.js} +1 -1
- package/dist/cdn/{R72MT5TQ.js → ACGQG2T3.js} +1 -1
- package/dist/cdn/AGNHPUGM.js +2 -0
- package/dist/cdn/{UQIJOVPD.js → BABV4Q67.js} +1 -1
- package/dist/cdn/{ESTUA4YE.js → BB2OVX6Z.js} +1 -1
- package/dist/cdn/BD27PEC7.js +2 -0
- package/dist/cdn/{IZVYML7I.js → BJHI57US.js} +1 -1
- package/dist/cdn/{NVKY5H7W.js → BMEV46IM.js} +1 -1
- package/dist/cdn/{R5NVFWFA.js → BPXDBUNH.js} +1 -1
- package/dist/cdn/{7MKSGCWC.js → BYIKUU2V.js} +1 -1
- package/dist/cdn/{AW7PMR3D.js → CDY4M34V.js} +1 -1
- package/dist/cdn/{KZBBEVWQ.js → CML7DSDS.js} +1 -1
- package/dist/cdn/{MMNJNQ3Q.js → CMXX5I5Y.js} +1 -1
- package/dist/cdn/{TCKCE5NB.js → CUWHMMMX.js} +1 -1
- package/dist/cdn/{3XWUH3TJ.js → CW3A3NSF.js} +1 -1
- package/dist/cdn/{VLJKBHDD.js → CWXLMMIV.js} +1 -1
- package/dist/cdn/{ZBWHLMXA.js → CZE4HGAH.js} +1 -1
- package/dist/cdn/{3TFVMVSU.js → D5OF45DN.js} +1 -1
- package/dist/cdn/{NANWWHJ6.js → D5YLOINY.js} +1 -1
- package/dist/cdn/{EFYUNXBG.js → DAPA72LS.js} +1 -1
- package/dist/cdn/{CCFKZSFO.js → DGHNWABD.js} +1 -1
- package/dist/cdn/{43OLIA7Q.js → DGIBWHDZ.js} +1 -1
- package/dist/cdn/{GLNO2ZMW.js → DI6UP5OE.js} +1 -1
- package/dist/cdn/{JCHYVWCR.js → EE2CA7CT.js} +1 -1
- package/dist/cdn/{54WXILYF.js → EOK45N5T.js} +1 -1
- package/dist/cdn/{ATLWKCAP.js → ESA5KBF2.js} +1 -1
- package/dist/cdn/{SHJGMBBY.js → EV4FZDIH.js} +1 -1
- package/dist/cdn/EXQF6CLS.js +2 -0
- package/dist/cdn/{435CL2BU.js → FC3W4JBU.js} +1 -1
- package/dist/cdn/{A2Q7UAOI.js → FJI7SX3Z.js} +1 -1
- package/dist/cdn/{6HJM34BD.js → FK5W4CAM.js} +1 -1
- package/dist/cdn/{YMCZRMWW.js → FPWQJH6Z.js} +1 -1
- package/dist/cdn/{YMHPA3VC.js → FW6YER2T.js} +1 -1
- package/dist/cdn/{45OF43WO.js → FWRGAMLD.js} +1 -1
- package/dist/cdn/FWVU47N3.js +2 -0
- package/dist/cdn/{7XUCMK3B.js → FZD4BWTZ.js} +1 -1
- package/dist/cdn/{NLQ5PJXM.js → G62ON2MX.js} +1 -1
- package/dist/cdn/{GPVFCWMU.js → GSI2ZI7D.js} +1 -1
- package/dist/cdn/{3XUZ45XB.js → HB3P56AO.js} +1 -1
- package/dist/cdn/HF7TEJAO.js +2 -0
- package/dist/cdn/{WCXM6TPE.js → HLW5IWNW.js} +1 -1
- package/dist/cdn/{6S7LUYCJ.js → HSVIFDP7.js} +1 -1
- package/dist/cdn/{KPOSO4HB.js → I5OLG552.js} +1 -1
- package/dist/cdn/{2SEZT4WZ.js → I75L57XX.js} +1 -1
- package/dist/cdn/{TCFK2EXM.js → IAQVHCU7.js} +1 -1
- package/dist/cdn/{SSVJJAR5.js → IIFKJ5KI.js} +1 -1
- package/dist/cdn/{K3BJFKYY.js → IJM4ETBT.js} +1 -1
- package/dist/cdn/ISUTHAE7.js +2 -0
- package/dist/cdn/{6IEKX6LJ.js → J5WF4RA3.js} +1 -1
- package/dist/cdn/{V2FVPSX3.js → JAPZRY7D.js} +1 -1
- package/dist/cdn/{V7MKCC7O.js → JC5VO2H6.js} +1 -1
- package/dist/cdn/JK5WW4LS.js +2 -0
- package/dist/cdn/{6JMYHTFN.js → JRGDCJFD.js} +1 -1
- package/dist/cdn/{NCHQCPM6.js → K3PRLBKN.js} +1 -1
- package/dist/cdn/{LA3UYF7I.js → K3RZVWUG.js} +1 -1
- package/dist/cdn/KI2RJGYP.js +2 -0
- package/dist/cdn/KN4B6FCH.js +2 -0
- package/dist/cdn/{4LB5GOV2.js → KS54PV2C.js} +1 -1
- package/dist/cdn/KY3F7CGM.js +2 -0
- package/dist/cdn/{3YDQP3TL.js → KYIGNAWR.js} +1 -1
- package/dist/cdn/{HIHYNNEU.js → LWFBZABK.js} +1 -1
- package/dist/cdn/{7GXEJLOM.js → LWUHDIX7.js} +1 -1
- package/dist/cdn/{PKS3JYAN.js → M7QNKIPS.js} +1 -1
- package/dist/cdn/{S7HZFJQZ.js → MHFQFV3U.js} +1 -1
- package/dist/cdn/MS7AHPCF.js +2 -0
- package/dist/cdn/{NC472JXT.js → MVGWB3RU.js} +1 -1
- package/dist/cdn/{BCXPJXAK.js → NRSO2H4L.js} +1 -1
- package/dist/cdn/{45O57WR4.js → O2ETKQ5D.js} +1 -1
- package/dist/cdn/{DBF4LUEJ.js → O5TYAJJC.js} +1 -1
- package/dist/cdn/{7PTCONZB.js → OES2XNU6.js} +1 -1
- package/dist/cdn/{LKR52VUM.js → OJZS7SEO.js} +1 -1
- package/dist/cdn/{EK7GAWIV.js → OPXW6KNI.js} +1 -1
- package/dist/cdn/{2NYG7G7M.js → P5CMHBXY.js} +1 -1
- package/dist/cdn/{NRYA6EOZ.js → PIBSUNDA.js} +1 -1
- package/dist/cdn/{YUCJQ6XI.js → Q3W5PUKE.js} +1 -1
- package/dist/cdn/{CX5LLKOW.js → QEKL2JAR.js} +1 -1
- package/dist/cdn/{VSXLCBBA.js → QHA2WGXH.js} +1 -1
- package/dist/cdn/{BXLXZYRC.js → R76WDXDY.js} +1 -1
- package/dist/cdn/{EL6TAK3S.js → RIFV5I7U.js} +1 -1
- package/dist/cdn/{GRUB3M36.js → RUFWW2L5.js} +1 -1
- package/dist/cdn/{TDEIRM7H.js → RY6OC64Z.js} +1 -1
- package/dist/cdn/{3MDY3AXY.js → S3Q7DCIL.js} +1 -1
- package/dist/cdn/{BPQPJXPT.js → SDWAS6TI.js} +1 -1
- package/dist/cdn/{GJIDZ4M6.js → T2U3NVKA.js} +1 -1
- package/dist/cdn/{XOTOMH2G.js → TCOOCOVG.js} +1 -1
- package/dist/cdn/{3IVI7KSX.js → TJFVBTGT.js} +1 -1
- package/dist/cdn/{SGY36MUJ.js → TJL2GS3I.js} +1 -1
- package/dist/cdn/{TCS6CS2V.js → TPL6IAKN.js} +1 -1
- package/dist/cdn/{KG2IHV32.js → TWF5DLV4.js} +1 -1
- package/dist/cdn/{7KPJBKO6.js → UCRELG4W.js} +1 -1
- package/dist/cdn/{O7SRECHG.js → URUIZIXD.js} +1 -1
- package/dist/cdn/{42N4OII5.js → UYO3EHF5.js} +1 -1
- package/dist/cdn/{B7P66JTS.js → VDRSNCLD.js} +1 -1
- package/dist/cdn/{TA7JY4OV.js → VPMDOL5A.js} +1 -1
- package/dist/cdn/{3JEAUEUY.js → VZP4JMWS.js} +1 -1
- package/dist/cdn/{A5W6D3EH.js → WIGC724I.js} +1 -1
- package/dist/cdn/{4ICKT52U.js → WVH3PWDM.js} +1 -1
- package/dist/cdn/{DMVLKBEO.js → X32UMW74.js} +1 -1
- package/dist/cdn/{B2ZGMSHQ.js → X34ZFQYZ.js} +1 -1
- package/dist/cdn/{BRDTU3O6.js → XC3A635J.js} +1 -1
- package/dist/cdn/{6O7GP3C3.js → XDK4EBMF.js} +1 -1
- package/dist/cdn/{EK44YZYH.js → XHS7LMVO.js} +1 -1
- package/dist/cdn/{CTUD7CTJ.js → XJ45UBQS.js} +1 -1
- package/dist/cdn/{DBJFHC3S.js → XR4WLNHC.js} +1 -1
- package/dist/cdn/{FCRUDE4P.js → XRRV7RO4.js} +1 -1
- package/dist/cdn/{SFP62RAJ.js → XVEDSEO5.js} +1 -1
- package/dist/cdn/{AU7UZMXF.js → Y4BLBOOK.js} +1 -1
- package/dist/cdn/{YNIECEKR.js → Y6YN2NUF.js} +1 -1
- package/dist/cdn/{3PM2WTS4.js → YMGM7P5W.js} +1 -1
- package/dist/cdn/{MPYM4XNR.js → YQHCTUQF.js} +1 -1
- package/dist/cdn/{EEF3VY5V.js → YVZBBDWC.js} +1 -1
- package/dist/cdn/{MECGUFOT.js → ZVK4FCTD.js} +1 -1
- package/dist/cdn/{Z2HJETJA.js → ZVZAGAA3.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-editor/customElement.d.ts +6 -0
- package/dist/components/arcgis-editor/customElement.js +6 -6
- package/dist/components/arcgis-feature-templates/customElement.d.ts +7 -0
- package/dist/components/arcgis-feature-templates/customElement.js +3 -3
- package/dist/components/arcgis-legend/customElement.d.ts +1 -1
- package/dist/components/arcgis-legend/customElement.js +34 -33
- package/dist/components/arcgis-multi-feature-form/customElement.js +1 -1
- package/dist/components/arcgis-paste/customElement.js +234 -227
- package/dist/components/arcgis-print-layout-advanced-options/customElement.js +33 -31
- package/dist/components/arcgis-print-layout-panel/customElement.js +19 -16
- package/dist/components/arcgis-print-main-panel/customElement.js +28 -21
- package/dist/components/arcgis-print-template-select/customElement.js +24 -21
- package/dist/components/arcgis-print-template-selector/customElement.js +19 -19
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/loader.js +2 -2
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +4 -4
- package/dist/cdn/3ACWQZMG.js +0 -2
- package/dist/cdn/3UEX6WWW.js +0 -2
- package/dist/cdn/EI7NXMGF.js +0 -2
- package/dist/cdn/ITCLBS5H.js +0 -2
- package/dist/cdn/MTYQJ4TB.js +0 -2
- package/dist/cdn/NYS47GN2.js +0 -2
- package/dist/cdn/PLLSFCLD.js +0 -2
- package/dist/cdn/Q2XRS2MQ.js +0 -2
- package/dist/cdn/TZHGOM2Y.js +0 -2
- package/dist/cdn/UFGA4NGM.js +0 -2
- package/dist/cdn/VJ2SMYNX.js +0 -2
- package/dist/cdn/VRWFW2LF.js +0 -2
- package/dist/cdn/VYBNGAPG.js +0 -2
- package/dist/cdn/YOXKII2K.js +0 -2
- package/dist/cdn/assets/home/t9n/messages.home.json +0 -1
- package/dist/cdn/assets/slider-scale-range/t9n/messages.ScaleRangeSlider.json +0 -1
- package/dist/cdn/assets/swipe/t9n/messages.swipe.json +0 -1
- package/dist/chunks/useHandles.js +0 -207
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import j from"./G4CPNGQ6.js";import{a as E}from"./SBUR54TP.js";import i from"./QFH7PJYV.js";import h from"./MZWO5JYA.js";import f from"./DUWXDGIW.js";import{a as y}from"./VJVKFKSG.js";import{b as Z,c as U}from"./32XG4IQO.js";import e from"./6IEKX6LJ.js";import{a as z}from"./KPOSO4HB.js";import d from"./R5NVFWFA.js";import c from"./GPVFCWMU.js";import{f as P,h as H}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{a as D,d as I}from"./DU6OKLV4.js";import{M as v,N as g,O as L,P as C,R as p,S as O,U as R,a as B,b as o,o as T,x as b}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([W,q,X,{initializeProjection:J},{renderingSanitizer:M},{stripHTML:S},{substitute:m,formatNumber:A},{watch:c},,,,V,,,{d:k},{c:j,d:K}])=>{var Q=B`:host{display:flex;overflow:hidden;flex:1 1 auto}.root{--calcite-color-background: var(--calcite-color-foreground-1);display:flex;overflow:hidden;flex:1 1 auto;flex-direction:column}.root img{image-orientation:from-image}.flow-item-collapsed{--calcite-flow-item-header-border-block-end: none}.container{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1)}.container calcite-list{width:100%}.container:not(:empty,.content-hidden){padding:var(--arcgis-internal-padding-md, var(--calcite-spacing-md))}.root .arcgis-feature,.root .arcgis-feature-relationship,.root .arcgis-feature-utility-network-associations{background-color:transparent}.heading{word-break:break-word;word-wrap:break-word}.header,.footer{display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-color-foreground-1)}.footer{flex:1}.pagination-text{padding-inline:var(--calcite-spacing-sm);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm)}.loader{align-self:center;padding-inline:var(--calcite-spacing-lg)}.pagination-action-bar{flex:1}.pagination-menu-button{padding-inline:var(--calcite-spacing-xxs);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.icon{display:inline-block;flex:0 0 var(--calcite-spacing-lg);width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.action-image{flex:0 0 var(--calcite-spacing-lg);background-position:50% 50%;background-repeat:no-repeat;background-size:contain;width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.header{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.content-feature{--calcite-flow-item-footer-padding: 0}.feature-menu-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.action-exit{transform:scaleX(-1)}.flow-item-drill-in{--calcite-flow-item-footer-padding: 0}`;function Y(_){return _?.declaredClass.startsWith("esri.layers.")??!1}function ee(_){if(!(!_||!("featureReduction"in _)))return _.featureReduction?.type}var te=V(X),N=class extends L{constructor(){super(...arguments),this._zoomToFeature=new W({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),this._fetchFeaturesController=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusTrapNode=v(),this._focusTrapAnimationFrameId=null,this._rootFlowItemNode=v(),this._featureMenuViewportNode=v(),this._actionBarMenuNode=v(),this._flowContainerNode=v(),this._aggregatedFeaturesComponent=v(),this.messages=z(),this._selectedFeatureComponent=v(),this._direction=P(),this._cancelOpenRelatedFeature=()=>{this._openRelatedFeatureAbortController=y(this._openRelatedFeatureAbortController)},this._openRelatedFeatureAbortController=null,this.flowItems=new q,this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._aggregatedFeaturesLoading=!1,this._hasActionsStartSlotContent=!1,this._hasActionsEndSlotContent=!1,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.focusTrapEnabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.effectiveHeading=this.viewModel.effectiveHeading,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=!1,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureItemAbilities=this.viewModel.featureItemAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new q,this.heading=this.viewModel.heading,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSelectFeature=!1,this.hideSpinner=!1,this.hideContent=!1,this.chartAnimationDisabled=this.viewModel.featureItemAbilities?.chartAnimation,this.hideAttachmentsContent=this.viewModel.featureItemAbilities?.attachmentsContent,this.hideCustomContent=this.viewModel.featureItemAbilities?.customContent,this.hideExpressionContent=!1,this.hideFieldsContent=this.viewModel.featureItemAbilities?.fieldsContent,this.hideMediaContent=this.viewModel.featureItemAbilities?.mediaContent,this.hideRelationshipContent=this.viewModel.featureItemAbilities?.relationshipContent,this.hideTextContent=this.viewModel.featureItemAbilities?.textContent,this.hideUtilityNetworkContent=this.viewModel.featureItemAbilities?.utilityNetworkAssociationsContent,this.hideLastEditedInfo=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.map=this.viewModel.map,this.open=this.viewModel.open,this.promises=this.viewModel.promises,this.responsiveActionsEnabled=!1,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.showCollapseButton=!1,this.spatialReference=this.viewModel.spatialReference,this.state=this.viewModel.state,this.timeZone=this.viewModel.timeZone,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=H()("active","collapsed","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=b(),this.arcgisClose=b(),this.arcgisTriggerAction=b()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_aggregatedFeatureCount:16,_selectedAggregatedFeatureIndex:16,_aggregatedFeaturesLoading:16,_hasActionsStartSlotContent:16,_hasActionsEndSlotContent:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,focusTrapEnabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureItemAbilities:0,goToOverride:0,headerActions:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSelectFeature:5,hideSpinner:5,hideContent:5,chartAnimationDisabled:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,hideRelationshipContent:5,hideTextContent:5,hideUtilityNetworkContent:5,hideLastEditedInfo:5,highlightDisabled:5,icon:1,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,map:0,messageOverrides:0,open:5,referenceElement:1,promises:0,responsiveActionsEnabled:5,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,showCollapseButton:5,spatialReference:0,state:32,timeZone:1,updateLocationEnabled:5,view:0}}static{this.styles=Q}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.viewModel.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&!this.hideFeatureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.showCollapseButton&&(this.initialDisplayMode==="list"||!!(this.heading||this.viewModel.selectedFeatureItem?.heading)&&!!(this.content||this.viewModel.selectedFeatureItem?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}clear(){this.viewModel.clear()}close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._cancelToggleFocusTrapAnimationFrame(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:a}=t??{},i=new AbortController,{signal:s}=i,n=a?AbortSignal.any([s,a]):s;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await J(this.location.spatialReference,this.view.spatialReference,null,{signal:n}),e=this.view.toScreen(this.location)??void 0),!e)return;let r=await this.viewModel.fetchFeatures(e,{...t,signal:n});this.location=r.location,this.promises=r.pendingFeatures}next(){this.viewModel.next()}previous(){this.viewModel.previous()}async setFocus(){await this._focusTrapNode.value?.setFocus()}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._cancelToggleFocusTrapAnimationFrame(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[c(()=>this.viewModel?.active,()=>this._toggleFocusTrap()),c(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),c(()=>this.viewModel?.view?.scale,()=>this._viewScaleChange()),c(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),c(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),c(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),c(()=>this.viewModel?.featureItems,()=>this._featureMenuViewportScrollTop()),c(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),c(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),c(()=>this.viewModel.aggregatedFeaturesEnabled,e=>{e||(this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._aggregatedFeaturesLoading=!1,this._removeFlowItems())}),c(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),c(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.open],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&T(()=>this.selectedFeatureComponent=e)}_toggleFocusTrap(){this._cancelToggleFocusTrapAnimationFrame(),this._focusTrapAnimationFrameId=requestAnimationFrame(()=>{this._focusTrapAnimationFrameId=null,this.viewModel.active?this._focusTrapNode.value?.activate():this._focusTrapNode.value?.deactivate()})}_cancelToggleFocusTrapAnimationFrame(){this._focusTrapAnimationFrameId!=null&&(cancelAnimationFrame(this._focusTrapAnimationFrameId),this._focusTrapAnimationFrameId=null)}_cancelFetchingFeatures(){this._fetchFeaturesController=y(this._fetchFeaturesController)}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureItems:e}=this.viewModel,t=new Map;return e.forEach(a=>{let i=a?.graphic;if(!i)return;let s=k(i),n=Y(s)?s:null,r=t.get(n);r||(r=[],t.set(n,r)),r.push(a)}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),t.signal.aborted)return;let a=e.graphic,i=a?.geometry;if(i==null||a==null){this._openRelatedFeatureAbortController=null;return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),t.signal.aborted)return;let s=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(t.signal.aborted)return;let n=s.execute(i);n!=null&&(this.location=n),this.features=[a],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController=null}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e}_previousFeature(){this.viewModel.previous()}_nextFeature(){this.viewModel.next()}_handleFeatureBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this._openFeatureMenu()}_handleFeatureMenuBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this.featureMenuOpen&&this._closeFeatureMenu()}_setActiveFeature(e){let{viewModel:t}=this;t.activeFeature=t.features?.[e]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){this.viewModel.selectedFeatureIndex=e,this.initialDisplayMode==="feature"?this._handleFeatureMenuBack():this.setFocus()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),e&&this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:t,selectedFeature:a}=this,{id:i}=e,s=a?.attributes,n=e.title??"",r=i==="zoom-to-feature"?m(n,{messages:t}):i==="remove-selected-feature"?m(n,{messages:t}):i==="zoom-to-clustered-features"?m(n,{messages:t}):i==="browse-aggregated-features"?m(n,{messages:t}):e.title;return r&&s?m(r,s):r??""}_onMainKeydown(e){let{key:t}=e;U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:a,waitingForResult:i}=this.viewModel;i||!a||e===t||e===-1||(this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){e.disabled||(e?.type==="toggle"&&(e.value=!e.value),K(e,this.viewModel),this.arcgisTriggerAction.emit({action:e}))}_viewScaleChange(){let{selectedFeature:e}=this;!e?.isAggregate||ee(k(e))!=="cluster"||(this.viewModel.aggregatedFeaturesEnabled=!1,this.open=!1,this.clear())}_viewChange(){this.viewModel.clear(),this.open=!1,this._aggregatedFeatureCount=0,this._removeFlowItems()}_handleAggregatedFeaturesPropertyChange({detail:e,target:t}){e.name==="aggregatedFeatureCount"&&(this._aggregatedFeatureCount=t.aggregatedFeatureCount),e.name==="selectedAggregatedFeatureIndex"&&(this._selectedAggregatedFeatureIndex=t.selectedAggregatedFeatureIndex,this._syncSelectedDrillInFeature()),e.name==="loading"&&(this._aggregatedFeaturesLoading=t.loading)}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);T(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_removeFlowItems(){this.viewModel.aggregatedFeaturesEnabled=!1,this.flowItems?.destroyAll()}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":case"feature-utility-network-association-type":return e.description;case"feature-relationship":return e.allItemsDescription}}_handleDrillInBackClick(){this.flowItems?.pop()?.destroy()}_getHeading(){let{effectiveHeading:e}=this.viewModel;return!this.hideHeading&&e?e:""}_handleActionsStartSlotChange(e){this._hasActionsStartSlotContent=D(e)}_handleActionsEndSlotChange(e){this._hasActionsEndSlotContent=D(e)}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=O(o`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.open&&this.viewModel?.waitingForResult} .location=${this.viewModel?.location??void 0} .view=${this.viewModel?.view??void 0}></arcgis-spinner>`),e.manager?.component?.extraContent?.add(this._spinnerEl))}render(){return o`<div class="root" @keydown=${this._onMainKeydown}><calcite-focus-trap .focusTrapDisabled=${!this.focusTrapEnabled} ${g(this._focusTrapNode)}>${this._renderHeader()}${this._renderContentContainer()}</calcite-focus-trap></div>`}_renderFeatureNavigation(){return[this._renderPagination(()=>this._previousFeature(),()=>this._nextFeature()),this.initialDisplayMode==="list"?this._renderFeaturePaginationText(this.viewModel.featureCount,this.viewModel.selectedFeatureIndex):this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(e,t){let{messages:a}=this;return o`<div class="pagination-text">${m(a.pageText??"",{index:A(t+1),total:A(e)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:a,selectedFeatureIndex:i,pendingPromisesCount:s}=t;return o`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${s>0} @click=${this._handlePaginationMenuButton} .text=${m(e.pageText??"",{index:A(i+1),total:A(a)})} text-enabled title=${e.selectFeature??p}></calcite-action>`}_renderPagination(e,t){let{previous:a,next:i}=this.messages;return o`<calcite-action-bar class="pagination-action-bar" expand-disabled layout=horizontal overflow-actions-disabled scale=s><calcite-action-group scale=s><calcite-action class="pagination-previous" icon=chevron-left icon-flip-rtl .label=${a??""} @click=${e} .text=${a??""} title=${a??""??p}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${i??""} @click=${t} .text=${i??""} title=${i??""??p}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e,t){let{initialDisplayMode:a}=this,{selectedFeatureItem:i}=this.viewModel,s=e===i;return o`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(t)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(t)} .selected=${s} @calciteListItemSelect=${()=>this._selectFeature(t)}><span .innerHTML=${(M.sanitize(e.heading)||this.messages.untitled)??""} slot=content></span>${a==="list"?o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`:null}</calcite-list-item>`}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,a=this._groupResultsByLayer(),i=new Map;t.featureItems.forEach((n,r)=>i.set(n,r));let s=this.initialDisplayMode==="list"?"none":"single";return t.featureItems.length?o`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${s}>${Array.from(a.keys(),n=>{let r=a.get(n)?.map(l=>{let h=i.get(l);return h==null?null:this._renderFeatureMenuItem(l,h)}),d=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&d!==null?E(n??"map-graphics",o`<calcite-list-item-group .heading=${d}>${r}</calcite-list-item-group>`):r})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?o`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} @click=${()=>this._triggerAction(e)} slot=header-actions-end .text=${t} title=${t??p}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(e){let{headingLevel:t,hideCloseButton:a,_isCollapsed:i,_collapseEnabled:s,featureNavigationTop:n,initialDisplayMode:r,selectedFeature:d,hideHeading:l}=this,{active:h,selectedFeatureItem:f,content:F}=this.viewModel,u=this._getHeading();if(r==="list"&&!d)return null;let w=f?!f.content:!F;return o`<calcite-flow-item class=${C(I({"content-feature":!0,"flow-item-collapsed":i}))} .closable=${!a} .closed=${!h} .collapsed=${i} .collapseDirection=${this.collapseDirection??(n?"down":"up")} .collapsible=${s} .headingLevel=${t} .selected=${e} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!l&&u?S(u):void 0} ${g(this._rootFlowItemNode)}>${!l&&u?o`<div slot=heading><div .innerHTML=${M.sanitize(u??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${C(I("container","content-container",{"content-hidden":w}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:a,messages:i,initialDisplayMode:s,featureMenuOpen:n,_featureFlowItemSelected:r,_collapseEnabled:d,_isCollapsed:l,featureNavigationTop:h,headingLevel:f}=this,{active:F,featureItems:u,pendingPromisesCount:w}=e,x=a??i.selectFeature;if(s==="feature"&&!n)return null;let $=!r;return o`<calcite-flow-item class=${C(I({"flow-item-collapsed":l}))} .closable=${s==="list"&&!t} .closed=${!F} .collapsed=${s==="list"&&l} .collapseDirection=${this.collapseDirection??(h?"down":"up")} .collapsible=${s==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:m(i.total??"",{total:u.length})} .heading=${this.hideFeatureMenuHeading?void 0:x} .headingLevel=${f} .loading=${e.waitingForContents} .selected=${$} @calciteFlowItemBack=${G=>{G.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${g(this._featureMenuViewportNode)}>${s==="list"?this._renderHeaderActions():null}${w>0?o`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${$?this._renderFeatureMenu():null}</div><div class="feature-menu-observer" ${g(this._featureMenuIntersectionObserverCreated)}></div>${s==="feature"?o`<calcite-button scale=s appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:a,hideCloseButton:i,hideSelectFeature:s,active:n,hideHeading:r}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,l=d&&!s,h=e.flowType==="feature-association",f=a.returnToInitialFeature??"",F=a?.selectFeature,u=this._getActionTitle(this._zoomToFeature),w=!this.hideActionBar&&h&&d,x=e.flowType==="feature"&&this.viewModel.aggregatedFeaturesEnabled?o`<div class="footer" slot=footer>${this._renderPagination(()=>{this._aggregatedFeaturesComponent.value?.previous()},()=>{this._aggregatedFeaturesComponent.value?.next()})}${this._renderFeaturePaginationText(this._aggregatedFeatureCount,this._selectedAggregatedFeatureIndex)}</div>`:null;return o`<calcite-flow-item .closable=${!i} .closed=${!n} class="flow-item-drill-in" .description=${S(this._getDrillInFlowItemDescription(e)??"")} .heading=${r?void 0:S(e.heading??"")} .selected=${t} @calciteFlowItemBack=${$=>{$.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${r?null:o`<div slot=heading><div .innerHTML=${M.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${M.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${f??""} title=${f??""??p}></calcite-action>${l?o`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${F??""} title=${F??p}></calcite-action>`:null}${w?o`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${this._zoomToFeature.disabled} .icon=${this._zoomToFeature.icon??void 0} .loading=${this._zoomToFeature.active} scale=s text-enabled .text=${u} title=${u??p} @click=${()=>j(this.viewModel,this._zoomToFeature,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div>${x}</calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e.length>0,a=this.viewModel.aggregatedFeaturesEnabled&&this.viewModel.selectedFeature?.isAggregate&&!t,i=a&&e.length===0,s=e.length===0&&this._featureFlowItemSelected&&!a,n=e?.map((l,h)=>this._renderFlowItem(l,this._featureFlowItemSelected&&h===e.length-1)),r=this._renderBrowseAggregateContainer(!!i),d=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(s)]:[this._renderContentFeature(s),this._renderFeatureMenuContainer()];return o`<calcite-flow ${g(this._flowContainerNode)}>${d}${r}${n}</calcite-flow>`}_renderBrowseAggregateContainer(e){let{hideCloseButton:t,active:a,messages:i}=this,{selectedFeature:s}=this.viewModel;return this.viewModel.aggregatedFeaturesEnabled&&s?.isAggregate?o`<calcite-flow-item .selected=${e} .closable=${!t} .closed=${!a} .description=${this._aggregatedFeatureCount?m(i.total??"",{total:this._aggregatedFeatureCount}):""} .heading=${i.aggregatedFeatures} @calciteFlowItemBack=${n=>{n.preventDefault(),this.viewModel.aggregatedFeaturesEnabled=!1}} .loading=${this._aggregatedFeaturesLoading} @calciteFlowItemClose=${this._handleClose}><arcgis-aggregated-features .autoDestroyDisabled=${this.autoDestroyDisabled} .feature=${s??void 0} .flowItems=${this.flowItems} .map=${this.map??void 0} .messages=${i} @arcgisPropertyChange=${this._handleAggregatedFeaturesPropertyChange} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .view=${this.view??void 0} ${g(this._aggregatedFeaturesComponent)}></arcgis-aggregated-features><calcite-button appearance=transparent @click=${()=>this.viewModel.aggregatedFeaturesEnabled=!1} slot=footer-start scale=s width=full>${i.back}</calcite-button></calcite-flow-item>`:null}_renderActionBar(){let e=this.viewModel.selectedFeatureItem?.isFeatureFromTable,t=this.viewModel.allActions.toArray(),a=e&&!this.location?t.filter(s=>s.id!==this._zoomToFeature.id):t,i=!!a.length||this._hasActionsStartSlotContent||this._hasActionsEndSlotContent;return!this._isCollapsed&&!this.hideActionBar&&i?o`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><slot name=actions-start @slotchange=${this._handleActionsStartSlotChange}></slot><calcite-action-group overlay-positioning=fixed scale=s ${g(this._actionBarMenuNode)}>${this._renderActions(a)}</calcite-action-group><slot name=actions-end @slotchange=${this._handleActionsEndSlotChange}></slot></calcite-action-bar>`:null}_renderActions(e){return e.map(t=>{let a=this._getActionTitle(t);return o`<calcite-action .active=${t.type==="toggle"?t.value:!1} .disabled=${t.disabled} .icon=${t.icon??void 0} .loading=${t.active} scale=s .textEnabled=${!this._hideActionText} .text=${a??""} title=${a??p} .hidden=${!t.visible} @click=${()=>this._triggerAction(t)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureItem:t}=this.viewModel;return t?o`<arcgis-feature-next .autoDestroyDisabled=${this.autoDestroyDisabled} .chartAnimationDisabled=${this.chartAnimationDisabled} .defaultPopupTemplateEnabled=${this.defaultPopupTemplateEnabled} .flowItems=${this.flowItems} .graphic=${t.graphic} .headingLevel=${this.headingLevel+1} .hideAttachmentsContent=${this.hideAttachmentsContent} .hideContent=${this.hideContent} .hideCustomContent=${this.hideCustomContent} .hideExpressionContent=${this.hideExpressionContent} .hideFieldsContent=${this.hideFieldsContent} hide-heading .hideLastEditedInfo=${this.hideLastEditedInfo} .hideMediaContent=${this.hideMediaContent} .hideTextContent=${this.hideTextContent} .location=${this.location} .map=${this.map} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${g(this._selectedFeatureComponent)}></arcgis-feature-next>`:typeof e=="string"?E(e,o`<div .innerHTML=${M.sanitize(e)??""}></div>`):e??null}};R("arcgis-features-next",N);return N},"support/actions/ActionButton","core/Collection","popup/Features","applications/Components/featureUtils","applications/Components/sanitizerUtils","applications/Components/stringUtils","intl","core/reactiveUtils",a,c,d,e,f,h,i,j)
|
|
2
|
+
import j from"./G4CPNGQ6.js";import{a as E}from"./SBUR54TP.js";import i from"./QFH7PJYV.js";import h from"./MZWO5JYA.js";import f from"./DUWXDGIW.js";import{a as y}from"./VJVKFKSG.js";import{b as Z,c as U}from"./32XG4IQO.js";import e from"./J5WF4RA3.js";import{a as z}from"./I5OLG552.js";import d from"./BPXDBUNH.js";import c from"./GSI2ZI7D.js";import{e as P,g as H}from"./BD27PEC7.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{a as D,d as I}from"./DU6OKLV4.js";import{M as v,N as g,O as L,P as C,R as p,S as O,U as R,a as B,b as o,o as T,x as b}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([W,q,X,{initializeProjection:J},{renderingSanitizer:M},{stripHTML:S},{substitute:m,formatNumber:A},{watch:c},,,,V,,,{d:k},{c:j,d:K}])=>{var Q=B`:host{display:flex;overflow:hidden;flex:1 1 auto}.root{--calcite-color-background: var(--calcite-color-foreground-1);display:flex;overflow:hidden;flex:1 1 auto;flex-direction:column}.root img{image-orientation:from-image}.flow-item-collapsed{--calcite-flow-item-header-border-block-end: none}.container{display:flex;flex:1 1 auto;background-color:var(--calcite-color-foreground-1)}.container calcite-list{width:100%}.container:not(:empty,.content-hidden){padding:var(--arcgis-internal-padding-md, var(--calcite-spacing-md))}.root .arcgis-feature,.root .arcgis-feature-relationship,.root .arcgis-feature-utility-network-associations{background-color:transparent}.heading{word-break:break-word;word-wrap:break-word}.header,.footer{display:flex;align-items:center;justify-content:flex-end;background-color:var(--calcite-color-foreground-1)}.footer{flex:1}.pagination-text{padding-inline:var(--calcite-spacing-sm);color:var(--calcite-color-text-3);font-size:var(--calcite-font-size-sm)}.loader{align-self:center;padding-inline:var(--calcite-spacing-lg)}.pagination-action-bar{flex:1}.pagination-menu-button{padding-inline:var(--calcite-spacing-xxs);border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.icon{display:inline-block;flex:0 0 var(--calcite-spacing-lg);width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.action-image{flex:0 0 var(--calcite-spacing-lg);background-position:50% 50%;background-repeat:no-repeat;background-size:contain;width:var(--calcite-spacing-lg);height:var(--calcite-spacing-lg)}.header{border-block-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.content-feature{--calcite-flow-item-footer-padding: 0}.feature-menu-observer{position:relative;bottom:var(--calcite-spacing-xxl);z-index:2;text-align:center}.action-exit{transform:scaleX(-1)}.flow-item-drill-in{--calcite-flow-item-footer-padding: 0}`;function Y(_){return _?.declaredClass.startsWith("esri.layers.")??!1}function ee(_){if(!(!_||!("featureReduction"in _)))return _.featureReduction?.type}var te=V(X),N=class extends L{constructor(){super(...arguments),this._zoomToFeature=new W({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),this._fetchFeaturesController=null,this._featureMenuIntersectionObserverCallback=([e])=>{e?.isIntersecting&&this.viewModel.featurePage!=null&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._featureMenuIntersectionObserverNode=null,this._focusTrapNode=v(),this._focusTrapAnimationFrameId=null,this._rootFlowItemNode=v(),this._featureMenuViewportNode=v(),this._actionBarMenuNode=v(),this._flowContainerNode=v(),this._aggregatedFeaturesComponent=v(),this.messages=z(),this._selectedFeatureComponent=v(),this._direction=P(),this._cancelOpenRelatedFeature=()=>{this._openRelatedFeatureAbortController=y(this._openRelatedFeatureAbortController)},this._openRelatedFeatureAbortController=null,this.flowItems=new q,this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._aggregatedFeaturesLoading=!1,this._hasActionsStartSlotContent=!1,this._hasActionsEndSlotContent=!1,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.focusTrapEnabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.effectiveHeading=this.viewModel.effectiveHeading,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=!1,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureItemAbilities=this.viewModel.featureItemAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new q,this.heading=this.viewModel.heading,this.headingLevel=2,this.hideActionBar=!1,this.hideCloseButton=!1,this.hideFeatureMenuHeading=!1,this.hideFeatureNavigation=!1,this.hideFeatureListLayerTitle=!1,this.hideHeading=!1,this.hideSelectFeature=!1,this.hideSpinner=!1,this.hideContent=!1,this.chartAnimationDisabled=this.viewModel.featureItemAbilities?.chartAnimation,this.hideAttachmentsContent=this.viewModel.featureItemAbilities?.attachmentsContent,this.hideCustomContent=this.viewModel.featureItemAbilities?.customContent,this.hideExpressionContent=!1,this.hideFieldsContent=this.viewModel.featureItemAbilities?.fieldsContent,this.hideMediaContent=this.viewModel.featureItemAbilities?.mediaContent,this.hideRelationshipContent=this.viewModel.featureItemAbilities?.relationshipContent,this.hideTextContent=this.viewModel.featureItemAbilities?.textContent,this.hideUtilityNetworkContent=this.viewModel.featureItemAbilities?.utilityNetworkAssociationsContent,this.hideLastEditedInfo=!1,this.highlightDisabled=this.viewModel.highlightEnabled,this.includeDefaultActionsDisabled=this.viewModel.includeDefaultActions,this.initialDisplayMode=this.viewModel.initialDisplayMode,this.location=this.viewModel.location,this.map=this.viewModel.map,this.open=this.viewModel.open,this.promises=this.viewModel.promises,this.responsiveActionsEnabled=!1,this.selectedFeature=this.viewModel.selectedFeature,this.selectedFeatureIndex=this.viewModel.selectedFeatureIndex,this.showCollapseButton=!1,this.spatialReference=this.viewModel.spatialReference,this.state=this.viewModel.state,this.timeZone=this.viewModel.timeZone,this.updateLocationEnabled=this.viewModel.updateLocationEnabled,this.view=this.viewModel.view,this.arcgisPropertyChange=H()("active","collapsed","effectiveHeading","featureCount","featureMenuOpen","features","promises","selectedDrillInFeature","selectedFeature","selectedFeatureComponent","selectedFeatureIndex","state","open"),this.arcgisReady=b(),this.arcgisClose=b(),this.arcgisTriggerAction=b()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_aggregatedFeatureCount:16,_selectedAggregatedFeatureIndex:16,_aggregatedFeaturesLoading:16,_hasActionsStartSlotContent:16,_hasActionsEndSlotContent:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,focusTrapEnabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureItemAbilities:0,goToOverride:0,headerActions:0,heading:1,headingLevel:9,hideActionBar:5,hideCloseButton:5,hideFeatureMenuHeading:5,hideFeatureNavigation:5,hideFeatureListLayerTitle:5,hideHeading:5,hideSelectFeature:5,hideSpinner:5,hideContent:5,chartAnimationDisabled:5,hideAttachmentsContent:5,hideCustomContent:5,hideExpressionContent:5,hideFieldsContent:5,hideMediaContent:5,hideRelationshipContent:5,hideTextContent:5,hideUtilityNetworkContent:5,hideLastEditedInfo:5,highlightDisabled:5,icon:1,includeDefaultActionsDisabled:5,initialDisplayMode:1,label:1,location:0,map:0,messageOverrides:0,open:5,referenceElement:1,promises:0,responsiveActionsEnabled:5,selectedDrillInFeature:32,selectedFeature:0,selectedFeatureComponent:32,selectedFeatureIndex:9,showCollapseButton:5,spatialReference:0,state:32,timeZone:1,updateLocationEnabled:5,view:0}}static{this.styles=Q}get _hideActionText(){if(!this.responsiveActionsEnabled)return!1;let e=this.viewModel.view?.widthBreakpoint;return e==="xsmall"||e==="small"||e==="medium"}get _featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&!!this.viewModel.selectedFeature&&!this.hideFeatureNavigation}get _isCollapsed(){return this._collapseEnabled&&this.collapsed}get _collapseEnabled(){return this.showCollapseButton&&(this.initialDisplayMode==="list"||!!(this.heading||this.viewModel.selectedFeatureItem?.heading)&&!!(this.content||this.viewModel.selectedFeatureItem?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}clear(){this.viewModel.clear()}close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._cancelToggleFocusTrapAnimationFrame(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:a}=t??{},i=new AbortController,{signal:s}=i,n=a?AbortSignal.any([s,a]):s;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await J(this.location.spatialReference,this.view.spatialReference,null,{signal:n}),e=this.view.toScreen(this.location)??void 0),!e)return;let r=await this.viewModel.fetchFeatures(e,{...t,signal:n});this.location=r.location,this.promises=r.pendingFeatures}next(){this.viewModel.next()}previous(){this.viewModel.previous()}async setFocus(){await this._focusTrapNode.value?.setFocus()}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._cancelToggleFocusTrapAnimationFrame(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[c(()=>this.viewModel?.active,()=>this._toggleFocusTrap()),c(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),c(()=>this.viewModel?.view?.scale,()=>this._viewScaleChange()),c(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),c(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),c(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),c(()=>this.viewModel?.featureItems,()=>this._featureMenuViewportScrollTop()),c(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),c(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),c(()=>this.viewModel.aggregatedFeaturesEnabled,e=>{e||(this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._aggregatedFeaturesLoading=!1,this._removeFlowItems())}),c(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),c(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.open],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&T(()=>this.selectedFeatureComponent=e)}_toggleFocusTrap(){this._cancelToggleFocusTrapAnimationFrame(),this._focusTrapAnimationFrameId=requestAnimationFrame(()=>{this._focusTrapAnimationFrameId=null,this.viewModel.active?this._focusTrapNode.value?.activate():this._focusTrapNode.value?.deactivate()})}_cancelToggleFocusTrapAnimationFrame(){this._focusTrapAnimationFrameId!=null&&(cancelAnimationFrame(this._focusTrapAnimationFrameId),this._focusTrapAnimationFrameId=null)}_cancelFetchingFeatures(){this._fetchFeaturesController=y(this._fetchFeaturesController)}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureItems:e}=this.viewModel,t=new Map;return e.forEach(a=>{let i=a?.graphic;if(!i)return;let s=k(i),n=Y(s)?s:null,r=t.get(n);r||(r=[],t.set(n,r)),r.push(a)}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),t.signal.aborted)return;let a=e.graphic,i=a?.geometry;if(i==null||a==null){this._openRelatedFeatureAbortController=null;return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),t.signal.aborted)return;let s=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(t.signal.aborted)return;let n=s.execute(i);n!=null&&(this.location=n),this.features=[a],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController=null}_handlePaginationMenuButton(){this._updateFeatureMenu()}_openFeatureMenu(){this._updateFeatureMenu(!0)}_closeFeatureMenu(){this._updateFeatureMenu(!1)}_updateFeatureMenu(e=!this.featureMenuOpen){this.featureMenuOpen=e}_previousFeature(){this.viewModel.previous()}_nextFeature(){this.viewModel.next()}_handleFeatureBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this._openFeatureMenu()}_handleFeatureMenuBack(){this.initialDisplayMode==="list"?(this.selectedFeatureIndex=-1,this.setFocus()):this.featureMenuOpen&&this._closeFeatureMenu()}_setActiveFeature(e){let{viewModel:t}=this;t.activeFeature=t.features?.[e]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_selectFeature(e){this.viewModel.selectedFeatureIndex=e,this.initialDisplayMode==="feature"?this._handleFeatureMenuBack():this.setFocus()}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),e&&this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_getActionTitle(e){let{messages:t,selectedFeature:a}=this,{id:i}=e,s=a?.attributes,n=e.title??"",r=i==="zoom-to-feature"?m(n,{messages:t}):i==="remove-selected-feature"?m(n,{messages:t}):i==="zoom-to-clustered-features"?m(n,{messages:t}):i==="browse-aggregated-features"?m(n,{messages:t}):e.title;return r&&s?m(r,s):r??""}_onMainKeydown(e){let{key:t}=e;U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:a,waitingForResult:i}=this.viewModel;i||!a||e===t||e===-1||(this._aggregatedFeatureCount=0,this._selectedAggregatedFeatureIndex=-1,this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){e.disabled||(e?.type==="toggle"&&(e.value=!e.value),K(e,this.viewModel),this.arcgisTriggerAction.emit({action:e}))}_viewScaleChange(){let{selectedFeature:e}=this;!e?.isAggregate||ee(k(e))!=="cluster"||(this.viewModel.aggregatedFeaturesEnabled=!1,this.open=!1,this.clear())}_viewChange(){this.viewModel.clear(),this.open=!1,this._aggregatedFeatureCount=0,this._removeFlowItems()}_handleAggregatedFeaturesPropertyChange({detail:e,target:t}){e.name==="aggregatedFeatureCount"&&(this._aggregatedFeatureCount=t.aggregatedFeatureCount),e.name==="selectedAggregatedFeatureIndex"&&(this._selectedAggregatedFeatureIndex=t.selectedAggregatedFeatureIndex,this._syncSelectedDrillInFeature()),e.name==="loading"&&(this._aggregatedFeaturesLoading=t.loading)}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);T(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_removeFlowItems(){this.viewModel.aggregatedFeaturesEnabled=!1,this.flowItems?.destroyAll()}_getDrillInFlowItemDescription(e){switch(e.flowType){case"feature":case"feature-association":case"feature-utility-network-associations":case"feature-utility-network-association-type":return e.description;case"feature-relationship":return e.allItemsDescription}}_handleDrillInBackClick(){this.flowItems?.pop()?.destroy()}_getHeading(){let{effectiveHeading:e}=this.viewModel;return!this.hideHeading&&e?e:""}_handleActionsStartSlotChange(e){this._hasActionsStartSlotContent=D(e)}_handleActionsEndSlotChange(e){this._hasActionsEndSlotContent=D(e)}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=O(o`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.open&&this.viewModel?.waitingForResult} .location=${this.viewModel?.location??void 0} .view=${this.viewModel?.view??void 0}></arcgis-spinner>`),e.manager?.component?.extraContent?.add(this._spinnerEl))}render(){return o`<div class="root" @keydown=${this._onMainKeydown}><calcite-focus-trap .focusTrapDisabled=${!this.focusTrapEnabled} ${g(this._focusTrapNode)}>${this._renderHeader()}${this._renderContentContainer()}</calcite-focus-trap></div>`}_renderFeatureNavigation(){return[this._renderPagination(()=>this._previousFeature(),()=>this._nextFeature()),this.initialDisplayMode==="list"?this._renderFeaturePaginationText(this.viewModel.featureCount,this.viewModel.selectedFeatureIndex):this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?o`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(e,t){let{messages:a}=this;return o`<div class="pagination-text">${m(a.pageText??"",{index:A(t+1),total:A(e)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:a,selectedFeatureIndex:i,pendingPromisesCount:s}=t;return o`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${s>0} @click=${this._handlePaginationMenuButton} .text=${m(e.pageText??"",{index:A(i+1),total:A(a)})} text-enabled title=${e.selectFeature??p}></calcite-action>`}_renderPagination(e,t){let{previous:a,next:i}=this.messages;return o`<calcite-action-bar class="pagination-action-bar" expand-disabled layout=horizontal overflow-actions-disabled scale=s><calcite-action-group scale=s><calcite-action class="pagination-previous" icon=chevron-left icon-flip-rtl .label=${a??""} @click=${e} .text=${a??""} title=${a??""??p}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${i??""} @click=${t} .text=${i??""} title=${i??""??p}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e,t){let{initialDisplayMode:a}=this,{selectedFeatureItem:i}=this.viewModel,s=e===i;return o`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(t)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(t)} .selected=${s} @calciteListItemSelect=${()=>this._selectFeature(t)}><span .innerHTML=${(M.sanitize(e.heading)||this.messages.untitled)??""} slot=content></span>${a==="list"?o`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`:null}</calcite-list-item>`}_renderFeatureMenu(){let{messages:e,viewModel:t}=this,a=this._groupResultsByLayer(),i=new Map;t.featureItems.forEach((n,r)=>i.set(n,r));let s=this.initialDisplayMode==="list"?"none":"single";return t.featureItems.length?o`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${s}>${Array.from(a.keys(),n=>{let r=a.get(n)?.map(l=>{let h=i.get(l);return h==null?null:this._renderFeatureMenuItem(l,h)}),d=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&d!==null?E(n??"map-graphics",o`<calcite-list-item-group .heading=${d}>${r}</calcite-list-item-group>`):r})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?o`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .indicator=${e.active} .loading=${e.active} @click=${()=>this._triggerAction(e)} slot=header-actions-end .text=${t} title=${t??p}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(e){let{headingLevel:t,hideCloseButton:a,_isCollapsed:i,_collapseEnabled:s,featureNavigationTop:n,initialDisplayMode:r,selectedFeature:d,hideHeading:l}=this,{active:h,selectedFeatureItem:f,content:F}=this.viewModel,u=this._getHeading();if(r==="list"&&!d)return null;let w=f?!f.content:!F;return o`<calcite-flow-item class=${C(I({"content-feature":!0,"flow-item-collapsed":i}))} .closable=${!a} .closed=${!h} .collapsed=${i} .collapseDirection=${this.collapseDirection??(n?"down":"up")} .collapsible=${s} .headingLevel=${t} .selected=${e} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!l&&u?S(u):void 0} ${g(this._rootFlowItemNode)}>${!l&&u?o`<div slot=heading><div .innerHTML=${M.sanitize(u??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${C(I("container","content-container",{"content-hidden":w}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:a,messages:i,initialDisplayMode:s,featureMenuOpen:n,_featureFlowItemSelected:r,_collapseEnabled:d,_isCollapsed:l,featureNavigationTop:h,headingLevel:f}=this,{active:F,featureItems:u,pendingPromisesCount:w}=e,x=a??i.selectFeature;if(s==="feature"&&!n)return null;let $=!r;return o`<calcite-flow-item class=${C(I({"flow-item-collapsed":l}))} .closable=${s==="list"&&!t} .closed=${!F} .collapsed=${s==="list"&&l} .collapseDirection=${this.collapseDirection??(h?"down":"up")} .collapsible=${s==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:m(i.total??"",{total:u.length})} .heading=${this.hideFeatureMenuHeading?void 0:x} .headingLevel=${f} .loading=${e.waitingForContents} .selected=${$} @calciteFlowItemBack=${G=>{G.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${g(this._featureMenuViewportNode)}>${s==="list"?this._renderHeaderActions():null}${w>0?o`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${$?this._renderFeatureMenu():null}</div><div class="feature-menu-observer" ${g(this._featureMenuIntersectionObserverCreated)}></div>${s==="feature"?o`<calcite-button scale=s appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:a,hideCloseButton:i,hideSelectFeature:s,active:n,hideHeading:r}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,l=d&&!s,h=e.flowType==="feature-association",f=a.returnToInitialFeature??"",F=a?.selectFeature,u=this._getActionTitle(this._zoomToFeature),w=!this.hideActionBar&&h&&d,x=e.flowType==="feature"&&this.viewModel.aggregatedFeaturesEnabled?o`<div class="footer" slot=footer>${this._renderPagination(()=>{this._aggregatedFeaturesComponent.value?.previous()},()=>{this._aggregatedFeaturesComponent.value?.next()})}${this._renderFeaturePaginationText(this._aggregatedFeatureCount,this._selectedAggregatedFeatureIndex)}</div>`:null;return o`<calcite-flow-item .closable=${!i} .closed=${!n} class="flow-item-drill-in" .description=${S(this._getDrillInFlowItemDescription(e)??"")} .heading=${r?void 0:S(e.heading??"")} .selected=${t} @calciteFlowItemBack=${$=>{$.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${r?null:o`<div slot=heading><div .innerHTML=${M.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${M.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${f??""} title=${f??""??p}></calcite-action>${l?o`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${F??""} title=${F??p}></calcite-action>`:null}${w?o`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${this._zoomToFeature.disabled} .icon=${this._zoomToFeature.icon??void 0} .loading=${this._zoomToFeature.active} scale=s text-enabled .text=${u} title=${u??p} @click=${()=>j(this.viewModel,this._zoomToFeature,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div>${x}</calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e.length>0,a=this.viewModel.aggregatedFeaturesEnabled&&this.viewModel.selectedFeature?.isAggregate&&!t,i=a&&e.length===0,s=e.length===0&&this._featureFlowItemSelected&&!a,n=e?.map((l,h)=>this._renderFlowItem(l,this._featureFlowItemSelected&&h===e.length-1)),r=this._renderBrowseAggregateContainer(!!i),d=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(s)]:[this._renderContentFeature(s),this._renderFeatureMenuContainer()];return o`<calcite-flow ${g(this._flowContainerNode)}>${d}${r}${n}</calcite-flow>`}_renderBrowseAggregateContainer(e){let{hideCloseButton:t,active:a,messages:i}=this,{selectedFeature:s}=this.viewModel;return this.viewModel.aggregatedFeaturesEnabled&&s?.isAggregate?o`<calcite-flow-item .selected=${e} .closable=${!t} .closed=${!a} .description=${this._aggregatedFeatureCount?m(i.total??"",{total:this._aggregatedFeatureCount}):""} .heading=${i.aggregatedFeatures} @calciteFlowItemBack=${n=>{n.preventDefault(),this.viewModel.aggregatedFeaturesEnabled=!1}} .loading=${this._aggregatedFeaturesLoading} @calciteFlowItemClose=${this._handleClose}><arcgis-aggregated-features .autoDestroyDisabled=${this.autoDestroyDisabled} .feature=${s??void 0} .flowItems=${this.flowItems} .map=${this.map??void 0} .messages=${i} @arcgisPropertyChange=${this._handleAggregatedFeaturesPropertyChange} .spatialReference=${this.spatialReference??void 0} .timeZone=${this.timeZone??void 0} .view=${this.view??void 0} ${g(this._aggregatedFeaturesComponent)}></arcgis-aggregated-features><calcite-button appearance=transparent @click=${()=>this.viewModel.aggregatedFeaturesEnabled=!1} slot=footer-start scale=s width=full>${i.back}</calcite-button></calcite-flow-item>`:null}_renderActionBar(){let e=this.viewModel.selectedFeatureItem?.isFeatureFromTable,t=this.viewModel.allActions.toArray(),a=e&&!this.location?t.filter(s=>s.id!==this._zoomToFeature.id):t,i=!!a.length||this._hasActionsStartSlotContent||this._hasActionsEndSlotContent;return!this._isCollapsed&&!this.hideActionBar&&i?o`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><slot name=actions-start @slotchange=${this._handleActionsStartSlotChange}></slot><calcite-action-group overlay-positioning=fixed scale=s ${g(this._actionBarMenuNode)}>${this._renderActions(a)}</calcite-action-group><slot name=actions-end @slotchange=${this._handleActionsEndSlotChange}></slot></calcite-action-bar>`:null}_renderActions(e){return e.map(t=>{let a=this._getActionTitle(t);return o`<calcite-action .active=${t.type==="toggle"?t.value:!1} .disabled=${t.disabled} .icon=${t.icon??void 0} .loading=${t.active} scale=s .textEnabled=${!this._hideActionText} .text=${a??""} title=${a??p} .hidden=${!t.visible} @click=${()=>this._triggerAction(t)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureItem:t}=this.viewModel;return t?o`<arcgis-feature-next .autoDestroyDisabled=${this.autoDestroyDisabled} .chartAnimationDisabled=${this.chartAnimationDisabled} .defaultPopupTemplateEnabled=${this.defaultPopupTemplateEnabled} .flowItems=${this.flowItems} .graphic=${t.graphic} .headingLevel=${this.headingLevel+1} .hideAttachmentsContent=${this.hideAttachmentsContent} .hideContent=${this.hideContent} .hideCustomContent=${this.hideCustomContent} .hideExpressionContent=${this.hideExpressionContent} .hideFieldsContent=${this.hideFieldsContent} hide-heading .hideLastEditedInfo=${this.hideLastEditedInfo} .hideMediaContent=${this.hideMediaContent} .hideTextContent=${this.hideTextContent} .location=${this.location} .map=${this.map} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${g(this._selectedFeatureComponent)}></arcgis-feature-next>`:typeof e=="string"?E(e,o`<div .innerHTML=${M.sanitize(e)??""}></div>`):e??null}};R("arcgis-features-next",N);return N},"support/actions/ActionButton","core/Collection","popup/Features","applications/Components/featureUtils","applications/Components/sanitizerUtils","applications/Components/stringUtils","intl","core/reactiveUtils",a,c,d,e,f,h,i,j)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as R}from"./NQSW6QJ6.js";import{a as h}from"./VJVKFKSG.js";import e from"./6IEKX6LJ.js";import{a as y}from"./KPOSO4HB.js";import{a as $}from"./JD74LG7K.js";import d from"./R5NVFWFA.js";import c from"./GPVFCWMU.js";import{h as S}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{d as M}from"./DU6OKLV4.js";import{N as _,O as v,P as w,R as f,S as b,U as x,a as p,b as o,x as m}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([E,{isAbortError:T},{substitute:k},{watch:u,on:A},,,{a:a},C])=>{var L=p`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__heading{word-break:break-word}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}.esri-hidden{display:none!important}:host{width:240px}.root{--arcgis-internal-search-width: 240px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;width:100%}.dropdown{--calcite-color-border-1: var(--calcite-color-border-input);--calcite-dropdown-width: var(--arcgis-internal-search-width);width:31px}.dropdown calcite-button{--calcite-offset-invert-focus: 1}.autocomplete{flex:1}.container{display:flex;position:relative;flex:1 0 100%;flex-flow:row nowrap;align-items:stretch}.form{display:flex;flex:1 0;flex-flow:row nowrap;align-items:stretch;margin:0;padding:0}.submit-button{position:absolute;margin:-1px;border-width:0;padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;clip:rect(0,0,0,0)}`,z=C(E);function D(n){return typeof n=="object"&&n!==null&&"openPopup"in n&&"closePopup"in n}var g=class extends v{constructor(){super(...arguments),this.viewModel=z(this),this._currentLocationValue="search-use-current-location",this._autocompleteEl=void 0,this._searchResultRendererEl=void 0,this._searchResultRendererContentEl=void 0,this._suggestController=void 0,this._searchController=void 0,this._lastSearchTerm="",this._handleSelectResult=e=>{let{name:t}=e.detail.result;this._selectedMessage=k(this.messages.resultSelected,{resultName:t})},this.messages=y({blocking:!0}),this._locateFailed=!1,this._showNoResults=!1,this.view=this.viewModel.view,this.goToOverride=this.viewModel.goToOverride,this.icon="search",this.hideSourcesMenu=!1,this.activeMenu="none",this.activeSourceIndex=this.viewModel.activeSourceIndex,this.allPlaceholder=this.viewModel.allPlaceholder,this.allSources=this.viewModel.allSources,this.autoNavigateDisabled=this.viewModel.autoNavigate,this.autoSelectDisabled=this.viewModel.autoSelect,this.defaultSources=this.viewModel.defaultSources,this.disabled=!1,this.includeDefaultSourcesDisabled=this.viewModel.includeDefaultSources,this.locationDisabled=this.viewModel.locationEnabled,this.maxResults=this.viewModel.maxResults,this.maxSuggestions=this.viewModel.maxSuggestions,this.minSuggestCharacters=this.viewModel.minSuggestCharacters,this.popupDisabled=this.viewModel.popupEnabled,this.popupTemplate=this.viewModel.popupTemplate,this.portal=this.viewModel.portal,this.resultGraphic=this.viewModel.resultGraphic,this.resultGraphicDisabled=this.viewModel.resultGraphicEnabled,this.results=this.viewModel.results,this.searchAllDisabled=this.viewModel.searchAllEnabled,this.searchTerm=this.viewModel.searchTerm,this.selectedResult=this.viewModel.selectedResult,this.sources=this.viewModel.sources,this.suggestions=this.viewModel.suggestions,this.suggestionsDisabled=this.viewModel.suggestionsEnabled,this.topLayerDisabled=!1,this.autoDestroyDisabled=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=S()("state"),this.arcgisReady=m(),this.arcgisSearchClear=a(()=>this.viewModel,"search-clear"),this.arcgisSearchComplete=a(()=>this.viewModel,"search-complete"),this.arcgisSearchStart=a(()=>this.viewModel,"search-start"),this.arcgisSelectResult=a(()=>this.viewModel,"select-result"),this.arcgisSuggestComplete=a(()=>this.viewModel,"suggest-complete"),this.arcgisSuggestStart=a(()=>this.viewModel,"suggest-start")}static{this.properties={_selectedMessage:16,messages:16,_locateFailed:16,_showNoResults:16,_isDisabled:16,_showCurrentLocation:16,_effectiveActiveMenu:16,view:0,referenceElement:1,goToOverride:0,icon:1,hideSourcesMenu:5,activeMenu:1,activeSource:32,activeSourceIndex:9,allPlaceholder:1,allSources:0,autoNavigateDisabled:5,autoSelectDisabled:5,defaultSources:0,disabled:5,includeDefaultSourcesDisabled:5,locationDisabled:5,maxResults:9,maxSuggestions:9,minSuggestCharacters:9,popupDisabled:5,popupTemplate:0,portal:0,resultGraphic:0,resultGraphicDisabled:5,results:0,searchAllDisabled:5,searchTerm:1,selectedResult:0,sources:0,suggestions:32,suggestionsDisabled:5,topLayerDisabled:5,autoDestroyDisabled:5,messageOverrides:0,label:1,state:32}}static{this.styles=[L,R]}get _isDisabled(){let{state:e}=this.viewModel;return e==="disabled"||e==="loading"||this.disabled}get _showCurrentLocation(){return!this.locationDisabled&&!this.searchTerm?.trim()}get _effectiveActiveMenu(){return this._isDisabled?"none":this.activeMenu}get activeSource(){return this.viewModel?.activeSource}clear(){this._locateFailed=!1,this._selectedMessage=void 0,this.viewModel.clear()}async destroy(){this._closePopup(this.viewModel.resultGraphic),this._cancelQueries(),await this._searchResultRendererEl?.destroy(),await this._searchResultRendererContentEl?.destroy(),await this.manager.destroy()}async search(e){this._cancelQueries();let t=new AbortController,{signal:i}=t;this._searchController=t;try{let s=await this.viewModel.search(e,{signal:i});return this._searchController!==t?void 0:(s?.numResults||(this._showNoResults=!0,this.activeMenu="suggestion"),this._searchController=void 0,s)}catch{if(this._searchController!==t)return;this._searchController=void 0;return}}async setFocus(){await this._autocompleteEl?.setFocus()}async suggest(e){this._cancelSuggest();let t=new AbortController,{signal:i}=t;this._suggestController=t;try{let s=await this.viewModel.suggest(e,null,{signal:i});return this._suggestController!==t?void 0:(this._suggestController=void 0,s?.numResults&&(this.activeMenu="suggestion",this._scrollToTopSuggestion()),s)}catch{return this._suggestController!==t||(this._suggestController=void 0),null}}loaded(){this.listen("arcgisSelectResult",this._handleSelectResult),this.manager.onLifecycle(()=>[u(()=>[this._searchResultRendererEl,this.viewModel?.defaultPopupTemplate],()=>{let e=this.viewModel?.defaultPopupTemplate,{_searchResultRendererEl:t}=this;if(e&&t){let i=document.createElement("div");i.appendChild(t),e.content=i,this._searchResultRendererContentEl=t}},{initial:!0}),u(()=>this.messages,e=>this.viewModel.messages=e,{initial:!0}),u(()=>this.viewModel?.resultGraphic,(e,t)=>this._closePopup(t)),A(()=>this.viewModel,"select-result",e=>{let{popupEnabled:t}=e;t&&this._openPopup()})])}_addSearchResultRenderer(){this._searchResultRendererEl=b(o`<arcgis-search-result-renderer auto-destroy-disabled .messages=${this.messages} .viewModel=${this.viewModel}></arcgis-search-result-renderer>`)}_closePopup(e){let{referenceElement:t,view:i}=this;D(t)&&t.popupElement?.selectedFeature===e?t?.closePopup():i?.popup?.selectedFeature===e&&i?.closePopup()}_openPopup(){if(D(this.referenceElement)){let{resultGraphic:e,resultLocation:t}=this.viewModel,i={features:e?[e]:[],location:t};this.referenceElement?.openPopup(i)}else if(this.view){let{resultGraphic:e,resultLocation:t}=this.viewModel;this.view.openPopup({features:e?[e]:[],location:t})}}_handleInputKeydown(e){e.key==="Tab"&&this._cancelSuggest()}_handleAutocompleteCreate(e){this._autocompleteEl=e}_handleCalciteAutocompleteTextInput(e){let t=e.target.inputValue;t!==this.viewModel.searchTerm&&(this.viewModel.searchTerm=t,t||this.clear(),this.suggest())}_handleAutocompleteOpen(){this.activeMenu="suggestion"}_handleAutocompleteClose(){this.activeMenu==="suggestion"&&(this.activeMenu="none")}_handleCalciteAutocompleteChange(e){let t=e.target.value;if(t===this._currentLocationValue){this._useCurrentLocation();return}let i=JSON.parse(t),s=this.viewModel.suggestions?.find(({sourceIndex:r})=>r===i.sourceIndex)?.results?.find(({key:r})=>`${r}`==`${i.key}`);s&&this.search(s)}async _useCurrentLocation(){this._cancelQueries();let e=new AbortController,{signal:t}=e;this._searchController=e;try{await this.viewModel.searchNearby({signal:t})}catch(i){T(i)||(this._locateFailed=!0,this.activeMenu="suggestion")}finally{this._searchController=void 0}}_handleSourceOpen(){this.activeMenu="source"}_handleSourceClose(){this.activeMenu==="source"&&(this.activeMenu="none")}_handleSourceSelect(e){let t=e.target.selectedItems[0].getAttribute("data-source-index");t&&(this.viewModel.activeSourceIndex=Number.parseInt(t,10))}_cancelSuggest(){this.activeMenu="none",this._locateFailed=!1,this._showNoResults=!1,this._suggestController=h(this._suggestController)}_cancelQueries(){this._cancelSuggest(),this._searchController=h(this._searchController)}_scrollToTopSuggestion(){this._autocompleteEl?.scrollContentTo({top:0})}_formSubmit(e){e.preventDefault(),this.activeMenu="none",this._lastSearchTerm=this.searchTerm,this.searchTerm&&this.search()}_getSourceName(e){let{messages:t}=this,{allSources:i}=this.viewModel,s=i.at(e);return(e===-1?t.all:s?.name||t.untitledSource)||""}render(){return this._addSearchResultRenderer(),o`<div class=${w(M("root",$.widget))}><div class="sr-only" aria-live=polite>${this._selectedMessage}</div><div class="container">${this._renderSourcesMenu()}${this._renderForm()}</div></div>`}_renderSourcesMenu(){let{hideSourcesMenu:e,messages:t,_isDisabled:i,_effectiveActiveMenu:s}=this,{allSources:r,searchAllEnabled:l}=this.viewModel;return r.length>1&&!e?o`<calcite-dropdown class="dropdown" .disabled=${i} .open=${s==="source"} overlay-positioning=fixed .topLayerDisabled=${this.topLayerDisabled} @calciteDropdownClose=${this._handleSourceClose} @calciteDropdownOpen=${this._handleSourceOpen} @calciteDropdownSelect=${this._handleSourceSelect}><calcite-button appearance=outline-fill icon-start=caret-down kind=neutral .label=${t.searchIn} slot=trigger></calcite-button><calcite-dropdown-group .groupTitle=${t.searchIn}>${l?this._renderSource(-1):null}${r.map((c,d)=>this._renderSource(d)).toArray()}</calcite-dropdown-group></calcite-dropdown>`:null}_renderUseCurrentLocation(){let{_currentLocationValue:e}=this;return o`<calcite-autocomplete-item .heading=${this.messages.useCurrentLocation??""} icon-start=gps-on .value=${e}></calcite-autocomplete-item>`}_renderAutocomplete(){let{_effectiveActiveMenu:e,messages:t,_isDisabled:i}=this,{maxInputLength:s,placeholder:r,searchTerm:l,state:c}=this.viewModel,d=this.label??t.searchButtonTitle??"";return o`<calcite-autocomplete autocomplete=off class="autocomplete" .disabled=${i} .icon=${this.icon||void 0} .inputValue=${l} .label=${d} .loading=${c==="searching"} .maxLength=${s} .name=${this.el.id} @keydown=${this._handleInputKeydown} .open=${e==="suggestion"} overlay-positioning=fixed .placeholder=${r} .topLayerDisabled=${this.topLayerDisabled} title=${(l?"":r)??f} @calciteAutocompleteChange=${this._handleCalciteAutocompleteChange} @calciteAutocompleteClose=${this._handleAutocompleteClose} @calciteAutocompleteOpen=${this._handleAutocompleteOpen} @calciteAutocompleteTextChange=${this._handleCalciteAutocompleteTextInput} @calciteAutocompleteTextInput=${this._handleCalciteAutocompleteTextInput} ${_(this._handleAutocompleteCreate)}>${this._renderSuggestions()}${this._renderNotices()}</calcite-autocomplete>`}_renderForm(){return o`<form class="form" @submit=${this._formSubmit} role=search>${this._renderAutocomplete()}<button class="submit-button" type=submit>${this.label??this.messages.searchButtonTitle??""}</button></form>`}_renderSuggestGroup(e){return e.results?.map(t=>this._renderSuggestion(t))}_renderSuggestions(){let{suggestions:e}=this.viewModel;return this._showNoResults?null:this._showCurrentLocation?this._renderUseCurrentLocation():e?.map(t=>this._renderSuggestResults(t))}_renderSuggestResults(e){let{allSources:t,activeSourceIndex:i}=this.viewModel,{sourceIndex:s}=e,r=e.results?.length,l=t.length>1&&i===-1,c=this._getSourceName(s);return r&&l?o`<calcite-autocomplete-item-group .heading=${c}>${this._renderSuggestGroup(e)}</calcite-autocomplete-item-group>`:this._renderSuggestGroup(e)}_renderSuggestion(e){let{key:t,sourceIndex:i,text:s}=e,r={key:t,sourceIndex:i};return o`<calcite-autocomplete-item .heading=${s??this.messages.untitledResult??""} .value=${JSON.stringify(r)} .selected=${e===this.viewModel.selectedSuggestion}></calcite-autocomplete-item>`}_renderSource(e){let t=this._getSourceName(e);return o`<calcite-dropdown-item data-source-index=${`${e}`} .selected=${e===this.viewModel.activeSourceIndex}>${t}</calcite-dropdown-item>`}_renderNoResultsWarning(e){let{messages:t}=this,i=e?k(t.noResultsFoundForValue??"",{value:`"${e}"`}):t.noResultsFound;return o`<calcite-notice icon=exclamation-mark-triangle kind=warning open slot=content-bottom><div slot=title>${t.noResults}</div><div slot=message>${i}</div></calcite-notice>`}_renderLocateError(){return o`<calcite-notice icon=exclamation-mark-circle kind=danger open slot=content-bottom><div slot=message>${this.messages.locateError}</div></calcite-notice>`}_renderNotices(){return this._locateFailed?this._renderLocateError():this._showNoResults?this._renderNoResultsWarning(this._lastSearchTerm??this.viewModel.searchTerm):null}};x("arcgis-search",g);return g},"widgets/Search/SearchViewModel","core/promiseUtils","intl","core/reactiveUtils",a,c,d,e)
|
|
2
|
+
import{a as R}from"./NQSW6QJ6.js";import{a as h}from"./VJVKFKSG.js";import e from"./J5WF4RA3.js";import{a as y}from"./I5OLG552.js";import{a as $}from"./JD74LG7K.js";import d from"./BPXDBUNH.js";import c from"./GSI2ZI7D.js";import{g as S}from"./BD27PEC7.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{d as M}from"./DU6OKLV4.js";import{N as _,O as v,P as w,R as f,S as b,U as x,a as p,b as o,x as m}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([E,{isAbortError:T},{substitute:k},{watch:u,on:A},,,{a:a},C])=>{var L=p`.esri-widget__heading{color:var(--calcite-color-text-2);margin:0 0 .5rem;font-weight:var(--calcite-font-weight-semibold)}h1.esri-widget__heading{font-size:var(--calcite-font-size-xl)}h2.esri-widget__heading{font-size:var(--calcite-font-size-md)}h3.esri-widget__heading,h4.esri-widget__heading,h5.esri-widget__heading,h6.esri-widget__heading{font-size:var(--calcite-font-size)}.esri-widget{box-sizing:border-box;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);font-size:var(--calcite-font-size);line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget *,.esri-widget :before,.esri-widget :after{box-sizing:inherit}.esri-widget.esri-widget--disabled>*{opacity:.4;pointer-events:none}.esri-widget.esri-widget--compact{--esri-widget-padding-y: 0;--esri-widget-padding-x: 0}.esri-widget__anchor{color:var(--calcite-color-text-2)}.esri-widget__anchor:hover{color:var(--calcite-color-text-3)}.esri-widget__anchor:hover,.esri-widget__anchor:focus{text-decoration:underline}.esri-widget__anchor--disabled{opacity:.4;pointer-events:none}.esri-widget__header{background-color:var(--calcite-color-foreground-1);flex:1 0 100%;justify-content:space-between;align-items:center;width:100%;min-height:48px;padding:12px 0 12px 15px;display:flex}.esri-widget__heading{word-break:break-word}.esri-widget__header .esri-widget__heading{width:calc(100% - 48px);text-align:initial;color:var(--calcite-color-text-1);align-items:center;margin:0;padding:0;display:flex}.esri-widget__header-button{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background-color:var(--calcite-color-foreground-1);border:none;flex:0 0 48px;justify-content:center;align-self:stretch;align-items:center;width:48px;padding:0;display:flex}.esri-widget__footer{background-color:var(--calcite-color-foreground-1);justify-content:center;align-items:center;width:100%;min-height:48px;display:flex}.esri-widget__footer-pagination{color:var(--calcite-color-text-2);justify-content:space-between;align-items:center;display:flex}.esri-widget__footer-pagination-previous-button,.esri-widget__footer-pagination-next-button{cursor:pointer;background-color:var(--calcite-color-foreground-1);border:0;margin:0 7px;padding:12px 15px;transition:background-color .125s ease-in-out}.esri-widget__footer-pagination-previous-button:hover,.esri-widget__footer-pagination-previous-button:focus,.esri-widget__footer-pagination-next-button:hover,.esri-widget__footer-pagination-next-button:focus{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1)}.esri-menu{visibility:hidden;z-index:1;background-clip:padding;background-color:var(--calcite-color-foreground-1);background-clip:padding-box;width:100%;max-height:0;margin:2px 0 0;padding:0;font-size:var(--calcite-font-size);line-height:var(--calcite-spacing-xl);position:absolute;top:100%;left:0;overflow:hidden;box-shadow:0 1px 2px #0000004d}.esri-menu .esri-menu__header{color:var(--calcite-color-text-inverse);background-color:var(--calcite-color-inverse);padding:6px 12px}.esri-menu__list{margin:0;padding:0;list-style:none}.esri-menu__list-item{cursor:pointer;border-top:1px solid #adadad4d;border-left:3px solid #0000;padding:.8em 1em}.esri-menu__list-item [class^=esri-icon-],.esri-menu__list-item [class*=" esri-icon-"]{padding-right:2.8px}.esri-menu__list-item:first-child{border-top:none}.esri-menu__list-item--focus,.esri-menu__list-item:hover,.esri-menu__list-item:focus{background-color:var(--calcite-color-foreground-1)}.esri-menu__list-item:active{background-color:var(--calcite-color-foreground-current)}.esri-menu__list-item--active,.esri-menu__list-item--active:hover,.esri-menu__list-item--active:focus{background-color:var(--calcite-color-foreground-1);border-left-color:var(--calcite-color-brand)}.esri-widget__table{border-collapse:collapse;color:var(--calcite-color-text-1);border:none;width:100%;line-height:var(--calcite-font-line-height-relative-tight)}.esri-widget__table tr:nth-child(odd){background-color:var(--calcite-color-transparent)}.esri-widget__table tr:nth-child(2n){background-color:var(--calcite-color-transparent-press)}.esri-widget__table tr a{color:var(--calcite-color-text-2)}.esri-widget__table tr a:hover,.esri-widget__table tr a:focus{color:var(--calcite-color-text-1)}.esri-widget__table tr td,.esri-widget__table tr th{vertical-align:top;word-break:break-word;padding:.5em .7em;font-size:var(--calcite-font-size-sm);font-weight:var(--calcite-font-weight-regular)}.esri-widget__table tr th{text-align:left;border-right:3px solid #0000000d;width:50%}.esri-widget__table tr td{width:50%}.esri-input{color:var(--calcite-color-text-1);background-color:var(--calcite-color-foreground-1);border:1px solid #959595;font-size:var(--calcite-font-size)}.esri-input::-ms-clear{display:none}.esri-input::placeholder{opacity:1;color:var(--calcite-color-text-2)}.esri-input:placeholder-shown{text-overflow:ellipsis}.esri-input[type=text],.esri-input[type=password],.esri-input[type=number]{height:32px;padding:0 .5em}calcite-combobox.esri-input{border:none}.esri-widget__content--empty{text-align:center;color:var(--calcite-color-border-input);flex-flow:column wrap;align-items:center;padding:18px 22px;display:flex}.esri-widget__content--empty h1.esri-widget__heading,.esri-widget__content--empty h2.esri-widget__heading,.esri-widget__content--empty h3.esri-widget__heading,.esri-widget__content--empty h4.esri-widget__heading,.esri-widget__content--empty h5.esri-widget__heading{font-weight:var(--calcite-font-weight-regular)}.esri-widget__content-illustration--empty{width:128px;padding:1rem 0}.esri-widget__content-icon--empty{width:32px;padding:.5rem 0}.esri-select{appearance:none;cursor:pointer;color:var(--calcite-color-text-2);background:var(--calcite-color-foreground-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-8 -8 32 32' width='32' height='32'%3E%3Cpath d='M8 11.207l-4-4V5.793l4 4 4-4v1.414z' fill='%23adadad' fillrule='nonzero'/%3E%3C/svg%3E") 100% no-repeat;border:1px solid #959595;border-radius:0;width:100%;height:32px;margin:0;padding:0 .5em;font-family:inherit;font-size:.85em;display:block}.esri-select[disabled]{cursor:auto}.esri-select::-ms-expand{display:none}.esri-disabled a,.esri-disabled [role=menu],.esri-disabled [role=checkbox],.esri-disabled [class^=esri-icon-],.esri-disabled [class*=" esri-icon-"]{color:var(--calcite-color-text-3)}.keynav-mode .esri-widget:focus,.keynav-mode .esri-widget :focus{z-index:1;outline-offset:2px;outline:2px solid #adadad}.esri-widget__loader-animation{border:.15em solid #adadad4d;border-top-color:var(--calcite-color-border-input);border-radius:100%;width:1em;height:1em;font-size:var(--calcite-font-size-md);animation:1.25s linear infinite esri-rotate;display:block;transform:translateZ(0)}:dir(rtl) .esri-widget__table th{text-align:right;border-left:3px solid #0000000d;border-right:none}:dir(rtl) .esri-select{background-position:0}:dir(rtl) .esri-menu__list-item{border-left:none;border-right:3px solid #0000}:dir(rtl) .esri-menu__list-item [class^=esri-icon-],:dir(rtl) .esri-menu__list-item [class*=" esri-icon-"]{padding-left:2px;padding-right:0}:dir(rtl) .esri-menu__list-item--active{border-right-color:var(--calcite-color-brand)}.esri-icon-font-fallback-text{clip:rect(0 0 0 0);width:1px;height:1px;position:absolute;overflow:hidden}.esri-rotating{animation:1.25s linear infinite esri-rotate;transform:translateZ(0)}.esri-clearfix:before,.esri-clearfix:after{content:" ";display:table}.esri-clearfix:after{clear:both}.esri-interactive{cursor:pointer}.esri-invisible{visibility:hidden!important}.esri-offscreen{position:absolute;top:-999em;left:-999em}.esri-match-height{flex-direction:column;flex:auto;display:flex;overflow:hidden}.esri-hidden{display:none!important}:host{width:240px}.root{--arcgis-internal-search-width: 240px;display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;width:100%}.dropdown{--calcite-color-border-1: var(--calcite-color-border-input);--calcite-dropdown-width: var(--arcgis-internal-search-width);width:31px}.dropdown calcite-button{--calcite-offset-invert-focus: 1}.autocomplete{flex:1}.container{display:flex;position:relative;flex:1 0 100%;flex-flow:row nowrap;align-items:stretch}.form{display:flex;flex:1 0;flex-flow:row nowrap;align-items:stretch;margin:0;padding:0}.submit-button{position:absolute;margin:-1px;border-width:0;padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;clip:rect(0,0,0,0)}`,z=C(E);function D(n){return typeof n=="object"&&n!==null&&"openPopup"in n&&"closePopup"in n}var g=class extends v{constructor(){super(...arguments),this.viewModel=z(this),this._currentLocationValue="search-use-current-location",this._autocompleteEl=void 0,this._searchResultRendererEl=void 0,this._searchResultRendererContentEl=void 0,this._suggestController=void 0,this._searchController=void 0,this._lastSearchTerm="",this._handleSelectResult=e=>{let{name:t}=e.detail.result;this._selectedMessage=k(this.messages.resultSelected,{resultName:t})},this.messages=y({blocking:!0}),this._locateFailed=!1,this._showNoResults=!1,this.view=this.viewModel.view,this.goToOverride=this.viewModel.goToOverride,this.icon="search",this.hideSourcesMenu=!1,this.activeMenu="none",this.activeSourceIndex=this.viewModel.activeSourceIndex,this.allPlaceholder=this.viewModel.allPlaceholder,this.allSources=this.viewModel.allSources,this.autoNavigateDisabled=this.viewModel.autoNavigate,this.autoSelectDisabled=this.viewModel.autoSelect,this.defaultSources=this.viewModel.defaultSources,this.disabled=!1,this.includeDefaultSourcesDisabled=this.viewModel.includeDefaultSources,this.locationDisabled=this.viewModel.locationEnabled,this.maxResults=this.viewModel.maxResults,this.maxSuggestions=this.viewModel.maxSuggestions,this.minSuggestCharacters=this.viewModel.minSuggestCharacters,this.popupDisabled=this.viewModel.popupEnabled,this.popupTemplate=this.viewModel.popupTemplate,this.portal=this.viewModel.portal,this.resultGraphic=this.viewModel.resultGraphic,this.resultGraphicDisabled=this.viewModel.resultGraphicEnabled,this.results=this.viewModel.results,this.searchAllDisabled=this.viewModel.searchAllEnabled,this.searchTerm=this.viewModel.searchTerm,this.selectedResult=this.viewModel.selectedResult,this.sources=this.viewModel.sources,this.suggestions=this.viewModel.suggestions,this.suggestionsDisabled=this.viewModel.suggestionsEnabled,this.topLayerDisabled=!1,this.autoDestroyDisabled=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=S()("state"),this.arcgisReady=m(),this.arcgisSearchClear=a(()=>this.viewModel,"search-clear"),this.arcgisSearchComplete=a(()=>this.viewModel,"search-complete"),this.arcgisSearchStart=a(()=>this.viewModel,"search-start"),this.arcgisSelectResult=a(()=>this.viewModel,"select-result"),this.arcgisSuggestComplete=a(()=>this.viewModel,"suggest-complete"),this.arcgisSuggestStart=a(()=>this.viewModel,"suggest-start")}static{this.properties={_selectedMessage:16,messages:16,_locateFailed:16,_showNoResults:16,_isDisabled:16,_showCurrentLocation:16,_effectiveActiveMenu:16,view:0,referenceElement:1,goToOverride:0,icon:1,hideSourcesMenu:5,activeMenu:1,activeSource:32,activeSourceIndex:9,allPlaceholder:1,allSources:0,autoNavigateDisabled:5,autoSelectDisabled:5,defaultSources:0,disabled:5,includeDefaultSourcesDisabled:5,locationDisabled:5,maxResults:9,maxSuggestions:9,minSuggestCharacters:9,popupDisabled:5,popupTemplate:0,portal:0,resultGraphic:0,resultGraphicDisabled:5,results:0,searchAllDisabled:5,searchTerm:1,selectedResult:0,sources:0,suggestions:32,suggestionsDisabled:5,topLayerDisabled:5,autoDestroyDisabled:5,messageOverrides:0,label:1,state:32}}static{this.styles=[L,R]}get _isDisabled(){let{state:e}=this.viewModel;return e==="disabled"||e==="loading"||this.disabled}get _showCurrentLocation(){return!this.locationDisabled&&!this.searchTerm?.trim()}get _effectiveActiveMenu(){return this._isDisabled?"none":this.activeMenu}get activeSource(){return this.viewModel?.activeSource}clear(){this._locateFailed=!1,this._selectedMessage=void 0,this.viewModel.clear()}async destroy(){this._closePopup(this.viewModel.resultGraphic),this._cancelQueries(),await this._searchResultRendererEl?.destroy(),await this._searchResultRendererContentEl?.destroy(),await this.manager.destroy()}async search(e){this._cancelQueries();let t=new AbortController,{signal:i}=t;this._searchController=t;try{let s=await this.viewModel.search(e,{signal:i});return this._searchController!==t?void 0:(s?.numResults||(this._showNoResults=!0,this.activeMenu="suggestion"),this._searchController=void 0,s)}catch{if(this._searchController!==t)return;this._searchController=void 0;return}}async setFocus(){await this._autocompleteEl?.setFocus()}async suggest(e){this._cancelSuggest();let t=new AbortController,{signal:i}=t;this._suggestController=t;try{let s=await this.viewModel.suggest(e,null,{signal:i});return this._suggestController!==t?void 0:(this._suggestController=void 0,s?.numResults&&(this.activeMenu="suggestion",this._scrollToTopSuggestion()),s)}catch{return this._suggestController!==t||(this._suggestController=void 0),null}}loaded(){this.listen("arcgisSelectResult",this._handleSelectResult),this.manager.onLifecycle(()=>[u(()=>[this._searchResultRendererEl,this.viewModel?.defaultPopupTemplate],()=>{let e=this.viewModel?.defaultPopupTemplate,{_searchResultRendererEl:t}=this;if(e&&t){let i=document.createElement("div");i.appendChild(t),e.content=i,this._searchResultRendererContentEl=t}},{initial:!0}),u(()=>this.messages,e=>this.viewModel.messages=e,{initial:!0}),u(()=>this.viewModel?.resultGraphic,(e,t)=>this._closePopup(t)),A(()=>this.viewModel,"select-result",e=>{let{popupEnabled:t}=e;t&&this._openPopup()})])}_addSearchResultRenderer(){this._searchResultRendererEl=b(o`<arcgis-search-result-renderer auto-destroy-disabled .messages=${this.messages} .viewModel=${this.viewModel}></arcgis-search-result-renderer>`)}_closePopup(e){let{referenceElement:t,view:i}=this;D(t)&&t.popupElement?.selectedFeature===e?t?.closePopup():i?.popup?.selectedFeature===e&&i?.closePopup()}_openPopup(){if(D(this.referenceElement)){let{resultGraphic:e,resultLocation:t}=this.viewModel,i={features:e?[e]:[],location:t};this.referenceElement?.openPopup(i)}else if(this.view){let{resultGraphic:e,resultLocation:t}=this.viewModel;this.view.openPopup({features:e?[e]:[],location:t})}}_handleInputKeydown(e){e.key==="Tab"&&this._cancelSuggest()}_handleAutocompleteCreate(e){this._autocompleteEl=e}_handleCalciteAutocompleteTextInput(e){let t=e.target.inputValue;t!==this.viewModel.searchTerm&&(this.viewModel.searchTerm=t,t||this.clear(),this.suggest())}_handleAutocompleteOpen(){this.activeMenu="suggestion"}_handleAutocompleteClose(){this.activeMenu==="suggestion"&&(this.activeMenu="none")}_handleCalciteAutocompleteChange(e){let t=e.target.value;if(t===this._currentLocationValue){this._useCurrentLocation();return}let i=JSON.parse(t),s=this.viewModel.suggestions?.find(({sourceIndex:r})=>r===i.sourceIndex)?.results?.find(({key:r})=>`${r}`==`${i.key}`);s&&this.search(s)}async _useCurrentLocation(){this._cancelQueries();let e=new AbortController,{signal:t}=e;this._searchController=e;try{await this.viewModel.searchNearby({signal:t})}catch(i){T(i)||(this._locateFailed=!0,this.activeMenu="suggestion")}finally{this._searchController=void 0}}_handleSourceOpen(){this.activeMenu="source"}_handleSourceClose(){this.activeMenu==="source"&&(this.activeMenu="none")}_handleSourceSelect(e){let t=e.target.selectedItems[0].getAttribute("data-source-index");t&&(this.viewModel.activeSourceIndex=Number.parseInt(t,10))}_cancelSuggest(){this.activeMenu="none",this._locateFailed=!1,this._showNoResults=!1,this._suggestController=h(this._suggestController)}_cancelQueries(){this._cancelSuggest(),this._searchController=h(this._searchController)}_scrollToTopSuggestion(){this._autocompleteEl?.scrollContentTo({top:0})}_formSubmit(e){e.preventDefault(),this.activeMenu="none",this._lastSearchTerm=this.searchTerm,this.searchTerm&&this.search()}_getSourceName(e){let{messages:t}=this,{allSources:i}=this.viewModel,s=i.at(e);return(e===-1?t.all:s?.name||t.untitledSource)||""}render(){return this._addSearchResultRenderer(),o`<div class=${w(M("root",$.widget))}><div class="sr-only" aria-live=polite>${this._selectedMessage}</div><div class="container">${this._renderSourcesMenu()}${this._renderForm()}</div></div>`}_renderSourcesMenu(){let{hideSourcesMenu:e,messages:t,_isDisabled:i,_effectiveActiveMenu:s}=this,{allSources:r,searchAllEnabled:l}=this.viewModel;return r.length>1&&!e?o`<calcite-dropdown class="dropdown" .disabled=${i} .open=${s==="source"} overlay-positioning=fixed .topLayerDisabled=${this.topLayerDisabled} @calciteDropdownClose=${this._handleSourceClose} @calciteDropdownOpen=${this._handleSourceOpen} @calciteDropdownSelect=${this._handleSourceSelect}><calcite-button appearance=outline-fill icon-start=caret-down kind=neutral .label=${t.searchIn} slot=trigger></calcite-button><calcite-dropdown-group .groupTitle=${t.searchIn}>${l?this._renderSource(-1):null}${r.map((c,d)=>this._renderSource(d)).toArray()}</calcite-dropdown-group></calcite-dropdown>`:null}_renderUseCurrentLocation(){let{_currentLocationValue:e}=this;return o`<calcite-autocomplete-item .heading=${this.messages.useCurrentLocation??""} icon-start=gps-on .value=${e}></calcite-autocomplete-item>`}_renderAutocomplete(){let{_effectiveActiveMenu:e,messages:t,_isDisabled:i}=this,{maxInputLength:s,placeholder:r,searchTerm:l,state:c}=this.viewModel,d=this.label??t.searchButtonTitle??"";return o`<calcite-autocomplete autocomplete=off class="autocomplete" .disabled=${i} .icon=${this.icon||void 0} .inputValue=${l} .label=${d} .loading=${c==="searching"} .maxLength=${s} .name=${this.el.id} @keydown=${this._handleInputKeydown} .open=${e==="suggestion"} overlay-positioning=fixed .placeholder=${r} .topLayerDisabled=${this.topLayerDisabled} title=${(l?"":r)??f} @calciteAutocompleteChange=${this._handleCalciteAutocompleteChange} @calciteAutocompleteClose=${this._handleAutocompleteClose} @calciteAutocompleteOpen=${this._handleAutocompleteOpen} @calciteAutocompleteTextChange=${this._handleCalciteAutocompleteTextInput} @calciteAutocompleteTextInput=${this._handleCalciteAutocompleteTextInput} ${_(this._handleAutocompleteCreate)}>${this._renderSuggestions()}${this._renderNotices()}</calcite-autocomplete>`}_renderForm(){return o`<form class="form" @submit=${this._formSubmit} role=search>${this._renderAutocomplete()}<button class="submit-button" type=submit>${this.label??this.messages.searchButtonTitle??""}</button></form>`}_renderSuggestGroup(e){return e.results?.map(t=>this._renderSuggestion(t))}_renderSuggestions(){let{suggestions:e}=this.viewModel;return this._showNoResults?null:this._showCurrentLocation?this._renderUseCurrentLocation():e?.map(t=>this._renderSuggestResults(t))}_renderSuggestResults(e){let{allSources:t,activeSourceIndex:i}=this.viewModel,{sourceIndex:s}=e,r=e.results?.length,l=t.length>1&&i===-1,c=this._getSourceName(s);return r&&l?o`<calcite-autocomplete-item-group .heading=${c}>${this._renderSuggestGroup(e)}</calcite-autocomplete-item-group>`:this._renderSuggestGroup(e)}_renderSuggestion(e){let{key:t,sourceIndex:i,text:s}=e,r={key:t,sourceIndex:i};return o`<calcite-autocomplete-item .heading=${s??this.messages.untitledResult??""} .value=${JSON.stringify(r)} .selected=${e===this.viewModel.selectedSuggestion}></calcite-autocomplete-item>`}_renderSource(e){let t=this._getSourceName(e);return o`<calcite-dropdown-item data-source-index=${`${e}`} .selected=${e===this.viewModel.activeSourceIndex}>${t}</calcite-dropdown-item>`}_renderNoResultsWarning(e){let{messages:t}=this,i=e?k(t.noResultsFoundForValue??"",{value:`"${e}"`}):t.noResultsFound;return o`<calcite-notice icon=exclamation-mark-triangle kind=warning open slot=content-bottom><div slot=title>${t.noResults}</div><div slot=message>${i}</div></calcite-notice>`}_renderLocateError(){return o`<calcite-notice icon=exclamation-mark-circle kind=danger open slot=content-bottom><div slot=message>${this.messages.locateError}</div></calcite-notice>`}_renderNotices(){return this._locateFailed?this._renderLocateError():this._showNoResults?this._renderNoResultsWarning(this._lastSearchTerm??this.viewModel.searchTerm):null}};x("arcgis-search",g);return g},"widgets/Search/SearchViewModel","core/promiseUtils","intl","core/reactiveUtils",a,c,d,e)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as w}from"./SBUR54TP.js";import{a as b}from"./KPOSO4HB.js";import c from"./GPVFCWMU.js";import{h as $}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import"./DU6OKLV4.js";import{M as _,N as M,O as v,Q as u,R as g,U as f,V as y,a as p,b as r,x as S}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([{watch:T},R,,{a:L}])=>{var m=new Set(["ar-iq","ar-kw","bg-bg","cs-cz","da-dk","da-gl","de-at","de-ch","de-de","de-li","el-gr","en-ae","en-au","en-ca","en-eg","en-gb","en-hk","en-id","en-ie","en-il","en-in","en-iq","en-ke","en-lu","en-mo","en-my","en-nz","en-rw","en-sg","en-us","en-vi","en-wo","en-za","es-ar","es-bo","es-cl","es-co","es-cr","es-es","es-gt","es-mx","es-ni","es-pe","es-pr","es-sv","es-ve","et-ee","fi-fi","fr-ci","fr-fr","fr-ma","fr-mg","fr-ml","fr-tn","is-is","it-it","ja-jp","ko-kr","lt-lt","lv-lv","nl-be","nl-nl","nl-sr","nn-no","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sk-sk","sv-se","th-th","zh-cn","zh-tw"]),P={ar:"iq",bg:"bg",cs:"cz",da:"dk",de:"de",el:"gr",en:"us",es:"es",et:"ee",fi:"fi",fr:"fr",is:"is",it:"it",ja:"jp",ko:"kr",lt:"lt",lv:"lv",nl:"nl",nn:"no",pl:"pl",pt:"br",ro:"ro",ru:"ru",sk:"sk",sv:"se",th:"th",zh:"cn"},k=p`:host{display:block;width:310px;max-width:100%}.slider{height:50px}.scale-indicator-container{position:relative;width:100%;margin-top:2px}.scale-indicator-icon{transform:scale(.8,1.7);margin-left:-6px;width:1px;--calcite-icon-color: var(--calcite-color-text-3)}.scale-menu-list{max-height:220px;overflow-y:auto}.scale-menu-input{max-width:120px}.scale-menu-button-container{display:flex;direction:ltr;justify-content:space-between}.scale-menu-button{min-width:0}:dir(rtl) .scale-menu-button-container>*{direction:rtl}.preview-container{padding:6px;background-color:var(--calcite-color-foreground-1);box-shadow:0 1px 2px #0000004d}`,l=[{id:"world",scale:147914382,minScale:147914382,maxScale:1e8},{id:"continent",scale:5e7,minScale:99999999,maxScale:35e6},{id:"countriesBig",scale:25e6,minScale:34999999,maxScale:15e6},{id:"countriesSmall",scale:12e6,minScale:14999999,maxScale:7e6},{id:"statesProvinces",scale:6e6,minScale:6999999,maxScale:4e6},{id:"stateProvince",scale:3e6,minScale:3999999,maxScale:2e6},{id:"counties",scale:15e5,minScale:1999999,maxScale:1e6},{id:"county",scale:75e4,minScale:999999,maxScale:5e5},{id:"metropolitanArea",scale:32e4,minScale:499999,maxScale:25e4},{id:"cities",scale:16e4,minScale:249999,maxScale:12e4},{id:"city",scale:8e4,minScale:119999,maxScale:6e4},{id:"town",scale:4e4,minScale:59999,maxScale:3e4},{id:"neighborhood",scale:2e4,minScale:29999,maxScale:15e3},{id:"streets",scale:1e4,minScale:14999,maxScale:7500},{id:"street",scale:5e3,minScale:7499,maxScale:4e3},{id:"buildings",scale:2500,minScale:3999,maxScale:2e3},{id:"building",scale:1250,minScale:1999,maxScale:801},{id:"smallBuilding",scale:800,minScale:800,maxScale:401},{id:"rooms",scale:400,minScale:400,maxScale:101},{id:"room",scale:100,minScale:100,maxScale:0}],x=class extends v{constructor(){super(...arguments),this.messages=b(),this._sliderRef=_(),this._activeMenu=null,this._customScaleSelected=null,this._portalRegion=null,this._layerMaxScaleLimit=l[l.length-1].maxScale,this._layerMinScaleLimit=l[0].minScale,this.autoDestroyDisabled=!1,this.disabled=!1,this.hidePreview=!1,this.hideMaxScaleMenu=!1,this.hideMinScaleMenu=!1,this.icon="actual-size",this.maxScale=0,this.maxScaleLimit=l[l.length-1].maxScale,this.minScale=0,this.minScaleLimit=l[0].minScale,this.mode="range",this.showWorldValue=!1,this.view=L(this),this.arcgisChange=S(),this.arcgisInput=S(),this.arcgisPropertyChange=$()("state","minScale","maxScale"),this.arcgisReady=S()}static{this.properties={_activeMenu:16,_customScaleSelected:16,_portalRegion:16,_layerMaxScaleLimit:16,_layerMinScaleLimit:16,autoDestroyDisabled:5,disabled:7,hidePreview:5,hideMaxScaleMenu:5,hideMinScaleMenu:5,icon:1,label:1,layer:0,maxScale:9,maxScaleLimit:9,minScale:9,minScaleLimit:9,mode:1,referenceElement:1,region:1,showWorldValue:5,state:32,view:0}}static{this.styles=k}get state(){let{view:e,layer:a}=this;return!e&&!a||!e&&a?.loadStatus==="loaded"||!a&&e?.ready||e?.ready&&a?.loadStatus==="loaded"?"ready":"disabled"}async destroy(){await this.manager.destroy()}willUpdate(e){if((e.has("maxScaleLimit")||e.has("minScaleLimit"))&&(this.minScaleLimit===0&&(this.minScaleLimit=l[0].minScale),this.maxScaleLimit===0&&(this.maxScaleLimit=l[l.length-1].maxScale),this.minScaleLimit=Math.min(this.minScaleLimit,l[0].minScale),this.maxScaleLimit=Math.max(this.maxScaleLimit,l[l.length-1].maxScale),this.minScale!==0&&(this.minScale=Math.min(this.minScale,this._interactiveMinScale)),this.maxScale!==0&&(this.maxScale=Math.max(this.maxScale,this._interactiveMaxScale)),this.hasUpdated&&this._syncLayerScale()),e.has("maxScale")||e.has("minScale")){if(this.minScale!==0){let a=this._clampScale("min",this.minScale);this.minScale=a===this.minScaleLimit?0:a}if(this.maxScale!==0){let a=this._clampScale("max",this.maxScale);this.maxScale=a===this.maxScaleLimit?0:a}}e.has("layer")&&(this.layer?this.layer.load().catch(()=>{}):(this._layerMinScaleLimit=l[0].minScale,this._layerMaxScaleLimit=l[l.length-1].maxScale)),e.has("mode")&&(this.mode==="max-scale-only"?this.minScale=0:this.mode==="min-scale-only"&&(this.maxScale=0),e.get("mode")!==void 0&&this._syncLayerScale())}loaded(){R.getDefault().load().then(e=>{let a=e.user?.culture??e.culture;a&&(this._portalRegion=a.split("-")[1]?.toLowerCase()??null)}).catch(()=>{}),this.manager.onLifecycle(()=>[T(()=>this.view?.scale,()=>this.requestUpdate(),{initial:!0}),T(()=>({loaded:this.layer?.loadStatus==="loaded",ready:this.view?.ready}),({loaded:e,ready:a})=>{if(!e||!a||!this.layer)return;this._layerMinScaleLimit=l[0].minScale,this._layerMaxScaleLimit=l[l.length-1].maxScale;let t=this.layer.type==="wcs"||this.layer.type==="imagery-tile"&&this.layer.raster?.tileType==="Raster"?null:"tileInfo"in this.layer?this.layer.tileInfo?.lods:null;if(t)!("resampling"in this.layer)||this.layer.resampling||(this._layerMinScaleLimit=t[0].scale===0?l[0].minScale:Math.min(l[0].minScale,t[0].scale),this._layerMaxScaleLimit=t[t.length-1].scale);else{let s=this.layer&&"maxScaleRange"in this.layer?this.layer.maxScaleRange:null,c=0,n=0;s&&(c=s.minScale,n=s.maxScale),n!==0&&(this._layerMaxScaleLimit=n),c!==0&&(this._layerMinScaleLimit=c)}let i=this.layer;i&&"minScale"in i&&"maxScale"in i&&(i.minScale!==0&&this.minScale===0&&(this.minScale=Math.min(i.minScale,this._interactiveMinScale)),i.maxScale!==0&&this.maxScale===0&&(this.maxScale=Math.max(i.maxScale,this._interactiveMaxScale)))},{initial:!0})])}get _interactiveMinScale(){return Math.min(this.minScaleLimit,this._layerMinScaleLimit)}get _interactiveMaxScale(){return Math.max(this.maxScaleLimit,this._layerMaxScaleLimit)}get _effectiveMinScale(){return this.minScale===0?this._interactiveMinScale:this.minScale}get _effectiveMaxScale(){return this.maxScale===0?this._interactiveMaxScale:this.maxScale}get _sliderFullRangeMin(){return this._mapScaleToSlider(this.minScaleLimit)}get _sliderFullRangeMax(){return this._mapScaleToSlider(this.maxScaleLimit)}_clampScale(e,a){return e==="min"?Math.min(Math.max(a,this._effectiveMaxScale+1),this._interactiveMinScale):Math.max(Math.min(a,this._effectiveMinScale-1),this._interactiveMaxScale)}_getDropdownLabel(e){let a=e==="min"?this._effectiveMinScale:this._effectiveMaxScale,t=Math.floor(this._mapScaleToSlider(a)),i=this.messages.scaleRangeLabels;return i?i[l[t].id]:""}_getSpriteSheetFile(){if(this.region){let t=this.region.toLowerCase(),i=`${this.messages._t9nLocale}-${t}`;if(m.has(i))return i;for(let s of m)if(s.endsWith(`-${t}`))return s}let e=this.messages._lang.toLowerCase();if(m.has(e))return e;if(this._portalRegion){let t=`${this.messages._t9nLocale}-${this._portalRegion}`;if(m.has(t))return t}let a=P[this.messages._t9nLocale];if(a){let t=`${this.messages._t9nLocale}-${a}`;if(m.has(t))return t}for(let t of m)if(t.startsWith(`${this.messages._t9nLocale}-`))return t;return"en-wo"}_handleCustomScaleInput(e,a){let t=Number.parseFloat(a);this._setScale(e,t)}_handleSliderThumbDrag(){let e=this._sliderRef.value;if(e){if(this.mode==="max-scale-only"){let a=Math.max(this._mapSliderToScale(e.values[0]),this._interactiveMaxScale);this.maxScale=a===this._interactiveMaxScale?0:a}else if(this.mode==="min-scale-only"){let a=Math.min(this._mapSliderToScale(e.values[0]),this._interactiveMinScale);this.minScale=a===this._interactiveMinScale?0:a}else{let a=Math.min(this._mapSliderToScale(e.values[0]),this._interactiveMinScale),t=Math.max(this._mapSliderToScale(e.values[1]),this._interactiveMaxScale);this.minScale=a===this._interactiveMinScale?0:a,this.maxScale=t===this._interactiveMaxScale?0:t}this._syncLayerScale()}}_mapScaleToSlider(e){let a=Math.min(l[0].minScale,Math.max(l[l.length-1].maxScale,e)),t=l.findIndex(n=>a>=n.maxScale&&a<=n.minScale),i=l[t],s=t,c=t+.9999;return i?s+(a-i.minScale)*(c-s)/(i.maxScale-i.minScale):0}_mapSliderToScale(e){let a=Math.min(l.length-1,Math.max(0,Math.floor(e))),{maxScale:t,minScale:i}=l[a],s=a,c=s+.9999;return i+(e-s)*(t-i)/(c-s)}_setScale(e,a){e==="min"?this.minScale=a===0?0:this._clampScale("min",a):this.maxScale=a===0?0:this._clampScale("max",a),this._syncLayerScale(),this._activeMenu=null}_syncLayerScale(){this.layer&&"minScale"in this.layer&&"maxScale"in this.layer&&(this.layer.minScale=this.mode==="max-scale-only"?0:this._effectiveMinScale,this.layer.maxScale=this.mode==="min-scale-only"?0:this._effectiveMaxScale)}_renderScalePreviewPopover(){let e=this._renderScalePreview();return this.hidePreview||!e?null:r`<div slot=popover>${e}</div>`}render(){let e=this._mapScaleToSlider(this._interactiveMinScale),a=this._mapScaleToSlider(this._interactiveMaxScale),t=this._sliderFullRangeMin,i=this._sliderFullRangeMax;return r`<div><arcgis-slider class="slider" .disabled=${this.disabled} layout=horizontal .fillPlacement=${this.mode==="max-scale-only"?"start":this.mode==="min-scale-only"?"end":void 0} .fullRangeMin=${t<e?t:void 0} .fullRangeMax=${i>a?i:void 0} .max=${a} .min=${e} .labelFormatter=${(s,c,n)=>n(Math.round(this._mapSliderToScale(s)))} .values=${this.mode==="max-scale-only"?[this._mapScaleToSlider(this._effectiveMaxScale)]:this.mode==="min-scale-only"?[this._mapScaleToSlider(this._effectiveMinScale)]:[this._mapScaleToSlider(this._effectiveMinScale),this._mapScaleToSlider(this._effectiveMaxScale)]} @arcgisInput=${this._handleSliderThumbDrag} ${M(this._sliderRef)}>${this._renderScalePreviewPopover()}${this.view?.scale!=null&&this._renderCurrentScaleIndicator(this.view.scale)||""}</arcgis-slider><div class="scale-menu-button-container" slot=content-end>${this.mode!=="max-scale-only"&&!this.hideMinScaleMenu?[this._renderScaleMenuButtons("min"),this._renderScaleMenuPopover("min")]:r`<div></div>`}${this.mode!=="min-scale-only"&&!this.hideMaxScaleMenu&&[this._renderScaleMenuButtons("max"),this._renderScaleMenuPopover("max")]||""}</div></div>`}_renderCurrentScaleIndicator(e){let a=this._sliderFullRangeMin,t=this._sliderFullRangeMax-a,i=Math.min(100,Math.max(0,(this._mapScaleToSlider(e)-a)/t*100));return w("scale-indicator",r`<div class="scale-indicator-container" slot=content-end><div class="scale-indicator-icon" style=${u({position:"absolute",left:`${i}%`})} .title=${`${this.messages.currentScale} 1:${Math.round(e).toLocaleString(this.messages._t9nLocale)}`}><calcite-icon icon=caret-up scale=s></calcite-icon></div></div>`)}_renderCustomScaleValue(e,a){let t=Math.round(a).toString();return r`<calcite-list-item .label=${this.messages?.featuredScaleLabels?.custom} .selected=${this._customScaleSelected===e} @calciteListItemSelect=${i=>{let s=i.target.querySelector("calcite-input-number");this._handleCustomScaleInput(e,s?.value??""),this._customScaleSelected=e}}><calcite-input-number dir=ltr class="scale-menu-input" slot=content-end group-separator inputmode=numeric .max=${l[0].minScale} .min=${l[l.length-1].maxScale} number-button-type=none .placeholder=${this.messages?.customScaleInputTooltip} prefix-text=1: scale=s step=1 .value=${t} @click=${i=>i.stopPropagation()} @keydown=${i=>{i.key==="Enter"&&(this._handleCustomScaleInput(e,i.target.value),this._customScaleSelected=e,i.stopPropagation())}}></calcite-input-number></calcite-list-item>`}_renderScaleMenuButtons(e){return r`<calcite-button .disabled=${this.disabled} class="scale-menu-button" .id=${`scale-menu-button-${e}`} icon-end=chevron-down scale=s .appearance=${this._activeMenu===e?"outline":"transparent"}>${this._getDropdownLabel(e)}</calcite-button>`}_renderScaleMenuPopover(e){return r`<calcite-popover auto-close .label=${`${e==="min"?"Min":"Max"} scale menu`} .referenceElement=${`scale-menu-button-${e}`} .placement=${e==="max"?"bottom-end":"bottom-start"} .open=${this._activeMenu===e} scale=s @calcitePopoverOpen=${()=>this._activeMenu=e} @calcitePopoverClose=${()=>{this._activeMenu===e&&(this._activeMenu=null)}}>${this._renderScaleMenu(e)}</calcite-popover>`}_renderScaleMenu(e){let a=Math.floor(this._mapScaleToSlider(this._effectiveMaxScale)),t=Math.floor(this._mapScaleToSlider(this._effectiveMinScale)),i=e==="min"?this._effectiveMinScale:this._effectiveMaxScale,s=this.messages.featuredScaleLabels;if(!s)return;let c=Math.floor(this._mapScaleToSlider(this._interactiveMaxScale)),n=Math.floor(this._mapScaleToSlider(this._interactiveMinScale)),d=l.filter((o,h)=>e==="min"?h<a&&h>=n:h>t&&h<=c).map(o=>this._renderScaleMenuItem({scaleLabel:s[o.id],scaleValue:o.scale,isSelected:i===o.scale,valueVisible:o.id!=="world"||this.showWorldValue,type:e}));return r`<calcite-list label="Scale Menu List" scale=s class="scale-menu-list" selection-appearance=icon selection-mode=single-persist>${this.view?.scale!=null&&this._renderCustomScaleValue(e,i)||""}${this.view?.scale!=null?this._renderScaleMenuItem({scaleValue:this.view.scale,scaleLabel:s.current,isSelected:i===this.view.scale,valueVisible:!0,type:e}):null}${d}</calcite-list>`}_renderScaleMenuItem(e){let{scaleValue:a,scaleLabel:t,isSelected:i,valueVisible:s}=e,c=a===l[0].scale?` ${this.messages.aboveSuffix}`:a===l[l.length-1].scale?` ${this.messages.belowSuffix}`:"";return r`<calcite-list-item .label=${t} .selected=${i&&this._customScaleSelected!==e.type} .description=${s?`1:${Math.round(a).toLocaleString(this.messages._t9nLocale)}${c}`:void 0} @calciteListItemSelect=${()=>{this._setScale(e.type,a),this._customScaleSelected=null}}></calcite-list-item>`}_renderScalePreview(){let e=this._sliderRef.value?.activeValue;if(typeof e!="number")return null;let a=Math.min(l.length-1,Math.max(0,Math.floor(e))),t=5,i=128,s=i*(a%t),c=i*Math.floor(a/t),n=`-${s}px -${c}px`,d=this._getSpriteSheetFile();return r`<div class="preview-container"><img src=${y(`./assets/slider-scale-range/images/${d}.avif`)??g} style=${u({display:"block",height:`${i}px`,width:`${i}px`,objectPosition:n,objectFit:"none"})}></div>`}};f("arcgis-slider-scale-range",x);return x},"core/reactiveUtils","portal/Portal",a,c)
|
|
2
|
+
import{a as w}from"./SBUR54TP.js";import{a as b}from"./I5OLG552.js";import c from"./GSI2ZI7D.js";import{g as $}from"./BD27PEC7.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import"./DU6OKLV4.js";import{M as _,N as M,O as v,Q as u,R as g,U as f,V as y,a as p,b as r,x as S}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([{watch:T},R,,{a:L}])=>{var m=new Set(["ar-iq","ar-kw","bg-bg","cs-cz","da-dk","da-gl","de-at","de-ch","de-de","de-li","el-gr","en-ae","en-au","en-ca","en-eg","en-gb","en-hk","en-id","en-ie","en-il","en-in","en-iq","en-ke","en-lu","en-mo","en-my","en-nz","en-rw","en-sg","en-us","en-vi","en-wo","en-za","es-ar","es-bo","es-cl","es-co","es-cr","es-es","es-gt","es-mx","es-ni","es-pe","es-pr","es-sv","es-ve","et-ee","fi-fi","fr-ci","fr-fr","fr-ma","fr-mg","fr-ml","fr-tn","is-is","it-it","ja-jp","ko-kr","lt-lt","lv-lv","nl-be","nl-nl","nl-sr","nn-no","pl-pl","pt-br","pt-pt","ro-ro","ru-ru","sk-sk","sv-se","th-th","zh-cn","zh-tw"]),P={ar:"iq",bg:"bg",cs:"cz",da:"dk",de:"de",el:"gr",en:"us",es:"es",et:"ee",fi:"fi",fr:"fr",is:"is",it:"it",ja:"jp",ko:"kr",lt:"lt",lv:"lv",nl:"nl",nn:"no",pl:"pl",pt:"br",ro:"ro",ru:"ru",sk:"sk",sv:"se",th:"th",zh:"cn"},k=p`:host{display:block;width:310px;max-width:100%}.slider{height:50px}.scale-indicator-container{position:relative;width:100%;margin-top:2px}.scale-indicator-icon{transform:scale(.8,1.7);margin-left:-6px;width:1px;--calcite-icon-color: var(--calcite-color-text-3)}.scale-menu-list{max-height:220px;overflow-y:auto}.scale-menu-input{max-width:120px}.scale-menu-button-container{display:flex;direction:ltr;justify-content:space-between}.scale-menu-button{min-width:0}:dir(rtl) .scale-menu-button-container>*{direction:rtl}.preview-container{padding:6px;background-color:var(--calcite-color-foreground-1);box-shadow:0 1px 2px #0000004d}`,l=[{id:"world",scale:147914382,minScale:147914382,maxScale:1e8},{id:"continent",scale:5e7,minScale:99999999,maxScale:35e6},{id:"countriesBig",scale:25e6,minScale:34999999,maxScale:15e6},{id:"countriesSmall",scale:12e6,minScale:14999999,maxScale:7e6},{id:"statesProvinces",scale:6e6,minScale:6999999,maxScale:4e6},{id:"stateProvince",scale:3e6,minScale:3999999,maxScale:2e6},{id:"counties",scale:15e5,minScale:1999999,maxScale:1e6},{id:"county",scale:75e4,minScale:999999,maxScale:5e5},{id:"metropolitanArea",scale:32e4,minScale:499999,maxScale:25e4},{id:"cities",scale:16e4,minScale:249999,maxScale:12e4},{id:"city",scale:8e4,minScale:119999,maxScale:6e4},{id:"town",scale:4e4,minScale:59999,maxScale:3e4},{id:"neighborhood",scale:2e4,minScale:29999,maxScale:15e3},{id:"streets",scale:1e4,minScale:14999,maxScale:7500},{id:"street",scale:5e3,minScale:7499,maxScale:4e3},{id:"buildings",scale:2500,minScale:3999,maxScale:2e3},{id:"building",scale:1250,minScale:1999,maxScale:801},{id:"smallBuilding",scale:800,minScale:800,maxScale:401},{id:"rooms",scale:400,minScale:400,maxScale:101},{id:"room",scale:100,minScale:100,maxScale:0}],x=class extends v{constructor(){super(...arguments),this.messages=b(),this._sliderRef=_(),this._activeMenu=null,this._customScaleSelected=null,this._portalRegion=null,this._layerMaxScaleLimit=l[l.length-1].maxScale,this._layerMinScaleLimit=l[0].minScale,this.autoDestroyDisabled=!1,this.disabled=!1,this.hidePreview=!1,this.hideMaxScaleMenu=!1,this.hideMinScaleMenu=!1,this.icon="actual-size",this.maxScale=0,this.maxScaleLimit=l[l.length-1].maxScale,this.minScale=0,this.minScaleLimit=l[0].minScale,this.mode="range",this.showWorldValue=!1,this.view=L(this),this.arcgisChange=S(),this.arcgisInput=S(),this.arcgisPropertyChange=$()("state","minScale","maxScale"),this.arcgisReady=S()}static{this.properties={_activeMenu:16,_customScaleSelected:16,_portalRegion:16,_layerMaxScaleLimit:16,_layerMinScaleLimit:16,autoDestroyDisabled:5,disabled:7,hidePreview:5,hideMaxScaleMenu:5,hideMinScaleMenu:5,icon:1,label:1,layer:0,maxScale:9,maxScaleLimit:9,minScale:9,minScaleLimit:9,mode:1,referenceElement:1,region:1,showWorldValue:5,state:32,view:0}}static{this.styles=k}get state(){let{view:e,layer:a}=this;return!e&&!a||!e&&a?.loadStatus==="loaded"||!a&&e?.ready||e?.ready&&a?.loadStatus==="loaded"?"ready":"disabled"}async destroy(){await this.manager.destroy()}willUpdate(e){if((e.has("maxScaleLimit")||e.has("minScaleLimit"))&&(this.minScaleLimit===0&&(this.minScaleLimit=l[0].minScale),this.maxScaleLimit===0&&(this.maxScaleLimit=l[l.length-1].maxScale),this.minScaleLimit=Math.min(this.minScaleLimit,l[0].minScale),this.maxScaleLimit=Math.max(this.maxScaleLimit,l[l.length-1].maxScale),this.minScale!==0&&(this.minScale=Math.min(this.minScale,this._interactiveMinScale)),this.maxScale!==0&&(this.maxScale=Math.max(this.maxScale,this._interactiveMaxScale)),this.hasUpdated&&this._syncLayerScale()),e.has("maxScale")||e.has("minScale")){if(this.minScale!==0){let a=this._clampScale("min",this.minScale);this.minScale=a===this.minScaleLimit?0:a}if(this.maxScale!==0){let a=this._clampScale("max",this.maxScale);this.maxScale=a===this.maxScaleLimit?0:a}}e.has("layer")&&(this.layer?this.layer.load().catch(()=>{}):(this._layerMinScaleLimit=l[0].minScale,this._layerMaxScaleLimit=l[l.length-1].maxScale)),e.has("mode")&&(this.mode==="max-scale-only"?this.minScale=0:this.mode==="min-scale-only"&&(this.maxScale=0),e.get("mode")!==void 0&&this._syncLayerScale())}loaded(){R.getDefault().load().then(e=>{let a=e.user?.culture??e.culture;a&&(this._portalRegion=a.split("-")[1]?.toLowerCase()??null)}).catch(()=>{}),this.manager.onLifecycle(()=>[T(()=>this.view?.scale,()=>this.requestUpdate(),{initial:!0}),T(()=>({loaded:this.layer?.loadStatus==="loaded",ready:this.view?.ready}),({loaded:e,ready:a})=>{if(!e||!a||!this.layer)return;this._layerMinScaleLimit=l[0].minScale,this._layerMaxScaleLimit=l[l.length-1].maxScale;let t=this.layer.type==="wcs"||this.layer.type==="imagery-tile"&&this.layer.raster?.tileType==="Raster"?null:"tileInfo"in this.layer?this.layer.tileInfo?.lods:null;if(t)!("resampling"in this.layer)||this.layer.resampling||(this._layerMinScaleLimit=t[0].scale===0?l[0].minScale:Math.min(l[0].minScale,t[0].scale),this._layerMaxScaleLimit=t[t.length-1].scale);else{let s=this.layer&&"maxScaleRange"in this.layer?this.layer.maxScaleRange:null,c=0,n=0;s&&(c=s.minScale,n=s.maxScale),n!==0&&(this._layerMaxScaleLimit=n),c!==0&&(this._layerMinScaleLimit=c)}let i=this.layer;i&&"minScale"in i&&"maxScale"in i&&(i.minScale!==0&&this.minScale===0&&(this.minScale=Math.min(i.minScale,this._interactiveMinScale)),i.maxScale!==0&&this.maxScale===0&&(this.maxScale=Math.max(i.maxScale,this._interactiveMaxScale)))},{initial:!0})])}get _interactiveMinScale(){return Math.min(this.minScaleLimit,this._layerMinScaleLimit)}get _interactiveMaxScale(){return Math.max(this.maxScaleLimit,this._layerMaxScaleLimit)}get _effectiveMinScale(){return this.minScale===0?this._interactiveMinScale:this.minScale}get _effectiveMaxScale(){return this.maxScale===0?this._interactiveMaxScale:this.maxScale}get _sliderFullRangeMin(){return this._mapScaleToSlider(this.minScaleLimit)}get _sliderFullRangeMax(){return this._mapScaleToSlider(this.maxScaleLimit)}_clampScale(e,a){return e==="min"?Math.min(Math.max(a,this._effectiveMaxScale+1),this._interactiveMinScale):Math.max(Math.min(a,this._effectiveMinScale-1),this._interactiveMaxScale)}_getDropdownLabel(e){let a=e==="min"?this._effectiveMinScale:this._effectiveMaxScale,t=Math.floor(this._mapScaleToSlider(a)),i=this.messages.scaleRangeLabels;return i?i[l[t].id]:""}_getSpriteSheetFile(){if(this.region){let t=this.region.toLowerCase(),i=`${this.messages._t9nLocale}-${t}`;if(m.has(i))return i;for(let s of m)if(s.endsWith(`-${t}`))return s}let e=this.messages._lang.toLowerCase();if(m.has(e))return e;if(this._portalRegion){let t=`${this.messages._t9nLocale}-${this._portalRegion}`;if(m.has(t))return t}let a=P[this.messages._t9nLocale];if(a){let t=`${this.messages._t9nLocale}-${a}`;if(m.has(t))return t}for(let t of m)if(t.startsWith(`${this.messages._t9nLocale}-`))return t;return"en-wo"}_handleCustomScaleInput(e,a){let t=Number.parseFloat(a);this._setScale(e,t)}_handleSliderThumbDrag(){let e=this._sliderRef.value;if(e){if(this.mode==="max-scale-only"){let a=Math.max(this._mapSliderToScale(e.values[0]),this._interactiveMaxScale);this.maxScale=a===this._interactiveMaxScale?0:a}else if(this.mode==="min-scale-only"){let a=Math.min(this._mapSliderToScale(e.values[0]),this._interactiveMinScale);this.minScale=a===this._interactiveMinScale?0:a}else{let a=Math.min(this._mapSliderToScale(e.values[0]),this._interactiveMinScale),t=Math.max(this._mapSliderToScale(e.values[1]),this._interactiveMaxScale);this.minScale=a===this._interactiveMinScale?0:a,this.maxScale=t===this._interactiveMaxScale?0:t}this._syncLayerScale()}}_mapScaleToSlider(e){let a=Math.min(l[0].minScale,Math.max(l[l.length-1].maxScale,e)),t=l.findIndex(n=>a>=n.maxScale&&a<=n.minScale),i=l[t],s=t,c=t+.9999;return i?s+(a-i.minScale)*(c-s)/(i.maxScale-i.minScale):0}_mapSliderToScale(e){let a=Math.min(l.length-1,Math.max(0,Math.floor(e))),{maxScale:t,minScale:i}=l[a],s=a,c=s+.9999;return i+(e-s)*(t-i)/(c-s)}_setScale(e,a){e==="min"?this.minScale=a===0?0:this._clampScale("min",a):this.maxScale=a===0?0:this._clampScale("max",a),this._syncLayerScale(),this._activeMenu=null}_syncLayerScale(){this.layer&&"minScale"in this.layer&&"maxScale"in this.layer&&(this.layer.minScale=this.mode==="max-scale-only"?0:this._effectiveMinScale,this.layer.maxScale=this.mode==="min-scale-only"?0:this._effectiveMaxScale)}_renderScalePreviewPopover(){let e=this._renderScalePreview();return this.hidePreview||!e?null:r`<div slot=popover>${e}</div>`}render(){let e=this._mapScaleToSlider(this._interactiveMinScale),a=this._mapScaleToSlider(this._interactiveMaxScale),t=this._sliderFullRangeMin,i=this._sliderFullRangeMax;return r`<div><arcgis-slider class="slider" .disabled=${this.disabled} layout=horizontal .fillPlacement=${this.mode==="max-scale-only"?"start":this.mode==="min-scale-only"?"end":void 0} .fullRangeMin=${t<e?t:void 0} .fullRangeMax=${i>a?i:void 0} .max=${a} .min=${e} .labelFormatter=${(s,c,n)=>n(Math.round(this._mapSliderToScale(s)))} .values=${this.mode==="max-scale-only"?[this._mapScaleToSlider(this._effectiveMaxScale)]:this.mode==="min-scale-only"?[this._mapScaleToSlider(this._effectiveMinScale)]:[this._mapScaleToSlider(this._effectiveMinScale),this._mapScaleToSlider(this._effectiveMaxScale)]} @arcgisInput=${this._handleSliderThumbDrag} ${M(this._sliderRef)}>${this._renderScalePreviewPopover()}${this.view?.scale!=null&&this._renderCurrentScaleIndicator(this.view.scale)||""}</arcgis-slider><div class="scale-menu-button-container" slot=content-end>${this.mode!=="max-scale-only"&&!this.hideMinScaleMenu?[this._renderScaleMenuButtons("min"),this._renderScaleMenuPopover("min")]:r`<div></div>`}${this.mode!=="min-scale-only"&&!this.hideMaxScaleMenu&&[this._renderScaleMenuButtons("max"),this._renderScaleMenuPopover("max")]||""}</div></div>`}_renderCurrentScaleIndicator(e){let a=this._sliderFullRangeMin,t=this._sliderFullRangeMax-a,i=Math.min(100,Math.max(0,(this._mapScaleToSlider(e)-a)/t*100));return w("scale-indicator",r`<div class="scale-indicator-container" slot=content-end><div class="scale-indicator-icon" style=${u({position:"absolute",left:`${i}%`})} .title=${`${this.messages.currentScale} 1:${Math.round(e).toLocaleString(this.messages._t9nLocale)}`}><calcite-icon icon=caret-up scale=s></calcite-icon></div></div>`)}_renderCustomScaleValue(e,a){let t=Math.round(a).toString();return r`<calcite-list-item .label=${this.messages?.featuredScaleLabels?.custom} .selected=${this._customScaleSelected===e} @calciteListItemSelect=${i=>{let s=i.target.querySelector("calcite-input-number");this._handleCustomScaleInput(e,s?.value??""),this._customScaleSelected=e}}><calcite-input-number dir=ltr class="scale-menu-input" slot=content-end group-separator inputmode=numeric .max=${l[0].minScale} .min=${l[l.length-1].maxScale} number-button-type=none .placeholder=${this.messages?.customScaleInputTooltip} prefix-text=1: scale=s step=1 .value=${t} @click=${i=>i.stopPropagation()} @keydown=${i=>{i.key==="Enter"&&(this._handleCustomScaleInput(e,i.target.value),this._customScaleSelected=e,i.stopPropagation())}}></calcite-input-number></calcite-list-item>`}_renderScaleMenuButtons(e){return r`<calcite-button .disabled=${this.disabled} class="scale-menu-button" .id=${`scale-menu-button-${e}`} icon-end=chevron-down scale=s .appearance=${this._activeMenu===e?"outline":"transparent"}>${this._getDropdownLabel(e)}</calcite-button>`}_renderScaleMenuPopover(e){return r`<calcite-popover auto-close .label=${`${e==="min"?"Min":"Max"} scale menu`} .referenceElement=${`scale-menu-button-${e}`} .placement=${e==="max"?"bottom-end":"bottom-start"} .open=${this._activeMenu===e} scale=s @calcitePopoverOpen=${()=>this._activeMenu=e} @calcitePopoverClose=${()=>{this._activeMenu===e&&(this._activeMenu=null)}}>${this._renderScaleMenu(e)}</calcite-popover>`}_renderScaleMenu(e){let a=Math.floor(this._mapScaleToSlider(this._effectiveMaxScale)),t=Math.floor(this._mapScaleToSlider(this._effectiveMinScale)),i=e==="min"?this._effectiveMinScale:this._effectiveMaxScale,s=this.messages.featuredScaleLabels;if(!s)return;let c=Math.floor(this._mapScaleToSlider(this._interactiveMaxScale)),n=Math.floor(this._mapScaleToSlider(this._interactiveMinScale)),d=l.filter((o,h)=>e==="min"?h<a&&h>=n:h>t&&h<=c).map(o=>this._renderScaleMenuItem({scaleLabel:s[o.id],scaleValue:o.scale,isSelected:i===o.scale,valueVisible:o.id!=="world"||this.showWorldValue,type:e}));return r`<calcite-list label="Scale Menu List" scale=s class="scale-menu-list" selection-appearance=icon selection-mode=single-persist>${this.view?.scale!=null&&this._renderCustomScaleValue(e,i)||""}${this.view?.scale!=null?this._renderScaleMenuItem({scaleValue:this.view.scale,scaleLabel:s.current,isSelected:i===this.view.scale,valueVisible:!0,type:e}):null}${d}</calcite-list>`}_renderScaleMenuItem(e){let{scaleValue:a,scaleLabel:t,isSelected:i,valueVisible:s}=e,c=a===l[0].scale?` ${this.messages.aboveSuffix}`:a===l[l.length-1].scale?` ${this.messages.belowSuffix}`:"";return r`<calcite-list-item .label=${t} .selected=${i&&this._customScaleSelected!==e.type} .description=${s?`1:${Math.round(a).toLocaleString(this.messages._t9nLocale)}${c}`:void 0} @calciteListItemSelect=${()=>{this._setScale(e.type,a),this._customScaleSelected=null}}></calcite-list-item>`}_renderScalePreview(){let e=this._sliderRef.value?.activeValue;if(typeof e!="number")return null;let a=Math.min(l.length-1,Math.max(0,Math.floor(e))),t=5,i=128,s=i*(a%t),c=i*Math.floor(a/t),n=`-${s}px -${c}px`,d=this._getSpriteSheetFile();return r`<div class="preview-container"><img src=${y(`./assets/slider-scale-range/images/${d}.avif`)??g} style=${u({display:"block",height:`${i}px`,width:`${i}px`,objectPosition:n,objectFit:"none"})}></div>`}};f("arcgis-slider-scale-range",x);return x},"core/reactiveUtils","portal/Portal",a,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import c from"./QFH7PJYV.js";import b from"./MZWO5JYA.js";import a from"./DUWXDGIW.js";import{a as y}from"./VJVKFKSG.js";import{
|
|
2
|
+
import c from"./QFH7PJYV.js";import b from"./MZWO5JYA.js";import a from"./DUWXDGIW.js";import{a as y}from"./VJVKFKSG.js";import{g as p}from"./BD27PEC7.js";import"./IDZCPNFC.js";import"./DU6OKLV4.js";import{O as F,S as _,U as A,a as m,b as d,o as n}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([,I,v,b,{getDisplayedSymbol:S},{stripHTML:x},{watch:u},{d:w},,{d:f}])=>{var C=m`calcite-notice{padding:var(--calcite-space-lg)}`,l=class extends F{constructor(){super(...arguments),this._aggregatedGraphicsSet=new Set,this.aggregatedFeatureCount=0,this.selectedAggregatedFeatureIndex=-1,this.aggregatedFeatureItems=[],this.aggregatedFeatures=[],this.autoDestroyDisabled=!1,this.loading=!1,this.selectedAggregateBoundaryFeature=new v({symbol:new b({outline:{width:1.5,color:"cyan"},style:"none"})}),this.arcgisPropertyChange=p()("aggregatedFeatureCount","selectedAggregatedFeatureIndex","aggregatedFeatureItems","aggregatedFeatures","loading"),this._renderableAggregatedFeatureItems=[]}static{this.properties={_abortController:16,aggregatedFeatureCount:32,selectedAggregatedFeatureIndex:32,aggregatedFeatureItems:32,aggregatedFeatures:32,autoDestroyDisabled:5,feature:0,flowItems:0,loading:32,map:0,messages:0,selectedAggregateBoundaryFeature:32,spatialReference:0,timeZone:1,view:0}}static{this.styles=C}async destroy(){await this.manager.destroy(),this._cancelQuery(),this._clearAggregatedFeatureItems(),this._removeAggregateBoundaryFeature()}async next(){await this._selectRelativeAggregatedFeature(1)}async previous(){await this._selectRelativeAggregatedFeature(-1)}loaded(){this.manager.onLifecycle(()=>[u(()=>[this.feature,this.view],()=>{this._updateAggregatedFeatures()},{initial:!0}),u(()=>this._getAggregatedFeatureItemsHeadingSignature(),()=>this.requestUpdate()),u(()=>this.flowItems?.length,()=>{let{flowItems:e}=this,t=e?.getItemAt((e.length??0)-1)?.graphic??void 0;this._setSelectedAggregatedFeatureIndex(t?this.aggregatedFeatures.indexOf(t):-1),this._removeSelectedAggregatedFeature(),t&&this._aggregatedGraphicsSet.has(t)&&this._addSelectedAggregatedFeature(t)})])}disconnectedCallback(){super.disconnectedCallback(),this._cancelQuery(),this._clearAggregatedFeatureItems(),this._removeAggregateBoundaryFeature()}_setAggregatedFeatureCount(e){n(()=>this.aggregatedFeatureCount=e)}_setSelectedAggregatedFeatureIndex(e){n(()=>this.selectedAggregatedFeatureIndex=e)}_setAggregatedFeatureItemsReadOnly(e){n(()=>{this.aggregatedFeatureItems=e}),this._renderableAggregatedFeatureItems=e.filter(t=>!!t.graphic)}_setAggregatedFeatures(e){this._aggregatedGraphicsSet=new Set(e),n(()=>this.aggregatedFeatures=e)}_getAggregatedFeatureItemsHeadingSignature(){let e="";for(let t of this.aggregatedFeatureItems)e+=`${t.heading??""}|`;return e}_setLoading(e){n(()=>this.loading=e)}_cancelQuery(){this._abortController=y(this._abortController),this._setLoading(!1)}_removeBoundaryGraphicFromView(e){e?.graphics.remove(this.selectedAggregateBoundaryFeature)}_clearAggregatedFeatureItems(){this._setAggregatedFeatureItemsReadOnly([]),this._setSelectedAggregatedFeatureIndex(-1),this._removeSelectedAggregatedFeature()}_resetAggregatedFeaturesState(){this._setAggregatedFeatures([]),this._clearAggregatedFeatureItems(),this._setAggregatedFeatureCount(0),this._removeAggregateBoundaryFeature()}_setAggregatedFeatureItems(e){this._setAggregatedFeatureItemsReadOnly(e.map(t=>new I({graphic:t})))}_setAggregatedFeaturesState(e){this._setAggregatedFeatures(e),this._setAggregatedFeatureItems(e),this._setAggregatedFeatureCount(e.length)}_removeAggregateBoundaryFeature(){this._removeBoundaryGraphicFromView(this._boundaryGraphicView),this.selectedAggregateBoundaryFeature.geometry=null,this._boundaryGraphicView=void 0}_updateAggregateBoundaryFeature(e){let{view:t}=this,a=this._boundaryGraphicView;if(!t){this._removeAggregateBoundaryFeature();return}a!==t&&this._removeBoundaryGraphicFromView(a),this.selectedAggregateBoundaryFeature.geometry=e,this._boundaryGraphicView=t,t.graphics.includes(this.selectedAggregateBoundaryFeature)||t.graphics.add(this.selectedAggregateBoundaryFeature)}async _getLayerViewAndQuery(e){let{view:t}=this,a=f(e);if(!t||!a)return null;let r=await t.whenLayerView(a);if(!r?.createQuery||!r?.queryFeatures||!r?.queryExtent)return null;let g=r.createQuery(),s=e.getObjectId();return g.aggregateIds=s!=null?[s]:[],[r,g]}async _updateAggregatedFeatures(){this._cancelQuery();let{feature:e}=this;if(!e?.isAggregate){this._resetAggregatedFeaturesState();return}let t=await this._getLayerViewAndQuery(e);if(!t){this._resetAggregatedFeaturesState();return}let[a,r]=t,g=new AbortController;this._abortController=g,this._setLoading(!0);try{let[s,o]=await Promise.all([a.queryFeatures(r,{signal:g.signal}),a.queryExtent(r,{signal:g.signal})]);if(this._abortController!==g||g.signal.aborted)return;this._abortController=null,this._setLoading(!1);let i=s.features??[];this._setAggregatedFeaturesState(i),o.extent?this._updateAggregateBoundaryFeature(o.extent):this._removeAggregateBoundaryFeature()}catch(s){if(this._abortController!==g||(this._abortController=null,this._setLoading(!1),w(s)))return;this._resetAggregatedFeaturesState()}}_addFlowItem(e){e&&this.flowItems?.push(e)}async _addSelectedAggregatedFeature(e){let{view:t}=this;if(e&&t){let a=await S(e),r=e.clone();r.symbol=a,this._selectedAggregatedFeature=r,t.graphics.add(this._selectedAggregatedFeature)}}_removeSelectedAggregatedFeature(){this._selectedAggregatedFeature&&this.view&&(this.view.graphics.remove(this._selectedAggregatedFeature),this._selectedAggregatedFeature=void 0)}async _selectFeature(e){let{flowItems:t,view:a}=this;t&&this._addFlowItem(_(d`<arcgis-feature-next .autoDestroyDisabled=${this.autoDestroyDisabled} .flowItems=${t} .graphic=${e.graphic} .map=${this.map} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} .view=${a??void 0}></arcgis-feature-next>`))}async _selectRelativeAggregatedFeature(e){let{aggregatedFeatures:t,aggregatedFeatureItems:a,flowItems:r}=this;if(!r||t.length===0||a.length===0)return;let g=t.length,s=this.selectedAggregatedFeatureIndex>=0&&this.selectedAggregatedFeatureIndex<g?this.selectedAggregatedFeatureIndex:-1;if(s===-1){let h=r.getItemAt(r.length-1)?.graphic;s=h?t.indexOf(h):-1}let o=s===-1?e>0?0:g-1:(s+e+g)%g,i=a[o];if(!i?.graphic)return;this._setSelectedAggregatedFeatureIndex(o);let c=r.getItemAt(r.length-1);if(c?.flowType==="feature"){c.graphic=i.graphic,this._removeSelectedAggregatedFeature(),await this._addSelectedAggregatedFeature(i.graphic);return}await this._selectFeature(i)}_renderChevronIconNode(){return d`<calcite-icon flip-rtl icon=chevron-right scale=s slot=content-end></calcite-icon>`}render(){let{_renderableAggregatedFeatureItems:e}=this,{loading:t}=this;return t||e.length>0?d`<calcite-list .loading=${t} display-mode=flat .label=${this.messages?.aggregatedFeatures??""} selection-mode=none>${e.map(a=>d`<calcite-list-item .label=${a.heading?x(a.heading):void 0} @calciteListItemSelect=${()=>this._selectFeature(a)}>${this._renderChevronIconNode()}</calcite-list-item>`)}</calcite-list>`:d`<calcite-notice icon=information kind=brand open scale=s width=full><div slot=message>${this.messages?.noAggregatedFeatures}</div></calcite-notice>`}};A("arcgis-aggregated-features",l);return l},"core/Collection","popup/Feature","Graphic","symbols/SimpleFillSymbol","symbols/support/symbolUtils","applications/Components/stringUtils","core/reactiveUtils",a,b,c)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{a as w}from"./BIU6VS3K.js";import f from"./
|
|
2
|
+
import{a as w}from"./BIU6VS3K.js";import f from"./J5WF4RA3.js";import{a as P}from"./I5OLG552.js";import{a as u}from"./JD74LG7K.js";import e from"./BPXDBUNH.js";import c from"./GSI2ZI7D.js";import{g as D}from"./BD27PEC7.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{d as g}from"./DU6OKLV4.js";import{M as y,N as x,O as _,P as p,Q as v,R as L,U as C,a as b,b as d,x as h}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([A,,,,$])=>{var k=b`:host{position:absolute;margin:0;background:transparent!important;padding:0;width:100%;height:100%;overflow:hidden;user-select:none;--arcgis-internal-swipe-handle-color-background: var(--calcite-color-background);--arcgis-internal-swipe-divider-color-background: var(--calcite-color-background)}.root{width:100%;height:100%;overflow:hidden;user-select:none}.root,.arcgis-ui .root{pointer-events:none!important}.container{position:absolute;z-index:1;margin:0;outline:0;border:0;padding:0;overflow:hidden;pointer-events:auto;touch-action:none;outline-color:transparent}.horizontal .container{margin-left:calc(var(--calcite-spacing-xxxl) / 2 * -1);cursor:col-resize;height:100%}.vertical .container{margin-top:calc(var(--calcite-spacing-xxxl) / 2 * -1);cursor:row-resize;width:100%}.disabled .container{cursor:default;pointer-events:none}.divider{position:absolute;background-color:var(--arcgis-internal-swipe-divider-color-background)}.horizontal .divider{top:0;left:calc(var(--calcite-spacing-xxxl) / 2);margin-left:calc(var(--calcite-border-width-lg) * .5 * -1);border-right:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);border-left:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);width:var(--calcite-border-width-lg);height:100%}.vertical .divider{top:calc(var(--calcite-spacing-xxxl) / 2);left:0;margin-top:calc(var(--calcite-border-width-lg) * .5 * -1);border-top:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);border-bottom:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);width:100%;height:var(--calcite-border-width-lg)}.handle{display:flex;position:relative;align-items:center;justify-content:center;border:var(--calcite-border-width-sm) solid var(--calcite-color-border-1);border-radius:var(--calcite-corner-radius-round);background-color:var(--arcgis-internal-swipe-handle-color-background);width:var(--calcite-spacing-xxxl);height:var(--calcite-spacing-xxxl);color:var(--calcite-color-text-3)}.handle-hidden{visibility:hidden}.vertical .handle{rotate:90deg}.handle-icon{position:relative;z-index:2}.handle-icon:before{content:"|||";color:inherit}.horizontal .handle{top:calc(50% - calc(var(--calcite-spacing-xxxl) / 2))}.vertical .handle{left:calc(50% - calc(var(--calcite-spacing-xxxl) / 2))}.container:focus .handle,.container:focus .divider{outline:inset 2px var(--calcite-color-focus, var(--calcite-color-focus, var(--calcite-color-brand)))}.container:focus .handle{outline-offset:calc(-2px*(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}`,z=$(A),f=class extends _{constructor(){super(...arguments),this._container=null,this._containerRef=y(),this._swiping=!1,this._positionChanged=!1,this.messages=P({}),this._pointerOffset=0,this.viewModel=z(this),this._onContainerPointerDown=e=>{e.preventDefault();let{_container:i}=this;i&&document.activeElement!==this.el&&i.focus(),this._swiping=!0,this._calculatePointerOffset(e)},this.view=this.viewModel.view,this.autoDestroyDisabled=!1,this.direction=this.viewModel.direction,this.disabled=!1,this.hideDivider=!1,this.hideHandle=!1,this.icon="compare",this.label=this.messages.componentLabel,this.position=this.viewModel.position,this.state=this.viewModel.state,this.arcgisPropertyChange=D()("state"),this.arcgisReady=h(),this.arcgisSwipeChange=h(),this.arcgisSwipeInput=h()}static{this.properties={view:0,autoDestroyDisabled:5,direction:3,disabled:7,endLayers:0,hideDivider:7,hideHandle:7,icon:1,label:1,leadingLayers:0,messageOverrides:0,position:9,startLayers:0,swipePosition:9,referenceElement:1,state:32,trailingLayers:0}}static{this.styles=k}get endLayers(){return this.viewModel.trailingLayers}set endLayers(e){this.viewModel.trailingLayers=e}get leadingLayers(){return this.startLayers}set leadingLayers(e){this.startLayers=e}get startLayers(){return this.viewModel.leadingLayers}set startLayers(e){this.viewModel.leadingLayers=e}get swipePosition(){return this.position}set swipePosition(e){this.position=e}get trailingLayers(){return this.endLayers}set trailingLayers(e){this.endLayers=e}async destroy(){await this.manager.destroy()}loaded(){this.listenOn(document,"pointermove",this._onContainerPointerMove),this.listenOn(document,"pointerup",this._onContainerPointerUp)}_calculatePointerOffset(e){let{direction:i}=this,t=this._containerRef.value,r=(i==="vertical"?t.clientHeight:t.clientWidth)/2,o=t.getBoundingClientRect(),a=e.clientX-o.left,l=e.clientY-o.top;this._pointerOffset=i==="vertical"?l-r:a-r}_onContainerPointerUp(e){this._swiping&&(e.preventDefault(),this._positionChanged&&(this.arcgisSwipeChange.emit(),this._positionChanged=!1),this._swiping=!1)}_onContainerPointerMove(e){if(!this._swiping)return;e.preventDefault();let{_pointerOffset:i,el:t,direction:r}=this,{clientX:o,clientY:a}=e,{top:l,left:n,width:s,height:c}=t.getBoundingClientRect(),M=r==="vertical"?c:s,m=(r==="vertical"?a-l-i:o-n-i)/M*100;this.position!==m&&(this.position=m,this._positionChanged=!0,this.arcgisSwipeInput.emit())}_getKeyPosition(e){let{key:i}=e,{position:t}=this,{max:r,min:o,step:a,stepMultiplier:l,direction:n}=this.viewModel,s=a*l;if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"].includes(i)&&(e.preventDefault(),e.stopPropagation()),n==="vertical"?i==="ArrowDown"||i==="ArrowRight":i==="ArrowUp"||i==="ArrowRight"){let c=e.shiftKey?s:a;return t+c}if(n==="vertical"?i==="ArrowUp"||i==="ArrowLeft":i==="ArrowDown"||i==="ArrowLeft"){let c=e.shiftKey?s:a;return t-c}return i==="Home"?o:i==="End"?r:(n==="vertical"?i==="PageDown":i==="PageUp")?t+s:(n==="vertical"?i==="PageUp":i==="PageDown")?t-s:null}_onContainerKeyDown(e){let i=this._getKeyPosition(e);typeof i=="number"&&this.position!==i&&(this.position=i,this.arcgisSwipeInput.emit(),this.arcgisSwipeChange.emit())}render(){let{state:e,direction:i}=this.viewModel,t=e==="disabled"||this.disabled,r={[u.disabled]:t,disabled:t,vertical:i==="vertical",horizontal:i==="horizontal"};return d`<div class=${p(g("root",u.widget,r))}>${e==="disabled"?null:this._renderContainer()}</div>`}_renderHandle(){let{direction:e}=this.viewModel,{hideHandle:i}=this,t={[w.dragHorizontal]:e==="vertical",[w.dragVertical]:e==="horizontal"},r=g("handle",!!i&&"handle-hidden");return d`<div class=${p(r)} role=presentation><span aria-hidden=true class=${p(g("handle-icon",t))}></span></div>`}_renderDivider(){return this.hideDivider?null:d`<div class="divider" role=presentation></div>`}_renderContent(){return[this._renderDivider(),this._renderHandle()]}_renderContainer(){let{disabled:e,viewModel:i}=this,{max:t,min:r,direction:o,position:a}=i,l=this.label??this.messages.dragLabel??"",n=`${a}%`,s={top:o==="vertical"?n:void 0,left:o==="vertical"?void 0:n},c=this._renderContent();return e?d`<div class="container" role=presentation style=${v(s)}>${c}</div>`:d`<div @pointerdown=${this._onContainerPointerDown} .ariaLabel=${l} .ariaOrientation=${o} .ariaValueMax=${`${t}`} .ariaValueMin=${`${r}`} .ariaValueNow=${`${a}`} .ariaValueText=${n} class="container" @keydown=${this._onContainerKeyDown} role=slider style=${v(s)} tabindex=0 title=${l??L} touch-action=none ${x(this._containerRef)}>${c}</div>`}};C("arcgis-swipe",f);return f},"widgets/Swipe/SwipeViewModel",a,c,e,f)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import o from"./SAEE5GTI.js";import l from"./G4CPNGQ6.js";import"./DBJFHC3S.js";import{a as K}from"./JCRPP54Z.js";import"./GLNO2ZMW.js";import{a as U,b as G,g as N,h as v,j as H,k as q,m as c,n as $}from"./LDDAJOTV.js";import{a as S}from"./JLZJ354E.js";import{a as m}from"./SBUR54TP.js";import j from"./QFH7PJYV.js";import i from"./MZWO5JYA.js";import h from"./DUWXDGIW.js";import"./VJVKFKSG.js";import f from"./6IEKX6LJ.js";import{a as O}from"./KPOSO4HB.js";import{a as y}from"./JD74LG7K.js";import{a as k}from"./GRUB3M36.js";import e from"./R5NVFWFA.js";import b from"./GPVFCWMU.js";import{h as B}from"./VJ2SMYNX.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{d as P}from"./DU6OKLV4.js";import{B as M,M as d,N as g,O as R,P as p,R as u,S as w,U as A,a as C,b as n,x as I}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([ie,b,{on:se,watch:ae},,,{a:D},x,,,,,{a:j,b:z,c:J}])=>{var f={...K,section:"section",editing:"editing",editingForm:"editing-form"},re=C`:host{--arcgis-layer-list-visibility-icon: hidden}.editing-form{display:flex;height:100%}.editing{padding-block:var(--calcite-spacing-sm);padding-inline:var(--calcite-spacing-sm)}`,Q="nested",le=".*\\S+.*",V="data-basemap-layer-type",ne=x(ie),F=class extends R{constructor(){super(...arguments),this._baseListRef=d(),this._referenceListRef=d(),this._editTitleInputRef=d(),this._layerFlowItemRef=d(),this._panelFlowItemRef=d(),this._rootFlowItemRef=d(),this._editingFlowItemRef=d(),this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`basemap-${M()}`,this._openedLayersController=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._focusEditingFlowItem=!1,this.messages=O(),this.viewModel=ne(this),this.arcgisClose=k(this),this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{let r=s==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=c(e,this._allItems);if(!l?.sortable)return!1;let a=c(t,this._allItems),o=$(t),h=c(i,this._allItems),L=$(i),_=!!o&&!!L&&o===L,X={selected:l,from:a,to:h},Y=t.group,Z=i.group,ee=a?.layer?.type??"",te=h?.layer?.type??"",T=new Set(["map-image","catalog","knowledge-graph"]);return Y&&Z&&typeof r=="function"?r(X):_&&!T.has(ee)&&!T.has(te)&&l.layer?.type!=="sublayer"},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid??null},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid??null},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._clearActiveItem=()=>{this._activeItem=null},this._setCurrentActiveItem=e=>{this._activeItem=e},this._setActiveItem=e=>{if(this.visibilityAppearance!=="default")return;let t=Array.from(e.composedPath()).find(i=>i.classList?.contains(f.item));this._activeItem=c(t,this._allItems)??null},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._toggleEditingTitle=()=>{let e=!this.editingTitle;this.editingTitle=e,e?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0},this._formSubmit=e=>{e.preventDefault();let t=this._editTitleInputRef.value?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()},this._activeItem=null,this._tooltipReferenceMap=new Map,this._layerListMap=new Map,this.openedLayerLists=new b,this.view=this.viewModel.view,this.autoDestroyDisabled=!1,this.baseFilterText="",this.baseListItemCreatedFunction=this.viewModel.baseListItemCreatedFunction,this.basemapTitle=this.viewModel.basemapTitle,this.closed=!1,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.headingLevel=2,this.icon="layers",this.layerTablesEnabled=new b(["knowledge-graph"]),this.minFilterItems=G,this.openedLayers=new b,this.referenceFilterText="",this.referenceListItemCreatedFunction=this.viewModel.referenceListItemCreatedFunction,this.selectedItems=new b,this.selectionMode="none",this.visibilityAppearance="default",this.hideBaseLayers=!1,this.hideCatalogLayerList=!1,this.hideHeading=!1,this.hideReferenceLayers=!1,this.hideStatusIndicators=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showEditTitleButton=!1,this.showErrors=!1,this.showFilter=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=B()("state"),this.arcgisReady=I(),this.arcgisBaseFilterChange=I(),this.arcgisReferenceFilterChange=I(),this.arcgisOpenedLayersChange=I(),this.arcgisTriggerAction=D(()=>this.viewModel,"trigger-action")}static{this.properties={_activeItem:16,_catalogLayerList:16,_tableList:16,_tooltipReferenceMap:16,_layerListMap:16,openedLayerLists:16,_allItems:16,_visibleBaseItems:16,_visibleReferenceItems:16,_openedPanelItems:16,_totalBaseItems:16,_totalReferenceItems:16,_baseFilterEnabled:16,_referenceFilterEnabled:16,_renderedOpenLayerFlowItems:16,view:0,autoDestroyDisabled:5,baseFilterPredicate:0,baseFilterText:1,baseItems:32,baseListItemCreatedFunction:0,basemapTitle:1,catalogLayerList:32,catalogOptions:0,closed:5,collapsed:7,dragEnabled:5,editingTitle:5,filterPlaceholder:1,headingLevel:9,icon:1,knowledgeGraphOptions:0,label:1,layerTablesEnabled:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,mapImageOptions:0,minFilterItems:9,openedLayers:32,position:1,referenceElement:1,referenceFilterPredicate:0,referenceFilterText:1,referenceItems:32,referenceListItemCreatedFunction:0,selectedItems:0,selectionMode:1,tableList:32,tileOptions:0,visibilityAppearance:1,hideBaseLayers:5,hideCatalogLayerList:5,hideHeading:5,hideReferenceLayers:5,hideStatusIndicators:5,showCloseButton:5,showCollapseButton:5,showEditTitleButton:5,showErrors:5,showFilter:5,showTemporaryLayerIndicators:5,messageOverrides:0,state:32}}static{this.styles=[J,re,z]}get _allItems(){return this.referenceItems.concat(this.baseItems)}get _visibleBaseItems(){return this.baseItems.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _visibleReferenceItems(){return this.referenceItems.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _openedPanelItems(){return this._visibleReferenceItems.concat(this._visibleBaseItems).flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _totalBaseItems(){return this.viewModel.baseItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _totalReferenceItems(){return this.viewModel.referenceItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _baseFilterEnabled(){return this._totalBaseItems>=this.minFilterItems&&this.showFilter}get _referenceFilterEnabled(){return this._totalReferenceItems>=this.minFilterItems&&this.showFilter}get _renderedOpenLayerFlowItems(){return this.openedLayers.toArray().map((e,t)=>this._renderLayerFlowItem(e,t===this.openedLayers.length-1))}get baseItems(){return this.viewModel.baseItems}get catalogLayerList(){return this._catalogLayerList}get referenceItems(){return this.viewModel.referenceItems}get tableList(){return this._tableList}async destroy(){await this.manager.destroy(),this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}loaded(){this.manager.onLifecycle(()=>[se(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),ae(()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()],()=>N(this.selectedItems),{initial:!0})])}updated(){v(this._baseListRef.value,this.baseFilterPredicate,this.baseItems),v(this._referenceListRef.value,this.referenceFilterPredicate,this.referenceItems)}triggerAction(e,t){this.viewModel.triggerAction(e,t)}async _createFlowList(e,t){let i=this._layerListMap.get(e);if(i)return i;let s=e.type==="catalog"?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||this._layerListMap.set(e,s),s}async _handleOpenedLayersChange(){let{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();let s=new AbortController,{signal:r}=s;this._openedLayersController=s,e.forEach((o,h)=>{t.includes(h)||(o?.destroy?.(),e.delete(h))});let l=await Promise.all(t.map(o=>this._createFlowList(o,r)));if(r.aborted)return;i.removeAll(),i.addMany(l);let a=i.at(-1);a?"catalogLayer"in a?(this._catalogLayerList=a,this._tableList=void 0):(this._catalogLayerList=void 0,this._tableList=a):(this._catalogLayerList=void 0,this._tableList=void 0),this.arcgisOpenedLayersChange.emit()}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}async _createCatalogLayerList(e){let{headingLevel:t,catalogOptions:i,filterPlaceholder:s,minFilterItems:r,selectionMode:l,visibilityAppearance:a,layerTablesEnabled:o}=this;return w(n`<arcgis-catalog-layer-list .headingLevel=${t} .filterPlaceholder=${i?.filterPlaceholder??s} .listItemCreatedFunction=${i?.listItemCreatedFunction} .minFilterItems=${i?.minFilterItems??r} .selectionMode=${i?.selectionMode??l} .visibilityAppearance=${i?.visibilityAppearance??a} .showErrors=${i?.visibleElements?.errors??this.showErrors} .showFilter=${i?.visibleElements?.filter??this.showFilter} .hideStatusIndicators=${i?.visibleElements?.statusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.visibleElements?.temporaryLayerIndicators??this.showTemporaryLayerIndicators} @arcgisReady=${h=>h.stopPropagation()} .catalogLayer=${e} .layerTablesEnabled=${o} .view=${this.view} .referenceElement=${this.referenceElement} @catalogOpen=${this._onCatalogOpen} @tablesOpen=${this._onTablesOpen}></arcgis-catalog-layer-list>`)}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){let t=this._getTableListParams(e);return w(n`<arcgis-table-list .headingLevel=${t?.headingLevel??this.headingLevel} .selectionMode=${t?.selectionMode??this.selectionMode} .dragEnabled=${t?.dragEnabled??this.dragEnabled} .collapsed=${t?.collapsed} .filterPlaceholder=${t?.filterPlaceholder} .filterText=${t?.filterText} .icon=${t?.icon??void 0} .label=${t?.label??void 0} .listItemCreatedFunction=${t?.listItemCreatedFunction} .tables=${t?.tables} .referenceElement=${this.referenceElement} @arcgisReady=${i=>i.stopPropagation()}></arcgis-table-list>`)}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){let r=c(i,this._allItems),l=c(e,this._allItems),a=c(t,this._allItems),o=W(t),h=W(e);s==null||!r||!a||!l||!o||!h||this.viewModel.moveListItem({targetItem:r,fromParentItem:a,toParentItem:l,newIndex:s,from:o,to:h})}_handleCalciteListDragEnd(e){let{fromEl:t,toEl:i,dragEl:s,oldIndex:r}=e;if(t!==i){s.remove();return}r==null||!t||!s||t.insertBefore(s,t.children[r])}_onCalciteListOrderChange(e){let{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:r,newIndex:l}=e,a=t?.newIndex===l&&t?.dragEl===r&&t?.toEl===i&&t?.fromEl===s;if(!s||!i||a)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=r.value.layer?.uid??null;let o=s,h=i;if(o===h){let L=Array.from(s.children).filter(_=>_?.matches("calcite-list-item")).map(_=>_.value.layer?.uid??"");this._sortLayers(o,L);return}this._moveLayerFromChildList({toEl:h,fromEl:o,dragEl:r,newIndex:l})}_sortLayers(e,t){if(e===this._referenceListRef.value||e===this._baseListRef.value){let s=e===this._baseListRef.value?this.view?.map?.basemap?.baseLayers:this.view?.map?.basemap?.referenceLayers;H(s,t);return}let i=c(e,this._allItems);i&&q(i,t)}_handleCalciteListChange(e){if(this.selectionMode==="none")return;let t=e.target.selectedItems.map(i=>c(i,this._allItems)).filter(Boolean);this.selectedItems.removeAll(),this.selectedItems.addMany(t)}_focusFlowItem(e,t){return!t||!e?t:(e.setFocus(),!1)}render(){let e={[y.hidden]:this.state==="loading",[y.disabled]:this.state==="disabled"};return n`<div class=${p(P(y.widget,y.panel,e))}>${this._renderItems()}${this._renderItemTooltips()}</div>`}_renderItemTooltip(e){return e?n`<calcite-tooltip overlay-positioning=fixed .referenceElement=${this._tooltipReferenceMap.get(e.layer?.uid??"")}>${this.messages.layerIncompatibleTooltip}</calcite-tooltip>`:null}_renderItemTooltipNodes(e){if(e.incompatible)return this._renderItemTooltip(e);let t=e.children?.filter(i=>!i.hidden).toArray().map(i=>this._renderItemTooltipNodes(i));return t?.length?t:null}_renderItemTooltips(){return this._visibleReferenceItems.concat(this._visibleBaseItems).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoLayersInfoMessage(e){return n`<div slot=message>${e}</div>`}_renderNoLayersInfo(e,t){return n`<div class=${p(f.itemMessage)}>${m(t,n`<calcite-notice icon=information kind=info open width=full>${this._renderNoLayersInfoMessage(e)}</calcite-notice>`)}</div>`}_renderEditingInput(){return n`<div class=${p(f.editing)}><calcite-label>${this.messages.basemapTitle}<calcite-input .label=${this.messages.basemapTitle} name=basemaptitle .pattern=${le} .placeholder=${this.messages.basemapTitle} required title=${this.messages.basemapTitle??u} type=text .value=${this.viewModel.basemapTitle??void 0} ${g(this._editTitleInputRef)}></calcite-input></calcite-label></div>`}_renderEditingForm(){return this.editingTitle?n`<form class=${p(f.editingForm)} @submit=${this._formSubmit}><calcite-flow-item .heading=${this.hideHeading?void 0:this.messages.basemapTitle} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&!this._openedPanelItems.length} @calciteFlowItemBack=${e=>{e.preventDefault(),this._toggleEditingTitle()}} ${g(this._editingFlowItemRef)}>${this._renderEditingInput()}<calcite-button appearance=outline @click=${this._toggleEditingTitle} slot=footer-actions width=full>${this.messages.cancel}</calcite-button><calcite-button slot=footer-actions type=submit width=full>${this.messages.ok}</calcite-button></calcite-flow-item></form>`:null}_renderEditTitleButton(){return this.showEditTitleButton&&!this.editingTitle?n`<calcite-action icon=pencil @click=${this._toggleEditingTitle} slot=header-actions-end .text=${this.messages.edit??""} title=${this.messages.edit??u}></calcite-action>`:null}_renderItems(){let e=[m("root-flow-item",n`<calcite-flow-item .closable=${this.showCloseButton} .closed=${this.closed} .collapsed=${this.collapsed} .collapsible=${this.showCollapseButton} .heading=${this.hideHeading?void 0:this.viewModel.basemapTitle??this.messages.componentLabel} .headingLevel=${this.headingLevel} .selected=${!this.editingTitle&&!this.openedLayers.length&&!this._openedPanelItems.length} @calciteFlowItemClose=${()=>{this.closed=!0}} ${g(this._rootFlowItemRef)}>${this._renderEditTitleButton()}${this._renderReferenceSection()}${this._renderBaseSection()}</calcite-flow-item>`),this._renderEditingForm(),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return this._focusRootFlowItem=this._focusFlowItem(this._rootFlowItemRef.value,this._focusRootFlowItem),this._focusEditingFlowItem=this._focusFlowItem(this._editingFlowItemRef.value,this._focusEditingFlowItem),this.closed?null:m("root-flow",n`<calcite-flow>${e}</calcite-flow>`)}_renderPanelFlowItems(){return S(this._openedPanelItems.toArray(),e=>e.uid,(e,t)=>{let{panel:i,title:s}=e,r=()=>this._handlePanelFlowItemBack(i);return this._focusPanelFlowItem=this._focusFlowItem(this._panelFlowItemRef.value,this._focusPanelFlowItem),n`<calcite-flow-item .description=${s} .heading=${i.title} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&t===this._openedPanelItems.length-1} @calciteFlowItemBack=${l=>{l.preventDefault(),r()}} ${g(this._panelFlowItemRef)}><arcgis-layer-list-item-panel .item=${e} .view=${this.view}></arcgis-layer-list-item-panel><calcite-button appearance=transparent @click=${r} slot=footer-actions width=full>${this.messages.back}</calcite-button></calcite-flow-item>`})}_renderLayerFlowItem(e,t){let i=e.title||this.messages.untitledLayer;return this._focusLayerFlowItem===e.uid&&(this._focusLayerFlowItem=this._focusFlowItem(this._layerFlowItemRef.value,!0)?e.uid:null),m(e.uid,n`<calcite-flow-item data-layer-uid=${e.uid??u} .description=${i} .heading=${this.messages[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${s=>{s.preventDefault(),this.openedLayers.pop();let r=this.openedLayers.at(-1);r?this._focusLayerFlowItem=r.uid:this._focusRootFlowItem=!0}} ${g(this._layerFlowItemRef)}>${this._layerListMap.get(e)}</calcite-flow-item>`)}_renderList(e,t,i){let s=t==="reference"?this._referenceFilterEnabled:this._baseFilterEnabled,r=t==="reference"?this.referenceFilterText:this.baseFilterText,l=(t==="reference"?this.messages.noReferenceLayers:this.messages.noBaseLayers)??this.messages.noItemsToDisplay??"";return m(`block-${t}`,n`<calcite-block class=${p(f.section)} collapsible expanded .heading=${t==="reference"?this.messages.referenceHeading:this.messages.baseHeading} .headingLevel=${this.headingLevel+1}>${e?.length?null:this._renderNoLayersInfo(l,t)}${m(`list-${t}`,n`<calcite-list @focusin=${this._setActiveItem} @focusout=${this._clearActiveItem} .canPull=${a=>this._canMove(a,"pull")} .canPut=${a=>this._canMove(a,"put")} data-basemap-layer-type=${t??u} data-layer-type=${this._rootGroupUid??u} .displayMode=${Q} .dragEnabled=${this.dragEnabled} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholder} .filterProps=${U} .filterText=${s?r:""} .group=${this._rootGroupUid} .label=${this.messages.componentLabel??""} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=border .selectionMode=${this.selectionMode} @calciteListChange=${this._handleCalciteListChange} @calciteListDragEnd=${a=>this._handleCalciteListDragEnd(a.detail)} @calciteListFilter=${a=>{let o=a.currentTarget?.filterText??"";this[t==="reference"?"referenceFilterText":"baseFilterText"]=o,t==="base"?this.arcgisBaseFilterChange.emit():this.arcgisReferenceFilterChange.emit()}} @calciteListOrderChange=${a=>this._onCalciteListOrderChange(a.detail)} ${g(t==="reference"?this._referenceListRef:this._baseListRef)}>${e?.toArray().map(a=>this._renderItem(a,i))}${s?n`<div class=${p(f.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this._renderNoLayersInfoMessage(l)}</calcite-notice></div>`:null}</calcite-list>`)}</calcite-block>`)}_renderBaseSection(){return this.hideBaseLayers?null:this._renderList(this._visibleBaseItems,"base",this._visibleBaseItems.length===1)}_renderReferenceSection(){return this.hideReferenceLayers?null:this._renderList(this._visibleReferenceItems,"reference",!1)}_renderItem(e,t,i,s){return m(e.uid,j({activeItem:this._activeItem,canMove:this._canMove,css:f,displayMode:Q,dragEnabled:this.dragEnabled&&!t,hideCatalogLayerList:this.hideCatalogLayerList,hideStatusIndicators:this.hideStatusIndicators,item:e,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,operationalItems:this._allItems,parent:i,parentTitles:s,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,setCurrentActiveItem:this._setCurrentActiveItem,clearActiveItem:this._clearActiveItem,showErrors:this.showErrors,showTemporaryLayerIndicators:this.showTemporaryLayerIndicators,visibilityAppearance:this.visibilityAppearance,handleAction:this._onTriggerAction,handleCatalogOpen:this._onCatalogOpen,handlePanelOpen:this._onPanelOpen,handleSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,handleTablesOpen:this._onTablesOpen,handleTooltipReferenceChange:this._onTooltipReferenceChange,view:this.view}))}};function W(E){let e=E.closest(`[${V}]`)?.getAttribute(V);return e==="base"||e==="reference"?e:null}A("arcgis-basemap-layer-list-next",F);return F},"widgets/BasemapLayerList/BasemapLayerListViewModel","core/Collection","core/reactiveUtils",a,b,e,f,h,i,j,l,o)
|
|
2
|
+
import o from"./SAEE5GTI.js";import l from"./G4CPNGQ6.js";import"./XR4WLNHC.js";import{a as K}from"./JCRPP54Z.js";import"./DI6UP5OE.js";import{a as U,b as G,g as N,h as v,j as H,k as q,m as c,n as $}from"./LDDAJOTV.js";import{a as S}from"./JLZJ354E.js";import{a as m}from"./SBUR54TP.js";import j from"./QFH7PJYV.js";import i from"./MZWO5JYA.js";import h from"./DUWXDGIW.js";import"./VJVKFKSG.js";import f from"./J5WF4RA3.js";import{a as O}from"./I5OLG552.js";import{a as y}from"./JD74LG7K.js";import{a as k}from"./RUFWW2L5.js";import e from"./BPXDBUNH.js";import b from"./GSI2ZI7D.js";import{g as B}from"./BD27PEC7.js";import"./IDZCPNFC.js";import a from"./HKTQWWXP.js";import{d as P}from"./DU6OKLV4.js";import{B as M,M as d,N as g,O as R,P as p,R as u,S as w,U as A,a as C,b as n,x as I}from"./KLXEJCTT.js";import"./H6RQVSYM.js";export default $arcgis.t(([ie,b,{on:se,watch:ae},,,{a:D},x,,,,,{a:j,b:z,c:J}])=>{var f={...K,section:"section",editing:"editing",editingForm:"editing-form"},re=C`:host{--arcgis-layer-list-visibility-icon: hidden}.editing-form{display:flex;height:100%}.editing{padding-block:var(--calcite-spacing-sm);padding-inline:var(--calcite-spacing-sm)}`,Q="nested",le=".*\\S+.*",V="data-basemap-layer-type",ne=x(ie),F=class extends R{constructor(){super(...arguments),this._baseListRef=d(),this._referenceListRef=d(),this._editTitleInputRef=d(),this._layerFlowItemRef=d(),this._panelFlowItemRef=d(),this._rootFlowItemRef=d(),this._editingFlowItemRef=d(),this._lastDragDetail=null,this._selectedDragItemLayerUid=null,this._rootGroupUid=`basemap-${M()}`,this._openedLayersController=null,this._focusRootFlowItem=!1,this._focusPanelFlowItem=!1,this._focusLayerFlowItem=null,this._focusEditingFlowItem=!1,this.messages=O(),this.viewModel=ne(this),this.arcgisClose=k(this),this._canMove=({dragEl:e,fromEl:t,toEl:i},s)=>{let r=s==="pull"?this.listItemCanGiveFunction:this.listItemCanReceiveFunction,l=c(e,this._allItems);if(!l?.sortable)return!1;let a=c(t,this._allItems),o=$(t),h=c(i,this._allItems),L=$(i),_=!!o&&!!L&&o===L,X={selected:l,from:a,to:h},Y=t.group,Z=i.group,ee=a?.layer?.type??"",te=h?.layer?.type??"",T=new Set(["map-image","catalog","knowledge-graph"]);return Y&&Z&&typeof r=="function"?r(X):_&&!T.has(ee)&&!T.has(te)&&l.layer?.type!=="sublayer"},this._onTriggerAction=(e,t)=>{this.triggerAction(e,t)},this._onTooltipReferenceChange=(e,t)=>{t?this._tooltipReferenceMap.set(e,t):this._tooltipReferenceMap.delete(e)},this._onTablesOpen=e=>{this.openedLayers.push(e.layer),this._focusLayerFlowItem=e.layer?.uid??null},this._onCatalogOpen=e=>{this.openedLayers.push(e.layer?.parent),this._focusLayerFlowItem=e.layer?.uid??null},this._onPanelOpen=()=>{this._focusPanelFlowItem=!0},this._clearActiveItem=()=>{this._activeItem=null},this._setCurrentActiveItem=e=>{this._activeItem=e},this._setActiveItem=e=>{if(this.visibilityAppearance!=="default")return;let t=Array.from(e.composedPath()).find(i=>i.classList?.contains(f.item));this._activeItem=c(t,this._allItems)??null},this._onSelectedDragItemLayerUidChange=e=>{this._selectedDragItemLayerUid=e},this._toggleEditingTitle=()=>{let e=!this.editingTitle;this.editingTitle=e,e?this._focusEditingFlowItem=!0:this._focusRootFlowItem=!0},this._formSubmit=e=>{e.preventDefault();let t=this._editTitleInputRef.value?.value;t?.trim()&&(this.basemapTitle=t),this._toggleEditingTitle()},this._activeItem=null,this._tooltipReferenceMap=new Map,this._layerListMap=new Map,this.openedLayerLists=new b,this.view=this.viewModel.view,this.autoDestroyDisabled=!1,this.baseFilterText="",this.baseListItemCreatedFunction=this.viewModel.baseListItemCreatedFunction,this.basemapTitle=this.viewModel.basemapTitle,this.closed=!1,this.collapsed=!1,this.dragEnabled=!1,this.editingTitle=!1,this.filterPlaceholder="",this.headingLevel=2,this.icon="layers",this.layerTablesEnabled=new b(["knowledge-graph"]),this.minFilterItems=G,this.openedLayers=new b,this.referenceFilterText="",this.referenceListItemCreatedFunction=this.viewModel.referenceListItemCreatedFunction,this.selectedItems=new b,this.selectionMode="none",this.visibilityAppearance="default",this.hideBaseLayers=!1,this.hideCatalogLayerList=!1,this.hideHeading=!1,this.hideReferenceLayers=!1,this.hideStatusIndicators=!1,this.showCloseButton=!1,this.showCollapseButton=!1,this.showEditTitleButton=!1,this.showErrors=!1,this.showFilter=!1,this.showTemporaryLayerIndicators=!1,this.state=this.viewModel.state,this.arcgisPropertyChange=B()("state"),this.arcgisReady=I(),this.arcgisBaseFilterChange=I(),this.arcgisReferenceFilterChange=I(),this.arcgisOpenedLayersChange=I(),this.arcgisTriggerAction=D(()=>this.viewModel,"trigger-action")}static{this.properties={_activeItem:16,_catalogLayerList:16,_tableList:16,_tooltipReferenceMap:16,_layerListMap:16,openedLayerLists:16,_allItems:16,_visibleBaseItems:16,_visibleReferenceItems:16,_openedPanelItems:16,_totalBaseItems:16,_totalReferenceItems:16,_baseFilterEnabled:16,_referenceFilterEnabled:16,_renderedOpenLayerFlowItems:16,view:0,autoDestroyDisabled:5,baseFilterPredicate:0,baseFilterText:1,baseItems:32,baseListItemCreatedFunction:0,basemapTitle:1,catalogLayerList:32,catalogOptions:0,closed:5,collapsed:7,dragEnabled:5,editingTitle:5,filterPlaceholder:1,headingLevel:9,icon:1,knowledgeGraphOptions:0,label:1,layerTablesEnabled:0,listItemCanGiveFunction:0,listItemCanReceiveFunction:0,mapImageOptions:0,minFilterItems:9,openedLayers:32,position:1,referenceElement:1,referenceFilterPredicate:0,referenceFilterText:1,referenceItems:32,referenceListItemCreatedFunction:0,selectedItems:0,selectionMode:1,tableList:32,tileOptions:0,visibilityAppearance:1,hideBaseLayers:5,hideCatalogLayerList:5,hideHeading:5,hideReferenceLayers:5,hideStatusIndicators:5,showCloseButton:5,showCollapseButton:5,showEditTitleButton:5,showErrors:5,showFilter:5,showTemporaryLayerIndicators:5,messageOverrides:0,state:32}}static{this.styles=[J,re,z]}get _allItems(){return this.referenceItems.concat(this.baseItems)}get _visibleBaseItems(){return this.baseItems.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _visibleReferenceItems(){return this.referenceItems.filter(e=>!e.hidden&&(this.showErrors||!e.error))}get _openedPanelItems(){return this._visibleReferenceItems.concat(this._visibleBaseItems).flatten(e=>e.children).filter(({hidden:e,panel:t})=>!e&&t?.open&&!t.disabled&&t.flowEnabled)}get _totalBaseItems(){return this.viewModel.baseItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _totalReferenceItems(){return this.viewModel.referenceItems.flatten(e=>e.children.filter(t=>t.layer?.type!=="catalog-dynamic-group")).length}get _baseFilterEnabled(){return this._totalBaseItems>=this.minFilterItems&&this.showFilter}get _referenceFilterEnabled(){return this._totalReferenceItems>=this.minFilterItems&&this.showFilter}get _renderedOpenLayerFlowItems(){return this.openedLayers.toArray().map((e,t)=>this._renderLayerFlowItem(e,t===this.openedLayers.length-1))}get baseItems(){return this.viewModel.baseItems}get catalogLayerList(){return this._catalogLayerList}get referenceItems(){return this.viewModel.referenceItems}get tableList(){return this._tableList}async destroy(){await this.manager.destroy(),this._destroyOpenedLayerLists(),this._tooltipReferenceMap.clear()}loaded(){this.manager.onLifecycle(()=>[se(()=>this.openedLayers,"change",()=>{this._handleOpenedLayersChange()},{initial:!0}),ae(()=>[this.viewModel.referenceItems.toArray(),this.viewModel.baseItems.toArray()],()=>N(this.selectedItems),{initial:!0})])}updated(){v(this._baseListRef.value,this.baseFilterPredicate,this.baseItems),v(this._referenceListRef.value,this.referenceFilterPredicate,this.referenceItems)}triggerAction(e,t){this.viewModel.triggerAction(e,t)}async _createFlowList(e,t){let i=this._layerListMap.get(e);if(i)return i;let s=e.type==="catalog"?await this._createCatalogLayerList(e):await this._createTableList(e);return t.aborted||this._layerListMap.set(e,s),s}async _handleOpenedLayersChange(){let{_layerListMap:e,openedLayers:t,openedLayerLists:i}=this;this._openedLayersController?.abort();let s=new AbortController,{signal:r}=s;this._openedLayersController=s,e.forEach((o,h)=>{t.includes(h)||(o?.destroy?.(),e.delete(h))});let l=await Promise.all(t.map(o=>this._createFlowList(o,r)));if(r.aborted)return;i.removeAll(),i.addMany(l);let a=i.at(-1);a?"catalogLayer"in a?(this._catalogLayerList=a,this._tableList=void 0):(this._catalogLayerList=void 0,this._tableList=a):(this._catalogLayerList=void 0,this._tableList=void 0),this.arcgisOpenedLayersChange.emit()}_destroyOpenedLayerLists(){this.openedLayerLists.destroyAll(),this.openedLayers.removeAll(),this._layerListMap.clear()}async _createCatalogLayerList(e){let{headingLevel:t,catalogOptions:i,filterPlaceholder:s,minFilterItems:r,selectionMode:l,visibilityAppearance:a,layerTablesEnabled:o}=this;return w(n`<arcgis-catalog-layer-list .headingLevel=${t} .filterPlaceholder=${i?.filterPlaceholder??s} .listItemCreatedFunction=${i?.listItemCreatedFunction} .minFilterItems=${i?.minFilterItems??r} .selectionMode=${i?.selectionMode??l} .visibilityAppearance=${i?.visibilityAppearance??a} .showErrors=${i?.visibleElements?.errors??this.showErrors} .showFilter=${i?.visibleElements?.filter??this.showFilter} .hideStatusIndicators=${i?.visibleElements?.statusIndicators??this.hideStatusIndicators} .showTemporaryLayerIndicators=${i?.visibleElements?.temporaryLayerIndicators??this.showTemporaryLayerIndicators} @arcgisReady=${h=>h.stopPropagation()} .catalogLayer=${e} .layerTablesEnabled=${o} .view=${this.view} .referenceElement=${this.referenceElement} @catalogOpen=${this._onCatalogOpen} @tablesOpen=${this._onTablesOpen}></arcgis-catalog-layer-list>`)}_getTableListParams(e){switch(e.type){case"knowledge-graph":return{...this.knowledgeGraphOptions,tables:e.tables};case"map-image":return{...this.mapImageOptions,tables:e.subtables};case"tile":return{...this.tileOptions,tables:e.subtables};default:return null}}async _createTableList(e){let t=this._getTableListParams(e);return w(n`<arcgis-table-list .headingLevel=${t?.headingLevel??this.headingLevel} .selectionMode=${t?.selectionMode??this.selectionMode} .dragEnabled=${t?.dragEnabled??this.dragEnabled} .collapsed=${t?.collapsed} .filterPlaceholder=${t?.filterPlaceholder} .filterText=${t?.filterText} .icon=${t?.icon??void 0} .label=${t?.label??void 0} .listItemCreatedFunction=${t?.listItemCreatedFunction} .tables=${t?.tables} .referenceElement=${this.referenceElement} @arcgisReady=${i=>i.stopPropagation()}></arcgis-table-list>`)}_handlePanelFlowItemBack(e){e.open=!1,this._focusRootFlowItem=!0}_moveLayerFromChildList({toEl:e,fromEl:t,dragEl:i,newIndex:s}){let r=c(i,this._allItems),l=c(e,this._allItems),a=c(t,this._allItems),o=W(t),h=W(e);s==null||!r||!a||!l||!o||!h||this.viewModel.moveListItem({targetItem:r,fromParentItem:a,toParentItem:l,newIndex:s,from:o,to:h})}_handleCalciteListDragEnd(e){let{fromEl:t,toEl:i,dragEl:s,oldIndex:r}=e;if(t!==i){s.remove();return}r==null||!t||!s||t.insertBefore(s,t.children[r])}_onCalciteListOrderChange(e){let{_lastDragDetail:t}=this,{toEl:i,fromEl:s,dragEl:r,newIndex:l}=e,a=t?.newIndex===l&&t?.dragEl===r&&t?.toEl===i&&t?.fromEl===s;if(!s||!i||a)return;this._lastDragDetail=e,this._selectedDragItemLayerUid=r.value.layer?.uid??null;let o=s,h=i;if(o===h){let L=Array.from(s.children).filter(_=>_?.matches("calcite-list-item")).map(_=>_.value.layer?.uid??"");this._sortLayers(o,L);return}this._moveLayerFromChildList({toEl:h,fromEl:o,dragEl:r,newIndex:l})}_sortLayers(e,t){if(e===this._referenceListRef.value||e===this._baseListRef.value){let s=e===this._baseListRef.value?this.view?.map?.basemap?.baseLayers:this.view?.map?.basemap?.referenceLayers;H(s,t);return}let i=c(e,this._allItems);i&&q(i,t)}_handleCalciteListChange(e){if(this.selectionMode==="none")return;let t=e.target.selectedItems.map(i=>c(i,this._allItems)).filter(Boolean);this.selectedItems.removeAll(),this.selectedItems.addMany(t)}_focusFlowItem(e,t){return!t||!e?t:(e.setFocus(),!1)}render(){let e={[y.hidden]:this.state==="loading",[y.disabled]:this.state==="disabled"};return n`<div class=${p(P(y.widget,y.panel,e))}>${this._renderItems()}${this._renderItemTooltips()}</div>`}_renderItemTooltip(e){return e?n`<calcite-tooltip overlay-positioning=fixed .referenceElement=${this._tooltipReferenceMap.get(e.layer?.uid??"")}>${this.messages.layerIncompatibleTooltip}</calcite-tooltip>`:null}_renderItemTooltipNodes(e){if(e.incompatible)return this._renderItemTooltip(e);let t=e.children?.filter(i=>!i.hidden).toArray().map(i=>this._renderItemTooltipNodes(i));return t?.length?t:null}_renderItemTooltips(){return this._visibleReferenceItems.concat(this._visibleBaseItems).toArray().map(e=>this._renderItemTooltipNodes(e))}_renderNoLayersInfoMessage(e){return n`<div slot=message>${e}</div>`}_renderNoLayersInfo(e,t){return n`<div class=${p(f.itemMessage)}>${m(t,n`<calcite-notice icon=information kind=info open width=full>${this._renderNoLayersInfoMessage(e)}</calcite-notice>`)}</div>`}_renderEditingInput(){return n`<div class=${p(f.editing)}><calcite-label>${this.messages.basemapTitle}<calcite-input .label=${this.messages.basemapTitle} name=basemaptitle .pattern=${le} .placeholder=${this.messages.basemapTitle} required title=${this.messages.basemapTitle??u} type=text .value=${this.viewModel.basemapTitle??void 0} ${g(this._editTitleInputRef)}></calcite-input></calcite-label></div>`}_renderEditingForm(){return this.editingTitle?n`<form class=${p(f.editingForm)} @submit=${this._formSubmit}><calcite-flow-item .heading=${this.hideHeading?void 0:this.messages.basemapTitle} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&!this._openedPanelItems.length} @calciteFlowItemBack=${e=>{e.preventDefault(),this._toggleEditingTitle()}} ${g(this._editingFlowItemRef)}>${this._renderEditingInput()}<calcite-button appearance=outline @click=${this._toggleEditingTitle} slot=footer-actions width=full>${this.messages.cancel}</calcite-button><calcite-button slot=footer-actions type=submit width=full>${this.messages.ok}</calcite-button></calcite-flow-item></form>`:null}_renderEditTitleButton(){return this.showEditTitleButton&&!this.editingTitle?n`<calcite-action icon=pencil @click=${this._toggleEditingTitle} slot=header-actions-end .text=${this.messages.edit??""} title=${this.messages.edit??u}></calcite-action>`:null}_renderItems(){let e=[m("root-flow-item",n`<calcite-flow-item .closable=${this.showCloseButton} .closed=${this.closed} .collapsed=${this.collapsed} .collapsible=${this.showCollapseButton} .heading=${this.hideHeading?void 0:this.viewModel.basemapTitle??this.messages.componentLabel} .headingLevel=${this.headingLevel} .selected=${!this.editingTitle&&!this.openedLayers.length&&!this._openedPanelItems.length} @calciteFlowItemClose=${()=>{this.closed=!0}} ${g(this._rootFlowItemRef)}>${this._renderEditTitleButton()}${this._renderReferenceSection()}${this._renderBaseSection()}</calcite-flow-item>`),this._renderEditingForm(),this._renderPanelFlowItems(),this._renderedOpenLayerFlowItems];return this._focusRootFlowItem=this._focusFlowItem(this._rootFlowItemRef.value,this._focusRootFlowItem),this._focusEditingFlowItem=this._focusFlowItem(this._editingFlowItemRef.value,this._focusEditingFlowItem),this.closed?null:m("root-flow",n`<calcite-flow>${e}</calcite-flow>`)}_renderPanelFlowItems(){return S(this._openedPanelItems.toArray(),e=>e.uid,(e,t)=>{let{panel:i,title:s}=e,r=()=>this._handlePanelFlowItemBack(i);return this._focusPanelFlowItem=this._focusFlowItem(this._panelFlowItemRef.value,this._focusPanelFlowItem),n`<calcite-flow-item .description=${s} .heading=${i.title} .headingLevel=${this.headingLevel} .selected=${!this.openedLayers.length&&t===this._openedPanelItems.length-1} @calciteFlowItemBack=${l=>{l.preventDefault(),r()}} ${g(this._panelFlowItemRef)}><arcgis-layer-list-item-panel .item=${e} .view=${this.view}></arcgis-layer-list-item-panel><calcite-button appearance=transparent @click=${r} slot=footer-actions width=full>${this.messages.back}</calcite-button></calcite-flow-item>`})}_renderLayerFlowItem(e,t){let i=e.title||this.messages.untitledLayer;return this._focusLayerFlowItem===e.uid&&(this._focusLayerFlowItem=this._focusFlowItem(this._layerFlowItemRef.value,!0)?e.uid:null),m(e.uid,n`<calcite-flow-item data-layer-uid=${e.uid??u} .description=${i} .heading=${this.messages[e.type==="catalog"?"catalogLayers":"tables"]} .headingLevel=${this.headingLevel} .selected=${t} @calciteFlowItemBack=${s=>{s.preventDefault(),this.openedLayers.pop();let r=this.openedLayers.at(-1);r?this._focusLayerFlowItem=r.uid:this._focusRootFlowItem=!0}} ${g(this._layerFlowItemRef)}>${this._layerListMap.get(e)}</calcite-flow-item>`)}_renderList(e,t,i){let s=t==="reference"?this._referenceFilterEnabled:this._baseFilterEnabled,r=t==="reference"?this.referenceFilterText:this.baseFilterText,l=(t==="reference"?this.messages.noReferenceLayers:this.messages.noBaseLayers)??this.messages.noItemsToDisplay??"";return m(`block-${t}`,n`<calcite-block class=${p(f.section)} collapsible expanded .heading=${t==="reference"?this.messages.referenceHeading:this.messages.baseHeading} .headingLevel=${this.headingLevel+1}>${e?.length?null:this._renderNoLayersInfo(l,t)}${m(`list-${t}`,n`<calcite-list @focusin=${this._setActiveItem} @focusout=${this._clearActiveItem} .canPull=${a=>this._canMove(a,"pull")} .canPut=${a=>this._canMove(a,"put")} data-basemap-layer-type=${t??u} data-layer-type=${this._rootGroupUid??u} .displayMode=${Q} .dragEnabled=${this.dragEnabled} .filterEnabled=${s} .filterPlaceholder=${this.filterPlaceholder} .filterProps=${U} .filterText=${s?r:""} .group=${this._rootGroupUid} .label=${this.messages.componentLabel??""} @mouseleave=${this._clearActiveItem} @mouseover=${this._setActiveItem} selection-appearance=border .selectionMode=${this.selectionMode} @calciteListChange=${this._handleCalciteListChange} @calciteListDragEnd=${a=>this._handleCalciteListDragEnd(a.detail)} @calciteListFilter=${a=>{let o=a.currentTarget?.filterText??"";this[t==="reference"?"referenceFilterText":"baseFilterText"]=o,t==="base"?this.arcgisBaseFilterChange.emit():this.arcgisReferenceFilterChange.emit()}} @calciteListOrderChange=${a=>this._onCalciteListOrderChange(a.detail)} ${g(t==="reference"?this._referenceListRef:this._baseListRef)}>${e?.toArray().map(a=>this._renderItem(a,i))}${s?n`<div class=${p(f.filterNoResults)} slot=filter-no-results><calcite-notice kind=info open width=full>${this._renderNoLayersInfoMessage(l)}</calcite-notice></div>`:null}</calcite-list>`)}</calcite-block>`)}_renderBaseSection(){return this.hideBaseLayers?null:this._renderList(this._visibleBaseItems,"base",this._visibleBaseItems.length===1)}_renderReferenceSection(){return this.hideReferenceLayers?null:this._renderList(this._visibleReferenceItems,"reference",!1)}_renderItem(e,t,i,s){return m(e.uid,j({activeItem:this._activeItem,canMove:this._canMove,css:f,displayMode:Q,dragEnabled:this.dragEnabled&&!t,hideCatalogLayerList:this.hideCatalogLayerList,hideStatusIndicators:this.hideStatusIndicators,item:e,layerTablesEnabled:this.layerTablesEnabled,listModeDisabled:this.viewModel.listModeDisabled,messages:this.messages,operationalItems:this._allItems,parent:i,parentTitles:s,rootGroupUid:this._rootGroupUid,selectedDragItemLayerUid:this._selectedDragItemLayerUid,selectedItems:this.selectedItems,selectionMode:this.selectionMode,setCurrentActiveItem:this._setCurrentActiveItem,clearActiveItem:this._clearActiveItem,showErrors:this.showErrors,showTemporaryLayerIndicators:this.showTemporaryLayerIndicators,visibilityAppearance:this.visibilityAppearance,handleAction:this._onTriggerAction,handleCatalogOpen:this._onCatalogOpen,handlePanelOpen:this._onPanelOpen,handleSelectedDragItemLayerUidChange:this._onSelectedDragItemLayerUidChange,handleTablesOpen:this._onTablesOpen,handleTooltipReferenceChange:this._onTooltipReferenceChange,view:this.view}))}};function W(E){let e=E.closest(`[${V}]`)?.getAttribute(V);return e==="base"||e==="reference"?e:null}A("arcgis-basemap-layer-list-next",F);return F},"widgets/BasemapLayerList/BasemapLayerListViewModel","core/Collection","core/reactiveUtils",a,b,e,f,h,i,j,l,o)
|