/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import * as m from "@esri/solution-common";
import { c as C } from "./runtime.js";
import { css as M, html as l, svg as x } from "lit";
import { u as U } from "./useT9n.js";
import { LitElement as $, createEvent as P, nothing as f, safeClassMap as G } from "@arcgis/lumina";
import { useContextConsumer as E } from "@arcgis/lumina/context";
import { createContext as T } from "@lit/context";
import "@arcgis/lumina/controllers";
import "@arcgis/core/identity/IdentityManager.js";
import "@arcgis/core/identity/OAuthInfo.js";
import "@arcgis/core/portal/Portal.js";
import "@arcgis/core/intl.js";
import { createRef as _, ref as S } from "lit-html/directives/ref.js";
const B = T("isMobile");
T("localDebug");
const K = T("config"), F = M`calcite-card{height:100%;padding-bottom:var(--calcite-spacing-base)}@media(max-width:400px){calcite-card{width:100%}}calcite-card:hover img{-webkit-filter:brightness(30%);filter:brightness(30%);-webkit-transition:all .1s ease;-moz-transition:all .1s ease;-o-transition:all .1s ease;-ms-transition:all .1s ease;transition:all .1s ease}calcite-card:hover .hover-text{opacity:1;color:#fff}calcite-card:hover{outline:var(--calcite-spacing-base) solid var(--calcite-color-brand);box-sizing:content-box;cursor:pointer}.hover-text{transition:.1s ease;opacity:0;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%);text-align:center;display:flex;flex-direction:row;align-items:center;height:100%;font-size:var(--calcite-spacing-xl)}.card-image-wrap{flex:0 0 auto}.card-image-wrap{width:100%;position:relative;margin-bottom:0;-webkit-box-flex:0 0 auto;-ms-flex:0 0 auto;flex:0 0 auto}.card-image{width:100%;display:block}video,img{max-width:100%;height:auto}img{overflow-clip-margin:content-box;overflow:clip}.width-full{width:100%}.deployed-label-override{--calcite-label-text-color: var(--calcite-color-text-3);--calcite-label-margin-bottom: var(--calcite-spacing-none)}.svg-color{fill:var(--calcite-color-text-3)}.padding-end-1-2{padding-inline-end:var(--calcite-spacing-sm)}.padding-bottom-1-2{padding-bottom:var(--calcite-spacing-sm)}.display-flex{display:flex}.display-none{display:none}.flex-direction-column{flex-direction:column}.align-items-center{align-items:center}.font-weight-400,.font-weight-normal{font-weight:400}.font-color-text-2{--calcite-label-text-color: var(--calcite-color-text-2)}.font-line-height{line-height:1.4}.font-size-size--1{font-size:var(--calcite-font-size--1)}.icon-brand-color{--calcite-icon-color: var(--calcite-color-brand)}.header-line-height{--calcite-label-margin-bottom: 0;margin-top:var(--calcite-spacing-sm);margin-bottom:.7rem}.dialog-y-size{--calcite-dialog-size-y: 90% }.dialog-x-size{--calcite-dialog-size-x: 90% }.justify-content-space-between{justify-content:space-between}.panel-bg-color{--calcite-panel-header-background-color: var(--calcite-color-foreground-1);--calcite-panel-background-color: var(--calcite-color-foreground-1)}.cursor-default{cursor:default}`;
function H(e) {
  let t = "", i = "?";
  return e.forEach((s) => {
    s.k && s.v && (t += i + s.k + "=" + s.v, i = "&");
  }), t;
}
function Re(e) {
  return e ? m.getVelocityUrlBase(e, {}).then((t) => Promise.resolve(!!t)) : Promise.resolve(!1);
}
async function W(e, t) {
  const i = t, s = await i.getUsername(), r = {
    q: new m.SearchQueryBuilder().match(e).in("title").and().match(s).in("owner"),
    filter: "type:Solution",
    authentication: i
  }, p = (await m.searchAllItems(r)).results.map((u) => u.title), { folders: o } = await m.getFoldersAndGroups(i), h = o.map((u) => u.title), d = [...p, ...h].map((u) => u.trim().toLowerCase()), w = e.toLowerCase(), N = d.filter((u) => u === w), L = d.filter((u) => u.startsWith(w));
  return { conflictingNames: N, similiarNames: L };
}
async function ke(e, t) {
  return V(e) ? { status: !1, type: "empty" } : z(e) ? { status: !1, type: "exceed length" } : Y(e, "folder") ? { status: !1, type: "special character" } : (await W(e.trim(), t)).conflictingNames.length > 0 ? { status: !1, type: "not unique" } : { status: !0, type: "" };
}
function V(e) {
  return e.length <= 0;
}
function z(e) {
  return e.length > fe;
}
function Y(e, t) {
  return (t === "item" ? /[><~`$^+=|]/u : /[/<>]/u).test(e);
}
function Ne(e) {
  if (e) {
    const t = e.trim();
    return t ? "<div>" + t + "</div>" : "";
  } else
    return "";
}
function q(e) {
  let t = "", i = "?";
  return e.forEach((s) => {
    s.k && s.v && (t += i + s.k + "=" + s.v, i = "&");
  }), t;
}
function Le(e, t, i, s) {
  let a = "";
  return t ? a = s + "/sharing/rest/content/items/" + e + "/info/" + t + q([{ k: "w", v: "400" }]) : a = i, a;
}
function Ce(e) {
  const t = e ? e.replace("https://", "").replace("www.", "") : "";
  return t.endsWith("devext.arcgis.com") || t.endsWith("mapsqa.arcgis.com") || t.endsWith("qaext.arcgis.com") ? e ?? "https://www.arcgis.com" : "https://www.arcgis.com";
}
function Me(e, t, i) {
  return t.some((s) => s.wkid === e ? (i = s.defaultExtent, !0) : !1), i;
}
function xe(e, t) {
  return O(t || e);
}
function Ue(e, t = "en") {
  return new Intl.DateTimeFormat(t, {
    year: "numeric",
    month: "long",
    day: "numeric"
  }).format(e);
}
function $e(e, t) {
  let i = "";
  return e.some((s) => s.startsWith(t) ? (i = s.substring(t.length), !0) : !1), i;
}
function O(e) {
  const t = e.replace("www.", "");
  return t.endsWith("devext.arcgis.com") ? "dev" : t.endsWith("mapsqa.arcgis.com") || t.endsWith("qaext.arcgis.com") ? "qa" : t === "arcgis.com" || t.endsWith(".arcgis.com") ? "prod" : "dev";
}
function Pe(e, t) {
  let i = e?.reduce((s, a) => (s.indexOf(a.id) < 0 && s.push(a.id), s), []) || [];
  return t ? i.sort((s, a) => t.indexOf(s) - t.indexOf(a)) : i;
}
function Ge(e) {
  return e.charAt(0).toUpperCase() + e.slice(1);
}
function Be(e) {
  return {
    relevance: "Relevance",
    title: "Title",
    new: "New",
    created: "Date deployed",
    updated: "Updated",
    suggested: "Suggested for you"
  }[e] || e;
}
function Ke(e) {
  if (!e)
    return "Unknown error";
  if (e.message)
    return e.message;
  try {
    const t = JSON.stringify(e);
    return t && t !== "{}" ? t : e.toString();
  } catch {
    return e.toString();
  }
}
function Fe(e) {
  return e ? parseFloat(((Date.now() - e) / 1e3).toFixed(2)) : 0;
}
function g(e, t) {
  (e.key === "Enter" || e.code === "NumpadEnter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), t());
}
async function j(e, t) {
  const i = await m.getItemDataAsJson(e, t);
  if (!i)
    throw new Error(`Solution ${e} was not found`);
  const s = t?.portal.replace("/sharing/rest", "") ?? "https://www.arcgis.com";
  let a = [];
  if (i.templates[0].item)
    a = i.templates.map((r) => ({
      id: r.itemId,
      title: r.item.title,
      type: r.item.type,
      typeKeywords: r.item.typeKeywords,
      dependencies: r.dependencies,
      snippet: r.item.snippet
    }));
  else {
    const r = i.templates.map((o) => o.type === "Group" ? m.getGroupBase(o.itemId, t) : m.getItemBase(o.itemId, t));
    a = (await Promise.allSettled(r)).filter((o) => o.status === "fulfilled").map((o) => o.value).map((o, h) => {
      const d = typeof o.type > "u" ? "group" : "item";
      return {
        id: o.id,
        title: o.title,
        type: o.type ?? "Group",
        typeKeywords: o.typeKeywords,
        dependencies: i.templates[h].dependencies,
        snippet: o.snippet,
        url: `${s}/home/${d}.html?id=${o.id}`
      };
    });
  }
  return a;
}
function He(e, t, i) {
  const s = e.templates.map((h) => h.type), a = [];
  a.push(ae), s.indexOf("Group") >= 0 && (a.push(A), a.push(D)), s.indexOf("Feature Service") >= 0 && a.push(I);
  const r = s.indexOf("Feed") > -1;
  r && a.push(oe);
  const n = s.indexOf("Big Data Analytic") > -1;
  n && a.push(ne);
  const p = s.indexOf("Real Time Analytic") > -1;
  p && a.push(le), (r || n || p) && a.push(ge), s.indexOf("Workflow") > -1 && (a.push(A), a.push(I), a.push(D), a.push(me)), s.indexOf("Geoprocessing Service") > -1 && (a.push(re), i.IsEnterprisePortal && a.push(de));
  const o = e.templates.reduce(
    (h, d) => h.concat(d.item.typeKeywords || []),
    []
  );
  return Q(a, o, i), X(a, t), J(a, e), a;
}
function J(e, t) {
  t.templates.some((i) => i.type === "Group" && i.item?.membershipAccess === "collaboration") && e.push(se);
}
function Q(e, t, i) {
  const s = v(i), a = Z(i);
  ["Location Tracking View"].some((n) => t.indexOf(n) > -1) && (!s && !a ? e.push(ue) : s && !a ? e.push(pe) : !s && a && e.push(he));
}
function X(e, t) {
  ["HubPremium"].some((s) => t.indexOf(s) > -1) && e.push(ce);
}
function v(e) {
  return e.PortalUserSubset?.role === "org_admin" && !e.PortalUserSubset?.roleId;
}
function Z(e) {
  return e.PortalSubset?.locationTrackingEnabled || !1;
}
function We(e, t) {
  let i = {
    leadingMessages: [],
    bulletedMessages: [],
    trailingMessages: []
  };
  const s = [
    c.NOTEBOOK,
    c.VELOCITY,
    c.HUBPREMIUM,
    c.WORKFLOW,
    c.TRACKINGBASE
  ];
  let a = y(
    e,
    t,
    c.VELOCITY
  );
  a && i.leadingMessages.push(a);
  let r = y(
    e,
    t,
    c.NOTEBOOK
  );
  r && i.leadingMessages.push(r);
  let n = y(
    e,
    t,
    c.HUBPREMIUM
  );
  n && i.leadingMessages.push(n);
  let p = y(
    e,
    t,
    c.WORKFLOW
  );
  p && i.leadingMessages.push(p), t = t.filter((d) => s.indexOf(d) < 0), t.forEach((d) => {
    i.bulletedMessages.push(
      R(e, d)
    );
  });
  let o = y(
    e,
    t,
    c.TRACKINGBASE
  );
  return o && i.trailingMessages.push(o), (i.leadingMessages.length > 0 || i.trailingMessages.length > 0 || i.bulletedMessages.length > 0) && i.trailingMessages.push(
    e.missingPrivilegesPopup.suggestedProblemRemedyMessage
  ), i;
}
function y(e, t, i) {
  return t.filter((a) => a.includes(i)).length > 0 ? R(e, i) : "";
}
function R(e, t) {
  const i = e.missingPrivilegesPopup.requiredPrivilegesList;
  let s = "";
  switch (t) {
    case "portal:user:createItem":
      s = i.createItem;
      break;
    case "portal:publisher:publishFeatures":
      s = i.publishFeatures;
      break;
    case "portal:user:createGroup":
      s = i.createGroup;
      break;
    case "portal:user:shareToGroup":
      s = i.shareToGroup;
      break;
    case "portal:user:addExternalMembersToGroup":
      s = i.addMembers;
      break;
    case "portal:publisher:publishFeeds":
      s = i.publishFeeds;
      break;
    case "portal:publisher:publishBigDataAnalytics":
      s = i.publishBigDataAnalytics;
      break;
    case "portal:publisher:publishRealTimeAnalytics":
      s = i.publishRealTimeAnalytics;
      break;
    case "solutions:locationtracking:admin:tracking":
      s = i.requiresLocationTrackingAndAdmin;
      break;
    case "solutions:locationtracking:tracking":
      s = i.requiresLocationTracking;
      break;
    case "solutions:locationtracking:admin":
      s = i.requiresAdmin;
      break;
    case "solutions:hubPremium":
      s = i.hubPremium;
      break;
    case "solutions:workflowManager":
      s = i.workflowManager;
      break;
    case "solutions:velocity":
      s = i.velocity;
      break;
    case "solutions:notebook":
      s = i.requiresNotebookServer;
      break;
    case "portal:publisher:publishServerGPServices":
      s = i.publishGPServices;
      break;
    case "writable:Enterprise":
      s = i.writableEnterprise;
      break;
    case "writable:Online":
      s = i.writableOnline.replace("{{url}}", "https://status.arcgis.com");
      break;
  }
  return s;
}
function Ve(e, t) {
  const i = k(t), s = H([{ k: "id", v: e }]) || "";
  return i ? `${i}/home/item.html${s}` : "";
}
function ze(e, t, i, s) {
  const a = s || k(i);
  return a ? `${a}/sharing/rest/content/items/${e}/resources/${t}` : "";
}
function k(e) {
  return e?.PortalSubset?.orgUrl || e?.PortalUrl || "";
}
function ee(e, t) {
  const i = new URL(e);
  return i.searchParams.set("token", t), i.toString();
}
class te extends $ {
  constructor() {
    super(), this.deployedDate = "", this.description = "", this.diagramKey = "", this.heading = "", this.itemId = "", this.owner = "", this.thumbnail = "", this.updateAvailable = !1, this.templateInfos = [], this._isDeleteOpen = !1, this._isDiagramOpen = !1, this.isMobile = !1, this.templateInfoGraph = [], this._configureTitlesOpen = !1, this._thumbnailUrl = "", this._translations = U({ name: "solution-deployed-card", blocking: !0 }), this._configContextConsumer = E({
      context: K,
      subscribe: !0,
      callback: async (t) => {
        t && (this._isOrgAdmin = v(t.authentication), this._thumbnailUrl = `${this.thumbnail}&token=${t.userSession?.token}`);
      }
    }), this._deleteDialogRef = _(), this._diagramDialogRef = _(), this._isOrgAdmin = !1, this._isMobileContextConsumer = E({
      context: B,
      subscribe: !0,
      callback: (t) => this.isMobile = t
    }), this.deployedCardSelected = P(), this.listenOn(window, "sessionRefreshed", (t) => {
      this._updateThumbnailToken(t.detail);
    });
  }
  static {
    this.properties = { card: 0, deployedDate: 1, description: 1, diagramKey: 1, heading: 1, itemId: 1, owner: 1, thumbnail: 1, updateAvailable: 5, templateInfos: 0, _isDeleteOpen: 16, _isDiagramOpen: 16, isMobile: 16, templateInfoGraph: 16, _configureTitlesOpen: 16, _thumbnailUrl: 16, _translations: 16 };
  }
  static {
    this.styles = F;
  }
  get _telemetry() {
    return this._configContextConsumer.value?.telemetrySession;
  }
  async renderDeleteDialog() {
    return this._isDeleteOpen = !0, this._renderDeleteDialog(), this._deleteDialogRef.value;
  }
  async renderDiagramDialog(t) {
    return await this._viewDiagram(t), await this._renderDiagramDialog(), this._diagramDialogRef.value;
  }
  async getTemplates() {
    return this._processTemplates(this.card);
  }
  async load() {
    this._isMobileContextConsumer.value && (this.isMobile = this._isMobileContextConsumer.value);
  }
  render() {
    return l`<calcite-card .label=${this.description} @click=${this._cardSelected} @keydown=${(t) => g(t, () => this._cardSelected())}>${this._getImage()}${this._getHeader()}<p class="font-color-text-2 font-line-height font-size-size--1" slot=description>${this.description}</p><div class="width-full display-flex flex-direction-column" slot=footer-start><div class="padding-bottom-1-2">${this.owner !== "" && this._getOwnerLabel() || ""}${this._getDeployedDate()}</div>${this._getConfigureButton()}</div></calcite-card>${this._renderDeleteDialog()}${this._renderDiagramDialog()}${this._renderConfigureTitlesDialog()}`;
  }
  _getImage() {
    return l`<div class="card-image-wrap" slot=thumbnail><img alt=${this.heading ?? f} class="thumbnail card-image" src=${this._thumbnailUrl ?? f}><div class="hover-text">${this._translations.openSolution}</div></div>`;
  }
  _getHeader() {
    return l`<div class="display-flex justify-content-space-between header-line-height" slot=heading><calcite-label layout=inline-space-between scale=l>${this.heading}</calcite-label></div>`;
  }
  _getOwnerLabel() {
    return l`<calcite-label class="font-weight-400 padding-end-1-2" layout=inline scale=s>${`${this._translations.owner}:`}<calcite-link class="font-weight-normal" @click=${this._openUserProfile} @keydown=${(t) => g(t, () => this._openUserProfile(t))}>${this.owner}</calcite-link></calcite-label>`;
  }
  _getDeployedDate() {
    return l`<div class="display-flex align-items-center"><div class="padding-end-1-2"><svg height=16px viewBox="0 0 32 32" width=16px xmlns=http://www.w3.org/2000/svg>${x`<path class="svg-color" d="M29.963 7.672a1.586 1.586 0 0 0-1.584-1.585h-5.274a.187.187 0 0 1-.188-.187V3.977A2 2 0 0 0 20.825 2h-9.672A2.095 2.095 0 0 0 9.06 4.093V5.9a.187.187 0 0 1-.187.187H3.598a1.586 1.586 0 0 0-1.584 1.585v4.016a.281.281 0 0 0 .281.28H4.9l.014-.013V9.153a.177.177 0 0 1 .177-.177h21.46a.456.456 0 0 1 .449.45v13.742A1.832 1.832 0 0 1 25.168 25h-8.892a.568.568 0 0 1-.534-.373 3.98 3.98 0 0 0-7.6.373H5.657a.757.757 0 0 1-.757-.757v-3.055A.188.188 0 0 0 4.714 21H2.028l-.014.014v4.58a2.35 2.35 0 0 0 2.347 2.346h4.161a3.963 3.963 0 0 0 6.8.256.569.569 0 0 1 .475-.256h12.065a2.102 2.102 0 0 0 2.101-2.101zM21 5.625a.375.375 0 0 1-.375.375h-9.25A.375.375 0 0 1 11 5.625V4.45a.456.456 0 0 1 .45-.45h9.1a.456.456 0 0 1 .45.45zM12 28a2 2 0 1 1 2-2 2 2 0 0 1-2 2z" /><path class="svg-color" d="M13.273 17.994a.57.57 0 0 1 .479.262A3.73 3.73 0 0 0 17 20a3.74 3.74 0 0 0 3.403-2.006h3.41a.188.188 0 0 0 .187-.188v-2.589a.187.187 0 0 0-.188-.188H20.8A3.8 3.8 0 0 0 17 12a4.058 4.058 0 0 0-3.69 2.647.568.568 0 0 1-.537.383H1.093a.094.094 0 0 0-.093.093V17.9a.094.094 0 0 0 .094.094zM17 13.9a2.1 2.1 0 1 1-2.1 2.1 2.1 2.1 0 0 1 2.1-2.1z" />`}</svg></div><calcite-label class="deployed-label-override" scale=s>${this._translations.deployedDate.replace("{{date}}", this.deployedDate)}</calcite-label></div>`;
  }
  _getConfigureButton() {
    const t = this._configContextConsumer.value?.userSession?.username, i = this._configContextConsumer.value?.authentication?.CanUpdateSolution, s = this.card?.owner === t || this._isOrgAdmin || i, a = this.card?.owner === t || this._isOrgAdmin, r = s ? "display-none" : "";
    return l`<calcite-split-button appearance=outline aria-label=${this._translations.openSolution ?? f} dropdown-label=${this._translations.moreActions ?? f} kind=neutral @calciteSplitButtonPrimaryClick=${this._cardSelected} @click=${(n) => n.stopPropagation()} @keydown=${(n) => n.stopPropagation()} overlay-positioning=fixed primary-text=${this._translations.openSolution ?? f} width=full><calcite-dropdown-group selection-mode=none>${!this.isMobile && l`<calcite-dropdown-item icon-start=model @click=${this._viewDiagram} @keydown=${(n) => g(n, () => this._viewDiagram(n))}>${this._translations.viewDiagram}</calcite-dropdown-item>` || ""}<calcite-dropdown-item icon-start=file-text @click=${this._viewDocumentation} @keydown=${(n) => g(n, () => this._viewDocumentation(n))}>${this._translations.documentation}</calcite-dropdown-item><calcite-dropdown-item icon-start=information @click=${this._viewItemDetails} @keydown=${(n) => g(n, () => this._viewItemDetails(n))}>${this._translations.viewItemDetails}</calcite-dropdown-item>${!this.isMobile && s && l`<calcite-dropdown-item icon-start=edit-attributes id=solution-configure-titles-dropdown @click=${async () => {
      this.templateInfos = await this._processTemplates(this.card), this._configureTitlesOpen = !0;
    }} @keydown=${(n) => g(n, async () => {
      this.templateInfos = await this._processTemplates(this.card), this._configureTitlesOpen = !0;
    })}>${this._translations.renameItems}</calcite-dropdown-item>` || ""}${!this.isMobile && a && l`<calcite-dropdown-item icon-start=trash @click=${this._deleteSolution} @keydown=${(n) => g(n, () => this._deleteSolution(n))}>${this._translations.deleteSolution}</calcite-dropdown-item>` || ""}</calcite-dropdown-group><calcite-tooltip class=${G(r)} overlay-positioning=fixed reference-element=solution-configure-titles-dropdown><span>${this._translations.mustOwnSolution}</span></calcite-tooltip></calcite-split-button>`;
  }
  _renderDeleteDialog() {
    return this._isDeleteOpen ? l`<solution-delete-dialog .card=${this.card} @solutionDeleteDialogOpen=${(t) => {
      this._isDeleteOpen = t.detail;
    }} .open=${this._isDeleteOpen} source="Card Dropdown" ${S(this._deleteDialogRef)}></solution-delete-dialog>` : "";
  }
  _renderDiagramDialog() {
    return this._isDiagramOpen ? l`<calcite-dialog class="dialog-y-size dialog-x-size panel-bg-color" .heading=${this._translations.diagramTitle.replace("{{solution}}", this.card?.title ?? "")} id=${this._translations.diagramTitle.replace("{{solution}}", this.card?.title ?? "") ?? f} modal .open=${this._isDiagramOpen} @calciteDialogClose=${() => {
      this._isDiagramOpen = !1;
    }} outside-close-disabled scale=m width=l ${S(this._diagramDialogRef)}><solution-item-diagram .diagramKey=${this.diagramKey} .templateInfoGraph=${this.templateInfoGraph} .typeKeywords=${this.card?.typeKeywords}></solution-item-diagram></calcite-dialog>` : "";
  }
  _renderConfigureTitlesDialog() {
    return this._configureTitlesOpen ? l`<solution-configure-titles .card=${this.card} @solutionConfigureTitlesBeforeClose=${async () => {
      this._processTemplates(this.card).then((t) => {
        this.templateInfos = t;
      }), this._configureTitlesOpen = !1;
    }} @solutionItemsTitlesChanged=${async () => {
      this._processTemplates(this.card).then((t) => {
        this.templateInfos = t;
      });
    }} .open=${this._configureTitlesOpen} source="Card Dropdown" .templateInfos=${this.templateInfos}></solution-configure-titles>` : "";
  }
  _cardSelected() {
    this.deployedCardSelected.emit({
      card: this.card,
      cardRef: this.el
    });
  }
  async _viewDiagram(t) {
    t.stopPropagation(), this.card && (this._telemetry?.logEvent({
      category: b.DEPLOYMENTS,
      action: "View Diagram",
      dimensions: [
        this.card.title || "",
        this.card.deployCommonId || "",
        this.card.deployVersion || "",
        "Card Dropdown"
      ]
    }), this.templateInfoGraph = await this._processTemplates(this.card), this._isDiagramOpen = !0);
  }
  _viewDocumentation(t) {
    t.stopPropagation(), this._telemetry?.logEvent({
      category: b.DEPLOYMENTS,
      action: "Open Help",
      dimensions: [
        this.card?.title || "",
        this.card?.deployCommonId || "",
        this.card?.deployVersion || "",
        "Card Dropdown"
      ]
    }), window.open(this.card.learnMoreUrl, "_blank");
  }
  _viewItemDetails(t) {
    t.stopPropagation(), this._telemetry?.logEvent({
      category: b.DEPLOYMENTS,
      action: "Open Item Details",
      dimensions: [
        this.card?.title || "",
        this.card?.deployCommonId || "",
        this.card?.deployVersion || "",
        "Card Dropdown"
      ]
    }), window.open(this.card.itemUrl, "_blank");
  }
  _deleteSolution(t) {
    t.stopPropagation(), this._isDeleteOpen = !0;
  }
  _openUserProfile(t) {
    t.stopPropagation();
    const i = this._configContextConsumer.value?.authentication?.PortalSubset?.orgUrl;
    i && window.open(`${i}/home/user.html?user=${this.owner}`, "_blank");
  }
  async _processTemplates(t) {
    return await j(t.id, this._configContextConsumer.value.userSession);
  }
  _updateThumbnailToken(t) {
    this._thumbnailUrl !== "" && (this._thumbnailUrl = ee(this._thumbnailUrl, t));
  }
}
C("solution-deployed-card", te);
const Ye = 500, qe = {
  AEC: "Architecture, Engineering, and Construction (AEC)",
  AIRPORTPORTRAIL: "Airports, Ports, and Rails",
  BUSINESS: "Business",
  CONSERVATION: "Conservation",
  DEFENSE: "Defense",
  FACILITIES: "Facilities",
  HEALTHANDHUMANSERVICES: "Health and Human Services",
  PIPELINE: "Pipeline",
  PUBLICSAFETY: "Public Safety",
  RENEWABLES: "Renewables",
  STATEANDLOCALGOVERNMENT: "State and Local Government",
  TELECOMMUNICATIONS: "Telecommunications",
  UTILITIES: "Utilities"
}, je = {
  AIRPORT: "Airports",
  AGRICULTURE: "Agriculture",
  ASSESSMENTANDTAXATION: "Assessment and Taxation",
  DISTRICTENERGY: "District Energy",
  ELECTIONS: "Elections",
  ELECTRIC: "Electric",
  EMERGENCYMANAGEMENT: "Emergency Management",
  ENVIRONMENTANDNATURALRESOURCES: "Environment and Natural Resources",
  FIRESERVICE: "Fire Service",
  FISHANDWILDLIFE: "Fish and Wildlife",
  GAS: "Gas",
  HEALTHANDHUMANSERVICES: "Health and Human Services",
  LAWENFORCEMENT: "Law Enforcement",
  NATURALRESOURCES: "Natural Resources",
  PARKS: "Parks",
  PLANNINGANDDEVELOPMENT: "Planning and Development",
  PROTECTEDAREAS: "Protected Areas",
  PUBLICWORKS: "Public Works",
  SEWER: "Sewer",
  STORMWATER: "Stormwater",
  TELECOMMUNICATIONS: "Telecommunications",
  TRANSPORTATION: "Transportation",
  WATER: "Water Distribution"
};
var c = /* @__PURE__ */ ((e) => (e.HUBPREMIUM = "solutions:hubPremium", e.NOTEBOOK = "solutions:notebook", e.TRACKINGBASE = "solutions:locationtracking", e.TRACKING = "solutions:locationtracking:tracking", e.TRACKINGADMIN = "solutions:locationtracking:admin", e.TRACKINGADMINANDTRACKING = "solutions:locationtracking:admin:tracking", e.VELOCITY = "solutions:velocity", e.WORKFLOW = "solutions:workflowManager", e))(c || {}), ie = /* @__PURE__ */ ((e) => (e.VELOCITYBIGDATA = "portal:publisher:publishBigDataAnalytics", e.VELOCITYFEEDS = "portal:publisher:publishFeeds", e.VELOCITYREALTIME = "portal:publisher:publishRealTimeAnalytics", e))(ie || {});
const Je = '((typekeywords:Solution,Deployed,"ArcGIS Solution") OR ((typekeywords:Solution,Deployed) AND (created:[1577862000000 TO 1622576880000])))', Qe = "(typekeywords:Solution,Template)", se = "portal:user:addExternalMembersToGroup", ae = "portal:user:createItem", A = "portal:user:createGroup", ne = "portal:publisher:publishBigDataAnalytics", I = "portal:publisher:publishFeatures", oe = "portal:publisher:publishFeeds", re = "portal:publisher:publishServerGPServices", le = "portal:publisher:publishRealTimeAnalytics", D = "portal:user:shareToGroup", ce = "solutions:hubPremium", de = "solutions:notebook", ue = "solutions:locationtracking:admin:tracking", pe = "solutions:locationtracking:tracking", he = "solutions:locationtracking:admin", ge = "solutions:velocity", me = "solutions:workflowManager", fe = 250, b = {
  SOLUTION_DETAILS: "Solution Details",
  GLOBAL_NAVIGATION: "Global Nav",
  ALL_SOLUTIONS: "Solutions",
  DEPLOYMENTS: "Deployments",
  ASSISTANT: "Assistant",
  RESOURCES: "Resources"
}, Xe = {
  MINE: "My deployments",
  ORG: "Organization"
}, Ze = {
  BOTH: "New,Suggested",
  NEW: "New",
  SUGGESTED: "Suggested"
}, et = {
  NEW: "new",
  NUMVIEWS: "views",
  RELEVANCE: "relevance",
  SUGGESTED: "suggested",
  TITLE: "title",
  UPDATED: "updated"
}, tt = {
  DEPLOY: "deploy",
  AIOPEN: "aiOpen"
};
export {
  ke as $,
  K as A,
  Je as B,
  Y as C,
  Ve as D,
  c as E,
  v as F,
  B as G,
  ee as H,
  fe as I,
  g as J,
  ze as K,
  Ge as L,
  Be as M,
  Ce as N,
  Ne as O,
  se as P,
  Ue as Q,
  Le as R,
  ce as S,
  b as T,
  q as U,
  Re as V,
  Fe as W,
  Ke as X,
  He as Y,
  We as Z,
  xe as _,
  Qe as a,
  Me as a0,
  W as a1,
  te as a2,
  Ye as b,
  Xe as c,
  je as d,
  qe as e,
  Ze as f,
  ie as g,
  tt as h,
  et as i,
  A as j,
  ae as k,
  ne as l,
  I as m,
  oe as n,
  re as o,
  le as p,
  D as q,
  de as r,
  pe as s,
  he as t,
  ue as u,
  ge as v,
  me as w,
  j as x,
  $e as y,
  Pe as z
};
