PageSourceSearch

https://packiro.com/_next/static/chunks/pages/cart-97721e0afb369a38.js

js packiro.com collected 2026-09-25 07:12:49 UTC 20,089 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6442],{96764:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/cart",function(){return r(57454)}])},57454:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSG:()=>eN,default:()=>eS});var a=r(21962),i=r(80838),n=r(10344),o=r(9399),l=r(98998),c=r(57963),s=r(22568),d=r(2488),u=r(54986),h=r(85208),p=r(63843),m=r(81352),x=r(97601);let y=()=>{let e=(0,u.A)(),{Link:t,t:r}=(0,m.f)();return(0,a.jsx)(i.A,{children:(0,a.jsx)(i.A,{py:16,px:8,sx:{backgroundColor:e.palette.primary.extraLight},children:(0,a.jsxs)(i.A,{display:"flex",flexDirection:"column",alignItems:"center",children:[(0,a.jsx)(h.A,{variant:"h3",maxWidth:x.h1,mx:"auto",align:"center",color:e.palette.primary.darkHover,mb:6,children:r("cart.footer.headline")}),(0,a.jsx)(t,{href:"/configurator",children:(0,a.jsx)(p.A,{variant:"outlined",size:"large",children:r("cart.footer.button")})})]})})})};var v=r(97302),j=r(5365),f=r(84434);let g=()=>{let e=(0,u.A)(),{Link:t,t:r}=(0,m.f)();return(0,a.jsx)(i.A,{children:(0,a.jsxs)(f.wn,{"data-cy":"cart:empty.container",display:"flex",flexDirection:"column",alignItems:"center",py:[10,12],children:[(0,a.jsx)(j.PV,{width:[72,134],color:e.palette.primary.darkHover,mx:"auto",mb:2}),(0,a.jsx)(h.A,{variant:"h1",align:"center",maxWidth:x.h1,mx:"auto",color:e.palette.primary.darkHover,mb:2,children:r("cart.empty.header")}),(0,a.jsx)(h.A,{variant:"body1",align:"center",mb:[8,10,6],width:["100%",497],children:r("cart.empty.copy")}),(0,a.jsxs)(v.A,{spacing:3,alignItems:"center",children:[(0,a.jsx)(t,{href:"/configurator",children:(0,a.jsx)(p.A,{variant:"contained",size:"large",children:r("cart.empty.button.configurator")})}),(0,a.jsx)(t,{href:"/",children:(0,a.jsx)(p.A,{variant:"outlined",size:"large",children:r("cart.empty.button.overview")})})]})]})})};var b=r(20851);let A=()=>{let{t:e}=(0,b.fJ)(),t=(0,u.A)();return(0,a.jsx)(i.A,{px:[8,0],mb:6,children:(0,a.jsx)(h.A,{variant:"h1",color:t.palette.primary.darkHover,children:e("cart.header.headline")})})};var w=r(41166),I=r(66392),C=r.n(I),N=r(46120),S=r(61332),k=r(87253);let q=()=>{let{t:e}=(0,b.fJ)(),{mutateAsync:t,isLoading:r,error:n}=(0,w.L2)(N.jX.ADD_PROMOTION(),{disableSnackbar:!0}),{isPackshotOnlyCart:o}=(0,l.B)();return(0,a.jsxs)(i.A,{children:[(0,a.jsx)(h.A,{variant:"h4",children:e("checkout.summary.title")}),(0,a.jsxs)(i.A,{display:"flex",flexDirection:["column","row","column"],sx:{columnGap:[3,4,3],rowGap:[3]},children:[(0,a.jsx)(S.B,{error:n}),(0,a.jsxs)(i.A,{sx:{flexShrink:0,flexGrow:1},children:[(0,a.jsxs)(p.A,{component:C(),href:o?"/checkout/payment":"/checkout",variant:"contained",size:"large",sx:{width:"100%"},"data-cy":"cart:summary.checkout.button",children:[e("cart.summary.checkout.button"),(0,a.jsx)(j.yd,{width:24,height:24,sx:{transform:"rotate(-90deg)"},ml:2})]}),(0,a.jsx)(k.Fs,{py:3,onAddPromotion:e=>t({name:e}),disabled:r})]})]})]})};var P=r(67754),L=r(80492),_=r(75338),D=r(73522),T=r(63342),M=r(8670),E=r(18283),H=r(26210),O=r(69460),z=r(83564),W=r(47327),B=r(95413),R=r(86034),F=r(12847),J=r(77684),U=r(73216),G=r(82408),Q=r(51753),V=r(79300),X=r(71940),K=r(30487),Y=r(75461);let Z=(e,t)=>{var r;return e.find(e=>e.quantityStart===t)||(null!==(r=[...e].filter(e=>e.quantityStart<=t).sort((e,t)=>t.quantityStart-e.quantityStart)[0])&&void 0!==r?r:e[0])},$=e=>{var t,r;let{onSubmit:o,submitButtonProps:l}=e,c=(0,u.A)(),{t:s}=(0,m.f)(),{state:d,quantityQuery:x,selectedVariant:y}=(0,U.L)(),[v,j]=(0,H.useState)(!1),{getImportantPageUrl:f}=(0,Q.du)(),{lineItem:g}=(0,n.s)(),[b,A]=(0,H.useState)(()=>g.proLibItemOrders.length>0?g.proLibItemOrders.map((e,t)=>{var r,a;return{name:null!==(r=e.name)&&void 0!==r?r:"".concat(s("productconfigurator.step.design")," ").concat(t+1),quantity:null!==(a=e.quantity)&&void 0!==a?a:0}}):[{name:"".concat(s("productconfigurator.step.design")," 1"),quantity:g.price.quantity}]),w=null!==(r=x.data)&&void 0!==r?r:[],I=b.reduce((e,t)=>e+t.quantity,0),C=Z(w,I),N=b.length>0&&b.every(e=>e.quantity>0),S=null===(t=d.finalSelections.accessories.other.find(e=>e.group.technicalName===G.Nx))||void 0===t?void 0:t.technicalName,q=!!S,P=v&&S===G.Yq&&I<Y.v,L={...d.finalSelections.accessories,other:[...d.finalSelections.accessories.other.filter(e=>e.technicalName!==G.nI),{group:{technicalName:G.W1},technicalName:G.nI,quantity:b.length}]},_=(0,V.Wf)(L,C,y),D=C?C.price.pc+(0,V.Ec)(L.addons,y):0,T=()=>{if(j(!0),!N||!y||!C||(0,G.nU)(d.finalSelections.productType)&&!q||S===G.Yq&&I<Y.v)return;let e={...d.finalSelections,quantity:C,designAllocations:b,accessories:L};o((0,X.f)(e,y))};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.A,{px:[null,6,6],pb:[null,6,6],mt:[6,4,4],display:"flex",flexDirection:"column",gap:4,width:"100%",position:"relative",children:[(0,a.jsx)(R.v,{disabled:!1}),(0,a.jsx)(J.z,{disabled:!1}),(0,G.nU)(d.finalSelections.productType)&&(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(F.U,{totalQuantity:I,disabled:d.isFinalized,hasError:v&&(!q||P),helperText:P?s("smartDropdowns.customSidesDropdown.warningLabel.individualSidesQuantityTooLow"):void 0})}),(0,a.jsx)(h.A,{variant:"body1/bold",color:c.palette.primary.darkHover,children:s("productconfigurator.designAllocationEditor.editQuantities")}),(0,a.jsx)(K.Q,{allocations:b,quantities:w,onChange:A}),(0,a.jsxs)(i.A,{display:"inline-flex",width:"100%",children:[(0,a.jsx)(h.A,{variant:"body1",mr:"auto",children:s("productDetailpage.priceAccordion.priceTotal")}),(0,a.jsx)(h.A,{variant:"h5",children:0===_.totalPrice?"- €":(0,O.i)(_.totalPrice)})]}),(0,a.jsx)(i.A,{display:"inline-flex",width:"100%",paddingTop:1,children:(0,a.jsx)(h.A,{ml:"auto",variant:"body2",color:c.palette.neutral.grey800,children:0===D?"- €":"".concat((0,O.i)(D)," / ").concat(s("productDetailpage.priceAccordion.piece"))})})]}),(0,a.jsxs)(i.A,{display:"flex",width:"100%",flexDirection:["column","row"],justifyContent:"space-between",alignItems:"center",gap:2,children:[(0,a.jsx)(i.A,{sx:{typography:c.typography.body2,color:c.palette.grey[800]},pl:6,children:s.rich("productDetailpage.priceAccordion.priceNet",{shippinglink:e=>(0,a.jsx)(k.QW,{href:f("SHIPPING"),typography:"body2",children:e})})}),(0,a.jsx)(p.A,{variant:"contained",size:"large",onClick:()=>T(),disabled:!N,...l,children:s("ordercard.editModal.button.save")})]})]})};var ee=r(9273);let et=e=>{let{configuratorData:t}=e,r=(0,ee.Cj)(),{lineItem:i}=(0,n.s)(),o={addons:i.accessories.addons.map(e=>({group:{technicalName:e.group.technicalName},technicalName:e.technicalName,quantity:e.quantity})),services:i.accessories.services.map(e=>({group:{technicalName:e.group.technicalName},technicalName:e.technicalName,quantity:e.quantity})),other:i.accessories.other.map(e=>({group:{technicalName:e.group.technicalName},technicalName:e.technicalName,quantity:e.quantity}))},l={...r,material:i.variant.material,productType:i.variant.product,accessories:o,size:i.variant.size,finalSelections:{...r.finalSelections,size:i.variant.size,productType:i.variant.product,material:i.variant.material,accessories:o}},c=(0,ee.ZN)(l);return(0,a.jsx)(U.O,{data:t,handler:c,fetchQuantities:async e=>{let t=await fetch("/api/quantity?id=".concat(e.id),{headers:{"Content-Type":"application/json","sw-access-key":String("SWSCVHF3YKNDZUHXMLJITHP0CA")}});return await t.json()},children:(0,a.jsx)($,{...e})})},er=e=>{let{lineItemId:t,refId:r,configuratorData:n,...o}=e,c=(0,u.A)(),{t:s}=(0,b.fJ)(),{isUpdatingCart:d,updateLineItem:p}=(0,l.B)(),m=(0,B.useRouter)(),y=async e=>{var r;await p(t,e),await m.push("/cart"),null===(r=o.onClose)||void 0===r||r.call(o)};return(0,a.jsx)(k.aF,{...o,"data-cy":"order:details.modal",children:(0,a.jsxs)(i.A,{children:[(0,a.jsx)(h.A,{variant:"h3",maxWidth:x.h1,mx:"auto",color:c.palette.primary.darkHover,align:"center",mb:4,children:s("ordercard.editModal.headline")}),(0,a.jsx)(et,{configuratorData:n,onSubmit:y,onCancel:()=>{var e;return null===(e=o.onClose)||void 0===e?void 0:e.call(o)},submitButtonProps:{disabled:d,"data-cy":"ordercard:editModal.button.save"}})]})})};var ea=r(75715),ei=r(84667),en=r(66266),eo=r(2446),el=r(66851),ec=r(10175),es=r(19283),ed=r(37395),eu=r(46089),eh=r(64544),ep=r(40860);let em=e=>(0,a.jsx)(k.x9,{sx:{borderBottomRightRadius:0,borderBottomLeftRadius:0,borderTopLeftRadius:"12px",borderTopRightRadius:"12px",display:"flex",justifyContent:"center"},...e}),ex=e=>{let{allowDelete:t,configuratorData:r}=e,{lineItem:o}=(0,n.s)(),{price:l,accessories:c,variant:d,id:m,referencedId:x,proLibItemOrders:y}=o,f=(0,u.A)(),{t:g}=(0,b.fJ)(),A=(0,B.useRouter)(),{enqueueSnackbar:w}=(0,el.dh)(),[I,C]=(0,H.useState)(!1),[S,q]=(0,H.useState)(!1),[P,L]=(0,H.useState)(!1),[_,T]=(0,H.useState)(!1),{addToWishlist:E,setWishListItem:R}=(0,eo.E)(),{setWishlistTrackingData:F}=(0,eo.q)(),{customer:J,contextToken:U}=(0,eu.L)(),{data:Q}=(0,ed.S)(N.h6.WISHLIST_ITEM_LIST(),{enabled:!!J&&!!U}),V=c.addons.reduce((e,t)=>
1{var r;return(null!=e?e:0)+(null!==(r=t.unitPrice)&&void 0!==r?r:0)},l.basePrice),X=async()=>{if(!J||!U){await A.push("/login?originalUrl=".concat(encodeURIComponent(A.asPath)));return}T(!0),R((0,ec.d4)(o));let e=r.variants.find(e=>e.id===o.variant.id);e||await (0,ep.m)({error:Error("Product ".concat(o.variant.product,"-").concat(o.variant.material,"-").concat(o.variant.size," with id: ").concat(o.variant.id," not found in configurator data for line item with id: ").concat(o.id)),options:{feature:"cart",type:"warning",component:"CartLineItem"}}),e&&F({product:e,quantity:l.quantity,addons:e.accessories.addons,calculatedUnitPrice:V});try{await E()}catch(e){w(g("cart.wishlistModal.failed"),{variant:"error"}),await (0,ep.m)({error:e instanceof Error?e:Error("Wishlist save failed"),options:{feature:"cart",type:"error",component:"CartLineItem"}}),T(!1);return}if(e){var t;(0,es.Fu)({product:e,quantity:l.quantity,addons:e.accessories.addons,calculatedUnitPrice:V,eventName:"add_to_wishlist",wishListItemsCount:(null!==(t=null==Q?void 0:Q.wishlistItems.length)&&void 0!==t?t:0)+1})}w(g("cart.wishlistModal.success"),{variant:"success",text:(0,a.jsx)(k.N_,{href:"/account/wishlist",target:"_blank",style:{textDecoration:"underline"},children:g("cart.wishlistModal.successLink")})}),T(!1),L(!1)},{allOrdersAreStandard:K}=(0,s.N)(),Y=c.other.some(e=>(0,G.Rc)(e.technicalName))&&y.length>1&&y.every(e=>!!e.proLibItem),Z=(0,ei.KH)("remove-desingstep-checkout")&&K;return(0,a.jsxs)(i.A,{pb:[3,4],sx:{borderBottom:"1px solid ".concat(f.palette.neutral.grey300)},children:[(0,a.jsxs)(v.A,{flexDirection:"row",justifyContent:"space-between",alignItems:"center",mb:3,children:[(0,a.jsxs)(h.A,{variant:"h4",color:f.palette.primary.darkHover,"data-cy":"staticwords:piece",children:[(0,M.g)(l.quantity)," ",g("staticwords.piece")]}),(0,a.jsxs)(v.A,{direction:"row",spacing:2,alignItems:"center",children:[(0,a.jsx)(D.A,{sx:{color:f.palette.primary.darkHover},onClick:()=>L(!0),"data-id":"cart_favorite",children:(0,a.jsx)(j.FE,{width:24,height:24,sx:{strokeWidth:1.5}})}),!Y&&(0,a.jsx)(D.A,{sx:{color:f.palette.primary.darkHover},"data-cy":"ordercard:action.edit",onClick:()=>q(!0),"data-id":"cart_edit",children:(0,a.jsx)(j.ff,{width:24,height:24})}),t&&(0,a.jsx)(D.A,{sx:{color:f.palette.primary.darkHover},onClick:()=>C(!0),"data-id":"cart_delete","data-cy":"ordercard:action.delete",children:(0,a.jsx)(j.ep,{width:24,height:24})})]})]}),(0,a.jsxs)(v.A,{direction:["column","row"],justifyContent:"space-between",children:[(0,a.jsxs)(i.A,{sx:{borderBottom:["1px solid ".concat(f.palette.neutral.grey300),"0px"]},pb:[3,0],mb:[3,0],maxWidth:540,width:"100%",children:[(0,a.jsx)(h.A,{variant:"body2",color:f.palette.neutral.grey800,mb:2,children:(0,eh.A)(c,"addons")}),(0,a.jsxs)(h.A,{variant:"body2",color:f.palette.neutral.grey800,mb:2,children:[(0,eh.A)(c,"designs"),Z&&(0,a.jsx)(en.e,{})]}),(0,a.jsx)(h.A,{variant:"body2",color:f.palette.neutral.grey800,mb:4,children:(0,eh.A)(c,"services")}),!Z&&(0,a.jsx)(ea.n,{"data-id":"cart_download-print-templates-link",renderAs:"TextButton",artworkVariant:d,addons:c.addons,children:(0,a.jsx)(i.A,{component:"span",children:g("ordercard.action.download")})})]}),(0,a.jsx)(v.A,{direction:"column",justifyContent:"flex-end",alignItems:"flex-end",children:(0,a.jsxs)(i.A,{children:[(0,a.jsxs)(h.A,{color:f.palette.neutral.grey800,sx:{typography:["bodyXS","body2"]},align:"right",mb:2,children:[g("staticwords.unitPrice"),": ",g("staticwords.pricePerPiece",{price:(0,O.i)(V)})]}),(0,a.jsx)(h.A,{color:f.palette.neutral.grey800,sx:{typography:["bodyXS","body2"]},align:"right",mb:3,children:g("staticwords.extraCosts",{price:(0,O.i)((0,W.r)(c))})}),(0,a.jsx)(h.A,{variant:"h4",color:f.palette.primary.darkHover,align:"right",children:(0,O.i)(l.totalPrice)})]})})]}),t&&(0,a.jsx)(z.G,{open:I,onClose:()=>C(!1),lineItemId:m,headline:g("ordercard.deleteModal.headline"),subline:g("ordercard.deleteModal.text")}),(0,a.jsx)(er,{configuratorData:r,open:S,onClose:()=>q(!1),lineItemId:m,refId:x}),(0,a.jsx)(k.aF,{open:P,onClose:()=>L(!1),PaperProps:{sx:{py:[8,12,12],px:[4,12,12],maxWidth:736}},children:(0,a.jsxs)(i.A,{children:[(0,a.jsx)(h.A,{variant:"h3",color:f.palette.primary.darkHover,align:"center",mb:4,children:g("cart.wishlistModal.title")}),(0,a.jsx)(h.A,{variant:"body1",align:"center",mb:4,children:g("cart.wishlistModal.description")}),(0,a.jsxs)(i.A,{display:"flex",justifyContent:"center",flexDirection:["column","row"],sx:{gap:[4,2]},children:[(0,a.jsx)(p.A,{variant:"outlined",size:"large",onClick:()=>L(!1),children:g("cart.wishlistModal.button.cancel")}),(0,a.jsx)(p.A,{disabled:_,"data-cy":"ordercard:wishlistModal.button.save",variant:"contained",color:"primary",size:"large",startIcon:(0,a.jsx)(j.FE,{width:24,height:24}),onClick:X,children:g("cart.wishlistModal.button.save")})]})]})})]})},ey=e=>{let{collapsibleText:t,allowDelete:r}=e,i=(0,u.A)(),{t:o}=(0,b.fJ)(),{lineItem:l}=(0,n.s)(),{isLineItemOpen:c,toggleLineItemOpen:d}=(0,s.N)(),[h,p]=(0,H.useState)(!1);return(0,a.jsxs)(v.A,{direction:"row",justifyContent:"flex-end",width:"100%",py:3,children:[(0,a.jsxs)(k.QW,{"data-id":"cart_price-detail-dropdown",typography:"body2",color:i.palette.primary.cta,onClick:()=>d(l.id),sx:{display:"flex",alignItems:"center"},children:[t,(0,a.jsx)(j.yQ,{width:18,height:18,ml:1,sx:{transform:c(l.id)?"rotate(180deg)":"rotate(0)"}})]}),r&&(0,a.jsx)(z.G,{headline:o("ordercard.deleteModal.headline"),subline:o("ordercard.deleteModal.text"),open:h,onClose:()=>p(!1),lineItemId:l.id})]})},ev=e=>{var t,r;let{children:o,data:l}=e,{lineItem:c}=(0,n.s)(),{isLineItemOpen:d}=(0,s.N)(),h=d(c.id),p=(0,H.useCallback)(e=>{e&&h&&setTimeout(()=>{e.scrollIntoView({block:"center"})},300)},[h]),m=(0,u.A)(),{t:x}=(0,b.fJ)(),[y]=(0,b.Mj)(E.OC,[]),v=y.includes(c.id),j=c.proLibItemOrders.some(e=>{var t;return(null===(t=e.proLibItem)||void 0===t?void 0:t.artworkCheckStatus.status)==="rejected"});return(0,a.jsxs)(i.A,{id:"lineItem-".concat(c.id),sx:{border:"1px solid ".concat(m.palette.neutral.grey300),borderRadius:"12px"},ref:p,children:[j&&(0,a.jsx)(em,{type:"error",children:x("ordercard.label.rejected")}),!j&&v&&(0,a.jsx)(em,{type:"order",children:x("ordercard.label.reordered",{name:null===(r=c.proLibItemOrders[0])||void 0===r?void 0:null===(t=r.proLibItem)||void 0===t?void 0:t.name})}),l&&(0,a.jsxs)(i.A,{px:[3,4],pt:[3,4],pb:[0,"2px"],position:"relative",children:[(0,a.jsx)(ex,{configuratorData:l,...e}),(0,a.jsx)(ey,{...e}),(0,a.jsx)(T.A,{in:d(c.id),timeout:300,children:(0,a.jsx)(i.A,{children:o})})]})]})};var ej=r(77039),ef=r(53101),eg=r(54703);let eb=e=>(t,r,a,i,n,o)=>
1{!(a<e)&&ej.Dp()&&ef.Uk({name:"<".concat(t,">"),op:"mount"===r?"ui.react.mount":"ui.react.update",onlyIfParent:!0,startTime:performance.timeOrigin+n,attributes:{[eg.JD]:"auto.ui.react.performance-profiler","ui.component_name":t,"ui.react.phase":r,"ui.react.actual_duration":a,"ui.react.base_duration":i}}).end(performance.timeOrigin+o)},eA=e=>{let{name:t,children:r,minDurationMs:i=2}=e;return(0,a.jsx)(H.Profiler,{id:t,onRender:eb(i),children:r})},ew=e=>{var t;let{data:r}=e,{data:u,isPackshotOnlyCart:h}=(0,l.B)(),{t:p}=(0,b.fJ)(),m=null==u?void 0:u.services.find(e=>"PCKS"===e.productType);return u?(0,a.jsx)(s.D,{cart:u,step:"CART",isPackshotOnlyCart:h,children:u.orders.length>0||u.services.length>0?(0,a.jsx)(eA,{name:"Cart",children:(0,a.jsxs)(i.A,{children:[(0,a.jsx)(_.K,{}),(0,a.jsx)(o.V,{Header:(0,a.jsx)(A,{}),MainComponent:(0,a.jsxs)(a.Fragment,{children:[u.orders.map((e,t)=>(0,a.jsx)(c.B,{order:e,index:t,children:e.lineItems.map(e=>(0,a.jsx)(n.A,{lineItem:e,children:(0,a.jsx)(eA,{name:"CartLineItem",children:(0,a.jsx)(ev,{collapsibleText:p("ordercard.action.priceDetails"),allowDelete:!0,data:r,children:(0,a.jsx)(d.E,{})})})},e.id))},t)),m&&(0,a.jsx)(P.U,{children:null===(t=m.productVersions)||void 0===t?void 0:t.map(e=>{var t;return(0,a.jsx)(eA,{name:"PackshotLineItem",children:(0,a.jsx)(L.n,{productVersion:e,price:m.price/(null!==(t=m.quantity)&&void 0!==t?t:1),lineItemId:m.id,allowDelete:!0})},e.id)})})]}),SummaryComponent:(0,a.jsx)(q,{})}),(0,a.jsx)(y,{})]})}):(0,a.jsx)(g,{})}):null};var eI=r(6319);let eC=e=>(0,a.jsx)(ew,{...e});var eN=!0;let eS=(0,eI.IJ)(eC,"off.light");eC.layout="off.light"},18283:(e,t,r)=>{"use strict";r.d(t,{OC:()=>y,fh:()=>v,zn:()=>j});var a=r(21962),i=r(79300),n=r(37942),o=r(82408),l=r(98998),c=r(26210),s=r(85766),d=r(49360),u=r(75461),h=r(73216),p=r(11866);let m=(e,t,r)=>{let a="SIDESINDIVIDUAL"===r;if(null!==t){let r=a&&t<u.v?u.v:t;return e.find(e=>e.quantityStart===r)}return a?e.find(e=>e.quantityStart===u.v):e[0]},x=(0,c.createContext)(void 0),y="reorderIds",v=e=>{let{children:t,sideOption:r,...u}=e,{selectedAddons:v,variant:j,productVersion:f,quantities:g}=u,{state:b}=(0,h.L)(),[A,w]=(0,c.useState)(!1),[I,C]=(0,c.useState)(()=>m(g,f.lastOrderQuantity,r)),[N,S]=(0,c.useState)(()=>(0,n.M)(j.accessories.services)),[k,q]=(0,c.useState)(!1),{data:P,addLineItem:L,isUpdatingCart:_}=(0,l.B)(),[D,T]=(0,d.Mj)(y,[]),M=j.accessories.other.find(e=>e.technicalName===f.sideOption),E=async()=>{if(!j.id||!I||!P||_)return;if("FBP"===j.product&&!r)return q(!0);q(!1);let e=(0,p.t)(b.finalSelections.accessories.addons,j).map(e=>({id:e.id,quantity:1,type:e.group.type})),t=N.map(e=>{let t=j.accessories.services.find(t=>t.technicalName===e.technicalName);return t?{id:null==t?void 0:t.id,quantity:1,type:null==t?void 0:t.group.type}:null}).filter(s.Gt),a=j.accessories.other.find(e=>e.technicalName===r),i=j.accessories.other.find(e=>e.technicalName===o.nI);if(!i)throw Error("Cannot add to cart without specifying count of artwork motifs");let n={variantId:j.id,quantity:I.quantityStart,accessories:[...e,...t,...a?[{id:a.id,type:a.group.type,quantity:1}]:[],{id:i.id,quantity:1,type:i.group.type}],reorder:{previousLineItemIds:P.orders.map(e=>e.lineItems.map(e=>e.id)).flat(1),proLibItems:[{id:f.id,quantity:I.quantityStart}]}},l=await L(n);l.reorderLineItemId&&T([...D,l.reorderLineItemId]),w(!0)},{totalPrice:H}=(0,c.useMemo)(()=>(0,i.Wf)({addons:v.map(e=>({technicalName:e.technicalName,group:{technicalName:e.group.technicalName}})),services:N,other:M?[M]:[]},I,j),[v,N,j,I,M]),O={...u,isItemAdded:A,price:H,onAddToCartClicked:E,quantity:I,setQuantity:C,services:N,setServices:S,sideOption:r,hasSideOptionError:k};return(0,a.jsx)(x.Provider,{value:O,children:t})},j=()=>{let e=(0,c.useContext)(x);if(void 0===e)throw Error("useAddCartItemContext must be used within a AddCartItemContextProvider");return e}},11866:(e,t,r)=>{"use strict";r.d(t,{t:()=>i});var a=r(85766);let i=(e,t)=>{var r;return t&&0!==e.length&&null!==(r=null==e?void 0:e.map(e=>{var r;return null!==(r=t.accessories.addons.find(t=>t.group.technicalName===e.group.technicalName&&t.technicalName===e.technicalName))&&void 0!==r?r:null}).filter(a.Gt))&&void 0!==r?r:[]}},6319:(e,t,r)=>{"use strict";r.d(t,{IJ:()=>n});var a=r(21962),i=r(85208);r(28026);let n=(e,t)=>{let r=t=>{let{errors:r}=t;return r?(console.error(r),(0,a.jsx)(i.A,{variant:"h1",color:"red",children:"Errors in shopware, see console"})):(0,a.jsx)(e,{...t})};return r.layout=t,r.displayName="WithShopwareErrorBoundary(".concat(e.displayName,")"),r}}},e=>{var t=t=>e(e.s=t);e.O(0,[1332,7499,670,2536,636,6593,8792],()=>t(96764)),_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.