1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3636],{43031:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/[shop]/products",function(){return s(29273)}])},34317:function(e,t,s){"use strict";s.d(t,{n:function(){return MoreIcon}});var n=s(85893);let MoreIcon=e=>(0,n.jsxs)("svg",{viewBox:"-192 0 512 512",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",...e,children:[(0,n.jsx)("path",{d:"m128 256c0 35.347656-28.652344 64-64 64s-64-28.652344-64-64 28.652344-64 64-64 64 28.652344 64 64zm0 0"}),(0,n.jsx)("path",{d:"m128 64c0 35.347656-28.652344 64-64 64s-64-28.652344-64-64 28.652344-64 64-64 64 28.652344 64 64zm0 0"}),(0,n.jsx)("path",{d:"m128 448c0 35.347656-28.652344 64-64 64s-64-28.652344-64-64 28.652344-64 64-64 64 28.652344 64 64zm0 0"})]})},47133:function(e,t,s){"use strict";var n=s(85893),l=s(78985),r=s(79362),i=s(11163),o=s(16203),a=s(1631),u=s(99494),d=s(5233),c=s(74673),p=s(8144),m=s(90573),h=s(48583),f=s(94184),x=s.n(f),v=s(30824),S=s(62964);let SidebarItemMap=e=>{var t,s;let l,u,{menuItems:c}=e,{locale:p}=(0,i.useRouter)(),{t:f}=(0,d.$G)(),{settings:x}=(0,m.n)({language:p}
1),{childMenu:v}=c,g=null==x?void 0:null===(t=x.options)||void 0===t?void 0:t.enableTerms,b=null==x?void 0:null===(s=x.options)||void 0===s?void 0:s.enableCoupons,{permissions:j}=(0,o.WA)(),[P,N]=(0,h.KO)(r.Hf),{width:y}=(0,S.Z)(),{query:{shop:w}}=(0,i.useRouter)();return!g&&(l=null==c?void 0:c.childMenu.find(e=>"Terms And Conditions"===e.label))&&(l.permissions=o.M$),!b&&(u=null==c?void 0:c.childMenu.find(e=>"Coupons"===e.label))&&(u.permissions=o.M$),(0,n.jsx)("div",{className:"space-y-2",children:null==v?void 0:v.map(e=>{let{href:t,label:s,icon:l,permissions:i,childMenu:u}=e;return u||(0,o.Ft)(i,j)?(0,n.jsx)(a.Z,{href:t(null==w?void 0:w.toString()),label:f(s),icon:l,childMenu:u,miniSidebar:P&&y>=r.h2},s):null})})},SideBarGroup=()=>{var e,t;let[s,l]=(0,h.KO)(r.Hf),{role:i}=(0,o.WA)(),a="staff"===i?null===u.siteSettings||void 0===u.siteSettings?void 0:null===(e=u.siteSettings.sidebarLinks)||void 0===e?void 0:e.staff:null===u.siteSettings||void 0===u.siteSettings?void 0:null===(t=u.siteSettings.sidebarLinks)||void 0===t?void 0:t.shop,c=Object.keys(a),{width:p}=(0,S.Z)(),{t:m}=(0,d.$G)();return(0,n.jsx)(n.Fragment,{children:null==c?void 0:c.map((e,t)=>{var l;return(0,n.jsxs)("div",{className:x()("flex flex-col px-5",s&&p>=r.h2?"border-b border-dashed border-gray-200 py-5":"pt-6 pb-3"),children:[(0,n.jsx)("div",{className:x()("px-3 pb-5 text-xs font-semibold uppercase tracking-[0.05em] text-body/60",s&&p>=r.h2?"hidden":""),children:m(null===(l=a[e])||void 0===l?void 0:l.label)}),(0,n.jsx)(SidebarItemMap,{menuItems:a[e]})]},t)})})};t.Z=e=>{let{children:t}=e,[s,o]=(0,h.KO)(r.Hf),{locale:a}=(0,i.useRouter)(),{width:u}=(0,S.Z)(),[d]=(0,h.KO)(r.GH),[m]=(0,h.KO)(r.W4);return(0,n.jsxs)("div",{className:"flex flex-col min-h-screen transition-colors duration-150 bg-gray-100",dir:"ar"===a||"he"===a?"rtl":"ltr",children:[(0,n.jsx)(l.Z,{}),(0,n.jsx)(c.Z,{children:(0,n.jsx)(SideBarGroup,{})}),(0,n.jsxs)("div",{className:"flex flex-1",children:[(0,n.jsx)("aside",{className:x()("fixed bottom-0 z-10 hidden h-full w-72 bg-white shadow transition-[width] duration-300 ltr:left-0 ltr:right-auto rtl:right-0 rtl:left-auto lg:block",u>=r.h2&&(d||m)?"pt-[8.75rem]":"pt-20",s&&u>=r.h2?"lg:w-24":"lg:w-76"),children:(0,n.jsx)("div",{className:"w-full h-full overflow-x-hidden sidebar-scrollbar",children:(0,n.jsx)(v.Z,{className:"w-full h-full",options:{scrollbars:{autoHide:"never"}},children:(0,n.jsx)(SideBarGroup,{})})})}),(0,n.jsxs)("main",{className:x()("relative flex w-full flex-col justify-start transition-[padding] duration-300",u>=r.h2&&(d||m)?"lg:pt-[8.75rem]":"pt-[3.9375rem] lg:pt-[4.75rem]",s&&u>=r.h2?"ltr:pl-24 rtl:pr-24":"ltr:xl:pl-76 rtl:xl:pr-76 ltr:lg:pl-72 rtl:lg:pr-72 rtl:lg:pl-0"),children:[(0,n.jsx)("div",{className:"h-full p-5 md:p-8",children:t}),(0,n.jsx)(p.Z,{})]})]})]})}},30042:function(e,t,s){"use strict";s.d(t,{bg:function(){return useApproveShopMutation},TC:function(){return useCreateShopMutation},mj:function(){return useDisApproveShopMutation},T3:function(){return useInActiveShopsQuery},DZ:function(){return useShopQuery},uL:function(){return useShopsQuery},D9:function(){return useUpdateShopMutation}});var n=s(93345),l=s(97514),r=s(47869),i=s(16203),o=s(28597),a=s(5233),u=s(11163),d=s(88767),c=s(22920),p=s(3737),m=s(55191);let h={...(0,m.h)(r.P.SHOPS),get(e){let{slug:t}=e;return p.eN.get("".concat(r.P.SHOPS,"/").concat(t))},paginated:e=>{let{name:t,...s}=e;return p.eN.get(r.P.SHOPS,{searchJoin:"and",...s,search:p.eN.formatSearchParams({name:t})})},newOrInActiveShops:e=>{let{is_active:t,name:s,...n}=e;return p.eN.get(r.P.NEW_OR_INACTIVE_SHOPS,{searchJoin:"and",is_active:t,name:s,...n,search:p.eN.formatSearchParams({is_active:t,name:s})})},approve:e=>p.eN.post(r.P.APPROVE_SHOP,e),disapprove:e=>p.eN.post(r.P.DISAPPROVE_SHOP,e)},useApproveShopMutation=()=>{let{t:e}=(0,a.$G)(),t=(0,d.useQueryClient)();return(0,d.useMutation)(h.approve,{onSuccess:()=>{c.Am.success(e("common:successfully-updated"))},onSettled:()=>{t.invalidateQueries(r.P.SHOPS)}})},useDisApproveShopMutation=()=>{let{t:e}=(0,a.$G)(),t=(0,d.useQueryClient)();return(0,d.useMutation)(h.disapprove,{onSuccess:()=>{c.Am.success(e("common:successfully-updated"))},onSettled:()=>{t.invalidateQueries(r.P.SHOPS)}})},useCreateShopMutation=()=>{let e=(0,d.useQueryClient)(),t=(0,u.useRouter)();return(0,d.useMutation)(h.create,{onSuccess:()=>{let{permissions:e}=(0,i.WA)();if((0,i.Ft)(i.M$,e))return t.push(l.Z.adminMyShops);t.push(l.Z.dashboard)},onSettled:()=>
1{e.invalidateQueries(r.P.SHOPS)}})},useUpdateShopMutation=()=>{let{t:e}=(0,a.$G)(),t=(0,u.useRouter)(),s=(0,d.useQueryClient)();return(0,d.useMutation)(h.update,{onSuccess:async s=>{await t.push("/".concat(null==s?void 0:s.slug,"/edit"),void 0,{locale:n.Config.defaultLanguage}),c.Am.success(e("common:successfully-updated"))},onSettled:()=>{s.invalidateQueries(r.P.SHOPS)}})},useShopQuery=(e,t)=>{let{slug:s}=e;return(0,d.useQuery)([r.P.SHOPS,{slug:s}],()=>h.get({slug:s}),t)},useShopsQuery=e=>{var t;let{data:s,error:n,isLoading:l}=(0,d.useQuery)([r.P.SHOPS,e],e=>{let{queryKey:t,pageParam:s}=e;return h.paginated(Object.assign({},t[1],s))},{keepPreviousData:!0});return{shops:null!==(t=null==s?void 0:s.data)&&void 0!==t?t:[],paginatorInfo:(0,o.Q)(s),error:n,loading:l}},useInActiveShopsQuery=e=>{var t;let{data:s,error:n,isLoading:l}=(0,d.useQuery)([r.P.NEW_OR_INACTIVE_SHOPS,e],e=>{let{queryKey:t,pageParam:s}=e;return h.newOrInActiveShops(Object.assign({},t[1],s))},{keepPreviousData:!0});return{shops:null!==(t=null==s?void 0:s.data)&&void 0!==t?t:[],paginatorInfo:(0,o.Q)(s),error:n,loading:l}}},29273:function(e,t,s){"use strict";s.r(t),s.d(t,{__N_SSP:function(){return C},default:function(){return ProductsPage}});var n=s(85893),l=s(92072),r=s(37912),i=s(85634),o=s(46626),a=s(34317),u=s(47133),d=s(15724),c=s(145),p=s(60802),m=s(45957),h=s(61616),f=s(55846),x=s(75814),v=s(93345),S=s(97514),g=s(93242),b=s(30042),j=s(99930),P=s(10265),N=s(16203),y=s(94184),w=s.n(y),O=s(5233),_=s(11163),M=s(67294),Z=s(35484),C=!0;function ProductsPage(){var e,t;let s=(0,_.useRouter)(),{permissions:u}=(0,N.WA)(),{data:y}=(0,j.UE)(),{query:{shop:C}}=(0,_.useRouter)(),{data:A,isLoading:I}=(0,b.DZ)({slug:C}),Q=null==A?void 0:A.id,{t:H}=(0,O.$G)(),[k,T]=(0,M.useState)(""),[R,E]=(0,M.useState)(""),[D,G]=(0,M.useState)(""),[$,F]=(0,M.useState)(""),[L,W]=(0,M.useState)(1),[K,z]=(0,M.useState)("created_at"),[B,U]=(0,M.useState)(P.As.Desc),[V,X]=(0,M.useState)(!0),{openModal:q}=(0,x.SO)(),{locale:J}=(0,_.useRouter)(),{products:Y,paginatorInfo:ee,loading:et,error:es}=(0,g.kN)({language:J,name:k,limit:20,shop_id:Q,type:R,categories:D,product_type:$,orderBy:K,sortedBy:B,page:L},{enabled:!!Q});function handleImportModal(){q("EXPORT_IMPORT_PRODUCT",Q)}return et||I?(0,n.jsx)(f.Z,{text:H("common:text-loading")}):es?(0,n.jsx)(m.Z,{message:es.message}):((0,N.Ft)(N.M$,u)||(null==y?void 0:null===(e=y.shops)||void 0===e?void 0:e.map(e=>e.id).includes(Q))||(null==y?void 0:null===(t=y.managed_shop)||void 0===t?void 0:t.id)==Q||s.replace(S.Z.dashboard),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(l.Z,{className:"mb-8 flex flex-col",children:[(0,n.jsxs)("div",{className:"flex w-full flex-col items-center md:flex-row",children:[(0,n.jsx)("div",{className:"mb-4 md:mb-0 md:w-1/4",children:(0,n.jsx)(Z.Z,{title:H("form:input-label-products")})}),(0,n.jsxs)("div",{className:"flex w-full flex-col items-center md:w-3/4 md:flex-row",children:[(0,n.jsxs)("div",{className:"flex w-full items-center",children:[(0,n.jsx)(r.Z,{onSearch:function(e){let{searchText:t}=e;T(t)},placeholderText:H("form:input-placeholder-search-name")}),J===v.Config.defaultLanguage&&(0,n.jsxs)(h.Z,{href:"/".concat(C,"/products/create"),className:"h-12 ms-4 md:ms-6",children:[(0,n.jsxs)("span",{className:"hidden md:block",children:["+ ",H("form:button-label-add-product")]}),(0,n.jsxs)("span",{className:"md:hidden",children:["+ ",H("form:button-label-add")]})]})]}),(0,n.jsx)(p.Z,{onClick:handleImportModal,className:"mt-5 w-full md:hidden",children:H("common:text-export-import")}),(0,n.jsxs)("button",{className:"mt-5 flex items-center whitespace-nowrap text-base font-semibold text-accent md:mt-0 md:ms-5",onClick:()=>{X(e=>!e)},children:[H("common:text-filter")," ",V?(0,n.jsx)(o.a,{className:"ms-2"}):(0,n.jsx)(i.K,{className:"ms-2"})]}),(0,n.jsx)("button",{onClick:handleImportModal,className:"hidden h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-gray-50 transition duration-300 ms-5 hover:bg-gray-100 md:flex",children:(0,n.jsx)(a.n,{className:"w-3.5 text-body"})})]})]}),(0,n.jsx)("div",{className:w()("flex w-full transition",{"visible h-auto":V,"invisible h-0":!V}),children:(0,n.jsx)("div",{className:"mt-5 flex w-full flex-col border-t border-gray-200 pt-5 md:mt-8 md:flex-row md:items-center md:pt-8",children:(0,n.jsx)(d.Z,{className:"w-full",type:R,onCategoryFilter:e=>{G(null==e?void 0:e.slug),W(1)},onTypeFilter:e=>
1{E(null==e?void 0:e.slug),W(1)},onProductTypeFilter:e=>{F(null==e?void 0:e.slug),W(1)},enableCategory:!0,enableType:!0,enableProductType:!0})})})]}),(0,n.jsx)(c.Z,{products:Y,paginatorInfo:ee,onPagination:function(e){W(e)},onOrder:z,onSort:U})]}))}ProductsPage.authenticate={permissions:N.ce},ProductsPage.Layout=u.Z}},function(e){e.O(0,[6037,4845,1609,3721,2023,7510,2924,7536,1698,3456,9693,9494,2416,5535,363,1285,1631,7556,8504,2713,1077,193,9774,2888,179],function(){return e(e.s=43031)}),_N_E=e.O()}]);
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.