import { g } from './SvgIcon-YE_5uJaI.mjs';
import { u } from './Skeleton-DfjdyTna.mjs';
import { mergeProps, reactive, ref, unref, withCtx, createVNode, withModifiers, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderList, ssrRenderComponent, ssrInterpolate, ssrRenderTeleport, ssrIncludeBooleanAttr } from 'vue/server-renderer';
import { f as cf, u as Qt, a as Ts } from './server.mjs';
import { $ } from './ProductCard-BoLfosCH.mjs';
import { a } from './NoData-IIg4-CUc.mjs';
import { n } from './Backdrop-CxzzDpnH.mjs';
import { q } from './BaseTextInput-sD2PisNb.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 './star-mqjJGHgV.mjs';

const y = {};
const S = y.setup;
y.setup = (e2, t2) => {
  const a2 = useSSRContext();
  return (a2.modules || (a2.modules = /* @__PURE__ */ new Set())).add("components/Shared/WishlistSkelton.vue"), S ? S(e2, t2) : undefined;
};
const _ = cf(y, [["ssrRender", function(e2, s2, i2, l2) {
  const o2 = u;
  s2(`<div${ssrRenderAttrs(mergeProps({ class: "grid grid-cols-2 md:grid-cols-2 xl:grid-cols-3 gap-4" }, l2))}><!--[-->`), ssrRenderList(6, (e3) => {
    s2('<div class="space-y-4">'), s2(ssrRenderComponent(o2, { class: "h-[280px] bg-white sm:h-[320px] w-[100%]" }, null, i2)), s2(ssrRenderComponent(o2, { class: "h-[14px] w-[70%] bg-white" }, null, i2)), s2(ssrRenderComponent(o2, { class: "h-[14px] w-[40%] bg-white" }, null, i2)), s2(ssrRenderComponent(o2, { class: "h-[14px] w-[50%] bg-white" }, null, i2)), s2("</div>");
  }), s2("<!--]--></div>");
}]]), j = { __name: "wishlist", __ssrInlineRender: true, setup(t2) {
  const s2 = reactive({ wishlistName: "" }), v2 = ref(false), y2 = Qt().$axios, { data: S2, status: j2, refresh: k2 } = Ts("faves", () => y2("get_fave_products").then((e2) => e2.data.data).catch((e2) => e2.response.data));
  return (t3, i2, l2, w2) => {
    const b2 = g, y3 = _, C = $, E = a, z = n, I = q;
    i2(`<div${ssrRenderAttrs(mergeProps({ class: "bg-[#F6F7FC] p-3 md:p-6 h-fit" }, w2))}><h3 class="font-bold text-xl lg:mb-10 mb-6">${ssrInterpolate(t3.$t("TITLES.wishlist"))}</h3>`), i2("<!---->"), "pending" === unref(j2) ? (i2("<div>"), i2(ssrRenderComponent(y3, null, null, l2)), i2("</div>")) : "success" === unref(j2) ? (i2("<!--[-->"), unref(S2) && unref(S2).length ? (i2('<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-2 xl:grid-cols-3 gap-2"><!--[-->'), ssrRenderList(unref(S2), (e2) => {
      i2(ssrRenderComponent(C, { key: e2.id, product: e2, onRemoveWishlist: (e3) => unref(k2)() }, null, l2));
    }), i2("<!--]--></div>")) : i2(ssrRenderComponent(E, { class: "!min-h-[320px]" }, null, l2)), i2("<!--]-->")) : i2("<!---->"), ssrRenderTeleport(i2, (e2) => {
      unref(v2) ? e2(ssrRenderComponent(z, { onClose: (e3) => v2.value = false }, { default: withCtx((e3, a2, i3, l3) => {
        if (!a2) return [createVNode("div", { onClick: withModifiers(() => {
        }, ["stop"]), class: "bg-white w-[540px] max-h-[95%] overflow-y-auto max-w-[90%] py-6 lg:py-10 px-4 lg:px-8", "data-aos": "zoom-in", "data-aos-duration": "800" }, [createVNode("div", { class: "relative" }, [createVNode("h4", { class: "text-3xl capitalize text-center mb-10 font-bold" }, " Create a wishlist "), createVNode("button", { class: "absolute size-12 top-1/2 border border-[#E1E1E1] flex items-center justify-center rounded-full -translate-y-1/2 end-0", onClick: (e4) => v2.value = false }, [createVNode(b2, { name: "close-2" })], 8, ["onClick"])]), createVNode(I, { name: "wishlistName", label: t3.$t("LABELS.wishlistName"), placeholder: t3.$t("INPUTS.wishlistName"), value: unref(s2).wishlistName, "onUpdate:value": (e4) => unref(s2).wishlistName = e4 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"]), createVNode("button", { disabled: !unref(s2).wishlistName, class: "base-btn mt-10 w-full capitalize !h-14" }, " Save Wishlist ", 8, ["disabled"])], 8, ["onClick"])];
        a2(`<div class="bg-white w-[540px] max-h-[95%] overflow-y-auto max-w-[90%] py-6 lg:py-10 px-4 lg:px-8" data-aos="zoom-in" data-aos-duration="800"${l3}><div class="relative"${l3}><h4 class="text-3xl capitalize text-center mb-10 font-bold"${l3}> Create a wishlist </h4><button class="absolute size-12 top-1/2 border border-[#E1E1E1] flex items-center justify-center rounded-full -translate-y-1/2 end-0"${l3}>`), a2(ssrRenderComponent(b2, { name: "close-2" }, null, i3, l3)), a2("</button></div>"), a2(ssrRenderComponent(I, { name: "wishlistName", label: t3.$t("LABELS.wishlistName"), placeholder: t3.$t("INPUTS.wishlistName"), value: unref(s2).wishlistName, "onUpdate:value": (e4) => unref(s2).wishlistName = e4 }, null, i3, l3)), a2(`<button${ssrIncludeBooleanAttr(!unref(s2).wishlistName) ? " disabled" : ""} class="base-btn mt-10 w-full capitalize !h-14"${l3}> Save Wishlist </button></div>`);
      }), _: 1 }, l2)) : e2("<!---->");
    }, "body", false, l2), i2("</div>");
  };
} }, k = j.setup;
j.setup = (e2, t2) => {
  const a2 = useSSRContext();
  return (a2.modules || (a2.modules = /* @__PURE__ */ new Set())).add("pages/profile/wishlist.vue"), k ? k(e2, t2) : undefined;
};

export { j as default };
//# sourceMappingURL=wishlist-DKXXEdju.mjs.map
