@icanbwell/composite 1.1135.1 → 1.1136.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/native.js +1 -1
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -866,7 +866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
866
866
  <div class="wrapper">
867
867
  <bwell-error-component />
868
868
  </div>
869
- `}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},$e=({src:Kt,elementNameSuffix:Gt,version:St,prefetchFeatureApp:Xe})=>(0,h.__awaiter)(void 0,void 0,void 0,function*(){var Fe,Ot,Qe,Ye,Dt,fn,zn,et,Rt,jt,_n,br,mn,Dn,fr;window.bwell||(window.bwell=new re({metadata:{version:St}}));const Bn=`bwell-${Gt}`;if(customElements.get(Bn)!==void 0)return;class Zr extends f{constructor(){super(),Fe.add(this),Ot.set(this,(0,S.nanoid)()),Qe.set(this,void 0),Ye.set(this,document.createElement("feature-app-loader")),Dt.set(this,new I.EventEmitter),fn.set(this,void 0),zn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),jt.set(this,void 0),_n.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:_e,container:ot,name:Je})=>{Je==="error"&&_e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,h.__classPrivateFieldGet)(this,Ye,"f").style.display=_e==="hidden"?"unset":"hidden"}),(0,h.__classPrivateFieldSet)(this,_n,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,h.__classPrivateFieldGet)(this,Dt,"f")},"f"),(0,h.__classPrivateFieldSet)(this,fn,(0,h.__classPrivateFieldGet)(this,Fe,"m",br).bind(this),"f"),(0,h.__classPrivateFieldSet)(this,zn,(0,h.__classPrivateFieldGet)(this,Fe,"m",mn).bind(this),"f"),(0,h.__classPrivateFieldSet)(this,et,(0,h.__classPrivateFieldGet)(this,Fe,"m",fr).call(this,"error"),"f"),(0,h.__classPrivateFieldSet)(this,Rt,(0,h.__classPrivateFieldGet)(this,Fe,"m",fr).call(this,"loading"),"f")}connectedCallback(){return(0,h.__awaiter)(this,void 0,void 0,function*(){(0,h.__classPrivateFieldGet)(this,et,"f").call(this,(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.get("error")),(0,h.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.get("loading")),(0,h.__classPrivateFieldGet)(this,_n,"f").slots.addEventListener("visibilitychange",(0,h.__classPrivateFieldGet)(this,zn,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.addChangeListener("error",(0,h.__classPrivateFieldGet)(this,et,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.addChangeListener("loading",(0,h.__classPrivateFieldGet)(this,Rt,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlot("error")}(0,h.__classPrivateFieldSet)(this,Ot,this.id||(0,h.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,h.__classPrivateFieldSet)(this,Qe,new T((0,h.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,h.__classPrivateFieldGet)(this,Qe,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,h.__classPrivateFieldGet)(this,fn,"f").call(this):(window.bwell.once("initialized",(0,h.__classPrivateFieldGet)(this,fn,"f")),window.bwell.once("error",()=>{(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlot("error")}),Xe&&(0,p.h)(Kt).catch(()=>{(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,h.__classPrivateFieldGet)(this,Dt,"f").emit("disconnect"),(0,h.__classPrivateFieldGet)(this,_n,"f").slots.removeEventListener("visibilitychange",(0,h.__classPrivateFieldGet)(this,zn,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.removeChangeListener("error",(0,h.__classPrivateFieldGet)(this,et,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.removeChangeListener("loading",(0,h.__classPrivateFieldGet)(this,Rt,"f")),(It=(0,h.__classPrivateFieldGet)(this,Qe,"f"))===null||It===void 0||It.deregister(),(0,h.__classPrivateFieldGet)(this,Dt,"f").removeAllListeners()}}Ot=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Dt=new WeakMap,fn=new WeakMap,zn=new WeakMap,et=new WeakMap,Rt=new WeakMap,jt=new WeakMap,_n=new WeakMap,Fe=new WeakSet,br=function(){(0,h.__classPrivateFieldGet)(this,Ye,"f").setAttribute("featureAppId",`bwell-embeddable:${Bn}`),(0,h.__classPrivateFieldGet)(this,Ye,"f").setAttribute("src",Kt),(0,h.__classPrivateFieldGet)(this,Ye,"f").config={id:(0,h.__classPrivateFieldGet)(this,Ot,"f"),name:Gt,elementName:Bn,utils:(0,h.__classPrivateFieldGet)(this,_n,"f")},this.shadowRoot.appendChild((0,h.__classPrivateFieldGet)(this,Ye,"f"))},mn=function({visibility:It,name:_e}){(0,h.__classPrivateFieldGet)(this,Ye,"f").style.display=It==="hidden"?"unset":"hidden"},Dn=function(It){(0,h.__classPrivateFieldGet)(this,jt,"f")(),(0,h.__classPrivateFieldSet)(this,jt,void 0,"f")},fr=function(It){return _e=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.get(tt)!==null)){if(_e!==null)(0,h.__classPrivateFieldGet)(this,jt,"f")&&(0,h.__classPrivateFieldGet)(this,Fe,"m",Dn).call(this,It),(0,h.__classPrivateFieldSet)(this,jt,(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlotLocked(xe[It]),"f");else if(_e===null&&(0,h.__classPrivateFieldGet)(this,jt,"f")){(0,h.__classPrivateFieldGet)(this,Fe,"m",Dn).call(this,It);const tt=Ie.find(rt=>(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.get(rt)!==null);tt&&(0,h.__classPrivateFieldSet)(this,jt,(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Bn,Zr)}),it={rE:"1.1135.1"},gt="composite";var Et=e(67321);$e({src:`https://embeddables.prod.icanbwell.com/${gt}/${it.rE}/scripts/embeddable.federated.js`,elementNameSuffix:gt,version:it.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,g=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,A=(h,p,f)=>p in h?i(h,p,{enumerable:!0,configurable:!0,writable:!0,value:f}):h[p]=f,m=(h,p)=>{for(var f in p||(p={}))u.call(p,f)&&A(h,f,p[f]);if(c)for(var f of c(p))E.call(p,f)&&A(h,f,p[f]);return h},d=(h,p)=>a(h,g(p));const O=(h,p,f)=>{const b=_.cloneDeep(h);if(!b.contained||p<0)return b;const M=b.contained.findIndex(x=>x.resourceType==="Questionnaire");if(M!==-1&&!f){const x=b.contained[M];if(x.item){if(!x.item.some(C=>isPageExtensionPresent(C)))return b;let T=0,S=x.item.length;for(let C=0;C<x.item.length;C++){const y=x.item[C];if(isPageExtensionPresent(y)){if(T===p+1){S=C;break}T++}}x.item=x.item.slice(0,S),b.contained[M]=x}}else f&&M!==-1&&(b.contained[M]=d(m({},b.contained[M]),{item:f}));return b},v=({formId:h,questionnaireResponse:p,showQuestionPrefix:f,nextQuestion:b,onGoBack:M,handleHiddenQuestion:x,errorConfig:z,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:y,onFormDataChange:R,externalComponentRenderMap:P,className:L,children:D})=>{var w,N,V;const{currentGroupIndex:q,hasCustomError:I}=useFHIRQuestionnaire(),k=(w=p.questionnaire)==null?void 0:w.replace("#",""),U=(N=p?.contained)==null?void 0:N.find(K=>K.id===k&&K.resourceType==="Questionnaire"),F=(K,G,se)=>{let oe=_.cloneDeep(p);oe.item=K,oe=trimQuestionnaireItems(oe,q,se),b(oe,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,L),children:jsx(FHIRQuestionnaire,{formId:h,onFormDataChange:R,questionnaireResponseItem:(V=p?.item)!=null?V:[],questionnaireSchema:U,status:p.status,showQuestionPrefix:f,errorConfig:z,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:T,handleHiddenQuestion:x,showStepper:C,hideBackButton:y,externalComponentRenderMap:P,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,E=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},h=(M,x)=>u(M,E(x)),p=(M,x,z)=>new Promise((T,S)=>{var C=P=>{try{R(z.next(P))}catch(L){S(L)}},y=P=>{try{R(z.throw(P))}catch(L){S(L)}},R=P=>P.done?T(P.value):Promise.resolve(P.value).then(C,y);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:y,errorText:R})=>{const P=(0,a.Ul)(),{i18n:{t:L},loading:D}=(0,g.E_)({keys:["shared-translations"]}),w=x?.placeId,N=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,oe]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Gt=>{var St,Xe;const Fe=(Xe=(St=Gt.placeAutocomplete)==null?void 0:St.predictions)==null?void 0:Xe.map(Ot=>{var Qe;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Qe=Ot.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(Fe?.length?Fe:pe)}}),De=(0,t.useMemo)(()=>be.map(Gt=>h(v({},Gt),{displayLabel:(0,r.RZ)(Gt?.label||"",V)})),[V,be]),ze=Gt=>p(void 0,null,function*(){var St,Xe,Fe,Ot,Qe,Ye,Dt,fn,zn,et,Rt,jt,_n,br,mn,Dn;if(F(Gt),G(Gt),oe(!1),Gt&&typeof Gt=="string"){const fr=be.find(tt=>tt.id===Gt),Bn=fr?.label||V;if(!fr)return;q(Bn),k(Bn),setTimeout(()=>{const tt=[{id:fr.id,label:fr.label}];Se(tt),ne(tt)},f);const Zr=yield ae({variables:{placeId:Gt}}),jr=(Xe=(St=Zr?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(Fe=Zr?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ot.longitude,_e=((Ye=(Qe=Zr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((fn=(Dt=Zr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:fn.state)||"",Je=((et=(zn=Zr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(jr&&It)if(!_e||!Je){const tt=yield ce({variables:{latitude:String(jr),longitude:String(It)}}),rt=((jt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:jt.zipCode)||"",lt=((br=(_n=tt?.data)==null?void 0:_n.geocodingByLatLon)==null?void 0:br.state)||"",zt=((Dn=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Dn.stateCode)||"";T({latitude:jr,longitude:It,zipCode:rt,state:lt,stateCode:zt,placeId:Gt,description:Bn,value:Gt})}else T({latitude:jr,longitude:It,zipCode:_e,state:ot,stateCode:Je,placeId:Gt,description:Bn,value:Gt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Gt=>p(void 0,null,function*(){return yield J({variables:{input:Gt,types:"geocode"}})})),$e=Gt=>p(void 0,null,function*(){if(oe(!1),q(Gt),z?.(Gt),!Gt||Gt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Gt});return}const St=Gt.trim();St.length>=2?yield xe(St):Se(pe)}),it=Gt=>{te.current=Gt},gt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>p(void 0,null,function*(){var St,Xe,Fe,Ot,Qe,Ye,Dt,fn,zn,et,Rt,jt,_n,br,mn,Dn;if(w&&N){Se([{id:w,label:V||N}]),ne([{id:w,label:V||N}]),F(w),G(w),q(N),k(N),N===V&&q(N);const fr=yield ae({variables:{placeId:w}}),Bn=(Xe=(St=fr?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Xe.latitude,Zr=(Ot=(Fe=fr?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ot.longitude,jr=((Ye=(Qe=fr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",It=((fn=(Dt=fr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:fn.state)||"",_e=((et=(zn=fr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Bn&&Zr)if(!jr||!It||!_e){const ot=yield ce({variables:{latitude:String(Bn),longitude:String(Zr)}}),Je=((jt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:jt.zipCode)||"",tt=((br=(_n=ot?.data)==null?void 0:_n.geocodingByLatLon)==null?void 0:br.state)||"",rt=((Dn=(mn=ot?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Dn.stateCode)||"";T({latitude:Bn,longitude:Zr,zipCode:Je,state:tt,stateCode:rt,placeId:w,description:N,value:w})}else T({latitude:Bn,longitude:Zr,zipCode:jr,state:It,stateCode:_e,placeId:w,description:N,value:w})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const Et=se||!!he||!!re||!!Ee||!!R,Kt=Et?R||L("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{y&&y(me||ue||D)},[y,me,ue,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:L("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:$e,defaultFilter:Ie,onOpenChange:it,onBlur:gt,isInvalid:Et,hint:Kt,autoComplete:"address-line1",className:"w-full",children:Gt=>{const St=Gt,Xe=V.trim().length>=2,Fe=St.mainText||"",Ot=St.secondaryText||"",Qe=Fe.trim().length>0,Ye=Ot.trim().length>0,Dt=Qe?(0,r.RZ)(Fe,V):{beforePart:"",highlightedPart:"",remainingPart:""},fn=Ye?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:St.id,supportingText:St.supportingText,isDisabled:St.isDisabled,icon:St.icon,avatarUrl:St.avatarUrl,textValue:St.label,children:Xe&&Qe?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Dt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Dt.highlightedPart}),(0,n.jsx)("span",{children:Dt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:fn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:fn.highlightedPart}),(0,n.jsx)("span",{children:fn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:St.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:i})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(52449);const i=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:E}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),h=c.getRouteMeta(v)||{},p=getBreadcrumbTitleKey(v,h,u);if(!p||h.breadcrumbHide)return[];const f=E[v];let b=c.getHref(v),M=p;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(y,R)=>new Promise((P,L)=>setTimeout(()=>L(new Error(R)),y)),u=(y,R,P)=>Promise.race([y,c(R,P)]),E=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(y,R,P)=>R in y?m(y,R,{enumerable:!0,configurable:!0,writable:!0,value:P}):y[R]=P,b=(y,R)=>{for(var P in R||(R={}))h.call(R,P)&&f(y,P,R[P]);if(v)for(var P of v(R))p.call(R,P)&&f(y,P,R[P]);return y},M=(y,R)=>d(y,O(R)),x=(y,R,P)=>new Promise((L,D)=>{var w=q=>{try{V(P.next(q))}catch(I){D(I)}},N=q=>{try{V(P.throw(q))}catch(I){D(I)}},V=q=>q.done?L(q.value):Promise.resolve(q.value).then(w,N);V((P=P.apply(y,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),C=({children:y})=>{var R;const{mobileOS:P}=(0,r.useDeviceDetection)(),L=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:w,setQueryParams:N}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(w);(0,t.useEffect)(()=>{q.current=w},[w]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=w.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{N(M(b({},q.current),{locationPermission:ve||i.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?L?.error(Ee,"Failed to update query params"):L?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[N,L]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking geolocation availability"):L?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,L]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,E,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&L?.error(De,"Geolocation timeout or error"),De}}),[D,L]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),E,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return L?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==i.Ef.GRANTED&&Ee!==i.Ef.PROMPT?(L?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location services"):L?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,L,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=w.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!0)):te(Ie)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error getting initial location with granted permission"):L?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error getting initial location"):L?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?L?.error(De,"Error initializing location permission"):L?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(P==="Android"&&Ee===i.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?L?.error(De,"Error re-requesting Android permission"):L?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.Ef.UNAVAILABLE),ve instanceof Error?L?.error(ve,"Error refreshing location"):L?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,L,P,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location permission"):L?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,L,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?L?.error(ve,"Error checking and setting location permission"):L?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,L,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||L?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||L?.error(`Error requesting location - ${Ee}`)}te(i.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,L,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),N(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?L?.error(ve,"Error requesting current location"):L?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,L,N,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&N(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?L?.error(ve,"Error overriding search settings"):L?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[L,U,ae,N]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),y]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>lt,GI:()=>be,rz:()=>et,Fp:()=>zn,el:()=>fn,ao:()=>Dt,oA:()=>D,Yt:()=>zt,g4:()=>Ye,tn:()=>Ue,n4:()=>w,gD:()=>L,Vp:()=>tt,Cx:()=>k,bK:()=>q,gi:()=>rt,Z$:()=>he,GT:()=>Je,hr:()=>ce,JL:()=>ue,Ck:()=>I,dU:()=>V,wG:()=>fr,hZ:()=>mn,$e:()=>Rt,qT:()=>br,GQ:()=>_n,q3:()=>Dn,D_:()=>jt,Uf:()=>F,_l:()=>ge,Md:()=>se,V7:()=>G,fe:()=>ae,JP:()=>At,Z_:()=>N,zO:()=>me,UZ:()=>te,$7:()=>Xe,rb:()=>K,_W:()=>Ot,WS:()=>Fe,VF:()=>_e,vf:()=>Zr,PV:()=>ot,PS:()=>Bn,Iz:()=>It,zD:()=>oe,m3:()=>Et,XP:()=>Kt,PM:()=>De,cX:()=>re,G6:()=>J,Us:()=>Ie,AA:()=>Ee,G0:()=>gt,mO:()=>$e,HH:()=>ze,PU:()=>ye,it:()=>St,Tl:()=>it,uH:()=>Gt,c3:()=>ve,rx:()=>P});var n=e(36087),t=e(14041);const r=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));a.displayName="UserX01";const g=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));g.displayName="Users01";const c=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),E=e(22716),A=e(9495);const m=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const v=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const h=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));h.displayName="CreditCard02";const p=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));p.displayName="Link03";var f=e(85418);const b=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));b.displayName="ClipboardCheck";const M=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));M.displayName="ClipboardPlus";const x=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 7c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.121-2.122C13.395 3 12.93 3 12 3c-.93 0-1.395 0-1.777.102a3 3 0 0 0-2.12 2.122C8 5.605 8 6.07 8 7M5.2 21h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 19.48 22 18.92 22 17.8v-7.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 7 19.92 7 18.8 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 21 4.08 21 5.2 21Z"}));z.displayName="Briefcase01";const T=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12.913 17h7.174m-7.174 0L11 21m1.913-4 2.865-5.991c.231-.483.347-.724.505-.8a.5.5 0 0 1 .434 0c.158.076.274.317.505.8L20.087 17m0 0L22 21M2 5h6m0 0h3.5M8 5V3m3.5 2H14m-2.5 0c-.496 2.957-1.647 5.636-3.334 7.884M10 14a9.396 9.396 0 0 1-1.834-1.116m0 0C6.813 11.848 5.603 10.427 5 9m3.166 3.884A17.295 17.295 0 0 1 2 18"}));T.displayName="Translate01";const S=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 8.502a2.248 2.248 0 0 1 4.37.75c0 1.499-2.25 2.248-2.25 2.248m.03 3h.01M9.9 19.2l1.46 1.947c.217.29.326.434.459.486a.5.5 0 0 0 .362 0c.133-.052.242-.197.459-.486L14.1 19.2c.293-.39.44-.586.619-.735a2 2 0 0 1 .822-.412c.226-.053.47-.053.959-.053 1.398 0 2.097 0 2.648-.228a3 3 0 0 0 1.624-1.624C21 15.597 21 14.898 21 13.5V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v5.7c0 1.398 0 2.097.228 2.648a3 3 0 0 0 1.624 1.624C5.403 18 6.102 18 7.5 18c.489 0 .733 0 .96.053a2 2 0 0 1 .821.412c.18.149.326.344.619.735Z"}));S.displayName="AnnotationQuestion";const C=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M15 2.458A9.996 9.996 0 0 0 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.715-.432-3.33-1.193-4.74M17 5.75h.005M10.5 21.888v-2.203a.5.5 0 0 1 .12-.325l2.486-2.9a.5.5 0 0 0-.131-.76l-2.857-1.632a.499.499 0 0 1-.186-.187L8.07 10.62a.5.5 0 0 0-.478-.25l-5.528.492M21 6c0 2.21-2 4-4 6-2-2-4-3.79-4-6a4 4 0 0 1 8 0Zm-3.75-.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0Z"}));C.displayName="Globe05";const y=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));y.displayName="Shield01";const R=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M21 15v1.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V15m14-7-5-5m0 0L7 8m5-5v12"}));R.displayName="Upload01";const P=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,L="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",w="http://hl7.org/fhir/questionnaire-item-control",N="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",q="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",k="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",F="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",K="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",G="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",se="http://hl7.org/fhir/StructureDefinition/entryFormat",oe="http://hl7.org/fhir/StructureDefinition/tz-code",te="tz-code",pe="footer",be="check-box",Se="header",ge="page",ne="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ae="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",he=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],ce={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ue={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},re="ui-toolkit/CoordinatePicker",J="ui-toolkit/DetailsInfo",ve="ui-toolkit/ServiceChoice",Ee="ui-toolkit/InfoBanner",De="ui-toolkit/Button",ze="ui-toolkit/Phone",Ie="ui-toolkit/ErrorCard",xe="ui-toolkit/FormContainer",$e="ui-toolkit/PageHeader",it="ui-toolkit/SelectableOption",gt="ui-toolkit/Modal",Et="ui-toolkit/Alert",Kt="ui-toolkit/AppSectionAccess",Gt="ui-toolkit/SensitiveDataCategory",St="ui-toolkit/QuestCard",Xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",Fe="http://icanbwell.com/fhir/StructureDefinition/text-align",Ot={LEFT:"left",CENTER:"center"},Qe={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Ye="http://icanbwell.com/fhir/StructureDefinition/icon-name",Dt="http://icanbwell.com/fhir/StructureDefinition/error-title",fn="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",zn="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",et="http://icanbwell.com/fhir/StructureDefinition/description",Rt="http://icanbwell.com/fhir/StructureDefinition/modal-description",jt="http://icanbwell.com/fhir/StructureDefinition/modal-title",_n="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",br="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",mn="http://icanbwell.com/fhir/StructureDefinition/button-text",Dn="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",fr="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Bn="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Zr="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",jr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",It="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",_e="http://icanbwell.com/fhir/StructureDefinition/trigger-color",ot="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Je="http://hl7.org/fhir/StructureDefinition/mimeType",tt="http://hl7.org/fhir/StructureDefinition/maxSize",rt="http://icanbwell.com/fhir/StructureDefinition/message-severity",lt="http://icanbwell.com/fhir/StructureDefinition/alert-color",zt="http://icanbwell.com/fhir/StructureDefinition/hideLabel",st="http://icanbwell.com/fhir/StructureDefinition/placeholder",le="http://icanbwell.com/fhir/StructureDefinition/hint-text",ye="ui-toolkit/PrefilledMemberDemographicsAlert",Ue="http://hl7.org/fhir/issue-severity",Te="http://icanbwell.com/fhir/StructureDefinition/button-type",Tt="http://icanbwell.com/fhir/StructureDefinition/button-action",Zt="button-type",vn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",Hn="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",vr="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Wt="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",we="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Ze={},At={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":E.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":h,"link-03":p,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x,"briefcase-01":z,"translate-01":T,"annotation-question":S,"globe-05":C,"shield-01":y,"upload-01":R}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>w,$O:()=>gt,CP:()=>jt,Fy:()=>Rt,GN:()=>be,J4:()=>lt,MU:()=>G,Nw:()=>ot,Qr:()=>C,Ue:()=>zt,Yo:()=>Ee,a0:()=>T,cz:()=>y,di:()=>I,eC:()=>st,iI:()=>k,lv:()=>q,mR:()=>vn,nt:()=>S,od:()=>V,t7:()=>Et,u0:()=>x,yQ:()=>Zt,zj:()=>ue});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),g=e(45250),c=e.n(g),u=e(16681),E=e(18807),A=e(1053),m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(Lt,Ct,bt)=>Ct in Lt?m(Lt,Ct,{enumerable:!0,configurable:!0,writable:!0,value:bt}):Lt[Ct]=bt,b=(Lt,Ct)=>{for(var bt in Ct||(Ct={}))h.call(Ct,bt)&&f(Lt,bt,Ct[bt]);if(v)for(var bt of v(Ct))p.call(Ct,bt)&&f(Lt,bt,Ct[bt]);return Lt},M=(Lt,Ct)=>d(Lt,O(Ct));const x=(Lt,Ct,bt,Ut)=>{if(Lt){const hn=Lt(Ct,b({defaultValue:bt},Ut));if(hn&&hn!==Ct)return hn}return Ut?Object.entries(Ut).reduce((hn,[Tn,Mr])=>hn.replace(`{{${Tn}}}`,String(Mr)),bt):bt},z=Lt=>{var Ct;return(Ct=Lt.filter(bt=>bt.url.includes("questionnaire-itemControl")).flatMap(bt=>{var Ut,hn;return(hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)!=null?hn:[]}).find(bt=>{var Ut;return(Ut=bt.code)==null?void 0:Ut.startsWith("ui-toolkit/")}))==null?void 0:Ct.code},T=Lt=>{var Ct;const bt=(Ct=Lt.extension)==null?void 0:Ct.find(Ut=>Ut.url===A.V7);return bt?.valueCode||"off"},S=(Lt,Ct,bt)=>{const Ut=(0,E.A)(bt);return Lt&&Ct&&bt?Ut.replace("<p>",`<span>${Ct} `).replace("</p>","</span>").trim():Ut.replace("<p>","<span>").replace("</p>","</span>").trim()},C=Lt=>{const Ct=Lt?.find(bt=>bt.url===A.Vp);return Ct?.valueInteger},y=Lt=>{const Ct=Lt?.find(bt=>bt.url===A.Z_);return Ct?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},P="Type your response here...",L=(Lt,Ct)=>{const bt=Lt?.find(Ut=>Ut.url===PLACEHOLDER_EXTENSION_URL);return bt?.valueString||Ct&&R[Ct]||P},D=Lt=>{const Ct=Lt?.find(bt=>bt.url===HINT_TEXT_EXTENSION_URL);return Ct?.valueString},w=Lt=>{const Ct=Lt?.filter(bt=>bt.url===A.GT&&bt.valueCode).map(bt=>A.hr[bt.valueCode]||bt.valueCode);return Ct?.length?Ct.join(","):void 0},N=Lt=>Lt.split(",").map(Ut=>Ut.trim()).map(Ut=>A.JL[Ut]||Ut).filter((Ut,hn,Tn)=>Tn.indexOf(Ut)===hn).join(", "),V=(Lt,Ct,bt)=>{const Ut=N(Lt),hn=Ut.lastIndexOf(","),Tn=hn!==-1?`${Ut.substring(0,hn)} or${Ut.substring(hn+1)}`:Ut,Mr=[Ct&&`max. ${(Ct/(1e3*1e3)).toFixed(0)}MB`,bt&&`upto ${bt} file${bt>1?"s":""}`].filter(Boolean);return Mr.length>0?`${Tn} (${Mr.join(", ")})`:Tn},q=Lt=>{const Ct=Lt?.find(bt=>bt?.url===A.zD||bt?.url===A.UZ);return Ct?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(Lt,Ct)=>{var bt,Ut,hn;const Tn=Ct?.find(Mr=>Mr.url.includes(Lt));return(hn=(Ut=(bt=Tn?.valueInteger)!=null?bt:Tn?.valueDecimal)!=null?Ut:Tn?.valueString)!=null?hn:Tn?.valueDate},k=Lt=>{if(!!Lt){if(/^\d{4}-\d{2}-\d{2}$/.test(Lt))return Lt;try{const Ct=(0,i.evaluate)({},Lt);if(Array.isArray(Ct)&&Ct.length>0){const bt=Ct[0];if(bt instanceof Date&&!isNaN(bt.getTime())){const Ut=bt.getFullYear(),hn=String(bt.getMonth()+1).padStart(2,"0"),Tn=String(bt.getDate()).padStart(2,"0");return`${Ut}-${hn}-${Tn}`}if(typeof bt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(bt))return bt}}catch{}}},U=(Lt,Ct)=>{var bt,Ut;const hn=Ct?.find(Mr=>Mr.url===Lt);if(!hn)return;const Tn=(bt=hn.valueString)!=null?bt:hn.valueDate;return Tn||k((Ut=hn.valueExpression)==null?void 0:Ut.expression)},F=(Lt,Ct)=>{if(!(!Lt||Lt.length===0))for(const bt of Lt){const Ut=I(Ct,bt.extension);if(Ut!==void 0)return Ut;if(bt.item&&bt.item.length>0){const hn=F(bt.item,Ct);if(hn!==void 0)return hn}}},K=(Lt,Ct)=>{try{const bt=String(Lt??Ct);let Ut;if(bt.includes("/"))Ut=(0,n.A)(bt,"MM/dd/yyyy",new Date);else{const hn=bt.split("T")[0];Ut=(0,t.A)(hn)}return(0,r.A)(Ut)}catch(bt){return console.error("Date parsing error:",bt,Lt),null}},G=(Lt,Ct)=>{var bt;for(const Ut of Lt){if(Ut.linkId===Ct)return Ut;if((bt=Ut.item)!=null&&bt.length){const hn=G(Ut.item,Ct);if(hn!==void 0)return hn}}},se=(Lt,Ct)=>{var bt;const Ut=[];for(const hn of Lt)if(hn.linkId===Ct&&Ut.push(hn),(bt=hn.item)!=null&&bt.length){const Tn=se(hn.item,Ct);Ut.push(...Tn)}return Ut},oe=(Lt,Ct,bt=0)=>se(Lt,Ct)[bt];function te(Lt){return Lt!=null}const pe=(Lt,Ct)=>{var bt,Ut,hn;if("answerString"in Lt&&te(Lt.answerString)){if(Lt.operator==="=")return Ct?.valueString===Lt.answerString;if(Lt.operator==="!=")return Ct?.valueString!==Lt.answerString}if("answerBoolean"in Lt&&te(Lt.answerBoolean)){if(Lt.operator==="=")return Ct?.valueBoolean===Lt.answerBoolean;if(Lt.operator==="!=")return Ct?.valueBoolean!==Lt.answerBoolean}if("answerInteger"in Lt&&te(Lt.answerInteger)||"answerDecimal"in Lt&&te(Lt.answerDecimal)){const Tn=Number(Ct?.valueInteger||Ct?.valueDecimal),Mr=Number(Lt.answerInteger||Lt.answerDecimal);if(Lt.operator==="=")return Tn===Mr;if(Lt.operator==="!=")return Tn!==Mr;if(Lt.operator===">")return Tn>Mr;if(Lt.operator==="<")return Tn<Mr;if(Lt.operator===">=")return Tn>=Mr;if(Lt.operator==="<=")return Tn<=Mr}if("answerQuantity"in Lt&&te(Lt.answerQuantity)){const Tn=Ct?.valueQuantity,Mr=Lt.answerQuantity;if(Tn?.unit!==Mr?.unit)return!1;if(Lt.operator==="=")return Tn.value===Mr.value;if(Lt.operator==="!=")return Tn.value!==Mr.value;if(Lt.operator===">")return Tn.value>Mr.value;if(Lt.operator==="<")return Tn.value<Mr.value;if(Lt.operator===">=")return Tn.value>=Mr.value;if(Lt.operator==="<=")return Tn.value<=Mr.value}if("answerCoding"in Lt&&te(Lt.answerCoding)){const Tn=Ct?.valueCoding,Mr=Lt.answerCoding;if(Lt.operator==="=")return Tn?.code===Mr.code;if(Lt.operator==="!=")return Tn?.code!==Mr.code}if("answerReference"in Lt&&te(Lt.answerReference)){const Tn=Ct?.valueReference,Mr=Lt.answerReference;if(Lt.operator==="=")return Tn?.reference===Mr.reference;if(Lt.operator==="!=")return Tn?.reference!==Mr.reference}if("answerDate"in Lt&&te(Lt.answerDate)||"answerDateTime"in Lt&&te(Lt.answerDateTime)||"answerTime"in Lt&&te(Lt.answerTime)){const Tn=new Date((hn=(Ut=(bt=Ct?.valueDate)!=null?bt:Ct?.valueDateTime)!=null?Ut:Ct?.valueTime)!=null?hn:""),Mr=new Date(Lt.answerDate||Lt.answerDateTime||Lt.answerTime||"");if(Lt.operator==="=")return Tn.getTime()===Mr.getTime();if(Lt.operator==="!=")return Tn.getTime()!==Mr.getTime();if(Lt.operator===">")return Tn.getTime()>Mr.getTime();if(Lt.operator==="<")return Tn.getTime()<Mr.getTime();if(Lt.operator===">=")return Tn.getTime()>=Mr.getTime();if(Lt.operator==="<=")return Tn.getTime()<=Mr.getTime()}return Lt.operator==="exists"?Ct!=null===Lt.answerBoolean:!0},be=(Lt,Ct,bt)=>{const Ut=hn=>{const Tn=se(bt,hn.question);return Tn.length===0||Tn.every(Mr=>!Mr.answer||Mr.answer.length===0)?pe(hn,void 0):Tn.some(Mr=>{var Cn;return(Cn=Mr.answer)==null?void 0:Cn.some(gn=>pe(hn,gn&&Object.keys(gn).length>0?gn:void 0))})};return Lt&&Lt?.length>0?Ct==="any"?Lt?.some(hn=>Ut(hn)):Lt?.every(hn=>Ut(hn)):!0},Se=(Lt,Ct,bt,Ut,hn)=>{if(!Lt||Lt.length===0)return!0;const Tn=Mr=>{var Cn;let gn;if(Ut&&typeof hn=="number"){const Mt=bt.filter(Pt=>Pt.linkId===Ut)[hn];if(Mt?.item){const Pt=Mt.item.find(Ht=>Ht.linkId===Mr.question);if(Pt?.answer&&Pt.answer.length>0)return(Cn=Pt?.answer)==null?void 0:Cn.some(Ht=>pe(Mr,Ht&&Object.keys(Ht).length>0?Ht:void 0))}}if(!gn){const rn=se(bt,Mr.question);if(rn.length>0)return rn.some(Mt=>{var Pt;return(Pt=Mt.answer)==null?void 0:Pt.some(Ht=>pe(Mr,Ht&&Object.keys(Ht).length>0?Ht:void 0))});gn=void 0}return pe(Mr,gn)};return Ct==="any"?Lt.some(Mr=>Tn(Mr)):Lt.every(Mr=>Tn(Mr))},ge=(Lt,Ct)=>{var bt;if(!!((bt=Lt?.valueExpression)!=null&&bt.expression))try{const Ut=evaluate(Ct,Lt.valueExpression.expression);return Array.isArray(Ut)?Ut.some(hn=>Boolean(hn)):Boolean(Ut)}catch{return}},ne=(Lt,Ct)=>{var bt;const Ut=(bt=Lt.extension)==null?void 0:bt.find(Tn=>Tn.url===READ_ONLY_EXPRESSION_EXTENSION_URL),hn=ge(Ut,Ct);return M(b({},Lt),{readOnly:hn??Lt.readOnly})},ae=(Lt,Ct,bt,Ut)=>{const{required:hn,maxLength:Tn,type:Mr,extension:Cn,enableWhen:gn,enableBehavior:rn,repeats:Mt,answerOption:Pt}=Lt;if(!be(gn,rn,Ct)||Lt.type==="group"||Lt.type==="display")return"";if(Mt)return me(Lt,Ct,bt,Ut);const Ht=re(Lt,Ct);return Ht&&J(Ht,Lt)?ve(Lt,Ct,bt,Ht,Ut):ue(Cn,Mr,hn,Tn,bt,Pt,Ut)},me=(Lt,Ct,bt,Ut)=>{const{required:hn}=Lt;if(hn){if(!bt||bt.length===0)return x(Ut,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let Tn=!1;for(let Mr=0;Mr<bt.length;Mr++){const Cn=bt[Mr];if(Cn&&Object.keys(Cn).length>0&&Object.values(Cn).some(rn=>rn!=null&&rn!==""&&(Array.isArray(rn)?rn.length>0:!0))){Tn=!0;const rn=ue(Lt.extension,Lt.type,!0,Lt.maxLength,[Cn],Lt.answerOption,Ut);if(rn)return x(Ut,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Mr+1,error:rn});if(Lt.item&&Lt.item.length>0){const Mt=he(Lt.item,Ct,Lt.linkId,Mr,Ut);if(Mt)return x(Ut,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Mr+1,error:Mt})}}else return x(Ut,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:Mr+1})}if(!Tn)return x(Ut,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(bt&&bt.length>0)for(let Tn=0;Tn<bt.length;Tn++){const Mr=bt[Tn];if(Mr&&Object.keys(Mr).length>0&&Object.values(Mr).some(gn=>gn!=null&&gn!==""&&(Array.isArray(gn)?gn.length>0:!0))){const gn=ue(Lt.extension,Lt.type,!1,Lt.maxLength,[Mr],Lt.answerOption,Ut);if(gn)return x(Ut,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Tn+1,error:gn});if(Lt.item&&Lt.item.length>0){const rn=he(Lt.item,Ct,Lt.linkId,Tn,Ut);if(rn)return x(Ut,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Tn+1,error:rn})}}}return""},he=(Lt,Ct,bt,Ut,hn)=>{var Tn,Mr;for(const Cn of Lt){if(!Se(Cn.enableWhen,Cn.enableBehavior,Ct,bt,Ut))continue;const gn=G(Ct,bt),rn=(Tn=gn?.item)==null?void 0:Tn.find(Pt=>Pt.linkId===Cn.linkId),Mt=(Mr=rn?.answer)!=null&&Mr[Ut]?[rn.answer[Ut]]:void 0;if(Cn.required){if(!Mt||!Mt[0]||!ce(Mt[0]))return x(hn,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Cn.text||Cn.linkId});const Pt=ue(Cn.extension,Cn.type,!0,Cn.maxLength,Mt,Cn.answerOption,hn);if(Pt)return`${Cn.text||Cn.linkId}: ${Pt}`}else if(Mt&&Mt[0]&&ce(Mt[0])){const Pt=ue(Cn.extension,Cn.type,!1,Cn.maxLength,Mt,Cn.answerOption,hn);if(Pt)return`${Cn.text||Cn.linkId}: ${Pt}`}if(Cn.item&&Cn.item.length>0){const Pt=he(Cn.item,Ct,Cn.linkId,Ut,hn);if(Pt)return Pt}}return""},ce=Lt=>!Lt||Object.keys(Lt).length===0?!1:Object.values(Lt).some(Ct=>Ct!=null&&Ct!==""&&(Array.isArray(Ct)?Ct.length>0:!0)),ue=(Lt,Ct,bt,Ut,hn,Tn,Mr)=>{var Cn,gn,rn,Mt,Pt;let Ht="";const un=!!Lt?.find(Lr=>{var Fr,p0;return Lr.url===A.gD&&((p0=(Fr=Lr.valueCodeableConcept)==null?void 0:Fr.coding)==null?void 0:p0.some(Mo=>Mo.system===A.n4&&Mo.code===A.GI))}),Jt=hn?.[0],Sn={choice:((Cn=Jt?.valueCoding)==null?void 0:Cn.code)||(Jt?.valueString&&Tn?.some(Lr=>Lr.valueString===Jt.valueString)?Jt.valueString:null),"open-choice":((gn=Jt?.valueCoding)==null?void 0:gn.code)||Jt?.valueString,boolean:Jt?.valueBoolean,string:Jt?.valueString,text:Jt?.valueString,url:Jt?.valueUri,integer:Jt?.valueInteger,decimal:Jt?.valueDecimal,dateTime:Jt?.valueDateTime,date:Jt?.valueDate,time:Jt?.valueTime,quantity:(rn=Jt?.valueQuantity)==null?void 0:rn.value,reference:(Mt=Jt?.valueReference)==null?void 0:Mt.display,attachment:(Pt=Jt?.valueAttachment)==null?void 0:Pt.title};if(!(Ct in Sn))return"";const jn=Sn[Ct],$r={required:()=>bt&&(jn==null||jn===""||jn==="NaN"||Number.isNaN(jn)||Ct==="boolean"&&jn!==!0&&un)?x(Mr,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Ut&&jn!==null&&jn!==void 0&&jn.toString().length>Ut?x(Mr,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:Ut}):"",minLength:()=>{const Lr=I("minLength",Lt);return Lr&&jn!==null&&jn!==void 0&&jn.toString().length<Number(Lr)?x(Mr,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:Lr}):""},urlRegex:()=>{const Lr=new RegExp(A.rx),Fr=I("regexError",Lt),p0=Fr??x(Mr,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return Lr&&Ct==="url"&&jn&&!Lr.test(jn)?String(p0):""},regex:()=>{const Lr=I("regex",Lt);if(!Lr||typeof jn!="string")return"";const Fr=new RegExp(Lr),p0=I("regexError",Lt),Mo=p0??x(Mr,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Fr&&jn&&!Fr.test(jn)?String(Mo):""},dateTime:()=>{if(Ct==="dateTime"&&jn){const Lr=jn?.toString(),Fr=new Date(Lr);return isNaN(Fr.getTime())?x(Mr,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(Ct!=="date"||!jn)return"";const Lr=jn.replace(/\D/g,"");return Lr.length>0&&Lr.length<8||isNaN(new Date(jn).getTime())?x(Mr,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var Lr;if(Ct==="date"){const p0=U(A.dU,Lt),Mo=K(p0??"01/01/1900","01/01/1900"),N0=K(jn,"");if(!Mo||!N0)return"";if((0,s.A)(N0,Mo)){const ro=(Lr=Lt?.find(W0=>W0.url===A.Ck))==null?void 0:Lr.valueString;return ro??x(Mr,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:p0??"01/01/1900"})}return""}const Fr=I("minValue",Lt);return Fr!=null&&jn!==null&&jn!==void 0&&jn<Fr?x(Mr,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Fr}):""},maxValue:()=>{var Lr;if(Ct==="date"){const p0=U(A.bK,Lt),Mo=K(p0??"01/01/2100","01/01/2100"),N0=K(jn,"");if(!Mo||!N0)return"";if((0,o.A)(N0,Mo)){const ro=(Lr=Lt?.find(W0=>W0.url===A.Cx))==null?void 0:Lr.valueString;return ro??x(Mr,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:p0??"01/01/2100"})}return""}const Fr=I("maxValue",Lt);return Fr!=null&&jn!==null&&jn!==void 0&&jn>Fr?x(Mr,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:Fr}):""}};return Ht=$r.required()||$r.maxLength()||$r.minLength()||$r.urlRegex()||$r.regex()||$r.dateTime()||$r.date()||$r.minValue()||$r.maxValue()||"",Ht},re=(Lt,Ct)=>{for(const bt of Ct)if(bt.item){if(bt.item.find(Tn=>Tn.linkId===Lt.linkId))return bt;const hn=re(Lt,bt.item);if(hn)return hn}return null},J=(Lt,Ct)=>{if(Lt.answer&&Lt.answer.length>1)return!0;if(Lt.item){const bt=Lt.item.find(Ut=>Ut.linkId===Ct.linkId);if(bt&&bt.answer&&bt.answer.length>1)return!0}return!1},ve=(Lt,Ct,bt,Ut,hn)=>{var Tn,Mr;const{required:Cn}=Lt,gn=(Tn=Ut.item)==null?void 0:Tn.find(Pt=>Pt.linkId===Lt.linkId),rn=gn?.answer||[],Mt=((Mr=Ut.answer)==null?void 0:Mr.length)||1;for(let Pt=0;Pt<Mt;Pt++){const Ht=rn[Pt];if(Cn){if(!Ht||!ce(Ht))return x(hn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:x(hn,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Lt.text||Lt.linkId})});const un=ue(Lt.extension,Lt.type,!0,Lt.maxLength,[Ht],Lt.answerOption,hn);if(un)return x(hn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:un})}else if(Ht&&ce(Ht)){const un=ue(Lt.extension,Lt.type,!1,Lt.maxLength,[Ht],Lt.answerOption,hn);if(un)return x(hn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:un})}}return""},Ee=(Lt,Ct)=>{for(const bt of Lt){if(bt?.linkId===Ct)return bt;if(bt?.item&&bt.item.length>0){const Ut=Ee(bt.item,Ct);if(Ut)return Ut}}},De=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>{var Ut,hn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)==null?void 0:hn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===FOOTER_CODE))}))},ze=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>bt.url===A.oA&&bt.valueBoolean))},Ie=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>{var Ut,hn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)==null?void 0:hn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===HEADER_CODE))}))},xe=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>{var Ut,hn;return bt.url===A.gD&&((hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)==null?void 0:hn.some(Tn=>Tn.system===A.n4&&Tn.code===A._l))}))},$e=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>bt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&bt.valueBoolean))},it=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>{var Ut,hn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)==null?void 0:hn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===CHECKBOX_CODE))}))},gt=Lt=>{var Ct;const bt=(Ct=Lt.extension)==null?void 0:Ct.find(Ut=>Ut.url===A.fe);return bt?.valueInteger},Et=Lt=>{var Ct;const bt=(Ct=Lt.extension)==null?void 0:Ct.find(Ut=>Ut.url===A.zO);return bt?.valueInteger},Kt=Lt=>{var Ct;const bt=(Ct=Lt?.extension)==null?void 0:Ct.find(Ut=>Ut.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return bt?.valueInteger},Gt=(Lt,Ct,bt,Ut,hn,Tn)=>{const Mr=gn=>Ct.filter(rn=>rn.linkId===gn),Cn=new Set;return Lt.map(gn=>{if(Cn.has(gn.linkId)||De(gn))return null;const Mt=Mr(gn.linkId),Pt=gn.type==="group"&&gn.repeats;if(Cn.add(gn.linkId),Pt){const Ht=[];if(Mt.forEach((un,Jt)=>{const Sn={linkId:gn.linkId,text:gn.text};let jn;if(bt===gn.linkId&&typeof Tn=="number"&&Tn===Jt&&hn&&hn.length>0){const $r=un?.item||[];jn=[...$r],hn.forEach(Lr=>{const Fr=jn.findIndex(p0=>p0.linkId===Lr.linkId);Fr>=0?jn[Fr]=M(b({},$r[Fr]),{answer:Lr.answer}):jn.push(Lr)})}else gn.item&&(jn=Gt(gn.item,un?.item||[],bt,Ut,hn,Jt));bt===gn.linkId&&typeof Tn=="number"&&Tn===Jt&&Ut?Sn.answer=Ut:Sn.answer=un.answer||[{}],jn&&jn.length>0?Sn.item=jn:un.item&&(Sn.item=un.item),Ht.push(Sn)}),bt===gn.linkId&&typeof Tn=="number"&&Tn>=Mt.length)for(let un=Mt.length;un<=Tn;un++){const Jt={linkId:gn.linkId,text:gn.text,answer:un===Tn&&Ut?Ut:[{}]};un===Tn&&hn&&hn.length>0?Jt.item=hn:gn.item&&(Jt.item=Gt(gn.item,[],void 0,void 0,void 0,void 0)),Ht.push(Jt)}return Ht}else if(gn.repeats&&typeof Tn=="number"&&bt===gn.linkId){const Ht=Mt[0]||{linkId:gn.linkId,text:gn.text,answer:[]},un={linkId:gn.linkId,text:gn.text,answer:[...Ht.answer||[]]};if(Ut&&Ut.length>0){for(;un.answer.length<=Tn;)un.answer.push({});un.answer[Tn]=Ut[0]}return un}else{const Ht=Mt[0],un=gn.item?Gt(gn.item,Ht?.item||[],bt,Ut,hn,Tn):void 0,Jt=un&&un.length>0,Sn={linkId:gn.linkId,text:gn.text};return bt&&gn.linkId===bt&&typeof Tn!="number"?(Ut||!Ut&&!hn?Sn.answer=Ut:Ht?.answer&&(Sn.answer=Ht.answer),hn?Sn.item=hn:Jt&&(Sn.item=un)):(Ht?.answer?Sn.answer=Ht.answer:Sn.answer=[{}],Jt&&(Sn.item=un)),Sn}}).filter(Boolean).flat()},St=(Lt,Ct)=>{for(const bt of Lt)if(bt.linkId===Ct||bt.item&&St(bt.item,Ct))return bt.linkId;return null},Xe=(Lt,Ct,bt,Ut)=>{var hn;const Tn=(hn=Lt?.item)!=null?hn:Ut;return!Tn||Tn.length===0?!0:Tn.every(Mr=>{var Cn;const gn=se(Ct,Mr.linkId);if(gn.length===0){const rn=(Cn=G(Ct,Mr.linkId))==null?void 0:Cn.answer;if(ae(Mr,Ct,rn)&&be(Mr.enableWhen,Mr.enableBehavior,Ct)&&bt.includes(Mr.linkId))return!1}else for(const rn of gn)if(ae(Mr,Ct,rn.answer)&&be(Mr.enableWhen,Mr.enableBehavior,Ct)&&bt.includes(Mr.linkId))return!1;return Mr.item?Xe(Mr,Ct,bt):!0})},Fe=(Lt,Ct,bt=!0)=>{for(const Ut of Lt)if(Ut.linkId===Ct&&Ut.answer&&Ut.answer.length>0||Ut.item&&Ut.item.length>0&&Fe(Ut.item,Ct,bt))return!0;return!1},Ot=(Lt,Ct,bt=0)=>{const Ut=Lt.filter(hn=>hn.linkId===Ct);if(Ut.length>bt){const hn=Ut[bt];if(hn.answer&&hn.answer.length>0)return hn.answer.some(Tn=>Tn&&Object.keys(Tn).length>0&&Object.values(Tn).some(Mr=>Mr!=null&&Mr!==""));if(hn.item&&hn.item.length>0)return Fe(hn.item,Ct,!1)}return Fe(Lt,Ct,!1)},Qe=(Lt,Ct)=>{if(!Lt||!Lt.item)return!1;const bt=Ut=>{var hn;if(ze(Ut)&&Ut.required&&be(Ut.enableWhen,Ut.enableBehavior,Ct)){const Tn=G(Ct,Ut.linkId),Mr=ue(Ut.extension,Ut.type,Ut.required,Ut.maxLength,Tn?.answer,Ut.answerOption);if(!((hn=Tn?.answer)!=null&&hn.length)||Mr)return!0}if(Ut.item){for(const Tn of Ut.item)if(bt(Tn))return!0}return!1};for(const Ut of Lt.item)if(bt(Ut))return!0;return!1},Ye=Lt=>{var Ct,bt,Ut;if(Lt.valueString!==void 0)return Lt.valueString;if(Lt.valueBoolean!==void 0)return Lt.valueBoolean;if(Lt.valueInteger!==void 0)return Lt.valueInteger;if(Lt.valueDecimal!==void 0)return Lt.valueDecimal;if(Lt.valueDate!==void 0)return Lt.valueDate;if(Lt.valueDateTime!==void 0)return Lt.valueDateTime;if(((Ct=Lt.valueCoding)==null?void 0:Ct.code)!==void 0)return Lt.valueCoding.code;if(((bt=Lt.valueReference)==null?void 0:bt.reference)!==void 0)return Lt.valueReference.reference;if(((Ut=Lt.valueQuantity)==null?void 0:Ut.value)!==void 0)return Lt.valueQuantity.value;if(Lt.valueAttachment!==void 0)return Lt.valueAttachment},Dt=Lt=>{const Ct={linkId:Lt.linkId};if(Lt.answer&&Lt.answer.length>0){const bt=Lt.answer.map(Ut=>Ye(Ut)).filter(Ut=>Ut!==void 0);bt.length>0&&(Ct.answer=bt)}if(Lt.item&&Lt.item.length>0){const bt=Lt.item.map(Ut=>Dt(Ut)).filter(Ut=>{const hn=Object.keys(Ut);return hn.length>1||hn.length===1&&hn[0]!=="linkId"});bt.length>0&&(Ct.item=bt)}return Ct},fn=(Lt,Ct,bt,Ut,hn,Tn)=>{var Mr;const Cn=(Mr=Ct?.item)==null?void 0:Mr[bt[Ut]],gn=Cn?.linkId;if(!gn)return!1;const rn=se(Lt,gn),Mt=se(hn,gn),Pt=Ht=>{if(Ht!=null){if(Array.isArray(Ht)){const un=Ht.filter(Jt=>Jt!=null).map(Jt=>Pt(Jt)).filter(Jt=>Jt!==void 0);return un.length===0||un.length===1&&typeof un[0]=="object"&&Object.keys(un[0]).length===0?void 0:un}if(typeof Ht=="object"){const un={};for(const[Jt,Sn]of Object.entries(Ht))if(Sn!=null){const jn=Pt(Sn);jn!==void 0&&(un[Jt]=jn)}return Object.keys(un).length===0?void 0:un}return Ht}};if(rn.length!==Mt.length)return!1;for(let Ht=0;Ht<rn.length;Ht++){const un=rn[Ht],Jt=Mt[Ht];if(!un||!Jt)return!1;const Sn=Dt(Pt(un)),jn=Dt(Pt(Jt));if(!_.isEqual(Sn,jn))return!1}return Ut!==Tn},zn=(Lt,Ct,bt,Ut)=>bt&&bt.length>0&&!(bt.length===1&&Object.keys(bt[0]).length===0)&&ae(Lt,Ct,bt,Ut)||null,et=(Lt,Ct,bt)=>{const Ut={},hn=Tn=>{Tn.forEach(Mr=>{const Cn=se(Ct,Mr.linkId);if(ye(Mr,Lt)||Mr.repeats)for(let gn=0;gn<Cn.length;gn++){const rn=Cn[gn];if(rn?.answer&&rn.answer.length>0){const Mt=zn(Mr,Ct,rn.answer,bt);Mt&&(Ut[Mr.linkId]=M(b({},Ut[Mr.linkId]),{[gn]:Mt}))}}else{const gn=G(Ct,Mr.linkId);if(gn?.answer&&gn.answer.length>0){const rn=zn(Mr,Ct,gn.answer,bt);rn&&(Ut[Mr.linkId]={0:rn})}}Mr.item&&Mr.item.length>0&&hn(Mr.item)})};return hn(Lt),Ut},Rt=Lt=>{if(!Lt)return"";const Ct=Lt.split("-");if(Ct.length===3){const[bt,Ut,hn]=Ct;return`${bt.slice(-4)}-${Ut}-${hn}`}return""},jt=Lt=>Lt.trim().replace(/[A-Za-z]+/g,""),_n=(Lt,Ct)=>{const bt=(Ut,hn)=>{for(const Tn of Ut){if(Tn.linkId===hn)return Tn.answer;if(Tn.item&&Tn.item.length>0){const Mr=bt(Tn.item,hn);if(Mr!==void 0)return Mr}}};return bt(Lt,Ct)},br=(Lt,Ct)=>{if(!Ct||Ct.length===0)return null;const bt=Lt.linkId,Ut=(hn,Tn,Mr=[])=>{for(const Cn of hn){const gn=[...Mr,Cn];if(Cn.item){if(Cn.item.some(Pt=>Pt.linkId===Tn))return gn.some(Pt=>Pt.repeats===!0)?Cn:null;if(Ut(Cn.item,Tn,gn))return Cn}}return null};return Ut(Ct,bt)},mn=(Lt,Ct)=>{if(!Ct||Ct.length===0)return!1;const bt=Lt.linkId,Ut=(hn,Tn,Mr=[])=>{for(const Cn of hn){const gn=[...Mr,Cn];if(Cn.item){if(Cn.item.some(Pt=>Pt.linkId===Tn))return gn.some(Pt=>{const Ht=z(Pt.extension||[]);return!!Ht&&Ht!==UI_TOOLKIT_FORM_CONTAINER});if(Ut(Cn.item,Tn,gn))return!0}}return!1};return Ut(Ct,bt)},Dn=(Lt,Ct,bt)=>{const Ut={};if(!Lt)return Ut;const{linkId:hn}=Ct;if(Lt[hn]){const Tn=Lt[hn];Ut[hn]=Tn[bt]||""}return Ct.item&&Ct.item.length>0&&Ct.item.forEach(Tn=>{if(Lt[Tn.linkId]){const Mr=Lt[Tn.linkId];Ut[Tn.linkId]=Mr[bt]||""}}),Ut},fr=(Lt,Ct)=>{const bt={};if(!Lt||!Lt[Ct])return bt;const Ut=Lt[Ct];return bt[Ct]=Ut[0]||"",bt},Bn=Lt=>{const Ct=Lt.findIndex(Tn=>!ze(Tn)),bt=Ct>=0?[Ct]:[],Ut=new Map;let hn=null;if(Lt.forEach((Tn,Mr)=>{const Cn=xe(Tn);if(Cn&&Tn.type==="group")Mr!==Ct&&bt.push(Mr),Ut.set(Mr,[Mr]),hn=Mr;else if(hn!==null&&!Cn){const gn=Ut.get(hn)||[];Ut.set(hn,[...gn,Mr])}}),Lt.length>0&&bt.length>0){const Tn=bt[0];if(!Ut.has(Tn)){const Mr=bt.find(gn=>gn>Tn),Cn=[];for(let gn=Tn;gn<(Mr??Lt.length);gn++)Cn.push(gn);Ut.set(Tn,Cn)}}return{groupIndices:bt,itemsToRenderMap:Ut}},Zr=(Lt,Ct,bt,Ut)=>{let hn=[...Ut];const Tn=(Mr,Cn)=>{Mr.forEach(gn=>{if((!gn?.enableWhen||be(gn?.enableWhen,gn.enableBehavior,Cn))&&gn.initial&&!Fe(Cn,gn.linkId))if(gn.repeats){const rn=Cn.filter(Mt=>Mt.linkId===gn.linkId);rn.length>0?rn.forEach((Mt,Pt)=>{Ot(Cn,gn.linkId,Pt)||(hn=Gt(bt,hn,gn.linkId,gn.initial,void 0,Pt))}):hn=Gt(bt,hn,gn.linkId,gn.initial)}else hn=Gt(bt,hn,gn.linkId,gn.initial);gn.item&&Tn(gn.item,Cn)})};return Tn(Lt,Ct),hn},jr=(Lt,Ct,bt)=>{if(!Lt)return[];const Ut=[],hn=Tn=>{Tn.required===Ct&&be(Tn.enableWhen,Tn.enableBehavior,bt)&&!ze(Tn)&&Tn.type!=="display"&&Ut.push(Tn),Tn.item&&Tn.item.length>0&&Tn.item.forEach(hn)};return Lt.forEach(hn),Ut},It=(Lt,Ct)=>Lt.every(bt=>{var Ut;const hn=se(Ct,bt.linkId);if(hn.length>0)return hn.every(Tn=>!ae(bt,Ct,Tn.answer));{const Tn=(Ut=G(Ct,bt.linkId))==null?void 0:Ut.answer;return!ae(bt,Ct,Tn)}}),_e=(Lt,Ct)=>{let bt=-1;for(let Ut=Lt.length-1;Ut>=0;Ut--)if(Lt[Ut].linkId===Ct){bt=Ut;break}return bt},ot=(Lt,Ct)=>Lt.filter(bt=>bt.linkId!==Ct).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:ot(bt.item,Ct)}):bt),Je=(Lt,Ct,bt=Lt)=>Lt.reduce((Ut,hn)=>{const Tn=Ee(Ct,hn.linkId);return Tn?.enableWhen&&!be(Tn.enableWhen,Tn.enableBehavior,bt)||(hn.item&&hn.item.length>0?Ut.push(M(b({},hn),{item:Je(hn.item,Ct,bt)})):Ut.push(hn)),Ut},[]),tt=(Lt,Ct,bt=[])=>{const Ut=[],hn=Tn=>{Tn.forEach(Mr=>{Ut.push(Mr.linkId),Mr.item&&Mr.item.length>0&&hn(Mr.item)})};for(let Tn=0;Tn<Lt.length;Tn++){const Mr=Lt[Tn];if(Mr.linkId===Ct){const Cn=Lt.slice(0,Tn+1),gn=Lt.slice(Tn+1),{kept:rn,removed:Mt}=gn.reduce((Pt,Ht)=>{const un=Ee(bt,Ht.linkId);return!un||ze(un)&&be(un.enableWhen,un.enableBehavior,Cn)?Pt.kept.push(Ht):Pt.removed.push(Ht),Pt},{kept:[],removed:[]});return hn(Mt),{trimmedData:[...Cn,...rn],trimmedLinkIds:Ut,found:!0}}if(Mr.item&&Mr.item.length>0){const Cn=tt(Mr.item,Ct,bt);if(Cn.found){const gn=Lt.slice(0,Tn),rn=Lt.slice(Tn+1),Mt=[...gn,M(b({},Mr),{item:Cn.trimmedData})],{kept:Pt,removed:Ht}=rn.reduce((un,Jt)=>{const Sn=Ee(bt,Jt.linkId);return!Sn||ze(Sn)&&be(Sn.enableWhen,Sn.enableBehavior,Mt)?un.kept.push(Jt):un.removed.push(Jt),un},{kept:[],removed:[]});return hn(Ht),{trimmedData:[...Mt,...Pt],trimmedLinkIds:[...Cn.trimmedLinkIds,...Ut],found:!0}}}}return{trimmedData:Lt,trimmedLinkIds:[],found:!1}},rt=(Lt,Ct)=>Lt.filter(bt=>!Ct.includes(bt.linkId)).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:rt(bt.item,Ct)}):bt),lt=Lt=>{var Ct;if(!Lt)return"empty";const bt=A.Z$.find(({patterns:Ut})=>Ut.some(hn=>Lt.includes(hn)));return(Ct=bt?.type)!=null?Ct:"empty"},zt=(Lt,Ct)=>{const{groupIndices:bt}=Bn(Lt),Ut=Lt.findIndex(hn=>hn.linkId===Ct);return Ut!==-1?bt.indexOf(Ut):-1},st=Lt=>{if(!Lt)return{restriction:null,warning:null};const Ct=bt=>{const Ut=Lt.find(Tn=>Tn.url===bt&&Tn.valueString);if(!Ut?.valueString)return null;const hn=Ut.valueString.replace(/\\n/g,`
869
+ `}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},$e=({src:Kt,elementNameSuffix:Gt,version:St,prefetchFeatureApp:Xe})=>(0,h.__awaiter)(void 0,void 0,void 0,function*(){var Fe,Ot,Qe,Ye,Dt,fn,zn,et,Rt,jt,_n,br,mn,Dn,fr;window.bwell||(window.bwell=new re({metadata:{version:St}}));const Bn=`bwell-${Gt}`;if(customElements.get(Bn)!==void 0)return;class Zr extends f{constructor(){super(),Fe.add(this),Ot.set(this,(0,S.nanoid)()),Qe.set(this,void 0),Ye.set(this,document.createElement("feature-app-loader")),Dt.set(this,new I.EventEmitter),fn.set(this,void 0),zn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),jt.set(this,void 0),_n.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:_e,container:ot,name:Je})=>{Je==="error"&&_e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,h.__classPrivateFieldGet)(this,Ye,"f").style.display=_e==="hidden"?"unset":"hidden"}),(0,h.__classPrivateFieldSet)(this,_n,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,h.__classPrivateFieldGet)(this,Dt,"f")},"f"),(0,h.__classPrivateFieldSet)(this,fn,(0,h.__classPrivateFieldGet)(this,Fe,"m",br).bind(this),"f"),(0,h.__classPrivateFieldSet)(this,zn,(0,h.__classPrivateFieldGet)(this,Fe,"m",mn).bind(this),"f"),(0,h.__classPrivateFieldSet)(this,et,(0,h.__classPrivateFieldGet)(this,Fe,"m",fr).call(this,"error"),"f"),(0,h.__classPrivateFieldSet)(this,Rt,(0,h.__classPrivateFieldGet)(this,Fe,"m",fr).call(this,"loading"),"f")}connectedCallback(){return(0,h.__awaiter)(this,void 0,void 0,function*(){(0,h.__classPrivateFieldGet)(this,et,"f").call(this,(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.get("error")),(0,h.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.get("loading")),(0,h.__classPrivateFieldGet)(this,_n,"f").slots.addEventListener("visibilitychange",(0,h.__classPrivateFieldGet)(this,zn,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.addChangeListener("error",(0,h.__classPrivateFieldGet)(this,et,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.addChangeListener("loading",(0,h.__classPrivateFieldGet)(this,Rt,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlot("error")}(0,h.__classPrivateFieldSet)(this,Ot,this.id||(0,h.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,h.__classPrivateFieldSet)(this,Qe,new T((0,h.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,h.__classPrivateFieldGet)(this,Qe,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,h.__classPrivateFieldGet)(this,fn,"f").call(this):(window.bwell.once("initialized",(0,h.__classPrivateFieldGet)(this,fn,"f")),window.bwell.once("error",()=>{(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlot("error")}),Xe&&(0,p.h)(Kt).catch(()=>{(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,h.__classPrivateFieldGet)(this,Dt,"f").emit("disconnect"),(0,h.__classPrivateFieldGet)(this,_n,"f").slots.removeEventListener("visibilitychange",(0,h.__classPrivateFieldGet)(this,zn,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.removeChangeListener("error",(0,h.__classPrivateFieldGet)(this,et,"f")),(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.removeChangeListener("loading",(0,h.__classPrivateFieldGet)(this,Rt,"f")),(It=(0,h.__classPrivateFieldGet)(this,Qe,"f"))===null||It===void 0||It.deregister(),(0,h.__classPrivateFieldGet)(this,Dt,"f").removeAllListeners()}}Ot=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Dt=new WeakMap,fn=new WeakMap,zn=new WeakMap,et=new WeakMap,Rt=new WeakMap,jt=new WeakMap,_n=new WeakMap,Fe=new WeakSet,br=function(){(0,h.__classPrivateFieldGet)(this,Ye,"f").setAttribute("featureAppId",`bwell-embeddable:${Bn}`),(0,h.__classPrivateFieldGet)(this,Ye,"f").setAttribute("src",Kt),(0,h.__classPrivateFieldGet)(this,Ye,"f").config={id:(0,h.__classPrivateFieldGet)(this,Ot,"f"),name:Gt,elementName:Bn,utils:(0,h.__classPrivateFieldGet)(this,_n,"f")},this.shadowRoot.appendChild((0,h.__classPrivateFieldGet)(this,Ye,"f"))},mn=function({visibility:It,name:_e}){(0,h.__classPrivateFieldGet)(this,Ye,"f").style.display=It==="hidden"?"unset":"hidden"},Dn=function(It){(0,h.__classPrivateFieldGet)(this,jt,"f")(),(0,h.__classPrivateFieldSet)(this,jt,void 0,"f")},fr=function(It){return _e=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.get(tt)!==null)){if(_e!==null)(0,h.__classPrivateFieldGet)(this,jt,"f")&&(0,h.__classPrivateFieldGet)(this,Fe,"m",Dn).call(this,It),(0,h.__classPrivateFieldSet)(this,jt,(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlotLocked(xe[It]),"f");else if(_e===null&&(0,h.__classPrivateFieldGet)(this,jt,"f")){(0,h.__classPrivateFieldGet)(this,Fe,"m",Dn).call(this,It);const tt=Ie.find(rt=>(0,h.__classPrivateFieldGet)(this,_n,"f").attributes.get(rt)!==null);tt&&(0,h.__classPrivateFieldSet)(this,jt,(0,h.__classPrivateFieldGet)(this,_n,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Bn,Zr)}),it={rE:"1.1136.0"},gt="composite";var Et=e(67321);$e({src:`https://embeddables.prod.icanbwell.com/${gt}/${it.rE}/scripts/embeddable.federated.js`,elementNameSuffix:gt,version:it.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,g=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,A=(h,p,f)=>p in h?i(h,p,{enumerable:!0,configurable:!0,writable:!0,value:f}):h[p]=f,m=(h,p)=>{for(var f in p||(p={}))u.call(p,f)&&A(h,f,p[f]);if(c)for(var f of c(p))E.call(p,f)&&A(h,f,p[f]);return h},d=(h,p)=>a(h,g(p));const O=(h,p,f)=>{const b=_.cloneDeep(h);if(!b.contained||p<0)return b;const M=b.contained.findIndex(x=>x.resourceType==="Questionnaire");if(M!==-1&&!f){const x=b.contained[M];if(x.item){if(!x.item.some(C=>isPageExtensionPresent(C)))return b;let T=0,S=x.item.length;for(let C=0;C<x.item.length;C++){const y=x.item[C];if(isPageExtensionPresent(y)){if(T===p+1){S=C;break}T++}}x.item=x.item.slice(0,S),b.contained[M]=x}}else f&&M!==-1&&(b.contained[M]=d(m({},b.contained[M]),{item:f}));return b},v=({formId:h,questionnaireResponse:p,showQuestionPrefix:f,nextQuestion:b,onGoBack:M,handleHiddenQuestion:x,errorConfig:z,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:y,onFormDataChange:R,externalComponentRenderMap:P,className:L,children:D})=>{var w,N,V;const{currentGroupIndex:q,hasCustomError:I}=useFHIRQuestionnaire(),k=(w=p.questionnaire)==null?void 0:w.replace("#",""),U=(N=p?.contained)==null?void 0:N.find(K=>K.id===k&&K.resourceType==="Questionnaire"),F=(K,G,se)=>{let oe=_.cloneDeep(p);oe.item=K,oe=trimQuestionnaireItems(oe,q,se),b(oe,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,L),children:jsx(FHIRQuestionnaire,{formId:h,onFormDataChange:R,questionnaireResponseItem:(V=p?.item)!=null?V:[],questionnaireSchema:U,status:p.status,showQuestionPrefix:f,errorConfig:z,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:T,handleHiddenQuestion:x,showStepper:C,hideBackButton:y,externalComponentRenderMap:P,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,E=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},h=(M,x)=>u(M,E(x)),p=(M,x,z)=>new Promise((T,S)=>{var C=P=>{try{R(z.next(P))}catch(L){S(L)}},y=P=>{try{R(z.throw(P))}catch(L){S(L)}},R=P=>P.done?T(P.value):Promise.resolve(P.value).then(C,y);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:y,errorText:R})=>{const P=(0,a.Ul)(),{i18n:{t:L},loading:D}=(0,g.E_)({keys:["shared-translations"]}),w=x?.placeId,N=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,oe]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Gt=>{var St,Xe;const Fe=(Xe=(St=Gt.placeAutocomplete)==null?void 0:St.predictions)==null?void 0:Xe.map(Ot=>{var Qe;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Qe=Ot.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(Fe?.length?Fe:pe)}}),De=(0,t.useMemo)(()=>be.map(Gt=>h(v({},Gt),{displayLabel:(0,r.RZ)(Gt?.label||"",V)})),[V,be]),ze=Gt=>p(void 0,null,function*(){var St,Xe,Fe,Ot,Qe,Ye,Dt,fn,zn,et,Rt,jt,_n,br,mn,Dn;if(F(Gt),G(Gt),oe(!1),Gt&&typeof Gt=="string"){const fr=be.find(tt=>tt.id===Gt),Bn=fr?.label||V;if(!fr)return;q(Bn),k(Bn),setTimeout(()=>{const tt=[{id:fr.id,label:fr.label}];Se(tt),ne(tt)},f);const Zr=yield ae({variables:{placeId:Gt}}),jr=(Xe=(St=Zr?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(Fe=Zr?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ot.longitude,_e=((Ye=(Qe=Zr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((fn=(Dt=Zr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:fn.state)||"",Je=((et=(zn=Zr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(jr&&It)if(!_e||!Je){const tt=yield ce({variables:{latitude:String(jr),longitude:String(It)}}),rt=((jt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:jt.zipCode)||"",lt=((br=(_n=tt?.data)==null?void 0:_n.geocodingByLatLon)==null?void 0:br.state)||"",zt=((Dn=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Dn.stateCode)||"";T({latitude:jr,longitude:It,zipCode:rt,state:lt,stateCode:zt,placeId:Gt,description:Bn,value:Gt})}else T({latitude:jr,longitude:It,zipCode:_e,state:ot,stateCode:Je,placeId:Gt,description:Bn,value:Gt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Gt=>p(void 0,null,function*(){return yield J({variables:{input:Gt,types:"geocode"}})})),$e=Gt=>p(void 0,null,function*(){if(oe(!1),q(Gt),z?.(Gt),!Gt||Gt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Gt});return}const St=Gt.trim();St.length>=2?yield xe(St):Se(pe)}),it=Gt=>{te.current=Gt},gt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>p(void 0,null,function*(){var St,Xe,Fe,Ot,Qe,Ye,Dt,fn,zn,et,Rt,jt,_n,br,mn,Dn;if(w&&N){Se([{id:w,label:V||N}]),ne([{id:w,label:V||N}]),F(w),G(w),q(N),k(N),N===V&&q(N);const fr=yield ae({variables:{placeId:w}}),Bn=(Xe=(St=fr?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Xe.latitude,Zr=(Ot=(Fe=fr?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ot.longitude,jr=((Ye=(Qe=fr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",It=((fn=(Dt=fr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:fn.state)||"",_e=((et=(zn=fr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Bn&&Zr)if(!jr||!It||!_e){const ot=yield ce({variables:{latitude:String(Bn),longitude:String(Zr)}}),Je=((jt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:jt.zipCode)||"",tt=((br=(_n=ot?.data)==null?void 0:_n.geocodingByLatLon)==null?void 0:br.state)||"",rt=((Dn=(mn=ot?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Dn.stateCode)||"";T({latitude:Bn,longitude:Zr,zipCode:Je,state:tt,stateCode:rt,placeId:w,description:N,value:w})}else T({latitude:Bn,longitude:Zr,zipCode:jr,state:It,stateCode:_e,placeId:w,description:N,value:w})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const Et=se||!!he||!!re||!!Ee||!!R,Kt=Et?R||L("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{y&&y(me||ue||D)},[y,me,ue,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:L("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:$e,defaultFilter:Ie,onOpenChange:it,onBlur:gt,isInvalid:Et,hint:Kt,autoComplete:"address-line1",className:"w-full",children:Gt=>{const St=Gt,Xe=V.trim().length>=2,Fe=St.mainText||"",Ot=St.secondaryText||"",Qe=Fe.trim().length>0,Ye=Ot.trim().length>0,Dt=Qe?(0,r.RZ)(Fe,V):{beforePart:"",highlightedPart:"",remainingPart:""},fn=Ye?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:St.id,supportingText:St.supportingText,isDisabled:St.isDisabled,icon:St.icon,avatarUrl:St.avatarUrl,textValue:St.label,children:Xe&&Qe?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Dt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Dt.highlightedPart}),(0,n.jsx)("span",{children:Dt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:fn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:fn.highlightedPart}),(0,n.jsx)("span",{children:fn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:St.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:i})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(52449);const i=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:E}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),h=c.getRouteMeta(v)||{},p=getBreadcrumbTitleKey(v,h,u);if(!p||h.breadcrumbHide)return[];const f=E[v];let b=c.getHref(v),M=p;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(y,R)=>new Promise((P,L)=>setTimeout(()=>L(new Error(R)),y)),u=(y,R,P)=>Promise.race([y,c(R,P)]),E=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(y,R,P)=>R in y?m(y,R,{enumerable:!0,configurable:!0,writable:!0,value:P}):y[R]=P,b=(y,R)=>{for(var P in R||(R={}))h.call(R,P)&&f(y,P,R[P]);if(v)for(var P of v(R))p.call(R,P)&&f(y,P,R[P]);return y},M=(y,R)=>d(y,O(R)),x=(y,R,P)=>new Promise((L,D)=>{var w=q=>{try{V(P.next(q))}catch(I){D(I)}},N=q=>{try{V(P.throw(q))}catch(I){D(I)}},V=q=>q.done?L(q.value):Promise.resolve(q.value).then(w,N);V((P=P.apply(y,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),C=({children:y})=>{var R;const{mobileOS:P}=(0,r.useDeviceDetection)(),L=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:w,setQueryParams:N}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(w);(0,t.useEffect)(()=>{q.current=w},[w]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=w.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{N(M(b({},q.current),{locationPermission:ve||i.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?L?.error(Ee,"Failed to update query params"):L?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[N,L]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking geolocation availability"):L?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,L]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,E,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&L?.error(De,"Geolocation timeout or error"),De}}),[D,L]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),E,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return L?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==i.Ef.GRANTED&&Ee!==i.Ef.PROMPT?(L?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location services"):L?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,L,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=w.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!0)):te(Ie)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error getting initial location with granted permission"):L?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error getting initial location"):L?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?L?.error(De,"Error initializing location permission"):L?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(P==="Android"&&Ee===i.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?L?.error(De,"Error re-requesting Android permission"):L?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.Ef.UNAVAILABLE),ve instanceof Error?L?.error(ve,"Error refreshing location"):L?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,L,P,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location permission"):L?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,L,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?L?.error(ve,"Error checking and setting location permission"):L?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,L,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||L?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||L?.error(`Error requesting location - ${Ee}`)}te(i.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,L,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),N(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?L?.error(ve,"Error requesting current location"):L?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,L,N,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&N(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?L?.error(ve,"Error overriding search settings"):L?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[L,U,ae,N]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),y]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>lt,GI:()=>be,rz:()=>et,Fp:()=>zn,el:()=>fn,ao:()=>Dt,oA:()=>D,Yt:()=>zt,g4:()=>Ye,tn:()=>Ue,n4:()=>w,gD:()=>L,Vp:()=>tt,Cx:()=>k,bK:()=>q,gi:()=>rt,Z$:()=>he,GT:()=>Je,hr:()=>ce,JL:()=>ue,Ck:()=>I,dU:()=>V,wG:()=>fr,hZ:()=>mn,$e:()=>Rt,qT:()=>br,GQ:()=>_n,q3:()=>Dn,D_:()=>jt,Uf:()=>F,_l:()=>ge,Md:()=>se,V7:()=>G,fe:()=>ae,JP:()=>At,Z_:()=>N,zO:()=>me,UZ:()=>te,$7:()=>Xe,rb:()=>K,_W:()=>Ot,WS:()=>Fe,VF:()=>_e,vf:()=>Zr,PV:()=>ot,PS:()=>Bn,Iz:()=>It,zD:()=>oe,m3:()=>Et,XP:()=>Kt,PM:()=>De,cX:()=>re,G6:()=>J,Us:()=>Ie,AA:()=>Ee,G0:()=>gt,mO:()=>$e,HH:()=>ze,PU:()=>ye,it:()=>St,Tl:()=>it,uH:()=>Gt,c3:()=>ve,rx:()=>P});var n=e(36087),t=e(14041);const r=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));a.displayName="UserX01";const g=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));g.displayName="Users01";const c=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),E=e(22716),A=e(9495);const m=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const v=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const h=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));h.displayName="CreditCard02";const p=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));p.displayName="Link03";var f=e(85418);const b=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));b.displayName="ClipboardCheck";const M=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));M.displayName="ClipboardPlus";const x=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 7c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.121-2.122C13.395 3 12.93 3 12 3c-.93 0-1.395 0-1.777.102a3 3 0 0 0-2.12 2.122C8 5.605 8 6.07 8 7M5.2 21h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 19.48 22 18.92 22 17.8v-7.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 7 19.92 7 18.8 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 21 4.08 21 5.2 21Z"}));z.displayName="Briefcase01";const T=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12.913 17h7.174m-7.174 0L11 21m1.913-4 2.865-5.991c.231-.483.347-.724.505-.8a.5.5 0 0 1 .434 0c.158.076.274.317.505.8L20.087 17m0 0L22 21M2 5h6m0 0h3.5M8 5V3m3.5 2H14m-2.5 0c-.496 2.957-1.647 5.636-3.334 7.884M10 14a9.396 9.396 0 0 1-1.834-1.116m0 0C6.813 11.848 5.603 10.427 5 9m3.166 3.884A17.295 17.295 0 0 1 2 18"}));T.displayName="Translate01";const S=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 8.502a2.248 2.248 0 0 1 4.37.75c0 1.499-2.25 2.248-2.25 2.248m.03 3h.01M9.9 19.2l1.46 1.947c.217.29.326.434.459.486a.5.5 0 0 0 .362 0c.133-.052.242-.197.459-.486L14.1 19.2c.293-.39.44-.586.619-.735a2 2 0 0 1 .822-.412c.226-.053.47-.053.959-.053 1.398 0 2.097 0 2.648-.228a3 3 0 0 0 1.624-1.624C21 15.597 21 14.898 21 13.5V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v5.7c0 1.398 0 2.097.228 2.648a3 3 0 0 0 1.624 1.624C5.403 18 6.102 18 7.5 18c.489 0 .733 0 .96.053a2 2 0 0 1 .821.412c.18.149.326.344.619.735Z"}));S.displayName="AnnotationQuestion";const C=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M15 2.458A9.996 9.996 0 0 0 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.715-.432-3.33-1.193-4.74M17 5.75h.005M10.5 21.888v-2.203a.5.5 0 0 1 .12-.325l2.486-2.9a.5.5 0 0 0-.131-.76l-2.857-1.632a.499.499 0 0 1-.186-.187L8.07 10.62a.5.5 0 0 0-.478-.25l-5.528.492M21 6c0 2.21-2 4-4 6-2-2-4-3.79-4-6a4 4 0 0 1 8 0Zm-3.75-.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0Z"}));C.displayName="Globe05";const y=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));y.displayName="Shield01";const R=({size:kt=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:kt,height:kt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M21 15v1.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V15m14-7-5-5m0 0L7 8m5-5v12"}));R.displayName="Upload01";const P=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,L="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",w="http://hl7.org/fhir/questionnaire-item-control",N="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",q="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",k="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",F="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",K="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",G="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",se="http://hl7.org/fhir/StructureDefinition/entryFormat",oe="http://hl7.org/fhir/StructureDefinition/tz-code",te="tz-code",pe="footer",be="check-box",Se="header",ge="page",ne="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ae="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",he=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],ce={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ue={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},re="ui-toolkit/CoordinatePicker",J="ui-toolkit/DetailsInfo",ve="ui-toolkit/ServiceChoice",Ee="ui-toolkit/InfoBanner",De="ui-toolkit/Button",ze="ui-toolkit/Phone",Ie="ui-toolkit/ErrorCard",xe="ui-toolkit/FormContainer",$e="ui-toolkit/PageHeader",it="ui-toolkit/SelectableOption",gt="ui-toolkit/Modal",Et="ui-toolkit/Alert",Kt="ui-toolkit/AppSectionAccess",Gt="ui-toolkit/SensitiveDataCategory",St="ui-toolkit/QuestCard",Xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",Fe="http://icanbwell.com/fhir/StructureDefinition/text-align",Ot={LEFT:"left",CENTER:"center"},Qe={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Ye="http://icanbwell.com/fhir/StructureDefinition/icon-name",Dt="http://icanbwell.com/fhir/StructureDefinition/error-title",fn="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",zn="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",et="http://icanbwell.com/fhir/StructureDefinition/description",Rt="http://icanbwell.com/fhir/StructureDefinition/modal-description",jt="http://icanbwell.com/fhir/StructureDefinition/modal-title",_n="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",br="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",mn="http://icanbwell.com/fhir/StructureDefinition/button-text",Dn="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",fr="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Bn="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Zr="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",jr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",It="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",_e="http://icanbwell.com/fhir/StructureDefinition/trigger-color",ot="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Je="http://hl7.org/fhir/StructureDefinition/mimeType",tt="http://hl7.org/fhir/StructureDefinition/maxSize",rt="http://icanbwell.com/fhir/StructureDefinition/message-severity",lt="http://icanbwell.com/fhir/StructureDefinition/alert-color",zt="http://icanbwell.com/fhir/StructureDefinition/hideLabel",st="http://icanbwell.com/fhir/StructureDefinition/placeholder",le="http://icanbwell.com/fhir/StructureDefinition/hint-text",ye="ui-toolkit/PrefilledMemberDemographicsAlert",Ue="http://hl7.org/fhir/issue-severity",Te="http://icanbwell.com/fhir/StructureDefinition/button-type",Tt="http://icanbwell.com/fhir/StructureDefinition/button-action",Zt="button-type",vn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",Hn="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",vr="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Wt="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",we="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Ze={},At={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":E.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":h,"link-03":p,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x,"briefcase-01":z,"translate-01":T,"annotation-question":S,"globe-05":C,"shield-01":y,"upload-01":R}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>w,$O:()=>gt,CP:()=>jt,Fy:()=>Rt,GN:()=>be,J4:()=>lt,MU:()=>G,Nw:()=>ot,Qr:()=>C,Ue:()=>zt,Yo:()=>Ee,a0:()=>T,cz:()=>y,di:()=>I,eC:()=>st,iI:()=>k,lv:()=>q,mR:()=>vn,nt:()=>S,od:()=>V,t7:()=>Et,u0:()=>x,yQ:()=>Zt,zj:()=>ue});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),g=e(45250),c=e.n(g),u=e(16681),E=e(18807),A=e(1053),m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(Lt,Ct,bt)=>Ct in Lt?m(Lt,Ct,{enumerable:!0,configurable:!0,writable:!0,value:bt}):Lt[Ct]=bt,b=(Lt,Ct)=>{for(var bt in Ct||(Ct={}))h.call(Ct,bt)&&f(Lt,bt,Ct[bt]);if(v)for(var bt of v(Ct))p.call(Ct,bt)&&f(Lt,bt,Ct[bt]);return Lt},M=(Lt,Ct)=>d(Lt,O(Ct));const x=(Lt,Ct,bt,Ut)=>{if(Lt){const hn=Lt(Ct,b({defaultValue:bt},Ut));if(hn&&hn!==Ct)return hn}return Ut?Object.entries(Ut).reduce((hn,[Tn,Mr])=>hn.replace(`{{${Tn}}}`,String(Mr)),bt):bt},z=Lt=>{var Ct;return(Ct=Lt.filter(bt=>bt.url.includes("questionnaire-itemControl")).flatMap(bt=>{var Ut,hn;return(hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)!=null?hn:[]}).find(bt=>{var Ut;return(Ut=bt.code)==null?void 0:Ut.startsWith("ui-toolkit/")}))==null?void 0:Ct.code},T=Lt=>{var Ct;const bt=(Ct=Lt.extension)==null?void 0:Ct.find(Ut=>Ut.url===A.V7);return bt?.valueCode||"off"},S=(Lt,Ct,bt)=>{const Ut=(0,E.A)(bt);return Lt&&Ct&&bt?Ut.replace("<p>",`<span>${Ct} `).replace("</p>","</span>").trim():Ut.replace("<p>","<span>").replace("</p>","</span>").trim()},C=Lt=>{const Ct=Lt?.find(bt=>bt.url===A.Vp);return Ct?.valueInteger},y=Lt=>{const Ct=Lt?.find(bt=>bt.url===A.Z_);return Ct?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},P="Type your response here...",L=(Lt,Ct)=>{const bt=Lt?.find(Ut=>Ut.url===PLACEHOLDER_EXTENSION_URL);return bt?.valueString||Ct&&R[Ct]||P},D=Lt=>{const Ct=Lt?.find(bt=>bt.url===HINT_TEXT_EXTENSION_URL);return Ct?.valueString},w=Lt=>{const Ct=Lt?.filter(bt=>bt.url===A.GT&&bt.valueCode).map(bt=>A.hr[bt.valueCode]||bt.valueCode);return Ct?.length?Ct.join(","):void 0},N=Lt=>Lt.split(",").map(Ut=>Ut.trim()).map(Ut=>A.JL[Ut]||Ut).filter((Ut,hn,Tn)=>Tn.indexOf(Ut)===hn).join(", "),V=(Lt,Ct,bt)=>{const Ut=N(Lt),hn=Ut.lastIndexOf(","),Tn=hn!==-1?`${Ut.substring(0,hn)} or${Ut.substring(hn+1)}`:Ut,Mr=[Ct&&`max. ${(Ct/(1e3*1e3)).toFixed(0)}MB`,bt&&`upto ${bt} file${bt>1?"s":""}`].filter(Boolean);return Mr.length>0?`${Tn} (${Mr.join(", ")})`:Tn},q=Lt=>{const Ct=Lt?.find(bt=>bt?.url===A.zD||bt?.url===A.UZ);return Ct?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(Lt,Ct)=>{var bt,Ut,hn;const Tn=Ct?.find(Mr=>Mr.url.includes(Lt));return(hn=(Ut=(bt=Tn?.valueInteger)!=null?bt:Tn?.valueDecimal)!=null?Ut:Tn?.valueString)!=null?hn:Tn?.valueDate},k=Lt=>{if(!!Lt){if(/^\d{4}-\d{2}-\d{2}$/.test(Lt))return Lt;try{const Ct=(0,i.evaluate)({},Lt);if(Array.isArray(Ct)&&Ct.length>0){const bt=Ct[0];if(bt instanceof Date&&!isNaN(bt.getTime())){const Ut=bt.getFullYear(),hn=String(bt.getMonth()+1).padStart(2,"0"),Tn=String(bt.getDate()).padStart(2,"0");return`${Ut}-${hn}-${Tn}`}if(typeof bt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(bt))return bt}}catch{}}},U=(Lt,Ct)=>{var bt,Ut;const hn=Ct?.find(Mr=>Mr.url===Lt);if(!hn)return;const Tn=(bt=hn.valueString)!=null?bt:hn.valueDate;return Tn||k((Ut=hn.valueExpression)==null?void 0:Ut.expression)},F=(Lt,Ct)=>{if(!(!Lt||Lt.length===0))for(const bt of Lt){const Ut=I(Ct,bt.extension);if(Ut!==void 0)return Ut;if(bt.item&&bt.item.length>0){const hn=F(bt.item,Ct);if(hn!==void 0)return hn}}},K=(Lt,Ct)=>{try{const bt=String(Lt??Ct);let Ut;if(bt.includes("/"))Ut=(0,n.A)(bt,"MM/dd/yyyy",new Date);else{const hn=bt.split("T")[0];Ut=(0,t.A)(hn)}return(0,r.A)(Ut)}catch(bt){return console.error("Date parsing error:",bt,Lt),null}},G=(Lt,Ct)=>{var bt;for(const Ut of Lt){if(Ut.linkId===Ct)return Ut;if((bt=Ut.item)!=null&&bt.length){const hn=G(Ut.item,Ct);if(hn!==void 0)return hn}}},se=(Lt,Ct)=>{var bt;const Ut=[];for(const hn of Lt)if(hn.linkId===Ct&&Ut.push(hn),(bt=hn.item)!=null&&bt.length){const Tn=se(hn.item,Ct);Ut.push(...Tn)}return Ut},oe=(Lt,Ct,bt=0)=>se(Lt,Ct)[bt];function te(Lt){return Lt!=null}const pe=(Lt,Ct)=>{var bt,Ut,hn;if("answerString"in Lt&&te(Lt.answerString)){if(Lt.operator==="=")return Ct?.valueString===Lt.answerString;if(Lt.operator==="!=")return Ct?.valueString!==Lt.answerString}if("answerBoolean"in Lt&&te(Lt.answerBoolean)){if(Lt.operator==="=")return Ct?.valueBoolean===Lt.answerBoolean;if(Lt.operator==="!=")return Ct?.valueBoolean!==Lt.answerBoolean}if("answerInteger"in Lt&&te(Lt.answerInteger)||"answerDecimal"in Lt&&te(Lt.answerDecimal)){const Tn=Number(Ct?.valueInteger||Ct?.valueDecimal),Mr=Number(Lt.answerInteger||Lt.answerDecimal);if(Lt.operator==="=")return Tn===Mr;if(Lt.operator==="!=")return Tn!==Mr;if(Lt.operator===">")return Tn>Mr;if(Lt.operator==="<")return Tn<Mr;if(Lt.operator===">=")return Tn>=Mr;if(Lt.operator==="<=")return Tn<=Mr}if("answerQuantity"in Lt&&te(Lt.answerQuantity)){const Tn=Ct?.valueQuantity,Mr=Lt.answerQuantity;if(Tn?.unit!==Mr?.unit)return!1;if(Lt.operator==="=")return Tn.value===Mr.value;if(Lt.operator==="!=")return Tn.value!==Mr.value;if(Lt.operator===">")return Tn.value>Mr.value;if(Lt.operator==="<")return Tn.value<Mr.value;if(Lt.operator===">=")return Tn.value>=Mr.value;if(Lt.operator==="<=")return Tn.value<=Mr.value}if("answerCoding"in Lt&&te(Lt.answerCoding)){const Tn=Ct?.valueCoding,Mr=Lt.answerCoding;if(Lt.operator==="=")return Tn?.code===Mr.code;if(Lt.operator==="!=")return Tn?.code!==Mr.code}if("answerReference"in Lt&&te(Lt.answerReference)){const Tn=Ct?.valueReference,Mr=Lt.answerReference;if(Lt.operator==="=")return Tn?.reference===Mr.reference;if(Lt.operator==="!=")return Tn?.reference!==Mr.reference}if("answerDate"in Lt&&te(Lt.answerDate)||"answerDateTime"in Lt&&te(Lt.answerDateTime)||"answerTime"in Lt&&te(Lt.answerTime)){const Tn=new Date((hn=(Ut=(bt=Ct?.valueDate)!=null?bt:Ct?.valueDateTime)!=null?Ut:Ct?.valueTime)!=null?hn:""),Mr=new Date(Lt.answerDate||Lt.answerDateTime||Lt.answerTime||"");if(Lt.operator==="=")return Tn.getTime()===Mr.getTime();if(Lt.operator==="!=")return Tn.getTime()!==Mr.getTime();if(Lt.operator===">")return Tn.getTime()>Mr.getTime();if(Lt.operator==="<")return Tn.getTime()<Mr.getTime();if(Lt.operator===">=")return Tn.getTime()>=Mr.getTime();if(Lt.operator==="<=")return Tn.getTime()<=Mr.getTime()}return Lt.operator==="exists"?Ct!=null===Lt.answerBoolean:!0},be=(Lt,Ct,bt)=>{const Ut=hn=>{const Tn=se(bt,hn.question);return Tn.length===0||Tn.every(Mr=>!Mr.answer||Mr.answer.length===0)?pe(hn,void 0):Tn.some(Mr=>{var Cn;return(Cn=Mr.answer)==null?void 0:Cn.some(gn=>pe(hn,gn&&Object.keys(gn).length>0?gn:void 0))})};return Lt&&Lt?.length>0?Ct==="any"?Lt?.some(hn=>Ut(hn)):Lt?.every(hn=>Ut(hn)):!0},Se=(Lt,Ct,bt,Ut,hn)=>{if(!Lt||Lt.length===0)return!0;const Tn=Mr=>{var Cn;let gn;if(Ut&&typeof hn=="number"){const Mt=bt.filter(Pt=>Pt.linkId===Ut)[hn];if(Mt?.item){const Pt=Mt.item.find(Ht=>Ht.linkId===Mr.question);if(Pt?.answer&&Pt.answer.length>0)return(Cn=Pt?.answer)==null?void 0:Cn.some(Ht=>pe(Mr,Ht&&Object.keys(Ht).length>0?Ht:void 0))}}if(!gn){const rn=se(bt,Mr.question);if(rn.length>0)return rn.some(Mt=>{var Pt;return(Pt=Mt.answer)==null?void 0:Pt.some(Ht=>pe(Mr,Ht&&Object.keys(Ht).length>0?Ht:void 0))});gn=void 0}return pe(Mr,gn)};return Ct==="any"?Lt.some(Mr=>Tn(Mr)):Lt.every(Mr=>Tn(Mr))},ge=(Lt,Ct)=>{var bt;if(!!((bt=Lt?.valueExpression)!=null&&bt.expression))try{const Ut=evaluate(Ct,Lt.valueExpression.expression);return Array.isArray(Ut)?Ut.some(hn=>Boolean(hn)):Boolean(Ut)}catch{return}},ne=(Lt,Ct)=>{var bt;const Ut=(bt=Lt.extension)==null?void 0:bt.find(Tn=>Tn.url===READ_ONLY_EXPRESSION_EXTENSION_URL),hn=ge(Ut,Ct);return M(b({},Lt),{readOnly:hn??Lt.readOnly})},ae=(Lt,Ct,bt,Ut)=>{const{required:hn,maxLength:Tn,type:Mr,extension:Cn,enableWhen:gn,enableBehavior:rn,repeats:Mt,answerOption:Pt}=Lt;if(!be(gn,rn,Ct)||Lt.type==="group"||Lt.type==="display")return"";if(Mt)return me(Lt,Ct,bt,Ut);const Ht=re(Lt,Ct);return Ht&&J(Ht,Lt)?ve(Lt,Ct,bt,Ht,Ut):ue(Cn,Mr,hn,Tn,bt,Pt,Ut)},me=(Lt,Ct,bt,Ut)=>{const{required:hn}=Lt;if(hn){if(!bt||bt.length===0)return x(Ut,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let Tn=!1;for(let Mr=0;Mr<bt.length;Mr++){const Cn=bt[Mr];if(Cn&&Object.keys(Cn).length>0&&Object.values(Cn).some(rn=>rn!=null&&rn!==""&&(Array.isArray(rn)?rn.length>0:!0))){Tn=!0;const rn=ue(Lt.extension,Lt.type,!0,Lt.maxLength,[Cn],Lt.answerOption,Ut);if(rn)return x(Ut,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Mr+1,error:rn});if(Lt.item&&Lt.item.length>0){const Mt=he(Lt.item,Ct,Lt.linkId,Mr,Ut);if(Mt)return x(Ut,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Mr+1,error:Mt})}}else return x(Ut,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:Mr+1})}if(!Tn)return x(Ut,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(bt&&bt.length>0)for(let Tn=0;Tn<bt.length;Tn++){const Mr=bt[Tn];if(Mr&&Object.keys(Mr).length>0&&Object.values(Mr).some(gn=>gn!=null&&gn!==""&&(Array.isArray(gn)?gn.length>0:!0))){const gn=ue(Lt.extension,Lt.type,!1,Lt.maxLength,[Mr],Lt.answerOption,Ut);if(gn)return x(Ut,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Tn+1,error:gn});if(Lt.item&&Lt.item.length>0){const rn=he(Lt.item,Ct,Lt.linkId,Tn,Ut);if(rn)return x(Ut,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Tn+1,error:rn})}}}return""},he=(Lt,Ct,bt,Ut,hn)=>{var Tn,Mr;for(const Cn of Lt){if(!Se(Cn.enableWhen,Cn.enableBehavior,Ct,bt,Ut))continue;const gn=G(Ct,bt),rn=(Tn=gn?.item)==null?void 0:Tn.find(Pt=>Pt.linkId===Cn.linkId),Mt=(Mr=rn?.answer)!=null&&Mr[Ut]?[rn.answer[Ut]]:void 0;if(Cn.required){if(!Mt||!Mt[0]||!ce(Mt[0]))return x(hn,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Cn.text||Cn.linkId});const Pt=ue(Cn.extension,Cn.type,!0,Cn.maxLength,Mt,Cn.answerOption,hn);if(Pt)return`${Cn.text||Cn.linkId}: ${Pt}`}else if(Mt&&Mt[0]&&ce(Mt[0])){const Pt=ue(Cn.extension,Cn.type,!1,Cn.maxLength,Mt,Cn.answerOption,hn);if(Pt)return`${Cn.text||Cn.linkId}: ${Pt}`}if(Cn.item&&Cn.item.length>0){const Pt=he(Cn.item,Ct,Cn.linkId,Ut,hn);if(Pt)return Pt}}return""},ce=Lt=>!Lt||Object.keys(Lt).length===0?!1:Object.values(Lt).some(Ct=>Ct!=null&&Ct!==""&&(Array.isArray(Ct)?Ct.length>0:!0)),ue=(Lt,Ct,bt,Ut,hn,Tn,Mr)=>{var Cn,gn,rn,Mt,Pt;let Ht="";const un=!!Lt?.find(Lr=>{var Fr,p0;return Lr.url===A.gD&&((p0=(Fr=Lr.valueCodeableConcept)==null?void 0:Fr.coding)==null?void 0:p0.some(Mo=>Mo.system===A.n4&&Mo.code===A.GI))}),Jt=hn?.[0],Sn={choice:((Cn=Jt?.valueCoding)==null?void 0:Cn.code)||(Jt?.valueString&&Tn?.some(Lr=>Lr.valueString===Jt.valueString)?Jt.valueString:null),"open-choice":((gn=Jt?.valueCoding)==null?void 0:gn.code)||Jt?.valueString,boolean:Jt?.valueBoolean,string:Jt?.valueString,text:Jt?.valueString,url:Jt?.valueUri,integer:Jt?.valueInteger,decimal:Jt?.valueDecimal,dateTime:Jt?.valueDateTime,date:Jt?.valueDate,time:Jt?.valueTime,quantity:(rn=Jt?.valueQuantity)==null?void 0:rn.value,reference:(Mt=Jt?.valueReference)==null?void 0:Mt.display,attachment:(Pt=Jt?.valueAttachment)==null?void 0:Pt.title};if(!(Ct in Sn))return"";const jn=Sn[Ct],$r={required:()=>bt&&(jn==null||jn===""||jn==="NaN"||Number.isNaN(jn)||Ct==="boolean"&&jn!==!0&&un)?x(Mr,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Ut&&jn!==null&&jn!==void 0&&jn.toString().length>Ut?x(Mr,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:Ut}):"",minLength:()=>{const Lr=I("minLength",Lt);return Lr&&jn!==null&&jn!==void 0&&jn.toString().length<Number(Lr)?x(Mr,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:Lr}):""},urlRegex:()=>{const Lr=new RegExp(A.rx),Fr=I("regexError",Lt),p0=Fr??x(Mr,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return Lr&&Ct==="url"&&jn&&!Lr.test(jn)?String(p0):""},regex:()=>{const Lr=I("regex",Lt);if(!Lr||typeof jn!="string")return"";const Fr=new RegExp(Lr),p0=I("regexError",Lt),Mo=p0??x(Mr,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Fr&&jn&&!Fr.test(jn)?String(Mo):""},dateTime:()=>{if(Ct==="dateTime"&&jn){const Lr=jn?.toString(),Fr=new Date(Lr);return isNaN(Fr.getTime())?x(Mr,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(Ct!=="date"||!jn)return"";const Lr=jn.replace(/\D/g,"");return Lr.length>0&&Lr.length<8||isNaN(new Date(jn).getTime())?x(Mr,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var Lr;if(Ct==="date"){const p0=U(A.dU,Lt),Mo=K(p0??"01/01/1900","01/01/1900"),N0=K(jn,"");if(!Mo||!N0)return"";if((0,s.A)(N0,Mo)){const ro=(Lr=Lt?.find(W0=>W0.url===A.Ck))==null?void 0:Lr.valueString;return ro??x(Mr,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:p0??"01/01/1900"})}return""}const Fr=I("minValue",Lt);return Fr!=null&&jn!==null&&jn!==void 0&&jn<Fr?x(Mr,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Fr}):""},maxValue:()=>{var Lr;if(Ct==="date"){const p0=U(A.bK,Lt),Mo=K(p0??"01/01/2100","01/01/2100"),N0=K(jn,"");if(!Mo||!N0)return"";if((0,o.A)(N0,Mo)){const ro=(Lr=Lt?.find(W0=>W0.url===A.Cx))==null?void 0:Lr.valueString;return ro??x(Mr,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:p0??"01/01/2100"})}return""}const Fr=I("maxValue",Lt);return Fr!=null&&jn!==null&&jn!==void 0&&jn>Fr?x(Mr,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:Fr}):""}};return Ht=$r.required()||$r.maxLength()||$r.minLength()||$r.urlRegex()||$r.regex()||$r.dateTime()||$r.date()||$r.minValue()||$r.maxValue()||"",Ht},re=(Lt,Ct)=>{for(const bt of Ct)if(bt.item){if(bt.item.find(Tn=>Tn.linkId===Lt.linkId))return bt;const hn=re(Lt,bt.item);if(hn)return hn}return null},J=(Lt,Ct)=>{if(Lt.answer&&Lt.answer.length>1)return!0;if(Lt.item){const bt=Lt.item.find(Ut=>Ut.linkId===Ct.linkId);if(bt&&bt.answer&&bt.answer.length>1)return!0}return!1},ve=(Lt,Ct,bt,Ut,hn)=>{var Tn,Mr;const{required:Cn}=Lt,gn=(Tn=Ut.item)==null?void 0:Tn.find(Pt=>Pt.linkId===Lt.linkId),rn=gn?.answer||[],Mt=((Mr=Ut.answer)==null?void 0:Mr.length)||1;for(let Pt=0;Pt<Mt;Pt++){const Ht=rn[Pt];if(Cn){if(!Ht||!ce(Ht))return x(hn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:x(hn,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Lt.text||Lt.linkId})});const un=ue(Lt.extension,Lt.type,!0,Lt.maxLength,[Ht],Lt.answerOption,hn);if(un)return x(hn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:un})}else if(Ht&&ce(Ht)){const un=ue(Lt.extension,Lt.type,!1,Lt.maxLength,[Ht],Lt.answerOption,hn);if(un)return x(hn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:un})}}return""},Ee=(Lt,Ct)=>{for(const bt of Lt){if(bt?.linkId===Ct)return bt;if(bt?.item&&bt.item.length>0){const Ut=Ee(bt.item,Ct);if(Ut)return Ut}}},De=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>{var Ut,hn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)==null?void 0:hn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===FOOTER_CODE))}))},ze=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>bt.url===A.oA&&bt.valueBoolean))},Ie=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>{var Ut,hn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)==null?void 0:hn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===HEADER_CODE))}))},xe=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>{var Ut,hn;return bt.url===A.gD&&((hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)==null?void 0:hn.some(Tn=>Tn.system===A.n4&&Tn.code===A._l))}))},$e=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>bt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&bt.valueBoolean))},it=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>{var Ut,hn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((hn=(Ut=bt.valueCodeableConcept)==null?void 0:Ut.coding)==null?void 0:hn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===CHECKBOX_CODE))}))},gt=Lt=>{var Ct;const bt=(Ct=Lt.extension)==null?void 0:Ct.find(Ut=>Ut.url===A.fe);return bt?.valueInteger},Et=Lt=>{var Ct;const bt=(Ct=Lt.extension)==null?void 0:Ct.find(Ut=>Ut.url===A.zO);return bt?.valueInteger},Kt=Lt=>{var Ct;const bt=(Ct=Lt?.extension)==null?void 0:Ct.find(Ut=>Ut.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return bt?.valueInteger},Gt=(Lt,Ct,bt,Ut,hn,Tn)=>{const Mr=gn=>Ct.filter(rn=>rn.linkId===gn),Cn=new Set;return Lt.map(gn=>{if(Cn.has(gn.linkId)||De(gn))return null;const Mt=Mr(gn.linkId),Pt=gn.type==="group"&&gn.repeats;if(Cn.add(gn.linkId),Pt){const Ht=[];if(Mt.forEach((un,Jt)=>{const Sn={linkId:gn.linkId,text:gn.text};let jn;if(bt===gn.linkId&&typeof Tn=="number"&&Tn===Jt&&hn&&hn.length>0){const $r=un?.item||[];jn=[...$r],hn.forEach(Lr=>{const Fr=jn.findIndex(p0=>p0.linkId===Lr.linkId);Fr>=0?jn[Fr]=M(b({},$r[Fr]),{answer:Lr.answer}):jn.push(Lr)})}else gn.item&&(jn=Gt(gn.item,un?.item||[],bt,Ut,hn,Jt));bt===gn.linkId&&typeof Tn=="number"&&Tn===Jt&&Ut?Sn.answer=Ut:Sn.answer=un.answer||[{}],jn&&jn.length>0?Sn.item=jn:un.item&&(Sn.item=un.item),Ht.push(Sn)}),bt===gn.linkId&&typeof Tn=="number"&&Tn>=Mt.length)for(let un=Mt.length;un<=Tn;un++){const Jt={linkId:gn.linkId,text:gn.text,answer:un===Tn&&Ut?Ut:[{}]};un===Tn&&hn&&hn.length>0?Jt.item=hn:gn.item&&(Jt.item=Gt(gn.item,[],void 0,void 0,void 0,void 0)),Ht.push(Jt)}return Ht}else if(gn.repeats&&typeof Tn=="number"&&bt===gn.linkId){const Ht=Mt[0]||{linkId:gn.linkId,text:gn.text,answer:[]},un={linkId:gn.linkId,text:gn.text,answer:[...Ht.answer||[]]};if(Ut&&Ut.length>0){for(;un.answer.length<=Tn;)un.answer.push({});un.answer[Tn]=Ut[0]}return un}else{const Ht=Mt[0],un=gn.item?Gt(gn.item,Ht?.item||[],bt,Ut,hn,Tn):void 0,Jt=un&&un.length>0,Sn={linkId:gn.linkId,text:gn.text};return bt&&gn.linkId===bt&&typeof Tn!="number"?(Ut||!Ut&&!hn?Sn.answer=Ut:Ht?.answer&&(Sn.answer=Ht.answer),hn?Sn.item=hn:Jt&&(Sn.item=un)):(Ht?.answer?Sn.answer=Ht.answer:Sn.answer=[{}],Jt&&(Sn.item=un)),Sn}}).filter(Boolean).flat()},St=(Lt,Ct)=>{for(const bt of Lt)if(bt.linkId===Ct||bt.item&&St(bt.item,Ct))return bt.linkId;return null},Xe=(Lt,Ct,bt,Ut)=>{var hn;const Tn=(hn=Lt?.item)!=null?hn:Ut;return!Tn||Tn.length===0?!0:Tn.every(Mr=>{var Cn;const gn=se(Ct,Mr.linkId);if(gn.length===0){const rn=(Cn=G(Ct,Mr.linkId))==null?void 0:Cn.answer;if(ae(Mr,Ct,rn)&&be(Mr.enableWhen,Mr.enableBehavior,Ct)&&bt.includes(Mr.linkId))return!1}else for(const rn of gn)if(ae(Mr,Ct,rn.answer)&&be(Mr.enableWhen,Mr.enableBehavior,Ct)&&bt.includes(Mr.linkId))return!1;return Mr.item?Xe(Mr,Ct,bt):!0})},Fe=(Lt,Ct,bt=!0)=>{for(const Ut of Lt)if(Ut.linkId===Ct&&Ut.answer&&Ut.answer.length>0||Ut.item&&Ut.item.length>0&&Fe(Ut.item,Ct,bt))return!0;return!1},Ot=(Lt,Ct,bt=0)=>{const Ut=Lt.filter(hn=>hn.linkId===Ct);if(Ut.length>bt){const hn=Ut[bt];if(hn.answer&&hn.answer.length>0)return hn.answer.some(Tn=>Tn&&Object.keys(Tn).length>0&&Object.values(Tn).some(Mr=>Mr!=null&&Mr!==""));if(hn.item&&hn.item.length>0)return Fe(hn.item,Ct,!1)}return Fe(Lt,Ct,!1)},Qe=(Lt,Ct)=>{if(!Lt||!Lt.item)return!1;const bt=Ut=>{var hn;if(ze(Ut)&&Ut.required&&be(Ut.enableWhen,Ut.enableBehavior,Ct)){const Tn=G(Ct,Ut.linkId),Mr=ue(Ut.extension,Ut.type,Ut.required,Ut.maxLength,Tn?.answer,Ut.answerOption);if(!((hn=Tn?.answer)!=null&&hn.length)||Mr)return!0}if(Ut.item){for(const Tn of Ut.item)if(bt(Tn))return!0}return!1};for(const Ut of Lt.item)if(bt(Ut))return!0;return!1},Ye=Lt=>{var Ct,bt,Ut;if(Lt.valueString!==void 0)return Lt.valueString;if(Lt.valueBoolean!==void 0)return Lt.valueBoolean;if(Lt.valueInteger!==void 0)return Lt.valueInteger;if(Lt.valueDecimal!==void 0)return Lt.valueDecimal;if(Lt.valueDate!==void 0)return Lt.valueDate;if(Lt.valueDateTime!==void 0)return Lt.valueDateTime;if(((Ct=Lt.valueCoding)==null?void 0:Ct.code)!==void 0)return Lt.valueCoding.code;if(((bt=Lt.valueReference)==null?void 0:bt.reference)!==void 0)return Lt.valueReference.reference;if(((Ut=Lt.valueQuantity)==null?void 0:Ut.value)!==void 0)return Lt.valueQuantity.value;if(Lt.valueAttachment!==void 0)return Lt.valueAttachment},Dt=Lt=>{const Ct={linkId:Lt.linkId};if(Lt.answer&&Lt.answer.length>0){const bt=Lt.answer.map(Ut=>Ye(Ut)).filter(Ut=>Ut!==void 0);bt.length>0&&(Ct.answer=bt)}if(Lt.item&&Lt.item.length>0){const bt=Lt.item.map(Ut=>Dt(Ut)).filter(Ut=>{const hn=Object.keys(Ut);return hn.length>1||hn.length===1&&hn[0]!=="linkId"});bt.length>0&&(Ct.item=bt)}return Ct},fn=(Lt,Ct,bt,Ut,hn,Tn)=>{var Mr;const Cn=(Mr=Ct?.item)==null?void 0:Mr[bt[Ut]],gn=Cn?.linkId;if(!gn)return!1;const rn=se(Lt,gn),Mt=se(hn,gn),Pt=Ht=>{if(Ht!=null){if(Array.isArray(Ht)){const un=Ht.filter(Jt=>Jt!=null).map(Jt=>Pt(Jt)).filter(Jt=>Jt!==void 0);return un.length===0||un.length===1&&typeof un[0]=="object"&&Object.keys(un[0]).length===0?void 0:un}if(typeof Ht=="object"){const un={};for(const[Jt,Sn]of Object.entries(Ht))if(Sn!=null){const jn=Pt(Sn);jn!==void 0&&(un[Jt]=jn)}return Object.keys(un).length===0?void 0:un}return Ht}};if(rn.length!==Mt.length)return!1;for(let Ht=0;Ht<rn.length;Ht++){const un=rn[Ht],Jt=Mt[Ht];if(!un||!Jt)return!1;const Sn=Dt(Pt(un)),jn=Dt(Pt(Jt));if(!_.isEqual(Sn,jn))return!1}return Ut!==Tn},zn=(Lt,Ct,bt,Ut)=>bt&&bt.length>0&&!(bt.length===1&&Object.keys(bt[0]).length===0)&&ae(Lt,Ct,bt,Ut)||null,et=(Lt,Ct,bt)=>{const Ut={},hn=Tn=>{Tn.forEach(Mr=>{const Cn=se(Ct,Mr.linkId);if(ye(Mr,Lt)||Mr.repeats)for(let gn=0;gn<Cn.length;gn++){const rn=Cn[gn];if(rn?.answer&&rn.answer.length>0){const Mt=zn(Mr,Ct,rn.answer,bt);Mt&&(Ut[Mr.linkId]=M(b({},Ut[Mr.linkId]),{[gn]:Mt}))}}else{const gn=G(Ct,Mr.linkId);if(gn?.answer&&gn.answer.length>0){const rn=zn(Mr,Ct,gn.answer,bt);rn&&(Ut[Mr.linkId]={0:rn})}}Mr.item&&Mr.item.length>0&&hn(Mr.item)})};return hn(Lt),Ut},Rt=Lt=>{if(!Lt)return"";const Ct=Lt.split("-");if(Ct.length===3){const[bt,Ut,hn]=Ct;return`${bt.slice(-4)}-${Ut}-${hn}`}return""},jt=Lt=>Lt.trim().replace(/[A-Za-z]+/g,""),_n=(Lt,Ct)=>{const bt=(Ut,hn)=>{for(const Tn of Ut){if(Tn.linkId===hn)return Tn.answer;if(Tn.item&&Tn.item.length>0){const Mr=bt(Tn.item,hn);if(Mr!==void 0)return Mr}}};return bt(Lt,Ct)},br=(Lt,Ct)=>{if(!Ct||Ct.length===0)return null;const bt=Lt.linkId,Ut=(hn,Tn,Mr=[])=>{for(const Cn of hn){const gn=[...Mr,Cn];if(Cn.item){if(Cn.item.some(Pt=>Pt.linkId===Tn))return gn.some(Pt=>Pt.repeats===!0)?Cn:null;if(Ut(Cn.item,Tn,gn))return Cn}}return null};return Ut(Ct,bt)},mn=(Lt,Ct)=>{if(!Ct||Ct.length===0)return!1;const bt=Lt.linkId,Ut=(hn,Tn,Mr=[])=>{for(const Cn of hn){const gn=[...Mr,Cn];if(Cn.item){if(Cn.item.some(Pt=>Pt.linkId===Tn))return gn.some(Pt=>{const Ht=z(Pt.extension||[]);return!!Ht&&Ht!==UI_TOOLKIT_FORM_CONTAINER});if(Ut(Cn.item,Tn,gn))return!0}}return!1};return Ut(Ct,bt)},Dn=(Lt,Ct,bt)=>{const Ut={};if(!Lt)return Ut;const{linkId:hn}=Ct;if(Lt[hn]){const Tn=Lt[hn];Ut[hn]=Tn[bt]||""}return Ct.item&&Ct.item.length>0&&Ct.item.forEach(Tn=>{if(Lt[Tn.linkId]){const Mr=Lt[Tn.linkId];Ut[Tn.linkId]=Mr[bt]||""}}),Ut},fr=(Lt,Ct)=>{const bt={};if(!Lt||!Lt[Ct])return bt;const Ut=Lt[Ct];return bt[Ct]=Ut[0]||"",bt},Bn=Lt=>{const Ct=Lt.findIndex(Tn=>!ze(Tn)),bt=Ct>=0?[Ct]:[],Ut=new Map;let hn=null;if(Lt.forEach((Tn,Mr)=>{const Cn=xe(Tn);if(Cn&&Tn.type==="group")Mr!==Ct&&bt.push(Mr),Ut.set(Mr,[Mr]),hn=Mr;else if(hn!==null&&!Cn){const gn=Ut.get(hn)||[];Ut.set(hn,[...gn,Mr])}}),Lt.length>0&&bt.length>0){const Tn=bt[0];if(!Ut.has(Tn)){const Mr=bt.find(gn=>gn>Tn),Cn=[];for(let gn=Tn;gn<(Mr??Lt.length);gn++)Cn.push(gn);Ut.set(Tn,Cn)}}return{groupIndices:bt,itemsToRenderMap:Ut}},Zr=(Lt,Ct,bt,Ut)=>{let hn=[...Ut];const Tn=(Mr,Cn)=>{Mr.forEach(gn=>{if((!gn?.enableWhen||be(gn?.enableWhen,gn.enableBehavior,Cn))&&gn.initial&&!Fe(Cn,gn.linkId))if(gn.repeats){const rn=Cn.filter(Mt=>Mt.linkId===gn.linkId);rn.length>0?rn.forEach((Mt,Pt)=>{Ot(Cn,gn.linkId,Pt)||(hn=Gt(bt,hn,gn.linkId,gn.initial,void 0,Pt))}):hn=Gt(bt,hn,gn.linkId,gn.initial)}else hn=Gt(bt,hn,gn.linkId,gn.initial);gn.item&&Tn(gn.item,Cn)})};return Tn(Lt,Ct),hn},jr=(Lt,Ct,bt)=>{if(!Lt)return[];const Ut=[],hn=Tn=>{Tn.required===Ct&&be(Tn.enableWhen,Tn.enableBehavior,bt)&&!ze(Tn)&&Tn.type!=="display"&&Ut.push(Tn),Tn.item&&Tn.item.length>0&&Tn.item.forEach(hn)};return Lt.forEach(hn),Ut},It=(Lt,Ct)=>Lt.every(bt=>{var Ut;const hn=se(Ct,bt.linkId);if(hn.length>0)return hn.every(Tn=>!ae(bt,Ct,Tn.answer));{const Tn=(Ut=G(Ct,bt.linkId))==null?void 0:Ut.answer;return!ae(bt,Ct,Tn)}}),_e=(Lt,Ct)=>{let bt=-1;for(let Ut=Lt.length-1;Ut>=0;Ut--)if(Lt[Ut].linkId===Ct){bt=Ut;break}return bt},ot=(Lt,Ct)=>Lt.filter(bt=>bt.linkId!==Ct).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:ot(bt.item,Ct)}):bt),Je=(Lt,Ct,bt=Lt)=>Lt.reduce((Ut,hn)=>{const Tn=Ee(Ct,hn.linkId);return Tn?.enableWhen&&!be(Tn.enableWhen,Tn.enableBehavior,bt)||(hn.item&&hn.item.length>0?Ut.push(M(b({},hn),{item:Je(hn.item,Ct,bt)})):Ut.push(hn)),Ut},[]),tt=(Lt,Ct,bt=[])=>{const Ut=[],hn=Tn=>{Tn.forEach(Mr=>{Ut.push(Mr.linkId),Mr.item&&Mr.item.length>0&&hn(Mr.item)})};for(let Tn=0;Tn<Lt.length;Tn++){const Mr=Lt[Tn];if(Mr.linkId===Ct){const Cn=Lt.slice(0,Tn+1),gn=Lt.slice(Tn+1),{kept:rn,removed:Mt}=gn.reduce((Pt,Ht)=>{const un=Ee(bt,Ht.linkId);return!un||ze(un)&&be(un.enableWhen,un.enableBehavior,Cn)?Pt.kept.push(Ht):Pt.removed.push(Ht),Pt},{kept:[],removed:[]});return hn(Mt),{trimmedData:[...Cn,...rn],trimmedLinkIds:Ut,found:!0}}if(Mr.item&&Mr.item.length>0){const Cn=tt(Mr.item,Ct,bt);if(Cn.found){const gn=Lt.slice(0,Tn),rn=Lt.slice(Tn+1),Mt=[...gn,M(b({},Mr),{item:Cn.trimmedData})],{kept:Pt,removed:Ht}=rn.reduce((un,Jt)=>{const Sn=Ee(bt,Jt.linkId);return!Sn||ze(Sn)&&be(Sn.enableWhen,Sn.enableBehavior,Mt)?un.kept.push(Jt):un.removed.push(Jt),un},{kept:[],removed:[]});return hn(Ht),{trimmedData:[...Mt,...Pt],trimmedLinkIds:[...Cn.trimmedLinkIds,...Ut],found:!0}}}}return{trimmedData:Lt,trimmedLinkIds:[],found:!1}},rt=(Lt,Ct)=>Lt.filter(bt=>!Ct.includes(bt.linkId)).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:rt(bt.item,Ct)}):bt),lt=Lt=>{var Ct;if(!Lt)return"empty";const bt=A.Z$.find(({patterns:Ut})=>Ut.some(hn=>Lt.includes(hn)));return(Ct=bt?.type)!=null?Ct:"empty"},zt=(Lt,Ct)=>{const{groupIndices:bt}=Bn(Lt),Ut=Lt.findIndex(hn=>hn.linkId===Ct);return Ut!==-1?bt.indexOf(Ut):-1},st=Lt=>{if(!Lt)return{restriction:null,warning:null};const Ct=bt=>{const Ut=Lt.find(Tn=>Tn.url===bt&&Tn.valueString);if(!Ut?.valueString)return null;const hn=Ut.valueString.replace(/\\n/g,`
870
870
  `).split(`
