@icanbwell/composite 1.1089.1 → 1.1089.2

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(ge)===void 0&&customElements.define(ge,ze);const De=[{name:"loader",defaultElement:document.createElement(te)},{name:"error",defaultElement:document.createElement(ge)}],Se=["error","loading"],Ie={error:"error",loading:"loader"},xe=({src:Ot,elementNameSuffix:Ft,version:Qt,prefetchFeatureApp:zt})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;window.bwell||(window.bwell=new ue({metadata:{version:Qt}}));const cr=`bwell-${Ft}`;if(customElements.get(cr)!==void 0)return;class Dn extends h{constructor(){super(),Ke.add(this),$e.set(this,(0,T.nanoid)()),Et.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Ye.set(this,new q.EventEmitter),Lt.set(this,void 0),mn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),Ht.set(this,void 0),this.attachShadow({mode:"open"});const qr=new me(De).attachToShadowRoot(this.shadowRoot);qr.addEventListener("visibilitychange",({visibility:wt,container:Ve,name:ot})=>{ot==="error"&&wt==="visible"&&window.bwell._registerEmbeddableContent(Ve),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=wt==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Ht,{slots:qr,attributes:new F().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Ye,"f")},"f"),(0,p.__classPrivateFieldSet)(this,Lt,(0,p.__classPrivateFieldGet)(this,Ke,"m",Un).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,mn,(0,p.__classPrivateFieldGet)(this,Ke,"m",Mr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,Sn,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,mn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,$e,this.id||(0,p.__classPrivateFieldGet)(this,$e,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Et,new z((0,p.__classPrivateFieldGet)(this,$e,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Et,"f").registerDispatcher(qr=>this.dispatchEvent(qr)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,Lt,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,Lt,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}),zt&&(0,b.h)(Ot).catch(()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}))})}disconnectedCallback(){var qr;(0,p.__classPrivateFieldGet)(this,Ye,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,mn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(qr=(0,p.__classPrivateFieldGet)(this,Et,"f"))===null||qr===void 0||qr.deregister(),(0,p.__classPrivateFieldGet)(this,Ye,"f").removeAllListeners()}}$e=new WeakMap,Et=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Lt=new WeakMap,mn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,Ht=new WeakMap,Ke=new WeakSet,Un=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${cr}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,$e,"f"),name:Ft,elementName:cr,utils:(0,p.__classPrivateFieldGet)(this,Ht,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},Mr=function({visibility:qr,name:wt}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=qr==="hidden"?"unset":"hidden"},gn=function(qr){(0,p.__classPrivateFieldGet)(this,Rt,"f")(),(0,p.__classPrivateFieldSet)(this,Rt,void 0,"f")},In=function(qr){return wt=>{const Ve=Se.findIndex(Je=>Je===qr);if(!Se.slice(0,Ve).some(Je=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(Je)!==null)){if(wt!==null)(0,p.__classPrivateFieldGet)(this,Rt,"f")&&(0,p.__classPrivateFieldGet)(this,Ke,"m",gn).call(this,qr),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[qr]),"f");else if(wt===null&&(0,p.__classPrivateFieldGet)(this,Rt,"f")){(0,p.__classPrivateFieldGet)(this,Ke,"m",gn).call(this,qr);const Je=Se.find(tt=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(tt)!==null);Je&&(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[Je]),"f")}}}},customElements.define(cr,Dn)}),_e={rE:"1.1089.1"},it="composite";var bt=e(67321);xe({src:`https://embeddables.prod.icanbwell.com/${it}/${_e.rE}/scripts/embeddable.federated.js`,elementNameSuffix:it,version:_e.rE,prefetchFeatureApp:!0})},79566:(Z,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,b,h)=>b in p?i(p,b,{enumerable:!0,configurable:!0,writable:!0,value:h}):p[b]=h,A=(p,b)=>{for(var h in b||(b={}))c.call(b,h)&&y(p,h,b[h]);if(g)for(var h of g(b))u.call(b,h)&&y(p,h,b[h]);return p},m=(p,b)=>o(p,a(b));const d=(p,b,h)=>{const f=_.cloneDeep(p);if(!f.contained||b<0)return f;const v=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(v!==-1&&!h){const M=f.contained[v];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===b+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[v]=M}}else h&&v!==-1&&(f.contained[v]=m(A({},f.contained[v]),{item:h}));return f},O=({formId:p,questionnaireResponse:b,showQuestionPrefix:h,nextQuestion:f,onGoBack:v,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,w;const{currentGroupIndex:N,hasCustomError:F}=useFHIRQuestionnaire(),q=(P=b.questionnaire)==null?void 0:P.replace("#",""),I=(D=b?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,$,K)=>{let G=_.cloneDeep(b);G.item=U,G=trimQuestionnaireItems(G,N,K),f(G,$)};return jsx("div",{className:`${F?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:C,questionnaireResponseItem:(w=b?.item)!=null?w:[],questionnaireSchema:I,status:b.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:v,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=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,p=(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},b=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,v=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),w=x?.placeId,N=x?.description,[F,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,$]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[oe,se]=(0,t.useState)(!1),ie=(0,t.useRef)(!1),me=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ye,Te]=(0,t.useState)(me),[ve,ne]=(0,t.useState)(me),[ae,{loading:he,error:pe}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[fe,{loading:ue,error:te}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ge,error:ze}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Te(me)},onCompleted:Qt=>{var zt,Ke;const $e=(Ke=(zt=Qt.placeAutocomplete)==null?void 0:zt.predictions)==null?void 0:Ke.map(Et=>{var Qe;return{id:Et.placeId,label:(0,s.removeAfterLastComma)(Et.description),mainText:Et?.mainText||((Qe=Et.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Et?.secondaryText||Et.description.split(",").slice(1).join(",").trim())}});Te($e?.length?$e:me)}}),De=(0,t.useMemo)(()=>ye.map(Qt=>b(p({},Qt),{displayLabel:(0,r.RZ)(Qt?.label||"",F)})),[F,ye]),Se=Qt=>h(void 0,null,function*(){var zt,Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;if($(Qt),G(Qt),se(!1),Qt&&typeof Qt=="string"){const cr=ye.find(tt=>tt.id===Qt),Dn=cr?.label||F;if(!cr)return;q(Dn),k(Dn),setTimeout(()=>{const tt=[{id:cr.id,label:cr.label}];Te(tt),ne(tt)},f);const $r=yield ae({variables:{placeId:Qt}}),qr=(Ke=(zt=$r?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ke.latitude,wt=(Et=($e=$r?.data)==null?void 0:$e.geocodingByPlaceId)==null?void 0:Et.longitude,Ve=((Ye=(Qe=$r?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((mn=(Lt=$r?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Je=((et=(Sn=$r?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(qr&&wt)if(!Ve||!Je){const tt=yield fe({variables:{latitude:String(qr),longitude:String(wt)}}),rt=((Ht=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",lt=((Mr=(Un=tt?.data)==null?void 0:Un.geocodingByLatLon)==null?void 0:Mr.state)||"",St=((In=(gn=tt?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:qr,longitude:wt,zipCode:rt,state:lt,stateCode:St,placeId:Qt,description:Dn,value:Qt})}else T({latitude:qr,longitude:wt,zipCode:Ve,state:ot,stateCode:Je,placeId:Qt,description:Dn,value:Qt});else se(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Qt=>h(void 0,null,function*(){return yield J({variables:{input:Qt,types:"geocode"}})})),_e=Qt=>h(void 0,null,function*(){if(se(!1),q(Qt),z?.(Qt),!Qt||Qt.trim().length===0){$(null),Te(me),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Qt});return}const zt=Qt.trim();zt.length>=2?yield xe(zt):Te(me)}),it=Qt=>{ie.current=Qt},bt=()=>{q(I),Te(ve),$(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var zt,Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;if(w&&N){Te([{id:w,label:F||N}]),ne([{id:w,label:F||N}]),$(w),G(w),q(N),k(N),N===F&&q(N);const cr=yield ae({variables:{placeId:w}}),Dn=(Ke=(zt=cr?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ke.latitude,$r=(Et=($e=cr?.data)==null?void 0:$e.geocodingByPlaceId)==null?void 0:Et.longitude,qr=((Ye=(Qe=cr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",wt=((mn=(Lt=cr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Ve=((et=(Sn=cr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Dn&&$r)if(!qr||!wt||!Ve){const ot=yield fe({variables:{latitude:String(Dn),longitude:String($r)}}),Je=((Ht=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",tt=((Mr=(Un=ot?.data)==null?void 0:Un.geocodingByLatLon)==null?void 0:Mr.state)||"",rt=((In=(gn=ot?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:Dn,longitude:$r,zipCode:Je,state:tt,stateCode:rt,placeId:w,description:N,value:w})}else T({latitude:Dn,longitude:$r,zipCode:qr,state:wt,stateCode:Ve,placeId:w,description:N,value:w})}else $(null),G(null),q(""),k(""),Te(me),ne(me)}))()},[]);const Ot=oe||!!pe||!!te||!!ze||!!R,Ft=Ot?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(he||ue||D)},[C,he,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:F,isLoading:ge||he||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:Se,onInputChange:_e,defaultFilter:Ie,onOpenChange:it,onBlur:bt,isInvalid:Ot,hint:Ft,autoComplete:"address-line1",className:"w-full",children:Qt=>{const zt=Qt,Ke=F.trim().length>=2,$e=zt.mainText||"",Et=zt.secondaryText||"",Qe=$e.trim().length>0,Ye=Et.trim().length>0,Lt=Qe?(0,r.RZ)($e,F):{beforePart:"",highlightedPart:"",remainingPart:""},mn=Ye?(0,r.RZ)(Et,F):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:zt.id,supportingText:zt.supportingText,isDisabled:zt.isDisabled,icon:zt.icon,avatarUrl:zt.avatarUrl,textValue:zt.label,children:Ke&&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:Lt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Lt.highlightedPart}),(0,n.jsx)("span",{children:Lt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:mn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:mn.highlightedPart}),(0,n.jsx)("span",{children:mn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:zt.label})})}})})}},18077:()=>{},12200:(Z,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:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{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:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(11300);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const p=c.getId(O),b=c.getRouteMeta(p)||{},h=getBreadcrumbTitleKey(p,b,u);if(!h||b.breadcrumbHide)return[];const f=y[p];let v=c.getHref(p),M=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:p,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:p,href:v,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:(Z,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,v=(C,R)=>{for(var L in R||(R={}))b.call(R,L)&&f(C,L,R[L]);if(p)for(var L of p(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var w=q=>{try{F(L.next(q))}catch(I){D(I)}},N=q=>{try{F(L.throw(q))}catch(I){D(I)}},F=q=>q.done?P(q.value):Promise.resolve(q.value).then(w,N);F((L=L.apply(C,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),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:w,setQueryParams:N}=(0,a.useSearchQueryParams)(),F=(0,t.useRef)(!1),q=(0,t.useRef)(w);(0,t.useEffect)(()=>{q.current=w},[w]);const[I,k]=(0,t.useState)(!1),[U,$]=(0,t.useState)((R=w.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[oe,se]=(0,t.useState)(!1),ie=(0,t.useCallback)(ge=>{$(ge);try{N(M(v({},q.current),{locationPermission:ge||o.Ef.UNAVAILABLE}))}catch(ze){ze instanceof Error?P?.error(ze,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(ze)}`)}},[N,P]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[D,P]),ye=(0,t.useCallback)(ge=>x(void 0,null,function*(){const ze=D.getCurrentPosition(ge).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(ze,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Te=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ve=(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 me()))return P?.error("Location services not available"),!1;const ze=yield Te();return ze!==o.Ef.GRANTED&&ze!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${ze}`),!1):!0}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[me,P,Te]);(0,t.useEffect)(()=>{if(F.current)return;F.current=!0,(()=>x(void 0,null,function*(){const ze=w.locationPermission;if(ze===o.Ef.DENIED||ze===o.Ef.BLOCKED||ze===o.Ef.UNAVAILABLE){$(ze);return}k(!0);try{if(!(yield me())){ie(o.Ef.UNAVAILABLE);return}if(ze===o.Ef.GRANTED){try{const Ie=yield Te();if(Ie===o.Ef.GRANTED){const xe=yield ye(z);xe&&(G(xe),ie(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(ie(Ie),se(!0)):ie(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),ie(o.Ef.UNAVAILABLE)}return}const Se=yield Te();if(ie(Se),Se===o.Ef.GRANTED)try{const Ie=yield ye(z);Ie?G(Ie):ie(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),ie(o.Ef.UNAVAILABLE)}else Se===o.Ef.PROMPT&&se(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),ie(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){ie(o.Ef.UNAVAILABLE);return}k(!0);let ze=yield Te();if(ie(ze),ze===o.Ef.GRANTED||ze===o.Ef.PROMPT){if(L==="Android"&&ze===o.Ef.GRANTED)try{ze=yield ve(),ie(ze)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(ze!==o.Ef.UNAVAILABLE){const De=yield ye(z);return G(De),De}}return}catch(ge){ie(o.Ef.UNAVAILABLE),ge instanceof Error?P?.error(ge,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{k(!1)}}),[ne,P,L,ie,ye,Te,ve]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield me())?yield Te():o.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ge)}`),o.Ef.UNAVAILABLE}}),[me,P,Te]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ie(o.Ef.UNAVAILABLE);return}const ze=yield Te();ie(ze)}catch(ge){ge instanceof Error?P?.error(ge,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),ie(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[me,P,ie,Te]),fe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ie(o.Ef.UNAVAILABLE);return}const ze=yield Te();if(ze===o.Ef.DENIED||ze===o.Ef.BLOCKED||ze===o.Ef.UNAVAILABLE){ie(ze);return}const De=yield ve();if(ie(De),["granted","prompt"].includes(De)){const Se=yield ye(z);return G(Se),Se}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||P?.error(ge,"Error requesting location");else{const ze=ge&&typeof ge=="object"&&"message"in ge?ge.message:JSON.stringify(ge);ze?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${ze}`)}ie(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[me,P,ie,ye,ve,Te]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ie(o.Ef.UNAVAILABLE);return}const ze=yield ye(z);ze&&(G(ze),$(o.Ef.GRANTED),N(M(v({},q.current),{location:`${ze.coords.latitude},${ze.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ze.coords.latitude}`,lng:`${ze.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ge){throw ge instanceof Error?P?.error(ge,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ge)}`),ie(o.Ef.UNAVAILABLE),ge}finally{k(!1)}}),[me,P,N,ie,ye]),te=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ge=yield ae();ge&&N(M(v({},q.current),{location:`${ge.coords.latitude},${ge.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ge.coords.latitude}`,lng:`${ge.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ge){ge instanceof Error?P?.error(ge,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{k(!1)}}),[P,U,ae,N]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:$,position:K,refreshPosition:ae,requestPosition:fe,requestCurrentLocation:ue,checkAndSetLocationPermission:pe,checkLocaitonPermission:he}),[I,te,U,K,ae,fe,ue,pe,he]);return(0,n.jsxs)(T.Provider,{value:J,children:[oe&&(0,n.jsx)(g.J,{isOpen:oe,onClose:()=>se(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Z,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},71934:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267);const s=({onClick:i})=>{const{loading:o,i18n:{t:a}}=useI18nChild({keys:["health-space"]});return o?jsx(LoadingIndicator,{}):jsxs("div",{className:"tw-preflight flex h-full flex-col items-center justify-center gap-6 p-2 text-center md:p-4",children:[jsx(CircleIcon,{icon:Users01,size:"xl",className:"p-4 shadow-xl"}),jsxs("div",{className:"flex flex-col items-center gap-3",children:[jsx(Typography,{tag:"h2",className:"text-primary text-md font-semibold",children:a("YOUR_CARE_TEAM_IS_EMPTY")}),jsx(Typography,{tag:"p",className:"text-tertiary text-sm md:max-w-[26rem]",children:a("START_BUILDING_YOUR_CARE_TEAM")})]}),jsx(Button,{size:"sm",className:"w-fit min-w-[10rem] rounded-full shadow-lg",onClick:i,children:a("FIND_DOCTORS")})]})}},69364:(Z,l,e)=>{"use strict";e.d(l,{pc:()=>In,GI:()=>$,rz:()=>Ft,Fp:()=>Ot,el:()=>bt,ao:()=>it,oA:()=>T,Yt:()=>cr,g4:()=>_e,tn:()=>wt,n4:()=>S,gD:()=>z,Vp:()=>Mr,Cx:()=>P,bK:()=>R,gi:()=>gn,Z$:()=>me,GT:()=>Un,hr:()=>ye,JL:()=>Te,Ck:()=>L,dU:()=>C,wG:()=>Ye,hZ:()=>Et,$e:()=>Qt,qT:()=>$e,GQ:()=>Ke,q3:()=>Qe,D_:()=>zt,Uf:()=>w,_l:()=>G,Md:()=>q,V7:()=>F,fe:()=>se,JP:()=>Oe,Z_:()=>E,zO:()=>ie,UZ:()=>k,$7:()=>xe,rb:()=>N,VF:()=>Rt,vf:()=>mn,PV:()=>Ht,PS:()=>Lt,Iz:()=>et,zD:()=>I,m3:()=>De,XP:()=>Se,PM:()=>pe,cX:()=>ve,G6:()=>ne,Us:()=>ue,AA:()=>he,G0:()=>ze,mO:()=>J,HH:()=>fe,PU:()=>qr,Tl:()=>ge,uH:()=>Ie,c3:()=>ae,rx:()=>x});var n=e(36087),t=e(14041);const r=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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 i=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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),y=e(22716),A=e(9495);const m=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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 p=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));p.displayName="Virus";const b=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));b.displayName="CreditCard02";const h=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));h.displayName="Link03";var f=e(85418);const v=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));v.displayName="ClipboardPlus";const M=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));M.displayName="Route";const x=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,z="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",T="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",S="http://hl7.org/fhir/questionnaire-item-control",E="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",C="http://hl7.org/fhir/StructureDefinition/minValue",R="http://hl7.org/fhir/StructureDefinition/maxValue",L="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",P="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",N="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",F="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",q="http://hl7.org/fhir/StructureDefinition/entryFormat",I="http://hl7.org/fhir/StructureDefinition/tz-code",k="tz-code",U="footer",$="check-box",K="header",G="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",se="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",me=[{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"}],ye={"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"},Te={"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"},ve="ui-toolkit/CoordinatePicker",ne="ui-toolkit/DetailsInfo",ae="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",pe="ui-toolkit/Button",fe="ui-toolkit/Phone",ue="ui-toolkit/ErrorCard",te="ui-toolkit/FormContainer",J="ui-toolkit/PageHeader",ge="ui-toolkit/SelectableOption",ze="ui-toolkit/Modal",De="ui-toolkit/Alert",Se="ui-toolkit/AppSectionAccess",Ie="ui-toolkit/SensitiveDataCategory",xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",_e="http://icanbwell.com/fhir/StructureDefinition/icon-name",it="http://icanbwell.com/fhir/StructureDefinition/error-title",bt="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",Ot="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ft="http://icanbwell.com/fhir/StructureDefinition/description",Qt="http://icanbwell.com/fhir/StructureDefinition/modal-description",zt="http://icanbwell.com/fhir/StructureDefinition/modal-title",Ke="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",$e="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Et="http://icanbwell.com/fhir/StructureDefinition/button-text",Qe="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Lt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Sn="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",et="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Rt="http://icanbwell.com/fhir/StructureDefinition/trigger-color",Ht="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Un="http://hl7.org/fhir/StructureDefinition/mimeType",Mr="http://hl7.org/fhir/StructureDefinition/maxSize",gn="http://icanbwell.com/fhir/StructureDefinition/message-severity",In="http://icanbwell.com/fhir/StructureDefinition/alert-color",cr="http://icanbwell.com/fhir/StructureDefinition/hideLabel",Dn="http://icanbwell.com/fhir/StructureDefinition/placeholder",$r="http://icanbwell.com/fhir/StructureDefinition/hint-text",qr="ui-toolkit/PrefilledMemberDemographicsAlert",wt="http://hl7.org/fhir/issue-severity",Ve="http://icanbwell.com/fhir/StructureDefinition/button-type",ot="http://icanbwell.com/fhir/StructureDefinition/button-action",Je="button-type",tt="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",rt="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",lt="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",St="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",st="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",le={},Oe={"user-check":r,"user-check-02":s,"user-plus":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:p,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":b,"link-03":h,"search-lg":f.q,"clipboard-plus":v,route:M}},25624:(Z,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>Sn,GN:()=>ie,J4:()=>tt,MU:()=>$,Nw:()=>wt,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>F,eC:()=>lt,iI:()=>q,lv:()=>N,mR:()=>yt,nt:()=>z,od:()=>w,t7:()=>it,yQ:()=>Ee,zj:()=>pe});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(69364),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,h=(pt,Yt,qt)=>Yt in pt?A(pt,Yt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):pt[Yt]=qt,f=(pt,Yt)=>{for(var qt in Yt||(Yt={}))p.call(Yt,qt)&&h(pt,qt,Yt[qt]);if(O)for(var qt of O(Yt))b.call(Yt,qt)&&h(pt,qt,Yt[qt]);return pt},v=(pt,Yt)=>m(pt,d(Yt));const M=pt=>{var Yt;return(Yt=pt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Pt,$t;return($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)!=null?$t:[]}).find(qt=>{var Pt;return(Pt=qt.code)==null?void 0:Pt.startsWith("ui-toolkit/")}))==null?void 0:Yt.code},x=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.V7);return qt?.valueCode||"off"},z=(pt,Yt,qt)=>{const Pt=(0,u.A)(qt);return pt&&Yt&&qt?Pt.replace("<p>",`<span>${Yt} `).replace("</p>","</span>").trim():Pt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=pt=>{const Yt=pt?.find(qt=>qt.url===y.Vp);return Yt?.valueInteger},S=pt=>{const Yt=pt?.find(qt=>qt.url===y.Z_);return Yt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(pt,Yt)=>{const qt=pt?.find(Pt=>Pt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Yt&&E[Yt]||C},L=pt=>{const Yt=pt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Yt?.valueString},P=pt=>{const Yt=pt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Yt?.length?Yt.join(","):void 0},D=pt=>pt.split(",").map(Pt=>Pt.trim()).map(Pt=>y.JL[Pt]||Pt).filter((Pt,$t,Zt)=>Zt.indexOf(Pt)===$t).join(", "),w=(pt,Yt,qt)=>{const Pt=D(pt),$t=Pt.lastIndexOf(","),Zt=$t!==-1?`${Pt.substring(0,$t)} or${Pt.substring($t+1)}`:Pt,Mn=[Yt&&`max. ${(Yt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return Mn.length>0?`${Zt} (${Mn.join(", ")})`:Zt},N=pt=>{const Yt=pt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Yt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},F=(pt,Yt)=>{var qt,Pt,$t;const Zt=Yt?.find(Mn=>Mn.url.includes(pt));return($t=(Pt=(qt=Zt?.valueInteger)!=null?qt:Zt?.valueDecimal)!=null?Pt:Zt?.valueString)!=null?$t:Zt?.valueDate},q=pt=>{if(!!pt){if(/^\d{4}-\d{2}-\d{2}$/.test(pt))return pt;try{const Yt=(0,o.evaluate)({},pt);if(Array.isArray(Yt)&&Yt.length>0){const qt=Yt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Pt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Zt=String(qt.getDate()).padStart(2,"0");return`${Pt}-${$t}-${Zt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(pt,Yt)=>{var qt,Pt;const $t=Yt?.find(Mn=>Mn.url===pt);if(!$t)return;const Zt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Zt||q((Pt=$t.valueExpression)==null?void 0:Pt.expression)},k=(pt,Yt)=>{if(!(!pt||pt.length===0))for(const qt of pt){const Pt=F(Yt,qt.extension);if(Pt!==void 0)return Pt;if(qt.item&&qt.item.length>0){const $t=k(qt.item,Yt);if($t!==void 0)return $t}}},U=(pt,Yt)=>{try{const qt=String(pt??Yt);let Pt;if(qt.includes("/"))Pt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Pt=(0,t.A)($t)}return(0,r.A)(Pt)}catch(qt){return console.error("Date parsing error:",qt,pt),null}},$=(pt,Yt)=>{var qt;for(const Pt of pt){if(Pt.linkId===Yt)return Pt;if((qt=Pt.item)!=null&&qt.length){const $t=$(Pt.item,Yt);if($t!==void 0)return $t}}},K=(pt,Yt)=>{var qt;const Pt=[];for(const $t of pt)if($t.linkId===Yt&&Pt.push($t),(qt=$t.item)!=null&&qt.length){const Zt=K($t.item,Yt);Pt.push(...Zt)}return Pt},G=(pt,Yt,qt=0)=>K(pt,Yt)[qt];function oe(pt){return pt!=null}const se=(pt,Yt)=>{var qt,Pt,$t;if("answerString"in pt&&oe(pt.answerString)){if(pt.operator==="=")return Yt?.valueString===pt.answerString;if(pt.operator==="!=")return Yt?.valueString!==pt.answerString}if("answerBoolean"in pt&&oe(pt.answerBoolean)){if(pt.operator==="=")return Yt?.valueBoolean===pt.answerBoolean;if(pt.operator==="!=")return Yt?.valueBoolean!==pt.answerBoolean}if("answerInteger"in pt&&oe(pt.answerInteger)||"answerDecimal"in pt&&oe(pt.answerDecimal)){const Zt=Number(Yt?.valueInteger||Yt?.valueDecimal),Mn=Number(pt.answerInteger||pt.answerDecimal);if(pt.operator==="=")return Zt===Mn;if(pt.operator==="!=")return Zt!==Mn;if(pt.operator===">")return Zt>Mn;if(pt.operator==="<")return Zt<Mn;if(pt.operator===">=")return Zt>=Mn;if(pt.operator==="<=")return Zt<=Mn}if("answerQuantity"in pt&&oe(pt.answerQuantity)){const Zt=Yt?.valueQuantity,Mn=pt.answerQuantity;if(Zt?.unit!==Mn?.unit)return!1;if(pt.operator==="=")return Zt.value===Mn.value;if(pt.operator==="!=")return Zt.value!==Mn.value;if(pt.operator===">")return Zt.value>Mn.value;if(pt.operator==="<")return Zt.value<Mn.value;if(pt.operator===">=")return Zt.value>=Mn.value;if(pt.operator==="<=")return Zt.value<=Mn.value}if("answerCoding"in pt&&oe(pt.answerCoding)){const Zt=Yt?.valueCoding,Mn=pt.answerCoding;if(pt.operator==="=")return Zt?.code===Mn.code;if(pt.operator==="!=")return Zt?.code!==Mn.code}if("answerReference"in pt&&oe(pt.answerReference)){const Zt=Yt?.valueReference,Mn=pt.answerReference;if(pt.operator==="=")return Zt?.reference===Mn.reference;if(pt.operator==="!=")return Zt?.reference!==Mn.reference}if("answerDate"in pt&&oe(pt.answerDate)||"answerDateTime"in pt&&oe(pt.answerDateTime)||"answerTime"in pt&&oe(pt.answerTime)){const Zt=new Date(($t=(Pt=(qt=Yt?.valueDate)!=null?qt:Yt?.valueDateTime)!=null?Pt:Yt?.valueTime)!=null?$t:""),Mn=new Date(pt.answerDate||pt.answerDateTime||pt.answerTime||"");if(pt.operator==="=")return Zt.getTime()===Mn.getTime();if(pt.operator==="!=")return Zt.getTime()!==Mn.getTime();if(pt.operator===">")return Zt.getTime()>Mn.getTime();if(pt.operator==="<")return Zt.getTime()<Mn.getTime();if(pt.operator===">=")return Zt.getTime()>=Mn.getTime();if(pt.operator==="<=")return Zt.getTime()<=Mn.getTime()}return pt.operator==="exists"?Yt!=null===pt.answerBoolean:!0},ie=(pt,Yt,qt)=>{const Pt=$t=>{const Zt=K(qt,$t.question);return Zt.length===0||Zt.every(Mn=>!Mn.answer||Mn.answer.length===0)?se($t,void 0):Zt.some(Mn=>{var zr;return(zr=Mn.answer)==null?void 0:zr.some(jr=>se($t,jr&&Object.keys(jr).length>0?jr:void 0))})};return pt&&pt?.length>0?Yt==="any"?pt?.some($t=>Pt($t)):pt?.every($t=>Pt($t)):!0},me=(pt,Yt,qt,Pt,$t)=>{if(!pt||pt.length===0)return!0;const Zt=Mn=>{var zr;let jr;if(Pt&&typeof $t=="number"){const Pn=qt.filter(rn=>rn.linkId===Pt)[$t];if(Pn?.item){const rn=Pn.item.find(vt=>vt.linkId===Mn.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(vt=>se(Mn,vt&&Object.keys(vt).length>0?vt:void 0))}}if(!jr){const Rn=K(qt,Mn.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(vt=>se(Mn,vt&&Object.keys(vt).length>0?vt:void 0))});jr=void 0}return se(Mn,jr)};return Yt==="any"?pt.some(Mn=>Zt(Mn)):pt.every(Mn=>Zt(Mn))},ye=(pt,Yt)=>{var qt;if(!!((qt=pt?.valueExpression)!=null&&qt.expression))try{const Pt=evaluate(Yt,pt.valueExpression.expression);return Array.isArray(Pt)?Pt.some($t=>Boolean($t)):Boolean(Pt)}catch{return}},Te=(pt,Yt)=>{var qt;const Pt=(qt=pt.extension)==null?void 0:qt.find(Zt=>Zt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=ye(Pt,Yt);return v(f({},pt),{readOnly:$t??pt.readOnly})},ve=(pt,Yt,qt)=>{const{required:Pt,maxLength:$t,type:Zt,extension:Mn,enableWhen:zr,enableBehavior:jr,repeats:Rn,answerOption:Pn}=pt;if(!ie(zr,jr,Yt)||pt.type==="group"||pt.type==="display")return"";if(Rn)return ne(pt,Yt,qt);const rn=fe(pt,Yt);return rn&&ue(rn,pt)?te(pt,Yt,qt,rn):pe(Mn,Zt,Pt,$t,qt,Pn)},ne=(pt,Yt,qt)=>{const{required:Pt}=pt;if(Pt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Zt=0;Zt<qt.length;Zt++){const Mn=qt[Zt];if(Mn&&Object.keys(Mn).length>0&&Object.values(Mn).some(jr=>jr!=null&&jr!==""&&(Array.isArray(jr)?jr.length>0:!0))){$t=!0;const jr=pe(pt.extension,pt.type,!0,pt.maxLength,[Mn],pt.answerOption);if(jr)return`Item ${Zt+1}: ${jr}`;if(pt.item&&pt.item.length>0){const Rn=ae(pt.item,Yt,pt.linkId,Zt);if(Rn)return`Item ${Zt+1}: ${Rn}`}}else return`Item ${Zt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(qt&&qt.length>0)for(let $t=0;$t<qt.length;$t++){const Zt=qt[$t];if(Zt&&Object.keys(Zt).length>0&&Object.values(Zt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=pe(pt.extension,pt.type,!1,pt.maxLength,[Zt],pt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(pt.item&&pt.item.length>0){const jr=ae(pt.item,Yt,pt.linkId,$t);if(jr)return`Item ${$t+1}: ${jr}`}}}return""},ae=(pt,Yt,qt,Pt)=>{var $t,Zt;for(const Mn of pt){if(!me(Mn.enableWhen,Mn.enableBehavior,Yt,qt,Pt))continue;const zr=$(Yt,qt),jr=($t=zr?.item)==null?void 0:$t.find(Pn=>Pn.linkId===Mn.linkId),Rn=(Zt=jr?.answer)!=null&&Zt[Pt]?[jr.answer[Pt]]:void 0;if(Mn.required){if(!Rn||!Rn[0]||!he(Rn[0]))return`${Mn.text||Mn.linkId} is required`;const Pn=pe(Mn.extension,Mn.type,!0,Mn.maxLength,Rn,Mn.answerOption);if(Pn)return`${Mn.text||Mn.linkId}: ${Pn}`}else if(Rn&&Rn[0]&&he(Rn[0])){const Pn=pe(Mn.extension,Mn.type,!1,Mn.maxLength,Rn,Mn.answerOption);if(Pn)return`${Mn.text||Mn.linkId}: ${Pn}`}if(Mn.item&&Mn.item.length>0){const Pn=ae(Mn.item,Yt,Mn.linkId,Pt);if(Pn)return Pn}}return""},he=pt=>!pt||Object.keys(pt).length===0?!1:Object.values(pt).some(Yt=>Yt!=null&&Yt!==""&&(Array.isArray(Yt)?Yt.length>0:!0)),pe=(pt,Yt,qt,Pt,$t,Zt)=>{var Mn,zr,jr,Rn,Pn;let rn="";const vt=!!pt?.find(Cn=>{var jn,wr;return Cn.url===y.gD&&((wr=(jn=Cn.valueCodeableConcept)==null?void 0:jn.coding)==null?void 0:wr.some(Wr=>Wr.system===y.n4&&Wr.code===y.GI))}),Tt=$t?.[0],Kt={choice:((Mn=Tt?.valueCoding)==null?void 0:Mn.code)||(Tt?.valueString&&Zt?.some(Cn=>Cn.valueString===Tt.valueString)?Tt.valueString:null),"open-choice":((zr=Tt?.valueCoding)==null?void 0:zr.code)||Tt?.valueString,boolean:Tt?.valueBoolean,string:Tt?.valueString,text:Tt?.valueString,url:Tt?.valueUri,integer:Tt?.valueInteger,decimal:Tt?.valueDecimal,dateTime:Tt?.valueDateTime,date:Tt?.valueDate,time:Tt?.valueTime,quantity:(jr=Tt?.valueQuantity)==null?void 0:jr.value,reference:(Rn=Tt?.valueReference)==null?void 0:Rn.display,attachment:(Pn=Tt?.valueAttachment)==null?void 0:Pn.title};if(!(Yt in Kt))return"";const un=Kt[Yt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Yt==="boolean"&&un!==!0&&vt)?"This field is required":"",maxLength:()=>Pt&&un!==null&&un!==void 0&&un.toString().length>Pt?`Input should not exceed ${Pt} characters`:"",minLength:()=>{const Cn=F("minLength",pt);return Cn&&un!==null&&un!==void 0&&un.toString().length<Number(Cn)?`Input should be at least ${Cn} characters`:""},urlRegex:()=>{const Cn=new RegExp(y.rx),jn=F("regexError",pt),wr=jn??"Please enter a valid url starting from http:// and https://";return Cn&&Yt==="url"&&un&&!Cn.test(un)?String(wr):""},regex:()=>{const Cn=F("regex",pt);if(!Cn||typeof un!="string")return"";const jn=new RegExp(Cn),wr=F("regexError",pt),Wr=wr??"Please enter a valid input";return jn&&un&&!jn.test(un)?String(Wr):""},dateTime:()=>{if(Yt==="dateTime"&&un){const Cn=un?.toString(),jn=new Date(Cn);return isNaN(jn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Yt!=="date"||!un)return"";const Cn=un.replace(/\D/g,"");return Cn.length>0&&Cn.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var Cn;if(Yt==="date"){const wr=I(y.dU,pt),Wr=U(wr??"01/01/1900","01/01/1900"),_r=U(un,"");if(!Wr||!_r)return"";if((0,s.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Ck))==null?void 0:Cn.valueString;return f0??`Date should not be before ${wr??"01/01/1900"}`}return""}const jn=F("minValue",pt);return jn!=null&&un!==null&&un!==void 0&&un<jn?`Input should not be less than ${jn}`:""},maxValue:()=>{var Cn;if(Yt==="date"){const wr=I(y.bK,pt),Wr=U(wr??"01/01/2100","01/01/2100"),_r=U(un,"");if(!Wr||!_r)return"";if((0,i.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Cx))==null?void 0:Cn.valueString;return f0??`Date should not be after ${wr??"01/01/2100"}`}return""}const jn=F("maxValue",pt);return jn!=null&&un!==null&&un!==void 0&&un>jn?`Input should not exceed ${jn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},fe=(pt,Yt)=>{for(const qt of Yt)if(qt.item){if(qt.item.find(Zt=>Zt.linkId===pt.linkId))return qt;const $t=fe(pt,qt.item);if($t)return $t}return null},ue=(pt,Yt)=>{if(pt.answer&&pt.answer.length>1)return!0;if(pt.item){const qt=pt.item.find(Pt=>Pt.linkId===Yt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},te=(pt,Yt,qt,Pt)=>{var $t,Zt;const{required:Mn}=pt,zr=($t=Pt.item)==null?void 0:$t.find(Pn=>Pn.linkId===pt.linkId),jr=zr?.answer||[],Rn=((Zt=Pt.answer)==null?void 0:Zt.length)||1;for(let Pn=0;Pn<Rn;Pn++){const rn=jr[Pn];if(Mn){if(!rn||!he(rn))return`Item ${Pn+1}: ${pt.text||pt.linkId} is required`;const vt=pe(pt.extension,pt.type,!0,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Pn+1}: ${vt}`}else if(rn&&he(rn)){const vt=pe(pt.extension,pt.type,!1,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Pn+1}: ${vt}`}}return""},J=(pt,Yt)=>{for(const qt of pt){if(qt?.linkId===Yt)return qt;if(qt?.item&&qt.item.length>0){const Pt=J(qt.item,Yt);if(Pt)return Pt}}},ge=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===FOOTER_CODE))}))},ze=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===HEADER_CODE))}))},Se=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===y.gD&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===y.n4&&Zt.code===y._l))}))},Ie=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===CHECKBOX_CODE))}))},_e=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.fe);return qt?.valueInteger},it=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.zO);return qt?.valueInteger},bt=pt=>{var Yt;const qt=(Yt=pt?.extension)==null?void 0:Yt.find(Pt=>Pt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},Ot=(pt,Yt,qt,Pt,$t,Zt)=>{const Mn=jr=>Yt.filter(Rn=>Rn.linkId===jr),zr=new Set;return pt.map(jr=>{if(zr.has(jr.linkId)||ge(jr))return null;const Pn=Mn(jr.linkId),rn=jr.type==="group"&&jr.repeats;if(zr.add(jr.linkId),rn){const vt=[];if(Pn.forEach((Tt,Kt)=>{const un={linkId:jr.linkId,text:jr.text};let on;if(qt===jr.linkId&&typeof Zt=="number"&&Zt===Kt&&$t&&$t.length>0){const Cn=Tt?.item||[];on=[...Cn],$t.forEach(jn=>{const wr=on.findIndex(Wr=>Wr.linkId===jn.linkId);wr>=0?on[wr]=v(f({},Cn[wr]),{answer:jn.answer}):on.push(jn)})}else jr.item&&(on=Ot(jr.item,Tt?.item||[],qt,Pt,$t,Kt));qt===jr.linkId&&typeof Zt=="number"&&Zt===Kt&&Pt?un.answer=Pt:un.answer=Tt.answer||[{}],on&&on.length>0?un.item=on:Tt.item&&(un.item=Tt.item),vt.push(un)}),qt===jr.linkId&&typeof Zt=="number"&&Zt>=Pn.length)for(let Tt=Pn.length;Tt<=Zt;Tt++){const Kt={linkId:jr.linkId,text:jr.text,answer:Tt===Zt&&Pt?Pt:[{}]};Tt===Zt&&$t&&$t.length>0?Kt.item=$t:jr.item&&(Kt.item=Ot(jr.item,[],void 0,void 0,void 0,void 0)),vt.push(Kt)}return vt}else if(jr.repeats&&typeof Zt=="number"&&qt===jr.linkId){const vt=Pn[0]||{linkId:jr.linkId,text:jr.text,answer:[]},Tt={linkId:jr.linkId,text:jr.text,answer:[...vt.answer||[]]};if(Pt&&Pt.length>0){for(;Tt.answer.length<=Zt;)Tt.answer.push({});Tt.answer[Zt]=Pt[0]}return Tt}else{const vt=Pn[0],Tt=jr.item?Ot(jr.item,vt?.item||[],qt,Pt,$t,Zt):void 0,Kt=Tt&&Tt.length>0,un={linkId:jr.linkId,text:jr.text};return qt&&jr.linkId===qt&&typeof Zt!="number"?(Pt||!Pt&&!$t?un.answer=Pt:vt?.answer&&(un.answer=vt.answer),$t?un.item=$t:Kt&&(un.item=Tt)):(vt?.answer?un.answer=vt.answer:un.answer=[{}],Kt&&(un.item=Tt)),un}}).filter(Boolean).flat()},Ft=(pt,Yt)=>{for(const qt of pt)if(qt.linkId===Yt||qt.item&&Ft(qt.item,Yt))return qt.linkId;return null},Qt=(pt,Yt,qt,Pt)=>{var $t;const Zt=($t=pt?.item)!=null?$t:Pt;return!Zt||Zt.length===0?!0:Zt.every(Mn=>{var zr;const jr=K(Yt,Mn.linkId);if(jr.length===0){const Rn=(zr=$(Yt,Mn.linkId))==null?void 0:zr.answer;if(ve(Mn,Yt,Rn)&&ie(Mn.enableWhen,Mn.enableBehavior,Yt)&&qt.includes(Mn.linkId))return!1}else for(const Rn of jr)if(ve(Mn,Yt,Rn.answer)&&ie(Mn.enableWhen,Mn.enableBehavior,Yt)&&qt.includes(Mn.linkId))return!1;return Mn.item?Qt(Mn,Yt,qt):!0})},zt=(pt,Yt,qt=!0)=>{for(const Pt of pt)if(Pt.linkId===Yt&&Pt.answer&&Pt.answer.length>0||Pt.item&&Pt.item.length>0&&zt(Pt.item,Yt,qt))return!0;return!1},Ke=(pt,Yt,qt=0)=>{const Pt=pt.filter($t=>$t.linkId===Yt);if(Pt.length>qt){const $t=Pt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Zt=>Zt&&Object.keys(Zt).length>0&&Object.values(Zt).some(Mn=>Mn!=null&&Mn!==""));if($t.item&&$t.item.length>0)return zt($t.item,Yt,!1)}return zt(pt,Yt,!1)},$e=(pt,Yt)=>{if(!pt||!pt.item)return!1;const qt=Pt=>{var $t;if(ze(Pt)&&Pt.required&&ie(Pt.enableWhen,Pt.enableBehavior,Yt)){const Zt=$(Yt,Pt.linkId),Mn=pe(Pt.extension,Pt.type,Pt.required,Pt.maxLength,Zt?.answer,Pt.answerOption);if(!(($t=Zt?.answer)!=null&&$t.length)||Mn)return!0}if(Pt.item){for(const Zt of Pt.item)if(qt(Zt))return!0}return!1};for(const Pt of pt.item)if(qt(Pt))return!0;return!1},Et=pt=>{var Yt,qt,Pt;if(pt.valueString!==void 0)return pt.valueString;if(pt.valueBoolean!==void 0)return pt.valueBoolean;if(pt.valueInteger!==void 0)return pt.valueInteger;if(pt.valueDecimal!==void 0)return pt.valueDecimal;if(pt.valueDate!==void 0)return pt.valueDate;if(pt.valueDateTime!==void 0)return pt.valueDateTime;if(((Yt=pt.valueCoding)==null?void 0:Yt.code)!==void 0)return pt.valueCoding.code;if(((qt=pt.valueReference)==null?void 0:qt.reference)!==void 0)return pt.valueReference.reference;if(((Pt=pt.valueQuantity)==null?void 0:Pt.value)!==void 0)return pt.valueQuantity.value;if(pt.valueAttachment!==void 0)return pt.valueAttachment},Qe=pt=>{const Yt={linkId:pt.linkId};if(pt.answer&&pt.answer.length>0){const qt=pt.answer.map(Pt=>Et(Pt)).filter(Pt=>Pt!==void 0);qt.length>0&&(Yt.answer=qt)}if(pt.item&&pt.item.length>0){const qt=pt.item.map(Pt=>Qe(Pt)).filter(Pt=>{const $t=Object.keys(Pt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Yt.item=qt)}return Yt},Ye=(pt,Yt,qt,Pt,$t,Zt)=>{var Mn;const zr=(Mn=Yt?.item)==null?void 0:Mn[qt[Pt]],jr=zr?.linkId;if(!jr)return!1;const Rn=K(pt,jr),Pn=K($t,jr),rn=vt=>{if(vt!=null){if(Array.isArray(vt)){const Tt=vt.filter(Kt=>Kt!=null).map(Kt=>rn(Kt)).filter(Kt=>Kt!==void 0);return Tt.length===0||Tt.length===1&&typeof Tt[0]=="object"&&Object.keys(Tt[0]).length===0?void 0:Tt}if(typeof vt=="object"){const Tt={};for(const[Kt,un]of Object.entries(vt))if(un!=null){const on=rn(un);on!==void 0&&(Tt[Kt]=on)}return Object.keys(Tt).length===0?void 0:Tt}return vt}};if(Rn.length!==Pn.length)return!1;for(let vt=0;vt<Rn.length;vt++){const Tt=Rn[vt],Kt=Pn[vt];if(!Tt||!Kt)return!1;const un=Qe(rn(Tt)),on=Qe(rn(Kt));if(!_.isEqual(un,on))return!1}return Pt!==Zt},Lt=(pt,Yt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ve(pt,Yt,qt)||null,mn=(pt,Yt)=>{const qt={},Pt=$t=>{$t.forEach(Zt=>{const Mn=K(Yt,Zt.linkId);if(st(Zt,pt)||Zt.repeats)for(let zr=0;zr<Mn.length;zr++){const jr=Mn[zr];if(jr?.answer&&jr.answer.length>0){const Rn=Lt(Zt,Yt,jr.answer);Rn&&(qt[Zt.linkId]=v(f({},qt[Zt.linkId]),{[zr]:Rn}))}}else{const zr=$(Yt,Zt.linkId);if(zr?.answer&&zr.answer.length>0){const jr=Lt(Zt,Yt,zr.answer);jr&&(qt[Zt.linkId]={0:jr})}}Zt.item&&Zt.item.length>0&&Pt(Zt.item)})};return Pt(pt),qt},Sn=pt=>{if(!pt)return"";const Yt=pt.split("-");if(Yt.length===3){const[qt,Pt,$t]=Yt;return`${qt.slice(-4)}-${Pt}-${$t}`}return""},et=pt=>pt.trim().replace(/[A-Za-z]+/g,""),Rt=(pt,Yt)=>{const qt=(Pt,$t)=>{for(const Zt of Pt){if(Zt.linkId===$t)return Zt.answer;if(Zt.item&&Zt.item.length>0){const Mn=qt(Zt.item,$t);if(Mn!==void 0)return Mn}}};return qt(pt,Yt)},Ht=(pt,Yt)=>{if(!Yt||Yt.length===0)return null;const qt=pt.linkId,Pt=($t,Zt,Mn=[])=>{for(const zr of $t){const jr=[...Mn,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Zt))return jr.some(rn=>rn.repeats===!0)?zr:null;if(Pt(zr.item,Zt,jr))return zr}}return null};return Pt(Yt,qt)},Un=(pt,Yt)=>{if(!Yt||Yt.length===0)return!1;const qt=pt.linkId,Pt=($t,Zt,Mn=[])=>{for(const zr of $t){const jr=[...Mn,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Zt))return jr.some(rn=>{const vt=M(rn.extension||[]);return!!vt&&vt!==UI_TOOLKIT_FORM_CONTAINER});if(Pt(zr.item,Zt,jr))return!0}}return!1};return Pt(Yt,qt)},Mr=(pt,Yt,qt)=>{const Pt={};if(!pt)return Pt;const{linkId:$t}=Yt;if(pt[$t]){const Zt=pt[$t];Pt[$t]=Zt[qt]||""}return Yt.item&&Yt.item.length>0&&Yt.item.forEach(Zt=>{if(pt[Zt.linkId]){const Mn=pt[Zt.linkId];Pt[Zt.linkId]=Mn[qt]||""}}),Pt},gn=(pt,Yt)=>{const qt={};if(!pt||!pt[Yt])return qt;const Pt=pt[Yt];return qt[Yt]=Pt[0]||"",qt},In=pt=>{const Yt=pt.findIndex(Zt=>!ze(Zt)),qt=Yt>=0?[Yt]:[],Pt=new Map;let $t=null;if(pt.forEach((Zt,Mn)=>{const zr=Se(Zt);if(zr&&Zt.type==="group")Mn!==Yt&&qt.push(Mn),Pt.set(Mn,[Mn]),$t=Mn;else if($t!==null&&!zr){const jr=Pt.get($t)||[];Pt.set($t,[...jr,Mn])}}),pt.length>0&&qt.length>0){const Zt=qt[0];if(!Pt.has(Zt)){const Mn=qt.find(jr=>jr>Zt),zr=[];for(let jr=Zt;jr<(Mn??pt.length);jr++)zr.push(jr);Pt.set(Zt,zr)}}return{groupIndices:qt,itemsToRenderMap:Pt}},cr=(pt,Yt,qt,Pt)=>{let $t=[...Pt];const Zt=(Mn,zr)=>{Mn.forEach(jr=>{if((!jr?.enableWhen||ie(jr?.enableWhen,jr.enableBehavior,zr))&&jr.initial&&!zt(zr,jr.linkId))if(jr.repeats){const Rn=zr.filter(Pn=>Pn.linkId===jr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Ke(zr,jr.linkId,rn)||($t=Ot(qt,$t,jr.linkId,jr.initial,void 0,rn))}):$t=Ot(qt,$t,jr.linkId,jr.initial)}else $t=Ot(qt,$t,jr.linkId,jr.initial);jr.item&&Zt(jr.item,zr)})};return Zt(pt,Yt),$t},Dn=(pt,Yt,qt)=>{if(!pt)return[];const Pt=[],$t=Zt=>{Zt.required===Yt&&ie(Zt.enableWhen,Zt.enableBehavior,qt)&&!ze(Zt)&&Zt.type!=="display"&&Pt.push(Zt),Zt.item&&Zt.item.length>0&&Zt.item.forEach($t)};return pt.forEach($t),Pt},$r=(pt,Yt)=>pt.every(qt=>{var Pt;const $t=K(Yt,qt.linkId);if($t.length>0)return $t.every(Zt=>!ve(qt,Yt,Zt.answer));{const Zt=(Pt=$(Yt,qt.linkId))==null?void 0:Pt.answer;return!ve(qt,Yt,Zt)}}),qr=(pt,Yt)=>{let qt=-1;for(let Pt=pt.length-1;Pt>=0;Pt--)if(pt[Pt].linkId===Yt){qt=Pt;break}return qt},wt=(pt,Yt)=>pt.filter(qt=>qt.linkId!==Yt).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:wt(qt.item,Yt)}):qt),Ve=(pt,Yt,qt=pt)=>pt.reduce((Pt,$t)=>{const Zt=J(Yt,$t.linkId);return Zt?.enableWhen&&!ie(Zt.enableWhen,Zt.enableBehavior,qt)||($t.item&&$t.item.length>0?Pt.push(v(f({},$t),{item:Ve($t.item,Yt,qt)})):Pt.push($t)),Pt},[]),ot=(pt,Yt,qt=[])=>{const Pt=[],$t=Zt=>{Zt.forEach(Mn=>{Pt.push(Mn.linkId),Mn.item&&Mn.item.length>0&&$t(Mn.item)})};for(let Zt=0;Zt<pt.length;Zt++){const Mn=pt[Zt];if(Mn.linkId===Yt){const zr=pt.slice(0,Zt+1),jr=pt.slice(Zt+1),{kept:Rn,removed:Pn}=jr.reduce((rn,vt)=>{const Tt=J(qt,vt.linkId);return!Tt||Se(Tt)||ze(Tt)&&ie(Tt.enableWhen,Tt.enableBehavior,zr)?rn.kept.push(vt):rn.removed.push(vt),rn},{kept:[],removed:[]});return $t(Pn),{trimmedData:[...zr,...Rn],trimmedLinkIds:Pt,found:!0}}if(Mn.item&&Mn.item.length>0){const zr=ot(Mn.item,Yt,qt);if(zr.found){const jr=pt.slice(0,Zt),Rn=pt.slice(Zt+1),Pn=[...jr,v(f({},Mn),{item:zr.trimmedData})],{kept:rn,removed:vt}=Rn.reduce((Tt,Kt)=>{const un=J(qt,Kt.linkId);return!un||Se(un)||ze(un)&&ie(un.enableWhen,un.enableBehavior,Pn)?Tt.kept.push(Kt):Tt.removed.push(Kt),Tt},{kept:[],removed:[]});return $t(vt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Pt],found:!0}}}}return{trimmedData:pt,trimmedLinkIds:[],found:!1}},Je=(pt,Yt)=>pt.filter(qt=>!Yt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:Je(qt.item,Yt)}):qt),tt=pt=>{var Yt;if(!pt)return"empty";const qt=y.Z$.find(({patterns:Pt})=>Pt.some($t=>pt.includes($t)));return(Yt=qt?.type)!=null?Yt:"empty"},rt=(pt,Yt)=>{const{groupIndices:qt}=In(pt),Pt=pt.findIndex($t=>$t.linkId===Yt);return Pt!==-1?qt.indexOf(Pt):-1},lt=pt=>{if(!pt)return{restriction:null,warning:null};const Yt=qt=>{const Pt=pt.find(Zt=>Zt.url===qt&&Zt.valueString);if(!Pt?.valueString)return null;const $t=Pt.valueString.replace(/\\n/g,`
869
+ `}}customElements.get(ge)===void 0&&customElements.define(ge,ze);const De=[{name:"loader",defaultElement:document.createElement(te)},{name:"error",defaultElement:document.createElement(ge)}],Se=["error","loading"],Ie={error:"error",loading:"loader"},xe=({src:Ot,elementNameSuffix:Ft,version:Qt,prefetchFeatureApp:zt})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;window.bwell||(window.bwell=new ue({metadata:{version:Qt}}));const cr=`bwell-${Ft}`;if(customElements.get(cr)!==void 0)return;class Dn extends h{constructor(){super(),Ke.add(this),$e.set(this,(0,T.nanoid)()),Et.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Ye.set(this,new q.EventEmitter),Lt.set(this,void 0),mn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),Ht.set(this,void 0),this.attachShadow({mode:"open"});const qr=new me(De).attachToShadowRoot(this.shadowRoot);qr.addEventListener("visibilitychange",({visibility:wt,container:Ve,name:ot})=>{ot==="error"&&wt==="visible"&&window.bwell._registerEmbeddableContent(Ve),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=wt==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Ht,{slots:qr,attributes:new F().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Ye,"f")},"f"),(0,p.__classPrivateFieldSet)(this,Lt,(0,p.__classPrivateFieldGet)(this,Ke,"m",Un).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,mn,(0,p.__classPrivateFieldGet)(this,Ke,"m",Mr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,Sn,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,mn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,$e,this.id||(0,p.__classPrivateFieldGet)(this,$e,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Et,new z((0,p.__classPrivateFieldGet)(this,$e,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Et,"f").registerDispatcher(qr=>this.dispatchEvent(qr)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,Lt,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,Lt,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}),zt&&(0,b.h)(Ot).catch(()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}))})}disconnectedCallback(){var qr;(0,p.__classPrivateFieldGet)(this,Ye,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,mn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(qr=(0,p.__classPrivateFieldGet)(this,Et,"f"))===null||qr===void 0||qr.deregister(),(0,p.__classPrivateFieldGet)(this,Ye,"f").removeAllListeners()}}$e=new WeakMap,Et=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Lt=new WeakMap,mn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,Ht=new WeakMap,Ke=new WeakSet,Un=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${cr}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,$e,"f"),name:Ft,elementName:cr,utils:(0,p.__classPrivateFieldGet)(this,Ht,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},Mr=function({visibility:qr,name:wt}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=qr==="hidden"?"unset":"hidden"},gn=function(qr){(0,p.__classPrivateFieldGet)(this,Rt,"f")(),(0,p.__classPrivateFieldSet)(this,Rt,void 0,"f")},In=function(qr){return wt=>{const Ve=Se.findIndex(Je=>Je===qr);if(!Se.slice(0,Ve).some(Je=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(Je)!==null)){if(wt!==null)(0,p.__classPrivateFieldGet)(this,Rt,"f")&&(0,p.__classPrivateFieldGet)(this,Ke,"m",gn).call(this,qr),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[qr]),"f");else if(wt===null&&(0,p.__classPrivateFieldGet)(this,Rt,"f")){(0,p.__classPrivateFieldGet)(this,Ke,"m",gn).call(this,qr);const Je=Se.find(tt=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(tt)!==null);Je&&(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[Je]),"f")}}}},customElements.define(cr,Dn)}),_e={rE:"1.1089.2"},it="composite";var bt=e(67321);xe({src:`https://embeddables.prod.icanbwell.com/${it}/${_e.rE}/scripts/embeddable.federated.js`,elementNameSuffix:it,version:_e.rE,prefetchFeatureApp:!0})},79566:(Z,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,b,h)=>b in p?i(p,b,{enumerable:!0,configurable:!0,writable:!0,value:h}):p[b]=h,A=(p,b)=>{for(var h in b||(b={}))c.call(b,h)&&y(p,h,b[h]);if(g)for(var h of g(b))u.call(b,h)&&y(p,h,b[h]);return p},m=(p,b)=>o(p,a(b));const d=(p,b,h)=>{const f=_.cloneDeep(p);if(!f.contained||b<0)return f;const v=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(v!==-1&&!h){const M=f.contained[v];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===b+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[v]=M}}else h&&v!==-1&&(f.contained[v]=m(A({},f.contained[v]),{item:h}));return f},O=({formId:p,questionnaireResponse:b,showQuestionPrefix:h,nextQuestion:f,onGoBack:v,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,w;const{currentGroupIndex:N,hasCustomError:F}=useFHIRQuestionnaire(),q=(P=b.questionnaire)==null?void 0:P.replace("#",""),I=(D=b?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,$,K)=>{let G=_.cloneDeep(b);G.item=U,G=trimQuestionnaireItems(G,N,K),f(G,$)};return jsx("div",{className:`${F?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:C,questionnaireResponseItem:(w=b?.item)!=null?w:[],questionnaireSchema:I,status:b.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:v,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=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,p=(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},b=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,v=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),w=x?.placeId,N=x?.description,[F,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,$]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[oe,se]=(0,t.useState)(!1),ie=(0,t.useRef)(!1),me=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ye,Te]=(0,t.useState)(me),[ve,ne]=(0,t.useState)(me),[ae,{loading:he,error:pe}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[fe,{loading:ue,error:te}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ge,error:ze}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Te(me)},onCompleted:Qt=>{var zt,Ke;const $e=(Ke=(zt=Qt.placeAutocomplete)==null?void 0:zt.predictions)==null?void 0:Ke.map(Et=>{var Qe;return{id:Et.placeId,label:(0,s.removeAfterLastComma)(Et.description),mainText:Et?.mainText||((Qe=Et.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Et?.secondaryText||Et.description.split(",").slice(1).join(",").trim())}});Te($e?.length?$e:me)}}),De=(0,t.useMemo)(()=>ye.map(Qt=>b(p({},Qt),{displayLabel:(0,r.RZ)(Qt?.label||"",F)})),[F,ye]),Se=Qt=>h(void 0,null,function*(){var zt,Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;if($(Qt),G(Qt),se(!1),Qt&&typeof Qt=="string"){const cr=ye.find(tt=>tt.id===Qt),Dn=cr?.label||F;if(!cr)return;q(Dn),k(Dn),setTimeout(()=>{const tt=[{id:cr.id,label:cr.label}];Te(tt),ne(tt)},f);const $r=yield ae({variables:{placeId:Qt}}),qr=(Ke=(zt=$r?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ke.latitude,wt=(Et=($e=$r?.data)==null?void 0:$e.geocodingByPlaceId)==null?void 0:Et.longitude,Ve=((Ye=(Qe=$r?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((mn=(Lt=$r?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Je=((et=(Sn=$r?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(qr&&wt)if(!Ve||!Je){const tt=yield fe({variables:{latitude:String(qr),longitude:String(wt)}}),rt=((Ht=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",lt=((Mr=(Un=tt?.data)==null?void 0:Un.geocodingByLatLon)==null?void 0:Mr.state)||"",St=((In=(gn=tt?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:qr,longitude:wt,zipCode:rt,state:lt,stateCode:St,placeId:Qt,description:Dn,value:Qt})}else T({latitude:qr,longitude:wt,zipCode:Ve,state:ot,stateCode:Je,placeId:Qt,description:Dn,value:Qt});else se(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Qt=>h(void 0,null,function*(){return yield J({variables:{input:Qt,types:"geocode"}})})),_e=Qt=>h(void 0,null,function*(){if(se(!1),q(Qt),z?.(Qt),!Qt||Qt.trim().length===0){$(null),Te(me),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Qt});return}const zt=Qt.trim();zt.length>=2?yield xe(zt):Te(me)}),it=Qt=>{ie.current=Qt},bt=()=>{q(I),Te(ve),$(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var zt,Ke,$e,Et,Qe,Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In;if(w&&N){Te([{id:w,label:F||N}]),ne([{id:w,label:F||N}]),$(w),G(w),q(N),k(N),N===F&&q(N);const cr=yield ae({variables:{placeId:w}}),Dn=(Ke=(zt=cr?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ke.latitude,$r=(Et=($e=cr?.data)==null?void 0:$e.geocodingByPlaceId)==null?void 0:Et.longitude,qr=((Ye=(Qe=cr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",wt=((mn=(Lt=cr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Ve=((et=(Sn=cr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Dn&&$r)if(!qr||!wt||!Ve){const ot=yield fe({variables:{latitude:String(Dn),longitude:String($r)}}),Je=((Ht=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",tt=((Mr=(Un=ot?.data)==null?void 0:Un.geocodingByLatLon)==null?void 0:Mr.state)||"",rt=((In=(gn=ot?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:Dn,longitude:$r,zipCode:Je,state:tt,stateCode:rt,placeId:w,description:N,value:w})}else T({latitude:Dn,longitude:$r,zipCode:qr,state:wt,stateCode:Ve,placeId:w,description:N,value:w})}else $(null),G(null),q(""),k(""),Te(me),ne(me)}))()},[]);const Ot=oe||!!pe||!!te||!!ze||!!R,Ft=Ot?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(he||ue||D)},[C,he,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:F,isLoading:ge||he||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:Se,onInputChange:_e,defaultFilter:Ie,onOpenChange:it,onBlur:bt,isInvalid:Ot,hint:Ft,autoComplete:"address-line1",className:"w-full",children:Qt=>{const zt=Qt,Ke=F.trim().length>=2,$e=zt.mainText||"",Et=zt.secondaryText||"",Qe=$e.trim().length>0,Ye=Et.trim().length>0,Lt=Qe?(0,r.RZ)($e,F):{beforePart:"",highlightedPart:"",remainingPart:""},mn=Ye?(0,r.RZ)(Et,F):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:zt.id,supportingText:zt.supportingText,isDisabled:zt.isDisabled,icon:zt.icon,avatarUrl:zt.avatarUrl,textValue:zt.label,children:Ke&&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:Lt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Lt.highlightedPart}),(0,n.jsx)("span",{children:Lt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:mn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:mn.highlightedPart}),(0,n.jsx)("span",{children:mn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:zt.label})})}})})}},18077:()=>{},12200:(Z,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:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{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:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(11300);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const p=c.getId(O),b=c.getRouteMeta(p)||{},h=getBreadcrumbTitleKey(p,b,u);if(!h||b.breadcrumbHide)return[];const f=y[p];let v=c.getHref(p),M=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:p,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:p,href:v,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:(Z,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,p=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,v=(C,R)=>{for(var L in R||(R={}))b.call(R,L)&&f(C,L,R[L]);if(p)for(var L of p(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var w=q=>{try{F(L.next(q))}catch(I){D(I)}},N=q=>{try{F(L.throw(q))}catch(I){D(I)}},F=q=>q.done?P(q.value):Promise.resolve(q.value).then(w,N);F((L=L.apply(C,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),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:w,setQueryParams:N}=(0,a.useSearchQueryParams)(),F=(0,t.useRef)(!1),q=(0,t.useRef)(w);(0,t.useEffect)(()=>{q.current=w},[w]);const[I,k]=(0,t.useState)(!1),[U,$]=(0,t.useState)((R=w.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[oe,se]=(0,t.useState)(!1),ie=(0,t.useCallback)(ge=>{$(ge);try{N(M(v({},q.current),{locationPermission:ge||o.Ef.UNAVAILABLE}))}catch(ze){ze instanceof Error?P?.error(ze,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(ze)}`)}},[N,P]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[D,P]),ye=(0,t.useCallback)(ge=>x(void 0,null,function*(){const ze=D.getCurrentPosition(ge).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(ze,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Te=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ve=(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 me()))return P?.error("Location services not available"),!1;const ze=yield Te();return ze!==o.Ef.GRANTED&&ze!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${ze}`),!1):!0}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[me,P,Te]);(0,t.useEffect)(()=>{if(F.current)return;F.current=!0,(()=>x(void 0,null,function*(){const ze=w.locationPermission;if(ze===o.Ef.DENIED||ze===o.Ef.BLOCKED||ze===o.Ef.UNAVAILABLE){$(ze);return}k(!0);try{if(!(yield me())){ie(o.Ef.UNAVAILABLE);return}if(ze===o.Ef.GRANTED){try{const Ie=yield Te();if(Ie===o.Ef.GRANTED){const xe=yield ye(z);xe&&(G(xe),ie(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(ie(Ie),se(!0)):ie(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),ie(o.Ef.UNAVAILABLE)}return}const Se=yield Te();if(ie(Se),Se===o.Ef.GRANTED)try{const Ie=yield ye(z);Ie?G(Ie):ie(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),ie(o.Ef.UNAVAILABLE)}else Se===o.Ef.PROMPT&&se(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),ie(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){ie(o.Ef.UNAVAILABLE);return}k(!0);let ze=yield Te();if(ie(ze),ze===o.Ef.GRANTED||ze===o.Ef.PROMPT){if(L==="Android"&&ze===o.Ef.GRANTED)try{ze=yield ve(),ie(ze)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(ze!==o.Ef.UNAVAILABLE){const De=yield ye(z);return G(De),De}}return}catch(ge){ie(o.Ef.UNAVAILABLE),ge instanceof Error?P?.error(ge,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{k(!1)}}),[ne,P,L,ie,ye,Te,ve]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield me())?yield Te():o.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ge)}`),o.Ef.UNAVAILABLE}}),[me,P,Te]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ie(o.Ef.UNAVAILABLE);return}const ze=yield Te();ie(ze)}catch(ge){ge instanceof Error?P?.error(ge,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),ie(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[me,P,ie,Te]),fe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ie(o.Ef.UNAVAILABLE);return}const ze=yield Te();if(ze===o.Ef.DENIED||ze===o.Ef.BLOCKED||ze===o.Ef.UNAVAILABLE){ie(ze);return}const De=yield ve();if(ie(De),["granted","prompt"].includes(De)){const Se=yield ye(z);return G(Se),Se}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||P?.error(ge,"Error requesting location");else{const ze=ge&&typeof ge=="object"&&"message"in ge?ge.message:JSON.stringify(ge);ze?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${ze}`)}ie(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[me,P,ie,ye,ve,Te]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ie(o.Ef.UNAVAILABLE);return}const ze=yield ye(z);ze&&(G(ze),$(o.Ef.GRANTED),N(M(v({},q.current),{location:`${ze.coords.latitude},${ze.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ze.coords.latitude}`,lng:`${ze.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ge){throw ge instanceof Error?P?.error(ge,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ge)}`),ie(o.Ef.UNAVAILABLE),ge}finally{k(!1)}}),[me,P,N,ie,ye]),te=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ge=yield ae();ge&&N(M(v({},q.current),{location:`${ge.coords.latitude},${ge.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ge.coords.latitude}`,lng:`${ge.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ge){ge instanceof Error?P?.error(ge,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{k(!1)}}),[P,U,ae,N]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:$,position:K,refreshPosition:ae,requestPosition:fe,requestCurrentLocation:ue,checkAndSetLocationPermission:pe,checkLocaitonPermission:he}),[I,te,U,K,ae,fe,ue,pe,he]);return(0,n.jsxs)(T.Provider,{value:J,children:[oe&&(0,n.jsx)(g.J,{isOpen:oe,onClose:()=>se(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Z,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},71934:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267);const s=({onClick:i})=>{const{loading:o,i18n:{t:a}}=useI18nChild({keys:["health-space"]});return o?jsx(LoadingIndicator,{}):jsxs("div",{className:"tw-preflight flex h-full flex-col items-center justify-center gap-6 p-2 text-center md:p-4",children:[jsx(CircleIcon,{icon:Users01,size:"xl",className:"p-4 shadow-xl"}),jsxs("div",{className:"flex flex-col items-center gap-3",children:[jsx(Typography,{tag:"h2",className:"text-primary text-md font-semibold",children:a("YOUR_CARE_TEAM_IS_EMPTY")}),jsx(Typography,{tag:"p",className:"text-tertiary text-sm md:max-w-[26rem]",children:a("START_BUILDING_YOUR_CARE_TEAM")})]}),jsx(Button,{size:"sm",className:"w-fit min-w-[10rem] rounded-full shadow-lg",onClick:i,children:a("FIND_DOCTORS")})]})}},69364:(Z,l,e)=>{"use strict";e.d(l,{pc:()=>In,GI:()=>$,rz:()=>Ft,Fp:()=>Ot,el:()=>bt,ao:()=>it,oA:()=>T,Yt:()=>cr,g4:()=>_e,tn:()=>wt,n4:()=>S,gD:()=>z,Vp:()=>Mr,Cx:()=>P,bK:()=>R,gi:()=>gn,Z$:()=>me,GT:()=>Un,hr:()=>ye,JL:()=>Te,Ck:()=>L,dU:()=>C,wG:()=>Ye,hZ:()=>Et,$e:()=>Qt,qT:()=>$e,GQ:()=>Ke,q3:()=>Qe,D_:()=>zt,Uf:()=>w,_l:()=>G,Md:()=>q,V7:()=>F,fe:()=>se,JP:()=>Oe,Z_:()=>E,zO:()=>ie,UZ:()=>k,$7:()=>xe,rb:()=>N,VF:()=>Rt,vf:()=>mn,PV:()=>Ht,PS:()=>Lt,Iz:()=>et,zD:()=>I,m3:()=>De,XP:()=>Se,PM:()=>pe,cX:()=>ve,G6:()=>ne,Us:()=>ue,AA:()=>he,G0:()=>ze,mO:()=>J,HH:()=>fe,PU:()=>qr,Tl:()=>ge,uH:()=>Ie,c3:()=>ae,rx:()=>x});var n=e(36087),t=e(14041);const r=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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 i=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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),y=e(22716),A=e(9495);const m=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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 p=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));p.displayName="Virus";const b=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));b.displayName="CreditCard02";const h=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));h.displayName="Link03";var f=e(85418);const v=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));v.displayName="ClipboardPlus";const M=({size:We=24,color:Ee="currentColor",...yt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:We,height:We,stroke:Ee,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...yt},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"}));M.displayName="Route";const x=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,z="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",T="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",S="http://hl7.org/fhir/questionnaire-item-control",E="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",C="http://hl7.org/fhir/StructureDefinition/minValue",R="http://hl7.org/fhir/StructureDefinition/maxValue",L="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",P="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",N="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",F="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",q="http://hl7.org/fhir/StructureDefinition/entryFormat",I="http://hl7.org/fhir/StructureDefinition/tz-code",k="tz-code",U="footer",$="check-box",K="header",G="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",se="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",me=[{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"}],ye={"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"},Te={"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"},ve="ui-toolkit/CoordinatePicker",ne="ui-toolkit/DetailsInfo",ae="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",pe="ui-toolkit/Button",fe="ui-toolkit/Phone",ue="ui-toolkit/ErrorCard",te="ui-toolkit/FormContainer",J="ui-toolkit/PageHeader",ge="ui-toolkit/SelectableOption",ze="ui-toolkit/Modal",De="ui-toolkit/Alert",Se="ui-toolkit/AppSectionAccess",Ie="ui-toolkit/SensitiveDataCategory",xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",_e="http://icanbwell.com/fhir/StructureDefinition/icon-name",it="http://icanbwell.com/fhir/StructureDefinition/error-title",bt="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",Ot="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ft="http://icanbwell.com/fhir/StructureDefinition/description",Qt="http://icanbwell.com/fhir/StructureDefinition/modal-description",zt="http://icanbwell.com/fhir/StructureDefinition/modal-title",Ke="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",$e="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Et="http://icanbwell.com/fhir/StructureDefinition/button-text",Qe="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Lt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Sn="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",et="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Rt="http://icanbwell.com/fhir/StructureDefinition/trigger-color",Ht="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Un="http://hl7.org/fhir/StructureDefinition/mimeType",Mr="http://hl7.org/fhir/StructureDefinition/maxSize",gn="http://icanbwell.com/fhir/StructureDefinition/message-severity",In="http://icanbwell.com/fhir/StructureDefinition/alert-color",cr="http://icanbwell.com/fhir/StructureDefinition/hideLabel",Dn="http://icanbwell.com/fhir/StructureDefinition/placeholder",$r="http://icanbwell.com/fhir/StructureDefinition/hint-text",qr="ui-toolkit/PrefilledMemberDemographicsAlert",wt="http://hl7.org/fhir/issue-severity",Ve="http://icanbwell.com/fhir/StructureDefinition/button-type",ot="http://icanbwell.com/fhir/StructureDefinition/button-action",Je="button-type",tt="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",rt="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",lt="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",St="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",st="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",le={},Oe={"user-check":r,"user-check-02":s,"user-plus":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:p,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":b,"link-03":h,"search-lg":f.q,"clipboard-plus":v,route:M}},25624:(Z,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>Sn,GN:()=>ie,J4:()=>tt,MU:()=>$,Nw:()=>wt,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>F,eC:()=>lt,iI:()=>q,lv:()=>N,mR:()=>yt,nt:()=>z,od:()=>w,t7:()=>it,yQ:()=>Ee,zj:()=>pe});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(69364),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,h=(pt,Yt,qt)=>Yt in pt?A(pt,Yt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):pt[Yt]=qt,f=(pt,Yt)=>{for(var qt in Yt||(Yt={}))p.call(Yt,qt)&&h(pt,qt,Yt[qt]);if(O)for(var qt of O(Yt))b.call(Yt,qt)&&h(pt,qt,Yt[qt]);return pt},v=(pt,Yt)=>m(pt,d(Yt));const M=pt=>{var Yt;return(Yt=pt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Pt,$t;return($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)!=null?$t:[]}).find(qt=>{var Pt;return(Pt=qt.code)==null?void 0:Pt.startsWith("ui-toolkit/")}))==null?void 0:Yt.code},x=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.V7);return qt?.valueCode||"off"},z=(pt,Yt,qt)=>{const Pt=(0,u.A)(qt);return pt&&Yt&&qt?Pt.replace("<p>",`<span>${Yt} `).replace("</p>","</span>").trim():Pt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=pt=>{const Yt=pt?.find(qt=>qt.url===y.Vp);return Yt?.valueInteger},S=pt=>{const Yt=pt?.find(qt=>qt.url===y.Z_);return Yt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(pt,Yt)=>{const qt=pt?.find(Pt=>Pt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Yt&&E[Yt]||C},L=pt=>{const Yt=pt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Yt?.valueString},P=pt=>{const Yt=pt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Yt?.length?Yt.join(","):void 0},D=pt=>pt.split(",").map(Pt=>Pt.trim()).map(Pt=>y.JL[Pt]||Pt).filter((Pt,$t,Zt)=>Zt.indexOf(Pt)===$t).join(", "),w=(pt,Yt,qt)=>{const Pt=D(pt),$t=Pt.lastIndexOf(","),Zt=$t!==-1?`${Pt.substring(0,$t)} or${Pt.substring($t+1)}`:Pt,Mn=[Yt&&`max. ${(Yt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return Mn.length>0?`${Zt} (${Mn.join(", ")})`:Zt},N=pt=>{const Yt=pt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Yt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},F=(pt,Yt)=>{var qt,Pt,$t;const Zt=Yt?.find(Mn=>Mn.url.includes(pt));return($t=(Pt=(qt=Zt?.valueInteger)!=null?qt:Zt?.valueDecimal)!=null?Pt:Zt?.valueString)!=null?$t:Zt?.valueDate},q=pt=>{if(!!pt){if(/^\d{4}-\d{2}-\d{2}$/.test(pt))return pt;try{const Yt=(0,o.evaluate)({},pt);if(Array.isArray(Yt)&&Yt.length>0){const qt=Yt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Pt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Zt=String(qt.getDate()).padStart(2,"0");return`${Pt}-${$t}-${Zt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(pt,Yt)=>{var qt,Pt;const $t=Yt?.find(Mn=>Mn.url===pt);if(!$t)return;const Zt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Zt||q((Pt=$t.valueExpression)==null?void 0:Pt.expression)},k=(pt,Yt)=>{if(!(!pt||pt.length===0))for(const qt of pt){const Pt=F(Yt,qt.extension);if(Pt!==void 0)return Pt;if(qt.item&&qt.item.length>0){const $t=k(qt.item,Yt);if($t!==void 0)return $t}}},U=(pt,Yt)=>{try{const qt=String(pt??Yt);let Pt;if(qt.includes("/"))Pt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Pt=(0,t.A)($t)}return(0,r.A)(Pt)}catch(qt){return console.error("Date parsing error:",qt,pt),null}},$=(pt,Yt)=>{var qt;for(const Pt of pt){if(Pt.linkId===Yt)return Pt;if((qt=Pt.item)!=null&&qt.length){const $t=$(Pt.item,Yt);if($t!==void 0)return $t}}},K=(pt,Yt)=>{var qt;const Pt=[];for(const $t of pt)if($t.linkId===Yt&&Pt.push($t),(qt=$t.item)!=null&&qt.length){const Zt=K($t.item,Yt);Pt.push(...Zt)}return Pt},G=(pt,Yt,qt=0)=>K(pt,Yt)[qt];function oe(pt){return pt!=null}const se=(pt,Yt)=>{var qt,Pt,$t;if("answerString"in pt&&oe(pt.answerString)){if(pt.operator==="=")return Yt?.valueString===pt.answerString;if(pt.operator==="!=")return Yt?.valueString!==pt.answerString}if("answerBoolean"in pt&&oe(pt.answerBoolean)){if(pt.operator==="=")return Yt?.valueBoolean===pt.answerBoolean;if(pt.operator==="!=")return Yt?.valueBoolean!==pt.answerBoolean}if("answerInteger"in pt&&oe(pt.answerInteger)||"answerDecimal"in pt&&oe(pt.answerDecimal)){const Zt=Number(Yt?.valueInteger||Yt?.valueDecimal),Mn=Number(pt.answerInteger||pt.answerDecimal);if(pt.operator==="=")return Zt===Mn;if(pt.operator==="!=")return Zt!==Mn;if(pt.operator===">")return Zt>Mn;if(pt.operator==="<")return Zt<Mn;if(pt.operator===">=")return Zt>=Mn;if(pt.operator==="<=")return Zt<=Mn}if("answerQuantity"in pt&&oe(pt.answerQuantity)){const Zt=Yt?.valueQuantity,Mn=pt.answerQuantity;if(Zt?.unit!==Mn?.unit)return!1;if(pt.operator==="=")return Zt.value===Mn.value;if(pt.operator==="!=")return Zt.value!==Mn.value;if(pt.operator===">")return Zt.value>Mn.value;if(pt.operator==="<")return Zt.value<Mn.value;if(pt.operator===">=")return Zt.value>=Mn.value;if(pt.operator==="<=")return Zt.value<=Mn.value}if("answerCoding"in pt&&oe(pt.answerCoding)){const Zt=Yt?.valueCoding,Mn=pt.answerCoding;if(pt.operator==="=")return Zt?.code===Mn.code;if(pt.operator==="!=")return Zt?.code!==Mn.code}if("answerReference"in pt&&oe(pt.answerReference)){const Zt=Yt?.valueReference,Mn=pt.answerReference;if(pt.operator==="=")return Zt?.reference===Mn.reference;if(pt.operator==="!=")return Zt?.reference!==Mn.reference}if("answerDate"in pt&&oe(pt.answerDate)||"answerDateTime"in pt&&oe(pt.answerDateTime)||"answerTime"in pt&&oe(pt.answerTime)){const Zt=new Date(($t=(Pt=(qt=Yt?.valueDate)!=null?qt:Yt?.valueDateTime)!=null?Pt:Yt?.valueTime)!=null?$t:""),Mn=new Date(pt.answerDate||pt.answerDateTime||pt.answerTime||"");if(pt.operator==="=")return Zt.getTime()===Mn.getTime();if(pt.operator==="!=")return Zt.getTime()!==Mn.getTime();if(pt.operator===">")return Zt.getTime()>Mn.getTime();if(pt.operator==="<")return Zt.getTime()<Mn.getTime();if(pt.operator===">=")return Zt.getTime()>=Mn.getTime();if(pt.operator==="<=")return Zt.getTime()<=Mn.getTime()}return pt.operator==="exists"?Yt!=null===pt.answerBoolean:!0},ie=(pt,Yt,qt)=>{const Pt=$t=>{const Zt=K(qt,$t.question);return Zt.length===0||Zt.every(Mn=>!Mn.answer||Mn.answer.length===0)?se($t,void 0):Zt.some(Mn=>{var zr;return(zr=Mn.answer)==null?void 0:zr.some(jr=>se($t,jr&&Object.keys(jr).length>0?jr:void 0))})};return pt&&pt?.length>0?Yt==="any"?pt?.some($t=>Pt($t)):pt?.every($t=>Pt($t)):!0},me=(pt,Yt,qt,Pt,$t)=>{if(!pt||pt.length===0)return!0;const Zt=Mn=>{var zr;let jr;if(Pt&&typeof $t=="number"){const Pn=qt.filter(rn=>rn.linkId===Pt)[$t];if(Pn?.item){const rn=Pn.item.find(vt=>vt.linkId===Mn.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(vt=>se(Mn,vt&&Object.keys(vt).length>0?vt:void 0))}}if(!jr){const Rn=K(qt,Mn.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(vt=>se(Mn,vt&&Object.keys(vt).length>0?vt:void 0))});jr=void 0}return se(Mn,jr)};return Yt==="any"?pt.some(Mn=>Zt(Mn)):pt.every(Mn=>Zt(Mn))},ye=(pt,Yt)=>{var qt;if(!!((qt=pt?.valueExpression)!=null&&qt.expression))try{const Pt=evaluate(Yt,pt.valueExpression.expression);return Array.isArray(Pt)?Pt.some($t=>Boolean($t)):Boolean(Pt)}catch{return}},Te=(pt,Yt)=>{var qt;const Pt=(qt=pt.extension)==null?void 0:qt.find(Zt=>Zt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=ye(Pt,Yt);return v(f({},pt),{readOnly:$t??pt.readOnly})},ve=(pt,Yt,qt)=>{const{required:Pt,maxLength:$t,type:Zt,extension:Mn,enableWhen:zr,enableBehavior:jr,repeats:Rn,answerOption:Pn}=pt;if(!ie(zr,jr,Yt)||pt.type==="group"||pt.type==="display")return"";if(Rn)return ne(pt,Yt,qt);const rn=fe(pt,Yt);return rn&&ue(rn,pt)?te(pt,Yt,qt,rn):pe(Mn,Zt,Pt,$t,qt,Pn)},ne=(pt,Yt,qt)=>{const{required:Pt}=pt;if(Pt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Zt=0;Zt<qt.length;Zt++){const Mn=qt[Zt];if(Mn&&Object.keys(Mn).length>0&&Object.values(Mn).some(jr=>jr!=null&&jr!==""&&(Array.isArray(jr)?jr.length>0:!0))){$t=!0;const jr=pe(pt.extension,pt.type,!0,pt.maxLength,[Mn],pt.answerOption);if(jr)return`Item ${Zt+1}: ${jr}`;if(pt.item&&pt.item.length>0){const Rn=ae(pt.item,Yt,pt.linkId,Zt);if(Rn)return`Item ${Zt+1}: ${Rn}`}}else return`Item ${Zt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(qt&&qt.length>0)for(let $t=0;$t<qt.length;$t++){const Zt=qt[$t];if(Zt&&Object.keys(Zt).length>0&&Object.values(Zt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=pe(pt.extension,pt.type,!1,pt.maxLength,[Zt],pt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(pt.item&&pt.item.length>0){const jr=ae(pt.item,Yt,pt.linkId,$t);if(jr)return`Item ${$t+1}: ${jr}`}}}return""},ae=(pt,Yt,qt,Pt)=>{var $t,Zt;for(const Mn of pt){if(!me(Mn.enableWhen,Mn.enableBehavior,Yt,qt,Pt))continue;const zr=$(Yt,qt),jr=($t=zr?.item)==null?void 0:$t.find(Pn=>Pn.linkId===Mn.linkId),Rn=(Zt=jr?.answer)!=null&&Zt[Pt]?[jr.answer[Pt]]:void 0;if(Mn.required){if(!Rn||!Rn[0]||!he(Rn[0]))return`${Mn.text||Mn.linkId} is required`;const Pn=pe(Mn.extension,Mn.type,!0,Mn.maxLength,Rn,Mn.answerOption);if(Pn)return`${Mn.text||Mn.linkId}: ${Pn}`}else if(Rn&&Rn[0]&&he(Rn[0])){const Pn=pe(Mn.extension,Mn.type,!1,Mn.maxLength,Rn,Mn.answerOption);if(Pn)return`${Mn.text||Mn.linkId}: ${Pn}`}if(Mn.item&&Mn.item.length>0){const Pn=ae(Mn.item,Yt,Mn.linkId,Pt);if(Pn)return Pn}}return""},he=pt=>!pt||Object.keys(pt).length===0?!1:Object.values(pt).some(Yt=>Yt!=null&&Yt!==""&&(Array.isArray(Yt)?Yt.length>0:!0)),pe=(pt,Yt,qt,Pt,$t,Zt)=>{var Mn,zr,jr,Rn,Pn;let rn="";const vt=!!pt?.find(Cn=>{var jn,wr;return Cn.url===y.gD&&((wr=(jn=Cn.valueCodeableConcept)==null?void 0:jn.coding)==null?void 0:wr.some(Wr=>Wr.system===y.n4&&Wr.code===y.GI))}),Tt=$t?.[0],Kt={choice:((Mn=Tt?.valueCoding)==null?void 0:Mn.code)||(Tt?.valueString&&Zt?.some(Cn=>Cn.valueString===Tt.valueString)?Tt.valueString:null),"open-choice":((zr=Tt?.valueCoding)==null?void 0:zr.code)||Tt?.valueString,boolean:Tt?.valueBoolean,string:Tt?.valueString,text:Tt?.valueString,url:Tt?.valueUri,integer:Tt?.valueInteger,decimal:Tt?.valueDecimal,dateTime:Tt?.valueDateTime,date:Tt?.valueDate,time:Tt?.valueTime,quantity:(jr=Tt?.valueQuantity)==null?void 0:jr.value,reference:(Rn=Tt?.valueReference)==null?void 0:Rn.display,attachment:(Pn=Tt?.valueAttachment)==null?void 0:Pn.title};if(!(Yt in Kt))return"";const un=Kt[Yt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Yt==="boolean"&&un!==!0&&vt)?"This field is required":"",maxLength:()=>Pt&&un!==null&&un!==void 0&&un.toString().length>Pt?`Input should not exceed ${Pt} characters`:"",minLength:()=>{const Cn=F("minLength",pt);return Cn&&un!==null&&un!==void 0&&un.toString().length<Number(Cn)?`Input should be at least ${Cn} characters`:""},urlRegex:()=>{const Cn=new RegExp(y.rx),jn=F("regexError",pt),wr=jn??"Please enter a valid url starting from http:// and https://";return Cn&&Yt==="url"&&un&&!Cn.test(un)?String(wr):""},regex:()=>{const Cn=F("regex",pt);if(!Cn||typeof un!="string")return"";const jn=new RegExp(Cn),wr=F("regexError",pt),Wr=wr??"Please enter a valid input";return jn&&un&&!jn.test(un)?String(Wr):""},dateTime:()=>{if(Yt==="dateTime"&&un){const Cn=un?.toString(),jn=new Date(Cn);return isNaN(jn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Yt!=="date"||!un)return"";const Cn=un.replace(/\D/g,"");return Cn.length>0&&Cn.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var Cn;if(Yt==="date"){const wr=I(y.dU,pt),Wr=U(wr??"01/01/1900","01/01/1900"),_r=U(un,"");if(!Wr||!_r)return"";if((0,s.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Ck))==null?void 0:Cn.valueString;return f0??`Date should not be before ${wr??"01/01/1900"}`}return""}const jn=F("minValue",pt);return jn!=null&&un!==null&&un!==void 0&&un<jn?`Input should not be less than ${jn}`:""},maxValue:()=>{var Cn;if(Yt==="date"){const wr=I(y.bK,pt),Wr=U(wr??"01/01/2100","01/01/2100"),_r=U(un,"");if(!Wr||!_r)return"";if((0,i.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Cx))==null?void 0:Cn.valueString;return f0??`Date should not be after ${wr??"01/01/2100"}`}return""}const jn=F("maxValue",pt);return jn!=null&&un!==null&&un!==void 0&&un>jn?`Input should not exceed ${jn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},fe=(pt,Yt)=>{for(const qt of Yt)if(qt.item){if(qt.item.find(Zt=>Zt.linkId===pt.linkId))return qt;const $t=fe(pt,qt.item);if($t)return $t}return null},ue=(pt,Yt)=>{if(pt.answer&&pt.answer.length>1)return!0;if(pt.item){const qt=pt.item.find(Pt=>Pt.linkId===Yt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},te=(pt,Yt,qt,Pt)=>{var $t,Zt;const{required:Mn}=pt,zr=($t=Pt.item)==null?void 0:$t.find(Pn=>Pn.linkId===pt.linkId),jr=zr?.answer||[],Rn=((Zt=Pt.answer)==null?void 0:Zt.length)||1;for(let Pn=0;Pn<Rn;Pn++){const rn=jr[Pn];if(Mn){if(!rn||!he(rn))return`Item ${Pn+1}: ${pt.text||pt.linkId} is required`;const vt=pe(pt.extension,pt.type,!0,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Pn+1}: ${vt}`}else if(rn&&he(rn)){const vt=pe(pt.extension,pt.type,!1,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Pn+1}: ${vt}`}}return""},J=(pt,Yt)=>{for(const qt of pt){if(qt?.linkId===Yt)return qt;if(qt?.item&&qt.item.length>0){const Pt=J(qt.item,Yt);if(Pt)return Pt}}},ge=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===FOOTER_CODE))}))},ze=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===HEADER_CODE))}))},Se=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===y.gD&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===y.n4&&Zt.code===y._l))}))},Ie=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Zt=>Zt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Zt.code===CHECKBOX_CODE))}))},_e=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.fe);return qt?.valueInteger},it=pt=>{var Yt;const qt=(Yt=pt.extension)==null?void 0:Yt.find(Pt=>Pt.url===y.zO);return qt?.valueInteger},bt=pt=>{var Yt;const qt=(Yt=pt?.extension)==null?void 0:Yt.find(Pt=>Pt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},Ot=(pt,Yt,qt,Pt,$t,Zt)=>{const Mn=jr=>Yt.filter(Rn=>Rn.linkId===jr),zr=new Set;return pt.map(jr=>{if(zr.has(jr.linkId)||ge(jr))return null;const Pn=Mn(jr.linkId),rn=jr.type==="group"&&jr.repeats;if(zr.add(jr.linkId),rn){const vt=[];if(Pn.forEach((Tt,Kt)=>{const un={linkId:jr.linkId,text:jr.text};let on;if(qt===jr.linkId&&typeof Zt=="number"&&Zt===Kt&&$t&&$t.length>0){const Cn=Tt?.item||[];on=[...Cn],$t.forEach(jn=>{const wr=on.findIndex(Wr=>Wr.linkId===jn.linkId);wr>=0?on[wr]=v(f({},Cn[wr]),{answer:jn.answer}):on.push(jn)})}else jr.item&&(on=Ot(jr.item,Tt?.item||[],qt,Pt,$t,Kt));qt===jr.linkId&&typeof Zt=="number"&&Zt===Kt&&Pt?un.answer=Pt:un.answer=Tt.answer||[{}],on&&on.length>0?un.item=on:Tt.item&&(un.item=Tt.item),vt.push(un)}),qt===jr.linkId&&typeof Zt=="number"&&Zt>=Pn.length)for(let Tt=Pn.length;Tt<=Zt;Tt++){const Kt={linkId:jr.linkId,text:jr.text,answer:Tt===Zt&&Pt?Pt:[{}]};Tt===Zt&&$t&&$t.length>0?Kt.item=$t:jr.item&&(Kt.item=Ot(jr.item,[],void 0,void 0,void 0,void 0)),vt.push(Kt)}return vt}else if(jr.repeats&&typeof Zt=="number"&&qt===jr.linkId){const vt=Pn[0]||{linkId:jr.linkId,text:jr.text,answer:[]},Tt={linkId:jr.linkId,text:jr.text,answer:[...vt.answer||[]]};if(Pt&&Pt.length>0){for(;Tt.answer.length<=Zt;)Tt.answer.push({});Tt.answer[Zt]=Pt[0]}return Tt}else{const vt=Pn[0],Tt=jr.item?Ot(jr.item,vt?.item||[],qt,Pt,$t,Zt):void 0,Kt=Tt&&Tt.length>0,un={linkId:jr.linkId,text:jr.text};return qt&&jr.linkId===qt&&typeof Zt!="number"?(Pt||!Pt&&!$t?un.answer=Pt:vt?.answer&&(un.answer=vt.answer),$t?un.item=$t:Kt&&(un.item=Tt)):(vt?.answer?un.answer=vt.answer:un.answer=[{}],Kt&&(un.item=Tt)),un}}).filter(Boolean).flat()},Ft=(pt,Yt)=>{for(const qt of pt)if(qt.linkId===Yt||qt.item&&Ft(qt.item,Yt))return qt.linkId;return null},Qt=(pt,Yt,qt,Pt)=>{var $t;const Zt=($t=pt?.item)!=null?$t:Pt;return!Zt||Zt.length===0?!0:Zt.every(Mn=>{var zr;const jr=K(Yt,Mn.linkId);if(jr.length===0){const Rn=(zr=$(Yt,Mn.linkId))==null?void 0:zr.answer;if(ve(Mn,Yt,Rn)&&ie(Mn.enableWhen,Mn.enableBehavior,Yt)&&qt.includes(Mn.linkId))return!1}else for(const Rn of jr)if(ve(Mn,Yt,Rn.answer)&&ie(Mn.enableWhen,Mn.enableBehavior,Yt)&&qt.includes(Mn.linkId))return!1;return Mn.item?Qt(Mn,Yt,qt):!0})},zt=(pt,Yt,qt=!0)=>{for(const Pt of pt)if(Pt.linkId===Yt&&Pt.answer&&Pt.answer.length>0||Pt.item&&Pt.item.length>0&&zt(Pt.item,Yt,qt))return!0;return!1},Ke=(pt,Yt,qt=0)=>{const Pt=pt.filter($t=>$t.linkId===Yt);if(Pt.length>qt){const $t=Pt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Zt=>Zt&&Object.keys(Zt).length>0&&Object.values(Zt).some(Mn=>Mn!=null&&Mn!==""));if($t.item&&$t.item.length>0)return zt($t.item,Yt,!1)}return zt(pt,Yt,!1)},$e=(pt,Yt)=>{if(!pt||!pt.item)return!1;const qt=Pt=>{var $t;if(ze(Pt)&&Pt.required&&ie(Pt.enableWhen,Pt.enableBehavior,Yt)){const Zt=$(Yt,Pt.linkId),Mn=pe(Pt.extension,Pt.type,Pt.required,Pt.maxLength,Zt?.answer,Pt.answerOption);if(!(($t=Zt?.answer)!=null&&$t.length)||Mn)return!0}if(Pt.item){for(const Zt of Pt.item)if(qt(Zt))return!0}return!1};for(const Pt of pt.item)if(qt(Pt))return!0;return!1},Et=pt=>{var Yt,qt,Pt;if(pt.valueString!==void 0)return pt.valueString;if(pt.valueBoolean!==void 0)return pt.valueBoolean;if(pt.valueInteger!==void 0)return pt.valueInteger;if(pt.valueDecimal!==void 0)return pt.valueDecimal;if(pt.valueDate!==void 0)return pt.valueDate;if(pt.valueDateTime!==void 0)return pt.valueDateTime;if(((Yt=pt.valueCoding)==null?void 0:Yt.code)!==void 0)return pt.valueCoding.code;if(((qt=pt.valueReference)==null?void 0:qt.reference)!==void 0)return pt.valueReference.reference;if(((Pt=pt.valueQuantity)==null?void 0:Pt.value)!==void 0)return pt.valueQuantity.value;if(pt.valueAttachment!==void 0)return pt.valueAttachment},Qe=pt=>{const Yt={linkId:pt.linkId};if(pt.answer&&pt.answer.length>0){const qt=pt.answer.map(Pt=>Et(Pt)).filter(Pt=>Pt!==void 0);qt.length>0&&(Yt.answer=qt)}if(pt.item&&pt.item.length>0){const qt=pt.item.map(Pt=>Qe(Pt)).filter(Pt=>{const $t=Object.keys(Pt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Yt.item=qt)}return Yt},Ye=(pt,Yt,qt,Pt,$t,Zt)=>{var Mn;const zr=(Mn=Yt?.item)==null?void 0:Mn[qt[Pt]],jr=zr?.linkId;if(!jr)return!1;const Rn=K(pt,jr),Pn=K($t,jr),rn=vt=>{if(vt!=null){if(Array.isArray(vt)){const Tt=vt.filter(Kt=>Kt!=null).map(Kt=>rn(Kt)).filter(Kt=>Kt!==void 0);return Tt.length===0||Tt.length===1&&typeof Tt[0]=="object"&&Object.keys(Tt[0]).length===0?void 0:Tt}if(typeof vt=="object"){const Tt={};for(const[Kt,un]of Object.entries(vt))if(un!=null){const on=rn(un);on!==void 0&&(Tt[Kt]=on)}return Object.keys(Tt).length===0?void 0:Tt}return vt}};if(Rn.length!==Pn.length)return!1;for(let vt=0;vt<Rn.length;vt++){const Tt=Rn[vt],Kt=Pn[vt];if(!Tt||!Kt)return!1;const un=Qe(rn(Tt)),on=Qe(rn(Kt));if(!_.isEqual(un,on))return!1}return Pt!==Zt},Lt=(pt,Yt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ve(pt,Yt,qt)||null,mn=(pt,Yt)=>{const qt={},Pt=$t=>{$t.forEach(Zt=>{const Mn=K(Yt,Zt.linkId);if(st(Zt,pt)||Zt.repeats)for(let zr=0;zr<Mn.length;zr++){const jr=Mn[zr];if(jr?.answer&&jr.answer.length>0){const Rn=Lt(Zt,Yt,jr.answer);Rn&&(qt[Zt.linkId]=v(f({},qt[Zt.linkId]),{[zr]:Rn}))}}else{const zr=$(Yt,Zt.linkId);if(zr?.answer&&zr.answer.length>0){const jr=Lt(Zt,Yt,zr.answer);jr&&(qt[Zt.linkId]={0:jr})}}Zt.item&&Zt.item.length>0&&Pt(Zt.item)})};return Pt(pt),qt},Sn=pt=>{if(!pt)return"";const Yt=pt.split("-");if(Yt.length===3){const[qt,Pt,$t]=Yt;return`${qt.slice(-4)}-${Pt}-${$t}`}return""},et=pt=>pt.trim().replace(/[A-Za-z]+/g,""),Rt=(pt,Yt)=>{const qt=(Pt,$t)=>{for(const Zt of Pt){if(Zt.linkId===$t)return Zt.answer;if(Zt.item&&Zt.item.length>0){const Mn=qt(Zt.item,$t);if(Mn!==void 0)return Mn}}};return qt(pt,Yt)},Ht=(pt,Yt)=>{if(!Yt||Yt.length===0)return null;const qt=pt.linkId,Pt=($t,Zt,Mn=[])=>{for(const zr of $t){const jr=[...Mn,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Zt))return jr.some(rn=>rn.repeats===!0)?zr:null;if(Pt(zr.item,Zt,jr))return zr}}return null};return Pt(Yt,qt)},Un=(pt,Yt)=>{if(!Yt||Yt.length===0)return!1;const qt=pt.linkId,Pt=($t,Zt,Mn=[])=>{for(const zr of $t){const jr=[...Mn,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Zt))return jr.some(rn=>{const vt=M(rn.extension||[]);return!!vt&&vt!==UI_TOOLKIT_FORM_CONTAINER});if(Pt(zr.item,Zt,jr))return!0}}return!1};return Pt(Yt,qt)},Mr=(pt,Yt,qt)=>{const Pt={};if(!pt)return Pt;const{linkId:$t}=Yt;if(pt[$t]){const Zt=pt[$t];Pt[$t]=Zt[qt]||""}return Yt.item&&Yt.item.length>0&&Yt.item.forEach(Zt=>{if(pt[Zt.linkId]){const Mn=pt[Zt.linkId];Pt[Zt.linkId]=Mn[qt]||""}}),Pt},gn=(pt,Yt)=>{const qt={};if(!pt||!pt[Yt])return qt;const Pt=pt[Yt];return qt[Yt]=Pt[0]||"",qt},In=pt=>{const Yt=pt.findIndex(Zt=>!ze(Zt)),qt=Yt>=0?[Yt]:[],Pt=new Map;let $t=null;if(pt.forEach((Zt,Mn)=>{const zr=Se(Zt);if(zr&&Zt.type==="group")Mn!==Yt&&qt.push(Mn),Pt.set(Mn,[Mn]),$t=Mn;else if($t!==null&&!zr){const jr=Pt.get($t)||[];Pt.set($t,[...jr,Mn])}}),pt.length>0&&qt.length>0){const Zt=qt[0];if(!Pt.has(Zt)){const Mn=qt.find(jr=>jr>Zt),zr=[];for(let jr=Zt;jr<(Mn??pt.length);jr++)zr.push(jr);Pt.set(Zt,zr)}}return{groupIndices:qt,itemsToRenderMap:Pt}},cr=(pt,Yt,qt,Pt)=>{let $t=[...Pt];const Zt=(Mn,zr)=>{Mn.forEach(jr=>{if((!jr?.enableWhen||ie(jr?.enableWhen,jr.enableBehavior,zr))&&jr.initial&&!zt(zr,jr.linkId))if(jr.repeats){const Rn=zr.filter(Pn=>Pn.linkId===jr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Ke(zr,jr.linkId,rn)||($t=Ot(qt,$t,jr.linkId,jr.initial,void 0,rn))}):$t=Ot(qt,$t,jr.linkId,jr.initial)}else $t=Ot(qt,$t,jr.linkId,jr.initial);jr.item&&Zt(jr.item,zr)})};return Zt(pt,Yt),$t},Dn=(pt,Yt,qt)=>{if(!pt)return[];const Pt=[],$t=Zt=>{Zt.required===Yt&&ie(Zt.enableWhen,Zt.enableBehavior,qt)&&!ze(Zt)&&Zt.type!=="display"&&Pt.push(Zt),Zt.item&&Zt.item.length>0&&Zt.item.forEach($t)};return pt.forEach($t),Pt},$r=(pt,Yt)=>pt.every(qt=>{var Pt;const $t=K(Yt,qt.linkId);if($t.length>0)return $t.every(Zt=>!ve(qt,Yt,Zt.answer));{const Zt=(Pt=$(Yt,qt.linkId))==null?void 0:Pt.answer;return!ve(qt,Yt,Zt)}}),qr=(pt,Yt)=>{let qt=-1;for(let Pt=pt.length-1;Pt>=0;Pt--)if(pt[Pt].linkId===Yt){qt=Pt;break}return qt},wt=(pt,Yt)=>pt.filter(qt=>qt.linkId!==Yt).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:wt(qt.item,Yt)}):qt),Ve=(pt,Yt,qt=pt)=>pt.reduce((Pt,$t)=>{const Zt=J(Yt,$t.linkId);return Zt?.enableWhen&&!ie(Zt.enableWhen,Zt.enableBehavior,qt)||($t.item&&$t.item.length>0?Pt.push(v(f({},$t),{item:Ve($t.item,Yt,qt)})):Pt.push($t)),Pt},[]),ot=(pt,Yt,qt=[])=>{const Pt=[],$t=Zt=>{Zt.forEach(Mn=>{Pt.push(Mn.linkId),Mn.item&&Mn.item.length>0&&$t(Mn.item)})};for(let Zt=0;Zt<pt.length;Zt++){const Mn=pt[Zt];if(Mn.linkId===Yt){const zr=pt.slice(0,Zt+1),jr=pt.slice(Zt+1),{kept:Rn,removed:Pn}=jr.reduce((rn,vt)=>{const Tt=J(qt,vt.linkId);return!Tt||Se(Tt)||ze(Tt)&&ie(Tt.enableWhen,Tt.enableBehavior,zr)?rn.kept.push(vt):rn.removed.push(vt),rn},{kept:[],removed:[]});return $t(Pn),{trimmedData:[...zr,...Rn],trimmedLinkIds:Pt,found:!0}}if(Mn.item&&Mn.item.length>0){const zr=ot(Mn.item,Yt,qt);if(zr.found){const jr=pt.slice(0,Zt),Rn=pt.slice(Zt+1),Pn=[...jr,v(f({},Mn),{item:zr.trimmedData})],{kept:rn,removed:vt}=Rn.reduce((Tt,Kt)=>{const un=J(qt,Kt.linkId);return!un||Se(un)||ze(un)&&ie(un.enableWhen,un.enableBehavior,Pn)?Tt.kept.push(Kt):Tt.removed.push(Kt),Tt},{kept:[],removed:[]});return $t(vt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Pt],found:!0}}}}return{trimmedData:pt,trimmedLinkIds:[],found:!1}},Je=(pt,Yt)=>pt.filter(qt=>!Yt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:Je(qt.item,Yt)}):qt),tt=pt=>{var Yt;if(!pt)return"empty";const qt=y.Z$.find(({patterns:Pt})=>Pt.some($t=>pt.includes($t)));return(Yt=qt?.type)!=null?Yt:"empty"},rt=(pt,Yt)=>{const{groupIndices:qt}=In(pt),Pt=pt.findIndex($t=>$t.linkId===Yt);return Pt!==-1?qt.indexOf(Pt):-1},lt=pt=>{if(!pt)return{restriction:null,warning:null};const Yt=qt=>{const Pt=pt.find(Zt=>Zt.url===qt&&Zt.valueString);if(!Pt?.valueString)return null;const $t=Pt.valueString.replace(/\\n/g,`
870
870
  `).split(`
871
871
  `).map(Zt=>Zt.trim()).filter(Boolean).map(Zt=>Zt.startsWith("*")?Zt.substring(1).trim():Zt);return $t.length===0?null:$t.length===1?{isList:!1,items:$t}:{isList:!0,items:$t}};return{restriction:Yt("restriction"),warning:Yt("warning")}},St=(pt,Yt)=>{var qt;switch(Yt.type){case"boolean-to-string":return typeof pt=="boolean"?pt?Yt.trueValue:Yt.falseValue:pt;case"map":return Yt.mapping&&pt in Yt.mapping?Yt.mapping[pt]:pt;case"date-format":return pt;case"number-format":if(typeof pt=="number"){let Pt=pt.toFixed((qt=Yt.decimals)!=null?qt:0);return Yt.prefix&&(Pt=Yt.prefix+Pt),Yt.suffix&&(Pt=Pt+Yt.suffix),Pt}return pt;case"passthrough":default:return pt}},st=(pt,Yt)=>{const qt=pt.linkId,Pt=(Zt,Mn,zr=[])=>{for(const jr of Zt){const Rn=[...zr,jr];if(jr.item){if(jr.item.some(vt=>vt.linkId===Mn))return Rn.filter(vt=>vt.repeats===!0);const rn=Pt(jr.item,Mn,Rn);if(rn.length>0)return rn}}return[]},$t=Pt(Yt,qt);return $t.length>0?$t[$t.length-1]:null},le=(pt,Yt)=>{if(!pt?.item)return[];const qt=[];for(const Pt of pt.item){if(Pt.type!=="group")continue;ie(Pt.enableWhen,Pt.enableBehavior,Yt||[])&&Pt.linkId&&qt.push(Pt.linkId)}return qt},Oe=(pt,Yt)=>{const qt=le(pt,Yt||void 0);return qt[qt.length-1]},We=({questionnaire:pt,extensionUrl:Yt,errorCode:qt})=>{if(!qt||!pt?.item)return;const Pt=pt.item.find($t=>{var Zt;return(Zt=$t.extension)==null?void 0:Zt.some(Mn=>Mn.url===Yt&&Mn.valueString===qt)});return Pt?.linkId},Ee=(pt,Yt)=>{var qt;const Pt=(qt=pt.extension)==null?void 0:qt.find(Zt=>Zt.url===y.rb);if(!Pt?.valueString)return;const $t=Pt.valueString;return J(Yt,$t)},yt=pt=>{var Yt;return!!((Yt=pt.extension)!=null&&Yt.find(qt=>qt.url===y.rb))},Xt=(pt,Yt)=>pt.filter(qt=>qt.linkId!==Yt).map(qt=>qt.item&&qt.item.length>0?v(f({},qt),{item:Xt(qt.item,Yt)}):qt),vn=pt=>{const Yt=F(ANALYTICS_FORM_NAME_EXTENSION_URL,pt.extension);return Yt??k(pt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},Vn=pt=>F(ANALYTICS_EVENT_NAME_EXTENSION_URL,pt.extension),gr=pt=>F(ANALYTICS_PAGE_NAME_EXTENSION_URL,pt.extension),Bt=pt=>F(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,pt.extension),we=pt=>F(ANALYTICS_OPTION_NAME_EXTENSION_URL,pt),Ze=(pt,Yt)=>{var qt,Pt,$t;if(!pt.answerOption)return;const Zt=$(Yt,pt.linkId),Mn=($t=(Pt=(qt=Zt?.answer)==null?void 0:qt[0])==null?void 0:Pt.valueCoding)==null?void 0:$t.code;if(!Mn)return;const zr=pt.answerOption.find(jr=>{var Rn;return((Rn=jr.valueCoding)==null?void 0:Rn.code)===Mn});if(!!zr)return we(zr.extension)},At=(pt,Yt)=>{const qt={},Pt=$t=>{if(!!$t)for(const Zt of $t){const Mn=Bt(Zt);if(Mn){let zr;switch(Zt.type){case"choice":zr=Ze(Zt,Yt);break;default:break}zr&&(qt[Mn]=zr)}Zt.item&&Zt.item.length>0&&Pt(Zt.item)}};return Pt(pt.item),qt},en=pt=>!!(pt.initial&&pt.initial.length>0),nn=(pt,Yt,qt)=>{if(!pt)return[];const Pt=[],$t=Zt=>{Zt.forEach(Mn=>{if(qt&&qt.includes(Mn.linkId))return;const zr=ze(Mn),jr=Yt.includes(Mn.linkId);(jr||zr&&Mn.required)&&Pt.push(Mn),jr&&Mn.item&&Mn.item.length>0&&$t(Mn.item)})};return $t(pt),Pt},fn=(pt,Yt,qt,Pt,$t,Zt)=>{var Mn;if(qt<0||!Pt?.item)return!0;const zr=$t.current[qt],jr=qt+1,Rn=$t.current[jr],Pn=qt===0?0:zr,rn=Rn??Pt.item.length,vt=[];for(let Cn=Pn;Cn<rn;Cn++){const jn=(Mn=Pt?.item)==null?void 0:Mn[Cn];if(jn){if(Zt&&Zt.includes(jn.linkId))continue;const wr=ze(jn);(Yt.includes(jn.linkId)||wr&&jn.required)&&vt.push(jn),jn.item&&jn.item.length>0&&vt.push(...nn(jn.item,Yt,Zt))}}const Tt=vt.filter(Cn=>Cn.required===!0),Kt=vt.filter(Cn=>Cn.required!==!0),un=$r(Tt,pt),on=Kt?.every(Cn=>{var jn;const wr=(jn=$(pt,Cn.linkId))==null?void 0:jn.answer;return wr?!ve(Cn,pt,wr):!0});return!Tt?.length||un&&on}},28058:(Z,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(36087),s=e(8322),i=e(69364),o=e(25624);const a=({item:er})=>{const Qr=er.text||"",Yr=er.extension||[],Li=_o=>{var Po;return(Po=Yr.find(So=>So.url===_o))==null?void 0:Po.valueString},io=Li(i.$7),Mo=Li(i.pc)||"default";return(0,n.jsx)(r.AlertFloating,{title:Qr,description:io??"",color:Mo})};var g=e(7630),c=e(16212),u=Object.defineProperty,y=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,d=(er,Qr,Yr)=>Qr in er?u(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,O=(er,Qr)=>{for(var Yr in Qr||(Qr={}))A.call(Qr,Yr)&&d(er,Yr,Qr[Yr]);if(y)for(var Yr of y(Qr))m.call(Qr,Yr)&&d(er,Yr,Qr[Yr]);return er};const p=({item:er})=>{const[Qr,Yr]=(0,t.useState)(!1),Li=er.extension||[],io=Ln=>{var lr;return(lr=Li.find(hn=>hn.url===Ln))==null?void 0:lr.valueString},Mo=io(i.PS)||er.text||"",_o=io(i.Iz)||"button",Po=io(i.VF),So=io(i.PV),Wo=io(i.vf),eo=Wo?i.JP[Wo]:void 0,fa=io(i.D_)||"",Sr=io(i.$e),ar=io(i.GQ),Tr=io(i.qT)||"gray",Pe=io(i.hZ),Ce=io(i.wG),Fe=io(i.q3),gt=ar?i.JP[ar]:void 0,Gt=()=>Yr(!0),tn=()=>{switch(_o){case"icon-button":return(0,n.jsxs)("button",{onClick:Gt,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":Mo||fa||void 0,children:[eo&&(0,n.jsx)(eo,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),Mo&&(0,n.jsx)("span",{className:"text-sm",children:Mo})]});default:return(0,n.jsx)(r.Button,{color:Po??"secondary",size:So??"md",iconLeading:eo,onClick:Gt,"aria-label":Mo,children:Mo})}};return(0,n.jsxs)(n.Fragment,{children:[tn(),(0,n.jsx)(r.Modal,O(O(O({id:`modal-${er.linkId}`,isOpen:Qr,onOpenChange:Yr,title:{content:fa},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:c.Wp.sanitizeHtml(Sr)}}):void 0},closeButton:{onCloseClick:()=>Yr(!1)}},gt?{featuredIcon:{icon:gt,color:Tr,size:"lg",className:"bg-white"}}:{}),Pe?{primaryButton:{children:Pe,onClick:()=>{var Ln,lr;Ce==="open-zendesk"&&((lr=(Ln=globalThis.zE)==null?void 0:Ln.activate)==null||lr.call(Ln,{hideOnClose:!0})),Yr(!1)}}}:{}),Fe?{secondaryButton:{children:Fe,onClick:()=>Yr(!1)}}:{}))]})};var b=e(18522);const h=({item:er})=>{var Qr,Yr,Li,io,Mo,_o,Po,So,Wo,eo;const{hasExternalError:fa}=(0,b.c)(),Sr=er.text||"",ar=(Yr=(Qr=er.extension)==null?void 0:Qr.find(hn=>hn.url===i.ao))==null?void 0:Yr.valueString,Tr=fa&&ar?ar:Sr,Pe=(io=(Li=er.extension)==null?void 0:Li.find(hn=>hn.url===i.$7))==null?void 0:io.valueString,Ce=(_o=(Mo=er.extension)==null?void 0:Mo.find(hn=>hn.url===i.el))==null?void 0:_o.valueString,Fe=fa&&Ce?Ce:Pe,gt=(So=(Po=er.extension)==null?void 0:Po.find(hn=>hn.url===i.g4))==null?void 0:So.valueString,Gt=(eo=(Wo=er.extension)==null?void 0:Wo.find(hn=>hn.url===i.Fp))==null?void 0:eo.valueString,tn=gt?i.JP[gt]:void 0,Ln=Gt?i.JP[Gt]:void 0,lr=fa&&Ln?Ln:tn;return(0,n.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[lr&&(0,n.jsx)(r.FeaturedIcon,{icon:lr,color:fa&&Ln?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,n.jsx)("h1",{className:"text-primary max-w-[330px] text-center text-3xl font-medium md:max-w-[352px]",children:Tr}),(0,n.jsx)("p",{className:"text-md text-secondary text-center",children:Fe})]})]})};var f=e(15297),v=e(17814),M=Object.defineProperty,x=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,S=(er,Qr,Yr)=>Qr in er?M(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,E=(er,Qr)=>{for(var Yr in Qr||(Qr={}))z.call(Qr,Yr)&&S(er,Yr,Qr[Yr]);if(x)for(var Yr of x(Qr))T.call(Qr,Yr)&&S(er,Yr,Qr[Yr]);return er};const C=({item:er})=>{const[Qr,Yr]=(0,t.useState)(!1),Li=(0,v.T$)(),io=er.extension||[],Mo=Pe=>{var Ce;return(Ce=io.find(Fe=>Fe.url===Pe))==null?void 0:Ce.valueString},_o=er.text||"",Po=Mo(i.PS)||"",So=Mo(i.D_)||"",Wo=Mo(i.$e),eo=Mo(i.GQ),fa=Mo(i.qT)||"gray",Sr=Mo(i.hZ),ar=Mo(i.q3),Tr=eo?i.JP[eo]: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)(f.d,{className:"text-tertiary size-4 shrink-0"}),(0,n.jsx)("span",{className:"text-primary text-sm font-semibold",children:_o})]}),Po&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>Yr(!0),children:Po})]}),(0,n.jsx)(r.Modal,E(E(E({id:`modal-${er.linkId}`,isOpen:Qr,onOpenChange:Yr,title:{content:So},description:{content:Wo?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:c.Wp.sanitizeHtml(Wo)}}):void 0},closeButton:{onCloseClick:()=>Yr(!1)}},Tr?{featuredIcon:{icon:Tr,color:fa,size:"lg",className:"bg-white"}}:{}),Sr?{primaryButton:{children:Sr,onClick:()=>{Yr(!1),Li.navigate({id:"profile"})}}}:{}),ar?{secondaryButton:{children:ar,onClick:()=>Yr(!1)}}:{}))]})},R=({item:er,selectedAnswer:Qr,handleInputChange:Yr})=>{var Li,io,Mo;const _o=(Li=er.answerOption)!=null?Li:[],Po=(Mo=(io=Qr?.[0])==null?void 0:io.valueCoding)==null?void 0:Mo.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:_o.map(So=>{var Wo,eo,fa,Sr,ar,Tr,Pe;const Ce=(eo=(Wo=So.valueCoding)==null?void 0:Wo.code)!=null?eo:"",Fe=(Sr=(fa=So.valueCoding)==null?void 0:fa.display)!=null?Sr:"",gt=Po===Ce,Gt=(ar=So.extension)==null?void 0:ar.find(hn=>hn.url===i.g4),tn=(Tr=So.extension)==null?void 0:Tr.find(hn=>hn.url===i.rz),Ln=Gt?.valueString?i.JP[Gt.valueString]:void 0,lr=(Pe=tn?.valueString)!=null?Pe:"";return(0,n.jsx)(r.SelectableOption,{icon:Ln,title:Fe,description:lr,isSelected:gt,onSelect:()=>{Yr(er,[{valueCoding:{code:Ce,display:Fe}}])}},Ce)})})};var L=e(72866),P=e(94043),D=e(94627);const w=({text:er,isLabel:Qr,required:Yr,className:Li,id:io})=>(0,n.jsxs)("p",{id:io,className:Li??"mb-md text-md",children:[(0,n.jsx)(r.Content,{as:"span",className:(0,P.cx)(Qr&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,D.p)(er||"")}}),Yr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),N="(###) ###-####",F=(er,Qr)=>{const Yr=er.replace(/\D/g,"");let Li="",io=0;for(let Mo=0;Mo<Qr.length&&io<Yr.length;Mo++)Qr[Mo]==="#"?(Li+=Yr[io],io++):Li+=Qr[Mo];return Li},q=er=>{if(!er)return N;const Qr=er.find(Yr=>Yr.url===i.Md);return Qr?.valueString||N},I=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o})=>{var Po;const{linkId:So,text:Wo,required:eo,prefix:fa,readOnly:Sr,extension:ar}=er,Tr=q(ar),Pe=((Po=Yr?.[0])==null?void 0:Po.valueString)||"",[Ce,Fe]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Pe){const lr=F(Pe,Tr);Fe(lr)}},[Pe,Tr]);const gt=Wo?(0,o.nt)(io,fa,Wo):"",Gt=Mo?.[So]||"",tn=lr=>{const hn=F(lr,Tr);Fe(hn),Li(er,[{valueString:hn}])},Ln=()=>{Qr&&Qr(So)};return(0,n.jsxs)("div",{"data-testid":So,children:[gt&&(0,n.jsx)(w,{isLabel:!0,text:gt,required:eo||!1}),(0,n.jsx)(r.Input,{id:So,"aria-label":So,"data-testid":So,type:"tel",placeholder:"Enter phone number",value:Ce,onChange:tn,onBlur:Ln,isDisabled:Sr||_o,isRequired:eo,hint:Gt,isInvalid:!!Gt,size:"md"},So)]})},k=({item:er,questionnaireSchemaItems:Qr})=>{var Yr;const{isLoading:Li,setCurrentGroupIndex:io}=(0,b.c)(),Mo=(Yr=er.extension)==null?void 0:Yr.find(Wo=>Wo.url===i.Uf),_o=Mo?.valueString,Po=er.text||"Save & continue",So=()=>{if(_o){const Wo=(0,o.Ue)(Qr||[],_o);Wo!==-1&&io(Wo)}};return(0,n.jsx)("div",{"data-testid":er.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.Button,{className:"md:w-xxs h-10 w-full text-sm",color:"primary",isLoading:Li,onClick:So,isDisabled:er.readOnly,children:Po})})},U=({size:er=24,color:Qr="currentColor",...Yr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Qr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Yr},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"}));U.displayName="Passport";var $=e(56327);const K=({size:er=24,color:Qr="currentColor",...Yr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Qr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Yr},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"}));K.displayName="UserCircle";var G=e(14711);const oe=({size:er=24,color:Qr="currentColor",...Yr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Qr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Yr},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 se=e(31165),ie=e(14449),me=e(27163);const ye=er=>{try{const Qr=er.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!Qr)return er;const[,Yr,Li,io]=Qr;return new Date(Date.UTC(parseInt(Yr),parseInt(Li)-1,parseInt(io))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return er}},Te=er=>{try{if(er.includes("AM")||er.includes("PM"))return er;const Qr=er.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!Qr)return er;const[,Yr,Li]=Qr,io=parseInt(Yr),Mo=io>=12?"PM":"AM";return`${io%12||12}:${Li} ${Mo}`}catch{return er}},ve=(er,Qr,Yr=f.d)=>{var Li;const io=(Li=er.extension)==null?void 0:Li.find(Mo=>Mo.url===i.g4);return io?.valueString&&i.JP[io.valueString]?i.JP[io.valueString]:er.linkId&&Qr[er.linkId]?Qr[er.linkId]:Yr},ne={"appointment-review/first-name":U,"appointment-review/last-name":U,"appointment-review/dob":$.V,"appointment-review/gender":K,"appointment-review/phone":G.b,"appointment-review/email":oe,"appointment-review/vaccines":r.Vaccine,"appointment-review/appointment-date":$.V,"appointment-review/appointment-time":se.z,"appointment-review/facility-name":r.HospitalBuilding,"appointment-review/facility-phone":G.b,"appointment-review/facility-address":ie.X},ae=["appointment-review/appointment-date"],he=["appointment-review/appointment-time"],pe=["appointment-review/facility-phone"],fe=["appointment-review/facility-address"],ue=["appointment-review/phone","appointment-review/facility-phone"],te=({item:er,questionnaireSchemaItems:Qr})=>{var Yr;const{setCurrentGroupIndex:Li}=(0,b.c)(),{trackEvent:io}=(0,s.st)(),Mo=er.item||[];if(Mo.length===0)return null;const _o=(Yr=er.extension)==null?void 0:Yr.find(eo=>eo.url===i.Uf),Po=_o?.valueString,So=()=>{if(io("edit_info_clicked",{section:er.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),Po){const eo=(0,o.Ue)(Qr||[],Po);eo!==-1&&Li(eo)}},Wo=Mo.map(eo=>{let fa="";if(eo.initial&&eo.initial.length>0){const Tr=eo.initial.map(Pe=>{var Ce,Fe;let gt=((Ce=Pe.valueCoding)==null?void 0:Ce.display)||((Fe=Pe.valueReference)==null?void 0:Fe.display)||Pe.valueString||"";return gt&&typeof gt=="string"&&(ae.includes(eo.linkId)?gt=ye(gt):he.includes(eo.linkId)&&(gt=Te(gt))),gt}).filter(Boolean);Tr.length>1||eo.repeats&&Tr.length>0?fa=Tr:Tr.length===1&&(fa=Tr[0])}if(!fa||Array.isArray(fa)&&fa.length===0)return null;let Sr;pe.includes(eo.linkId)?Sr="phone":fe.includes(eo.linkId)&&(Sr="address");let ar;return ue.includes(eo.linkId)&&(ar="phone"),{Icon:ve(eo,ne),label:eo.text||eo.linkId,value:fa,linkType:Sr,displayType:ar}}).filter(Boolean);return Wo.length===0?null:(0,n.jsx)("div",{"data-testid":er.linkId,children:(0,n.jsx)(me.InfoCard,{title:er.text||"Details",infoDetails:Wo,actionButtonText:Po&&"Edit info",onActionButtonClick:Po?So:void 0})})},J=({size:er=24,color:Qr="currentColor",...Yr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Qr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Yr},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"}));J.displayName="AlertTriangle";var ge=e(18807);const ze=({item:er})=>{const{setHideFooterButton:Qr,incrementCustomErrorCount:Yr,decrementCustomErrorCount:Li}=(0,b.c)();return(0,t.useEffect)(()=>(Qr(!0),Yr(),()=>{Qr(!1),Li()}),[Qr,Yr,Li]),(0,n.jsx)("div",{"data-testid":er.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.EmptyState,{className:"mt-5xl",description:(0,n.jsx)(r.Content,{as:"span",dangerouslySetInnerHTML:{__html:(0,ge.p)(er.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(J,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},De={information:"info",warning:"warning",error:"error",fatal:"error",success:"success"},Se=({item:er})=>{var Qr,Yr,Li,io;const{incrementCustomErrorCount:Mo,decrementCustomErrorCount:_o,setHideFooterButton:Po}=(0,b.c)(),[So,Wo]=(0,t.useState)(!1),eo=(Qr=er.extension)==null?void 0:Qr.find(Ce=>Ce.url===i.gi),fa=(Li=(Yr=eo?.valueCodeableConcept)==null?void 0:Yr.coding)==null?void 0:Li.find(Ce=>Ce.system===i.tn),Sr=fa?.code||"error",ar=De[Sr]||"error";(0,t.useEffect)(()=>{if(ar==="error")return Mo(),Po(!0),Wo(!0),()=>{_o(),Po(!1)};Wo(!0)},[ar,Mo,_o,Po]);const Tr=fa?.display||"Error",Pe=(io=er.text)!=null?io:"";return So?(0,n.jsx)("div",{"data-testid":er.linkId,children:(0,n.jsx)(r.InfoBanner,{type:ar,title:Tr,description:Pe})}):null},Ie=({configKey:er,customErrorConfigurations:Qr})=>{if(!Qr)return null;const Yr=Qr[er];if(!Yr)return null;const{icon:Li,title:io,description:Mo,primaryButton:_o,secondaryButton:Po}=Yr;return(0,n.jsx)(r.EmptyState,{className:"mt-5xl",title:io,description:Mo,featuredIconProps:{icon:Li,color:"gray"},primaryButton:_o,secondaryButton:Po})},xe=10,_e=({item:er,customErrorConfigurations:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o})=>{var Po,So,Wo,eo;const{trackEvent:fa}=(0,s.st)(),{setHideFooterButton:Sr}=(0,b.c)(),{linkId:ar,text:Tr,required:Pe,answerOption:Ce,prefix:Fe,readOnly:gt}=er,Gt=er?.type==="reference",tn=(Po=Yr?.map(Tn=>{var tr,Hr;return Gt?(tr=Tn.valueReference)==null?void 0:tr.display:(Hr=Tn.valueCoding)==null?void 0:Hr.code}).filter(Tn=>Tn!==void 0))!=null?Po:[],[Ln,lr]=(0,t.useState)(tn.length),hn=Tr?(0,o.nt)(io,Fe,Tr):"",Zn=(Wo=(So=er.extension)==null?void 0:So.find(Tn=>Tn.url===i.Z_))==null?void 0:Wo.valueInteger,cn=(eo=Ce?.map(Tn=>{var tr,Hr,p0,ai;return{value:Gt?((tr=Tn.valueReference)==null?void 0:tr.display)||"":((Hr=Tn.valueCoding)==null?void 0:Hr.code)||"",label:Gt?((p0=Tn.valueReference)==null?void 0:p0.display)||"":((ai=Tn.valueCoding)==null?void 0:ai.display)||"",valueReference:Tn.valueReference}}))!=null?eo:[],Or=Mo?.[ar],Cr=cn.length>xe,Vr=Cr?cn.slice(0,xe):cn,d0=Cr?cn.slice(xe):[],Zr=d0.some(Tn=>tn?.includes(Tn?.value)),[K0,wi]=(0,t.useState)(Zr);if(!(er.answerOption&&er.answerOption.length>0))return Sr(!0),(0,n.jsx)(Ie,{configKey:er.linkId,customErrorConfigurations:Qr});const _t=cn.filter(Tn=>tn?.includes(Tn?.value)).map(Tn=>{var tr;const{restriction:Hr,warning:p0}=Gt?(0,o.eC)((tr=Tn.valueReference)==null?void 0:tr.extension):{restriction:null,warning:null};return{label:Tn.label,restriction:Hr,warning:p0}}).filter(Tn=>Tn.restriction||Tn.warning),En=(Tn,tr)=>{var Hr;fa("vaccine_type_checkbox_selected",{on_or_off:Tn?"on":"off",vaccine:tr,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let p0;if(Tn){const ai=cn.find(M0=>M0.value===tr);p0=[...(Hr=Yr?.filter(M0=>Object.keys(M0).length!==0))!=null?Hr:[],Gt?{valueReference:ai?.valueReference}:{valueCoding:{code:tr,display:ai?.label}}],lr(M0=>M0+1)}else p0=Yr?.filter(ai=>{var M0,Ni;return Gt?((M0=ai.valueReference)==null?void 0:M0.display)!==tr:((Ni=ai.valueCoding)==null?void 0:Ni.code)!==tr})||[{}],lr(ai=>ai-1);Li&&Li(er,p0)};return(0,n.jsxs)("div",{"data-testid":ar,children:[hn&&(0,n.jsx)(w,{text:hn,required:Pe||!1}),Cr&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:Vr.map((Tn,tr)=>{const Hr=tn?.includes(Tn?.value),p0=!Hr&&Zn?Ln>=Zn:!1;return(0,n.jsx)("div",{className:tr!==Vr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Tn.value,id:tr.toString(),name:Tn.label,isInvalid:!!Or,isSelected:Hr,label:Tn.label,onChange:ai=>En(ai,Tn.value),isDisabled:gt||_o||p0})},tr)})}),Cr&&!K0&&!Zr&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(r.Button,{type:"button",onClick:()=>{wi(!0),fa("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:gt||_o,children:"See all"})}),Cr&&K0&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),Cr&&K0&&(0,n.jsx)("div",{children:d0.map((Tn,tr)=>{const Hr=tn?.includes(Tn?.value),p0=!Hr&&Zn?Ln>=Zn:!1;return(0,n.jsx)("div",{className:tr!==d0.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Tn.value,id:(xe+tr).toString(),name:Tn.label,isInvalid:!!Or,isSelected:Hr,label:Tn.label,onChange:ai=>En(ai,Tn.value),isDisabled:gt||_o||p0})},xe+tr)})}),(0,n.jsx)(r.HintText,{isInvalid:!!Or,children:Or}),_t.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:_t.map((Tn,tr)=>(0,n.jsxs)("div",{children:[Tn.restriction&&(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Restriction] ${Tn.label}`,description:Tn.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:Tn.restriction.items.map((Hr,p0)=>(0,n.jsx)("li",{className:"text-sm",children:Hr},p0))}):(0,n.jsx)("p",{className:"text-sm",children:Tn.restriction.items[0]})}),Tn.warning&&(0,n.jsx)("div",{className:Tn.restriction?"mt-2":"",children:(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Warning] ${Tn.label}`,description:Tn.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:Tn.warning.items.map((Hr,p0)=>(0,n.jsx)("li",{className:"text-sm",children:Hr},p0))}):(0,n.jsx)("p",{className:"text-sm",children:Tn.warning.items[0]})})})]},tr))})]})};var it=e(76323),bt=e(56192),Ot=e(66267),Ft=Object.defineProperty,Qt=Object.defineProperties,zt=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertySymbols,$e=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable,Qe=(er,Qr,Yr)=>Qr in er?Ft(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,Ye=(er,Qr)=>{for(var Yr in Qr||(Qr={}))$e.call(Qr,Yr)&&Qe(er,Yr,Qr[Yr]);if(Ke)for(var Yr of Ke(Qr))Et.call(Qr,Yr)&&Qe(er,Yr,Qr[Yr]);return er},Lt=(er,Qr)=>Qt(er,zt(Qr)),mn=(er,Qr,Yr)=>new Promise((Li,io)=>{var Mo=So=>{try{Po(Yr.next(So))}catch(Wo){io(Wo)}},_o=So=>{try{Po(Yr.throw(So))}catch(Wo){io(Wo)}},Po=So=>So.done?Li(So.value):Promise.resolve(So.value).then(Mo,_o);Po((Yr=Yr.apply(er,Qr)).next())});const Sn=({item:er,handleInputChange:Qr,onCompleteHandler:Yr,errors:Li})=>{const{i18n:{t:io},loading:Mo}=(0,Ot.E_)({keys:["shared-translations"]}),{trackEvent:_o}=(0,s.st)(),{linkId:Po,required:So,readOnly:Wo}=er,eo=Li?.[Po]||"",[fa,Sr]=(0,t.useState)(it.LocationType.CURRENT_LOCATION),[ar,Tr]=(0,t.useState)(""),Pe=(0,t.useRef)({}),[Ce,Fe]=(0,t.useState)([{id:it.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:it.LocationType.ADDRESS,label:"Address"},{id:it.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:gt,setIsLoading:Gt,setIsCurrentFormValid:tn,isCurrentFormValid:Ln}=(0,b.c)(),{position:lr,loading:hn,locationPermission:Zn}=(0,it.useDeviceLocationContext)(),{queryParams:cn,setQueryParams:Or}=(0,it.useSearchQueryParams)(),[Cr,{loading:Vr}]=(0,bt.qtq)({fetchPolicy:"cache-first"}),[d0,{loading:Zr}]=(0,bt.YyG)({fetchPolicy:"cache-first"}),K0=er.item?(0,o.Yo)(er.item,"postal-code"):void 0,wi=er.item?(0,o.Yo)(er.item,"state"):void 0,dt=er.item?(0,o.Yo)(er.item,"latitude"):void 0,_t=er.item?(0,o.Yo)(er.item,"longitude"):void 0,En=q0=>{if(!q0||!K0)return Tr(""),!1;const Ci=(0,o.zj)(K0.extension,K0.type,!1,K0.maxLength,[{valueString:q0}]);return Ci?(Tr(fa!==it.LocationType.ZIP_CODE?io("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Ci),!1):(Tr(""),!0)},Tn=()=>{const{latitude:q0,longitude:Ci,state:l0,zipcode:E0}=Pe.current;return!!(q0&&Ci&&l0&&E0)},tr=(0,t.useCallback)(q0=>{Pe.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},er.item&&(wi&&Qr(wi,[{valueString:""}]),dt&&Qr(dt,[{valueDecimal:void 0}]),_t&&Qr(_t,[{valueDecimal:void 0}]),K0&&Qr(K0,[{valueString:""}])),Or({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:q0,locationPermission:Zn}),tn&&tn(!1),Tr("")},[Qr,er.item,dt,Zn,_t,tn,Or,wi,K0]);(0,t.useEffect)(()=>{if(!So)return;!Tn()&&tn&&tn(!1)},[Ln,So,tn]);const Hr=q0=>{Pe.current=Ye(Ye({},Pe.current),q0),q0.addressDescription&&_o("address_selected",{value:q0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),M0(Pe.current.latitude,Pe.current.longitude,Pe.current.state,Pe.current.zipcode,Pe.current.placeId,Pe.current.addressDescription)},p0=q0=>mn(void 0,null,function*(){var Ci,l0,E0;if(Tr(""),Pe.current.zipcode=q0,tn&&tn(!1),En(q0)){_o("zip_code_entered",{value:q0,_event_metadata:{description:"A user entered a zip code."}});const pi=yield d0({variables:{location:q0}}),P0=(Ci=pi?.data)==null?void 0:Ci.geocoding,Oo=pi?.error;if(P0){const ki=P0.stateCode||"",Qo=(l0=P0.latitude)!=null?l0:void 0,xo=(E0=P0.longitude)!=null?E0:void 0;Hr({latitude:Qo,longitude:xo,state:ki,zipcode:q0,placeId:void 0,addressDescription:void 0})}else Oo&&(Hr({latitude:void 0,longitude:void 0,state:void 0,zipcode:q0,placeId:void 0,addressDescription:void 0}),Tr(io("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else M0(Pe.current.latitude,Pe.current.longitude,Pe.current.state,q0)}),ai=()=>{const q0=Pe.current.zipcode||"";!q0||fa!==it.LocationType.ZIP_CODE||En(q0)};(0,t.useEffect)(()=>{cn.locationType&&(Sr(cn.locationType),cn.locationType===it.LocationType.ZIP_CODE&&cn.zipCode&&p0(cn.zipCode),cn.locationType===it.LocationType.ADDRESS&&cn.placeId&&cn.addressDescription&&(Pe.current.addressDescription=cn.addressDescription,Pe.current.placeId=cn.placeId))},[]),(0,t.useEffect)(()=>{const q0=[it.LocationPermissionEnum.DENIED,it.LocationPermissionEnum.UNAVAILABLE,it.LocationPermissionEnum.BLOCKED].includes(cn.locationPermission),Ci=[it.LocationPermissionEnum.GRANTED,it.LocationPermissionEnum.PROMPT].includes(cn.locationPermission);if(q0&&Ce.length!==2){if(Fe([{id:it.LocationType.ADDRESS,label:"Address"},{id:it.LocationType.ZIP_CODE,label:"Zip code"}]),fa===it.LocationType.CURRENT_LOCATION||!cn.locationType||cn.locationType===""){const l0=cn.locationType===it.LocationType.ZIP_CODE?it.LocationType.ZIP_CODE:it.LocationType.ADDRESS;Sr(l0),Or(Lt(Ye({},cn),{locationType:l0})),tr(l0)}Tr("")}Ci&&Ce.length!==3&&Fe([{id:it.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:it.LocationType.ADDRESS,label:"Address"},{id:it.LocationType.ZIP_CODE,label:"Zip code"}])},[fa,Zn,Ce.length,cn,Or,tr]);const M0=(q0,Ci,l0,E0,pi,P0)=>{if(!er.item)return;wi&&Qr(wi,[{valueString:l0||""}]),dt&&Qr(dt,[{valueDecimal:q0}]),_t&&Qr(_t,[{valueDecimal:Ci}]),K0&&Qr(K0,[{valueString:E0||""}]),Or(Lt(Ye({},cn),{lat:String(q0),lng:String(Ci),location:`${q0},${Ci}`,zipCode:E0||"",placeId:pi||"",addressDescription:P0||"",locationPermission:Zn}));const Oo=Tn()&&En(E0||"");tn&&tn(Oo),Yr&&Yr(Po)};(0,t.useEffect)(()=>{const q0=()=>mn(void 0,null,function*(){var Ci;try{const l0=yield Cr({variables:{latitude:String(lr?.coords.latitude),longitude:String(lr?.coords.longitude)}}),E0=(Ci=l0?.data)==null?void 0:Ci.geocodingByLatLon,pi=E0?.stateCode||"",P0=E0?.zipCode||"";(!P0||!pi)&&Tr(io("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),Hr({latitude:lr?.coords.latitude,longitude:lr?.coords.longitude,state:pi,zipcode:P0,placeId:void 0,addressDescription:void 0})}catch{Sr(it.LocationType.ADDRESS)}});fa===it.LocationType.CURRENT_LOCATION&&lr&&q0()},[fa,lr]);const Ni=q0=>{if(!q0||!q0.latitude||!q0.longitude||!q0.zipCode||!q0.stateCode){Hr({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&&Tr(io("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}Hr({latitude:q0.latitude,longitude:q0.longitude,state:q0.stateCode,zipcode:q0.zipCode,placeId:q0.placeId,addressDescription:q0.description})};return(0,t.useEffect)(()=>{Gt(hn||Vr||Zr||Mo)},[hn,Vr,Zr,Mo,Gt]),(0,t.useEffect)(()=>{cn.locationType!==fa&&Or(Lt(Ye({},cn),{locationType:fa}))},[fa]),(0,n.jsxs)("div",{"data-testid":er.linkId,children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:So||!1}),(0,n.jsx)(r.Select,{id:Po,"aria-label":Po,"data-testid":Po,isDisabled:Wo||Vr||Zr||gt,selectedKey:fa,onSelectionChange:q0=>{var Ci;_o("location_type_input_selected",{choice:(Ci=Ce.find(({id:l0})=>l0===q0))==null?void 0:Ci.label,_event_metadata:{description:"A user changed the location type input."}}),q0!==fa&&(tr(q0),Sr(q0))},hint:eo,isInvalid:!!eo,items:Ce,placeholder:"Select an option",isRequired:So,children:q0=>(0,n.jsx)(r.Select.Item,{id:q0.id,"data-testid":q0.id,value:q0,children:q0.label},q0.id)},Po),fa===it.LocationType.CURRENT_LOCATION&&(0,n.jsx)(r.HintText,{isInvalid:!!ar,children:ar}),fa===it.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:So||!1}),(0,n.jsx)(it.AddressTypeahead,{onValueChange:Ni,isDisabled:gt,setIsLoading:Gt,initialValue:{placeId:Pe.current.placeId||"",description:Pe.current.addressDescription||""},errorText:ar||eo})]}),fa===it.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:So||!1}),(0,n.jsx)(r.Input,{isRequired:So,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${Po}-zipcode`,placeholder:"Type your response here...",value:Pe.current.zipcode||"",onChange:p0,onBlur:ai,isDisabled:Wo||Zr||gt,hint:ar||eo,isInvalid:!!ar||!!eo,autoComplete:"postal-code"},`${Po}-zipcode`)]})]})},et=er=>(0,n.jsx)(it.DeviceLocationProvider,{children:(0,n.jsx)(Sn,Ye({},er))}),Rt={[i.cX]:et,[i.G6]:te,[i.c3]:_e,[i.AA]:Se,[i.mO]:h,[i.PM]:k,[i.HH]:I,[i.Us]:ze,[i.Tl]:R,[i.G0]:p,[i.m3]:a,[i.PU]:C,[i.XP]:g.l,[i.uH]:L.v};var Ht,Un=new Uint8Array(16);function Mr(){if(!Ht&&(Ht=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ht))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Un)}const gn=/^(?:[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 In(er){return typeof er=="string"&&gn.test(er)}const cr=In;for(var Dn=[],$r=0;$r<256;++$r)Dn.push(($r+256).toString(16).substr(1));function qr(er){var Qr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Yr=(Dn[er[Qr+0]]+Dn[er[Qr+1]]+Dn[er[Qr+2]]+Dn[er[Qr+3]]+"-"+Dn[er[Qr+4]]+Dn[er[Qr+5]]+"-"+Dn[er[Qr+6]]+Dn[er[Qr+7]]+"-"+Dn[er[Qr+8]]+Dn[er[Qr+9]]+"-"+Dn[er[Qr+10]]+Dn[er[Qr+11]]+Dn[er[Qr+12]]+Dn[er[Qr+13]]+Dn[er[Qr+14]]+Dn[er[Qr+15]]).toLowerCase();if(!cr(Yr))throw TypeError("Stringified UUID is invalid");return Yr}const wt=qr;function Ve(er,Qr,Yr){er=er||{};var Li=er.random||(er.rng||Mr)();if(Li[6]=Li[6]&15|64,Li[8]=Li[8]&63|128,Qr){Yr=Yr||0;for(var io=0;io<16;++io)Qr[Yr+io]=Li[io];return Qr}return wt(Li)}const ot=Ve,Je=(er,Qr="application/octet-stream")=>{try{const Yr=window.atob(er),Li=new Uint8Array(Yr.length);for(let Mo=0;Mo<Yr.length;Mo++)Li[Mo]=Yr.charCodeAt(Mo);return new Blob([Li],{type:Qr}).size}catch{return 0}},tt=(er,Qr)=>`data:${Qr};base64,${er}`,rt=(er,Qr,Yr=512)=>{const Li=window.atob(er),io=[];for(let _o=0;_o<Li.length;_o+=Yr){const Po=Li.slice(_o,_o+Yr),So=new Array(Po.length);for(let eo=0;eo<Po.length;eo++)So[eo]=Po.charCodeAt(eo);const Wo=new Uint8Array(So);io.push(Wo)}const Mo=new Blob(io,{type:Qr});return URL.createObjectURL(Mo)},lt=er=>{const Qr=new Date().toISOString().replace(/[:.-]/g,"");return`${er.split(" ").join("-")}_${Qr}`},St=4e3,st=.8,le=(er,Qr)=>{var Yr,Li;const io=(Yr=Qr?.maxDimension)!=null?Yr:St,Mo=(Li=Qr?.quality)!=null?Li:st;return new Promise((_o,Po)=>{if(!er.type.startsWith("image/")){_o(er);return}const So=new Image,Wo=URL.createObjectURL(er);So.onload=()=>{URL.revokeObjectURL(Wo);let{width:eo,height:fa}=So;if(eo>io||fa>io){const Ce=io/Math.max(eo,fa);eo=Math.round(eo*Ce),fa=Math.round(fa*Ce)}const Sr=document.createElement("canvas");Sr.width=eo,Sr.height=fa;const ar=Sr.getContext("2d");if(!ar){_o(er);return}ar.drawImage(So,0,0,eo,fa);const Tr=er.type==="image/png"?"image/png":"image/jpeg",Pe=er.type==="image/png"?void 0:Mo;Sr.toBlob(Ce=>{if(!Ce||Ce.size>=er.size){_o(er);return}_o(new File([Ce],er.name,{type:Tr}))},Tr,Pe)},So.onerror=()=>{URL.revokeObjectURL(Wo),Po(new Error(`Failed to load image: ${er.name}`))},So.src=Wo})},Oe=50,We=(er,Qr=Oe)=>{if(er.length<=Qr)return er;const Yr=er.lastIndexOf("."),Li=Yr!==-1?er.slice(Yr):"",io=Yr!==-1?er.slice(0,Yr):er,Mo=Qr-Li.length-1,_o=Math.ceil(Mo/2),Po=Math.floor(Mo/2);return`${io.slice(0,_o)}\u2026${io.slice(-Po)}${Li}`};var Ee=Object.defineProperty,yt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,vn=Object.getOwnPropertySymbols,Vn=Object.prototype.hasOwnProperty,gr=Object.prototype.propertyIsEnumerable,Bt=(er,Qr,Yr)=>Qr in er?Ee(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,we=(er,Qr)=>{for(var Yr in Qr||(Qr={}))Vn.call(Qr,Yr)&&Bt(er,Yr,Qr[Yr]);if(vn)for(var Yr of vn(Qr))gr.call(Qr,Yr)&&Bt(er,Yr,Qr[Yr]);return er},Ze=(er,Qr)=>yt(er,Xt(Qr)),At=(er,Qr,Yr)=>new Promise((Li,io)=>{var Mo=So=>{try{Po(Yr.next(So))}catch(Wo){io(Wo)}},_o=So=>{try{Po(Yr.throw(So))}catch(Wo){io(Wo)}},Po=So=>So.done?Li(So.value):Promise.resolve(So.value).then(Mo,_o);Po((Yr=Yr.apply(er,Qr)).next())});const en=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o})=>{const{linkId:Po,text:So,required:Wo,prefix:eo,readOnly:fa,repeats:Sr,extension:ar}=er,Tr=(0,o.Qr)(ar),Pe=(0,o.cz)(ar),Ce=(0,o.$H)(ar)||"image/*,.pdf,.doc,.docx",Fe=So?(0,o.nt)(io,eo,So):"",gt=Mo?.[Po]||"",[Gt,tn]=(0,t.useState)([]),Ln=(0,t.useRef)(Yr||[]);(0,t.useEffect)(()=>{Yr&&(Ln.current=Yr)},[Yr]),(0,t.useEffect)(()=>{Yr?.length&&tn(Cr=>{const Vr=Cr.filter(Zr=>Zr.isLoading||Zr.failed);return[...Yr.filter(Zr=>Zr.valueAttachment).map((Zr,K0)=>{var wi,dt,_t,En,Tn;const tr=((wi=Zr.valueAttachment)==null?void 0:wi.title)||`attachment-${K0}`,Hr=(dt=Zr.valueAttachment)==null?void 0:dt.id,p0=Cr.find(Ni=>Hr&&Ni.id===Hr||!Hr&&Ni.id===`existing-${K0}`),ai=(_t=Zr.valueAttachment)==null?void 0:_t.data,M0=ai?Je(ai,(En=Zr.valueAttachment)==null?void 0:En.contentType):0;return{id:Hr||p0?.id||`existing-${K0}`,name:tr,size:p0?.size||M0,progress:100,failed:!1,type:(0,o.J4)((Tn=Zr.valueAttachment)==null?void 0:Tn.contentType),isLoading:!1}}),...Vr]})},[Yr]);const lr=Cr=>{let Vr=Array.from(Cr);if(Pe!==void 0){const Zr=Pe-Gt.length;if(Zr<=0)return;Vr=Vr.slice(0,Zr)}const d0=Vr.map(Zr=>{const K0=Tr&&Zr.size>Tr,wi=Zr.name.replace(/\s+/g,"-");return{id:ot(),name:wi,size:Zr.size,progress:0,type:(0,o.J4)(Zr.type),failed:!!K0,isLoading:!K0,disableRetry:!!K0,errorMessage:K0?`File size exceeds ${(Tr/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});tn(Zr=>[...Zr,...d0]),d0.filter(Zr=>!Zr.failed).forEach(Zr=>{const K0=Vr.find(wi=>wi.name.replace(/\s+/g,"-")===Zr.name);K0&&hn(K0,Zr.id)})},hn=(Cr,Vr)=>At(void 0,null,function*(){try{const d0=yield le(Cr),Zr=yield Or(d0),K0=d0.name.replace(/\s+/g,"-");tn(En=>En.map(Tn=>Tn.id===Vr?Ze(we({},Tn),{isLoading:!1,progress:100,failed:!1}):Tn));const wi={valueAttachment:{id:Vr,contentType:d0.type,data:Zr,title:K0}},_t=[...(Ln.current||[]).filter(En=>En.valueAttachment||Object.keys(En).length>0),wi];Ln.current=_t,Li(er,_t),Qr(Po)}catch{tn(Zr=>Zr.map(K0=>K0.id===Vr?Ze(we({},K0),{isLoading:!1,failed:!0}):K0))}}),Zn=Cr=>{const Vr=Gt.find(d0=>d0.id===Cr);if(tn(d0=>d0.filter(Zr=>Zr.id!==Cr)),Vr){const d0=(Ln.current||[]).filter((Zr,K0)=>{var wi;if(Cr.startsWith("existing-")){const dt=parseInt(Cr.replace("existing-",""));return K0!==dt}return((wi=Zr.valueAttachment)==null?void 0:wi.id)!==Cr}).filter(Zr=>Zr.valueAttachment||Object.keys(Zr).length>0);Ln.current=d0,Li(er,d0.length>0?d0:[{}])}},cn=Cr=>{const Vr=Gt.find(d0=>d0.id===Cr);if(Vr){tn(Zr=>Zr.map(K0=>K0.id===Cr?Ze(we({},K0),{failed:!1,isLoading:!0,progress:0}):K0));const d0=new File([""],Vr.name,{type:"application/octet-stream"});hn(d0,Cr)}},Or=Cr=>new Promise((Vr,d0)=>{const Zr=new FileReader;Zr.onload=()=>{const wi=Zr.result.split(",")[1];Vr(wi)},Zr.onerror=d0,Zr.readAsDataURL(Cr)});return(0,n.jsxs)("div",{children:[Fe&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Fe,required:Wo||!1}),(0,n.jsx)(r.FileUpload,{files:Gt,onDropFiles:lr,onDeleteFile:Zn,onRetryFile:cn,onDropUnacceptedFiles:()=>{},hint:(0,o.od)(Ce,Tr,Pe),accept:Ce,allowsMultiple:Sr!==!1,isDisabled:fa||_o||Pe!==void 0&&Gt.length>=Pe,className:"w-full",showDisclosureModal:!0}),gt&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:gt})]})},nn=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o})=>{var Po,So;const{linkId:Wo,text:eo,prefix:fa,readOnly:Sr,required:ar,extension:Tr}=er,{trackQuestionnaireEvent:Pe}=(0,b.c)(),Ce=eo?(0,o.nt)(io,fa,eo):"",Fe=Mo?.[Wo];return Tr?.find(Gt=>{var tn,Ln;return Gt.url===i.gD&&((Ln=(tn=Gt.valueCodeableConcept)==null?void 0:tn.coding)==null?void 0:Ln.some(lr=>lr.system===i.n4&&lr.code===i.GI))})?(0,n.jsxs)("div",{"data-testid":Wo,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":Wo,children:[(0,n.jsx)(r.Checkbox,{size:"md",id:Wo,name:Wo,isDisabled:Sr||_o,isSelected:(Po=Yr?.[0])==null?void 0:Po.valueBoolean,"aria-label":Wo,label:"",className:"mt-1",onChange:Gt=>{Pe(er.linkId,{value:Gt}),Li(er,[{valueBoolean:Gt}]),Qr(er.linkId)}}),Ce&&(0,n.jsx)(w,{isLabel:!0,text:Ce,required:ar||!1})]}),(0,n.jsx)(r.HintText,{isInvalid:!!Fe,children:Fe})]}):(0,n.jsxs)("div",{"data-testid":Wo,children:[Ce&&(0,n.jsx)(w,{isLabel:!0,text:Ce,required:ar||!1}),(0,n.jsxs)(r.RadioGroup,{size:"md",id:Wo,name:Wo,"aria-label":Wo,value:String((So=Yr?.[0])==null?void 0:So.valueBoolean)||"",onChange:Gt=>{Li(er,[{valueBoolean:Gt==="true"}]),Qr(er.linkId)},isInvalid:!!Fe,children:[(0,n.jsx)(r.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Sr||_o}),(0,n.jsx)(r.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Sr||_o})]},Wo),Fe&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Fe})})]})};var fn=Object.defineProperty,pt=Object.getOwnPropertySymbols,Yt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Pt=(er,Qr,Yr)=>Qr in er?fn(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,$t=(er,Qr)=>{for(var Yr in Qr||(Qr={}))Yt.call(Qr,Yr)&&Pt(er,Yr,Qr[Yr]);if(pt)for(var Yr of pt(Qr))qt.call(Qr,Yr)&&Pt(er,Yr,Qr[Yr]);return er};const Zt=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o,placeholder:Po,hintText:So})=>{var Wo,eo,fa;const{linkId:Sr,text:ar,required:Tr,answerOption:Pe,prefix:Ce,readOnly:Fe}=er,gt=ar?(0,o.nt)(io,Ce,ar):"",Gt=Pe?.map(lr=>{var hn,Zn,cn,Or;return{id:((hn=lr.valueCoding)==null?void 0:hn.code)||lr.valueString||"",label:((Zn=lr.valueCoding)==null?void 0:Zn.display)||lr.valueString||"",value:((cn=lr.valueCoding)==null?void 0:cn.code)||lr.valueString||"",extension:lr.extension||[],system:((Or=lr.valueCoding)==null?void 0:Or.system)||void 0}})||[],tn=((eo=(Wo=Yr?.[0])==null?void 0:Wo.valueCoding)==null?void 0:eo.code)||((fa=Yr?.[0])==null?void 0:fa.valueString)||"",Ln=Mo?.[Sr];return(0,n.jsxs)("div",{children:[gt&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:gt,required:Tr||!1}),(0,n.jsx)(r.Select,{id:Sr,"aria-label":Sr,"data-testid":Sr,isDisabled:Fe||_o,selectedKey:tn,onSelectionChange:lr=>{const hn=String(lr),Zn=Gt.find(Cr=>Cr.value===hn),cn=Zn?Zn.label:"",Or=Boolean(Pe?.find(Cr=>Cr.valueString===hn));Li(er,[Or?{valueString:hn}:{valueCoding:$t({code:hn,display:cn},Zn?.system?{system:Zn.system}:{}),extension:Zn?.extension||[]}]),Qr(er.linkId)},isInvalid:!!Ln,hint:Ln||So,items:Gt,placeholder:Po,isRequired:Tr,children:lr=>(0,n.jsx)(r.Select.Item,{id:lr.id,"data-testid":lr.value,value:lr.value,children:lr.label},lr.id)},Sr)]})};var Mn=Object.defineProperty,zr=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable,Pn=(er,Qr,Yr)=>Qr in er?Mn(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,rn=(er,Qr)=>{for(var Yr in Qr||(Qr={}))jr.call(Qr,Yr)&&Pn(er,Yr,Qr[Yr]);if(zr)for(var Yr of zr(Qr))Rn.call(Qr,Yr)&&Pn(er,Yr,Qr[Yr]);return er};const vt=er=>{var Qr,Yr,Li;const{item:io,selectedAnswer:Mo,updatedText:_o,required:Po,errorMessage:So}=er,Wo=io?.type==="reference",eo=(Qr=Mo?.map(Pe=>{var Ce,Fe;return Wo?(Ce=Pe.valueReference)==null?void 0:Ce.display:(Fe=Pe.valueCoding)==null?void 0:Fe.code}).filter(Pe=>Pe!==void 0))!=null?Qr:[],[fa,Sr]=(0,t.useState)(eo.length),ar=(Li=(Yr=io.extension)==null?void 0:Yr.find(Pe=>Pe.url===i.Z_))==null?void 0:Li.valueInteger,Tr=(Pe,Ce)=>{var Fe,gt,Gt;let tn;if(Pe){const Ln=er.options.find(lr=>lr.value===Ce);tn=[...(gt=(Fe=er.selectedAnswer)==null?void 0:Fe.filter(lr=>Object.keys(lr).length!==0))!=null?gt:[],Wo?{valueReference:Ln?.valueReference}:{valueCoding:rn({code:Ce,display:Ln?.label},Ln?.system?{system:Ln.system}:{}),extension:Ln?.extension||[]}],Sr(lr=>lr+1)}else tn=((Gt=er.selectedAnswer)==null?void 0:Gt.filter(Ln=>{var lr,hn;return Wo?((lr=Ln.valueReference)==null?void 0:lr.display)!==Ce:((hn=Ln.valueCoding)==null?void 0:hn.code)!==Ce}))||[{}],Sr(Ln=>Ln-1);er.handleInputChange(er.item,tn)};return(0,n.jsxs)("div",{"data-testid":io.linkId,children:[_o&&(0,n.jsx)(w,{isLabel:!0,text:_o,required:Po||!1}),(0,n.jsx)("div",{children:er.options.map((Pe,Ce)=>(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Pe.value,id:Ce.toString(),className:Ce!==er.options.length-1?"mb-2xl":"",name:Pe.label,isInvalid:!!So,isSelected:eo?.includes(Pe?.value),label:Pe.label,onChange:Fe=>Tr(Fe,Pe.value),isDisabled:er.readOnly||er.isLoading||(!eo?.includes(Pe?.value)&&ar?fa>=ar:!1)},Ce))}),(0,n.jsx)(r.HintText,{isInvalid:!!So,children:So})]})},Tt=({item:er,onCompleteHandler:Qr,updatedText:Yr,options:Li,handleInputChange:io,errorMessage:Mo,readOnly:_o,initialValue:Po,selectedAnswer:So,isLoading:Wo,required:eo})=>{var fa,Sr;const ar=`${er.linkId}-label`,Tr=`${er.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":er.linkId,children:[Yr&&(0,n.jsx)(w,{id:ar,isLabel:!0,text:Yr,required:eo||!1}),(0,n.jsx)(r.RadioGroup,{size:"md",id:er.linkId,name:er.linkId,"aria-labelledby":Yr?ar:void 0,"aria-describedby":Mo?Tr:void 0,isRequired:eo,className:Li.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Sr=(fa=So?.[0])==null?void 0:fa.valueCoding)==null?void 0:Sr.code)||Po||"",onChange:Pe=>{const Ce=Pe,Fe=Li.find(Gt=>Gt.value===Ce),gt=Fe?Fe.label:"";io(er,[{valueCoding:{code:Ce,display:gt,system:Fe?.system||void 0},extension:Fe?.extension||[]}]),Qr(er.linkId)},isInvalid:!!Mo,children:Li.map(Pe=>(0,n.jsx)(r.RadioButton,{size:"md","data-testid":Pe.value,isDisabled:_o||Wo,value:Pe.value,label:Pe.label},Pe.value))},er.linkId),Mo&&(0,n.jsx)("div",{id:Tr,children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Mo})})]})};var Kt=Object.defineProperty,un=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,jn=(er,Qr,Yr)=>Qr in er?Kt(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,wr=(er,Qr)=>{for(var Yr in Qr||(Qr={}))on.call(Qr,Yr)&&jn(er,Yr,Qr[Yr]);if(un)for(var Yr of un(Qr))Cn.call(Qr,Yr)&&jn(er,Yr,Qr[Yr]);return er};const Wr=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o,placeholder:Po,hintText:So})=>{var Wo,eo,fa,Sr,ar;const{linkId:Tr,text:Pe,required:Ce,answerOption:Fe,prefix:gt,readOnly:Gt}=er,tn=er?.type==="reference",Ln=Pe?(0,o.nt)(io,gt,Pe):"",hn=(()=>{var d0,Zr;const K0=Fe?.find(wi=>wi.initialSelected===!0);return K0?tn?((d0=K0.valueReference)==null?void 0:d0.display)||"":((Zr=K0?.valueCoding)==null?void 0:Zr.code)||"":""})(),Zn=(Fe?.map(d0=>{var Zr,K0,wi,dt,_t;return{label:((Zr=d0?.valueCoding)==null?void 0:Zr.display)||((K0=d0?.valueReference)==null?void 0:K0.display)||"",value:tn?((wi=d0.valueReference)==null?void 0:wi.display)||"":((dt=d0.valueCoding)==null?void 0:dt.code)||"",valueReference:tn?d0.valueReference:{},extension:d0.extension||[],system:((_t=d0.valueCoding)==null?void 0:_t.system)||""}})||[]).filter(d0=>d0.label),cn=Mo?.[Tr],Or=(ar=(Sr=(fa=(eo=(Wo=er?.extension)==null?void 0:Wo.find(d0=>d0.url.includes("questionnaire-itemControl")))==null?void 0:eo.valueCodeableConcept)==null?void 0:fa.coding)==null?void 0:Sr[0])==null?void 0:ar.code;let Cr=null;const Vr={item:er,onCompleteHandler:Qr,updatedText:Ln,options:Zn,handleInputChange:Li,errorMessage:cn,required:Ce,readOnly:Gt,initialValue:hn,selectedAnswer:Yr,isLoading:_o,showQuestionPrefix:io,placeholder:Po,hintText:So};switch(Or){case"drop-down":Cr=(0,n.jsx)(Zt,wr({},Vr));break;case"check-box":Cr=(0,n.jsx)(vt,wr({},Vr));break;case"radio-button":Cr=(0,n.jsx)(Tt,wr({},Vr));break}return(0,n.jsx)(n.Fragment,{children:Cr})};var _r=e(73697),f0=e(71924),Di=e(46776);const V0=er=>`${String(er.month).padStart(2,"0")}/${String(er.day).padStart(2,"0")}/${er.year}`,si=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o,placeholder:Po,hintText:So})=>{var Wo,eo,fa;const{linkId:Sr,text:ar,required:Tr,prefix:Pe,readOnly:Ce}=er,Fe=(0,t.useRef)(null),[gt,Gt]=(0,t.useState)(!1),[tn,Ln]=(0,t.useState)(null),{setIsCurrentFormValid:lr,isCurrentFormValid:hn,trackQuestionnaireEvent:Zn}=(0,b.c)(),cn=ar?(0,o.nt)(io,Pe,ar):"",Or=Mo?.[Sr]||"",Cr=(Wo=er.extension)==null?void 0:Wo.find(l0=>l0.url===i.dU),Vr=(eo=er.extension)==null?void 0:eo.find(l0=>l0.url===i.bK),d0=(0,t.useMemo)(()=>{var l0;const E0=Cr?.valueString||Cr?.valueDate;return E0||(0,o.iI)((l0=Cr?.valueExpression)==null?void 0:l0.expression)},[Cr]),Zr=(0,t.useMemo)(()=>{var l0;const E0=Vr?.valueString||Vr?.valueDate;return E0||(0,o.iI)((l0=Vr?.valueExpression)==null?void 0:l0.expression)},[Vr]),K0=(0,t.useMemo)(()=>{if(d0&&/^\d{4}-\d{2}-\d{2}$/.test(d0))try{return(0,_r._U)(d0)}catch{}return(0,_r._U)("1900-01-01")},[d0]),wi=(0,t.useMemo)(()=>{if(Zr&&/^\d{4}-\d{2}-\d{2}$/.test(Zr))try{return(0,_r._U)(Zr)}catch(l0){console.warn("Failed to parse maxDateStr:",Zr,l0)}return(0,_r._U)("2099-12-31")},[Zr]),_t=(l0=>{if(!l0)return"";const E0=l0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!E0)return l0;const[,pi,P0,Oo]=E0;return`${P0}/${Oo}/${pi}`})(((fa=Yr?.[0])==null?void 0:fa.valueDate)||""),En=l0=>{if(!l0)return"";const E0=l0.replace(/\D/g,"");if(E0.length===0)return"";if(E0.length<=2)return E0.length===2?`${E0}/`:E0;const pi=Oo=>{const ki=Oo.slice(0,2),Qo=Oo.slice(2);return Qo.length===2?`${ki}/${Qo}/`:`${ki}/${Qo}`},P0=Oo=>{const ki=Oo.slice(0,2),Qo=Oo.slice(2,4),xo=Oo.slice(4,8);return`${ki}/${Qo}/${xo}`};return E0.length<=4?pi(E0):P0(E0)},Tn=()=>{if(Ce||_o)return;if(_t.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const E0=(0,_r._U)(_t);Ln(E0)}catch{Ln(null)}else{const E0=_t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(E0){const[,pi,P0,Oo]=E0,ki=parseInt(pi,10),Qo=parseInt(P0,10);if(ki>=1&&ki<=12&&Qo>=1&&Qo<=31)try{const xo=(0,_r._U)(`${Oo}-${pi}-${P0}`);Ln(xo)}catch{Ln(null)}else Ln(null)}else Ln(null)}Gt(!0)},tr=()=>{if(tn){const l0=`${tn.year}-${String(tn.month).padStart(2,"0")}-${String(tn.day).padStart(2,"0")}`;Zn(er.linkId,{value:(0,o.CP)(`${String(tn.month).padStart(2,"0")}/${String(tn.day).padStart(2,"0")}/${tn.year}`)}),Li(er,[{valueDate:(0,o.Fy)(l0)}])}Gt(!1),Ln(null)},Hr=()=>{Gt(!1),Ln(null)},p0=l0=>{var E0;const pi=((E0=Fe.current)==null?void 0:E0.selectionStart)||0,P0=_t,Oo=En(l0),ki=Oo.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(ki){const[,Qo,xo,ya]=ki,ba=parseInt(Qo,10),Ls=parseInt(xo,10),Fs=parseInt(ya,10);if(ai(ba,Ls,Fs).isValid){const Xo=`${ya}-${Qo}-${xo}`;Zn(er.linkId,{value:(0,o.CP)(`${Qo}/${xo}/${ya}`)}),Li(er,[{valueDate:(0,o.Fy)(Xo)}])}else Li(er,[{valueDate:Oo}])}else Li(er,[{valueDate:Oo}]);setTimeout(()=>{if(Fe.current){const Qo=P0.replace(/\D/g,""),xo=Oo.replace(/\D/g,"");let ya=pi;Oo===P0&&(ya=pi-1),xo.length>=Qo.length&&Oo!==P0?Oo[pi-1]==="/"?ya=pi+1:ya=pi:xo.length<Qo.length&&(P0[pi-1]==="/"?ya=Math.max(0,pi-1):ya=pi),Fe.current.setSelectionRange(ya,ya)}},0)},ai=(l0,E0,pi)=>{if(l0<1||l0>12)return{isValid:!1,error:"Month must be between 01 and 12"};if(E0<1||E0>31)return{isValid:!1,error:"Day must be between 01 and 31"};const P0=new Date(pi,l0,0).getDate();if(E0>P0)return{isValid:!1,error:"Invalid day for the selected month"};if(d0||Zr){const Oo=new f0.ng(pi,l0,E0);if(d0&&/^\d{4}-\d{2}-\d{2}$/.test(d0))try{const ki=(0,_r._U)(d0);if(Oo.compare(ki)<0){const Qo=(0,o.di)(i.Ck,er.extension);if(Qo)return{isValid:!1,error:Qo};const xo=V0(ki);return{isValid:!1,error:`Date must be on or after ${xo}`}}}catch{}if(Zr&&/^\d{4}-\d{2}-\d{2}$/.test(Zr))try{const ki=(0,_r._U)(Zr);if(Oo.compare(ki)>0){const Qo=(0,o.di)(i.Cx,er.extension);if(Qo)return{isValid:!1,error:Qo};const xo=V0(ki);return{isValid:!1,error:`Date must be on or before ${xo}`}}}catch{}}return{isValid:!0,error:""}},M0=()=>{const l0=_t.replace(/\D/g,"");if(l0.length>0&&l0.length<8){Qr(er.linkId);return}const E0=_t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!E0&&l0.length>=6){Qr(er.linkId);return}if(E0){const[,pi,P0,Oo]=E0,ki=parseInt(pi,10),Qo=parseInt(P0,10),xo=parseInt(Oo,10);if(ai(ki,Qo,xo).isValid){const ya=`${Oo}-${pi}-${P0}`;Li(er,[{valueDate:(0,o.Fy)(ya)}])}}Qr(er.linkId)},q0=(()=>{if(!_t)return"";const l0=_t.replace(/\D/g,"");if(l0.length>0&&l0.length<8)return"";const E0=_t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!E0&&l0.length>=6)return hn&&lr(!1),"Invalid date";if(E0){const[,pi,P0,Oo]=E0,ki=parseInt(pi,10),Qo=parseInt(P0,10),xo=parseInt(Oo,10),{isValid:ya,error:ba}=ai(ki,Qo,xo);if(!ya)return hn&&lr(!1),ba||"Invalid date"}return""})(),Ci=!!Or||!!q0;return(0,n.jsxs)("div",{children:[cn&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:cn,required:Tr||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Ce||_o,className:(0,P.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||_o)&&"cursor-not-allowed opacity-50"),onClick:Tn,"aria-label":"Open calendar",children:(0,n.jsx)($.V,{className:"size-5 text-gray-400"})}),(0,n.jsx)("div",{className:(0,P.cx)("pointer-events-none absolute top-[7px] right-[2px] z-2 h-[30px] w-[35px] bg-white",(Ce||_o)&&"bg-disabled_subtle")}),(0,n.jsx)(r.Input,{ref:Fe,isRequired:Tr,size:"md",type:"text",name:Sr,"data-testid":Sr,id:Sr,value:_t,onChange:p0,placeholder:Po,isDisabled:Ce||_o,onBlur:M0,hint:q0||Or||So,isInvalid:Ci,className:(0,P.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Sr)]}),(0,n.jsx)(r.Modal,{id:"calendar-date-picker-modal",isOpen:gt,onOpenChange:l0=>{l0||Hr()},primaryButton:{children:"Apply",onClick:tr,isDisabled:!tn},secondaryButton:{children:"Cancel",onClick:Hr},children:(0,n.jsx)(Di.lr,{value:tn,onChange:Ln,minValue:K0,maxValue:wi,children:(0,n.jsx)(r.Calendar,{showDateInput:!1,minValue:K0,maxValue:wi,onYearPickerOpen:()=>{Ln(null)}})})})]})},X0=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o})=>{var Po;const{linkId:So,text:Wo,required:eo,prefix:fa,readOnly:Sr}=er,ar=Wo?(0,o.nt)(io,fa,Wo):"",Tr=Mo?.[So]||"";return(0,n.jsxs)("div",{children:[ar&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:ar,required:eo||!1}),(0,n.jsx)(r.Input,{isRequired:eo,size:"md",type:"datetime-local",id:So,"aria-label":So,"data-testid":So,placeholder:"Type your response here...",value:((Po=Yr?.[0])==null?void 0:Po.valueDateTime)||"",onChange:Pe=>{let Ce=Pe;const[Fe,gt]=Ce.split("T");Fe&&gt&&(Ce=`${(0,o.Fy)(Fe)}T${gt}:00`),Li(er,[{valueDateTime:Ce}])},isDisabled:Sr||_o,onBlur:()=>{Qr(er.linkId)},hint:Tr,isInvalid:!!Tr},So)]})},Si=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o,placeholder:Po,hintText:So})=>{var Wo;const{linkId:eo,text:fa,required:Sr,prefix:ar,readOnly:Tr}=er,Pe=fa?(0,o.nt)(io,ar,fa):"",Ce=Mo?.[eo]||"",Fe=(0,o.a0)(er),gt=(Wo=Yr?.[0])==null?void 0:Wo.valueDecimal,[Gt,tn]=(0,t.useState)(String(gt??""));return(0,t.useEffect)(()=>{tn(String(gt??""))},[gt]),(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(w,{isLabel:!0,text:Pe,required:Sr||!1}),(0,n.jsx)(r.Input,{isRequired:Sr,size:"md",id:eo,"aria-label":eo,"data-testid":eo,placeholder:Po,value:Gt,onChange:Ln=>{tn(Ln)},isDisabled:Tr||_o,onBlur:()=>{const Ln=parseFloat(Gt);tn(isNaN(Ln)?"":String(Ln)),Li(er,[{valueDecimal:isNaN(Ln)?void 0:Ln}]),Qr(er.linkId)},type:"number",hint:Ce||So,isInvalid:!!Ce,autoComplete:Fe},eo)]})},pr=({item:er,showStepper:Qr=!1})=>{var Yr;const{text:Li,linkId:io,type:Mo}=er,_o=Li&&(0,o.nt)(!1,"",Li),Po=(Yr=er.extension)==null?void 0:Yr.find(fa=>fa.url===i.Yt),So=Po?.valueBoolean===!0,Wo=Mo==="group"&&(0,o.$O)(er)!==void 0,eo=()=>{const fa=(0,o.$O)(er),Sr=(0,o.t7)(er);if(fa===void 0||Sr===void 0||Sr<=0)return[];const ar=[];for(let Tr=1;Tr<=Sr;Tr++){let Pe="incomplete";Tr<fa?Pe="complete":Tr===fa&&(Pe="current"),ar.push({title:"",description:"",status:Pe})}return ar};return _o&&!So?(0,n.jsxs)("div",{"data-testid":io,children:[(0,n.jsx)(w,{text:_o,required:!1,className:""}),Qr&&Wo&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(r.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:eo()})})]}):null},mr=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o,placeholder:Po,hintText:So})=>{var Wo;const{linkId:eo,text:fa,required:Sr,prefix:ar,readOnly:Tr}=er,Pe=fa?(0,o.nt)(io,ar,fa):"",Ce=Mo?.[eo]||"",Fe=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Sr||!1}),(0,n.jsx)(r.Input,{isRequired:Sr,"data-testid":eo,size:"md",id:eo,"aria-label":eo,placeholder:Po,value:String((Wo=Yr?.[0])==null?void 0:Wo.valueInteger)||"",onChange:gt=>{Li(er,[{valueInteger:Number(gt)}])},isDisabled:Tr||_o,onBlur:()=>{Qr(er.linkId)},type:"number",hint:Ce||So,isInvalid:!!Ce,autoComplete:Fe},eo)]})},vr=({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o,placeholder:Po,hintText:So})=>{var Wo,eo,fa;const{linkId:Sr,text:ar,extension:Tr,required:Pe,prefix:Ce,readOnly:Fe}=er,gt=ar?(0,o.nt)(io,Ce,ar):"",Gt=Tr?.find(lr=>lr.url.includes("questionnaire-unitOption")),tn=Mo?.[Sr],Ln=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[gt&&(0,n.jsx)(w,{isLabel:!0,text:gt,required:Pe||!1}),(0,n.jsx)(r.InputGroup,{isRequired:Pe,size:"md",id:Sr,"aria-label":Sr,"data-testid":Sr,value:(Wo=Yr?.[0])!=null&&Wo.valueQuantity?String((eo=Yr[0].valueQuantity)==null?void 0:eo.value):"",onChange:lr=>{Li(er,[{valueQuantity:{value:parseFloat(lr)}}])},isDisabled:Fe||_o,onBlur:()=>{var lr,hn,Zn;const cn=(lr=Yr?.[0])!=null&&lr.valueQuantity?parseFloat(String((Zn=(hn=Yr?.[0])==null?void 0:hn.valueQuantity)==null?void 0:Zn.value)).toFixed(2):"";Li(er,[{valueQuantity:{value:parseFloat(cn)}}]),Qr(er.linkId)},hint:tn||So,isInvalid:!!tn,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:(fa=Gt?.valueCoding)==null?void 0:fa.display}),children:(0,n.jsx)(r.InputBase,{type:"number",placeholder:Po,autoComplete:Ln})},Sr)]})};var x0=e(61784);const b0="ui-toolkit-modern",Y0={CLOSE_MODAL:"CLOSE_MODAL",PROFILE:"PROFILE",SEARCH:"SEARCH",CALENDAR_PREV_WEEK:"CALENDAR_PREV_WEEK",CALENDAR_NEXT_WEEK:"CALENDAR_NEXT_WEEK",CALENDAR_CANCEL:"CALENDAR_CANCEL",CALENDAR_APPLY:"CALENDAR_APPLY",CALENDAR:"CALENDAR",NEXT_AVAILABLE_APPOINTMENTS:"NEXT_AVAILABLE_APPOINTMENTS",NO_NEXT_AVAILABLE_APPOINTMENTS:"NO_NEXT_AVAILABLE_APPOINTMENTS",TODAY:"TODAY",CLICK_TO_UPLOAD:"CLICK_TO_UPLOAD",OR_DRAG_AND_DROP:"OR_DRAG_AND_DROP",FAILED_TO_UPLOAD:"FAILED_TO_UPLOAD",TRY_AGAIN:"TRY_AGAIN",LOCATIONS_LOWER_CASE:"LOCATIONS_LOWER_CASE",LOCATION_LOWER_CASE:"LOCATION_LOWER_CASE",EXPAND:"EXPAND",COLLAPSE:"COLLAPSE",DISCLOSURE_MODAL_TITLE:"DISCLOSURE_MODAL_TITLE",DISCLOSURE_MODAL_DESCRIPTION:"DISCLOSURE_MODAL_DESCRIPTION",DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE:"DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE",DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON:"DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON",FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON:"FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON",FILE_DISCLOSURE_UPLOAD_BUTTON:"FILE_DISCLOSURE_UPLOAD_BUTTON",FILE_UPLOAD_DROPZONE:"FILE_UPLOAD_DROPZONE",DOWNLOAD_DISCLOSURE_TITLE:"DOWNLOAD_DISCLOSURE_TITLE",DOWNLOAD_DISCLOSURE_DESCRIPTION:"DOWNLOAD_DISCLOSURE_DESCRIPTION",DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE:"DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE",DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE:"DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE",DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE:"DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE",DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON:"DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON",DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON:"DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON",DISMISS:"DISMISS",LOCATION_DISTANCE:"LOCATION_DISTANCE",LOCATION_DISTANCE_AWAY:"LOCATION_DISTANCE_AWAY",MILE:"MILE",MILES:"MILES",ADDRESS:"ADDRESS",CURRENT_LOCATION:"CURRENT_LOCATION",ZIP_CODE:"ZIP_CODE",SEE_ALL:"SEE_ALL",SEE_LESS:"SEE_LESS"},Fi={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},Ui={[Fi.CURRENT_LOCATION]:Y0.CURRENT_LOCATION,[Fi.ZIP_CODE]:Y0.ZIP_CODE,[Fi.ADDRESS]:Y0.ADDRESS},lo={mi:{singular:Y0.MILE,plural:Y0.MILES}},Ro=({resourceData:er,handleInputChange:Qr,item:Yr,questionnaireSchemaItems:Li})=>{var io;const{t:Mo}=(0,x0.SS)(),{queryParams:_o}=(0,it.useSearchQueryParams)(),Po=_o.locationType||"",{setCurrentGroupIndex:So,handleContinueButtonClick:Wo,setHideFooterButton:eo}=(0,b.c)(),{trackEvent:fa}=(0,s.st)();(0,t.useEffect)(()=>{if(!Yr.readOnly)return eo(!0),()=>{eo(!1)}},[Yr.readOnly,eo]);const Sr=(io=Yr.extension)==null?void 0:io.find(hn=>hn.url===i.Uf),ar=Sr?.valueString,Tr=()=>{if(ar){const hn=(0,o.Ue)(Li||[],ar);hn!==-1&&So(hn)}},Pe=hn=>{const Zn=hn.find(cn=>cn.url.includes("description"));return Zn?.valueString||""},Ce=hn=>{const Zn=hn.find(Zr=>Zr.url.includes("distance-value")),cn=hn.find(Zr=>Zr.url.includes("distance-unit")),Or=Zn?.valueString?Number(Zn.valueString):NaN,Cr=cn?.valueString||"";if(!Cr||isNaN(Or))return null;const Vr=Math.round(Or);let d0=Cr;return lo[Cr]&&(d0=Mo(Vr===1?lo[Cr].singular:lo[Cr].plural)),Po&&Ui[Po]?Mo(Y0.LOCATION_DISTANCE,{distance:`${Vr} ${d0}`,locationType:Mo(Ui[Po])}):Mo(Y0.LOCATION_DISTANCE_AWAY,{distance:`${Vr} ${d0}`})},Fe=hn=>({id:hn.id||"",providerName:hn.name||"",specialty:"",distance:Ce(hn.extension||[])||"",placeholderIcon:r.WalgreensLogo,address:hn.address||"",valueReference:hn.valueReference||{reference:hn.id}}),gt=hn=>{var Zn,cn,Or,Cr;const Vr=hn;return Fe({id:Vr.id,name:(Zn=Vr.name)!=null?Zn:"",address:(Cr=(Or=(cn=Vr?.address)==null?void 0:cn.line)==null?void 0:Or[0])!=null?Cr:"",extension:Vr?.extension,valueReference:{reference:Vr.id}})},Gt=hn=>Fe({id:hn?.reference,name:hn?.display,address:Pe(hn?.extension||[]),extension:hn?.extension,valueReference:hn}),Ln=(()=>er&&Array.isArray(er)&&er.length>0?er.map(gt):Yr.initial&&Array.isArray(Yr.initial)&&Yr.initial.length>0?Yr.initial.map(hn=>Gt(hn.valueReference)):Yr.answerOption?Yr.answerOption.map(hn=>Gt(hn.valueReference)):[])(),lr=hn=>{Qr(Yr,[{valueReference:hn}])};return(0,n.jsx)("div",{className:(0,r.cx)("gap-md flex flex-col",!Yr.readOnly&&"pb-4xl"),children:Yr.readOnly?Ln.map(({address:hn,id:Zn,providerName:cn,placeholderIcon:Or,distance:Cr})=>(0,n.jsx)(it.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Or},locationName:cn,address:hn,distance:Cr,actionButtonText:ar?"Change location":void 0,onActionButtonClick:ar?Tr:void 0},Zn)):Ln.map(({address:hn,id:Zn,providerName:cn,placeholderIcon:Or,specialty:Cr,valueReference:Vr,distance:d0})=>(0,n.jsx)(r.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Or},providerName:{content:cn},specialty:{content:Cr},location:{address:hn,distance:d0},actionButton:{children:"Schedule appointment",onClick:()=>{fa("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:hn,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),lr(Vr),Wo?.()}}},Zn))})};var To=e(79079),to=e(32066),No=e(43915),mo=e(36181),ko=e(37234),Uo=e(59931),qa=e(65388),Dr=Object.defineProperty,Jn=Object.defineProperties,Kr=Object.getOwnPropertyDescriptors,Lr=Object.getOwnPropertySymbols,k0=Object.prototype.hasOwnProperty,bn=Object.prototype.propertyIsEnumerable,$n=(er,Qr,Yr)=>Qr in er?Dr(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,Er=(er,Qr)=>{for(var Yr in Qr||(Qr={}))k0.call(Qr,Yr)&&$n(er,Yr,Qr[Yr]);if(Lr)for(var Yr of Lr(Qr))bn.call(Qr,Yr)&&$n(er,Yr,Qr[Yr]);return er},c0=(er,Qr)=>Jn(er,Kr(Qr));const Qn="tz-code",Nr={"ui-toolkit/LocationCard":Ro,"ui-toolkit/TimeSlotSelection":({resourceData:er,item:Qr,handleInputChange:Yr,selectedAnswer:Li,questionnaireSchemaItems:io,formData:Mo,onCompleteHandler:_o})=>{var Po,So;const{t:Wo}=(0,To.S)(),{trackEvent:eo}=(0,s.st)(),{isLoading:fa,setIsInlineNextQuestionTriggered:Sr}=(0,b.c)(),ar=l0=>{const E0=l0.match(/^(\d{4}-\d{2}-\d{2})/);return E0?E0[1]:l0},Tr=l0=>{const E0=l0.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return E0?`${E0[1]} ${E0[2]}`:l0},Pe=l0=>{const E0=l0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(E0){const[,pi,P0,Oo]=E0;return new Date(parseInt(pi),parseInt(P0)-1,parseInt(Oo))}return new Date},Fe=(()=>{var l0;if((l0=Li?.[0])!=null&&l0.valueReference){const E0=Li[0].valueReference,pi=E0.display||"",P0=ar(pi);if(P0)return{date:Pe(P0),slotId:E0.reference||""}}return{date:new Date,slotId:""}})(),[gt,Gt]=(0,t.useState)(Fe.date),[tn,Ln]=(0,t.useState)(Fe.slotId),[lr,hn]=(0,t.useState)(new Set),Zn=(0,t.useMemo)(()=>new f0.ng(gt.getFullYear(),gt.getMonth()+1,gt.getDate()),[gt]),cn=l0=>({display:l0.display||"",id:l0.id||"",start:l0.start||"",extension:Array.isArray(l0.extension)?l0.extension:[],identifier:Array.isArray(l0.identifier)?l0.identifier:[],type:l0.type||""}),Or=l0=>cn({display:l0.start?Tr(l0.start):"",id:l0.id,start:l0.start,extension:l0.extension,identifier:l0.identifier}),Cr=l0=>cn({display:l0?.display||"",id:l0?.reference,start:l0?.display,extension:l0?.extension,identifier:l0?.identifier,type:l0?.type}),Vr=()=>{if(Array.isArray(er)&&er.length>0)return er.filter(l0=>l0.resourceType==="Appointment").map(Or);if(Qr.initial&&Array.isArray(Qr.initial)&&Qr.initial.length>0)return Qr.initial.map(l0=>Cr(l0.valueReference));if(Qr.answerOption)return Qr.answerOption.map(l0=>Cr(l0.valueReference))},d0=(0,t.useMemo)(()=>Vr()||[],[er,Li,Qr]),Zr=(0,t.useMemo)(()=>{const l0={};return d0.forEach(E0=>{if(E0.start&&E0.id){const pi=ar(E0.start);l0[pi]||(l0[pi]=[]),l0[pi].push({display:E0.display,id:E0.id,start:E0.start,extension:E0.extension})}}),l0},[d0]),K0=(0,t.useMemo)(()=>{const l0=Object.keys(Zr).sort(),E0=[],pi=(0,o.mR)(Qr);if(l0.length===0)return E0.push(Zn),lr.forEach(P0=>{const Oo=(0,No.A)(P0);E0.push(new f0.ng(Oo.getFullYear(),Oo.getMonth()+1,Oo.getDate()))}),E0;if(pi){const P0=(0,No.A)(l0[0]),Oo=(0,No.A)(l0[l0.length-1]),ki=new f0.ng(P0.getFullYear(),P0.getMonth()+1,P0.getDate()),Qo=new f0.ng(Oo.getFullYear(),Oo.getMonth()+1,Oo.getDate());for(let xo=ki;xo.compare(Qo)<=0;xo=xo.add({days:1})){const ya=`${xo.year}-${String(xo.month).padStart(2,"0")}-${String(xo.day).padStart(2,"0")}`;Zr[ya]||E0.push(xo)}lr.forEach(xo=>{const ya=(0,No.A)(xo),ba=new f0.ng(ya.getFullYear(),ya.getMonth()+1,ya.getDate());E0.some(Ls=>Ls.year===ba.year&&Ls.month===ba.month&&Ls.day===ba.day)||E0.push(ba)})}else{const P0=(0,to.Ec)((0,to.Xj)()),Oo=P0.add({days:30});for(let ki=P0;ki.compare(Oo)<=0;ki=ki.add({days:1})){const Qo=`${ki.year}-${String(ki.month).padStart(2,"0")}-${String(ki.day).padStart(2,"0")}`;Zr[Qo]||E0.push(ki)}}return E0},[Zr,lr,Zn,Qr]),wi=(0,t.useMemo)(()=>(0,o.mR)(Qr)?r.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[Qr]),dt=(0,t.useMemo)(()=>Object.keys(Zr).map(l0=>{const E0=(0,No.A)(l0);return new f0.ng(E0.getFullYear(),E0.getMonth()+1,E0.getDate())}),[Zr]),_t=(0,mo.A)((0,ko.A)(gt),"yyyy-MM-dd"),En=(0,t.useMemo)(()=>Zr[_t]||[],[Zr,_t]);(0,t.useEffect)(()=>{const l0=Object.entries(Zr).sort(([E0],[pi])=>E0.localeCompare(pi)).slice(0,3).reduce((E0,[pi,P0])=>c0(Er({},E0),{[`${pi} ${Hr}`]:P0.map(Oo=>{var ki;return(0,qa.YX)({time:Oo.start,timeZone:(0,o.lv)((ki=En[0])==null?void 0:ki.extension)}).time})}),{});eo("slots_returned",{Specialty:"Vaccines",first_three_days_slots:l0,_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 Tn=t.useRef(null),tr=t.useRef(null);(0,t.useEffect)(()=>{var l0;const E0=Object.keys(Zr).sort();if(E0.length===0)return;const P0=!(Tn.current===null)&&JSON.stringify(Tn.current)!==JSON.stringify(Zr);if(Tn.current=Zr,!!P0&&(hn(new Set),tr.current)){const Oo=tr.current;if(!(((l0=Zr[Oo])==null?void 0:l0.length)>0)){const Qo=new Set,xo=(0,No.A)(Oo),ya=(0,No.A)(E0[0]);let ba=xo;for(;ba<ya;){const Ls=(0,mo.A)(ba,"yyyy-MM-dd");Qo.add(Ls),ba=new Date(ba),ba.setDate(ba.getDate()+1)}hn(Qo),Ln("")}tr.current=null}},[Zr]);const Hr=(0,t.useMemo)(()=>{var l0;const E0=En[0];if(!E0?.extension)return"";const pi=E0.extension.find(P0=>P0?.url===Qn);try{return(0,Uo.formatToTimeZone)(new Date,"(z)",{timeZone:(l0=pi?.valueCode)!=null?l0:""})}catch{return""}},[En]),p0=(0,t.useMemo)(()=>{const l0=Wo(r.Translations.NEXT_AVAILABLE_APPOINTMENTS);return Hr?`${l0} ${Hr}`:l0},[Wo,Hr]),ai=(0,t.useMemo)(()=>{const E0=Object.keys(Zr).sort().find(pi=>pi>_t);if(E0){const pi=(0,No.A)(E0);return new f0.ng(pi.getFullYear(),pi.getMonth()+1,pi.getDate())}return null},[Zr,_t]),M0=()=>{if(ai){const l0=ai.toDate((0,to.Xj)());Gt(l0),Ln("")}},Ni=l0=>{if(!l0){Ln(""),Yr(Qr,void 0);return}Ln(l0.id);const E0=[{valueReference:{display:l0.display,reference:l0.id,extension:l0.extension,identifier:l0.identifier,type:l0.type}}];Yr(Qr,E0)},q0=l0=>{var E0;if(!l0)return;const pi=Object.keys(Zr).sort(),P0=pi[pi.length-1],Oo=pi[0],ki=`${l0.year}-${String(l0.month).padStart(2,"0")}-${String(l0.day).padStart(2,"0")}`;if(P0&&(ki>P0||Oo&&ki<Oo)&&(0,o.mR)(Qr)&&io&&!K0?.some(xo=>xo.compare(l0)===0)){const xo=(0,o.yQ)(Qr,io);if(xo){tr.current=ki;let ya="-06:00";if((E0=d0[0])!=null&&E0.start){const Xo=d0[0].start.match(/([+-]\d{2}:\d{2})$/);Xo&&(ya=Xo[1])}const Ls=[{valueDateTime:`${ki}T23:59:59${ya}`}],Fs=Yr(xo,Ls);Yr(Qr,void 0,(0,o.Nw)(Fs||Mo||[],Qr.linkId),void 0,!0),Sr(!0),_o(xo.linkId,!0,!0)}}const Qo=l0?.toDate((0,to.Xj)());Gt(Qo),Ln("")},Ci=l0=>{if(!l0)return;const E0=En.find(pi=>pi.id===l0);eo("slot_selected",{Specialty:"Vaccines",time_slot:E0?(0,qa.YX)({time:E0.start,timeZone:(0,o.lv)(En[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."}}),Ni(E0??null)};return(0,n.jsx)(r.TimeSlot,{onChange:q0,disabledDates:K0,highlightedDates:dt,loading:fa,minValue:(0,to.Ec)((0,to.Xj)()),maxValue:(0,to.Ec)((0,to.Xj)()).add({days:wi}),value:Zn,defaultValue:Zn,appointmentSlots:{title:p0,onChange:Ci,defaultValue:Li&&((So=(Po=Li[0])==null?void 0:Po.valueReference)==null?void 0:So.reference)||void 0,value:tn||void 0,items:En.map(l0=>({label:Te(l0.start),value:l0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[Wo(r.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),ai&&(0,n.jsx)("button",{onClick:M0,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:Wo(r.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var ni=Object.defineProperty,qi=Object.defineProperties,ea=Object.getOwnPropertyDescriptors,Fo=Object.getOwnPropertySymbols,la=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,z0=(er,Qr,Yr)=>Qr in er?ni(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,ja=(er,Qr)=>{for(var Yr in Qr||(Qr={}))la.call(Qr,Yr)&&z0(er,Yr,Qr[Yr]);if(Fo)for(var Yr of Fo(Qr))Oi.call(Qr,Yr)&&z0(er,Yr,Qr[Yr]);return er},cs=(er,Qr)=>qi(er,ea(Qr)),ys=(er,Qr)=>{var Yr={};for(var Li in er)la.call(er,Li)&&Qr.indexOf(Li)<0&&(Yr[Li]=er[Li]);if(er!=null&&Fo)for(var Li of Fo(er))Qr.indexOf(Li)<0&&Oi.call(er,Li)&&(Yr[Li]=er[Li]);return Yr};const gs=(er,Qr)=>er.answerOption?er.answerOption.map(Yr=>{var Li,io;const Mo=(io=(Li=Yr.valueReference)==null?void 0:Li.reference)==null?void 0:io.replace("#","");return Qr.find(_o=>_o.id===Mo)}).filter(Boolean):[],ss=er=>{var Qr,Yr,Li;const io=er.find(Mo=>{var _o,Po;return Mo.url.includes("questionnaire-itemControl")&&((Po=(_o=Mo.valueCodeableConcept)==null?void 0:_o.coding)==null?void 0:Po.some(So=>{var Wo;return(Wo=So.code)==null?void 0:Wo.startsWith("ui-toolkit/")}))});return(Li=(Yr=(Qr=io?.valueCodeableConcept)==null?void 0:Qr.coding)==null?void 0:Yr.find(Mo=>{var _o;return(_o=Mo.code)==null?void 0:_o.startsWith("ui-toolkit/")}))==null?void 0:Li.code},d1=er=>{var{uiToolkitCode:Qr,props:Yr}=er,Li=Yr,{item:io,contained:Mo=[],customErrorConfigurations:_o}=Li,Po=ys(Li,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:So}=(0,b.c)(),Wo=Nr[Qr];if(!Wo)return(0,n.jsx)(n.Fragment,{});const eo=gs(io,Mo),fa=eo.length>0;return!(io.answerOption&&io.answerOption.length>0)&&!fa&&!io.readOnly?(So(!0),(0,n.jsx)(Ie,{configKey:Qr,customErrorConfigurations:_o})):(0,n.jsx)(Wo,cs(ja({},Po),{item:io,contained:Mo,customErrorConfigurations:_o,resourceData:eo,"data-testid":io.linkId}))},O0={attachment:en,choice:Wr,boolean:nn,integer:mr,string:({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o,placeholder:Po,hintText:So})=>{var Wo;const{linkId:eo,text:fa,required:Sr,prefix:ar,readOnly:Tr}=er,Pe=fa?(0,o.nt)(io,ar,fa):"",Ce=Mo?.[eo]||"",Fe=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Sr||!1}),(0,n.jsx)(r.Input,{isRequired:Sr,size:"md","aria-label":eo,"data-testid":eo,id:eo,type:Fe==="tel"?"tel":"text",placeholder:Po,value:((Wo=Yr?.[0])==null?void 0:Wo.valueString)||"",onChange:gt=>{Li(er,[{valueString:gt}])},isDisabled:Tr||_o,onBlur:gt=>{const Gt=gt.target.value,tn=Gt.trim();tn!==Gt&&Li(er,[{valueString:tn}]),Qr(er.linkId)},hint:Ce||So,isInvalid:!!Ce,autoComplete:Fe},eo)]})},url:({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o,placeholder:Po,hintText:So})=>{var Wo;const{linkId:eo,text:fa,required:Sr,prefix:ar,readOnly:Tr}=er,Pe=fa?(0,o.nt)(io,ar,fa):"",Ce=Mo?.[eo]||"",Fe=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Sr||!1}),(0,n.jsx)(r.Input,{isRequired:Sr,size:"md",type:"url",id:eo,"data-testid":eo,"aria-label":eo,placeholder:Po,value:((Wo=Yr?.[0])==null?void 0:Wo.valueUri)||"",onChange:gt=>{Li(er,[{valueUri:gt}])},isDisabled:Tr||_o,onBlur:gt=>{const Gt=gt.target.value,tn=Gt.trim();tn!==Gt&&Li(er,[{valueUri:tn}]),Qr(er.linkId)},hint:Ce||So,isInvalid:!!Ce,autoComplete:Fe},eo)]})},text:({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o,placeholder:Po,hintText:So})=>{var Wo;const{linkId:eo,text:fa,required:Sr,prefix:ar,readOnly:Tr,maxLength:Pe}=er,Ce=fa?(0,o.nt)(io,ar,fa):"",Fe=Mo?.[eo]||"",gt=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Sr||!1}),(0,n.jsx)(r.TextArea,{isRequired:Sr,id:eo,"aria-label":eo,"data-testid":eo,rows:3,placeholder:Po,value:((Wo=Yr?.[0])==null?void 0:Wo.valueString)||"",onChange:Gt=>{Li(er,[{valueString:Gt}])},isDisabled:Tr||_o,onBlur:Gt=>{const tn=Gt.target.value,Ln=tn.trim();Ln!==tn&&Li(er,[{valueString:Ln}]),Qr(er.linkId)},hint:Fe||So,counter:!0,isInvalid:!!Fe,maxLength:Pe,autoComplete:gt},eo)]})},date:si,time:({item:er,onCompleteHandler:Qr,selectedAnswer:Yr,handleInputChange:Li,showQuestionPrefix:io,errors:Mo,isLoading:_o})=>{var Po;const{linkId:So,text:Wo,required:eo,prefix:fa,readOnly:Sr}=er,ar=Wo?(0,o.nt)(io,fa,Wo):"",Tr=Mo?.[So]||"";return(0,n.jsxs)("div",{children:[ar&&(0,n.jsx)(w,{isLabel:!0,text:ar,required:eo||!1}),(0,n.jsx)(r.Input,{isRequired:eo,size:"md",type:"time",id:So,"data-testid":So,"aria-label":So,placeholder:"Type your response here...",value:((Po=Yr?.[0])==null?void 0:Po.valueTime)||"",onChange:Pe=>{Li(er,[{valueTime:Pe}])},isDisabled:Sr||_o,onBlur:()=>{Qr(er.linkId)},hint:Tr,isInvalid:!!Tr},So)]})},dateTime:X0,quantity:vr,decimal:Si,question:pr,display:pr,group:pr,reference:er=>{var Qr,Yr,Li,io,Mo;const{setHideFooterButton:_o}=(0,b.c)(),{item:Po,customErrorConfigurations:So}=er,Wo=Po.extension||[],eo=ss(Wo);return eo?(0,n.jsx)(d1,{uiToolkitCode:eo,props:er}):((Mo=(io=(Li=(Yr=(Qr=Po?.extension)==null?void 0:Qr.find(Sr=>Sr.url.includes("questionnaire-itemControl")))==null?void 0:Yr.valueCodeableConcept)==null?void 0:Li.coding)==null?void 0:io[0])==null?void 0:Mo.code)==="check-box"?Po.answerOption&&Po.answerOption.length>0?(0,n.jsx)(Wr,cs(ja({},er),{item:Po})):(_o(!0),(0,n.jsx)(Ie,{configKey:Po.linkId,customErrorConfigurations:So})):null}};var $0=(er,Qr,Yr)=>new Promise((Li,io)=>{var Mo=So=>{try{Po(Yr.next(So))}catch(Wo){io(Wo)}},_o=So=>{try{Po(Yr.throw(So))}catch(Wo){io(Wo)}},Po=So=>So.done?Li(So.value):Promise.resolve(So.value).then(Mo,_o);Po((Yr=Yr.apply(er,Qr)).next())});const Wt=({item:er,selectedAnswer:Qr,showQuestionPrefix:Yr})=>{const{text:Li,prefix:io,required:Mo}=er,_o=Li?getUpdatedQuestionText(Yr,io,Li):"",[Po,So]=useState(null),[Wo,eo]=useState(!1),{documentDownload:fa,webview:Sr}=useNativeBridge(),ar=(Qr||[]).filter(Fe=>{var gt,Gt;return((gt=Fe.valueAttachment)==null?void 0:gt.data)&&((Gt=Fe.valueAttachment)==null?void 0:Gt.title)}).map((Fe,gt)=>{var Gt,tn,Ln,lr,hn,Zn,cn;return{id:((Gt=Fe.valueAttachment)==null?void 0:Gt.id)||`preview-${gt}`,fileName:((tn=Fe.valueAttachment)==null?void 0:tn.title)||`attachment-${gt}`,contentType:((Ln=Fe.valueAttachment)==null?void 0:Ln.contentType)||"application/octet-stream",base64Data:((lr=Fe.valueAttachment)==null?void 0:lr.data)||"",size:getBase64Size(((hn=Fe.valueAttachment)==null?void 0:hn.data)||"",(Zn=Fe.valueAttachment)==null?void 0:Zn.contentType),type:getFileTypeFromMimeType((cn=Fe.valueAttachment)==null?void 0:cn.contentType)}}),Tr=useCallback(Fe=>{const{fileName:gt,contentType:Gt,base64Data:tn}=Fe;if(Sr.isWithin)So({fileName:gt,contentType:Gt,base64Data:tn}),eo(!0);else{const Ln=base64toObjectUrl(tn,Gt),lr=document.createElement("a");lr.href=Ln,lr.download=gt,document.body.appendChild(lr),lr.click(),document.body.removeChild(lr),URL.revokeObjectURL(Ln)}},[Sr.isWithin]),Pe=useCallback(()=>$0(void 0,null,function*(){!Po||(yield fa.writeFile(Po.fileName,prepareDataUrl(Po.base64Data,Po.contentType)))}),[Po,fa]),Ce=useCallback(()=>{eo(!1),So(null)},[]);return ar.length?jsxs("div",{children:[_o&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:_o,required:Mo||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:ar.map(Fe=>jsx("button",{type:"button",onClick:()=>Tr(Fe),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(Fe.fileName),size:Fe.size,type:Fe.type})},Fe.id))}),jsx(DownloadDisclosureModal,{opened:Wo,onClose:Ce,onDownload:Pe,contentType:Po?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var Xe=Object.defineProperty,ut=Object.defineProperties,Dt=Object.getOwnPropertyDescriptors,Nn=Object.getOwnPropertySymbols,ir=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,T0=(er,Qr,Yr)=>Qr in er?Xe(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,H0=(er,Qr)=>{for(var Yr in Qr||(Qr={}))ir.call(Qr,Yr)&&T0(er,Yr,Qr[Yr]);if(Nn)for(var Yr of Nn(Qr))xr.call(Qr,Yr)&&T0(er,Yr,Qr[Yr]);return er},G0=(er,Qr)=>ut(er,Dt(Qr));const no=(er,Qr,Yr,Li)=>{var io;const Mo=er.extension||[];if(Li?.[BUTTON_TYPE_EXTERNAL_KEY]&&Mo.some(eo=>eo.url===BUTTON_TYPE_EXTENSION_URL))return Li[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(er)||hasParentWithUIToolkitWidget(er,Qr))return null;if(Yr&&er.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const _o=getUIToolkitCode(Mo),Po=Mo.filter(eo=>eo.url.includes("questionnaire-itemControl")).flatMap(eo=>{var fa,Sr;return(Sr=(fa=eo.valueCodeableConcept)==null?void 0:fa.coding)!=null?Sr:[]})||[];let So;return Li&&(So=(io=Po.find(eo=>eo.code&&Li[eo.code]))==null?void 0:io.code),(So&&Li?Li[So]:void 0)||UI_TOOLKIT_WIDGET_MAP[_o||""]||typeToRenderFunctionMap[er.type]||null},Zi=er=>{var Qr;const{item:Yr,selectedAnswer:Li,handleInputChange:io,showQuestionPrefix:Mo,errors:_o,questionnaireSchemaItems:Po,formData:So,isNestedRepeatedItem:Wo=!1}=er,{linkId:eo,text:fa,prefix:Sr,required:ar,repeats:Tr}=Yr,Pe=getMaxOccursFromExtensions(Yr.extension),Ce=getPlaceholderFromExtensions(Yr.extension,Yr.type),[Fe,gt]=useState(()=>{if(Yr.type==="group"&&Yr.item&&Yr.item.length>0){const d0=So?.filter(Zr=>Zr.linkId===Yr.linkId)||[];if(d0.length>0)return d0.map((Zr,K0)=>K0)}else if(Li&&Li.length>0)return Li.map((d0,Zr)=>Zr);return[0]}),Gt=Pe!==void 0&&Fe.length>=Pe,tn=fa?getUpdatedQuestionText(Mo,Sr,fa):"",Ln=()=>{const d0=Math.max(...Fe,-1)+1,Zr=[...Fe,d0];if(gt(Zr),Yr.type==="group"&&Yr.item&&Yr.item.length>0){const K0=Yr.item.map(dt=>({linkId:dt.linkId,text:dt.text,answer:[{}]})),wi={linkId:Yr.linkId,text:Yr.text,answer:[{}],item:K0};io(Yr,void 0,[wi])}else{const K0=[...Li||[]];K0.push({}),io(Yr,K0)}},lr=d0=>{if(Fe.length<=1)return;const Zr=Fe.filter((K0,wi)=>wi!==Fe.length-1);if(gt(Zr),Yr.type==="group"&&Yr.item&&Yr.item.length>0){const K0=[];if(So?.forEach((wi,dt)=>{wi.linkId===eo&&K0.push({item:wi,originalIndex:dt})}),d0>=0&&d0<K0.length){const wi=K0[d0],dt=So?.filter((_t,En)=>En!==wi.originalIndex);io(Yr,void 0,dt,void 0,!0)}}else{const K0=Li?.filter((wi,dt)=>dt!==d0)||[];io(Yr,K0.length>0?K0:[{}])}},hn=d0=>{if(!So||!Yr.item)return[];const Zr=dt=>{const _t=[];for(const En of dt)if(En.linkId===Yr.linkId&&_t.push(En),En.item&&En.item.length>0){const Tn=Zr(En.item);_t.push(...Tn)}return _t},wi=Zr(So)[d0];return wi?.item?wi.item:[]},Zn=(d0,Zr)=>{if(isHiddenExtensionPresent(d0))return null;const K0=hn(Zr);if(!isQuestionEnabledForInstance(d0.enableWhen,d0.enableBehavior,So||[],Yr.linkId,Zr))return null;if(d0.repeats){const Tn=findNestedAnswer(K0,d0.linkId),tr=G0(H0({},er),{item:d0,selectedAnswer:Tn||[{}],errors:getInstanceErrors(_o,Yr,Zr),handleInputChange:(Hr,p0,ai)=>io(Hr,p0,ai,Zr)});return jsx("div",{children:jsx(Zi,G0(H0({},tr),{isNestedRepeatedItem:!0}))},d0.linkId)}if(d0.type==="group"&&d0.item&&!getUIToolkitCode(d0?.extension||[]))return jsxs("div",{children:[d0.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:d0.text}),jsx("div",{className:"space-y-3",children:d0.item.map(Tn=>{if(!isQuestionEnabledForInstance(Tn.enableWhen,Tn.enableBehavior,So||[],Yr.linkId,Zr))return null;const Hr=no(Tn,Po,er.isLoading,er.externalComponentRenderMap);if(!Hr)return null;const p0=findNestedAnswer(K0,Tn.linkId),ai=G0(H0({},er),{item:Tn,selectedAnswer:p0,placeholder:getPlaceholderFromExtensions(Tn.extension,Tn.type),errors:getInstanceErrors(_o,Yr,Zr),handleInputChange:(M0,Ni,q0)=>io(M0,Ni,q0,Zr)});return createElement(Hr,G0(H0({},ai),{key:Tn.linkId}))})})]},d0.linkId);const dt=no(d0,Po,er.isLoading,er.externalComponentRenderMap);if(!dt)return null;const _t=findNestedAnswer(K0,d0.linkId),En=G0(H0({},er),{item:d0,selectedAnswer:_t,placeholder:getPlaceholderFromExtensions(d0.extension,d0.type),errors:getInstanceErrors(_o,Yr,Zr),handleInputChange:(Tn,tr,Hr)=>io(Tn,tr,Hr,Zr)});return createElement(dt,G0(H0({},En),{key:`${d0.linkId}-${Zr}`}))},cn=()=>{const d0=getDirectErrors(_o,eo);return jsxs("div",{className:"flex flex-col gap-2",children:[d0[eo]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:d0[eo]}),!Gt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:Ln,className:"mt-4 text-center",isDisabled:er.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},Or=d0=>Fe.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>lr(d0),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${d0+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:er.isLoading}),Cr=no(Yr,Po,er.isLoading,er.externalComponentRenderMap);return hasRepeatingParent(Yr,Po)&&!Wo?null:!Tr||Tr&&hasCheckboxExtension(Yr)?Cr?jsx(Cr,G0(H0({},er),{placeholder:Ce,errors:{[Yr.linkId]:((Qr=_o?.[Yr.linkId])==null?void 0:Qr[0])||""}})):null:Yr.type==="group"&&Yr.item&&Yr.item.length>0&&Yr.repeats?jsxs("div",{"data-testid":`${eo}-repeating`,children:[tn&&jsx(FHIRQuestionnaireQuestionText,{text:tn,required:ar||!1}),Fe.map(d0=>{var Zr;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${d0>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",d0+1]}),Or(d0)]}),jsx("div",{className:"space-y-4",children:(Zr=Yr.item)==null?void 0:Zr.map(K0=>Zn(K0,d0))})]},`${eo}-instance-${d0}`)}),cn()]}):Cr?jsxs("div",{"data-testid":`${eo}-repeating`,children:[Fe.map(d0=>{const Zr=Li?.[d0]?[Li[d0]]:void 0,K0=G0(H0({},er),{item:Yr,selectedAnswer:Zr,errors:getInstanceErrors(_o,Yr,d0),handleInputChange:(wi,dt,_t)=>io(wi,dt,_t,d0)});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 ",d0+1]}),Or(d0)]}),jsx(Cr,H0({},K0))]},`${eo}-instance-${d0}`)}),jsxs("div",{children:[(()=>{const Zr=getDirectErrors(_o,eo)[eo];return Zr&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:Zr})})(),!Gt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:Ln,className:"mt-4 text-center",isDisabled:er.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var uo=Object.defineProperty,Do=Object.defineProperties,va=Object.getOwnPropertyDescriptors,Yo=Object.getOwnPropertySymbols,Oa=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Is=(er,Qr,Yr)=>Qr in er?uo(er,Qr,{enumerable:!0,configurable:!0,writable:!0,value:Yr}):er[Qr]=Yr,Sa=(er,Qr)=>{for(var Yr in Qr||(Qr={}))Oa.call(Qr,Yr)&&Is(er,Yr,Qr[Yr]);if(Yo)for(var Yr of Yo(Qr))Qa.call(Qr,Yr)&&Is(er,Yr,Qr[Yr]);return er},vs=(er,Qr)=>Do(er,va(Qr));const Vs=null,ts=({formId:er,questionnaireSchema:Qr,questionnaireResponseItem:Yr,errorConfig:Li,customErrorConfigurations:io,showQuestionPrefix:Mo=!0,isAdaptiveFlow:_o=!1,status:Po,hideBackButton:So=!1,showStepper:Wo=!1,onComplete:eo,onClearError:fa,handleHiddenQuestion:Sr,onGoBack:ar,onFormDataChange:Tr=()=>{},externalComponentRenderMap:Pe,children:Ce})=>{var Fe,gt;const{setHandleContinueButtonClick:Gt,setHandleBackButtonClick:tn,setIsCurrentFormValid:Ln,setCurrentGroupLinkId:lr,setCurrentGroupIndex:hn,setTotalSteps:Zn,setHideFooterButton:cn,setIsInlineNextQuestionTriggered:Or,isCurrentFormValid:Cr,currentGroupIndex:Vr,isLoading:d0,hasCustomError:Zr,groupItemIndicesRef:K0}=useFHIRQuestionnaire(),{trackEvent:wi}=useAnalytics(),[dt,_t]=useState([]),[En,Tn]=useState(new Set),[tr,Hr]=useState([]),[p0,ai]=useState([]),M0=K0,Ni=useRef(new Map),q0=useRef(new Set),[Ci,l0]=useState({}),[E0,pi]=useState(!1),[P0,Oo]=useState(Qr),ki=useRef(Yr||[]),Qo=useRef(!1),xo=useRef(!1),ya=useMemo(()=>getTotalStepsFromQuestionnaire(Qr),[Qr]),[ba,Ls]=useState(!1),Fs=useRef([]),Xo=(ji,_i)=>{var Vo,$i,ta,Ia,Fa;if(isCallNextQuestionExtensionPresent(ji))return ji.linkId;const Rr=validateCurrentPage(_i,dt,Vr,P0,M0),Kn=M0.current[Vr],n0=Vr+1,b1=M0.current[n0],_l=Vr===0?0:Kn,dl=($i=b1??((Vo=P0?.item)==null?void 0:Vo.length))!=null?$i:0;let ru=-1;for(let fi=_l;fi<dl;fi++){const _n=(ta=P0?.item)==null?void 0:ta[fi];if(_n?.linkId===ji.linkId){ru=fi;break}}const Dl=(fi,_n=[])=>(fi.forEach(go=>{var qo;if((!go.enableWhen||isQuestionEnabled(go.enableWhen,go.enableBehavior,_i))&&isCallNextQuestionExtensionPresent(go)&&!Fs.current.includes(go.linkId))if(go.required){const La=(qo=findResponseItem(_i,go.linkId))==null?void 0:qo.answer;(La&&La.length>0&&Object.keys(La[0]).length>0||go.initial&&go.initial.length>0&&!En.has(go.linkId))&&_n.push(go.linkId)}else _n.push(go.linkId);go.item&&go.item.length>0&&Dl(go.item,_n)}),_n),cu=[],au=ru!==-1?ru+1:dl;for(let fi=_l;fi<au;fi++){const _n=(Ia=P0?.item)==null?void 0:Ia[fi];_n&&Dl([_n],cu)}if(cu.length>0&&Rr){const fi=cu[cu.length-1],_n=La=>La.flatMap(h1=>[h1,...h1.item?_n(h1.item):[]]),go=_n((Fa=P0?.item)!=null?Fa:[]),qo=go.findIndex(La=>La.linkId===fi),Ya=go.findIndex(La=>La.linkId===ji.linkId);return qo!==-1&&Ya>qo?void 0:fi}},v1=ji=>Xo(ji,ki.current)?!0:ji.item&&ji.item.length>0?ji.item.some(v1):!1,Ys=()=>{var ji;if(!_o||Vr<0||!P0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const _i=M0.current[Vr],$i=(Ni.current.get(_i)||[_i]).some(Fa=>{var Rr;const Kn=(Rr=P0.item)==null?void 0:Rr[Fa];return Kn?v1(Kn):!1}),ta=Vr<M0.current.length-1;let Ia=!1;if($i&&ta){const Fa=Vr+1,Rr=M0.current[Fa],Kn=(ji=P0?.item)==null?void 0:ji[Rr],n0=!Kn?.enableWhen||isQuestionEnabled(Kn.enableWhen,Kn.enableBehavior,ki.current),b1=Kn?isPageExtensionPresent(Kn):!1;Ia=n0&&b1}return{shouldTriggerInlineLoading:$i,canNavigateToNextGroup:Ia,hasMoreGroups:ta}},ms=(ji,_i,Vo,$i)=>{const ta=getUpdatedFormData(P0?.item||[],ki.current,ji,_i,Vo,$i);return ki.current=ta,Tr(ta),ta},F1=(ji,_i,Vo,$i,ta)=>{ms(_i,Vo,$i,ta),$i.forEach(Ia=>{const Fa=getValidationError(vs(Sa({},ji),{linkId:Ia.linkId}),ki.current,Ia.answer);Fa&&l0(Rr=>vs(Sa({},Rr),{[Ia.linkId]:typeof ta=="number"?vs(Sa({},Rr[Ia.linkId]),{[ta]:Fa}):Fa}))})},Ar=(ji,_i,Vo,$i,ta)=>{var Ia;const Fa=ms(_i,Vo,$i,ta),Rr=(Ia=findResponseItem(Fa,_i))==null?void 0:Ia.answer,Kn=getValidationError(ji,ki.current,Rr);l0(n0=>vs(Sa({},n0),{[_i]:typeof ta=="number"?vs(Sa({},n0[_i]),{[ta]:Kn}):Kn}))},Yn=(ji,_i)=>{const Vo=validateCurrentPage(_i,dt,Vr,P0,M0);if(Ln(Vo),P0?.item){const $i=validateAllItemsRecursively(P0.item,_i);if(Object.keys($i).length>0)l0(ta=>Sa(Sa({},ta),$i));else{const ta=P0.item,Ia={},Fa=Rr=>{Rr.forEach(Kn=>{Ia[Kn.linkId]={},Kn.item&&Fa(Kn.item)})};Fa(ta),l0(Rr=>Sa(Sa({},Rr),Ia))}}},Pr=(ji,_i,Vo,$i,ta=!1)=>{var Ia;const{linkId:Fa}=ji;if(ta)return ki.current=Vo||[],Yn(Fa,Vo||[]),ki.current;if(Vo&&Vo.length>0&&ji.type==="group"&&ji.repeats){let b1=ki.current.length;for(let dl=ki.current.length-1;dl>=0;dl--)if(ki.current[dl].linkId===Fa){b1=dl+1;break}const _l=[...ki.current.slice(0,b1),...Vo,...ki.current.slice(b1)];return ki.current=_l,Yn(Fa,_l),ki.current}if(typeof $i=="number"&&_i){const b1=hasRepeatingParent(ji,P0?.item||[]);if(b1){const _l=ki.current.filter(ru=>ru.linkId===b1.linkId);if($i<_l.length){const ru=ki.current.map(Dl=>{if(Dl.linkId===b1.linkId&&ki.current.slice(0,ki.current.indexOf(Dl)).filter(au=>au.linkId===b1.linkId).length===$i){const au=(go,qo)=>{const Ya=new Map(go.map(h1=>[h1.linkId,h1])),La=[];return qo?.forEach(h1=>{const sl=Ya.get(h1.linkId);if(h1.linkId===Fa)La.push(Sa({linkId:h1.linkId,text:h1.text,answer:_i},sl?.item&&{item:sl.item}));else if(sl)if(h1.item&&h1.item.length>0){const Il=au(sl.item||[],h1.item);La.push(vs(Sa({},sl),{item:Il}))}else La.push(sl);else if(h1.item&&h1.item.length>0){const Il=au([],h1.item);Il.some(S1=>S1.linkId===Fa||S1.item&&fi(S1.item,Fa))&&La.push({linkId:h1.linkId,text:h1.text,answer:[{}],item:Il})}Ya.delete(h1.linkId)}),Ya.forEach(h1=>{La.push(h1)}),La},fi=(go,qo)=>go.some(Ya=>Ya.linkId===qo||Ya.item&&fi(Ya.item,qo)),_n=au(Dl.item||[],b1.item);return vs(Sa({},Dl),{item:_n})}return Dl});ki.current=ru,Tr(ru)}else{const ru=$i+1,Dl=_l.length;if(Dl<ru||ru===1){const cu=[],au=(go,qo,Ya)=>go.map(La=>{const h1={linkId:La.linkId,text:La.text,answer:La.linkId===qo?Ya:[{}]};return La.item&&La.item.length>0&&(h1.item=au(La.item,qo,Ya)),h1});for(let go=Dl;go<ru;go++){const qo=b1.item?au(b1.item,Fa,_i):[],Ya={linkId:b1.linkId,text:b1.text,answer:[{}],item:qo};cu.push(Ya)}let fi=ki.current.length;for(let go=ki.current.length-1;go>=0;go--)if(ki.current[go].linkId===b1.linkId){fi=go+1;break}const _n=[...ki.current.slice(0,fi),...cu,...ki.current.slice(fi)];ki.current=_n,Tr(_n)}}const dl=getValidationError(ji,ki.current,_i);return l0(ru=>vs(Sa({},ru),{[Fa]:typeof $i=="number"?vs(Sa({},ru[Fa]),{[$i]:dl}):dl})),Yn(Fa,ki.current),ki.current}}if(typeof $i=="number")return Vo&&Vo.length>0?F1(ji,Fa,_i,Vo,$i):Ar(ji,Fa,_i,Vo,$i),ki.current;const Rr=ms(Fa,_i,Vo),Kn=(Ia=findResponseItem(Rr,Fa))==null?void 0:Ia.answer,n0=getValidationError(ji,Rr,Kn);return l0(b1=>vs(Sa({},b1),{[Fa]:typeof $i=="number"?vs(Sa({},b1[Fa]),{[$i]:n0}):n0})),Yn(Fa,Rr),ki.current},sr=()=>{var ji;for(let _i=Vr+1;_i<M0.current.length;_i++){const Vo=M0.current[_i],$i=(ji=P0?.item)==null?void 0:ji[Vo];if(!!$i&&(!$i.enableWhen||isQuestionEnabled($i.enableWhen,$i.enableBehavior,ki.current)))return!0}return!1},Fr=()=>{var ji,_i,Vo,$i,ta;const Ia=(ji=Qr?.item)==null?void 0:ji[M0.current[Vr]];if(Ia){const Kn=(_i=getAnalyticsEventName(Ia))!=null?_i:"questionnaire_form",n0=getAnalyticsPageName(Ia);if(n0){const b1=(Vo=getAnalyticsFormName(Qr))!=null?Vo:Qr.name,_l=collectAnalyticsProperties(Ia,ki.current),dl={};b1&&(dl.form_name=b1),dl.page_name=n0,Object.assign(dl,_l),wi(Kn,dl)}}const Fa=Vr<M0.current.length-1,Rr=checkCurrentStepDataMatch(ki.current,P0,M0.current,Vr,Yr,M0.current.length-1);if(_o&&Fa){const Kn=Vr+1,n0=M0.current[Kn],b1=($i=P0?.item)==null?void 0:$i[n0],_l=!b1?.enableWhen||isQuestionEnabled(b1.enableWhen,b1.enableBehavior,ki.current),dl=b1?isPageExtensionPresent(b1):!1;if(_l&&dl&&Rr){hn(Kn),Ln(!1),window.scrollTo(0,0);return}}if(Rr&&M0.current.length>0){sr()?hn(Vr+1):(eo(removeDisabledItems(ki.current,P0?.item||[])),Ln(!1),window.scrollTo(0,0));return}if(Vr<M0.current.length-1){const Kn=(ta=P0?.item)==null?void 0:ta[M0.current[Vr]];if(!Kn){eo(removeDisabledItems(ki.current,P0?.item||[]));return}const n0=Kn.linkId,b1=findLastGroupInstanceIndex(ki.current,n0),_l=ki.current.slice(0,b1+1);if(!validateCurrentPage(_l,dt,Vr,P0,M0))return;_o?(ki.current=_l,Tr(_l),eo(ki.current),Ln(!1)):M0.current.length>0&&(sr()?hn(Vr+1):(eo(removeDisabledItems(ki.current,P0?.item||[])),window.scrollTo(0,0)))}else eo(removeDisabledItems(ki.current,P0?.item||[])),Ln(!1),window.scrollTo(0,0)};useEffect(()=>{var ji;Gt(()=>Fr),tn(()=>oo),Ln(Cr);const _i=(ji=P0?.item)==null?void 0:ji[M0.current[Vr]];_i&&lr(_i.linkId)},[Cr,Vr]),useEffect(()=>{if(!Qr?.item)return;const{groupIndices:ji,itemsToRenderMap:_i}=collectGroupItemIndices(Qr.item);M0.current=ji,Ni.current=_i;const Vo=ya??ji.length;Zn(Vo),Hr(ji),_o?(xo.current||hn(ji.length>0?ji.length-1:0),Or(!1),xo.current=!1):Vr===-1&&hn(0)},[Qr?.item,ya]),useEffect(()=>{if(Vr<0||!P0?.item)return;const ji=validateCurrentPage(ki.current,dt,Vr,P0,M0);if(!ji){Ln(!1);return}const{shouldTriggerInlineLoading:_i,canNavigateToNextGroup:Vo,hasMoreGroups:$i}=Ys();if(_o&&_i){if(!$i){Ln(!1);return}if(Vo&&ji){Ln(!0);return}else{Ln(!1);return}}Ln(ji)},[Vr,P0?.item,Zr,_o,ki.current,dt]),useEffect(()=>{if(!Qr?.item||Qo.current)return;const ji=initializeQuestionnaireItems(Qr.item,ki.current,Qr.item,ki.current);if(ji!==ki.current){ki.current=ji;const Vo=(ta=>{const Ia=new Set,Fa=Rr=>{Rr.forEach(Kn=>{var n0;const b1=Kn.initial&&Kn.initial.length>0,_l=(Kn.type==="choice"||Kn.type==="open-choice")&&((n0=Kn.answerOption)==null?void 0:n0.some(dl=>dl.initialSelected===!0));(b1||_l)&&(!Kn.enableWhen||isQuestionEnabled(Kn.enableWhen,Kn.enableBehavior,ki.current))&&Ia.add(Kn.linkId),Kn.item&&Fa(Kn.item)})};return Fa(ta),Ia})(P0?.item||[]);Tn(Vo);const $i=validateAllItemsRecursively(P0?.item||[],ki.current);Object.keys($i).length>0&&l0(ta=>Sa(Sa({},ta),$i))}Qo.current=!0},[P0?.item,Qr]),useEffect(()=>{Oo(Qr)},[Qr]),useEffect(()=>{Vr>=0&&window.scrollTo(0,0)},[Vr]),useEffect(()=>{var ji;if(!_o||dt.length===0||d0||!P0?.item)return;const _i=M0.current[Vr];if(_i===void 0)return;const Vo=Ni.current.get(_i)||[_i],$i=[];if(Vo.forEach(Kn=>{var n0;const b1=(n0=P0?.item)==null?void 0:n0[Kn];b1&&hasInitialValue(b1)&&$i.push(b1)}),$i.length===0||!$i.some(Kn=>Xo(Kn,ki.current)&&!Fs.current.includes(Kn.linkId)?(Fs.current.push(Kn.linkId),!0):!1))return;const Ia=validateCurrentPage(ki.current,dt,Vr,P0,M0),Fa=(ji=P0?.item)==null?void 0:ji[_i],Rr=isHiddenAnswerInValid(Fa,ki.current);!Ia||Rr||(q0.current.add(Vr),Or(!0),xo.current=!0,W0($i[$i.length-1].linkId))},[Vr,dt,_o,d0,P0]);const W0=(ji,_i=!1,Vo=!1)=>{var $i;if(_i){eo(removeDisabledItems(ki.current,P0?.item||[]),Vo),Ln(!1);return}const ta=findQuestionByLinkId(P0?.item||[],ji);if(!ta)return;const Ia=($i=findResponseItem(ki.current,ji))==null?void 0:$i.answer;if(getValidationError(ta,ki.current,Ia))return;const Fa=getUpdatedFormData(P0?.item||[],ki.current,ji,Ia),Rr=Xo(ta,Fa);if(!Rr)return;Ln(!1);const Kn=findRootGroupLinkId(P0?.item||[],ji);let n0=Fa,b1=[];const _l=deepTrimFormData(Fa,Rr,P0?.item||[]);n0=_l.trimmedData,b1=_l.trimmedLinkIds;const dl=findQuestionByLinkId(P0?.item||[],Kn||"");ki.current=n0;const ru=findGroupPositionByLinkId(P0?.item||[],ji||""),Dl=ru!==-1?ru:Vr;if(validateCurrentPage(n0,dt,Dl,P0,M0,b1)&&!isHiddenAnswerInValid(dl,n0)){Or(!0),xo.current=!0;let au;const fi=(()=>{var qo;const Ya=ks=>ks.flatMap(S1=>[S1,...S1.item?Ya(S1.item):[]]),La=Ya((qo=P0?.item)!=null?qo:[]),h1=La.findIndex(ks=>ks.linkId===Rr),sl=new Set;let Il=!0;for(;Il;){Il=!1;for(const ks of La){if(sl.has(ks.linkId)||!ks.enableWhen)continue;ks.enableWhen.some(z1=>{const Y1=La.findIndex(Xl=>Xl.linkId===z1.question);return Y1!==-1&&Y1<=h1||sl.has(z1.question)})&&(sl.add(ks.linkId),Il=!0)}}return b1.filter(ks=>!sl.has(ks))})();fi.length>0&&(au=removeItemsFromSchema(P0?.item||[],fi),Oo(vs(Sa({},P0),{item:au})));const go=((qo,Ya)=>{const La=[];let h1=!1;const sl=Il=>{for(const ks of Il)h1?(La.push(ks.linkId),ks.item&&sl(ks.item)):ks.linkId===Ya?h1=!0:ks.item&&sl(ks.item)};return sl(qo),La})(P0?.item||[],Rr);go.length>0&&(Fs.current=Fs.current.filter(qo=>!go.includes(qo)),Tn(qo=>{const Ya=new Set(qo);return go.forEach(La=>Ya.delete(La)),Ya})),Fs.current.push(Rr),eo(removeDisabledItems(n0,P0?.item||[]),!0,au)}},Q0=(ji,_i,Vo=!1)=>{const $i=updateItemWithReadOnlyExpression(ji,P0),ta={item:$i,selectedAnswer:_i,handleInputChange:Pr,showQuestionPrefix:Mo,onCompleteHandler:W0,errors:Ci,isLoading:d0,isCurrentFormValid:Cr,contained:P0?.contained,questionnaireSchemaItems:P0?.item,customErrorConfigurations:io,formData:ki.current,showStepper:Wo,totalStepsFromExtension:ya,externalComponentRenderMap:Pe,hintText:getHintTextFromExtensions($i.extension)};if(typeof Sr=="function"&&Vo)Sr(ji,ta,ki.current);else if(ji.type in typeToRenderFunctionMap&&!Vo)return dt.includes(ji.linkId)||_t(Ia=>[...Ia,ji.linkId]),jsx(RenderFHIRQuestionnaireItem,Sa({},ta),ji.linkId);return null},It=ji=>ji.map(_i=>{var Vo,$i;const ta=isHiddenExtensionPresent(_i);let Ia=(Vo=findResponseItem(ki.current,_i.linkId))==null?void 0:Vo.answer;if((!Ia||Object.keys(($i=Ia?.[0])!=null?$i:{}).length===0)&&!En.has(_i.linkId)){if(_i.initial&&_i.initial.length>0)Ia=_i.initial,Tn(Fa=>new Set(Fa).add(_i.linkId));else if((_i.type==="choice"||_i.type==="open-choice")&&_i.answerOption){const Fa=_i.answerOption.filter(Rr=>Rr.initialSelected===!0);Fa.length>0&&(Ia=Fa.map(Rr=>{let Kn={};return Rr.valueCoding?Kn={valueCoding:{code:Rr.valueCoding.code,display:Rr.valueCoding.display,system:Rr.valueCoding.system}}:Rr.valueReference&&(Kn={valueReference:{reference:Rr.valueReference.reference,display:Rr.valueReference.display}}),Kn}).filter(Rr=>Object.keys(Rr).length>0),Tn(Rr=>new Set(Rr).add(_i.linkId)))}Ia&&(ki.current=getUpdatedFormData(P0?.item||[],ki.current,_i.linkId,Ia))}if(!_i?.enableWhen||isQuestionEnabled(_i?.enableWhen,_i.enableBehavior,ki.current)){const Fa=Vs.includes(_i.linkId)||getUIToolkitCode(_i.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[Q0(_i,Ia,ta),_i.item&&!ta&&(Fa?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:It(_i.item)})}):It(_i.item))]},_i.linkId)}else if(_i.type==="group"&&!ta)return p0.includes(_i.linkId)||(ya===void 0&&Zn(M0.current.length-1||-1),M0.current=M0.current.filter((Fa,Rr)=>Rr!==Vr),ai(Fa=>[...Fa,_i.linkId])),null});if(Vr>=0){const ji=[];let _i=0,Vo=0;for(;_i<tr.length&&Vo<M0.current.length;){const $i=tr[_i],ta=M0.current[Vo];if($i<ta){const Ia=(Fe=P0?.item)==null?void 0:Fe[$i];(!Ia?.enableWhen||isQuestionEnabled(Ia.enableWhen,Ia.enableBehavior,ki.current))&&ji.push(_i),_i++}else $i===ta&&_i++,Vo++}for(;_i<tr.length;){const $i=tr[_i],ta=(gt=P0?.item)==null?void 0:gt[$i];(!ta?.enableWhen||isQuestionEnabled(ta.enableWhen,ta.enableBehavior,ki.current))&&ji.push(_i),_i++}if(ji.length>0){ya===void 0&&Zn(M0.current.length+ji.length),ji.reverse().forEach(ta=>{const Ia=tr[ta];let Fa=0;for(let Rr=0;Rr<M0.current.length;Rr++){if(M0.current[Rr]>Ia){Fa=Rr;break}Fa=Rr+1}M0.current.splice(Fa,0,Ia)});const $i=ji.map(ta=>{var Ia;const Fa=tr[ta],Rr=(Ia=P0?.item)==null?void 0:Ia[Fa];return Rr?.linkId}).filter(Boolean);ai(ta=>ta.filter(Ia=>!$i.includes(Ia)))}tr.forEach($i=>{var ta;const Ia=(ta=P0?.item)==null?void 0:ta[$i];Ia?.enableWhen&&!isQuestionEnabled(Ia.enableWhen,Ia.enableBehavior,ki.current)&&ki.current.some(Rr=>Rr.linkId===Ia.linkId)&&(ki.current=removeAnswerFromFormData(ki.current,Ia.linkId))})}const oo=()=>{var ji;if(Li&&!E0&&Vr>0&&Po!=="completed")hn(M0.current.length-1),pi(!0),cn(!1),fa?.();else if(Vr>0&&Po!=="completed"){let _i=Vr-1;for(;_i>0;){const Vo=M0.current[_i],$i=(ji=P0?.item)==null?void 0:ji[Vo];if(!$i?.enableWhen||isQuestionEnabled($i.enableWhen,$i.enableBehavior,ki.current))break;_i--}hn(_i),Ln(!0),cn(!1),fa?.()}else ar?.()},Co=ji=>ji.preventDefault();return useEffect(()=>{const ji=setTimeout(()=>{Ls(!0)},0);return()=>clearTimeout(ji)},[]),ba?jsxs(Fragment,{children:[jsxs("form",{id:er,className:"w-full","data-testid":"questionnaire-form",onSubmit:Co,children:[!So&&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:()=>oo(),onKeyDown:ji=>{(ji.key==="Enter"||ji.key===" ")&&oo()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Li&&!E0?jsx(EmptyState,{className:"mt-5xl",title:Li.title,description:Li.description,featuredIconProps:{icon:Li.icon,color:"gray"},primaryButton:Li.primaryButton,secondaryButton:Li.secondaryButton?vs(Sa({},Li.secondaryButton),{onClick:oo}):void 0}):jsxs(Fragment,{children:[!P0?.item&&d0&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),P0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:It(Vr>=0?P0.item.filter((ji,_i)=>{const Vo=M0.current[Vr];return(Ni.current.get(Vo)||[Vo]).includes(_i)}):P0?.item||[])})]})]}),Qo.current&&Ce]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Z,l,e)=>{"use strict";e.d(l,{l:()=>b});var n=e(31085),t=e(14041),r=e(36087),s=e(69364),i=e(25624),o=e(18522),a=Object.defineProperty,g=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,m=(h,f,v)=>f in h?a(h,f,{enumerable:!0,configurable:!0,writable:!0,value:v}):h[f]=v,d=(h,f)=>{for(var v in f||(f={}))y.call(f,v)&&m(h,v,f[v]);if(u)for(var v of u(f))A.call(f,v)&&m(h,v,f[v]);return h},O=(h,f)=>g(h,c(f));const p=({selected:h,onClick:f,icon:v,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",h?"bg-utility-accent-500/20":"bg-gray-100",h?"text-accent-800":"text-quaternary"),children:v}),(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":h?"border-blue-700 bg-white":"border-gray-100 bg-white",!z&&!h&&"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":!!h,children:T})},b=({item:h,handleInputChange:f,formData:v,isLoading:M})=>{const{incrementCustomErrorCount:x,decrementCustomErrorCount:z}=(0,o.c)(),T=(0,t.useMemo)(()=>{var w;return(w=h.item)!=null?w:[]},[h.item]),S=h.readOnly===!0,E=(0,t.useMemo)(()=>T.filter(w=>!w.enableWhen||(0,i.GN)(w.enableWhen,w.enableBehavior,v??[])),[T,v]),C=(0,t.useMemo)(()=>T.filter(w=>w.enableWhen&&!(0,i.GN)(w.enableWhen,w.enableBehavior,v??[])),[T,v]),R=w=>{var N,F;if(!v)return!1;const q=(0,i.MU)(v,w);return((F=(N=q?.answer)==null?void 0:N[0])==null?void 0:F.valueBoolean)===!0},L=(0,t.useMemo)(()=>E.some(w=>R(w.linkId)),[E,v]),P=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||E.length===0){P.current&&(z(),P.current=!1);return}!L&&!P.current?(x(),P.current=!0):L&&P.current&&(z(),P.current=!1)},[L,S,E.length,x,z]),(0,t.useEffect)(()=>{C.forEach(w=>{var N,F;const q=v?(0,i.MU)(v,w.linkId):void 0;(!q||((F=(N=q.answer)==null?void 0:N[0])==null?void 0:F.valueBoolean)!==!1)&&f(w,[{valueBoolean:!1}])})},[C]),(0,t.useEffect)(()=>()=>{P.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:E.map(w=>{var N,F,q,I;const k=R(w.linkId),U=(N=w.extension)==null?void 0:N.find(oe=>oe.url===s.g4),$=(F=w.extension)==null?void 0:F.find(oe=>oe.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(q=$?.valueString)!=null?q:"";return(0,n.jsx)(p,{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:(Z,l,e)=>{"use strict";e.d(l,{v:()=>o});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const i=({selected:a,onClick:g,label:c,readOnly:u})=>{const y=(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:y,children:c}):(0,n.jsx)("button",{type:"button",onClick:g,className:y,"aria-pressed":!!a,children:c})},o=({item:a,handleInputChange:g,formData:c})=>{var u;const y=(u=a.item)!=null?u:[],A=a.readOnly===!0,m=O=>{var p,b;if(!c)return!1;const h=(0,s.MU)(c,O);return((b=(p=h?.answer)==null?void 0:p[0])==null?void 0:b.valueBoolean)===!0},d=O=>{const p=m(O.linkId);g(O,[{valueBoolean:!p}])};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:y.map(O=>{var p;const b=m(O.linkId);return(0,n.jsx)(i,{label:(p=O.text)!=null?p:"",selected:b,readOnly:A,onClick:A?void 0:()=>d(O)},O.linkId)})})]})}},18522:(Z,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(b,h,f)=>h in b?i(b,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):b[h]=f,A=(b,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(b,f,h[f]);if(g)for(var f of g(h))u.call(h,f)&&y(b,f,h[f]);return b},m=(b,h)=>o(b,a(h));const d=(0,t.createContext)(void 0),O=()=>{const b=(0,t.useContext)(d);if(!b)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return b},p=({children:b,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[v,M]=useState(null),[x,z]=useState(null),[T,S]=useState(!1),[E,C]=useState(null),[R,L]=useState(-1),[P,D]=useState(!1),[w,N]=useState(-1),[F,q]=useState(!1),[I,k]=useState(0),[U,$]=useState(!1),[K,G]=useState(!1),oe=useRef([]),se=()=>{k(ne=>ne+1)},ie=useCallback(ne=>{$(ne)},[]),me=()=>{k(ne=>Math.max(0,ne-1))},ye=I>0,Te=useCallback((ne,ae,he)=>{if(!h)return;const pe=h[ne];if(!pe)return;let fe;if(Array.isArray(pe))if(he)fe=pe.find(ze=>ze.inputType===he);else{console.warn(`Multiple analytics configs found for linkId "${ne}" but no inputType provided. Skipping tracking.`);return}else{if(he&&pe.inputType&&pe.inputType!==he)return;fe=pe}if(!fe)return;let ue=A({},ae);fe.valueTransform&&(ue=Object.keys(ae).reduce((ze,De)=>{var Se;const Ie=(Se=fe.valueTransform)==null?void 0:Se[De];return ze[De]=Ie?applyValueTransform(ae[De],Ie):ae[De],ze},{}));let te=A({},ue);fe.propertyMapping&&(te=Object.keys(ue).reduce((ze,De)=>{var Se;const Ie=((Se=fe.propertyMapping)==null?void 0:Se[De])||De;return ze[Ie]=ue[De],ze},{}));const J=fe.eventName,ge=fe.description;f(J,m(A(A({},te),fe.properties),{_event_metadata:ge?{description:ge}:void 0}))},[h,f]),ve={isCurrentFormValid:T,currentGroupLinkId:E,currentGroupIndex:R,hideFooterButton:P,totalSteps:w,isLoading:F,isInlineNextQuestionTriggered:K,hasCustomError:ye,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:v,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:C,setCurrentGroupIndex:L,setHideFooterButton:D,setTotalSteps:N,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:se,decrementCustomErrorCount:me,trackQuestionnaireEvent:Te,setHasExternalError:ie,groupItemIndicesRef:oe};return jsx(d.Provider,{value:ve,children:b})}},35473:(Z,l,e)=>{"use strict";var n=e(28058),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 i=e(25624),o=e(69364),a=e(7630),g=e(72866)},61388:(Z,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:i,onActionButtonClick:o,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}),i&&o&&(0,n.jsx)(t.Button,{color:"link-color",onClick:o,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:i})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Z,l,e)=>{"use strict";e.d(l,{d:()=>i});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const i=({infoDetails:o,className:a})=>{const{redirectToBook:g,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(d,O,p)=>{d.preventDefault(),O.linkType==="phone"?g(p):O.linkType==="address"?c({address:p}):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:p=>y(p,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:o.map((d,O)=>{const p=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(p,{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 b=Array.isArray(d.value)?d.value:[d.value];return b.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:b.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(h,d)},f))}):m(b[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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),i=e(76808),o=e(92094),a=e(5380),g=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,A=Object.defineProperties,m=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,b=(x,z,T)=>z in x?y(x,z,{enumerable:!0,configurable:!0,writable:!0,value:T}):x[z]=T,h=(x,z)=>{for(var T in z||(z={}))O.call(z,T)&&b(x,T,z[T]);if(d)for(var T of d(z))p.call(z,T)&&b(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),v=(x,z,T)=>new Promise((S,E)=>{var C=P=>{try{L(T.next(P))}catch(D){E(D)}},R=P=>{try{L(T.throw(P))}catch(D){E(D)}},L=P=>P.done?S(P.value):Promise.resolve(P.value).then(C,R);L((T=T.apply(x,z)).next())});const M=({setLocationUpdating:x,title:z,description:T,isOpen:S,onClose:E})=>{const{locationPermission:C,position:R,requestPosition:L,setLocationPermission:P}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:w,setQueryParams:N}=(0,g.i)(),[F,q]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),k=S!==void 0?S:F;(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)(ye=>{N(f(h({},w),{location:ye,locationType:a.iF.CURRENT_LOCATION,locationPermission:C||""}))},[C,w,N]),$=(0,t.useCallback)(()=>{S===void 0&&(!C||[a.Ef.GRANTED].includes(C)&&I.get()||[a.Ef.PROMPT].includes(C)&&I.get()&&R||q([a.Ef.PROMPT,a.Ef.GRANTED].includes(C)))},[S,C,I,R]);(0,t.useEffect)(()=>{$()},[$]);const K=(0,i.Ul)(),G=(0,t.useCallback)(()=>v(void 0,null,function*(){x&&x(!0);let ye;try{ye=yield L(),ye&&U&&U(`${ye.coords.latitude},${ye.coords.longitude}`)}catch(Te){Te instanceof Error?K?.error(Te,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Te)}`),S!==void 0&&E?E():q(!1)}return x&&x(!1),!!ye}),[K,U,L,x,S,E]),oe=(0,t.useCallback)(()=>v(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&&E?E():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,E,I,G]),se=(0,t.useCallback)(ye=>{D("location_permissions_cta_clicked",{click:ye==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),P(a.Ef.DENIED),N(f(h({},w),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&E?E():q(!1)},[D,P,N,w,I,S,E]),ie=(0,t.useCallback)(()=>se("close"),[se]),me=(0,t.useCallback)(()=>se("cancel"),[se]);return(0,n.jsx)(o.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:ie},primaryButton:{children:"Use my current location",onClick:oe},secondaryButton:{children:"Search another way",onClick:me}})}},35471:(Z,l,e)=>{"use strict";var n=e(26877)},98741:(Z,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(y,A,m)=>A in y?r(y,A,{enumerable:!0,configurable:!0,writable:!0,value:m}):y[A]=m,g=(y,A)=>{for(var m in A||(A={}))i.call(A,m)&&a(y,m,A[m]);if(s)for(var m of s(A))o.call(A,m)&&a(y,m,A[m]);return y};const c=y=>{if(!y||typeof y!="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(y)},u=({animationData:y,loop:A=!0,autoplay:m=!0,className:d=""})=>{const O=useRef(null),p=useRef(null);return useEffect(()=>{if(!!O.current){try{const b=c(y);p.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:b})}catch(b){console.error("Failed to load Lottie animation:",b)}return()=>{var b;(b=p.current)==null||b.destroy()}}},[y,A,m]),jsx("div",{ref:O,className:d})}},81304:(Z,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const i=y=>y*1609.34;var o=e(27419);const a={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var g=e(92469);const c=({center:y,isLoading:A=!1,searchRadius:m,className:d,height:O="350px",width:p="100%",googleMapsApiKey:b})=>{const h=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:b||""}),v={height:typeof O=="number"?`${O}px`:O,width:typeof p=="number"?`${p}px`:p},M=(0,t.useCallback)(z=>{google.maps.event.addListenerOnce(z,"idle",()=>{if(m&&y.lat&&y.lng){const S=new google.maps.Circle({center:{lat:y.lat,lng:y.lng},radius:i(m)}).getBounds();S&&z.fitBounds(S,0)}})},[y,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,o.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:v,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,o.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:v,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("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,o.cx)("overflow-hidden rounded-lg",d),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:v,onLoad:M,options:x,zoom:12,children:(0,n.jsx)(g.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Z,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:(Z,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:(Z,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:o,profileUrl:a,subTitle:g,variant:c="default",showChevron:u=!0,onClick:y,pendingText:A})=>{const m=!!A,d=!m&&!!y,O=u&&d;return jsxs("button",{type:"button",onClick:d?y: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:o,size:"md",initials:getInitials(o),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:o}),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"})]})},i=()=>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:(Z,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:i,fullImageHeader:o=!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:[o?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}),i&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:i})]}),s]})]})}),r=null},51254:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:i,icon:o})=>{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:o.icon,color:(a=o.color)!=null?a:"brand",size:"lg",className:o.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),i&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:i})]})]})}},69092:()=>{},33457:(Z,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:(Z,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:Lt="currentColor",...mn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Ye,height:Ye,stroke:Lt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...mn},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 i=e(14449),o=e(14711),a=e(58139),g=e(37121),c=e(43144);function u(Ye){Ye()}let y=null;const A=Ye=>y=Ye,m=()=>y,d=(0,r.createContext)(null),O=null;function p(){return(0,r.useContext)(d)}let h=()=>{throw new Error("uSES not initialized!")};const f=Ye=>{h=Ye},v=(Ye,Lt)=>Ye===Lt;function M(Ye=d){const Lt=Ye===d?p:()=>(0,r.useContext)(Ye);return function(Sn,et=v){const{store:Rt,subscription:Ht,getServerState:Un}=Lt(),Mr=h(Ht.addNestedSub,Rt.getState,Un||Rt.getState,Sn,et);return(0,r.useDebugValue)(Mr),Mr}}const x=M();var z=e(75985),T=e(524);function S(){const Ye=getBatch();let Lt=null,mn=null;return{clear(){Lt=null,mn=null},notify(){Ye(()=>{let Sn=Lt;for(;Sn;)Sn.callback(),Sn=Sn.next})},get(){let Sn=[],et=Lt;for(;et;)Sn.push(et),et=et.next;return Sn},subscribe(Sn){let et=!0,Rt=mn={callback:Sn,next:null,prev:mn};return Rt.prev?Rt.prev.next=Rt:Lt=Rt,function(){!et||Lt===null||(et=!1,Rt.next?Rt.next.prev=Rt.prev:mn=Rt.prev,Rt.prev?Rt.prev.next=Rt.next:Lt=Rt.next)}}}}const E={notify(){},get:()=>[]};function C(Ye,Lt){let mn,Sn=E;function et(cr){return Mr(),Sn.subscribe(cr)}function Rt(){Sn.notify()}function Ht(){In.onStateChange&&In.onStateChange()}function Un(){return Boolean(mn)}function Mr(){mn||(mn=Lt?Lt.addNestedSub(Ht):Ye.subscribe(Ht),Sn=S())}function gn(){mn&&(mn(),mn=void 0,Sn.clear(),Sn=E)}const In={addNestedSub:et,notifyNestedSubs:Rt,handleChangeWrapper:Ht,isSubscribed:Un,trySubscribe:Mr,tryUnsubscribe:gn,getListeners:()=>Sn};return In}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L=null,P=null;let D=null;const w=Ye=>{D=Ye},N=null,F=null,q=Ye=>{try{return JSON.stringify(Ye)}catch{return String(Ye)}};function I(Ye,Lt,mn){useIsomorphicLayoutEffect(()=>Ye(...Lt),mn)}function k(Ye,Lt,mn,Sn,et,Rt){Ye.current=Sn,mn.current=!1,et.current&&(et.current=null,Rt())}function U(Ye,Lt,mn,Sn,et,Rt,Ht,Un,Mr,gn,In){if(!Ye)return()=>{};let cr=!1,Dn=null;const $r=()=>{if(cr||!Un.current)return;const wt=Lt.getState();let Ve,ot;try{Ve=Sn(wt,et.current)}catch(Je){ot=Je,Dn=Je}ot||(Dn=null),Ve===Rt.current?Ht.current||gn():(Rt.current=Ve,Mr.current=Ve,Ht.current=!0,In())};return mn.onStateChange=$r,mn.trySubscribe(),$r(),()=>{if(cr=!0,mn.tryUnsubscribe(),mn.onStateChange=null,Dn)throw Dn}}const $=()=>N;function K(Ye,Lt){return Ye===Lt}let G=!1;function oe(Ye,Lt,mn,{pure:Sn,areStatesEqual:et=K,areOwnPropsEqual:Rt=shallowEqual,areStatePropsEqual:Ht=shallowEqual,areMergedPropsEqual:Un=shallowEqual,forwardRef:Mr=!1,context:gn=ReactReduxContext}={}){const In=gn,cr=mapStateToPropsFactory(Ye),Dn=mapDispatchToPropsFactory(Lt),$r=mergePropsFactory(mn),qr=Boolean(Ye);return Ve=>{const ot=Ve.displayName||Ve.name||"Component",Je=`Connect(${ot})`,tt={shouldHandleStateChanges:qr,displayName:Je,wrappedComponentName:ot,WrappedComponent:Ve,initMapStateToProps:cr,initMapDispatchToProps:Dn,initMergeProps:$r,areStatesEqual:et,areStatePropsEqual:Ht,areOwnPropsEqual:Rt,areMergedPropsEqual:Un};function rt(st){const[le,Oe,We]=useMemo(()=>{const{reactReduxForwardedRef:Rn}=st,Pn=_objectWithoutPropertiesLoose(st,P);return[st.context,Rn,Pn]},[st]),Ee=useMemo(()=>le&&le.Consumer&&isContextConsumer(React.createElement(le.Consumer,null))?le:In,[le,In]),yt=useContext(Ee),Xt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),vn=Boolean(yt)&&Boolean(yt.store),Vn=Xt?st.store:yt.store,gr=vn?yt.getServerState:Vn.getState,Bt=useMemo(()=>defaultSelectorFactory(Vn.dispatch,tt),[Vn]),[we,Ze]=useMemo(()=>{if(!qr)return F;const Rn=createSubscription(Vn,Xt?void 0:yt.subscription),Pn=Rn.notifyNestedSubs.bind(Rn);return[Rn,Pn]},[Vn,Xt,yt]),At=useMemo(()=>Xt?yt:_extends({},yt,{subscription:we}),[Xt,yt,we]),en=useRef(),nn=useRef(We),fn=useRef(),pt=useRef(!1),Yt=useRef(!1),qt=useRef(!1),Pt=useRef();useIsomorphicLayoutEffect(()=>(qt.current=!0,()=>{qt.current=!1}),[]);const $t=useMemo(()=>()=>fn.current&&We===nn.current?fn.current:Bt(Vn.getState(),We),[Vn,We]),Zt=useMemo(()=>Pn=>we?U(qr,Vn,we,Bt,nn,en,pt,qt,fn,Ze,Pn):()=>{},[we]);I(k,[nn,en,pt,We,fn,Ze]);let Mn;try{Mn=D(Zt,$t,gr?()=>Bt(gr(),We):$t)}catch(Rn){throw Pt.current&&(Rn.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.1089.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.12.3"},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.1336.1",D="@icanbwell/composite. repo version: 0.1336.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.1089.2",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.12.3"},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.1336.2",D="@icanbwell/composite. repo version: 0.1336.2",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.1089.1",
3
+ "version": "1.1089.2",
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.1336.1",
47
- "description": "@icanbwell/composite. repo version: 0.1336.1"
46
+ "repoVersion": "0.1336.2",
47
+ "description": "@icanbwell/composite. repo version: 0.1336.2"
48
48
  }