1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[65515,95437],{24912:(e,t,r)=>{r.d(t,{BG:()=>x,PW:()=>c,SQ:()=>i,wE:()=>g,xS:()=>u,yK:()=>d});var a=r(22356),n=r(26708),o=r(35625),s=r(48934);let l="/ProductCategory";function i(e){return(0,n.I)({queryKey:["product-category","getById",e],enabled:!!e,queryFn:async()=>(await a.FH.get(l+`/GetById/${e}`)).data})}function c(e){return(0,n.I)({queryKey:["product-category","getAll",e],queryFn:async()=>{var t;let r,n=(t={languageId:e?.languageId,slug:e?.slug,searchTerm:e?.searchTerm,isActive:e?.isActive},r=new URLSearchParams,Object.entries(t).forEach(([e,t])=>{null!=t&&""!==t&&r.set(e,String(t))}),r.toString());return(await a.FH.get(`${l}/GetAll${n?`?${n}`:""}`)).data}})}function d(){let e=(0,o.jE)();return(0,s.n)({mutationFn:async e=>await a.FH.post(l+"/Create",e),onSuccess:()=>{e.invalidateQueries({queryKey:["product-category"]})}})}function u(){let e=(0,o.jE)();return(0,s.n)({mutationFn:async e=>await a.FH.put(l+"/Update",e),onSuccess:()=>{e.invalidateQueries({queryKey:["product-category"]})}})}function x(){let e=(0,o.jE)();return(0,s.n)({mutationFn:async e=>await a.FH.delete(l+`/RemoveById/${e}`),onSuccess:()=>{e.invalidateQueries({queryKey:["product-category"]})}})}function g(e){return(0,n.I)({queryKey:["product-category","getByLanguageId",e],enabled:!!e,queryFn:async()=>(await a.FH.get(l+`/GetAllByLanguageId/${e}`)).data})}},25366:(e,t,r)=>{r.d(t,{q:()=>l});var a=r(29753),n=r(28509),o=class extends a.${constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){let{state:r}=e,a=super.createResult(e,t),{isFetching:o,isRefetching:s,isError:l,isRefetchError:i}=a,c=r.fetchMeta?.fetchMore?.direction,d=l&&"forward"===c,u=o&&"forward"===c,x=l&&"backward"===c,g=o&&"backward"===c;return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,n.rB)(t,r.data),hasPreviousPage:(0,n.RQ)(t,r.data),isFetchNextPageError:d,isFetchingNextPage:u,isFetchPreviousPageError:x,isFetchingPreviousPage:g,isRefetchError:i&&!d&&!x,isRefetching:s&&!u&&!g}}},s=r(38764);function l(e,t){return(0,s.t)(e,o,t)}},50388:(e,t,r)=>{r.r(t),r.d(t,{default:()=>b});var a=r(95155),n=r(12115),o=r(15446),s=r(80870),l=r(65515),i=r(90346),c=r(80283),d=r(24912),u=r(55506);function x({children:e,disabled:t,tone:r="default",onClick:n,title:o}){return(0,a.jsx)("button",{type:"button",disabled:t,title:o,onClick:n,className:["inline-flex h-6 min-w-6 items-center justify-center rounded-[8px] border border-[var(--pc-control-border)] bg-[var(--pc-control-bg)] px-1.5 font-yekan text-[10px] transition","danger"===r?"text-red-500 hover:border-red-400 hover:bg-red-500/10":"success"===r?"text-emerald-600 hover:border-emerald-500 hover:bg-emerald-500/10":"text-[var(--pc-control-text)] hover:border-[var(--pc-control-hover-border)] hover:bg-[var(--pc-control-hover-bg,rgba(148,163,184,0.12))]",t?"cursor-not-allowed opacity-35":""].join(" "),children:e})}function g(){return{id:`box-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,languageId:"",title:"",backgroundImage:"",logo:"",categories:[],showCategoryImages:!0,showCategoryIcons:!0}}function p(e){return{boxes:Array.isArray(e?.boxes)?e.boxes.map(e=>{let t;return{...t=g(),...e||{},id:String(e?.id||t.id),languageId:String(e?.languageId||""),title:String(e?.title||""),backgroundImage:String(e?.backgroundImage||""),logo:String(e?.logo||""),categories:Array.isArray(e?.categories)?e.categories.filter(Boolean):[],showCategoryImages:e?.showCategoryImages??!0,showCategoryIcons:e?.showCategoryIcons??!0}}):[]}}function h({fieldName:e,index:t,itemsLength:r,form:n,move:c,remove:g}){let p=i.lV.useWatch(["boxes",e,"languageId"],n),b=i.lV.useWatch(["boxes",e,"backgroundImage"],n),m=i.lV.useWatch(["boxes",e,"logo"],n),y=d.wE(p||"");return(0,a.jsxs)("div",{className:"space-y-1.5 border-t border-[var(--pc-panel-border)] pt-1.5",children:[(0,a.jsx)(s.xh,{label:"زبا٠گرÙÙ",children:(0,a.jsx)(i.lV.Item,{name:["boxes",e,"languageId"],rules:[{required:!0,message:"زبا٠گرÙÙ Ø¨Ø§ÛØ¯ Ù
شخص Ø´ÙØ¯."}],noStyle:!0,children:(0,a.jsx)(o.A,{compact:!0})})}),(0,a.jsx)(s.xh,{label:"عÙÙØ§Ù گرÙÙ",children:(0,a.jsx)(i.lV.Item,{name:["boxes",e,"title"],rules:[{required:!0,message:"عÙÙØ§Ù گرÙÙ Ø¨Ø§ÛØ¯ Ù
شخص Ø´ÙØ¯."}],noStyle:!0,children:(0,a.jsx)(s.zA,{placeholder:"Ù
Ø«ÙØ§Ù Ù
ØØµÙÙØ§Øª ØµÙØ¹ØªÛ",allowClear:!0})})}),(0,a.jsx)(s.xh,{label:"تصÙÛØ± Ù¾Ø³âØ²Ù
ÛÙÙ",children:(0,a.jsx)(i.lV.Item,{name:["boxes",e,"backgroundImage"],noStyle:!0,children:(0,a.jsx)(u.A,{value:String(b||""),onChange:t=>n.setFieldValue(["boxes",e,"backgroundImage"],t),emptyText:"در ØµÙØ±Øª ÙÛØ§Ø² تصÙÛØ± Ù¾Ø³âØ²Ù
ÛÙ٠اÛ٠گرÙ٠را Ø§ÙØªØ®Ø§Ø¨ Ú©ÙÛØ¯.",previewClassName:"h-32 w-full object-cover"})})}),(0,a.jsx)(s.xh,{label:"ÙÙÚ¯Ù ÛØ§ ÙØ´Ø§ÙÙ",children:(0,a.jsx)(i.lV.Item,{name:["boxes",e,"logo"],noStyle:!0,children:(0,a.jsx)(u.A,{value:String(m||""),onChange:t=>n.setFieldValue(["boxes",e,"logo"],t),emptyText:"در ØµÙØ±Øª ÙÛØ§Ø² ÙÙÚ¯ÙÛ Ø§Û٠گرÙ٠را Ø§ÙØªØ®Ø§Ø¨ Ú©ÙÛØ¯.",previewClassName:"h-28 w-full object-contain"})})}),(0,a.jsx)(s.xh,{label:"دستÙâØ¨ÙØ¯ÛâÙØ§",children:(0,a.jsx)(i.lV.Item,{name:["boxes",e,"categories"],noStyle:!0,children:(0,a.jsx)(l.default,{options:y.data||[],loading:y.isLoading,disabled:!p,compact:!0,placeholder:p?"دستÙâØ§Û Ø¨Ø±Ø§Û Ø§ÛÙ Ø²Ø¨Ø§Ù Ù¾ÛØ¯Ø§ ÙØ´Ø¯.":"ابتدا زبا٠گرÙ٠را Ø§ÙØªØ®Ø§Ø¨ Ú©ÙÛØ¯."})})}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-1",children:[(0,a.jsxs)("div",{className:"flex min-h-7 items-center justify-between gap-2 rounded-[8px] border border-[var(--pc-control-border)] bg-[var(--pc-control-bg)] px-2",children:[(0,a.jsx)("span",{className:"font-yekan text-[9px] text-[var(--pc-panel-muted)]",children:"ÙÙ
Ø§ÛØ´ تصÙÛØ± دستÙ"}),(0,a.jsx)(i.lV.Item,{name:["boxes",e,"showCategoryImages"],valuePropName:"checked",noStyle:!0,children:(0,a.jsx)(s.xk,{})})]}),(0,a.jsxs)("div",{className:"flex min-h-7 items-center justify-between gap-2 rounded-[8px] border border-[var(--pc-control-border)] bg-[var(--pc-control-bg)] px-2",children:[(0,a.jsx)("span",{className:"font-yekan text-[9px] text-[var(--pc-panel-muted)]",children:"ÙÙ
Ø§ÛØ´ Ø¢Ûک٠دستÙ"}),(0,a.jsx)(i.lV.Item,{name:["boxes",e,"showCategoryIcons"],valuePropName:"checked",noStyle:!0,children:(0,a.jsx)(s.xk,{})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 pt-1",children:[(0,a.jsx)(x,{title:"Ø§ÙØªÙØ§Ù Ø¨Ù Ø¨Ø§ÙØ§",disabled:0===t,onClick:()=>c(t,t-1),children:"Ø¨Ø§ÙØ§"}),(0,a.jsx)(x,{title:"Ø§ÙØªÙا٠ب٠پاÛÛÙ",disabled:t>=r-1,onClick:()=>c(t,t+1),children:"پاÛÛÙ"}),(0,a.jsx)(x,{title:"ØØ°Ù گرÙÙ",tone:"danger",disabled:r<=1,onClick:()=>g(t),children:"ØØ°Ù"})]})]})}function b(){let e=(0,c.sr)(),t=(0,c.s0)().selectedWidget,[r]=i.lV.useForm(),o=i.lV.useWatch([],r);if((0,n.useEffect)(()=>{t&&(r.resetFields(),r.setFieldsValue(p(t.defaultProps||{boxes:[]})))},[r,t]),!t)return null;let l=p(o||t.defaultProps||{boxes:[]}),d=(r,a)=>{e.updateNode(t.id,{defaultProps:p(a)})},u=()=>{queueMicrotask(()=>d(null,r.getFieldsValue(!0)))};return(0,a.jsx)(s.XR,{children:(0,a.jsx)(i.lV,{form:r,layout:"vertical",size:"small",autoComplete:"off",onValuesChange:d,children:(0,a.jsx)(s.So,{title:"گرÙÙâÙØ§",defaultOpen:!0,children:(0,a.jsx)(i.lV.List,{name:"boxes",children:(e,{add:t,remove:n,move:o})=>(0,a.jsxs)("div",{className:"space-y-1.5",children:[e.length?e.map((t,i)=>{let c=l.boxes?.[i];return(0,a.jsx)(s.So,{title:`${String(c?.title||"").trim()||`گرÙÙ ${Number(i||0)+1}`} - ${c?.categories?.length||0} دستÙ`,children:(0,a.jsx)(h,{fieldName:t.name,index:i,itemsLength:e.length,form:r,move:(e,t)=>
1{o(e,t),u()},remove:e=>{n(e),u()}})},t.key)}):(0,a.jsx)("div",{className:"rounded-[10px] border border-dashed border-[var(--pc-panel-border)] px-3 py-4 text-center font-yekan text-[10px] text-[var(--pc-panel-subtle)]",children:"ÙÙÙØ² ÙÛÚ Ú¯Ø±ÙÙÛ Ø¨Ø±Ø§Û Ø§ÛÙ ÙÛØ¬Øª تعرÛÙ ÙØ´Ø¯Ù است."}),(0,a.jsx)("button",{type:"button",onClick:()=>{t(g()),u()},className:"flex h-8 w-full items-center justify-center rounded-[10px] border border-dashed border-emerald-400 bg-emerald-500/5 px-3 font-yekan text-[10px] font-semibold text-emerald-700 transition hover:bg-emerald-500/10",children:"+ Ø§ÙØ²Ùد٠گرÙÙ Ø¬Ø¯ÛØ¯"})]})})})})})}},55506:(e,t,r)=>{r.d(t,{A:()=>l});var a=r(95155),n=r(86588),o=r(60180),s=r(6576);function l({value:e,onChange:t,emptyText:r="ÙÙÙØ² تصÙÛØ±Û Ø§ÙØªØ®Ø§Ø¨ ÙØ´Ø¯Ù است.",previewClassName:i="h-44 w-full object-cover",fileFilter:c="image",allowedExtensions:d,accept:u,restrictionMessage:x}){return(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(n.A,{multiselect:!1,filter:c,value:e||"",onChange:e=>t?.(String(e||"")),allowedExtensions:d,accept:u,restrictionMessage:x}),e?(0,a.jsxs)("div",{className:"group relative overflow-hidden rounded-2xl border border-slate-200 bg-slate-50 shadow-sm",children:[(0,a.jsx)("img",{src:e?(0,s.IB)(e):"",alt:"preview",className:i}),(0,a.jsx)("button",{type:"button",onClick:()=>t?.(""),className:"absolute left-3 top-3 z-20 flex h-10 w-10 items-center justify-center rounded-full bg-red-500 text-white shadow-lg transition hover:bg-red-600","aria-label":"ØØ°Ù تصÙÛØ±",children:(0,a.jsx)(o.SU,{})})]}):(0,a.jsx)("div",{className:"rounded-2xl border border-dashed border-slate-300 px-3 py-4 text-center text-xs text-slate-400",children:r})]})}},65515:(e,t,r)=>{r.r(t),r.d(t,{default:()=>o});var a=r(95155),n=r(60180);function o({value:e=[],onChange:t,options:r=[],loading:s=!1,disabled:l=!1,placeholder:i="Ø§ÙØªØ®Ø§Ø¨ Ú©ÙÛØ¯",compact:c=!1}){let d=Array.isArray(e)?e:[],u=(e,t)=>String(e?.id||e?.slug||e?.title||`category-${t??0}`);return(0,a.jsxs)("div",{className:c?"space-y-1.5 font-yekan":"space-y-3",children:[d.length>0?(0,a.jsx)("div",{className:["flex flex-wrap",c?"gap-1 rounded-[8px] border border-[var(--pc-control-border)] bg-[var(--pc-control-bg)] p-1.5":"gap-2 rounded-lg bg-gray-50 p-3"].join(" "),children:d.map((e,r)=>(0,a.jsxs)("span",{className:["flex items-center gap-1 rounded-full bg-[#008060] text-white",c?"px-2 py-0.5 text-[9px]":"px-3 py-1 text-sm"].join(" "),children:[e.title,l?null:(0,a.jsx)("button",{type:"button",onClick:r=>{let a;r.preventDefault(),r.stopPropagation(),a=u(e),t?.(d.filter(e=>u(e)!==a))},className:["flex cursor-pointer items-center justify-center rounded-full transition-colors hover:bg-white/20",c?"h-4 w-4 text-[8px]":"h-5 w-5"].join(" "),"aria-label":`ØØ°Ù ${e.title}`,children:(0,a.jsx)(n.r$,{})})]},u(e,r)))}):null,(0,a.jsx)("div",{className:["overflow-y-auto border",c?"max-h-[148px] rounded-[8px] p-1":"max-h-[200px] rounded-lg p-3",c?l?"border-[var(--pc-control-border)] bg-[var(--pc-control-bg)] opacity-60":"border-[var(--pc-control-border)] bg-[var(--pc-control-bg)]":l?"bg-gray-100 opacity-60":"bg-white"].join(" "),children:s?(0,a.jsx)("div",{className:c?"py-3 text-center text-[10px] text-[var(--pc-panel-muted)]":"py-4 text-center text-gray-400",children:"در ØØ§Ù بارگذارÛ..."}):0===r.length?(0,a.jsx)("div",{className:c?"py-3 text-center text-[10px] text-[var(--pc-panel-muted)]":"py-4 text-center text-gray-400",children:i}):(0,a.jsx)("div",{className:c?"space-y-0.5":"space-y-1",children:r.map((e,r)=>{let n=d.some(t=>u(t)===u(e));return(0,a.jsxs)("button",{type:"button",disabled:l,onClick:r=>{let a;r.preventDefault(),r.stopPropagation(),!l&&(a=u(e),d.some(e=>u(e)===a)||t?.([...d,e]))},className:["flex w-full items-center justify-between border-0 bg-transparent text-right transition-colors duration-200",c?"rounded-[7px] px-2 py-1 text-[10px]":"rounded-md p-2",n?"bg-[#008060]/10 text-[#008060]":c?"text-[var(--pc-control-text)] hover:bg-[var(--pc-control-hover-bg,rgba(148,163,184,0.12))]":"text-gray-700 hover:bg-gray-100",l?"cursor-not-allowed opacity-60":"cursor-pointer"].join(" "),children:[(0,a.jsx)("span",{className:"min-w-0 truncate",children:e.title}),n?(0,a.jsx)("span",{className:["flex items-center justify-center rounded-full bg-[#008060] text-white",c?"h-4 w-4 text-[8px]":"h-5 w-5 text-xs"].join(" "),children:"â"}):null]},u(e,r))})})})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.