import { h as Ma, a as Qt, b as Qs, i as wn, _ as An } from './server.mjs';
import { g } from './SvgIcon-BnUcaRsf.mjs';
import { d } from './breadcrumb-gjE702oE.mjs';
import { C } from './AddressCard-VAtTVDdz.mjs';
import { h, B, I } from './Cash-PXPgJeUJ.mjs';
import { ref, watch, mergeProps, withCtx, createVNode, unref, isRef, withModifiers, toDisplayString, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderList, ssrRenderAttr, ssrRenderTeleport, ssrRenderClass, ssrIncludeBooleanAttr, ssrLooseEqual } from 'vue/server-renderer';
import { A } from './visa-YBBZ6mho.mjs';
import { n } from './Backdrop-BEGlY-L5.mjs';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:fs';
import 'node:url';
import 'node:path';
import 'unhead';
import '@unhead/shared';
import 'vue-router';
import 'vue-rate';
import 'date-fns';
import '@hennge/vue3-pagination';
import 'axios';
import 'vue-social-sharing';
import './BaseSelectInput-CRA84xWg.mjs';
import '@headlessui/vue';
import './BaseTextInput-Cu_w8Ykz.mjs';
import './BasePhoneInput-Bn0nyYE9.mjs';
import './Success-B3ItDJKk.mjs';
import './Modal-CfKvzdGl.mjs';
import 'yup';
import './index-Dj5w-pp2.mjs';

