import __nuxt_component_0 from './GlobalLoader-CBULtKs6.mjs';
import __nuxt_component_0$1 from './InternalHeaderSection-DIj5MLKD.mjs';
import { defineComponent, computed, watch, unref, withCtx, createVNode, toDisplayString, mergeProps, ref, createTextVNode, createBlock, openBlock, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer';
import { k as useRoute, d as useI18n, q as useSetI18nParams, e as useSeoMeta, s as useHead, n as navigateTo, a as _export_sfc } from './server.mjs';
import { a as useJobQuery, _ as __nuxt_component_0$2 } from './career-BoxYXbpB.mjs';
import { u as useUtmPayload, _ as _sfc_main$2$1, a as _sfc_main$3$1, b as _sfc_main$6, c as _sfc_main$1$1 } from './useUtmPayload-DlQ2OH8k.mjs';
import { _ as _sfc_main$5 } from './FormLabel-PCaiHQXT.mjs';
import { useForm, Field } from 'vee-validate';
import { _ as _sfc_main$7 } from './index-m9AqQ9dr.mjs';
import { toTypedSchema } from '@vee-validate/zod';
import * as z from 'zod';
import { u as useApi } from './useApi-Dv-cyvzn.mjs';
import { _ as __nuxt_component_3 } from './SubscribeSection-D6lSAdXw.mjs';
import './useBreadcrumbSchema-CZ-Fj_m_.mjs';
import './utils-H80jjgLf.mjs';
import 'clsx';
import 'tailwind-merge';
import 'reka-ui';
import 'lucide-vue-next';
import '@unhead/schema-org';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'nitropack/dist/runtime/plugin';
import 'packrup';
import 'consola';
import 'node:fs';
import 'node:url';
import '@iconify/utils';
import 'node:crypto';
import 'ipx';
import 'node:path';
import 'pinia';
import '@pinia/colada';
import 'vue-router';
import '@unhead/schema-org/vue';
import 'deep-pick-omit';
import '@iconify/vue';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/plugins';
import 'unhead/utils';
import './index-Cce4iXMN.mjs';
import './index-B_IDLhd1.mjs';
import 'class-variance-authority';
import 'axios';
import 'vue-sonner';

const _sfc_main$4 = /* @__PURE__ */ defineComponent({
  __name: "JobDetails",
  __ssrInlineRender: true,
  props: {
    jobDetails: {}
  },
  setup(__props) {
    return (_ctx, _push, _parent, _attrs) => {
      var _a;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "prose bg-surface-background border-surface-border mx-auto w-full rounded-[12px] border p-6" }, _attrs))} data-v-f3c4bb7c>${(_a = _ctx.jobDetails) != null ? _a : ""}</div>`);
    };
  }
});
const _sfc_setup$4 = _sfc_main$4.setup;
_sfc_main$4.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/join-us/JobDetails.vue");
  return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
};
const __nuxt_component_2 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-f3c4bb7c"]]);
const _sfc_main$3 = {};
function _sfc_ssrRender(_ctx, _push, _parent, _attrs) {
  _push(`<svg${ssrRenderAttrs(mergeProps({
    xmlns: "http://www.w3.org/2000/svg",
    width: "17",
    height: "18",
    viewBox: "0 0 17 18",
    fill: "none"
  }, _attrs))}><path d="M2.68748 9.61605L9.09831 16.0269C9.80158 16.7301 10.7554 17.1252 11.75 17.1252C12.7445 17.1252 13.6984 16.7301 14.4016 16.0269C15.1049 15.3236 15.5 14.3698 15.5 13.3752C15.5 12.3806 15.1049 11.4268 14.4016 10.7235L5.28498 1.60688C5.05276 1.37477 4.77709 1.19067 4.47372 1.06509C4.17035 0.939516 3.84522 0.874923 3.51689 0.875C3.18856 0.875077 2.86345 0.939824 2.56014 1.06554C2.25683 1.19126 1.98126 1.37549 1.74915 1.60771C1.51703 1.83993 1.33293 2.1156 1.20736 2.41897C1.08178 2.72234 1.01719 3.04747 1.01727 3.3758C1.01734 3.70413 1.08209 4.02924 1.20781 4.33255C1.33353 4.63586 1.51776 4.91143 1.74998 5.14355L10.8733 14.2669C11.11 14.4938 11.4263 14.6178 11.7542 14.6136C12.082 14.6095 12.3951 14.4767 12.626 14.2438C12.8568 14.011 12.987 13.6968 12.9883 13.3689C12.9897 13.0411 12.8622 12.7258 12.6333 12.491L6.12498 5.98271M10.8658 14.2585L10.8741 14.2669" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path></svg>`);
}
const _sfc_setup$3 = _sfc_main$3.setup;
_sfc_main$3.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/svg/UploadIcon.vue");
  return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
};
const __nuxt_component_6 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["ssrRender", _sfc_ssrRender]]);
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  __name: "Form",
  __ssrInlineRender: true,
  props: {
    slug: {}
  },
  setup(__props) {
    const { t } = useI18n();
    const { getUTMPayload } = useUtmPayload();
    const fileInput = ref(null);
    const successMessage = ref("");
    const errorMessage = ref("");
    const loading = ref(false);
    const formSchema = computed(() => createFormSchema(t));
    function createFormSchema(t2) {
      const phoneRegex = /^(?:\+?(20|966))?0?\d{9,10}$/;
      return toTypedSchema(
        z.object({
          full_name: z.string({
            required_error: t2("schemaErrors.required_field_error")
          }).min(3, t2("schemaErrors.min")),
          phone: z.string({
            required_error: t2("schemaErrors.phone_reqired_error")
          }).refine((val) => phoneRegex.test(val), {
            message: t2("schemaErrors.phone_invalid_error")
          }),
          email: z.string({
            required_error: t2("schemaErrors.email_required_error")
          }).email(t2("schemaErrors.email_invalid_error")),
          cv: z.any().refine((file) => file instanceof File, {
            message: t2("schemaErrors.required_field_error")
          }).refine(
            (file) => file && [
              "application/pdf",
              "application/msword",
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
            ].includes(file.type),
            {
              message: t2("schemaErrors.file_type_error")
            }
          ),
          portfolio: z.string().url({ message: t2("schemaErrors.portfolio_invalid_error") }).optional(),
          current_salary: z.coerce.number({
            invalid_type_error: t2("schemaErrors.expected_salary_invalid_error")
          }).optional(),
          expected_salary: z.coerce.number({
            required_error: t2("schemaErrors.required_field_error"),
            invalid_type_error: t2("schemaErrors.expected_salary_invalid_error"),
            message: t2("schemaErrors.expected_salary_invalid_error")
          }).min(1, { message: t2("schemaErrors.required_field_error") })
        })
      );
    }
    const { handleSubmit, resetForm } = useForm({
      validationSchema: formSchema,
      validateOnMount: false
    });
    handleSubmit(async (values) => {
      var _a, _b;
      const { post } = useApi();
      try {
        loading.value = true;
        errorMessage.value = "";
        successMessage.value = "";
        const formData = new FormData();
        formData.append("name", values.full_name);
        formData.append("phone", values.phone);
        formData.append("email", values.email);
        formData.append("cv", values.cv);
        if (values.portfolio) {
          formData.append("portfolio_url", values.portfolio);
        }
        if (values.current_salary !== void 0) {
          formData.append("current_salary", values.current_salary.toString());
        }
        formData.append("expected_salary", values.expected_salary.toString());
        const utmPayload = getUTMPayload();
        if (utmPayload) {
          formData.append("utm", JSON.stringify(utmPayload));
        }
        await post(`jobs/${__props.slug}/apply`, formData, {
          headers: {
            "Content-Type": "multipart/form-data"
          }
        }).then((res) => {
          console.log(res.data.message);
        });
        successMessage.value = t("success_message");
        resetForm();
      } catch (err) {
        console.error("Form submission error:", err);
        errorMessage.value = ((_b = (_a = err == null ? void 0 : err.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || t("error_message");
        setTimeout(() => {
          errorMessage.value = "";
        }, 3e3);
      } finally {
        loading.value = false;
      }
    });
    return (_ctx, _push, _parent, _attrs) => {
      const _component_FormField = Field;
      const _component_FormItem = _sfc_main$2$1;
      const _component_FormLabel = _sfc_main$5;
      const _component_FormControl = _sfc_main$3$1;
      const _component_Input = _sfc_main$6;
      const _component_FormMessage = _sfc_main$1$1;
      const _component_SvgUploadIcon = __nuxt_component_6;
      const _component_Button = _sfc_main$7;
      _push(`<form${ssrRenderAttrs(mergeProps({ class: "mx-auto w-full space-y-3" }, _attrs))}><div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-1 xl: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 focus-visible:ring-0" }, componentField), 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 focus-visible:ring-0" }, componentField), 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.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 focus-visible:ring-0" }, componentField), 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.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 focus-visible:ring-0" }, componentField), 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: "phone",
        "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.phone_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.phone_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 focus-visible:ring-0" }, componentField), 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 focus-visible:ring-0" }, componentField), 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.phone_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 focus-visible:ring-0" }, componentField), 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.phone_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 focus-visible:ring-0" }, componentField), null, 16)
                    ]),
                    _: 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 sm:grid-cols-2 lg:grid-cols-1 xl: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 focus-visible:ring-0" }, componentField), 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 focus-visible:ring-0" }, componentField), 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 focus-visible:ring-0" }, componentField), 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 focus-visible:ring-0" }, componentField), 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: "portfolio",
        "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.portfolio_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.portfolio_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 focus-visible:ring-0" }, componentField), 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 focus-visible:ring-0" }, componentField), 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.portfolio_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 focus-visible:ring-0" }, componentField), 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.portfolio_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 focus-visible:ring-0" }, componentField), null, 16)
                    ]),
                    _: 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 sm:grid-cols-2 lg:grid-cols-1 xl:grid-cols-2">`);
      _push(ssrRenderComponent(_component_FormField, {
        name: "current_salary",
        "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.current_salary_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.current_salary_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 focus-visible:ring-0" }, componentField), 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 focus-visible:ring-0" }, componentField), 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.current_salary_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 focus-visible:ring-0" }, componentField), 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.current_salary_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 focus-visible:ring-0" }, componentField), 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: "expected_salary",
        "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.expected_salary_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.expected_salary_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 focus-visible:ring-0" }, componentField), 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 focus-visible:ring-0" }, componentField), 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.expected_salary_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 focus-visible:ring-0" }, componentField), 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.expected_salary_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 focus-visible:ring-0" }, componentField), null, 16)
                    ]),
                    _: 2
                  }, 1024),
                  createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                    createVNode(_component_FormMessage)
                  ])
                ]),
                _: 2
              }, 1024)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div><div>`);
      _push(ssrRenderComponent(_component_FormField, {
        name: "cv",
        "validate-on-blur": true,
        "validate-on-input": false
      }, {
        default: withCtx(({ componentField, handleChange, value }, _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.cv_label"))}`);
                      } else {
                        return [
                          createTextVNode(toDisplayString(_ctx.$t("labels.cv_label")), 1)
                        ];
                      }
                    }),
                    _: 2
                  }, _parent3, _scopeId2));
                  _push3(ssrRenderComponent(_component_FormControl, null, {
                    default: withCtx((_2, _push4, _parent4, _scopeId3) => {
                      if (_push4) {
                        _push4(`<input${ssrRenderAttrs(mergeProps({
                          ref_key: "fileInput",
                          ref: fileInput,
                          type: "file",
                          accept: ".pdf,.doc,.docx",
                          class: "hidden"
                        }, componentField))}${_scopeId3}><button type="button" class="!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 focus-visible:ring-0"${_scopeId3}>`);
                        if (value) {
                          _push4(`<div class="flex h-full items-center text-sm"${_scopeId3}><span${_scopeId3}>${ssrInterpolate(value.name)}</span></div>`);
                        } else {
                          _push4(`<div class="flex h-full items-center gap-2"${_scopeId3}>`);
                          _push4(ssrRenderComponent(_component_SvgUploadIcon, null, null, _parent4, _scopeId3));
                          _push4(`<span class="text-sm"${_scopeId3}>${ssrInterpolate(_ctx.$t("buttons.upload_cv"))}</span></div>`);
                        }
                        _push4(`</button>`);
                      } else {
                        return [
                          createVNode("input", mergeProps({
                            ref_key: "fileInput",
                            ref: fileInput,
                            type: "file",
                            accept: ".pdf,.doc,.docx",
                            class: "hidden"
                          }, componentField, {
                            onChange: (e) => {
                              var _a, _b;
                              return handleChange((_b = (_a = e.target) == null ? void 0 : _a.files) == null ? void 0 : _b[0]);
                            }
                          }), null, 16, ["onChange"]),
                          createVNode("button", {
                            type: "button",
                            class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 focus-visible:ring-0",
                            onClick: ($event) => {
                              var _a;
                              return (_a = unref(fileInput)) == null ? void 0 : _a.click();
                            }
                          }, [
                            value ? (openBlock(), createBlock("div", {
                              key: 0,
                              class: "flex h-full items-center text-sm"
                            }, [
                              createVNode("span", null, toDisplayString(value.name), 1)
                            ])) : (openBlock(), createBlock("div", {
                              key: 1,
                              class: "flex h-full items-center gap-2"
                            }, [
                              createVNode(_component_SvgUploadIcon),
                              createVNode("span", { class: "text-sm" }, toDisplayString(_ctx.$t("buttons.upload_cv")), 1)
                            ]))
                          ], 8, ["onClick"])
                        ];
                      }
                    }),
                    _: 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.cv_label")), 1)
                      ]),
                      _: 1
                    }),
                    createVNode(_component_FormControl, null, {
                      default: withCtx(() => [
                        createVNode("input", mergeProps({
                          ref_key: "fileInput",
                          ref: fileInput,
                          type: "file",
                          accept: ".pdf,.doc,.docx",
                          class: "hidden"
                        }, componentField, {
                          onChange: (e) => {
                            var _a, _b;
                            return handleChange((_b = (_a = e.target) == null ? void 0 : _a.files) == null ? void 0 : _b[0]);
                          }
                        }), null, 16, ["onChange"]),
                        createVNode("button", {
                          type: "button",
                          class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 focus-visible:ring-0",
                          onClick: ($event) => {
                            var _a;
                            return (_a = unref(fileInput)) == null ? void 0 : _a.click();
                          }
                        }, [
                          value ? (openBlock(), createBlock("div", {
                            key: 0,
                            class: "flex h-full items-center text-sm"
                          }, [
                            createVNode("span", null, toDisplayString(value.name), 1)
                          ])) : (openBlock(), createBlock("div", {
                            key: 1,
                            class: "flex h-full items-center gap-2"
                          }, [
                            createVNode(_component_SvgUploadIcon),
                            createVNode("span", { class: "text-sm" }, toDisplayString(_ctx.$t("buttons.upload_cv")), 1)
                          ]))
                        ], 8, ["onClick"])
                      ]),
                      _: 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.cv_label")), 1)
                    ]),
                    _: 1
                  }),
                  createVNode(_component_FormControl, null, {
                    default: withCtx(() => [
                      createVNode("input", mergeProps({
                        ref_key: "fileInput",
                        ref: fileInput,
                        type: "file",
                        accept: ".pdf,.doc,.docx",
                        class: "hidden"
                      }, componentField, {
                        onChange: (e) => {
                          var _a, _b;
                          return handleChange((_b = (_a = e.target) == null ? void 0 : _a.files) == null ? void 0 : _b[0]);
                        }
                      }), null, 16, ["onChange"]),
                      createVNode("button", {
                        type: "button",
                        class: "!bg-background border-input-border focus-visible:border-input-border h-[40px] rounded-sm border p-3 focus-visible:ring-0",
                        onClick: ($event) => {
                          var _a;
                          return (_a = unref(fileInput)) == null ? void 0 : _a.click();
                        }
                      }, [
                        value ? (openBlock(), createBlock("div", {
                          key: 0,
                          class: "flex h-full items-center text-sm"
                        }, [
                          createVNode("span", null, toDisplayString(value.name), 1)
                        ])) : (openBlock(), createBlock("div", {
                          key: 1,
                          class: "flex h-full items-center gap-2"
                        }, [
                          createVNode(_component_SvgUploadIcon),
                          createVNode("span", { class: "text-sm" }, toDisplayString(_ctx.$t("buttons.upload_cv")), 1)
                        ]))
                      ], 8, ["onClick"])
                    ]),
                    _: 2
                  }, 1024),
                  createVNode("div", { class: "text-destructive min-h-[20px] !text-sm" }, [
                    createVNode(_component_FormMessage)
                  ])
                ]),
                _: 2
              }, 1024)
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(`</div>`);
      _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(successMessage)) {
        _push(`<div class="text-center text-green-500">${ssrInterpolate(_ctx.$t("success_message"))}</div>`);
      } else {
        _push(`<!---->`);
      }
      if (unref(errorMessage)) {
        _push(`<div class="text-center text-red-500">${ssrInterpolate(unref(errorMessage))}</div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</form>`);
    };
  }
});
const _sfc_setup$2 = _sfc_main$2.setup;
_sfc_main$2.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/join-us/Form.vue");
  return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  __name: "FormSection",
  __ssrInlineRender: true,
  props: {
    slug: {}
  },
  setup(__props) {
    return (_ctx, _push, _parent, _attrs) => {
      const _component_SvgJobIcon = __nuxt_component_0$2;
      const _component_JoinUsForm = _sfc_main$2;
      _push(`<div${ssrRenderAttrs(mergeProps({ class: "bg-surface-background border-surface-border mx-auto w-full rounded-[12px] border p-8" }, _attrs))}><div class="mb-8 flex flex-col items-center justify-center gap-2">`);
      _push(ssrRenderComponent(_component_SvgJobIcon, { class: "h-[56px] w-[56px]" }, null, _parent));
      _push(`<h2 class="dark-text-gradient text-2xl">${ssrInterpolate(_ctx.$t("joinUs.title"))}</h2></div>`);
      _push(ssrRenderComponent(_component_JoinUsForm, { slug: _ctx.slug }, null, _parent));
      _push(`</div>`);
    };
  }
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/join-us/FormSection.vue");
  return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const baseUrl = "https://webstdy.com";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "[slug]",
  __ssrInlineRender: true,
  setup(__props) {
    const slug = useRoute().params.slug;
    const { data: jobData, isPending } = useJobQuery(slug);
    const { locale } = useI18n();
    const setI18nParams = useSetI18nParams();
    const pageTitle = computed(() => {
      var _a;
      return (_a = jobData.value) == null ? void 0 : _a.title;
    });
    const pageDescription = computed(() => {
      var _a;
      return (_a = jobData.value) == null ? void 0 : _a.description;
    });
    const arUrl = computed(
      () => {
        var _a;
        return ((_a = jobData.value) == null ? void 0 : _a.slug_ar) ? `${baseUrl}/join-us/${jobData.value.slug_ar}` : "";
      }
    );
    const enUrl = computed(
      () => {
        var _a;
        return ((_a = jobData.value) == null ? void 0 : _a.slug_en) ? `${baseUrl}/en/join-us/${jobData.value.slug_en}` : "";
      }
    );
    const canonicalUrl = computed(
      () => locale.value === "ar" ? arUrl.value : enUrl.value
    );
    useSeoMeta({
      title: pageTitle,
      description: pageDescription,
      ogTitle: pageTitle,
      ogDescription: pageDescription
    });
    useHead(() => ({
      link: jobData.value ? [
        { rel: "canonical", href: canonicalUrl.value },
        { rel: "alternate", hreflang: "x-default", href: arUrl.value },
        { rel: "alternate", hreflang: "ar", href: arUrl.value },
        { rel: "alternate", hreflang: "en", href: enUrl.value }
      ] : []
    }));
    watch(
      jobData,
      (newJobData) => {
        if (newJobData) {
          const currentSlug = useRoute().params.slug;
          const targetSlug = locale.value === "ar" ? newJobData.slug_ar : newJobData.slug_en;
          if (currentSlug !== targetSlug) {
            navigateTo(
              {
                name: "join-us-slug",
                params: { slug: targetSlug }
              },
              {
                redirectCode: 301,
                external: true
              }
            );
          }
          setI18nParams({
            ar: { slug: newJobData.slug_ar },
            en: { slug: newJobData.slug_en }
          });
        }
      },
      { immediate: true }
    );
    return (_ctx, _push, _parent, _attrs) => {
      var _a, _b;
      const _component_GlobalLoader = __nuxt_component_0;
      const _component_InternalHeaderSection = __nuxt_component_0$1;
      const _component_JoinUsJobDetails = __nuxt_component_2;
      const _component_JoinUsFormSection = _sfc_main$1;
      const _component_SubscribeSection = __nuxt_component_3;
      _push(`<main${ssrRenderAttrs(_attrs)}>`);
      if (unref(isPending)) {
        _push(ssrRenderComponent(_component_GlobalLoader, null, null, _parent));
      } else {
        _push(`<!---->`);
      }
      if (!unref(isPending)) {
        _push(ssrRenderComponent(_component_InternalHeaderSection, {
          "video-url": "/videos/join-us.mp4",
          pages: [
            { name: _ctx.$t("joinus"), link: "/join-us" },
            { name: unref(jobData).title }
          ]
        }, {
          title: withCtx((_, _push2, _parent2, _scopeId) => {
            var _a2, _b2, _c, _d, _e, _f;
            if (_push2) {
              _push2(`<h1${_scopeId}>${ssrInterpolate((_a2 = unref(jobData)) == null ? void 0 : _a2.title)}</h1><div class="dark-text-gradient text-center text-[20px]"${_scopeId}><span${_scopeId}>${ssrInterpolate((_b2 = unref(jobData)) == null ? void 0 : _b2.location)}</span><span class="mx-2 inline-block"${_scopeId}>|</span><span${_scopeId}>${ssrInterpolate((_c = unref(jobData)) == null ? void 0 : _c.type)}</span></div>`);
            } else {
              return [
                createVNode("h1", null, toDisplayString((_d = unref(jobData)) == null ? void 0 : _d.title), 1),
                createVNode("div", { class: "dark-text-gradient text-center text-[20px]" }, [
                  createVNode("span", null, toDisplayString((_e = unref(jobData)) == null ? void 0 : _e.location), 1),
                  createVNode("span", { class: "mx-2 inline-block" }, "|"),
                  createVNode("span", null, toDisplayString((_f = unref(jobData)) == null ? void 0 : _f.type), 1)
                ])
              ];
            }
          }),
          _: 1
        }, _parent));
      } else {
        _push(`<!---->`);
      }
      _push(`<section class="bg-gradient-odd py-section"><div class="relative container mx-auto grid gap-6 px-4 lg:grid-cols-2">`);
      if ((_a = unref(jobData)) == null ? void 0 : _a.description) {
        _push(ssrRenderComponent(_component_JoinUsJobDetails, {
          "job-details": (_b = unref(jobData)) == null ? void 0 : _b.description
        }, null, _parent));
      } else {
        _push(`<!---->`);
      }
      _push(ssrRenderComponent(_component_JoinUsFormSection, {
        slug: unref(slug),
        class: "static top-[90px] h-fit lg:sticky"
      }, null, _parent));
      _push(`</div></section><div class="bg-gradient-even pb-section px-4">`);
      _push(ssrRenderComponent(_component_SubscribeSection, null, null, _parent));
      _push(`</div></main>`);
    };
  }
});
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/join-us/[slug].vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};

export { _sfc_main as default };
//# sourceMappingURL=_slug_-J3PgThkx.mjs.map
