import { r as e, c as t, h as a, H as o, a as i, g as n } from "./p-9b9ccd0c.js";

import { L as r } from "./p-311eedf3.js";

import { g as s } from "./p-d42e842b.js";

import "./p-6534555e.js";

import "lit";

import "lit/directives/when.js";

import "lit/directives/if-defined.js";

const c = ":host{display:block;block-size:100%;overflow:auto;background-color:var(--ch-color-surface-primary);color:var(--ch-color-text-primary)}.main{overflow:auto;display:block}.apis-container{padding:24px;display:flex;flex-direction:column;gap:var(--spacing-gap-xl);max-width:100%}.api-item{background:var(--ch-color-surface-secondary);border:1px solid var(--color-border-neutral-default);border-radius:0;overflow:hidden;transition:all var(--timing-fast) ease;width:100%;max-width:100%;display:flex;flex-direction:column;min-height:64px}.api-item:hover{box-shadow:var(--color-accent-surface-elevation-2);transform:translateY(-2px);border-color:var(--color-border-primary-hover)}.api-header{padding:16px;background:transparent;border-bottom:1px solid var(--color-border-neutral-default);flex-shrink:0}.api-header .api-name{margin:0;color:var(--color-text-neutral-default);word-break:break-all;overflow-wrap:break-word}.api-content{overflow:hidden}.no-apis,.no-data{color:var(--color-text-neutral-disabled);font-style:italic;text-align:center;padding:16px}.no-apis p,.no-data p{font-size:var(--font-size-body-m);font-weight:var(--font-style-semi-bold);line-height:var(--line-height-spacious)}";

