@arcgis/map-components 5.2.0-next.85 → 5.2.0-next.87
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/3IY3D62Z.js +2 -0
- package/dist/cdn/{YXA3DG4H.js → 3W4IH5LQ.js} +1 -1
- package/dist/cdn/5L5UYV3H.js +2 -0
- package/dist/cdn/6NGRUK5C.js +2 -0
- package/dist/cdn/BPHJ4VBC.js +2 -0
- package/dist/cdn/CFB4ZR5F.js +2 -0
- package/dist/cdn/D6MRDGUC.js +2 -0
- package/dist/cdn/EFUTKX2O.js +2 -0
- package/dist/cdn/{PNSES5YC.js → EGUVICJF.js} +1 -1
- package/dist/cdn/FXK4G4VK.js +2 -0
- package/dist/cdn/GNVPXNTX.js +2 -0
- package/dist/cdn/HTEIMRY6.js +2 -0
- package/dist/cdn/I2D75Q7M.js +2 -0
- package/dist/cdn/IMG5GOJB.js +2 -0
- package/dist/cdn/IOZ5U2X7.js +2 -0
- package/dist/cdn/K3N6NHJW.js +2 -0
- package/dist/cdn/KN4PG54T.js +2 -0
- package/dist/cdn/{56NINR5L.js → KNMMVZVV.js} +1 -1
- package/dist/cdn/M66G67OC.js +2 -0
- package/dist/cdn/MQX2F54G.js +2 -0
- package/dist/cdn/NFWFRHUT.js +2 -0
- package/dist/cdn/PCEAIDCB.js +2 -0
- package/dist/cdn/PMU2DO3P.js +2 -0
- package/dist/cdn/{LTGPFC6N.js → PWEF6IKF.js} +1 -1
- package/dist/cdn/{HWLBIEGO.js → RS5BEGC5.js} +1 -1
- package/dist/cdn/{K4V76SMR.js → TAIZWQYU.js} +1 -1
- package/dist/cdn/TCMRGJTC.js +2 -0
- package/dist/cdn/TPG3TU6B.js +2 -0
- package/dist/cdn/TSZ26CSX.js +2 -0
- package/dist/cdn/V4W4ZP6M.js +2 -0
- package/dist/cdn/XM2OBGXW.js +2 -0
- package/dist/cdn/assets/presentation/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/utility-network-picker/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/constants2.js +6 -0
- package/dist/chunks/useArcgisViewReadyError.js +42 -27
- package/dist/components/arcgis-aggregated-features/customElement.js +0 -1
- package/dist/components/arcgis-bookmarks/customElement.js +0 -1
- package/dist/components/arcgis-feature-next/customElement.js +4 -4
- package/dist/components/arcgis-features/customElement.js +3 -3
- package/dist/components/arcgis-features-next/customElement.js +98 -86
- package/dist/components/arcgis-features-next/index.js +0 -1
- package/dist/components/arcgis-grid-controls/customElement.js +1 -1
- package/dist/components/arcgis-link-chart/customElement.d.ts +9 -5
- package/dist/components/arcgis-link-chart/customElement.js +24 -18
- package/dist/components/arcgis-map/customElement.d.ts +9 -5
- package/dist/components/arcgis-map/customElement.js +19 -13
- package/dist/components/arcgis-oriented-imagery-viewer-non-panoramic-viewer/customElement.js +0 -2
- package/dist/components/arcgis-oriented-imagery-viewer-panoramic-viewer/customElement.js +15 -16
- package/dist/components/arcgis-paste/customElement.js +0 -1
- package/dist/components/arcgis-popup/customElement.d.ts +7 -7
- package/dist/components/arcgis-popup/customElement.js +10 -13
- package/dist/components/arcgis-presentation/PresentationViewModel.d.ts +6 -0
- package/dist/components/arcgis-presentation/customElement.d.ts +8 -6
- package/dist/components/arcgis-presentation/customElement.js +206 -165
- package/dist/components/arcgis-presentation/index.js +2 -0
- package/dist/components/arcgis-presentation-captions/customElement.js +4 -4
- package/dist/components/arcgis-presentation-slide-list/customElement.js +49 -0
- package/dist/components/arcgis-presentation-slide-list/index.js +3 -0
- package/dist/components/arcgis-scene/customElement.d.ts +9 -5
- package/dist/components/arcgis-scene/customElement.js +21 -15
- package/dist/components/arcgis-template-image/customElement.js +0 -1
- package/dist/components/arcgis-time-bar/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-picker/customElement.d.ts +56 -0
- package/dist/components/arcgis-utility-network-picker/customElement.js +91 -0
- package/dist/components/arcgis-utility-network-picker/index.d.ts +1 -0
- package/dist/components/arcgis-utility-network-picker/index.js +7 -0
- package/dist/components/arcgis-utility-network-trace-analysis/customElement.js +0 -1
- package/dist/components/arcgis-utility-network-trace-analysis-next/customElement.js +0 -1
- package/dist/components/arcgis-utility-network-trace-inputs-next/customElement.js +123 -140
- package/dist/components/arcgis-utility-network-trace-inputs-next/index.js +2 -1
- package/dist/components/arcgis-utility-network-trace-results/customElement.js +0 -2
- package/dist/components/arcgis-utility-network-trace-results-next/customElement.js +0 -2
- package/dist/components/arcgis-utility-network-validate-network-topology/customElement.js +0 -2
- package/dist/components/arcgis-version-management-service-item/customElement.js +3 -4
- package/dist/components/arcgis-video/customElement.d.ts +5 -3
- package/dist/components/arcgis-video-player-actions-group/customElement.js +6 -6
- package/dist/components/arcgis-video-player-controls-group/customElement.js +1 -1
- 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/index.d.ts +10 -0
- package/dist/loader.js +4 -2
- package/dist/types/lumina.d.ts +9 -2
- package/dist/types/preact.d.ts +10 -2
- package/dist/types/react.d.ts +11 -2
- package/dist/types/stencil.d.ts +9 -2
- package/package.json +7 -7
- package/dist/cdn/42TPQKQZ.js +0 -2
- package/dist/cdn/4T6ECCFH.js +0 -2
- package/dist/cdn/4UBDCXSK.js +0 -2
- package/dist/cdn/6MEC4BFN.js +0 -2
- package/dist/cdn/AJ7XRBWN.js +0 -2
- package/dist/cdn/ARVN7QLQ.js +0 -2
- package/dist/cdn/BVDQQOCR.js +0 -2
- package/dist/cdn/DKBC3UMW.js +0 -2
- package/dist/cdn/DSIL7TYR.js +0 -2
- package/dist/cdn/G2PAKIMS.js +0 -2
- package/dist/cdn/JOOHHKWH.js +0 -2
- package/dist/cdn/KS5TQB2A.js +0 -2
- package/dist/cdn/NAQYIBE5.js +0 -2
- package/dist/cdn/NBYN44GP.js +0 -2
- package/dist/cdn/NGB5WVIG.js +0 -2
- package/dist/cdn/PBNP6WFU.js +0 -2
- package/dist/cdn/RDARV7HC.js +0 -2
- package/dist/cdn/RXAUCQQC.js +0 -2
- package/dist/cdn/S22ZRUS7.js +0 -2
- package/dist/cdn/SVOAX4K6.js +0 -2
- package/dist/cdn/TI4BX367.js +0 -2
- package/dist/cdn/W5WXJT7N.js +0 -2
- package/dist/cdn/YTC3XBSZ.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import j from"./C4LCKYWW.js";import{a as k}from"./LTOXLO3L.js";import i from"./7HL2TQ7E.js";import h from"./MZWO5JYA.js";import g from"./FHWOIM57.js";import"./VJVKFKSG.js";import{b as U,c as Z}from"./32XG4IQO.js";import f from"./3T7L7UT5.js";import{a as P}from"./2BVXNQ3U.js";import e from"./2FM2FJAY.js";import d from"./YHNRTH56.js";import{e as L,g as H}from"./3AQ6NC3C.js";import"./A4X5YDA6.js";import b from"./SDWFNKIL.js";import"./QUZTFUWM.js";import{d as y}from"./4W3T75SY.js";import{L as M,M as v,N,O as x,Q as c,R,T as B,a as O,b as a,n as C,o as $,w as A}from"./WXLC6FPD.js";import"./H6RQVSYM.js";export default $arcgis.t(([X,{substitute:u,formatNumber:I},{watch:r},{stripHTML:D},G,{renderingSanitizer:b},{initializeProjection:q},J,,,,z,,,{d:S},{c:j,d:K}])=>{var Q=O`: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)}`,Y=new J({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),_=Y.clone();function ee(E){return E?.declaredClass.startsWith("esri.layers.")??!1}var te=z(X),V=class extends N{constructor(){super(...arguments),this._direction=L(),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._rootFlowItemNode=M(),this._featureMenuViewportNode=M(),this._actionBarMenuNode=M(),this._flowContainerNode=M(),this.messages=P(),this._selectedFeatureComponent=M(),this._cancelOpenRelatedFeature=()=>{let{_openRelatedFeatureAbortController:e}=this;e&&e.abort(),this._openRelatedFeatureAbortController=null},this._openRelatedFeatureAbortController=null,this.flowItems=new G,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=this.viewModel.featureMenuOpen,this.featureMenuTitle=this.viewModel.featureMenuTitle,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureViewModelAbilities=this.viewModel.featureViewModelAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new G,this.heading=this.viewModel.title,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.hideExpressionContent=!1,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.visible,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=A(),this.arcgisClose=A(),this.arcgisTriggerAction=A()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureViewModelAbilities: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.selectedFeatureViewModel?.title)&&!!(this.content||this.viewModel.selectedFeatureViewModel?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}get chartAnimationDisabled(){return!(this.viewModel.featureViewModelAbilities?.chartAnimation??!0)}set chartAnimationDisabled(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.chartAnimation=!e}get hideAttachmentsContent(){return!(this.viewModel.featureViewModelAbilities?.attachmentsContent??!0)}set hideAttachmentsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.attachmentsContent=!e}get hideCustomContent(){return!(this.viewModel.featureViewModelAbilities?.customContent??!0)}set hideCustomContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.customContent=!e}get hideFieldsContent(){return!(this.viewModel.featureViewModelAbilities?.fieldsContent??!0)}set hideFieldsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.fieldsContent=!e}get hideMediaContent(){return!(this.viewModel.featureViewModelAbilities?.mediaContent??!0)}set hideMediaContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.mediaContent=!e}get hideRelationshipContent(){return!(this.viewModel.featureViewModelAbilities?.relationshipContent??!0)}set hideRelationshipContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.relationshipContent=!e}get hideTextContent(){return!(this.viewModel.featureViewModelAbilities?.textContent??!0)}set hideTextContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.textContent=!e}get hideUtilityNetworkContent(){return!(this.viewModel.featureViewModelAbilities?.utilityNetworkAssociationsContent??!0)}set hideUtilityNetworkContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.utilityNetworkAssociationsContent=!e}async clear(){return this.viewModel.clear()}async close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:s}=t??{},i=new AbortController,{signal:n}=i,o=s?AbortSignal.any([n,s]):n;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await q(this.location.spatialReference,this.view.spatialReference,null,{signal:o}),e=this.view.toScreen(this.location)??void 0),!e)return;let l=await this.viewModel.fetchFeatures(e,{...t,signal:o});this.location=l.location,this.promises=l.pendingFeatures}async next(){return $("warn",this,"The return type of FeaturesViewModel on the next() method is deprecated. At 6.0, this method will return void."),this.viewModel.next()}async previous(){return $("warn",this,"The return type of FeaturesViewModel on the previous() method is deprecated. At 6.0, this method will return void."),this.viewModel.previous()}async setFocus(){this._flowContainerNode.value?.setFocus()}async triggerAction(e){if($("warn",this,"The triggerAction() method is deprecated since 5.1. Trigger actions with manual user interaction within the component.",{once:!0}),!e.disabled)return e?.type==="toggle"&&(e.value=!e.value),await K(e,this.viewModel)}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[r(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),r(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),r(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),r(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),r(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),r(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),r(()=>[this.viewModel?.title,this.viewModel?.selectedFeatureViewModel?.title,this.viewModel?.selectedFeatureViewModel?.state],()=>this._syncEffectiveHeading(),{initial:!0}),r(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),r(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),r(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.visible],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&C(()=>this.selectedFeatureComponent=e)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);C(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_syncEffectiveHeading(){let e=this._calculateEffectiveHeading();this.effectiveHeading!==e&&C(()=>this.effectiveHeading=e)}_cancelFetchingFeatures(){this._fetchFeaturesController?.abort(),this._fetchFeaturesController=null}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(s=>{let i=s?.graphic;if(!i)return;let n=S(i),o=ee(n)?n:null,l=t.get(o)??[];t.set(o,[...l,s])}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),this._openRelatedFeatureAbortController!==t)return;let s=e.graphic,i=s?.geometry;if(i==null||s==null){this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null);return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),this._openRelatedFeatureAbortController!==t)return;let n=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(this._openRelatedFeatureAbortController!==t)return;let o=n.execute(i);o!=null&&(this.location=o),this.features=[s],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController===t&&(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:s}=this,{id:i}=e,n=s?.attributes,o=e.title??"",l=i==="zoom-to-feature"?u(o,{messages:t}):i==="remove-selected-feature"?u(o,{messages:t}):i==="zoom-to-clustered-features"?u(o,{messages:t}):i==="browse-clustered-features"?u(o,{messages:t}):e.title;return l&&n?u(l,n):l??""}_onMainKeydown(e){let{key:t}=e;Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:s,waitingForResult:i}=this.viewModel;i||!s||e===t||e===-1||(this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){this.triggerAction(e),this.arcgisTriggerAction.emit({action:e})}_viewChange(){this.viewModel.clear(),this.open=!1}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_removeFlowItems(){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()}_calculateEffectiveHeading(){let{title:e,selectedFeatureViewModel:t}=this.viewModel;return t?t?.state==="error"?this.messages?.errorMessage??"":t?.title||"":e??""}_getHeading(){return!this.hideHeading&&this.effectiveHeading?this.effectiveHeading:""}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=R(a`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.visible&&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 a`<div class="root" @keydown=${this._onMainKeydown}>${this._renderHeader()}${this._renderContentContainer()}</div>`}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode==="list"?this._renderFeaturePaginationText():this._renderFeatureMenuButton()]}_renderHeader(){return this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="header">${this._renderFeatureNavigation()}</div>`:null}_renderFooter(){return!this.featureNavigationTop&&this._featureNavigationVisible?a`<div class="footer" slot=footer>${this._renderFeatureNavigation()}</div>`:null}_renderFeaturePaginationText(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i}=t;return a`<div class="pagination-text">${u(e.pageText??"",{index:I(i+1),total:I(s)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i,pendingPromisesCount:n}=t;return a`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${n>0} @click=${this._handlePaginationMenuButton} .text=${u(e.pageText??"",{index:I(i+1),total:I(s)})} text-enabled title=${e.selectFeature??c}></calcite-action>`}_renderPagination(){let{previous:e,next:t}=this.messages;return a`<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=${e??""} @click=${this._previousFeature} .text=${e??""} title=${e??""??c}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${t??""} @click=${this._nextFeature} .text=${t??""} title=${t??""??c}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:s,featureViewModels:i}=this.viewModel,n=e===s,o=i.indexOf(e);return a`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(o)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(o)} .selected=${n} @calciteListItemSelect=${()=>this._selectFeature(o)}><span .innerHTML=${(b.sanitize(e.title)||this.messages.untitled)??""} slot=content></span>${t==="list"?a`<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,s=this._groupResultsByLayer(),i=this.initialDisplayMode==="list"?"none":"single";return t.featureViewModels.length?a`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${i}>${Array.from(s.keys(),n=>{let o=s.get(n)?.map(d=>this._renderFeatureMenuItem(d)),l=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&l!==null?k(n??"map-graphics",a`<calcite-list-item-group .heading=${l}>${o}</calcite-list-item-group>`):o})}</calcite-list>`:null}_renderHeaderAction(e){let t=e.title||"";return e.visible?a`<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??c}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(){let{headingLevel:e,hideCloseButton:t,_isCollapsed:s,_collapseEnabled:i,_featureFlowItemSelected:n,featureNavigationTop:o,flowItems:l,initialDisplayMode:d,selectedFeature:g,hideHeading:f}=this,{active:w,selectedFeatureViewModel:p,content:m}=this.viewModel,h=this._getHeading();if(d==="list"&&!g)return null;let F=l.length===0&&n,T=p?!p.content:!m;return a`<calcite-flow-item class=${x(y({"content-feature":!0,"flow-item-collapsed":s}))} .closable=${!t} .closed=${!w} .collapsed=${s} .collapseDirection=${this.collapseDirection??(o?"down":"up")} .collapsible=${i} .headingLevel=${e} .selected=${F} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!f&&h?D(h):void 0} ${v(this._rootFlowItemNode)}>${!f&&h?a`<div slot=heading><div .innerHTML=${b.sanitize(h??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${x(y("container","content-container",{"content-hidden":T}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:s,messages:i,initialDisplayMode:n,featureMenuOpen:o,_featureFlowItemSelected:l,_collapseEnabled:d,_isCollapsed:g,featureNavigationTop:f,headingLevel:w}=this,{active:p,featureViewModels:m,pendingPromisesCount:h}=e,F=s??i.selectFeature;if(n==="feature"&&!o)return null;let T=!l;return a`<calcite-flow-item class=${x(y({"flow-item-collapsed":g}))} .closable=${n==="list"&&!t} .closed=${!p} .collapsed=${n==="list"&&g} .collapseDirection=${this.collapseDirection??(f?"down":"up")} .collapsible=${n==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:u(i.total??"",{total:m.length})} .heading=${this.hideFeatureMenuHeading?void 0:F} .headingLevel=${w} .loading=${e.waitingForContents} .selected=${T} @calciteFlowItemBack=${W=>{W.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${v(this._featureMenuViewportNode)}>${n==="list"?this._renderHeaderActions():null}${h>0?a`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${this._renderFeatureMenu()}</div><div class="feature-menu-observer" ${v(this._featureMenuIntersectionObserverCreated)}></div>${n==="feature"?a`<calcite-button appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:s,hideCloseButton:i,hideSelectFeature:n,active:o,hideHeading:l}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,g=d&&!n,f=e.flowType==="feature-association",w=s.returnToInitialFeature??"",p=s?.selectFeature,m=this._getActionTitle(_),h=!this.hideActionBar&&f&&d;return a`<calcite-flow-item .closable=${!i} .closed=${!o} .description=${D(this._getDrillInFlowItemDescription(e)??"")} .heading=${l?void 0:D(e.heading??"")} .selected=${t} @calciteFlowItemBack=${F=>{F.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${l?null:a`<div slot=heading><div .innerHTML=${b.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${b.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${w??""} title=${w??""??c}></calcite-action>${g?a`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${p??""} title=${p??c}></calcite-action>`:null}${h?a`<calcite-action-bar expand-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${_.disabled} .icon=${_.icon??void 0} .loading=${_.active} scale=s text-enabled .text=${m} title=${m??c} @click=${()=>j(this.viewModel,_,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div></calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e?.map((i,n)=>this._renderFlowItem(i,this._featureFlowItemSelected&&n===e.length-1)),s=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(),t]:[this._renderContentFeature(),t,this._renderFeatureMenuContainer()];return a`<calcite-flow ${v(this._flowContainerNode)}>${s}</calcite-flow>`}_renderActionBar(){let e=this.viewModel.selectedFeatureViewModel?.isFeatureFromTable&&!this.location?this.viewModel.allActions.filter(t=>t.id!==_.id):this.viewModel.allActions;return!this._isCollapsed&&!this.hideActionBar&&e.length?a`<calcite-action-bar expand-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s ${v(this._actionBarMenuNode)}>${this._renderActions()}</calcite-action-group></calcite-action-bar>`:null}_renderActions(){return this.viewModel.allActions.toArray().map(e=>{let t=this._getActionTitle(e);return a`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .loading=${e.active} scale=s .textEnabled=${!this._hideActionText} .text=${t??""} title=${t??c} .hidden=${!e.visible} @click=${()=>this._triggerAction(e)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureViewModel:t}=this.viewModel;return t?a`<arcgis-feature .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} .messageOverrides=${this.messageOverrides} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${v(this._selectedFeatureComponent)}></arcgis-feature>`:typeof e=="string"?k(e,a`<div .innerHTML=${b.sanitize(e)??""}></div>`):e??null}};B("arcgis-features",V);return V},"widgets/Features/FeaturesViewModel","intl","core/reactiveUtils","applications/Components/stringUtils","core/Collection","applications/Components/sanitizerUtils","applications/Components/featureUtils","support/actions/ActionButton",b,d,e,f,g,h,i,j)
|
|
2
|
+
import i from"./C4LCKYWW.js";import{a as k}from"./LTOXLO3L.js";import h from"./7HL2TQ7E.js";import g from"./MZWO5JYA.js";import f from"./FHWOIM57.js";import"./VJVKFKSG.js";import{b as U,c as Z}from"./32XG4IQO.js";import e from"./3T7L7UT5.js";import{a as P}from"./2BVXNQ3U.js";import d from"./2FM2FJAY.js";import b from"./YHNRTH56.js";import{e as L,g as H}from"./3AQ6NC3C.js";import"./A4X5YDA6.js";import a from"./SDWFNKIL.js";import"./QUZTFUWM.js";import{d as y}from"./4W3T75SY.js";import{L as M,M as v,N,O as x,Q as c,R,T as B,a as O,b as o,n as C,o as $,w as A}from"./WXLC6FPD.js";import"./H6RQVSYM.js";export default $arcgis.t(([X,{substitute:u,formatNumber:I},{watch:r},{stripHTML:D},G,{renderingSanitizer:b},{initializeProjection:q},J,,,,z,,,{d:S},{c:j,d:K}])=>{var Q=O`: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)}`,Y=new J({icon:"magnifying-glass-plus",id:"zoom-to-feature",title:"{messages.zoom}"}),_=Y.clone();function ee(E){return E?.declaredClass.startsWith("esri.layers.")??!1}var te=z(X),V=class extends N{constructor(){super(...arguments),this._direction=L(),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._rootFlowItemNode=M(),this._featureMenuViewportNode=M(),this._actionBarMenuNode=M(),this._flowContainerNode=M(),this.messages=P(),this._selectedFeatureComponent=M(),this._cancelOpenRelatedFeature=()=>{let{_openRelatedFeatureAbortController:e}=this;e&&e.abort(),this._openRelatedFeatureAbortController=null},this._openRelatedFeatureAbortController=null,this.flowItems=new G,this.viewModel=te(this),this.actions=this.viewModel.actions,this.active=this.viewModel.active,this.autoDestroyDisabled=!1,this.collapsed=!1,this.content=this.viewModel.content,this.defaultPopupTemplateEnabled=this.viewModel.defaultPopupTemplateEnabled,this.featureCount=this.viewModel.featureCount,this.featureMenuOpen=this.viewModel.featureMenuOpen,this.featureMenuTitle=this.viewModel.featureMenuTitle,this.featureNavigationTop=!1,this.features=this.viewModel.features,this.featuresPerPage=this.viewModel.featuresPerPage,this.featureViewModelAbilities=this.viewModel.featureViewModelAbilities,this.goToOverride=this.viewModel.goToOverride,this.headerActions=new G,this.heading=this.viewModel.title,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.hideExpressionContent=!1,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.visible,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=A(),this.arcgisClose=A(),this.arcgisTriggerAction=A()}static{this.properties={_openRelatedFeatureAbortController:16,flowItems:16,_hideActionText:16,_featureNavigationVisible:16,_isCollapsed:16,_collapseEnabled:16,_featureFlowItemSelected:16,viewModel:0,actions:0,active:0,autoDestroyDisabled:5,collapseDirection:1,collapsed:5,content:1,defaultPopupTemplateEnabled:5,effectiveHeading:32,featureCount:9,featureMenuOpen:5,featureMenuTitle:1,featureNavigationTop:5,features:0,featuresPerPage:9,featureViewModelAbilities: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.selectedFeatureViewModel?.title)&&!!(this.content||this.viewModel.selectedFeatureViewModel?.content))}get _featureFlowItemSelected(){return this.initialDisplayMode==="list"?!!this.selectedFeature:!this.featureMenuOpen}get chartAnimationDisabled(){return!(this.viewModel.featureViewModelAbilities?.chartAnimation??!0)}set chartAnimationDisabled(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.chartAnimation=!e}get hideAttachmentsContent(){return!(this.viewModel.featureViewModelAbilities?.attachmentsContent??!0)}set hideAttachmentsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.attachmentsContent=!e}get hideCustomContent(){return!(this.viewModel.featureViewModelAbilities?.customContent??!0)}set hideCustomContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.customContent=!e}get hideFieldsContent(){return!(this.viewModel.featureViewModelAbilities?.fieldsContent??!0)}set hideFieldsContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.fieldsContent=!e}get hideMediaContent(){return!(this.viewModel.featureViewModelAbilities?.mediaContent??!0)}set hideMediaContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.mediaContent=!e}get hideRelationshipContent(){return!(this.viewModel.featureViewModelAbilities?.relationshipContent??!0)}set hideRelationshipContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.relationshipContent=!e}get hideTextContent(){return!(this.viewModel.featureViewModelAbilities?.textContent??!0)}set hideTextContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.textContent=!e}get hideUtilityNetworkContent(){return!(this.viewModel.featureViewModelAbilities?.utilityNetworkAssociationsContent??!0)}set hideUtilityNetworkContent(e){this.viewModel.featureViewModelAbilities??={},this.viewModel.featureViewModelAbilities.utilityNetworkAssociationsContent=!e}async clear(){return this.viewModel.clear()}async close(){this.open=!1}async destroy(){await this.manager.destroy(),this._removeSpinner(this.referenceElement),this._cancelOpenRelatedFeature(),this._removeFlowItems(),this._unobserveFeatureMenuObserver(),this._cancelFetchingFeatures(),this._featureMenuIntersectionObserver?.disconnect()}async fetchFeatures(e,t){this._cancelFetchingFeatures();let{signal:s}=t??{},i=new AbortController,{signal:n}=i,a=s?AbortSignal.any([n,s]):n;if(this._fetchFeaturesController=i,!e&&this.view&&this.location&&(await q(this.location.spatialReference,this.view.spatialReference,null,{signal:a}),e=this.view.toScreen(this.location)??void 0),!e)return;let l=await this.viewModel.fetchFeatures(e,{...t,signal:a});this.location=l.location,this.promises=l.pendingFeatures}async next(){return $("warn",this,"The return type of FeaturesViewModel on the next() method is deprecated. At 6.0, this method will return void."),this.viewModel.next()}async previous(){return $("warn",this,"The return type of FeaturesViewModel on the previous() method is deprecated. At 6.0, this method will return void."),this.viewModel.previous()}async setFocus(){this._flowContainerNode.value?.setFocus()}async triggerAction(e){if($("warn",this,"The triggerAction() method is deprecated since 5.1. Trigger actions with manual user interaction within the component.",{once:!0}),!e.disabled)return e?.type==="toggle"&&(e.value=!e.value),await K(e,this.viewModel)}connectedCallback(){super.connectedCallback(),this._createSpinner()}disconnectedCallback(){super.disconnectedCallback(),this._removeSpinner(this.referenceElement)}loaded(){this.manager.onLifecycle(()=>[r(()=>this.viewModel?.selectedFeatureIndex,(e,t)=>this._selectedFeatureIndexUpdated(e,t)),r(()=>this.viewModel?.view,(e,t)=>t&&this._viewChange()),r(()=>this._spinnerEl?.screenLocation,()=>this._closeOpenActionMenu()),r(()=>this.selectedFeatureComponent?.viewModel,()=>this._removeFlowItems()),r(()=>this.viewModel?.featureViewModels,()=>this._featureMenuViewportScrollTop()),r(()=>this.flowItems.length,()=>this._syncSelectedDrillInFeature()),r(()=>[this.viewModel?.title,this.viewModel?.selectedFeatureViewModel?.title,this.viewModel?.selectedFeatureViewModel?.state],()=>this._syncEffectiveHeading(),{initial:!0}),r(()=>[this.flowItems?.length,this.featureMenuOpen],()=>{this.setFocus()}),r(()=>this.referenceElement,(e,t)=>{this._removeSpinner(t),this._createSpinner()},{initial:!0}),r(()=>[this.hideSpinner,this.viewModel?.view,this.viewModel?.location,this.viewModel?.waitingForResult,this.viewModel?.visible],()=>this._createSpinner(),{initial:!0})])}updated(){let e=this._selectedFeatureComponent.value??void 0;this.selectedFeatureComponent!==e&&C(()=>this.selectedFeatureComponent=e)}_syncSelectedDrillInFeature(){let e=this.flowItems.getItemAt(this.flowItems.length-1);C(()=>this.selectedDrillInFeature=e?.graphic??void 0)}_syncEffectiveHeading(){let e=this._calculateEffectiveHeading();this.effectiveHeading!==e&&C(()=>this.effectiveHeading=e)}_cancelFetchingFeatures(){this._fetchFeaturesController?.abort(),this._fetchFeaturesController=null}_handleClose(){this.close(),this.arcgisClose.emit()}_groupResultsByLayer(){let{featureViewModels:e}=this.viewModel,t=new Map;return e.forEach(s=>{let i=s?.graphic;if(!i)return;let n=S(i),a=ee(n)?n:null,l=t.get(a)??[];t.set(a,[...l,s])}),t}_handleCollapseToggle(){this.collapsed=!this.collapsed}async _openRelatedFeature(e){this._cancelOpenRelatedFeature();let t=new AbortController;if(this._openRelatedFeatureAbortController=t,await e.updateGeometry(),this._openRelatedFeatureAbortController!==t)return;let s=e.graphic,i=s?.geometry;if(i==null||s==null){this._openRelatedFeatureAbortController===t&&(this._openRelatedFeatureAbortController=null);return}if(this._removeFlowItems(),await this.viewModel.zoomTo({target:i}),this._openRelatedFeatureAbortController!==t)return;let n=await $arcgis.t(m=>m[0],"geometry/operators/labelPointOperator");if(this._openRelatedFeatureAbortController!==t)return;let a=n.execute(i);a!=null&&(this.location=a),this.features=[s],this.open=!0,await this.setFocus(),this._openRelatedFeatureAbortController===t&&(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:s}=this,{id:i}=e,n=s?.attributes,a=e.title??"",l=i==="zoom-to-feature"?u(a,{messages:t}):i==="remove-selected-feature"?u(a,{messages:t}):i==="zoom-to-clustered-features"?u(a,{messages:t}):i==="browse-clustered-features"?u(a,{messages:t}):e.title;return l&&n?u(l,n):l??""}_onMainKeydown(e){let{key:t}=e;Z(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.previous(),this.setFocus()),U(t,this._direction)&&(e.stopPropagation(),this._handleFeatureMenuBack(),this.next(),this.setFocus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode.value?.scrollContentTo({top:0})}_selectedFeatureIndexUpdated(e,t){let{featureCount:s,waitingForResult:i}=this.viewModel;i||!s||e===t||e===-1||(this._removeFlowItems(),this._rootFlowItemNode.value?.scrollContentTo({top:0}))}_triggerAction(e){this.triggerAction(e),this.arcgisTriggerAction.emit({action:e})}_viewChange(){this.viewModel.clear(),this.open=!1}_closeOpenActionMenu(){let{_actionBarMenuNode:e}=this;e.value&&(e.value.menuOpen=!1)}_removeFlowItems(){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()}_calculateEffectiveHeading(){let{title:e,selectedFeatureViewModel:t}=this.viewModel;return t?t?.state==="error"?this.messages?.errorMessage??"":t?.title||"":e??""}_getHeading(){return!this.hideHeading&&this.effectiveHeading?this.effectiveHeading:""}_removeSpinner(e){e?.manager?.component?.extraContent?.remove(this._spinnerEl),this._spinnerEl=void 0}_createSpinner(){let e=this.referenceElement;e&&(this._removeSpinner(e),this._spinnerEl=R(o`<arcgis-spinner .label=${this.messages.loading??""} .trackLocation=${!this.hideSpinner&&this.viewModel.visible&&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}>${this._renderHeader()}${this._renderContentContainer()}</div>`}_renderFeatureNavigation(){return[this._renderPagination(),this.initialDisplayMode==="list"?this._renderFeaturePaginationText():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(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i}=t;return o`<div class="pagination-text">${u(e.pageText??"",{index:I(i+1),total:I(s)})}</div>`}_renderFeatureMenuButton(){let{messages:e,viewModel:t}=this,{featureCount:s,selectedFeatureIndex:i,pendingPromisesCount:n}=t;return o`<calcite-action class="pagination-menu-button" icon=list .label=${e.selectFeature} .loading=${n>0} @click=${this._handlePaginationMenuButton} .text=${u(e.pageText??"",{index:I(i+1),total:I(s)})} text-enabled title=${e.selectFeature??c}></calcite-action>`}_renderPagination(){let{previous:e,next:t}=this.messages;return o`<calcite-action-bar class="pagination-action-bar" expand-toggle-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=${e??""} @click=${this._previousFeature} .text=${e??""} title=${e??""??c}></calcite-action><calcite-action icon=chevron-right icon-flip-rtl .label=${t??""} @click=${this._nextFeature} .text=${t??""} title=${t??""??c}></calcite-action></calcite-action-group></calcite-action-bar>`}_renderFeatureMenuItem(e){let{initialDisplayMode:t}=this,{selectedFeatureViewModel:s,featureViewModels:i}=this.viewModel,n=e===s,a=i.indexOf(e);return o`<calcite-list-item @blur=${this._removeActiveFeature} @focus=${()=>this._setActiveFeature(a)} @mouseleave=${this._removeActiveFeature} @mouseover=${()=>this._setActiveFeature(a)} .selected=${n} @calciteListItemSelect=${()=>this._selectFeature(a)}><span .innerHTML=${(b.sanitize(e.title)||this.messages.untitled)??""} slot=content></span>${t==="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,s=this._groupResultsByLayer(),i=this.initialDisplayMode==="list"?"none":"single";return t.featureViewModels.length?o`<calcite-list display-mode=flat .label=${e?.featuresList??""} selection-appearance=icon .selectionMode=${i}>${Array.from(s.keys(),n=>{let a=s.get(n)?.map(d=>this._renderFeatureMenuItem(d)),l=n?n.title??this.messages.untitled:null;return!this.hideFeatureListLayerTitle&&l!==null?k(n??"map-graphics",o`<calcite-list-item-group .heading=${l}>${a}</calcite-list-item-group>`):a})}</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??c}></calcite-action>`:null}_renderHeaderActions(){return this.headerActions.map(e=>this._renderHeaderAction(e)).toArray()}_renderContentFeature(){let{headingLevel:e,hideCloseButton:t,_isCollapsed:s,_collapseEnabled:i,_featureFlowItemSelected:n,featureNavigationTop:a,flowItems:l,initialDisplayMode:d,selectedFeature:g,hideHeading:f}=this,{active:w,selectedFeatureViewModel:p,content:m}=this.viewModel,h=this._getHeading();if(d==="list"&&!g)return null;let F=l.length===0&&n,T=p?!p.content:!m;return o`<calcite-flow-item class=${x(y({"content-feature":!0,"flow-item-collapsed":s}))} .closable=${!t} .closed=${!w} .collapsed=${s} .collapseDirection=${this.collapseDirection??(a?"down":"up")} .collapsible=${i} .headingLevel=${e} .selected=${F} @calciteFlowItemBack=${this._handleFeatureBack} .loading=${!!this._openRelatedFeatureAbortController} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} .heading=${!f&&h?D(h):void 0} ${v(this._rootFlowItemNode)}>${!f&&h?o`<div slot=heading><div .innerHTML=${b.sanitize(h??"")??""}></div></div>`:null}${this._renderHeaderActions()}${this._renderActionBar()}<div class=${x(y("container","content-container",{"content-hidden":T}))}>${this._renderContent()}</div>${this._renderFooter()}</calcite-flow-item>`}_renderFeatureMenuContainer(){let{viewModel:e,hideCloseButton:t,featureMenuTitle:s,messages:i,initialDisplayMode:n,featureMenuOpen:a,_featureFlowItemSelected:l,_collapseEnabled:d,_isCollapsed:g,featureNavigationTop:f,headingLevel:w}=this,{active:p,featureViewModels:m,pendingPromisesCount:h}=e,F=s??i.selectFeature;if(n==="feature"&&!a)return null;let T=!l;return o`<calcite-flow-item class=${x(y({"flow-item-collapsed":g}))} .closable=${n==="list"&&!t} .closed=${!p} .collapsed=${n==="list"&&g} .collapseDirection=${this.collapseDirection??(f?"down":"up")} .collapsible=${n==="list"&&d} .messageOverrides=${{collapse:this.messages.collapse,expand:this.messages.expand}} .description=${this.hideFeatureMenuHeading?void 0:u(i.total??"",{total:m.length})} .heading=${this.hideFeatureMenuHeading?void 0:F} .headingLevel=${w} .loading=${e.waitingForContents} .selected=${T} @calciteFlowItemBack=${W=>{W.preventDefault(),this._handleFeatureMenuBack()}} @calciteFlowItemClose=${this._handleClose} @calciteFlowItemToggle=${this._handleCollapseToggle} ${v(this._featureMenuViewportNode)}>${n==="list"?this._renderHeaderActions():null}${h>0?o`<calcite-loader class="loader" inline .label=${i.loading??""} slot=header-actions-end></calcite-loader>`:null}<div class="container">${this._renderFeatureMenu()}</div><div class="feature-menu-observer" ${v(this._featureMenuIntersectionObserverCreated)}></div>${n==="feature"?o`<calcite-button appearance=transparent @click=${this._handleFeatureMenuBack} slot=footer-start width=full>${i.back}</calcite-button>`:null}</calcite-flow-item>`}_renderFlowItem(e,t){let{messages:s,hideCloseButton:i,hideSelectFeature:n,active:a,hideHeading:l}=this,d="graphic"in e&&"isFeatureFromTable"in e&&!e.isFeatureFromTable,g=d&&!n,f=e.flowType==="feature-association",w=s.returnToInitialFeature??"",p=s?.selectFeature,m=this._getActionTitle(_),h=!this.hideActionBar&&f&&d;return o`<calcite-flow-item .closable=${!i} .closed=${!a} .description=${D(this._getDrillInFlowItemDescription(e)??"")} .heading=${l?void 0:D(e.heading??"")} .selected=${t} @calciteFlowItemBack=${F=>{F.preventDefault(),this._handleDrillInBackClick()}} .loading=${!!this._openRelatedFeatureAbortController} @calciteFlowItemClose=${this._handleClose}>${l?null:o`<div slot=heading><div .innerHTML=${b.sanitize(e.heading??"")??""}></div></div>`}<div slot=description><div .innerHTML=${b.sanitize(this._getDrillInFlowItemDescription(e)??"")??""}></div></div><calcite-action class="action-exit" icon=move-up @click=${this._removeFlowItems} slot=header-actions-start .text=${w??""} title=${w??""??c}></calcite-action>${g?o`<calcite-action icon=zoom-to-object @click=${()=>this._openRelatedFeature(e)} slot=header-actions-end .text=${p??""} title=${p??c}></calcite-action>`:null}${h?o`<calcite-action-bar expand-toggle-disabled expanded scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s><calcite-action .disabled=${_.disabled} .icon=${_.icon??void 0} .loading=${_.active} scale=s text-enabled .text=${m} title=${m??c} @click=${()=>j(this.viewModel,_,e)}></calcite-action></calcite-action-group></calcite-action-bar>`:null}<div class="container">${e}</div></calcite-flow-item>`}_renderContentContainer(){let e=this.flowItems?.toArray(),t=e?.map((i,n)=>this._renderFlowItem(i,this._featureFlowItemSelected&&n===e.length-1)),s=this.initialDisplayMode==="list"?[this._renderFeatureMenuContainer(),this._renderContentFeature(),t]:[this._renderContentFeature(),t,this._renderFeatureMenuContainer()];return o`<calcite-flow ${v(this._flowContainerNode)}>${s}</calcite-flow>`}_renderActionBar(){let e=this.viewModel.selectedFeatureViewModel?.isFeatureFromTable&&!this.location?this.viewModel.allActions.filter(t=>t.id!==_.id):this.viewModel.allActions;return!this._isCollapsed&&!this.hideActionBar&&e.length?o`<calcite-action-bar expand-toggle-disabled .expanded=${!this._hideActionText} scale=s slot=action-bar><calcite-action-group overlay-positioning=fixed scale=s ${v(this._actionBarMenuNode)}>${this._renderActions()}</calcite-action-group></calcite-action-bar>`:null}_renderActions(){return this.viewModel.allActions.toArray().map(e=>{let t=this._getActionTitle(e);return o`<calcite-action .active=${e.type==="toggle"?e.value:!1} .disabled=${e.disabled} .icon=${e.icon??void 0} .loading=${e.active} scale=s .textEnabled=${!this._hideActionText} .text=${t??""} title=${t??c} .hidden=${!e.visible} @click=${()=>this._triggerAction(e)}></calcite-action>`})}_renderContent(){let{content:e,selectedFeatureViewModel:t}=this.viewModel;return t?o`<arcgis-feature .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} .messageOverrides=${this.messageOverrides} .referenceElement=${this.referenceElement} .showRelationshipContent=${!this.hideRelationshipContent} .showUtilityNetworkContent=${!this.hideUtilityNetworkContent} .spatialReference=${this.spatialReference} .timeZone=${this.timeZone} ${v(this._selectedFeatureComponent)}></arcgis-feature>`:typeof e=="string"?k(e,o`<div .innerHTML=${b.sanitize(e)??""}></div>`):e??null}};B("arcgis-features",V);return V},"widgets/Features/FeaturesViewModel","intl","core/reactiveUtils","applications/Components/stringUtils","core/Collection","applications/Components/sanitizerUtils","applications/Components/featureUtils","support/actions/ActionButton",a,b,d,e,f,g,h,i)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import g from"./YT6GA6QR.js";import{a as Y,k as G}from"./4SV6HHMC.js";import f from"./FHWOIM57.js";import"./VJVKFKSG.js";import e from"./3T7L7UT5.js";import{a as L}from"./2BVXNQ3U.js";import c from"./2FM2FJAY.js";import b from"./YHNRTH56.js";import{e as B,g as I}from"./3AQ6NC3C.js";import"./A4X5YDA6.js";import a from"./SDWFNKIL.js";import"./QUZTFUWM.js";import{b as z}from"./4W3T75SY.js";import{L as A,M,N as W,T as N,a as R,b as d,o as j,w as C}from"./WXLC6FPD.js";import"./H6RQVSYM.js";export default $arcgis.t(([x,ut,mt,ht,{convertDateFormatToIntlOptions:T},it,{getTimeSliderSettingsFromWebDocument:ct},{property:l,subclass:dt},{watch:w,whenOnce:at},,,,U,{d:q,f:V,i:H},{a:J,b:K,c:S,d:$,e:Q,f:X,g:tt,h:D,i:et}])=>{var nt=new WeakMap,ot=new WeakMap;function vt(t){let{locale:e,formatOptions:a}=t,n=yt(a),u=new Intl.DateTimeFormat(e,n);return nt.set(t,u),u}function pt(t){let{locale:e,formatOptions:a}=t,n=new Intl.NumberFormat(e,a);return ot.set(t,n),n}function ft(t){return nt.get(t)??vt(t)}function gt(t){return ot.get(t)??pt(t)}function yt(t){return t.timeZone?{...t,timeZone:G(t.timeZone)}:t}var i=(t,e,a)=>({minorTick:t,majorTick:e,majorTickFormat:a}),s={sf:{second:"numeric",fractionalSecondDigits:3},s:{second:"numeric"},ms:{minute:"numeric",second:"numeric"},mi:{minute:"numeric"},hm:{hour:"numeric",minute:"numeric"},dm:{day:"numeric",month:"short"},m:{month:"short"},my:{month:"short",year:"numeric"},y:{year:"numeric"}},wt=[i({value:1,unit:"milliseconds"},{value:20,unit:"milliseconds"},s.sf),i({value:2,unit:"milliseconds"},{value:50,unit:"milliseconds"},s.sf),i({value:5,unit:"milliseconds"},{value:100,unit:"milliseconds"},s.sf),i({value:10,unit:"milliseconds"},{value:200,unit:"milliseconds"},s.sf),i({value:20,unit:"milliseconds"},{value:500,unit:"milliseconds"},s.sf),i({value:50,unit:"milliseconds"},{value:1,unit:"seconds"},s.s),i({value:100,unit:"milliseconds"},{value:2,unit:"seconds"},s.s),i({value:200,unit:"milliseconds"},{value:5,unit:"seconds"},s.s),i({value:500,unit:"milliseconds"},{value:10,unit:"seconds"},s.s),i({value:1,unit:"seconds"},{value:20,unit:"seconds"},s.ms),i({value:2,unit:"seconds"},{value:30,unit:"seconds"},s.ms),i({value:5,unit:"seconds"},{value:1,unit:"minutes"},s.mi),i({value:10,unit:"seconds"},{value:2,unit:"minutes"},s.mi),i({value:20,unit:"seconds"},{value:5,unit:"minutes"},s.mi),i({value:40,unit:"seconds"},{value:10,unit:"minutes"},s.mi),i({value:1,unit:"minutes"},{value:30,unit:"minutes"},s.hm),i({value:2,unit:"minutes"},{value:1,unit:"hours"},s.hm),i({value:5,unit:"minutes"},{value:2,unit:"hours"},s.hm),i({value:10,unit:"minutes"},{value:4,unit:"hours"},s.hm),i({value:20,unit:"minutes"},{value:8,unit:"hours"},s.hm),i({value:40,unit:"minutes"},{value:1,unit:"days"},s.dm),i({value:1,unit:"hours"},{value:1,unit:"days"},s.dm),i({value:2,unit:"hours"},{value:2,unit:"days"},s.dm),i({value:5,unit:"hours"},{value:4,unit:"days"},s.dm),i({value:10,unit:"hours"},{value:10,unit:"days"},s.dm),i({value:20,unit:"hours"},{value:15,unit:"days"},s.dm),i({value:1,unit:"days"},{value:20,unit:"days"},s.dm),i({value:2,unit:"days"},{value:1,unit:"months"},s.m),i({value:5,unit:"days"},{value:3,unit:"months"},s.m),i({value:10,unit:"days"},{value:6,unit:"months"},s.my),i({value:20,unit:"days"},{value:1,unit:"years"},s.y),i({value:1,unit:"months"},{value:2,unit:"years"},s.y),i({value:2,unit:"months"},{value:4,unit:"years"},s.y),i({value:5,unit:"months"},{value:10,unit:"years"},s.y),i({value:1,unit:"years"},{value:20,unit:"years"},s.y),i({value:2,unit:"years"},{value:50,unit:"years"},s.y),i({value:5,unit:"years"},{value:100,unit:"years"},s.y),i({value:10,unit:"years"},{value:200,unit:"years"},s.y),i({value:20,unit:"years"},{value:500,unit:"years"},s.y),i({value:50,unit:"years"},{value:1e3,unit:"years"},s.y),i({value:1,unit:"centuries"},{value:20,unit:"centuries"},s.y),i({value:2,unit:"centuries"},{value:50,unit:"centuries"},s.y),i({value:5,unit:"centuries"},{value:100,unit:"centuries"},s.y),i({value:10,unit:"centuries"},{value:200,unit:"centuries"},s.y),i({value:20,unit:"centuries"},{value:500,unit:"centuries"},s.y),i({value:50,unit:"centuries"},{value:1e3,unit:"centuries"},s.y),i({value:100,unit:"centuries"},{value:2e3,unit:"centuries"},s.y),i({value:200,unit:"centuries"},{value:5e3,unit:"centuries"},s.y),i({value:500,unit:"centuries"},{value:1e4,unit:"centuries"},s.y),i({value:1e3,unit:"centuries"},{value:2e4,unit:"centuries"},s.y)];function xt(t){return wt.map(({minorTick:e,majorTick:a,majorTickFormat:n},u)=>{let h=new it(e),m=new it(a),p=h.toMilliseconds(),g={...n,timeZone:t};return{minor:h,major:m,duration:p,format:g,index:u}})}var Et=Object.defineProperty,bt=Object.getOwnPropertyDescriptor,rt=t=>{throw TypeError(t)},r=(t,e,a,n)=>{for(var u=n>1?void 0:n?bt(e,a):e,h=t.length-1,m;h>=0;h--)(m=t[h])&&(u=(n?m(e,a,u):m(u))||u);return n&&u&&Et(e,a,u),u},lt=(t,e,a)=>e.has(t)||rt("Cannot "+a),k=(t,e,a)=>(lt(t,e,"read from private field"),a?a.call(t):e.get(t)),st=(t,e,a)=>e.has(t)?rt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),v=(t,e,a)=>(lt(t,e,"access private method"),a),E,c,P,Z,b,_,F,o=class extends ut{constructor(){super(...arguments),st(this,c),st(this,E,new AbortController),this.disabled=!1,this.format="date",this.loadPersistedSettingsDisabled=!1,this.loop=!1,this.mode="time-window",this.savePersistedSettingsDisabled=!1,this.stops=J}get _adjustedMajorTickFormat(){let{era:t,timeZone:e}=this;return{...this.majorTickFormat,era:this.majorTickFormat?.year?t:void 0,timeZone:e}}get _dateFormat(){let{era:t,timeZone:e}=this;return{...T("short-date"),era:t,timeZone:e}}get _dateTimeFormat(){let{era:t,timeZone:e}=this;return{...T("short-date"),...T("long-time"),era:t,timeZone:e}}get _thumbPositions(){if(!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty)return null;let{start:t,end:e}=this.timeExtent;switch(this.mode){case"cumulative-from-end":case"instant":return t?[t.getTime()]:null;case"cumulative-from-start":return e?[e.getTime()]:null;case"time-window":return t&&e?[t.getTime(),e.getTime()]:null}}get _timeFormat(){let{timeZone:t}=this;return{...T("long-time"),timeZone:t}}get effectiveStops(){let{fullTimeExtent:t,stops:e}=this;if(!e)return;if($(e)){let{dates:n}=e;if(!n?.length)return;let u=n.sort((f,y)=>f.getTime()-y.getTime());if(!t?.start||!t?.end)return u;let{start:h,end:m}=t,p=h.getTime(),g=m.getTime();return u.filter(f=>{let y=f.getTime();return y>=p&&y<=g})}let a=e.timeExtent??t;if(a)return S(e)?X(a,e.count):tt(a,e.interval)}get effectiveStopsEpoch(){return this.effectiveStops?.map(t=>t.getTime())}get era(){return(this.fullTimeExtent?.start?.getFullYear()??0)<0?"short":void 0}get interactive(){return!(this.disabled||this.state==="disabled")}get isOutOfRange(){let{timeExtent:t,fullTimeExtent:e}=this,{start:a,end:n}=e??{};if(!a||!n||!t||t.isAllTime||t.isEmpty)return!0;let{start:u,end:h}=t??{},m=u!=null&&(u<a||u>n),p=h!=null&&(h>n||h<a);return m||p}get majorTickFormatter(){return t=>this._formatDate(t,this._adjustedMajorTickFormat)}set playRate(t){t<=0||t>1e3*60*60||(this.state==="playing"&&v(this,c,Z).call(this),this._set("playRate",t))}get state(){return this.fullTimeExtent?this._animationController?"playing":"ready":"disabled"}get tickFormats(){return xt(this.timeZone)}get timeZone(){return this._userTimeZone??this.viewTimeZone??Y}set timeZone(t){this._userTimeZone=t??void 0}get viewTimeZone(){return this.view?.type==="2d"?this.view.timeZone:void 0}destroy(){k(this,E).abort(),this.view?.unregisterComponent(this),v(this,c,_).call(this)}formatDate(t){return this._formatDate(t,this._dateFormat)}formatDateTime(t){return this._formatDate(t,this._dateTimeFormat)}formatNumber(t,e){return this._formatNumber(t,e)}formatTime(t){return this._formatDate(t,this._timeFormat)}getTickValues(t){let{fullTimeExtent:e,timeZone:a}=this;if(!e)return[];let{start:n,end:u}=e;return!n||!u?[]:et(n,u,t,a).map(h=>h.getTime())}async initialize(){this.addHandles([w(()=>this.effectiveStops,t=>{t&&(this.timeExtent??=D(t,this.mode))},{initial:!0}),w(()=>this.timeExtent,t=>{!this.view||this.view.timeExtent&&t?.equals(this.view.timeExtent)||(!t||t.isAllTime)&&(!this.view.timeExtent||this.view.timeExtent.isAllTime)||(this.view.timeExtent=t)},{initial:!0}),w(()=>this.view,t=>{t?.timeExtent&&(this.timeExtent=t.timeExtent)}),w(()=>this.view,(t,e)=>{e?.unregisterComponent(this),t?.registerComponent(this)},{initial:!0,sync:!0}),w(()=>this.view?.timeExtent,t=>{!t||t.equals(this.timeExtent)||t.isAllTime&&(!this.timeExtent||this.timeExtent.isAllTime)||(this.timeExtent=t??void 0)}),w(()=>this.mode,t=>{if(!(!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||!this.fullTimeExtent?.start||!this.fullTimeExtent.end))switch(t){case"time-window":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:this.timeExtent.end??this.timeExtent.start});break;case"cumulative-from-start":this.timeExtent=new x({start:null,end:this.timeExtent.end??this.timeExtent.start});break;case"cumulative-from-end":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:null});break;case"instant":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:this.timeExtent.start??this.timeExtent.end});break}})]),await V((async()=>{if(await at(()=>this.view?.ready,{signal:k(this,E).signal}),this.loadPersistedSettingsDisabled)return;let t=await ct(this.view?.map,k(this,E).signal);t&&(this.fullTimeExtent=t.fullTimeExtent??void 0,this.loop=t.loop,this.mode=t.mode,this.playRate=t.playRate,this.stops=t.stops??void 0,this.timeExtent=t.timeExtent??void 0)})())}next(){v(this,c,b).call(this,{forward:!0,allowRestart:!1})}play(){v(this,c,Z).call(this)}previous(){v(this,c,b).call(this,{forward:!1,allowRestart:!1})}stop(){v(this,c,_).call(this)}updateWebDocument(t){if(this.savePersistedSettingsDisabled)return;let e=new mt({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:S(this.stops)?this.stops.count:null,numThumbs:this.mode==="time-window"?2:1,stopDelay:this.playRate,stopInterval:Q(this.stops)?this.stops.interval:null,stops:$(this.stops)?this.stops.dates:null});t.widgets??=new ht,t.widgets.timeSlider=e}_formatDate(t,e){return ft({locale:this.locale,formatOptions:e}).format(t)}_formatNumber(t,e){return gt({locale:this.locale,formatOptions:e}).format(t)}};E=new WeakMap;c=new WeakSet;P=async function(){try{let{view:t}=this,e=this._animationController?.signal;await Promise.all([H(this.playRate,e),t&&at(()=>!t.updating,e)])}catch(t){q(t)||j("error","arcgis-slider-time","animation error",{detail:{error:t}}),this._animationController=void 0;return}v(this,c,b).call(this,{forward:!0,allowRestart:!1}),this._animationController&&v(this,c,P).call(this)};Z=function(){v(this,c,_).call(this),this._animationController=new AbortController,v(this,c,b).call(this,{forward:!0,allowRestart:!0}),v(this,c,P).call(this)};b=function({forward:t,allowRestart:e}){let{_thumbPositions:a,effectiveStopsEpoch:n}=this;if(!a||!n)return;let u=a.map(m=>{let p=n.indexOf(m);if(p!==-1)return p;let g=n.reduce((f,y)=>Math.abs(y-m)<Math.abs(f-m)?y:f);return n.indexOf(g)}),h=u.map(m=>m+=t?1:-1);if(h.some(m=>m<0||m>n.length-1))if(this.loop||e){let m=Math.min(...u),p=Math.max(...u),g=(t?u.map(f=>f-m):u.map(f=>f+(n.length-1-p))).map(f=>n[f]);this.timeExtent=v(this,c,F).call(this,g)}else this.state==="playing"&&this.stop();else{let m=h.map(p=>n[p]);this.timeExtent=v(this,c,F).call(this,m)}};_=function(){this._animationController?.abort(),this._animationController=void 0};F=function(t){if(!t)return;let e=[...t].sort((a,n)=>a-n).map(a=>new Date(a));return D(e,this.mode)};r([l()],o.prototype,"_adjustedMajorTickFormat",1);r([l()],o.prototype,"_animationController",2);r([l()],o.prototype,"_dateFormat",1);r([l()],o.prototype,"_dateTimeFormat",1);r([l()],o.prototype,"_thumbPositions",1);r([l()],o.prototype,"_timeFormat",1);r([l()],o.prototype,"_userTimeZone",2);r([l()],o.prototype,"disabled",2);r([l()],o.prototype,"effectiveStops",1);r([l()],o.prototype,"effectiveStopsEpoch",1);r([l()],o.prototype,"era",1);r([l()],o.prototype,"format",2);r([l({type:x})],o.prototype,"fullTimeExtent",2);r([l()],o.prototype,"interactive",1);r([l()],o.prototype,"isOutOfRange",1);r([l()],o.prototype,"loadPersistedSettingsDisabled",2);r([l()],o.prototype,"locale",2);r([l()],o.prototype,"loop",2);r([l()],o.prototype,"majorTickFormat",2);r([l()],o.prototype,"majorTickFormatter",1);r([l()],o.prototype,"mode",2);r([l({value:1e3})],o.prototype,"playRate",1);r([l()],o.prototype,"savePersistedSettingsDisabled",2);r([l()],o.prototype,"state",1);r([l({cast:K})],o.prototype,"stops",2);r([l()],o.prototype,"tickFormats",1);r([l({type:x})],o.prototype,"timeExtent",2);r([l()],o.prototype,"timeZone",1);r([l()],o.prototype,"view",2);r([l()],o.prototype,"viewTimeZone",1);o=r([dt("components.time-bar.TimeBarViewModel")],o);var Tt=R`:host{box-shadow:var(--arcgis-internal-box-shadow, var(--calcite-shadow-sm));transition:max-height var(--calcite-internal-animation-timing-medium) ease-in-out}::slotted([slot="actions-end"]){border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);padding-inline-start:var(--calcite-spacing-sm)}.action-bar,.time-extent-group,.time-extent-group>slot{display:flex;flex:1 0 auto;place-items:center}.label{block-size:var(--calcite-size-fixed-xxxl);inline-size:175px}.settings{inline-size:calc(var(--arcgis-internal-panel-width) - 2 * var(--calcite-spacing-lg))}`,_t=U(o),O=class extends W{constructor(){super(...arguments),this._viewModel=_t(this),this.messages=L({name:"time-bar",blocking:!0}),this.#t=A(),this.#e=B(),this.#i=e=>{this._settingsActionElement=e},this.autoDestroyDisabled=!1,this.disabled=this._viewModel.disabled,this.effectiveStops=this._viewModel.effectiveStops,this.format=this._viewModel.format,this.fullTimeExtent=this._viewModel.fullTimeExtent,this.icon="clock",this.loadPersistedSettingsDisabled=this._viewModel.loadPersistedSettingsDisabled,this.loop=this._viewModel.loop,this.mode=this._viewModel.mode,this.playRate=this._viewModel.playRate,this.savePersistedSettingsDisabled=this._viewModel.savePersistedSettingsDisabled,this.showNext=!1,this.showPlay=!1,this.showPrevious=!1,this.showSettings=!1,this.state=this._viewModel.state,this.stops=this._viewModel.stops,this.timeExtent=this._viewModel.timeExtent,this.timeZone=this._viewModel.timeZone,this.view=this._viewModel.view,this.arcgisPropertyChange=I()("effectiveStops","fullTimeExtent","state","timeExtent"),this.arcgisReady=C()}static{this.properties={_settingsActionElement:16,autoDestroyDisabled:5,disabled:5,effectiveStops:32,format:1,fullTimeExtent:0,icon:1,label:1,loadPersistedSettingsDisabled:5,loop:5,messageOverrides:0,mode:1,playRate:9,referenceElement:1,savePersistedSettingsDisabled:5,showNext:5,showPlay:5,showPrevious:5,showSettings:5,state:32,stops:0,timeExtent:0,timeZone:1,view:0}}static{this.styles=Tt}#t;#e;#i;async applyTimeSettings(e){this._viewModel.set(e)}async destroy(){await this.manager.destroy()}async next(){this._viewModel.next()}async play(){this._viewModel.play()}async previous(){this._viewModel.previous()}async stop(){this._viewModel.stop()}async updateWebDocument(e){this._viewModel.updateWebDocument(e)}willUpdate(e){e.has("messages")&&(this._viewModel.locale=this.messages._lang)}#m(e){let{currentTarget:a}=e,n=z(a).at(0)??a.querySelector("arcgis-time-bar-extent");n&&(n.viewModel=this._viewModel)}async#h(){switch(this.state){case"disabled":case"playing":return await this.stop();case"ready":return await this.play()}}render(){return d`<div role=presentation><calcite-action-bar class="action-bar" layout=horizontal expand-disabled floating>${this.#e==="ltr"?d`${this.#a()}${this.#u()}${this.#l()}${this.#s()}`:d`${this.#l()}${this.#u()}${this.#a()}${this.#s()}`}</calcite-action-bar></div>`}#s(){return d`<slot name=actions-end slot=actions-end></slot>`}#a(){return this.showPrevious||this.showPlay||this.showNext?d`<calcite-action-group>${this.#e==="ltr"?d`${this.#o()}${this.#r()}${this.#n()}`:d`${this.#n()}${this.#r()}${this.#o()}`}</calcite-action-group>`:null}#n(){return this.showNext?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length||this.state==="playing"} icon=forward @click=${this.next} .text=${this.messages.next}></calcite-action>`:null}#o(){return this.showPlay?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length} .icon=${this.state==="playing"?"pause-f":"play-f"} @click=${this.#h} .text=${this.state==="playing"?this.messages.stop:this.messages.play}></calcite-action>`:null}#r(){return this.showPrevious?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length||this.state==="playing"} icon=reverse @click=${this.previous} .text=${this.messages.previous}></calcite-action>`:null}#l(){return this.showSettings?d`<calcite-action-group><calcite-action .disabled=${!this._viewModel.interactive} .text=${this.messages.settings} icon=sliders-horizontal ${M(this.#i)}></calcite-action>${this._settingsActionElement?d`<calcite-popover auto-close .heading=${this.messages.timeBarSettings} .label=${this.messages.timeBarSettings} .referenceElement=${this._settingsActionElement} @calcitePopoverClose=${()=>{this.#t.value?.navigateToOverview()}} overlay-positioning=fixed><slot name=settings><arcgis-time-bar-settings class="settings" .messages=${this.messages} .viewModel=${this._viewModel} ${M(this.#t)}></arcgis-time-bar-settings></slot></calcite-popover>`:void 0}</calcite-action-group>`:null}#u(){return d`<calcite-action-group class="time-extent-group"><slot name=time-extent @slotchange=${this.#m}><arcgis-time-bar-extent class="label" .viewModel=${this._viewModel}></arcgis-time-bar-extent></slot></calcite-action-group>`}};N("arcgis-time-bar",O);return O},"time/TimeExtent","core/Accessor","webdoc/widgets/TimeSlider","webdoc/Widgets","intl","time/TimeInterval","support/timeUtils","core/accessorSupport/decorators","core/reactiveUtils",a,b,c,e,f,g)
|
|
2
|
+
import g from"./YT6GA6QR.js";import{a as Y,k as G}from"./4SV6HHMC.js";import f from"./FHWOIM57.js";import"./VJVKFKSG.js";import e from"./3T7L7UT5.js";import{a as L}from"./2BVXNQ3U.js";import c from"./2FM2FJAY.js";import b from"./YHNRTH56.js";import{e as B,g as I}from"./3AQ6NC3C.js";import"./A4X5YDA6.js";import a from"./SDWFNKIL.js";import"./QUZTFUWM.js";import{b as z}from"./4W3T75SY.js";import{L as A,M,N as W,T as N,a as R,b as d,o as j,w as C}from"./WXLC6FPD.js";import"./H6RQVSYM.js";export default $arcgis.t(([ut,x,mt,ht,{convertDateFormatToIntlOptions:T},it,{getTimeSliderSettingsFromWebDocument:ct},{property:l,subclass:dt},{watch:w,whenOnce:at},,,,U,{d:q,f:V,i:H},{a:J,b:K,c:S,d:$,e:Q,f:X,g:tt,h:D,i:et}])=>{var nt=new WeakMap,ot=new WeakMap;function vt(t){let{locale:e,formatOptions:a}=t,n=yt(a),u=new Intl.DateTimeFormat(e,n);return nt.set(t,u),u}function pt(t){let{locale:e,formatOptions:a}=t,n=new Intl.NumberFormat(e,a);return ot.set(t,n),n}function ft(t){return nt.get(t)??vt(t)}function gt(t){return ot.get(t)??pt(t)}function yt(t){return t.timeZone?{...t,timeZone:G(t.timeZone)}:t}var i=(t,e,a)=>({minorTick:t,majorTick:e,majorTickFormat:a}),s={sf:{second:"numeric",fractionalSecondDigits:3},s:{second:"numeric"},ms:{minute:"numeric",second:"numeric"},mi:{minute:"numeric"},hm:{hour:"numeric",minute:"numeric"},dm:{day:"numeric",month:"short"},m:{month:"short"},my:{month:"short",year:"numeric"},y:{year:"numeric"}},wt=[i({value:1,unit:"milliseconds"},{value:20,unit:"milliseconds"},s.sf),i({value:2,unit:"milliseconds"},{value:50,unit:"milliseconds"},s.sf),i({value:5,unit:"milliseconds"},{value:100,unit:"milliseconds"},s.sf),i({value:10,unit:"milliseconds"},{value:200,unit:"milliseconds"},s.sf),i({value:20,unit:"milliseconds"},{value:500,unit:"milliseconds"},s.sf),i({value:50,unit:"milliseconds"},{value:1,unit:"seconds"},s.s),i({value:100,unit:"milliseconds"},{value:2,unit:"seconds"},s.s),i({value:200,unit:"milliseconds"},{value:5,unit:"seconds"},s.s),i({value:500,unit:"milliseconds"},{value:10,unit:"seconds"},s.s),i({value:1,unit:"seconds"},{value:20,unit:"seconds"},s.ms),i({value:2,unit:"seconds"},{value:30,unit:"seconds"},s.ms),i({value:5,unit:"seconds"},{value:1,unit:"minutes"},s.mi),i({value:10,unit:"seconds"},{value:2,unit:"minutes"},s.mi),i({value:20,unit:"seconds"},{value:5,unit:"minutes"},s.mi),i({value:40,unit:"seconds"},{value:10,unit:"minutes"},s.mi),i({value:1,unit:"minutes"},{value:30,unit:"minutes"},s.hm),i({value:2,unit:"minutes"},{value:1,unit:"hours"},s.hm),i({value:5,unit:"minutes"},{value:2,unit:"hours"},s.hm),i({value:10,unit:"minutes"},{value:4,unit:"hours"},s.hm),i({value:20,unit:"minutes"},{value:8,unit:"hours"},s.hm),i({value:40,unit:"minutes"},{value:1,unit:"days"},s.dm),i({value:1,unit:"hours"},{value:1,unit:"days"},s.dm),i({value:2,unit:"hours"},{value:2,unit:"days"},s.dm),i({value:5,unit:"hours"},{value:4,unit:"days"},s.dm),i({value:10,unit:"hours"},{value:10,unit:"days"},s.dm),i({value:20,unit:"hours"},{value:15,unit:"days"},s.dm),i({value:1,unit:"days"},{value:20,unit:"days"},s.dm),i({value:2,unit:"days"},{value:1,unit:"months"},s.m),i({value:5,unit:"days"},{value:3,unit:"months"},s.m),i({value:10,unit:"days"},{value:6,unit:"months"},s.my),i({value:20,unit:"days"},{value:1,unit:"years"},s.y),i({value:1,unit:"months"},{value:2,unit:"years"},s.y),i({value:2,unit:"months"},{value:4,unit:"years"},s.y),i({value:5,unit:"months"},{value:10,unit:"years"},s.y),i({value:1,unit:"years"},{value:20,unit:"years"},s.y),i({value:2,unit:"years"},{value:50,unit:"years"},s.y),i({value:5,unit:"years"},{value:100,unit:"years"},s.y),i({value:10,unit:"years"},{value:200,unit:"years"},s.y),i({value:20,unit:"years"},{value:500,unit:"years"},s.y),i({value:50,unit:"years"},{value:1e3,unit:"years"},s.y),i({value:1,unit:"centuries"},{value:20,unit:"centuries"},s.y),i({value:2,unit:"centuries"},{value:50,unit:"centuries"},s.y),i({value:5,unit:"centuries"},{value:100,unit:"centuries"},s.y),i({value:10,unit:"centuries"},{value:200,unit:"centuries"},s.y),i({value:20,unit:"centuries"},{value:500,unit:"centuries"},s.y),i({value:50,unit:"centuries"},{value:1e3,unit:"centuries"},s.y),i({value:100,unit:"centuries"},{value:2e3,unit:"centuries"},s.y),i({value:200,unit:"centuries"},{value:5e3,unit:"centuries"},s.y),i({value:500,unit:"centuries"},{value:1e4,unit:"centuries"},s.y),i({value:1e3,unit:"centuries"},{value:2e4,unit:"centuries"},s.y)];function xt(t){return wt.map(({minorTick:e,majorTick:a,majorTickFormat:n},u)=>{let h=new it(e),m=new it(a),p=h.toMilliseconds(),g={...n,timeZone:t};return{minor:h,major:m,duration:p,format:g,index:u}})}var Et=Object.defineProperty,bt=Object.getOwnPropertyDescriptor,rt=t=>{throw TypeError(t)},r=(t,e,a,n)=>{for(var u=n>1?void 0:n?bt(e,a):e,h=t.length-1,m;h>=0;h--)(m=t[h])&&(u=(n?m(e,a,u):m(u))||u);return n&&u&&Et(e,a,u),u},lt=(t,e,a)=>e.has(t)||rt("Cannot "+a),k=(t,e,a)=>(lt(t,e,"read from private field"),a?a.call(t):e.get(t)),st=(t,e,a)=>e.has(t)?rt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,a),v=(t,e,a)=>(lt(t,e,"access private method"),a),E,c,P,Z,b,_,F,o=class extends ut{constructor(){super(...arguments),st(this,c),st(this,E,new AbortController),this.disabled=!1,this.format="date",this.loadPersistedSettingsDisabled=!1,this.loop=!1,this.mode="time-window",this.savePersistedSettingsDisabled=!1,this.stops=J}get _adjustedMajorTickFormat(){let{era:t,timeZone:e}=this;return{...this.majorTickFormat,era:this.majorTickFormat?.year?t:void 0,timeZone:e}}get _dateFormat(){let{era:t,timeZone:e}=this;return{...T("short-date"),era:t,timeZone:e}}get _dateTimeFormat(){let{era:t,timeZone:e}=this;return{...T("short-date"),...T("long-time"),era:t,timeZone:e}}get _thumbPositions(){if(!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty)return null;let{start:t,end:e}=this.timeExtent;switch(this.mode){case"cumulative-from-end":case"instant":return t?[t.getTime()]:null;case"cumulative-from-start":return e?[e.getTime()]:null;case"time-window":return t&&e?[t.getTime(),e.getTime()]:null}}get _timeFormat(){let{timeZone:t}=this;return{...T("long-time"),timeZone:t}}get effectiveStops(){let{fullTimeExtent:t,stops:e}=this;if(!e)return;if($(e)){let{dates:n}=e;if(!n?.length)return;let u=n.sort((f,y)=>f.getTime()-y.getTime());if(!t?.start||!t?.end)return u;let{start:h,end:m}=t,p=h.getTime(),g=m.getTime();return u.filter(f=>{let y=f.getTime();return y>=p&&y<=g})}let a=e.timeExtent??t;if(a)return S(e)?X(a,e.count):tt(a,e.interval)}get effectiveStopsEpoch(){return this.effectiveStops?.map(t=>t.getTime())}get era(){return(this.fullTimeExtent?.start?.getFullYear()??0)<0?"short":void 0}get interactive(){return!(this.disabled||this.state==="disabled")}get isOutOfRange(){let{timeExtent:t,fullTimeExtent:e}=this,{start:a,end:n}=e??{};if(!a||!n||!t||t.isAllTime||t.isEmpty)return!0;let{start:u,end:h}=t??{},m=u!=null&&(u<a||u>n),p=h!=null&&(h>n||h<a);return m||p}get majorTickFormatter(){return t=>this._formatDate(t,this._adjustedMajorTickFormat)}set playRate(t){t<=0||t>1e3*60*60||(this.state==="playing"&&v(this,c,Z).call(this),this._set("playRate",t))}get state(){return this.fullTimeExtent?this._animationController?"playing":"ready":"disabled"}get tickFormats(){return xt(this.timeZone)}get timeZone(){return this._userTimeZone??this.viewTimeZone??Y}set timeZone(t){this._userTimeZone=t??void 0}get viewTimeZone(){return this.view?.type==="2d"?this.view.timeZone:void 0}destroy(){k(this,E).abort(),this.view?.unregisterComponent(this),v(this,c,_).call(this)}formatDate(t){return this._formatDate(t,this._dateFormat)}formatDateTime(t){return this._formatDate(t,this._dateTimeFormat)}formatNumber(t,e){return this._formatNumber(t,e)}formatTime(t){return this._formatDate(t,this._timeFormat)}getTickValues(t){let{fullTimeExtent:e,timeZone:a}=this;if(!e)return[];let{start:n,end:u}=e;return!n||!u?[]:et(n,u,t,a).map(h=>h.getTime())}async initialize(){this.addHandles([w(()=>this.effectiveStops,t=>{t&&(this.timeExtent??=D(t,this.mode))},{initial:!0}),w(()=>this.timeExtent,t=>{!this.view||this.view.timeExtent&&t?.equals(this.view.timeExtent)||(!t||t.isAllTime)&&(!this.view.timeExtent||this.view.timeExtent.isAllTime)||(this.view.timeExtent=t)},{initial:!0}),w(()=>this.view,t=>{t?.timeExtent&&(this.timeExtent=t.timeExtent)}),w(()=>this.view,(t,e)=>{e?.unregisterComponent(this),t?.registerComponent(this)},{initial:!0,sync:!0}),w(()=>this.view?.timeExtent,t=>{!t||t.equals(this.timeExtent)||t.isAllTime&&(!this.timeExtent||this.timeExtent.isAllTime)||(this.timeExtent=t??void 0)}),w(()=>this.mode,t=>{if(!(!this.timeExtent||this.timeExtent.isAllTime||this.timeExtent.isEmpty||!this.fullTimeExtent?.start||!this.fullTimeExtent.end))switch(t){case"time-window":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:this.timeExtent.end??this.timeExtent.start});break;case"cumulative-from-start":this.timeExtent=new x({start:null,end:this.timeExtent.end??this.timeExtent.start});break;case"cumulative-from-end":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:null});break;case"instant":this.timeExtent=new x({start:this.timeExtent.start??this.timeExtent.end,end:this.timeExtent.start??this.timeExtent.end});break}})]),await V((async()=>{if(await at(()=>this.view?.ready,{signal:k(this,E).signal}),this.loadPersistedSettingsDisabled)return;let t=await ct(this.view?.map,k(this,E).signal);t&&(this.fullTimeExtent=t.fullTimeExtent??void 0,this.loop=t.loop,this.mode=t.mode,this.playRate=t.playRate,this.stops=t.stops??void 0,this.timeExtent=t.timeExtent??void 0)})())}next(){v(this,c,b).call(this,{forward:!0,allowRestart:!1})}play(){v(this,c,Z).call(this)}previous(){v(this,c,b).call(this,{forward:!1,allowRestart:!1})}stop(){v(this,c,_).call(this)}updateWebDocument(t){if(this.savePersistedSettingsDisabled)return;let e=new mt({currentTimeExtent:this.timeExtent,fullTimeExtent:this.fullTimeExtent,loop:this.loop,numStops:S(this.stops)?this.stops.count:null,numThumbs:this.mode==="time-window"?2:1,stopDelay:this.playRate,stopInterval:Q(this.stops)?this.stops.interval:null,stops:$(this.stops)?this.stops.dates:null});t.widgets??=new ht,t.widgets.timeSlider=e}_formatDate(t,e){return ft({locale:this.locale,formatOptions:e}).format(t)}_formatNumber(t,e){return gt({locale:this.locale,formatOptions:e}).format(t)}};E=new WeakMap;c=new WeakSet;P=async function(){try{let{view:t}=this,e=this._animationController?.signal;await Promise.all([H(this.playRate,e),t&&at(()=>!t.updating,e)])}catch(t){q(t)||j("error","arcgis-slider-time","animation error",{detail:{error:t}}),this._animationController=void 0;return}v(this,c,b).call(this,{forward:!0,allowRestart:!1}),this._animationController&&v(this,c,P).call(this)};Z=function(){v(this,c,_).call(this),this._animationController=new AbortController,v(this,c,b).call(this,{forward:!0,allowRestart:!0}),v(this,c,P).call(this)};b=function({forward:t,allowRestart:e}){let{_thumbPositions:a,effectiveStopsEpoch:n}=this;if(!a||!n)return;let u=a.map(m=>{let p=n.indexOf(m);if(p!==-1)return p;let g=n.reduce((f,y)=>Math.abs(y-m)<Math.abs(f-m)?y:f);return n.indexOf(g)}),h=u.map(m=>m+=t?1:-1);if(h.some(m=>m<0||m>n.length-1))if(this.loop||e){let m=Math.min(...u),p=Math.max(...u),g=(t?u.map(f=>f-m):u.map(f=>f+(n.length-1-p))).map(f=>n[f]);this.timeExtent=v(this,c,F).call(this,g)}else this.state==="playing"&&this.stop();else{let m=h.map(p=>n[p]);this.timeExtent=v(this,c,F).call(this,m)}};_=function(){this._animationController?.abort(),this._animationController=void 0};F=function(t){if(!t)return;let e=[...t].sort((a,n)=>a-n).map(a=>new Date(a));return D(e,this.mode)};r([l()],o.prototype,"_adjustedMajorTickFormat",1);r([l()],o.prototype,"_animationController",2);r([l()],o.prototype,"_dateFormat",1);r([l()],o.prototype,"_dateTimeFormat",1);r([l()],o.prototype,"_thumbPositions",1);r([l()],o.prototype,"_timeFormat",1);r([l()],o.prototype,"_userTimeZone",2);r([l()],o.prototype,"disabled",2);r([l()],o.prototype,"effectiveStops",1);r([l()],o.prototype,"effectiveStopsEpoch",1);r([l()],o.prototype,"era",1);r([l()],o.prototype,"format",2);r([l({type:x})],o.prototype,"fullTimeExtent",2);r([l()],o.prototype,"interactive",1);r([l()],o.prototype,"isOutOfRange",1);r([l()],o.prototype,"loadPersistedSettingsDisabled",2);r([l()],o.prototype,"locale",2);r([l()],o.prototype,"loop",2);r([l()],o.prototype,"majorTickFormat",2);r([l()],o.prototype,"majorTickFormatter",1);r([l()],o.prototype,"mode",2);r([l({value:1e3})],o.prototype,"playRate",1);r([l()],o.prototype,"savePersistedSettingsDisabled",2);r([l()],o.prototype,"state",1);r([l({cast:K})],o.prototype,"stops",2);r([l()],o.prototype,"tickFormats",1);r([l({type:x})],o.prototype,"timeExtent",2);r([l()],o.prototype,"timeZone",1);r([l()],o.prototype,"view",2);r([l()],o.prototype,"viewTimeZone",1);o=r([dt("components.time-bar.TimeBarViewModel")],o);var Tt=R`:host{box-shadow:var(--arcgis-internal-box-shadow, var(--calcite-shadow-sm));transition:max-height var(--calcite-internal-animation-timing-medium) ease-in-out}::slotted([slot="actions-end"]){border-inline-start:var(--calcite-border-width-sm) solid var(--calcite-color-border-3);padding-inline-start:var(--calcite-spacing-sm)}.action-bar,.time-extent-group,.time-extent-group>slot{display:flex;flex:1 0 auto;place-items:center}.label{block-size:var(--calcite-size-fixed-xxxl);inline-size:175px}.settings{inline-size:calc(var(--arcgis-internal-panel-width) - 2 * var(--calcite-spacing-lg))}`,_t=U(o),O=class extends W{constructor(){super(...arguments),this._viewModel=_t(this),this.messages=L({name:"time-bar",blocking:!0}),this.#t=A(),this.#e=B(),this.#i=e=>{this._settingsActionElement=e},this.autoDestroyDisabled=!1,this.disabled=this._viewModel.disabled,this.effectiveStops=this._viewModel.effectiveStops,this.format=this._viewModel.format,this.fullTimeExtent=this._viewModel.fullTimeExtent,this.icon="clock",this.loadPersistedSettingsDisabled=this._viewModel.loadPersistedSettingsDisabled,this.loop=this._viewModel.loop,this.mode=this._viewModel.mode,this.playRate=this._viewModel.playRate,this.savePersistedSettingsDisabled=this._viewModel.savePersistedSettingsDisabled,this.showNext=!1,this.showPlay=!1,this.showPrevious=!1,this.showSettings=!1,this.state=this._viewModel.state,this.stops=this._viewModel.stops,this.timeExtent=this._viewModel.timeExtent,this.timeZone=this._viewModel.timeZone,this.view=this._viewModel.view,this.arcgisPropertyChange=I()("effectiveStops","fullTimeExtent","state","timeExtent"),this.arcgisReady=C()}static{this.properties={_settingsActionElement:16,autoDestroyDisabled:5,disabled:5,effectiveStops:32,format:1,fullTimeExtent:0,icon:1,label:1,loadPersistedSettingsDisabled:5,loop:5,messageOverrides:0,mode:1,playRate:9,referenceElement:1,savePersistedSettingsDisabled:5,showNext:5,showPlay:5,showPrevious:5,showSettings:5,state:32,stops:0,timeExtent:0,timeZone:1,view:0}}static{this.styles=Tt}#t;#e;#i;async applyTimeSettings(e){this._viewModel.set(e)}async destroy(){await this.manager.destroy()}async next(){this._viewModel.next()}async play(){this._viewModel.play()}async previous(){this._viewModel.previous()}async stop(){this._viewModel.stop()}async updateWebDocument(e){this._viewModel.updateWebDocument(e)}willUpdate(e){e.has("messages")&&(this._viewModel.locale=this.messages._lang)}#m(e){let{currentTarget:a}=e,n=z(a).at(0)??a.querySelector("arcgis-time-bar-extent");n&&(n.viewModel=this._viewModel)}async#h(){switch(this.state){case"disabled":case"playing":return await this.stop();case"ready":return await this.play()}}render(){return d`<div role=presentation><calcite-action-bar class="action-bar" layout=horizontal expand-disabled floating>${this.#e==="ltr"?d`${this.#a()}${this.#u()}${this.#l()}${this.#s()}`:d`${this.#l()}${this.#u()}${this.#a()}${this.#s()}`}</calcite-action-bar></div>`}#s(){return d`<slot name=actions-end slot=actions-end></slot>`}#a(){return this.showPrevious||this.showPlay||this.showNext?d`<calcite-action-group>${this.#e==="ltr"?d`${this.#o()}${this.#r()}${this.#n()}`:d`${this.#n()}${this.#r()}${this.#o()}`}</calcite-action-group>`:null}#n(){return this.showNext?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length||this.state==="playing"} icon=forward @click=${this.next} .text=${this.messages.next}></calcite-action>`:null}#o(){return this.showPlay?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length} .icon=${this.state==="playing"?"pause-f":"play-f"} @click=${this.#h} .text=${this.state==="playing"?this.messages.stop:this.messages.play}></calcite-action>`:null}#r(){return this.showPrevious?d`<calcite-action .disabled=${this._viewModel.isOutOfRange||!this._viewModel.interactive||!this.effectiveStops?.length||this.state==="playing"} icon=reverse @click=${this.previous} .text=${this.messages.previous}></calcite-action>`:null}#l(){return this.showSettings?d`<calcite-action-group><calcite-action .disabled=${!this._viewModel.interactive} .text=${this.messages.settings} icon=sliders-horizontal ${M(this.#i)}></calcite-action>${this._settingsActionElement?d`<calcite-popover auto-close .heading=${this.messages.timeBarSettings} .label=${this.messages.timeBarSettings} .referenceElement=${this._settingsActionElement} @calcitePopoverClose=${()=>{this.#t.value?.navigateToOverview()}} overlay-positioning=fixed><slot name=settings><arcgis-time-bar-settings class="settings" .messages=${this.messages} .viewModel=${this._viewModel} ${M(this.#t)}></arcgis-time-bar-settings></slot></calcite-popover>`:void 0}</calcite-action-group>`:null}#u(){return d`<calcite-action-group class="time-extent-group"><slot name=time-extent @slotchange=${this.#m}><arcgis-time-bar-extent class="label" .viewModel=${this._viewModel}></arcgis-time-bar-extent></slot></calcite-action-group>`}};N("arcgis-time-bar",O);return O},"core/Accessor","time/TimeExtent","webdoc/widgets/TimeSlider","webdoc/Widgets","intl","time/TimeInterval","support/timeUtils","core/accessorSupport/decorators","core/reactiveUtils",a,b,c,e,f,g)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as k}from"./5L5UYV3H.js";import{c as S}from"./TN5C3MSL.js";import d from"./3T7L7UT5.js";import{a as O}from"./2BVXNQ3U.js";import c from"./2FM2FJAY.js";import b from"./YHNRTH56.js";import{a as R,e as B}from"./3AQ6NC3C.js";import"./A4X5YDA6.js";import a from"./SDWFNKIL.js";import"./QUZTFUWM.js";import"./4W3T75SY.js";import{N as F,Q as m,T as E,a as C,b as u,w as v,y as x}from"./WXLC6FPD.js";import"./H6RQVSYM.js";export default $arcgis.t(([{property:c,subclass:H},j,_,{ignoreAbortErrors:V},{watch:g,on:M,whenOnce:I},W,U,K,Q,q,J,X,Y,{fetchPopupFeaturesFromGraphics:z},,,,G])=>{var Z=C`:host{width:100%;height:100%;padding:var(--calcite-space-none);margin:var(--calcite-space-none);display:flex;--internal-attribution-height: 16px;--arcgis-internal-presentation-padding-start: unset;--arcgis-internal-presentation-padding-end: unset;--arcgis-internal-presentation-cover-padding-top: unset;--arcgis-internal-presentation-cover-padding-bottom: unset;--arcgis-internal-presentation-cover-padding-start: unset;--arcgis-internal-presentation-cover-padding-end: unset}p{padding:0;margin:0}.root{display:flex;flex-direction:column;justify-content:space-between;width:100%;height:100%}.presentation-content{display:flex;width:100%;justify-content:flex-end;padding-top:var(--calcite-space-lg);padding-inline-start:calc(var(--calcite-space-lg) + var(--arcgis-internal-presentation-padding-start));padding-inline-end:calc(var(--calcite-space-lg) + var(--arcgis-internal-presentation-padding-end))}.navigation-container{display:flex;flex-direction:column;margin-inline-start:var(--calcite-space-lg);margin-block:auto calc(var(--calcite-space-lg) + var(--internal-attribution-height));width:fit-content;height:100%}.navigation{width:fit-content;display:flex;align-items:center;background-color:var(--calcite-color-surface-2);box-shadow:var(--arcgis-internal-box-shadow);pointer-events:auto}.navigation-slide-list-container{position:relative;height:100%;min-height:0;margin-block-start:var(--calcite-space-lg)}.slide-list-action-container{height:100%;align-content:center;border-inline-end:var(--calcite-border-width-sm) solid var(--calcite-color-border-3)}.slide-list-action{padding-inline:var(--calcite-space-sm)}.slide-counter-text{display:flex;align-items:center;justify-content:center;gap:var(--calcite-space-base)}.slide-counter-text-element{box-sizing:border-box;max-width:28px;margin:0;padding:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-variant-numeric:tabular-nums;min-width:var(--calcite-spacing-md);text-align:center}.legend-container{pointer-events:all;box-shadow:var(--calcite-shadow-sm);max-width:300px;height:auto;max-height:calc(100vh - 136px);overflow:hidden auto}.legend{padding:var(--esri-widget-padding);background-color:var(--calcite-color-surface-2)}`,ee=Object.defineProperty,te=Object.getOwnPropertyDescriptor,d=(i,e,t,s)=>{for(var n=s>1?void 0:s?te(e,t):e,r=i.length-1,a;r>=0;r--)(a=i[r])&&(n=(s?a(e,t,n):a(n))||n);return s&&n&&ee(e,t,n),n},l=class extends j{constructor(i){super(i),this.transitionActive=!1,this.showLegend=!1,this.keyboardNavigationEnabled=!1,this._subscribeToSlideEvents=e=>{this._unsubscribeToSlideEvents(e),e.forEach(t=>{let s=t.on("apply-slide-start",()=>this._onApplySlideStart(t)),n=t.on("apply-slide-complete",()=>this._onApplySlideComplete(t)),r=t.on("apply-slide-cancel",()=>this._onApplySlideCancel(t));this.addHandles(s,t.id),this.addHandles(n,t.id),this.addHandles(r,t.id)})},this._unsubscribeToSlideEvents=e=>{e.forEach(t=>{this.hasHandles(t.id)&&this.removeHandles(t.id)})}}initialize(){this.addHandles(g(()=>this.view?.map,(i,e)=>{if(this.hasHandles("sceneLoaded")&&this.removeHandles("sceneLoaded"),e){let t=e.presentation?.slides;t&&t.length>0&&this._unsubscribeToSlideEvents(t)}i&&this.addHandles(g(()=>i.loaded,t=>{t&&(this.removeHandles("sceneLoaded"),this._startWatchSlides(),this._slideId&&this._applySlideById(this._slideId))},{initial:!0}),"sceneLoaded")},{initial:!0}))}destroy(){this._unsubscribeToSlideEvents(this.slides)}get slideId(){return this._slideId}set slideId(i){i===void 0||!this.view?.map?.loaded?this._slideId=i:this._applySlideById(i)}get visibleSlides(){return this.view?.map?.presentation?.slides?.filter(i=>!i.hidden)??new _}get slides(){return this.view?.map?.presentation?.slides??new _}get lastSlideSelected(){return this.getSlideIndexBySlideId(this.slideId)===this.visibleSlides.length-1}get firstSlideSelected(){return this.getSlideIndexBySlideId(this.slideId)===0}get slideSelected(){return this.getSlideIndexBySlideId(this.slideId)>-1}get hasOnlyOneSlide(){return this.visibleSlides.length===1}get slideIndex(){return this.getSlideIndexBySlideId(this.slideId)}getSlideIndexBySlideId(i){let e=-1;return i&&(e=this.visibleSlides.findIndex(t=>t.id===i)),e}navigateInPresentation(i){let e=this.slideIndex+i,t=this._getSlideBySlideIndex(e);t??=this._getSlideBySlideIndex(0),t&&this.applySlide(t)}captureArrowKeysForNavigation(i,e){let t=["ArrowLeft","ArrowRight","PageUp","PageDown"];if(document.activeElement?.nodeName.toLowerCase()==="arcgis-scene"||!t.includes(i.code))return;let s=e==="rtl"?"ArrowRight":"ArrowLeft",n=i.code===s||i.code==="PageUp"?-1:1;this.navigateInPresentation(n)}async setSliceAnalysisInteractive(i){if(!this.view?.analyses?.length)return;let e=this.view.analyses.find(s=>s.type==="slice"&&s.origin?.type==="web-scene");if(!e)return;let t=await this.view.whenAnalysisView(e);t&&(t.interactive=i)}getSlideBySlideId(i){return this.visibleSlides.find(e=>e.id===i)}async applySlide(i,e,t){if(this.view){let s=t?{signal:t?.signal}:{};await V(i.applyTo(this.view,{...s,animate:!e}))}}_getSlideBySlideIndex(i){if(i!=null&&i>=0&&i<this.visibleSlides.length)return this.visibleSlides.getItemAt(i)}async _applySlideById(i){let e=i?this.getSlideBySlideId(i):void 0;e&&await this.applySlide(e)}_startWatchSlides(){this._subscribeToSlideEvents(this.slides),this.addHandles(M(()=>this.slides,"change",i=>{this._subscribeToSlideEvents(new _(i.added)),this._unsubscribeToSlideEvents(new _(i.removed))},{onListenerAdd:this._subscribeToSlideEvents,onListenerRemove:this._unsubscribeToSlideEvents}))}_onApplySlideStart(i){this._slideId=i.id,this.transitionActive=!0,this.showLegend=!1,this.onApplySlideStart?.(i)}_onApplySlideComplete(i){this.transitionActive=!1,this.showLegend=!!i.elements.legendInfo?.visible,this.onApplySlideComplete?.(i)}_onApplySlideCancel(i){this.transitionActive=!1,this.showLegend=!!i.elements.legendInfo?.visible,this.onApplySlideCancel?.(i)}};d([c()],l.prototype,"_slideId",2);d([c()],l.prototype,"view",2);d([c()],l.prototype,"slideId",1);d([c()],l.prototype,"transitionActive",2);d([c()],l.prototype,"showLegend",2);d([c()],l.prototype,"keyboardNavigationEnabled",2);d([c()],l.prototype,"visibleSlides",1);d([c()],l.prototype,"slides",1);d([c()],l.prototype,"lastSlideSelected",1);d([c()],l.prototype,"firstSlideSelected",1);d([c()],l.prototype,"slideSelected",1);d([c()],l.prototype,"hasOnlyOneSlide",1);d([c()],l.prototype,"onApplySlideStart",2);d([c()],l.prototype,"onApplySlideComplete",2);d([c()],l.prototype,"onApplySlideCancel",2);d([c()],l.prototype,"getSlideIndexBySlideId",1);l=d([H("components.presentation.PresentationViewModel")],l);var A=class extends x{constructor(e){super(e)}hostLoaded(){this.component.manager.onLifecycle(()=>{let e=this.component;I(()=>e.referenceElement).then(t=>{this._isArcgisScene(t)&&(this._sceneRef=t)})})}openPopup(e){this.component.view&&this.component.slideId===e.id&&e.elements.popupInfo!=null&&this._preparePopupFeature(this.component.view,e.elements.popupInfo).then(({success:t,features:s,popupInfo:n})=>{this.component.slideId===e.id&&(t?this._handlePopupFeatureFound(e,s,n):this.component.arcgisPopupFeatureNotFound.emit({slide:e}))})}_isArcgisScene(e){return e===void 0||typeof e=="string"?!1:"tagName"in e&&e.tagName==="ARCGIS-SCENE"}closePopup(e){(!this.component.slidePopupDisabled||e)&&this._sceneRef?.closePopup()}async _handlePopupFeatureFound(e,t,s){let n=s?.location??void 0;this.component.arcgisPopupFeaturesRetrieved.emit({slide:e,features:t,location:n}),this.component.slidePopupDisabled||await this._sceneRef?.openPopup({features:t,location:n})}async _preparePopupFeature(e,t){let s=[];if(!t.features?.length||t.features.length===0)return{success:!1,features:s};let n=t.features?.getItemAt(t.selectedFeatureIndex)?.layerReference;if(n?.layerId==null)return{success:!1,features:s};let{layer:r,sublayer:a}=this._getLayersFromView(e,n.layerId,n?.sublayerId);if(!r)return{success:!1,features:s};let p=a??r;if(!p||!this._layerTypeSupportsCapturePopup(p))return{success:!1,features:s};if(s=await this._fetchFeaturesFromQueryable(e,t,r,a,p),s&&this._featureHasBeenFilledWithAttributes(s)){let o=s[0];return this._setFallbackPopupTemplate(o,a,r),this._setFallbackGeometry(o,t?.location),{success:!0,features:s,popupInfo:t}}return{success:!1,features:s}}_getLayersFromView(e,t,s){let n=e.map?.findLayerById(t)??void 0,r=this._getBuildingSceneLayerSublayer(n,s);return{layer:n,sublayer:r}}_getBuildingSceneLayerSublayer(e,t){let s;return e&&this._isLayer(e)&&this._isBuildingSceneLayer(e)&&t!=null&&(s=e.allSublayers.find(n=>n.id===t&&n.type==="building-component")),s}_featureHasBeenFilledWithAttributes(e){return e&&e.length>0&&e[0].attributes&&Object.entries(e[0].attributes)?.length>1}async _fetchFeaturesFromQueryable(e,t,s,n,r){let a=t.features?.getItemAt(t.selectedFeatureIndex);if(a?.id==null)return await Promise.resolve([]);let p=await e.whenLayerView(s);await I(()=>!p.updating);let o=this._tryGetBuildingComponentSublayerView(s,n,p)??p;await I(()=>!o.updating);let h=this._createFeatureGraphic(s,n,r,a.id),b=await z(o,[h]);return this._featureHasBeenFilledWithAttributes(b)||(await I(()=>!e.updating),b=await z(o,[h])),b}_tryGetBuildingComponentSublayerView(e,t,s){let n;return this._isLayer(e)&&this._isBuildingSceneLayer(e)&&t!=null&&(n=s.sublayerViews.find(r=>r.sublayer.id===t.id)),n}_setFallbackPopupTemplate(e,t,s){e.popupTemplate==null&&(e.popupTemplate=t?.popupTemplate?t.popupTemplate:s.popupTemplate)}_setFallbackGeometry(e,t){e.geometry==null&&t&&(e.geometry=t.clone())}_createFeatureGraphic(e,t,s,n){let r=this._getGlobalIdFieldNameFromLayer(s),a=n.type==="global-id"&&r?r:s.objectIdField,p=this._getGraphicOrigin(e,t),o=new W({attributes:{},layer:e,origin:p});return o.attributes[a]=n.value,o}_getGraphicOrigin(e,t){switch(e.type){case"csv":return new K(e);case"feature":return new Y(e);case"geojson":return new Q(e);case"scene":return new q(e);case"wfs":return new J(e);case"building-scene":return t?new X(t):void 0;default:return}}_layerTypeSupportsCapturePopup(e){return e!=null&&["csv","feature","geojson","wfs","scene","building-component"].includes(e.type)}_isLayer(e){return!!e&&e instanceof U}_isBuildingSceneLayer(e){return e?.type==="building-scene"}_getGlobalIdFieldNameFromLayer(e){return e.fields?.find(t=>t.type==="global-id")?.name}},ie=i=>new A(i),y=Object.freeze({width:0,height:0}),w=new WeakMap,f=()=>({topCenter:{...y},topLeft:{...y},topRight:{...y},bottomCenter:{...y},bottomLeft:{...y},bottomRight:{...y}}),D=i=>({topCenter:{...i.topCenter},topLeft:{...i.topLeft},topRight:{...i.topRight},bottomCenter:{...i.bottomCenter},bottomLeft:{...i.bottomLeft},bottomRight:{...i.bottomRight}}),N=i=>{let e=w.get(i);return e||(e={observedGroups:new Map,observedSizes:f(),subscribers:new Set},w.set(i,e)),e},se=i=>{let e=i?.topCenter.value,t=i?.topLeft.value,s=i?.topRight.value,n=i?.bottomCenter.value,r=i?.bottomLeft.value,a=i?.bottomRight.value;return e&&t&&s&&n&&r&&a?{topCenter:e,topLeft:t,topRight:s,bottomCenter:n,bottomLeft:r,bottomRight:a}:null},ne=(i,e)=>S.every(t=>i.get(t)===e[t]),re=i=>{let e=D(i.observedSizes);i.subscribers.forEach(t=>t(e))},ae=(i,e)=>{let t=w.get(i);if(!t)return;let s=!1;e.forEach(n=>{let r=S.find(b=>t.observedGroups.get(b)===n.target);if(!r)return;let{width:a,height:p}=n.contentRect,o={width:a,height:p},h=t.observedSizes[r];h.width===o.width&&h.height===o.height||(t.observedSizes[r]=o,s=!0)}),s&&re(t)},L=(i,e)=>{let t=N(i);t.resizeObserver||(t.resizeObserver=new ResizeObserver(n=>{ae(i,n)}));let s=se(e);if(!s){t.observedGroups.size>0&&(t.resizeObserver.disconnect(),t.observedGroups.clear());return}ne(t.observedGroups,s)||(t.resizeObserver.disconnect(),t.observedGroups.clear(),S.forEach(n=>{let r=s[n];t.observedGroups.set(n,r),t.resizeObserver?.observe(r)}))},le=(i,e)=>{let t=N(i);return t.subscribers.add(e),e(D(t.observedSizes)),()=>{let s=w.get(i);s&&(s.subscribers.delete(e),s.subscribers.size===0&&(s.resizeObserver?.disconnect(),s.observedGroups.clear(),w.delete(i)))}},P=class extends x{#e;#t;#i;constructor(e){super(e),this.exports=f()}hostDisconnected(){this.#i?.(),this.#i=void 0,this.#t=void 0,this.#e=void 0,this.exports=f()}hostLifecycle(){return[g(()=>this.#s(),e=>{if(this.#t!==e){if(this.#i?.(),this.#i=void 0,this.#t=e,this.#e=e?.slotGroupRefs,!e){this.exports=f();return}this.#i=le(e,t=>{this.#n(t)||(this.exports=t)}),L(e,this.#e)}},{sync:!0,initial:!0}),g(()=>this.#s()?.slotGroupRefs,e=>{this.#e=e,this.#t&&e&&L(this.#t,e)},{sync:!0,initial:!0})]}#s(){let{referenceElement:e}=this.component;return e&&typeof e!="string"?e:void 0}hostUpdated(){!this.#t||!this.#e||L(this.#t,this.#e)}#n(e){let t=this.exports??f();return S.every(s=>{let n=t[s],r=e[s];return n.width===r.width&&n.height===r.height})}},oe=R(P),de=G(l),$=class extends F{constructor(){super(...arguments),this._messages=O(),this.#e=de(this),this.#t=B(),this.#s=e=>{this.#e.captureArrowKeysForNavigation(e,this.#t)},this.#n=ie(this),this.#a=null,this.#o=e=>{this.#n.closePopup(),this.arcgisSlideApplyStart.emit({slide:e})},this.#d=e=>{this.#n.openPopup(e),this.sliceAnalysisInteractive&&this.#e.setSliceAnalysisInteractive(!0),this.arcgisSlideApplyComplete.emit({slide:e})},this.#c=e=>{this.sliceAnalysisInteractive&&this.#e.setSliceAnalysisInteractive(!0),this.arcgisSlideApplyCancel.emit({slide:e})},this.#p=e=>{let t=e.detail?.selectedSlide;if(!t)return;this.#r?.abort(),this.#r=new AbortController;let s=Date.now(),n=this.#a!==null&&s-this.#a<300;if(this.#a=s,this.#e.applySlide(t,n,this.#r),n){this._showSlideList=!1;return}setTimeout(()=>{this.#r?.signal.aborted||(this._showSlideList=!1,this.#e.applySlide(t,!1,this.#r))},300)},this.#l=()=>{this._showSlideList=!1},this._showSlideList=!1,this.autoDestroyDisabled=!1,this.view=this.#e.view,this.visualScale="m",this.keyboardNavigationEnabled=!1,this.slidePopupDisabled=!1,this.slideCaptionsDisabled=!1,this.slideLegendDisabled=!1,this.sliceAnalysisInteractive=!1,this.navigationHidden=!1,this.arcgisPopupFeatureNotFound=v(),this.arcgisPopupFeaturesRetrieved=v(),this.arcgisReady=v(),this.arcgisSlideApplyCancel=v(),this.arcgisSlideApplyComplete=v(),this.arcgisSlideApplyStart=v()}static{this.properties={_slotSizesController:16,_showSlideList:16,slideId:1,autoDestroyDisabled:5,view:0,visualScale:1,keyboardNavigationEnabled:5,slidePopupDisabled:5,slideCaptionsDisabled:5,slideLegendDisabled:5,sliceAnalysisInteractive:5,navigationHidden:5}}static{this.styles=Z}#e;#t;#i;#s;#n;#r;#a;#o;#d;#c;#p;#l;#u;#h;get slideId(){return this.#e.slideId}set slideId(e){this.#e.slideId=e}async destroy(){await this.manager.destroy()}loaded(){this.#e.onApplySlideStart=this.#o,this.#e.onApplySlideComplete=this.#d,this.#e.onApplySlideCancel=this.#c,this.#y();let e=this;this.manager.onLifecycle(()=>[g(()=>this.slidePopupDisabled,t=>{if(this.slideId&&!t){let s=this.#e.getSlideBySlideId(this.slideId);s&&this.#n?.openPopup(s)}else t&&this.#n?.closePopup(!0)}),g(()=>this.sliceAnalysisInteractive,t=>{this.#e.setSliceAnalysisInteractive(t)},{initial:!0}),g(()=>e.referenceElement,t=>{this.#g(t)&&(this._slotSizesController=oe(this),this.#h=this.#v())},{once:!0,initial:!0}),{remove:()=>{document.removeEventListener("keydown",this.#s),this.#u?.removeEventListener("arcgisSlideListClose",this.#l),this.#i?.remove(),this.#h?.remove(),this.#r?.abort()}}])}#g(e){return e===void 0||typeof e=="string"?!1:"tagName"in e&&e.tagName==="ARCGIS-SCENE"}#v(){return g(()=>this._slotSizesController,e=>this.#m(e?.topLeft,e?.topRight,e?.bottomLeft,e?.bottomRight),{initial:!0})}#m(e,t,s,n){let r=this.#t==="ltr"?e?.width??0:t?.width??0,a=this.#t==="ltr"?t?.width??0:e?.width??0,p=Math.max(e?.height??0,t?.height??0),o=Math.max(s?.height??0,n?.height??0);r>0?this.el.style.setProperty("--arcgis-internal-presentation-padding-start",`calc(var(--calcite-space-lg) + ${r.toString()}px)`):this.el.style.setProperty("--arcgis-internal-presentation-padding-start","0px"),a>0?this.el.style.setProperty("--arcgis-internal-presentation-padding-end",`calc(var(--calcite-space-lg) + ${a.toString()}px)`):this.el.style.setProperty("--arcgis-internal-presentation-padding-end","0px");let h=r<=Math.max(p,o)&&a<=Math.max(p,o);this.el.style.setProperty("--arcgis-internal-presentation-cover-padding-top",h?"0":`${p}px`),this.el.style.setProperty("--arcgis-internal-presentation-cover-padding-bottom",h?"0":`${o}px`),this.el.style.setProperty("--arcgis-internal-presentation-cover-padding-start",h?`${r}px`:"0"),this.el.style.setProperty("--arcgis-internal-presentation-cover-padding-end",h?`${a}px`:"0")}#y(){this.#i=g(()=>this.keyboardNavigationEnabled,e=>{document.removeEventListener("keydown",this.#s),e&&document.addEventListener("keydown",this.#s)},{initial:!0})}render(){if(this.#e?.visibleSlides?.length===0)return u`<div></div>`;let e=this.#e.visibleSlides.find(r=>r.id===this.slideId),t=this.#b(),s=this.#f(e),n=this.#w();return u`<div class="root"><div class="presentation-content">${s}${n}</div>${t}</div>`}#b(){if(this.navigationHidden)return null;let e=this.#e.lastSlideSelected&&!this.#e.hasOnlyOneSlide,t=this.#t==="rtl",s=t?"chevron-right":"chevron-left",n=t?"chevron-left":"chevron-right",r=this.#_();return u`<div class="navigation-container"><div class="navigation-slide-list-container">${r}</div><div class="navigation"><div class="slide-list-action-container"><calcite-action id=${k} class="slide-list-action" .text=${this._messages.slideList??""} selection-appearance=highlight icon=list .scale=${this.visualScale==="l"?"m":"s"} .label=${this._messages.slideList} title=${this._messages.slideList??m} .active=${this._showSlideList} @click=${()=>this._showSlideList=!this._showSlideList}></calcite-action></div><calcite-button appearance=transparent icon-start=${s??m} icon-flip-rtl=start kind=neutral .scale=${this.visualScale} .disabled=${this.#e.firstSlideSelected||!this.#e.slideSelected} .label=${this._messages.previous} title=${this._messages.previous??m} @click=${()=>this.#e.navigateInPresentation(-1)}></calcite-button><div class="slide-counter-text">${this.#S()}</div><calcite-button appearance=transparent icon-start=${(e?"reset":n)??m} icon-flip-rtl=start kind=neutral .scale=${this.visualScale} .label=${e?this._messages.restart:this._messages.next} title=${(e?this._messages.restart:this._messages.next)??m} @click=${()=>this.#e.navigateInPresentation(1)}></calcite-button></div></div>`}#S(){let e=this.#e.slideIndex+1,t=this._messages?.slideNavAriaText?.replace("${index}",e.toString()).replace("${numberOfSlides}",this.#e.visibleSlides.length.toString());return this.#e.slideSelected?u`<p role=banner aria-label=${t??m} aria-live=polite><div class="slide-counter-text-element" data-testId=arcgis-map-presentation-slideIndex>${e}</div><div>/</div><p class="slide-counter-text-element" data-testId=arcgis-map-presentation-numberOfSlides>${this.#e.visibleSlides.length}</p></p>`:u`<p role=banner data-testId=arcgis-map-presentation-numberOfSlides>${this.#e.visibleSlides?.length} ${this._messages?.slides}</p>`}#f(e){return this.slideCaptionsDisabled?null:u`<arcgis-presentation-captions .slide=${e} .transitionActive=${this.#e.transitionActive}></arcgis-presentation-captions>`}#w(){return this.slideLegendDisabled||!this.#e.showLegend?null:u`<calcite-panel data-testid=presentation-legend class="legend-container" .heading=${this._messages.legend} closable @calcitePanelClose=${()=>this.#e.showLegend=!1}><arcgis-legend class="legend" .view=${this.view} @arcgisReady=${e=>e.stopPropagation()}></arcgis-legend></calcite-panel>`}#_(){return this._showSlideList?u`<arcgis-presentation-slide-list .slides=${this.#e.visibleSlides} .slideId=${this.#e.slideId} .label=${this._messages.slideList} .visualScale=${this.visualScale} @arcgisSlideListItemSelected=${this.#p} @arcgisSlideListOutsideClick=${this.#l}></arcgis-presentation-slide-list>`:null}};E("arcgis-presentation",$);return $},"core/accessorSupport/decorators","core/Accessor","core/Collection","core/promiseUtils","core/reactiveUtils","Graphic","layers/Layer","graphic/CSVGraphicOrigin","graphic/GeoJSONGraphicOrigin","graphic/SceneGraphicOrigin","graphic/WFSGraphicOrigin","graphic/BuildingGraphicOrigin","graphic/FeatureGraphicOrigin","applications/SceneViewer/sceneViewerUtils",a,b,c,d)
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{g as $}from"./3AQ6NC3C.js";import"./A4X5YDA6.js";import"./QUZTFUWM.js";import"./4W3T75SY.js";import{N as m,T as g,a as d,b as i,w as v}from"./WXLC6FPD.js";import"./H6RQVSYM.js";var x=d`calcite-notice{margin-bottom:var(--calcite-space-xs)}`,l=class extends m{constructor(){super(...arguments),this.allowEditingDisabled=!1,this.invalidInitialVersion=!1,this.versioningStateFailedToLoad=!1,this.arcgisInternalManageVersion=v(),this.arcgisPropertyChange=$()("selectedFeatureService")}static{this.properties={allowEditingDisabled:5,invalidInitialVersion:5,messages:0,selectedFeatureService:0,serviceName:1,serviceUrl:1,versioningStateFailedToLoad:5,viewModel:0}}static{this.styles=x}#e(s){let{serviceUrl:t,viewModel:e}=this,a=e?.versioningStateLookup.get(t)?.versionInfos??[],o=s.target.selectedItems[0].value,c=a.find(n=>n.versionIdentifier.guid===o);this.arcgisInternalManageVersion.emit({actionType:"changeVersion",serviceUrl:this.serviceUrl,versionInfo:c})}render(){let{allowEditingDisabled:s,messages:t,serviceName:e,serviceUrl:a,versioningStateFailedToLoad:o,viewModel:c}=this,n=c?.versioningStateLookup.get(a),h=n?.versionInfos??[],p=this.invalidInitialVersion?i`<calcite-notice closable kind=warning open scale=s width=full icon><div slot=title>${t?.headers.invalidInitialVersion}</div><div slot=message>${t?.loadErrors.invalidInitialVersion}</div></calcite-notice>`:void 0,b=o?i`<calcite-notice kind=warning open scale=s width=full icon><div slot=title>${t?.headers.versioningStateFailedToLoad}</div><div slot=message>${t?.loadErrors.versioningStateFailedToLoad}</div></calcite-notice>`:void 0,f=o?void 0:i`<calcite-combobox .ariaLabel=${`combobox-${e}`} .label=${`combobox-${e}`} max-items=5 overlay-positioning=fixed selection-mode=single-persist @calciteComboboxChange=${this.#e}>${h.map(r=>i`<calcite-combobox-item .heading=${r.versionIdentifier.name} .selected=${n?.currentVersionInfo?.versionIdentifier.guid===r.versionIdentifier.guid&&n?.currentVersionInfo?.versionIdentifier.name===r.versionIdentifier.name} .value=${r.versionIdentifier.guid}></calcite-combobox-item>`)}</calcite-combobox>`,u=!o&&!s?i`<calcite-action icon=list .id=${`action-manage-versions-${e}`} .label=${`action-manage-versions-${e}`} scale=s slot=actions-end .text=${`action-manage-versions-${e}`} @click=${()=>{this.selectedFeatureService={url:a,name:e}}}></calcite-action>`:void 0,I=s?void 0:i`<calcite-tooltip overlay-positioning=fixed .referenceElement=${`action-manage-versions-${e}`}><span>${t?.headers.manageVersions}</span></calcite-tooltip>`;return i`<calcite-block expanded .heading=${e}>${p}${b}${f}${u}${I}</calcite-block>`}};g("arcgis-version-management-service-item",l);export{l as ArcgisVersionManagementServiceItem};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{b as w,c as g}from"./MZBCC5YA.js";import{b,c as a,e as f}from"./3AQ6NC3C.js";import{b as c,e as d,g as E}from"./4W3T75SY.js";import{L as m,b as l,w as r,y as h}from"./WXLC6FPD.js";export default $arcgis.t(([{when:v,watch:y}])=>{var P=class extends h{constructor(t){super(t),this.direction=f(),this.popupRef=m(),this.slotGroupRefs=w(),this.attributionHeight=0,this._uiContainer=null,this.component.listenOn(globalThis,"unhandledrejection",o=>{let e=o.reason;if(e?.name==="webgl:required"){let{name:i}=e;this.webGLError={name:i}}})}hostLifecycle(){return[v(()=>this.component.view.ready,()=>{this._assignDefaultPopup()}),v(()=>this.component.view.popup?.visible,()=>{this.popupElement?.open&&(this.popupElement.open=!1)}),this.component.view.on("click",[],t=>{let o=t.native;t.button!==0||o?.ctrlKey||o?.metaKey||this._handleOpenPopup(t)},-2)]}async openPopup(t){if(this._assignDefaultPopup(),this.closePopup(),this.popupElement){await this.popupElement.componentOnReady(),this.popupElement.open=!0;let{fetchFeatures:o,shouldFocus:e,title:i,featureStream:n,promises:s,...u}=t;delete t.fetchFeatures,s&&s.length>0&&Object.assign(u,{promises:s}),Object.assign(this.popupElement,u),n&&(this.popupElement.featureStream=n),i!==void 0&&(this.popupElement.heading=i),e&&await this.popupElement.setFocus(),o&&!n&&await this.popupElement.fetchFeatures()}else await this.component.view.openPopup(t)}closePopup(){this.popupElement&&(this.popupElement.open=!1),this.component.view.closePopup()}_assignDefaultPopup(){this.popupRef.value&&!this.popupElement&&(this.popupElement=this.popupRef.value,this.popupElement.referenceElement=this.component.el,this.popupElement.view=this.component.view)}handleAttributionHeightChange(t){if(!(this.attributionHeight===t||!this.component.el.shadowRoot)){if(this.attributionHeight=t,!this._uiContainer){let o=this.component.el.shadowRoot.querySelector(".arcgis-map-container-ui");this._uiContainer=o}this._uiContainer?.style.setProperty("--arcgis-internal-attribution-space-top",`${this.attributionHeight}px`)}}_maybeDisableViewPopup(){this.component.view&&(this.component.popupComponentEnabled||this.popupElement)&&(this.previousViewPopupEnabled=this.component.view.popupEnabled,this.component.view.popupEnabled=!1)}_maybeResetViewPopup(){this.component.view&&this.previousViewPopupEnabled!==void 0&&(this.component.view.popupEnabled=this.previousViewPopupEnabled,this.previousViewPopupEnabled=void 0)}async _handleOpenPopup(t){if(this._assignDefaultPopup(),!this.component.popupDisabled){if(this._maybeDisableViewPopup(),this.popupElement){let o={x:t.x,y:t.y},e=this.component.view?.fetchPopupFeatures(o);e?await this.openPopup({location:t.mapPoint,featureStream:e}):this.popupElement?.open&&this.closePopup()}this._maybeResetViewPopup()}}_handlePopupSlotChange(t){let o=c(t.target,"arcgis-popup");!this.popupElement&&o.length?this.popupElement=o[0]:o.length||(this.popupElement=void 0)}_webGLErrorAlert(){return this.webGLError?l`<arcgis-webgl-error .errorName=${this.webGLError.name}></arcgis-webgl-error>`:null}render(){return g({direction:this.direction,popupComponentEnabled:this.component.popupComponentEnabled,slotGroupRefs:this.slotGroupRefs,handlePopupSlotChange:t=>this._handlePopupSlotChange(t),webGLErrorElement:this._webGLErrorAlert(),popupElement:this.popupRef})}};function O(p){b((t,o)=>{let e=()=>{if(p.attributionMode!=="auto")return;let i=E(p.el);p.view.attributionMode!==i&&(p.view.attributionMode=i)};o.onLifecycle(()=>(e(),d(p.el,["class"],e))),o.onUpdate(i=>{i.has("attributionMode")&&p.attributionMode==="auto"&&e()})})}var V=a((p,t)=>{let o=r();return t.onLifecycle(()=>y(()=>{let{map:e}=p;if(!e||e.destroyed)return[];let i=[];return e.loadError&&i.push(e),e.basemap?.loadError&&i.push(e.basemap),e.ground.loadError&&i.push(e.ground),[...e.allLayers,...e.allTables].forEach(n=>{n.loadError&&i.push(n)}),i},e=>{e.length&&(p.loadErrorSources=e,o.emit())})),o}),A=a((p,t)=>{let o=r();return t.onLifecycle(()=>y(()=>p.view?.readyState,e=>{(e==="map-content-error"||e==="rendering-error")&&o.emit()})),o});return{a:P,b:O,c:V,d:A}},"core/reactiveUtils")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import{a as h}from"./5L5UYV3H.js";import"./QUZTFUWM.js";import{d as p}from"./4W3T75SY.js";import{N as n,O as d,Q as a,T as m,a as r,b as s,w as l}from"./WXLC6FPD.js";import"./H6RQVSYM.js";export default $arcgis.t(([])=>{var u=r`:host{--calcite-list-background-color: var(--calcite-color-transparent);position:absolute;inset-block-end:0;display:flex;flex-direction:column;justify-content:flex-end;height:100%}.presentation-slide-list-container{overflow-x:hidden;overflow-y:auto;pointer-events:auto;background-color:var(--calcite-color-surface-2);box-shadow:var(--arcgis-internal-box-shadow)}.presentation-slide-list{position:relative;display:block;width:300px;box-sizing:border-box}.slide-list-item-content{position:relative;display:flex;height:100%;justify-content:flex-start;box-sizing:border-box}.slide-list-item-selected{border:1px solid var(--calcite-color-surface-2);background:var(--calcite-color-surface-highlight)}.card-slide-title{margin-inline-start:var(--calcite-space-md);padding-inline-end:var(--calcite-space-xs);min-inline-size:0;align-content:center;font-size:var(--calcite-font-size--1)}.card-slide-title-text{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-box-orient:vertical;-webkit-line-clamp:2}@supports (line-clamp: 2){.card-slide-title-text{line-clamp:2}}.card-image{width:114px;height:62px}`,c=class extends n{constructor(){super(...arguments),this.visualScale="m",this.arcgisSlideListItemSelected=l(),this.arcgisSlideListOutsideClick=l()}static{this.properties={slides:0,slideId:1,label:1,visualScale:1}}static{this.styles=u}loaded(){this.manager.onLifecycle(()=>{this.listenOn(window,"mouseup",this.#t),this.#i()})}#e(e){requestAnimationFrame(()=>{this.arcgisSlideListItemSelected.emit({selectedSlide:e})})}#t(e){let t=e.composedPath();t.includes(this.el)||t.some(i=>i instanceof HTMLElement&&i.id===h)||this.arcgisSlideListOutsideClick.emit()}#i(){let e=this.renderRoot.querySelector("calcite-list-item[selected]");e&&e.setFocus()}render(){return!this.slides||this.slides?.length===0?s`<div></div>`:s`<div class="presentation-slide-list-container"><calcite-list .label=${this.label??""} class="presentation-slide-list" .scale=${this.visualScale}>${this.slides.toArray().map(e=>{let t=e.id===this.slideId,{thumbnail:i,title:o}=e;return s`<calcite-list-item .selected=${t} class=${d(p({"slide-list-item-selected":t}))} @calciteListItemSelect=${()=>this.#e(e)}><div slot=content class="slide-list-item-content"><img class="card-image" src=${i.url??a} alt=${o?.text??a}><div class="card-slide-title"><span class="card-slide-title-text">${o?.text}</span></div></div></calcite-list-item>`})}</calcite-list></div>`}};m("arcgis-presentation-slide-list",c);return c},"core/accessorSupport/decorators")
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import b from"./3NWZC6DC.js";import a from"./FHWOIM57.js";import"./VJVKFKSG.js";import{a as P}from"./2BVXNQ3U.js";import"./3AQ6NC3C.js";import"./A4X5YDA6.js";import"./QUZTFUWM.js";import"./4W3T75SY.js";import{L as R,M as E,N as x,T as V,a as f,b as g,o as w}from"./WXLC6FPD.js";import"./H6RQVSYM.js";export default $arcgis.t(([{property:d,subclass:L},F,S,H,{watch:p},{rotateDimensions:I,registerPanConstraint:O},T,{b:l},b])=>{var G=f`:host{height:100%;--arcgis-view-color-focus: none}`,z={xmin:-150,ymin:1,xmax:20,ymax:80,spatialReference:{wkid:4326}},_=1e-6;function N(i,e){if(!e)return null;let t=i.width/2,a=i.height/2,r=e.xmin+t,s=e.xmax-t,o=e.ymin+a,c=e.ymax-a;return r>=s||o>=c?null:new S({xmin:r,xmax:s,ymin:o,ymax:c,spatialReference:i.spatialReference})}var $=Object.defineProperty,k=Object.getOwnPropertyDescriptor,h=(i,e,t,a)=>{for(var r=a>1?void 0:a?k(e,t):e,s=i.length-1,o;s>=0;s--)(o=i[s])&&(r=(a?o(e,t,r):o(r))||r);return a&&r&&$(e,t,r),r},n=class extends F{constructor(i){super(i),this.autoplay=!1,this.loop=!1,this.type="image",this.autoLoad=!1}static isNonPanoramicMedia(i){return!!i&&typeof i=="object"&&"declaredClass"in i&&typeof i.declaredClass=="string"&&i.declaredClass==="components.oriented-imagery-viewer.support.NonPanoramicMedia"}destroy(){this._cache?.destroy(),this._cache=void 0,this._videoElement=void 0}get layer(){return this._cache}get videoElement(){return this._videoElement}get size(){if(!this._cache||this._cache.destroyed||this._cache.loadError)return;let{type:i}=this._cache;if(i==="imagery-tile"){let{serviceRasterInfo:e}=this._cache;return e?[e.width,e.height]:void 0}if(i==="media"){let e=this._videoElement??this._getVideoElementFromLayer(this._cache);return!e||e.videoWidth<=0||e.videoHeight<=0?void 0:[e.videoWidth,e.videoHeight]}}async load(i){return this.type==="video"?await this._loadVideo(i):await this._loadImage(i)}async _loadVideo(i){if(this._cache&&!this._cache.destroyed&&this._cache.type==="media")return await this._cache.load(i),this._videoElement=this._getVideoElementFromLayer(this._cache)??this._videoElement,this._applyVideoPlaybackOptions(),{layer:this._cache,size:this.size};let{title:e,url:t}=this;if(!t)throw new Error("URL is required to load NonPanoramicMedia.");let a=(await $arcgis.t(m=>m[0],"geometry/Extent")).default,r=(await $arcgis.t(m=>m[0],"layers/support/ExtentAndRotationGeoreference")).default,s=(await $arcgis.t(m=>m[0],"layers/support/VideoElement")).default,o=(await $arcgis.t(m=>m[0],"layers/MediaLayer")).default;l(i);let c=new s({video:t,georeference:new r({extent:new a(z)})});await c.load(i),l(i),this._videoElement=c.content??void 0,this._applyVideoPlaybackOptions();let m=new o({source:c,title:e});return await m.load(i),l(i),this._cache=m,{layer:this._cache,size:this.size}}_getVideoElementFromLayer(i){let e=i.source;if(!e||!("content"in e))return;let{content:t}=e;if(t instanceof HTMLVideoElement)return t}_applyVideoPlaybackOptions(){let i=this._videoElement;i&&(i.autoplay=this.autoplay,i.loop=this.loop,this.autoplay||i.pause())}async _loadImage(i){if(this._cache&&!this._cache.destroyed&&this._cache.type==="imagery-tile")return await this._cache.load(i),this._videoElement=void 0,{layer:this._cache,size:this.size};let{url:e,customParameters:t}=this,a=this.datasetFormat;if(!e)throw new Error("URL is required to load NonPanoramicMedia.");if(!a){let o=await import("./DBA7NSTP.js").then(m=>m.default);if(l(i),a=o.guessExtensionFromURI(e),!a){try{a=await o.getDatasetFormat(e)}catch{w("warn",this,"Failed to determine dataset format from URL or response headers."),a="UNKNOWN FORMAT"}l(i)}}this.datasetFormat=a;let r=(await $arcgis.t(m=>m[0],"layers/ImageryTileLayer")).default;l(i);let s=new r({url:e,ioConfig:{skipExtensions:["aux.xml","jgw"],skipMapInfo:!0,datasetFormat:a},customParameters:t??void 0});return await s.load(i),l(i),this._videoElement=void 0,this._cache=s,{layer:this._cache,size:this.size}}};h([d()],n.prototype,"_cache",2);h([d()],n.prototype,"_videoElement",2);h([d()],n.prototype,"autoplay",2);h([d()],n.prototype,"loop",2);h([d()],n.prototype,"title",2);h([d()],n.prototype,"type",2);h([d()],n.prototype,"layer",1);h([d()],n.prototype,"videoElement",1);h([d()],n.prototype,"size",1);h([d()],n.prototype,"autoLoad",2);h([d()],n.prototype,"customParameters",2);h([d()],n.prototype,"datasetFormat",2);h([d()],n.prototype,"url",2);n=h([L("components.oriented-imagery-viewer.support.NonPanoramicMedia")],n);function W(i,e,t,a,r){let{width:s,height:o}=I(i,e,r);return Math.max(s/t,o/a)}var A=96,U=39.37,M=U*A;function C(i){let e=M*.25,t=M*i,a=[],r=t;for(;r>e;)a.push(r),r*=.5;a.push(e);let{lods:s}=T.create({scales:a});return{minScale:t,lods:s}}var y=class extends x{constructor(){super(...arguments),this._messages=P(),this.#t=new b(this),this._imageChanged=!1,this._internalMap=R(),this._loading=!1,this.hideHeader=!1,this.hideLoader=!1,this.hideZoomControls=!1,this.hideVideoControls=!1,this.rotation=0}static{this.properties={_imageChanged:16,_internalMap:16,_layer:16,_videoTargetExtent:16,_videoRef:16,_loading:16,_media:16,hideHeader:5,hideLoader:5,hideZoomControls:5,hideVideoControls:5,messageOverrides:0,media:0,rotation:9}}static{this.styles=[G]}#t;#i;#a;#e;#s;#r;get imageRenderer(){return this._internalMap?.value?.view}get map(){return this.imageRenderer?.map}get media(){return this._media}set media(e){if(!e){this.#i?.abort(),this._media=void 0,this._clearMedia();return}this._media=e instanceof n?e:new n(e)}addGraphic(e){this.#t.addGraphic(e)}addGraphics(e){this.#t.addGraphics(e)}clearGraphics(){this.#t.clearGraphics()}async mediaOnLoad(){return this.#a&&await this.#a,this._media}removeGraphic(e){this.#t.removeGraphic(e)}removeGraphics(e){this.#t.removeGraphics(e)}loaded(){this.manager.onLifecycle(()=>[this._createResizeConstraint(),this._createRotationHandler(),this._createPanConstraint(),this._createVideoInteractionWatcher(),{remove:()=>{this._removeVideoPanHandles()}},p(()=>this._media,e=>{this.#i?.abort(),e&&(this.#i=new AbortController,this.#a=this._loadMediaInternal(e,this.#i),this.#a.catch(()=>{}))},{initial:!0,sync:!0})])}_createPanConstraint(){return p(()=>({layer:this._layer,imageRenderer:this.imageRenderer}),({layer:e,imageRenderer:t})=>{this._media?.type!=="video"&&(e?.type!=="imagery-tile"||!t?.ready||O(t,e))},{sync:!0,initial:!0})}_createResizeConstraint(){return p(()=>{if(!this.imageRenderer?.ready||!this._layer)return;if(this._layer.type==="imagery-tile"){let{width:t,height:a}=this._layer.serviceRasterInfo,{width:r,height:s,rotation:o}=this.imageRenderer;return W(t,a,r,s,o)}let e=this._videoTargetExtent;if(!(!e||this.imageRenderer.width<=0||this.imageRenderer.height<=0))return Math.max(e.width/this.imageRenderer.width,e.height/this.imageRenderer.height)},e=>{if(!e||!this.imageRenderer)return;if(this._media?.type==="video"){this._updateVideoScaleForResize(e);return}let{constraints:t,scale:a}=this.imageRenderer,r=t.minScale,{lods:s,minScale:o}=C(e);t.set({minScale:o,lods:s}),this.imageRenderer.scale=this._imageChanged||Math.abs(a-r)<=1e-6?o:a,this._imageChanged=!1},{sync:!0,initial:!0})}_createVideoInteractionWatcher(){return p(()=>[this.imageRenderer?.interacting,this.imageRenderer?.navigating,this.imageRenderer?.scale],()=>{this._media?.type==="video"&&this._updateVideoInteraction()},{initial:!0})}_createRotationHandler(){return p(()=>this.rotation,e=>{this._media?.type!=="video"&&this.imageRenderer&&(this.imageRenderer.constraints.rotationEnabled=!0,this.imageRenderer.rotation=e,this.imageRenderer.constraints.rotationEnabled=!1)},{sync:!0,initial:!0})}_clearMedia(){this._removeVideoPanHandles(),this._restoreConstraints(),this.#e=void 0,this._videoTargetExtent=void 0,this._videoRef?.pause(),this._videoRef=void 0,this._layer&&this.map?.layers.includes(this._layer)&&this.map.layers.remove(this._layer),this._layer?.destroy(),this._layer=void 0}async _loadMediaInternal(e,t){if(this._loading=!0,this._clearMedia(),!e)throw new Error("No media provided");let{layer:a}=await e.load(t).finally(()=>{this._loading=!1});l(t),this._imageChanged=!0,this._layer=a,this.imageRenderer?.map?.layers.add(this._layer),e.type==="video"&&await this._loadVideoMedia(e)}async _loadVideoMedia(e){let t=this.imageRenderer,a=new S(z),r=e.videoElement;this._videoRef=r instanceof HTMLVideoElement?r:void 0,t&&(await t.when(),this._snapshotConstraints(),t.constraints.set({rotationEnabled:!1}),await t.goTo(a.clone(),{animate:!1}),this._videoTargetExtent=t.extent?.clone(),this.#e=t.extent?.clone(),this._videoTargetExtent&&t.width>0&&t.height>0&&this._updateVideoScaleForResize(Math.max(this._videoTargetExtent.width/t.width,this._videoTargetExtent.height/t.height))),this._updateVideoInteraction()}_snapshotConstraints(){let e=this.imageRenderer?.constraints;!e||this.#r||(this.#r={geometry:e.geometry?.clone()??null,lods:e.lods,maxScale:e.maxScale,minScale:e.minScale,rotationEnabled:e.rotationEnabled})}_restoreConstraints(){let e=this.imageRenderer?.constraints,t=this.#r;!e||!t||(e.set({geometry:t.geometry,lods:t.lods,maxScale:t.maxScale,minScale:t.minScale,rotationEnabled:t.rotationEnabled}),this.#r=void 0)}_disablePan(){let e=this.imageRenderer;if(this._removeVideoPanHandles(),!e)return;let t=e.on("drag",r=>r.stopPropagation()),a=e.on("key-down",r=>{r.key.startsWith("Arrow")&&r.stopPropagation()});this.#s=[t,a]}_enablePan(){this._removeVideoPanHandles()}_removeVideoPanHandles(){this.#s?.forEach(e=>e.remove()),this.#s=void 0}_updateVideoInteraction(){let e=this.imageRenderer,t=e?.extent;if(!e||!t||this._layer?.type!=="media")return;this.#e??=t.clone();let{minScale:a}=e.constraints;if(!a)return;let r=e.scale<a-_,s=N(t,this._videoTargetExtent);if(r&&s){this._enablePan(),e.constraints.geometry=s;return}if(r){this._disablePan(),e.constraints.geometry=null;return}this.#e&&!t.equals(this.#e)&&(e.extent=this.#e.clone()),this._disablePan(),e.constraints.geometry=null}_updateVideoScaleForResize(e){if(!this.imageRenderer)return;let{constraints:t,scale:a}=this.imageRenderer,r=t.minScale,s=r!=null&&Math.abs(a-r)<=_,{lods:o,minScale:c}=C(e);t.set({lods:o,minScale:c,rotationEnabled:!1}),this.imageRenderer.scale=this._imageChanged||s?c:a,this._imageChanged=!1,s&&requestAnimationFrame(()=>{let{extent:m,scale:u,constraints:v}=this.imageRenderer??{};m&&u&&v?.minScale!=null&&Math.abs(u-v.minScale)<=_&&(this.#e=m.clone())})}render(){return g`<calcite-panel .loading=${this.hideLoader?void 0:this._loading} .heading=${this.hideHeader?void 0:this._messages.title}><arcgis-map hide-attribution .spatialReference=${H.WebMercator} ${E(this._internalMap)}><arcgis-zoom .hidden=${this.hideZoomControls} .messageOverrides=${this.messageOverrides} slot=top-left></arcgis-zoom></arcgis-map>${this.hideVideoControls||this._media?.type!=="video"||!this._videoRef?void 0:g`<arcgis-oriented-imagery-viewer-video-controls .videoRef=${this._videoRef}></arcgis-oriented-imagery-viewer-video-controls>`}</calcite-panel>`}};V("arcgis-oriented-imagery-viewer-non-panoramic-viewer",y);return y},"core/accessorSupport/decorators","core/Accessor","geometry/Extent","geometry/SpatialReference","core/reactiveUtils","applications/Components/OrientedImageryViewer/ImageViewer/utils","layers/support/TileInfo",a,b)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"componentLabel":"Presentation","slides":"slides","slideNavAriaText":"slide ${index} of ${numberOfSlides}","previous":"previous","next":"next","restart":"restart","legend":"Legend"}
|
|
1
|
+
{"componentLabel":"Presentation","slides":"slides","slideNavAriaText":"slide ${index} of ${numberOfSlides}","previous":"previous","next":"next","slideList":"Slide list","restart":"restart","legend":"Legend"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"componentLabel":"Utility network picker","errors":{"mapLoadFailed":"An error occurred while loading the map.","noUtilityNetwork":"No utility networks found in the map.","noView":"No map view found.","utilityNetworkLoadFailed":"An error occurred while loading the selected utility network."},"labels":{"utilityNetwork":"Utility network"}}
|