diff --git a/dist/assets/ActiveSwitchCell-4PQpvsIu.js b/dist/assets/ActiveSwitchCell-4PQpvsIu.js
new file mode 100644
index 0000000..a394bae
--- /dev/null
+++ b/dist/assets/ActiveSwitchCell-4PQpvsIu.js
@@ -0,0 +1 @@
+import{A as e,ct as t,et as n,g as r,l as i}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a}from"./http-CTjL79ty.js";import{B as o}from"./index-DxcN1-hp.js";import{t as s}from"./BaseSwitch-Dz4ODUhf.js";function c(e=480){return new Promise(t=>{window.setTimeout(t,e)})}function l(e){let t=n(null),r=n(null),i=a();async function o(n,a){if(t.value)return a;let o=!a;if(!o&&e.confirmOff&&!await e.confirmOff())return a;t.value=n,r.value=null;let s=a;try{return await e.onPersist(o),i.success(e.successMessage?.(o)??(o?`وضعیت فعال شد.`:`وضعیت غیرفعال شد.`)),o}catch{return r.value=n,i.error(e.errorMessage??`بهروزرسانی وضعیت انجام نشد.`),s}finally{t.value=null}}function s(e){return t.value===e}function c(e){return r.value===e}return{toggle:o,isLoading:s,hasError:c}}var u=r({__name:`ActiveSwitchCell`,props:{id:{},modelValue:{type:Boolean},entityName:{},entityType:{},persist:{type:Function}},emits:[`update:modelValue`],setup(n,{emit:r}){let a=n,u=r,{toggle:d,isLoading:f,hasError:p}=l({onPersist:async e=>{a.persist?await a.persist(a.id,e):await c()},successMessage:e=>e?`${a.entityType??`مورد`} «${a.entityName}» فعال شد.`:`${a.entityType??`مورد`} «${a.entityName}» غیرفعال شد.`});async function m(e){if(e===a.modelValue)return;let t=a.entityType??`مورد`;if(!await o({title:e?`فعالسازی ${t}`:`غیرفعالسازی ${t}`,message:e?`آیا از فعال کردن «${a.entityName}» مطمئن هستید؟`:`آیا از غیرفعال کردن «${a.entityName}» مطمئن هستید؟`,tone:e?`primary`:`danger`,confirmLabel:e?`فعال کردن`:`غیرفعال کردن`,cancelLabel:`انصراف`}))return;let n=await d(a.id,a.modelValue);u(`update:modelValue`,n)}return(r,a)=>(e(),i(s,{"model-value":n.modelValue,loading:t(f)(n.id),error:t(p)(n.id),"onUpdate:modelValue":m},null,8,[`model-value`,`loading`,`error`]))}});export{u as t};
\ No newline at end of file
diff --git a/dist/assets/ActiveSwitchCell-DIBIZfO9.js b/dist/assets/ActiveSwitchCell-DIBIZfO9.js
deleted file mode 100644
index 9ad525c..0000000
--- a/dist/assets/ActiveSwitchCell-DIBIZfO9.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,g as t,k as n,l as r,st as i}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a}from"./http-BjLkjdQu.js";import{z as o}from"./index-SWzbcuqQ.js";import{t as s}from"./BaseSwitch-pJwnFBVo.js";function c(e=480){return new Promise(t=>{window.setTimeout(t,e)})}function l(t){let n=e(null),r=e(null),i=a();async function o(e,a){if(n.value)return a;let o=!a;if(!o&&t.confirmOff&&!await t.confirmOff())return a;n.value=e,r.value=null;let s=a;try{return await t.onPersist(o),i.success(t.successMessage?.(o)??(o?`وضعیت فعال شد.`:`وضعیت غیرفعال شد.`)),o}catch{return r.value=e,i.error(t.errorMessage??`بهروزرسانی وضعیت انجام نشد.`),s}finally{n.value=null}}function s(e){return n.value===e}function c(e){return r.value===e}return{toggle:o,isLoading:s,hasError:c}}var u=t({__name:`ActiveSwitchCell`,props:{id:{},modelValue:{type:Boolean},entityName:{},entityType:{},persist:{type:Function}},emits:[`update:modelValue`],setup(e,{emit:t}){let a=e,u=t,{toggle:d,isLoading:f,hasError:p}=l({onPersist:async e=>{a.persist?await a.persist(a.id,e):await c()},successMessage:e=>e?`${a.entityType??`مورد`} «${a.entityName}» فعال شد.`:`${a.entityType??`مورد`} «${a.entityName}» غیرفعال شد.`});async function m(e){if(e===a.modelValue)return;let t=a.entityType??`مورد`;if(!await o({title:e?`فعالسازی ${t}`:`غیرفعالسازی ${t}`,message:e?`آیا از فعال کردن «${a.entityName}» مطمئن هستید؟`:`آیا از غیرفعال کردن «${a.entityName}» مطمئن هستید؟`,tone:e?`primary`:`danger`,confirmLabel:e?`فعال کردن`:`غیرفعال کردن`,cancelLabel:`انصراف`}))return;let n=await d(a.id,a.modelValue);u(`update:modelValue`,n)}return(t,a)=>(n(),r(s,{"model-value":e.modelValue,loading:i(f)(e.id),error:i(p)(e.id),"onUpdate:modelValue":m},null,8,[`model-value`,`loading`,`error`]))}});export{u as t};
\ No newline at end of file
diff --git a/dist/assets/AdminCurrencyInput-BGwf-fv_.js b/dist/assets/AdminCurrencyInput-BGwf-fv_.js
deleted file mode 100644
index 197ba8e..0000000
--- a/dist/assets/AdminCurrencyInput-BGwf-fv_.js
+++ /dev/null
@@ -1 +0,0 @@
-import{Dt as e,d as t,g as n,k as r,s as i,t as a}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{c as o,r as s}from"./index-SWzbcuqQ.js";var c=[`id`,`value`,`placeholder`,`disabled`],l=a(n({__name:`AdminCurrencyInput`,props:{modelValue:{default:null},placeholder:{default:``},disabled:{type:Boolean,default:!1},id:{},inputClass:{default:`admin-input`},allowEmpty:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(n,{emit:a}){let l=n,u=a,d=i(()=>l.modelValue==null||!Number.isFinite(l.modelValue)?``:o(l.modelValue));function f(e){let t=e.target,n=s(t.value);if(!n){u(`update:modelValue`,l.allowEmpty?null:0),t.value=``;return}let r=Number(n);u(`update:modelValue`,r),t.value=o(r)}return(i,a)=>(r(),t(`input`,{id:n.id,type:`text`,inputmode:`numeric`,dir:`ltr`,class:e([`admin-currency-input`,n.inputClass]),value:d.value,placeholder:n.placeholder,disabled:n.disabled,onInput:f},null,42,c))}}),[[`__scopeId`,`data-v-56435fc8`]]);export{l as t};
\ No newline at end of file
diff --git a/dist/assets/AdminCurrencyInput-Da4QfhWv.js b/dist/assets/AdminCurrencyInput-Da4QfhWv.js
new file mode 100644
index 0000000..b441b41
--- /dev/null
+++ b/dist/assets/AdminCurrencyInput-Da4QfhWv.js
@@ -0,0 +1 @@
+import{A as e,Ot as t,d as n,g as r,s as i,t as a}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{c as o,r as s}from"./index-DxcN1-hp.js";var c=[`id`,`value`,`placeholder`,`disabled`],l=a(r({__name:`AdminCurrencyInput`,props:{modelValue:{default:null},placeholder:{default:``},disabled:{type:Boolean,default:!1},id:{},inputClass:{default:`admin-input`},allowEmpty:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(r,{emit:a}){let l=r,u=a,d=i(()=>l.modelValue==null||!Number.isFinite(l.modelValue)?``:o(l.modelValue));function f(e){let t=e.target,n=s(t.value);if(!n){u(`update:modelValue`,l.allowEmpty?null:0),t.value=``;return}let r=Number(n);u(`update:modelValue`,r),t.value=o(r)}return(i,a)=>(e(),n(`input`,{id:r.id,type:`text`,inputmode:`numeric`,dir:`ltr`,class:t([`admin-currency-input`,r.inputClass]),value:d.value,placeholder:r.placeholder,disabled:r.disabled,onInput:f},null,42,c))}}),[[`__scopeId`,`data-v-56435fc8`]]);export{l as t};
\ No newline at end of file
diff --git a/dist/assets/AdminImageLightbox-BbQANbIb.js b/dist/assets/AdminImageLightbox-BbQANbIb.js
new file mode 100644
index 0000000..0d1e796
--- /dev/null
+++ b/dist/assets/AdminImageLightbox-BbQANbIb.js
@@ -0,0 +1 @@
+import{A as e,S as t,a as n,c as r,d as i,g as a,l as o,t as s,u as c,z as l}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{m as u}from"./http-CTjL79ty.js";var d=[`src`,`alt`],f=s(a({__name:`AdminImageLightbox`,props:t({src:{},alt:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let a=l(t,`modelValue`);return(s,l)=>(e(),o(n,{to:`body`},[a.value?(e(),i(`div`,{key:0,class:`admin-image-lightbox`,onClick:l[1]||=u(e=>a.value=!1,[`self`])},[r(`button`,{type:`button`,class:`admin-image-lightbox__close`,onClick:l[0]||=e=>a.value=!1},` بستن `),r(`img`,{src:t.src,alt:t.alt??`پیشنمایش تصویر`},null,8,d)])):c(``,!0)]))}}),[[`__scopeId`,`data-v-d52b23fb`]]);export{f as t};
\ No newline at end of file
diff --git a/dist/assets/AdminImageLightbox-CE3ZJ5-o.js b/dist/assets/AdminImageLightbox-CE3ZJ5-o.js
deleted file mode 100644
index d116a7f..0000000
--- a/dist/assets/AdminImageLightbox-CE3ZJ5-o.js
+++ /dev/null
@@ -1 +0,0 @@
-import{R as e,S as t,a as n,c as r,d as i,g as a,k as o,l as s,t as c,u as l}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{m as u}from"./http-BjLkjdQu.js";var d=[`src`,`alt`],f=c(a({__name:`AdminImageLightbox`,props:t({src:{},alt:{}},{modelValue:{type:Boolean,required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(t){let a=e(t,`modelValue`);return(e,c)=>(o(),s(n,{to:`body`},[a.value?(o(),i(`div`,{key:0,class:`admin-image-lightbox`,onClick:c[1]||=u(e=>a.value=!1,[`self`])},[r(`button`,{type:`button`,class:`admin-image-lightbox__close`,onClick:c[0]||=e=>a.value=!1},` بستن `),r(`img`,{src:t.src,alt:t.alt??`پیشنمایش تصویر`},null,8,d)])):l(``,!0)]))}}),[[`__scopeId`,`data-v-d52b23fb`]]);export{f as t};
\ No newline at end of file
diff --git a/dist/assets/AdminImagePicker-D0rHEosY.css b/dist/assets/AdminImagePicker-D0rHEosY.css
deleted file mode 100644
index c5eef47..0000000
--- a/dist/assets/AdminImagePicker-D0rHEosY.css
+++ /dev/null
@@ -1 +0,0 @@
-.image-picker__label[data-v-0959163b]{margin:0 0 8px;font-size:.8125rem;font-weight:600}.image-picker__row[data-v-0959163b]{align-items:center;gap:12px;display:flex}.image-picker__preview[data-v-0959163b]{border:1px solid var(--color-border);background:#e8eceb 50%/cover no-repeat;border-radius:10px;flex-shrink:0;width:88px;height:72px}.image-picker__preview--empty[data-v-0959163b]{background:repeating-linear-gradient(45deg,#eef1f0,#eef1f0 8px,#e4e8e6 8px 16px)}.image-picker__actions[data-v-0959163b]{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.image-picker__file[data-v-0959163b]{display:none}.image-picker__error[data-v-0959163b]{width:100%;color:var(--color-danger);margin:0;font-size:.75rem}.image-picker__ok[data-v-0959163b]{width:100%;color:var(--color-success-dark);margin:0;font-size:.75rem;font-weight:600}
diff --git a/dist/assets/AdminImagePicker-DBOLHU6S.js b/dist/assets/AdminImagePicker-DBOLHU6S.js
deleted file mode 100644
index e6734d8..0000000
--- a/dist/assets/AdminImagePicker-DBOLHU6S.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,Dt as n,c as r,d as i,g as a,k as o,kt as s,st as c,t as l,u}from"./_plugin-vue_export-helper-QrIvvHC8.js";var d=960,f=.82;function p(e){let t=e.trim();return t?`url("${t.replace(/"/g,`\\"`)}")`:``}async function m(e){if(!e.type.startsWith(`image/`))throw Error(`فقط فایل تصویری مجاز است.`);if(e.size>8388608)throw Error(`حجم تصویر نباید بیشتر از ۸ مگابایت باشد.`);return g(await h(e))}function h(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result??``)),r.onerror=()=>n(Error(`خواندن تصویر ناموفق بود.`)),r.readAsDataURL(e)})}function g(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{let e=Math.min(1,d/Math.max(r.width,r.height)),i=Math.max(1,Math.round(r.width*e)),a=Math.max(1,Math.round(r.height*e)),o=document.createElement(`canvas`);o.width=i,o.height=a;let s=o.getContext(`2d`);if(!s){n(Error(`پردازش تصویر ناموفق بود.`));return}s.drawImage(r,0,0,i,a),t(o.toDataURL(`image/jpeg`,f))},r.onerror=()=>n(Error(`تصویر نامعتبر است.`)),r.src=e})}var _={class:`image-picker`},v={key:0,class:`image-picker__label`},y={class:`image-picker__row`},b={class:`image-picker__actions`},x=[`disabled`],S=[`disabled`],C={key:1,class:`image-picker__error`},w={key:2,class:`image-picker__ok`},T=l(a({__name:`AdminImagePicker`,props:{modelValue:{},label:{},showRemove:{type:Boolean,default:!0}},emits:[`update:modelValue`],setup(a,{emit:l}){let d=a,f=l,h=e(null),g=e(!1),T=e(``),E=e(!1);function D(){h.value?.click()}async function O(e){let t=e.target,n=t.files?.[0];if(t.value=``,n){g.value=!0,T.value=``,E.value=!1;try{f(`update:modelValue`,await m(n)),E.value=!0}catch(e){T.value=e instanceof Error?e.message:`بارگذاری تصویر ناموفق بود.`}finally{g.value=!1}}}function k(){f(`update:modelValue`,null)}return(e,l)=>(o(),i(`div`,_,[a.label?(o(),i(`p`,v,t(a.label),1)):u(``,!0),r(`div`,y,[r(`div`,{class:n([`image-picker__preview`,{"image-picker__preview--empty":!d.modelValue}]),style:s(d.modelValue?{backgroundImage:c(p)(d.modelValue)}:void 0)},null,6),r(`div`,b,[r(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:D},t(d.modelValue?`تغییر تصویر`:`افزودن تصویر`),9,x),d.showRemove&&d.modelValue?(o(),i(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:k},` حذف `,8,S)):u(``,!0),T.value?(o(),i(`p`,C,t(T.value),1)):E.value?(o(),i(`p`,w,`تصویر انتخاب شد — برای ثبت نهایی «ثبت» را بزنید.`)):u(``,!0)])]),r(`input`,{ref_key:`inputRef`,ref:h,type:`file`,accept:`image/*`,class:`image-picker__file`,onChange:O},null,544)]))}}),[[`__scopeId`,`data-v-0959163b`]]);export{p as n,T as t};
\ No newline at end of file
diff --git a/dist/assets/AdminImagePicker-Dh_HSRmL.css b/dist/assets/AdminImagePicker-Dh_HSRmL.css
new file mode 100644
index 0000000..f764b8e
--- /dev/null
+++ b/dist/assets/AdminImagePicker-Dh_HSRmL.css
@@ -0,0 +1 @@
+.image-picker__label[data-v-64060a40]{margin:0 0 8px;font-size:.8125rem;font-weight:600}.image-picker__row[data-v-64060a40]{align-items:center;gap:12px;display:flex}.image-picker__preview[data-v-64060a40]{border:1px solid var(--color-border);object-fit:cover;background:#e8eceb 50%/cover no-repeat;border-radius:10px;flex-shrink:0;width:88px;height:72px;display:block}.image-picker__preview-img[data-v-64060a40]{background:#e8eceb}.image-picker__preview--empty[data-v-64060a40]{background:repeating-linear-gradient(45deg,#eef1f0,#eef1f0 8px,#e4e8e6 8px 16px)}.image-picker__actions[data-v-64060a40]{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.image-picker__file[data-v-64060a40]{display:none}.image-picker__error[data-v-64060a40]{width:100%;color:var(--color-danger);margin:0;font-size:.75rem}.image-picker__ok[data-v-64060a40]{width:100%;color:var(--color-success-dark);margin:0;font-size:.75rem;font-weight:600}.image-picker--compact .image-picker__row[data-v-64060a40]{gap:10px}.image-picker__preview-hit[data-v-64060a40]{cursor:pointer;background:0 0;border:none;border-radius:10px;flex-shrink:0;padding:0;line-height:0}.image-picker__preview-hit[data-v-64060a40]:disabled{cursor:not-allowed;opacity:.65}.image-picker__preview-hit[data-v-64060a40]:focus-visible{outline:2px solid var(--color-primary,#2d6a4f);outline-offset:2px}.image-picker--compact .image-picker__preview[data-v-64060a40]{border-radius:12px;width:72px;height:72px}.image-picker--compact .image-picker__change[data-v-64060a40]{color:var(--color-primary,#2d6a4f);font-weight:600}.image-picker--compact .image-picker__error[data-v-64060a40]{font-size:.7rem}
diff --git a/dist/assets/AdminImagePicker-DhyB3HhH.js b/dist/assets/AdminImagePicker-DhyB3HhH.js
new file mode 100644
index 0000000..7c8d2f3
--- /dev/null
+++ b/dist/assets/AdminImagePicker-DhyB3HhH.js
@@ -0,0 +1 @@
+import{A as e,At as t,Ot as n,c as r,ct as i,d as a,et as o,g as s,jt as c,t as l,u}from"./_plugin-vue_export-helper-vx-p5QAT.js";var d=960,f=.82;function p(e){let t=e.trim();return t?`url("${t.replace(/"/g,`\\"`)}")`:``}async function m(e){if(!e.type.startsWith(`image/`))throw Error(`فقط فایل تصویری مجاز است.`);if(e.size>8388608)throw Error(`حجم تصویر نباید بیشتر از ۸ مگابایت باشد.`);return g(await h(e))}function h(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result??``)),r.onerror=()=>n(Error(`خواندن تصویر ناموفق بود.`)),r.readAsDataURL(e)})}function g(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>{let e=Math.min(1,d/Math.max(r.width,r.height)),i=Math.max(1,Math.round(r.width*e)),a=Math.max(1,Math.round(r.height*e)),o=document.createElement(`canvas`);o.width=i,o.height=a;let s=o.getContext(`2d`);if(!s){n(Error(`پردازش تصویر ناموفق بود.`));return}s.drawImage(r,0,0,i,a),t(o.toDataURL(`image/jpeg`,f))},r.onerror=()=>n(Error(`تصویر نامعتبر است.`)),r.src=e})}var _={key:0,class:`image-picker__label`},v={class:`image-picker__row`},y=[`disabled`,`aria-label`],b=[`src`],x={key:1,class:`image-picker__preview image-picker__preview--empty`,"aria-hidden":`true`},S={class:`image-picker__actions`},C=[`disabled`],w=[`disabled`],T={key:1,class:`image-picker__error`},E={key:2,class:`image-picker__ok`},D=l(s({__name:`AdminImagePicker`,props:{modelValue:{},label:{},showRemove:{type:Boolean,default:!0},compact:{type:Boolean,default:!1}},emits:[`update:modelValue`],setup(s,{emit:l}){let d=s,f=l,h=o(null),g=o(!1),D=o(``),O=o(!1);function k(){h.value?.click()}async function A(e){let t=e.target,n=t.files?.[0];if(t.value=``,n){g.value=!0,D.value=``,O.value=!1;try{f(`update:modelValue`,await m(n)),O.value=!0}catch(e){D.value=e instanceof Error?e.message:`بارگذاری تصویر ناموفق بود.`}finally{g.value=!1}}}function j(){f(`update:modelValue`,null)}return(o,l)=>(e(),a(`div`,{class:n([`image-picker`,{"image-picker--compact":s.compact}])},[s.label&&!s.compact?(e(),a(`p`,_,c(s.label),1)):u(``,!0),r(`div`,v,[s.compact?(e(),a(`button`,{key:0,type:`button`,class:`image-picker__preview-hit`,disabled:g.value,"aria-label":d.modelValue?`تغییر تصویر`:`افزودن تصویر`,onClick:k},[d.modelValue?(e(),a(`img`,{key:0,src:d.modelValue,alt:``,class:`image-picker__preview image-picker__preview-img`},null,8,b)):(e(),a(`span`,x))],8,y)):(e(),a(`div`,{key:1,class:n([`image-picker__preview`,{"image-picker__preview--empty":!d.modelValue}]),style:t(d.modelValue?{backgroundImage:i(p)(d.modelValue)}:void 0)},null,6)),r(`div`,S,[r(`button`,{type:`button`,class:n(s.compact?`admin-btn admin-btn--ghost admin-btn--sm image-picker__change`:`admin-btn admin-btn--outline admin-btn--sm`),disabled:g.value,onClick:k},c(d.modelValue?`تغییر تصویر`:`افزودن تصویر`),11,C),!s.compact&&d.showRemove&&d.modelValue?(e(),a(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,disabled:g.value,onClick:j},` حذف `,8,w)):u(``,!0),D.value?(e(),a(`p`,T,c(D.value),1)):O.value&&!s.compact?(e(),a(`p`,E,`تصویر انتخاب شد — برای ثبت نهایی «ثبت» را بزنید.`)):u(``,!0)])]),r(`input`,{ref_key:`inputRef`,ref:h,type:`file`,accept:`image/*`,class:`image-picker__file`,onChange:A},null,544)],2))}}),[[`__scopeId`,`data-v-64060a40`]]);export{p as n,D as t};
\ No newline at end of file
diff --git a/dist/assets/AdminPageSkeleton-oWhHYjl4.js b/dist/assets/AdminPageSkeleton-DacAHji8.js
similarity index 50%
rename from dist/assets/AdminPageSkeleton-oWhHYjl4.js
rename to dist/assets/AdminPageSkeleton-DacAHji8.js
index 55f7a47..7367f6a 100644
--- a/dist/assets/AdminPageSkeleton-oWhHYjl4.js
+++ b/dist/assets/AdminPageSkeleton-DacAHji8.js
@@ -1 +1 @@
-import{M as e,c as t,d as n,g as r,k as i,p as a,r as o,t as s}from"./_plugin-vue_export-helper-QrIvvHC8.js";var c={class:`admin-page-skeleton`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,"aria-label":`در حال بارگذاری`},l={class:`admin-card admin-page-skeleton__table`},u={key:1,class:`admin-card admin-page-skeleton__form`},d={key:2,class:`admin-card admin-page-skeleton__detail`},f={key:3,class:`admin-page-skeleton__cards`},p=s(r({__name:`AdminPageSkeleton`,props:{variant:{default:`cards`},rows:{default:5}},setup(r){return(s,p)=>(i(),n(`div`,c,[r.variant===`table`?(i(),n(o,{key:0},[p[1]||=t(`div`,{class:`admin-page-skeleton__toolbar`},[t(`span`,{class:`admin-skeleton admin-page-skeleton__search`}),t(`span`,{class:`admin-skeleton admin-page-skeleton__btn`})],-1),t(`div`,l,[(i(!0),n(o,null,e(r.rows,e=>(i(),n(`div`,{key:e,class:`admin-page-skeleton__tr`},[...p[0]||=[a(``,5)]]))),128))])],64)):r.variant===`form`?(i(),n(`div`,u,[(i(!0),n(o,null,e(r.rows,e=>(i(),n(`div`,{key:e,class:`admin-page-skeleton__field`},[...p[2]||=[t(`span`,{class:`admin-skeleton`,style:{width:`28%`,height:`10px`}},null,-1),t(`span`,{class:`admin-skeleton`,style:{width:`100%`,height:`40px`,"border-radius":`10px`}},null,-1)]]))),128))])):r.variant===`detail`?(i(),n(`div`,d,[...p[3]||=[a(``,5)]])):(i(),n(`div`,f,[(i(!0),n(o,null,e(r.rows,e=>(i(),n(`div`,{key:e,class:`admin-card admin-page-skeleton__card`},[...p[4]||=[t(`span`,{class:`admin-skeleton`,style:{width:`45%`,height:`14px`}},null,-1),t(`span`,{class:`admin-skeleton`,style:{width:`70%`,height:`11px`}},null,-1),t(`span`,{class:`admin-skeleton`,style:{width:`35%`,height:`11px`}},null,-1)]]))),128))]))]))}}),[[`__scopeId`,`data-v-8283cd1d`]]);export{p as t};
\ No newline at end of file
+import{A as e,N as t,c as n,d as r,g as i,p as a,r as o,t as s}from"./_plugin-vue_export-helper-vx-p5QAT.js";var c={class:`admin-page-skeleton`,role:`status`,"aria-live":`polite`,"aria-busy":`true`,"aria-label":`در حال بارگذاری`},l={class:`admin-card admin-page-skeleton__table`},u={key:1,class:`admin-card admin-page-skeleton__form`},d={key:2,class:`admin-card admin-page-skeleton__detail`},f={key:3,class:`admin-page-skeleton__cards`},p=s(i({__name:`AdminPageSkeleton`,props:{variant:{default:`cards`},rows:{default:5}},setup(i){return(s,p)=>(e(),r(`div`,c,[i.variant===`table`?(e(),r(o,{key:0},[p[1]||=n(`div`,{class:`admin-page-skeleton__toolbar`},[n(`span`,{class:`admin-skeleton admin-page-skeleton__search`}),n(`span`,{class:`admin-skeleton admin-page-skeleton__btn`})],-1),n(`div`,l,[(e(!0),r(o,null,t(i.rows,t=>(e(),r(`div`,{key:t,class:`admin-page-skeleton__tr`},[...p[0]||=[a(``,5)]]))),128))])],64)):i.variant===`form`?(e(),r(`div`,u,[(e(!0),r(o,null,t(i.rows,t=>(e(),r(`div`,{key:t,class:`admin-page-skeleton__field`},[...p[2]||=[n(`span`,{class:`admin-skeleton`,style:{width:`28%`,height:`10px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`100%`,height:`40px`,"border-radius":`10px`}},null,-1)]]))),128))])):i.variant===`detail`?(e(),r(`div`,d,[...p[3]||=[a(``,5)]])):(e(),r(`div`,f,[(e(!0),r(o,null,t(i.rows,t=>(e(),r(`div`,{key:t,class:`admin-card admin-page-skeleton__card`},[...p[4]||=[n(`span`,{class:`admin-skeleton`,style:{width:`45%`,height:`14px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`70%`,height:`11px`}},null,-1),n(`span`,{class:`admin-skeleton`,style:{width:`35%`,height:`11px`}},null,-1)]]))),128))]))]))}}),[[`__scopeId`,`data-v-8283cd1d`]]);export{p as t};
\ No newline at end of file
diff --git a/dist/assets/AdminSelect-6a7SFr9x.js b/dist/assets/AdminSelect-6a7SFr9x.js
deleted file mode 100644
index 030eb75..0000000
--- a/dist/assets/AdminSelect-6a7SFr9x.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,B as n,D as r,Dt as i,M as a,N as o,U as s,a as c,c as l,d as u,g as d,h as f,k as p,kt as m,l as h,r as g,s as _,t as v,u as y,w as b}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{f as x,m as S,p as C}from"./http-BjLkjdQu.js";import{I as w,j as T}from"./index-SWzbcuqQ.js";var E=[`id`],D=[`aria-label`,`aria-expanded`],O={class:`admin-select__trigger-content`},k={class:`admin-select__value`},A={class:`admin-select__chevron`,"aria-hidden":`true`},j=[`aria-label`],M={key:0,class:`admin-select__search`,role:`presentation`},N=[`placeholder`],P={key:1,class:`admin-select__empty`,role:`presentation`},F=[`aria-selected`,`onClick`],I={class:`admin-select__option-label`},L=v(d({__name:`AdminSelect`,props:{modelValue:{},options:{},placeholder:{default:`انتخاب کنید`},ariaLabel:{default:`انتخاب`},block:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:`جستجو…`},id:{default:void 0}},emits:[`update:modelValue`],setup(d,{emit:v}){let L=d,R=v,z=e(!1),B=e(``),V=e(null),H=e(null),U=e(null),W=e({});T(V,()=>{z.value=!1,B.value=``},{ignore:[H]});let G=_(()=>L.options.find(e=>e.value===L.modelValue)),K=_(()=>G.value?.label??L.placeholder),q=_(()=>{let e=B.value.trim().toLowerCase();return e?L.options.filter(t=>t.label.toLowerCase().includes(e)):L.options});function J(){let e=V.value;if(!e)return;let t=e.getBoundingClientRect(),n=Math.min(320,window.innerHeight*.5),r=window.innerHeight-t.bottom-6,i=t.top-6,a=rr,o=Math.max(120,Math.min(n,a?i:r));W.value={position:`fixed`,left:`${Math.max(8,Math.min(t.left,window.innerWidth-Math.max(t.width,220)-8))}px`,width:`${Math.max(t.width,220)}px`,zIndex:`1100`,maxHeight:`${o}px`,...a?{top:`auto`,bottom:`${window.innerHeight-t.top+6}px`}:{top:`${t.bottom+6}px`,bottom:`auto`}}}function Y(e){e?(window.addEventListener(`resize`,J),window.addEventListener(`scroll`,J,!0)):(window.removeEventListener(`resize`,J),window.removeEventListener(`scroll`,J,!0))}async function X(){z.value=!z.value,z.value&&(await b(),J(),L.searchable&&(B.value=``,await b(),U.value?.focus()))}function Z(e){R(`update:modelValue`,e),z.value=!1,B.value=``}return n(z,e=>{Y(e),e&&b(()=>J())}),r(()=>{Y(!1)}),(e,n)=>(p(),u(`div`,{id:d.id,ref_key:`rootRef`,ref:V,class:i([`admin-select`,{"admin-select--open":z.value,"admin-select--block":d.block}])},[l(`button`,{type:`button`,class:`admin-select__trigger`,"aria-label":d.ariaLabel,"aria-expanded":z.value,"aria-haspopup":`listbox`,onClick:X},[l(`span`,O,[o(e.$slots,`option-leading`,{option:G.value},void 0,!0),l(`span`,k,t(K.value),1)]),l(`span`,A,[f(w,{name:`chevron-down`,size:16})])],8,D),(p(),h(c,{to:`body`},[z.value?(p(),u(`ul`,{key:0,ref_key:`menuRef`,ref:H,class:`admin-select__menu`,role:`listbox`,"aria-label":d.ariaLabel,style:m(W.value)},[d.searchable?(p(),u(`li`,M,[s(l(`input`,{ref_key:`searchInputRef`,ref:U,"onUpdate:modelValue":n[0]||=e=>B.value=e,type:`search`,class:`admin-select__search-input`,placeholder:d.searchPlaceholder,onClick:n[1]||=S(()=>{},[`stop`]),onKeydown:n[2]||=C(S(e=>z.value=!1,[`stop`]),[`esc`])},null,40,N),[[x,B.value]])])):y(``,!0),q.value.length?y(``,!0):(p(),u(`li`,P,` موردی یافت نشد `)),(p(!0),u(g,null,a(q.value,n=>(p(),u(`li`,{key:n.value,role:`presentation`},[l(`button`,{type:`button`,class:i([`admin-select__option`,{"admin-select__option--active":n.value===d.modelValue}]),role:`option`,"aria-selected":n.value===d.modelValue,onClick:e=>Z(n.value)},[l(`span`,I,[o(e.$slots,`option-leading`,{option:n},void 0,!0),l(`span`,null,t(n.label),1)]),n.value===d.modelValue?(p(),h(w,{key:0,name:`check`,size:16,class:`admin-select__check`})):y(``,!0)],10,F)]))),128))],12,j)):y(``,!0)]))],10,E))}}),[[`__scopeId`,`data-v-4623e322`]]);export{L as t};
\ No newline at end of file
diff --git a/dist/assets/AdminSelect-BYntBSYd.js b/dist/assets/AdminSelect-BYntBSYd.js
new file mode 100644
index 0000000..0c9bc34
--- /dev/null
+++ b/dist/assets/AdminSelect-BYntBSYd.js
@@ -0,0 +1 @@
+import{A as e,At as t,N as n,O as r,Ot as i,P as a,V as o,W as s,a as c,c as l,d as u,et as d,g as f,h as p,jt as m,l as h,r as g,s as _,t as v,u as y,w as b}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{d as x,m as S,p as C}from"./http-CTjL79ty.js";import{L as w,M as T}from"./index-DxcN1-hp.js";import{n as E,r as D,t as O}from"./selectOptionSearch-BxACqWRl.js";var k=[`id`],A=[`aria-label`,`aria-expanded`],j={class:`admin-select__trigger-content`},ee={class:`admin-select__value`},te={class:`admin-select__chevron`,"aria-hidden":`true`},M=[`aria-label`],N={key:0,class:`admin-select__search`,role:`presentation`},P=[`placeholder`],F={key:1,class:`admin-select__empty`,role:`presentation`},I=[`aria-selected`,`onClick`,`onKeydown`],L={class:`admin-select__option-label`},R=v(f({__name:`AdminSelect`,props:{modelValue:{},options:{},placeholder:{default:`انتخاب کنید`},ariaLabel:{default:`انتخاب`},block:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},searchPlaceholder:{default:`جستجو…`},id:{default:void 0}},emits:[`update:modelValue`],setup(f,{emit:v}){let R=f,z=v,B=d(!1),V=d(``),H=d(null),U=d(null),W=d(null),G=d({});T(H,()=>{B.value=!1,V.value=``},{ignore:[U]});let K=_(()=>R.options.find(e=>e.value===R.modelValue)),q=_(()=>K.value?.label??R.placeholder),J=_(()=>O(R.options,V.value));function Y(e){e.key===`ArrowDown`?(e.preventDefault(),D(U.value,`first`)):e.key===`ArrowUp`&&(e.preventDefault(),D(U.value,`last`))}function X(e,t){let n=e.currentTarget;e.key===`ArrowDown`?(e.preventDefault(),E(n,1)):e.key===`ArrowUp`?(e.preventDefault(),E(n,-1)):(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),$(t))}function Z(){let e=H.value;if(!e)return;let t=e.getBoundingClientRect(),n=Math.min(320,window.innerHeight*.5),r=window.innerHeight-t.bottom-6,i=t.top-6,a=rr,o=Math.max(120,Math.min(n,a?i:r));G.value={position:`fixed`,left:`${Math.max(8,Math.min(t.left,window.innerWidth-Math.max(t.width,220)-8))}px`,width:`${Math.max(t.width,220)}px`,zIndex:`1100`,maxHeight:`${o}px`,...a?{top:`auto`,bottom:`${window.innerHeight-t.top+6}px`}:{top:`${t.bottom+6}px`,bottom:`auto`}}}function Q(e){e?(window.addEventListener(`resize`,Z),window.addEventListener(`scroll`,Z,!0)):(window.removeEventListener(`resize`,Z),window.removeEventListener(`scroll`,Z,!0))}async function ne(){B.value=!B.value,B.value&&(V.value=``,await b(),Z(),R.searchable&&(await b(),W.value?.focus()))}function $(e){z(`update:modelValue`,e),B.value=!1,V.value=``}return o(B,e=>{Q(e),e&&b(()=>Z())}),r(()=>{Q(!1)}),(r,o)=>(e(),u(`div`,{id:f.id,ref_key:`rootRef`,ref:H,class:i([`admin-select`,{"admin-select--open":B.value,"admin-select--block":f.block}])},[l(`button`,{type:`button`,class:`admin-select__trigger`,"aria-label":f.ariaLabel,"aria-expanded":B.value,"aria-haspopup":`listbox`,onClick:ne},[l(`span`,j,[a(r.$slots,`option-leading`,{option:K.value},void 0,!0),l(`span`,ee,m(q.value),1)]),l(`span`,te,[p(w,{name:`chevron-down`,size:16})])],8,A),(e(),h(c,{to:`body`},[B.value?(e(),u(`ul`,{key:0,ref_key:`menuRef`,ref:U,class:`admin-select__menu`,"data-select-menu":``,role:`listbox`,"aria-label":f.ariaLabel,style:t(G.value)},[f.searchable?(e(),u(`li`,N,[s(l(`input`,{ref_key:`searchInputRef`,ref:W,"onUpdate:modelValue":o[0]||=e=>V.value=e,type:`search`,class:`admin-select__search-input`,placeholder:f.searchPlaceholder,onClick:o[1]||=S(()=>{},[`stop`]),onKeydown:[o[2]||=C(S(e=>B.value=!1,[`stop`]),[`esc`]),Y]},null,40,P),[[x,V.value]])])):y(``,!0),J.value.length?y(``,!0):(e(),u(`li`,F,` موردی یافت نشد `)),(e(!0),u(g,null,n(J.value,t=>(e(),u(`li`,{key:t.value,role:`presentation`},[l(`button`,{type:`button`,class:i([`admin-select__option`,{"admin-select__option--active":t.value===f.modelValue}]),"data-select-option":``,role:`option`,"aria-selected":t.value===f.modelValue,onClick:e=>$(t.value),onKeydown:e=>X(e,t.value)},[l(`span`,L,[a(r.$slots,`option-leading`,{option:t},void 0,!0),l(`span`,null,m(t.label),1)]),t.value===f.modelValue?(e(),h(w,{key:0,name:`check`,size:16,class:`admin-select__check`})):y(``,!0)],42,I)]))),128))],12,M)):y(``,!0)]))],10,k))}}),[[`__scopeId`,`data-v-4ee349a1`]]);export{R as t};
\ No newline at end of file
diff --git a/dist/assets/AdminSelect-DRq_EKw9.css b/dist/assets/AdminSelect-D_tV1Ad3.css
similarity index 59%
rename from dist/assets/AdminSelect-DRq_EKw9.css
rename to dist/assets/AdminSelect-D_tV1Ad3.css
index 48151bb..734b34f 100644
--- a/dist/assets/AdminSelect-DRq_EKw9.css
+++ b/dist/assets/AdminSelect-D_tV1Ad3.css
@@ -1 +1 @@
-.admin-select[data-v-4623e322]{min-width:200px;max-width:100%;position:relative}.admin-select--block[data-v-4623e322]{width:100%;min-width:0}.admin-select__trigger[data-v-4623e322]{width:100%;min-height:var(--control-height,40px);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);justify-content:space-between;align-items:center;gap:10px;padding:0 12px 0 10px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__trigger[data-v-4623e322]:hover{border-color:var(--color-primary);background:var(--color-elevated,var(--color-surface))}.admin-select--open .admin-select__trigger[data-v-4623e322],.admin-select__trigger[data-v-4623e322]:focus-visible{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__trigger-content[data-v-4623e322]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__value[data-v-4623e322]{text-align:start;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.admin-select__option-label[data-v-4623e322]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__chevron[data-v-4623e322]{color:var(--color-text-muted);transition:transform var(--transition-fast);flex-shrink:0;display:inline-flex}.admin-select--open .admin-select__chevron[data-v-4623e322]{color:var(--color-primary);transform:rotate(180deg)}.admin-select__menu[data-v-4623e322]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-card,0 12px 28px #0f172a1f);box-sizing:border-box;flex-direction:column;gap:4px;margin:0;padding:8px;list-style:none;display:flex;overflow-y:auto}.admin-select__search[data-v-4623e322]{z-index:1;background:var(--color-surface);padding-bottom:4px;position:sticky;top:0}.admin-select__search-input[data-v-4623e322]{border:1px solid var(--color-border);background:var(--color-bg);width:100%;height:36px;color:var(--color-text);font:inherit;border-radius:10px;padding:0 12px;font-size:.8125rem}.admin-select__search-input[data-v-4623e322]:focus{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__empty[data-v-4623e322]{color:var(--color-text-muted);text-align:center;padding:12px;font-size:.8125rem}.admin-select__option[data-v-4623e322]{width:100%;color:var(--color-text);text-align:start;cursor:pointer;transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);background:0 0;border:1px solid #0000;border-radius:12px;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__option[data-v-4623e322]:hover{background:var(--color-bg);border-color:var(--color-border)}.admin-select__option--active[data-v-4623e322]{background:var(--color-primary-soft);color:var(--color-primary);border-color:#0000;font-weight:600}.admin-select__option--active[data-v-4623e322]:hover{background:var(--color-primary-soft);border-color:#0000}.admin-select__check[data-v-4623e322]{color:var(--color-primary);flex-shrink:0}
+.admin-select[data-v-4ee349a1]{min-width:200px;max-width:100%;position:relative}.admin-select--block[data-v-4ee349a1]{width:100%;min-width:0}.admin-select__trigger[data-v-4ee349a1]{width:100%;min-height:var(--control-height,40px);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-surface);color:var(--color-text);cursor:pointer;transition:border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);justify-content:space-between;align-items:center;gap:10px;padding:0 12px 0 10px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__trigger[data-v-4ee349a1]:hover{border-color:var(--color-primary);background:var(--color-elevated,var(--color-surface))}.admin-select--open .admin-select__trigger[data-v-4ee349a1],.admin-select__trigger[data-v-4ee349a1]:focus-visible{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__trigger-content[data-v-4ee349a1]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__value[data-v-4ee349a1]{text-align:start;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.admin-select__option-label[data-v-4ee349a1]{flex:1;align-items:center;gap:8px;min-width:0;display:inline-flex}.admin-select__chevron[data-v-4ee349a1]{color:var(--color-text-muted);transition:transform var(--transition-fast);flex-shrink:0;display:inline-flex}.admin-select--open .admin-select__chevron[data-v-4ee349a1]{color:var(--color-primary);transform:rotate(180deg)}.admin-select__menu[data-v-4ee349a1]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:var(--radius-md);box-shadow:var(--shadow-card,0 12px 28px #0f172a1f);box-sizing:border-box;flex-direction:column;gap:4px;margin:0;padding:8px;list-style:none;display:flex;overflow-y:auto}.admin-select__search[data-v-4ee349a1]{z-index:1;background:var(--color-surface);padding-bottom:4px;position:sticky;top:0}.admin-select__search-input[data-v-4ee349a1]{border:1px solid var(--color-border);background:var(--color-bg);width:100%;height:36px;color:var(--color-text);font:inherit;border-radius:10px;padding:0 12px;font-size:.8125rem}.admin-select__search-input[data-v-4ee349a1]:focus{border-color:var(--color-primary);box-shadow:var(--focus-ring);outline:none}.admin-select__empty[data-v-4ee349a1]{color:var(--color-text-muted);text-align:center;padding:12px;font-size:.8125rem}.admin-select__option[data-v-4ee349a1]{width:100%;color:var(--color-text);text-align:start;cursor:pointer;transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);background:0 0;border:1px solid #0000;border-radius:12px;justify-content:space-between;align-items:center;gap:10px;padding:10px 12px;font-family:inherit;font-size:.875rem;font-weight:500;display:flex}.admin-select__option[data-v-4ee349a1]:hover{background:var(--color-bg);border-color:var(--color-border)}.admin-select__option--active[data-v-4ee349a1]{background:var(--color-primary-soft);color:var(--color-primary);border-color:#0000;font-weight:600}.admin-select__option--active[data-v-4ee349a1]:hover{background:var(--color-primary-soft);border-color:#0000}.admin-select__check[data-v-4ee349a1]{color:var(--color-primary);flex-shrink:0}
diff --git a/dist/assets/BankAccountsView-45UgBBlI.css b/dist/assets/BankAccountsView-45UgBBlI.css
new file mode 100644
index 0000000..eab13a5
--- /dev/null
+++ b/dist/assets/BankAccountsView-45UgBBlI.css
@@ -0,0 +1 @@
+.accounts-page__table[data-v-cb49a72f]{overflow:hidden}
diff --git a/dist/assets/BankAccountsView-CntmP0ge.js b/dist/assets/BankAccountsView-CntmP0ge.js
new file mode 100644
index 0000000..45fc422
--- /dev/null
+++ b/dist/assets/BankAccountsView-CntmP0ge.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,Q as r,U as i,W as a,c as o,d as s,et as c,g as ee,h as l,jt as u,l as te,m as d,r as f,s as p,t as m,u as h}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as ne,d as g,m as _,t as v}from"./http-CTjL79ty.js";import{R as re,V as ie,p as y,v as ae,z as oe}from"./index-DxcN1-hp.js";import{t as se}from"./BaseSwitch-Dz4ODUhf.js";import{t as b}from"./BaseEmptyState-BAIuUvAl.js";import{t as x}from"./ActiveSwitchCell-4PQpvsIu.js";var ce={class:`accounts-page`},le={key:0,class:`admin-card accounts-page__notice`,role:`status`},ue={class:`admin-page-header`},de={class:`admin-page-header__title`},fe={key:0,class:`admin-page-header__subtitle`},pe={class:`admin-action-group`},me={key:2,class:`accounts-page__table admin-card desktop-only`},he={class:`admin-table-wrap`},ge={class:`admin-table`},S={class:`status`},C={key:3,class:`compact-only admin-card-list`},w={class:`admin-card-item__header`},T={class:`admin-card-item__title`},E={class:`admin-card-item__meta`},D={key:0},O={key:1,dir:`ltr`},k={key:0,class:`admin-form__error`,role:`alert`},A={class:`admin-form__row`},j={class:`admin-form__field`},M={class:`admin-form__field`},N={class:`admin-form__field`},P={class:`admin-form__row`},F={class:`admin-form__field`},I={class:`admin-form__field`},_e={class:`admin-form__field`},ve=[`disabled`],L=m(ee({__name:`BankAccountsView`,setup(ee){let m=re(),L=oe(),R=ne(),z=c(null),B=c([]),V=c(!1),H=c(``),U=c(!1),W=p(()=>String(m.params.companyId)),G=p(()=>z.value?.isPaymentRecipient===!0||z.value?.slug===`nademitex`),K=p(()=>B.value),q=()=>({bankName:``,accountNumber:``,accountHolder:z.value?.name??``,cardNumber:``,iban:``,isActive:!0}),J=r(q()),Y=p(()=>J.bankName.trim().length>0&&J.accountNumber.trim().length>0&&J.accountHolder.trim().length>0);async function ye(){try{let e=await ae.get(W.value);if(z.value=e,e.isPaymentRecipient!==!0&&e.slug!==`nademitex`){B.value=[];return}B.value=await y.listByCompany(W.value)}catch(e){R.error(e instanceof v?e.message:`بارگذاری حسابها انجام نشد.`)}}t(()=>{ye()});function X(){Object.assign(J,q()),H.value=``,V.value=!0}function Z(){V.value=!1,H.value=``}async function Q(){if(!G.value){H.value=`حساب بانکی فقط برای شرکت نادمی تکس (دریافتکننده پرداخت) ثبت میشود.`;return}if(!Y.value){H.value=`فیلدهای ستارهدار الزامی هستند.`;return}U.value=!0;try{let e=await y.create(W.value,{bankName:J.bankName.trim(),accountNumber:J.accountNumber.trim(),accountHolder:J.accountHolder.trim(),cardNumber:J.cardNumber.trim()||`-`,iban:J.iban.trim()||`-`,isActive:J.isActive,displayOrder:B.value.length+1});B.value.push(e),R.success(`حساب بانکی جدید ثبت شد.`),Z()}catch(e){R.error(e instanceof v?e.message:`ثبت حساب انجام نشد.`)}finally{U.value=!1}}async function $(e,t){await y.setActive(e,t)}function be(){L.push(`/companies`)}return(t,r)=>(e(),s(`div`,ce,[z.value&&!G.value?(e(),s(`p`,le,` حسابهای دریافت پرداخت مشتریان فقط برای شرکت نادمی تکس تعریف میشوند. شرکتهای دیگر صرفاً برای مشخصکردن مالکیت محصول هستند و حساب بانکی مستقل ندارند. `)):h(``,!0),o(`div`,ue,[o(`div`,null,[o(`h1`,de,` مدیریت حسابهای بانکی — `+u(z.value?.name??`…`),1),G.value?(e(),s(`p`,fe,` تمام پرداختهای اپ به این شرکت واریز میشود. `)):h(``,!0)]),o(`div`,pe,[G.value?(e(),s(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--primary`,onClick:X},` افزودن حساب `)):h(``,!0),o(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,onClick:be},` بازگشت `)])]),K.value.length?(e(),s(`div`,me,[o(`div`,he,[o(`table`,ge,[r[6]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`بانک`),o(`th`,null,`حساب بانکی`),o(`th`,null,`نام صاحب`),o(`th`,null,`شماره کارت`),o(`th`,null,`شماره شبا`),o(`th`,{class:`status`},`وضعیت`)])],-1),o(`tbody`,null,[(e(!0),s(f,null,n(K.value,t=>(e(),s(`tr`,{key:t.id},[o(`td`,null,u(t.bankName),1),o(`td`,null,u(t.accountNumber),1),o(`td`,null,u(t.accountHolder),1),o(`td`,null,u(t.cardNumber||`—`),1),o(`td`,null,u(t.iban||`—`),1),o(`td`,S,[l(x,{id:t.id,modelValue:t.isActive,"onUpdate:modelValue":e=>t.isActive=e,"entity-name":t.bankName,"entity-type":`حساب بانکی`,persist:$},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])])]))),128))])])])])):(e(),te(b,{key:1,class:`admin-card`,icon:`wallet`,title:G.value?`حساب بانکی ثبت نشده`:`حساب بانکی برای این شرکت تعریف نمیشود`,description:G.value?`هنوز حساب بانکی برای دریافت پرداخت ثبت نشده است.`:`از منوی شرکتها، حسابهای نادمی تکس را مدیریت کنید.`},{default:i(()=>[G.value?(e(),s(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:X},` افزودن حساب `)):h(``,!0)]),_:1},8,[`title`,`description`])),K.value.length?(e(),s(`div`,C,[(e(!0),s(f,null,n(K.value,t=>(e(),s(`article`,{key:t.id,class:`admin-card-item`},[o(`div`,w,[o(`p`,T,`بانک `+u(t.bankName),1),l(x,{id:t.id,modelValue:t.isActive,"onUpdate:modelValue":e=>t.isActive=e,"entity-name":t.bankName,"entity-type":`حساب بانکی`,persist:$},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])]),o(`div`,E,[o(`span`,null,u(t.accountHolder),1),o(`span`,null,`حساب: `+u(t.accountNumber),1),t.cardNumber?(e(),s(`span`,D,`کارت: `+u(t.cardNumber),1)):h(``,!0),t.iban?(e(),s(`span`,O,u(t.iban),1)):h(``,!0)])]))),128))])):h(``,!0),l(ie,{open:V.value,title:`افزودن حساب بانکی`,size:`lg`,onClose:Z},{footer:i(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:Z},` انصراف `),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!Y.value||U.value,onClick:Q},` ثبت حساب `,8,ve)]),default:i(()=>[o(`form`,{class:`admin-form`,onSubmit:_(Q,[`prevent`])},[H.value?(e(),s(`p`,k,u(H.value),1)):h(``,!0),o(`div`,A,[o(`div`,j,[r[7]||=o(`label`,{for:`bank-name`},[d(`نام بانک `),o(`span`,{class:`admin-form__required`},`*`)],-1),a(o(`input`,{id:`bank-name`,"onUpdate:modelValue":r[0]||=e=>J.bankName=e,type:`text`,class:`admin-input`,placeholder:`مثال: ملت`},null,512),[[g,J.bankName]])]),o(`div`,M,[r[8]||=o(`label`,{for:`account-number`},[d(` شماره حساب `),o(`span`,{class:`admin-form__required`},`*`)],-1),a(o(`input`,{id:`account-number`,"onUpdate:modelValue":r[1]||=e=>J.accountNumber=e,type:`text`,class:`admin-input`,placeholder:`1234567890`,inputmode:`numeric`,dir:`ltr`},null,512),[[g,J.accountNumber]])])]),o(`div`,N,[r[9]||=o(`label`,{for:`account-holder`},[d(` نام صاحب حساب `),o(`span`,{class:`admin-form__required`},`*`)],-1),a(o(`input`,{id:`account-holder`,"onUpdate:modelValue":r[2]||=e=>J.accountHolder=e,type:`text`,class:`admin-input`},null,512),[[g,J.accountHolder]])]),o(`div`,P,[o(`div`,F,[r[10]||=o(`label`,{for:`card-number`},`شماره کارت`,-1),a(o(`input`,{id:`card-number`,"onUpdate:modelValue":r[3]||=e=>J.cardNumber=e,type:`text`,class:`admin-input`,placeholder:`6104 3378 0077 1234`,inputmode:`numeric`,dir:`ltr`},null,512),[[g,J.cardNumber]])]),o(`div`,I,[r[11]||=o(`label`,{for:`iban`},`شماره شبا`,-1),a(o(`input`,{id:`iban`,"onUpdate:modelValue":r[4]||=e=>J.iban=e,type:`text`,class:`admin-input`,placeholder:`IR...`,dir:`ltr`},null,512),[[g,J.iban]])])]),o(`div`,_e,[l(se,{modelValue:J.isActive,"onUpdate:modelValue":r[5]||=e=>J.isActive=e,label:`وضعیت`},null,8,[`modelValue`])])],32)]),_:1},8,[`open`])]))}}),[[`__scopeId`,`data-v-cb49a72f`]]);export{L as default};
\ No newline at end of file
diff --git a/dist/assets/BankAccountsView-D2HiabfV.js b/dist/assets/BankAccountsView-D2HiabfV.js
deleted file mode 100644
index 62e99a7..0000000
--- a/dist/assets/BankAccountsView-D2HiabfV.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,E as n,H as r,M as i,U as a,Z as o,c as s,d as c,g as ee,h as l,k as u,l as d,m as f,r as p,s as m,t as h,u as g}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as te,f as _,m as ne,t as v}from"./http-BjLkjdQu.js";import{B as y,L as b,R as re,_ as ie,d as x}from"./index-SWzbcuqQ.js";import{t as ae}from"./BaseSwitch-pJwnFBVo.js";import{t as oe}from"./BaseEmptyState-Bzvl_pTa.js";import{t as S}from"./ActiveSwitchCell-DIBIZfO9.js";var se={class:`accounts-page`},ce={class:`admin-page-header`},le={class:`admin-page-header__title`},ue={key:1,class:`accounts-page__table admin-card desktop-only`},de={class:`admin-table-wrap`},fe={class:`admin-table`},pe={class:`status`},C={key:2,class:`compact-only admin-card-list`},w={class:`admin-card-item__header`},T={class:`admin-card-item__title`},E={class:`admin-card-item__meta`},D={key:0},O={key:1,dir:`ltr`},k={key:0,class:`admin-form__error`,role:`alert`},A={class:`admin-form__row`},j={class:`admin-form__field`},M={class:`admin-form__field`},N={class:`admin-form__field`},P={class:`admin-form__row`},F={class:`admin-form__field`},I={class:`admin-form__field`},L={class:`admin-form__field`},me=[`disabled`],R=h(ee({__name:`BankAccountsView`,setup(ee){let h=b(),R=re(),z=te(),B=e(null),V=e([]),H=e(!1),U=e(``),W=e(!1),G=m(()=>String(h.params.companyId)),K=m(()=>V.value),q=()=>({bankName:``,accountNumber:``,accountHolder:B.value?.name??``,cardNumber:``,iban:``,isActive:!0}),J=o(q()),Y=m(()=>J.bankName.trim().length>0&&J.accountNumber.trim().length>0&&J.accountHolder.trim().length>0);async function he(){try{let[e,t]=await Promise.all([ie.get(G.value),x.listByCompany(G.value)]);B.value=e,V.value=t}catch(e){z.error(e instanceof v?e.message:`بارگذاری حسابها انجام نشد.`)}}n(()=>{he()});function X(){Object.assign(J,q()),U.value=``,H.value=!0}function Z(){H.value=!1,U.value=``}async function Q(){if(!Y.value){U.value=`فیلدهای ستارهدار الزامی هستند.`;return}W.value=!0;try{let e=await x.create(G.value,{bankName:J.bankName.trim(),accountNumber:J.accountNumber.trim(),accountHolder:J.accountHolder.trim(),cardNumber:J.cardNumber.trim()||`-`,iban:J.iban.trim()||`-`,isActive:J.isActive,displayOrder:V.value.length+1});V.value.push(e),z.success(`حساب بانکی جدید ثبت شد.`),Z()}catch(e){z.error(e instanceof v?e.message:`ثبت حساب انجام نشد.`)}finally{W.value=!1}}async function $(e,t){await x.setActive(e,t)}function ge(){R.push(`/companies`)}return(e,n)=>(u(),c(`div`,se,[s(`div`,ce,[s(`div`,null,[s(`h1`,le,` مدیریت حسابهای بانکی — `+t(B.value?.name??`…`),1)]),s(`div`,{class:`admin-action-group`},[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:X},` افزودن حساب `),s(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,onClick:ge},` بازگشت `)])]),K.value.length?(u(),c(`div`,ue,[s(`div`,de,[s(`table`,fe,[n[6]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`بانک`),s(`th`,null,`حساب بانکی`),s(`th`,null,`نام صاحب`),s(`th`,null,`شماره کارت`),s(`th`,null,`شماره شبا`),s(`th`,{class:`status`},`وضعیت`)])],-1),s(`tbody`,null,[(u(!0),c(p,null,i(K.value,e=>(u(),c(`tr`,{key:e.id},[s(`td`,null,t(e.bankName),1),s(`td`,null,t(e.accountNumber),1),s(`td`,null,t(e.accountHolder),1),s(`td`,null,t(e.cardNumber||`—`),1),s(`td`,null,t(e.iban||`—`),1),s(`td`,pe,[l(S,{id:e.id,modelValue:e.isActive,"onUpdate:modelValue":t=>e.isActive=t,"entity-name":e.bankName,"entity-type":`حساب بانکی`,persist:$},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])])]))),128))])])])])):(u(),d(oe,{key:0,class:`admin-card`,icon:`wallet`,title:`حساب بانکی ثبت نشده`,description:`برای این شرکت هنوز حساب بانکی ثبت نشده است.`},{default:r(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:X},` افزودن حساب `)]),_:1})),K.value.length?(u(),c(`div`,C,[(u(!0),c(p,null,i(K.value,e=>(u(),c(`article`,{key:e.id,class:`admin-card-item`},[s(`div`,w,[s(`p`,T,`بانک `+t(e.bankName),1),l(S,{id:e.id,modelValue:e.isActive,"onUpdate:modelValue":t=>e.isActive=t,"entity-name":e.bankName,"entity-type":`حساب بانکی`,persist:$},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])]),s(`div`,E,[s(`span`,null,t(e.accountHolder),1),s(`span`,null,`حساب: `+t(e.accountNumber),1),e.cardNumber?(u(),c(`span`,D,`کارت: `+t(e.cardNumber),1)):g(``,!0),e.iban?(u(),c(`span`,O,t(e.iban),1)):g(``,!0)])]))),128))])):g(``,!0),l(y,{open:H.value,title:`افزودن حساب بانکی`,size:`lg`,onClose:Z},{footer:r(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:Z},` انصراف `),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!Y.value||W.value,onClick:Q},` ثبت حساب `,8,me)]),default:r(()=>[s(`form`,{class:`admin-form`,onSubmit:ne(Q,[`prevent`])},[U.value?(u(),c(`p`,k,t(U.value),1)):g(``,!0),s(`div`,A,[s(`div`,j,[n[7]||=s(`label`,{for:`bank-name`},[f(`نام بانک `),s(`span`,{class:`admin-form__required`},`*`)],-1),a(s(`input`,{id:`bank-name`,"onUpdate:modelValue":n[0]||=e=>J.bankName=e,type:`text`,class:`admin-input`,placeholder:`مثال: ملت`},null,512),[[_,J.bankName]])]),s(`div`,M,[n[8]||=s(`label`,{for:`account-number`},[f(` شماره حساب `),s(`span`,{class:`admin-form__required`},`*`)],-1),a(s(`input`,{id:`account-number`,"onUpdate:modelValue":n[1]||=e=>J.accountNumber=e,type:`text`,class:`admin-input`,placeholder:`1234567890`,inputmode:`numeric`,dir:`ltr`},null,512),[[_,J.accountNumber]])])]),s(`div`,N,[n[9]||=s(`label`,{for:`account-holder`},[f(` نام صاحب حساب `),s(`span`,{class:`admin-form__required`},`*`)],-1),a(s(`input`,{id:`account-holder`,"onUpdate:modelValue":n[2]||=e=>J.accountHolder=e,type:`text`,class:`admin-input`},null,512),[[_,J.accountHolder]])]),s(`div`,P,[s(`div`,F,[n[10]||=s(`label`,{for:`card-number`},`شماره کارت`,-1),a(s(`input`,{id:`card-number`,"onUpdate:modelValue":n[3]||=e=>J.cardNumber=e,type:`text`,class:`admin-input`,placeholder:`6104 3378 0077 1234`,inputmode:`numeric`,dir:`ltr`},null,512),[[_,J.cardNumber]])]),s(`div`,I,[n[11]||=s(`label`,{for:`iban`},`شماره شبا`,-1),a(s(`input`,{id:`iban`,"onUpdate:modelValue":n[4]||=e=>J.iban=e,type:`text`,class:`admin-input`,placeholder:`IR...`,dir:`ltr`},null,512),[[_,J.iban]])])]),s(`div`,L,[l(ae,{modelValue:J.isActive,"onUpdate:modelValue":n[5]||=e=>J.isActive=e,label:`وضعیت`},null,8,[`modelValue`])])],32)]),_:1},8,[`open`])]))}}),[[`__scopeId`,`data-v-0011826b`]]);export{R as default};
\ No newline at end of file
diff --git a/dist/assets/BankAccountsView-jIdT6saw.css b/dist/assets/BankAccountsView-jIdT6saw.css
deleted file mode 100644
index cd3b309..0000000
--- a/dist/assets/BankAccountsView-jIdT6saw.css
+++ /dev/null
@@ -1 +0,0 @@
-.accounts-page__table[data-v-0011826b]{overflow:hidden}
diff --git a/dist/assets/BannersView-99C5H1oR.js b/dist/assets/BannersView-99C5H1oR.js
new file mode 100644
index 0000000..2719c54
--- /dev/null
+++ b/dist/assets/BannersView-99C5H1oR.js
@@ -0,0 +1 @@
+import{A as e,At as t,D as n,N as r,Ot as ee,Q as i,U as a,W as o,c as s,d as c,et as l,g as u,h as d,jt as f,l as p,m,r as h,s as g,t as _,u as v}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as te,d as y,t as b}from"./http-CTjL79ty.js";import{V as x,m as S}from"./index-DxcN1-hp.js";import{t as C}from"./AdminPageSkeleton-DacAHji8.js";import{t as w}from"./BaseSwitch-Dz4ODUhf.js";import{t as ne}from"./BaseEmptyState-BAIuUvAl.js";import{t as re}from"./AdminImagePicker-DhyB3HhH.js";import{t as T}from"./AdminSelect-BYntBSYd.js";function E(e){let t=e.trim();if(!t)return!0;if(t.startsWith(`/`))return/^\/[^\s]*$/.test(t);try{let e=new URL(t);return e.protocol===`http:`||e.protocol===`https:`}catch{return!1}}var D={class:`banners-page`},O={key:2,class:`admin-card`},k={class:`admin-table`},A={key:0,class:`banner-sub`},j={class:`actions`},M=[`onClick`],N=[`onClick`],P={class:`field`},F={class:`field`},I={class:`field__head`},L={class:`field`},R={class:`field__head`},z={class:`field`},ie={class:`field__head`},B={class:`field`},V={class:`field`},H={class:`field`},U=[`disabled`],W=_(u({__name:`BannersView`,setup(u){let _=[{value:`home_hero`,label:`خانه — بنر اصلی`},{value:`products_hero`,label:`لیست محصولات`},{value:`categories_hero`,label:`دستهبندیها`}],W=l([]),G=l(!0),K=l(!1),q=l(!1),J=l(null),Y=te(),X=i({slot:`home_hero`,title:``,subtitle:``,ctaLabel:``,ctaLink:`/categories`,bannerLink:``,imageUrl:null,displayOrder:0,isActive:!0,showTitle:!0,showSubtitle:!0,showCta:!0}),Z=g(()=>J.value?`ویرایش بنر`:`افزودن بنر`);function ae(e){return _.find(t=>t.value===e)?.label??e}async function Q(){G.value=!0;try{W.value=await S.list()}catch(e){Y.error(e instanceof b?e.message:`بارگذاری بنرها ناموفق بود.`)}finally{G.value=!1}}function $(){J.value=null,Object.assign(X,{slot:`home_hero`,title:``,subtitle:``,ctaLabel:`مشاهده کالکشن`,ctaLink:`/categories`,bannerLink:``,imageUrl:null,displayOrder:W.value.length,isActive:!0,showTitle:!0,showSubtitle:!0,showCta:!0}),q.value=!0}function oe(e){J.value=e.id,Object.assign(X,{slot:e.slot,title:e.title,subtitle:e.subtitle,ctaLabel:e.ctaLabel,ctaLink:e.ctaLink||`/categories`,bannerLink:e.bannerLink||``,imageUrl:e.imageUrl||null,displayOrder:e.displayOrder,isActive:e.isActive,showTitle:e.showTitle!==!1,showSubtitle:e.showSubtitle!==!1,showCta:e.showCta!==!1}),q.value=!0}async function se(){if(X.title.trim()){if(!E(X.bannerLink)){Y.error(`لینک بنر معتبر نیست. مسیر داخلی (مثل /categories) یا آدرس https وارد کنید.`);return}K.value=!0;try{let e={slot:X.slot,title:X.title.trim(),subtitle:X.subtitle.trim()||null,ctaLabel:X.ctaLabel.trim()||null,ctaLink:X.ctaLink.trim()||null,bannerLink:X.bannerLink.trim()||null,imageUrl:X.imageUrl,displayOrder:X.displayOrder,isActive:X.isActive,showTitle:X.showTitle,showSubtitle:X.showSubtitle,showCta:X.showCta};J.value?await S.update(J.value,e):await S.create(e),q.value=!1,Y.success(`بنر ذخیره شد.`),await Q()}catch(e){Y.error(e instanceof b?e.message:`ذخیره بنر ناموفق بود.`)}finally{K.value=!1}}}async function ce(e){if(window.confirm(`بنر «${e.title}» حذف شود؟`))try{await S.remove(e.id),Y.success(`بنر حذف شد.`),await Q()}catch(e){Y.error(e instanceof b?e.message:`حذف بنر ناموفق بود.`)}}return n(()=>{Q()}),(n,i)=>(e(),c(`div`,D,[s(`div`,{class:`admin-page-header`},[i[14]||=s(`div`,null,[s(`h1`,{class:`admin-page-header__title`},`بنرها`),s(`p`,{class:`admin-page-header__sub`},`بنر بخشهای مختلف اپ کاربر را از اینجا مدیریت کنید.`)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:$},`افزودن بنر`)]),G.value?(e(),p(C,{key:0,variant:`table`})):W.value.length?(e(),c(`div`,O,[s(`table`,k,[i[15]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`تصویر`),s(`th`,null,`عنوان`),s(`th`,null,`بخش`),s(`th`,null,`دکمه`),s(`th`,null,`فعال`),s(`th`,{class:`actions`},`عملیات`)])],-1),s(`tbody`,null,[(e(!0),c(h,null,r(W.value,n=>(e(),c(`tr`,{key:n.id},[s(`td`,null,[s(`span`,{class:ee([`banner-thumb`,{"banner-thumb--empty":!n.imageUrl}]),style:t(n.imageUrl?{backgroundImage:`url(${n.imageUrl})`}:void 0)},null,6)]),s(`td`,null,[s(`strong`,null,f(n.title),1),n.subtitle?(e(),c(`p`,A,f(n.subtitle),1)):v(``,!0)]),s(`td`,null,f(ae(n.slot)),1),s(`td`,null,f(n.ctaLabel||`—`),1),s(`td`,null,f(n.isActive?`بله`:`خیر`),1),s(`td`,j,[s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:e=>oe(n)},` ویرایش `,8,M),s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:e=>ce(n)},` حذف `,8,N)])]))),128))])])])):(e(),p(ne,{key:1,title:`بنری ثبت نشده`,description:`اولین بنر خانه را اضافه کنید.`},{default:a(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:$},` افزودن بنر `)]),_:1})),d(x,{open:q.value,title:Z.value,onClose:i[13]||=e=>q.value=!1},{footer:a(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:i[12]||=e=>q.value=!1},`انصراف`),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!X.title.trim()||K.value,onClick:se},f(K.value?`در حال ذخیره...`:`ذخیره`),9,U)]),default:a(()=>[s(`label`,P,[i[16]||=m(` بخش نمایش `,-1),d(T,{modelValue:X.slot,"onUpdate:modelValue":i[0]||=e=>X.slot=e,options:_},null,8,[`modelValue`])]),s(`div`,F,[s(`span`,I,[i[17]||=m(` عنوان `,-1),d(w,{modelValue:X.showTitle,"onUpdate:modelValue":i[1]||=e=>X.showTitle=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`])]),o(s(`input`,{"onUpdate:modelValue":i[2]||=e=>X.title=e,class:`admin-input`},null,512),[[y,X.title]])]),s(`div`,L,[s(`span`,R,[i[18]||=m(` زیرعنوان `,-1),d(w,{modelValue:X.showSubtitle,"onUpdate:modelValue":i[3]||=e=>X.showSubtitle=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`])]),o(s(`input`,{"onUpdate:modelValue":i[4]||=e=>X.subtitle=e,class:`admin-input`},null,512),[[y,X.subtitle]])]),s(`div`,z,[s(`span`,ie,[i[19]||=m(` متن دکمه `,-1),d(w,{modelValue:X.showCta,"onUpdate:modelValue":i[5]||=e=>X.showCta=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`])]),o(s(`input`,{"onUpdate:modelValue":i[6]||=e=>X.ctaLabel=e,class:`admin-input`},null,512),[[y,X.ctaLabel]])]),s(`label`,B,[i[20]||=m(` لینک دکمه `,-1),o(s(`input`,{"onUpdate:modelValue":i[7]||=e=>X.ctaLink=e,class:`admin-input`,dir:`ltr`,placeholder:`/categories`},null,512),[[y,X.ctaLink]])]),s(`label`,V,[i[21]||=m(` لینک بنر `,-1),o(s(`input`,{"onUpdate:modelValue":i[8]||=e=>X.bannerLink=e,class:`admin-input`,dir:`ltr`,placeholder:`/categories یا https://...`},null,512),[[y,X.bannerLink]]),i[22]||=s(`span`,{class:`field-hint`},`با کلیک روی تصویر بنر در اپ؛ خالی = بدون لینک روی تصویر`,-1)]),s(`label`,H,[i[23]||=m(`ترتیب نمایش`,-1),o(s(`input`,{"onUpdate:modelValue":i[9]||=e=>X.displayOrder=e,type:`number`,min:`0`,class:`admin-input`},null,512),[[y,X.displayOrder,void 0,{number:!0}]])]),d(re,{modelValue:X.imageUrl,"onUpdate:modelValue":i[10]||=e=>X.imageUrl=e,label:`تصویر بنر`},null,8,[`modelValue`]),d(w,{modelValue:X.isActive,"onUpdate:modelValue":i[11]||=e=>X.isActive=e,label:`فعال`},null,8,[`modelValue`])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-2c8696f3`]]);export{W as default};
\ No newline at end of file
diff --git a/dist/assets/BannersView-COPiXMPa.css b/dist/assets/BannersView-COPiXMPa.css
new file mode 100644
index 0000000..0663e2a
--- /dev/null
+++ b/dist/assets/BannersView-COPiXMPa.css
@@ -0,0 +1 @@
+.admin-page-header__sub[data-v-2c8696f3]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.banner-thumb[data-v-2c8696f3]{background:#e8eceb 50%/cover no-repeat;border-radius:8px;width:72px;height:44px;display:block}.banner-thumb--empty[data-v-2c8696f3]{background:#eef1f0}.banner-sub[data-v-2c8696f3]{color:var(--color-text-muted);margin:2px 0 0;font-size:.8rem}.field[data-v-2c8696f3]{flex-direction:column;gap:6px;margin-bottom:12px;font-size:.875rem;display:flex}.field__head[data-v-2c8696f3]{justify-content:space-between;align-items:center;gap:12px;display:flex}.field-hint[data-v-2c8696f3]{color:var(--color-text-muted);font-size:.75rem;line-height:1.4}
diff --git a/dist/assets/BannersView-M2Tlryjc.js b/dist/assets/BannersView-M2Tlryjc.js
deleted file mode 100644
index 1cff53b..0000000
--- a/dist/assets/BannersView-M2Tlryjc.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,Dt as n,E as r,H as i,M as ee,U as a,Z as o,c as s,d as c,g as l,h as u,k as d,kt as f,l as p,m,r as h,s as g,t as _,u as v}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as y,f as b,t as x}from"./http-BjLkjdQu.js";import{B as S,f as C}from"./index-SWzbcuqQ.js";import{t as te}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as w}from"./BaseSwitch-pJwnFBVo.js";import{t as T}from"./BaseEmptyState-Bzvl_pTa.js";import{t as E}from"./AdminImagePicker-DBOLHU6S.js";import{t as D}from"./AdminSelect-6a7SFr9x.js";var O={class:`banners-page`},k={key:2,class:`admin-card`},A={class:`admin-table`},j={key:0,class:`banner-sub`},M={class:`actions`},N=[`onClick`],P=[`onClick`],F={class:`field`},I={class:`field`},L={class:`field__head`},R={class:`field`},z={class:`field__head`},ne={class:`field`},B={class:`field__head`},V={class:`field`},H={class:`field`},U=[`disabled`],W=_(l({__name:`BannersView`,setup(l){let _=[{value:`home_hero`,label:`خانه — بنر اصلی`},{value:`products_hero`,label:`لیست محصولات`},{value:`categories_hero`,label:`دستهبندیها`}],W=e([]),G=e(!0),K=e(!1),q=e(!1),J=e(null),Y=y(),X=o({slot:`home_hero`,title:``,subtitle:``,ctaLabel:``,ctaLink:`/categories`,imageUrl:null,displayOrder:0,isActive:!0,showTitle:!0,showSubtitle:!0,showCta:!0}),Z=g(()=>J.value?`ویرایش بنر`:`افزودن بنر`);function re(e){return _.find(t=>t.value===e)?.label??e}async function Q(){G.value=!0;try{W.value=await C.list()}catch(e){Y.error(e instanceof x?e.message:`بارگذاری بنرها ناموفق بود.`)}finally{G.value=!1}}function $(){J.value=null,Object.assign(X,{slot:`home_hero`,title:``,subtitle:``,ctaLabel:`مشاهده کالکشن`,ctaLink:`/categories`,imageUrl:null,displayOrder:W.value.length,isActive:!0,showTitle:!0,showSubtitle:!0,showCta:!0}),q.value=!0}function ie(e){J.value=e.id,Object.assign(X,{slot:e.slot,title:e.title,subtitle:e.subtitle,ctaLabel:e.ctaLabel,ctaLink:e.ctaLink||`/categories`,imageUrl:e.imageUrl||null,displayOrder:e.displayOrder,isActive:e.isActive,showTitle:e.showTitle!==!1,showSubtitle:e.showSubtitle!==!1,showCta:e.showCta!==!1}),q.value=!0}async function ae(){if(X.title.trim()){K.value=!0;try{let e={slot:X.slot,title:X.title.trim(),subtitle:X.subtitle.trim()||null,ctaLabel:X.ctaLabel.trim()||null,ctaLink:X.ctaLink.trim()||null,imageUrl:X.imageUrl,displayOrder:X.displayOrder,isActive:X.isActive,showTitle:X.showTitle,showSubtitle:X.showSubtitle,showCta:X.showCta};J.value?await C.update(J.value,e):await C.create(e),q.value=!1,Y.success(`بنر ذخیره شد.`),await Q()}catch(e){Y.error(e instanceof x?e.message:`ذخیره بنر ناموفق بود.`)}finally{K.value=!1}}}async function oe(e){if(window.confirm(`بنر «${e.title}» حذف شود؟`))try{await C.remove(e.id),Y.success(`بنر حذف شد.`),await Q()}catch(e){Y.error(e instanceof x?e.message:`حذف بنر ناموفق بود.`)}}return r(()=>{Q()}),(e,r)=>(d(),c(`div`,O,[s(`div`,{class:`admin-page-header`},[r[13]||=s(`div`,null,[s(`h1`,{class:`admin-page-header__title`},`بنرها`),s(`p`,{class:`admin-page-header__sub`},`بنر بخشهای مختلف اپ کاربر را از اینجا مدیریت کنید.`)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:$},`افزودن بنر`)]),G.value?(d(),p(te,{key:0,variant:`table`})):W.value.length?(d(),c(`div`,k,[s(`table`,A,[r[14]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`تصویر`),s(`th`,null,`عنوان`),s(`th`,null,`بخش`),s(`th`,null,`دکمه`),s(`th`,null,`فعال`),s(`th`,{class:`actions`},`عملیات`)])],-1),s(`tbody`,null,[(d(!0),c(h,null,ee(W.value,e=>(d(),c(`tr`,{key:e.id},[s(`td`,null,[s(`span`,{class:n([`banner-thumb`,{"banner-thumb--empty":!e.imageUrl}]),style:f(e.imageUrl?{backgroundImage:`url(${e.imageUrl})`}:void 0)},null,6)]),s(`td`,null,[s(`strong`,null,t(e.title),1),e.subtitle?(d(),c(`p`,j,t(e.subtitle),1)):v(``,!0)]),s(`td`,null,t(re(e.slot)),1),s(`td`,null,t(e.ctaLabel||`—`),1),s(`td`,null,t(e.isActive?`بله`:`خیر`),1),s(`td`,M,[s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:t=>ie(e)},` ویرایش `,8,N),s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:t=>oe(e)},` حذف `,8,P)])]))),128))])])])):(d(),p(T,{key:1,title:`بنری ثبت نشده`,description:`اولین بنر خانه را اضافه کنید.`},{default:i(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:$},` افزودن بنر `)]),_:1})),u(S,{open:q.value,title:Z.value,onClose:r[12]||=e=>q.value=!1},{footer:i(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:r[11]||=e=>q.value=!1},`انصراف`),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!X.title.trim()||K.value,onClick:ae},t(K.value?`در حال ذخیره...`:`ذخیره`),9,U)]),default:i(()=>[s(`label`,F,[r[15]||=m(` بخش نمایش `,-1),u(D,{modelValue:X.slot,"onUpdate:modelValue":r[0]||=e=>X.slot=e,options:_},null,8,[`modelValue`])]),s(`div`,I,[s(`span`,L,[r[16]||=m(` عنوان `,-1),u(w,{modelValue:X.showTitle,"onUpdate:modelValue":r[1]||=e=>X.showTitle=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`])]),a(s(`input`,{"onUpdate:modelValue":r[2]||=e=>X.title=e,class:`admin-input`},null,512),[[b,X.title]])]),s(`div`,R,[s(`span`,z,[r[17]||=m(` زیرعنوان `,-1),u(w,{modelValue:X.showSubtitle,"onUpdate:modelValue":r[3]||=e=>X.showSubtitle=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`])]),a(s(`input`,{"onUpdate:modelValue":r[4]||=e=>X.subtitle=e,class:`admin-input`},null,512),[[b,X.subtitle]])]),s(`div`,ne,[s(`span`,B,[r[18]||=m(` متن دکمه `,-1),u(w,{modelValue:X.showCta,"onUpdate:modelValue":r[5]||=e=>X.showCta=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`])]),a(s(`input`,{"onUpdate:modelValue":r[6]||=e=>X.ctaLabel=e,class:`admin-input`},null,512),[[b,X.ctaLabel]])]),s(`label`,V,[r[19]||=m(` لینک دکمه `,-1),a(s(`input`,{"onUpdate:modelValue":r[7]||=e=>X.ctaLink=e,class:`admin-input`,dir:`ltr`,placeholder:`/categories`},null,512),[[b,X.ctaLink]])]),s(`label`,H,[r[20]||=m(`ترتیب نمایش`,-1),a(s(`input`,{"onUpdate:modelValue":r[8]||=e=>X.displayOrder=e,type:`number`,min:`0`,class:`admin-input`},null,512),[[b,X.displayOrder,void 0,{number:!0}]])]),u(E,{modelValue:X.imageUrl,"onUpdate:modelValue":r[9]||=e=>X.imageUrl=e,label:`تصویر بنر`},null,8,[`modelValue`]),u(w,{modelValue:X.isActive,"onUpdate:modelValue":r[10]||=e=>X.isActive=e,label:`فعال`},null,8,[`modelValue`])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-1ca3d686`]]);export{W as default};
\ No newline at end of file
diff --git a/dist/assets/BannersView-TRKkvRxh.css b/dist/assets/BannersView-TRKkvRxh.css
deleted file mode 100644
index 7881c8e..0000000
--- a/dist/assets/BannersView-TRKkvRxh.css
+++ /dev/null
@@ -1 +0,0 @@
-.admin-page-header__sub[data-v-1ca3d686]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.banner-thumb[data-v-1ca3d686]{background:#e8eceb 50%/cover no-repeat;border-radius:8px;width:72px;height:44px;display:block}.banner-thumb--empty[data-v-1ca3d686]{background:#eef1f0}.banner-sub[data-v-1ca3d686]{color:var(--color-text-muted);margin:2px 0 0;font-size:.8rem}.field[data-v-1ca3d686]{flex-direction:column;gap:6px;margin-bottom:12px;font-size:.875rem;display:flex}.field__head[data-v-1ca3d686]{justify-content:space-between;align-items:center;gap:12px;display:flex}
diff --git a/dist/assets/BaseEmptyState-Bzvl_pTa.js b/dist/assets/BaseEmptyState-BAIuUvAl.js
similarity index 57%
rename from dist/assets/BaseEmptyState-Bzvl_pTa.js
rename to dist/assets/BaseEmptyState-BAIuUvAl.js
index b545331..cb6fb98 100644
--- a/dist/assets/BaseEmptyState-Bzvl_pTa.js
+++ b/dist/assets/BaseEmptyState-BAIuUvAl.js
@@ -1 +1 @@
-import{At as e,Dt as t,N as n,c as r,d as i,g as a,h as o,k as s,t as c,u as l}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{I as u}from"./index-SWzbcuqQ.js";var d={class:`base-empty__icon`,"aria-hidden":`true`},f={class:`base-empty__title`},p={key:0,class:`base-empty__description`},m={key:1,class:`base-empty__actions`},h=c(a({__name:`BaseEmptyState`,props:{icon:{default:`file`},title:{},description:{},compact:{type:Boolean}},emits:[`action`,`secondary`],setup(a){return(c,h)=>(s(),i(`div`,{class:t([`base-empty`,{"base-empty--compact":a.compact}])},[r(`div`,d,[o(u,{name:a.icon,size:a.compact?28:36},null,8,[`name`,`size`])]),r(`h3`,f,e(a.title),1),a.description?(s(),i(`p`,p,e(a.description),1)):l(``,!0),c.$slots.default||c.$slots.secondary?(s(),i(`div`,m,[n(c.$slots,`default`,{},void 0,!0),n(c.$slots,`secondary`,{},void 0,!0)])):l(``,!0)],2))}}),[[`__scopeId`,`data-v-47ea81e4`]]);export{h as t};
\ No newline at end of file
+import{A as e,Ot as t,P as n,c as r,d as i,g as a,h as o,jt as s,t as c,u as l}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{L as u}from"./index-DxcN1-hp.js";var d={class:`base-empty__icon`,"aria-hidden":`true`},f={class:`base-empty__title`},p={key:0,class:`base-empty__description`},m={key:1,class:`base-empty__actions`},h=c(a({__name:`BaseEmptyState`,props:{icon:{default:`file`},title:{},description:{},compact:{type:Boolean}},emits:[`action`,`secondary`],setup(a){return(c,h)=>(e(),i(`div`,{class:t([`base-empty`,{"base-empty--compact":a.compact}])},[r(`div`,d,[o(u,{name:a.icon,size:a.compact?28:36},null,8,[`name`,`size`])]),r(`h3`,f,s(a.title),1),a.description?(e(),i(`p`,p,s(a.description),1)):l(``,!0),c.$slots.default||c.$slots.secondary?(e(),i(`div`,m,[n(c.$slots,`default`,{},void 0,!0),n(c.$slots,`secondary`,{},void 0,!0)])):l(``,!0)],2))}}),[[`__scopeId`,`data-v-47ea81e4`]]);export{h as t};
\ No newline at end of file
diff --git a/dist/assets/BaseSwitch-pJwnFBVo.js b/dist/assets/BaseSwitch-Dz4ODUhf.js
similarity index 77%
rename from dist/assets/BaseSwitch-pJwnFBVo.js
rename to dist/assets/BaseSwitch-Dz4ODUhf.js
index 9d576bf..058a8b7 100644
--- a/dist/assets/BaseSwitch-pJwnFBVo.js
+++ b/dist/assets/BaseSwitch-Dz4ODUhf.js
@@ -1 +1 @@
-import{At as e,Dt as t,c as n,d as r,g as i,k as a,s as o,t as s,u as c}from"./_plugin-vue_export-helper-QrIvvHC8.js";var l=[`title`],u={key:0,class:`base-switch__label`},d={class:`base-switch__control`},f=[`id`,`checked`,`disabled`,`aria-checked`,`aria-label`],p={class:`base-switch__track`,"aria-hidden":`true`},m={class:`base-switch__thumb`},h={key:0,class:`base-switch__spinner`},g=s(i({__name:`BaseSwitch`,props:{modelValue:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},error:{type:Boolean},label:{},activeText:{default:`فعال`},inactiveText:{default:`غیرفعال`},id:{}},emits:[`update:modelValue`],setup(i,{emit:s}){let g=i,_=s,v=o(()=>g.id??`switch-${crypto.randomUUID().slice(0,8)}`),y=o(()=>g.modelValue?g.activeText:g.inactiveText);function b(e){let t=e.target,n=t.checked;t.checked=g.modelValue,!(g.disabled||g.loading)&&_(`update:modelValue`,n)}return(o,s)=>(a(),r(`label`,{class:t([`base-switch`,{"base-switch--disabled":i.disabled||i.loading,"base-switch--error":i.error}]),title:y.value},[i.label?(a(),r(`span`,u,e(i.label),1)):c(``,!0),n(`span`,d,[n(`input`,{id:v.value,class:`base-switch__input`,type:`checkbox`,role:`switch`,checked:i.modelValue,disabled:i.disabled||i.loading,"aria-checked":i.modelValue,"aria-label":i.label||y.value,onChange:b},null,40,f),n(`span`,p,[n(`span`,m,[i.loading?(a(),r(`span`,h)):c(``,!0)])])])],10,l))}}),[[`__scopeId`,`data-v-0410eed4`]]);export{g as t};
\ No newline at end of file
+import{A as e,Ot as t,c as n,d as r,g as i,jt as a,s as o,t as s,u as c}from"./_plugin-vue_export-helper-vx-p5QAT.js";var l=[`title`],u={key:0,class:`base-switch__label`},d={class:`base-switch__control`},f=[`id`,`checked`,`disabled`,`aria-checked`,`aria-label`],p={class:`base-switch__track`,"aria-hidden":`true`},m={class:`base-switch__thumb`},h={key:0,class:`base-switch__spinner`},g=s(i({__name:`BaseSwitch`,props:{modelValue:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},error:{type:Boolean},label:{},activeText:{default:`فعال`},inactiveText:{default:`غیرفعال`},id:{}},emits:[`update:modelValue`],setup(i,{emit:s}){let g=i,_=s,v=o(()=>g.id??`switch-${crypto.randomUUID().slice(0,8)}`),y=o(()=>g.modelValue?g.activeText:g.inactiveText);function b(e){let t=e.target,n=t.checked;t.checked=g.modelValue,!(g.disabled||g.loading)&&_(`update:modelValue`,n)}return(o,s)=>(e(),r(`label`,{class:t([`base-switch`,{"base-switch--disabled":i.disabled||i.loading,"base-switch--error":i.error}]),title:y.value},[i.label?(e(),r(`span`,u,a(i.label),1)):c(``,!0),n(`span`,d,[n(`input`,{id:v.value,class:`base-switch__input`,type:`checkbox`,role:`switch`,checked:i.modelValue,disabled:i.disabled||i.loading,"aria-checked":i.modelValue,"aria-label":i.label||y.value,onChange:b},null,40,f),n(`span`,p,[n(`span`,m,[i.loading?(e(),r(`span`,h)):c(``,!0)])])])],10,l))}}),[[`__scopeId`,`data-v-0410eed4`]]);export{g as t};
\ No newline at end of file
diff --git a/dist/assets/BrandsView-C8jhktRT.css b/dist/assets/BrandsView-C8jhktRT.css
deleted file mode 100644
index 0fd0d3b..0000000
--- a/dist/assets/BrandsView-C8jhktRT.css
+++ /dev/null
@@ -1 +0,0 @@
-.admin-page__head[data-v-a6f53b6f]{justify-content:space-between;margin-bottom:20px;display:flex}.admin-page__head h1[data-v-a6f53b6f]{margin:0 0 4px;font-size:1.25rem}.admin-page__head p[data-v-a6f53b6f]{color:var(--color-text-muted);margin:0;font-size:.875rem}.admin-table[data-v-a6f53b6f]{border-collapse:collapse;width:100%}.admin-table th[data-v-a6f53b6f],.admin-table td[data-v-a6f53b6f]{text-align:right;border-bottom:1px solid var(--color-border);padding:10px 8px}.field[data-v-a6f53b6f]{flex-direction:column;gap:6px;margin-bottom:12px;font-size:.875rem;display:flex}.link[data-v-a6f53b6f]{color:var(--color-primary);cursor:pointer;background:0 0;border:none;font-family:inherit}
diff --git a/dist/assets/BrandsView-vL6Hgb4d.js b/dist/assets/BrandsView-vL6Hgb4d.js
deleted file mode 100644
index 7aaf6e2..0000000
--- a/dist/assets/BrandsView-vL6Hgb4d.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,E as n,H as r,M as i,U as a,Z as o,c as s,d as c,g as l,h as u,k as d,l as f,m as p,r as m,s as h,t as g}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as _,f as v,t as y}from"./http-BjLkjdQu.js";import{B as b,p as x}from"./index-SWzbcuqQ.js";import{t as S}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as C}from"./BaseSwitch-pJwnFBVo.js";import{t as w}from"./BaseEmptyState-Bzvl_pTa.js";var T={class:`admin-page`},E={key:2,class:`admin-table`},D={dir:`ltr`},O=[`onClick`],k={class:`field`},A={class:`field`},j={class:`field`},M={class:`field`},N=[`disabled`],P=g(l({__name:`BrandsView`,setup(l){let g=e([]),P=e(!0),F=e(!1),I=e(null),L=_(),R=o({name:``,slug:``,description:``,displayOrder:0,isActive:!0}),z=h(()=>I.value?`ویرایش برند`:`افزودن برند`);async function B(){P.value=!0;try{g.value=await x.list()}catch(e){L.error(e instanceof y?e.message:`بارگذاری برندها ناموفق بود`)}finally{P.value=!1}}function V(){I.value=null,Object.assign(R,{name:``,slug:``,description:``,displayOrder:g.value.length+1,isActive:!0}),F.value=!0}function H(e){I.value=e.id,Object.assign(R,{name:e.name,slug:e.slug??``,description:e.description??``,displayOrder:e.displayOrder,isActive:e.isActive}),F.value=!0}async function U(){try{let e={name:R.name.trim(),slug:R.slug.trim()||void 0,description:R.description.trim()||void 0,displayOrder:R.displayOrder,isActive:R.isActive};I.value?await x.update(I.value,e):await x.create(e),F.value=!1,L.success(`ذخیره شد`),await B()}catch(e){L.error(e instanceof y?e.message:`ذخیره ناموفق بود`)}}return n(()=>{B()}),(e,n)=>(d(),c(`div`,T,[s(`header`,{class:`admin-page__head`},[n[6]||=s(`div`,null,[s(`h1`,null,`برندها`)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`افزودن برند`)]),P.value?(d(),f(S,{key:0,variant:`table`})):g.value.length?(d(),c(`table`,E,[n[7]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`نام`),s(`th`,null,`شناسه لاتین`),s(`th`,null,`محصولات`),s(`th`,null,`فعال`),s(`th`)])],-1),s(`tbody`,null,[(d(!0),c(m,null,i(g.value,e=>(d(),c(`tr`,{key:e.id},[s(`td`,null,t(e.name),1),s(`td`,D,t(e.slug||`—`),1),s(`td`,null,t(e.productsCount??0),1),s(`td`,null,t(e.isActive?`بله`:`خیر`),1),s(`td`,null,[s(`button`,{type:`button`,class:`link`,onClick:t=>H(e)},`ویرایش`,8,O)])]))),128))])])):(d(),f(w,{key:1,title:`برندی ثبت نشده`})),u(b,{open:F.value,title:z.value,onClose:n[5]||=e=>F.value=!1},{footer:r(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!R.name.trim(),onClick:U},`ذخیره`,8,N)]),default:r(()=>[s(`label`,k,[n[8]||=p(`نام`,-1),a(s(`input`,{"onUpdate:modelValue":n[0]||=e=>R.name=e,class:`admin-input`},null,512),[[v,R.name]])]),s(`label`,A,[n[9]||=p(`شناسه لاتین`,-1),a(s(`input`,{"onUpdate:modelValue":n[1]||=e=>R.slug=e,class:`admin-input`,dir:`ltr`,placeholder:`مثلاً nademi-silk`},null,512),[[v,R.slug]])]),s(`label`,j,[n[10]||=p(`توضیح`,-1),a(s(`textarea`,{"onUpdate:modelValue":n[2]||=e=>R.description=e,class:`admin-input`,rows:`3`},null,512),[[v,R.description]])]),s(`label`,M,[n[11]||=p(`ترتیب`,-1),a(s(`input`,{"onUpdate:modelValue":n[3]||=e=>R.displayOrder=e,type:`number`,class:`admin-input`},null,512),[[v,R.displayOrder,void 0,{number:!0}]])]),u(C,{modelValue:R.isActive,"onUpdate:modelValue":n[4]||=e=>R.isActive=e,label:`فعال`},null,8,[`modelValue`])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-a6f53b6f`]]);export{P as default};
\ No newline at end of file
diff --git a/dist/assets/CashPaymentsView-BJ5MjxN_.js b/dist/assets/CashPaymentsView-BJ5MjxN_.js
new file mode 100644
index 0000000..9c659f7
--- /dev/null
+++ b/dist/assets/CashPaymentsView-BJ5MjxN_.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,Ot as r,W as ee,c as i,ct as a,d as o,et as s,g as te,h as c,jt as l,l as u,r as d,s as ne,t as f,u as p}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as re,d as ie,t as m}from"./http-CTjL79ty.js";import{L as ae,R as oe,T as h,h as g,i as _,o as v}from"./index-DxcN1-hp.js";import{t as se}from"./AdminPageSkeleton-DacAHji8.js";import{t as ce}from"./AdminSelect-BYntBSYd.js";import{t as le}from"./AdminImageLightbox-BbQANbIb.js";import{n as y,t as b}from"./adminLabels-jYlObVqa.js";var ue={class:`cash-payments-page`},de={class:`cash-payments-page__filters admin-card`},fe={class:`cash-payments-page__search`},x={class:`cash-payments-page__table admin-card desktop-only`},S={class:`admin-table-wrap`},C={class:`admin-table`},w={dir:`ltr`},T=[`onClick`],E={key:1},D={key:0,class:`admin-action-group`},O=[`disabled`,`onClick`],k=[`disabled`,`onClick`],A={key:1,class:`admin-action-group`},j=[`disabled`,`onClick`],M={key:2},N={class:`compact-only admin-card-list`},P={class:`admin-card-item__header`},F={class:`admin-card-item__title`},I={class:`admin-card-item__meta`},pe={key:0},L={dir:`ltr`},R=[`onClick`],z={key:1,class:`admin-card-item__actions`},B=[`disabled`,`onClick`],me=[`disabled`,`onClick`],he=[`disabled`,`onClick`],V=f(te({__name:`CashPaymentsView`,setup(te){let f=oe(),V=s([]),H=s(f.query.order??``),U=s(`all`),W=s(!0),G=re(),K=s(null),q=s(!1),J=s(``);function Y(e){J.value=e,q.value=!0}let ge=[{value:`all`,label:`همه وضعیتها`},{value:`pending_review`,label:`در انتظار تأیید`},{value:`approved`,label:`تأیید شده`},{value:`rejected`,label:`رد شده`},{value:`expired`,label:`منقضیشده`}],X=ne(()=>{let e=V.value;U.value!==`all`&&(e=e.filter(e=>e.status===U.value));let t=H.value.trim();return t&&(e=e.filter(e=>e.orderNumber.includes(t)||e.customerName.includes(t)||e.trackingCode.includes(t))),e});async function _e(){W.value=!0;try{V.value=await g.list()}catch(e){G.error(e instanceof m?e.message:`بارگذاری پرداختها انجام نشد.`)}finally{W.value=!1}}t(()=>{_e()});async function Z(e){K.value=e.id;try{let t=await g.updateStatus(e.id,{status:`approved`}),n=V.value.findIndex(t=>t.id===e.id);n!==-1&&(V.value[n]={...V.value[n],...t}),G.success(`پرداخت سفارش ${e.orderNumber} تأیید شد.`)}catch(e){G.error(e instanceof m?e.message:`تأیید پرداخت انجام نشد.`)}finally{K.value=null}}async function Q(e){K.value=e.id;try{await h.updateStatus(e.orderId,{status:`final_approved`,note:`تأیید نهایی پس از تأیید رسید نقدی`}),G.success(`سفارش ${e.orderNumber} تأیید نهایی شد.`)}catch(e){G.error(e instanceof m?e.message:`تأیید نهایی انجام نشد.`)}finally{K.value=null}}async function $(e){K.value=e.id;try{let t=await g.updateStatus(e.id,{status:`rejected`}),n=V.value.findIndex(t=>t.id===e.id);n!==-1&&(V.value[n]={...V.value[n],...t}),G.warning(`پرداخت سفارش ${e.orderNumber} رد شد.`)}catch(e){G.error(e instanceof m?e.message:`رد پرداخت انجام نشد.`)}finally{K.value=null}}return(t,s)=>(e(),o(`div`,ue,[s[4]||=i(`div`,{class:`admin-page-header`},[i(`div`,null,[i(`h1`,{class:`admin-page-header__title`},`پرداختهای نقدی`)])],-1),i(`div`,de,[i(`div`,fe,[c(ae,{name:`search`,size:18}),ee(i(`input`,{"onUpdate:modelValue":s[0]||=e=>H.value=e,type:`search`,class:`cash-payments-page__search-input`,placeholder:`جستجو در شماره سفارش، مشتری، پیگیری...`},null,512),[[ie,H.value]])]),c(ce,{modelValue:U.value,"onUpdate:modelValue":s[1]||=e=>U.value=e,class:`cash-payments-page__status-select`,"aria-label":`فیلتر وضعیت پرداخت`,options:ge},null,8,[`modelValue`])]),W.value?(e(),u(se,{key:0,variant:`table`})):(e(),o(d,{key:1},[i(`div`,x,[i(`div`,S,[i(`table`,C,[s[3]||=i(`thead`,null,[i(`tr`,null,[i(`th`,null,`شماره سفارش`),i(`th`,null,`مشتری`),i(`th`,null,`مبلغ فاکتور`),i(`th`,null,`مبلغ واریزی`),i(`th`,null,`تاریخ واریز`),i(`th`,null,`شماره پیگیری`),i(`th`,null,`پایان اعتبار`),i(`th`,null,`وضعیت`),i(`th`,null,`رسید`),i(`th`,null,`عملیات`)])],-1),i(`tbody`,null,[(e(!0),o(d,null,n(X.value,t=>(e(),o(`tr`,{key:t.id},[i(`td`,null,l(t.orderNumber),1),i(`td`,null,l(t.customerName),1),i(`td`,null,l(a(_)(t.amount)),1),i(`td`,null,l(t.paidAmount?a(_)(t.paidAmount):`—`),1),i(`td`,null,l(t.transferDate?a(v)(t.transferDate):`—`),1),i(`td`,w,l(t.trackingCode),1),i(`td`,null,l(a(v)(t.expiresAt)),1),i(`td`,null,[i(`span`,{class:r([`admin-badge`,a(b)[t.status]])},l(a(y)[t.status]),3)]),i(`td`,null,[t.receiptImage?(e(),o(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:e=>Y(t.receiptImage)},` مشاهده `,8,T)):(e(),o(`span`,E,`—`))]),i(`td`,null,[t.status===`pending_review`?(e(),o(`div`,D,[i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:K.value===t.id,onClick:e=>Z(t)},` تأیید `,8,O),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:K.value===t.id,onClick:e=>$(t)},` رد `,8,k)])):t.status===`approved`?(e(),o(`div`,A,[i(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--xs`,disabled:K.value===t.id,onClick:e=>Q(t)},` تأیید نهایی سفارش `,8,j)])):(e(),o(`span`,M,`—`))])]))),128))])])])]),i(`div`,N,[(e(!0),o(d,null,n(X.value,t=>(e(),o(`article`,{key:t.id,class:`admin-card-item`},[i(`div`,P,[i(`p`,F,l(t.orderNumber),1),i(`span`,{class:r([`admin-badge`,a(b)[t.status]])},l(a(y)[t.status]),3)]),i(`div`,I,[i(`span`,null,l(t.customerName),1),i(`span`,null,l(a(_)(t.amount)),1),t.paidAmount==null?p(``,!0):(e(),o(`span`,pe,`پرداختی: `+l(a(_)(t.paidAmount)),1)),i(`span`,L,l(t.trackingCode),1)]),t.receiptImage?(e(),o(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs cash-payments-page__receipt-btn`,onClick:e=>Y(t.receiptImage)},` مشاهده تصویر رسید `,8,R)):p(``,!0),t.status===`pending_review`||t.status===`approved`?(e(),o(`div`,z,[t.status===`pending_review`?(e(),o(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:K.value===t.id,onClick:e=>Z(t)},` تأیید `,8,B)):p(``,!0),t.status===`pending_review`?(e(),o(`button`,{key:1,type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:K.value===t.id,onClick:e=>$(t)},` رد `,8,me)):p(``,!0),t.status===`approved`?(e(),o(`button`,{key:2,type:`button`,class:`admin-btn admin-btn--primary admin-btn--xs`,disabled:K.value===t.id,onClick:e=>Q(t)},` تأیید نهایی سفارش `,8,he)):p(``,!0)])):p(``,!0)]))),128))])],64)),J.value?(e(),u(le,{key:2,modelValue:q.value,"onUpdate:modelValue":s[2]||=e=>q.value=e,src:J.value,alt:`تصویر رسید پرداخت`},null,8,[`modelValue`,`src`])):p(``,!0)]))}}),[[`__scopeId`,`data-v-367bdef1`]]);export{V as default};
\ No newline at end of file
diff --git a/dist/assets/CashPaymentsView-CBMJOEPX.js b/dist/assets/CashPaymentsView-CBMJOEPX.js
deleted file mode 100644
index c40789b..0000000
--- a/dist/assets/CashPaymentsView-CBMJOEPX.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,Dt as n,E as r,M as i,U as a,c as o,d as s,g as ee,h as c,k as l,l as u,r as d,s as te,st as f,t as p,u as m}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as ne,f as re,t as h}from"./http-BjLkjdQu.js";import{I as g,L as ie,i as _,m as v,o as y,w as ae}from"./index-SWzbcuqQ.js";import{t as oe}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as se}from"./AdminSelect-6a7SFr9x.js";import{t as ce}from"./AdminImageLightbox-CE3ZJ5-o.js";import{n as b,t as x}from"./adminLabels-Cz9ccm1Z.js";var le={class:`cash-payments-page`},ue={class:`cash-payments-page__filters admin-card`},de={class:`cash-payments-page__search`},fe={class:`cash-payments-page__table admin-card desktop-only`},S={class:`admin-table-wrap`},C={class:`admin-table`},w={dir:`ltr`},T=[`onClick`],E={key:1},D={key:0,class:`admin-action-group`},O=[`disabled`,`onClick`],k=[`disabled`,`onClick`],A={key:1,class:`admin-action-group`},j=[`disabled`,`onClick`],M={key:2},N={class:`compact-only admin-card-list`},P={class:`admin-card-item__header`},F={class:`admin-card-item__title`},I={class:`admin-card-item__meta`},pe={key:0},L={dir:`ltr`},R=[`onClick`],z={key:1,class:`admin-card-item__actions`},B=[`disabled`,`onClick`],me=[`disabled`,`onClick`],he=[`disabled`,`onClick`],V=p(ee({__name:`CashPaymentsView`,setup(ee){let p=ie(),V=e([]),H=e(p.query.order??``),U=e(`all`),W=e(!0),G=ne(),K=e(null),q=e(!1),J=e(``);function Y(e){J.value=e,q.value=!0}let ge=[{value:`all`,label:`همه وضعیتها`},{value:`pending_review`,label:`در انتظار تأیید`},{value:`approved`,label:`تأیید شده`},{value:`rejected`,label:`رد شده`},{value:`expired`,label:`منقضیشده`}],X=te(()=>{let e=V.value;U.value!==`all`&&(e=e.filter(e=>e.status===U.value));let t=H.value.trim();return t&&(e=e.filter(e=>e.orderNumber.includes(t)||e.customerName.includes(t)||e.trackingCode.includes(t))),e});async function _e(){W.value=!0;try{V.value=await v.list()}catch(e){G.error(e instanceof h?e.message:`بارگذاری پرداختها انجام نشد.`)}finally{W.value=!1}}r(()=>{_e()});async function Z(e){K.value=e.id;try{let t=await v.updateStatus(e.id,{status:`approved`}),n=V.value.findIndex(t=>t.id===e.id);n!==-1&&(V.value[n]={...V.value[n],...t}),G.success(`پرداخت سفارش ${e.orderNumber} تأیید شد.`)}catch(e){G.error(e instanceof h?e.message:`تأیید پرداخت انجام نشد.`)}finally{K.value=null}}async function Q(e){K.value=e.id;try{await ae.updateStatus(e.orderId,{status:`final_approved`,note:`تأیید نهایی پس از تأیید رسید نقدی`}),G.success(`سفارش ${e.orderNumber} تأیید نهایی شد.`)}catch(e){G.error(e instanceof h?e.message:`تأیید نهایی انجام نشد.`)}finally{K.value=null}}async function $(e){K.value=e.id;try{let t=await v.updateStatus(e.id,{status:`rejected`}),n=V.value.findIndex(t=>t.id===e.id);n!==-1&&(V.value[n]={...V.value[n],...t}),G.warning(`پرداخت سفارش ${e.orderNumber} رد شد.`)}catch(e){G.error(e instanceof h?e.message:`رد پرداخت انجام نشد.`)}finally{K.value=null}}return(e,r)=>(l(),s(`div`,le,[r[4]||=o(`div`,{class:`admin-page-header`},[o(`div`,null,[o(`h1`,{class:`admin-page-header__title`},`پرداختهای نقدی`)])],-1),o(`div`,ue,[o(`div`,de,[c(g,{name:`search`,size:18}),a(o(`input`,{"onUpdate:modelValue":r[0]||=e=>H.value=e,type:`search`,class:`cash-payments-page__search-input`,placeholder:`جستجو در شماره سفارش، مشتری، پیگیری...`},null,512),[[re,H.value]])]),c(se,{modelValue:U.value,"onUpdate:modelValue":r[1]||=e=>U.value=e,class:`cash-payments-page__status-select`,"aria-label":`فیلتر وضعیت پرداخت`,options:ge},null,8,[`modelValue`])]),W.value?(l(),u(oe,{key:0,variant:`table`})):(l(),s(d,{key:1},[o(`div`,fe,[o(`div`,S,[o(`table`,C,[r[3]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`شماره سفارش`),o(`th`,null,`مشتری`),o(`th`,null,`مبلغ فاکتور`),o(`th`,null,`مبلغ واریزی`),o(`th`,null,`تاریخ واریز`),o(`th`,null,`شماره پیگیری`),o(`th`,null,`پایان اعتبار`),o(`th`,null,`وضعیت`),o(`th`,null,`رسید`),o(`th`,null,`عملیات`)])],-1),o(`tbody`,null,[(l(!0),s(d,null,i(X.value,e=>(l(),s(`tr`,{key:e.id},[o(`td`,null,t(e.orderNumber),1),o(`td`,null,t(e.customerName),1),o(`td`,null,t(f(_)(e.amount)),1),o(`td`,null,t(e.paidAmount?f(_)(e.paidAmount):`—`),1),o(`td`,null,t(e.transferDate?f(y)(e.transferDate):`—`),1),o(`td`,w,t(e.trackingCode),1),o(`td`,null,t(f(y)(e.expiresAt)),1),o(`td`,null,[o(`span`,{class:n([`admin-badge`,f(x)[e.status]])},t(f(b)[e.status]),3)]),o(`td`,null,[e.receiptImage?(l(),s(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:t=>Y(e.receiptImage)},` مشاهده `,8,T)):(l(),s(`span`,E,`—`))]),o(`td`,null,[e.status===`pending_review`?(l(),s(`div`,D,[o(`button`,{type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:K.value===e.id,onClick:t=>Z(e)},` تأیید `,8,O),o(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:K.value===e.id,onClick:t=>$(e)},` رد `,8,k)])):e.status===`approved`?(l(),s(`div`,A,[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--xs`,disabled:K.value===e.id,onClick:t=>Q(e)},` تأیید نهایی سفارش `,8,j)])):(l(),s(`span`,M,`—`))])]))),128))])])])]),o(`div`,N,[(l(!0),s(d,null,i(X.value,e=>(l(),s(`article`,{key:e.id,class:`admin-card-item`},[o(`div`,P,[o(`p`,F,t(e.orderNumber),1),o(`span`,{class:n([`admin-badge`,f(x)[e.status]])},t(f(b)[e.status]),3)]),o(`div`,I,[o(`span`,null,t(e.customerName),1),o(`span`,null,t(f(_)(e.amount)),1),e.paidAmount==null?m(``,!0):(l(),s(`span`,pe,`پرداختی: `+t(f(_)(e.paidAmount)),1)),o(`span`,L,t(e.trackingCode),1)]),e.receiptImage?(l(),s(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs cash-payments-page__receipt-btn`,onClick:t=>Y(e.receiptImage)},` مشاهده تصویر رسید `,8,R)):m(``,!0),e.status===`pending_review`||e.status===`approved`?(l(),s(`div`,z,[e.status===`pending_review`?(l(),s(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:K.value===e.id,onClick:t=>Z(e)},` تأیید `,8,B)):m(``,!0),e.status===`pending_review`?(l(),s(`button`,{key:1,type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:K.value===e.id,onClick:t=>$(e)},` رد `,8,me)):m(``,!0),e.status===`approved`?(l(),s(`button`,{key:2,type:`button`,class:`admin-btn admin-btn--primary admin-btn--xs`,disabled:K.value===e.id,onClick:t=>Q(e)},` تأیید نهایی سفارش `,8,he)):m(``,!0)])):m(``,!0)]))),128))])],64)),J.value?(l(),u(ce,{key:2,modelValue:q.value,"onUpdate:modelValue":r[2]||=e=>q.value=e,src:J.value,alt:`تصویر رسید پرداخت`},null,8,[`modelValue`,`src`])):m(``,!0)]))}}),[[`__scopeId`,`data-v-367bdef1`]]);export{V as default};
\ No newline at end of file
diff --git a/dist/assets/CatalogRequestsView-BEaJWR_M.js b/dist/assets/CatalogRequestsView-BEaJWR_M.js
deleted file mode 100644
index 6dca6e1..0000000
--- a/dist/assets/CatalogRequestsView-BEaJWR_M.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,E as n,M as r,c as i,d as a,g as o,h as s,k as c,l,m as u,r as d,st as f,t as p,u as m}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as h,t as g}from"./http-BjLkjdQu.js";import{h as _,o as v}from"./index-SWzbcuqQ.js";import{t as y}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as b}from"./BaseEmptyState-Bzvl_pTa.js";import{t as x}from"./AdminSelect-6a7SFr9x.js";var S={class:`admin-page`},C={class:`admin-page__head`},w={class:`request-card__top`},T={class:`muted`,dir:`ltr`},E={class:`badge`},D={key:0,class:`muted`},O={class:`admin-table`},k={dir:`ltr`},A={key:0,class:`movements`},j={class:`muted`},M=p(o({__name:`CatalogRequestsView`,setup(o){let p=[{value:``,label:`همه وضعیتها`},{value:`new`,label:`درخواست جدید`},{value:`approved`,label:`تأیید شده`},{value:`ready_to_ship`,label:`آماده ارسال`},{value:`delivered`,label:`تحویل به مشتری`},{value:`returned`,label:`بازگردانده شده`},{value:`cancelled`,label:`لغو شده`}],M=[{value:`warehouse`,label:`انبار`},{value:`customer`,label:`مشتری`},{value:`agent`,label:`واسطه`}],N=Object.fromEntries(p.filter(e=>e.value).map(e=>[e.value,e.label])),P=Object.fromEntries(M.map(e=>[e.value,e.label])),F=e([]),I=e(``),L=e(!0),R=e(null),z=h();async function B(){L.value=!0;try{F.value=await _.list(I.value||void 0)}catch(e){z.error(e instanceof g?e.message:`بارگذاری انجام نشد`)}finally{L.value=!1}}async function V(e,t){try{await _.updateStatus(e,t),z.success(`وضعیت بهروز شد`),await B()}catch(e){z.error(e instanceof g?e.message:`بهروزرسانی ناموفق بود`)}}async function H(e,t){if(!R.value){R.value=e;try{await _.updateHolder(e,{holderType:t}),z.success(`محل نگهداری بهروز شد`),await B()}catch(e){z.error(e instanceof g?e.message:`بهروزرسانی محل ناموفق بود`)}finally{R.value=null}}}function U(e){return P[e]??e}return n(()=>{B()}),(e,n)=>(c(),a(`div`,S,[i(`header`,C,[n[1]||=i(`div`,null,[i(`h1`,null,`درخواست کالیته فیزیکی`),i(`p`,null,`بررسی، گردش وضعیت و محل نگهداری اقلام`)],-1),s(x,{modelValue:I.value,"onUpdate:modelValue":[n[0]||=e=>I.value=e,B],options:p},null,8,[`modelValue`])]),L.value?(c(),l(y,{key:0,variant:`cards`})):F.value.length?(c(!0),a(d,{key:2},r(F.value,e=>(c(),a(`div`,{key:e.id,class:`request-card`},[i(`div`,w,[i(`div`,null,[i(`strong`,null,t(e.customerName),1),i(`span`,T,t(e.customerPhone),1),i(`span`,E,t(f(N)[e.status]??e.status),1)]),s(x,{"model-value":e.status,options:p.filter(e=>e.value),"onUpdate:modelValue":t=>V(e.id,String(t))},null,8,[`model-value`,`options`,`onUpdate:modelValue`])]),e.note?(c(),a(`p`,D,t(e.note),1)):m(``,!0),i(`table`,O,[n[2]||=i(`thead`,null,[i(`tr`,null,[i(`th`,null,`محصول`),i(`th`,null,`کد`),i(`th`,null,`تعداد`),i(`th`,null,`محل`)])],-1),i(`tbody`,null,[(c(!0),a(d,null,r(e.items,e=>(c(),a(`tr`,{key:e.id},[i(`td`,null,t(e.productName),1),i(`td`,k,t(e.productCode),1),i(`td`,null,t(e.quantity),1),i(`td`,null,[s(x,{"model-value":e.holderType,options:M,"onUpdate:modelValue":t=>H(e.id,String(t))},null,8,[`model-value`,`onUpdate:modelValue`]),e.movements?.length?(c(),a(`ul`,A,[(c(!0),a(d,null,r(e.movements,e=>(c(),a(`li`,{key:e.id},[u(t(U(e.fromHolder))+` → `+t(U(e.toHolder))+` `,1),i(`span`,j,t(f(v)(e.movedAt)),1)]))),128))])):m(``,!0)])]))),128))])])]))),128)):(c(),l(b,{key:1,title:`درخواستی نیست`}))]))}}),[[`__scopeId`,`data-v-747d8f88`]]);export{M as default};
\ No newline at end of file
diff --git a/dist/assets/CatalogRequestsView-DUePIjul.js b/dist/assets/CatalogRequestsView-DUePIjul.js
new file mode 100644
index 0000000..a8679be
--- /dev/null
+++ b/dist/assets/CatalogRequestsView-DUePIjul.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,Ot as r,T as i,V as a,W as o,c as s,ct as c,d as l,et as u,g as d,h as f,jt as p,l as m,m as h,r as g,s as _,t as v,u as y}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as b,d as x,f as S,m as C,t as w}from"./http-CTjL79ty.js";import{L as T,a as E,g as D,u as O}from"./index-DxcN1-hp.js";import{t as k}from"./AdminPageSkeleton-DacAHji8.js";import{t as ee}from"./BaseEmptyState-BAIuUvAl.js";import{t as A}from"./AdminSelect-BYntBSYd.js";import{r as j}from"./adminLabels-jYlObVqa.js";var M=[-61,9,38,199,426,686,756,818,1111,1181,1210,1635,2060,2097,2192,2262,2324,2394,2456,3178],N=M[0],P=M[M.length-1]-1;function F(e,t,n){return e instanceof Date?W(G(e.getFullYear(),e.getMonth()+1,e.getDate())):W(G(e,t,n))}function I(e,t,n){return te(V(e,t,n))}function L(e){return ne(e)===0}function R(e,t){return t<=6?31:t<=11||L(e)?30:29}function z(e){let{gy:t,march:n,jump:r,n:i}=K(e);return{leap:q(r,i),gy:t,march:n}}function B(e){let{gy:t,march:n}=K(e);return{gy:t,march:n}}function V(e,t,n){let r=B(e);return G(r.gy,3,r.march)+(t-1)*31-J(t,7)*(t-7)+n-1}var H=V(N,1,1),U=V(P,12,R(P,12));function W(e){if(eU)throw RangeError(`Invalid Julian Day number ${e}: outside the supported Jalaali range [${N}, ${P}]`);let t=te(e).gy,n=Math.min(t-621,P),r=z(n),i=e-G(r.gy,3,r.march);if(i>=0){if(i<=185)return{jy:n,jm:1+J(i,31),jd:Y(i,31)+1};i-=186}else--n,i+=179,r.leap===1&&(i+=1);return{jy:n,jm:7+J(i,30),jd:Y(i,30)+1}}function G(e,t,n){let r=J((e+J(t-8,6)+100100)*1461,4)+J(153*Y(t+9,12)+2,5)+n-34840408;return r=r-J(J(e+100100+J(t-8,6),100)*3,4)+752,r}function te(e){let t=4*e+139361631;t=t+J(J(4*e+183187720,146097)*3,4)*4-3908;let n=J(Y(t,1461),4)*5+308,r=J(Y(n,153),5)+1,i=Y(J(n,153),12)+1;return{gy:J(t,1461)-100100+J(8-i,6),gm:i,gd:r}}function K(e){if(!Number.isFinite(e)||eP)throw RangeError(`Invalid Jalaali year ${e}: must be a finite number between ${N} and ${P} (inclusive)`);let t=e+621,n=-14,r=M[0],i=0,a=0;for(let t=1;tP)throw RangeError(`Invalid Jalaali year ${e}: must be a finite number between ${N} and ${P} (inclusive)`);let t=M[0],n=0,r=0;for(let i=1;ire[Number(e)])}var Z=[`فروردین`,`اردیبهشت`,`خرداد`,`تیر`,`مرداد`,`شهریور`,`مهر`,`آبان`,`آذر`,`دی`,`بهمن`,`اسفند`],ie=[`ش`,`ی`,`د`,`س`,`چ`,`پ`,`ج`];function ae(e){let t=e.trim().match(/^(\d{4})-(\d{2})-(\d{2})/);if(t)return new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));let n=new Date(e);return Number.isNaN(n.getTime())?new Date(NaN):new Date(n.getFullYear(),n.getMonth(),n.getDate())}function oe(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function Q(e){let{jy:t,jm:n,jd:r}=F(e.getFullYear(),e.getMonth()+1,e.getDate());return{jy:t,jm:n,jd:r}}function se(e,t,n){let{gy:r,gm:i,gd:a}=I(e,t,n);return new Date(r,i-1,a)}function ce(e){return e?Q(ae(e)):null}function le(e,t,n){return oe(se(e,t,n))}function ue(e,t,n){return`${X(String(n))} ${Z[t-1]} ${X(String(e))}`}function de(e,t,n){let{gy:r,gm:i,gd:a}=I(e,t,n);return(new Date(r,i-1,a).getDay()+1)%7}function fe(e,t){return R(e,t)}function pe(e,t){let n=fe(e,t),r=de(e,t,1),i=Array.from({length:r},()=>null);for(let e=1;e<=n;e+=1)i.push(e);for(;i.length%7!=0;)i.push(null);return i}function $(){return Q(new Date)}var me={key:0,class:`form-label`},he=[`disabled`],ge={class:`persian-date-input__header`},_e={class:`persian-date-input__month`},ve={class:`persian-date-input__weekdays`},ye={class:`persian-date-input__grid`},be={key:0,class:`persian-date-input__cell persian-date-input__cell--empty`},xe=[`onClick`],Se={key:2,class:`input-error-text`},Ce={key:3,class:`form-hint`},we=v(d({__name:`PersianDateInput`,props:{modelValue:{},label:{},placeholder:{},hint:{},error:{},disabled:{type:Boolean},compact:{type:Boolean}},emits:[`update:modelValue`],setup(o,{emit:d}){let f=o,m=d,h=u(null),v=u(!1),b=u($().jy),x=u($().jm),S=_(()=>ce(f.modelValue??``)),w=_(()=>{if(!S.value)return``;let{jy:e,jm:t,jd:n}=S.value;return ue(e,t,n)}),T=_(()=>pe(b.value,x.value)),E=_(()=>`${Z[x.value-1]} ${O(String(b.value))}`);a(()=>f.modelValue,e=>{let t=ce(e??``);t&&(b.value=t.jy,x.value=t.jm)},{immediate:!0});function D(){f.disabled||(v.value=!v.value)}function k(){v.value=!1}function ee(e){m(`update:modelValue`,le(b.value,x.value,e)),k()}function A(e){let t=x.value+e,n=b.value;t>12?(t=1,n+=1):t<1&&(t=12,--n),x.value=t,b.value=n}function j(){let e=$();b.value=e.jy,x.value=e.jm,m(`update:modelValue`,le(e.jy,e.jm,e.jd)),k()}function M(e){if(!S.value)return!1;let{jy:t,jm:n,jd:r}=S.value;return t===b.value&&n===x.value&&r===e}function N(e){let t=$();return t.jy===b.value&&t.jm===x.value&&t.jd===e}function P(e){h.value?.contains(e.target)||k()}return t(()=>{document.addEventListener(`click`,P)}),i(()=>{document.removeEventListener(`click`,P)}),(t,i)=>(e(),l(`div`,{ref_key:`rootRef`,ref:h,class:r([`form-group persian-date-input`,{"persian-date-input--compact":o.compact}])},[o.label?(e(),l(`label`,me,p(o.label),1)):y(``,!0),s(`button`,{type:`button`,class:r([`input persian-date-input__trigger`,{"input-error":o.error,"is-open":v.value}]),disabled:o.disabled,onClick:C(D,[`stop`])},[s(`span`,{class:r({"persian-date-input__placeholder":!w.value})},p(w.value||o.placeholder||`انتخاب تاریخ`),3),i[3]||=s(`span`,{class:`persian-date-input__icon`,"aria-hidden":`true`},[s(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`},[s(`rect`,{x:`3`,y:`5`,width:`18`,height:`16`,rx:`2`,stroke:`currentColor`,"stroke-width":`1.5`}),s(`path`,{d:`M8 3v4M16 3v4M3 10h18`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`})])],-1)],10,he),v.value?(e(),l(`div`,{key:1,class:`persian-date-input__panel`,onClick:i[2]||=C(()=>{},[`stop`])},[s(`div`,ge,[s(`button`,{type:`button`,class:`persian-date-input__nav`,onClick:i[0]||=e=>A(-1)},`‹`),s(`strong`,_e,p(E.value),1),s(`button`,{type:`button`,class:`persian-date-input__nav`,onClick:i[1]||=e=>A(1)},`›`)]),s(`div`,ve,[(e(!0),l(g,null,n(c(ie),t=>(e(),l(`span`,{key:t},p(t),1))),128))]),s(`div`,ye,[(e(!0),l(g,null,n(T.value,(t,n)=>(e(),l(g,{key:n},[t===null?(e(),l(`span`,be)):(e(),l(`button`,{key:1,type:`button`,class:r([`persian-date-input__cell`,{"persian-date-input__cell--selected":M(t),"persian-date-input__cell--today":N(t)}]),onClick:e=>ee(t)},p(c(O)(String(t))),11,xe))],64))),128))]),s(`button`,{type:`button`,class:`persian-date-input__today`,onClick:j},`امروز`)])):y(``,!0),o.error?(e(),l(`p`,Se,p(o.error),1)):o.hint?(e(),l(`p`,Ce,p(o.hint),1)):y(``,!0)],2))}}),[[`__scopeId`,`data-v-fc20b5a1`]]);function Te(e){return e?.trim()&&(e.match(/آدرس:\s*(.+)/)?.[1]??e).trim()||`—`}function Ee(e){let t=new Map;for(let n of e){let e=Te(n.note),r=t.get(n.customerId);r?r.address===`—`&&e!==`—`&&(r.address=e):(r={customerId:n.customerId,customerName:n.customerName,customerPhone:n.customerPhone,address:e,lines:[]},t.set(n.customerId,r));for(let e of n.items)r.lines.push({lineKey:`${n.id}:${e.id}`,requestId:n.id,createdAt:n.createdAt,status:n.status,productName:e.productName,productCode:e.productCode})}return[...t.values()].sort((e,t)=>{let n=e.lines[0]?.createdAt??``;return(t.lines[0]?.createdAt??``).localeCompare(n)})}var De=/^(\d{4})-(\d{2})-(\d{2})$/;function Oe(e){return new Intl.DateTimeFormat(`en-CA`,{timeZone:`Asia/Tehran`,year:`numeric`,month:`2-digit`,day:`2-digit`}).format(new Date(e))}function ke(e,t){let n=t?.trim();return!n||!De.test(n)?e:e.filter(e=>Oe(e.createdAt)===n)}var Ae={class:`admin-page catalog-requests-page`},je={class:`catalog-requests-page__toolbar admin-card`},Me={class:`catalog-requests-page__search`},Ne={class:`catalog-requests-page__filters`},Pe={class:`catalog-requests-page__date-wrap`},Fe={key:2,class:`catalog-requests-page__list`},Ie=[`aria-expanded`,`onClick`],Le={class:`customer-card__chevron`,"aria-hidden":`true`},Re={class:`customer-card__toggle-main`},ze={class:`customer-card__identity`},Be={class:`customer-card__name`},Ve={class:`customer-card__phone`,dir:`ltr`},He={class:`customer-card__badge`},Ue={key:0,class:`customer-card__address`},We={class:`customer-card__table-wrap`},Ge={class:`customer-card__table`},Ke={class:`customer-card__date`},qe={dir:`ltr`,class:`customer-card__code`},Je={class:`customer-card__status`},Ye=v(d({__name:`CatalogRequestsView`,setup(i){let a=[{value:``,label:`همه وضعیتها`},{value:`new`,label:j.new},{value:`approved`,label:j.approved},{value:`ready_to_ship`,label:j.ready_to_ship},{value:`delivered`,label:j.delivered},{value:`returned`,label:j.returned},{value:`cancelled`,label:j.cancelled}],d=a.filter(e=>e.value),v=u([]),C=u(``),O=u(``),M=u(``),N=u(!0),P=b(),F=u(new Set),I=_(()=>ke(v.value,O.value)),L=_(()=>Ee(I.value)),R=_(()=>{let e=M.value.trim();return e?L.value.filter(t=>t.customerName.includes(e)||t.customerPhone.includes(e)):L.value}),z=_(()=>!!(C.value||O.value||M.value.trim()));function B(e){return!F.value.has(e)}function V(e){let t=new Set(F.value);t.has(e)?t.delete(e):t.add(e),F.value=t}async function H(){N.value=!0;try{v.value=await D.list({status:C.value||void 0,registeredOn:O.value||void 0})}catch(e){P.error(e instanceof w?e.message:`بارگذاری انجام نشد`)}finally{N.value=!1}}async function U(e,t){try{await D.updateStatus(e,t),P.success(`وضعیت بهروز شد`),await H()}catch(e){P.error(e instanceof w?e.message:`بهروزرسانی ناموفق بود`)}}function W(){O.value=``,H()}return t(()=>{H()}),(t,i)=>(e(),l(`div`,Ae,[i[5]||=s(`header`,{class:`catalog-requests-page__head`},[s(`div`,null,[s(`h1`,null,`درخواست کالیته فیزیکی`),s(`p`,null,`درخواستهای هر مشتری در یک کارت`)])],-1),s(`div`,je,[s(`div`,Me,[f(T,{name:`search`,size:18}),o(s(`input`,{"onUpdate:modelValue":i[0]||=e=>M.value=e,type:`search`,class:`catalog-requests-page__search-input`,placeholder:`جستجو در نام یا شماره مشتری...`,autocomplete:`off`},null,512),[[x,M.value]])]),s(`div`,Ne,[s(`div`,Pe,[f(we,{modelValue:O.value,"onUpdate:modelValue":[i[1]||=e=>O.value=e,H],class:`catalog-requests-page__date`,compact:``,placeholder:`انتخاب روز`},null,8,[`modelValue`]),O.value?(e(),l(`button`,{key:0,type:`button`,class:`catalog-requests-page__date-clear`,"aria-label":`پاک کردن تاریخ`,title:`پاک کردن تاریخ`,onClick:W},` × `)):y(``,!0)]),f(A,{modelValue:C.value,"onUpdate:modelValue":[i[2]||=e=>C.value=e,H],class:`catalog-requests-page__status`,"aria-label":`فیلتر وضعیت`,options:a},null,8,[`modelValue`])])]),N.value?(e(),m(k,{key:0,variant:`cards`})):R.value.length?(e(),l(`div`,Fe,[(e(!0),l(g,null,n(R.value,t=>(e(),l(`article`,{key:t.customerId,class:r([`customer-card`,{"customer-card--collapsed":!B(t.customerId)}])},[s(`button`,{type:`button`,class:`customer-card__toggle`,"aria-expanded":B(t.customerId),onClick:e=>V(t.customerId)},[s(`span`,Le,p(B(t.customerId)?`▾`:`◂`),1),s(`span`,Re,[s(`span`,ze,[s(`strong`,Be,p(t.customerName),1),s(`span`,Ve,p(t.customerPhone),1)]),s(`span`,He,p(t.lines.length)+` درخواست`,1)])],8,Ie),B(t.customerId)?(e(),l(`p`,Ue,[i[3]||=s(`span`,{class:`customer-card__address-label`},`آدرس:`,-1),h(` `+p(t.address),1)])):y(``,!0),o(s(`div`,We,[s(`table`,Ge,[i[4]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`تاریخ ثبت`),s(`th`,null,`محصول`),s(`th`,null,`کد`),s(`th`,null,`وضعیت`)])],-1),s(`tbody`,null,[(e(!0),l(g,null,n(t.lines,t=>(e(),l(`tr`,{key:t.lineKey},[s(`td`,Ke,p(c(E)(t.createdAt)),1),s(`td`,null,p(t.productName),1),s(`td`,qe,p(t.productCode),1),s(`td`,Je,[f(A,{"model-value":t.status,class:`customer-card__status-select`,options:c(d),"onUpdate:modelValue":e=>U(t.requestId,String(e))},null,8,[`model-value`,`options`,`onUpdate:modelValue`])])]))),128))])])],512),[[S,B(t.customerId)]])],2))),128))])):(e(),m(ee,{key:1,title:z.value?M.value.trim()?`مشتری با این جستجو پیدا نشد`:`درخواستی برای این فیلتر نیست`:`درخواستی نیست`,description:z.value?M.value.trim()?`عبارت جستجو یا فیلترها را تغییر دهید.`:`تاریخ یا وضعیت را تغییر دهید.`:void 0},null,8,[`title`,`description`]))]))}}),[[`__scopeId`,`data-v-01bfcf4e`]]);export{Ye as default};
\ No newline at end of file
diff --git a/dist/assets/CatalogRequestsView-DmO_C6eq.css b/dist/assets/CatalogRequestsView-DmO_C6eq.css
deleted file mode 100644
index 356cf95..0000000
--- a/dist/assets/CatalogRequestsView-DmO_C6eq.css
+++ /dev/null
@@ -1 +0,0 @@
-.admin-page__head[data-v-747d8f88]{justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:20px;display:flex}.admin-page__head h1[data-v-747d8f88]{margin:0 0 4px;font-size:1.25rem}.admin-page__head p[data-v-747d8f88]{color:var(--color-text-muted);margin:0;font-size:.875rem}.request-card[data-v-747d8f88]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;margin-bottom:12px;padding:16px}.request-card__top[data-v-747d8f88]{justify-content:space-between;align-items:center;gap:12px;margin-bottom:10px;display:flex}.request-card__top strong[data-v-747d8f88]{margin-left:8px}.muted[data-v-747d8f88]{color:var(--color-text-muted);margin-left:8px;font-size:.8125rem}.badge[data-v-747d8f88]{background:var(--color-primary-soft);color:var(--color-primary);border-radius:999px;padding:2px 8px;font-size:.75rem;display:inline-block}.admin-table[data-v-747d8f88]{border-collapse:collapse;width:100%;font-size:.8125rem}.admin-table th[data-v-747d8f88],.admin-table td[data-v-747d8f88]{text-align:right;border-top:1px solid var(--color-border);vertical-align:top;padding:8px 6px}.movements[data-v-747d8f88]{flex-direction:column;gap:4px;margin:8px 0 0;padding:0;font-size:.75rem;list-style:none;display:flex}
diff --git a/dist/assets/CatalogRequestsView-DvXU9zF3.css b/dist/assets/CatalogRequestsView-DvXU9zF3.css
new file mode 100644
index 0000000..a139073
--- /dev/null
+++ b/dist/assets/CatalogRequestsView-DvXU9zF3.css
@@ -0,0 +1 @@
+.persian-date-input[data-v-fc20b5a1]{position:relative}.input[data-v-fc20b5a1]{width:100%;height:var(--btn-height);border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-surface);color:var(--color-text);padding:0 14px;font-size:.9375rem;transition:border-color .15s}.persian-date-input__trigger[data-v-fc20b5a1]{cursor:pointer;text-align:right;justify-content:space-between;align-items:center;gap:8px;display:flex}.persian-date-input__trigger[data-v-fc20b5a1]:focus{border-color:var(--color-primary);outline:none}.persian-date-input__trigger.is-open[data-v-fc20b5a1],.persian-date-input__trigger[data-v-fc20b5a1]:focus-visible{border-color:var(--color-primary)}.persian-date-input__trigger[data-v-fc20b5a1]:disabled{opacity:.6;cursor:not-allowed}.persian-date-input__placeholder[data-v-fc20b5a1]{color:var(--color-text-muted)}.persian-date-input__icon[data-v-fc20b5a1]{color:var(--color-text-muted);align-items:center;display:flex}.input-error[data-v-fc20b5a1]{border-color:var(--color-danger)}.input-error-text[data-v-fc20b5a1]{color:var(--color-danger);margin:4px 0 0;font-size:.8125rem}.persian-date-input__panel[data-v-fc20b5a1]{z-index:120;border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-surface);box-shadow:var(--shadow-md);padding:12px;position:absolute;top:calc(100% + 6px);left:0;right:0}.persian-date-input__header[data-v-fc20b5a1]{justify-content:space-between;align-items:center;margin-bottom:10px;display:flex}.persian-date-input__month[data-v-fc20b5a1]{font-size:.9375rem;font-weight:700}.persian-date-input__nav[data-v-fc20b5a1]{border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-elevated);width:32px;height:32px;color:var(--color-text);cursor:pointer;font-size:1.125rem;line-height:1}.persian-date-input__weekdays[data-v-fc20b5a1],.persian-date-input__grid[data-v-fc20b5a1]{grid-template-columns:repeat(7,1fr);gap:4px;display:grid}.persian-date-input__weekdays[data-v-fc20b5a1]{color:var(--color-text-muted);text-align:center;margin-bottom:6px;font-size:.75rem}.persian-date-input__cell[data-v-fc20b5a1]{border-radius:var(--radius-sm);height:34px;color:var(--color-text);cursor:pointer;background:0 0;border:none;font-size:.8125rem}.persian-date-input__cell--empty[data-v-fc20b5a1]{cursor:default}.persian-date-input__cell--today[data-v-fc20b5a1]{border:1px solid var(--color-primary)}.persian-date-input__cell--selected[data-v-fc20b5a1]{background:var(--color-primary);color:var(--color-on-primary,#fff)}.persian-date-input__today[data-v-fc20b5a1]{border:1px solid var(--color-border);border-radius:var(--radius-sm);background:var(--color-elevated);width:100%;color:var(--color-primary);cursor:pointer;margin-top:10px;padding:8px 12px;font-size:.8125rem;font-weight:600;transition:background .15s,border-color .15s}.persian-date-input__today[data-v-fc20b5a1]:hover{background:var(--color-primary-soft);border-color:var(--color-primary)}.persian-date-input--compact .form-label[data-v-fc20b5a1]{color:var(--color-text-muted);margin-bottom:4px;font-size:.75rem}.persian-date-input--compact .persian-date-input__trigger[data-v-fc20b5a1]{background:var(--color-elevated);border-radius:8px;height:36px;padding:0 10px;font-size:.8125rem}.persian-date-input--compact .persian-date-input__icon svg[data-v-fc20b5a1]{width:16px;height:16px}.persian-date-input--compact .persian-date-input__panel[data-v-fc20b5a1]{border-radius:10px;width:min(292px,100vw - 24px);padding:10px;left:auto;right:0}.persian-date-input--compact .persian-date-input__cell[data-v-fc20b5a1]{height:32px;font-size:.75rem}.persian-date-input--compact .persian-date-input__nav[data-v-fc20b5a1]{width:28px;height:28px;font-size:1rem}.catalog-requests-page__head[data-v-01bfcf4e]{flex-wrap:wrap;justify-content:space-between;align-items:flex-start;gap:12px 16px;margin-bottom:16px;display:flex}.catalog-requests-page__head h1[data-v-01bfcf4e]{margin:0 0 2px;font-size:1.15rem}.catalog-requests-page__head p[data-v-01bfcf4e]{color:var(--color-text-muted);margin:0;font-size:.8125rem}.catalog-requests-page__toolbar[data-v-01bfcf4e]{flex-wrap:wrap;align-items:center;gap:12px;margin-bottom:14px;padding:12px 14px;display:flex}.catalog-requests-page__search[data-v-01bfcf4e]{min-width:0;color:var(--color-text-muted);flex:220px;align-items:center;gap:10px;display:flex}.catalog-requests-page__search-input[data-v-01bfcf4e]{min-width:0;color:var(--color-text);background:0 0;border:none;outline:none;flex:1;font-size:.875rem}.catalog-requests-page__filters[data-v-01bfcf4e]{flex-wrap:wrap;flex:280px;justify-content:flex-end;align-items:flex-end;gap:8px;display:flex}.catalog-requests-page__date-wrap[data-v-01bfcf4e]{align-items:flex-end;gap:4px;display:flex;position:relative}.catalog-requests-page__date[data-v-01bfcf4e]{width:min(168px,42vw);min-width:132px}.catalog-requests-page__date-clear[data-v-01bfcf4e]{border:1px solid var(--color-border);background:var(--color-elevated);width:28px;height:36px;color:var(--color-text-muted);cursor:pointer;border-radius:8px;flex-shrink:0;margin-bottom:0;font-size:1.125rem;line-height:1;transition:color .15s,border-color .15s}.catalog-requests-page__date-clear[data-v-01bfcf4e]:hover{color:var(--color-danger);border-color:var(--color-danger)}.catalog-requests-page__status[data-v-01bfcf4e]{width:min(168px,42vw);min-width:140px}.catalog-requests-page__list[data-v-01bfcf4e]{flex-direction:column;gap:10px;display:flex}.customer-card[data-v-01bfcf4e]{background:var(--color-surface);border:1px solid var(--color-border);border-radius:10px;padding:10px 12px}.customer-card__toggle[data-v-01bfcf4e]{text-align:right;cursor:pointer;width:100%;color:inherit;background:0 0;border:none;align-items:flex-start;gap:8px;margin:0;padding:0;display:flex}.customer-card__toggle[data-v-01bfcf4e]:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px;border-radius:6px}.customer-card__chevron[data-v-01bfcf4e]{width:22px;color:var(--color-text-muted);flex-shrink:0;margin-top:2px;font-size:.75rem}.customer-card__toggle-main[data-v-01bfcf4e]{flex-wrap:wrap;flex:1;justify-content:space-between;align-items:center;gap:6px 10px;min-width:0;display:flex}.customer-card--collapsed .customer-card__table-wrap[data-v-01bfcf4e]{display:none}.customer-card__badge[data-v-01bfcf4e]{background:var(--color-elevated);color:var(--color-text-muted);border-radius:999px;flex-shrink:0;padding:2px 8px;font-size:.6875rem;font-weight:600}.customer-card__identity[data-v-01bfcf4e]{flex-wrap:wrap;align-items:baseline;gap:6px 10px;min-width:0;display:flex}.customer-card__name[data-v-01bfcf4e]{text-overflow:ellipsis;white-space:nowrap;max-width:min(240px,55vw);font-size:.9rem;overflow:hidden}.customer-card__phone[data-v-01bfcf4e]{color:var(--color-text-muted);font-size:.8125rem}.customer-card__address[data-v-01bfcf4e]{border-bottom:1px solid var(--color-border);color:var(--color-text-muted);margin:6px 0 8px;padding:0 30px 8px 0;font-size:.75rem;line-height:1.45}.customer-card--collapsed .customer-card__address[data-v-01bfcf4e]{display:none}.customer-card__address-label[data-v-01bfcf4e]{color:var(--color-text);font-weight:600}.customer-card__table-wrap[data-v-01bfcf4e]{overflow-x:auto}.customer-card__table[data-v-01bfcf4e]{border-collapse:collapse;width:100%;font-size:.75rem}.customer-card__table th[data-v-01bfcf4e],.customer-card__table td[data-v-01bfcf4e]{text-align:right;border-top:1px solid var(--color-border);vertical-align:middle;padding:5px 6px}.customer-card__table thead th[data-v-01bfcf4e]{color:var(--color-text-muted);white-space:nowrap;border-top:none;font-weight:600}.customer-card__date[data-v-01bfcf4e],.customer-card__code[data-v-01bfcf4e]{white-space:nowrap}.customer-card__status[data-v-01bfcf4e]{flex-wrap:wrap;align-items:center;gap:6px;min-width:140px;display:flex}.customer-card__status-select[data-v-01bfcf4e]{flex:120px;min-width:120px}@media (width>=768px){.customer-card[data-v-01bfcf4e]{padding:12px 14px}.customer-card__table[data-v-01bfcf4e]{font-size:.8125rem}}
diff --git a/dist/assets/CategoriesView-Bixx3g4K.css b/dist/assets/CategoriesView-Bixx3g4K.css
new file mode 100644
index 0000000..3a0cb8f
--- /dev/null
+++ b/dist/assets/CategoriesView-Bixx3g4K.css
@@ -0,0 +1 @@
+.category-icon[data-v-76e4dc13]{color:var(--color-text-muted);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.admin-page-header__sub[data-v-c42a22e0]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.categories-admin__grid[data-v-c42a22e0]{align-items:start;gap:16px;display:grid}.categories-panel[data-v-c42a22e0]{padding:20px}.categories-panel__head[data-v-c42a22e0]{border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px;padding-bottom:14px;display:flex}.categories-panel__head h2[data-v-c42a22e0]{margin:0 0 4px;font-size:1.05rem;font-weight:700}.categories-panel__head p[data-v-c42a22e0]{color:var(--color-text-muted);margin:0;font-size:.78rem}.categories-panel__add[data-v-c42a22e0]{border:1px dashed var(--color-border);background:var(--color-bg);border-radius:12px;gap:8px;margin-bottom:16px;padding:14px;display:grid}.categories-panel__empty[data-v-c42a22e0]{text-align:center;color:var(--color-text-muted);background:var(--color-bg);border-radius:12px;margin:0;padding:28px 12px;font-size:.875rem}.categories-panel__list[data-v-c42a22e0]{gap:12px;display:grid}.category-row[data-v-c42a22e0]{border:1px solid var(--color-border);background:var(--color-bg);border-radius:14px;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:12px;padding:12px;display:grid}.category-row__fields[data-v-c42a22e0]{gap:8px;min-width:0;display:grid}.category-row__line[data-v-c42a22e0]{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;display:grid}.category-row__line[data-v-c42a22e0] .admin-select{min-width:0}.category-row__id[data-v-c42a22e0]{color:var(--color-text-muted);margin:0;font-family:ui-monospace,monospace;font-size:.72rem}.category-row__remove[data-v-c42a22e0]{color:var(--color-danger,#dc3545);font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:none;padding:6px 4px;font-size:.8125rem}.category-row[data-v-c42a22e0] .image-picker__preview{width:72px;height:60px}@media (width>=900px){.categories-admin__grid[data-v-c42a22e0]{grid-template-columns:1fr 1fr}}@media (width<=640px){.category-row[data-v-c42a22e0]{grid-template-columns:1fr}.category-row__remove[data-v-c42a22e0]{justify-self:start}}
diff --git a/dist/assets/CategoriesView-D7xsOZr4.css b/dist/assets/CategoriesView-D7xsOZr4.css
deleted file mode 100644
index 89709c7..0000000
--- a/dist/assets/CategoriesView-D7xsOZr4.css
+++ /dev/null
@@ -1 +0,0 @@
-.category-icon[data-v-76e4dc13]{color:var(--color-text-muted);flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.admin-page-header__sub[data-v-092c0b6f]{color:var(--color-text-muted);margin:4px 0 0;font-size:.85rem}.categories-admin__grid[data-v-092c0b6f]{align-items:start;gap:16px;display:grid}.categories-panel[data-v-092c0b6f]{padding:20px}.categories-panel__head[data-v-092c0b6f]{border-bottom:1px solid var(--color-border);justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:16px;padding-bottom:14px;display:flex}.categories-panel__head h2[data-v-092c0b6f]{margin:0 0 4px;font-size:1.05rem;font-weight:700}.categories-panel__head p[data-v-092c0b6f]{color:var(--color-text-muted);margin:0;font-size:.78rem}.categories-panel__add[data-v-092c0b6f]{border:1px dashed var(--color-border);background:var(--color-bg);border-radius:12px;gap:8px;margin-bottom:16px;padding:14px;display:grid}.categories-panel__empty[data-v-092c0b6f]{text-align:center;color:var(--color-text-muted);background:var(--color-bg);border-radius:12px;margin:0;padding:28px 12px;font-size:.875rem}.categories-panel__list[data-v-092c0b6f]{gap:12px;display:grid}.category-row[data-v-092c0b6f]{border:1px solid var(--color-border);background:var(--color-bg);border-radius:14px;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:12px;padding:12px;display:grid}.category-row__fields[data-v-092c0b6f]{gap:8px;min-width:0;display:grid}.category-row__line[data-v-092c0b6f]{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;display:grid}.category-row__line[data-v-092c0b6f] .admin-select{min-width:0}.category-row__id[data-v-092c0b6f]{color:var(--color-text-muted);margin:0;font-family:ui-monospace,monospace;font-size:.72rem}.category-row__remove[data-v-092c0b6f]{color:var(--color-danger,#dc3545);font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:none;padding:6px 4px;font-size:.8125rem}.category-row[data-v-092c0b6f] .image-picker__preview{width:72px;height:60px}@media (width>=900px){.categories-admin__grid[data-v-092c0b6f]{grid-template-columns:1fr 1fr}}@media (width<=640px){.category-row[data-v-092c0b6f]{grid-template-columns:1fr}.category-row__remove[data-v-092c0b6f]{justify-self:start}}
diff --git a/dist/assets/CategoriesView-DB_2mVA7.js b/dist/assets/CategoriesView-DB_2mVA7.js
deleted file mode 100644
index 54ee1b7..0000000
--- a/dist/assets/CategoriesView-DB_2mVA7.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,E as n,H as r,M as i,U as a,Z as o,c as s,d as c,g as l,h as u,k as d,l as f,p,r as m,s as h,t as g,u as _}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as ee,f as v,t as y}from"./http-BjLkjdQu.js";import{E as b,V as x}from"./index-SWzbcuqQ.js";import{t as te}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as S}from"./BaseSwitch-pJwnFBVo.js";import{t as C}from"./AdminImagePicker-DBOLHU6S.js";import{t as w}from"./AdminSelect-6a7SFr9x.js";var T={class:`category-icon`,"aria-hidden":`true`},E=[`width`,`height`,`stroke`,`stroke-width`],D=[`width`,`height`,`stroke`,`stroke-width`],O=[`width`,`height`,`stroke`,`stroke-width`],k=[`width`,`height`,`stroke`],A=[`width`,`height`,`stroke`],j=[`width`,`height`,`stroke`],M=g(l({__name:`CategoryIcon`,props:{name:{},size:{default:18},color:{default:`currentColor`},strokeWidth:{default:1.5}},setup(e){let t=e,n={bolt:`vuesax-linear:flash`,feather:`vuesax-linear:pen-add`,diamond:`vuesax-linear:diamonds`,grid:`vuesax-linear:element-3`,bag:`vuesax-linear:shopping-bag`,weight:`vuesax-linear:shopping-bag`,"id-card":`vuesax-linear:personalcard`,catalog:`vuesax-linear:category`,headset:`vuesax-linear:headphone`,home:`vuesax-linear:home`},r=h(()=>n[t.name]);return(t,n)=>(d(),c(`span`,T,[r.value?(d(),f(x,{key:0,icon:r.value,size:e.size,"stroke-width":e.strokeWidth,color:e.color},null,8,[`icon`,`size`,`stroke-width`,`color`])):e.name===`shirt`?(d(),c(`svg`,{key:1,width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,stroke:e.color,"stroke-width":e.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...n[0]||=[s(`path`,{d:`M8.25 5.25 12 7.75l3.75-2.5 2.25 2.75L16 9.5V18.5a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V9.5L6 8l2.25-2.75Z`},null,-1),s(`path`,{d:`M12 7.75V18.5`},null,-1)]],8,E)):e.name===`suit`?(d(),c(`svg`,{key:2,width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,stroke:e.color,"stroke-width":e.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...n[1]||=[s(`path`,{d:`M7.5 5.5h9l2 3v10.5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1V8.5l2-3Z`},null,-1),s(`path`,{d:`M12 5.5v13`},null,-1),s(`path`,{d:`M7.5 9 12 11.75 16.5 9`},null,-1),s(`path`,{d:`M10.25 5.5V4a1.75 1.75 0 0 1 3.5 0v1.5`},null,-1)]],8,D)):e.name===`trousers`?(d(),c(`svg`,{key:3,width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,stroke:e.color,"stroke-width":e.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...n[2]||=[s(`path`,{d:`M8 4.5h8v4.25l-1.75 11H13l-1-9.5-1 9.5H7.75L6 8.75V4.5Z`},null,-1),s(`path`,{d:`M12 8.75v11`},null,-1),s(`path`,{d:`M8 7.25h8`},null,-1)]],8,O)):e.name===`ruler`?(d(),c(`svg`,{key:4,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`},[...n[3]||=[p(``,5)]],8,k)):e.name===`composition`?(d(),c(`svg`,{key:5,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`},[...n[4]||=[s(`path`,{d:`M12 3.5 20 8v8l-8 4.5L4 16V8l8-4.5Z`},null,-1)]],8,A)):e.name===`weave`?(d(),c(`svg`,{key:6,width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,stroke:e.color,"stroke-width":`1.6`,"stroke-linecap":`round`},[...n[5]||=[p(``,7)]],8,j)):_(``,!0)]))}}),[[`__scopeId`,`data-v-76e4dc13`]]),ne={class:`categories-admin`},re={class:`admin-page-header`},ie=[`disabled`],ae={key:1,class:`categories-admin__grid`},oe={class:`admin-card categories-panel`},se={class:`categories-panel__head`},ce={key:0,class:`categories-panel__add`},le={key:1,class:`categories-panel__empty`},ue={key:2,class:`categories-panel__list`},N={class:`category-row__fields`},P={class:`category-row__line`},F=[`onUpdate:modelValue`],I={class:`category-row__line`},L=[`onUpdate:modelValue`],R={class:`category-row__line`},z={class:`category-row__id`,dir:`ltr`},B=[`onClick`],V={class:`admin-card categories-panel`},H={class:`categories-panel__head`},U={key:0,class:`categories-panel__add`},de={key:1,class:`categories-panel__empty`},fe={key:2,class:`categories-panel__list`},pe={class:`category-row__fields`},W={class:`category-row__line`},me=[`onUpdate:modelValue`],he={class:`category-row__line`},ge=[`onUpdate:modelValue`],_e={class:`category-row__line`},ve=[`onUpdate:modelValue`],ye={class:`category-row__line`},be={class:`category-row__id`,dir:`ltr`},xe=[`onClick`],G=g(l({__name:`CategoriesView`,setup(l){let p=e([]),g=e([]),x=o({}),T=e(!0),E=e(!1),D=ee(),O=e(!1),k=e(!1),A=[{value:`shirt`,label:`پیراهن`},{value:`suit`,label:`کتشلوار`},{value:`trousers`,label:`شلوار`},{value:`bolt`,label:`آذرخش`},{value:`feather`,label:`پر`},{value:`diamond`,label:`الماس`},{value:`grid`,label:`شبکه`},{value:`bag`,label:`کیف`},{value:`id-card`,label:`کارت`},{value:`catalog`,label:`کالیته`},{value:`headset`,label:`پشتیبانی`},{value:`home`,label:`خانه`},{value:`ruler`,label:`عرض`},{value:`composition`,label:`جنس`},{value:`weight`,label:`وزن`},{value:`weave`,label:`نوع بافت`}];function j(e){return e===`shirt`?`shirt`:e===`suit`?`suit`:e===`trousers`?`trousers`:`grid`}function G(e){return e===`summer`?`bolt`:e===`winter`?`feather`:`diamond`}let K=o({id:``,title:``,subtitle:`مشاهده محصولات`,icon:`grid`,showTitle:!0,showSubtitle:!0,showIcon:!0}),q=o({id:``,title:``,description:``,ctaLabel:`مشاهده محصولات`,icon:`diamond`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0});function J(e){return e!==!1}let Y=h(()=>p.value.map(e=>e.id)),X=h(()=>g.value.map(e=>e.id));function Z(e){return e.trim().toLowerCase().replace(/\s+/g,`_`).replace(/[^a-z0-9_\u0600-\u06ff-]/gi,``).slice(0,48)}function Q(){let e=[...Y.value,...X.value];for(let t of e)t in x||(x[t]=null);for(let t of Object.keys(x))e.includes(t)||delete x[t]}async function $(){T.value=!0;try{let e=await b.get();p.value=e.categoryDefsJson?.usage?.length?e.categoryDefsJson.usage.map(e=>({id:e.id,title:e.title,subtitle:e.subtitle||`مشاهده محصولات`,icon:e.icon||j(e.id),showTitle:J(e.showTitle),showSubtitle:J(e.showSubtitle),showIcon:J(e.showIcon)})):[{id:`trousers`,title:`پارچههای شلواری`,subtitle:`مشاهده محصولات`,icon:`trousers`,showTitle:!0,showSubtitle:!0,showIcon:!0},{id:`suit`,title:`پارچههای کتشلواری`,subtitle:`مشاهده محصولات`,icon:`suit`,showTitle:!0,showSubtitle:!0,showIcon:!0},{id:`shirt`,title:`پارچههای پیراهنی`,subtitle:`مشاهده محصولات`,icon:`shirt`,showTitle:!0,showSubtitle:!0,showIcon:!0}],g.value=e.categoryDefsJson?.seasons?.length?e.categoryDefsJson.seasons.map(e=>({id:e.id,title:e.title,description:e.description||``,ctaLabel:e.ctaLabel||`مشاهده محصولات`,icon:e.icon||G(e.id),showTitle:J(e.showTitle),showDescription:J(e.showDescription),showCta:J(e.showCta),showIcon:J(e.showIcon)})):[{id:`summer`,title:`تابستانه`,description:`سبک، خنک و مناسب فصل گرم`,ctaLabel:`مشاهده محصولات`,icon:`bolt`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0},{id:`winter`,title:`زمستانه`,description:`گرم و مناسب فصل سرد`,ctaLabel:`مشاهده محصولات`,icon:`feather`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0},{id:`all_season`,title:`چهارفصل`,description:`مناسب استفاده در بیشتر فصلهای سال`,ctaLabel:`مشاهده محصولات`,icon:`diamond`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0}],Q();let t=e.categoryImagesJson??{};for(let e of Object.keys(x))x[e]=t[e]??null}catch(e){D.error(e instanceof y?e.message:`بارگذاری دستهها ناموفق بود.`),p.value.length||(p.value=[{id:`trousers`,title:`پارچههای شلواری`,subtitle:`مشاهده محصولات`,icon:`trousers`,showTitle:!0,showSubtitle:!0,showIcon:!0},{id:`suit`,title:`پارچههای کتشلواری`,subtitle:`مشاهده محصولات`,icon:`suit`,showTitle:!0,showSubtitle:!0,showIcon:!0},{id:`shirt`,title:`پارچههای پیراهنی`,subtitle:`مشاهده محصولات`,icon:`shirt`,showTitle:!0,showSubtitle:!0,showIcon:!0}]),g.value.length||(g.value=[{id:`summer`,title:`تابستانه`,description:`سبک، خنک و مناسب فصل گرم`,ctaLabel:`مشاهده محصولات`,icon:`bolt`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0},{id:`winter`,title:`زمستانه`,description:`گرم و مناسب فصل سرد`,ctaLabel:`مشاهده محصولات`,icon:`feather`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0},{id:`all_season`,title:`چهارفصل`,description:`مناسب استفاده در بیشتر فصلهای سال`,ctaLabel:`مشاهده محصولات`,icon:`diamond`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0}]),Q()}finally{T.value=!1}}function Se(){let e=Z(K.id||K.title),t=K.title.trim();if(!e||!t){D.error(`شناسه و عنوان دسته کاربرد الزامی است.`);return}if(Y.value.includes(e)||X.value.includes(e)){D.error(`این شناسه از قبل وجود دارد.`);return}p.value.push({id:e,title:t,subtitle:K.subtitle.trim()||`مشاهده محصولات`,icon:K.icon,showTitle:K.showTitle,showSubtitle:K.showSubtitle,showIcon:K.showIcon}),x[e]=null,K.id=``,K.title=``,K.subtitle=`مشاهده محصولات`,K.icon=`grid`,K.showTitle=!0,K.showSubtitle=!0,K.showIcon=!0,O.value=!1}function Ce(){let e=Z(q.id||q.title),t=q.title.trim();if(!e||!t){D.error(`شناسه و عنوان دسته فصل الزامی است.`);return}if(Y.value.includes(e)||X.value.includes(e)){D.error(`این شناسه از قبل وجود دارد.`);return}g.value.push({id:e,title:t,description:q.description.trim(),ctaLabel:q.ctaLabel.trim()||`مشاهده محصولات`,icon:q.icon,showTitle:q.showTitle,showDescription:q.showDescription,showCta:q.showCta,showIcon:q.showIcon}),x[e]=null,q.id=``,q.title=``,q.description=``,q.ctaLabel=`مشاهده محصولات`,q.icon=`diamond`,q.showTitle=!0,q.showDescription=!0,q.showCta=!0,q.showIcon=!0,k.value=!1}function we(e){if(p.value.length<=1){D.error(`حداقل یک دسته کاربرد لازم است.`);return}p.value=p.value.filter(t=>t.id!==e),delete x[e]}function Te(e){if(g.value.length<=1){D.error(`حداقل یک دسته فصل لازم است.`);return}g.value=g.value.filter(t=>t.id!==e),delete x[e]}async function Ee(){E.value=!0;try{let e={};for(let[t,n]of Object.entries(x))n&&(e[t]=n);await b.update({categoryDefsJson:{usage:p.value,seasons:g.value},categoryImagesJson:e}),D.success(`دستهبندیها ذخیره شد.`),await $()}catch(e){D.error(e instanceof y?e.message:`ذخیره دستهبندیها ناموفق بود.`)}finally{E.value=!1}}return n(()=>{$()}),(e,n)=>(d(),c(`div`,ne,[s(`div`,re,[n[8]||=s(`div`,null,[s(`h1`,{class:`admin-page-header__title`},`دستهبندیها`),s(`p`,{class:`admin-page-header__sub`},` دستههای کاربرد و فصل را اضافه کنید. با کلید «نمایش / مخفی» مشخص کنید عنوان و توضیح در اپ کاربر دیده شود. `)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:E.value||T.value,onClick:Ee},t(E.value?`در حال ذخیره...`:`ذخیره تغییرات`),9,ie)]),T.value?(d(),f(te,{key:0,variant:`cards`})):(d(),c(`div`,ae,[s(`section`,oe,[s(`div`,se,[s(`div`,null,[n[9]||=s(`h2`,null,`بر اساس کاربرد`,-1),s(`p`,null,t(p.value.length)+` دسته برای فیلتر محصول در اپ کاربر`,1)]),s(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:n[0]||=e=>O.value=!O.value},t(O.value?`بستن فرم`:`+ افزودن دسته`),1)]),O.value?(d(),c(`div`,ce,[a(s(`input`,{"onUpdate:modelValue":n[1]||=e=>K.title=e,class:`admin-input`,type:`text`,placeholder:`عنوان (مثلاً پارچههای مانتویی)`},null,512),[[v,K.title]]),a(s(`input`,{"onUpdate:modelValue":n[2]||=e=>K.id=e,class:`admin-input`,type:`text`,dir:`ltr`,placeholder:`شناسه انگلیسی (اختیاری، مثلاً mantle)`},null,512),[[v,K.id]]),a(s(`input`,{"onUpdate:modelValue":n[3]||=e=>K.subtitle=e,class:`admin-input`,type:`text`,placeholder:`زیرعنوان`},null,512),[[v,K.subtitle]]),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:Se},`ثبت در لیست`)])):_(``,!0),p.value.length?(d(),c(`div`,ue,[(d(!0),c(m,null,i(p.value,e=>(d(),c(`article`,{key:e.id,class:`category-row`},[u(C,{"model-value":x[e.id],"onUpdate:modelValue":t=>x[e.id]=t},null,8,[`model-value`,`onUpdate:modelValue`]),s(`div`,N,[s(`div`,P,[a(s(`input`,{"onUpdate:modelValue":t=>e.title=t,class:`admin-input`,type:`text`,placeholder:`عنوان دسته`},null,8,F),[[v,e.title]]),u(S,{modelValue:e.showTitle,"onUpdate:modelValue":t=>e.showTitle=t,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),s(`div`,I,[a(s(`input`,{"onUpdate:modelValue":t=>e.subtitle=t,class:`admin-input`,type:`text`,placeholder:`زیرعنوان`},null,8,L),[[v,e.subtitle]]),u(S,{modelValue:e.showSubtitle,"onUpdate:modelValue":t=>e.showSubtitle=t,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),s(`div`,R,[u(w,{modelValue:e.icon,"onUpdate:modelValue":t=>e.icon=t,options:A,"aria-label":`آیکون`,block:``},{"option-leading":r(({option:e})=>[e?(d(),f(M,{key:0,name:e.value,size:18},null,8,[`name`])):_(``,!0)]),_:1},8,[`modelValue`,`onUpdate:modelValue`]),u(S,{modelValue:e.showIcon,"onUpdate:modelValue":t=>e.showIcon=t,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),s(`p`,z,t(e.id),1)]),s(`button`,{type:`button`,class:`category-row__remove`,onClick:t=>we(e.id)},`حذف`,8,B)]))),128))])):(d(),c(`p`,le,`هنوز دستهای ثبت نشده. با «افزودن دسته» شروع کنید.`))]),s(`section`,V,[s(`div`,H,[s(`div`,null,[n[10]||=s(`h2`,null,`بر اساس فصل`,-1),s(`p`,null,t(g.value.length)+` دسته فصلی برای فیلتر محصول`,1)]),s(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:n[4]||=e=>k.value=!k.value},t(k.value?`بستن فرم`:`+ افزودن دسته`),1)]),k.value?(d(),c(`div`,U,[a(s(`input`,{"onUpdate:modelValue":n[5]||=e=>q.title=e,class:`admin-input`,type:`text`,placeholder:`عنوان (مثلاً بهاره)`},null,512),[[v,q.title]]),a(s(`input`,{"onUpdate:modelValue":n[6]||=e=>q.id=e,class:`admin-input`,type:`text`,dir:`ltr`,placeholder:`شناسه انگلیسی (اختیاری، مثلاً spring)`},null,512),[[v,q.id]]),a(s(`input`,{"onUpdate:modelValue":n[7]||=e=>q.description=e,class:`admin-input`,type:`text`,placeholder:`توضیح`},null,512),[[v,q.description]]),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:Ce},`ثبت در لیست`)])):_(``,!0),g.value.length?(d(),c(`div`,fe,[(d(!0),c(m,null,i(g.value,e=>(d(),c(`article`,{key:e.id,class:`category-row`},[u(C,{"model-value":x[e.id],"onUpdate:modelValue":t=>x[e.id]=t},null,8,[`model-value`,`onUpdate:modelValue`]),s(`div`,pe,[s(`div`,W,[a(s(`input`,{"onUpdate:modelValue":t=>e.title=t,class:`admin-input`,type:`text`,placeholder:`عنوان دسته`},null,8,me),[[v,e.title]]),u(S,{modelValue:e.showTitle,"onUpdate:modelValue":t=>e.showTitle=t,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),s(`div`,he,[a(s(`input`,{"onUpdate:modelValue":t=>e.description=t,class:`admin-input`,type:`text`,placeholder:`توضیح`},null,8,ge),[[v,e.description]]),u(S,{modelValue:e.showDescription,"onUpdate:modelValue":t=>e.showDescription=t,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),s(`div`,_e,[a(s(`input`,{"onUpdate:modelValue":t=>e.ctaLabel=t,class:`admin-input`,type:`text`,placeholder:`متن لینک (مشاهده محصولات)`},null,8,ve),[[v,e.ctaLabel]]),u(S,{modelValue:e.showCta,"onUpdate:modelValue":t=>e.showCta=t,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),s(`div`,ye,[u(w,{modelValue:e.icon,"onUpdate:modelValue":t=>e.icon=t,options:A,"aria-label":`آیکون`,block:``},{"option-leading":r(({option:e})=>[e?(d(),f(M,{key:0,name:e.value,size:18},null,8,[`name`])):_(``,!0)]),_:1},8,[`modelValue`,`onUpdate:modelValue`]),u(S,{modelValue:e.showIcon,"onUpdate:modelValue":t=>e.showIcon=t,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),s(`p`,be,t(e.id),1)]),s(`button`,{type:`button`,class:`category-row__remove`,onClick:t=>Te(e.id)},`حذف`,8,xe)]))),128))])):(d(),c(`p`,de,`هنوز دستهای ثبت نشده. با «افزودن دسته» شروع کنید.`))])]))]))}}),[[`__scopeId`,`data-v-092c0b6f`]]);export{G as default};
\ No newline at end of file
diff --git a/dist/assets/CategoriesView-ifdhAjnC.js b/dist/assets/CategoriesView-ifdhAjnC.js
new file mode 100644
index 0000000..703bf12
--- /dev/null
+++ b/dist/assets/CategoriesView-ifdhAjnC.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,Q as r,U as i,W as a,c as o,d as s,et as c,g as l,h as u,jt as d,l as f,p,r as m,s as h,t as g,u as _}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as ee,d as v,t as y}from"./http-CTjL79ty.js";import{D as b,H as x}from"./index-DxcN1-hp.js";import{t as te}from"./AdminPageSkeleton-DacAHji8.js";import{t as S}from"./BaseSwitch-Dz4ODUhf.js";import{t as C}from"./AdminImagePicker-DhyB3HhH.js";import{t as w}from"./AdminSelect-BYntBSYd.js";var T={class:`category-icon`,"aria-hidden":`true`},E=[`width`,`height`,`stroke`,`stroke-width`],D=[`width`,`height`,`stroke`,`stroke-width`],O=[`width`,`height`,`stroke`,`stroke-width`],k=[`width`,`height`,`stroke`],A=[`width`,`height`,`stroke`],j=[`width`,`height`,`stroke`],M=g(l({__name:`CategoryIcon`,props:{name:{},size:{default:18},color:{default:`currentColor`},strokeWidth:{default:1.5}},setup(t){let n=t,r={bolt:`vuesax-linear:flash`,feather:`vuesax-linear:pen-add`,diamond:`vuesax-linear:diamonds`,grid:`vuesax-linear:element-3`,bag:`vuesax-linear:shopping-bag`,weight:`vuesax-linear:shopping-bag`,"id-card":`vuesax-linear:personalcard`,catalog:`vuesax-linear:category`,headset:`vuesax-linear:headphone`,home:`vuesax-linear:home`},i=h(()=>r[n.name]);return(n,r)=>(e(),s(`span`,T,[i.value?(e(),f(x,{key:0,icon:i.value,size:t.size,"stroke-width":t.strokeWidth,color:t.color},null,8,[`icon`,`size`,`stroke-width`,`color`])):t.name===`shirt`?(e(),s(`svg`,{key:1,width:t.size,height:t.size,viewBox:`0 0 24 24`,fill:`none`,stroke:t.color,"stroke-width":t.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...r[0]||=[o(`path`,{d:`M8.25 5.25 12 7.75l3.75-2.5 2.25 2.75L16 9.5V18.5a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V9.5L6 8l2.25-2.75Z`},null,-1),o(`path`,{d:`M12 7.75V18.5`},null,-1)]],8,E)):t.name===`suit`?(e(),s(`svg`,{key:2,width:t.size,height:t.size,viewBox:`0 0 24 24`,fill:`none`,stroke:t.color,"stroke-width":t.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...r[1]||=[o(`path`,{d:`M7.5 5.5h9l2 3v10.5a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1V8.5l2-3Z`},null,-1),o(`path`,{d:`M12 5.5v13`},null,-1),o(`path`,{d:`M7.5 9 12 11.75 16.5 9`},null,-1),o(`path`,{d:`M10.25 5.5V4a1.75 1.75 0 0 1 3.5 0v1.5`},null,-1)]],8,D)):t.name===`trousers`?(e(),s(`svg`,{key:3,width:t.size,height:t.size,viewBox:`0 0 24 24`,fill:`none`,stroke:t.color,"stroke-width":t.strokeWidth,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...r[2]||=[o(`path`,{d:`M8 4.5h8v4.25l-1.75 11H13l-1-9.5-1 9.5H7.75L6 8.75V4.5Z`},null,-1),o(`path`,{d:`M12 8.75v11`},null,-1),o(`path`,{d:`M8 7.25h8`},null,-1)]],8,O)):t.name===`ruler`?(e(),s(`svg`,{key:4,width:t.size,height:t.size,viewBox:`0 0 24 24`,fill:`none`,stroke:t.color,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...r[3]||=[p(``,5)]],8,k)):t.name===`composition`?(e(),s(`svg`,{key:5,width:t.size,height:t.size,viewBox:`0 0 24 24`,fill:`none`,stroke:t.color,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[...r[4]||=[o(`path`,{d:`M12 3.5 20 8v8l-8 4.5L4 16V8l8-4.5Z`},null,-1)]],8,A)):t.name===`weave`?(e(),s(`svg`,{key:6,width:t.size,height:t.size,viewBox:`0 0 24 24`,fill:`none`,stroke:t.color,"stroke-width":`1.6`,"stroke-linecap":`round`},[...r[5]||=[p(``,7)]],8,j)):_(``,!0)]))}}),[[`__scopeId`,`data-v-76e4dc13`]]),ne={class:`categories-admin`},re={class:`admin-page-header`},ie=[`disabled`],ae={key:1,class:`categories-admin__grid`},oe={class:`admin-card categories-panel`},se={class:`categories-panel__head`},ce={key:0,class:`categories-panel__add`},le={key:1,class:`categories-panel__empty`},ue={key:2,class:`categories-panel__list`},N={class:`category-row__fields`},P={class:`category-row__line`},F=[`onUpdate:modelValue`],I={class:`category-row__line`},L=[`onUpdate:modelValue`],R={class:`category-row__line`},z={class:`category-row__id`,dir:`ltr`},B=[`onClick`],V={class:`admin-card categories-panel`},H={class:`categories-panel__head`},U={key:0,class:`categories-panel__add`},W={key:1,class:`categories-panel__empty`},de={key:2,class:`categories-panel__list`},fe={class:`category-row__fields`},pe={class:`category-row__line`},me=[`onUpdate:modelValue`],he={class:`category-row__line`},ge=[`onUpdate:modelValue`],_e={class:`category-row__line`},ve=[`onUpdate:modelValue`],ye={class:`category-row__line`},be={class:`category-row__id`,dir:`ltr`},xe=[`onClick`],G=g(l({__name:`CategoriesView`,setup(l){let p=c([]),g=c([]),x=r({}),T=c(!0),E=c(!1),D=ee(),O=c(!1),k=c(!1),A=[{value:`shirt`,label:`پیراهن`},{value:`suit`,label:`کتشلوار`},{value:`trousers`,label:`شلوار`},{value:`bolt`,label:`آذرخش`},{value:`feather`,label:`پر`},{value:`diamond`,label:`الماس`},{value:`grid`,label:`شبکه`},{value:`bag`,label:`کیف`},{value:`id-card`,label:`کارت`},{value:`catalog`,label:`کالیته`},{value:`headset`,label:`پشتیبانی`},{value:`home`,label:`خانه`},{value:`ruler`,label:`عرض`},{value:`composition`,label:`جنس`},{value:`weight`,label:`وزن`},{value:`weave`,label:`نوع بافت`}];function j(e){return e===`shirt`?`shirt`:e===`suit`?`suit`:e===`trousers`?`trousers`:`grid`}function G(e){return e===`summer`?`bolt`:e===`winter`?`feather`:`diamond`}let K=r({id:``,title:``,subtitle:`مشاهده محصولات`,icon:`grid`,showTitle:!0,showSubtitle:!0,showIcon:!0}),q=r({id:``,title:``,description:``,ctaLabel:`مشاهده محصولات`,icon:`diamond`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0});function J(e){return e!==!1}let Y=h(()=>p.value.map(e=>e.id)),X=h(()=>g.value.map(e=>e.id));function Z(e){return e.trim().toLowerCase().replace(/\s+/g,`_`).replace(/[^a-z0-9_\u0600-\u06ff-]/gi,``).slice(0,48)}function Q(){let e=[...Y.value,...X.value];for(let t of e)t in x||(x[t]=null);for(let t of Object.keys(x))e.includes(t)||delete x[t]}async function $(){T.value=!0;try{let e=await b.get();p.value=e.categoryDefsJson?.usage?.length?e.categoryDefsJson.usage.map(e=>({id:e.id,title:e.title,subtitle:e.subtitle||`مشاهده محصولات`,icon:e.icon||j(e.id),showTitle:J(e.showTitle),showSubtitle:J(e.showSubtitle),showIcon:J(e.showIcon)})):[{id:`trousers`,title:`پارچههای شلواری`,subtitle:`مشاهده محصولات`,icon:`trousers`,showTitle:!0,showSubtitle:!0,showIcon:!0},{id:`suit`,title:`پارچههای کتشلواری`,subtitle:`مشاهده محصولات`,icon:`suit`,showTitle:!0,showSubtitle:!0,showIcon:!0},{id:`shirt`,title:`پارچههای پیراهنی`,subtitle:`مشاهده محصولات`,icon:`shirt`,showTitle:!0,showSubtitle:!0,showIcon:!0}],g.value=e.categoryDefsJson?.seasons?.length?e.categoryDefsJson.seasons.map(e=>({id:e.id,title:e.title,description:e.description||``,ctaLabel:e.ctaLabel||`مشاهده محصولات`,icon:e.icon||G(e.id),showTitle:J(e.showTitle),showDescription:J(e.showDescription),showCta:J(e.showCta),showIcon:J(e.showIcon)})):[{id:`summer`,title:`تابستانه`,description:`سبک، خنک و مناسب فصل گرم`,ctaLabel:`مشاهده محصولات`,icon:`bolt`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0},{id:`winter`,title:`زمستانه`,description:`گرم و مناسب فصل سرد`,ctaLabel:`مشاهده محصولات`,icon:`feather`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0},{id:`all_season`,title:`چهارفصل`,description:`مناسب استفاده در بیشتر فصلهای سال`,ctaLabel:`مشاهده محصولات`,icon:`diamond`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0}],Q();let t=e.categoryImagesJson??{};for(let e of Object.keys(x))x[e]=t[e]??null}catch(e){D.error(e instanceof y?e.message:`بارگذاری دستهها ناموفق بود.`),p.value.length||(p.value=[{id:`trousers`,title:`پارچههای شلواری`,subtitle:`مشاهده محصولات`,icon:`trousers`,showTitle:!0,showSubtitle:!0,showIcon:!0},{id:`suit`,title:`پارچههای کتشلواری`,subtitle:`مشاهده محصولات`,icon:`suit`,showTitle:!0,showSubtitle:!0,showIcon:!0},{id:`shirt`,title:`پارچههای پیراهنی`,subtitle:`مشاهده محصولات`,icon:`shirt`,showTitle:!0,showSubtitle:!0,showIcon:!0}]),g.value.length||(g.value=[{id:`summer`,title:`تابستانه`,description:`سبک، خنک و مناسب فصل گرم`,ctaLabel:`مشاهده محصولات`,icon:`bolt`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0},{id:`winter`,title:`زمستانه`,description:`گرم و مناسب فصل سرد`,ctaLabel:`مشاهده محصولات`,icon:`feather`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0},{id:`all_season`,title:`چهارفصل`,description:`مناسب استفاده در بیشتر فصلهای سال`,ctaLabel:`مشاهده محصولات`,icon:`diamond`,showTitle:!0,showDescription:!0,showCta:!0,showIcon:!0}]),Q()}finally{T.value=!1}}function Se(){let e=Z(K.id||K.title),t=K.title.trim();if(!e||!t){D.error(`شناسه و عنوان دسته کاربرد الزامی است.`);return}if(Y.value.includes(e)||X.value.includes(e)){D.error(`این شناسه از قبل وجود دارد.`);return}p.value.push({id:e,title:t,subtitle:K.subtitle.trim()||`مشاهده محصولات`,icon:K.icon,showTitle:K.showTitle,showSubtitle:K.showSubtitle,showIcon:K.showIcon}),x[e]=null,K.id=``,K.title=``,K.subtitle=`مشاهده محصولات`,K.icon=`grid`,K.showTitle=!0,K.showSubtitle=!0,K.showIcon=!0,O.value=!1}function Ce(){let e=Z(q.id||q.title),t=q.title.trim();if(!e||!t){D.error(`شناسه و عنوان دسته فصل الزامی است.`);return}if(Y.value.includes(e)||X.value.includes(e)){D.error(`این شناسه از قبل وجود دارد.`);return}g.value.push({id:e,title:t,description:q.description.trim(),ctaLabel:q.ctaLabel.trim()||`مشاهده محصولات`,icon:q.icon,showTitle:q.showTitle,showDescription:q.showDescription,showCta:q.showCta,showIcon:q.showIcon}),x[e]=null,q.id=``,q.title=``,q.description=``,q.ctaLabel=`مشاهده محصولات`,q.icon=`diamond`,q.showTitle=!0,q.showDescription=!0,q.showCta=!0,q.showIcon=!0,k.value=!1}function we(e){if(p.value.length<=1){D.error(`حداقل یک دسته کاربرد لازم است.`);return}p.value=p.value.filter(t=>t.id!==e),delete x[e]}function Te(e){if(g.value.length<=1){D.error(`حداقل یک دسته فصل لازم است.`);return}g.value=g.value.filter(t=>t.id!==e),delete x[e]}async function Ee(){E.value=!0;try{let e={};for(let[t,n]of Object.entries(x))n&&(e[t]=n);await b.update({categoryDefsJson:{usage:p.value,seasons:g.value},categoryImagesJson:e}),D.success(`دستهبندیها ذخیره شد.`),await $()}catch(e){D.error(e instanceof y?e.message:`ذخیره دستهبندیها ناموفق بود.`)}finally{E.value=!1}}return t(()=>{$()}),(t,r)=>(e(),s(`div`,ne,[o(`div`,re,[r[8]||=o(`div`,null,[o(`h1`,{class:`admin-page-header__title`},`دستهبندیها`),o(`p`,{class:`admin-page-header__sub`},` دستههای کاربرد و فصل را اضافه کنید. با کلید «نمایش / مخفی» مشخص کنید عنوان و توضیح در اپ کاربر دیده شود. `)],-1),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:E.value||T.value,onClick:Ee},d(E.value?`در حال ذخیره...`:`ثبت تغییرات`),9,ie)]),T.value?(e(),f(te,{key:0,variant:`cards`})):(e(),s(`div`,ae,[o(`section`,oe,[o(`div`,se,[o(`div`,null,[r[9]||=o(`h2`,null,`بر اساس کاربرد`,-1),o(`p`,null,d(p.value.length)+` دسته برای فیلتر محصول در اپ کاربر`,1)]),o(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:r[0]||=e=>O.value=!O.value},d(O.value?`بستن فرم`:`+ افزودن دسته`),1)]),O.value?(e(),s(`div`,ce,[a(o(`input`,{"onUpdate:modelValue":r[1]||=e=>K.title=e,class:`admin-input`,type:`text`,placeholder:`عنوان (مثلاً پارچههای مانتویی)`},null,512),[[v,K.title]]),a(o(`input`,{"onUpdate:modelValue":r[2]||=e=>K.id=e,class:`admin-input`,type:`text`,dir:`ltr`,placeholder:`شناسه انگلیسی (اختیاری، مثلاً mantle)`},null,512),[[v,K.id]]),a(o(`input`,{"onUpdate:modelValue":r[3]||=e=>K.subtitle=e,class:`admin-input`,type:`text`,placeholder:`زیرعنوان`},null,512),[[v,K.subtitle]]),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:Se},`ثبت در لیست`)])):_(``,!0),p.value.length?(e(),s(`div`,ue,[(e(!0),s(m,null,n(p.value,t=>(e(),s(`article`,{key:t.id,class:`category-row`},[u(C,{"model-value":x[t.id],"onUpdate:modelValue":e=>x[t.id]=e},null,8,[`model-value`,`onUpdate:modelValue`]),o(`div`,N,[o(`div`,P,[a(o(`input`,{"onUpdate:modelValue":e=>t.title=e,class:`admin-input`,type:`text`,placeholder:`عنوان دسته`},null,8,F),[[v,t.title]]),u(S,{modelValue:t.showTitle,"onUpdate:modelValue":e=>t.showTitle=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),o(`div`,I,[a(o(`input`,{"onUpdate:modelValue":e=>t.subtitle=e,class:`admin-input`,type:`text`,placeholder:`زیرعنوان`},null,8,L),[[v,t.subtitle]]),u(S,{modelValue:t.showSubtitle,"onUpdate:modelValue":e=>t.showSubtitle=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),o(`div`,R,[u(w,{modelValue:t.icon,"onUpdate:modelValue":e=>t.icon=e,options:A,"aria-label":`آیکون`,block:``},{"option-leading":i(({option:t})=>[t?(e(),f(M,{key:0,name:t.value,size:18},null,8,[`name`])):_(``,!0)]),_:1},8,[`modelValue`,`onUpdate:modelValue`]),u(S,{modelValue:t.showIcon,"onUpdate:modelValue":e=>t.showIcon=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),o(`p`,z,d(t.id),1)]),o(`button`,{type:`button`,class:`category-row__remove`,onClick:e=>we(t.id)},`حذف`,8,B)]))),128))])):(e(),s(`p`,le,`هنوز دستهای ثبت نشده. با «افزودن دسته» شروع کنید.`))]),o(`section`,V,[o(`div`,H,[o(`div`,null,[r[10]||=o(`h2`,null,`بر اساس فصل`,-1),o(`p`,null,d(g.value.length)+` دسته فصلی برای فیلتر محصول`,1)]),o(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:r[4]||=e=>k.value=!k.value},d(k.value?`بستن فرم`:`+ افزودن دسته`),1)]),k.value?(e(),s(`div`,U,[a(o(`input`,{"onUpdate:modelValue":r[5]||=e=>q.title=e,class:`admin-input`,type:`text`,placeholder:`عنوان (مثلاً بهاره)`},null,512),[[v,q.title]]),a(o(`input`,{"onUpdate:modelValue":r[6]||=e=>q.id=e,class:`admin-input`,type:`text`,dir:`ltr`,placeholder:`شناسه انگلیسی (اختیاری، مثلاً spring)`},null,512),[[v,q.id]]),a(o(`input`,{"onUpdate:modelValue":r[7]||=e=>q.description=e,class:`admin-input`,type:`text`,placeholder:`توضیح`},null,512),[[v,q.description]]),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:Ce},`ثبت در لیست`)])):_(``,!0),g.value.length?(e(),s(`div`,de,[(e(!0),s(m,null,n(g.value,t=>(e(),s(`article`,{key:t.id,class:`category-row`},[u(C,{"model-value":x[t.id],"onUpdate:modelValue":e=>x[t.id]=e},null,8,[`model-value`,`onUpdate:modelValue`]),o(`div`,fe,[o(`div`,pe,[a(o(`input`,{"onUpdate:modelValue":e=>t.title=e,class:`admin-input`,type:`text`,placeholder:`عنوان دسته`},null,8,me),[[v,t.title]]),u(S,{modelValue:t.showTitle,"onUpdate:modelValue":e=>t.showTitle=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),o(`div`,he,[a(o(`input`,{"onUpdate:modelValue":e=>t.description=e,class:`admin-input`,type:`text`,placeholder:`توضیح`},null,8,ge),[[v,t.description]]),u(S,{modelValue:t.showDescription,"onUpdate:modelValue":e=>t.showDescription=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),o(`div`,_e,[a(o(`input`,{"onUpdate:modelValue":e=>t.ctaLabel=e,class:`admin-input`,type:`text`,placeholder:`متن لینک (مشاهده محصولات)`},null,8,ve),[[v,t.ctaLabel]]),u(S,{modelValue:t.showCta,"onUpdate:modelValue":e=>t.showCta=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),o(`div`,ye,[u(w,{modelValue:t.icon,"onUpdate:modelValue":e=>t.icon=e,options:A,"aria-label":`آیکون`,block:``},{"option-leading":i(({option:t})=>[t?(e(),f(M,{key:0,name:t.value,size:18},null,8,[`name`])):_(``,!0)]),_:1},8,[`modelValue`,`onUpdate:modelValue`]),u(S,{modelValue:t.showIcon,"onUpdate:modelValue":e=>t.showIcon=e,"active-text":`نمایش`,"inactive-text":`مخفی`},null,8,[`modelValue`,`onUpdate:modelValue`])]),o(`p`,be,d(t.id),1)]),o(`button`,{type:`button`,class:`category-row__remove`,onClick:e=>Te(t.id)},`حذف`,8,xe)]))),128))])):(e(),s(`p`,W,`هنوز دستهای ثبت نشده. با «افزودن دسته» شروع کنید.`))])]))]))}}),[[`__scopeId`,`data-v-c42a22e0`]]);export{G as default};
\ No newline at end of file
diff --git a/dist/assets/CheckManagementView-CI7_ZXvL.js b/dist/assets/CheckManagementView-CI7_ZXvL.js
new file mode 100644
index 0000000..afc7ba2
--- /dev/null
+++ b/dist/assets/CheckManagementView-CI7_ZXvL.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,Ot as r,a as ee,c as i,ct as a,d as o,et as s,g as te,h as c,jt as l,l as ne,m as u,r as d,s as f,t as p,u as m}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as re,m as h,t as g}from"./http-CTjL79ty.js";import{B as _,C as ie,R as ae,T as v,_ as y,a as b,i as x,o as oe,z as se}from"./index-DxcN1-hp.js";import{s as S}from"./orderStatus-CeC05Cv4.js";import{t as C}from"./StatusBadge-BkaoX2rz.js";var ce={class:`checks-page`},le={class:`admin-page-header`},ue={key:0,class:`checks-page__order-meta`},de={class:`checks-page__stats`},fe={class:`checks-page__stat`},pe={class:`checks-page__stat`},me={class:`checks-page__stat`},he={class:`checks-page__stat`},ge={class:`admin-tabs`},_e={key:0,class:`admin-empty-placeholder admin-card`},ve={key:1,class:`checks-page__list admin-card`},ye=[`onClick`],be={class:`check-row__chevron`,"aria-hidden":`true`},w=[`onClick`],T=[`src`],E={key:1,class:`check-row__thumb check-row__thumb--empty`},D={class:`check-row__meta`},O=[`disabled`,`onClick`],k=[`disabled`,`onClick`],A={key:0,class:`check-row__panel`},j={key:0,class:`check-row__fields`},M=[`dir`],N={key:1,class:`check-row__hint`},xe={class:`check-row__photos`},Se=[`onClick`],Ce=[`src`],we=[`onClick`],Te=[`src`],Ee={key:2,class:`check-row__hint`},De={class:`checks-page__footer`},Oe={class:`checks-page__note`},ke={class:`admin-action-group`},Ae=[`disabled`],je={key:0,class:`admin-empty-placeholder admin-card`},Me={key:1,class:`checks-page__history`},P={class:`checks-page__history-item-head`},Ne={class:`checks-page__history-meta`},Pe={key:0,class:`checks-page__history-note`},Fe={key:1,class:`checks-page__history-note`},Ie={class:`checks-page__history-item-head`},Le={class:`checks-page__history-note`},Re=[`src`],F=p(te({__name:`CheckManagementView`,setup(te){let p=ae(),F=se(),I=re(),L=s(`info`),R=s(null),z=s([]),B=s(null),V=s(null),H=s(null),U=f(()=>R.value?ie(R.value):null),ze=f(()=>z.value.reduce((e,t)=>e+t.amount,0)),W=f(()=>z.value.filter(e=>e.status===`pending_review`)),Be=f(()=>z.value.length>0&&z.value.every(e=>e.status===`approved`)),G=f(()=>!Be.value||!R.value?!1:(R.value.rawStatus??R.value.status)===`checks_approved`),K=s(!1),q=f(()=>{let e=R.value?.statusHistory??[],t=new Set([`check_in_progress`,`awaiting_check_review`,`check_needs_fix`,`check_rejected`,`checks_approved`]),n=e.filter(e=>t.has(e.toStatus)||e.fromStatus&&t.has(e.fromStatus)||/چک/.test(e.note||``)||/چک/.test(e.reason||``));return[...n.length?n:e].sort((e,t)=>new Date(t.changedAt).getTime()-new Date(e.changedAt).getTime())}),J=f(()=>z.value.filter(e=>e.notes?.trim()).map(e=>({id:e.id,row:e.row,status:e.status,notes:e.notes,updatedAt:e.updatedAt})));async function Ve(){let e=String(p.params.id);try{let[t,n]=await Promise.all([v.get(e),y.listByOrder(e)]);R.value=t,z.value=n,n.length===1&&(V.value=n[0].id)}catch(e){I.error(e instanceof g?e.message:`بارگذاری چکها انجام نشد.`)}}t(()=>{Ve()});function He(){F.push(`/orders`)}function Y(e){return e===`approved`?`check_approved`:e===`rejected`?`check_rejected`:`pending_check_review`}function Ue(e){return e?e===`customer`?`مشتری`:e.startsWith(`admin:`)?`ادمین`:e:`—`}function X(e){return oe(e)}function We(e){return[e.ownerFirstName,e.ownerLastName].filter(Boolean).join(` `)}function Z(e){return[{label:`بانک`,value:e.bankName},{label:`شعبه`,value:e.branchName},{label:`شناسه صیادی`,value:e.sayadId,ltr:!0},{label:`شماره چک`,value:e.checkNumber,ltr:!0},{label:`صاحب چک`,value:We(e)},{label:`کد ملی`,value:e.ownerNationalId,ltr:!0},{label:`یادداشت`,value:e.notes}].filter(e=>!!e.value?.trim())}function Ge(e){V.value=V.value===e.id?null:e.id}async function Q(e,t){B.value=e.id;try{let n=await y.updateStatus(e.id,{status:t}),r=z.value.findIndex(t=>t.id===e.id);return r!==-1&&(z.value[r]=n),R.value=await v.get(String(p.params.id)),!0}catch(e){return I.error(e instanceof g?e.message:`بهروزرسانی وضعیت چک انجام نشد.`),!1}finally{B.value=null}}async function $(e,t){if(t!==`approved`&&t!==`rejected`)return;let n=x(e.amount);await _(t===`approved`?{title:`تأیید چک`,message:`آیا از تأیید چک ردیف ${e.row} به مبلغ ${n} مطمئن هستید؟`,tone:`primary`,confirmLabel:`تأیید چک`,cancelLabel:`انصراف`}:{title:`رد چک`,message:`آیا از رد چک ردیف ${e.row} به مبلغ ${n} مطمئن هستید؟`,tone:`danger`,confirmLabel:`رد چک`,cancelLabel:`انصراف`})&&await Q(e,t)&&I.success(t===`approved`?`چک تأیید شد.`:`چک رد شد.`)}async function Ke(){let e=W.value;if(!e.length){I.error(`چکی برای تأیید وجود ندارد.`);return}if(await _({title:`تأیید همه چکها`,message:`آیا از تأیید ${e.length} چک در انتظار بررسی مطمئن هستید؟`,tone:`primary`,confirmLabel:`تأیید همه`,cancelLabel:`انصراف`})){for(let t of e)if(!await Q(t,`approved`))return;I.success(`همه چکهای در انتظار تأیید شدند.`)}}async function qe(){if(!(!R.value||K.value)&&await _({title:`تأیید نهایی سفارش`,message:`با تأیید نهایی، سفارش از مرحله بررسی چک خارج میشود و وارد آمادهسازی میگردد. ادامه میدهید؟`,tone:`primary`,confirmLabel:`تأیید نهایی`,cancelLabel:`انصراف`})){K.value=!0;try{let e=await v.updateStatus(R.value.id,{status:`final_approved`,note:`تأیید نهایی پس از تأیید همه چکها`});R.value=e,I.success(`سفارش تأیید نهایی شد.`)}catch(e){I.error(e instanceof g?e.message:`تأیید نهایی انجام نشد.`)}finally{K.value=!1}}}return(t,s)=>(e(),o(`div`,ce,[i(`div`,le,[s[5]||=i(`div`,null,[i(`h1`,{class:`admin-page-header__title`},`مدیریت چکهای سفارش`)],-1),U.value?(e(),o(`div`,ue,[c(C,{status:U.value.status},null,8,[`status`])])):m(``,!0)]),i(`div`,de,[i(`div`,fe,[s[6]||=i(`span`,null,`تعداد`,-1),i(`strong`,null,l(z.value.length),1)]),i(`div`,pe,[s[7]||=i(`span`,null,`راس`,-1),i(`strong`,null,l(R.value?.checkRassDays??`—`)+` روز`,1)]),i(`div`,me,[s[8]||=i(`span`,null,`مجموع چک`,-1),i(`strong`,null,l(a(x)(ze.value)),1)]),i(`div`,he,[s[9]||=i(`span`,null,`مبلغ سفارش`,-1),i(`strong`,null,l(U.value?.totalAmount?a(x)(U.value.totalAmount):`—`),1)])]),i(`div`,ge,[i(`button`,{type:`button`,class:r([`admin-tab`,{active:L.value===`info`}]),onClick:s[0]||=e=>L.value=`info`},` چکها (`+l(z.value.length)+`) `,3),i(`button`,{type:`button`,class:r([`admin-tab`,{active:L.value===`history`}]),onClick:s[1]||=e=>L.value=`history`},` تاریخچه `,2)]),L.value===`info`?(e(),o(d,{key:0},[z.value.length?(e(),o(`div`,ve,[(e(!0),o(d,null,n(z.value,t=>(e(),o(`div`,{key:t.id,class:r([`check-row`,{open:V.value===t.id}])},[i(`button`,{type:`button`,class:`check-row__main`,onClick:e=>Ge(t)},[i(`span`,be,l(V.value===t.id?`▾`:`◂`),1),t.frontImage||t.backImage?(e(),o(`span`,{key:0,class:`check-row__thumb`,onClick:h(e=>H.value=t.frontImage||t.backImage,[`stop`])},[i(`img`,{src:t.frontImage||t.backImage,alt:``},null,8,T)],8,w)):(e(),o(`span`,E,`بدون عکس`)),i(`span`,D,[i(`strong`,null,`چک `+l(t.row),1),i(`small`,null,[u(l(a(x)(t.amount))+` `,1),t.bankName?(e(),o(d,{key:0},[u(` · `+l(t.bankName),1)],64)):m(``,!0),u(` · `+l(a(b)(t.dueDate)),1)])]),c(C,{status:Y(t.status)},null,8,[`status`])],8,ye),i(`div`,{class:`check-row__actions`,onClick:s[2]||=h(()=>{},[`stop`])},[t.status===`pending_review`?(e(),o(d,{key:0},[i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:B.value===t.id,onClick:e=>$(t,`approved`)},` تأیید `,8,O),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:B.value===t.id,onClick:e=>$(t,`rejected`)},` رد `,8,k)],64)):m(``,!0)]),V.value===t.id?(e(),o(`div`,A,[Z(t).length?(e(),o(`div`,j,[(e(!0),o(d,null,n(Z(t),t=>(e(),o(`div`,{key:t.label,class:`check-row__field`},[i(`span`,null,l(t.label),1),i(`strong`,{dir:t.ltr?`ltr`:void 0},l(t.value),9,M)]))),128))])):(e(),o(`p`,N,`جزئیات متنی بیشتری ثبت نشده است.`)),i(`div`,xe,[t.frontImage?(e(),o(`button`,{key:0,type:`button`,class:`check-row__photo`,onClick:e=>H.value=t.frontImage},[i(`img`,{src:t.frontImage,alt:`روی چک`},null,8,Ce),s[10]||=i(`span`,null,`روی`,-1)],8,Se)):m(``,!0),t.backImage?(e(),o(`button`,{key:1,type:`button`,class:`check-row__photo`,onClick:e=>H.value=t.backImage},[i(`img`,{src:t.backImage,alt:`پشت چک`},null,8,Te),s[11]||=i(`span`,null,`پشت`,-1)],8,we)):m(``,!0),!t.frontImage&&!t.backImage?(e(),o(`p`,Ee,` تصویری ثبت نشده. `)):m(``,!0)])])):m(``,!0)],2))),128))])):(e(),o(`div`,_e,` چکی برای این سفارش ثبت نشده است. `)),i(`div`,De,[i(`p`,Oe,[G.value?(e(),o(d,{key:0},[u(` همه چکها تأیید شدهاند. برای ادامه، تأیید نهایی سفارش را ثبت کنید. `)],64)):R.value?.checkRassDate?(e(),o(d,{key:1},[u(` راس: `+l(a(b)(R.value.checkRassDate)),1)],64)):(e(),o(d,{key:2},[u(`راس بر اساس تاریخ ثبت سفارش محاسبه میشود.`)],64))]),i(`div`,ke,[G.value?(e(),o(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--success admin-btn--sm`,disabled:K.value,onClick:qe},l(K.value?`در حال ثبت…`:`تأیید نهایی سفارش`),9,Ae)):m(``,!0),W.value.length?(e(),o(`button`,{key:1,type:`button`,class:`admin-btn admin-btn--success admin-btn--sm`,onClick:Ke},` تأیید همه چکها `)):m(``,!0),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,onClick:He},` بازگشت `)])])],64)):(e(),o(d,{key:1},[!q.value.length&&!J.value.length?(e(),o(`div`,je,` هنوز تاریخچهای ثبت نشده است. `)):(e(),o(`div`,Me,[(e(!0),o(d,null,n(q.value,t=>(e(),o(`article`,{key:t.id,class:`admin-card checks-page__history-item`},[i(`div`,P,[i(`strong`,null,l(t.fromStatus?a(S)(t.fromStatus):`—`)+` → `+l(a(S)(t.toStatus)),1),i(`span`,null,l(X(t.changedAt)),1)]),i(`p`,Ne,`توسط `+l(Ue(t.changedBy)),1),t.note?(e(),o(`p`,Pe,l(t.note),1)):m(``,!0),t.reason?(e(),o(`p`,Fe,`دلیل: `+l(t.reason),1)):m(``,!0)]))),128)),(e(!0),o(d,null,n(J.value,t=>(e(),o(`article`,{key:`note-${t.id}`,class:`admin-card checks-page__history-item`},[i(`div`,Ie,[i(`strong`,null,`یادداشت چک `+l(t.row),1),i(`span`,null,l(X(t.updatedAt)),1)]),c(C,{status:Y(t.status)},null,8,[`status`]),i(`p`,Le,l(t.notes),1)]))),128))]))],64)),(e(),ne(ee,{to:`body`},[H.value?(e(),o(`div`,{key:0,class:`checks-page__lightbox`,onClick:s[4]||=h(e=>H.value=null,[`self`])},[i(`button`,{type:`button`,class:`checks-page__lightbox-close`,onClick:s[3]||=e=>H.value=null},` بستن `),i(`img`,{src:H.value,alt:`پیشنمایش`},null,8,Re)])):m(``,!0)]))]))}}),[[`__scopeId`,`data-v-af5e25db`]]);export{F as default};
\ No newline at end of file
diff --git a/dist/assets/CheckManagementView-Cegsi1VF.js b/dist/assets/CheckManagementView-Cegsi1VF.js
deleted file mode 100644
index cf1473c..0000000
--- a/dist/assets/CheckManagementView-Cegsi1VF.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,Dt as n,E as r,M as i,a as ee,c as a,d as o,g as te,h as s,k as c,l as ne,m as l,r as u,s as d,st as f,t as p,u as m}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as re,m as h,t as g}from"./http-BjLkjdQu.js";import{L as ie,R as ae,S as oe,a as _,g as v,i as y,o as se,w as b,z as x}from"./index-SWzbcuqQ.js";import{s as S}from"./orderStatus-CeC05Cv4.js";import{t as C}from"./StatusBadge-jGFZVW4C.js";var ce={class:`checks-page`},le={class:`admin-page-header`},ue={key:0,class:`checks-page__order-meta`},de={class:`checks-page__stats`},fe={class:`checks-page__stat`},pe={class:`checks-page__stat`},me={class:`checks-page__stat`},he={class:`checks-page__stat`},ge={class:`admin-tabs`},_e={key:0,class:`admin-empty-placeholder admin-card`},ve={key:1,class:`checks-page__list admin-card`},ye=[`onClick`],be={class:`check-row__chevron`,"aria-hidden":`true`},w=[`onClick`],T=[`src`],E={key:1,class:`check-row__thumb check-row__thumb--empty`},D={class:`check-row__meta`},O=[`disabled`,`onClick`],k=[`disabled`,`onClick`],A={key:0,class:`check-row__panel`},j={key:0,class:`check-row__fields`},M=[`dir`],N={key:1,class:`check-row__hint`},xe={class:`check-row__photos`},Se=[`onClick`],Ce=[`src`],we=[`onClick`],Te=[`src`],Ee={key:2,class:`check-row__hint`},De={class:`checks-page__footer`},Oe={class:`checks-page__note`},ke={class:`admin-action-group`},Ae=[`disabled`],je={key:0,class:`admin-empty-placeholder admin-card`},Me={key:1,class:`checks-page__history`},P={class:`checks-page__history-item-head`},Ne={class:`checks-page__history-meta`},Pe={key:0,class:`checks-page__history-note`},Fe={key:1,class:`checks-page__history-note`},Ie={class:`checks-page__history-item-head`},Le={class:`checks-page__history-note`},Re=[`src`],F=p(te({__name:`CheckManagementView`,setup(te){let p=ie(),F=ae(),I=re(),L=e(`info`),R=e(null),z=e([]),B=e(null),V=e(null),H=e(null),U=d(()=>R.value?oe(R.value):null),ze=d(()=>z.value.reduce((e,t)=>e+t.amount,0)),W=d(()=>z.value.filter(e=>e.status===`pending_review`)),Be=d(()=>z.value.length>0&&z.value.every(e=>e.status===`approved`)),G=d(()=>!Be.value||!R.value?!1:(R.value.rawStatus??R.value.status)===`checks_approved`),K=e(!1),q=d(()=>{let e=R.value?.statusHistory??[],t=new Set([`check_in_progress`,`awaiting_check_review`,`check_needs_fix`,`check_rejected`,`checks_approved`]),n=e.filter(e=>t.has(e.toStatus)||e.fromStatus&&t.has(e.fromStatus)||/چک/.test(e.note||``)||/چک/.test(e.reason||``));return[...n.length?n:e].sort((e,t)=>new Date(t.changedAt).getTime()-new Date(e.changedAt).getTime())}),J=d(()=>z.value.filter(e=>e.notes?.trim()).map(e=>({id:e.id,row:e.row,status:e.status,notes:e.notes,updatedAt:e.updatedAt})));async function Ve(){let e=String(p.params.id);try{let[t,n]=await Promise.all([b.get(e),v.listByOrder(e)]);R.value=t,z.value=n,n.length===1&&(V.value=n[0].id)}catch(e){I.error(e instanceof g?e.message:`بارگذاری چکها انجام نشد.`)}}r(()=>{Ve()});function He(){F.push(`/orders`)}function Y(e){return e===`approved`?`check_approved`:e===`rejected`?`check_rejected`:`pending_check_review`}function Ue(e){return e?e===`customer`?`مشتری`:e.startsWith(`admin:`)?`ادمین`:e:`—`}function X(e){return se(e)}function We(e){return[e.ownerFirstName,e.ownerLastName].filter(Boolean).join(` `)}function Z(e){return[{label:`بانک`,value:e.bankName},{label:`شعبه`,value:e.branchName},{label:`شناسه صیادی`,value:e.sayadId,ltr:!0},{label:`شماره چک`,value:e.checkNumber,ltr:!0},{label:`صاحب چک`,value:We(e)},{label:`کد ملی`,value:e.ownerNationalId,ltr:!0},{label:`یادداشت`,value:e.notes}].filter(e=>!!e.value?.trim())}function Ge(e){V.value=V.value===e.id?null:e.id}async function Q(e,t){B.value=e.id;try{let n=await v.updateStatus(e.id,{status:t}),r=z.value.findIndex(t=>t.id===e.id);return r!==-1&&(z.value[r]=n),R.value=await b.get(String(p.params.id)),!0}catch(e){return I.error(e instanceof g?e.message:`بهروزرسانی وضعیت چک انجام نشد.`),!1}finally{B.value=null}}async function $(e,t){if(t!==`approved`&&t!==`rejected`)return;let n=y(e.amount);await x(t===`approved`?{title:`تأیید چک`,message:`آیا از تأیید چک ردیف ${e.row} به مبلغ ${n} مطمئن هستید؟`,tone:`primary`,confirmLabel:`تأیید چک`,cancelLabel:`انصراف`}:{title:`رد چک`,message:`آیا از رد چک ردیف ${e.row} به مبلغ ${n} مطمئن هستید؟`,tone:`danger`,confirmLabel:`رد چک`,cancelLabel:`انصراف`})&&await Q(e,t)&&I.success(t===`approved`?`چک تأیید شد.`:`چک رد شد.`)}async function Ke(){let e=W.value;if(!e.length){I.error(`چکی برای تأیید وجود ندارد.`);return}if(await x({title:`تأیید همه چکها`,message:`آیا از تأیید ${e.length} چک در انتظار بررسی مطمئن هستید؟`,tone:`primary`,confirmLabel:`تأیید همه`,cancelLabel:`انصراف`})){for(let t of e)if(!await Q(t,`approved`))return;I.success(`همه چکهای در انتظار تأیید شدند.`)}}async function qe(){if(!(!R.value||K.value)&&await x({title:`تأیید نهایی سفارش`,message:`با تأیید نهایی، سفارش از مرحله بررسی چک خارج میشود و وارد آمادهسازی میگردد. ادامه میدهید؟`,tone:`primary`,confirmLabel:`تأیید نهایی`,cancelLabel:`انصراف`})){K.value=!0;try{let e=await b.updateStatus(R.value.id,{status:`final_approved`,note:`تأیید نهایی پس از تأیید همه چکها`});R.value=e,I.success(`سفارش تأیید نهایی شد.`)}catch(e){I.error(e instanceof g?e.message:`تأیید نهایی انجام نشد.`)}finally{K.value=!1}}}return(e,r)=>(c(),o(`div`,ce,[a(`div`,le,[r[5]||=a(`div`,null,[a(`h1`,{class:`admin-page-header__title`},`مدیریت چکهای سفارش`)],-1),U.value?(c(),o(`div`,ue,[s(C,{status:U.value.status},null,8,[`status`])])):m(``,!0)]),a(`div`,de,[a(`div`,fe,[r[6]||=a(`span`,null,`تعداد`,-1),a(`strong`,null,t(z.value.length),1)]),a(`div`,pe,[r[7]||=a(`span`,null,`راس`,-1),a(`strong`,null,t(R.value?.checkRassDays??`—`)+` روز`,1)]),a(`div`,me,[r[8]||=a(`span`,null,`مجموع چک`,-1),a(`strong`,null,t(f(y)(ze.value)),1)]),a(`div`,he,[r[9]||=a(`span`,null,`مبلغ سفارش`,-1),a(`strong`,null,t(U.value?.totalAmount?f(y)(U.value.totalAmount):`—`),1)])]),a(`div`,ge,[a(`button`,{type:`button`,class:n([`admin-tab`,{active:L.value===`info`}]),onClick:r[0]||=e=>L.value=`info`},` چکها (`+t(z.value.length)+`) `,3),a(`button`,{type:`button`,class:n([`admin-tab`,{active:L.value===`history`}]),onClick:r[1]||=e=>L.value=`history`},` تاریخچه `,2)]),L.value===`info`?(c(),o(u,{key:0},[z.value.length?(c(),o(`div`,ve,[(c(!0),o(u,null,i(z.value,e=>(c(),o(`div`,{key:e.id,class:n([`check-row`,{open:V.value===e.id}])},[a(`button`,{type:`button`,class:`check-row__main`,onClick:t=>Ge(e)},[a(`span`,be,t(V.value===e.id?`▾`:`◂`),1),e.frontImage||e.backImage?(c(),o(`span`,{key:0,class:`check-row__thumb`,onClick:h(t=>H.value=e.frontImage||e.backImage,[`stop`])},[a(`img`,{src:e.frontImage||e.backImage,alt:``},null,8,T)],8,w)):(c(),o(`span`,E,`بدون عکس`)),a(`span`,D,[a(`strong`,null,`چک `+t(e.row),1),a(`small`,null,[l(t(f(y)(e.amount))+` `,1),e.bankName?(c(),o(u,{key:0},[l(` · `+t(e.bankName),1)],64)):m(``,!0),l(` · `+t(f(_)(e.dueDate)),1)])]),s(C,{status:Y(e.status)},null,8,[`status`])],8,ye),a(`div`,{class:`check-row__actions`,onClick:r[2]||=h(()=>{},[`stop`])},[e.status===`pending_review`?(c(),o(u,{key:0},[a(`button`,{type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:B.value===e.id,onClick:t=>$(e,`approved`)},` تأیید `,8,O),a(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:B.value===e.id,onClick:t=>$(e,`rejected`)},` رد `,8,k)],64)):m(``,!0)]),V.value===e.id?(c(),o(`div`,A,[Z(e).length?(c(),o(`div`,j,[(c(!0),o(u,null,i(Z(e),e=>(c(),o(`div`,{key:e.label,class:`check-row__field`},[a(`span`,null,t(e.label),1),a(`strong`,{dir:e.ltr?`ltr`:void 0},t(e.value),9,M)]))),128))])):(c(),o(`p`,N,`جزئیات متنی بیشتری ثبت نشده است.`)),a(`div`,xe,[e.frontImage?(c(),o(`button`,{key:0,type:`button`,class:`check-row__photo`,onClick:t=>H.value=e.frontImage},[a(`img`,{src:e.frontImage,alt:`روی چک`},null,8,Ce),r[10]||=a(`span`,null,`روی`,-1)],8,Se)):m(``,!0),e.backImage?(c(),o(`button`,{key:1,type:`button`,class:`check-row__photo`,onClick:t=>H.value=e.backImage},[a(`img`,{src:e.backImage,alt:`پشت چک`},null,8,Te),r[11]||=a(`span`,null,`پشت`,-1)],8,we)):m(``,!0),!e.frontImage&&!e.backImage?(c(),o(`p`,Ee,` تصویری ثبت نشده. `)):m(``,!0)])])):m(``,!0)],2))),128))])):(c(),o(`div`,_e,` چکی برای این سفارش ثبت نشده است. `)),a(`div`,De,[a(`p`,Oe,[G.value?(c(),o(u,{key:0},[l(` همه چکها تأیید شدهاند. برای ادامه، تأیید نهایی سفارش را ثبت کنید. `)],64)):R.value?.checkRassDate?(c(),o(u,{key:1},[l(` راس: `+t(f(_)(R.value.checkRassDate)),1)],64)):(c(),o(u,{key:2},[l(`راس بر اساس تاریخ ثبت سفارش محاسبه میشود.`)],64))]),a(`div`,ke,[G.value?(c(),o(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--success admin-btn--sm`,disabled:K.value,onClick:qe},t(K.value?`در حال ثبت…`:`تأیید نهایی سفارش`),9,Ae)):m(``,!0),W.value.length?(c(),o(`button`,{key:1,type:`button`,class:`admin-btn admin-btn--success admin-btn--sm`,onClick:Ke},` تأیید همه چکها `)):m(``,!0),a(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,onClick:He},` بازگشت `)])])],64)):(c(),o(u,{key:1},[!q.value.length&&!J.value.length?(c(),o(`div`,je,` هنوز تاریخچهای ثبت نشده است. `)):(c(),o(`div`,Me,[(c(!0),o(u,null,i(q.value,e=>(c(),o(`article`,{key:e.id,class:`admin-card checks-page__history-item`},[a(`div`,P,[a(`strong`,null,t(e.fromStatus?f(S)(e.fromStatus):`—`)+` → `+t(f(S)(e.toStatus)),1),a(`span`,null,t(X(e.changedAt)),1)]),a(`p`,Ne,`توسط `+t(Ue(e.changedBy)),1),e.note?(c(),o(`p`,Pe,t(e.note),1)):m(``,!0),e.reason?(c(),o(`p`,Fe,`دلیل: `+t(e.reason),1)):m(``,!0)]))),128)),(c(!0),o(u,null,i(J.value,e=>(c(),o(`article`,{key:`note-${e.id}`,class:`admin-card checks-page__history-item`},[a(`div`,Ie,[a(`strong`,null,`یادداشت چک `+t(e.row),1),a(`span`,null,t(X(e.updatedAt)),1)]),s(C,{status:Y(e.status)},null,8,[`status`]),a(`p`,Le,t(e.notes),1)]))),128))]))],64)),(c(),ne(ee,{to:`body`},[H.value?(c(),o(`div`,{key:0,class:`checks-page__lightbox`,onClick:r[4]||=h(e=>H.value=null,[`self`])},[a(`button`,{type:`button`,class:`checks-page__lightbox-close`,onClick:r[3]||=e=>H.value=null},` بستن `),a(`img`,{src:H.value,alt:`پیشنمایش`},null,8,Re)])):m(``,!0)]))]))}}),[[`__scopeId`,`data-v-af5e25db`]]);export{F as default};
\ No newline at end of file
diff --git a/dist/assets/ChecksListView-CCsj1dMX.js b/dist/assets/ChecksListView-CCsj1dMX.js
deleted file mode 100644
index 5272832..0000000
--- a/dist/assets/ChecksListView-CCsj1dMX.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,E as n,M as r,U as ee,c as i,d as a,g as te,h as o,k as s,l as c,r as l,s as u,st as d,t as f,u as p}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as ne,f as m,t as h}from"./http-BjLkjdQu.js";import{I as re,R as ie,g,i as _,o as ae,w as oe}from"./index-SWzbcuqQ.js";import{t as se}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as ce}from"./AdminSelect-6a7SFr9x.js";import{t as v}from"./StatusBadge-jGFZVW4C.js";var le={class:`checks-list-page`},y={class:`admin-page-header`},b={class:`checks-list-page__summary`},x={key:0},S={class:`checks-list-page__filters admin-card`},C={class:`checks-list-page__search`},w={class:`checks-list-page__table admin-card desktop-only`},T={class:`admin-table-wrap`},E={class:`admin-table`},D=[`onClick`],O={dir:`ltr`},k={class:`admin-action-group`},A=[`disabled`,`onClick`],j=[`disabled`,`onClick`],M=[`onClick`],N={key:0,class:`checks-list-page__empty`},P={class:`compact-only admin-card-list`},ue={class:`admin-card-item__header`},F={class:`admin-card-item__title`},I={class:`admin-card-item__meta`},L={key:0},R={class:`admin-card-item__actions`},z=[`disabled`,`onClick`],B=[`disabled`,`onClick`],V=[`onClick`],H={key:0,class:`checks-list-page__empty`},U=f(te({__name:`ChecksListView`,setup(te){let f=ie(),U=ne(),W=e([]),G=e(!0),K=e(``),q=e(`all`),J=e(null),de=[{value:`all`,label:`همه وضعیتها`},{value:`pending_review`,label:`در انتظار بررسی`},{value:`approved`,label:`تأیید شده`},{value:`rejected`,label:`رد شده`}],Y=u(()=>{let e=W.value;q.value!==`all`&&(e=e.filter(e=>e.status===q.value));let t=K.value.trim();return t&&(e=e.filter(e=>(e.orderNumber??``).includes(t)||(e.customerName??``).includes(t)||(e.bankName??``).includes(t)||(e.sayadId??``).includes(t))),e}),X=u(()=>W.value.filter(e=>e.status===`pending_review`).length);function Z(e){return e===`approved`?`final_approval`:e===`rejected`?`needs_correction`:`pending_check_review`}async function fe(){let e=await oe.list();W.value=e.flatMap(e=>(e.checks??[]).map(t=>({...t,orderNumber:e.orderNumber,customerName:e.customerName,orderStatus:e.status,settlementType:e.settlementMethod??e.settlementType??null})))}async function pe(){G.value=!0;try{W.value=await g.list()}catch{try{await fe()}catch(e){U.error(e instanceof h?e.message:`بارگذاری چکها انجام نشد.`)}}finally{G.value=!1}}n(()=>{pe()});function Q(e){f.push(`/orders/${e.orderId}/checks`)}async function $(e,t){J.value=e.id;try{let n=await g.updateStatus(e.id,{status:t}),r=W.value.findIndex(t=>t.id===e.id);r!==-1&&(W.value[r]={...W.value[r],...n,orderNumber:e.orderNumber,customerName:e.customerName,orderStatus:e.orderStatus,settlementType:e.settlementType}),U.success(t===`approved`?`چک تأیید شد.`:`چک رد شد.`)}catch(e){U.error(e instanceof h?e.message:`بهروزرسانی وضعیت چک انجام نشد.`)}finally{J.value=null}}return(e,n)=>(s(),a(`div`,le,[i(`div`,y,[n[2]||=i(`div`,null,[i(`h1`,{class:`admin-page-header__title`},`چکها`)],-1),i(`div`,b,[i(`span`,null,t(W.value.length)+` چک`,1),X.value?(s(),a(`span`,x,t(X.value)+` در انتظار بررسی`,1)):p(``,!0)])]),i(`div`,S,[i(`div`,C,[o(re,{name:`search`,size:18}),ee(i(`input`,{"onUpdate:modelValue":n[0]||=e=>K.value=e,type:`search`,class:`checks-list-page__search-input`,placeholder:`جستجو در شماره سفارش، مشتری، بانک، صیاد...`},null,512),[[m,K.value]])]),o(ce,{modelValue:q.value,"onUpdate:modelValue":n[1]||=e=>q.value=e,class:`checks-list-page__status-select`,"aria-label":`فیلتر وضعیت چک`,options:de},null,8,[`modelValue`])]),G.value?(s(),c(se,{key:0,variant:`table`})):(s(),a(l,{key:1},[i(`div`,w,[i(`div`,T,[i(`table`,E,[n[3]||=i(`thead`,null,[i(`tr`,null,[i(`th`,null,`شماره سفارش`),i(`th`,null,`مشتری`),i(`th`,null,`ردیف`),i(`th`,null,`مبلغ`),i(`th`,null,`بانک`),i(`th`,null,`شناسه صیادی`),i(`th`,null,`سررسید`),i(`th`,null,`وضعیت`),i(`th`,null,`عملیات`)])],-1),i(`tbody`,null,[(s(!0),a(l,null,r(Y.value,e=>(s(),a(`tr`,{key:e.id},[i(`td`,null,[i(`button`,{type:`button`,class:`checks-list-page__order-link`,onClick:t=>Q(e)},t(e.orderNumber||e.orderId),9,D)]),i(`td`,null,t(e.customerName||`—`),1),i(`td`,null,t(e.row),1),i(`td`,null,t(d(_)(e.amount)),1),i(`td`,null,t(e.bankName||`—`),1),i(`td`,O,t(e.sayadId||`—`),1),i(`td`,null,t(e.dueDate.slice(0,10)),1),i(`td`,null,[o(v,{status:Z(e.status)},null,8,[`status`])]),i(`td`,null,[i(`div`,k,[e.status===`pending_review`?(s(),a(l,{key:0},[i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:J.value===e.id,onClick:t=>$(e,`approved`)},` تأیید `,8,A),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:J.value===e.id,onClick:t=>$(e,`rejected`)},` رد `,8,j)],64)):p(``,!0),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:t=>Q(e)},` جزئیات سفارش `,8,M)])])]))),128))])])]),Y.value.length?p(``,!0):(s(),a(`p`,N,` چکی با این فیلتر یافت نشد. `))]),i(`div`,P,[(s(!0),a(l,null,r(Y.value,e=>(s(),a(`article`,{key:e.id,class:`admin-card-item`},[i(`div`,ue,[i(`p`,F,t(e.orderNumber||e.orderId)+` — چک `+t(e.row),1),o(v,{status:Z(e.status)},null,8,[`status`])]),i(`div`,I,[i(`span`,null,t(e.customerName||`—`),1),i(`span`,null,t(d(_)(e.amount)),1),i(`span`,null,t(e.bankName||`—`),1),i(`span`,null,`سررسید `+t(e.dueDate.slice(0,10)),1),e.createdAt?(s(),a(`span`,L,`ثبت `+t(d(ae)(e.createdAt)),1)):p(``,!0)]),i(`div`,R,[e.status===`pending_review`?(s(),a(l,{key:0},[i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:J.value===e.id,onClick:t=>$(e,`approved`)},` تأیید `,8,z),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:J.value===e.id,onClick:t=>$(e,`rejected`)},` رد `,8,B)],64)):p(``,!0),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:t=>Q(e)},` جزئیات سفارش `,8,V)])]))),128)),Y.value.length?p(``,!0):(s(),a(`p`,H,` چکی با این فیلتر یافت نشد. `))])],64))]))}}),[[`__scopeId`,`data-v-09633f1f`]]);export{U as default};
\ No newline at end of file
diff --git a/dist/assets/ChecksListView-DVHaL7qi.js b/dist/assets/ChecksListView-DVHaL7qi.js
new file mode 100644
index 0000000..27c196e
--- /dev/null
+++ b/dist/assets/ChecksListView-DVHaL7qi.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,W as r,c as i,ct as a,d as o,et as s,g as c,h as l,jt as u,l as d,r as f,s as p,t as m,u as h}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as ee,d as te,t as g}from"./http-CTjL79ty.js";import{L as ne,T as re,_,i as v,o as y,z as ie}from"./index-DxcN1-hp.js";import{t as ae}from"./AdminPageSkeleton-DacAHji8.js";import{t as oe}from"./AdminSelect-BYntBSYd.js";import{t as b}from"./StatusBadge-BkaoX2rz.js";var se={class:`checks-list-page`},ce={class:`admin-page-header`},le={class:`checks-list-page__summary`},x={key:0},S={class:`checks-list-page__filters admin-card`},C={class:`checks-list-page__search`},w={class:`checks-list-page__table admin-card desktop-only`},T={class:`admin-table-wrap`},E={class:`admin-table`},D=[`onClick`],O={dir:`ltr`},k={class:`admin-action-group`},A=[`disabled`,`onClick`],j=[`disabled`,`onClick`],M=[`onClick`],N={key:0,class:`checks-list-page__empty`},P={class:`compact-only admin-card-list`},F={class:`admin-card-item__header`},ue={class:`admin-card-item__title`},I={class:`admin-card-item__meta`},L={key:0},R={class:`admin-card-item__actions`},z=[`disabled`,`onClick`],B=[`disabled`,`onClick`],V=[`onClick`],H={key:0,class:`checks-list-page__empty`},U=m(c({__name:`ChecksListView`,setup(c){let m=ie(),U=ee(),W=s([]),G=s(!0),K=s(``),q=s(`all`),J=s(null),de=[{value:`all`,label:`همه وضعیتها`},{value:`pending_review`,label:`در انتظار بررسی`},{value:`approved`,label:`تأیید شده`},{value:`rejected`,label:`رد شده`}],Y=p(()=>{let e=W.value;q.value!==`all`&&(e=e.filter(e=>e.status===q.value));let t=K.value.trim();return t&&(e=e.filter(e=>(e.orderNumber??``).includes(t)||(e.customerName??``).includes(t)||(e.bankName??``).includes(t)||(e.sayadId??``).includes(t))),e}),X=p(()=>W.value.filter(e=>e.status===`pending_review`).length);function Z(e){return e===`approved`?`final_approval`:e===`rejected`?`needs_correction`:`pending_check_review`}async function fe(){let e=await re.list();W.value=e.flatMap(e=>(e.checks??[]).map(t=>({...t,orderNumber:e.orderNumber,customerName:e.customerName,orderStatus:e.status,settlementType:e.settlementMethod??e.settlementType??null})))}async function pe(){G.value=!0;try{W.value=await _.list()}catch{try{await fe()}catch(e){U.error(e instanceof g?e.message:`بارگذاری چکها انجام نشد.`)}}finally{G.value=!1}}t(()=>{pe()});function Q(e){m.push(`/orders/${e.orderId}/checks`)}async function $(e,t){J.value=e.id;try{let n=await _.updateStatus(e.id,{status:t}),r=W.value.findIndex(t=>t.id===e.id);r!==-1&&(W.value[r]={...W.value[r],...n,orderNumber:e.orderNumber,customerName:e.customerName,orderStatus:e.orderStatus,settlementType:e.settlementType}),U.success(t===`approved`?`چک تأیید شد.`:`چک رد شد.`)}catch(e){U.error(e instanceof g?e.message:`بهروزرسانی وضعیت چک انجام نشد.`)}finally{J.value=null}}return(t,s)=>(e(),o(`div`,se,[i(`div`,ce,[s[2]||=i(`div`,null,[i(`h1`,{class:`admin-page-header__title`},`چکها`)],-1),i(`div`,le,[i(`span`,null,u(W.value.length)+` چک`,1),X.value?(e(),o(`span`,x,u(X.value)+` در انتظار بررسی`,1)):h(``,!0)])]),i(`div`,S,[i(`div`,C,[l(ne,{name:`search`,size:18}),r(i(`input`,{"onUpdate:modelValue":s[0]||=e=>K.value=e,type:`search`,class:`checks-list-page__search-input`,placeholder:`جستجو در شماره سفارش، مشتری، بانک، صیاد...`},null,512),[[te,K.value]])]),l(oe,{modelValue:q.value,"onUpdate:modelValue":s[1]||=e=>q.value=e,class:`checks-list-page__status-select`,"aria-label":`فیلتر وضعیت چک`,options:de},null,8,[`modelValue`])]),G.value?(e(),d(ae,{key:0,variant:`table`})):(e(),o(f,{key:1},[i(`div`,w,[i(`div`,T,[i(`table`,E,[s[3]||=i(`thead`,null,[i(`tr`,null,[i(`th`,null,`شماره سفارش`),i(`th`,null,`مشتری`),i(`th`,null,`ردیف`),i(`th`,null,`مبلغ`),i(`th`,null,`بانک`),i(`th`,null,`شناسه صیادی`),i(`th`,null,`سررسید`),i(`th`,null,`وضعیت`),i(`th`,null,`عملیات`)])],-1),i(`tbody`,null,[(e(!0),o(f,null,n(Y.value,t=>(e(),o(`tr`,{key:t.id},[i(`td`,null,[i(`button`,{type:`button`,class:`checks-list-page__order-link`,onClick:e=>Q(t)},u(t.orderNumber||t.orderId),9,D)]),i(`td`,null,u(t.customerName||`—`),1),i(`td`,null,u(t.row),1),i(`td`,null,u(a(v)(t.amount)),1),i(`td`,null,u(t.bankName||`—`),1),i(`td`,O,u(t.sayadId||`—`),1),i(`td`,null,u(t.dueDate.slice(0,10)),1),i(`td`,null,[l(b,{status:Z(t.status)},null,8,[`status`])]),i(`td`,null,[i(`div`,k,[t.status===`pending_review`?(e(),o(f,{key:0},[i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:J.value===t.id,onClick:e=>$(t,`approved`)},` تأیید `,8,A),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:J.value===t.id,onClick:e=>$(t,`rejected`)},` رد `,8,j)],64)):h(``,!0),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:e=>Q(t)},` جزئیات سفارش `,8,M)])])]))),128))])])]),Y.value.length?h(``,!0):(e(),o(`p`,N,` چکی با این فیلتر یافت نشد. `))]),i(`div`,P,[(e(!0),o(f,null,n(Y.value,t=>(e(),o(`article`,{key:t.id,class:`admin-card-item`},[i(`div`,F,[i(`p`,ue,u(t.orderNumber||t.orderId)+` — چک `+u(t.row),1),l(b,{status:Z(t.status)},null,8,[`status`])]),i(`div`,I,[i(`span`,null,u(t.customerName||`—`),1),i(`span`,null,u(a(v)(t.amount)),1),i(`span`,null,u(t.bankName||`—`),1),i(`span`,null,`سررسید `+u(t.dueDate.slice(0,10)),1),t.createdAt?(e(),o(`span`,L,`ثبت `+u(a(y)(t.createdAt)),1)):h(``,!0)]),i(`div`,R,[t.status===`pending_review`?(e(),o(f,{key:0},[i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-success admin-btn--xs`,disabled:J.value===t.id,onClick:e=>$(t,`approved`)},` تأیید `,8,z),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,disabled:J.value===t.id,onClick:e=>$(t,`rejected`)},` رد `,8,B)],64)):h(``,!0),i(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:e=>Q(t)},` جزئیات سفارش `,8,V)])]))),128)),Y.value.length?h(``,!0):(e(),o(`p`,H,` چکی با این فیلتر یافت نشد. `))])],64))]))}}),[[`__scopeId`,`data-v-09633f1f`]]);export{U as default};
\ No newline at end of file
diff --git a/dist/assets/CompaniesView-BubE_GYW.css b/dist/assets/CompaniesView-BPiVj2Wz.css
similarity index 52%
rename from dist/assets/CompaniesView-BubE_GYW.css
rename to dist/assets/CompaniesView-BPiVj2Wz.css
index 540d9a8..96a6942 100644
--- a/dist/assets/CompaniesView-BubE_GYW.css
+++ b/dist/assets/CompaniesView-BPiVj2Wz.css
@@ -1 +1 @@
-.companies-page__table[data-v-b4857c22]{overflow:hidden}.companies-page__card-logo[data-v-b4857c22]{align-items:center;gap:12px;display:flex}.companies-page__card-desc[data-v-b4857c22]{color:var(--color-text-muted);margin:4px 0 0;font-size:.8125rem;font-weight:400}.company-logo[data-v-b4857c22]{border-radius:var(--radius-sm);object-fit:contain;background:var(--color-bg);border:1px solid var(--color-border);width:40px;height:40px}.company-logo--fallback[data-v-b4857c22]{background:var(--color-primary);color:#fff;justify-content:center;align-items:center;font-size:1rem;font-weight:700;display:flex}.logo-upload[data-v-b4857c22]{flex-direction:column;gap:10px;display:flex}.logo-upload__input[data-v-b4857c22]{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.logo-upload__dropzone[data-v-b4857c22]{border:2px dashed var(--color-border);border-radius:var(--radius-md);background:var(--color-border-light);cursor:pointer;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:28px 16px;transition:border-color .15s,background .15s;display:flex}.logo-upload__dropzone[data-v-b4857c22]:hover{border-color:var(--color-primary);background:var(--color-info-light)}.logo-upload__icon[data-v-b4857c22]{background:var(--color-surface);border:1px solid var(--color-border);width:40px;height:40px;color:var(--color-text-muted);border-radius:50%;justify-content:center;align-items:center;font-size:1.5rem;line-height:1;display:flex}.logo-upload__text[data-v-b4857c22]{color:var(--color-text);font-size:.875rem;font-weight:600}.logo-upload__hint[data-v-b4857c22]{color:var(--color-text-muted);font-size:.75rem}.logo-upload__preview-wrap[data-v-b4857c22]{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-border-light);flex-direction:column;align-items:center;gap:10px;padding:16px;display:flex}.logo-upload__preview[data-v-b4857c22]{object-fit:contain;border-radius:var(--radius-sm);background:var(--color-surface);border:1px solid var(--color-border);width:80px;height:80px}.logo-upload__remove[data-v-b4857c22]{color:var(--color-danger);cursor:pointer;background:0 0;border:none;padding:0;font-size:.8125rem;font-weight:600}.logo-upload__remove[data-v-b4857c22]:hover{text-decoration:underline}.logo-upload__change[data-v-b4857c22]{align-self:flex-start}
+.companies-page__table[data-v-189e4d8e]{overflow:hidden}.companies-page__card-logo[data-v-189e4d8e]{align-items:center;gap:12px;display:flex}.companies-page__card-desc[data-v-189e4d8e]{color:var(--color-text-muted);margin:4px 0 0;font-size:.8125rem;font-weight:400}.company-logo[data-v-189e4d8e]{border-radius:var(--radius-sm);object-fit:contain;background:var(--color-bg);border:1px solid var(--color-border);width:40px;height:40px}.company-logo--fallback[data-v-189e4d8e]{background:var(--color-primary);color:#fff;justify-content:center;align-items:center;font-size:1rem;font-weight:700;display:flex}.logo-upload[data-v-189e4d8e]{flex-direction:column;gap:10px;display:flex}.logo-upload__input[data-v-189e4d8e]{opacity:0;pointer-events:none;width:1px;height:1px;position:absolute}.logo-upload__dropzone[data-v-189e4d8e]{border:2px dashed var(--color-border);border-radius:var(--radius-md);background:var(--color-border-light);cursor:pointer;flex-direction:column;justify-content:center;align-items:center;gap:8px;padding:28px 16px;transition:border-color .15s,background .15s;display:flex}.logo-upload__dropzone[data-v-189e4d8e]:hover{border-color:var(--color-primary);background:var(--color-info-light)}.logo-upload__icon[data-v-189e4d8e]{background:var(--color-surface);border:1px solid var(--color-border);width:40px;height:40px;color:var(--color-text-muted);border-radius:50%;justify-content:center;align-items:center;font-size:1.5rem;line-height:1;display:flex}.logo-upload__text[data-v-189e4d8e]{color:var(--color-text);font-size:.875rem;font-weight:600}.logo-upload__hint[data-v-189e4d8e]{color:var(--color-text-muted);font-size:.75rem}.logo-upload__preview-wrap[data-v-189e4d8e]{border:1px solid var(--color-border);border-radius:var(--radius-md);background:var(--color-border-light);flex-direction:column;align-items:center;gap:10px;padding:16px;display:flex}.logo-upload__preview[data-v-189e4d8e]{object-fit:contain;border-radius:var(--radius-sm);background:var(--color-surface);border:1px solid var(--color-border);width:80px;height:80px}.logo-upload__remove[data-v-189e4d8e]{color:var(--color-danger);cursor:pointer;background:0 0;border:none;padding:0;font-size:.8125rem;font-weight:600}.logo-upload__remove[data-v-189e4d8e]:hover{text-decoration:underline}.logo-upload__change[data-v-189e4d8e]{align-self:flex-start}
diff --git a/dist/assets/CompaniesView-BoVnVogS.js b/dist/assets/CompaniesView-BoVnVogS.js
new file mode 100644
index 0000000..2a92020
--- /dev/null
+++ b/dist/assets/CompaniesView-BoVnVogS.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,Q as r,U as i,W as a,c as o,d as s,et as c,g as ee,h as l,jt as u,l as d,m as f,r as p,s as m,t as h,u as g}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as te,d as _,m as ne,t as v}from"./http-CTjL79ty.js";import{B as re,V as ie,k as ae,v as y,z as oe}from"./index-DxcN1-hp.js";import{t as se}from"./AdminPageSkeleton-DacAHji8.js";import{t as ce}from"./BaseSwitch-Dz4ODUhf.js";import{t as le}from"./BaseEmptyState-BAIuUvAl.js";import{t as b}from"./ActiveSwitchCell-4PQpvsIu.js";var ue={class:`companies-page`},de={key:2,class:`companies-page__table admin-card desktop-only`},fe={class:`admin-table-wrap`},pe={class:`admin-table`},me=[`src`,`alt`],he={key:1,class:`company-logo company-logo--fallback`},ge={class:`numeric`},_e={class:`status`},ve={class:`actions`},ye={class:`admin-action-group`},be=[`onClick`],xe=[`onClick`],x={key:3,class:`compact-only admin-card-list`},S={class:`admin-card-item__header`},C={class:`companies-page__card-logo`},w=[`src`,`alt`],T={key:1,class:`company-logo company-logo--fallback`},E={class:`admin-card-item__title`},D={class:`companies-page__card-desc`},O={class:`admin-card-item__meta`},k={class:`admin-card-item__actions`},A=[`onClick`],j=[`onClick`],M={key:0,class:`admin-form__error`,role:`alert`},Se={class:`admin-form__field`},Ce={class:`logo-upload`},we={key:0,class:`logo-upload__preview-wrap`},Te=[`src`],Ee={key:1,class:`logo-upload__dropzone`,for:`company-logo-file`},De={class:`admin-form__field`},Oe={class:`admin-form__field`},ke={class:`admin-form__row`},Ae={class:`admin-form__field`},N={class:`admin-form__field`},je=[`disabled`],Me=2097152,P=h(ee({__name:`CompaniesView`,setup(ee){let h=[`image/png`,`image/jpeg`,`image/webp`,`image/svg+xml`],P=oe(),F=te(),I=c([]),L=c(!0),R=c(null),z=c(null),B=c(null),V=c(null),H=c(!1);async function Ne(){L.value=!0;try{I.value=await y.list()}catch(e){F.error(e instanceof v?e.message:`بارگذاری شرکتها انجام نشد.`)}finally{L.value=!1}}t(()=>{Ne()});let U=()=>({name:``,description:``,displayOrder:I.value.length+1,isActive:!0}),W=r(U()),G=c(``),Pe=m(()=>R.value!==null),Fe=m(()=>R.value===`edit`?`ویرایش شرکت`:`افزودن شرکت`),Ie=m(()=>R.value===`edit`?`ثبت تغییرات`:`ثبت شرکت`),Le=m(()=>W.name.trim().length>0&&B.value!==null);function K(){B.value=null,V.value&&(V.value.value=``)}function q(){R.value=`add`,z.value=null,Object.assign(W,U()),K(),G.value=``}function J(e){R.value=`edit`,z.value=e.id,W.name=e.name,W.description=e.description===`—`?``:e.description,W.displayOrder=e.displayOrder,W.isActive=e.isActive,B.value=e.logoUrl,V.value&&(V.value.value=``),G.value=``}function Y(){R.value=null,z.value=null,G.value=``,K()}function Re(e){let t=e.target.files?.[0];if(!t)return;if(!h.includes(t.type)){G.value=`فرمت مجاز: PNG، JPG، WEBP یا SVG`;return}if(t.size>Me){G.value=`حداکثر حجم تصویر ۲ مگابایت است.`;return}G.value=``;let n=new FileReader;n.onload=()=>{B.value=n.result},n.readAsDataURL(t)}async function ze(){B.value&&await re({title:`حذف تصویر`,message:`آیا از حذف لوگوی شرکت مطمئن هستید؟`,confirmLabel:`حذف`,cancelLabel:`انصراف`,tone:`danger`})&&K()}async function X(){let e=W.name.trim();if(!e){G.value=`نام شرکت الزامی است.`;return}if(!B.value){G.value=`آپلود لوگو الزامی است.`;return}if(I.value.some(t=>t.name===e&&t.id!==z.value)){G.value=`شرکتی با این نام قبلاً ثبت شده است.`;return}H.value=!0;try{if(R.value===`edit`&&z.value){let t=await y.update(z.value,{name:e,description:W.description.trim()||void 0,displayOrder:Number(W.displayOrder)||1,isActive:W.isActive,logoUrl:B.value}),n=I.value.findIndex(e=>e.id===z.value);n!==-1&&(I.value[n]={...I.value[n],...t}),F.success(`اطلاعات شرکت بهروزرسانی شد.`)}else{let t=await y.create({name:e,slug:ae(e),description:W.description.trim()||void 0,displayOrder:Number(W.displayOrder)||I.value.length+1,isActive:W.isActive,logoUrl:B.value});I.value.push(t),F.success(`شرکت جدید ثبت شد.`)}Y()}catch(e){F.error(e instanceof v?e.message:`ذخیره شرکت انجام نشد.`)}finally{H.value=!1}}async function Z(e,t){await y.setActive(e,t)}function Q(e){P.push(`/companies/${e}/accounts`)}function $(e){return e.trim().charAt(0)||`؟`}return(t,r)=>(e(),s(`div`,ue,[o(`div`,{class:`admin-page-header`},[r[5]||=o(`div`,null,[o(`h1`,{class:`admin-page-header__title`},`مدیریت شرکتها`)],-1),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:q},` افزودن شرکت `)]),L.value?(e(),d(se,{key:0,variant:`table`})):I.value.length?(e(),s(`div`,de,[o(`div`,fe,[o(`table`,pe,[r[6]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`لوگو`),o(`th`,{class:`numeric`},`ترتیب`),o(`th`,{class:`status`},`وضعیت`),o(`th`,null,`توضیحات`),o(`th`,null,`نام شرکت`),o(`th`,{class:`actions`},`عملیات`)])],-1),o(`tbody`,null,[(e(!0),s(p,null,n(I.value,t=>(e(),s(`tr`,{key:t.id},[o(`td`,null,[t.logoUrl?(e(),s(`img`,{key:0,src:t.logoUrl,alt:`لوگوی ${t.name}`,class:`company-logo`},null,8,me)):(e(),s(`div`,he,u($(t.name)),1))]),o(`td`,ge,u(t.displayOrder),1),o(`td`,_e,[l(b,{id:t.id,modelValue:t.isActive,"onUpdate:modelValue":e=>t.isActive=e,"entity-name":t.name,"entity-type":`شرکت`,persist:Z},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])]),o(`td`,null,u(t.description),1),o(`td`,null,u(t.name),1),o(`td`,ve,[o(`div`,ye,[o(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:e=>J(t)},` ویرایش `,8,be),t.isPaymentRecipient||t.slug===`nademitex`?(e(),s(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:e=>Q(t.id)},` حسابهای پرداخت `,8,xe)):g(``,!0)])])]))),128))])])])])):(e(),d(le,{key:1,class:`admin-card`,icon:`companies`,title:`شرکتی ثبت نشده`,description:`برای شروع، اولین شرکت را ثبت کنید.`},{default:i(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:q},` افزودن شرکت `)]),_:1})),!L.value&&I.value.length?(e(),s(`div`,x,[(e(!0),s(p,null,n(I.value,t=>(e(),s(`article`,{key:t.id,class:`admin-card-item`},[o(`div`,S,[o(`div`,C,[t.logoUrl?(e(),s(`img`,{key:0,src:t.logoUrl,alt:`لوگوی ${t.name}`,class:`company-logo`},null,8,w)):(e(),s(`div`,T,u($(t.name)),1)),o(`div`,null,[o(`p`,E,u(t.name),1),o(`p`,D,u(t.description),1)])]),l(b,{id:t.id,modelValue:t.isActive,"onUpdate:modelValue":e=>t.isActive=e,"entity-name":t.name,"entity-type":`شرکت`,persist:Z},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])]),o(`div`,O,[o(`span`,null,`ترتیب: `+u(t.displayOrder),1)]),o(`div`,k,[o(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:e=>J(t)},` ویرایش `,8,A),t.isPaymentRecipient||t.slug===`nademitex`?(e(),s(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:e=>Q(t.id)},` حسابهای پرداخت `,8,j)):g(``,!0)])]))),128))])):g(``,!0),l(ie,{open:Pe.value,title:Fe.value,onClose:Y},{footer:i(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:Y},` انصراف `),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!Le.value||H.value,onClick:X},u(Ie.value),9,je)]),default:i(()=>[o(`form`,{class:`admin-form`,onSubmit:ne(X,[`prevent`])},[G.value?(e(),s(`p`,M,u(G.value),1)):g(``,!0),o(`div`,Se,[r[8]||=o(`label`,null,[f(`لوگو `),o(`span`,{class:`admin-form__required`},`*`)],-1),o(`div`,Ce,[B.value?(e(),s(`div`,we,[o(`img`,{src:B.value,alt:`پیشنمایش لوگو`,class:`logo-upload__preview`},null,8,Te),o(`button`,{type:`button`,class:`logo-upload__remove`,onClick:ze},` حذف تصویر `)])):(e(),s(`label`,Ee,[...r[7]||=[o(`span`,{class:`logo-upload__icon`},`+`,-1),o(`span`,{class:`logo-upload__text`},`انتخاب یا رها کردن تصویر لوگو`,-1),o(`span`,{class:`logo-upload__hint`},`PNG، JPG، WEBP یا SVG — حداکثر ۲ مگابایت`,-1)]])),o(`input`,{id:`company-logo-file`,ref_key:`logoInputRef`,ref:V,type:`file`,accept:`image/png,image/jpeg,image/webp,image/svg+xml`,class:`logo-upload__input`,onChange:Re},null,544),B.value?(e(),s(`button`,{key:2,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm logo-upload__change`,onClick:r[0]||=e=>V.value?.click()},` تغییر تصویر `)):g(``,!0)])]),o(`div`,De,[r[9]||=o(`label`,{for:`company-name`},[f(`نام شرکت `),o(`span`,{class:`admin-form__required`},`*`)],-1),a(o(`input`,{id:`company-name`,"onUpdate:modelValue":r[1]||=e=>W.name=e,type:`text`,class:`admin-input`,placeholder:`مثال: شرکت پَر`,autocomplete:`off`},null,512),[[_,W.name]])]),o(`div`,Oe,[r[10]||=o(`label`,{for:`company-description`},`توضیحات`,-1),a(o(`textarea`,{id:`company-description`,"onUpdate:modelValue":r[2]||=e=>W.description=e,class:`admin-form__textarea`,placeholder:`تولید و عرضه انواع پارچه`,rows:`3`},null,512),[[_,W.description]])]),o(`div`,ke,[o(`div`,Ae,[r[11]||=o(`label`,{for:`company-order`},`ترتیب نمایش`,-1),a(o(`input`,{id:`company-order`,"onUpdate:modelValue":r[3]||=e=>W.displayOrder=e,type:`number`,min:`1`,class:`admin-input`},null,512),[[_,W.displayOrder,void 0,{number:!0}]])]),o(`div`,N,[l(ce,{modelValue:W.isActive,"onUpdate:modelValue":r[4]||=e=>W.isActive=e,label:`وضعیت`},null,8,[`modelValue`])])])],32)]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-189e4d8e`]]);export{P as default};
\ No newline at end of file
diff --git a/dist/assets/CompaniesView-C54y7vWA.js b/dist/assets/CompaniesView-C54y7vWA.js
deleted file mode 100644
index de37615..0000000
--- a/dist/assets/CompaniesView-C54y7vWA.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,E as n,H as r,M as i,U as a,Z as ee,c as o,d as s,g as te,h as c,k as l,l as u,m as d,r as f,s as p,t as m,u as h}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as ne,f as g,m as re,t as _}from"./http-BjLkjdQu.js";import{B as ie,O as ae,R as oe,_ as v,z as se}from"./index-SWzbcuqQ.js";import{t as ce}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as le}from"./BaseSwitch-pJwnFBVo.js";import{t as ue}from"./BaseEmptyState-Bzvl_pTa.js";import{t as y}from"./ActiveSwitchCell-DIBIZfO9.js";var de={class:`companies-page`},fe={key:2,class:`companies-page__table admin-card desktop-only`},pe={class:`admin-table-wrap`},me={class:`admin-table`},he=[`src`,`alt`],ge={key:1,class:`company-logo company-logo--fallback`},_e={class:`numeric`},ve={class:`status`},ye={class:`actions`},be={class:`admin-action-group`},xe=[`onClick`],b=[`onClick`],x={key:3,class:`compact-only admin-card-list`},S={class:`admin-card-item__header`},C={class:`companies-page__card-logo`},w=[`src`,`alt`],T={key:1,class:`company-logo company-logo--fallback`},E={class:`admin-card-item__title`},D={class:`companies-page__card-desc`},O={class:`admin-card-item__meta`},k={class:`admin-card-item__actions`},A=[`onClick`],j=[`onClick`],M={key:0,class:`admin-form__error`,role:`alert`},Se={class:`admin-form__field`},Ce={class:`logo-upload`},we={key:0,class:`logo-upload__preview-wrap`},Te=[`src`],Ee={key:1,class:`logo-upload__dropzone`,for:`company-logo-file`},De={class:`admin-form__field`},Oe={class:`admin-form__field`},N={class:`admin-form__row`},ke={class:`admin-form__field`},Ae={class:`admin-form__field`},je=[`disabled`],Me=2097152,P=m(te({__name:`CompaniesView`,setup(te){let m=[`image/png`,`image/jpeg`,`image/webp`,`image/svg+xml`],P=oe(),F=ne(),I=e([]),L=e(!0),R=e(null),z=e(null),B=e(null),V=e(null),H=e(!1);async function Ne(){L.value=!0;try{I.value=await v.list()}catch(e){F.error(e instanceof _?e.message:`بارگذاری شرکتها انجام نشد.`)}finally{L.value=!1}}n(()=>{Ne()});let U=()=>({name:``,description:``,displayOrder:I.value.length+1,isActive:!0}),W=ee(U()),G=e(``),Pe=p(()=>R.value!==null),Fe=p(()=>R.value===`edit`?`ویرایش شرکت`:`افزودن شرکت`),Ie=p(()=>R.value===`edit`?`ذخیره تغییرات`:`ثبت شرکت`),Le=p(()=>W.name.trim().length>0&&B.value!==null);function K(){B.value=null,V.value&&(V.value.value=``)}function q(){R.value=`add`,z.value=null,Object.assign(W,U()),K(),G.value=``}function J(e){R.value=`edit`,z.value=e.id,W.name=e.name,W.description=e.description===`—`?``:e.description,W.displayOrder=e.displayOrder,W.isActive=e.isActive,B.value=e.logoUrl,V.value&&(V.value.value=``),G.value=``}function Y(){R.value=null,z.value=null,G.value=``,K()}function Re(e){let t=e.target.files?.[0];if(!t)return;if(!m.includes(t.type)){G.value=`فرمت مجاز: PNG، JPG، WEBP یا SVG`;return}if(t.size>Me){G.value=`حداکثر حجم تصویر ۲ مگابایت است.`;return}G.value=``;let n=new FileReader;n.onload=()=>{B.value=n.result},n.readAsDataURL(t)}async function ze(){B.value&&await se({title:`حذف تصویر`,message:`آیا از حذف لوگوی شرکت مطمئن هستید؟`,confirmLabel:`حذف`,cancelLabel:`انصراف`,tone:`danger`})&&K()}async function X(){let e=W.name.trim();if(!e){G.value=`نام شرکت الزامی است.`;return}if(!B.value){G.value=`آپلود لوگو الزامی است.`;return}if(I.value.some(t=>t.name===e&&t.id!==z.value)){G.value=`شرکتی با این نام قبلاً ثبت شده است.`;return}H.value=!0;try{if(R.value===`edit`&&z.value){let t=await v.update(z.value,{name:e,description:W.description.trim()||void 0,displayOrder:Number(W.displayOrder)||1,isActive:W.isActive,logoUrl:B.value}),n=I.value.findIndex(e=>e.id===z.value);n!==-1&&(I.value[n]={...I.value[n],...t}),F.success(`اطلاعات شرکت بهروزرسانی شد.`)}else{let t=await v.create({name:e,slug:ae(e),description:W.description.trim()||void 0,displayOrder:Number(W.displayOrder)||I.value.length+1,isActive:W.isActive,logoUrl:B.value});I.value.push(t),F.success(`شرکت جدید ثبت شد.`)}Y()}catch(e){F.error(e instanceof _?e.message:`ذخیره شرکت انجام نشد.`)}finally{H.value=!1}}async function Z(e,t){await v.setActive(e,t)}function Q(e){P.push(`/companies/${e}/accounts`)}function $(e){return e.trim().charAt(0)||`؟`}return(e,n)=>(l(),s(`div`,de,[o(`div`,{class:`admin-page-header`},[n[5]||=o(`div`,null,[o(`h1`,{class:`admin-page-header__title`},`مدیریت شرکتها`)],-1),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:q},` افزودن شرکت `)]),L.value?(l(),u(ce,{key:0,variant:`table`})):I.value.length?(l(),s(`div`,fe,[o(`div`,pe,[o(`table`,me,[n[6]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`لوگو`),o(`th`,{class:`numeric`},`ترتیب`),o(`th`,{class:`status`},`وضعیت`),o(`th`,null,`توضیحات`),o(`th`,null,`نام شرکت`),o(`th`,{class:`actions`},`عملیات`)])],-1),o(`tbody`,null,[(l(!0),s(f,null,i(I.value,e=>(l(),s(`tr`,{key:e.id},[o(`td`,null,[e.logoUrl?(l(),s(`img`,{key:0,src:e.logoUrl,alt:`لوگوی ${e.name}`,class:`company-logo`},null,8,he)):(l(),s(`div`,ge,t($(e.name)),1))]),o(`td`,_e,t(e.displayOrder),1),o(`td`,ve,[c(y,{id:e.id,modelValue:e.isActive,"onUpdate:modelValue":t=>e.isActive=t,"entity-name":e.name,"entity-type":`شرکت`,persist:Z},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])]),o(`td`,null,t(e.description),1),o(`td`,null,t(e.name),1),o(`td`,ye,[o(`div`,be,[o(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:t=>J(e)},` ویرایش `,8,xe),o(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:t=>Q(e.id)},` حسابها `,8,b)])])]))),128))])])])])):(l(),u(ue,{key:1,class:`admin-card`,icon:`companies`,title:`شرکتی ثبت نشده`,description:`برای شروع، اولین شرکت را ثبت کنید.`},{default:r(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:q},` افزودن شرکت `)]),_:1})),!L.value&&I.value.length?(l(),s(`div`,x,[(l(!0),s(f,null,i(I.value,e=>(l(),s(`article`,{key:e.id,class:`admin-card-item`},[o(`div`,S,[o(`div`,C,[e.logoUrl?(l(),s(`img`,{key:0,src:e.logoUrl,alt:`لوگوی ${e.name}`,class:`company-logo`},null,8,w)):(l(),s(`div`,T,t($(e.name)),1)),o(`div`,null,[o(`p`,E,t(e.name),1),o(`p`,D,t(e.description),1)])]),c(y,{id:e.id,modelValue:e.isActive,"onUpdate:modelValue":t=>e.isActive=t,"entity-name":e.name,"entity-type":`شرکت`,persist:Z},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])]),o(`div`,O,[o(`span`,null,`ترتیب: `+t(e.displayOrder),1)]),o(`div`,k,[o(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:t=>J(e)},` ویرایش `,8,A),o(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--xs`,onClick:t=>Q(e.id)},` حسابها `,8,j)])]))),128))])):h(``,!0),c(ie,{open:Pe.value,title:Fe.value,onClose:Y},{footer:r(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:Y},` انصراف `),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!Le.value||H.value,onClick:X},t(Ie.value),9,je)]),default:r(()=>[o(`form`,{class:`admin-form`,onSubmit:re(X,[`prevent`])},[G.value?(l(),s(`p`,M,t(G.value),1)):h(``,!0),o(`div`,Se,[n[8]||=o(`label`,null,[d(`لوگو `),o(`span`,{class:`admin-form__required`},`*`)],-1),o(`div`,Ce,[B.value?(l(),s(`div`,we,[o(`img`,{src:B.value,alt:`پیشنمایش لوگو`,class:`logo-upload__preview`},null,8,Te),o(`button`,{type:`button`,class:`logo-upload__remove`,onClick:ze},` حذف تصویر `)])):(l(),s(`label`,Ee,[...n[7]||=[o(`span`,{class:`logo-upload__icon`},`+`,-1),o(`span`,{class:`logo-upload__text`},`انتخاب یا رها کردن تصویر لوگو`,-1),o(`span`,{class:`logo-upload__hint`},`PNG، JPG، WEBP یا SVG — حداکثر ۲ مگابایت`,-1)]])),o(`input`,{id:`company-logo-file`,ref_key:`logoInputRef`,ref:V,type:`file`,accept:`image/png,image/jpeg,image/webp,image/svg+xml`,class:`logo-upload__input`,onChange:Re},null,544),B.value?(l(),s(`button`,{key:2,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm logo-upload__change`,onClick:n[0]||=e=>V.value?.click()},` تغییر تصویر `)):h(``,!0)])]),o(`div`,De,[n[9]||=o(`label`,{for:`company-name`},[d(`نام شرکت `),o(`span`,{class:`admin-form__required`},`*`)],-1),a(o(`input`,{id:`company-name`,"onUpdate:modelValue":n[1]||=e=>W.name=e,type:`text`,class:`admin-input`,placeholder:`مثال: شرکت پَر`,autocomplete:`off`},null,512),[[g,W.name]])]),o(`div`,Oe,[n[10]||=o(`label`,{for:`company-description`},`توضیحات`,-1),a(o(`textarea`,{id:`company-description`,"onUpdate:modelValue":n[2]||=e=>W.description=e,class:`admin-form__textarea`,placeholder:`تولید و عرضه انواع پارچه`,rows:`3`},null,512),[[g,W.description]])]),o(`div`,N,[o(`div`,ke,[n[11]||=o(`label`,{for:`company-order`},`ترتیب نمایش`,-1),a(o(`input`,{id:`company-order`,"onUpdate:modelValue":n[3]||=e=>W.displayOrder=e,type:`number`,min:`1`,class:`admin-input`},null,512),[[g,W.displayOrder,void 0,{number:!0}]])]),o(`div`,Ae,[c(le,{modelValue:W.isActive,"onUpdate:modelValue":n[4]||=e=>W.isActive=e,label:`وضعیت`},null,8,[`modelValue`])])])],32)]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-b4857c22`]]);export{P as default};
\ No newline at end of file
diff --git a/dist/assets/CustomersView-DgDLPLAd.css b/dist/assets/CustomersView-CpyDze5R.css
similarity index 84%
rename from dist/assets/CustomersView-DgDLPLAd.css
rename to dist/assets/CustomersView-CpyDze5R.css
index 0d8e4f2..bfb86b2 100644
--- a/dist/assets/CustomersView-DgDLPLAd.css
+++ b/dist/assets/CustomersView-CpyDze5R.css
@@ -1 +1 @@
-.suggestions-panel[data-v-4182e847]{border-top:1px solid var(--color-border);margin-top:20px;padding-top:20px}.suggestions-panel__head[data-v-4182e847]{margin-bottom:12px}.suggestions-panel__title[data-v-4182e847]{margin:0 0 4px;font-size:.95rem}.suggestions-panel__hint[data-v-4182e847]{color:var(--color-text-muted);margin:0;font-size:.78rem;line-height:1.5}.suggestions-panel__loading[data-v-4182e847],.suggestions-panel__empty[data-v-4182e847]{color:var(--color-text-muted);font-size:.85rem}.suggestions-panel__add[data-v-4182e847]{flex-direction:column;gap:10px;display:flex}.field[data-v-4182e847]{flex-direction:column;gap:6px;font-size:.85rem;display:flex}.suggestions-panel__picked[data-v-4182e847]{flex-wrap:wrap;gap:6px;display:flex}.suggestions-panel__chip[data-v-4182e847]{background:var(--color-primary-soft);color:var(--color-primary);border-radius:999px;align-items:center;gap:6px;padding:4px 8px;font-size:.75rem;font-weight:700;display:inline-flex}.suggestions-panel__chip button[data-v-4182e847]{color:inherit;cursor:pointer;background:0 0;border:none;font-size:1rem;line-height:1}.suggestions-panel__sub[data-v-4182e847]{margin:16px 0 8px;font-size:.85rem}.suggestions-panel__list ul[data-v-4182e847]{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.suggestions-panel__row[data-v-4182e847]{background:var(--color-bg);border:1px solid var(--color-border);border-radius:10px;justify-content:space-between;align-items:flex-start;gap:12px;padding:10px 12px;display:flex}.suggestions-panel__actions[data-v-4182e847]{flex-direction:column;flex-shrink:0;align-items:flex-end;gap:4px;display:flex}.muted[data-v-4182e847]{color:var(--color-text-muted);margin-inline-start:4px;font-size:.75rem}.note[data-v-4182e847]{color:var(--color-text-muted);margin:4px 0 0;font-size:.75rem}.on[data-v-4182e847]{color:var(--color-success);font-size:.72rem;font-weight:700}.off[data-v-4182e847]{color:var(--color-text-muted);font-size:.72rem}.link[data-v-4182e847]{color:var(--color-primary);cursor:pointer;background:0 0;border:none;font-family:inherit;font-size:.78rem}.customers-page__tabs[data-v-2e37be8d]{gap:8px;margin-bottom:16px;display:flex}.customers-page__tab[data-v-2e37be8d]{border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-muted);font:inherit;cursor:pointer;border-radius:999px;padding:8px 16px;font-size:.875rem;font-weight:600}.customers-page__tab.is-active[data-v-2e37be8d]{border-color:var(--color-primary);background:var(--color-primary-soft);color:var(--color-primary)}.customers-page__search[data-v-2e37be8d]{color:var(--color-text-muted);align-items:center;gap:10px;margin-bottom:16px;padding:10px 14px;display:flex}.customers-page__search-input[data-v-2e37be8d]{background:0 0;border:none;outline:none;flex:1;font-size:.875rem}.customers-page__table[data-v-2e37be8d]{overflow:hidden}
+.suggestions-panel[data-v-4182e847]{border-top:1px solid var(--color-border);margin-top:20px;padding-top:20px}.suggestions-panel__head[data-v-4182e847]{margin-bottom:12px}.suggestions-panel__title[data-v-4182e847]{margin:0 0 4px;font-size:.95rem}.suggestions-panel__hint[data-v-4182e847]{color:var(--color-text-muted);margin:0;font-size:.78rem;line-height:1.5}.suggestions-panel__loading[data-v-4182e847],.suggestions-panel__empty[data-v-4182e847]{color:var(--color-text-muted);font-size:.85rem}.suggestions-panel__add[data-v-4182e847]{flex-direction:column;gap:10px;display:flex}.field[data-v-4182e847]{flex-direction:column;gap:6px;font-size:.85rem;display:flex}.suggestions-panel__picked[data-v-4182e847]{flex-wrap:wrap;gap:6px;display:flex}.suggestions-panel__chip[data-v-4182e847]{background:var(--color-primary-soft);color:var(--color-primary);border-radius:999px;align-items:center;gap:6px;padding:4px 8px;font-size:.75rem;font-weight:700;display:inline-flex}.suggestions-panel__chip button[data-v-4182e847]{color:inherit;cursor:pointer;background:0 0;border:none;font-size:1rem;line-height:1}.suggestions-panel__sub[data-v-4182e847]{margin:16px 0 8px;font-size:.85rem}.suggestions-panel__list ul[data-v-4182e847]{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.suggestions-panel__row[data-v-4182e847]{background:var(--color-bg);border:1px solid var(--color-border);border-radius:10px;justify-content:space-between;align-items:flex-start;gap:12px;padding:10px 12px;display:flex}.suggestions-panel__actions[data-v-4182e847]{flex-direction:column;flex-shrink:0;align-items:flex-end;gap:4px;display:flex}.muted[data-v-4182e847]{color:var(--color-text-muted);margin-inline-start:4px;font-size:.75rem}.note[data-v-4182e847]{color:var(--color-text-muted);margin:4px 0 0;font-size:.75rem}.on[data-v-4182e847]{color:var(--color-success);font-size:.72rem;font-weight:700}.off[data-v-4182e847]{color:var(--color-text-muted);font-size:.72rem}.link[data-v-4182e847]{color:var(--color-primary);cursor:pointer;background:0 0;border:none;font-family:inherit;font-size:.78rem}.customers-page__tabs[data-v-e7c35ad6]{gap:8px;margin-bottom:16px;display:flex}.customers-page__tab[data-v-e7c35ad6]{border:1px solid var(--color-border);background:var(--color-surface);color:var(--color-text-muted);font:inherit;cursor:pointer;border-radius:999px;padding:8px 16px;font-size:.875rem;font-weight:600}.customers-page__tab.is-active[data-v-e7c35ad6]{border-color:var(--color-primary);background:var(--color-primary-soft);color:var(--color-primary)}.customers-page__search[data-v-e7c35ad6]{color:var(--color-text-muted);align-items:center;gap:10px;margin-bottom:16px;padding:10px 14px;display:flex}.customers-page__search-input[data-v-e7c35ad6]{background:0 0;border:none;outline:none;flex:1;font-size:.875rem}.customers-page__table[data-v-e7c35ad6]{overflow:hidden}
diff --git a/dist/assets/CustomersView-DkeEBLgM.js b/dist/assets/CustomersView-DkeEBLgM.js
deleted file mode 100644
index 99c2135..0000000
--- a/dist/assets/CustomersView-DkeEBLgM.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,B as n,Dt as r,E as i,H as a,M as o,U as s,Z as c,c as l,d as u,g as d,h as f,k as p,l as m,m as h,r as g,s as _,st as v,t as y,u as b}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as x,f as S,m as C,t as w}from"./http-BjLkjdQu.js";import{A as T,B as E,I as D,T as O,o as ee,s as k,v as A,x as te}from"./index-SWzbcuqQ.js";import{t as ne}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as re}from"./BaseSwitch-pJwnFBVo.js";import{t as ie}from"./BaseEmptyState-Bzvl_pTa.js";import{t as j}from"./AdminSelect-6a7SFr9x.js";import{r as M}from"./adminLabels-Cz9ccm1Z.js";import{t as N}from"./ActiveSwitchCell-DIBIZfO9.js";var P={class:`suggestions-panel`},F={key:0,class:`suggestions-panel__loading`},I={class:`suggestions-panel__add`},L={class:`field`},R={key:0,class:`suggestions-panel__picked`},z=[`onClick`],B={class:`field`},V=[`disabled`],H={key:0,class:`suggestions-panel__list`},U={class:`muted`,dir:`ltr`},W={key:0,class:`note`},G={class:`suggestions-panel__actions`},K=[`onClick`],q={key:1,class:`suggestions-panel__empty`},ae=y(d({__name:`CustomerSuggestionsPanel`,props:{customerId:{}},setup(a){let c=a,d=x(),m=e(!0),v=e(!1),y=e([]),C=e([]),E=e([]),D=e(``),ee=_(()=>C.value.filter(e=>!y.value.some(t=>t.productId===e.id&&t.isActive)).map(e=>({value:e.id,label:`${e.name} (${e.productCode})`})));async function k(){if(c.customerId){m.value=!0;try{let[e,t]=await Promise.all([T.list(c.customerId),O.list()]);y.value=e,C.value=t}catch(e){d.error(e instanceof w?e.message:`بارگذاری پیشنهادها ناموفق بود`)}finally{m.value=!1}}}async function A(){if(E.value.length){v.value=!0;try{for(let e of E.value)await T.create({customerId:c.customerId,productId:e,note:D.value.trim()||void 0});E.value=[],D.value=``,d.success(`پیشنهادها به صفحه خانه مشتری اضافه شد`),await k()}catch(e){d.error(e instanceof w?e.message:`ثبت پیشنهاد ناموفق بود`)}finally{v.value=!1}}}async function te(e){try{await T.setActive(e.id,!e.isActive),await k()}catch(e){d.error(e instanceof w?e.message:`بهروزرسانی ناموفق بود`)}}function ne(e){e&&(E.value.includes(e)||(E.value=[...E.value,e]))}function re(e){E.value=E.value.filter(t=>t!==e)}return n(()=>c.customerId,()=>{k()}),i(()=>{k()}),(e,n)=>(p(),u(`section`,P,[n[4]||=l(`header`,{class:`suggestions-panel__head`},[l(`div`,null,[l(`h3`,{class:`suggestions-panel__title`},`پیشنهاد اختصاصی در اپ`),l(`p`,{class:`suggestions-panel__hint`},` محصولات انتخابشده در بخش «پیشنهاد اختصاصی ما برای شما» در صفحه خانه مشتری نمایش داده میشوند. `)])],-1),m.value?(p(),u(`div`,F,`در حال بارگذاری...`)):(p(),u(g,{key:1},[l(`div`,I,[l(`label`,L,[n[1]||=h(` افزودن محصول (کد کالیته) `,-1),f(j,{"model-value":``,options:[{value:``,label:`انتخاب محصول...`},...ee.value],"onUpdate:modelValue":ne},null,8,[`options`])]),E.value.length?(p(),u(`div`,R,[(p(!0),u(g,null,o(E.value,e=>(p(),u(`span`,{key:e,class:`suggestions-panel__chip`},[h(t(C.value.find(t=>t.id===e)?.productCode||e)+` `,1),l(`button`,{type:`button`,"aria-label":`حذف`,onClick:t=>re(e)},`×`,8,z)]))),128))])):b(``,!0),l(`label`,B,[n[2]||=h(` یادداشت (اختیاری) `,-1),s(l(`textarea`,{"onUpdate:modelValue":n[0]||=e=>D.value=e,class:`admin-input`,rows:`2`,placeholder:`دلیل پیشنهاد برای مشتری`},null,512),[[S,D.value]])]),l(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,disabled:!E.value.length||v.value,onClick:A},` افزودن به صفحه خانه مشتری `,8,V)]),y.value.length?(p(),u(`div`,H,[n[3]||=l(`h4`,{class:`suggestions-panel__sub`},`پیشنهادهای ثبتشده`,-1),l(`ul`,null,[(p(!0),u(g,null,o(y.value,e=>(p(),u(`li`,{key:e.id,class:`suggestions-panel__row`},[l(`div`,null,[l(`strong`,null,t(e.productName),1),l(`span`,U,`(`+t(e.productCode)+`)`,1),e.note?(p(),u(`p`,W,t(e.note),1)):b(``,!0)]),l(`div`,G,[l(`span`,{class:r(e.isActive?`on`:`off`)},t(e.isActive?`فعال`:`غیرفعال`),3),l(`button`,{type:`button`,class:`link`,onClick:t=>te(e)},t(e.isActive?`حذف از خانه`:`فعالسازی`),9,K)])]))),128))])])):(p(),u(`p`,q,`هنوز پیشنهادی برای این مشتری ثبت نشده است.`))],64))]))}}),[[`__scopeId`,`data-v-4182e847`]]),oe={class:`customers-page`},se={class:`admin-page-header`},ce={class:`customers-page__tabs`,role:`tablist`,"aria-label":`نوع کاربر`},le=[`aria-selected`],ue=[`aria-selected`],de={class:`customers-page__search admin-card`},fe={key:2,class:`customers-page__table admin-card desktop-only`},pe={class:`admin-table-wrap`},me={class:`admin-table`},he={key:0},ge={key:1},_e={key:2},ve={key:3},ye={key:4},be={key:0},xe={key:1},Se={key:2},Ce={key:3},we={key:4},Te={class:`numeric`},Ee={class:`numeric`},De={class:`status`},Oe={class:`actions`},ke=[`onClick`],Ae={key:3,class:`compact-only admin-card-list`},je={class:`admin-card-item__header`},Me={class:`admin-card-item__title`},Ne={class:`admin-card-item__header-actions`},Pe=[`onClick`],Fe={class:`admin-card-item__meta`},Ie={key:0},Le={key:1},Re={key:2},ze={key:3},Be={key:4},Ve={key:0,class:`admin-form__error`,role:`alert`},He={class:`admin-form__field`},Ue={class:`admin-form__row`},We={class:`admin-form__field`},Ge={class:`admin-form__field`},Ke={class:`admin-form__row`},qe={class:`admin-form__field`},Je={class:`admin-form__field`},Ye={class:`admin-form__row`},Xe={class:`admin-form__field`},Ze={class:`admin-form__field`},Qe={class:`admin-form__row`},$e={class:`admin-form__field`},et={key:0,class:`admin-form__field`},tt={class:`admin-form__field`},nt=[`disabled`],rt={key:0,class:`admin-btn__spinner`,"aria-hidden":`true`},J=y(d({__name:`CustomersView`,setup(n){let d=e([]),y=e([]),T=e([]),O=e(``),P=e(`customer`),F=e(!0),I=e(null),L=e(null),R=e(``),z=e(!1),B=x();function V(e){if(e==null)return`-`;if(typeof e==`number`)return Number.isFinite(e)?String(e):`-`;let t=e.trim();return!t||t===`—`?`-`:t}function H(e){return e==null||!Number.isFinite(e)?`-`:k(e)}let U=[{value:`wholesale`,label:`عمدهفروش`},{value:`retail`,label:`خردهفروش`}],W=[{value:`customer`,label:`مشتری`},{value:`agent`,label:`واسطه`}],G={customer:`مشتری`,agent:`واسطه`};function K(e){return G[e===`agent`?`agent`:`customer`]}let q=_(()=>[{value:``,label:`بدون سطح`},...y.value.map(e=>({value:e.id,label:e.label}))]),J=_(()=>[{value:``,label:`بدون واسطه`},...T.value.filter(e=>e.id!==L.value).map(e=>({value:e.id,label:e.name+(e.agentCode?` (${e.agentCode})`:``)}))]),Y=()=>({name:``,phone:``,nationalId:``,customerType:`wholesale`,companyName:``,isActive:!0,levelDefId:``,assignedAgentId:``,appRole:`customer`,agentCode:``}),X=c(Y()),it=_(()=>I.value!==null),at=_(()=>I.value===`edit`?`ویرایش مشتری`:`افزودن مشتری`),ot=_(()=>X.name.trim()&&X.phone.trim()&&X.nationalId.trim()),Z=_(()=>{let e=O.value.trim();return e?d.value.filter(t=>t.name.includes(e)||t.phone.includes(e)||t.nationalId.includes(e)||t.companyName.includes(e)):d.value});async function st(){F.value=!0;try{d.value=await A.list(void 0,P.value)}catch(e){B.error(e instanceof w?e.message:P.value===`agent`?`بارگذاری واسطهها انجام نشد.`:`بارگذاری مشتریان انجام نشد.`)}finally{F.value=!1}}function ct(e){P.value!==e&&(P.value=e,O.value=``,st())}async function lt(){try{let[e,t]=await Promise.all([te.list(),A.list(void 0,`agent`)]);y.value=e,T.value=t}catch(e){B.error(e instanceof w?e.message:`بارگذاری اطلاعات کمکی انجام نشد.`)}}i(()=>{st(),lt()});function ut(){I.value=`add`,L.value=null,Object.assign(X,Y()),X.appRole=P.value,R.value=``}function dt(e){I.value=`edit`,L.value=e.id,X.name=e.name,X.phone=e.phone,X.nationalId=e.nationalId,X.customerType=e.customerType,X.companyName=e.companyName,X.isActive=e.isActive,X.levelDefId=e.levelDefId??``,X.assignedAgentId=e.assignedAgentId??``,X.appRole=e.appRole===`agent`?`agent`:`customer`,X.agentCode=e.agentCode??``,R.value=``}function Q(){I.value=null,L.value=null,R.value=``}async function $(){if(!ot.value){R.value=`نام، تلفن و شناسه ملی الزامی هستند.`;return}z.value=!0;let e={name:X.name.trim(),phone:X.phone.trim(),nationalId:X.nationalId.trim(),customerType:X.customerType,isActive:X.isActive,levelDefId:X.levelDefId||null,assignedAgentId:X.assignedAgentId||null,appRole:X.appRole,agentCode:X.appRole===`agent`&&X.agentCode.trim()||null};try{if(I.value===`edit`&&L.value){let t=await A.update(L.value,e),n=d.value.findIndex(e=>e.id===L.value);n!==-1&&(d.value[n]={...d.value[n],...t})}else{let t=await A.create(e);d.value.unshift(t)}B.success(I.value===`edit`?`اطلاعات مشتری بهروزرسانی شد.`:`مشتری جدید ثبت شد.`),Q(),e.appRole===`agent`&<()}catch(e){B.error(e instanceof w?e.message:`ذخیره مشتری انجام نشد.`)}finally{z.value=!1}}async function ft(e,t){await A.setActive(e,t)}function pt(){O.value=``}return(e,n)=>(p(),u(`div`,oe,[l(`div`,se,[n[13]||=l(`div`,null,[l(`h1`,{class:`admin-page-header__title`},`مشتریان و واسطهها`)],-1),l(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:ut},t(P.value===`agent`?`افزودن واسطه`:`افزودن مشتری`),1)]),l(`div`,ce,[l(`button`,{type:`button`,role:`tab`,class:r([`customers-page__tab`,{"is-active":P.value===`customer`}]),"aria-selected":P.value===`customer`,onClick:n[0]||=e=>ct(`customer`)},` مشتریان `,10,le),l(`button`,{type:`button`,role:`tab`,class:r([`customers-page__tab`,{"is-active":P.value===`agent`}]),"aria-selected":P.value===`agent`,onClick:n[1]||=e=>ct(`agent`)},` واسطهها `,10,ue)]),l(`div`,de,[f(D,{name:`search`,size:18}),s(l(`input`,{"onUpdate:modelValue":n[2]||=e=>O.value=e,type:`search`,class:`customers-page__search-input`,placeholder:`جستجو در نام، تلفن، شناسه ملی...`},null,512),[[S,O.value]])]),F.value?(p(),m(ne,{key:0,variant:`table`})):Z.value.length?(p(),u(`div`,fe,[l(`div`,pe,[l(`table`,me,[l(`thead`,null,[l(`tr`,null,[l(`th`,null,t(P.value===`agent`?`نام واسطه`:`نام مشتری`),1),n[14]||=l(`th`,null,`تلفن`,-1),n[15]||=l(`th`,null,`نقش`,-1),P.value===`agent`?(p(),u(`th`,he,`کد واسطه`)):b(``,!0),P.value===`customer`?(p(),u(`th`,ge,`نوع`)):b(``,!0),P.value===`customer`?(p(),u(`th`,_e,`سطح`)):b(``,!0),P.value===`customer`?(p(),u(`th`,ve,`واسطه`)):b(``,!0),P.value===`customer`?(p(),u(`th`,ye,`شرکت`)):b(``,!0),n[16]||=l(`th`,{class:`numeric`},`تعداد سفارش`,-1),n[17]||=l(`th`,{class:`numeric`},`مجموع متراژ`,-1),n[18]||=l(`th`,{class:`status`},`وضعیت`,-1),n[19]||=l(`th`,null,`تاریخ ثبت`,-1),n[20]||=l(`th`,{class:`actions`},`عملیات`,-1)])]),l(`tbody`,null,[(p(!0),u(g,null,o(Z.value,e=>(p(),u(`tr`,{key:e.id},[l(`td`,null,t(V(e.name)),1),l(`td`,null,t(V(e.phone)),1),l(`td`,null,t(K(e.appRole)),1),P.value===`agent`?(p(),u(`td`,be,t(V(e.agentCode)),1)):b(``,!0),P.value===`customer`?(p(),u(`td`,xe,t(V(v(M)[e.customerType])),1)):b(``,!0),P.value===`customer`?(p(),u(`td`,Se,t(V(e.levelLabel)),1)):b(``,!0),P.value===`customer`?(p(),u(`td`,Ce,t(V(e.assignedAgentName)),1)):b(``,!0),P.value===`customer`?(p(),u(`td`,we,t(V(e.companyName)),1)):b(``,!0),l(`td`,Te,t(V(e.orderCount)),1),l(`td`,Ee,t(H(e.totalMeterage)),1),l(`td`,De,[f(N,{id:e.id,modelValue:e.isActive,"onUpdate:modelValue":t=>e.isActive=t,"entity-name":e.name,"entity-type":`مشتری`,persist:ft},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])]),l(`td`,null,t(V(v(ee)(e.registeredAt))),1),l(`td`,Oe,[l(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:t=>dt(e)},` ویرایش `,8,ke)])]))),128))])])])])):(p(),m(ie,{key:1,class:`admin-card`,icon:`customers`,title:O.value.trim()?`نتیجهای یافت نشد`:P.value===`agent`?`واسطهای ثبت نشده`:`مشتریان ثبت شده`,description:O.value.trim()?`عبارت جستجو را تغییر دهید یا فیلترها را پاک کنید.`:P.value===`agent`?`برای شروع، اولین واسطه را ثبت کنید.`:`برای شروع، اولین مشتری را ثبت کنید.`},{default:a(()=>[O.value.trim()?(p(),u(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,onClick:pt},` پاک کردن جستجو `)):(p(),u(`button`,{key:1,type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:ut},t(P.value===`agent`?`افزودن واسطه`:`افزودن مشتری`),1))]),_:1},8,[`title`,`description`])),!F.value&&Z.value.length?(p(),u(`div`,Ae,[(p(!0),u(g,null,o(Z.value,e=>(p(),u(`article`,{key:e.id,class:`admin-card-item`},[l(`div`,je,[l(`p`,Me,t(V(e.name)),1),l(`div`,Ne,[f(N,{id:e.id,modelValue:e.isActive,"onUpdate:modelValue":t=>e.isActive=t,"entity-name":e.name,"entity-type":`مشتری`,persist:ft},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`]),l(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:t=>dt(e)},` ویرایش `,8,Pe)])]),l(`div`,Fe,[l(`span`,null,t(V(e.phone)),1),P.value===`agent`?(p(),u(`span`,Ie,`کد: `+t(V(e.agentCode)),1)):b(``,!0),P.value===`customer`?(p(),u(`span`,Le,t(V(v(M)[e.customerType])),1)):b(``,!0),P.value===`customer`?(p(),u(`span`,Re,t(V(e.levelLabel)),1)):b(``,!0),P.value===`customer`?(p(),u(`span`,ze,`واسطه: `+t(V(e.assignedAgentName)),1)):b(``,!0),P.value===`customer`?(p(),u(`span`,Be,t(V(e.companyName)),1)):b(``,!0),l(`span`,null,t(V(e.orderCount))+` سفارش · `+t(H(e.totalMeterage)),1)])]))),128))])):b(``,!0),f(E,{open:it.value,title:at.value,size:`lg`,onClose:Q},{footer:a(()=>[l(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:Q},`انصراف`),l(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!ot.value||z.value,onClick:$},[z.value?(p(),u(`span`,rt)):b(``,!0),h(` `+t(I.value===`edit`?`ذخیره تغییرات`:X.appRole===`agent`?`ثبت واسطه`:`ثبت مشتری`),1)],8,nt)]),default:a(()=>[l(`form`,{class:`admin-form`,onSubmit:C($,[`prevent`])},[R.value?(p(),u(`p`,Ve,t(R.value),1)):b(``,!0),l(`div`,He,[n[21]||=l(`label`,{for:`customer-name`},[h(`نام مشتری `),l(`span`,{class:`admin-form__required`},`*`)],-1),s(l(`input`,{id:`customer-name`,"onUpdate:modelValue":n[3]||=e=>X.name=e,type:`text`,class:`admin-input`},null,512),[[S,X.name]])]),l(`div`,Ue,[l(`div`,We,[n[22]||=l(`label`,{for:`customer-phone`},[h(`تلفن `),l(`span`,{class:`admin-form__required`},`*`)],-1),s(l(`input`,{id:`customer-phone`,"onUpdate:modelValue":n[4]||=e=>X.phone=e,type:`tel`,class:`admin-input`,inputmode:`tel`,dir:`ltr`},null,512),[[S,X.phone]])]),l(`div`,Ge,[n[23]||=l(`label`,{for:`customer-national-id`},[h(`شناسه ملی `),l(`span`,{class:`admin-form__required`},`*`)],-1),s(l(`input`,{id:`customer-national-id`,"onUpdate:modelValue":n[5]||=e=>X.nationalId=e,type:`text`,class:`admin-input`,inputmode:`numeric`,dir:`ltr`},null,512),[[S,X.nationalId]])])]),l(`div`,Ke,[l(`div`,qe,[n[24]||=l(`label`,null,`نوع مشتری`,-1),f(j,{modelValue:X.customerType,"onUpdate:modelValue":n[6]||=e=>X.customerType=e,block:``,"aria-label":`نوع مشتری`,options:U},null,8,[`modelValue`])]),l(`div`,Je,[n[25]||=l(`label`,{for:`customer-company`},`شرکت مرتبط`,-1),s(l(`input`,{id:`customer-company`,"onUpdate:modelValue":n[7]||=e=>X.companyName=e,type:`text`,class:`admin-input`},null,512),[[S,X.companyName]])])]),l(`div`,Ye,[l(`div`,Xe,[n[26]||=l(`label`,null,`سطح`,-1),f(j,{modelValue:X.levelDefId,"onUpdate:modelValue":n[8]||=e=>X.levelDefId=e,block:``,"aria-label":`سطح مشتری`,options:q.value},null,8,[`modelValue`,`options`])]),l(`div`,Ze,[n[27]||=l(`label`,null,`واسطه`,-1),f(j,{modelValue:X.assignedAgentId,"onUpdate:modelValue":n[9]||=e=>X.assignedAgentId=e,block:``,"aria-label":`واسطه اختصاصیافته`,options:J.value},null,8,[`modelValue`,`options`])])]),l(`div`,Qe,[l(`div`,$e,[n[28]||=l(`label`,null,`نقش در اپ`,-1),f(j,{modelValue:X.appRole,"onUpdate:modelValue":n[10]||=e=>X.appRole=e,block:``,"aria-label":`نقش در اپ`,options:W},null,8,[`modelValue`])]),X.appRole===`agent`?(p(),u(`div`,et,[n[29]||=l(`label`,{for:`customer-agent-code`},`کد واسطه`,-1),s(l(`input`,{id:`customer-agent-code`,"onUpdate:modelValue":n[11]||=e=>X.agentCode=e,type:`text`,class:`admin-input`,dir:`ltr`},null,512),[[S,X.agentCode]])])):b(``,!0)]),l(`div`,tt,[f(re,{modelValue:X.isActive,"onUpdate:modelValue":n[12]||=e=>X.isActive=e,label:`وضعیت`},null,8,[`modelValue`])]),I.value===`edit`&&L.value&&X.appRole===`customer`?(p(),m(ae,{key:1,"customer-id":L.value},null,8,[`customer-id`])):b(``,!0)],32)]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-2e37be8d`]]);export{J as default};
\ No newline at end of file
diff --git a/dist/assets/CustomersView-Dq5nc_F0.js b/dist/assets/CustomersView-Dq5nc_F0.js
new file mode 100644
index 0000000..29752fb
--- /dev/null
+++ b/dist/assets/CustomersView-Dq5nc_F0.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,Ot as r,Q as i,U as a,V as ee,W as o,c as s,ct as c,d as l,et as u,g as d,h as f,jt as p,l as m,m as h,r as g,s as _,t as v,u as y}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as b,d as x,m as S,t as C}from"./http-CTjL79ty.js";import{E as w,L as T,S as E,V as te,j as D,o as O,s as k,y as A}from"./index-DxcN1-hp.js";import{t as ne}from"./AdminPageSkeleton-DacAHji8.js";import{t as re}from"./BaseSwitch-Dz4ODUhf.js";import{t as ie}from"./BaseEmptyState-BAIuUvAl.js";import{t as j}from"./AdminSelect-BYntBSYd.js";import{i as M}from"./adminLabels-jYlObVqa.js";import{t as N}from"./ActiveSwitchCell-4PQpvsIu.js";var P={class:`suggestions-panel`},F={key:0,class:`suggestions-panel__loading`},I={class:`suggestions-panel__add`},L={class:`field`},R={key:0,class:`suggestions-panel__picked`},z=[`onClick`],B={class:`field`},V=[`disabled`],H={key:0,class:`suggestions-panel__list`},U={class:`muted`,dir:`ltr`},W={key:0,class:`note`},G={class:`suggestions-panel__actions`},K=[`onClick`],q={key:1,class:`suggestions-panel__empty`},ae=v(d({__name:`CustomerSuggestionsPanel`,props:{customerId:{}},setup(i){let a=i,c=b(),d=u(!0),m=u(!1),v=u([]),S=u([]),T=u([]),E=u(``),te=_(()=>S.value.filter(e=>!v.value.some(t=>t.productId===e.id&&t.isActive)).map(e=>({value:e.id,label:`${e.name} (${e.productCode})`})));async function O(){if(a.customerId){d.value=!0;try{let[e,t]=await Promise.all([D.list(a.customerId),w.list()]);v.value=e,S.value=t}catch(e){c.error(e instanceof C?e.message:`بارگذاری پیشنهادها ناموفق بود`)}finally{d.value=!1}}}async function k(){if(T.value.length){m.value=!0;try{for(let e of T.value)await D.create({customerId:a.customerId,productId:e,note:E.value.trim()||void 0});T.value=[],E.value=``,c.success(`پیشنهادها به صفحه خانه مشتری اضافه شد`),await O()}catch(e){c.error(e instanceof C?e.message:`ثبت پیشنهاد ناموفق بود`)}finally{m.value=!1}}}async function A(e){try{await D.setActive(e.id,!e.isActive),await O()}catch(e){c.error(e instanceof C?e.message:`بهروزرسانی ناموفق بود`)}}function ne(e){e&&(T.value.includes(e)||(T.value=[...T.value,e]))}function re(e){T.value=T.value.filter(t=>t!==e)}return ee(()=>a.customerId,()=>{O()}),t(()=>{O()}),(t,i)=>(e(),l(`section`,P,[i[4]||=s(`header`,{class:`suggestions-panel__head`},[s(`div`,null,[s(`h3`,{class:`suggestions-panel__title`},`پیشنهاد اختصاصی در اپ`),s(`p`,{class:`suggestions-panel__hint`},` محصولات انتخابشده در بخش «پیشنهاد اختصاصی ما برای شما» در صفحه خانه مشتری نمایش داده میشوند. `)])],-1),d.value?(e(),l(`div`,F,`در حال بارگذاری...`)):(e(),l(g,{key:1},[s(`div`,I,[s(`label`,L,[i[1]||=h(` افزودن محصول (کد کالیته) `,-1),f(j,{"model-value":``,options:[{value:``,label:`انتخاب محصول...`},...te.value],"onUpdate:modelValue":ne},null,8,[`options`])]),T.value.length?(e(),l(`div`,R,[(e(!0),l(g,null,n(T.value,t=>(e(),l(`span`,{key:t,class:`suggestions-panel__chip`},[h(p(S.value.find(e=>e.id===t)?.productCode||t)+` `,1),s(`button`,{type:`button`,"aria-label":`حذف`,onClick:e=>re(t)},`×`,8,z)]))),128))])):y(``,!0),s(`label`,B,[i[2]||=h(` یادداشت (اختیاری) `,-1),o(s(`textarea`,{"onUpdate:modelValue":i[0]||=e=>E.value=e,class:`admin-input`,rows:`2`,placeholder:`دلیل پیشنهاد برای مشتری`},null,512),[[x,E.value]])]),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,disabled:!T.value.length||m.value,onClick:k},` افزودن به صفحه خانه مشتری `,8,V)]),v.value.length?(e(),l(`div`,H,[i[3]||=s(`h4`,{class:`suggestions-panel__sub`},`پیشنهادهای ثبتشده`,-1),s(`ul`,null,[(e(!0),l(g,null,n(v.value,t=>(e(),l(`li`,{key:t.id,class:`suggestions-panel__row`},[s(`div`,null,[s(`strong`,null,p(t.productName),1),s(`span`,U,`(`+p(t.productCode)+`)`,1),t.note?(e(),l(`p`,W,p(t.note),1)):y(``,!0)]),s(`div`,G,[s(`span`,{class:r(t.isActive?`on`:`off`)},p(t.isActive?`فعال`:`غیرفعال`),3),s(`button`,{type:`button`,class:`link`,onClick:e=>A(t)},p(t.isActive?`حذف از خانه`:`فعالسازی`),9,K)])]))),128))])])):(e(),l(`p`,q,`هنوز پیشنهادی برای این مشتری ثبت نشده است.`))],64))]))}}),[[`__scopeId`,`data-v-4182e847`]]),oe={class:`customers-page`},se={class:`admin-page-header`},ce={class:`customers-page__tabs`,role:`tablist`,"aria-label":`نوع کاربر`},le=[`aria-selected`],ue=[`aria-selected`],de={class:`customers-page__search admin-card`},fe={key:2,class:`customers-page__table admin-card desktop-only`},pe={class:`admin-table-wrap`},me={class:`admin-table`},he={key:0},ge={key:1},_e={key:2},ve={key:3},ye={key:4},be={key:0},xe={key:1},Se={key:2},Ce={key:3},we={key:4},Te={class:`numeric`},Ee={class:`numeric`},De={class:`status`},Oe={class:`actions`},ke=[`onClick`],Ae={key:3,class:`compact-only admin-card-list`},je={class:`admin-card-item__header`},Me={class:`admin-card-item__title`},Ne={class:`admin-card-item__header-actions`},Pe=[`onClick`],Fe={class:`admin-card-item__meta`},Ie={key:0},Le={key:1},Re={key:2},ze={key:3},Be={key:4},Ve={key:0,class:`admin-form__error`,role:`alert`},He={class:`admin-form__field`},Ue={class:`admin-form__row`},We={class:`admin-form__field`},Ge={class:`admin-form__field`},Ke={class:`admin-form__row`},qe={class:`admin-form__field`},Je={class:`admin-form__field`},Ye={class:`admin-form__row`},Xe={class:`admin-form__field`},Ze={class:`admin-form__field`},Qe={class:`admin-form__row`},$e={class:`admin-form__field`},et={key:0,class:`admin-form__field`},tt={class:`admin-form__field`},nt=[`disabled`],rt={key:0,class:`admin-btn__spinner`,"aria-hidden":`true`},J=v(d({__name:`CustomersView`,setup(ee){let d=u([]),v=u([]),w=u([]),D=u(``),P=u(`customer`),F=u(!0),I=u(null),L=u(null),R=u(``),z=u(!1),B=b();function V(e){if(e==null)return`-`;if(typeof e==`number`)return Number.isFinite(e)?String(e):`-`;let t=e.trim();return!t||t===`—`?`-`:t}function H(e){return e==null||!Number.isFinite(e)?`-`:k(e)}let U=[{value:`wholesale`,label:`عمدهفروش`},{value:`retail`,label:`خردهفروش`}],W=[{value:`customer`,label:`مشتری`},{value:`agent`,label:`واسطه`}],G={customer:`مشتری`,agent:`واسطه`};function K(e){return G[e===`agent`?`agent`:`customer`]}let q=_(()=>[{value:``,label:`بدون سطح`},...v.value.map(e=>({value:e.id,label:e.label}))]),J=_(()=>[{value:``,label:`بدون واسطه`},...w.value.filter(e=>e.id!==L.value).map(e=>({value:e.id,label:e.name+(e.agentCode?` (${e.agentCode})`:``)}))]),Y=()=>({name:``,phone:``,nationalId:``,customerType:`wholesale`,companyName:``,isActive:!0,levelDefId:``,assignedAgentId:``,appRole:`customer`,agentCode:``}),X=i(Y()),it=_(()=>I.value!==null),at=_(()=>I.value===`edit`?`ویرایش مشتری`:`افزودن مشتری`),Z=_(()=>X.name.trim()&&X.phone.trim()&&X.nationalId.trim()),Q=_(()=>{let e=D.value.trim();return e?d.value.filter(t=>t.name.includes(e)||t.phone.includes(e)||t.nationalId.includes(e)||t.companyName.includes(e)):d.value});async function ot(){F.value=!0;try{d.value=await A.list(void 0,P.value)}catch(e){B.error(e instanceof C?e.message:P.value===`agent`?`بارگذاری واسطهها انجام نشد.`:`بارگذاری مشتریان انجام نشد.`)}finally{F.value=!1}}function st(e){P.value!==e&&(P.value=e,D.value=``,ot())}async function ct(){try{let[e,t]=await Promise.all([E.list(),A.list(void 0,`agent`)]);v.value=e,w.value=t}catch(e){B.error(e instanceof C?e.message:`بارگذاری اطلاعات کمکی انجام نشد.`)}}t(()=>{ot(),ct()});function lt(){I.value=`add`,L.value=null,Object.assign(X,Y()),X.appRole=P.value,R.value=``}function ut(e){I.value=`edit`,L.value=e.id,X.name=e.name,X.phone=e.phone,X.nationalId=e.nationalId,X.customerType=e.customerType,X.companyName=e.companyName,X.isActive=e.isActive,X.levelDefId=e.levelDefId??``,X.assignedAgentId=e.assignedAgentId??``,X.appRole=e.appRole===`agent`?`agent`:`customer`,X.agentCode=e.agentCode??``,R.value=``}function $(){I.value=null,L.value=null,R.value=``}async function dt(){if(!Z.value){R.value=`نام، تلفن و شناسه ملی الزامی هستند.`;return}z.value=!0;let e={name:X.name.trim(),phone:X.phone.trim(),nationalId:X.nationalId.trim(),customerType:X.customerType,isActive:X.isActive,levelDefId:X.levelDefId||null,assignedAgentId:X.assignedAgentId||null,appRole:X.appRole,agentCode:X.appRole===`agent`&&X.agentCode.trim()||null};try{if(I.value===`edit`&&L.value){let t=await A.update(L.value,e),n=d.value.findIndex(e=>e.id===L.value);n!==-1&&(d.value[n]={...d.value[n],...t})}else{let t=await A.create(e);d.value.unshift(t)}B.success(I.value===`edit`?`اطلاعات مشتری بهروزرسانی شد.`:`مشتری جدید ثبت شد.`),$(),e.appRole===`agent`&&ct()}catch(e){B.error(e instanceof C?e.message:`ذخیره مشتری انجام نشد.`)}finally{z.value=!1}}async function ft(e,t){await A.setActive(e,t)}function pt(){D.value=``}return(t,i)=>(e(),l(`div`,oe,[s(`div`,se,[i[13]||=s(`div`,null,[s(`h1`,{class:`admin-page-header__title`},`مشتریان و واسطهها`)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:lt},p(P.value===`agent`?`افزودن واسطه`:`افزودن مشتری`),1)]),s(`div`,ce,[s(`button`,{type:`button`,role:`tab`,class:r([`customers-page__tab`,{"is-active":P.value===`customer`}]),"aria-selected":P.value===`customer`,onClick:i[0]||=e=>st(`customer`)},` مشتریان `,10,le),s(`button`,{type:`button`,role:`tab`,class:r([`customers-page__tab`,{"is-active":P.value===`agent`}]),"aria-selected":P.value===`agent`,onClick:i[1]||=e=>st(`agent`)},` واسطهها `,10,ue)]),s(`div`,de,[f(T,{name:`search`,size:18}),o(s(`input`,{"onUpdate:modelValue":i[2]||=e=>D.value=e,type:`search`,class:`customers-page__search-input`,placeholder:`جستجو در نام، تلفن، شناسه ملی...`},null,512),[[x,D.value]])]),F.value?(e(),m(ne,{key:0,variant:`table`})):Q.value.length?(e(),l(`div`,fe,[s(`div`,pe,[s(`table`,me,[s(`thead`,null,[s(`tr`,null,[s(`th`,null,p(P.value===`agent`?`نام واسطه`:`نام مشتری`),1),i[14]||=s(`th`,null,`تلفن`,-1),i[15]||=s(`th`,null,`نقش`,-1),P.value===`agent`?(e(),l(`th`,he,`کد واسطه`)):y(``,!0),P.value===`customer`?(e(),l(`th`,ge,`نوع`)):y(``,!0),P.value===`customer`?(e(),l(`th`,_e,`سطح`)):y(``,!0),P.value===`customer`?(e(),l(`th`,ve,`واسطه`)):y(``,!0),P.value===`customer`?(e(),l(`th`,ye,`شرکت`)):y(``,!0),i[16]||=s(`th`,{class:`numeric`},`تعداد سفارش`,-1),i[17]||=s(`th`,{class:`numeric`},`مجموع متراژ`,-1),i[18]||=s(`th`,{class:`status`},`وضعیت`,-1),i[19]||=s(`th`,null,`تاریخ ثبت`,-1),i[20]||=s(`th`,{class:`actions`},`عملیات`,-1)])]),s(`tbody`,null,[(e(!0),l(g,null,n(Q.value,t=>(e(),l(`tr`,{key:t.id},[s(`td`,null,p(V(t.name)),1),s(`td`,null,p(V(t.phone)),1),s(`td`,null,p(K(t.appRole)),1),P.value===`agent`?(e(),l(`td`,be,p(V(t.agentCode)),1)):y(``,!0),P.value===`customer`?(e(),l(`td`,xe,p(V(c(M)[t.customerType])),1)):y(``,!0),P.value===`customer`?(e(),l(`td`,Se,p(V(t.levelLabel)),1)):y(``,!0),P.value===`customer`?(e(),l(`td`,Ce,p(V(t.assignedAgentName)),1)):y(``,!0),P.value===`customer`?(e(),l(`td`,we,p(V(t.companyName)),1)):y(``,!0),s(`td`,Te,p(V(t.orderCount)),1),s(`td`,Ee,p(H(t.totalMeterage)),1),s(`td`,De,[f(N,{id:t.id,modelValue:t.isActive,"onUpdate:modelValue":e=>t.isActive=e,"entity-name":t.name,"entity-type":`مشتری`,persist:ft},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`])]),s(`td`,null,p(V(c(O)(t.registeredAt))),1),s(`td`,Oe,[s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:e=>ut(t)},` ویرایش `,8,ke)])]))),128))])])])])):(e(),m(ie,{key:1,class:`admin-card`,icon:`customers`,title:D.value.trim()?`نتیجهای یافت نشد`:P.value===`agent`?`واسطهای ثبت نشده`:`مشتریان ثبت شده`,description:D.value.trim()?`عبارت جستجو را تغییر دهید یا فیلترها را پاک کنید.`:P.value===`agent`?`برای شروع، اولین واسطه را ثبت کنید.`:`برای شروع، اولین مشتری را ثبت کنید.`},{default:a(()=>[D.value.trim()?(e(),l(`button`,{key:0,type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,onClick:pt},` پاک کردن جستجو `)):(e(),l(`button`,{key:1,type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:lt},p(P.value===`agent`?`افزودن واسطه`:`افزودن مشتری`),1))]),_:1},8,[`title`,`description`])),!F.value&&Q.value.length?(e(),l(`div`,Ae,[(e(!0),l(g,null,n(Q.value,t=>(e(),l(`article`,{key:t.id,class:`admin-card-item`},[s(`div`,je,[s(`p`,Me,p(V(t.name)),1),s(`div`,Ne,[f(N,{id:t.id,modelValue:t.isActive,"onUpdate:modelValue":e=>t.isActive=e,"entity-name":t.name,"entity-type":`مشتری`,persist:ft},null,8,[`id`,`modelValue`,`onUpdate:modelValue`,`entity-name`]),s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:e=>ut(t)},` ویرایش `,8,Pe)])]),s(`div`,Fe,[s(`span`,null,p(V(t.phone)),1),P.value===`agent`?(e(),l(`span`,Ie,`کد: `+p(V(t.agentCode)),1)):y(``,!0),P.value===`customer`?(e(),l(`span`,Le,p(V(c(M)[t.customerType])),1)):y(``,!0),P.value===`customer`?(e(),l(`span`,Re,p(V(t.levelLabel)),1)):y(``,!0),P.value===`customer`?(e(),l(`span`,ze,`واسطه: `+p(V(t.assignedAgentName)),1)):y(``,!0),P.value===`customer`?(e(),l(`span`,Be,p(V(t.companyName)),1)):y(``,!0),s(`span`,null,p(V(t.orderCount))+` سفارش · `+p(H(t.totalMeterage)),1)])]))),128))])):y(``,!0),f(te,{open:it.value,title:at.value,size:`lg`,onClose:$},{footer:a(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:$},`انصراف`),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!Z.value||z.value,onClick:dt},[z.value?(e(),l(`span`,rt)):y(``,!0),h(` `+p(I.value===`edit`?`ثبت تغییرات`:X.appRole===`agent`?`ثبت واسطه`:`ثبت مشتری`),1)],8,nt)]),default:a(()=>[s(`form`,{class:`admin-form`,onSubmit:S(dt,[`prevent`])},[R.value?(e(),l(`p`,Ve,p(R.value),1)):y(``,!0),s(`div`,He,[i[21]||=s(`label`,{for:`customer-name`},[h(`نام مشتری `),s(`span`,{class:`admin-form__required`},`*`)],-1),o(s(`input`,{id:`customer-name`,"onUpdate:modelValue":i[3]||=e=>X.name=e,type:`text`,class:`admin-input`},null,512),[[x,X.name]])]),s(`div`,Ue,[s(`div`,We,[i[22]||=s(`label`,{for:`customer-phone`},[h(`تلفن `),s(`span`,{class:`admin-form__required`},`*`)],-1),o(s(`input`,{id:`customer-phone`,"onUpdate:modelValue":i[4]||=e=>X.phone=e,type:`tel`,class:`admin-input`,inputmode:`tel`,dir:`ltr`},null,512),[[x,X.phone]])]),s(`div`,Ge,[i[23]||=s(`label`,{for:`customer-national-id`},[h(`شناسه ملی `),s(`span`,{class:`admin-form__required`},`*`)],-1),o(s(`input`,{id:`customer-national-id`,"onUpdate:modelValue":i[5]||=e=>X.nationalId=e,type:`text`,class:`admin-input`,inputmode:`numeric`,dir:`ltr`},null,512),[[x,X.nationalId]])])]),s(`div`,Ke,[s(`div`,qe,[i[24]||=s(`label`,null,`نوع مشتری`,-1),f(j,{modelValue:X.customerType,"onUpdate:modelValue":i[6]||=e=>X.customerType=e,block:``,"aria-label":`نوع مشتری`,options:U},null,8,[`modelValue`])]),s(`div`,Je,[i[25]||=s(`label`,{for:`customer-company`},`شرکت مرتبط`,-1),o(s(`input`,{id:`customer-company`,"onUpdate:modelValue":i[7]||=e=>X.companyName=e,type:`text`,class:`admin-input`},null,512),[[x,X.companyName]])])]),s(`div`,Ye,[s(`div`,Xe,[i[26]||=s(`label`,null,`سطح`,-1),f(j,{modelValue:X.levelDefId,"onUpdate:modelValue":i[8]||=e=>X.levelDefId=e,block:``,"aria-label":`سطح مشتری`,options:q.value},null,8,[`modelValue`,`options`])]),s(`div`,Ze,[i[27]||=s(`label`,null,`واسطه`,-1),f(j,{modelValue:X.assignedAgentId,"onUpdate:modelValue":i[9]||=e=>X.assignedAgentId=e,block:``,"aria-label":`واسطه اختصاصیافته`,options:J.value},null,8,[`modelValue`,`options`])])]),s(`div`,Qe,[s(`div`,$e,[i[28]||=s(`label`,null,`نقش در اپ`,-1),f(j,{modelValue:X.appRole,"onUpdate:modelValue":i[10]||=e=>X.appRole=e,block:``,"aria-label":`نقش در اپ`,options:W},null,8,[`modelValue`])]),X.appRole===`agent`?(e(),l(`div`,et,[i[29]||=s(`label`,{for:`customer-agent-code`},`کد واسطه`,-1),o(s(`input`,{id:`customer-agent-code`,"onUpdate:modelValue":i[11]||=e=>X.agentCode=e,type:`text`,class:`admin-input`,dir:`ltr`},null,512),[[x,X.agentCode]])])):y(``,!0)]),s(`div`,tt,[f(re,{modelValue:X.isActive,"onUpdate:modelValue":i[12]||=e=>X.isActive=e,label:`وضعیت`},null,8,[`modelValue`])]),I.value===`edit`&&L.value&&X.appRole===`customer`?(e(),m(ae,{key:1,"customer-id":L.value},null,8,[`customer-id`])):y(``,!0)],32)]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-e7c35ad6`]]);export{J as default};
\ No newline at end of file
diff --git a/dist/assets/DashboardView-BgXMVCJV.js b/dist/assets/DashboardView-BgXMVCJV.js
new file mode 100644
index 0000000..809d032
--- /dev/null
+++ b/dist/assets/DashboardView-BgXMVCJV.js
@@ -0,0 +1 @@
+import{A as e,At as t,D as n,F as r,N as i,Ot as a,U as o,c as s,ct as c,d as l,et as u,g as d,h as f,jt as p,l as m,m as h,r as g,s as _,t as v,u as y}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as b,t as x}from"./http-CTjL79ty.js";import{C as S,L as C,b as w,c as T,i as E,o as D,z as O}from"./index-DxcN1-hp.js";import{t as k}from"./StatusBadge-BkaoX2rz.js";var ee={class:`sales-chart`},A={key:0,class:`sales-chart__header`},j={key:0,class:`sales-chart__title`},M={key:1,class:`sales-chart__subtitle`},N=[`viewBox`,`aria-label`],te=[`x1`,`x2`,`y1`,`y2`],P=[`points`],F=[`points`],I=[`x1`,`x2`,`y1`,`y2`],L=[`cx`,`cy`],R={class:`sales-chart__tooltip-label`},z={key:1,class:`sales-chart__axis`},B=320,V=120,H=v(d({__name:`SalesAreaChart`,props:{data:{},title:{},subtitle:{},height:{default:160},color:{default:`#091d36`},unit:{default:`میلیارد تومان`},labels:{}},setup(n){let r=n,a=u(null),o={top:12,right:8,bottom:8,left:8},d=_(()=>Math.max(...r.data,.001)),f=_(()=>{let e=B-o.left-o.right,t=V-o.top-o.bottom,n=e/Math.max(r.data.length-1,1);return r.data.map((e,r)=>({x:o.left+r*n,y:o.top+t-e/d.value*t,value:e,index:r}))}),m=_(()=>f.value.map(e=>`${e.x},${e.y}`).join(` `)),h=_(()=>{let e=V-o.bottom,t=f.value[0],n=f.value[f.value.length-1];return!t||!n?``:`${t.x},${e} ${m.value} ${n.x},${e}`}),v=_(()=>{let e=V-o.top-o.bottom;return[0,.5,1].map(t=>o.top+e*t)}),b=_(()=>a.value===null?null:f.value[a.value]??null);function x(e){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*B,r=0,i=1/0;f.value.forEach(e=>{let t=Math.abs(e.x-n);t(e(),l(`div`,ee,[n.title||n.subtitle?(e(),l(`div`,A,[s(`div`,null,[n.title?(e(),l(`h3`,j,p(n.title),1)):y(``,!0),n.subtitle?(e(),l(`p`,M,p(n.subtitle),1)):y(``,!0)])])):y(``,!0),s(`div`,{class:`sales-chart__body`,style:t({height:`${n.height}px`})},[(e(),l(`svg`,{class:`sales-chart__svg`,viewBox:`0 0 ${B} ${V}`,preserveAspectRatio:`none`,role:`img`,"aria-label":n.title||`نمودار فروش`,onMousemove:x,onMouseleave:S},[(e(!0),l(g,null,i(v.value,(t,n)=>(e(),l(`line`,{key:n,x1:o.left,x2:B-o.right,y1:t,y2:t,class:`sales-chart__grid`},null,8,te))),128)),h.value?(e(),l(`polygon`,{key:0,points:h.value,class:`sales-chart__area`,style:t({fill:`${n.color}22`})},null,12,P)):y(``,!0),s(`polyline`,{points:m.value,class:`sales-chart__line`,style:t({stroke:n.color})},null,12,F),b.value?(e(),l(g,{key:1},[s(`line`,{x1:b.value.x,x2:b.value.x,y1:o.top,y2:V-o.bottom,class:`sales-chart__cursor`},null,8,I),s(`circle`,{cx:b.value.x,cy:b.value.y,r:`4`,class:`sales-chart__dot`,style:t({fill:n.color})},null,12,L)],64)):y(``,!0)],40,N)),b.value?(e(),l(`div`,{key:0,class:`sales-chart__tooltip`,style:t({left:`${b.value.x/B*100}%`})},[s(`span`,R,p(n.labels?.[b.value.index]??`روز ${b.value.index+1}`),1),s(`strong`,null,p(c(T)(b.value.value))+` `+p(n.unit),1)],4)):y(``,!0)],4),n.labels?.length?(e(),l(`div`,z,[(e(!0),l(g,null,i(n.labels,(t,n)=>(e(),l(`span`,{key:n},p(t),1))),128))])):y(``,!0)]))}}),[[`__scopeId`,`data-v-36d15f13`]]),U={info:`var(--color-info-light)`,warning:`var(--color-warning-light)`,purple:`var(--color-purple-light)`,success:`var(--color-success-light)`},W={info:`var(--color-info)`,warning:`var(--color-warning-dark)`,purple:`var(--color-purple)`,success:`var(--color-success)`},G=()=>({newOrders:0,pendingReview:0,pendingCheck:0,finalApproval:0,todaySales:0,todaySalesGrowth:0,monthSales:0});function K(){let e=O(),t=b(),r=u(G()),i=u([]),a=u(Array.from({length:28},()=>0)),o=u([`۱`,`۷`,`۱۴`,`۲۱`,`۲۸`]),s=u([]),c=u(!1),l=_(()=>[{label:`سفارشهای جدید`,value:r.value.newOrders,icon:`cart`,tone:`info`,link:`/orders`},{label:`در انتظار بررسی`,value:r.value.pendingReview,icon:`file`,tone:`warning`,link:`/orders?tab=pending_review`},{label:`بررسی چک`,value:r.value.pendingCheck,icon:`wallet`,tone:`purple`,link:`/orders?tab=pending_check`},{label:`تأیید نهایی شده`,value:r.value.finalApproval,icon:`check-circle`,tone:`success`,link:`/orders?tab=final_approval`}]),d=_(()=>{let e=a.value;if(!e.length)return``;let t=Math.max(...e,.001),n=e.length>1?280/(e.length-1):280;return e.map((e,r)=>`${r*n},${120-e/t*110-5}`).join(` `)});async function f(){c.value=!0;try{let e=await w.get();r.value=e.stats,i.value=(e.recentOrders??[]).map(e=>S(e)),a.value=e.salesChartData?.length?e.salesChartData:Array.from({length:28},()=>0),o.value=e.chartAxisLabels?.length?e.chartAxisLabels:[`۱`,`۷`,`۱۴`,`۲۱`,`۲۸`],s.value=e.checkDeadlines??[]}catch(e){t.error(e instanceof x?e.message:`بارگذاری داشبورد انجام نشد.`)}finally{c.value=!1}}n(()=>{f()});function p(){e.push(`/orders`)}return{checkDeadlines:s,dashboardStats:r,recentOrders:i,chartPoints:d,salesChartData:a,chartAxisLabels:o,statCards:l,loading:c,goOrders:p,loadDashboard:f}}var q={class:`dashboard`},J={class:`dashboard__toolbar`},Y={type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`},X={class:`dashboard__stats`},Z={class:`admin-stat-card__label`},Q={class:`admin-stat-card__value`},ne={class:`dashboard__sales-card admin-stat-card`},re={class:`dashboard__sales-header`},ie={class:`admin-stat-card__value dashboard__sales-value`},ae={class:`dashboard__sales-growth`},oe={class:`dashboard__grid`},se={class:`dashboard__chart-card admin-card`},ce={class:`dashboard__orders-card admin-card`},le={class:`admin-table-wrap`},ue={class:`admin-table admin-table--compact`},de={class:`dashboard__card-footer`},fe={class:`dashboard__checks-card admin-card`},pe={class:`dashboard__deadline-list`},me={class:`dashboard__deadline-count`},he={class:`dashboard__deadline-amount`},ge={class:`dashboard__card-footer`},_e=v(d({__name:`DesktopDashboard`,setup(n){let{checkDeadlines:u,dashboardStats:d,recentOrders:m,salesChartData:_,chartAxisLabels:v,goOrders:y,statCards:b}=K();return(n,x)=>{let S=r(`RouterLink`);return e(),l(`div`,q,[s(`div`,J,[s(`button`,Y,[f(C,{name:`calendar`,size:16}),x[1]||=h(` امروز `,-1)])]),s(`div`,X,[(e(!0),l(g,null,i(c(b),n=>(e(),l(`div`,{key:n.label,class:`admin-stat-card`},[s(`div`,{class:`admin-stat-card__icon`,style:t({background:c(U)[n.tone],color:c(W)[n.tone]})},[f(C,{name:n.icon,size:20},null,8,[`name`])],4),s(`p`,Z,p(n.label),1),s(`p`,Q,p(n.value),1),f(S,{to:n.link,class:`admin-stat-card__link`},{default:o(()=>[...x[2]||=[h(`مشاهده سفارشها`,-1)]]),_:1},8,[`to`])]))),128)),s(`div`,ne,[s(`div`,re,[s(`div`,null,[x[3]||=s(`p`,{class:`admin-stat-card__label`},`فروش امروز`,-1),s(`p`,ie,p(c(E)(c(d).todaySales)),1),s(`span`,ae,` +`+p(c(d).todaySalesGrowth)+`% نسبت به دیروز `,1)]),f(C,{name:`calendar`,size:20,class:`dashboard__sales-icon`})]),x[4]||=s(`svg`,{class:`dashboard__sparkline`,viewBox:`0 0 120 32`,preserveAspectRatio:`none`},[s(`polyline`,{fill:`none`,stroke:`#159660`,"stroke-width":`2`,points:`0,24 20,18 40,22 60,12 80,16 100,8 120,14`})],-1)])]),s(`div`,oe,[s(`div`,se,[f(H,{title:`فروش ماه جاری`,subtitle:c(E)(c(d).monthSales),data:c(_),labels:c(v),unit:`میلیارد`,height:168},null,8,[`subtitle`,`data`,`labels`])]),s(`div`,ce,[x[7]||=s(`div`,{class:`dashboard__card-header`},[s(`h2`,{class:`dashboard__card-title`},`سفارشهای اخیر`)],-1),s(`div`,le,[s(`table`,ue,[x[5]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`شماره سفارش`),s(`th`,null,`مشتری`),s(`th`,null,`شرکت`),s(`th`,null,`وضعیت`),s(`th`,null,`تاریخ ثبت`)])],-1),s(`tbody`,null,[(e(!0),l(g,null,i(c(m),t=>(e(),l(`tr`,{key:t.id},[s(`td`,null,p(t.orderNumber),1),s(`td`,null,p(t.customerName),1),s(`td`,null,p(t.companyName),1),s(`td`,null,[f(k,{status:t.status},null,8,[`status`])]),s(`td`,null,p(c(D)(t.createdAt)),1)]))),128))])])]),s(`div`,de,[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:x[0]||=(...e)=>c(y)&&c(y)(...e)},[x[6]||=h(` مشاهده همه سفارشها `,-1),f(C,{name:`chevron-left`,size:16})])])]),s(`div`,fe,[x[9]||=s(`div`,{class:`dashboard__card-header`},[s(`h2`,{class:`dashboard__card-title`},`سررسید چکها`)],-1),s(`ul`,pe,[(e(!0),l(g,null,i(c(u),t=>(e(),l(`li`,{key:t.id,class:`dashboard__deadline-item`},[s(`span`,{class:a([`admin-badge`,{"admin-badge--danger":t.tone===`danger`,"admin-badge--warning":t.tone===`warning`,"admin-badge--neutral":t.tone===`neutral`}])},p(t.label),3),s(`span`,me,p(t.count)+` فقره`,1),s(`span`,he,p(c(E)(t.amount)),1)]))),128))]),s(`div`,ge,[f(S,{to:`/checks`,class:`admin-btn admin-btn--outline admin-btn--sm`},{default:o(()=>[x[8]||=h(` مشاهده همه `,-1),f(C,{name:`chevron-left`,size:16})]),_:1})])])])])}}}),[[`__scopeId`,`data-v-bf2ebdae`]]),ve={class:`compact-dashboard page-shell`},ye={class:`flex justify-end mb-3`},be={type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`},xe={class:`compact-stats-grid`},Se={class:`admin-stat-card__label`},Ce={class:`admin-stat-card__value`},we={class:`admin-stat-card col-span-full`},$={class:`admin-stat-card__value`},Te={class:`text-xs font-semibold text-success`},Ee={class:`compact-section-grid`},De={class:`compact-section-card admin-panel`},Oe={class:`compact-section-card admin-panel`},ke={class:`admin-card-list`},Ae={class:`admin-card-item__header`},je={class:`admin-card-item__title`},Me={class:`admin-card-item__meta`},Ne={class:`compact-section-card admin-panel`},Pe={class:`m-0 p-0 list-none flex flex-col gap-2.5`},Fe={class:`mr-auto text-xs`},Ie=d({__name:`CompactDashboard`,setup(n){let{checkDeadlines:u,dashboardStats:d,recentOrders:_,salesChartData:v,chartAxisLabels:y,goOrders:b,statCards:x}=K();return(n,S)=>{let w=r(`RouterLink`);return e(),l(`div`,ve,[s(`div`,ye,[s(`button`,be,[f(C,{name:`calendar`,size:16}),S[1]||=h(` امروز `,-1)])]),s(`div`,xe,[(e(!0),l(g,null,i(c(x),n=>(e(),l(`div`,{key:n.label,class:`admin-stat-card`},[s(`div`,{class:`admin-stat-card__icon`,style:t({background:c(U)[n.tone],color:c(W)[n.tone]})},[f(C,{name:n.icon,size:20},null,8,[`name`])],4),s(`p`,Se,p(n.label),1),s(`p`,Ce,p(n.value),1),f(w,{to:n.link,class:`admin-stat-card__link`},{default:o(()=>[...S[2]||=[h(`مشاهده`,-1)]]),_:1},8,[`to`])]))),128)),s(`div`,we,[S[3]||=s(`p`,{class:`admin-stat-card__label`},`فروش امروز`,-1),s(`p`,$,p(c(E)(c(d).todaySales)),1),s(`span`,Te,` +`+p(c(d).todaySalesGrowth)+`% نسبت به دیروز `,1)])]),s(`div`,Ee,[s(`section`,De,[f(H,{title:`فروش ماه جاری`,subtitle:c(E)(c(d).monthSales),data:c(v),labels:c(y),unit:`میلیارد`,height:140},null,8,[`subtitle`,`data`,`labels`])]),s(`section`,Oe,[S[5]||=s(`h2`,{class:`compact-section-card__title`},`سفارشهای اخیر`,-1),s(`div`,ke,[(e(!0),l(g,null,i(c(_),t=>(e(),m(w,{key:t.id,to:`/orders`,class:`admin-card-item block no-underline text-inherit`},{default:o(()=>[s(`div`,Ae,[s(`p`,je,p(t.orderNumber),1),f(k,{status:t.status},null,8,[`status`])]),s(`div`,Me,[s(`span`,null,p(t.customerName),1),s(`span`,null,p(c(D)(t.createdAt)),1)])]),_:2},1024))),128))]),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm inline-flex mt-3`,onClick:S[0]||=(...e)=>c(b)&&c(b)(...e)},[S[4]||=h(` مشاهده همه سفارشها `,-1),f(C,{name:`chevron-left`,size:16})])]),s(`section`,Ne,[S[7]||=s(`h2`,{class:`compact-section-card__title`},`سررسید چکها`,-1),s(`ul`,Pe,[(e(!0),l(g,null,i(c(u),t=>(e(),l(`li`,{key:t.id,class:`flex flex-wrap items-center gap-2 text-sm`},[s(`span`,{class:a([`admin-badge`,{"admin-badge--danger":t.tone===`danger`,"admin-badge--warning":t.tone===`warning`,"admin-badge--neutral":t.tone===`neutral`}])},p(t.label),3),s(`span`,null,p(t.count)+` فقره`,1),s(`strong`,Fe,p(c(E)(t.amount)),1)]))),128))]),f(w,{to:`/checks`,class:`admin-btn admin-btn--outline admin-btn--sm inline-flex mt-3 no-underline`},{default:o(()=>[S[6]||=h(` مشاهده همه `,-1),f(C,{name:`chevron-left`,size:16})]),_:1})])])])}}}),Le=d({__name:`DashboardView`,setup(t){return(t,n)=>(e(),l(g,null,[f(_e,{class:`desktop-only`}),f(Ie,{class:`compact-only`})],64))}});export{Le as default};
\ No newline at end of file
diff --git a/dist/assets/DashboardView-Dd0CgoV5.js b/dist/assets/DashboardView-Dd0CgoV5.js
deleted file mode 100644
index ba9e2a9..0000000
--- a/dist/assets/DashboardView-Dd0CgoV5.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,Dt as n,E as r,H as i,M as a,P as o,c as s,d as c,g as l,h as u,k as d,kt as f,l as p,m,r as h,s as g,st as _,t as v,u as y}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as b,t as x}from"./http-BjLkjdQu.js";import{I as S,R as C,S as w,c as T,i as E,o as D,y as O}from"./index-SWzbcuqQ.js";import{t as k}from"./StatusBadge-jGFZVW4C.js";var ee={class:`sales-chart`},A={key:0,class:`sales-chart__header`},j={key:0,class:`sales-chart__title`},M={key:1,class:`sales-chart__subtitle`},N=[`viewBox`,`aria-label`],te=[`x1`,`x2`,`y1`,`y2`],P=[`points`],F=[`points`],I=[`x1`,`x2`,`y1`,`y2`],L=[`cx`,`cy`],R={class:`sales-chart__tooltip-label`},z={key:1,class:`sales-chart__axis`},B=320,V=120,H=v(l({__name:`SalesAreaChart`,props:{data:{},title:{},subtitle:{},height:{default:160},color:{default:`#091d36`},unit:{default:`میلیارد تومان`},labels:{}},setup(n){let r=n,i=e(null),o={top:12,right:8,bottom:8,left:8},l=g(()=>Math.max(...r.data,.001)),u=g(()=>{let e=B-o.left-o.right,t=V-o.top-o.bottom,n=e/Math.max(r.data.length-1,1);return r.data.map((e,r)=>({x:o.left+r*n,y:o.top+t-e/l.value*t,value:e,index:r}))}),p=g(()=>u.value.map(e=>`${e.x},${e.y}`).join(` `)),m=g(()=>{let e=V-o.bottom,t=u.value[0],n=u.value[u.value.length-1];return!t||!n?``:`${t.x},${e} ${p.value} ${n.x},${e}`}),v=g(()=>{let e=V-o.top-o.bottom;return[0,.5,1].map(t=>o.top+e*t)}),b=g(()=>i.value===null?null:u.value[i.value]??null);function x(e){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*B,r=0,a=1/0;u.value.forEach(e=>{let t=Math.abs(e.x-n);t(d(),c(`div`,ee,[n.title||n.subtitle?(d(),c(`div`,A,[s(`div`,null,[n.title?(d(),c(`h3`,j,t(n.title),1)):y(``,!0),n.subtitle?(d(),c(`p`,M,t(n.subtitle),1)):y(``,!0)])])):y(``,!0),s(`div`,{class:`sales-chart__body`,style:f({height:`${n.height}px`})},[(d(),c(`svg`,{class:`sales-chart__svg`,viewBox:`0 0 ${B} ${V}`,preserveAspectRatio:`none`,role:`img`,"aria-label":n.title||`نمودار فروش`,onMousemove:x,onMouseleave:S},[(d(!0),c(h,null,a(v.value,(e,t)=>(d(),c(`line`,{key:t,x1:o.left,x2:B-o.right,y1:e,y2:e,class:`sales-chart__grid`},null,8,te))),128)),m.value?(d(),c(`polygon`,{key:0,points:m.value,class:`sales-chart__area`,style:f({fill:`${n.color}22`})},null,12,P)):y(``,!0),s(`polyline`,{points:p.value,class:`sales-chart__line`,style:f({stroke:n.color})},null,12,F),b.value?(d(),c(h,{key:1},[s(`line`,{x1:b.value.x,x2:b.value.x,y1:o.top,y2:V-o.bottom,class:`sales-chart__cursor`},null,8,I),s(`circle`,{cx:b.value.x,cy:b.value.y,r:`4`,class:`sales-chart__dot`,style:f({fill:n.color})},null,12,L)],64)):y(``,!0)],40,N)),b.value?(d(),c(`div`,{key:0,class:`sales-chart__tooltip`,style:f({left:`${b.value.x/B*100}%`})},[s(`span`,R,t(n.labels?.[b.value.index]??`روز ${b.value.index+1}`),1),s(`strong`,null,t(_(T)(b.value.value))+` `+t(n.unit),1)],4)):y(``,!0)],4),n.labels?.length?(d(),c(`div`,z,[(d(!0),c(h,null,a(n.labels,(e,n)=>(d(),c(`span`,{key:n},t(e),1))),128))])):y(``,!0)]))}}),[[`__scopeId`,`data-v-36d15f13`]]),U={info:`var(--color-info-light)`,warning:`var(--color-warning-light)`,purple:`var(--color-purple-light)`,success:`var(--color-success-light)`},W={info:`var(--color-info)`,warning:`var(--color-warning-dark)`,purple:`var(--color-purple)`,success:`var(--color-success)`},G=()=>({newOrders:0,pendingReview:0,pendingCheck:0,finalApproval:0,todaySales:0,todaySalesGrowth:0,monthSales:0});function K(){let t=C(),n=b(),i=e(G()),a=e([]),o=e(Array.from({length:28},()=>0)),s=e([`۱`,`۷`,`۱۴`,`۲۱`,`۲۸`]),c=e([]),l=e(!1),u=g(()=>[{label:`سفارشهای جدید`,value:i.value.newOrders,icon:`cart`,tone:`info`,link:`/orders`},{label:`در انتظار بررسی`,value:i.value.pendingReview,icon:`file`,tone:`warning`,link:`/orders?tab=pending_review`},{label:`بررسی چک`,value:i.value.pendingCheck,icon:`wallet`,tone:`purple`,link:`/orders?tab=pending_check`},{label:`تأیید نهایی شده`,value:i.value.finalApproval,icon:`check-circle`,tone:`success`,link:`/orders?tab=final_approval`}]),d=g(()=>{let e=o.value;if(!e.length)return``;let t=Math.max(...e,.001),n=e.length>1?280/(e.length-1):280;return e.map((e,r)=>`${r*n},${120-e/t*110-5}`).join(` `)});async function f(){l.value=!0;try{let e=await O.get();i.value=e.stats,a.value=(e.recentOrders??[]).map(e=>w(e)),o.value=e.salesChartData?.length?e.salesChartData:Array.from({length:28},()=>0),s.value=e.chartAxisLabels?.length?e.chartAxisLabels:[`۱`,`۷`,`۱۴`,`۲۱`,`۲۸`],c.value=e.checkDeadlines??[]}catch(e){n.error(e instanceof x?e.message:`بارگذاری داشبورد انجام نشد.`)}finally{l.value=!1}}r(()=>{f()});function p(){t.push(`/orders`)}return{checkDeadlines:c,dashboardStats:i,recentOrders:a,chartPoints:d,salesChartData:o,chartAxisLabels:s,statCards:u,loading:l,goOrders:p,loadDashboard:f}}var q={class:`dashboard`},J={class:`dashboard__toolbar`},Y={type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`},X={class:`dashboard__stats`},Z={class:`admin-stat-card__label`},Q={class:`admin-stat-card__value`},ne={class:`dashboard__sales-card admin-stat-card`},re={class:`dashboard__sales-header`},ie={class:`admin-stat-card__value dashboard__sales-value`},ae={class:`dashboard__sales-growth`},oe={class:`dashboard__grid`},se={class:`dashboard__chart-card admin-card`},ce={class:`dashboard__orders-card admin-card`},le={class:`admin-table-wrap`},ue={class:`admin-table admin-table--compact`},de={class:`dashboard__card-footer`},fe={class:`dashboard__checks-card admin-card`},pe={class:`dashboard__deadline-list`},me={class:`dashboard__deadline-count`},he={class:`dashboard__deadline-amount`},ge={class:`dashboard__card-footer`},_e=v(l({__name:`DesktopDashboard`,setup(e){let{checkDeadlines:r,dashboardStats:l,recentOrders:p,salesChartData:g,chartAxisLabels:v,goOrders:y,statCards:b}=K();return(e,x)=>{let C=o(`RouterLink`);return d(),c(`div`,q,[s(`div`,J,[s(`button`,Y,[u(S,{name:`calendar`,size:16}),x[1]||=m(` امروز `,-1)])]),s(`div`,X,[(d(!0),c(h,null,a(_(b),e=>(d(),c(`div`,{key:e.label,class:`admin-stat-card`},[s(`div`,{class:`admin-stat-card__icon`,style:f({background:_(U)[e.tone],color:_(W)[e.tone]})},[u(S,{name:e.icon,size:20},null,8,[`name`])],4),s(`p`,Z,t(e.label),1),s(`p`,Q,t(e.value),1),u(C,{to:e.link,class:`admin-stat-card__link`},{default:i(()=>[...x[2]||=[m(`مشاهده سفارشها`,-1)]]),_:1},8,[`to`])]))),128)),s(`div`,ne,[s(`div`,re,[s(`div`,null,[x[3]||=s(`p`,{class:`admin-stat-card__label`},`فروش امروز`,-1),s(`p`,ie,t(_(E)(_(l).todaySales)),1),s(`span`,ae,` +`+t(_(l).todaySalesGrowth)+`% نسبت به دیروز `,1)]),u(S,{name:`calendar`,size:20,class:`dashboard__sales-icon`})]),x[4]||=s(`svg`,{class:`dashboard__sparkline`,viewBox:`0 0 120 32`,preserveAspectRatio:`none`},[s(`polyline`,{fill:`none`,stroke:`#159660`,"stroke-width":`2`,points:`0,24 20,18 40,22 60,12 80,16 100,8 120,14`})],-1)])]),s(`div`,oe,[s(`div`,se,[u(H,{title:`فروش ماه جاری`,subtitle:_(E)(_(l).monthSales),data:_(g),labels:_(v),unit:`میلیارد`,height:168},null,8,[`subtitle`,`data`,`labels`])]),s(`div`,ce,[x[7]||=s(`div`,{class:`dashboard__card-header`},[s(`h2`,{class:`dashboard__card-title`},`سفارشهای اخیر`)],-1),s(`div`,le,[s(`table`,ue,[x[5]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`شماره سفارش`),s(`th`,null,`مشتری`),s(`th`,null,`شرکت`),s(`th`,null,`وضعیت`),s(`th`,null,`تاریخ ثبت`)])],-1),s(`tbody`,null,[(d(!0),c(h,null,a(_(p),e=>(d(),c(`tr`,{key:e.id},[s(`td`,null,t(e.orderNumber),1),s(`td`,null,t(e.customerName),1),s(`td`,null,t(e.companyName),1),s(`td`,null,[u(k,{status:e.status},null,8,[`status`])]),s(`td`,null,t(_(D)(e.createdAt)),1)]))),128))])])]),s(`div`,de,[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:x[0]||=(...e)=>_(y)&&_(y)(...e)},[x[6]||=m(` مشاهده همه سفارشها `,-1),u(S,{name:`chevron-left`,size:16})])])]),s(`div`,fe,[x[9]||=s(`div`,{class:`dashboard__card-header`},[s(`h2`,{class:`dashboard__card-title`},`سررسید چکها`)],-1),s(`ul`,pe,[(d(!0),c(h,null,a(_(r),e=>(d(),c(`li`,{key:e.id,class:`dashboard__deadline-item`},[s(`span`,{class:n([`admin-badge`,{"admin-badge--danger":e.tone===`danger`,"admin-badge--warning":e.tone===`warning`,"admin-badge--neutral":e.tone===`neutral`}])},t(e.label),3),s(`span`,me,t(e.count)+` فقره`,1),s(`span`,he,t(_(E)(e.amount)),1)]))),128))]),s(`div`,ge,[u(C,{to:`/checks`,class:`admin-btn admin-btn--outline admin-btn--sm`},{default:i(()=>[x[8]||=m(` مشاهده همه `,-1),u(S,{name:`chevron-left`,size:16})]),_:1})])])])])}}}),[[`__scopeId`,`data-v-bf2ebdae`]]),ve={class:`compact-dashboard page-shell`},ye={class:`flex justify-end mb-3`},be={type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`},xe={class:`compact-stats-grid`},Se={class:`admin-stat-card__label`},Ce={class:`admin-stat-card__value`},we={class:`admin-stat-card col-span-full`},$={class:`admin-stat-card__value`},Te={class:`text-xs font-semibold text-success`},Ee={class:`compact-section-grid`},De={class:`compact-section-card admin-panel`},Oe={class:`compact-section-card admin-panel`},ke={class:`admin-card-list`},Ae={class:`admin-card-item__header`},je={class:`admin-card-item__title`},Me={class:`admin-card-item__meta`},Ne={class:`compact-section-card admin-panel`},Pe={class:`m-0 p-0 list-none flex flex-col gap-2.5`},Fe={class:`mr-auto text-xs`},Ie=l({__name:`CompactDashboard`,setup(e){let{checkDeadlines:r,dashboardStats:l,recentOrders:g,salesChartData:v,chartAxisLabels:y,goOrders:b,statCards:x}=K();return(e,C)=>{let w=o(`RouterLink`);return d(),c(`div`,ve,[s(`div`,ye,[s(`button`,be,[u(S,{name:`calendar`,size:16}),C[1]||=m(` امروز `,-1)])]),s(`div`,xe,[(d(!0),c(h,null,a(_(x),e=>(d(),c(`div`,{key:e.label,class:`admin-stat-card`},[s(`div`,{class:`admin-stat-card__icon`,style:f({background:_(U)[e.tone],color:_(W)[e.tone]})},[u(S,{name:e.icon,size:20},null,8,[`name`])],4),s(`p`,Se,t(e.label),1),s(`p`,Ce,t(e.value),1),u(w,{to:e.link,class:`admin-stat-card__link`},{default:i(()=>[...C[2]||=[m(`مشاهده`,-1)]]),_:1},8,[`to`])]))),128)),s(`div`,we,[C[3]||=s(`p`,{class:`admin-stat-card__label`},`فروش امروز`,-1),s(`p`,$,t(_(E)(_(l).todaySales)),1),s(`span`,Te,` +`+t(_(l).todaySalesGrowth)+`% نسبت به دیروز `,1)])]),s(`div`,Ee,[s(`section`,De,[u(H,{title:`فروش ماه جاری`,subtitle:_(E)(_(l).monthSales),data:_(v),labels:_(y),unit:`میلیارد`,height:140},null,8,[`subtitle`,`data`,`labels`])]),s(`section`,Oe,[C[5]||=s(`h2`,{class:`compact-section-card__title`},`سفارشهای اخیر`,-1),s(`div`,ke,[(d(!0),c(h,null,a(_(g),e=>(d(),p(w,{key:e.id,to:`/orders`,class:`admin-card-item block no-underline text-inherit`},{default:i(()=>[s(`div`,Ae,[s(`p`,je,t(e.orderNumber),1),u(k,{status:e.status},null,8,[`status`])]),s(`div`,Me,[s(`span`,null,t(e.customerName),1),s(`span`,null,t(_(D)(e.createdAt)),1)])]),_:2},1024))),128))]),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm inline-flex mt-3`,onClick:C[0]||=(...e)=>_(b)&&_(b)(...e)},[C[4]||=m(` مشاهده همه سفارشها `,-1),u(S,{name:`chevron-left`,size:16})])]),s(`section`,Ne,[C[7]||=s(`h2`,{class:`compact-section-card__title`},`سررسید چکها`,-1),s(`ul`,Pe,[(d(!0),c(h,null,a(_(r),e=>(d(),c(`li`,{key:e.id,class:`flex flex-wrap items-center gap-2 text-sm`},[s(`span`,{class:n([`admin-badge`,{"admin-badge--danger":e.tone===`danger`,"admin-badge--warning":e.tone===`warning`,"admin-badge--neutral":e.tone===`neutral`}])},t(e.label),3),s(`span`,null,t(e.count)+` فقره`,1),s(`strong`,Fe,t(_(E)(e.amount)),1)]))),128))]),u(w,{to:`/checks`,class:`admin-btn admin-btn--outline admin-btn--sm inline-flex mt-3 no-underline`},{default:i(()=>[C[6]||=m(` مشاهده همه `,-1),u(S,{name:`chevron-left`,size:16})]),_:1})])])])}}}),Le=l({__name:`DashboardView`,setup(e){return(e,t)=>(d(),c(h,null,[u(_e,{class:`desktop-only`}),u(Ie,{class:`compact-only`})],64))}});export{Le as default};
\ No newline at end of file
diff --git a/dist/assets/InternalMessagesView-CjsukHYr.js b/dist/assets/InternalMessagesView-CjsukHYr.js
deleted file mode 100644
index cd323d1..0000000
--- a/dist/assets/InternalMessagesView-CjsukHYr.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,E as n,H as r,M as i,U as a,Z as o,c as s,d as c,g as l,h as u,k as d,l as f,m as p,r as m,s as h,st as g,t as _}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as v,f as y,t as b}from"./http-BjLkjdQu.js";import{B as x,N as S,b as C,o as w}from"./index-SWzbcuqQ.js";import{t as T}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as E}from"./BaseEmptyState-Bzvl_pTa.js";var D={class:`internal-messages-page`},O={key:2,class:`admin-card`},k={class:`admin-table`},A={class:`preview-cell`},j={dir:`ltr`,class:`link-cell`},M={class:`actions`},N=[`onClick`],P=[`onClick`],F={class:`field`},I={class:`field`},L={class:`field`},R={class:`field`},z=[`disabled`],B=_(l({__name:`InternalMessagesView`,setup(l){let _=S(),B=e([]),V=e(!0),H=e(!1),U=e(!1),W=e(null),G=v(),K=o({senderName:``,subject:``,preview:``,link:``}),q=h(()=>W.value?`ویرایش پیام داخلی`:`پیام داخلی جدید`);async function J(){V.value=!0;try{B.value=await C.list()}catch(e){G.error(e instanceof b?e.message:`بارگذاری پیامها ناموفق بود.`)}finally{V.value=!1}}function Y(){W.value=null,Object.assign(K,{senderName:_.fullName||`پشتیبانی`,subject:``,preview:``,link:``}),U.value=!0}function X(e){W.value=e.id,Object.assign(K,{senderName:e.senderName,subject:e.subject,preview:e.preview,link:e.link||``}),U.value=!0}async function Z(){if(!K.senderName.trim()||!K.subject.trim()||!K.preview.trim()){G.error(`فرستنده، موضوع و متن پیام الزامی است.`);return}H.value=!0;let e={senderName:K.senderName.trim(),subject:K.subject.trim(),preview:K.preview.trim(),link:K.link.trim()||null};try{W.value?(await C.update(W.value,e),G.success(`پیام بهروزرسانی شد.`)):(await C.create(e),G.success(`پیام برای همه اپراتورها ارسال شد.`)),U.value=!1,await J()}catch(e){G.error(e instanceof b?e.message:`ذخیره پیام ناموفق بود.`)}finally{H.value=!1}}async function Q(e){if(window.confirm(`پیام «${e.subject}» حذف شود؟`))try{await C.remove(e.id),G.success(`پیام حذف شد.`),await J()}catch(e){G.error(e instanceof b?e.message:`حذف پیام ناموفق بود.`)}}return n(()=>{J()}),(e,n)=>(d(),c(`div`,D,[s(`div`,{class:`admin-page-header`},[n[6]||=s(`div`,null,[s(`h1`,{class:`admin-page-header__title`},`پیامهای داخلی`),s(`p`,{class:`admin-page-header__sub`},` پیام برای تیم پشتیبانی در آیکن نامه بالای پنل نمایش داده میشود. با کلیک روی پیام، در صورت تعیین لینک به همان صفحه میروید. `)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:Y},`پیام جدید`)]),V.value?(d(),f(T,{key:0,variant:`table`})):B.value.length?(d(),c(`div`,O,[s(`table`,k,[n[7]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`موضوع`),s(`th`,null,`فرستنده`),s(`th`,null,`خلاصه`),s(`th`,null,`لینک`),s(`th`,null,`زمان`),s(`th`,null,`خواندهشده`),s(`th`,{class:`actions`},`عملیات`)])],-1),s(`tbody`,null,[(d(!0),c(m,null,i(B.value,e=>(d(),c(`tr`,{key:e.id},[s(`td`,null,[s(`strong`,null,t(e.subject),1)]),s(`td`,null,t(e.senderName),1),s(`td`,A,t(e.preview),1),s(`td`,j,t(e.link||`—`),1),s(`td`,null,t(g(w)(e.sentAt)),1),s(`td`,null,t(e.isRead?`بله`:`خیر`),1),s(`td`,M,[s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:t=>X(e)},` ویرایش `,8,N),s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:t=>Q(e)},` حذف `,8,P)])]))),128))])])])):(d(),f(E,{key:1,title:`پیامی ثبت نشده`,description:`اولین پیام داخلی را برای تیم ارسال کنید.`},{default:r(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:Y},` پیام جدید `)]),_:1})),u(x,{open:U.value,title:q.value,size:`md`,onClose:n[5]||=e=>U.value=!1},{footer:r(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:n[4]||=e=>U.value=!1},`انصراف`),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:H.value,onClick:Z},t(H.value?`در حال ذخیره…`:`ذخیره`),9,z)]),default:r(()=>[s(`label`,F,[n[8]||=p(` نام فرستنده `,-1),a(s(`input`,{"onUpdate:modelValue":n[0]||=e=>K.senderName=e,type:`text`,class:`admin-input`},null,512),[[y,K.senderName]])]),s(`label`,I,[n[9]||=p(` موضوع `,-1),a(s(`input`,{"onUpdate:modelValue":n[1]||=e=>K.subject=e,type:`text`,class:`admin-input`},null,512),[[y,K.subject]])]),s(`label`,L,[n[10]||=p(` متن پیام (خلاصه در لیست نامه) `,-1),a(s(`textarea`,{"onUpdate:modelValue":n[2]||=e=>K.preview=e,class:`admin-input`,rows:`4`},null,512),[[y,K.preview]])]),s(`label`,R,[n[11]||=p(` لینک (اختیاری) `,-1),a(s(`input`,{"onUpdate:modelValue":n[3]||=e=>K.link=e,type:`text`,class:`admin-input`,dir:`ltr`,placeholder:`/orders یا /settings`},null,512),[[y,K.link]])])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-413b6ea4`]]);export{B as default};
\ No newline at end of file
diff --git a/dist/assets/InternalMessagesView-DU9Dw8AF.js b/dist/assets/InternalMessagesView-DU9Dw8AF.js
new file mode 100644
index 0000000..32fae43
--- /dev/null
+++ b/dist/assets/InternalMessagesView-DU9Dw8AF.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,Q as r,U as i,W as a,c as o,ct as s,d as c,et as l,g as u,h as d,jt as f,l as p,m,r as h,s as g,t as _}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as v,d as y,t as b}from"./http-CTjL79ty.js";import{P as x,V as S,o as C,x as w}from"./index-DxcN1-hp.js";import{t as T}from"./AdminPageSkeleton-DacAHji8.js";import{t as E}from"./BaseEmptyState-BAIuUvAl.js";var D={class:`internal-messages-page`},O={key:2,class:`admin-card`},k={class:`admin-table`},A={class:`preview-cell`},j={dir:`ltr`,class:`link-cell`},M={class:`actions`},N=[`onClick`],P=[`onClick`],F={class:`field`},I={class:`field`},L={class:`field`},R={class:`field`},z=[`disabled`],B=_(u({__name:`InternalMessagesView`,setup(u){let _=x(),B=l([]),V=l(!0),H=l(!1),U=l(!1),W=l(null),G=v(),K=r({senderName:``,subject:``,preview:``,link:``}),q=g(()=>W.value?`ویرایش پیام داخلی`:`پیام داخلی جدید`);async function J(){V.value=!0;try{B.value=await w.list()}catch(e){G.error(e instanceof b?e.message:`بارگذاری پیامها ناموفق بود.`)}finally{V.value=!1}}function Y(){W.value=null,Object.assign(K,{senderName:_.fullName||`پشتیبانی`,subject:``,preview:``,link:``}),U.value=!0}function X(e){W.value=e.id,Object.assign(K,{senderName:e.senderName,subject:e.subject,preview:e.preview,link:e.link||``}),U.value=!0}async function Z(){if(!K.senderName.trim()||!K.subject.trim()||!K.preview.trim()){G.error(`فرستنده، موضوع و متن پیام الزامی است.`);return}H.value=!0;let e={senderName:K.senderName.trim(),subject:K.subject.trim(),preview:K.preview.trim(),link:K.link.trim()||null};try{W.value?(await w.update(W.value,e),G.success(`پیام بهروزرسانی شد.`)):(await w.create(e),G.success(`پیام برای همه اپراتورها ارسال شد.`)),U.value=!1,await J()}catch(e){G.error(e instanceof b?e.message:`ذخیره پیام ناموفق بود.`)}finally{H.value=!1}}async function Q(e){if(window.confirm(`پیام «${e.subject}» حذف شود؟`))try{await w.remove(e.id),G.success(`پیام حذف شد.`),await J()}catch(e){G.error(e instanceof b?e.message:`حذف پیام ناموفق بود.`)}}return t(()=>{J()}),(t,r)=>(e(),c(`div`,D,[o(`div`,{class:`admin-page-header`},[r[6]||=o(`div`,null,[o(`h1`,{class:`admin-page-header__title`},`پیامهای داخلی`),o(`p`,{class:`admin-page-header__sub`},` پیام برای تیم پشتیبانی در آیکن نامه بالای پنل نمایش داده میشود. با کلیک روی پیام، در صورت تعیین لینک به همان صفحه میروید. `)],-1),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:Y},`پیام جدید`)]),V.value?(e(),p(T,{key:0,variant:`table`})):B.value.length?(e(),c(`div`,O,[o(`table`,k,[r[7]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`موضوع`),o(`th`,null,`فرستنده`),o(`th`,null,`خلاصه`),o(`th`,null,`لینک`),o(`th`,null,`زمان`),o(`th`,null,`خواندهشده`),o(`th`,{class:`actions`},`عملیات`)])],-1),o(`tbody`,null,[(e(!0),c(h,null,n(B.value,t=>(e(),c(`tr`,{key:t.id},[o(`td`,null,[o(`strong`,null,f(t.subject),1)]),o(`td`,null,f(t.senderName),1),o(`td`,A,f(t.preview),1),o(`td`,j,f(t.link||`—`),1),o(`td`,null,f(s(C)(t.sentAt)),1),o(`td`,null,f(t.isRead?`بله`:`خیر`),1),o(`td`,M,[o(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:e=>X(t)},` ویرایش `,8,N),o(`button`,{type:`button`,class:`admin-btn admin-btn--ghost admin-btn--xs`,onClick:e=>Q(t)},` حذف `,8,P)])]))),128))])])])):(e(),p(E,{key:1,title:`پیامی ثبت نشده`,description:`اولین پیام داخلی را برای تیم ارسال کنید.`},{default:i(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:Y},` پیام جدید `)]),_:1})),d(S,{open:U.value,title:q.value,size:`md`,onClose:r[5]||=e=>U.value=!1},{footer:i(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:r[4]||=e=>U.value=!1},`انصراف`),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:H.value,onClick:Z},f(H.value?`در حال ذخیره…`:`ذخیره`),9,z)]),default:i(()=>[o(`label`,F,[r[8]||=m(` نام فرستنده `,-1),a(o(`input`,{"onUpdate:modelValue":r[0]||=e=>K.senderName=e,type:`text`,class:`admin-input`},null,512),[[y,K.senderName]])]),o(`label`,I,[r[9]||=m(` موضوع `,-1),a(o(`input`,{"onUpdate:modelValue":r[1]||=e=>K.subject=e,type:`text`,class:`admin-input`},null,512),[[y,K.subject]])]),o(`label`,L,[r[10]||=m(` متن پیام (خلاصه در لیست نامه) `,-1),a(o(`textarea`,{"onUpdate:modelValue":r[2]||=e=>K.preview=e,class:`admin-input`,rows:`4`},null,512),[[y,K.preview]])]),o(`label`,R,[r[11]||=m(` لینک (اختیاری) `,-1),a(o(`input`,{"onUpdate:modelValue":r[3]||=e=>K.link=e,type:`text`,class:`admin-input`,dir:`ltr`,placeholder:`/orders یا /settings`},null,512),[[y,K.link]])])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-413b6ea4`]]);export{B as default};
\ No newline at end of file
diff --git a/dist/assets/LevelsView-B-ACzl3p.js b/dist/assets/LevelsView-B-ACzl3p.js
deleted file mode 100644
index 3a66d60..0000000
--- a/dist/assets/LevelsView-B-ACzl3p.js
+++ /dev/null
@@ -1,3 +0,0 @@
-import{$ as e,At as t,E as n,H as r,M as i,U as a,Z as o,c as s,d as c,g as l,h as u,k as d,l as f,m as p,r as m,s as h,t as g}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as _,f as v,t as y}from"./http-BjLkjdQu.js";import{B as b,x}from"./index-SWzbcuqQ.js";import{t as S}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as C}from"./BaseEmptyState-Bzvl_pTa.js";var w={class:`admin-page`},T={key:2,class:`admin-table`},E={dir:`ltr`},D=[`onClick`],O={class:`field`},k={class:`field`},A={class:`field`},j={class:`field`},M=[`disabled`],N=g(l({__name:`LevelsView`,setup(l){let g=e([]),N=e(!0),P=e(!1),F=e(null),I=_(),L=o({code:``,label:``,sortOrder:0,benefitsText:``}),R=h(()=>F.value?`ویرایش سطح`:`سطح جدید`);function z(e){return e.split(`
-`).map(e=>e.trim()).filter(Boolean).map(e=>({title:e}))}async function B(){N.value=!0;try{g.value=await x.list()}catch(e){I.error(e instanceof y?e.message:`بارگذاری سطوح ناموفق بود`)}finally{N.value=!1}}function V(){F.value=null,Object.assign(L,{code:``,label:``,sortOrder:g.value.length+1,benefitsText:``}),P.value=!0}function H(e){F.value=e.id,Object.assign(L,{code:e.code,label:e.label,sortOrder:e.sortOrder,benefitsText:e.benefits.map(e=>e.title).join(`
-`)}),P.value=!0}async function U(){try{let e={code:L.code.trim(),label:L.label.trim(),sortOrder:L.sortOrder,benefits:z(L.benefitsText)};F.value?await x.update(F.value,e):await x.create(e),P.value=!1,I.success(`ذخیره شد`),await B()}catch(e){I.error(e instanceof y?e.message:`ذخیره ناموفق بود`)}}return n(()=>{B()}),(e,n)=>(d(),c(`div`,w,[s(`header`,{class:`admin-page__head`},[n[5]||=s(`div`,null,[s(`h1`,null,`سطوح و مزایای مشتری`),s(`p`,null,`تعریف Level داخلی CRM و مزایای هر سطح (نمایش فقط در ادمین)`)],-1),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`سطح جدید`)]),N.value?(d(),f(S,{key:0,variant:`table`})):g.value.length?(d(),c(`table`,T,[n[6]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`کد`),s(`th`,null,`عنوان`),s(`th`,null,`مزایا`),s(`th`,null,`مشتریان`),s(`th`)])],-1),s(`tbody`,null,[(d(!0),c(m,null,i(g.value,e=>(d(),c(`tr`,{key:e.id},[s(`td`,E,t(e.code),1),s(`td`,null,t(e.label),1),s(`td`,null,t(e.benefits.map(e=>e.title).join(`، `)||`—`),1),s(`td`,null,t(e.customersCount),1),s(`td`,null,[s(`button`,{type:`button`,class:`link`,onClick:t=>H(e)},`ویرایش`,8,D)])]))),128))])])):(d(),f(C,{key:1,title:`سطحی تعریف نشده`})),u(b,{open:P.value,title:R.value,onClose:n[4]||=e=>P.value=!1},{footer:r(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!L.code.trim()||!L.label.trim(),onClick:U},` ذخیره `,8,M)]),default:r(()=>[s(`label`,O,[n[7]||=p(`کد`,-1),a(s(`input`,{"onUpdate:modelValue":n[0]||=e=>L.code=e,class:`admin-input`,dir:`ltr`},null,512),[[v,L.code]])]),s(`label`,k,[n[8]||=p(`عنوان`,-1),a(s(`input`,{"onUpdate:modelValue":n[1]||=e=>L.label=e,class:`admin-input`},null,512),[[v,L.label]])]),s(`label`,A,[n[9]||=p(`ترتیب`,-1),a(s(`input`,{"onUpdate:modelValue":n[2]||=e=>L.sortOrder=e,type:`number`,class:`admin-input`},null,512),[[v,L.sortOrder,void 0,{number:!0}]])]),s(`label`,j,[n[10]||=p(` مزایا (هر خط یک مورد) `,-1),a(s(`textarea`,{"onUpdate:modelValue":n[3]||=e=>L.benefitsText=e,class:`admin-input`,rows:`4`},null,512),[[v,L.benefitsText]])])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-44c7f808`]]);export{N as default};
\ No newline at end of file
diff --git a/dist/assets/LevelsView-BqtuodSw.js b/dist/assets/LevelsView-BqtuodSw.js
new file mode 100644
index 0000000..5bd42d1
--- /dev/null
+++ b/dist/assets/LevelsView-BqtuodSw.js
@@ -0,0 +1,3 @@
+import{A as e,D as t,N as n,Q as r,U as i,W as a,c as o,d as s,et as c,g as l,h as u,jt as d,l as f,m as p,r as m,s as h,t as g}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as _,d as v,t as y}from"./http-CTjL79ty.js";import{S as b,V as x}from"./index-DxcN1-hp.js";import{t as S}from"./AdminPageSkeleton-DacAHji8.js";import{t as C}from"./BaseEmptyState-BAIuUvAl.js";var w={class:`admin-page`},T={key:2,class:`admin-table`},E={dir:`ltr`},D=[`onClick`],O={class:`field`},k={class:`field`},A={class:`field`},j={class:`field`},M=[`disabled`],N=g(l({__name:`LevelsView`,setup(l){let g=c([]),N=c(!0),P=c(!1),F=c(null),I=_(),L=r({code:``,label:``,sortOrder:0,benefitsText:``}),R=h(()=>F.value?`ویرایش سطح`:`سطح جدید`);function z(e){return e.split(`
+`).map(e=>e.trim()).filter(Boolean).map(e=>({title:e}))}async function B(){N.value=!0;try{g.value=await b.list()}catch(e){I.error(e instanceof y?e.message:`بارگذاری سطوح ناموفق بود`)}finally{N.value=!1}}function V(){F.value=null,Object.assign(L,{code:``,label:``,sortOrder:g.value.length+1,benefitsText:``}),P.value=!0}function H(e){F.value=e.id,Object.assign(L,{code:e.code,label:e.label,sortOrder:e.sortOrder,benefitsText:e.benefits.map(e=>e.title).join(`
+`)}),P.value=!0}async function U(){try{let e={code:L.code.trim(),label:L.label.trim(),sortOrder:L.sortOrder,benefits:z(L.benefitsText)};F.value?await b.update(F.value,e):await b.create(e),P.value=!1,I.success(`ذخیره شد`),await B()}catch(e){I.error(e instanceof y?e.message:`ذخیره ناموفق بود`)}}return t(()=>{B()}),(t,r)=>(e(),s(`div`,w,[o(`header`,{class:`admin-page__head`},[r[5]||=o(`div`,null,[o(`h1`,null,`سطوح و مزایای مشتری`),o(`p`,null,`تعریف Level داخلی CRM و مزایای هر سطح (نمایش فقط در ادمین)`)],-1),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,onClick:V},`سطح جدید`)]),N.value?(e(),f(S,{key:0,variant:`table`})):g.value.length?(e(),s(`table`,T,[r[6]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`کد`),o(`th`,null,`عنوان`),o(`th`,null,`مزایا`),o(`th`,null,`مشتریان`),o(`th`)])],-1),o(`tbody`,null,[(e(!0),s(m,null,n(g.value,t=>(e(),s(`tr`,{key:t.id},[o(`td`,E,d(t.code),1),o(`td`,null,d(t.label),1),o(`td`,null,d(t.benefits.map(e=>e.title).join(`، `)||`—`),1),o(`td`,null,d(t.customersCount),1),o(`td`,null,[o(`button`,{type:`button`,class:`link`,onClick:e=>H(t)},`ویرایش`,8,D)])]))),128))])])):(e(),f(C,{key:1,title:`سطحی تعریف نشده`})),u(x,{open:P.value,title:R.value,onClose:r[4]||=e=>P.value=!1},{footer:i(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!L.code.trim()||!L.label.trim(),onClick:U},` ذخیره `,8,M)]),default:i(()=>[o(`label`,O,[r[7]||=p(`کد`,-1),a(o(`input`,{"onUpdate:modelValue":r[0]||=e=>L.code=e,class:`admin-input`,dir:`ltr`},null,512),[[v,L.code]])]),o(`label`,k,[r[8]||=p(`عنوان`,-1),a(o(`input`,{"onUpdate:modelValue":r[1]||=e=>L.label=e,class:`admin-input`},null,512),[[v,L.label]])]),o(`label`,A,[r[9]||=p(`ترتیب`,-1),a(o(`input`,{"onUpdate:modelValue":r[2]||=e=>L.sortOrder=e,type:`number`,class:`admin-input`},null,512),[[v,L.sortOrder,void 0,{number:!0}]])]),o(`label`,j,[r[10]||=p(` مزایا (هر خط یک مورد) `,-1),a(o(`textarea`,{"onUpdate:modelValue":r[3]||=e=>L.benefitsText=e,class:`admin-input`,rows:`4`},null,512),[[v,L.benefitsText]])])]),_:1},8,[`open`,`title`])]))}}),[[`__scopeId`,`data-v-44c7f808`]]);export{N as default};
\ No newline at end of file
diff --git a/dist/assets/LoginView-C_qAsslY.js b/dist/assets/LoginView-C_qAsslY.js
new file mode 100644
index 0000000..6870d1c
--- /dev/null
+++ b/dist/assets/LoginView-C_qAsslY.js
@@ -0,0 +1 @@
+import{A as e,W as t,c as n,ct as r,d as i,et as a,g as o,h as s,jt as c,m as l,s as u,t as d,u as f}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as p,d as m,l as h,m as g,u as _}from"./http-CTjL79ty.js";import{F as v,I as y,L as b,P as x,R as S,z as C}from"./index-DxcN1-hp.js";var w={class:`login-page`},T={class:`login-page__form-wrap`},E={class:`login-page__card admin-card`},D={class:`login-page__header`},O={key:0,class:`login-page__mock-hint`},k={dir:`ltr`},A={dir:`ltr`},j={key:0,class:`admin-form__error`,role:`alert`},M={class:`admin-form__field`},N={class:`login-page__input-wrap`},P={class:`login-page__field-icon`,"aria-hidden":`true`},F={class:`admin-form__field`},I={class:`login-page__input-wrap login-page__input-wrap--password`},L={class:`login-page__field-icon`,"aria-hidden":`true`},R=[`type`],z=[`aria-label`],B={class:`login-page__remember`},V=[`disabled`],H={key:0,class:`admin-btn__spinner`,"aria-hidden":`true`},U=d(o({__name:`LoginView`,setup(o){let d=C(),U=S(),W=x(),G=p(),K=a(y()?v.phone:``),q=a(y()?v.password:``),J=a(!0),Y=a(!1),X=y(),Z=u(()=>K.value.trim().length>0&&q.value.length>0);function Q(e){return e.replace(/[۰-۹]/g,e=>String(`۰۱۲۳۴۵۶۷۸۹`.indexOf(e))).replace(/[٠-٩]/g,e=>String(`٠١٢٣٤٥٦٧٨٩`.indexOf(e)))}async function $(){if(!Z.value){W.error=`لطفاً شماره موبایل و رمز عبور را وارد کنید.`;return}if(!await W.login(Q(K.value.trim()),q.value,J.value))return;G.success(`خوش آمدید، ${W.fullName}`);let e=typeof U.query.redirect==`string`?U.query.redirect:`/`,t=`/admin/`.replace(/\/$/,``),n=e.startsWith(t)?e.slice(t.length)||`/`:e;await d.replace(n)}return(a,o)=>(e(),i(`div`,w,[n(`div`,T,[n(`div`,E,[n(`div`,D,[o[8]||=n(`h2`,{class:`login-page__title`},`ورود به پنل مدیریت`,-1),o[9]||=n(`p`,{class:`login-page__subtitle`},`برای ادامه، اطلاعات حساب کاربری خود را وارد کنید.`,-1),r(X)?(e(),i(`p`,O,[o[6]||=l(` حالت موک فعال است — `,-1),n(`span`,k,c(r(v).phone),1),o[7]||=l(` / `,-1),n(`span`,A,c(r(v).password),1)])):f(``,!0)]),n(`form`,{class:`admin-form login-page__form`,onSubmit:g($,[`prevent`])},[r(W).error?(e(),i(`p`,j,c(r(W).error),1)):f(``,!0),n(`div`,M,[o[10]||=n(`label`,{for:`login-phone`},`شماره موبایل`,-1),n(`div`,N,[n(`span`,P,[s(b,{name:`phone`,size:18})]),t(n(`input`,{id:`login-phone`,"onUpdate:modelValue":o[0]||=e=>K.value=e,type:`tel`,class:`admin-input login-page__input`,placeholder:`۰۹۱۲۱۱۱۱۲۲۲۲`,autocomplete:`username`,inputmode:`tel`,dir:`ltr`,onInput:o[1]||=e=>r(W).clearError()},null,544),[[m,K.value]])])]),n(`div`,F,[o[11]||=n(`label`,{for:`login-password`},`رمز عبور`,-1),n(`div`,I,[n(`span`,L,[s(b,{name:`lock`,size:18})]),t(n(`input`,{id:`login-password`,"onUpdate:modelValue":o[2]||=e=>q.value=e,type:Y.value?`text`:`password`,class:`admin-input login-page__input login-page__input--with-toggle`,placeholder:`رمز عبور`,autocomplete:`current-password`,onInput:o[3]||=e=>r(W).clearError()},null,40,R),[[_,q.value]]),n(`button`,{type:`button`,class:`login-page__toggle-password`,"aria-label":Y.value?`پنهان کردن رمز`:`نمایش رمز`,onClick:o[4]||=e=>Y.value=!Y.value},[s(b,{name:Y.value?`eye-off`:`eye`,size:18},null,8,[`name`])],8,z)])]),n(`label`,B,[t(n(`input`,{"onUpdate:modelValue":o[5]||=e=>J.value=e,type:`checkbox`},null,512),[[h,J.value]]),o[12]||=n(`span`,null,`مرا به خاطر بسپار`,-1)]),n(`button`,{type:`submit`,class:`admin-btn admin-btn--primary login-page__submit`,disabled:!Z.value||r(W).loading},[r(W).loading?(e(),i(`span`,H)):f(``,!0),o[13]||=l(` ورود به پنل `,-1)],8,V)],32)])]),n(`div`,{class:`login-page__brand`},[n(`div`,{class:`login-page__brand-inner`},[n(`img`,{src:`/admin/brand-logo.png`,alt:`نادمی تکس`,class:`login-page__brand-logo`}),o[14]||=n(`p`,{class:`login-page__brand-badge`},`پارچه`,-1),o[15]||=n(`h1`,{class:`login-page__brand-title`},`پنل مدیریت سفارشهای عمده`,-1),o[16]||=n(`p`,{class:`login-page__brand-text`},` مدیریت سفارشها، مشتریان، قیمتگذاری، چکها و گزارشهای فروش در یک محیط یکپارچه. `,-1)])])]))}}),[[`__scopeId`,`data-v-df8d196a`]]);export{U as default};
\ No newline at end of file
diff --git a/dist/assets/LoginView-Z5zCxTv8.js b/dist/assets/LoginView-Z5zCxTv8.js
deleted file mode 100644
index f1e3152..0000000
--- a/dist/assets/LoginView-Z5zCxTv8.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,U as n,c as r,d as i,g as a,h as o,k as s,m as c,s as l,st as u,t as d,u as f}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as p,f as m,l as h,m as g,u as _}from"./http-BjLkjdQu.js";import{F as v,I as y,L as b,N as x,P as S,R as C}from"./index-SWzbcuqQ.js";var w={class:`login-page`},T={class:`login-page__form-wrap`},E={class:`login-page__card admin-card`},D={class:`login-page__header`},O={key:0,class:`login-page__mock-hint`},k={dir:`ltr`},A={dir:`ltr`},j={key:0,class:`admin-form__error`,role:`alert`},M={class:`admin-form__field`},N={class:`login-page__input-wrap`},P={class:`login-page__field-icon`,"aria-hidden":`true`},F={class:`admin-form__field`},I={class:`login-page__input-wrap login-page__input-wrap--password`},L={class:`login-page__field-icon`,"aria-hidden":`true`},R=[`type`],z=[`aria-label`],B={class:`login-page__remember`},V=[`disabled`],H={key:0,class:`admin-btn__spinner`,"aria-hidden":`true`},U=d(a({__name:`LoginView`,setup(a){let d=C(),U=b(),W=x(),G=p(),K=e(v()?S.phone:``),q=e(v()?S.password:``),J=e(!0),Y=e(!1),X=v(),Z=l(()=>K.value.trim().length>0&&q.value.length>0);function Q(e){return e.replace(/[۰-۹]/g,e=>String(`۰۱۲۳۴۵۶۷۸۹`.indexOf(e))).replace(/[٠-٩]/g,e=>String(`٠١٢٣٤٥٦٧٨٩`.indexOf(e)))}async function $(){if(!Z.value){W.error=`لطفاً شماره موبایل و رمز عبور را وارد کنید.`;return}if(!await W.login(Q(K.value.trim()),q.value,J.value))return;G.success(`خوش آمدید، ${W.fullName}`);let e=typeof U.query.redirect==`string`?U.query.redirect:`/`,t=`/admin/`.replace(/\/$/,``),n=e.startsWith(t)?e.slice(t.length)||`/`:e;await d.replace(n)}return(e,a)=>(s(),i(`div`,w,[r(`div`,T,[r(`div`,E,[r(`div`,D,[a[8]||=r(`h2`,{class:`login-page__title`},`ورود به پنل مدیریت`,-1),a[9]||=r(`p`,{class:`login-page__subtitle`},`برای ادامه، اطلاعات حساب کاربری خود را وارد کنید.`,-1),u(X)?(s(),i(`p`,O,[a[6]||=c(` حالت موک فعال است — `,-1),r(`span`,k,t(u(S).phone),1),a[7]||=c(` / `,-1),r(`span`,A,t(u(S).password),1)])):f(``,!0)]),r(`form`,{class:`admin-form login-page__form`,onSubmit:g($,[`prevent`])},[u(W).error?(s(),i(`p`,j,t(u(W).error),1)):f(``,!0),r(`div`,M,[a[10]||=r(`label`,{for:`login-phone`},`شماره موبایل`,-1),r(`div`,N,[r(`span`,P,[o(y,{name:`phone`,size:18})]),n(r(`input`,{id:`login-phone`,"onUpdate:modelValue":a[0]||=e=>K.value=e,type:`tel`,class:`admin-input login-page__input`,placeholder:`۰۹۱۲۱۱۱۱۲۲۲۲`,autocomplete:`username`,inputmode:`tel`,dir:`ltr`,onInput:a[1]||=e=>u(W).clearError()},null,544),[[m,K.value]])])]),r(`div`,F,[a[11]||=r(`label`,{for:`login-password`},`رمز عبور`,-1),r(`div`,I,[r(`span`,L,[o(y,{name:`lock`,size:18})]),n(r(`input`,{id:`login-password`,"onUpdate:modelValue":a[2]||=e=>q.value=e,type:Y.value?`text`:`password`,class:`admin-input login-page__input login-page__input--with-toggle`,placeholder:`رمز عبور`,autocomplete:`current-password`,onInput:a[3]||=e=>u(W).clearError()},null,40,R),[[_,q.value]]),r(`button`,{type:`button`,class:`login-page__toggle-password`,"aria-label":Y.value?`پنهان کردن رمز`:`نمایش رمز`,onClick:a[4]||=e=>Y.value=!Y.value},[o(y,{name:Y.value?`eye-off`:`eye`,size:18},null,8,[`name`])],8,z)])]),r(`label`,B,[n(r(`input`,{"onUpdate:modelValue":a[5]||=e=>J.value=e,type:`checkbox`},null,512),[[h,J.value]]),a[12]||=r(`span`,null,`مرا به خاطر بسپار`,-1)]),r(`button`,{type:`submit`,class:`admin-btn admin-btn--primary login-page__submit`,disabled:!Z.value||u(W).loading},[u(W).loading?(s(),i(`span`,H)):f(``,!0),a[13]||=c(` ورود به پنل `,-1)],8,V)],32)])]),r(`div`,{class:`login-page__brand`},[r(`div`,{class:`login-page__brand-inner`},[r(`img`,{src:`/admin/brand-logo.png`,alt:`نادمی تکس`,class:`login-page__brand-logo`}),a[14]||=r(`p`,{class:`login-page__brand-badge`},`پارچه`,-1),a[15]||=r(`h1`,{class:`login-page__brand-title`},`پنل مدیریت سفارشهای عمده`,-1),a[16]||=r(`p`,{class:`login-page__brand-text`},` مدیریت سفارشها، مشتریان، قیمتگذاری، چکها و گزارشهای فروش در یک محیط یکپارچه. `,-1)])])]))}}),[[`__scopeId`,`data-v-df8d196a`]]);export{U as default};
\ No newline at end of file
diff --git a/dist/assets/NotFoundView-DBzokouR.js b/dist/assets/NotFoundView-DBzokouR.js
deleted file mode 100644
index cb345bd..0000000
--- a/dist/assets/NotFoundView-DBzokouR.js
+++ /dev/null
@@ -1 +0,0 @@
-import{H as e,P as t,c as n,d as r,h as i,k as a,m as o,t as s}from"./_plugin-vue_export-helper-QrIvvHC8.js";var c={},l={class:`not-found`};function u(s,c){let u=t(`RouterLink`);return a(),r(`main`,l,[c[1]||=n(`p`,{class:`not-found__code`},`404`,-1),c[2]||=n(`h1`,null,`صفحه پیدا نشد`,-1),c[3]||=n(`p`,null,`آدرسی که وارد کردهاید وجود ندارد.`,-1),i(u,{to:`/`},{default:e(()=>[...c[0]||=[o(`بازگشت به داشبورد`,-1)]]),_:1})])}var d=s(c,[[`render`,u],[`__scopeId`,`data-v-1c91077f`]]);export{d as default};
\ No newline at end of file
diff --git a/dist/assets/NotFoundView-fVAjwM_0.js b/dist/assets/NotFoundView-fVAjwM_0.js
new file mode 100644
index 0000000..a9ad1e7
--- /dev/null
+++ b/dist/assets/NotFoundView-fVAjwM_0.js
@@ -0,0 +1 @@
+import{A as e,F as t,U as n,c as r,d as i,h as a,m as o,t as s}from"./_plugin-vue_export-helper-vx-p5QAT.js";var c={},l={class:`not-found`};function u(s,c){let u=t(`RouterLink`);return e(),i(`main`,l,[c[1]||=r(`p`,{class:`not-found__code`},`404`,-1),c[2]||=r(`h1`,null,`صفحه پیدا نشد`,-1),c[3]||=r(`p`,null,`آدرسی که وارد کردهاید وجود ندارد.`,-1),a(u,{to:`/`},{default:n(()=>[...c[0]||=[o(`بازگشت به داشبورد`,-1)]]),_:1})])}var d=s(c,[[`render`,u],[`__scopeId`,`data-v-1c91077f`]]);export{d as default};
\ No newline at end of file
diff --git a/dist/assets/OrderPricingView-Ba_MCwwk.js b/dist/assets/OrderPricingView-Ba_MCwwk.js
deleted file mode 100644
index ef4f61d..0000000
--- a/dist/assets/OrderPricingView-Ba_MCwwk.js
+++ /dev/null
@@ -1 +0,0 @@
-import{$ as e,At as t,B as n,E as r,H as i,M as a,U as o,Z as ee,c as s,d as c,g as te,h as l,k as u,l as ne,m as d,r as f,s as p,st as m,t as h,u as g}from"./_plugin-vue_export-helper-QrIvvHC8.js";import{a as re,f as _,m as ie,t as v}from"./http-BjLkjdQu.js";import{B as ae,I as y,L as oe,R as se,S as ce,T as le,c as b,i as x,w as S,z as C}from"./index-SWzbcuqQ.js";import{t as ue}from"./AdminPageSkeleton-oWhHYjl4.js";import{t as de}from"./AdminSelect-6a7SFr9x.js";import{r as fe}from"./orderStatus-CeC05Cv4.js";import{t as pe}from"./StatusBadge-jGFZVW4C.js";import{t as w}from"./AdminCurrencyInput-BGwf-fv_.js";var me={class:`pricing-page`},he={class:`admin-page-header`},ge={class:`admin-action-group`},_e=[`disabled`],ve=[`disabled`],ye={class:`pricing-page__summary admin-card`},be={class:`pricing-page__order-meta`},xe={class:`pricing-page__order-id`},Se={class:`pricing-page__customer`},Ce={class:`admin-summary-grid`},we={class:`admin-summary-item`},Te={class:`admin-summary-item__value`},Ee={class:`admin-summary-item`},De={class:`admin-summary-item__value`},T={class:`admin-summary-item`},E={class:`admin-summary-item__value`},Oe={class:`pricing-page__table admin-card desktop-only`},ke={class:`admin-table-wrap`},Ae={class:`admin-table`},je=[`onUpdate:modelValue`],Me=[`onClick`],Ne={class:`compact-only admin-card-list pricing-page__compact-items`},Pe={class:`admin-card-item__header`},Fe={class:`admin-card-item__title`},Ie={class:`pricing-page__item-index`},Le={class:`admin-card-item__meta`},Re={key:0},ze={class:`pricing-page__compact-fields`},Be=[`onUpdate:modelValue`],Ve={key:0,class:`pricing-page__line-total`},He={class:`admin-card-item__actions`},Ue=[`onClick`],We={class:`admin-form-grid`},Ge={class:`admin-form-field`},Ke={class:`admin-form-field`},qe={class:`admin-footer-actions`},D=[`disabled`],Je=[`disabled`],Ye={class:`pricing-page__invoice-hint`},Xe={key:0,class:`admin-form__error`,role:`alert`},Ze={class:`admin-form__field`},Qe={class:`admin-form__row`},$e={class:`admin-form__field`},et={class:`admin-form__field`},tt=[`disabled`],O=h(te({__name:`OrderPricingView`,setup(te){let h=oe(),O=se(),k=re(),A=e(null),j=e([]),M=e(0),N=e(``),P=e(!1),F=e(``),I=e(!1),L=e(!1),R=e(!0),z=e([]),B=e([]),V=()=>({productId:``,requestedMeterage:50,confirmedMeterage:50}),H=ee(V()),nt=p(()=>z.value.filter(e=>e.isActive!==!1).map(e=>({value:e.id,label:`${e.name} — ${e.catalogCode} (${e.companyName})`}))),U=p(()=>H.productId.length>0&&H.requestedMeterage>0),W=p(()=>A.value?ce(A.value):null),G=p(()=>A.value?!fe.includes(A.value.status):!1),K=p(()=>!!A.value?.finalAmount&&!G.value);async function rt(){R.value=!0;try{let e=await S.get(String(h.params.id));A.value=e,j.value=(e.items??[]).map(q),M.value=e.shippingCost??0,B.value=[],z.value=await le.list({activeOnly:!0})}catch(e){k.error(e instanceof v?e.message:`بارگذاری سفارش انجام نشد.`)}finally{R.value=!1}}r(()=>{rt()});function q(e){return{id:e.id,productId:e.productId,catalogCode:e.catalogCode,productName:e.productName,color:e.color,requestedMeterage:e.requestedMeterage,confirmedMeterage:e.confirmedMeterage,supplyPrice:e.supplyPrice,totalAmount:e.totalAmount,companyId:e.companyId,companyName:e.companyName}}function it(){O.push(`/orders`)}async function J(e){let t=j.value.find(t=>t.id===e);await C({title:`حذف محصول`,message:t?`آیا از حذف «${t.productName}» از سفارش مطمئن هستید؟`:`آیا از حذف این محصول از سفارش مطمئن هستید؟`,confirmLabel:`حذف`,cancelLabel:`انصراف`,tone:`danger`})&&(e.startsWith(`new-`)||B.value.push(e),j.value=j.value.filter(t=>t.id!==e))}n(()=>H.productId,e=>{let t=z.value.find(t=>t.id===e);if(!t)return;let n=t.rollMeters||t.minMeterage||t.orderStep||50;H.requestedMeterage=n,H.confirmedMeterage=n});function Y(){Object.assign(H,V()),F.value=``,P.value=!0}function X(){P.value=!1,F.value=``}function Z(){if(!U.value){F.value=`محصول و متراژ الزامی هستند.`;return}let e=z.value.find(e=>e.id===H.productId);if(!e){F.value=`محصول انتخابشده یافت نشد.`;return}if(j.value.some(t=>t.productId===e.id||t.catalogCode===e.catalogCode&&t.productName===e.name)){F.value=`این محصول در سفارش هست.`;return}j.value.push({id:`new-${crypto.randomUUID().slice(0,8)}`,productId:e.id,catalogCode:e.catalogCode??e.productCode,productName:e.name,color:e.color||`—`,requestedMeterage:H.requestedMeterage,confirmedMeterage:H.confirmedMeterage||H.requestedMeterage,supplyPrice:e.price,totalAmount:null,companyId:A.value?.companyId,companyName:e.companyName||A.value?.companyName}),X()}async function Q(){if(A.value){if(!j.value.length){k.error(`سفارش باید حداقل یک قلم داشته باشد.`);return}I.value=!0;try{let e=await S.updatePricing(A.value.id,{items:j.value.map(e=>e.id.startsWith(`new-`)?{productId:e.productId,requestedMeterage:e.requestedMeterage,confirmedMeterage:e.confirmedMeterage??void 0,supplyPrice:e.supplyPrice??void 0}:{id:e.id,confirmedMeterage:e.confirmedMeterage??void 0,supplyPrice:e.supplyPrice??void 0}),deletedItemIds:B.value,shippingCost:M.value,note:N.value.trim()||void 0});A.value=e,j.value=(e.items??[]).map(q),B.value=[],k.success(`قیمتگذاری ذخیره شد.`)}catch(e){k.error(e instanceof v?e.message:`ذخیره قیمتگذاری انجام نشد.`)}finally{I.value=!1}}}async function $(){if(A.value){if(!A.value.finalAmount){k.error(`ابتدا قیمتگذاری را ذخیره کنید تا مبلغ فاکتور مشخص شود.`);return}if(await C({title:`ارسال فاکتور برای مشتری`,message:`فاکتور ${x(A.value.finalAmount)} برای مشتری ارسال میشود و او روش تسویه را انتخاب میکند. ادامه میدهید؟`,confirmLabel:`ارسال فاکتور`,cancelLabel:`انصراف`})){L.value=!0;try{let e=await S.updateStatus(A.value.id,{status:`awaiting_settlement`,note:N.value.trim()||void 0});A.value=e,k.success(`فاکتور برای مشتری ارسال شد.`)}catch(e){k.error(e instanceof v?e.message:`ارسال فاکتور انجام نشد.`)}finally{L.value=!1}}}}return(e,n)=>(u(),c(`div`,me,[s(`div`,he,[n[5]||=s(`div`,null,[s(`h1`,{class:`admin-page-header__title`},`قیمتگذاری سفارش`)],-1),s(`div`,ge,[s(`button`,{type:`button`,class:`admin-btn admin-btn--success admin-btn--sm`,disabled:I.value||R.value,onClick:Q},t(I.value?`در حال ذخیره…`:`ذخیره قیمتگذاری`),9,_e),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,disabled:!K.value||L.value||I.value,onClick:$},t(L.value?`در حال ارسال…`:`ارسال فاکتور برای مشتری`),9,ve),s(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,onClick:it},` بازگشت `)])]),R.value?(u(),ne(ue,{key:0,variant:`detail`})):W.value?(u(),c(f,{key:1},[s(`div`,ye,[s(`div`,be,[s(`div`,null,[s(`strong`,xe,t(W.value.orderNumber),1),s(`p`,Se,t(W.value.customerName),1),l(pe,{status:W.value.status},null,8,[`status`])])]),s(`div`,Ce,[s(`div`,we,[n[6]||=s(`p`,{class:`admin-summary-item__label`},`مجموع مبلغ`,-1),s(`p`,Te,t(W.value.totalAmount?m(x)(W.value.totalAmount):`—`),1)]),s(`div`,Ee,[n[7]||=s(`p`,{class:`admin-summary-item__label`},`هزینه حمل`,-1),s(`p`,De,t(m(x)(M.value)),1)]),s(`div`,T,[n[8]||=s(`p`,{class:`admin-summary-item__label`},`مبلغ نهایی`,-1),s(`p`,E,t(A.value?.finalAmount?m(x)(A.value.finalAmount):`—`),1)])])]),s(`div`,Oe,[s(`div`,ke,[s(`table`,Ae,[n[9]||=s(`thead`,null,[s(`tr`,null,[s(`th`,null,`ردیف`),s(`th`,null,`شرکت`),s(`th`,null,`کالیته`),s(`th`,null,`محصول`),s(`th`,null,`رنگ / نوع`),s(`th`,null,`متراژ درخواستی`),s(`th`,null,`متراژ تأیید شده`),s(`th`,null,`قیمت هر متر (تومان)`),s(`th`,null,`مبلغ کل (تومان)`),s(`th`,null,`عملیات`)])],-1),s(`tbody`,null,[(u(!0),c(f,null,a(j.value,(e,n)=>(u(),c(`tr`,{key:e.id},[s(`td`,null,t(n+1),1),s(`td`,null,t(e.companyName||A.value?.companyName||`—`),1),s(`td`,null,t(e.catalogCode),1),s(`td`,null,t(e.productName),1),s(`td`,null,t(e.color),1),s(`td`,null,t(m(b)(e.requestedMeterage)),1),s(`td`,null,[o(s(`input`,{"onUpdate:modelValue":t=>e.confirmedMeterage=t,type:`number`,class:`admin-input admin-input--sm`},null,8,je),[[_,e.confirmedMeterage,void 0,{number:!0}]])]),s(`td`,null,[l(w,{modelValue:e.supplyPrice,"onUpdate:modelValue":t=>e.supplyPrice=t,"input-class":`admin-input admin-input--sm`,placeholder:`—`},null,8,[`modelValue`,`onUpdate:modelValue`])]),s(`td`,null,t(e.totalAmount?m(x)(e.totalAmount):`—`),1),s(`td`,null,[s(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,onClick:t=>J(e.id)},` حذف `,8,Me)])]))),128))])])]),s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost pricing-page__add-btn`,onClick:Y},[l(y,{name:`products`,size:16}),n[10]||=d(` افزودن محصول `,-1)])]),s(`div`,Ne,[(u(!0),c(f,null,a(j.value,(e,r)=>(u(),c(`article`,{key:e.id,class:`admin-card-item`},[s(`div`,Pe,[s(`p`,Fe,t(e.productName),1),s(`span`,Ie,`#`+t(r+1),1)]),s(`div`,Le,[e.companyName||A.value?.companyName?(u(),c(`span`,Re,t(e.companyName||A.value?.companyName),1)):g(``,!0),s(`span`,null,`کالیته `+t(e.catalogCode),1),s(`span`,null,t(e.color),1),s(`span`,null,`درخواست: `+t(m(b)(e.requestedMeterage))+` متر`,1)]),s(`div`,ze,[s(`label`,null,[n[11]||=d(` متراژ تأیید شده `,-1),o(s(`input`,{"onUpdate:modelValue":t=>e.confirmedMeterage=t,type:`number`,class:`admin-input`},null,8,Be),[[_,e.confirmedMeterage,void 0,{number:!0}]])]),s(`label`,null,[n[12]||=d(` قیمت هر متر (تومان) `,-1),l(w,{modelValue:e.supplyPrice,"onUpdate:modelValue":t=>e.supplyPrice=t,placeholder:`—`},null,8,[`modelValue`,`onUpdate:modelValue`])]),e.totalAmount?(u(),c(`p`,Ve,` مبلغ کل: `+t(m(x)(e.totalAmount)),1)):g(``,!0)]),s(`div`,He,[s(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,onClick:t=>J(e.id)},` حذف `,8,Ue)])]))),128)),s(`button`,{type:`button`,class:`admin-btn admin-btn--ghost`,onClick:Y},[l(y,{name:`products`,size:16}),n[13]||=d(` افزودن محصول `,-1)])]),s(`div`,We,[s(`div`,Ge,[n[14]||=s(`label`,null,`هزینه حمل (تومان)`,-1),l(w,{modelValue:M.value,"onUpdate:modelValue":n[0]||=e=>M.value=e,"allow-empty":!1},null,8,[`modelValue`])]),s(`div`,Ke,[n[15]||=s(`label`,null,`توضیحات برای مشتری`,-1),o(s(`textarea`,{"onUpdate:modelValue":n[1]||=e=>N.value=e,placeholder:`توضیحات خود را وارد کنید...`},null,512),[[_,N.value]])])]),s(`div`,qe,[s(`button`,{type:`button`,class:`admin-btn admin-btn--success`,disabled:I.value,onClick:Q},t(I.value?`در حال ذخیره…`:`ذخیره قیمتگذاری`),9,D),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!K.value||L.value||I.value,onClick:$},t(L.value?`در حال ارسال…`:`ارسال فاکتور برای مشتری`),9,Je)]),s(`p`,Ye,[G.value?(u(),c(f,{key:0},[d(` فاکتور این سفارش برای مشتری ارسال شده است؛ انتخاب روش تسویه در اختیار اوست. `)],64)):K.value?(u(),c(f,{key:1},[d(` مبلغ نهایی آماده است. با ارسال فاکتور، مشتری برای انتخاب نقدی یا چک مطلع میشود. `)],64)):(u(),c(f,{key:2},[d(` ابتدا قیمت واحد اقلام و هزینه حمل را ذخیره کنید تا مبلغ نهایی فاکتور ساخته شود. `)],64))])],64)):g(``,!0),l(ae,{open:P.value,title:`افزودن محصول`,size:`lg`,onClose:X},{footer:i(()=>[s(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:X},` انصراف `),s(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!U.value,onClick:Z},` افزودن به سفارش `,8,tt)]),default:i(()=>[s(`form`,{class:`admin-form`,onSubmit:ie(Z,[`prevent`])},[F.value?(u(),c(`p`,Xe,t(F.value),1)):g(``,!0),s(`div`,Ze,[n[16]||=s(`label`,null,[d(`محصول `),s(`span`,{class:`admin-form__required`},`*`)],-1),l(de,{modelValue:H.productId,"onUpdate:modelValue":n[2]||=e=>H.productId=e,block:``,searchable:``,"aria-label":`انتخاب محصول`,placeholder:`جستجو و انتخاب محصول`,"search-placeholder":`نام، کد یا کالیته…`,options:nt.value},null,8,[`modelValue`,`options`])]),s(`div`,Qe,[s(`div`,$e,[n[17]||=s(`label`,{for:`requested-meterage`},[d(` متراژ درخواستی `),s(`span`,{class:`admin-form__required`},`*`)],-1),o(s(`input`,{id:`requested-meterage`,"onUpdate:modelValue":n[3]||=e=>H.requestedMeterage=e,type:`number`,min:`1`,class:`admin-input`},null,512),[[_,H.requestedMeterage,void 0,{number:!0}]])]),s(`div`,et,[n[18]||=s(`label`,{for:`confirmed-meterage`},`متراژ تأیید شده`,-1),o(s(`input`,{id:`confirmed-meterage`,"onUpdate:modelValue":n[4]||=e=>H.confirmedMeterage=e,type:`number`,min:`0`,class:`admin-input`},null,512),[[_,H.confirmedMeterage,void 0,{number:!0}]])])])],32)]),_:1},8,[`open`])]))}}),[[`__scopeId`,`data-v-fb0720df`]]);export{O as default};
\ No newline at end of file
diff --git a/dist/assets/OrderPricingView-CQ5yCiR0.js b/dist/assets/OrderPricingView-CQ5yCiR0.js
new file mode 100644
index 0000000..802f638
--- /dev/null
+++ b/dist/assets/OrderPricingView-CQ5yCiR0.js
@@ -0,0 +1 @@
+import{A as e,D as t,N as n,Q as r,U as i,V as ee,W as a,c as o,ct as s,d as c,et as l,g as te,h as u,jt as d,l as ne,m as f,r as p,s as m,t as h,u as g}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as re,d as _,m as ie,t as v}from"./http-CTjL79ty.js";import{B as y,C as ae,E as oe,L as b,R as se,T as x,V as ce,c as S,i as C,z as le}from"./index-DxcN1-hp.js";import{t as ue}from"./AdminPageSkeleton-DacAHji8.js";import{t as de}from"./AdminSelect-BYntBSYd.js";import{r as fe}from"./orderStatus-CeC05Cv4.js";import{t as pe}from"./StatusBadge-BkaoX2rz.js";import{t as w}from"./AdminCurrencyInput-Da4QfhWv.js";var me={class:`pricing-page`},he={class:`admin-page-header`},ge={class:`admin-action-group`},_e=[`disabled`],ve=[`disabled`],ye={class:`pricing-page__summary admin-card`},be={class:`pricing-page__order-meta`},xe={class:`pricing-page__order-id`},Se={class:`pricing-page__customer`},Ce={class:`admin-summary-grid`},we={class:`admin-summary-item`},Te={class:`admin-summary-item__value`},Ee={class:`admin-summary-item`},De={class:`admin-summary-item__value`},T={class:`admin-summary-item`},E={class:`admin-summary-item__value`},Oe={class:`pricing-page__table admin-card desktop-only`},ke={class:`admin-table-wrap`},Ae={class:`admin-table`},je=[`onUpdate:modelValue`],Me=[`onClick`],Ne={class:`compact-only admin-card-list pricing-page__compact-items`},Pe={class:`admin-card-item__header`},Fe={class:`admin-card-item__title`},Ie={class:`pricing-page__item-index`},Le={class:`admin-card-item__meta`},Re={key:0},ze={class:`pricing-page__compact-fields`},Be=[`onUpdate:modelValue`],Ve={key:0,class:`pricing-page__line-total`},He={class:`admin-card-item__actions`},Ue=[`onClick`],We={class:`admin-form-grid`},Ge={class:`admin-form-field`},Ke={class:`admin-form-field`},qe={class:`admin-footer-actions`},Je=[`disabled`],Ye=[`disabled`],D={class:`pricing-page__invoice-hint`},Xe={key:0,class:`admin-form__error`,role:`alert`},Ze={class:`admin-form__field`},Qe={class:`admin-form__row`},$e={class:`admin-form__field`},et={class:`admin-form__field`},tt=[`disabled`],O=h(te({__name:`OrderPricingView`,setup(te){let h=se(),O=le(),k=re(),A=l(null),j=l([]),M=l(0),N=l(``),P=l(!1),F=l(``),I=l(!1),L=l(!1),R=l(!0),z=l([]),B=l([]),V=()=>({productId:``,requestedMeterage:50,confirmedMeterage:50}),H=r(V()),nt=m(()=>z.value.filter(e=>e.isActive!==!1).map(e=>({value:e.id,label:`${e.name} — ${e.catalogCode} (${e.companyName})`}))),U=m(()=>H.productId.length>0&&H.requestedMeterage>0),W=m(()=>A.value?ae(A.value):null),G=m(()=>A.value?!fe.includes(A.value.status):!1),K=m(()=>!!A.value?.finalAmount&&!G.value);async function rt(){R.value=!0;try{let e=await x.get(String(h.params.id));A.value=e,j.value=(e.items??[]).map(q),M.value=e.shippingCost??0,B.value=[],z.value=await oe.list({activeOnly:!0})}catch(e){k.error(e instanceof v?e.message:`بارگذاری سفارش انجام نشد.`)}finally{R.value=!1}}t(()=>{rt()});function q(e){return{id:e.id,productId:e.productId,catalogCode:e.catalogCode,productName:e.productName,color:e.color,requestedMeterage:e.requestedMeterage,confirmedMeterage:e.confirmedMeterage,supplyPrice:e.supplyPrice,totalAmount:e.totalAmount,companyId:e.companyId,companyName:e.companyName}}function it(){O.push(`/orders`)}async function J(e){let t=j.value.find(t=>t.id===e);await y({title:`حذف محصول`,message:t?`آیا از حذف «${t.productName}» از سفارش مطمئن هستید؟`:`آیا از حذف این محصول از سفارش مطمئن هستید؟`,confirmLabel:`حذف`,cancelLabel:`انصراف`,tone:`danger`})&&(e.startsWith(`new-`)||B.value.push(e),j.value=j.value.filter(t=>t.id!==e))}ee(()=>H.productId,e=>{let t=z.value.find(t=>t.id===e);if(!t)return;let n=t.rollMeters||t.minMeterage||t.orderStep||50;H.requestedMeterage=n,H.confirmedMeterage=n});function Y(){Object.assign(H,V()),F.value=``,P.value=!0}function X(){P.value=!1,F.value=``}function Z(){if(!U.value){F.value=`محصول و متراژ الزامی هستند.`;return}let e=z.value.find(e=>e.id===H.productId);if(!e){F.value=`محصول انتخابشده یافت نشد.`;return}if(j.value.some(t=>t.productId===e.id||t.catalogCode===e.catalogCode&&t.productName===e.name)){F.value=`این محصول در سفارش هست.`;return}j.value.push({id:`new-${crypto.randomUUID().slice(0,8)}`,productId:e.id,catalogCode:e.catalogCode??e.productCode,productName:e.name,color:e.color||`—`,requestedMeterage:H.requestedMeterage,confirmedMeterage:H.confirmedMeterage||H.requestedMeterage,supplyPrice:e.price,totalAmount:null,companyId:A.value?.companyId,companyName:e.companyName||A.value?.companyName}),X()}async function Q(){if(A.value){if(!j.value.length){k.error(`سفارش باید حداقل یک قلم داشته باشد.`);return}I.value=!0;try{let e=await x.updatePricing(A.value.id,{items:j.value.map(e=>e.id.startsWith(`new-`)?{productId:e.productId,requestedMeterage:e.requestedMeterage,confirmedMeterage:e.confirmedMeterage??void 0,supplyPrice:e.supplyPrice??void 0}:{id:e.id,confirmedMeterage:e.confirmedMeterage??void 0,supplyPrice:e.supplyPrice??void 0}),deletedItemIds:B.value,shippingCost:M.value,note:N.value.trim()||void 0});A.value=e,j.value=(e.items??[]).map(q),B.value=[],k.success(`قیمتگذاری ذخیره شد.`)}catch(e){k.error(e instanceof v?e.message:`ذخیره قیمتگذاری انجام نشد.`)}finally{I.value=!1}}}async function $(){if(A.value){if(!A.value.finalAmount){k.error(`ابتدا قیمتگذاری را ذخیره کنید تا مبلغ فاکتور مشخص شود.`);return}if(await y({title:`ارسال فاکتور برای مشتری`,message:`فاکتور ${C(A.value.finalAmount)} برای مشتری ارسال میشود و او روش تسویه را انتخاب میکند. ادامه میدهید؟`,confirmLabel:`ارسال فاکتور`,cancelLabel:`انصراف`})){L.value=!0;try{let e=await x.updateStatus(A.value.id,{status:`awaiting_settlement`,note:N.value.trim()||void 0});A.value=e,k.success(`فاکتور برای مشتری ارسال شد.`)}catch(e){k.error(e instanceof v?e.message:`ارسال فاکتور انجام نشد.`)}finally{L.value=!1}}}}return(t,r)=>(e(),c(`div`,me,[o(`div`,he,[r[5]||=o(`div`,null,[o(`h1`,{class:`admin-page-header__title`},`قیمتگذاری سفارش`)],-1),o(`div`,ge,[o(`button`,{type:`button`,class:`admin-btn admin-btn--success admin-btn--sm`,disabled:I.value||R.value,onClick:Q},d(I.value?`در حال ذخیره…`:`ذخیره قیمتگذاری`),9,_e),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,disabled:!K.value||L.value||I.value,onClick:$},d(L.value?`در حال ارسال…`:`ارسال فاکتور برای مشتری`),9,ve),o(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,onClick:it},` بازگشت `)])]),R.value?(e(),ne(ue,{key:0,variant:`detail`})):W.value?(e(),c(p,{key:1},[o(`div`,ye,[o(`div`,be,[o(`div`,null,[o(`strong`,xe,d(W.value.orderNumber),1),o(`p`,Se,d(W.value.customerName),1),u(pe,{status:W.value.status},null,8,[`status`])])]),o(`div`,Ce,[o(`div`,we,[r[6]||=o(`p`,{class:`admin-summary-item__label`},`مجموع مبلغ`,-1),o(`p`,Te,d(W.value.totalAmount?s(C)(W.value.totalAmount):`—`),1)]),o(`div`,Ee,[r[7]||=o(`p`,{class:`admin-summary-item__label`},`هزینه حمل`,-1),o(`p`,De,d(s(C)(M.value)),1)]),o(`div`,T,[r[8]||=o(`p`,{class:`admin-summary-item__label`},`مبلغ نهایی`,-1),o(`p`,E,d(A.value?.finalAmount?s(C)(A.value.finalAmount):`—`),1)])])]),o(`div`,Oe,[o(`div`,ke,[o(`table`,Ae,[r[9]||=o(`thead`,null,[o(`tr`,null,[o(`th`,null,`ردیف`),o(`th`,null,`شرکت`),o(`th`,null,`کالیته`),o(`th`,null,`محصول`),o(`th`,null,`رنگ / نوع`),o(`th`,null,`متراژ درخواستی`),o(`th`,null,`متراژ تأیید شده`),o(`th`,null,`قیمت هر متر (تومان)`),o(`th`,null,`مبلغ کل (تومان)`),o(`th`,null,`عملیات`)])],-1),o(`tbody`,null,[(e(!0),c(p,null,n(j.value,(t,n)=>(e(),c(`tr`,{key:t.id},[o(`td`,null,d(n+1),1),o(`td`,null,d(t.companyName||A.value?.companyName||`—`),1),o(`td`,null,d(t.catalogCode),1),o(`td`,null,d(t.productName),1),o(`td`,null,d(t.color),1),o(`td`,null,d(s(S)(t.requestedMeterage)),1),o(`td`,null,[a(o(`input`,{"onUpdate:modelValue":e=>t.confirmedMeterage=e,type:`number`,class:`admin-input admin-input--sm`},null,8,je),[[_,t.confirmedMeterage,void 0,{number:!0}]])]),o(`td`,null,[u(w,{modelValue:t.supplyPrice,"onUpdate:modelValue":e=>t.supplyPrice=e,"input-class":`admin-input admin-input--sm`,placeholder:`—`},null,8,[`modelValue`,`onUpdate:modelValue`])]),o(`td`,null,d(t.totalAmount?s(C)(t.totalAmount):`—`),1),o(`td`,null,[o(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,onClick:e=>J(t.id)},` حذف `,8,Me)])]))),128))])])]),o(`button`,{type:`button`,class:`admin-btn admin-btn--ghost pricing-page__add-btn`,onClick:Y},[u(b,{name:`products`,size:16}),r[10]||=f(` افزودن محصول `,-1)])]),o(`div`,Ne,[(e(!0),c(p,null,n(j.value,(t,n)=>(e(),c(`article`,{key:t.id,class:`admin-card-item`},[o(`div`,Pe,[o(`p`,Fe,d(t.productName),1),o(`span`,Ie,`#`+d(n+1),1)]),o(`div`,Le,[t.companyName||A.value?.companyName?(e(),c(`span`,Re,d(t.companyName||A.value?.companyName),1)):g(``,!0),o(`span`,null,`کالیته `+d(t.catalogCode),1),o(`span`,null,d(t.color),1),o(`span`,null,`درخواست: `+d(s(S)(t.requestedMeterage))+` متر`,1)]),o(`div`,ze,[o(`label`,null,[r[11]||=f(` متراژ تأیید شده `,-1),a(o(`input`,{"onUpdate:modelValue":e=>t.confirmedMeterage=e,type:`number`,class:`admin-input`},null,8,Be),[[_,t.confirmedMeterage,void 0,{number:!0}]])]),o(`label`,null,[r[12]||=f(` قیمت هر متر (تومان) `,-1),u(w,{modelValue:t.supplyPrice,"onUpdate:modelValue":e=>t.supplyPrice=e,placeholder:`—`},null,8,[`modelValue`,`onUpdate:modelValue`])]),t.totalAmount?(e(),c(`p`,Ve,` مبلغ کل: `+d(s(C)(t.totalAmount)),1)):g(``,!0)]),o(`div`,He,[o(`button`,{type:`button`,class:`admin-btn admin-btn--outline-danger admin-btn--xs`,onClick:e=>J(t.id)},` حذف `,8,Ue)])]))),128)),o(`button`,{type:`button`,class:`admin-btn admin-btn--ghost`,onClick:Y},[u(b,{name:`products`,size:16}),r[13]||=f(` افزودن محصول `,-1)])]),o(`div`,We,[o(`div`,Ge,[r[14]||=o(`label`,null,`هزینه حمل (تومان)`,-1),u(w,{modelValue:M.value,"onUpdate:modelValue":r[0]||=e=>M.value=e,"allow-empty":!1},null,8,[`modelValue`])]),o(`div`,Ke,[r[15]||=o(`label`,null,`توضیحات برای مشتری`,-1),a(o(`textarea`,{"onUpdate:modelValue":r[1]||=e=>N.value=e,placeholder:`توضیحات خود را وارد کنید...`},null,512),[[_,N.value]])])]),o(`div`,qe,[o(`button`,{type:`button`,class:`admin-btn admin-btn--success`,disabled:I.value,onClick:Q},d(I.value?`در حال ذخیره…`:`ذخیره قیمتگذاری`),9,Je),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!K.value||L.value||I.value,onClick:$},d(L.value?`در حال ارسال…`:`ارسال فاکتور برای مشتری`),9,Ye)]),o(`p`,D,[G.value?(e(),c(p,{key:0},[f(` فاکتور این سفارش برای مشتری ارسال شده است؛ انتخاب روش تسویه در اختیار اوست. `)],64)):K.value?(e(),c(p,{key:1},[f(` مبلغ نهایی آماده است. با ارسال فاکتور، مشتری برای انتخاب نقدی یا چک مطلع میشود. `)],64)):(e(),c(p,{key:2},[f(` ابتدا قیمت واحد اقلام و هزینه حمل را ذخیره کنید تا مبلغ نهایی فاکتور ساخته شود. `)],64))])],64)):g(``,!0),u(ce,{open:P.value,title:`افزودن محصول`,size:`lg`,onClose:X},{footer:i(()=>[o(`button`,{type:`button`,class:`admin-btn admin-btn--outline`,onClick:X},` انصراف `),o(`button`,{type:`button`,class:`admin-btn admin-btn--primary`,disabled:!U.value,onClick:Z},` افزودن به سفارش `,8,tt)]),default:i(()=>[o(`form`,{class:`admin-form`,onSubmit:ie(Z,[`prevent`])},[F.value?(e(),c(`p`,Xe,d(F.value),1)):g(``,!0),o(`div`,Ze,[r[16]||=o(`label`,null,[f(`محصول `),o(`span`,{class:`admin-form__required`},`*`)],-1),u(de,{modelValue:H.productId,"onUpdate:modelValue":r[2]||=e=>H.productId=e,block:``,searchable:``,"aria-label":`انتخاب محصول`,placeholder:`جستجو و انتخاب محصول`,"search-placeholder":`نام، کد یا کالیته…`,options:nt.value},null,8,[`modelValue`,`options`])]),o(`div`,Qe,[o(`div`,$e,[r[17]||=o(`label`,{for:`requested-meterage`},[f(` متراژ درخواستی `),o(`span`,{class:`admin-form__required`},`*`)],-1),a(o(`input`,{id:`requested-meterage`,"onUpdate:modelValue":r[3]||=e=>H.requestedMeterage=e,type:`number`,min:`1`,class:`admin-input`},null,512),[[_,H.requestedMeterage,void 0,{number:!0}]])]),o(`div`,et,[r[18]||=o(`label`,{for:`confirmed-meterage`},`متراژ تأیید شده`,-1),a(o(`input`,{id:`confirmed-meterage`,"onUpdate:modelValue":r[4]||=e=>H.confirmedMeterage=e,type:`number`,min:`0`,class:`admin-input`},null,512),[[_,H.confirmedMeterage,void 0,{number:!0}]])])])],32)]),_:1},8,[`open`])]))}}),[[`__scopeId`,`data-v-fb0720df`]]);export{O as default};
\ No newline at end of file
diff --git a/dist/assets/OrdersView-DRiOmblz.js b/dist/assets/OrdersView-DRiOmblz.js
new file mode 100644
index 0000000..33a5a0e
--- /dev/null
+++ b/dist/assets/OrdersView-DRiOmblz.js
@@ -0,0 +1 @@
+import{A as e,At as t,D as n,N as r,O as i,Ot as a,Q as o,U as s,V as c,W as l,Y as u,a as d,c as f,ct as p,d as m,et as h,g,h as _,j as v,jt as y,l as b,m as x,p as S,r as C,s as w,t as T,u as E,w as D,x as O}from"./_plugin-vue_export-helper-vx-p5QAT.js";import{a as k,d as A,m as j,t as M}from"./http-CTjL79ty.js";import{C as N,D as P,E as F,L as I,N as L,R,T as z,V as B,c as V,i as H,o as ee,s as U,v as W,y as G,z as K}from"./index-DxcN1-hp.js";import{t as q}from"./AdminSelect-BYntBSYd.js";import{t as J}from"./AdminImageLightbox-BbQANbIb.js";import{i as Y,n as X}from"./adminLabels-jYlObVqa.js";import{a as te,n as Z,o as ne,s as Q,t as re}from"./orderStatus-CeC05Cv4.js";import{t as ie}from"./StatusBadge-BkaoX2rz.js";var ae=new Set([`awaiting_cash_payment`,`cash_invoice_issued`,`cash_in_progress`,`cash_payment_submitted`,`awaiting_cash_confirmation`]);function oe(e){return e?e===`check`?`چکی`:e===`cash_check`?`نقدی-چکی`:`نقدی`:`انتخابنشده`}function se(e){let t=e.settlementMethod;return t?t===`cash`?e.rawStatus!==`cash_confirmed`:t===`cash_check`&&!!e.rawStatus&&ae.has(e.rawStatus):!1}function ce(e){let t=e.settlementMethod;return t===`check`||t===`cash_check`&&!!e.rawStatus&&!ae.has(e.rawStatus)}function le(){let e=R(),t=K(),r=k(),i=h([]),a=h([]),s=new Set(Z.map(e=>e.key));function l(){let t=typeof e.query.tab==`string`?e.query.tab:``;return s.has(t)?t:`all`}let u=h([]),d=h(l()),f=h(``),p=h(``),m=h(!1),g=h(!1),_=h(!1),v=h(``),y=h(!1),b=()=>({customerId:``,customerName:``,customerPhone:``,items:[]}),x=o(b()),S=w(()=>x.customerId.length>0&&x.items.length>0),C=w(()=>{let e=[...a.value];return e.sort((e,t)=>Number(t.isActive)-Number(e.isActive)||e.name.localeCompare(t.name,`fa`)),e});function T(e){let t=a.value.find(t=>t.id===e);x.customerId=e,x.customerName=t?.name??``,x.customerPhone=t?.phone??``}async function E(){try{a.value=await G.list()}catch(e){r.error(e instanceof M?e.message:`بارگذاری مشتریان انجام نشد.`)}}let D=w(()=>{let e=u.value;if(d.value!==`all`&&(e=e.filter(e=>e.status===d.value)),p.value.trim()){let t=p.value.trim();e=e.filter(e=>e.orderNumber.includes(t)||e.customerName.includes(t))}return e}),O=w(()=>u.value.find(e=>e.id===f.value)??null);function A(e){let t=e.trim();if(t)return u.value.find(e=>e.id===t||e.orderNumber.toUpperCase()===t.toUpperCase())}async function j(){let n=typeof e.query.order==`string`?e.query.order:``;if(!n||!u.value.length)return;let r=A(n);if(!r){p.value=n;return}let i=typeof e.query.focus==`string`?e.query.focus:``;if(i===`pricing`){await t.replace(`/orders/${r.id}/pricing`);return}if(i===`checks`){await t.replace(`/orders/${r.id}/checks`);return}I(r),p.value=r.orderNumber}async function P(){try{let[e,t,n]=await Promise.all([z.list(),W.list(),G.list()]);u.value=e.map(e=>N(e)),i.value=t,a.value=n,await j()}catch(e){r.error(e instanceof M?e.message:`بارگذاری سفارشها انجام نشد.`)}}n(()=>{P()}),c(()=>[e.query.order,e.query.focus],()=>{j()}),c(()=>e.query.tab,()=>{let e=l();d.value!==e&&(d.value=e)}),c(d,n=>{let r=typeof e.query.tab==`string`?e.query.tab:`all`,i=n===`all`?void 0:n;(r===`all`?void 0:r)!==i&&t.replace({query:{...e.query,tab:i}})});function F(e,t=!1){f.value=e.id,t&&(g.value=!0)}async function I(e){f.value=e.id,_.value=!0;try{let t=N(await z.get(e.id)),n=u.value.findIndex(t=>t.id===e.id);n>=0&&(u.value[n]={...u.value[n],...t})}catch{}}function L(){g.value=!1}function B(){_.value=!1}function V(e){return oe(e)}let H=h(!1);async function ee(e){if(H.value)return null;H.value=!0;try{let t=await z.updateStatus(e.orderId,{status:e.status,note:e.note}),n=N(t),i=u.value.findIndex(t=>t.id===e.orderId);return i>=0&&(u.value[i]={...u.value[i],...n}),r.success(`وضعیت سفارش به «${Q(e.status)}» تغییر کرد.`),n}catch(e){return r.error(e instanceof M?e.message:`تغییر وضعیت انجام نشد.`),null}finally{H.value=!1}}function U(e){t.push(`/orders/${e.id}/pricing`)}function q(e){t.push(`/orders/${e.id}/checks`)}function J(e){t.push({path:`/cash-payments`,query:{order:e.orderNumber}})}function Y(){Object.assign(x,b()),v.value=``,m.value=!0,E()}function X(){m.value=!1,v.value=``}function te(e){return x.items.some(t=>t.productId===e.productId)?(v.value=`این محصول قبلاً به سفارش اضافه شده است.`,!1):(x.items.push(e),v.value=``,!0)}function ne(e){x.items=x.items.filter(t=>t.productId!==e)}async function re(){if(!S.value){v.value=`انتخاب مشتری و حداقل یک محصول الزامی است.`;return}y.value=!0;try{let e=await z.create({customerId:x.customerId||void 0,userId:x.customerId||void 0,customerName:x.customerName.trim(),customerPhone:x.customerPhone.trim()||void 0,items:x.items.map(e=>({productId:e.productId,meterage:e.meterage}))}),t=N(e);u.value.unshift(t),f.value=t.id,r.success(`سفارش جدید ثبت شد.`),X()}catch(e){r.error(e instanceof M?e.message:`ثبت سفارش انجام نشد.`)}finally{y.value=!1}}return{companies:i,customers:a,activeCustomers:C,applyCustomer:T,loadCustomers:E,orderList:u,activeTab:d,selectedOrderId:f,searchQuery:p,showAddModal:m,showDetailPanel:g,showDetailModal:_,formError:v,form:x,addFormItem:te,removeFormItem:ne,isFormValid:S,filteredOrders:D,selectedOrder:O,selectOrder:F,openOrderDetail:I,closeDetailPanel:L,closeDetailModal:B,settlementLabel:V,changeStatus:ee,statusSaving:H,goPricing:U,goChecks:q,goCashReceipt:J,openAddModal:Y,closeAddModal:X,submitAddOrder:re,saving:y}}var $=Symbol(`orders-page`);function ue(){let e=le();return v($,e),e}function de(){let e=O($);if(!e)throw Error(`Orders page context is missing`);return e}var fe={class:`order-detail__hero`},pe={class:`order-detail__hero-text`},me={class:`order-detail__id`},he={key:0,class:`order-detail__raw-status`},ge={class:`order-detail__actions no-print`},_e=[`disabled`],ve={class:`order-detail__panels`},ye={class:`order-detail__section`},be={class:`order-detail__info`},xe={class:`order-detail__info-row`},Se={class:`order-detail__info-value`},Ce={class:`order-detail__info-row`},we={class:`order-detail__info-value order-detail__info-value--phone`,dir:`ltr`},Te={class:`order-detail__info-row`},Ee={class:`order-detail__info-value`},De={class:`order-detail__info-row`},Oe={class:`order-detail__info-value`},ke={class:`order-detail__section`},Ae={class:`order-detail__info`},je={class:`order-detail__info-row`},Me={class:`order-detail__info-value`},Ne={class:`order-detail__info-row`},Pe={class:`order-detail__info-value`},Fe={class:`order-detail__info-row`},Ie={class:`order-detail__info-value`},Le={class:`order-detail__info-row`},Re={class:`order-detail__info-value`},ze={key:0,class:`order-detail__section`},Be={key:0,class:`admin-table-wrap order-detail__table`},Ve={class:`admin-table admin-table--compact`},He={key:1,class:`order-detail__items`},Ue={class:`order-detail__item-head`},We={class:`order-detail__item-meta`},Ge={key:0},Ke={key:1},qe={key:2,class:`order-detail__item-total`},Je={key:1,class:`order-detail__section`},Ye={class:`order-detail__info`},Xe={class:`order-detail__info-row`},Ze={class:`order-detail__info-value`},Qe={class:`order-detail__info-row`},$e={class:`order-detail__info-value`},et={key:0,class:`order-detail__info-row`},tt={class:`order-detail__info-value`},nt={key:1,class:`order-detail__info-row`},rt={class:`order-detail__info-value`,dir:`ltr`},it={key:2,class:`order-detail__info-row`},at={class:`order-detail__info-value`},ot={key:0,class:`order-detail__receipt`},st=[`src`],ct={key:1,class:`order-detail__status-hint`},lt={class:`order-detail__section order-detail__status no-print`},ut={key:0,class:`order-detail__status-hint`},dt={key:1,class:`order-detail__status-form`},ft={class:`admin-form__field`},pt={class:`admin-form__field`},mt=[`disabled`],ht=T(g({__name:`OrderDetailContent`,props:{order:{},settlementLabel:{},layout:{default:`compact`},statusSaving:{type:Boolean}},emits:[`pricing`,`checks`,`cashReceipt`,`finalApprove`,`status`],setup(t,{emit:n}){let i=t,o=n,s=h(``),u=h(``),d=h(!1),g=w(()=>i.order.cashReceipt??null),v=w(()=>i.order.allowedTransitions??[]),S=w(()=>[...v.value]),T=w(()=>[{value:``,label:`انتخاب کنید…`},...S.value.map(e=>({value:e,label:Q(e)}))]),D=w(()=>!!s.value),O=w(()=>i.layout===`desktop`),k=w(()=>re[i.order.status]?.label??i.order.status),j=w(()=>{let e=Q(i.order.rawStatus);return!e||e===k.value?``:e}),M=w(()=>{let e=i.order.customerType;return e?Y[e]??i.order.customerType??`—`:`—`}),N=w(()=>ne(i.order)),P=w(()=>te(i.order)),F=w(()=>ce(i.order)&&!N.value),L=w(()=>se(i.order)&&!N.value),R=w(()=>N.value?`pricing`:P.value?`final`:F.value?`checks`:L.value?`cash`:null);c(()=>i.order.id,()=>{s.value=``,u.value=``});function z(){if(!s.value||!D.value)return;let e=u.value.trim()||void 0;o(`status`,{orderId:i.order.id,status:s.value,note:e}),s.value=``,u.value=``}function B(){if(g.value?.receiptImage){d.value=!0;return}o(`cashReceipt`)}return(n,i)=>(e(),m(`div`,{class:a([`order-detail`,`order-detail--${t.layout}`])},[f(`header`,fe,[f(`div`,pe,[f(`div`,me,[f(`strong`,null,y(t.order.orderNumber),1),_(ie,{status:t.order.status},null,8,[`status`])]),j.value?(e(),m(`p`,he,y(j.value),1)):E(``,!0)]),f(`div`,ge,[N.value?(e(),m(`button`,{key:0,type:`button`,class:a([`admin-btn admin-btn--sm`,R.value===`pricing`?`admin-btn--primary`:`admin-btn--outline`]),onClick:i[0]||=e=>o(`pricing`)},` قیمتگذاری سفارش `,2)):E(``,!0),F.value?(e(),m(`button`,{key:1,type:`button`,class:a([`admin-btn admin-btn--sm`,R.value===`checks`?`admin-btn--primary`:`admin-btn--outline`]),onClick:i[1]||=e=>o(`checks`)},` مدیریت چکها `,2)):E(``,!0),L.value?(e(),m(`button`,{key:2,type:`button`,class:a([`admin-btn admin-btn--sm`,R.value===`cash`?`admin-btn--primary`:`admin-btn--outline`]),onClick:B},y(g.value?.receiptImage?`مشاهده رسید`:`رسید پرداخت`),3)):E(``,!0),P.value?(e(),m(`button`,{key:3,type:`button`,class:a([`admin-btn admin-btn--sm`,R.value===`final`?`admin-btn--primary`:`admin-btn--outline`]),disabled:t.statusSaving,onClick:i[2]||=e=>o(`finalApprove`)},` تأیید نهایی `,10,_e)):E(``,!0)])]),f(`div`,ve,[f(`section`,ye,[i[12]||=f(`h3`,{class:`order-detail__section-title`},`اطلاعات مشتری`,-1),f(`div`,be,[f(`div`,xe,[_(I,{name:`building`,size:16}),i[8]||=f(`span`,{class:`order-detail__info-label`},`مشتری`,-1),f(`span`,Se,y(t.order.customerName),1)]),f(`div`,Ce,[_(I,{name:`phone`,size:16}),i[9]||=f(`span`,{class:`order-detail__info-label`},`تلفن`,-1),f(`span`,we,y(t.order.customerPhone??`—`),1)]),f(`div`,Te,[_(I,{name:`id-card`,size:16}),i[10]||=f(`span`,{class:`order-detail__info-label`},`شناسه ملی`,-1),f(`span`,Ee,y(t.order.customerNationalId??`—`),1)]),f(`div`,De,[_(I,{name:`user`,size:16}),i[11]||=f(`span`,{class:`order-detail__info-label`},`نوع مشتری`,-1),f(`span`,Oe,y(M.value),1)])])]),f(`section`,ke,[i[17]||=f(`h3`,{class:`order-detail__section-title`},`اطلاعات سفارش`,-1),f(`div`,Ae,[f(`div`,je,[i[13]||=f(`span`,{class:`order-detail__info-label`},`شرکت`,-1),f(`span`,Me,y(t.order.companyName),1)]),f(`div`,Ne,[i[14]||=f(`span`,{class:`order-detail__info-label`},`روش تسویه`,-1),f(`span`,Pe,y(t.settlementLabel(t.order.settlementMethod)),1)]),f(`div`,Fe,[i[15]||=f(`span`,{class:`order-detail__info-label`},`متراژ کل`,-1),f(`span`,Ie,y(p(U)(t.order.meterage)),1)]),f(`div`,Le,[i[16]||=f(`span`,{class:`order-detail__info-label`},`مبلغ کل`,-1),f(`span`,Re,y(t.order.totalAmount==null?`پس از قیمتگذاری`:p(H)(t.order.totalAmount)),1)])])])]),t.order.items?.length?(e(),m(`section`,ze,[i[19]||=f(`h3`,{class:`order-detail__section-title`},`محصولات سفارش`,-1),O.value?(e(),m(`div`,Be,[f(`table`,Ve,[i[18]||=f(`thead`,null,[f(`tr`,null,[f(`th`,null,`شرکت`),f(`th`,null,`کالیته`),f(`th`,null,`محصول`),f(`th`,null,`رنگ`),f(`th`,null,`متراژ`),f(`th`,null,`قیمت هر متر`),f(`th`,null,`مبلغ کل`)])],-1),f(`tbody`,null,[(e(!0),m(C,null,r(t.order.items,n=>(e(),m(`tr`,{key:n.id},[f(`td`,null,y(n.companyName||t.order.companyName),1),f(`td`,null,y(n.catalogCode),1),f(`td`,null,y(n.productName),1),f(`td`,null,y(n.color),1),f(`td`,null,y(p(V)(n.confirmedMeterage??n.requestedMeterage)),1),f(`td`,null,y(n.supplyPrice==null?`—`:p(H)(n.supplyPrice)),1),f(`td`,null,y(n.totalAmount==null?`—`:p(H)(n.totalAmount)),1)]))),128))])])])):(e(),m(`ul`,He,[(e(!0),m(C,null,r(t.order.items,t=>(e(),m(`li`,{key:t.id,class:`order-detail__item`},[f(`div`,Ue,[f(`strong`,null,y(t.productName),1),f(`span`,null,y(t.catalogCode),1)]),f(`div`,We,[t.companyName?(e(),m(`span`,Ge,y(t.companyName),1)):E(``,!0),f(`span`,null,y(t.color),1),f(`span`,null,y(p(U)(t.confirmedMeterage??t.requestedMeterage)),1),t.supplyPrice==null?E(``,!0):(e(),m(`span`,Ke,y(p(H)(t.supplyPrice)),1)),t.totalAmount==null?E(``,!0):(e(),m(`span`,qe,y(p(H)(t.totalAmount)),1))])]))),128))]))])):E(``,!0),g.value?(e(),m(`section`,Je,[i[25]||=f(`h3`,{class:`order-detail__section-title`},`رسید پرداخت نقدی`,-1),f(`div`,Ye,[f(`div`,Xe,[i[20]||=f(`span`,{class:`order-detail__info-label`},`وضعیت`,-1),f(`span`,Ze,y(p(X)[g.value.status]),1)]),f(`div`,Qe,[i[21]||=f(`span`,{class:`order-detail__info-label`},`مبلغ واریزی`,-1),f(`span`,$e,y(g.value.paidAmount==null?p(H)(g.value.amount):p(H)(g.value.paidAmount)),1)]),g.value.transferDate?(e(),m(`div`,et,[i[22]||=f(`span`,{class:`order-detail__info-label`},`تاریخ واریز`,-1),f(`span`,tt,[x(y(p(ee)(g.value.transferDate))+` `,1),g.value.transferTime?(e(),m(C,{key:0},[x(` · `+y(g.value.transferTime),1)],64)):E(``,!0)])])):E(``,!0),g.value.trackingNumber||g.value.trackingCode?(e(),m(`div`,nt,[i[23]||=f(`span`,{class:`order-detail__info-label`},`پیگیری`,-1),f(`span`,rt,y(g.value.trackingNumber||g.value.trackingCode),1)])):E(``,!0),g.value.notes?(e(),m(`div`,it,[i[24]||=f(`span`,{class:`order-detail__info-label`},`یادداشت`,-1),f(`span`,at,y(g.value.notes),1)])):E(``,!0)]),g.value.receiptImage?(e(),m(`div`,ot,[f(`button`,{type:`button`,class:`order-detail__receipt-thumb`,onClick:i[3]||=e=>d.value=!0},[f(`img`,{src:g.value.receiptImage,alt:`تصویر رسید پرداخت`},null,8,st)]),f(`button`,{type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`,onClick:i[4]||=e=>d.value=!0},` مشاهده تصویر رسید `)])):(e(),m(`p`,ct,`تصویر رسید هنوز آپلود نشده است.`))])):E(``,!0),g.value?.receiptImage?(e(),b(J,{key:2,modelValue:d.value,"onUpdate:modelValue":i[5]||=e=>d.value=e,src:g.value.receiptImage,alt:`تصویر رسید پرداخت`},null,8,[`modelValue`,`src`])):E(``,!0),f(`section`,lt,[i[28]||=f(`h3`,{class:`order-detail__section-title`},`تغییر وضعیت`,-1),S.value.length?E(``,!0):(e(),m(`p`,ut,` در این مرحله گذر مجازی از این بخش نیست؛ از اقدامهای مرحلهای بالا (قیمتگذاری، چک، رسید نقدی و …) استفاده کنید. `)),S.value.length?(e(),m(`div`,dt,[f(`div`,ft,[i[26]||=f(`label`,null,`وضعیت بعدی`,-1),_(q,{modelValue:s.value,"onUpdate:modelValue":i[6]||=e=>s.value=e,block:``,"aria-label":`وضعیت بعدی`,placeholder:`انتخاب کنید…`,options:T.value},null,8,[`modelValue`,`options`])]),f(`div`,pt,[i[27]||=f(`label`,{for:`status-note`},`یادداشت (اختیاری)`,-1),l(f(`input`,{id:`status-note`,"onUpdate:modelValue":i[7]||=e=>u.value=e,type:`text`,class:`admin-input`,placeholder:`دلیل یا توضیح این تغییر`},null,512),[[A,u.value]])]),f(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,disabled:!D.value||t.statusSaving,onClick:z},y(t.statusSaving?`در حال ثبت…`:`ثبت وضعیت`),9,mt)])):E(``,!0)])],2))}}),[[`__scopeId`,`data-v-bef42197`]]),gt={class:`orders-page`},_t={class:`orders-page__list-panel admin-card`},vt={class:`orders-page__list-header`},yt={class:`orders-page__list-actions`},bt={type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`},xt={class:`orders-page__search`},St={class:`admin-tabs`},Ct=[`onClick`],wt={class:`admin-table-wrap`},Tt={class:`admin-table admin-table--compact`},Et=[`onClick`],Dt={class:`orders-page__actions-cell`},Ot=[`aria-expanded`,`onClick`],kt={type:`button`,class:`admin-btn admin-btn--outline admin-btn--sm`},At=T(g({__name:`DesktopOrdersPage`,setup(o){let c=L(`(min-width: 1280px)`),{activeTab:g,selectedOrderId:v,searchQuery:w,filteredOrders:T,selectedOrder:O,showDetailModal:k,openOrderDetail:M,closeDetailModal:N,settlementLabel:P,goPricing:F,goChecks:R,goCashReceipt:z,changeStatus:V,statusSaving:W,openAddModal:G}=de(),K=h(null),q=h({});function J(){K.value=null}async function Y(e,t){if(t.stopPropagation(),K.value?.id===e.id){J();return}let n=t.currentTarget.getBoundingClientRect();K.value=e,await D();let r=Math.min(Math.max(8,n.right-168),window.innerWidth-168-8);q.value={position:`fixed`,top:`${n.bottom+4}px`,left:`${r}px`,width:`168px`}}function X(){J()}n(()=>{document.addEventListener(`click`,X),window.addEventListener(`scroll`,J,!0),window.addEventListener(`resize`,J)}),i(()=>{document.removeEventListener(`click`,X),window.removeEventListener(`scroll`,J,!0),window.removeEventListener(`resize`,J)});function Q(){O.value&&(N(),F(O.value))}function re(){O.value&&(N(),R(O.value))}function ae(){O.value&&(N(),z(O.value))}function oe(){O.value&&V({orderId:O.value.id,status:`final_approved`,note:`تأیید نهایی سفارش`})}function le(){if(!O.value)return;document.documentElement.classList.add(`printing-order-detail`);let e=()=>{document.documentElement.classList.remove(`printing-order-detail`),window.removeEventListener(`afterprint`,e)};window.addEventListener(`afterprint`,e),window.setTimeout(e,6e4),window.print()}function $(e){let t=K.value;if(t){if(J(),e===`detail`){M(t);return}if(e===`pricing`){F(t);return}if(e===`checks`){R(t);return}if(e===`final`){V({orderId:t.id,status:`final_approved`,note:`تأیید نهایی سفارش`});return}z(t)}}return(n,i)=>(e(),m(`div`,gt,[f(`div`,_t,[f(`div`,vt,[i[9]||=f(`div`,null,[f(`h2`,{class:`orders-page__list-title`},`سفارشها`)],-1),f(`div`,yt,[f(`button`,bt,[_(I,{name:`filter`,size:16}),i[8]||=x(` فیلتر `,-1)]),f(`button`,{type:`button`,class:`admin-btn admin-btn--primary admin-btn--sm`,onClick:i[0]||=(...e)=>p(G)&&p(G)(...e)},` سفارش جدید `)])]),f(`div`,xt,[_(I,{name:`search`,size:18}),l(f(`input`,{"onUpdate:modelValue":i[1]||=e=>u(w)?w.value=e:null,type:`search`,placeholder:`جستجو در شماره سفارش، مشتری...`,class:`orders-page__search-input`},null,512),[[A,p(w)]])]),f(`div`,St,[(e(!0),m(C,null,r(p(Z),t=>(e(),m(`button`,{key:t.key,type:`button`,class:a([`admin-tab`,{active:p(g)===t.key}]),onClick:e=>g.value=t.key},[x(y(t.label)+` `,1),`count`in t&&t.count?(e(),m(C,{key:0},[x(` (`+y(t.count)+`)`,1)],64)):E(``,!0)],10,Ct))),128))]),f(`div`,wt,[f(`table`,Tt,[i[10]||=f(`thead`,null,[f(`tr`,null,[f(`th`,null,`شماره سفارش`),f(`th`,null,`مشتری`),f(`th`,null,`روش تسویه`),f(`th`,null,`مبلغ کل`),f(`th`,null,`متراژ`),f(`th`,null,`وضعیت`),f(`th`,null,`تاریخ ثبت`),f(`th`,null,`عملیات`)])],-1),f(`tbody`,null,[(e(!0),m(C,null,r(p(T),t=>(e(),m(`tr`,{key:t.id,class:a({"is-selected":p(v)===t.id}),onClick:e=>p(M)(t)},[f(`td`,null,y(t.orderNumber),1),f(`td`,null,y(t.customerName),1),f(`td`,null,y(p(P)(t.settlementMethod)),1),f(`td`,null,y(t.totalAmount?p(H)(t.totalAmount):`—`),1),f(`td`,null,y(p(U)(t.meterage)),1),f(`td`,null,[_(ie,{status:t.status},null,8,[`status`])]),f(`td`,null,y(p(ee)(t.createdAt)),1),f(`td`,Dt,[f(`button`,{type:`button`,class:`orders-page__more-btn`,"aria-expanded":K.value?.id===t.id,"aria-haspopup":`menu`,"aria-label":`عملیات سفارش`,onClick:e=>Y(t,e)},[_(I,{name:`more`,size:18})],8,Ot)])],10,Et))),128))])])]),i[11]||=S(`