import { defineComponent as y, resolveComponent as p, createBlock as f, openBlock as i, Teleport as E, createVNode as _, Transition as g, withCtx as h, createCommentVNode as L, withKeys as w, normalizeStyle as F, normalizeClass as d, createElementVNode as m, renderSlot as x, createElementBlock as T, toDisplayString as R, Fragment as A, renderList as v, computed as C, unref as I } from "vue";
import { _ as k } from "./_plugin-vue_export-helper-CHgC5LLL.js";
import { useI18n as U } from "@feedmepos/mf-common";
const N = {
  class: /* @__PURE__ */ d([
    "flex items-center",
    "px-24 pt-16 pb-8",
    "border-b border-fm-color-neutral-gray-100",
    "space-x-4"
  ])
}, $ = { class: "fm-typo-en-title-sm-600 mr-auto" }, z = {
  class: /* @__PURE__ */ d(["flex flex-col", "flex-1 overflow-scroll", "w-full", "px-24"])
}, V = /* @__PURE__ */ y({
  __name: "FullScreenForm",
  props: {
    show: { type: Boolean },
    title: {},
    primaryAction: {},
    secondaryActions: {},
    zIndex: { default: 50 }
  },
  emits: ["onPrimary", "onCancel"],
  setup(t, { emit: e }) {
    const n = e, l = () => {
      n("onPrimary");
    }, c = () => {
      n("onCancel");
    };
    return (r, o) => {
      const a = p("fm-button"), s = p("fm-form");
      return i(), f(E, { to: "body" }, [
        _(g, { name: "fade" }, {
          default: h(() => [
            r.show ? (i(), f(s, {
              key: 0,
              "blame-form-child-on-validation-failed": "",
              class: d(["fixed inset-0", "flex flex-col", "w-screen h-dvh", "bg-fm-color-neutral-white"]),
              style: F({ zIndex: r.zIndex }),
              tabindex: "-1",
              onValidationSuccess: l,
              onKeyup: w(c, ["esc"])
            }, {
              default: h(() => [
                m("div", N, [
                  m("p", $, R(r.title), 1),
                  x(r.$slots, "append-title", {}, void 0, !0),
                  (i(!0), T(A, null, v(r.secondaryActions, (u) => (i(), f(a, {
                    label: u.label,
                    variant: "tertiary",
                    onClick: u.click
                  }, null, 8, ["label", "onClick"]))), 256)),
                  _(a, {
                    label: r.primaryAction.label,
                    type: "submit",
                    variant: "primary"
                  }, null, 8, ["label"])
                ]),
                m("div", z, [
                  x(r.$slots, "default", {}, void 0, !0)
                ])
              ]),
              _: 3
            }, 8, ["style"])) : L("", !0)
          ]),
          _: 3
        })
      ]);
    };
  }
}), Q = /* @__PURE__ */ k(V, [["__scopeId", "data-v-5b5c7179"]]), Y = /* @__PURE__ */ y({
  __name: "PriceTierNotice",
  props: {
    menuStore: {}
  },
  setup(t) {
    const e = t, n = C(() => {
      var r, o;
      return ((r = e.menuStore.currentCatalog) == null ? void 0 : r.priceTierRules) ?? ((o = e.menuStore.currentCatalog) == null ? void 0 : o.usePriceTiers) ?? [];
    }), l = C(() => {
      var r;
      return e.menuStore.isV4 && e.menuStore.currentCatalog && !e.menuStore.currentScheduler && ((r = n.value) == null ? void 0 : r.length) > 0;
    }), { t: c } = U();
    return (r, o) => {
      var s;
      const a = p("FmSnackbar");
      return l.value ? (i(), f(a, {
        key: 0,
        "z-index": 0,
        class: "!max-w-full",
        title: I(c)("menu.price_tier.price_group_description", { group: (s = n.value) == null ? void 0 : s.join(", ") })
      }, null, 8, ["title"])) : L("", !0);
    };
  }
}), B = new RegExp("([\\p{Ll}\\d])(\\p{Lu})", "gu"), D = new RegExp("(\\p{Lu})([\\p{Lu}][\\p{Ll}])", "gu"), X = new RegExp("(\\d)\\p{Ll}|(\\p{L})\\d", "u"), j = /[^\p{L}\d]+/giu, S = "$1\0$2", b = "";
function P(t) {
  let e = t.trim();
  e = e.replace(B, S).replace(D, S), e = e.replace(j, "\0");
  let n = 0, l = e.length;
  for (; e.charAt(n) === "\0"; )
    n++;
  if (n === l)
    return [];
  for (; e.charAt(l - 1) === "\0"; )
    l--;
  return e.slice(n, l).split(/\0/g);
}
function K(t) {
  const e = P(t);
  for (let n = 0; n < e.length; n++) {
    const l = e[n], c = X.exec(l);
    if (c) {
      const r = c.index + (c[1] ?? c[2]).length;
      e.splice(n, 1, l.slice(0, r), l.slice(r));
    }
  }
  return e;
}
function Z(t, e) {
  const [n, l, c] = O(t, e), r = G(e == null ? void 0 : e.locale), o = H(e == null ? void 0 : e.locale), a = M(r, o);
  return n + l.map((s, u) => u === 0 ? a(s) : r(s)).join((e == null ? void 0 : e.delimiter) ?? " ") + c;
}
function G(t) {
  return t === !1 ? (e) => e.toLowerCase() : (e) => e.toLocaleLowerCase(t);
}
function H(t) {
  return t === !1 ? (e) => e.toUpperCase() : (e) => e.toLocaleUpperCase(t);
}
function M(t, e) {
  return (n) => `${e(n[0])}${t(n.slice(1))}`;
}
function O(t, e = {}) {
  const n = e.split ?? (e.separateNumbers ? K : P), l = e.prefixCharacters ?? b, c = e.suffixCharacters ?? b;
  let r = 0, o = t.length;
  for (; r < t.length; ) {
    const a = t.charAt(r);
    if (!l.includes(a))
      break;
    r++;
  }
  for (; o > r; ) {
    const a = o - 1, s = t.charAt(a);
    if (!c.includes(s))
      break;
    o = a;
  }
  return [
    t.slice(0, r),
    n(t.slice(r, o)),
    t.slice(o)
  ];
}
export {
  Q as F,
  Y as _,
  Z as s
};