const F = { __name: "PaymentMethods", __ssrInlineRender: true, props: { value: { type: String, required: true } }, emits: ["update:value"], setup(e2, { emit: t2 }) {
  const l2 = ref(e2.value);
  watch(l2, (e3) => {
    s2("update:value", e3);
  });
  const s2 = t2;
  return (e3, t3, s3, a2) => {
    const r2 = g;
    t3(`<div${ssrRenderAttrs(mergeProps({ class: "p-4 lg:p-8 bg-[#F9F9F9]" }, a2))}><h2 class="font-bold text-xl sm:text-2xl mb-8">${ssrInterpolate(e3.$t("TITLES.payment_method"))}</h2><div class="space-y-8"><div class="${ssrRenderClass(["online" === unref(l2) ? "border-[#707070]" : "border-[#E1E1E1]", "border p-5 bg-white cursor-pointer transition-all"])}"><label class="flex items-center w-full cursor-pointer"><div class="relative me-5"><input type="radio" name="payment" value="online"${ssrIncludeBooleanAttr(ssrLooseEqual(unref(l2), "online")) ? " checked" : ""} class="opacity-0 absolute h-6 w-6 cursor-pointer"><div class="${ssrRenderClass(["online" === unref(l2) ? "border-primary" : "border-[#E1E1E1]", "w-6 h-6 border-[1.5px] rounded-full"])}">`), "online" === unref(l2) ? t3('<div class="w-4 h-4 bg-primary rounded-full absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"></div>') : t3("<!---->"), t3(`</div></div><span class="flex-grow text-primary">${ssrInterpolate(e3.$t("TITLES.online_payment"))}</span><div class="flex items-center gap-5"><div class="lg:w-[112px] h-[56px] w-[80px] flex items-center justify-center bg-[#F5F5F5]"><img${ssrRenderAttr("src", h)} alt="mastercard"></div><div class="lg:w-[112px] h-[56px] w-[80px] flex items-center justify-center bg-[#F5F5F5]"><img${ssrRenderAttr("src", A)} alt="visa"></div></div></label></div><div class="${ssrRenderClass(["wallet" === unref(l2) ? "border-[#707070]" : "border-[#E1E1E1]", "border p-5 bg-white cursor-pointer transition-all"])}"><label class="flex items-center w-full cursor-pointer"><div class="relative me-5"><input type="radio" name="payment" value="wallet"${ssrIncludeBooleanAttr(ssrLooseEqual(unref(l2), "wallet")) ? " checked" : ""} class="opacity-0 absolute h-6 w-6 cursor-pointer"><div class="${ssrRenderClass(["wallet" === unref(l2) ? "border-primary" : "border-[#E1E1E1]", "w-6 h-6 border-[1.5px] rounded-full"])}">`), "wallet" === unref(l2) ? t3('<div class="w-4 h-4 bg-primary rounded-full absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"></div>') : t3("<!---->"), t3(`</div></div><span class="flex-grow text-primary">${ssrInterpolate(e3.$t("TITLES.wallet"))}</span><div class="lg:w-[112px] h-[56px] w-[80px] flex items-center justify-center bg-[#F5F5F5]">`), t3(ssrRenderComponent(r2, { name: "wallet" }, null, s3)), t3(`</div></label></div><div class="${ssrRenderClass(["cash" === unref(l2) ? "border-[#707070]" : "border-[#E1E1E1]", "border p-5 bg-white cursor-pointer transition-all"])}"><label class="flex items-center w-full cursor-pointer"><div class="relative me-5"><input type="radio" name="payment" value="cash"${ssrIncludeBooleanAttr(ssrLooseEqual(unref(l2), "cash")) ? " checked" : ""} class="opacity-0 absolute h-6 w-6 cursor-pointer"><div class="${ssrRenderClass(["cash" === unref(l2) ? "border-primary" : "border-[#E1E1E1]", "w-6 h-6 border-[1.5px] rounded-full"])}">`), "cash" === unref(l2) ? t3('<div class="w-4 h-4 bg-primary rounded-full absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"></div>') : t3("<!---->"), t3(`</div></div><span class="flex-grow text-primary">${ssrInterpolate(e3.$t("TITLES.cash_on_delivery"))}</span><div class="lg:w-[112px] h-[56px] w-[80px] flex items-center justify-center bg-[#F5F5F5]"><div><img${ssrRenderAttr("src", B)} alt="Cash" class="mx-auto"><p class="text-[#339966] font-semibold"> Cash </p></div></div></label></div></div></div>`);
  };
} }, U = F.setup;
F.setup = (e2, t2) => {
  const l2 = useSSRContext();
  return (l2.modules || (l2.modules = /* @__PURE__ */ new Set())).add("components/Shared/PaymentMethods.vue"), U ? U(e2, t2) : undefined;
};
const D = "data:image/png;base64, ", M = { __name: "index", __ssrInlineRender: true, setup(p2) {
  const T2 = Ma(), E2 = Qt().$axios, { t: I2 } = Qs(), U2 = ref([{ name: I2("NAV.home"), to: "/" }, { name: I2("TITLES.confirm_order"), to: "", disabled: true }, { name: I2("TITLES.payment"), to: "/order/payment", disabled: true }]), M2 = ref(false), { data: _2, status: q, refresh: J } = wn("addresses", () => E2("address").then((e2) => e2.data.data).catch((e2) => e2.response.data)), P = ref(null);
  watch(() => _2.value, (e2) => {
    var t2;
    (null == e2 ? undefined : e2.length) && (P.value = null == (t2 = null == e2 ? undefined : e2.find((e3) => e3.is_default)) ? undefined : t2.id);
  }, { deep: true, immediate: true });
  const { data: R, status: Y, refresh: Q } = wn("cart", () => (() => {
    var e2, t2, l2, s2;
    const a2 = new URLSearchParams();
    return (null == (e2 = T2.query) ? undefined : e2.selected) && ("string" == typeof (null == (t2 = T2.query) ? undefined : t2.selected) ? a2.append("product_cart_ids[0]", null == (l2 = T2.query) ? undefined : l2.selected) : null == (s2 = T2.query) || s2.selected.map((e3, t3) => {
      a2.append(`product_cart_ids[${t3}]`, e3);
    })), E2("cart", { params: a2 }).then((e3) => e3.data).catch((e3) => e3.response.data);
  })()), V = ref([]);
  watch(() => R.value, (e2) => {
    var t2, l2;
    (null == (l2 = null == (t2 = null == e2 ? undefined : e2.data) ? undefined : t2.items) ? undefined : l2.length) && (T2.query.selected ? V.value = e2.data.items.filter((e3) => T2.query.selected.includes(e3.product_cart_id.toString())) : V.value = e2.data.items);
  }, { deep: true, immediate: true });
  const G = ref(null), z = ref("online"), B$1 = ref(""), K = ref(null);
  return (e2, t2, l2, s2) => {
    var _a;
    var p3, u2, m2, T3, E3, q2, Y2;
    const Q2 = An, H = g, O = d, X = C, W = I, N = F, Z = n;
    t2(`<div${ssrRenderAttrs(mergeProps({ class: "my-16 container" }, s2))}><div data-aos="fade-right" class="flex mb-10 items-center gap-5 flex-wrap">`), t2(ssrRenderComponent(Q2, { to: e2.localePath("/cart"), class: "justify-center flex items-center border border-[#E1E1E1] size-12 rounded-full" }, { default: withCtx((e3, t3, l3, s3) => {
      if (!t3) return [createVNode(H, { name: "arrow-left", class: "[&_path]:fill-primary scale-[.60]" })];
      t3(ssrRenderComponent(H, { name: "arrow-left", class: "[&_path]:fill-primary scale-[.60]" }, null, l3, s3));
    }), _: 1 }, l2)), t2(ssrRenderComponent(O, { items: unref(U2) }, null, l2)), t2(`</div><div class="grid grid-cols-1 lg:grid-cols-12 gap-10"><div data-aos="fade-right" class="lg:col-span-8 space-y-10"><div class="p-4 lg:p-8 bg-[#F9F9F9] mb-6 space-y-6"><h3 class="font-bold text-xl sm:text-2xl mb-6">${ssrInterpolate(unref(I2)("TITLES.address"))}</h3><!--[-->`), ssrRenderList(unref(_2), (e3) => {
      t2(ssrRenderComponent(X, { key: e3.id, address: e3, checkout: "", onUpdated: unref(J), value: unref(P), "onUpdate:value": (e4) => isRef(P) ? P.value = e4 : null }, null, l2));
    }), t2(`<!--]--></div><div class="p-4 lg:p-8 bg-[#F9F9F9]"><h2 class="font-bold text-xl sm:text-2xl mb-8">${ssrInterpolate(unref(I2)("TITLES.order_details"))}</h2><div class="space-y-8"><!--[-->`), ssrRenderList(unref(V), (e3) => {
      t2(ssrRenderComponent(W, { key: e3.id, product: e3, "show-action": false }, null, l2));
    }), t2("<!--]--></div></div>"), t2(ssrRenderComponent(N, { value: unref(z), "onUpdate:value": (e3) => isRef(z) ? z.value = e3 : null }, null, l2)), t2(`</div><div data-aos="fade-left" class="lg:col-span-4"><div class="bg-[#F9F9F9] px-6 pt-6 mb-10 pb-10"><h3 class="font-bold text-xl sm:text-2xl mb-6">${ssrInterpolate(e2.$t("TITLES.order_summary"))}</h3><div class="border mb-6 border-[#E4E7ED0] p-4"><div class="flex font-semibold text-xl mb-4 items-center gap-4 justify-between"><h4>${ssrInterpolate(e2.$t("TITLES.sub_total"))}</h4>`), (null == (p3 = unref(G)) ? undefined : p3.sub_total) ? t2(`<div class="font-bold text-xl"><span class="line-through text-desc">${ssrInterpolate(unref(R).sub_total)}</span> ${ssrInterpolate(null == (u2 = unref(G)) ? undefined : u2.sub_total)} ${ssrInterpolate(e2.$t("TITLES.egp"))}</div>`) : t2(`<div class="font-bold text-xl">${ssrInterpolate(unref(R).sub_total)} ${ssrInterpolate(e2.$t("TITLES.egp"))}</div>`), t2(`</div><div class="flex font-semibold text-xl mb-4 items-center gap-4 justify-between"><h4>${ssrInterpolate(e2.$t("TITLES.vat_price"))}</h4>`), (null == (m2 = unref(G)) ? undefined : m2.vat_price) ? t2(`<div class="font-bold text-xl"><span class="line-through text-desc">${ssrInterpolate(unref(R).vat_price)}</span> ${ssrInterpolate(null == (T3 = unref(G)) ? undefined : T3.vat_price)} ${ssrInterpolate(e2.$t("TITLES.egp"))}</div>`) : t2(`<div class="font-bold text-xl">${ssrInterpolate(unref(R).vat_price)} ${ssrInterpolate(e2.$t("TITLES.egp"))}</div>`), t2(`</div><div class="flex font-medium text-lg mb-4 items-center gap-4 justify-between pb-4 border-b-[1.5px] border-dashed border-[#D7D7E0]"><h4 class="text-[#797979]">${ssrInterpolate(e2.$t("TITLES.shipping"))} :</h4><div class="text-xl">${ssrInterpolate((_a = unref(R).shipping) != null ? _a : 0)} ${ssrInterpolate(e2.$t("TITLES.egp"))}</div></div><div class="flex font-semibold text-xl mb-4 items-center gap-4 justify-between"><h4>${ssrInterpolate(e2.$t("TITLES.total_price"))}</h4>`), (null == (E3 = unref(G)) ? undefined : E3.total_price) ? t2(`<div class="font-bold text-xl"><span class="line-through text-desc">${ssrInterpolate(unref(R).total_price)}</span> ${ssrInterpolate(null == (q2 = unref(G)) ? undefined : q2.total_price)} ${ssrInterpolate(e2.$t("TITLES.egp"))}</div>`) : t2(`<div class="font-bold text-xl">${ssrInterpolate(unref(R).total_price)} ${ssrInterpolate(e2.$t("TITLES.egp"))}</div>`), t2(`</div></div><button class="base-btn w-full">${ssrInterpolate(unref(I2)("TITLES.confirm_order"))}</button></div><div class="bg-[#F9F9F9] p-6"><h3 class="font-bold text-xl sm:text-2xl mb-6">${ssrInterpolate(unref(I2)("TITLES.our_payment_methods"))}</h3><div class="flex items-center justify-center gap-6"><div class="w-[112px] h-[56px] flex items-center justify-center bg-white"><img${ssrRenderAttr("src", h)} alt="mastercard"></div><div class="w-[112px] h-[56px] flex items-center justify-center bg-white"><img${ssrRenderAttr("src", A)} alt="visa"></div><div class="w-[112px] h-[56px] flex items-center justify-center bg-white flex-col"><img${ssrRenderAttr("src", B)} alt="Cash" class="mx-auto"><p class="text-[#339966] font-semibold">Cash</p></div></div></div><form class="mt-10"><h3 class="font-bold text-xl sm:text-2xl mb-4">${ssrInterpolate(e2.$t("TITLES.promo_code"))}</h3><div class="border gap-4 border-[#E1E1E1] p-4 flex items-center flex-wrap"><div class="rounded-full flex-shrink-0 flex items-center justify-center bg-[#FDF7F1] size-12">`), t2(ssrRenderComponent(H, { name: "discount-shape" }, null, l2)), t2(`</div><input id="couponInput" type="text" class="border-none flex-1 outline-none text-lg placeholder:text-[#606060]"${ssrRenderAttr("placeholder", e2.$t("TITLES.enter_discount_code"))}${ssrRenderAttr("value", unref(B$1))}>`), (null == (Y2 = unref(G)) ? undefined : Y2.total_price) ? (t2('<button class="size-6 flex items-center justify-center rounded-full" type="button">'), t2(ssrRenderComponent(H, { name: "xmark" }, null, l2)), t2("</button>")) : t2(`<button class="bg-primary transition-all duration-300 hover:bg-opacity-80 ms-auto text-white flex-shrink-0 py-2 font-semibold px-6 rounded-full" type="submit">${ssrInterpolate(unref(I2)("TITLES.apply"))}</button>`), t2("</div></form></div></div>"), ssrRenderTeleport(t2, (t3) => {
      unref(M2) ? t3(ssrRenderComponent(Z, null, { default: withCtx((t4, l3, s3, a2) => {
        var i2, r2, o2, d2, n2, c2, p4, u3;
        if (!l3) return [createVNode("div", { onClick: withModifiers(() => {
        }, ["stop"]), class: "bg-white w-[760px] max-h-[95%] overflow-y-auto max-w-[90%] p-12", "data-aos": "zoom-in", "data-aos-duration": "800" }, [createVNode("div", { class: "relative" }, [createVNode("h4", { class: "text-3xl capitalize text-center mb-10 font-bold" }, toDisplayString(unref(I2)("TITLES.thanks_for_shopping")), 1)]), createVNode("div", { class: "pb-6 border-b-2 border-opacity-30 border-[#909EAC]" }, [createVNode("img", { src: D, alt: "big-check", class: "mx-auto mb-10" }), createVNode("p", { class: "text-[#707377] mx-auto text-center w-[394px] text-xl max-w-[100%]" }, toDisplayString(unref(I2)("TITLES.order_confirmation_sent")), 1)]), createVNode("div", { class: "space-y-6 capitalize mt-6 mb-6" }, [createVNode("div", { class: "flex font-semibold text-xl mb-4 items-center gap-4 justify-between" }, [createVNode("h4", null, toDisplayString(unref(I2)("TITLES.items_ordered")), 1), createVNode("div", { class: "font-bold text-xl" }, toDisplayString(null == (n2 = unref(K)) ? undefined : n2.count), 1)]), createVNode("div", { class: "flex font-semibold text-xl mb-4 items-center gap-4 justify-between" }, [createVNode("h4", null, toDisplayString(unref(I2)("TITLES.total")), 1), createVNode("div", { class: "font-bold text-xl" }, toDisplayString(null == (c2 = unref(K)) ? undefined : c2.total) + " " + toDisplayString(e2.$t("TITLES.egp")), 1)]), createVNode("div", { class: "flex font-semibold text-xl mb-4 items-center gap-4 justify-between" }, [createVNode("h4", null, toDisplayString(unref(I2)("TITLES.delivery_date")), 1), createVNode("div", { class: "font-bold text-xl" }, "05:30 - 05:30 PM")]), createVNode("div", { class: "text-center text-xl" }, toDisplayString(unref(I2)("TITLES.order")) + " #" + toDisplayString(null == (p4 = unref(K)) ? undefined : p4.order_no), 1)]), createVNode(Q2, { to: e2.localePath(`/order/tracking-order/${null == (u3 = unref(K)) ? undefined : u3.id}`), class: "block w-full" }, { default: withCtx(() => [createVNode("button", { class: "base-btn w-full capitalize mb-6 !h-14" }, toDisplayString(unref(I2)("TITLES.track_your_order")), 1)]), _: 1 }, 8, ["to"]), createVNode(Q2, { to: e2.localePath("/"), class: "block w-full" }, { default: withCtx(() => [createVNode("button", { class: "base-btn w-full !bg-white border !text-primary !border-primary capitalize !h-14" }, toDisplayString(unref(I2)("TITLES.continue_shopping")), 1)]), _: 1 }, 8, ["to"])], 8, ["onClick"])];
        l3(`<div class="bg-white w-[760px] max-h-[95%] overflow-y-auto max-w-[90%] p-12" data-aos="zoom-in" data-aos-duration="800"${a2}><div class="relative"${a2}><h4 class="text-3xl capitalize text-center mb-10 font-bold"${a2}>${ssrInterpolate(unref(I2)("TITLES.thanks_for_shopping"))}</h4></div><div class="pb-6 border-b-2 border-opacity-30 border-[#909EAC]"${a2}><img${ssrRenderAttr("src", D)} alt="big-check" class="mx-auto mb-10"${a2}><p class="text-[#707377] mx-auto text-center w-[394px] text-xl max-w-[100%]"${a2}>${ssrInterpolate(unref(I2)("TITLES.order_confirmation_sent"))}</p></div><div class="space-y-6 capitalize mt-6 mb-6"${a2}><div class="flex font-semibold text-xl mb-4 items-center gap-4 justify-between"${a2}><h4${a2}>${ssrInterpolate(unref(I2)("TITLES.items_ordered"))}</h4><div class="font-bold text-xl"${a2}>${ssrInterpolate(null == (i2 = unref(K)) ? undefined : i2.count)}</div></div><div class="flex font-semibold text-xl mb-4 items-center gap-4 justify-between"${a2}><h4${a2}>${ssrInterpolate(unref(I2)("TITLES.total"))}</h4><div class="font-bold text-xl"${a2}>${ssrInterpolate(null == (r2 = unref(K)) ? undefined : r2.total)} ${ssrInterpolate(e2.$t("TITLES.egp"))}</div></div><div class="flex font-semibold text-xl mb-4 items-center gap-4 justify-between"${a2}><h4${a2}>${ssrInterpolate(unref(I2)("TITLES.delivery_date"))}</h4><div class="font-bold text-xl"${a2}>05:30 - 05:30 PM</div></div><div class="text-center text-xl"${a2}>${ssrInterpolate(unref(I2)("TITLES.order"))} #${ssrInterpolate(null == (o2 = unref(K)) ? undefined : o2.order_no)}</div></div>`), l3(ssrRenderComponent(Q2, { to: e2.localePath(`/order/tracking-order/${null == (d2 = unref(K)) ? undefined : d2.id}`), class: "block w-full" }, { default: withCtx((e3, t5, l4, s4) => {
          if (!t5) return [createVNode("button", { class: "base-btn w-full capitalize mb-6 !h-14" }, toDisplayString(unref(I2)("TITLES.track_your_order")), 1)];
          t5(`<button class="base-btn w-full capitalize mb-6 !h-14"${s4}>${ssrInterpolate(unref(I2)("TITLES.track_your_order"))}</button>`);
        }), _: 1 }, s3, a2)), l3(ssrRenderComponent(Q2, { to: e2.localePath("/"), class: "block w-full" }, { default: withCtx((e3, t5, l4, s4) => {
          if (!t5) return [createVNode("button", { class: "base-btn w-full !bg-white border !text-primary !border-primary capitalize !h-14" }, toDisplayString(unref(I2)("TITLES.continue_shopping")), 1)];
          t5(`<button class="base-btn w-full !bg-white border !text-primary !border-primary capitalize !h-14"${s4}>${ssrInterpolate(unref(I2)("TITLES.continue_shopping"))}</button>`);
        }), _: 1 }, s3, a2)), l3("</div>");
      }), _: 1 }, l2)) : t3("<!---->");
    }, "body", false, l2), t2("</div>");
  };
} }, _ = M.setup;
M.setup = (e2, t2) => {
  const l2 = useSSRContext();
  return (l2.modules || (l2.modules = /* @__PURE__ */ new Set())).add("pages/order/payment/index.vue"), _ ? _(e2, t2) : undefined;
};

export { M as default };
//# sourceMappingURL=index-aJx2MebJ.mjs.map
