/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import f from"./3A5WS2II.js";import e from"./LSBUPU7F.js";import b from"./PYPVVSIX.js";import{b as m}from"./2B4SGB3I.js";import{b as d}from"./I2NTSKBD.js";import"./ACTJS4TX.js";import{a as c}from"./XF5N3NI5.js";import"./UBPOT5V3.js";import"./ISFTCFSJ.js";import"./TEHBW75B.js";import"./IHG7KTNC.js";import"./ZCU2WWVN.js";import"./WGO4EVOV.js";import"./YKB6256M.js";import"./N22MFQSQ.js";import"./N7BXCDA3.js";import"./ZX3UHK6P.js";import"./Z4F2NZOT.js";import"./KOIDWEP3.js";import"./3KXMYZCU.js";import"./LP2JYX4X.js";import"./GF4QELNV.js";import"./AYSQIO6L.js";import"./YQHYMLC7.js";import"./DKD2EGQP.js";import"./5O53T3SW.js";import"./AJZDBHB6.js";import"./FES7B3SJ.js";import{b as a}from"./2I5LGZNX.js";import{G as r,K as s,h as o,i,q as n}from"./FFF5HUPM.js";import"./EXBEKVP5.js";export default $arcgis.t(([{v:u},,h])=>{var p=o`.text-center{text-align:center}.no-solutions{display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;min-height:calc(100vh - 190px)}.display-flex{display:flex;align-items:center}.display-none{display:none}.flex-direction-column{flex-direction:column}.flex-direction-row{flex-direction:row}.padding-10{padding:10px}.padding-y-10{padding-top:10px;padding-bottom:10px}.subnote{font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.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}`,l=class extends r{constructor(){super(),this.referenceCards=[],this.results=null,this.hasLinks=!1,this.listTitle="",this._translations=c({name:"solutions-deployed-list",blocking:!0}),this._cardsFetcher=null,this._configContextConsumer=d({context:m,subscribe:!0}),this.deployedCardSelected=n()}static{this.properties={referenceCards:0,results:0,hasLinks:5,listTitle:1,_translations:16,_cardsFetcher:16}}static{this.styles=p}async load(){if(this._configContextConsumer?.value){let t=this._configContextConsumer.value;this._cardsFetcher=new h(t.locale,t.orgUrl,t.portalURL)}}disconnectedCallback(){super.disconnectedCallback()}render(){if(!this.results)return i`<div class="no-solutions"></div>`;let t=this.listTitle||this._translations.dependencyList,e="solutions-deployed-list-title";return i`${this.listTitle!==""&&i`<div class="solutions-deployed-list-title" id=${e}>${this.listTitle}</div>`||""}${this.hasLinks?i`<calcite-list aria-labelledby=${(this.listTitle!==""?e:void 0)??s} .label=${t}>${this._renderCards()}</calcite-list>`:i`<calcite-list aria-labelledby=${(this.listTitle!==""?e:void 0)??s} .label=${t} selection-mode=none interaction-mode=static>${this._renderCards()}</calcite-list>`}`}_renderCards(){if(this._cardsFetcher&&this.results){let t={...this.results};return t.results=u(t.results),this._cardsFetcher.getCardsFromResponse(t).map(e=>i`<calcite-list-item .label=${e.title} @calciteListItemSelect=${()=>{this.hasLinks&&this._cardSelected(e)}} .value=${e.id}><div class="solution-list-item-content" slot=content><div class=${`solution-list-item-label ${this.hasLinks?"underline":""}`}>${e.title}</div><div class="solution-list-item-description">${`${this._translations.deployedVersion} ${e.deployVersion} - ${new Date(e.created).toLocaleDateString(this._configContextConsumer.value?.locale,{year:"numeric",month:"long",day:"numeric"})}`}</div></div></calcite-list-item>`)}return[]}async _cardSelected(t){let e={tabType:"deployed-card",tabTitleOrId:t.id};window.dispatchEvent(new CustomEvent("forceSelectTab",{detail:e}))}};a("solutions-deployed-list",l);return l},b,e,f)