2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
import{_ as D}from"./Bbd_Ti14.js";import{u as ee}from"./DyxeBzWG.js";import{d as C,G as P,y as l,J as e,z as i,u as te,r as x,H as se,ag as oe,ah as re,k as G,a3 as ie,a4 as ae,$ as le,ai as ne,A as t,C as a,B as n,D as p,F as y,R as _,a8 as k,a5 as I,E as w,a2 as U,a0 as R,a1 as ce,a6 as ue,T as de}from"./Cbt2tPBc.js";import{c as me,a as pe}from"./0sQGsR-B.js";import{_ as _e,a as ve,b as ge,c as fe}from"./C7zEPsIa.js";import{B as S}from"./_OSaw0MT.js";import{n as he}from"./BGrduSck.js";import{B as j}from"./CgpbEzJY.js";import{H as xe}from"./FVfVRvfu.js";import{U as we}from"./ScpmmaE4.js";import{_ as ye}from"./Ctsa2335.js";import{_ as ke}from"./DNDpcsqo.js";import{u as Ce}from"./CLMw6_SR.js";import{u as be}from"./BoBuM2tF.js";import{l as E}from"./DkLizs-G.js";import{_ as Ve}from"./CqrgowAD.js";import{u as Se}from"./CBJoCjDV.js";import{B as Me}from"./BsLs4p15.js";import{_ as $e,T as He}from"./CRIXWJhb.js";import{_ as Pe}from"./QyMw0Sp1.js";import{_ as ze}from"./DlAUqK2U.js";import"./C9QN_Mfk.js";import"./SolGyfyY.js";import"./mPGATRDV.js";/* empty css */import"./DGFRw2HL.js";import"./DRgfp1up.js";import"./B1N_kU_k.js";import"./pFOmwm6m.js";import"./BBSG9FnH.js";import"./CK63FxZH.js";import"./DPLkQIR9.js";import"./b4XmZQIy.js";import"./CmMfcJ2x.js";import"./DlznrpTI.js";import"./BzAZyL4T.js";import"./YUm_jrvp.js";import"./D6qJbdzf.js";import"./CZUeDkO0.js";import"./CxM9_8io.js";import"./D2avLtB7.js";import"./BlkfA1qz.js";import"./BI5evUJ6.js";import"./Dm-BacZx.js";import"./Rshl30Eo.js";import"./sFfhux-l.js";import"./CD4jTnQf.js";import"./BaFlPdDo.js";import"./D58EDzqx.js";import"./DfSIj5ee.js";import"./1jTl4r5u.js";import"./Bh8FlG27.js";import"./Cj99RmFE.js";import"./DnXbm1Hu.js";import"./Dq7m1_nY.js";import"./ClgUV-y-.js";import"./ONZBPW5n.js";import"./PPhiVNr-.js";import"./DuNs4Pw1.js";import"./BgR2E6gQ.js";import"./Ca3ZqvUo.js";import"./iccRLuv1.js";import"./unXo4E2b.js";import"./C5eOakM-.js";import"./DFzrht7B.js";import"./DjvBa-1E.js";import"./D0vSK_3x.js";import"./DwalR_vN.js";import"./D-bUn136.js";import"./Ceqi68nG.js";const Ne="data:image/svg+xml,%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20512%20512'%20style='enable-background:new%200%200%20512%20512;'%20xml:space='preserve'%3e%3cg%20id='XMLID_2_'%20fill='white'%3e%3cpath%20id='XMLID_14_'%20class='st0'%20d='M460.8,0H51.2C23.3,0,0,23.3,0,51.2v409.6C0,488.7,23.3,512,51.2,512h409.6%20c27.9,0,51.2-23.3,51.2-51.2V51.2C512,23.3,488.7,0,460.8,0z%20M153.6,460.8H51.2V358.4h102.4V460.8z%20M153.6,307.2H51.2V204.8h102.4%20V307.2z%20M153.6,153.6H51.2V51.2h102.4V153.6z%20M307.2,460.8H204.8V358.4h102.4V460.8z%20M307.2,307.2H204.8V204.8h102.4V307.2z%20M307.2,153.6H204.8V51.2h102.4V153.6z%20M460.8,460.8H358.4V358.4h102.4V460.8z%20M460.8,307.2H358.4V204.8h102.4V307.2z%20M460.8,153.6%20H358.4V51.2h102.4V153.6z'/%3e%3c/g%3e%3c/svg%3e",Ae="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Generator:%20Adobe%20Illustrator%2024.1.1,%20SVG%20Export%20Plug-In%20.%20SVG%20Version:%206.00%20Build%200)%20--%3e%3csvg%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20x='0px'%20y='0px'%20viewBox='0%200%20512%20512'%20style='enable-background:new%200%200%20512%20512;'%20xml:space='preserve'%3e%3cg%20id='XMLID_2_'%3e%3cpath%20id='XMLID_14_'%20class='st0'%20d='M460.8,0H51.2C23.3,0,0,23.3,0,51.2v409.6C0,488.7,23.3,512,51.2,512h409.6%20c27.9,0,51.2-23.3,51.2-51.2V51.2C512,23.3,488.7,0,460.8,0z%20M153.6,460.8H51.2V358.4h102.4V460.8z%20M153.6,307.2H51.2V204.8h102.4%20V307.2z%20M153.6,153.6H51.2V51.2h102.4V153.6z%20M307.2,460.8H204.8V358.4h102.4V460.8z%20M307.2,307.2H204.8V204.8h102.4V307.2z%20M307.2,153.6H204.8V51.2h102.4V153.6z%20M460.8,460.8H358.4V358.4h102.4V460.8z%20M460.8,307.2H358.4V204.8h102.4V307.2z%20M460.8,153.6%20H358.4V51.2h102.4V153.6z'/%3e%3c/g%3e%3c/svg%3e",Be={key:0,src:Ne,class:"w-1rem h-1rem",alt:"grid","cursor-pointer":""},Te={key:1,src:Ae,alt:"grid","cursor-pointer":"",class:"w-1rem h-1rem"},Le=C({__name:"grid",setup(g){const d=P();return(f,u)=>e(d).isNightStore?(i(),l("img",Be)):(i(),l("img",Te))}}),De="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21%206H19M21%2012H16M21%2018H16M7%2020V13.5612C7%2013.3532%207%2013.2492%206.97958%2013.1497C6.96147%2013.0615%206.93151%2012.9761%206.89052%2012.8958C6.84431%2012.8054%206.77934%2012.7242%206.64939%2012.5617L3.35061%208.43826C3.22066%208.27583%203.15569%208.19461%203.10948%208.10417C3.06849%208.02393%203.03853%207.93852%203.02042%207.85026C3%207.75078%203%207.64677%203%207.43875V5.6C3%205.03995%203%204.75992%203.10899%204.54601C3.20487%204.35785%203.35785%204.20487%203.54601%204.10899C3.75992%204%204.03995%204%204.6%204H13.4C13.9601%204%2014.2401%204%2014.454%204.10899C14.6422%204.20487%2014.7951%204.35785%2014.891%204.54601C15%204.75992%2015%205.03995%2015%205.6V7.43875C15%207.64677%2015%207.75078%2014.9796%207.85026C14.9615%207.93852%2014.9315%208.02393%2014.8905%208.10417C14.8443%208.19461%2014.7793%208.27583%2014.6494%208.43826L11.3506%2012.5617C11.2207%2012.7242%2011.1557%2012.8054%2011.1095%2012.8958C11.0685%2012.9761%2011.0385%2013.0615%2011.0204%2013.1497C11%2013.2492%2011%2013.3532%2011%2013.5612V17L7%2020Z'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Ge="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21%206H19M21%2012H16M21%2018H16M7%2020V13.5612C7%2013.3532%207%2013.2492%206.97958%2013.1497C6.96147%2013.0615%206.93151%2012.9761%206.89052%2012.8958C6.84431%2012.8054%206.77934%2012.7242%206.64939%2012.5617L3.35061%208.43826C3.22066%208.27583%203.15569%208.19461%203.10948%208.10417C3.06849%208.02393%203.03853%207.93852%203.02042%207.85026C3%207.75078%203%207.64677%203%207.43875V5.6C3%205.03995%203%204.75992%203.10899%204.54601C3.20487%204.35785%203.35785%204.20487%203.54601%204.10899C3.75992%204%204.03995%204%204.6%204H13.4C13.9601%204%2014.2401%204%2014.454%204.10899C14.6422%204.20487%2014.7951%204.35785%2014.891%204.54601C15%204.75992%2015%205.03995%2015%205.6V7.43875C15%207.64677%2015%207.75078%2014.9796%207.85026C14.9615%207.93852%2014.9315%208.02393%2014.8905%208.10417C14.8443%208.19461%2014.7793%208.27583%2014.6494%208.43826L11.3506%2012.5617C11.2207%2012.7242%2011.1557%2012.8054%2011.1095%2012.8958C11.0685%2012.9761%2011.0385%2013.0615%2011.0204%2013.1497C11%2013.2492%2011%2013.3532%2011%2013.5612V17L7%2020Z'%20stroke='%23000000'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Ie={key:0,class:"w-1.5rem h-1.5rem",src:De,alt:"filter","cursor-pointer":""},Ue={key:1,src:Ge,class:"w-1.5rem h-1.5rem",alt:"filter","cursor-pointer":""},Re=C({__name:"filter",setup(g){const d=P();return(f,u)=>e(d).isNightStore?(i(),l("img",Ie)):(i(),l("img",Ue))}});function je(g,d=50){if(g.length<=d)return g;const f=g.slice(0,Math.floor(d/2)-3),u=g.slice(-Math.floor(d/2));return`${f}...${u}`}const Ee={class:"absolute top-0 w-inherit right-0 left-0"},Oe={class:"flex justify-between w-full p-4"},Ke={class:"font-semibold text-lg"},Xe={class:"flex gap6 items-center"},qe={key:0,src:me,class:"w-1.8rem -mt1",alt:""},Fe=["alt"],Ye=["alt"],Ze=["alt"],Je={class:"h-90vh overflow-y-auto pb-5vh"},We={class:"px4"},Qe={class:"flex"},et={class:"p3 text-sm"},tt={class:"flex mt2 gap-3"},st={class:""},ot={class:"font-semibold"},rt={class:"text-xs"},it={class:"font-semibold"},at={class:"text-xs"},lt={class:"font-semibold"},nt={class:"text-xs"},ct={key:1,class:""},ut={class:"font-semibold flex gap-1"},dt={class:"text-xs"},mt={class:"text-xs"},pt={class:"text-xs mt-5 whitespace-pre-line"},_t=["href"],vt={class:"flex items-center text-xs gap-1 text-primary"},gt={key:1},ft=["href"],ht={class:"flex items-center text-xs gap-1 text-primary"},xt={key:0,class:"flex items-center gap-2 mt-2"},wt={class:"mt-4 flex -me16px"},yt={class:"w-full grid grid-cols-3 mt-[1px] gap-2px"},kt=["onClick"],Ct=["alt"],bt={key:1,class:"relative w-full h-full"},Vt=["src"],St=["src"],Mt=C({__name:"Seller",async setup(g){let d,f;const u=te(),b=x(null),z=x("products"),N=x(!1),s=P(),A=se(),O=Ce(),K=oe(),v=be(),X=re(),c=G(()=>s.sellerConfig?.store),B=x(X?.prices.find(m=>m?.id_key==="8-geram18")?.price),h=G(()=>O.users.find(m=>m.id===c.value?.id)),M=m=>m<9999?m:he(m).format({average:!0,mantissa:1}),q=x({});async function F(){if(navigator.share)try{await navigator.share({title:`${s.lang==="fa"?`${s.appName.fa}`:`${s.appName.en}`}`,text:`${c.value?.bio}`,url:`${window.location.origin}/user`})}catch(m){console.error("Sharing failed",m)}else alert("Web Share API not supported in this browser.")}const T=x();ie(T,async([{isIntersecting:m}])=>{m&&!v.loading&&!v.endPage&&setTimeout(async()=>{const o=v.currentPage+1,H=await v.loadPosts(c.value?.user_id,o);v.loadStateNextPage(H)},100)});const{data:$}=([d,f]=ae(async()=>Se("productMainSeller",async()=>(v.reset(),await v.loadPosts(c.value?.user_id,1)))),d=await d,f(),d);return le($,()=>{$&&v.loadStateNextPage($.value)}),(m,o)=>{const H=Me,Y=Pe,Z=D,J=D,L=$e,W=He,Q=ne("lazy");return i(),l("div",null,[t("div",Ee,[t("div",Oe,[t("div",Ke,n(c.value?.username),1),a(Z,null,{default:p(()=>[t("div",Xe,[!e(s).isSeller&&e(s).APP_TYPE==="single"||e(s).APP_TYPE==="multi"?(i(),y(H,{key:0,count:e(K).count,dir:"ltr",class:"mt1"},{default:p(()=>[t("div",{onClick:o[0]||(o[0]=r=>e(u).push({name:"cart"}))},[e(s).isNightStore?(i(),l("img",qe)):(i(),l("img",{key:1,src:pe,alt:e(s).appName.en,class:"w-1.8rem -mt1"},null,8,Fe))])]),_:1},8,["count"])):_("",!0),e(k)()&&e(s).isSeller?(i(),y(Y,{key:1,open:N.value,"onUpdate:open":o[3]||(o[3]=r=>N.value=r),trigger:"click"},{content:p(()=>[t("div",null,[t("div",{class:"flex items-center gap-2",onClick:o[1]||(o[1]=r=>e(u).push({name:"add-product"}))},[t("img",{src:ve,class:"w-1rem",alt:e(s).appName.en},null,8,Ye),t("div",null,n(e(s).useString("product")),1)]),t("div",{class:"flex items-center gap-2 mt-2",onClick:o[2]||(o[2]=r=>e(u).push({name:"add-story"}))},[t("img",{src:ge,class:"w-1rem",alt:e(s).appName.en},null,8,Ze),t("div",null,n(e(s).useString("story")),1)])])]),default:p(()=>[a(_e,{class:"w-1.4rem"})]),_:1},8,["open"])):_("",!0),e(k)()&&!e(s).isSeller?(i(),l("div",{key:2,onClick:o[4]||(o[4]=r=>e(u).push({name:"user-profile"}))},[a(S,{icon:"vuesax-linear:profile-circle"})])):_("",!0),e(k)()?_("",!0):(i(),l("div",{key:3,onClick:o[5]||(o[5]=r=>e(u).push({name:"auth-login"}))},[a(S,{icon:"vuesax-linear:login"})])),a(fe,{class:"w-1.3rem",onClick:o[6]||(o[6]=r=>e(u).push({name:"user-setting"}))})])]),_:1})]),t("div",Je,[t("div",We,[t("div",Qe,[a(we,{src:c.value?.avatar,onClick:o[7]||(o[7]=r=>h.value?.stories?.length===0||!h.value?.stories?"":b.value=c.value?.id),"just-show-profile":h.value?.stories?.length===0||!h.value?.stories,seenStory:!h.value?.stories?.length||h.value?.stories?.every(r=>r.storyviews.find(V=>V.user_id===e(A).user?.id||V.user_id==="me")),showAdd:e(s).isSeller},null,8,["src","just-show-profile","seenStory","showAdd"]),t("div",et,[t("div",tt,[t("div",st,[t("div",ot,n(M(c.value?.stats?.total_product??0)),1),t("div",rt,n(e(s).useString("products")),1)]),e(s).isSeller?(i(),l("div",{key:0,class:"",onClick:o[8]||(o[8]=r=>e(s).isSeller?e(u).push({name:"user-statistics_list-customers"}):"")},[t("div",it,n(M(c.value?.stats?.total_customer??0)),1),t("div",at,n(e(s).useString("customers")),1)])):_("",!0),t("div",{class:"",onClick:o[9]||(o[9]=r=>e(k)()?e(u).push({name:"user-statistics_list-orders"}):e(u).push({name:"auth-login"}))},[t("div",lt,n(M(e(s).isSeller?c.value?.stats?.sell_total_order_count??0:e(A)?.user?.stats?.buy_total_order_count??0)),1),t("div",nt,n(e(s).isSeller?e(s).useString("orders"):e(s).useString("yourOrders")),1)]),e(s).APP_HAS_GOLD&&B.value?(i(),l("div",ct,[t("div",ut,[w(n(("usePrice"in m?m.usePrice:e(ee))(B.value/10,!0,""))+" ",1),t("div",dt,n(e(s).useString("toman")),1)]),t("div",mt,n(e(s).useString("goldGramPrice")),1)])):_("",!0)])])]),t("div",pt,n(c.value?.bio),1),c.value?.website?(i(),l("a",{key:0,href:"https://"+c.value?.website,target:"_blank"},[t("div",vt,[a(S,{icon:"vuesax-linear:link-1",class:"text-primary",size:"20"}),w(" "+n(c.value?.website),1)])],8,_t)):_("",!0),e(s).ENAMAD_URL?(i(),l("div",gt,[o[14]||(o[14]=w(" اینماد ",-1)),t("a",{href:e(s).ENAMAD_URL,target:"_blank"},[t("div",ht,[a(S,{icon:"vuesax-linear:link-1",class:"text-primary",size:"20"}),w(" "+n(e(je)(e(s).ENAMAD_URL)),1)])],8,ft)])):_("",!0),a(J,null,{default:p(()=>[e(k)()?(i(),l("div",xt,[a(j,{size:"small",block:"",class:U(["!h-unset bg-gray-200 border-0 !py-1 !rounded-lg",e(s).isNightStore?"border-white text-white bg-black":"border-black text-black"]),onClick:o[10]||(o[10]=r=>e(u).push({name:"user-edit"}))},{default:p(()=>[w(n(e(s).useString("editProfile")),1)]),_:1},8,["class"]),a(j,{size:"small",block:"",class:U(["!h-unset bg-gray-200 border-0 !py-1 !rounded-lg",e(s).isNightStore?"border-white text-white bg-black":"border-black text-black"]),onClick:o[11]||(o[11]=r=>F())},{default:p(()=>[w(n(e(s).useString("shareStore")),1)]),_:1},8,["class"])])):_("",!0)]),_:1}),t("div",wt,[a(xe,{"current-user":c.value},null,8,["current-user"])])]),a(W,{activeKey:z.value,"onUpdate:activeKey":o[12]||(o[12]=r=>z.value=r),centered:"",class:"instaTab"},{default:p(()=>[a(L,{class:"!w-full",key:"products"},{tab:p(()=>[t("span",null,[a(Le)])]),default:p(()=>[t("div",yt,[(i(!0),l(R,null,ce(e(v).posts,(r,V)=>(i(),l("div",{key:V,class:"w-full aspect-square relative",onClick:Pt=>e(u).push({name:"posts",query:{target:r.id,userId:c.value?.user_id}})},[r.files?.length?(i(),l(R,{key:0},[r.files[0]?.type==="image"?I((i(),l("img",{key:0,class:"w-full h-full object-cover",alt:e(s).appName.en},null,8,Ct)),[[Q,{src:e(s).useDataStorage(r.files[0].url),loading:e(E),error:e(E)}]]):r.files[0]?.type==="video"?(i(),l("div",bt,[t("video",{ref_for:!0,ref:"videoRefs",src:r.files[0]?.url,class:"hidden"},null,8,Vt),t("img",{src:q.value[r.files[0]?.url],class:"w-full h-full object-cover",alt:"Video Thumbnail"},null,8,St),o[15]||(o[15]=t("div",{class:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-30"},[t("svg",{class:"w-12 h-12 text-white",fill:"currentColor",viewBox:"0 0 24 24"},[t("path",{d:"M8 5v14l11-7z"})])],-1))])):_("",!0)],64)):_("",!0)],8,kt))),128))])]),_:1}),a(L,{class:"!w-full",key:"search"},{tab:p(()=>[t("span",null,[a(Re)])]),default:p(()=>[a(Ve,{class:"!-mt-3"})]),_:1})]),_:1},8,["activeKey"]),I(t("div",{ref_key:"observer",ref:T,class:"w-full opacity-0 relative"}," load ",512),[[ue,!e(v).loading]]),e(v).loading?(i(),y(ye,{key:0})):_("",!0)])]),a(de,{name:"slide-up",mode:"out-in"},{default:p(()=>[b.value?(i(),y(ke,{key:0,id:b.value,"onUpdate:id":o[13]||(o[13]=r=>b.value=r),specifyId:""},null,8,["id"])):_("",!0)]),_:1})])}}}),$t=ze(Mt,[["__scopeId","data-v-224dcc9a"]]),Ht=C({__name:"index",setup(g){return(d,f)=>(i(),y($t))}}),qs=C({__name:"index",setup(g){return(d,f)=>(i(),y(Ht))}});export{qs as default};
|