@esri/solutions-components 0.11.23 → 0.11.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +6 -6
- package/dist/cjs/buffer-tools_2.cjs.entry.js +1 -1
- package/dist/cjs/card-manager_3.cjs.entry.js +3 -3
- package/dist/cjs/consent-manager.cjs.entry.js +1 -1
- package/dist/cjs/create-feature_4.cjs.entry.js +6 -6
- package/dist/cjs/create-related-feature_3.cjs.entry.js +7 -7
- package/dist/cjs/crowdsource-manager.cjs.entry.js +1 -1
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +1 -1
- package/dist/cjs/deduct-calculator.cjs.entry.js +1 -1
- package/dist/cjs/delete-dialog.cjs.entry.js +1 -1
- package/dist/cjs/feature-list.cjs.entry.js +4 -4
- package/dist/cjs/json-editor_7.cjs.entry.js +7 -7
- package/dist/cjs/map-layer-picker.cjs.entry.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
- package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +3 -3
- package/dist/cjs/solution-contents_3.cjs.entry.js +3 -3
- package/dist/cjs/solution-item-accordion.cjs.entry.js +1 -1
- package/dist/cjs/solution-item-icon.cjs.entry.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
- package/dist/collection/assets/t9n/layer-table/resources.json +4 -1
- package/dist/collection/assets/t9n/layer-table/resources_en.json +4 -1
- package/dist/collection/components/consent-manager/consent-manager.js +1 -1
- package/dist/collection/components/create-feature/create-feature.js +2 -2
- package/dist/collection/components/create-related-feature/create-related-feature.js +1 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +1 -1
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +1 -1
- package/dist/collection/components/deduct-calculator/deduct-calculator.js +1 -1
- package/dist/collection/components/delete-button/delete-button.js +1 -1
- package/dist/collection/components/delete-dialog/delete-dialog.js +1 -1
- package/dist/collection/components/edit-card/edit-card.js +1 -1
- package/dist/collection/components/feature-details/feature-details.js +6 -6
- package/dist/collection/components/feature-list/feature-list.js +4 -4
- package/dist/collection/components/floor-filter/floor-filter.js +1 -1
- package/dist/collection/components/info-card/info-card.js +2 -2
- package/dist/collection/components/json-editor/json-editor.js +1 -1
- package/dist/collection/components/layer-table/layer-table.js +2 -2
- package/dist/collection/components/map-card/map-card.js +1 -1
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
- package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
- package/dist/collection/components/map-legend/map-legend.js +1 -1
- package/dist/collection/components/map-picker/map-picker.js +1 -1
- package/dist/collection/components/map-search/map-search.js +1 -1
- package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
- package/dist/collection/components/map-tools/map-tools.js +1 -1
- package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
- package/dist/collection/components/pdf-download/pdf-download.js +1 -1
- package/dist/collection/components/public-notification/public-notification.js +1 -1
- package/dist/collection/components/refine-selection/refine-selection.js +1 -1
- package/dist/collection/components/solution-configuration/solution-configuration.js +3 -3
- package/dist/collection/components/solution-contents/solution-contents.js +1 -1
- package/dist/collection/components/solution-item/solution-item.js +1 -1
- package/dist/collection/components/solution-item-accordion/solution-item-accordion.js +1 -1
- package/dist/collection/components/solution-item-details/solution-item-details.js +1 -1
- package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
- package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
- package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -1
- package/dist/collection/components/solution-resource-item/solution-resource-item.js +1 -1
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +1 -1
- package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
- package/dist/collection/components/solution-variables/solution-variables.js +1 -1
- package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
- package/dist/components/consent-manager.js +1 -1
- package/dist/components/create-feature2.js +2 -2
- package/dist/components/create-related-feature2.js +1 -1
- package/dist/components/crowdsource-manager.js +1 -1
- package/dist/components/crowdsource-reporter.js +1 -1
- package/dist/components/deduct-calculator2.js +1 -1
- package/dist/components/delete-button2.js +1 -1
- package/dist/components/delete-dialog2.js +1 -1
- package/dist/components/edit-card2.js +1 -1
- package/dist/components/feature-details2.js +6 -6
- package/dist/components/feature-list2.js +4 -4
- package/dist/components/floor-filter2.js +1 -1
- package/dist/components/info-card2.js +2 -2
- package/dist/components/json-editor2.js +1 -1
- package/dist/components/layer-table2.js +2 -2
- package/dist/components/map-card2.js +1 -1
- package/dist/components/map-draw-tools2.js +1 -1
- package/dist/components/map-fullscreen2.js +1 -1
- package/dist/components/map-layer-picker2.js +1 -1
- package/dist/components/map-legend2.js +1 -1
- package/dist/components/map-picker2.js +1 -1
- package/dist/components/map-search2.js +1 -1
- package/dist/components/map-select-tools2.js +1 -1
- package/dist/components/map-tools2.js +1 -1
- package/dist/components/pci-calculator.js +1 -1
- package/dist/components/pdf-download2.js +1 -1
- package/dist/components/public-notification.js +1 -1
- package/dist/components/refine-selection2.js +1 -1
- package/dist/components/solution-configuration.js +3 -3
- package/dist/components/solution-contents2.js +1 -1
- package/dist/components/solution-item-accordion.js +1 -1
- package/dist/components/solution-item-details2.js +1 -1
- package/dist/components/solution-item-icon2.js +1 -1
- package/dist/components/solution-item-sharing2.js +1 -1
- package/dist/components/solution-item2.js +1 -1
- package/dist/components/solution-organization-variables2.js +1 -1
- package/dist/components/solution-resource-item2.js +1 -1
- package/dist/components/solution-spatial-ref2.js +1 -1
- package/dist/components/solution-template-data2.js +1 -1
- package/dist/components/solution-variables2.js +1 -1
- package/dist/components/spatial-ref.js +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +6 -6
- package/dist/esm/buffer-tools_2.entry.js +1 -1
- package/dist/esm/card-manager_3.entry.js +3 -3
- package/dist/esm/consent-manager.entry.js +1 -1
- package/dist/esm/create-feature_4.entry.js +6 -6
- package/dist/esm/create-related-feature_3.entry.js +7 -7
- package/dist/esm/crowdsource-manager.entry.js +1 -1
- package/dist/esm/crowdsource-reporter.entry.js +1 -1
- package/dist/esm/deduct-calculator.entry.js +1 -1
- package/dist/esm/delete-dialog.entry.js +1 -1
- package/dist/esm/feature-list.entry.js +4 -4
- package/dist/esm/json-editor_7.entry.js +7 -7
- package/dist/esm/map-layer-picker.entry.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +3 -3
- package/dist/esm/pci-calculator.entry.js +1 -1
- package/dist/esm/public-notification.entry.js +1 -1
- package/dist/esm/solution-configuration.entry.js +3 -3
- package/dist/esm/solution-contents_3.entry.js +3 -3
- package/dist/esm/solution-item-accordion.entry.js +1 -1
- package/dist/esm/solution-item-icon.entry.js +1 -1
- package/dist/esm/spatial-ref.entry.js +1 -1
- package/dist/solutions-components/assets/t9n/layer-table/resources.json +4 -1
- package/dist/solutions-components/assets/t9n/layer-table/resources_en.json +4 -1
- package/dist/solutions-components/{p-7e233b70.entry.js → p-0bc11bac.entry.js} +1 -1
- package/dist/solutions-components/{p-e3e35c14.entry.js → p-0efb117f.entry.js} +1 -1
- package/dist/solutions-components/{p-2507c685.entry.js → p-12f91837.entry.js} +1 -1
- package/dist/solutions-components/{p-b5a102db.entry.js → p-16c5c285.entry.js} +1 -1
- package/dist/solutions-components/{p-99e00361.entry.js → p-1dc077ec.entry.js} +1 -1
- package/dist/solutions-components/{p-5e4e0f84.entry.js → p-281cc2b2.entry.js} +1 -1
- package/dist/solutions-components/{p-b636a8b4.entry.js → p-48ff9d90.entry.js} +1 -1
- package/dist/solutions-components/{p-832707fd.entry.js → p-505a2880.entry.js} +1 -1
- package/dist/solutions-components/{p-72d04c7a.entry.js → p-70fbbe26.entry.js} +1 -1
- package/dist/solutions-components/{p-837e0939.entry.js → p-7b9f3c85.entry.js} +1 -1
- package/dist/solutions-components/{p-a415a60d.entry.js → p-84976ab1.entry.js} +1 -1
- package/dist/solutions-components/{p-698656b8.entry.js → p-8ef447cc.entry.js} +1 -1
- package/dist/solutions-components/{p-ed1ecb5b.entry.js → p-922e704c.entry.js} +1 -1
- package/dist/solutions-components/p-a2e356f8.entry.js +6 -0
- package/dist/solutions-components/{p-6d20da19.entry.js → p-a9b81651.entry.js} +1 -1
- package/dist/solutions-components/{p-386b0163.entry.js → p-abcdbba6.entry.js} +1 -1
- package/dist/solutions-components/{p-09041307.entry.js → p-c117b7f7.entry.js} +1 -1
- package/dist/solutions-components/{p-a5eaf7fe.entry.js → p-df018eb2.entry.js} +1 -1
- package/dist/solutions-components/{p-ee3bb943.entry.js → p-e806feda.entry.js} +1 -1
- package/dist/solutions-components/{p-244316dd.entry.js → p-e8df7a70.entry.js} +1 -1
- package/dist/solutions-components/{p-0326f1f4.entry.js → p-fd106abf.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/solutions-components_commit.txt +6 -6
- package/package.json +1 -1
- package/dist/solutions-components/p-541eb93a.entry.js +0 -6
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as e,g as a,h as r,a as t}from"./p-e996c38f.js";const s=class{constructor(a){e(this,a),this.isPortal=!1,this.type="",this.typeKeywords=[]}get el(){return a(this)}render(){return r("div",{key:"
|
6
|
+
import{r as e,g as a,h as r,a as t}from"./p-e996c38f.js";const s=class{constructor(a){e(this,a),this.isPortal=!1,this.type="",this.typeKeywords=[]}get el(){return a(this)}render(){return r("div",{key:"1592a8aa86ffa30c0a1ce919d9839cdfa0c39782",title:this.type},r("img",{key:"b6eda446f08661d277b307cb15d989b86641cbc9",class:"item-type-icon item-type-icon-margin",height:"16",src:this._getIconUrl(this.type,this.typeKeywords),width:"16"}))}_getIconUrl(e,a){const r=this._getItemIcon(e,a);return t("group"===r?`./item-icons/${r}16.png`:`./item-icons/${r}16.svg`)}_getItemIcon(e,a){const r=e.toLowerCase(),t=a||[],s=t.includes("Hosted Service");switch(r.trim()){case"360 vr experience":return"360vr";case"3dtiles package":return"3dtileslayerpackage";case"3dtiles service":return t.includes("3DObject")?"3dobjecttileslayer":t.includes("IntegratedMesh")?"integratedmeshtileslayer":"3dobjecttileslayer";case"feature service":case"feature collection":case"kml":case"wfs":if(t.includes("IndoorPositioningDataService"))return"indoorpositioningdataservice";const e=t.includes("Spatiotemporal");return t.includes("Table")?e?"spatiotemporaltable":"table":t.includes("Route Layer")?"routelayer":t.includes("Markup")?"markup":e?"spatiotemporal":t.includes("UtilityNetwork")?"utilitynetwork":s?"featureshosted":"features";case"group":return"group";case"group layer":return t.includes("Map")?"layergroup2d":t.includes("Scene")?"layergroup3d":"layergroup";case"wmts":return"maptiles";case"map service":case"wms":return s||t.includes("Tiled")?"maptiles":"mapimages";case"scene service":return t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer";case"image service":return t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery";case"stream service":return"streamlayer";case"video service":return t.includes("Live Stream")?"livestreamvideolayer":"mediaservice";case"vector tile service":return"vectortile";case"datastore catalog service":return"datastorecollection";case"geocoding service":return"geocodeservice";case"geoprocessing service":return t.includes("Web Tool")?"tool":"layers";case"geodata service":return"geodataservice";case"web map":case"cityengine web scene":return"maps";case"web scene":return t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal";case"application":case"web mapping application":case"mobile application":case"operation view":case"desktop application":return t.includes("configurableApp")?"instantapps":"apps";case"map document":case"map package":case"published map":case"scene document":case"globe document":case"basemap package":case"mobile basemap package":case"mobile map package":case"project package":case"project template":case"pro map":case"layout":return"mapsgray";case"layer":if(t.includes("ArcGIS Pro"))return"mapsgray";case"explorer map":if(t.indexOf("Explorer Document"))return"mapsgray";if(t.includes("Explorer Mapping Application"))return"datafilesgray";case"pro presentation":return"propresentation";case"api key":return"key";case"csv":return"csv";case"shapefile":return"shapefile";case"csv collection":return"csvcollection";case"media layer":return"medialayer";case"microsoft excel":return"excel";case"microsoft powerpoint":return"powerpoint";case"microsoft word":return"word";case"pdf":return"pdf";case"sqlite geodatabase":return"sqlite";case"administrative report":return"report";case"image":return"image";case"cad drawing":return"cad";case"service definition":case"geojson":case"360 vr experience":case"netcdf":return"data";case"explorer add in":case"desktop add in":case"windows viewer add in":case"windows viewer configuration":return"appsgray";case"arcgis pro add in":case"arcgis pro configuration":return"addindesktop";case"rule package":case"file geodatabase":case"kml collection":case"windows mobile package":case"map template":case"desktop application template":case"gml":case"arcpad package":case"code sample":case"document link":case"earth configuration":case"operations dashboard add in":case"rules package":case"workflow manager package":return"datafilesgray";case"form":return t.includes("Survey123")?"survey":"datafilesgray";case"network analysis service":case"geoprocessing service":case"geodata service":case"geometry service":case"geoprocessing package":case"locator package":case"geoprocessing sample":case"workflow manager service":return"toolsgray";case"layer":case"layer package":case"explorer layer":return"layersgray";case"scene package":return"scenepackage";case"mobile scene package":return"mobilescenepackage";case"tile package":case"compact tile package":return"tilepackage";case"task file":return"taskfile";case"report template":return"reporttemplate";case"statistical data collection":return"statisticaldatacollection";case"analysis model":return"geoprocessingmodel";case"insights workbook":return"workbook";case"insights model":return"insightsmodel";case"insights page":return"insightspage";case"insights theme":return"insightstheme";case"hub initiative":return"hubinitiative";case"hub page":return"hubpage";case"hub event":return"hubevent";case"hub site application":return"hubsite";case"hub project":return"hubproject";case"relational database connection":return"relationaldatabaseconnection";case"image":return"image";case"image collection":return"imagecollection";case"style":return t.includes("Dictionary")?"dictionarystyle":"style";case"desktop style":return"desktopstyle";case"dashboard":return"dashboard";case"raster function template":return"rasterprocessingtemplate";case"vector tile package":return"vectortilepackage";case"ortho mapping project":return"orthomappingproject";case"ortho mapping template":return"orthomappingtemplate";case"solution":return"solutions";case"geopackage":return"geopackage";case"deep learning package":return"deeplearningpackage";case"real time analytic":return"realtimeanalytics";case"big data analytic":return"bigdataanalytics";case"feed":return"feed";case"excalibur imagery project":return"excaliburimageryproject";case"notebook":return"notebook";case"reality mapping project":return"realitymappingproject";case"storymap":return t.includes("storymaptemplate")?"storymapstemplate":t.includes("storymapcollection")?"storymapcollection":t.includes("storymapbriefing")?"storymapbriefing":"storymap";case"survey123 add in":return"survey123addin";case"mission":return"mission";case"mission report":return"missionreport";case"quickcapture project":return"quickcaptureproject";case"pro report":return"proreport";case"urban model":return"urbanmodel";case"urban project":return"urbanproject";case"web experience":return"experiencebuilder";case"web experience template":return"webexperiencetemplate";case"experience builder widget":return"experiencebuilderwidget";case"experience builder widget package":return"experiencebuilderwidgetpackage";case"workflow":return"workflow";case"insights script":return"insightsscript";case"kernel gateway connection":return"kernelgatewayconnection";case"hub initiative template":return"hubinitiativetemplate";case"storymap theme":return"storymaptheme";case"knowledge graph":return"knowledgegraph";case"knowledge studio project":return"knowledgestudio";case"knowledge graph layer":return"knowledgegraphlayer";case"native application":return"nativeapp";case"native application installer":return"nativeappinstaller";case"web link chart":return"linkchart";case"knowledge graph web investigation":return"investigation";case"ogcfeatureserver":return"features";case"pro project":return"proproject";case"insights workbook package":return"insightsworkbookpackage";case"apache parquet":return"apacheparquet";case"notebook code snippets":case"notebook code snippet library":return"notebookcodesnippets";case"suitability model":return"suitabilitymodel";case"esri classifier definition":return"classifierdefinition";case"esri classification schema":return"classificationschema";case"insights data engineering workbook":return"dataengineeringworkbook";case"insights data engineering model":return"dataengineeringmodel";case"deep learning studio project":return"deeplearningproject";case"data store":return"datastore";case"data pipeline":return"datapipeline";default:return t.includes("Document")?"datafilesgray":r.includes("service")?"layers":"maps"}}static get assetsDirs(){return["item-icons"]}};s.style=".item-type-icon{pointer-events:none;display:block;height:1rem;margin-top:0.15em !important;min-width:16px;fill:currentColor;transform:rotate(360deg)}.item-type-icon-margin{margin-inline-end:0.375rem}";export{s as solution_item_icon}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as e,g as a,h as i,H as t}from"./p-e996c38f.js";import{c as l}from"./p-747d4b59.js";const s=class{constructor(a){e(this,a),this.showAddDeduct=!1}get el(){return a(this)}_deductValuesElement;render(){const e=this.showAddDeduct?"position-relative":"display-none";return i(t,{key:"
|
6
|
+
import{r as e,g as a,h as i,H as t}from"./p-e996c38f.js";import{c as l}from"./p-747d4b59.js";const s=class{constructor(a){e(this,a),this.showAddDeduct=!1}get el(){return a(this)}_deductValuesElement;render(){const e=this.showAddDeduct?"position-relative":"display-none";return i(t,{key:"4f333fa9aecd33cf2b34d85802c79256073f940c"},i("div",{key:"6946f22e384fac51a20e2efb7b4ddbf2de7517ed",class:this.showAddDeduct?"display-none":"display-grid"},i("div",{key:"e30e88571eb1b89588798d51ba788e4b6dc7d269",class:"label-display"},i("calcite-label",{key:"034582e553ac4191939095cec8d836bc567ea77e",class:"label-display"},"Enter comma delimited deduct values",this._getDeductValuesInput())),i("div",{key:"7fc1ae8d901b0a1ce820e53e225b275f1d779eb6"},this._getCalculateButton())),i("div",{key:"b74849f5007f54d3019be5e18a85769186edfffa",class:e},i("div",{key:"ae8bf9314b0ead0b3f9d220d81cc410c2a29dc6f",class:"position-right"},i("calcite-action",{key:"cac38dc7e539275a0baeb0511fb8a09e8f96fa7a",appearance:"transparent",class:"float-end",icon:"x",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""})),i("deduct-calculator",{key:"68bcd78e3ef4505e5b1e5f0ea76d15f9e00fc18d",class:"display-grid padding-top-1",onDeductValueComplete:e=>this._addDeductValue(e)})))}_getDeductValuesInput(){return i("div",{class:"display-flex"},i("calcite-input",{class:"main-input",ref:e=>{this._deductValuesElement=e}}),i("calcite-action",{appearance:"transparent",icon:"plus-circle",onClick:()=>this._toggleShowAddDeduct(),scale:"s",text:""}))}_getCalculateButton(){return i("calcite-button",{onClick:()=>this._calculatePCI(this._deductValuesElement.value)},"Calculate PCI")}_toggleShowAddDeduct(){this.showAddDeduct=!this.showAddDeduct}_addDeductValue(e){this._toggleShowAddDeduct(),this._deductValuesElement.value+=Math.abs(parseFloat(this._deductValuesElement.value))>0?`,${e.detail}`:e.detail}_calculatePCI(e){const a=l(e,!0),i=a<=10?"Failed":a<=25?"Serious":a<=40?"Very Poor":a<=55?"Poor":a<=70?"Fair":a<=85?"Satisfactory":"Good";console.log(`PCI: ${a}`),console.log(`Rating: ${i}`),alert("See debug console for results")}};s.style=":host{display:block;--calcite-label-margin-bottom:0}.label-display{display:block;padding-bottom:1rem}.display-flex{display:flex}.display-grid{display:grid}.display-table{display:table}.display-inline-table{display:inline-table}.display-none{display:none}.display-inherit{display:inherit}.padding-top-1{padding-top:1rem}.main-input{width:300px;padding-inline-end:1rem}.float-end{float:inline-end}.position-relative{position:relative}.position-right{position:absolute;right:0px}";export{s as pci_calculator}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,g as i,h as s,H as e,c as a}from"./p-e996c38f.js";import{l as h,g as n}from"./p-404cbf48.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const o=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}get el(){return i(this)}BasemapGallery;PortalBasemapsSource;_basemapElement;async basemapConfigWatchHandler(){if(this.basemapWidget?.source){const t=this.basemapWidget?.source;t.query=this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,await t.refresh()}}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"cc7e423a47742c0f5c3a5023b77157af09e56433"},s("div",{key:"9b41466e49c93e533f1d2a621707c5189c5092b3",ref:t=>{this._basemapElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t,i]=await h(["esri/widgets/BasemapGallery","esri/widgets/BasemapGallery/support/PortalBasemapsSource"]);this.BasemapGallery=t,this.PortalBasemapsSource=i}async _initBaseMapGallery(t){if(this.BasemapGallery){this.basemapWidget&&this.basemapWidget.destroy();const i=new this.PortalBasemapsSource({query:this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await i.refresh(),this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:i})}}static get watchers(){return{basemapConfig:["basemapConfigWatchHandler"],mapView:["mapViewWatchHandler"]}}};o.style=":host{display:block}";const c=class{constructor(i){t(this,i),this.facilityChanged=a(this,"facilityChanged",7),this.levelChanged=a(this,"levelChanged",7),this.siteChanged=a(this,"siteChanged",7),this.enabled=void 0,this.floorFilterWidget=void 0,this.mapView=void 0}get el(){return i(this)}FloorFilter;_floorFilterElement;reactiveUtils;_facilityHandle;_levelHandle;_siteHandle;async mapViewWatchHandler(){await this._initFloorFilter(this.mapView)}async enabledWatchHandler(){this.enabled?await this._initFloorFilter(this.mapView):this.enabled||this._destroyWidget()}facilityChanged;levelChanged;siteChanged;async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"b2ba7504abbc8621f2ad4f561920f2125181350d"},s("div",{key:"1df2a06b4b99ba0ece38ca3d91b622ce9b692c4a",ref:t=>{this._floorFilterElement=t}}))}async componentDidLoad(){this.mapView&&!this.floorFilterWidget&&await this._initFloorFilter(this.mapView)}async _initModules(){const[t,i]=await h(["esri/widgets/FloorFilter","esri/core/reactiveUtils"]);this.FloorFilter=t,this.reactiveUtils=i}_destroyWidget(){this.floorFilterWidget&&(this.floorFilterWidget.destroy(),this.floorFilterWidget=void 0),this._floorFilterElement&&this._floorFilterElement.remove()}_initContainer(){this._destroyWidget(),this._floorFilterElement=document.createElement("div")}async _initFloorFilter(t){const i=t?.map;await i.when((()=>{t&&this.enabled&&this.FloorFilter&&i?.floorInfo&&(this._initContainer(),this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}),this._facilityHandle?.remove(),this._facilityHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.facility),(t=>{this.facilityChanged.emit(t)})),this._levelHandle?.remove(),this._levelHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.level),(t=>{this.levelChanged.emit(t)})),this._siteHandle?.remove(),this._siteHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.site),(t=>{this.siteChanged.emit(t)})))}))}static get watchers(){return{mapView:["mapViewWatchHandler"],enabled:["enabledWatchHandler"]}}};c.style=":host{display:block}";const r=class{constructor(i){t(this,i),this.fullscreenStateChange=a(this,"fullscreenStateChange",7),this.mapView=void 0,this.fullscreenWidget=void 0}Fullscreen;_fullscreenElement;_fullscreenStateChangeHandle;reactiveUtils;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}fullscreenStateChange;async componentWillLoad(){await this._initModules()}render(){return s(e,{key:"50488298d31b85071bb8ec898781b8af52a800ae"},s("div",{key:"24b4c28cd69ce487c851412a839f6762ceaf02b1",class:"fullscreen-widget",ref:t=>{this._fullscreenElement=t}}))}async componentDidUpdate(){await this._initFullscreenWidget()}async componentDidLoad(){await this._initFullscreenWidget()}async _initModules(){const[t,i]=await h(["esri/widgets/Fullscreen","esri/core/reactiveUtils"]);this.Fullscreen=t,this.reactiveUtils=i}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement&&!this.fullscreenWidget?(this.fullscreenWidget=new this.Fullscreen({view:this.mapView}),await this.fullscreenWidget.when((()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=this.reactiveUtils.watch((()=>this.fullscreenWidget.viewModel.state),(t=>this.fullscreenStateChange.emit(t)))}))):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};r.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}get el(){return i(this)}Legend;_legendElement;async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"60b355f71d25b3c683f6218941e342899006d839"},s("div",{key:"7686d302e16fd42cd26777d14c682dc0e951c058",ref:t=>{this._legendElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t]=await h(["esri/widgets/Legend"]);this.Legend=t}_initLegend(t){t&&this.Legend&&(this.legendWidget?this.legendWidget.view=t:this.legendWidget=new this.Legend({container:this._legendElement,respectLayerDefinitionExpression:!0,view:t}))}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};l.style=":host{display:block}";const d=class{constructor(i){t(this,i),this.beforeMapInfoChange=a(this,"beforeMapInfoChange",7),this.mapInfoChange=a(this,"mapInfoChange",7),this.locale=void 0,this.mapInfos=[],this.isMapLayout=void 0,this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}get el(){return i(this)}_list;_loadedId="";_skipEditCheck=!1;_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=t?.id,this.mapInfoChange.emit(t))}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t,i=!1){this._skipEditCheck=i;const s=this.mapInfos?.filter((i=>i.id===t));t&&s?.length>0&&this._webMapSelected(s[0]),this._skipEditCheck=!1}async close(){this._mapListExpanded&&(this._mapListExpanded=!1)}async toggle(t){this._mapListExpanded=t}beforeMapInfoChange;mapInfoChange;async componentWillLoad(){await this._getTranslations()}render(){return s(e,{key:"a16cef5d3d16de605f51ce77450365e8c7f5ba08"},this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){const t="map-picker-expand-toggle";return s("div",{class:"width-full"},s("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",iconStart:"map",id:t,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},this._webMapInfo?.name),s("calcite-tooltip",{placement:"bottom","reference-element":t},s("span",null,this._translations.switchMap)))}_getToolbar(){return s("div",{class:"display-flex border-right"},s("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return s("div",{class:t?"map-list border-bottom-1 adjusted-height "+(this.isMapLayout?"width-26":"width-full"):"display-none"},s("calcite-list",{id:"mapList",label:"",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>s("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){const i=this._loadedId;this._loadedId=t.id,this._skipEditCheck?this._webMapInfo=t:this.beforeMapInfoChange.emit({currentId:i,mapInfo:t,ref:this.el}).defaultPrevented||(this._webMapInfo=t),this._mapListExpanded=!1}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],locale:["localeWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};d.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100%}.width-26{width:26% !important}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.border-right{border-right:1px solid var(--calcite-color-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-color-background);z-index:1000;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}.align-center{align-items:center}.adjusted-height{max-height:calc(100% - 52px);overflow-y:auto}";const p=class{constructor(i){t(this,i),this.mapView=void 0,this.popupEnabled=!1,this.resultGraphicEnabled=!1,this.searchConfiguration=void 0,this.searchTerm=void 0,this.searchWidget=void 0}FeatureLayer;Search;_searchElement;_searchResult;async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return s(e,{key:"fec180c41817a6388f5fdb3f14b72355cbbb1467"},s("div",{key:"72b3931995d7157572d54069e73fb6bd95eb6f44",class:"search-widget",ref:t=>{this._searchElement=t}}))}async _initModules(){const[t,i]=await h(["esri/widgets/Search","esri/layers/FeatureLayer"]);this.Search=t,this.FeatureLayer=i}_initSearchWidget(){if(this.mapView&&this._searchElement&&!this.searchWidget){let t={view:this.mapView,container:this._searchElement,searchTerm:this.searchTerm};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this.mapView)}),this.searchWidget=new this.Search(t),this.searchWidget.popupEnabled=this.popupEnabled,this.searchWidget.resultGraphicEnabled=this.resultGraphicEnabled}else this.searchWidget&&(this.searchWidget.view=this.mapView)}_getSearchConfig(t,i){const s=t.sources;return s?.length>0?(t.includeDefaultSources=!1,s.forEach((t=>{if(t.hasOwnProperty("layer")){const s=t,e=s.layer?.id,a=e?i.map.findLayerById(e):null,h=s?.layer?.url;a?s.layer=a:h&&(s.layer=new this.FeatureLayer(h))}})),s?.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===i?.name&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t={...t,includeDefaultSources:!0},t}static get watchers(){return{searchConfiguration:["watchSearchConfigurationHandler"],mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}";const m=class{constructor(i){t(this,i),this.basemapConfig=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.enableHome=void 0,this.enableSingleExpand=void 0,this.homeZoomToolsSize="m",this.layout="vertical",this.locale=void 0,this.mapView=void 0,this.mapWidgetsSize="m",this.position="top-right",this.searchConfiguration=void 0,this.stackTools=!0,this.toolOrder=void 0,this._hasFloorInfo=!1,this._translations=void 0,this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showFullscreen=!1,this._showLegendWidget=!1,this._showSearchWidget=!1}get el(){return i(this)}Expand;_basemapElement;_floorFilterElement;_fullscreenElement;_legendElement;_searchElement;_widgets=[];async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._hasFloorInfo=this.mapView?.map?.floorInfo}))}async _showBasemapWidgetWatchHandler(t){t?this.mapView.ui.add(this._basemapElement.basemapWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._basemapElement.basemapWidget)}async _showFloorFilterWatchHandler(t){const i=this._floorFilterElement.floorFilterWidget;t?this.mapView.ui.add(i,{position:this.position,index:1}):this.mapView.ui.remove(i)}async _showFullscreenWatchHandler(t){const i=this._fullscreenElement.fullscreenWidget;t?"ready"===i.viewModel.state&&i.viewModel.enter():"active"===i.viewModel.state&&i.viewModel.exit()}async _showLegendWidgetWatchHandler(t){t?this.mapView.ui.add(this._legendElement.legendWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._legendElement.legendWidget)}async _showSearchWidgetWatchHandler(t){t?this.mapView.ui.add(this._searchElement.searchWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._searchElement.searchWidget)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){this._setZoomToolsSize();const t=this._showTools?"":"display-none",i=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",n=this._showFloorFilter?"":"display-none",o=this._showFullscreen?"":"display-none",c=this.enableSingleExpand?"margin-top-1-2":"",r=this.toolOrder?this.toolOrder:["legend","search","fullscreen","floorfilter"],l=this.stackTools?"box-shadow":"";return s(e,{key:"4630a876708781097e02cf1aa94a3f77e30c0fee"},s("div",{key:"28be602bad246ef82214f3724aaf5f8480473456",class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},this.enableSingleExpand?s("div",{class:"box-shadow"},this._getActionGroup(this._showTools?"chevrons-up":"chevrons-down",!1,this._showTools?this._translations.collapse:this._translations.expand,(()=>this._toggleTools()))):void 0,s("div",{key:"25694e233efe5b917f0a4b25cc4c707c0584cae4",class:`${c} ${l} ${t}`},this._getMapWidgets(r))),s("basemap-gallery",{key:"db1c9cd3e1851957f9be86d43dc94355f6894a26",basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),s("map-search",{key:"558c28360b5e295a886becff4a07c5ec3d22c570",class:i,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),s("map-legend",{key:"8e9a8c3e0619773b10ed51543717c2c63d7caa7a",class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),s("map-fullscreen",{key:"0fba4904ba25f4122e57dc77f3bc64f2bd59d7c1",class:o,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),s("floor-filter",{key:"696d3bc16a3464770e96a45af8224537550c90a2",class:n,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/Expand"]);this.Expand=t}_setZoomToolsSize(){const t=document.getElementsByClassName("esri-zoom")[0]?.children[0],i=document.getElementsByClassName("esri-zoom")[0]?.children[1];if(t&&i){const s="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";t.style.width=s,t.style.height=s,i.style.width=s,i.style.height=s}}_getMapWidgets(t){const i=this._showFullscreen?"full-screen-exit":"full-screen",s=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return t.map((t=>{switch(t){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):this.enableLegend?this._getWidget(t,this._legendElement?.legendWidget,!0):void 0;case"search":return this.enableSearch&&this.enableSingleExpand?this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())):this.enableSearch?this._getWidget(t,this._searchElement?.searchWidget,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getActionGroup(i,!1,s,(()=>this._expand())):this.enableFullscreen?this._getWidget(t,this._fullscreenElement?.fullscreenWidget,!1):void 0;case"basemap":return this.enableBasemap&&this.enableSingleExpand?this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())):this.enableBasemap?this._getWidget(t,this._basemapElement?.basemapWidget,!0):void 0;case"floorfilter":return this.enableFloorFilter&&this._hasFloorInfo&&this.enableSingleExpand?this._getActionGroup("urban-model",!1,this._translations.floorFilter,(()=>this._toggleFloorFilter())):this.enableFloorFilter&&this._hasFloorInfo?this._getWidget(t,this._floorFilterElement?.floorFilterWidget,!0):void 0}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,i,e,a){return s("div",null,s("calcite-action",{alignment:"center",class:`${"s"===this.mapWidgetsSize?"square-32":"m"===this.mapWidgetsSize?"square-40":"square-48"} ${this.stackTools?"":"margin-bottom-1-2"} border-bottom ${this.stackTools?"":"box-shadow"}`,disabled:i,icon:t,id:t,onClick:a,scale:"s",text:""},s("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),s("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},s("span",null,e)))}_getWidget(t,i,s){if(this._widgets.indexOf(t)<0&&this.mapView&&i){const e=this.toolOrder.indexOf(t),a=new this.Expand({view:this.mapView,content:i});this.mapView.ui.add(s?a:i,{position:this.position,index:e>-1?e+(this.enableHome?2:1):1}),this._widgets.push(t)}}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1}_expand(){this._showFullscreen=!this._showFullscreen}_toggleTools(){this._showTools||(this._showBasemapWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._showTools=!this._showTools}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};m.style=":host{display:block}.display-none{display:none}.margin-top-1-2{margin-top:0.5rem}.square-32{width:32px;height:32px}.square-40{width:40px;height:40px}.square-48{width:48px;height:48px}.width-40{width:40px}.square-40-41{width:40px;height:41px}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.box-shadow{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.margin-bottom-1-2{margin-bottom:0.5rem}";export{o as basemap_gallery,c as floor_filter,r as map_fullscreen,l as map_legend,d as map_picker,p as map_search,m as map_tools}
|
6
|
+
import{r as t,g as i,h as s,H as e,c as a}from"./p-e996c38f.js";import{l as h,g as n}from"./p-404cbf48.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const o=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}get el(){return i(this)}BasemapGallery;PortalBasemapsSource;_basemapElement;async basemapConfigWatchHandler(){if(this.basemapWidget?.source){const t=this.basemapWidget?.source;t.query=this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,await t.refresh()}}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"cc7e423a47742c0f5c3a5023b77157af09e56433"},s("div",{key:"9b41466e49c93e533f1d2a621707c5189c5092b3",ref:t=>{this._basemapElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t,i]=await h(["esri/widgets/BasemapGallery","esri/widgets/BasemapGallery/support/PortalBasemapsSource"]);this.BasemapGallery=t,this.PortalBasemapsSource=i}async _initBaseMapGallery(t){if(this.BasemapGallery){this.basemapWidget&&this.basemapWidget.destroy();const i=new this.PortalBasemapsSource({query:this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await i.refresh(),this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:i})}}static get watchers(){return{basemapConfig:["basemapConfigWatchHandler"],mapView:["mapViewWatchHandler"]}}};o.style=":host{display:block}";const c=class{constructor(i){t(this,i),this.facilityChanged=a(this,"facilityChanged",7),this.levelChanged=a(this,"levelChanged",7),this.siteChanged=a(this,"siteChanged",7),this.enabled=void 0,this.floorFilterWidget=void 0,this.mapView=void 0}get el(){return i(this)}FloorFilter;_floorFilterElement;reactiveUtils;_facilityHandle;_levelHandle;_siteHandle;async mapViewWatchHandler(){await this._initFloorFilter(this.mapView)}async enabledWatchHandler(){this.enabled?await this._initFloorFilter(this.mapView):this.enabled||this._destroyWidget()}facilityChanged;levelChanged;siteChanged;async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"dd7fa68ddc1e417cb8924549e50e81742f9e891a"},s("div",{key:"294837a32ed7e8f955bce7dc2403895c7dd9984f",ref:t=>{this._floorFilterElement=t}}))}async componentDidLoad(){this.mapView&&!this.floorFilterWidget&&await this._initFloorFilter(this.mapView)}async _initModules(){const[t,i]=await h(["esri/widgets/FloorFilter","esri/core/reactiveUtils"]);this.FloorFilter=t,this.reactiveUtils=i}_destroyWidget(){this.floorFilterWidget&&(this.floorFilterWidget.destroy(),this.floorFilterWidget=void 0),this._floorFilterElement&&this._floorFilterElement.remove()}_initContainer(){this._destroyWidget(),this._floorFilterElement=document.createElement("div")}async _initFloorFilter(t){const i=t?.map;await i.when((()=>{t&&this.enabled&&this.FloorFilter&&i?.floorInfo&&(this._initContainer(),this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}),this._facilityHandle?.remove(),this._facilityHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.facility),(t=>{this.facilityChanged.emit(t)})),this._levelHandle?.remove(),this._levelHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.level),(t=>{this.levelChanged.emit(t)})),this._siteHandle?.remove(),this._siteHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.site),(t=>{this.siteChanged.emit(t)})))}))}static get watchers(){return{mapView:["mapViewWatchHandler"],enabled:["enabledWatchHandler"]}}};c.style=":host{display:block}";const r=class{constructor(i){t(this,i),this.fullscreenStateChange=a(this,"fullscreenStateChange",7),this.mapView=void 0,this.fullscreenWidget=void 0}Fullscreen;_fullscreenElement;_fullscreenStateChangeHandle;reactiveUtils;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}fullscreenStateChange;async componentWillLoad(){await this._initModules()}render(){return s(e,{key:"7eec3dc5ab76a4ad8fdd24d8d18f8e6cf2820dde"},s("div",{key:"2093cc2a6a3678209e61eea63ebde2f69ec00011",class:"fullscreen-widget",ref:t=>{this._fullscreenElement=t}}))}async componentDidUpdate(){await this._initFullscreenWidget()}async componentDidLoad(){await this._initFullscreenWidget()}async _initModules(){const[t,i]=await h(["esri/widgets/Fullscreen","esri/core/reactiveUtils"]);this.Fullscreen=t,this.reactiveUtils=i}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement&&!this.fullscreenWidget?(this.fullscreenWidget=new this.Fullscreen({view:this.mapView}),await this.fullscreenWidget.when((()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=this.reactiveUtils.watch((()=>this.fullscreenWidget.viewModel.state),(t=>this.fullscreenStateChange.emit(t)))}))):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};r.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}get el(){return i(this)}Legend;_legendElement;async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"768d9d69042516c6d4edc55fcb0af23f90d33e6e"},s("div",{key:"e1147cf58240e7a6fcb9a00fce3649a380755e3d",ref:t=>{this._legendElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t]=await h(["esri/widgets/Legend"]);this.Legend=t}_initLegend(t){t&&this.Legend&&(this.legendWidget?this.legendWidget.view=t:this.legendWidget=new this.Legend({container:this._legendElement,respectLayerDefinitionExpression:!0,view:t}))}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};l.style=":host{display:block}";const d=class{constructor(i){t(this,i),this.beforeMapInfoChange=a(this,"beforeMapInfoChange",7),this.mapInfoChange=a(this,"mapInfoChange",7),this.locale=void 0,this.mapInfos=[],this.isMapLayout=void 0,this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}get el(){return i(this)}_list;_loadedId="";_skipEditCheck=!1;_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=t?.id,this.mapInfoChange.emit(t))}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t,i=!1){this._skipEditCheck=i;const s=this.mapInfos?.filter((i=>i.id===t));t&&s?.length>0&&this._webMapSelected(s[0]),this._skipEditCheck=!1}async close(){this._mapListExpanded&&(this._mapListExpanded=!1)}async toggle(t){this._mapListExpanded=t}beforeMapInfoChange;mapInfoChange;async componentWillLoad(){await this._getTranslations()}render(){return s(e,{key:"6b4b2bc101fa29a1eaadfdcc772131b7c40cedec"},this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){const t="map-picker-expand-toggle";return s("div",{class:"width-full"},s("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",iconStart:"map",id:t,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},this._webMapInfo?.name),s("calcite-tooltip",{placement:"bottom","reference-element":t},s("span",null,this._translations.switchMap)))}_getToolbar(){return s("div",{class:"display-flex border-right"},s("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return s("div",{class:t?"map-list border-bottom-1 adjusted-height "+(this.isMapLayout?"width-26":"width-full"):"display-none"},s("calcite-list",{id:"mapList",label:"",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>s("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){const i=this._loadedId;this._loadedId=t.id,this._skipEditCheck?this._webMapInfo=t:this.beforeMapInfoChange.emit({currentId:i,mapInfo:t,ref:this.el}).defaultPrevented||(this._webMapInfo=t),this._mapListExpanded=!1}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],locale:["localeWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};d.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100%}.width-26{width:26% !important}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.border-right{border-right:1px solid var(--calcite-color-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-color-background);z-index:1000;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}.align-center{align-items:center}.adjusted-height{max-height:calc(100% - 52px);overflow-y:auto}";const p=class{constructor(i){t(this,i),this.mapView=void 0,this.popupEnabled=!1,this.resultGraphicEnabled=!1,this.searchConfiguration=void 0,this.searchTerm=void 0,this.searchWidget=void 0}FeatureLayer;Search;_searchElement;_searchResult;async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return s(e,{key:"36e0fb49fdedbe9e8789fba37f86a2f2d57b4e45"},s("div",{key:"796ee258723e9277dc98323ba76def22bd7dca3a",class:"search-widget",ref:t=>{this._searchElement=t}}))}async _initModules(){const[t,i]=await h(["esri/widgets/Search","esri/layers/FeatureLayer"]);this.Search=t,this.FeatureLayer=i}_initSearchWidget(){if(this.mapView&&this._searchElement&&!this.searchWidget){let t={view:this.mapView,container:this._searchElement,searchTerm:this.searchTerm};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this.mapView)}),this.searchWidget=new this.Search(t),this.searchWidget.popupEnabled=this.popupEnabled,this.searchWidget.resultGraphicEnabled=this.resultGraphicEnabled}else this.searchWidget&&(this.searchWidget.view=this.mapView)}_getSearchConfig(t,i){const s=t.sources;return s?.length>0?(t.includeDefaultSources=!1,s.forEach((t=>{if(t.hasOwnProperty("layer")){const s=t,e=s.layer?.id,a=e?i.map.findLayerById(e):null,h=s?.layer?.url;a?s.layer=a:h&&(s.layer=new this.FeatureLayer(h))}})),s?.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===i?.name&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t={...t,includeDefaultSources:!0},t}static get watchers(){return{searchConfiguration:["watchSearchConfigurationHandler"],mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}";const m=class{constructor(i){t(this,i),this.basemapConfig=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.enableHome=void 0,this.enableSingleExpand=void 0,this.homeZoomToolsSize="m",this.layout="vertical",this.locale=void 0,this.mapView=void 0,this.mapWidgetsSize="m",this.position="top-right",this.searchConfiguration=void 0,this.stackTools=!0,this.toolOrder=void 0,this._hasFloorInfo=!1,this._translations=void 0,this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showFullscreen=!1,this._showLegendWidget=!1,this._showSearchWidget=!1}get el(){return i(this)}Expand;_basemapElement;_floorFilterElement;_fullscreenElement;_legendElement;_searchElement;_widgets=[];async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._hasFloorInfo=this.mapView?.map?.floorInfo}))}async _showBasemapWidgetWatchHandler(t){t?this.mapView.ui.add(this._basemapElement.basemapWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._basemapElement.basemapWidget)}async _showFloorFilterWatchHandler(t){const i=this._floorFilterElement.floorFilterWidget;t?this.mapView.ui.add(i,{position:this.position,index:1}):this.mapView.ui.remove(i)}async _showFullscreenWatchHandler(t){const i=this._fullscreenElement.fullscreenWidget;t?"ready"===i.viewModel.state&&i.viewModel.enter():"active"===i.viewModel.state&&i.viewModel.exit()}async _showLegendWidgetWatchHandler(t){t?this.mapView.ui.add(this._legendElement.legendWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._legendElement.legendWidget)}async _showSearchWidgetWatchHandler(t){t?this.mapView.ui.add(this._searchElement.searchWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._searchElement.searchWidget)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){this._setZoomToolsSize();const t=this._showTools?"":"display-none",i=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",n=this._showFloorFilter?"":"display-none",o=this._showFullscreen?"":"display-none",c=this.enableSingleExpand?"margin-top-1-2":"",r=this.toolOrder?this.toolOrder:["legend","search","fullscreen","floorfilter"],l=this.stackTools?"box-shadow":"";return s(e,{key:"6a707a10b3cbe094548a863b13d0852969c46f94"},s("div",{key:"c1e349ba8577a87f967b31a7a042be30cb933d34",class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},this.enableSingleExpand?s("div",{class:"box-shadow"},this._getActionGroup(this._showTools?"chevrons-up":"chevrons-down",!1,this._showTools?this._translations.collapse:this._translations.expand,(()=>this._toggleTools()))):void 0,s("div",{key:"7120793f9d707fb0d1914f5aeffb3293532ab891",class:`${c} ${l} ${t}`},this._getMapWidgets(r))),s("basemap-gallery",{key:"11e280302f6b1f5287aa83c7eb33542f3a9d87ab",basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),s("map-search",{key:"c3afd22dc8d652877f48a6def87e486546993d61",class:i,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),s("map-legend",{key:"b8fad3cdbc3b96b4f3441316651ad78b4ed3de65",class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),s("map-fullscreen",{key:"e34111225f1ec80fedfd548196e407786d28200b",class:o,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),s("floor-filter",{key:"2db5c7e6182d77786b162692169263495b2752f5",class:n,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/Expand"]);this.Expand=t}_setZoomToolsSize(){const t=document.getElementsByClassName("esri-zoom")[0]?.children[0],i=document.getElementsByClassName("esri-zoom")[0]?.children[1];if(t&&i){const s="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";t.style.width=s,t.style.height=s,i.style.width=s,i.style.height=s}}_getMapWidgets(t){const i=this._showFullscreen?"full-screen-exit":"full-screen",s=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return t.map((t=>{switch(t){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):this.enableLegend?this._getWidget(t,this._legendElement?.legendWidget,!0):void 0;case"search":return this.enableSearch&&this.enableSingleExpand?this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())):this.enableSearch?this._getWidget(t,this._searchElement?.searchWidget,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getActionGroup(i,!1,s,(()=>this._expand())):this.enableFullscreen?this._getWidget(t,this._fullscreenElement?.fullscreenWidget,!1):void 0;case"basemap":return this.enableBasemap&&this.enableSingleExpand?this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())):this.enableBasemap?this._getWidget(t,this._basemapElement?.basemapWidget,!0):void 0;case"floorfilter":return this.enableFloorFilter&&this._hasFloorInfo&&this.enableSingleExpand?this._getActionGroup("urban-model",!1,this._translations.floorFilter,(()=>this._toggleFloorFilter())):this.enableFloorFilter&&this._hasFloorInfo?this._getWidget(t,this._floorFilterElement?.floorFilterWidget,!0):void 0}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,i,e,a){return s("div",null,s("calcite-action",{alignment:"center",class:`${"s"===this.mapWidgetsSize?"square-32":"m"===this.mapWidgetsSize?"square-40":"square-48"} ${this.stackTools?"":"margin-bottom-1-2"} border-bottom ${this.stackTools?"":"box-shadow"}`,disabled:i,icon:t,id:t,onClick:a,scale:"s",text:""},s("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),s("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},s("span",null,e)))}_getWidget(t,i,s){if(this._widgets.indexOf(t)<0&&this.mapView&&i){const e=this.toolOrder.indexOf(t),a=new this.Expand({view:this.mapView,content:i});this.mapView.ui.add(s?a:i,{position:this.position,index:e>-1?e+(this.enableHome?2:1):1}),this._widgets.push(t)}}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1}_expand(){this._showFullscreen=!this._showFullscreen}_toggleTools(){this._showTools||(this._showBasemapWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._showTools=!this._showTools}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"],mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};m.style=":host{display:block}.display-none{display:none}.margin-top-1-2{margin-top:0.5rem}.square-32{width:32px;height:32px}.square-40{width:40px;height:40px}.square-48{width:48px;height:48px}.width-40{width:40px}.square-40-41{width:40px;height:41px}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.box-shadow{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.margin-bottom-1-2{margin-bottom:0.5rem}";export{o as basemap_gallery,c as floor_filter,r as map_fullscreen,l as map_legend,d as map_picker,p as map_search,m as map_tools}
|
@@ -8,4 +8,4 @@ import{r as t,c as n,g as e,h as r,H as i}from"./p-e996c38f.js";import{g as o}fr
|
|
8
8
|
* @license MIT <https://opensource.org/licenses/MIT>
|
9
9
|
* @copyright Michael Hart 2024
|
10
10
|
*/
|
11
|
-
const n=new TextEncoder,e={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},r=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]);class i{constructor({method:t,url:n,headers:i,body:o,accessKeyId:u,secretAccessKey:a,sessionToken:c,service:f,region:l,cache:d,datetime:h,signQuery:v,appendSessionToken:p,allHeaders:w,singleEncode:m}){if(null==n)throw new TypeError("url is a required option");if(null==u)throw new TypeError("accessKeyId is a required option");if(null==a)throw new TypeError("secretAccessKey is a required option");let b,y;this.method=t||(o?"POST":"GET"),this.url=new URL(n),this.headers=new Headers(i||{}),this.body=o,this.accessKeyId=u,this.secretAccessKey=a,this.sessionToken=c,f&&l||([b,y]=function(t,n){const{hostname:r,pathname:i}=t;if(r.endsWith(".on.aws")){const t=r.match(/^[^.]{1,63}\.lambda-url\.([^.]{1,63})\.on\.aws$/);return null!=t?["lambda",t[1]||""]:["",""]}if(r.endsWith(".r2.cloudflarestorage.com"))return["s3","auto"];if(r.endsWith(".backblazeb2.com")){const t=r.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);return null!=t?["s3",t[1]||""]:["",""]}const o=r.replace("dualstack.","").match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/);let u=o&&o[1]||"",a=o&&o[2];if("us-gov"===a)a="us-gov-west-1";else if("s3"===a||"s3-accelerate"===a)a="us-east-1",u="s3";else if("iot"===u)u=r.startsWith("iot.")?"execute-api":r.startsWith("data.jobs.iot.")?"iot-jobs-data":"/mqtt"===i?"iotdevicegateway":"iotdata";else if("autoscaling"===u){const t=(n.get("X-Amz-Target")||"").split(".")[0];"AnyScaleFrontendService"===t?u="application-autoscaling":"AnyScaleScalingPlannerFrontendService"===t&&(u="autoscaling-plans")}else null==a&&u.startsWith("s3-")?(a=u.slice(3).replace(/^fips-|^external-1/,""),u="s3"):u.endsWith("-fips")?u=u.slice(0,-5):a&&/-\d$/.test(u)&&!/-\d$/.test(a)&&([u,a]=[a,u]);return[e[u]||u,a||""]}(this.url,this.headers)),this.service=f||b||"",this.region=l||y||"us-east-1",this.cache=d||new Map,this.datetime=h||(new Date).toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=v,this.appendSessionToken=p||"iotdevicegateway"===this.service,this.headers.delete("Host"),"s3"!==this.service||this.signQuery||this.headers.has("X-Amz-Content-Sha256")||this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");const g=this.signQuery?this.url.searchParams:this.headers;if(g.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken&&g.set("X-Amz-Security-Token",this.sessionToken),this.signableHeaders=["host",...this.headers.keys()].filter((t=>w||!r.has(t))).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map((t=>t+":"+("host"===t?this.url.host:(this.headers.get(t)||"").replace(/\s+/g," ")))).join("\n"),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery&&("s3"!==this.service||g.has("X-Amz-Expires")||g.set("X-Amz-Expires","86400"),g.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),g.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),g.set("X-Amz-SignedHeaders",this.signedHeaders)),"s3"===this.service)try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch(t){this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");m||(this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/")),this.encodedPath=s(this.encodedPath);const j=new Set;this.encodedSearch=[...this.url.searchParams].filter((([t])=>{if(!t)return!1;if("s3"===this.service){if(j.has(t))return!1;j.add(t)}return!0})).map((t=>t.map((t=>s(encodeURIComponent(t)))))).sort((([t,n],[e,r])=>t<e?-1:t>e?1:n<r?-1:n>r?1:0)).map((t=>t.join("="))).join("&")}async sign(){return this.signQuery?(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken&&this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)):this.headers.set("Authorization",await this.authHeader()),{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){const t=this.datetime.slice(0,8),n=[this.secretAccessKey,t,this.region,this.service].join();let e=this.cache.get(n);if(!e){const r=await o("AWS4"+this.secretAccessKey,t),i=await o(r,this.region),u=await o(i,this.service);e=await o(u,"aws4_request"),this.cache.set(n,e)}return c(await o(e,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,c(await u(await this.canonicalString()))].join("\n")}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+"\n",this.signedHeaders,await this.hexBodyHash()].join("\n")}async hexBodyHash(){let t=this.headers.get("X-Amz-Content-Sha256")||("s3"===this.service&&this.signQuery?"UNSIGNED-PAYLOAD":null);if(null==t){if(this.body&&"string"!=typeof this.body&&!("byteLength"in this.body))throw new Error("body must be a string, ArrayBuffer or ArrayBufferView, unless you include the X-Amz-Content-Sha256 header");t=c(await u(this.body||""))}return t}}async function o(t,e){const r=await crypto.subtle.importKey("raw","string"==typeof t?n.encode(t):t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return crypto.subtle.sign("HMAC",r,n.encode(e))}async function u(t){return crypto.subtle.digest("SHA-256","string"==typeof t?n.encode(t):t)}const a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function c(t){const n=new Uint8Array(t);let e="";for(let t=0;t<n.length;t++){const r=n[t];e+=a[r>>>4&15],e+=a[15&r]}return e}function s(t){return t.replace(/[!'()*]/g,(t=>"%"+t.charCodeAt(0).toString(16).toUpperCase()))}t.AwsClient=class{constructor({accessKeyId:t,secretAccessKey:n,sessionToken:e,service:r,region:i,cache:o,retries:u,initRetryMs:a}){if(null==t)throw new TypeError("accessKeyId is a required option");if(null==n)throw new TypeError("secretAccessKey is a required option");this.accessKeyId=t,this.secretAccessKey=n,this.sessionToken=e,this.service=r,this.region=i,this.cache=o||new Map,this.retries=null!=u?u:10,this.initRetryMs=a||50}async sign(t,n){if(t instanceof Request){const{method:e,url:r,headers:i,body:o}=t;null==(n=Object.assign({method:e,url:r,headers:i},n)).body&&i.has("Content-Type")&&(n.body=null!=o&&i.has("X-Amz-Content-Sha256")?o:await t.clone().arrayBuffer()),t=r}const e=new i(Object.assign({url:t.toString()},n,this,n&&n.aws)),r=Object.assign({},n,await e.sign());delete r.aws;try{return new Request(r.url.toString(),r)}catch(t){if(t instanceof TypeError)return new Request(r.url.toString(),Object.assign({duplex:"half"},r));throw t}}async fetch(t,n){for(let e=0;e<=this.retries;e++){const r=fetch(await this.sign(t,n));if(e===this.retries)return r;const i=await r;if(i.status<500&&429!==i.status)return i;await new Promise((t=>setTimeout(t,Math.random()*this.initRetryMs*Math.pow(2,e))))}throw new Error("An unknown error occurred, ensure retries is not negative")}},t.AwsV4Signer=i,Object.defineProperty(t,"__esModule",{value:!0})}(Tr.exports);var Nr=function(){};"undefined"==typeof process||process;var _r="undefined"!=typeof document;function Pr(t,n){return n.charAt(0)[t]()+n.slice(1)}"undefined"!=typeof Deno&&Deno,_r&&"nodejs"===window.name||"undefined"!=typeof navigator&&void 0!==navigator.userAgent&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var Mr=Pr.bind(null,"toUpperCase"),Cr=Pr.bind(null,"toLowerCase");function Dr(t,n){void 0===n&&(n=!0);var e=function(t){return Ur(t)?Mr("null"):"object"==typeof t?function(t){return zr(t.constructor)?t.constructor.name:null}(t):Object.prototype.toString.call(t).slice(8,-1)}(t);return n?Cr(e):e}function Lr(t,n){return typeof n===t}var zr=Lr.bind(null,"function"),$r=Lr.bind(null,"string");function Ur(t){return null===t}function Rr(t,n){if("object"!=typeof n||Ur(n))return!1;if(n instanceof t)return!0;var e=Dr(new t(""));if(function(t){return t instanceof Error||$r(t.message)&&t.constructor&&function(t){return"number"===Dr(t)&&!isNaN(t)}(t.constructor.stackTraceLimit)}(n))for(;n;){if(Dr(n)===e)return!0;n=Object.getPrototypeOf(n)}return!1}function Wr(t,n){var e=t instanceof Element||t instanceof HTMLDocument;return e&&n?function(t,n){return void 0===n&&(n=""),t&&t.nodeName===n.toUpperCase()}(t,n):e}function Hr(t){var n=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(n))}}Lr.bind(null,"undefined"),Lr.bind(null,"boolean"),Lr.bind(null,"symbol"),Rr.bind(null,TypeError),Rr.bind(null,SyntaxError),Hr(Wr,"form"),Hr(Wr,"button"),Hr(Wr,"input"),Hr(Wr,"select");var qr="EventListener";function Vr(t,n){if($r(t))return n?Vr(document.querySelectorAll(t)):(e=t).split(e.indexOf(",")>-1?",":" ").map((function(t){return t.trim()}));var e;if(NodeList.prototype.isPrototypeOf(t)){for(var r=[],i=t.length>>>0;i--;)r[i]=t[i];return r}var o=function(t){return t?function(t){return"array"===Dr(t)}(t)?t:[t]:[]}(t);return n?o.map((function(t){return $r(t)?Vr(t,!0):t})).flat():o}function Fr(t,n){var e;return function(){return t&&(e=t.apply(n||this,arguments),t=null),e}}var Gr=function(t,n,e,r){var i=e||Nr,o=r||!1;if(!_r)return i;var u=Vr(n),a=Vr(t,!0);if(!a.length)throw new Error("noElements");if(!u.length)throw new Error("noEvent");var c=[];return function t(n){n&&(c=[]);for(var e=n?"add"+qr:"remove"+qr,r=0;r<a.length;r++){var s=a[r];c[r]=n?o&&o.once?Fr(i):i:c[r]||i;for(var f=0;f<u.length;f++)s[e]?s["on"+u[f]]=n?c[r]:null:s[e](u[f],c[r],o)}return t.bind(null,!n)}("Event")};function Jr(t,n){return _r&&zr(window[t])?(e=window[t],r=n,void 0===(i=window)&&(i=null),zr(e)?function(){e.apply(i,arguments),r.apply(i,arguments)}:r):window[t]=n;var e,r,i}Jr.bind(null,"onerror"),Jr.bind(null,"onload");var Xr="undefined"==typeof window,Kr="hidden";var Br=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Yr(t,n){void 0===n&&(n={});var e=function(t,n){var e=this,r=!1;return function(i){r||(t.call(e,i),r=!0,setTimeout((function(){return r=!1}),n))}}(t,n.throttle||1e4),r=[];function i(){var t=function(t){if(Xr)return!1;var n=Xr||Kr in document?Kr:["webkit","moz","ms","o"].reduce((function(t,n){var e=n+"Hidden";return!t&&e in document?e:t}),null),e="".concat(n.replace(/[H|h]idden/,""),"visibilitychange"),r=function(){return t(Boolean(document[n]))},i=function(){return document.addEventListener(e,r)};return i(),function(){return document.removeEventListener(e,r),i}}((function(t){t||e({type:"tabVisible"})}));return r=[t].concat(Br.map((function(t){return Gr(document,t,e)}))).concat(Gr(window,"load",e)).concat(Gr(window,"scroll",e,{capture:!0,passive:!0})),o}function o(){r.map((function(t){return t()}))}return i(),function(){return o(),i}}function Zr(t,n){return n?0:Math.round((new Date-t)/1e3)}var Qr="object",ti="string",ni="name",ei="version",ri="",ii="function",oi="undefined",ui={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},ai=[[/microsoft (windows) (vista|xp)/i],[ni,ei],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[ni,[ei,si,ui]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[ni,"Windows"],[ei,si,ui]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[ei,/_/g,"."],[ni,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[ni,"MacOS"],[ei,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[ei,ni],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[ni,ei],[/\(bb(10);/i],[ei,[ni,"BlackBerry"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[ei,[ni,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[ei,[ni,"webOS"]],[/crkey\/([\d\.]+)/i],[ei,[ni,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[ni,"Chromium OS"],ei],[/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/(unix) ?([\w\.]*)/i],[ni,ei]];function ci(t,n){for(var e,r,i,o,u,a,c=0;c<n.length&&!u;){var s=n[c],f=n[c+1];for(e=r=0;e<s.length&&!u;)if(u=s[e++].exec(t))for(i=0;i<f.length;i++)a=u[++r],d(o=f[i])===Qr&&o.length>0?2==o.length?this[o[0]]=d(o[1])==ii?o[1].call(this,a):o[1]:3==o.length?this[o[0]]=d(o[1])!==ii||o[1].exec&&o[1].test?a?a.replace(o[1],o[2]):void 0:a?o[1].call(this,a,o[2]):void 0:4==o.length&&(this[o[0]]=a?o[3].call(this,a.replace(o[1],o[2])):void 0):this[o]=a||void 0;c+=2}}function si(t,n){for(var e in n)if(d(n[e])===Qr&&n[e].length>0){for(var r=0;r<n[e].length;r++)if(fi(n[e][r],t))return"?"===e?void 0:e}else if(fi(n[e],t))return"?"===e?void 0:e;return t}function fi(t,n){return d(t)===ti&&-1!==li(n).indexOf(li(t))}function li(t){return t.toLowerCase()}function di(t){var n=t||(("undefined"==typeof window?"undefined":d(window))!==oi&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:ri),e={};return e[ni]=void 0,e[ei]=void 0,ci.call(e,n,ai),e}var hi="Brave";function vi(){if("undefined"==typeof window)return{};if(!window.navigator)return{};var t,n,e,r,i,o=window.navigator,u=o.platform,a=o.product,c=o.vendor,s=function(t){var n=t.userAgent,e=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(n);if(e)return{type:e[1],version:e[2]};var r=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(n);if(r)return{type:r[1],version:r[2]};var i=/(headlesschrome)(?:\/([\w\.]+)| )/i.exec(n);if(i)return{type:i[1],version:i[2]};var o=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(n);if(o)return{type:t.brave&&t.brave.isBrave?hi:o[1],version:o[2]};var u=/.+(Safari)\/([0-9\.]+).*/i.exec(n);if(u)return{type:u[1],version:u[2]};var a=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(n);if(a)return{type:a[1],version:a[2]};var c=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(n)||["","NA","0.0.0"];return{type:c[1],version:c[2]}}(window.navigator),f=s.type,l=s.version,d=f===hi?f:(c||"").split(" ")[0];return{platform:u,os:di(),make:d||a,model:f,version:l,name:[f,l].join("/"),language:(n=window.navigator,e=n.language,r=n.browserLanguage,i=n.languages,(e||r||(i||["en_US"])[0]).toLowerCase().replace("-","_")),timezone:(t=/\(([A-Za-z\s].*)\)/.exec((new Date).toString()),t&&t[1]||"")}}function pi(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})[t]||t}function wi(t){return mi.apply(this,arguments)}function mi(){return mi=s(er.mark((function t(n){var e,r,i,o,u,a,c=arguments;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=c.length>1&&void 0!==c[1]&&c[1],r={},t.t0=er.keys(n);case 3:if((t.t1=t.t0()).done){t.next=13;break}return i=t.t1.value,o=Array.isArray(n[i])?n[i]:[n[i]],u=e?o:o[0],t.next=9,gi(u,Oi);case 9:Ei(a=t.sent)||(r[i]=a),t.next=3;break;case 13:return t.abrupt("return",r);case 14:case"end":return t.stop()}}),t)}))),mi.apply(this,arguments)}function bi(t){return yi.apply(this,arguments)}function yi(){return(yi=s(er.mark((function t(n){var e,r;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e={},t.t0=er.keys(n);case 2:if((t.t1=t.t0()).done){t.next=9;break}return r=t.t1.value,t.next=6,gi(n[r],Si);case 6:e[r]=t.sent,t.next=2;break;case 9:return t.abrupt("return",e);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function gi(t,n){return ji.apply(this,arguments)}function ji(){return(ji=s(er.mark((function t(n,e){return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof n){t.next=4;break}return t.next=3,n();case 3:n=t.sent;case 4:return t.abrupt("return",e(n));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Oi(t){if(null!=t)return Array.isArray(t)?t.filter(ki).map((function(t){return t.toString()})):Ei(t)?t:t.toString()}function Si(t){return parseFloat(Number(Array.isArray(t)?t[0]:t))}function ki(t){return null!=t}function Ei(t){return null==t}var Ai="_session.start",Ii="_session.stop",xi="pageView";function Ti(t){return Ni.apply(this,arguments)}function Ni(){return Ni=s(er.mark((function t(n){var e,r,i,o,u,a,c,s,l,d,h,v,p,w,m,b,y,g,j,O,S,k,E,A,I,x,T,N,_,P=arguments;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=P.length>1&&void 0!==P[1]?P[1]:{},i=(r=P.length>2&&void 0!==P[2]?P[2]:{}).appTitle,o=r.appPackageName,u=r.appVersionCode,a=r.enrichEventAttributes,c=r.enrichEventMetrics,s=r.debug?console.log:function(){},l=pi(n,r.eventMapping),d=hr(),h=e.sessionId||d.id,v=e.sessionStart||d.createdAt,p=e.sessionStart?new Date(e.sessionStart).getTime():d.created,s("event sessionData ",JSON.stringify(d)),yr&&(w=mr(),m=pr(),s("event pageSessionInfo",JSON.stringify(w)),s("event tabSessionData ",JSON.stringify(m))),b=e.attributes||{},y=e.eventId||J(),g=e.time?new Date(e.time):new Date,j=g.toISOString(),O=g.getTime()-p,S=Qe({date:j,sessionId:h},yr?{pageSession:w.id}:{}),!a){t.next=23;break}return t.next=20,a();case 20:t.t0=t.sent,t.next=24;break;case 23:t.t0={};case 24:if(k=t.t0,E=Qe(Qe(Qe({},S),k),b),A=e.metrics||{},I={sessionTime:d.elapsed||O,hour:g.getHours(),day:g.getDay()+1,month:g.getMonth()+1,year:g.getFullYear()},!c){t.next=34;break}return t.next=31,c();case 31:t.t1=t.sent,t.next=35;break;case 34:t.t1={};case 35:return x=t.t1,T=Qe(Qe(Qe({},I),x),A),t.next=39,wi(E);case 39:return t.t2=t.sent,t.next=42,bi(T);case 42:return t.t3=t.sent,N={attributes:t.t2,metrics:t.t3},s("".concat(y,":").concat(l)),s("eventAttributes",N.attributes),s("eventMetrics",N.metrics),yr&&s("clientInfo",vi()),_=f({},y,Qe(Qe({EventType:l,Timestamp:j,AppPackageName:o,AppTitle:i},u?{AppVersionCode:u}:{}),{},{Attributes:N.attributes,Metrics:N.metrics,Session:{Id:h,StartTimestamp:v}})),n===Ii&&(_[y].Session.Duration=O,_[y].Session.StopTimestamp=j),t.abrupt("return",_);case 51:case"end":return t.stop()}}),t)}))),Ni.apply(this,arguments)}var _i="__endpoint";function Pi(t){return"".concat(_i,".").concat(t)}var Mi,Ci="__endpoint",Di=!1;function Li(){return zi.apply(this,arguments)}function zi(){return zi=s(er.mark((function t(){var n,e,r,i,o,u,a,c,s,f,l,d,h,v,p,w,m,b,y,g,j,O=arguments;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=O.length>0&&void 0!==O[0]?O[0]:{},r=(e=O.length>1&&void 0!==O[1]?O[1]:{}).getUserId,i=e.getEndpointId,o=e.endpointMigration,u=qi(e),a=u.sessionKey?u.sessionKey():"sessions",c=u.pageViewKey?u.pageViewKey():"pageViews",yr&&(l=vi(),s=mr(),f=s.id),d=hr(),t.next=10,i();case 10:if(h=t.sent,Di||(Di=!0,(v=ke(Ci))&&($i(h,v),Ae(Ci))),p=Ui(h),w=Wi(e),m=Ri(w,l),b={Attributes:{},Demographic:m,Location:{},Metrics:{}},yr&&(l.device&&l.device.vendor&&(b.Attributes.DeviceMake=[l.device.vendor]),l.device&&l.device.model&&(b.Attributes.DeviceModel=[l.device.model]),l.device&&l.device.type&&(b.Attributes.DeviceType=[l.device.type])),!(n=xr.all([p,b,n],{arrayMerge:Hi})).User||!n.User.UserId){t.next=23;break}return t.next=21,r();case 21:n.User.UserId!==(y=t.sent)&&(n.User.UserId=y);case 23:if(n.User&&n.User.UserId){t.next=28;break}return t.next=26,r();case 26:(g=t.sent)&&(n.User=n.User||{},n.User.UserId=g);case 28:if(!n.User||!n.User.UserAttributes){t.next=32;break}return t.next=31,wi(n.User.UserAttributes,!0);case 31:n.User.UserAttributes=t.sent;case 32:return t.next=34,wi(n.Attributes,!0);case 34:return n.Attributes=t.sent,t.next=37,bi(n.Metrics);case 37:if(n.Metrics=t.sent,n.Metrics[a]||(n.Metrics[a]=1),n.Metrics[c]||(n.Metrics[c]=1),o&&(n=o(h,n)),j=n.Attributes.lastSession){t.next=47;break}return n.Attributes.lastSessionDate=[d.createdAt],n.Attributes.lastSession=[d.id],f&&(n.Attributes.lastPageSession=[f]),t.abrupt("return",$i(h,n));case 47:return j&&j[0]!==d.id&&(n.Attributes.lastSessionDate=[d.createdAt],n.Attributes.lastSession=[d.id],n.Metrics[a]+=1),n.Attributes&&n.Attributes.lastPageSession&&Array.isArray(n.Attributes.lastPageSession)&&n.Attributes.lastPageSession.length>0&&n.Attributes.lastPageSession[0]!==f&&(n.Attributes.lastPageSession=[f],n.Metrics[c]+=1),t.abrupt("return",$i(h,n));case 50:case"end":return t.stop()}}),t)}))),zi.apply(this,arguments)}function $i(t,n){var e=Pi(t),r="string"==typeof n?n:JSON.stringify(n);return Ee(e,r),n}function Ui(t){try{return JSON.parse(ke(Pi(t)))||{}}catch(t){}return{}}function Ri(t,n){return yr?function(t,n){var e={AppVersion:t,Locale:n.language,Make:n.make,Model:n.model,ModelVersion:n.version,Platform:n.os.name||n.platform};return n.os&&n.os.version&&(e.PlatformVersion=n.os.version),e}(t,n):function(t){return{AppVersion:t,Make:"generic server",Platform:"Node.js",PlatformVersion:process.version}}(t)}function Wi(t){var n=t.appTitle||t.appPackageName||"",e=t.appVersionCode||"0.0.0";return n?"".concat(n,"@").concat(e):e}function Hi(t,n){return n}function qi(t){var n=t.getContext;return"function"==typeof n?n():n}var Vi=[429,500],Fi=[202],Gi=400;function Ji(t,n){return Xi.apply(this,arguments)}function Xi(){return Xi=s(er.mark((function t(n,e){var r,i,o,u,a,c,s,f,l,d,h,v,p,w,m,b,y;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pinpointRegion,i=e.pinpointAppId,o=e.lambdaArn,u=e.lambdaRegion,a=e.credentials,c=e.getCredentials,s=e.debug,t.next=3,Ki(a,c);case 3:return f=t.sent,s&&console.log("pinpoint auth",f),l=r||u,d=!0===e.fips?"-fips":"",h="https://lambda.".concat(u||r,".amazonaws.com/2015-03-31/functions/").concat(o,"/invocations"),v="https://pinpoint".concat(d,".").concat(l,".amazonaws.com/v1/apps/").concat(i,"/events"),p=o?h:v,b={body:JSON.stringify(n)},w=new Tr.exports.AwsClient(f),t.next=16,w.fetch(p,b).then((function(t){return t.json()}));case 16:m=t.sent,t.next=24;break;case 19:return w=new Mi.PinpointClient({credentials:f,region:r}),y=new Mi.PutEventsCommand({ApplicationId:i,EventsRequest:n}),t.next=23,w.send(y);case 23:m=t.sent;case 24:return m&&m.Results&&Object.keys(m.Results).map((function(t){return m.Results[t]})).forEach((function(t){var n=t.EndpointItemResponse||{},e=t.EventsItemResponse||{};Object.keys(n).length&&(Fi.includes(n.StatusCode)||Vi.includes(n.StatusCode)||Yi(n,Endpoint));var r=Object.keys(e);r.length&&r.forEach((function(){}))})),t.abrupt("return",m);case 26:case"end":return t.stop()}}),t)}))),Xi.apply(this,arguments)}function Ki(t,n){return Bi.apply(this,arguments)}function Bi(){return(Bi=s(er.mark((function t(n,e){var r;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n,Object.keys(r).length||!e){t.next=11;break}return t.prev=2,t.next=5,e();case 5:r=t.sent,t.next=11;break;case 8:throw t.prev=8,t.t0=t.catch(2),new Error(t.t0);case 11:return t.abrupt("return",{accessKeyId:r.accessKeyId||r.AccessKeyId,secretAccessKey:r.secretAccessKey||r.SecretKey,sessionToken:r.sessionToken||r.SessionToken,retries:5});case 13:case"end":return t.stop()}}),t,null,[[2,8]])})))).apply(this,arguments)}function Yi(t){var n=t.Message;if(t.StatusCode===Gi){if(n.startsWith("Missing ChannelType"))throw new Error("Missing ChannelType");if(n.startsWith("Exceeded maximum endpoint per user count"))throw new Error("Exceeded maximum endpoint per user count")}}var Zi=["PUSH","GCM","APNS","APNS_SANDBOX","APNS_VOIP","APNS_VOIP_SANDBOX","ADM","SMS","VOICE","EMAIL","BAIDU","CUSTOM"].reduce((function(t,n){return t[n]=n,t}),{}),Qi=vi(),to=Ai,no=Ii,eo=/.+\@.+\..+/;function ro(t){try{return JSON.parse(ke(Pi(t)))||{}}catch(t){}return{}}function io(t){return t.sort((function(t,n){var e=t.EventType,r=n.EventType;return e==to?-1:r==to||e==no?1:r==no?-1:void 0})).reduce((function(t,n){return Qe(Qe({},n),t)}),{})}function oo(t,n,e){return{BatchItem:f({},t,{Endpoint:n,Events:e})}}var uo=Ii;function ao(){return{}}function co(){throw new Error("Pinpoint not loaded")}function so(t){var n=t.config,e=t.instance;n&&n.disableAnonymousTraffic&&!e.user("userId")&&e.once("identifyStart",(function(t){t.plugins["aws-pinpoint"].loaded()||e.loadPlugin("aws-pinpoint")}))}var fo={disableAnonymousTraffic:!1,pinpointRegion:"us-east-1",eventMapping:{}},lo=function(){var t,n,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!1;return{name:"aws-pinpoint",config:Qe(Qe({},fo),e),bootstrap:so,initialize:function(r){var i=r.config,o=r.instance,u=i.disableAnonymousTraffic,a=i.debug?console.log:function(){},c=o.getState(),f=c.user||{},l=f.userId,h=f.anonymousId,v=c.context||{},p=v.app,w=v.version,m=v.campaign,b=mr(),y=pr(),g=hr();if(a("initPageSession",b),a("initTabSession",y),a("initSessionData",g),g&&g.anonId&&g.anonId!==h){a("anonId different refresh session details"),br(),wr();var j=vr(30,{anonId:h,userId:l});a("newSessionForNewUser",j)}if(!l&&u)return!1;var O=Object.keys(m).reduce((function(t,n){return t["utm_".concat(n)]=m[n],t}),{}),S=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Qe({getContext:t.getContext||ao,credentials:t.credentials||{},getEndpointId:t.getEndpointId},t),e=n.debug?console.log:function(){},r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getEndpointId,e=t.debug;return function(){var r=s(er.mark((function r(){var i,o,u,a,c,s,f,l,h,v=arguments;return er.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=v.length>0&&void 0!==v[0]?v[0]:[],o=v.length>1&&void 0!==v[1]?v[1]:{},r.next=4,n();case 4:if(u=r.sent){r.next=8;break}return console.error("No endpoint id. check getEndpointId()"),r.abrupt("return");case 8:if("object"===d(o)&&Object.keys(o).length){r.next=13;break}r.t0=ro(u),r.next=16;break;case 13:return r.next=15,Li(o,t);case 15:r.t0=r.sent;case 16:return c=(a=r.t0).ChannelType,a.Address&&eo.test(a.Address)&&(c=Zi.EMAIL),!c&&a.Address&&(c="android"===Qi.platform?c||Zi.GCM:c||Zi.APNS),e&&(console.log("Endpoint",a),console.log("CHANNEL_TYPE",c)),a.RequestId=J(),a.ChannelType=c,a.Address&&(a.OptOut=a.OptOut||"NONE"),s=io(i),f=oo(u,a,s),r.prev=26,r.next=29,Ji(f,t);case 29:l=r.sent,r.next=36;break;case 32:r.prev=32,r.t1=r.catch(26),console.log("Error calling AWS",r.t1),h=r.t1;case 36:return r.abrupt("return",{endpoint:a,response:l,error:h,events:i});case 37:case"end":return r.stop()}}),r,null,[[26,32]])})));return function(){return r.apply(this,arguments)}}()}(n),i=function(t,n){var e,r,i,o=(n=n||{}).initial||[],u=n.max||1/0,a=n.interval||1e4,c=n.onEmpty||rr,s=n.onPause||rr;function f(n){clearInterval(e);var r=o.splice(0,u);return r.length&&t(r,o),o.length?n?f():l():(i=!1,c(o))}function l(){i=!0,e=setInterval(f,a)}return o.length&&l(),{flush:function(t){f(t)},resume:f,push:function(t){return(r=o.push(t))>=u&&!n.throttle&&f(),i||l(),r},size:function(){return o.length},pause:function(t){t&&f(),clearInterval(e),i=!1,s(o)}}}(function(){var t=s(er.mark((function t(n){return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.forEach((function(t){return e("> Queue event",t)})),t.next=3,r(n,{});case 3:e("> Queue response",t.sent);case 5:case"end":return t.stop()}}),t)})));return function(n,e){return t.apply(this,arguments)}}(),{max:10,interval:t.flushInterval||3e3,throttle:!0}),o=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(){var e=s(er.mark((function e(r){var i,o,u,a,c=arguments;return er.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=c.length>2&&void 0!==c[2]?c[2]:{},u=c.length>3&&void 0!==c[3]&&c[3],gr(i=c.length>1&&void 0!==c[1]?c[1]:{})&&(u=i={}),gr(o)&&(u=o={}),e.next=7,Ti(r,i,n);case 7:if(a=e.sent,!Object.entries(o).length&&r!==xi){e.next=12;break}return e.next=11,Li(o,n);case 11:o=e.sent;case 12:if(t.push(a),!u){e.next=17;break}return e.abrupt("return",t.flush());case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}(i,n);Li({},t);var u=function(t){if(!yr)return ao;var n=function(t){return function(){t(uo,!0)}}(t);return window.addEventListener("beforeunload",n),function(){return window.removeEventListener("beforeunload",n)}}(o);return{updateEndpoint:function(t){return r([],t)},recordEvent:o,disable:function(){u()}}}(Qe(Qe({},i),{},{appTitle:i.appTitle||p,appPackageName:i.appPackageName||p,appVersionCode:i.appVersionCode||w,eventMapping:i.eventMapping,getEndpointId:function(){return o.user("anonymousId")},getUserId:function(){return o.user("userId")},getContext:function(){return{sessionKey:i.sessionKey,pageViewKey:i.pageViewKey,initialSession:g}},enrichEventAttributes:function(){return Qe({anonId:o.user("anonymousId"),userId:o.user("userId"),hash:window.location.hash,path:window.location.pathname,referrer:document.referrer,search:window.location.search,title:document.title,host:window.location.hostname,url:window.location.origin+window.location.pathname},O)},enrichUserAttributes:i.enrichUserAttributes,enrichEventMetrics:function(){return{}}}));t=S.recordEvent,n=S.updateEndpoint,g&&g.isNew&&(a("Start brand new session because cookie not found"),t(Ai)),function(t){var n,e,r=t.onIdle,i=t.onWakeUp,o=t.onHeartbeat,u=t.timeout,a=void 0===u?1e4:u,c=t.throttle,s=void 0===c?2e3:c,f=!1,l=new Date;Yr((function(t){clearTimeout(n),o&&!f&&o(Zr(l),t),i&&f&&(f=!1,i(Zr(e),t),l=new Date),n=setTimeout((function(){f=!0,r&&(e=new Date,r(Zr(l),t))}),a)}),{throttle:s})}({timeout:18e5,throttle:2e4,onIdle:function(n){var r;a("Session idle. Active ".concat(n," seconds")),r=hr(),e.debug&&console.log("Stop session",r),t(Ii,!0)},onWakeUp:function(n){var r;a("Session wakeup. Idle ".concat(n," seconds")),r=vr(30),e.debug&&console.log("START SESSION",r),t(Ai)},onHeartbeat:function(t){a("ping session",new Date),a("total active time",t);var n=o.user();!function(t,n){void 0===t&&(t=30),vr(t||1,n,!0)}(30,{anonId:n.anonymousId,userId:n.userId})}})},page:function(){if(!t)return co();r&&br(),t(xi),r=!0},track:function(n){var e=n.payload,r=n.config;if(!t)return co();if(!r.disableAnonymousTraffic||e.userId){var i,o=(i=e.properties,Object.keys(i).reduce((function(t,n){var e=i[n];return"number"==typeof e&&(t.metrics[n]=e),"string"!=typeof e&&"boolean"!=typeof e||(t.attributes[n]=e),t}),{attributes:{},metrics:{}}));t(e.event,o)}},identify:function(t){var e=t.payload,r=e.userId,i=e.traits;if(!n)return co();var o={},u={};r&&(u.UserId=r),i&&Object.keys(i).length&&(u.UserAttributes=i),Object.keys(u).length&&(o.User=u),n(o,!0)},reset:function(t){var n=Pi(t.instance.user("anonymousId"));Ae(n)},loaded:function(){return!!t}}};function ho(t,n){var e=vo(t,n),r=v({httpMethod:"GET"},n);return h(e,r)}var vo=function(t,n){return("string"==typeof n?n:p(n))+"/content/items/"+t};class po{constructor(t){this.name="amazon";const{app:n={},fips:e,userPoolID:r}=t;this.analytics=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return de(Ye(Ye({},{storage:Xe}),t))}({app:n.name,version:n.version,plugins:[lo({fips:e,pinpointAppId:n.id,getCredentials:()=>function(t,n={}){const e=`https://cognito-identity${!0===n.fips?"-fips":""}.us-east-1.amazonaws.com/`;let r=m.get(k);if(r&&Date.now()/1e3<r.Expiration)return Promise.resolve(r);const i={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetId"},body:JSON.stringify({IdentityPoolId:t})};return fetch(e,i).then((t=>{if(!t.ok)throw new Error(t.statusText);return t.json()})).then((t=>{const{IdentityId:n}=t,r={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},body:JSON.stringify({IdentityId:n})};return fetch(e,r)})).then((t=>{if(!t.ok)throw new Error(t.statusText);return t.json()})).then((({Credentials:t})=>(m.set(k,t),t)))}(r,{fips:e})})]}),Object.assign(this,t)}init(){return Promise.resolve()}static async setAccessPermissions({id:t,authentication:n,username:e,accessChangeset:r}){return async function({id:t,authentication:n,username:e,accessChangeset:r}){const{properties:i={}}=await ho(t,{authentication:n}),o=i.telemetry,u=void 0===o?{}:o,{arcgis:{access:a={}}={}}=u,c=O(u,["arcgis"]),s=function(t,n,e){return e.reduce(((n,e)=>{const{action:r,targetProperty:i}=e;return"add"===r?n[i]={updatedAt:new Date,updatedBy:t}:"remove"===r&&delete n[i],n}),n)}(e,a,r);return w({item:{id:t,properties:Object.assign(Object.assign({},i),{telemetry:Object.assign(Object.assign({},c),{arcgis:{access:Object.assign({},s)}})})},authentication:n})}({id:t,authentication:n,username:e,accessChangeset:r})}static async getAccessPermissions({id:t,authentication:n}){return async function({id:t,authentication:n}){const{properties:{telemetry:{arcgis:{access:e={}}={}}={}}}=await ho(t,{authentication:n});return{access:e}}({id:t,authentication:n})}logPageView(t,n){const e=function({page:t,previousPage:n={},options:e={},dimensionLookup:r={},metricLookup:i={}}){const o=T(e,i),u=E({telemetryData:e,dimensionLookup:r,excludeKeys:["workflow",...Object.keys(o),...Object.keys(i)]}),{referrer:a,title:c}=document||{},{hostname:s,pathname:f}=window&&window.location?window.location:{};return Object.assign(Object.assign({name:"pageView",referrer:a,hostname:s,path:t||f,pageUrl:t||f,pageName:c,previousPageUrl:n.pageUrl,previousPageName:n.pageName},u),o)}({page:t,previousPage:this.previousPage,options:n,dimensionLookup:this.dimensions,metricLookup:this.metrics}),{pageUrl:r,pageName:i}=e;this.previousPage={pageUrl:r,pageName:i},this.analytics.track("pageView",e)}logEvent(t={}){const n=function({event:t={},dimensionLookup:n={},metricLookup:e={}}){var r,i;const{pathname:o,eventType:u="other"}=t,a=T(t,e),c=E({telemetryData:Object.assign({eventType:u},t),dimensionLookup:n,excludeKeys:["workflow","pathname",...Object.keys(a),...Object.keys(e)]}),s=Object.assign(Object.assign({name:u},c),a);return"undefined"!=typeof document&&document.referrer&&(s.referrer=document.referrer),"undefined"==typeof window||s.hostname||(s.hostname=null===(r=window.location)||void 0===r?void 0:r.hostname),s.path="undefined"!=typeof window&&window.location.pathname?null===(i=window.location)||void 0===i?void 0:i.pathname:o,s}({event:t,dimensionLookup:this.dimensions,metricLookup:this.metrics}),{name:e}=n;this.analytics.track(e,n)}}const wo=class{constructor(e){t(this,e),this.consentGranted=n(this,"consentGranted",7),this.amazonAppId=void 0,this.amazonAppName=void 0,this.amazonUserPoolID=void 0,this.amazonVersion=void 0,this.firstUseVar=void 0,this.locale=void 0,this.measurementIds=void 0,this.portal=void 0,this._open=void 0,this._translations=void 0}get el(){return e(this)}_loaded=!1;_telemetryInstance;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async getInstance(){return"true"===localStorage.getItem(this.firstUseVar)||this.portal.eueiEnabled?(await this._init(),this._telemetryInstance):void 0}consentGranted;async componentWillLoad(){await this._getTranslations(),this._open=null===localStorage.getItem(this.firstUseVar)}render(){return r(i,{key:"6b5a4571e972d6d79948cbf186119372456b5e1e"},r("calcite-alert",{key:"93eaac2efe214be10c0b5a0ff511404e74861bd0",kind:"brand",label:this._translations.trackingAlertLabel,onCalciteAlertClose:()=>this._alertClosed(),open:this._open},r("div",{key:"791bf8851d3f7fd5cec537afcd369071127701a4",slot:"message"},this._translations.message),r("calcite-button",{key:"a3708023545b76ab30fc085d6de8c853a986a5a6",alignment:"center",appearance:"solid",kind:"brand",onClick:()=>this._accept(),scale:"m",slot:"actions-end",style:{margin:"auto"},type:"button"},this._translations.accept)))}async componentDidLoad(){this.consentGranted.emit({granted:"true"===localStorage.getItem(this.firstUseVar)})}async _init(){if(!this._loaded){const t={plugins:[],portal:this.portal};if(this.measurementIds?.length>0){const n=new S({measurementIds:this.measurementIds});t.plugins.push(n)}if(this.amazonUserPoolID){const n=new po({userPoolID:this.amazonUserPoolID,app:{name:this.amazonAppName,id:this.amazonAppId,version:this.amazonVersion}});t.plugins.push(n)}this._telemetryInstance=new j(t),await this._telemetryInstance.init(),this._loaded=!0}}_alertClosed(){this._open=!1,"true"!==localStorage.getItem(this.firstUseVar)&&localStorage.setItem(this.firstUseVar,"false")}_accept(){localStorage.setItem(this.firstUseVar,"true"),this.consentGranted.emit({granted:!0}),this._open=!1}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"]}}};wo.style=":host{display:block}.consent-panel{position:fixed;display:block;z-index:5000;bottom:0;left:0;width:100%;height:auto;text-align:center}.cookie-consent-popup-container{position:relative;display:block;bottom:0;left:0;width:100%;margin:0;padding-top:1rem;padding-bottom:1rem;transition:transform 0.5s ease-out 0s;background-color:rgba(51, 51, 51, 0.95);color:#fff}.button-container{position:static;margin-bottom:1rem;display:flex;justify-content:center;flex-wrap:wrap}.padding-end-1{padding-inline-end:1rem}.link-text{--calcite-ui-text-link:var(--calcite-color-text-inverse);--calcite-ui-brand:var(--calcite-color-text-inverse);--calcite-color-text-link:var(--calcite-color-text-inverse);--calcite-color-brand-underline:var(--calcite-color-text-inverse);--calcite-color-brand:var(--calcite-color-text-inverse)}";export{wo as consent_manager}
|
11
|
+
const n=new TextEncoder,e={appstream2:"appstream",cloudhsmv2:"cloudhsm",email:"ses",marketplace:"aws-marketplace",mobile:"AWSMobileHubService",pinpoint:"mobiletargeting",queue:"sqs","git-codecommit":"codecommit","mturk-requester-sandbox":"mturk-requester","personalize-runtime":"personalize"},r=new Set(["authorization","content-type","content-length","user-agent","presigned-expires","expect","x-amzn-trace-id","range","connection"]);class i{constructor({method:t,url:n,headers:i,body:o,accessKeyId:u,secretAccessKey:a,sessionToken:c,service:f,region:l,cache:d,datetime:h,signQuery:v,appendSessionToken:p,allHeaders:w,singleEncode:m}){if(null==n)throw new TypeError("url is a required option");if(null==u)throw new TypeError("accessKeyId is a required option");if(null==a)throw new TypeError("secretAccessKey is a required option");let b,y;this.method=t||(o?"POST":"GET"),this.url=new URL(n),this.headers=new Headers(i||{}),this.body=o,this.accessKeyId=u,this.secretAccessKey=a,this.sessionToken=c,f&&l||([b,y]=function(t,n){const{hostname:r,pathname:i}=t;if(r.endsWith(".on.aws")){const t=r.match(/^[^.]{1,63}\.lambda-url\.([^.]{1,63})\.on\.aws$/);return null!=t?["lambda",t[1]||""]:["",""]}if(r.endsWith(".r2.cloudflarestorage.com"))return["s3","auto"];if(r.endsWith(".backblazeb2.com")){const t=r.match(/^(?:[^.]{1,63}\.)?s3\.([^.]{1,63})\.backblazeb2\.com$/);return null!=t?["s3",t[1]||""]:["",""]}const o=r.replace("dualstack.","").match(/([^.]{1,63})\.(?:([^.]{0,63})\.)?amazonaws\.com(?:\.cn)?$/);let u=o&&o[1]||"",a=o&&o[2];if("us-gov"===a)a="us-gov-west-1";else if("s3"===a||"s3-accelerate"===a)a="us-east-1",u="s3";else if("iot"===u)u=r.startsWith("iot.")?"execute-api":r.startsWith("data.jobs.iot.")?"iot-jobs-data":"/mqtt"===i?"iotdevicegateway":"iotdata";else if("autoscaling"===u){const t=(n.get("X-Amz-Target")||"").split(".")[0];"AnyScaleFrontendService"===t?u="application-autoscaling":"AnyScaleScalingPlannerFrontendService"===t&&(u="autoscaling-plans")}else null==a&&u.startsWith("s3-")?(a=u.slice(3).replace(/^fips-|^external-1/,""),u="s3"):u.endsWith("-fips")?u=u.slice(0,-5):a&&/-\d$/.test(u)&&!/-\d$/.test(a)&&([u,a]=[a,u]);return[e[u]||u,a||""]}(this.url,this.headers)),this.service=f||b||"",this.region=l||y||"us-east-1",this.cache=d||new Map,this.datetime=h||(new Date).toISOString().replace(/[:-]|\.\d{3}/g,""),this.signQuery=v,this.appendSessionToken=p||"iotdevicegateway"===this.service,this.headers.delete("Host"),"s3"!==this.service||this.signQuery||this.headers.has("X-Amz-Content-Sha256")||this.headers.set("X-Amz-Content-Sha256","UNSIGNED-PAYLOAD");const g=this.signQuery?this.url.searchParams:this.headers;if(g.set("X-Amz-Date",this.datetime),this.sessionToken&&!this.appendSessionToken&&g.set("X-Amz-Security-Token",this.sessionToken),this.signableHeaders=["host",...this.headers.keys()].filter((t=>w||!r.has(t))).sort(),this.signedHeaders=this.signableHeaders.join(";"),this.canonicalHeaders=this.signableHeaders.map((t=>t+":"+("host"===t?this.url.host:(this.headers.get(t)||"").replace(/\s+/g," ")))).join("\n"),this.credentialString=[this.datetime.slice(0,8),this.region,this.service,"aws4_request"].join("/"),this.signQuery&&("s3"!==this.service||g.has("X-Amz-Expires")||g.set("X-Amz-Expires","86400"),g.set("X-Amz-Algorithm","AWS4-HMAC-SHA256"),g.set("X-Amz-Credential",this.accessKeyId+"/"+this.credentialString),g.set("X-Amz-SignedHeaders",this.signedHeaders)),"s3"===this.service)try{this.encodedPath=decodeURIComponent(this.url.pathname.replace(/\+/g," "))}catch(t){this.encodedPath=this.url.pathname}else this.encodedPath=this.url.pathname.replace(/\/+/g,"/");m||(this.encodedPath=encodeURIComponent(this.encodedPath).replace(/%2F/g,"/")),this.encodedPath=s(this.encodedPath);const j=new Set;this.encodedSearch=[...this.url.searchParams].filter((([t])=>{if(!t)return!1;if("s3"===this.service){if(j.has(t))return!1;j.add(t)}return!0})).map((t=>t.map((t=>s(encodeURIComponent(t)))))).sort((([t,n],[e,r])=>t<e?-1:t>e?1:n<r?-1:n>r?1:0)).map((t=>t.join("="))).join("&")}async sign(){return this.signQuery?(this.url.searchParams.set("X-Amz-Signature",await this.signature()),this.sessionToken&&this.appendSessionToken&&this.url.searchParams.set("X-Amz-Security-Token",this.sessionToken)):this.headers.set("Authorization",await this.authHeader()),{method:this.method,url:this.url,headers:this.headers,body:this.body}}async authHeader(){return["AWS4-HMAC-SHA256 Credential="+this.accessKeyId+"/"+this.credentialString,"SignedHeaders="+this.signedHeaders,"Signature="+await this.signature()].join(", ")}async signature(){const t=this.datetime.slice(0,8),n=[this.secretAccessKey,t,this.region,this.service].join();let e=this.cache.get(n);if(!e){const r=await o("AWS4"+this.secretAccessKey,t),i=await o(r,this.region),u=await o(i,this.service);e=await o(u,"aws4_request"),this.cache.set(n,e)}return c(await o(e,await this.stringToSign()))}async stringToSign(){return["AWS4-HMAC-SHA256",this.datetime,this.credentialString,c(await u(await this.canonicalString()))].join("\n")}async canonicalString(){return[this.method.toUpperCase(),this.encodedPath,this.encodedSearch,this.canonicalHeaders+"\n",this.signedHeaders,await this.hexBodyHash()].join("\n")}async hexBodyHash(){let t=this.headers.get("X-Amz-Content-Sha256")||("s3"===this.service&&this.signQuery?"UNSIGNED-PAYLOAD":null);if(null==t){if(this.body&&"string"!=typeof this.body&&!("byteLength"in this.body))throw new Error("body must be a string, ArrayBuffer or ArrayBufferView, unless you include the X-Amz-Content-Sha256 header");t=c(await u(this.body||""))}return t}}async function o(t,e){const r=await crypto.subtle.importKey("raw","string"==typeof t?n.encode(t):t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);return crypto.subtle.sign("HMAC",r,n.encode(e))}async function u(t){return crypto.subtle.digest("SHA-256","string"==typeof t?n.encode(t):t)}const a=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function c(t){const n=new Uint8Array(t);let e="";for(let t=0;t<n.length;t++){const r=n[t];e+=a[r>>>4&15],e+=a[15&r]}return e}function s(t){return t.replace(/[!'()*]/g,(t=>"%"+t.charCodeAt(0).toString(16).toUpperCase()))}t.AwsClient=class{constructor({accessKeyId:t,secretAccessKey:n,sessionToken:e,service:r,region:i,cache:o,retries:u,initRetryMs:a}){if(null==t)throw new TypeError("accessKeyId is a required option");if(null==n)throw new TypeError("secretAccessKey is a required option");this.accessKeyId=t,this.secretAccessKey=n,this.sessionToken=e,this.service=r,this.region=i,this.cache=o||new Map,this.retries=null!=u?u:10,this.initRetryMs=a||50}async sign(t,n){if(t instanceof Request){const{method:e,url:r,headers:i,body:o}=t;null==(n=Object.assign({method:e,url:r,headers:i},n)).body&&i.has("Content-Type")&&(n.body=null!=o&&i.has("X-Amz-Content-Sha256")?o:await t.clone().arrayBuffer()),t=r}const e=new i(Object.assign({url:t.toString()},n,this,n&&n.aws)),r=Object.assign({},n,await e.sign());delete r.aws;try{return new Request(r.url.toString(),r)}catch(t){if(t instanceof TypeError)return new Request(r.url.toString(),Object.assign({duplex:"half"},r));throw t}}async fetch(t,n){for(let e=0;e<=this.retries;e++){const r=fetch(await this.sign(t,n));if(e===this.retries)return r;const i=await r;if(i.status<500&&429!==i.status)return i;await new Promise((t=>setTimeout(t,Math.random()*this.initRetryMs*Math.pow(2,e))))}throw new Error("An unknown error occurred, ensure retries is not negative")}},t.AwsV4Signer=i,Object.defineProperty(t,"__esModule",{value:!0})}(Tr.exports);var Nr=function(){};"undefined"==typeof process||process;var _r="undefined"!=typeof document;function Pr(t,n){return n.charAt(0)[t]()+n.slice(1)}"undefined"!=typeof Deno&&Deno,_r&&"nodejs"===window.name||"undefined"!=typeof navigator&&void 0!==navigator.userAgent&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));var Mr=Pr.bind(null,"toUpperCase"),Cr=Pr.bind(null,"toLowerCase");function Dr(t,n){void 0===n&&(n=!0);var e=function(t){return Ur(t)?Mr("null"):"object"==typeof t?function(t){return zr(t.constructor)?t.constructor.name:null}(t):Object.prototype.toString.call(t).slice(8,-1)}(t);return n?Cr(e):e}function Lr(t,n){return typeof n===t}var zr=Lr.bind(null,"function"),$r=Lr.bind(null,"string");function Ur(t){return null===t}function Rr(t,n){if("object"!=typeof n||Ur(n))return!1;if(n instanceof t)return!0;var e=Dr(new t(""));if(function(t){return t instanceof Error||$r(t.message)&&t.constructor&&function(t){return"number"===Dr(t)&&!isNaN(t)}(t.constructor.stackTraceLimit)}(n))for(;n;){if(Dr(n)===e)return!0;n=Object.getPrototypeOf(n)}return!1}function Wr(t,n){var e=t instanceof Element||t instanceof HTMLDocument;return e&&n?function(t,n){return void 0===n&&(n=""),t&&t.nodeName===n.toUpperCase()}(t,n):e}function Hr(t){var n=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(n))}}Lr.bind(null,"undefined"),Lr.bind(null,"boolean"),Lr.bind(null,"symbol"),Rr.bind(null,TypeError),Rr.bind(null,SyntaxError),Hr(Wr,"form"),Hr(Wr,"button"),Hr(Wr,"input"),Hr(Wr,"select");var qr="EventListener";function Vr(t,n){if($r(t))return n?Vr(document.querySelectorAll(t)):(e=t).split(e.indexOf(",")>-1?",":" ").map((function(t){return t.trim()}));var e;if(NodeList.prototype.isPrototypeOf(t)){for(var r=[],i=t.length>>>0;i--;)r[i]=t[i];return r}var o=function(t){return t?function(t){return"array"===Dr(t)}(t)?t:[t]:[]}(t);return n?o.map((function(t){return $r(t)?Vr(t,!0):t})).flat():o}function Fr(t,n){var e;return function(){return t&&(e=t.apply(n||this,arguments),t=null),e}}var Gr=function(t,n,e,r){var i=e||Nr,o=r||!1;if(!_r)return i;var u=Vr(n),a=Vr(t,!0);if(!a.length)throw new Error("noElements");if(!u.length)throw new Error("noEvent");var c=[];return function t(n){n&&(c=[]);for(var e=n?"add"+qr:"remove"+qr,r=0;r<a.length;r++){var s=a[r];c[r]=n?o&&o.once?Fr(i):i:c[r]||i;for(var f=0;f<u.length;f++)s[e]?s["on"+u[f]]=n?c[r]:null:s[e](u[f],c[r],o)}return t.bind(null,!n)}("Event")};function Jr(t,n){return _r&&zr(window[t])?(e=window[t],r=n,void 0===(i=window)&&(i=null),zr(e)?function(){e.apply(i,arguments),r.apply(i,arguments)}:r):window[t]=n;var e,r,i}Jr.bind(null,"onerror"),Jr.bind(null,"onload");var Xr="undefined"==typeof window,Kr="hidden";var Br=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Yr(t,n){void 0===n&&(n={});var e=function(t,n){var e=this,r=!1;return function(i){r||(t.call(e,i),r=!0,setTimeout((function(){return r=!1}),n))}}(t,n.throttle||1e4),r=[];function i(){var t=function(t){if(Xr)return!1;var n=Xr||Kr in document?Kr:["webkit","moz","ms","o"].reduce((function(t,n){var e=n+"Hidden";return!t&&e in document?e:t}),null),e="".concat(n.replace(/[H|h]idden/,""),"visibilitychange"),r=function(){return t(Boolean(document[n]))},i=function(){return document.addEventListener(e,r)};return i(),function(){return document.removeEventListener(e,r),i}}((function(t){t||e({type:"tabVisible"})}));return r=[t].concat(Br.map((function(t){return Gr(document,t,e)}))).concat(Gr(window,"load",e)).concat(Gr(window,"scroll",e,{capture:!0,passive:!0})),o}function o(){r.map((function(t){return t()}))}return i(),function(){return o(),i}}function Zr(t,n){return n?0:Math.round((new Date-t)/1e3)}var Qr="object",ti="string",ni="name",ei="version",ri="",ii="function",oi="undefined",ui={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},ai=[[/microsoft (windows) (vista|xp)/i],[ni,ei],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[ni,[ei,si,ui]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[ni,"Windows"],[ei,si,ui]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[ei,/_/g,"."],[ni,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[ni,"MacOS"],[ei,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[ei,ni],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[ni,ei],[/\(bb(10);/i],[ei,[ni,"BlackBerry"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[ei,[ni,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[ei,[ni,"webOS"]],[/crkey\/([\d\.]+)/i],[ei,[ni,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[ni,"Chromium OS"],ei],[/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/(unix) ?([\w\.]*)/i],[ni,ei]];function ci(t,n){for(var e,r,i,o,u,a,c=0;c<n.length&&!u;){var s=n[c],f=n[c+1];for(e=r=0;e<s.length&&!u;)if(u=s[e++].exec(t))for(i=0;i<f.length;i++)a=u[++r],d(o=f[i])===Qr&&o.length>0?2==o.length?this[o[0]]=d(o[1])==ii?o[1].call(this,a):o[1]:3==o.length?this[o[0]]=d(o[1])!==ii||o[1].exec&&o[1].test?a?a.replace(o[1],o[2]):void 0:a?o[1].call(this,a,o[2]):void 0:4==o.length&&(this[o[0]]=a?o[3].call(this,a.replace(o[1],o[2])):void 0):this[o]=a||void 0;c+=2}}function si(t,n){for(var e in n)if(d(n[e])===Qr&&n[e].length>0){for(var r=0;r<n[e].length;r++)if(fi(n[e][r],t))return"?"===e?void 0:e}else if(fi(n[e],t))return"?"===e?void 0:e;return t}function fi(t,n){return d(t)===ti&&-1!==li(n).indexOf(li(t))}function li(t){return t.toLowerCase()}function di(t){var n=t||(("undefined"==typeof window?"undefined":d(window))!==oi&&window.navigator&&window.navigator.userAgent?window.navigator.userAgent:ri),e={};return e[ni]=void 0,e[ei]=void 0,ci.call(e,n,ai),e}var hi="Brave";function vi(){if("undefined"==typeof window)return{};if(!window.navigator)return{};var t,n,e,r,i,o=window.navigator,u=o.platform,a=o.product,c=o.vendor,s=function(t){var n=t.userAgent,e=/.+(Opera[\s[A-Z]*|OPR[\sA-Z]*)\/([0-9\.]+).*/i.exec(n);if(e)return{type:e[1],version:e[2]};var r=/.+(Trident|Edge)\/([0-9\.]+).*/i.exec(n);if(r)return{type:r[1],version:r[2]};var i=/(headlesschrome)(?:\/([\w\.]+)| )/i.exec(n);if(i)return{type:i[1],version:i[2]};var o=/.+(Chrome|Firefox|FxiOS)\/([0-9\.]+).*/i.exec(n);if(o)return{type:t.brave&&t.brave.isBrave?hi:o[1],version:o[2]};var u=/.+(Safari)\/([0-9\.]+).*/i.exec(n);if(u)return{type:u[1],version:u[2]};var a=/.+(AppleWebKit)\/([0-9\.]+).*/i.exec(n);if(a)return{type:a[1],version:a[2]};var c=/.*([A-Z]+)\/([0-9\.]+).*/i.exec(n)||["","NA","0.0.0"];return{type:c[1],version:c[2]}}(window.navigator),f=s.type,l=s.version,d=f===hi?f:(c||"").split(" ")[0];return{platform:u,os:di(),make:d||a,model:f,version:l,name:[f,l].join("/"),language:(n=window.navigator,e=n.language,r=n.browserLanguage,i=n.languages,(e||r||(i||["en_US"])[0]).toLowerCase().replace("-","_")),timezone:(t=/\(([A-Za-z\s].*)\)/.exec((new Date).toString()),t&&t[1]||"")}}function pi(t){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})[t]||t}function wi(t){return mi.apply(this,arguments)}function mi(){return mi=s(er.mark((function t(n){var e,r,i,o,u,a,c=arguments;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=c.length>1&&void 0!==c[1]&&c[1],r={},t.t0=er.keys(n);case 3:if((t.t1=t.t0()).done){t.next=13;break}return i=t.t1.value,o=Array.isArray(n[i])?n[i]:[n[i]],u=e?o:o[0],t.next=9,gi(u,Oi);case 9:Ei(a=t.sent)||(r[i]=a),t.next=3;break;case 13:return t.abrupt("return",r);case 14:case"end":return t.stop()}}),t)}))),mi.apply(this,arguments)}function bi(t){return yi.apply(this,arguments)}function yi(){return(yi=s(er.mark((function t(n){var e,r;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e={},t.t0=er.keys(n);case 2:if((t.t1=t.t0()).done){t.next=9;break}return r=t.t1.value,t.next=6,gi(n[r],Si);case 6:e[r]=t.sent,t.next=2;break;case 9:return t.abrupt("return",e);case 10:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function gi(t,n){return ji.apply(this,arguments)}function ji(){return(ji=s(er.mark((function t(n,e){return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof n){t.next=4;break}return t.next=3,n();case 3:n=t.sent;case 4:return t.abrupt("return",e(n));case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Oi(t){if(null!=t)return Array.isArray(t)?t.filter(ki).map((function(t){return t.toString()})):Ei(t)?t:t.toString()}function Si(t){return parseFloat(Number(Array.isArray(t)?t[0]:t))}function ki(t){return null!=t}function Ei(t){return null==t}var Ai="_session.start",Ii="_session.stop",xi="pageView";function Ti(t){return Ni.apply(this,arguments)}function Ni(){return Ni=s(er.mark((function t(n){var e,r,i,o,u,a,c,s,l,d,h,v,p,w,m,b,y,g,j,O,S,k,E,A,I,x,T,N,_,P=arguments;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=P.length>1&&void 0!==P[1]?P[1]:{},i=(r=P.length>2&&void 0!==P[2]?P[2]:{}).appTitle,o=r.appPackageName,u=r.appVersionCode,a=r.enrichEventAttributes,c=r.enrichEventMetrics,s=r.debug?console.log:function(){},l=pi(n,r.eventMapping),d=hr(),h=e.sessionId||d.id,v=e.sessionStart||d.createdAt,p=e.sessionStart?new Date(e.sessionStart).getTime():d.created,s("event sessionData ",JSON.stringify(d)),yr&&(w=mr(),m=pr(),s("event pageSessionInfo",JSON.stringify(w)),s("event tabSessionData ",JSON.stringify(m))),b=e.attributes||{},y=e.eventId||J(),g=e.time?new Date(e.time):new Date,j=g.toISOString(),O=g.getTime()-p,S=Qe({date:j,sessionId:h},yr?{pageSession:w.id}:{}),!a){t.next=23;break}return t.next=20,a();case 20:t.t0=t.sent,t.next=24;break;case 23:t.t0={};case 24:if(k=t.t0,E=Qe(Qe(Qe({},S),k),b),A=e.metrics||{},I={sessionTime:d.elapsed||O,hour:g.getHours(),day:g.getDay()+1,month:g.getMonth()+1,year:g.getFullYear()},!c){t.next=34;break}return t.next=31,c();case 31:t.t1=t.sent,t.next=35;break;case 34:t.t1={};case 35:return x=t.t1,T=Qe(Qe(Qe({},I),x),A),t.next=39,wi(E);case 39:return t.t2=t.sent,t.next=42,bi(T);case 42:return t.t3=t.sent,N={attributes:t.t2,metrics:t.t3},s("".concat(y,":").concat(l)),s("eventAttributes",N.attributes),s("eventMetrics",N.metrics),yr&&s("clientInfo",vi()),_=f({},y,Qe(Qe({EventType:l,Timestamp:j,AppPackageName:o,AppTitle:i},u?{AppVersionCode:u}:{}),{},{Attributes:N.attributes,Metrics:N.metrics,Session:{Id:h,StartTimestamp:v}})),n===Ii&&(_[y].Session.Duration=O,_[y].Session.StopTimestamp=j),t.abrupt("return",_);case 51:case"end":return t.stop()}}),t)}))),Ni.apply(this,arguments)}var _i="__endpoint";function Pi(t){return"".concat(_i,".").concat(t)}var Mi,Ci="__endpoint",Di=!1;function Li(){return zi.apply(this,arguments)}function zi(){return zi=s(er.mark((function t(){var n,e,r,i,o,u,a,c,s,f,l,d,h,v,p,w,m,b,y,g,j,O=arguments;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=O.length>0&&void 0!==O[0]?O[0]:{},r=(e=O.length>1&&void 0!==O[1]?O[1]:{}).getUserId,i=e.getEndpointId,o=e.endpointMigration,u=qi(e),a=u.sessionKey?u.sessionKey():"sessions",c=u.pageViewKey?u.pageViewKey():"pageViews",yr&&(l=vi(),s=mr(),f=s.id),d=hr(),t.next=10,i();case 10:if(h=t.sent,Di||(Di=!0,(v=ke(Ci))&&($i(h,v),Ae(Ci))),p=Ui(h),w=Wi(e),m=Ri(w,l),b={Attributes:{},Demographic:m,Location:{},Metrics:{}},yr&&(l.device&&l.device.vendor&&(b.Attributes.DeviceMake=[l.device.vendor]),l.device&&l.device.model&&(b.Attributes.DeviceModel=[l.device.model]),l.device&&l.device.type&&(b.Attributes.DeviceType=[l.device.type])),!(n=xr.all([p,b,n],{arrayMerge:Hi})).User||!n.User.UserId){t.next=23;break}return t.next=21,r();case 21:n.User.UserId!==(y=t.sent)&&(n.User.UserId=y);case 23:if(n.User&&n.User.UserId){t.next=28;break}return t.next=26,r();case 26:(g=t.sent)&&(n.User=n.User||{},n.User.UserId=g);case 28:if(!n.User||!n.User.UserAttributes){t.next=32;break}return t.next=31,wi(n.User.UserAttributes,!0);case 31:n.User.UserAttributes=t.sent;case 32:return t.next=34,wi(n.Attributes,!0);case 34:return n.Attributes=t.sent,t.next=37,bi(n.Metrics);case 37:if(n.Metrics=t.sent,n.Metrics[a]||(n.Metrics[a]=1),n.Metrics[c]||(n.Metrics[c]=1),o&&(n=o(h,n)),j=n.Attributes.lastSession){t.next=47;break}return n.Attributes.lastSessionDate=[d.createdAt],n.Attributes.lastSession=[d.id],f&&(n.Attributes.lastPageSession=[f]),t.abrupt("return",$i(h,n));case 47:return j&&j[0]!==d.id&&(n.Attributes.lastSessionDate=[d.createdAt],n.Attributes.lastSession=[d.id],n.Metrics[a]+=1),n.Attributes&&n.Attributes.lastPageSession&&Array.isArray(n.Attributes.lastPageSession)&&n.Attributes.lastPageSession.length>0&&n.Attributes.lastPageSession[0]!==f&&(n.Attributes.lastPageSession=[f],n.Metrics[c]+=1),t.abrupt("return",$i(h,n));case 50:case"end":return t.stop()}}),t)}))),zi.apply(this,arguments)}function $i(t,n){var e=Pi(t),r="string"==typeof n?n:JSON.stringify(n);return Ee(e,r),n}function Ui(t){try{return JSON.parse(ke(Pi(t)))||{}}catch(t){}return{}}function Ri(t,n){return yr?function(t,n){var e={AppVersion:t,Locale:n.language,Make:n.make,Model:n.model,ModelVersion:n.version,Platform:n.os.name||n.platform};return n.os&&n.os.version&&(e.PlatformVersion=n.os.version),e}(t,n):function(t){return{AppVersion:t,Make:"generic server",Platform:"Node.js",PlatformVersion:process.version}}(t)}function Wi(t){var n=t.appTitle||t.appPackageName||"",e=t.appVersionCode||"0.0.0";return n?"".concat(n,"@").concat(e):e}function Hi(t,n){return n}function qi(t){var n=t.getContext;return"function"==typeof n?n():n}var Vi=[429,500],Fi=[202],Gi=400;function Ji(t,n){return Xi.apply(this,arguments)}function Xi(){return Xi=s(er.mark((function t(n,e){var r,i,o,u,a,c,s,f,l,d,h,v,p,w,m,b,y;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.pinpointRegion,i=e.pinpointAppId,o=e.lambdaArn,u=e.lambdaRegion,a=e.credentials,c=e.getCredentials,s=e.debug,t.next=3,Ki(a,c);case 3:return f=t.sent,s&&console.log("pinpoint auth",f),l=r||u,d=!0===e.fips?"-fips":"",h="https://lambda.".concat(u||r,".amazonaws.com/2015-03-31/functions/").concat(o,"/invocations"),v="https://pinpoint".concat(d,".").concat(l,".amazonaws.com/v1/apps/").concat(i,"/events"),p=o?h:v,b={body:JSON.stringify(n)},w=new Tr.exports.AwsClient(f),t.next=16,w.fetch(p,b).then((function(t){return t.json()}));case 16:m=t.sent,t.next=24;break;case 19:return w=new Mi.PinpointClient({credentials:f,region:r}),y=new Mi.PutEventsCommand({ApplicationId:i,EventsRequest:n}),t.next=23,w.send(y);case 23:m=t.sent;case 24:return m&&m.Results&&Object.keys(m.Results).map((function(t){return m.Results[t]})).forEach((function(t){var n=t.EndpointItemResponse||{},e=t.EventsItemResponse||{};Object.keys(n).length&&(Fi.includes(n.StatusCode)||Vi.includes(n.StatusCode)||Yi(n,Endpoint));var r=Object.keys(e);r.length&&r.forEach((function(){}))})),t.abrupt("return",m);case 26:case"end":return t.stop()}}),t)}))),Xi.apply(this,arguments)}function Ki(t,n){return Bi.apply(this,arguments)}function Bi(){return(Bi=s(er.mark((function t(n,e){var r;return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n,Object.keys(r).length||!e){t.next=11;break}return t.prev=2,t.next=5,e();case 5:r=t.sent,t.next=11;break;case 8:throw t.prev=8,t.t0=t.catch(2),new Error(t.t0);case 11:return t.abrupt("return",{accessKeyId:r.accessKeyId||r.AccessKeyId,secretAccessKey:r.secretAccessKey||r.SecretKey,sessionToken:r.sessionToken||r.SessionToken,retries:5});case 13:case"end":return t.stop()}}),t,null,[[2,8]])})))).apply(this,arguments)}function Yi(t){var n=t.Message;if(t.StatusCode===Gi){if(n.startsWith("Missing ChannelType"))throw new Error("Missing ChannelType");if(n.startsWith("Exceeded maximum endpoint per user count"))throw new Error("Exceeded maximum endpoint per user count")}}var Zi=["PUSH","GCM","APNS","APNS_SANDBOX","APNS_VOIP","APNS_VOIP_SANDBOX","ADM","SMS","VOICE","EMAIL","BAIDU","CUSTOM"].reduce((function(t,n){return t[n]=n,t}),{}),Qi=vi(),to=Ai,no=Ii,eo=/.+\@.+\..+/;function ro(t){try{return JSON.parse(ke(Pi(t)))||{}}catch(t){}return{}}function io(t){return t.sort((function(t,n){var e=t.EventType,r=n.EventType;return e==to?-1:r==to||e==no?1:r==no?-1:void 0})).reduce((function(t,n){return Qe(Qe({},n),t)}),{})}function oo(t,n,e){return{BatchItem:f({},t,{Endpoint:n,Events:e})}}var uo=Ii;function ao(){return{}}function co(){throw new Error("Pinpoint not loaded")}function so(t){var n=t.config,e=t.instance;n&&n.disableAnonymousTraffic&&!e.user("userId")&&e.once("identifyStart",(function(t){t.plugins["aws-pinpoint"].loaded()||e.loadPlugin("aws-pinpoint")}))}var fo={disableAnonymousTraffic:!1,pinpointRegion:"us-east-1",eventMapping:{}},lo=function(){var t,n,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!1;return{name:"aws-pinpoint",config:Qe(Qe({},fo),e),bootstrap:so,initialize:function(r){var i=r.config,o=r.instance,u=i.disableAnonymousTraffic,a=i.debug?console.log:function(){},c=o.getState(),f=c.user||{},l=f.userId,h=f.anonymousId,v=c.context||{},p=v.app,w=v.version,m=v.campaign,b=mr(),y=pr(),g=hr();if(a("initPageSession",b),a("initTabSession",y),a("initSessionData",g),g&&g.anonId&&g.anonId!==h){a("anonId different refresh session details"),br(),wr();var j=vr(30,{anonId:h,userId:l});a("newSessionForNewUser",j)}if(!l&&u)return!1;var O=Object.keys(m).reduce((function(t,n){return t["utm_".concat(n)]=m[n],t}),{}),S=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Qe({getContext:t.getContext||ao,credentials:t.credentials||{},getEndpointId:t.getEndpointId},t),e=n.debug?console.log:function(){},r=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getEndpointId,e=t.debug;return function(){var r=s(er.mark((function r(){var i,o,u,a,c,s,f,l,h,v=arguments;return er.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=v.length>0&&void 0!==v[0]?v[0]:[],o=v.length>1&&void 0!==v[1]?v[1]:{},r.next=4,n();case 4:if(u=r.sent){r.next=8;break}return console.error("No endpoint id. check getEndpointId()"),r.abrupt("return");case 8:if("object"===d(o)&&Object.keys(o).length){r.next=13;break}r.t0=ro(u),r.next=16;break;case 13:return r.next=15,Li(o,t);case 15:r.t0=r.sent;case 16:return c=(a=r.t0).ChannelType,a.Address&&eo.test(a.Address)&&(c=Zi.EMAIL),!c&&a.Address&&(c="android"===Qi.platform?c||Zi.GCM:c||Zi.APNS),e&&(console.log("Endpoint",a),console.log("CHANNEL_TYPE",c)),a.RequestId=J(),a.ChannelType=c,a.Address&&(a.OptOut=a.OptOut||"NONE"),s=io(i),f=oo(u,a,s),r.prev=26,r.next=29,Ji(f,t);case 29:l=r.sent,r.next=36;break;case 32:r.prev=32,r.t1=r.catch(26),console.log("Error calling AWS",r.t1),h=r.t1;case 36:return r.abrupt("return",{endpoint:a,response:l,error:h,events:i});case 37:case"end":return r.stop()}}),r,null,[[26,32]])})));return function(){return r.apply(this,arguments)}}()}(n),i=function(t,n){var e,r,i,o=(n=n||{}).initial||[],u=n.max||1/0,a=n.interval||1e4,c=n.onEmpty||rr,s=n.onPause||rr;function f(n){clearInterval(e);var r=o.splice(0,u);return r.length&&t(r,o),o.length?n?f():l():(i=!1,c(o))}function l(){i=!0,e=setInterval(f,a)}return o.length&&l(),{flush:function(t){f(t)},resume:f,push:function(t){return(r=o.push(t))>=u&&!n.throttle&&f(),i||l(),r},size:function(){return o.length},pause:function(t){t&&f(),clearInterval(e),i=!1,s(o)}}}(function(){var t=s(er.mark((function t(n){return er.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n.forEach((function(t){return e("> Queue event",t)})),t.next=3,r(n,{});case 3:e("> Queue response",t.sent);case 5:case"end":return t.stop()}}),t)})));return function(n,e){return t.apply(this,arguments)}}(),{max:10,interval:t.flushInterval||3e3,throttle:!0}),o=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(){var e=s(er.mark((function e(r){var i,o,u,a,c=arguments;return er.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=c.length>2&&void 0!==c[2]?c[2]:{},u=c.length>3&&void 0!==c[3]&&c[3],gr(i=c.length>1&&void 0!==c[1]?c[1]:{})&&(u=i={}),gr(o)&&(u=o={}),e.next=7,Ti(r,i,n);case 7:if(a=e.sent,!Object.entries(o).length&&r!==xi){e.next=12;break}return e.next=11,Li(o,n);case 11:o=e.sent;case 12:if(t.push(a),!u){e.next=17;break}return e.abrupt("return",t.flush());case 17:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}(i,n);Li({},t);var u=function(t){if(!yr)return ao;var n=function(t){return function(){t(uo,!0)}}(t);return window.addEventListener("beforeunload",n),function(){return window.removeEventListener("beforeunload",n)}}(o);return{updateEndpoint:function(t){return r([],t)},recordEvent:o,disable:function(){u()}}}(Qe(Qe({},i),{},{appTitle:i.appTitle||p,appPackageName:i.appPackageName||p,appVersionCode:i.appVersionCode||w,eventMapping:i.eventMapping,getEndpointId:function(){return o.user("anonymousId")},getUserId:function(){return o.user("userId")},getContext:function(){return{sessionKey:i.sessionKey,pageViewKey:i.pageViewKey,initialSession:g}},enrichEventAttributes:function(){return Qe({anonId:o.user("anonymousId"),userId:o.user("userId"),hash:window.location.hash,path:window.location.pathname,referrer:document.referrer,search:window.location.search,title:document.title,host:window.location.hostname,url:window.location.origin+window.location.pathname},O)},enrichUserAttributes:i.enrichUserAttributes,enrichEventMetrics:function(){return{}}}));t=S.recordEvent,n=S.updateEndpoint,g&&g.isNew&&(a("Start brand new session because cookie not found"),t(Ai)),function(t){var n,e,r=t.onIdle,i=t.onWakeUp,o=t.onHeartbeat,u=t.timeout,a=void 0===u?1e4:u,c=t.throttle,s=void 0===c?2e3:c,f=!1,l=new Date;Yr((function(t){clearTimeout(n),o&&!f&&o(Zr(l),t),i&&f&&(f=!1,i(Zr(e),t),l=new Date),n=setTimeout((function(){f=!0,r&&(e=new Date,r(Zr(l),t))}),a)}),{throttle:s})}({timeout:18e5,throttle:2e4,onIdle:function(n){var r;a("Session idle. Active ".concat(n," seconds")),r=hr(),e.debug&&console.log("Stop session",r),t(Ii,!0)},onWakeUp:function(n){var r;a("Session wakeup. Idle ".concat(n," seconds")),r=vr(30),e.debug&&console.log("START SESSION",r),t(Ai)},onHeartbeat:function(t){a("ping session",new Date),a("total active time",t);var n=o.user();!function(t,n){void 0===t&&(t=30),vr(t||1,n,!0)}(30,{anonId:n.anonymousId,userId:n.userId})}})},page:function(){if(!t)return co();r&&br(),t(xi),r=!0},track:function(n){var e=n.payload,r=n.config;if(!t)return co();if(!r.disableAnonymousTraffic||e.userId){var i,o=(i=e.properties,Object.keys(i).reduce((function(t,n){var e=i[n];return"number"==typeof e&&(t.metrics[n]=e),"string"!=typeof e&&"boolean"!=typeof e||(t.attributes[n]=e),t}),{attributes:{},metrics:{}}));t(e.event,o)}},identify:function(t){var e=t.payload,r=e.userId,i=e.traits;if(!n)return co();var o={},u={};r&&(u.UserId=r),i&&Object.keys(i).length&&(u.UserAttributes=i),Object.keys(u).length&&(o.User=u),n(o,!0)},reset:function(t){var n=Pi(t.instance.user("anonymousId"));Ae(n)},loaded:function(){return!!t}}};function ho(t,n){var e=vo(t,n),r=v({httpMethod:"GET"},n);return h(e,r)}var vo=function(t,n){return("string"==typeof n?n:p(n))+"/content/items/"+t};class po{constructor(t){this.name="amazon";const{app:n={},fips:e,userPoolID:r}=t;this.analytics=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return de(Ye(Ye({},{storage:Xe}),t))}({app:n.name,version:n.version,plugins:[lo({fips:e,pinpointAppId:n.id,getCredentials:()=>function(t,n={}){const e=`https://cognito-identity${!0===n.fips?"-fips":""}.us-east-1.amazonaws.com/`;let r=m.get(k);if(r&&Date.now()/1e3<r.Expiration)return Promise.resolve(r);const i={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetId"},body:JSON.stringify({IdentityPoolId:t})};return fetch(e,i).then((t=>{if(!t.ok)throw new Error(t.statusText);return t.json()})).then((t=>{const{IdentityId:n}=t,r={method:"POST",headers:{"Content-type":"application/x-amz-json-1.1","X-Amz-Target":"AWSCognitoIdentityService.GetCredentialsForIdentity"},body:JSON.stringify({IdentityId:n})};return fetch(e,r)})).then((t=>{if(!t.ok)throw new Error(t.statusText);return t.json()})).then((({Credentials:t})=>(m.set(k,t),t)))}(r,{fips:e})})]}),Object.assign(this,t)}init(){return Promise.resolve()}static async setAccessPermissions({id:t,authentication:n,username:e,accessChangeset:r}){return async function({id:t,authentication:n,username:e,accessChangeset:r}){const{properties:i={}}=await ho(t,{authentication:n}),o=i.telemetry,u=void 0===o?{}:o,{arcgis:{access:a={}}={}}=u,c=O(u,["arcgis"]),s=function(t,n,e){return e.reduce(((n,e)=>{const{action:r,targetProperty:i}=e;return"add"===r?n[i]={updatedAt:new Date,updatedBy:t}:"remove"===r&&delete n[i],n}),n)}(e,a,r);return w({item:{id:t,properties:Object.assign(Object.assign({},i),{telemetry:Object.assign(Object.assign({},c),{arcgis:{access:Object.assign({},s)}})})},authentication:n})}({id:t,authentication:n,username:e,accessChangeset:r})}static async getAccessPermissions({id:t,authentication:n}){return async function({id:t,authentication:n}){const{properties:{telemetry:{arcgis:{access:e={}}={}}={}}}=await ho(t,{authentication:n});return{access:e}}({id:t,authentication:n})}logPageView(t,n){const e=function({page:t,previousPage:n={},options:e={},dimensionLookup:r={},metricLookup:i={}}){const o=T(e,i),u=E({telemetryData:e,dimensionLookup:r,excludeKeys:["workflow",...Object.keys(o),...Object.keys(i)]}),{referrer:a,title:c}=document||{},{hostname:s,pathname:f}=window&&window.location?window.location:{};return Object.assign(Object.assign({name:"pageView",referrer:a,hostname:s,path:t||f,pageUrl:t||f,pageName:c,previousPageUrl:n.pageUrl,previousPageName:n.pageName},u),o)}({page:t,previousPage:this.previousPage,options:n,dimensionLookup:this.dimensions,metricLookup:this.metrics}),{pageUrl:r,pageName:i}=e;this.previousPage={pageUrl:r,pageName:i},this.analytics.track("pageView",e)}logEvent(t={}){const n=function({event:t={},dimensionLookup:n={},metricLookup:e={}}){var r,i;const{pathname:o,eventType:u="other"}=t,a=T(t,e),c=E({telemetryData:Object.assign({eventType:u},t),dimensionLookup:n,excludeKeys:["workflow","pathname",...Object.keys(a),...Object.keys(e)]}),s=Object.assign(Object.assign({name:u},c),a);return"undefined"!=typeof document&&document.referrer&&(s.referrer=document.referrer),"undefined"==typeof window||s.hostname||(s.hostname=null===(r=window.location)||void 0===r?void 0:r.hostname),s.path="undefined"!=typeof window&&window.location.pathname?null===(i=window.location)||void 0===i?void 0:i.pathname:o,s}({event:t,dimensionLookup:this.dimensions,metricLookup:this.metrics}),{name:e}=n;this.analytics.track(e,n)}}const wo=class{constructor(e){t(this,e),this.consentGranted=n(this,"consentGranted",7),this.amazonAppId=void 0,this.amazonAppName=void 0,this.amazonUserPoolID=void 0,this.amazonVersion=void 0,this.firstUseVar=void 0,this.locale=void 0,this.measurementIds=void 0,this.portal=void 0,this._open=void 0,this._translations=void 0}get el(){return e(this)}_loaded=!1;_telemetryInstance;async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}async getInstance(){return"true"===localStorage.getItem(this.firstUseVar)||this.portal.eueiEnabled?(await this._init(),this._telemetryInstance):void 0}consentGranted;async componentWillLoad(){await this._getTranslations(),this._open=null===localStorage.getItem(this.firstUseVar)}render(){return r(i,{key:"6b5a4571e972d6d79948cbf186119372456b5e1e"})}async componentDidLoad(){this.consentGranted.emit({granted:"true"===localStorage.getItem(this.firstUseVar)})}async _init(){if(!this._loaded){const t={plugins:[],portal:this.portal};if(this.measurementIds?.length>0){const n=new S({measurementIds:this.measurementIds});t.plugins.push(n)}if(this.amazonUserPoolID){const n=new po({userPoolID:this.amazonUserPoolID,app:{name:this.amazonAppName,id:this.amazonAppId,version:this.amazonVersion}});t.plugins.push(n)}this._telemetryInstance=new j(t),await this._telemetryInstance.init(),this._loaded=!0}}_alertClosed(){this._open=!1,"true"!==localStorage.getItem(this.firstUseVar)&&localStorage.setItem(this.firstUseVar,"false")}_accept(){localStorage.setItem(this.firstUseVar,"true"),this.consentGranted.emit({granted:!0}),this._open=!1}async _getTranslations(){const t=await o(this.el);this._translations=t[0]}static get watchers(){return{locale:["localeWatchHandler"]}}};wo.style=":host{display:block}.consent-panel{position:fixed;display:block;z-index:5000;bottom:0;left:0;width:100%;height:auto;text-align:center}.cookie-consent-popup-container{position:relative;display:block;bottom:0;left:0;width:100%;margin:0;padding-top:1rem;padding-bottom:1rem;transition:transform 0.5s ease-out 0s;background-color:rgba(51, 51, 51, 0.95);color:#fff}.button-container{position:static;margin-bottom:1rem;display:flex;justify-content:center;flex-wrap:wrap}.padding-end-1{padding-inline-end:1rem}.link-text{--calcite-ui-text-link:var(--calcite-color-text-inverse);--calcite-ui-brand:var(--calcite-color-text-inverse);--calcite-color-text-link:var(--calcite-color-text-inverse);--calcite-color-brand-underline:var(--calcite-color-text-inverse);--calcite-color-brand:var(--calcite-color-text-inverse)}";export{wo as consent_manager}
|
@@ -18,4 +18,4 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
18
18
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
19
19
|
PERFORMANCE OF THIS SOFTWARE.
|
20
20
|
***************************************************************************** */
|
21
|
-
var p=function(){return p=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},p.apply(this,arguments)};function w(t,e){var i=e;return i.rawResponse=!1,c(t,i).then((function(t){var e={token:t.access_token,username:t.username,expires:new Date(Date.now()+(1e3*t.expires_in-1e3)),ssl:!0===t.ssl};return t.refresh_token&&(e.refreshToken=t.refresh_token),e}))}function m(t,e){var i=e;return i.params.referer="undefined"!=typeof window&&window.location&&window.location.host?window.location.host:u,c(t,i)}var g=/^https?:\/\/(\S+)\.arcgis\.com.+/;function v(t){return g.test(t)}function b(t){if(!g.test(t))return null;var e=t.match(g)[1].split(".").pop();return e.includes("dev")?"dev":e.includes("qa")?"qa":"production"}var k=function(){function t(t){if(this.clientId=t.clientId,this._refreshToken=t.refreshToken,this._refreshTokenExpires=t.refreshTokenExpires,this.username=t.username,this.password=t.password,this._token=t.token,this._tokenExpires=t.tokenExpires,this.portal=t.portal?l(t.portal):"https://www.arcgis.com/sharing/rest",this.ssl=t.ssl,this.provider=t.provider||"arcgis",this.tokenDuration=t.tokenDuration||20160,this.redirectUri=t.redirectUri,this.refreshTokenTTL=t.refreshTokenTTL||20160,this.server=t.server,this.federatedServers={},this.trustedDomains=[],t.server){var e=this.getServerRootUrl(t.server);this.federatedServers[e]={token:t.token,expires:t.tokenExpires}}this._pendingTokenRequests={}}return Object.defineProperty(t.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenExpires",{get:function(){return this._tokenExpires},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refreshToken",{get:function(){return this._refreshToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refreshTokenExpires",{get:function(){return this._refreshTokenExpires},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trustedServers",{get:function(){return console.log("DEPRECATED: use federatedServers instead"),this.federatedServers},enumerable:!1,configurable:!0}),t.beginOAuth2=function(e,i){void 0===i&&(i=window),e.duration&&console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");var n,s=p({portal:"https://www.arcgis.com/sharing/rest",provider:"arcgis",expiration:20160,popup:!0,popupWindowFeatures:"height=400,width=600,menubar=no,location=yes,resizable=yes,scrollbars=yes,status=yes",state:e.clientId,locale:""},e),r=s.portal,o=s.provider,a=s.clientId,h=s.expiration,c=s.redirectUri,u=s.popup,l=s.popupWindowFeatures,w=s.state,m=s.locale,g=s.params;if(n="arcgis"===o?r+"/oauth2/authorize?client_id="+a+"&response_type=token&expiration="+(e.duration||h)+"&redirect_uri="+encodeURIComponent(c)+"&state="+w+"&locale="+m:r+"/oauth2/social/authorize?client_id="+a+"&socialLoginProviderName="+o+"&autoAccountCreateForSocial=true&response_type=token&expiration="+(e.duration||h)+"&redirect_uri="+encodeURIComponent(c)+"&state="+w+"&locale="+m,g&&(n=n+"&"+f(g)),u){var v,b=((v={promise:null,resolve:null,reject:null}).promise=new Promise((function(t,e){v.resolve=t,v.reject=e})),v);return i["__ESRI_REST_AUTH_HANDLER_"+a]=function(e,i){if(e){var n=JSON.parse(e);b.reject(new d(n.errorMessage,n.error))}else if(i){var s=JSON.parse(i);b.resolve(new t({clientId:a,portal:r,ssl:s.ssl,token:s.token,tokenExpires:new Date(s.expires),username:s.username}))}},i.open(n,"oauth-window",l),b.promise}i.location.href=n},t.completeOAuth2=function(e,i){void 0===i&&(i=window);var n=p({portal:"https://www.arcgis.com/sharing/rest",popup:!0},e),s=n.portal,r=n.clientId,o=n.popup;function a(e,n){try{var a=void 0,h="__ESRI_REST_AUTH_HANDLER_"+r;if(o&&(i.opener?i.opener.parent&&i.opener.parent[h]?a=i.opener.parent[h]:i.opener&&i.opener[h]&&(a=i.opener[h]):i!==i.parent&&i.parent&&i.parent[h]&&(a=i.parent[h]),a))return a(e?JSON.stringify(e):void 0,JSON.stringify(n)),void i.close()}catch(t){throw new d('Unable to complete authentication. It\'s possible you specified popup based oAuth2 but no handler from "beginOAuth2()" present. This generally happens because the "popup" option differs between "beginOAuth2()" and "completeOAuth2()".')}if(e)throw new d(e.errorMessage,e.error);return new t({clientId:r,portal:s,ssl:n.ssl,token:n.token,tokenExpires:n.expires,username:n.username})}var h=i.location.hash.replace(/^#/,"").split("&").reduce((function(t,e){var i=function(t){var e=t.split("="),i=e[1];return{key:decodeURIComponent(e[0]),value:decodeURIComponent(i)}}(e);return t[i.key]=i.value,t}),{});if(!h.access_token){var c=void 0,u="Unknown error";return h.error&&(c=h.error,u=h.error_description),a({error:c,errorMessage:u})}return a(void 0,{token:h.access_token,expires:new Date(Date.now()+1e3*parseInt(h.expires_in,10)-6e4),ssl:"true"===h.ssl,username:h.username})},t.fromParent=function(e,i){var n;return!i&&window&&(i=window),new Promise((function(s,r){i.addEventListener("message",n=function(e){if(e.source===i.parent&&e.data)try{return s(t.parentMessageHandler(e))}catch(t){return r(t)}},!1),i.parent.postMessage({type:"arcgis:auth:requestCredential"},e)})).then((function(t){return i.removeEventListener("message",n,!1),t}))},t.authorize=function(t,e){t.duration&&console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");var i=p({portal:"https://arcgis.com/sharing/rest",expiration:20160},t);e.writeHead(301,{Location:i.portal+"/oauth2/authorize?client_id="+i.clientId+"&expiration="+(t.duration||i.expiration)+"&response_type=code&redirect_uri="+encodeURIComponent(i.redirectUri)}),e.end()},t.exchangeAuthorizationCode=function(e,i){var n=p({portal:"https://www.arcgis.com/sharing/rest",refreshTokenTTL:20160},e),s=n.portal,r=n.clientId,o=n.redirectUri,a=n.refreshTokenTTL;return w(s+"/oauth2/token",{params:{grant_type:"authorization_code",client_id:r,redirect_uri:o,code:i}}).then((function(e){return new t({clientId:r,portal:s,ssl:e.ssl,redirectUri:o,refreshToken:e.refreshToken,refreshTokenTTL:a,refreshTokenExpires:new Date(Date.now()+60*(a-1)*1e3),token:e.token,tokenExpires:e.expires,username:e.username})}))},t.deserialize=function(e){var i=JSON.parse(e);return new t({clientId:i.clientId,refreshToken:i.refreshToken,refreshTokenExpires:new Date(i.refreshTokenExpires),username:i.username,password:i.password,token:i.token,tokenExpires:new Date(i.tokenExpires),portal:i.portal,ssl:i.ssl,tokenDuration:i.tokenDuration,redirectUri:i.redirectUri,refreshTokenTTL:i.refreshTokenTTL})},t.fromCredential=function(e){var i=void 0===e.ssl||e.ssl,n=e.expires||Date.now()+72e5;return new t({portal:e.server.includes("sharing/rest")?e.server:e.server+"/sharing/rest",ssl:i,token:e.token,username:e.userId,tokenExpires:new Date(n)})},t.parentMessageHandler=function(e){if("arcgis:auth:credential"===e.data.type)return t.fromCredential(e.data.credential);if("arcgis:auth:error"===e.data.type){var i=new Error(e.data.error.message);throw i.name=e.data.error.name,i}throw new Error("Unknown message type.")},t.prototype.toCredential=function(){return{expires:this.tokenExpires.getTime(),server:this.portal,ssl:this.ssl,token:this.token,userId:this.username}},t.prototype.getUser=function(t){var e=this;if(this._pendingUserRequest)return this._pendingUserRequest;if(this._user)return Promise.resolve(this._user);var i=this.portal+"/community/self",n=p(p({httpMethod:"GET",authentication:this},t),{rawResponse:!1});return this._pendingUserRequest=c(i,n).then((function(t){return e._user=t,e._pendingUserRequest=null,t})),this._pendingUserRequest},t.prototype.getPortal=function(t){var e=this;if(this._pendingPortalRequest)return this._pendingPortalRequest;if(this._portalInfo)return Promise.resolve(this._portalInfo);var i=this.portal+"/portals/self",n=p(p({httpMethod:"GET",authentication:this},t),{rawResponse:!1});return this._pendingPortalRequest=c(i,n).then((function(t){return e._portalInfo=t,e._pendingPortalRequest=null,t})),this._pendingPortalRequest},t.prototype.getUsername=function(){return this.username?Promise.resolve(this.username):this._user?Promise.resolve(this._user.username):this.getUser().then((function(t){return t.username}))},t.prototype.getToken=function(t,e){return n=t,s=v(i=this.portal),r=v(n),o=b(i),a=b(n),s&&r&&o===a||new RegExp(this.portal,"i").test(t)?this.getFreshToken(e):this.getTokenForServer(t,e);var i,n,s,r,o,a},t.prototype.validateAppAccess=function(t){return this.getToken(this.portal).then((function(e){return function(t,e,i){return void 0===i&&(i="https://www.arcgis.com/sharing/rest"),c(i+"/oauth2/validateAppAccess",{method:"POST",params:{f:"json",client_id:e,token:t}})}(e,t)}))},t.prototype.toJSON=function(){return{clientId:this.clientId,refreshToken:this.refreshToken,refreshTokenExpires:this.refreshTokenExpires,username:this.username,password:this.password,token:this.token,tokenExpires:this.tokenExpires,portal:this.portal,ssl:this.ssl,tokenDuration:this.tokenDuration,redirectUri:this.redirectUri,refreshTokenTTL:this.refreshTokenTTL}},t.prototype.serialize=function(){return JSON.stringify(this)},t.prototype.enablePostMessageAuth=function(t,e){!e&&window&&(e=window),this._hostHandler=this.createPostMessageHandler(t),e.addEventListener("message",this._hostHandler,!1)},t.prototype.disablePostMessageAuth=function(t){!t&&window&&(t=window),t.removeEventListener("message",this._hostHandler,!1)},t.prototype.refreshSession=function(t){return this._user=null,this.username&&this.password?this.refreshWithUsernameAndPassword(t):this.clientId&&this.refreshToken?this.refreshWithRefreshToken():Promise.reject(new d("Unable to refresh token."))},t.prototype.getServerRootUrl=function(t){var e=l(t).split(/\/rest(\/admin)?\/services(?:\/|#|\?|$)/)[0].match(/(https?:\/\/)(.+)/),i=e[1],n=e[2].split("/"),s=n[0],r=n.slice(1);return""+i+s.toLowerCase()+"/"+r.join("/")},t.prototype.getDomainCredentials=function(t){return this.trustedDomains&&this.trustedDomains.length&&this.trustedDomains.some((function(e){return t.startsWith(e)}))?"include":"same-origin"},t.prototype.createPostMessageHandler=function(t){var e=this;return function(i){var n=t.indexOf(i.origin)>-1,s="arcgis:auth:requestCredential"===i.data.type,r=e.tokenExpires.getTime()>Date.now();if(n&&s){var o={};if(r){var a=e.toCredential();a.server=a.server.replace("/sharing/rest",""),o={type:"arcgis:auth:credential",credential:a}}else o={type:"arcgis:auth:error",error:{name:"tokenExpiredError",message:"Session token was expired, and not returned to the child application"}};i.source.postMessage(o,i.origin)}}},t.prototype.getTokenForServer=function(t,e){var i=this,n=this.getServerRootUrl(t),s=this.federatedServers[n];return s&&s.expires&&s.expires.getTime()>Date.now()?Promise.resolve(s.token):(this._pendingTokenRequests[n]||(this._pendingTokenRequests[n]=this.fetchAuthorizedDomains().then((function(){return c(n+"/rest/info",{credentials:i.getDomainCredentials(t)}).then((function(s){if(s.owningSystemUrl){if(r=s.owningSystemUrl,o=l(function(t){if(!g.test(t))return t;switch(b(t)){case"dev":return"https://devext.arcgis.com/sharing/rest";case"qa":return"https://qaext.arcgis.com/sharing/rest";default:return"https://www.arcgis.com/sharing/rest"}}(i.portal)).replace(/https?:\/\//,""),a=l(r).replace(/https?:\/\//,""),new RegExp(a,"i").test(o))return c(s.owningSystemUrl+"/sharing/rest/info",e);throw new d(t+" is not federated with "+i.portal+".","NOT_FEDERATED")}var r,o,a;if(s.authInfo&&void 0!==i.federatedServers[n])return Promise.resolve({authInfo:s.authInfo});throw new d(t+" is not federated with any portal and is not explicitly trusted.","NOT_FEDERATED")})).then((function(t){return t.authInfo.tokenServicesUrl})).then((function(e){return i.token&&i.tokenExpires.getTime()>Date.now()?m(e,{params:{token:i.token,serverUrl:t,expiration:i.tokenDuration,client:"referer"}}):m(e,{params:{username:i.username,password:i.password,expiration:i.tokenDuration,client:"referer"}}).then((function(t){return i._token=t.token,i._tokenExpires=new Date(t.expires),t}))})).then((function(t){return i.federatedServers[n]={expires:new Date(t.expires),token:t.token},delete i._pendingTokenRequests[n],t.token}))}))),this._pendingTokenRequests[n])},t.prototype.getFreshToken=function(t){var e=this;return this.token&&!this.tokenExpires||this.token&&this.tokenExpires&&this.tokenExpires.getTime()>Date.now()?Promise.resolve(this.token):(this._pendingTokenRequests[this.portal]||(this._pendingTokenRequests[this.portal]=this.refreshSession(t).then((function(t){return e._pendingTokenRequests[e.portal]=null,t.token}))),this._pendingTokenRequests[this.portal])},t.prototype.refreshWithUsernameAndPassword=function(t){var e=this,i=p({params:{username:this.username,password:this.password,expiration:this.tokenDuration}},t);return m(this.portal+"/generateToken",i).then((function(t){return e._token=t.token,e._tokenExpires=new Date(t.expires),e}))},t.prototype.refreshWithRefreshToken=function(t){var e=this;if(this.refreshToken&&this.refreshTokenExpires&&this.refreshTokenExpires.getTime()<Date.now())return this.refreshRefreshToken(t);var i=p({params:{client_id:this.clientId,refresh_token:this.refreshToken,grant_type:"refresh_token"}},t);return w(this.portal+"/oauth2/token",i).then((function(t){return e._token=t.token,e._tokenExpires=t.expires,e}))},t.prototype.refreshRefreshToken=function(t){var e=this,i=p({params:{client_id:this.clientId,refresh_token:this.refreshToken,redirect_uri:this.redirectUri,grant_type:"exchange_refresh_token"}},t);return w(this.portal+"/oauth2/token",i).then((function(t){return e._token=t.token,e._tokenExpires=t.expires,e._refreshToken=t.refreshToken,e._refreshTokenExpires=new Date(Date.now()+60*(e.refreshTokenTTL-1)*1e3),e}))},t.prototype.fetchAuthorizedDomains=function(){var t=this;return this.server||!this.portal?Promise.resolve(this):this.getPortal().then((function(e){return e.authorizedCrossOriginDomains&&e.authorizedCrossOriginDomains.length&&(t.trustedDomains=e.authorizedCrossOriginDomains.filter((function(t){return!t.startsWith("http://")})).map((function(t){return t.startsWith("https://")?t:"https://"+t}))),t}))},t}();const y=class{get el(){return t(this)}async serializedAuthenticationWatchHandler(){this.authentication=this.serializedAuthentication?k.deserialize(this.serializedAuthentication):new k({})}async valueWatchHandler(){await this._loadSolution(this.solutionItemId)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}constructor(t){e(this,t),this.authentication=new k({}),this.locale=void 0,this.serializedAuthentication="",this.solutionItemId="",this.showLoading=!1,this._currentEditItemId="",this._organizationVariables="",this._solutionContentsComponent=void 0,this._solutionIsLoaded=!1,this._solutionVariables="",this._templateHierarchy=[],this._translations=void 0,this._treeOpen=!0,this.serializedAuthentication&&(this.authentication=k.deserialize(this.serializedAuthentication)),this._loadSolution(this.solutionItemId),window.addEventListener("solutionStoreHasChanges",(t=>{this._updateSaveability(this._solutionStoreHasChanges=t.detail,this._solutionEditorHasChanges,this._solutionEditorHasErrors)})),window.addEventListener("solutionEditorHasChanges",(t=>{this._updateSaveability(this._solutionStoreHasChanges,this._solutionEditorHasChanges=t.detail,this._solutionEditorHasErrors)})),window.addEventListener("solutionEditorHasErrors",(t=>{this._updateSaveability(this._solutionStoreHasChanges,this._solutionEditorHasChanges,this._solutionEditorHasErrors=t.detail)}))}async componentWillLoad(){return this._getTranslations()}render(){const t=a.getStoreInfo("spatialReferenceInfo"),e=a.getStoreInfo("featureServices").length>0,o=a.getStoreInfo("solutionData");return this._solutionVariables=JSON.stringify(s(o.templates,this._translations)),this._organizationVariables=JSON.stringify(r(this._translations)),i(n,{key:"dd68b412fe4fbf053491eb1a7ec6a3c1703ceb17"},this._solutionIsLoaded?null:i("calcite-loader",{label:""}),i("div",{key:"b36eee569f4ca90453f0c3eca215576f8e98b95a",class:"configuration-container"},i("div",{key:"653f75751fc960cce09cbb653504600dbe6f01c7",class:"configuration"},i("calcite-tabs",{key:"de3dd520000f03cada90e7bb7964583e62adf229",class:"config-tabs"},i("calcite-tab-nav",{key:"846d714f94a2476314f7843682483e4cda407a7c",slot:"tab-nav"},i("calcite-tab-title",{key:"7146aced1bd7dd4928e2bd6c49d52ef3003aabc1"},this._translations.definitionTab),e?i("calcite-tab-title",null,this._translations.spatialReferenceTab):null),i("calcite-tab",{key:"5b8672dd8089a21a49139c2bedc4a9ab91d2b2e2",class:"config-tab",selected:!0},i("div",{key:"1bf9bf03f6418212807afc5657e807faa45557d6",class:"config-solution"},i("div",{key:"718a6a90a39844562d547e4e08abc4b133945a68",class:this._treeOpen?"config-inventory":"config-inventory-hide"},i("solution-contents",{id:"configInventory",key:`${this.solutionItemId}-contents`,ref:t=>this._solutionContentsComponent=t})),i("calcite-button",{key:"25039c4b3c3e97d587fd3d3aec4791f53875d9bf",appearance:"transparent",class:"collapse-btn","icon-start":this._treeOpen?"chevrons-left":"chevrons-right",id:"collapse-vars",onClick:()=>this._toggleTree(),scale:"s",title:this._treeOpen?this._translations.collapse:this._translations.expand}),i("div",{key:"5970c8ed59c6cb9fa02c574c3c1a3949940dfec6",class:"config-item"},i("solution-item",{authentication:this.authentication,"item-id":this._currentEditItemId,key:`${this.solutionItemId}-item`,locale:this.locale,"organization-variables":this._organizationVariables,"solution-item-id":this.solutionItemId,"solution-variables":this._solutionVariables})))),e?i("calcite-tab",{class:"config-tab"},i("div",{class:"config-solution"},i("solution-spatial-ref",{enableDefault:!!t.default,enabled:t?.enabled,featureServices:a.getStoreInfo("featureServices").map((t=>t.name)),id:"configure-solution-spatial-ref",key:`${this.solutionItemId}-spatial-ref`,locale:this.locale}))):null))))}_solutionStoreHasChanges=!1;_solutionEditorHasChanges=!1;_solutionEditorHasErrors=!1;_canSave=!1;_solutionItemSelected(t){this._currentEditItemId=t.detail}async getSpatialReferenceInfo(){return Promise.resolve(a.getStoreInfo("spatialReferenceInfo"))}async saveSolution(){this._solutionIsLoaded=!1,await a.saveSolution(),this._solutionIsLoaded=!0,this.solutionItemId=null}async unloadSolution(){this.solutionItemId=null}_initProps(){const t=a.getStoreInfo("solutionData");let e;this._templateHierarchy=[...o(t.templates)],this._solutionContentsComponent&&(this._solutionContentsComponent.templateHierarchy=this._templateHierarchy),this._templateHierarchy.length>0&&(e=a.getItemInfo(this._templateHierarchy[0].id)),this._currentEditItemId=e?e.itemId:""}async _loadSolution(t){return t?(this._solutionIsLoaded=!1,await a.loadSolution(t,this.authentication),this._initProps(),this._solutionIsLoaded=!0):this._reset(),Promise.resolve()}_reset(){this._currentEditItemId="",this._organizationVariables="",this._solutionVariables="",this._templateHierarchy=[]}_toggleTree(){this._treeOpen=!this._treeOpen}_updateSaveability(t,e,i){const n=(t||e)&&!i;this._canSave!==n&&window.dispatchEvent(new CustomEvent("solutionCanSave",{detail:n,bubbles:!0,cancelable:!1,composed:!0})),this._canSave=n}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{serializedAuthentication:["serializedAuthenticationWatchHandler"],solutionItemId:["valueWatchHandler"],locale:["localeWatchHandler"]}}};y.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%}.config-solution{position:absolute;top:3.5rem;right:-1px;bottom:-1px;left:-1px;display:flex;padding:0.5rem}.config-inventory{display:inline;max-width:-moz-min-content;max-width:min-content;flex-grow:0;overflow-y:auto}.config-inventory-hide{display:none;max-width:-moz-min-content;max-width:min-content;flex-grow:0;overflow-y:auto}.config-item{position:relative;display:inline;flex-grow:1;overflow-y:auto;margin-inline-start:0.5rem}solution-contents{position:relative;height:100%}solution-item{position:relative;height:100%}solution-spatial-ref{position:relative;height:100%;width:100%;overflow-y:auto}";export{y as solution_configuration}
|
21
|
+
var p=function(){return p=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},p.apply(this,arguments)};function w(t,e){var i=e;return i.rawResponse=!1,c(t,i).then((function(t){var e={token:t.access_token,username:t.username,expires:new Date(Date.now()+(1e3*t.expires_in-1e3)),ssl:!0===t.ssl};return t.refresh_token&&(e.refreshToken=t.refresh_token),e}))}function m(t,e){var i=e;return i.params.referer="undefined"!=typeof window&&window.location&&window.location.host?window.location.host:u,c(t,i)}var g=/^https?:\/\/(\S+)\.arcgis\.com.+/;function v(t){return g.test(t)}function b(t){if(!g.test(t))return null;var e=t.match(g)[1].split(".").pop();return e.includes("dev")?"dev":e.includes("qa")?"qa":"production"}var k=function(){function t(t){if(this.clientId=t.clientId,this._refreshToken=t.refreshToken,this._refreshTokenExpires=t.refreshTokenExpires,this.username=t.username,this.password=t.password,this._token=t.token,this._tokenExpires=t.tokenExpires,this.portal=t.portal?l(t.portal):"https://www.arcgis.com/sharing/rest",this.ssl=t.ssl,this.provider=t.provider||"arcgis",this.tokenDuration=t.tokenDuration||20160,this.redirectUri=t.redirectUri,this.refreshTokenTTL=t.refreshTokenTTL||20160,this.server=t.server,this.federatedServers={},this.trustedDomains=[],t.server){var e=this.getServerRootUrl(t.server);this.federatedServers[e]={token:t.token,expires:t.tokenExpires}}this._pendingTokenRequests={}}return Object.defineProperty(t.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tokenExpires",{get:function(){return this._tokenExpires},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refreshToken",{get:function(){return this._refreshToken},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"refreshTokenExpires",{get:function(){return this._refreshTokenExpires},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trustedServers",{get:function(){return console.log("DEPRECATED: use federatedServers instead"),this.federatedServers},enumerable:!1,configurable:!0}),t.beginOAuth2=function(e,i){void 0===i&&(i=window),e.duration&&console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");var n,s=p({portal:"https://www.arcgis.com/sharing/rest",provider:"arcgis",expiration:20160,popup:!0,popupWindowFeatures:"height=400,width=600,menubar=no,location=yes,resizable=yes,scrollbars=yes,status=yes",state:e.clientId,locale:""},e),r=s.portal,o=s.provider,a=s.clientId,h=s.expiration,c=s.redirectUri,u=s.popup,l=s.popupWindowFeatures,w=s.state,m=s.locale,g=s.params;if(n="arcgis"===o?r+"/oauth2/authorize?client_id="+a+"&response_type=token&expiration="+(e.duration||h)+"&redirect_uri="+encodeURIComponent(c)+"&state="+w+"&locale="+m:r+"/oauth2/social/authorize?client_id="+a+"&socialLoginProviderName="+o+"&autoAccountCreateForSocial=true&response_type=token&expiration="+(e.duration||h)+"&redirect_uri="+encodeURIComponent(c)+"&state="+w+"&locale="+m,g&&(n=n+"&"+f(g)),u){var v,b=((v={promise:null,resolve:null,reject:null}).promise=new Promise((function(t,e){v.resolve=t,v.reject=e})),v);return i["__ESRI_REST_AUTH_HANDLER_"+a]=function(e,i){if(e){var n=JSON.parse(e);b.reject(new d(n.errorMessage,n.error))}else if(i){var s=JSON.parse(i);b.resolve(new t({clientId:a,portal:r,ssl:s.ssl,token:s.token,tokenExpires:new Date(s.expires),username:s.username}))}},i.open(n,"oauth-window",l),b.promise}i.location.href=n},t.completeOAuth2=function(e,i){void 0===i&&(i=window);var n=p({portal:"https://www.arcgis.com/sharing/rest",popup:!0},e),s=n.portal,r=n.clientId,o=n.popup;function a(e,n){try{var a=void 0,h="__ESRI_REST_AUTH_HANDLER_"+r;if(o&&(i.opener?i.opener.parent&&i.opener.parent[h]?a=i.opener.parent[h]:i.opener&&i.opener[h]&&(a=i.opener[h]):i!==i.parent&&i.parent&&i.parent[h]&&(a=i.parent[h]),a))return a(e?JSON.stringify(e):void 0,JSON.stringify(n)),void i.close()}catch(t){throw new d('Unable to complete authentication. It\'s possible you specified popup based oAuth2 but no handler from "beginOAuth2()" present. This generally happens because the "popup" option differs between "beginOAuth2()" and "completeOAuth2()".')}if(e)throw new d(e.errorMessage,e.error);return new t({clientId:r,portal:s,ssl:n.ssl,token:n.token,tokenExpires:n.expires,username:n.username})}var h=i.location.hash.replace(/^#/,"").split("&").reduce((function(t,e){var i=function(t){var e=t.split("="),i=e[1];return{key:decodeURIComponent(e[0]),value:decodeURIComponent(i)}}(e);return t[i.key]=i.value,t}),{});if(!h.access_token){var c=void 0,u="Unknown error";return h.error&&(c=h.error,u=h.error_description),a({error:c,errorMessage:u})}return a(void 0,{token:h.access_token,expires:new Date(Date.now()+1e3*parseInt(h.expires_in,10)-6e4),ssl:"true"===h.ssl,username:h.username})},t.fromParent=function(e,i){var n;return!i&&window&&(i=window),new Promise((function(s,r){i.addEventListener("message",n=function(e){if(e.source===i.parent&&e.data)try{return s(t.parentMessageHandler(e))}catch(t){return r(t)}},!1),i.parent.postMessage({type:"arcgis:auth:requestCredential"},e)})).then((function(t){return i.removeEventListener("message",n,!1),t}))},t.authorize=function(t,e){t.duration&&console.log("DEPRECATED: 'duration' is deprecated - use 'expiration' instead");var i=p({portal:"https://arcgis.com/sharing/rest",expiration:20160},t);e.writeHead(301,{Location:i.portal+"/oauth2/authorize?client_id="+i.clientId+"&expiration="+(t.duration||i.expiration)+"&response_type=code&redirect_uri="+encodeURIComponent(i.redirectUri)}),e.end()},t.exchangeAuthorizationCode=function(e,i){var n=p({portal:"https://www.arcgis.com/sharing/rest",refreshTokenTTL:20160},e),s=n.portal,r=n.clientId,o=n.redirectUri,a=n.refreshTokenTTL;return w(s+"/oauth2/token",{params:{grant_type:"authorization_code",client_id:r,redirect_uri:o,code:i}}).then((function(e){return new t({clientId:r,portal:s,ssl:e.ssl,redirectUri:o,refreshToken:e.refreshToken,refreshTokenTTL:a,refreshTokenExpires:new Date(Date.now()+60*(a-1)*1e3),token:e.token,tokenExpires:e.expires,username:e.username})}))},t.deserialize=function(e){var i=JSON.parse(e);return new t({clientId:i.clientId,refreshToken:i.refreshToken,refreshTokenExpires:new Date(i.refreshTokenExpires),username:i.username,password:i.password,token:i.token,tokenExpires:new Date(i.tokenExpires),portal:i.portal,ssl:i.ssl,tokenDuration:i.tokenDuration,redirectUri:i.redirectUri,refreshTokenTTL:i.refreshTokenTTL})},t.fromCredential=function(e){var i=void 0===e.ssl||e.ssl,n=e.expires||Date.now()+72e5;return new t({portal:e.server.includes("sharing/rest")?e.server:e.server+"/sharing/rest",ssl:i,token:e.token,username:e.userId,tokenExpires:new Date(n)})},t.parentMessageHandler=function(e){if("arcgis:auth:credential"===e.data.type)return t.fromCredential(e.data.credential);if("arcgis:auth:error"===e.data.type){var i=new Error(e.data.error.message);throw i.name=e.data.error.name,i}throw new Error("Unknown message type.")},t.prototype.toCredential=function(){return{expires:this.tokenExpires.getTime(),server:this.portal,ssl:this.ssl,token:this.token,userId:this.username}},t.prototype.getUser=function(t){var e=this;if(this._pendingUserRequest)return this._pendingUserRequest;if(this._user)return Promise.resolve(this._user);var i=this.portal+"/community/self",n=p(p({httpMethod:"GET",authentication:this},t),{rawResponse:!1});return this._pendingUserRequest=c(i,n).then((function(t){return e._user=t,e._pendingUserRequest=null,t})),this._pendingUserRequest},t.prototype.getPortal=function(t){var e=this;if(this._pendingPortalRequest)return this._pendingPortalRequest;if(this._portalInfo)return Promise.resolve(this._portalInfo);var i=this.portal+"/portals/self",n=p(p({httpMethod:"GET",authentication:this},t),{rawResponse:!1});return this._pendingPortalRequest=c(i,n).then((function(t){return e._portalInfo=t,e._pendingPortalRequest=null,t})),this._pendingPortalRequest},t.prototype.getUsername=function(){return this.username?Promise.resolve(this.username):this._user?Promise.resolve(this._user.username):this.getUser().then((function(t){return t.username}))},t.prototype.getToken=function(t,e){return n=t,s=v(i=this.portal),r=v(n),o=b(i),a=b(n),s&&r&&o===a||new RegExp(this.portal,"i").test(t)?this.getFreshToken(e):this.getTokenForServer(t,e);var i,n,s,r,o,a},t.prototype.validateAppAccess=function(t){return this.getToken(this.portal).then((function(e){return function(t,e,i){return void 0===i&&(i="https://www.arcgis.com/sharing/rest"),c(i+"/oauth2/validateAppAccess",{method:"POST",params:{f:"json",client_id:e,token:t}})}(e,t)}))},t.prototype.toJSON=function(){return{clientId:this.clientId,refreshToken:this.refreshToken,refreshTokenExpires:this.refreshTokenExpires,username:this.username,password:this.password,token:this.token,tokenExpires:this.tokenExpires,portal:this.portal,ssl:this.ssl,tokenDuration:this.tokenDuration,redirectUri:this.redirectUri,refreshTokenTTL:this.refreshTokenTTL}},t.prototype.serialize=function(){return JSON.stringify(this)},t.prototype.enablePostMessageAuth=function(t,e){!e&&window&&(e=window),this._hostHandler=this.createPostMessageHandler(t),e.addEventListener("message",this._hostHandler,!1)},t.prototype.disablePostMessageAuth=function(t){!t&&window&&(t=window),t.removeEventListener("message",this._hostHandler,!1)},t.prototype.refreshSession=function(t){return this._user=null,this.username&&this.password?this.refreshWithUsernameAndPassword(t):this.clientId&&this.refreshToken?this.refreshWithRefreshToken():Promise.reject(new d("Unable to refresh token."))},t.prototype.getServerRootUrl=function(t){var e=l(t).split(/\/rest(\/admin)?\/services(?:\/|#|\?|$)/)[0].match(/(https?:\/\/)(.+)/),i=e[1],n=e[2].split("/"),s=n[0],r=n.slice(1);return""+i+s.toLowerCase()+"/"+r.join("/")},t.prototype.getDomainCredentials=function(t){return this.trustedDomains&&this.trustedDomains.length&&this.trustedDomains.some((function(e){return t.startsWith(e)}))?"include":"same-origin"},t.prototype.createPostMessageHandler=function(t){var e=this;return function(i){var n=t.indexOf(i.origin)>-1,s="arcgis:auth:requestCredential"===i.data.type,r=e.tokenExpires.getTime()>Date.now();if(n&&s){var o={};if(r){var a=e.toCredential();a.server=a.server.replace("/sharing/rest",""),o={type:"arcgis:auth:credential",credential:a}}else o={type:"arcgis:auth:error",error:{name:"tokenExpiredError",message:"Session token was expired, and not returned to the child application"}};i.source.postMessage(o,i.origin)}}},t.prototype.getTokenForServer=function(t,e){var i=this,n=this.getServerRootUrl(t),s=this.federatedServers[n];return s&&s.expires&&s.expires.getTime()>Date.now()?Promise.resolve(s.token):(this._pendingTokenRequests[n]||(this._pendingTokenRequests[n]=this.fetchAuthorizedDomains().then((function(){return c(n+"/rest/info",{credentials:i.getDomainCredentials(t)}).then((function(s){if(s.owningSystemUrl){if(r=s.owningSystemUrl,o=l(function(t){if(!g.test(t))return t;switch(b(t)){case"dev":return"https://devext.arcgis.com/sharing/rest";case"qa":return"https://qaext.arcgis.com/sharing/rest";default:return"https://www.arcgis.com/sharing/rest"}}(i.portal)).replace(/https?:\/\//,""),a=l(r).replace(/https?:\/\//,""),new RegExp(a,"i").test(o))return c(s.owningSystemUrl+"/sharing/rest/info",e);throw new d(t+" is not federated with "+i.portal+".","NOT_FEDERATED")}var r,o,a;if(s.authInfo&&void 0!==i.federatedServers[n])return Promise.resolve({authInfo:s.authInfo});throw new d(t+" is not federated with any portal and is not explicitly trusted.","NOT_FEDERATED")})).then((function(t){return t.authInfo.tokenServicesUrl})).then((function(e){return i.token&&i.tokenExpires.getTime()>Date.now()?m(e,{params:{token:i.token,serverUrl:t,expiration:i.tokenDuration,client:"referer"}}):m(e,{params:{username:i.username,password:i.password,expiration:i.tokenDuration,client:"referer"}}).then((function(t){return i._token=t.token,i._tokenExpires=new Date(t.expires),t}))})).then((function(t){return i.federatedServers[n]={expires:new Date(t.expires),token:t.token},delete i._pendingTokenRequests[n],t.token}))}))),this._pendingTokenRequests[n])},t.prototype.getFreshToken=function(t){var e=this;return this.token&&!this.tokenExpires||this.token&&this.tokenExpires&&this.tokenExpires.getTime()>Date.now()?Promise.resolve(this.token):(this._pendingTokenRequests[this.portal]||(this._pendingTokenRequests[this.portal]=this.refreshSession(t).then((function(t){return e._pendingTokenRequests[e.portal]=null,t.token}))),this._pendingTokenRequests[this.portal])},t.prototype.refreshWithUsernameAndPassword=function(t){var e=this,i=p({params:{username:this.username,password:this.password,expiration:this.tokenDuration}},t);return m(this.portal+"/generateToken",i).then((function(t){return e._token=t.token,e._tokenExpires=new Date(t.expires),e}))},t.prototype.refreshWithRefreshToken=function(t){var e=this;if(this.refreshToken&&this.refreshTokenExpires&&this.refreshTokenExpires.getTime()<Date.now())return this.refreshRefreshToken(t);var i=p({params:{client_id:this.clientId,refresh_token:this.refreshToken,grant_type:"refresh_token"}},t);return w(this.portal+"/oauth2/token",i).then((function(t){return e._token=t.token,e._tokenExpires=t.expires,e}))},t.prototype.refreshRefreshToken=function(t){var e=this,i=p({params:{client_id:this.clientId,refresh_token:this.refreshToken,redirect_uri:this.redirectUri,grant_type:"exchange_refresh_token"}},t);return w(this.portal+"/oauth2/token",i).then((function(t){return e._token=t.token,e._tokenExpires=t.expires,e._refreshToken=t.refreshToken,e._refreshTokenExpires=new Date(Date.now()+60*(e.refreshTokenTTL-1)*1e3),e}))},t.prototype.fetchAuthorizedDomains=function(){var t=this;return this.server||!this.portal?Promise.resolve(this):this.getPortal().then((function(e){return e.authorizedCrossOriginDomains&&e.authorizedCrossOriginDomains.length&&(t.trustedDomains=e.authorizedCrossOriginDomains.filter((function(t){return!t.startsWith("http://")})).map((function(t){return t.startsWith("https://")?t:"https://"+t}))),t}))},t}();const y=class{get el(){return t(this)}async serializedAuthenticationWatchHandler(){this.authentication=this.serializedAuthentication?k.deserialize(this.serializedAuthentication):new k({})}async valueWatchHandler(){await this._loadSolution(this.solutionItemId)}async localeWatchHandler(){this.el.lang=this.locale,await this._getTranslations()}constructor(t){e(this,t),this.authentication=new k({}),this.locale=void 0,this.serializedAuthentication="",this.solutionItemId="",this.showLoading=!1,this._currentEditItemId="",this._organizationVariables="",this._solutionContentsComponent=void 0,this._solutionIsLoaded=!1,this._solutionVariables="",this._templateHierarchy=[],this._translations=void 0,this._treeOpen=!0,this.serializedAuthentication&&(this.authentication=k.deserialize(this.serializedAuthentication)),this._loadSolution(this.solutionItemId),window.addEventListener("solutionStoreHasChanges",(t=>{this._updateSaveability(this._solutionStoreHasChanges=t.detail,this._solutionEditorHasChanges,this._solutionEditorHasErrors)})),window.addEventListener("solutionEditorHasChanges",(t=>{this._updateSaveability(this._solutionStoreHasChanges,this._solutionEditorHasChanges=t.detail,this._solutionEditorHasErrors)})),window.addEventListener("solutionEditorHasErrors",(t=>{this._updateSaveability(this._solutionStoreHasChanges,this._solutionEditorHasChanges,this._solutionEditorHasErrors=t.detail)}))}async componentWillLoad(){return this._getTranslations()}render(){const t=a.getStoreInfo("spatialReferenceInfo"),e=a.getStoreInfo("featureServices").length>0,o=a.getStoreInfo("solutionData");return this._solutionVariables=JSON.stringify(s(o.templates,this._translations)),this._organizationVariables=JSON.stringify(r(this._translations)),i(n,{key:"c3119f5d0485eacbbd1380db442ef9c28f772dec"},this._solutionIsLoaded?null:i("calcite-loader",{label:""}),i("div",{key:"f363b65e521bde0dff7290ec7345b95cd61a6d75",class:"configuration-container"},i("div",{key:"bcc9dac3ec183cb36da61bca5c1718395ff76efd",class:"configuration"},i("calcite-tabs",{key:"76d8e022c66e2d9157ecd44d26d080f5bfbfee4e",class:"config-tabs"},i("calcite-tab-nav",{key:"1b40a68e10b69189496325bfea5116655d715c97",slot:"tab-nav"},i("calcite-tab-title",{key:"2c729b8fe2a3fd3a0ac0964d2b825e9fc113f51f"},this._translations.definitionTab),e?i("calcite-tab-title",null,this._translations.spatialReferenceTab):null),i("calcite-tab",{key:"99c4e95166fa304a16efac7261888bbbc970b66a",class:"config-tab",selected:!0},i("div",{key:"ec17e4d65348b3e6d496f7a7564f6a771b0d051b",class:"config-solution"},i("div",{key:"2f2e72b5fd3a9137e9c6edae9d2a4f2a1b12f826",class:this._treeOpen?"config-inventory":"config-inventory-hide"},i("solution-contents",{id:"configInventory",key:`${this.solutionItemId}-contents`,ref:t=>this._solutionContentsComponent=t})),i("calcite-button",{key:"696f310d8a8e1c1cb37b738f0a5a6f38003aef39",appearance:"transparent",class:"collapse-btn","icon-start":this._treeOpen?"chevrons-left":"chevrons-right",id:"collapse-vars",onClick:()=>this._toggleTree(),scale:"s",title:this._treeOpen?this._translations.collapse:this._translations.expand}),i("div",{key:"e6d9a56d72753ce4d625b547adbe8991a8697f54",class:"config-item"},i("solution-item",{authentication:this.authentication,"item-id":this._currentEditItemId,key:`${this.solutionItemId}-item`,locale:this.locale,"organization-variables":this._organizationVariables,"solution-item-id":this.solutionItemId,"solution-variables":this._solutionVariables})))),e?i("calcite-tab",{class:"config-tab"},i("div",{class:"config-solution"},i("solution-spatial-ref",{enableDefault:!!t.default,enabled:t?.enabled,featureServices:a.getStoreInfo("featureServices").map((t=>t.name)),id:"configure-solution-spatial-ref",key:`${this.solutionItemId}-spatial-ref`,locale:this.locale}))):null))))}_solutionStoreHasChanges=!1;_solutionEditorHasChanges=!1;_solutionEditorHasErrors=!1;_canSave=!1;_solutionItemSelected(t){this._currentEditItemId=t.detail}async getSpatialReferenceInfo(){return Promise.resolve(a.getStoreInfo("spatialReferenceInfo"))}async saveSolution(){this._solutionIsLoaded=!1,await a.saveSolution(),this._solutionIsLoaded=!0,this.solutionItemId=null}async unloadSolution(){this.solutionItemId=null}_initProps(){const t=a.getStoreInfo("solutionData");let e;this._templateHierarchy=[...o(t.templates)],this._solutionContentsComponent&&(this._solutionContentsComponent.templateHierarchy=this._templateHierarchy),this._templateHierarchy.length>0&&(e=a.getItemInfo(this._templateHierarchy[0].id)),this._currentEditItemId=e?e.itemId:""}async _loadSolution(t){return t?(this._solutionIsLoaded=!1,await a.loadSolution(t,this.authentication),this._initProps(),this._solutionIsLoaded=!0):this._reset(),Promise.resolve()}_reset(){this._currentEditItemId="",this._organizationVariables="",this._solutionVariables="",this._templateHierarchy=[]}_toggleTree(){this._treeOpen=!this._treeOpen}_updateSaveability(t,e,i){const n=(t||e)&&!i;this._canSave!==n&&window.dispatchEvent(new CustomEvent("solutionCanSave",{detail:n,bubbles:!0,cancelable:!1,composed:!0})),this._canSave=n}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{serializedAuthentication:["serializedAuthenticationWatchHandler"],solutionItemId:["valueWatchHandler"],locale:["localeWatchHandler"]}}};y.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%}.config-solution{position:absolute;top:3.5rem;right:-1px;bottom:-1px;left:-1px;display:flex;padding:0.5rem}.config-inventory{display:inline;max-width:-moz-min-content;max-width:min-content;flex-grow:0;overflow-y:auto}.config-inventory-hide{display:none;max-width:-moz-min-content;max-width:min-content;flex-grow:0;overflow-y:auto}.config-item{position:relative;display:inline;flex-grow:1;overflow-y:auto;margin-inline-start:0.5rem}solution-contents{position:relative;height:100%}solution-item{position:relative;height:100%}solution-spatial-ref{position:relative;height:100%;width:100%;overflow-y:auto}";export{y as solution_configuration}
|