406 lines
19 KiB
JavaScript
406 lines
19 KiB
JavaScript
import { defineComponent, computed, unref, ref, watch, mergeProps, withAsyncContext, provide, useSSRContext } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/vue/index.mjs';
|
|
import { ssrRenderComponent, ssrRenderAttrs, ssrInterpolate, ssrRenderList, ssrRenderStyle } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/vue/server-renderer/index.mjs';
|
|
import { a as useConfigStore, u as useRouter$1, b as useUserStore, o as useCartStore, p as usePriceStore, _ as __nuxt_component_0$1, m as useIntersectionObserver, n as getToken, d as api$1 } from './server.mjs';
|
|
import { u as usePrice } from './usePrice-_QzChhgO.mjs';
|
|
import { P as Post, _ as _sfc_main$7 } from './PostCardSkeleton-DAYpOwlx.mjs';
|
|
import { C as CommentAddEdit, _ as _sfc_main$8, d as deletePostLike, c as createPostLike } from './moreOptionProduct-CCkPwsB0.mjs';
|
|
import { d as deleteSave, c as createSave } from './save-DsCeVVYe.mjs';
|
|
import { u as useProductStore } from './product-DgF2C5vR.mjs';
|
|
import { u as useMediaStore } from './media-D7PFhdrG.mjs';
|
|
import { u as useAsyncData } from './asyncData-Iix-4nDI.mjs';
|
|
import { storeToRefs } from 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/pinia/dist/pinia.prod.cjs';
|
|
import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs';
|
|
import { _ as _sfc_main$6 } from './FullScreenStories-nkUmovER.mjs';
|
|
import { U as UserProfilePic } from './UserProfilePic-DaZ03Xcl.mjs';
|
|
import { _ as __nuxt_component_2 } from './index-Czz3hSzg.mjs';
|
|
import 'node:http';
|
|
import 'node:https';
|
|
import '../nitro/nitro.mjs';
|
|
import 'node:events';
|
|
import 'node:buffer';
|
|
import 'node:fs';
|
|
import 'node:path';
|
|
import 'node:crypto';
|
|
import 'node:url';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/consola/dist/index.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/ipx/dist/index.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@supabase/supabase-js/dist/main/index.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/axios/index.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/lodash-es/lodash.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@babel/runtime/helpers/esm/extends.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@babel/runtime/helpers/esm/objectSpread2.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@ant-design/colors/dist/index.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@ctrl/tinycolor/dist/public_api.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/stylis/index.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/vue-types/dist/vue-types.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@ant-design/icons-vue/lib/index.js';
|
|
import '../routes/renderer.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/vue-bundle-renderer/dist/runtime.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@nuxt/nitro-server/node_modules/vue/server-renderer/index.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/unhead/dist/server.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/devalue/index.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/unhead/dist/utils.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@unhead/vue/node_modules/vue/index.mjs';
|
|
import './empty_user-DSxcM_ac.mjs';
|
|
import './useDateTime-D8RCoGwW.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/moment/moment.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/moment-timezone/index.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/moment-jalaali/index.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/date-fns/index.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/date-fns/locale.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/swiper/swiper-vue.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/swiper/modules/index.mjs';
|
|
import './post_loading-CMOcYm9B.mjs';
|
|
import './BasicIconOld-93vAWohq.mjs';
|
|
import './like-B155RLSm.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/vue-content-loader/dist/vue-content-loader.cjs.js';
|
|
import './index-m5qbBl98.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@vueuse/gesture/dist/index.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/@headlessui/vue/dist/headlessui.esm.js';
|
|
import './index-BWBnVq-W.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/framesync/dist/es/index.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/popmotion/dist/es/index.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/style-value-types/dist/es/index.mjs';
|
|
import './BasicButton-DhQvSD8U.mjs';
|
|
import './index-BMAjr3Fm.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/throttle-debounce/esm/index.js';
|
|
import './index-Bn4rLj9V.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/dom-align/dist-node/index.js';
|
|
import './index-D-yl9XJT.mjs';
|
|
import './shallowequal-BEyWmMEh.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/lodash-es/uniq.js';
|
|
import './index-G65aBv4F.mjs';
|
|
import './FormItemContext-BlKvWASA.mjs';
|
|
import './index-BGahPE0Z.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/lodash-es/isPlainObject.js';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/resize-observer-polyfill/dist/ResizeObserver.js';
|
|
import './index-BTMNH22J.mjs';
|
|
import './media-_NDkNIvH.mjs';
|
|
import 'file:///mnt/new-volume-7/vue_projects/montify/montify/node_modules/perfect-debounce/dist/index.mjs';
|
|
import './BasicInput-rlXkJMLE.mjs';
|
|
import '../_/CheckOutlined.mjs';
|
|
import './useRefs-BHKrVg4I.mjs';
|
|
|
|
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
__name: "InstallButton",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
ref(false);
|
|
ref(null);
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_ClientOnly = __nuxt_component_0$1;
|
|
_push(ssrRenderComponent(_component_ClientOnly, _attrs, {}, _parent));
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup$5 = _sfc_main$5.setup;
|
|
_sfc_main$5.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/InstallButton.vue");
|
|
return _sfc_setup$5 ? _sfc_setup$5(props, ctx) : void 0;
|
|
};
|
|
const __nuxt_component_0 = Object.assign(_sfc_main$5, { __name: "InstallButton" });
|
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
__name: "Logo",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const config = useConfigStore();
|
|
const logoSrc = computed(
|
|
() => config.isNightStore ? config.useLogo("logo_full_white.png") : config.useLogo("logo_full.png")
|
|
);
|
|
const showFallback = ref(false);
|
|
watch(logoSrc, () => {
|
|
showFallback.value = false;
|
|
});
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
if (showFallback.value) {
|
|
_push(`<span${ssrRenderAttrs(_attrs)}>${ssrInterpolate(unref(config).appName.en)}</span>`);
|
|
} else {
|
|
_push(`<img${ssrRenderAttrs(mergeProps({
|
|
src: logoSrc.value,
|
|
alt: unref(config).appName.en,
|
|
class: "inline"
|
|
}, _attrs))}>`);
|
|
}
|
|
};
|
|
}
|
|
});
|
|
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/Logo.vue");
|
|
return _sfc_setup$4 ? _sfc_setup$4(props, ctx) : void 0;
|
|
};
|
|
const Logo = Object.assign(_sfc_main$4, { __name: "Logo" });
|
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
__name: "Posts",
|
|
__ssrInlineRender: true,
|
|
props: {
|
|
userPostScroll: {},
|
|
scrollSave: {}
|
|
},
|
|
async setup(__props) {
|
|
let __temp, __restore;
|
|
const props = __props;
|
|
const user = useUserStore();
|
|
const media = useMediaStore();
|
|
const percent = useProductStore();
|
|
const router = useRouter$1();
|
|
const config = useConfigStore();
|
|
ref(100);
|
|
const { posts, endPage } = storeToRefs(media);
|
|
ref(0);
|
|
const loading = ref(false);
|
|
const addLikeLoading = ref(false);
|
|
const commentPostId = ref();
|
|
const commentVisible = ref(false);
|
|
const optionVisible = ref(false);
|
|
const optionPostId = ref();
|
|
const ownerPostId = ref();
|
|
computed(() => props.userPostScroll === "userPostScroll");
|
|
const present = computed(() => percent.percentUpload);
|
|
function handleLike(isLiked, id) {
|
|
try {
|
|
addLikeLoading.value = true;
|
|
if (getToken()) {
|
|
if (isLiked) {
|
|
deletePostLike(id);
|
|
const index = posts.value.findIndex((x) => x.id === id);
|
|
posts.value[index]?.likes.splice(posts.value[index].likes?.findIndex((y) => y.user_id === user.user.id));
|
|
} else {
|
|
createPostLike(id);
|
|
const index = posts.value.findIndex((x) => x.id === id);
|
|
posts.value[index]?.likes.push({
|
|
product_id: id,
|
|
user_id: user.user.id
|
|
});
|
|
}
|
|
} else {
|
|
router.push({ name: "auth-login" });
|
|
api$1.warn(config.useString("pleaseLoginOrRegister"));
|
|
}
|
|
} catch (e) {
|
|
console.log(e);
|
|
} finally {
|
|
addLikeLoading.value = false;
|
|
}
|
|
}
|
|
function addCommentId(id) {
|
|
posts.value[posts.value.findIndex((x) => x.id === commentPostId.value)]?.comments.push({ id });
|
|
}
|
|
function deleteCommentId() {
|
|
posts.value[posts.value.findIndex((x) => x.id === commentPostId.value)]?.comments.splice(0, 1);
|
|
}
|
|
function handleSave(isSaved, id) {
|
|
if (getToken()) {
|
|
if (isSaved) {
|
|
deleteSave(id);
|
|
const index = posts.value.findIndex((x) => x.id === id);
|
|
posts.value[index]?.saved.splice(posts.value[index].saved?.findIndex((y) => y.user_id === user.user.id));
|
|
} else {
|
|
createSave(id);
|
|
const index = posts.value.findIndex((x) => x.id === id);
|
|
posts.value[index]?.saved.push({
|
|
product_id: id,
|
|
user_id: user.user.id
|
|
});
|
|
}
|
|
} else {
|
|
router.push({ name: "auth-login" });
|
|
api$1.warn(config.useString("pleaseLoginOrRegister"));
|
|
}
|
|
}
|
|
function openOption(id) {
|
|
optionPostId.value = id;
|
|
optionVisible.value = true;
|
|
}
|
|
function openComment(id, owner_id) {
|
|
commentPostId.value = id;
|
|
commentVisible.value = true;
|
|
ownerPostId.value = owner_id;
|
|
}
|
|
provide("ownerPostId", ownerPostId);
|
|
const { data } = ([__temp, __restore] = withAsyncContext(() => useAsyncData("posts", () => media.loadPosts(1))), __temp = await __temp, __restore(), __temp);
|
|
const observer = ref();
|
|
useIntersectionObserver(observer, async (entries) => {
|
|
const entry = entries[0];
|
|
if (!entry) return;
|
|
if (entry.isIntersecting && !media.loading && !media.endPage) {
|
|
await media.loadPosts(media.currentPage + 1);
|
|
}
|
|
});
|
|
computed(() => router.currentRoute.value.query.target || null);
|
|
watch(present, () => {
|
|
if (present.value == 100) {
|
|
media.reset();
|
|
media.loadPosts(1);
|
|
}
|
|
});
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(`<!--[--><div class="mt-5 pb-5vh" data-v-ae1841bb><!--[-->`);
|
|
ssrRenderList(unref(posts), (post, index) => {
|
|
_push(ssrRenderComponent(Post, {
|
|
onOpenOption: openOption,
|
|
onOpenComment: openComment,
|
|
onHandleLike: handleLike,
|
|
onHandleSave: handleSave,
|
|
index,
|
|
post,
|
|
key: index,
|
|
scrollSave: __props.scrollSave,
|
|
"add-like-loading": addLikeLoading.value
|
|
}, null, _parent));
|
|
});
|
|
_push(`<!--]-->`);
|
|
if (loading.value) {
|
|
_push(ssrRenderComponent(_sfc_main$7, null, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`<div class="w-full opacity-0 relative" style="${ssrRenderStyle(!loading.value ? null : { display: "none" })}" data-v-ae1841bb> load </div></div>`);
|
|
_push(ssrRenderComponent(CommentAddEdit, {
|
|
id: commentPostId.value,
|
|
open: commentVisible.value,
|
|
"onUpdate:open": ($event) => commentVisible.value = $event,
|
|
onAddCommentId: addCommentId,
|
|
onDeleteCommentId: deleteCommentId
|
|
}, null, _parent));
|
|
_push(ssrRenderComponent(_sfc_main$8, {
|
|
id: optionPostId.value,
|
|
open: optionVisible.value,
|
|
"onUpdate:open": ($event) => optionVisible.value = $event
|
|
}, null, _parent));
|
|
_push(`<!--]-->`);
|
|
};
|
|
}
|
|
});
|
|
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("views/base/pages/home/components/Posts.vue");
|
|
return _sfc_setup$3 ? _sfc_setup$3(props, ctx) : void 0;
|
|
};
|
|
const Posts = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-ae1841bb"]]);
|
|
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
__name: "CustomStories",
|
|
__ssrInlineRender: true,
|
|
async setup(__props) {
|
|
let __temp, __restore;
|
|
const selectedStoryId = ref(null);
|
|
ref(null);
|
|
ref(false);
|
|
const mediaStore = useMediaStore();
|
|
const userStore = useUserStore();
|
|
const { data } = ([__temp, __restore] = withAsyncContext(() => useAsyncData("story", () => mediaStore.getList())), __temp = await __temp, __restore(), __temp);
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(`<div${ssrRenderAttrs(mergeProps({ class: "stories-container -ms4" }, _attrs))} data-v-c6b78541><div class="scroll-wrapper ps-4" data-v-c6b78541><!--[-->`);
|
|
ssrRenderList(unref(mediaStore).users, (user) => {
|
|
_push(`<div class="story" data-v-c6b78541>`);
|
|
_push(ssrRenderComponent(UserProfilePic, {
|
|
src: user.avatar,
|
|
seenStory: !user?.stories?.length || user.stories.every((item) => item.storyviews.find((_item) => _item.user_id === unref(userStore).user?.id || _item.user_id === "me")),
|
|
showAdd: user.id === unref(userStore).user?.id
|
|
}, null, _parent));
|
|
_push(`<div class="w-full text-center mt1 text-xs truncate" data-v-c6b78541>${ssrInterpolate(user.name)}</div></div>`);
|
|
});
|
|
_push(`<!--]--></div>`);
|
|
if (selectedStoryId.value) {
|
|
_push(ssrRenderComponent(_sfc_main$6, {
|
|
id: selectedStoryId.value,
|
|
"onUpdate:id": ($event) => selectedStoryId.value = $event
|
|
}, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div>`);
|
|
};
|
|
}
|
|
});
|
|
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("views/base/pages/home/components/CustomStories.vue");
|
|
return _sfc_setup$2 ? _sfc_setup$2(props, ctx) : void 0;
|
|
};
|
|
const CustomStories = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-c6b78541"]]);
|
|
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
__name: "index",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
const config = useConfigStore();
|
|
const percent = useProductStore();
|
|
useRouter$1();
|
|
useUserStore();
|
|
useCartStore();
|
|
const onlinePrices = usePriceStore();
|
|
const header = config.TEXT_HEADER;
|
|
const tala18 = computed(() => {
|
|
return onlinePrices?.prices.find((x) => x?.id_key === "8-geram18")?.price;
|
|
});
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
const _component_InstallButton = __nuxt_component_0;
|
|
const _component_ClientOnly = __nuxt_component_0$1;
|
|
const _component_AProgress = __nuxt_component_2;
|
|
_push(`<div${ssrRenderAttrs(_attrs)}><div class="absolute top-0 w-inherit right-0 left-0 h-screen overflow-hidden overflow-y-hidden flex flex-col"><div class="flex-col flex overflow-hidden flex-shrink-0"><div class="flex justify-between w-full p-4">`);
|
|
_push(ssrRenderComponent(Logo, { class: "h-2rem" }, null, _parent));
|
|
_push(`<div class="flex items-center gap-3">`);
|
|
if (unref(config).APP_HAS_GOLD && unref(config).PRICE_HEADER && unref(tala18)) {
|
|
_push(`<div class="border-1 border-solid p-2px rounded"><div class="font-semibold flex gap-1">${ssrInterpolate(
|
|
// usePrice((tala18/1000)?? 0,true,'')
|
|
("usePrice" in _ctx ? _ctx.usePrice : unref(usePrice))(unref(tala18) / 10, true, "")
|
|
)} <div class="text-xs text-center w-full">${ssrInterpolate(unref(config).useString("toman"))}</div></div><div class="text-xs text-center">${ssrInterpolate(unref(config).useString("goldGramPrice"))}</div></div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(ssrRenderComponent(_component_InstallButton, { class: "w-10" }, null, _parent));
|
|
_push(ssrRenderComponent(_component_ClientOnly, null, {}, _parent));
|
|
_push(`</div></div><div class="flex justify-between"></div>`);
|
|
if (unref(header) != "") {
|
|
_push(`<div class="text-center pb-2 leading-relaxed text-xs">${unref(header) ?? ""}</div>`);
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(`</div><div class="flex-1 overflow-y-auto overflow-x-hidden pb-10vh scrollHome min-h-0">`);
|
|
_push(ssrRenderComponent(CustomStories, { class: "" }, null, _parent));
|
|
if (unref(percent).percentUpload != 100 && unref(percent).loading) {
|
|
_push(ssrRenderComponent(_component_AProgress, {
|
|
percent: unref(percent).percentUpload,
|
|
"show-info": false,
|
|
status: "active",
|
|
size: "small"
|
|
}, null, _parent));
|
|
} else {
|
|
_push(`<!---->`);
|
|
}
|
|
_push(ssrRenderComponent(Posts, {
|
|
"user-post-scroll": "scrollHome",
|
|
"scroll-save": "scrollPosition"
|
|
}, null, _parent));
|
|
_push(`</div></div></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("views/base/pages/home/index.vue");
|
|
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
|
};
|
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
__name: "index",
|
|
__ssrInlineRender: true,
|
|
setup(__props) {
|
|
return (_ctx, _push, _parent, _attrs) => {
|
|
_push(ssrRenderComponent(_sfc_main$1, _attrs, null, _parent));
|
|
};
|
|
}
|
|
});
|
|
const _sfc_setup = _sfc_main.setup;
|
|
_sfc_main.setup = (props, ctx) => {
|
|
const ssrContext = useSSRContext();
|
|
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/home/index.vue");
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
};
|
|
|
|
export { _sfc_main as default };
|