PageSourceSearch

https://www.astastrings.org/_next/static/chunks/pages/cart-f0ba6a84f12fe1da.js

js astastrings.org collected 2026-10-01 11:38:56 UTC 11,069 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39190],{54476:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/cart",function(){return n(39406)}])},25452:function(e,t,n){"use strict";n.d(t,{C:function(){return PublicPageWrapper}});var i=n(85893),r=n(53768),a=n(43699),s=n(31677),l=n(53079);n(67294);var c=n(86374),o=n(9161),d=n(7638),u=n(87530);n(82431);var h=n(11722);let PublicPageWrapper=e=>{let{children:t,tenantData:n,error:m}=e;return m?(0,i.jsx)(a.xjn,{theme:(0,s.B1)({...u.rS,colors:{primary:l.rS.colors.blue}}),children:(0,i.jsx)(o.m,{})}):(null==n?void 0:n.tenant.result)?(0,i.jsx)(r.e,{client:c.l,children:(0,i.jsx)(h.B,{primaryColor:n.tenant.result.primaryColor,children:t})}):(0,i.jsx)(a.xjn,{theme:(0,s.B1)({...u.rS,colors:{primary:l.rS.colors.blue}}),children:(0,i.jsx)(d.Q,{})})}},93629:function(e,t,n){"use strict";n.d(t,{Gy:function(){return l},ep:function(){return c},jD:function(){return a},p6:function(){return s}});var i=n(82729),r=n(50456);function _templateObject(){let e=(0,i._)(["\n  query GetOtherItems($input: GetOtherItemsInput) {\n    getOtherItems(input: $input) {\n      results {\n        _id\n        name\n        price\n        units\n        status\n        categoryId\n        description\n        isLimitedUnits\n        visibility\n      }\n      totalCount\n    }\n  }\n"]);return _templateObject=function(){return e},e}function _templateObject1(){let e=(0,i._)(["\n  mutation CreateOtherItem($input: CreateOtherItemInput!) {\n    createOtherItem(input: $input) {\n      success\n      message\n      otherItem {\n        _id\n      }\n    }\n  }\n"]);return _templateObject1=function(){return e},e}function _templateObject2(){let e=(0,i._)(["\n  mutation UpdateOtherItem($input: UpdateOtherItemInput!) {\n    updateOtherItem(input: $input) {\n      success\n      message\n      otherItem {\n        _id\n      }\n    }\n  }\n"]);return _templateObject2=function(){return e},e}function _templateObject3(){let e=(0,i._)(["\n  mutation ChangeOtherItemStatus($input: ChangeOtherItemStatusInput!) {\n    changeOtherItemStatus(input: $input) {\n      success\n      message\n    }\n  }\n"]);return _templateObject3=function(){return e},e}let a=(0,r.Ps)(_templateObject()),s=(0,r.Ps)(_templateObject1()),l=(0,r.Ps)(_templateObject2()),c=(0,r.Ps)(_templateObject3())},85740:function(e,t,n){"use strict";var i=n(85893),r=n(48641),a=n(47741),s=n(35610);n(67294),t.Z=e=>{let{item:t,isIncrementing:n,isDecrementing:l,onIncrement:c,onDecrement:o,onRemove:d}=e,u=t.quantity>=1;return t.isLimitedUnits&&(t.quantity,t.units),(0,i.jsx)(r.Ug,{align:"center",justify:"center",children:(0,i.jsxs)(r.Ug,{spacing:0,align:"center",justify:"center",bg:"white",borderRadius:"md",display:"inline-flex",children:[(0,i.jsx)(a.zx,{"aria-label":"Decrease quantity",size:"sm",variant:"ghost",isDisabled:!u||l,onClick:e=>{e.stopPropagation(),u&&o(t._id)},"data-testid":"decrease-quantity-".concat(t.itemId),minW:"40px",h:"40px",p:0,fontSize:"xl",fontWeight:"bold",borderRadius:"md",color:"primary.500",_hover:{bg:"#E0E0E0"},children:l?(0,i.jsx)(s.$,{size:"sm"}):"−"}),(0,i.jsx)(r.xv,{fontSize:"sm",fontWeight:"bold",minW:"40px",textAlign:"center",color:"#121212",children:t.quantity||1}),(0,i.jsx)(a.zx,{"aria-label":"Increase quantity",size:"sm",variant:"ghost",isDisabled:n,onClick:e=>{e.stopPropagation(),c(t._id)},"data-testid":"increase-quantity-".concat(t.itemId),minW:"40px",h:"40px",p:0,fontSize:"xl",fontWeight:"bold",borderRadius:"md",color:"primary.500",_hover:{bg:"#E0E0E0"},children:n?(0,i.jsx)(s.$,{size:"sm"}):"+"})]})})}},39406:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return k},default:function(){return cart}});var i=n(85893),r=n(67294),a=n(25452),s=n(66252),l=n(90195),c=n(48641),o=n(2821),d=n(11163),u=n(69171),h=n(39300),m=n(33995),p=n(46320),x=n(37887),f=n(80419),g=n(47741),j=n(36158),y=n(50371),b=n(32156),v=n(47503),C=n(93629),_=n(88216),I=n(85740);let OtherItemsCartList=()=>{var e;let[t,n]=r.useState({}),[a,s]=r.useState({}),[l,o]=r.useState(!1),{items:u,addToCart:h,updateQuantity:m,refreshCart:O,removeFromCart:k}=(0,p.j)(),E=(0,f.pm)(),S=(0,d.useRouter)(),{data:w,loading:P,error:R}=(0,x.a)(C.jD,{variables:{input:{limit:3,offset:0,filter:{status:"ACTIVE"}}},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-and-network"}),z=(null==w?void 0:null===(e=w.getOtherItems)||void 0===e?void 0:e.results)||[],updateLoadingState=(e,t,n
1)=>{s(i=>({...i,[e]:{...i[e]||{},[t]:n}}))},q=r.useCallback(async e=>{try{let t={itemId:e,itemType:_.hI.OTHER_ITEM,otherItemId:e,quantity:1,quantityMode:v.Fy.ADD};await h([t]),n(t=>({...t,[e]:(t[e]||0)+1})),E({title:"Added to Cart",description:"Other item has been successfully added to your cart.",status:"success",duration:3e3,isClosable:!0})}catch(e){E({title:"Error",description:e instanceof Error?e.message:"Failed to add other item to cart. Please try again.",status:"error",duration:5e3,isClosable:!0})}},[]),D=r.useCallback(async e=>{var i,r;updateLoadingState(e,"inc",!0);let a=null!==(r=null==u?void 0:null===(i=u.find(t=>t.type===_.hI.OTHER_ITEM&&t.itemId===e))||void 0===i?void 0:i._id)&&void 0!==r?r:"";try{await m({cartItemId:a,quantity:(t[e]||0)+1}),n(t=>({...t,[e]:(t[e]||0)+1})),O()}finally{setTimeout(()=>updateLoadingState(e,"inc",!1),300)}},[updateLoadingState]),L=r.useCallback(async e=>{var i,r;updateLoadingState(e,"dec",!0);let a=null!==(r=null==u?void 0:null===(i=u.find(t=>t.type===_.hI.OTHER_ITEM&&t.itemId===e))||void 0===i?void 0:i._id)&&void 0!==r?r:"";try{let i=(t[e]||0)-1;if(i<=0)try{await k(a),E({title:"Removed from Cart",description:"Cart item has been successfully removed from your cart.",status:"success",duration:3e3,isClosable:!0})}catch(e){E({title:"Error",description:e instanceof Error?e.message:"Failed to remove item from cart. Please try again.",status:"error",duration:5e3,isClosable:!0})}else await m({cartItemId:a,quantity:(t[e]||0)-1});O(),n(t=>{if(i<=0){let n={...t};return delete n[e],n}return{...t,[e]:i}})}finally{setTimeout(()=>updateLoadingState(e,"dec",!1),300)}},[updateLoadingState]);return(0,r.useEffect)(()=>{let e={};o(null==u?void 0:u.some(e=>e.type===_.hI.MEMBERSHIP)),null==u||u.forEach(t=>{t.type===_.hI.OTHER_ITEM&&t.itemId&&(e[t.itemId]=t.quantity)}),n(e)},[u,z]),(0,i.jsxs)(c.xu,{p:{base:4,md:5},bg:"white",borderRadius:"md",boxShadow:"md",children:[(0,i.jsxs)(c.kC,{justify:"space-between",align:"center",children:[(0,i.jsx)(c.xv,{fontWeight:"bold",fontSize:"md",children:"Other Items"}),(0,i.jsx)(g.zx,{variant:"ghost",textColor:"primary.500",textDecoration:"underline",onClick:()=>S.replace("/cart/other-items"),children:"View All"})]}),(0,i.jsx)(c.xu,{borderRadius:"md",children:(0,i.jsxs)(c.gC,{spacing:3,align:"stretch",p:2,backgroundColor:"secondary.500",borderRadius:"8px",children:[P?(0,i.jsx)(c.xu,{textAlign:"center",py:4,height:"75px",children:(0,i.jsx)(j.N2,{height:"20px",noOfLines:2})}):(0,i.jsx)(i.Fragment,{children:0===z.length&&(0,i.jsx)(c.xv,{color:"grey.500",textAlign:"center",py:4,children:"No other items available"})}),null==z?void 0:z.map(e=>{var r,s;let l=t[e._id]||0;return(0,i.jsx)(c.xu,{borderRadius:"md",p:2,children:(0,i.jsxs)(c.xu,{children:[(0,i.jsxs)(c.kC,{align:"center",justify:"space-between",children:[(0,i.jsxs)(c.kC,{direction:"column",flex:"1",children:[(0,i.jsx)(c.xv,{fontSize:"sm",fontWeight:"medium",mb:1,children:e.name}),(0,i.jsx)(b.i_,{value:(0,y.h)(null==e?void 0:e.price),fontSize:"sm"})]}),(0,i.jsx)(c.Ug,{spacing:4,children:0===l?(0,i.jsx)(g.zx,{variant:"solid",size:"sm",backgroundColor:"primary.500",onClick:()=>q(e._id),children:"Add"}):(0,i.jsx)(I.Z,{item:{...e,quantity:l,itemId:e._id},isIncrementing:(null===(r=a[e._id])||void 0===r?void 0:r.inc)||!1,isDecrementing:(null===(s=a[e._id])||void 0===s?void 0:s.dec)||!1,onIncrement:()=>D(e._id),onDecrement:()=>L(e._id),onRemove:()=>n(t=>({...t,[e._id]:0}))})})]}),(0,i.jsx)("hr",{})]})},e._id)})]})})]})};var cart_CartPage=()=>{let{items:e,loading:t,refreshCart:n}=(0,p.j)(),a=(0,d.useRouter)(),x=(0,s.x)(),f=!!(null==e?void 0:e.length),{isOpen:g,onOpen:j,onClose:y}=(0,l.qY)(),{hasEventTickets:b,needsAttendeeDetails:v,isAttendeeDetailsComplete:C,hasUnvalidatedAttendees:_}=(0,m.q)(),I=b&&(_||!C),[O,k]=r.useState(!1),[E,S]=r.useState(!1);r.useEffect(()=>{let e=!0;S(!1);let fetchFreshCart=async()=>{try{await n()}catch(e){console.warn("Failed to fetch fresh cart on cart page load:",e)}finally{e&&S(!0)}};return fetchFreshCart(),()=>{e=!1}},[n,a.asPath]);let w=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(w.current&&"/cart"===a.pathname)return;let refetchAttendeeDetails=async()=>{try{await x.refetchQueries({include:[m.e]}),w.current=!0}catch(e){console.warn("Failed to refetch attendee details on cart page load:",e)}};"/cart"===a.pathname&&refetchAttendeeDetails();let handleVisibilityChange=()=>{"visible"===document.visibilityState&&"/cart"===a.pathname&&refetchAttendeeDetails()};return document.addEventListener("visibilitychange",handleVisibilityChange),()=>{document.removeEventListener("visibilitychange",handleVisibilityChange),"/cart"!==a.pathname&&(w.current=!1)}},[x,a.pathname]);let handleCheckoutClick=async()=>
1{if(b&&v&&I){j();return}k(!0);try{await a.push("/cart/checkout")}catch(e){console.error("Failed to navigate to checkout:",e)}finally{k(!1)}},handleAttendeeRegistrationComplete=async()=>{y(),k(!0);try{await a.push("/cart/checkout")}catch(e){console.error("Failed to navigate to checkout:",e)}finally{k(!1)}};return r.useEffect(()=>{a.prefetch("/cart/checkout").catch(()=>void 0)},[a]),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(h.C1,{title:"Shopping Cart","data-testid":"cart-page",children:E?(null==e?void 0:e.length)===0?(0,i.jsx)(h.OP,{}):(0,i.jsxs)(c.rj,{templateColumns:f?{base:"1fr",lg:"2fr 1fr"}:{base:"1fr"},gap:{base:4,lg:6},children:[(0,i.jsx)(c.P4,{...f?{}:{display:"flex",justifyContent:"center"},children:(0,i.jsx)(h.Gl,{items:e||[],loading:t})}),e&&e.length>0&&(0,i.jsx)(c.P4,{children:(0,i.jsx)(c.xu,{position:{base:"relative",lg:"sticky"},top:{lg:"20px"},children:(0,i.jsxs)(c.Kq,{spacing:4,children:[(0,i.jsx)(h.He,{showCheckoutButton:!0,checkoutButtonText:"Proceed to Checkout",onCheckoutClick:handleCheckoutClick,isCheckoutDisabled:I,isCheckoutLoading:O}),(0,i.jsx)(OtherItemsCartList,{}),(0,i.jsx)(h.pE,{})]})})})]}):(0,i.jsx)(u.g,{minH:"400px"})}),(0,i.jsxs)(o.u_,{isOpen:g,onClose:y,size:{base:"full",md:"6xl"},scrollBehavior:"inside",children:[(0,i.jsx)(o.ZA,{}),(0,i.jsxs)(o.hz,{maxH:{base:"100vh",md:"90vh"},m:{base:0,md:4},borderRadius:{base:0,md:"md"},children:[(0,i.jsx)(o.xB,{children:"Event Registration"}),(0,i.jsx)(o.ol,{}),(0,i.jsx)(o.fe,{pb:6,children:(0,i.jsx)(h.cz,{onComplete:handleAttendeeRegistrationComplete})})]})]})]})},O=n(32672),k=!0,cart=e=>{let{tenantData:t,error:n}=e;return(0,i.jsx)(a.C,{tenantData:t,error:n,children:(0,i.jsx)(O.Yf,{children:(0,i.jsx)(cart_CartPage,{})})})}}},function(e){e.O(0,[9669,9041,47376,78428,94451,27313,29504,15097,64986,86439,52176,197,71843,11440,32464,49774,92888,40179],function(){return e(e.s=54476)}),_N_E=e.O()}]);
2//# sourceMappingURL=cart-f0ba6a84f12fe1da.js.map

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.