1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4909],{7371:(e,t,r)=>{"use strict";r.d(t,{YJ:()=>i,dN:()=>c,kS:()=>s});var a=r(86686),n=r(64352),o=r(65468);let s=(0,a.tG)("user_id",null),i=(0,a.tG)("userIdGuest",null),c=(0,n.eU)(!1);(0,a.tG)("access_token",null);let u=(0,n.eU)(null);(0,n.eU)(!1),(0,n.eU)(async e=>{let t=e(u);if(t)return t;try{return await (0,o.jp)()}catch(e){return null}})},7551:(e,t,r)=>{"use strict";function a(e){return(Array.isArray(e)?e:e?[e]:[]).flatMap(e=>{var t,r;let a=Number(null!=(r=null!=(t=e.quantity)?t:e.incoming_stock)?r:0),n="string"==typeof e.list_delivery_date?e.list_delivery_date:"",o="string"==typeof e.date_received?e.date_received:"";return a&&(n||o)?[{quantity:a,incoming_stock:a,list_delivery_date:n||void 0,date_received:o||void 0}]:[]})}r.d(t,{$I:()=>l,DF:()=>a,Ub:()=>u,Xl:()=>o,o2:()=>s,qp:()=>i,uH:()=>c});let n="guest_cart";function o(){let e=localStorage.getItem(n);return e?JSON.parse(e):[]}function s(e){localStorage.setItem(n,JSON.stringify(e))}function i(e){let t,r=o();return s(t=r.find(t=>t.product_id===e.product_id)?r.map(t=>t.product_id===e.product_id?{...t,quantity:t.quantity+e.quantity}:t):[...r,e]),t}function c(e){let t=o();return s(t=t.filter(t=>t.product_id!==e)),t}function u(e,t){let r=o();return s(r=(r=r.map(r=>r.product_id===e?{...r,quantity:t}:r)).filter(e=>e.quantity>0)),r}function l(e,t){let r=o().map(r=>r.product_id===e?{...r,is_active:t}:r);return s(r),r}},17656:(e,t,r)=>{"use strict";r.d(t,{cn:()=>o});var a=r(54511),n=r(96469);function o(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,a.$)(t))}},18173:(e,t,r)=>{"use strict";r.d(t,{N_:()=>o,a8:()=>i,rd:()=>c});var a=r(16268);let n=(0,r(14037).A)({locales:["de","en"],defaultLocale:"de",localePrefix:"as-needed"}),{Link:o,redirect:s,usePathname:i,useRouter:c,getPathname:u}=(0,a.A)(n)},22179:()=>{},38828:(e,t,r)=>{"use strict";r.d(t,{AR:()=>c,Aq:()=>s,DM:()=>l,FD:()=>i,bE:()=>o,je:()=>n,zW:()=>u});var a=r(94295);async function n(){let{data:e}=await a.FH.get("/cart/");return e}async function o(e,t){let{data:r}=await a.FH.post("/cart/add-item",{product_id:e,quantity:t,is_active:!0},{headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(localStorage.getItem("access_token"))},withCredentials:!0});return r}async function s(e){let{data:t}=await a.FH.get("/cart/by-user/".concat(e));return t}async function i(e){let{data:t}=await a.FH.delete("/cart/remove-item/".concat(e),{headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(localStorage.getItem("access_token"))},withCredentials:!0});return t}async function c(e,t){let{data:r}=await a.FH.patch("/cart/update-item-quantity/".concat(e),{quantity:t},{headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(localStorage.getItem("access_token"))},withCredentials:!0});return r}async function u(e,t){let{data:r}=await a.FH.patch("/cart/update-item-active/".concat(e),{is_active:t},{headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(localStorage.getItem("access_token"))},withCredentials:!0});return r}async function l(e){let t=localStorage.getItem("access_token"),{data:r}=await a.FH.put("/cart/delete-cart-user/".concat(e),null,{headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},withCredentials:!0});return r}},45995:(e,t,r)=>{"use strict";r.d(t,{$:()=>c,r:()=>i});var a=r(53137);r(82901);var n=r(91034),o=r(71703),s=r(17656);let i=(0,o.F)("inline-flex items-center cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function c(e){let{className:t,variant:r,size:o,asChild:c=!1,...u}=e,l=c?n.DX:"button";return(0,a.jsx)(l,{"data-slot":"button",className:(0,s.cn)(i({variant:r,size:o,className:t})),...u})}},65468:(e,t,r)=>{"use strict";r.d(t,{Hh:()=>c,Ix:()=>p,RP:()=>d,SX:()=>u,b7:()=>g,iD:()=>s,jp:()=>i,p4:()=>h,z:()=>l});var a=r(94295),n=r(27331),o=r.n(n);async function s(e){let{data:t}=await a.eB.post("/login",o().stringify(e),{headers:{"Content-Type":"application/x-www-form-urlencoded"},withCredentials:!0});return t}async function i(){if(!localStorage.getItem("access_token"))throw Error("No token");let{data:e}=await a.FH.get("/me");return e}async function c(e){let{data:t}=await a.eB.post("/signup",e,{headers:{"Content-Type":"application/json"},withCredentials:!0});return t}async function u(e){let{data:t}=await a.eB.post("/signup-guess",e,{headers:{"Content-Type":"application/json"}});return t}async function l(e){let{data:t}=await a.eB.post("/check-email",'"'.concat(e,'"'),{headers:{"Content-Type":"application/json"}});return t}async function d(e,t){let{data:r}=await a.eB.post("/check-otp",{email:e,code:t});return r}async function p(e){let{data:t}=await a.eB.post("/login-symlink",{email:e});return t}async function g(e){let{data:t}=await a.eB.post("/login-admin",o().stringify({username:e}),{headers:{"Content-Type":"application/x-www-form-urlencoded"}});return t}async function h(e,t){let{data:r}=await a.eB.post("/check-real-email",{email:e,code:t});return r}},94295:(e,t,r)=>{"use strict";r.d(t,{C_:()=>c,FH:()=>s,eB:()=>o});var a=r(82787);let n="https://test.prestige-home.de/",o=a.A.create({baseURL:n,withCredentials:!0}),s=a.A.create({baseURL:n,withCredentials:!0});s.interceptors.request.use(e=>{{let t=localStorage.getItem("access_token");t&&(e.headers=e.headers||{},e.headers.Authorization="Bearer ".concat(t))}return e}),s.interceptors.response.use(e=>e,async e=>{var t,r;return(null==(t=e.response)?void 0:t.status)===401&&(localStorage.removeItem("access_token"),localStorage.removeItem("userId")),(null==(r=e.response)?void 0:r.data)==="Token expired"&&(window.location.href="/einloggen"),Promise.reject(e)});let i=a.A.create({baseURL:n,withCredentials:!0});i.interceptors.request.use(e=>{{let t=localStorage.getItem("admin_access_token");t&&(e.headers=e.headers||{},e.headers.Authorization="Bearer ".concat(t))}return e}),i.interceptors.response.use(e=>e,async e=>{var t;return(null==(t=e.response)?void 0:t.status)===401&&(localStorage.removeItem("admin_access_token"),window.location.href="/admin-login"),Promise.reject(e)});let c=a.A.create({baseURL:n,withCredentials:!0});c.interceptors.request.use(e=>{{let t=localStorage.getItem("access_token"),r=localStorage.getItem("admin_access_token");t?(e.headers=e.headers||{},e.headers.Authorization="Bearer ".concat(t)):r&&(e.headers=e.headers||{},e.headers.Authorization="Bearer ".concat(r))}return e}),c.interceptors.response.use(e=>e,async e=>{var t;return(null==(t=e.response)?void 0:t.status)===401&&(localStorage.removeItem("access_token"),localStorage.removeItem("admin_access_token")),Promise.reject(e)});let u=a.A.create({baseURL:n,withCredentials:!0});u.interceptors.request.use(e=>{{let t=localStorage.getItem("dsp_access_token");t&&(e.headers=e.headers||{},e.headers.Authorization="Bearer ".concat(t))}return e}),u.interceptors.response.use(e=>e,async e=>{var t;return(null==(t=e.response)?void 0:t.status)===401&&(localStorage.removeItem("dsp_access_token"),window.location.href="/dsp/login"),Promise.reject(e)})},95284:(e,t,r)=>{"use strict";r.d(t,{A:()=>i,Z:()=>c});var a=r(7551),n=r(78131),o=r(83126),s=r(10801);let i=["cart"];function c(){var e;let t=(0,n.useQueryClient)(),r=(0,o.useQuery)({queryKey:i,queryFn:()=>(0,a.Xl)(),refetchOnWindowFocus:!0,refetchOnMount:!0}),c=(0,s.useMutation)({mutationFn:async e=>{let{item:t}=e;return(0,a.qp)(t),(0,a.Xl)()},onSuccess:e=>{t.setQueryData(i,e)}}),u=(0,s.useMutation)({mutationFn:async e=>((0,a.o2)(e),(0,a.Xl)()),onSuccess:e=>{t.setQueryData(i,e)}}),l=(0,s.useMutation)({mutationFn:async e=>{let{product_id:t,quantity:r}=e;return(0,a.Ub)(t,r)},onSuccess:e=>{t.setQueryData(i,e)}}),d=(0,s.useMutation)({mutationFn:async e=>{let{product_id:t,is_active:r}=e;return(0,a.$I)(t,r)},onSuccess:e=>{t.setQueryData(i,e)}}),p=(0,s.useMutation)({mutationFn:async e=>(0,a.uH)(e),onSuccess:e=>{t.setQueryData(i,e)}});return{cart:null!=(e=r.data)?e:[],isLoading:r.isLoading,addToCartLocal:c.mutate,updateCart:u.mutate,updateQuantity:l.mutate,removeItem:p.mutate,updateStatus:d.mutate}}}}]);
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.