871
871
  `).map(Tn=>Tn.trim()).filter(Boolean).map(Tn=>Tn.startsWith("*")?Tn.substring(1).trim():Tn);return hn.length===0?null:hn.length===1?{isList:!1,items:hn}:{isList:!0,items:hn}};return{restriction:Ct("restriction"),warning:Ct("warning")}},le=(Lt,Ct)=>{var bt;switch(Ct.type){case"boolean-to-string":return typeof Lt=="boolean"?Lt?Ct.trueValue:Ct.falseValue:Lt;case"map":return Ct.mapping&&Lt in Ct.mapping?Ct.mapping[Lt]:Lt;case"date-format":return Lt;case"number-format":if(typeof Lt=="number"){let Ut=Lt.toFixed((bt=Ct.decimals)!=null?bt:0);return Ct.prefix&&(Ut=Ct.prefix+Ut),Ct.suffix&&(Ut=Ut+Ct.suffix),Ut}return Lt;case"passthrough":default:return Lt}},ye=(Lt,Ct)=>{const bt=Lt.linkId,Ut=(Tn,Mr,Cn=[])=>{for(const gn of Tn){const rn=[...Cn,gn];if(gn.item){if(gn.item.some(Ht=>Ht.linkId===Mr))return rn.filter(Ht=>Ht.repeats===!0);const Pt=Ut(gn.item,Mr,rn);if(Pt.length>0)return Pt}}return[]},hn=Ut(Ct,bt);return hn.length>0?hn[hn.length-1]:null},Ue=(Lt,Ct)=>{if(!Lt?.item)return[];const bt=[];for(const Ut of Lt.item){if(Ut.type!=="group")continue;be(Ut.enableWhen,Ut.enableBehavior,Ct||[])&&Ut.linkId&&bt.push(Ut.linkId)}return bt},Te=(Lt,Ct)=>{const bt=Ue(Lt,Ct||void 0);return bt[bt.length-1]},Tt=({questionnaire:Lt,extensionUrl:Ct,errorCode:bt})=>{if(!bt||!Lt?.item)return;const Ut=Lt.item.find(hn=>{var Tn;return(Tn=hn.extension)==null?void 0:Tn.some(Mr=>Mr.url===Ct&&Mr.valueString===bt)});return Ut?.linkId},Zt=(Lt,Ct)=>{var bt;const Ut=(bt=Lt.extension)==null?void 0:bt.find(Tn=>Tn.url===A.rb);if(!Ut?.valueString)return;const hn=Ut.valueString;return Ee(Ct,hn)},vn=Lt=>{var Ct;return!!((Ct=Lt.extension)!=null&&Ct.find(bt=>bt.url===A.rb))},Hn=(Lt,Ct)=>Lt.filter(bt=>bt.linkId!==Ct).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:Hn(bt.item,Ct)}):bt),vr=Lt=>{const Ct=I(ANALYTICS_FORM_NAME_EXTENSION_URL,Lt.extension);return Ct??F(Lt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},Wt=Lt=>I(ANALYTICS_EVENT_NAME_EXTENSION_URL,Lt.extension),we=Lt=>I(ANALYTICS_PAGE_NAME_EXTENSION_URL,Lt.extension),Ze=Lt=>I(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,Lt.extension),At=Lt=>I(ANALYTICS_OPTION_NAME_EXTENSION_URL,Lt),kt=(Lt,Ct)=>{var bt,Ut,hn;if(!Lt.answerOption)return;const Tn=G(Ct,Lt.linkId),Mr=(hn=(Ut=(bt=Tn?.answer)==null?void 0:bt[0])==null?void 0:Ut.valueCoding)==null?void 0:hn.code;if(!Mr)return;const Cn=Lt.answerOption.find(gn=>{var rn;return((rn=gn.valueCoding)==null?void 0:rn.code)===Mr});if(!!Cn)return At(Cn.extension)},Qt=(Lt,Ct)=>{const bt={},Ut=hn=>{if(!!hn)for(const Tn of hn){const Mr=Ze(Tn);if(Mr){let Cn;switch(Tn.type){case"choice":Cn=kt(Tn,Ct);break;default:break}Cn&&(bt[Mr]=Cn)}Tn.item&&Tn.item.length>0&&Ut(Tn.item)}};return Ut(Lt.item),bt},tn=Lt=>!!(Lt.initial&&Lt.initial.length>0),Un=(Lt,Ct,bt)=>{if(!Lt)return[];const Ut=[],hn=Tn=>{Tn.forEach(Mr=>{if(bt&&bt.includes(Mr.linkId))return;const Cn=ze(Mr),gn=Ct.includes(Mr.linkId);(gn||Cn&&Mr.required)&&Ut.push(Mr),gn&&Mr.item&&Mr.item.length>0&&hn(Mr.item)})};return hn(Lt),Ut},_r=(Lt,Ct,bt,Ut,hn,Tn)=>{var Mr;if(bt<0||!Ut?.item)return!0;const Cn=hn.current[bt],gn=bt+1,rn=hn.current[gn],Mt=bt===0?0:Cn,Pt=rn??Ut.item.length,Ht=[];for(let $r=Mt;$r<Pt;$r++){const Lr=(Mr=Ut?.item)==null?void 0:Mr[$r];if(Lr){if(Tn&&Tn.includes(Lr.linkId))continue;const Fr=ze(Lr);(Ct.includes(Lr.linkId)||Fr&&Lr.required)&&Ht.push(Lr),Lr.item&&Lr.item.length>0&&Ht.push(...Un(Lr.item,Ct,Tn))}}const un=Ht.filter($r=>$r.required===!0),Jt=Ht.filter($r=>$r.required!==!0),Sn=It(un,Lt),jn=Jt?.every($r=>{var Lr;const Fr=(Lr=G(Lt,$r.linkId))==null?void 0:Lr.answer;return Fr?!ae($r,Lt,Fr):!0});return!un?.length||Sn&&jn}},32957:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(61784),s=e(36087),o=e(8322),i=e(1053),a=e(25624);const g=({item:Yn})=>{const e0=Yn.text||"",t0=Yn.extension||[],Io=Ui=>{var Ii;return(Ii=t0.find(Ti=>Ti.url===Ui))==null?void 0:Ii.valueString},ri=Io(i.$7),yi=Io(i.pc)||"default";return(0,n.jsx)(s.AlertFloating,{title:e0,description:ri??"",color:yi})};var c=e(7630),u=e(16212),E=Object.defineProperty,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(Yn,e0,t0)=>e0 in Yn?E(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,v=(Yn,e0)=>{for(var t0 in e0||(e0={}))m.call(e0,t0)&&O(Yn,t0,e0[t0]);if(A)for(var t0 of A(e0))d.call(e0,t0)&&O(Yn,t0,e0[t0]);return Yn};const h=({item:Yn})=>{const[e0,t0]=(0,t.useState)(!1),Io=Yn.extension||[],ri=Pn=>{var lr;return(lr=Io.find(pn=>pn.url===Pn))==null?void 0:lr.valueString},yi=ri(i.PS)||Yn.text||"",Ui=ri(i.Iz)||"button",Ii=ri(i.VF),Ti=ri(i.PV),Fi=ri(i.vf),ii=Fi?i.JP[Fi]:void 0,va=ri(i.D_)||"",Sr=ri(i.$e),ir=ri(i.GQ),xr=ri(i.qT)||"gray",Le=ri(i.hZ),Ce=ri(i.wG),We=ri(i.q3),mt=ir?i.JP[ir]:void 0,Yt=()=>t0(!0),nn=()=>{switch(Ui){case"icon-button":return(0,n.jsxs)("button",{onClick:Yt,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":yi||va||void 0,children:[ii&&(0,n.jsx)(ii,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),yi&&(0,n.jsx)("span",{className:"text-sm",children:yi})]});default:return(0,n.jsx)(s.Button,{color:Ii??"secondary",size:Ti??"md",iconLeading:ii,onClick:Yt,"aria-label":yi,children:yi})}};return(0,n.jsxs)(n.Fragment,{children:[nn(),(0,n.jsx)(s.Modal,v(v(v({id:`modal-${Yn.linkId}`,isOpen:e0,onOpenChange:t0,title:{content:va},description:{content:Sr?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:u.Wp.sanitizeHtml(Sr)}}):void 0},closeButton:{onCloseClick:()=>t0(!1)}},mt?{featuredIcon:{icon:mt,color:xr,size:"lg",className:"bg-white"}}:{}),Le?{primaryButton:{children:Le,onClick:()=>{var Pn,lr;Ce==="open-zendesk"&&((lr=(Pn=globalThis.zE)==null?void 0:Pn.activate)==null||lr.call(Pn,{hideOnClose:!0})),t0(!1)}}}:{}),We?{secondaryButton:{children:We,onClick:()=>t0(!1)}}:{}))]})};var p=e(18522);const f=({item:Yn})=>{var e0,t0,Io,ri,yi,Ui,Ii,Ti,Fi,ii,va,Sr;const{hasExternalError:ir}=(0,p.c)(),xr=Yn.text||"",Le=(t0=(e0=Yn.extension)==null?void 0:e0.find(s0=>s0.url===i.ao))==null?void 0:t0.valueString,Ce=ir&&Le?Le:xr,We=(ri=(Io=Yn.extension)==null?void 0:Io.find(s0=>s0.url===i.$7))==null?void 0:ri.valueString,mt=(Ui=(yi=Yn.extension)==null?void 0:yi.find(s0=>s0.url===i.el))==null?void 0:Ui.valueString,Yt=ir&&mt?mt:We,nn=(Ti=(Ii=Yn.extension)==null?void 0:Ii.find(s0=>s0.url===i.g4))==null?void 0:Ti.valueString,Pn=(ii=(Fi=Yn.extension)==null?void 0:Fi.find(s0=>s0.url===i.Fp))==null?void 0:ii.valueString,lr=nn?i.JP[nn]:void 0,pn=Pn?i.JP[Pn]:void 0,Zn=ir&&pn?pn:lr,an=((Sr=(va=Yn.extension)==null?void 0:va.find(s0=>s0.url===i.WS))==null?void 0:Sr.valueString)===i._W.LEFT,Er=an?"items-start":"items-center",Tr=an?"text-left":"text-center",Ur=an?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${Er} gap-4`,children:[Zn&&(0,n.jsx)(s.FeaturedIcon,{icon:Zn,color:ir&&pn?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${Er} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${Tr} ${Ur} md:max-w-[352px]`,children:Ce}),(0,n.jsx)("p",{className:`text-md text-secondary ${Tr}`,children:Yt})]})]})};var b=e(15297),M=e(17814),x=Object.defineProperty,z=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,C=(Yn,e0,t0)=>e0 in Yn?x(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,y=(Yn,e0)=>{for(var t0 in e0||(e0={}))T.call(e0,t0)&&C(Yn,t0,e0[t0]);if(z)for(var t0 of z(e0))S.call(e0,t0)&&C(Yn,t0,e0[t0]);return Yn};const R=({item:Yn})=>{const[e0,t0]=(0,t.useState)(!1),Io=(0,M.T$)(),ri=Yn.extension||[],yi=Le=>{var Ce;return(Ce=ri.find(We=>We.url===Le))==null?void 0:Ce.valueString},Ui=Yn.text||"",Ii=yi(i.PS)||"",Ti=yi(i.D_)||"",Fi=yi(i.$e),ii=yi(i.GQ),va=yi(i.qT)||"gray",Sr=yi(i.hZ),ir=yi(i.q3),xr=ii?i.JP[ii]:void 0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-secondary ring-border-secondary flex items-center justify-between rounded-lg px-4 py-2.5 ring-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(b.d,{className:"text-tertiary size-4 shrink-0"}),(0,n.jsx)("span",{className:"text-primary text-sm font-semibold",children:Ui})]}),Ii&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>t0(!0),children:Ii})]}),(0,n.jsx)(s.Modal,y(y(y({id:`modal-${Yn.linkId}`,isOpen:e0,onOpenChange:t0,title:{content:Ti},description:{content:Fi?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:u.Wp.sanitizeHtml(Fi)}}):void 0},closeButton:{onCloseClick:()=>t0(!1)}},xr?{featuredIcon:{icon:xr,color:va,size:"lg",className:"bg-white"}}:{}),Sr?{primaryButton:{children:Sr,onClick:()=>{t0(!1),Io.navigate({id:"profile"})}}}:{}),ir?{secondaryButton:{children:ir,onClick:()=>t0(!1)}}:{}))]})},P=({item:Yn,selectedAnswer:e0,handleInputChange:t0})=>{var Io,ri,yi;const Ui=(Io=Yn.answerOption)!=null?Io:[],Ii=(yi=(ri=e0?.[0])==null?void 0:ri.valueCoding)==null?void 0:yi.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:Ui.map(Ti=>{var Fi,ii,va,Sr,ir,xr,Le;const Ce=(ii=(Fi=Ti.valueCoding)==null?void 0:Fi.code)!=null?ii:"",We=(Sr=(va=Ti.valueCoding)==null?void 0:va.display)!=null?Sr:"",mt=Ii===Ce,Yt=(ir=Ti.extension)==null?void 0:ir.find(pn=>pn.url===i.g4),nn=(xr=Ti.extension)==null?void 0:xr.find(pn=>pn.url===i.rz),Pn=Yt?.valueString?i.JP[Yt.valueString]:void 0,lr=(Le=nn?.valueString)!=null?Le:"";return(0,n.jsx)(s.SelectableOption,{icon:Pn,title:We,description:lr,isSelected:mt,onSelect:()=>{t0(Yn,[{valueCoding:{code:Ce,display:We}}])}},Ce)})})};var L=e(72866),D=e(94043),w=e(94627);const N=({text:Yn,isLabel:e0,required:t0,className:Io,id:ri})=>(0,n.jsxs)("p",{id:ri,className:Io??"mb-md text-md",children:[(0,n.jsx)(s.Content,{as:"span",className:(0,D.cx)(e0&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,w.p)(Yn||"")}}),t0&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),V="(###) ###-####",q=(Yn,e0)=>{const t0=Yn.replace(/\D/g,"");let Io="",ri=0;for(let yi=0;yi<e0.length&&ri<t0.length;yi++)e0[yi]==="#"?(Io+=t0[ri],ri++):Io+=e0[yi];return Io},I=Yn=>{if(!Yn)return V;const e0=Yn.find(t0=>t0.url===i.Md);return e0?.valueString||V},k=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui})=>{var Ii;const{linkId:Ti,text:Fi,required:ii,prefix:va,readOnly:Sr,extension:ir}=Yn,xr=I(ir),Le=((Ii=t0?.[0])==null?void 0:Ii.valueString)||"",[Ce,We]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Le){const lr=q(Le,xr);We(lr)}},[Le,xr]);const mt=Fi?(0,a.nt)(ri,va,Fi):"",Yt=yi?.[Ti]||"",nn=lr=>{const pn=q(lr,xr);We(pn),Io(Yn,[{valueString:pn}])},Pn=()=>{e0&&e0(Ti)};return(0,n.jsxs)("div",{"data-testid":Ti,children:[mt&&(0,n.jsx)(N,{isLabel:!0,text:mt,required:ii||!1}),(0,n.jsx)(s.Input,{id:Ti,"aria-label":Ti,"data-testid":Ti,type:"tel",placeholder:"Enter phone number",value:Ce,onChange:nn,onBlur:Pn,isDisabled:Sr||Ui,isRequired:ii,hint:Yt,isInvalid:!!Yt,size:"md"},Ti)]})},U=({item:Yn,questionnaireSchemaItems:e0})=>{var t0;const{isLoading:Io,setCurrentGroupIndex:ri}=(0,p.c)(),yi=(t0=Yn.extension)==null?void 0:t0.find(Fi=>Fi.url===i.Uf),Ui=yi?.valueString,Ii=Yn.text||"Save & continue",Ti=()=>{if(Ui){const Fi=(0,a.Ue)(e0||[],Ui);Fi!==-1&&ri(Fi)}};return(0,n.jsx)("div",{"data-testid":Yn.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(s.Button,{className:"md:w-xxs h-10 w-full text-sm",color:"primary",isLoading:Io,onClick:Ti,isDisabled:Yn.readOnly,children:Ii})})},F=({size:Yn=24,color:e0="currentColor",...t0})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Yn,height:Yn,stroke:e0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t0},t.createElement("path",{d:"M10 16h4m-5.2 6h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V6.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 2 16.88 2 15.2 2H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 22 7.12 22 8.8 22ZM15 9a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));F.displayName="Passport";var K=e(56327);const G=({size:Yn=24,color:e0="currentColor",...t0})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Yn,height:Yn,stroke:e0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t0},t.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));G.displayName="UserCircle";var se=e(14711);const oe=({size:Yn=24,color:e0="currentColor",...t0})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Yn,height:Yn,stroke:e0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t0},t.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));oe.displayName="Mail01";var te=e(31165),pe=e(14449),be=e(27163);const Se=Yn=>{try{const e0=Yn.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!e0)return Yn;const[,t0,Io,ri]=e0;return new Date(Date.UTC(parseInt(t0),parseInt(Io)-1,parseInt(ri))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return Yn}},ge=Yn=>{try{if(Yn.includes("AM")||Yn.includes("PM"))return Yn;const e0=Yn.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!e0)return Yn;const[,t0,Io]=e0,ri=parseInt(t0),yi=ri>=12?"PM":"AM";return`${ri%12||12}:${Io} ${yi}`}catch{return Yn}},ne=(Yn,e0,t0=b.d)=>{var Io;const ri=(Io=Yn.extension)==null?void 0:Io.find(yi=>yi.url===i.g4);return ri?.valueString&&i.JP[ri.valueString]?i.JP[ri.valueString]:Yn.linkId&&e0[Yn.linkId]?e0[Yn.linkId]:t0},ae={"appointment-review/first-name":F,"appointment-review/last-name":F,"appointment-review/dob":K.V,"appointment-review/gender":G,"appointment-review/phone":se.b,"appointment-review/email":oe,"appointment-review/vaccines":s.Vaccine,"appointment-review/appointment-date":K.V,"appointment-review/appointment-time":te.z,"appointment-review/facility-name":s.HospitalBuilding,"appointment-review/facility-phone":se.b,"appointment-review/facility-address":pe.X},me=["appointment-review/appointment-date"],he=["appointment-review/appointment-time"],ce=["appointment-review/facility-phone"],ue=["appointment-review/facility-address"],re=["appointment-review/phone","appointment-review/facility-phone"],J=({item:Yn,questionnaireSchemaItems:e0})=>{var t0;const{setCurrentGroupIndex:Io}=(0,p.c)(),{trackEvent:ri}=(0,o.st)(),yi=Yn.item||[];if(yi.length===0)return null;const Ui=(t0=Yn.extension)==null?void 0:t0.find(ii=>ii.url===i.Uf),Ii=Ui?.valueString,Ti=()=>{if(ri("edit_info_clicked",{section:Yn.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),Ii){const ii=(0,a.Ue)(e0||[],Ii);ii!==-1&&Io(ii)}},Fi=yi.map(ii=>{let va="";if(ii.initial&&ii.initial.length>0){const xr=ii.initial.map(Le=>{var Ce,We;let mt=((Ce=Le.valueCoding)==null?void 0:Ce.display)||((We=Le.valueReference)==null?void 0:We.display)||Le.valueString||"";return mt&&typeof mt=="string"&&(me.includes(ii.linkId)?mt=Se(mt):he.includes(ii.linkId)&&(mt=ge(mt))),mt}).filter(Boolean);xr.length>1||ii.repeats&&xr.length>0?va=xr:xr.length===1&&(va=xr[0])}if(!va||Array.isArray(va)&&va.length===0)return null;let Sr;ce.includes(ii.linkId)?Sr="phone":ue.includes(ii.linkId)&&(Sr="address");let ir;return re.includes(ii.linkId)&&(ir="phone"),{Icon:ne(ii,ae),label:ii.text||ii.linkId,value:va,linkType:Sr,displayType:ir}}).filter(Boolean);return Fi.length===0?null:(0,n.jsx)("div",{"data-testid":Yn.linkId,children:(0,n.jsx)(be.InfoCard,{title:Yn.text||"Details",infoDetails:Fi,actionButtonText:Ii&&"Edit info",onActionButtonClick:Ii?Ti:void 0})})},ve=({size:Yn=24,color:e0="currentColor",...t0})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Yn,height:Yn,stroke:e0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...t0},t.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));ve.displayName="AlertTriangle";var Ee=e(18807);const De=({item:Yn})=>{const{setHideFooterButton:e0,incrementCustomErrorCount:t0,decrementCustomErrorCount:Io}=(0,p.c)();return(0,t.useEffect)(()=>(e0(!0),t0(),()=>{e0(!1),Io()}),[e0,t0,Io]),(0,n.jsx)("div",{"data-testid":Yn.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(s.EmptyState,{className:"mt-5xl",description:(0,n.jsx)(s.Content,{as:"span",dangerouslySetInnerHTML:{__html:(0,Ee.p)(Yn.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(ve,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},ze={information:"info",warning:"warning",error:"error",fatal:"error",success:"success"},Ie=({item:Yn})=>{var e0,t0,Io,ri;const{incrementCustomErrorCount:yi,decrementCustomErrorCount:Ui,setHideFooterButton:Ii}=(0,p.c)(),[Ti,Fi]=(0,t.useState)(!1),ii=(e0=Yn.extension)==null?void 0:e0.find(Ce=>Ce.url===i.gi),va=(Io=(t0=ii?.valueCodeableConcept)==null?void 0:t0.coding)==null?void 0:Io.find(Ce=>Ce.system===i.tn),Sr=va?.code||"error",ir=ze[Sr]||"error";(0,t.useEffect)(()=>{if(ir==="error")return yi(),Ii(!0),Fi(!0),()=>{Ui(),Ii(!1)};Fi(!0)},[ir,yi,Ui,Ii]);const xr=va?.display||"Error",Le=(ri=Yn.text)!=null?ri:"";return Ti?(0,n.jsx)("div",{"data-testid":Yn.linkId,children:(0,n.jsx)(s.InfoBanner,{type:ir,title:xr,description:Le})}):null};var xe=e(65735);const $e=({configKey:Yn,customErrorConfigurations:e0})=>{if(!e0)return null;const t0=e0[Yn];if(!t0)return null;const{icon:Io,title:ri,description:yi,primaryButton:Ui,secondaryButton:Ii}=t0;return(0,n.jsx)(s.EmptyState,{className:"mt-5xl",title:ri,description:yi,featuredIconProps:{icon:Io,color:"gray"},primaryButton:Ui,secondaryButton:Ii})},it=10,gt=({item:Yn,customErrorConfigurations:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui})=>{var Ii,Ti,Fi,ii;const{trackEvent:va}=(0,o.st)(),{setHideFooterButton:Sr}=(0,p.c)(),{linkId:ir,text:xr,required:Le,answerOption:Ce,prefix:We,readOnly:mt}=Yn,Yt=Yn?.type==="reference",nn=(Ii=t0?.map(Ln=>{var or,kr;return Yt?(or=Ln.valueReference)==null?void 0:or.display:(kr=Ln.valueCoding)==null?void 0:kr.code}).filter(Ln=>Ln!==void 0))!=null?Ii:[],[Pn,lr]=(0,t.useState)(nn.length),pn=xr?(0,a.nt)(ri,We,xr):"",Zn=(Fi=(Ti=Yn.extension)==null?void 0:Ti.find(Ln=>Ln.url===i.Z_))==null?void 0:Fi.valueInteger,an=(ii=Ce?.map(Ln=>{var or,kr,h0,fo;return{value:Yt?((or=Ln.valueReference)==null?void 0:or.display)||"":((kr=Ln.valueCoding)==null?void 0:kr.code)||"",label:Yt?((h0=Ln.valueReference)==null?void 0:h0.display)||"":((fo=Ln.valueCoding)==null?void 0:fo.display)||"",valueReference:Ln.valueReference}}))!=null?ii:[],Er=yi?.[ir],Tr=an.length>it,Ur=Tr?an.slice(0,it):an,s0=Tr?an.slice(it):[],Qr=s0.some(Ln=>nn?.includes(Ln?.value)),[k0,Bo]=(0,t.useState)(Qr);if(!(Yn.answerOption&&Yn.answerOption.length>0))return Sr(!0),(0,n.jsx)($e,{configKey:Yn.linkId,customErrorConfigurations:e0});const $t=an.filter(Ln=>nn?.includes(Ln?.value)).map(Ln=>{var or;const{restriction:kr,warning:h0}=Yt?(0,a.eC)((or=Ln.valueReference)==null?void 0:or.extension):{restriction:null,warning:null};return{label:Ln.label,restriction:kr,warning:h0}}).filter(Ln=>Ln.restriction||Ln.warning),An=(Ln,or)=>{var kr;va("vaccine_type_checkbox_selected",{on_or_off:Ln?"on":"off",vaccine:or,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let h0;if(Ln){const fo=an.find(T0=>T0.value===or);h0=[...(kr=t0?.filter(T0=>Object.keys(T0).length!==0))!=null?kr:[],Yt?{valueReference:fo?.valueReference}:{valueCoding:{code:or,display:fo?.label}}],lr(T0=>T0+1)}else h0=t0?.filter(fo=>{var T0,ao;return Yt?((T0=fo.valueReference)==null?void 0:T0.display)!==or:((ao=fo.valueCoding)==null?void 0:ao.code)!==or})||[{}],lr(fo=>fo-1);Io&&Io(Yn,h0)};return(0,n.jsxs)("div",{"data-testid":ir,children:[pn&&(0,n.jsx)(N,{text:pn,required:Le||!1}),Tr&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:Ur.map((Ln,or)=>{const kr=nn?.includes(Ln?.value),h0=!kr&&Zn?Pn>=Zn:!1;return(0,n.jsx)("div",{className:or!==Ur.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(s.Checkbox,{size:"md","data-testid":Ln.value,id:or.toString(),name:Ln.label,isInvalid:!!Er,isSelected:kr,label:Ln.label,onChange:fo=>An(fo,Ln.value),isDisabled:mt||Ui||h0})},or)})}),Tr&&!k0&&!Qr&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(s.Button,{type:"button",onClick:()=>{Bo(!0),va("see_all_vaccines_clicked",{_event_metadata:{description:"A user clicked the see all link on the vaccine type page."}})},color:"link-color",size:"sm",isDisabled:mt||Ui,children:"See all"})}),Tr&&k0&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),Tr&&k0&&(0,n.jsx)("div",{children:s0.map((Ln,or)=>{const kr=nn?.includes(Ln?.value),h0=!kr&&Zn?Pn>=Zn:!1;return(0,n.jsx)("div",{className:or!==s0.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(s.Checkbox,{size:"md","data-testid":Ln.value,id:(it+or).toString(),name:Ln.label,isInvalid:!!Er,isSelected:kr,label:Ln.label,onChange:fo=>An(fo,Ln.value),isDisabled:mt||Ui||h0})},it+or)})}),(0,n.jsx)(s.HintText,{isInvalid:!!Er,children:Er}),$t.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:$t.map((Ln,or)=>(0,n.jsxs)("div",{children:[Ln.restriction&&(0,n.jsx)(s.InfoBanner,{type:"warning",title:`[Restriction] ${Ln.label}`,description:Ln.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:Ln.restriction.items.map((kr,h0)=>(0,n.jsx)("li",{className:"text-sm",children:kr},h0))}):(0,n.jsx)("p",{className:"text-sm",children:Ln.restriction.items[0]})}),Ln.warning&&(0,n.jsx)("div",{className:Ln.restriction?"mt-2":"",children:(0,n.jsx)(s.InfoBanner,{type:"warning",title:`[Warning] ${Ln.label}`,description:Ln.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:Ln.warning.items.map((kr,h0)=>(0,n.jsx)("li",{className:"text-sm",children:kr},h0))}):(0,n.jsx)("p",{className:"text-sm",children:Ln.warning.items[0]})})})]},or))})]})};var Et=e(76323),Kt=e(56192),Gt=e(66267),St=Object.defineProperty,Xe=Object.defineProperties,Fe=Object.getOwnPropertyDescriptors,Ot=Object.getOwnPropertySymbols,Qe=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Dt=(Yn,e0,t0)=>e0 in Yn?St(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,fn=(Yn,e0)=>{for(var t0 in e0||(e0={}))Qe.call(e0,t0)&&Dt(Yn,t0,e0[t0]);if(Ot)for(var t0 of Ot(e0))Ye.call(e0,t0)&&Dt(Yn,t0,e0[t0]);return Yn},zn=(Yn,e0)=>Xe(Yn,Fe(e0)),et=(Yn,e0,t0)=>new Promise((Io,ri)=>{var yi=Ti=>{try{Ii(t0.next(Ti))}catch(Fi){ri(Fi)}},Ui=Ti=>{try{Ii(t0.throw(Ti))}catch(Fi){ri(Fi)}},Ii=Ti=>Ti.done?Io(Ti.value):Promise.resolve(Ti.value).then(yi,Ui);Ii((t0=t0.apply(Yn,e0)).next())});const Rt=({item:Yn,handleInputChange:e0,onCompleteHandler:t0,errors:Io})=>{const{i18n:{t:ri},loading:yi}=(0,Gt.E_)({keys:["shared-translations","ui-toolkit-modern"]}),{trackEvent:Ui}=(0,o.st)(),{linkId:Ii,required:Ti,readOnly:Fi}=Yn,ii=Io?.[Ii]||"",[va,Sr]=(0,t.useState)(Et.LocationType.CURRENT_LOCATION),[ir,xr]=(0,t.useState)(""),Le=(0,t.useRef)({}),[Ce,We]=(0,t.useState)([{id:Et.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:Et.LocationType.ADDRESS,label:"Address"},{id:Et.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:mt,setIsLoading:Yt,setIsCurrentFormValid:nn,isCurrentFormValid:Pn}=(0,p.c)(),{position:lr,loading:pn,locationPermission:Zn}=(0,Et.useDeviceLocationContext)(),{queryParams:an,setQueryParams:Er}=(0,Et.useSearchQueryParams)(),[Tr,{loading:Ur}]=(0,Kt.qtq)({fetchPolicy:"cache-first"}),[s0,{loading:Qr}]=(0,Kt.YyG)({fetchPolicy:"cache-first"}),k0=Yn.item?(0,a.Yo)(Yn.item,"postal-code"):void 0,Bo=Yn.item?(0,a.Yo)(Yn.item,"state"):void 0,ft=Yn.item?(0,a.Yo)(Yn.item,"latitude"):void 0,$t=Yn.item?(0,a.Yo)(Yn.item,"longitude"):void 0,An=q0=>{if(!q0||!k0)return xr(""),!1;const Eo=(0,a.zj)(k0.extension,k0.type,!1,k0.maxLength,[{valueString:q0}],void 0,ri);return Eo?(xr(va!==Et.LocationType.ZIP_CODE?ri("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Eo),!1):(xr(""),!0)},Ln=()=>{const{latitude:q0,longitude:Eo,state:No,zipcode:d0}=Le.current;return!!(q0&&Eo&&No&&d0)},or=(0,t.useCallback)(q0=>{Le.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},Yn.item&&(Bo&&e0(Bo,[{valueString:""}]),ft&&e0(ft,[{valueDecimal:void 0}]),$t&&e0($t,[{valueDecimal:void 0}]),k0&&e0(k0,[{valueString:""}])),Er({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:q0,locationPermission:Zn}),nn&&nn(!1),xr("")},[e0,Yn.item,ft,Zn,$t,nn,Er,Bo,k0]);(0,t.useEffect)(()=>{if(!Ti)return;!Ln()&&nn&&nn(!1)},[Pn,Ti,nn]);const kr=q0=>{Le.current=fn(fn({},Le.current),q0),q0.addressDescription&&Ui("address_selected",{value:q0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),T0(Le.current.latitude,Le.current.longitude,Le.current.state,Le.current.zipcode,Le.current.placeId,Le.current.addressDescription)},h0=q0=>et(void 0,null,function*(){var Eo,No,d0;if(xr(""),Le.current.zipcode=q0,nn&&nn(!1),An(q0)){Ui("zip_code_entered",{value:q0,_event_metadata:{description:"A user entered a zip code."}});const B0=yield s0({variables:{location:q0}}),jo=(Eo=B0?.data)==null?void 0:Eo.geocoding,Q0=B0?.error;if(jo){const xi=jo.stateCode||"",_o=(No=jo.latitude)!=null?No:void 0,Ni=(d0=jo.longitude)!=null?d0:void 0;kr({latitude:_o,longitude:Ni,state:xi,zipcode:q0,placeId:void 0,addressDescription:void 0})}else Q0&&(kr({latitude:void 0,longitude:void 0,state:void 0,zipcode:q0,placeId:void 0,addressDescription:void 0}),xr(ri("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else T0(Le.current.latitude,Le.current.longitude,Le.current.state,q0)}),fo=()=>{const q0=Le.current.zipcode||"";!q0||va!==Et.LocationType.ZIP_CODE||An(q0)};(0,t.useEffect)(()=>{an.locationType&&(Sr(an.locationType),an.locationType===Et.LocationType.ZIP_CODE&&an.zipCode&&h0(an.zipCode),an.locationType===Et.LocationType.ADDRESS&&an.placeId&&an.addressDescription&&(Le.current.addressDescription=an.addressDescription,Le.current.placeId=an.placeId))},[]),(0,t.useEffect)(()=>{const q0=[Et.LocationPermissionEnum.DENIED,Et.LocationPermissionEnum.UNAVAILABLE,Et.LocationPermissionEnum.BLOCKED].includes(an.locationPermission),Eo=[Et.LocationPermissionEnum.GRANTED,Et.LocationPermissionEnum.PROMPT].includes(an.locationPermission);if(q0&&Ce.length!==2){if(We([{id:Et.LocationType.ADDRESS,label:"Address"},{id:Et.LocationType.ZIP_CODE,label:"Zip code"}]),va===Et.LocationType.CURRENT_LOCATION||!an.locationType||an.locationType===""){const No=an.locationType===Et.LocationType.ZIP_CODE?Et.LocationType.ZIP_CODE:Et.LocationType.ADDRESS;Sr(No),Er(zn(fn({},an),{locationType:No})),or(No)}xr("")}Eo&&Ce.length!==3&&We([{id:Et.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:Et.LocationType.ADDRESS,label:"Address"},{id:Et.LocationType.ZIP_CODE,label:"Zip code"}])},[va,Zn,Ce.length,an,Er,or]);const T0=(q0,Eo,No,d0,B0,jo)=>{if(!Yn.item)return;Bo&&e0(Bo,[{valueString:No||""}]),ft&&e0(ft,[{valueDecimal:q0}]),$t&&e0($t,[{valueDecimal:Eo}]),k0&&e0(k0,[{valueString:d0||""}]),Er(zn(fn({},an),{lat:String(q0),lng:String(Eo),location:`${q0},${Eo}`,zipCode:d0||"",placeId:B0||"",addressDescription:jo||"",locationPermission:Zn}));const Q0=Ln()&&An(d0||"");nn&&nn(Q0),t0&&t0(Ii)};(0,t.useEffect)(()=>{const q0=()=>et(void 0,null,function*(){var Eo;try{const No=yield Tr({variables:{latitude:String(lr?.coords.latitude),longitude:String(lr?.coords.longitude)}}),d0=(Eo=No?.data)==null?void 0:Eo.geocodingByLatLon,B0=d0?.stateCode||"",jo=d0?.zipCode||"";(!jo||!B0)&&xr(ri("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),kr({latitude:lr?.coords.latitude,longitude:lr?.coords.longitude,state:B0,zipcode:jo,placeId:void 0,addressDescription:void 0})}catch{Sr(Et.LocationType.ADDRESS)}});va===Et.LocationType.CURRENT_LOCATION&&lr&&q0()},[va,lr]);const ao=q0=>{if(!q0||!q0.latitude||!q0.longitude||!q0.zipCode||!q0.stateCode){kr({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),q0&&typeof q0.value=="string"&&q0.value.trim().length!==0&&xr(ri("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}kr({latitude:q0.latitude,longitude:q0.longitude,state:q0.stateCode,zipcode:q0.zipCode,placeId:q0.placeId,addressDescription:q0.description})};return(0,t.useEffect)(()=>{Yt(pn||Ur||Qr||yi)},[pn,Ur,Qr,yi,Yt]),(0,t.useEffect)(()=>{an.locationType!==va&&Er(zn(fn({},an),{locationType:va}))},[va]),(0,n.jsxs)("div",{"data-testid":Yn.linkId,children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:Ti||!1}),(0,n.jsx)(s.Select,{id:Ii,"aria-label":Ii,"data-testid":Ii,isDisabled:Fi||Ur||Qr||mt,selectedKey:va,onSelectionChange:q0=>{var Eo;Ui("location_type_input_selected",{choice:(Eo=Ce.find(({id:No})=>No===q0))==null?void 0:Eo.label,_event_metadata:{description:"A user changed the location type input."}}),q0!==va&&(or(q0),Sr(q0))},hint:ii,isInvalid:!!ii,items:Ce,placeholder:"Select an option",isRequired:Ti,children:q0=>(0,n.jsx)(s.Select.Item,{id:q0.id,"data-testid":q0.id,value:q0,children:q0.label},q0.id)},Ii),va===Et.LocationType.CURRENT_LOCATION&&(0,n.jsx)(s.HintText,{isInvalid:!!ir,children:ir}),va===Et.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:Ti||!1}),(0,n.jsx)(Et.AddressTypeahead,{onValueChange:ao,isDisabled:mt,setIsLoading:Yt,initialValue:{placeId:Le.current.placeId||"",description:Le.current.addressDescription||""},errorText:ir||ii})]}),va===Et.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:Ti||!1}),(0,n.jsx)(s.Input,{isRequired:Ti,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${Ii}-zipcode`,placeholder:"Type your response here...",value:Le.current.zipcode||"",onChange:h0,onBlur:fo,isDisabled:Fi||Qr||mt,hint:ir||ii,isInvalid:!!ir||!!ii,autoComplete:"postal-code"},`${Ii}-zipcode`)]})]})},jt=Yn=>(0,n.jsx)(Et.DeviceLocationProvider,{children:(0,n.jsx)(Rt,fn({},Yn))}),_n={[i.cX]:jt,[i.G6]:J,[i.c3]:gt,[i.AA]:Ie,[i.mO]:f,[i.PM]:U,[i.HH]:k,[i.Us]:De,[i.Tl]:P,[i.G0]:h,[i.m3]:g,[i.PU]:R,[i.XP]:c.l,[i.uH]:L.v,[i.it]:xe.d};var br,mn=new Uint8Array(16);function Dn(){if(!br&&(br=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!br))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return br(mn)}const fr=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Bn(Yn){return typeof Yn=="string"&&fr.test(Yn)}const Zr=Bn;for(var jr=[],It=0;It<256;++It)jr.push((It+256).toString(16).substr(1));function _e(Yn){var e0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t0=(jr[Yn[e0+0]]+jr[Yn[e0+1]]+jr[Yn[e0+2]]+jr[Yn[e0+3]]+"-"+jr[Yn[e0+4]]+jr[Yn[e0+5]]+"-"+jr[Yn[e0+6]]+jr[Yn[e0+7]]+"-"+jr[Yn[e0+8]]+jr[Yn[e0+9]]+"-"+jr[Yn[e0+10]]+jr[Yn[e0+11]]+jr[Yn[e0+12]]+jr[Yn[e0+13]]+jr[Yn[e0+14]]+jr[Yn[e0+15]]).toLowerCase();if(!Zr(t0))throw TypeError("Stringified UUID is invalid");return t0}const ot=_e;function Je(Yn,e0,t0){Yn=Yn||{};var Io=Yn.random||(Yn.rng||Dn)();if(Io[6]=Io[6]&15|64,Io[8]=Io[8]&63|128,e0){t0=t0||0;for(var ri=0;ri<16;++ri)e0[t0+ri]=Io[ri];return e0}return ot(Io)}const tt=Je,rt=(Yn,e0="application/octet-stream")=>{try{const t0=window.atob(Yn),Io=new Uint8Array(t0.length);for(let yi=0;yi<t0.length;yi++)Io[yi]=t0.charCodeAt(yi);return new Blob([Io],{type:e0}).size}catch{return 0}},lt=(Yn,e0)=>`data:${e0};base64,${Yn}`,zt=(Yn,e0,t0=512)=>{const Io=window.atob(Yn),ri=[];for(let Ui=0;Ui<Io.length;Ui+=t0){const Ii=Io.slice(Ui,Ui+t0),Ti=new Array(Ii.length);for(let ii=0;ii<Ii.length;ii++)Ti[ii]=Ii.charCodeAt(ii);const Fi=new Uint8Array(Ti);ri.push(Fi)}const yi=new Blob(ri,{type:e0});return URL.createObjectURL(yi)},st=Yn=>{const e0=new Date().toISOString().replace(/[:.-]/g,"");return`${Yn.split(" ").join("-")}_${e0}`},le=4e3,ye=.8,Ue=(Yn,e0)=>{var t0,Io;const ri=(t0=e0?.maxDimension)!=null?t0:le,yi=(Io=e0?.quality)!=null?Io:ye;return new Promise((Ui,Ii)=>{if(!Yn.type.startsWith("image/")){Ui(Yn);return}if(Yn.type==="image/heic"||Yn.type==="image/heif"||Yn.name.toLowerCase().endsWith(".heic")||Yn.name.toLowerCase().endsWith(".heif")){Ui(Yn);return}const Fi=new Image,ii=new FileReader;ii.onload=()=>{const va=ii.result;Fi.onload=()=>{let{width:Sr,height:ir}=Fi;if(Sr>ri||ir>ri){const mt=ri/Math.max(Sr,ir);Sr=Math.round(Sr*mt),ir=Math.round(ir*mt)}const xr=document.createElement("canvas");xr.width=Sr,xr.height=ir;const Le=xr.getContext("2d");if(!Le){Ui(Yn);return}Le.drawImage(Fi,0,0,Sr,ir);const Ce=Yn.type==="image/png"?"image/png":"image/jpeg",We=Yn.type==="image/png"?void 0:yi;xr.toBlob(mt=>{if(!mt||mt.size>=Yn.size){Ui(Yn);return}Ui(new File([mt],Yn.name,{type:Ce}))},Ce,We)},Fi.onerror=()=>{Ii(new Error(`Failed to load image: ${Yn.name}`))},Fi.src=va},ii.onerror=()=>{Ii(new Error(`Failed to read file: ${Yn.name}`))},ii.readAsDataURL(Yn)})},Te=50,Tt=(Yn,e0=Te)=>{if(Yn.length<=e0)return Yn;const t0=Yn.lastIndexOf("."),Io=t0!==-1?Yn.slice(t0):"",ri=t0!==-1?Yn.slice(0,t0):Yn,yi=e0-Io.length-1,Ui=Math.ceil(yi/2),Ii=Math.floor(yi/2);return`${ri.slice(0,Ui)}\u2026${ri.slice(-Ii)}${Io}`};var Zt=Object.defineProperty,vn=Object.defineProperties,Hn=Object.getOwnPropertyDescriptors,vr=Object.getOwnPropertySymbols,Wt=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable,Ze=(Yn,e0,t0)=>e0 in Yn?Zt(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,At=(Yn,e0)=>{for(var t0 in e0||(e0={}))Wt.call(e0,t0)&&Ze(Yn,t0,e0[t0]);if(vr)for(var t0 of vr(e0))we.call(e0,t0)&&Ze(Yn,t0,e0[t0]);return Yn},kt=(Yn,e0)=>vn(Yn,Hn(e0)),Qt=(Yn,e0,t0)=>new Promise((Io,ri)=>{var yi=Ti=>{try{Ii(t0.next(Ti))}catch(Fi){ri(Fi)}},Ui=Ti=>{try{Ii(t0.throw(Ti))}catch(Fi){ri(Fi)}},Ii=Ti=>Ti.done?Io(Ti.value):Promise.resolve(Ti.value).then(yi,Ui);Ii((t0=t0.apply(Yn,e0)).next())});const tn=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui})=>{const{linkId:Ii,text:Ti,required:Fi,prefix:ii,readOnly:va,repeats:Sr,extension:ir}=Yn,xr=(0,a.Qr)(ir),Le=(0,a.cz)(ir),Ce=(0,a.$H)(ir)||"image/*,.pdf,.doc,.docx",We=Ti?(0,a.nt)(ri,ii,Ti):"",mt=yi?.[Ii]||"",[Yt,nn]=(0,t.useState)([]),Pn=(0,t.useRef)(t0||[]);(0,t.useEffect)(()=>{t0&&(Pn.current=t0)},[t0]),(0,t.useEffect)(()=>{t0?.length&&nn(Tr=>{const Ur=Tr.filter(Qr=>Qr.isLoading||Qr.failed);return[...t0.filter(Qr=>Qr.valueAttachment).map((Qr,k0)=>{var Bo,ft,$t,An,Ln;const or=((Bo=Qr.valueAttachment)==null?void 0:Bo.title)||`attachment-${k0}`,kr=(ft=Qr.valueAttachment)==null?void 0:ft.id,h0=Tr.find(ao=>kr&&ao.id===kr||!kr&&ao.id===`existing-${k0}`),fo=($t=Qr.valueAttachment)==null?void 0:$t.data,T0=fo?rt(fo,(An=Qr.valueAttachment)==null?void 0:An.contentType):0;return{id:kr||h0?.id||`existing-${k0}`,name:or,size:h0?.size||T0,progress:100,failed:!1,type:(0,a.J4)((Ln=Qr.valueAttachment)==null?void 0:Ln.contentType),isLoading:!1}}),...Ur]})},[t0]);const lr=Tr=>{let Ur=Array.from(Tr);if(Le!==void 0){const Qr=Le-Yt.length;if(Qr<=0)return;Ur=Ur.slice(0,Qr)}const s0=Ur.map(Qr=>{const k0=xr&&Qr.size>xr,Bo=Qr.name.replace(/\s+/g,"-");return{id:tt(),name:Bo,size:Qr.size,progress:0,type:(0,a.J4)(Qr.type),failed:!!k0,isLoading:!k0,disableRetry:!!k0,errorMessage:k0?`File size exceeds ${(xr/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});nn(Qr=>[...Qr,...s0]),s0.filter(Qr=>!Qr.failed).forEach(Qr=>{const k0=Ur.find(Bo=>Bo.name.replace(/\s+/g,"-")===Qr.name);k0&&pn(k0,Qr.id)})},pn=(Tr,Ur)=>Qt(void 0,null,function*(){try{const s0=yield Ue(Tr),Qr=yield Er(s0),k0=s0.name.replace(/\s+/g,"-");nn(An=>An.map(Ln=>Ln.id===Ur?kt(At({},Ln),{isLoading:!1,progress:100,failed:!1}):Ln));const Bo={valueAttachment:{id:Ur,contentType:s0.type,data:Qr,title:k0}},$t=[...(Pn.current||[]).filter(An=>An.valueAttachment||Object.keys(An).length>0),Bo];Pn.current=$t,Io(Yn,$t),e0(Ii)}catch{nn(Qr=>Qr.map(k0=>k0.id===Ur?kt(At({},k0),{isLoading:!1,failed:!0}):k0))}}),Zn=Tr=>{const Ur=Yt.find(s0=>s0.id===Tr);if(nn(s0=>s0.filter(Qr=>Qr.id!==Tr)),Ur){const s0=(Pn.current||[]).filter((Qr,k0)=>{var Bo;if(Tr.startsWith("existing-")){const ft=parseInt(Tr.replace("existing-",""));return k0!==ft}return((Bo=Qr.valueAttachment)==null?void 0:Bo.id)!==Tr}).filter(Qr=>Qr.valueAttachment||Object.keys(Qr).length>0);Pn.current=s0,Io(Yn,s0.length>0?s0:[{}])}},an=Tr=>{const Ur=Yt.find(s0=>s0.id===Tr);if(Ur){nn(Qr=>Qr.map(k0=>k0.id===Tr?kt(At({},k0),{failed:!1,isLoading:!0,progress:0}):k0));const s0=new File([""],Ur.name,{type:"application/octet-stream"});pn(s0,Tr)}},Er=Tr=>new Promise((Ur,s0)=>{const Qr=new FileReader;Qr.onload=()=>{const Bo=Qr.result.split(",")[1];Ur(Bo)},Qr.onerror=s0,Qr.readAsDataURL(Tr)});return(0,n.jsxs)("div",{children:[We&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:We,required:Fi||!1}),(0,n.jsx)(s.FileUpload,{files:Yt,onDropFiles:lr,onDeleteFile:Zn,onRetryFile:an,onDropUnacceptedFiles:()=>{},hint:(0,a.od)(Ce,xr,Le),accept:Ce,allowsMultiple:Sr!==!1,isDisabled:va||Ui||Le!==void 0&&Yt.length>=Le,className:"w-full",showDisclosureModal:!0}),mt&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:mt})]})},Un=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui})=>{var Ii,Ti;const{linkId:Fi,text:ii,prefix:va,readOnly:Sr,required:ir,extension:xr}=Yn,{trackQuestionnaireEvent:Le}=(0,p.c)(),Ce=ii?(0,a.nt)(ri,va,ii):"",We=yi?.[Fi];return xr?.find(Yt=>{var nn,Pn;return Yt.url===i.gD&&((Pn=(nn=Yt.valueCodeableConcept)==null?void 0:nn.coding)==null?void 0:Pn.some(lr=>lr.system===i.n4&&lr.code===i.GI))})?(0,n.jsxs)("div",{"data-testid":Fi,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":Fi,children:[(0,n.jsx)(s.Checkbox,{size:"md",id:Fi,name:Fi,isDisabled:Sr||Ui,isSelected:(Ii=t0?.[0])==null?void 0:Ii.valueBoolean,"aria-label":Fi,label:"",className:"mt-1",onChange:Yt=>{Le(Yn.linkId,{value:Yt}),Io(Yn,[{valueBoolean:Yt}]),e0(Yn.linkId)}}),Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:ir||!1})]}),(0,n.jsx)(s.HintText,{isInvalid:!!We,children:We})]}):(0,n.jsxs)("div",{"data-testid":Fi,children:[Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:ir||!1}),(0,n.jsxs)(s.RadioGroup,{size:"md",id:Fi,name:Fi,"aria-label":Fi,value:String((Ti=t0?.[0])==null?void 0:Ti.valueBoolean)||"",onChange:Yt=>{Io(Yn,[{valueBoolean:Yt==="true"}]),e0(Yn.linkId)},isInvalid:!!We,children:[(0,n.jsx)(s.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Sr||Ui}),(0,n.jsx)(s.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Sr||Ui})]},Fi),We&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,D.cx)("text-error-primary","text-sm","mt-[1.5]"),children:We})})]})};var _r=Object.defineProperty,Lt=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,bt=Object.prototype.propertyIsEnumerable,Ut=(Yn,e0,t0)=>e0 in Yn?_r(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,hn=(Yn,e0)=>{for(var t0 in e0||(e0={}))Ct.call(e0,t0)&&Ut(Yn,t0,e0[t0]);if(Lt)for(var t0 of Lt(e0))bt.call(e0,t0)&&Ut(Yn,t0,e0[t0]);return Yn};const Tn=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui,placeholder:Ii,hintText:Ti})=>{var Fi,ii,va;const{linkId:Sr,text:ir,required:xr,answerOption:Le,prefix:Ce,readOnly:We}=Yn,mt=ir?(0,a.nt)(ri,Ce,ir):"",Yt=Le?.map(lr=>{var pn,Zn,an,Er;return{id:((pn=lr.valueCoding)==null?void 0:pn.code)||lr.valueString||"",label:((Zn=lr.valueCoding)==null?void 0:Zn.display)||lr.valueString||"",value:((an=lr.valueCoding)==null?void 0:an.code)||lr.valueString||"",extension:lr.extension||[],system:((Er=lr.valueCoding)==null?void 0:Er.system)||void 0}})||[],nn=((ii=(Fi=t0?.[0])==null?void 0:Fi.valueCoding)==null?void 0:ii.code)||((va=t0?.[0])==null?void 0:va.valueString)||"",Pn=yi?.[Sr];return(0,n.jsxs)("div",{children:[mt&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:mt,required:xr||!1}),(0,n.jsx)(s.Select,{id:Sr,"aria-label":Sr,"data-testid":Sr,isDisabled:We||Ui,selectedKey:nn,onSelectionChange:lr=>{const pn=String(lr),Zn=Yt.find(Tr=>Tr.value===pn),an=Zn?Zn.label:"",Er=Boolean(Le?.find(Tr=>Tr.valueString===pn));Io(Yn,[Er?{valueString:pn}:{valueCoding:hn({code:pn,display:an},Zn?.system?{system:Zn.system}:{}),extension:Zn?.extension||[]}]),e0(Yn.linkId)},isInvalid:!!Pn,hint:Pn||Ti,items:Yt,placeholder:Ii,isRequired:xr,children:lr=>(0,n.jsx)(s.Select.Item,{id:lr.id,"data-testid":lr.value,value:lr.value,children:lr.label},lr.id)},Sr)]})};var Mr=Object.defineProperty,Cn=Object.getOwnPropertySymbols,gn=Object.prototype.hasOwnProperty,rn=Object.prototype.propertyIsEnumerable,Mt=(Yn,e0,t0)=>e0 in Yn?Mr(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,Pt=(Yn,e0)=>{for(var t0 in e0||(e0={}))gn.call(e0,t0)&&Mt(Yn,t0,e0[t0]);if(Cn)for(var t0 of Cn(e0))rn.call(e0,t0)&&Mt(Yn,t0,e0[t0]);return Yn};const Ht=Yn=>{var e0,t0,Io;const{item:ri,selectedAnswer:yi,updatedText:Ui,required:Ii,errorMessage:Ti}=Yn,Fi=ri?.type==="reference",ii=(e0=yi?.map(Le=>{var Ce,We;return Fi?(Ce=Le.valueReference)==null?void 0:Ce.display:(We=Le.valueCoding)==null?void 0:We.code}).filter(Le=>Le!==void 0))!=null?e0:[],[va,Sr]=(0,t.useState)(ii.length),ir=(Io=(t0=ri.extension)==null?void 0:t0.find(Le=>Le.url===i.Z_))==null?void 0:Io.valueInteger,xr=(Le,Ce)=>{var We,mt,Yt;let nn;if(Le){const Pn=Yn.options.find(lr=>lr.value===Ce);nn=[...(mt=(We=Yn.selectedAnswer)==null?void 0:We.filter(lr=>Object.keys(lr).length!==0))!=null?mt:[],Fi?{valueReference:Pn?.valueReference}:{valueCoding:Pt({code:Ce,display:Pn?.label},Pn?.system?{system:Pn.system}:{}),extension:Pn?.extension||[]}],Sr(lr=>lr+1)}else nn=((Yt=Yn.selectedAnswer)==null?void 0:Yt.filter(Pn=>{var lr,pn;return Fi?((lr=Pn.valueReference)==null?void 0:lr.display)!==Ce:((pn=Pn.valueCoding)==null?void 0:pn.code)!==Ce}))||[{}],Sr(Pn=>Pn-1);Yn.handleInputChange(Yn.item,nn)};return(0,n.jsxs)("div",{"data-testid":ri.linkId,children:[Ui&&(0,n.jsx)(N,{isLabel:!0,text:Ui,required:Ii||!1}),(0,n.jsx)("div",{children:Yn.options.map((Le,Ce)=>(0,n.jsx)(s.Checkbox,{size:"md","data-testid":Le.value,id:Ce.toString(),className:Ce!==Yn.options.length-1?"mb-2xl":"",name:Le.label,isInvalid:!!Ti,isSelected:ii?.includes(Le?.value),label:Le.label,onChange:We=>xr(We,Le.value),isDisabled:Yn.readOnly||Yn.isLoading||(!ii?.includes(Le?.value)&&ir?va>=ir:!1)},Ce))}),(0,n.jsx)(s.HintText,{isInvalid:!!Ti,children:Ti})]})},un=({item:Yn,onCompleteHandler:e0,updatedText:t0,options:Io,handleInputChange:ri,errorMessage:yi,readOnly:Ui,initialValue:Ii,selectedAnswer:Ti,isLoading:Fi,required:ii})=>{var va,Sr;const ir=`${Yn.linkId}-label`,xr=`${Yn.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":Yn.linkId,children:[t0&&(0,n.jsx)(N,{id:ir,isLabel:!0,text:t0,required:ii||!1}),(0,n.jsx)(s.RadioGroup,{size:"md",id:Yn.linkId,name:Yn.linkId,"aria-labelledby":t0?ir:void 0,"aria-describedby":yi?xr:void 0,isRequired:ii,className:Io.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Sr=(va=Ti?.[0])==null?void 0:va.valueCoding)==null?void 0:Sr.code)||Ii||"",onChange:Le=>{const Ce=Le,We=Io.find(Yt=>Yt.value===Ce),mt=We?We.label:"";ri(Yn,[{valueCoding:{code:Ce,display:mt,system:We?.system||void 0},extension:We?.extension||[]}]),e0(Yn.linkId)},isInvalid:!!yi,children:Io.map(Le=>(0,n.jsx)(s.RadioButton,{size:"md","data-testid":Le.value,isDisabled:Ui||Fi,value:Le.value,label:Le.label},Le.value))},Yn.linkId),yi&&(0,n.jsx)("div",{id:xr,children:(0,n.jsx)("span",{className:(0,D.cx)("text-error-primary","text-sm","mt-[1.5]"),children:yi})})]})};var Jt=Object.defineProperty,Sn=Object.getOwnPropertySymbols,jn=Object.prototype.hasOwnProperty,$r=Object.prototype.propertyIsEnumerable,Lr=(Yn,e0,t0)=>e0 in Yn?Jt(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,Fr=(Yn,e0)=>{for(var t0 in e0||(e0={}))jn.call(e0,t0)&&Lr(Yn,t0,e0[t0]);if(Sn)for(var t0 of Sn(e0))$r.call(e0,t0)&&Lr(Yn,t0,e0[t0]);return Yn};const p0=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui,placeholder:Ii,hintText:Ti})=>{var Fi,ii,va,Sr,ir;const{linkId:xr,text:Le,required:Ce,answerOption:We,prefix:mt,readOnly:Yt}=Yn,nn=Yn?.type==="reference",Pn=Le?(0,a.nt)(ri,mt,Le):"",pn=(()=>{var s0,Qr;const k0=We?.find(Bo=>Bo.initialSelected===!0);return k0?nn?((s0=k0.valueReference)==null?void 0:s0.display)||"":((Qr=k0?.valueCoding)==null?void 0:Qr.code)||"":""})(),Zn=(We?.map(s0=>{var Qr,k0,Bo,ft,$t;return{label:((Qr=s0?.valueCoding)==null?void 0:Qr.display)||((k0=s0?.valueReference)==null?void 0:k0.display)||"",value:nn?((Bo=s0.valueReference)==null?void 0:Bo.display)||"":((ft=s0.valueCoding)==null?void 0:ft.code)||"",valueReference:nn?s0.valueReference:{},extension:s0.extension||[],system:(($t=s0.valueCoding)==null?void 0:$t.system)||""}})||[]).filter(s0=>s0.label),an=yi?.[xr],Er=(ir=(Sr=(va=(ii=(Fi=Yn?.extension)==null?void 0:Fi.find(s0=>s0.url.includes("questionnaire-itemControl")))==null?void 0:ii.valueCodeableConcept)==null?void 0:va.coding)==null?void 0:Sr[0])==null?void 0:ir.code;let Tr=null;const Ur={item:Yn,onCompleteHandler:e0,updatedText:Pn,options:Zn,handleInputChange:Io,errorMessage:an,required:Ce,readOnly:Yt,initialValue:pn,selectedAnswer:t0,isLoading:Ui,showQuestionPrefix:ri,placeholder:Ii,hintText:Ti};switch(Er){case"drop-down":Tr=(0,n.jsx)(Tn,Fr({},Ur));break;case"check-box":Tr=(0,n.jsx)(Ht,Fr({},Ur));break;case"radio-button":Tr=(0,n.jsx)(un,Fr({},Ur));break}return(0,n.jsx)(n.Fragment,{children:Tr})};var Mo=e(73697),N0=e(71924),ro=e(46776),W0=e(16681);const Lo=Yn=>`${String(Yn.month).padStart(2,"0")}/${String(Yn.day).padStart(2,"0")}/${Yn.year}`,mr=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui,placeholder:Ii,hintText:Ti})=>{var Fi,ii,va;const{linkId:Sr,text:ir,required:xr,prefix:Le,readOnly:Ce}=Yn,We=(0,t.useRef)(null),[mt,Yt]=(0,t.useState)(!1),[nn,Pn]=(0,t.useState)(null),{t:lr}=(0,r.SS)(),{setIsCurrentFormValid:pn,isCurrentFormValid:Zn,trackQuestionnaireEvent:an}=(0,p.c)(),Er=ir?(0,a.nt)(ri,Le,ir):"",Tr=yi?.[Sr]||"",Ur=(Fi=Yn.extension)==null?void 0:Fi.find(d0=>d0.url===i.dU),s0=(ii=Yn.extension)==null?void 0:ii.find(d0=>d0.url===i.bK),Qr=(0,t.useMemo)(()=>{var d0;const B0=Ur?.valueString||Ur?.valueDate;return B0||(0,a.iI)((d0=Ur?.valueExpression)==null?void 0:d0.expression)},[Ur]),k0=(0,t.useMemo)(()=>{var d0;const B0=s0?.valueString||s0?.valueDate;return B0||(0,a.iI)((d0=s0?.valueExpression)==null?void 0:d0.expression)},[s0]),Bo=(0,t.useMemo)(()=>{if(Qr&&/^\d{4}-\d{2}-\d{2}$/.test(Qr))try{return(0,Mo._U)(Qr)}catch{}return(0,Mo._U)("1900-01-01")},[Qr]),ft=(0,t.useMemo)(()=>{if(k0&&/^\d{4}-\d{2}-\d{2}$/.test(k0))try{return(0,Mo._U)(k0)}catch(d0){console.warn("Failed to parse maxDateStr:",k0,d0)}return(0,Mo._U)("2099-12-31")},[k0]),An=(d0=>{if(!d0)return"";const B0=d0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!B0)return d0;const[,jo,Q0,xi]=B0;return`${Q0}/${xi}/${jo}`})(((va=t0?.[0])==null?void 0:va.valueDate)||""),Ln=d0=>{if(!d0)return"";const B0=d0.replace(/\D/g,"");if(B0.length===0)return"";if(B0.length<=2)return B0.length===2?`${B0}/`:B0;const jo=xi=>{const _o=xi.slice(0,2),Ni=xi.slice(2);return Ni.length===2?`${_o}/${Ni}/`:`${_o}/${Ni}`},Q0=xi=>{const _o=xi.slice(0,2),Ni=xi.slice(2,4),ba=xi.slice(4,8);return`${_o}/${Ni}/${ba}`};return B0.length<=4?jo(B0):Q0(B0)},or=()=>{if(Ce||Ui)return;if(An.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const B0=(0,Mo._U)(An);Pn(B0)}catch{Pn(null)}else{const B0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(B0){const[,jo,Q0,xi]=B0,_o=parseInt(jo,10),Ni=parseInt(Q0,10);if(_o>=1&&_o<=12&&Ni>=1&&Ni<=31)try{const ba=(0,Mo._U)(`${xi}-${jo}-${Q0}`);Pn(ba)}catch{Pn(null)}else Pn(null)}else Pn(null)}Yt(!0)},kr=()=>{if(nn){const d0=`${nn.year}-${String(nn.month).padStart(2,"0")}-${String(nn.day).padStart(2,"0")}`;an(Yn.linkId,{value:(0,a.CP)(`${String(nn.month).padStart(2,"0")}/${String(nn.day).padStart(2,"0")}/${nn.year}`)}),Io(Yn,[{valueDate:(0,a.Fy)(d0)}])}Yt(!1),Pn(null)},h0=()=>{Yt(!1),Pn(null)},fo=d0=>{var B0;const jo=((B0=We.current)==null?void 0:B0.selectionStart)||0,Q0=An,xi=Ln(d0),_o=xi.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(_o){const[,Ni,ba,na]=_o,Vs=parseInt(Ni,10),a1=parseInt(ba,10),Ki=parseInt(na,10);if(T0(Vs,a1,Ki).isValid){const p1=`${na}-${Ni}-${ba}`;an(Yn.linkId,{value:(0,a.CP)(`${Ni}/${ba}/${na}`)}),Io(Yn,[{valueDate:(0,a.Fy)(p1)}])}else Io(Yn,[{valueDate:xi}])}else Io(Yn,[{valueDate:xi}]);setTimeout(()=>{if(We.current){const Ni=Q0.replace(/\D/g,""),ba=xi.replace(/\D/g,"");let na=jo;xi===Q0&&(na=jo-1),ba.length>=Ni.length&&xi!==Q0?xi[jo-1]==="/"?na=jo+1:na=jo:ba.length<Ni.length&&(Q0[jo-1]==="/"?na=Math.max(0,jo-1):na=jo),We.current.setSelectionRange(na,na)}},0)},T0=(d0,B0,jo)=>{if(d0<1||d0>12)return{isValid:!1,error:(0,a.u0)(lr,W0.p.VALIDATION_MONTH_RANGE,"Month must be between 01 and 12")};if(B0<1||B0>31)return{isValid:!1,error:(0,a.u0)(lr,W0.p.VALIDATION_DAY_RANGE,"Day must be between 01 and 31")};const Q0=new Date(jo,d0,0).getDate();if(B0>Q0)return{isValid:!1,error:(0,a.u0)(lr,W0.p.VALIDATION_INVALID_DAY_FOR_MONTH,"Invalid day for the selected month")};if(Qr||k0){const xi=new N0.ng(jo,d0,B0);if(Qr&&/^\d{4}-\d{2}-\d{2}$/.test(Qr))try{const _o=(0,Mo._U)(Qr);if(xi.compare(_o)<0){const Ni=(0,a.di)(i.Ck,Yn.extension);if(Ni)return{isValid:!1,error:Ni};const ba=Lo(_o);return{isValid:!1,error:(0,a.u0)(lr,W0.p.VALIDATION_DATE_ON_OR_AFTER,"Date must be on or after {{minDate}}",{minDate:ba})}}}catch{}if(k0&&/^\d{4}-\d{2}-\d{2}$/.test(k0))try{const _o=(0,Mo._U)(k0);if(xi.compare(_o)>0){const Ni=(0,a.di)(i.Cx,Yn.extension);if(Ni)return{isValid:!1,error:Ni};const ba=Lo(_o);return{isValid:!1,error:(0,a.u0)(lr,W0.p.VALIDATION_DATE_ON_OR_BEFORE,"Date must be on or before {{maxDate}}",{maxDate:ba})}}}catch{}}return{isValid:!0,error:""}},ao=()=>{const d0=An.replace(/\D/g,"");if(d0.length>0&&d0.length<8){e0(Yn.linkId);return}const B0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!B0&&d0.length>=6){e0(Yn.linkId);return}if(B0){const[,jo,Q0,xi]=B0,_o=parseInt(jo,10),Ni=parseInt(Q0,10),ba=parseInt(xi,10);if(T0(_o,Ni,ba).isValid){const na=`${xi}-${jo}-${Q0}`;Io(Yn,[{valueDate:(0,a.Fy)(na)}])}}e0(Yn.linkId)},Eo=(()=>{if(!An)return"";const d0=An.replace(/\D/g,"");if(d0.length>0&&d0.length<8)return"";const B0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!B0&&d0.length>=6)return Zn&&pn(!1),(0,a.u0)(lr,W0.p.VALIDATION_INVALID_DATE,"Invalid date");if(B0){const[,jo,Q0,xi]=B0,_o=parseInt(jo,10),Ni=parseInt(Q0,10),ba=parseInt(xi,10),{isValid:na,error:Vs}=T0(_o,Ni,ba);if(!na)return Zn&&pn(!1),Vs||(0,a.u0)(lr,W0.p.VALIDATION_INVALID_DATE,"Invalid date")}return""})(),No=!!Tr||!!Eo;return(0,n.jsxs)("div",{children:[Er&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Er,required:xr||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Ce||Ui,className:(0,D.cx)("absolute top-3 right-3.5 z-3 cursor-pointer","outline-focus-ring rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2",(Ce||Ui)&&"cursor-not-allowed opacity-50"),onClick:or,"aria-label":"Open calendar",children:(0,n.jsx)(K.V,{className:"size-5 text-gray-400"})}),(0,n.jsx)("div",{className:(0,D.cx)("pointer-events-none absolute top-[7px] right-[2px] z-2 h-[30px] w-[35px] bg-white",(Ce||Ui)&&"bg-disabled_subtle")}),(0,n.jsx)(s.Input,{ref:We,isRequired:xr,size:"md",type:"text",name:Sr,"data-testid":Sr,id:Sr,value:An,onChange:fo,placeholder:Ii,isDisabled:Ce||Ui,onBlur:ao,hint:Eo||Tr||Ti,isInvalid:No,className:(0,D.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Sr)]}),(0,n.jsx)(s.Modal,{id:"calendar-date-picker-modal",isOpen:mt,onOpenChange:d0=>{d0||h0()},primaryButton:{children:"Apply",onClick:kr,isDisabled:!nn},secondaryButton:{children:"Cancel",onClick:h0},children:(0,n.jsx)(ro.lr,{value:nn,onChange:Pn,minValue:Bo,maxValue:ft,children:(0,n.jsx)(s.Calendar,{showDateInput:!1,minValue:Bo,maxValue:ft,onYearPickerOpen:()=>{Pn(null)}})})})]})},gr=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui})=>{var Ii;const{linkId:Ti,text:Fi,required:ii,prefix:va,readOnly:Sr}=Yn,ir=Fi?(0,a.nt)(ri,va,Fi):"",xr=yi?.[Ti]||"";return(0,n.jsxs)("div",{children:[ir&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:ir,required:ii||!1}),(0,n.jsx)(s.Input,{isRequired:ii,size:"md",type:"datetime-local",id:Ti,"aria-label":Ti,"data-testid":Ti,placeholder:"Type your response here...",value:((Ii=t0?.[0])==null?void 0:Ii.valueDateTime)||"",onChange:Le=>{let Ce=Le;const[We,mt]=Ce.split("T");We&&mt&&(Ce=`${(0,a.Fy)(We)}T${mt}:00`),Io(Yn,[{valueDateTime:Ce}])},isDisabled:Sr||Ui,onBlur:()=>{e0(Yn.linkId)},hint:xr,isInvalid:!!xr},Ti)]})},Ar=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui,placeholder:Ii,hintText:Ti})=>{var Fi;const{linkId:ii,text:va,required:Sr,prefix:ir,readOnly:xr}=Yn,Le=va?(0,a.nt)(ri,ir,va):"",Ce=yi?.[ii]||"",We=(0,a.a0)(Yn),mt=(Fi=t0?.[0])==null?void 0:Fi.valueDecimal,[Yt,nn]=(0,t.useState)(String(mt??""));return(0,t.useEffect)(()=>{nn(String(mt??""))},[mt]),(0,n.jsxs)("div",{children:[Le&&(0,n.jsx)(N,{isLabel:!0,text:Le,required:Sr||!1}),(0,n.jsx)(s.Input,{isRequired:Sr,size:"md",id:ii,"aria-label":ii,"data-testid":ii,placeholder:Ii,value:Yt,onChange:Pn=>{nn(Pn)},isDisabled:xr||Ui,onBlur:()=>{const Pn=parseFloat(Yt);nn(isNaN(Pn)?"":String(Pn)),Io(Yn,[{valueDecimal:isNaN(Pn)?void 0:Pn}]),e0(Yn.linkId)},type:"number",hint:Ce||Ti,isInvalid:!!Ce,autoComplete:We},ii)]})},x0=({item:Yn,showStepper:e0=!1})=>{var t0;const{text:Io,linkId:ri,type:yi}=Yn,Ui=Io&&(0,a.nt)(!1,"",Io),Ii=(t0=Yn.extension)==null?void 0:t0.find(va=>va.url===i.Yt),Ti=Ii?.valueBoolean===!0,Fi=yi==="group"&&(0,a.$O)(Yn)!==void 0,ii=()=>{const va=(0,a.$O)(Yn),Sr=(0,a.t7)(Yn);if(va===void 0||Sr===void 0||Sr<=0)return[];const ir=[];for(let xr=1;xr<=Sr;xr++){let Le="incomplete";xr<va?Le="complete":xr===va&&(Le="current"),ir.push({title:"",description:"",status:Le})}return ir};return Ui&&!Ti?(0,n.jsxs)("div",{"data-testid":ri,children:[(0,n.jsx)(N,{text:Ui,required:!1,className:""}),e0&&Fi&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(s.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:ii()})})]}):null},b0=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui,placeholder:Ii,hintText:Ti})=>{var Fi;const{linkId:ii,text:va,required:Sr,prefix:ir,readOnly:xr}=Yn,Le=va?(0,a.nt)(ri,ir,va):"",Ce=yi?.[ii]||"",We=(0,a.a0)(Yn);return(0,n.jsxs)("div",{children:[Le&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Le,required:Sr||!1}),(0,n.jsx)(s.Input,{isRequired:Sr,"data-testid":ii,size:"md",id:ii,"aria-label":ii,placeholder:Ii,value:String((Fi=t0?.[0])==null?void 0:Fi.valueInteger)||"",onChange:mt=>{Io(Yn,[{valueInteger:Number(mt)}])},isDisabled:xr||Ui,onBlur:()=>{e0(Yn.linkId)},type:"number",hint:Ce||Ti,isInvalid:!!Ce,autoComplete:We},ii)]})},eo=({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui,placeholder:Ii,hintText:Ti})=>{var Fi,ii,va;const{linkId:Sr,text:ir,extension:xr,required:Le,prefix:Ce,readOnly:We}=Yn,mt=ir?(0,a.nt)(ri,Ce,ir):"",Yt=xr?.find(lr=>lr.url.includes("questionnaire-unitOption")),nn=yi?.[Sr],Pn=(0,a.a0)(Yn);return(0,n.jsxs)("div",{children:[mt&&(0,n.jsx)(N,{isLabel:!0,text:mt,required:Le||!1}),(0,n.jsx)(s.InputGroup,{isRequired:Le,size:"md",id:Sr,"aria-label":Sr,"data-testid":Sr,value:(Fi=t0?.[0])!=null&&Fi.valueQuantity?String((ii=t0[0].valueQuantity)==null?void 0:ii.value):"",onChange:lr=>{Io(Yn,[{valueQuantity:{value:parseFloat(lr)}}])},isDisabled:We||Ui,onBlur:()=>{var lr,pn,Zn;const an=(lr=t0?.[0])!=null&&lr.valueQuantity?parseFloat(String((Zn=(pn=t0?.[0])==null?void 0:pn.valueQuantity)==null?void 0:Zn.value)).toFixed(2):"";Io(Yn,[{valueQuantity:{value:parseFloat(an)}}]),e0(Yn.linkId)},hint:nn||Ti,isInvalid:!!nn,trailingAddon:(0,n.jsx)("p",{className:"bg-primary ring-primary flex size-full w-max items-center rounded-lg rounded-l-none p-1 text-center ring-1 ring-inset",children:(va=Yt?.valueCoding)==null?void 0:va.display}),children:(0,n.jsx)(s.InputBase,{type:"number",placeholder:Ii,autoComplete:Pn})},Sr)]})},$o={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},Uo={[$o.CURRENT_LOCATION]:W0.p.CURRENT_LOCATION,[$o.ZIP_CODE]:W0.p.ZIP_CODE,[$o.ADDRESS]:W0.p.ADDRESS},ci={mi:{singular:W0.p.MILE,plural:W0.p.MILES}},Pi=({resourceData:Yn,handleInputChange:e0,item:t0,questionnaireSchemaItems:Io})=>{var ri;const{t:yi}=(0,r.SS)(),{queryParams:Ui}=(0,Et.useSearchQueryParams)(),Ii=Ui.locationType||"",{setCurrentGroupIndex:Ti,handleContinueButtonClick:Fi,setHideFooterButton:ii}=(0,p.c)(),{trackEvent:va}=(0,o.st)();(0,t.useEffect)(()=>{if(!t0.readOnly)return ii(!0),()=>{ii(!1)}},[t0.readOnly,ii]);const Sr=(ri=t0.extension)==null?void 0:ri.find(pn=>pn.url===i.Uf),ir=Sr?.valueString,xr=()=>{if(ir){const pn=(0,a.Ue)(Io||[],ir);pn!==-1&&Ti(pn)}},Le=pn=>{const Zn=pn.find(an=>an.url.includes("description"));return Zn?.valueString||""},Ce=pn=>{const Zn=pn.find(Qr=>Qr.url.includes("distance-value")),an=pn.find(Qr=>Qr.url.includes("distance-unit")),Er=Zn?.valueString?Number(Zn.valueString):NaN,Tr=an?.valueString||"";if(!Tr||isNaN(Er))return null;const Ur=Math.round(Er);let s0=Tr;return ci[Tr]&&(s0=yi(Ur===1?ci[Tr].singular:ci[Tr].plural)),Ii&&Uo[Ii]?yi(W0.p.LOCATION_DISTANCE,{distance:`${Ur} ${s0}`,locationType:yi(Uo[Ii])}):yi(W0.p.LOCATION_DISTANCE_AWAY,{distance:`${Ur} ${s0}`})},We=pn=>({id:pn.id||"",providerName:pn.name||"",specialty:"",distance:Ce(pn.extension||[])||"",placeholderIcon:s.WalgreensLogo,address:pn.address||"",valueReference:pn.valueReference||{reference:pn.id}}),mt=pn=>{var Zn,an,Er,Tr;const Ur=pn;return We({id:Ur.id,name:(Zn=Ur.name)!=null?Zn:"",address:(Tr=(Er=(an=Ur?.address)==null?void 0:an.line)==null?void 0:Er[0])!=null?Tr:"",extension:Ur?.extension,valueReference:{reference:Ur.id}})},Yt=pn=>We({id:pn?.reference,name:pn?.display,address:Le(pn?.extension||[]),extension:pn?.extension,valueReference:pn}),Pn=(()=>Yn&&Array.isArray(Yn)&&Yn.length>0?Yn.map(mt):t0.initial&&Array.isArray(t0.initial)&&t0.initial.length>0?t0.initial.map(pn=>Yt(pn.valueReference)):t0.answerOption?t0.answerOption.map(pn=>Yt(pn.valueReference)):[])(),lr=pn=>{e0(t0,[{valueReference:pn}])};return(0,n.jsx)("div",{className:(0,s.cx)("gap-md flex flex-col",!t0.readOnly&&"pb-4xl"),children:t0.readOnly?Pn.map(({address:pn,id:Zn,providerName:an,placeholderIcon:Er,distance:Tr})=>(0,n.jsx)(Et.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Er},locationName:an,address:pn,distance:Tr,actionButtonText:ir?"Change location":void 0,onActionButtonClick:ir?xr:void 0},Zn)):Pn.map(({address:pn,id:Zn,providerName:an,placeholderIcon:Er,specialty:Tr,valueReference:Ur,distance:s0})=>(0,n.jsx)(s.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Er},providerName:{content:an},specialty:{content:Tr},location:{address:pn,distance:s0},actionButton:{children:"Schedule appointment",onClick:()=>{va("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:pn,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),lr(Ur),Fi?.()}}},Zn))})};var Li=e(79079),ti=e(32066),$i=e(43915),vi=e(36181),Gi=e(37234),qi=e(59931),Ga=e(65388),Nr=Object.defineProperty,er=Object.defineProperties,Yr=Object.getOwnPropertyDescriptors,Ir=Object.getOwnPropertySymbols,U0=Object.prototype.hasOwnProperty,bn=Object.prototype.propertyIsEnumerable,$n=(Yn,e0,t0)=>e0 in Yn?Nr(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,zr=(Yn,e0)=>{for(var t0 in e0||(e0={}))U0.call(e0,t0)&&$n(Yn,t0,e0[t0]);if(Ir)for(var t0 of Ir(e0))bn.call(e0,t0)&&$n(Yn,t0,e0[t0]);return Yn},f0=(Yn,e0)=>er(Yn,Yr(e0));const Jn="tz-code",Br={"ui-toolkit/LocationCard":Pi,"ui-toolkit/TimeSlotSelection":({resourceData:Yn,item:e0,handleInputChange:t0,selectedAnswer:Io,questionnaireSchemaItems:ri,formData:yi,onCompleteHandler:Ui})=>{var Ii,Ti;const{t:Fi}=(0,Li.S)(),{trackEvent:ii}=(0,o.st)(),{isLoading:va,setIsInlineNextQuestionTriggered:Sr}=(0,p.c)(),ir=d0=>{const B0=d0.match(/^(\d{4}-\d{2}-\d{2})/);return B0?B0[1]:d0},xr=d0=>{const B0=d0.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return B0?`${B0[1]} ${B0[2]}`:d0},Le=d0=>{const B0=d0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(B0){const[,jo,Q0,xi]=B0;return new Date(parseInt(jo),parseInt(Q0)-1,parseInt(xi))}return new Date},We=(()=>{var d0;if((d0=Io?.[0])!=null&&d0.valueReference){const B0=Io[0].valueReference,jo=B0.display||"",Q0=ir(jo);if(Q0)return{date:Le(Q0),slotId:B0.reference||""}}return{date:new Date,slotId:""}})(),[mt,Yt]=(0,t.useState)(We.date),[nn,Pn]=(0,t.useState)(We.slotId),[lr,pn]=(0,t.useState)(new Set),Zn=(0,t.useMemo)(()=>new N0.ng(mt.getFullYear(),mt.getMonth()+1,mt.getDate()),[mt]),an=d0=>({display:d0.display||"",id:d0.id||"",start:d0.start||"",extension:Array.isArray(d0.extension)?d0.extension:[],identifier:Array.isArray(d0.identifier)?d0.identifier:[],type:d0.type||""}),Er=d0=>an({display:d0.start?xr(d0.start):"",id:d0.id,start:d0.start,extension:d0.extension,identifier:d0.identifier}),Tr=d0=>an({display:d0?.display||"",id:d0?.reference,start:d0?.display,extension:d0?.extension,identifier:d0?.identifier,type:d0?.type}),Ur=()=>{if(Array.isArray(Yn)&&Yn.length>0)return Yn.filter(d0=>d0.resourceType==="Appointment").map(Er);if(e0.initial&&Array.isArray(e0.initial)&&e0.initial.length>0)return e0.initial.map(d0=>Tr(d0.valueReference));if(e0.answerOption)return e0.answerOption.map(d0=>Tr(d0.valueReference))},s0=(0,t.useMemo)(()=>Ur()||[],[Yn,Io,e0]),Qr=(0,t.useMemo)(()=>{const d0={};return s0.forEach(B0=>{if(B0.start&&B0.id){const jo=ir(B0.start);d0[jo]||(d0[jo]=[]),d0[jo].push({display:B0.display,id:B0.id,start:B0.start,extension:B0.extension})}}),d0},[s0]),k0=(0,t.useMemo)(()=>{const d0=Object.keys(Qr).sort(),B0=[];if(d0.length===0)return B0.push(Zn),lr.forEach(xi=>{const _o=(0,$i.A)(xi);B0.push(new N0.ng(_o.getFullYear(),_o.getMonth()+1,_o.getDate()))}),B0;const jo=(0,$i.A)(d0[d0.length-1]),Q0=new N0.ng(jo.getFullYear(),jo.getMonth()+1,jo.getDate());for(let xi=Zn;xi.compare(Q0)<=0;xi=xi.add({days:1})){const _o=`${xi.year}-${String(xi.month).padStart(2,"0")}-${String(xi.day).padStart(2,"0")}`;Qr[_o]||B0.push(xi)}if(!(0,a.mR)(e0)){const xi=(0,ti.Ec)((0,ti.Xj)()).add({days:30});let _o=Q0.add({days:1});for(;_o.compare(xi)<=0;)B0.push(_o),_o=_o.add({days:1})}return lr.forEach(xi=>{const _o=(0,$i.A)(xi),Ni=new N0.ng(_o.getFullYear(),_o.getMonth()+1,_o.getDate());B0.some(ba=>ba.year===Ni.year&&ba.month===Ni.month&&ba.day===Ni.day)||B0.push(Ni)}),B0},[Qr,lr,Zn,e0]),Bo=(0,t.useMemo)(()=>(0,a.mR)(e0)?s.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[e0]),ft=(0,t.useMemo)(()=>Object.keys(Qr).map(d0=>{const B0=(0,$i.A)(d0);return new N0.ng(B0.getFullYear(),B0.getMonth()+1,B0.getDate())}),[Qr]),$t=(0,vi.A)((0,Gi.A)(mt),"yyyy-MM-dd"),An=(0,t.useMemo)(()=>Qr[$t]||[],[Qr,$t]);(0,t.useEffect)(()=>{const d0=Object.entries(Qr).sort(([B0],[jo])=>B0.localeCompare(jo)).slice(0,3).reduce((B0,[jo,Q0])=>f0(zr({},B0),{[`${jo} ${h0}`]:Q0.map(xi=>{var _o;return(0,Ga.YX)({time:xi.start,timeZone:(0,a.lv)((_o=An[0])==null?void 0:_o.extension)}).time})}),{});ii("slots_returned",{Specialty:"Vaccines",first_three_days_slots:d0,_event_metadata:{description:"The API called for bookable slots based on the user's answers on who, when, where and why they want to book an appointment."}})},[]);const Ln=t.useRef(null),or=t.useRef(null),kr=t.useRef(!1);(0,t.useEffect)(()=>{var d0;const B0=Object.keys(Qr).sort();B0.length===0||kr.current||(kr.current=!0,(d0=Io?.[0])!=null&&d0.valueReference||Yt((0,$i.A)(B0[0])))},[Qr]),(0,t.useEffect)(()=>{var d0;const B0=Object.keys(Qr).sort();if(B0.length===0)return;const Q0=!(Ln.current===null)&&JSON.stringify(Ln.current)!==JSON.stringify(Qr);if(Ln.current=Qr,!!Q0&&(pn(new Set),or.current)){const xi=or.current;if(!(((d0=Qr[xi])==null?void 0:d0.length)>0)){const Ni=new Set,ba=(0,$i.A)(xi),na=(0,$i.A)(B0[0]);let Vs=ba;for(;Vs<na;){const a1=(0,vi.A)(Vs,"yyyy-MM-dd");Ni.add(a1),Vs=new Date(Vs),Vs.setDate(Vs.getDate()+1)}pn(Ni),Pn("")}or.current=null}},[Qr]);const h0=(0,t.useMemo)(()=>{var d0;const B0=An[0];if(!B0?.extension)return"";const jo=B0.extension.find(Q0=>Q0?.url===Jn);try{return(0,qi.formatToTimeZone)(new Date,"(z)",{timeZone:(d0=jo?.valueCode)!=null?d0:""})}catch{return""}},[An]),fo=(0,t.useMemo)(()=>{const d0=Fi(s.Translations.NEXT_AVAILABLE_APPOINTMENTS);return h0?`${d0} ${h0}`:d0},[Fi,h0]),T0=(0,t.useMemo)(()=>{const d0=(0,ti.Ec)((0,ti.Xj)()).add({days:Bo}),B0=`${d0.year}-${String(d0.month).padStart(2,"0")}-${String(d0.day).padStart(2,"0")}`,Q0=Object.keys(Qr).sort().find(xi=>xi>$t&&xi<=B0);if(Q0){const xi=(0,$i.A)(Q0);return new N0.ng(xi.getFullYear(),xi.getMonth()+1,xi.getDate())}return null},[Qr,$t,Bo]),ao=()=>{if(T0){const d0=T0.toDate((0,ti.Xj)());Yt(d0),Pn("")}},q0=d0=>{if(!d0){Pn(""),t0(e0,void 0);return}Pn(d0.id);const B0=[{valueReference:{display:d0.display,reference:d0.id,extension:d0.extension,identifier:d0.identifier,type:d0.type}}];t0(e0,B0)},Eo=d0=>{var B0;if(!d0||va||!kr.current)return;const jo=Object.keys(Qr).sort(),Q0=jo[jo.length-1],xi=jo[0],_o=`${d0.year}-${String(d0.month).padStart(2,"0")}-${String(d0.day).padStart(2,"0")}`;if(Q0&&(_o>Q0||xi&&_o<xi)&&(0,a.mR)(e0)&&ri&&!k0?.some(ba=>ba.compare(d0)===0)){const ba=(0,a.yQ)(e0,ri);if(ba){or.current=_o;let na="-06:00";if((B0=s0[0])!=null&&B0.start){const p1=s0[0].start.match(/([+-]\d{2}:\d{2})$/);p1&&(na=p1[1])}const a1=[{valueDateTime:`${_o}T23:59:59${na}`}],Ki=t0(ba,a1);t0(e0,void 0,(0,a.Nw)(Ki||yi||[],e0.linkId),void 0,!0),Sr(!0),Ui(ba.linkId,!0,!0)}}const Ni=d0.toDate((0,ti.Xj)());Yt(Ni),Pn("")},No=d0=>{if(!d0)return;const B0=An.find(jo=>jo.id===d0);ii("slot_selected",{Specialty:"Vaccines",time_slot:B0?(0,Ga.YX)({time:B0.start,timeZone:(0,a.lv)(An[0].extension)}).dateWithTime:"",_event_metadata:{description:"A user clicked an option to select a slot or search a different date set if no slots were found."}}),q0(B0??null)};return(0,n.jsx)(s.TimeSlot,{onChange:Eo,disabledDates:k0,highlightedDates:ft,loading:va,minValue:(0,ti.Ec)((0,ti.Xj)()),maxValue:(0,ti.Ec)((0,ti.Xj)()).add({days:Bo}),value:Zn,defaultValue:Zn,appointmentSlots:{title:fo,onChange:No,defaultValue:Io&&((Ti=(Ii=Io[0])==null?void 0:Ii.valueReference)==null?void 0:Ti.reference)||void 0,value:nn||void 0,items:An.map(d0=>({label:ge(d0.start),value:d0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[Fi(s.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),T0&&(0,n.jsx)("button",{onClick:ao,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:Fi(s.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var io=Object.defineProperty,ko=Object.defineProperties,Ji=Object.getOwnPropertyDescriptors,Hi=Object.getOwnPropertySymbols,aa=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable,S0=(Yn,e0,t0)=>e0 in Yn?io(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,qa=(Yn,e0)=>{for(var t0 in e0||(e0={}))aa.call(e0,t0)&&S0(Yn,t0,e0[t0]);if(Hi)for(var t0 of Hi(e0))zo.call(e0,t0)&&S0(Yn,t0,e0[t0]);return Yn},vs=(Yn,e0)=>ko(Yn,Ji(e0)),Rs=(Yn,e0)=>{var t0={};for(var Io in Yn)aa.call(Yn,Io)&&e0.indexOf(Io)<0&&(t0[Io]=Yn[Io]);if(Yn!=null&&Hi)for(var Io of Hi(Yn))e0.indexOf(Io)<0&&zo.call(Yn,Io)&&(t0[Io]=Yn[Io]);return t0};const zs=(Yn,e0)=>Yn.answerOption?Yn.answerOption.map(t0=>{var Io,ri;const yi=(ri=(Io=t0.valueReference)==null?void 0:Io.reference)==null?void 0:ri.replace("#","");return e0.find(Ui=>Ui.id===yi)}).filter(Boolean):[],is=Yn=>{var e0,t0,Io;const ri=Yn.find(yi=>{var Ui,Ii;return yi.url.includes("questionnaire-itemControl")&&((Ii=(Ui=yi.valueCodeableConcept)==null?void 0:Ui.coding)==null?void 0:Ii.some(Ti=>{var Fi;return(Fi=Ti.code)==null?void 0:Fi.startsWith("ui-toolkit/")}))});return(Io=(t0=(e0=ri?.valueCodeableConcept)==null?void 0:e0.coding)==null?void 0:t0.find(yi=>{var Ui;return(Ui=yi.code)==null?void 0:Ui.startsWith("ui-toolkit/")}))==null?void 0:Io.code},v1=Yn=>{var{uiToolkitCode:e0,props:t0}=Yn,Io=t0,{item:ri,contained:yi=[],customErrorConfigurations:Ui}=Io,Ii=Rs(Io,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:Ti}=(0,p.c)(),Fi=Br[e0];if(!Fi)return(0,n.jsx)(n.Fragment,{});const ii=zs(ri,yi),va=ii.length>0;return!(ri.answerOption&&ri.answerOption.length>0)&&!va&&!ri.readOnly?(Ti(!0),(0,n.jsx)($e,{configKey:e0,customErrorConfigurations:Ui})):(0,n.jsx)(Fi,vs(qa({},Ii),{item:ri,contained:yi,customErrorConfigurations:Ui,resourceData:ii,"data-testid":ri.linkId}))},O0={attachment:tn,choice:p0,boolean:Un,integer:b0,string:({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui,placeholder:Ii,hintText:Ti})=>{var Fi;const{linkId:ii,text:va,required:Sr,prefix:ir,readOnly:xr}=Yn,Le=va?(0,a.nt)(ri,ir,va):"",Ce=yi?.[ii]||"",We=(0,a.a0)(Yn);return(0,n.jsxs)("div",{children:[Le&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Le,required:Sr||!1}),(0,n.jsx)(s.Input,{isRequired:Sr,size:"md","aria-label":ii,"data-testid":ii,id:ii,type:We==="tel"?"tel":"text",placeholder:Ii,value:((Fi=t0?.[0])==null?void 0:Fi.valueString)||"",onChange:mt=>{Io(Yn,[{valueString:mt}])},isDisabled:xr||Ui,onBlur:mt=>{const Yt=mt.target.value,nn=Yt.trim();nn!==Yt&&Io(Yn,[{valueString:nn}]),e0(Yn.linkId)},hint:Ce||Ti,isInvalid:!!Ce,autoComplete:We},ii)]})},url:({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui,placeholder:Ii,hintText:Ti})=>{var Fi;const{linkId:ii,text:va,required:Sr,prefix:ir,readOnly:xr}=Yn,Le=va?(0,a.nt)(ri,ir,va):"",Ce=yi?.[ii]||"",We=(0,a.a0)(Yn);return(0,n.jsxs)("div",{children:[Le&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Le,required:Sr||!1}),(0,n.jsx)(s.Input,{isRequired:Sr,size:"md",type:"url",id:ii,"data-testid":ii,"aria-label":ii,placeholder:Ii,value:((Fi=t0?.[0])==null?void 0:Fi.valueUri)||"",onChange:mt=>{Io(Yn,[{valueUri:mt}])},isDisabled:xr||Ui,onBlur:mt=>{const Yt=mt.target.value,nn=Yt.trim();nn!==Yt&&Io(Yn,[{valueUri:nn}]),e0(Yn.linkId)},hint:Ce||Ti,isInvalid:!!Ce,autoComplete:We},ii)]})},text:({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui,placeholder:Ii,hintText:Ti})=>{var Fi;const{linkId:ii,text:va,required:Sr,prefix:ir,readOnly:xr,maxLength:Le}=Yn,Ce=va?(0,a.nt)(ri,ir,va):"",We=yi?.[ii]||"",mt=(0,a.a0)(Yn);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Sr||!1}),(0,n.jsx)(s.TextArea,{isRequired:Sr,id:ii,"aria-label":ii,"data-testid":ii,rows:3,placeholder:Ii,value:((Fi=t0?.[0])==null?void 0:Fi.valueString)||"",onChange:Yt=>{Io(Yn,[{valueString:Yt}])},isDisabled:xr||Ui,onBlur:Yt=>{const nn=Yt.target.value,Pn=nn.trim();Pn!==nn&&Io(Yn,[{valueString:Pn}]),e0(Yn.linkId)},hint:We||Ti,counter:!0,isInvalid:!!We,maxLength:Le,autoComplete:mt},ii)]})},date:mr,time:({item:Yn,onCompleteHandler:e0,selectedAnswer:t0,handleInputChange:Io,showQuestionPrefix:ri,errors:yi,isLoading:Ui})=>{var Ii;const{linkId:Ti,text:Fi,required:ii,prefix:va,readOnly:Sr}=Yn,ir=Fi?(0,a.nt)(ri,va,Fi):"",xr=yi?.[Ti]||"";return(0,n.jsxs)("div",{children:[ir&&(0,n.jsx)(N,{isLabel:!0,text:ir,required:ii||!1}),(0,n.jsx)(s.Input,{isRequired:ii,size:"md",type:"time",id:Ti,"data-testid":Ti,"aria-label":Ti,placeholder:"Type your response here...",value:((Ii=t0?.[0])==null?void 0:Ii.valueTime)||"",onChange:Le=>{Io(Yn,[{valueTime:Le}])},isDisabled:Sr||Ui,onBlur:()=>{e0(Yn.linkId)},hint:xr,isInvalid:!!xr},Ti)]})},dateTime:gr,quantity:eo,decimal:Ar,question:x0,display:x0,group:x0,reference:Yn=>{var e0,t0,Io,ri,yi;const{setHideFooterButton:Ui}=(0,p.c)(),{item:Ii,customErrorConfigurations:Ti}=Yn,Fi=Ii.extension||[],ii=is(Fi);return ii?(0,n.jsx)(v1,{uiToolkitCode:ii,props:Yn}):((yi=(ri=(Io=(t0=(e0=Ii?.extension)==null?void 0:e0.find(Sr=>Sr.url.includes("questionnaire-itemControl")))==null?void 0:t0.valueCodeableConcept)==null?void 0:Io.coding)==null?void 0:ri[0])==null?void 0:yi.code)==="check-box"?Ii.answerOption&&Ii.answerOption.length>0?(0,n.jsx)(p0,vs(qa({},Yn),{item:Ii})):(Ui(!0),(0,n.jsx)($e,{configKey:Ii.linkId,customErrorConfigurations:Ti})):null}};var _0=(Yn,e0,t0)=>new Promise((Io,ri)=>{var yi=Ti=>{try{Ii(t0.next(Ti))}catch(Fi){ri(Fi)}},Ui=Ti=>{try{Ii(t0.throw(Ti))}catch(Fi){ri(Fi)}},Ii=Ti=>Ti.done?Io(Ti.value):Promise.resolve(Ti.value).then(yi,Ui);Ii((t0=t0.apply(Yn,e0)).next())});const Ft=({item:Yn,selectedAnswer:e0,showQuestionPrefix:t0})=>{const{text:Io,prefix:ri,required:yi}=Yn,Ui=Io?getUpdatedQuestionText(t0,ri,Io):"",[Ii,Ti]=useState(null),[Fi,ii]=useState(!1),{documentDownload:va,webview:Sr}=useNativeBridge(),ir=(e0||[]).filter(We=>{var mt,Yt;return((mt=We.valueAttachment)==null?void 0:mt.data)&&((Yt=We.valueAttachment)==null?void 0:Yt.title)}).map((We,mt)=>{var Yt,nn,Pn,lr,pn,Zn,an;return{id:((Yt=We.valueAttachment)==null?void 0:Yt.id)||`preview-${mt}`,fileName:((nn=We.valueAttachment)==null?void 0:nn.title)||`attachment-${mt}`,contentType:((Pn=We.valueAttachment)==null?void 0:Pn.contentType)||"application/octet-stream",base64Data:((lr=We.valueAttachment)==null?void 0:lr.data)||"",size:getBase64Size(((pn=We.valueAttachment)==null?void 0:pn.data)||"",(Zn=We.valueAttachment)==null?void 0:Zn.contentType),type:getFileTypeFromMimeType((an=We.valueAttachment)==null?void 0:an.contentType)}}),xr=useCallback(We=>{const{fileName:mt,contentType:Yt,base64Data:nn}=We;if(Sr.isWithin)Ti({fileName:mt,contentType:Yt,base64Data:nn}),ii(!0);else{const Pn=base64toObjectUrl(nn,Yt),lr=document.createElement("a");lr.href=Pn,lr.download=mt,document.body.appendChild(lr),lr.click(),document.body.removeChild(lr),URL.revokeObjectURL(Pn)}},[Sr.isWithin]),Le=useCallback(()=>_0(void 0,null,function*(){!Ii||(yield va.writeFile(Ii.fileName,prepareDataUrl(Ii.base64Data,Ii.contentType)))}),[Ii,va]),Ce=useCallback(()=>{ii(!1),Ti(null)},[]);return ir.length?jsxs("div",{children:[Ui&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:Ui,required:yi||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:ir.map(We=>jsx("button",{type:"button",onClick:()=>xr(We),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(We.fileName),size:We.size,type:We.type})},We.id))}),jsx(DownloadDisclosureModal,{opened:Fi,onClose:Ce,onDownload:Le,contentType:Ii?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var Ke=Object.defineProperty,ut=Object.defineProperties,Nt=Object.getOwnPropertyDescriptors,In=Object.getOwnPropertySymbols,ar=Object.prototype.hasOwnProperty,Pr=Object.prototype.propertyIsEnumerable,z0=(Yn,e0,t0)=>e0 in Yn?Ke(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,H0=(Yn,e0)=>{for(var t0 in e0||(e0={}))ar.call(e0,t0)&&z0(Yn,t0,e0[t0]);if(In)for(var t0 of In(e0))Pr.call(e0,t0)&&z0(Yn,t0,e0[t0]);return Yn},K0=(Yn,e0)=>ut(Yn,Nt(e0));const ni=(Yn,e0,t0,Io)=>{var ri;const yi=Yn.extension||[];if(Io?.[BUTTON_TYPE_EXTERNAL_KEY]&&yi.some(ii=>ii.url===BUTTON_TYPE_EXTENSION_URL))return Io[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(Yn)||hasParentWithUIToolkitWidget(Yn,e0))return null;if(t0&&Yn.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const Ui=getUIToolkitCode(yi),Ii=yi.filter(ii=>ii.url.includes("questionnaire-itemControl")).flatMap(ii=>{var va,Sr;return(Sr=(va=ii.valueCodeableConcept)==null?void 0:va.coding)!=null?Sr:[]})||[];let Ti;return Io&&(Ti=(ri=Ii.find(ii=>ii.code&&Io[ii.code]))==null?void 0:ri.code),(Ti&&Io?Io[Ti]:void 0)||UI_TOOLKIT_WIDGET_MAP[Ui||""]||typeToRenderFunctionMap[Yn.type]||null},Yo=Yn=>{var e0;const{item:t0,selectedAnswer:Io,handleInputChange:ri,showQuestionPrefix:yi,errors:Ui,questionnaireSchemaItems:Ii,formData:Ti,isNestedRepeatedItem:Fi=!1}=Yn,{linkId:ii,text:va,prefix:Sr,required:ir,repeats:xr}=t0,Le=getMaxOccursFromExtensions(t0.extension),Ce=getPlaceholderFromExtensions(t0.extension,t0.type),[We,mt]=useState(()=>{if(t0.type==="group"&&t0.item&&t0.item.length>0){const s0=Ti?.filter(Qr=>Qr.linkId===t0.linkId)||[];if(s0.length>0)return s0.map((Qr,k0)=>k0)}else if(Io&&Io.length>0)return Io.map((s0,Qr)=>Qr);return[0]}),Yt=Le!==void 0&&We.length>=Le,nn=va?getUpdatedQuestionText(yi,Sr,va):"",Pn=()=>{const s0=Math.max(...We,-1)+1,Qr=[...We,s0];if(mt(Qr),t0.type==="group"&&t0.item&&t0.item.length>0){const k0=t0.item.map(ft=>({linkId:ft.linkId,text:ft.text,answer:[{}]})),Bo={linkId:t0.linkId,text:t0.text,answer:[{}],item:k0};ri(t0,void 0,[Bo])}else{const k0=[...Io||[]];k0.push({}),ri(t0,k0)}},lr=s0=>{if(We.length<=1)return;const Qr=We.filter((k0,Bo)=>Bo!==We.length-1);if(mt(Qr),t0.type==="group"&&t0.item&&t0.item.length>0){const k0=[];if(Ti?.forEach((Bo,ft)=>{Bo.linkId===ii&&k0.push({item:Bo,originalIndex:ft})}),s0>=0&&s0<k0.length){const Bo=k0[s0],ft=Ti?.filter(($t,An)=>An!==Bo.originalIndex);ri(t0,void 0,ft,void 0,!0)}}else{const k0=Io?.filter((Bo,ft)=>ft!==s0)||[];ri(t0,k0.length>0?k0:[{}])}},pn=s0=>{if(!Ti||!t0.item)return[];const Qr=ft=>{const $t=[];for(const An of ft)if(An.linkId===t0.linkId&&$t.push(An),An.item&&An.item.length>0){const Ln=Qr(An.item);$t.push(...Ln)}return $t},Bo=Qr(Ti)[s0];return Bo?.item?Bo.item:[]},Zn=(s0,Qr)=>{if(isHiddenExtensionPresent(s0))return null;const k0=pn(Qr);if(!isQuestionEnabledForInstance(s0.enableWhen,s0.enableBehavior,Ti||[],t0.linkId,Qr))return null;if(s0.repeats){const Ln=findNestedAnswer(k0,s0.linkId),or=K0(H0({},Yn),{item:s0,selectedAnswer:Ln||[{}],errors:getInstanceErrors(Ui,t0,Qr),handleInputChange:(kr,h0,fo)=>ri(kr,h0,fo,Qr)});return jsx("div",{children:jsx(Yo,K0(H0({},or),{isNestedRepeatedItem:!0}))},s0.linkId)}if(s0.type==="group"&&s0.item&&!getUIToolkitCode(s0?.extension||[]))return jsxs("div",{children:[s0.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:s0.text}),jsx("div",{className:"space-y-3",children:s0.item.map(Ln=>{if(!isQuestionEnabledForInstance(Ln.enableWhen,Ln.enableBehavior,Ti||[],t0.linkId,Qr))return null;const kr=ni(Ln,Ii,Yn.isLoading,Yn.externalComponentRenderMap);if(!kr)return null;const h0=findNestedAnswer(k0,Ln.linkId),fo=K0(H0({},Yn),{item:Ln,selectedAnswer:h0,placeholder:getPlaceholderFromExtensions(Ln.extension,Ln.type),errors:getInstanceErrors(Ui,t0,Qr),handleInputChange:(T0,ao,q0)=>ri(T0,ao,q0,Qr)});return createElement(kr,K0(H0({},fo),{key:Ln.linkId}))})})]},s0.linkId);const ft=ni(s0,Ii,Yn.isLoading,Yn.externalComponentRenderMap);if(!ft)return null;const $t=findNestedAnswer(k0,s0.linkId),An=K0(H0({},Yn),{item:s0,selectedAnswer:$t,placeholder:getPlaceholderFromExtensions(s0.extension,s0.type),errors:getInstanceErrors(Ui,t0,Qr),handleInputChange:(Ln,or,kr)=>ri(Ln,or,kr,Qr)});return createElement(ft,K0(H0({},An),{key:`${s0.linkId}-${Qr}`}))},an=()=>{const s0=getDirectErrors(Ui,ii);return jsxs("div",{className:"flex flex-col gap-2",children:[s0[ii]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:s0[ii]}),!Yt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:Pn,className:"mt-4 text-center",isDisabled:Yn.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},Er=s0=>We.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>lr(s0),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${s0+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:Yn.isLoading}),Tr=ni(t0,Ii,Yn.isLoading,Yn.externalComponentRenderMap);return hasRepeatingParent(t0,Ii)&&!Fi?null:!xr||xr&&hasCheckboxExtension(t0)?Tr?jsx(Tr,K0(H0({},Yn),{placeholder:Ce,errors:{[t0.linkId]:((e0=Ui?.[t0.linkId])==null?void 0:e0[0])||""}})):null:t0.type==="group"&&t0.item&&t0.item.length>0&&t0.repeats?jsxs("div",{"data-testid":`${ii}-repeating`,children:[nn&&jsx(FHIRQuestionnaireQuestionText,{text:nn,required:ir||!1}),We.map(s0=>{var Qr;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${s0>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",s0+1]}),Er(s0)]}),jsx("div",{className:"space-y-4",children:(Qr=t0.item)==null?void 0:Qr.map(k0=>Zn(k0,s0))})]},`${ii}-instance-${s0}`)}),an()]}):Tr?jsxs("div",{"data-testid":`${ii}-repeating`,children:[We.map(s0=>{const Qr=Io?.[s0]?[Io[s0]]:void 0,k0=K0(H0({},Yn),{item:t0,selectedAnswer:Qr,errors:getInstanceErrors(Ui,t0,s0),handleInputChange:(Bo,ft,$t)=>ri(Bo,ft,$t,s0)});return jsxs("div",{className:"relative mb-2",children:[jsxs("div",{className:"flex items-end justify-between",children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",s0+1]}),Er(s0)]}),jsx(Tr,H0({},k0))]},`${ii}-instance-${s0}`)}),jsxs("div",{children:[(()=>{const Qr=getDirectErrors(Ui,ii)[ii];return Qr&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:Qr})})(),!Yt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:Pn,className:"mt-4 text-center",isDisabled:Yn.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var di=Object.defineProperty,Wi=Object.defineProperties,ma=Object.getOwnPropertyDescriptors,ea=Object.getOwnPropertySymbols,ga=Object.prototype.hasOwnProperty,Ya=Object.prototype.propertyIsEnumerable,_s=(Yn,e0,t0)=>e0 in Yn?di(Yn,e0,{enumerable:!0,configurable:!0,writable:!0,value:t0}):Yn[e0]=t0,Ea=(Yn,e0)=>{for(var t0 in e0||(e0={}))ga.call(e0,t0)&&_s(Yn,t0,e0[t0]);if(ea)for(var t0 of ea(e0))Ya.call(e0,t0)&&_s(Yn,t0,e0[t0]);return Yn},Ls=(Yn,e0)=>Wi(Yn,ma(e0));const i1=null,es=({formId:Yn,questionnaireSchema:e0,questionnaireResponseItem:t0,errorConfig:Io,customErrorConfigurations:ri,showQuestionPrefix:yi=!0,isAdaptiveFlow:Ui=!1,status:Ii,hideBackButton:Ti=!1,showStepper:Fi=!1,onComplete:ii,onClearError:va,handleHiddenQuestion:Sr,onGoBack:ir,onFormDataChange:xr=()=>{},externalComponentRenderMap:Le,children:Ce})=>{var We,mt;const{setHandleContinueButtonClick:Yt,setHandleBackButtonClick:nn,setIsCurrentFormValid:Pn,setCurrentGroupLinkId:lr,setCurrentGroupIndex:pn,setTotalSteps:Zn,setHideFooterButton:an,setIsInlineNextQuestionTriggered:Er,isCurrentFormValid:Tr,currentGroupIndex:Ur,isLoading:s0,hasCustomError:Qr,groupItemIndicesRef:k0}=useFHIRQuestionnaire(),{trackEvent:Bo}=useAnalytics(),{t:ft}=useUIToolkitTranslations(),[$t,An]=useState([]),[Ln,or]=useState(new Set),[kr,h0]=useState([]),[fo,T0]=useState([]),ao=k0,q0=useRef(new Map),Eo=useRef(new Set),[No,d0]=useState({}),[B0,jo]=useState(!1),[Q0,xi]=useState(e0),_o=useRef(t0||[]),Ni=useRef(!1),ba=useRef(!1),na=useMemo(()=>getTotalStepsFromQuestionnaire(e0),[e0]),[Vs,a1]=useState(!1),Ki=useRef([]),p1=(qo,li)=>{var Xo,wi,Ba,Pa,Ja;if(isCallNextQuestionExtensionPresent(qo))return qo.linkId;const wa=validateCurrentPage(li,$t,Ur,Q0,ao),ts=ao.current[Ur],Y1=Ur+1,R1=ao.current[Y1],ul=Ur===0?0:ts,Dl=(wi=R1??((Xo=Q0?.item)==null?void 0:Xo.length))!=null?wi:0;let hl=-1;for(let Wn=ul;Wn<Dl;Wn++){const zi=(Ba=Q0?.item)==null?void 0:Ba[Wn];if(zi?.linkId===qo.linkId){hl=Wn;break}}const eu=(Wn,zi=[])=>(Wn.forEach(Ri=>{var Xa;if((!Ri.enableWhen||isQuestionEnabled(Ri.enableWhen,Ri.enableBehavior,li))&&isCallNextQuestionExtensionPresent(Ri)&&!Ki.current.includes(Ri.linkId))if(Ri.required){const M1=(Xa=findResponseItem(li,Ri.linkId))==null?void 0:Xa.answer;(M1&&M1.length>0&&Object.keys(M1[0]).length>0||Ri.initial&&Ri.initial.length>0&&!Ln.has(Ri.linkId))&&zi.push(Ri.linkId)}else zi.push(Ri.linkId);Ri.item&&Ri.item.length>0&&eu(Ri.item,zi)}),zi),Ou=[],Ao=hl!==-1?hl+1:Dl;for(let Wn=ul;Wn<Ao;Wn++){const zi=(Pa=Q0?.item)==null?void 0:Pa[Wn];zi&&eu([zi],Ou)}if(Ou.length>0&&wa){const Wn=Ou[Ou.length-1],zi=M1=>M1.flatMap(B1=>[B1,...B1.item?zi(B1.item):[]]),Ri=zi((Ja=Q0?.item)!=null?Ja:[]),Xa=Ri.findIndex(M1=>M1.linkId===Wn),Wa=Ri.findIndex(M1=>M1.linkId===qo.linkId);return Xa!==-1&&Wa>Xa?void 0:Wn}},Js=qo=>p1(qo,_o.current)?!0:qo.item&&qo.item.length>0?qo.item.some(Js):!1,bs=()=>{var qo;if(!Ui||Ur<0||!Q0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const li=ao.current[Ur],wi=(q0.current.get(li)||[li]).some(Ja=>{var wa;const ts=(wa=Q0.item)==null?void 0:wa[Ja];return ts?Js(ts):!1}),Ba=Ur<ao.current.length-1;let Pa=!1;if(wi&&Ba){const Ja=Ur+1,wa=ao.current[Ja],ts=(qo=Q0?.item)==null?void 0:qo[wa],Y1=!ts?.enableWhen||isQuestionEnabled(ts.enableWhen,ts.enableBehavior,_o.current),R1=ts?isPageExtensionPresent(ts):!1;Pa=Y1&&R1}return{shouldTriggerInlineLoading:wi,canNavigateToNextGroup:Pa,hasMoreGroups:Ba}},w1=(qo,li,Xo,wi)=>{const Ba=getUpdatedFormData(Q0?.item||[],_o.current,qo,li,Xo,wi);return _o.current=Ba,xr(Ba),Ba},Or=(qo,li,Xo,wi,Ba)=>{w1(li,Xo,wi,Ba),wi.forEach(Pa=>{const Ja=getValidationError(Ls(Ea({},qo),{linkId:Pa.linkId}),_o.current,Pa.answer,ft);Ja&&d0(wa=>Ls(Ea({},wa),{[Pa.linkId]:typeof Ba=="number"?Ls(Ea({},wa[Pa.linkId]),{[Ba]:Ja}):Ja}))})},Qn=(qo,li,Xo,wi,Ba)=>{var Pa;const Ja=w1(li,Xo,wi,Ba),wa=(Pa=findResponseItem(Ja,li))==null?void 0:Pa.answer,ts=getValidationError(qo,_o.current,wa,ft);d0(Y1=>Ls(Ea({},Y1),{[li]:typeof Ba=="number"?Ls(Ea({},Y1[li]),{[Ba]:ts}):ts}))},Dr=(qo,li)=>{const Xo=validateCurrentPage(li,$t,Ur,Q0,ao);if(Pn(Xo),Q0?.item){const wi=validateAllItemsRecursively(Q0.item,li,ft);if(Object.keys(wi).length>0)d0(Ba=>Ea(Ea({},Ba),wi));else{const Ba=Q0.item,Pa={},Ja=wa=>{wa.forEach(ts=>{Pa[ts.linkId]={},ts.item&&Ja(ts.item)})};Ja(Ba),d0(wa=>Ea(Ea({},wa),Pa))}}},dr=(qo,li,Xo,wi,Ba=!1)=>{var Pa;const{linkId:Ja}=qo;if(Ba)return _o.current=Xo||[],Dr(Ja,Xo||[]),_o.current;if(Xo&&Xo.length>0&&qo.type==="group"&&qo.repeats){let R1=_o.current.length;for(let Dl=_o.current.length-1;Dl>=0;Dl--)if(_o.current[Dl].linkId===Ja){R1=Dl+1;break}const ul=[..._o.current.slice(0,R1),...Xo,..._o.current.slice(R1)];return _o.current=ul,Dr(Ja,ul),_o.current}if(typeof wi=="number"&&li){const R1=hasRepeatingParent(qo,Q0?.item||[]);if(R1){const ul=_o.current.filter(hl=>hl.linkId===R1.linkId);if(wi<ul.length){const hl=_o.current.map(eu=>{if(eu.linkId===R1.linkId&&_o.current.slice(0,_o.current.indexOf(eu)).filter(Ao=>Ao.linkId===R1.linkId).length===wi){const Ao=(Ri,Xa)=>{const Wa=new Map(Ri.map(B1=>[B1.linkId,B1])),M1=[];return Xa?.forEach(B1=>{const Ol=Wa.get(B1.linkId);if(B1.linkId===Ja)M1.push(Ea({linkId:B1.linkId,text:B1.text,answer:li},Ol?.item&&{item:Ol.item}));else if(Ol)if(B1.item&&B1.item.length>0){const b1=Ao(Ol.item||[],B1.item);M1.push(Ls(Ea({},Ol),{item:b1}))}else M1.push(Ol);else if(B1.item&&B1.item.length>0){const b1=Ao([],B1.item);b1.some(d1=>d1.linkId===Ja||d1.item&&Wn(d1.item,Ja))&&M1.push({linkId:B1.linkId,text:B1.text,answer:[{}],item:b1})}Wa.delete(B1.linkId)}),Wa.forEach(B1=>{M1.push(B1)}),M1},Wn=(Ri,Xa)=>Ri.some(Wa=>Wa.linkId===Xa||Wa.item&&Wn(Wa.item,Xa)),zi=Ao(eu.item||[],R1.item);return Ls(Ea({},eu),{item:zi})}return eu});_o.current=hl,xr(hl)}else{const hl=wi+1,eu=ul.length;if(eu<hl||hl===1){const Ou=[],Ao=(Ri,Xa,Wa)=>Ri.map(M1=>{const B1={linkId:M1.linkId,text:M1.text,answer:M1.linkId===Xa?Wa:[{}]};return M1.item&&M1.item.length>0&&(B1.item=Ao(M1.item,Xa,Wa)),B1});for(let Ri=eu;Ri<hl;Ri++){const Xa=R1.item?Ao(R1.item,Ja,li):[],Wa={linkId:R1.linkId,text:R1.text,answer:[{}],item:Xa};Ou.push(Wa)}let Wn=_o.current.length;for(let Ri=_o.current.length-1;Ri>=0;Ri--)if(_o.current[Ri].linkId===R1.linkId){Wn=Ri+1;break}const zi=[..._o.current.slice(0,Wn),...Ou,..._o.current.slice(Wn)];_o.current=zi,xr(zi)}}const Dl=getValidationError(qo,_o.current,li,ft);return d0(hl=>Ls(Ea({},hl),{[Ja]:typeof wi=="number"?Ls(Ea({},hl[Ja]),{[wi]:Dl}):Dl})),Dr(Ja,_o.current),_o.current}}if(typeof wi=="number")return Xo&&Xo.length>0?Or(qo,Ja,li,Xo,wi):Qn(qo,Ja,li,Xo,wi),_o.current;const wa=w1(Ja,li,Xo),ts=(Pa=findResponseItem(wa,Ja))==null?void 0:Pa.answer,Y1=getValidationError(qo,wa,ts,ft);return d0(R1=>Ls(Ea({},R1),{[Ja]:typeof wi=="number"?Ls(Ea({},R1[Ja]),{[wi]:Y1}):Y1})),Dr(Ja,wa),_o.current},Vr=()=>{var qo;for(let li=Ur+1;li<ao.current.length;li++){const Xo=ao.current[li],wi=(qo=Q0?.item)==null?void 0:qo[Xo];if(!!wi&&(!wi.enableWhen||isQuestionEnabled(wi.enableWhen,wi.enableBehavior,_o.current)))return!0}return!1},V0=()=>{var qo,li,Xo,wi,Ba;const Pa=(qo=e0?.item)==null?void 0:qo[ao.current[Ur]];if(Pa){const ts=(li=getAnalyticsEventName(Pa))!=null?li:"questionnaire_form",Y1=getAnalyticsPageName(Pa);if(Y1){const R1=(Xo=getAnalyticsFormName(e0))!=null?Xo:e0.name,ul=collectAnalyticsProperties(Pa,_o.current),Dl={};R1&&(Dl.form_name=R1),Dl.page_name=Y1,Object.assign(Dl,ul),Bo(ts,Dl)}}const Ja=Ur<ao.current.length-1,wa=checkCurrentStepDataMatch(_o.current,Q0,ao.current,Ur,t0,ao.current.length-1);if(Ui&&Ja){const ts=Ur+1,Y1=ao.current[ts],R1=(wi=Q0?.item)==null?void 0:wi[Y1],ul=!R1?.enableWhen||isQuestionEnabled(R1.enableWhen,R1.enableBehavior,_o.current),Dl=R1?isPageExtensionPresent(R1):!1;if(ul&&Dl&&wa){pn(ts),Pn(!1),window.scrollTo(0,0);return}}if(wa&&ao.current.length>0){Vr()?pn(Ur+1):(ii(removeDisabledItems(_o.current,Q0?.item||[])),Pn(!1),window.scrollTo(0,0));return}if(Ur<ao.current.length-1){const ts=(Ba=Q0?.item)==null?void 0:Ba[ao.current[Ur]];if(!ts){ii(removeDisabledItems(_o.current,Q0?.item||[]));return}const Y1=ts.linkId,R1=findLastGroupInstanceIndex(_o.current,Y1),ul=_o.current.slice(0,R1+1);if(!validateCurrentPage(ul,$t,Ur,Q0,ao))return;Ui?(_o.current=ul,xr(ul),ii(_o.current),Pn(!1)):ao.current.length>0&&(Vr()?pn(Ur+1):(ii(removeDisabledItems(_o.current,Q0?.item||[])),window.scrollTo(0,0)))}else ii(removeDisabledItems(_o.current,Q0?.item||[])),Pn(!1),window.scrollTo(0,0)};useEffect(()=>{var qo;Yt(()=>V0),nn(()=>Ai),Pn(Tr);const li=(qo=Q0?.item)==null?void 0:qo[ao.current[Ur]];li&&lr(li.linkId)},[Tr,Ur]),useEffect(()=>{if(!e0?.item)return;const{groupIndices:qo,itemsToRenderMap:li}=collectGroupItemIndices(e0.item);ao.current=qo,q0.current=li;const Xo=na??qo.length;Zn(Xo),h0(qo),Ui?(ba.current||pn(qo.length>0?qo.length-1:0),Er(!1),ba.current=!1):Ur===-1&&pn(0)},[e0?.item,na]),useEffect(()=>{if(Ur<0||!Q0?.item)return;const qo=validateCurrentPage(_o.current,$t,Ur,Q0,ao);if(!qo){Pn(!1);return}const{shouldTriggerInlineLoading:li,canNavigateToNextGroup:Xo,hasMoreGroups:wi}=bs();if(Ui&&li){if(!wi){Pn(!1);return}if(Xo&&qo){Pn(!0);return}else{Pn(!1);return}}Pn(qo)},[Ur,Q0?.item,Qr,Ui,_o.current,$t]),useEffect(()=>{if(!e0?.item||Ni.current)return;const qo=initializeQuestionnaireItems(e0.item,_o.current,e0.item,_o.current);if(qo!==_o.current){_o.current=qo;const Xo=(Ba=>{const Pa=new Set,Ja=wa=>{wa.forEach(ts=>{var Y1;const R1=ts.initial&&ts.initial.length>0,ul=(ts.type==="choice"||ts.type==="open-choice")&&((Y1=ts.answerOption)==null?void 0:Y1.some(Dl=>Dl.initialSelected===!0));(R1||ul)&&(!ts.enableWhen||isQuestionEnabled(ts.enableWhen,ts.enableBehavior,_o.current))&&Pa.add(ts.linkId),ts.item&&Ja(ts.item)})};return Ja(Ba),Pa})(Q0?.item||[]);or(Xo);const wi=validateAllItemsRecursively(Q0?.item||[],_o.current,ft);Object.keys(wi).length>0&&d0(Ba=>Ea(Ea({},Ba),wi))}Ni.current=!0},[Q0?.item,e0,ft]),useEffect(()=>{xi(e0)},[e0]),useEffect(()=>{Ur>=0&&window.scrollTo(0,0)},[Ur]),useEffect(()=>{var qo;if(!Ui||$t.length===0||s0||!Q0?.item)return;const li=ao.current[Ur];if(li===void 0)return;const Xo=q0.current.get(li)||[li],wi=[];if(Xo.forEach(ts=>{var Y1;const R1=(Y1=Q0?.item)==null?void 0:Y1[ts];R1&&hasInitialValue(R1)&&wi.push(R1)}),wi.length===0||!wi.some(ts=>p1(ts,_o.current)&&!Ki.current.includes(ts.linkId)?(Ki.current.push(ts.linkId),!0):!1))return;const Pa=validateCurrentPage(_o.current,$t,Ur,Q0,ao),Ja=(qo=Q0?.item)==null?void 0:qo[li],wa=isHiddenAnswerInValid(Ja,_o.current);!Pa||wa||(Eo.current.add(Ur),Er(!0),ba.current=!0,Z0(wi[wi.length-1].linkId))},[Ur,$t,Ui,s0,Q0]);const Z0=(qo,li=!1,Xo=!1)=>{var wi;if(li){ii(removeDisabledItems(_o.current,Q0?.item||[]),Xo),Pn(!1);return}const Ba=findQuestionByLinkId(Q0?.item||[],qo);if(!Ba)return;const Pa=(wi=findResponseItem(_o.current,qo))==null?void 0:wi.answer;if(getValidationError(Ba,_o.current,Pa,ft))return;const Ja=getUpdatedFormData(Q0?.item||[],_o.current,qo,Pa),wa=p1(Ba,Ja);if(!wa)return;Pn(!1);const ts=findRootGroupLinkId(Q0?.item||[],qo);let Y1=Ja,R1=[];const ul=deepTrimFormData(Ja,wa,Q0?.item||[]);Y1=ul.trimmedData,R1=ul.trimmedLinkIds;const Dl=findQuestionByLinkId(Q0?.item||[],ts||"");_o.current=Y1;const hl=findGroupPositionByLinkId(Q0?.item||[],qo||""),eu=hl!==-1?hl:Ur;if(validateCurrentPage(Y1,$t,eu,Q0,ao,R1)&&!isHiddenAnswerInValid(Dl,Y1)){Er(!0),ba.current=!0;let Ao;const Wn=(()=>{var Xa;const Wa=e1=>e1.flatMap(d1=>[d1,...d1.item?Wa(d1.item):[]]),M1=Wa((Xa=Q0?.item)!=null?Xa:[]),B1=M1.findIndex(e1=>e1.linkId===wa),Ol=new Set;let b1=!0;for(;b1;){b1=!1;for(const e1 of M1){if(Ol.has(e1.linkId)||!e1.enableWhen)continue;e1.enableWhen.some(Q1=>{const Wl=M1.findIndex(_l=>_l.linkId===Q1.question);return Wl!==-1&&Wl<=B1||Ol.has(Q1.question)})&&(Ol.add(e1.linkId),b1=!0)}}return R1.filter(e1=>!Ol.has(e1))})();Wn.length>0&&(Ao=removeItemsFromSchema(Q0?.item||[],Wn),xi(Ls(Ea({},Q0),{item:Ao})));const Ri=((Xa,Wa)=>{const M1=[];let B1=!1;const Ol=b1=>{for(const e1 of b1)B1?(M1.push(e1.linkId),e1.item&&Ol(e1.item)):e1.linkId===Wa?B1=!0:e1.item&&Ol(e1.item)};return Ol(Xa),M1})(Q0?.item||[],wa);Ri.length>0&&(Ki.current=Ki.current.filter(Xa=>!Ri.includes(Xa)),or(Xa=>{const Wa=new Set(Xa);return Ri.forEach(M1=>Wa.delete(M1)),Wa})),Ki.current.push(wa),ii(removeDisabledItems(Y1,Q0?.item||[]),!0,Ao)}},Bt=(qo,li,Xo=!1)=>{const wi=updateItemWithReadOnlyExpression(qo,Q0),Ba={item:wi,selectedAnswer:li,handleInputChange:dr,showQuestionPrefix:yi,onCompleteHandler:Z0,errors:No,isLoading:s0,isCurrentFormValid:Tr,contained:Q0?.contained,questionnaireSchemaItems:Q0?.item,customErrorConfigurations:ri,formData:_o.current,showStepper:Fi,totalStepsFromExtension:na,externalComponentRenderMap:Le,hintText:getHintTextFromExtensions(wi.extension)};if(typeof Sr=="function"&&Xo)Sr(qo,Ba,_o.current);else if(qo.type in typeToRenderFunctionMap&&!Xo)return $t.includes(qo.linkId)||An(Pa=>[...Pa,qo.linkId]),jsx(RenderFHIRQuestionnaireItem,Ea({},Ba),qo.linkId);return null},oi=qo=>qo.map(li=>{var Xo,wi;const Ba=isHiddenExtensionPresent(li);let Pa=(Xo=findResponseItem(_o.current,li.linkId))==null?void 0:Xo.answer;if((!Pa||Object.keys((wi=Pa?.[0])!=null?wi:{}).length===0)&&!Ln.has(li.linkId)){if(li.initial&&li.initial.length>0)Pa=li.initial,or(Ja=>new Set(Ja).add(li.linkId));else if((li.type==="choice"||li.type==="open-choice")&&li.answerOption){const Ja=li.answerOption.filter(wa=>wa.initialSelected===!0);Ja.length>0&&(Pa=Ja.map(wa=>{let ts={};return wa.valueCoding?ts={valueCoding:{code:wa.valueCoding.code,display:wa.valueCoding.display,system:wa.valueCoding.system}}:wa.valueReference&&(ts={valueReference:{reference:wa.valueReference.reference,display:wa.valueReference.display}}),ts}).filter(wa=>Object.keys(wa).length>0),or(wa=>new Set(wa).add(li.linkId)))}Pa&&(_o.current=getUpdatedFormData(Q0?.item||[],_o.current,li.linkId,Pa))}if(!li?.enableWhen||isQuestionEnabled(li?.enableWhen,li.enableBehavior,_o.current)){const Ja=i1.includes(li.linkId)||getUIToolkitCode(li.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[Bt(li,Pa,Ba),li.item&&!Ba&&(Ja?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:oi(li.item)})}):oi(li.item))]},li.linkId)}else if(li.type==="group"&&!Ba)return fo.includes(li.linkId)||(na===void 0&&Zn(ao.current.length-1||-1),ao.current=ao.current.filter((Ja,wa)=>wa!==Ur),T0(Ja=>[...Ja,li.linkId])),null});if(Ur>=0){const qo=[];let li=0,Xo=0;for(;li<kr.length&&Xo<ao.current.length;){const wi=kr[li],Ba=ao.current[Xo];if(wi<Ba){const Pa=(We=Q0?.item)==null?void 0:We[wi];(!Pa?.enableWhen||isQuestionEnabled(Pa.enableWhen,Pa.enableBehavior,_o.current))&&qo.push(li),li++}else wi===Ba&&li++,Xo++}for(;li<kr.length;){const wi=kr[li],Ba=(mt=Q0?.item)==null?void 0:mt[wi];(!Ba?.enableWhen||isQuestionEnabled(Ba.enableWhen,Ba.enableBehavior,_o.current))&&qo.push(li),li++}if(qo.length>0){na===void 0&&Zn(ao.current.length+qo.length),qo.reverse().forEach(Ba=>{const Pa=kr[Ba];let Ja=0;for(let wa=0;wa<ao.current.length;wa++){if(ao.current[wa]>Pa){Ja=wa;break}Ja=wa+1}ao.current.splice(Ja,0,Pa)});const wi=qo.map(Ba=>{var Pa;const Ja=kr[Ba],wa=(Pa=Q0?.item)==null?void 0:Pa[Ja];return wa?.linkId}).filter(Boolean);T0(Ba=>Ba.filter(Pa=>!wi.includes(Pa)))}kr.forEach(wi=>{var Ba;const Pa=(Ba=Q0?.item)==null?void 0:Ba[wi];Pa?.enableWhen&&!isQuestionEnabled(Pa.enableWhen,Pa.enableBehavior,_o.current)&&_o.current.some(wa=>wa.linkId===Pa.linkId)&&(_o.current=removeAnswerFromFormData(_o.current,Pa.linkId))})}const Ai=()=>{var qo;if(Io&&!B0&&Ur>0&&Ii!=="completed")pn(ao.current.length-1),jo(!0),an(!1),va?.();else if(Ur>0&&Ii!=="completed"){let li=Ur-1;for(;li>0;){const Xo=ao.current[li],wi=(qo=Q0?.item)==null?void 0:qo[Xo];if(!wi?.enableWhen||isQuestionEnabled(wi.enableWhen,wi.enableBehavior,_o.current))break;li--}pn(li),Pn(!0),an(!1),va?.()}else ir?.()},Ra=qo=>qo.preventDefault();return useEffect(()=>{const qo=setTimeout(()=>{a1(!0)},0);return()=>clearTimeout(qo)},[]),Vs?jsxs(Fragment,{children:[jsxs("form",{id:Yn,className:"w-full","data-testid":"questionnaire-form",onSubmit:Ra,children:[!Ti&&jsxs("div",{className:"tw group text-secondary gap-md mb-2xl hover:text-secondary_hover flex w-fit cursor-pointer items-center text-sm font-semibold hover:font-bold",role:"button","data-testid":"questionnaire-back-button",tabIndex:0,onClick:()=>Ai(),onKeyDown:qo=>{(qo.key==="Enter"||qo.key===" ")&&Ai()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Io&&!B0?jsx(EmptyState,{className:"mt-5xl",title:Io.title,description:Io.description,featuredIconProps:{icon:Io.icon,color:"gray"},primaryButton:Io.primaryButton,secondaryButton:Io.secondaryButton?Ls(Ea({},Io.secondaryButton),{onClick:Ai}):void 0}):jsxs(Fragment,{children:[!Q0?.item&&s0&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),Q0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:oi(Ur>=0?Q0.item.filter((qo,li)=>{const Xo=ao.current[Ur];return(q0.current.get(Xo)||[Xo]).includes(li)}):Q0?.item||[])})]})]}),Ni.current&&Ce]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Y,l,e)=>{"use strict";e.d(l,{l:()=>h});var n=e(31085),t=e(14041),r=e(36087),s=e(1053),o=e(25624),i=e(18522),a=Object.defineProperty,g=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,m=(p,f,b)=>f in p?a(p,f,{enumerable:!0,configurable:!0,writable:!0,value:b}):p[f]=b,d=(p,f)=>{for(var b in f||(f={}))E.call(f,b)&&m(p,b,f[b]);if(u)for(var b of u(f))A.call(f,b)&&m(p,b,f[b]);return p},O=(p,f)=>g(p,c(f));const v=({selected:p,onClick:f,icon:b,title:M,description:x,readOnly:z})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",p?"bg-utility-accent-500/20":"bg-gray-100",p?"text-accent-800":"text-quaternary"),children:b}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:M})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:x})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",z?"cursor-not-allowed":"cursor-pointer",z?"border-gray-200 bg-white":p?"border-blue-700 bg-white":"border-gray-100 bg-white",!z&&!p&&"hover:border-gray-400");return z?(0,n.jsx)("div",{className:S,children:T}):(0,n.jsx)("button",{type:"button",onClick:f,className:S,"aria-pressed":!!p,children:T})},h=({item:p,handleInputChange:f,formData:b,isLoading:M})=>{const{incrementCustomErrorCount:x,decrementCustomErrorCount:z}=(0,i.c)(),T=(0,t.useMemo)(()=>{var w;return(w=p.item)!=null?w:[]},[p.item]),S=p.readOnly===!0,C=(0,t.useMemo)(()=>T.filter(w=>!w.enableWhen||(0,o.GN)(w.enableWhen,w.enableBehavior,b??[])),[T,b]),y=(0,t.useMemo)(()=>T.filter(w=>w.enableWhen&&!(0,o.GN)(w.enableWhen,w.enableBehavior,b??[])),[T,b]),R=w=>{var N,V;if(!b)return!1;const q=(0,o.MU)(b,w);return((V=(N=q?.answer)==null?void 0:N[0])==null?void 0:V.valueBoolean)===!0},P=(0,t.useMemo)(()=>C.some(w=>R(w.linkId)),[C,b]),L=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||C.length===0){L.current&&(z(),L.current=!1);return}!P&&!L.current?(x(),L.current=!0):P&&L.current&&(z(),L.current=!1)},[P,S,C.length,x,z]),(0,t.useEffect)(()=>{y.forEach(w=>{var N,V;const q=b?(0,o.MU)(b,w.linkId):void 0;(!q||((V=(N=q.answer)==null?void 0:N[0])==null?void 0:V.valueBoolean)!==!1)&&f(w,[{valueBoolean:!1}])})},[y]),(0,t.useEffect)(()=>()=>{L.current&&z()},[]);const D=w=>{const N=R(w.linkId);f(w,[{valueBoolean:!N}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},M?{inert:""}:{}),{children:C.map(w=>{var N,V,q,I;const k=R(w.linkId),U=(N=w.extension)==null?void 0:N.find(se=>se.url===s.g4),F=(V=w.extension)==null?void 0:V.find(se=>se.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(q=F?.valueString)!=null?q:"";return(0,n.jsx)(v,{icon:K?(0,n.jsx)(K,{className:"h-6 w-6"}):void 0,title:(I=w.text)!=null?I:"",description:G,selected:k,readOnly:S,onClick:S?void 0:()=>D(w)},w.linkId)})}))}},72866:(Y,l,e)=>{"use strict";e.d(l,{v:()=>i});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const o=({selected:a,onClick:g,label:c,readOnly:u})=>{const E=(0,r.cx)("rounded-sm border-2 px-3 py-2 text-sm font-medium transition-colors",u?"cursor-default":"cursor-pointer",a?"border-brand bg-brand-50 text-primary":"border-secondary bg-primary text-secondary",!u&&!a&&"hover:border-tertiary");return u?(0,n.jsx)("div",{className:E,children:c}):(0,n.jsx)("button",{type:"button",onClick:g,className:E,"aria-pressed":!!a,children:c})},i=({item:a,handleInputChange:g,formData:c})=>{var u;const E=(u=a.item)!=null?u:[],A=a.readOnly===!0,m=O=>{var v,h;if(!c)return!1;const p=(0,s.MU)(c,O);return((h=(v=p?.answer)==null?void 0:v[0])==null?void 0:h.valueBoolean)===!0},d=O=>{const v=m(O.linkId);g(O,[{valueBoolean:!v}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[a.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(a.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:E.map(O=>{var v;const h=m(O.linkId);return(0,n.jsx)(o,{label:(v=O.text)!=null?v:"",selected:h,readOnly:A,onClick:A?void 0:()=>d(O)},O.linkId)})})]})}},65735:(Y,l,e)=>{"use strict";e.d(l,{d:()=>s});var n=e(31085),t=e(36087),r=e(1053);const s=({item:o})=>{var i,a,g,c;const u=o.text||"",E=(a=(i=o.extension)==null?void 0:i.find(d=>d.url===r.rz))==null?void 0:a.valueString,A=(c=(g=o.extension)==null?void 0:g.find(d=>d.url===r.g4))==null?void 0:c.valueString,m=A?r.JP[A]:void 0;return(0,n.jsxs)("div",{className:"bg-primary flex items-start gap-4 rounded-lg px-4 py-6 shadow-sm","data-testid":o.linkId,children:[m&&(0,n.jsx)(t.FeaturedIcon,{icon:m,color:"brand",size:"lg",className:"text-accent-600 size-14"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-primary text-lg font-semibold",children:u}),E&&(0,n.jsx)("p",{className:"text-secondary text-sm",children:E})]})]})}},18522:(Y,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),o=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,E=(h,p,f)=>p in h?o(h,p,{enumerable:!0,configurable:!0,writable:!0,value:f}):h[p]=f,A=(h,p)=>{for(var f in p||(p={}))c.call(p,f)&&E(h,f,p[f]);if(g)for(var f of g(p))u.call(p,f)&&E(h,f,p[f]);return h},m=(h,p)=>i(h,a(p));const d=(0,t.createContext)(void 0),O=()=>{const h=(0,t.useContext)(d);if(!h)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return h},v=({children:h,analyticsConfig:p})=>{const{trackEvent:f}=useAnalytics(),[b,M]=useState(null),[x,z]=useState(null),[T,S]=useState(!1),[C,y]=useState(null),[R,P]=useState(-1),[L,D]=useState(!1),[w,N]=useState(-1),[V,q]=useState(!1),[I,k]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),se=useRef([]),oe=()=>{k(ne=>ne+1)},te=useCallback(ne=>{F(ne)},[]),pe=()=>{k(ne=>Math.max(0,ne-1))},be=I>0,Se=useCallback((ne,ae,me)=>{if(!p)return;const he=p[ne];if(!he)return;let ce;if(Array.isArray(he))if(me)ce=he.find(Ee=>Ee.inputType===me);else{console.warn(`Multiple analytics configs found for linkId "${ne}" but no inputType provided. Skipping tracking.`);return}else{if(me&&he.inputType&&he.inputType!==me)return;ce=he}if(!ce)return;let ue=A({},ae);ce.valueTransform&&(ue=Object.keys(ae).reduce((Ee,De)=>{var ze;const Ie=(ze=ce.valueTransform)==null?void 0:ze[De];return Ee[De]=Ie?applyValueTransform(ae[De],Ie):ae[De],Ee},{}));let re=A({},ue);ce.propertyMapping&&(re=Object.keys(ue).reduce((Ee,De)=>{var ze;const Ie=((ze=ce.propertyMapping)==null?void 0:ze[De])||De;return Ee[Ie]=ue[De],Ee},{}));const J=ce.eventName,ve=ce.description;f(J,m(A(A({},re),ce.properties),{_event_metadata:ve?{description:ve}:void 0}))},[p,f]),ge={isCurrentFormValid:T,currentGroupLinkId:C,currentGroupIndex:R,hideFooterButton:L,totalSteps:w,isLoading:V,isInlineNextQuestionTriggered:K,hasCustomError:be,analyticsConfig:p,hasExternalError:U,handleContinueButtonClick:b,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:y,setCurrentGroupIndex:P,setHideFooterButton:D,setTotalSteps:N,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:oe,decrementCustomErrorCount:pe,trackQuestionnaireEvent:Se,setHasExternalError:te,groupItemIndicesRef:se};return jsx(d.Provider,{value:ge,children:h})}},35473:(Y,l,e)=>{"use strict";var n=e(32957),t=e(18522),r=e(78912),s=e.n(r);e.o(r,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return r.BWELL_STORED_TOKENS_KEY}}),e.o(r,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return r.LocationPermissionEnum}}),e.o(r,"LocationType")&&e.d(l,{LocationType:function(){return r.LocationType}}),e.o(r,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return r.SchedulingLocationCard}}),e.o(r,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return r.formatPhoneNumber}}),e.o(r,"getInitials")&&e.d(l,{getInitials:function(){return r.getInitials}}),e.o(r,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return r.removeAfterLastComma}}),e.o(r,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return r.shouldForceLogoutAfterAuthFailure}}),e.o(r,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return r.unformatPhoneNumber}}),e.o(r,"useDebounce")&&e.d(l,{useDebounce:function(){return r.useDebounce}}),e.o(r,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return r.useDeviceDetection}}),e.o(r,"useRedirect")&&e.d(l,{useRedirect:function(){return r.useRedirect}}),e.o(r,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return r.useSearchQueryParams}});var o=e(25624),i=e(1053),a=e(7630),g=e(72866),c=e(65735)},61388:(Y,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:o,onActionButtonClick:i,title:a,infoDetails:g})=>(0,n.jsxs)("div",{className:"bg-primary py-2xl px-lg rounded-2xl shadow-sm",children:[(0,n.jsxs)("div",{className:"gap-lg mb-2xl flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-primary text-md font-semibold",children:a}),o&&i&&(0,n.jsx)(t.Button,{color:"link-color",onClick:i,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:o})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Y,l,e)=>{"use strict";e.d(l,{d:()=>o});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const o=({infoDetails:i,className:a})=>{const{redirectToBook:g,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),E=(d,O,v)=>{d.preventDefault(),O.linkType==="phone"?g(v):O.linkType==="address"?c({address:v}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},A=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},m=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:v=>E(v,O,d),className:"text-md text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary text-left font-normal! wrap-anywhere underline underline-offset-2",children:A(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:A(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",a),children:i.map((d,O)=>{const v=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(v,{className:"text-fg-secondary"}),size:"lg",color:"gray"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-tertiary m-0 mb-1 text-sm",children:d.label}),(()=>{const h=Array.isArray(d.value)?d.value:[d.value];return h.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:h.map((p,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(p,d)},f))}):m(h[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.d});var n=e(97257),t=e(71428),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},33180:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.InfoCardDetails});var n=e(3203);e.o(n,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return n.BWELL_STORED_TOKENS_KEY}}),e.o(n,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return n.LocationPermissionEnum}}),e.o(n,"LocationType")&&e.d(l,{LocationType:function(){return n.LocationType}}),e.o(n,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return n.SchedulingLocationCard}}),e.o(n,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return n.formatPhoneNumber}}),e.o(n,"getInitials")&&e.d(l,{getInitials:function(){return n.getInitials}}),e.o(n,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return n.removeAfterLastComma}}),e.o(n,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return n.shouldForceLogoutAfterAuthFailure}}),e.o(n,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return n.unformatPhoneNumber}}),e.o(n,"useDebounce")&&e.d(l,{useDebounce:function(){return n.useDebounce}}),e.o(n,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return n.useDeviceDetection}}),e.o(n,"useRedirect")&&e.d(l,{useRedirect:function(){return n.useRedirect}}),e.o(n,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return n.useSearchQueryParams}})},27163:(Y,l,e)=>{"use strict";e.d(l,{InfoCard:()=>n.n});var n=e(61388),t=e(79286),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(33180);e.o(s,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return s.BWELL_STORED_TOKENS_KEY}}),e.o(s,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return s.LocationPermissionEnum}}),e.o(s,"LocationType")&&e.d(l,{LocationType:function(){return s.LocationType}}),e.o(s,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return s.SchedulingLocationCard}}),e.o(s,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return s.formatPhoneNumber}}),e.o(s,"getInitials")&&e.d(l,{getInitials:function(){return s.getInitials}}),e.o(s,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return s.removeAfterLastComma}}),e.o(s,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return s.shouldForceLogoutAfterAuthFailure}}),e.o(s,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return s.unformatPhoneNumber}}),e.o(s,"useDebounce")&&e.d(l,{useDebounce:function(){return s.useDebounce}}),e.o(s,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return s.useDeviceDetection}}),e.o(s,"useRedirect")&&e.d(l,{useRedirect:function(){return s.useRedirect}}),e.o(s,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return s.useSearchQueryParams}})},98549:(Y,l,e)=>{"use strict";var n=e(31085);const t=({currentStep:r,totalSteps:s})=>jsx(Stack,{"data-testid":"stepper",width:"100%",children:jsx(LinearProgress,{"aria-label":`Progress bar showing step ${r} of ${s}`,sx:{height:"2px",backgroundColor:"rgba(0,0,0,0.1)","& .MuiLinearProgress-bar":{backgroundColor:"accessibility.info",borderRadius:2}},value:r/s*100,variant:"determinate"})})},26877:(Y,l,e)=>{"use strict";e.d(l,{J:()=>M});var n=e(31085),t=e(14041);const r=({size:x=24,color:z="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:x,height:x,stroke:z,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...T},t.createElement("path",{d:"M3.413 10.745c-.595-.232-.893-.348-.98-.515a.5.5 0 0 1 0-.461c.087-.167.385-.283.98-.515L20.3 2.664c.537-.21.806-.315.978-.258a.5.5 0 0 1 .316.316c.057.172-.048.44-.258.977l-6.59 16.888c-.232.595-.348.893-.515.98a.5.5 0 0 1-.462 0c-.167-.088-.282-.385-.514-.98l-2.628-6.759a1.075 1.075 0 0 0-.107-.232.5.5 0 0 0-.116-.117 1.069 1.069 0 0 0-.232-.106l-6.759-2.628Z"}));r.displayName="NavigationPointer01";var s=e(8322),o=e(76808),i=e(92094),a=e(5380),g=e(54783),c=e(53151),u=e(85449),E=Object.defineProperty,A=Object.defineProperties,m=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,h=(x,z,T)=>z in x?E(x,z,{enumerable:!0,configurable:!0,writable:!0,value:T}):x[z]=T,p=(x,z)=>{for(var T in z||(z={}))O.call(z,T)&&h(x,T,z[T]);if(d)for(var T of d(z))v.call(z,T)&&h(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),b=(x,z,T)=>new Promise((S,C)=>{var y=L=>{try{P(T.next(L))}catch(D){C(D)}},R=L=>{try{P(T.throw(L))}catch(D){C(D)}},P=L=>L.done?S(L.value):Promise.resolve(L.value).then(y,R);P((T=T.apply(x,z)).next())});const M=({setLocationUpdating:x,title:z,description:T,isOpen:S,onClose:C})=>{const{locationPermission:y,position:R,requestPosition:P,setLocationPermission:L}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:w,setQueryParams:N}=(0,g.i)(),[V,q]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),k=S!==void 0?S:V;(0,t.useEffect)(()=>{(k||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,k,D]);const U=(0,t.useCallback)(be=>{N(f(p({},w),{location:be,locationType:a.iF.CURRENT_LOCATION,locationPermission:y||""}))},[y,w,N]),F=(0,t.useCallback)(()=>{S===void 0&&(!y||[a.Ef.GRANTED].includes(y)&&I.get()||[a.Ef.PROMPT].includes(y)&&I.get()&&R||q([a.Ef.PROMPT,a.Ef.GRANTED].includes(y)))},[S,y,I,R]);(0,t.useEffect)(()=>{F()},[F]);const K=(0,o.Ul)(),G=(0,t.useCallback)(()=>b(void 0,null,function*(){x&&x(!0);let be;try{be=yield P(),be&&U&&U(`${be.coords.latitude},${be.coords.longitude}`)}catch(Se){Se instanceof Error?K?.error(Se,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Se)}`),S!==void 0&&C?C():q(!1)}return x&&x(!1),!!be}),[K,U,P,x,S,C]),se=(0,t.useCallback)(()=>b(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&C?C():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,C,I,G]),oe=(0,t.useCallback)(be=>{D("location_permissions_cta_clicked",{click:be==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),L(a.Ef.DENIED),N(f(p({},w),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&C?C():q(!1)},[D,L,N,w,I,S,C]),te=(0,t.useCallback)(()=>oe("close"),[oe]),pe=(0,t.useCallback)(()=>oe("cancel"),[oe]);return(0,n.jsx)(i.Modal,{id:"location-modal",isOpen:k,className:"sm:max-w-md",title:{content:z,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:te},primaryButton:{children:"Use my current location",onClick:se},secondaryButton:{children:"Search another way",onClick:pe}})}},35471:(Y,l,e)=>{"use strict";var n=e(26877)},98741:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(E,A,m)=>A in E?r(E,A,{enumerable:!0,configurable:!0,writable:!0,value:m}):E[A]=m,g=(E,A)=>{for(var m in A||(A={}))o.call(A,m)&&a(E,m,A[m]);if(s)for(var m of s(A))i.call(A,m)&&a(E,m,A[m]);return E};const c=E=>{if(!E||typeof E!="object")throw new Error("Invalid animation data");const A=m=>{if(!m||typeof m!="object")return m;if(Array.isArray(m))return m.map(A);const d=g({},m);delete d.ef,delete d.expr,typeof d.x=="string"&&delete d.x;for(const O in d)typeof d[O]=="object"&&(d[O]=A(d[O]));return d};return A(E)},u=({animationData:E,loop:A=!0,autoplay:m=!0,className:d=""})=>{const O=useRef(null),v=useRef(null);return useEffect(()=>{if(!!O.current){try{const h=c(E);v.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:h})}catch(h){console.error("Failed to load Lottie animation:",h)}return()=>{var h;(h=v.current)==null||h.destroy()}}},[E,A,m]),jsx("div",{ref:O,className:d})}},81304:(Y,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const o=E=>E*1609.34;var i=e(27419);const a={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var g=e(92469);const c=({center:E,isLoading:A=!1,searchRadius:m,className:d,height:O="350px",width:v="100%",googleMapsApiKey:h})=>{const p=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:h||""}),b={height:typeof O=="number"?`${O}px`:O,width:typeof v=="number"?`${v}px`:v},M=(0,t.useCallback)(z=>{google.maps.event.addListenerOnce(z,"idle",()=>{if(m&&E.lat&&E.lng){const S=new google.maps.Circle({center:{lat:E.lat,lng:E.lng},radius:o(m)}).getBounds();S&&z.fitBounds(S,0)}})},[E,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,i.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:p("LOADING_MAP")})});if(!E.lat||!E.lng)return(0,n.jsx)("div",{className:(0,i.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:p("UNABLE_TO_LOAD_MAP_NO_LOCATION")})});const x={clickableIcons:!1,disableDefaultUI:!0,disableDoubleClickZoom:!0,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:a.gray50}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:a.gray100}]},{featureType:"water",elementType:"geometry",stylers:[{color:a.blue100}]}]};return(0,n.jsx)("div",{className:(0,i.cx)("overflow-hidden rounded-lg",d),children:(0,n.jsx)(r.u6,{center:{lat:E.lat,lng:E.lng},mapContainerStyle:b,onLoad:M,options:x,zoom:12,children:(0,n.jsx)(g.I,{center:E})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Y,l,e)=>{"use strict";e.d(l,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(92469)},92469:(Y,l,e)=>{"use strict";e.d(l,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:s})=>typeof s?.lat=="number"&&typeof s?.lng=="number"&&!isNaN(s.lat)&&!isNaN(s.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:s.lat,lng:s.lng}}):null},43743:(Y,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:i,profileUrl:a,subTitle:g,variant:c="default",showChevron:u=!0,onClick:E,pendingText:A})=>{const m=!!A,d=!m&&!!E,O=u&&d;return jsxs("button",{type:"button",onClick:d?E:void 0,disabled:!d,className:cx("bg-primary border-primary flex w-full items-center justify-between gap-3 rounded-lg border p-4 text-left",c==="compact"&&"rounded-xl p-3",!O&&"justify-start",d?"cursor-pointer":"cursor-default",m&&"opacity-60"),children:[jsx(Avatar,{src:a,alt:i,size:"md",initials:getInitials(i),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:i}),m?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),A]}):jsx("span",{className:"text-secondary text-sm",children:g})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},o=()=>jsx("div",{className:"bg-primary border-primary animate-pulse items-center justify-between rounded-lg border p-4",children:jsxs("div",{className:"flex items-center space-x-4",children:[jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300"}),jsxs("div",{className:"flex-1 space-y-2",children:[jsx("div",{className:"h-4 w-3/4 rounded bg-gray-300"}),jsx("div",{className:"h-3 w-1/2 rounded bg-gray-300"})]})]})})},4062:(Y,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:o,fullImageHeader:i=!1,header:a,title:g})=>jsx("div",{className:"tw-preflight gap-lg flex h-full w-full items-center justify-center",children:jsxs("div",{className:"max-w-16xl flex h-fit w-full flex-col items-center justify-center self-center overflow-hidden rounded-2xl",children:[i?a:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:a}),jsxs("div",{className:"gap-lg p-sm md:pb-2xl h-fit w-full md:p-[55px]",children:[jsxs("div",{className:"text-center",children:[jsx("h1",{className:"font-display text-primary mb-md px-5 text-3xl leading-[38px] font-normal tracking-tight",children:g}),o&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:o})]}),s]})]})}),r=null},51254:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:o,icon:i})=>{var a;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:i.icon,color:(a=i.color)!=null?a:"brand",size:"lg",className:i.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),o&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:o})]})]})}},69092:()=>{},33457:(Y,l,e)=>{"use strict";var n=e(51254),t=e(69092),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},77057:(Y,l,e)=>{"use strict";e.d(l,{i:()=>Qe});var n=e(31085),t=e(36087),r=e(14041);const s=({size:Ye=24,color:Dt="currentColor",...fn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Ye,height:Ye,stroke:Dt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...fn},r.createElement("path",{d:"M9.5 7h5m-5 4h5m-5 4h5m3.5 6V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C16.48 3 15.92 3 14.8 3H9.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C6 4.52 6 5.08 6 6.2V21m14 0H4"}));s.displayName="Building04";var o=e(14449),i=e(14711),a=e(58139),g=e(37121),c=e(43144);function u(Ye){Ye()}let E=null;const A=Ye=>E=Ye,m=()=>E,d=(0,r.createContext)(null),O=null;function v(){return(0,r.useContext)(d)}let p=()=>{throw new Error("uSES not initialized!")};const f=Ye=>{p=Ye},b=(Ye,Dt)=>Ye===Dt;function M(Ye=d){const Dt=Ye===d?v:()=>(0,r.useContext)(Ye);return function(zn,et=b){const{store:Rt,subscription:jt,getServerState:_n}=Dt(),br=p(jt.addNestedSub,Rt.getState,_n||Rt.getState,zn,et);return(0,r.useDebugValue)(br),br}}const x=M();var z=e(75985),T=e(524);function S(){const Ye=getBatch();let Dt=null,fn=null;return{clear(){Dt=null,fn=null},notify(){Ye(()=>{let zn=Dt;for(;zn;)zn.callback(),zn=zn.next})},get(){let zn=[],et=Dt;for(;et;)zn.push(et),et=et.next;return zn},subscribe(zn){let et=!0,Rt=fn={callback:zn,next:null,prev:fn};return Rt.prev?Rt.prev.next=Rt:Dt=Rt,function(){!et||Dt===null||(et=!1,Rt.next?Rt.next.prev=Rt.prev:fn=Rt.prev,Rt.prev?Rt.prev.next=Rt.next:Dt=Rt.next)}}}}const C={notify(){},get:()=>[]};function y(Ye,Dt){let fn,zn=C;function et(fr){return br(),zn.subscribe(fr)}function Rt(){zn.notify()}function jt(){Dn.onStateChange&&Dn.onStateChange()}function _n(){return Boolean(fn)}function br(){fn||(fn=Dt?Dt.addNestedSub(jt):Ye.subscribe(jt),zn=S())}function mn(){fn&&(fn(),fn=void 0,zn.clear(),zn=C)}const Dn={addNestedSub:et,notifyNestedSubs:Rt,handleChangeWrapper:jt,isSubscribed:_n,trySubscribe:br,tryUnsubscribe:mn,getListeners:()=>zn};return Dn}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",P=null,L=null;let D=null;const w=Ye=>{D=Ye},N=null,V=null,q=Ye=>{try{return JSON.stringify(Ye)}catch{return String(Ye)}};function I(Ye,Dt,fn){useIsomorphicLayoutEffect(()=>Ye(...Dt),fn)}function k(Ye,Dt,fn,zn,et,Rt){Ye.current=zn,fn.current=!1,et.current&&(et.current=null,Rt())}function U(Ye,Dt,fn,zn,et,Rt,jt,_n,br,mn,Dn){if(!Ye)return()=>{};let fr=!1,Bn=null;const Zr=()=>{if(fr||!_n.current)return;const It=Dt.getState();let _e,ot;try{_e=zn(It,et.current)}catch(Je){ot=Je,Bn=Je}ot||(Bn=null),_e===Rt.current?jt.current||mn():(Rt.current=_e,br.current=_e,jt.current=!0,Dn())};return fn.onStateChange=Zr,fn.trySubscribe(),Zr(),()=>{if(fr=!0,fn.tryUnsubscribe(),fn.onStateChange=null,Bn)throw Bn}}const F=()=>N;function K(Ye,Dt){return Ye===Dt}let G=!1;function se(Ye,Dt,fn,{pure:zn,areStatesEqual:et=K,areOwnPropsEqual:Rt=shallowEqual,areStatePropsEqual:jt=shallowEqual,areMergedPropsEqual:_n=shallowEqual,forwardRef:br=!1,context:mn=ReactReduxContext}={}){const Dn=mn,fr=mapStateToPropsFactory(Ye),Bn=mapDispatchToPropsFactory(Dt),Zr=mergePropsFactory(fn),jr=Boolean(Ye);return _e=>{const ot=_e.displayName||_e.name||"Component",Je=`Connect(${ot})`,tt={shouldHandleStateChanges:jr,displayName:Je,wrappedComponentName:ot,WrappedComponent:_e,initMapStateToProps:fr,initMapDispatchToProps:Bn,initMergeProps:Zr,areStatesEqual:et,areStatePropsEqual:jt,areOwnPropsEqual:Rt,areMergedPropsEqual:_n};function rt(st){const[le,ye,Ue]=useMemo(()=>{const{reactReduxForwardedRef:Cn}=st,gn=_objectWithoutPropertiesLoose(st,L);return[st.context,Cn,gn]},[st]),Te=useMemo(()=>le&&le.Consumer&&isContextConsumer(React.createElement(le.Consumer,null))?le:Dn,[le,Dn]),Tt=useContext(Te),Zt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),vn=Boolean(Tt)&&Boolean(Tt.store),Hn=Zt?st.store:Tt.store,vr=vn?Tt.getServerState:Hn.getState,Wt=useMemo(()=>defaultSelectorFactory(Hn.dispatch,tt),[Hn]),[we,Ze]=useMemo(()=>{if(!jr)return V;const Cn=createSubscription(Hn,Zt?void 0:Tt.subscription),gn=Cn.notifyNestedSubs.bind(Cn);return[Cn,gn]},[Hn,Zt,Tt]),At=useMemo(()=>Zt?Tt:_extends({},Tt,{subscription:we}),[Zt,Tt,we]),kt=useRef(),Qt=useRef(Ue),tn=useRef(),Un=useRef(!1),_r=useRef(!1),Lt=useRef(!1),Ct=useRef();useIsomorphicLayoutEffect(()=>(Lt.current=!0,()=>{Lt.current=!1}),[]);const bt=useMemo(()=>()=>tn.current&&Ue===Qt.current?tn.current:Wt(Hn.getState(),Ue),[Hn,Ue]),Ut=useMemo(()=>gn=>we?U(jr,Hn,we,Wt,Qt,kt,Un,Lt,tn,Ze,gn):()=>{},[we]);I(k,[Qt,kt,Un,Ue,tn,Ze]);let hn;try{hn=D(Ut,bt,vr?()=>Wt(vr(),Ue):bt)}catch(Cn){throw Ct.current&&(Cn.message+=`
872
872
  The error may be correlated with this previous error:
package/native.js CHANGED
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1135.1",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.14.2"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1386.1",D="@icanbwell/composite. repo version: 0.1386.1",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
1
+ import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1136.0",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.14.2"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1387.0",D="@icanbwell/composite. repo version: 0.1387.0",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/composite",
3
- "version": "1.1135.1",
3
+ "version": "1.1136.0",
4
4
  "author": "icanbwell",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -43,6 +43,6 @@
43
43
  "optional": true
44
44
  }
45
45
  },
46
- "repoVersion": "0.1386.1",
47
- "description": "@icanbwell/composite. repo version: 0.1386.1"
46
+ "repoVersion": "0.1387.0",
47
+ "description": "@icanbwell/composite. repo version: 0.1387.0"
48
48
  }