1 line
20 KiB
JavaScript
1 line
20 KiB
JavaScript
import{At as e,D as t,F as n,G as r,K as i,M as a,Nt as o,Pt as s,U as c,_ as l,c as u,d,f,g as p,h as m,i as h,k as g,l as _,nt as v,o as y,t as b,u as x,ut as S,v as C}from"./_plugin-vue_export-helper-1xMDlcEE.js";import{s as w,u as T}from"./BasicIcon-Bzeb0Iwd.js";import{o as E}from"./format-C72AoJ2H.js";import{t as D}from"./catalog-BHsy1JeE.js";import{A as O,M as k,O as A,c as j,j as ee,l as te,n as M}from"./index-3Kv0ngks.js";import{t as ne}from"./IconChevronBack-CDeN0Cbu.js";import{t as re}from"./PageSkeleton-DYdjm4l9.js";import{a as ie,o as ae,t as oe}from"./crm-DoYzOa8A.js";import{t as N}from"./catalogRequests-Bfg-Nm09.js";import{t as se}from"./useGoBack-pkrD1deE.js";import{t as ce}from"./IconShoppingBag-BHoZiOex.js";import{t as le}from"./quick-catalog-request-Di7-t6Ua.js";import{t as ue}from"./IconHeart-CvzbNH_T.js";import{n as P,t as de}from"./colorSwatch-BgOH1LE5.js";var F=[`width`,`height`],I=[`stroke`],L=[`stroke`],R=[`stroke`],fe=C({__name:`IconShare`,props:{size:{default:20},color:{default:`#9AA3AF`}},setup(e){return(t,n)=>(a(),f(`svg`,{width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`},[_(`path`,{d:`M12 3.5v11`,stroke:e.color,"stroke-width":`1.5`,"stroke-linecap":`round`},null,8,I),_(`path`,{d:`M8.25 7 12 3.25 15.75 7`,stroke:e.color,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,L),_(`path`,{d:`M6.5 11.5v7.25c0 .97.78 1.75 1.75 1.75h7.5c.97 0 1.75-.78 1.75-1.75V11.5`,stroke:e.color,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,R)],8,F))}}),z=[`width`,`height`,`stroke`],pe=C({__name:`IconRuler`,props:{size:{default:22},color:{default:`currentColor`}},setup(e){return(t,n)=>(a(),f(`svg`,{width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,stroke:e.color,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[...n[0]||=[m(`<rect x="3" y="8" width="18" height="8" rx="1.5"></rect><path d="M7 8v3"></path><path d="M10 8v4"></path><path d="M13 8v3"></path><path d="M16 8v4"></path>`,5)]],8,z))}}),B=[`width`,`height`,`stroke`],me=C({__name:`IconWeave`,props:{size:{default:22},color:{default:`currentColor`}},setup(e){return(t,n)=>(a(),f(`svg`,{width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,stroke:e.color,"stroke-width":`1.6`,"stroke-linecap":`round`,"aria-hidden":`true`},[...n[0]||=[m(`<path d="M6 4v16"></path><path d="M10 4v16"></path><path d="M14 4v16"></path><path d="M18 4v16"></path><path d="M4 8h16"></path><path d="M4 12h16"></path><path d="M4 16h16"></path>`,7)]],8,B))}}),V=`درخواست دریافت فیزیکی کالیته برای شما ثبت شد و به زودی همکاران ما برای شما خواهند آورد`;function he(){let e=j(),t=N(),n=v(!1),r=v(``),i=v(!1),a=v(null),o=v(``);function s(){i.value=!1,a.value=null,o.value=``}async function c(e,n){let i=await t.create({items:[{productId:e.id,productName:e.name,productCode:e.code,quantity:1}],note:`آدرس: ${n}`});return i.success?(r.value=V,window.setTimeout(()=>{r.value=``},6e3),!0):(o.value=i.message,!1)}async function l(t){o.value=``;let r=e.user?.address?.trim();if(r){n.value=!0;try{await c(t,r)}finally{n.value=!1}return}a.value=t,i.value=!0}async function u(t){let r=t.trim();if(!r)return o.value=`آدرس الزامی است.`,!1;let i=a.value;if(!i)return!1;o.value=``,n.value=!0;try{if(!await e.updateProfile({address:r}))return o.value=`ذخیره آدرس ناموفق بود.`,!1;let t=await c(i,r);return t&&s(),t}finally{n.value=!1}}return{requesting:n,successMessage:r,addressModalOpen:i,addressError:o,requestCatalog:l,submitAddressAndRequest:u,closeAddressModal:s}}var H={class:`dialog card address-modal`},U={class:`address-modal__field`},ge={key:0,class:`address-modal__error`},_e={class:`dialog-actions address-modal__actions`},ve=b(C({__name:`AddressCompletionModal`,props:{open:{type:Boolean},loading:{type:Boolean},error:{}},emits:[`close`,`submit`],setup(e,{emit:n}){let o=e,u=n,m=v(``);c(()=>o.open,e=>{e&&(m.value=``)});function h(e){e.key===`Escape`&&o.open&&u(`close`)}c(()=>o.open,e=>{document.body.style.overflow=e?`hidden`:``,e?window.addEventListener(`keydown`,h):window.removeEventListener(`keydown`,h)},{immediate:!0}),t(()=>{document.body.style.overflow=``,window.removeEventListener(`keydown`,h)});function g(){u(`submit`,m.value)}return(t,n)=>(a(),x(y,{to:`body`},[e.open?(a(),f(`div`,{key:0,class:`dialog-overlay address-modal-overlay`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`address-modal-title`,onClick:n[2]||=T(e=>u(`close`),[`self`])},[_(`div`,H,[n[5]||=_(`h3`,{id:`address-modal-title`,class:`address-modal__title`},`تکمیل آدرس`,-1),n[6]||=_(`p`,{class:`address-modal__hint`},` برای ارسال کالیته فیزیکی، آدرس محل فعالیت خود را وارد کنید. این آدرس در اطلاعات کاربری شما ذخیره میشود. `,-1),_(`label`,U,[n[3]||=_(`span`,{class:`form-label`},`آدرس`,-1),i(_(`textarea`,{"onUpdate:modelValue":n[0]||=e=>m.value=e,class:`address-modal__textarea`,rows:`3`,maxlength:`500`,placeholder:`آدرس کامل محل فعالیت`},null,512),[[w,m.value]])]),e.error?(a(),f(`p`,ge,s(e.error),1)):d(``,!0),_(`div`,_e,[l(M,{variant:`outline`,disabled:e.loading,onClick:n[1]||=e=>u(`close`)},{default:r(()=>[...n[4]||=[p(` انصراف `,-1)]]),_:1},8,[`disabled`]),l(M,{disabled:e.loading,onClick:g},{default:r(()=>[p(s(e.loading?`در حال ثبت...`:`ثبت درخواست`),1)]),_:1},8,[`disabled`])])])])):d(``,!0)]))}}),[[`__scopeId`,`data-v-0a7c2418`]]),ye={class:`dialog card product-order-modal`},be={class:`product-order-modal__head`},xe={class:`product-order-modal__rows`},W={class:`product-order-row__color`},G=[`title`],K={key:0,class:`product-order-row__label`},q={class:`product-order-row__stepper`},J=[`disabled`,`onClick`],Y={class:`product-order-row__qty`},Se=[`disabled`,`onClick`],Ce={key:0,class:`product-order-modal__error`},we={class:`product-order-modal__footer`},X={class:`product-order-modal__price`},Te={key:0},Ee={key:1},Z={key:2},Q={key:0,class:`product-order-modal__hint`},De=b(C({__name:`ProductOrderModal`,props:{open:{type:Boolean},product:{},rollMeters:{},minRolls:{},basePrice:{},loading:{type:Boolean},error:{}},emits:[`close`,`submit`],setup(e,{emit:i}){let m=e,g=i,b=v([]);c(()=>[m.open,m.product?.colors.length],([e])=>{!e||!m.product||(b.value=m.product.colors.map(()=>0))});let C=u(()=>b.value.reduce((e,t)=>e+(t>0?t:0),0)),w=u(()=>C.value*m.rollMeters),D=u(()=>!m.basePrice||w.value<=0?null:m.basePrice*w.value);function O(e){e.key===`Escape`&&m.open&&g(`close`)}c(()=>m.open,e=>{document.body.style.overflow=e?`hidden`:``,e?window.addEventListener(`keydown`,O):window.removeEventListener(`keydown`,O)},{immediate:!0}),t(()=>{document.body.style.overflow=``,window.removeEventListener(`keydown`,O)});function k(e,t){let n=[...b.value];n[e]=Math.max(0,(n[e]??0)+t),b.value=n}function A(){g(`submit`,[...b.value])}return(t,i)=>(a(),x(y,{to:`body`},[e.open&&e.product?(a(),f(`div`,{key:0,class:`dialog-overlay product-order-overlay`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`product-order-title`,onClick:i[1]||=T(e=>g(`close`),[`self`])},[_(`div`,ye,[_(`header`,be,[i[2]||=_(`h3`,{id:`product-order-title`,class:`product-order-modal__title`},`ثبت سفارش`,-1),_(`button`,{type:`button`,class:`product-order-modal__close`,"aria-label":`بستن`,onClick:i[0]||=e=>g(`close`)},` × `)]),i[4]||=_(`div`,{class:`product-order-modal__table-head`,"aria-hidden":`true`},[_(`span`,null,`رنگ`),_(`span`,null,`تعداد`)],-1),_(`ul`,xe,[(a(!0),f(h,null,n(e.product.colors,(t,n)=>(a(),f(`li`,{key:n,class:`product-order-row`},[_(`div`,W,[_(`span`,{class:`product-order-row__swatch`,style:o(S(P)(t,e.product.colorImages?.[n]||e.product.imageUrls?.[n])),title:t},null,12,G),t?(a(),f(`span`,K,s(t),1)):d(``,!0)]),_(`div`,q,[_(`button`,{type:`button`,class:`product-order-row__btn`,"aria-label":`کاهش`,disabled:e.loading||(b.value[n]??0)<=0,onClick:e=>k(n,-1)},` − `,8,J),_(`span`,Y,s(S(E)(b.value[n]??0)),1),_(`button`,{type:`button`,class:`product-order-row__btn`,"aria-label":`افزایش`,disabled:e.loading,onClick:e=>k(n,1)},` + `,8,Se)])]))),128))]),e.error?(a(),f(`p`,Ce,s(e.error),1)):d(``,!0),_(`footer`,we,[_(`div`,X,[i[3]||=_(`span`,null,`قیمت`,-1),D.value==null?C.value>0?(a(),f(`strong`,Ee,s(S(E)(w.value))+` متر `,1)):(a(),f(`strong`,Z,`—`)):(a(),f(`strong`,Te,s(S(E)(D.value))+` تومان `,1))]),e.minRolls>0?(a(),f(`p`,Q,` حداقل سفارش: `+s(S(E)(e.minRolls))+` طاقه `,1)):d(``,!0),l(M,{class:`product-order-modal__submit`,disabled:e.loading,onClick:A},{default:r(()=>[p(s(e.loading?`در حال ثبت...`:`ثبت`),1)]),_:1},8,[`disabled`])])])])):d(``,!0)]))}}),[[`__scopeId`,`data-v-9e750bcd`]]),Oe={key:0,class:`page product-detail product-page`},ke={key:0,class:`catalog-success-banner`,role:`status`},Ae={class:`pd-header mobile-only`},je={class:`pd-header__actions`},Me=[`aria-label`,`aria-pressed`],Ne={class:`desktop-page__head desktop-only pd-desk-head`},Pe={class:`desktop-page__title`},Fe={class:`desktop-page__subtitle`},Ie={class:`pd-desk-head__actions`},Le=[`aria-label`,`aria-pressed`],Re={class:`page__scroll pd-scroll product-page__scroll`},ze={class:`product-page__layout`},Be={class:`product-page__main`},Ve={class:`gallery`},He={class:`gallery__stage`},Ue={key:0,class:`gallery__dots`,role:`tablist`,"aria-label":`تصاویر محصول`},We=[`aria-label`,`aria-selected`,`onClick`],Ge={class:`gallery__thumbs`},Ke=[`onClick`],qe={class:`pd-body`},Je={class:`title-row`},Ye={key:0,class:`new-badge`},Xe={class:`code`},Ze={class:`specs`},Qe={class:`spec-cell`},$e={class:`spec-icon`,"aria-hidden":`true`},et={class:`spec-cell`},tt={class:`spec-cell`},nt={class:`spec-icon`,"aria-hidden":`true`},rt={class:`spec-cell`},it={class:`spec-icon`,"aria-hidden":`true`},at={key:0,class:`specs-extra`},ot={class:`pd-section pd-section--boxed`},st={class:`section-head`},ct={class:`colors`},lt=[`onClick`],ut={class:`pd-section`},dt={class:`tags`,role:`list`},ft=[`onClick`],pt={class:`pd-section`},mt={class:`roll-field`},ht={class:`product-page__sidebar desktop-only`},gt={class:`cart-summary-panel`},_t={class:`cart-summary-panel__row`},vt={class:`cart-summary-panel__row`},yt={class:`cart-summary-panel__btn`},bt=[`disabled`],xt=[`src`],St={class:`pd-footer mobile-only sticky-footer`},Ct={class:`pd-footer__primary`},wt={class:`min-note`},Tt=[`disabled`],Et=[`src`],Dt={key:1,class:`page empty`},Ot={key:2,class:`page empty`},kt=b(C({__name:`ProductDetailView`,setup(t){let r={suit:`پارچه کتشلواری`,trousers:`پارچه شلواری`,shirt:`پارچه پیراهنی`},i={summer:`پارچه تابستانه`,winter:`پارچه زمستانه`,all_season:`پارچه چهارفصل`},m=ee(),y=k(),{goBack:b}=se(`/products`),x=oe(),C=te(),w=O(),T=D(),j=u(()=>String(m.query.id??``)),M=v(null),N=v(!0),F=v(null),I=v(0),L=v(1),R=v(!1),z=v(!1),B=v(!1),V=v(``),{requesting:H,successMessage:U,addressModalOpen:ge,addressError:_e,requestCatalog:ye,submitAddressAndRequest:be,closeAddressModal:xe}=he(),W=u(()=>M.value?.rollMeters??50),G=u(()=>{let e=M.value;return e?de(e.colors,e.colorImages,e.imageUrls,I.value,e.imageUrl):``}),K=u(()=>M.value?.colors[I.value]??``),q=u(()=>L.value*W.value),J=u(()=>{let e=M.value?.minMeterage;return e&&e>0?e:W.value}),Y=u(()=>Math.max(1,Math.ceil(J.value/W.value))),Se=u(()=>r[M.value?.categoryId??``]||`—`),Ce=u(()=>i[M.value?.season??``]||`—`),we=u(()=>{let e=M.value;if(!e)return[];let t=[],n=ae.some(t=>t.id===e.categoryId)?e.categoryId:``,a=n?r[n]:``;a&&t.push({key:`usage-${n}`,label:a,to:{path:`/products`,query:{categoryId:n}}});let o=ie.some(t=>t.id===e.season)?e.season:``,s=o?i[o]:``;s&&t.push({key:`season-${o}`,label:s,to:{path:`/products`,query:{season:o}}});let c=new Set(t.flatMap(e=>[e.label,e.label.replace(/^پارچه\s*/,``)]));for(let n of e.tags){let e=n.replace(/^پارچه?های?\s*/,``).trim();if(!e||c.has(e)||t.some(t=>t.label.includes(e)))continue;let r=n.startsWith(`پارچه`)?n:`پارچه ${e}`;c.add(e),t.push({key:`tag-${n}`,label:r})}return t});async function X(){if(!j.value){M.value=null,N.value=!1;return}N.value=!0,F.value=null;try{await Promise.all([C.hydrate(),T.loadCompanies()]),M.value=await x.loadProductById(j.value),I.value=0,L.value=Y.value}catch(e){M.value=null,F.value=e instanceof Error?e.message:`محصول یافت نشد.`}finally{N.value=!1}}g(X),c(j,X);function Te(e,t=I.value){let n=e.rollMeters||50,r=e.orderMultiplier&&e.orderMultiplier>0?e.orderMultiplier:n,i=e.minMeterage&&e.minMeterage>0?e.minMeterage:n;return{id:e.id,companyId:e.companyId||``,catalogId:e.catalogId||``,name:e.name,code:e.code,color:e.color||e.colors[t]||`—`,minMeterage:i,orderMultiplier:r,basePrice:e.basePrice,isActive:!0}}function Ee(e,t,n){let r=t>0?t:1,i=Math.ceil(e/r)*r,a=Math.ceil(n/r)*r;return Math.max(i,a)}function Z(){M.value&&(V.value=``,B.value=!0)}function Q(){B.value=!1,V.value=``}async function kt(e){let t=M.value;if(!t)return;let n=t.colors.map((t,n)=>({color:t,idx:n,rolls:e[n]??0})).filter(e=>e.rolls>0);if(!n.length){V.value=`حداقل یک رنگ با تعداد انتخاب کنید.`;return}let r=n.reduce((e,t)=>e+t.rolls,0)*W.value;if(r<J.value){V.value=`حداقل سفارش ${E(Y.value)} طاقه است.`;return}let i=n[0],a=Te(t,i.idx),o=Ee(r,a.orderMultiplier,a.minMeterage),s=n.map(e=>`${e.color||`رنگ ${e.idx+1}`}: ${E(e.rolls)} طاقه`).join(`، `);R.value=!0,V.value=``;try{let e=await w.addItem(a,t.catalogCode||t.code,o,s,!0);if(!e.success){V.value=e.message??`افزودن به سفارش ناموفق بود.`;return}Q()}finally{R.value=!1}}function At(){M.value&&C.toggle(M.value.id)}function jt(){let e=window.location.href;if(navigator.share){navigator.share({title:M.value?.name,url:e}).catch(()=>void 0);return}navigator.clipboard?.writeText(e)}function $(){!M.value||H.value||ye(M.value)}function Mt(e){be(e)}return(t,r)=>M.value?(a(),f(`div`,Oe,[S(U)?(a(),f(`p`,ke,s(S(U)),1)):d(``,!0),_(`header`,Ae,[_(`button`,{type:`button`,class:`icon-btn`,"aria-label":`بازگشت`,onClick:r[0]||=(...e)=>S(b)&&S(b)(...e)},[l(ne,{size:20})]),_(`div`,je,[_(`button`,{type:`button`,class:`icon-btn`,"aria-label":S(C).isFavorite(M.value.id)?`حذف از علاقهمندیها`:`افزودن به علاقهمندیها`,"aria-pressed":S(C).isFavorite(M.value.id),onClick:At},[l(ue,{size:20,filled:S(C).isFavorite(M.value.id),color:S(C).isFavorite(M.value.id)?`var(--color-primary)`:void 0},null,8,[`filled`,`color`])],8,Me),_(`button`,{type:`button`,class:`icon-btn`,"aria-label":`اشتراکگذاری`,onClick:jt},[l(fe,{size:20})])])]),_(`header`,Ne,[_(`div`,null,[_(`h1`,Pe,s(M.value.name),1),_(`p`,Fe,`کد محصول: `+s(M.value.code),1)]),_(`div`,Ie,[_(`button`,{type:`button`,class:`icon-btn`,"aria-label":S(C).isFavorite(M.value.id)?`حذف از علاقهمندیها`:`افزودن به علاقهمندیها`,"aria-pressed":S(C).isFavorite(M.value.id),onClick:At},[l(ue,{size:20,filled:S(C).isFavorite(M.value.id),color:S(C).isFavorite(M.value.id)?`var(--color-primary)`:void 0},null,8,[`filled`,`color`])],8,Le),_(`button`,{type:`button`,class:`icon-btn`,"aria-label":`اشتراکگذاری`,onClick:jt},[l(fe,{size:20})])])]),_(`div`,Re,[_(`div`,ze,[_(`div`,Be,[_(`div`,Ve,[_(`div`,He,[_(`div`,{class:`gallery__main`,style:o(G.value?{backgroundImage:`url(${G.value})`,backgroundSize:`cover`,backgroundPosition:`center`}:S(P)(K.value))},null,4),M.value.colors.length>1?(a(),f(`div`,Ue,[(a(!0),f(h,null,n(M.value.colors,(t,n)=>(a(),f(`button`,{key:n,type:`button`,class:e([`gallery__dot`,{"gallery__dot--active":I.value===n}]),"aria-label":t||`تصویر ${n+1}`,"aria-selected":I.value===n,onClick:e=>I.value=n},null,10,We))),128))])):d(``,!0)]),_(`div`,Ge,[(a(!0),f(h,null,n(M.value.colors,(t,n)=>(a(),f(`button`,{key:n,type:`button`,class:e([`thumb`,{"thumb--active":I.value===n}]),onClick:e=>I.value=n},[_(`span`,{class:`thumb__swatch`,style:o(S(P)(t,M.value.colorImages?.[n]||M.value.imageUrls?.[n]))},null,4)],10,Ke))),128))])]),_(`div`,qe,[_(`div`,Je,[_(`h1`,null,s(M.value.name),1),M.value.isNew?(a(),f(`span`,Ye,`جدید`)):d(``,!0)]),_(`p`,Xe,`کد محصول: `+s(M.value.code),1),_(`div`,Ze,[_(`div`,Qe,[_(`span`,$e,[l(pe,{color:`#98a2ad`})]),r[3]||=_(`span`,null,`عرض`,-1),_(`strong`,null,s(S(E)(M.value.widthCm))+` سانتیمتر`,1)]),_(`div`,et,[r[4]||=_(`span`,{class:`spec-icon`,"aria-hidden":`true`},[_(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`},[_(`path`,{d:`M12 3.5 20 8v8l-8 4.5L4 16V8l8-4.5Z`})])],-1),r[5]||=_(`span`,null,`جنس`,-1),_(`strong`,null,s(M.value.composition||`—`),1)]),_(`div`,tt,[_(`span`,nt,[l(ce,{size:22,color:`#98a2ad`})]),r[6]||=_(`span`,null,`وزن`,-1),_(`strong`,null,s(M.value.weightGrams?`${S(E)(M.value.weightGrams)} گرم`:`—`),1)]),_(`div`,rt,[_(`span`,it,[l(me,{color:`#98a2ad`})]),r[7]||=_(`span`,null,`نوع بافت`,-1),_(`strong`,null,s(M.value.weaveType||`—`),1)])]),_(`button`,{type:`button`,class:`specs-more`,onClick:r[1]||=e=>z.value=!z.value},[p(s(z.value?`بستن مشخصات`:`مشاهده همه مشخصات`)+` `,1),(a(),f(`svg`,{class:e([`specs-more__chevron`,{"is-open":z.value}]),viewBox:`0 0 12 12`,"aria-hidden":`true`},[...r[8]||=[_(`path`,{d:`M3 4.5 6 8l3-3.5`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.4`,"stroke-linecap":`round`},null,-1)]],2))]),z.value?(a(),f(`div`,at,[_(`p`,null,`فصل: `+s(Ce.value),1),_(`p`,null,`دسته: `+s(Se.value),1),_(`p`,null,`جمع سفارش: `+s(S(E)(q.value))+` متر`,1)])):d(``,!0),_(`section`,ot,[_(`div`,st,[r[9]||=_(`h2`,null,`رنگبندی`,-1),_(`span`,null,`(`+s(S(E)(M.value.colors.length))+` رنگ موجود)`,1)]),_(`div`,ct,[(a(!0),f(h,null,n(M.value.colors,(t,n)=>(a(),f(`button`,{key:n,type:`button`,class:e([`color-dot`,{"color-dot--active":I.value===n}]),style:o(S(P)(t,M.value.colorImages?.[n]||M.value.imageUrls?.[n])),onClick:e=>I.value=n},null,14,lt))),128))])]),_(`section`,ut,[r[10]||=_(`h2`,{class:`section-title`},`دستهبندی`,-1),_(`div`,dt,[(a(!0),f(h,null,n(we.value,t=>(a(),f(`button`,{key:t.key,type:`button`,class:e([`tag`,{"tag--link":!!t.to}]),role:`listitem`,onClick:e=>t.to&&S(y).push(t.to)},s(t.label),11,ft))),128))])]),_(`section`,pt,[r[11]||=_(`h2`,{class:`section-title`},`متراژ هر طاقه`,-1),_(`div`,mt,s(S(E)(M.value.rollMeters))+` متر`,1)])])]),_(`aside`,ht,[_(`div`,gt,[r[15]||=_(`h2`,{class:`cart-summary-panel__title`},`ثبت سفارش`,-1),_(`div`,_t,[r[12]||=_(`span`,null,`متراژ سفارش`,-1),_(`strong`,null,s(S(E)(q.value))+` متر`,1)]),_(`div`,vt,[r[13]||=_(`span`,null,`حداقل سفارش`,-1),_(`strong`,null,s(S(E)(Y.value))+` طاقه`,1)]),_(`div`,yt,[_(`button`,{type:`button`,class:`btn-primary`,onClick:Z},[l(A,{size:18,color:`#ffffff`}),r[14]||=p(` افزودن به سفارش `,-1)])]),_(`button`,{type:`button`,class:`btn-secondary pd-desk-catalog-btn`,disabled:S(H),onClick:$},[_(`img`,{class:`btn-secondary__icon`,src:S(le),alt:``,"aria-hidden":`true`},null,8,xt),p(` `+s(S(H)?`در حال ثبت...`:`درخواست کالیته`),1)],8,bt)])])])]),_(`footer`,St,[_(`div`,Ct,[_(`button`,{type:`button`,class:`btn-primary`,onClick:Z},[l(A,{size:18,color:`#ffffff`}),r[16]||=p(` افزودن به سفارش `,-1)]),_(`p`,wt,`حداقل سفارش: `+s(S(E)(Y.value))+` طاقه`,1)]),_(`button`,{type:`button`,class:`btn-secondary`,disabled:S(H),onClick:$},[_(`img`,{class:`btn-secondary__icon`,src:S(le),alt:``,"aria-hidden":`true`},null,8,Et),p(` `+s(S(H)?`در حال ثبت...`:`درخواست کالیته`),1)],8,Tt)]),l(ve,{open:S(ge),loading:S(H),error:S(_e),onClose:S(xe),onSubmit:Mt},null,8,[`open`,`loading`,`error`,`onClose`]),l(De,{open:B.value,product:M.value,"roll-meters":W.value,"min-rolls":Y.value,"base-price":M.value.basePrice,loading:R.value,error:V.value,onClose:Q,onSubmit:kt},null,8,[`open`,`product`,`roll-meters`,`min-rolls`,`base-price`,`loading`,`error`])])):N.value?(a(),f(`div`,Dt,[l(re,{variant:`detail`})])):(a(),f(`div`,Ot,[_(`p`,null,s(F.value||`محصول یافت نشد.`),1),_(`button`,{type:`button`,onClick:r[2]||=e=>S(y).push(`/products`)},`بازگشت به لیست`)]))}}),[[`__scopeId`,`data-v-79685c20`]]);export{kt as default}; |