1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9072],{86275:function(e,t,n){var i=n(85893);n(67294);var Icon=function(e){var t=e.wrapperClassName,n=e.iconClassName,r=e.icon,a=e.alt;return(0,i.jsx)("div",{className:"icon round-image ".concat(t).trim(),children:(0,i.jsx)("img",{className:"icon__image ".concat(n).trim(),src:r,width:"32",height:"32",alt:a})})};Icon.defaultProps={wrapperClassName:"",iconClassName:"",alt:""},t.Z=Icon},31117:function(e,t,n){var i=n(85893);t.Z=function(e){var t=e.id,n=e.value,r=e.onChange,a=e.options;return(0,i.jsx)("select",{id:t,className:"inline-select",value:n,onChange:r,children:a})}},70664:function(e,t,n){var i=n(85893),r=n(41664),a=n.n(r),LinkAsButton=function(e){var t=e.link,n=e.className,r=e.text,o=e.shallow,s=e.testId;return(0,i.jsx)(a(),{href:t.href,as:t.as,shallow:o,className:"button text-center ".concat(n),"data-testid":s,children:r})};LinkAsButton.defaultProps={className:"",shallow:!1,testId:null},t.Z=LinkAsButton},98787:function(e,t,n){var i=n(85893);n(67294),t.Z=function(e){var t=e.className,n=e.text;return(0,i.jsx)("span",{className:"label ".concat(t),children:n})}},52898:function(e,t,n){var i=n(85893);n(67294);var RecordAccordion=function(e){var t=e.title,n=e.children,r=e.detailClassName,a=e.summaryClassName,o=e.bodyClassName,s=e.detailOpen;return(0,i.jsxs)("details",{className:"testimonial ".concat(r).trim(),open:s,children:[(0,i.jsx)("summary",{className:"padding-top-1 padding-bottom-1 padding-left-1 padding-right-1 record-accordion__header record-accordion__header--open ".concat(a).trim(),children:(0,i.jsx)("h3",{className:"margin-bottom-0 record-accordion__title",children:t})}),(0,i.jsx)("div",{className:"record__part testimonial__form section--light ".concat(o).trim(),children:n})]})};RecordAccordion.defaultProps={detailClassName:"",summaryClassName:"",bodyClassName:"",detailOpen:!1},t.Z=RecordAccordion},79892:function(e,t,n){var i=n(85893);n(67294);var CheckBox=function(e){var t=e.id,n=e.title,r=e.value,a=e.disabled,o=e.checked,s=e.children,c=e.onChange,l=e.className,d=e.required,u=e.textClassName,m=e.divClassName;return(0,i.jsxs)("div",{className:"checkbox ".concat(m).trim(),children:[(0,i.jsx)("input",{type:"checkbox",id:t,"data-testid":t,title:"select ".concat(n),name:t,value:r,disabled:a,className:l,checked:o,onChange:function(e){return c(e)},required:d}),(0,i.jsx)("label",{htmlFor:t,children:(0,i.jsx)("div",{className:"checkbox__faux"})}),(0,i.jsxs)("div",{children:[(0,i.jsx)("h4",{className:"margin-bottom-0 ".concat(u).trim(),children:n}),s]})]})};CheckBox.defaultProps={className:"",children:null,required:!1,disabled:!1,textClassName:"",divClassName:""},t.Z=CheckBox},88431:function(e,t,n){function _extends(){return(_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}n.d(t,{Z:function(){return DatePicker}});var i=n(72253),r=n(14932),a=n(91309),o=n(85893),s=n(78542),c=n(11988),DatePicker=function(e){var t=_extends({},function(e){if(null==e)throw TypeError("Cannot destructure "+e);return e}(e)),n=(0,s.u6)().setFieldValue,l=(0,a._)((0,s.U$)(t),1)[0];return(0,o.jsx)(c.ZP,(0,r._)((0,i._)({},t,l),{selected:l.value&&new Date(l.value)||void 0,onChange:function(e){n(l.name,e||"")}}))}},61251:function(e,t,n){n.d(t,{Z:function(){return c}});var i=n(91309),r=n(85893),a=n(67294),o=n(40863),s=n(37845),Tooltip=function(e){var t=e.label,n=e.text,c=e.blockContent,l=(0,i._)((0,a.useState)(!1),2),d=l[0],u=l[1],m=(0,o.ZP)().isMobile,p=(0,i._)((0,a.useState)({left:0,above:!1,y:0}),2),h=p[0],f=p[1],b=(0,a.useRef)(null),show=function(){var e=b.current,t=null==e?void 0:e.getBoundingClientRect();if(t){var n=Math.min(Math.max(t.left+t.width/2,123),window.innerWidth-115-8),i=!!(null==e?void 0:e.closest(".statistic")),r=window.innerHeight-t.bottom>110,a=t.top>110,o=m&&i;o&&!a&&(o=!1),o||r||!a||(o=!0),f({left:n,above:o,y:o?window.innerHeight-t.top+6:t.bottom+6})}u(!0)},hide=function(){return u(!1)},v=(0,a.useId)();return(0,r.jsxs)("span",{className:"tooltip",children:[(0,r.jsx)("button",{ref:b,type:"button",className:"tooltip__icon","aria-label":"About ".concat(t),"aria-expanded":d,"aria-describedby":v,onMouseEnter:show,onMouseLeave:hide,onFocus:show,onBlur:hide,children:"i"}),(0,r.jsxs)("span",{className:"tooltip__bubble",role:"tooltip",id:v,"aria-hidden":!d,style:h.above?{left:h.left,bottom:h.y}:{left:h.left,top:h.y},children:[c&&c.length>0&&(0,r.jsx)(s.Z,{blocks:c}),n]})]})};Tooltip.defaultProps={text:"",blockContent:[]};var c=Tooltip},56174:function(e,t,n){var i=n(91309),r=n(85893),a=n(67294),o=n(73857),s=n(70664),c=n(8061),l=n(90214),SnippetRow=function(e){var t=e.snippet,n=e.actionText,d=e.onAction,u=e.isExpandable,m=e.editRoute,p=e.canDelete,h=e.deleteRoute,f=(0,i._)((0,a.useState)(!1),2),b=f[0],v=f[1],g=!!u&&(t.body||"").length>128;return(0,r.jsxs)("article",{className:"snippet","data-testid":l.Z.row(t.id),children:[(0,r.jsx)("h3",{className:"snippet__title",children:t.name}),(0,r.jsxs)("div",{className:"row row--no-margin column-m-12 row--spaced row--top",children:[(0,r.jsx)("div",{className:"column-m-12 column-t-8",children:(0,r.jsx)("p",{className:"snippet__body ".concat(!b&&g?"ellipses":"").trim(),"data-testid":l.Z.rowBody(t.id),children:t.body})}),(0,r.jsxs)("div",{className:"column-m-12 margin-top-1 margin-top__t-0 column-t-4 row row--no-margin gap-small snippet__actions",children:[g&&(0,r.jsx)(o.Z,{className:"button--outline button--small",testId:l.Z.previewToggle(t.id),onClick:function(e){e.preventDefault(),v(!b)},children:b?c.It.minimisePreview:c.It.preview}),m&&(0,r.jsx)(s.Z,{link:{href:m.href,as:m.as},text:c.It.edit,shallow:!0,className:"button--gold button--small",testId:l.Z.editLink(t.id)}),p&&!!h&&(0,r.jsx)(s.Z,{className:"button--rose button--small",testId:l.Z.deleteLink(t.id),link:{href:h.href,as:h.as},text:c.It.delete}),n&&d&&(0,r.jsx)(o.Z,{text:n,testId:l.Z.insertAction(t.id),onClick:function(){return d(t)},className:"button--small button--gold"})]})]})]})};SnippetRow.defaultProps={actionText:null,onAction:null,isExpandable:!1,editRoute:null,deleteRoute:null,canDelete:!1},t.ZP=SnippetRow},10550:function(e,t,n){var i=n(85893),r=n(8061),SnippetSearchField=function(e){var t=e.id,n=e.value,r=e.onChange,a=e.label,o=e.placeholder,s=e.className;return(0,i.jsxs)("div",{className:"field ".concat(s).trim(),children:[(0,i.jsx)("label",{htmlFor:t,className:"sr-only",children:a}),(0,i.jsx)("input",{id:t,"data-testid":t,type:"search",className:"snippet-search__field",value:n,placeholder:o,onChange:function(e){return r(e.target.value)}})]})};SnippetSearchField.defaultProps={label:r.sr.label,placeholder:r.sr.placeholder,className:""},t.Z=SnippetSearchField},75136:function(e,t,n){n.d(t,{Z:function(){return j}});var i=n(91309),r=n(85893),a=n(67294),o=n(52056),s=n(11010),c=n(97582),l=n(43711),d=n(96224),u=n(53509),m=n(27878),p=n(70664),h=n(66849),f=n(54192),b=n(72176),v=n(56174),g=n(10550),x=n(8061),_=n(29208),snippets_SnippetPickerModal=function(e){var t,n=e.isOpen,o=e.closeModal,
1y=e.clinicId,j=e.onInsert,N=(0,i._)((0,a.useState)([]),2),C=N[0],w=N[1],I=(0,i._)((0,a.useState)("loading"),2),T=I[0],k=I[1],S=(0,i._)((0,a.useState)(""),2),A=S[0],P=S[1],B=(0,a.useContext)(f.ZP).userDetails,Z=!!(null===(t=B.glowdayUser)||void 0===t?void 0:t.isAdmin);if((0,a.useEffect)(function(){var e;n&&(P(""),k("loading"),(e=(0,s._)(function(){var e,t;return(0,c.Jh)(this,function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),e=[y],[4,B.accessToken()];case 1:return[4,l.d5.apply(void 0,e.concat([n.sent()]))];case 2:return w(u.nD.apply(void 0,[n.sent()])),k("loaded"),[3,4];case 3:if((t=n.sent())instanceof d.u8)return w([]),k("loaded"),[2];return k("unavailable"),m.A.exception(t),[3,4];case 4:return[2]}})}),function(){return e.apply(this,arguments)})())},[n,y]),!n)return null;var D=(0,_.Z)(C,A);return(0,r.jsxs)(b.default,{isOpen:n,closeModal:o,title:x.yt.title,showCloseButton:!0,modalInsideClassName:"snippet-picker",children:["loading"===T&&(0,r.jsx)("div",{className:"spinner-wrapper",children:(0,r.jsx)(h.Z,{})}),"unavailable"===T&&(0,r.jsx)("p",{className:"snippet__hint",children:x.yt.unavailable}),"loaded"===T&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g.Z,{id:"snippet-picker-search",value:A,onChange:P}),(0,r.jsxs)("div",{className:"snippet-picker__results",children:[0===C.length&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"snippet__hint",children:x.yt.emptyLibrary}),Z&&(0,r.jsx)(p.Z,{text:x.yt.libraryLink,className:"button--flat button--outline button--small",testId:"snippet-library-link",link:{href:"/snippets?clinicId=".concat(y),as:"/snippets/".concat(y)}})]}),C.length>0&&0===D.length&&(0,r.jsx)("p",{className:"snippet__hint",children:x.yt.noMatch(A.trim())}),D.map(function(e){return(0,r.jsx)("div",{className:"margin-bottom-1",children:(0,r.jsx)(v.ZP,{snippet:e,actionText:x.yt.insert,onAction:j,isExpandable:!0})},e.id)})]})]})]})},y=n(90214),SnippetTextarea=function(e){var t=e.id,n=e.label,s=e.value,c=e.onChange,l=e.clinicId,d=e.onBlur,u=e.placeholder,m=e.className,p=e.textareaClassName,h=(0,i._)((0,a.useState)(!1),2),f=h[0],b=h[1],v=(0,i._)((0,a.useState)(null),2),g=v[0],_=v[1],j=(0,a.useRef)(null),N=(0,a.useRef)(!1);return(0,a.useEffect)(function(){null!==g&&j.current&&(j.current.focus(),j.current.setSelectionRange(g,g),_(null))},[g]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("label",{htmlFor:t,className:"sr-only",children:n}),(0,r.jsxs)("div",{className:"field__option ".concat(m).trim(),children:[(0,r.jsx)("textarea",{ref:j,id:t,className:"snippet__textarea snippet__textarea--trigger ".concat(p).trim(),value:s,placeholder:u,onFocus:function(){N.current=!0},onBlur:function(e){return null==d?void 0:d(e.target.value)},onChange:function(e){return c(e.target.value)}}),(0,r.jsx)(o.Z,{icon:"white/insert-snippet",text:x.yt.trigger,dataTestId:y.Z.insertTrigger,className:"button--gold button--small field__option--bottom",onClick:function(){return b(!0)}})]}),(0,r.jsx)(snippets_SnippetPickerModal,{isOpen:f,closeModal:function(){var e;b(!1),null===(e=j.current)||void 0===e||e.focus()},clinicId:l,onInsert:function(e){var t=j.current,n=N.current&&t?{start:t.selectionStart,end:t.selectionEnd}:{start:s.length,end:s.length};c("".concat(s.slice(0,n.start)).concat(e.body).concat(s.slice(n.end))),_(n.start+e.body.length),b(!1)}})]})};SnippetTextarea.defaultProps={onBlur:void 0,placeholder:"",className:"",textareaClassName:""};var j=SnippetTextarea},29208:function(e,t){t.Z=function(e,t){var n=t.trim().toLowerCase();return n?e.filter(function(e){return e.name.toLowerCase().includes(n)||e.body.toLowerCase().includes(n)}):e}},90214:function(e,t){t.Z={row:function(e){return"snippet-row-".concat(e)},rowBody:function(e){return"snippet-row-body-".concat(e)},previewToggle:function(e){return"snippet-preview-toggle-".concat(e)},editLink:function(e){return"snippet-edit-".concat(e)},deleteLink:function(e){return"snippet-delete-".concat(e)},insertAction:function(e){return"snippet-insert-".concat(e)},insertTrigger:"snippet-insert-trigger",editor:"snippet-editor",nameField:"snippet-name-field",bodyField:"snippet-body-field",saveButton:"snippet-save-button",saveError:"snippet-save-error",search:"snippet-library-search",newSnippet:"snippet-new"}},24053:function(e,t,n){var i=n(11010),r=n(91309),a=n(97582),o=n(85893),s=n(12205),c=n(67294),l=n(66821),d=n(53509),u=n(73857),m=n(52056),p=n(70664),h=n(75586),f=n(70706),b=n(54192),v=n(72176),g=n(75136),Note=function(e){var t,n=e.canEdit,x=e.clinicId,_=e.clientId,y=e.canViewTreatmentOrder,j=e.note,N=e.deleteNote,C=(0,r._)((0,c.useState)(!1),2),w=C[0],I=C[1],T=(0,r._)((0,c.useState)(!1),2),k=T[0],S=T[1],A=(0,r._)((0,c.useState)(j.note),2),P=A[0],B=A[1],Z=(0,c.useContext)(b.ZP).userDetails,D=(0,c.useContext)(f.lM),R=(t=(0,i._)(function(e,t,n){var i,r,o;return(0,a.Jh)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r=[x,_,e,t,{notes:n}],[4,Z.accessToken()];case 1:return[4,l.pL.apply(void 0,r.concat([a.sent()]))];case 2:return i=a.sent(),B((0,d.nD)(i).notes),I(!1),[3,4];case 3:if(o=a.sent(),(0,h.f1)(o))return D("auth error from patient notes wrapper","/",!0),[2];return(0,d.M8)(o,"updateNotes"),[3,4];case 4:return[2]}})}),function(e,n,i){return t.apply(this,arguments)}),M=!!N,L="column-m-12";return n&&(L=w||!M?"column-m-9 column-t-10":"column-m-8"),(0,o.jsxs)("div",{className:"patient-treatment-note border-radius padding-top-1 padding-right-1 padding-bottom-1 padding-left-1",children:[(0,o.jsxs)("div",{className:"row row--no-margin margin-bottom-1 row--justified",children:[(0,o.jsx)("div",{className:"row row--no-margin row--middle ".concat(L," "),children:(0,o.jsxs)("ul",{className:"unstyled patient-treatment-note__details",children:[(0,o.jsx)("li",{className:"column-m-12",children:(0,o.jsx)("strong",{children:j.name})}),(0,o.jsx)("li",{className:"patient-treatment-note__time column-m-12",children:(0,o.jsx)("small",{children:(0,s.Z)(new Date(j.lastModified),"d/MM/yyyy H:mm a")})})]})}),n&&(0,o.jsxs)("div",{className:"".concat(w?"column-m-3 column--flex":"column-m-4 gap-small row row--no-margin"," column-t-2 row--end"),children:[(0,o.jsx)(m.Z,{icon:"".concat(w?"charcoal-dark/close":"edit"),text:"edit notes",onClick:function(){w&&B(j.note),I(!w)},className:"button--utility button--sm-shadow button--small",style:{height:"100%"}}),M&&!w&&(0,o.jsx)(m.Z,{icon:"trash",text:"delete notes",onClick:function(){S(!0)},className:"button--utility button--sm-shadow button--small",style:{height:"100%"}})]})]}),(0,o.jsx)("div",{className:"".concat(w?"padding-top-1":""),children:w&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g.Z,{id:"notes-".concat(j.id),label:"Notes",clinicId:x,value:P,onChange:B,textareaClassName:"patient-treatment-note__textarea border-radius padding-top-1 padding-right-1 padding-bottom-1 padding-left-1"}),(0,o.jsx)("div",{className:"column-m-12 column-t-6 column-d-4 margin-top-1",children:(0,o.jsx)(u.Z,{className:"button--flat button--green button--small button--fullwidth",text:"Update Notes",type:"submit",disabled:0===P.trim().length,onClick:function(){return R(j.treatmentRecordId,j.id,P)}})})]})||(0,o.jsx)("div",{className:"patient-treatment-note__text border-top border-top__dashed padding-top-1 ".concat(y?"border-bottom border-bottom__dashed padding-bottom-1":"").trim(),children:(0,o.jsx)("pre",{className:"patient-treatment-note__content",children:P})})}),y&&!w&&(0,o.jsx)("div",{className:"column-m-12 column-t-4 margin-top-1",children:(0,o.jsx)(p.Z,{className:"button--flat button--ivory button--small button--fullwidth",text:"View Treatment",link:{href:"/treatment-management?bookingId=".concat(j.treatmentRecordId),as:"/treatment-management/".concat(j.treatmentRecordId)}})}),(0,o.jsx)(v.default,{modalInsideClassName:"patient-treatment-note__confirm-delete-modal",isOpen:k,closeModal:function(){return S(!1)},children:(0,o.jsxs)("div",{className:"record__part",children:[(0,o.jsx)("h1",{className:"default-font",children:"Delete Note"}),(0,o.jsx)("p",{children:"Are you sure you want to delete this treatment note?"}),(0,o.jsxs)("div",{className:"row row--spaced row--no-margin treatment__action border-top padding-top-1",children:[(0,o.jsx)("div",{className:"column-m-12 column-t-4",children:N&&(0,o.jsx)(u.Z,{text:"Delete",className:"button--flat button--rose button--small button--fullwidth",onClick:function(){return N(x,_,j.treatmentRecordId,j.id)}})}),(0,o.jsx)("div",{className:"column-m-12 column-t-4",children:(0,o.jsx)(u.Z,{text:"Cancel",className:"button--flat button--outline button--small button--fullwidth",onClick:function(){return S(!1)}})})]})]})})]})};Note.defaultProps={deleteNote:null},t.Z=Note},48508:function(e,t,n){n.d(t,{W:function(){return toNotesViewModel}});var toNotesViewModel=function(e){return{id:e.id,note:e.notes,lastModified:e.lastUpdatedUtc,treatmentRecordId:e.treatmentRecordId,userId:e.ownerUserId,name:"".concat(e.ownerFirstName," ").concat(e.ownerLastName)}}},39072:function(e,t,n){n.r(t),n.d(t,{default:function(){return patient_management_tab_PatientManagementCard}});
1var i,r,a,o,s,c,l,d,u,m=n(11010),p=n(91309),h=n(97582),f=n(85893),b=n(11163),v=n(67294),g=n(67967),x=n(55498),_=n(53509),y=n(73093),j=n(75586),N=n(70706),C=n(54192),w=n(72176),I=n(72253),T=n(12205),k=n(48377),S=n(55661);n(62287),(i=l||(l={})).NotSet="",i.Appointments="appointments",i.Edit="edit",i.Notes="notes",i.Comms="comms",i.Reminders="reminders",(r=d||(d={})).ClinicPatient="clinicPatient",r.GlowdayPatient="glowdayPatient";var getAddress=function(e){return e&&Object.values(e).join("")?(0,I._)({},e):null},getBookingStatusFriendlyName=function(e){switch(e){case k.gn.Confirmed:return"Confirmed";case k.gn.Completed:return"Completed";case k.gn.NoShow:return"Not Attended";case k.gn.Cancelled:return"Cancelled";case k.gn.ConfirmedPendingCustomerDetails:case k.gn.Pending:return"Pending";case k.gn.CheckedIn:return"Checked In";default:throw Error("The status ".concat(e," doesn't exist"))}},getFormStatusClassName=function(e){switch(e){case k.gn.Confirmed:return"label__booking--confirmed";case k.gn.Completed:return"label__booking--completed";case k.gn.NoShow:case k.gn.Cancelled:return"label--red";case k.gn.ConfirmedPendingCustomerDetails:case k.gn.Pending:return"label__booking--pending";case k.gn.CheckedIn:return"label__booking--confirmed";default:throw Error("The status ".concat(e," doesn't exist"))}},toClientViewModel=function(e){return{inactive:e.inactive,email:e.email,id:e.clientId,clinicId:e.clinicId,mobile:e.phoneNumber,name:"".concat(e.firstName," ").concat(e.surname),firstName:e.firstName,lastName:e.surname,accountType:e.isClinicOwned?d.ClinicPatient:d.GlowdayPatient,loginType:e.accountType,dob:e.dateOfBirth,address:getAddress(e.address),notes:e.notes}},ClientBookingsViewModel=function(e){var t,n,i;return{id:e.id,bookingAppointmentId:e.bookingAppointmentId,bookingStatus:getBookingStatusFriendlyName(e.bookingStatus),startDate:(0,T.Z)(new Date(e.start),"dd/MM/yyyy HH:mm"),timeZone:e.timeZone,practitionerId:e.practitionerId,bookingSummary:{shortDescription:(null===(t=e.bookingSummary)||void 0===t?void 0:t.shortDescription)||(null===(n=e.bookingSummary)||void 0===n?void 0:n.treatments[0])||"",treatments:(null===(i=e.bookingSummary)||void 0===i?void 0:i.treatments)||[]},statusClassName:getFormStatusClassName(e.bookingStatus)}},toClinicCustomerUpdateInputModel=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return{firstName:e.firstName,surname:e.lastName,email:e.email,phoneNumber:e.mobile,practitionerId:t}},validatePatientCardNavigation=function(e,t){switch(e){case l.Edit:return t.accountType===d.ClinicPatient;case l.Appointments:case l.Notes:case l.Comms:case l.Reminders:return!!t.id;default:return!1}},A=n(78542),P=n(7622),B=n(91310),Z=n(16310),D=n(63144),R=n.n(D),M=n(11752),L=n.n(M)()().publicRuntimeConfig.bookingBaseUrl,O=(a=(0,m._)(function(e,t,n,i){var r;return(0,h.Jh)(this,function(a){switch(a.label){case 0:return[4,R()("".concat(L,"/ClinicClient/Clinic/").concat(e,"/client/").concat(t),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify(i)})];case 1:return r=a.sent(),[2,(0,_.dW)(r)]}})}),function(e,t,n,i){return a.apply(this,arguments)}),J=(o=(0,m._)(function(e,t,n){var i;return(0,h.Jh)(this,function(r){switch(r.label){case 0:return[4,R()("".concat(L,"/ClinicClient/Clinic/").concat(e,"/client/").concat(t,"/activate"),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)}})];case 1:return i=r.sent(),[2,(0,_.dW)(i)]}})}),function(e,t,n){return o.apply(this,arguments)}),E=(s=(0,m._)(function(e,t,n){var i;return(0,h.Jh)(this,function(r){switch(r.label){case 0:return[4,R()("".concat(L,"/ClinicClient/Clinic/").concat(e,"/client/").concat(t,"/inactivate"),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)}})];case 1:return i=r.sent(),[2,(0,_.dW)(i)]}})}),function(e,t,n){return s.apply(this,arguments)}),F=n(38570),G=n(91748),U=n(73857),W=n(86060),z=n(88431),molecules_YearAndMonthDatePicker=function(e){var t=e.dateForPicker,n=e.setFieldValue,i=e.fieldName;return(0,f.jsx)(z.Z,{placeholderText:"Select date of birth",onSelect:function(e){n(i,e)},name:i,dateFormat:"dd/MM/yyyy",yearDropdownItemNumber:100,showYearDropdown:!0,scrollableYearDropdown:!0,maxDate:new Date,selected:t,disabledKeyboardNavigation:!0,onKeyDown:function(e){e.preventDefault()}})},sections_OfflinePatientEdit=function(e){var t,n,i,r,a,o,s=e.client,c=e.setClient,l=e.practitionerId,u=e.closingRouteObj,g=(0,p._)((0,v.useState)(""),2),x=g[0],y=g[1],w=(0,v.useContext)(C.ZP).userDetails,I=(0,v.useContext)(N.lM),T=(0,b.useRouter)();return(0,f.jsx)("div",{className:"record__section patient-summary",children:(0,f.jsx)(A.J9,{initialValues:{firstName:s.firstName,lastName:s.lastName,email:s.email,mobile:s.mobile,dob:s.dob?new Date(s.dob):null,firstLine:(null===(n=s.address)||void 0===n?void 0:n.firstLine)||"",secondLine:(null===(i=s.address)||void 0===i?void 0:i.secondLine)||"",postCode:(null===(r=s.address)||void 0===r?void 0:r.postcode)||"",city:(null===(a=s.address)||void 0===a?void 0:a.city)||"",county:(null===(o=s.address)||void 0===o?void 0:o.county)||"",notes:s.notes||""},onSubmit:(t=(0,m._)(function(e,t){var n,i,r,a,o,m,p,f,b,v;return(0,h.Jh)(this,function(h){switch(h.label){case 0:(n=t.setSubmitting)(!0),y(""),i={id:s.id,firstName:e.firstName,lastName:e.lastName,email:e.email,mobile:e.mobile},h.label=1;case 1:return h.trys.push([1,5,6,7]),[4,w.accessToken()];
1case 2:return r=h.sent(),a=toClinicCustomerUpdateInputModel(i,l),[4,(0,F.uu)(a,s.id,r)];case 3:return o=h.sent(),m={dateOfBirth:e.dob?new Date(e.dob).toISOString():null,notes:e.notes,address:{firstLine:e.firstLine,secondLine:e.secondLine,city:e.city,postcode:e.postCode,county:e.county}},[4,O(s.clinicId,s.id,r,m)];case 4:return p=h.sent(),f=(0,_.nD)(o),c({inactive:(b=(0,_.nD)(p)).inactive,id:f.id,name:"".concat(f.firstName," ").concat(f.surname),clinicId:f.clinicId,firstName:f.firstName,lastName:f.surname,email:f.email,mobile:f.phoneNumber,accountType:b.isClinicOwned?d.ClinicPatient:d.GlowdayPatient,loginType:b.accountType,notes:b.notes,address:getAddress(b.address),dob:b.dateOfBirth}),T.push("".concat(u.href,"&patientId=").concat(s.id),"".concat(u.as,"/patient/").concat(s.id),{shallow:!0}),[3,7];case 5:return v=h.sent(),(0,j.f1)(v)?I("/forbidden","/",!0):(y("Failed to update the details, please try again"),(0,_.M8)(v,"Update offline patient details")),[3,7];case 6:return n(!1),[7];case 7:return[2]}})}),function(e,n){return t.apply(this,arguments)}),validationSchema:Z.Ry({firstName:Z.Z_().required("First name is Required"),lastName:Z.Z_().required("Last name is Required"),dob:Z.Z_().nullable(),firstLine:Z.Z_(),secondLine:Z.Z_().nullable(),postCode:Z.Z_().min(5,"Should be a valid UK postcode").max(10,"Should be a valid UK postcode").nullable(),city:Z.Z_(),county:Z.Z_().nullable(),notes:Z.Z_().max(1024)}).shape({mobile:Z.Z_().nullable().test("isValid","Invalid mobile number",function(e){return!e||(0,P.yf)(e)}).when("email",function(e,t){return null==e?Z.Z_().required("*mobile or email required"):t}),email:Z.Z_().nullable().matches(G.Z,"Invalid email").when("mobile",function(e,t){return null==e?Z.Z_().nullable().matches(G.Z,"Invalid email").required("*mobile or email required"):t})},[["mobile","email"]]),children:function(e){var t=e.errors,n=e.touched,i=e.isSubmitting,r=e.values,a=e.setFieldValue;return(0,f.jsxs)(A.l0,{autoComplete:"off",children:[(0,f.jsxs)("div",{className:"row row--no-margin",children:[(0,f.jsx)("div",{className:"column-m-8 column-t-10",children:(0,f.jsx)("h2",{className:"margin-bottom-1",children:"Edit Patient"})}),(0,f.jsx)("div",{className:"column-m-4 column-t-2",children:(0,f.jsx)(U.Z,{text:"Close",className:"button--outline button--fullwidth button--small",onClick:function(){return T.push("".concat(u.href,"&patientId=").concat(s.id),"".concat(u.as,"/patient/").concat(s.id))}})})]}),(0,f.jsxs)("div",{className:"record__section record__section--borderless row row--no-margin",children:[(0,f.jsxs)("div",{className:"patient-summary__item border-bottom column-m-12",children:[(0,f.jsxs)("div",{className:"field column-m-12 column-t-6 padding-right__t-1".concat(t.firstName&&n.firstName?" field--error":""),children:[(0,f.jsx)("label",{htmlFor:"firstName",children:"First name"}),(0,f.jsx)(A.gN,{name:"firstName",id:"firstName",placeholder:"First name"}),(0,f.jsx)(A.Bc,{name:"firstName",component:"div"})]}),(0,f.jsxs)("div",{className:"field column-m-12 column-t-6".concat(t.lastName&&n.lastName?" field--error":""),children:[(0,f.jsx)("label",{htmlFor:"lastName",children:"Last name"}),(0,f.jsx)(A.gN,{name:"lastName",id:"lastName",placeholder:"Last name"}),(0,f.jsx)(A.Bc,{name:"lastName",component:"div"})]}),(0,f.jsxs)("div",{className:"field column-m-12 2 column-t-6 padding-right__t-1".concat(t.firstName&&n.firstName?" field--error":""),children:[(0,f.jsx)("label",{htmlFor:"email",children:"Email"}),(0,f.jsx)(A.gN,{name:"email",id:"email",placeholder:"Email address"}),(0,f.jsx)(A.Bc,{name:"email",component:"div"})]}),(0,f.jsxs)("div",{className:"field field--no-margin column-m-12 2 column-t-6".concat(t.mobile&&n.mobile?" field--error":""),children:[(0,f.jsx)("label",{htmlFor:"mobile",children:"Mobile number"}),(0,f.jsx)(B.ZP,{defaultCountry:"GB",name:"mobile",id:"mobile",placeholder:"Mobile number",value:r.mobile,onChange:function(e){return a("mobile",e)}}),(0,f.jsx)(A.Bc,{name:"mobile",component:"div"})]})]}),(0,f.jsxs)("div",{className:"field ".concat(t.dob&&n.dob?"field--error":""," column-m-12 padding-top-1"),children:[(0,f.jsx)("label",{htmlFor:"dob",children:"Date of Birth"}),(0,f.jsx)(molecules_YearAndMonthDatePicker,{dateForPicker:new Date,setFieldValue:a,fieldName:"dob"}),(0,f.jsx)(A.Bc,{name:"dob",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.firstLine&&n.firstLine?"field--error":""," column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"firstLine",children:"Address"}),(0,f.jsx)(A.gN,{type:"text",name:"firstLine",id:"firstLine",placeholder:"First address line"}),(0,f.jsx)(A.Bc,{name:"firstLine",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.secondLine&&n.secondLine?"field--error":""," column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"secondLine",className:"sr-only",children:"Second Address Line"}),(0,f.jsx)(A.gN,{type:"text",name:"secondLine",id:"secondLine",placeholder:"Second address line"}),(0,f.jsx)(A.Bc,{name:"secondLine",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.city&&n.city?"field--error":""," column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"city",className:"sr-only",children:"City/Town"}),(0,f.jsx)(A.gN,{type:"text",name:"city",id:"city",placeholder:"City or Town"}),(0,f.jsx)(A.Bc,{name:"city",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.county&&n.county?"field--error":""," column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"county",className:"sr-only",children:"County"}),(0,f.jsx)(A.gN,{type:"text",name:"county",id:"county",placeholder:"County"}),(0,f.jsx)(A.Bc,{name:"county",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.postCode&&n.postCode?"field--error":""," column-m-12 column-t-6"),children:[(0,f.jsx)("label",{htmlFor:"postCode",className:"sr-only",children:"Postcode"}),(0,f.jsx)(A.gN,{type:"text",name:"postCode",id:"postCode",placeholder:"Postcode",maxLength:10,minLength:5}),(0,f.jsx)(A.Bc,{name:"postCode",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.notes&&n.notes?"field--error":""," column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"notes",children:"Notes"}),(0,f.jsx)("textarea",{name:"notes",id:"notes",placeholder:"Notes",className:"client-notes__field",onChange:function(e){return a("notes",e.target.value)},maxLength:1024,defaultValue:r.notes}),(0,f.jsx)("div",{className:"margin-top-1",children:(0,f.jsxs)("span",{className:"label ".concat(r.notes.length<1e3?"label--green":"label--red"),children:[r.notes.length,"/1024"]})}),(0,f.jsx)(A.Bc,{name:"notes",component:"div"})]}),x&&(0,f.jsx)("div",{className:"padding-top-1 margin-bottom-1 padding-bottom-1 border-bottom",children:(0,f.jsx)(W.Z,{text:
1x})}),(0,f.jsx)("div",{className:"column-m-12 padding-top-1 padding-bottom-1",children:(0,f.jsx)(U.Z,{text:i?"updating...":"Update patient info",className:"button--flat button--green button--fullwidth button--small",type:"submit",disabled:i})})]})]})}})})},V=n(32304),H=n(52056),getStageTitle=function(e){switch(e){case l.Appointments:return"Appointments";case l.Notes:return"Notes";case l.Reminders:return"Reminders";case l.Comms:return"Emails";default:return"Patient Summary"}},q=n(41664),Y=n.n(q),molecules_HeaderStep=function(e){var t=e.stepLink,n=e.title,i=e.tab,r=e.isActive,a=t.as.includes("?")?"&":"?";return(0,f.jsx)("div",{className:"record-navigation__item ".concat(r?"record-navigation__item--current":"").trim(),children:(0,f.jsxs)(Y(),{href:"".concat(t.href).concat(i?"&patientTab=".concat(i):"").trim(),as:"".concat(t.as).concat(i?"".concat(a,"patientTab=").concat(i):"").trim(),shallow:!0,className:"capitalise record-navigation__link",children:[(0,f.jsx)("img",{src:"/static/img/icons/green/".concat(function(e){switch(e){case l.Appointments:return"date-slim";case l.Notes:return"patient-notes";case l.Reminders:return"reminders";case l.Comms:return"comms";default:return"person"}}(i),".svg"),alt:"",width:"32",height:"32",className:"patient-navigation__image"}),(0,f.jsx)("span",{className:"hide-on-mobile hide-on-tablet",children:n})]})})},sections_PatientHeader=function(e){var t=e.closeModal,n=e.closingRouteObject,i=e.routeObject,r=e.patientType,a=e.patientId,o=(0,p._)((0,v.useState)(""),2),s=o[0],c=o[1],u=(0,p._)((0,v.useState)(!1),2),m=u[0],h=u[1],g=(0,v.useContext)(C.ZP).userDetails,_=(0,b.useRouter)(),j=_.query,N=j.tab,w=j.patientTab,I=(0,x.ZP)(_.query.prevState);(0,v.useEffect)(function(){if(g&&g.glowdayUser){var e,t;h((null==g?void 0:null===(e=g.glowdayUser)||void 0===e?void 0:e.userRole.includes(y.x.admin))||(null==g?void 0:null===(t=g.glowdayUser)||void 0===t?void 0:t.userRole.includes(y.x.practitioner)))}},[g]),(0,v.useEffect)(function(){var e;c(getStageTitle(null!==(e=null!=N?N:w)&&void 0!==e?e:""))},[N,w]);var NavigateToTab=function(e){e.preventDefault(),_.back()},T=i.as.includes("?")?"&":"?",k={href:I?"".concat(i.href,"&prevState=").concat(encodeURIComponent(I)):i.href,as:I?"".concat(i.as).concat(T,"prevState=").concat(encodeURIComponent(I)):i.as,patientId:a};return(0,f.jsxs)("div",{className:"record-header",children:[(0,f.jsx)("div",{className:"record-header__button-space column-m-1 column-m-order-1",children:N&&(0,f.jsx)(H.Z,{className:"button__modal--back",onClick:function(e){return NavigateToTab(e)},text:"go to previous screen",icon:"white/chevron-left"})}),(0,f.jsx)(V.pU,{lessThan:"md",className:"column-m-8 column-m-order-2",children:(0,f.jsx)("h2",{className:"record-header__title margin-bottom-0 text-center",children:s})}),(0,f.jsx)("div",{className:"record-header__wrapper margin-top-1 margin-top__t-0 column-m-12 column-m-order-4 column-t-9 column-t-order-2",children:(0,f.jsx)("nav",{className:"record-navigation patient-navigation",children:(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(molecules_HeaderStep,{tab:l.NotSet,title:"Personal",stepLink:k,isActive:!N&&!w}),(0,f.jsx)(molecules_HeaderStep,{tab:l.Appointments,title:"Appointments",stepLink:k,isActive:N===l.Appointments||w===l.Appointments}),m&&(0,f.jsx)(molecules_HeaderStep,{tab:l.Notes,title:"Notes",stepLink:k,isActive:N===l.Notes||w===l.Notes}),r===d.GlowdayPatient&&(0,f.jsx)(molecules_HeaderStep,{tab:l.Reminders,title:"Reminders",stepLink:k,isActive:N===l.Reminders||w===l.Reminders}),(0,f.jsx)(molecules_HeaderStep,{tab:l.Comms,title:"Communications",stepLink:k,isActive:N===l.Comms||w===l.Comms})]})})}),(0,f.jsx)("div",{className:"row row--no-margin row--end record-header__button-space column-m-2 column-m-order-3",children:(0,f.jsx)(H.Z,{className:"button__modal--close",onClick:function(){I?_.push("".concat(n.href,"&").concat(I),"".concat(n.as,"?").concat(I),{shallow:!0}):t()},text:"close the modal",icon:"white/close"})})]})},$=n(66821),Q=n(66849),K=n(24053),X=n(48508),lastUpdatedInDescendingOrder=function(e,t){return new Date(t.lastUpdatedUtc).getTime()-new Date(e.lastUpdatedUtc).getTime()},tabs_NotesWrapper=function(e){var t=e.clinicId,n=e.clientId,i=(0,p._)((0,v.useState)(!0),2),r=i[0],a=i[1],o=(0,p._)((0,v.useState)([]),2),s=o[0],c=o[1],l=(0,p._)((0,v.useState)(""),2),d=l[0],u=l[1],b=(0,v.useContext)(C.ZP).userDetails,g=(0,v.useContext)(N.lM);return(0,v.useEffect)(function(){var e;return(e=(0,m._)(function(){var e,i,r;return(0,h.Jh)(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,4,5]),i=[t,n],[4,b.accessToken()];case 1:return[4,$.bw.apply(void 0,i.concat([o.sent()]))];case 2:return e=o.sent(),c((0,_.nD)(e).sort(lastUpdatedInDescendingOrder).map(function(e){return(0,X.W)(e)})),[3,5];case 3:return r=o.sent(),(0,j.f1)(r)?g("auth error from patient notes wrapper","/",!0):(u("couldn't load notes"),(0,_.M8)(r,"PMT: GetPatientNotes")),[3,5];case 4:return a(!1),[7];case 5:return[2]}})}),function(){return e.apply(this,arguments)})(),function(){}},[]),(0,f.jsxs)("div",{className:"record__section patient-notes__full",children:[(0,f.jsx)("h3",{className:"border-bottom border-bottom__dashed",children:"Notes"}),r&&null===s&&(0,f.jsx)("div",{className:"spinner-wrapper",children:(0,f.jsx)(Q.Z,{})}),!r&&0===s.length&&(0,f.jsxs)("div",{className:"",children:[(0,f.jsx)("h3",{children:"Patient notes"}),(0,f.jsx)("p",{children:"There are currently no treatment nor adhoc notes for this patient"})]}),!r&&s.length>0&&(0,f.jsx)("div",{className:"record__treatments record__treatments--full ".concat(s.length>1?"padding-right-1":"").trim(),children:s.map(function(e,i){var r;return(0,f.jsx)("div",{className:"".concat(s.length===i+1?"":"margin-bottom-1"),children:(0,f.jsx)(K.Z,{canEdit:e.userId===(null===(r=b.loggedInUser)||void 0===r?void 0:r.profile.sub),note:e,canViewTreatmentOrder:!0,clinicId:t,clientId:n}
1)},e.id)})}),!r&&d&&(0,f.jsx)("div",{className:"padding-top-1",children:(0,f.jsx)(W.Z,{text:d})})]})},ee=n(51059),et=n(82718),en=n(96224),ei=n(42699),er=n(52898),molecules_AppointmentLink=function(e){var t=e.bookingId,n=e.className;return(0,f.jsx)("div",{className:n,children:(0,f.jsxs)(Y(),{href:"/treatment-management?bookingId=".concat(t),as:"/treatment-management/".concat(t),shallow:!0,children:[(0,f.jsx)("div",{className:"hide-on-mobile hide-on-tablet",children:(0,f.jsx)("div",{className:"record-appointment__link record-appointment__link--extra-padding round-image shadow__utility",children:(0,f.jsx)("img",{src:"/static/img/icons/chevron-right.svg",alt:"view this booking",width:"16",height:"16"})})}),(0,f.jsx)("span",{className:"hide-on-laptop",children:"View Booking"})]})})},molecules_AppointmentRow=function(e){var t=e.history,n=e.practitionerName;return(0,f.jsxs)("div",{className:"record__row row row--no-margin record__row--bottom row--middle padding-right-1 padding-right__t-0",children:[(0,f.jsx)("div",{className:"column-m-6 column-t-8 column-d-3 margin-bottom-1 margin-bottom__t-0 column-d-order-1",children:(0,f.jsxs)("ul",{className:"unstyled",children:[(0,f.jsx)("li",{children:(0,f.jsx)("small",{className:"bold",children:t.startDate})}),n&&(0,f.jsx)("li",{children:(0,f.jsx)("span",{children:n})})]})}),(0,f.jsx)("div",{className:"column-m-6 column-t-4 column-d-2 margin-bottom-1 margin-bottom__d-0 column-d-order-3",children:(0,f.jsx)("small",{className:"label label--small uppercase label--small-font ".concat(t.statusClassName),children:t.bookingStatus})}),(0,f.jsx)("div",{className:"column-m-12 column-d-5 margin-bottom-1 margin-bottom__d-0 column-d-order-2",children:(0,f.jsx)("span",{children:t.bookingSummary.shortDescription})}),(0,f.jsx)(molecules_AppointmentLink,{bookingId:t.id,className:"column-m-12 column-d-2 padding-right-1 margin-bottom-1 margin-bottom__d-0 column-d-order-4"})]},t.id)},sections_AppointmentsSection=function(e){var t=e.clientHistory,n=e.title,i=e.clinicPractitioners;return(0,f.jsx)("div",{className:"record__part--bottom",children:(0,f.jsx)(er.Z,{title:n,bodyClassName:"record-accordion__body--tall",detailOpen:!0,children:(0,f.jsxs)("div",{className:"record__treatments record__treatments--medium",children:[!t.length&&(0,f.jsx)("p",{children:"There are no bookings for this client"}),t.length>0&&t.map(function(e){var t;return(0,f.jsx)(molecules_AppointmentRow,{history:e,practitionerName:(null===(t=i.find(function(t){return t.id===e.practitionerId}))||void 0===t?void 0:t.name)||null},e.id)})]})})})},ea=n(93353),eo=n(19987),es=n(10138),ec=n(57786),molecules_RecordAppointmentRow=function(e){var t=e.clinicId,n=e.clientId,i=e.session,r=e.practitionerId,a={as:"/diary/".concat(t,"/book?bookingClientId=").concat(n,"&practitionerId=").concat(r),href:"/diary?clinicId=".concat(t,"&practitionerId=").concat(r,"&bookingClientId=").concat(n)};return(0,f.jsxs)("div",{className:"row row--no-margin row--middle record__row record__row--bottom padding-right__t-1",children:[(0,f.jsx)("div",{className:"column-m-12 column-t-9 margin-bottom-1 margin-bottom__t-0",children:(0,f.jsxs)("ul",{className:"unstyled",children:[(0,f.jsx)("li",{children:(0,f.jsx)("strong",{className:"uppercase bold",children:i.categoryName})}),(0,f.jsx)("li",{children:(0,f.jsx)("span",{children:i.name})})]})}),(0,f.jsx)("div",{className:"column-m-12 column-t-3 text-right",children:(0,f.jsx)(Y(),{href:a.href,as:a.as,children:"Book Session >"})})]})},AvailableSessionsSection=function(e){var t=e.clinicId,n=e.clientId,i=e.practitionerId,r=(0,p._)((0,v.useState)([]),2),a=r[0],o=r[1],s=(0,p._)((0,v.useState)(!1),2),c=s[0],l=s[1],d=(0,v.useContext)(N.lM),u=(0,v.useContext)(C.ZP).userDetails;return(0,v.useEffect)(function(){var e,r=new AbortController;return(e=(0,m._)(function(){var e,a,s,c,m,p;return(0,h.Jh)(this,function(h){switch(h.label){case 0:return h.trys.push([0,4,5,6]),l(!0),[4,(0,ea.IF)(i,!0)];case 1:return e=h.sent(),a=(0,_.nD)(e).practitionerCategoryTreatments,c=[t,i,n],[4,u.accessToken()];case 2:return[4,eo.Cw.apply(void 0,c.concat([h.sent(),r]))];case 3:return s=h.sent(),(m=(0,_.nD)(s)).length>0&&a.length>0?o((0,es.$J)(m,a).filter(function(e){return e.availableSessions>0}).map(function(e){return(0,ec.d)(e)})):o([]),[3,6];case 4:if(p=h.sent(),(0,j.f1)(p))return d("auth error for getting client available sessions","/",!0),[2];if(p instanceof en.nl&&404===p.status)return o([]),[2];return(0,_.M8)(p,"GetAvailableClientSessionsForClinicPractitioner",r),[3,6];case 5:return l(!1),[7];case 6:return[2]}})}),function(){return e.apply(this,arguments)})(),function(){r.abort()}},[i]),(0,f.jsx)("div",{className:"record__part--bottom",children:(0,f.jsxs)(er.Z,{title:"Bookable Sessions",bodyClassName:"record-accordion__body--tall",detailOpen:!0,children:[c&&(0,f.jsx)("div",{className:"spinner-wrapper",children:(0,f.jsx)(Q.Z,{})}),!c&&0===a.length&&(0,f.jsx)("article",{children:(0,f.jsx)("p",{children:"This practitioner doesn't have any sessions available for this client"})}),a.length>0&&!c&&(0,f.jsx)("div",{className:"record__treatments record__treatments--medium",children:a.map(function(e){return(0,f.jsx)(molecules_RecordAppointmentRow,{clientId:n,session:e,clinicId:t,practitionerId:i},e.compositeId)})})]})})},tabs_PatientAppointments=function(e){var t,n=e.practitionerId,i=e.clientId,r=e.clinicId,a=e.hasAccessToAllBookings,o=(0,p._)((0,v.useState)([]),2),s=o[0],c=o[1],l=(0,p._)((0,v.useState)([]),2),d=l[0],u=l[1],b=(0,p._)((0,v.useState)(""),2),g=b[0],x=b[1],y=(0,p._)((0,v.useState)(!0),2),w=y[0],I=y[1],T=(0,p._)((0,v.useState)([]),2),k=T[0],S=T[1],A=(0,v.useContext)(C.ZP).userDetails,P=(0,p._)((0,v.useState)(n),2),B=P[0],Z=P[1],D=(0,v.useContext)(N.lM),R=(t=(0,m._)(function(e,t){var n,o,s,l,d,m,p;return(0,h.Jh)(this,function(h){switch(h.label){case 0:I(!0),h.label=1;case 1:return h.trys.push([1,7,9,10]),[4,A.accessToken()];case 2:if(n=h.sent(),!a&&!t)throw Error("PatientAppointments - does not have AccessToAllBookings and No practitioner selected");if(!a)return[3,4];return[4,(0,ee.f)({clinicId:r,customerId:i,practitionerId:t},n,e)];case 3:return s=h.sent(),[3,6];case 4:return[4,(0,ee.b)({clinicId:r,customerId:i,practitionerId:t},n,e)];case 5:s=h.sent(),h.label=6;case 6:return o=s,d=(l=(0,_.nD)(o).reduce(function(e,t){return(0,ei.Z)(new Date(t.start),new Date)?e.futureBookings.push(t):e.pastBookings.push(t),e},{futureBookings:[],pastBookings:[]})).futureBookings.map(function(e){return ClientBookingsViewModel(e)}),m=l.pastBookings.map(function(e){return ClientBookingsViewModel(e)}),u(d),c(m),x(""),[3,10];case 7:if(p=h.sent(),(0,j.f1)(p))return D("Patient Appointments auth error","/",!0),[2];if(p instanceof en.nl&&404===p.status)return c([]),u([]),[2];return x("Something went wrong with the appointments data, please refresh the page"),[4,(0,_.oQ)(p,"Patient appointments - getHistory",e)];case 8:return h.sent(),[3,10];case 9:return I(!1),[7];case 10:return[2]}})}),function(e,n){return t.apply(this,arguments)});(0,v.useEffect)(function(){var e,t=new AbortController,n=(e=(0,m._)(function(){var e,n,i;return(0,h.Jh)(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,4,5]),I(!0),n=[r,!0],[4,A.accessToken()];case 1:return[4,et.QU.apply(void 0,n.concat([a.sent(),!0,t]))];case 2:return e=a.sent(),S((0,_.nD)(e).practitioners.map(function(e){return{id:e.id,name:"".concat(e.name).concat(e.isArchived?" ( Archived )":"")}})),[3,5];case 3:return i=a.sent(),(0,j.f1)(i)?D("/forbidden","/",!0):(0,_.M8)(i,"PatientAppointments - GetClinicDetail
1sByIdTyped",t),[3,5];case 4:return I(!1),[7];case 5:return[2]}})}),function(){return e.apply(this,arguments)});return a&&n(),R(t,B),function(){t.abort()}},[]),(0,v.useEffect)(function(){var e=new AbortController;return R(e,B),function(){e.abort()}},[B]);var HandlePractitionerChange=function(e){e.persist(),Z(""===e.target.value?null:e.target.value)};return(0,f.jsx)("div",{className:"column-m-12 patient-appointments",children:(0,f.jsxs)("div",{className:"record__section",children:[(0,f.jsx)("h3",{children:"Appointments"}),g&&(0,f.jsx)("div",{className:"record__section record__section--capped margin-bottom-1",children:(0,f.jsx)(W.Z,{text:g})}),w&&(0,f.jsx)("div",{className:"spinner-wrapper",children:(0,f.jsx)(Q.Z,{})}),!w&&(0,f.jsxs)(f.Fragment,{children:[k.length>0&&(0,f.jsxs)("div",{className:"field",children:[(0,f.jsx)("label",{htmlFor:"practitioner",children:"Select practitioner to view their sessions"}),(0,f.jsx)("div",{className:"field__select",children:(0,f.jsxs)("select",{name:"practitioner",id:"practitioner",onChange:function(e){return HandlePractitionerChange(e)},defaultValue:null!=B?B:void 0,children:[(0,f.jsx)("option",{value:"",children:"All Practitioners"}),k.map(function(e){return(0,f.jsx)("option",{value:e.id,children:e.name},e.id)})]})})]}),B&&(0,f.jsx)(AvailableSessionsSection,{clinicId:r,practitionerId:B,clientId:i}),(0,f.jsx)(sections_AppointmentsSection,{title:"Future Appointments",clientHistory:d,clinicPractitioners:k},"Future"),(0,f.jsx)(sections_AppointmentsSection,{title:"Past Appointments",clientHistory:s,clinicPractitioners:k},"Past")]})]})})},el=n(91101);(c=u||(u={})).Created="Created",c.Processed="Processed",c.Deferred="Deferred",c.Delivered="Delivered",c.Bounced="Bounced",c.Dropped="Dropped";var getEmailStatusClassName=function(e){switch(e){case u.Delivered:return"label__booking--confirmed";case u.Bounced:case u.Deferred:case u.Dropped:return"label--red";case u.Created:case u.Processed:return"label__booking--pending";default:throw Error("The status ".concat(e," doesn't exist"))}},tabs_PatientComms=function(e){var t=e.clinicId,n=e.clientId,i=(0,p._)((0,v.useState)(!0),2),r=i[0],a=i[1],o=(0,p._)((0,v.useState)([]),2),s=o[0],c=o[1],l=(0,p._)((0,v.useState)(""),2),d=l[0],u=l[1],b=(0,v.useContext)(C.ZP).userDetails,g=(0,v.useContext)(N.lM);(0,v.useEffect)(function(){var e;return(e=(0,m._)(function(){var e,i,r;return(0,h.Jh)(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,4,5]),i=[t,n],[4,b.accessToken()];case 1:return[4,el.D.apply(void 0,i.concat([o.sent()]))];case 2:return e=o.sent(),c((0,_.nD)(e).map(function(e){return{id:e.id,to:e.to,subject:e.subject,opened:e.opened,clicked:e.clicked,sentUtc:e.sentUtc,statusClassName:getEmailStatusClassName(e.status),status:e.status}})),[3,5];case 3:return r=o.sent(),(0,j.f1)(r)?g("auth error from patient emails","/",!0):(u("couldn't load emails"),(0,_.M8)(r,"load emails")),[3,5];case 4:return a(!1),[7];case 5:return[2]}})}),function(){return e.apply(this,arguments)})(),function(){}},[]);var EmailLink=function(e){var i=e.emailId,r=e.className;return(0,f.jsx)("div",{className:r,children:(0,f.jsxs)(Y(),{href:"/emails?clinicId=".concat(t,"&patientId=").concat(n,"&emailId=").concat(i),as:"/emails/".concat(t,"/").concat(n,"/").concat(i),shallow:!0,children:[(0,f.jsx)("div",{className:"hide-on-mobile hide-on-tablet",children:(0,f.jsx)("div",{className:"record-appointment__link record-appointment__link--extra-padding round-image shadow__utility",children:(0,f.jsx)("img",{src:"/static/img/icons/chevron-right.svg",alt:"view this booking",width:"16",height:"16"})})}),(0,f.jsx)("div",{className:"hide-on-laptop",style:{marginTop:"0.5rem"},children:(0,f.jsx)("span",{children:"View Email"})})]})})};return(0,f.jsxs)("div",{className:"record__section patient-notes__full",children:[(0,f.jsx)("h3",{className:"border-bottom border-bottom__dashed",children:"Emails"}),r&&(0,f.jsx)("div",{className:"spinner-wrapper",children:(0,f.jsx)(Q.Z,{})}),!r&&0===s.length&&(0,f.jsxs)("div",{className:"",children:[(0,f.jsx)("h3",{children:"Patient emails"}),(0,f.jsx)("p",{children:"No emails have been sent to this patient"})]}),!r&&s.length>0&&(0,f.jsx)("div",{className:"record__treatments record__treatments--full ".concat(s.length>1?"padding-right-1":"").trim(),children:s.map(function(e){return(0,f.jsxs)("div",{className:"record__row row row--no-margin record__row--bottom row--middle padding-right-1 padding-right__t-0",children:[(0,f.jsx)("div",{className:"column-d-3 column-m-12 column-d-order-2 hide-on-tablet hide-on-mobile",children:(0,f.jsx)("div",{style:{display:"block",textAlign:"center",width:"100%"},children:(0,f.jsx)("small",{className:"label label--small uppercase label--small-font ".concat(e.statusClassName),children:e.status})})}),(0,f.jsxs)("div",{className:"row row--no-margin column-d-8 column-m-12 column-d-order-1",children:[(0,f.jsx)("div",{className:"column-d-5 column-m-8 column-d-order-1",style:{marginTop:"0.5rem"},children:(0,f.jsx)("small",{className:"bold",children:(0,T.Z)(new Date(e.sentUtc),"dd/MM/yyyy HH:mm")}
1)}),(0,f.jsx)("div",{className:"column-m-4 hide-on-laptop",style:{marginTop:"0.5rem",minWidth:"3em"},children:(0,f.jsx)("div",{style:{display:"block",textAlign:"center",width:"100%"},children:(0,f.jsx)("small",{className:"label label--small uppercase label--small-font ".concat(e.statusClassName),children:e.status})})}),(0,f.jsx)("div",{className:"column-d-7 column-m-12 column-d-order-2",style:{marginTop:"0.5rem"},children:(0,f.jsx)("span",{style:{overflowWrap:"break-word"},children:e.to})}),(0,f.jsx)("div",{className:"column-d-7 column-m-12 column-d-order-4",style:{marginTop:"0.5rem"},children:(0,f.jsx)("span",{children:e.subject})}),(0,f.jsxs)("div",{className:"column-d-5 column-m-12 column-d-order-3",style:{marginTop:"0.5rem"},children:[(0,f.jsxs)("span",{children:["Opened:\xa0",e.opened]}),(0,f.jsxs)("span",{children:["\xa0\xa0Clicked:\xa0",e.clicked]})]})]}),(0,f.jsx)("div",{className:"column-d-1 column-m-12 column-d-order-3",children:(0,f.jsx)(EmailLink,{emailId:e.id,className:""})})]},e.id)})}),!r&&d&&(0,f.jsx)("div",{className:"padding-top-1",children:(0,f.jsx)(W.Z,{text:d})})]})},ed=n(4586),eu=n(37491),em=n(481),ep=n(27878),eh=n(8817),tabs_PatientReminders=function(e){var t,n=e.clinicId,i=e.clientId,r=e.clientName,a=(0,p._)((0,v.useState)(!0),2),o=a[0],s=a[1],c=(0,p._)((0,v.useState)([]),2),l=c[0],d=c[1],u=(0,p._)((0,v.useState)(""),2),b=u[0],g=u[1],x=(0,p._)((0,v.useState)(null),2),y=x[0],w=x[1],I=(0,v.useContext)(C.ZP).userDetails,T=(0,v.useContext)(N.lM);(0,v.useEffect)(function(){var e;return(e=(0,m._)(function(){var e,t,r,a;return(0,h.Jh)(this,function(o){switch(o.label){case 0:return o.trys.push([0,4,5,6]),[4,I.accessToken()];case 1:return e=o.sent(),[4,(0,eu.Q)(i,e)];case 2:return 404===(t=o.sent()).innerResponse.status?g("Patient does not have reminder preferences"):w((0,_.nD)(t).receiveTreatmentReminders),[4,(0,em.gW)(n,i,e)];case 3:return r=o.sent(),d((0,_.nD)(r).treatmentReminders.sort(function(e,t){return e.categoryName!==t.categoryName?e.categoryName<t.categoryName?-1:1:e.treatmentName<t.treatmentName?e.treatmentName<t.treatmentName?-1:1:0}).map(function(e){return{id:e.treatmentTypeId,treatmentName:"".concat(e.categoryName," - ").concat(e.treatmentName),interval:e.reminderInWeeks,nextReminder:e.nextReminderDueDay}})),[3,6];case 4:return a=o.sent(),(0,j.f1)(a)?T("auth error from patient reminders","/",!0):(g("Failed to load patient reminder settings"),ep.A.exception(a)),[3,6];case 5:return s(!1),[7];case 6:return[2]}})}),function(){return e.apply(this,arguments)})(),function(){}},[]);var k=(t=(0,m._)(function(e,t){var r,a,o,s,c,u;return(0,h.Jh)(this,function(m){switch(m.label){case 0:return m.trys.push([0,3,,4]),a=[n,i,e.id,{treatmentTypeId:e.id,intervalInWeeks:t}],[4,I.accessToken()];case 1:return[4,em.cJ.apply(void 0,a.concat([m.sent()]))];case 2:return r=m.sent(),s={id:(o=(0,_.nD)(r)).treatmentTypeId,interval:o.reminderInWeeks,nextReminder:o.nextReminderDueDay,treatmentName:e.treatmentName},c=l.findIndex(function(e){return e.id===s.id}),l.splice(c,1,s),d((0,ed._)(l)),[3,4];case 3:return u=m.sent(),(0,j.f1)(u)?T("auth error from patient reminders","/",!0):(g("Failed to update treatment reminder interval"),ep.A.exception(u)),[3,4];case 4:return[2]}})}),function(e,n){return t.apply(this,arguments)});return(0,f.jsxs)("div",{className:"record__section patient-notes__full",children:[(0,f.jsx)("h3",{className:"border-bottom border-bottom__dashed",children:"Treatment Reminders"}),o&&(0,f.jsx)("div",{className:"spinner-wrapper",children:(0,f.jsx)(Q.Z,{})}),!o&&0===l.length&&(0,f.jsxs)("div",{className:"",children:[(0,f.jsx)("h3",{children:"Patient reminders"}),(0,f.jsx)("p",{children:"No reminders have been configured for this patient"})]}),!o&&l.length>0&&(0,f.jsxs)("div",{className:"record__treatments record__treatments--full",children:[!1===y&&(0,f.jsxs)("div",{className:"record__row",children:[(0,f.jsx)(W.Z,{text:"Warning: ".concat(r," is currently opted out of treatment reminders.")}),(0,f.jsx)("p",{children:"In order to receive reminders patients must opt into reminders, which they can do via their account preferences"})]}),l.map(function(e){return(0,f.jsx)(eh.Z,{reminder:e,updateTreatmentReminderInterval:k},e.id)})]}),!o&&b&&(0,f.jsx)("div",{className:"padding-top-1",children:(0,f.jsx)(W.Z,{text:b})})]})},ef=n(79892),eb=n(61251),ev=n(86275),renderLoginIcon=function(e){var t="",n="";switch(e){case S.P.Email:t="/static/img/icons/email.svg",n="This patient has created an online account with Glowday";break;case S.P.Facebook:t="/static/img/icons/facebook.svg",n="This patient has created an online account with Glowday linked to their Facebook account";break;case S.P.Google:t="/static/img/icons/google-g-logo.svg",n="This patient has created an online account with Glowday linked to their Google account";break;default:return null}return(0,f.jsx)(ev.Z,{icon:t,alt:n})},molecules_PatientAccountReadOnly=function(e){var t=e.client;return(0,f.jsx)("div",{className:"patient-summary__item",children:(0,f.jsxs)("div",{className:"row row--no-margin row--middle border record__part border-radius column-m-12",children:[(0,f.jsxs)("div",{className:"row row--no-margin column-m-9",children:[(0,f.jsx)("span",{className:"column-m-12",children:"Has Glowday login?"}),(0,f.jsx)("strong",{className:"column-m-12",children:t.accountType===d.GlowdayPatient?"Yes":"No"})]}),(0,f.jsx)("div",{className:"column-m-3 column--flex row--end",children:renderLoginIcon(t.loginType)})]})})},eg=n(62169),ex=n(98787),sections_InvitationView=function(e){var t,n,i,r,a,o=e.client,s=(0,p._)((0,v.useState)(null),2),c=s[0],l=s[1],d=(0,p._)((0,v.useState)(!0),2),u=d[0],b=d[1],g=(0,p._)((0,v.useState)(null),2),x=g[0],y=g[1],w=(0,v.useRef)(null),I=(0,v.useContext)(C.ZP).userDetails,k=(0,v.useContext)(N.lM),S=(t=(0,m._)(function(){var e,t,n;return(0,h.Jh)(this,function(i){switch(i.label){case 0:b(!0),i.label=1;case 1:return i.trys.push([1,4,5,6]),t=[o.id],[4,I.accessToken()];case 2:return[4,eg.rB.apply(void 0,t.concat([i.sent()]))];case 3:return e=i.sent(),y((0,_.nD)(e)),[3,6];case 4:if(n=i.sent(),(0,j.f1)(n))return k("auth error from getting offline patient invite","/",!0),[2];if(n instanceof en.nl&&404===n.status)return y(null),[2];return l("Couldn't retrieve invitation at this time"),(0,_.M8)(n,"GetInvitation"),[3,6];case 5:return b(!1),[7];case 6:return[2]}})}),function(){return t.apply(this,arguments)}),A=(n=(0,m._)(function(){var e,t,n;return(0,h.Jh)(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=[o.id],[4,I.accessToken()];case 1:return[4,eg.ZB.apply(void 0,t.concat([i.sent()]))];case 2:return e=i.sent(),y((0,_.nD)(e)),[3,4];case 3:return n=i.sent(),(0,j.f1)(n)?k("Auth error from inviting offline patient","/",!0):(0,_.M8)(n,"SendInviteToClaimAccount"),[3,4];case 4:return[2]}})}),function(){return n.apply(this,arguments)}),P=(i=(0,m._)(function(){return(0,h.Jh)(this,function(e){var t,n;switch(e.label){case 0:if(!(o.email&&o.mobile))return[3,2];return l(null),[4,A()];case 1:return e.sent(),[3,3];case 2:l((t=!!o.mobile,n=!!o.email,t&&!n?"Cannot invite patient to the clinic, a valid email is required.":!t&&n?"Cannot invite patient to the clinic, a valid phone number is required.":t||n?"":"Cannot invite patient to the clinic, a valid phone number and a valid email are required.")),e.label=3;case 3:return[2]}})}),function(){return i.apply(this,arguments)}),B=(r=(0,m._)(function(){var e,t,n,i;return(0,h.Jh)(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,4,5]),t=[o.id],[4,I.accessToken()];case 1:return[4,eg._8.apply(void 0,t.concat([r.sent()]))];case 2:return e=r.sent(),n=(0,_.nD)(e),w.current&&(w.current.className="record__part--top"),y(n),[3,5];case 3:return i=r.sent(),(0,j.f1)(i)?k("auth error from getting offline patient invite","/",!0):(l("Couldn't resend the invitation at this time"),(0,_.M8)(i,"ResendInvitation")),[3,5];case 4:return setTimeout(function(){w.current&&(w.current.className="hide-on-mobile hide-on-tablet hide-on-laptop")},3e3),[7];case 5:return[2]}})}),function(){return r.apply(this,arguments)}),Z=(a=(0,m._)(function(){var e,t,n;return(0,h.Jh)(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=[o.id],[4,I.accessToken()];case 1:return[4,eg.cH.apply(void 0,t.concat([i.sent()]))];case 2:return e=i.sent(),y((0,_.nD)(e)),[3,4];case 3:return n=i.sent(),(0,j.f1)(n)?k("auth error from getting offline patient invite","/",!0):(l("Couldn't resend the invitation at this time"),(0,_.M8)(n,"RevokeInvitation")),[3,4];case 4:return[2]}})}),function(){return a.apply(this,arguments)});return(0,v.useEffect)(function(){S()},[]),(0,f.jsxs)("div",{className:"patient-summary__item",children:[!(null==x?void 0:x.invite)&&(0,f.jsxs)("div",{className:"row row--no-margin row--middle border record__part border-radius column-m-12",children:[(0,f.jsxs)("div",{className:"column-m-12 row--middle column--flex column--gap",children:[(0,f.jsx)("span",{children:"Has Glowday login?"}),(0,f.jsx)(eb.Z,{label:"Glowday logins",text:"Patients with Glowday accounts are able to confirm, view and manage their appointments, and sign their forms ahead of their appointment"})]}),(0,f.jsx)("strong",{className:"column-m-12",children:"No"}),u&&(0,f.jsx)("div",{className:"spinner-wrapper",children:(0,f.jsx)(Q.Z,{})}),c&&(0,f.jsx)("div",{className:"column-m-12 record__part--top","data-testid":"error",children:(0,f.jsx)(W.Z,{text:c})}),!u&&(0,f.jsx)("div",{className:"column-m-12 column-t-2 record__part--top",children:(0,f.jsx)(U.Z,{text:"Invite",className:"button--flat button--green button--small button--fullwidth",testId:"invite-button",onClick:P})})]}),x&&x.invite&&(0,f.jsxs)("div",{className:"row row--no-margin row--middle border record__part border-radius column-m-12","data-testid":"inv
1itation-sent",children:[(0,f.jsxs)("div",{className:"column-m-12 row row--no-margin",children:["Invited"===x.invite.status&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"column-m-12 record__part--bottom border-bottom",children:[(0,f.jsx)("span",{children:"Invitation sent on:"})," ",(0,f.jsx)("br",{}),(0,f.jsx)("strong",{children:(0,T.Z)(new Date(x.invite.lastSentUtc),"dd/MM HH:mm")})]}),(0,f.jsxs)("div",{className:"column-m-12 record__part--bottom record__part--top border-bottom",children:[(0,f.jsx)("span",{children:"Expires on:"})," ",(0,f.jsx)("br",{}),(0,f.jsx)("strong",{children:(0,T.Z)(new Date(x.invite.tokenExpiryUtc),"dd/MM HH:mm")})]})]}),"Revoked"===x.invite.status&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("div",{className:"column-m-12 record__part--bottom border-bottom",children:[(0,f.jsx)("span",{children:"Invitation revoked on:"})," ",(0,f.jsx)("br",{}),(0,f.jsx)("strong",{children:(0,T.Z)(new Date(x.invite.lastSentUtc),"dd/MM HH:mm")})]}),(0,f.jsx)("div",{className:"column-m-12 record__part--bottom record__part--top border-bottom",children:(0,f.jsx)(ex.Z,{className:"label--red",text:"Revoked"})})]}),(0,f.jsx)("div",{ref:w,className:"hide-on-mobile hide-on-tablet hide-on-laptop",children:(0,f.jsx)(ex.Z,{className:"label--green",text:"Invitation resent"})})]}),c&&(0,f.jsx)("div",{className:"column-m-12 record__part--top record__part--bottom border-top",children:(0,f.jsx)(W.Z,{text:c})}),(0,f.jsxs)("div",{className:"column-m-12 record__part--top row row--no-margin row--nowrap column--gap ",children:[(0,f.jsx)("div",{className:"column-m-12 column-t-6",children:(0,f.jsx)(U.Z,{text:"Resend",className:"button--flat button--green button--small button--fullwidth",onClick:B})}),"Invited"===x.invite.status&&(0,f.jsx)("div",{className:"column-m-12 column-t-6",children:(0,f.jsx)(U.Z,{text:"Cancel",className:"button--flat button--rose button--small button--fullwidth",onClick:Z})})]})]})]})},e_=n(14932),sections_PatientDetails=function(e){var t,n,i,r,a,o,s,c=e.clinicId,l=e.client,d=e.setClient,u=e.closeEdit,b=(0,p._)((0,v.useState)(""),2),g=b[0],x=b[1],y=new Date,w=(0,v.useContext)(C.ZP).userDetails,T=(0,v.useContext)(N.lM),k={dob:l.dob?new Date(l.dob):null,firstLine:(null===(i=l.address)||void 0===i?void 0:i.firstLine)||"",secondLine:(null===(r=l.address)||void 0===r?void 0:r.secondLine)||"",postCode:(null===(a=l.address)||void 0===a?void 0:a.postcode)||"",city:(null===(o=l.address)||void 0===o?void 0:o.city)||"",county:(null===(s=l.address)||void 0===s?void 0:s.county)||"",notes:l.notes||""},S=(t=(0,m._)(function(e,t){var n,i,r,a,o;return(0,h.Jh)(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,4,5]),t(!0),n={dateOfBirth:e.dob?new Date(e.dob).toISOString():null,notes:e.notes,address:{firstLine:e.firstLine,secondLine:e.secondLine,city:e.city,postcode:e.postCode,county:e.county}},r=[c,l.id],[4,w.accessToken()];case 1:return[4,O.apply(void 0,r.concat([s.sent(),n]))];case 2:return i=s.sent(),a=(0,_.nD)(i),d((0,e_._)((0,I._)({},l),{address:getAddress(a.address),notes:a.notes,dob:a.dateOfBirth})),u(!1),[3,5];case 3:if(o=s.sent(),(0,j.f1)(o))return T("/forbidden","/",!0),[2];if(o instanceof en.nl&&400===o.status)return x("Please check all the fields are filled in correctly"),[2];return x("Something went wrong, please try again"),(0,_.M8)(o,"UpdateClinicClientDetails"),[3,5];case 4:return t(!1),[7];case 5:return[2]}})}),function(e,n){return t.apply(this,arguments)});return(0,f.jsx)(A.J9,{initialValues:k,enableReinitialize:!0,validationSchema:Z.Ry({dob:Z.Z_().nullable(),firstLine:Z.Z_(),secondLine:Z.Z_().nullable(),postCode:Z.Z_().min(5,"Should be a valid UK postcode").max(10,"Should be a valid UK postcode").nullable(),city:Z.Z_(),county:Z.Z_().nullable(),notes:Z.Z_().max(1024)}),onSubmit:(n=(0,m._)(function(e,t){return(0,h.Jh)(this,function(n){switch(n.label){case 0:return[4,S(e,t.setSubmitting)];case 1:return n.sent(),[2]}})}),function(e,t){return n.apply(this,arguments)}),children:function(e){var t=e.errors,n=e.touched,i=e.isSubmitting,r=e.setFieldValue,a=e.values;return(0,f.jsxs)(A.l0,{className:"patient-summary__item column-m-12",onCh
1ange:function(){return x("")},children:[(0,f.jsx)("div",{className:"patient-summary__item border-bottom column-m-12",children:(0,f.jsxs)("div",{className:"field ".concat(t.dob&&n.dob?"field--error":""," field--no-margin column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"dob",children:"Date of Birth"}),(0,f.jsx)(molecules_YearAndMonthDatePicker,{dateForPicker:y,setFieldValue:r,fieldName:"dob"}),(0,f.jsx)(A.Bc,{name:"dob",component:"div"})]})}),(0,f.jsxs)("div",{className:"patient-summary__item border-bottom",children:[(0,f.jsxs)("div",{className:"field ".concat(t.firstLine&&n.firstLine?"field--error":""," column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"firstLine",children:"Address"}),(0,f.jsx)(A.gN,{type:"text",name:"firstLine",id:"firstLine",placeholder:"First address line"}),(0,f.jsx)(A.Bc,{name:"firstLine",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.secondLine&&n.secondLine?"field--error":""," column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"secondLine",className:"sr-only",children:"Second Address Line"}),(0,f.jsx)(A.gN,{type:"text",name:"secondLine",id:"secondLine",placeholder:"Second address line"}),(0,f.jsx)(A.Bc,{name:"secondLine",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.city&&n.city?"field--error":""," column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"city",className:"sr-only",children:"City/Town"}),(0,f.jsx)(A.gN,{type:"text",name:"city",id:"city",placeholder:"City or Town"}),(0,f.jsx)(A.Bc,{name:"city",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.county&&n.county?"field--error":""," column-m-12"),children:[(0,f.jsx)("label",{htmlFor:"county",className:"sr-only",children:"County"}),(0,f.jsx)(A.gN,{type:"text",name:"county",id:"county",placeholder:"County"}),(0,f.jsx)(A.Bc,{name:"county",component:"div"})]}),(0,f.jsxs)("div",{className:"field ".concat(t.postCode&&n.postCode?"field--error":""," column-m-12 column-t-6 field--no-margin"),children:[(0,f.jsx)("label",{htmlFor:"postCode",className:"sr-only",children:"Postcode"}),(0,f.jsx)(A.gN,{type:"text",name:"postCode",id:"postCode",maxLength:10,minLength:5,placeholder:"Postcode"}),(0,f.jsx)(A.Bc,{name:"postCode",component:"div"})]})]}),(0,f.jsx)("div",{className:"patient-summary__item border-bottom column-m-12",children:(0,f.jsxs)("div",{className:"field ".concat(t.notes&&n.notes?"field--error":""," column-m-12 field--no-margin"),children:[(0,f.jsx)("label",{htmlFor:"notes",children:"Notes"}),(0,f.jsx)("textarea",{name:"notes",id:"notes",placeholder:"Notes",className:"client-notes__field",onChange:function(e){return r("notes",e.target.value)},maxLength:1024,defaultValue:a.notes}),(0,f.jsx)("div",{className:"margin-top-1",children:(0,f.jsxs)("span",{className:"label ".concat(a.notes.length<1e3?"label--green":"label--red"),children:[a.notes.length,"/1024"]})}),(0,f.jsx)(A.Bc,{name:"notes",component:"div"})]})}),g&&(0,f.jsx)("div",{className:"padding-top-1 padding-bottom-1 column-m-12",children:(0,f.jsx)(W.Z,{text:g})}),(0,f.jsx)("div",{className:"padding-top-1 border-top padding-bottom-1 border-bottom column-m-12",children:(0,f.jsx)(U.Z,{disabled:i,text:"".concat(i?"Updating...":"Update"),className:"button--flat button--green",type:"submit"})})]})}})},sections_PatientDetailsReadOnly=function(e){var t=e.client,n=t.notes,i=t.address,r=t.dob;return(0,f.jsxs)("div",{className:"padding-top-1",children:[(0,f.jsx)("h4",{children:"Additional information"}),!r&&!i&&!n&&(0,f.jsx)("p",{children:"You can add additional details about the client."}),r&&(0,f.jsxs)("dl",{className:"patient-summary__item border-bottom",children:[(0,f.jsx)("dt",{className:"column-m-12 column-t-3",children:"Date of Birth"}),(0,f.jsx)("dd",{className:"column-m-12 column-t-9",children:(0,f.jsx)("strong",{children:(0,T.Z)(new Date(r),"do MMMM yyyy")})})]}),i&&(0,f.jsxs)("dl",{className:"patient-summary__item border-bottom",children:[(0,f.jsx)("dt",{className:"column-m-12 column-t-3",children:"Address"}),(0,f.jsx)("dd",{className:"column-m-12 column-t-9",children:(0,f.jsxs)("ul",{className:"unstyled",children:[(0,f.jsx)("li",{children:(0,f.jsx)("strong",{children:i.firstLine})}),(0,f.jsx)("li",{children:(0,f.jsx)("strong",{children:i.secondLine})}),(0,f.jsx)("li",{children:(0,f.jsx)("strong",{children:i.city})}),(0,f.jsx)("li",{children:(0,f.jsx)("strong",{children:i.county})}),(0,f.jsx)("li",{children:(0,f.jsx)("strong",{children:i.postcode})})]})})]}),n&&(0,f.jsxs)("dl",{className:"patient-summary__item",children:[(0,f.jsx)("dt",{className:"column-m-12 column-t-3",children:"Notes"}),(0,f.jsx)("dd",{className:"column-m-12 column-t-9 patient-summary__text",children:(0,f.jsx)("p",{children:n})})]})]})},tabs_PatientSummary=function(e){var t,n=e.client,i=e.routeObject,r=e.clinicId,a=e.setClient,o=(0,b.useRouter)(),s=(0,p._)((0,v.useState)(!1),2),c=s[0],u=s[1],g=(0,p._)((0,v.useState)(!1),2),x=g[0],y=g[1],w=(0,v.useContext)(C.ZP).userDetails,I=(0,v.useContext)(N.lM),T=(t=(0,m._)(function(e){var t,i,o;return(0,h.Jh)(this,function(s){switch(s.label){case 0:t=null,s.label=1;case 1:return s.trys.push([1,7,8,9]),[4,w.accessToken()];case 2:if(i=s.sent(),y(!0),!e)return[3,4];
1return[4,J(r,n.id,i)];case 3:return t=s.sent(),[3,6];case 4:return[4,E(r,n.id,i)];case 5:t=s.sent(),s.label=6;case 6:return a(toClientViewModel((0,_.nD)(t))),[3,9];case 7:if(o=s.sent(),(0,j.f1)(o))return I("forbidden","/",!0),[2];return(0,_.M8)(o,"handleTogglePatientVisible"),[3,9];case 8:return y(!1),[7];case 9:return[2]}})}),function(e){return t.apply(this,arguments)});return(0,f.jsxs)("div",{className:"record__section patient-summary",children:[(0,f.jsxs)("div",{className:"row row--no-margin row--middle padding-bottom-1",children:[(0,f.jsx)("div",{className:"column-m-9 column-t-10 padding-right-1",children:(0,f.jsx)("h3",{className:"small margin-bottom-0",children:n.inactive?"".concat(n.name," (inactive)"):n.name})}),(0,f.jsx)("div",{className:"column-m-3 column-t-2",children:(0,f.jsx)(U.Z,{className:"button--outline button--small button--fullwidth",text:"".concat(c?"close":"edit"),onClick:function(){if(n.accountType===d.ClinicPatient){o.push("".concat(i.href,"&patientId=").concat(n.id,"&patientTab=").concat(l.Edit),"".concat(i.as,"/patient/").concat(n.id,"?patientTab=").concat(l.Edit),{shallow:!0});return}u(!c)}})})]}),(0,f.jsxs)("div",{className:"row row--no-margin border-top-bottom row--middle",children:[(0,f.jsx)(ef.Z,{id:"patientActive",title:"Patient Active",value:"",checked:!n.inactive,disabled:x,onChange:function(e){T(e.target.checked)},textClassName:"checkbox__text--small"}),(0,f.jsx)(eb.Z,{label:"Patient Active",text:"Inactive patients are no-longer automatically found in your client search, but has no impact on the patient's own Glowday account"})]}),(0,f.jsxs)("dl",{className:"patient-summary__item border-bottom",children:[(0,f.jsx)("dt",{className:"column-m-12",children:"Email"}),(0,f.jsx)("dd",{className:"column-m-12",children:(0,f.jsx)("a",{href:"mailto:".concat(n.email),className:"patient-record__link",children:n.email})})]}),(0,f.jsxs)("dl",{className:"patient-summary__item border-bottom",children:[(0,f.jsx)("dt",{className:"column-m-12",children:"Phone"}),(0,f.jsx)("dd",{className:"column-m-12",children:(0,f.jsx)("a",{href:"tel:".concat(n.mobile),className:"patient-summary__link",children:n.mobile})})]}),n.accountType===d.GlowdayPatient&&(0,f.jsx)(molecules_PatientAccountReadOnly,{client:n})||(0,f.jsx)(sections_InvitationView,{client:n}),c&&n.accountType===d.GlowdayPatient&&(0,f.jsx)(sections_PatientDetails,{clinicId:r,client:n,setClient:a,closeEdit:u})||(0,f.jsx)(sections_PatientDetailsReadOnly,{client:n})]})},patient_management_tab_PatientManagementCard=function(e){var t=e.clientId,n=e.practitionerId,i=e.onCloseWidget,r=e.clinicId,a=e.closingRouteObj,o=e.routeObj,s=(0,p._)((0,v.useState)(null),2),c=s[0],d=s[1],u=(0,v.useContext)(C.ZP),I=u.userDetails,T=u.userDetails.glowdayUser,k=(0,v.useContext)(N.lM),S=(0,b.useRouter)();return(0,v.useEffect)(function(){var e,n=new AbortController;return(e=(0,m._)(function(){var e,i,a;return(0,h.Jh)(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),i=[r,t],[4,I.accessToken()];case 1:return[4,g.WG.apply(void 0,i.concat([o.sent(),n]))];case 2:return e=o.sent(),d(toClientViewModel((0,_.nD)(e))),[3,4];case 3:return a=o.sent(),(0,j.f1)(a)?k("forbidden","/",!0):(0,_.M8)(a,"fetchClient from PMC",n),[3,4];case 4:return[2]}})}),function(){return e.apply(this,arguments)})(),function(){n.abort()}},[]),(0,f.jsxs)(w.default,{className:"modal--treatment",closeModal:i,isOpen:!0,showCloseButton:!1,modalInsideClassName:"widget patient-management-card",children:[a&&o&&c&&(0,f.jsx)(sections_PatientHeader,{closeModal:i,closingRouteObject:a,routeObject:o,patientType:c.accountType,patientId:c.id}),c&&(0,f.jsx)("section",{className:"record record--negative record--capped-full",children:(0,f.jsx)("div",{className:"row",children:(0,f.jsx)("div",{className:"column-m-12",children:function(e){var i,o=null!==(i=(0,x.ZP)(S.query.patientTab))&&void 0!==i?i:"";if(!o)return(0,f.jsx)(tabs_PatientSummary,{client:e,clinicId:r,routeObject:a,setClient:d});if(validatePatientCardNavigation(o,e))switch(o){case l.Appointments:return(0,f.jsx)(tabs_PatientAppointments,{practitionerId:n,clientId:t,clinicId:r,hasAccessToAllBookings:(null==T?void 0:T.userRole.includes(y.x.admin))||(null==T?void 0:T.userRole.includes(y.x.frontOfHouse))||
1!1});case l.Edit:return(0,f.jsx)(sections_OfflinePatientEdit,{practitionerId:n,client:e,setClient:d,closingRouteObj:a});case l.Notes:return(0,f.jsx)(tabs_NotesWrapper,{clinicId:r,clientId:t});case l.Comms:return(0,f.jsx)(tabs_PatientComms,{clinicId:r,clientId:t});case l.Reminders:return(0,f.jsx)(tabs_PatientReminders,{clinicId:r,clientId:t,clientName:e.name});default:return null}else S.push("".concat(a.href,"&patientId=").concat(e.id),"".concat(a.as,"/patient/").concat(e.id),{shallow:!0})}(c)})})})]})}},10138:function(e,t,n){n.d(t,{$J:function(){return ToTreatmentCoursesViewModel},FF:function(){return TreatmentRecordToTreatmentCoursesViewModel},Up:function(){return ToTreatmentsViewModel},_D:function(){return SessionsToTreatmentCourseViewModel},rj:function(){return ToTreatmentsRecordViewModel}});var i=n(91795);n(10564);var ToTreatmentsViewModel=function(e,t){return{treatmentCourseId:t.treatmentCourseId,sessionId:e.id,treatmentOrderId:e.orderId,practitionerTreatmentId:t.practitionerTreatmentId,treatmentTypeId:t.treatmentTypeId,category:t.categoryName,name:t.name,numberOfSessions:t.numberOfSessions,completedSessions:t.completedSessions,sessionNumber:t.completedSessions+1}},ToTreatmentsRecordViewModel=function(e,t){var n=e.sessions.find(function(e){return e.bookingId===t});if(!n)throw Error("Treatment course ".concat(e.treatmentCourseId," was set as selected for booking ").concat(t,", but no allocated session found"));return{treatmentCourseId:e.treatmentCourseId,sessionId:n.id,treatmentOrderId:n.orderId,practitionerTreatmentId:e.practitionerTreatmentId,treatmentTypeId:e.treatmentTypeId,category:e.categoryName,name:e.name,numberOfSessions:e.numberOfSessions,completedSessions:e.completedSessions,sessionNumber:e.completedSessions+1}},ToTreatmentCoursesViewModel=function(e,t){var n=t.map(function(e){return e.practitionerTreatments.map(function(t){return{globalId:t.id,treatmentId:t.practitionerTreatmentId,name:t.name,category:e.categoryName,price:t.price,sessions:t.sessions,treatmentTypeId:t.id,removed:!1}})}).flat(),r=[];return e.forEach(function(e){var t=r.find(function(t){return t.orderId===e.orderId&&t.practitionerTreatmentId===e.practitionerTreatmentId});if(t)t.numberOfSessions+=1,e.status===i.$.CREATED&&(t.availableSessions+=1),e.status===i.$.COMPLETED&&(t.completedSessions+=1),t.sessions.push({id:e.id,clientId:e.patientId,practitionerId:e.practitionerId,clinicId:e.clinicId,bookingId:null!==(a=e.bookingId)&&void 0!==a?a:"",status:e.status,orderId:e.orderId});else{var a,o,s=n.find(function(t){return t.treatmentId===e.practitionerTreatmentId});if(!s)throw Error("Practitioner treatment ".concat(e.practitionerTreatmentId," not found"));r.push({treatmentCourseId:e.treatmentCourseId,treatmentTypeId:e.treatmentTypeId,name:s.name,categoryName:s.category,selected:!1,practitionerTreatmentId:s.treatmentId,numberOfSessions:1,availableSessions:e.status===i.$.CREATED?1:0,completedSessions:e.status===i.$.COMPLETED?1:0,orderId:e.orderId,sessions:[{id:e.id,clientId:e.patientId,practitionerId:e.practitionerId,clinicId:e.clinicId,bookingId:null!==(o=e.bookingId)&&void 0!==o?o:"",status:e.status,orderId:e.orderId}]})}}),r},TreatmentRecordToTreatmentCoursesViewModel=function(e){var t=[];return e.treatmentSessions.forEach(function(n){var r=t.find(function(e){return e.orderId===n.treatmentOrderId&&e.practitionerTreatmentId===n.practitionerTreatmentId});r?(r.treatmentCourseId=n.treatmentCourseId,r.numberOfSessions=n.numberOfSessions,r.completedSessions=n.completedSessions,r.sessions.push({id:n.sessionId,clientId:e.customerId,practitionerId:e.practitionerId,clinicId:e.clinicId,bookingId:e.bookingId,status:i.$.COMPLETED,orderId:n.treatmentOrderId})):t.push({treatmentCourseId:n.treatmentCourseId,treatmentTypeId:n.treatmentTypeId,name:n.name,categoryName:n.category,selected:!0,practitionerTreatmentId:n.practitionerTreatmentId,numberOfSessions:n.numberOfSessions,availableSessions:n.numberOfSessions-n.completedSessions,completedSessions:n.completedSessions,orderId:n.treatmentOrderId,sessions:[{id:n.sessionId,clientId:e.customerId,practitionerId:e.practitionerId,clinicId:e.clinicId,bookingId:e.bookingId,status:i.$.COMPLETED,orderId:n.treatmentOrderId}]})}),t},SessionsToTreatmentCourseViewModel=function(e,t,n){var i=ToTreatmentCoursesViewModel(e,t);
1return i.forEach(function(e){e.sessions.find(function(e){return e.bookingId===n})&&(e.selected=!0)}),i.filter(function(e){return e.selected||e.availableSessions>0})}},8817:function(e,t,n){var i=n(85893),r=n(12205),a=n(31117);t.Z=function(e){var t,n=e.reminder,o=e.updateTreatmentReminderInterval,s=function(){var e=[];e.push((0,i.jsx)("option",{value:-1,children:"not set"},-1)),e.push((0,i.jsx)("option",{value:1,children:"1 week"},1));for(var t=2;t<=26;t++)e.push((0,i.jsxs)("option",{value:t,children:[t," weeks"]},t));return e}();return(0,i.jsxs)("div",{className:"record__row row row--no-margin record__row--bottom",children:[(0,i.jsx)("div",{className:"column-m-12",children:(0,i.jsx)("p",{className:"bold",children:n.treatmentName})}),(0,i.jsxs)("div",{className:"column-m-12 column-t-6 margin-bottom-1",children:["Interval:\xa0",(0,i.jsx)(a.Z,{value:null!==(t=n.interval)&&void 0!==t?t:-1,options:s,onChange:function(e){o(n,parseInt(e.currentTarget.value,10))}})]}),(0,i.jsxs)("div",{style:{lineHeight:"1.5"},className:"column-m-12 column-t-6",children:["Next reminder:"," ",n.nextReminder?(0,r.Z)(new Date(n.nextReminder)," do MMMM yyyy"):"n/a"]})]})}},57786:function(e,t,n){n.d(t,{d:function(){return SessionRowViewModel}});var SessionRowViewModel=function(e){return{treatmentTypeId:e.treatmentTypeId,compositeId:"".concat(e.orderId,",").concat(e.practitionerTreatmentId),categoryName:e.categoryName,name:"".concat(e.name," (session ").concat(e.completedSessions+1," of ").concat(e.numberOfSessions,")"),selected:e.selected}}},40863:function(e,t,n){var i=n(91309),r=n(67294);t.ZP=function(){var e=(0,i._)((0,r.useState)("mobile"),2),t=e[0],n=e[1];return(0,r.useEffect)(function(){var e=window.matchMedia("(min-width: ".concat(768,"px)")),t=window.matchMedia("(min-width: ".concat(1024,"px)")),update=function(){var i;return n((i=e.matches,t.matches?"desktop":i?"tablet":"mobile"))};return update(),e.addEventListener("change",update),t.addEventListener("change",update),function(){e.removeEventListener("change",update),t.removeEventListener("change",update)}},[]),{tier:t,isMobile:"mobile"===t,isTablet:"tablet"===t,isDesktop:"desktop"===t}}},67967:function(e,t,n){n.d(t,{N_:function(){return GetClientsBookings},WG:function(){return g},c7:function(){return f},d_:function(){return v},t4:function(){return b}});var i,r,a,o,s=n(11010),c=n(97582),l=n(63144),d=n.n(l),u=n(11752),m=n.n(u),p=n(53509),h=m()().publicRuntimeConfig.bookingBaseUrl,f=(i=(0,s._)(function(e,t){var n;return(0,c.Jh)(this,function(i){switch(i.label){case 0:return[4,d()("".concat(h,"/ExistingClient/").concat(e,"/summary"),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}})];case 1:return n=i.sent(),[2,(0,p.dW)(n)]}})}),function(e,t){return i.apply(this,arguments)}),b=(r=(0,s._)(function(e,t,n,i){var r;return(0,c.Jh)(this,function(a){switch(a.label){case 0:return[4,d()("".concat(h,"/ExistingClient/").concat(e,"/clients/").concat(t,"/summary"),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},signal:null==i?void 0:i.signal})];case 1:return r=a.sent(),[2,(0,p.dW)(r)]}})}),function(e,t,n,i){return r.apply(this,arguments)});(0,s._)(function(e,t){var n;return(0,c.Jh)(this,function(i){switch(i.label){case 0:return[4,d()("".concat(h,"/ExistingClient/").concat(e),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}})];case 1:return n=i.sent(),[2,(0,p.dW)(n)]}})});var GetClientsBookingsFetch=function(e,t,n,i){var r="".concat(h,"/Booking/Client/").concat(e,"?from=").concat(n,"&to=").concat(i);return n&&!i&&(r="".concat(h,"/Booking/Client/").concat(e,"?from=").concat(n)),i&&!n&&(r="".concat(h,"/Booking/Client/").concat(e,"?to=").concat(i)),d()(r,{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}})};function GetClientsBookings(e,t,n,i){return _GetClientsBookings.apply(this,arguments)}function _GetClientsBookings(){return(_GetClientsBookings=(0,s._)(function(e,t,n,i){var r;return(0,c.Jh)(this,function(a){switch(a.label){case 0:return[4,GetClientsBookingsFetch(e,i,t,n)];case 1:return r=a.sent(),[2,(0,p.dW)(r)]}})})).apply(this,arguments)}var v=(a=(0,s._)(function(e,t,n,i){var r;return(0,c.Jh)(this,function(a){switch(a.label){case 0:return[4,d()("".concat(h,"/Client/Clinic/").concat(e,"/ProspectiveClient/").concat(t),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},signal:null==i?void 0:i.signal})];case 1:return r=a.sent(),[2,(0,p.dW)(r)]}})}),function(e,t,n,i){return a.apply(this,arguments)}),g=(o=(0,s._)(function(e,t,n,i){var r;return(0,c.Jh)(this,function(a){switch(a.label){case 0:return[4,d()("".concat(h,"/Client/Clinic/").concat(e,"/Client/").concat(t),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},signal:null==i?void 0:i.signal})];case 1:return r=a.sent(),[2,(0,p.dW)(r)]}})}),function(e,t,n,i){return o.apply(this,arguments)})},51059:function(e,t,n){n.d(t,{b:function(){return u},f:function(){return m}});var i,r,a=n(11010),o=n(97582),s=n(11752),c=n.n(s),l=n(53509),d=c()().publicRuntimeConfig.bookingBaseUrl,u=(i=(0,a._)(function(e,t,n){var i;return(0,o.Jh)(this,function(r){switch(r.label){case 0:return[4,fetch("".concat(d,"/CustomerBookingSearch/GetPractitionerCustomerBookings"),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},signal:n.signal,body:JSON.stringify(e)})];case 1:return i=r.sent(),[2,(0,l.dW)(i)]}})}),function(e,t,n){return i.apply(this,arguments)}),m=(r=(0,a._)(function(e,t,n){var i;return(0,o.Jh)(this,function(r){switch(r.label){case 0:return[4,fetch("".concat(d,"/CustomerBookingSearch/GetClinicCustomerBookings"),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},signal:n.signal,body:JSON.stringify(e)})];case 1:return i=r.sent(),[2,(0,l.dW)(i)]}})}),function(e,t,n){return r.apply(this,arguments)})},55661:function(e,t,n){var i,r;n.d(t,{P:function(){return i}}),(r=i||(i={})).Email="AzureB2C",r.Facebook="Facebook",r.Google="Google"},93353:function(e,t,n){n.d(t,{IF:function(){return GetPractitionerTreatments},MT:function(){return GetPractitionerTreatmentsV2},hk:function(){return m}});var i,r=n(11010),a=n(97582),o=n(63144),s=n.n(o),c=n(11752),l=n.n(c),d=n(53509),u=l()().publicRuntimeConfig.clinicBaseUrl,m=(i=(0,r._)(function(e,t){var n;return(0,a.Jh)(this,function(i){switch(i.label){case 0:return[4,s()("".concat(u,"/practitionerTreatment/savePractitionerTreatments"),{method:"put",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(e)})];case 1:return n=i.sent(),[2,(0,d.dW)(n)]}})}),function(e,t){return i.apply(this,arguments)});function GetPractitionerTreatments(e){return _GetPractitionerTreatments.apply(this,arguments)}function _GetPractitionerTreatments(){return(_GetPractitionerTreatments=(0,r._)(function(e){var t,n,i=arguments;return(0,a.Jh)(this,function(r){switch(r.label){case 0:return t=i.length>1&&void 0!==i[1]&&i[1],[4,s()("".concat(u,"/PractitionerTreatment/GetPractitionerTreatments/").concat(e,"?includeDiscontinued=").concat(t),{method:"get",headers:{"Content-Type":"application/json"}})];case 1:return n=r.sent(),[2,(0,d.dW)(n)]}})})).apply(this,arguments)}function GetPractitionerTreatmentsV2(e){return _GetPractitionerTreatmentsV2.apply(this,arguments)}function _GetPractitionerTreatmentsV2(){return(_GetPractitionerTreatmentsV2=(0,r._)(function(e){var t,n,i,r=arguments;return(0,a.Jh)(this,function(a){switch(a.label){case 0:return t=r.length>1&&void 0!==r[1]&&r[1],n=r.length>2?r[2]:void 0,[4,s()("".concat(u,"/PractitionerTreatment/GetPractitionerTreatmentsV2/").concat(e,"?includeDiscontinued=").concat(t),{method:"get",headers:{"Content-Type":"application/json"},signal:null==n?void 0:n.signal})];case 1:return i=a.sent(),[2,(0,d.dW)(i)]}})})).apply(this,arguments)}},43711:function(e,t,n){n.d(t,{$b:function(){return v},NT:function(){return g},d5:function(){return f},nq:function(){return b}});var i,r,a,o,s=n(11010),c=n(97582),l=n(63144),d=n.n(l),u=n(11752),m=n.n(u),p=n(53509),h=m()().publicRuntimeConfig.clinicBaseUrl,snippetsUrl=function(e){return"".concat(h,"/clinics/").concat(e,"/snippets")},jsonHeaders=function(e){return{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)}},f=(i=(0,s._)(function(e,t){var n;return(0,c.Jh)(this,function(i){switch(i.label){case 0:return[4,d()(snippetsUrl(e),{method:"get",headers:jsonHeaders(t)})];case 1:return n=i.sent(),[2,(0,p.dW)(n)]}})}),function(e,t){return i.apply(this,arguments)}),b=(r=(0,s._)(function(e,t,n){var i;return(0,c.Jh)(this,function(r){switch(r.label){case 0:return[4,d()(snippetsUrl(e),{method:"post",headers:jsonHeaders(n),body:JSON.stringify(t)})];case 1:return i=r.sent(),[2,(0,p.dW)(i)]}})}),function(e,t,n){return r.apply(this,arguments)}),v=(a=(0,s._)(function(e,t,n,i){var r;return(0,c.Jh)(this,function(a){switch(a.label){case 0:return[4,d()("".concat(snippetsUrl(e),"/").concat(t),{method:"put",headers:jsonHeaders(i),body:JSON.stringify(n)})];case 1:return r=a.sent(),[2,(0,p.dW)(r)]}})}),function(e,t,n,i){return a.apply(this,arguments)}),g=(o=(0,s._)(function(e,t,n){var i;return(0,c.Jh)(this,function(r){switch(r.label){case 0:return[4,d()("".concat(snippetsUrl(e),"/").concat(t),{method:"delete",headers:jsonHeaders(n)})];case 1:return i=r.sent(),[2,(0,p.YQ)(i)]}})}),function(e,t,n){return o.apply(this,arguments)})},38570:function(e,t,n){n.d(t,{GP:function(){return y},JE:function(){return C},XT:function(){return j},bF:function(){return GetTypedCustomerAccountType},er:function(){return _},uu:function(){return N}});var i,r,a,o,s,c=n(11010),l=n(72253),d=n(14932),u=n(97582),m=n(63144),p=n.n(m),h=n(11752),f=n.n(h),b=n(53509),v=f()().publicRuntimeConfig,g=v.customerBaseUrl,x=v.customerB2cBaseUrl,_=(i=(0,c._)(function(e,t){var n;return(0,u.Jh)(this,function(i){switch(i.label){case 0:return[4,p()("".concat(g,"/Customer/GetCustomerById?Id=").concat(e),{method:"get",headers:{Authorization:"Bearer ".concat(t)}})];case 1:return n=i.sent(),[2,(0,b.dW)(n)]}})}),function(e,t){return i.apply(this,arguments)}),y=(r=(0,c._)(function(e,t,n,i){var r;return(0,u.Jh)(this,function(a){switch(a.label){case 0:return[4,p()("".concat(x,"/RegisterAsCustomer"),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)},body:JSON.stringify({userId:e,phoneNumber:t,email:n})})];case 1:return r=a.sent(),[2,(0,b.dW)(r)]}})}),function(e,t,n,i){return r.apply(this,arguments)});function GetTypedCustomerAccountType(e){return _GetTypedCustomerAccountType.apply(this,arguments)}function _GetTypedCustomerAccountType(){return(_GetTypedCustomerAccountType=(0,c._)(function(e){var t,n;return(0,u.Jh)(this,function(i){switch(i.label){case 0:return[4,p()("".concat(g,"/Customer/GetCustomerAccountType?customerId=").concat(e),{method:"get"})];case 1:return t=i.sent(),[4,(0,b.dW)(t)];case 2:return n=i.sent(),[2,(0,d._)((0,l._)({},n),{body:n.body?n.body:null})]}})})).apply(this,arguments)}var j=(a=(0,c._)(function(e,t,n){var i;return(0,u.Jh)(this,function(r){switch(r.label){case 0:return[4,p()("".concat(g,"/Customer/clinic/").concat(t,"/CreateClinicCustomer"),{method:"put",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify(e)})];case 1:return i=r.sent(),[2,(0,b.dW)(i)]}})}),function(e,t,n){return a.apply(this,arguments)}),N=(o=(0,c._)(function(e,t,n){var i;return(0,u.Jh)(this,function(r){switch(r.label){case 0:return[4,p()("".concat(g,"/Customer/UpdateCustomer/").concat(t),{method:"put",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify(e)})];case 1:return i=r.sent(),[2,(0,b.dW)(i)]}})}),function(e,t,n){return o.apply(this,arguments)}),C=(s=(0,c._)(function(e,t,n){var i;return(0,u.Jh)(this,function(r){switch(r.label){case 0:return[4,p()("".concat(g,"/Customer/UpdateCustomerMobile/").concat(t),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify(e)})];case 1:return i=r.sent(),[2,(0,b.dW)(i)]}})}),function(e,t,n){return s.apply(this,arguments)})},62169:function(e,t,n){n.d(t,{Bz:function(){return N},Sv:function(){return C},ZB:function(){return g},_8:function(){return _},cH:function(){return y},rB:function(){return x},vf:function(){return j}});var i,r,a,o,s,c,l,d=n(11010),u=n(97582),m=n(63144),p=n.n(m),h=n(11752),f=n.n(h),b=n(53509),v=f()().publicRuntimeConfig.customerBaseUrl,g=(i=(0,d._)(function(e,t){var n;return(0,u.Jh)(this,function(i){switch(i.label){case 0:return[4,p()("".concat(v,"/OfflineCustomer/Invite/").concat(e),{method:"post",headers:{Authorization:"Bearer ".concat(t)}})];case 1:return n=i.sent(),[2,(0,b.dW)(n)]}})}),function(e,t){return i.apply(this,arguments)}),x=(r=(0,d._)(function(e,t){var n;return(0,u.Jh)(this,function(i){switch(i.label){case 0:return[4,p()("".concat(v,"/OfflineCustomer/Invite/").concat(e),{method:"get",headers:{Authorization:"Bearer ".concat(t)}})];case 1:return n=i.sent(),[2,(0,b.dW)(n)]}})}),function(e,t){return r.apply(this,arguments)}),_=(a=(0,d._)(function(e,t){var n;return(0,u.Jh)(this,function(i){switch(i.label){case 0:return[4,p()("".concat(v,"/OfflineCustomer/ResendInvite/").concat(e),{method:"post",headers:{Authorization:"Bearer ".concat(t)}})];case 1:return n=i.sent(),[2,(0,b.dW)(n)]}})}),function(e,t){return a.apply(this,arguments)}),y=(o=(0,d._)(function(e,t){var n;return(0,u.Jh)(this,function(i){switch(i.label){case 0:return[4,p()("".concat(v,"/OfflineCustomer/RevokeInvite/").concat(e),{method:"post",headers:{Authorization:"Bearer ".concat(t)}})];case 1:return n=i.sent(),[2,(0,b.dW)(n)]}})}),function(e,t){return o.apply(this,arguments)}),j=(s=(0,d._)(function(e){var t;return(0,u.Jh)(this,function(n){switch(n.label){case 0:return[4,p()("".concat(v,"/OfflineCustomer/getbytoken/").concat(e),{method:"get"})];case 1:return t=n.sent(),[2,(0,b.dW)(t)]}})}),function(e){return s.apply(this,arguments)}),N=(c=(0,d._)(function(e,t){var n;return(0,u.Jh)(this,function(i){switch(i.label){case 0:return[4,p()("".concat(v,"/OfflineCustomer/SendSmsVerificationCode/").concat(e),{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return n=i.sent(),[2,(0,b.YQ)(n)]}})}),function(e,t){return c.apply(this,arguments)}),C=(l=(0,d._)(function(e,t){var n;return(0,u.Jh)(this,function(i){switch(i.label){case 0:return[4,p()("".concat(v,"/OfflineCustomer/ValidateSmsVerificationCode/").concat(e),{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})];case 1:return n=i.sent(),[2,(0,b.YQ)(n)]}})}),function(e,t){return l.apply(this,arguments)})},62287:function(e,t,n){var i,r;n.d(t,{u:function(){return i}}),(r=i||(i={})).AzureB2C="AzureB2C",r.Facebook="Facebook",r.Google="Google"},91101:function(e,t,n){n.d(t,{D:function(){return u},X:function(){return m}});var i,r,a=n(11010),o=n(97582),s=n(11752),c=n.n(s),l=n(53509),d=c()().publicRuntimeConfig.emailBaseUrl,u=(i=(0,a._)(function(e,t,n){var i;return(0,o.Jh)(this,function(r){switch(r.label){case 0:return[4,fetch("".concat(d,"/PatientEmails/clinics/").concat(e,"/patients/").concat(t),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)}})];case 1:return i=r.sent(),[2,(0,l.dW)(i)]}})}),function(e,t,n){return i.apply(this,arguments)}),m=(r=(0,a._)(function(e,t,n,i,r){var a;return(0,o.Jh)(this,function(o){switch(o.label){case 0:return[4,fetch("".concat(d,"/PatientEmails/clinics/").concat(e,"/patients/").concat(t,"/").concat(n),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)},signal:r})];case 1:return a=o.sent(),[2,(0,l.dW)(a)]}})}),function(e,t,n,i,a){return r.apply(this,arguments)})},37491:function(e,t,n){n.d(t,{Q:function(){return p},_:function(){return h}});var i,r,a=n(11010),o=n(97582),s=n(63144),c=n.n(s),l=n(11752),d=n.n(l),u=n(53509),m=d()().publicRuntimeConfig.treatmentBaseUrl,p=(i=(0,a._)(function(e,t){var n;return(0,o.Jh)(this,function(i){switch(i.label){case 0:return[4,c()("".concat(m,"/CustomerPreferences/").concat(e),{method:"get",headers:{Authorization:"Bearer ".concat(t)}})];case 1:return n=i.sent(),[2,(0,u.dW)(n)]}})}),function(e,t){return i.apply(this,arguments)}),h=(r=(0,a._)(function(e,t,n){var i;return(0,o.Jh)(this,function(r){switch(r.label)
1{case 0:return[4,c()("".concat(m,"/CustomerPreferences/").concat(e),{method:"put",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify(n)})];case 1:return i=r.sent(),[2,(0,u.YQ)(i)]}})}),function(e,t,n){return r.apply(this,arguments)})},481:function(e,t,n){n.d(t,{TH:function(){return p},cJ:function(){return h},gW:function(){return m}});var i,r,a,o=n(11010),s=n(97582),c=n(11752),l=n.n(c),d=n(53509),u=l()().publicRuntimeConfig.treatmentBaseUrl,m=(i=(0,o._)(function(e,t,n){var i;return(0,s.Jh)(this,function(r){switch(r.label){case 0:return[4,fetch("".concat(u,"/PatientTreatmentReminders/clinic/").concat(e,"/patient/").concat(t),{method:"get",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}})];case 1:return i=r.sent(),[2,(0,d.dW)(i)]}})}),function(e,t,n){return i.apply(this,arguments)}),p=(r=(0,o._)(function(e,t,n,i){var r;return(0,s.Jh)(this,function(a){switch(a.label){case 0:return[4,fetch("".concat(u,"/PatientTreatmentReminders/clinic/").concat(e,"/patient/").concat(t),{method:"post",headers:{Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(n)})];case 1:return r=a.sent(),[2,(0,d.dW)(r)]}})}),function(e,t,n,i){return r.apply(this,arguments)}),h=(a=(0,o._)(function(e,t,n,i,r){var a;return(0,s.Jh)(this,function(o){switch(o.label){case 0:return[4,fetch("".concat(u,"/PatientTreatmentReminders/clinic/").concat(e,"/patient/").concat(t,"/treatment/").concat(n),{method:"put",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify(i)})];case 1:return a=o.sent(),[2,(0,d.dW)(a)]}})}),function(e,t,n,i,r){return a.apply(this,arguments)})},19987:function(e,t,n){n.d(t,{Cw:function(){return GetAvailableClientTreatmentSessionsForClinicPractitioner},RK:function(){return GetAvailableClientTreatmentSessions},nb:function(){return AllocateBookingSession},ox:function(){return DeallocateBookingSession}});var i=n(11010),r=n(97582),a=n(63144),o=n.n(a),s=n(11752),c=n.n(s),l=n(53509),d=c()().publicRuntimeConfig.treatmentBaseUrl;function GetAvailableClientTreatmentSessions(e,t,n,i){return _GetAvailableClientTreatmentSessions.apply(this,arguments)}function _GetAvailableClientTreatmentSessions(){return(_GetAvailableClientTreatmentSessions=(0,i._)(function(e,t,n,i){var a;return(0,r.Jh)(this,function(r){switch(r.label){case 0:return[4,o()("".concat(d,"/TreatmentCourse/GetAvailableSessions/clinic/").concat(e,"/patient/").concat(t),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},signal:i.signal})];case 1:return a=r.sent(),[2,(0,l.dW)(a)]}})})).apply(this,arguments)}function GetAvailableClientTreatmentSessionsForClinicPractitioner(e,t,n,i,r){return _GetAvailableClientTreatmentSessionsForClinicPractitioner.apply(this,arguments)}function _GetAvailableClientTreatmentSessionsForClinicPractitioner(){return(_GetAvailableClientTreatmentSessionsForClinicPractitioner=(0,i._)(function(e,t,n,i,a){var s;return(0,r.Jh)(this,function(r){switch(r.label){case 0:return[4,o()("".concat(d,"/TreatmentCourse/GetAvailableSessions/clinic/").concat(e,"/patient/").concat(n,"?practitionerId=").concat(t),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)},signal:a.signal})];case 1:return s=r.sent(),[2,(0,l.dW)(s)]}})})).apply(this,arguments)}function AllocateBookingSession(e,t,n,i,r){return _AllocateBookingSession.apply(this,arguments)}function _AllocateBookingSession(){return(_AllocateBookingSession=(0,i._)(function(e,t,n,i,a){var s;return(0,r.Jh)(this,function(r){switch(r.label){case 0:return[4,o()("".concat(d,"/TreatmentCourse/Clinic/").concat(e,"/Patient/").concat(t,"/Allocate/").concat(n),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify(i)})];case 1:return s=r.sent(),[2,(0,l.YQ)(s)]}})})).apply(this,arguments)}function DeallocateBookingSession(e,t,n,i,r){return _DeallocateBookingSession.apply(this,arguments)}function _DeallocateBookingSession(){return(_DeallocateBookingSession=(0,i._)(function(e,t,n,i,a){var s;return(0,r.Jh)(this,function(r){switch(r.label){case 0:return[4,o()("".concat(d,"/TreatmentCourse/Clinic/").concat(e,"/Patient/").concat(t,"/Deallocate/").concat(n),{method:"post",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify(i)})];case 1:return s=r.sent(),[2,(0,l.YQ)(s)]}})})).apply(this,arguments)}},66821:function(e,t,n){n.d(t,{K3:function(){return g},bw:function(){return f},e_:function(){return b},pL:function(){return v}});var i,r,a,o,s=n(11010),c=n(97582),l=n(63144),d=n.n(l),u=n(11752),m=n.n(u),p=n(53509),h=m()().publicRuntimeConfig.treatmentNotes
1BaseUrl,f=(i=(0,s._)(function(e,t,n){var i;return(0,c.Jh)(this,function(r){switch(r.label){case 0:return[4,d()("".concat(h,"/notes/clinics/").concat(e,"/patients/").concat(t),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)}})];case 1:return i=r.sent(),[2,(0,p.dW)(i)]}})}),function(e,t,n){return i.apply(this,arguments)}),b=(r=(0,s._)(function(e,t,n,i){var r;return(0,c.Jh)(this,function(a){switch(a.label){case 0:return[4,d()("".concat(h,"/notes/clinics/").concat(e,"/patients/").concat(t,"/treatmentrecords/").concat(n),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(i)}})];case 1:return r=a.sent(),[2,(0,p.dW)(r)]}})}),function(e,t,n,i){return r.apply(this,arguments)});(0,s._)(function(e,t,n,i,r){var a;return(0,c.Jh)(this,function(o){switch(o.label){case 0:return[4,d()("".concat(h,"/notes/clinics/").concat(e,"/patients/").concat(t,"/treatmentrecords/").concat(n,"/notes/").concat(i),{method:"get",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)}})];case 1:return a=o.sent(),[2,(0,p.dW)(a)]}})});var v=(a=(0,s._)(function(e,t,n,i,r,a){var o;return(0,c.Jh)(this,function(s){switch(s.label){case 0:return[4,d()("".concat(h,"/notes/clinics/").concat(e,"/patients/").concat(t,"/treatmentrecords/").concat(n,"/notes/").concat(i),{method:"put",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(a)},body:JSON.stringify(r)})];case 1:return o=s.sent(),[2,(0,p.dW)(o)]}})}),function(e,t,n,i,r,o){return a.apply(this,arguments)}),g=(o=(0,s._)(function(e,t,n,i,r){var a;return(0,c.Jh)(this,function(o){switch(o.label){case 0:return[4,d()("".concat(h,"/notes/clinics/").concat(e,"/patients/").concat(t,"/treatmentrecords/").concat(n,"/notes/").concat(i),{method:"delete",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(r)}})];case 1:return a=o.sent(),[2,(0,p.YQ)(a)]}})}),function(e,t,n,i,r){return o.apply(this,arguments)})},91795:function(e,t,n){var i,r;n.d(t,{$:function(){return i}}),(r=i||(i={})).CREATED="created",r.ALLOCATED="allocated",r.COMPLETED="completed"},10564:function(e,t,n){var i,r,a,o;n.d(t,{C:function(){return i},l:function(){return r}}),(a=i||(i={})).Created="Created",a.Completed="Completed",(o=r||(r={})).Online="online",o.Offline="offline"},91748:function(e,t,n){n.d(t,{Z:function(){return i}});var i=RegExp(/^[a-zA-Z0-9!#$%&'+^_`{}~-]+(?:\.[a-zA-Z0-9!#$%&'+^_`{}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/)}}]); 2//# sourceMappingURL=9072-9767bb9e3c24cb29.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.