PageSourceSearch

https://www.bridgemuseum.com.au/dist/assets/index-BlVtUHV1.js

js bridgemuseum.com.au collected 2026-10-09 05:04:18 UTC 15,240 bytes, 1 lines download raw bytes

1import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as x}from"./loadcontainer-PzAIb_Sc.js";import{r as K}from"./bookingutils-eyVfbJAh.js";import{s as X}from"./toast-CLSQraIx.js";import{A as ge}from"./index-BApgSYvf.js";import"./main-D3YWLS5m.js";import"./toastr-bNSR7Tgz.js";function P(o){if(!o)return 0;const n=String(o).replace(/[^0-9.]/g,"");return parseFloat(n)||0}function pe(o){const n=(o||"").toLowerCase();return n.includes("adult")?"adult":n.includes("child")?"child":n.includes("concession")?"concession":n.includes("infant")?"infant":n||"adult"}const Ce=({cartdata:o,cartProps:n,title:E="Cart",items:m,addons:f=[],date:v,time:y,onEdit:U,onRemove:w,onEditAddon:N,onRemoveAddon:k,onUpdateAddonQuantity:B,onCheckout:H,checkoutUrl:ee,labels:S,afterPayHelpLabel:te})=>{var O,G;const le=ee??(n==null?void 0:n.checkoutUrl)??"/checkout",C=(n==null?void 0:n.bookingUrl)??"/book",q=(n==null?void 0:n.removeItemUrl)??"/api/cart/removeitem",g=te??((G=(O=S==null?void 0:S.otherLabels)==null?void 0:O.find(t=>t.key==="afterpayhelp"))==null?void 0:G.label)??null;x.useEffect(()=>{K(o??void 0)},[o==null?void 0:o.script]);const{entries:$,items:h,dateStr:L,timeStr:se,editUrl:I,totalStr:T,afterPayStr:D,isEmpty:p,sectionTitle:R,orderItemId:W,productCode:M}=x.useMemo(()=>{var Y,J,V;if(!((J=(Y=o==null?void 0:o.data)==null?void 0:Y.ParentSections)!=null&&J.length)){const c=!(m!=null&&m.length)&&!(o!=null&&o.isSuccess),r=(m==null?void 0:m.map(s=>({...s,label:s.type})))??[];return{entries:[],items:r,dateStr:v??null,timeStr:y??null,editUrl:null,totalStr:null,afterPayStr:null,isEmpty:(n==null?void 0:n.isEmpty)!==void 0?n.isEmpty:c,sectionTitle:"",orderItemId:null,productCode:null}}const t=o.data,i=[];let a=0;for(const c of t.ParentSections??[])for(const r of(c==null?void 0:c.Sections)??[])for(const s of(r==null?void 0:r.Products)??[]){const Z=[];if((V=s==null?void 0:s.Pax)!=null&&V.length)for(const j of s.Pax)j.Qty>0&&Z.push({type:pe(j.Name),quantity:j.Qty,price:j.Amount,label:j.Name||"Adult"});i.push({key:`${(s==null?void 0:s.ItemID)??a}-${(s==null?void 0:s.Code)??a}`,sectionTitle:(c==null?void 0:c.Title)??(r==null?void 0:r.Title)??(s==null?void 0:s.Title)??"Experience",sectionNote:(r==null?void 0:r.Note)??"",items:Z,dateStr:(s==null?void 0:s.Date)??null,timeStr:(s==null?void 0:s.Time)??null,editUrl:(s==null?void 0:s.EditUrl)??(r==null?void 0:r.EditUrl)??C,orderItemId:(s==null?void 0:s.ItemID)??null,productCode:(s==null?void 0:s.Code)??null}),a++}const l=i[0],ue=i.reduce((c,r)=>c+r.items.length,0)===0;return{entries:i,items:(l==null?void 0:l.items)??[],dateStr:(l==null?void 0:l.dateStr)??v??null,timeStr:(l==null?void 0:l.timeStr)??y??null,editUrl:(l==null?void 0:l.editUrl)??null,totalStr:t.Total??t.PaymentTotal??null,afterPayStr:t.AfterPay??null,isEmpty:(n==null?void 0:n.isEmpty)!==void 0?n.isEmpty:ue,sectionTitle:(l==null?void 0:l.sectionTitle)??"",orderItemId:(l==null?void 0:l.orderItemId)??null,productCode:(l==null?void 0:l.productCode)??null}},[o,n,m,v,y,C]);x.useEffect(()=>(window.__leaveBookingSkipModal=p,()=>{window.__leaveBookingSkipModal=!1}),[p]),x.useEffect(()=>{const t=F.current;if(!t||!g)return;const i=a=>{a.target.closest("a")&&(a.preventDefault(),A(!0))};return t.addEventListener("click",i),()=>t.removeEventListener("click",i)},[g]),x.useEffect(()=>{if(p&&!h.length){delete window.__getAbandonBookingState;return}return window.__getAbandonBookingState=()=>({productCode:null,selectedDate:L??null,selectedTimeSlot:M??null,selectedPax:h.length>0?h.map(t=>({code:t.type.toUpperCase(),quantity:t.quantity,title:t.label})):null}),()=>{delete window.__getAbandonBookingState}},[p,h,L,M]);const ne=h.reduce((t,i)=>t+P(i.price)*i.quantity,0),ie=f.reduce((t,i)=>t+i.price*i.quantity,0),ae=T?P(T):ne+ie,oe=T??`$${ae.toFixed(2)}`,re=()=>{U?U():I&&(window.location.href=I)},de=()=>{H?H():window.location.href=le},[u,_]=x.useState(!1),[d,b]=x.useState(null),[ce,A]=x.useState(!1),F=x.useRef(null),xe=t=>{if(w){w();return}b(t??null)},fe=async()=>{if(w){w(),b(null);return}const t=(d==null?void 0:d.orderItemId)??W;if(!(!t||!q||u)){_(!0);try{const a=await(await fetch(q,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({removeCartItemId:t})})).json().catch(()=>({}));a!=null&&a.isSuccess?(K(a),window.location.reload()):(_(!1),b(null),X((a==null?void 0:a.message)??"Could not remove item."))}catch{_(!1),b(null),X("Could not remove item.")}}},z=()=>{b(null)},me=d!==null,he=(d==null?void 0:d.sectionTitle)||R||"this item",Q=(t,i)=>{const a=f.find(l=>l.id===t);if(a&&B){const l=Math.max(0,a.quantity+i);B(t,l)}};return p?e.jsx("div",{className:"min-h-screen pt-6 pb-12 lg:pt-16 lg:px-12 lg:pb-[100px]",children:e.jsx("div",{className:"container mx-auto",children:e.jsxs("div",{className:"flex flex-col gap-8 lg:gap-10 items-center max-w-[900px] mx-auto w-full",children:[e.jsx("div",{className:"border-b-[3px] border-[#00064f] pb-4 lg:pb-6 w-full",children:e.jsx("h2",{className:"h2 text-center",children:E})}),e.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center p-5 lg:p-8 w-full",children:[e.jsx("p",{className:"text-[18px] text-[#363945]",children:"Your cart is empty."}),e.jsxs("a",{href:C,className:"bg-[#fdc55a] flex gap-2 items-center justify-center min-h-[48px] px-8 py-3 rounded-[48px] text-[#00064f] text-[18px] font-bold leading-[1.75] hover:opacity-90 transition-opacity no-u
1nderline",children:["Book now",e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9 18L15 12L9 6",stroke:"#00064f",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})})}):e.jsxs("div",{className:"min-h-screen pt-6 pb-12 lg:pt-16 lg:px-12 lg:pb-[100px]",children:[me&&e.jsxs("div",{className:"fixed inset-0 z-[200] flex flex-col items-center justify-center px-4",role:"dialog","aria-modal":"true","aria-labelledby":"cart-remove-title",children:[e.jsx("button",{type:"button",className:"absolute inset-0 bg-[#000000]/60","aria-label":"Close",onClick:z}),e.jsxs("div",{className:"relative w-full max-w-[600px] bg-bg-inverse rounded p-8 shadow-lg text-text-inverse",children:[e.jsx("h3",{id:"cart-remove-title",className:"font-bold h5 mb-4",children:"Remove"}),e.jsxs("p",{className:"text-[16px] font-light leading-[1.75] mb-6",children:["Are you sure you want to remove ",e.jsx("strong",{children:he}),"?"]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[e.jsx("button",{type:"button",onClick:fe,disabled:u,className:"o-btn o-btn--primary o-btn--lg flex-1 disabled:opacity-50 disabled:cursor-not-allowed",children:u?e.jsx("span",{className:"inline-block w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin","aria-hidden":!0}):"Yes"}),e.jsx("button",{type:"button",onClick:z,disabled:u,className:"o-btn o-btn--secondary-inverse o-btn--lg flex-1 disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"})]})]})]}),e.jsx("div",{className:"container mx-auto",children:e.jsxs("div",{className:"flex flex-col gap-8 lg:gap-10 items-end max-w-[900px] mx-auto w-full",children:[e.jsx("div",{className:"border-b-[3px] border-[#00064f] pb-4 lg:pb-6 flex lg:items-center lg:justify-center relative w-full",children:e.jsx("h2",{className:"h2",children:E})}),e.jsxs("div",{className:"bg-white flex flex-col gap-6 items-end p-5 lg:p-8 w-full rounded",children:[($.length>0?$:[{key:"fallback",sectionTitle:R,sectionNote:"",items:h,dateStr:L,timeStr:se,editUrl:I,orderItemId:W,productCode:M}]).map((t,i,a)=>e.jsxs("div",{className:"flex flex-col gap-6 items-start w-full",children:[e.jsx("h3",{className:"h5 text-[#00064f]",children:t.sectionTitle}),e.jsxs("div",{className:"flex flex-col gap-[8px] items-start w-full",children:[t.items.map(l=>e.jsxs("div",{className:"flex items-start w-full text-[18px] min-h-8 lg:flex-nowrap",children:[e.jsx("div",{className:"flex flex-col font-bold justify-end text-[#00064f] min-w-[120px] lg:w-[260px]",children:e.jsx("p",{className:"leading-[1.75]",children:l.label})}),e.jsx("div",{className:"flex lg:flex-1 flex-col font-light justify-end text-[#363945] lg:w-auto",children:e.jsxs("p",{className:"leading-[1.75]",children:["Qty: ",l.quantity]})}),e.jsx("div",{className:"flex flex-col font-bold justify-end text-[#00064f] text-right flex-1 lg:flex-none pl-2 md:pl-0",children:e.jsx("div",{className:"leading-[1.75]",dangerouslySetInnerHTML:{__html:l.price}})})]},`${l.type}-${l.label}`)),t.dateStr&&e.jsxs("div",{className:"flex items-start w-full text-[18px] min-h-8",children:[e.jsx("div",{className:"flex flex-col font-bold justify-end text-[#00064f] min-w-[120px] lg:w-[260px]",children:e.jsx("p",{className:"leading-[1.75]",children:"Museum Date"})}),e.jsx("div",{className:"flex flex-1 flex-col font-light justify-end text-[#363945]",children:e.jsx("p",{className:"leading-[1.75]",children:t.dateStr})})]}),t.timeStr&&e.jsxs("div",{className:"flex items-start w-full text-[18px] min-h-8",children:[e.jsx("div",{className:"flex flex-col font-bold justify-end text-[#00064f] min-w-[120px] lg:w-[260px]",children:e.jsx("p",{className:"leading-[1.75]",children:"Time"})}),e.jsx("div",{className:"flex flex-1 flex-col font-light justify-end text-[#363945]",children:e.jsx("p",{className:"leading-[1.75]",children:t.timeStr})})]}),t.sectionNote&&e.jsx("div",{className:"flex items-start w-full text-[18px] min-h-8",children:e.jsx("div",{className:"flex flex-1 flex-col font-light justify-end text-[#363945]",children:e.jsx("p",{className:"leading-[1.75]",children:t.sectionNote})})})]}),e.jsxs("div",{className:"flex gap-[8px] items-start",children:[t.editUrl?e.jsxs("a",{href:t.editUrl,className:"o-btn o-btn--tertiary o-btn--sm gap-1 cursor-pointer js-leavebooking-ignored",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.333 2.667a1.333 1.333 0 0 1 1.884 1.884L5.884 11.667H4v-1.884l7.333-7.116z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Edit"]}):e.jsxs("button",{onClick:re,type:"button",className:"o-btn o-btn--tertiary o-btn--sm gap-1 cursor-pointer",children:[e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.333 2.667a1.333 1.333 0 0 1 1.884 1.884L5.884 11.667H4v-1.884l7.333-7.116z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Edit"]}),e.jsxs("button",{onClick:()=>xe(t),type:"button",disabled:u,className:"o-btn o-btn--tertiary o-btn--sm gap-1 cursor-pointer",children:[u&&(d==null?void 0:d.key)===t.key?e.jsx("span",{className:"inline-block w-4 h-4 border-2 border-[#00064f] border-t-transparent roun
1ded-full animate-spin","aria-hidden":!0}):e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M12 4L4 12M4 4l8 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),"Remove"]})]}),i<a.length-1&&e.jsx("div",{className:"bg-[#dadada] h-px w-full"})]},t.key)),e.jsx("div",{className:"bg-[#dadada] h-px w-full"}),f.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-6 items-start w-full",children:[e.jsx("h3",{className:"h5 text-[#00064f]",children:"Add ons"}),e.jsx("div",{className:"flex flex-col gap-[8px] items-start w-full",children:f.map(t=>e.jsxs("div",{className:"flex items-start w-full text-[18px] min-h-8",children:[e.jsx("div",{className:"flex flex-col font-bold justify-end text-[#00064f] min-w-[120px] lg:w-[260px]",children:e.jsx("p",{className:"leading-[1.75]",children:t.name})}),e.jsxs("div",{className:"flex flex-1 gap-0 items-center",children:[e.jsx("button",{onClick:()=>Q(t.id,-1),disabled:t.quantity===0,type:"button",className:"bg-[rgba(0,0,0,0.05)] flex items-center justify-center w-8 h-8 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-[rgba(0,0,0,0.1)] transition-colors",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M5 10H15",stroke:"#00064f",strokeWidth:"2",strokeLinecap:"round"})})}),e.jsx("div",{className:"bg-[#00064f] flex flex-col h-8 items-center justify-center w-10",children:e.jsx("span",{className:"text-[16px] font-bold leading-[1.75] text-center text-white",children:t.quantity})}),e.jsx("button",{onClick:()=>Q(t.id,1),type:"button",className:"bg-[rgba(0,0,0,0.05)] flex items-center justify-center w-8 h-8 hover:bg-[rgba(0,0,0,0.1)] transition-colors",children:e.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M10 5V15M5 10H15",stroke:"#00064f",strokeWidth:"2",strokeLinecap:"round"})})})]}),e.jsx("div",{className:"flex flex-col font-bold justify-end text-[#00064f] text-right whitespace-nowrap",children:e.jsxs("p",{className:"leading-[1.75]",children:["$",(t.price*t.quantity).toFixed(2)]})})]},t.id))}),e.jsxs("div",{className:"flex gap-[8px] items-start",children:[e.jsx("button",{type:"button",onClick:()=>f[0]&&(N==null?void 0:N(f[0].id)),className:"bg-white border-2 border-[#00064f] border-solid flex gap-1 h-[32px] items-center justify-center px-4 py-1 rounded-[48px] text-[#00064f] text-[14px] font-bold leading-[1.2] hover:bg-[#00064f]/5 transition-colors",children:"Edit"}),e.jsx("button",{type:"button",onClick:()=>f[0]&&(k==null?void 0:k(f[0].id)),className:"bg-white border-2 border-[#00064f] border-solid flex gap-1 h-[32px] items-center justify-center px-4 py-1 rounded-[48px] text-[#00064f] text-[14px] font-bold leading-[1.2] hover:bg-[#00064f]/5 transition-colors",children:"Remove"})]})]}),e.jsx("div",{className:"bg-[#00064f] h-[3px] w-full"})]}),e.jsxs("div",{className:"flex items-center justify-between w-full",children:[e.jsx("div",{className:"flex shrink-0 flex-col justify-end text-[#00064f]",children:e.jsxs("div",{children:[e.jsx("span",{className:"h5 leading-[1.5]",children:"Order total"}),e.jsx("span",{className:"ml-1 text-[14px] leading-[1.75]",children:"(Inc GST)"})]})}),e.jsx("div",{className:"flex flex-col justify-end text-[#00064f] text-right",children:e.jsx("p",{className:"h5 leading-[1.5]",dangerouslySetInnerHTML:{__html:oe}})})]}),e.jsxs("div",{className:"text-right w-full lg:w-auto",children:[D&&e.jsxs("div",{className:"text-[14px] text-right mt-4 text-[#363945] font-light leading-[1.75]",children:[e.jsxs("div",{className:"inline-flex items-center",children:[e.jsx("span",{dangerouslySetInnerHTML:{__html:D}}),e.jsx("img",{src:"/www_shared/assets/img/paymentlogo-afterpay-horizontal.png",alt:"",className:"ml-2 inline-block max-w-[106px] align-middle"})]}),g&&e.jsx("div",{ref:F,className:"js-leavebooking-ignored inline-block ml-3 align-middle [&_a]:cursor-pointer [&_a]:underline",dangerouslySetInnerHTML:{__html:g}})]}),g&&ce&&e.jsx(ge,{onClose:()=>A(!1)})]}),e.jsxs("button",{onClick:de,type:"button",className:"o-btn o-btn--primary o-btn--lg o-btn--icon-right w-full lg:w-auto",children:["Continue to checkout",e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"
1currentColor",children:e.jsx("path",{d:"M12.6 12L8 7.4L9.4 6L15.4 12L9.4 18L8 16.6L12.6 12Z"})})]})]})]})})]})};export{Ce as default};

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.