(globalThis.webpackChunkbooktics=globalThis.webpackChunkbooktics||[]).push([[8155],{4623:(e,t,a)=>{"use strict";a.r(t),a.d(t,{Container:()=>u,StyledFilterSelection:()=>h,StyledItemCard:()=>x,StyledModal:()=>g,StyledSinglePage:()=>p});var n=a(52762),r=a(59e3),i=a(22564),o=a(75778);const s=n.css`
    .bkt-semi-bold-text {
        font-weight: 600;
        font-size: 16px;
    }
`,l=n.css`
    .bkt-hidden-input {
        height: 0;
        margin-top: -22px;

        .ant-form-item-control-input {
            display: none;
        }
    }
`,c=n.css`
    .ant-form-item .ant-form-item-label > label.ant-form-item-required {
        &::before {
            display: none;
        }

        &::after {
            display: inline-block;
            margin-inline-end: 4px;
            color: #ff4d4f;
            font-size: 14px;
            font-family: SimSun, sans-serif;
            line-height: 1;
            content: "*";
            visibility: visible;
        }
    }
`,d=n.css`
    @media (max-width: ${o.a?.xl}px) {
        padding: 20px;
    }
`,m=n.css`
    .bkt-container-row {
        max-width: 1200px;
    }
`,u=(0,r.A)(i.Flex)`
    width: 100%;
    height: 100%;
    margin: 0 auto;
    padding: 45px;
    color: ${({theme:e})=>e.colors.neutralLightDark};

    .bkt-row-layout {
        min-height: 600px;
    }

    ${m}
    ${s}
    ${d}
    ${l}
    ${c}
`,p=(0,r.A)(i.Flex)`
    min-height: 100%;
    margin: 0 auto;
    padding: 45px 100px;
    max-width: 1200px;
    color: ${({theme:e})=>e.colors.neutralLightDark};

    .bkt-row-layout {
        min-height: 500px;
    }

    ${m}
    ${s}
    ${d}
    ${l}
    ${c}
`,h=(0,r.A)(i.SelectInput)`
    min-width: 143px;
`,g=(0,r.A)(i.Modal)`
    &.ant-modal {
        width: 90% !important;
        max-width: 1100px;
    }

    .ant-modal-content {
        border: 1px solid ${({theme:e})=>e.colors.inputBorder};
        border-radius: 10px;
    }

    .ant-modal-body {
        padding: 0;

        .bkt-row-layout {
            min-height: 600px;

            @media (max-width: ${o.a?.xxl}px) {
                min-height: 500px;
            }
        }

        ${l}
        ${c}
    }
`,x=(0,r.A)(i.Card)`
    height: ${({height:e})=>e||"522px"};
    border-radius: 12px;
    border: 1px solid #e4e4e7;
    box-shadow: none !important;

    .ant-card-body {
        height: 100%;
        padding: 20px;

        .bkt-${({context:e})=>e||"service"}-frontend-inner {
            height: 100% !important;
        }
    }

    .bkt-${({context:e})=>e||"service"}-img {
        border-radius: 10px;
        object-fit: cover;
    }

    .bkt-${({context:e})=>e||"service"}-text {
        color: #0e0f0c;
    }

    .bkt-${({context:e})=>e||"service"}-price {
        font-size: 20px;
        color: ${({theme:e})=>e.colors.neutralLightDark};
        font-weight: 700;
    }

    /* Additional styling for description text with ellipsis */
    .bkt-${({context:e})=>e||"service"}-description {
        display: -webkit-box;
        -webkit-line-clamp: ${({descriptionLines:e})=>e||3};
        -webkit-box-orient: vertical;
        overflow: hidden;
        word-break: break-word;
        margin-bottom: 10px;
    }

    /* Title text with ellipsis */
    .bkt-${({context:e})=>e||"service"}-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 8px;
        font-weight: 600;
    }
`},13722:(e,t,a)=>{var n={"./af.js":65662,"./am.js":82355,"./ar-dz.js":48361,"./ar-iq.js":13309,"./ar-kw.js":79865,"./ar-ly.js":85592,"./ar-ma.js":81289,"./ar-sa.js":40539,"./ar-tn.js":54405,"./ar.js":2338,"./az.js":51130,"./be.js":51532,"./bg.js":39990,"./bi.js":95944,"./bm.js":71092,"./bn-bd.js":64608,"./bn.js":92509,"./bo.js":59294,"./br.js":72745,"./bs.js":25530,"./ca.js":25993,"./cs.js":9751,"./cv.js":4780,"./cy.js":95681,"./da.js":20325,"./de-at.js":32878,"./de-ch.js":13672,"./de.js":50494,"./dv.js":82187,"./el.js":54072,"./en-au.js":59881,"./en-ca.js":21995,"./en-gb.js":72026,"./en-ie.js":17329,"./en-il.js":97690,"./en-in.js":60912,"./en-nz.js":35571,"./en-sg.js":12673,"./en-tt.js":2619,"./en.js":65826,"./eo.js":33713,"./es-do.js":61219,"./es-mx.js":64719,"./es-pr.js":3532,"./es-us.js":32498,"./es.js":47317,"./et.js":4288,"./eu.js":94007,"./fa.js":90292,"./fi.js":89964,"./fo.js":17674,"./fr-ca.js":86290,"./fr-ch.js":73433,"./fr.js":813,"./fy.js":59836,"./ga.js":54061,"./gd.js":68418,"./gl.js":33562,"./gom-latn.js":78660,"./gu.js":57409,"./he.js":92010,"./hi.js":52830,"./hr.js":15811,"./ht.js":8809,"./hu.js":38298,"./hy-am.js":94309,"./id.js":87420,"./is.js":15513,"./it-ch.js":19286,"./it.js":33900,"./ja.js":50952,"./jv.js":77741,"./ka.js":46481,"./kk.js":11335,"./km.js":36101,"./kn.js":6364,"./ko.js":88003,"./ku.js":16605,"./ky.js":34457,"./lb.js":88615,"./lo.js":73860,"./lt.js":34485,"./lv.js":76467,"./me.js":80623,"./mi.js":32739,"./mk.js":75877,"./ml.js":75376,"./mn.js":12698,"./mr.js":46462,"./ms-my.js":26400,"./ms.js":79677,"./mt.js":77083,"./my.js":46803,"./nb.js":7205,"./ne.js":40880,"./nl-be.js":60465,"./nl.js":69423,"./nn.js":23473,"./oc-lnc.js":70225,"./pa-in.js":39252,"./pl.js":63225,"./pt-br.js":92218,"./pt.js":72369,"./rn.js":34509,"./ro.js":24334,"./ru.js":62796,"./rw.js":35414,"./sd.js":63222,"./se.js":55285,"./si.js":65665,"./sk.js":46847,"./sl.js":39998,"./sq.js":95977,"./sr-cyrl.js":27439,"./sr.js":45616,"./ss.js":52487,"./sv-fi.js":9160,"./sv.js":21340,"./sw.js":2979,"./ta.js":77250,"./te.js":87406,"./tet.js":18928,"./tg.js":15012,"./th.js":47081,"./tk.js":62544,"./tl-ph.js":78142,"./tlh.js":60321,"./tr.js":4895,"./tzl.js":3187,"./tzm-latn.js":58804,"./tzm.js":95084,"./ug-cn.js":79911,"./uk.js":34173,"./ur.js":51750,"./uz-latn.js":80950,"./uz.js":54734,"./vi.js":40860,"./x-pseudo.js":83379,"./yo.js":87933,"./zh-cn.js":16033,"./zh-hk.js":87741,"./zh-tw.js":31349,"./zh.js":56007};function r(e){var t=i(e);return a(t)}function i(e){if(!a.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=i,e.exports=r,r.id=13722},38155:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var n=a(51609),r=a(47143),i=a(86087),o=a(22564),s=a(60532),l=a(4623),c=a(87927),d=a(27723);const m=({invoiceData:e})=>(0,n.createElement)(o.Flex,{vertical:!0,gap:"small"},(0,n.createElement)(o.Flex,{gap:8,align:"center"},(0,n.createElement)(o.Title,{level:3,text:(0,d.__)("Your booking confirmed","booktics")}),(0,n.createElement)(o.Text,{className:"bkt-invoice-status",text:e?.status})),(0,n.createElement)(o.Text,{className:"bkt-order-no",text:(0,d.__)("Booking ID: ","Booktics")+e?.order_no}),(0,n.createElement)(o.Space,{size:4},(0,n.createElement)(o.Text,{text:(0,d.__)("An email confirmation was sent to","booktics")}),(0,n.createElement)(o.Text,{className:"bkt-customer-email",text:e?.customer?.email})),(0,n.createElement)(c.TQ,null)),u=({invoiceData:e})=>{const{settings:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]);return(0,n.createElement)(o.Flex,{vertical:!0,gap:"small"},e?.items?.map(e=>(0,n.createElement)(o.SingleBookingBox,{key:e?.id,settings:t,bookingItem:e})))},p=({invoiceData:e})=>{const{settings:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]);return(0,n.createElement)(o.CostBreakdownReusableComp,{invoiceData:e,settings:t})};var h=a(47767),g=a(11534);var x=a(59e3);const f=(0,x.A)(o.Card)`
    max-width: 580px;
    width: 100%;
    height: 100%;
    font-size: 16px;
    min-height: 500px;

    .bkt-order-no {
        font-size: 18px;
        font-weight: 500;
    }

    .bkt-customer-email {
        font-weight: 500;
    }
    .bkt-custom-field-title {
        text-transform: capitalize;
    }

    .bkt-invoice-status {
        background-color: #d1fae5;
        min-width: 60px;
        border-radius: 100px;
        color: #065f46;
        height: 30px;
        display: flex;
        align-items: center;
        font-weight: 500;
        justify-content: center;
        margin-bottom: 2px;
    }
`,b=(0,x.A)(o.Flex)`
    font-size: 16px;

    .bkt-reschedule,
    .bkt-cancel {
        font-weight: 500;
    }

    .bkt-reschedule {
        color: #009959;
    }

    .bkt-cancel {
        color: #ed695e;
    }
`,k=(0,x.A)(o.Modal)`
    &.ant-modal {
        width: 90% !important;
        max-width: 600px;
    }
`;var _=a(60742),w=a(44512);const j=()=>(0,n.createElement)(o.Flex,{vertical:!0,align:"center",justify:"space-between"},(0,n.createElement)(o.Title,{level:5,text:(0,d.__)("Cancelled Appointment","booktics")}),(0,n.createElement)(o.Description,{text:(0,d.__)("Oops, it seems your booking was canceled.","booktics")}),(0,n.createElement)(o.PrimaryButton,{text:(0,d.__)("Book Again","booktics"),onClick:()=>{window.location.href=window.location.pathname}})),v=()=>{const[e]=_.A.useForm(),t=(0,h.Zp)(),{openCancelModal:a,cancelLoading:i,isCancelledSuccess:l}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{setFrontendState:c}=(0,r.useDispatch)(s.H),{cancel:m}=(0,w.A)();return(0,n.createElement)(o.Modal,{onCancel:()=>{c({openCancelModal:!1}),t(`/${window.location?.pathname}`)},open:a,centered:!0,footer:null,maskClosable:!1,destroyOnHidden:!0},(0,n.createElement)(o.Flex,{gap:10,vertical:!0},l?(0,n.createElement)(j,null):(0,n.createElement)(n.Fragment,null,(0,n.createElement)(o.Title,{level:4,text:(0,d.__)("Give your information","booktics")}),(0,n.createElement)(_.A,{form:e,onFinish:m},(0,n.createElement)(o.FormItem,{name:"cancel_note"},(0,n.createElement)(o.TextArea,{placeholder:(0,d.__)("Please tell us the reason to cancel this Appointment","booktics"),rows:4}))),(0,n.createElement)("div",null,(0,n.createElement)(o.PrimaryButton,{text:(0,d.__)("Cancel Appointment","booktics"),onClick:e.submit,loading:i})))))};var y=a(74353),E=a.n(y),S=a(95358);const D=({invoiceData:e})=>{const t=(0,S.phpToDayjsFormat)(window?.booktics?.date_format)||"MMM D, YYYY",a=(0,S.phpToDayjsFormat)(window?.booktics?.time_format)||"h:mm A";return(0,n.createElement)(o.Row,{gutter:[20,20]},(0,n.createElement)(o.Col,{xs:12},(0,n.createElement)(o.Title,{level:5,text:(0,d.__)("Name","booktics")}),(0,n.createElement)(o.Text,{text:e?.customer?.name})),(0,n.createElement)(o.Col,{xs:12},(0,n.createElement)(o.Title,{level:5,text:(0,d.__)("Email","booktics")}),(0,n.createElement)(o.Text,{text:e?.customer?.email})),e?.total<1&&(0,n.createElement)(o.Col,{xs:12},(0,n.createElement)(o.Title,{level:5,text:(0,d.__)("Payment Gateway","booktics")}),(0,n.createElement)(o.Text,{text:e?.payment_gateway})),(0,n.createElement)(o.Col,{xs:12},(0,n.createElement)(o.Title,{level:5,text:(0,d.__)("Receive On","booktics")}),(0,n.createElement)(o.Text,{text:E()(e?.created_at).format(`${t}, ${a}`)})),Array.isArray(e.custom_fields)&&e?.custom_fields.map(e=>(0,n.createElement)(o.Col,{xs:12,key:e.name},(0,n.createElement)(o.Title,{level:5,text:e?.label,className:"bkt-custom-field-title"}),(0,n.createElement)(o.Text,{text:Array.isArray(e.value)?e.value.join(" "):e.value}))))},A=({cancellation_restriction:e,date:t,start_time:a})=>{const i=(0,S.isRestrictedToUpdateBooking)({date:t,start_time:a,settings:e}),{setFrontendState:l}=(0,r.useDispatch)(s.H);return(0,n.createElement)(o.Button,{disabled:i,type:"text",className:"bkt-cancel",text:(0,d.__)("Cancel","booktics"),size:"small",onClick:()=>l({openCancelModal:!0})})};var C=a(46079),F=a(57010);const T=()=>{const{invoiceData:e,selectedData:t,openRescheduleModal:a,availability:o}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{setFrontendState:l}=(0,r.useDispatch)(s.H),{getTimeSlot:c}=(0,F.A)();return(0,i.useEffect)(()=>{if(!a)return;const n=e?.items?.[0]||{};t||l({selectedData:e?.items});const{service:r,team:i,date:s}=n;l({availability:{...o,timeSlots:{},service_id:null,team_member_id:null}}),i.id&&c({service_id:r?.id,team_member_id:i?.id,additional_duration_id:r?.additional_duration?.id})},[a]),(0,n.createElement)(k,{onCancel:()=>l({openRescheduleModal:!1}),open:a,centered:!0,footer:null,maskClosable:!1,destroyOnHidden:!0,className:"bkt-booking-modal"},(0,n.createElement)(C.A,null))},$=({reschedule_restriction:e,date:t,start_time:a})=>{const{setFrontendState:i}=(0,r.useDispatch)(s.H),l=(0,S.isRestrictedToUpdateBooking)({date:t,start_time:a,settings:e});return(0,n.createElement)(n.Fragment,null,(0,n.createElement)(o.Button,{disabled:l,type:"text",className:"bkt-reschedule",text:(0,d.__)("Reschedule","booktics"),size:"small",onClick:()=>i({openRescheduleModal:!0})}),(0,n.createElement)(T,null))};var H=a(46714),z=a(90445),M=a.n(z);E().extend(M());const O=e=>{const{calendarAddUrls:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{getAllCalendarAddUrls:a}=function(){const{setFrontendState:e}=(0,r.useDispatch)(s.H);return{getAllCalendarAddUrls:async function(t={}){const{meeting_id:a,booking_date:n,start_time:r,end_time:i}=t,o=await(g.A?.addToCalendar?.getAllCalendarAddUrls({meeting_id:a,booking_date:n,start_time:r,end_time:i}));if(o?.success)return e({calendarAddUrls:o?.data?.calendars}),o?.data?.calendars||[];throw new Error("Failed to fetch calendar add URLs")}}}(),{id:n,date:o,start_time:l,end_time:c}=e?.items?.[0]||{},d=e=>{if(!e)return"";try{let t;return t=/am|pm/i.test(e)?E()(e,["h:mm A","hh:mm A","h:mm a","hh:mm a"]):e.includes(":")?E()(e,["HH:mm:ss","HH:mm"]):E()(e),t.isValid()?t.format("HH:mm"):(console.warn("Could not parse time:",e),"")}catch(e){return console.error("Error formatting time:",e),""}};(0,i.useEffect)(()=>{if(!t&&e&&n&&o){const e=d(l),t=d(c);a({meeting_id:n,booking_date:o,start_time:e,end_time:t})}},[e]);const m=e=>{if(!t||!Array.isArray(t))return null;const a=t.find(t=>t.id===e);return a?.url||null};return{hasGoogleCalendar:!!m("google"),hasOutlookCalendar:!!m("outlook"),handleGoogleCalendarClick:()=>{const e=m("google");e&&window.open(e,"_blank")},handleOutlookCalendarClick:()=>{const e=m("outlook");e&&window.open(e,"_blank")}}},R=(x.A.div`
    border: 1px solid #e4e4e7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px;
    white-space: nowrap;
    color: #525266;
    font-size: 14px;
    font-weight: 500;

    span {
        width: 12px;
        height: 12px;
        border-radius: 50px;
        background-color: ${({color:e})=>e};
    }
`,(0,x.A)(o.PrimaryOutlinedButton)`
    &.ant-btn-lg {
        height: 36px !important;
    }
`,(0,x.A)(o.DatePicker)`
    height: 44px;
`,(0,x.A)(o.Title)`
    margin-block: 0px !important;
    white-space: nowrap;
`,(0,x.A)(o.Divider)`
    margin-block: 16px;
`),{Flex:B,Space:I,Text:Y}=((0,x.A)(o.Card)`
    width: 100%;
    border-radius: 10px;
    border: 1px solid #e2ecf4;
    position: relative;

    .ant-card-body {
        padding: 20px;
    }

    .bkt-booking-service-title {
        font-weight: 600;
        font-size: 16px;
    }

    .bkt-booking-service-date-time {
        color: #3161f1;
        font-weight: 500;
    }
`,window?.booktics?.components||{}),L=(0,o.wrapWithTheme)(({invoiceData:e,settingsData:t})=>{const{hasGoogleCalendar:a,hasOutlookCalendar:r,handleGoogleCalendarClick:i,handleOutlookCalendarClick:s}=O(e),{enable_google_calendar:l,enable_outlook_calendar:c}=t||{};return l||c?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(R,null),(0,n.createElement)(B,{gap:16,align:"center"},(0,n.createElement)(Y,{text:(0,d.__)("Add to Calendar:","booktics")}),(0,n.createElement)(I,null,l&&(0,n.createElement)(o.SecondaryOutlineButton,{onClick:i,icon:(0,n.createElement)(H.GoogleCalendarIcon,null),disabled:!a},(0,d.__)("Google Calendar","booktics")),c&&window.wp?.hooks?.applyFilters("booktics_add_to_Outlook_calendar",null,{handleOutlookCalendarClick:s,hasOutlookCalendar:r})))):null}),U=()=>{const{settings:e,invoiceData:t}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{allow_customer_cancellation:a,allow_customer_rescheduling:i,reschedule_restriction:l,cancellation_restriction:m}=e,{date:u,start_time:p}=t?.items?.[0]||{},h=a||i;return(0,n.createElement)("div",null,h&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)(c.TQ,null),(0,n.createElement)(b,{gap:"small",wrap:!0,align:"center"},(0,n.createElement)(o.Text,{text:(0,d.__)("Need to make a change?","booktics")}),(0,n.createElement)(o.Space,{size:4},i&&(0,n.createElement)($,{reschedule_restriction:l,date:u,start_time:p}),i&&a&&(0,n.createElement)(o.Text,{text:(0,d.__)("or","booktics")}),a&&(0,n.createElement)(A,{cancellation_restriction:m,date:u,start_time:p})))),(0,n.createElement)(L,{invoiceData:t,settingsData:e}))},N=()=>{const{invoiceData:e}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),t=new URLSearchParams(window.location.search).get("booking_action"),{getInvoice:a}=function(){const{invoiceId:e}=(0,r.useSelect)(e=>e(s.H).getFrontendState(),[]),{setFrontendState:t}=(0,r.useDispatch)(s.H),{id:a}=(0,h.g)();return{getInvoice:async()=>{const n=new URLSearchParams(window.location.search),r=n.get("order_id"),i=a||e||r;if(!i)return;const o=n.get("order_key")||"undefined"!=typeof sessionStorage&&sessionStorage.getItem(`booktics_order_key_${i}`)||"";try{const e=await(g.A?.orders?.singleOrder(i,o?{order_key:o}:{}));e?.success&&t({invoiceData:e?.data})}catch(e){console.error("Error fetching services:",e)}}}}();return(0,i.useEffect)(()=>{a()},[]),(0,n.createElement)(l.Container,{vertical:!0,gap:24},(0,n.createElement)(o.Flex,{justify:"center"},"cancel"===t?(0,n.createElement)(v,null):(0,n.createElement)(f,null,(0,n.createElement)(o.RowSkeleton,{loading:!e},(0,n.createElement)(o.Flex,{vertical:!0,gap:"middle"},(0,n.createElement)(m,{invoiceData:e}),(0,n.createElement)(D,{invoiceData:e}),(0,n.createElement)(u,{invoiceData:e}),(0,n.createElement)(p,{invoiceData:e}),(0,n.createElement)(U,null))),(0,n.createElement)(v,null))))}},44512:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(47143),r=a(11534),i=a(60532);const o=function(){const{invoiceData:e}=(0,n.useSelect)(e=>e(i.H).getFrontendState(),[]),{setFrontendState:t,resetFrontend:a}=(0,n.useDispatch)(i.H),o=new URLSearchParams(window.location.search),s=o.get("booking_action"),l=o.get("appointment_token");return{reschedule:async(a={})=>{const{id:n,...i}=a;try{const a=await(r.A?.appointment?.appointmentReschedule(n,{...i,security_token:l||e?.items?.[e?.items?.length-1]?.appointment_token}));a?.success&&t({openRescheduleModal:!1,invoiceData:{...e,items:e?.items?.map(e=>e?.id===n?{...e,...i}:e)}})}catch(e){console.error(e)}},cancel:async n=>{const i=e?.items[0]?.id;t({cancelLoading:!0});const o={...n,security_token:l};try{const e=await(r.A?.appointment?.appointmentCancel(i,o));return e?.success&&("cancel"!==s&&a(),t({isCancelledSuccess:e.success})),e}catch(e){console.error("Error fetching services:",e)}finally{t({cancelLoading:!1})}}}}},46079:(e,t,a)=>{"use strict";a.d(t,{A:()=>C});var n=a(51609),r=a(86087),i=a(22564),o=a(57010),s=a(47143),l=a(60532),c=a(59e3),d=a(75778);const m=c.A.div`
    padding-right: 10px;

    .bkt-flatpickr-input {
        display: none;
    }

    .flatpickr-rContainer {
        width: 100%;
    }

    .flatpickr-calendar {
        width: 100%;
        box-shadow: none;
        background: transparent;

        .dayContainer {
            width: 100%;
            min-width: 100%;
            max-width: 100%;
        }

        .flatpickr-days,
        .flatpickr-day {
            width: 100%;
            max-width: 100%;
        }

        .flatpickr-day {
            height: 50px;
            line-height: 50px;
            border-radius: 6px;
            color: #0a1018;
            font-weight: 600;

            &.selected {
                color: #fff;
                border: none;
                background: ${({theme:e})=>e.colors.primary};
            }

            &.today {
                border-color: transparent;

                &::before {
                    content: "";
                    position: absolute;
                    bottom: 5px;
                    left: 50%;
                    transform: translateX(-50%);
                    background: ${({theme:e})=>e.colors.primary};
                    width: 5px;
                    height: 5px;
                    border-radius: 100vmax;
                }
            }

            &.flatpickr-disabled,
            &.flatpickr-disabled:hover {
                color: ${({theme:e})=>e.colors.secondary};
                opacity: 0.4;
            }
        }

        @media (max-width: ${d.a.xxl}px) {
            max-height: 380px;

            .flatpickr-day {
                height: 40px;
                line-height: 40px;
            }
        }
    }

    .flatpickr-disabled {
        opacity: 0.4;
    }

    .flatpickr-months {
        padding-bottom: 20px;
        border-bottom: 1px solid #eaeaea;
        margin-bottom: 20px;
        display: flex;
        align-items: center;

        .flatpickr-month,
        .flatpickr-current-month {
            text-align: left;
        }

        .flatpickr-current-month {
            display: flex;
            align-items: center;
            left: 0;
            padding-top: 0;
        }

        .flatpickr-prev-month,
        .flatpickr-next-month {
            display: flex;
            justify-content: center;
            align-items: center;
            top: 8px;
            height: 20px;
            width: 20px;
            padding: 0;
            line-height: 20px;
            border-radius: 100vmax;
            background-color: #0c274a;

            svg {
                stroke: #ffffff;
                stroke-width: 2px;
                fill: transparent;
                width: 10px;
                height: 10px;
            }

            &.flatpickr-disabled {
                cursor: no-drop;
            }
        }

        .flatpickr-prev-month.flatpickr-prev-month,
        .flatpickr-next-month.flatpickr-prev-month {
            left: auto;
            right: 40px;
        }

        .cur-year,
        .cur-month {
            font-weight: 600 !important;

            &:hover,
            &:focus {
                background: transparent;
            }
        }
    }
`;var u=a(74353),p=a.n(u),h=a(44512),g=a(95358),x=a(48602);const f=function(){const{setFrontendState:e}=(0,s.useDispatch)(l.H),t=(0,s.useSelect)(e=>e(l.H).getFrontendState(),[]),{currentStep:a,selectedData:n=[],availability:r,invoiceData:i,selectedLocation:c,use24h:d}=t,{getTimeSlot:m}=(0,o.A)(),{addToCart:u,editCartItem:f}=(0,x.A)(),{reschedule:b}=(0,h.A)();return{selectDate:(t,a)=>{const r=n.map((e,t)=>t===n.length-1?{...e,date:a}:e);e({selectedData:r,currentSelectedData:r?.[r?.length-1]||{}})},selectMonth:(e,__,t)=>{const a=p()().month(t.currentMonth),n=a.startOf("month").format("YYYY-MM-DD"),r=a.startOf("month").add(60,"day").format("YYYY-MM-DD");m({startDate:n,endDate:r})},toggleTimeFormat:t=>{e({availability:{...r,timeSlots:(0,g.convertScheduleTimeFormat)({timeSlots:r?.timeSlots,to24Hour:t})},use24h:t})},selectTime:({slot:t})=>{if(!t?.is_available)return;const r=e=>p()(e,["h:mm A","hh:mm A","HH:mm","H:mm"]).format("HH:mm"),o=r(t.start),s=r(t.end),l=[...n],m=l.length-1;m>=0&&(l[m]={...l[m],start_time:o,end_time:s});const h=l[m]||{},{service:g,additional_duration:x,team:k,date:_,total:w,extraServices:j,group_booking:v}=h;e({selectedData:l,currentSelectedData:h,...!i&&{currentStep:a+1}});const y={team_member_id:k?.id,service_id:g?.id,date:_,start_time:o,end_time:s,additional_duration_id:x?.id,extra_services:j,price:x?.charge_amount,total:w,group_booking:v,time_format:d?"24h":"12h",...c&&{location_id:c}};if(i)b({id:i?.items?.[i?.items?.length-1]?.id,date:_,start_time:o,end_time:s});else{let e=h?.uuid;if(e)return void f(e,y);u(y)}}}},b=window.booktics.locale_name;if(b)try{a(13722)(`./${b}.js`),p().locale(b)}catch(e){const t=b.split("-")[0];a(13722)(`./${t}.js`),p().locale(t)}const k=()=>{const{availability:e}=(0,s.useSelect)(e=>e(l.H).getFrontendState(),[]),{fp:t}=(()=>{const e=(0,s.useSelect)(e=>e(l.H).getFrontendState(),[]),{settings:t,currentSelectedData:a,availability:n}=e,{disabledDates:i=[]}=n||{},o=(0,r.useRef)(null),c=(0,r.useRef)(null),{date:d}=a||{},{selectDate:m,selectMonth:u}=f();return(0,r.useEffect)(()=>{if("undefined"!=typeof window&&window.flatpickr&&!c.current){const e=o.current;t?.calendar_locale&&window.flatpickr.localize(window.flatpickr.l10ns[t?.calendar_locale]),c.current=window.flatpickr(e,{defaultDate:d,inline:!0,altFormat:"F j, Y",dateFormat:"Y-m-d",minDate:"today",monthSelectorType:"static",disable:i,locale:{firstDayOfWeek:Number(window?.booktics?.start_of_week)},onChange:m,onMonthChange:u})}return()=>{c.current?.destroy(),c.current=null}},[]),(0,r.useEffect)(()=>{c.current&&c.current.set("disable",i)},[i]),{fp:o}})();return(0,n.createElement)(i.Spin,{spinning:!e||e?.loading},(0,n.createElement)(m,null,(0,n.createElement)("input",{ref:t,type:"text",className:"bkt-flatpickr-input"})))};var _=a(46714),w=a(27723);const j=(0,c.A)(i.Flex)`
    width: 100%;
    height: 450px;
    padding: 8px 16px;
    border-left: 1px solid #e2ecf4;
    font-weight: 500;
    ${({hasSlot:e})=>e?"justify-content: start;":"justify-content: center; align-items: center;"}

    .bkt-slot-heading {
        font-size: 16px;
    }

    @media (max-width: ${d.a.xxl}px) {
        height: 350px;
    }
`,v=(0,c.A)(i.Flex)`
    overflow-y: auto;
    max-height: 350px;
    padding-right: 8px;

    /* Optional custom scrollbar */
    &::-webkit-scrollbar {
        width: 6px;
    }
    &::-webkit-scrollbar-thumb {
        background-color: #d9d9d9;
        border-radius: 3px;
    }
`,y=(0,c.A)(i.Button)`
    &.ant-btn {
        border-radius: 4px;
        font-weight: 600;
    }

    width: 100%;
    padding: 10px 12px;
    border: ${({active:e,theme:t})=>`${e?"2px":"1px"} solid ${e?t.colors.primary:"#E2ECF4"}`};
    opacity: ${({disabled:e})=>e?.4:1};
    position: relative;
    font-size: 16px;
    justify-content: ${({active:e})=>e?"start":"center"};
    cursor: ${({disabled:e})=>e?"not-allowed":"pointer"};
    transition: 0.3s ease;

    &:hover {
        border-color: ${({disabled:e})=>e?"#d9d9d9":"#40a9ff"};
    }

    svg {
        position: absolute;
        right: 10px;
        color: ${({theme:e})=>e.colors.primary};
    }
`,E=(0,c.A)(i.Switch)`
    background: #f7f7f7;
    width: 36px;
    height: 18px;

    .ant-switch-handle::before {
        top: -7px;
        background-color: #fff;
        border-radius: 50%;
        border: 2px solid #e2ecf4;
        height: 22px;
        width: 22px;
    }
`,{CheckCircleFilled:S}=window?.booktics?.libraryIcons||{},D=({selectedTime:e,slot:t,showEndTime:a})=>{const{selectTime:r}=f(),{start:o,is_available:s,end:l,available_spots:c}=t||{},d=e===o;return(0,n.createElement)(i.Tooltip,{title:(0,w.__)(`Available Spaces: ${c}`),placement:"left"},(0,n.createElement)(y,{onClick:()=>r({slot:t}),disabled:!s,active:d,text:(0,n.createElement)(i.Flex,null,a?`${o} - ${l}`:o,d?(0,n.createElement)(S,null):null)}))},A=()=>{const e=(0,s.useSelect)(e=>e(l.H).getFrontendState(),[]),{availability:t,use24h:a,currentSelectedData:r,settings:o}=e,c=r?.start_time,d=t?.timeSlots?.[r?.date]||[],{toggleTimeFormat:m}=f();return(0,n.createElement)(j,{vertical:!0,gap:"large",hasSlot:!!d?.length},d?.length?(0,n.createElement)(n.Fragment,null,(0,n.createElement)(i.Space,{align:"center"},(0,n.createElement)("span",null,(0,w.__)("12h","booktics")),(0,n.createElement)(E,{checked:a,onChange:m}),(0,n.createElement)("span",null,(0,w.__)("24h","booktics"))),(0,n.createElement)(v,{vertical:!0,gap:"small"},d?.filter(e=>e?.is_available)?.map(e=>(0,n.createElement)(D,{key:e?.start,slot:e,selectedTime:c,showEndTime:o?.show_end_time})))):(0,n.createElement)(_.EmptyGridIcon,null))},C=()=>{const{getTimeSlot:e}=(0,o.A)();return(0,r.useEffect)(()=>{e()},[]),(0,n.createElement)(i.Flex,{vertical:!0,gap:20},(0,n.createElement)(i.Title,{level:3,text:(0,w.__)("Select Date & Time","booktics")}),(0,n.createElement)(i.Row,null,(0,n.createElement)(i.Col,{xs:24,sm:24,md:16,lg:16},(0,n.createElement)(k,null)),(0,n.createElement)(i.Col,{xs:24,sm:24,md:8,lg:8},(0,n.createElement)(A,null))))}},48602:(e,t,a)=>{"use strict";a.d(t,{A:()=>o});var n=a(47143),r=a(11534),i=a(60532);const o=function(){const{setFrontendState:e}=(0,n.useDispatch)(i.H),t=(0,n.useSelect)(e=>e(i.H).getFrontendState(),[]),{selectedData:a=[],orderDetails:o=[],currentSelectedData:s,use24h:l}=t,c=e=>({...e,service:s?.service,extraServices:s?.extraServices,team:s?.team,time_format:l?"24h":"12h"});return{addToCart:async t=>{const n={...t,time_format:l?"24h":"12h"};try{const t=await(r.A?.cart?.addToCart(n));if(t?.success){const n=a.map((e,n)=>n===a.length-1?{...e,uuid:t?.data?.uuid}:e);e({orderDetails:[...o,c(t?.data)],selectedData:n,currentSelectedData:n?.[n?.length-1]||{}})}}catch(e){console.error("Error adding to cart:",e)}},removeFromCart:async t=>{try{const n=await(r.A?.cart?.deleteCartItem(t));if(n?.success){const n=a.map(e=>e?.uuid===t?{...e,uuid:null}:e);e({orderDetails:o?.filter(e=>e?.uuid!==t),selectedData:n,currentSelectedData:n?.[n?.length-1]||{}})}}catch(e){console.error("Error removing from cart:",e)}},getCartItems:async()=>{if(!o)try{const t=await(r.A?.cart?.getCartItems());t?.success&&e({orderDetails:t?.data?.items?.map(e=>c(e))})}catch(e){console.error("Error retrieving cart items:",e)}},editCartItem:async(t,a)=>{try{const n=await(r.A?.cart?.editCart(t,a));if(n?.success){const a=o.map(e=>e?.uuid===t?{...e,...c(n?.data)}:e);e({orderDetails:a})}}catch(e){console.error("Error editing cart item:",e)}}}}},57010:(e,t,a)=>{"use strict";a.d(t,{A:()=>l});var n=a(47143),r=a(86087),i=a(11534),o=a(60532),s=a(95358);const l=function(){const{setFrontendState:e}=(0,n.useDispatch)(o.H),t=(0,n.useSelect)(e=>e(o.H).getFrontendState(),[]),a=(0,r.useRef)(t);return(0,r.useEffect)(()=>{a.current=t},[t.currentSelectedData,t.availability,t.calendarFilter,t.use24h]),{getTimeSlot:async t=>{const{currentSelectedData:n,calendarFilter:r,availability:o,use24h:l}=a.current,{service:c,additional_duration:d,team:m,extraServices:u,group_booking:p}=n||{},h=new URLSearchParams(window.location.search),g=h.get("team_member_id"),x=h.get("booking_action"),f=t?.startDate||r?.startDate,b=t?.endDate||r?.endDate,k=t?.service_id||c?.id,_="reschedule"===x?g:t?.team_member_id||m?.id,w=t?.additional_duration_id||d?.id,j={service_id:k,team_member_id:_,start_date:f,end_date:b,...p?.attendee_count?{total_attendees:p?.attendee_count}:{}};let v;w&&(j.additional_duration_id=w),Array.isArray(u)&&u.length>0&&u.forEach((e,t)=>{void 0!==e?.id&&void 0!==e?.quantity&&(j[`extra_services[${e.id}]`]=e.quantity)});try{e({availability:{...o,loading:!0}});const a=await(i.A?.appointment?.getTimeSlot(j));if(a?.success){let e=(0,s.convertScheduleTimeFormat)({timeSlots:a?.data?.slots,to24Hour:l});t&&(e={...o?.timeSlots,...e});const n=Object.entries(e).filter(([,e])=>Array.isArray(e)&&0===e.length).map(([e])=>e);v={...j,timeSlots:e,disabledDates:n}}}catch(e){console.error("Error fetching services:",e)}finally{e({availability:{...v||o,loading:!1}})}}}}},87927:(e,t,a)=>{"use strict";a.d(t,{D7:()=>s,It:()=>d,QP:()=>o,TQ:()=>c,_1:()=>i,fq:()=>l});var n=a(59e3),r=a(22564);const i=(0,n.A)(r.Flex)`
    padding: 30px 20px;
    height: 100%;
    ${({hasBorder:e,theme:t})=>e&&`border-right: 1px solid ${t.colors.inputBorder};`}

    .bkt-booking-service-item {
        font-weight: 500;
    }
`,o=(0,n.A)(r.Text)`
    font-size: 14px;
    font-weight: 500;
`,s=n.A.p`
    font-size: 12px;
`,l=((0,n.A)(r.Text)`
    font-size: 14px;
    font-weight: 500;
`,(0,n.A)(o)`
    &::before {
        content: "•";
        margin-right: 8px;
    }
`),c=(0,n.A)(r.Divider)`
    && {
        margin: 12px 0;
    }
`,d=(0,n.A)(r.Flex)`
    font-weight: bold;
    font-size: 16px;
    color: #000;
`}}]);