Files
appco_dist/.output/server/chunks/build/_id_-dNslld0o.mjs
T

1889 lines
70 KiB
JavaScript

import { defineComponent, computed, withAsyncContext, unref, mergeProps, ref, reactive, withCtx, createVNode, watch, resolveDirective, createBlock, openBlock, toDisplayString, createTextVNode, shallowRef, inject, provide, nextTick, Transition, withDirectives, vShow, useSSRContext } from 'vue';
import { ssrRenderComponent, ssrRenderAttrs, ssrRenderAttr, ssrInterpolate, ssrRenderList, ssrGetDirectiveProps, ssrRenderStyle, ssrRenderSlot } from 'vue/server-renderer';
import { u as useRouter$1, a as useConfigStore, b as useUserStore, aQ as getOneUser, f as loading, B as useElementSize, p as useCartStore, n as useIntersectionObserver, q as APP_TYPE, t as reactiveProjectName, o as getToken, C as getSupabaseStorageUrl, aa as withInstall, L as initDefaultProps, E as useConfigInject, F as genComponentStyleHook, aD as devWarning, H as classNames, ap as getTransitionProps, ad as getTransitionName, G as omit, aR as NoCompactStyle, P as PropTypes, M as objectType, a0 as merge, ak as Portal, X as functionType, I as arrayType, a6 as getPropsSlot, S as KeyCode, as as CloseOutlined } from './server.mjs';
import { _ as _imports_0, a as _imports_1 } from './cart-DMkYna66.mjs';
import { _ as __nuxt_component_1, a as _sfc_main$6, b as _imports_2, c as _imports_3, d as _sfc_main$5$1, H as Highlights } from './Highlights-BBCbV9vc.mjs';
import { B as BasicIconOld } from './BasicIconOld-93vAWohq.mjs';
import numbro from 'numbro';
import { B as BasicButton } from './BasicButton-DjnsWEoH.mjs';
import { U as UserProfilePic } from './UserProfilePic-DmMhGlDO.mjs';
import { l as loadGray, S as SquarePostSkeleton } from './gray-aGBk9il7.mjs';
import { u as useMediaStore } from './media-g_JiA7fA.mjs';
import { _ as _sfc_main$7 } from './FullScreenStories-PlbP0ebP.mjs';
import { u as useUserPostStore } from './userPostsStore-6qqHC3AK.mjs';
import { u as useAsyncData } from './asyncData-DGiCewbG.mjs';
import { B as Badge, i as isNumeric } from './index-DPz-pTqF.mjs';
import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
import _extends from '@babel/runtime/helpers/esm/extends';
import { _ as __nuxt_component_4 } from './index-kFKdqKf9.mjs';
import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs';
import { _ as _sfc_main$8 } from './OrdersList-DJpXKchl.mjs';
import { _ as _sfc_main$9 } from './SavedList-D6_VcM_m.mjs';
import { u as usePrice } from './usePrice-B-5-jXKQ.mjs';
import { t as toJalali } from './useDateTime-D8RCoGwW.mjs';
import { T as Tabs, _ as __nuxt_component_2$1 } from './index-Dka00L3X.mjs';
import { ContentLoader } from 'vue-content-loader';
import '../_/nitro.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:fs';
import 'node:url';
import 'consola';
import 'ipx';
import 'node:path';
import 'node:crypto';
import 'pinia';
import '@supabase/supabase-js';
import '@ant-design/colors';
import '@ctrl/tinycolor';
import 'stylis';
import 'vue-types';
import 'lodash-es';
import 'axios';
import '@ant-design/icons-vue';
import '../routes/renderer.mjs';
import 'vue-bundle-renderer/runtime';
import 'unhead/server';
import 'devalue';
import 'unhead/utils';
import './index-TzujBed1.mjs';
import './raf-ruCY1ktO.mjs';
import 'dom-align';
import './media-B5mop_Ew.mjs';
import 'swiper/vue';
import './empty_user-BaUNCdgf.mjs';
import './post_loading-BiySI7bp.mjs';
import './index-CX0dq7oe.mjs';
import '@vueuse/gesture';
import '@headlessui/vue';
import 'framesync';
import 'popmotion';
import 'style-value-types';
import './index-C7TNxeFB.mjs';
import 'throttle-debounce';
import './BasicInput-Blh68VTZ.mjs';
import './index-Dd0_mp7p.mjs';
import './FormItemContext-CR0UDjwx.mjs';
import './statusUtils-TdjbCkOy.mjs';
import './BaseInput-8pfzphkE.mjs';
import 'resize-observer-polyfill';
import './index-PQFDA1Lj.mjs';
import '../_/SearchOutlined.mjs';
import 'lodash-es/isPlainObject.js';
import './like-BhIOg3YL.mjs';
import 'swiper/modules';
import './save-C7QepgSS.mjs';
import 'moment';
import 'moment-timezone';
import 'moment-jalaali';
import 'date-fns';
import 'date-fns/locale';
import './index-Dl3x779O.mjs';
import './shallowequal-DbdDzF9p.mjs';
import 'lodash-es/uniq.js';
import './Overflow-DfCwiuVq.mjs';
import './collapseMotion-cQ2SGjCA.mjs';
import './slide-DWlovEng.mjs';
import './useRefs-BHKrVg4I.mjs';
import 'lodash-es/pick.js';
import './useMergedState-BZEfJ8Fl.mjs';
const props = () => ({
prefixCls: String,
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
style: {
type: Object,
default: void 0
},
class: String,
rootClassName: String,
rootStyle: objectType(),
placement: {
type: String
},
wrapperClassName: String,
level: {
type: [String, Array]
},
levelMove: {
type: [Number, Function, Array]
},
duration: String,
ease: String,
showMask: {
type: Boolean,
default: void 0
},
maskClosable: {
type: Boolean,
default: void 0
},
maskStyle: {
type: Object,
default: void 0
},
afterVisibleChange: Function,
keyboard: {
type: Boolean,
default: void 0
},
contentWrapperStyle: arrayType(),
autofocus: {
type: Boolean,
default: void 0
},
open: {
type: Boolean,
default: void 0
},
// Motion
motion: functionType(),
maskMotion: objectType()
});
const drawerProps$1 = () => _extends(_extends({}, props()), {
forceRender: {
type: Boolean,
default: void 0
},
getContainer: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.object, PropTypes.looseBool])
});
const drawerChildProps = () => _extends(_extends({}, props()), {
getContainer: Function,
getOpenCount: Function,
scrollLocker: PropTypes.any,
inline: Boolean
});
var __rest$2 = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const DrawerChild = defineComponent({
compatConfig: {
MODE: 3
},
inheritAttrs: false,
props: drawerChildProps(),
emits: ["close", "handleClick", "change"],
setup(props2, _ref) {
let {
emit,
slots
} = _ref;
const contentWrapper = shallowRef();
const dom = shallowRef();
const maskDom = shallowRef();
const handlerDom = shallowRef();
const contentDom = shallowRef();
`drawer_id_${Number((Date.now() + Math.random()).toString().replace(".", Math.round(Math.random() * 9).toString())).toString(16)}`;
watch(() => props2.level, () => {
getLevelDom(props2);
}, {
flush: "post"
});
watch(() => props2.open, () => {
const {
open,
getContainer,
scrollLocker,
showMask,
autofocus
} = props2;
const container = getContainer === null || getContainer === void 0 ? void 0 : getContainer();
if (container && container.parentNode === (void 0).body) ;
if (open) {
if (autofocus) {
domFocus();
}
if (showMask) {
scrollLocker === null || scrollLocker === void 0 ? void 0 : scrollLocker.lock();
}
} else {
scrollLocker === null || scrollLocker === void 0 ? void 0 : scrollLocker.unLock();
}
}, {
flush: "post"
});
watch(() => props2.placement, (val) => {
if (val) {
contentDom.value = null;
}
});
const domFocus = () => {
var _a, _b;
(_b = (_a = dom.value) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
};
const onClose = (e) => {
emit("close", e);
};
const onKeyDown = (e) => {
if (e.keyCode === KeyCode.ESC) {
e.stopPropagation();
onClose(e);
}
};
const onAfterVisibleChange = () => {
const {
open,
afterVisibleChange
} = props2;
if (afterVisibleChange) {
afterVisibleChange(!!open);
}
};
const getLevelDom = (_ref2) => {
let {
level,
getContainer
} = _ref2;
{
return;
}
};
const onHandleClick = (e) => {
emit("handleClick", e);
};
const canOpen = shallowRef(false);
watch(dom, () => {
nextTick(() => {
canOpen.value = true;
});
});
return () => {
var _a, _b;
const {
width,
height,
open: $open,
prefixCls,
placement,
level,
levelMove,
ease,
duration,
getContainer,
onChange,
afterVisibleChange,
showMask,
maskClosable,
maskStyle,
keyboard,
getOpenCount,
scrollLocker,
contentWrapperStyle,
style,
class: className,
rootClassName,
rootStyle,
maskMotion,
motion,
inline
} = props2, otherProps = __rest$2(props2, ["width", "height", "open", "prefixCls", "placement", "level", "levelMove", "ease", "duration", "getContainer", "onChange", "afterVisibleChange", "showMask", "maskClosable", "maskStyle", "keyboard", "getOpenCount", "scrollLocker", "contentWrapperStyle", "style", "class", "rootClassName", "rootStyle", "maskMotion", "motion", "inline"]);
const open = $open && canOpen.value;
const wrapperClassName = classNames(prefixCls, {
[`${prefixCls}-${placement}`]: true,
[`${prefixCls}-open`]: open,
[`${prefixCls}-inline`]: inline,
"no-mask": !showMask,
[rootClassName]: true
});
const motionProps = typeof motion === "function" ? motion(placement) : motion;
return createVNode("div", _objectSpread(_objectSpread({}, omit(otherProps, ["autofocus"])), {}, {
"tabindex": -1,
"class": wrapperClassName,
"style": rootStyle,
"ref": dom,
"onKeydown": open && keyboard ? onKeyDown : void 0
}), [createVNode(Transition, maskMotion, {
default: () => [showMask && withDirectives(createVNode("div", {
"class": `${prefixCls}-mask`,
"onClick": maskClosable ? onClose : void 0,
"style": maskStyle,
"ref": maskDom
}, null), [[vShow, open]])]
}), createVNode(Transition, _objectSpread(_objectSpread({}, motionProps), {}, {
"onAfterEnter": onAfterVisibleChange,
"onAfterLeave": onAfterVisibleChange
}), {
default: () => [withDirectives(createVNode("div", {
"class": `${prefixCls}-content-wrapper`,
"style": [contentWrapperStyle],
"ref": contentWrapper
}, [createVNode("div", {
"class": [`${prefixCls}-content`, className],
"style": style,
"ref": contentDom
}, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]), slots.handler ? createVNode("div", {
"onClick": onHandleClick,
"ref": handlerDom
}, [(_b = slots.handler) === null || _b === void 0 ? void 0 : _b.call(slots)]) : null]), [[vShow, open]])]
})]);
};
}
});
var __rest$1 = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const DrawerWrapper = defineComponent({
compatConfig: {
MODE: 3
},
inheritAttrs: false,
props: initDefaultProps(drawerProps$1(), {
prefixCls: "drawer",
placement: "left",
getContainer: "body",
level: "all",
duration: ".3s",
ease: "cubic-bezier(0.78, 0.14, 0.15, 0.86)",
afterVisibleChange: () => {
},
showMask: true,
maskClosable: true,
maskStyle: {},
wrapperClassName: "",
keyboard: true,
forceRender: false,
autofocus: true
}),
emits: ["handleClick", "close"],
setup(props2, _ref) {
let {
emit,
slots
} = _ref;
const dom = ref(null);
const onHandleClick = (e) => {
emit("handleClick", e);
};
const onClose = (e) => {
emit("close", e);
};
return () => {
const {
getContainer,
wrapperClassName,
rootClassName,
rootStyle,
forceRender
} = props2, otherProps = __rest$1(props2, ["getContainer", "wrapperClassName", "rootClassName", "rootStyle", "forceRender"]);
let portal = null;
if (!getContainer) {
return createVNode(DrawerChild, _objectSpread(_objectSpread({}, otherProps), {}, {
"rootClassName": rootClassName,
"rootStyle": rootStyle,
"open": props2.open,
"onClose": onClose,
"onHandleClick": onHandleClick,
"inline": true
}), slots);
}
const $forceRender = !!slots.handler || forceRender;
if ($forceRender || props2.open || dom.value) {
portal = createVNode(Portal, {
"autoLock": true,
"visible": props2.open,
"forceRender": $forceRender,
"getContainer": getContainer,
"wrapperClassName": wrapperClassName
}, {
default: (_a) => {
var {
visible,
afterClose
} = _a, rest = __rest$1(_a, ["visible", "afterClose"]);
return createVNode(DrawerChild, _objectSpread(_objectSpread(_objectSpread({
"ref": dom
}, otherProps), rest), {}, {
"rootClassName": rootClassName,
"rootStyle": rootStyle,
"open": visible !== void 0 ? visible : props2.open,
"afterVisibleChange": afterClose !== void 0 ? afterClose : props2.afterVisibleChange,
"onClose": onClose,
"onHandleClick": onHandleClick
}), slots);
}
});
}
return portal;
};
}
});
const genMotionStyle = (token) => {
const {
componentCls,
motionDurationSlow
} = token;
const sharedPanelMotion = {
"&-enter, &-appear, &-leave": {
"&-start": {
transition: "none"
},
"&-active": {
transition: `all ${motionDurationSlow}`
}
}
};
return {
[componentCls]: {
// ======================== Mask ========================
[`${componentCls}-mask-motion`]: {
"&-enter, &-appear, &-leave": {
"&-active": {
transition: `all ${motionDurationSlow}`
}
},
"&-enter, &-appear": {
opacity: 0,
"&-active": {
opacity: 1
}
},
"&-leave": {
opacity: 1,
"&-active": {
opacity: 0
}
}
},
// ======================= Panel ========================
[`${componentCls}-panel-motion`]: {
// Left
"&-left": [sharedPanelMotion, {
"&-enter, &-appear": {
"&-start": {
transform: "translateX(-100%) !important"
},
"&-active": {
transform: "translateX(0)"
}
},
"&-leave": {
transform: "translateX(0)",
"&-active": {
transform: "translateX(-100%)"
}
}
}],
// Right
"&-right": [sharedPanelMotion, {
"&-enter, &-appear": {
"&-start": {
transform: "translateX(100%) !important"
},
"&-active": {
transform: "translateX(0)"
}
},
"&-leave": {
transform: "translateX(0)",
"&-active": {
transform: "translateX(100%)"
}
}
}],
// Top
"&-top": [sharedPanelMotion, {
"&-enter, &-appear": {
"&-start": {
transform: "translateY(-100%) !important"
},
"&-active": {
transform: "translateY(0)"
}
},
"&-leave": {
transform: "translateY(0)",
"&-active": {
transform: "translateY(-100%)"
}
}
}],
// Bottom
"&-bottom": [sharedPanelMotion, {
"&-enter, &-appear": {
"&-start": {
transform: "translateY(100%) !important"
},
"&-active": {
transform: "translateY(0)"
}
},
"&-leave": {
transform: "translateY(0)",
"&-active": {
transform: "translateY(100%)"
}
}
}]
}
}
};
};
const genDrawerStyle = (token) => {
const {
componentCls,
zIndexPopup,
colorBgMask,
colorBgElevated,
motionDurationSlow,
motionDurationMid,
padding,
paddingLG,
fontSizeLG,
lineHeightLG,
lineWidth,
lineType,
colorSplit,
marginSM,
colorIcon,
colorIconHover,
colorText,
fontWeightStrong,
drawerFooterPaddingVertical,
drawerFooterPaddingHorizontal
} = token;
const wrapperCls = `${componentCls}-content-wrapper`;
return {
[componentCls]: {
position: "fixed",
inset: 0,
zIndex: zIndexPopup,
pointerEvents: "none",
"&-pure": {
position: "relative",
background: colorBgElevated,
[`&${componentCls}-left`]: {
boxShadow: token.boxShadowDrawerLeft
},
[`&${componentCls}-right`]: {
boxShadow: token.boxShadowDrawerRight
},
[`&${componentCls}-top`]: {
boxShadow: token.boxShadowDrawerUp
},
[`&${componentCls}-bottom`]: {
boxShadow: token.boxShadowDrawerDown
}
},
"&-inline": {
position: "absolute"
},
// ====================== Mask ======================
[`${componentCls}-mask`]: {
position: "absolute",
inset: 0,
zIndex: zIndexPopup,
background: colorBgMask,
pointerEvents: "auto"
},
// ==================== Content =====================
[wrapperCls]: {
position: "absolute",
zIndex: zIndexPopup,
transition: `all ${motionDurationSlow}`,
"&-hidden": {
display: "none"
}
},
// Placement
[`&-left > ${wrapperCls}`]: {
top: 0,
bottom: 0,
left: {
_skip_check_: true,
value: 0
},
boxShadow: token.boxShadowDrawerLeft
},
[`&-right > ${wrapperCls}`]: {
top: 0,
right: {
_skip_check_: true,
value: 0
},
bottom: 0,
boxShadow: token.boxShadowDrawerRight
},
[`&-top > ${wrapperCls}`]: {
top: 0,
insetInline: 0,
boxShadow: token.boxShadowDrawerUp
},
[`&-bottom > ${wrapperCls}`]: {
bottom: 0,
insetInline: 0,
boxShadow: token.boxShadowDrawerDown
},
[`${componentCls}-content`]: {
width: "100%",
height: "100%",
overflow: "auto",
background: colorBgElevated,
pointerEvents: "auto"
},
// ===================== Panel ======================
[`${componentCls}-wrapper-body`]: {
display: "flex",
flexDirection: "column",
width: "100%",
height: "100%"
},
// Header
[`${componentCls}-header`]: {
display: "flex",
flex: 0,
alignItems: "center",
padding: `${padding}px ${paddingLG}px`,
fontSize: fontSizeLG,
lineHeight: lineHeightLG,
borderBottom: `${lineWidth}px ${lineType} ${colorSplit}`,
"&-title": {
display: "flex",
flex: 1,
alignItems: "center",
minWidth: 0,
minHeight: 0
}
},
[`${componentCls}-extra`]: {
flex: "none"
},
[`${componentCls}-close`]: {
display: "inline-block",
marginInlineEnd: marginSM,
color: colorIcon,
fontWeight: fontWeightStrong,
fontSize: fontSizeLG,
fontStyle: "normal",
lineHeight: 1,
textAlign: "center",
textTransform: "none",
textDecoration: "none",
background: "transparent",
border: 0,
outline: 0,
cursor: "pointer",
transition: `color ${motionDurationMid}`,
textRendering: "auto",
"&:focus, &:hover": {
color: colorIconHover,
textDecoration: "none"
}
},
[`${componentCls}-title`]: {
flex: 1,
margin: 0,
color: colorText,
fontWeight: token.fontWeightStrong,
fontSize: fontSizeLG,
lineHeight: lineHeightLG
},
// Body
[`${componentCls}-body`]: {
flex: 1,
minWidth: 0,
minHeight: 0,
padding: paddingLG,
overflow: "auto"
},
// Footer
[`${componentCls}-footer`]: {
flexShrink: 0,
padding: `${drawerFooterPaddingVertical}px ${drawerFooterPaddingHorizontal}px`,
borderTop: `${lineWidth}px ${lineType} ${colorSplit}`
},
// ====================== RTL =======================
"&-rtl": {
direction: "rtl"
}
}
};
};
const useStyle = genComponentStyleHook("Drawer", (token) => {
const drawerToken = merge(token, {
drawerFooterPaddingVertical: token.paddingXS,
drawerFooterPaddingHorizontal: token.padding
});
return [genDrawerStyle(drawerToken), genMotionStyle(drawerToken)];
}, (token) => ({
zIndexPopup: token.zIndexPopupBase
}));
var __rest = function(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
}
return t;
};
const PlacementTypes = ["top", "right", "bottom", "left"];
const defaultPushState = {
distance: 180
};
const drawerProps = () => ({
autofocus: {
type: Boolean,
default: void 0
},
closable: {
type: Boolean,
default: void 0
},
closeIcon: PropTypes.any,
destroyOnClose: {
type: Boolean,
default: void 0
},
forceRender: {
type: Boolean,
default: void 0
},
getContainer: {
type: [String, Function, Boolean, Object],
default: void 0
},
maskClosable: {
type: Boolean,
default: void 0
},
mask: {
type: Boolean,
default: void 0
},
maskStyle: objectType(),
rootClassName: String,
rootStyle: objectType(),
size: {
type: String
},
drawerStyle: objectType(),
headerStyle: objectType(),
bodyStyle: objectType(),
contentWrapperStyle: {
type: Object,
default: void 0
},
title: PropTypes.any,
/** @deprecated Please use `open` instead */
visible: {
type: Boolean,
default: void 0
},
open: {
type: Boolean,
default: void 0
},
width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
zIndex: Number,
prefixCls: String,
push: PropTypes.oneOfType([PropTypes.looseBool, {
type: Object
}]),
placement: PropTypes.oneOf(PlacementTypes),
keyboard: {
type: Boolean,
default: void 0
},
extra: PropTypes.any,
footer: PropTypes.any,
footerStyle: objectType(),
level: PropTypes.any,
levelMove: {
type: [Number, Array, Function]
},
handle: PropTypes.any,
/** @deprecated Use `@afterVisibleChange` instead */
afterVisibleChange: Function,
/** @deprecated Please use `@afterOpenChange` instead */
onAfterVisibleChange: Function,
onAfterOpenChange: Function,
/** @deprecated Please use `onUpdate:open` instead */
"onUpdate:visible": Function,
"onUpdate:open": Function,
onClose: Function
});
const Drawer = defineComponent({
compatConfig: {
MODE: 3
},
name: "ADrawer",
inheritAttrs: false,
props: initDefaultProps(drawerProps(), {
closable: true,
placement: "right",
maskClosable: true,
mask: true,
level: null,
keyboard: true,
push: defaultPushState
}),
slots: Object,
// emits: ['update:visible', 'close', 'afterVisibleChange'],
setup(props2, _ref) {
let {
emit,
slots,
attrs
} = _ref;
const sPush = shallowRef(false);
const destroyClose = shallowRef(false);
const vcDrawer = shallowRef(null);
const load = shallowRef(false);
const visible = shallowRef(false);
const mergedOpen = computed(() => {
var _a;
return (_a = props2.open) !== null && _a !== void 0 ? _a : props2.visible;
});
watch(mergedOpen, () => {
if (mergedOpen.value) {
load.value = true;
} else {
visible.value = false;
}
}, {
immediate: true
});
watch([mergedOpen, load], () => {
if (mergedOpen.value && load.value) {
visible.value = true;
}
}, {
immediate: true
});
const parentDrawerOpts = inject("parentDrawerOpts", null);
const {
prefixCls,
getPopupContainer,
direction
} = useConfigInject("drawer", props2);
const [wrapSSR, hashId] = useStyle(prefixCls);
const getContainer = computed(() => (
// 有可能为 false,所以不能直接判断
props2.getContainer === void 0 && (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer.value) ? () => getPopupContainer.value((void 0).body) : props2.getContainer
));
devWarning(!props2.afterVisibleChange, "Drawer", "`afterVisibleChange` prop is deprecated, please use `@afterVisibleChange` event instead");
const setPush = () => {
sPush.value = true;
};
const setPull = () => {
sPush.value = false;
nextTick(() => {
domFocus();
});
};
provide("parentDrawerOpts", {
setPush,
setPull
});
watch(visible, () => {
if (parentDrawerOpts) {
if (visible.value) {
parentDrawerOpts.setPush();
} else {
parentDrawerOpts.setPull();
}
}
}, {
flush: "post"
});
const domFocus = () => {
var _a, _b;
(_b = (_a = vcDrawer.value) === null || _a === void 0 ? void 0 : _a.domFocus) === null || _b === void 0 ? void 0 : _b.call(_a);
};
const close = (e) => {
emit("update:visible", false);
emit("update:open", false);
emit("close", e);
};
const afterVisibleChange = (open) => {
var _a;
if (!open) {
if (destroyClose.value === false) {
destroyClose.value = true;
}
if (props2.destroyOnClose) {
load.value = false;
}
}
(_a = props2.afterVisibleChange) === null || _a === void 0 ? void 0 : _a.call(props2, open);
emit("afterVisibleChange", open);
emit("afterOpenChange", open);
};
const pushTransform = computed(() => {
const {
push,
placement
} = props2;
let distance;
if (typeof push === "boolean") {
distance = push ? defaultPushState.distance : 0;
} else {
distance = push.distance;
}
distance = parseFloat(String(distance || 0));
if (placement === "left" || placement === "right") {
return `translateX(${placement === "left" ? distance : -distance}px)`;
}
if (placement === "top" || placement === "bottom") {
return `translateY(${placement === "top" ? distance : -distance}px)`;
}
return null;
});
const mergedWidth = computed(() => {
var _a;
return (_a = props2.width) !== null && _a !== void 0 ? _a : props2.size === "large" ? 736 : 378;
});
const mergedHeight = computed(() => {
var _a;
return (_a = props2.height) !== null && _a !== void 0 ? _a : props2.size === "large" ? 736 : 378;
});
const offsetStyle = computed(() => {
const {
mask,
placement
} = props2;
if (!visible.value && !mask) {
return {};
}
const val = {};
if (placement === "left" || placement === "right") {
val.width = isNumeric(mergedWidth.value) ? `${mergedWidth.value}px` : mergedWidth.value;
} else {
val.height = isNumeric(mergedHeight.value) ? `${mergedHeight.value}px` : mergedHeight.value;
}
return val;
});
const wrapperStyle = computed(() => {
const {
zIndex,
contentWrapperStyle
} = props2;
const val = offsetStyle.value;
return [{
zIndex,
transform: sPush.value ? pushTransform.value : void 0
}, _extends({}, contentWrapperStyle), val];
});
const renderHeader = (prefixCls2) => {
const {
closable,
headerStyle
} = props2;
const extra = getPropsSlot(slots, props2, "extra");
const title = getPropsSlot(slots, props2, "title");
if (!title && !closable) {
return null;
}
return createVNode("div", {
"class": classNames(`${prefixCls2}-header`, {
[`${prefixCls2}-header-close-only`]: closable && !title && !extra
}),
"style": headerStyle
}, [createVNode("div", {
"class": `${prefixCls2}-header-title`
}, [renderCloseIcon(prefixCls2), title && createVNode("div", {
"class": `${prefixCls2}-title`
}, [title])]), extra && createVNode("div", {
"class": `${prefixCls2}-extra`
}, [extra])]);
};
const renderCloseIcon = (prefixCls2) => {
var _a;
const {
closable
} = props2;
const $closeIcon = slots.closeIcon ? (_a = slots.closeIcon) === null || _a === void 0 ? void 0 : _a.call(slots) : props2.closeIcon;
return closable && createVNode("button", {
"key": "closer",
"onClick": close,
"aria-label": "Close",
"class": `${prefixCls2}-close`
}, [$closeIcon === void 0 ? createVNode(CloseOutlined, null, null) : $closeIcon]);
};
const renderBody = (prefixCls2) => {
var _a;
if (destroyClose.value && !props2.forceRender && !load.value) {
return null;
}
const {
bodyStyle,
drawerStyle
} = props2;
return createVNode("div", {
"class": `${prefixCls2}-wrapper-body`,
"style": drawerStyle
}, [renderHeader(prefixCls2), createVNode("div", {
"key": "body",
"class": `${prefixCls2}-body`,
"style": bodyStyle
}, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]), renderFooter(prefixCls2)]);
};
const renderFooter = (prefixCls2) => {
const footer = getPropsSlot(slots, props2, "footer");
if (!footer) {
return null;
}
const footerClassName = `${prefixCls2}-footer`;
return createVNode("div", {
"class": footerClassName,
"style": props2.footerStyle
}, [footer]);
};
const drawerClassName = computed(() => classNames({
"no-mask": !props2.mask,
[`${prefixCls.value}-rtl`]: direction.value === "rtl"
}, props2.rootClassName, hashId.value));
const maskMotion = computed(() => {
return getTransitionProps(getTransitionName(prefixCls.value, "mask-motion"));
});
const panelMotion = (motionPlacement) => {
return getTransitionProps(getTransitionName(prefixCls.value, `panel-motion-${motionPlacement}`));
};
return () => {
const {
width,
height,
placement,
mask,
forceRender
} = props2, rest = __rest(props2, ["width", "height", "placement", "mask", "forceRender"]);
const vcDrawerProps = _extends(_extends(_extends({}, attrs), omit(rest, ["size", "closeIcon", "closable", "destroyOnClose", "drawerStyle", "headerStyle", "bodyStyle", "title", "push", "onAfterVisibleChange", "onClose", "onUpdate:visible", "onUpdate:open", "visible"])), {
forceRender,
onClose: close,
afterVisibleChange,
handler: false,
prefixCls: prefixCls.value,
open: visible.value,
showMask: mask,
placement,
ref: vcDrawer
});
return wrapSSR(createVNode(NoCompactStyle, null, {
default: () => [createVNode(DrawerWrapper, _objectSpread(_objectSpread({}, vcDrawerProps), {}, {
"maskMotion": maskMotion.value,
"motion": panelMotion,
"width": mergedWidth.value,
"height": mergedHeight.value,
"getContainer": getContainer.value,
"rootClassName": drawerClassName.value,
"rootStyle": props2.rootStyle,
"contentWrapperStyle": wrapperStyle.value
}), {
handler: props2.handle ? () => props2.handle : slots.handle,
default: () => renderBody(prefixCls.value)
})]
}));
};
}
});
const __nuxt_component_2 = withInstall(Drawer);
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
__name: "MenuItem",
__ssrInlineRender: true,
props: {
title: {},
icon: {},
hasRightArrow: { type: Boolean }
},
setup(__props) {
const config = useConfigStore();
return (_ctx, _push, _parent, _attrs) => {
_push(`<div${ssrRenderAttrs(mergeProps({ class: "flex items-center justify-between" }, _attrs))}><div class="flex gap-2 items-center">`);
if (_ctx.icon) {
_push(ssrRenderComponent(BasicIconOld, { icon: _ctx.icon }, null, _parent));
} else {
_push(`<!---->`);
}
_push(`<div class="text-sm">${ssrInterpolate(_ctx.title)}</div></div><div class="flex items-center">`);
ssrRenderSlot(_ctx.$slots, "extra", {}, null, _push, _parent);
if (_ctx.hasRightArrow) {
_push(ssrRenderComponent(BasicIconOld, {
key: unref(config).isRTL,
icon: unref(config).isRTL ? "vuesax-linear:arrow-left-1" : "vuesax-linear:arrow-right-1",
size: "20"
}, null, _parent));
} else {
_push(`<!---->`);
}
_push(`</div></div>`);
};
}
});
const _sfc_setup$5 = _sfc_main$5.setup;
_sfc_main$5.setup = (props2, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/MenuItem.vue");
return _sfc_setup$5 ? _sfc_setup$5(props2, ctx) : void 0;
};
const MenuItem = Object.assign(_sfc_main$5, { __name: "MenuItem" });
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
__name: "Seller",
__ssrInlineRender: true,
props: {
user: {},
userId: {}
},
async setup(__props) {
let __temp, __restore;
const router = useRouter$1();
const props2 = __props;
const settingMenu = ref(false);
ref(false);
ref(false);
const visibleAdd = ref(false);
const config = useConfigStore();
const userPost = useUserPostStore();
const cartStore = useCartStore();
ref([]);
const formatNumber = (num) => {
if (num < 9999) return num;
return numbro(num).format({
average: true,
// Converts 11230 -> 11.2K, 1000000 -> 1M
mantissa: 1
// Number of decimal places
});
};
const videoThumbnails = ref({});
const isMain = computed(() => router.currentRoute.value.query.isMain);
const mediaStore = useMediaStore();
computed(() => config.sellerConfig?.store);
const userStore = useUserStore();
const userStory = computed(() => {
return mediaStore.users.find((x) => x.id === props2.user?.id);
});
const selectedStoryId = ref(null);
const observer = ref();
useIntersectionObserver(observer, async ([{ isIntersecting }]) => {
if (isIntersecting && !userPost.loading && !userPost.endPage) {
setTimeout(async () => {
const nextPage = userPost.currentPage + 1;
const data2 = await userPost.loadPosts(props2.userId, nextPage);
userPost.loadStateNextPage(data2);
}, 100);
}
});
const { data } = ([__temp, __restore] = withAsyncContext(async () => useAsyncData("productProfSeller", async () => {
userPost.reset();
return await userPost.loadPosts(props2.userId, 1);
})), __temp = await __temp, __restore(), __temp);
watch(data, () => {
if (data) {
userPost.loadStateNextPage(data.value);
}
});
return (_ctx, _push, _parent, _attrs) => {
const _component_a_badge = Badge;
const _component_a_popover = __nuxt_component_1;
const _component_a_drawer = __nuxt_component_2;
const _component_a_divider = __nuxt_component_4;
const _directive_lazy = resolveDirective("lazy");
let _temp0;
_push(`<!--[--><div data-v-4a92115e><div class="absolute top-0 w-inherit right-0 left-0" data-v-4a92115e><div class="flex justify-between w-full p-4" data-v-4a92115e><div class="flex items-center gap-4" data-v-4a92115e>`);
if (!isMain.value) {
_push(ssrRenderComponent(BasicIconOld, {
icon: !unref(config).isRTL ? "vuesax-linear:arrow-left" : "vuesax-linear:arrow-right",
onClick: ($event) => unref(router).back()
}, null, _parent));
} else {
_push(`<!---->`);
}
_push(`<div class="font-semibold text-xl" data-v-4a92115e>${ssrInterpolate(_ctx.user?.username)}</div></div><div class="flex items-center gap5" data-v-4a92115e>`);
if ((!unref(config).isSeller && ("APP_TYPE" in _ctx ? _ctx.APP_TYPE : unref(APP_TYPE)) === "single" || ("APP_TYPE" in _ctx ? _ctx.APP_TYPE : unref(APP_TYPE)) === "multi") && isMain.value) {
_push(ssrRenderComponent(_component_a_badge, {
count: unref(cartStore).count,
dir: "ltr",
class: "mt1"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div data-v-4a92115e${_scopeId}>`);
if (unref(config).isNightStore) {
_push2(`<img${ssrRenderAttr("src", _imports_0)} class="w-1.8rem -mt1" alt="" data-v-4a92115e${_scopeId}>`);
} else {
_push2(`<img${ssrRenderAttr("src", _imports_1)}${ssrRenderAttr("alt", unref(reactiveProjectName))} class="w-1.8rem -mt1" data-v-4a92115e${_scopeId}>`);
}
_push2(`</div>`);
} else {
return [
createVNode("div", {
onClick: ($event) => unref(router).push({ name: "cart" })
}, [
unref(config).isNightStore ? (openBlock(), createBlock("img", {
key: 0,
src: _imports_0,
class: "w-1.8rem -mt1",
alt: ""
})) : (openBlock(), createBlock("img", {
key: 1,
src: _imports_1,
alt: unref(reactiveProjectName),
class: "w-1.8rem -mt1"
}, null, 8, ["alt"]))
], 8, ["onClick"])
];
}
}),
_: 1
}, _parent));
} else {
_push(`<!---->`);
}
if (unref(getToken)() && unref(config).isSeller) {
_push(ssrRenderComponent(_component_a_popover, {
open: visibleAdd.value,
"onUpdate:open": ($event) => visibleAdd.value = $event,
trigger: "click"
}, {
content: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div data-v-4a92115e${_scopeId}><div class="flex items-center gap-2" data-v-4a92115e${_scopeId}><img${ssrRenderAttr("src", _imports_2)} class="w-1rem" alt="" data-v-4a92115e${_scopeId}><div data-v-4a92115e${_scopeId}>${ssrInterpolate(unref(config).useString("product"))}</div></div><div class="flex items-center gap-2 mt-2" data-v-4a92115e${_scopeId}><img${ssrRenderAttr("src", _imports_3)} class="w-1rem" alt="" data-v-4a92115e${_scopeId}><div data-v-4a92115e${_scopeId}>${ssrInterpolate(unref(config).useString("story"))}</div></div></div>`);
} else {
return [
createVNode("div", null, [
createVNode("div", {
class: "flex items-center gap-2",
onClick: ($event) => unref(router).push({ name: "add-product" })
}, [
createVNode("img", {
src: _imports_2,
class: "w-1rem",
alt: ""
}),
createVNode("div", null, toDisplayString(unref(config).useString("product")), 1)
], 8, ["onClick"]),
createVNode("div", {
class: "flex items-center gap-2 mt-2",
onClick: ($event) => unref(router).push({ name: "add-story" })
}, [
createVNode("img", {
src: _imports_3,
class: "w-1rem",
alt: ""
}),
createVNode("div", null, toDisplayString(unref(config).useString("story")), 1)
], 8, ["onClick"])
])
];
}
}),
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_sfc_main$6, { class: "w-1.4rem" }, null, _parent2, _scopeId));
} else {
return [
createVNode(_sfc_main$6, { class: "w-1.4rem" })
];
}
}),
_: 1
}, _parent));
} else {
_push(`<!---->`);
}
if (_ctx.user?.id === unref(userStore).user?.id) {
_push(ssrRenderComponent(_sfc_main$5$1, {
class: "w-1.3rem",
onClick: ($event) => unref(router).push({ name: "user-setting" })
}, null, _parent));
} else {
_push(`<!---->`);
}
_push(`</div></div><div class="h-90vh overflow-y-auto pb-5vh" data-v-4a92115e><div class="px4" data-v-4a92115e><div class="flex" data-v-4a92115e>`);
_push(ssrRenderComponent(UserProfilePic, {
src: _ctx.user?.avatar,
onClick: ($event) => userStory.value?.stories?.length !== 0 ? selectedStoryId.value = _ctx.user?.id : "",
"just-show-profile": userStory.value?.stories?.length === 0 || !userStory.value?.stories,
seenStory: !userStory.value?.stories?.length || userStory.value?.stories?.every((item) => item.storyviews.find((_item) => _item.user_id === unref(userStore).user?.id || _item.user_id === "me")),
showAdd: unref(config).isSeller
}, null, _parent));
_push(`<div class="p3 text-sm" data-v-4a92115e><div class="flex mt2 gap-2" data-v-4a92115e><div class="" data-v-4a92115e><div class="font-semibold" data-v-4a92115e>${ssrInterpolate(formatNumber(_ctx.user?.stats?.buy_total_order_count ?? 0))}</div><div data-v-4a92115e>${ssrInterpolate(unref(config).useString("products"))}</div></div>`);
if (_ctx.user?.id === unref(userStore).user?.id) {
_push(`<div class="" data-v-4a92115e><div class="font-semibold" data-v-4a92115e>${ssrInterpolate(formatNumber(_ctx.user?.stats?.total_customer ?? 0))}</div><div data-v-4a92115e>${ssrInterpolate(unref(config).useString("customers"))}</div></div>`);
} else {
_push(`<!---->`);
}
_push(`<div class="" data-v-4a92115e><div class="font-semibold" data-v-4a92115e>${ssrInterpolate(formatNumber(_ctx.user?.id === unref(userStore).user?.id ? _ctx.user?.stats?.sell_total_order_count ?? 0 : _ctx.user?.stats?.buy_total_order_count ?? 0))}</div><div data-v-4a92115e>${ssrInterpolate(unref(config).isSeller ? unref(config).useString("orders") : unref(config).useString("yourOrders"))}</div></div></div></div></div><div class="text-xs mt-5 font-azar font-300 whitespace-pre-line" data-v-4a92115e>${ssrInterpolate(_ctx.user?.bio)}</div>`);
if (_ctx.user?.website) {
_push(`<a${ssrRenderAttr("href", "https://" + _ctx.user?.website)} target="_blank" data-v-4a92115e><div class="flex items-center text-xs gap-1 text-primary" data-v-4a92115e>`);
_push(ssrRenderComponent(BasicIconOld, {
icon: "vuesax-linear:link-1",
class: "text-primary",
size: "20"
}, null, _parent));
_push(` ${ssrInterpolate(_ctx.user?.website)}</div></a>`);
} else {
_push(`<!---->`);
}
if (unref(getToken)() && unref(userStore).user?.id === unref(router).currentRoute.value.params.id) {
_push(`<div class="flex items-center gap-2 mt-2" data-v-4a92115e>`);
_push(ssrRenderComponent(BasicButton, {
size: "small",
block: "",
class: ["!h-unset !rounded-lg", unref(config).isNightStore ? "border-white text-white bg-black" : "border-black text-black"],
onClick: ($event) => unref(router).push({ name: "user-edit" })
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`${ssrInterpolate(unref(config).useString("editProfile"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("editProfile")), 1)
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(BasicButton, {
size: "small",
block: "",
class: ["!h-unset !rounded-lg", unref(config).isNightStore ? "border-white text-white bg-black" : "border-black text-black"]
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`${ssrInterpolate(unref(config).useString("shareStore"))}`);
} else {
return [
createTextVNode(toDisplayString(unref(config).useString("shareStore")), 1)
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
_push(`<div class="mt-4 flex" data-v-4a92115e>`);
_push(ssrRenderComponent(Highlights, { "current-user": _ctx.user }, null, _parent));
_push(`</div></div><div class="w-full grid grid-cols-3 mt-2 gap-2px" data-v-4a92115e><!--[-->`);
ssrRenderList(unref(userPost).posts, (post, i) => {
_push(`<div class="w-full aspect-square relative" data-v-4a92115e>`);
if (post.files?.length) {
_push(`<!--[-->`);
if (post.files[0].type === "image") {
_push(`<img${ssrRenderAttrs(_temp0 = mergeProps({
class: "w-full h-full object-cover",
alt: "Post Image"
}, ssrGetDirectiveProps(_ctx, _directive_lazy, { src: unref(getSupabaseStorageUrl)(post.files[0].url), loading: unref(loadGray), error: unref(loadGray) })))} data-v-4a92115e>${"textContent" in _temp0 ? ssrInterpolate(_temp0.textContent) : _temp0.innerHTML ?? ""}`);
} else if (post.files[0].type === "video") {
_push(`<div class="relative w-full h-full" data-v-4a92115e><video${ssrRenderAttr("src", post.files[0].url)} class="hidden" data-v-4a92115e></video><img${ssrRenderAttr("src", videoThumbnails.value[post.files[0].url])} class="w-full h-full object-cover" alt="Video Thumbnail" data-v-4a92115e><div class="absolute inset-0 flex items-center justify-center bg-black bg-opacity-30" data-v-4a92115e><svg class="w-12 h-12 text-white" fill="currentColor" viewBox="0 0 24 24" data-v-4a92115e><path d="M8 5v14l11-7z" data-v-4a92115e></path></svg></div></div>`);
} else {
_push(`<!---->`);
}
_push(`<!--]-->`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
});
_push(`<!--]--></div><div style="${ssrRenderStyle(!unref(userPost).loading ? null : { display: "none" })}" class="w-full opacity-0 relative" data-v-4a92115e> load </div>`);
if (unref(userPost).loading) {
_push(ssrRenderComponent(SquarePostSkeleton, null, null, _parent));
} else {
_push(`<!---->`);
}
_push(`</div></div>`);
_push(ssrRenderComponent(_component_a_drawer, {
width: 300,
title: unref(config).useString("setting"),
placement: "right",
open: settingMenu.value,
onClose: ($event) => settingMenu.value = false
}, {
extra: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(BasicIconOld, {
icon: "vuesax-linear:setting",
onClick: ($event) => unref(router).push({ name: "setting" })
}, null, _parent2, _scopeId));
} else {
return [
createVNode(BasicIconOld, {
icon: "vuesax-linear:setting",
onClick: ($event) => unref(router).push({ name: "setting" })
}, null, 8, ["onClick"])
];
}
}),
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<div data-v-4a92115e${_scopeId}>`);
_push2(ssrRenderComponent(MenuItem, {
title: unref(config).useString("brands"),
onClick: ($event) => unref(router).push({ name: "user-brands" }),
icon: "vuesax-linear:medal"
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_divider, { class: "my-2" }, null, _parent2, _scopeId));
_push2(ssrRenderComponent(MenuItem, {
title: unref(config).useString("categories"),
onClick: ($event) => unref(router).push({ name: "user-categories" }),
icon: "vuesax-linear:category-2"
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_divider, { class: "my-2" }, null, _parent2, _scopeId));
_push2(ssrRenderComponent(MenuItem, {
title: unref(config).useString("attributes"),
onClick: ($event) => unref(router).push({ name: "user-attributes" }),
icon: "vuesax-linear:data-2"
}, null, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_a_divider, { class: "my-2" }, null, _parent2, _scopeId));
_push2(ssrRenderComponent(MenuItem, {
class: "text-red-6",
title: unref(config).useString("logout"),
icon: "vuesax-linear:logout",
onClick: unref(userStore).confirmLogout
}, null, _parent2, _scopeId));
_push2(`</div>`);
} else {
return [
createVNode("div", null, [
createVNode(MenuItem, {
title: unref(config).useString("brands"),
onClick: ($event) => unref(router).push({ name: "user-brands" }),
icon: "vuesax-linear:medal"
}, null, 8, ["title", "onClick"]),
createVNode(_component_a_divider, { class: "my-2" }),
createVNode(MenuItem, {
title: unref(config).useString("categories"),
onClick: ($event) => unref(router).push({ name: "user-categories" }),
icon: "vuesax-linear:category-2"
}, null, 8, ["title", "onClick"]),
createVNode(_component_a_divider, { class: "my-2" }),
createVNode(MenuItem, {
title: unref(config).useString("attributes"),
onClick: ($event) => unref(router).push({ name: "user-attributes" }),
icon: "vuesax-linear:data-2"
}, null, 8, ["title", "onClick"]),
createVNode(_component_a_divider, { class: "my-2" }),
createVNode(MenuItem, {
class: "text-red-6",
title: unref(config).useString("logout"),
icon: "vuesax-linear:logout",
onClick: unref(userStore).confirmLogout
}, null, 8, ["title", "onClick"])
])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
if (selectedStoryId.value) {
_push(ssrRenderComponent(_sfc_main$7, {
id: selectedStoryId.value,
"onUpdate:id": ($event) => selectedStoryId.value = $event,
specifyId: ""
}, null, _parent));
} else {
_push(`<!---->`);
}
_push(`<!--]-->`);
};
}
});
const _sfc_setup$4 = _sfc_main$4.setup;
_sfc_main$4.setup = (props2, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/userProf/components/Seller.vue");
return _sfc_setup$4 ? _sfc_setup$4(props2, ctx) : void 0;
};
const Seller = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-4a92115e"]]);
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
__name: "Customer",
__ssrInlineRender: true,
props: {
user: {}
},
setup(__props) {
const router = useRouter$1();
const activeKey = ref("orders");
const config = useConfigStore();
const formatNumber = (num) => {
if (num < 9999) return num;
return numbro(num).format({
average: true,
// Converts 11230 -> 11.2K, 1000000 -> 1M
mantissa: 1
// Number of decimal places
});
};
return (_ctx, _push, _parent, _attrs) => {
const _component_ATabs = Tabs;
const _component_ATabPane = __nuxt_component_2$1;
_push(`<div${ssrRenderAttrs(_attrs)} data-v-097c9901><div class="absolute top-0 w-inherit right-0 left-0" data-v-097c9901><div class="flex justify-between w-full p-4" data-v-097c9901><div class="flex items-center gap-4" data-v-097c9901>`);
_push(ssrRenderComponent(BasicIconOld, {
icon: !unref(config).isRTL ? "vuesax-linear:arrow-left" : "vuesax-linear:arrow-right",
onClick: ($event) => unref(router).back()
}, null, _parent));
_push(`<div class="font-semibold text-lg" data-v-097c9901>${ssrInterpolate(_ctx.user?.name)}</div></div><div class="flex gap-24px items-center" data-v-097c9901></div></div><div class="h-90vh overflow-y-auto" data-v-097c9901><div class="px4" data-v-097c9901><div class="flex" data-v-097c9901>`);
_push(ssrRenderComponent(UserProfilePic, {
src: _ctx.user?.avatar,
"just-show-profile": ""
}, null, _parent));
_push(`<div class="p3 text-sm" data-v-097c9901><div class="flex mt2 gap-4" data-v-097c9901><div class="w-4rem" data-v-097c9901><div class="font-semibold" data-v-097c9901>${ssrInterpolate(formatNumber(_ctx.user?.stats?.buy_total_order_count ?? 0))}</div><div data-v-097c9901>${ssrInterpolate(unref(config).useString("orders"))}</div></div><div class="w-10rem" data-v-097c9901><div class="font-semibold flex" data-v-097c9901>${ssrInterpolate(unref(usePrice)(_ctx.user?.stats?.buy_total_order_sum ?? 0))}</div><div data-v-097c9901>${ssrInterpolate(unref(config).useString("totalAmountPurchased"))}</div></div></div></div></div><div class="grid grid-cols-3 mt-3" data-v-097c9901><div class="" data-v-097c9901><div class="text-sm" data-v-097c9901>${ssrInterpolate(unref(config).useString("phone"))}:</div><div class="text-xs font-semibold" data-v-097c9901>${ssrInterpolate(_ctx.user?.phone ?? "_")}</div></div><div class="" data-v-097c9901><div class="text-sm" data-v-097c9901>${ssrInterpolate(unref(config).useString("birthdate"))}:</div><div class="text-xs font-semibold" data-v-097c9901>${ssrInterpolate(unref(toJalali)(_ctx.user?.birthday ?? "_"))}</div></div><div class="" data-v-097c9901><div class="text-sm" data-v-097c9901>${ssrInterpolate(unref(config).useString("email"))}:</div><div class="text-xs font-semibold" data-v-097c9901>${ssrInterpolate(_ctx.user?.email ?? "_")}</div></div></div><div class="mt-4 flex" data-v-097c9901></div></div>`);
if (unref(config).isSeller) {
_push(`<div data-v-097c9901>`);
_push(ssrRenderComponent(_component_ATabs, {
activeKey: activeKey.value,
"onUpdate:activeKey": ($event) => activeKey.value = $event,
centered: "",
class: "instaTab"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_ATabPane, {
class: "!w-full",
key: "orders",
tab: unref(config).useString("orders")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="h-63vh pb-10vh overflow-y-auto px-3" data-v-097c9901${_scopeId2}>`);
_push3(ssrRenderComponent(_sfc_main$8, null, null, _parent3, _scopeId2));
_push3(`</div>`);
} else {
return [
createVNode("div", { class: "h-63vh pb-10vh overflow-y-auto px-3" }, [
createVNode(_sfc_main$8)
])
];
}
}),
_: 1
}, _parent2, _scopeId));
_push2(ssrRenderComponent(_component_ATabPane, {
class: "!w-full",
key: "saved",
tab: unref(config).useString("saved")
}, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`<div class="h-63vh pb-10vh overflow-y-auto px-3" data-v-097c9901${_scopeId2}>`);
_push3(ssrRenderComponent(_sfc_main$9, null, null, _parent3, _scopeId2));
_push3(`</div>`);
} else {
return [
createVNode("div", { class: "h-63vh pb-10vh overflow-y-auto px-3" }, [
createVNode(_sfc_main$9)
])
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_ATabPane, {
class: "!w-full",
key: "orders",
tab: unref(config).useString("orders")
}, {
default: withCtx(() => [
createVNode("div", { class: "h-63vh pb-10vh overflow-y-auto px-3" }, [
createVNode(_sfc_main$8)
])
]),
_: 1
}, 8, ["tab"]),
createVNode(_component_ATabPane, {
class: "!w-full",
key: "saved",
tab: unref(config).useString("saved")
}, {
default: withCtx(() => [
createVNode("div", { class: "h-63vh pb-10vh overflow-y-auto px-3" }, [
createVNode(_sfc_main$9)
])
]),
_: 1
}, 8, ["tab"])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
_push(`</div></div></div>`);
};
}
});
const _sfc_setup$3 = _sfc_main$3.setup;
_sfc_main$3.setup = (props2, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/userProf/components/Customer.vue");
return _sfc_setup$3 ? _sfc_setup$3(props2, ctx) : void 0;
};
const Customer = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-097c9901"]]);
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
__name: "ProfileSkeleton",
__ssrInlineRender: true,
setup(__props) {
const isLoaded = ref(false);
const skeletonRatio = ref(null);
const skeletonSize = reactive(
useElementSize(skeletonRatio, { width: 0, height: 0 }, { box: "border-box" })
);
return (_ctx, _push, _parent, _attrs) => {
if (isLoaded.value) {
_push(`<div${ssrRenderAttrs(mergeProps({
ref_key: "skeletonRatio",
ref: skeletonRatio,
class: "h-fit"
}, _attrs))}>`);
_push(ssrRenderComponent(unref(ContentLoader), {
width: skeletonSize.width,
height: "760"
}, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(`<rect x="0" y="0" rx="0" ry="0"${ssrRenderAttr("width", skeletonSize.width)} height="40"${_scopeId}></rect><circle cx="60" cy="90" r="40"${_scopeId}></circle><rect x="120" y="90" rx="3" ry="3" width="70" height="30"${_scopeId}></rect><rect x="220" y="90" rx="3" ry="3" width="70" height="30"${_scopeId}></rect><rect x="320" y="90" rx="3" ry="3" width="70" height="30"${_scopeId}></rect><rect x="10" y="160" rx="3" ry="3" width="70" height="10"${_scopeId}></rect><rect x="10" y="180" rx="3" ry="3" width="200" height="10"${_scopeId}></rect><rect x="10" y="200" rx="3" ry="3" width="400" height="10"${_scopeId}></rect><rect x="10" y="220" rx="3" ry="3" width="400" height="10"${_scopeId}></rect><rect x="10" y="250" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 2 - 15)} height="30"${_scopeId}></rect><rect${ssrRenderAttr("x", skeletonSize.width / 2 + 5)} y="250" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 2 - 15)} height="30"${_scopeId}></rect><rect x="0" y="310" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", skeletonSize.width / 3)} y="310" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", 2 * skeletonSize.width / 3)} y="310" rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect x="0"${ssrRenderAttr("y", 311 + skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", skeletonSize.width / 3)}${ssrRenderAttr("y", 311 + skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", 2 * skeletonSize.width / 3)}${ssrRenderAttr("y", 311 + skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect x="0"${ssrRenderAttr("y", 312 + 2 * skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", skeletonSize.width / 3)}${ssrRenderAttr("y", 312 + 2 * skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect><rect${ssrRenderAttr("x", 2 * skeletonSize.width / 3)}${ssrRenderAttr("y", 312 + 2 * skeletonSize.width / 3)} rx="3" ry="3"${ssrRenderAttr("width", skeletonSize.width / 3 - 2)}${ssrRenderAttr("height", skeletonSize.width / 3 - 2)}${_scopeId}></rect>`);
} else {
return [
createVNode("rect", {
x: "0",
y: "0",
rx: "0",
ry: "0",
width: skeletonSize.width,
height: "40"
}, null, 8, ["width"]),
createVNode("circle", {
cx: "60",
cy: "90",
r: "40"
}),
createVNode("rect", {
x: "120",
y: "90",
rx: "3",
ry: "3",
width: "70",
height: "30"
}),
createVNode("rect", {
x: "220",
y: "90",
rx: "3",
ry: "3",
width: "70",
height: "30"
}),
createVNode("rect", {
x: "320",
y: "90",
rx: "3",
ry: "3",
width: "70",
height: "30"
}),
createVNode("rect", {
x: "10",
y: "160",
rx: "3",
ry: "3",
width: "70",
height: "10"
}),
createVNode("rect", {
x: "10",
y: "180",
rx: "3",
ry: "3",
width: "200",
height: "10"
}),
createVNode("rect", {
x: "10",
y: "200",
rx: "3",
ry: "3",
width: "400",
height: "10"
}),
createVNode("rect", {
x: "10",
y: "220",
rx: "3",
ry: "3",
width: "400",
height: "10"
}),
createVNode("rect", {
x: "10",
y: "250",
rx: "3",
ry: "3",
width: skeletonSize.width / 2 - 15,
height: "30"
}, null, 8, ["width"]),
createVNode("rect", {
x: skeletonSize.width / 2 + 5,
y: "250",
rx: "3",
ry: "3",
width: skeletonSize.width / 2 - 15,
height: "30"
}, null, 8, ["x", "width"]),
createVNode("rect", {
x: "0",
y: "310",
rx: "3",
ry: "3",
width: skeletonSize.width / 3 - 2,
height: skeletonSize.width / 3 - 2
}, null, 8, ["width", "height"]),
createVNode("rect", {
x: skeletonSize.width / 3,
y: "310",
rx: "3",
ry: "3",
width: skeletonSize.width / 3 - 2,
height: skeletonSize.width / 3 - 2
}, null, 8, ["x", "width", "height"]),
createVNode("rect", {
x: 2 * skeletonSize.width / 3,
y: "310",
rx: "3",
ry: "3",
width: skeletonSize.width / 3 - 2,
height: skeletonSize.width / 3 - 2
}, null, 8, ["x", "width", "height"]),
createVNode("rect", {
x: "0",
y: 311 + skeletonSize.width / 3,
rx: "3",
ry: "3",
width: skeletonSize.width / 3 - 2,
height: skeletonSize.width / 3 - 2
}, null, 8, ["y", "width", "height"]),
createVNode("rect", {
x: skeletonSize.width / 3,
y: 311 + skeletonSize.width / 3,
rx: "3",
ry: "3",
width: skeletonSize.width / 3 - 2,
height: skeletonSize.width / 3 - 2
}, null, 8, ["x", "y", "width", "height"]),
createVNode("rect", {
x: 2 * skeletonSize.width / 3,
y: 311 + skeletonSize.width / 3,
rx: "3",
ry: "3",
width: skeletonSize.width / 3 - 2,
height: skeletonSize.width / 3 - 2
}, null, 8, ["x", "y", "width", "height"]),
createVNode("rect", {
x: "0",
y: 312 + 2 * skeletonSize.width / 3,
rx: "3",
ry: "3",
width: skeletonSize.width / 3 - 2,
height: skeletonSize.width / 3 - 2
}, null, 8, ["y", "width", "height"]),
createVNode("rect", {
x: skeletonSize.width / 3,
y: 312 + 2 * skeletonSize.width / 3,
rx: "3",
ry: "3",
width: skeletonSize.width / 3 - 2,
height: skeletonSize.width / 3 - 2
}, null, 8, ["x", "y", "width", "height"]),
createVNode("rect", {
x: 2 * skeletonSize.width / 3,
y: 312 + 2 * skeletonSize.width / 3,
rx: "3",
ry: "3",
width: skeletonSize.width / 3 - 2,
height: skeletonSize.width / 3 - 2
}, null, 8, ["x", "y", "width", "height"])
];
}
}),
_: 1
}, _parent));
_push(`</div>`);
} else {
_push(`<!---->`);
}
};
}
});
const _sfc_setup$2 = _sfc_main$2.setup;
_sfc_main$2.setup = (props2, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/userProf/components/ProfileSkeleton.vue");
return _sfc_setup$2 ? _sfc_setup$2(props2, ctx) : void 0;
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
__name: "index",
__ssrInlineRender: true,
async setup(__props) {
let __temp, __restore;
const router = useRouter$1();
useConfigStore();
const profileId = computed(() => router.currentRoute.value.params.id);
const userStore = useUserStore();
computed(() => router.currentRoute.value.query.isMain);
const { data: user, error } = ([__temp, __restore] = withAsyncContext(() => useAsyncData(
"user-profile",
() => getOneUser(profileId.value ?? 0)
)), __temp = await __temp, __restore(), __temp);
return (_ctx, _push, _parent, _attrs) => {
if (unref(user) && !unref(loading)) {
_push(`<!--[-->`);
if (unref(user)?.type === "store" && !unref(userStore)?.user?.main || unref(router).currentRoute.value.query.isMain) {
_push(ssrRenderComponent(Seller, {
user: unref(user),
userId: profileId.value
}, null, _parent));
} else {
_push(ssrRenderComponent(Customer, { user: unref(user) }, null, _parent));
}
_push(`<!--]-->`);
} else {
_push(ssrRenderComponent(_sfc_main$2, mergeProps({ class: "w-full h-90vh" }, _attrs), null, _parent));
}
};
}
});
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props2, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("views/base/pages/userProf/index.vue");
return _sfc_setup$1 ? _sfc_setup$1(props2, ctx) : void 0;
};
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "[id]",
__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 = (props2, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/user_detail/[id].vue");
return _sfc_setup ? _sfc_setup(props2, ctx) : void 0;
};
export { _sfc_main as default };
//# sourceMappingURL=_id_-dNslld0o.mjs.map