import { u as useUtmPayload, _ as _sfc_main$1, a as _sfc_main$3, b as _sfc_main$4, c as _sfc_main$5 } from "./useUtmPayload-DlQ2OH8k.js";
import { _ as _sfc_main$2 } from "./FormLabel-PCaiHQXT.js";
import { useForm, Field } from "vee-validate";
import { d as useI18n, u as useLocalePath, m as useState, n as navigateTo, _ as __nuxt_component_0 } from "../server.mjs";
import { _ as _sfc_main$6, a as _sfc_main$7, b as _sfc_main$a } from "./PopoverTrigger-D3Tywx5m.js";
import { _ as _sfc_main$8 } from "./index-m9AqQ9dr.js";
import _sfc_main$9 from "./FlagComponent-tWUs0Zo0.js";
import { _ as _sfc_main$b, a as _sfc_main$c, b as _sfc_main$d, c as _sfc_main$e, d as _sfc_main$f, e as _sfc_main$g, f as _sfc_main$h, g as _sfc_main$i, h as _sfc_main$j, i as _sfc_main$k, j as _sfc_main$l, k as _sfc_main$m } from "./Textarea-D5DXsU7G.js";
import { defineComponent, ref, computed, mergeProps, withCtx, createTextVNode, toDisplayString, createVNode, unref, createBlock, openBlock, Fragment, renderList, useSSRContext } from "vue";
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderList } from "vue/server-renderer";
import { toTypedSchema } from "@vee-validate/zod";
import PhoneInput from "base-vue-phone-input";
import { a as useFocus } from "./index-Cce4iXMN.js";
import { ChevronsUpDown } from "lucide-vue-next";
import * as z from "zod";
import { u as useApi } from "./useApi-Dv-cyvzn.js";
import { u as useThrottleFn } from "./index-B_IDLhd1.js";
import "reka-ui";
import "./utils-H80jjgLf.js";
import "clsx";
import "tailwind-merge";
import "ofetch";
import "#internal/nuxt/paths";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/hookable/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/unctx/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/h3/dist/index.mjs";
import "pinia";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/defu/dist/defu.mjs";
import "@pinia/colada";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/klona/dist/index.mjs";
import "vue-router";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/radix3/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/cookie-es/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/destr/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/ohash/dist/index.mjs";
import "D:/marwa/front/webstdy-v2-frontend/node_modules/@unhead/vue/dist/index.mjs";
import "@vue/devtools-api";
import "@unhead/schema-org/vue";
import "scule";
import "deep-pick-omit";
import "@iconify/vue";
import "class-variance-authority";
import "axios";
import "vue-sonner";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Form",
  __ssrInlineRender: true,
  props: {
    isCampaign: { type: Boolean, default: false },
    services: {}
  },
  setup(__props) {
    const { t } = useI18n();
    const localePath = useLocalePath();
    const { getUTMPayload } = useUtmPayload();
    const phoneInput = ref(null);
    const { focused } = useFocus(phoneInput);
    const open = ref(false);
    const phoneResult = ref();
    const successMessage = ref("");
    const errorMessage = ref("");
    const loading = ref(false);
    const formSubmitted = useState("form-submitted", () => false);
    const formSchema = computed(() => createFormSchema(t));
    function onPhoneUpdate(res) {
      phoneResult.value = res;
    }
    function createFormSchema(t2) {
      return toTypedSchema(
        z.object({
          full_name: z.string({ required_error: t2("schemaErrors.required_field_error") }).min(3, t2("schemaErrors.min")),
          email: z.string({ required_error: t2("schemaErrors.email_required_error") }).email(t2("schemaErrors.email_invalid_error")),
          phone: z.string({ required_error: t2("schemaErrors.required_field_error") }).min(1, t2("schemaErrors.required_field_error")).refine(
            () => {
              var _a;
              return ((_a = phoneResult.value) == null ? void 0 : _a.isValid) === true;
            },
            t2("schemaErrors.phone_invalid_error")
          ),
          service_id: z.number({ required_error: t2("schemaErrors.required_field_error") }).min(1, t2("schemaErrors.min_service")),
          description: z.string().optional()
        })
      );
    }
    const { handleSubmit, resetForm } = useForm({
      validationSchema: formSchema,
      validateOnMount: false
    });
    useThrottleFn(
      handleSubmit(async (values) => {
        var _a, _b, _c, _d, _e;
        const { post } = useApi();
        if (((_a = phoneResult.value) == null ? void 0 : _a.isValid) === false) {
          return;
        }
        try {
          loading.value = true;
          errorMessage.value = "";
          successMessage.value = "";
          const payload = {
            full_name: values.full_name,
            email: values.email,
            phone: (_b = phoneResult.value) == null ? void 0 : _b.formatInternational,
            country_code: (_c = phoneResult.value) == null ? void 0 : _c.countryCode,
            service_id: values.service_id,
            description: values.description,
            utm: getUTMPayload()
          };
          await post("contact_us", payload);
          successMessage.value = t("success_message");
          resetForm();
          formSubmitted.value = true;
          await navigateTo(localePath("/thank-you"));
        } catch (err) {
          console.error("Contact form submission error:", err);
          const maybeAxiosErr = err;
          const message = typeof ((_e = (_d = maybeAxiosErr == null ? void 0 : maybeAxiosErr.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) === "string" ? maybeAxiosErr.response.data.message : t("error_message");
          errorMessage.value = message;
          setTimeout(() => {
            errorMessage.value = "";
          }, 3e3);
        } finally {
          loading.value = false;
        }
      }),
      5e3
    );
    return (_ctx, _push, _parent, _attrs) => {
      const _component_FormField = Field;
      const _component_FormItem = _sfc_main$1;
      const _component_FormLabel = _sfc_main$2;
      const _component_FormControl = _sfc_main$3;
      const _component_Input = _sfc_main$4;
      const _component_FormMessage = _sfc_main$5;
      const _component_ClientOnly = __nuxt_component_0;
      const _component_Popover = _sfc_main$6;
      const _component_PopoverTrigger = _sfc_main$7;
      const _component_Button = _sfc_main$8;
      const _component_ContactFlagComponent = _sfc_main$9;
      const _component_PopoverContent = _sfc_main$a;
      const _component_Command = _sfc_main$b;
      const _component_CommandInput = _sfc_main$c;
      const _component_CommandEmpty = _sfc_main$d;
      const _component_CommandList = _sfc_main$e;
      const _component_CommandGroup = _sfc_main$f;
      const _component_CommandItem = _sfc_main$g;
      const _component_Select = _sfc_main$h;
      const _component_SelectTrigger = _sfc_main$i;
      const _component_SelectValue = _sfc_main$j;
      const _component_SelectContent = _sfc_main$k;
      const _component_SelectItem = _sfc_main$l;
      const _component_Textarea = _sfc_main$m;
      _push(`<form${ssrRenderAttrs(mergeProps({ class: "mx-auto w-full space-y-3" }, _attrs))}><div class="grid grid-cols-1 gap-4 md:grid-cols-2">`);
      _push(ssrRenderComponent(_component_FormField, {
        name: "full_name",
        "validate-on-blur": true,
        "validate-on-input": false
      }, {
        default: withCtx(({ componentField }, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(_component_FormItem, null, {
              default: withCtx((_, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`${ssrInterpolate(_ctx.$t("labels.full_name_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.full_name_label")), 1)
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(ssrRenderComponent(_component_FormControl, null, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(ssrRenderComponent(_component_Input, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, {
                          placeholder: _ctx.$t("placeholders.name")
                        }), null, _parent4, _scopeId3));
                      } else {
                        return [
                          createVNode(_component_Input, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, {
                            placeholder: _ctx.$t("placeholders.name")
                          }), null, 16, ["placeholder"])
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(`<div class="text-destructive min-h-[20px] !text-sm"${_scopeId2}>`);
                  _push3(ssrRenderComponent(_component_FormMessage, null, null, _parent3, _scopeId2));
                  _push3(`</div>`);
                } else {
                  return [
                    createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                      default: withCtx(() => [
                        createTextVNode(toDisplayString(_ctx.$t("labels.full_name_label")), 1)
                      ]),
                      _: 1
                    }),
                    createVNode(_component_FormControl, null, {
                      default: withCtx(() => [
                        createVNode(_component_Input, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, {
                          placeholder: _ctx.$t("placeholders.name")
                        }), null, 16, ["placeholder"])
                      ]),
                      _: 2
                    }, 1024),
                    createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                      createVNode(_component_FormMessage)
                    ])
                  ];
                }
              }),
              _: 2
            }, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_FormItem, null, {
                default: withCtx(() => [
                  createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(_ctx.$t("labels.full_name_label")), 1)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_FormControl, null, {
                    default: withCtx(() => [
                      createVNode(_component_Input, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, {
                        placeholder: _ctx.$t("placeholders.name")
                      }), null, 16, ["placeholder"])
                    ]),
                    _: 2
                  }, 1024),
                  createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                    createVNode(_component_FormMessage)
                  ])
                ]),
                _: 2
              }, 1024)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(ssrRenderComponent(_component_FormField, { name: "phone" }, {
        default: withCtx(({ componentField }, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(_component_FormItem, null, {
              default: withCtx((_, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`${ssrInterpolate(_ctx.$t("labels.phone_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.phone_label")), 1)
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(ssrRenderComponent(_component_ClientOnly, null, {}, _parent3, _scopeId2));
                  _push3(`<div class="text-destructive min-h-[20px] !text-sm"${_scopeId2}>`);
                  _push3(ssrRenderComponent(_component_FormMessage, null, null, _parent3, _scopeId2));
                  _push3(`</div>`);
                } else {
                  return [
                    createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                      default: withCtx(() => [
                        createTextVNode(toDisplayString(_ctx.$t("labels.phone_label")), 1)
                      ]),
                      _: 1
                    }),
                    createVNode(_component_ClientOnly, null, {
                      default: withCtx(() => [
                        createVNode(unref(PhoneInput), {
                          noUseBrowserLocale: "",
                          fetchCountry: "",
                          "country-code": "SA",
                          "country-locale": _ctx.$i18n.locale,
                          class: "flex items-center",
                          "only-countries": [
                            "SA",
                            "EG",
                            "AE",
                            "KW",
                            "QA",
                            "BH",
                            "JO",
                            "MA",
                            "PS",
                            "TN",
                            "DZ",
                            "KM",
                            "DJ",
                            "IQ",
                            "LB",
                            "LY",
                            "MR",
                            "OM",
                            "SD",
                            "SY",
                            "YE"
                          ],
                          onUpdate: onPhoneUpdate
                        }, {
                          selector: withCtx(({ inputValue, updateInputValue, countries }) => [
                            createVNode(_component_Popover, null, {
                              default: withCtx(() => [
                                createVNode(_component_PopoverTrigger, null, {
                                  default: withCtx(() => [
                                    createVNode(_component_Button, {
                                      type: "button",
                                      class: "!bg-background border-input-border focus-visible:border-input-border border-e-none h-[40px] rounded-sm rounded-e-none border p-3 placeholder:text-[12px] focus-visible:ring-0"
                                    }, {
                                      default: withCtx(() => [
                                        createVNode(_component_ContactFlagComponent, { country: inputValue }, null, 8, ["country"]),
                                        createVNode(unref(ChevronsUpDown), { class: "text-foreground h-4 w-4 opacity-50" })
                                      ]),
                                      _: 2
                                    }, 1024)
                                  ]),
                                  _: 2
                                }, 1024),
                                createVNode(_component_PopoverContent, {
                                  align: "start",
                                  class: "!bg-background border-input-border ws-scrollbar w-[287px] rounded-sm p-0 sm:w-[540px] md:w-[325px] lg:w-[455px] xl:w-[270px] 2xl:w-[335px]"
                                }, {
                                  default: withCtx(() => [
                                    createVNode(_component_Command, {
                                      dir: _ctx.$i18n.locale === "ar" ? "rtl" : "ltr"
                                    }, {
                                      default: withCtx(() => [
                                        createVNode(_component_CommandInput, {
                                          placeholder: _ctx.$t("placeholders.country")
                                        }, null, 8, ["placeholder"]),
                                        createVNode(_component_CommandEmpty, null, {
                                          default: withCtx(() => [
                                            createTextVNode(toDisplayString(_ctx.$t("placeholders.noResult")), 1)
                                          ]),
                                          _: 1
                                        }),
                                        createVNode(_component_CommandList, null, {
                                          default: withCtx(() => [
                                            createVNode(_component_CommandGroup, null, {
                                              default: withCtx(() => [
                                                (openBlock(true), createBlock(Fragment, null, renderList(countries, (option) => {
                                                  return openBlock(), createBlock(_component_CommandItem, {
                                                    key: option.iso2,
                                                    value: option.iso2,
                                                    class: "gap-2",
                                                    onSelect: () => {
                                                      updateInputValue(option.iso2);
                                                      open.value = false;
                                                      focused.value = true;
                                                    }
                                                  }, {
                                                    default: withCtx(() => [
                                                      createVNode(_component_ContactFlagComponent, {
                                                        country: option == null ? void 0 : option.iso2
                                                      }, null, 8, ["country"]),
                                                      createVNode("span", { class: "flex-1 text-sm" }, toDisplayString(option.name), 1),
                                                      createVNode("span", { class: "text-foreground/50 text-sm" }, toDisplayString(option.dialCode), 1)
                                                    ]),
                                                    _: 2
                                                  }, 1032, ["value", "onSelect"]);
                                                }), 128))
                                              ]),
                                              _: 2
                                            }, 1024)
                                          ]),
                                          _: 2
                                        }, 1024)
                                      ]),
                                      _: 2
                                    }, 1032, ["dir"])
                                  ]),
                                  _: 2
                                }, 1024)
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          input: withCtx(({ inputValue, updateInputValue, placeholder }) => [
                            createVNode(_component_FormControl, null, {
                              default: withCtx(() => [
                                createVNode(_component_Input, mergeProps({
                                  ref_key: "phoneInput",
                                  ref: phoneInput,
                                  class: "!bg-background border-input-border focus-visible:border-input-border border-s-none h-[40px] rounded-sm rounded-s-none border p-3 placeholder:text-[12px] focus-visible:ring-0",
                                  type: "text"
                                }, componentField, {
                                  "model-value": inputValue,
                                  placeholder,
                                  style: { "unicode-bidi": "plaintext" },
                                  onInput: updateInputValue
                                }), null, 16, ["model-value", "placeholder", "onInput"])
                              ]),
                              _: 2
                            }, 1024)
                          ]),
                          _: 2
                        }, 1032, ["country-locale"])
                      ]),
                      _: 2
                    }, 1024),
                    createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                      createVNode(_component_FormMessage)
                    ])
                  ];
                }
              }),
              _: 2
            }, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_FormItem, null, {
                default: withCtx(() => [
                  createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(_ctx.$t("labels.phone_label")), 1)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_ClientOnly, null, {
                    default: withCtx(() => [
                      createVNode(unref(PhoneInput), {
                        noUseBrowserLocale: "",
                        fetchCountry: "",
                        "country-code": "SA",
                        "country-locale": _ctx.$i18n.locale,
                        class: "flex items-center",
                        "only-countries": [
                          "SA",
                          "EG",
                          "AE",
                          "KW",
                          "QA",
                          "BH",
                          "JO",
                          "MA",
                          "PS",
                          "TN",
                          "DZ",
                          "KM",
                          "DJ",
                          "IQ",
                          "LB",
                          "LY",
                          "MR",
                          "OM",
                          "SD",
                          "SY",
                          "YE"
                        ],
                        onUpdate: onPhoneUpdate
                      }, {
                        selector: withCtx(({ inputValue, updateInputValue, countries }) => [
                          createVNode(_component_Popover, null, {
                            default: withCtx(() => [
                              createVNode(_component_PopoverTrigger, null, {
                                default: withCtx(() => [
                                  createVNode(_component_Button, {
                                    type: "button",
                                    class: "!bg-background border-input-border focus-visible:border-input-border border-e-none h-[40px] rounded-sm rounded-e-none border p-3 placeholder:text-[12px] focus-visible:ring-0"
                                  }, {
                                    default: withCtx(() => [
                                      createVNode(_component_ContactFlagComponent, { country: inputValue }, null, 8, ["country"]),
                                      createVNode(unref(ChevronsUpDown), { class: "text-foreground h-4 w-4 opacity-50" })
                                    ]),
                                    _: 2
                                  }, 1024)
                                ]),
                                _: 2
                              }, 1024),
                              createVNode(_component_PopoverContent, {
                                align: "start",
                                class: "!bg-background border-input-border ws-scrollbar w-[287px] rounded-sm p-0 sm:w-[540px] md:w-[325px] lg:w-[455px] xl:w-[270px] 2xl:w-[335px]"
                              }, {
                                default: withCtx(() => [
                                  createVNode(_component_Command, {
                                    dir: _ctx.$i18n.locale === "ar" ? "rtl" : "ltr"
                                  }, {
                                    default: withCtx(() => [
                                      createVNode(_component_CommandInput, {
                                        placeholder: _ctx.$t("placeholders.country")
                                      }, null, 8, ["placeholder"]),
                                      createVNode(_component_CommandEmpty, null, {
                                        default: withCtx(() => [
                                          createTextVNode(toDisplayString(_ctx.$t("placeholders.noResult")), 1)
                                        ]),
                                        _: 1
                                      }),
                                      createVNode(_component_CommandList, null, {
                                        default: withCtx(() => [
                                          createVNode(_component_CommandGroup, null, {
                                            default: withCtx(() => [
                                              (openBlock(true), createBlock(Fragment, null, renderList(countries, (option) => {
                                                return openBlock(), createBlock(_component_CommandItem, {
                                                  key: option.iso2,
                                                  value: option.iso2,
                                                  class: "gap-2",
                                                  onSelect: () => {
                                                    updateInputValue(option.iso2);
                                                    open.value = false;
                                                    focused.value = true;
                                                  }
                                                }, {
                                                  default: withCtx(() => [
                                                    createVNode(_component_ContactFlagComponent, {
                                                      country: option == null ? void 0 : option.iso2
                                                    }, null, 8, ["country"]),
                                                    createVNode("span", { class: "flex-1 text-sm" }, toDisplayString(option.name), 1),
                                                    createVNode("span", { class: "text-foreground/50 text-sm" }, toDisplayString(option.dialCode), 1)
                                                  ]),
                                                  _: 2
                                                }, 1032, ["value", "onSelect"]);
                                              }), 128))
                                            ]),
                                            _: 2
                                          }, 1024)
                                        ]),
                                        _: 2
                                      }, 1024)
                                    ]),
                                    _: 2
                                  }, 1032, ["dir"])
                                ]),
                                _: 2
                              }, 1024)
                            ]),
                            _: 2
                          }, 1024)
                        ]),
                        input: withCtx(({ inputValue, updateInputValue, placeholder }) => [
                          createVNode(_component_FormControl, null, {
                            default: withCtx(() => [
                              createVNode(_component_Input, mergeProps({
                                ref_key: "phoneInput",
                                ref: phoneInput,
                                class: "!bg-background border-input-border focus-visible:border-input-border border-s-none h-[40px] rounded-sm rounded-s-none border p-3 placeholder:text-[12px] focus-visible:ring-0",
                                type: "text"
                              }, componentField, {
                                "model-value": inputValue,
                                placeholder,
                                style: { "unicode-bidi": "plaintext" },
                                onInput: updateInputValue
                              }), null, 16, ["model-value", "placeholder", "onInput"])
                            ]),
                            _: 2
                          }, 1024)
                        ]),
                        _: 2
                      }, 1032, ["country-locale"])
                    ]),
                    _: 2
                  }, 1024),
                  createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                    createVNode(_component_FormMessage)
                  ])
                ]),
                _: 2
              }, 1024)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div><div class="grid grid-cols-1 gap-4 md:grid-cols-2">`);
      _push(ssrRenderComponent(_component_FormField, {
        name: "email",
        "validate-on-blur": true,
        "validate-on-input": false
      }, {
        default: withCtx(({ componentField }, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(_component_FormItem, null, {
              default: withCtx((_, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`${ssrInterpolate(_ctx.$t("labels.email_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.email_label")), 1)
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(ssrRenderComponent(_component_FormControl, null, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(ssrRenderComponent(_component_Input, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, { placeholder: "email@example.com" }), null, _parent4, _scopeId3));
                      } else {
                        return [
                          createVNode(_component_Input, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, { placeholder: "email@example.com" }), null, 16)
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(`<div class="text-destructive min-h-[20px] !text-sm"${_scopeId2}>`);
                  _push3(ssrRenderComponent(_component_FormMessage, null, null, _parent3, _scopeId2));
                  _push3(`</div>`);
                } else {
                  return [
                    createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                      default: withCtx(() => [
                        createTextVNode(toDisplayString(_ctx.$t("labels.email_label")), 1)
                      ]),
                      _: 1
                    }),
                    createVNode(_component_FormControl, null, {
                      default: withCtx(() => [
                        createVNode(_component_Input, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, { placeholder: "email@example.com" }), null, 16)
                      ]),
                      _: 2
                    }, 1024),
                    createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                      createVNode(_component_FormMessage)
                    ])
                  ];
                }
              }),
              _: 2
            }, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_FormItem, null, {
                default: withCtx(() => [
                  createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(_ctx.$t("labels.email_label")), 1)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_FormControl, null, {
                    default: withCtx(() => [
                      createVNode(_component_Input, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, { placeholder: "email@example.com" }), null, 16)
                    ]),
                    _: 2
                  }, 1024),
                  createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                    createVNode(_component_FormMessage)
                  ])
                ]),
                _: 2
              }, 1024)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(ssrRenderComponent(_component_FormField, {
        name: "service_id",
        "validate-on-blur": true,
        "validate-on-input": false
      }, {
        default: withCtx(({ componentField }, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(_component_FormItem, null, {
              default: withCtx((_, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`${ssrInterpolate(_ctx.$t("labels.service_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.service_label")), 1)
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(ssrRenderComponent(_component_Select, componentField, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(ssrRenderComponent(_component_FormControl, null, {
                          default: withCtx((_3, _push5, _parent5, _scopeId4) => {
                            if (_push5) {
                              _push5(ssrRenderComponent(_component_SelectTrigger, {
                                "aria-label": _ctx.$t("ariaLabels.services"),
                                class: "!bg-background border-input-border focus-visible:border-input-border !h-[40px] w-full rounded-sm border p-3 shadow-none focus-visible:ring-0 ltr:text-left rtl:flex-row-reverse rtl:text-right"
                              }, {
                                default: withCtx((_4, _push6, _parent6, _scopeId5) => {
                                  if (_push6) {
                                    _push6(ssrRenderComponent(_component_SelectValue, {
                                      class: "placeholder:text-[12px]",
                                      placeholder: _ctx.$t("placeholders.service")
                                    }, null, _parent6, _scopeId5));
                                  } else {
                                    return [
                                      createVNode(_component_SelectValue, {
                                        class: "placeholder:text-[12px]",
                                        placeholder: _ctx.$t("placeholders.service")
                                      }, null, 8, ["placeholder"])
                                    ];
                                  }
                                }),
                                _: 2
                              }, _parent5, _scopeId4));
                            } else {
                              return [
                                createVNode(_component_SelectTrigger, {
                                  "aria-label": _ctx.$t("ariaLabels.services"),
                                  class: "!bg-background border-input-border focus-visible:border-input-border !h-[40px] w-full rounded-sm border p-3 shadow-none focus-visible:ring-0 ltr:text-left rtl:flex-row-reverse rtl:text-right"
                                }, {
                                  default: withCtx(() => [
                                    createVNode(_component_SelectValue, {
                                      class: "placeholder:text-[12px]",
                                      placeholder: _ctx.$t("placeholders.service")
                                    }, null, 8, ["placeholder"])
                                  ]),
                                  _: 1
                                }, 8, ["aria-label"])
                              ];
                            }
                          }),
                          _: 2
                        }, _parent4, _scopeId3));
                        _push4(ssrRenderComponent(_component_SelectContent, { class: "!bg-background border-input-border rounded-sm" }, {
                          default: withCtx((_3, _push5, _parent5, _scopeId4) => {
                            if (_push5) {
                              _push5(`<!--[-->`);
                              ssrRenderList(_ctx.services, (service) => {
                                _push5(ssrRenderComponent(_component_SelectItem, {
                                  key: service.id,
                                  value: service.id
                                }, {
                                  default: withCtx((_4, _push6, _parent6, _scopeId5) => {
                                    if (_push6) {
                                      _push6(`${ssrInterpolate(service.title)}`);
                                    } else {
                                      return [
                                        createTextVNode(toDisplayString(service.title), 1)
                                      ];
                                    }
                                  }),
                                  _: 2
                                }, _parent5, _scopeId4));
                              });
                              _push5(`<!--]-->`);
                            } else {
                              return [
                                (openBlock(true), createBlock(Fragment, null, renderList(_ctx.services, (service) => {
                                  return openBlock(), createBlock(_component_SelectItem, {
                                    key: service.id,
                                    value: service.id
                                  }, {
                                    default: withCtx(() => [
                                      createTextVNode(toDisplayString(service.title), 1)
                                    ]),
                                    _: 2
                                  }, 1032, ["value"]);
                                }), 128))
                              ];
                            }
                          }),
                          _: 2
                        }, _parent4, _scopeId3));
                      } else {
                        return [
                          createVNode(_component_FormControl, null, {
                            default: withCtx(() => [
                              createVNode(_component_SelectTrigger, {
                                "aria-label": _ctx.$t("ariaLabels.services"),
                                class: "!bg-background border-input-border focus-visible:border-input-border !h-[40px] w-full rounded-sm border p-3 shadow-none focus-visible:ring-0 ltr:text-left rtl:flex-row-reverse rtl:text-right"
                              }, {
                                default: withCtx(() => [
                                  createVNode(_component_SelectValue, {
                                    class: "placeholder:text-[12px]",
                                    placeholder: _ctx.$t("placeholders.service")
                                  }, null, 8, ["placeholder"])
                                ]),
                                _: 1
                              }, 8, ["aria-label"])
                            ]),
                            _: 1
                          }),
                          createVNode(_component_SelectContent, { class: "!bg-background border-input-border rounded-sm" }, {
                            default: withCtx(() => [
                              (openBlock(true), createBlock(Fragment, null, renderList(_ctx.services, (service) => {
                                return openBlock(), createBlock(_component_SelectItem, {
                                  key: service.id,
                                  value: service.id
                                }, {
                                  default: withCtx(() => [
                                    createTextVNode(toDisplayString(service.title), 1)
                                  ]),
                                  _: 2
                                }, 1032, ["value"]);
                              }), 128))
                            ]),
                            _: 1
                          })
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(`<div class="text-destructive min-h-[20px] !text-sm"${_scopeId2}>`);
                  _push3(ssrRenderComponent(_component_FormMessage, null, null, _parent3, _scopeId2));
                  _push3(`</div>`);
                } else {
                  return [
                    createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                      default: withCtx(() => [
                        createTextVNode(toDisplayString(_ctx.$t("labels.service_label")), 1)
                      ]),
                      _: 1
                    }),
                    createVNode(_component_Select, componentField, {
                      default: withCtx(() => [
                        createVNode(_component_FormControl, null, {
                          default: withCtx(() => [
                            createVNode(_component_SelectTrigger, {
                              "aria-label": _ctx.$t("ariaLabels.services"),
                              class: "!bg-background border-input-border focus-visible:border-input-border !h-[40px] w-full rounded-sm border p-3 shadow-none focus-visible:ring-0 ltr:text-left rtl:flex-row-reverse rtl:text-right"
                            }, {
                              default: withCtx(() => [
                                createVNode(_component_SelectValue, {
                                  class: "placeholder:text-[12px]",
                                  placeholder: _ctx.$t("placeholders.service")
                                }, null, 8, ["placeholder"])
                              ]),
                              _: 1
                            }, 8, ["aria-label"])
                          ]),
                          _: 1
                        }),
                        createVNode(_component_SelectContent, { class: "!bg-background border-input-border rounded-sm" }, {
                          default: withCtx(() => [
                            (openBlock(true), createBlock(Fragment, null, renderList(_ctx.services, (service) => {
                              return openBlock(), createBlock(_component_SelectItem, {
                                key: service.id,
                                value: service.id
                              }, {
                                default: withCtx(() => [
                                  createTextVNode(toDisplayString(service.title), 1)
                                ]),
                                _: 2
                              }, 1032, ["value"]);
                            }), 128))
                          ]),
                          _: 1
                        })
                      ]),
                      _: 2
                    }, 1040),
                    createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                      createVNode(_component_FormMessage)
                    ])
                  ];
                }
              }),
              _: 2
            }, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_FormItem, null, {
                default: withCtx(() => [
                  createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(_ctx.$t("labels.service_label")), 1)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_Select, componentField, {
                    default: withCtx(() => [
                      createVNode(_component_FormControl, null, {
                        default: withCtx(() => [
                          createVNode(_component_SelectTrigger, {
                            "aria-label": _ctx.$t("ariaLabels.services"),
                            class: "!bg-background border-input-border focus-visible:border-input-border !h-[40px] w-full rounded-sm border p-3 shadow-none focus-visible:ring-0 ltr:text-left rtl:flex-row-reverse rtl:text-right"
                          }, {
                            default: withCtx(() => [
                              createVNode(_component_SelectValue, {
                                class: "placeholder:text-[12px]",
                                placeholder: _ctx.$t("placeholders.service")
                              }, null, 8, ["placeholder"])
                            ]),
                            _: 1
                          }, 8, ["aria-label"])
                        ]),
                        _: 1
                      }),
                      createVNode(_component_SelectContent, { class: "!bg-background border-input-border rounded-sm" }, {
                        default: withCtx(() => [
                          (openBlock(true), createBlock(Fragment, null, renderList(_ctx.services, (service) => {
                            return openBlock(), createBlock(_component_SelectItem, {
                              key: service.id,
                              value: service.id
                            }, {
                              default: withCtx(() => [
                                createTextVNode(toDisplayString(service.title), 1)
                              ]),
                              _: 2
                            }, 1032, ["value"]);
                          }), 128))
                        ]),
                        _: 1
                      })
                    ]),
                    _: 2
                  }, 1040),
                  createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                    createVNode(_component_FormMessage)
                  ])
                ]),
                _: 2
              }, 1024)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div>`);
      _push(ssrRenderComponent(_component_FormField, { name: "description" }, {
        default: withCtx(({ componentField }, _push2, _parent2, _scopeId) => {
          if (_push2) {
            _push2(ssrRenderComponent(_component_FormItem, null, {
              default: withCtx((_, _push3, _parent3, _scopeId2) => {
                if (_push3) {
                  _push3(ssrRenderComponent(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`${ssrInterpolate(_ctx.$t("labels.project_description_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.project_description_label")), 1)
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(ssrRenderComponent(_component_FormControl, null, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(ssrRenderComponent(_component_Textarea, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[78px] resize-none rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, {
                          placeholder: _ctx.$t("placeholders.project_description")
                        }), null, _parent4, _scopeId3));
                      } else {
                        return [
                          createVNode(_component_Textarea, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[78px] resize-none rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, {
                            placeholder: _ctx.$t("placeholders.project_description")
                          }), null, 16, ["placeholder"])
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(`<div class="text-destructive min-h-[20px] !text-sm"${_scopeId2}>`);
                  _push3(ssrRenderComponent(_component_FormMessage, null, null, _parent3, _scopeId2));
                  _push3(`</div>`);
                } else {
                  return [
                    createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                      default: withCtx(() => [
                        createTextVNode(toDisplayString(_ctx.$t("labels.project_description_label")), 1)
                      ]),
                      _: 1
                    }),
                    createVNode(_component_FormControl, null, {
                      default: withCtx(() => [
                        createVNode(_component_Textarea, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[78px] resize-none rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, {
                          placeholder: _ctx.$t("placeholders.project_description")
                        }), null, 16, ["placeholder"])
                      ]),
                      _: 2
                    }, 1024),
                    createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                      createVNode(_component_FormMessage)
                    ])
                  ];
                }
              }),
              _: 2
            }, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_FormItem, null, {
                default: withCtx(() => [
                  createVNode(_component_FormLabel, { class: "text-primary capitalize" }, {
                    default: withCtx(() => [
                      createTextVNode(toDisplayString(_ctx.$t("labels.project_description_label")), 1)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_FormControl, null, {
                    default: withCtx(() => [
                      createVNode(_component_Textarea, mergeProps({ class: "!bg-background border-input-border focus-visible:border-input-border h-[78px] resize-none rounded-sm border p-3 placeholder:text-[12px] focus-visible:ring-0" }, componentField, {
                        placeholder: _ctx.$t("placeholders.project_description")
                      }), null, 16, ["placeholder"])
                    ]),
                    _: 2
                  }, 1024),
                  createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                    createVNode(_component_FormMessage)
                  ])
                ]),
                _: 2
              }, 1024)
            ];
          }
        }),
        _: 1
      }, _parent));
      if (_ctx.isCampaign) {
        _push(ssrRenderComponent(_component_Button, {
          type: "submit",
          variant: "wsDefault",
          class: [unref(loading) ? "cursor-not-allowed opacity-50" : "cursor-pointer", "h-[48px] w-full !text-black dark:!text-white"]
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              if (unref(loading)) {
                _push2(`<span class="flex items-center gap-2"${_scopeId}><span${_scopeId}>${ssrInterpolate(_ctx.$t("buttons.loading_send_button"))}</span><span class="animate-spin-loader"${_scopeId}></span></span>`);
              } else {
                _push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$t("buttons.send_button2"))}</span>`);
              }
            } else {
              return [
                unref(loading) ? (openBlock(), createBlock("span", {
                  key: 0,
                  class: "flex items-center gap-2"
                }, [
                  createVNode("span", null, toDisplayString(_ctx.$t("buttons.loading_send_button")), 1),
                  createVNode("span", { class: "animate-spin-loader" })
                ])) : (openBlock(), createBlock("span", { key: 1 }, toDisplayString(_ctx.$t("buttons.send_button2")), 1))
              ];
            }
          }),
          _: 1
        }, _parent));
      } else {
        _push(ssrRenderComponent(_component_Button, {
          type: "submit",
          class: [unref(loading) ? "cursor-not-allowed opacity-50" : "cursor-pointer", "ws-gradient-border text-foreground h-[48px] w-full"]
        }, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              if (unref(loading)) {
                _push2(`<span class="flex items-center gap-2"${_scopeId}><span${_scopeId}>${ssrInterpolate(_ctx.$t("buttons.loading_send_button"))}</span><span class="animate-spin-loader"${_scopeId}></span></span>`);
              } else {
                _push2(`<span${_scopeId}>${ssrInterpolate(_ctx.$t("buttons.send_button"))}</span>`);
              }
            } else {
              return [
                unref(loading) ? (openBlock(), createBlock("span", {
                  key: 0,
                  class: "flex items-center gap-2"
                }, [
                  createVNode("span", null, toDisplayString(_ctx.$t("buttons.loading_send_button")), 1),
                  createVNode("span", { class: "animate-spin-loader" })
                ])) : (openBlock(), createBlock("span", { key: 1 }, toDisplayString(_ctx.$t("buttons.send_button")), 1))
              ];
            }
          }),
          _: 1
        }, _parent));
      }
      if (unref(errorMessage)) {
        _push(`<div class="text-center text-red-500">${ssrInterpolate(unref(errorMessage))}</div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</form>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/global/contact/Form.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
export {
  _sfc_main as default
};
//# sourceMappingURL=Form-BItdTITZ.js.map
