1import { o as p, c as f, a as e, t as i, F as S, r as G, u as r, b as B, d as h, w as M, v as P, e as y, f as O, g as v, h as R, i as E, m as j, j as U, p as I, k as T, l as z, n as D, q as A, s as K, x as L, y as b } from "./app-yg_pP4S4.js"; 2import { S as W } from "./powered_by_stripe-CbOTyS_c.js"; 3import { _ as H } from "./BaseButton-DP1PFEmO.js"; 4import { f as k, i as C, p as J, d as Q } from "./functions-DLrKIvnr.js"; 5import { u as X } from "./modelWrapper-D0DowOi8.js"; 6import { r as Y, _ as Z } from "./OrderAdminAlert-DKnol03F.js"; 7import { _ as ee, a as te } from "./PaymentMethodField-Bm4377cD.js"; 8import { _ as se } from "./BaseStepper-LO3b-WNc.js"; 9import { _ as ae } from "./FullPageLayout-B7_0J1eo.js"; 10import { s as w, g as oe } from "./getStripe-BXcvn0by.js"; 11import "./AlertCard-SUuzXx3b.js"; 12import "./UserAvatar-B3-R1wxh.js"; 13import "./index-CDyB1Hog.js"; 14import "./XMarkIcon-C7ztHuKP.js"; 15import "./BaseInput-DrEncIoW.js"; 16import "./BaseListbox-BuI0rG6W.js"; 17import "./LoaderIcon-BfI_LFZK.js"; 18import "./_plugin-vue_export-helper-DlAUqK2U.js"; 19import "./listbox-BVei8WBz.js"; 20import "./form-BcDj1t5Y.js"; 21import "./use-text-value-9Z6g_4jd.js"; 22import "./ChevronDownIcon-DvXuQ_5B.js"; 23import "./CheckIcon-Bb6ppPFl.js"; 24import "./BasePhoneInput-CDgWagnI.js"; 25import "./Checkbox-CmVxljr7.js"; 26import "./InputError-c3Vl2Z79.js"; 27import "./radio-group-C7m5BNR4.js"; 28import "./use-tree-walker-DC0osvAV.js"; 29import "./consts-7Qk9bpse.js"; 30import "./FormFooter-BR3rPhrH.js"; 31import "./LiveChat-BEmWJs6j.js"; 32import "./ApplicationLogo-D4QkytOJ.js"; 33import "./popover-DTQdCRwt.js"; 34import "./ModalConfirmation-BptK8hn4.js"; 35import "./index-BF2h0ubX.js"; 36const re = { class: "sticky top-16 rounded-md bg-gray-50 px-4 py-6 max-md:static max-md:p-0" }, ie = { class: "mb-2 text-lg font-bold text-gray-900" }, ne = { class: "truncate pr-10" }, le = { class: "flex space-x-1" }, de = { class: "truncate text-sm font-medium text-gray-900" }, ce = { class: "shrink-0 text-sm font-medium text-gray-900" }, ue = { class: "shrink-0 text-sm text-gray-900" }, me = { class: "space-y-4 py-4 text-gray-500" }, pe = { class: "flex items-center justify-between" }, ye = { class: "text-base font-medium" }, fe = { class: "text-sm" }, _e = { key: 0, class: "flex items-center justify-between" }, xe = { class: "text-base font-medium" }, ve = { class: "text-sm" }, ge = { class: "flex items-center justify-between border-t pt-6" }, he = { class: "text-base font-medium text-gray-900" }, be = { key: 0, class: "text-sm font-normal text-gray-600" }, ke = { class: "text-base font-medium text-gray-900" }, we = { class: "mb-6 mt-4 flex space-x-2 [@media(hover:none)]:py-1" }, $e = { class: "flex h-5 items-center" }, qe = { for: "terms", class: "select-none text-sm text-gray-500 [@media(hover:none)]:-my-3 [@media(hover:none)]:py-3" }, Ve = { href: "#", target: "_blank", class: "text-blue-500" }, Ae = { class: "mt-6 max-md:hidden" }, Se = { class: "flex flex-col items-center" }, Be = { class: "w-full border-b pb-4 pt-12 max-md:pt-6" }, Ce = { class: "flex items-center justify-center space-x-2" }, Fe = { class: "font-semibold text-gray-900" }, je = ["src"], Oe = { __name: "AddOnCheckoutSummary", props: { modelValue: { type: Object, required: true }, addOns: { type: Array, required: true }, currency: { type: String, required: true } }, emits: ["update:modelValue", "finish"], setup(o, { emit: n }) { 37 const d = o, c = n, t = X(d, c, "modelValue"), u = () => { 38 t.value.accepted_tos && !t.value.processing && !C.value && c("finish"); 39 }, m = d.addOns.reduce((s, a) => s + parseFloat(a.price * a.pivot.quantity), 0), g = v(() => _.chain(m).multiply(t.value.taxes).divide(100).value()), $ = v(() => _.chain(m).add(g.value).value()), q = v(() => t.value.taxes > 0); 40 return (s, a) => (p(), f(S, null, [e("div", re, [e("h4", ie, i(s.$t("Order summary")), 1)]), (p(true), f(S, null, G(o.addOns, (l, x) => (p(), f("div", { key: `add-on-${x}`, class: "flex justify-between border-b py-4" }, [e("div", ne, [e("div", le, [e("span", de, i(l.label), 1), e("span", ce, i(l.pivot.quantity > 1 ? `x${l.pivot.quantity}` : ""), 1)])]), e("span", ue, i(r(k)(l.price * l.pivot.quantity, o.currency, false)), 1)]))), 128)), e("dl", null, [e("div", me, [e("div", pe, [e("dt", ye, i(s.$t("Subtotal")), 1), e("dd", fe, i(r(k)(r(m), o.currency, false)), 1)]), q.value ? (p(), f("div", _e, [e("dt", xe, i(s.$t("Taxes ({percentage}%)", { percentage: r(t).taxes })), 1), e("dd", ve, i(r(k)(g.value, o.currency, false)), 1)])) : B("", true)]), e("div", ge, [e("dt", he, [h(i(s.$t("Grand total")) + " ", 1), o.currency ? (p(), f("span", be, " (" + i(o.currency) + ") ", 1)) : B("", true)]), e("dd", ke, i(r(k)($.value, o.currency, false)), 1)]), e("div", we, [e("div", $e, [M(e("input", { id: "terms", "onUpdate:modelValue": a[0] || (a[0] = (l) => r(t).accepted_tos = l), name: "terms", type: "checkbox", class: "h-4 w-4 roun
40ded border-gray-300 text-primary-600 focus:outline-none focus:ring-0 focus:ring-offset-0" }, null, 512), [[P, r(t).accepted_tos]])]), e("label", qe, [h(i(s.$t("By submitting this form you agree to our")) + " ", 1), e("a", Ve, i(s.$t("terms of service")), 1), a[1] || (a[1] = h(". ", -1))])]), e("div", Ae, [y(H, { class: "w-full [@media(hover:none)]:min-h-11", disabled: !r(t).accepted_tos, onClick: u }, { default: O(() => [h(i(s.$t("Complete order")), 1)]), _: 1 }, 8, ["disabled"])]), e("div", Se, [e("div", Be, [e("div", Ce, [y(r(Y), { class: "h-5 w-5 text-gray-900" }), e("span", Fe, i(s.$t("Secure checkout")), 1)])]), e("img", { src: r(W), alt: "Powered By Stripe", class: "w-36 max-lg:mt-4" }, null, 8, je)])])], 64)); 41} }, Ne = { class: "mb-12 px-4 max-lg:mb-0 max-lg:[&_button[aria-haspopup=listbox]]:min-h-11 max-lg:[&_input]:text-base max-lg:[&_textarea]:text-base" }, Ge = { class: "mb-6 text-3xl font-bold text-gray-900 max-sm:text-2xl" }, Me = { class: "grid grid-cols-12 gap-x-12 max-md:block" }, Pe = { class: "col-span-7 space-y-8" }, Re = { class: "col-span-5 max-md:mt-8 max-md:rounded-md max-md:bg-gray-50 max-md:p-4" }, Ee = { __name: "AddOnCheckoutBillingDetails", props: j({ paymentGateways: { type: Array, required: true }, addOns: { type: Array, required: true }, askFullAddress: { type: Boolean, required: true } }, { modelValue: { type: [Object, String, Number] }, modelModifiers: {} }), emits: j(["finish"], ["update:modelValue"]), setup(o, { emit: n }) { 42 const d = n, c = R(o, "modelValue"); 43 return (t, u) => (p(), f("div", Ne, [e("h3", Ge, i(t.$t("Checkout")), 1), r(C) ? (p(), E(Z, { key: 0, class: "mb-6" })) : B("", true), e("div", Me, [e("div", Pe, [y(ee, { modelValue: c.value, "onUpdate:modelValue": u[0] || (u[0] = (m) => c.value = m), "ask-full-address": o.askFullAddress }, null, 8, ["modelValue", "ask-full-address"]), y(te, { modelValue: c.value, "onUpdate:modelValue": u[1] || (u[1] = (m) => c.value = m), "payment-gateways": o.paymentGateways }, null, 8, ["modelValue", "payment-gateways"])]), e("div", Re, [y(Oe, { modelValue: c.value, "onUpdate:modelValue": u[2] || (u[2] = (m) => c.value = m), "add-ons": o.addOns, currency: o.addOns[0].add_on.currency, onFinish: u[3] || (u[3] = (m) => d("finish")) }, null, 8, ["modelValue", "add-ons", "currency"])])])])); 44} }, Ue = { class: "pt-12 max-lg:pt-0" }, wt = { __name: "AddOnCheckout", props: { draftRequest: { type: Object, required: true }, taxes: { type: [String, Number], default: "0" }, paymentGateways: { type: Array, required: true }, countries: { type: Array, required: true }, rewardfulApiKey: { type: String, required: false }, tapfiliateAccountId: { type: String, required: false }, askFullAddress: { type: Boolean, required: false } }, setup(o) { 45 const n = o, d = v(() => L().props.auth.user), { t: c } = U(); 46 I("countries", n.countries), T(() => { 47 const s = n.draftRequest.add_on_options, a = s.reduce((N, F) => N + parseFloat(F.price * F.pivot.quantity), 0), l = _.chain(a).multiply(n.taxes).divide(100).value(), x = s[0].add_on.currency, V = _.chain(a).add(l).value(); 48 w.value.options = { mode: "payment", amount: J(V, x), currency: x.toLowerCase() }; 49 }); 50 const t = z({ taxes: n.taxes, accepted_tos: false, billing: { invoice_to: d.value.invoice_to, country: d.value.country, processing: false, for_company: !!(d.value && d.value.tax_code), street_address: d.value.street_address, city: d.value.city, province: d.value.province, zip_code: d.value.zip_code, tax_code: d.value.tax_code }, payment_type: Q(n.paymentGateways), payment_method_id: null, payment_reference: null }), u = v(() => _.find(n.countries, { name: t.billing.country })), m = [{ name: c("Billing details"), component: Ee, props: { addOns: n.draftRequest.add_on_options, paymentGateways: n.paymentGateways, askFullAddress: n.askFullAddress }, disableNext: () => !t.accepted_tos || C.value }], g = async () => { 51 const s = oe(), { error: a } = await s.confirmPayment({ elements: w.value.elements, clientSecret: t.client_secret, confirmParams: { return_url: route("checkout.complete"), payment_method_data: { billing_details: { address: { country: u.value.iso_3166_1_alpha2, postal_code: t.billing.zip_code } } } }, redirect: "if_required", setup_future_usage: "off_session" }); 52 if (a) { 53 w.value.cardError = a.message, t.processing = false;
54 return; 55 } 56 A.visit(route("checkout.invoice.confirmation", t.invoice_id)); 57 }, $ = async () => { 58 try { 59 const s = await axios.post(route("add-ons.checkout.stripe", n.draftRequest.slug), b.omitBy({ billing: t.billing }, b.isNil)); 60 if (t.client_secret = s.data.client_secret, t.invoice_id = s.data.invoice_id, s.data.status === "succeeded") return A.visit(route("checkout.invoice.confirmation", t.invoice_id)); 61 } catch ({ response: s }) { 62 t.processing = false; 63 const a = _.reduce(s.data.errors, (l, x, V) => (l[V] = x[0], l), {}); 64 t.errors = a; 65 } 66 }, q = async () => { 67 if (t.processing = true, t.payment_type == "stripe") { 68 const { error: s } = await w.value.elements.submit(); 69 if (s) { 70 t.processing = false; 71 return; 72 } 73 return await $(), await g(); 74 } else t.transform((s) => b.omitBy({ payment_reference: s.payment_reference, billing: s.billing }, b.isNil)).post(route("add-ons.checkout.manual", n.draftRequest.slug)); 75 }; 76 return (s, a) => (p(), f(S, null, [y(r(D), { title: r(c)("Checkout") }, null, 8, ["title"]), y(ae, { "rewardful-api-key": o.rewardfulApiKey, "tapfiliate-account-id": o.tapfiliateAccountId }, { default: O(() => [e("div", Ue, [y(se, { modelValue: r(t), "onUpdate:modelValue": a[0] || (a[0] = (l) => K(t) ? t.value = l : null), "content-classes": "max-lg:py-6", steps: m, "finish-text": r(c)("Complete order"), "validate-go-back": false, loading: r(t).processing, onFinish: q, onExit: a[1] || (a[1] = (l) => r(A).get(s.route("requests.index"))) }, null, 8, ["modelValue", "finish-text", "loading"])])]), _: 1 }, 8, ["rewardful-api-key", "tapfiliate-account-id"])], 64)); 77} }; 78export { 79 wt as default 80};
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.