var l = undefined && undefined.__classPrivateFieldSet || function(e, t, a, o, i) {
  if (o === "m") throw new TypeError("Private method is not writable");
  if (o === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
  if (typeof t === "function" ? e !== t || !i : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return o === "a" ? i.call(e, a) : i ? i.value = a : t.set(e, a), a;
};

var d = undefined && undefined.__classPrivateFieldGet || function(e, t, a, o) {
  if (a === "a" && !o) throw new TypeError("Private accessor was defined without a getter");
  if (typeof t === "function" ? e !== t || !o : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return a === "m" ? o : a === "a" ? o.call(e) : o ? o.value : t.get(e);
};

var p, h;

const u = [ "resets/box-sizing", "components/accordion", "utils/elevation", "utils/layout", "utils/typography", "utils/spacing" ];

const f = class {
  constructor(a) {
    e(this, a);
    this.copyToClipboard = t(this, "copyToClipboard", 7);
    p.set(this, void 0);
    h.set(this, []);
    this.apis = undefined;
    this.onObjectSelected = undefined;
  }
  async componentWillLoad() {
    try {
      l(this, p, await r.getComponentStrings(this.element), "f");
    } catch (e) {
      console.error("Error loading locale:", e);
      l(this, p, {}, "f");
    }
    this.initializeAccordionModel();
  }
  /**
     * Initialize accordion model with dynamic sections for each API
     */  initializeAccordionModel() {
    if (!this.apis || !Array.isArray(this.apis)) {
      l(this, h, [], "f");
      return;
    }
    l(this, h, this.apis.map(((e, t) => {
      let a;
      if (typeof e === "string") {
        a = e;
      } else if (e && typeof e === "object" && e.url) {
        a = e.url.toString();
      } else {
        return null;
      }
      const o = a.lastIndexOf("/");
      const i = a.substring(o + 1, a.length).toUpperCase();
      return {
        id: `api-${t}`,
        caption: i,
        expanded: true
      };
    })).filter(Boolean), "f");
  }
  renderApis() {
    if (!this.apis || !Array.isArray(this.apis)) {
      return null;
    }
    return this.apis.map(((e, t) => {
      let o;
      if (typeof e === "string") {
        o = {
          url: e
        };
      } else if (e && typeof e === "object" && e.url) {
        o = e;
      } else {
        return null;
      }
      return a("div", {
        key: `api-${t}`,
        slot: `api-${t}`,
        class: "api-content spacing-body"
      }, a("gx-ide-launchpad-api", {
        data: o,
        onObjectSelected: e => this.handleObjectSelection(e),
        onCopyToClipboard: e => this.handleCopyToClipboard(e)
      }));
    })).filter(Boolean);
  }
  /**
     * Handles object selection from subcomponents
     */  handleObjectSelection(e) {
    if (this.onObjectSelected) {
      this.onObjectSelected(e);
    }
  }
  /**
     * Handles copy to clipboard from subcomponents
     */  handleCopyToClipboard(e) {
    this.copyToClipboard.emit({
      url: e.detail.url
    });
  }
  render() {
    var e;
    if (!this.apis || this.apis.length === 0) {
      return a(o, null, a("ch-theme", {
        model: u
      }), a("div", {
        class: "no-data"
      }, a("p", {
        class: "body-regular-s"
      }, ((e = d(this, p, "f")) === null || e === void 0 ? void 0 : e.noApis) || "No APIs available")));
    }
    return a(o, null, a("ch-theme", {
      model: u
    }), a("div", {
      class: "main"
    }, a("ch-accordion-render", {
      class: "accordion-filled-header elevation-2 apis-accordion",
      model: d(this, h, "f")
    }, this.renderApis())));
  }
  static get assetsDirs() {
    return [ "gx-ide-assets/launchpad-apis" ];
  }
  get element() {
    return i(this);
  }
};

p = new WeakMap, h = new WeakMap;

f.style = c;

const b = '.object-card{border:none;border-radius:4px;padding:12px;display:flex;gap:var(--spacing-gap-l);flex-direction:column;flex-shrink:0;text-align:left}.platform-grid{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--card-min-inline-size, 300px), var(--card-max-inline-size, 1fr)));gap:var(--spacing-gap-l);align-items:stretch}button.button-secondary{border-color:var(--color-border-neutral-default)}:host{display:block;block-size:100%;overflow:auto}.main{overflow:auto;display:block}ch-accordion-render{inline-size:100%;block-size:100%}.native-apps-accordion{inline-size:100%;block-size:100%}.platform-section{display:flex;align-items:center;gap:var(--spacing-gap-l)}.app__apple-store{height:32px;cursor:pointer;transition:opacity var(--timing-fast) ease}.app__apple-store:hover{opacity:0.8}.platform-grid{--card-min-inline-size:360px}.card-content{display:flex;gap:var(--spacing-gap-xl);flex:1;width:100%}.card-content:focus{outline:none}.info-section{flex:1;display:flex;flex-direction:column;justify-content:space-between;width:100%}.app-info{display:flex;flex-direction:column;gap:var(--spacing-gap-xs);flex:1}.name{color:var(--color-text-neutral-default)}.description{color:var(--color-text-neutral-disabled);margin:0;line-height:var(--line-height-relaxed)}.dialog{--ch-dialog-block-size:400px;--ch-dialog-inline-size:350px;--ch-dialog-min-block-size:400px;--ch-dialog-min-inline-size:350px}.qr-container{display:flex;align-items:center;justify-content:center}.card-actions{display:flex;justify-content:space-between;align-items:center;padding-top:12px;border-top:1px solid var(--color-border-neutral-default)}.no-data,.no-results{color:var(--color-text-neutral-disabled);font-style:italic;text-align:center;padding:16px}.no-data p,.no-results p{font-size:var(--font-size-body-m);font-weight:var(--font-style-semi-bold);line-height:var(--line-height-spacious)}@media (max-width: 768px){.platform-grid{justify-content:center}.card-content{flex-direction:column;gap:var(--spacing-gap-l)}.card-actions{flex-direction:column;gap:var(--spacing-gap-l);align-items:stretch}}@media (max-width: 480px){.main{padding:12px}.object-card{padding:12px}.platform-grid{gap:var(--spacing-gap-l);padding:12px}}.android:after{content:"";display:block}';

var m = undefined && undefined.__classPrivateFieldSet || function(e, t, a, o, i) {
  if (o === "m") throw new TypeError("Private method is not writable");
  if (o === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
  if (typeof t === "function" ? e !== t || !i : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return o === "a" ? i.call(e, a) : i ? i.value = a : t.set(e, a), a;
};

var g = undefined && undefined.__classPrivateFieldGet || function(e, t, a, o) {
  if (a === "a" && !o) throw new TypeError("Private accessor was defined without a getter");
  if (typeof t === "function" ? e !== t || !o : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return a === "m" ? o : a === "a" ? o.call(e) : o ? o.value : t.get(e);
};

var v, y, x, w, j, k, C, _, z, A, W, T, I;

const P = "ios";

const S = "android";

const L = n("./gx-ide-assets/launchpad-native-apps/images/app-store-badge.svg");

const N = n("./gx-ide-assets/launchpad-native-apps/images/android-logo.svg");

const E = n("./gx-ide-assets/launchpad-native-apps/images/mac-logo.svg");

const O = [ "resets/box-sizing", "components/accordion", "components/button", "components/dialog", "components/icon", "utils/elevation", "utils/layout", "utils/spacing", "utils/typography" ];

const M = s({
  category: "system",
  name: "qr-code",
  colorType: "interactive"
});

const G = class {
  constructor(a) {
    e(this, a);
    this.copyToClipboard = t(this, "copyToClipboard", 7);
    this.openOnTheAppStore = t(this, "openOnTheAppStore", 7);
    v.add(this);
    y.set(this, void 0);
    x.set(this, []);
    w.set(this, new Set);
    this.objects = [];
    this.filterValue = "";
    this.order = {
      orderCriteria: null,
      ascending: null
    };
    this.page = 1;
    this.perPage = 10;
    this.onObjectSelected = undefined;
    this.showCopiedMessage = {};
    this.showQRDialog = false;
    this.selectedObjectForQR = null;
  }
  async componentWillLoad() {
    try {
      m(this, y, await r.getComponentStrings(this.el), "f");
    } catch (e) {
      console.error("Error loading locale:", e);
      m(this, y, {}, "f");
    }
    m(this, x, [ {
      id: P,
      caption: "iOS",
      expanded: true
    }, {
      id: S,
      caption: "Android",
      expanded: true
    } ], "f");
  }
  /**
     * Cleanup method to prevent memory leaks
     */  disconnectedCallback() {
    if (g(this, w, "f")) {
      g(this, w, "f").forEach((e => {
        if (e) {
          clearTimeout(e);
        }
      }));
      g(this, w, "f").clear();
    }
  }
  render() {
    var e;
    if (!this.objects || this.objects.length === 0) {
      a("div", {
        class: "no-data"
      }, a("p", {
        class: "body-regular-s"
      }, ((e = g(this, y, "f")) === null || e === void 0 ? void 0 : e.noData) || "No native applications data available"));
    }
    return [ a("ch-theme", {
      model: O
    }), a("div", {
      class: "main"
    }, a("ch-accordion-render", {
      class: "accordion-filled-header elevation-1 native-apps-accordion",
      model: g(this, x, "f")
    }, a("div", {
      slot: P,
      class: "accordion-content spacing-body"
    }, g(this, v, "m", I).call(this, P)), a("div", {
      slot: S,
      class: "accordion-content spacing-body"
    }, g(this, v, "m", I).call(this, S)))), a("ch-dialog", {
      class: "dialog",
      show: this.showQRDialog,
      "show-header": true,
      closable: true,
      "close-button-accessible-name": "Close QR code",
      onDialogClosed: () => g(this, v, "m", W).call(this)
    }, this.selectedObjectForQR && a("div", {
      class: "qr-container"
    }, a("ch-qr", {
      value: this.selectedObjectForQR.url || "",
      size: 200,
      "error-correction-level": "Low",
      class: "qr-code",
      fill: g(this, v, "m", j).call(this),
      background: g(this, v, "m", k).call(this)
    }))) ];
  }
  static get assetsDirs() {
    return [ "gx-ide-assets/launchpad-native-apps" ];
  }
  get el() {
    return i(this);
  }
};

y = new WeakMap, x = new WeakMap, w = new WeakMap, v = new WeakSet, j = function _GxIdeLaunchpadNativeApps_getQRFillColor() {
  const e = getComputedStyle(document.documentElement);
  return e.getPropertyValue("--color-text-neutral-default").trim() || e.getPropertyValue("--color-neutral-400").trim() || "#49566d";
}, k = function _GxIdeLaunchpadNativeApps_getQRBackgroundColor() {
  const e = getComputedStyle(document.documentElement);
  return e.getPropertyValue("--color-neutral-1600").trim() || "#ffffff";
}, C = function _GxIdeLaunchpadNativeApps_getCopyIcon() {
  return s({
    category: "system",
    name: "copy",
    colorType: "primary"
  });
}, _ = function _GxIdeLaunchpadNativeApps_copyToClipboardFunc(e) {
  this.copyToClipboard.emit({
    url: e.url
  });
  if (e.url) {
    navigator.clipboard.writeText(e.url).then((() => {
      const t = `${e.name}-${e.url}`;
      this.showCopiedMessage = Object.assign(Object.assign({}, this.showCopiedMessage), {
        [t]: true
      });
      const a = window.setTimeout((() => {
        this.showCopiedMessage = Object.assign(Object.assign({}, this.showCopiedMessage), {
          [t]: false
        });
        g(this, w, "f").delete(a);
      }), 2e3);
      g(this, w, "f").add(a);
    })).catch((e => {
      console.error("Failed to copy text: ", e);
    }));
  }
}, z = function _GxIdeLaunchpadNativeApps_openAppStoreFunc(e) {
  this.openOnTheAppStore.emit({
    url: e.url
  });
  if (e.url) {
    window.open(e.url, "_blank");
  }
}, A = function _GxIdeLaunchpadNativeApps_handleQRClick(e) {
  this.selectedObjectForQR = e;
  this.showQRDialog = true;
}, W = function _GxIdeLaunchpadNativeApps_handleCloseQRDialog() {
  this.showQRDialog = false;
  this.selectedObjectForQR = null;
}, T = function _GxIdeLaunchpadNativeApps_handleObjectClick(e) {
  if (e.key && this.onObjectSelected) {
    // Send the full key object as string in format "type|id"
    const t = `${e.key.type}|${e.key.id}`;
    this.onObjectSelected({
      detail: {
        key: t
      }
    });
  }
}, I = function _GxIdeLaunchpadNativeApps_renderPlatformSection(e) {
  var t, o;
  const i = e === P ? a("img", {
    src: E,
    alt: "Apple iOS Logo"
  }) : a("img", {
    src: N,
    alt: "Android Logo"
  });
  const n = this.objects.find((t => t.type === e));
  if (!n || n.objects.length === 0) {
    return a("div", {
      class: "no-results"
    }, a("p", {
      class: "body-regular-s"
    }, ((o = (t = g(this, y, "f")) === null || t === void 0 ? void 0 : t.noPlatformApps) === null || o === void 0 ? void 0 : o.replace("{platformType}", e)) || `No ${e} applications available`));
  }
  return a("div", {
    class: "platform-grid"
  }, n.objects.map(((e, t) => {
    var o, n, r;
    return a("div", {
      key: t,
      class: "object-card elevation-1",
      tabindex: "0",
      onClick: () => g(this, v, "m", T).call(this, e)
    }, a("div", {
      class: "card-content"
    }, a("div", {
      class: "info-section"
    }, a("div", {
      class: "app-info"
    }, a("h1", {
      class: "name body-semi-bold-s"
    }, e.name), e.description && a("p", {
      class: "description body-regular-xs"
    }, e.description)))), a("div", {
      class: "card-actions"
    }, e.url && a("div", {
      class: "platform-section"
    }, e["app-store-badge"] ? a("img", {
      src: L,
      alt: "Download on the App Store",
      class: "app__apple-store",
      onClick: () => g(this, v, "m", z).call(this, e)
    }) : i, a("button", {
      class: "button-secondary button-icon-and-text",
      onClick: () => g(this, v, "m", A).call(this, e),
      "aria-label": "Show QR Code"
    }, a("ch-image", {
      class: "icon-m",
      src: M,
      type: "mask"
    }), ((o = g(this, y, "f")) === null || o === void 0 ? void 0 : o.showQR) || "Show QR")), a("button", {
      class: "button-tertiary button-icon-and-text copy-button",
      onClick: () => g(this, v, "m", _).call(this, e),
      "aria-label": "Copy to clipboard"
    }, a("ch-image", {
      class: "icon-m",
      src: g(this, v, "m", C).call(this)
    }), this.showCopiedMessage[`${e.name}-${e.url}`] ? ((n = g(this, y, "f")) === null || n === void 0 ? void 0 : n.copied) || "Copied!" : ((r = g(this, y, "f")) === null || r === void 0 ? void 0 : r.copy) || "Copy")));
  })), 
  // WA: Prevent card take full width if there is only one card
  n.objects.length === 1 && a("div", null));
};

G.style = b;

const $ = ".object-card{border:none;border-radius:4px;padding:12px;display:flex;gap:var(--spacing-gap-l);flex-direction:column;flex-shrink:0;text-align:left}.object-card:focus-visible{outline:none;border-color:var(--focus__outline-color)}.object-card:hover{cursor:pointer;border-color:var(--color-border-item-hover)}.object-card:active{border-color:var(--color-border-item-pressed)}:host{display:block;block-size:100%;overflow:auto}.main{overflow:auto;display:block}.input-filter{inline-size:33%;min-inline-size:300px}ch-accordion-render{inline-size:100%;block-size:100%}.accordion-content{inline-size:100%;overflow-x:auto;min-width:0}.web-apps-accordion{inline-size:100%;block-size:100%}.main-objects-grid{display:grid;grid-template-columns:repeat(auto-fit, minmax(267px, 1fr));gap:var(--spacing-gap-l);align-items:stretch}.object-card{inline-size:100%;border-width:1px;border-style:solid}.object-card.elevation-1{--elevation-border-color:var(\n    --color-accent-surface-elevation-1\n  )}.card-header{display:flex;justify-content:space-between;align-items:flex-start;flex-shrink:0}.card-header .left{display:flex;flex-direction:column;flex:1;gap:8px}.card-header .left .name{color:var(--color-text-neutral-default);font-weight:var(--font-style-regular)}.card-header .left .module{color:var(--ch-color-text-secondary);margin:0}.card-header .right .type-container{display:flex;flex-direction:column;align-items:flex-end;gap:8px}.card-header .type{margin:0;color:var(--color-text-neutral-disabled)}.card-footer{display:flex;justify-content:space-between;align-items:center;margin-top:auto;padding-top:12px;border-top:1px solid var(--color-border-surface-on-elevation-1);flex-shrink:0}.card-footer .description{margin:0;line-height:var(--line-height-relaxed);color:var(--color-text-neutral-default)}.card-footer .angular-icon{inline-size:14px;block-size:14px;opacity:0.8}.no-results,.no-objects{color:var(--color-text-neutral-disabled);text-align:center;padding:16px}.recent-objects-grid-container .cell-content{display:flex;align-items:center;gap:var(--spacing-gap-m)}.tabular-grid-scroll-container{max-block-size:400px;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}:host{display:block !important}.header{display:block !important;inline-size:100% !important;float:none !important;clear:both !important}.field{display:block !important;inline-size:100% !important;float:none !important;clear:both !important}.main{display:block !important;inline-size:100% !important;float:none !important;clear:both !important}";

var D = undefined && undefined.__classPrivateFieldGet || function(e, t, a, o) {
  if (a === "a" && !o) throw new TypeError("Private accessor was defined without a getter");
  if (typeof t === "function" ? e !== t || !o : !t.has(e)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
  return a === "m" ? o : a === "a" ? o.call(e) : o ? o.value : t.get(e);
};

var R = undefined && undefined.__classPrivateFieldSet || function(e, t, a, o, i) {
  if (o === "m") throw new TypeError("Private method is not writable");
  if (o === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
  if (typeof t === "function" ? e !== t || !i : !t.has(e)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
  return o === "a" ? i.call(e, a) : i ? i.value = a : t.set(e, a), a;
};

var Q, q, H, F, B, U, V, Y, J, K;

const X = [ "resets/box-sizing", "components/edit", "components/accordion", "components/tabular-grid", "components/icon", "chameleon/scrollbar", "utils/layout", "utils/form", "utils/typography", "utils/spacing", "utils/elevation" ];

const Z = n("./gx-ide-assets/launchpad-web-apps/images/angular-logo.svg");

const ee = "recent-objects";

const te = "name";

const ae = "module";

const oe = "type";

const ie = "description";

const ne = class {
  constructor(a) {
    e(this, a);
    this.copyToClipboard = t(this, "copyToClipboard", 7);
    Q.add(this);
    q.set(this, void 0);
    /**
         * Sorts recent objects
         */    F.set(this, ((e, t) => {
      var a, o;
      if (this.order.orderCriteria) {
        const i = ((a = D(this, Q, "m", B).call(this, e, this.order.orderCriteria)) === null || a === void 0 ? void 0 : a.toUpperCase()) || "";
        const n = ((o = D(this, Q, "m", B).call(this, t, this.order.orderCriteria)) === null || o === void 0 ? void 0 : o.toUpperCase()) || "";
        if (i < n) {
          return this.order.ascending ? -1 : 1;
        }
        if (i > n) {
          return this.order.ascending ? 1 : -1;
        }
      }
      return 0;
    }));
    /**
         * Handles column sort changes
         */    U.set(this, (e => {
      const {columnId: t, sortDirection: a} = e.detail;
      this.order = {
        orderCriteria: t,
        ascending: a === "asc"
      };
    }));
    this.objects = [];
    this.onObjectSelected = undefined;
    this.filterValue = "";
    this.recentObjectsExpanded = true;
    this.order = {
      orderCriteria: null,
      ascending: null
    };
  }
  async componentWillLoad() {
    try {
      R(this, q, await r.getComponentStrings(this.el), "f");
    } catch (e) {
      console.error("Error loading locale:", e);
      R(this, q, {}, "f");
    }
  }
  handleAccordionExpandedChange(e) {
    if (e.detail.id === ee) {
      this.recentObjectsExpanded = e.detail.expanded;
    }
  }
  render() {
    var e, t, i;
    if (!this.objects || this.objects.length === 0) {
      return a(o, null, a("ch-theme", {
        model: X
      }), a("div", {
        class: "no-data"
      }, a("p", {
        class: "body-regular-s"
      }, ((e = D(this, q, "f")) === null || e === void 0 ? void 0 : e.noData) || "No web applications data available")));
    }
    return a(o, null, a("ch-theme", {
      model: X
    }), a("header", {
      class: "header dialog-header"
    }, a("div", {
      class: "field field-block"
    }, a("ch-edit", {
      class: "input input-filter",
      id: "filter",
      placeholder: ((t = D(this, q, "f")) === null || t === void 0 ? void 0 : t.search) || "Search",
      value: this.filterValue,
      accessibleName: ((i = D(this, q, "f")) === null || i === void 0 ? void 0 : i.search) || "Search",
      onInput: e => this.filterValue = String(e.detail)
    }))), a("div", {
      class: "main"
    }, a("ch-accordion-render", {
      class: "accordion-filled-header elevation-1 web-apps-accordion",
      model: [ {
        id: "main-objects",
        caption: "Main Objects",
        expanded: true
      }, {
        id: ee,
        caption: "Recent Objects",
        expanded: this.recentObjectsExpanded
      } ]
    }, a("div", {
      slot: "main-objects",
      class: "accordion-content spacing-body"
    }, D(this, Q, "m", J).call(this)), a("div", {
      slot: ee,
      class: "accordion-content spacing-body"
    }, D(this, Q, "m", K).call(this)))));
  }
  static get assetsDirs() {
    return [ "gx-ide-assets/launchpad-web-apps" ];
  }
  get el() {
    return i(this);
  }
};

q = new WeakMap, F = new WeakMap, U = new WeakMap, Q = new WeakSet, H = function _GxIdeLaunchpadWebApps_filterObjects(e) {
  if (!this.filterValue) return true;
  const t = this.filterValue.toLowerCase();
  return e.module && e.module.toLowerCase().includes(t) || e.name && e.name.toLowerCase().includes(t) || e.type && e.type.toLowerCase().includes(t) || e.description && e.description.toLowerCase().includes(t);
}, B = function _GxIdeLaunchpadWebApps_getObjectValue(e, t) {
  switch (t) {
   case "name":
    return e.name || "";

   case "module":
    return e.module || "";

   case "type":
    return e.type || "";

   case "description":
    return e.description || "";

   default:
    return "";
  }
}, V = function _GxIdeLaunchpadWebApps_getObjectTypeIcon(e) {
  var t;
  const a = {
    "36e32e2d-023e-4188-95df-d13573bac2e0:API": s({
      category: "objects",
      name: "api"
    }),
    "2a9e9aba-d2de-4801-ae7f-5e3819222daf:Data Provider": s({
      category: "objects",
      name: "data-provider"
    }),
    "9bdcc055-174e-4af6-96cb-a2ceef6c5f09:Menu": s({
      category: "objects",
      name: "dashboard"
    }),
    "9bdcc055-174e-4af6-96cb-a2ceef6c5f09:Dashboard": s({
      category: "objects",
      name: "dashboard"
    }),
    "0eee17f4-cef9-4988-aed4-c2da632be85b:Mini App": s({
      category: "objects",
      name: "mini-app"
    }),
    "d82625fd-5892-40b0-99c9-5c8559c197fc:Panel": s({
      category: "objects",
      name: "panel-for-sd"
    }),
    "d82625fd-5892-40b0-99c9-5c8559c197fc:SDPanel": s({
      category: "objects",
      name: "panel-for-sd"
    }),
    "84a12160-f59b-4ad7-a683-ea4481ac23e9:Procedure": s({
      category: "objects",
      name: "procedure"
    }),
    "a7e6cce5-1171-49e9-a6a0-07f137eedc07:Super App": s({
      category: "objects",
      name: "super-app"
    }),
    "1db606f2-af09-4cf9-a3b5-b481519d28f6:Transaction": s({
      category: "objects",
      name: "transaction"
    }),
    "c9584656-94b6-4ccd-890f-332d11fc2c25:Web Panel": s({
      category: "objects",
      name: "webpanel"
    }),
    "c9584656-94b6-4ccd-890f-332d11fc2c25:WebPanel": s({
      category: "objects",
      name: "webpanel"
    }),
    "c9584656-94b6-4ccd-890f-332d11fc2c25:Web Component": s({
      category: "objects",
      name: "web-component"
    }),
    "c9584656-94b6-4ccd-890f-332d11fc2c25:WebComponent": s({
      category: "objects",
      name: "web-component"
    }),
    "15cf49b5-fc38-4899-91b5-395d02d79889:Work With": s({
      category: "patterns",
      name: "workwith-for-sd"
    }),
    "15cf49b5-fc38-4899-91b5-395d02d79889:WorkWith": s({
      category: "patterns",
      name: "workwith-for-sd"
    }),
    API: s({
      category: "objects",
      name: "api"
    }),
    "Data Provider": s({
      category: "objects",
      name: "data-provider"
    }),
    Menu: s({
      category: "objects",
      name: "dashboard"
    }),
    Dashboard: s({
      category: "objects",
      name: "dashboard"
    }),
    "Mini App": s({
      category: "objects",
      name: "mini-app"
    }),
    Panel: s({
      category: "objects",
      name: "panel-for-sd"
    }),
    SDPanel: s({
      category: "objects",
      name: "panel-for-sd"
    }),
    Procedure: s({
      category: "objects",
      name: "procedure"
    }),
    "Super App": s({
      category: "objects",
      name: "super-app"
    }),
    Transaction: s({
      category: "objects",
      name: "transaction"
    }),
    "Web Panel": s({
      category: "objects",
      name: "webpanel"
    }),
    WebPanel: s({
      category: "objects",
      name: "webpanel"
    }),
    "Web Component": s({
      category: "objects",
      name: "web-component"
    }),
    WebComponent: s({
      category: "objects",
      name: "web-component"
    }),
    "Work With": s({
      category: "patterns",
      name: "workwith-for-sd"
    }),
    WorkWith: s({
      category: "patterns",
      name: "workwith-for-sd"
    })
  };
  if ((t = e.key) === null || t === void 0 ? void 0 : t.type) {
    const t = `${e.key.type}:${e.type}`;
    if (a[t]) {
      return a[t];
    }
  }
  if (a[e.type]) {
    return a[e.type];
  }
  return s({
    category: "objects",
    name: "object"
  });
}, Y = function _GxIdeLaunchpadWebApps_handleObjectClick(e) {
  if (e.key && this.onObjectSelected) {
    // Send the full key object as string in format "type|id"
    const t = `${e.key.type}|${e.key.id}`;
    this.onObjectSelected({
      detail: {
        key: t
      }
    });
  }
}, J = function _GxIdeLaunchpadWebApps_renderMainObjects() {
  var e, t, o;
  const i = ((e = this.objects.find((e => e.type === "main"))) === null || e === void 0 ? void 0 : e.objects) || [];
  const n = i.filter((e => D(this, Q, "m", H).call(this, e)));
  if (i.length === 0) {
    return a("div", {
      class: "no-results"
    }, a("p", {
      class: "body-regular-s"
    }, ((t = D(this, q, "f")) === null || t === void 0 ? void 0 : t.noMainObjects) || "There are no main objects to display"));
  }
  if (n.length === 0) {
    return a("div", {
      class: "no-results"
    }, a("p", {
      class: "body-regular-s"
    }, (o = D(this, q, "f")) === null || o === void 0 ? void 0 : o.noObjectsMatchSearch));
  }
  return a("div", {
    class: "main-objects-grid"
  }, n.map(((e, t) => a("button", {
    key: t,
    class: "object-card elevation-1",
    onClick: () => D(this, Q, "m", Y).call(this, e)
  }, a("div", {
    class: "card-header"
  }, a("div", {
    class: "left"
  }, a("h1", {
    class: "name body-semi-bold-s"
  }, e.name), a("h3", {
    class: "module body-regular-xs"
  }, e.module), a("p", {
    class: "type body-italic-xs"
  }, e.type)), a("div", {
    class: "right"
  }, a("div", {
    class: "type-container"
  }, a("ch-image", {
    class: "type-icon icon-m",
    src: D(this, Q, "m", V).call(this, e)
  })))), (e.description || e.angular) && a("footer", {
    class: "card-footer"
  }, a("div", {
    class: "left"
  }, e.description && a("p", {
    class: "description body-regular-xs"
  }, e.description)), a("div", {
    class: "right"
  }, e.angular && a("img", {
    src: Z,
    alt: "Angular Logotype"
  })))))), 
  // WA: Add empty divs to ensure a minimum of 4 grid items for proper layout
  n.length < 4 && Array.from({
    length: 4 - n.length
  }).map(((e, t) => a("div", {
    key: `empty-${t}`
  }))));
}, K = function _GxIdeLaunchpadWebApps_renderRecentObjects() {
  var e, t, o, i, n, r, s, c, l, d, p;
  const h = ((e = this.objects.find((e => e.type === "recent"))) === null || e === void 0 ? void 0 : e.objects) || [];
  const u = h.filter((e => D(this, Q, "m", H).call(this, e)));
  if (h.length === 0) {
    return a("div", {
      class: "no-objects"
    }, a("p", {
      class: "body-regular-s"
    }, (t = D(this, q, "f")) === null || t === void 0 ? void 0 : t.noRecentObjects));
  }
  if (u.length === 0) {
    return a("div", {
      class: "no-objects"
    }, a("p", {
      class: "body-regular-s"
    }, (o = D(this, q, "f")) === null || o === void 0 ? void 0 : o.noObjectsMatchSearch));
  }
  const f = [ ...u ].sort(D(this, F, "f"));
  return a("div", {
    class: "recent-objects-grid-container"
  }, a("div", {
    class: "tabular-grid-scroll-container"
  }, a("ch-tabular-grid", {
    class: "tabular-grid elevation-2"
  }, a("ch-tabular-grid-columnset", {
    class: "tabular-grid-column-set"
  }, a("ch-tabular-grid-column", {
    class: "tabular-grid-column",
    columnId: te,
    columnName: ((n = (i = D(this, q, "f")) === null || i === void 0 ? void 0 : i.columns) === null || n === void 0 ? void 0 : n.name) || "Name",
    columnNameHidden: false,
    settingable: false,
    sortable: true,
    onColumnSortChanged: D(this, U, "f"),
    size: "25%",
    resizable: false
  }), a("ch-tabular-grid-column", {
    class: "tabular-grid-column",
    columnId: ae,
    columnName: ((s = (r = D(this, q, "f")) === null || r === void 0 ? void 0 : r.columns) === null || s === void 0 ? void 0 : s.module) || "Module",
    columnNameHidden: false,
    settingable: false,
    sortable: true,
    onColumnSortChanged: D(this, U, "f"),
    size: "20%",
    resizable: false
  }), a("ch-tabular-grid-column", {
    class: "tabular-grid-column",
    columnId: oe,
    columnName: ((l = (c = D(this, q, "f")) === null || c === void 0 ? void 0 : c.columns) === null || l === void 0 ? void 0 : l.type) || "Type",
    columnNameHidden: false,
    settingable: false,
    sortable: true,
    onColumnSortChanged: D(this, U, "f"),
    size: "20%",
    resizable: false
  }), a("ch-tabular-grid-column", {
    class: "tabular-grid-column",
    columnId: ie,
    columnName: ((p = (d = D(this, q, "f")) === null || d === void 0 ? void 0 : d.columns) === null || p === void 0 ? void 0 : p.description) || "Description",
    columnNameHidden: false,
    settingable: false,
    sortable: false,
    size: "35%",
    resizable: false
  })), a("ch-tabular-grid-rowset", {
    class: "tabular-grid-rowset"
  }, f.map(((e, t) => {
    var o;
    return a("ch-tabular-grid-row", {
      rowid: ((o = e.key) === null || o === void 0 ? void 0 : o.id) || t.toString(),
      class: "tabular-grid-row",
      onClick: () => D(this, Q, "m", Y).call(this, e)
    }, a("ch-tabular-grid-cell", {
      class: "tabular-grid-cell"
    }, a("div", {
      class: "cell-content"
    }, a("ch-image", {
      class: "object-icon icon-m",
      src: D(this, Q, "m", V).call(this, e)
    }), a("span", {
      class: "object-name"
    }, e.name || "Unnamed"))), a("ch-tabular-grid-cell", {
      class: "tabular-grid-cell"
    }, e.module || ""), a("ch-tabular-grid-cell", {
      class: "tabular-grid-cell"
    }, e.type), a("ch-tabular-grid-cell", {
      class: "tabular-grid-cell"
    }, e.description || ""));
  }))))));
};

ne.style = $;

export { f as gx_ide_launchpad_apis, G as gx_ide_launchpad_native_apps, ne as gx_ide_launchpad_web_apps };
//# sourceMappingURL=p-42860e7e.entry.js.map