1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6237],{76493:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return R}});var r=t(67294),a=t(16745),i=t(75733),s=t(91911),l=t(18342),c=t(6388),o=t(97334),d=t(33299),u=t(8307),p=t(50029),h=t(64687),_=t.n(h),x=t(49861),f=t(70738),v=t(5990),j=t(85168),m=t(58902),b=t(90772),g=t(97423),y=t(81115),w=t(65463),O=t(9871),C=t(11163),D=t(97990),E=t(85893);function k(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),t.push.apply(t,r)}return t}var P=function(e){var n,t,r,i,s=e.user,o=e.activePlan,d=(0,a.nX)().t9n,h=(0,l.dd)().openModal,P=(0,v.D)().openSnackbar,I=(0,l.wh)(),Z=(0,w.r)(),A=(0,C.useRouter)(),N=(0,m.Z)(),F=N.downloadS3File,S=N.previewS3File,R=N.isDownloading,J=N.validatePreviewSupport,M=(0,c.aM)(g.P8,{variables:{user_id:s.id}}),T=(M.loading,M.error,M.data,M.refetch),U=(0,b.Z)(T).openFileUploadModal,X=s[x.Z.firstName],z=s[x.Z.lastName],W="".concat(X," ").concat(z),L=(n=(0,p.Z)(_().mark(function e(){return _().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,F(null==o?void 0:o.id);case 4:e.sent?I.dispatch(I.events.COMPLETED):(P({message:d.user_dashboard.care_plan.care_plan_header.errors.download_failed,variant:"error"}),I.dispatch(I.events.ERROR));case 6:case"end":return e.stop()}},e)})),function(){return n.apply(this,arguments)}),H=(t=(0,p.Z)(_().mark(function e(){return _().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return");case 2:if(J(o)){e.next=4;break}return e.abrupt("return");case 4:return e.next=6,S(null==o?void 0:o.id);case 6:e.sent||P({message:d.user_dashboard.care_plan.care_plan_header.errors.preview_failed,variant:"error"});case 8:case"end":return e.stop()}},e)})),function(){return t.apply(this,arguments)}),V=(r=(0,p.Z)(_().mark(function e(){return _().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!Z){e.next=3;break}return h({title:d.user_dashboard.care_plan.care_plan_header.choose_plan_modal_header,maxWidth:1200,padding:"0",content:(0,E.jsx)(O.Z,{})}),e.abrupt("return");case 3:A.push("/trusted-contacts");case 4:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)}),q=(i=(0,p.Z)(_().mark(function e(){return _().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:U(y.fileUploadActions.ADVANCE_CARE_DIRECTIVE);case 1:case"end":return e.stop()}},e)})),function(){return i.apply(this,arguments)}),B=(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(j.Zg,{children:[(0,E.jsx)(l.zx,{variant:"outline",onClick:H,disable:!o,children:(0,E.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[(0,E.jsx)(l.JO,{name:o?"eye_green":"eye_disable",width:"35px",height:"20px",style:{transform:"scale(1.25)"}}),d.user_dashboard.care_plan.care_plan_header.buttons.view_plan]})}),(0,E.jsx)(l.Z6,function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?k(Object(t),!0).forEach(function(n){(0,u.Z)(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}({labels:{INITIAL:d.button.download_plan.initial,PENDING:d.button.download_plan.pending,COMPLETE:d.button.download_plan.complete,ERROR:d.button.saving_error},icon:(0,E.jsx)(l.JO,{name:o?"download_green":"download_disable",width:"35px",height:"20px",style:{transform:"scale(1.25)"}}),variant:"outline",type:"button","data-cy":"download-PDF",reset:3e3,disable:!o,onClick:!R&&L},I)),(0,E.jsx)(l.zx,{variant:"outline",onClick:q,disable:D.Jw,children:(0,E.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[(0,E.jsx)(l.JO,{name:D.Jw?"upload_disable":"upload_green",width:"35px",height:"20px",style:{transform:"scale(1.2)"}}),d.user_dashboard.care_plan.care_plan_header.buttons.upload_new]})}),(0,E.jsx)(l.zx,{variant:"outline",onClick:V,paywallEnabled:Z,children:(0,E.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[(0,E.jsx)(l.JO,{name:Z?"share_user_orange":"share_user_green",width:"35px",height:"20px",style:{transform:"scale(1.25)"}}),d.user_dashboard.care_plan.care_plan_header.buttons.share_my_plan]})})]}),(0,E.jsx)(j.Zg,{children:(0,E.jsx)(l.zx,{variant:"outline",onClick:function(){var e;h({title:d.modal.emergency.title,maxWidth:780,content:(0,E.jsx)(f.$,{name:"".concat(s.first_name," ").concat(s.last_name),date:s.dob,pinNumber:s.pin,shareid:s.share_id,providerName:null==s||null===(e=s.provider)||void 0===e?void 0:e.name})})},children:(0,E.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[(0,E.jsx)(l.JO,{name:"print",width:"35px",height:"20px",style:{transform:"scale(1.25)"}}),d.user_dashboard.care_plan.care_plan_header.buttons.print_emergency]})})})]});return(0,E.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:40,border:"2px s
1olid #B9CFCE",padding:"30px 50px",margin:"30px",borderRadius:10},children:[(0,E.jsxs)("div",{style:{display:"flex",gap:30,width:"100%"},children:[(0,E.jsx)(l.xu,{children:(0,E.jsx)(l.qE,{user:s,size:[64,64,64]})}),(0,E.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:30,width:"100%"},children:(0,E.jsxs)(l.xu,{gap:5,children:[(0,E.jsx)(l.xv,{as:"h1",color:"#064D45",children:W}),(0,E.jsx)(l.xv,{as:"h4",color:"#5A6E73",fontWeight:"400",children:d.user_dashboard.care_plan.care_plan_header.title})]})})]}),(0,E.jsx)(j.hr,{children:B})]})},I=t(78488),Z=t(5112),A=function(e){var n=e.files,t=e.refetchFiles,r=(0,a.nX)().t9n,i=(0,b.Z)(t).openFileUploadModal;return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(j.uK,{children:[(0,E.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:30},children:(0,E.jsxs)(l.xu,{gap:5,children:[(0,E.jsx)(l.xv,{as:"h3",color:"#064D45",children:r.user_dashboard.care_plan.care_plan_content.recording.title}),(0,E.jsx)(l.xv,{as:"h4",color:"#5A6E73",fontWeight:"400",children:r.user_dashboard.care_plan.care_plan_content.recording.subtitle})]})}),(0,E.jsx)("div",{style:{display:"flex",alignItems:"center",gap:20},children:(0,E.jsx)(l.zx,{variant:"outline",onClick:function(){i(y.fileUploadActions.RECORD_AND_SHARE)},disabled:D.Jw,children:(0,E.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center"},children:[(0,E.jsx)(l.JO,{name:D.Jw?"plus_disable":"plus",width:"30px",height:"20px",style:{transform:"scale(1.25)"}}),r.user_dashboard.care_plan.care_plan_content.recording.button.title]})})})]}),(0,E.jsx)(j.sX,{children:(null==n?void 0:n.length)>0?null==n?void 0:n.map(function(e,n){return(0,E.jsxs)(j.HC,{children:[(0,E.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,color:"#303030"},children:[(0,E.jsx)(j.tw,{}),(0,E.jsx)(j.IA,{children:null==e?void 0:e.file_name})]}),(0,E.jsx)(I.cT,{data:e,updateList:t})]},n)}):(0,E.jsx)("div",{style:{display:"flex",width:"100%",padding:30},children:(0,E.jsx)(l.xv,{as:"h4",style:{margin:"auto"},children:r.user_dashboard.care_plan.care_plan_content.recording.nothing_to_display_yet})})})]})},N=function(e){var n=e.user,t=e.files,i=e.refetchFiles,s=(0,a.nX)().t9n,l=(0,r.useState)(0),c=l[0],o=l[1],d=t.filter(function(e){return"ADDITIONAL_DOCUMENT"===e.category.toUpperCase()}).sort(function(e,n){return new Date(n.activated_timestamp)-new Date(e.activated_timestamp)}),u=t.filter(function(e){return"ACP"===e.category.toUpperCase()}).sort(function(e,n){return new Date(n.activated_timestamp)-new Date(e.activated_timestamp)}),p=t.filter(function(e){return"WISHES"===e.category.toUpperCase()}).sort(function(e,n){return new Date(n.activated_timestamp)-new Date(e.activated_timestamp)});return(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)("div",{style:{display:"flex",alignItems:"stretch",margin:"30px 30px 0 30px",overflow:"auto"},children:[(0,E.jsx)(j.Av,{onClick:function(){o(0)},variant:"outline",active:String(0===c),children:s.user_dashboard.care_plan.care_plan_content.additional_documents.title}),(0,E.jsx)(j.Av,{onClick:function(){o(1)},variant:"outline",active:String(1===c),children:s.user_dashboard.care_plan.care_plan_content.version_history.title}),(0,E.jsx)(j.Av,{onClick:function(){o(2)},variant:"outline",active:String(2===c),children:s.user_dashboard.care_plan.care_plan_content.recording.title})]}),0===c&&(0,E.jsx)(I.ZP,{files:d,refetchFiles:i}),1===c&&(0,E.jsx)(Z.Z,{user:n,files:u,refetchFiles:i}),2===c&&(0,E.jsx)(A,{files:p,refetchFiles:i})]})},F=t(31222),S=function(){var e=(0,a.nX)().t9n,n=(0,d.useSession)(),t=n.data;n.status;var r=(0,c.aM)(o.Ql,{variables:{id:null==t?void 0:t.id},skip:!t}),i=r.data,s=r.loading,u=(0,c.aM)(g.P8,{variables:{user_id:null==t?void 0:t.id},fetchPolicy:"network-only",skip:!t}),p=u.loading,h=(u.error,u.data),_=u.refetch;if(!p&&!s){var x=i.user,f=h.files,v=f.filter(function(e){return e.is_active}).pop();return(0,E.jsxs)(l.xu,{gap:20,alignContent:"flex-start",children:[(0,E.jsx)(F.h4,{header:{title:"".concat(e.user_dashboard.care_plan.title).concat(null!=x&&x.first_name?", ".concat(x.first_name):"","."),copy:e.user_dashboard.care_plan.subtitle},t9n:e}),(0,E.jsxs)(l.s_,{maxWidth:[null,null,1500],position:"relative",p:["unset"],children:[(0,E.jsx)(P,{user:x,activePlan:v}),(0,E.jsx)(N,{user:x,files:f,refetchFiles:_})]})]})}},R=function(){var e=(0,a.nX)().t9n;return(0,E.jsxs)(i.Z,{children:[(0,E.jsx)(s.Z,{items:[{name:e.bread_crumb.dashboard,route:"/dashboard"},{name:e.bread_crumb.my_advance_care_plan}]}),(0,E.jsx)(S,{})]})}},41560:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/care-plan",function(){return t(76493)}])}},function(e){e.O(0,[5843,2678,7439,1111,2191,7802,7986,4098,3553,1761,8159,5733,9033,4615,2888,9774,179],function(){return e(e.s=41560)}),_N_E=e.O()}]);
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.