@icanbwell/composite 1.1126.0 → 1.1127.1
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.
- package/index.js +1 -1
- package/native.js +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -866,7 +866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
866
866
|
<div class="wrapper">
|
|
867
867
|
<bwell-error-component />
|
|
868
868
|
</div>
|
|
869
|
-
`}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},_e=({src:Xt,elementNameSuffix:Kt,version:Ct,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var We,yt,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Ar,mn,Ln,fr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Fn=`bwell-${Kt}`;if(customElements.get(Fn)!==void 0)return;class Wr extends f{constructor(){super(),We.add(this),yt.set(this,(0,S.nanoid)()),Ye.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Pt.set(this,new I.EventEmitter),hn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),kt.set(this,void 0),Bn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:$e,container:ot,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Bn,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Pt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,hn,(0,p.__classPrivateFieldGet)(this,We,"m",Ar).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,We,"m",mn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,We,"m",fr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,We,"m",fr).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,yt,this.id||(0,p.__classPrivateFieldGet)(this,yt,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,yt,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,hn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,hn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Xt).catch(()=>{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,p.__classPrivateFieldGet)(this,Pt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(It=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||It===void 0||It.deregister(),(0,p.__classPrivateFieldGet)(this,Pt,"f").removeAllListeners()}}yt=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Pt=new WeakMap,hn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,kt=new WeakMap,Bn=new WeakMap,We=new WeakSet,Ar=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${Fn}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Xt),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,yt,"f"),name:Kt,elementName:Fn,utils:(0,p.__classPrivateFieldGet)(this,Bn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},mn=function({visibility:It,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=It==="hidden"?"unset":"hidden"},Ln=function(It){(0,p.__classPrivateFieldGet)(this,kt,"f")(),(0,p.__classPrivateFieldSet)(this,kt,void 0,"f")},fr=function(It){return $e=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,kt,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It),(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlotLocked(xe[It]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,kt,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Fn,Wr)}),at={rE:"1.1126.0"},pt="composite";var xt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${pt}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:pt,version:at.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),o=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(v,p,h)=>p in v?o(v,p,{enumerable:!0,configurable:!0,writable:!0,value:h}):v[p]=h,A=(v,p)=>{for(var h in p||(p={}))c.call(p,h)&&y(v,h,p[h]);if(g)for(var h of g(p))u.call(p,h)&&y(v,h,p[h]);return v},m=(v,p)=>i(v,a(p));const d=(v,p,h)=>{const f=_.cloneDeep(v);if(!f.contained||p<0)return f;const b=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(b!==-1&&!h){const M=f.contained[b];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===p+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[b]=M}}else h&&b!==-1&&(f.contained[b]=m(A({},f.contained[b]),{item:h}));return f},O=({formId:v,questionnaireResponse:p,showQuestionPrefix:h,nextQuestion:f,onGoBack:b,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),q=(P=p.questionnaire)==null?void 0:P.replace("#",""),I=(D=p?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(p);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:v,onFormDataChange:C,questionnaireResponseItem:(N=p?.item)!=null?N:[],questionnaireSchema:I,status:p.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:b,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,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,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(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,b=({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"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,oe]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[de,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Kt=>{var Ct,Xe;const We=(Xe=(Ct=Kt.placeAutocomplete)==null?void 0:Ct.predictions)==null?void 0:Xe.map(yt=>{var Ye;return{id:yt.placeId,label:(0,s.removeAfterLastComma)(yt.description),mainText:yt?.mainText||((Ye=yt.description.split(",")[0])==null?void 0:Ye.trim()),secondaryText:(0,s.removeAfterLastComma)(yt?.secondaryText||yt.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Kt=>p(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,be]),ze=Kt=>h(void 0,null,function*(){var Ct,Xe,We,yt,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Ar,mn,Ln;if(F(Kt),G(Kt),oe(!1),Kt&&typeof Kt=="string"){const fr=be.find(tt=>tt.id===Kt),Fn=fr?.label||V;if(!fr)return;q(Fn),k(Fn),setTimeout(()=>{const tt=[{id:fr.id,label:fr.label}];Se(tt),ne(tt)},f);const Wr=yield ae({variables:{placeId:Kt}}),Yr=(Xe=(Ct=Wr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(yt=(We=Wr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:yt.longitude,$e=((Qe=(Ye=Wr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",ot=((hn=(Pt=Wr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",Je=((et=(Sn=Wr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Yr&&It)if(!$e||!Je){const tt=yield de({variables:{latitude:String(Yr),longitude:String(It)}}),rt=((kt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",lt=((Ar=(Bn=tt?.data)==null?void 0:Bn.geocodingByLatLon)==null?void 0:Ar.state)||"",Et=((Ln=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Yr,longitude:It,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Fn,value:Kt})}else T({latitude:Yr,longitude:It,zipCode:$e,state:ot,stateCode:Je,placeId:Kt,description:Fn,value:Kt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),_e=Kt=>h(void 0,null,function*(){if(oe(!1),q(Kt),z?.(Kt),!Kt||Kt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Kt});return}const Ct=Kt.trim();Ct.length>=2?yield xe(Ct):Se(pe)}),at=Kt=>{te.current=Kt},pt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ct,Xe,We,yt,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Ar,mn,Ln;if(N&&w){Se([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),F(N),G(N),q(w),k(w),w===V&&q(w);const fr=yield ae({variables:{placeId:N}}),Fn=(Xe=(Ct=fr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Wr=(yt=(We=fr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:yt.longitude,Yr=((Qe=(Ye=fr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",It=((hn=(Pt=fr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",$e=((et=(Sn=fr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Fn&&Wr)if(!Yr||!It||!$e){const ot=yield de({variables:{latitude:String(Fn),longitude:String(Wr)}}),Je=((kt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",tt=((Ar=(Bn=ot?.data)==null?void 0:Bn.geocodingByLatLon)==null?void 0:Ar.state)||"",rt=((Ln=(mn=ot?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Fn,longitude:Wr,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Fn,longitude:Wr,zipCode:Yr,state:It,stateCode:$e,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const xt=se||!!he||!!re||!!Ee||!!R,Xt=xt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:at,onBlur:pt,isInvalid:xt,hint:Xt,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Ct=Kt,Xe=V.trim().length>=2,We=Ct.mainText||"",yt=Ct.secondaryText||"",Ye=We.trim().length>0,Qe=yt.trim().length>0,Pt=Ye?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},hn=Qe?(0,r.RZ)(yt,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Ct.id,supportingText:Ct.supportingText,isDisabled:Ct.isDisabled,icon:Ct.icon,avatarUrl:Ct.avatarUrl,textValue:Ct.label,children:Xe&&Ye?(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:Pt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Pt.highlightedPart}),(0,n.jsx)("span",{children:Pt.remainingPart})]}),Qe&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:hn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:hn.highlightedPart}),(0,n.jsx)("span",{children:hn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ct.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:i})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(52449);const i=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(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,v=Object.getOwnPropertySymbols,p=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,b=(C,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(C,L,R[L]);if(v)for(var L of v(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 N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((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,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},q.current),{locationPermission:ve||i.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,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]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==i.Ef.GRANTED&&Ee!==i.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(L==="Android"&&Ee===i.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}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(Ee!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,P,L,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),de=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(i.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,P,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),w(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,w,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:de,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,de,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},76260:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>It,GI:()=>K,rz:()=>yt,Fp:()=>We,el:()=>Xe,ao:()=>Ct,oA:()=>S,Yt:()=>$e,g4:()=>Kt,tn:()=>rt,n4:()=>E,gD:()=>T,Vp:()=>Wr,Cx:()=>D,bK:()=>L,gi:()=>Yr,Z$:()=>be,GT:()=>Fn,hr:()=>Se,JL:()=>ge,Ck:()=>P,dU:()=>R,wG:()=>Rt,hZ:()=>Sn,$e:()=>Ye,qT:()=>hn,GQ:()=>Pt,q3:()=>et,D_:()=>Qe,Uf:()=>w,_l:()=>se,Md:()=>I,V7:()=>q,fe:()=>te,JP:()=>vn,Z_:()=>C,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>xt,WS:()=>pt,VF:()=>Ln,vf:()=>Bn,PV:()=>fr,PS:()=>kt,Iz:()=>mn,zD:()=>k,m3:()=>ze,XP:()=>Ie,PM:()=>de,cX:()=>ne,G6:()=>ae,Us:()=>re,AA:()=>he,G0:()=>De,mO:()=>ve,HH:()=>ue,PU:()=>tt,it:()=>_e,Tl:()=>Ee,uH:()=>xe,c3:()=>me,rx:()=>z});var n=e(36087),t=e(14041);const r=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const v=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const p=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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"}));p.displayName="CreditCard02";const h=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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 b=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));b.displayName="ClipboardCheck";const M=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));M.displayName="ClipboardPlus";const x=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,T="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",S="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",E="http://hl7.org/fhir/questionnaire-item-control",C="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",R="http://hl7.org/fhir/StructureDefinition/minValue",L="http://hl7.org/fhir/StructureDefinition/maxValue",P="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",N="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",V="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",q="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",I="http://hl7.org/fhir/StructureDefinition/entryFormat",k="http://hl7.org/fhir/StructureDefinition/tz-code",U="tz-code",F="footer",K="check-box",G="header",se="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",pe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",be=[{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"}],Se={"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"},ge={"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"},ne="ui-toolkit/CoordinatePicker",ae="ui-toolkit/DetailsInfo",me="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",de="ui-toolkit/Button",ue="ui-toolkit/Phone",re="ui-toolkit/ErrorCard",J="ui-toolkit/FormContainer",ve="ui-toolkit/PageHeader",Ee="ui-toolkit/SelectableOption",De="ui-toolkit/Modal",ze="ui-toolkit/Alert",Ie="ui-toolkit/AppSectionAccess",xe="ui-toolkit/SensitiveDataCategory",_e="ui-toolkit/QuestCard",at="http://icanbwell.com/fhir/StructureDefinition/subtitle",pt="http://icanbwell.com/fhir/StructureDefinition/text-align",xt={LEFT:"left",CENTER:"center"},Xt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Kt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Ct="http://icanbwell.com/fhir/StructureDefinition/error-title",Xe="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",We="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",yt="http://icanbwell.com/fhir/StructureDefinition/description",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-description",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-title",Pt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",hn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Sn="http://icanbwell.com/fhir/StructureDefinition/button-text",et="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Rt="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",kt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Bn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Ar="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Ln="http://icanbwell.com/fhir/StructureDefinition/trigger-color",fr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Fn="http://hl7.org/fhir/StructureDefinition/mimeType",Wr="http://hl7.org/fhir/StructureDefinition/maxSize",Yr="http://icanbwell.com/fhir/StructureDefinition/message-severity",It="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ot="http://icanbwell.com/fhir/StructureDefinition/placeholder",Je="http://icanbwell.com/fhir/StructureDefinition/hint-text",tt="ui-toolkit/PrefilledMemberDemographicsAlert",rt="http://hl7.org/fhir/issue-severity",lt="http://icanbwell.com/fhir/StructureDefinition/button-type",Et="http://icanbwell.com/fhir/StructureDefinition/button-action",st="button-type",le="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",ye="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ue="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Te="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",zt="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Gt={},vn={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>Sn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>It,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>q,lv:()=>w,mR:()=>zt,nt:()=>z,od:()=>N,t7:()=>at,yQ:()=>Te,zj:()=>he});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),g=e(45250),c=e.n(g),u=e(18807),y=e(76260),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(mt,Qt,qt)=>Qt in mt?A(mt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):mt[Qt]=qt,f=(mt,Qt)=>{for(var qt in Qt||(Qt={}))v.call(Qt,qt)&&h(mt,qt,Qt[qt]);if(O)for(var qt of O(Qt))p.call(Qt,qt)&&h(mt,qt,Qt[qt]);return mt},b=(mt,Qt)=>m(mt,d(Qt));const M=mt=>{var Qt;return(Qt=mt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Lt,Ft;return(Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)!=null?Ft:[]}).find(qt=>{var Lt;return(Lt=qt.code)==null?void 0:Lt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.V7);return qt?.valueCode||"off"},z=(mt,Qt,qt)=>{const Lt=(0,u.A)(qt);return mt&&Qt&&qt?Lt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Lt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=mt=>{const Qt=mt?.find(qt=>qt.url===y.Vp);return Qt?.valueInteger},S=mt=>{const Qt=mt?.find(qt=>qt.url===y.Z_);return Qt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(mt,Qt)=>{const qt=mt?.find(Lt=>Lt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Qt&&E[Qt]||C},L=mt=>{const Qt=mt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=mt=>{const Qt=mt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Qt?.length?Qt.join(","):void 0},D=mt=>mt.split(",").map(Lt=>Lt.trim()).map(Lt=>y.JL[Lt]||Lt).filter((Lt,Ft,Yt)=>Yt.indexOf(Lt)===Ft).join(", "),N=(mt,Qt,qt)=>{const Lt=D(mt),Ft=Lt.lastIndexOf(","),Yt=Ft!==-1?`${Lt.substring(0,Ft)} or${Lt.substring(Ft+1)}`:Lt,On=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return On.length>0?`${Yt} (${On.join(", ")})`:Yt},w=mt=>{const Qt=mt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(mt,Qt)=>{var qt,Lt,Ft;const Yt=Qt?.find(On=>On.url.includes(mt));return(Ft=(Lt=(qt=Yt?.valueInteger)!=null?qt:Yt?.valueDecimal)!=null?Lt:Yt?.valueString)!=null?Ft:Yt?.valueDate},q=mt=>{if(!!mt){if(/^\d{4}-\d{2}-\d{2}$/.test(mt))return mt;try{const Qt=(0,i.evaluate)({},mt);if(Array.isArray(Qt)&&Qt.length>0){const qt=Qt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Lt=qt.getFullYear(),Ft=String(qt.getMonth()+1).padStart(2,"0"),Yt=String(qt.getDate()).padStart(2,"0");return`${Lt}-${Ft}-${Yt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(mt,Qt)=>{var qt,Lt;const Ft=Qt?.find(On=>On.url===mt);if(!Ft)return;const Yt=(qt=Ft.valueString)!=null?qt:Ft.valueDate;return Yt||q((Lt=Ft.valueExpression)==null?void 0:Lt.expression)},k=(mt,Qt)=>{if(!(!mt||mt.length===0))for(const qt of mt){const Lt=V(Qt,qt.extension);if(Lt!==void 0)return Lt;if(qt.item&&qt.item.length>0){const Ft=k(qt.item,Qt);if(Ft!==void 0)return Ft}}},U=(mt,Qt)=>{try{const qt=String(mt??Qt);let Lt;if(qt.includes("/"))Lt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const Ft=qt.split("T")[0];Lt=(0,t.A)(Ft)}return(0,r.A)(Lt)}catch(qt){return console.error("Date parsing error:",qt,mt),null}},F=(mt,Qt)=>{var qt;for(const Lt of mt){if(Lt.linkId===Qt)return Lt;if((qt=Lt.item)!=null&&qt.length){const Ft=F(Lt.item,Qt);if(Ft!==void 0)return Ft}}},K=(mt,Qt)=>{var qt;const Lt=[];for(const Ft of mt)if(Ft.linkId===Qt&&Lt.push(Ft),(qt=Ft.item)!=null&&qt.length){const Yt=K(Ft.item,Qt);Lt.push(...Yt)}return Lt},G=(mt,Qt,qt=0)=>K(mt,Qt)[qt];function se(mt){return mt!=null}const oe=(mt,Qt)=>{var qt,Lt,Ft;if("answerString"in mt&&se(mt.answerString)){if(mt.operator==="=")return Qt?.valueString===mt.answerString;if(mt.operator==="!=")return Qt?.valueString!==mt.answerString}if("answerBoolean"in mt&&se(mt.answerBoolean)){if(mt.operator==="=")return Qt?.valueBoolean===mt.answerBoolean;if(mt.operator==="!=")return Qt?.valueBoolean!==mt.answerBoolean}if("answerInteger"in mt&&se(mt.answerInteger)||"answerDecimal"in mt&&se(mt.answerDecimal)){const Yt=Number(Qt?.valueInteger||Qt?.valueDecimal),On=Number(mt.answerInteger||mt.answerDecimal);if(mt.operator==="=")return Yt===On;if(mt.operator==="!=")return Yt!==On;if(mt.operator===">")return Yt>On;if(mt.operator==="<")return Yt<On;if(mt.operator===">=")return Yt>=On;if(mt.operator==="<=")return Yt<=On}if("answerQuantity"in mt&&se(mt.answerQuantity)){const Yt=Qt?.valueQuantity,On=mt.answerQuantity;if(Yt?.unit!==On?.unit)return!1;if(mt.operator==="=")return Yt.value===On.value;if(mt.operator==="!=")return Yt.value!==On.value;if(mt.operator===">")return Yt.value>On.value;if(mt.operator==="<")return Yt.value<On.value;if(mt.operator===">=")return Yt.value>=On.value;if(mt.operator==="<=")return Yt.value<=On.value}if("answerCoding"in mt&&se(mt.answerCoding)){const Yt=Qt?.valueCoding,On=mt.answerCoding;if(mt.operator==="=")return Yt?.code===On.code;if(mt.operator==="!=")return Yt?.code!==On.code}if("answerReference"in mt&&se(mt.answerReference)){const Yt=Qt?.valueReference,On=mt.answerReference;if(mt.operator==="=")return Yt?.reference===On.reference;if(mt.operator==="!=")return Yt?.reference!==On.reference}if("answerDate"in mt&&se(mt.answerDate)||"answerDateTime"in mt&&se(mt.answerDateTime)||"answerTime"in mt&&se(mt.answerTime)){const Yt=new Date((Ft=(Lt=(qt=Qt?.valueDate)!=null?qt:Qt?.valueDateTime)!=null?Lt:Qt?.valueTime)!=null?Ft:""),On=new Date(mt.answerDate||mt.answerDateTime||mt.answerTime||"");if(mt.operator==="=")return Yt.getTime()===On.getTime();if(mt.operator==="!=")return Yt.getTime()!==On.getTime();if(mt.operator===">")return Yt.getTime()>On.getTime();if(mt.operator==="<")return Yt.getTime()<On.getTime();if(mt.operator===">=")return Yt.getTime()>=On.getTime();if(mt.operator==="<=")return Yt.getTime()<=On.getTime()}return mt.operator==="exists"?Qt!=null===mt.answerBoolean:!0},te=(mt,Qt,qt)=>{const Lt=Ft=>{const Yt=K(qt,Ft.question);return Yt.length===0||Yt.every(On=>!On.answer||On.answer.length===0)?oe(Ft,void 0):Yt.some(On=>{var zr;return(zr=On.answer)==null?void 0:zr.some(qr=>oe(Ft,qr&&Object.keys(qr).length>0?qr:void 0))})};return mt&&mt?.length>0?Qt==="any"?mt?.some(Ft=>Lt(Ft)):mt?.every(Ft=>Lt(Ft)):!0},pe=(mt,Qt,qt,Lt,Ft)=>{if(!mt||mt.length===0)return!0;const Yt=On=>{var zr;let qr;if(Lt&&typeof Ft=="number"){const Pn=qt.filter(rn=>rn.linkId===Lt)[Ft];if(Pn?.item){const rn=Pn.item.find(bt=>bt.linkId===On.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))}}if(!qr){const Rn=K(qt,On.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))});qr=void 0}return oe(On,qr)};return Qt==="any"?mt.some(On=>Yt(On)):mt.every(On=>Yt(On))},be=(mt,Qt)=>{var qt;if(!!((qt=mt?.valueExpression)!=null&&qt.expression))try{const Lt=evaluate(Qt,mt.valueExpression.expression);return Array.isArray(Lt)?Lt.some(Ft=>Boolean(Ft)):Boolean(Lt)}catch{return}},Se=(mt,Qt)=>{var qt;const Lt=(qt=mt.extension)==null?void 0:qt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),Ft=be(Lt,Qt);return b(f({},mt),{readOnly:Ft??mt.readOnly})},ge=(mt,Qt,qt)=>{const{required:Lt,maxLength:Ft,type:Yt,extension:On,enableWhen:zr,enableBehavior:qr,repeats:Rn,answerOption:Pn}=mt;if(!te(zr,qr,Qt)||mt.type==="group"||mt.type==="display")return"";if(Rn)return ne(mt,Qt,qt);const rn=de(mt,Qt);return rn&&ue(rn,mt)?re(mt,Qt,qt,rn):he(On,Yt,Lt,Ft,qt,Pn)},ne=(mt,Qt,qt)=>{const{required:Lt}=mt;if(Lt){if(!qt||qt.length===0)return"At least one item is required";let Ft=!1;for(let Yt=0;Yt<qt.length;Yt++){const On=qt[Yt];if(On&&Object.keys(On).length>0&&Object.values(On).some(qr=>qr!=null&&qr!==""&&(Array.isArray(qr)?qr.length>0:!0))){Ft=!0;const qr=he(mt.extension,mt.type,!0,mt.maxLength,[On],mt.answerOption);if(qr)return`Item ${Yt+1}: ${qr}`;if(mt.item&&mt.item.length>0){const Rn=ae(mt.item,Qt,mt.linkId,Yt);if(Rn)return`Item ${Yt+1}: ${Rn}`}}else return`Item ${Yt+1}: This field is required`}if(!Ft)return"At least one item is required"}else if(qt&&qt.length>0)for(let Ft=0;Ft<qt.length;Ft++){const Yt=qt[Ft];if(Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=he(mt.extension,mt.type,!1,mt.maxLength,[Yt],mt.answerOption);if(zr)return`Item ${Ft+1}: ${zr}`;if(mt.item&&mt.item.length>0){const qr=ae(mt.item,Qt,mt.linkId,Ft);if(qr)return`Item ${Ft+1}: ${qr}`}}}return""},ae=(mt,Qt,qt,Lt)=>{var Ft,Yt;for(const On of mt){if(!pe(On.enableWhen,On.enableBehavior,Qt,qt,Lt))continue;const zr=F(Qt,qt),qr=(Ft=zr?.item)==null?void 0:Ft.find(Pn=>Pn.linkId===On.linkId),Rn=(Yt=qr?.answer)!=null&&Yt[Lt]?[qr.answer[Lt]]:void 0;if(On.required){if(!Rn||!Rn[0]||!me(Rn[0]))return`${On.text||On.linkId} is required`;const Pn=he(On.extension,On.type,!0,On.maxLength,Rn,On.answerOption);if(Pn)return`${On.text||On.linkId}: ${Pn}`}else if(Rn&&Rn[0]&&me(Rn[0])){const Pn=he(On.extension,On.type,!1,On.maxLength,Rn,On.answerOption);if(Pn)return`${On.text||On.linkId}: ${Pn}`}if(On.item&&On.item.length>0){const Pn=ae(On.item,Qt,On.linkId,Lt);if(Pn)return Pn}}return""},me=mt=>!mt||Object.keys(mt).length===0?!1:Object.values(mt).some(Qt=>Qt!=null&&Qt!==""&&(Array.isArray(Qt)?Qt.length>0:!0)),he=(mt,Qt,qt,Lt,Ft,Yt)=>{var On,zr,qr,Rn,Pn;let rn="";const bt=!!mt?.find(En=>{var Kn,wr;return En.url===y.gD&&((wr=(Kn=En.valueCodeableConcept)==null?void 0:Kn.coding)==null?void 0:wr.some($r=>$r.system===y.n4&&$r.code===y.GI))}),St=Ft?.[0],Zt={choice:((On=St?.valueCoding)==null?void 0:On.code)||(St?.valueString&&Yt?.some(En=>En.valueString===St.valueString)?St.valueString:null),"open-choice":((zr=St?.valueCoding)==null?void 0:zr.code)||St?.valueString,boolean:St?.valueBoolean,string:St?.valueString,text:St?.valueString,url:St?.valueUri,integer:St?.valueInteger,decimal:St?.valueDecimal,dateTime:St?.valueDateTime,date:St?.valueDate,time:St?.valueTime,quantity:(qr=St?.valueQuantity)==null?void 0:qr.value,reference:(Rn=St?.valueReference)==null?void 0:Rn.display,attachment:(Pn=St?.valueAttachment)==null?void 0:Pn.title};if(!(Qt in Zt))return"";const un=Zt[Qt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Qt==="boolean"&&un!==!0&&bt)?"This field is required":"",maxLength:()=>Lt&&un!==null&&un!==void 0&&un.toString().length>Lt?`Input should not exceed ${Lt} characters`:"",minLength:()=>{const En=V("minLength",mt);return En&&un!==null&&un!==void 0&&un.toString().length<Number(En)?`Input should be at least ${En} characters`:""},urlRegex:()=>{const En=new RegExp(y.rx),Kn=V("regexError",mt),wr=Kn??"Please enter a valid url starting from http:// and https://";return En&&Qt==="url"&&un&&!En.test(un)?String(wr):""},regex:()=>{const En=V("regex",mt);if(!En||typeof un!="string")return"";const Kn=new RegExp(En),wr=V("regexError",mt),$r=wr??"Please enter a valid input";return Kn&&un&&!Kn.test(un)?String($r):""},dateTime:()=>{if(Qt==="dateTime"&&un){const En=un?.toString(),Kn=new Date(En);return isNaN(Kn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!un)return"";const En=un.replace(/\D/g,"");return En.length>0&&En.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var En;if(Qt==="date"){const wr=I(y.dU,mt),$r=U(wr??"01/01/1900","01/01/1900"),Kr=U(un,"");if(!$r||!Kr)return"";if((0,s.A)(Kr,$r)){const d0=(En=mt?.find(No=>No.url===y.Ck))==null?void 0:En.valueString;return d0??`Date should not be before ${wr??"01/01/1900"}`}return""}const Kn=V("minValue",mt);return Kn!=null&&un!==null&&un!==void 0&&un<Kn?`Input should not be less than ${Kn}`:""},maxValue:()=>{var En;if(Qt==="date"){const wr=I(y.bK,mt),$r=U(wr??"01/01/2100","01/01/2100"),Kr=U(un,"");if(!$r||!Kr)return"";if((0,o.A)(Kr,$r)){const d0=(En=mt?.find(No=>No.url===y.Cx))==null?void 0:En.valueString;return d0??`Date should not be after ${wr??"01/01/2100"}`}return""}const Kn=V("maxValue",mt);return Kn!=null&&un!==null&&un!==void 0&&un>Kn?`Input should not exceed ${Kn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},de=(mt,Qt)=>{for(const qt of Qt)if(qt.item){if(qt.item.find(Yt=>Yt.linkId===mt.linkId))return qt;const Ft=de(mt,qt.item);if(Ft)return Ft}return null},ue=(mt,Qt)=>{if(mt.answer&&mt.answer.length>1)return!0;if(mt.item){const qt=mt.item.find(Lt=>Lt.linkId===Qt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},re=(mt,Qt,qt,Lt)=>{var Ft,Yt;const{required:On}=mt,zr=(Ft=Lt.item)==null?void 0:Ft.find(Pn=>Pn.linkId===mt.linkId),qr=zr?.answer||[],Rn=((Yt=Lt.answer)==null?void 0:Yt.length)||1;for(let Pn=0;Pn<Rn;Pn++){const rn=qr[Pn];if(On){if(!rn||!me(rn))return`Item ${Pn+1}: ${mt.text||mt.linkId} is required`;const bt=he(mt.extension,mt.type,!0,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Pn+1}: ${bt}`}else if(rn&&me(rn)){const bt=he(mt.extension,mt.type,!1,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Pn+1}: ${bt}`}}return""},J=(mt,Qt)=>{for(const qt of mt){if(qt?.linkId===Qt)return qt;if(qt?.item&&qt.item.length>0){const Lt=J(qt.item,Qt);if(Lt)return Lt}}},ve=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,Ft;return qt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,Ft;return qt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,Ft;return qt.url===y.gD&&((Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,Ft;return qt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},_e=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.fe);return qt?.valueInteger},at=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.zO);return qt?.valueInteger},pt=mt=>{var Qt;const qt=(Qt=mt?.extension)==null?void 0:Qt.find(Lt=>Lt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},xt=(mt,Qt,qt,Lt,Ft,Yt)=>{const On=qr=>Qt.filter(Rn=>Rn.linkId===qr),zr=new Set;return mt.map(qr=>{if(zr.has(qr.linkId)||ve(qr))return null;const Pn=On(qr.linkId),rn=qr.type==="group"&&qr.repeats;if(zr.add(qr.linkId),rn){const bt=[];if(Pn.forEach((St,Zt)=>{const un={linkId:qr.linkId,text:qr.text};let on;if(qt===qr.linkId&&typeof Yt=="number"&&Yt===Zt&&Ft&&Ft.length>0){const En=St?.item||[];on=[...En],Ft.forEach(Kn=>{const wr=on.findIndex($r=>$r.linkId===Kn.linkId);wr>=0?on[wr]=b(f({},En[wr]),{answer:Kn.answer}):on.push(Kn)})}else qr.item&&(on=xt(qr.item,St?.item||[],qt,Lt,Ft,Zt));qt===qr.linkId&&typeof Yt=="number"&&Yt===Zt&&Lt?un.answer=Lt:un.answer=St.answer||[{}],on&&on.length>0?un.item=on:St.item&&(un.item=St.item),bt.push(un)}),qt===qr.linkId&&typeof Yt=="number"&&Yt>=Pn.length)for(let St=Pn.length;St<=Yt;St++){const Zt={linkId:qr.linkId,text:qr.text,answer:St===Yt&&Lt?Lt:[{}]};St===Yt&&Ft&&Ft.length>0?Zt.item=Ft:qr.item&&(Zt.item=xt(qr.item,[],void 0,void 0,void 0,void 0)),bt.push(Zt)}return bt}else if(qr.repeats&&typeof Yt=="number"&&qt===qr.linkId){const bt=Pn[0]||{linkId:qr.linkId,text:qr.text,answer:[]},St={linkId:qr.linkId,text:qr.text,answer:[...bt.answer||[]]};if(Lt&&Lt.length>0){for(;St.answer.length<=Yt;)St.answer.push({});St.answer[Yt]=Lt[0]}return St}else{const bt=Pn[0],St=qr.item?xt(qr.item,bt?.item||[],qt,Lt,Ft,Yt):void 0,Zt=St&&St.length>0,un={linkId:qr.linkId,text:qr.text};return qt&&qr.linkId===qt&&typeof Yt!="number"?(Lt||!Lt&&!Ft?un.answer=Lt:bt?.answer&&(un.answer=bt.answer),Ft?un.item=Ft:Zt&&(un.item=St)):(bt?.answer?un.answer=bt.answer:un.answer=[{}],Zt&&(un.item=St)),un}}).filter(Boolean).flat()},Xt=(mt,Qt)=>{for(const qt of mt)if(qt.linkId===Qt||qt.item&&Xt(qt.item,Qt))return qt.linkId;return null},Kt=(mt,Qt,qt,Lt)=>{var Ft;const Yt=(Ft=mt?.item)!=null?Ft:Lt;return!Yt||Yt.length===0?!0:Yt.every(On=>{var zr;const qr=K(Qt,On.linkId);if(qr.length===0){const Rn=(zr=F(Qt,On.linkId))==null?void 0:zr.answer;if(ge(On,Qt,Rn)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1}else for(const Rn of qr)if(ge(On,Qt,Rn.answer)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1;return On.item?Kt(On,Qt,qt):!0})},Ct=(mt,Qt,qt=!0)=>{for(const Lt of mt)if(Lt.linkId===Qt&&Lt.answer&&Lt.answer.length>0||Lt.item&&Lt.item.length>0&&Ct(Lt.item,Qt,qt))return!0;return!1},Xe=(mt,Qt,qt=0)=>{const Lt=mt.filter(Ft=>Ft.linkId===Qt);if(Lt.length>qt){const Ft=Lt[qt];if(Ft.answer&&Ft.answer.length>0)return Ft.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(On=>On!=null&&On!==""));if(Ft.item&&Ft.item.length>0)return Ct(Ft.item,Qt,!1)}return Ct(mt,Qt,!1)},We=(mt,Qt)=>{if(!mt||!mt.item)return!1;const qt=Lt=>{var Ft;if(Ee(Lt)&&Lt.required&&te(Lt.enableWhen,Lt.enableBehavior,Qt)){const Yt=F(Qt,Lt.linkId),On=he(Lt.extension,Lt.type,Lt.required,Lt.maxLength,Yt?.answer,Lt.answerOption);if(!((Ft=Yt?.answer)!=null&&Ft.length)||On)return!0}if(Lt.item){for(const Yt of Lt.item)if(qt(Yt))return!0}return!1};for(const Lt of mt.item)if(qt(Lt))return!0;return!1},yt=mt=>{var Qt,qt,Lt;if(mt.valueString!==void 0)return mt.valueString;if(mt.valueBoolean!==void 0)return mt.valueBoolean;if(mt.valueInteger!==void 0)return mt.valueInteger;if(mt.valueDecimal!==void 0)return mt.valueDecimal;if(mt.valueDate!==void 0)return mt.valueDate;if(mt.valueDateTime!==void 0)return mt.valueDateTime;if(((Qt=mt.valueCoding)==null?void 0:Qt.code)!==void 0)return mt.valueCoding.code;if(((qt=mt.valueReference)==null?void 0:qt.reference)!==void 0)return mt.valueReference.reference;if(((Lt=mt.valueQuantity)==null?void 0:Lt.value)!==void 0)return mt.valueQuantity.value;if(mt.valueAttachment!==void 0)return mt.valueAttachment},Ye=mt=>{const Qt={linkId:mt.linkId};if(mt.answer&&mt.answer.length>0){const qt=mt.answer.map(Lt=>yt(Lt)).filter(Lt=>Lt!==void 0);qt.length>0&&(Qt.answer=qt)}if(mt.item&&mt.item.length>0){const qt=mt.item.map(Lt=>Ye(Lt)).filter(Lt=>{const Ft=Object.keys(Lt);return Ft.length>1||Ft.length===1&&Ft[0]!=="linkId"});qt.length>0&&(Qt.item=qt)}return Qt},Qe=(mt,Qt,qt,Lt,Ft,Yt)=>{var On;const zr=(On=Qt?.item)==null?void 0:On[qt[Lt]],qr=zr?.linkId;if(!qr)return!1;const Rn=K(mt,qr),Pn=K(Ft,qr),rn=bt=>{if(bt!=null){if(Array.isArray(bt)){const St=bt.filter(Zt=>Zt!=null).map(Zt=>rn(Zt)).filter(Zt=>Zt!==void 0);return St.length===0||St.length===1&&typeof St[0]=="object"&&Object.keys(St[0]).length===0?void 0:St}if(typeof bt=="object"){const St={};for(const[Zt,un]of Object.entries(bt))if(un!=null){const on=rn(un);on!==void 0&&(St[Zt]=on)}return Object.keys(St).length===0?void 0:St}return bt}};if(Rn.length!==Pn.length)return!1;for(let bt=0;bt<Rn.length;bt++){const St=Rn[bt],Zt=Pn[bt];if(!St||!Zt)return!1;const un=Ye(rn(St)),on=Ye(rn(Zt));if(!_.isEqual(un,on))return!1}return Lt!==Yt},Pt=(mt,Qt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(mt,Qt,qt)||null,hn=(mt,Qt)=>{const qt={},Lt=Ft=>{Ft.forEach(Yt=>{const On=K(Qt,Yt.linkId);if(st(Yt,mt)||Yt.repeats)for(let zr=0;zr<On.length;zr++){const qr=On[zr];if(qr?.answer&&qr.answer.length>0){const Rn=Pt(Yt,Qt,qr.answer);Rn&&(qt[Yt.linkId]=b(f({},qt[Yt.linkId]),{[zr]:Rn}))}}else{const zr=F(Qt,Yt.linkId);if(zr?.answer&&zr.answer.length>0){const qr=Pt(Yt,Qt,zr.answer);qr&&(qt[Yt.linkId]={0:qr})}}Yt.item&&Yt.item.length>0&&Lt(Yt.item)})};return Lt(mt),qt},Sn=mt=>{if(!mt)return"";const Qt=mt.split("-");if(Qt.length===3){const[qt,Lt,Ft]=Qt;return`${qt.slice(-4)}-${Lt}-${Ft}`}return""},et=mt=>mt.trim().replace(/[A-Za-z]+/g,""),Rt=(mt,Qt)=>{const qt=(Lt,Ft)=>{for(const Yt of Lt){if(Yt.linkId===Ft)return Yt.answer;if(Yt.item&&Yt.item.length>0){const On=qt(Yt.item,Ft);if(On!==void 0)return On}}};return qt(mt,Qt)},kt=(mt,Qt)=>{if(!Qt||Qt.length===0)return null;const qt=mt.linkId,Lt=(Ft,Yt,On=[])=>{for(const zr of Ft){const qr=[...On,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return qr.some(rn=>rn.repeats===!0)?zr:null;if(Lt(zr.item,Yt,qr))return zr}}return null};return Lt(Qt,qt)},Bn=(mt,Qt)=>{if(!Qt||Qt.length===0)return!1;const qt=mt.linkId,Lt=(Ft,Yt,On=[])=>{for(const zr of Ft){const qr=[...On,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return qr.some(rn=>{const bt=M(rn.extension||[]);return!!bt&&bt!==UI_TOOLKIT_FORM_CONTAINER});if(Lt(zr.item,Yt,qr))return!0}}return!1};return Lt(Qt,qt)},Ar=(mt,Qt,qt)=>{const Lt={};if(!mt)return Lt;const{linkId:Ft}=Qt;if(mt[Ft]){const Yt=mt[Ft];Lt[Ft]=Yt[qt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(mt[Yt.linkId]){const On=mt[Yt.linkId];Lt[Yt.linkId]=On[qt]||""}}),Lt},mn=(mt,Qt)=>{const qt={};if(!mt||!mt[Qt])return qt;const Lt=mt[Qt];return qt[Qt]=Lt[0]||"",qt},Ln=mt=>{const Qt=mt.findIndex(Yt=>!Ee(Yt)),qt=Qt>=0?[Qt]:[],Lt=new Map;let Ft=null;if(mt.forEach((Yt,On)=>{const zr=ze(Yt);if(zr&&Yt.type==="group")On!==Qt&&qt.push(On),Lt.set(On,[On]),Ft=On;else if(Ft!==null&&!zr){const qr=Lt.get(Ft)||[];Lt.set(Ft,[...qr,On])}}),mt.length>0&&qt.length>0){const Yt=qt[0];if(!Lt.has(Yt)){const On=qt.find(qr=>qr>Yt),zr=[];for(let qr=Yt;qr<(On??mt.length);qr++)zr.push(qr);Lt.set(Yt,zr)}}return{groupIndices:qt,itemsToRenderMap:Lt}},fr=(mt,Qt,qt,Lt)=>{let Ft=[...Lt];const Yt=(On,zr)=>{On.forEach(qr=>{if((!qr?.enableWhen||te(qr?.enableWhen,qr.enableBehavior,zr))&&qr.initial&&!Ct(zr,qr.linkId))if(qr.repeats){const Rn=zr.filter(Pn=>Pn.linkId===qr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Xe(zr,qr.linkId,rn)||(Ft=xt(qt,Ft,qr.linkId,qr.initial,void 0,rn))}):Ft=xt(qt,Ft,qr.linkId,qr.initial)}else Ft=xt(qt,Ft,qr.linkId,qr.initial);qr.item&&Yt(qr.item,zr)})};return Yt(mt,Qt),Ft},Fn=(mt,Qt,qt)=>{if(!mt)return[];const Lt=[],Ft=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,qt)&&!Ee(Yt)&&Yt.type!=="display"&&Lt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach(Ft)};return mt.forEach(Ft),Lt},Wr=(mt,Qt)=>mt.every(qt=>{var Lt;const Ft=K(Qt,qt.linkId);if(Ft.length>0)return Ft.every(Yt=>!ge(qt,Qt,Yt.answer));{const Yt=(Lt=F(Qt,qt.linkId))==null?void 0:Lt.answer;return!ge(qt,Qt,Yt)}}),Yr=(mt,Qt)=>{let qt=-1;for(let Lt=mt.length-1;Lt>=0;Lt--)if(mt[Lt].linkId===Qt){qt=Lt;break}return qt},It=(mt,Qt)=>mt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:It(qt.item,Qt)}):qt),$e=(mt,Qt,qt=mt)=>mt.reduce((Lt,Ft)=>{const Yt=J(Qt,Ft.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,qt)||(Ft.item&&Ft.item.length>0?Lt.push(b(f({},Ft),{item:$e(Ft.item,Qt,qt)})):Lt.push(Ft)),Lt},[]),ot=(mt,Qt,qt=[])=>{const Lt=[],Ft=Yt=>{Yt.forEach(On=>{Lt.push(On.linkId),On.item&&On.item.length>0&&Ft(On.item)})};for(let Yt=0;Yt<mt.length;Yt++){const On=mt[Yt];if(On.linkId===Qt){const zr=mt.slice(0,Yt+1),qr=mt.slice(Yt+1),{kept:Rn,removed:Pn}=qr.reduce((rn,bt)=>{const St=J(qt,bt.linkId);return!St||Ee(St)&&te(St.enableWhen,St.enableBehavior,zr)?rn.kept.push(bt):rn.removed.push(bt),rn},{kept:[],removed:[]});return Ft(Pn),{trimmedData:[...zr,...Rn],trimmedLinkIds:Lt,found:!0}}if(On.item&&On.item.length>0){const zr=ot(On.item,Qt,qt);if(zr.found){const qr=mt.slice(0,Yt),Rn=mt.slice(Yt+1),Pn=[...qr,b(f({},On),{item:zr.trimmedData})],{kept:rn,removed:bt}=Rn.reduce((St,Zt)=>{const un=J(qt,Zt.linkId);return!un||Ee(un)&&te(un.enableWhen,un.enableBehavior,Pn)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return Ft(bt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Lt],found:!0}}}}return{trimmedData:mt,trimmedLinkIds:[],found:!1}},Je=(mt,Qt)=>mt.filter(qt=>!Qt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Je(qt.item,Qt)}):qt),tt=mt=>{var Qt;if(!mt)return"empty";const qt=y.Z$.find(({patterns:Lt})=>Lt.some(Ft=>mt.includes(Ft)));return(Qt=qt?.type)!=null?Qt:"empty"},rt=(mt,Qt)=>{const{groupIndices:qt}=Ln(mt),Lt=mt.findIndex(Ft=>Ft.linkId===Qt);return Lt!==-1?qt.indexOf(Lt):-1},lt=mt=>{if(!mt)return{restriction:null,warning:null};const Qt=qt=>{const Lt=mt.find(Yt=>Yt.url===qt&&Yt.valueString);if(!Lt?.valueString)return null;const Ft=Lt.valueString.replace(/\\n/g,`
|
|
869
|
+
`}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},_e=({src:Xt,elementNameSuffix:Kt,version:Ct,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var We,yt,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Ar,mn,Ln,fr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Fn=`bwell-${Kt}`;if(customElements.get(Fn)!==void 0)return;class Wr extends f{constructor(){super(),We.add(this),yt.set(this,(0,S.nanoid)()),Ye.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Pt.set(this,new I.EventEmitter),hn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),kt.set(this,void 0),Bn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:$e,container:ot,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Bn,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Pt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,hn,(0,p.__classPrivateFieldGet)(this,We,"m",Ar).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,We,"m",mn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,We,"m",fr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,We,"m",fr).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,yt,this.id||(0,p.__classPrivateFieldGet)(this,yt,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,yt,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,hn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,hn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Xt).catch(()=>{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,p.__classPrivateFieldGet)(this,Pt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(It=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||It===void 0||It.deregister(),(0,p.__classPrivateFieldGet)(this,Pt,"f").removeAllListeners()}}yt=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Pt=new WeakMap,hn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,kt=new WeakMap,Bn=new WeakMap,We=new WeakSet,Ar=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${Fn}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Xt),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,yt,"f"),name:Kt,elementName:Fn,utils:(0,p.__classPrivateFieldGet)(this,Bn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},mn=function({visibility:It,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=It==="hidden"?"unset":"hidden"},Ln=function(It){(0,p.__classPrivateFieldGet)(this,kt,"f")(),(0,p.__classPrivateFieldSet)(this,kt,void 0,"f")},fr=function(It){return $e=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,kt,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It),(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlotLocked(xe[It]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,kt,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Fn,Wr)}),at={rE:"1.1127.1"},pt="composite";var xt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${pt}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:pt,version:at.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),o=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(v,p,h)=>p in v?o(v,p,{enumerable:!0,configurable:!0,writable:!0,value:h}):v[p]=h,A=(v,p)=>{for(var h in p||(p={}))c.call(p,h)&&y(v,h,p[h]);if(g)for(var h of g(p))u.call(p,h)&&y(v,h,p[h]);return v},m=(v,p)=>i(v,a(p));const d=(v,p,h)=>{const f=_.cloneDeep(v);if(!f.contained||p<0)return f;const b=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(b!==-1&&!h){const M=f.contained[b];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===p+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[b]=M}}else h&&b!==-1&&(f.contained[b]=m(A({},f.contained[b]),{item:h}));return f},O=({formId:v,questionnaireResponse:p,showQuestionPrefix:h,nextQuestion:f,onGoBack:b,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),q=(P=p.questionnaire)==null?void 0:P.replace("#",""),I=(D=p?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(p);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:v,onFormDataChange:C,questionnaireResponseItem:(N=p?.item)!=null?N:[],questionnaireSchema:I,status:p.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:b,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,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,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(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,b=({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"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,oe]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[de,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Kt=>{var Ct,Xe;const We=(Xe=(Ct=Kt.placeAutocomplete)==null?void 0:Ct.predictions)==null?void 0:Xe.map(yt=>{var Ye;return{id:yt.placeId,label:(0,s.removeAfterLastComma)(yt.description),mainText:yt?.mainText||((Ye=yt.description.split(",")[0])==null?void 0:Ye.trim()),secondaryText:(0,s.removeAfterLastComma)(yt?.secondaryText||yt.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Kt=>p(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,be]),ze=Kt=>h(void 0,null,function*(){var Ct,Xe,We,yt,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Ar,mn,Ln;if(F(Kt),G(Kt),oe(!1),Kt&&typeof Kt=="string"){const fr=be.find(tt=>tt.id===Kt),Fn=fr?.label||V;if(!fr)return;q(Fn),k(Fn),setTimeout(()=>{const tt=[{id:fr.id,label:fr.label}];Se(tt),ne(tt)},f);const Wr=yield ae({variables:{placeId:Kt}}),Yr=(Xe=(Ct=Wr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(yt=(We=Wr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:yt.longitude,$e=((Qe=(Ye=Wr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",ot=((hn=(Pt=Wr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",Je=((et=(Sn=Wr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Yr&&It)if(!$e||!Je){const tt=yield de({variables:{latitude:String(Yr),longitude:String(It)}}),rt=((kt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",lt=((Ar=(Bn=tt?.data)==null?void 0:Bn.geocodingByLatLon)==null?void 0:Ar.state)||"",Et=((Ln=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Yr,longitude:It,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Fn,value:Kt})}else T({latitude:Yr,longitude:It,zipCode:$e,state:ot,stateCode:Je,placeId:Kt,description:Fn,value:Kt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),_e=Kt=>h(void 0,null,function*(){if(oe(!1),q(Kt),z?.(Kt),!Kt||Kt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Kt});return}const Ct=Kt.trim();Ct.length>=2?yield xe(Ct):Se(pe)}),at=Kt=>{te.current=Kt},pt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ct,Xe,We,yt,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Ar,mn,Ln;if(N&&w){Se([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),F(N),G(N),q(w),k(w),w===V&&q(w);const fr=yield ae({variables:{placeId:N}}),Fn=(Xe=(Ct=fr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Wr=(yt=(We=fr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:yt.longitude,Yr=((Qe=(Ye=fr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",It=((hn=(Pt=fr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",$e=((et=(Sn=fr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Fn&&Wr)if(!Yr||!It||!$e){const ot=yield de({variables:{latitude:String(Fn),longitude:String(Wr)}}),Je=((kt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",tt=((Ar=(Bn=ot?.data)==null?void 0:Bn.geocodingByLatLon)==null?void 0:Ar.state)||"",rt=((Ln=(mn=ot?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Fn,longitude:Wr,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Fn,longitude:Wr,zipCode:Yr,state:It,stateCode:$e,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const xt=se||!!he||!!re||!!Ee||!!R,Xt=xt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:at,onBlur:pt,isInvalid:xt,hint:Xt,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Ct=Kt,Xe=V.trim().length>=2,We=Ct.mainText||"",yt=Ct.secondaryText||"",Ye=We.trim().length>0,Qe=yt.trim().length>0,Pt=Ye?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},hn=Qe?(0,r.RZ)(yt,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Ct.id,supportingText:Ct.supportingText,isDisabled:Ct.isDisabled,icon:Ct.icon,avatarUrl:Ct.avatarUrl,textValue:Ct.label,children:Xe&&Ye?(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:Pt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Pt.highlightedPart}),(0,n.jsx)("span",{children:Pt.remainingPart})]}),Qe&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:hn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:hn.highlightedPart}),(0,n.jsx)("span",{children:hn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ct.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:i})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(52449);const i=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(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,v=Object.getOwnPropertySymbols,p=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,b=(C,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(C,L,R[L]);if(v)for(var L of v(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 N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((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,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},q.current),{locationPermission:ve||i.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,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]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==i.Ef.GRANTED&&Ee!==i.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(L==="Android"&&Ee===i.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}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(Ee!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,P,L,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),de=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(i.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,P,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),w(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,w,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:de,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,de,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},76260:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>It,GI:()=>K,rz:()=>yt,Fp:()=>We,el:()=>Xe,ao:()=>Ct,oA:()=>S,Yt:()=>$e,g4:()=>Kt,tn:()=>rt,n4:()=>E,gD:()=>T,Vp:()=>Wr,Cx:()=>D,bK:()=>L,gi:()=>Yr,Z$:()=>be,GT:()=>Fn,hr:()=>Se,JL:()=>ge,Ck:()=>P,dU:()=>R,wG:()=>Rt,hZ:()=>Sn,$e:()=>Ye,qT:()=>hn,GQ:()=>Pt,q3:()=>et,D_:()=>Qe,Uf:()=>w,_l:()=>se,Md:()=>I,V7:()=>q,fe:()=>te,JP:()=>vn,Z_:()=>C,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>xt,WS:()=>pt,VF:()=>Ln,vf:()=>Bn,PV:()=>fr,PS:()=>kt,Iz:()=>mn,zD:()=>k,m3:()=>ze,XP:()=>Ie,PM:()=>de,cX:()=>ne,G6:()=>ae,Us:()=>re,AA:()=>he,G0:()=>De,mO:()=>ve,HH:()=>ue,PU:()=>tt,it:()=>_e,Tl:()=>Ee,uH:()=>xe,c3:()=>me,rx:()=>z});var n=e(36087),t=e(14041);const r=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const v=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const p=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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"}));p.displayName="CreditCard02";const h=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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 b=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));b.displayName="ClipboardCheck";const M=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));M.displayName="ClipboardPlus";const x=({size:zn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,T="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",S="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",E="http://hl7.org/fhir/questionnaire-item-control",C="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",R="http://hl7.org/fhir/StructureDefinition/minValue",L="http://hl7.org/fhir/StructureDefinition/maxValue",P="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",N="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",V="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",q="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",I="http://hl7.org/fhir/StructureDefinition/entryFormat",k="http://hl7.org/fhir/StructureDefinition/tz-code",U="tz-code",F="footer",K="check-box",G="header",se="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",pe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",be=[{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"}],Se={"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"},ge={"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"},ne="ui-toolkit/CoordinatePicker",ae="ui-toolkit/DetailsInfo",me="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",de="ui-toolkit/Button",ue="ui-toolkit/Phone",re="ui-toolkit/ErrorCard",J="ui-toolkit/FormContainer",ve="ui-toolkit/PageHeader",Ee="ui-toolkit/SelectableOption",De="ui-toolkit/Modal",ze="ui-toolkit/Alert",Ie="ui-toolkit/AppSectionAccess",xe="ui-toolkit/SensitiveDataCategory",_e="ui-toolkit/QuestCard",at="http://icanbwell.com/fhir/StructureDefinition/subtitle",pt="http://icanbwell.com/fhir/StructureDefinition/text-align",xt={LEFT:"left",CENTER:"center"},Xt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Kt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Ct="http://icanbwell.com/fhir/StructureDefinition/error-title",Xe="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",We="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",yt="http://icanbwell.com/fhir/StructureDefinition/description",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-description",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-title",Pt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",hn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Sn="http://icanbwell.com/fhir/StructureDefinition/button-text",et="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Rt="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",kt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Bn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Ar="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Ln="http://icanbwell.com/fhir/StructureDefinition/trigger-color",fr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Fn="http://hl7.org/fhir/StructureDefinition/mimeType",Wr="http://hl7.org/fhir/StructureDefinition/maxSize",Yr="http://icanbwell.com/fhir/StructureDefinition/message-severity",It="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ot="http://icanbwell.com/fhir/StructureDefinition/placeholder",Je="http://icanbwell.com/fhir/StructureDefinition/hint-text",tt="ui-toolkit/PrefilledMemberDemographicsAlert",rt="http://hl7.org/fhir/issue-severity",lt="http://icanbwell.com/fhir/StructureDefinition/button-type",Et="http://icanbwell.com/fhir/StructureDefinition/button-action",st="button-type",le="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",ye="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ue="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Te="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",zt="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Gt={},vn={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>Sn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>It,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>q,lv:()=>w,mR:()=>zt,nt:()=>z,od:()=>N,t7:()=>at,yQ:()=>Te,zj:()=>he});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),g=e(45250),c=e.n(g),u=e(18807),y=e(76260),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(mt,Qt,qt)=>Qt in mt?A(mt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):mt[Qt]=qt,f=(mt,Qt)=>{for(var qt in Qt||(Qt={}))v.call(Qt,qt)&&h(mt,qt,Qt[qt]);if(O)for(var qt of O(Qt))p.call(Qt,qt)&&h(mt,qt,Qt[qt]);return mt},b=(mt,Qt)=>m(mt,d(Qt));const M=mt=>{var Qt;return(Qt=mt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Lt,Ft;return(Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)!=null?Ft:[]}).find(qt=>{var Lt;return(Lt=qt.code)==null?void 0:Lt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.V7);return qt?.valueCode||"off"},z=(mt,Qt,qt)=>{const Lt=(0,u.A)(qt);return mt&&Qt&&qt?Lt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Lt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=mt=>{const Qt=mt?.find(qt=>qt.url===y.Vp);return Qt?.valueInteger},S=mt=>{const Qt=mt?.find(qt=>qt.url===y.Z_);return Qt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(mt,Qt)=>{const qt=mt?.find(Lt=>Lt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Qt&&E[Qt]||C},L=mt=>{const Qt=mt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=mt=>{const Qt=mt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Qt?.length?Qt.join(","):void 0},D=mt=>mt.split(",").map(Lt=>Lt.trim()).map(Lt=>y.JL[Lt]||Lt).filter((Lt,Ft,Yt)=>Yt.indexOf(Lt)===Ft).join(", "),N=(mt,Qt,qt)=>{const Lt=D(mt),Ft=Lt.lastIndexOf(","),Yt=Ft!==-1?`${Lt.substring(0,Ft)} or${Lt.substring(Ft+1)}`:Lt,On=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return On.length>0?`${Yt} (${On.join(", ")})`:Yt},w=mt=>{const Qt=mt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(mt,Qt)=>{var qt,Lt,Ft;const Yt=Qt?.find(On=>On.url.includes(mt));return(Ft=(Lt=(qt=Yt?.valueInteger)!=null?qt:Yt?.valueDecimal)!=null?Lt:Yt?.valueString)!=null?Ft:Yt?.valueDate},q=mt=>{if(!!mt){if(/^\d{4}-\d{2}-\d{2}$/.test(mt))return mt;try{const Qt=(0,i.evaluate)({},mt);if(Array.isArray(Qt)&&Qt.length>0){const qt=Qt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Lt=qt.getFullYear(),Ft=String(qt.getMonth()+1).padStart(2,"0"),Yt=String(qt.getDate()).padStart(2,"0");return`${Lt}-${Ft}-${Yt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(mt,Qt)=>{var qt,Lt;const Ft=Qt?.find(On=>On.url===mt);if(!Ft)return;const Yt=(qt=Ft.valueString)!=null?qt:Ft.valueDate;return Yt||q((Lt=Ft.valueExpression)==null?void 0:Lt.expression)},k=(mt,Qt)=>{if(!(!mt||mt.length===0))for(const qt of mt){const Lt=V(Qt,qt.extension);if(Lt!==void 0)return Lt;if(qt.item&&qt.item.length>0){const Ft=k(qt.item,Qt);if(Ft!==void 0)return Ft}}},U=(mt,Qt)=>{try{const qt=String(mt??Qt);let Lt;if(qt.includes("/"))Lt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const Ft=qt.split("T")[0];Lt=(0,t.A)(Ft)}return(0,r.A)(Lt)}catch(qt){return console.error("Date parsing error:",qt,mt),null}},F=(mt,Qt)=>{var qt;for(const Lt of mt){if(Lt.linkId===Qt)return Lt;if((qt=Lt.item)!=null&&qt.length){const Ft=F(Lt.item,Qt);if(Ft!==void 0)return Ft}}},K=(mt,Qt)=>{var qt;const Lt=[];for(const Ft of mt)if(Ft.linkId===Qt&&Lt.push(Ft),(qt=Ft.item)!=null&&qt.length){const Yt=K(Ft.item,Qt);Lt.push(...Yt)}return Lt},G=(mt,Qt,qt=0)=>K(mt,Qt)[qt];function se(mt){return mt!=null}const oe=(mt,Qt)=>{var qt,Lt,Ft;if("answerString"in mt&&se(mt.answerString)){if(mt.operator==="=")return Qt?.valueString===mt.answerString;if(mt.operator==="!=")return Qt?.valueString!==mt.answerString}if("answerBoolean"in mt&&se(mt.answerBoolean)){if(mt.operator==="=")return Qt?.valueBoolean===mt.answerBoolean;if(mt.operator==="!=")return Qt?.valueBoolean!==mt.answerBoolean}if("answerInteger"in mt&&se(mt.answerInteger)||"answerDecimal"in mt&&se(mt.answerDecimal)){const Yt=Number(Qt?.valueInteger||Qt?.valueDecimal),On=Number(mt.answerInteger||mt.answerDecimal);if(mt.operator==="=")return Yt===On;if(mt.operator==="!=")return Yt!==On;if(mt.operator===">")return Yt>On;if(mt.operator==="<")return Yt<On;if(mt.operator===">=")return Yt>=On;if(mt.operator==="<=")return Yt<=On}if("answerQuantity"in mt&&se(mt.answerQuantity)){const Yt=Qt?.valueQuantity,On=mt.answerQuantity;if(Yt?.unit!==On?.unit)return!1;if(mt.operator==="=")return Yt.value===On.value;if(mt.operator==="!=")return Yt.value!==On.value;if(mt.operator===">")return Yt.value>On.value;if(mt.operator==="<")return Yt.value<On.value;if(mt.operator===">=")return Yt.value>=On.value;if(mt.operator==="<=")return Yt.value<=On.value}if("answerCoding"in mt&&se(mt.answerCoding)){const Yt=Qt?.valueCoding,On=mt.answerCoding;if(mt.operator==="=")return Yt?.code===On.code;if(mt.operator==="!=")return Yt?.code!==On.code}if("answerReference"in mt&&se(mt.answerReference)){const Yt=Qt?.valueReference,On=mt.answerReference;if(mt.operator==="=")return Yt?.reference===On.reference;if(mt.operator==="!=")return Yt?.reference!==On.reference}if("answerDate"in mt&&se(mt.answerDate)||"answerDateTime"in mt&&se(mt.answerDateTime)||"answerTime"in mt&&se(mt.answerTime)){const Yt=new Date((Ft=(Lt=(qt=Qt?.valueDate)!=null?qt:Qt?.valueDateTime)!=null?Lt:Qt?.valueTime)!=null?Ft:""),On=new Date(mt.answerDate||mt.answerDateTime||mt.answerTime||"");if(mt.operator==="=")return Yt.getTime()===On.getTime();if(mt.operator==="!=")return Yt.getTime()!==On.getTime();if(mt.operator===">")return Yt.getTime()>On.getTime();if(mt.operator==="<")return Yt.getTime()<On.getTime();if(mt.operator===">=")return Yt.getTime()>=On.getTime();if(mt.operator==="<=")return Yt.getTime()<=On.getTime()}return mt.operator==="exists"?Qt!=null===mt.answerBoolean:!0},te=(mt,Qt,qt)=>{const Lt=Ft=>{const Yt=K(qt,Ft.question);return Yt.length===0||Yt.every(On=>!On.answer||On.answer.length===0)?oe(Ft,void 0):Yt.some(On=>{var zr;return(zr=On.answer)==null?void 0:zr.some(qr=>oe(Ft,qr&&Object.keys(qr).length>0?qr:void 0))})};return mt&&mt?.length>0?Qt==="any"?mt?.some(Ft=>Lt(Ft)):mt?.every(Ft=>Lt(Ft)):!0},pe=(mt,Qt,qt,Lt,Ft)=>{if(!mt||mt.length===0)return!0;const Yt=On=>{var zr;let qr;if(Lt&&typeof Ft=="number"){const Pn=qt.filter(rn=>rn.linkId===Lt)[Ft];if(Pn?.item){const rn=Pn.item.find(bt=>bt.linkId===On.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))}}if(!qr){const Rn=K(qt,On.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))});qr=void 0}return oe(On,qr)};return Qt==="any"?mt.some(On=>Yt(On)):mt.every(On=>Yt(On))},be=(mt,Qt)=>{var qt;if(!!((qt=mt?.valueExpression)!=null&&qt.expression))try{const Lt=evaluate(Qt,mt.valueExpression.expression);return Array.isArray(Lt)?Lt.some(Ft=>Boolean(Ft)):Boolean(Lt)}catch{return}},Se=(mt,Qt)=>{var qt;const Lt=(qt=mt.extension)==null?void 0:qt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),Ft=be(Lt,Qt);return b(f({},mt),{readOnly:Ft??mt.readOnly})},ge=(mt,Qt,qt)=>{const{required:Lt,maxLength:Ft,type:Yt,extension:On,enableWhen:zr,enableBehavior:qr,repeats:Rn,answerOption:Pn}=mt;if(!te(zr,qr,Qt)||mt.type==="group"||mt.type==="display")return"";if(Rn)return ne(mt,Qt,qt);const rn=de(mt,Qt);return rn&&ue(rn,mt)?re(mt,Qt,qt,rn):he(On,Yt,Lt,Ft,qt,Pn)},ne=(mt,Qt,qt)=>{const{required:Lt}=mt;if(Lt){if(!qt||qt.length===0)return"At least one item is required";let Ft=!1;for(let Yt=0;Yt<qt.length;Yt++){const On=qt[Yt];if(On&&Object.keys(On).length>0&&Object.values(On).some(qr=>qr!=null&&qr!==""&&(Array.isArray(qr)?qr.length>0:!0))){Ft=!0;const qr=he(mt.extension,mt.type,!0,mt.maxLength,[On],mt.answerOption);if(qr)return`Item ${Yt+1}: ${qr}`;if(mt.item&&mt.item.length>0){const Rn=ae(mt.item,Qt,mt.linkId,Yt);if(Rn)return`Item ${Yt+1}: ${Rn}`}}else return`Item ${Yt+1}: This field is required`}if(!Ft)return"At least one item is required"}else if(qt&&qt.length>0)for(let Ft=0;Ft<qt.length;Ft++){const Yt=qt[Ft];if(Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=he(mt.extension,mt.type,!1,mt.maxLength,[Yt],mt.answerOption);if(zr)return`Item ${Ft+1}: ${zr}`;if(mt.item&&mt.item.length>0){const qr=ae(mt.item,Qt,mt.linkId,Ft);if(qr)return`Item ${Ft+1}: ${qr}`}}}return""},ae=(mt,Qt,qt,Lt)=>{var Ft,Yt;for(const On of mt){if(!pe(On.enableWhen,On.enableBehavior,Qt,qt,Lt))continue;const zr=F(Qt,qt),qr=(Ft=zr?.item)==null?void 0:Ft.find(Pn=>Pn.linkId===On.linkId),Rn=(Yt=qr?.answer)!=null&&Yt[Lt]?[qr.answer[Lt]]:void 0;if(On.required){if(!Rn||!Rn[0]||!me(Rn[0]))return`${On.text||On.linkId} is required`;const Pn=he(On.extension,On.type,!0,On.maxLength,Rn,On.answerOption);if(Pn)return`${On.text||On.linkId}: ${Pn}`}else if(Rn&&Rn[0]&&me(Rn[0])){const Pn=he(On.extension,On.type,!1,On.maxLength,Rn,On.answerOption);if(Pn)return`${On.text||On.linkId}: ${Pn}`}if(On.item&&On.item.length>0){const Pn=ae(On.item,Qt,On.linkId,Lt);if(Pn)return Pn}}return""},me=mt=>!mt||Object.keys(mt).length===0?!1:Object.values(mt).some(Qt=>Qt!=null&&Qt!==""&&(Array.isArray(Qt)?Qt.length>0:!0)),he=(mt,Qt,qt,Lt,Ft,Yt)=>{var On,zr,qr,Rn,Pn;let rn="";const bt=!!mt?.find(En=>{var Kn,wr;return En.url===y.gD&&((wr=(Kn=En.valueCodeableConcept)==null?void 0:Kn.coding)==null?void 0:wr.some($r=>$r.system===y.n4&&$r.code===y.GI))}),St=Ft?.[0],Zt={choice:((On=St?.valueCoding)==null?void 0:On.code)||(St?.valueString&&Yt?.some(En=>En.valueString===St.valueString)?St.valueString:null),"open-choice":((zr=St?.valueCoding)==null?void 0:zr.code)||St?.valueString,boolean:St?.valueBoolean,string:St?.valueString,text:St?.valueString,url:St?.valueUri,integer:St?.valueInteger,decimal:St?.valueDecimal,dateTime:St?.valueDateTime,date:St?.valueDate,time:St?.valueTime,quantity:(qr=St?.valueQuantity)==null?void 0:qr.value,reference:(Rn=St?.valueReference)==null?void 0:Rn.display,attachment:(Pn=St?.valueAttachment)==null?void 0:Pn.title};if(!(Qt in Zt))return"";const un=Zt[Qt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Qt==="boolean"&&un!==!0&&bt)?"This field is required":"",maxLength:()=>Lt&&un!==null&&un!==void 0&&un.toString().length>Lt?`Input should not exceed ${Lt} characters`:"",minLength:()=>{const En=V("minLength",mt);return En&&un!==null&&un!==void 0&&un.toString().length<Number(En)?`Input should be at least ${En} characters`:""},urlRegex:()=>{const En=new RegExp(y.rx),Kn=V("regexError",mt),wr=Kn??"Please enter a valid url starting from http:// and https://";return En&&Qt==="url"&&un&&!En.test(un)?String(wr):""},regex:()=>{const En=V("regex",mt);if(!En||typeof un!="string")return"";const Kn=new RegExp(En),wr=V("regexError",mt),$r=wr??"Please enter a valid input";return Kn&&un&&!Kn.test(un)?String($r):""},dateTime:()=>{if(Qt==="dateTime"&&un){const En=un?.toString(),Kn=new Date(En);return isNaN(Kn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!un)return"";const En=un.replace(/\D/g,"");return En.length>0&&En.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var En;if(Qt==="date"){const wr=I(y.dU,mt),$r=U(wr??"01/01/1900","01/01/1900"),Kr=U(un,"");if(!$r||!Kr)return"";if((0,s.A)(Kr,$r)){const d0=(En=mt?.find(No=>No.url===y.Ck))==null?void 0:En.valueString;return d0??`Date should not be before ${wr??"01/01/1900"}`}return""}const Kn=V("minValue",mt);return Kn!=null&&un!==null&&un!==void 0&&un<Kn?`Input should not be less than ${Kn}`:""},maxValue:()=>{var En;if(Qt==="date"){const wr=I(y.bK,mt),$r=U(wr??"01/01/2100","01/01/2100"),Kr=U(un,"");if(!$r||!Kr)return"";if((0,o.A)(Kr,$r)){const d0=(En=mt?.find(No=>No.url===y.Cx))==null?void 0:En.valueString;return d0??`Date should not be after ${wr??"01/01/2100"}`}return""}const Kn=V("maxValue",mt);return Kn!=null&&un!==null&&un!==void 0&&un>Kn?`Input should not exceed ${Kn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},de=(mt,Qt)=>{for(const qt of Qt)if(qt.item){if(qt.item.find(Yt=>Yt.linkId===mt.linkId))return qt;const Ft=de(mt,qt.item);if(Ft)return Ft}return null},ue=(mt,Qt)=>{if(mt.answer&&mt.answer.length>1)return!0;if(mt.item){const qt=mt.item.find(Lt=>Lt.linkId===Qt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},re=(mt,Qt,qt,Lt)=>{var Ft,Yt;const{required:On}=mt,zr=(Ft=Lt.item)==null?void 0:Ft.find(Pn=>Pn.linkId===mt.linkId),qr=zr?.answer||[],Rn=((Yt=Lt.answer)==null?void 0:Yt.length)||1;for(let Pn=0;Pn<Rn;Pn++){const rn=qr[Pn];if(On){if(!rn||!me(rn))return`Item ${Pn+1}: ${mt.text||mt.linkId} is required`;const bt=he(mt.extension,mt.type,!0,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Pn+1}: ${bt}`}else if(rn&&me(rn)){const bt=he(mt.extension,mt.type,!1,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Pn+1}: ${bt}`}}return""},J=(mt,Qt)=>{for(const qt of mt){if(qt?.linkId===Qt)return qt;if(qt?.item&&qt.item.length>0){const Lt=J(qt.item,Qt);if(Lt)return Lt}}},ve=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,Ft;return qt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,Ft;return qt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,Ft;return qt.url===y.gD&&((Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,Ft;return qt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},_e=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.fe);return qt?.valueInteger},at=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.zO);return qt?.valueInteger},pt=mt=>{var Qt;const qt=(Qt=mt?.extension)==null?void 0:Qt.find(Lt=>Lt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},xt=(mt,Qt,qt,Lt,Ft,Yt)=>{const On=qr=>Qt.filter(Rn=>Rn.linkId===qr),zr=new Set;return mt.map(qr=>{if(zr.has(qr.linkId)||ve(qr))return null;const Pn=On(qr.linkId),rn=qr.type==="group"&&qr.repeats;if(zr.add(qr.linkId),rn){const bt=[];if(Pn.forEach((St,Zt)=>{const un={linkId:qr.linkId,text:qr.text};let on;if(qt===qr.linkId&&typeof Yt=="number"&&Yt===Zt&&Ft&&Ft.length>0){const En=St?.item||[];on=[...En],Ft.forEach(Kn=>{const wr=on.findIndex($r=>$r.linkId===Kn.linkId);wr>=0?on[wr]=b(f({},En[wr]),{answer:Kn.answer}):on.push(Kn)})}else qr.item&&(on=xt(qr.item,St?.item||[],qt,Lt,Ft,Zt));qt===qr.linkId&&typeof Yt=="number"&&Yt===Zt&&Lt?un.answer=Lt:un.answer=St.answer||[{}],on&&on.length>0?un.item=on:St.item&&(un.item=St.item),bt.push(un)}),qt===qr.linkId&&typeof Yt=="number"&&Yt>=Pn.length)for(let St=Pn.length;St<=Yt;St++){const Zt={linkId:qr.linkId,text:qr.text,answer:St===Yt&&Lt?Lt:[{}]};St===Yt&&Ft&&Ft.length>0?Zt.item=Ft:qr.item&&(Zt.item=xt(qr.item,[],void 0,void 0,void 0,void 0)),bt.push(Zt)}return bt}else if(qr.repeats&&typeof Yt=="number"&&qt===qr.linkId){const bt=Pn[0]||{linkId:qr.linkId,text:qr.text,answer:[]},St={linkId:qr.linkId,text:qr.text,answer:[...bt.answer||[]]};if(Lt&&Lt.length>0){for(;St.answer.length<=Yt;)St.answer.push({});St.answer[Yt]=Lt[0]}return St}else{const bt=Pn[0],St=qr.item?xt(qr.item,bt?.item||[],qt,Lt,Ft,Yt):void 0,Zt=St&&St.length>0,un={linkId:qr.linkId,text:qr.text};return qt&&qr.linkId===qt&&typeof Yt!="number"?(Lt||!Lt&&!Ft?un.answer=Lt:bt?.answer&&(un.answer=bt.answer),Ft?un.item=Ft:Zt&&(un.item=St)):(bt?.answer?un.answer=bt.answer:un.answer=[{}],Zt&&(un.item=St)),un}}).filter(Boolean).flat()},Xt=(mt,Qt)=>{for(const qt of mt)if(qt.linkId===Qt||qt.item&&Xt(qt.item,Qt))return qt.linkId;return null},Kt=(mt,Qt,qt,Lt)=>{var Ft;const Yt=(Ft=mt?.item)!=null?Ft:Lt;return!Yt||Yt.length===0?!0:Yt.every(On=>{var zr;const qr=K(Qt,On.linkId);if(qr.length===0){const Rn=(zr=F(Qt,On.linkId))==null?void 0:zr.answer;if(ge(On,Qt,Rn)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1}else for(const Rn of qr)if(ge(On,Qt,Rn.answer)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1;return On.item?Kt(On,Qt,qt):!0})},Ct=(mt,Qt,qt=!0)=>{for(const Lt of mt)if(Lt.linkId===Qt&&Lt.answer&&Lt.answer.length>0||Lt.item&&Lt.item.length>0&&Ct(Lt.item,Qt,qt))return!0;return!1},Xe=(mt,Qt,qt=0)=>{const Lt=mt.filter(Ft=>Ft.linkId===Qt);if(Lt.length>qt){const Ft=Lt[qt];if(Ft.answer&&Ft.answer.length>0)return Ft.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(On=>On!=null&&On!==""));if(Ft.item&&Ft.item.length>0)return Ct(Ft.item,Qt,!1)}return Ct(mt,Qt,!1)},We=(mt,Qt)=>{if(!mt||!mt.item)return!1;const qt=Lt=>{var Ft;if(Ee(Lt)&&Lt.required&&te(Lt.enableWhen,Lt.enableBehavior,Qt)){const Yt=F(Qt,Lt.linkId),On=he(Lt.extension,Lt.type,Lt.required,Lt.maxLength,Yt?.answer,Lt.answerOption);if(!((Ft=Yt?.answer)!=null&&Ft.length)||On)return!0}if(Lt.item){for(const Yt of Lt.item)if(qt(Yt))return!0}return!1};for(const Lt of mt.item)if(qt(Lt))return!0;return!1},yt=mt=>{var Qt,qt,Lt;if(mt.valueString!==void 0)return mt.valueString;if(mt.valueBoolean!==void 0)return mt.valueBoolean;if(mt.valueInteger!==void 0)return mt.valueInteger;if(mt.valueDecimal!==void 0)return mt.valueDecimal;if(mt.valueDate!==void 0)return mt.valueDate;if(mt.valueDateTime!==void 0)return mt.valueDateTime;if(((Qt=mt.valueCoding)==null?void 0:Qt.code)!==void 0)return mt.valueCoding.code;if(((qt=mt.valueReference)==null?void 0:qt.reference)!==void 0)return mt.valueReference.reference;if(((Lt=mt.valueQuantity)==null?void 0:Lt.value)!==void 0)return mt.valueQuantity.value;if(mt.valueAttachment!==void 0)return mt.valueAttachment},Ye=mt=>{const Qt={linkId:mt.linkId};if(mt.answer&&mt.answer.length>0){const qt=mt.answer.map(Lt=>yt(Lt)).filter(Lt=>Lt!==void 0);qt.length>0&&(Qt.answer=qt)}if(mt.item&&mt.item.length>0){const qt=mt.item.map(Lt=>Ye(Lt)).filter(Lt=>{const Ft=Object.keys(Lt);return Ft.length>1||Ft.length===1&&Ft[0]!=="linkId"});qt.length>0&&(Qt.item=qt)}return Qt},Qe=(mt,Qt,qt,Lt,Ft,Yt)=>{var On;const zr=(On=Qt?.item)==null?void 0:On[qt[Lt]],qr=zr?.linkId;if(!qr)return!1;const Rn=K(mt,qr),Pn=K(Ft,qr),rn=bt=>{if(bt!=null){if(Array.isArray(bt)){const St=bt.filter(Zt=>Zt!=null).map(Zt=>rn(Zt)).filter(Zt=>Zt!==void 0);return St.length===0||St.length===1&&typeof St[0]=="object"&&Object.keys(St[0]).length===0?void 0:St}if(typeof bt=="object"){const St={};for(const[Zt,un]of Object.entries(bt))if(un!=null){const on=rn(un);on!==void 0&&(St[Zt]=on)}return Object.keys(St).length===0?void 0:St}return bt}};if(Rn.length!==Pn.length)return!1;for(let bt=0;bt<Rn.length;bt++){const St=Rn[bt],Zt=Pn[bt];if(!St||!Zt)return!1;const un=Ye(rn(St)),on=Ye(rn(Zt));if(!_.isEqual(un,on))return!1}return Lt!==Yt},Pt=(mt,Qt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(mt,Qt,qt)||null,hn=(mt,Qt)=>{const qt={},Lt=Ft=>{Ft.forEach(Yt=>{const On=K(Qt,Yt.linkId);if(st(Yt,mt)||Yt.repeats)for(let zr=0;zr<On.length;zr++){const qr=On[zr];if(qr?.answer&&qr.answer.length>0){const Rn=Pt(Yt,Qt,qr.answer);Rn&&(qt[Yt.linkId]=b(f({},qt[Yt.linkId]),{[zr]:Rn}))}}else{const zr=F(Qt,Yt.linkId);if(zr?.answer&&zr.answer.length>0){const qr=Pt(Yt,Qt,zr.answer);qr&&(qt[Yt.linkId]={0:qr})}}Yt.item&&Yt.item.length>0&&Lt(Yt.item)})};return Lt(mt),qt},Sn=mt=>{if(!mt)return"";const Qt=mt.split("-");if(Qt.length===3){const[qt,Lt,Ft]=Qt;return`${qt.slice(-4)}-${Lt}-${Ft}`}return""},et=mt=>mt.trim().replace(/[A-Za-z]+/g,""),Rt=(mt,Qt)=>{const qt=(Lt,Ft)=>{for(const Yt of Lt){if(Yt.linkId===Ft)return Yt.answer;if(Yt.item&&Yt.item.length>0){const On=qt(Yt.item,Ft);if(On!==void 0)return On}}};return qt(mt,Qt)},kt=(mt,Qt)=>{if(!Qt||Qt.length===0)return null;const qt=mt.linkId,Lt=(Ft,Yt,On=[])=>{for(const zr of Ft){const qr=[...On,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return qr.some(rn=>rn.repeats===!0)?zr:null;if(Lt(zr.item,Yt,qr))return zr}}return null};return Lt(Qt,qt)},Bn=(mt,Qt)=>{if(!Qt||Qt.length===0)return!1;const qt=mt.linkId,Lt=(Ft,Yt,On=[])=>{for(const zr of Ft){const qr=[...On,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return qr.some(rn=>{const bt=M(rn.extension||[]);return!!bt&&bt!==UI_TOOLKIT_FORM_CONTAINER});if(Lt(zr.item,Yt,qr))return!0}}return!1};return Lt(Qt,qt)},Ar=(mt,Qt,qt)=>{const Lt={};if(!mt)return Lt;const{linkId:Ft}=Qt;if(mt[Ft]){const Yt=mt[Ft];Lt[Ft]=Yt[qt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(mt[Yt.linkId]){const On=mt[Yt.linkId];Lt[Yt.linkId]=On[qt]||""}}),Lt},mn=(mt,Qt)=>{const qt={};if(!mt||!mt[Qt])return qt;const Lt=mt[Qt];return qt[Qt]=Lt[0]||"",qt},Ln=mt=>{const Qt=mt.findIndex(Yt=>!Ee(Yt)),qt=Qt>=0?[Qt]:[],Lt=new Map;let Ft=null;if(mt.forEach((Yt,On)=>{const zr=ze(Yt);if(zr&&Yt.type==="group")On!==Qt&&qt.push(On),Lt.set(On,[On]),Ft=On;else if(Ft!==null&&!zr){const qr=Lt.get(Ft)||[];Lt.set(Ft,[...qr,On])}}),mt.length>0&&qt.length>0){const Yt=qt[0];if(!Lt.has(Yt)){const On=qt.find(qr=>qr>Yt),zr=[];for(let qr=Yt;qr<(On??mt.length);qr++)zr.push(qr);Lt.set(Yt,zr)}}return{groupIndices:qt,itemsToRenderMap:Lt}},fr=(mt,Qt,qt,Lt)=>{let Ft=[...Lt];const Yt=(On,zr)=>{On.forEach(qr=>{if((!qr?.enableWhen||te(qr?.enableWhen,qr.enableBehavior,zr))&&qr.initial&&!Ct(zr,qr.linkId))if(qr.repeats){const Rn=zr.filter(Pn=>Pn.linkId===qr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Xe(zr,qr.linkId,rn)||(Ft=xt(qt,Ft,qr.linkId,qr.initial,void 0,rn))}):Ft=xt(qt,Ft,qr.linkId,qr.initial)}else Ft=xt(qt,Ft,qr.linkId,qr.initial);qr.item&&Yt(qr.item,zr)})};return Yt(mt,Qt),Ft},Fn=(mt,Qt,qt)=>{if(!mt)return[];const Lt=[],Ft=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,qt)&&!Ee(Yt)&&Yt.type!=="display"&&Lt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach(Ft)};return mt.forEach(Ft),Lt},Wr=(mt,Qt)=>mt.every(qt=>{var Lt;const Ft=K(Qt,qt.linkId);if(Ft.length>0)return Ft.every(Yt=>!ge(qt,Qt,Yt.answer));{const Yt=(Lt=F(Qt,qt.linkId))==null?void 0:Lt.answer;return!ge(qt,Qt,Yt)}}),Yr=(mt,Qt)=>{let qt=-1;for(let Lt=mt.length-1;Lt>=0;Lt--)if(mt[Lt].linkId===Qt){qt=Lt;break}return qt},It=(mt,Qt)=>mt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:It(qt.item,Qt)}):qt),$e=(mt,Qt,qt=mt)=>mt.reduce((Lt,Ft)=>{const Yt=J(Qt,Ft.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,qt)||(Ft.item&&Ft.item.length>0?Lt.push(b(f({},Ft),{item:$e(Ft.item,Qt,qt)})):Lt.push(Ft)),Lt},[]),ot=(mt,Qt,qt=[])=>{const Lt=[],Ft=Yt=>{Yt.forEach(On=>{Lt.push(On.linkId),On.item&&On.item.length>0&&Ft(On.item)})};for(let Yt=0;Yt<mt.length;Yt++){const On=mt[Yt];if(On.linkId===Qt){const zr=mt.slice(0,Yt+1),qr=mt.slice(Yt+1),{kept:Rn,removed:Pn}=qr.reduce((rn,bt)=>{const St=J(qt,bt.linkId);return!St||Ee(St)&&te(St.enableWhen,St.enableBehavior,zr)?rn.kept.push(bt):rn.removed.push(bt),rn},{kept:[],removed:[]});return Ft(Pn),{trimmedData:[...zr,...Rn],trimmedLinkIds:Lt,found:!0}}if(On.item&&On.item.length>0){const zr=ot(On.item,Qt,qt);if(zr.found){const qr=mt.slice(0,Yt),Rn=mt.slice(Yt+1),Pn=[...qr,b(f({},On),{item:zr.trimmedData})],{kept:rn,removed:bt}=Rn.reduce((St,Zt)=>{const un=J(qt,Zt.linkId);return!un||Ee(un)&&te(un.enableWhen,un.enableBehavior,Pn)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return Ft(bt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Lt],found:!0}}}}return{trimmedData:mt,trimmedLinkIds:[],found:!1}},Je=(mt,Qt)=>mt.filter(qt=>!Qt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Je(qt.item,Qt)}):qt),tt=mt=>{var Qt;if(!mt)return"empty";const qt=y.Z$.find(({patterns:Lt})=>Lt.some(Ft=>mt.includes(Ft)));return(Qt=qt?.type)!=null?Qt:"empty"},rt=(mt,Qt)=>{const{groupIndices:qt}=Ln(mt),Lt=mt.findIndex(Ft=>Ft.linkId===Qt);return Lt!==-1?qt.indexOf(Lt):-1},lt=mt=>{if(!mt)return{restriction:null,warning:null};const Qt=qt=>{const Lt=mt.find(Yt=>Yt.url===qt&&Yt.valueString);if(!Lt?.valueString)return null;const Ft=Lt.valueString.replace(/\\n/g,`
|
|
870
870
|
`).split(`
|
|
871
871
|
`).map(Yt=>Yt.trim()).filter(Boolean).map(Yt=>Yt.startsWith("*")?Yt.substring(1).trim():Yt);return Ft.length===0?null:Ft.length===1?{isList:!1,items:Ft}:{isList:!0,items:Ft}};return{restriction:Qt("restriction"),warning:Qt("warning")}},Et=(mt,Qt)=>{var qt;switch(Qt.type){case"boolean-to-string":return typeof mt=="boolean"?mt?Qt.trueValue:Qt.falseValue:mt;case"map":return Qt.mapping&&mt in Qt.mapping?Qt.mapping[mt]:mt;case"date-format":return mt;case"number-format":if(typeof mt=="number"){let Lt=mt.toFixed((qt=Qt.decimals)!=null?qt:0);return Qt.prefix&&(Lt=Qt.prefix+Lt),Qt.suffix&&(Lt=Lt+Qt.suffix),Lt}return mt;case"passthrough":default:return mt}},st=(mt,Qt)=>{const qt=mt.linkId,Lt=(Yt,On,zr=[])=>{for(const qr of Yt){const Rn=[...zr,qr];if(qr.item){if(qr.item.some(bt=>bt.linkId===On))return Rn.filter(bt=>bt.repeats===!0);const rn=Lt(qr.item,On,Rn);if(rn.length>0)return rn}}return[]},Ft=Lt(Qt,qt);return Ft.length>0?Ft[Ft.length-1]:null},le=(mt,Qt)=>{if(!mt?.item)return[];const qt=[];for(const Lt of mt.item){if(Lt.type!=="group")continue;te(Lt.enableWhen,Lt.enableBehavior,Qt||[])&&Lt.linkId&&qt.push(Lt.linkId)}return qt},ye=(mt,Qt)=>{const qt=le(mt,Qt||void 0);return qt[qt.length-1]},Ue=({questionnaire:mt,extensionUrl:Qt,errorCode:qt})=>{if(!qt||!mt?.item)return;const Lt=mt.item.find(Ft=>{var Yt;return(Yt=Ft.extension)==null?void 0:Yt.some(On=>On.url===Qt&&On.valueString===qt)});return Lt?.linkId},Te=(mt,Qt)=>{var qt;const Lt=(qt=mt.extension)==null?void 0:qt.find(Yt=>Yt.url===y.rb);if(!Lt?.valueString)return;const Ft=Lt.valueString;return J(Qt,Ft)},zt=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===y.rb))},Gt=(mt,Qt)=>mt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Gt(qt.item,Qt)}):qt),vn=mt=>{const Qt=V(ANALYTICS_FORM_NAME_EXTENSION_URL,mt.extension);return Qt??k(mt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},zn=mt=>V(ANALYTICS_EVENT_NAME_EXTENSION_URL,mt.extension),ar=mt=>V(ANALYTICS_PAGE_NAME_EXTENSION_URL,mt.extension),Dt=mt=>V(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,mt.extension),we=mt=>V(ANALYTICS_OPTION_NAME_EXTENSION_URL,mt),Ze=(mt,Qt)=>{var qt,Lt,Ft;if(!mt.answerOption)return;const Yt=F(Qt,mt.linkId),On=(Ft=(Lt=(qt=Yt?.answer)==null?void 0:qt[0])==null?void 0:Lt.valueCoding)==null?void 0:Ft.code;if(!On)return;const zr=mt.answerOption.find(qr=>{var Rn;return((Rn=qr.valueCoding)==null?void 0:Rn.code)===On});if(!!zr)return we(zr.extension)},Ot=(mt,Qt)=>{const qt={},Lt=Ft=>{if(!!Ft)for(const Yt of Ft){const On=Dt(Yt);if(On){let zr;switch(Yt.type){case"choice":zr=Ze(Yt,Qt);break;default:break}zr&&(qt[On]=zr)}Yt.item&&Yt.item.length>0&&Lt(Yt.item)}};return Lt(mt.item),qt},en=mt=>!!(mt.initial&&mt.initial.length>0),nn=(mt,Qt,qt)=>{if(!mt)return[];const Lt=[],Ft=Yt=>{Yt.forEach(On=>{if(qt&&qt.includes(On.linkId))return;const zr=Ee(On),qr=Qt.includes(On.linkId);(qr||zr&&On.required)&&Lt.push(On),qr&&On.item&&On.item.length>0&&Ft(On.item)})};return Ft(mt),Lt},fn=(mt,Qt,qt,Lt,Ft,Yt)=>{var On;if(qt<0||!Lt?.item)return!0;const zr=Ft.current[qt],qr=qt+1,Rn=Ft.current[qr],Pn=qt===0?0:zr,rn=Rn??Lt.item.length,bt=[];for(let En=Pn;En<rn;En++){const Kn=(On=Lt?.item)==null?void 0:On[En];if(Kn){if(Yt&&Yt.includes(Kn.linkId))continue;const wr=Ee(Kn);(Qt.includes(Kn.linkId)||wr&&Kn.required)&&bt.push(Kn),Kn.item&&Kn.item.length>0&&bt.push(...nn(Kn.item,Qt,Yt))}}const St=bt.filter(En=>En.required===!0),Zt=bt.filter(En=>En.required!==!0),un=Wr(St,mt),on=Zt?.every(En=>{var Kn;const wr=(Kn=F(mt,En.linkId))==null?void 0:Kn.answer;return wr?!ge(En,mt,wr):!0});return!St?.length||un&&on}},28058:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(36087),s=e(8322),o=e(76260),i=e(25624);const a=({item:dr})=>{const r0=dr.text||"",Fr=dr.extension||[],ko=ki=>{var Di;return(Di=Fr.find(Ci=>Ci.url===ki))==null?void 0:Di.valueString},gi=ko(o.$7),yi=ko(o.pc)||"default";return(0,n.jsx)(r.AlertFloating,{title:r0,description:gi??"",color:yi})};var g=e(7630),c=e(16212),u=Object.defineProperty,y=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,d=(dr,r0,Fr)=>r0 in dr?u(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,O=(dr,r0)=>{for(var Fr in r0||(r0={}))A.call(r0,Fr)&&d(dr,Fr,r0[Fr]);if(y)for(var Fr of y(r0))m.call(r0,Fr)&&d(dr,Fr,r0[Fr]);return dr};const v=({item:dr})=>{const[r0,Fr]=(0,t.useState)(!1),ko=dr.extension||[],gi=nr=>{var gn;return(gn=ko.find(Un=>Un.url===nr))==null?void 0:gn.valueString},yi=gi(o.PS)||dr.text||"",ki=gi(o.Iz)||"button",Di=gi(o.VF),Ci=gi(o.PV),Pi=gi(o.vf),hi=Pi?o.JP[Pi]:void 0,yr=gi(o.D_)||"",Jn=gi(o.$e),Sr=gi(o.GQ),Le=gi(o.qT)||"gray",Ce=gi(o.hZ),Fe=gi(o.wG),ht=gi(o.q3),Ht=Sr?o.JP[Sr]:void 0,tn=()=>Fr(!0),In=()=>{switch(ki){case"icon-button":return(0,n.jsxs)("button",{onClick:tn,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":yi||yr||void 0,children:[hi&&(0,n.jsx)(hi,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),yi&&(0,n.jsx)("span",{className:"text-sm",children:yi})]});default:return(0,n.jsx)(r.Button,{color:Di??"secondary",size:Ci??"md",iconLeading:hi,onClick:tn,"aria-label":yi,children:yi})}};return(0,n.jsxs)(n.Fragment,{children:[In(),(0,n.jsx)(r.Modal,O(O(O({id:`modal-${dr.linkId}`,isOpen:r0,onOpenChange:Fr,title:{content:yr},description:{content:Jn?(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(Jn)}}):void 0},closeButton:{onCloseClick:()=>Fr(!1)}},Ht?{featuredIcon:{icon:Ht,color:Le,size:"lg",className:"bg-white"}}:{}),Ce?{primaryButton:{children:Ce,onClick:()=>{var nr,gn;Fe==="open-zendesk"&&((gn=(nr=globalThis.zE)==null?void 0:nr.activate)==null||gn.call(nr,{hideOnClose:!0})),Fr(!1)}}}:{}),ht?{secondaryButton:{children:ht,onClick:()=>Fr(!1)}}:{}))]})};var p=e(18522);const h=({item:dr})=>{var r0,Fr,ko,gi,yi,ki,Di,Ci,Pi,hi,yr,Jn;const{hasExternalError:Sr}=(0,p.c)(),Le=dr.text||"",Ce=(Fr=(r0=dr.extension)==null?void 0:r0.find(Vr=>Vr.url===o.ao))==null?void 0:Fr.valueString,Fe=Sr&&Ce?Ce:Le,ht=(gi=(ko=dr.extension)==null?void 0:ko.find(Vr=>Vr.url===o.$7))==null?void 0:gi.valueString,Ht=(ki=(yi=dr.extension)==null?void 0:yi.find(Vr=>Vr.url===o.el))==null?void 0:ki.valueString,tn=Sr&&Ht?Ht:ht,In=(Ci=(Di=dr.extension)==null?void 0:Di.find(Vr=>Vr.url===o.g4))==null?void 0:Ci.valueString,nr=(hi=(Pi=dr.extension)==null?void 0:Pi.find(Vr=>Vr.url===o.Fp))==null?void 0:hi.valueString,gn=In?o.JP[In]:void 0,Un=nr?o.JP[nr]:void 0,cn=Sr&&Un?Un:gn,lr=((Jn=(yr=dr.extension)==null?void 0:yr.find(Vr=>Vr.url===o.WS))==null?void 0:Jn.valueString)===o._W.LEFT,Ir=lr?"items-start":"items-center",t0=lr?"text-left":"text-center",A0=lr?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${Ir} gap-4`,children:[cn&&(0,n.jsx)(r.FeaturedIcon,{icon:cn,color:Sr&&Un?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${Ir} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${t0} ${A0} md:max-w-[352px]`,children:Fe}),(0,n.jsx)("p",{className:`text-md text-secondary ${t0}`,children:tn})]})]})};var f=e(15297),b=e(17814),M=Object.defineProperty,x=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,S=(dr,r0,Fr)=>r0 in dr?M(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,E=(dr,r0)=>{for(var Fr in r0||(r0={}))z.call(r0,Fr)&&S(dr,Fr,r0[Fr]);if(x)for(var Fr of x(r0))T.call(r0,Fr)&&S(dr,Fr,r0[Fr]);return dr};const C=({item:dr})=>{const[r0,Fr]=(0,t.useState)(!1),ko=(0,b.T$)(),gi=dr.extension||[],yi=Ce=>{var Fe;return(Fe=gi.find(ht=>ht.url===Ce))==null?void 0:Fe.valueString},ki=dr.text||"",Di=yi(o.PS)||"",Ci=yi(o.D_)||"",Pi=yi(o.$e),hi=yi(o.GQ),yr=yi(o.qT)||"gray",Jn=yi(o.hZ),Sr=yi(o.q3),Le=hi?o.JP[hi]: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:ki})]}),Di&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>Fr(!0),children:Di})]}),(0,n.jsx)(r.Modal,E(E(E({id:`modal-${dr.linkId}`,isOpen:r0,onOpenChange:Fr,title:{content:Ci},description:{content:Pi?(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(Pi)}}):void 0},closeButton:{onCloseClick:()=>Fr(!1)}},Le?{featuredIcon:{icon:Le,color:yr,size:"lg",className:"bg-white"}}:{}),Jn?{primaryButton:{children:Jn,onClick:()=>{Fr(!1),ko.navigate({id:"profile"})}}}:{}),Sr?{secondaryButton:{children:Sr,onClick:()=>Fr(!1)}}:{}))]})},R=({item:dr,selectedAnswer:r0,handleInputChange:Fr})=>{var ko,gi,yi;const ki=(ko=dr.answerOption)!=null?ko:[],Di=(yi=(gi=r0?.[0])==null?void 0:gi.valueCoding)==null?void 0:yi.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:ki.map(Ci=>{var Pi,hi,yr,Jn,Sr,Le,Ce;const Fe=(hi=(Pi=Ci.valueCoding)==null?void 0:Pi.code)!=null?hi:"",ht=(Jn=(yr=Ci.valueCoding)==null?void 0:yr.display)!=null?Jn:"",Ht=Di===Fe,tn=(Sr=Ci.extension)==null?void 0:Sr.find(Un=>Un.url===o.g4),In=(Le=Ci.extension)==null?void 0:Le.find(Un=>Un.url===o.rz),nr=tn?.valueString?o.JP[tn.valueString]:void 0,gn=(Ce=In?.valueString)!=null?Ce:"";return(0,n.jsx)(r.SelectableOption,{icon:nr,title:ht,description:gn,isSelected:Ht,onSelect:()=>{Fr(dr,[{valueCoding:{code:Fe,display:ht}}])}},Fe)})})};var L=e(72866),P=e(94043),D=e(94627);const N=({text:dr,isLabel:r0,required:Fr,className:ko,id:gi})=>(0,n.jsxs)("p",{id:gi,className:ko??"mb-md text-md",children:[(0,n.jsx)(r.Content,{as:"span",className:(0,P.cx)(r0&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,D.p)(dr||"")}}),Fr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),w="(###) ###-####",V=(dr,r0)=>{const Fr=dr.replace(/\D/g,"");let ko="",gi=0;for(let yi=0;yi<r0.length&&gi<Fr.length;yi++)r0[yi]==="#"?(ko+=Fr[gi],gi++):ko+=r0[yi];return ko},q=dr=>{if(!dr)return w;const r0=dr.find(Fr=>Fr.url===o.Md);return r0?.valueString||w},I=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki})=>{var Di;const{linkId:Ci,text:Pi,required:hi,prefix:yr,readOnly:Jn,extension:Sr}=dr,Le=q(Sr),Ce=((Di=Fr?.[0])==null?void 0:Di.valueString)||"",[Fe,ht]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Ce){const gn=V(Ce,Le);ht(gn)}},[Ce,Le]);const Ht=Pi?(0,i.nt)(gi,yr,Pi):"",tn=yi?.[Ci]||"",In=gn=>{const Un=V(gn,Le);ht(Un),ko(dr,[{valueString:Un}])},nr=()=>{r0&&r0(Ci)};return(0,n.jsxs)("div",{"data-testid":Ci,children:[Ht&&(0,n.jsx)(N,{isLabel:!0,text:Ht,required:hi||!1}),(0,n.jsx)(r.Input,{id:Ci,"aria-label":Ci,"data-testid":Ci,type:"tel",placeholder:"Enter phone number",value:Fe,onChange:In,onBlur:nr,isDisabled:Jn||ki,isRequired:hi,hint:tn,isInvalid:!!tn,size:"md"},Ci)]})},k=({item:dr,questionnaireSchemaItems:r0})=>{var Fr;const{isLoading:ko,setCurrentGroupIndex:gi}=(0,p.c)(),yi=(Fr=dr.extension)==null?void 0:Fr.find(Pi=>Pi.url===o.Uf),ki=yi?.valueString,Di=dr.text||"Save & continue",Ci=()=>{if(ki){const Pi=(0,i.Ue)(r0||[],ki);Pi!==-1&&gi(Pi)}};return(0,n.jsx)("div",{"data-testid":dr.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:ko,onClick:Ci,isDisabled:dr.readOnly,children:Di})})},U=({size:dr=24,color:r0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:dr,height:dr,stroke:r0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},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 F=e(56327);const K=({size:dr=24,color:r0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:dr,height:dr,stroke:r0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},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 se=({size:dr=24,color:r0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:dr,height:dr,stroke:r0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},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"}));se.displayName="Mail01";var oe=e(31165),te=e(14449),pe=e(27163);const be=dr=>{try{const r0=dr.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!r0)return dr;const[,Fr,ko,gi]=r0;return new Date(Date.UTC(parseInt(Fr),parseInt(ko)-1,parseInt(gi))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return dr}},Se=dr=>{try{if(dr.includes("AM")||dr.includes("PM"))return dr;const r0=dr.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!r0)return dr;const[,Fr,ko]=r0,gi=parseInt(Fr),yi=gi>=12?"PM":"AM";return`${gi%12||12}:${ko} ${yi}`}catch{return dr}},ge=(dr,r0,Fr=f.d)=>{var ko;const gi=(ko=dr.extension)==null?void 0:ko.find(yi=>yi.url===o.g4);return gi?.valueString&&o.JP[gi.valueString]?o.JP[gi.valueString]:dr.linkId&&r0[dr.linkId]?r0[dr.linkId]:Fr},ne={"appointment-review/first-name":U,"appointment-review/last-name":U,"appointment-review/dob":F.V,"appointment-review/gender":K,"appointment-review/phone":G.b,"appointment-review/email":se,"appointment-review/vaccines":r.Vaccine,"appointment-review/appointment-date":F.V,"appointment-review/appointment-time":oe.z,"appointment-review/facility-name":r.HospitalBuilding,"appointment-review/facility-phone":G.b,"appointment-review/facility-address":te.X},ae=["appointment-review/appointment-date"],me=["appointment-review/appointment-time"],he=["appointment-review/facility-phone"],de=["appointment-review/facility-address"],ue=["appointment-review/phone","appointment-review/facility-phone"],re=({item:dr,questionnaireSchemaItems:r0})=>{var Fr;const{setCurrentGroupIndex:ko}=(0,p.c)(),{trackEvent:gi}=(0,s.st)(),yi=dr.item||[];if(yi.length===0)return null;const ki=(Fr=dr.extension)==null?void 0:Fr.find(hi=>hi.url===o.Uf),Di=ki?.valueString,Ci=()=>{if(gi("edit_info_clicked",{section:dr.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),Di){const hi=(0,i.Ue)(r0||[],Di);hi!==-1&&ko(hi)}},Pi=yi.map(hi=>{let yr="";if(hi.initial&&hi.initial.length>0){const Le=hi.initial.map(Ce=>{var Fe,ht;let Ht=((Fe=Ce.valueCoding)==null?void 0:Fe.display)||((ht=Ce.valueReference)==null?void 0:ht.display)||Ce.valueString||"";return Ht&&typeof Ht=="string"&&(ae.includes(hi.linkId)?Ht=be(Ht):me.includes(hi.linkId)&&(Ht=Se(Ht))),Ht}).filter(Boolean);Le.length>1||hi.repeats&&Le.length>0?yr=Le:Le.length===1&&(yr=Le[0])}if(!yr||Array.isArray(yr)&&yr.length===0)return null;let Jn;he.includes(hi.linkId)?Jn="phone":de.includes(hi.linkId)&&(Jn="address");let Sr;return ue.includes(hi.linkId)&&(Sr="phone"),{Icon:ge(hi,ne),label:hi.text||hi.linkId,value:yr,linkType:Jn,displayType:Sr}}).filter(Boolean);return Pi.length===0?null:(0,n.jsx)("div",{"data-testid":dr.linkId,children:(0,n.jsx)(pe.InfoCard,{title:dr.text||"Details",infoDetails:Pi,actionButtonText:Di&&"Edit info",onActionButtonClick:Di?Ci:void 0})})},J=({size:dr=24,color:r0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:dr,height:dr,stroke:r0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},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 ve=e(18807);const Ee=({item:dr})=>{const{setHideFooterButton:r0,incrementCustomErrorCount:Fr,decrementCustomErrorCount:ko}=(0,p.c)();return(0,t.useEffect)(()=>(r0(!0),Fr(),()=>{r0(!1),ko()}),[r0,Fr,ko]),(0,n.jsx)("div",{"data-testid":dr.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,ve.p)(dr.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"},ze=({item:dr})=>{var r0,Fr,ko,gi;const{incrementCustomErrorCount:yi,decrementCustomErrorCount:ki,setHideFooterButton:Di}=(0,p.c)(),[Ci,Pi]=(0,t.useState)(!1),hi=(r0=dr.extension)==null?void 0:r0.find(Fe=>Fe.url===o.gi),yr=(ko=(Fr=hi?.valueCodeableConcept)==null?void 0:Fr.coding)==null?void 0:ko.find(Fe=>Fe.system===o.tn),Jn=yr?.code||"error",Sr=De[Jn]||"error";(0,t.useEffect)(()=>{if(Sr==="error")return yi(),Di(!0),Pi(!0),()=>{ki(),Di(!1)};Pi(!0)},[Sr,yi,ki,Di]);const Le=yr?.display||"Error",Ce=(gi=dr.text)!=null?gi:"";return Ci?(0,n.jsx)("div",{"data-testid":dr.linkId,children:(0,n.jsx)(r.InfoBanner,{type:Sr,title:Le,description:Ce})}):null};var Ie=e(65735);const xe=({configKey:dr,customErrorConfigurations:r0})=>{if(!r0)return null;const Fr=r0[dr];if(!Fr)return null;const{icon:ko,title:gi,description:yi,primaryButton:ki,secondaryButton:Di}=Fr;return(0,n.jsx)(r.EmptyState,{className:"mt-5xl",title:gi,description:yi,featuredIconProps:{icon:ko,color:"gray"},primaryButton:ki,secondaryButton:Di})},_e=10,at=({item:dr,customErrorConfigurations:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki})=>{var Di,Ci,Pi,hi;const{trackEvent:yr}=(0,s.st)(),{setHideFooterButton:Jn}=(0,p.c)(),{linkId:Sr,text:Le,required:Ce,answerOption:Fe,prefix:ht,readOnly:Ht}=dr,tn=dr?.type==="reference",In=(Di=Fr?.map(kn=>{var Ur,c0;return tn?(Ur=kn.valueReference)==null?void 0:Ur.display:(c0=kn.valueCoding)==null?void 0:c0.code}).filter(kn=>kn!==void 0))!=null?Di:[],[nr,gn]=(0,t.useState)(In.length),Un=Le?(0,i.nt)(gi,ht,Le):"",cn=(Pi=(Ci=dr.extension)==null?void 0:Ci.find(kn=>kn.url===o.Z_))==null?void 0:Pi.valueInteger,lr=(hi=Fe?.map(kn=>{var Ur,c0,so,E0;return{value:tn?((Ur=kn.valueReference)==null?void 0:Ur.display)||"":((c0=kn.valueCoding)==null?void 0:c0.code)||"",label:tn?((so=kn.valueReference)==null?void 0:so.display)||"":((E0=kn.valueCoding)==null?void 0:E0.display)||"",valueReference:kn.valueReference}}))!=null?hi:[],Ir=yi?.[Sr],t0=lr.length>_e,A0=t0?lr.slice(0,_e):lr,Vr=t0?lr.slice(_e):[],C0=Vr.some(kn=>In?.includes(kn?.value)),[fo,ut]=(0,t.useState)(C0);if(!(dr.answerOption&&dr.answerOption.length>0))return Jn(!0),(0,n.jsx)(xe,{configKey:dr.linkId,customErrorConfigurations:r0});const Mn=lr.filter(kn=>In?.includes(kn?.value)).map(kn=>{var Ur;const{restriction:c0,warning:so}=tn?(0,i.eC)((Ur=kn.valueReference)==null?void 0:Ur.extension):{restriction:null,warning:null};return{label:kn.label,restriction:c0,warning:so}}).filter(kn=>kn.restriction||kn.warning),jn=(kn,Ur)=>{var c0;yr("vaccine_type_checkbox_selected",{on_or_off:kn?"on":"off",vaccine:Ur,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let so;if(kn){const E0=lr.find(Q0=>Q0.value===Ur);so=[...(c0=Fr?.filter(Q0=>Object.keys(Q0).length!==0))!=null?c0:[],tn?{valueReference:E0?.valueReference}:{valueCoding:{code:Ur,display:E0?.label}}],gn(Q0=>Q0+1)}else so=Fr?.filter(E0=>{var Q0,wo;return tn?((Q0=E0.valueReference)==null?void 0:Q0.display)!==Ur:((wo=E0.valueCoding)==null?void 0:wo.code)!==Ur})||[{}],gn(E0=>E0-1);ko&&ko(dr,so)};return(0,n.jsxs)("div",{"data-testid":Sr,children:[Un&&(0,n.jsx)(N,{text:Un,required:Ce||!1}),t0&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:A0.map((kn,Ur)=>{const c0=In?.includes(kn?.value),so=!c0&&cn?nr>=cn:!1;return(0,n.jsx)("div",{className:Ur!==A0.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":kn.value,id:Ur.toString(),name:kn.label,isInvalid:!!Ir,isSelected:c0,label:kn.label,onChange:E0=>jn(E0,kn.value),isDisabled:Ht||ki||so})},Ur)})}),t0&&!fo&&!C0&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(r.Button,{type:"button",onClick:()=>{ut(!0),yr("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:Ht||ki,children:"See all"})}),t0&&fo&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),t0&&fo&&(0,n.jsx)("div",{children:Vr.map((kn,Ur)=>{const c0=In?.includes(kn?.value),so=!c0&&cn?nr>=cn:!1;return(0,n.jsx)("div",{className:Ur!==Vr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":kn.value,id:(_e+Ur).toString(),name:kn.label,isInvalid:!!Ir,isSelected:c0,label:kn.label,onChange:E0=>jn(E0,kn.value),isDisabled:Ht||ki||so})},_e+Ur)})}),(0,n.jsx)(r.HintText,{isInvalid:!!Ir,children:Ir}),Mn.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:Mn.map((kn,Ur)=>(0,n.jsxs)("div",{children:[kn.restriction&&(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Restriction] ${kn.label}`,description:kn.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:kn.restriction.items.map((c0,so)=>(0,n.jsx)("li",{className:"text-sm",children:c0},so))}):(0,n.jsx)("p",{className:"text-sm",children:kn.restriction.items[0]})}),kn.warning&&(0,n.jsx)("div",{className:kn.restriction?"mt-2":"",children:(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Warning] ${kn.label}`,description:kn.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:kn.warning.items.map((c0,so)=>(0,n.jsx)("li",{className:"text-sm",children:c0},so))}):(0,n.jsx)("p",{className:"text-sm",children:kn.warning.items[0]})})})]},Ur))})]})};var pt=e(76323),xt=e(56192),Xt=e(66267),Kt=Object.defineProperty,Ct=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertySymbols,yt=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Qe=(dr,r0,Fr)=>r0 in dr?Kt(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,Pt=(dr,r0)=>{for(var Fr in r0||(r0={}))yt.call(r0,Fr)&&Qe(dr,Fr,r0[Fr]);if(We)for(var Fr of We(r0))Ye.call(r0,Fr)&&Qe(dr,Fr,r0[Fr]);return dr},hn=(dr,r0)=>Ct(dr,Xe(r0)),Sn=(dr,r0,Fr)=>new Promise((ko,gi)=>{var yi=Ci=>{try{Di(Fr.next(Ci))}catch(Pi){gi(Pi)}},ki=Ci=>{try{Di(Fr.throw(Ci))}catch(Pi){gi(Pi)}},Di=Ci=>Ci.done?ko(Ci.value):Promise.resolve(Ci.value).then(yi,ki);Di((Fr=Fr.apply(dr,r0)).next())});const et=({item:dr,handleInputChange:r0,onCompleteHandler:Fr,errors:ko})=>{const{i18n:{t:gi},loading:yi}=(0,Xt.E_)({keys:["shared-translations"]}),{trackEvent:ki}=(0,s.st)(),{linkId:Di,required:Ci,readOnly:Pi}=dr,hi=ko?.[Di]||"",[yr,Jn]=(0,t.useState)(pt.LocationType.CURRENT_LOCATION),[Sr,Le]=(0,t.useState)(""),Ce=(0,t.useRef)({}),[Fe,ht]=(0,t.useState)([{id:pt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:pt.LocationType.ADDRESS,label:"Address"},{id:pt.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:Ht,setIsLoading:tn,setIsCurrentFormValid:In,isCurrentFormValid:nr}=(0,p.c)(),{position:gn,loading:Un,locationPermission:cn}=(0,pt.useDeviceLocationContext)(),{queryParams:lr,setQueryParams:Ir}=(0,pt.useSearchQueryParams)(),[t0,{loading:A0}]=(0,xt.qtq)({fetchPolicy:"cache-first"}),[Vr,{loading:C0}]=(0,xt.YyG)({fetchPolicy:"cache-first"}),fo=dr.item?(0,i.Yo)(dr.item,"postal-code"):void 0,ut=dr.item?(0,i.Yo)(dr.item,"state"):void 0,$t=dr.item?(0,i.Yo)(dr.item,"latitude"):void 0,Mn=dr.item?(0,i.Yo)(dr.item,"longitude"):void 0,jn=j0=>{if(!j0||!fo)return Le(""),!1;const Po=(0,i.zj)(fo.extension,fo.type,!1,fo.maxLength,[{valueString:j0}]);return Po?(Le(yr!==pt.LocationType.ZIP_CODE?gi("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Po),!1):(Le(""),!0)},kn=()=>{const{latitude:j0,longitude:Po,state:K0,zipcode:M0}=Ce.current;return!!(j0&&Po&&K0&&M0)},Ur=(0,t.useCallback)(j0=>{Ce.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},dr.item&&(ut&&r0(ut,[{valueString:""}]),$t&&r0($t,[{valueDecimal:void 0}]),Mn&&r0(Mn,[{valueDecimal:void 0}]),fo&&r0(fo,[{valueString:""}])),Ir({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:j0,locationPermission:cn}),In&&In(!1),Le("")},[r0,dr.item,$t,cn,Mn,In,Ir,ut,fo]);(0,t.useEffect)(()=>{if(!Ci)return;!kn()&&In&&In(!1)},[nr,Ci,In]);const c0=j0=>{Ce.current=Pt(Pt({},Ce.current),j0),j0.addressDescription&&ki("address_selected",{value:j0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),Q0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,Ce.current.zipcode,Ce.current.placeId,Ce.current.addressDescription)},so=j0=>Sn(void 0,null,function*(){var Po,K0,M0;if(Le(""),Ce.current.zipcode=j0,In&&In(!1),jn(j0)){ki("zip_code_entered",{value:j0,_event_metadata:{description:"A user entered a zip code."}});const Mo=yield Vr({variables:{location:j0}}),U0=(Po=Mo?.data)==null?void 0:Po.geocoding,Bi=Mo?.error;if(U0){const Bo=U0.stateCode||"",Si=(K0=U0.latitude)!=null?K0:void 0,Ma=(M0=U0.longitude)!=null?M0:void 0;c0({latitude:Si,longitude:Ma,state:Bo,zipcode:j0,placeId:void 0,addressDescription:void 0})}else Bi&&(c0({latitude:void 0,longitude:void 0,state:void 0,zipcode:j0,placeId:void 0,addressDescription:void 0}),Le(gi("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else Q0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,j0)}),E0=()=>{const j0=Ce.current.zipcode||"";!j0||yr!==pt.LocationType.ZIP_CODE||jn(j0)};(0,t.useEffect)(()=>{lr.locationType&&(Jn(lr.locationType),lr.locationType===pt.LocationType.ZIP_CODE&&lr.zipCode&&so(lr.zipCode),lr.locationType===pt.LocationType.ADDRESS&&lr.placeId&&lr.addressDescription&&(Ce.current.addressDescription=lr.addressDescription,Ce.current.placeId=lr.placeId))},[]),(0,t.useEffect)(()=>{const j0=[pt.LocationPermissionEnum.DENIED,pt.LocationPermissionEnum.UNAVAILABLE,pt.LocationPermissionEnum.BLOCKED].includes(lr.locationPermission),Po=[pt.LocationPermissionEnum.GRANTED,pt.LocationPermissionEnum.PROMPT].includes(lr.locationPermission);if(j0&&Fe.length!==2){if(ht([{id:pt.LocationType.ADDRESS,label:"Address"},{id:pt.LocationType.ZIP_CODE,label:"Zip code"}]),yr===pt.LocationType.CURRENT_LOCATION||!lr.locationType||lr.locationType===""){const K0=lr.locationType===pt.LocationType.ZIP_CODE?pt.LocationType.ZIP_CODE:pt.LocationType.ADDRESS;Jn(K0),Ir(hn(Pt({},lr),{locationType:K0})),Ur(K0)}Le("")}Po&&Fe.length!==3&&ht([{id:pt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:pt.LocationType.ADDRESS,label:"Address"},{id:pt.LocationType.ZIP_CODE,label:"Zip code"}])},[yr,cn,Fe.length,lr,Ir,Ur]);const Q0=(j0,Po,K0,M0,Mo,U0)=>{if(!dr.item)return;ut&&r0(ut,[{valueString:K0||""}]),$t&&r0($t,[{valueDecimal:j0}]),Mn&&r0(Mn,[{valueDecimal:Po}]),fo&&r0(fo,[{valueString:M0||""}]),Ir(hn(Pt({},lr),{lat:String(j0),lng:String(Po),location:`${j0},${Po}`,zipCode:M0||"",placeId:Mo||"",addressDescription:U0||"",locationPermission:cn}));const Bi=kn()&&jn(M0||"");In&&In(Bi),Fr&&Fr(Di)};(0,t.useEffect)(()=>{const j0=()=>Sn(void 0,null,function*(){var Po;try{const K0=yield t0({variables:{latitude:String(gn?.coords.latitude),longitude:String(gn?.coords.longitude)}}),M0=(Po=K0?.data)==null?void 0:Po.geocodingByLatLon,Mo=M0?.stateCode||"",U0=M0?.zipCode||"";(!U0||!Mo)&&Le(gi("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),c0({latitude:gn?.coords.latitude,longitude:gn?.coords.longitude,state:Mo,zipcode:U0,placeId:void 0,addressDescription:void 0})}catch{Jn(pt.LocationType.ADDRESS)}});yr===pt.LocationType.CURRENT_LOCATION&&gn&&j0()},[yr,gn]);const wo=j0=>{if(!j0||!j0.latitude||!j0.longitude||!j0.zipCode||!j0.stateCode){c0({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),j0&&typeof j0.value=="string"&&j0.value.trim().length!==0&&Le(gi("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}c0({latitude:j0.latitude,longitude:j0.longitude,state:j0.stateCode,zipcode:j0.zipCode,placeId:j0.placeId,addressDescription:j0.description})};return(0,t.useEffect)(()=>{tn(Un||A0||C0||yi)},[Un,A0,C0,yi,tn]),(0,t.useEffect)(()=>{lr.locationType!==yr&&Ir(hn(Pt({},lr),{locationType:yr}))},[yr]),(0,n.jsxs)("div",{"data-testid":dr.linkId,children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:Ci||!1}),(0,n.jsx)(r.Select,{id:Di,"aria-label":Di,"data-testid":Di,isDisabled:Pi||A0||C0||Ht,selectedKey:yr,onSelectionChange:j0=>{var Po;ki("location_type_input_selected",{choice:(Po=Fe.find(({id:K0})=>K0===j0))==null?void 0:Po.label,_event_metadata:{description:"A user changed the location type input."}}),j0!==yr&&(Ur(j0),Jn(j0))},hint:hi,isInvalid:!!hi,items:Fe,placeholder:"Select an option",isRequired:Ci,children:j0=>(0,n.jsx)(r.Select.Item,{id:j0.id,"data-testid":j0.id,value:j0,children:j0.label},j0.id)},Di),yr===pt.LocationType.CURRENT_LOCATION&&(0,n.jsx)(r.HintText,{isInvalid:!!Sr,children:Sr}),yr===pt.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:Ci||!1}),(0,n.jsx)(pt.AddressTypeahead,{onValueChange:wo,isDisabled:Ht,setIsLoading:tn,initialValue:{placeId:Ce.current.placeId||"",description:Ce.current.addressDescription||""},errorText:Sr||hi})]}),yr===pt.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:Ci||!1}),(0,n.jsx)(r.Input,{isRequired:Ci,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${Di}-zipcode`,placeholder:"Type your response here...",value:Ce.current.zipcode||"",onChange:so,onBlur:E0,isDisabled:Pi||C0||Ht,hint:Sr||hi,isInvalid:!!Sr||!!hi,autoComplete:"postal-code"},`${Di}-zipcode`)]})]})},Rt=dr=>(0,n.jsx)(pt.DeviceLocationProvider,{children:(0,n.jsx)(et,Pt({},dr))}),kt={[o.cX]:Rt,[o.G6]:re,[o.c3]:at,[o.AA]:ze,[o.mO]:h,[o.PM]:k,[o.HH]:I,[o.Us]:Ee,[o.Tl]:R,[o.G0]:v,[o.m3]:a,[o.PU]:C,[o.XP]:g.l,[o.uH]:L.v,[o.it]:Ie.d};var Bn,Ar=new Uint8Array(16);function mn(){if(!Bn&&(Bn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Bn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bn(Ar)}const Ln=/^(?:[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 fr(dr){return typeof dr=="string"&&Ln.test(dr)}const Fn=fr;for(var Wr=[],Yr=0;Yr<256;++Yr)Wr.push((Yr+256).toString(16).substr(1));function It(dr){var r0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Fr=(Wr[dr[r0+0]]+Wr[dr[r0+1]]+Wr[dr[r0+2]]+Wr[dr[r0+3]]+"-"+Wr[dr[r0+4]]+Wr[dr[r0+5]]+"-"+Wr[dr[r0+6]]+Wr[dr[r0+7]]+"-"+Wr[dr[r0+8]]+Wr[dr[r0+9]]+"-"+Wr[dr[r0+10]]+Wr[dr[r0+11]]+Wr[dr[r0+12]]+Wr[dr[r0+13]]+Wr[dr[r0+14]]+Wr[dr[r0+15]]).toLowerCase();if(!Fn(Fr))throw TypeError("Stringified UUID is invalid");return Fr}const $e=It;function ot(dr,r0,Fr){dr=dr||{};var ko=dr.random||(dr.rng||mn)();if(ko[6]=ko[6]&15|64,ko[8]=ko[8]&63|128,r0){Fr=Fr||0;for(var gi=0;gi<16;++gi)r0[Fr+gi]=ko[gi];return r0}return $e(ko)}const Je=ot,tt=(dr,r0="application/octet-stream")=>{try{const Fr=window.atob(dr),ko=new Uint8Array(Fr.length);for(let yi=0;yi<Fr.length;yi++)ko[yi]=Fr.charCodeAt(yi);return new Blob([ko],{type:r0}).size}catch{return 0}},rt=(dr,r0)=>`data:${r0};base64,${dr}`,lt=(dr,r0,Fr=512)=>{const ko=window.atob(dr),gi=[];for(let ki=0;ki<ko.length;ki+=Fr){const Di=ko.slice(ki,ki+Fr),Ci=new Array(Di.length);for(let hi=0;hi<Di.length;hi++)Ci[hi]=Di.charCodeAt(hi);const Pi=new Uint8Array(Ci);gi.push(Pi)}const yi=new Blob(gi,{type:r0});return URL.createObjectURL(yi)},Et=dr=>{const r0=new Date().toISOString().replace(/[:.-]/g,"");return`${dr.split(" ").join("-")}_${r0}`},st=4e3,le=.8,ye=(dr,r0)=>{var Fr,ko;const gi=(Fr=r0?.maxDimension)!=null?Fr:st,yi=(ko=r0?.quality)!=null?ko:le;return new Promise((ki,Di)=>{if(!dr.type.startsWith("image/")){ki(dr);return}if(dr.type==="image/heic"||dr.type==="image/heif"||dr.name.toLowerCase().endsWith(".heic")||dr.name.toLowerCase().endsWith(".heif")){ki(dr);return}const Pi=new Image,hi=new FileReader;hi.onload=()=>{const yr=hi.result;Pi.onload=()=>{let{width:Jn,height:Sr}=Pi;if(Jn>gi||Sr>gi){const Ht=gi/Math.max(Jn,Sr);Jn=Math.round(Jn*Ht),Sr=Math.round(Sr*Ht)}const Le=document.createElement("canvas");Le.width=Jn,Le.height=Sr;const Ce=Le.getContext("2d");if(!Ce){ki(dr);return}Ce.drawImage(Pi,0,0,Jn,Sr);const Fe=dr.type==="image/png"?"image/png":"image/jpeg",ht=dr.type==="image/png"?void 0:yi;Le.toBlob(Ht=>{if(!Ht||Ht.size>=dr.size){ki(dr);return}ki(new File([Ht],dr.name,{type:Fe}))},Fe,ht)},Pi.onerror=()=>{Di(new Error(`Failed to load image: ${dr.name}`))},Pi.src=yr},hi.onerror=()=>{Di(new Error(`Failed to read file: ${dr.name}`))},hi.readAsDataURL(dr)})},Ue=50,Te=(dr,r0=Ue)=>{if(dr.length<=r0)return dr;const Fr=dr.lastIndexOf("."),ko=Fr!==-1?dr.slice(Fr):"",gi=Fr!==-1?dr.slice(0,Fr):dr,yi=r0-ko.length-1,ki=Math.ceil(yi/2),Di=Math.floor(yi/2);return`${gi.slice(0,ki)}\u2026${gi.slice(-Di)}${ko}`};var zt=Object.defineProperty,Gt=Object.defineProperties,vn=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertySymbols,ar=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,we=(dr,r0,Fr)=>r0 in dr?zt(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,Ze=(dr,r0)=>{for(var Fr in r0||(r0={}))ar.call(r0,Fr)&&we(dr,Fr,r0[Fr]);if(zn)for(var Fr of zn(r0))Dt.call(r0,Fr)&&we(dr,Fr,r0[Fr]);return dr},Ot=(dr,r0)=>Gt(dr,vn(r0)),en=(dr,r0,Fr)=>new Promise((ko,gi)=>{var yi=Ci=>{try{Di(Fr.next(Ci))}catch(Pi){gi(Pi)}},ki=Ci=>{try{Di(Fr.throw(Ci))}catch(Pi){gi(Pi)}},Di=Ci=>Ci.done?ko(Ci.value):Promise.resolve(Ci.value).then(yi,ki);Di((Fr=Fr.apply(dr,r0)).next())});const nn=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki})=>{const{linkId:Di,text:Ci,required:Pi,prefix:hi,readOnly:yr,repeats:Jn,extension:Sr}=dr,Le=(0,i.Qr)(Sr),Ce=(0,i.cz)(Sr),Fe=(0,i.$H)(Sr)||"image/*,.pdf,.doc,.docx",ht=Ci?(0,i.nt)(gi,hi,Ci):"",Ht=yi?.[Di]||"",[tn,In]=(0,t.useState)([]),nr=(0,t.useRef)(Fr||[]);(0,t.useEffect)(()=>{Fr&&(nr.current=Fr)},[Fr]),(0,t.useEffect)(()=>{Fr?.length&&In(t0=>{const A0=t0.filter(C0=>C0.isLoading||C0.failed);return[...Fr.filter(C0=>C0.valueAttachment).map((C0,fo)=>{var ut,$t,Mn,jn,kn;const Ur=((ut=C0.valueAttachment)==null?void 0:ut.title)||`attachment-${fo}`,c0=($t=C0.valueAttachment)==null?void 0:$t.id,so=t0.find(wo=>c0&&wo.id===c0||!c0&&wo.id===`existing-${fo}`),E0=(Mn=C0.valueAttachment)==null?void 0:Mn.data,Q0=E0?tt(E0,(jn=C0.valueAttachment)==null?void 0:jn.contentType):0;return{id:c0||so?.id||`existing-${fo}`,name:Ur,size:so?.size||Q0,progress:100,failed:!1,type:(0,i.J4)((kn=C0.valueAttachment)==null?void 0:kn.contentType),isLoading:!1}}),...A0]})},[Fr]);const gn=t0=>{let A0=Array.from(t0);if(Ce!==void 0){const C0=Ce-tn.length;if(C0<=0)return;A0=A0.slice(0,C0)}const Vr=A0.map(C0=>{const fo=Le&&C0.size>Le,ut=C0.name.replace(/\s+/g,"-");return{id:Je(),name:ut,size:C0.size,progress:0,type:(0,i.J4)(C0.type),failed:!!fo,isLoading:!fo,disableRetry:!!fo,errorMessage:fo?`File size exceeds ${(Le/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});In(C0=>[...C0,...Vr]),Vr.filter(C0=>!C0.failed).forEach(C0=>{const fo=A0.find(ut=>ut.name.replace(/\s+/g,"-")===C0.name);fo&&Un(fo,C0.id)})},Un=(t0,A0)=>en(void 0,null,function*(){try{const Vr=yield ye(t0),C0=yield Ir(Vr),fo=Vr.name.replace(/\s+/g,"-");In(jn=>jn.map(kn=>kn.id===A0?Ot(Ze({},kn),{isLoading:!1,progress:100,failed:!1}):kn));const ut={valueAttachment:{id:A0,contentType:Vr.type,data:C0,title:fo}},Mn=[...(nr.current||[]).filter(jn=>jn.valueAttachment||Object.keys(jn).length>0),ut];nr.current=Mn,ko(dr,Mn),r0(Di)}catch{In(C0=>C0.map(fo=>fo.id===A0?Ot(Ze({},fo),{isLoading:!1,failed:!0}):fo))}}),cn=t0=>{const A0=tn.find(Vr=>Vr.id===t0);if(In(Vr=>Vr.filter(C0=>C0.id!==t0)),A0){const Vr=(nr.current||[]).filter((C0,fo)=>{var ut;if(t0.startsWith("existing-")){const $t=parseInt(t0.replace("existing-",""));return fo!==$t}return((ut=C0.valueAttachment)==null?void 0:ut.id)!==t0}).filter(C0=>C0.valueAttachment||Object.keys(C0).length>0);nr.current=Vr,ko(dr,Vr.length>0?Vr:[{}])}},lr=t0=>{const A0=tn.find(Vr=>Vr.id===t0);if(A0){In(C0=>C0.map(fo=>fo.id===t0?Ot(Ze({},fo),{failed:!1,isLoading:!0,progress:0}):fo));const Vr=new File([""],A0.name,{type:"application/octet-stream"});Un(Vr,t0)}},Ir=t0=>new Promise((A0,Vr)=>{const C0=new FileReader;C0.onload=()=>{const ut=C0.result.split(",")[1];A0(ut)},C0.onerror=Vr,C0.readAsDataURL(t0)});return(0,n.jsxs)("div",{children:[ht&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:ht,required:Pi||!1}),(0,n.jsx)(r.FileUpload,{files:tn,onDropFiles:gn,onDeleteFile:cn,onRetryFile:lr,onDropUnacceptedFiles:()=>{},hint:(0,i.od)(Fe,Le,Ce),accept:Fe,allowsMultiple:Jn!==!1,isDisabled:yr||ki||Ce!==void 0&&tn.length>=Ce,className:"w-full",showDisclosureModal:!0}),Ht&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:Ht})]})},fn=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki})=>{var Di,Ci;const{linkId:Pi,text:hi,prefix:yr,readOnly:Jn,required:Sr,extension:Le}=dr,{trackQuestionnaireEvent:Ce}=(0,p.c)(),Fe=hi?(0,i.nt)(gi,yr,hi):"",ht=yi?.[Pi];return Le?.find(tn=>{var In,nr;return tn.url===o.gD&&((nr=(In=tn.valueCodeableConcept)==null?void 0:In.coding)==null?void 0:nr.some(gn=>gn.system===o.n4&&gn.code===o.GI))})?(0,n.jsxs)("div",{"data-testid":Pi,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":Pi,children:[(0,n.jsx)(r.Checkbox,{size:"md",id:Pi,name:Pi,isDisabled:Jn||ki,isSelected:(Di=Fr?.[0])==null?void 0:Di.valueBoolean,"aria-label":Pi,label:"",className:"mt-1",onChange:tn=>{Ce(dr.linkId,{value:tn}),ko(dr,[{valueBoolean:tn}]),r0(dr.linkId)}}),Fe&&(0,n.jsx)(N,{isLabel:!0,text:Fe,required:Sr||!1})]}),(0,n.jsx)(r.HintText,{isInvalid:!!ht,children:ht})]}):(0,n.jsxs)("div",{"data-testid":Pi,children:[Fe&&(0,n.jsx)(N,{isLabel:!0,text:Fe,required:Sr||!1}),(0,n.jsxs)(r.RadioGroup,{size:"md",id:Pi,name:Pi,"aria-label":Pi,value:String((Ci=Fr?.[0])==null?void 0:Ci.valueBoolean)||"",onChange:tn=>{ko(dr,[{valueBoolean:tn==="true"}]),r0(dr.linkId)},isInvalid:!!ht,children:[(0,n.jsx)(r.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Jn||ki}),(0,n.jsx)(r.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Jn||ki})]},Pi),ht&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:ht})})]})};var mt=Object.defineProperty,Qt=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable,Ft=(dr,r0,Fr)=>r0 in dr?mt(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,Yt=(dr,r0)=>{for(var Fr in r0||(r0={}))qt.call(r0,Fr)&&Ft(dr,Fr,r0[Fr]);if(Qt)for(var Fr of Qt(r0))Lt.call(r0,Fr)&&Ft(dr,Fr,r0[Fr]);return dr};const On=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki,placeholder:Di,hintText:Ci})=>{var Pi,hi,yr;const{linkId:Jn,text:Sr,required:Le,answerOption:Ce,prefix:Fe,readOnly:ht}=dr,Ht=Sr?(0,i.nt)(gi,Fe,Sr):"",tn=Ce?.map(gn=>{var Un,cn,lr,Ir;return{id:((Un=gn.valueCoding)==null?void 0:Un.code)||gn.valueString||"",label:((cn=gn.valueCoding)==null?void 0:cn.display)||gn.valueString||"",value:((lr=gn.valueCoding)==null?void 0:lr.code)||gn.valueString||"",extension:gn.extension||[],system:((Ir=gn.valueCoding)==null?void 0:Ir.system)||void 0}})||[],In=((hi=(Pi=Fr?.[0])==null?void 0:Pi.valueCoding)==null?void 0:hi.code)||((yr=Fr?.[0])==null?void 0:yr.valueString)||"",nr=yi?.[Jn];return(0,n.jsxs)("div",{children:[Ht&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ht,required:Le||!1}),(0,n.jsx)(r.Select,{id:Jn,"aria-label":Jn,"data-testid":Jn,isDisabled:ht||ki,selectedKey:In,onSelectionChange:gn=>{const Un=String(gn),cn=tn.find(t0=>t0.value===Un),lr=cn?cn.label:"",Ir=Boolean(Ce?.find(t0=>t0.valueString===Un));ko(dr,[Ir?{valueString:Un}:{valueCoding:Yt({code:Un,display:lr},cn?.system?{system:cn.system}:{}),extension:cn?.extension||[]}]),r0(dr.linkId)},isInvalid:!!nr,hint:nr||Ci,items:tn,placeholder:Di,isRequired:Le,children:gn=>(0,n.jsx)(r.Select.Item,{id:gn.id,"data-testid":gn.value,value:gn.value,children:gn.label},gn.id)},Jn)]})};var zr=Object.defineProperty,qr=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable,rn=(dr,r0,Fr)=>r0 in dr?zr(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,bt=(dr,r0)=>{for(var Fr in r0||(r0={}))Rn.call(r0,Fr)&&rn(dr,Fr,r0[Fr]);if(qr)for(var Fr of qr(r0))Pn.call(r0,Fr)&&rn(dr,Fr,r0[Fr]);return dr};const St=dr=>{var r0,Fr,ko;const{item:gi,selectedAnswer:yi,updatedText:ki,required:Di,errorMessage:Ci}=dr,Pi=gi?.type==="reference",hi=(r0=yi?.map(Ce=>{var Fe,ht;return Pi?(Fe=Ce.valueReference)==null?void 0:Fe.display:(ht=Ce.valueCoding)==null?void 0:ht.code}).filter(Ce=>Ce!==void 0))!=null?r0:[],[yr,Jn]=(0,t.useState)(hi.length),Sr=(ko=(Fr=gi.extension)==null?void 0:Fr.find(Ce=>Ce.url===o.Z_))==null?void 0:ko.valueInteger,Le=(Ce,Fe)=>{var ht,Ht,tn;let In;if(Ce){const nr=dr.options.find(gn=>gn.value===Fe);In=[...(Ht=(ht=dr.selectedAnswer)==null?void 0:ht.filter(gn=>Object.keys(gn).length!==0))!=null?Ht:[],Pi?{valueReference:nr?.valueReference}:{valueCoding:bt({code:Fe,display:nr?.label},nr?.system?{system:nr.system}:{}),extension:nr?.extension||[]}],Jn(gn=>gn+1)}else In=((tn=dr.selectedAnswer)==null?void 0:tn.filter(nr=>{var gn,Un;return Pi?((gn=nr.valueReference)==null?void 0:gn.display)!==Fe:((Un=nr.valueCoding)==null?void 0:Un.code)!==Fe}))||[{}],Jn(nr=>nr-1);dr.handleInputChange(dr.item,In)};return(0,n.jsxs)("div",{"data-testid":gi.linkId,children:[ki&&(0,n.jsx)(N,{isLabel:!0,text:ki,required:Di||!1}),(0,n.jsx)("div",{children:dr.options.map((Ce,Fe)=>(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Ce.value,id:Fe.toString(),className:Fe!==dr.options.length-1?"mb-2xl":"",name:Ce.label,isInvalid:!!Ci,isSelected:hi?.includes(Ce?.value),label:Ce.label,onChange:ht=>Le(ht,Ce.value),isDisabled:dr.readOnly||dr.isLoading||(!hi?.includes(Ce?.value)&&Sr?yr>=Sr:!1)},Fe))}),(0,n.jsx)(r.HintText,{isInvalid:!!Ci,children:Ci})]})},Zt=({item:dr,onCompleteHandler:r0,updatedText:Fr,options:ko,handleInputChange:gi,errorMessage:yi,readOnly:ki,initialValue:Di,selectedAnswer:Ci,isLoading:Pi,required:hi})=>{var yr,Jn;const Sr=`${dr.linkId}-label`,Le=`${dr.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":dr.linkId,children:[Fr&&(0,n.jsx)(N,{id:Sr,isLabel:!0,text:Fr,required:hi||!1}),(0,n.jsx)(r.RadioGroup,{size:"md",id:dr.linkId,name:dr.linkId,"aria-labelledby":Fr?Sr:void 0,"aria-describedby":yi?Le:void 0,isRequired:hi,className:ko.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Jn=(yr=Ci?.[0])==null?void 0:yr.valueCoding)==null?void 0:Jn.code)||Di||"",onChange:Ce=>{const Fe=Ce,ht=ko.find(tn=>tn.value===Fe),Ht=ht?ht.label:"";gi(dr,[{valueCoding:{code:Fe,display:Ht,system:ht?.system||void 0},extension:ht?.extension||[]}]),r0(dr.linkId)},isInvalid:!!yi,children:ko.map(Ce=>(0,n.jsx)(r.RadioButton,{size:"md","data-testid":Ce.value,isDisabled:ki||Pi,value:Ce.value,label:Ce.label},Ce.value))},dr.linkId),yi&&(0,n.jsx)("div",{id:Le,children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:yi})})]})};var un=Object.defineProperty,on=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,wr=(dr,r0,Fr)=>r0 in dr?un(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,$r=(dr,r0)=>{for(var Fr in r0||(r0={}))En.call(r0,Fr)&&wr(dr,Fr,r0[Fr]);if(on)for(var Fr of on(r0))Kn.call(r0,Fr)&&wr(dr,Fr,r0[Fr]);return dr};const Kr=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki,placeholder:Di,hintText:Ci})=>{var Pi,hi,yr,Jn,Sr;const{linkId:Le,text:Ce,required:Fe,answerOption:ht,prefix:Ht,readOnly:tn}=dr,In=dr?.type==="reference",nr=Ce?(0,i.nt)(gi,Ht,Ce):"",Un=(()=>{var Vr,C0;const fo=ht?.find(ut=>ut.initialSelected===!0);return fo?In?((Vr=fo.valueReference)==null?void 0:Vr.display)||"":((C0=fo?.valueCoding)==null?void 0:C0.code)||"":""})(),cn=(ht?.map(Vr=>{var C0,fo,ut,$t,Mn;return{label:((C0=Vr?.valueCoding)==null?void 0:C0.display)||((fo=Vr?.valueReference)==null?void 0:fo.display)||"",value:In?((ut=Vr.valueReference)==null?void 0:ut.display)||"":(($t=Vr.valueCoding)==null?void 0:$t.code)||"",valueReference:In?Vr.valueReference:{},extension:Vr.extension||[],system:((Mn=Vr.valueCoding)==null?void 0:Mn.system)||""}})||[]).filter(Vr=>Vr.label),lr=yi?.[Le],Ir=(Sr=(Jn=(yr=(hi=(Pi=dr?.extension)==null?void 0:Pi.find(Vr=>Vr.url.includes("questionnaire-itemControl")))==null?void 0:hi.valueCodeableConcept)==null?void 0:yr.coding)==null?void 0:Jn[0])==null?void 0:Sr.code;let t0=null;const A0={item:dr,onCompleteHandler:r0,updatedText:nr,options:cn,handleInputChange:ko,errorMessage:lr,required:Fe,readOnly:tn,initialValue:Un,selectedAnswer:Fr,isLoading:ki,showQuestionPrefix:gi,placeholder:Di,hintText:Ci};switch(Ir){case"drop-down":t0=(0,n.jsx)(On,$r({},A0));break;case"check-box":t0=(0,n.jsx)(St,$r({},A0));break;case"radio-button":t0=(0,n.jsx)(Zt,$r({},A0));break}return(0,n.jsx)(n.Fragment,{children:t0})};var d0=e(73697),No=e(71924),_0=e(46776);const lo=dr=>`${String(dr.month).padStart(2,"0")}/${String(dr.day).padStart(2,"0")}/${dr.year}`,X0=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki,placeholder:Di,hintText:Ci})=>{var Pi,hi,yr;const{linkId:Jn,text:Sr,required:Le,prefix:Ce,readOnly:Fe}=dr,ht=(0,t.useRef)(null),[Ht,tn]=(0,t.useState)(!1),[In,nr]=(0,t.useState)(null),{setIsCurrentFormValid:gn,isCurrentFormValid:Un,trackQuestionnaireEvent:cn}=(0,p.c)(),lr=Sr?(0,i.nt)(gi,Ce,Sr):"",Ir=yi?.[Jn]||"",t0=(Pi=dr.extension)==null?void 0:Pi.find(K0=>K0.url===o.dU),A0=(hi=dr.extension)==null?void 0:hi.find(K0=>K0.url===o.bK),Vr=(0,t.useMemo)(()=>{var K0;const M0=t0?.valueString||t0?.valueDate;return M0||(0,i.iI)((K0=t0?.valueExpression)==null?void 0:K0.expression)},[t0]),C0=(0,t.useMemo)(()=>{var K0;const M0=A0?.valueString||A0?.valueDate;return M0||(0,i.iI)((K0=A0?.valueExpression)==null?void 0:K0.expression)},[A0]),fo=(0,t.useMemo)(()=>{if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{return(0,d0._U)(Vr)}catch{}return(0,d0._U)("1900-01-01")},[Vr]),ut=(0,t.useMemo)(()=>{if(C0&&/^\d{4}-\d{2}-\d{2}$/.test(C0))try{return(0,d0._U)(C0)}catch(K0){console.warn("Failed to parse maxDateStr:",C0,K0)}return(0,d0._U)("2099-12-31")},[C0]),Mn=(K0=>{if(!K0)return"";const M0=K0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!M0)return K0;const[,Mo,U0,Bi]=M0;return`${U0}/${Bi}/${Mo}`})(((yr=Fr?.[0])==null?void 0:yr.valueDate)||""),jn=K0=>{if(!K0)return"";const M0=K0.replace(/\D/g,"");if(M0.length===0)return"";if(M0.length<=2)return M0.length===2?`${M0}/`:M0;const Mo=Bi=>{const Bo=Bi.slice(0,2),Si=Bi.slice(2);return Si.length===2?`${Bo}/${Si}/`:`${Bo}/${Si}`},U0=Bi=>{const Bo=Bi.slice(0,2),Si=Bi.slice(2,4),Ma=Bi.slice(4,8);return`${Bo}/${Si}/${Ma}`};return M0.length<=4?Mo(M0):U0(M0)},kn=()=>{if(Fe||ki)return;if(Mn.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const M0=(0,d0._U)(Mn);nr(M0)}catch{nr(null)}else{const M0=Mn.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(M0){const[,Mo,U0,Bi]=M0,Bo=parseInt(Mo,10),Si=parseInt(U0,10);if(Bo>=1&&Bo<=12&&Si>=1&&Si<=31)try{const Ma=(0,d0._U)(`${Bi}-${Mo}-${U0}`);nr(Ma)}catch{nr(null)}else nr(null)}else nr(null)}tn(!0)},Ur=()=>{if(In){const K0=`${In.year}-${String(In.month).padStart(2,"0")}-${String(In.day).padStart(2,"0")}`;cn(dr.linkId,{value:(0,i.CP)(`${String(In.month).padStart(2,"0")}/${String(In.day).padStart(2,"0")}/${In.year}`)}),ko(dr,[{valueDate:(0,i.Fy)(K0)}])}tn(!1),nr(null)},c0=()=>{tn(!1),nr(null)},so=K0=>{var M0;const Mo=((M0=ht.current)==null?void 0:M0.selectionStart)||0,U0=Mn,Bi=jn(K0),Bo=Bi.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Bo){const[,Si,Ma,Ki]=Bo,Bs=parseInt(Si,10),Vs=parseInt(Ma,10),Gi=parseInt(Ki,10);if(E0(Bs,Vs,Gi).isValid){const f1=`${Ki}-${Si}-${Ma}`;cn(dr.linkId,{value:(0,i.CP)(`${Si}/${Ma}/${Ki}`)}),ko(dr,[{valueDate:(0,i.Fy)(f1)}])}else ko(dr,[{valueDate:Bi}])}else ko(dr,[{valueDate:Bi}]);setTimeout(()=>{if(ht.current){const Si=U0.replace(/\D/g,""),Ma=Bi.replace(/\D/g,"");let Ki=Mo;Bi===U0&&(Ki=Mo-1),Ma.length>=Si.length&&Bi!==U0?Bi[Mo-1]==="/"?Ki=Mo+1:Ki=Mo:Ma.length<Si.length&&(U0[Mo-1]==="/"?Ki=Math.max(0,Mo-1):Ki=Mo),ht.current.setSelectionRange(Ki,Ki)}},0)},E0=(K0,M0,Mo)=>{if(K0<1||K0>12)return{isValid:!1,error:"Month must be between 01 and 12"};if(M0<1||M0>31)return{isValid:!1,error:"Day must be between 01 and 31"};const U0=new Date(Mo,K0,0).getDate();if(M0>U0)return{isValid:!1,error:"Invalid day for the selected month"};if(Vr||C0){const Bi=new No.ng(Mo,K0,M0);if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{const Bo=(0,d0._U)(Vr);if(Bi.compare(Bo)<0){const Si=(0,i.di)(o.Ck,dr.extension);if(Si)return{isValid:!1,error:Si};const Ma=lo(Bo);return{isValid:!1,error:`Date must be on or after ${Ma}`}}}catch{}if(C0&&/^\d{4}-\d{2}-\d{2}$/.test(C0))try{const Bo=(0,d0._U)(C0);if(Bi.compare(Bo)>0){const Si=(0,i.di)(o.Cx,dr.extension);if(Si)return{isValid:!1,error:Si};const Ma=lo(Bo);return{isValid:!1,error:`Date must be on or before ${Ma}`}}}catch{}}return{isValid:!0,error:""}},Q0=()=>{const K0=Mn.replace(/\D/g,"");if(K0.length>0&&K0.length<8){r0(dr.linkId);return}const M0=Mn.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!M0&&K0.length>=6){r0(dr.linkId);return}if(M0){const[,Mo,U0,Bi]=M0,Bo=parseInt(Mo,10),Si=parseInt(U0,10),Ma=parseInt(Bi,10);if(E0(Bo,Si,Ma).isValid){const Ki=`${Bi}-${Mo}-${U0}`;ko(dr,[{valueDate:(0,i.Fy)(Ki)}])}}r0(dr.linkId)},j0=(()=>{if(!Mn)return"";const K0=Mn.replace(/\D/g,"");if(K0.length>0&&K0.length<8)return"";const M0=Mn.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!M0&&K0.length>=6)return Un&&gn(!1),"Invalid date";if(M0){const[,Mo,U0,Bi]=M0,Bo=parseInt(Mo,10),Si=parseInt(U0,10),Ma=parseInt(Bi,10),{isValid:Ki,error:Bs}=E0(Bo,Si,Ma);if(!Ki)return Un&&gn(!1),Bs||"Invalid date"}return""})(),Po=!!Ir||!!j0;return(0,n.jsxs)("div",{children:[lr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:lr,required:Le||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Fe||ki,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",(Fe||ki)&&"cursor-not-allowed opacity-50"),onClick:kn,"aria-label":"Open calendar",children:(0,n.jsx)(F.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",(Fe||ki)&&"bg-disabled_subtle")}),(0,n.jsx)(r.Input,{ref:ht,isRequired:Le,size:"md",type:"text",name:Jn,"data-testid":Jn,id:Jn,value:Mn,onChange:so,placeholder:Di,isDisabled:Fe||ki,onBlur:Q0,hint:j0||Ir||Ci,isInvalid:Po,className:(0,P.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Jn)]}),(0,n.jsx)(r.Modal,{id:"calendar-date-picker-modal",isOpen:Ht,onOpenChange:K0=>{K0||c0()},primaryButton:{children:"Apply",onClick:Ur,isDisabled:!In},secondaryButton:{children:"Cancel",onClick:c0},children:(0,n.jsx)(_0.lr,{value:In,onChange:nr,minValue:fo,maxValue:ut,children:(0,n.jsx)(r.Calendar,{showDateInput:!1,minValue:fo,maxValue:ut,onYearPickerOpen:()=>{nr(null)}})})})]})},Ro=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki})=>{var Di;const{linkId:Ci,text:Pi,required:hi,prefix:yr,readOnly:Jn}=dr,Sr=Pi?(0,i.nt)(gi,yr,Pi):"",Le=yi?.[Ci]||"";return(0,n.jsxs)("div",{children:[Sr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Sr,required:hi||!1}),(0,n.jsx)(r.Input,{isRequired:hi,size:"md",type:"datetime-local",id:Ci,"aria-label":Ci,"data-testid":Ci,placeholder:"Type your response here...",value:((Di=Fr?.[0])==null?void 0:Di.valueDateTime)||"",onChange:Ce=>{let Fe=Ce;const[ht,Ht]=Fe.split("T");ht&&Ht&&(Fe=`${(0,i.Fy)(ht)}T${Ht}:00`),ko(dr,[{valueDateTime:Fe}])},isDisabled:Jn||ki,onBlur:()=>{r0(dr.linkId)},hint:Le,isInvalid:!!Le},Ci)]})},vr=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki,placeholder:Di,hintText:Ci})=>{var Pi;const{linkId:hi,text:yr,required:Jn,prefix:Sr,readOnly:Le}=dr,Ce=yr?(0,i.nt)(gi,Sr,yr):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(dr),Ht=(Pi=Fr?.[0])==null?void 0:Pi.valueDecimal,[tn,In]=(0,t.useState)(String(Ht??""));return(0,t.useEffect)(()=>{In(String(Ht??""))},[Ht]),(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:Jn||!1}),(0,n.jsx)(r.Input,{isRequired:Jn,size:"md",id:hi,"aria-label":hi,"data-testid":hi,placeholder:Di,value:tn,onChange:nr=>{In(nr)},isDisabled:Le||ki,onBlur:()=>{const nr=parseFloat(tn);In(isNaN(nr)?"":String(nr)),ko(dr,[{valueDecimal:isNaN(nr)?void 0:nr}]),r0(dr.linkId)},type:"number",hint:Fe||Ci,isInvalid:!!Fe,autoComplete:ht},hi)]})},mr=({item:dr,showStepper:r0=!1})=>{var Fr;const{text:ko,linkId:gi,type:yi}=dr,ki=ko&&(0,i.nt)(!1,"",ko),Di=(Fr=dr.extension)==null?void 0:Fr.find(yr=>yr.url===o.Yt),Ci=Di?.valueBoolean===!0,Pi=yi==="group"&&(0,i.$O)(dr)!==void 0,hi=()=>{const yr=(0,i.$O)(dr),Jn=(0,i.t7)(dr);if(yr===void 0||Jn===void 0||Jn<=0)return[];const Sr=[];for(let Le=1;Le<=Jn;Le++){let Ce="incomplete";Le<yr?Ce="complete":Le===yr&&(Ce="current"),Sr.push({title:"",description:"",status:Ce})}return Sr};return ki&&!Ci?(0,n.jsxs)("div",{"data-testid":gi,children:[(0,n.jsx)(N,{text:ki,required:!1,className:""}),r0&&Pi&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(r.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:hi()})})]}):null},br=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki,placeholder:Di,hintText:Ci})=>{var Pi;const{linkId:hi,text:yr,required:Jn,prefix:Sr,readOnly:Le}=dr,Ce=yr?(0,i.nt)(gi,Sr,yr):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Jn||!1}),(0,n.jsx)(r.Input,{isRequired:Jn,"data-testid":hi,size:"md",id:hi,"aria-label":hi,placeholder:Di,value:String((Pi=Fr?.[0])==null?void 0:Pi.valueInteger)||"",onChange:Ht=>{ko(dr,[{valueInteger:Number(Ht)}])},isDisabled:Le||ki,onBlur:()=>{r0(dr.linkId)},type:"number",hint:Fe||Ci,isInvalid:!!Fe,autoComplete:ht},hi)]})},R0=({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki,placeholder:Di,hintText:Ci})=>{var Pi,hi,yr;const{linkId:Jn,text:Sr,extension:Le,required:Ce,prefix:Fe,readOnly:ht}=dr,Ht=Sr?(0,i.nt)(gi,Fe,Sr):"",tn=Le?.find(gn=>gn.url.includes("questionnaire-unitOption")),In=yi?.[Jn],nr=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Ht&&(0,n.jsx)(N,{isLabel:!0,text:Ht,required:Ce||!1}),(0,n.jsx)(r.InputGroup,{isRequired:Ce,size:"md",id:Jn,"aria-label":Jn,"data-testid":Jn,value:(Pi=Fr?.[0])!=null&&Pi.valueQuantity?String((hi=Fr[0].valueQuantity)==null?void 0:hi.value):"",onChange:gn=>{ko(dr,[{valueQuantity:{value:parseFloat(gn)}}])},isDisabled:ht||ki,onBlur:()=>{var gn,Un,cn;const lr=(gn=Fr?.[0])!=null&&gn.valueQuantity?parseFloat(String((cn=(Un=Fr?.[0])==null?void 0:Un.valueQuantity)==null?void 0:cn.value)).toFixed(2):"";ko(dr,[{valueQuantity:{value:parseFloat(lr)}}]),r0(dr.linkId)},hint:In||Ci,isInvalid:!!In,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:(yr=tn?.valueCoding)==null?void 0:yr.display}),children:(0,n.jsx)(r.InputBase,{type:"number",placeholder:Di,autoComplete:nr})},Jn)]})};var h0=e(61784);const to="ui-toolkit-modern",Fo={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",SUBMIT:"SUBMIT"},Uo={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},li={[Uo.CURRENT_LOCATION]:Fo.CURRENT_LOCATION,[Uo.ZIP_CODE]:Fo.ZIP_CODE,[Uo.ADDRESS]:Fo.ADDRESS},Li={mi:{singular:Fo.MILE,plural:Fo.MILES}},Ri=({resourceData:dr,handleInputChange:r0,item:Fr,questionnaireSchemaItems:ko})=>{var gi;const{t:yi}=(0,h0.SS)(),{queryParams:ki}=(0,pt.useSearchQueryParams)(),Di=ki.locationType||"",{setCurrentGroupIndex:Ci,handleContinueButtonClick:Pi,setHideFooterButton:hi}=(0,p.c)(),{trackEvent:yr}=(0,s.st)();(0,t.useEffect)(()=>{if(!Fr.readOnly)return hi(!0),()=>{hi(!1)}},[Fr.readOnly,hi]);const Jn=(gi=Fr.extension)==null?void 0:gi.find(Un=>Un.url===o.Uf),Sr=Jn?.valueString,Le=()=>{if(Sr){const Un=(0,i.Ue)(ko||[],Sr);Un!==-1&&Ci(Un)}},Ce=Un=>{const cn=Un.find(lr=>lr.url.includes("description"));return cn?.valueString||""},Fe=Un=>{const cn=Un.find(C0=>C0.url.includes("distance-value")),lr=Un.find(C0=>C0.url.includes("distance-unit")),Ir=cn?.valueString?Number(cn.valueString):NaN,t0=lr?.valueString||"";if(!t0||isNaN(Ir))return null;const A0=Math.round(Ir);let Vr=t0;return Li[t0]&&(Vr=yi(A0===1?Li[t0].singular:Li[t0].plural)),Di&&li[Di]?yi(Fo.LOCATION_DISTANCE,{distance:`${A0} ${Vr}`,locationType:yi(li[Di])}):yi(Fo.LOCATION_DISTANCE_AWAY,{distance:`${A0} ${Vr}`})},ht=Un=>({id:Un.id||"",providerName:Un.name||"",specialty:"",distance:Fe(Un.extension||[])||"",placeholderIcon:r.WalgreensLogo,address:Un.address||"",valueReference:Un.valueReference||{reference:Un.id}}),Ht=Un=>{var cn,lr,Ir,t0;const A0=Un;return ht({id:A0.id,name:(cn=A0.name)!=null?cn:"",address:(t0=(Ir=(lr=A0?.address)==null?void 0:lr.line)==null?void 0:Ir[0])!=null?t0:"",extension:A0?.extension,valueReference:{reference:A0.id}})},tn=Un=>ht({id:Un?.reference,name:Un?.display,address:Ce(Un?.extension||[]),extension:Un?.extension,valueReference:Un}),nr=(()=>dr&&Array.isArray(dr)&&dr.length>0?dr.map(Ht):Fr.initial&&Array.isArray(Fr.initial)&&Fr.initial.length>0?Fr.initial.map(Un=>tn(Un.valueReference)):Fr.answerOption?Fr.answerOption.map(Un=>tn(Un.valueReference)):[])(),gn=Un=>{r0(Fr,[{valueReference:Un}])};return(0,n.jsx)("div",{className:(0,r.cx)("gap-md flex flex-col",!Fr.readOnly&&"pb-4xl"),children:Fr.readOnly?nr.map(({address:Un,id:cn,providerName:lr,placeholderIcon:Ir,distance:t0})=>(0,n.jsx)(pt.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ir},locationName:lr,address:Un,distance:t0,actionButtonText:Sr?"Change location":void 0,onActionButtonClick:Sr?Le:void 0},cn)):nr.map(({address:Un,id:cn,providerName:lr,placeholderIcon:Ir,specialty:t0,valueReference:A0,distance:Vr})=>(0,n.jsx)(r.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ir},providerName:{content:lr},specialty:{content:t0},location:{address:Un,distance:Vr},actionButton:{children:"Schedule appointment",onClick:()=>{yr("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:Un,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),gn(A0),Pi?.()}}},cn))})};var ci=e(79079),Ni=e(32066),fi=e(43915),qi=e(36181),Ui=e(37234),ja=e(59931),Pr=e(65388),tr=Object.defineProperty,Zr=Object.defineProperties,Lr=Object.getOwnPropertyDescriptors,V0=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,Vn=Object.prototype.propertyIsEnumerable,Er=(dr,r0,Fr)=>r0 in dr?tr(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,u0=(dr,r0)=>{for(var Fr in r0||(r0={}))bn.call(r0,Fr)&&Er(dr,Fr,r0[Fr]);if(V0)for(var Fr of V0(r0))Vn.call(r0,Fr)&&Er(dr,Fr,r0[Fr]);return dr},Qn=(dr,r0)=>Zr(dr,Lr(r0));const Xn="tz-code",oo={"ui-toolkit/LocationCard":Ri,"ui-toolkit/TimeSlotSelection":({resourceData:dr,item:r0,handleInputChange:Fr,selectedAnswer:ko,questionnaireSchemaItems:gi,formData:yi,onCompleteHandler:ki})=>{var Di,Ci;const{t:Pi}=(0,ci.S)(),{trackEvent:hi}=(0,s.st)(),{isLoading:yr,setIsInlineNextQuestionTriggered:Jn}=(0,p.c)(),Sr=M0=>{const Mo=M0.match(/^(\d{4}-\d{2}-\d{2})/);return Mo?Mo[1]:M0},Le=M0=>{const Mo=M0.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return Mo?`${Mo[1]} ${Mo[2]}`:M0},Ce=M0=>{const Mo=M0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(Mo){const[,U0,Bi,Bo]=Mo;return new Date(parseInt(U0),parseInt(Bi)-1,parseInt(Bo))}return new Date},ht=(()=>{var M0;if((M0=ko?.[0])!=null&&M0.valueReference){const Mo=ko[0].valueReference,U0=Mo.display||"",Bi=Sr(U0);if(Bi)return{date:Ce(Bi),slotId:Mo.reference||""}}return{date:new Date,slotId:""}})(),[Ht,tn]=(0,t.useState)(ht.date),[In,nr]=(0,t.useState)(ht.slotId),[gn,Un]=(0,t.useState)(new Set),cn=(0,t.useMemo)(()=>new No.ng(Ht.getFullYear(),Ht.getMonth()+1,Ht.getDate()),[Ht]),lr=M0=>({display:M0.display||"",id:M0.id||"",start:M0.start||"",extension:Array.isArray(M0.extension)?M0.extension:[],identifier:Array.isArray(M0.identifier)?M0.identifier:[],type:M0.type||""}),Ir=M0=>lr({display:M0.start?Le(M0.start):"",id:M0.id,start:M0.start,extension:M0.extension,identifier:M0.identifier}),t0=M0=>lr({display:M0?.display||"",id:M0?.reference,start:M0?.display,extension:M0?.extension,identifier:M0?.identifier,type:M0?.type}),A0=()=>{if(Array.isArray(dr)&&dr.length>0)return dr.filter(M0=>M0.resourceType==="Appointment").map(Ir);if(r0.initial&&Array.isArray(r0.initial)&&r0.initial.length>0)return r0.initial.map(M0=>t0(M0.valueReference));if(r0.answerOption)return r0.answerOption.map(M0=>t0(M0.valueReference))},Vr=(0,t.useMemo)(()=>A0()||[],[dr,ko,r0]),C0=(0,t.useMemo)(()=>{const M0={};return Vr.forEach(Mo=>{if(Mo.start&&Mo.id){const U0=Sr(Mo.start);M0[U0]||(M0[U0]=[]),M0[U0].push({display:Mo.display,id:Mo.id,start:Mo.start,extension:Mo.extension})}}),M0},[Vr]),fo=(0,t.useMemo)(()=>{const M0=Object.keys(C0).sort(),Mo=[];if(M0.length===0)return Mo.push(cn),gn.forEach(Bo=>{const Si=(0,fi.A)(Bo);Mo.push(new No.ng(Si.getFullYear(),Si.getMonth()+1,Si.getDate()))}),Mo;const U0=(0,fi.A)(M0[M0.length-1]),Bi=new No.ng(U0.getFullYear(),U0.getMonth()+1,U0.getDate());for(let Bo=cn;Bo.compare(Bi)<=0;Bo=Bo.add({days:1})){const Si=`${Bo.year}-${String(Bo.month).padStart(2,"0")}-${String(Bo.day).padStart(2,"0")}`;C0[Si]||Mo.push(Bo)}if(!(0,i.mR)(r0)){const Bo=(0,Ni.Ec)((0,Ni.Xj)()).add({days:30});let Si=Bi.add({days:1});for(;Si.compare(Bo)<=0;)Mo.push(Si),Si=Si.add({days:1})}return gn.forEach(Bo=>{const Si=(0,fi.A)(Bo),Ma=new No.ng(Si.getFullYear(),Si.getMonth()+1,Si.getDate());Mo.some(Ki=>Ki.year===Ma.year&&Ki.month===Ma.month&&Ki.day===Ma.day)||Mo.push(Ma)}),Mo},[C0,gn,cn,r0]),ut=(0,t.useMemo)(()=>(0,i.mR)(r0)?r.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[r0]),$t=(0,t.useMemo)(()=>Object.keys(C0).map(M0=>{const Mo=(0,fi.A)(M0);return new No.ng(Mo.getFullYear(),Mo.getMonth()+1,Mo.getDate())}),[C0]),Mn=(0,qi.A)((0,Ui.A)(Ht),"yyyy-MM-dd"),jn=(0,t.useMemo)(()=>C0[Mn]||[],[C0,Mn]);(0,t.useEffect)(()=>{const M0=Object.entries(C0).sort(([Mo],[U0])=>Mo.localeCompare(U0)).slice(0,3).reduce((Mo,[U0,Bi])=>Qn(u0({},Mo),{[`${U0} ${so}`]:Bi.map(Bo=>{var Si;return(0,Pr.YX)({time:Bo.start,timeZone:(0,i.lv)((Si=jn[0])==null?void 0:Si.extension)}).time})}),{});hi("slots_returned",{Specialty:"Vaccines",first_three_days_slots:M0,_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 kn=t.useRef(null),Ur=t.useRef(null),c0=t.useRef(!1);(0,t.useEffect)(()=>{var M0;const Mo=Object.keys(C0).sort();Mo.length===0||c0.current||(c0.current=!0,(M0=ko?.[0])!=null&&M0.valueReference||tn((0,fi.A)(Mo[0])))},[C0]),(0,t.useEffect)(()=>{var M0;const Mo=Object.keys(C0).sort();if(Mo.length===0)return;const Bi=!(kn.current===null)&&JSON.stringify(kn.current)!==JSON.stringify(C0);if(kn.current=C0,!!Bi&&(Un(new Set),Ur.current)){const Bo=Ur.current;if(!(((M0=C0[Bo])==null?void 0:M0.length)>0)){const Ma=new Set,Ki=(0,fi.A)(Bo),Bs=(0,fi.A)(Mo[0]);let Vs=Ki;for(;Vs<Bs;){const Gi=(0,qi.A)(Vs,"yyyy-MM-dd");Ma.add(Gi),Vs=new Date(Vs),Vs.setDate(Vs.getDate()+1)}Un(Ma),nr("")}Ur.current=null}},[C0]);const so=(0,t.useMemo)(()=>{var M0;const Mo=jn[0];if(!Mo?.extension)return"";const U0=Mo.extension.find(Bi=>Bi?.url===Xn);try{return(0,ja.formatToTimeZone)(new Date,"(z)",{timeZone:(M0=U0?.valueCode)!=null?M0:""})}catch{return""}},[jn]),E0=(0,t.useMemo)(()=>{const M0=Pi(r.Translations.NEXT_AVAILABLE_APPOINTMENTS);return so?`${M0} ${so}`:M0},[Pi,so]),Q0=(0,t.useMemo)(()=>{const M0=(0,Ni.Ec)((0,Ni.Xj)()).add({days:ut}),Mo=`${M0.year}-${String(M0.month).padStart(2,"0")}-${String(M0.day).padStart(2,"0")}`,Bi=Object.keys(C0).sort().find(Bo=>Bo>Mn&&Bo<=Mo);if(Bi){const Bo=(0,fi.A)(Bi);return new No.ng(Bo.getFullYear(),Bo.getMonth()+1,Bo.getDate())}return null},[C0,Mn,ut]),wo=()=>{if(Q0){const M0=Q0.toDate((0,Ni.Xj)());tn(M0),nr("")}},j0=M0=>{if(!M0){nr(""),Fr(r0,void 0);return}nr(M0.id);const Mo=[{valueReference:{display:M0.display,reference:M0.id,extension:M0.extension,identifier:M0.identifier,type:M0.type}}];Fr(r0,Mo)},Po=M0=>{var Mo;if(!M0||yr||!c0.current)return;const U0=Object.keys(C0).sort(),Bi=U0[U0.length-1],Bo=U0[0],Si=`${M0.year}-${String(M0.month).padStart(2,"0")}-${String(M0.day).padStart(2,"0")}`;if(Bi&&(Si>Bi||Bo&&Si<Bo)&&(0,i.mR)(r0)&&gi&&!fo?.some(Ki=>Ki.compare(M0)===0)){const Ki=(0,i.yQ)(r0,gi);if(Ki){Ur.current=Si;let Bs="-06:00";if((Mo=Vr[0])!=null&&Mo.start){const js=Vr[0].start.match(/([+-]\d{2}:\d{2})$/);js&&(Bs=js[1])}const Gi=[{valueDateTime:`${Si}T23:59:59${Bs}`}],f1=Fr(Ki,Gi);Fr(r0,void 0,(0,i.Nw)(f1||yi||[],r0.linkId),void 0,!0),Jn(!0),ki(Ki.linkId,!0,!0)}}const Ma=M0.toDate((0,Ni.Xj)());tn(Ma),nr("")},K0=M0=>{if(!M0)return;const Mo=jn.find(U0=>U0.id===M0);hi("slot_selected",{Specialty:"Vaccines",time_slot:Mo?(0,Pr.YX)({time:Mo.start,timeZone:(0,i.lv)(jn[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."}}),j0(Mo??null)};return(0,n.jsx)(r.TimeSlot,{onChange:Po,disabledDates:fo,highlightedDates:$t,loading:yr,minValue:(0,Ni.Ec)((0,Ni.Xj)()),maxValue:(0,Ni.Ec)((0,Ni.Xj)()).add({days:ut}),value:cn,defaultValue:cn,appointmentSlots:{title:E0,onChange:K0,defaultValue:ko&&((Ci=(Di=ko[0])==null?void 0:Di.valueReference)==null?void 0:Ci.reference)||void 0,value:In||void 0,items:jn.map(M0=>({label:Se(M0.start),value:M0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[Pi(r.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),Q0&&(0,n.jsx)("button",{onClick:wo,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:Pi(r.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var qo=Object.defineProperty,ea=Object.defineProperties,ji=Object.getOwnPropertyDescriptors,aa=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,S0=Object.prototype.propertyIsEnumerable,Ua=(dr,r0,Fr)=>r0 in dr?qo(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,ps=(dr,r0)=>{for(var Fr in r0||(r0={}))So.call(r0,Fr)&&Ua(dr,Fr,r0[Fr]);if(aa)for(var Fr of aa(r0))S0.call(r0,Fr)&&Ua(dr,Fr,r0[Fr]);return dr},Os=(dr,r0)=>ea(dr,ji(r0)),ys=(dr,r0)=>{var Fr={};for(var ko in dr)So.call(dr,ko)&&r0.indexOf(ko)<0&&(Fr[ko]=dr[ko]);if(dr!=null&&aa)for(var ko of aa(dr))r0.indexOf(ko)<0&&S0.call(dr,ko)&&(Fr[ko]=dr[ko]);return Fr};const os=(dr,r0)=>dr.answerOption?dr.answerOption.map(Fr=>{var ko,gi;const yi=(gi=(ko=Fr.valueReference)==null?void 0:ko.reference)==null?void 0:gi.replace("#","");return r0.find(ki=>ki.id===yi)}).filter(Boolean):[],M1=dr=>{var r0,Fr,ko;const gi=dr.find(yi=>{var ki,Di;return yi.url.includes("questionnaire-itemControl")&&((Di=(ki=yi.valueCodeableConcept)==null?void 0:ki.coding)==null?void 0:Di.some(Ci=>{var Pi;return(Pi=Ci.code)==null?void 0:Pi.startsWith("ui-toolkit/")}))});return(ko=(Fr=(r0=gi?.valueCodeableConcept)==null?void 0:r0.coding)==null?void 0:Fr.find(yi=>{var ki;return(ki=yi.code)==null?void 0:ki.startsWith("ui-toolkit/")}))==null?void 0:ko.code},Gn=dr=>{var{uiToolkitCode:r0,props:Fr}=dr,ko=Fr,{item:gi,contained:yi=[],customErrorConfigurations:ki}=ko,Di=ys(ko,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:Ci}=(0,p.c)(),Pi=oo[r0];if(!Pi)return(0,n.jsx)(n.Fragment,{});const hi=os(gi,yi),yr=hi.length>0;return!(gi.answerOption&&gi.answerOption.length>0)&&!yr&&!gi.readOnly?(Ci(!0),(0,n.jsx)(xe,{configKey:r0,customErrorConfigurations:ki})):(0,n.jsx)(Pi,Os(ps({},Di),{item:gi,contained:yi,customErrorConfigurations:ki,resourceData:hi,"data-testid":gi.linkId}))},F0={attachment:nn,choice:Kr,boolean:fn,integer:br,string:({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki,placeholder:Di,hintText:Ci})=>{var Pi;const{linkId:hi,text:yr,required:Jn,prefix:Sr,readOnly:Le}=dr,Ce=yr?(0,i.nt)(gi,Sr,yr):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Jn||!1}),(0,n.jsx)(r.Input,{isRequired:Jn,size:"md","aria-label":hi,"data-testid":hi,id:hi,type:ht==="tel"?"tel":"text",placeholder:Di,value:((Pi=Fr?.[0])==null?void 0:Pi.valueString)||"",onChange:Ht=>{ko(dr,[{valueString:Ht}])},isDisabled:Le||ki,onBlur:Ht=>{const tn=Ht.target.value,In=tn.trim();In!==tn&&ko(dr,[{valueString:In}]),r0(dr.linkId)},hint:Fe||Ci,isInvalid:!!Fe,autoComplete:ht},hi)]})},url:({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki,placeholder:Di,hintText:Ci})=>{var Pi;const{linkId:hi,text:yr,required:Jn,prefix:Sr,readOnly:Le}=dr,Ce=yr?(0,i.nt)(gi,Sr,yr):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Jn||!1}),(0,n.jsx)(r.Input,{isRequired:Jn,size:"md",type:"url",id:hi,"data-testid":hi,"aria-label":hi,placeholder:Di,value:((Pi=Fr?.[0])==null?void 0:Pi.valueUri)||"",onChange:Ht=>{ko(dr,[{valueUri:Ht}])},isDisabled:Le||ki,onBlur:Ht=>{const tn=Ht.target.value,In=tn.trim();In!==tn&&ko(dr,[{valueUri:In}]),r0(dr.linkId)},hint:Fe||Ci,isInvalid:!!Fe,autoComplete:ht},hi)]})},text:({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki,placeholder:Di,hintText:Ci})=>{var Pi;const{linkId:hi,text:yr,required:Jn,prefix:Sr,readOnly:Le,maxLength:Ce}=dr,Fe=yr?(0,i.nt)(gi,Sr,yr):"",ht=yi?.[hi]||"",Ht=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Fe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Fe,required:Jn||!1}),(0,n.jsx)(r.TextArea,{isRequired:Jn,id:hi,"aria-label":hi,"data-testid":hi,rows:3,placeholder:Di,value:((Pi=Fr?.[0])==null?void 0:Pi.valueString)||"",onChange:tn=>{ko(dr,[{valueString:tn}])},isDisabled:Le||ki,onBlur:tn=>{const In=tn.target.value,nr=In.trim();nr!==In&&ko(dr,[{valueString:nr}]),r0(dr.linkId)},hint:ht||Ci,counter:!0,isInvalid:!!ht,maxLength:Ce,autoComplete:Ht},hi)]})},date:X0,time:({item:dr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:ko,showQuestionPrefix:gi,errors:yi,isLoading:ki})=>{var Di;const{linkId:Ci,text:Pi,required:hi,prefix:yr,readOnly:Jn}=dr,Sr=Pi?(0,i.nt)(gi,yr,Pi):"",Le=yi?.[Ci]||"";return(0,n.jsxs)("div",{children:[Sr&&(0,n.jsx)(N,{isLabel:!0,text:Sr,required:hi||!1}),(0,n.jsx)(r.Input,{isRequired:hi,size:"md",type:"time",id:Ci,"data-testid":Ci,"aria-label":Ci,placeholder:"Type your response here...",value:((Di=Fr?.[0])==null?void 0:Di.valueTime)||"",onChange:Ce=>{ko(dr,[{valueTime:Ce}])},isDisabled:Jn||ki,onBlur:()=>{r0(dr.linkId)},hint:Le,isInvalid:!!Le},Ci)]})},dateTime:Ro,quantity:R0,decimal:vr,question:mr,display:mr,group:mr,reference:dr=>{var r0,Fr,ko,gi,yi;const{setHideFooterButton:ki}=(0,p.c)(),{item:Di,customErrorConfigurations:Ci}=dr,Pi=Di.extension||[],hi=M1(Pi);return hi?(0,n.jsx)(Gn,{uiToolkitCode:hi,props:dr}):((yi=(gi=(ko=(Fr=(r0=Di?.extension)==null?void 0:r0.find(Jn=>Jn.url.includes("questionnaire-itemControl")))==null?void 0:Fr.valueCodeableConcept)==null?void 0:ko.coding)==null?void 0:gi[0])==null?void 0:yi.code)==="check-box"?Di.answerOption&&Di.answerOption.length>0?(0,n.jsx)(Kr,Os(ps({},dr),{item:Di})):(ki(!0),(0,n.jsx)(xe,{configKey:Di.linkId,customErrorConfigurations:Ci})):null}};var Wt=(dr,r0,Fr)=>new Promise((ko,gi)=>{var yi=Ci=>{try{Di(Fr.next(Ci))}catch(Pi){gi(Pi)}},ki=Ci=>{try{Di(Fr.throw(Ci))}catch(Pi){gi(Pi)}},Di=Ci=>Ci.done?ko(Ci.value):Promise.resolve(Ci.value).then(yi,ki);Di((Fr=Fr.apply(dr,r0)).next())});const Ke=({item:dr,selectedAnswer:r0,showQuestionPrefix:Fr})=>{const{text:ko,prefix:gi,required:yi}=dr,ki=ko?getUpdatedQuestionText(Fr,gi,ko):"",[Di,Ci]=useState(null),[Pi,hi]=useState(!1),{documentDownload:yr,webview:Jn}=useNativeBridge(),Sr=(r0||[]).filter(ht=>{var Ht,tn;return((Ht=ht.valueAttachment)==null?void 0:Ht.data)&&((tn=ht.valueAttachment)==null?void 0:tn.title)}).map((ht,Ht)=>{var tn,In,nr,gn,Un,cn,lr;return{id:((tn=ht.valueAttachment)==null?void 0:tn.id)||`preview-${Ht}`,fileName:((In=ht.valueAttachment)==null?void 0:In.title)||`attachment-${Ht}`,contentType:((nr=ht.valueAttachment)==null?void 0:nr.contentType)||"application/octet-stream",base64Data:((gn=ht.valueAttachment)==null?void 0:gn.data)||"",size:getBase64Size(((Un=ht.valueAttachment)==null?void 0:Un.data)||"",(cn=ht.valueAttachment)==null?void 0:cn.contentType),type:getFileTypeFromMimeType((lr=ht.valueAttachment)==null?void 0:lr.contentType)}}),Le=useCallback(ht=>{const{fileName:Ht,contentType:tn,base64Data:In}=ht;if(Jn.isWithin)Ci({fileName:Ht,contentType:tn,base64Data:In}),hi(!0);else{const nr=base64toObjectUrl(In,tn),gn=document.createElement("a");gn.href=nr,gn.download=Ht,document.body.appendChild(gn),gn.click(),document.body.removeChild(gn),URL.revokeObjectURL(nr)}},[Jn.isWithin]),Ce=useCallback(()=>Wt(void 0,null,function*(){!Di||(yield yr.writeFile(Di.fileName,prepareDataUrl(Di.base64Data,Di.contentType)))}),[Di,yr]),Fe=useCallback(()=>{hi(!1),Ci(null)},[]);return Sr.length?jsxs("div",{children:[ki&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:ki,required:yi||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:Sr.map(ht=>jsx("button",{type:"button",onClick:()=>Le(ht),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(ht.fileName),size:ht.size,type:ht.type})},ht.id))}),jsx(DownloadDisclosureModal,{opened:Pi,onClose:Fe,onDownload:Ce,contentType:Di?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var dt=Object.defineProperty,Nt=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,sr=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,T0=Object.prototype.propertyIsEnumerable,G0=(dr,r0,Fr)=>r0 in dr?dt(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,q0=(dr,r0)=>{for(var Fr in r0||(r0={}))xr.call(r0,Fr)&&G0(dr,Fr,r0[Fr]);if(sr)for(var Fr of sr(r0))T0.call(r0,Fr)&&G0(dr,Fr,r0[Fr]);return dr},Jo=(dr,r0)=>Nt(dr,Dn(r0));const Go=(dr,r0,Fr,ko)=>{var gi;const yi=dr.extension||[];if(ko?.[BUTTON_TYPE_EXTERNAL_KEY]&&yi.some(hi=>hi.url===BUTTON_TYPE_EXTENSION_URL))return ko[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(dr)||hasParentWithUIToolkitWidget(dr,r0))return null;if(Fr&&dr.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const ki=getUIToolkitCode(yi),Di=yi.filter(hi=>hi.url.includes("questionnaire-itemControl")).flatMap(hi=>{var yr,Jn;return(Jn=(yr=hi.valueCodeableConcept)==null?void 0:yr.coding)!=null?Jn:[]})||[];let Ci;return ko&&(Ci=(gi=Di.find(hi=>hi.code&&ko[hi.code]))==null?void 0:gi.code),(Ci&&ko?ko[Ci]:void 0)||UI_TOOLKIT_WIDGET_MAP[ki||""]||typeToRenderFunctionMap[dr.type]||null},ai=dr=>{var r0;const{item:Fr,selectedAnswer:ko,handleInputChange:gi,showQuestionPrefix:yi,errors:ki,questionnaireSchemaItems:Di,formData:Ci,isNestedRepeatedItem:Pi=!1}=dr,{linkId:hi,text:yr,prefix:Jn,required:Sr,repeats:Le}=Fr,Ce=getMaxOccursFromExtensions(Fr.extension),Fe=getPlaceholderFromExtensions(Fr.extension,Fr.type),[ht,Ht]=useState(()=>{if(Fr.type==="group"&&Fr.item&&Fr.item.length>0){const Vr=Ci?.filter(C0=>C0.linkId===Fr.linkId)||[];if(Vr.length>0)return Vr.map((C0,fo)=>fo)}else if(ko&&ko.length>0)return ko.map((Vr,C0)=>C0);return[0]}),tn=Ce!==void 0&&ht.length>=Ce,In=yr?getUpdatedQuestionText(yi,Jn,yr):"",nr=()=>{const Vr=Math.max(...ht,-1)+1,C0=[...ht,Vr];if(Ht(C0),Fr.type==="group"&&Fr.item&&Fr.item.length>0){const fo=Fr.item.map($t=>({linkId:$t.linkId,text:$t.text,answer:[{}]})),ut={linkId:Fr.linkId,text:Fr.text,answer:[{}],item:fo};gi(Fr,void 0,[ut])}else{const fo=[...ko||[]];fo.push({}),gi(Fr,fo)}},gn=Vr=>{if(ht.length<=1)return;const C0=ht.filter((fo,ut)=>ut!==ht.length-1);if(Ht(C0),Fr.type==="group"&&Fr.item&&Fr.item.length>0){const fo=[];if(Ci?.forEach((ut,$t)=>{ut.linkId===hi&&fo.push({item:ut,originalIndex:$t})}),Vr>=0&&Vr<fo.length){const ut=fo[Vr],$t=Ci?.filter((Mn,jn)=>jn!==ut.originalIndex);gi(Fr,void 0,$t,void 0,!0)}}else{const fo=ko?.filter((ut,$t)=>$t!==Vr)||[];gi(Fr,fo.length>0?fo:[{}])}},Un=Vr=>{if(!Ci||!Fr.item)return[];const C0=$t=>{const Mn=[];for(const jn of $t)if(jn.linkId===Fr.linkId&&Mn.push(jn),jn.item&&jn.item.length>0){const kn=C0(jn.item);Mn.push(...kn)}return Mn},ut=C0(Ci)[Vr];return ut?.item?ut.item:[]},cn=(Vr,C0)=>{if(isHiddenExtensionPresent(Vr))return null;const fo=Un(C0);if(!isQuestionEnabledForInstance(Vr.enableWhen,Vr.enableBehavior,Ci||[],Fr.linkId,C0))return null;if(Vr.repeats){const kn=findNestedAnswer(fo,Vr.linkId),Ur=Jo(q0({},dr),{item:Vr,selectedAnswer:kn||[{}],errors:getInstanceErrors(ki,Fr,C0),handleInputChange:(c0,so,E0)=>gi(c0,so,E0,C0)});return jsx("div",{children:jsx(ai,Jo(q0({},Ur),{isNestedRepeatedItem:!0}))},Vr.linkId)}if(Vr.type==="group"&&Vr.item&&!getUIToolkitCode(Vr?.extension||[]))return jsxs("div",{children:[Vr.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:Vr.text}),jsx("div",{className:"space-y-3",children:Vr.item.map(kn=>{if(!isQuestionEnabledForInstance(kn.enableWhen,kn.enableBehavior,Ci||[],Fr.linkId,C0))return null;const c0=Go(kn,Di,dr.isLoading,dr.externalComponentRenderMap);if(!c0)return null;const so=findNestedAnswer(fo,kn.linkId),E0=Jo(q0({},dr),{item:kn,selectedAnswer:so,placeholder:getPlaceholderFromExtensions(kn.extension,kn.type),errors:getInstanceErrors(ki,Fr,C0),handleInputChange:(Q0,wo,j0)=>gi(Q0,wo,j0,C0)});return createElement(c0,Jo(q0({},E0),{key:kn.linkId}))})})]},Vr.linkId);const $t=Go(Vr,Di,dr.isLoading,dr.externalComponentRenderMap);if(!$t)return null;const Mn=findNestedAnswer(fo,Vr.linkId),jn=Jo(q0({},dr),{item:Vr,selectedAnswer:Mn,placeholder:getPlaceholderFromExtensions(Vr.extension,Vr.type),errors:getInstanceErrors(ki,Fr,C0),handleInputChange:(kn,Ur,c0)=>gi(kn,Ur,c0,C0)});return createElement($t,Jo(q0({},jn),{key:`${Vr.linkId}-${C0}`}))},lr=()=>{const Vr=getDirectErrors(ki,hi);return jsxs("div",{className:"flex flex-col gap-2",children:[Vr[hi]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:Vr[hi]}),!tn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:nr,className:"mt-4 text-center",isDisabled:dr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},Ir=Vr=>ht.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>gn(Vr),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${Vr+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:dr.isLoading}),t0=Go(Fr,Di,dr.isLoading,dr.externalComponentRenderMap);return hasRepeatingParent(Fr,Di)&&!Pi?null:!Le||Le&&hasCheckboxExtension(Fr)?t0?jsx(t0,Jo(q0({},dr),{placeholder:Fe,errors:{[Fr.linkId]:((r0=ki?.[Fr.linkId])==null?void 0:r0[0])||""}})):null:Fr.type==="group"&&Fr.item&&Fr.item.length>0&&Fr.repeats?jsxs("div",{"data-testid":`${hi}-repeating`,children:[In&&jsx(FHIRQuestionnaireQuestionText,{text:In,required:Sr||!1}),ht.map(Vr=>{var C0;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${Vr>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",Vr+1]}),Ir(Vr)]}),jsx("div",{className:"space-y-4",children:(C0=Fr.item)==null?void 0:C0.map(fo=>cn(fo,Vr))})]},`${hi}-instance-${Vr}`)}),lr()]}):t0?jsxs("div",{"data-testid":`${hi}-repeating`,children:[ht.map(Vr=>{const C0=ko?.[Vr]?[ko[Vr]]:void 0,fo=Jo(q0({},dr),{item:Fr,selectedAnswer:C0,errors:getInstanceErrors(ki,Fr,Vr),handleInputChange:(ut,$t,Mn)=>gi(ut,$t,Mn,Vr)});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 ",Vr+1]}),Ir(Vr)]}),jsx(t0,q0({},fo))]},`${hi}-instance-${Vr}`)}),jsxs("div",{children:[(()=>{const C0=getDirectErrors(ki,hi)[hi];return C0&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:C0})})(),!tn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:nr,className:"mt-4 text-center",isDisabled:dr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var wi=Object.defineProperty,ha=Object.defineProperties,ta=Object.getOwnPropertyDescriptors,ga=Object.getOwnPropertySymbols,Qa=Object.prototype.hasOwnProperty,Fs=Object.prototype.propertyIsEnumerable,Za=(dr,r0,Fr)=>r0 in dr?wi(dr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):dr[r0]=Fr,is=(dr,r0)=>{for(var Fr in r0||(r0={}))Qa.call(r0,Fr)&&Za(dr,Fr,r0[Fr]);if(ga)for(var Fr of ga(r0))Fs.call(r0,Fr)&&Za(dr,Fr,r0[Fr]);return dr},xs=(dr,r0)=>ha(dr,ta(r0));const ts=null,_s=({formId:dr,questionnaireSchema:r0,questionnaireResponseItem:Fr,errorConfig:ko,customErrorConfigurations:gi,showQuestionPrefix:yi=!0,isAdaptiveFlow:ki=!1,status:Di,hideBackButton:Ci=!1,showStepper:Pi=!1,onComplete:hi,onClearError:yr,handleHiddenQuestion:Jn,onGoBack:Sr,onFormDataChange:Le=()=>{},externalComponentRenderMap:Ce,children:Fe})=>{var ht,Ht;const{setHandleContinueButtonClick:tn,setHandleBackButtonClick:In,setIsCurrentFormValid:nr,setCurrentGroupLinkId:gn,setCurrentGroupIndex:Un,setTotalSteps:cn,setHideFooterButton:lr,setIsInlineNextQuestionTriggered:Ir,isCurrentFormValid:t0,currentGroupIndex:A0,isLoading:Vr,hasCustomError:C0,groupItemIndicesRef:fo}=useFHIRQuestionnaire(),{trackEvent:ut}=useAnalytics(),[$t,Mn]=useState([]),[jn,kn]=useState(new Set),[Ur,c0]=useState([]),[so,E0]=useState([]),Q0=fo,wo=useRef(new Map),j0=useRef(new Set),[Po,K0]=useState({}),[M0,Mo]=useState(!1),[U0,Bi]=useState(r0),Bo=useRef(Fr||[]),Si=useRef(!1),Ma=useRef(!1),Ki=useMemo(()=>getTotalStepsFromQuestionnaire(r0),[r0]),[Bs,Vs]=useState(!1),Gi=useRef([]),f1=(jo,ni)=>{var Zo,_i,Ba,Da,Ja;if(isCallNextQuestionExtensionPresent(jo))return jo.linkId;const Ia=validateCurrentPage(ni,$t,A0,U0,Q0),Ya=Q0.current[A0],el=A0+1,P1=Q0.current[el],cl=A0===0?0:Ya,Hl=(_i=P1??((Zo=U0?.item)==null?void 0:Zo.length))!=null?_i:0;let ml=-1;for(let Wn=cl;Wn<Hl;Wn++){const Ti=(Ba=U0?.item)==null?void 0:Ba[Wn];if(Ti?.linkId===jo.linkId){ml=Wn;break}}const nu=(Wn,Ti=[])=>(Wn.forEach(xi=>{var qa;if((!xi.enableWhen||isQuestionEnabled(xi.enableWhen,xi.enableBehavior,ni))&&isCallNextQuestionExtensionPresent(xi)&&!Gi.current.includes(xi.linkId))if(xi.required){const h1=(qa=findResponseItem(ni,xi.linkId))==null?void 0:qa.answer;(h1&&h1.length>0&&Object.keys(h1[0]).length>0||xi.initial&&xi.initial.length>0&&!jn.has(xi.linkId))&&Ti.push(xi.linkId)}else Ti.push(xi.linkId);xi.item&&xi.item.length>0&&nu(xi.item,Ti)}),Ti),Cu=[],Ao=ml!==-1?ml+1:Hl;for(let Wn=cl;Wn<Ao;Wn++){const Ti=(Da=U0?.item)==null?void 0:Da[Wn];Ti&&nu([Ti],Cu)}if(Cu.length>0&&Ia){const Wn=Cu[Cu.length-1],Ti=h1=>h1.flatMap(L1=>[L1,...L1.item?Ti(L1.item):[]]),xi=Ti((Ja=U0?.item)!=null?Ja:[]),qa=xi.findIndex(h1=>h1.linkId===Wn),wa=xi.findIndex(h1=>h1.linkId===jo.linkId);return qa!==-1&&wa>qa?void 0:Wn}},js=jo=>f1(jo,Bo.current)?!0:jo.item&&jo.item.length>0?jo.item.some(js):!1,Cs=()=>{var jo;if(!ki||A0<0||!U0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const ni=Q0.current[A0],_i=(wo.current.get(ni)||[ni]).some(Ja=>{var Ia;const Ya=(Ia=U0.item)==null?void 0:Ia[Ja];return Ya?js(Ya):!1}),Ba=A0<Q0.current.length-1;let Da=!1;if(_i&&Ba){const Ja=A0+1,Ia=Q0.current[Ja],Ya=(jo=U0?.item)==null?void 0:jo[Ia],el=!Ya?.enableWhen||isQuestionEnabled(Ya.enableWhen,Ya.enableBehavior,Bo.current),P1=Ya?isPageExtensionPresent(Ya):!1;Da=el&&P1}return{shouldTriggerInlineLoading:_i,canNavigateToNextGroup:Da,hasMoreGroups:Ba}},$1=(jo,ni,Zo,_i)=>{const Ba=getUpdatedFormData(U0?.item||[],Bo.current,jo,ni,Zo,_i);return Bo.current=Ba,Le(Ba),Ba},Or=(jo,ni,Zo,_i,Ba)=>{$1(ni,Zo,_i,Ba),_i.forEach(Da=>{const Ja=getValidationError(xs(is({},jo),{linkId:Da.linkId}),Bo.current,Da.answer);Ja&&K0(Ia=>xs(is({},Ia),{[Da.linkId]:typeof Ba=="number"?xs(is({},Ia[Da.linkId]),{[Ba]:Ja}):Ja}))})},er=(jo,ni,Zo,_i,Ba)=>{var Da;const Ja=$1(ni,Zo,_i,Ba),Ia=(Da=findResponseItem(Ja,ni))==null?void 0:Da.answer,Ya=getValidationError(jo,Bo.current,Ia);K0(el=>xs(is({},el),{[ni]:typeof Ba=="number"?xs(is({},el[ni]),{[Ba]:Ya}):Ya}))},Rr=(jo,ni)=>{const Zo=validateCurrentPage(ni,$t,A0,U0,Q0);if(nr(Zo),U0?.item){const _i=validateAllItemsRecursively(U0.item,ni);if(Object.keys(_i).length>0)K0(Ba=>is(is({},Ba),_i));else{const Ba=U0.item,Da={},Ja=Ia=>{Ia.forEach(Ya=>{Da[Ya.linkId]={},Ya.item&&Ja(Ya.item)})};Ja(Ba),K0(Ia=>is(is({},Ia),Da))}}},ur=(jo,ni,Zo,_i,Ba=!1)=>{var Da;const{linkId:Ja}=jo;if(Ba)return Bo.current=Zo||[],Rr(Ja,Zo||[]),Bo.current;if(Zo&&Zo.length>0&&jo.type==="group"&&jo.repeats){let P1=Bo.current.length;for(let Hl=Bo.current.length-1;Hl>=0;Hl--)if(Bo.current[Hl].linkId===Ja){P1=Hl+1;break}const cl=[...Bo.current.slice(0,P1),...Zo,...Bo.current.slice(P1)];return Bo.current=cl,Rr(Ja,cl),Bo.current}if(typeof _i=="number"&&ni){const P1=hasRepeatingParent(jo,U0?.item||[]);if(P1){const cl=Bo.current.filter(ml=>ml.linkId===P1.linkId);if(_i<cl.length){const ml=Bo.current.map(nu=>{if(nu.linkId===P1.linkId&&Bo.current.slice(0,Bo.current.indexOf(nu)).filter(Ao=>Ao.linkId===P1.linkId).length===_i){const Ao=(xi,qa)=>{const wa=new Map(xi.map(L1=>[L1.linkId,L1])),h1=[];return qa?.forEach(L1=>{const gl=wa.get(L1.linkId);if(L1.linkId===Ja)h1.push(is({linkId:L1.linkId,text:L1.text,answer:ni},gl?.item&&{item:gl.item}));else if(gl)if(L1.item&&L1.item.length>0){const d1=Ao(gl.item||[],L1.item);h1.push(xs(is({},gl),{item:d1}))}else h1.push(gl);else if(L1.item&&L1.item.length>0){const d1=Ao([],L1.item);d1.some(m1=>m1.linkId===Ja||m1.item&&Wn(m1.item,Ja))&&h1.push({linkId:L1.linkId,text:L1.text,answer:[{}],item:d1})}wa.delete(L1.linkId)}),wa.forEach(L1=>{h1.push(L1)}),h1},Wn=(xi,qa)=>xi.some(wa=>wa.linkId===qa||wa.item&&Wn(wa.item,qa)),Ti=Ao(nu.item||[],P1.item);return xs(is({},nu),{item:Ti})}return nu});Bo.current=ml,Le(ml)}else{const ml=_i+1,nu=cl.length;if(nu<ml||ml===1){const Cu=[],Ao=(xi,qa,wa)=>xi.map(h1=>{const L1={linkId:h1.linkId,text:h1.text,answer:h1.linkId===qa?wa:[{}]};return h1.item&&h1.item.length>0&&(L1.item=Ao(h1.item,qa,wa)),L1});for(let xi=nu;xi<ml;xi++){const qa=P1.item?Ao(P1.item,Ja,ni):[],wa={linkId:P1.linkId,text:P1.text,answer:[{}],item:qa};Cu.push(wa)}let Wn=Bo.current.length;for(let xi=Bo.current.length-1;xi>=0;xi--)if(Bo.current[xi].linkId===P1.linkId){Wn=xi+1;break}const Ti=[...Bo.current.slice(0,Wn),...Cu,...Bo.current.slice(Wn)];Bo.current=Ti,Le(Ti)}}const Hl=getValidationError(jo,Bo.current,ni);return K0(ml=>xs(is({},ml),{[Ja]:typeof _i=="number"?xs(is({},ml[Ja]),{[_i]:Hl}):Hl})),Rr(Ja,Bo.current),Bo.current}}if(typeof _i=="number")return Zo&&Zo.length>0?Or(jo,Ja,ni,Zo,_i):er(jo,Ja,ni,Zo,_i),Bo.current;const Ia=$1(Ja,ni,Zo),Ya=(Da=findResponseItem(Ia,Ja))==null?void 0:Da.answer,el=getValidationError(jo,Ia,Ya);return K0(P1=>xs(is({},P1),{[Ja]:typeof _i=="number"?xs(is({},P1[Ja]),{[_i]:el}):el})),Rr(Ja,Ia),Bo.current},_r=()=>{var jo;for(let ni=A0+1;ni<Q0.current.length;ni++){const Zo=Q0.current[ni],_i=(jo=U0?.item)==null?void 0:jo[Zo];if(!!_i&&(!_i.enableWhen||isQuestionEnabled(_i.enableWhen,_i.enableBehavior,Bo.current)))return!0}return!1},W0=()=>{var jo,ni,Zo,_i,Ba;const Da=(jo=r0?.item)==null?void 0:jo[Q0.current[A0]];if(Da){const Ya=(ni=getAnalyticsEventName(Da))!=null?ni:"questionnaire_form",el=getAnalyticsPageName(Da);if(el){const P1=(Zo=getAnalyticsFormName(r0))!=null?Zo:r0.name,cl=collectAnalyticsProperties(Da,Bo.current),Hl={};P1&&(Hl.form_name=P1),Hl.page_name=el,Object.assign(Hl,cl),ut(Ya,Hl)}}const Ja=A0<Q0.current.length-1,Ia=checkCurrentStepDataMatch(Bo.current,U0,Q0.current,A0,Fr,Q0.current.length-1);if(ki&&Ja){const Ya=A0+1,el=Q0.current[Ya],P1=(_i=U0?.item)==null?void 0:_i[el],cl=!P1?.enableWhen||isQuestionEnabled(P1.enableWhen,P1.enableBehavior,Bo.current),Hl=P1?isPageExtensionPresent(P1):!1;if(cl&&Hl&&Ia){Un(Ya),nr(!1),window.scrollTo(0,0);return}}if(Ia&&Q0.current.length>0){_r()?Un(A0+1):(hi(removeDisabledItems(Bo.current,U0?.item||[])),nr(!1),window.scrollTo(0,0));return}if(A0<Q0.current.length-1){const Ya=(Ba=U0?.item)==null?void 0:Ba[Q0.current[A0]];if(!Ya){hi(removeDisabledItems(Bo.current,U0?.item||[]));return}const el=Ya.linkId,P1=findLastGroupInstanceIndex(Bo.current,el),cl=Bo.current.slice(0,P1+1);if(!validateCurrentPage(cl,$t,A0,U0,Q0))return;ki?(Bo.current=cl,Le(cl),hi(Bo.current),nr(!1)):Q0.current.length>0&&(_r()?Un(A0+1):(hi(removeDisabledItems(Bo.current,U0?.item||[])),window.scrollTo(0,0)))}else hi(removeDisabledItems(Bo.current,U0?.item||[])),nr(!1),window.scrollTo(0,0)};useEffect(()=>{var jo;tn(()=>W0),In(()=>Mi),nr(t0);const ni=(jo=U0?.item)==null?void 0:jo[Q0.current[A0]];ni&&gn(ni.linkId)},[t0,A0]),useEffect(()=>{if(!r0?.item)return;const{groupIndices:jo,itemsToRenderMap:ni}=collectGroupItemIndices(r0.item);Q0.current=jo,wo.current=ni;const Zo=Ki??jo.length;cn(Zo),c0(jo),ki?(Ma.current||Un(jo.length>0?jo.length-1:0),Ir(!1),Ma.current=!1):A0===-1&&Un(0)},[r0?.item,Ki]),useEffect(()=>{if(A0<0||!U0?.item)return;const jo=validateCurrentPage(Bo.current,$t,A0,U0,Q0);if(!jo){nr(!1);return}const{shouldTriggerInlineLoading:ni,canNavigateToNextGroup:Zo,hasMoreGroups:_i}=Cs();if(ki&&ni){if(!_i){nr(!1);return}if(Zo&&jo){nr(!0);return}else{nr(!1);return}}nr(jo)},[A0,U0?.item,C0,ki,Bo.current,$t]),useEffect(()=>{if(!r0?.item||Si.current)return;const jo=initializeQuestionnaireItems(r0.item,Bo.current,r0.item,Bo.current);if(jo!==Bo.current){Bo.current=jo;const Zo=(Ba=>{const Da=new Set,Ja=Ia=>{Ia.forEach(Ya=>{var el;const P1=Ya.initial&&Ya.initial.length>0,cl=(Ya.type==="choice"||Ya.type==="open-choice")&&((el=Ya.answerOption)==null?void 0:el.some(Hl=>Hl.initialSelected===!0));(P1||cl)&&(!Ya.enableWhen||isQuestionEnabled(Ya.enableWhen,Ya.enableBehavior,Bo.current))&&Da.add(Ya.linkId),Ya.item&&Ja(Ya.item)})};return Ja(Ba),Da})(U0?.item||[]);kn(Zo);const _i=validateAllItemsRecursively(U0?.item||[],Bo.current);Object.keys(_i).length>0&&K0(Ba=>is(is({},Ba),_i))}Si.current=!0},[U0?.item,r0]),useEffect(()=>{Bi(r0)},[r0]),useEffect(()=>{A0>=0&&window.scrollTo(0,0)},[A0]),useEffect(()=>{var jo;if(!ki||$t.length===0||Vr||!U0?.item)return;const ni=Q0.current[A0];if(ni===void 0)return;const Zo=wo.current.get(ni)||[ni],_i=[];if(Zo.forEach(Ya=>{var el;const P1=(el=U0?.item)==null?void 0:el[Ya];P1&&hasInitialValue(P1)&&_i.push(P1)}),_i.length===0||!_i.some(Ya=>f1(Ya,Bo.current)&&!Gi.current.includes(Ya.linkId)?(Gi.current.push(Ya.linkId),!0):!1))return;const Da=validateCurrentPage(Bo.current,$t,A0,U0,Q0),Ja=(jo=U0?.item)==null?void 0:jo[ni],Ia=isHiddenAnswerInValid(Ja,Bo.current);!Da||Ia||(j0.current.add(A0),Ir(!0),Ma.current=!0,Y0(_i[_i.length-1].linkId))},[A0,$t,ki,Vr,U0]);const Y0=(jo,ni=!1,Zo=!1)=>{var _i;if(ni){hi(removeDisabledItems(Bo.current,U0?.item||[]),Zo),nr(!1);return}const Ba=findQuestionByLinkId(U0?.item||[],jo);if(!Ba)return;const Da=(_i=findResponseItem(Bo.current,jo))==null?void 0:_i.answer;if(getValidationError(Ba,Bo.current,Da))return;const Ja=getUpdatedFormData(U0?.item||[],Bo.current,jo,Da),Ia=f1(Ba,Ja);if(!Ia)return;nr(!1);const Ya=findRootGroupLinkId(U0?.item||[],jo);let el=Ja,P1=[];const cl=deepTrimFormData(Ja,Ia,U0?.item||[]);el=cl.trimmedData,P1=cl.trimmedLinkIds;const Hl=findQuestionByLinkId(U0?.item||[],Ya||"");Bo.current=el;const ml=findGroupPositionByLinkId(U0?.item||[],jo||""),nu=ml!==-1?ml:A0;if(validateCurrentPage(el,$t,nu,U0,Q0,P1)&&!isHiddenAnswerInValid(Hl,el)){Ir(!0),Ma.current=!0;let Ao;const Wn=(()=>{var qa;const wa=n1=>n1.flatMap(m1=>[m1,...m1.item?wa(m1.item):[]]),h1=wa((qa=U0?.item)!=null?qa:[]),L1=h1.findIndex(n1=>n1.linkId===Ia),gl=new Set;let d1=!0;for(;d1;){d1=!1;for(const n1 of h1){if(gl.has(n1.linkId)||!n1.enableWhen)continue;n1.enableWhen.some(G1=>{const _l=h1.findIndex(Ol=>Ol.linkId===G1.question);return _l!==-1&&_l<=L1||gl.has(G1.question)})&&(gl.add(n1.linkId),d1=!0)}}return P1.filter(n1=>!gl.has(n1))})();Wn.length>0&&(Ao=removeItemsFromSchema(U0?.item||[],Wn),Bi(xs(is({},U0),{item:Ao})));const xi=((qa,wa)=>{const h1=[];let L1=!1;const gl=d1=>{for(const n1 of d1)L1?(h1.push(n1.linkId),n1.item&&gl(n1.item)):n1.linkId===wa?L1=!0:n1.item&&gl(n1.item)};return gl(qa),h1})(U0?.item||[],Ia);xi.length>0&&(Gi.current=Gi.current.filter(qa=>!xi.includes(qa)),kn(qa=>{const wa=new Set(qa);return xi.forEach(h1=>wa.delete(h1)),wa})),Gi.current.push(Ia),hi(removeDisabledItems(el,U0?.item||[]),!0,Ao)}},Bt=(jo,ni,Zo=!1)=>{const _i=updateItemWithReadOnlyExpression(jo,U0),Ba={item:_i,selectedAnswer:ni,handleInputChange:ur,showQuestionPrefix:yi,onCompleteHandler:Y0,errors:Po,isLoading:Vr,isCurrentFormValid:t0,contained:U0?.contained,questionnaireSchemaItems:U0?.item,customErrorConfigurations:gi,formData:Bo.current,showStepper:Pi,totalStepsFromExtension:Ki,externalComponentRenderMap:Ce,hintText:getHintTextFromExtensions(_i.extension)};if(typeof Jn=="function"&&Zo)Jn(jo,Ba,Bo.current);else if(jo.type in typeToRenderFunctionMap&&!Zo)return $t.includes(jo.linkId)||Mn(Da=>[...Da,jo.linkId]),jsx(RenderFHIRQuestionnaireItem,is({},Ba),jo.linkId);return null},si=jo=>jo.map(ni=>{var Zo,_i;const Ba=isHiddenExtensionPresent(ni);let Da=(Zo=findResponseItem(Bo.current,ni.linkId))==null?void 0:Zo.answer;if((!Da||Object.keys((_i=Da?.[0])!=null?_i:{}).length===0)&&!jn.has(ni.linkId)){if(ni.initial&&ni.initial.length>0)Da=ni.initial,kn(Ja=>new Set(Ja).add(ni.linkId));else if((ni.type==="choice"||ni.type==="open-choice")&&ni.answerOption){const Ja=ni.answerOption.filter(Ia=>Ia.initialSelected===!0);Ja.length>0&&(Da=Ja.map(Ia=>{let Ya={};return Ia.valueCoding?Ya={valueCoding:{code:Ia.valueCoding.code,display:Ia.valueCoding.display,system:Ia.valueCoding.system}}:Ia.valueReference&&(Ya={valueReference:{reference:Ia.valueReference.reference,display:Ia.valueReference.display}}),Ya}).filter(Ia=>Object.keys(Ia).length>0),kn(Ia=>new Set(Ia).add(ni.linkId)))}Da&&(Bo.current=getUpdatedFormData(U0?.item||[],Bo.current,ni.linkId,Da))}if(!ni?.enableWhen||isQuestionEnabled(ni?.enableWhen,ni.enableBehavior,Bo.current)){const Ja=ts.includes(ni.linkId)||getUIToolkitCode(ni.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[Bt(ni,Da,Ba),ni.item&&!Ba&&(Ja?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:si(ni.item)})}):si(ni.item))]},ni.linkId)}else if(ni.type==="group"&&!Ba)return so.includes(ni.linkId)||(Ki===void 0&&cn(Q0.current.length-1||-1),Q0.current=Q0.current.filter((Ja,Ia)=>Ia!==A0),E0(Ja=>[...Ja,ni.linkId])),null});if(A0>=0){const jo=[];let ni=0,Zo=0;for(;ni<Ur.length&&Zo<Q0.current.length;){const _i=Ur[ni],Ba=Q0.current[Zo];if(_i<Ba){const Da=(ht=U0?.item)==null?void 0:ht[_i];(!Da?.enableWhen||isQuestionEnabled(Da.enableWhen,Da.enableBehavior,Bo.current))&&jo.push(ni),ni++}else _i===Ba&&ni++,Zo++}for(;ni<Ur.length;){const _i=Ur[ni],Ba=(Ht=U0?.item)==null?void 0:Ht[_i];(!Ba?.enableWhen||isQuestionEnabled(Ba.enableWhen,Ba.enableBehavior,Bo.current))&&jo.push(ni),ni++}if(jo.length>0){Ki===void 0&&cn(Q0.current.length+jo.length),jo.reverse().forEach(Ba=>{const Da=Ur[Ba];let Ja=0;for(let Ia=0;Ia<Q0.current.length;Ia++){if(Q0.current[Ia]>Da){Ja=Ia;break}Ja=Ia+1}Q0.current.splice(Ja,0,Da)});const _i=jo.map(Ba=>{var Da;const Ja=Ur[Ba],Ia=(Da=U0?.item)==null?void 0:Da[Ja];return Ia?.linkId}).filter(Boolean);E0(Ba=>Ba.filter(Da=>!_i.includes(Da)))}Ur.forEach(_i=>{var Ba;const Da=(Ba=U0?.item)==null?void 0:Ba[_i];Da?.enableWhen&&!isQuestionEnabled(Da.enableWhen,Da.enableBehavior,Bo.current)&&Bo.current.some(Ia=>Ia.linkId===Da.linkId)&&(Bo.current=removeAnswerFromFormData(Bo.current,Da.linkId))})}const Mi=()=>{var jo;if(ko&&!M0&&A0>0&&Di!=="completed")Un(Q0.current.length-1),Mo(!0),lr(!1),yr?.();else if(A0>0&&Di!=="completed"){let ni=A0-1;for(;ni>0;){const Zo=Q0.current[ni],_i=(jo=U0?.item)==null?void 0:jo[Zo];if(!_i?.enableWhen||isQuestionEnabled(_i.enableWhen,_i.enableBehavior,Bo.current))break;ni--}Un(ni),nr(!0),lr(!1),yr?.()}else Sr?.()},xa=jo=>jo.preventDefault();return useEffect(()=>{const jo=setTimeout(()=>{Vs(!0)},0);return()=>clearTimeout(jo)},[]),Bs?jsxs(Fragment,{children:[jsxs("form",{id:dr,className:"w-full","data-testid":"questionnaire-form",onSubmit:xa,children:[!Ci&&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:()=>Mi(),onKeyDown:jo=>{(jo.key==="Enter"||jo.key===" ")&&Mi()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),ko&&!M0?jsx(EmptyState,{className:"mt-5xl",title:ko.title,description:ko.description,featuredIconProps:{icon:ko.icon,color:"gray"},primaryButton:ko.primaryButton,secondaryButton:ko.secondaryButton?xs(is({},ko.secondaryButton),{onClick:Mi}):void 0}):jsxs(Fragment,{children:[!U0?.item&&Vr&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),U0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:si(A0>=0?U0.item.filter((jo,ni)=>{const Zo=Q0.current[A0];return(wo.current.get(Zo)||[Zo]).includes(ni)}):U0?.item||[])})]})]}),Si.current&&Fe]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Y,l,e)=>{"use strict";e.d(l,{l:()=>p});var n=e(31085),t=e(14041),r=e(36087),s=e(76260),o=e(25624),i=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,b)=>f in h?a(h,f,{enumerable:!0,configurable:!0,writable:!0,value:b}):h[f]=b,d=(h,f)=>{for(var b in f||(f={}))y.call(f,b)&&m(h,b,f[b]);if(u)for(var b of u(f))A.call(f,b)&&m(h,b,f[b]);return h},O=(h,f)=>g(h,c(f));const v=({selected:h,onClick:f,icon:b,title:M,description:x,readOnly:z})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",h?"bg-utility-accent-500/20":"bg-gray-100",h?"text-accent-800":"text-quaternary"),children:b}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:M})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:x})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",z?"cursor-not-allowed":"cursor-pointer",z?"border-gray-200 bg-white":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})},p=({item:h,handleInputChange:f,formData:b,isLoading:M})=>{const{incrementCustomErrorCount:x,decrementCustomErrorCount:z}=(0,i.c)(),T=(0,t.useMemo)(()=>{var N;return(N=h.item)!=null?N:[]},[h.item]),S=h.readOnly===!0,E=(0,t.useMemo)(()=>T.filter(N=>!N.enableWhen||(0,o.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),C=(0,t.useMemo)(()=>T.filter(N=>N.enableWhen&&!(0,o.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),R=N=>{var w,V;if(!b)return!1;const q=(0,o.MU)(b,N);return((V=(w=q?.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)===!0},L=(0,t.useMemo)(()=>E.some(N=>R(N.linkId)),[E,b]),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(N=>{var w,V;const q=b?(0,o.MU)(b,N.linkId):void 0;(!q||((V=(w=q.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)!==!1)&&f(N,[{valueBoolean:!1}])})},[C]),(0,t.useEffect)(()=>()=>{P.current&&z()},[]);const D=N=>{const w=R(N.linkId);f(N,[{valueBoolean:!w}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},M?{inert:""}:{}),{children:E.map(N=>{var w,V,q,I;const k=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(se=>se.url===s.g4),F=(V=N.extension)==null?void 0:V.find(se=>se.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(q=F?.valueString)!=null?q:"";return(0,n.jsx)(v,{icon:K?(0,n.jsx)(K,{className:"h-6 w-6"}):void 0,title:(I=N.text)!=null?I:"",description:G,selected:k,readOnly:S,onClick:S?void 0:()=>D(N)},N.linkId)})}))}},72866:(Y,l,e)=>{"use strict";e.d(l,{v:()=>i});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const o=({selected:a,onClick:g,label:c,readOnly:u})=>{const 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})},i=({item:a,handleInputChange:g,formData:c})=>{var u;const y=(u=a.item)!=null?u:[],A=a.readOnly===!0,m=O=>{var v,p;if(!c)return!1;const h=(0,s.MU)(c,O);return((p=(v=h?.answer)==null?void 0:v[0])==null?void 0:p.valueBoolean)===!0},d=O=>{const v=m(O.linkId);g(O,[{valueBoolean:!v}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[a.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(a.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:y.map(O=>{var v;const p=m(O.linkId);return(0,n.jsx)(o,{label:(v=O.text)!=null?v:"",selected:p,readOnly:A,onClick:A?void 0:()=>d(O)},O.linkId)})})]})}},65735:(Y,l,e)=>{"use strict";e.d(l,{d:()=>s});var n=e(31085),t=e(36087),r=e(76260);const s=({item:o})=>{var i,a,g,c;const u=o.text||"",y=(a=(i=o.extension)==null?void 0:i.find(d=>d.url===r.rz))==null?void 0:a.valueString,A=(c=(g=o.extension)==null?void 0:g.find(d=>d.url===r.g4))==null?void 0:c.valueString,m=A?r.JP[A]:void 0;return(0,n.jsxs)("div",{className:"bg-primary flex items-start gap-4 rounded-lg px-4 py-6 shadow-sm","data-testid":o.linkId,children:[m&&(0,n.jsx)(t.FeaturedIcon,{icon:m,color:"brand",size:"lg",className:"text-accent-600 size-14"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-primary text-lg font-semibold",children:u}),y&&(0,n.jsx)("p",{className:"text-secondary text-sm",children:y})]})]})}},18522:(Y,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),o=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,h,f)=>h in p?o(p,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[h]=f,A=(p,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(p,f,h[f]);if(g)for(var f of g(h))u.call(h,f)&&y(p,f,h[f]);return p},m=(p,h)=>i(p,a(h));const d=(0,t.createContext)(void 0),O=()=>{const p=(0,t.useContext)(d);if(!p)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return p},v=({children:p,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[b,M]=useState(null),[x,z]=useState(null),[T,S]=useState(!1),[E,C]=useState(null),[R,L]=useState(-1),[P,D]=useState(!1),[N,w]=useState(-1),[V,q]=useState(!1),[I,k]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),se=useRef([]),oe=()=>{k(ne=>ne+1)},te=useCallback(ne=>{F(ne)},[]),pe=()=>{k(ne=>Math.max(0,ne-1))},be=I>0,Se=useCallback((ne,ae,me)=>{if(!h)return;const he=h[ne];if(!he)return;let de;if(Array.isArray(he))if(me)de=he.find(Ee=>Ee.inputType===me);else{console.warn(`Multiple analytics configs found for linkId "${ne}" but no inputType provided. Skipping tracking.`);return}else{if(me&&he.inputType&&he.inputType!==me)return;de=he}if(!de)return;let ue=A({},ae);de.valueTransform&&(ue=Object.keys(ae).reduce((Ee,De)=>{var ze;const Ie=(ze=de.valueTransform)==null?void 0:ze[De];return Ee[De]=Ie?applyValueTransform(ae[De],Ie):ae[De],Ee},{}));let re=A({},ue);de.propertyMapping&&(re=Object.keys(ue).reduce((Ee,De)=>{var ze;const Ie=((ze=de.propertyMapping)==null?void 0:ze[De])||De;return Ee[Ie]=ue[De],Ee},{}));const J=de.eventName,ve=de.description;f(J,m(A(A({},re),de.properties),{_event_metadata:ve?{description:ve}:void 0}))},[h,f]),ge={isCurrentFormValid:T,currentGroupLinkId:E,currentGroupIndex:R,hideFooterButton:P,totalSteps:N,isLoading:V,isInlineNextQuestionTriggered:K,hasCustomError:be,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:b,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:C,setCurrentGroupIndex:L,setHideFooterButton:D,setTotalSteps:w,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:oe,decrementCustomErrorCount:pe,trackQuestionnaireEvent:Se,setHasExternalError:te,groupItemIndicesRef:se};return jsx(d.Provider,{value:ge,children:p})}},35473:(Y,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 o=e(25624),i=e(76260),a=e(7630),g=e(72866),c=e(65735)},61388:(Y,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:o,onActionButtonClick:i,title:a,infoDetails:g})=>(0,n.jsxs)("div",{className:"bg-primary py-2xl px-lg rounded-2xl shadow-sm",children:[(0,n.jsxs)("div",{className:"gap-lg mb-2xl flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-primary text-md font-semibold",children:a}),o&&i&&(0,n.jsx)(t.Button,{color:"link-color",onClick:i,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:o})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Y,l,e)=>{"use strict";e.d(l,{d:()=>o});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const o=({infoDetails:i,className:a})=>{const{redirectToBook:g,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(d,O,v)=>{d.preventDefault(),O.linkType==="phone"?g(v):O.linkType==="address"?c({address:v}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},A=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},m=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:v=>y(v,O,d),className:"text-md text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary text-left font-normal! wrap-anywhere underline underline-offset-2",children:A(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:A(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",a),children:i.map((d,O)=>{const v=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(v,{className:"text-fg-secondary"}),size:"lg",color:"gray"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-tertiary m-0 mb-1 text-sm",children:d.label}),(()=>{const p=Array.isArray(d.value)?d.value:[d.value];return p.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:p.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(h,d)},f))}):m(p[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.d});var n=e(97257),t=e(71428),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},33180:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.InfoCardDetails});var n=e(3203);e.o(n,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return n.BWELL_STORED_TOKENS_KEY}}),e.o(n,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return n.LocationPermissionEnum}}),e.o(n,"LocationType")&&e.d(l,{LocationType:function(){return n.LocationType}}),e.o(n,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return n.SchedulingLocationCard}}),e.o(n,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return n.formatPhoneNumber}}),e.o(n,"getInitials")&&e.d(l,{getInitials:function(){return n.getInitials}}),e.o(n,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return n.removeAfterLastComma}}),e.o(n,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return n.shouldForceLogoutAfterAuthFailure}}),e.o(n,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return n.unformatPhoneNumber}}),e.o(n,"useDebounce")&&e.d(l,{useDebounce:function(){return n.useDebounce}}),e.o(n,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return n.useDeviceDetection}}),e.o(n,"useRedirect")&&e.d(l,{useRedirect:function(){return n.useRedirect}}),e.o(n,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return n.useSearchQueryParams}})},27163:(Y,l,e)=>{"use strict";e.d(l,{InfoCard:()=>n.n});var n=e(61388),t=e(79286),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(33180);e.o(s,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return s.BWELL_STORED_TOKENS_KEY}}),e.o(s,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return s.LocationPermissionEnum}}),e.o(s,"LocationType")&&e.d(l,{LocationType:function(){return s.LocationType}}),e.o(s,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return s.SchedulingLocationCard}}),e.o(s,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return s.formatPhoneNumber}}),e.o(s,"getInitials")&&e.d(l,{getInitials:function(){return s.getInitials}}),e.o(s,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return s.removeAfterLastComma}}),e.o(s,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return s.shouldForceLogoutAfterAuthFailure}}),e.o(s,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return s.unformatPhoneNumber}}),e.o(s,"useDebounce")&&e.d(l,{useDebounce:function(){return s.useDebounce}}),e.o(s,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return s.useDeviceDetection}}),e.o(s,"useRedirect")&&e.d(l,{useRedirect:function(){return s.useRedirect}}),e.o(s,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return s.useSearchQueryParams}})},98549:(Y,l,e)=>{"use strict";var n=e(31085);const t=({currentStep:r,totalSteps:s})=>jsx(Stack,{"data-testid":"stepper",width:"100%",children:jsx(LinearProgress,{"aria-label":`Progress bar showing step ${r} of ${s}`,sx:{height:"2px",backgroundColor:"rgba(0,0,0,0.1)","& .MuiLinearProgress-bar":{backgroundColor:"accessibility.info",borderRadius:2}},value:r/s*100,variant:"determinate"})})},26877:(Y,l,e)=>{"use strict";e.d(l,{J:()=>M});var n=e(31085),t=e(14041);const r=({size:x=24,color:z="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:x,height:x,stroke:z,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...T},t.createElement("path",{d:"M3.413 10.745c-.595-.232-.893-.348-.98-.515a.5.5 0 0 1 0-.461c.087-.167.385-.283.98-.515L20.3 2.664c.537-.21.806-.315.978-.258a.5.5 0 0 1 .316.316c.057.172-.048.44-.258.977l-6.59 16.888c-.232.595-.348.893-.515.98a.5.5 0 0 1-.462 0c-.167-.088-.282-.385-.514-.98l-2.628-6.759a1.075 1.075 0 0 0-.107-.232.5.5 0 0 0-.116-.117 1.069 1.069 0 0 0-.232-.106l-6.759-2.628Z"}));r.displayName="NavigationPointer01";var s=e(8322),o=e(76808),i=e(92094),a=e(5380),g=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,A=Object.defineProperties,m=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,p=(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)&&p(x,T,z[T]);if(d)for(var T of d(z))v.call(z,T)&&p(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),b=(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:N,setQueryParams:w}=(0,g.i)(),[V,q]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),k=S!==void 0?S:V;(0,t.useEffect)(()=>{(k||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,k,D]);const U=(0,t.useCallback)(be=>{w(f(h({},N),{location:be,locationType:a.iF.CURRENT_LOCATION,locationPermission:C||""}))},[C,N,w]),F=(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)(()=>{F()},[F]);const K=(0,o.Ul)(),G=(0,t.useCallback)(()=>b(void 0,null,function*(){x&&x(!0);let be;try{be=yield L(),be&&U&&U(`${be.coords.latitude},${be.coords.longitude}`)}catch(Se){Se instanceof Error?K?.error(Se,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Se)}`),S!==void 0&&E?E():q(!1)}return x&&x(!1),!!be}),[K,U,L,x,S,E]),se=(0,t.useCallback)(()=>b(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&E?E():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,E,I,G]),oe=(0,t.useCallback)(be=>{D("location_permissions_cta_clicked",{click:be==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),P(a.Ef.DENIED),w(f(h({},N),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&E?E():q(!1)},[D,P,w,N,I,S,E]),te=(0,t.useCallback)(()=>oe("close"),[oe]),pe=(0,t.useCallback)(()=>oe("cancel"),[oe]);return(0,n.jsx)(i.Modal,{id:"location-modal",isOpen:k,className:"sm:max-w-md",title:{content:z,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:te},primaryButton:{children:"Use my current location",onClick:se},secondaryButton:{children:"Search another way",onClick:pe}})}},35471:(Y,l,e)=>{"use strict";var n=e(26877)},98741:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(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={}))o.call(A,m)&&a(y,m,A[m]);if(s)for(var m of s(A))i.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),v=useRef(null);return useEffect(()=>{if(!!O.current){try{const p=c(y);v.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:p})}catch(p){console.error("Failed to load Lottie animation:",p)}return()=>{var p;(p=v.current)==null||p.destroy()}}},[y,A,m]),jsx("div",{ref:O,className:d})}},81304:(Y,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const o=y=>y*1609.34;var i=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:v="100%",googleMapsApiKey:p})=>{const h=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:p||""}),b={height:typeof O=="number"?`${O}px`:O,width:typeof v=="number"?`${v}px`:v},M=(0,t.useCallback)(z=>{google.maps.event.addListenerOnce(z,"idle",()=>{if(m&&y.lat&&y.lng){const S=new google.maps.Circle({center:{lat:y.lat,lng:y.lng},radius:o(m)}).getBounds();S&&z.fitBounds(S,0)}})},[y,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,i.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,i.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children: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,i.cx)("overflow-hidden rounded-lg",d),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:b,onLoad:M,options:x,zoom:12,children:(0,n.jsx)(g.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Y,l,e)=>{"use strict";e.d(l,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(92469)},92469:(Y,l,e)=>{"use strict";e.d(l,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:s})=>typeof s?.lat=="number"&&typeof s?.lng=="number"&&!isNaN(s.lat)&&!isNaN(s.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:s.lat,lng:s.lng}}):null},43743:(Y,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:i,profileUrl:a,subTitle:g,variant:c="default",showChevron:u=!0,onClick: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:i,size:"md",initials:getInitials(i),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:i}),m?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),A]}):jsx("span",{className:"text-secondary text-sm",children:g})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},o=()=>jsx("div",{className:"bg-primary border-primary animate-pulse items-center justify-between rounded-lg border p-4",children:jsxs("div",{className:"flex items-center space-x-4",children:[jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300"}),jsxs("div",{className:"flex-1 space-y-2",children:[jsx("div",{className:"h-4 w-3/4 rounded bg-gray-300"}),jsx("div",{className:"h-3 w-1/2 rounded bg-gray-300"})]})]})})},4062:(Y,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:o,fullImageHeader:i=!1,header:a,title:g})=>jsx("div",{className:"tw-preflight gap-lg flex h-full w-full items-center justify-center",children:jsxs("div",{className:"max-w-16xl flex h-fit w-full flex-col items-center justify-center self-center overflow-hidden rounded-2xl",children:[i?a:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:a}),jsxs("div",{className:"gap-lg p-sm md:pb-2xl h-fit w-full md:p-[55px]",children:[jsxs("div",{className:"text-center",children:[jsx("h1",{className:"font-display text-primary mb-md px-5 text-3xl leading-[38px] font-normal tracking-tight",children:g}),o&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:o})]}),s]})]})}),r=null},51254:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:o,icon:i})=>{var a;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:i.icon,color:(a=i.color)!=null?a:"brand",size:"lg",className:i.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),o&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:o})]})]})}},69092:()=>{},33457:(Y,l,e)=>{"use strict";var n=e(51254),t=e(69092),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},77057:(Y,l,e)=>{"use strict";e.d(l,{i:()=>Ye});var n=e(31085),t=e(36087),r=e(14041);const s=({size:Qe=24,color:Pt="currentColor",...hn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Qe,height:Qe,stroke:Pt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...hn},r.createElement("path",{d:"M9.5 7h5m-5 4h5m-5 4h5m3.5 6V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C16.48 3 15.92 3 14.8 3H9.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C6 4.52 6 5.08 6 6.2V21m14 0H4"}));s.displayName="Building04";var o=e(14449),i=e(14711),a=e(58139),g=e(37121),c=e(43144);function u(Qe){Qe()}let y=null;const A=Qe=>y=Qe,m=()=>y,d=(0,r.createContext)(null),O=null;function v(){return(0,r.useContext)(d)}let h=()=>{throw new Error("uSES not initialized!")};const f=Qe=>{h=Qe},b=(Qe,Pt)=>Qe===Pt;function M(Qe=d){const Pt=Qe===d?v:()=>(0,r.useContext)(Qe);return function(Sn,et=b){const{store:Rt,subscription:kt,getServerState:Bn}=Pt(),Ar=h(kt.addNestedSub,Rt.getState,Bn||Rt.getState,Sn,et);return(0,r.useDebugValue)(Ar),Ar}}const x=M();var z=e(75985),T=e(524);function S(){const Qe=getBatch();let Pt=null,hn=null;return{clear(){Pt=null,hn=null},notify(){Qe(()=>{let Sn=Pt;for(;Sn;)Sn.callback(),Sn=Sn.next})},get(){let Sn=[],et=Pt;for(;et;)Sn.push(et),et=et.next;return Sn},subscribe(Sn){let et=!0,Rt=hn={callback:Sn,next:null,prev:hn};return Rt.prev?Rt.prev.next=Rt:Pt=Rt,function(){!et||Pt===null||(et=!1,Rt.next?Rt.next.prev=Rt.prev:hn=Rt.prev,Rt.prev?Rt.prev.next=Rt.next:Pt=Rt.next)}}}}const E={notify(){},get:()=>[]};function C(Qe,Pt){let hn,Sn=E;function et(fr){return Ar(),Sn.subscribe(fr)}function Rt(){Sn.notify()}function kt(){Ln.onStateChange&&Ln.onStateChange()}function Bn(){return Boolean(hn)}function Ar(){hn||(hn=Pt?Pt.addNestedSub(kt):Qe.subscribe(kt),Sn=S())}function mn(){hn&&(hn(),hn=void 0,Sn.clear(),Sn=E)}const Ln={addNestedSub:et,notifyNestedSubs:Rt,handleChangeWrapper:kt,isSubscribed:Bn,trySubscribe:Ar,tryUnsubscribe:mn,getListeners:()=>Sn};return Ln}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L=null,P=null;let D=null;const N=Qe=>{D=Qe},w=null,V=null,q=Qe=>{try{return JSON.stringify(Qe)}catch{return String(Qe)}};function I(Qe,Pt,hn){useIsomorphicLayoutEffect(()=>Qe(...Pt),hn)}function k(Qe,Pt,hn,Sn,et,Rt){Qe.current=Sn,hn.current=!1,et.current&&(et.current=null,Rt())}function U(Qe,Pt,hn,Sn,et,Rt,kt,Bn,Ar,mn,Ln){if(!Qe)return()=>{};let fr=!1,Fn=null;const Wr=()=>{if(fr||!Bn.current)return;const It=Pt.getState();let $e,ot;try{$e=Sn(It,et.current)}catch(Je){ot=Je,Fn=Je}ot||(Fn=null),$e===Rt.current?kt.current||mn():(Rt.current=$e,Ar.current=$e,kt.current=!0,Ln())};return hn.onStateChange=Wr,hn.trySubscribe(),Wr(),()=>{if(fr=!0,hn.tryUnsubscribe(),hn.onStateChange=null,Fn)throw Fn}}const F=()=>w;function K(Qe,Pt){return Qe===Pt}let G=!1;function se(Qe,Pt,hn,{pure:Sn,areStatesEqual:et=K,areOwnPropsEqual:Rt=shallowEqual,areStatePropsEqual:kt=shallowEqual,areMergedPropsEqual:Bn=shallowEqual,forwardRef:Ar=!1,context:mn=ReactReduxContext}={}){const Ln=mn,fr=mapStateToPropsFactory(Qe),Fn=mapDispatchToPropsFactory(Pt),Wr=mergePropsFactory(hn),Yr=Boolean(Qe);return $e=>{const ot=$e.displayName||$e.name||"Component",Je=`Connect(${ot})`,tt={shouldHandleStateChanges:Yr,displayName:Je,wrappedComponentName:ot,WrappedComponent:$e,initMapStateToProps:fr,initMapDispatchToProps:Fn,initMergeProps:Wr,areStatesEqual:et,areStatePropsEqual:kt,areOwnPropsEqual:Rt,areMergedPropsEqual:Bn};function rt(st){const[le,ye,Ue]=useMemo(()=>{const{reactReduxForwardedRef:Rn}=st,Pn=_objectWithoutPropertiesLoose(st,P);return[st.context,Rn,Pn]},[st]),Te=useMemo(()=>le&&le.Consumer&&isContextConsumer(React.createElement(le.Consumer,null))?le:Ln,[le,Ln]),zt=useContext(Te),Gt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),vn=Boolean(zt)&&Boolean(zt.store),zn=Gt?st.store:zt.store,ar=vn?zt.getServerState:zn.getState,Dt=useMemo(()=>defaultSelectorFactory(zn.dispatch,tt),[zn]),[we,Ze]=useMemo(()=>{if(!Yr)return V;const Rn=createSubscription(zn,Gt?void 0:zt.subscription),Pn=Rn.notifyNestedSubs.bind(Rn);return[Rn,Pn]},[zn,Gt,zt]),Ot=useMemo(()=>Gt?zt:_extends({},zt,{subscription:we}),[Gt,zt,we]),en=useRef(),nn=useRef(Ue),fn=useRef(),mt=useRef(!1),Qt=useRef(!1),qt=useRef(!1),Lt=useRef();useIsomorphicLayoutEffect(()=>(qt.current=!0,()=>{qt.current=!1}),[]);const Ft=useMemo(()=>()=>fn.current&&Ue===nn.current?fn.current:Dt(zn.getState(),Ue),[zn,Ue]),Yt=useMemo(()=>Pn=>we?U(Yr,zn,we,Dt,nn,en,mt,qt,fn,Ze,Pn):()=>{},[we]);I(k,[nn,en,mt,Ue,fn,Ze]);let On;try{On=D(Yt,Ft,ar?()=>Dt(ar(),Ue):Ft)}catch(Rn){throw Lt.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.
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1127.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.13.1"},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.1378.1",D="@icanbwell/composite. repo version: 0.1378.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};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icanbwell/composite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1127.1",
|
|
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.
|
|
47
|
-
"description": "@icanbwell/composite. repo version: 0.
|
|
46
|
+
"repoVersion": "0.1378.1",
|
|
47
|
+
"description": "@icanbwell/composite. repo version: 0.1378.1"
|
|
48
48
|
}
|