import { q } from './BaseTextInput-Cu_w8Ykz.mjs';
import { B } from './BasePhoneInput-Bn0nyYE9.mjs';
import { S } from './BaseSelectInput-CRA84xWg.mjs';
import { l } from './Success-SKyLuquS.mjs';
import { ref, resolveComponent, mergeProps, unref, withCtx, createVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrInterpolate, ssrRenderComponent, ssrRenderAttr, ssrRenderTeleport } from 'vue/server-renderer';
import { p as pe } from './index-Dj5w-pp2.mjs';
import * as R from 'yup';
import { u as ef, a as Qt, b as Qs } from './server.mjs';
import './SvgIcon-BnUcaRsf.mjs';
import '@headlessui/vue';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:fs';
import 'node:url';
import 'node:path';
import './Modal-DvA5yYy3.mjs';
import './Backdrop-BEGlY-L5.mjs';
import 'unhead';
import '@unhead/shared';
import 'vue-router';
import 'vue-rate';
import 'date-fns';
import '@hennge/vue3-pagination';
import 'axios';
import 'vue-social-sharing';

const x = { __name: "contact-us", __ssrInlineRender: true, setup(m2) {
  const x2 = ef(), $2 = Qt().$axios, y = ref(false), { t: U } = Qs(), f = ref(R.object().shape({ phone: R.object().shape({ phone_number: R.string().required(U("ERRORS.phone")).test("phone-length", function(e2) {
    const { phone_limit: a2 } = this.parent;
    return !!e2 && (e2.length === a2 || this.createError({ message: U("ERRORS.phone_limit", { phone_limit: a2 }) }));
  }) }), name: R.string().required(U("ERRORS.name")), email: R.string().email(U("ERRORS.invalid_email")).required(U("ERRORS.email")), country: R.object().required(U("ERRORS.country")), message: R.string().required(U("ERRORS.message")) })), R$1 = ref({}), L = ref(false), E = async (e2, a2) => {
    L.value = true;
    const t2 = new FormData();
    t2.append("full_name", e2.name), t2.append("email", e2.email), t2.append("country_id", e2.country.id), t2.append("content", e2.message), t2.append("phone_code", e2.phone.phone_code), t2.append("phone", e2.phone.phone_number), $2.post("contact-us", t2).then((e3) => {
      y.value = true, R$1.value = {}, a2.resetForm();
    }).catch((e3) => {
      pe.error(e3.response.data.message);
    }).finally(() => {
      L.value = false;
    });
  };
  return (o2, m3, b2, g2) => {
    const F2 = resolveComponent("VeeForm"), S2 = q, _2 = B, $3 = S, U2 = l;
    m3(`<div${ssrRenderAttrs(mergeProps({ class: "bg-[#F6F7FC] py-6 lg:py-10 px-2 lg:px-14 h-fit" }, g2))}><h3 class="font-bold text-3xl mb-12">${ssrInterpolate(o2.$t("NAV.contact"))}</h3>`), m3(ssrRenderComponent(F2, { "validation-schema": unref(f), onSubmit: E, initialValues: unref(R$1) }, { default: withCtx((e2, a2, t2, l2) => {
      if (!a2) return [createVNode("div", { class: "grid grid-cols-1 [&_label]:!bg-[#F6F7FC] [&_input]:!bg-[#FFFFFF03] [&_button[aria-haspopup=listbox]]:!bg-[#FFFFFF03] gap-8" }, [createVNode("div", null, [createVNode(S2, { name: "name", label: o2.$t("LABELS.name"), placeholder: o2.$t("INPUTS.name"), type: "text", value: unref(R$1).name, "onUpdate:value": (e3) => unref(R$1).name = e3 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", null, [createVNode(_2, { name: "phone", label: o2.$t("LABELS.phone"), placeholder: o2.$t("INPUTS.phone"), value: unref(R$1).phone, "onUpdate:value": (e3) => unref(R$1).phone = e3 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", null, [createVNode(S2, { name: "email", label: o2.$t("LABELS.email"), placeholder: o2.$t("INPUTS.email"), type: "email", value: unref(R$1).email, "onUpdate:value": (e3) => unref(R$1).email = e3 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", null, [createVNode($3, { name: "country", label: o2.$t("LABELS.country"), placeholder: o2.$t("INPUTS.country"), value: unref(R$1).country, "onUpdate:value": (e3) => unref(R$1).country = e3, items: unref(x2).countries }, null, 8, ["label", "placeholder", "value", "onUpdate:value", "items"])]), createVNode("div", { class: "[&_textarea]:!h-[160px] [&_textarea]:!bg-[#FFFFFF03] [&_textarea]:!p-6" }, [createVNode(S2, { name: "message", type: "textarea", label: o2.$t("LABELS.message"), placeholder: o2.$t("INPUTS.message"), value: unref(R$1).message, "onUpdate:value": (e3) => unref(R$1).message = e3 }, null, 8, ["label", "placeholder", "value", "onUpdate:value"])]), createVNode("div", null, [createVNode("button", { loading: unref(L), type: "submit", class: "base-btn capitalize !w-[480px] max-w-[100%]" }, " Send message ", 8, ["loading"])])])];
      a2(`<div class="grid grid-cols-1 [&amp;_label]:!bg-[#F6F7FC] [&amp;_input]:!bg-[#FFFFFF03] [&amp;_button[aria-haspopup=listbox]]:!bg-[#FFFFFF03] gap-8"${l2}><div${l2}>`), a2(ssrRenderComponent(S2, { name: "name", label: o2.$t("LABELS.name"), placeholder: o2.$t("INPUTS.name"), type: "text", value: unref(R$1).name, "onUpdate:value": (e3) => unref(R$1).name = e3 }, null, t2, l2)), a2(`</div><div${l2}>`), a2(ssrRenderComponent(_2, { name: "phone", label: o2.$t("LABELS.phone"), placeholder: o2.$t("INPUTS.phone"), value: unref(R$1).phone, "onUpdate:value": (e3) => unref(R$1).phone = e3 }, null, t2, l2)), a2(`</div><div${l2}>`), a2(ssrRenderComponent(S2, { name: "email", label: o2.$t("LABELS.email"), placeholder: o2.$t("INPUTS.email"), type: "email", value: unref(R$1).email, "onUpdate:value": (e3) => unref(R$1).email = e3 }, null, t2, l2)), a2(`</div><div${l2}>`), a2(ssrRenderComponent($3, { name: "country", label: o2.$t("LABELS.country"), placeholder: o2.$t("INPUTS.country"), value: unref(R$1).country, "onUpdate:value": (e3) => unref(R$1).country = e3, items: unref(x2).countries }, null, t2, l2)), a2(`</div><div class="[&amp;_textarea]:!h-[160px] [&amp;_textarea]:!bg-[#FFFFFF03] [&amp;_textarea]:!p-6"${l2}>`), a2(ssrRenderComponent(S2, { name: "message", type: "textarea", label: o2.$t("LABELS.message"), placeholder: o2.$t("INPUTS.message"), value: unref(R$1).message, "onUpdate:value": (e3) => unref(R$1).message = e3 }, null, t2, l2)), a2(`</div><div${l2}><button${ssrRenderAttr("loading", unref(L))} type="submit" class="base-btn capitalize !w-[480px] max-w-[100%]"${l2}> Send message </button></div></div>`);
    }), _: 1 }, b2)), unref(y) ? ssrRenderTeleport(m3, (e2) => {
      e2(ssrRenderComponent(U2, { class: "[&_h2]:!font-Montserrat [&_h2]:!not-italic [&_h2]:!font-semibold", onClose: (e3) => y.value = false, title: "Send message", desc: "The message has been sent successfully." }, null, b2));
    }, "body", false, b2) : m3("<!---->"), m3("</div>");
  };
} }, $ = x.setup;
x.setup = (e2, a2) => {
  const t2 = useSSRContext();
  return (t2.modules || (t2.modules = /* @__PURE__ */ new Set())).add("pages/profile/contact-us.vue"), $ ? $(e2, a2) : undefined;
};

export { x as default };
//# sourceMappingURL=contact-us-UYsmIDHv.mjs.map
