import { _ as __nuxt_component_49 } from './MainLoader-BFnVrwHB.mjs';
import { T as Title } from './components-BFogvFSQ.mjs';
import { _ as _sfc_main$1 } from './PlayVideo-YRE_Sr6i.mjs';
import { _ as _sfc_main$2 } from './MainModal-CspCWVZB.mjs';
import { ref, withAsyncContext, unref, withCtx, createTextVNode, toDisplayString, openBlock, createBlock, withModifiers, createCommentVNode, useSSRContext } from 'vue';
import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate, ssrRenderAttr, ssrRenderList, ssrRenderTeleport } from 'vue/server-renderer';
import { a as _export_sfc, u as useI18n, c as useHead, b as useNuxtApp, g as useRoute, d as useLazyAsyncData, f as useRuntimeConfig } from './server.mjs';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:fs';
import 'node:url';
import 'ipx';
import 'node:path';
import 'unhead';
import '@unhead/shared';
import 'vue-router';
import 'vue-social-sharing';
import 'axios';
import '@headlessui/vue';
import 'yup';

const _sfc_main = {
  __name: "index",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    const { locale, t } = useI18n();
    useHead({
      title: t("NAV.media")
    });
    const config = useRuntimeConfig();
    const showMediaVal = ref(false);
    const media_src = ref(null);
    const axios = useNuxtApp().$axios;
    const route = useRoute();
    const { data: pageData, error, pending } = ([__temp, __restore] = withAsyncContext(() => useLazyAsyncData(
      `project-medias`,
      () => axios.get(`project-medias/${route.params.slug}`, {
        baseURL: config.public.baseURL,
        headers: {
          "Accept-Language": locale.value
        }
      }).then((res) => res.data.data)
    )), __temp = await __temp, __restore(), __temp);
    return (_ctx, _push, _parent, _attrs) => {
      const _component_MainLoader = __nuxt_component_49;
      const _component_Title = Title;
      const _component_play_video = _sfc_main$1;
      const _component_main_modal = _sfc_main$2;
      _push(`<div${ssrRenderAttrs(_attrs)} data-v-07dd780c>`);
      if (unref(pending)) {
        _push(ssrRenderComponent(_component_MainLoader, null, null, _parent));
      } else {
        _push(`<!---->`);
      }
      if (unref(pageData)) {
        _push(`<div class="container" data-v-07dd780c>`);
        _push(ssrRenderComponent(_component_Title, null, {
          default: withCtx((_, _push2, _parent2, _scopeId) => {
            if (_push2) {
              _push2(`${ssrInterpolate(unref(pageData).title ? unref(pageData).title : unref(t)("NAV.media"))}`);
            } else {
              return [
                createTextVNode(toDisplayString(unref(pageData).title ? unref(pageData).title : unref(t)("NAV.media")), 1)
              ];
            }
          }),
          _: 1
        }, _parent));
        _push(`<div class="flex items-center justify-center py-2" data-v-07dd780c><img${ssrRenderAttr("src", unref(pageData).logo[0].media_trans)}${ssrRenderAttr("alt", unref(pageData).logo[0].alt)} width="130" height="65" loading="lazy" data-v-07dd780c></div><div class="grid md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-4 gap-5 pb-10 gallary" data-v-07dd780c><!--[-->`);
        ssrRenderList(unref(pageData).videos, (item) => {
          _push(`<div class="rounded-2xl h-[400px] video-overlay" data-v-07dd780c>`);
          _push(ssrRenderComponent(_component_play_video, {
            url: true,
            src: item.short_link
          }, null, _parent));
          _push(`</div>`);
        });
        _push(`<!--]--></div></div>`);
      } else {
        _push(`<!---->`);
      }
      ssrRenderTeleport(_push, (_push2) => {
        if (unref(showMediaVal)) {
          _push2(ssrRenderComponent(_component_main_modal, {
            onClose: ($event) => showMediaVal.value = false
          }, {
            default: withCtx((_, _push3, _parent2, _scopeId) => {
              if (_push3) {
                if (unref(media_src)) {
                  _push3(ssrRenderComponent(_component_play_video, {
                    url: true,
                    src: unref(media_src),
                    onClick: () => {
                    }
                  }, null, _parent2, _scopeId));
                } else {
                  _push3(`<!---->`);
                }
              } else {
                return [
                  unref(media_src) ? (openBlock(), createBlock(_component_play_video, {
                    key: 0,
                    url: true,
                    src: unref(media_src),
                    onClick: withModifiers(() => {
                    }, ["stop"])
                  }, null, 8, ["src", "onClick"])) : createCommentVNode("", true)
                ];
              }
            }),
            _: 1
          }, _parent));
        } else {
          _push2(`<!---->`);
        }
      }, "body", false, _parent);
      _push(`</div>`);
    };
  }
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
  const ssrContext = useSSRContext();
  (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/media/[slug]/videos/index.vue");
  return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-07dd780c"]]);

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