PageSourceSearch

https://www.ashcare.com/react/assets/index.esm-CNgfcGHI.js

js ashcare.com collected 2026-10-08 09:12:21 UTC 35,481 bytes, 5 lines download raw bytes

1import{M as ne,j as a,r as v,$ as sr,a0 as ur,b5 as lr,a3 as Me,b7 as cr,F as ce,S as _,A as Q,T as f,B as q,Z as I,R as dr,U as pr,v as Te,I as He,t as mr,aC as Re,aW as re,b1 as hr,b as k,H as Se,aS as fr,aT as gr,aU as vr,aR as Er,aQ as br,w as yr,p as s,z as te,a1 as Fe,b4 as xr,o as Ar,u as jr,E as O,ad as Tr,ae as Rr,aj as Sr,ak as ue,bi as _r,a2 as Cr,d as y}from"./index-HIYmxtGU.js";import{C as Or}from"./ChevronRight-CrCv0sdk.js";import{C as Nr}from"./Close-Bs-3qgcm.js";import{F as Dr}from"./FormControlLabel-DkVskfp8.js";import{C as Pr}from"./Checkbox-CukkVv7M.js";import{A as Ir}from"./AccessTime-Cav7v3WE.js";import{L as le}from"./ListItemAvatar-Bm6Ew9Bo.js";import"./SwitchBase-BUXJ1E1r.js";const wr=ne(a.jsx("path",{d:"M22 24H2v-4h20zM13.06 5.19l3.75 3.75L7.75 18H4v-3.75zm4.82 2.68-3.75-3.75 1.83-1.83c.39-.39 1.02-.39 1.41 0l2.34 2.34c.39.39.39 1.02 0 1.41z"})),Lr=ne(a.jsx("path",{d:"M18 2H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H9V4h9zM3 15v-2h2v2zm0-5.5h2v2H3zM10 20h2v2h-2zm-7-1.5v-2h2v2zM5 22c-1.1 0-2-.9-2-2h2zm3.5 0h-2v-2h2zm5 0v-2h2c0 1.1-.9 2-2 2M5 6v2H3c0-1.1.9-2 2-2"})),he=ne(a.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"})),Gr=ne(a.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}));function Mr(t){if(Array.isArray(t))return t}function Hr(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,i,u,c,l=[],p=!0,m=!1;try{if(u=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;p=!1}else for(;!(p=(n=u.call(r)).done)&&(l.push(n.value),l.length!==e);p=!0);}catch(b){m=!0,i=b}finally{try{if(!p&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(m)throw i}}return l}}function de(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ke(t,e){if(t){if(typeof t=="string")return de(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?de(t,e):void 0}}function Fr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(t,e){return Mr(t)||Hr(t,e)||ke(t,e)||Fr()}var qe=function(e){var r=e.children,n=dr(),i=pr(n.breakpoints.down("sm"));return a.jsx(Te,{container:!0,justifyContent:"center",children:a.jsx(Te,{px:{xs:1,sm:2,md:4},m:{xs:"0 auto"},maxWidth:i?"100%":"600px",width:"100%",children:r})})},kr=v.forwardRef(function(t,e){var r=t.open,n=t.onClose,i=t.children,u=t.hideClose,c=u===void 0?!1:u;return a.jsxs(lr,{open:r,onClose:n,fullScreen:!0,scroll:"paper",slotProps:{paper:{sx:{bgcolor:"background.eveCustom.secondary"}}},children:[!c&&a.jsx(Me,{"aria-label":"close",onClick:n,size:"large",sx:{position:"absolute",right:8,top:8},children:a.jsx(Nr,{})}),a.jsx(cr,{ref:e,children:a.jsx(qe,{children:i})})]})}),qr={defaultOptions:{queries:{suspense:!0}}},Be=function(e){var r=e.SuspenseFallBack,n=e.hasOwnProvider,i=e.children,u=qr,c=v.useState(function(){return new sr(u)}),l=B(c,1),p=l[0],m=function(){return a.jsx(v.Suspense,{fallback:r,children:i})};return n?m():a.jsxs(ur,{client:p,children:[m(),!1]})};Be.propTypes={SuspenseFallBack:s.element.isRequired,hasOwnProvider:s.bool,children:s.element.isRequired};function Br(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function _e(t,e){if(t==null)return{};var r,n,i=Br(t,e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(t);for(n=0;n<u.length;n++)r=u[n],e.indexOf(r)===-1&&{}.propertyIsEnumerable.call(t,r)&&(i[r]=t[r])}return i}function V(t){"@babel/helpers - typeof";return V=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V(t)}function $r(t,e){if(V(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(V(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ur(t){var e=$r(t,"string");return V(e)=="symbol"?e:e+""}function S(t,e,r){return(e=Ur(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var fe=function(e){var r=e.agreed,n=r===void 0?!1:r,i=e.guardianName,u=i===void 0?"":i,c=e.guardianNameError,l=c===void 0?!1:c,p=e.agreedError,m=p===void 0?!1:p,b=e.requiresParentOrGuardian,g=b===void 0?!1:b,x=e.transparent,D=x===void 0?!1:x,C=e.onAgree,P=e.onGuardianNameChange;return a.jsx(k,{variant:"outlined",sx:{p:2,backgroundColor:D?void 0:"background.eveCustom.secondary"},children:a.jsxs(_,{children:[g&&a.jsxs(a.Fragment,{children:[a.jsx(f,{variant:"body2",gutterBottom:!0,children:"Parent or Guardian"}),a.jsx(yr,{label:"Full Name",sx:{backgroundColor:"background.paper"},value:u,onChange:P,error:!!l,fullWidth:!0})]}),a.jsx(Dr,{control:a.jsx(Pr,{checked:n,onChange:C,color:m?"error":"secondary"}),labelPlacement:"end",label:a.jsx(f,{variant:"body1",color:m?"error":"inherit",children:"I have read and agree"})})]})})};fe.propTypes={agreed:s.bool.isRequired,guardianName:s.string,guardianNameError:s.bool,agreedError:s.bool,requiresParentOrGuardian:s.bool,transparent:s.bool,onAgree:s.func.isRequired,onGuardianNameChange:s.func};function zr(t){if(Array.isArray(t))return de(t)}function Wr(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Yr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qr(t){return zr(t)||Wr(t)||ke(t)||Yr()}var o=(function(t){return t.DOCUMENT="document",t.PARAGRAPH="paragraph",t.HEADING_1="heading-1",t.HEADING_2="heading-2",t.HEADING_3="heading-3",t.HEADING_4="heading-4",t.HEADING_5="heading-5",t.HEADING_6="heading-6",t.OL_LIST="ordered-list",t.UL_LIST="unordered-list",t.LIST_ITEM="list-item",t.HR="hr",t.QUOTE="blockquote",t.EMBEDDED_ENTRY="embedded-entry-block",t.EMBEDDED_ASSET="embedded-asset-block",t.EMBEDDED_RESOURCE="embedded-resource-block",t.TABLE="table",t.TABLE_ROW="table-row",t.TABLE_CELL="table-cell",t.TABLE_HEADER_CELL="table-header-cell",t})({}),N=(function(t){return t.ASSET_HYPERLINK="asset-hyperlink",t.EMBEDDED_ENTRY="embedded-entry-inline",t.EMBEDDED_RESOURCE="embedded-resource-inline",t.ENTRY_HYPERLINK="entry-hyperlink",t.HYPERLINK="hyperlink",t.RESOURCE_HYPERLINK="resource-hyperlink",t})({});const Vr=[o.PARAGRAPH,o.HEADING_1,o.HEADING_2,o.HEADING_3,o.HEADING_4,o.HEADING_5,o.HEADING_6,o.OL_LIST,o.UL_LIST,o.HR,o.QUOTE,o.EMBEDDED_ENTRY,o.EMBEDDED_ASSET,o.EMBEDDED_RESOURCE,o.TABLE],$e=[o.PARAGRAPH,o.HEADING_1,o.HEADING_2,o.HEADING_3,o.HEADING_4,o.HEADING_5,o.HEADING_6,o.OL_LIST,o.UL_LIST,o.HR,o.QUOTE,o.EMBEDDED_ENTRY,o.EMBEDDED_ASSET,o.EMBEDDED_RESOURCE];o.TABLE,o.TABLE_ROW,o.TABLE_CELL,o.TABLE_HEADER_CELL;o.HR,o.EMBEDDED_ENTRY,o.EMBEDDED_ASSET,o.EMBEDDED_RESOURCE;const Kr={[o.OL_LIST]:[o.LIST_ITEM],[o.UL_LIST]:[o.LIST_ITEM],[o.LIST_ITEM]:$e,[o.QUOTE]:[o.PARAGRAPH],[o.TABLE]:[o.TABLE_ROW],[o.TABLE_ROW]:[o.TABLE_CELL,o.TABLE_HEADER_CELL],[o.TABLE_CELL]:[o.PARAGRAPH,o.UL_LIST,o.OL_LIST],[o.TABLE_HEADER_CELL]:[o.PARAGRAPH]},Xr=[o.HEADING_1,o.HEADING_2,o.HEADING_3,o.HEADING_4,o.HEADING_5,o.HEADING_6];[o.PARAGRAPH,...Xr];o.DOCUMENT,o.PARAGRAPH,o.HEADING_1,o.HEADING_2,o.HEADING_3,o.HEADING_4,o.HEADING_5,o.HEADING_6,o.OL_LIST,o.UL_LIST,o.LIST_ITEM,o.HR,o.QUOTE,o.EMBEDDED_ENTRY,o.EMBEDDED_ASSET,N.HYPERLINK,N.ENTRY_HYPERLINK,N.ASSET_HYPERLINK,N.EMBEDDED_ENTRY;o.DOCUMENT,o.PARAGRAPH;const J=({path:t,property:e,typeName:r,value:n})=>({details:`The type of "${e}" is incorrect, expected type: ${r}`,name:"type",path:t.toArray(),type:r,value:n}),Zr=({min:t,value:e,path:r})=>({name:"size",min:t,path:r.toArray(),details:`Size must be at least ${t}`,value:e}),Jr=({max:t,value:e,path:r})=>({name:"size",max:t,path:r.toArray(),details:`Size must be at most ${t}`,value:e}),et=({expected:t,value:e,path:r})=>({details:"Value must be one of expected values",name:"in",expected:[...t].sort(),path:r.toArray(),value:e}),rt=({property:t,path:e})=>({details:`The property "${t}" is not expected`,name:"unexpected",path:e.toArray()}),tt=({property:t,path:e})=>({details:`The property "${t}" is required here`,name:"required",path:e.toArray()});class U{obj;path;_errors=[];constructor(e,r){this.obj=e,this.path=r}catch=(...e)=>{this._errors.push(...e)};get errors(){const e=r=>JSON.stringify({details:r.details,path:r.path});return this._errors.filter((r,n)=>this._errors.findIndex(i=>e(r)===e(i))===n)}exists=e=>e in this.obj?!0:(this.catch(tt({property:e,path:this.path.of(e)})),!1);object=e=>{const r=e?this.obj[e]:this.obj;if(e&&!this.exists(e))return!1;if(typeof r=="object"&&!Array.isArray(r)&&r!==null)return!0;const n=e?this.path.of(e):this.path,i=e??this.path.last()??"value";return this.catch(J({typeName:"Object",property:i,path:n,value:r})),!1};string=e=>{const r=this.obj[e];return e&&!this.exists(e)?!1:typeof r=="string"?!0:(this.catch(J({typeName:"String",property:e,path:this.path.of(e),value:r})),!1)};number=(e,r)=>{const n=this.obj[e];return r&&!(e in this.obj)?!0:this.exists(e)?typeof n=="number"&&!Number.isNaN(n)?!0:(this.catch(J({typeName:"Number",property:e,path:this.path.of(e),value:n})),!1):!1};array=e=>{const r=this.obj[e];return e&&!this.exists(e)?!1:Array.isArray(r)?!0:(this.catch(J({typeName:"Array",property:e,path:this.path.of(e),value:r})),!1)};enum=(e,r)=>{const n=this.obj[e];return typeof n=="string"&&r.includes(n)?!0:(this.catch(et({expected:r,value:n,path:this.path.of(e)})),!1)};empty=e=>{if(!this.array(e))return!1;const r=this.obj[e];return r.length===0?!0:(this.catch(Jr({max:0,value:r,path:this.path.of(e)})),!1)};minLength=(e,r)=>{if(!this.array(e))return!1;const n=this.obj[e];return n.length>=r?!0:(this.catch(Zr({min:r,value:n,path:this.path.of(e)})),!1)};noAdditionalProperties=e=>{const r=Object.keys(this.obj).sort().filter(n=>!e.includes(n));return r.forEach(n=>this.catch(rt({property:n,path:this.path.of(n)}))),r.length===0};each=(e,r)=>{if(!this.array(e))return;const n=this.obj[e];let i=!1;
3n.forEach((u,c)=>{if(i)return;const l=r(u,this.path.of(e).of(c));l.length>0&&(i=!0),this.catch(...l)})}}const Y=[];class ge{contentRule;validateData;constructor(e,r){this.contentRule=e,this.validateData=r}assert(e,r){const n=new U(e,r);if(!n.object())return n.errors;n.noAdditionalProperties(["nodeType","data","content"]);const{nodeTypes:i,min:u=0}=Array.isArray(this.contentRule)?{nodeTypes:this.contentRule}:this.contentRule(e,r);if(i.length===0&&u>0)throw new Error(`Invalid content rule. Cannot have enforce a 'min' of ${u} with no nodeTypes`);if(n.minLength("content",u),i.length===0?n.empty("content"):n.each("content",(c,l)=>{const p=new U(c,l);return p.object()&&p.enum("nodeType",i),p.errors}),n.object("data")){const c=this.validateData?.(e.data,r.of("data"))??[];n.catch(...c)}return n.errors}}class nt extends ge{linkType;type;constructor(e,r){super(r,(n,i)=>this.assertLink(n,i)),this.linkType=e,this.type=this.linkType.startsWith("Contentful:")?"ResourceLink":"Link"}assertLink=(e,r)=>{const n=new U(e,r);if(n.object("target")){const i=new U(e.target.sys,r.of("target").of("sys"));i.object()&&(i.enum("type",[this.type]),i.enum("linkType",[this.linkType]),this.type==="Link"?(i.string("id"),i.noAdditionalProperties(["type","linkType","id"])):this.type==="ResourceLink"&&(i.string("urn"),i.noAdditionalProperties(["type","linkType","urn"]))),n.catch(...i.errors)}return n.noAdditionalProperties(["target"]),n.errors}}class at extends ge{constructor(){super(["text"],(e,r)=>this.assertLink(e,r))}assertLink=(e,r)=>{const n=new U(e,r);return n.string("uri"),n.noAdditionalProperties(["uri"]),n.errors}}const w=(t,e)=>new ge(t,e),F=(t,e)=>new nt(t,e),H=w([...Object.values(N),"text"].sort()),Ce=w([o.LIST_ITEM]),ot=F("Entry",Y),Oe=w(()=>({nodeTypes:[o.PARAGRAPH],min:1}),(t,e)=>{const r=new U(t,e);return r.noAdditionalProperties(["colspan","rowspan"]),r.number("colspan",!0),r.number("rowspan",!0),r.errors});o.DOCUMENT+"",w(Vr),o.PARAGRAPH+"",o.HEADING_1+"",o.HEADING_2+"",o.HEADING_3+"",o.HEADING_4+"",o.HEADING_5+"",o.HEADING_6+"",o.QUOTE+"",w(Kr[o.QUOTE]),o.EMBEDDED_ENTRY+"",o.EMBEDDED_ASSET+"",F("Asset",Y),o.EMBEDDED_RESOURCE+"",F("Contentful:Entry",Y),o.HR+"",w(Y),o.OL_LIST+"",o.UL_LIST+"",o.LIST_ITEM+"",w([...$e].sort()),o.TABLE+"",w(()=>({nodeTypes:[o.TABLE_ROW],min:1})),o.TABLE_ROW+"",w(()=>({nodeTypes:[o.TABLE_CELL,o.TABLE_HEADER_CELL],min:1})),o.TABLE_CELL+"",o.TABLE_HEADER_CELL+"",N.HYPERLINK+"",new at,N.EMBEDDED_RESOURCE+"",F("Contentful:Entry",Y),N.ENTRY_HYPERLINK+"",F("Entry",["text"]),N.ASSET_HYPERLINK+"",F("Asset",["text"]),N.RESOURCE_HYPERLINK+"",F("Contentful:Entry",["text"]);var pe={EXTERNAL_IN_NEW_TAB:"ExternalInNewTab",NEW_TAB:"NewTab"};function Ne(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ee(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ne(Object(r),!0).forEach(function(n){S(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ne(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var it=function(e){return e?e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//"):!1},De=function(e,r){switch(r){case pe.EXTERNAL_IN_NEW_TAB:return it(e)?{target:"_blank",rel:"noopener"}:{};case pe.NEW_TAB:return{target:"_blank",rel:"noopener"};default:return{}}},Ue=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:pe.EXTERNAL_IN_NEW_TAB;return{renderText:function(n){return n.split(`
4`).reduce(function(i,u,c){return[].concat(Qr(i),[c>0&&a.jsx("br",{},"br-".concat(c)),a.jsx(v.Fragment,{children:u},"text-".concat(c))])},[])},renderNode:S(S(S(S(S(S({},o.TABLE,function(r,n){return a.jsx(fr,{children:a.jsx(gr,{children:a.jsx(vr,{children:n})})})}),o.TABLE_ROW,function(r,n){return a.jsx(Er,{children:n})}),o.TABLE_CELL,function(r,n){return a.jsx(br,{children:n})}),N.ASSET_HYPERLINK,function(r){var n=De(r.data.target.file.url,e);return a.jsx(Se,ee(ee({href:r.data.target.file.url},n),{},{children:r.data.target.title}))}),o.UL_LIST,function(r,n){return a.jsx(f,{color:"text.secondary",component:"ul",children:n})}),N.HYPERLINK,function(r,n){var i=De(r.data.uri,e);return a.jsx(Se,ee(ee({href:r.data.uri},i),{},{children:n}))})}};Ue();var ze=function(e){var r=e.data,n=e.requiresParentOrGuardian,i=e.agreed,u=e.guardianName,c=e.onAgree,l=e.onGuardianNameChange,p=l===void 0?function(){}:l,m=e.onBack;return a.jsxs(_,{mb:3,spacing:6,children:[a.jsxs(_,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[a.jsx(q,{onClick:m,startIcon:a.jsx(Re,{}),children:"Back"}),a.jsx(re,{label:"Required"})]}),a.jsxs(_,{direction:"column",alignItems:"center",spacing:2,children:[a.jsx(Q,{"aria-hidden":"true",sx:{width:56,height:56},children:a.jsx(he,{})}),a.jsx(f,{variant:"h6",component:"h1",align:"center",children:r?.title})]}),r?.content&&hr.documentToReactComponents(r?.content,Ue()),a.jsxs(_,{spacing:3,children:[a.jsx(fe,{transparent:!0,agreed:i,guardianName:u,requiresParentOrGuardian:n,onAgree:c,onGuardianNameChange:p}),a.jsx(q,{variant:"outlined",startIcon:a.jsx(Re,{}),fullWidth:!0,onClick:m,children:"Back"})]})]})};ze.propTypes={data:s.shape({title:s.string,description:s.string,content:s.shape({})}),requiresParentOrGuardian:s.bool,agreed:s.bool.isRequired,guardianName:s.string,onAgree:s.func.isRequired,onGuardianNameChange:s.func,onBack:s.func.isRequired};var We=function(e){var r=e.formData,n=e.requiresParentOrGuardian,i=n===void 0?!1:n,u=e.agreed,c=e.guardianName,l=c===void 0?"":c,p=e.onAgree,m=e.onGuardianNameChange,b=e.onReadFull,g=e.guardianNameError,x=e.agreedError,D=x===void 0?!1:x;return a.jsxs(k,{sx:{p:3,borderColor:g||D?"error.main":void 0},variant:"outlined",children:[a.jsxs(_,{direction:"row",justifyContent:"space-between",alignItems:"center",mb:2.5,children:[a.jsx(he,{color:"disabled",fontSize:"large"}),a.jsx(re,{color:"secondary",label:"Required"})]}),a.jsx(f,{variant:"h6",children:r?.title}),a.jsx(f,{variant:"body2",color:"text.secondary",gutterBottom:!0,children:r?.description}),a.jsx(q,{endIcon:a.jsx(Or,{}),variant:"text",size:"small",onClick:b,"aria-label":"Read full".concat(r!=null&&r.title?": ".concat(r.title):""),sx:{mb:1.5},children:a.jsx("strong",{children:"Read Full Document"})}),a.jsx(fe,{agreed:u,guardianName:l,guardianNameError:g,agreedError:D,requiresParentOrGuardian:i,onAgree:p,onGuardianNameChange:m})]})};We.propTypes={formData:s.shape({title:s.string,description:s.string}),requiresParentOrGuardian:s.bool,agreed:s.bool.isRequired,guardianName:s.string,onAgree:s.func.isRequired,onGuardianNameChange:s.func,onReadFull:s.func.isRequired,guardianNameError:s.bool,agreedError:s.bool};function Pe(t,e,r,n,i,u,c){try{var l=t[u](c),p=l.value}catch(m){return void r(m)}l.done?e(p):Promise.resolve(p).then(n,i)}function Ye(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var u=t.apply(e,r);function c(p){Pe(u,n,i,c,l,"next",p)}function l(p){Pe(u,n,i,c,l,"throw",p)}c(void 0)})}}var st=new Map([["localhost","dev"],["preview","dev"],["dev","dev"],["tst","tst"],["stg","stg"]]),ut=function(){var e,r,n=(e=window.location)===null||e===void 0?void 0:e.hostname,i=n==null||(r=n.split(".").shift())===null||r===void 0?void 0:r.toLowerCase();return st.get(i)||"prod"}
4,Qe=function(){var e=ut(),r=e!=="prod"?"https://".concat(e,".customerservice.api.ashcompanies.com"):"https://customerservice.api.ashcompanies.com",n=Fe.create({baseURL:r,withCredentials:!0});return n};function Ie(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function me(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ie(Object(r),!0).forEach(function(n){S(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ie(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Ve=function(e){return{headers:e?{"X-SS-ID":e}:{}}},lt=(function(){var t=Ye(te.mark(function e(r){var n,i,u,c,l,p,m,b;return te.wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return n=r.queryKey,i=B(n,5),u=i[1],c=i[2],l=i[3],p=i[4],m=p.join(","),b=me({product:c,contentTypes:m},l?{component:l}:{}),g.next=1,Qe().get("/memberAgreements",me({params:b},Ve(u)));case 1:return g.abrupt("return",g.sent.data);case 2:case"end":return g.stop()}},e)}));return function(r){return t.apply(this,arguments)}})(),ct=(function(){var t=Ye(te.mark(function e(r,n){return te.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=1,Qe().put("/memberAgreements",n,me({},Ve(r)));case 1:return i.abrupt("return",i.sent.data);case 2:case"end":return i.stop()}},e)}));return function(r,n){return t.apply(this,arguments)}})(),dt=function(e){var r=v.useState(null),n=B(r,2),i=n[0],u=n[1],c=v.useState(!1),l=B(c,2),p=l[0],m=l[1],b=mr(function(x){return ct(e,x)},{onMutate:function(){m(!0),u(null)},onError:function(){u("Something went wrong processing your request. Please try again.")},onSettled:function(){m(!1)}}),g=b.mutate;return{mutate:g,submitError:i,isSubmitting:p}},pt={GET_COMPONENT_FORMS:"GetComponentForms"},mt=function(e,r,n,i){var u=He([pt.GET_COMPONENT_FORMS,e,r,n,i],lt,{enabled:!!e&&i?.length>0,suspense:!1}),c=u.data,l=u.isLoading,p=u.isError;return{data:c,isLoading:l,isError:p}},ve=function(e){var r=e.count,n=r===void 0?3:r;return a.jsx(qe,{children:a.jsxs(_,{pb:9,children:[a.jsxs(_,{mt:5,mb:3,gap:1,children:[a.jsx(I,{variant:"circular",width:56,height:56}),a.jsx(I,{variant:"text",width:"40%",height:40}),a.jsx(I,{variant:"text",width:"100%",height:60})]}),a.jsx(_,{spacing:2,children:Array.from({length:n},function(i,u){return a.jsx(I,{variant:"rounded",width:"100%",height:200},u)})})]})})};ve.propTypes={count:s.number};var ht=["agreedError"],ft=["guardianNameError"];function we(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?we(Object(r),!0).forEach(function(n){S(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):we(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var gt=function(e){return e.reduce(function(r,n){var i;return R(R({},r),{},S({},n.contentType,{agreed:!1,guardianName:"",requiresParentOrGuardian:(i=n.requiresParentOrGuardian)!==null&&i!==void 0?i:!1}))},{})},Ke=function(e){var r=e.ssId,n=e.product,i=e.component,u=i===void 0?null:i,c=e.memberForms,l=c===void 0?[]:c,p=e.onNext,m=e.activeDetailForm,b=e.setActiveDetailForm,g=e.onSaveScroll,x=e.onRestoreScroll,D=l.map(function(d){return d.contentType}),C=mt(r,n,u,D),P=C.data,L=C.isLoading,z=C.isError,W=v.useState(function(){return gt(l)}),G=B(W,2),A=G[0],$=G[1],nr=v.useState({}),Ee=B(nr,2),be=Ee[0],K=Ee[1],ye=v.useRef(null),ae=dt(r),xe=ae.mutate,X=ae.submitError,ar=ae.isSubmitting,Z=v.useMemo(function(){var d;return Object.fromEntries(((d=P?.memberAgreements)!==null&&d!==void 0?d:[]).map(function(E){return[E.contentType,E]}))},[P]),or=v.useMemo(function(){return l.filter(function(d){var E,h=A[d.contentType];return h?.agreed&&(!d.requiresParentOrGuardian||!!((E=h.guardianName)!==null&&E!==void 0&&E.trim()))}).length},[A,l]);v.useEffect(function(){if(X){var d;(d=ye.current)===null||d===void 0||d.scrollIntoView({behavior:"smooth"})}},[X]);var Ae=v.useCallback(function(d){return function(){K(function(E){var h;if(!((h=E[d])!==null&&h!==void 0&&h.agreedError))return E;var T=E[d];T.agreedError;var j=_e(T,ht);return R(R({},E),{},S({},d,j))}),$(function(E){return R(R({},E),{},S({},d,R(R({},E[d]),{},{agreed:!E[d].agreed})))})}},[]),je=v.useCallback(function(d){return function(E){K(function(h){var T;if(!((T=h[d])!==null&&T!==void 0&&T.guardianNameError))return h;var j=h[d];j.guardianNameError;var M=_e(j,ft);return R(R({},h),{},S({},d,M))}),$(function(h){return R(R({},h),{},S({},d,R(R({}
4,h[d]),{},{guardianName:E.target.value})))})}},[]),ir=v.useCallback(function(){var d={};if(l.forEach(function(h){var T,j=A[h.contentType],M={};h.requiresParentOrGuardian&&!(j!=null&&(T=j.guardianName)!==null&&T!==void 0&&T.trim())&&(M.guardianNameError=!0),j!=null&&j.agreed||(M.agreedError=!0),Object.keys(M).length>0&&(d[h.contentType]=M)}),Object.keys(d).length>0){K(d);return}K({});var E={memberAgreements:l.map(function(h){var T=A[h.contentType],j=Z[h.contentType];return R({memberAgreementId:j?.memberAgreementId,agreed:T.agreed},h.requiresParentOrGuardian?{inputs:{FullName:T.guardianName}}:{})})};xe(E,{onSuccess:function(){return p()}})},[l,A,Z,xe,p]);if(m){var oe,ie,se=l.find(function(d){return d.contentType===m});return a.jsx(ze,{data:Z[m],requiresParentOrGuardian:se?.requiresParentOrGuardian,agreed:((oe=A[m])===null||oe===void 0?void 0:oe.agreed)||!1,guardianName:((ie=A[m])===null||ie===void 0?void 0:ie.guardianName)||"",onAgree:Ae(m),onGuardianNameChange:je(m),onBack:function(){b(null),x()}})}return L?a.jsx(ve,{count:l.length}):z?a.jsx(ce,{severity:"error",sx:{mb:2},children:"Something went wrong processing your request. Please try again."}):a.jsxs(_,{pb:9,children:[a.jsxs(_,{mt:5,mb:3,gap:1,children:[a.jsx(Q,{"aria-hidden":"true",variant:"circular",sx:{width:56,height:56},children:a.jsx(wr,{})}),a.jsx(f,{variant:"h5",children:"Review & Sign"}),a.jsx(f,{variant:"body1",children:"Take a moment to read through the documents below. By accepting, you're agreeing to their terms."})]}),X&&a.jsx(ce,{ref:ye,severity:"error",sx:{mb:2},children:X}),a.jsxs(_,{spacing:2,children:[l.map(function(d){var E,h,T,j;return a.jsx(We,{formData:Z[d.contentType],requiresParentOrGuardian:d.requiresParentOrGuardian,agreed:((E=A[d.contentType])===null||E===void 0?void 0:E.agreed)||!1,guardianName:((h=A[d.contentType])===null||h===void 0?void 0:h.guardianName)||"",guardianNameError:(T=be[d.contentType])===null||T===void 0?void 0:T.guardianNameError,agreedError:(j=be[d.contentType])===null||j===void 0?void 0:j.agreedError,onAgree:Ae(d.contentType),onGuardianNameChange:je(d.contentType),onReadFull:function(){g(),b(d.contentType)}},d.contentType)}),a.jsx(q,{type:"submit",variant:"contained",disableElevation:!0,disabled:ar,onClick:ir,children:"Next"}),a.jsxs(f,{variant:"subtitle2",color:"text.secondary",align:"center",children:["Signed ",or," of ",l.length]})]})]})};Ke.propTypes={ssId:s.string.isRequired,product:s.string.isRequired,component:s.string,memberForms:s.arrayOf(s.shape({contentType:s.string.isRequired,requiresParentOrGuardian:s.bool})).isRequired,onNext:s.func.isRequired,activeDetailForm:s.string,setActiveDetailForm:s.func.isRequired,onSaveScroll:s.func.isRequired,onRestoreScroll:s.func.isRequired};var Xe=function(e){var r=e.open,n=e.ssId,i=e.product,u=e.component,c=u===void 0?null:u,l=e.hasOwnProvider,p=l===void 0?!1:l,m=e.memberForms,b=e.onNext,g=e.onClose,x=v.useRef(null),D=v.useRef(0),C=v.useState(null),P=B(C,2),L=P[0],z=P[1];v.useLayoutEffect(function(){if(L){var A=x.current;A&&(A.scrollTop=0)}},[L]);var W=v.useCallback(function(){var A,$;D.current=(A=($=x.current)===null||$===void 0?void 0:$.scrollTop)!==null&&A!==void 0?A:0},[]),G=v.useCallback(function(){requestAnimationFrame(function(){var A=x.current;A&&(A.scrollTop=D.current)})},[]);return a.jsx(Be,{hasOwnProvider:p,SuspenseFallBack:a.jsx(ve,{count:m.length}),children:a.jsx(kr,{open:r,onClose:g,ref:x,hideClose:!!L,children:a.jsx(Ke,{ssId:n,product:i,component:c,memberForms:m,onNext:b,activeDetailForm:L,setActiveDetailForm:z,onSaveScroll:W,onRestoreScroll:G})})})};Xe.propTypes={open:s.bool.isRequired,onClose:s.func.isRequired,ssId:s.string.isRequired,product:s.string.isRequired,component:s.string,hasOwnProvider:s.bool,memberForms:s.arrayOf(s.shape({contentType:s.string.isRequired,requiresParentOrGuardian:s.bool})).isRequired,onNext:s.func.isRequired};const Le=t=>({color:t.palette.mode==="dark"?t.palette.grey[600]:t.palette.grey[400]}),vt="https://pp-wfe-100.advancedmd.com/155535/account/logon",Et="default",Ze=({email:t=void 0})=>{const[e,r]=v.useState(!1),n=()=>{navigator.clipboard.writeText(t),r(!0)},i=()=>{r(!1)},u=()=>{window.open(vt,"_blank","noopener,noreferrer")};return a.jsxs(k,{variant:"outlined",sx:{p:4,minHeight:"160px",display:"flex",flexDirection:"column"},children:[a.jsxs(O,{sx:{mb:3},children:[a.jsx(f,{variant:"h6",children:"Clinical Forms"}),a.jsx(f,{variant:"body2",color:"text.secondary",children:"Help your provider understand your symptoms and goals before your first visit."})]}),t&&a.jsxs(k,{variant:"outlined",sx:{px:2,py:3,bgcolor:"background.eveCustom.secondary",textAlign:"center",userSelect:"none"},children:[a.jsx(f,{variant:"subtitle2",color:"text.secondary",children:"Set up AdvancedMD with this email"}),a.jsx(f,{variant:"h6",children:t}),a.jsx(q,{variant:"text",color:"secondary",onClick:n,startIcon:a.jsx(Lr,{fontSize:"small"}),children:a.jsx("strong",{children:"COPY"})})]}),a.jsx(f,{variant:"subtitle1",sx:{mt:4,mb:1},children:"How to complete your forms"}),a.jsxs(Sr,{disablePadding:!0,sx:{mb:2},children:[a.jsxs(ue,{disableGutters:!0,sx:{my:1},children:[a.jsx(le,{children:a.jsx(Q,{children:a.jsx(f,{variant:"subtitle2",children:"1"})})}),a.jsx(f,{variant:"body2",children:t?a.jsxs(a.Fragment,{children:["Go to ",a.jsx("strong",{children:"AdvancedMD"}),a.jsx("br",{}),"Create your account using the email above"]}):a.jsxs(a.Fragment,{children:["Go to ",a.jsx("strong",{children:"AdvancedMD"})," and create your account"]})})]}),a.jsxs(ue,{disableGutters:!0,children:[a.jsx(le,{children:a.jsx(Q,{children:a.jsx(f,{variant:"subtitle2",children:"2"})})}),a.jsx(f,{variant:"body2",children:t?a.jsx(a.Fragment,{children:"Sign up with the email above and set a password"}):a.jsx(a.Fragment,{children:"Sign up and set a password"})})]}),a.jsxs(ue,{disableGutters:!0,sx:{my:1},children:[a.jsx(le,{children:a.jsx(Q,{children:a.jsx(f,{variant:"subtitle2",children:"3"})})}),a.jsx(f,{variant:"body2",children:"Complete your intake forms."})]})]}),a.jsxs(q,{variant:"contained",sx:{mt:"auto",width:{xs:"100%",md:"auto"},alignSelf:{xs:"stretch",md:"flex-end"}},onClick:u,children:["Go to AdvancedMD ",a.jsx(_r,{})]}),a.jsx(Cr,{open:e,autoHideDuration:3e3,onClose:i,anchorOrigin:{vertical:"bottom",horizontal:"center"},children:a.jsx(ce,{severity:"success",onClose:i,sx:{width:"100%"},children:"Email copied to clipboard!"})})]})};Ze.propTypes={email:y.string};function Je({status:t,forms:e,onReviewAndSignClicked:r}){if(t==="loading")return a.jsx(k,{variant:"outlined",role:"status","aria-label":"Loading consent forms",sx:{p:4,minHeight:"160px"},children:a.jsxs(_,{spacing:2.5,sx:{height:"100%"},children:[a.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[a.jsx(I,{variant:"circular",width:40,height:40}),a.jsx(O,{sx:{flexGrow:1}}),a.jsx(I,{variant:"rounded",width:88,height:32})]}),a.jsxs(O,{children:[a.jsx(I,{variant:"text",width:"45%",height:36}),a.jsx(I,{variant:"text",width:"70%"})]}),a.jsx(I,{variant:"rounded",width:"100%",height:64}),a.jsx(I,{variant:"rounded",width:"100%",height:44,sx:{mt:"auto"}})]})});if(t==="required"){const n=e.filter(i=>!i.agreed).length;return a.jsx(k,{variant:"outlined",sx:{p:4,minHeight:{xs:"160px",md:"auto"}},children:a.jsxs(_,{spacing:4,sx:{height:"100%"},children:[a.jsxs(O,{sx:{display:"flex",alignItems:"center"},children:[a.jsxs(O,{children:[a.jsx(f,{variant:"h6",children:"Consent Forms"}),a.jsx(f,{variant:"body2",color:"text.secondary",children:"Review and sign before your first visit."})]}),a.jsx(O,{sx:{flexGrow:1}}),a.jsx(re,{label:"Required",size:"medium",sx:{userSelect:"none"}})]}),a.jsxs(O,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:{xs:"stretch",md:"center"},justifyContent:{md:"space-between"},gap:2.5,mt:"auto"},children:[a.jsxs(O,{sx:{display:"flex",alignItems:"center",justifyContent:{xs:"center",md:"flex-start"},gap:1,px:{xs:2,md:0},py:{xs:1.5,md:0},border:"1px solid",borderColor:{xs:"divider",md:"transparent"},borderRadius:1,bgcolor:{xs:"background.eveCustom.secondary",md:"transparent"},width:{xs:"100%",md:"auto"},userSelect:"none"},children:[a.jsx(he,{fontSize:"small",sx:Le}),a.jsxs(f,{variant:"body2",color:"text.secondary",children:[n," ",n===1?"form":"forms"]}),a.jsx(Rr,{orientation:"vertical",flexItem:!0,sx:{mx:{xs:3,md:1}}}),a.jsx(Ir,{fontSize:"small",sx:Le}),a.jsxs(f,{variant:"body2",color:"text.secondary",children:[n," ",n===1?"minute":"minutes"]})]}),a.jsxs(q,{variant:"contained",sx:{width:{xs:"100%",md:"auto"}},onClick:r,children:["Review and Sign ",a.jsx(Gr,{})]})]})]})})}return a.jsxs(k,{variant:"outlined",sx:{p:4,bgcolor:"background.eveCustom.secondary",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[a.jsx(f,{variant:"h6",children:"Consent Forms"}),a.jsx(re,{label:"Completed",color:"success",size:"large",sx:{userSelect:"none"}})]})}Je.propTypes={status:y.oneOf(["loading","required","completed"]).isRequired,forms:y.arrayOf(y.object),onReviewAndSignClicked:y.func.isRequired};const bt=()=>{},yt=({isLoading:t,forms:e,agreementsAgreed:r})=>t||e===null?"loading":r===!1||r===void 0&&e.length>0?"required":"completed";
4function er({isLoading:t,agreementsAgreed:e,consentForms:r=[],email:n,onBackClick:i,onReviewAndSignClicked:u=bt,hideClinical:c}){const l=yt({isLoading:t,forms:r,agreementsAgreed:e});return a.jsx(O,{sx:{display:"flex",justifyContent:"center",width:"100%"},children:a.jsxs(O,{sx:{width:{xs:"100%",md:"600px"},display:"flex",flexDirection:"column",gap:2},children:[i&&a.jsx(Me,{"aria-label":"Go back",size:"large",onClick:i,sx:{alignSelf:"flex-start"},children:a.jsx(Tr,{})}),a.jsx(f,{variant:"h5",sx:{mb:2,textAlign:"left"},children:"My Forms"}),a.jsxs(O,{sx:{display:"flex",flexDirection:"column",gap:2},children:[a.jsx(Je,{status:l,forms:r,onReviewAndSignClicked:u}),!c&&a.jsx(Ze,{email:n})]})]})})}er.propTypes={isLoading:y.bool,agreementsAgreed:y.bool,consentForms:y.arrayOf(y.object),email:y.string,onBackClick:y.func,onReviewAndSignClicked:y.func,hideClinical:y.bool};const xt=t=>{const r=`https://${t==="prod"?"":`${t}.`}vhs.api.ashcompanies.com/`;return Fe.create({baseURL:r,withCredentials:!1})},At=t=>({headers:t?{"X-SS-ID":t,"X-TMZ-OFFSET":new Date().getTimezoneOffset().toString()}:{}}),jt=async({queryKey:t})=>{const[,e,r]=t;try{return(await xt(e).get("/Patients/VptotAgreementsStatus/ByBenefitMember",{...At(r)})).data}catch(n){return n?.response?.status===404||n?.response?.data?.type==="VptotAgreementsStatus.NotFound"?null:n}},rr={GET_MEMBER_AGREEMENTS:"GetMemberAgreements"},Tt=t=>{const e=t?.vptotAgreementsStatus,r=e?.vptotAgreements;return Array.isArray(r)?{agreementsAgreed:e?.vptotAgreementsAgreed,consentForms:r.filter(n=>n?.agreed===!1).map(n=>({id:`${n.agreementType}`,agreementType:n.agreementType,agreementTypeName:n.agreementTypeName,agreed:n.agreed}))}:{consentForms:[],agreementsAgreed:void 0}},Rt=(t,e,r=!0)=>{const{data:n,isLoading:i}=He([rr.GET_MEMBER_AGREEMENTS,t,e],jt,{enabled:!!(t&&e)&&r,select:Tt});return{consentForms:n?.consentForms,agreementsAgreed:n?.agreementsAgreed,error:n?.message,isLoading:i}},Ge={1:{description:"Clinical Consent",contentType:"ClinicalConsent",requiresParentOrGuardian:!1},2:{description:"Clinical Consent Minor",contentType:"ClinicalConsentMinor",requiresParentOrGuardian:!0},3:{description:"HIPAA Privacy",contentType:"HipaaPrivacy",requiresParentOrGuardian:!1},4:{description:"Patient Services Provider Group",contentType:"PatientServicesProviderGroup",requiresParentOrGuardian:!1},5:{description:"Patient Services Provider Group Consumer SelfPay",contentType:"PatientServicesProviderGroupConsumerSelfPay",requiresParentOrGuardian:!1}},St="ASHCare";function tr({apiEnv:t=void 0,ssId:e=void 0,email:r=void 0,onBackClick:n=void 0}){const i=xr(),{consentForms:u,agreementsAgreed:c,isLoading:l}=Rt(t,e),{state:p,key:m}=Ar(),b=jr(),g=p?.nextRoute,x=p?.hasCopay,[D,C]=v.useState(!1),P=u?.filter(G=>Ge[G.agreementType]!=null).map(G=>Ge[G.agreementType])??[],L=()=>{C(!0)},z=()=>{i.invalidateQueries([rr.GET_MEMBER_AGREEMENTS,t,e]),C(!1),g&&b(g,{state:{hasCopay:x}})},W=()=>{C(!1),g&&b(m!==Et?-1:"/")};return v.useEffect(()=>{g&&!l&&C(!0)},[g,l]),a.jsxs(a.Fragment,{children:[a.jsx(er,{isLoading:l,agreementsAgreed:c,consentForms:u??[],email:r,onBackClick:n,onReviewAndSignClicked:L,hideClinical:!!g}),a.jsx(Xe,{open:D,ssId:e,product:St,memberForms:P,onNext:z,onClose:W,hasOwnProvider:!0})]})}tr.propTypes={apiEnv:y.string,ssId:y.string,email:y.string,onBackClick:y.func};function _t({apiEnv:t,ssId:e,email:r,onBackClick:n}){return a.jsx(tr,{apiEnv:t,ssId:e,email:r,onBackClick:n})}_t.propTypes={apiEnv:y.string,ssId:y.string,email:y.string,onBackClick:y.func};export{_t as default};
5//# sourceMappingURL=index.esm-CNgfcGHI.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.