Rebuilt dist/ and api release bundle, with the migration for catalog paging indexes. Fix Less build error: fade(@token, N%) on theme tokens failed in both user-app and user-app-v2 CustomerChoiceView; use alpha(), the project's token-aware helper. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
import{d as G,u as re,o as le,a as te,b as t,c as l,e as a,n as R,F as q,r as H,f as F,g as b,h as z,i as M,_ as T,t as E,j as ce,k as ue,l as de,w as _e,m as e,p as ve,q as d,I as B,s as me,v as ie,x as ge,y as he,z as pe,K as se,A as fe,B as x,C as ye,D as ae,E as ke,G as j,L as Q,H as be}from"./index-VWrANxEJ.js";import{R as we}from"./RateStrip-6D9PMAmS.js";import{S as ne}from"./SectionHead-J7ahFDqv.js";import{u as Ce}from"./filtersStore-UBudUsQ5.js";import{u as Se}from"./useReveal-Bux4blM-.js";import{u as Ie}from"./catalogStore-BoknsQzW.js";import{P as $e}from"./index-aiEWOmRt.js";import"./filters-BJnbPXdW.js";const Pe={key:0,class:"showcase"},xe=["onClick"],Re=["src"],ze={key:0,class:"showcase__dots"},Ae=["aria-label","onClick"],oe=.18,De=6,Be=G({__name:"ShowcaseSlider",props:{slides:{}},emits:["select"],setup(r,{emit:g}){const h=r,A=g,c=z(0);let u;const f=re();function P(o){c.value=o,$()}function $(){u&&clearInterval(u),h.slides.length>1&&!f.isReducedMotion&&(u=setInterval(()=>{c.value=(c.value+1)%h.slides.length},6e3))}le($),te(()=>{u&&clearInterval(u)});const y=z(null),k=z(!1),v=z(0);let m=null,w=0,L=0,D=0,I=!1;function Y(o){var p;if(h.slides.length<2||m!==null)return;const _=y.value;_&&(m=o.pointerId,w=o.clientX,L=o.clientY,D=_.getBoundingClientRect().width||1,v.value=0,k.value=!0,I=!1,(p=_.setPointerCapture)==null||p.call(_,o.pointerId))}function O(o){if(!k.value||o.pointerId!==m)return;const _=o.clientX-w,p=o.clientY-L;!I&&Math.abs(_)>Math.abs(p)&&Math.abs(_)>De&&(I=!0),I&&(v.value=_)}function N(){if(!k.value)return;const _=v.value/D;k.value=!1,m=null,v.value=0,_<=-oe&&c.value<h.slides.length-1?c.value++:_>=oe&&c.value>0&&c.value--,I&&$(),I=!1}function K(o){o.pointerId===m&&N()}function X(o){o.pointerId===m&&(k.value=!1,m=null,v.value=0,I=!1)}function W(o){I||A("select",o)}const J=M(()=>{const o=-c.value*100,_=D?v.value/D*100:0;return{transform:`translate3d(${o+_}%, 0, 0)`,transition:k.value?"none":void 0}});return te(()=>{if(m!==null&&y.value)try{y.value.releasePointerCapture(m)}catch{}}),(o,_)=>r.slides.length?(t(),l("section",Pe,[a("div",{ref_key:"root",ref:y,class:F(["showcase__frame",{"is-dragging":k.value}]),onPointerdown:Y,onPointermove:O,onPointerup:K,onPointercancel:X},[a("div",{class:"showcase__track",style:R(J.value)},[(t(!0),l(q,null,H(r.slides,(p,V)=>(t(),l("article",{key:p.key,class:F(["showcase__slide",{"is-active":V===c.value}]),onClick:U=>W(p)},[p.image?(t(),l("img",{key:0,src:p.image,alt:"",class:"showcase__art",draggable:"false"},null,8,Re)):b("",!0)],10,xe))),128))],4)],34),r.slides.length>1?(t(),l("div",ze,[(t(!0),l(q,null,H(r.slides,(p,V)=>(t(),l("button",{key:p.key,type:"button",class:F(["showcase__dot",{"is-active":V===c.value}]),"aria-label":p.title,onClick:U=>P(V)},null,10,Ae))),128))])):b("",!0)])):b("",!0)}}),Me=T(Be,[["__scopeId","data-v-90ab1328"]]),Fe={class:"rail no-scrollbar"},Le=["onClick"],Oe={class:"rail__mark","aria-hidden":"true"},Ve=["src"],Ee={class:"rail__title"},Xe=G({__name:"CategoryRail",props:{categories:{},activeId:{}},emits:["select"],setup(r,{emit:g}){const h=g;return(A,c)=>(t(),l("div",Fe,[(t(!0),l(q,null,H(r.categories,u=>{var f;return t(),l("button",{key:u.id,type:"button",class:F(["rail__chip",{"is-active":u.id===r.activeId}]),onClick:P=>h("select",u)},[a("span",Oe,[(f=u.icon)!=null&&f.image?(t(),l("img",{key:0,src:u.icon.image,alt:""},null,8,Ve)):b("",!0)]),a("span",Ee,E(u.title),1)],10,Le)}),128))]))}}),qe=T(Xe,[["__scopeId","data-v-b38bbeb0"]]),He={class:"card__art"},Ye=["alt"],Ne={key:0,class:"card__badge"},Ue={class:"card__body"},je={class:"card__title"},Ge={class:"card__meta"},Te={class:"card__weight"},Ke={key:0,class:"card__wage"},We=G({__name:"ShowcaseCard",props:{value:{},wide:{type:Boolean},badge:{}},emits:["open"],setup(r,{emit:g}){const h=r,A=g,c=ce(),{image:u,id:f,title:P,min_gram:$,wage:y}=ue(h.value),k=M(()=>{const v=y.value;return v==null?"":v%1===0?String(v):v.toFixed(2)});return(v,m)=>{const w=de("lazy");return t(),l("article",{class:F(["card",{"card--wide":r.wide}]),"data-product-origin":"",onClick:m[1]||(m[1]=L=>A("open",r.value))},[a("div",He,[_e(a("img",{alt:e(P)},null,8,Ye),[[w,e(u)]]),a("button",{type:"button",class:F(["card__fav",{"is-on":e(c).isFavorite(e(f))}]),onClick:m[0]||(m[0]=ve(L=>e(c).toggle(e(f)),["stop"]))},[d(B,{icon:e(c).isFavorite(e(f))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"17"},null,8,["icon"])],2),r.badge?(t(),l("span",Ne,E(r.badge),1)):b("",!0)]),a("div",Ue,[a("h3",je,E(e(P)),1),a("div",Ge,[a("span",Te,E(e($))+" گرم",1),e(y)!=null?(t(),l("span",Ke,"اجرت "+E(k.value)+"٪",1)):b("",!0)])])],2)}}}),Z=T(We,[["__scopeId","data-v-bd6d18a4"]]),Je="/assets/shipping-and-delivery-CyUGL93q.png",Qe="/assets/sports-and-competition-ao926_SX.png",Ze=[{type:"popup",src:Je,text:"ارسال سریع و مطمئن سفارشهای شما به سراسر کشور.",link:void 0},{type:"popup",src:Qe,text:"جدیدترین محصولات منتزر را در بخش محصولات جدید ببینید.",link:void 0},{type:"popup",src:ie,text:"منتزر، همراه شما در خرید و فروش طلا.",link:void 0}],et=me("config",{state:()=>({config:{main_slider:Ze},cats:[],loaded:!1}),actions:{setCats(r){this.cats=r},async init(r=!1){try{const{categories:g}=await ge.getCatalogFacets();this.cats=g.map(h=>({...h,icon:{image:ie}})),this.loaded=!0}catch(g){console.log(g)}}}}),tt={class:"home"},st={class:"home__bar"},at={class:"home__barInner"},nt={key:0,class:"home__badge"},ot={key:0,class:"home__grid"},lt={class:"home__reel no-scrollbar"},it={class:"home__trustItem"},rt={class:"home__trustItem"},ct={class:"home__trustItem"},ut=G({__name:"HomeView",setup(r){const g=ke(),h=et(),A=he(),c=Ce(),u=Ie(),f=pe(),P=z(!u.loaded),$=z(!1),y=M(()=>u.products),k=z(f.peek(se.goldPrice)??null),v=z(f.peek(se.homeSlider)??null),{revealed:m,revealDelay:w,reveal:L}=Se("home"),D=M(()=>y.value[0]??null),I=M(()=>y.value.slice(1,5)),Y=M(()=>y.value.slice(5,13)),O=[{eyebrow:"مجموعه منتزر",cta:"دیدن مجموعه"},{eyebrow:"انتخاب سردبیر",cta:"مشاهده"},{eyebrow:"پیشنهاد این هفته",cta:"بررسی کنید"}],N=M(()=>{var s;if((s=v.value)!=null&&s.length)return v.value.filter(i=>i.image).map((i,C)=>({key:`${C}-${i.image}`,eyebrow:"مجموعه منتزر",title:"",subtitle:"",cta:"",image:i.image,link:i.link||void 0}));const n=h.cats.slice(0,3);return n.length?n.map((i,C)=>({key:i.id,eyebrow:O[C%O.length].eyebrow,title:i.title,subtitle:"ساختهشده از طلای ۱۸ عیار، با اجرت شفاف و اصالت تضمینشده.",cta:O[C%O.length].cta,image:K(i.id),categoryId:i.id})):[]});function K(n){var i,C;const s=y.value.find(S=>{var ee;return((ee=S.category)==null?void 0:ee.id)===n});return(C=(i=s==null?void 0:s.images)==null?void 0:i[0])==null?void 0:C.url}function X(n){be(n)}function W(n){c.query.cats=[n.id],g.push({name:"search"})}function J(n){if(n.link){/^https?:\/\//i.test(n.link)?window.open(n.link,"_blank","noopener"):g.push(n.link);return}n.categoryId&&(c.query.cats=[n.categoryId]),g.push({name:"search"})}function o(){g.push({name:"search"})}function _(){g.push({name:"newestProduct"})}async function p(n=!1){const[s,i,C,S]=await Promise.allSettled([u.load(n),h.init(n),f.goldPrice({force:n}),f.homeSlider({force:n})]);s.status==="rejected"&&console.log(s.reason),i.status==="rejected"&&console.log(i.reason),k.value=C.status==="fulfilled"?C.value:null,v.value=S.status==="fulfilled"?S.value:null}async function V(){await p(!0),$.value=!1}le(async()=>{await p(),P.value=!1,L()});let U=!1;return fe(async()=>{if(!U){U=!0;return}try{k.value=await f.goldPrice({force:!0})}catch(n){console.log(n)}}),(n,s)=>{const i=ae("router-link"),C=ae("container");return t(),l("div",tt,[a("header",st,[a("div",at,[d(i,{to:{name:"cart"},class:"home__iconBtn","aria-label":"سبد خرید"},{default:x(()=>[d(B,{icon:"vuesax-linear:bag-2",size:"21"}),e(A).items.length?(t(),l("span",nt,E(e(A).items.length),1)):b("",!0)]),_:1}),s[1]||(s[1]=a("img",{src:ye,alt:"منتزر",class:"home__logo"},null,-1)),d(i,{to:{name:"search"},class:"home__iconBtn","aria-label":"جستجو"},{default:x(()=>[d(B,{icon:"vuesax-linear:search-normal-1",size:"21"})]),_:1})])]),d(e($e),{modelValue:$.value,"onUpdate:modelValue":s[0]||(s[0]=S=>$.value=S),onRefresh:V},{pulling:x(()=>[d(e(Q),{size:"18"})]),loosing:x(()=>[d(e(Q),{size:"18"})]),loading:x(()=>[d(e(Q),{size:"18"})]),success:x(()=>[...s[2]||(s[2]=[a("span",null,null,-1)])]),default:x(()=>[d(C,{class:F(["home__body",{"is-revealed":e(m)}])},{default:x(()=>[d(we,{quote:k.value,class:"home__rate reveal",style:R(e(w)(0))},null,8,["quote","style"]),N.value.length?(t(),j(Me,{key:0,slides:N.value,class:"home__hero reveal",style:R(e(w)(1)),onSelect:J},null,8,["slides","style"])):b("",!0),e(h).cats.length?(t(),j(qe,{key:1,categories:e(h).cats,"active-id":null,class:"home__rail reveal",style:R(e(w)(2)),onSelect:W},null,8,["categories","style"])):b("",!0),D.value?(t(),l("section",{key:2,class:"home__section reveal",style:R(e(w)(3))},[d(ne,{title:"برگزیده منتزر",subtitle:"انتخابشده از میان مجموعههای موجود","action-label":"همه محصولات",onAction:o}),d(Z,{value:D.value,wide:"",badge:"برگزیده",onOpen:X},null,8,["value"]),I.value.length?(t(),l("div",ot,[(t(!0),l(q,null,H(I.value,S=>(t(),j(Z,{key:S.id,value:S,onOpen:X},null,8,["value"]))),128))])):b("",!0)],4)):b("",!0),Y.value.length?(t(),l("section",{key:3,class:"home__section reveal",style:R(e(w)(4))},[d(ne,{title:"تازهها",subtitle:"آخرین افزودههای مجموعه","action-label":"مشاهده همه",onAction:_}),a("div",lt,[(t(!0),l(q,null,H(Y.value,S=>(t(),j(Z,{key:S.id,value:S,class:"home__reelItem",onOpen:X},null,8,["value"]))),128))])],4)):b("",!0),!P.value&&!y.value.length?(t(),l("section",{key:4,class:"home__empty reveal",style:R(e(w)(3))},[d(B,{icon:"vuesax-linear:box",size:"26"}),s[3]||(s[3]=a("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))],4)):b("",!0),a("div",{class:"home__trust reveal",style:R(e(w)(5))},[a("div",it,[d(B,{icon:"vuesax-linear:shield-tick",size:"18"}),s[4]||(s[4]=a("span",null,"خرید امن",-1))]),a("div",rt,[d(B,{icon:"vuesax-linear:verify",size:"18"}),s[5]||(s[5]=a("span",null,"اصالت کالا",-1))]),a("div",ct,[d(B,{icon:"vuesax-linear:box-tick",size:"18"}),s[6]||(s[6]=a("span",null,"ارسال بیمهشده",-1))])],4)]),_:1},8,["class"])]),_:1},8,["modelValue"])])}}}),yt=T(ut,[["__scopeId","data-v-b32a0927"]]);export{yt as default};
|