Files
nademitex_user/dist/assets/ProductDetailView-BxbbLfCJ.js
T
mohmdsdgandCopilot adb6ca47cd fix(auth): secure sessions and app routing
Validate sessions against the API, honor configurable base paths, and route unknown pages to 404. Keep development ports stable so user and admin apps cannot be confused.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-24 20:14:11 +03:30

1 line
20 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{D as e,E as t,Et as n,G as r,J as i,Kt as a,M as o,N as s,O as c,P as l,S as u,T as d,U as f,Xt as p,Yt as m,Z as h,at as g,b as _,ct as v,g as y,h as b,j as x,st as S,t as C,vt as w,w as T}from"./_plugin-vue_export-helper-Bo3WtfwJ.js";import{s as E,u as D}from"./BasicIcon-BXxbbWA_.js";import{o as O}from"./format-C72AoJ2H.js";import{t as k}from"./catalog-CIw6in_a.js";import{A,O as ee,c as j,l as te,n as M}from"./index-BAQfYU-Q.js";import{t as ne}from"./IconChevronBack-DfGoZJJk.js";import{t as re}from"./PageSkeleton-DHtB6RUa.js";import{a as ie,o as ae,t as oe}from"./crm-CooNUbmr.js";import{t as N}from"./catalogRequests-DB19-0hk.js";import{t as se}from"./useGoBack-TJZZv7or.js";import{t as ce}from"./IconShoppingBag-BeSLUxcB.js";import{t as le}from"./quick-catalog-request-Di7-t6Ua.js";import{t as ue}from"./IconHeart-Be5RRWq4.js";import{n as P,t as de}from"./colorSwatch-BgOH1LE5.js";var F=[`width`,`height`],I=[`stroke`],L=[`stroke`],R=[`stroke`],fe=l({__name:`IconShare`,props:{size:{default:20},color:{default:`#9AA3AF`}},setup(e){return(t,n)=>(i(),c(`svg`,{width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`},[d(`path`,{d:`M12 3.5v11`,stroke:e.color,"stroke-width":`1.5`,"stroke-linecap":`round`},null,8,I),d(`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),d(`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=l({__name:`IconRuler`,props:{size:{default:22},color:{default:`currentColor`}},setup(e){return(t,n)=>(i(),c(`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]||=[x(`<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=l({__name:`IconWeave`,props:{size:{default:22},color:{default:`currentColor`}},setup(e){return(t,n)=>(i(),c(`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]||=[x(`<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=w(!1),r=w(``),i=w(!1),a=w(null),o=w(``);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=C(l({__name:`AddressCompletionModal`,props:{open:{type:Boolean},loading:{type:Boolean},error:{}},emits:[`close`,`submit`],setup(n,{emit:r}){let a=n,l=r,m=w(``);g(()=>a.open,e=>{e&&(m.value=``)});function h(e){e.key===`Escape`&&a.open&&l(`close`)}g(()=>a.open,e=>{document.body.style.overflow=e?`hidden`:``,e?window.addEventListener(`keydown`,h):window.removeEventListener(`keydown`,h)},{immediate:!0}),f(()=>{document.body.style.overflow=``,window.removeEventListener(`keydown`,h)});function _(){l(`submit`,m.value)}return(r,a)=>(i(),t(u,{to:`body`},[n.open?(i(),c(`div`,{key:0,class:`dialog-overlay address-modal-overlay`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`address-modal-title`,onClick:a[2]||=D(e=>l(`close`),[`self`])},[d(`div`,H,[a[5]||=d(`h3`,{id:`address-modal-title`,class:`address-modal__title`},`تکمیل آدرس`,-1),a[6]||=d(`p`,{class:`address-modal__hint`},` برای ارسال کالیته فیزیکی، آدرس محل فعالیت خود را وارد کنید. این آدرس در اطلاعات کاربری شما ذخیره می‌شود. `,-1),d(`label`,U,[a[3]||=d(`span`,{class:`form-label`},`آدرس`,-1),v(d(`textarea`,{"onUpdate:modelValue":a[0]||=e=>m.value=e,class:`address-modal__textarea`,rows:`3`,maxlength:`500`,placeholder:`آدرس کامل محل فعالیت`},null,512),[[E,m.value]])]),n.error?(i(),c(`p`,ge,p(n.error),1)):e(``,!0),d(`div`,_e,[s(M,{variant:`outline`,disabled:n.loading,onClick:a[1]||=e=>l(`close`)},{default:S(()=>[...a[4]||=[o(` انصراف `,-1)]]),_:1},8,[`disabled`]),s(M,{disabled:n.loading,onClick:_},{default:S(()=>[o(p(n.loading?`در حال ثبت...`:`ثبت درخواست`),1)]),_:1},8,[`disabled`])])])])):e(``,!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=C(l({__name:`ProductOrderModal`,props:{open:{type:Boolean},product:{},rollMeters:{},minRolls:{},basePrice:{},loading:{type:Boolean},error:{}},emits:[`close`,`submit`],setup(r,{emit:a}){let l=r,v=a,y=w([]);g(()=>[l.open,l.product?.colors.length],([e])=>{!e||!l.product||(y.value=l.product.colors.map(()=>0))});let b=T(()=>y.value.reduce((e,t)=>e+(t>0?t:0),0)),x=T(()=>b.value*l.rollMeters),C=T(()=>!l.basePrice||x.value<=0?null:l.basePrice*x.value);function E(e){e.key===`Escape`&&l.open&&v(`close`)}g(()=>l.open,e=>{document.body.style.overflow=e?`hidden`:``,e?window.addEventListener(`keydown`,E):window.removeEventListener(`keydown`,E)},{immediate:!0}),f(()=>{document.body.style.overflow=``,window.removeEventListener(`keydown`,E)});function k(e,t){let n=[...y.value];n[e]=Math.max(0,(n[e]??0)+t),y.value=n}function A(){v(`submit`,[...y.value])}return(a,l)=>(i(),t(u,{to:`body`},[r.open&&r.product?(i(),c(`div`,{key:0,class:`dialog-overlay product-order-overlay`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`product-order-title`,onClick:l[1]||=D(e=>v(`close`),[`self`])},[d(`div`,ye,[d(`header`,be,[l[2]||=d(`h3`,{id:`product-order-title`,class:`product-order-modal__title`},`ثبت سفارش`,-1),d(`button`,{type:`button`,class:`product-order-modal__close`,"aria-label":`بستن`,onClick:l[0]||=e=>v(`close`)},` × `)]),l[4]||=d(`div`,{class:`product-order-modal__table-head`,"aria-hidden":`true`},[d(`span`,null,`رنگ`),d(`span`,null,`تعداد`)],-1),d(`ul`,xe,[(i(!0),c(_,null,h(r.product.colors,(t,a)=>(i(),c(`li`,{key:a,class:`product-order-row`},[d(`div`,W,[d(`span`,{class:`product-order-row__swatch`,style:m(n(P)(t,r.product.colorImages?.[a]||r.product.imageUrls?.[a])),title:t},null,12,G),t?(i(),c(`span`,K,p(t),1)):e(``,!0)]),d(`div`,q,[d(`button`,{type:`button`,class:`product-order-row__btn`,"aria-label":`کاهش`,disabled:r.loading||(y.value[a]??0)<=0,onClick:e=>k(a,-1)},` − `,8,J),d(`span`,Y,p(n(O)(y.value[a]??0)),1),d(`button`,{type:`button`,class:`product-order-row__btn`,"aria-label":`افزایش`,disabled:r.loading,onClick:e=>k(a,1)},` + `,8,Se)])]))),128))]),r.error?(i(),c(`p`,Ce,p(r.error),1)):e(``,!0),d(`footer`,we,[d(`div`,X,[l[3]||=d(`span`,null,`قیمت`,-1),C.value==null?b.value>0?(i(),c(`strong`,Ee,p(n(O)(x.value))+` متر `,1)):(i(),c(`strong`,Z,`—`)):(i(),c(`strong`,Te,p(n(O)(C.value))+` تومان `,1))]),r.minRolls>0?(i(),c(`p`,Q,` حداقل سفارش: `+p(n(O)(r.minRolls))+` طاقه `,1)):e(``,!0),s(M,{class:`product-order-modal__submit`,disabled:r.loading,onClick:A},{default:S(()=>[o(p(r.loading?`در حال ثبت...`:`ثبت`),1)]),_:1},8,[`disabled`])])])])):e(``,!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=C(l({__name:`ProductDetailView`,setup(t){let l={suit:`پارچه کت‌شلواری`,trousers:`پارچه شلواری`,shirt:`پارچه پیراهنی`},u={summer:`پارچه تابستانه`,winter:`پارچه زمستانه`,all_season:`پارچه چهارفصل`},f=b(),v=y(),{goBack:x}=se(`/products`),S=oe(),C=te(),E=A(),D=k(),j=T(()=>String(f.query.id??``)),M=w(null),N=w(!0),F=w(null),I=w(0),L=w(1),R=w(!1),z=w(!1),B=w(!1),V=w(``),{requesting:H,successMessage:U,addressModalOpen:ge,addressError:_e,requestCatalog:ye,submitAddressAndRequest:be,closeAddressModal:xe}=he(),W=T(()=>M.value?.rollMeters??50),G=T(()=>{let e=M.value;return e?de(e.colors,e.colorImages,e.imageUrls,I.value,e.imageUrl):``}),K=T(()=>M.value?.colors[I.value]??``),q=T(()=>L.value*W.value),J=T(()=>{let e=M.value?.minMeterage;return e&&e>0?e:W.value}),Y=T(()=>Math.max(1,Math.ceil(J.value/W.value))),Se=T(()=>l[M.value?.categoryId??``]||`—`),Ce=T(()=>u[M.value?.season??``]||`—`),we=T(()=>{let e=M.value;if(!e)return[];let t=[],n=ae.some(t=>t.id===e.categoryId)?e.categoryId:``,r=n?l[n]:``;r&&t.push({key:`usage-${n}`,label:r,to:{path:`/products`,query:{categoryId:n}}});let i=ie.some(t=>t.id===e.season)?e.season:``,a=i?u[i]:``;a&&t.push({key:`season-${i}`,label:a,to:{path:`/products`,query:{season:i}}});let o=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||o.has(e)||t.some(t=>t.label.includes(e)))continue;let r=n.startsWith(`پارچه`)?n:`پارچه ${e}`;o.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(),D.loadCompanies()]),M.value=await S.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}}r(X),g(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=`حداقل سفارش ${O(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}`}: ${O(e.rolls)} طاقه`).join(`، `);R.value=!0,V.value=``;try{let e=await E.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?(i(),c(`div`,Oe,[n(U)?(i(),c(`p`,ke,p(n(U)),1)):e(``,!0),d(`header`,Ae,[d(`button`,{type:`button`,class:`icon-btn`,"aria-label":`بازگشت`,onClick:r[0]||=(...e)=>n(x)&&n(x)(...e)},[s(ne,{size:20})]),d(`div`,je,[d(`button`,{type:`button`,class:`icon-btn`,"aria-label":n(C).isFavorite(M.value.id)?`حذف از علاقه‌مندی‌ها`:`افزودن به علاقه‌مندی‌ها`,"aria-pressed":n(C).isFavorite(M.value.id),onClick:At},[s(ue,{size:20,filled:n(C).isFavorite(M.value.id),color:n(C).isFavorite(M.value.id)?`#0a353c`:void 0},null,8,[`filled`,`color`])],8,Me),d(`button`,{type:`button`,class:`icon-btn`,"aria-label":`اشتراک‌گذاری`,onClick:jt},[s(fe,{size:20})])])]),d(`header`,Ne,[d(`div`,null,[d(`h1`,Pe,p(M.value.name),1),d(`p`,Fe,`کد محصول: `+p(M.value.code),1)]),d(`div`,Ie,[d(`button`,{type:`button`,class:`icon-btn`,"aria-label":n(C).isFavorite(M.value.id)?`حذف از علاقه‌مندی‌ها`:`افزودن به علاقه‌مندی‌ها`,"aria-pressed":n(C).isFavorite(M.value.id),onClick:At},[s(ue,{size:20,filled:n(C).isFavorite(M.value.id),color:n(C).isFavorite(M.value.id)?`#0a353c`:void 0},null,8,[`filled`,`color`])],8,Le),d(`button`,{type:`button`,class:`icon-btn`,"aria-label":`اشتراک‌گذاری`,onClick:jt},[s(fe,{size:20})])])]),d(`div`,Re,[d(`div`,ze,[d(`div`,Be,[d(`div`,Ve,[d(`div`,He,[d(`div`,{class:`gallery__main`,style:m(G.value?{backgroundImage:`url(${G.value})`,backgroundSize:`cover`,backgroundPosition:`center`}:n(P)(K.value))},null,4),M.value.colors.length>1?(i(),c(`div`,Ue,[(i(!0),c(_,null,h(M.value.colors,(e,t)=>(i(),c(`button`,{key:t,type:`button`,class:a([`gallery__dot`,{"gallery__dot--active":I.value===t}]),"aria-label":e||`تصویر ${t+1}`,"aria-selected":I.value===t,onClick:e=>I.value=t},null,10,We))),128))])):e(``,!0)]),d(`div`,Ge,[(i(!0),c(_,null,h(M.value.colors,(e,t)=>(i(),c(`button`,{key:t,type:`button`,class:a([`thumb`,{"thumb--active":I.value===t}]),onClick:e=>I.value=t},[d(`span`,{class:`thumb__swatch`,style:m(n(P)(e,M.value.colorImages?.[t]||M.value.imageUrls?.[t]))},null,4)],10,Ke))),128))])]),d(`div`,qe,[d(`div`,Je,[d(`h1`,null,p(M.value.name),1),M.value.isNew?(i(),c(`span`,Ye,`جدید`)):e(``,!0)]),d(`p`,Xe,`کد محصول: `+p(M.value.code),1),d(`div`,Ze,[d(`div`,Qe,[d(`span`,$e,[s(pe,{color:`#98a2ad`})]),r[3]||=d(`span`,null,`عرض`,-1),d(`strong`,null,p(n(O)(M.value.widthCm))+` سانتی‌متر`,1)]),d(`div`,et,[r[4]||=d(`span`,{class:`spec-icon`,"aria-hidden":`true`},[d(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`},[d(`path`,{d:`M12 3.5 20 8v8l-8 4.5L4 16V8l8-4.5Z`})])],-1),r[5]||=d(`span`,null,`جنس`,-1),d(`strong`,null,p(M.value.composition||`—`),1)]),d(`div`,tt,[d(`span`,nt,[s(ce,{size:22,color:`#98a2ad`})]),r[6]||=d(`span`,null,`وزن`,-1),d(`strong`,null,p(M.value.weightGrams?`${n(O)(M.value.weightGrams)} گرم`:`—`),1)]),d(`div`,rt,[d(`span`,it,[s(me,{color:`#98a2ad`})]),r[7]||=d(`span`,null,`نوع بافت`,-1),d(`strong`,null,p(M.value.weaveType||`—`),1)])]),d(`button`,{type:`button`,class:`specs-more`,onClick:r[1]||=e=>z.value=!z.value},[o(p(z.value?`بستن مشخصات`:`مشاهده همه مشخصات`)+` `,1),(i(),c(`svg`,{class:a([`specs-more__chevron`,{"is-open":z.value}]),viewBox:`0 0 12 12`,"aria-hidden":`true`},[...r[8]||=[d(`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?(i(),c(`div`,at,[d(`p`,null,`فصل: `+p(Ce.value),1),d(`p`,null,`دسته: `+p(Se.value),1),d(`p`,null,`جمع سفارش: `+p(n(O)(q.value))+` متر`,1)])):e(``,!0),d(`section`,ot,[d(`div`,st,[r[9]||=d(`h2`,null,`رنگ‌بندی`,-1),d(`span`,null,`(`+p(n(O)(M.value.colors.length))+` رنگ موجود)`,1)]),d(`div`,ct,[(i(!0),c(_,null,h(M.value.colors,(e,t)=>(i(),c(`button`,{key:t,type:`button`,class:a([`color-dot`,{"color-dot--active":I.value===t}]),style:m(n(P)(e,M.value.colorImages?.[t]||M.value.imageUrls?.[t])),onClick:e=>I.value=t},null,14,lt))),128))])]),d(`section`,ut,[r[10]||=d(`h2`,{class:`section-title`},`دسته‌بندی`,-1),d(`div`,dt,[(i(!0),c(_,null,h(we.value,e=>(i(),c(`button`,{key:e.key,type:`button`,class:a([`tag`,{"tag--link":!!e.to}]),role:`listitem`,onClick:t=>e.to&&n(v).push(e.to)},p(e.label),11,ft))),128))])]),d(`section`,pt,[r[11]||=d(`h2`,{class:`section-title`},`متراژ هر طاقه`,-1),d(`div`,mt,p(n(O)(M.value.rollMeters))+` متر`,1)])])]),d(`aside`,ht,[d(`div`,gt,[r[15]||=d(`h2`,{class:`cart-summary-panel__title`},`ثبت سفارش`,-1),d(`div`,_t,[r[12]||=d(`span`,null,`متراژ سفارش`,-1),d(`strong`,null,p(n(O)(q.value))+` متر`,1)]),d(`div`,vt,[r[13]||=d(`span`,null,`حداقل سفارش`,-1),d(`strong`,null,p(n(O)(Y.value))+` طاقه`,1)]),d(`div`,yt,[d(`button`,{type:`button`,class:`btn-primary`,onClick:Z},[s(ee,{size:18,color:`#ffffff`}),r[14]||=o(` افزودن به سفارش `,-1)])]),d(`button`,{type:`button`,class:`btn-secondary pd-desk-catalog-btn`,disabled:n(H),onClick:$},[d(`img`,{class:`btn-secondary__icon`,src:n(le),alt:``,"aria-hidden":`true`},null,8,xt),o(` `+p(n(H)?`در حال ثبت...`:`درخواست کالیته`),1)],8,bt)])])])]),d(`footer`,St,[d(`div`,Ct,[d(`button`,{type:`button`,class:`btn-primary`,onClick:Z},[s(ee,{size:18,color:`#ffffff`}),r[16]||=o(` افزودن به سفارش `,-1)]),d(`p`,wt,`حداقل سفارش: `+p(n(O)(Y.value))+` طاقه`,1)]),d(`button`,{type:`button`,class:`btn-secondary`,disabled:n(H),onClick:$},[d(`img`,{class:`btn-secondary__icon`,src:n(le),alt:``,"aria-hidden":`true`},null,8,Et),o(` `+p(n(H)?`در حال ثبت...`:`درخواست کالیته`),1)],8,Tt)]),s(ve,{open:n(ge),loading:n(H),error:n(_e),onClose:n(xe),onSubmit:Mt},null,8,[`open`,`loading`,`error`,`onClose`]),s(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?(i(),c(`div`,Dt,[s(re,{variant:`detail`})])):(i(),c(`div`,Ot,[d(`p`,null,p(F.value||`محصول یافت نشد.`),1),d(`button`,{type:`button`,onClick:r[2]||=e=>n(v).push(`/products`)},`بازگشت به لیست`)]))}}),[[`__scopeId`,`data-v-dbc81cbc`]]);export{kt as default};