@esri/solutions-components 5.1.0-next.94 → 5.1.0-next.95

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.
Files changed (107) hide show
  1. package/dist/cdn/2ID55IJB.js +2 -0
  2. package/dist/cdn/2SGR44DX.js +2 -0
  3. package/dist/cdn/{C4UB6MNN.js → 3J47AYBV.js} +97 -97
  4. package/dist/cdn/{VOF34LDF.js → 4B7NJE47.js} +1 -1
  5. package/dist/cdn/{YVDSW2OQ.js → 5LTIZSXG.js} +1 -1
  6. package/dist/cdn/74MDW73I.js +2 -0
  7. package/dist/cdn/ADPYDJG6.js +2 -0
  8. package/dist/cdn/{FDE2V7FU.js → AJZHT4GA.js} +1 -1
  9. package/dist/cdn/{JQXKQHAG.js → DI7PQSFH.js} +1 -1
  10. package/dist/cdn/FVXS4LF5.js +2 -0
  11. package/dist/cdn/IRRMUFW7.js +2 -0
  12. package/dist/cdn/ITLTQWCX.js +2 -0
  13. package/dist/cdn/IYUTLV2O.js +2 -0
  14. package/dist/cdn/{3XGF3ZJO.js → KW6YOUWC.js} +1 -1
  15. package/dist/cdn/{LUZYJVG5.js → KYFNXHOH.js} +1 -1
  16. package/dist/cdn/{NXL2QN3P.js → R3MCMOLS.js} +1 -1
  17. package/dist/cdn/R4VHCXKS.js +2 -0
  18. package/dist/cdn/{5Z45KDQY.js → UHPN75WT.js} +1 -1
  19. package/dist/cdn/VESARS2D.js +7 -0
  20. package/dist/cdn/{D4GI6KPZ.js → WVRKV5SS.js} +1 -1
  21. package/dist/cdn/assets/solution-details-card/t9n/messages.en.json +1 -1
  22. package/dist/cdn/assets/solution-details-card/t9n/messages.json +1 -1
  23. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ar.json +1 -1
  24. package/dist/cdn/assets/solution-item-accordion/t9n/messages.bg.json +1 -1
  25. package/dist/cdn/assets/solution-item-accordion/t9n/messages.bs.json +1 -1
  26. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ca.json +1 -1
  27. package/dist/cdn/assets/solution-item-accordion/t9n/messages.cs.json +1 -1
  28. package/dist/cdn/assets/solution-item-accordion/t9n/messages.da.json +1 -1
  29. package/dist/cdn/assets/solution-item-accordion/t9n/messages.de.json +1 -1
  30. package/dist/cdn/assets/solution-item-accordion/t9n/messages.el.json +1 -1
  31. package/dist/cdn/assets/solution-item-accordion/t9n/messages.es.json +1 -1
  32. package/dist/cdn/assets/solution-item-accordion/t9n/messages.et.json +1 -1
  33. package/dist/cdn/assets/solution-item-accordion/t9n/messages.fi.json +1 -1
  34. package/dist/cdn/assets/solution-item-accordion/t9n/messages.fr.json +1 -1
  35. package/dist/cdn/assets/solution-item-accordion/t9n/messages.he.json +1 -1
  36. package/dist/cdn/assets/solution-item-accordion/t9n/messages.hr.json +1 -1
  37. package/dist/cdn/assets/solution-item-accordion/t9n/messages.hu.json +1 -1
  38. package/dist/cdn/assets/solution-item-accordion/t9n/messages.id.json +1 -1
  39. package/dist/cdn/assets/solution-item-accordion/t9n/messages.it.json +1 -1
  40. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ja.json +1 -1
  41. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ko.json +1 -1
  42. package/dist/cdn/assets/solution-item-accordion/t9n/messages.lt.json +1 -1
  43. package/dist/cdn/assets/solution-item-accordion/t9n/messages.lv.json +1 -1
  44. package/dist/cdn/assets/solution-item-accordion/t9n/messages.nl.json +1 -1
  45. package/dist/cdn/assets/solution-item-accordion/t9n/messages.no.json +1 -1
  46. package/dist/cdn/assets/solution-item-accordion/t9n/messages.pl.json +1 -1
  47. package/dist/cdn/assets/solution-item-accordion/t9n/messages.pt-BR.json +1 -1
  48. package/dist/cdn/assets/solution-item-accordion/t9n/messages.pt-PT.json +1 -1
  49. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ro.json +1 -1
  50. package/dist/cdn/assets/solution-item-accordion/t9n/messages.ru.json +1 -1
  51. package/dist/cdn/assets/solution-item-accordion/t9n/messages.sk.json +1 -1
  52. package/dist/cdn/assets/solution-item-accordion/t9n/messages.sl.json +1 -1
  53. package/dist/cdn/assets/solution-item-accordion/t9n/messages.sr.json +1 -1
  54. package/dist/cdn/assets/solution-item-accordion/t9n/messages.sv.json +1 -1
  55. package/dist/cdn/assets/solution-item-accordion/t9n/messages.th.json +1 -1
  56. package/dist/cdn/assets/solution-item-accordion/t9n/messages.tr.json +1 -1
  57. package/dist/cdn/assets/solution-item-accordion/t9n/messages.uk.json +1 -1
  58. package/dist/cdn/assets/solution-item-accordion/t9n/messages.vi.json +1 -1
  59. package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-CN.json +1 -1
  60. package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-HK.json +1 -1
  61. package/dist/cdn/assets/solution-item-accordion/t9n/messages.zh-TW.json +1 -1
  62. package/dist/cdn/assets/solutions-deployed-list/t9n/messages.en.json +1 -0
  63. package/dist/cdn/assets/solutions-deployed-list/t9n/messages.json +1 -0
  64. package/dist/cdn/index.js +1 -1
  65. package/dist/cdn/main.css +1 -1
  66. package/dist/chunks/converter.js +82 -86
  67. package/dist/chunks/get.js +387 -0
  68. package/dist/components/arcgis-solutions-assistant/customElement.js +5766 -5676
  69. package/dist/components/consent-manager/customElement.js +609 -638
  70. package/dist/components/solution-configure-titles/customElement.js +31 -28
  71. package/dist/components/solution-delete-dialog/customElement.js +57 -54
  72. package/dist/components/solution-deployed-card-panel/customElement.js +40 -37
  73. package/dist/components/solution-details-card/customElement.d.ts +4 -0
  74. package/dist/components/solution-details-card/customElement.js +45 -29
  75. package/dist/components/solution-details-card/index.js +1 -0
  76. package/dist/components/solution-item-accordion/customElement.d.ts +3 -2
  77. package/dist/components/solution-item-accordion/customElement.js +52 -35
  78. package/dist/components/solution-item-accordion/index.js +2 -0
  79. package/dist/components/solutions-all-panel/customElement.js +11 -11
  80. package/dist/components/solutions-deployed-list/customElement.d.ts +33 -0
  81. package/dist/components/solutions-deployed-list/customElement.js +38 -0
  82. package/dist/components/solutions-deployed-list/index.d.ts +1 -0
  83. package/dist/components/solutions-deployed-list/index.js +1 -0
  84. package/dist/docs/api.json +1 -1
  85. package/dist/docs/docs.json +1 -1
  86. package/dist/docs/vscode.html-custom-data.json +1 -1
  87. package/dist/docs/web-types.json +1 -1
  88. package/dist/index.d.ts +10 -0
  89. package/dist/loader.js +3 -2
  90. package/dist/solutions-components_commit.txt +7 -7
  91. package/dist/types/lumina.d.ts +6 -0
  92. package/dist/types/preact.d.ts +7 -0
  93. package/dist/types/react.d.ts +8 -0
  94. package/dist/types/stencil.d.ts +6 -0
  95. package/dist/utils/getRelatedInfos.d.ts +4 -0
  96. package/dist/utils/interfaces.d.ts +1 -1
  97. package/package.json +1 -1
  98. package/dist/cdn/2L3RREZ4.js +0 -2
  99. package/dist/cdn/2WHAF4H7.js +0 -2
  100. package/dist/cdn/AKKTG2RD.js +0 -2
  101. package/dist/cdn/DLH53PYM.js +0 -7
  102. package/dist/cdn/P24CZ4HM.js +0 -2
  103. package/dist/cdn/R2G4DDRZ.js +0 -2
  104. package/dist/cdn/SO3S3WP4.js +0 -2
  105. package/dist/cdn/UBLDT5XD.js +0 -2
  106. package/dist/cdn/ZONXYZVU.js +0 -2
  107. package/dist/chunks/get-portal-url.js +0 -345
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import i from"./NPOHA56R.js";import h from"./XAW6KPKL.js";import e from"./ZP6VPBP4.js";import d from"./XXT542UR.js";import a from"./X5EABWHE.js";import{a as _,b as v}from"./2B4SGB3I.js";import{b as g}from"./YKQDHR27.js";import{la as w,ra as y}from"./J75MHJID.js";import{a as x}from"./R67EKKSL.js";import{b}from"./KIUBUHVM.js";import{G as u,I as f,K as c,h as m,i as t,q as r}from"./H5E6ISYP.js";export default $arcgis.t(([{r:$},{c:C},{a:k,c:D,o:l},{a:S},{d:p,h:I,i:T}])=>{var O=m`.negative-tabbing-offset[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:-2px}.tabbing-offset[tabindex]:focus-visible{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.font-weight-med{font-weight:var(--calcite-font-weight-medium)}.font-weight-bold{font-weight:var(--calcite-font-weight-bold)}.heading-font{font-size:var(--calcite-font-size-0);font-weight:var(--calcite-font-weight-medium)}.title-font{font-size:1.8rem;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1)}.font-1{font-size:var(--calcite-spacing-lg)}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}.flex-direction-row{flex-direction:row}@container (min-width: 801px){.font-size-override .display-flex.flex-direction-row>.image-width+.display-flex{flex:1;min-width:0}}.icon-color{color:var(--calcite-color-text-3)}.padding-bottom-lg{padding-bottom:var(--calcite-spacing-lg)}.item-padding{--calcite-internal-accordion-item-padding: var(--calcite-spacing-xl)}.align-items-center{align-items:center}.align-items-start{align-items:start}.font-size-override{--calcite-font-size--2: var(--calcite-font-size--1)}.background-color-1{background-color:var(--calcite-color-surface-2)}.background-color-2{background-color:var(--calcite-color-surface-3)}.label-override{--calcite-label-margin-bottom: var(--calcite-spacing-none)}.position-relative{position:relative}.overflow-hidden{overflow:hidden}.overflow-auto{overflow:auto}.margin-block-start-end-0{margin-block-start:var(--calcite-spacing-none);margin-block-end:var(--calcite-spacing-none)}.panel-background-2{--calcite-panel-background-color: var(--calcite-color-surface-3);background-color:var(--calcite-color-surface-3)}.panel-background-1{--calcite-panel-background-color: var(--calcite-color-surface-2);--calcite-shell-panel-background-color: var(--calcite-color-surface-2)}.border-none{border:none}.font-color-1{color:var(--calcite-color-text-1)}.panel-bg-color{--calcite-panel-header-background-color: var(--calcite-color-surface-2);--calcite-panel-background-color: var(--calcite-color-surface-2)}.dialog-y-size{--calcite-dialog-size-y: 90% }.dialog-x-size{--calcite-dialog-size-x: 90% }.bottom-border{border-bottom:solid var(--calcite-spacing-px);color:var(--calcite-color-border-1)}.margin-start-end-xxl{margin-inline-start:var(--calcite-spacing-xxl);margin-inline-end:var(--calcite-spacing-xxl)}.margin-start-end-lg{margin-inline-start:var(--calcite-spacing-lg);margin-inline-end:var(--calcite-spacing-lg)}.margin-top-xxl{margin-top:var(--calcite-spacing-xxl)}.justify-between{justify-content:space-between}.items-baseline{align-items:baseline}.padding-xxl{padding:var(--calcite-spacing-xxl)}.padding-lg{padding:var(--calcite-spacing-lg)}.padding-top-xxl{padding-top:var(--calcite-spacing-xxl)}.padding-top-lg{padding-top:var(--calcite-spacing-lg)}.padding-bottom-xxl{padding-bottom:var(--calcite-spacing-xxl)}.padding-end-1{padding-inline-end:var(--calcite-spacing-lg)}.padding-end-xxl{padding-inline-end:var(--calcite-spacing-xxl)}.padding-start-sm{padding-inline-start:var(--calcite-spacing-sm)}.padding-start-xxl{padding-inline-start:var(--calcite-spacing-xxl)}.image-width{width:300px;flex-grow:0;flex-shrink:0}@container (max-width: 1280px){.image-width{flex-grow:0;flex-shrink:1}}img{max-width:100%;height:auto;overflow-clip-margin:content-box;overflow:clip;display:block}.margin-xl{margin:var(--calcite-spacing-xl)}.line-height-1{line-height:1.1}.line-height-xxl{line-height:var(--calcite-line-height-xxl)}@container (max-width: 800px){.font-size-override .display-flex.flex-direction-row{flex-direction:column!important}.image-width{width:100%!important;max-width:100%!important;margin:0!important;padding:var(--calcite-spacing-lg)!important;padding-bottom:0!important;box-sizing:border-box}.image-width img{width:100%;max-width:100%}.margin-xl{margin:0!important}.image-width+.display-flex{padding-inline-start:var(--calcite-spacing-lg)!important;padding-inline-end:var(--calcite-spacing-lg)!important}.padding-start-sm{padding-inline-start:0!important}.title-font{padding-inline-start:0!important;padding-top:var(--calcite-spacing-lg)!important;padding-bottom:var(--calcite-spacing-lg)!important}.align-items-start.padding-bottom-xxl,.padding-bottom-xxl.padding-start-sm{padding-bottom:var(--calcite-spacing-lg)!important}}calcite-shell-panel{--calcite-shell-panel-max-width: 20rem;--calcite-shell-panel-width: 24vw}calcite-shell{block-size:unset}.solution-deployed-action{--calcite-color-focus: initial}.skeleton-loader{background:linear-gradient(90deg,var(--calcite-color-foreground-1) 0%,var(--calcite-color-foreground-2) 50%,var(--calcite-color-foreground-1) 100%);background-size:200% 100%;animation:shimmer 1.5s ease-in-out infinite;border-radius:var(--calcite-border-radius)}.skeleton-folder{height:1.5rem;width:12rem;border-radius:var(--calcite-border-radius)}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}`,h=class extends u{constructor(){super(),this.diagramKey="",this.open=!1,this.templateInfos=[],this._accordionLoading=!1,this._configureTitlesOpen=!1,this._deleteDialogOpen=!1,this._hasNewVersion=!1,this._isDiagramOpen=!1,this._isNameConflict=!1,this._invalidNameMessage="",this._showFailedAlert=!1,this._showItemUpdateLoading=!1,this.isMobile=!1,this._templateInfoGraph=[],this._thumbnailUrl="",this._folderName="",this._folderId=null,this._folderLoading=!1,this._translations=x({name:"solution-deployed-card-panel",blocking:!0}),this._configContextConsumer=g({context:v,subscribe:!0,callback:async e=>{e&&(this._isOrgAdmin=D(e.authentication),this._user=e.authentication?.Portal?.user)}}),this._isOrgAdmin=!1,this._isMobileContextConsumer=g({context:_,subscribe:!0,callback:e=>this.isMobile=e}),this.navTabSelected=r(),this.forceSelectTab=r(),this.sortTypeChanged=r(),this.solutionConfigureDialogClose=r(),this._nonSolutionDependencyItems=[],this._openFolder=e=>{e.stopPropagation(),this._telemetry?.logEvent({category:l.DEPLOYMENTS,action:"Open Folder",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Details Page"]});let i=this._configContextConsumer.value?.orgUrl;if(!i)return;let a=this._configContextConsumer.value?.userSession?.username,n=this.card?.owner===a,o;if(n){let s=this._folderId||this.card?.owner;o=`${i}/home/content.html?folder=${s}`}else this._folderId?o=`${i}/home/content.html?user=${this.card?.owner}&folder=${this._folderId}`:o=`${i}/home/content.html?user=${this.card?.owner}&folder=${this.card?.owner}`;window.open(o,"_blank")},this.listenOn(window,"deployedCardSelected",this._deployedCardSelected),this.listenOn(window,"deployAppTabSelected",this._handleDeployAppTabSelected),this.listenOn(window,"displayDeployedCard",()=>{$({kind:"success",icon:"check-circle",title:this._translations.deploySuccessAlert.replace("{{solutionTitle}}",this.card?.title??""),message:"",autoClose:!0,autoCloseDuration:"medium"})}),this.listenOn(window,"sessionRefreshed",e=>{this._updateThumbnailToken(e.detail)})}static{this.properties={card:0,cardRef:1,diagramKey:1,open:5,templateInfos:0,_accordionLoading:16,_configureTitlesOpen:16,_deleteDialogOpen:16,_hasNewVersion:16,_isDiagramOpen:16,_isNameConflict:16,_invalidNameMessage:16,_showFailedAlert:16,_showItemUpdateLoading:16,isMobile:16,_templateInfoGraph:16,_thumbnailUrl:16,_folderName:16,_folderId:16,_folderLoading:16,_translations:16,_nonSolutionDependencyItems:16}}static{this.styles=O}get _telemetry(){return this._configContextConsumer.value?.telemetrySession}async load(){if(this._isMobileContextConsumer.value&&(this.isMobile=this._isMobileContextConsumer.value),this.card?.thumbnailUrl){let e=this._configContextConsumer.value?.userSession,i=this.card?.thumbnailUrl.replace(/w=\d+/,"w=400");this._thumbnailUrl=`${i}&token=${e?.token}`}}willUpdate(e){if(e.has("card")){let i=this._configContextConsumer.value?.userSession,a=this.card?.thumbnailUrl.replace(/w=\d+/,"w=400");this._thumbnailUrl=`${a}&token=${i?.token}`,this._folderLoading=!0,this._folderName="",this._folderId=null}}render(){return this.isMobile?t`<calcite-shell class="position-relative background-color-2"><calcite-panel class="panel-background-2 border-none" slot=panel-bottom><div class="background-color-2 padding-top-lg">${this._getSolutionPanel()}</div><div class="background-color-1 margin-top-xxl">${this._getButtons()}${this._getOwnerSection()}<div class="bottom-border margin-start-end-xxl"></div>${this._getFolderSection()}<div class="bottom-border margin-start-end-xxl"></div>${this._getSolutionVersionCard()}</div>${this._getSolutionContents()}</calcite-panel></calcite-shell>`:t`<calcite-shell class="position-relative background-color-2"><calcite-panel class="padding-end-xxl panel-background-2 border-none" slot=panel-bottom><div class="display-flex flex-direction-column overflow-hidden"><div class="background-color-2 padding-top-xxl">${this._getSolutionPanel()}</div>${this._getSolutionContents()}</div></calcite-panel><calcite-shell-panel class="panel-background-1" slot=panel-end>${this._getButtons()}${this._getOwnerSection()}<div class="bottom-border margin-start-end-xxl"></div>${this._getFolderSection()}<div class="bottom-border margin-start-end-xxl"></div>${this._getSolutionVersionCard()}</calcite-shell-panel>${this._renderDiagramDialog()}${this._getConfigureTitlesDialog()}${this._getDeleteDialog()}</calcite-shell>`}async _deployedCardSelected(e){let i=e.detail;this.card=i.card,this.cardRef=i.cardRef,this.templateInfos=[],this._accordionLoading=!0,this.templateInfos=await this._getTemplates(),this._accordionLoading=!1;let a=await S(this._configContextConsumer.value.userSession,this.card);this._nonSolutionDependencyItems=a._nonSolutionDependencyItems;let n=I(this._configContextConsumer.value?.allCards||[],this.card.deployCommonId),o=!1;if(n){let s=p(n),d=p(this.card);o=s>d}this._hasNewVersion=o,this._folderLoading=!0,this._folderName="",this._folderId=null,await this._fetchFolderInfo(),this._folderLoading=!1}_handleDeployAppTabSelected(e){e.detail==="deployed-card"&&this.sortTypeChanged.emit("")}_getButtons(){let e=this._configContextConsumer.value?.userSession?.username,i=this._configContextConsumer.value?.authentication?.CanUpdateSolution,a=this._configContextConsumer.value?.authentication?.CanDeleteSolution&&this._configContextConsumer.value?.authentication?.CanUpdateSolution,n=this.card?.owner===e||this._isOrgAdmin||i,o=this.card?.owner===e||this._isOrgAdmin||a,s=n?"display-none":"",d=this.isMobile?"padding-lg":"padding-xxl";return t`<div class=${`display-flex flex-direction-column ${d}`}>${!this.isMobile&&t`<calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" kind=neutral @click=${this._openDiagram}>${this._translations.viewTheDiagram}</calcite-button>`||""}<calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" kind=neutral @click=${this._viewDocumentation}>${this._translations.solutionDocumentation}</calcite-button><calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" kind=neutral @click=${this._openItemDetails}>${this._translations.itemDetails}</calcite-button>${n&&!this.isMobile&&t`<calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" id=solution-configure-titles-button kind=neutral @click=${this._openConfigureTitlesDialog}>${this._translations.updateTitles}</calcite-button><calcite-tooltip class=${f(s)} overlay-positioning=fixed reference-element=solution-configure-titles-button><span>${this._translations.mustOwnSolution}</span></calcite-tooltip>`||""}${o&&!this.isMobile&&t`<calcite-button appearance=outline class="padding-bottom-lg solution-deployed-action" kind=neutral @click=${this._deleteSolution}>${this._translations.deleteSolution}</calcite-button>`||""}</div>`}_openConfigureTitlesDialog(){this._configureTitlesOpen=!0}_getConfigureTitlesDialog(){return this._configureTitlesOpen?t`<solution-configure-titles .card=${this.card} @solutionConfigureTitlesBeforeClose=${async()=>{this.templateInfos=await this._getTemplates(),this._configureTitlesOpen=!1}} @solutionItemsTitlesChanged=${async()=>{this.templateInfos=await this._getTemplates()}} .open=${this._configureTitlesOpen} source="Details Page" .templateInfos=${this.templateInfos}></solution-configure-titles>`:""}_viewDocumentation(e){e.stopPropagation(),this._telemetry?.logEvent({category:l.DEPLOYMENTS,action:"Open Help",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Details Page"]}),window.open(this.card.learnMoreUrl,"_blank")}_openItemDetails(e){e.stopPropagation(),this._telemetry?.logEvent({category:l.DEPLOYMENTS,action:"Open Item Details",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Details Page"]}),window.open(this.card.itemUrl,"_blank")}_getOwnerSection(){if(!this._configContextConsumer?.value)return;let e=this.isMobile?"margin-start-end-lg":"margin-start-end-xxl";return t`<div class=${`display-flex padding-bottom-xxl ${e} flex-direction-column`}><div class="display-flex justify-between items-baseline"><calcite-label class="font-weight-med label-override tabbing-offset" layout=inline scale=l tabindex=0>${this._translations.aboutYourSolutionOwner}</calcite-label></div><solution-user-avatar .fullname=${this._user?.username===this.card?.owner?this._user?.fullName:void 0} .lookupProfile=${this._user?.username!==this.card?.owner} .thumbnailUrl=${this._user?.username===this.card?.owner?this._user?.thumbnailUrl:void 0} .username=${this.card?.owner}></solution-user-avatar></div>`}async _openDiagram(e){e.stopPropagation();let i=await this._getTemplates();i&&(this._telemetry?.logEvent({category:l.DEPLOYMENTS,action:"View Diagram",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||"","Details Page"]}),this._templateInfoGraph=i,this._isDiagramOpen=!0)}async _getTemplates(){return this.cardRef?await this.cardRef.getTemplates():this.card?await k(this.card.id,this._configContextConsumer.value.userSession):void 0}async _fetchFolderInfo(){if(this.card?.id)try{let e=this._configContextConsumer.value?.userSession;if(!e)return;let i=await y(this.card.id,e);if(this._folderId=i.ownerFolder??null,this._folderId){let a=await w(this.card.owner,this._folderId,e);this._folderName=a?.currentFolder?.title||this._folderId}else this._folderName=this.card.owner||"Root"}catch(e){console.error("Error fetching folder info:",e),this._folderId=null,this._folderName=""}}_getFolderSection(){let e=this.isMobile?"padding-lg":"padding-xxl",i=this._folderId?"folder":"home";return t`<div class=${`${e} display-flex flex-direction-column`}><div class="display-flex justify-between items-baseline"><calcite-label class="font-weight-med label-override tabbing-offset" layout=inline scale=l slot=heading tabindex=0>${this._translations.folder}</calcite-label><calcite-button appearance=transparent .disabled=${this._folderLoading} kind=neutral icon-start=launch2 @click=${this._openFolder}>${this._translations.openFolder}</calcite-button></div><div class="display-flex"><div class="display-flex flex-direction-row padding-top-lg align-items-center">${this._folderLoading?t`<div class="skeleton-loader skeleton-folder"></div>`:t`<calcite-icon class="icon-color" .icon=${i} scale=m></calcite-icon><div class="display-flex flex-direction-column padding-start-xxl"><span class="tabbing-offset" tabindex=0>${this._folderName||"Root"}</span></div>`}</div></div></div>`}_getSolutionVersionCard(){let e=this._hasNewVersion?this._translations.newVersionAvailable:this._translations.youHaveTheLatestVersion,i=this.isMobile?"padding-lg":"padding-xxl";return t`<div class=${`${i} display-flex flex-direction-column`}><calcite-label class="font-weight-med label-override tabbing-offset" layout=inline scale=l slot=heading tabindex=0>${this._translations.solutionVersion.replace("{{version}}",this.card?.deployVersion||"")}</calcite-label><div class="display-flex"><div class="display-flex flex-direction-row padding-top-lg align-items-center"><calcite-icon class="icon-color" icon=clock-forward scale=m></calcite-icon><div class="display-flex flex-direction-column padding-start-xxl"><span class="tabbing-offset" tabindex=0>${e}</span></div></div></div>${this._hasNewVersion?t`<calcite-button appearance=outline class="padding-top-lg solution-deployed-action" kind=neutral @click=${this._openNewVersionSolution} width=full>${this._translations.learnMoreNewVersion}</calcite-button>`:""}</div>`}async _openNewVersionSolution(e){e.stopPropagation(),this._telemetry?.logEvent({category:l.DEPLOYMENTS,action:"View Latest Version",dimensions:[this.card?.title||"",this.card?.deployCommonId||"",this.card?.deployVersion||""]}),await new Promise(a=>setTimeout(a,100));let i=T(this._configContextConsumer.value.allCards,this.card.deployCommonId);i&&this.forceSelectTab.emit({tabType:"details",tabTitleOrId:i})}_getSolutionPanel(){return t`<calcite-panel class="font-size-override panel-background-1"><div class="display-flex flex-direction-row"><div class="image-width margin-xl"><img alt=${this.card?.title??c} src=${this._thumbnailUrl??c}></div><div class="display-flex flex-direction-column"><h1 class="title-font margin-block-start-end-0 padding-end-xxl padding-start-sm padding-top-xxl padding-bottom-xxl line-height-1 negative-tabbing-offset" tabindex=0>${this.card?.title}</h1><div class="display-flex flex-direction-column padding-bottom-xxl padding-start-sm"><div class="display-flex align-items-start padding-bottom-xxl"><div class="font-1 padding-end-1 line-height-xxl negative-tabbing-offset" tabindex=0>${this.card?.snippet}</div></div><div class="display-flex"><div class="display-flex"><calcite-label class="label-override icon-color tabbing-offset" layout=inline tabindex=0><calcite-icon class="icon-color" icon=projects scale=s></calcite-icon>${this._translations.aboutYourSolutionDeployedDate.replace("{{deployedDate}}",this.card?.created||"")}</calcite-label></div></div></div></div></div></calcite-panel>`}_getSolutionContents(){let e=[...new Set(this._nonSolutionDependencyItems.map(i=>i.controlItemId))];return t`<calcite-panel class="panel-background-1 padding-top-xxl"><calcite-accordion class="accordion-bg " icon-position=start scale=l appearance=transparent><calcite-accordion-item class="item-padding" expanded><div class="margin-block-start-end-0 heading-font " slot=content-start>${this._translations.solutionsContentsAndCount.replace("{{numberOfSolutions}}",this.templateInfos.length.toString())}</div><div class="overflow-auto">${this._accordionLoading?t`<calcite-loader .label=${this._translations.loadingText} scale=m></calcite-loader>`:t`<solution-item-accordion .itemRelationshipDependencies=${e} .listSelectionMode=${e.length>0?"multiple":"single"} .reuseWarning=${this._translations.itemUsedInOtherSolutions} .templateInfos=${this.templateInfos} .typeKeywords=${this.card?.typeKeywords}></solution-item-accordion>`}</div></calcite-accordion-item></calcite-accordion></calcite-panel>`}_getDeleteDialog(){return this._deleteDialogOpen?t`<solution-delete-dialog .card=${this.card} @solutionDeleted=${()=>setTimeout(()=>this.navTabSelected.emit({tabType:"deployments"}),100)} @solutionDeleteDialogBeforeClose=${()=>{this._deleteDialogOpen=!1}} .open=${this._deleteDialogOpen} source="Details Page"></solution-delete-dialog>`:""}_renderDiagramDialog(){return this._isDiagramOpen?t`<calcite-dialog class="dialog-y-size dialog-x-size panel-bg-color" .heading=${this._translations.diagramOfTheSolution.replace("{{solution}}",this.card?.title??"")} id=${this._translations.diagramOfTheSolution.replace("{{solution}}",this.card?.title??"")??c} modal .open=${this._isDiagramOpen} @calciteDialogClose=${()=>{this._isDiagramOpen=!1}} outside-close-disabled scale=m width=l><solution-item-diagram .diagramKey=${this.diagramKey!==""?this.diagramKey:this._configContextConsumer.value?.diagramKey??""} .templateInfoGraph=${this._templateInfoGraph} .typeKeywords=${this.card?.typeKeywords}></solution-item-diagram></calcite-dialog>`:""}async _deleteSolution(){this._deleteDialogOpen=!0}_updateThumbnailToken(e){this._thumbnailUrl!==""&&(this._thumbnailUrl=C(this._thumbnailUrl,e))}};b("solution-deployed-card-panel",h);return h},a,d,e,h,i)
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{b as g}from"./2B4SGB3I.js";import{b as u}from"./YKQDHR27.js";import{a as m}from"./R67EKKSL.js";import{b as h}from"./KIUBUHVM.js";import{G as d,J as p,h as r,i as o,l as c,q as l}from"./H5E6ISYP.js";var f=r`:host{display:block}.padding-start-1{padding-inline-start:1rem}.border-override{--calcite-accordion-border-color: var(--calcite-color-border-1) !important}.display-flex{display:flex}.align-center{align-items:center}.solution-list-item-label{color:var(--calcite-color-text-1);font-size:var(--calcite-font-size--1)}.solution-list-item-label,.solution-list-item-description{font-family:var(--calcite-font-family);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.solution-list-item-description{font-size:var(--calcite-font-size--2);margin-block-start:.125rem;color:var(--calcite-color-text-3)}.solution-list-item-content{display:flex;flex:1 1 auto;flex-direction:column;justify-content:center;line-height:1.375}.underline{text-decoration:underline}calcite-chip{--calcite-chip-icon-color: var(--calcite-color-brand)}`,a=class extends d{constructor(){super(...arguments),this.itemRelationshipDependencies=[],this.linkType="item",this.listSelectionMode="none",this.reuseWarning="",this.templateInfos=[],this.typeKeywords=[],this.usageContext="content",this._canDeletePermission=!1,this._sortedTemplateInfos=[],this._translations=m({name:"solution-item-accordion",blocking:!0}),this._configContextConsumer=u({context:g,subscribe:!0}),this._sortOrder=["Hub Site Application","Hub Page","Web Experience","Instant App","Web Mapping Application","Dashboard","StoryMap","Form","QuickCapture Project","Workflow","Big Data Analytic (hosted)","Real Time Analytic (hosted)","Feed (hosted)","Tool","Notebook","Data Pipeline","Project Package","Desktop Application Template","TypeNotFound","Web Map","Web Scene","Feature Layer (hosted, view)","Feature Layer (hosted)","Table (hosted, view)","Table (hosted)","Tile Layer","CSV","Microsoft Excel","Microsoft Word","Report Template","Rule Package","Group"],this.solutionItemHover=l(),this.solutionItemSelect=l(),this.solutionTypeHover=l()}static{this.properties={itemRelationshipDependencies:0,linkType:1,listSelectionMode:1,reuseWarning:1,templateInfos:0,typeKeywords:0,usageContext:1,_canDeletePermission:16,_sortedTemplateInfos:16,_translations:16}}static{this.styles=f}willUpdate(e){e.has("templateInfos")&&(this.hasUpdated||this.templateInfos?.length>0)&&this.templateInfosWatchHandler()}async templateInfosWatchHandler(){this._sortedTemplateInfos=this._sortTemplates()}async collapseAll(){this.el?.shadowRoot?.querySelectorAll("calcite-accordion-item")?.forEach(e=>{e.expanded=!1})}async deselectAll(e=!1){(this.listSelectionMode==="single"||this.listSelectionMode==="single-persist")&&this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{t.selected&&(t.selected=!1),e&&(t.parentElement?.parentElement).expanded&&((t.parentElement?.parentElement).expanded=!1)})}async expandItemById(e){this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{t.id===e&&((t.parentElement?.parentElement).expanded=!0)})}async expandFirstItem(){let e=this.el?.shadowRoot?.querySelectorAll("calcite-list-item");e?.length&&((e[0].parentElement?.parentElement).expanded=!0)}async expandItems(e){this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{e.indexOf(t.id)>-1&&((t.parentElement?.parentElement).expanded=!0)})}async selectItem(e){(this.listSelectionMode==="single"||this.listSelectionMode==="single-persist")&&this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{t.id===e&&(t.selected=!0,(t.parentElement?.parentElement).expanded=!0)})}async selectFirstItem(){let e=this.el?.shadowRoot?.querySelectorAll("calcite-list-item");e?.length&&(e[0].selected=!0,(e[0].parentElement?.parentElement).expanded=!0)}async selectItems(e){this.listSelectionMode==="multiple"&&this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{e.indexOf(t.id)>-1&&(t.selected=!0,(t.parentElement?.parentElement).expanded=!0)})}async load(){this._sortedTemplateInfos=this._sortTemplates(),this._canDeletePermission=(this._configContextConsumer.value?.authentication?.CanDeleteSolution&&this._configContextConsumer.value?.authentication?.CanUpdateSolution)??!1}render(){return this._getAccordion()}_deselectOthers(e){(this.listSelectionMode==="single"||this.listSelectionMode==="single-persist")&&this.el?.shadowRoot?.querySelectorAll("calcite-list-item")?.forEach(t=>{t.id!==e&&(t.selected=!1)})}_getAccordion(){let e=[],t=this._sortedTemplateInfos.reduce((i,s)=>{let n=this._getTypeForDisplay(s.type,s.typeKeywords);return e.indexOf(n)<0&&(e.push(n),i.push(this._getAccordionItem(s))),i},[]);return o`<calcite-accordion class="border-override" selection-mode=single>${t}</calcite-accordion>`}_getAccordionItem(e){let t=this._getTypeForDisplay(e.type,e.typeKeywords),i=this._sortedTemplateInfos.filter(s=>this._getTypeForDisplay(s.type,s.typeKeywords)===t);return o`<calcite-accordion-item .heading=${`${t} (${i.length})`} @mouseenter=${()=>this.solutionTypeHover.emit({itemType:t,entering:!0})} @mouseleave=${()=>this.solutionTypeHover.emit({itemType:t,entering:!1})}><solution-item-icon class="padding-start-1 display-flex align-center" slot=actions-start .type=${e.type} .typeKeywords=${e.typeKeywords}></solution-item-icon>${this._getList(i)}</calcite-accordion-item>`}_getList(e){let t=this._sortTemplatesByTitle(e);return o`<calcite-list .label=${this._translations.solutionsTemplates} selection-appearance=border .selectionMode=${this.listSelectionMode}>${t.map(i=>this._getListItem(i))}</calcite-list>`}_getListItem(e){let t=this.typeKeywords.includes("Deployed")&&e.url,i=this.linkType==="action";return o`<calcite-list-item id=${e.id??c} @mouseenter=${()=>this.solutionItemHover.emit({itemId:e.id,entering:!0})} @mouseleave=${()=>this.solutionItemHover.emit({itemId:e.id,entering:!1})} @calciteListItemSelect=${()=>{this._deselectOthers(e.id),this.solutionItemSelect.emit({itemId:e.id,selected:!0}),t&&!i&&window.open(e.url,"_blank")}} .value=${e.id}><div class="solution-list-item-content" slot=content><div class=${`solution-list-item-label ${t&&!i?"underline":""}`}>${e.title}</div><div class="solution-list-item-description">${e.snippet}</div></div>${this._checkUsageForWarnings(e)}${t&&i?o`<div slot=actions-end><calcite-action icon=launch .id=${`${e.id}-launch`} @click=${()=>window.open(e.url,"_blank")} text></calcite-action><calcite-tooltip overlay-positioning=fixed .referenceElement=${`${e.id}-launch`}><span>${this._translations?.openDetails}</span></calcite-tooltip></div>`:null}</calcite-list-item>`}_sortTemplatesByTitle(e){return e.sort((t,i)=>t.title<i.title?-1:t.title>i.title?1:0)}_sortTemplates(){return this.templateInfos.sort((e,t)=>{let i=this._getTypeForSort(e),s=this._getTypeForSort(t),n=this._sortOrder.indexOf(i),y=this._sortOrder.indexOf(s);return n-y})}_getTypeForSort(e){let t=this._getTypeForDisplay(e.type,e.typeKeywords);return this._sortOrder.indexOf(t)<0&&(t="TypeNotFound"),t}_getTypeForDisplay(e,t){let i=e;if(e==="Feature Service"){let s=t.indexOf("View Service")>-1,n=t.indexOf("Table")>-1;i=s&&n?"Table (hosted, view)":n?"Table (hosted)":s?"Feature Layer (hosted, view)":"Feature Layer (hosted)"}return e==="Web Mapping Application"&&(i=t.indexOf("configurableApp")>-1?"Instant App":i),i=e==="Geoprocessing Service"?"Tool":i,i=e==="Feed"?"Feed (hosted)":i,i=e==="Real Time Analytic"?"Real Time Analytic (hosted)":i,i=e==="Big Data Analytic"?"Big Data Analytic (hosted)":i,i=e==="Vector Tile Service"?"Tile Layer":i,i}_getWarningChip(e,t){return o`<calcite-chip .icon=${t==="info"?"information":"exclamation-mark-triangle"} kind=neutral .label=${e} scale=s slot=actions-end style=${p({"--calcite-chip-icon-color":t==="info"?"var(--calcite-color-status-info)":"var(--calcite-color-status-danger)"})}>${e}</calcite-chip>`}_checkUsageForWarnings(e){let t=this._configContextConsumer.value?.userSession?.username??null,i=this.itemRelationshipDependencies.some(s=>s===e.id);if(this.usageContext==="content"&&i&&this.reuseWarning)return this._getWarningChip(this.reuseWarning,"info");if(this.usageContext==="rename"){let s=this._configContextConsumer.value?.authentication?.CanUpdateSolution??!1;if(e.owner!==t)if(s){if(i&&this.reuseWarning)return this._getWarningChip(this.reuseWarning,"info")}else return this._getWarningChip(this._translations?.noPrivilegeToManage||"","warn");else if(i&&this.reuseWarning)return this._getWarningChip(this.reuseWarning,"info")}if(this.usageContext==="delete"){if(e.owner!==t)if(this._canDeletePermission){if(i)return this._getWarningChip(this._translations?.usedInOtherSolutionsDeleteWarning||"","info")}else return this._getWarningChip(this._translations?.noPrivilegeToManage||"","warn");else if(i)return this._getWarningChip(this.reuseWarning,"info")}return""}};h("solution-item-accordion",a);export{a};
@@ -1,2 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function B(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function k(t,s){var o={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&s.indexOf(e)<0&&(o[e]=t[e]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,e=Object.getOwnPropertySymbols(t);a<e.length;a++)s.indexOf(e[a])<0&&Object.prototype.propertyIsEnumerable.call(t,e[a])&&(o[e[a]]=t[e[a]]);return o}function C(t){return Object.keys(t).some(s=>{let o=t[s];if(!o)return!1;switch(o&&o.toParam&&(o=o.toParam()),o.constructor.name){case"Array":return!1;case"Object":return!1;case"Date":return!1;case"Function":return!1;case"Boolean":return!1;case"String":return!1;case"Number":return!1;default:return!0}})}function j(t){let s={};return Object.keys(t).forEach(o=>{var e,a;let n=t[o];if(n&&n.toParam&&(n=n.toParam()),!n&&n!==0&&typeof n!="boolean"&&typeof n!="string")return;let r=n.constructor.name,c;switch(r){case"Array":let u=(a=(e=n[0])===null||e===void 0?void 0:e.constructor)===null||a===void 0?void 0:a.name;c=u==="Array"?n:u==="Object"?JSON.stringify(n):n.join(",");break;case"Object":c=JSON.stringify(n);break;case"Date":c=n.valueOf();break;case"Function":c=null;break;case"Boolean":c=n+"";break;default:c=n;break}(c||c===0||typeof c=="string"||Array.isArray(c))&&(s[o]=c)}),s}function A(t,s){return Array.isArray(s)&&s[0]&&Array.isArray(s[0])?s.map(o=>A(t,o)).join("&"):encodeURIComponent(t)+"="+encodeURIComponent(s)}function N(t){let s=j(t);return Object.keys(s).map(o=>A(o,s[o])).join("&")}var I=globalThis.FormData;function U(t,s){let o=C(t)||s,e=j(t);if(o){let a=new I;return Object.keys(e).forEach(n=>{if(typeof Blob<"u"&&e[n]instanceof Blob){let r=e.fileName||e[n].name||n;a.append(n,e[n],r)}else a.append(n,e[n])}),a}else return N(t)}var g=class extends Error{constructor(s,o,e,a,n){super(s);let r=new.target.prototype;Object.setPrototypeOf(this,r),s=s||"UNKNOWN_ERROR",o=o||"UNKNOWN_ERROR_CODE",this.name="ArcGISRequestError",this.message=o==="UNKNOWN_ERROR_CODE"?s:`${o}: ${s}`,this.originalMessage=s,this.code=o,this.response=e,this.url=a,this.options=n}},v={noCorsDomains:[],crossOriginNoCorsDomains:{},pendingNoCorsRequests:{}},R="ARCGIS_REST_JS_NO_CORS";globalThis[R]||(globalThis[R]=Object.assign({},v));var l=globalThis[R];function x(t){let s=new URL(t);t=s.origin+s.pathname,s.search.includes("f=json")&&(t+="?f=json");let o=s.origin;return l.pendingNoCorsRequests[o]||(l.pendingNoCorsRequests[o]=fetch(t,{mode:"no-cors",credentials:"include",cache:"no-store"}).then(e=>{l.noCorsDomains.indexOf(o)===-1&&l.noCorsDomains.push(o),l.crossOriginNoCorsDomains[o.toLowerCase()]=Date.now(),delete l.pendingNoCorsRequests[o]}).catch(e=>(delete l.pendingNoCorsRequests[o],Promise.reject(new Error(`no-cors request to ${o} failed`))))),l.pendingNoCorsRequests[o]}function q(t){t.forEach(s=>{s=s.toLowerCase(),/^https?:\/\//.test(s)?w(s):(w("http://"+s),w("https://"+s))})}function w(t){let s=new URL(t).origin;l.noCorsDomains.indexOf(s)===-1&&l.noCorsDomains.push(s)}function E(t){let s=!1;if(l.noCorsDomains.length){let o=new URL(t).origin.toLowerCase();s=l.noCorsDomains.some(e=>o.includes(e))}return s}function G(t){let s=!1;if(E(t)){let o=new URL(t).origin.toLowerCase(),e=l.crossOriginNoCorsDomains[o]||0;Date.now()-60*6e4>e&&(s=!0)}return s}function L(t){console&&console.warn&&console.warn.apply(console,[t])}function W(){return Promise.resolve({fetch:globalThis.fetch,Headers:globalThis.Headers,Response:globalThis.Response,Request:globalThis.Request})}function $(t,s){var o;if(!s&&!window||!t)return!1;{s=s||window;let e=(o=s.location)===null||o===void 0?void 0:o.origin;return t.startsWith(e)}}var K="@esri/arcgis-rest-js";function M(){return globalThis.DEFAULT_ARCGIS_REQUEST_OPTIONS||{httpMethod:"POST",params:{f:"json"}}}var O=class extends g{constructor(s="AUTHENTICATION_ERROR",o="AUTHENTICATION_ERROR_CODE",e,a,n){super(s,o,e,a,n),this.name="ArcGISAuthError",this.message=o==="AUTHENTICATION_ERROR_CODE"?s:`${o}: ${s}`;let r=new.target.prototype;Object.setPrototypeOf(this,r)}retry(s,o=1){let e=0,a=(n,r)=>{e=e+1,s(this.url,this.options).then(c=>{let u=Object.assign(Object.assign({},this.options),{authentication:c});return S(this.url,u)}).then(c=>{n(c)}).catch(c=>{c.name==="ArcGISAuthError"&&e<o?a(n,r):c.name===this.name&&c.message===this.message&&e>=o?r(this):r(c)})};return new Promise((n,r)=>{a(n,r)})}};function J(t,s,o,e,a){if(t.code>=400){let{message:n,code:r}=t;throw new g(n,r,t,s,e)}if(t.error){let{message:n,code:r,messageCode:c}=t.error,u=c||r||"UNKNOWN_ERROR_CODE";throw r===498||r===499?a||new O(n,u,t,s,e):new g(n,u,t,s,e)}if(t.status==="failed"||t.status==="failure"){let n,r="UNKNOWN_ERROR_CODE";try{n=JSON.parse(t.statusMessage).message,r=JSON.parse(t.statusMessage).code}catch{n=t.statusMessage||t.message}throw new g(n,r,t,s,e)}return t}function S(t,s){let o=M(),e=Object.assign(Object.assign(Object.assign({httpMethod:"POST"},o),s),{params:Object.assign(Object.assign({},o.params),s.params),headers:Object.assign(Object.assign({},o.headers),s.headers)}),{httpMethod:a,rawResponse:n}=e,r=Object.assign({f:"json"},e.params),c=null,u={method:a,signal:e.signal,credentials:e.credentials||"same-origin"};E(t)&&(u.credentials="include"),e.headers&&e.headers["X-Esri-Auth-Client-Id"]&&t.indexOf("/oauth2/platformSelf")>-1&&(u.credentials="include");let p;if(typeof e.authentication=="string"){let i=e.authentication;p={portal:"https://www.arcgis.com/sharing/rest",getToken:()=>Promise.resolve(i)},!e.authentication.startsWith("AAPK")&&!e.authentication.startsWith("AAPT")&&!e.authentication.startsWith("AATK")&&!e.authentication.startsWith("AAST")&&!e.suppressWarnings&&!globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING&&(L("Using an oAuth 2.0 access token directly in the token option is discouraged. Consider using ArcGISIdentityManager or Application session. See https://esriurl.com/arcgis-rest-js-direct-token-warning for more information."),globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING=!0)}else p=e.authentication;let _=t,b=!1;typeof window<"u"&&(b=$(t));let P=!b&&G(t);e.headers&&e.headers["X-Esri-Auth-Client-Id"]&&t.indexOf("/oauth2/platformSelf")>-1&&(u.credentials="include");let T=Promise.resolve();return P&&(u.credentials="include",T=x(t)),T.then(()=>p?p.getToken(t).catch(i=>(i.url=t,i.options=e,c=i,Promise.resolve(""))):Promise.resolve("")).then(i=>{i.length&&(r.token=i),p&&p.getDomainCredentials&&(u.credentials=p.getDomainCredentials(t));let h={};if(u.method==="GET"){r.token&&e.hideToken&&typeof window>"u"&&(h["X-Esri-Authorization"]=`Bearer ${r.token}`,delete r.token);let f=N(r),m=f===""?t:`${t}?${f}`;e.maxUrlLength&&m.length>e.maxUrlLength||!e.maxUrlLength&&m.length>2e3||r.token&&e.hideToken?(u.method="POST",i.length&&e.hideToken&&(r.token=i,delete h["X-Esri-Authorization"])):t=m}let d=new RegExp("/items/.+/updateResources").test(t);return u.method==="POST"&&(u.body=U(r,d)),u.headers=Object.assign(Object.assign({},h),e.headers),(typeof window>"u"||window&&typeof window.document>"u")&&!u.headers.referer&&(u.headers.referer=K),!C(r)&&!d&&(u.headers["Content-Type"]="application/x-www-form-urlencoded"),globalThis.fetch?globalThis.fetch(t,u):W().then(({fetch:f})=>f(t,u))}).then(i=>{if(!i.ok)return i.json().then(h=>{let{status:d,statusText:f}=i,{message:m,details:y}=h.error,D=`${m}. ${y?y.join(" "):""}`.trim();throw new g(D,`HTTP ${d} ${f}`,h,t,e)}).catch(h=>{if(h.name==="ArcGISRequestError")throw h;let{status:d,statusText:f}=i;throw new g(f,`HTTP ${d}`,i,t,e)});if(n)return console.warn("rawResponse option is deprecated and will be removed in ArcGIS REST JS v5.0."),i;switch(r.f){case"json":return i.json();case"geojson":return i.json();case"html":return i.text();case"text":return i.text();default:return i.blob()}}).then(i=>{if((r.f==="json"||r.f==="geojson")&&!n){let h=J(i,_,r,e,c);if(i&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(t)&&Array.isArray(i.authorizedCrossOriginNoCorsDomains)&&q(i.authorizedCrossOriginNoCorsDomains),c){let d=t.toLowerCase().split(/\/rest(\/admin)?\/services\//)[0];e.authentication.federatedServers[d]={token:[],expires:new Date(Date.now()+86400*1e3)},c=null}return h}else return i})}function z(t,s={params:{f:"json"}}){let{request:o}=s,e=k(s,["request"]);return o?o(t,e):S(t,e).catch(a=>a instanceof O&&s.authentication&&typeof s.authentication!="string"&&s.authentication.canRefresh&&s.authentication.refreshCredentials?a.retry(()=>s.authentication.refreshCredentials(),1):Promise.reject(a))}function H(t){return typeof t!="string"||(t=t.trim(),t[t.length-1]==="/"&&(t=t.slice(0,-1))),t}function F(t={}){return t.portal?H(t.portal):t.authentication&&typeof t.authentication!="string"?t.authentication.portal:"https://www.arcgis.com/sharing/rest"}export{B as a,k as b,L as c,z as d,F as e};
@@ -1,345 +0,0 @@
1
- /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- function K(e) {
3
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
4
- }
5
- function I(e, n) {
6
- var r = {};
7
- for (var t in e) Object.prototype.hasOwnProperty.call(e, t) && n.indexOf(t) < 0 && (r[t] = e[t]);
8
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
9
- for (var i = 0, t = Object.getOwnPropertySymbols(e); i < t.length; i++)
10
- n.indexOf(t[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, t[i]) && (r[t[i]] = e[t[i]]);
11
- return r;
12
- }
13
- function b(e) {
14
- return Object.keys(e).some((n) => {
15
- let r = e[n];
16
- if (!r)
17
- return !1;
18
- switch (r && r.toParam && (r = r.toParam()), r.constructor.name) {
19
- case "Array":
20
- return !1;
21
- case "Object":
22
- return !1;
23
- case "Date":
24
- return !1;
25
- case "Function":
26
- return !1;
27
- case "Boolean":
28
- return !1;
29
- case "String":
30
- return !1;
31
- case "Number":
32
- return !1;
33
- default:
34
- return !0;
35
- }
36
- });
37
- }
38
- function A(e) {
39
- const n = {};
40
- return Object.keys(e).forEach((r) => {
41
- var t, i;
42
- let s = e[r];
43
- if (s && s.toParam && (s = s.toParam()), !s && s !== 0 && typeof s != "boolean" && typeof s != "string")
44
- return;
45
- const o = s.constructor.name;
46
- let a;
47
- switch (o) {
48
- case "Array":
49
- const f = (i = (t = s[0]) === null || t === void 0 ? void 0 : t.constructor) === null || i === void 0 ? void 0 : i.name;
50
- a = f === "Array" ? s : f === "Object" ? JSON.stringify(s) : s.join(",");
51
- break;
52
- case "Object":
53
- a = JSON.stringify(s);
54
- break;
55
- case "Date":
56
- a = s.valueOf();
57
- break;
58
- case "Function":
59
- a = null;
60
- break;
61
- case "Boolean":
62
- a = s + "";
63
- break;
64
- default:
65
- a = s;
66
- break;
67
- }
68
- (a || a === 0 || typeof a == "string" || Array.isArray(a)) && (n[r] = a);
69
- }), n;
70
- }
71
- function N(e, n) {
72
- return Array.isArray(n) && n[0] && Array.isArray(n[0]) ? n.map((r) => N(e, r)).join("&") : encodeURIComponent(e) + "=" + encodeURIComponent(n);
73
- }
74
- function T(e) {
75
- const n = A(e);
76
- return Object.keys(n).map((r) => N(r, n[r])).join("&");
77
- }
78
- const U = globalThis.FormData;
79
- function v(e, n) {
80
- const r = b(e) || n, t = A(e);
81
- if (r) {
82
- const i = new U();
83
- return Object.keys(t).forEach((s) => {
84
- if (typeof Blob < "u" && t[s] instanceof Blob) {
85
- const o = t.fileName || t[s].name || s;
86
- i.append(s, t[s], o);
87
- } else
88
- i.append(s, t[s]);
89
- }), i;
90
- } else
91
- return T(e);
92
- }
93
- class m extends Error {
94
- /**
95
- * Create a new `ArcGISRequestError` object.
96
- *
97
- * @param message - The error message from the API
98
- * @param code - The error code from the API
99
- * @param response - The original response from the API that caused the error
100
- * @param url - The original url of the request
101
- * @param options - The original options and parameters of the request
102
- */
103
- constructor(n, r, t, i, s) {
104
- super(n);
105
- const o = new.target.prototype;
106
- Object.setPrototypeOf(this, o), n = n || "UNKNOWN_ERROR", r = r || "UNKNOWN_ERROR_CODE", this.name = "ArcGISRequestError", this.message = r === "UNKNOWN_ERROR_CODE" ? n : `${r}: ${n}`, this.originalMessage = n, this.code = r, this.response = t, this.url = i, this.options = s;
107
- }
108
- }
109
- const G = {
110
- noCorsDomains: [],
111
- crossOriginNoCorsDomains: {},
112
- pendingNoCorsRequests: {}
113
- }, R = "ARCGIS_REST_JS_NO_CORS";
114
- globalThis[R] || (globalThis[R] = Object.assign({}, G));
115
- const u = globalThis[R];
116
- function x(e) {
117
- const n = new URL(e);
118
- e = n.origin + n.pathname, n.search.includes("f=json") && (e += "?f=json");
119
- const r = n.origin;
120
- return u.pendingNoCorsRequests[r] || (u.pendingNoCorsRequests[r] = fetch(e, {
121
- mode: "no-cors",
122
- credentials: "include",
123
- cache: "no-store"
124
- }).then((t) => {
125
- u.noCorsDomains.indexOf(r) === -1 && u.noCorsDomains.push(r), u.crossOriginNoCorsDomains[r.toLowerCase()] = Date.now(), delete u.pendingNoCorsRequests[r];
126
- }).catch((t) => (delete u.pendingNoCorsRequests[r], Promise.reject(new Error(`no-cors request to ${r} failed`))))), u.pendingNoCorsRequests[r];
127
- }
128
- function L(e) {
129
- e.forEach((n) => {
130
- n = n.toLowerCase(), /^https?:\/\//.test(n) ? O(n) : (O("http://" + n), O("https://" + n));
131
- });
132
- }
133
- function O(e) {
134
- const r = new URL(e).origin;
135
- u.noCorsDomains.indexOf(r) === -1 && u.noCorsDomains.push(r);
136
- }
137
- function S(e) {
138
- let n = !1;
139
- if (u.noCorsDomains.length) {
140
- const r = new URL(e).origin.toLowerCase();
141
- n = u.noCorsDomains.some((t) => r.includes(t));
142
- }
143
- return n;
144
- }
145
- function k(e) {
146
- let n = !1;
147
- if (S(e)) {
148
- const r = new URL(e).origin.toLowerCase(), t = u.crossOriginNoCorsDomains[r] || 0;
149
- Date.now() - 60 * 6e4 > t && (n = !0);
150
- }
151
- return n;
152
- }
153
- function q(e) {
154
- console && console.warn && console.warn.apply(console, [e]);
155
- }
156
- function F() {
157
- return Promise.resolve({
158
- fetch: globalThis.fetch,
159
- Headers: globalThis.Headers,
160
- Response: globalThis.Response,
161
- Request: globalThis.Request
162
- });
163
- }
164
- function W(e, n) {
165
- var r;
166
- if (!n && !window || !e)
167
- return !1;
168
- {
169
- n = n || window;
170
- const t = (r = n.location) === null || r === void 0 ? void 0 : r.origin;
171
- return e.startsWith(t);
172
- }
173
- }
174
- const $ = "@esri/arcgis-rest-js";
175
- function M() {
176
- return globalThis.DEFAULT_ARCGIS_REQUEST_OPTIONS || {
177
- httpMethod: "POST",
178
- params: {
179
- f: "json"
180
- }
181
- };
182
- }
183
- class y extends m {
184
- /**
185
- * Create a new `ArcGISAuthError` object.
186
- *
187
- * @param message - The error message from the API
188
- * @param code - The error code from the API
189
- * @param response - The original response from the API that caused the error
190
- * @param url - The original url of the request
191
- * @param options - The original options of the request
192
- */
193
- constructor(n = "AUTHENTICATION_ERROR", r = "AUTHENTICATION_ERROR_CODE", t, i, s) {
194
- super(n, r, t, i, s), this.name = "ArcGISAuthError", this.message = r === "AUTHENTICATION_ERROR_CODE" ? n : `${r}: ${n}`;
195
- const o = new.target.prototype;
196
- Object.setPrototypeOf(this, o);
197
- }
198
- retry(n, r = 1) {
199
- let t = 0;
200
- const i = (s, o) => {
201
- t = t + 1, n(this.url, this.options).then((a) => {
202
- const f = Object.assign(Object.assign({}, this.options), { authentication: a });
203
- return _(this.url, f);
204
- }).then((a) => {
205
- s(a);
206
- }).catch((a) => {
207
- a.name === "ArcGISAuthError" && t < r ? i(s, o) : a.name === this.name && a.message === this.message && t >= r ? o(this) : o(a);
208
- });
209
- };
210
- return new Promise((s, o) => {
211
- i(s, o);
212
- });
213
- }
214
- }
215
- function H(e, n, r, t, i) {
216
- if (e.code >= 400) {
217
- const { message: s, code: o } = e;
218
- throw new m(s, o, e, n, t);
219
- }
220
- if (e.error) {
221
- const { message: s, code: o, messageCode: a } = e.error, f = a || o || "UNKNOWN_ERROR_CODE";
222
- throw o === 498 || o === 499 ? i || new y(s, f, e, n, t) : new m(s, f, e, n, t);
223
- }
224
- if (e.status === "failed" || e.status === "failure") {
225
- let s, o = "UNKNOWN_ERROR_CODE";
226
- try {
227
- s = JSON.parse(e.statusMessage).message, o = JSON.parse(e.statusMessage).code;
228
- } catch {
229
- s = e.statusMessage || e.message;
230
- }
231
- throw new m(s, o, e, n, t);
232
- }
233
- return e;
234
- }
235
- function _(e, n) {
236
- const r = M(), t = Object.assign(Object.assign(Object.assign({ httpMethod: "POST" }, r), n), {
237
- params: Object.assign(Object.assign({}, r.params), n.params),
238
- headers: Object.assign(Object.assign({}, r.headers), n.headers)
239
- }), { httpMethod: i, rawResponse: s } = t, o = Object.assign({ f: "json" }, t.params);
240
- let a = null;
241
- const f = {
242
- method: i,
243
- signal: t.signal,
244
- /* ensures behavior mimics XMLHttpRequest.
245
- needed to support sending IWA cookies */
246
- credentials: t.credentials || "same-origin"
247
- };
248
- S(e) && (f.credentials = "include"), t.headers && t.headers["X-Esri-Auth-Client-Id"] && e.indexOf("/oauth2/platformSelf") > -1 && (f.credentials = "include");
249
- let g;
250
- if (typeof t.authentication == "string") {
251
- const c = t.authentication;
252
- g = {
253
- portal: "https://www.arcgis.com/sharing/rest",
254
- getToken: () => Promise.resolve(c)
255
- };
256
- !t.authentication.startsWith("AAPK") && !t.authentication.startsWith("AAPT") && !t.authentication.startsWith("AATK") && // doesn't look like an API Key
257
- !t.authentication.startsWith("AAST") && // doesn't look like a session token
258
- !t.suppressWarnings && // user doesn't want to suppress warnings for this request
259
- !globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING && (q("Using an oAuth 2.0 access token directly in the token option is discouraged. Consider using ArcGISIdentityManager or Application session. See https://esriurl.com/arcgis-rest-js-direct-token-warning for more information."), globalThis.ARCGIS_REST_JS_SUPPRESS_TOKEN_WARNING = !0);
260
- } else
261
- g = t.authentication;
262
- const j = e;
263
- let w = !1;
264
- typeof window < "u" && (w = W(e));
265
- const D = !w && k(e);
266
- t.headers && t.headers["X-Esri-Auth-Client-Id"] && e.indexOf("/oauth2/platformSelf") > -1 && (f.credentials = "include");
267
- let E = Promise.resolve();
268
- return D && (f.credentials = "include", E = x(e)), E.then(() => g ? g.getToken(e).catch((c) => (c.url = e, c.options = t, a = c, Promise.resolve(""))) : Promise.resolve("")).then((c) => {
269
- c.length && (o.token = c), g && g.getDomainCredentials && (f.credentials = g.getDomainCredentials(e));
270
- const h = {};
271
- if (f.method === "GET") {
272
- o.token && t.hideToken && // Sharing API does not support preflight check required by modern browsers https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request
273
- typeof window > "u" && (h["X-Esri-Authorization"] = `Bearer ${o.token}`, delete o.token);
274
- const d = T(o), p = d === "" ? (
275
- /* istanbul ignore next -- @preserve */
276
- e
277
- ) : `${e}?${d}`;
278
- // This would exceed the maximum length for URLs by 2000 as default or as specified by the consumer and requires POST
279
- t.maxUrlLength && p.length > t.maxUrlLength || !t.maxUrlLength && p.length > 2e3 || // Or if the customer requires the token to be hidden and it has not already been hidden in the header (for browsers)
280
- o.token && t.hideToken ? (f.method = "POST", c.length && t.hideToken && (o.token = c, delete h["X-Esri-Authorization"])) : e = p;
281
- }
282
- const l = new RegExp("/items/.+/updateResources").test(e);
283
- f.method === "POST" && (f.body = v(o, l)), f.headers = Object.assign(Object.assign({}, h), t.headers);
284
- (typeof window > "u" || window && typeof window.document > "u") && !f.headers.referer && (f.headers.referer = $);
285
- !b(o) && !l && (f.headers["Content-Type"] = "application/x-www-form-urlencoded");
286
- return globalThis.fetch ? globalThis.fetch(e, f) : F().then(({ fetch: d }) => d(e, f));
287
- }).then((c) => {
288
- if (!c.ok)
289
- return c.json().then((h) => {
290
- const { status: l, statusText: d } = c, { message: p, details: C } = h.error, P = `${p}. ${C ? C.join(" ") : ""}`.trim();
291
- throw new m(P, `HTTP ${l} ${d}`, h, e, t);
292
- }).catch((h) => {
293
- if (h.name === "ArcGISRequestError")
294
- throw h;
295
- const { status: l, statusText: d } = c;
296
- throw new m(d, `HTTP ${l}`, c, e, t);
297
- });
298
- if (s)
299
- return console.warn("rawResponse option is deprecated and will be removed in ArcGIS REST JS v5.0."), c;
300
- switch (o.f) {
301
- case "json":
302
- return c.json();
303
- case "geojson":
304
- return c.json();
305
- case "html":
306
- return c.text();
307
- case "text":
308
- return c.text();
309
- /* istanbul ignore next blob responses are difficult to make cross platform we will just have to trust that isomorphic fetch will do its job */
310
- default:
311
- return c.blob();
312
- }
313
- }).then((c) => {
314
- if ((o.f === "json" || o.f === "geojson") && !s) {
315
- const h = H(c, j, o, t, a);
316
- if (c && /\/sharing\/rest\/(accounts|portals)\/self/i.test(e) && Array.isArray(c.authorizedCrossOriginNoCorsDomains) && L(c.authorizedCrossOriginNoCorsDomains), a) {
317
- const l = e.toLowerCase().split(/\/rest(\/admin)?\/services\//)[0];
318
- t.authentication.federatedServers[l] = {
319
- token: [],
320
- // default to 24 hours
321
- expires: new Date(Date.now() + 86400 * 1e3)
322
- }, a = null;
323
- }
324
- return h;
325
- } else
326
- return c;
327
- });
328
- }
329
- function B(e, n = { params: { f: "json" } }) {
330
- const { request: r } = n, t = I(n, ["request"]);
331
- return r ? r(e, t) : _(e, t).catch((i) => i instanceof y && n.authentication && typeof n.authentication != "string" && n.authentication.canRefresh && n.authentication.refreshCredentials ? i.retry(() => n.authentication.refreshCredentials(), 1) : Promise.reject(i));
332
- }
333
- function J(e) {
334
- return typeof e != "string" || (e = e.trim(), e[e.length - 1] === "/" && (e = e.slice(0, -1))), e;
335
- }
336
- function z(e = {}) {
337
- return e.portal ? J(e.portal) : e.authentication && typeof e.authentication != "string" ? e.authentication.portal : "https://www.arcgis.com/sharing/rest";
338
- }
339
- export {
340
- I as _,
341
- K as a,
342
- z as g,
343
- B as r,
344
- q as w
345
- };