1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6066],{1946:function(t,i,o){(window.__NEXT_P=window.__NEXT_P||[]).push(["/practitioner-builder/treatment-menu",function(){return o(50079)}])},20003:function(t,i,o){"use strict";o.d(i,{Z:function(){return ContentDivider}});var a=o(85893);function ContentDivider(t){var i=t.className;return(0,a.jsx)("hr",{className:"content-divider ".concat(i," ")})}o(67294),ContentDivider.defaultProps={className:null}},33339:function(t,i,o){"use strict";var a=o(85893),c=o(67294),Accordion=function(t){var i=t.children,o=t.className,s=t.title,g=t.subtitle,x=t.footer,w=t.open,j=t.titleClassName,P=(0,c.useRef)(null),D=(0,c.useRef)(null);(0,c.useEffect)(function(){P.current&&D.current&&(w?(P.current.classList.add("accordion__animation--open"),D.current.classList.add("open"),D.current.classList.remove("closed")):(P.current.classList.remove("accordion__animation--open"),D.current.classList.remove("open"),D.current.classList.add("closed")))},[]);var toggleOpen=function(){D.current&&P.current&&(D.current.classList.toggle("open"),D.current.classList.toggle("closed"),P.current.classList.toggle("accordion__animation--open"))};return(0,a.jsxs)("div",{className:"accordion ".concat(o),ref:P,children:[(0,a.jsxs)("button",{className:"accordion__header ".concat(j).trim(),onClick:function(){toggleOpen()},children:[(0,a.jsx)("span",{children:s}),g&&(0,a.jsx)("small",{children:g})]}),(0,a.jsxs)("div",{className:"accordion__body closed",ref:D,children:[(0,a.jsx)("div",{className:"accordion__body--content",children:i}),x&&(0,a.jsx)("div",{className:"accordion__footer",children:x})]})]})};Accordion.defaultProps={subtitle:"",footer:null,open:!1,titleClassName:""},i.Z=Accordion},77289:function(t,i,o){"use strict";var a=o(72253),c=o(14932),s=o(85893),g=o(23157);i.Z=function(t){var i=t.onChange,o=t.options,x=t.placeholder;return(0,s.jsx)(g.ZP,{styles:{control:function(t){return(0,c._)((0,a._)({},t),{borderRadius:"13px",borderColor:"#606060",color:"#606060"})},indicatorSeparator:function(){return{display:"none"}},option:function(t,i){return(0,c._)((0,a._)({},t),{backgroundColor:i.isFocused?"#5AD3A4":t.backgroundColor,"&:active":{backgroundColor:"#5AD3A4"}})}},options:o,placeholder:x,value:null,onChange:function(t){t&&i(t.value)}})}},57714:function(t,i,o){"use strict";var a=o(85893),c=o(23157),s=o(27090),findSelectedOption=function(t,i){var o;return i&&null!==(o=(t.length>0&&"options"in t[0]?t.flatMap(function(t){return t.options}):t).find(function(t){return t.value===i}))&&void 0!==o?o:null},TreatmentSelect=function(t){var i=t.onChange,o=t.options,g=t.placeholder,x=t.isDisabled,w=t.value,j=t.isClearable,P=t.onClear,D=(0,s.of)();return(0,a.jsx)(c.ZP,{styles:(0,s.zV)(D),options:o,placeholder:g,value:void 0!==w?findSelectedOption(o,w):null,onChange:function(t){t?i(t.value):P&&P()},isDisabled:x,isClearable:j})};TreatmentSelect.defaultProps={isDisabled:!1,value:void 0,isClearable:!1,onClear:void 0},i.Z=TreatmentSelect},27090:function(t,i,o){"use strict";o.d(i,{of:function(){return useSelectResponsiveView},zV:function(){return buildSelectStyles}});var a,c,s=o(72253),g=o(14932),x=o(91309),w=o(67294);(a=c||(c={})).Mobile="mobile",a.Tablet="tablet",a.Desktop="desktop";var useSelectResponsiveView=function(){var t=(0,x._)((0,w.useState)(null),2),i=t[0],o=t[1];return(0,w.useEffect)(function(){var handleScreenSize=function(){return o(window.matchMedia("(max-width: 767px)").matches?"mobile":window.matchMedia("(max-width: 1023px)").matches?"tablet":"desktop")};return(handleScreenSize(),window.matchMedia("(max-width: 767px)").addEventListener)?(window.matchMedia("(max-width: 767px)").addEventListener("change",handleScreenSize),function(){window.matchMedia("(max-width: 767px)").removeEventListener("change",handleScreenSize)}):(window.matchMedia("(max-width: 767px)").addListener(handleScreenSize),function(){window.matchMedia("(max-width: 767px)").removeListener(handleScreenSize)})},[]),i},buildSelectStyles=function(t){return{container:function(i){return(0,g._)((0,s._)({},i),{position:"desktop"===t?"relative":"initial"})},control:function(t,i){return(0,g._)((0,s._)({},t),{borderRadius:"13px",borderColor:"#606060",color:"#606060",backgroundColor:i.isDisabled?"rgba(255, 255, 255, 0.5)":t.backgroundColor})},menu:function(i){return(0,g._)((0,s._)({},i),{top:"auto",width:"".concat("tablet"===t?"50%":"100%")})},indicatorSeparator:function(){return{display:"none"}},option:function(t,i){return(0,g._)((0,s._)({},t),{backgroundColor:i.isFocused?"#edd270":t.backgroundColor,"&:active":{backgroundColor:"#edd270"}})}}}},75166:function(t,i,o){"use strict";o.d(i,{Nd:function(){return getActionText},cO:function(){return c},i7:function(){return a},sk:function(){return s}});var getActionText=function(t,i,o){return t&&!i?o.live:t&&i?o.liveSubmitting:!t&&i?o.preliveSubmitting:t||i?void 0:o.prelive},a={prelive:"Save & Finish",preliveSubmitting:"Saving...",live:"Update",liveSubmitting:"Updating..."},c={prelive:"Save & Next",preliveSubmitting:"Saving...",live:"Update",liveSubmitting:"Updating..."},s={prelive:"Save",preliveSubmitting:"Saving...",live:"Update",liveSubmitting:"Updating..."}},19565:function(t,i,o){"use strict";o.d(i,{D:function(){return a},f:function(){return c}});var a="4a0ebaa3-2731-42dd-bb3e-725264415169",c="6a49cb51-9d7a-4fc9-a46b-c70c82ba83eb"},50079:function(t,i,o){"use strict";o.r(i),o.d(i,{default:function(){return ey}});var a=o(11010),c=o(72253),s=o(14932),g=o(91309),x=o(4586),w=o(97582),j=o(85893),P=o(41664),D=o.n(P),k=o(11163),A=o.n(k),B=o(67294),F=o(91444),G=o(27878),R=o(20003),U=o(66849),z=o(75586),V=o(70706),J=o(54192),Z=o(19759),$=o(83825),W=o(51679),X=o(64831
1),Y=o(73857),K=o(86060),ee=o(59513),et=o(75166),en=o(32304),er=o(52056),ei=o(33339),eo=o(77289),addCategory=function(t,i){var o=t.map(function(t){return(0,c._)({},t)}),a=o.find(function(t){return t.id===i});return a&&(a.selected=!0,a.open=!0),o},deleteCategory=function(t,i){var o,a=t.map(function(t){return(0,c._)({},t)}),s=a.find(function(t){return t.id===i});if(!s)return a;if(s.clinicOffers)s.selected=!1,null===(o=s.treatments)||void 0===o||o.forEach(function(t){return t.selected=!1});else{var g=a.indexOf(s);a.splice(g,1)}return a},ea=o(57714),ec=o(11077),deleteTreatment=function(t,i){var o=t.filter(function(t){return t.clinicTreatmentId!==i}).map(function(t){return(0,c._)({},t)}),a=t.find(function(t){return t.clinicTreatmentId===i});return a&&(o[o.length]=(0,s._)((0,c._)({},a),{selected:!1})),o},changeDuration=function(t,i,o){var a=t.map(function(t){return(0,c._)({},t)}),s=a.find(function(t){return t.clinicTreatmentId===o});if(!s)throw Error("".concat(o," treatment not found in treatment menu"));var g=parseInt(i,10);return(0,ec.eS)(g)?(s.duration=g,s.durationError=null):(s.duration=i,s.durationError=ec.gM),a},changePrice=function(t,i,o,a,s){var g,x=t.map(function(t){return(0,c._)({},t)}),w=x.find(function(t){return t.clinicTreatmentId===o});if(!w)throw Error("".concat(o," treatment not found in treatment menu"));var j=parseInt(i,10);return j?(w.price=j,w.priceError=null):0===j&&w.name===a?(w.price=Number(i),w.priceError=null):(w.price=i,w.priceError="invalid value"),null===(g=w.locations)||void 0===g||g.forEach(function(t){s.findIndex(function(i){return i.locationId===t.locationId})>-1&&(t.price=w.price,t.priceError=w.priceError)}),x},changeLocationPrice=function(t,i,o,a,g){var w,j=t.map(function(t){return(0,s._)((0,c._)({},t),{locations:t.locations.map(function(t){return(0,c._)({},t)})})}),P=j.find(function(t){return t.clinicTreatmentId===o});if(!P)throw Error("".concat(o," treatment not found in treatment menu"));var D=null===(w=P.locations)||void 0===w?void 0:w.find(function(t){return t.locationId===a});D||(D={locationId:a,price:null,discontinued:!1,priceError:"invalid cost value"},P.locations=(0,x._)(P.locations).concat([D])),D.discontinued=!1;var k=parseInt(i,10);return k?(D.price=k,D.priceError=null):0===k&&P.name===g?(D.price=Number(i),D.priceError=null):(D.price=i,D.priceError="invalid cost value"),j},deleteLocationPrice=function(t,i,o){var a,s=t.map(function(t){return(0,c._)({},t)}),g=s.find(function(t){return t.clinicTreatmentId===i});if(!g)throw Error("".concat(i," treatment not found in treatment menu"));var x=null===(a=g.locations)||void 0===a?void 0:a.find(function(t){return t.locationId===o});return x&&(x.discontinued=!0),s},addTreatment=function(t,i){var o=t.map(function(t){return(0,c._)({},t)}),a=o.find(function(t){return t.clinicTreatmentId===i});return a&&(a.selected=!0),o},getTreatmentName=function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return i>1?"".concat(t," - ").concat(i," Sessions"):t},practitioner_LocationPrice=function(t){var i=t.location,o=t.updateLocationPrice,a=t.DeleteLocationPrice,c=t.clinicTreatmentId,s=t.clinicTreatmentPrice,x=t.requiredTreatment,w=(0,g._)((0,B.useState)(!1),2),P=w[0],D=w[1],k=(0,g._)((0,B.useState)(null),2),A=k[0],F=k[1];return(0,B.useEffect)(function(){x?D(!0):D(!i.discontinued)},[i.discontinued]),(0,B.useEffect)(function(){F(i.priceError)},[i.priceError]),(0,j.jsx)("article",{className:"column-m-12 column-t-6 column-d-3",children:P&&(0,j.jsxs)("div",{className:"row row--no-margin field row--middle",children:[(0,j.jsxs)("div",{className:"field field__price treatment-item-details ".concat(A&&"field--error"," ").concat(x?"column-m-11":"column-m-10 column-t-9 padding-right-1 padding-right__t-0 "),children:[(0,j.jsx)("label",{htmlFor:"cost",children:i.name}),(0,j.jsx)("input",{type:"text",placeholder:"Cost",id:"cost",value:i.price||"",onChange:function(t){return o(c,i.locationId,t.target.value)}}),(0,j.jsx)("div",{className:"treatment__error",children:A&&(0,j.jsx)(K.Z,{text:A})})]}),!x&&(0,j.jsx)("div",{className:"column-m-2 field row row--no-margin row--center",children:(0,j.jsx)(er.Z,{icon:"trash",text:"remove location price",className:"button--utility button--small",onClick:function(){return a(c,i.locationId)}})})]})||(0,j.jsxs)("div",{className:"row row--no-margin row--middle column-m-12 field",children:[(0,j.jsx)("div",{className:"column-m-10 field column-t-order-2 padding-right-1 padding-right__t-0",children:(0,j.jsx)("span",{children:i.name})}),(0,j.jsx)("div",{className:"column-m-2 field row row--no-margin column-t-order-1",children:(0,j.jsx)(er.Z,{icon:"green/add",text:"edit location price",className:"button--small button--green button--flat",onClick:function(){return o(c,i.locationId,i.price||s.toString())}})})]})})},practitioner_PractitionerTreatmentMenuItem=function(t){var i=t.treatmentItems,o=t.updateTreatmentItems,a=t.categoryId,g=t.stayOnTreatmentName,x=t.locations,w=t.enableMultiLocationView,P=i.filter(function(t){return!t.selected}),RemoveTreatment=function(t,c){t.persist(),t.preventDefault(),o(a,deleteTreatment(i,c))},UpdateDuration=function(t,c){o(a,changeDuration(i,t,c))},UpdatePrice=function(t,c){o(a,changePrice(i,t,c,g,x))},UpdateLocation=function(t,c,s){o(a,changeLocationPrice(i,c,s,t,g))},DeleteLocation=function(t,c){o(a,deleteLocationPrice(i,c,t))},ShowTreatments=function(t){o(a,addTreatment(i,t))};return(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:"row--no-margin row",children:[!w&&(0,j.jsxs)(en.pU,{greaterThanOrEqual:"md",className:"row row--no-margin column--gap column-m-12 row--middle treatment-item__row treatment-item__row--border",children:[(0,j.jsx)("div",{className:"treatment-item-details column-t-5",children:(0,j.jsx)("h5",{children:"Area / Variation"})}),(0,j.jsx)("div",{className:"treatment-item-details column-t-2",children:(0,j.jsx)("h5",{children:"Duration"})}),(0,j.jsx)("div",{className:"treatment-item-details column-t-2",children:(0,j.jsx)("h5",{children:"Cost"})}),(0,j.jsx)("div",{className:"treatment-item-details column-t-1"})]}),i&&i.filter(function(t){return t.selected}).map(function(t){return(0,j.jsxs)("div",{className:"row row--no-margin column-m-12 row--middle margin-bottom-1 border-bottom ".concat(w?"":"column--gap").trim(),children:[(0,j.jsxs)("div",{className:"field column-m-12 column-t-order-1 ".concat(w?"row--direction-column":"column-t-5"),children:[(0,j.jsxs)("div",{className:"row--middle row row--no-margin",children:[(0,j.jsx)("h4",{className:"margin-bottom-0 ".concat(t.name===g?"disabled":""),children:getTreatmentName(t.name,Number(t.sessions))}),t.name!==g&&w&&(0,j.jsx)(en.pU,{greaterThanOrEqual:"md",className:"margin-left-1",children:(0,j.jsx)(er.Z,{icon:"trash",text:"remove treatment from the menu",className:"button--utility button--small",onClick:function(i){return RemoveTreatment(i,t.clinicTreatmentId)}})})]}),t.durationError&&(0,j.jsx)(K.Z,{text:t.durationError}),t.priceError&&(0,j.jsx)(K.Z,{text:t.priceError}),!t.name&&(0,j.jsx)("div",{className:"field__select",children:(0,j.jsxs)("select",{onChange:function(t){return ShowTreatments(t.target.value)},children:[(0,j.jsx)("option",{children:"Please select an area"}),i.map(function(t){return(0,j.jsx)("option",{value:t.id,children:getTreatmentName(t.name,Number(t.sessions))},t.id)})]})})]}),(0,j.jsx)("div",{className:"column-t-order-2 field field__duration treatment-item-details column-m-12 ".concat(w?"column-t-12":"column-t-2"," ").concat(t.durationError&&" field--error"),children:w&&(0,j.jsxs)("div",{className:"column-m-12 column-t-4",children:[(0,j.jsx)("label",{htmlFor:"duration-".concat(t.id),children:"Duration (in minutes)"}),(0,j.jsx)("input",{type:"text",placeholder:"Duration",value:t.duration,id:"duration-".concat(t.id),name:"duration-".concat(t.id),onChange:function(i){return UpdateDuration(i.target.value,t.clinicTreatmentId)}})]})||(0,j.jsx)("input",{type:"text",placeholder:"Duration",value:t.duration,onChange:function(i){return UpdateDuration(i.target.value,t.clinicTreatmentId)}})}),!w&&(0,j.jsx)("div",{className:"field field__price treatment-item-details column-t-2 column-m-12 column-t-order-3 ".concat(t.priceError&&" field--error"),children:(0,j.jsx)("input",{type:"text",placeholder:"Cost",id:"cost",value:t.price,onChange:function(i){return UpdatePrice(i.target.value,t.clinicTreatmentId)}})}),w&&(0,j.jsx)("div",{className:"field treatment-item-details row--direction-column column-t-order-4 row--t-row column-m-12 row row--no-margin row--middle--t",children:x.map(function(i){var o=t.locations.find(function(t){return t.locationId===i.locationId});return(0,j.jsx)(practitioner_LocationPrice,{location:(0,s._)((0,c._)({},i),{price:o?"".concat(o.price):null,priceError:o&&o.priceError||null,discontinued:!o||o.discontinued}),updateLocationPrice:function(t,i,o){UpdateLocation(i,o,t)},DeleteLocationPrice:function(t,i){DeleteLocation(i,t)},clinicTreatmentId:t.clinicTreatmentId,clinicTreatmentPrice:t.price,requiredTreatment:t.name===g},i.locationId)})}),(0,j.jsx)("div",{className:"field treatment-item-details column-t-order-4",children:t.name!==g&&(0,j.jsxs)(j.Fragment,{children:[!w&&(0,j.jsx)(en.pU,{greaterThanOrEqual:"md",children:(0,j.jsx)(er.Z,{icon:"trash",text:"remove treatment from the menu",className:"button--utility button--small",onClick:function(i){return RemoveTreatment(i,t.clinicTreatmentId)}})}),(0,j.jsx)(en.pU,{lessThan:"md",children:(0,j.jsx)(Y.Z,{text:"remove treatment",className:"button--flat button--rose button--small button--fullwidth",onClick:function(i){return RemoveTreatment(i,t.clinicTreatmentId)}})})]})})]},"".concat(t.id,"-").concat(t.clinicTreatmentId))}),i.filter(function(t){return!t.selected}).length>0&&(0,j.jsx)("div",{className:"column-m-12 column-t-5 column-d-4",children:(0,j.jsx)(ea.Z,{options:P.map(function(t){return{label:getTreatmentName(t.name,Number(t.sessions)),value:t.clinicTreatmentId}}),placeholder:"Please add another variation",onChange:function(t){return ShowTreatments(t)}})})]})})},practitioner_PractitionerTreatmentMenuCategory=function(t){var i=t.treatmentCategories,o=t.updateTreatmentCategories,a=t.stayOnTreatment,c=t.locations,s=t.enableMultiLocationView,updateTreatments=function(t,a){var c=i.find(function(i){return i.id===t});if(!c)throw Error("Category ".concat(t," not found in treatmentCategories"));c.treatments=a,o(i)},showCategories=function(t){o(addCategory(i,t))},removeCategories=function(t,a){t.persist(),o(deleteCategory(i,a))};return(0,j.jsxs)(j.Fragment,{children:[i&&i.filter(function(t){return t.selected}).map(function(t){var i=(0,j.jsx)(en.pU,{lessThan:"md",className:"column padding-top-1 padding-bottom-1",children:(0,j.jsx)(Y.Z,{text:"remove treatment category",className:"button--fullwidth button--outline button--small",onClick:function(i){return removeCategories(i,t.id)}})});return(0,j.jsx)("div",{className:"margin-bottom-1",children:(0,j.jsxs)(ei.Z,{title:t.categoryName,className:"accordion--treatment",footer:t.categoryName!==a?i:" ",open:t.open,children:[(0,j.jsx)(en.pU,{greaterThanOrEqual:"md",children:t.categoryName!==a&&(0,j.jsx)("div",{className:"field treatment-remove column-t-1",children:(0,j.jsx)(er.Z,{icon:"trash",text:"remove treatment from the menu",className:"button--utility",onClick:function(i){return removeCategories(i,t.id)}})})}),(0,j.jsx)(practitioner_PractitionerTreatmentMenuItem,{categoryName:t.categoryName,categoryId:t.
1id,treatmentItems:t.treatments,updateTreatmentItems:updateTreatments,stayOnTreatmentName:a,locations:c,enableMultiLocationView:s})]})},t.id)}),i.filter(function(t){return!t.selected}).length>0&&(0,j.jsx)("div",{className:"column-m-12 column-t-6",children:(0,j.jsx)(eo.Z,{options:i.filter(function(t){return!t.selected}).map(function(t){return{value:t.id,label:t.categoryName}}),placeholder:"Add treatment category",onChange:function(t){return showCategories(t)}})})]})},practitionerHasTreatmentsWithMissingConsentForms=function(t,i){var o=i.filter(function(t){return t.selected});return t.filter(function(t){var i=o.find(function(i){return i.categoryName===t.categoryName});return i&&i.treatments.filter(function(t){return t.selected}).find(function(i){return i.name===t.name})?t:null})},TreatmentMenuFormPractitioner=function(t){var i=t.practitioner,o=t.onSubmit,a=t.globalTreatments,c=t.error,s=t.consultation,w=t.clinicTreatmentsMissingConsentForms,P=t.clinicFormSettings,D=t.locations,k=t.enableMultiLocationView,F=t.isLive,G=(0,g._)((0,B.useState)(a),2),R=G[0],U=G[1],z=(0,g._)((0,B.useState)(!1),2),V=z[0],J=z[1],Z=(0,B.useContext)(ee.Z),$=practitionerHasTreatmentsWithMissingConsentForms(w,R);return(0,j.jsxs)("div",{className:"form-section column-m-12",children:[(0,j.jsx)("h3",{className:"medium",children:"Customise your treatments"}),(0,j.jsx)("p",{children:"Adjust the treatments set by your clinic."}),Z.contactInformation&&Z.contactInformation.email&&(0,j.jsx)("p",{children:"If you don't see a treatment you'd like to add here, check it's in your Clinic menu".concat(P.status===X.q.Live?" and that you have assigned it a consent form.":".")}),P.optedInToForms&&$.length>0&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("h3",{className:"medium uppercase",children:"treatments missing consent forms:"}),(0,j.jsx)("p",{children:"The following treatments are missing a consent form. They need an appropriate consent form assigned to them. Contact your clinic admin if you're unable to do this."}),(0,j.jsx)("ul",{className:"unstyled",children:$.map(function(t){return(0,j.jsxs)("li",{children:[t.categoryName," - ",t.name]},"".concat(t.categoryName).concat(t.name))})}),(0,j.jsx)("br",{})]}),R&&R.filter(function(t){return!t.clinicOffers||t.treatments.filter(function(t){return!t.clinicOffers}).length>0}).length>0&&(0,j.jsxs)("section",{className:"padding-left-1 margin-bottom-1 border-radius padding-right-1 padding-top-1 padding-bottom-1 border border--rose",children:[(0,j.jsx)("h3",{className:"medium uppercase",children:"treatments missing from menu:"}),(0,j.jsx)("p",{children:"The following treatments are missing from your Clinic Menu. You can either:"}),(0,j.jsxs)("ul",{className:"unstyled",children:[(0,j.jsx)("li",{children:"- Delete them from this menu"},"del"),(0,j.jsx)("li",{children:"- Add them back to your Clinic menu"},"add")]}),(0,j.jsx)("br",{}),(0,j.jsx)("ul",{className:"unstyled",children:R.filter(function(t){return!t.clinicOffers||t.treatments.filter(function(t){return!t.clinicOffers}).length>0}).map(function(t){return(0,j.jsx)(j.Fragment,{children:t.treatments.filter(function(t){return!t.clinicOffers}).map(function(i){return(0,j.jsxs)("li",{children:[t.categoryName," - ",i.name]},i.id)})})})})]}),R&&(0,j.jsx)("div",{className:"form-section",children:(0,j.jsx)(practitioner_PractitionerTreatmentMenuCategory,{treatmentCategories:R,updateTreatmentCategories:function(t){return U((0,x._)(t))},stayOnTreatment:s,locations:D,enableMultiLocationView:k})}),(0,j.jsxs)("div",{className:"button-group button-group--right",children:[c&&(0,j.jsx)("div",{className:"column-t-5 column",style:{float:"left",textAlign:"left"},children:(0,j.jsx)(K.Z,{text:c})}),!F&&(0,j.jsx)(Y.Z,{text:"Previous",className:"button--outline",onClick:function(t){t.preventDefault(),A().push("/practitioner-builder/upload-photos?id=".concat(i.id),"/practitioner-builder/upload-photos/".concat(i.id))}}),R&&(0,j.jsx)(Y.Z,{text:(0,et.Nd)(F,V,et.cO),disabled:V,className:"button--flat button--gold",onClick:function(t){return o(t,i.id,i.clinicId,R,J)}}),!R&&(0,j.jsx)(Y.Z,{text:"skip",className:"button--flat button--rose",onClick:function(t){t.preventDefault(),A().push("/practitioner-builder/id-check?id=".concat(i.id),"/practitioner-builder/id-check/".concat(i.id))}})]})]})},es=o(19565),el=o(21354),eu=o(28552),ed=o(14349),em=o(9781),ef=o(93353),ep=o(82718),eh=o(55498),ev=o(25117),eg=
1o(53509),ey=(0,W.Z)($.V.TreatmentMenu,function(t){var i,o,P,W,Y=t.isLive,K=(0,g._)((0,B.useState)([]),2),ee=K[0],et=K[1],en=(0,g._)((0,B.useState)([]),2),er=en[0],ei=en[1],eo=(0,g._)((0,B.useState)(null),2),ea=eo[0],ec=eo[1],ey=(0,g._)((0,B.useState)(null),2),eT=ey[0],eb=ey[1],eC=(0,g._)((0,B.useState)(null),2),e_=eC[0],ex=eC[1],eI=(0,g._)((0,B.useState)(!1),2),eN=eI[0],ew=eI[1],eE=(0,g._)((0,B.useState)(null),2),ej=eE[0],eP=eE[1],eL=(0,g._)((0,B.useState)([]),2),eO=eL[0],eD=eL[1],eS=(0,g._)((0,B.useState)(!1),2),eM=eS[0],ek=eS[1],eA="Consultation",eB=(0,B.useContext)(V.lM),eF=(0,k.useRouter)(),eG=(0,eh.ZP)(eF.query.id),eR=(0,B.useContext)(J.ZP).userDetails,eU=(i=(0,a._)(function(t){var i;return(0,w.Jh)(this,function(o){switch(o.label){case 0:return[4,(0,eu.W7)(t)];case 1:if(404===(i=o.sent()).innerResponse.status)return[2,null];return[2,(0,eg.nD)(i)]}})}),function(t){return i.apply(this,arguments)}),ez=(o=(0,a._)(function(t){var i,o;return(0,w.Jh)(this,function(a){switch(a.label){case 0:return o=[t],[4,eR.accessToken()];case 1:return[4,el.T.apply(void 0,o.concat([a.sent()]))];case 2:return i=a.sent(),[2,(0,eg.nD)(i)]}})}),function(t){return o.apply(this,arguments)}),eQ=(P=(0,a._)(function(t,i){var o;return(0,w.Jh)(this,function(a){switch(a.label){case 0:return[4,(0,ed.Ry)(t,i,!0)];case 1:return o=a.sent(),[2,(0,eg.nD)(o)]}})}),function(t,i){return P.apply(this,arguments)});(0,B.useEffect)(function(){var t,i,o=new AbortController,g=(t=(0,a._)(function(t,i){var o,a;return(0,w.Jh)(this,function(c){switch(c.label){case 0:return[4,(0,ep.ug)(t,i,!0,!0)];case 1:return o=c.sent(),ek((a=(0,eg.nD)(o)).clinicLocations.length>1),[2,a.practitioner.assignedLocations.map(function(t){return a.clinicLocations.find(function(i){return i.id===t})}).filter(function(t){return void 0!==t}).map(function(t){return{locationId:t.id,name:t.friendlyName,active:t.active}})]}})}),function(i,o){return t.apply(this,arguments)});function _localData(){return(_localData=(0,a._)(function(t){var i,a,g,j,P,D;return(0,w.Jh)(this,function(w){switch(w.label){case 0:return w.trys.push([0,6,7,8]),[4,eQ(eT.clinicId,o)];case 1:if(i=w.sent(),!(eT&&eT.clinicId))return[3,4];return[4,ez(eT.clinicId)];case 2:var k;return ec(a={clinicId:(k=w.sent()).clinicId,status:k.status,optedInToForms:k.status!==X.q.OptedOut}),[4,eU(eT.clinicId)];case 3:if(!(g=w.sent()))return ew(!0),[2];return(j=g.clinicCategoryTreatments.map(function(t){var o=i.find(function(i){return i.id===t.id});if(!o)throw Error("global category for treatment category ".concat(t.id," not found"));var c={id:t.id,categoryName:t.categoryName,clinicOffers:!0,sortOrder:o.sortOrder,selected:!1,open:!0,medicOnly:o.medicOnly,priceFrom:t.priceFrom,treatments:t.clinicTreatments.map(function(i){if(a.optedInToForms&&!i.consentFormUrn&&t.id!==e
1s.D)return ei(function(o){return o.push({categoryName:t.categoryName,name:i.name}),o}),null;var c=o.treatments.find(function(t){return t.id===i.id});if(!c)throw Error("Treatment ".concat(i.id," ").concat(i.name," not found within global treatment category ").concat(o.id," ").concat(o.categoryName));return{id:i.id,clinicTreatmentId:i.clinicTreatmentId,name:i.name,duration:Number(i.duration),price:Number(i.price),sessions:Number(i.sessions),discontinued:!1,selected:!1,clinicOffers:!0,consentFormUrn:i.consentFormUrn,sortOrder:c.sortOrder,locations:[]}}).filter(function(t){return null!==t})};return a.optedInToForms&&0===c.treatments.length?null:c}).filter(function(t){return null!==t})).sort(ev.A),e_?(P=e_.practitionerCategoryTreatments.map(function(t){var o=i.find(function(i){return i.id===t.id});if(!o)throw Error("global category for treatment category ".concat(t.id," not found"));return{id:t.id,categoryName:t.categoryName,selected:!0,clinicOffers:!1,priceFrom:t.priceFrom,open:!0,medicOnly:o.medicOnly,sortOrder:o.sortOrder,treatments:t.practitionerTreatments.map(function(t){var i=o.treatments.find(function(i){return i.id===t.id});if(!i)throw Error("Treatment ".concat(t.id," not found within global treatment category ").concat(o.id));return{id:t.id,clinicTreatmentId:t.clinicTreatmentId,name:t.name,duration:Number(t.duration),price:Number(t.price),sessions:Number(t.sessions),discontinued:i.discontinued,selected:!0,clinicOffers:!1,sortOrder:i.sortOrder,locations:t.locations}})}}),j.forEach(function(t){var i=P.find(function(i){return i.id===t.id});if(i){var o=P.indexOf(i);i.clinicOffers=!0,t.treatments.forEach(function(a){var g=i.treatments.find(function(t){return t.id===a.id&&t.sessions===a.sessions});if(g){var w=i.treatments.indexOf(g);g=(0,s._)((0,c._)({},g),{clinicOffers:!0,consentFormUrn:a.consentFormUrn}),i.treatments[w]=g,P[o]=i}else(eT.isMedic||!t.medicOnly)&&(i.treatments=(0,x._)(i.treatments).concat([a]),P[o]=i)})}else(eT.isMedic||!t.medicOnly)&&(P=(0,x._)(P).concat([t]))}),P.sort(ev.A),P.forEach(function(t){t.treatments.sort(ev.U)}),et(P),ew(!0)):((j=j.map(function(i){return(0,s._)((0,c._)({},i),{selected:!0,treatments:i.treatments.map(function(i){return(0,s._)((0,c._)({},i),{selected:!a.optedInToForms||i.name===eA||!!i.consentFormUrn,locations:t.map(function(t){return{locationId:t.locationId,price:i.price,discontinued:!1}})})})})})).sort(ev.A),j.forEach(function(t){return t.treatments.sort(ev.U)}),et(j.filter(function(t){return t.categoryName===eA||eT.isMedic||!t.medicOnly?t:null}))),[3,5];case 4:et([]),w.label=5;case 5:return[3,8];case 6:if(D=w.sent(),(0,z.f1)(D))return eB("forbidden",null,!0),[2];return(0,eg.M8)(D,"load practitioner treatment menu"),et([]),[3,8];case 7:return ew(!0),[7];case 8:return[2]}})})).apply(this,arguments)}var j=(i=(0,a._)(function(t,i){var o,a;return(0,w.Jh)(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),[4,g(i,t)];case 1:return[4,function(t){return _localData.apply(this,arguments)}(o=c.sent())];case 2:return c.sent(),eD(o),[3,4];case 3:return a=c.sent(),(0,z.f1)(a)?eB("forbidden","/",!0):(eP("Couldn't fetch location for the clinic"),G.A.exception(a)),[3,4];case 4:return[2]}})}),function(t,o){return i.apply(this,arguments)});return(null==eT?void 0:eT.clinicId)&&(null==eT?void 0:eT.isMedic)!==null?j(eT.id,eT.clinicId):(et([]),ew(!0)),function(){o.abort()}},[eT]),(0,B.useEffect)(function(){var t;(t=(0,a._)(function(){var t,i,o,a,c,s,g,x,j;return(0,w.Jh)(this,function(w){switch(w.label){case 0:ew(!1),w.label=1;case 1:if(w.trys.push([1,6,,7]),null===eG)throw Error("Practitioner id was null from query string");return[4,(0,ef.IF)(eG)];case 2:return 404!==(t=w.sent()).innerResponse.status&&ex((0,eg.nD)(t)),[4,(0,ep.tr)(eG,!0)];case 3:return i=w.sent(),o=(0,eg.nD)(i),a=!1,eR.set&&eR.loggedInUser&&(c=eR.loggedInUser.profile.extension_AdminClinicIds)&&c.split(";").forEach(function(t){t===o.clinic.id&&(a=!0)}),g=[eG],[4,eR.accessToken()];case 4:return[4,em.MN.apply(void 0,g.concat([w.sent()]))];case 5:return s=w.sent(),x=(0,eg.nD)(s),eb({id:o.id,clinicId:o.clinic.id,isAdmin:a,isMedic:x.isMedic}),[3,7];case 6:return j=w.sent(),(0,z.f1)(j)?eB("forbidden","/",!0):G.A.exception(j),[3,7];case 7:return[2]}})}),function(){return t.apply(this,arguments)})()},[eG]);var eV=(W=(0,a._)(function(t,i,o,a,c){var s,g,x,j,P,D,k,B,G,R;return(0,w.Jh)(this,function(w){switch(w.label){case 0:if(t.persist(),t.preventDefault(),eP(null),c(!0),(s=a.filter(function(t){return t.selected&&0===t.treatments.filter(function(t){return t.selected}).length})).length>0)return g=s.reduce(function(t,i){return"".concat(i.categoryName,", ")},""),eP("Please select at least one treatment for category ".concat(g," or remove the category.")),c(!1),[2];if(eM&&(x=!1,(j=a.find(function(t){return t.categoryName===eA}))&&(P=j.treatments.find(function(t){return t.name===eA}))?eO.filter(function(t){return P.locations.find(function(i){return i.locationId===t.locationId})?null:t}).length>0&&(x=!0):x=!0,x))return eP("Consultation is required for all locations"),c(!1),[2];if(a.filter(function(t){return t.selected&&t.treatments.filter(function(t){var i;return t.selected&&(null!=t.priceError||null!=t.durationError||(null===(i=t.locations)||void 0===i?void 0:i.filter(function(t){return null!=t.priceError}).length)>0)}).length>0}).length>0)return eP("Please correct the errors in the form above"),c(!1),[2];D=function(t){var i;return(null===(i=t.locations)||void 0===i?void 0:i.length)<1?null:t.locations.filter(function(t){return!t.discontinued}).map(function(t){return{locationId:t.locationId,price:Number(t.price)}})},k={clinicId:o,practitionerId:i,practitionerCategoryTreatments:a.filter(function(t){return t.selected}
1).map(function(t){return{categoryName:t.categoryName,id:t.id,treatments:t.treatments.filter(function(t){return t.selected}).map(function(t){return{name:t.name,price:Number(t.price),duration:Number(t.duration),id:t.id,sessions:Number(t.sessions)||1,clinicTreatmentId:t.clinicTreatmentId,locations:D(t)}})}})},w.label=1;case 1:return w.trys.push([1,5,6,7]),[4,eR.accessToken()];case 2:return B=w.sent(),[4,(0,ef.hk)(k,B)];case 3:return G=w.sent(),(0,eg.rP)(G),[4,(0,em.th)({practitionerId:i,step:{id:$.V.TreatmentMenu.id,status:Z.k.COMPLETE}},B)];case 4:return w.sent(),Y?F.Am.success("Treatment menu updated",{hideProgressBar:!0}):A().push("/practitioner-builder/id-check?id=".concat(i),"/practitioner-builder/id-check/".concat(i)),[3,7];case 5:if(R=w.sent(),(0,z.f1)(R))return eB("forbidden","/",!0),[2];return(0,eg.M8)(R,"SavePractitionerTreatmentMenu"),eP("Something went wrong, please refresh the page and try again"),[3,7];case 6:return c(!1),[7];case 7:return[2]}})}),function(t,i,o,a,c){return W.apply(this,arguments)});return(0,j.jsxs)("div",{className:"container",children:[(0,j.jsx)("h1",{className:"default-font bold column",children:"Treatment Menu"}),(0,j.jsx)(R.Z,{className:"content-divider__extra-small"}),(0,j.jsxs)("div",{className:"row column",children:[(!eT||!eN)&&(0,j.jsx)("div",{className:"spinner-wrapper",children:(0,j.jsx)(U.Z,{})}),ea&&eT&&eN&&0===eO.length&&ee.length>0&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:"form-section",children:[eT.isAdmin&&(0,j.jsxs)("p",{children:["Your practitioner is not assigned to any active locations. Please"," ",(0,j.jsx)(D(),{href:"/clinic-builder/team?id=".concat(eT.clinicId),as:"/clinic-builder/team/".concat(eT.clinicId),children:"assign locations"})," ","and then revisit this step."]}),!eT.isAdmin&&(0,j.jsx)("p",{children:"Your practitioner is not assigned to any active locations, please speak to your clinic administrator, and revisit this step once they have assigned you an active location."})]})}),ea&&eT&&eN&&eO.length>0&&ee.length>0&&(0,j.jsx)(TreatmentMenuFormPractitioner,{practitioner:eT,error:ej,clinicFormSettings:ea,globalTreatments:ee,clinicTreatmentsMissingConsentForms:er,onSubmit:eV,consultation:eA,locations:eO,enableMultiLocationView:eM,isLive:Y}),0===ee.length&&eT&&eN&&(0,j.jsx)(j.Fragment,{children:(0,j.jsxs)("div",{className:"form-section",children:[eT.isAdmin&&null!==eT.isMedic&&(0,j.jsxs)("p",{children:["The treatment menu has not yet been setup for your clinic. Please set up your clinic's"," ",(0,j.jsx)(D(),{href:"/clinic-builder/treatment-menu?id=".concat(eT.clinicId),as:"/clinic-builder/treatment-menu/".concat(eT.clinicId),children:"treatment menu in the Clinic Builder"})," ","and then revisit this step."]}),!eT.isAdmin&&null!==eT.isMedic&&(0,j.jsx)("p",{children:"The treatment menu has not yet been setup for your clinic, please speak to your clinic administrator, and revisit this step once they have configured the clinic treatment menu."}),null==eT.isMedic&&(0,j.jsxs)("p",{children:["The treatment menu cannot be set unless you specify your profession in"," ",(0,j.jsx)(D(),{href:"/practitioner-builder?id=".concat(eT.id),as:"/practitioner-builder/".concat(eT.id),children:"practitioner builder."})]})]})})]})]})})},21354:function(t,i,o){"use strict";o.d(i,{T:function(){return P}});var a,c=o(11010),s=o(97582),g=o(11752),x=o.n(g),w=o(53509),j=x()().publicRuntimeConfig.clinicBaseUrl,P=(a=(0,c._)(function(t,i){var o;return(0,s.Jh)(this,function(a){switch(a.label){case 0:return[4,fetch("".concat(j,"/ClinicFormSettings/").concat(t),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)}})];case 1:return o=a.sent(),[2,(0,w.dW)(o)]}})}),function(t,i){return a.apply(this,arguments)})},28552:function(t,i,o){"use strict";o.d(i,{EA:function(){return AssignTreatmentIntervals},GM:function(){return ValidateForms},W7:function(){return GetClinicTreatmentsTyped},jy:function(){return AssignConsentForms},kD:function(){return SaveClinicTreatmentMenuType}});var a=o(11010),c=o(97582),s=o(63144),g=o.n(s),x=o(11752),w=o.n(x),j=o(53509),P=w()().publicRuntimeConfig.clinicBaseUrl;function SaveClinicTreatmentMenuType(t,i){return _SaveClinicTreatmentMenuType.apply(this,arguments)}function _SaveClinicTreatmentMenuType(){return(_SaveClinicTreatmentMenuType=(0,a._)(function(t,i){var o;return(0,c.Jh)(this,function(a){switch(a.label){case 0:return[4,g()("".concat(P,"/clinicTreatment/saveClinicTreatments"),{method:"put",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)},body:JSON.stringify(t)})];case 1:return o=a.sent(),[2,(0,j.dW)(o)]}})})).apply(this,arguments)}function GetClinicTreatmentsTyped(t){return _GetClinicTreatmentsTyped.apply(this,arguments)}function _GetClinicTreatmentsTyped(){return(_GetClinicTreatmentsTyped=(0,a._)(function(t){var i;return(0,c.Jh)(this,function(o){switch(o.label){case 0:return[4,g()("".concat(P,"/clinicTreatment/GetClinicTreatments/").concat(t),{method:"get",headers:{"Content-Type":"application/json"}})];case 1:return i=o.sent(),[2,(0,j.dW)(i)]}})})).apply(this,arguments)}function AssignConsentForms(t,i,o){return _AssignConsentForms.apply(this,arguments)}function _AssignConsentForms(){return(_AssignConsentForms=(0,a._)(function(t,i,o){var a;return(0,c.Jh)(this,function(c){switch(c.label){case 0:return[4,g()("".concat(P,"/clinicTreatment/AssignConsentForms/").concat(t),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o)},body:JSON.stringify(i)})];case 1:return a=c.sent(),[2,(0,j.dW)(a)]}})})).apply(this,arguments)}function ValidateForms(t,i){return _ValidateForms.apply(this,arguments)}function _ValidateForms(){return(_ValidateForms=(0,a._)(function(t,i){var o;return(0,c.Jh)(this,function(a){switch(a.label){case 0:return[4,g()("".concat(P,"/clinicTreatment/ValidateForms/").concat(t),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)}})];case 1:return o=a.sent(),[2,(0,j.dW)(o)]}})})).apply(this,arguments)}function AssignTreatmentIntervals(t,i,o){return _AssignTreatmentIntervals.apply(this,arguments)}function _AssignTreatmentIntervals(){return(_AssignTreatmentIntervals=(0,a._)(function(t,i,o){var a;return(0,c.Jh)(this,function(c){switch(c.label){case 0:return[4,g()("".concat(P,"/clinicTreatment/AssignTreatmentIntervals/").concat(t),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o)},body:JSON.stringify(i)})];case 1:return a=c.sent(),[2,(0,j.dW)(a)]}})})).apply(this,arguments)}},93353:function(t,i,o){"use strict";o.d(i,{IF:function(){return GetPractitionerTreatments},MT:function(){return GetPractitionerTreatmentsV2},hk:function(){return k}});var a,c=o(11010),s=o(97582),g=o(63144),x=o.n(g),w=o(11752),j=o.n(w),P=o(53509),D=j()().publicRuntimeConfig.clinicBaseUrl,k=(a=(0,c._)(function(t,i){var o;return(0,s.Jh)(this,function(a){switch(a.label){case 0:return[4,x()("".concat(D,"/practitionerTreatment/savePractitionerTreatments"),{method:"put",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)},body:JSON.stringify(t)})];case 1:return o=a.sent(),[2,(0,P.dW)(o)]}})}),function(t,i){return a.apply(this,arguments)});function GetPractitionerTreatments(t){return _GetPractitionerTreatments.apply(this,arguments)}function _GetPractitionerTreatments(){return(_GetPractitionerTreatments=(0,c._)(function(t){var i,o,a=arguments;return(0,s.Jh)(this,function(c){switch(c.label){case 0:return i=a.length>1&&void 0!==a[1]&&a[1],[4,x()("".concat(D,"/PractitionerTreatment/GetPractitionerTreatments/").concat(t,"?includeDiscontinued=").concat(i),{method:"get",headers:{"Content-Type":"application/json"}})];case 1:return o=c.sent(),[2,(0,P.dW)(o)]}})})).apply(this,arguments)}function GetPractitionerTreatmentsV2(t){return _GetPractitionerTreatmentsV2.apply(this,arguments)}function _GetPractitionerTreatmentsV2(){return(_GetPractitionerTreatmentsV2=(0,c._)(function(t){var i,o,a,c=arguments;return(0,s.Jh)(this,function(s){switch(s.label){case 0:return i=c.length>1&&void 0!==c[1]&&c[1],o=c.length>2?c[2]:void 0,[4,x()("".concat(D,"/PractitionerTreatment/GetPractitionerTreatmentsV2/").concat(t,"?includeDiscontinued=").concat(i),{method:"get",headers:{"Content-Type":"application/json"},signal:null==o?void 0:o.signal})];case 1:return a=s.sent(),[2,(0,P.dW)(a)]}})})).apply(this,arguments)}},64831:function(t,i,o){"use strict";
1var a,c;o.d(i,{q:function(){return a}}),(c=a||(a={})).OptedOut="OptedOut",c.OptedIn="OptedIn",c.Live="Live"},82718:function(t,i,o){"use strict";o.d(i,{F$:function(){return U},FD:function(){return G},Mz:function(){return F},QU:function(){return GetClinicDetailsByIdTyped},dt:function(){return GetClinicPractitionerDetailsByIdTyped},lr:function(){return R},rc:function(){return GetPublicClinicDetailsByIdTyped},tr:function(){return GetPublicPractitionerDetailsTyped},ug:function(){return GetPublicClinicPractitionerDetailsByIdTyped}});var a,c,s,g,x=o(11010),w=o(97582),j=o(63144),P=o.n(j),D=o(11752),k=o.n(D),A=o(53509),B=k()().publicRuntimeConfig.sanityGatewayBaseUrl,F=(a=(0,x._)(function(t,i){var o,a,c=arguments;return(0,w.Jh)(this,function(s){switch(s.label){case 0:return o=c.length>2&&void 0!==c[2]&&c[2],[4,P()("".concat(B,"/Clinic/GetPublicDetailsBySlug/").concat(t,"?includeNonLive=").concat(i,"&includeArchived=").concat(o),{method:"get",headers:{"Content-Type":"application/json"}})];case 1:return a=s.sent(),[2,(0,A.dW)(a)]}})}),function(t,i){return a.apply(this,arguments)}),GetPublicClinicDetailsById=function(t,i){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return P()("".concat(B,"/Clinic/GetPublicDetailsById/").concat(t,"?includeNonLive=").concat(i,"&includeArchived=").concat(o),{method:"get",headers:{"Content-Type":"application/json"}})};function GetPublicClinicDetailsByIdTyped(t,i){return _GetPublicClinicDetailsByIdTyped.apply(this,arguments)}function _GetPublicClinicDetailsByIdTyped(){return(_GetPublicClinicDetailsByIdTyped=(0,x._)(function(t,i){var o,a=arguments;return(0,w.Jh)(this,function(c){switch(c.label){case 0:return[4,GetPublicClinicDetailsById(t,i,a.length>2&&void 0!==a[2]&&a[2])];case 1:return o=c.sent(),[2,(0,A.dW)(o)]}})})).apply(this,arguments)}function GetClinicDetailsByIdTyped(t,i,o){return _GetClinicDetailsByIdTyped.apply(this,arguments)}function _GetClinicDetailsByIdTyped(){return(_GetClinicDetailsByIdTyped=(0,x._)(function(t,i,o){var a,c,s,g=arguments;return(0,w.Jh)(this,function(x){switch(x.label){case 0:return a=g.length>3&&void 0!==g[3]&&g[3],c=g.length>4?g[4]:void 0,[4,P()("".concat(B,"/Clinic/GetDetailsById/").concat(t,"?includeNonLive=").concat(i,"&includeArchived=").concat(a),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o)},signal:null==c?void 0:c.signal})];case 1:return s=x.sent(),[2,(0,A.dW)(s)]}})})).apply(this,arguments)}var G=(c=(0,x._)(function(t,i,o){var a,c,s=arguments;return(0,w.Jh)(this,function(g){switch(g.label){case 0:return a=s.length>3&&void 0!==s[3]&&s[3],[4,P()("".concat(B,"/Clinic/GetPublicPractitionerDetailsBySlug/").concat(t,"/").concat(i,"?includeNonLive=").concat(o,"&includeArchived=").concat(a),{method:"get",headers:{"Content-Type":"application/json"}})];case 1:return c=g.sent(),[2,(0,A.dW)(c)]}})}),function(t,i,o){return c.apply(this,arguments)}),GetClinicPractitionerDetailsById=function(t,i,o){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=arguments.length>4?arguments[4]:void 0;return P()("".concat(B,"/Clinic/GetPractitionerDetailsById/").concat(t,"/").concat(i,"?includeNonLive=").concat(o,"&includeArchived=").concat(a),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(c)}})};function GetClinicPractitionerDetailsByIdTyped(t,i,o){return _GetClinicPractitionerDetailsByIdTyped.apply(this,arguments)}function _GetClinicPractitionerDetailsByIdTyped(){return(_GetClinicPractitionerDetailsByIdTyped=(0,x._)(function(t,i,o){var a,c=arguments;return(0,w.Jh)(this,function(s){switch(s.label){case 0:return[4,GetClinicPractitionerDetailsById(t,i,o,c.length>3&&void 0!==c[3]&&c[3],c.length>4?c[4]:void 0)];case 1:return a=s.sent(),[2,(0,A.dW)(a)]}})})).apply(this,arguments)}var GetPublicPractitionerDetails=function(t,i){var o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return P()("".concat(B,"/Practitioner/GetPublicDetailsById/").concat(t,"?includeNonLive=").concat(i,"&includeArchived=").concat(o),{method:"get",headers:{"Content-Type":"application/json"}})};function GetPublicPractitionerDetailsTyped(t,i){return _GetPublicPractitionerDetailsTyped.apply(this,arguments)}function _GetPublicPractitionerDetailsTyped(){return(_GetPublicPractitionerDetailsTyped=(0,x._)(function(t,i){var o,a=arguments;return(0,w.Jh)(this,function(c){switch(c.label){case 0:return[4,GetPublicPractitionerDetails(t,i,a.length>2&&void 0!==a[2]&&a[2])];case 1:return o=c.sent(),[2,(0,A.dW)(o)]}})})).apply(this,arguments)}var R=(s=(0,x._)(function(t,i,o){var a;return(0,w.Jh)(this,function(c){switch(c.label){case 0:return[4,P()("".concat(B,"/Practitioner/GetDetailsById/").concat(t,"?includeNonLive=").concat(i),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(o)}})];case 1:return a=c.sent(),[2,(0,A.dW)(a)]}})}),function(t,i,o){return s.apply(this,arguments)});function GetPublicClinicPractitionerDetailsByIdTyped(t,i,o,a){return _GetPublicClinicPractitionerDetailsByIdTyped.apply(this,arguments)}function _GetPublicClinicPractitionerDetailsByIdTyped(){return(_GetPublicClinicPractitionerDetailsByIdTyped=(0,x._)(function(t,i,o,a){var c;return(0,w.Jh)(this,function(s){switch(s.label){case 0:return[4,P()("".concat(B,"/Clinic/GetPublicPractitionerDetailsById/").concat(t,"/").concat(i,"?includeNonLive=").concat(o,"&includeArchived=").concat(a),{method:"get",headers:{"Content-Type":"application/json"}})];case 1:return c=s.sent(),[2,(0,A.dW)(c)]}})})).apply(this,arguments)}var U=(g=(0,x._)(function(t,i){var o;return(0,w.Jh)(this,function(a){switch(a.label){case 0:return[4,P()("".concat(B,"/Clinic/GetClinicPreBookingInformation/").concat(t),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)}})];case 1:return o=a.sent(),[2,(0,A.dW)(o)]}})}),function(t,i){return g.apply(this,arguments)})},25117:function(t,i,o){"use strict";o.d(i,{A:function(){return CompareCategorySortOrder},U:function(){return CompareSortOrder}});var CompareSortOrder=function(t,i){var o=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=i&&i.sortOrder,c=t&&t.sortOrder,s=i&&"number"==typeof i.sessions&&i.sessions,g=t&&"number"==typeof t.sessions&&t.sessions;
1if(o){if(!i.selected&&t.selected)return -1;if(i.selected&&!t.selected)return 1}return a&&c?0===t.name.toLowerCase().localeCompare(i.name.toLowerCase())&&s&&s&&g?g-s:c-a||t.name.toLowerCase().localeCompare(i.name.toLowerCase()):0===t.name.toLowerCase().localeCompare(i.name.toLowerCase())?s&&g?g-s:t.name.toLowerCase().localeCompare(i.name.toLowerCase()):!a&&c?-1:a||c?0:t.name.toLowerCase().localeCompare(i.name.toLowerCase())},CompareCategorySortOrder=function(t,i){if(!i.selected&&t.selected)return -1;if(i.selected&&!t.selected)return 1;var o=i&&i.sortOrder,a=t&&t.sortOrder;return o&&a?a-o||t.categoryName.toLowerCase().localeCompare(i.categoryName.toLowerCase()):o&&!a?1:!o&&a?-1:t.categoryName.toLowerCase().localeCompare(i.categoryName.toLowerCase())}},11077:function(t,i,o){"use strict";o.d(i,{AW:function(){return c},Hm:function(){return s},XN:function(){return a},eS:function(){return isValidDurationInterval},f4:function(){return reducibleTimeOverlapRemoved},gM:function(){return g}});var a=15,c=5,s="The duration is not valid, make sure to use ".concat(c,"min intervals"),g="Invalid duration, use ".concat(c," min intervals"),isValidDurationInterval=function(t){return!(t<=0)&&t%c==0},reducibleTimeOverlapRemoved=function(t){return Math.max(t-a,0)}},27967:function(){},61202:function(t,i,o){"use strict";o.d(i,{o:function(){return jwtDecode}});let InvalidTokenError=class InvalidTokenError extends Error{};function jwtDecode(t,i){let o;if("string"!=typeof t)throw new InvalidTokenError("Invalid token specified: must be a string");i||(i={});let a=!0===i.header?0:1,c=t.split(".")[a];if("string"!=typeof c)throw new InvalidTokenError(`Invalid token specified: missing part #${a+1}`);try{o=function(t){let i=t.replace(/-/g,"+").replace(/_/g,"/");switch(i.length%4){case 0:break;case 2:i+="==";break;case 3:i+="=";break;default:throw Error("base64 string is not of the correct length")}try{var o;return o=i,decodeURIComponent(atob(o).replace(/(.)/g,(t,i)=>{let o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}catch(t){return atob(i)}}(c)}catch(t){throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${a+1} (${t.message})`)}try{return JSON.parse(o)}catch(t){throw new InvalidTokenError(`Invalid token specified: invalid json for part #${a+1} (${t.message})`)}}InvalidTokenError.prototype.name="InvalidTokenError"},91444:function(t,i,o){"use strict";o.d(i,{Ix:function(){return x},Am:function(){return Q}});var a=o(67294),clsx_m=function(){for(var t,i,o=0,a="";o<arguments.length;)(t=arguments[o++])&&(i=function r(t){var i,o,a="";if("string"==typeof t||"number"==typeof t)a+=t;else if("object"==typeof t){if(Array.isArray(t))for(i=0;i<t.length;i++)t[i]&&(o=r(t[i]))&&(a&&(a+=" "),a+=o);else for(i in t)t[i]&&(a&&(a+=" "),a+=i)}return a}(t))&&(a&&(a+=" "),a+=i);return a};let u=t=>"number"==typeof t&&!isNaN(t),d=t=>"string"==typeof t,p=t=>"function"==typeof t,m=t=>d(t)||p(t)?t:null,f=t=>(0,a.isValidElement)(t)||d(t)||p(t)||u(t);function h(t){let{enter:i,exit:o,appendPosition:c=!1,collapse:s=!0,collapseDuration:g=300}=t;return function(t){let{children:x,position:w,preventExitTransition:j,done:P,nodeRef:D,isIn:k}=t,A=c?`${i}--${w}`:i,B=c?`${o}--${w}`:o,F=(0,a.useRef)(0);return(0,a.useLayoutEffect)(()=>{let t=D.current,i=A.split(" "),n=o=>{o.target===D.current&&(t.dispatchEvent(new Event("d")),t.removeEventListener("animationend",n),t.removeEventListener("animationcancel",n),0===F.current&&"animationcancel"!==o.type&&t.classList.remove(...i))};t.classList.add(...i),t.addEventListener("animationend",n),t.addEventListener("animationcancel",n)},[]),(0,a.useEffect)(()=>{let t=D.current,e=()=>{t.removeEventListener("animationend",e),s?function(t,i,o){void 0===o&&(o=300);let{scrollHeight:a,style:c}=t;requestAnimationFrame(()=>{c.minHeight="initial",c.height=a+"px",c.transition=`all ${o}ms`,requestAnimationFrame(()=>{c.height="0",c.padding="0",c.margin="0",setTimeout(i,o)})})}(t,P,g):P()};k||(j?e():(F.current=1,t.className+=` ${B}`,t.addEventListener("animationend",e)))},[k]),a.createElement(a.Fragment,null,x)}}function y(t,i){return null!=t?{content:t.content,containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,status:i}:{}}let c={list:new Map,emitQueue:new Map,on(t,i){return this.list.has(t)||this.list.set(t,[]),this.list.get(t).push(i),this},off(t,i){if(i){let o=this.list.get(t).filter(t=>t!==i);return this.list.set(t,o),this}return this.list.delete(t),this},cancelEmit(t){let i=this.emitQueue.get(t);return i&&(i.forEach(clearTimeout),this.emitQueue.delete(t)),this},emit(t){this.list.has(t)&&this.list.get(t).forEach(i=>
1{let o=setTimeout(()=>{i(...[].slice.call(arguments,1))},0);this.emitQueue.has(t)||this.emitQueue.set(t,[]),this.emitQueue.get(t).push(o)})}},T=t=>{let{theme:i,type:o,...c}=t;return a.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===i?"currentColor":`var(--toastify-icon-color-${o})`,...c})},s={info:function(t){return a.createElement(T,{...t},a.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(t){return a.createElement(T,{...t},a.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(t){return a.createElement(T,{...t},a.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(t){return a.createElement(T,{...t},a.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return a.createElement("div",{className:"Toastify__spinner"})}};function b(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientX:t.clientX}function I(t){return t.targetTouches&&t.targetTouches.length>=1?t.targetTouches[0].clientY:t.clientY}function L(t){let{closeToast:i,theme:o,ariaLabel:c="close"}=t;return a.createElement("button",{className:`Toastify__close-button Toastify__close-button--${o}`,type:"button",onClick:t=>{t.stopPropagation(),i(t)},"aria-label":c},a.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},a.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function O(t){let{delay:i,isRunning:o,closeToast:c,type:s="default",hide:g,className:x,style:w,controlledProgress:j,progress:P,rtl:D,isIn:k,theme:A}=t,B=g||j&&0===P,F={...w,animationDuration:`${i}ms`,animationPlayState:o?"running":"paused",opacity:B?0:1};j&&(F.transform=`scaleX(${P})`);let G=clsx_m("Toastify__progress-bar",j?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${A}`,`Toastify__progress-bar--${s}`,{"Toastify__progress-bar--rtl":D}),R=p(x)?x({rtl:D,type:s,defaultClassName:G}):clsx_m(G,x);return a.createElement("div",{role:"progressbar","aria-hidden":B?"true":"false","aria-label":"notification timer",className:R,style:F,[j&&P>=1?"onTransitionEnd":"onAnimationEnd"]:j&&P<1?null:()=>{k&&c()}})}let N=t=>{let{isRunning:i,preventExitTransition:o,toastRef:c,eventHandlers:s}=function(t){let[i,o]=(0,a.useState)(!1),[c,s]=(0,a.useState)(!1),g=(0,a.useRef)(null),x=(0,a.useRef)({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,w=(0,a.useRef)(t),{autoClose:j,pauseOnHover:P,closeToast:D,onClick:k,closeOnClick:A}=t;function v(i){if(t.draggable){"touchstart"===i.nativeEvent.type&&i.nativeEvent.preventDefault(),x.didMove=!1,document.addEventListener("mousemove",_),document.addEventListener("mouseup",L),document.addEventListener("touchmove",_),document.addEventListener("touchend",L);let o=g.current;x.canCloseOnClick=!0,x.canDrag=!0,x.boundingRect=o.getBoundingClientRect(),o.style.transition="",x.x=b(i.nativeEvent),x.y=I(i.nativeEvent),"x"===t.draggableDirection?(x.start=x.x,x.removalDistance=o.offsetWidth*(t.draggablePercent/100)):(x.start=x.y,x.removalDistance=o.offsetHeight*(80===t.draggablePercent?1.5*t.draggablePercent:t.draggablePercent/100))}}
1function T(i){if(x.boundingRect){let{top:o,bottom:a,left:c,right:s}=x.boundingRect;"touchend"!==i.nativeEvent.type&&t.pauseOnHover&&x.x>=c&&x.x<=s&&x.y>=o&&x.y<=a?C():E()}}function E(){o(!0)}function C(){o(!1)}function _(o){let a=g.current;x.canDrag&&a&&(x.didMove=!0,i&&C(),x.x=b(o),x.y=I(o),x.delta="x"===t.draggableDirection?x.x-x.start:x.y-x.start,x.start!==x.x&&(x.canCloseOnClick=!1),a.style.transform=`translate${t.draggableDirection}(${x.delta}px)`,a.style.opacity=""+(1-Math.abs(x.delta/x.removalDistance)))}function L(){document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",L),document.removeEventListener("touchmove",_),document.removeEventListener("touchend",L);let i=g.current;if(x.canDrag&&x.didMove&&i){if(x.canDrag=!1,Math.abs(x.delta)>x.removalDistance)return s(!0),void t.closeToast();i.style.transition="transform 0.2s, opacity 0.2s",i.style.transform=`translate${t.draggableDirection}(0)`,i.style.opacity="1"}}(0,a.useEffect)(()=>{w.current=t}),(0,a.useEffect)(()=>(g.current&&g.current.addEventListener("d",E,{once:!0}),p(t.onOpen)&&t.onOpen((0,a.isValidElement)(t.children)&&t.children.props),()=>{let t=w.current;p(t.onClose)&&t.onClose((0,a.isValidElement)(t.children)&&t.children.props)}),[]),(0,a.useEffect)(()=>(t.pauseOnFocusLoss&&(document.hasFocus()||C(),window.addEventListener("focus",E),window.addEventListener("blur",C)),()=>{t.pauseOnFocusLoss&&(window.removeEventListener("focus",E),window.removeEventListener("blur",C))}),[t.pauseOnFocusLoss]);let B={onMouseDown:v,onTouchStart:v,onMouseUp:T,onTouchEnd:T};return j&&P&&(B.onMouseEnter=C,B.onMouseLeave=E),A&&(B.onClick=t=>{k&&k(t),x.canCloseOnClick&&D()}),{playToast:E,pauseToast:C,isRunning:i,preventExitTransition:c,toastRef:g,eventHandlers:B}}(t),{closeButton:g,children:x,autoClose:w,onClick:j,type:P,hideProgressBar:D,closeToast:k,transition:A,position:B,className:F,style:G,bodyClassName:R,bodyStyle:U,progressClassName:z,progressStyle:V,updateId:J,role:Z,progress:$,rtl:W,toastId:X,deleteToast:Y,isIn:K,isLoading:ee,iconOut:et,closeOnClick:en,theme:er}=t,ei=clsx_m("Toastify__toast",`Toastify__toast-theme--${er}`,`Toastify__toast--${P}`,{"Toastify__toast--rtl":W},{"Toastify__toast--close-on-click":en}),eo=p(F)?F({rtl:W,position:B,type:P,defaultClassName:ei}):clsx_m(ei,F),ea=!!$||!w,ec={closeToast:k,type:P,theme:er},es=null;return!1===g||(es=p(g)?g(ec):(0,a.isValidElement)(g)?(0,a.cloneElement)(g,ec):L(ec)),a.createElement(A,{isIn:K,done:Y,position:B,preventExitTransition:o,nodeRef:c},a.createElement("div",{id:X,onClick:j,className:eo,...s,style:G,ref:c},a.createElement("div",{...K&&{role:Z},className:p(R)?R({type:P}):clsx_m("Toastify__toast-body",R),style:U},null!=et&&a.createElement("div",{className:clsx_m("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!ee})},et),a.createElement("div",null,x)),es,a.createElement(O,{...J&&!ea?{key:`pb-${J}`}:{},rtl:W,theme:er,delay:w,isRunning:i,isIn:K,closeToast:k,hide:D,type:P,style:V,className:z,controlledProgress:ea,progress:$||0})))},M=function(t,i){return void 0===i&&(i=!1),{enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:i}},g=h(M("bounce",!0)),x=(h(M("slide",!0)),h(M("zoom")),h(M("flip")),(0,a.forwardRef)((t,i)=>{let{getToastToRender:o,containerRef:g,isToastActive:x}=function(t){let[,i]=(0,a.useReducer)(t=>t+1,0),[o,g]=(0,a.useState)([]),x=(0,a.useRef)(null),w=(0,a.useRef)(new Map).current,T=t=>-1!==o.indexOf(t),j=(0,a.useRef)({toastKey:1,displayedToast:0,count:0,queue:[],props:t,containerId:null,isToastActive:T,getToast:t=>w.get(t)}).current;function b(t){let{containerId:i}=t,{limit:o}=j.props;!o||i&&j.containerId!==i||(j.count-=j.queue.length,j.queue=[])}function I(t){g(i=>null==t?[]:i.filter(i=>i!==t))}function _(){let{toastContent:t,toastProps:i,staleId:o}=j.queue.shift();O(t,i,o)}function L(t,o){var g,P;let{delay:D,staleId:k,...A}=o;if(!f(t)||!x.current||j.props.enableMultiContainer&&A.containerId!==j.props.containerId||w.has(A.toastId)&&null==A.updateId)return;let{toastId:B,updateId:F,data:G}=A,{props:R}=j,L=()=>I(B),U=null==F;U&&j.count++;let z={...R,style:R.toastStyle,key:j.toastKey++,...Object.fromEntries(Object.entries(A).filter(t=>{let[i,o]=t;return null!=o})),toastId:B,updateId:F,data:G,closeToast:L,isIn:!1,className:m(A.className||R.toastClassName),bodyClassName:m(A.bodyClassName||R.bodyClassName),progressClassName:m(A.progressClassName||R.progressClassName),autoClose:!A.isLoading&&(g=A.autoClose,P
1=R.autoClose,!1===g||u(g)&&g>0?g:P),deleteToast(){let t=y(w.get(B),"removed");w.delete(B),c.emit(4,t);let o=j.queue.length;if(j.count=null==B?j.count-j.displayedToast:j.count-1,j.count<0&&(j.count=0),o>0){let t=null==B?j.props.limit:1;if(1===o||1===t)j.displayedToast++,_();else{let i=t>o?o:t;j.displayedToast=i;for(let t=0;t<i;t++)_()}}else i()}};z.iconOut=function(t){let{theme:i,type:o,isLoading:c,icon:g}=t,x=null,w={theme:i,type:o};return!1===g||(p(g)?x=g(w):(0,a.isValidElement)(g)?x=(0,a.cloneElement)(g,w):d(g)||u(g)?x=g:c?x=s.spinner():o in s&&(x=s[o](w))),x}(z),p(A.onOpen)&&(z.onOpen=A.onOpen),p(A.onClose)&&(z.onClose=A.onClose),z.closeButton=R.closeButton,!1===A.closeButton||f(A.closeButton)?z.closeButton=A.closeButton:!0===A.closeButton&&(z.closeButton=!f(R.closeButton)||R.closeButton);let V=t;(0,a.isValidElement)(t)&&!d(t.type)?V=(0,a.cloneElement)(t,{closeToast:L,toastProps:z,data:G}):p(t)&&(V=t({closeToast:L,toastProps:z,data:G})),R.limit&&R.limit>0&&j.count>R.limit&&U?j.queue.push({toastContent:V,toastProps:z,staleId:k}):u(D)?setTimeout(()=>{O(V,z,k)},D):O(V,z,k)}function O(t,i,o){let{toastId:a}=i;o&&w.delete(o);let s={content:t,props:i};w.set(a,s),g(t=>[...t,a].filter(t=>t!==o)),c.emit(4,y(s,null==s.props.updateId?"added":"updated"))}return(0,a.useEffect)(()=>(j.containerId=t.containerId,c.cancelEmit(3).on(0,L).on(1,t=>x.current&&I(t)).on(5,b).emit(2,j),()=>{w.clear(),c.emit(3,j)}),[]),(0,a.useEffect)(()=>{j.props=t,j.isToastActive=T,j.displayedToast=o.length}),{getToastToRender:function(i){let o=new Map,a=Array.from(w.values());return t.newestOnTop&&a.reverse(),a.forEach(t=>{let{position:i}=t.props;o.has(i)||o.set(i,[]),o.get(i).push(t)}),Array.from(o,t=>i(t[0],t[1]))},containerRef:x,isToastActive:T}}(t),{className:w,style:j,rtl:P,containerId:D}=t;return(0,a.useEffect)(()=>{i&&(i.current=g.current)},[]),a.createElement("div",{ref:g,className:"Toastify",id:D},o((t,i)=>{let o=i.length?{...j}:{...j,pointerEvents:"none"};return a.createElement("div",{className:function(t){let i=clsx_m("Toastify__toast-container",`Toastify__toast-container--${t}`,{"Toastify__toast-container--rtl":P});return p(w)?w({position:t,rtl:P,defaultClassName:i}):clsx_m(i,m(w))}(t),style:o,key:`container-${t}`},i.map((t,o)=>{let{content:c,props:s}=t;return a.createElement(N,{...s,isIn:x(s.toastId),style:{...s.style,"--nth":o+1,"--len":i.length},key:`toast-${s.key}`},c)}))}))}));x.displayName="ToastContainer",x.defaultProps={position:"top-right",transition:g,autoClose:5e3,closeButton:L,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let w,j=new Map,P=[],D=1;function H(t,i){return j.size>0?c.emit(0,t,i):P.push({content:t,options:i}),i.toastId}function S(t,i){return{...i,type:i&&i.type||t,toastId:i&&(d(i.toastId)||u(i.toastId))?i.toastId:""+D++}}function q(t){return(i,o)=>H(i,S(t,o))}function Q(t,i){return H(t,S("default",i))}Q.loading=(t,i)=>H(t,S("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...i})),Q.promise=function(t,i,o){let a,{pending:c,error:s,success:g}=i;c&&(a=d(c)?Q.loading(c,o):Q.loading(c.render,{...o,...c}));let x={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(t,i,c)=>{if(null==i)return void Q.dismiss(a);let s={type:t,...x,...o,data:c},g=d(i)?{render:i}:i;return a?Q.update(a,{...s,...g}):Q(g.render,{...s,...g}),c},w=p(t)?t():t;return w.then(t=>l("success",g,t)).catch(t=>l("error",s,t)),w},Q.success=q("success"),Q.info=q("info"),Q.error=q("error"),Q.warning=q("warning"),Q.warn=Q.warning,Q.dark=(t,i)=>H(t,S("default",{theme:"dark",...i})),Q.dismiss=t=>{j.size>0?c.emit(1,t):P=P.filter(i=>null!=t&&i.options.toastId!==t)},Q.clearWaitingQueue=function(t){return void 0===t&&(t={}),c.emit(5,t)},Q.isActive=t=>{let i=!1;return j.forEach(o=>{o.isToastActive&&o.isToastActive(t)&&(i=!0)}),i},Q.update=function(t,i){void 0===i&&(i={}),setTimeout(()=>{let o=function(t,i){let{containerId:o}=i,a=j.get(o||w);return a&&a.getToast(t)}(t,i);if(o){let{props:a,content:c}=o,s={delay:100,...a,...i,toastId:i.toastId||t,updateId:""+D++};s.toastId!==t&&(s.staleId=t);let g=s.render||c;delete s.render,H(g,s)}},0)},Q.done=t=>{Q.update(t,{progress:1})},Q.onChange=t=>(c.on(4,t),()=>{c.off(4,t)}),Q.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Q.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},c.on(2,t=>{w=t.containerId||t,j.set(w,t),P.forEach(t=>{c.emit(0,t.content,t.options)}),P=[]}).on(3,t=>{j.delete(t.containerId||t),0===j.size&&c.off(0).off(1).off(5)})}},function(t){t.O(0,[2644,6342,1664,5159,9799,8460,7973,8542,6310,4750,7531,3157,2288,9223,2377,1679,9774,2888,179],function(){return t(t.s=1946)}),_N_E=t.O()}]); 2//# sourceMappingURL=treatment-menu-d0be71e3b74c06ce.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.