PageSourceSearch

https://portal.godesignguru.com/build/assets/ServiceCatalogEdit-C36nzn8w.js

js godesignguru.com collected 2026-10-04 05:49:42 UTC 10,450 bytes, 56 lines download raw bytes

1import { j as M, J as E, o as c, c as u, e as r, f as m, u as e, a as t, t as i, w as H, d as S, b as C, a0 as T, s as F, q as L, G as b, l as N, n as q, B as z, E as P, F as R } from "./app-yg_pP4S4.js";
2import { _ as W } from "./ApplicationLogo-D4QkytOJ.js";
3import { _ as G } from "./BaseButton-DP1PFEmO.js";
4import { _ as A } from "./TextareaEditable-Boq2HHAO.js";
5import { _ as J } from "./FormFooter-BR3rPhrH.js";
6import { _ as Q } from "./ModalConfirmation-BptK8hn4.js";
7import { _ as Y } from "./ServiceCatalogPricingVariationDropdown-Cjx_fW4s.js";
8import { _ as D } from "./ServiceImage-_IFbGTdH.js";
9import { f as V } from "./functions-DLrKIvnr.js";
10import { u as K } from "./modelWrapper-D0DowOi8.js";
11import { b as X, d as Z, aa as ee } from "./index-CDyB1Hog.js";
12import { a3 as te, av as se } from "./XMarkIcon-C7ztHuKP.js";
13import { d as re } from "./vuedraggable.umd-Cnlv58mN.js";
14import { r as B } from "./EyeSlashIcon-B1bK03kn.js";
15import { r as ae } from "./ArrowRightIcon-DA8ixEGq.js";
16import { _ as oe } from "./FullPageLayout-B7_0J1eo.js";
17import "./LoaderIcon-BfI_LFZK.js";
18import "./_plugin-vue_export-helper-DlAUqK2U.js";
19import "./ChevronDownIcon-DvXuQ_5B.js";
20import "./listbox-BVei8WBz.js";
21import "./form-BcDj1t5Y.js";
22import "./use-text-value-9Z6g_4jd.js";
23import "./UserAvatar-B3-R1wxh.js";
24import "./LiveChat-BEmWJs6j.js";
25import "./popover-DTQdCRwt.js";
26import "./consts-7Qk9bpse.js";
27import "./BaseInput-DrEncIoW.js";
28import "./index-BF2h0ubX.js";
29import "./CheckIcon-Bb6ppPFl.js";
30const ie = { class: "relative mx-auto mt-3 max-w-7xl overflow-hidden sm:rounded-md" }, le = { key: 0, class: "service-element flex items-center gap-3 bg-white py-3 pl-4 pr-2" }, ne = { class: "min-w-0 flex-1" }, de = { class: "line-clamp-2 text-sm font-semibold text-gray-900" }, ce = { class: "truncate text-sm text-gray-500" }, ue = ["aria-label", "onClick"], me = { class: "drag-handle flex h-11 w-11 shrink-0 cursor-move touch-none items-center justify-center text-gray-400" }, pe = { key: 1, class: "service-element grip-handle group flex cursor-grab flex-col overflow-hidden rounded-lg shadow" }, fe = { class: "relative flex-shrink-0" }, ve = { class: "absolute right-4 top-5 flex space-x-2 [@media(hover:hover)]:invisible [@media(hover:hover)]:group-hover:visible [@media(hover:none)]:space-x-5" }, he = ["aria-label", "onClick"], ge = { class: "drag-handle flex cursor-move justify-center bg-white p-1 hover:bg-gray-50 [@media(hover:none)]:relative [@media(hover:none)]:touch-none [@media(hover:none)]:after:absolute [@media(hover:none)]:after:-inset-2 [@media(hover:none)]:after:content-['']" }, _e = { class: "flex flex-1 flex-col justify-between bg-white p-6" }, xe = { class: "flex-1" }, ye = { class: "mb-2 mt-auto justify-end" }, be = { key: 0, class: "py-2 text-base font-semibold text-gray-900" }, we = { class: "font-medium text-gray-500" }, ke = { key: 1 }, $e = { class: "w-full" }, Ce = ["title"], Ve = { key: 0, class: "prose prose-base mt-3 whitespace-pre-line text-base leading-6 text-gray-500 lg:max-h-44 lg:overflow-y-auto" }, Se = { class: "text-sm font-normal leading-5 text-gray-500" }, je = { __name: "ServiceCatalogGridDraggable", props: { modelValue: { type: Array, default: () => [] }, services: { type: Object }, editable: { type: Boolean, default: () => false } }, emits: ["update:modelValue"], setup(x, { emit: _ }) {
31  const d = K(x, _, "modelValue"), { t: a } = M(), h = b(false), f = b(null), w = X(Z).smaller("lg"), l = ee("(min-width: 1024px) and (hover: hover)"), n = (o) => {
32    if (o.type === "one-off") return `${V(o.price, o.currency)} \xB7 ${a("One-off")}`;
33    const g = o.pricing_variations.find(({ id: k }) => k == o.selected_pricing_variation_id) ?? o.pricing_variations[0];
34    return g ? `${V(g.price, o.currency)} ${g.billing_period.description}` : "";
35  }, v = { animation: 200, group: "services", draggable: ".service-element", ghostClass: "opacity-50" }, j = (o) => {
36    h.value = true, f.value = o;
37  }, O = () => {
38    L.put(route("services.sale.update", { service: f.value.id }), { is_for_sale: false }, { preserveScroll: true, onSuccess: () => {
39      h.value = false, d.value = d.value.filter((o) => o.id !== f.value.id), f.value = null;
40    } });
41  }, U = () => {
42    h.value = false, f.value = null;
43  };
44  return (o, g) => {
45    const k = E("tooltip"), I = E("dompurify-html");
46    return c(), u("div", ie, [r(e(re), T({ modelValue: e(d), "onUpdate:modelValue": g[0] || (g[0] = (s) => F(d) ? d.value = s : null), class: "mx-auto grid max-w-lg gap-5 max-lg:gap-0 max-lg:divide-y max-lg:divide-gray-200 max-lg:overflow-hidden max-lg:rounded-lg max-lg:bg-white max-lg:shadow lg:max-w-none lg:grid-cols-3", "item-key": "id", handle: e(l) ? ".grip-handle" : ".drag-handle" }, v), { item: m(({ element: s }) => [e(w) ? (c(), u("div", le, [r(D, { class: "h-12 w-12 shrink-0 rounded-md object-cover", service: s }, null, 8, ["service"]), t("div", ne, [t("p", de, i(s.name), 1), t("p", ce, i(n(s)), 1)]), t("button", { type: "button", class: "flex h-11 w-11 shrink-0 items-center justify-center rounded-md text-gray-400 focus:outline-none focus:ring-2 focus:ring-primary-500", "aria-label": e(a)("Hide service"), onClick: ($) => j(s) }, [r(e(B), { class: "h-5 w-5" })], 8, ue), t("div", me, [r(e(te), { class: "h-5 w-5", "aria-hidden": "true" })])])) : (c(), u("div", pe, [t("div", fe, [r(D, { class: "!h-48 w-full !object-cover", service: s }, null, 8, ["service"]), t("div", ve, [H((c(), u("button", { type: "button", class: "cursor-pointer rounded-full border border-gray-300 bg-white p-1 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 [@media(hover:none)]:relative [@media(hover:none)]:after:absolute [@media(hover:none)]:after:-inset-2.5 [@media(hover:none)]:after:content-['']", "aria-label": e(a)("Hide service"), onClick: ($) => j(s) }, [r(e(B), { class: "h-4 w-4 text-gray-500" })], 8, he)), [[k, e(a)("Hide service"), void 0, { "top-end": true }]]), t("div", ge, [r(e(se), { class: "h-5 w-5 text-gray-400", "aria-hidden": "true" })])])]), t("div", _e, [t("div", xe, [t("div", ye, [s.type === "one-off" ? (c(), u("div", be, [S(i(e(V)(s.price, s.currency)) + " ", 1), t("span", we, i(e(a)("One-off")), 1)])) : C("", true), s.type === "recurring" ? (c(), u("div", ke, [r(Y, { modelValue: s.selected_pricing_variation_id, "onUpdate:modelValue": ($) => s.selected_pricing_variation_id = $, service: s, "pricing-variations": s.pricing_variations, disabled: true }, null, 8, ["modelValue", "onUpdate:modelValue", "service", "pricing-variations"])])) : C("", true)]), t("div", $e, [t("h3", { class: "text-lg font-semibold leading-7 text-gray-900", title: s.name }, i(s.name), 9, Ce), s.description ? H((c(), u("p", Ve, null, 512)), [[I, s.description]]) : C("", true)])]), r(G, { class: "mt-7 flex items-center justify-center space-x-2" }
46, { default: m(() => [t("span", null, i(e(a)("Purchase")), 1), r(e(ae), { class: "h-4 w-4" })]), _: 1 })])]))]), _: 1 }, 16, ["modelValue", "handle"]), r(Q, { open: h.value, color: "red", "confirm-text": e(a)("Hide service"), onConfirmed: O, onClosed: U }, { title: m(() => [S(i(e(a)("Hide service")), 1)]), content: m(() => [t("p", Se, i(e(a)("Are you sure you want to hide this service? You can revert this change later in the Services menu.")), 1)]), _: 1 }, 8, ["open", "confirm-text"])]);
47  };
48} }, Ee = { class: "relative flex flex-col content-center" }, He = { class: "flex justify-center" }, Ae = { class: "flex justify-center" }, De = { class: "flex justify-center" }, Be = { class: "mb-[3.25rem] mt-10 text-center max-lg:mb-4" }, Me = { class: "text-lg font-semibold text-gray-900" }, Ge = { class: "text-sm font-normal text-gray-500" }, mt = { __name: "ServiceCatalogEdit", props: { services: { type: Array, required: true }, settings: { type: Object, required: true } }, setup(x) {
49  const _ = x, { t: p } = M(), y = b(false), d = b(false), a = N({ header: _.settings.CATALOG_HEADER, subheader: _.settings.CATALOG_SUBHEADER, services: _.services }), h = (l) => a.header = l, f = (l) => a.subheader = l, w = () => {
50    a.transform((l) => ({ ...l, services: l.services.map((n) => n.id) })).put(route("services.catalog.update"), { preserveScroll: true });
51  };
52  return (l, n) => (c(), u(R, null, [r(e(q), { title: e(p)("Edit catalog") }, null, 8, ["title"]), r(oe, { class: "bg-gray-100 pt-10", "show-navbar": false }
52, { default: m(() => [t("form", { class: "mx-auto max-w-7xl px-4 max-lg:flex max-lg:min-h-[calc(100dvh-2.5rem)] max-lg:flex-col sm:px-6 md:px-8", onSubmit: z(w, ["prevent"]) }, [t("div", Ee, [t("div", He, [r(W, { class: "!h-8 !w-auto", "is-dark-theme": false })]), t("div", Ae, [r(A, { "in-edit-mode": y.value, "onUpdate:inEditMode": n[0] || (n[0] = (v) => y.value = v), value: e(a).header, "can-edit": true, class: "mt-8", "input-classes": ["!p-0 text-3xl w-full resize-none text-ellipsis font-bold text-gray-900 max-h-26 py-1 px-2 text-center", y.value ? "cursor-text bg-gray-100 block" : "line-clamp-3"], placeholder: e(p)("Header here"), onChange: h }, null, 8, ["in-edit-mode", "value", "input-classes", "placeholder"])]), t("div", De, [r(A, { "in-edit-mode": d.value, "onUpdate:inEditMode": n[1] || (n[1] = (v) => d.value = v), value: e(a).subheader, "can-edit": true, class: "mt-4", "input-classes": ["!p-0 text-base w-full resize-none text-ellipsis font-normal text-gray-500 max-h-26 py-1 px-2 text-center", d.value ? "cursor-text bg-gray-100 block" : "line-clamp-3"], placeholder: e(p)("Subheader here"), onChange: f }, null, 8, ["in-edit-mode", "value", "input-classes", "placeholder"])])]), t("div", Be, [t("p", Me, i(e(p)("Sort the service catalog")), 1), t("p", Ge, i(e(p)("Drag and drop to order your services")), 1)]), r(je, { modelValue: e(a).services, "onUpdate:modelValue": n[2] || (n[2] = (v) => e(a).services = v), class: "max-lg:mb-8", services: x.services, editable: true }, null, 8, ["modelValue", "services"]), r(J, { class: "mt-8 border-t-2 border-gray-300 bg-gray-100 max-lg:mt-auto [@media(hover:none)]:[&_a]:inline-flex [@media(hover:none)]:[&_button]:min-h-11", "is-dirty": e(a).isDirty, processing: e(a).processing }, { left: m(() => [r(e(P), { href: l.route("services.catalog.index") }
52, { default: m(() => [r(G, { secondary: "" }, { default: m(() => [S(i(e(p)("Cancel and go back")), 1)]), _: 1 })]), _: 1 }, 8, ["href"])]), _: 1 }, 8, ["is-dirty", "processing"])], 32)]), _: 1 })], 64));
53} };
54export {
55  mt as default
56};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.