@esri/solutions-components 5.1.0-next.147 → 5.1.0-next.149

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.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import u from"./4DAGSZIC.js";import t from"./G3C6IL5Y.js";import s from"./WUEJANIZ.js";import r from"./Q2DJUFVO.js";import q from"./LTLR4VF3.js";import n from"./RYBSWXQQ.js";import m from"./RY6KZ77P.js";import l from"./5MPDXVRM.js";import k from"./IZSM7ZJK.js";import j from"./4SBOBTOR.js";import i from"./AH3PJQ6A.js";import"./HYQVSB6C.js";import h from"./UTZUXO5F.js";import"./PNESECPO.js";import"./5DEYOM7D.js";import g from"./7Q5BT35O.js";import"./ONARC6AZ.js";import{a as $}from"./7VD3Y4IF.js";import"./NQH7ZZWD.js";import"./2BIUOM64.js";import e from"./OANAQ6HY.js";import b from"./UBEU6ULP.js";import{a as D,b as S,c as A}from"./2B4SGB3I.js";import{a as p}from"./I2NTSKBD.js";import"./AE5HNAOV.js";import{a as C}from"./MGEDATQ7.js";import"./RMEDO4JC.js";import"./ISFTCFSJ.js";import"./TEHBW75B.js";import"./IHG7KTNC.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./YKB6256M.js";import"./N22MFQSQ.js";import"./N7BXCDA3.js";import"./ZX3UHK6P.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LP2JYX4X.js";import"./GF4QELNV.js";import"./AYSQIO6L.js";import"./YQHYMLC7.js";import"./DKD2EGQP.js";import"./5O53T3SW.js";import"./AJZDBHB6.js";import"./FES7B3SJ.js";import{b as w}from"./2I5LGZNX.js";import{E as o,F as a,G as f,I as _,K as T,h as v,i as c,q as d}from"./FFF5HUPM.js";import"./QPIMTXPL.js";export default $arcgis.t(([,,,{m:x},{c:I,j:O,n:F,o:L,r:h},,{b:k},{a:P},,,{g:M,h:B},,,,,m,E,{a:y}])=>{var R=v`.back-color-override{background-color:var(--calcite-color-surface-3);--calcite-tab-border-color: var(--calcite-color-surface-4)}:host{--panel-edge-adjustment: 2vw;--assistant-panel-min-width: 420px;--assistant-panel-width: max(var(--assistant-panel-min-width), calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment) - 15px))}.display-none{display:none!important}.height-100{height:100%}calcite-tab-nav{padding-bottom:6px;padding-top:6px}calcite-tab{--calcite-color-focus: transparent}calcite-tab>*{--calcite-color-focus: initial}calcite-tabs{--calcite-tab-border-color: var(--calcite-color-border-2);flex:1;min-height:0}.tab-space-0{--calcite-tab-content-space-y: var(--calcite-spacing-none)}.tab-space-md{--calcite-tab-content-space-y: var(--calcite-spacing-md)}solutions-searchsort-toolbar,solutions-deploy-app-nav,solution-details-panel,solutions-deployed-shell,solutions-all-shell,calcite-tab-nav,solution-deployed-card-panel{width:1440px;display:block;max-width:96vw;padding-right:var(--calcite-spacing-none);padding-left:var(--calcite-spacing-none);margin-left:auto;margin-right:auto;box-sizing:border-box}.border{height:var(--calcite-spacing-px);border-bottom-color:var(--calcite-color-border-2);border-bottom-style:solid;border-bottom-width:var(--calcite-border-width-sm);box-sizing:border-box}.overflow-auto{overflow:auto}solution-details-panel{scroll-margin-top:3rem}.main-content{container-type:inline-size;display:flex;flex-direction:column;height:100%;overflow:hidden}.main-content.assistant-open{margin-inline-end:var(--assistant-panel-width)}.assistant-open solutions-searchsort-toolbar,.assistant-open solution-details-panel,.assistant-open solutions-deployed-shell,.assistant-open solutions-all-shell,.assistant-open calcite-tab-nav,.assistant-open solution-deployed-card-panel{margin-inline-start:max(var(--panel-edge-adjustment),calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment)));margin-inline-end:0;width:auto;max-width:1440px}.builder-panel{position:fixed;top:65px;inset-inline-start:max(var(--panel-edge-adjustment),calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment)));inset-inline-end:var(--assistant-panel-width);bottom:0;z-index:400;display:flex;flex-direction:column;transition:transform .3s cubic-bezier(.4,0,.2,1);pointer-events:auto}.builder-panel.display-none{display:flex!important;transform:translate(100%);pointer-events:none}.builder-panel:dir(rtl).display-none{transform:translate(-100%)}@supports (-webkit-touch-callout: none){.builder-panel.display-none{display:none!important;transform:none}.builder-panel:dir(rtl).display-none{transform:none}}.builder-panel.display-none:has(~.assistant-panel.display-none){display:none!important;transition:none}.assistant-panel{position:fixed;top:65px;inset-inline-end:0;bottom:0;width:var(--assistant-panel-width);min-width:var(--assistant-panel-min-width);z-index:400;display:flex;flex-direction:column}@media(max-width:800px){.builder-panel{display:none!important}.assistant-panel{width:100%;box-shadow:none}.main-content.assistant-open{margin-inline-end:0}}.assistant-fab{position:fixed;bottom:var(--calcite-spacing-xxl);inset-inline-end:var(--calcite-spacing-xxl);z-index:500}calcite-tooltip{--calcite-tooltip-max-size-x: 16rem}.assistant-fab-popover{--calcite-popover-max-size-x: 16rem}.assistant-fab-popover__content{display:block;padding-block:var(--calcite-spacing-sm);padding-inline:var(--calcite-spacing-md);font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-relative-snug);font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word}`,N={solution:{title:"Bus Stop ADA Compliance Inspections",description:"Bus Stop ADA Compliance Inspections can be used to perform routine inspections of bus stops for ADA compliance and monitor inspection progress.",thumbnailUrl:P,tags:["Bus Stop","ADA Compliance","Inspection","Field","Monitor","ArcGIS Solutions"],strings:[{key:"inspectionsByMonth",value:"Inspections by Month",description:"Descriptive title of dashboard chart displaying the number of inspections completed by month."},{key:"inspectionsCompleted",value:"Inspections Completed",description:"Descriptive title of dashboard indicator displaying the total number of inspections completed."},{key:"assetInventory",value:"Bus Stop Inventory",description:"Descriptive title of dashboard indicator displaying the total number of bus stops."}]},items:[{id:"b21885d38b3c4924922ce36c90112737",title:"Bus Stop ADA Inspection Dashboard",description:"An ArcGIS Dashboards app used to monitor bus stop ADA compliance inspections.",type:"Dashboard"},{id:"54f69b6af00b4f06b1c1eef05e80dc93",title:"Bus Stop ADA Inspection Map",description:"A map used by the Bus Stop ADA Inspection Dashboard app to monitor inspections.",type:"Web Map"},{id:"2fc93fa4e07e42508669d02acb837a75",title:"Bus Stop ADA Inspection Field Map",description:"A map used in ArcGIS Field Maps to inspect bus stops in the field for ADA compliance.",type:"Web Map"},{id:"0bd4ecf9c95e4dcd8ff1744adc12f323",title:"BusStops_field",description:"A hosted feature layer view used to inspect bus stops for ADA compliance.",type:"Feature Layer (hosted, view)"},{id:"0bd4ecf9c95e4dcd8ff1744adc12f324",title:"BusStops_dashboard",description:"A hosted feature layer view used to monitor bus stop ADA inspections.",type:"Feature Layer (hosted, view)"},{id:"36d0bdce3a74436f8314c88c9667003e",title:"BusStops",description:"A hosted feature layer used to store bus stop and ADA inspection details.",type:"Feature Layer (hosted)"}],featureLayer:{itemId:"36d0bdce3a74436f8314c88c9667003e",addLayers:!0,layers:[{id:"0",type:"Point",typeMutable:!0,name:"BusStops",description:"Point layer containing bus stop locations and ADA compliance information.",customFields:[{name:"stop_id",type:"string",alias:"Stop ID",description:"Identifier for the bus stop.",choiceList:null,length:255},{name:"location_description",type:"string",alias:"Location Description",description:"Description of the bus stop location.",choiceList:null,length:255},{name:"shelter_present",type:"string",alias:"Shelter Present",description:"Indicates if a waiting shelter is present at the bus stop.",choiceList:["Yes","No"],length:5},{name:"bench_present",type:"string",alias:"Bench Present",description:"Indicates if a bench is present at the bus stop.",choiceList:["Yes","No"],length:5},{name:"ada_compliant",type:"string",alias:"ADA Compliant",description:"Indicates if the bus stop meets ADA compliance requirements.",choiceList:["Yes","No"],length:5},{name:"capacity",type:"integer",alias:"Seating Capacity",description:"Number of people that can be seated at the bus stop."},{name:"distance_from_curb",type:"double",alias:"Distance from Curb (ft)",description:"Distance in feet from the curb to the shelter."},{name:"last_inspection_date",type:"date",alias:"Last Inspection Date",description:"Date of the most recent inspection."},{name:"installation_date",type:"date",alias:"Installation Date",description:"Date when the bus stop was installed."}],requiredFields:[{name:"route_number",type:"string",alias:"Route Number",description:"Number of the bus route that uses this stop.",choiceList:null,length:50},{name:"average_daily_riders",type:"integer",alias:"Average Daily Riders",description:"Average number of riders using this stop per day."},{name:"inspection_priority",type:"string",alias:"Inspection Priority",description:"Priority level for scheduling inspections.",choiceList:["High","Medium","Low"],length:10}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"1",type:"Polyline",typeMutable:!1,name:"Routes",description:"Polyline layer containing bus route paths.",customFields:[{name:"route_name",type:"string",alias:"Route Name",description:"Name of the bus route.",choiceList:null,length:100},{name:"route_type",type:"string",alias:"Route Type",description:"Type of bus route service.",choiceList:["Express","Local","Rapid"],length:20},{name:"frequency_minutes",type:"integer",alias:"Frequency (minutes)",description:"How often buses run on this route in minutes."},{name:"route_length_miles",type:"double",alias:"Route Length (miles)",description:"Total length of the route in miles."}],requiredFields:[{name:"route_id",type:"string",alias:"Route ID",description:"Unique identifier for the route.",choiceList:null,length:50},{name:"active",type:"string",alias:"Active Status",description:"Whether the route is currently active.",choiceList:["Yes","No"],length:3}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"2",type:"Polygon",typeMutable:!1,name:"ServiceAreas",description:"Polygon layer defining bus service coverage areas.",customFields:[{name:"area_name",type:"string",alias:"Area Name",description:"Name of the service area.",choiceList:null,length:100},{name:"service_level",type:"string",alias:"Service Level",description:"Level of service provided in this area.",choiceList:["High Frequency","Standard","Limited"],length:20},{name:"population",type:"integer",alias:"Population",description:"Estimated population within the service area."},{name:"area_sq_miles",type:"double",alias:"Area (sq miles)",description:"Size of the service area in square miles."}],requiredFields:[{name:"district_id",type:"string",alias:"District ID",description:"Unique identifier for the service district.",choiceList:null,length:50}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"3",type:"Point",typeMutable:!1,name:"Tasks",description:"Point layer containing task assignments for bus stop inspections, related to BusStops layer.",customFields:[{name:"task_id",type:"string",alias:"Task ID",description:"Unique identifier for the task assignment.",choiceList:null,length:50},{name:"stop_id",type:"string",alias:"Bus Stop ID",description:"ID of the bus stop to be inspected (relates to BusStops layer).",choiceList:null,length:255},{name:"assigned_to",type:"string",alias:"Assigned To",description:"Name of the inspector assigned to this task.",choiceList:null,length:100},{name:"due_date",type:"date",alias:"Due Date",description:"Date by which the inspection should be completed."},{name:"priority",type:"string",alias:"Priority",description:"Priority level of the inspection task.",choiceList:["High","Medium","Low"],length:10},{name:"notes",type:"string",alias:"Task Notes",description:"Additional notes or instructions for the inspection task.",choiceList:null,length:500}],requiredFields:[{name:"status",type:"string",alias:"Task Status",description:"Current status of the task assignment.",choiceList:["Not Started","In Progress","Completed","Cancelled"],length:20},{name:"assignment_date",type:"date",alias:"Assignment Date",description:"Date when the task was created and assigned."}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"4",typeMutable:!1,type:"Table",name:"Inspections",description:"Table containing inspection records and findings.",customFields:[{name:"inspection_id",type:"string",alias:"Inspection ID",description:"Unique identifier for the inspection.",choiceList:null,length:50},{name:"stop_id",type:"string",alias:"Bus Stop ID",description:"ID of the bus stop that was inspected.",choiceList:null,length:255},{name:"inspector_name",type:"string",alias:"Inspector Name",description:"Name of the person who performed the inspection.",choiceList:null,length:100},{name:"inspection_date",type:"date",alias:"Inspection Date",description:"Date when the inspection was performed."},{name:"overall_condition",type:"string",alias:"Overall Condition",description:"Overall condition assessment of the bus stop.",choiceList:["Excellent","Good","Fair","Poor","Critical"],length:20},{name:"issues_found",type:"integer",alias:"Issues Found",description:"Number of issues identified during inspection."},{name:"notes",type:"string",alias:"Inspection Notes",description:"Additional notes or comments about the inspection.",choiceList:null,length:1e3}],requiredFields:[{name:"inspection_status",type:"string",alias:"Inspection Status",description:"Current status of the inspection.",choiceList:["Scheduled","In Progress","Completed","Cancelled"],length:20}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]}]}},g=class extends f{constructor(){super(),this.initTitleOrId="",this.sortType="relevance",this.useLocalAppConfig=!1,this.loadExampleBuilderData=!1,this.authentication=void 0,this._isLoaded=!1,this.isMobile=!1,this._isViewportMobile=window.innerWidth<=800,this._isAssistantOpen=!1,this._builderVisible=!1,this._hasActiveBuilderDesign=!1,this._showFabTooltip=!0,this._fabTooltipDismissed=!1,this._activeTab="all-solutions",this._showDeployedCardFetchFailed=!1,this._globalAlerts=[],this._translations=C({name:"solutions-deploy-app",blocking:!0}),this._agoTerms=`${L}`,this._allCards=[],this._allShell=o(),this._allTab=o(),this._allTabTitle=o(),this._resourcesTab=o(),this._resourcesTabTitle=o(),this._categories=[],this._configContextProvider=p({context:S}),this._delay=!1,this._deployAppNav=o(),this._deployedCardPanel=o(),this._deployCardFetchFailedMessage="",this._deployedCardTab=o(),this._deployedCardTabTitle=o(),this._detailsShell=o(),this._detailsTab=o(),this._detailsTabTitle=o(),this._forceInit=!1,this._getSuggested=!1,this._tabpanelsFixed=!1,this._solutionBuilderPanel=o(),this._builderDesignContextProvider=p({context:A}),this._isMobileContextProvider=p({context:D}),this._handleWindowResize=()=>{let t=window.innerWidth<=800;this._isViewportMobile!==t&&(this._isViewportMobile=t,t&&(this._isAssistantOpen=!1,this._builderVisible=!1))},this._mainContentRef=o(),this._mySolutionsShell=o(),this._mySolutionsTab=o(),this._mySolutionsTabTitle=o(),this._sortField="relevance",this._sortOrder="desc",this._telemetryManager=new y,this.deployAppTabSelected=d(),this.deployedCardFetchFailed=d(),this.detailsCardSelected=d(),this.deployedCardSelected=d(),this.metaTagStringsReady=d(),this.sessionRefreshed=d(),this.tabChanged=d(),this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"displayDeployedCard",this._handleDeployedCardDisplay),this.listenOn(window,"navTabSelected",this._setActiveTab),this.listenOn(window,"forceSelectTab",t=>this.selectTab(t.detail,{})),this.listenOn(window,"showGlobalAlert",this._handleShowGlobalAlert),this.listenOn(window,"openAssistant",()=>{this._openAssistant()}),this.listenOn(window,"closeAssistant",()=>{this._isAssistantOpen=!1,this._builderVisible=!1}),this.listenOn(window,"toggleSolutionBuilder",()=>{this._builderVisible=!this._builderVisible}),this.listenOn(window,"hideSolutionBuilder",()=>{this._builderVisible=!1}),this.listenOn(window,"discardBuilder",t=>{this._hasActiveBuilderDesign=t.detail}),this.listenOn(window,"arcgis-solution-design-update",this._solutionBuilderSelected),window.addEventListener("resize",this._handleWindowResize),this._builderDesignContextProvider.value={design:this.loadExampleBuilderData?N:null,updateDesign:t=>{this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,design:t}},isBuilderVisible:!1,setBuilderVisible:t=>{this._builderVisible=t,this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,isBuilderVisible:t}}},this.loadExampleBuilderData&&(this._hasActiveBuilderDesign=!0)}static{this.properties={appConfig:1,initTab:1,initTitleOrId:1,sortType:1,useLocalAppConfig:5,loadExampleBuilderData:5,authentication:16,_isLoaded:16,isMobile:16,_isViewportMobile:16,_isAssistantOpen:16,_builderVisible:16,_hasActiveBuilderDesign:16,_showFabTooltip:16,_fabTooltipDismissed:16,_activeTab:16,_showDeployedCardFetchFailed:16,_globalAlerts:16,_translations:16}}static{this.styles=R}get _telemetry(){return this._configContextProvider.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextProvider.value?.isEnterprise===!0&&this._configContextProvider.value?.authentication?.CanSearchArcGISOnline===!1}get _readOnlyNotice(){return this._configContextProvider.value?.isEnterprise?this._translations.writableEnterprise||"":(this._translations.writableOnline||"").replace("{{url}}","https://status.arcgis.com/")}_openAssistant(){this._telemetry?.logEvent({category:h.ASSISTANT,action:"Open"}),this._isAssistantOpen=!0}async selectTab(t,e){if(this._isLoaded||this._forceInit){let i=this._getDefaultSearchOptions(e);switch(this._searchSortToolbar&&(this._searchSortToolbar.scope=t.tabType),t.tabType){case"all-solutions":this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0,i&&await this._allShell.value?.searchSolutions(i);break;case"resources":this._resourcesTab.value.selected=!0,this._resourcesTabTitle.value.selected=!0;break;case"deployed-card":if(this.authentication?.IsSignedIn){if(this._forceInit=!0,this._isLoaded=!1,this._cardFetcherDeployed&&await this._getDeployedSolution(t.tabTitleOrId),this._deployedSolutions?.cards?.length>0){let s;this._deployedSolutions.cards.some(l=>l.id===t.tabTitleOrId?(s=l,this.deployedCardSelected.emit({card:s}),!0):!1),this._isLoaded=!0,this._forceInit=!1}else return this._isLoaded=!0,this._forceInit=!1,this.selectTab({tabTitleOrId:"",tabType:"deployments"},e);break}else await this.authentication?.signIn();case"details":if(this._allCards){let s=M(this._allCards,t.tabTitleOrId);s=s||B(this._allCards,t.tabTitleOrId),s?(this._detailsTab.value.selected=!0,this._detailsTabTitle.value.selected=!0,this.detailsCardSelected.emit(s)):(t.tabType="all-solutions",this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0)}break;case"deployments":this._mySolutionsTab.value.selected=!0,this._mySolutionsTabTitle.value.selected=!0,this._searchSortToolbar&&i?.filter&&this._searchSortToolbar.changeOwnerFilter(i.filter!=="Organization"),i&&await this._mySolutionsShell.value?.searchSolutions(i);break}return this._builderVisible=!1,this._setActiveTab(new CustomEvent("setActiveTab",{detail:t})),this._blurTabs(),this._showDeployedCardFetchFailed&&(this.deployedCardFetchFailed.emit({message:this._deployCardFetchFailedMessage,title:this._translations.failedToOpen}),this._showDeployedCardFetchFailed=!1),!0}else return this._initTab=t,this._initFilters=e,!1}updated(t){this._fixTabpanelFocus(),t.has("_isAssistantOpen")&&this._setScrollbarGutters(this._isAssistantOpen?"stable":"stable both-edges"),!this._resizeObserver&&this._mainContentRef.value&&(this._resizeObserver=new ResizeObserver(e=>{for(let i of e){let s=i.contentRect.width<=800;this.isMobile!==s&&(this.isMobile=s,this._isMobileContextProvider.setValue(s))}}),this._resizeObserver.observe(this._mainContentRef.value))}_fixTabpanelFocus(){if(!this._tabpanelsFixed&&this._allTab.value){let t=[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab];Promise.all(t.map(async e=>{let i=e.value;if(i&&(await i.componentOnReady?.(),i.shadowRoot)){let s=i.shadowRoot.querySelector('[role="tabpanel"]');s&&(s.tabIndex=-1)}})).then(()=>{this._tabpanelsFixed=!0,this._setupTabpanelObserver()}).catch(()=>{this._tabpanelsFixed=!0})}}_setupTabpanelObserver(){this._tabpanelObserver||(this._tabpanelObserver=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"&&e.attributeName==="tabindex"){let i=e.target;i.getAttribute("role")==="tabpanel"&&i.tabIndex===0&&(i.tabIndex=-1)}})}),[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(t=>{let e=t.value;if(e?.shadowRoot){let i=e.shadowRoot.querySelector('[role="tabpanel"]');i&&this._tabpanelObserver.observe(i,{attributes:!0,attributeFilter:["tabindex"]})}}))}async load(){this.useLocalAppConfig&&(this.appConfig=k)}render(){let t=this._isLoaded?"display-none":"",e=this._isLoaded?"":"display-none";return c`<calcite-shell><solutions-deploy-app-nav .appConfig=${this.appConfig} .assistantOpen=${this._isAssistantOpen} .initTab=${this.initTab} @authInit=${this._handleAuthInit} slot=header ${a(this._deployAppNav)}></solutions-deploy-app-nav><div class=${`main-content${this._isAssistantOpen?" assistant-open":""}`} ${a(this._mainContentRef)}>${this._isSearchToolbarShowing()&&c`<div class="border"></div>`||""}<solutions-searchsort-toolbar ${a(async i=>{i&&(await this._deployAppNav.value?.componentOnReady(),this._searchSortToolbar=i)})}></solutions-searchsort-toolbar><calcite-loader class=${_(t)} id=solutions-loader .label=${this._translations.fetchingAllSolutions}></calcite-loader>${this._renderGlobalAlerts()}<calcite-tabs class=${_(e)} scale=l><calcite-tab-nav class="display-none" @calciteTabChange=${this._handleCalciteTabChanged} slot=title-group><calcite-tab-title ${a(this._allTabTitle)}>${this._translations.allSolutions}</calcite-tab-title><calcite-tab-title ${a(this._mySolutionsTabTitle)}>${this._translations.mySolutions}</calcite-tab-title><calcite-tab-title ${a(this._resourcesTabTitle)}>${this._translations.solutionResources}</calcite-tab-title><calcite-tab-title class="display-none" ${a(this._detailsTabTitle)}></calcite-tab-title><calcite-tab-title class="display-none" ${a(this._deployedCardTabTitle)}></calcite-tab-title></calcite-tab-nav><calcite-tab class="back-color-override tab-space-0" selected ${a(this._allTab)}><solutions-all-shell class="height-100" ${a(this._allShell)}></solutions-all-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._mySolutionsTab)}><solutions-deployed-shell class="height-100" ${a(this._mySolutionsShell)}></solutions-deployed-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._resourcesTab)}><solutions-resources-shell .assistantOpen=${this._isAssistantOpen} class="height-100"></solutions-resources-shell></calcite-tab><calcite-tab class="back-color-override" ${a(this._detailsTab)}><solution-details-panel class="height-100" .readOnlyNotice=${this._readOnlyNotice} ${a(this._detailsShell)}></solution-details-panel></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._deployedCardTab)}><solution-deployed-card-panel class="shell-container height-100" .readOnlyNotice=${this._readOnlyNotice} ${a(this._deployedCardPanel)}></solution-deployed-card-panel></calcite-tab></calcite-tabs></div>${!this._configContextProvider.value?.isEnterprise&&c`<div class=${`builder-panel${this._builderVisible&&!this._isViewportMobile?"":" display-none"}`}><solution-builder-assistant class="height-100" .readOnlyNotice=${this._readOnlyNotice} ${a(this._solutionBuilderPanel)}></solution-builder-assistant></div><div class=${`assistant-panel${this._isAssistantOpen&&!this._isViewportMobile?"":" display-none"}`}><arcgis-solutions-assistant class="height-100" .builderVisible=${this._builderVisible} .hasActiveBuilderDesign=${this._hasActiveBuilderDesign}></arcgis-solutions-assistant></div><calcite-fab aria-label=${this._translations.assistantFabTooltip??T} class=${`assistant-fab${this._isAssistantOpen||this._isViewportMobile?" display-none":""}`} icon=effects id=assistant-fab-button @click=${()=>{this._openAssistant(),this._fabTooltipDismissed=!0,this._showFabTooltip=!1}} scale=l></calcite-fab>${!this._fabTooltipDismissed&&c`<calcite-popover closable class=${`assistant-fab-popover${this._isAssistantOpen||this._isViewportMobile?" display-none":""}`} .label=${this._translations.assistantFabTooltip} overlay-positioning=fixed @calcitePopoverClose=${()=>{this._fabTooltipDismissed=!0,this._showFabTooltip=!1}} .open=${this._showFabTooltip&&!this._isAssistantOpen&&!this._isViewportMobile} placement=leading reference-element=assistant-fab-button><span class="assistant-fab-popover__content">${this._translations.assistantFabTooltip}</span></calcite-popover>`||""}`||""}</calcite-shell>`}loaded(){this._setScrollbarGutters()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._handleWindowResize),this._resizeObserver?.disconnect(),this._tabpanelObserver?.disconnect()}_renderGlobalAlerts(){return $(this._globalAlerts,t=>t.id,t=>c`<calcite-alert .autoClose=${t.autoClose} .autoCloseDuration=${t.autoCloseDuration} .icon=${t.icon} .kind=${t.kind} .label=${t.title||""} @calciteAlertClose=${()=>this._removeGlobalAlert(t.id)} open>${t.title&&c`<div slot=title>${t.title}</div>`||""}<div slot=message>${t.message}</div></calcite-alert>`)}async _handleAuthInit(t){let e=t.detail;e.telemetrySession||(e.telemetrySession=y.getDisabledSession()),this._configContextProvider.setValue(e),e.authentication&&(this.authentication=e.authentication),this._cardFetcherDeployed=new m(e.locale,e.orgUrl,e.portalURL),this._cardsFetcher=new m(e.locale,e.orgUrl,e.portalURL),this._isDisconnectedEnvironment||await this._getSolutions(e.primarySolutionsGroupId,e.agoBasedEnterpriseSolutionsGroupId),this._configContextProvider.value.allCards=this._allCards,this._configContextProvider.value.anonAgolSession=this._cardsFetcher.anonAgolSession,this._configContextProvider.value.agolPortalUrl=this._cardsFetcher.agolPortalUrl,await this._initializeTelemetry(),this._isLoaded=!0,this._setRefreshInterval(),this._initTab?(this.selectTab(this._initTab,this._initFilters),this._logTabViewTelemetry(this._initTab.tabType),this._initTab=void 0,this._initFilters=void 0):this.authentication?.IsSignedIn&&(this.initTab==="details"||this.initTab==="deployed-card"||(this._logTabViewTelemetry(this._activeTab),this._emitMetaTagStrings(this._activeTab)))}_setActiveTab(t){let e=t.detail.tabType,i=this._activeTab!==e;switch(this._activeTab=e,i&&this._logTabViewTelemetry(e),e){case"all-solutions":this._allTabTitle.value?.click();break;case"deployments":this._mySolutionsTabTitle.value?.click();break;case"resources":this._resourcesTabTitle.value?.click();break;case"deployed-card":this._deployedCardTabTitle.value?.click();break;case"details":this._detailsTabTitle.value?.click();break}this._builderVisible=!1,e!=="details"&&e!=="deployed-card"&&(this._deployAppNav.value.activateMenuItem(e),this.deployAppTabSelected.emit(e),this._emitMetaTagStrings(e))}_logTabViewTelemetry(t,e){let i;switch(t){case"all-solutions":i=h.ALL_SOLUTIONS;break;case"deployments":i=h.DEPLOYMENTS;break;case"resources":i=h.RESOURCES;break;case"details":i=h.SOLUTION_DETAILS;break;case"deployed-card":i=h.DEPLOYMENTS;break}if(!((t==="details"||t==="deployed-card")&&!e)&&i){let s=[];if((t==="details"||t==="deployed-card")&&e){let n=e;s.push(n.title||""),s.push(n.deployCommonId||""),s.push(n.deployVersion||""),s.push(""),s.push(x(n.typeKeywords))}let l=t==="deployed-card"?"Open":"View";this._telemetry?.logEvent({category:i,action:l,dimensions:s.length>0?s:void 0})}}_emitMetaTagStrings(t,e){let i="",s="";switch(t){case"all-solutions":i=this._translations.metaAllSolutionsTitle,s=this._translations.metaAllSolutionsDescription;break;case"deployments":case"deployed-card":i=this._translations.metaDeploymentsTitle,s=this._translations.metaDeploymentsDescription;break;case"resources":i=this._translations.metaResourcesTitle,s=this._translations.metaResourcesDescription;break;case"details":e&&(i=this._translations.metaDetailsTitle.replace("{title}",e.title),s=e.snippet);break}this.metaTagStringsReady.emit({pageType:t,title:i,description:s,detailTemplate:e})}_handleCalciteTabChanged(){this.tabChanged.emit(this._activeTab)}_detailsCardSelected(t){this._activeTab="details",this._detailsTabTitle.value.selected=!0,this._detailsTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail&&(this._selectedDetailsCard=t.detail),this._logTabViewTelemetry("details",this._selectedDetailsCard),this._emitMetaTagStrings("details",this._selectedDetailsCard)}_deployedCardSelected(t){this._activeTab="deployed-card",this._deployedCardTabTitle.value.selected=!0,this._deployedCardTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail?.card&&(this._selectedDeployedCard=t.detail.card),this._logTabViewTelemetry("deployed-card",this._selectedDeployedCard),this._emitMetaTagStrings("deployed-card")}_solutionBuilderSelected(t){t?.detail&&(this._builderVisible=!0,this._hasActiveBuilderDesign=!0,this._builderDesignContextProvider.value={design:t.detail,updateDesign:e=>{this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,design:e}},isBuilderVisible:!0,setBuilderVisible:e=>{this._builderVisible=e,this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,isBuilderVisible:e}}})}_handleDeployedCardDisplay(t){let{card:e,cardRef:i}=t.detail;this.deployedCardSelected.emit({card:e,cardRef:i})}_handleShowGlobalAlert(t){let e=t.detail,i=e.id||`alert-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;this._globalAlerts=[...this._globalAlerts,{...e,id:i}]}_removeGlobalAlert(t){this._globalAlerts=this._globalAlerts.filter(e=>e.id!==t)}async _initializeTelemetry(){let t=this._configContextProvider.value;if(!this.authentication||!t)return;let e=await this._telemetryManager.initializeTelemetry(this.authentication,t);this._configContextProvider.value.telemetrySession=e}async _getSolutions(t,e){if(this._isDisconnectedEnvironment)return[];this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let i=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},t,e,this._configContextProvider.value.userSession,this._configContextProvider.value.isEnterprise,this._abortController.signal,{num:1e3});return this._abortController=void 0,this._allCards.length===0&&i?.cards&&(this._allCards=i?.cards),this._allCards}async _getDeployedSolution(t){let e=this._configContextProvider.value.authentication,i=this._configContextProvider.value.userSession;if(e&&i&&e.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let s=I(e);try{let l=await E(e,i,this._cardsFetcher,this._cardFetcherDeployed,F,"created","desc",!1,[],[],this._abortControllerDeployed.signal,s?"My organization's solutions":"My solutions",t);l.cards.length===0||l.cards[0].typeKeywords.indexOf("Deployed")<0?(this._deployCardFetchFailedMessage=this._translations.failedToFetchNotSolution.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):this._deployedSolutions=l}catch(l){let n=l.message;n.indexOf("CONT_0001")>-1||n.indexOf("Item does not exist or is inaccessible.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongId.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):n.indexOf("GWM_0003")>-1||n.indexOf("You do not have permissions to access this resource or perform this operation.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongPermissions.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):(this._showDeployedCardFetchFailed=!0,this._deployCardFetchFailedMessage=""),console.warn(l)}}}_blurTabs(){this._allTabTitle.value?.blur(),this._resourcesTabTitle.value?.blur(),this._detailsTabTitle.value?.blur(),this._mySolutionsTabTitle.value?.blur()}_isSearchToolbarShowing(){return this._activeTab==="all-solutions"||this._activeTab==="deployments"&&this.authentication?.IsSignedIn===!0}_getDefaultSearchOptions(t){let e;if(t){let i=t.domain,s=t.industry==="AEC"?O.AEC:t.industry,l=t.offerType,n=t.searchTerm,V="",r=t.sortField,u=t.owner,b=t.filter;r==="suggested"&&!this.authentication?.IsSignedIn&&(r=this.sortType),e=i||s?{type:i?"domain":s?"industry":""}:void 0,i&&(e=e?{...e,domain:i}:{domain:i}),s&&(e=e?{...e,industry:s}:{industry:s}),n&&(e=e?{...e,searchTerm:n}:{searchTerm:n}),e&&(e={...e,displayValue:V}),r&&(e=e?{...e,sortType:r}:{sortType:r}),l&&(r=l.toLowerCase(),e=e?{...e,sortType:r}:{sortType:r}),u&&(e=e?{...e,owner:u}:{owner:u}),b&&(e=e?{...e,filter:b}:{filter:b})}return e}_setScrollbarGutters(t="stable both-edges"){[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(e=>{let i=e.value?.shadowRoot?.firstElementChild;i?.style&&(i.style.scrollbarGutter=t)})}_setRefreshInterval(){let{userSession:t,authentication:e}=this._configContextProvider.value;if(t&&t.tokenDuration&&e?.IsSignedIn){let i=Date.now(),s=(e.Credential?.expires-i)*.95;setInterval(async()=>{if(e.Credential&&e.Credential.expires){await e.Credential?.refreshToken();let l=new Date(e.Credential.expires);t.updateToken(e.Credential.token,l),this.sessionRefreshed.emit(t.token)}},s)}}};w("solutions-deploy-app",g);return g},"identity/IdentityManager","identity/OAuthInfo","portal/Portal",b,e,g,h,i,j,k,l,m,n,q,r,s,t,u)
2
+ import u from"./4DAGSZIC.js";import t from"./G3C6IL5Y.js";import s from"./WUEJANIZ.js";import r from"./Q2DJUFVO.js";import q from"./LTLR4VF3.js";import n from"./RYBSWXQQ.js";import m from"./RY6KZ77P.js";import l from"./5MPDXVRM.js";import k from"./UCQJWFUW.js";import j from"./4SBOBTOR.js";import i from"./DO7NLLUV.js";import"./HYQVSB6C.js";import h from"./5O7LFBHI.js";import"./PNESECPO.js";import"./HQLA2AI4.js";import g from"./7Q5BT35O.js";import"./ONARC6AZ.js";import{a as $}from"./7VD3Y4IF.js";import"./NQH7ZZWD.js";import"./2BIUOM64.js";import e from"./OANAQ6HY.js";import b from"./UBEU6ULP.js";import{a as D,b as S,c as A}from"./2B4SGB3I.js";import{a as p}from"./I2NTSKBD.js";import"./AE5HNAOV.js";import{a as C}from"./MGEDATQ7.js";import"./RMEDO4JC.js";import"./ISFTCFSJ.js";import"./TEHBW75B.js";import"./IHG7KTNC.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./YKB6256M.js";import"./N22MFQSQ.js";import"./N7BXCDA3.js";import"./ZX3UHK6P.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LP2JYX4X.js";import"./GF4QELNV.js";import"./AYSQIO6L.js";import"./YQHYMLC7.js";import"./DKD2EGQP.js";import"./5O53T3SW.js";import"./AJZDBHB6.js";import"./FES7B3SJ.js";import{b as w}from"./2I5LGZNX.js";import{E as o,F as a,G as f,I as _,K as T,h as v,i as c,q as d}from"./FFF5HUPM.js";import"./QPIMTXPL.js";export default $arcgis.t(([,,,{m:x},{c:I,j:O,n:F,o:L,r:h},,{b:k},{a:P},,,{g:M,h:B},,,,,m,E,{a:y}])=>{var R=v`.back-color-override{background-color:var(--calcite-color-surface-3);--calcite-tab-border-color: var(--calcite-color-surface-4)}:host{--panel-edge-adjustment: 2vw;--assistant-panel-min-width: 420px;--assistant-panel-width: max(var(--assistant-panel-min-width), calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment) - 15px))}.display-none{display:none!important}.height-100{height:100%}calcite-tab-nav{padding-bottom:6px;padding-top:6px}calcite-tab{--calcite-color-focus: transparent}calcite-tab>*{--calcite-color-focus: initial}calcite-tabs{--calcite-tab-border-color: var(--calcite-color-border-2);flex:1;min-height:0}.tab-space-0{--calcite-tab-content-space-y: var(--calcite-spacing-none)}.tab-space-md{--calcite-tab-content-space-y: var(--calcite-spacing-md)}solutions-searchsort-toolbar,solutions-deploy-app-nav,solution-details-panel,solutions-deployed-shell,solutions-all-shell,calcite-tab-nav,solution-deployed-card-panel{width:1440px;display:block;max-width:96vw;padding-right:var(--calcite-spacing-none);padding-left:var(--calcite-spacing-none);margin-left:auto;margin-right:auto;box-sizing:border-box}.border{height:var(--calcite-spacing-px);border-bottom-color:var(--calcite-color-border-2);border-bottom-style:solid;border-bottom-width:var(--calcite-border-width-sm);box-sizing:border-box}.overflow-auto{overflow:auto}solution-details-panel{scroll-margin-top:3rem}.main-content{container-type:inline-size;display:flex;flex-direction:column;height:100%;overflow:hidden}.main-content.assistant-open{margin-inline-end:var(--assistant-panel-width)}.assistant-open solutions-searchsort-toolbar,.assistant-open solution-details-panel,.assistant-open solutions-deployed-shell,.assistant-open solutions-all-shell,.assistant-open calcite-tab-nav,.assistant-open solution-deployed-card-panel{margin-inline-start:max(var(--panel-edge-adjustment),calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment)));margin-inline-end:0;width:auto;max-width:1440px}.builder-panel{position:fixed;top:65px;inset-inline-start:max(var(--panel-edge-adjustment),calc((96vw - 1440px) / 2 + var(--panel-edge-adjustment)));inset-inline-end:var(--assistant-panel-width);bottom:0;z-index:400;display:flex;flex-direction:column;transition:transform .3s cubic-bezier(.4,0,.2,1);pointer-events:auto}.builder-panel.display-none{display:flex!important;transform:translate(100%);pointer-events:none}.builder-panel:dir(rtl).display-none{transform:translate(-100%)}@supports (-webkit-touch-callout: none){.builder-panel.display-none{display:none!important;transform:none}.builder-panel:dir(rtl).display-none{transform:none}}.builder-panel.display-none:has(~.assistant-panel.display-none){display:none!important;transition:none}.assistant-panel{position:fixed;top:65px;inset-inline-end:0;bottom:0;width:var(--assistant-panel-width);min-width:var(--assistant-panel-min-width);z-index:400;display:flex;flex-direction:column}@media(max-width:800px){.builder-panel{display:none!important}.assistant-panel{width:100%;box-shadow:none}.main-content.assistant-open{margin-inline-end:0}}.assistant-fab{position:fixed;bottom:var(--calcite-spacing-xxl);inset-inline-end:var(--calcite-spacing-xxl);z-index:500}calcite-tooltip{--calcite-tooltip-max-size-x: 16rem}.assistant-fab-popover{--calcite-popover-max-size-x: 16rem}.assistant-fab-popover__content{display:block;padding-block:var(--calcite-spacing-sm);padding-inline:var(--calcite-spacing-md);font-size:var(--calcite-font-size-relative-sm);line-height:var(--calcite-font-line-height-relative-snug);font-weight:var(--calcite-font-weight-medium);word-wrap:break-word;word-break:break-word}`,N={solution:{title:"Bus Stop ADA Compliance Inspections",description:"Bus Stop ADA Compliance Inspections can be used to perform routine inspections of bus stops for ADA compliance and monitor inspection progress.",thumbnailUrl:P,tags:["Bus Stop","ADA Compliance","Inspection","Field","Monitor","ArcGIS Solutions"],strings:[{key:"inspectionsByMonth",value:"Inspections by Month",description:"Descriptive title of dashboard chart displaying the number of inspections completed by month."},{key:"inspectionsCompleted",value:"Inspections Completed",description:"Descriptive title of dashboard indicator displaying the total number of inspections completed."},{key:"assetInventory",value:"Bus Stop Inventory",description:"Descriptive title of dashboard indicator displaying the total number of bus stops."}]},items:[{id:"b21885d38b3c4924922ce36c90112737",title:"Bus Stop ADA Inspection Dashboard",description:"An ArcGIS Dashboards app used to monitor bus stop ADA compliance inspections.",type:"Dashboard"},{id:"54f69b6af00b4f06b1c1eef05e80dc93",title:"Bus Stop ADA Inspection Map",description:"A map used by the Bus Stop ADA Inspection Dashboard app to monitor inspections.",type:"Web Map"},{id:"2fc93fa4e07e42508669d02acb837a75",title:"Bus Stop ADA Inspection Field Map",description:"A map used in ArcGIS Field Maps to inspect bus stops in the field for ADA compliance.",type:"Web Map"},{id:"0bd4ecf9c95e4dcd8ff1744adc12f323",title:"BusStops_field",description:"A hosted feature layer view used to inspect bus stops for ADA compliance.",type:"Feature Layer (hosted, view)"},{id:"0bd4ecf9c95e4dcd8ff1744adc12f324",title:"BusStops_dashboard",description:"A hosted feature layer view used to monitor bus stop ADA inspections.",type:"Feature Layer (hosted, view)"},{id:"36d0bdce3a74436f8314c88c9667003e",title:"BusStops",description:"A hosted feature layer used to store bus stop and ADA inspection details.",type:"Feature Layer (hosted)"}],featureLayer:{itemId:"36d0bdce3a74436f8314c88c9667003e",addLayers:!0,layers:[{id:"0",type:"Point",typeMutable:!0,name:"BusStops",description:"Point layer containing bus stop locations and ADA compliance information.",customFields:[{name:"stop_id",type:"string",alias:"Stop ID",description:"Identifier for the bus stop.",choiceList:null,length:255},{name:"location_description",type:"string",alias:"Location Description",description:"Description of the bus stop location.",choiceList:null,length:255},{name:"shelter_present",type:"string",alias:"Shelter Present",description:"Indicates if a waiting shelter is present at the bus stop.",choiceList:["Yes","No"],length:5},{name:"bench_present",type:"string",alias:"Bench Present",description:"Indicates if a bench is present at the bus stop.",choiceList:["Yes","No"],length:5},{name:"ada_compliant",type:"string",alias:"ADA Compliant",description:"Indicates if the bus stop meets ADA compliance requirements.",choiceList:["Yes","No"],length:5},{name:"capacity",type:"integer",alias:"Seating Capacity",description:"Number of people that can be seated at the bus stop."},{name:"distance_from_curb",type:"double",alias:"Distance from Curb (ft)",description:"Distance in feet from the curb to the shelter."},{name:"last_inspection_date",type:"date",alias:"Last Inspection Date",description:"Date of the most recent inspection."},{name:"installation_date",type:"date",alias:"Installation Date",description:"Date when the bus stop was installed."}],requiredFields:[{name:"route_number",type:"string",alias:"Route Number",description:"Number of the bus route that uses this stop.",choiceList:null,length:50},{name:"average_daily_riders",type:"integer",alias:"Average Daily Riders",description:"Average number of riders using this stop per day."},{name:"inspection_priority",type:"string",alias:"Inspection Priority",description:"Priority level for scheduling inspections.",choiceList:["High","Medium","Low"],length:10}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"1",type:"Polyline",typeMutable:!1,name:"Routes",description:"Polyline layer containing bus route paths.",customFields:[{name:"route_name",type:"string",alias:"Route Name",description:"Name of the bus route.",choiceList:null,length:100},{name:"route_type",type:"string",alias:"Route Type",description:"Type of bus route service.",choiceList:["Express","Local","Rapid"],length:20},{name:"frequency_minutes",type:"integer",alias:"Frequency (minutes)",description:"How often buses run on this route in minutes."},{name:"route_length_miles",type:"double",alias:"Route Length (miles)",description:"Total length of the route in miles."}],requiredFields:[{name:"route_id",type:"string",alias:"Route ID",description:"Unique identifier for the route.",choiceList:null,length:50},{name:"active",type:"string",alias:"Active Status",description:"Whether the route is currently active.",choiceList:["Yes","No"],length:3}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"2",type:"Polygon",typeMutable:!1,name:"ServiceAreas",description:"Polygon layer defining bus service coverage areas.",customFields:[{name:"area_name",type:"string",alias:"Area Name",description:"Name of the service area.",choiceList:null,length:100},{name:"service_level",type:"string",alias:"Service Level",description:"Level of service provided in this area.",choiceList:["High Frequency","Standard","Limited"],length:20},{name:"population",type:"integer",alias:"Population",description:"Estimated population within the service area."},{name:"area_sq_miles",type:"double",alias:"Area (sq miles)",description:"Size of the service area in square miles."}],requiredFields:[{name:"district_id",type:"string",alias:"District ID",description:"Unique identifier for the service district.",choiceList:null,length:50}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"3",type:"Point",typeMutable:!1,name:"Tasks",description:"Point layer containing task assignments for bus stop inspections, related to BusStops layer.",customFields:[{name:"task_id",type:"string",alias:"Task ID",description:"Unique identifier for the task assignment.",choiceList:null,length:50},{name:"stop_id",type:"string",alias:"Bus Stop ID",description:"ID of the bus stop to be inspected (relates to BusStops layer).",choiceList:null,length:255},{name:"assigned_to",type:"string",alias:"Assigned To",description:"Name of the inspector assigned to this task.",choiceList:null,length:100},{name:"due_date",type:"date",alias:"Due Date",description:"Date by which the inspection should be completed."},{name:"priority",type:"string",alias:"Priority",description:"Priority level of the inspection task.",choiceList:["High","Medium","Low"],length:10},{name:"notes",type:"string",alias:"Task Notes",description:"Additional notes or instructions for the inspection task.",choiceList:null,length:500}],requiredFields:[{name:"status",type:"string",alias:"Task Status",description:"Current status of the task assignment.",choiceList:["Not Started","In Progress","Completed","Cancelled"],length:20},{name:"assignment_date",type:"date",alias:"Assignment Date",description:"Date when the task was created and assigned."}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]},{id:"4",typeMutable:!1,type:"Table",name:"Inspections",description:"Table containing inspection records and findings.",customFields:[{name:"inspection_id",type:"string",alias:"Inspection ID",description:"Unique identifier for the inspection.",choiceList:null,length:50},{name:"stop_id",type:"string",alias:"Bus Stop ID",description:"ID of the bus stop that was inspected.",choiceList:null,length:255},{name:"inspector_name",type:"string",alias:"Inspector Name",description:"Name of the person who performed the inspection.",choiceList:null,length:100},{name:"inspection_date",type:"date",alias:"Inspection Date",description:"Date when the inspection was performed."},{name:"overall_condition",type:"string",alias:"Overall Condition",description:"Overall condition assessment of the bus stop.",choiceList:["Excellent","Good","Fair","Poor","Critical"],length:20},{name:"issues_found",type:"integer",alias:"Issues Found",description:"Number of issues identified during inspection."},{name:"notes",type:"string",alias:"Inspection Notes",description:"Additional notes or comments about the inspection.",choiceList:null,length:1e3}],requiredFields:[{name:"inspection_status",type:"string",alias:"Inspection Status",description:"Current status of the inspection.",choiceList:["Scheduled","In Progress","Completed","Cancelled"],length:20}],systemFields:[{name:"objectid",type:"oid",alias:"ObjectID",description:"Unique identifier for each record in the dataset."},{name:"globalid",type:"globalid",alias:"GlobalID",description:"Globally unique identifier for the record."},{name:"created_date",type:"date",alias:"Created On",description:"Date when the record was created."},{name:"created_user",type:"string",alias:"Created By",description:"User who created the record."},{name:"last_edited_date",type:"date",alias:"Last Edited On",description:"Date when the record was last edited."},{name:"last_edited_user",type:"string",alias:"Last Edited By",description:"User who last edited the record."}]}]}},g=class extends f{constructor(){super(),this.initTitleOrId="",this.sortType="relevance",this.useLocalAppConfig=!1,this.loadExampleBuilderData=!1,this.authentication=void 0,this._isLoaded=!1,this.isMobile=!1,this._isViewportMobile=window.innerWidth<=800,this._isAssistantOpen=!1,this._builderVisible=!1,this._hasActiveBuilderDesign=!1,this._showFabTooltip=!0,this._fabTooltipDismissed=!1,this._activeTab="all-solutions",this._showDeployedCardFetchFailed=!1,this._globalAlerts=[],this._translations=C({name:"solutions-deploy-app",blocking:!0}),this._agoTerms=`${L}`,this._allCards=[],this._allShell=o(),this._allTab=o(),this._allTabTitle=o(),this._resourcesTab=o(),this._resourcesTabTitle=o(),this._categories=[],this._configContextProvider=p({context:S}),this._delay=!1,this._deployAppNav=o(),this._deployedCardPanel=o(),this._deployCardFetchFailedMessage="",this._deployedCardTab=o(),this._deployedCardTabTitle=o(),this._detailsShell=o(),this._detailsTab=o(),this._detailsTabTitle=o(),this._forceInit=!1,this._getSuggested=!1,this._tabpanelsFixed=!1,this._solutionBuilderPanel=o(),this._builderDesignContextProvider=p({context:A}),this._isMobileContextProvider=p({context:D}),this._handleWindowResize=()=>{let t=window.innerWidth<=800;this._isViewportMobile!==t&&(this._isViewportMobile=t,t&&(this._isAssistantOpen=!1,this._builderVisible=!1))},this._mainContentRef=o(),this._mySolutionsShell=o(),this._mySolutionsTab=o(),this._mySolutionsTabTitle=o(),this._sortField="relevance",this._sortOrder="desc",this._telemetryManager=new y,this.deployAppTabSelected=d(),this.deployedCardFetchFailed=d(),this.detailsCardSelected=d(),this.deployedCardSelected=d(),this.metaTagStringsReady=d(),this.sessionRefreshed=d(),this.tabChanged=d(),this.listenOn(window,"detailsCardSelected",this._detailsCardSelected),this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"displayDeployedCard",this._handleDeployedCardDisplay),this.listenOn(window,"navTabSelected",this._setActiveTab),this.listenOn(window,"forceSelectTab",t=>this.selectTab(t.detail,{})),this.listenOn(window,"showGlobalAlert",this._handleShowGlobalAlert),this.listenOn(window,"openAssistant",()=>{this._openAssistant()}),this.listenOn(window,"closeAssistant",()=>{this._isAssistantOpen=!1,this._builderVisible=!1}),this.listenOn(window,"toggleSolutionBuilder",()=>{this._builderVisible=!this._builderVisible}),this.listenOn(window,"hideSolutionBuilder",()=>{this._builderVisible=!1}),this.listenOn(window,"discardBuilder",t=>{this._hasActiveBuilderDesign=t.detail}),this.listenOn(window,"arcgis-solution-design-update",this._solutionBuilderSelected),window.addEventListener("resize",this._handleWindowResize),this._builderDesignContextProvider.value={design:this.loadExampleBuilderData?N:null,updateDesign:t=>{this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,design:t}},isBuilderVisible:!1,setBuilderVisible:t=>{this._builderVisible=t,this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,isBuilderVisible:t}}},this.loadExampleBuilderData&&(this._hasActiveBuilderDesign=!0)}static{this.properties={appConfig:1,initTab:1,initTitleOrId:1,sortType:1,useLocalAppConfig:5,loadExampleBuilderData:5,authentication:16,_isLoaded:16,isMobile:16,_isViewportMobile:16,_isAssistantOpen:16,_builderVisible:16,_hasActiveBuilderDesign:16,_showFabTooltip:16,_fabTooltipDismissed:16,_activeTab:16,_showDeployedCardFetchFailed:16,_globalAlerts:16,_translations:16}}static{this.styles=R}get _telemetry(){return this._configContextProvider.value?.telemetrySession}get _isDisconnectedEnvironment(){return this._configContextProvider.value?.isEnterprise===!0&&this._configContextProvider.value?.authentication?.CanSearchArcGISOnline===!1}get _readOnlyNotice(){return this._configContextProvider.value?.isEnterprise?this._translations.writableEnterprise||"":(this._translations.writableOnline||"").replace("{{url}}","https://status.arcgis.com/")}_openAssistant(){this._telemetry?.logEvent({category:h.ASSISTANT,action:"Open"}),this._isAssistantOpen=!0}async selectTab(t,e){if(this._isLoaded||this._forceInit){let i=this._getDefaultSearchOptions(e);switch(this._searchSortToolbar&&(this._searchSortToolbar.scope=t.tabType),t.tabType){case"all-solutions":this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0,i&&await this._allShell.value?.searchSolutions(i);break;case"resources":this._resourcesTab.value.selected=!0,this._resourcesTabTitle.value.selected=!0;break;case"deployed-card":if(this.authentication?.IsSignedIn){if(this._forceInit=!0,this._isLoaded=!1,this._cardFetcherDeployed&&await this._getDeployedSolution(t.tabTitleOrId),this._deployedSolutions?.cards?.length>0){let s;this._deployedSolutions.cards.some(l=>l.id===t.tabTitleOrId?(s=l,this.deployedCardSelected.emit({card:s}),!0):!1),this._isLoaded=!0,this._forceInit=!1}else return this._isLoaded=!0,this._forceInit=!1,this.selectTab({tabTitleOrId:"",tabType:"deployments"},e);break}else await this.authentication?.signIn();case"details":if(this._allCards){let s=M(this._allCards,t.tabTitleOrId);s=s||B(this._allCards,t.tabTitleOrId),s?(this._detailsTab.value.selected=!0,this._detailsTabTitle.value.selected=!0,this.detailsCardSelected.emit(s)):(t.tabType="all-solutions",this._allTab.value.selected=!0,this._allTabTitle.value.selected=!0)}break;case"deployments":this._mySolutionsTab.value.selected=!0,this._mySolutionsTabTitle.value.selected=!0,this._searchSortToolbar&&i?.filter&&this._searchSortToolbar.changeOwnerFilter(i.filter!=="Organization"),i&&await this._mySolutionsShell.value?.searchSolutions(i);break}return this._builderVisible=!1,this._setActiveTab(new CustomEvent("setActiveTab",{detail:t})),this._blurTabs(),this._showDeployedCardFetchFailed&&(this.deployedCardFetchFailed.emit({message:this._deployCardFetchFailedMessage,title:this._translations.failedToOpen}),this._showDeployedCardFetchFailed=!1),!0}else return this._initTab=t,this._initFilters=e,!1}updated(t){this._fixTabpanelFocus(),t.has("_isAssistantOpen")&&this._setScrollbarGutters(this._isAssistantOpen?"stable":"stable both-edges"),!this._resizeObserver&&this._mainContentRef.value&&(this._resizeObserver=new ResizeObserver(e=>{for(let i of e){let s=i.contentRect.width<=800;this.isMobile!==s&&(this.isMobile=s,this._isMobileContextProvider.setValue(s))}}),this._resizeObserver.observe(this._mainContentRef.value))}_fixTabpanelFocus(){if(!this._tabpanelsFixed&&this._allTab.value){let t=[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab];Promise.all(t.map(async e=>{let i=e.value;if(i&&(await i.componentOnReady?.(),i.shadowRoot)){let s=i.shadowRoot.querySelector('[role="tabpanel"]');s&&(s.tabIndex=-1)}})).then(()=>{this._tabpanelsFixed=!0,this._setupTabpanelObserver()}).catch(()=>{this._tabpanelsFixed=!0})}}_setupTabpanelObserver(){this._tabpanelObserver||(this._tabpanelObserver=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"&&e.attributeName==="tabindex"){let i=e.target;i.getAttribute("role")==="tabpanel"&&i.tabIndex===0&&(i.tabIndex=-1)}})}),[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(t=>{let e=t.value;if(e?.shadowRoot){let i=e.shadowRoot.querySelector('[role="tabpanel"]');i&&this._tabpanelObserver.observe(i,{attributes:!0,attributeFilter:["tabindex"]})}}))}async load(){this.useLocalAppConfig&&(this.appConfig=k)}render(){let t=this._isLoaded?"display-none":"",e=this._isLoaded?"":"display-none";return c`<calcite-shell><solutions-deploy-app-nav .appConfig=${this.appConfig} .assistantOpen=${this._isAssistantOpen} .initTab=${this.initTab} @authInit=${this._handleAuthInit} slot=header ${a(this._deployAppNav)}></solutions-deploy-app-nav><div class=${`main-content${this._isAssistantOpen?" assistant-open":""}`} ${a(this._mainContentRef)}>${this._isSearchToolbarShowing()&&c`<div class="border"></div>`||""}<solutions-searchsort-toolbar ${a(async i=>{i&&(await this._deployAppNav.value?.componentOnReady(),this._searchSortToolbar=i)})}></solutions-searchsort-toolbar><calcite-loader class=${_(t)} id=solutions-loader .label=${this._translations.fetchingAllSolutions}></calcite-loader>${this._renderGlobalAlerts()}<calcite-tabs class=${_(e)} scale=l><calcite-tab-nav class="display-none" @calciteTabChange=${this._handleCalciteTabChanged} slot=title-group><calcite-tab-title ${a(this._allTabTitle)}>${this._translations.allSolutions}</calcite-tab-title><calcite-tab-title ${a(this._mySolutionsTabTitle)}>${this._translations.mySolutions}</calcite-tab-title><calcite-tab-title ${a(this._resourcesTabTitle)}>${this._translations.solutionResources}</calcite-tab-title><calcite-tab-title class="display-none" ${a(this._detailsTabTitle)}></calcite-tab-title><calcite-tab-title class="display-none" ${a(this._deployedCardTabTitle)}></calcite-tab-title></calcite-tab-nav><calcite-tab class="back-color-override tab-space-0" selected ${a(this._allTab)}><solutions-all-shell class="height-100" ${a(this._allShell)}></solutions-all-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._mySolutionsTab)}><solutions-deployed-shell class="height-100" ${a(this._mySolutionsShell)}></solutions-deployed-shell></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._resourcesTab)}><solutions-resources-shell .assistantOpen=${this._isAssistantOpen} class="height-100"></solutions-resources-shell></calcite-tab><calcite-tab class="back-color-override" ${a(this._detailsTab)}><solution-details-panel class="height-100" .readOnlyNotice=${this._readOnlyNotice} ${a(this._detailsShell)}></solution-details-panel></calcite-tab><calcite-tab class="back-color-override tab-space-0" ${a(this._deployedCardTab)}><solution-deployed-card-panel class="shell-container height-100" .readOnlyNotice=${this._readOnlyNotice} ${a(this._deployedCardPanel)}></solution-deployed-card-panel></calcite-tab></calcite-tabs></div>${!this._configContextProvider.value?.isEnterprise&&c`<div class=${`builder-panel${this._builderVisible&&!this._isViewportMobile?"":" display-none"}`}><solution-builder-assistant class="height-100" .readOnlyNotice=${this._readOnlyNotice} ${a(this._solutionBuilderPanel)}></solution-builder-assistant></div><div class=${`assistant-panel${this._isAssistantOpen&&!this._isViewportMobile?"":" display-none"}`}><arcgis-solutions-assistant class="height-100" .builderVisible=${this._builderVisible} .hasActiveBuilderDesign=${this._hasActiveBuilderDesign}></arcgis-solutions-assistant></div><calcite-fab aria-label=${this._translations.assistantFabTooltip??T} class=${`assistant-fab${this._isAssistantOpen||this._isViewportMobile?" display-none":""}`} icon=effects id=assistant-fab-button @click=${()=>{this._openAssistant(),this._fabTooltipDismissed=!0,this._showFabTooltip=!1}} scale=l></calcite-fab>${!this._fabTooltipDismissed&&c`<calcite-popover closable class=${`assistant-fab-popover${this._isAssistantOpen||this._isViewportMobile?" display-none":""}`} .label=${this._translations.assistantFabTooltip} overlay-positioning=fixed @calcitePopoverClose=${()=>{this._fabTooltipDismissed=!0,this._showFabTooltip=!1}} .open=${this._showFabTooltip&&!this._isAssistantOpen&&!this._isViewportMobile} placement=leading reference-element=assistant-fab-button><span class="assistant-fab-popover__content">${this._translations.assistantFabTooltip}</span></calcite-popover>`||""}`||""}</calcite-shell>`}loaded(){this._setScrollbarGutters()}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._handleWindowResize),this._resizeObserver?.disconnect(),this._tabpanelObserver?.disconnect()}_renderGlobalAlerts(){return $(this._globalAlerts,t=>t.id,t=>c`<calcite-alert .autoClose=${t.autoClose} .autoCloseDuration=${t.autoCloseDuration} .icon=${t.icon} .kind=${t.kind} .label=${t.title||""} @calciteAlertClose=${()=>this._removeGlobalAlert(t.id)} open>${t.title&&c`<div slot=title>${t.title}</div>`||""}<div slot=message>${t.message}</div></calcite-alert>`)}async _handleAuthInit(t){let e=t.detail;e.telemetrySession||(e.telemetrySession=y.getDisabledSession()),this._configContextProvider.setValue(e),e.authentication&&(this.authentication=e.authentication),this._cardFetcherDeployed=new m(e.locale,e.orgUrl,e.portalURL),this._cardsFetcher=new m(e.locale,e.orgUrl,e.portalURL),this._isDisconnectedEnvironment||await this._getSolutions(e.primarySolutionsGroupId,e.agoBasedEnterpriseSolutionsGroupId),this._configContextProvider.value.allCards=this._allCards,this._configContextProvider.value.anonAgolSession=this._cardsFetcher.anonAgolSession,this._configContextProvider.value.agolPortalUrl=this._cardsFetcher.agolPortalUrl,await this._initializeTelemetry(),this._isLoaded=!0,this._setRefreshInterval(),this._initTab?(this.selectTab(this._initTab,this._initFilters),this._logTabViewTelemetry(this._initTab.tabType),this._initTab=void 0,this._initFilters=void 0):this.authentication?.IsSignedIn&&(this.initTab==="details"||this.initTab==="deployed-card"||(this._logTabViewTelemetry(this._activeTab),this._emitMetaTagStrings(this._activeTab)))}_setActiveTab(t){let e=t.detail.tabType,i=this._activeTab!==e;switch(this._activeTab=e,i&&this._logTabViewTelemetry(e),e){case"all-solutions":this._allTabTitle.value?.click();break;case"deployments":this._mySolutionsTabTitle.value?.click();break;case"resources":this._resourcesTabTitle.value?.click();break;case"deployed-card":this._deployedCardTabTitle.value?.click();break;case"details":this._detailsTabTitle.value?.click();break}this._builderVisible=!1,e!=="details"&&e!=="deployed-card"&&(this._deployAppNav.value.activateMenuItem(e),this.deployAppTabSelected.emit(e),this._emitMetaTagStrings(e))}_logTabViewTelemetry(t,e){let i;switch(t){case"all-solutions":i=h.ALL_SOLUTIONS;break;case"deployments":i=h.DEPLOYMENTS;break;case"resources":i=h.RESOURCES;break;case"details":i=h.SOLUTION_DETAILS;break;case"deployed-card":i=h.DEPLOYMENTS;break}if(!((t==="details"||t==="deployed-card")&&!e)&&i){let s=[];if((t==="details"||t==="deployed-card")&&e){let n=e;s.push(n.title||""),s.push(n.deployCommonId||""),s.push(n.deployVersion||""),s.push(""),s.push(x(n.typeKeywords))}let l=t==="deployed-card"?"Open":"View";this._telemetry?.logEvent({category:i,action:l,dimensions:s.length>0?s:void 0})}}_emitMetaTagStrings(t,e){let i="",s="";switch(t){case"all-solutions":i=this._translations.metaAllSolutionsTitle,s=this._translations.metaAllSolutionsDescription;break;case"deployments":case"deployed-card":i=this._translations.metaDeploymentsTitle,s=this._translations.metaDeploymentsDescription;break;case"resources":i=this._translations.metaResourcesTitle,s=this._translations.metaResourcesDescription;break;case"details":e&&(i=this._translations.metaDetailsTitle.replace("{title}",e.title),s=e.snippet);break}this.metaTagStringsReady.emit({pageType:t,title:i,description:s,detailTemplate:e})}_handleCalciteTabChanged(){this.tabChanged.emit(this._activeTab)}_detailsCardSelected(t){this._activeTab="details",this._detailsTabTitle.value.selected=!0,this._detailsTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail&&(this._selectedDetailsCard=t.detail),this._logTabViewTelemetry("details",this._selectedDetailsCard),this._emitMetaTagStrings("details",this._selectedDetailsCard)}_deployedCardSelected(t){this._activeTab="deployed-card",this._deployedCardTabTitle.value.selected=!0,this._deployedCardTab.value.selected=!0,this._deployAppNav.value.clearMenuItems(),t?.detail?.card&&(this._selectedDeployedCard=t.detail.card),this._logTabViewTelemetry("deployed-card",this._selectedDeployedCard),this._emitMetaTagStrings("deployed-card")}_solutionBuilderSelected(t){t?.detail&&(this._builderVisible=!0,this._hasActiveBuilderDesign=!0,this._builderDesignContextProvider.value={design:t.detail,updateDesign:e=>{this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,design:e}},isBuilderVisible:!0,setBuilderVisible:e=>{this._builderVisible=e,this._builderDesignContextProvider.value={...this._builderDesignContextProvider.value,isBuilderVisible:e}}})}_handleDeployedCardDisplay(t){let{card:e,cardRef:i}=t.detail;this.deployedCardSelected.emit({card:e,cardRef:i})}_handleShowGlobalAlert(t){let e=t.detail,i=e.id||`alert-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;this._globalAlerts=[...this._globalAlerts,{...e,id:i}]}_removeGlobalAlert(t){this._globalAlerts=this._globalAlerts.filter(e=>e.id!==t)}async _initializeTelemetry(){let t=this._configContextProvider.value;if(!this.authentication||!t)return;let e=await this._telemetryManager.initializeTelemetry(this.authentication,t);this._configContextProvider.value.telemetrySession=e}async _getSolutions(t,e){if(this._isDisconnectedEnvironment)return[];this._abortController?(this._abortController.abort(),this._abortController=new AbortController):this._abortController=new AbortController;let i=await this._cardsFetcher?.requestAvailableSolutionCards({q:this._agoTerms,filter:"type:Solution",sortField:this._sortField,sortOrder:this._sortOrder,nextStart:-1,categories:this._categories,delay:this._delay,getSuggested:this._getSuggested,num:100},t,e,this._configContextProvider.value.userSession,this._configContextProvider.value.isEnterprise,this._abortController.signal,{num:1e3});return this._abortController=void 0,this._allCards.length===0&&i?.cards&&(this._allCards=i?.cards),this._allCards}async _getDeployedSolution(t){let e=this._configContextProvider.value.authentication,i=this._configContextProvider.value.userSession;if(e&&i&&e.IsSignedIn){this._abortControllerDeployed?(this._abortControllerDeployed.abort(),this._abortControllerDeployed=new AbortController):this._abortControllerDeployed=new AbortController;let s=I(e);try{let l=await E(e,i,this._cardsFetcher,this._cardFetcherDeployed,F,"created","desc",!1,[],[],this._abortControllerDeployed.signal,s?"My organization's solutions":"My solutions",t);l.cards.length===0||l.cards[0].typeKeywords.indexOf("Deployed")<0?(this._deployCardFetchFailedMessage=this._translations.failedToFetchNotSolution.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):this._deployedSolutions=l}catch(l){let n=l.message;n.indexOf("CONT_0001")>-1||n.indexOf("Item does not exist or is inaccessible.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongId.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):n.indexOf("GWM_0003")>-1||n.indexOf("You do not have permissions to access this resource or perform this operation.")>-1?(this._deployCardFetchFailedMessage=this._translations.failedToFetchWrongPermissions.replace("{{ITEMID}}",t),this._showDeployedCardFetchFailed=!0):(this._showDeployedCardFetchFailed=!0,this._deployCardFetchFailedMessage=""),console.warn(l)}}}_blurTabs(){this._allTabTitle.value?.blur(),this._resourcesTabTitle.value?.blur(),this._detailsTabTitle.value?.blur(),this._mySolutionsTabTitle.value?.blur()}_isSearchToolbarShowing(){return this._activeTab==="all-solutions"||this._activeTab==="deployments"&&this.authentication?.IsSignedIn===!0}_getDefaultSearchOptions(t){let e;if(t){let i=t.domain,s=t.industry==="AEC"?O.AEC:t.industry,l=t.offerType,n=t.searchTerm,V="",r=t.sortField,u=t.owner,b=t.filter;r==="suggested"&&!this.authentication?.IsSignedIn&&(r=this.sortType),e=i||s?{type:i?"domain":s?"industry":""}:void 0,i&&(e=e?{...e,domain:i}:{domain:i}),s&&(e=e?{...e,industry:s}:{industry:s}),n&&(e=e?{...e,searchTerm:n}:{searchTerm:n}),e&&(e={...e,displayValue:V}),r&&(e=e?{...e,sortType:r}:{sortType:r}),l&&(r=l.toLowerCase(),e=e?{...e,sortType:r}:{sortType:r}),u&&(e=e?{...e,owner:u}:{owner:u}),b&&(e=e?{...e,filter:b}:{filter:b})}return e}_setScrollbarGutters(t="stable both-edges"){[this._allTab,this._mySolutionsTab,this._resourcesTab,this._detailsTab,this._deployedCardTab].forEach(e=>{let i=e.value?.shadowRoot?.firstElementChild;i?.style&&(i.style.scrollbarGutter=t)})}_setRefreshInterval(){let{userSession:t,authentication:e}=this._configContextProvider.value;if(t&&t.tokenDuration&&e?.IsSignedIn){let i=Date.now(),s=(e.Credential?.expires-i)*.95;setInterval(async()=>{if(e.Credential&&e.Credential.expires){await e.Credential?.refreshToken();let l=new Date(e.Credential.expires);t.updateToken(e.Credential.token,l),this.sessionRefreshed.emit(t.token)}},s)}}};w("solutions-deploy-app",g);return g},"identity/IdentityManager","identity/OAuthInfo","portal/Portal",b,e,g,h,i,j,k,l,m,n,q,r,s,t,u)
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{a as gn,b as yn}from"./5DEYOM7D.js";import{a as In}from"./2BIUOM64.js";import a from"./UBEU6ULP.js";import{b as Po}from"./2B4SGB3I.js";import{b as yo}from"./I2NTSKBD.js";import{$ as Qe,$a as gr,$b as Mt,A as Oo,Aa as Zo,Ab as Ar,B as Ro,Ba as Qo,Bb as Ur,C as Ie,Ca as Yo,Cb as Mr,D as M,Da as kt,E as Co,Ea as Ot,Eb as Nr,F as Je,Fa as Xo,G as _e,Ga as er,Gb as $r,H as S,Ha as ye,Hb as Wr,I as Et,Ia as Rt,Ib as Lr,J as Ao,Ja as tr,Jb as Vr,K as p,Ka as or,Kb as ne,L as Uo,La as rr,Lb as Br,Ma as nr,Mb as zr,N as Te,Na as ir,Nb as jr,O as b,Oa as sr,Ob as Dr,P as ve,Pa as ar,Pb as Gr,Q as Mo,Qa as mr,Qb as Kr,R as _t,Ra as cr,Rb as Hr,S as Tt,Sa as dr,Sb as qr,T as Ze,Ta as pr,Tb as Jr,U as q,Ua as lr,Ub as Zr,V as No,Va as ur,Vb as Qr,W as $o,Wa as fr,Wb as Yr,X as Wo,Xa as Ct,Xb as Xr,Y as B,Ya as tt,Yb as en,Z as Lo,Za as hr,Zb as tn,_ as D,_a as Ir,_b as on,a as Le,aa as Vo,ab as re,ac as rt,ba as vt,bb as yr,bc as Nt,c as W,ca as oe,cb as Pr,cc as ke,da as w,db as wr,dc as nt,e as ee,ea as _,eb as Sr,ec as rn,f as Eo,fa as Y,fb as xr,fc as nn,g as me,ga as Ye,gb as br,gc as sn,h as u,ha as Bo,hb as Er,hc as an,i as xt,ia as zo,ib as _r,ic as mn,j as le,ja as Ft,jb as Tr,jc as cn,k as je,ka as jo,kb as vr,kc as dn,l as fe,lb as Fe,lc as Oe,m as De,ma as Do,mb as F,mc as it,n as Ge,na as Go,nb as ot,nc as st,o as bt,oa as Ko,oc as pn,p as To,pa as Ho,pc as at,qa as qo,qb as Fr,qc as ln,r as Ke,ra as C,rb as kr,s as vo,sa as ge,sb as z,t as He,ta as J,tb as Or,u as qe,ub as Pe,v as te,va as Xe,vb as Z,w as Fo,wa as et,wb as Rr,x as he,xa as Jo,xb as At,y as ko,yb as Cr,z as I,zb as Ut}from"./AE5HNAOV.js";import{a as go}from"./MGEDATQ7.js";import{a as ue,g as Ee}from"./IHG7KTNC.js";import{a as L}from"./ZCU2WWVN.js";import{a as H,b as Ve,c as Be,d as ze}from"./KOIDWEP3.js";import{e as K,f as xo,j as Ne,l as $e,o as bo,s as We}from"./AYSQIO6L.js";import{b as wo,h as So}from"./YQHYMLC7.js";import{a as _o}from"./5O53T3SW.js";import{a as V}from"./AJZDBHB6.js";import{b as Io}from"./2I5LGZNX.js";import{E as Me,F as be,G as fo,K as ho,h as uo,i as G,q as pe}from"./FFF5HUPM.js";import{c as $}from"./QPIMTXPL.js";export default $arcgis.t(([{g:un,h:fn,i:hn}])=>{function we(e,t="application/octet-stream"){if(typeof Blob<"u"){let o=[];for(let n=0;n<e.length;n++)o[n]=e.charCodeAt(n);let r=new Uint8Array(o);return new Blob([r],{type:t})}else throw new Error("stringToBlob is not currently supported on Node")}function Pn(e){if(typeof Blob<"u")return new Blob([JSON.stringify(e)],{type:"application/json"});throw new Error("objectToJsonBlob is not currently supported on Node")}var mt={};$(mt,{_mostRecentlyEditedLayer:()=>$t,convertItemToTemplate:()=>ss,createItemFromTemplate:()=>as,postProcess:()=>ms});function ss(e,t,o,r){return new Promise((n,i)=>{let s=D(e);Tr(e.groupDesignations)?rr(s,o).then(m=>n(m),m=>i(S(m))):(s.estimatedDeploymentCostFactor=10,J(s.item.id,o).then(m=>{s.data=m,br(s,o).then(c=>{c.item.modified=Math.max(c.item.modified,$t(s.properties.layers),$t(s.properties.tables)),wr(c,o).then(d=>{c.dependencies=d.map(l=>l.id),n(Xo(c,d,!1,r))},d=>i(S(d)))},c=>i(S(c)))}))})}function as(e,t,o,r){return new Promise(n=>{if(!r(e.itemId,u.Started,0)){r(e.itemId,u.Ignored,0),n(I(e.type));return}let i=M(e);i=w(i,t),delete i.item.thumbnail,Je(i,"properties.service.size");let s=er(i.data);gr(i,o,t).then(a=>{a.success?r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,a.serviceItemId)?(i=Rt(i,t,a),sr(i,t,s,o).then(()=>{i=Rt(i,t,a),Pe({...i.item,url:void 0},i.data,o,e.item.thumbnail,void 0,t).then(()=>{r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor/2,a.serviceItemId)?C(i.itemId,o).then(m=>{i.item=m,p(i,"item.url")&&!i.item.url.endsWith("/")&&(i.item.url+="/"),n({item:i,id:a.serviceItemId,type:i.type,postProcess:oe({item:i.item,data:i.data})||Ct(i)})},()=>{r(e.itemId,u.Failed,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type)))}):(r(e.itemId,u.Cancelled,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type))))},()=>{r(e.itemId,u.Failed,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type)))})},()=>{r(e.itemId,u.Failed,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type)))})):(r(e.itemId,u.Cancelled,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type)))):(r(e.itemId,u.Failed,0),n(I(e.type)))},()=>{r(e.itemId,u.Failed,0),n(I(e.type))})})}function ms(e,t,o,r,n,i,s){return new Promise((a,m)=>{Z(e,i,s).then(c=>{Ct(r)?(r=w(r,i),tt(r,s,r.item.url,i).then(a,m)):a(c)},m)})}function $t(e){let t=0;return e.forEach(o=>{t=o.editingInfo?.lastEditDate?Math.max(t,o.editingInfo.lastEditDate):t}),t}var f={};$(f,{convertItemToTemplate:()=>cs,createItemFromTemplate:()=>ds});function cs(e,t,o){return new Promise(r=>{let n=D(e);n.item.id=_(n.item.id,n.item.id,".itemId");let i=new Promise(a=>{ge(n.itemId,n.item.name,o).then(m=>{!m||m.size===0?a(null):a(m)})}),s=Promise.resolve({});Promise.all([i,s]).then(a=>{let[m]=a;if(m){let c=rn(m,n.item.name);n.properties[c.filename]=c.mimeType;let d=nt(n.itemId,c.blob.name,1,c.blob.name===c.filename?ke.data:ke.fakezip),l={itemId:n.itemId,file:c.blob,folder:d.folder,filename:d.filename};n.dataFile=l,n.resources.push(d.folder+"/"+d.filename),r(n)}else r(n)})})}function ds(e,t,o,r){return new Promise(n=>{if(!r(e.itemId,u.Started,0)){r(e.itemId,u.Ignored,0),n(I(e.type));return}let i=M(e);i=w(i,t),e.item.thumbnail&&(i.item.thumbnail=e.item.thumbnail),re(i.item,i.data,o,t.folderId).then(s=>{r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,s.id)?(i.itemId=s.id,t[e.itemId]={itemId:s.id},r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor/2,s.id),n({item:i,id:s.id,type:i.type,postProcess:!1})):(r(e.itemId,u.Cancelled,0),F(s.id,o).then(()=>n(I(e.type)),()=>n(I(e.type))))},()=>{r(e.itemId,u.Failed,0),n(I(e.type))})})}var Xt={};$(Xt,{_getFormDataFilename:()=>ri,_replaceFeatureServiceURLs:()=>Zn,_replaceItemIds:()=>Qn,_replacePortalBaseUrls:()=>Yn,_replaceWorkflowManagerBaseUrls:()=>Xn,_updateZipObjectTextContent:()=>ei,convertItemToTemplate:()=>Ks,createItemFromTemplate:()=>Hs,postProcess:()=>oi,postProcessFormItems:()=>Js,swizzleFormObject:()=>Qt,templatizeFormData:()=>Yt});function xn(e,t){return ps(e,t)}function ps(e,t){return["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"].forEach(r=>{let n=p(e,r);Array.isArray(n)&&n.forEach(i=>{i.type==="mapWidget"&&(e.dependencies.indexOf(i.itemId)<0&&e.dependencies.push(i.itemId),i.itemId=_(i.itemId,i.itemId,".itemId")),Array.isArray(i.datasets)&&ls(i,e,t)})}),e}function ls(e,t,o){e.datasets.forEach(r=>{if(p(r,"dataSource.type")!=="arcadeDataSource"){let i=p(r,"dataSource.itemId");if(i){t.dependencies.indexOf(i)<0&&t.dependencies.push(i);let s=p(r,"dataSource.layerId");ye(s?.toString(),i,"",o),r.dataSource.itemId=_(i,i,".itemId")}}})}function bn(e,t){let o=["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"];return o.forEach(r=>{let n=p(e,r);us(n,t)}),o.forEach(r=>{fs(e,r,t)}),e}function us(e,t){e&&Array.isArray(e)&&e.forEach(o=>{Array.isArray(o.datasets)&&o.datasets.forEach(r=>{let n=_t(p(r,"dataSource.itemId"));if(n){let i=Tt(p(r,"dataSource.layerId"));t.some(s=>s.itemId===n&&s.layerId===i?(Sn(s,o.id),!0):!1)}else{let i=p(r,"dataSource.id");if(i){let s=i.split("#")[1];t.some(a=>a.ids.indexOf(s)>-1?(Sn(a,o.id),!0):!1)}}})})}function fs(e,t,o){let r=p(e,t);r&&b(e,t,hs(r,o))}function hs(e,t){return Array.isArray(e)?e.map(o=>{let r=o;return Array.isArray(r.events)&&(r.events=r.events.map(n=>{let i=n;return Array.isArray(i.actions)&&(i.actions=i.actions.map(s=>{let a=s;if(a.fieldMap&&a.targetId&&a.targetId.indexOf("#")>-1){let m=wn(a,t);if(m){let c=p(m,"fields"),d=p(m,"basePath");Array.isArray(c)&&d&&(a.fieldMap=a.fieldMap.map(l=>{let h=l;return h.targetName=Y(h.targetName,c,d),h}))}}return a})),i})),Array.isArray(r.datasets)&&(r.datasets=r.datasets.map(n=>{let i=n;if(i.type==="serviceDataset"){let s=wn(n,t);if(s){let a=p(s,"fields"),m=p(s,"basePath");Array.isArray(a)&&m&&(r=Y(r,a,m),i=Y(i,a,m))}}return i})),r}):e}function wn(e,t){let o,r=p(e,"dataSource.id")||p(e,"targetId");if(r){let n=r.split("#")[1];if(!t.some(i=>(o=i.ids.indexOf(n)>-1?i:o,i.ids.indexOf(n)>-1))){let i=r.split("#")[0];t.some(s=>{let m=(s.references||[]).indexOf(i)>-1;return o=m?s:o,m})}}else{let n=_t(p(e,"dataSource.itemId")),i=Tt(p(e,"dataSource.layerId"));n&&t.some(s=>{let a=n===s.itemId&&i===s.layerId;return o=a?s:o,a})}return o}function Sn(e,t){e.references=Array.isArray(e.references)?e.references:[],e.references.indexOf(t)<0&&e.references.push(t)}var Se={};$(Se,{convertItemToTemplate:()=>_s,convertNotebookToTemplate:()=>Ht,createItemFromTemplate:()=>Ts,deleteProps:()=>Un,fineTuneCreatedItem:()=>Kt,postProcess:()=>Fs,postProcessNotebookTemplates:()=>vs});function Tn(e,t,o,r){return new Promise((n,i)=>{let s="";if(e.item.url){let a=e.item.url,m=a.indexOf("//");e.item.url=B(q)+a.substring(a.indexOf("/",m+2),a.lastIndexOf("=")+1)+e.item.id,s=a.replace(a.substring(a.indexOf("/",m+2)),"")}e.dependencies=ys(e),b(e,"data.folderId","{{folderId}}"),Ss(e,["data.map.itemId","data.map.appProxy.mapItemId","data.values.webmap","data.values.group"]),Fn(e,"data.appItemId",e.itemId),Dt(e,["data.logo","data.map.portalUrl","data.portalUrl","data.httpProxy.url"],B(q)),b(e,"data.geometryService",B(No)),Is(e,o,s,r).then(()=>{_n(e,o,s,"data.widgetPool.widgets").then(a=>{_n(a,o,s,"data.widgetOnScreen.widgets",!0).then(m=>{gs(m,o,s,"data.values").then(c=>{n(c)},c=>i(S(c)))},m=>i(S(m)))},a=>i(S(a)))},a=>i(S(a)))})}function Is(e,t,o,r){return new Promise((n,i)=>{let s=p(e,"data.dataSource.dataSources");if(s&&Object.keys(s).length>0){let a=new Array;Object.keys(s).forEach(m=>{let c=s[m];b(c,"portalUrl",B(q));let d=p(c,"itemId");if(p(c,"url")){if(d){let h=c.url.substr(c.url.lastIndexOf("/")+1);ye(h.toString(),d,c.url,r),c.itemId=_(d,d,".layer"+h+".itemId")}let l=jt(c.url,o,[],[],t);a.push(new Promise((h,g)=>{zt(l.serviceRequests,l.requestUrls,l.testString).then(P=>{c.url=P,h()},P=>g(S(P)))}))}else d&&(c.itemId=_(d,d,".itemId"))}),Promise.all(a).then(()=>n(e),m=>i(S(m)))}else n(e)})}function _n(e,t,o,r,n=!1){return new Promise((i,s)=>{let a=p(e,r)||[],m=[],c=[];if(a.forEach(d=>{!n&&p(d,"icon")&&Dt(d,["icon"],B(q));let l=d.config;if(l){let h=JSON.stringify(l),g=jt(h,o,c,m,t);d.config=JSON.parse(g.testString),m=g.serviceRequests,c=g.requestUrls}}),m.length>0){let d=JSON.stringify(a);zt(m,c,d).then(l=>{b(e,r,JSON.parse(l)),i(e)},l=>s(S(l)))}else i(e)})}function gs(e,t,o,r){return new Promise((n,i)=>{let s=p(e,r),a=[],m=[];if(s){p(s,"icon")&&Dt(s,["icon"],B(q));let c=JSON.stringify(s),d=jt(c,o,m,a,t);s=JSON.parse(d.testString),a=d.serviceRequests,m=d.requestUrls}if(a.length>0){let c=JSON.stringify(s);zt(a,m,c).then(d=>{b(e,r,JSON.parse(d)),n(e)},d=>i(S(d)))}else n(e)})}function zt(e,t,o){return new Promise((r,n)=>{if(e&&e.length>0){let i=0;Promise.all(e).then(s=>{s.forEach(a=>{if(p(a,"serviceItemId")){let m="{{"+a.serviceItemId+(a.hasOwnProperty("id")?".layer"+a.id:"")+".url}}";o=ct(o,t[i],m,!0)}i++}),r(o)},s=>n(S(s)))}else r(o)})}function jt(e,t,o,r,n){let i={f:"json",authentication:n},s=e.match(/(\bhttps?:\/\/[-A-Z0-9/._]*)/gim);return s&&s.length&&s.forEach(a=>{a.indexOf("NAServer")>-1?e=ct(e,a,B(Wo)):a.indexOf("GeocodeServer")>-1?e=ct(e,a,B($o)):t&&a.indexOf(t)>-1?e=ct(e,t,B(q)):a.indexOf("FeatureServer")>-1&&o.indexOf(a)===-1&&(o.push(a),r.push(W(a,i)))}),{testString:e,requestUrls:o,serviceRequests:r}}function ct(e,t,o,r=!1){let n=r&&e.indexOf('"')>-1,i=new RegExp(n?'"'+t+'"':t,"gmi");return e.replace(i,n?'"'+o+'"':o)}function Dt(e,t,o){t.forEach(r=>{let n=p(e,r);if(n){let i=n.substring(n.indexOf("/",n.indexOf("//")+2));b(e,r,i!==n?o+i:o)}})}function vn(e,t,o,r){return new Promise(n=>{if(ve(e,["WAB2D","WAB3D","Web AppBuilder"])){let i={id:t.itemId,url:t.item.url,data:t.data},s=z(i,r),a={tags:e.item.tags,title:e.item.title,type:"Code Attachment",typeKeywords:["Code","Javascript","Web Mapping Application"],relationshipType:"WMA2Code",originItemId:t.itemId,url:qe(w(B(q),o))+"sharing/rest/content/items/"+t.itemId+"/package"},m=re(a,{},r,o.folderId);Promise.all([s,m]).then(()=>n(null),()=>n(null))}else n(null)})}function ys(e){let t=Ps;return ve(e,["WAB2D","WAB3D","Web AppBuilder"])&&(t=ws),t(e)}function Ps(e){return Uo(e,["data.values.webmap","data.values.group"])}function ws(e){let t=[],o=p(e,"data.map.itemId");o&&t.push(o);let r=p(e,"data.dataSource.dataSources");return r&&Object.keys(r).forEach(n=>{let i=r[n];i.itemId&&t.push(i.itemId)}),t}function Ss(e,t){t.forEach(o=>{let r=p(e,o);Fn(e,o,r)})}function Fn(e,t,o){b(e,t,_(o,o,".itemId"))}function kn(e,t){let o=p(e,"data.dataSource.dataSources");o&&Object.keys(o).length>0&&(Object.keys(o).forEach(i=>{let s=o[i];o[i]=Vt(s,t)}),b(e,"data.dataSource.dataSources",o)),["data.widgetPool.widgets","data.widgetOnScreen.widgets"].forEach(i=>{let s=p(e,i);s&&b(e,i,xs(s,t))});let n=p(e,"data.values");return n&&b(e,"data.values",Vt(n,t)),e}function Vt(e,t,o=!1){return e=Es(e,t,o),bs(e,t).forEach(n=>{e=Y(e,n.fields,n.basePath,o)}),e}function xs(e,t){let o=["SmartEditor","Screening"];return e.map(r=>{if(r.config){let n=o.indexOf(r.name)>-1;r.config=Vt(r.config,t,n)}return r})}function bs(e,t){let o=JSON.stringify(e);return t.filter(n=>Lt(n,o)<4).sort((n,i)=>Lt(n,o)-Lt(i,o))}function Lt(e,t){let o=e.url,r=e.itemId,n=e.layerId,i;return o&&!isNaN(n)&&(i=new RegExp(o.replace(/[.]/,".layer"+n+"."),"gm")),i&&i.test(t)||e.ids.length>0&&e.ids.some(s=>new RegExp(s,"gm").test(t))?1:o&&new RegExp(o,"gm").test(t)?2:r&&new RegExp(r,"gm").test(t)?3:4}function Es(e,t,o){let r=JSON.stringify(e),n=t.filter(i=>{let s;i.url&&!isNaN(i.layerId)&&(s=new RegExp(i.url.replace(/[.]/,".layer"+i.layerId+"."),"gm"));let a=!1;if(i.ids.length>0&&(a=i.ids.some(m=>new RegExp(m,"gm").test(r))),a||s&&s.test(r))return i});return n.length>0&&n.forEach(i=>{e=Bt(e,i,o),i.ids.length>0&&i.ids.forEach(s=>{e=dt(e,i,s,o)})}),e}function Bt(e,t,o){let r={},n=t.url,i=t.layerId,s;if(n&&!isNaN(i)&&(s=new RegExp(n.replace(/[.]/,".layer"+i+"."),"gm")),Array.isArray(e))r=e.map(a=>Bt(a,t,o));else if(typeof e=="object")for(let a in e)e[a]!=null&&typeof e[a]=="object"?r[a]=Bt(e[a],t,o):(s&&s.test(e[a])&&(e=Y(e,t.fields,t.basePath,o)),r[a]=e[a]);else r=e;return r}function dt(e,t,o,r){let n={},i=new RegExp(o,"gm");if(Array.isArray(e))n=e.map(s=>dt(s,t,o,r));else if(typeof e=="object")for(let s in e)if(e[s]!==null){let a;try{a=JSON.parse(e[s])}catch{a=void 0}a&&typeof a=="object"?n[s]=JSON.stringify(dt(a,t,o,r)):typeof e[s]=="object"?(i.test(s)&&r&&(e[s]=Y(e[s],t.fields,t.basePath,r)),n[s]=dt(e[s],t,o,r)):(i.test(e[s])&&(e=Y(e,t.fields,t.basePath,r)),n[s]=e[s])}else n[s]=e[s];else n=e;return n}function On(e,t,o,r){return fr(e,o,r)}function Rn(e,t,o){return tt(e,t,"",o)}function Q(e,t,o,r,n){return new Promise((i,s)=>{function a(){n&&n.signal.aborted&&s(new Error("Operation was cancelled"))}if(a(),!r(e.itemId,u.Started,0))r(e.itemId,u.Ignored,0),i(I(e.type));else{let m=M(e);m=w(m,t);let c;e.type==="Web Mapping Application"&&e.data?m=JSON.parse(w(JSON.stringify(m),t)):e.type==="QuickCapture Project"&&e.data&&(c=JSON.stringify(m.data.application),delete m.data),e.item.thumbnail&&(m.item.thumbnail=e.item.thumbnail),re(m.item,m.data,o,t.folderId).then(d=>{if(a(),!r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,d.id))r(e.itemId,u.Cancelled,0),F(d.id,o).then(()=>i(I(e.type)),()=>i(I(e.type)));else{t[e.itemId]={itemId:d.id,itemUrl:t.portalBaseUrl+"/sharing/rest/content/items/"+d.id},m.itemId=d.id,m.type==="Web Mapping Application"&&e.data&&b(m,"data.appItemId",d.id);let l=oe(m.data),h=m.item.url;m=w(m,t),a();let g=Promise.resolve([]);if(m.relatedItems){let x=w(Ye(m.relatedItems),t);g=hr(m.itemId,x,o)}a();let P;if(e.type==="Web Mapping Application"&&e.data&&ve(e,["WAB2D","WAB3D","Web AppBuilder"]))P=vn(e,m,t,o);else if(e.type==="Workforce Project")P=Rn(m,o,t);else if(e.type==="QuickCapture Project"){if(c){let x=Ie(w(JSON.parse(c),t),"qc.project.json");P=dn(x,m.itemId,"",x.name,o)}}else e.type==="Notebook"?P=Kt(e,m,t,o):h!==m.item.url?(a(),P=new Promise((x,y)=>{Rr(d.id,m.item.url,o).then(()=>x(),y)})):P=Promise.resolve(null);a(),Promise.all([g,P]).then(()=>{r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor/2,d.id)?i({item:m,id:d.id,type:m.type,postProcess:l}):(r(e.itemId,u.Cancelled,0),F(d.id,o).then(()=>i(I(e.type)),()=>i(I(e.type))))},()=>{r(e.itemId,u.Failed,0),i(I(e.type))})}},()=>{r(e.itemId,u.Failed,0),i(I(e.type))})}})}function _s(e,t,o,r){return X(e,t,o,r)}function Ts(e,t,o,r){return Q(e,t,o,r)}function Ht(e){return new Promise(t=>{Un(e.data),t(e)})}function vs(e,t){if(e.some(r=>r.type==="Notebook")){let r=Object.keys(t).filter(i=>i.indexOf("FeatureServer")>-1).sort().reverse(),n=e.reduce((i,s)=>(i=[...new Set([...i,...s.dependencies,s.itemId])],i),[]);e=e.map(i=>{if(i.type==="Notebook"){let s=i.data&&JSON.stringify(i.data);return n.forEach(a=>{new RegExp(a,"gim").test(s)&&(s=s.replace(a,"{{"+a+".itemId}}"),i.dependencies.indexOf(a)<0&&i.dependencies.push(a))}),r.forEach(a=>{let m=new RegExp(a,"gim");if(m.test(s)){let c=t[a];s=s.replace(m,c);let d=/[0-9A-F]{32}/gim,l=c.match(d)[0];i.dependencies.indexOf(l)<0&&i.dependencies.push(l)}}),i.data=JSON.parse(s),i}})}return e}function Un(e){if(e){let t=["metadata.interpreter","metadata.papermill"];_e(e,t),(e.cells||[]).forEach(o=>{_e(o,t)})}}function Kt(e,t,o,r){return new Promise((n,i)=>{let s={id:t.itemId,url:t.item.url,data:Ie(t.data,t.itemId+".ipynb")};z(s,r).then(()=>n(null),i)})}function Fs(e,t,o,r,n,i,s){return Z(e,i,s)}function Nn(e,t,o){return new Promise((r,n)=>{ks(e,o).then(i=>{e.dependencies=i.dependencies,e.data?.properties&&(e.data.properties.ServiceURL=Mn(e.data.properties.ServiceURL,i.urlHash),e.data.properties.OverviewURL=Mn(e.data.properties.OverviewURL,i.urlHash)),r(e)},i=>n(S(i)))})}function ks(e,t){return new Promise((o,r)=>{let n=[];if(e.data?.properties){let i=[];e.data.properties.ServiceURL&&i.push(e.data.properties.ServiceURL),e.data.properties.OverviewURL&&e.data.properties.OverviewURL!==e.data.properties.ServiceURL&&i.push(e.data.properties.OverviewURL),Os(i,n,t).then(s=>{o(s)},s=>r(S(s)))}else o({dependencies:n,urlHash:{}})})}function Os(e,t,o){return new Promise((r,n)=>{let i={},s={f:"json",authentication:o},a=[],m={},c=e.filter(d=>{if(d){let l=/.+FeatureServer/g.exec(d),h=Array.isArray(l)&&l.length>0?l[0]:void 0;return h?(Object.keys(m).indexOf(h)<0&&(m[h]=W(d,s)),a.push(m[h]),!0):!1}else return!1});a.length>0?Promise.all(a).then(d=>{d.forEach((l,h)=>{if(p(l,"serviceItemId")){let g=l.serviceItemId;t.indexOf(g)<0&&t.push(g),i[c[h]]=g}}),r({dependencies:t,urlHash:i})},d=>n(S(d))):r({dependencies:t,urlHash:i})})}function Mn(e,t){let o=e;if(e){let r=t[e];if(r){let n=e.substr(e.lastIndexOf("/")+1);o=_(r,r,".layer"+n+".url")}o=Ye(o.replace(/.+?(?=\/home)/,"{{portalBaseUrl}}"))}return o}var Re={};$(Re,{_templatizeAdminEmail:()=>Ln,_templatizeApplication:()=>Wn,_templatizeId:()=>qt,_templatizeUrl:()=>Bn,_updateDependencies:()=>Vn,convertItemToTemplate:()=>Cs,convertQuickCaptureToTemplate:()=>Jt,createItemFromTemplate:()=>As});function Cs(e,t,o,r){return X(e,t,o,r)}function Jt(e){return b(e,"data.application",Wn(e.data.application,e)),e}function Wn(e,t){qt(e,"itemId"),Ln(e);let o=e?.dataSources;return o&&Array.isArray(o)&&o.forEach(r=>{let n=r.featureServiceItemId;n&&(Vn(n,t),Bn(r,"featureServiceItemId","url"),qt(r,"featureServiceItemId"))}),e}function Ln(e){p(e,"preferences.adminEmail")&&b(e,"preferences.adminEmail","{{user.email}}")}function Vn(e,t){t.dependencies.indexOf(e)===-1&&t.dependencies.push(e)}function Bn(e,t,o){let r=p(e,t),n=p(e,o);if(n){let i=n.substr(n.lastIndexOf("/")+1);b(e,o,_(r,r,".layer"+i+".url"))}}function qt(e,t){let o=p(e,t);o&&b(e,t,_(o,o,".itemId"))}function As(e,t,o,r){return Q(e,t,o,r)}var Us="home/webmap/viewer.html?webmap=";function zn(e,t,o,r){return new Promise((n,i)=>{e.type!=="Vector Tile Service"&&(e.item.url=e.item.url?qe(B(q))+Us+e.item.id:e.item.url),Ms(e,o).then(s=>{e.dependencies=s.dependencies,e.data&&(e.data.baseMap?.baseMapLayers&&Zt(e.data.baseMap.baseMapLayers,s.urlHash,r),e.data.operationalLayers&&Zt(e.data.operationalLayers,s.urlHash,r),Zt(e.data.tables,s.urlHash,r),Ns(e.data)),n(e)},s=>i(S(s)))})}function Ms(e,t){return new Promise((o,r)=>{let n=[];if(e.data){let i=e.data.baseMap?.baseMapLayers||[],s=e.data.operationalLayers||[],a=e.data.tables||[],m=i.concat(s).concat(a);$s(m,n,t).then(c=>{o(c)},c=>r(S(c)))}else o({dependencies:n,urlHash:{}})})}function Ns(e){Je(e,"initialState")}function $s(e,t,o){return new Promise((r,n)=>{let i={},s={f:"json",authentication:o},a=[],m={},c=e.filter(d=>{if(d.itemId&&d.layerType==="VectorTileLayer")return a.push(C(d.itemId,o)),!0;if(d.url&&d.url.indexOf("{{velocityUrl}}")<0){let l=/.+FeatureServer/g.exec(d.url),h=Array.isArray(l)&&l.length>0?l[0]:void 0;return h?(Object.keys(m).indexOf(h)<0&&(m[h]=W(d.url,s)),a.push(m[h]),!0):!1}else return!1});a.length>0?Promise.all(a).then(d=>{d.forEach((l,h)=>{if(c[h].layerType==="VectorTileLayer"){let g=p(l,"typeKeywords");if(g&&g.includes("Vector Tile Style Editor")){t.indexOf(l.id)<0&&t.push(l.id),c[h].templatizeId=!0;let P=c[h].styleUrl.indexOf(l.id)+l.id.length;c[h].styleUrl=_(c[h].styleUrl.replace(c[h].styleUrl.substring(0,P),l.id),l.id,".itemUrl")}}else if(p(l,"serviceItemId")){let g=l.serviceItemId;t.indexOf(g)<0&&t.push(g),i[c[h].url]=g}}),r({dependencies:t,urlHash:i})},d=>n(S(d))):r({dependencies:t,urlHash:i})})}function Zt(e=[],t,o){e.forEach(r=>{if(r.itemId&&r.layerType==="VectorTileLayer")r.templatizeId&&(r.itemId=_(r.itemId,r.itemId,".itemId"),delete r.templatizeId);else if(r.url){let n=r.url.substr(r.url.lastIndexOf("/")+1),i=Object.keys(t).indexOf(r.url)>-1?t[r.url]:void 0;i&&(ye(n,i,r.url,o),r.url=_(i,i,".layer"+n+".url"),r.itemId=_(i,i,".layer"+n+".itemId"))}})}function jn(e,t){return["data.operationalLayers","data.tables","data.applicationProperties.viewing.search.layers"].forEach(r=>Ws(e,t,r)),e}function Ws(e,t,o){let r=p(e,o);r&&b(e,o,Ls(r,t))}function Ls(e,t){return e.forEach(o=>{let r=Vs(o,t);if(r){let n=r.fields.map(s=>s.name);cr(o,r,r.basePath,r.itemId,n),pr(o,r.basePath,n),o.layerDefinition&&(ur(o.layerDefinition,r.basePath,n),lr(o.layerDefinition,r.basePath,n));let i=p(o,"field.name");i&&b(o,"field.name",dr(i,o,r.itemId,r.basePath))}}),e}function Vs(e,t){let o;return t.some(r=>r.ids.indexOf(e.id)>-1?(o=r,!0):!1),o}function X(e,t,o,r){return new Promise((n,i)=>{let s=D(e);s.item.id=_(s.item.id,s.item.id,".itemId");let a=Xe(s.itemId,"forward",o),m=Promise.resolve({}),c=Promise.resolve([]);switch(e.type){case"Dashboard":case"Data Pipeline":case"Feature Collection":case"Feature Service":case"Hub Initiative":case"Hub Page":case"Hub Site Application":case"Insights Model":case"Oriented Imagery Catalog":case"Project Package":case"Style":case"Workforce Project":case"Web Map":case"Web Mapping Application":case"Web Scene":case"Notebook":m=new Promise(d=>{J(s.itemId,o).then(l=>d(l))});break;case"Form":m=ge(s.itemId,s.item.name,o);break;case"QuickCapture Project":c=et(s.itemId,o);break}Promise.all([m,a,c]).then(d=>{let[l,h,g]=d;ln(s,r),s.data=at(l,e.type,r);let P=h;s.dependencies=[],s.relatedItems=[],P.forEach(y=>{y.relationshipType!=="WMA2Code"&&(s.relatedItems.push(y),y.relatedItemIds.forEach(T=>{s.dependencies.indexOf(T)<0&&s.dependencies.push(T)}))}),e.type==="Data Pipeline"&&(s.dependencies=s.dependencies.concat(Bs(l)));let x=Promise.resolve(s);switch(e.type){case"Dashboard":xn(s,r);break;case"Notebook":x=Ht(s);break;case"Oriented Imagery Catalog":x=Nn(s,t,o);break;case"QuickCapture Project":s.resources=g,x=new Promise(async y=>{let T=null,E=-1;g&&(g.some((ce,ie)=>{let se=ce.name==="qc.project.json";return se&&(T=ce,E=ie),se}),E>=0&&g.splice(E,1)),T&&(s.data={application:{...await He(T)},name:"qc.project.json"}),s.data.application?.basemap?.type==="Web Map"&&s.dependencies.push(s.data.application.basemap.itemId);let j=Jt(s);y(j)});break;case"Vector Tile Service":case"Web Map":case"Web Scene":x=zn(s,t,o,r);break;case"Web Mapping Application":l&&(x=Tn(s,t,o,r));break;case"Workforce Project":x=On(s,t,o,r);break}x.then(n,y=>i(S(y)))})})}function Bs(e){let t=[];return(e?.inputs??[]).concat(e?.outputs??[]).forEach(r=>{if(r.type==="FeatureServiceSource"||r.type==="FeatureServiceSink"){let n=p(r,"parameters.layer.value.itemId");n&&t.push(n)}}),t}var O={};$(O,{convertItemToTemplate:()=>zs,createItemFromTemplate:()=>js,postProcess:()=>Gs,postProcessFieldReferences:()=>Ds});function zs(e,t,o,r){return X(e,t,o,r)}function js(e,t,o,r,n){return n?Q(e,t,o,r,n):Q(e,t,o,r)}function Ds(e,t,o){switch(o){case"Web Mapping Application":kn(e,t);break;case"Dashboard":bn(e,t);break;case"Web Map":jn(e,t);break}return e}async function Gs(e,t,o,r,n,i,s){if(t==="Web Map"&&r.resources.some(a=>a.indexOf(me)>-1)){let a=sn(`${i.portalBaseUrl}/sharing/rest`,r.itemId,me),m={httpMethod:"GET",authentication:s,params:{f:"json"},headers:{Accept:"application/json",Authorization:`Bearer ${s.token}`,"Content-Type":"application/json","X-Esri-Authorization":`Bearer ${s.token}`}};await W(a,m).then(async c=>{let d=JSON.stringify(c),l=w(d,i);if(d!==l){let h=JSON.parse(l),g={id:e,resource:Ie(h,me),name:me,authentication:s,params:{}};await Eo(g)}})}return Z(e,i,s)}function Ks(e,t,o,r){return O.convertItemToTemplate(e,t,o,r)}function pt(e){return!!p(e,"properties.services")}function Kn(e,t="https://survey123.arcgis.com"){let o=`${t}/api/survey/create`,r={credentials:"same-origin",method:"POST",body:wo({f:"json",...e},!0)};return fetch(o,r).then(n=>n.json()).then(n=>{if(!n.success)throw new Error(`Failed to create survey: ${n.error.message}`);return{formId:n.id,featureServiceId:n.featureService.source.itemId,folderId:n.formItemInfo.ownerFolder}})}var Hn=function(t){let o=M(t),r=[["header","content"],["subHeader","content"],["footer","content"],["settings","thankYouScreenContent"]],n=(s,a)=>(s&&s[a]&&(s[a]=encodeURIComponent(s[a])),s);r.forEach(([s,a])=>n(o[s],a));let i=s=>n(s,"description");return o.questions=(o.questions||[]).map(s=>s.questions?{...s,questions:s.questions.map(i)}:i(s)),o};function qn(e,t,o){let{item:{title:r,description:n,tags:i,typeKeywords:s},properties:{form:a}}=e,{user:{username:m},portalBaseUrl:c,organization:{basemapGalleryGroupQuery:d,defaultBasemap:{title:l}}}=t,{token:h}=o.toCredential();return Zo(d,l,o).then(g=>{let P="Survey-",x=Mo(`${P}${r}`,t,"user.folders").replace(P,"");if(a.questions){let T=E=>(E.maps&&(E.maps=E.maps.map(j=>({...j,itemId:g.id}))),E);a.questions=a.questions.map(E=>E.questions?{...E,questions:E.questions.map(T)}:T(E))}let y=Hn(a);return{description:n,form:y,portalUrl:c,tags:i,title:x,token:h,typeKeywords:s,username:m}})}function Jn(e,t,o,r){let n=w(e,t),{survey123Url:i}=t;return qn(n,t,o).then(s=>Kn(s,i)).then(s=>{let{formId:a,featureServiceId:m}=s,c=Promise.resolve(null);return e.item.thumbnail&&(c=Pe({id:a},null,o,e.item.thumbnail)),c.then(()=>C(a,o)).then(d=>(t[n.itemId]={itemId:a},t[n.properties.info.serviceInfo.itemId]={itemId:m},r(n.itemId,u.Finished,n.estimatedDeploymentCostFactor,a),{item:{...e,item:d,itemId:a},id:a,type:"Form",postProcess:!0}))}).catch(s=>{throw r(n.itemId,u.Failed,0),s})}function Hs(e,t,o,r){return pt(e)?Jn(e,t,o,r):O.createItemFromTemplate(e,t,o,r)}async function Qt(e,t){let o=await Ut(e),r=new Date;return r=new Date(r.valueOf()-864e5-r.getTimezoneOffset()*1e3*60),o.forEach(n=>{if(typeof n.content=="string"){let i=ei(n,t);e.file(n.file,i,{date:r})}else n.file.endsWith(".xlsx")&&e.file(n.file,n.content,{date:r})}),Promise.resolve(e)}async function Yt(e,t){return(await Ut(e)).forEach(r=>{if(r.file.endsWith(".info")||r.file.endsWith(".itemInfo")||r.file.endsWith(".json")||r.file.endsWith(".webform")||r.file.endsWith(".xml")){let n=r.content,i=/\b([0-9A-Fa-f]){32}_type/g;n=Qn(n,t,i),n=Zn(n,t,i),n=Yn(n,t),n=Xn(n,t),e.file(r.file,n)}}),Promise.resolve(e)}function Zn(e,t,o){let r=e;return Object.keys(t).filter(i=>i.match(o)&&t[i].type==="Feature Service").forEach(i=>{let s=t[i].url,a=t[s];a&&(r=r.replace(new RegExp(s,"g"),a))}),r}function Qn(e,t,o){let r=e;return Object.keys(t).filter(i=>i.match(o)&&t[i].type!=="Feature Service").map(i=>i.replace("_type","")).forEach(i=>{r=r.replace(new RegExp(i,"g"),`{{${i}.itemId}}`)}),r}function Yn(e,t){let o=e;return t.portalBaseUrl&&(o=o.replace(new RegExp(t.portalBaseUrl,"g"),"{{portalBaseUrl}}")),o}function Xn(e,t){let o=e;return t.workflowBaseUrl&&(o=o.replace(new RegExp(t.workflowBaseUrl,"g"),"{{workflowBaseUrl}}")),o}function ei(e,t){let o=Oo(),r=e.content;return r=w(e.content,t),he(r.match(o)??[]).forEach(i=>{let s=t[i];typeof s?.itemId=="string"&&(r=r.replace(new RegExp(i,"g"),`${s.itemId}`))}),r}function ti(e,t,o,r,n,i,s){let a=r.properties.info.serviceInfo.itemId,{itemId:m}=i[a],c=w(r,i);return C(m,s).then(d=>{let l=[{id:e,title:c.item.title,snippet:c.item.snippet,extent:c.item.extent,culture:c.item.culture},{id:m,extent:c.item.extent,typeKeywords:[`source-${a}`].concat(d.typeKeywords)}],h=P=>z(P,s),g=l.map(h);return Promise.all(g).then(()=>{let P=[e,m],x=T=>K({itemId:T,folderId:i.folderId,authentication:s}),y=P.map(x);return Promise.all(y)}).then(()=>vr(d.ownerFolder,s)).then(()=>{let P=D(d);return n.push(P),r.dependencies.push(d.id),!0})})}async function oi(e,t,o,r,n,i,s){let a=await ge(e,"Form",s);if(a){let m=await At(a),c=await Qt(m,i);rt(c,e,s)}else return await ko(5e3),oi(e,t,o,r,n,i,s);return pt(r)?ti(e,t,o,r,n,i,s):Z(e,i,s)}async function Js(e,t){for(let o of e)if(o.type==="Form"){let r=o.data;if(o.data=null,r){let n=await At(r);n=await Yt(n,t),o.item.name=ri(o.item.name,r.name,`${o.itemId}.zip`);let i=await Ar(n,o.item.name),s=nt(o.itemId,o.item.name,1,ke.data),a={itemId:o.itemId,file:i,folder:s.folder,filename:o.item.name};o.dataFile=a,o.resources.push(s.folder+"/"+s.filename)}}return Promise.resolve(e)}function ri(e,t,o){let r=e||t;return r&&r!=="undefined"?r:o}var eo={};$(eo,{_initializeNewGroup:()=>ni,convertItemToTemplate:()=>Zs,createItemFromTemplate:()=>Qs,postProcess:()=>Ys});function Zs(e,t,o){return new Promise(r=>{let n=Lo(e);n.item.id=_(n.item.id,n.item.id,".itemId"),qo(e.id,o).then(i=>{n.type="Group",Ho(e.id,o).then(s=>{s.id=n.item.id,n.item={...s,type:"Group"},n.dependencies=i.concat(Ao(s.tags)),r(n)},()=>r(n))},()=>r(n))})}function Qs(e,t,o,r){return new Promise(n=>{if(!r(e.itemId,u.Started,0)){r(e.itemId,u.Ignored,0),n(I(e.type));return}let i=M(e);i=w(i,t),i.item.thumbnail=e.item.thumbnail;let s=ni(i.item);Pr(s.title,s,t,o,Ot(i)?t.locationTracking.owner:void 0).then(a=>{if(a.success)if(!r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,a.group.id))r(e.itemId,u.Cancelled,0),Fe(a.group.id,o).then(()=>n(I(e.type)),()=>n(I(e.type)));else if(i.itemId=a.group.id,t[e.itemId]={itemId:a.group.id},i=w(i,t),t[e.itemId].itemId=a.group.id,!r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor/2,a.group.id))r(e.itemId,u.Cancelled,0),Fe(a.group.id,o).then(()=>n(I(e.type)),()=>n(I(e.type)));else if(Ot(i)){let m=t.locationTracking.owner;Fr(a.group.id,m,o).then(c=>{c.success?r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,a.group.id)?kr(a.group.id,[o.username],o).then(d=>{Array.isArray(d.notRemoved)&&d.notRemoved.length===0?r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,a.group.id)?n({item:i,id:a.group.id,type:i.type,postProcess:oe(i)}):(r(e.itemId,u.Cancelled,0),Fe(a.group.id,o).then(()=>n(I(e.type)),()=>n(I(e.type)))):(r(e.itemId,u.Failed,0),n(I(e.type)))}):(r(e.itemId,u.Cancelled,0),Fe(a.group.id,o).then(()=>n(I(e.type)),()=>n(I(e.type)))):(r(e.itemId,u.Failed,0),n(I(e.type)))})}else n({item:i,id:a.group.id,type:i.type,postProcess:oe(i)});else r(e.itemId,u.Failed,0),n(I(e.type))},()=>{r(e.itemId,u.Failed,0),n(I(e.type))})})}function Ys(e,t,o,r,n,i,s){let a=Promise.resolve({success:!0});return o.some(m=>{if(m.id===e){let c=m.item.item;return oe(c)&&(c=w(c,i),a=Or(c,s)),!0}}),a}function ni(e){let t={access:"private",description:e.description,owner:e.owner,snippet:e.snippet,tags:e.tags,thumbnail:e.thumbnail,title:e.title||"",typeKeywords:e.typeKeywords};return["autoJoin","displaySettings","isInvitationOnly","isOpenData","isViewOnly","membershipAccess","properties","sortField","sortOrder"].forEach(r=>{e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var Ce={};$(Ce,{convertItemToTemplate:()=>Xs,createItemFromTemplate:()=>ea,isAPage:()=>oa,postProcess:()=>ta});function ii(e,t,o,r){return e=fe(e,o,{}),Dr(e,{...r,allowList:[]}).then(()=>!0)}function lt(e){let t=H(e);return(e.dependencies||[]).forEach(r=>{let n=new RegExp(r,"g"),i=`{{${r}.itemId}}`;t.item=le(t.item,n,i),t.data=le(t.data,n,i),e.properties&&(t.properties=le(t.properties,n,i))}),t}function ut(e,t,o){let r=L(K,{success:!0}),n=[r({itemId:e.item.id,folderId:t,authentication:o})];return V(e,"item.properties.parentInitiativeId")&&n.push(r({itemId:e.item.properties.parentInitiativeId,folderId:t,authentication:o})),Promise.all(n)}function Xs(e,t,o=null){let r=0,n=0;return Promise.all([Ee(e.id,{authentication:t}),ne(t)]).then(([i,s])=>(r=i.item.created,n=i.item.modified,Kr(i,s))).then(i=>(i.item.created=r,i.item.modified=n,i.item.typeKeywords=Ve(i.item.typeKeywords,"doNotDelete"),i.groups=[],i.estimatedDeploymentCostFactor=2,i.resources=[],V(i,"properties")||(i.properties={}),i=lt(i),i))}function ea(e,t,o,r){if(!r(e.itemId,u.Started,0))return Promise.resolve(I(e.type));if(e.assets&&e.resources&&delete e.assets,t.solutionItemExtent){let c=t.solutionItemExtent.split(",");t.organization.defaultExtentBBox=[[c[0],c[1]],[c[2],c[3]]]}let i={},s,a,m=e.item.thumbnail;return ne(o,t).then(c=>(a=c,Hr(e,t,i,a))).then(c=>{let d=c,l={assets:d.assets||[]};return Gr(d,l,a)}).then(c=>(s=c,ut(c,t.folderId,o))).then(()=>{let c={item:{id:s.item.id},params:{thumbnail:m},authentication:o};return ee(c)}).then(()=>{if(t[e.itemId]={itemId:s.item.id},r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor||2,s.item.id)){let d={item:{...e,...te(s)},id:s.item.id,type:e.type,postProcess:!0};return d.item.itemId=s.item.id,d}else return L(jr,{success:!0})(s,a).then(()=>Promise.resolve(I(e.type)))}).catch(c=>{throw r(e.itemId,u.Failed,0),c})}function ta(e,t,o,r,n,i,s){let a;return ne(s).then(m=>(a=m,Ee(e,{authentication:s}))).then(m=>ii(m,o,i,a))}function oa(e){let t=!1;return(e==="Hub Page"||e==="Site Page")&&(t=!0),t}var Ae={};$(Ae,{convertItemToTemplate:()=>ra,createItemFromTemplate:()=>na,isASite:()=>sa,postProcess:()=>ia});function si(e,t,o){let r=t.filter(n=>n.type.indexOf("Page")>-1).map(n=>n.id);return Promise.all(r.map(n=>Ee(n,o))).then(n=>tn(e,n,o))}function ai(e,t,o,r){let n=t.filter(m=>m.id!==e.item.id),i=n.map(m=>({item:{id:m.id,type:m.type}})),s=[];s=s.concat(en(e,i,r)),s=s.concat(si(e,n,r));let a=n.map(m=>m.id);return e.item.properties.children=a,e=Qr(e,o,{}),s.push(qr(e,{...r,allowList:void 0})),Promise.all(s).then(()=>!0)}function ra(e,t,o=null){let r=0,n=0,i,s,a;return ne(t).then(m=>(a=m,bt(e.id,a))).then(m=>(r=m.item.created,n=m.item.modified,i=m.item.title,s=m.data.values.title,Xr(m,a))).then(m=>(m.item.created=r,m.item.modified=n,m.item.title=i,m.item.typeKeywords=Ve(m.item.typeKeywords,"doNotDelete"),m.data.values.title=s,m.groups=[],m.estimatedDeploymentCostFactor=2,m.resources=[],p(m,"properties")||(m.properties={}),m.dependencies=he(m.dependencies),m=lt(m),m))}function na(e,t,o,r){if(!r(e.itemId,u.Started,0))return Promise.resolve(I(e.type));e.assets&&e.resources&&delete e.assets,t.solution||(t.solution={}),t.solution.title=t.title;let i={},s,a,m=e.item.thumbnail;return ne(o,t).then(c=>(a=c,Yr(e,t,i,a))).then(c=>{let d={assets:c.assets||[]};return Zr(c,d,a)}).then(c=>(s=c,ut(c,t.folderId,o))).then(()=>{let c={item:{id:s.item.id},params:{thumbnail:m},authentication:o};return ee(c)}).then(()=>{if(t[e.itemId]={itemId:s.item.id},r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor||2,s.item.id)){let d={item:{...e,...te(s)},id:s.item.id,type:e.type,postProcess:!0};return d.item.itemId=s.item.id,d}else return L(Jr,{success:!0})(s,a).then(()=>Promise.resolve(I(e.type)))}).catch(c=>{throw r(e.itemId,u.Failed,0),c})}function ia(e,t,o,r,n,i,s){let a;return ne(s,i).then(m=>(a=m,bt(e,a))).then(m=>ai(m,o,i,a)).then(()=>Promise.resolve(!0))}function sa(e){let t=!1;return(e==="Hub Site Application"||e==="Site Application")&&(t=!0),t}var ht={};$(ht,{convertItemToTemplate:()=>ca,createItemFromTemplate:()=>da,isAStoryMap:()=>pa});function mi(e={}){let t=0;return Object.keys(e).reduce((o,r)=>(V(e,`${r}.type`)==="webmap"&&r!==`webmap${t}`&&(o.push({original:r,updated:`webmap${t}`}),t++),o),[])}function ci(e){let t=V(e,"data.resources")||{};return Object.keys(t).reduce((o,r)=>(V(t,`${r}.type`)==="webmap"&&o.push(V(t,`${r}.data.itemId`)),o),[])}function pi(e){let t=Qe(e.item.id,e.item.type);t.key=`${je(e.item.title)}_${Be("i")}`;let o=H(e);t.data=o.data;let r=o.item.created,n=o.item.modified;return t.item=Ge(o.item),t.item.created=r,t.item.modified=n,t.item.url="{{storyMapTemplateUrl}}",mi(t.data.resources).forEach(a=>{t.data.resources[a.updated]=H(t.data.resources[a.original]),delete t.data.resources[a.original],t.data.nodes=le(t.data.nodes,a.original,a.updated)}),t.item.typeKeywords.indexOf(di)!==-1&&(t.item.typeKeywords=[aa].concat(t.item.typeKeywords.filter(a=>a!==di))),t.properties={},t.properties.draftFileName="draft_{{timestamp}}.json",Object.assign(t.properties,ma),t.dependencies=ci(e),Promise.resolve(t)}var di="smstatusunpublishedchanges",aa="smstatuspublished",ma={oembed:{version:"1.0",type:"rich",title:"Example StoryMap",url:"{{storyMapTemplateUrl}}",provider_name:"ArcGIS StoryMaps",provider_url:"{{storyMapBaseUrl}}",width:800,height:600,thumbnail_url:"{{storyMapThumbnailUrl}}",thumbnail_height:"100.5",thumbnail_width:"400",html:'<iframe src="{{storyMapTemplateUrl}}" width="800" height="600" scrolling="yes" frameborder="0" allowfullscreen></iframe>',cache_age:86400},oembedXML:`<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2
+ import{a as gn,b as yn}from"./HQLA2AI4.js";import{a as In}from"./2BIUOM64.js";import a from"./UBEU6ULP.js";import{b as Po}from"./2B4SGB3I.js";import{b as yo}from"./I2NTSKBD.js";import{$ as Qe,$a as gr,$b as Mt,A as Oo,Aa as Zo,Ab as Ar,B as Ro,Ba as Qo,Bb as Ur,C as Ie,Ca as Yo,Cb as Mr,D as M,Da as kt,E as Co,Ea as Ot,Eb as Nr,F as Je,Fa as Xo,G as _e,Ga as er,Gb as $r,H as S,Ha as ye,Hb as Wr,I as Et,Ia as Rt,Ib as Lr,J as Ao,Ja as tr,Jb as Vr,K as p,Ka as or,Kb as ne,L as Uo,La as rr,Lb as Br,Ma as nr,Mb as zr,N as Te,Na as ir,Nb as jr,O as b,Oa as sr,Ob as Dr,P as ve,Pa as ar,Pb as Gr,Q as Mo,Qa as mr,Qb as Kr,R as _t,Ra as cr,Rb as Hr,S as Tt,Sa as dr,Sb as qr,T as Ze,Ta as pr,Tb as Jr,U as q,Ua as lr,Ub as Zr,V as No,Va as ur,Vb as Qr,W as $o,Wa as fr,Wb as Yr,X as Wo,Xa as Ct,Xb as Xr,Y as B,Ya as tt,Yb as en,Z as Lo,Za as hr,Zb as tn,_ as D,_a as Ir,_b as on,a as Le,aa as Vo,ab as re,ac as rt,ba as vt,bb as yr,bc as Nt,c as W,ca as oe,cb as Pr,cc as ke,da as w,db as wr,dc as nt,e as ee,ea as _,eb as Sr,ec as rn,f as Eo,fa as Y,fb as xr,fc as nn,g as me,ga as Ye,gb as br,gc as sn,h as u,ha as Bo,hb as Er,hc as an,i as xt,ia as zo,ib as _r,ic as mn,j as le,ja as Ft,jb as Tr,jc as cn,k as je,ka as jo,kb as vr,kc as dn,l as fe,lb as Fe,lc as Oe,m as De,ma as Do,mb as F,mc as it,n as Ge,na as Go,nb as ot,nc as st,o as bt,oa as Ko,oc as pn,p as To,pa as Ho,pc as at,qa as qo,qb as Fr,qc as ln,r as Ke,ra as C,rb as kr,s as vo,sa as ge,sb as z,t as He,ta as J,tb as Or,u as qe,ub as Pe,v as te,va as Xe,vb as Z,w as Fo,wa as et,wb as Rr,x as he,xa as Jo,xb as At,y as ko,yb as Cr,z as I,zb as Ut}from"./AE5HNAOV.js";import{a as go}from"./MGEDATQ7.js";import{a as ue,g as Ee}from"./IHG7KTNC.js";import{a as L}from"./ZCU2WWVN.js";import{a as H,b as Ve,c as Be,d as ze}from"./KOIDWEP3.js";import{e as K,f as xo,j as Ne,l as $e,o as bo,s as We}from"./AYSQIO6L.js";import{b as wo,h as So}from"./YQHYMLC7.js";import{a as _o}from"./5O53T3SW.js";import{a as V}from"./AJZDBHB6.js";import{b as Io}from"./2I5LGZNX.js";import{E as Me,F as be,G as fo,K as ho,h as uo,i as G,q as pe}from"./FFF5HUPM.js";import{c as $}from"./QPIMTXPL.js";export default $arcgis.t(([{g:un,h:fn,i:hn}])=>{function we(e,t="application/octet-stream"){if(typeof Blob<"u"){let o=[];for(let n=0;n<e.length;n++)o[n]=e.charCodeAt(n);let r=new Uint8Array(o);return new Blob([r],{type:t})}else throw new Error("stringToBlob is not currently supported on Node")}function Pn(e){if(typeof Blob<"u")return new Blob([JSON.stringify(e)],{type:"application/json"});throw new Error("objectToJsonBlob is not currently supported on Node")}var mt={};$(mt,{_mostRecentlyEditedLayer:()=>$t,convertItemToTemplate:()=>ss,createItemFromTemplate:()=>as,postProcess:()=>ms});function ss(e,t,o,r){return new Promise((n,i)=>{let s=D(e);Tr(e.groupDesignations)?rr(s,o).then(m=>n(m),m=>i(S(m))):(s.estimatedDeploymentCostFactor=10,J(s.item.id,o).then(m=>{s.data=m,br(s,o).then(c=>{c.item.modified=Math.max(c.item.modified,$t(s.properties.layers),$t(s.properties.tables)),wr(c,o).then(d=>{c.dependencies=d.map(l=>l.id),n(Xo(c,d,!1,r))},d=>i(S(d)))},c=>i(S(c)))}))})}function as(e,t,o,r){return new Promise(n=>{if(!r(e.itemId,u.Started,0)){r(e.itemId,u.Ignored,0),n(I(e.type));return}let i=M(e);i=w(i,t),delete i.item.thumbnail,Je(i,"properties.service.size");let s=er(i.data);gr(i,o,t).then(a=>{a.success?r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,a.serviceItemId)?(i=Rt(i,t,a),sr(i,t,s,o).then(()=>{i=Rt(i,t,a),Pe({...i.item,url:void 0},i.data,o,e.item.thumbnail,void 0,t).then(()=>{r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor/2,a.serviceItemId)?C(i.itemId,o).then(m=>{i.item=m,p(i,"item.url")&&!i.item.url.endsWith("/")&&(i.item.url+="/"),n({item:i,id:a.serviceItemId,type:i.type,postProcess:oe({item:i.item,data:i.data})||Ct(i)})},()=>{r(e.itemId,u.Failed,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type)))}):(r(e.itemId,u.Cancelled,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type))))},()=>{r(e.itemId,u.Failed,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type)))})},()=>{r(e.itemId,u.Failed,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type)))})):(r(e.itemId,u.Cancelled,0),F(a.serviceItemId,o).then(()=>n(I(e.type)),()=>n(I(e.type)))):(r(e.itemId,u.Failed,0),n(I(e.type)))},()=>{r(e.itemId,u.Failed,0),n(I(e.type))})})}function ms(e,t,o,r,n,i,s){return new Promise((a,m)=>{Z(e,i,s).then(c=>{Ct(r)?(r=w(r,i),tt(r,s,r.item.url,i).then(a,m)):a(c)},m)})}function $t(e){let t=0;return e.forEach(o=>{t=o.editingInfo?.lastEditDate?Math.max(t,o.editingInfo.lastEditDate):t}),t}var f={};$(f,{convertItemToTemplate:()=>cs,createItemFromTemplate:()=>ds});function cs(e,t,o){return new Promise(r=>{let n=D(e);n.item.id=_(n.item.id,n.item.id,".itemId");let i=new Promise(a=>{ge(n.itemId,n.item.name,o).then(m=>{!m||m.size===0?a(null):a(m)})}),s=Promise.resolve({});Promise.all([i,s]).then(a=>{let[m]=a;if(m){let c=rn(m,n.item.name);n.properties[c.filename]=c.mimeType;let d=nt(n.itemId,c.blob.name,1,c.blob.name===c.filename?ke.data:ke.fakezip),l={itemId:n.itemId,file:c.blob,folder:d.folder,filename:d.filename};n.dataFile=l,n.resources.push(d.folder+"/"+d.filename),r(n)}else r(n)})})}function ds(e,t,o,r){return new Promise(n=>{if(!r(e.itemId,u.Started,0)){r(e.itemId,u.Ignored,0),n(I(e.type));return}let i=M(e);i=w(i,t),e.item.thumbnail&&(i.item.thumbnail=e.item.thumbnail),re(i.item,i.data,o,t.folderId).then(s=>{r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,s.id)?(i.itemId=s.id,t[e.itemId]={itemId:s.id},r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor/2,s.id),n({item:i,id:s.id,type:i.type,postProcess:!1})):(r(e.itemId,u.Cancelled,0),F(s.id,o).then(()=>n(I(e.type)),()=>n(I(e.type))))},()=>{r(e.itemId,u.Failed,0),n(I(e.type))})})}var Xt={};$(Xt,{_getFormDataFilename:()=>ri,_replaceFeatureServiceURLs:()=>Zn,_replaceItemIds:()=>Qn,_replacePortalBaseUrls:()=>Yn,_replaceWorkflowManagerBaseUrls:()=>Xn,_updateZipObjectTextContent:()=>ei,convertItemToTemplate:()=>Ks,createItemFromTemplate:()=>Hs,postProcess:()=>oi,postProcessFormItems:()=>Js,swizzleFormObject:()=>Qt,templatizeFormData:()=>Yt});function xn(e,t){return ps(e,t)}function ps(e,t){return["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"].forEach(r=>{let n=p(e,r);Array.isArray(n)&&n.forEach(i=>{i.type==="mapWidget"&&(e.dependencies.indexOf(i.itemId)<0&&e.dependencies.push(i.itemId),i.itemId=_(i.itemId,i.itemId,".itemId")),Array.isArray(i.datasets)&&ls(i,e,t)})}),e}function ls(e,t,o){e.datasets.forEach(r=>{if(p(r,"dataSource.type")!=="arcadeDataSource"){let i=p(r,"dataSource.itemId");if(i){t.dependencies.indexOf(i)<0&&t.dependencies.push(i);let s=p(r,"dataSource.layerId");ye(s?.toString(),i,"",o),r.dataSource.itemId=_(i,i,".itemId")}}})}function bn(e,t){let o=["data.desktopView.header","data.desktopView.headerPanel.selectors","data.desktopView.leftPanel.selectors","data.desktopView.sidebar","data.desktopView.urlParameters","data.desktopView.widgets","data.header","data.headerPanel.selectors","data.leftPanel.selectors","data.mobileView.header","data.mobileView.headerPanel.selectors","data.mobileView.leftPanel.selectors","data.mobileView.sidebar","data.mobileView.urlParameters","data.mobileView.widgets","data.sidebar","data.urlParameters","data.widgets"];return o.forEach(r=>{let n=p(e,r);us(n,t)}),o.forEach(r=>{fs(e,r,t)}),e}function us(e,t){e&&Array.isArray(e)&&e.forEach(o=>{Array.isArray(o.datasets)&&o.datasets.forEach(r=>{let n=_t(p(r,"dataSource.itemId"));if(n){let i=Tt(p(r,"dataSource.layerId"));t.some(s=>s.itemId===n&&s.layerId===i?(Sn(s,o.id),!0):!1)}else{let i=p(r,"dataSource.id");if(i){let s=i.split("#")[1];t.some(a=>a.ids.indexOf(s)>-1?(Sn(a,o.id),!0):!1)}}})})}function fs(e,t,o){let r=p(e,t);r&&b(e,t,hs(r,o))}function hs(e,t){return Array.isArray(e)?e.map(o=>{let r=o;return Array.isArray(r.events)&&(r.events=r.events.map(n=>{let i=n;return Array.isArray(i.actions)&&(i.actions=i.actions.map(s=>{let a=s;if(a.fieldMap&&a.targetId&&a.targetId.indexOf("#")>-1){let m=wn(a,t);if(m){let c=p(m,"fields"),d=p(m,"basePath");Array.isArray(c)&&d&&(a.fieldMap=a.fieldMap.map(l=>{let h=l;return h.targetName=Y(h.targetName,c,d),h}))}}return a})),i})),Array.isArray(r.datasets)&&(r.datasets=r.datasets.map(n=>{let i=n;if(i.type==="serviceDataset"){let s=wn(n,t);if(s){let a=p(s,"fields"),m=p(s,"basePath");Array.isArray(a)&&m&&(r=Y(r,a,m),i=Y(i,a,m))}}return i})),r}):e}function wn(e,t){let o,r=p(e,"dataSource.id")||p(e,"targetId");if(r){let n=r.split("#")[1];if(!t.some(i=>(o=i.ids.indexOf(n)>-1?i:o,i.ids.indexOf(n)>-1))){let i=r.split("#")[0];t.some(s=>{let m=(s.references||[]).indexOf(i)>-1;return o=m?s:o,m})}}else{let n=_t(p(e,"dataSource.itemId")),i=Tt(p(e,"dataSource.layerId"));n&&t.some(s=>{let a=n===s.itemId&&i===s.layerId;return o=a?s:o,a})}return o}function Sn(e,t){e.references=Array.isArray(e.references)?e.references:[],e.references.indexOf(t)<0&&e.references.push(t)}var Se={};$(Se,{convertItemToTemplate:()=>_s,convertNotebookToTemplate:()=>Ht,createItemFromTemplate:()=>Ts,deleteProps:()=>Un,fineTuneCreatedItem:()=>Kt,postProcess:()=>Fs,postProcessNotebookTemplates:()=>vs});function Tn(e,t,o,r){return new Promise((n,i)=>{let s="";if(e.item.url){let a=e.item.url,m=a.indexOf("//");e.item.url=B(q)+a.substring(a.indexOf("/",m+2),a.lastIndexOf("=")+1)+e.item.id,s=a.replace(a.substring(a.indexOf("/",m+2)),"")}e.dependencies=ys(e),b(e,"data.folderId","{{folderId}}"),Ss(e,["data.map.itemId","data.map.appProxy.mapItemId","data.values.webmap","data.values.group"]),Fn(e,"data.appItemId",e.itemId),Dt(e,["data.logo","data.map.portalUrl","data.portalUrl","data.httpProxy.url"],B(q)),b(e,"data.geometryService",B(No)),Is(e,o,s,r).then(()=>{_n(e,o,s,"data.widgetPool.widgets").then(a=>{_n(a,o,s,"data.widgetOnScreen.widgets",!0).then(m=>{gs(m,o,s,"data.values").then(c=>{n(c)},c=>i(S(c)))},m=>i(S(m)))},a=>i(S(a)))},a=>i(S(a)))})}function Is(e,t,o,r){return new Promise((n,i)=>{let s=p(e,"data.dataSource.dataSources");if(s&&Object.keys(s).length>0){let a=new Array;Object.keys(s).forEach(m=>{let c=s[m];b(c,"portalUrl",B(q));let d=p(c,"itemId");if(p(c,"url")){if(d){let h=c.url.substr(c.url.lastIndexOf("/")+1);ye(h.toString(),d,c.url,r),c.itemId=_(d,d,".layer"+h+".itemId")}let l=jt(c.url,o,[],[],t);a.push(new Promise((h,g)=>{zt(l.serviceRequests,l.requestUrls,l.testString).then(P=>{c.url=P,h()},P=>g(S(P)))}))}else d&&(c.itemId=_(d,d,".itemId"))}),Promise.all(a).then(()=>n(e),m=>i(S(m)))}else n(e)})}function _n(e,t,o,r,n=!1){return new Promise((i,s)=>{let a=p(e,r)||[],m=[],c=[];if(a.forEach(d=>{!n&&p(d,"icon")&&Dt(d,["icon"],B(q));let l=d.config;if(l){let h=JSON.stringify(l),g=jt(h,o,c,m,t);d.config=JSON.parse(g.testString),m=g.serviceRequests,c=g.requestUrls}}),m.length>0){let d=JSON.stringify(a);zt(m,c,d).then(l=>{b(e,r,JSON.parse(l)),i(e)},l=>s(S(l)))}else i(e)})}function gs(e,t,o,r){return new Promise((n,i)=>{let s=p(e,r),a=[],m=[];if(s){p(s,"icon")&&Dt(s,["icon"],B(q));let c=JSON.stringify(s),d=jt(c,o,m,a,t);s=JSON.parse(d.testString),a=d.serviceRequests,m=d.requestUrls}if(a.length>0){let c=JSON.stringify(s);zt(a,m,c).then(d=>{b(e,r,JSON.parse(d)),n(e)},d=>i(S(d)))}else n(e)})}function zt(e,t,o){return new Promise((r,n)=>{if(e&&e.length>0){let i=0;Promise.all(e).then(s=>{s.forEach(a=>{if(p(a,"serviceItemId")){let m="{{"+a.serviceItemId+(a.hasOwnProperty("id")?".layer"+a.id:"")+".url}}";o=ct(o,t[i],m,!0)}i++}),r(o)},s=>n(S(s)))}else r(o)})}function jt(e,t,o,r,n){let i={f:"json",authentication:n},s=e.match(/(\bhttps?:\/\/[-A-Z0-9/._]*)/gim);return s&&s.length&&s.forEach(a=>{a.indexOf("NAServer")>-1?e=ct(e,a,B(Wo)):a.indexOf("GeocodeServer")>-1?e=ct(e,a,B($o)):t&&a.indexOf(t)>-1?e=ct(e,t,B(q)):a.indexOf("FeatureServer")>-1&&o.indexOf(a)===-1&&(o.push(a),r.push(W(a,i)))}),{testString:e,requestUrls:o,serviceRequests:r}}function ct(e,t,o,r=!1){let n=r&&e.indexOf('"')>-1,i=new RegExp(n?'"'+t+'"':t,"gmi");return e.replace(i,n?'"'+o+'"':o)}function Dt(e,t,o){t.forEach(r=>{let n=p(e,r);if(n){let i=n.substring(n.indexOf("/",n.indexOf("//")+2));b(e,r,i!==n?o+i:o)}})}function vn(e,t,o,r){return new Promise(n=>{if(ve(e,["WAB2D","WAB3D","Web AppBuilder"])){let i={id:t.itemId,url:t.item.url,data:t.data},s=z(i,r),a={tags:e.item.tags,title:e.item.title,type:"Code Attachment",typeKeywords:["Code","Javascript","Web Mapping Application"],relationshipType:"WMA2Code",originItemId:t.itemId,url:qe(w(B(q),o))+"sharing/rest/content/items/"+t.itemId+"/package"},m=re(a,{},r,o.folderId);Promise.all([s,m]).then(()=>n(null),()=>n(null))}else n(null)})}function ys(e){let t=Ps;return ve(e,["WAB2D","WAB3D","Web AppBuilder"])&&(t=ws),t(e)}function Ps(e){return Uo(e,["data.values.webmap","data.values.group"])}function ws(e){let t=[],o=p(e,"data.map.itemId");o&&t.push(o);let r=p(e,"data.dataSource.dataSources");return r&&Object.keys(r).forEach(n=>{let i=r[n];i.itemId&&t.push(i.itemId)}),t}function Ss(e,t){t.forEach(o=>{let r=p(e,o);Fn(e,o,r)})}function Fn(e,t,o){b(e,t,_(o,o,".itemId"))}function kn(e,t){let o=p(e,"data.dataSource.dataSources");o&&Object.keys(o).length>0&&(Object.keys(o).forEach(i=>{let s=o[i];o[i]=Vt(s,t)}),b(e,"data.dataSource.dataSources",o)),["data.widgetPool.widgets","data.widgetOnScreen.widgets"].forEach(i=>{let s=p(e,i);s&&b(e,i,xs(s,t))});let n=p(e,"data.values");return n&&b(e,"data.values",Vt(n,t)),e}function Vt(e,t,o=!1){return e=Es(e,t,o),bs(e,t).forEach(n=>{e=Y(e,n.fields,n.basePath,o)}),e}function xs(e,t){let o=["SmartEditor","Screening"];return e.map(r=>{if(r.config){let n=o.indexOf(r.name)>-1;r.config=Vt(r.config,t,n)}return r})}function bs(e,t){let o=JSON.stringify(e);return t.filter(n=>Lt(n,o)<4).sort((n,i)=>Lt(n,o)-Lt(i,o))}function Lt(e,t){let o=e.url,r=e.itemId,n=e.layerId,i;return o&&!isNaN(n)&&(i=new RegExp(o.replace(/[.]/,".layer"+n+"."),"gm")),i&&i.test(t)||e.ids.length>0&&e.ids.some(s=>new RegExp(s,"gm").test(t))?1:o&&new RegExp(o,"gm").test(t)?2:r&&new RegExp(r,"gm").test(t)?3:4}function Es(e,t,o){let r=JSON.stringify(e),n=t.filter(i=>{let s;i.url&&!isNaN(i.layerId)&&(s=new RegExp(i.url.replace(/[.]/,".layer"+i.layerId+"."),"gm"));let a=!1;if(i.ids.length>0&&(a=i.ids.some(m=>new RegExp(m,"gm").test(r))),a||s&&s.test(r))return i});return n.length>0&&n.forEach(i=>{e=Bt(e,i,o),i.ids.length>0&&i.ids.forEach(s=>{e=dt(e,i,s,o)})}),e}function Bt(e,t,o){let r={},n=t.url,i=t.layerId,s;if(n&&!isNaN(i)&&(s=new RegExp(n.replace(/[.]/,".layer"+i+"."),"gm")),Array.isArray(e))r=e.map(a=>Bt(a,t,o));else if(typeof e=="object")for(let a in e)e[a]!=null&&typeof e[a]=="object"?r[a]=Bt(e[a],t,o):(s&&s.test(e[a])&&(e=Y(e,t.fields,t.basePath,o)),r[a]=e[a]);else r=e;return r}function dt(e,t,o,r){let n={},i=new RegExp(o,"gm");if(Array.isArray(e))n=e.map(s=>dt(s,t,o,r));else if(typeof e=="object")for(let s in e)if(e[s]!==null){let a;try{a=JSON.parse(e[s])}catch{a=void 0}a&&typeof a=="object"?n[s]=JSON.stringify(dt(a,t,o,r)):typeof e[s]=="object"?(i.test(s)&&r&&(e[s]=Y(e[s],t.fields,t.basePath,r)),n[s]=dt(e[s],t,o,r)):(i.test(e[s])&&(e=Y(e,t.fields,t.basePath,r)),n[s]=e[s])}else n[s]=e[s];else n=e;return n}function On(e,t,o,r){return fr(e,o,r)}function Rn(e,t,o){return tt(e,t,"",o)}function Q(e,t,o,r,n){return new Promise((i,s)=>{function a(){n&&n.signal.aborted&&s(new Error("Operation was cancelled"))}if(a(),!r(e.itemId,u.Started,0))r(e.itemId,u.Ignored,0),i(I(e.type));else{let m=M(e);m=w(m,t);let c;e.type==="Web Mapping Application"&&e.data?m=JSON.parse(w(JSON.stringify(m),t)):e.type==="QuickCapture Project"&&e.data&&(c=JSON.stringify(m.data.application),delete m.data),e.item.thumbnail&&(m.item.thumbnail=e.item.thumbnail),re(m.item,m.data,o,t.folderId).then(d=>{if(a(),!r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,d.id))r(e.itemId,u.Cancelled,0),F(d.id,o).then(()=>i(I(e.type)),()=>i(I(e.type)));else{t[e.itemId]={itemId:d.id,itemUrl:t.portalBaseUrl+"/sharing/rest/content/items/"+d.id},m.itemId=d.id,m.type==="Web Mapping Application"&&e.data&&b(m,"data.appItemId",d.id);let l=oe(m.data),h=m.item.url;m=w(m,t),a();let g=Promise.resolve([]);if(m.relatedItems){let x=w(Ye(m.relatedItems),t);g=hr(m.itemId,x,o)}a();let P;if(e.type==="Web Mapping Application"&&e.data&&ve(e,["WAB2D","WAB3D","Web AppBuilder"]))P=vn(e,m,t,o);else if(e.type==="Workforce Project")P=Rn(m,o,t);else if(e.type==="QuickCapture Project"){if(c){let x=Ie(w(JSON.parse(c),t),"qc.project.json");P=dn(x,m.itemId,"",x.name,o)}}else e.type==="Notebook"?P=Kt(e,m,t,o):h!==m.item.url?(a(),P=new Promise((x,y)=>{Rr(d.id,m.item.url,o).then(()=>x(),y)})):P=Promise.resolve(null);a(),Promise.all([g,P]).then(()=>{r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor/2,d.id)?i({item:m,id:d.id,type:m.type,postProcess:l}):(r(e.itemId,u.Cancelled,0),F(d.id,o).then(()=>i(I(e.type)),()=>i(I(e.type))))},()=>{r(e.itemId,u.Failed,0),i(I(e.type))})}},()=>{r(e.itemId,u.Failed,0),i(I(e.type))})}})}function _s(e,t,o,r){return X(e,t,o,r)}function Ts(e,t,o,r){return Q(e,t,o,r)}function Ht(e){return new Promise(t=>{Un(e.data),t(e)})}function vs(e,t){if(e.some(r=>r.type==="Notebook")){let r=Object.keys(t).filter(i=>i.indexOf("FeatureServer")>-1).sort().reverse(),n=e.reduce((i,s)=>(i=[...new Set([...i,...s.dependencies,s.itemId])],i),[]);e=e.map(i=>{if(i.type==="Notebook"){let s=i.data&&JSON.stringify(i.data);return n.forEach(a=>{new RegExp(a,"gim").test(s)&&(s=s.replace(a,"{{"+a+".itemId}}"),i.dependencies.indexOf(a)<0&&i.dependencies.push(a))}),r.forEach(a=>{let m=new RegExp(a,"gim");if(m.test(s)){let c=t[a];s=s.replace(m,c);let d=/[0-9A-F]{32}/gim,l=c.match(d)[0];i.dependencies.indexOf(l)<0&&i.dependencies.push(l)}}),i.data=JSON.parse(s),i}})}return e}function Un(e){if(e){let t=["metadata.interpreter","metadata.papermill"];_e(e,t),(e.cells||[]).forEach(o=>{_e(o,t)})}}function Kt(e,t,o,r){return new Promise((n,i)=>{let s={id:t.itemId,url:t.item.url,data:Ie(t.data,t.itemId+".ipynb")};z(s,r).then(()=>n(null),i)})}function Fs(e,t,o,r,n,i,s){return Z(e,i,s)}function Nn(e,t,o){return new Promise((r,n)=>{ks(e,o).then(i=>{e.dependencies=i.dependencies,e.data?.properties&&(e.data.properties.ServiceURL=Mn(e.data.properties.ServiceURL,i.urlHash),e.data.properties.OverviewURL=Mn(e.data.properties.OverviewURL,i.urlHash)),r(e)},i=>n(S(i)))})}function ks(e,t){return new Promise((o,r)=>{let n=[];if(e.data?.properties){let i=[];e.data.properties.ServiceURL&&i.push(e.data.properties.ServiceURL),e.data.properties.OverviewURL&&e.data.properties.OverviewURL!==e.data.properties.ServiceURL&&i.push(e.data.properties.OverviewURL),Os(i,n,t).then(s=>{o(s)},s=>r(S(s)))}else o({dependencies:n,urlHash:{}})})}function Os(e,t,o){return new Promise((r,n)=>{let i={},s={f:"json",authentication:o},a=[],m={},c=e.filter(d=>{if(d){let l=/.+FeatureServer/g.exec(d),h=Array.isArray(l)&&l.length>0?l[0]:void 0;return h?(Object.keys(m).indexOf(h)<0&&(m[h]=W(d,s)),a.push(m[h]),!0):!1}else return!1});a.length>0?Promise.all(a).then(d=>{d.forEach((l,h)=>{if(p(l,"serviceItemId")){let g=l.serviceItemId;t.indexOf(g)<0&&t.push(g),i[c[h]]=g}}),r({dependencies:t,urlHash:i})},d=>n(S(d))):r({dependencies:t,urlHash:i})})}function Mn(e,t){let o=e;if(e){let r=t[e];if(r){let n=e.substr(e.lastIndexOf("/")+1);o=_(r,r,".layer"+n+".url")}o=Ye(o.replace(/.+?(?=\/home)/,"{{portalBaseUrl}}"))}return o}var Re={};$(Re,{_templatizeAdminEmail:()=>Ln,_templatizeApplication:()=>Wn,_templatizeId:()=>qt,_templatizeUrl:()=>Bn,_updateDependencies:()=>Vn,convertItemToTemplate:()=>Cs,convertQuickCaptureToTemplate:()=>Jt,createItemFromTemplate:()=>As});function Cs(e,t,o,r){return X(e,t,o,r)}function Jt(e){return b(e,"data.application",Wn(e.data.application,e)),e}function Wn(e,t){qt(e,"itemId"),Ln(e);let o=e?.dataSources;return o&&Array.isArray(o)&&o.forEach(r=>{let n=r.featureServiceItemId;n&&(Vn(n,t),Bn(r,"featureServiceItemId","url"),qt(r,"featureServiceItemId"))}),e}function Ln(e){p(e,"preferences.adminEmail")&&b(e,"preferences.adminEmail","{{user.email}}")}function Vn(e,t){t.dependencies.indexOf(e)===-1&&t.dependencies.push(e)}function Bn(e,t,o){let r=p(e,t),n=p(e,o);if(n){let i=n.substr(n.lastIndexOf("/")+1);b(e,o,_(r,r,".layer"+i+".url"))}}function qt(e,t){let o=p(e,t);o&&b(e,t,_(o,o,".itemId"))}function As(e,t,o,r){return Q(e,t,o,r)}var Us="home/webmap/viewer.html?webmap=";function zn(e,t,o,r){return new Promise((n,i)=>{e.type!=="Vector Tile Service"&&(e.item.url=e.item.url?qe(B(q))+Us+e.item.id:e.item.url),Ms(e,o).then(s=>{e.dependencies=s.dependencies,e.data&&(e.data.baseMap?.baseMapLayers&&Zt(e.data.baseMap.baseMapLayers,s.urlHash,r),e.data.operationalLayers&&Zt(e.data.operationalLayers,s.urlHash,r),Zt(e.data.tables,s.urlHash,r),Ns(e.data)),n(e)},s=>i(S(s)))})}function Ms(e,t){return new Promise((o,r)=>{let n=[];if(e.data){let i=e.data.baseMap?.baseMapLayers||[],s=e.data.operationalLayers||[],a=e.data.tables||[],m=i.concat(s).concat(a);$s(m,n,t).then(c=>{o(c)},c=>r(S(c)))}else o({dependencies:n,urlHash:{}})})}function Ns(e){Je(e,"initialState")}function $s(e,t,o){return new Promise((r,n)=>{let i={},s={f:"json",authentication:o},a=[],m={},c=e.filter(d=>{if(d.itemId&&d.layerType==="VectorTileLayer")return a.push(C(d.itemId,o)),!0;if(d.url&&d.url.indexOf("{{velocityUrl}}")<0){let l=/.+FeatureServer/g.exec(d.url),h=Array.isArray(l)&&l.length>0?l[0]:void 0;return h?(Object.keys(m).indexOf(h)<0&&(m[h]=W(d.url,s)),a.push(m[h]),!0):!1}else return!1});a.length>0?Promise.all(a).then(d=>{d.forEach((l,h)=>{if(c[h].layerType==="VectorTileLayer"){let g=p(l,"typeKeywords");if(g&&g.includes("Vector Tile Style Editor")){t.indexOf(l.id)<0&&t.push(l.id),c[h].templatizeId=!0;let P=c[h].styleUrl.indexOf(l.id)+l.id.length;c[h].styleUrl=_(c[h].styleUrl.replace(c[h].styleUrl.substring(0,P),l.id),l.id,".itemUrl")}}else if(p(l,"serviceItemId")){let g=l.serviceItemId;t.indexOf(g)<0&&t.push(g),i[c[h].url]=g}}),r({dependencies:t,urlHash:i})},d=>n(S(d))):r({dependencies:t,urlHash:i})})}function Zt(e=[],t,o){e.forEach(r=>{if(r.itemId&&r.layerType==="VectorTileLayer")r.templatizeId&&(r.itemId=_(r.itemId,r.itemId,".itemId"),delete r.templatizeId);else if(r.url){let n=r.url.substr(r.url.lastIndexOf("/")+1),i=Object.keys(t).indexOf(r.url)>-1?t[r.url]:void 0;i&&(ye(n,i,r.url,o),r.url=_(i,i,".layer"+n+".url"),r.itemId=_(i,i,".layer"+n+".itemId"))}})}function jn(e,t){return["data.operationalLayers","data.tables","data.applicationProperties.viewing.search.layers"].forEach(r=>Ws(e,t,r)),e}function Ws(e,t,o){let r=p(e,o);r&&b(e,o,Ls(r,t))}function Ls(e,t){return e.forEach(o=>{let r=Vs(o,t);if(r){let n=r.fields.map(s=>s.name);cr(o,r,r.basePath,r.itemId,n),pr(o,r.basePath,n),o.layerDefinition&&(ur(o.layerDefinition,r.basePath,n),lr(o.layerDefinition,r.basePath,n));let i=p(o,"field.name");i&&b(o,"field.name",dr(i,o,r.itemId,r.basePath))}}),e}function Vs(e,t){let o;return t.some(r=>r.ids.indexOf(e.id)>-1?(o=r,!0):!1),o}function X(e,t,o,r){return new Promise((n,i)=>{let s=D(e);s.item.id=_(s.item.id,s.item.id,".itemId");let a=Xe(s.itemId,"forward",o),m=Promise.resolve({}),c=Promise.resolve([]);switch(e.type){case"Dashboard":case"Data Pipeline":case"Feature Collection":case"Feature Service":case"Hub Initiative":case"Hub Page":case"Hub Site Application":case"Insights Model":case"Oriented Imagery Catalog":case"Project Package":case"Style":case"Workforce Project":case"Web Map":case"Web Mapping Application":case"Web Scene":case"Notebook":m=new Promise(d=>{J(s.itemId,o).then(l=>d(l))});break;case"Form":m=ge(s.itemId,s.item.name,o);break;case"QuickCapture Project":c=et(s.itemId,o);break}Promise.all([m,a,c]).then(d=>{let[l,h,g]=d;ln(s,r),s.data=at(l,e.type,r);let P=h;s.dependencies=[],s.relatedItems=[],P.forEach(y=>{y.relationshipType!=="WMA2Code"&&(s.relatedItems.push(y),y.relatedItemIds.forEach(T=>{s.dependencies.indexOf(T)<0&&s.dependencies.push(T)}))}),e.type==="Data Pipeline"&&(s.dependencies=s.dependencies.concat(Bs(l)));let x=Promise.resolve(s);switch(e.type){case"Dashboard":xn(s,r);break;case"Notebook":x=Ht(s);break;case"Oriented Imagery Catalog":x=Nn(s,t,o);break;case"QuickCapture Project":s.resources=g,x=new Promise(async y=>{let T=null,E=-1;g&&(g.some((ce,ie)=>{let se=ce.name==="qc.project.json";return se&&(T=ce,E=ie),se}),E>=0&&g.splice(E,1)),T&&(s.data={application:{...await He(T)},name:"qc.project.json"}),s.data.application?.basemap?.type==="Web Map"&&s.dependencies.push(s.data.application.basemap.itemId);let j=Jt(s);y(j)});break;case"Vector Tile Service":case"Web Map":case"Web Scene":x=zn(s,t,o,r);break;case"Web Mapping Application":l&&(x=Tn(s,t,o,r));break;case"Workforce Project":x=On(s,t,o,r);break}x.then(n,y=>i(S(y)))})})}function Bs(e){let t=[];return(e?.inputs??[]).concat(e?.outputs??[]).forEach(r=>{if(r.type==="FeatureServiceSource"||r.type==="FeatureServiceSink"){let n=p(r,"parameters.layer.value.itemId");n&&t.push(n)}}),t}var O={};$(O,{convertItemToTemplate:()=>zs,createItemFromTemplate:()=>js,postProcess:()=>Gs,postProcessFieldReferences:()=>Ds});function zs(e,t,o,r){return X(e,t,o,r)}function js(e,t,o,r,n){return n?Q(e,t,o,r,n):Q(e,t,o,r)}function Ds(e,t,o){switch(o){case"Web Mapping Application":kn(e,t);break;case"Dashboard":bn(e,t);break;case"Web Map":jn(e,t);break}return e}async function Gs(e,t,o,r,n,i,s){if(t==="Web Map"&&r.resources.some(a=>a.indexOf(me)>-1)){let a=sn(`${i.portalBaseUrl}/sharing/rest`,r.itemId,me),m={httpMethod:"GET",authentication:s,params:{f:"json"},headers:{Accept:"application/json",Authorization:`Bearer ${s.token}`,"Content-Type":"application/json","X-Esri-Authorization":`Bearer ${s.token}`}};await W(a,m).then(async c=>{let d=JSON.stringify(c),l=w(d,i);if(d!==l){let h=JSON.parse(l),g={id:e,resource:Ie(h,me),name:me,authentication:s,params:{}};await Eo(g)}})}return Z(e,i,s)}function Ks(e,t,o,r){return O.convertItemToTemplate(e,t,o,r)}function pt(e){return!!p(e,"properties.services")}function Kn(e,t="https://survey123.arcgis.com"){let o=`${t}/api/survey/create`,r={credentials:"same-origin",method:"POST",body:wo({f:"json",...e},!0)};return fetch(o,r).then(n=>n.json()).then(n=>{if(!n.success)throw new Error(`Failed to create survey: ${n.error.message}`);return{formId:n.id,featureServiceId:n.featureService.source.itemId,folderId:n.formItemInfo.ownerFolder}})}var Hn=function(t){let o=M(t),r=[["header","content"],["subHeader","content"],["footer","content"],["settings","thankYouScreenContent"]],n=(s,a)=>(s&&s[a]&&(s[a]=encodeURIComponent(s[a])),s);r.forEach(([s,a])=>n(o[s],a));let i=s=>n(s,"description");return o.questions=(o.questions||[]).map(s=>s.questions?{...s,questions:s.questions.map(i)}:i(s)),o};function qn(e,t,o){let{item:{title:r,description:n,tags:i,typeKeywords:s},properties:{form:a}}=e,{user:{username:m},portalBaseUrl:c,organization:{basemapGalleryGroupQuery:d,defaultBasemap:{title:l}}}=t,{token:h}=o.toCredential();return Zo(d,l,o).then(g=>{let P="Survey-",x=Mo(`${P}${r}`,t,"user.folders").replace(P,"");if(a.questions){let T=E=>(E.maps&&(E.maps=E.maps.map(j=>({...j,itemId:g.id}))),E);a.questions=a.questions.map(E=>E.questions?{...E,questions:E.questions.map(T)}:T(E))}let y=Hn(a);return{description:n,form:y,portalUrl:c,tags:i,title:x,token:h,typeKeywords:s,username:m}})}function Jn(e,t,o,r){let n=w(e,t),{survey123Url:i}=t;return qn(n,t,o).then(s=>Kn(s,i)).then(s=>{let{formId:a,featureServiceId:m}=s,c=Promise.resolve(null);return e.item.thumbnail&&(c=Pe({id:a},null,o,e.item.thumbnail)),c.then(()=>C(a,o)).then(d=>(t[n.itemId]={itemId:a},t[n.properties.info.serviceInfo.itemId]={itemId:m},r(n.itemId,u.Finished,n.estimatedDeploymentCostFactor,a),{item:{...e,item:d,itemId:a},id:a,type:"Form",postProcess:!0}))}).catch(s=>{throw r(n.itemId,u.Failed,0),s})}function Hs(e,t,o,r){return pt(e)?Jn(e,t,o,r):O.createItemFromTemplate(e,t,o,r)}async function Qt(e,t){let o=await Ut(e),r=new Date;return r=new Date(r.valueOf()-864e5-r.getTimezoneOffset()*1e3*60),o.forEach(n=>{if(typeof n.content=="string"){let i=ei(n,t);e.file(n.file,i,{date:r})}else n.file.endsWith(".xlsx")&&e.file(n.file,n.content,{date:r})}),Promise.resolve(e)}async function Yt(e,t){return(await Ut(e)).forEach(r=>{if(r.file.endsWith(".info")||r.file.endsWith(".itemInfo")||r.file.endsWith(".json")||r.file.endsWith(".webform")||r.file.endsWith(".xml")){let n=r.content,i=/\b([0-9A-Fa-f]){32}_type/g;n=Qn(n,t,i),n=Zn(n,t,i),n=Yn(n,t),n=Xn(n,t),e.file(r.file,n)}}),Promise.resolve(e)}function Zn(e,t,o){let r=e;return Object.keys(t).filter(i=>i.match(o)&&t[i].type==="Feature Service").forEach(i=>{let s=t[i].url,a=t[s];a&&(r=r.replace(new RegExp(s,"g"),a))}),r}function Qn(e,t,o){let r=e;return Object.keys(t).filter(i=>i.match(o)&&t[i].type!=="Feature Service").map(i=>i.replace("_type","")).forEach(i=>{r=r.replace(new RegExp(i,"g"),`{{${i}.itemId}}`)}),r}function Yn(e,t){let o=e;return t.portalBaseUrl&&(o=o.replace(new RegExp(t.portalBaseUrl,"g"),"{{portalBaseUrl}}")),o}function Xn(e,t){let o=e;return t.workflowBaseUrl&&(o=o.replace(new RegExp(t.workflowBaseUrl,"g"),"{{workflowBaseUrl}}")),o}function ei(e,t){let o=Oo(),r=e.content;return r=w(e.content,t),he(r.match(o)??[]).forEach(i=>{let s=t[i];typeof s?.itemId=="string"&&(r=r.replace(new RegExp(i,"g"),`${s.itemId}`))}),r}function ti(e,t,o,r,n,i,s){let a=r.properties.info.serviceInfo.itemId,{itemId:m}=i[a],c=w(r,i);return C(m,s).then(d=>{let l=[{id:e,title:c.item.title,snippet:c.item.snippet,extent:c.item.extent,culture:c.item.culture},{id:m,extent:c.item.extent,typeKeywords:[`source-${a}`].concat(d.typeKeywords)}],h=P=>z(P,s),g=l.map(h);return Promise.all(g).then(()=>{let P=[e,m],x=T=>K({itemId:T,folderId:i.folderId,authentication:s}),y=P.map(x);return Promise.all(y)}).then(()=>vr(d.ownerFolder,s)).then(()=>{let P=D(d);return n.push(P),r.dependencies.push(d.id),!0})})}async function oi(e,t,o,r,n,i,s){let a=await ge(e,"Form",s);if(a){let m=await At(a),c=await Qt(m,i);rt(c,e,s)}else return await ko(5e3),oi(e,t,o,r,n,i,s);return pt(r)?ti(e,t,o,r,n,i,s):Z(e,i,s)}async function Js(e,t){for(let o of e)if(o.type==="Form"){let r=o.data;if(o.data=null,r){let n=await At(r);n=await Yt(n,t),o.item.name=ri(o.item.name,r.name,`${o.itemId}.zip`);let i=await Ar(n,o.item.name),s=nt(o.itemId,o.item.name,1,ke.data),a={itemId:o.itemId,file:i,folder:s.folder,filename:o.item.name};o.dataFile=a,o.resources.push(s.folder+"/"+s.filename)}}return Promise.resolve(e)}function ri(e,t,o){let r=e||t;return r&&r!=="undefined"?r:o}var eo={};$(eo,{_initializeNewGroup:()=>ni,convertItemToTemplate:()=>Zs,createItemFromTemplate:()=>Qs,postProcess:()=>Ys});function Zs(e,t,o){return new Promise(r=>{let n=Lo(e);n.item.id=_(n.item.id,n.item.id,".itemId"),qo(e.id,o).then(i=>{n.type="Group",Ho(e.id,o).then(s=>{s.id=n.item.id,n.item={...s,type:"Group"},n.dependencies=i.concat(Ao(s.tags)),r(n)},()=>r(n))},()=>r(n))})}function Qs(e,t,o,r){return new Promise(n=>{if(!r(e.itemId,u.Started,0)){r(e.itemId,u.Ignored,0),n(I(e.type));return}let i=M(e);i=w(i,t),i.item.thumbnail=e.item.thumbnail;let s=ni(i.item);Pr(s.title,s,t,o,Ot(i)?t.locationTracking.owner:void 0).then(a=>{if(a.success)if(!r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,a.group.id))r(e.itemId,u.Cancelled,0),Fe(a.group.id,o).then(()=>n(I(e.type)),()=>n(I(e.type)));else if(i.itemId=a.group.id,t[e.itemId]={itemId:a.group.id},i=w(i,t),t[e.itemId].itemId=a.group.id,!r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor/2,a.group.id))r(e.itemId,u.Cancelled,0),Fe(a.group.id,o).then(()=>n(I(e.type)),()=>n(I(e.type)));else if(Ot(i)){let m=t.locationTracking.owner;Fr(a.group.id,m,o).then(c=>{c.success?r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,a.group.id)?kr(a.group.id,[o.username],o).then(d=>{Array.isArray(d.notRemoved)&&d.notRemoved.length===0?r(e.itemId,u.Created,e.estimatedDeploymentCostFactor/2,a.group.id)?n({item:i,id:a.group.id,type:i.type,postProcess:oe(i)}):(r(e.itemId,u.Cancelled,0),Fe(a.group.id,o).then(()=>n(I(e.type)),()=>n(I(e.type)))):(r(e.itemId,u.Failed,0),n(I(e.type)))}):(r(e.itemId,u.Cancelled,0),Fe(a.group.id,o).then(()=>n(I(e.type)),()=>n(I(e.type)))):(r(e.itemId,u.Failed,0),n(I(e.type)))})}else n({item:i,id:a.group.id,type:i.type,postProcess:oe(i)});else r(e.itemId,u.Failed,0),n(I(e.type))},()=>{r(e.itemId,u.Failed,0),n(I(e.type))})})}function Ys(e,t,o,r,n,i,s){let a=Promise.resolve({success:!0});return o.some(m=>{if(m.id===e){let c=m.item.item;return oe(c)&&(c=w(c,i),a=Or(c,s)),!0}}),a}function ni(e){let t={access:"private",description:e.description,owner:e.owner,snippet:e.snippet,tags:e.tags,thumbnail:e.thumbnail,title:e.title||"",typeKeywords:e.typeKeywords};return["autoJoin","displaySettings","isInvitationOnly","isOpenData","isViewOnly","membershipAccess","properties","sortField","sortOrder"].forEach(r=>{e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var Ce={};$(Ce,{convertItemToTemplate:()=>Xs,createItemFromTemplate:()=>ea,isAPage:()=>oa,postProcess:()=>ta});function ii(e,t,o,r){return e=fe(e,o,{}),Dr(e,{...r,allowList:[]}).then(()=>!0)}function lt(e){let t=H(e);return(e.dependencies||[]).forEach(r=>{let n=new RegExp(r,"g"),i=`{{${r}.itemId}}`;t.item=le(t.item,n,i),t.data=le(t.data,n,i),e.properties&&(t.properties=le(t.properties,n,i))}),t}function ut(e,t,o){let r=L(K,{success:!0}),n=[r({itemId:e.item.id,folderId:t,authentication:o})];return V(e,"item.properties.parentInitiativeId")&&n.push(r({itemId:e.item.properties.parentInitiativeId,folderId:t,authentication:o})),Promise.all(n)}function Xs(e,t,o=null){let r=0,n=0;return Promise.all([Ee(e.id,{authentication:t}),ne(t)]).then(([i,s])=>(r=i.item.created,n=i.item.modified,Kr(i,s))).then(i=>(i.item.created=r,i.item.modified=n,i.item.typeKeywords=Ve(i.item.typeKeywords,"doNotDelete"),i.groups=[],i.estimatedDeploymentCostFactor=2,i.resources=[],V(i,"properties")||(i.properties={}),i=lt(i),i))}function ea(e,t,o,r){if(!r(e.itemId,u.Started,0))return Promise.resolve(I(e.type));if(e.assets&&e.resources&&delete e.assets,t.solutionItemExtent){let c=t.solutionItemExtent.split(",");t.organization.defaultExtentBBox=[[c[0],c[1]],[c[2],c[3]]]}let i={},s,a,m=e.item.thumbnail;return ne(o,t).then(c=>(a=c,Hr(e,t,i,a))).then(c=>{let d=c,l={assets:d.assets||[]};return Gr(d,l,a)}).then(c=>(s=c,ut(c,t.folderId,o))).then(()=>{let c={item:{id:s.item.id},params:{thumbnail:m},authentication:o};return ee(c)}).then(()=>{if(t[e.itemId]={itemId:s.item.id},r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor||2,s.item.id)){let d={item:{...e,...te(s)},id:s.item.id,type:e.type,postProcess:!0};return d.item.itemId=s.item.id,d}else return L(jr,{success:!0})(s,a).then(()=>Promise.resolve(I(e.type)))}).catch(c=>{throw r(e.itemId,u.Failed,0),c})}function ta(e,t,o,r,n,i,s){let a;return ne(s).then(m=>(a=m,Ee(e,{authentication:s}))).then(m=>ii(m,o,i,a))}function oa(e){let t=!1;return(e==="Hub Page"||e==="Site Page")&&(t=!0),t}var Ae={};$(Ae,{convertItemToTemplate:()=>ra,createItemFromTemplate:()=>na,isASite:()=>sa,postProcess:()=>ia});function si(e,t,o){let r=t.filter(n=>n.type.indexOf("Page")>-1).map(n=>n.id);return Promise.all(r.map(n=>Ee(n,o))).then(n=>tn(e,n,o))}function ai(e,t,o,r){let n=t.filter(m=>m.id!==e.item.id),i=n.map(m=>({item:{id:m.id,type:m.type}})),s=[];s=s.concat(en(e,i,r)),s=s.concat(si(e,n,r));let a=n.map(m=>m.id);return e.item.properties.children=a,e=Qr(e,o,{}),s.push(qr(e,{...r,allowList:void 0})),Promise.all(s).then(()=>!0)}function ra(e,t,o=null){let r=0,n=0,i,s,a;return ne(t).then(m=>(a=m,bt(e.id,a))).then(m=>(r=m.item.created,n=m.item.modified,i=m.item.title,s=m.data.values.title,Xr(m,a))).then(m=>(m.item.created=r,m.item.modified=n,m.item.title=i,m.item.typeKeywords=Ve(m.item.typeKeywords,"doNotDelete"),m.data.values.title=s,m.groups=[],m.estimatedDeploymentCostFactor=2,m.resources=[],p(m,"properties")||(m.properties={}),m.dependencies=he(m.dependencies),m=lt(m),m))}function na(e,t,o,r){if(!r(e.itemId,u.Started,0))return Promise.resolve(I(e.type));e.assets&&e.resources&&delete e.assets,t.solution||(t.solution={}),t.solution.title=t.title;let i={},s,a,m=e.item.thumbnail;return ne(o,t).then(c=>(a=c,Yr(e,t,i,a))).then(c=>{let d={assets:c.assets||[]};return Zr(c,d,a)}).then(c=>(s=c,ut(c,t.folderId,o))).then(()=>{let c={item:{id:s.item.id},params:{thumbnail:m},authentication:o};return ee(c)}).then(()=>{if(t[e.itemId]={itemId:s.item.id},r(e.itemId,u.Finished,e.estimatedDeploymentCostFactor||2,s.item.id)){let d={item:{...e,...te(s)},id:s.item.id,type:e.type,postProcess:!0};return d.item.itemId=s.item.id,d}else return L(Jr,{success:!0})(s,a).then(()=>Promise.resolve(I(e.type)))}).catch(c=>{throw r(e.itemId,u.Failed,0),c})}function ia(e,t,o,r,n,i,s){let a;return ne(s,i).then(m=>(a=m,bt(e,a))).then(m=>ai(m,o,i,a)).then(()=>Promise.resolve(!0))}function sa(e){let t=!1;return(e==="Hub Site Application"||e==="Site Application")&&(t=!0),t}var ht={};$(ht,{convertItemToTemplate:()=>ca,createItemFromTemplate:()=>da,isAStoryMap:()=>pa});function mi(e={}){let t=0;return Object.keys(e).reduce((o,r)=>(V(e,`${r}.type`)==="webmap"&&r!==`webmap${t}`&&(o.push({original:r,updated:`webmap${t}`}),t++),o),[])}function ci(e){let t=V(e,"data.resources")||{};return Object.keys(t).reduce((o,r)=>(V(t,`${r}.type`)==="webmap"&&o.push(V(t,`${r}.data.itemId`)),o),[])}function pi(e){let t=Qe(e.item.id,e.item.type);t.key=`${je(e.item.title)}_${Be("i")}`;let o=H(e);t.data=o.data;let r=o.item.created,n=o.item.modified;return t.item=Ge(o.item),t.item.created=r,t.item.modified=n,t.item.url="{{storyMapTemplateUrl}}",mi(t.data.resources).forEach(a=>{t.data.resources[a.updated]=H(t.data.resources[a.original]),delete t.data.resources[a.original],t.data.nodes=le(t.data.nodes,a.original,a.updated)}),t.item.typeKeywords.indexOf(di)!==-1&&(t.item.typeKeywords=[aa].concat(t.item.typeKeywords.filter(a=>a!==di))),t.properties={},t.properties.draftFileName="draft_{{timestamp}}.json",Object.assign(t.properties,ma),t.dependencies=ci(e),Promise.resolve(t)}var di="smstatusunpublishedchanges",aa="smstatuspublished",ma={oembed:{version:"1.0",type:"rich",title:"Example StoryMap",url:"{{storyMapTemplateUrl}}",provider_name:"ArcGIS StoryMaps",provider_url:"{{storyMapBaseUrl}}",width:800,height:600,thumbnail_url:"{{storyMapThumbnailUrl}}",thumbnail_height:"100.5",thumbnail_width:"400",html:'<iframe src="{{storyMapTemplateUrl}}" width="800" height="600" scrolling="yes" frameborder="0" allowfullscreen></iframe>',cache_age:86400},oembedXML:`<?xml version="1.0" encoding="utf-8" standalone="yes"?>
3
3
  <oembed>
4
4
  <version>1.0</version>
5
5
  <type>rich</type>