@icanbwell/composite 1.1137.1 → 1.1139.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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:$t,elementNameSuffix:Kt,version:Et,prefetchFeatureApp:Xe})=>(0,h.__awaiter)(void 0,void 0,void 0,function*(){var We,Ot,Qe,Ye,Dt,pn,zn,et,xt,Xt,Wn,zr,hn,Ln,mr;window.bwell||(window.bwell=new re({metadata:{version:Et}}));const wn=`bwell-${Kt}`;if(customElements.get(wn)!==void 0)return;class Zr extends f{constructor(){super(),We.add(this),Ot.set(this,(0,S.nanoid)()),Qe.set(this,void 0),Ye.set(this,document.createElement("feature-app-loader")),Dt.set(this,new I.EventEmitter),pn.set(this,void 0),zn.set(this,void 0),et.set(this,void 0),xt.set(this,void 0),Xt.set(this,void 0),Wn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:Fe,container:ot,name:Je})=>{Je==="error"&&Fe==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,h.__classPrivateFieldGet)(this,Ye,"f").style.display=Fe==="hidden"?"unset":"hidden"}),(0,h.__classPrivateFieldSet)(this,Wn,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,h.__classPrivateFieldGet)(this,Dt,"f")},"f"),(0,h.__classPrivateFieldSet)(this,pn,(0,h.__classPrivateFieldGet)(this,We,"m",zr).bind(this),"f"),(0,h.__classPrivateFieldSet)(this,zn,(0,h.__classPrivateFieldGet)(this,We,"m",hn).bind(this),"f"),(0,h.__classPrivateFieldSet)(this,et,(0,h.__classPrivateFieldGet)(this,We,"m",mr).call(this,"error"),"f"),(0,h.__classPrivateFieldSet)(this,xt,(0,h.__classPrivateFieldGet)(this,We,"m",mr).call(this,"loading"),"f")}connectedCallback(){return(0,h.__awaiter)(this,void 0,void 0,function*(){(0,h.__classPrivateFieldGet)(this,et,"f").call(this,(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.get("error")),(0,h.__classPrivateFieldGet)(this,xt,"f").call(this,(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.get("loading")),(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.addEventListener("visibilitychange",(0,h.__classPrivateFieldGet)(this,zn,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.addChangeListener("error",(0,h.__classPrivateFieldGet)(this,et,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.addChangeListener("loading",(0,h.__classPrivateFieldGet)(this,xt,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}(0,h.__classPrivateFieldSet)(this,Ot,this.id||(0,h.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,h.__classPrivateFieldSet)(this,Qe,new T((0,h.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,h.__classPrivateFieldGet)(this,Qe,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,h.__classPrivateFieldGet)(this,pn,"f").call(this):(window.bwell.once("initialized",(0,h.__classPrivateFieldGet)(this,pn,"f")),window.bwell.once("error",()=>{(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}),Xe&&(0,p.h)($t).catch(()=>{(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,h.__classPrivateFieldGet)(this,Dt,"f").emit("disconnect"),(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.removeEventListener("visibilitychange",(0,h.__classPrivateFieldGet)(this,zn,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.removeChangeListener("error",(0,h.__classPrivateFieldGet)(this,et,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.removeChangeListener("loading",(0,h.__classPrivateFieldGet)(this,xt,"f")),(It=(0,h.__classPrivateFieldGet)(this,Qe,"f"))===null||It===void 0||It.deregister(),(0,h.__classPrivateFieldGet)(this,Dt,"f").removeAllListeners()}}Ot=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Dt=new WeakMap,pn=new WeakMap,zn=new WeakMap,et=new WeakMap,xt=new WeakMap,Xt=new WeakMap,Wn=new WeakMap,We=new WeakSet,zr=function(){(0,h.__classPrivateFieldGet)(this,Ye,"f").setAttribute("featureAppId",`bwell-embeddable:${wn}`),(0,h.__classPrivateFieldGet)(this,Ye,"f").setAttribute("src",$t),(0,h.__classPrivateFieldGet)(this,Ye,"f").config={id:(0,h.__classPrivateFieldGet)(this,Ot,"f"),name:Kt,elementName:wn,utils:(0,h.__classPrivateFieldGet)(this,Wn,"f")},this.shadowRoot.appendChild((0,h.__classPrivateFieldGet)(this,Ye,"f"))},hn=function({visibility:It,name:Fe}){(0,h.__classPrivateFieldGet)(this,Ye,"f").style.display=It==="hidden"?"unset":"hidden"},Ln=function(It){(0,h.__classPrivateFieldGet)(this,Xt,"f")(),(0,h.__classPrivateFieldSet)(this,Xt,void 0,"f")},mr=function(It){return Fe=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.get(tt)!==null)){if(Fe!==null)(0,h.__classPrivateFieldGet)(this,Xt,"f")&&(0,h.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It),(0,h.__classPrivateFieldSet)(this,Xt,(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[It]),"f");else if(Fe===null&&(0,h.__classPrivateFieldGet)(this,Xt,"f")){(0,h.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It);const tt=Ie.find(rt=>(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.get(rt)!==null);tt&&(0,h.__classPrivateFieldSet)(this,Xt,(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(wn,Zr)}),it={rE:"1.1137.1"},mt="composite";var Lt=e(67321);$e({src:`https://embeddables.prod.icanbwell.com/${mt}/${it.rE}/scripts/embeddable.federated.js`,elementNameSuffix:mt,version:it.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,g=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,A=(h,p,f)=>p in h?i(h,p,{enumerable:!0,configurable:!0,writable:!0,value:f}):h[p]=f,m=(h,p)=>{for(var f in p||(p={}))u.call(p,f)&&A(h,f,p[f]);if(c)for(var f of c(p))E.call(p,f)&&A(h,f,p[f]);return h},d=(h,p)=>a(h,g(p));const O=(h,p,f)=>{const b=_.cloneDeep(h);if(!b.contained||p<0)return b;const M=b.contained.findIndex(x=>x.resourceType==="Questionnaire");if(M!==-1&&!f){const x=b.contained[M];if(x.item){if(!x.item.some(C=>isPageExtensionPresent(C)))return b;let T=0,S=x.item.length;for(let C=0;C<x.item.length;C++){const y=x.item[C];if(isPageExtensionPresent(y)){if(T===p+1){S=C;break}T++}}x.item=x.item.slice(0,S),b.contained[M]=x}}else f&&M!==-1&&(b.contained[M]=d(m({},b.contained[M]),{item:f}));return b},v=({formId:h,questionnaireResponse:p,showQuestionPrefix:f,nextQuestion:b,onGoBack:M,handleHiddenQuestion:x,errorConfig:z,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:y,onFormDataChange:R,externalComponentRenderMap:P,className:L,children:D})=>{var w,N,V;const{currentGroupIndex:q,hasCustomError:I}=useFHIRQuestionnaire(),k=(w=p.questionnaire)==null?void 0:w.replace("#",""),U=(N=p?.contained)==null?void 0:N.find(K=>K.id===k&&K.resourceType==="Questionnaire"),F=(K,G,se)=>{let oe=_.cloneDeep(p);oe.item=K,oe=trimQuestionnaireItems(oe,q,se),b(oe,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,L),children:jsx(FHIRQuestionnaire,{formId:h,onFormDataChange:R,questionnaireResponseItem:(V=p?.item)!=null?V:[],questionnaireSchema:U,status:p.status,showQuestionPrefix:f,errorConfig:z,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:T,handleHiddenQuestion:x,showStepper:C,hideBackButton:y,externalComponentRenderMap:P,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,E=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},h=(M,x)=>u(M,E(x)),p=(M,x,z)=>new Promise((T,S)=>{var C=P=>{try{R(z.next(P))}catch(L){S(L)}},y=P=>{try{R(z.throw(P))}catch(L){S(L)}},R=P=>P.done?T(P.value):Promise.resolve(P.value).then(C,y);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:y,errorText:R})=>{const P=(0,a.Ul)(),{i18n:{t:L},loading:D}=(0,g.E_)({keys:["shared-translations"]}),w=x?.placeId,N=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,oe]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Kt=>{var Et,Xe;const We=(Xe=(Et=Kt.placeAutocomplete)==null?void 0:Et.predictions)==null?void 0:Xe.map(Ot=>{var Qe;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Qe=Ot.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Kt=>h(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,be]),ze=Kt=>p(void 0,null,function*(){var Et,Xe,We,Ot,Qe,Ye,Dt,pn,zn,et,xt,Xt,Wn,zr,hn,Ln;if(F(Kt),G(Kt),oe(!1),Kt&&typeof Kt=="string"){const mr=be.find(tt=>tt.id===Kt),wn=mr?.label||V;if(!mr)return;q(wn),k(wn),setTimeout(()=>{const tt=[{id:mr.id,label:mr.label}];Se(tt),ne(tt)},f);const Zr=yield ae({variables:{placeId:Kt}}),n0=(Xe=(Et=Zr?.data)==null?void 0:Et.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(We=Zr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,Fe=((Ye=(Qe=Zr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((pn=(Dt=Zr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:pn.state)||"",Je=((et=(zn=Zr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(n0&&It)if(!Fe||!Je){const tt=yield ce({variables:{latitude:String(n0),longitude:String(It)}}),rt=((Xt=(xt=tt?.data)==null?void 0:xt.geocodingByLatLon)==null?void 0:Xt.zipCode)||"",lt=((zr=(Wn=tt?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:zr.state)||"",St=((Ln=(hn=tt?.data)==null?void 0:hn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:n0,longitude:It,zipCode:rt,state:lt,stateCode:St,placeId:Kt,description:wn,value:Kt})}else T({latitude:n0,longitude:It,zipCode:Fe,state:ot,stateCode:Je,placeId:Kt,description:wn,value:Kt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>p(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),$e=Kt=>p(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 Et=Kt.trim();Et.length>=2?yield xe(Et):Se(pe)}),it=Kt=>{te.current=Kt},mt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>p(void 0,null,function*(){var Et,Xe,We,Ot,Qe,Ye,Dt,pn,zn,et,xt,Xt,Wn,zr,hn,Ln;if(w&&N){Se([{id:w,label:V||N}]),ne([{id:w,label:V||N}]),F(w),G(w),q(N),k(N),N===V&&q(N);const mr=yield ae({variables:{placeId:w}}),wn=(Xe=(Et=mr?.data)==null?void 0:Et.geocodingByPlaceId)==null?void 0:Xe.latitude,Zr=(Ot=(We=mr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,n0=((Ye=(Qe=mr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",It=((pn=(Dt=mr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:pn.state)||"",Fe=((et=(zn=mr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(wn&&Zr)if(!n0||!It||!Fe){const ot=yield ce({variables:{latitude:String(wn),longitude:String(Zr)}}),Je=((Xt=(xt=ot?.data)==null?void 0:xt.geocodingByLatLon)==null?void 0:Xt.zipCode)||"",tt=((zr=(Wn=ot?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:zr.state)||"",rt=((Ln=(hn=ot?.data)==null?void 0:hn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:wn,longitude:Zr,zipCode:Je,state:tt,stateCode:rt,placeId:w,description:N,value:w})}else T({latitude:wn,longitude:Zr,zipCode:n0,state:It,stateCode:Fe,placeId:w,description:N,value:w})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const Lt=se||!!he||!!re||!!Ee||!!R,$t=Lt?R||L("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{y&&y(me||ue||D)},[y,me,ue,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:L("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:$e,defaultFilter:Ie,onOpenChange:it,onBlur:mt,isInvalid:Lt,hint:$t,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Et=Kt,Xe=V.trim().length>=2,We=Et.mainText||"",Ot=Et.secondaryText||"",Qe=We.trim().length>0,Ye=Ot.trim().length>0,Dt=Qe?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},pn=Ye?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Et.id,supportingText:Et.supportingText,isDisabled:Et.isDisabled,icon:Et.icon,avatarUrl:Et.avatarUrl,textValue:Et.label,children:Xe&&Qe?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Dt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Dt.highlightedPart}),(0,n.jsx)("span",{children:Dt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:pn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:pn.highlightedPart}),(0,n.jsx)("span",{children:pn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Et.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:i})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(52449);const i=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:E}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),h=c.getRouteMeta(v)||{},p=getBreadcrumbTitleKey(v,h,u);if(!p||h.breadcrumbHide)return[];const f=E[v];let b=c.getHref(v),M=p;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(y,R)=>new Promise((P,L)=>setTimeout(()=>L(new Error(R)),y)),u=(y,R,P)=>Promise.race([y,c(R,P)]),E=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(y,R,P)=>R in y?m(y,R,{enumerable:!0,configurable:!0,writable:!0,value:P}):y[R]=P,b=(y,R)=>{for(var P in R||(R={}))h.call(R,P)&&f(y,P,R[P]);if(v)for(var P of v(R))p.call(R,P)&&f(y,P,R[P]);return y},M=(y,R)=>d(y,O(R)),x=(y,R,P)=>new Promise((L,D)=>{var w=q=>{try{V(P.next(q))}catch(I){D(I)}},N=q=>{try{V(P.throw(q))}catch(I){D(I)}},V=q=>q.done?L(q.value):Promise.resolve(q.value).then(w,N);V((P=P.apply(y,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),C=({children:y})=>{var R;const{mobileOS:P}=(0,r.useDeviceDetection)(),L=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:w,setQueryParams:N}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(w);(0,t.useEffect)(()=>{q.current=w},[w]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=w.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{N(M(b({},q.current),{locationPermission:ve||i.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?L?.error(Ee,"Failed to update query params"):L?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[N,L]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking geolocation availability"):L?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,L]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,E,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&L?.error(De,"Geolocation timeout or error"),De}}),[D,L]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),E,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return L?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==i.Ef.GRANTED&&Ee!==i.Ef.PROMPT?(L?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location services"):L?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,L,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=w.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!0)):te(Ie)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error getting initial location with granted permission"):L?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error getting initial location"):L?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?L?.error(De,"Error initializing location permission"):L?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(P==="Android"&&Ee===i.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?L?.error(De,"Error re-requesting Android permission"):L?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.Ef.UNAVAILABLE),ve instanceof Error?L?.error(ve,"Error refreshing location"):L?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,L,P,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location permission"):L?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,L,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?L?.error(ve,"Error checking and setting location permission"):L?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,L,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||L?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||L?.error(`Error requesting location - ${Ee}`)}te(i.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,L,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),N(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?L?.error(ve,"Error requesting current location"):L?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,L,N,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&N(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?L?.error(ve,"Error overriding search settings"):L?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[L,U,ae,N]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),y]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>lt,GI:()=>be,rz:()=>et,Fp:()=>zn,el:()=>pn,ao:()=>Dt,oA:()=>D,Yt:()=>St,g4:()=>Ye,tn:()=>Ue,n4:()=>w,gD:()=>L,Vp:()=>tt,Cx:()=>k,bK:()=>q,gi:()=>rt,Z$:()=>he,GT:()=>Je,hr:()=>ce,JL:()=>ue,Ck:()=>I,dU:()=>V,wG:()=>mr,hZ:()=>hn,$e:()=>xt,qT:()=>zr,GQ:()=>Wn,q3:()=>Ln,D_:()=>Xt,Uf:()=>F,_l:()=>ge,Md:()=>se,V7:()=>G,fe:()=>ae,JP:()=>At,Z_:()=>N,zO:()=>me,UZ:()=>te,$7:()=>Xe,rb:()=>K,_W:()=>Ot,WS:()=>We,VF:()=>Fe,vf:()=>Zr,PV:()=>ot,PS:()=>wn,Iz:()=>It,zD:()=>oe,m3:()=>Lt,XP:()=>$t,PM:()=>De,cX:()=>re,G6:()=>J,Us:()=>Ie,AA:()=>Ee,G0:()=>mt,mO:()=>$e,HH:()=>ze,PU:()=>ye,it:()=>Et,Tl:()=>it,uH:()=>Kt,c3:()=>ve,rx:()=>P});var n=e(36087),t=e(14041);const r=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),E=e(22716),A=e(9495);const m=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const h=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));h.displayName="CreditCard02";const p=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));p.displayName="Link03";var f=e(85418);const b=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M16 7c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.121-2.122C13.395 3 12.93 3 12 3c-.93 0-1.395 0-1.777.102a3 3 0 0 0-2.12 2.122C8 5.605 8 6.07 8 7M5.2 21h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 19.48 22 18.92 22 17.8v-7.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 7 19.92 7 18.8 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 21 4.08 21 5.2 21Z"}));z.displayName="Briefcase01";const T=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M12.913 17h7.174m-7.174 0L11 21m1.913-4 2.865-5.991c.231-.483.347-.724.505-.8a.5.5 0 0 1 .434 0c.158.076.274.317.505.8L20.087 17m0 0L22 21M2 5h6m0 0h3.5M8 5V3m3.5 2H14m-2.5 0c-.496 2.957-1.647 5.636-3.334 7.884M10 14a9.396 9.396 0 0 1-1.834-1.116m0 0C6.813 11.848 5.603 10.427 5 9m3.166 3.884A17.295 17.295 0 0 1 2 18"}));T.displayName="Translate01";const S=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M10 8.502a2.248 2.248 0 0 1 4.37.75c0 1.499-2.25 2.248-2.25 2.248m.03 3h.01M9.9 19.2l1.46 1.947c.217.29.326.434.459.486a.5.5 0 0 0 .362 0c.133-.052.242-.197.459-.486L14.1 19.2c.293-.39.44-.586.619-.735a2 2 0 0 1 .822-.412c.226-.053.47-.053.959-.053 1.398 0 2.097 0 2.648-.228a3 3 0 0 0 1.624-1.624C21 15.597 21 14.898 21 13.5V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v5.7c0 1.398 0 2.097.228 2.648a3 3 0 0 0 1.624 1.624C5.403 18 6.102 18 7.5 18c.489 0 .733 0 .96.053a2 2 0 0 1 .821.412c.18.149.326.344.619.735Z"}));S.displayName="AnnotationQuestion";const C=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M15 2.458A9.996 9.996 0 0 0 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.715-.432-3.33-1.193-4.74M17 5.75h.005M10.5 21.888v-2.203a.5.5 0 0 1 .12-.325l2.486-2.9a.5.5 0 0 0-.131-.76l-2.857-1.632a.499.499 0 0 1-.186-.187L8.07 10.62a.5.5 0 0 0-.478-.25l-5.528.492M21 6c0 2.21-2 4-4 6-2-2-4-3.79-4-6a4 4 0 0 1 8 0Zm-3.75-.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0Z"}));C.displayName="Globe05";const y=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));y.displayName="Shield01";const R=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M21 15v1.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V15m14-7-5-5m0 0L7 8m5-5v12"}));R.displayName="Upload01";const P=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,L="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",w="http://hl7.org/fhir/questionnaire-item-control",N="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",q="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",k="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",F="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",K="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",G="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",se="http://hl7.org/fhir/StructureDefinition/entryFormat",oe="http://hl7.org/fhir/StructureDefinition/tz-code",te="tz-code",pe="footer",be="check-box",Se="header",ge="page",ne="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ae="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",he=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],ce={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ue={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},re="ui-toolkit/CoordinatePicker",J="ui-toolkit/DetailsInfo",ve="ui-toolkit/ServiceChoice",Ee="ui-toolkit/InfoBanner",De="ui-toolkit/Button",ze="ui-toolkit/Phone",Ie="ui-toolkit/ErrorCard",xe="ui-toolkit/FormContainer",$e="ui-toolkit/PageHeader",it="ui-toolkit/SelectableOption",mt="ui-toolkit/Modal",Lt="ui-toolkit/Alert",$t="ui-toolkit/AppSectionAccess",Kt="ui-toolkit/SensitiveDataCategory",Et="ui-toolkit/QuestCard",Xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",We="http://icanbwell.com/fhir/StructureDefinition/text-align",Ot={LEFT:"left",CENTER:"center"},Qe={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Ye="http://icanbwell.com/fhir/StructureDefinition/icon-name",Dt="http://icanbwell.com/fhir/StructureDefinition/error-title",pn="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",zn="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",et="http://icanbwell.com/fhir/StructureDefinition/description",xt="http://icanbwell.com/fhir/StructureDefinition/modal-description",Xt="http://icanbwell.com/fhir/StructureDefinition/modal-title",Wn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",zr="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",hn="http://icanbwell.com/fhir/StructureDefinition/button-text",Ln="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",mr="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",wn="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Zr="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",n0="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",It="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Fe="http://icanbwell.com/fhir/StructureDefinition/trigger-color",ot="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Je="http://hl7.org/fhir/StructureDefinition/mimeType",tt="http://hl7.org/fhir/StructureDefinition/maxSize",rt="http://icanbwell.com/fhir/StructureDefinition/message-severity",lt="http://icanbwell.com/fhir/StructureDefinition/alert-color",St="http://icanbwell.com/fhir/StructureDefinition/hideLabel",st="http://icanbwell.com/fhir/StructureDefinition/placeholder",le="http://icanbwell.com/fhir/StructureDefinition/hint-text",ye="ui-toolkit/PrefilledMemberDemographicsAlert",Ue="http://hl7.org/fhir/issue-severity",Te="http://icanbwell.com/fhir/StructureDefinition/button-type",zt="http://icanbwell.com/fhir/StructureDefinition/button-action",Yt="button-type",vn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",$n="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ar="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Wt="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",we="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Ze={},At={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":E.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":h,"link-03":p,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x,"briefcase-01":z,"translate-01":T,"annotation-question":S,"globe-05":C,"shield-01":y,"upload-01":R}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>w,$O:()=>mt,CP:()=>Xt,Fy:()=>xt,GN:()=>be,J4:()=>lt,MU:()=>G,Nw:()=>ot,Qr:()=>C,Ue:()=>St,Yo:()=>Ee,a0:()=>T,cz:()=>y,di:()=>I,eC:()=>st,iI:()=>k,lv:()=>q,mR:()=>vn,nt:()=>S,od:()=>V,t7:()=>Lt,u0:()=>x,yQ:()=>Yt,zj:()=>ue});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),g=e(45250),c=e.n(g),u=e(16681),E=e(18807),A=e(1053),m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(Rt,Ct,bt)=>Ct in Rt?m(Rt,Ct,{enumerable:!0,configurable:!0,writable:!0,value:bt}):Rt[Ct]=bt,b=(Rt,Ct)=>{for(var bt in Ct||(Ct={}))h.call(Ct,bt)&&f(Rt,bt,Ct[bt]);if(v)for(var bt of v(Ct))p.call(Ct,bt)&&f(Rt,bt,Ct[bt]);return Rt},M=(Rt,Ct)=>d(Rt,O(Ct));const x=(Rt,Ct,bt,kt)=>{if(Rt){const mn=Rt(Ct,b({defaultValue:bt},kt));if(mn&&mn!==Ct)return mn}return kt?Object.entries(kt).reduce((mn,[Tn,Or])=>mn.replace(`{{${Tn}}}`,String(Or)),bt):bt},z=Rt=>{var Ct;return(Ct=Rt.filter(bt=>bt.url.includes("questionnaire-itemControl")).flatMap(bt=>{var kt,mn;return(mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)!=null?mn:[]}).find(bt=>{var kt;return(kt=bt.code)==null?void 0:kt.startsWith("ui-toolkit/")}))==null?void 0:Ct.code},T=Rt=>{var Ct;const bt=(Ct=Rt.extension)==null?void 0:Ct.find(kt=>kt.url===A.V7);return bt?.valueCode||"off"},S=(Rt,Ct,bt)=>{const kt=(0,E.A)(bt);return Rt&&Ct&&bt?kt.replace("<p>",`<span>${Ct} `).replace("</p>","</span>").trim():kt.replace("<p>","<span>").replace("</p>","</span>").trim()},C=Rt=>{const Ct=Rt?.find(bt=>bt.url===A.Vp);return Ct?.valueInteger},y=Rt=>{const Ct=Rt?.find(bt=>bt.url===A.Z_);return Ct?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},P="Type your response here...",L=(Rt,Ct)=>{const bt=Rt?.find(kt=>kt.url===PLACEHOLDER_EXTENSION_URL);return bt?.valueString||Ct&&R[Ct]||P},D=Rt=>{const Ct=Rt?.find(bt=>bt.url===HINT_TEXT_EXTENSION_URL);return Ct?.valueString},w=Rt=>{const Ct=Rt?.filter(bt=>bt.url===A.GT&&bt.valueCode).map(bt=>A.hr[bt.valueCode]||bt.valueCode);return Ct?.length?Ct.join(","):void 0},N=Rt=>Rt.split(",").map(kt=>kt.trim()).map(kt=>A.JL[kt]||kt).filter((kt,mn,Tn)=>Tn.indexOf(kt)===mn).join(", "),V=(Rt,Ct,bt)=>{const kt=N(Rt),mn=kt.lastIndexOf(","),Tn=mn!==-1?`${kt.substring(0,mn)} or${kt.substring(mn+1)}`:kt,Or=[Ct&&`max. ${(Ct/(1e3*1e3)).toFixed(0)}MB`,bt&&`upto ${bt} file${bt>1?"s":""}`].filter(Boolean);return Or.length>0?`${Tn} (${Or.join(", ")})`:Tn},q=Rt=>{const Ct=Rt?.find(bt=>bt?.url===A.zD||bt?.url===A.UZ);return Ct?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(Rt,Ct)=>{var bt,kt,mn;const Tn=Ct?.find(Or=>Or.url.includes(Rt));return(mn=(kt=(bt=Tn?.valueInteger)!=null?bt:Tn?.valueDecimal)!=null?kt:Tn?.valueString)!=null?mn:Tn?.valueDate},k=Rt=>{if(!!Rt){if(/^\d{4}-\d{2}-\d{2}$/.test(Rt))return Rt;try{const Ct=(0,i.evaluate)({},Rt);if(Array.isArray(Ct)&&Ct.length>0){const bt=Ct[0];if(bt instanceof Date&&!isNaN(bt.getTime())){const kt=bt.getFullYear(),mn=String(bt.getMonth()+1).padStart(2,"0"),Tn=String(bt.getDate()).padStart(2,"0");return`${kt}-${mn}-${Tn}`}if(typeof bt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(bt))return bt}}catch{}}},U=(Rt,Ct)=>{var bt,kt;const mn=Ct?.find(Or=>Or.url===Rt);if(!mn)return;const Tn=(bt=mn.valueString)!=null?bt:mn.valueDate;return Tn||k((kt=mn.valueExpression)==null?void 0:kt.expression)},F=(Rt,Ct)=>{if(!(!Rt||Rt.length===0))for(const bt of Rt){const kt=I(Ct,bt.extension);if(kt!==void 0)return kt;if(bt.item&&bt.item.length>0){const mn=F(bt.item,Ct);if(mn!==void 0)return mn}}},K=(Rt,Ct)=>{try{const bt=String(Rt??Ct);let kt;if(bt.includes("/"))kt=(0,n.A)(bt,"MM/dd/yyyy",new Date);else{const mn=bt.split("T")[0];kt=(0,t.A)(mn)}return(0,r.A)(kt)}catch(bt){return console.error("Date parsing error:",bt,Rt),null}},G=(Rt,Ct)=>{var bt;for(const kt of Rt){if(kt.linkId===Ct)return kt;if((bt=kt.item)!=null&&bt.length){const mn=G(kt.item,Ct);if(mn!==void 0)return mn}}},se=(Rt,Ct)=>{var bt;const kt=[];for(const mn of Rt)if(mn.linkId===Ct&&kt.push(mn),(bt=mn.item)!=null&&bt.length){const Tn=se(mn.item,Ct);kt.push(...Tn)}return kt},oe=(Rt,Ct,bt=0)=>se(Rt,Ct)[bt];function te(Rt){return Rt!=null}const pe=(Rt,Ct)=>{var bt,kt,mn;if("answerString"in Rt&&te(Rt.answerString)){if(Rt.operator==="=")return Ct?.valueString===Rt.answerString;if(Rt.operator==="!=")return Ct?.valueString!==Rt.answerString}if("answerBoolean"in Rt&&te(Rt.answerBoolean)){if(Rt.operator==="=")return Ct?.valueBoolean===Rt.answerBoolean;if(Rt.operator==="!=")return Ct?.valueBoolean!==Rt.answerBoolean}if("answerInteger"in Rt&&te(Rt.answerInteger)||"answerDecimal"in Rt&&te(Rt.answerDecimal)){const Tn=Number(Ct?.valueInteger||Ct?.valueDecimal),Or=Number(Rt.answerInteger||Rt.answerDecimal);if(Rt.operator==="=")return Tn===Or;if(Rt.operator==="!=")return Tn!==Or;if(Rt.operator===">")return Tn>Or;if(Rt.operator==="<")return Tn<Or;if(Rt.operator===">=")return Tn>=Or;if(Rt.operator==="<=")return Tn<=Or}if("answerQuantity"in Rt&&te(Rt.answerQuantity)){const Tn=Ct?.valueQuantity,Or=Rt.answerQuantity;if(Tn?.unit!==Or?.unit)return!1;if(Rt.operator==="=")return Tn.value===Or.value;if(Rt.operator==="!=")return Tn.value!==Or.value;if(Rt.operator===">")return Tn.value>Or.value;if(Rt.operator==="<")return Tn.value<Or.value;if(Rt.operator===">=")return Tn.value>=Or.value;if(Rt.operator==="<=")return Tn.value<=Or.value}if("answerCoding"in Rt&&te(Rt.answerCoding)){const Tn=Ct?.valueCoding,Or=Rt.answerCoding;if(Rt.operator==="=")return Tn?.code===Or.code;if(Rt.operator==="!=")return Tn?.code!==Or.code}if("answerReference"in Rt&&te(Rt.answerReference)){const Tn=Ct?.valueReference,Or=Rt.answerReference;if(Rt.operator==="=")return Tn?.reference===Or.reference;if(Rt.operator==="!=")return Tn?.reference!==Or.reference}if("answerDate"in Rt&&te(Rt.answerDate)||"answerDateTime"in Rt&&te(Rt.answerDateTime)||"answerTime"in Rt&&te(Rt.answerTime)){const Tn=new Date((mn=(kt=(bt=Ct?.valueDate)!=null?bt:Ct?.valueDateTime)!=null?kt:Ct?.valueTime)!=null?mn:""),Or=new Date(Rt.answerDate||Rt.answerDateTime||Rt.answerTime||"");if(Rt.operator==="=")return Tn.getTime()===Or.getTime();if(Rt.operator==="!=")return Tn.getTime()!==Or.getTime();if(Rt.operator===">")return Tn.getTime()>Or.getTime();if(Rt.operator==="<")return Tn.getTime()<Or.getTime();if(Rt.operator===">=")return Tn.getTime()>=Or.getTime();if(Rt.operator==="<=")return Tn.getTime()<=Or.getTime()}return Rt.operator==="exists"?Ct!=null===Rt.answerBoolean:!0},be=(Rt,Ct,bt)=>{const kt=mn=>{const Tn=se(bt,mn.question);return Tn.length===0||Tn.every(Or=>!Or.answer||Or.answer.length===0)?pe(mn,void 0):Tn.some(Or=>{var Cn;return(Cn=Or.answer)==null?void 0:Cn.some(gn=>pe(mn,gn&&Object.keys(gn).length>0?gn:void 0))})};return Rt&&Rt?.length>0?Ct==="any"?Rt?.some(mn=>kt(mn)):Rt?.every(mn=>kt(mn)):!0},Se=(Rt,Ct,bt,kt,mn)=>{if(!Rt||Rt.length===0)return!0;const Tn=Or=>{var Cn;let gn;if(kt&&typeof mn=="number"){const Mt=bt.filter(Pt=>Pt.linkId===kt)[mn];if(Mt?.item){const Pt=Mt.item.find(Ut=>Ut.linkId===Or.question);if(Pt?.answer&&Pt.answer.length>0)return(Cn=Pt?.answer)==null?void 0:Cn.some(Ut=>pe(Or,Ut&&Object.keys(Ut).length>0?Ut:void 0))}}if(!gn){const rn=se(bt,Or.question);if(rn.length>0)return rn.some(Mt=>{var Pt;return(Pt=Mt.answer)==null?void 0:Pt.some(Ut=>pe(Or,Ut&&Object.keys(Ut).length>0?Ut:void 0))});gn=void 0}return pe(Or,gn)};return Ct==="any"?Rt.some(Or=>Tn(Or)):Rt.every(Or=>Tn(Or))},ge=(Rt,Ct)=>{var bt;if(!!((bt=Rt?.valueExpression)!=null&&bt.expression))try{const kt=evaluate(Ct,Rt.valueExpression.expression);return Array.isArray(kt)?kt.some(mn=>Boolean(mn)):Boolean(kt)}catch{return}},ne=(Rt,Ct)=>{var bt;const kt=(bt=Rt.extension)==null?void 0:bt.find(Tn=>Tn.url===READ_ONLY_EXPRESSION_EXTENSION_URL),mn=ge(kt,Ct);return M(b({},Rt),{readOnly:mn??Rt.readOnly})},ae=(Rt,Ct,bt,kt)=>{const{required:mn,maxLength:Tn,type:Or,extension:Cn,enableWhen:gn,enableBehavior:rn,repeats:Mt,answerOption:Pt}=Rt;if(!be(gn,rn,Ct)||Rt.type==="group"||Rt.type==="display")return"";if(Mt)return me(Rt,Ct,bt,kt);const Ut=re(Rt,Ct);return Ut&&J(Ut,Rt)?ve(Rt,Ct,bt,Ut,kt):ue(Cn,Or,mn,Tn,bt,Pt,kt)},me=(Rt,Ct,bt,kt)=>{const{required:mn}=Rt;if(mn){if(!bt||bt.length===0)return x(kt,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let Tn=!1;for(let Or=0;Or<bt.length;Or++){const Cn=bt[Or];if(Cn&&Object.keys(Cn).length>0&&Object.values(Cn).some(rn=>rn!=null&&rn!==""&&(Array.isArray(rn)?rn.length>0:!0))){Tn=!0;const rn=ue(Rt.extension,Rt.type,!0,Rt.maxLength,[Cn],Rt.answerOption,kt);if(rn)return x(kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Or+1,error:rn});if(Rt.item&&Rt.item.length>0){const Mt=he(Rt.item,Ct,Rt.linkId,Or,kt);if(Mt)return x(kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Or+1,error:Mt})}}else return x(kt,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:Or+1})}if(!Tn)return x(kt,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(bt&&bt.length>0)for(let Tn=0;Tn<bt.length;Tn++){const Or=bt[Tn];if(Or&&Object.keys(Or).length>0&&Object.values(Or).some(gn=>gn!=null&&gn!==""&&(Array.isArray(gn)?gn.length>0:!0))){const gn=ue(Rt.extension,Rt.type,!1,Rt.maxLength,[Or],Rt.answerOption,kt);if(gn)return x(kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Tn+1,error:gn});if(Rt.item&&Rt.item.length>0){const rn=he(Rt.item,Ct,Rt.linkId,Tn,kt);if(rn)return x(kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Tn+1,error:rn})}}}return""},he=(Rt,Ct,bt,kt,mn)=>{var Tn,Or;for(const Cn of Rt){if(!Se(Cn.enableWhen,Cn.enableBehavior,Ct,bt,kt))continue;const gn=G(Ct,bt),rn=(Tn=gn?.item)==null?void 0:Tn.find(Pt=>Pt.linkId===Cn.linkId),Mt=(Or=rn?.answer)!=null&&Or[kt]?[rn.answer[kt]]:void 0;if(Cn.required){if(!Mt||!Mt[0]||!ce(Mt[0]))return x(mn,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Cn.text||Cn.linkId});const Pt=ue(Cn.extension,Cn.type,!0,Cn.maxLength,Mt,Cn.answerOption,mn);if(Pt)return`${Cn.text||Cn.linkId}: ${Pt}`}else if(Mt&&Mt[0]&&ce(Mt[0])){const Pt=ue(Cn.extension,Cn.type,!1,Cn.maxLength,Mt,Cn.answerOption,mn);if(Pt)return`${Cn.text||Cn.linkId}: ${Pt}`}if(Cn.item&&Cn.item.length>0){const Pt=he(Cn.item,Ct,Cn.linkId,kt,mn);if(Pt)return Pt}}return""},ce=Rt=>!Rt||Object.keys(Rt).length===0?!1:Object.values(Rt).some(Ct=>Ct!=null&&Ct!==""&&(Array.isArray(Ct)?Ct.length>0:!0)),ue=(Rt,Ct,bt,kt,mn,Tn,Or)=>{var Cn,gn,rn,Mt,Pt;let Ut="";const ln=!!Rt?.find(Lr=>{var $r,d0;return Lr.url===A.gD&&((d0=($r=Lr.valueCodeableConcept)==null?void 0:$r.coding)==null?void 0:d0.some(Lo=>Lo.system===A.n4&&Lo.code===A.GI))}),Jt=mn?.[0],Sn={choice:((Cn=Jt?.valueCoding)==null?void 0:Cn.code)||(Jt?.valueString&&Tn?.some(Lr=>Lr.valueString===Jt.valueString)?Jt.valueString:null),"open-choice":((gn=Jt?.valueCoding)==null?void 0:gn.code)||Jt?.valueString,boolean:Jt?.valueBoolean,string:Jt?.valueString,text:Jt?.valueString,url:Jt?.valueUri,integer:Jt?.valueInteger,decimal:Jt?.valueDecimal,dateTime:Jt?.valueDateTime,date:Jt?.valueDate,time:Jt?.valueTime,quantity:(rn=Jt?.valueQuantity)==null?void 0:rn.value,reference:(Mt=Jt?.valueReference)==null?void 0:Mt.display,attachment:(Pt=Jt?.valueAttachment)==null?void 0:Pt.title};if(!(Ct in Sn))return"";const jn=Sn[Ct],Hr={required:()=>bt&&(jn==null||jn===""||jn==="NaN"||Number.isNaN(jn)||Ct==="boolean"&&jn!==!0&&ln)?x(Or,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>kt&&jn!==null&&jn!==void 0&&jn.toString().length>kt?x(Or,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:kt}):"",minLength:()=>{const Lr=I("minLength",Rt);return Lr&&jn!==null&&jn!==void 0&&jn.toString().length<Number(Lr)?x(Or,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:Lr}):""},urlRegex:()=>{const Lr=new RegExp(A.rx),$r=I("regexError",Rt),d0=$r??x(Or,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return Lr&&Ct==="url"&&jn&&!Lr.test(jn)?String(d0):""},regex:()=>{const Lr=I("regex",Rt);if(!Lr||typeof jn!="string")return"";const $r=new RegExp(Lr),d0=I("regexError",Rt),Lo=d0??x(Or,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return $r&&jn&&!$r.test(jn)?String(Lo):""},dateTime:()=>{if(Ct==="dateTime"&&jn){const Lr=jn?.toString(),$r=new Date(Lr);return isNaN($r.getTime())?x(Or,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(Ct!=="date"||!jn)return"";const Lr=jn.replace(/\D/g,"");return Lr.length>0&&Lr.length<8||isNaN(new Date(jn).getTime())?x(Or,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var Lr;if(Ct==="date"){const d0=U(A.dU,Rt),Lo=K(d0??"01/01/1900","01/01/1900"),N0=K(jn,"");if(!Lo||!N0)return"";if((0,s.A)(N0,Lo)){const Q0=(Lr=Rt?.find(q0=>q0.url===A.Ck))==null?void 0:Lr.valueString;return Q0??x(Or,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:d0??"01/01/1900"})}return""}const $r=I("minValue",Rt);return $r!=null&&jn!==null&&jn!==void 0&&jn<$r?x(Or,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:$r}):""},maxValue:()=>{var Lr;if(Ct==="date"){const d0=U(A.bK,Rt),Lo=K(d0??"01/01/2100","01/01/2100"),N0=K(jn,"");if(!Lo||!N0)return"";if((0,o.A)(N0,Lo)){const Q0=(Lr=Rt?.find(q0=>q0.url===A.Cx))==null?void 0:Lr.valueString;return Q0??x(Or,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:d0??"01/01/2100"})}return""}const $r=I("maxValue",Rt);return $r!=null&&jn!==null&&jn!==void 0&&jn>$r?x(Or,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:$r}):""}};return Ut=Hr.required()||Hr.maxLength()||Hr.minLength()||Hr.urlRegex()||Hr.regex()||Hr.dateTime()||Hr.date()||Hr.minValue()||Hr.maxValue()||"",Ut},re=(Rt,Ct)=>{for(const bt of Ct)if(bt.item){if(bt.item.find(Tn=>Tn.linkId===Rt.linkId))return bt;const mn=re(Rt,bt.item);if(mn)return mn}return null},J=(Rt,Ct)=>{if(Rt.answer&&Rt.answer.length>1)return!0;if(Rt.item){const bt=Rt.item.find(kt=>kt.linkId===Ct.linkId);if(bt&&bt.answer&&bt.answer.length>1)return!0}return!1},ve=(Rt,Ct,bt,kt,mn)=>{var Tn,Or;const{required:Cn}=Rt,gn=(Tn=kt.item)==null?void 0:Tn.find(Pt=>Pt.linkId===Rt.linkId),rn=gn?.answer||[],Mt=((Or=kt.answer)==null?void 0:Or.length)||1;for(let Pt=0;Pt<Mt;Pt++){const Ut=rn[Pt];if(Cn){if(!Ut||!ce(Ut))return x(mn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:x(mn,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Rt.text||Rt.linkId})});const ln=ue(Rt.extension,Rt.type,!0,Rt.maxLength,[Ut],Rt.answerOption,mn);if(ln)return x(mn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:ln})}else if(Ut&&ce(Ut)){const ln=ue(Rt.extension,Rt.type,!1,Rt.maxLength,[Ut],Rt.answerOption,mn);if(ln)return x(mn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:ln})}}return""},Ee=(Rt,Ct)=>{for(const bt of Rt){if(bt?.linkId===Ct)return bt;if(bt?.item&&bt.item.length>0){const kt=Ee(bt.item,Ct);if(kt)return kt}}},De=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>{var kt,mn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)==null?void 0:mn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===FOOTER_CODE))}))},ze=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>bt.url===A.oA&&bt.valueBoolean))},Ie=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>{var kt,mn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)==null?void 0:mn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===HEADER_CODE))}))},xe=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>{var kt,mn;return bt.url===A.gD&&((mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)==null?void 0:mn.some(Tn=>Tn.system===A.n4&&Tn.code===A._l))}))},$e=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>bt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&bt.valueBoolean))},it=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>{var kt,mn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)==null?void 0:mn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===CHECKBOX_CODE))}))},mt=Rt=>{var Ct;const bt=(Ct=Rt.extension)==null?void 0:Ct.find(kt=>kt.url===A.fe);return bt?.valueInteger},Lt=Rt=>{var Ct;const bt=(Ct=Rt.extension)==null?void 0:Ct.find(kt=>kt.url===A.zO);return bt?.valueInteger},$t=Rt=>{var Ct;const bt=(Ct=Rt?.extension)==null?void 0:Ct.find(kt=>kt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return bt?.valueInteger},Kt=(Rt,Ct,bt,kt,mn,Tn)=>{const Or=gn=>Ct.filter(rn=>rn.linkId===gn),Cn=new Set;return Rt.map(gn=>{if(Cn.has(gn.linkId)||De(gn))return null;const Mt=Or(gn.linkId),Pt=gn.type==="group"&&gn.repeats;if(Cn.add(gn.linkId),Pt){const Ut=[];if(Mt.forEach((ln,Jt)=>{const Sn={linkId:gn.linkId,text:gn.text};let jn;if(bt===gn.linkId&&typeof Tn=="number"&&Tn===Jt&&mn&&mn.length>0){const Hr=ln?.item||[];jn=[...Hr],mn.forEach(Lr=>{const $r=jn.findIndex(d0=>d0.linkId===Lr.linkId);$r>=0?jn[$r]=M(b({},Hr[$r]),{answer:Lr.answer}):jn.push(Lr)})}else gn.item&&(jn=Kt(gn.item,ln?.item||[],bt,kt,mn,Jt));bt===gn.linkId&&typeof Tn=="number"&&Tn===Jt&&kt?Sn.answer=kt:Sn.answer=ln.answer||[{}],jn&&jn.length>0?Sn.item=jn:ln.item&&(Sn.item=ln.item),Ut.push(Sn)}),bt===gn.linkId&&typeof Tn=="number"&&Tn>=Mt.length)for(let ln=Mt.length;ln<=Tn;ln++){const Jt={linkId:gn.linkId,text:gn.text,answer:ln===Tn&&kt?kt:[{}]};ln===Tn&&mn&&mn.length>0?Jt.item=mn:gn.item&&(Jt.item=Kt(gn.item,[],void 0,void 0,void 0,void 0)),Ut.push(Jt)}return Ut}else if(gn.repeats&&typeof Tn=="number"&&bt===gn.linkId){const Ut=Mt[0]||{linkId:gn.linkId,text:gn.text,answer:[]},ln={linkId:gn.linkId,text:gn.text,answer:[...Ut.answer||[]]};if(kt&&kt.length>0){for(;ln.answer.length<=Tn;)ln.answer.push({});ln.answer[Tn]=kt[0]}return ln}else{const Ut=Mt[0],ln=gn.item?Kt(gn.item,Ut?.item||[],bt,kt,mn,Tn):void 0,Jt=ln&&ln.length>0,Sn={linkId:gn.linkId,text:gn.text};return bt&&gn.linkId===bt&&typeof Tn!="number"?(kt||!kt&&!mn?Sn.answer=kt:Ut?.answer&&(Sn.answer=Ut.answer),mn?Sn.item=mn:Jt&&(Sn.item=ln)):(Ut?.answer?Sn.answer=Ut.answer:Sn.answer=[{}],Jt&&(Sn.item=ln)),Sn}}).filter(Boolean).flat()},Et=(Rt,Ct)=>{for(const bt of Rt)if(bt.linkId===Ct||bt.item&&Et(bt.item,Ct))return bt.linkId;return null},Xe=(Rt,Ct,bt,kt)=>{var mn;const Tn=(mn=Rt?.item)!=null?mn:kt;return!Tn||Tn.length===0?!0:Tn.every(Or=>{var Cn;const gn=se(Ct,Or.linkId);if(gn.length===0){const rn=(Cn=G(Ct,Or.linkId))==null?void 0:Cn.answer;if(ae(Or,Ct,rn)&&be(Or.enableWhen,Or.enableBehavior,Ct)&&bt.includes(Or.linkId))return!1}else for(const rn of gn)if(ae(Or,Ct,rn.answer)&&be(Or.enableWhen,Or.enableBehavior,Ct)&&bt.includes(Or.linkId))return!1;return Or.item?Xe(Or,Ct,bt):!0})},We=(Rt,Ct,bt=!0)=>{for(const kt of Rt)if(kt.linkId===Ct&&kt.answer&&kt.answer.length>0||kt.item&&kt.item.length>0&&We(kt.item,Ct,bt))return!0;return!1},Ot=(Rt,Ct,bt=0)=>{const kt=Rt.filter(mn=>mn.linkId===Ct);if(kt.length>bt){const mn=kt[bt];if(mn.answer&&mn.answer.length>0)return mn.answer.some(Tn=>Tn&&Object.keys(Tn).length>0&&Object.values(Tn).some(Or=>Or!=null&&Or!==""));if(mn.item&&mn.item.length>0)return We(mn.item,Ct,!1)}return We(Rt,Ct,!1)},Qe=(Rt,Ct)=>{if(!Rt||!Rt.item)return!1;const bt=kt=>{var mn;if(ze(kt)&&kt.required&&be(kt.enableWhen,kt.enableBehavior,Ct)){const Tn=G(Ct,kt.linkId),Or=ue(kt.extension,kt.type,kt.required,kt.maxLength,Tn?.answer,kt.answerOption);if(!((mn=Tn?.answer)!=null&&mn.length)||Or)return!0}if(kt.item){for(const Tn of kt.item)if(bt(Tn))return!0}return!1};for(const kt of Rt.item)if(bt(kt))return!0;return!1},Ye=Rt=>{var Ct,bt,kt;if(Rt.valueString!==void 0)return Rt.valueString;if(Rt.valueBoolean!==void 0)return Rt.valueBoolean;if(Rt.valueInteger!==void 0)return Rt.valueInteger;if(Rt.valueDecimal!==void 0)return Rt.valueDecimal;if(Rt.valueDate!==void 0)return Rt.valueDate;if(Rt.valueDateTime!==void 0)return Rt.valueDateTime;if(((Ct=Rt.valueCoding)==null?void 0:Ct.code)!==void 0)return Rt.valueCoding.code;if(((bt=Rt.valueReference)==null?void 0:bt.reference)!==void 0)return Rt.valueReference.reference;if(((kt=Rt.valueQuantity)==null?void 0:kt.value)!==void 0)return Rt.valueQuantity.value;if(Rt.valueAttachment!==void 0)return Rt.valueAttachment},Dt=Rt=>{const Ct={linkId:Rt.linkId};if(Rt.answer&&Rt.answer.length>0){const bt=Rt.answer.map(kt=>Ye(kt)).filter(kt=>kt!==void 0);bt.length>0&&(Ct.answer=bt)}if(Rt.item&&Rt.item.length>0){const bt=Rt.item.map(kt=>Dt(kt)).filter(kt=>{const mn=Object.keys(kt);return mn.length>1||mn.length===1&&mn[0]!=="linkId"});bt.length>0&&(Ct.item=bt)}return Ct},pn=(Rt,Ct,bt,kt,mn,Tn)=>{var Or;const Cn=(Or=Ct?.item)==null?void 0:Or[bt[kt]],gn=Cn?.linkId;if(!gn)return!1;const rn=se(Rt,gn),Mt=se(mn,gn),Pt=Ut=>{if(Ut!=null){if(Array.isArray(Ut)){const ln=Ut.filter(Jt=>Jt!=null).map(Jt=>Pt(Jt)).filter(Jt=>Jt!==void 0);return ln.length===0||ln.length===1&&typeof ln[0]=="object"&&Object.keys(ln[0]).length===0?void 0:ln}if(typeof Ut=="object"){const ln={};for(const[Jt,Sn]of Object.entries(Ut))if(Sn!=null){const jn=Pt(Sn);jn!==void 0&&(ln[Jt]=jn)}return Object.keys(ln).length===0?void 0:ln}return Ut}};if(rn.length!==Mt.length)return!1;for(let Ut=0;Ut<rn.length;Ut++){const ln=rn[Ut],Jt=Mt[Ut];if(!ln||!Jt)return!1;const Sn=Dt(Pt(ln)),jn=Dt(Pt(Jt));if(!_.isEqual(Sn,jn))return!1}return kt!==Tn},zn=(Rt,Ct,bt,kt)=>bt&&bt.length>0&&!(bt.length===1&&Object.keys(bt[0]).length===0)&&ae(Rt,Ct,bt,kt)||null,et=(Rt,Ct,bt)=>{const kt={},mn=Tn=>{Tn.forEach(Or=>{const Cn=se(Ct,Or.linkId);if(ye(Or,Rt)||Or.repeats)for(let gn=0;gn<Cn.length;gn++){const rn=Cn[gn];if(rn?.answer&&rn.answer.length>0){const Mt=zn(Or,Ct,rn.answer,bt);Mt&&(kt[Or.linkId]=M(b({},kt[Or.linkId]),{[gn]:Mt}))}}else{const gn=G(Ct,Or.linkId);if(gn?.answer&&gn.answer.length>0){const rn=zn(Or,Ct,gn.answer,bt);rn&&(kt[Or.linkId]={0:rn})}}Or.item&&Or.item.length>0&&mn(Or.item)})};return mn(Rt),kt},xt=Rt=>{if(!Rt)return"";const Ct=Rt.split("-");if(Ct.length===3){const[bt,kt,mn]=Ct;return`${bt.slice(-4)}-${kt}-${mn}`}return""},Xt=Rt=>Rt.trim().replace(/[A-Za-z]+/g,""),Wn=(Rt,Ct)=>{const bt=(kt,mn)=>{for(const Tn of kt){if(Tn.linkId===mn)return Tn.answer;if(Tn.item&&Tn.item.length>0){const Or=bt(Tn.item,mn);if(Or!==void 0)return Or}}};return bt(Rt,Ct)},zr=(Rt,Ct)=>{if(!Ct||Ct.length===0)return null;const bt=Rt.linkId,kt=(mn,Tn,Or=[])=>{for(const Cn of mn){const gn=[...Or,Cn];if(Cn.item){if(Cn.item.some(Pt=>Pt.linkId===Tn))return gn.some(Pt=>Pt.repeats===!0)?Cn:null;if(kt(Cn.item,Tn,gn))return Cn}}return null};return kt(Ct,bt)},hn=(Rt,Ct)=>{if(!Ct||Ct.length===0)return!1;const bt=Rt.linkId,kt=(mn,Tn,Or=[])=>{for(const Cn of mn){const gn=[...Or,Cn];if(Cn.item){if(Cn.item.some(Pt=>Pt.linkId===Tn))return gn.some(Pt=>{const Ut=z(Pt.extension||[]);return!!Ut&&Ut!==UI_TOOLKIT_FORM_CONTAINER});if(kt(Cn.item,Tn,gn))return!0}}return!1};return kt(Ct,bt)},Ln=(Rt,Ct,bt)=>{const kt={};if(!Rt)return kt;const{linkId:mn}=Ct;if(Rt[mn]){const Tn=Rt[mn];kt[mn]=Tn[bt]||""}return Ct.item&&Ct.item.length>0&&Ct.item.forEach(Tn=>{if(Rt[Tn.linkId]){const Or=Rt[Tn.linkId];kt[Tn.linkId]=Or[bt]||""}}),kt},mr=(Rt,Ct)=>{const bt={};if(!Rt||!Rt[Ct])return bt;const kt=Rt[Ct];return bt[Ct]=kt[0]||"",bt},wn=Rt=>{const Ct=Rt.findIndex(Tn=>!ze(Tn)),bt=Ct>=0?[Ct]:[],kt=new Map;let mn=null;if(Rt.forEach((Tn,Or)=>{const Cn=xe(Tn);if(Cn&&Tn.type==="group")Or!==Ct&&bt.push(Or),kt.set(Or,[Or]),mn=Or;else if(mn!==null&&!Cn){const gn=kt.get(mn)||[];kt.set(mn,[...gn,Or])}}),Rt.length>0&&bt.length>0){const Tn=bt[0];if(!kt.has(Tn)){const Or=bt.find(gn=>gn>Tn),Cn=[];for(let gn=Tn;gn<(Or??Rt.length);gn++)Cn.push(gn);kt.set(Tn,Cn)}}return{groupIndices:bt,itemsToRenderMap:kt}},Zr=(Rt,Ct,bt,kt)=>{let mn=[...kt];const Tn=(Or,Cn)=>{Or.forEach(gn=>{if((!gn?.enableWhen||be(gn?.enableWhen,gn.enableBehavior,Cn))&&gn.initial&&!We(Cn,gn.linkId))if(gn.repeats){const rn=Cn.filter(Mt=>Mt.linkId===gn.linkId);rn.length>0?rn.forEach((Mt,Pt)=>{Ot(Cn,gn.linkId,Pt)||(mn=Kt(bt,mn,gn.linkId,gn.initial,void 0,Pt))}):mn=Kt(bt,mn,gn.linkId,gn.initial)}else mn=Kt(bt,mn,gn.linkId,gn.initial);gn.item&&Tn(gn.item,Cn)})};return Tn(Rt,Ct),mn},n0=(Rt,Ct,bt)=>{if(!Rt)return[];const kt=[],mn=Tn=>{Tn.required===Ct&&be(Tn.enableWhen,Tn.enableBehavior,bt)&&!ze(Tn)&&Tn.type!=="display"&&kt.push(Tn),Tn.item&&Tn.item.length>0&&Tn.item.forEach(mn)};return Rt.forEach(mn),kt},It=(Rt,Ct)=>Rt.every(bt=>{var kt;const mn=se(Ct,bt.linkId);if(mn.length>0)return mn.every(Tn=>!ae(bt,Ct,Tn.answer));{const Tn=(kt=G(Ct,bt.linkId))==null?void 0:kt.answer;return!ae(bt,Ct,Tn)}}),Fe=(Rt,Ct)=>{let bt=-1;for(let kt=Rt.length-1;kt>=0;kt--)if(Rt[kt].linkId===Ct){bt=kt;break}return bt},ot=(Rt,Ct)=>Rt.filter(bt=>bt.linkId!==Ct).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:ot(bt.item,Ct)}):bt),Je=(Rt,Ct,bt=Rt)=>Rt.reduce((kt,mn)=>{const Tn=Ee(Ct,mn.linkId);return Tn?.enableWhen&&!be(Tn.enableWhen,Tn.enableBehavior,bt)||(mn.item&&mn.item.length>0?kt.push(M(b({},mn),{item:Je(mn.item,Ct,bt)})):kt.push(mn)),kt},[]),tt=(Rt,Ct,bt=[])=>{const kt=[],mn=Tn=>{Tn.forEach(Or=>{kt.push(Or.linkId),Or.item&&Or.item.length>0&&mn(Or.item)})};for(let Tn=0;Tn<Rt.length;Tn++){const Or=Rt[Tn];if(Or.linkId===Ct){const Cn=Rt.slice(0,Tn+1),gn=Rt.slice(Tn+1),{kept:rn,removed:Mt}=gn.reduce((Pt,Ut)=>{const ln=Ee(bt,Ut.linkId);return!ln||ze(ln)&&be(ln.enableWhen,ln.enableBehavior,Cn)?Pt.kept.push(Ut):Pt.removed.push(Ut),Pt},{kept:[],removed:[]});return mn(Mt),{trimmedData:[...Cn,...rn],trimmedLinkIds:kt,found:!0}}if(Or.item&&Or.item.length>0){const Cn=tt(Or.item,Ct,bt);if(Cn.found){const gn=Rt.slice(0,Tn),rn=Rt.slice(Tn+1),Mt=[...gn,M(b({},Or),{item:Cn.trimmedData})],{kept:Pt,removed:Ut}=rn.reduce((ln,Jt)=>{const Sn=Ee(bt,Jt.linkId);return!Sn||ze(Sn)&&be(Sn.enableWhen,Sn.enableBehavior,Mt)?ln.kept.push(Jt):ln.removed.push(Jt),ln},{kept:[],removed:[]});return mn(Ut),{trimmedData:[...Mt,...Pt],trimmedLinkIds:[...Cn.trimmedLinkIds,...kt],found:!0}}}}return{trimmedData:Rt,trimmedLinkIds:[],found:!1}},rt=(Rt,Ct)=>Rt.filter(bt=>!Ct.includes(bt.linkId)).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:rt(bt.item,Ct)}):bt),lt=Rt=>{var Ct;if(!Rt)return"empty";const bt=A.Z$.find(({patterns:kt})=>kt.some(mn=>Rt.includes(mn)));return(Ct=bt?.type)!=null?Ct:"empty"},St=(Rt,Ct)=>{const{groupIndices:bt}=wn(Rt),kt=Rt.findIndex(mn=>mn.linkId===Ct);return kt!==-1?bt.indexOf(kt):-1},st=Rt=>{if(!Rt)return{restriction:null,warning:null};const Ct=bt=>{const kt=Rt.find(Tn=>Tn.url===bt&&Tn.valueString);if(!kt?.valueString)return null;const mn=kt.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:$t,elementNameSuffix:Kt,version:Et,prefetchFeatureApp:Xe})=>(0,h.__awaiter)(void 0,void 0,void 0,function*(){var We,Ot,Qe,Ye,Dt,pn,zn,et,xt,Xt,Wn,zr,hn,Ln,mr;window.bwell||(window.bwell=new re({metadata:{version:Et}}));const wn=`bwell-${Kt}`;if(customElements.get(wn)!==void 0)return;class Zr extends f{constructor(){super(),We.add(this),Ot.set(this,(0,S.nanoid)()),Qe.set(this,void 0),Ye.set(this,document.createElement("feature-app-loader")),Dt.set(this,new I.EventEmitter),pn.set(this,void 0),zn.set(this,void 0),et.set(this,void 0),xt.set(this,void 0),Xt.set(this,void 0),Wn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:Fe,container:ot,name:Je})=>{Je==="error"&&Fe==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,h.__classPrivateFieldGet)(this,Ye,"f").style.display=Fe==="hidden"?"unset":"hidden"}),(0,h.__classPrivateFieldSet)(this,Wn,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,h.__classPrivateFieldGet)(this,Dt,"f")},"f"),(0,h.__classPrivateFieldSet)(this,pn,(0,h.__classPrivateFieldGet)(this,We,"m",zr).bind(this),"f"),(0,h.__classPrivateFieldSet)(this,zn,(0,h.__classPrivateFieldGet)(this,We,"m",hn).bind(this),"f"),(0,h.__classPrivateFieldSet)(this,et,(0,h.__classPrivateFieldGet)(this,We,"m",mr).call(this,"error"),"f"),(0,h.__classPrivateFieldSet)(this,xt,(0,h.__classPrivateFieldGet)(this,We,"m",mr).call(this,"loading"),"f")}connectedCallback(){return(0,h.__awaiter)(this,void 0,void 0,function*(){(0,h.__classPrivateFieldGet)(this,et,"f").call(this,(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.get("error")),(0,h.__classPrivateFieldGet)(this,xt,"f").call(this,(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.get("loading")),(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.addEventListener("visibilitychange",(0,h.__classPrivateFieldGet)(this,zn,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.addChangeListener("error",(0,h.__classPrivateFieldGet)(this,et,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.addChangeListener("loading",(0,h.__classPrivateFieldGet)(this,xt,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}(0,h.__classPrivateFieldSet)(this,Ot,this.id||(0,h.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,h.__classPrivateFieldSet)(this,Qe,new T((0,h.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,h.__classPrivateFieldGet)(this,Qe,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,h.__classPrivateFieldGet)(this,pn,"f").call(this):(window.bwell.once("initialized",(0,h.__classPrivateFieldGet)(this,pn,"f")),window.bwell.once("error",()=>{(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}),Xe&&(0,p.h)($t).catch(()=>{(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,h.__classPrivateFieldGet)(this,Dt,"f").emit("disconnect"),(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.removeEventListener("visibilitychange",(0,h.__classPrivateFieldGet)(this,zn,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.removeChangeListener("error",(0,h.__classPrivateFieldGet)(this,et,"f")),(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.removeChangeListener("loading",(0,h.__classPrivateFieldGet)(this,xt,"f")),(It=(0,h.__classPrivateFieldGet)(this,Qe,"f"))===null||It===void 0||It.deregister(),(0,h.__classPrivateFieldGet)(this,Dt,"f").removeAllListeners()}}Ot=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Dt=new WeakMap,pn=new WeakMap,zn=new WeakMap,et=new WeakMap,xt=new WeakMap,Xt=new WeakMap,Wn=new WeakMap,We=new WeakSet,zr=function(){(0,h.__classPrivateFieldGet)(this,Ye,"f").setAttribute("featureAppId",`bwell-embeddable:${wn}`),(0,h.__classPrivateFieldGet)(this,Ye,"f").setAttribute("src",$t),(0,h.__classPrivateFieldGet)(this,Ye,"f").config={id:(0,h.__classPrivateFieldGet)(this,Ot,"f"),name:Kt,elementName:wn,utils:(0,h.__classPrivateFieldGet)(this,Wn,"f")},this.shadowRoot.appendChild((0,h.__classPrivateFieldGet)(this,Ye,"f"))},hn=function({visibility:It,name:Fe}){(0,h.__classPrivateFieldGet)(this,Ye,"f").style.display=It==="hidden"?"unset":"hidden"},Ln=function(It){(0,h.__classPrivateFieldGet)(this,Xt,"f")(),(0,h.__classPrivateFieldSet)(this,Xt,void 0,"f")},mr=function(It){return Fe=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.get(tt)!==null)){if(Fe!==null)(0,h.__classPrivateFieldGet)(this,Xt,"f")&&(0,h.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It),(0,h.__classPrivateFieldSet)(this,Xt,(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[It]),"f");else if(Fe===null&&(0,h.__classPrivateFieldGet)(this,Xt,"f")){(0,h.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It);const tt=Ie.find(rt=>(0,h.__classPrivateFieldGet)(this,Wn,"f").attributes.get(rt)!==null);tt&&(0,h.__classPrivateFieldSet)(this,Xt,(0,h.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(wn,Zr)}),it={rE:"1.1139.0"},mt="composite";var Lt=e(67321);$e({src:`https://embeddables.prod.icanbwell.com/${mt}/${it.rE}/scripts/embeddable.federated.js`,elementNameSuffix:mt,version:it.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,g=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,A=(h,p,f)=>p in h?i(h,p,{enumerable:!0,configurable:!0,writable:!0,value:f}):h[p]=f,m=(h,p)=>{for(var f in p||(p={}))u.call(p,f)&&A(h,f,p[f]);if(c)for(var f of c(p))E.call(p,f)&&A(h,f,p[f]);return h},d=(h,p)=>a(h,g(p));const O=(h,p,f)=>{const b=_.cloneDeep(h);if(!b.contained||p<0)return b;const M=b.contained.findIndex(x=>x.resourceType==="Questionnaire");if(M!==-1&&!f){const x=b.contained[M];if(x.item){if(!x.item.some(C=>isPageExtensionPresent(C)))return b;let T=0,S=x.item.length;for(let C=0;C<x.item.length;C++){const y=x.item[C];if(isPageExtensionPresent(y)){if(T===p+1){S=C;break}T++}}x.item=x.item.slice(0,S),b.contained[M]=x}}else f&&M!==-1&&(b.contained[M]=d(m({},b.contained[M]),{item:f}));return b},v=({formId:h,questionnaireResponse:p,showQuestionPrefix:f,nextQuestion:b,onGoBack:M,handleHiddenQuestion:x,errorConfig:z,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:y,onFormDataChange:R,externalComponentRenderMap:P,className:L,children:D})=>{var w,N,V;const{currentGroupIndex:q,hasCustomError:I}=useFHIRQuestionnaire(),k=(w=p.questionnaire)==null?void 0:w.replace("#",""),U=(N=p?.contained)==null?void 0:N.find(K=>K.id===k&&K.resourceType==="Questionnaire"),F=(K,G,se)=>{let oe=_.cloneDeep(p);oe.item=K,oe=trimQuestionnaireItems(oe,q,se),b(oe,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,L),children:jsx(FHIRQuestionnaire,{formId:h,onFormDataChange:R,questionnaireResponseItem:(V=p?.item)!=null?V:[],questionnaireSchema:U,status:p.status,showQuestionPrefix:f,errorConfig:z,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:T,handleHiddenQuestion:x,showStepper:C,hideBackButton:y,externalComponentRenderMap:P,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,E=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},h=(M,x)=>u(M,E(x)),p=(M,x,z)=>new Promise((T,S)=>{var C=P=>{try{R(z.next(P))}catch(L){S(L)}},y=P=>{try{R(z.throw(P))}catch(L){S(L)}},R=P=>P.done?T(P.value):Promise.resolve(P.value).then(C,y);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:y,errorText:R})=>{const P=(0,a.Ul)(),{i18n:{t:L},loading:D}=(0,g.E_)({keys:["shared-translations"]}),w=x?.placeId,N=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,oe]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Kt=>{var Et,Xe;const We=(Xe=(Et=Kt.placeAutocomplete)==null?void 0:Et.predictions)==null?void 0:Xe.map(Ot=>{var Qe;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Qe=Ot.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Kt=>h(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,be]),ze=Kt=>p(void 0,null,function*(){var Et,Xe,We,Ot,Qe,Ye,Dt,pn,zn,et,xt,Xt,Wn,zr,hn,Ln;if(F(Kt),G(Kt),oe(!1),Kt&&typeof Kt=="string"){const mr=be.find(tt=>tt.id===Kt),wn=mr?.label||V;if(!mr)return;q(wn),k(wn),setTimeout(()=>{const tt=[{id:mr.id,label:mr.label}];Se(tt),ne(tt)},f);const Zr=yield ae({variables:{placeId:Kt}}),n0=(Xe=(Et=Zr?.data)==null?void 0:Et.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(We=Zr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,Fe=((Ye=(Qe=Zr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((pn=(Dt=Zr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:pn.state)||"",Je=((et=(zn=Zr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(n0&&It)if(!Fe||!Je){const tt=yield ce({variables:{latitude:String(n0),longitude:String(It)}}),rt=((Xt=(xt=tt?.data)==null?void 0:xt.geocodingByLatLon)==null?void 0:Xt.zipCode)||"",lt=((zr=(Wn=tt?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:zr.state)||"",St=((Ln=(hn=tt?.data)==null?void 0:hn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:n0,longitude:It,zipCode:rt,state:lt,stateCode:St,placeId:Kt,description:wn,value:Kt})}else T({latitude:n0,longitude:It,zipCode:Fe,state:ot,stateCode:Je,placeId:Kt,description:wn,value:Kt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>p(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),$e=Kt=>p(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 Et=Kt.trim();Et.length>=2?yield xe(Et):Se(pe)}),it=Kt=>{te.current=Kt},mt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>p(void 0,null,function*(){var Et,Xe,We,Ot,Qe,Ye,Dt,pn,zn,et,xt,Xt,Wn,zr,hn,Ln;if(w&&N){Se([{id:w,label:V||N}]),ne([{id:w,label:V||N}]),F(w),G(w),q(N),k(N),N===V&&q(N);const mr=yield ae({variables:{placeId:w}}),wn=(Xe=(Et=mr?.data)==null?void 0:Et.geocodingByPlaceId)==null?void 0:Xe.latitude,Zr=(Ot=(We=mr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,n0=((Ye=(Qe=mr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",It=((pn=(Dt=mr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:pn.state)||"",Fe=((et=(zn=mr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(wn&&Zr)if(!n0||!It||!Fe){const ot=yield ce({variables:{latitude:String(wn),longitude:String(Zr)}}),Je=((Xt=(xt=ot?.data)==null?void 0:xt.geocodingByLatLon)==null?void 0:Xt.zipCode)||"",tt=((zr=(Wn=ot?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:zr.state)||"",rt=((Ln=(hn=ot?.data)==null?void 0:hn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:wn,longitude:Zr,zipCode:Je,state:tt,stateCode:rt,placeId:w,description:N,value:w})}else T({latitude:wn,longitude:Zr,zipCode:n0,state:It,stateCode:Fe,placeId:w,description:N,value:w})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const Lt=se||!!he||!!re||!!Ee||!!R,$t=Lt?R||L("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{y&&y(me||ue||D)},[y,me,ue,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:L("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:$e,defaultFilter:Ie,onOpenChange:it,onBlur:mt,isInvalid:Lt,hint:$t,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Et=Kt,Xe=V.trim().length>=2,We=Et.mainText||"",Ot=Et.secondaryText||"",Qe=We.trim().length>0,Ye=Ot.trim().length>0,Dt=Qe?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},pn=Ye?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Et.id,supportingText:Et.supportingText,isDisabled:Et.isDisabled,icon:Et.icon,avatarUrl:Et.avatarUrl,textValue:Et.label,children:Xe&&Qe?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Dt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Dt.highlightedPart}),(0,n.jsx)("span",{children:Dt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:pn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:pn.highlightedPart}),(0,n.jsx)("span",{children:pn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Et.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:i})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(52449);const i=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:E}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),h=c.getRouteMeta(v)||{},p=getBreadcrumbTitleKey(v,h,u);if(!p||h.breadcrumbHide)return[];const f=E[v];let b=c.getHref(v),M=p;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(y,R)=>new Promise((P,L)=>setTimeout(()=>L(new Error(R)),y)),u=(y,R,P)=>Promise.race([y,c(R,P)]),E=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(y,R,P)=>R in y?m(y,R,{enumerable:!0,configurable:!0,writable:!0,value:P}):y[R]=P,b=(y,R)=>{for(var P in R||(R={}))h.call(R,P)&&f(y,P,R[P]);if(v)for(var P of v(R))p.call(R,P)&&f(y,P,R[P]);return y},M=(y,R)=>d(y,O(R)),x=(y,R,P)=>new Promise((L,D)=>{var w=q=>{try{V(P.next(q))}catch(I){D(I)}},N=q=>{try{V(P.throw(q))}catch(I){D(I)}},V=q=>q.done?L(q.value):Promise.resolve(q.value).then(w,N);V((P=P.apply(y,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),C=({children:y})=>{var R;const{mobileOS:P}=(0,r.useDeviceDetection)(),L=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:w,setQueryParams:N}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(w);(0,t.useEffect)(()=>{q.current=w},[w]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=w.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{N(M(b({},q.current),{locationPermission:ve||i.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?L?.error(Ee,"Failed to update query params"):L?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[N,L]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking geolocation availability"):L?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,L]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,E,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&L?.error(De,"Geolocation timeout or error"),De}}),[D,L]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),E,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return L?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==i.Ef.GRANTED&&Ee!==i.Ef.PROMPT?(L?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location services"):L?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,L,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=w.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!0)):te(Ie)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error getting initial location with granted permission"):L?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?L?.error(Ie,"Error getting initial location"):L?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?L?.error(De,"Error initializing location permission"):L?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(P==="Android"&&Ee===i.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?L?.error(De,"Error re-requesting Android permission"):L?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.Ef.UNAVAILABLE),ve instanceof Error?L?.error(ve,"Error refreshing location"):L?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,L,P,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location permission"):L?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,L,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?L?.error(ve,"Error checking and setting location permission"):L?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,L,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||L?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||L?.error(`Error requesting location - ${Ee}`)}te(i.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,L,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),N(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?L?.error(ve,"Error requesting current location"):L?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,L,N,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&N(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?L?.error(ve,"Error overriding search settings"):L?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[L,U,ae,N]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),y]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},1053:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>lt,GI:()=>be,rz:()=>et,Fp:()=>zn,el:()=>pn,ao:()=>Dt,oA:()=>D,Yt:()=>St,g4:()=>Ye,tn:()=>Ue,n4:()=>w,gD:()=>L,Vp:()=>tt,Cx:()=>k,bK:()=>q,gi:()=>rt,Z$:()=>he,GT:()=>Je,hr:()=>ce,JL:()=>ue,Ck:()=>I,dU:()=>V,wG:()=>mr,hZ:()=>hn,$e:()=>xt,qT:()=>zr,GQ:()=>Wn,q3:()=>Ln,D_:()=>Xt,Uf:()=>F,_l:()=>ge,Md:()=>se,V7:()=>G,fe:()=>ae,JP:()=>At,Z_:()=>N,zO:()=>me,UZ:()=>te,$7:()=>Xe,rb:()=>K,_W:()=>Ot,WS:()=>We,VF:()=>Fe,vf:()=>Zr,PV:()=>ot,PS:()=>wn,Iz:()=>It,zD:()=>oe,m3:()=>Lt,XP:()=>$t,PM:()=>De,cX:()=>re,G6:()=>J,Us:()=>Ie,AA:()=>Ee,G0:()=>mt,mO:()=>$e,HH:()=>ze,PU:()=>ye,it:()=>Et,Tl:()=>it,uH:()=>Kt,c3:()=>ve,rx:()=>P});var n=e(36087),t=e(14041);const r=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),E=e(22716),A=e(9495);const m=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const h=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));h.displayName="CreditCard02";const p=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));p.displayName="Link03";var f=e(85418);const b=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},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:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M16 7c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.121-2.122C13.395 3 12.93 3 12 3c-.93 0-1.395 0-1.777.102a3 3 0 0 0-2.12 2.122C8 5.605 8 6.07 8 7M5.2 21h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 19.48 22 18.92 22 17.8v-7.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 7 19.92 7 18.8 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 21 4.08 21 5.2 21Z"}));z.displayName="Briefcase01";const T=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M12.913 17h7.174m-7.174 0L11 21m1.913-4 2.865-5.991c.231-.483.347-.724.505-.8a.5.5 0 0 1 .434 0c.158.076.274.317.505.8L20.087 17m0 0L22 21M2 5h6m0 0h3.5M8 5V3m3.5 2H14m-2.5 0c-.496 2.957-1.647 5.636-3.334 7.884M10 14a9.396 9.396 0 0 1-1.834-1.116m0 0C6.813 11.848 5.603 10.427 5 9m3.166 3.884A17.295 17.295 0 0 1 2 18"}));T.displayName="Translate01";const S=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M10 8.502a2.248 2.248 0 0 1 4.37.75c0 1.499-2.25 2.248-2.25 2.248m.03 3h.01M9.9 19.2l1.46 1.947c.217.29.326.434.459.486a.5.5 0 0 0 .362 0c.133-.052.242-.197.459-.486L14.1 19.2c.293-.39.44-.586.619-.735a2 2 0 0 1 .822-.412c.226-.053.47-.053.959-.053 1.398 0 2.097 0 2.648-.228a3 3 0 0 0 1.624-1.624C21 15.597 21 14.898 21 13.5V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v5.7c0 1.398 0 2.097.228 2.648a3 3 0 0 0 1.624 1.624C5.403 18 6.102 18 7.5 18c.489 0 .733 0 .96.053a2 2 0 0 1 .821.412c.18.149.326.344.619.735Z"}));S.displayName="AnnotationQuestion";const C=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M15 2.458A9.996 9.996 0 0 0 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.715-.432-3.33-1.193-4.74M17 5.75h.005M10.5 21.888v-2.203a.5.5 0 0 1 .12-.325l2.486-2.9a.5.5 0 0 0-.131-.76l-2.857-1.632a.499.499 0 0 1-.186-.187L8.07 10.62a.5.5 0 0 0-.478-.25l-5.528.492M21 6c0 2.21-2 4-4 6-2-2-4-3.79-4-6a4 4 0 0 1 8 0Zm-3.75-.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0Z"}));C.displayName="Globe05";const y=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));y.displayName="Shield01";const R=({size:jt=24,color:Qt="currentColor",...nn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:jt,height:jt,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...nn},t.createElement("path",{d:"M21 15v1.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V15m14-7-5-5m0 0L7 8m5-5v12"}));R.displayName="Upload01";const P=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,L="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",w="http://hl7.org/fhir/questionnaire-item-control",N="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",q="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",k="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",F="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",K="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",G="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",se="http://hl7.org/fhir/StructureDefinition/entryFormat",oe="http://hl7.org/fhir/StructureDefinition/tz-code",te="tz-code",pe="footer",be="check-box",Se="header",ge="page",ne="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ae="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",he=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],ce={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ue={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},re="ui-toolkit/CoordinatePicker",J="ui-toolkit/DetailsInfo",ve="ui-toolkit/ServiceChoice",Ee="ui-toolkit/InfoBanner",De="ui-toolkit/Button",ze="ui-toolkit/Phone",Ie="ui-toolkit/ErrorCard",xe="ui-toolkit/FormContainer",$e="ui-toolkit/PageHeader",it="ui-toolkit/SelectableOption",mt="ui-toolkit/Modal",Lt="ui-toolkit/Alert",$t="ui-toolkit/AppSectionAccess",Kt="ui-toolkit/SensitiveDataCategory",Et="ui-toolkit/QuestCard",Xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",We="http://icanbwell.com/fhir/StructureDefinition/text-align",Ot={LEFT:"left",CENTER:"center"},Qe={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Ye="http://icanbwell.com/fhir/StructureDefinition/icon-name",Dt="http://icanbwell.com/fhir/StructureDefinition/error-title",pn="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",zn="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",et="http://icanbwell.com/fhir/StructureDefinition/description",xt="http://icanbwell.com/fhir/StructureDefinition/modal-description",Xt="http://icanbwell.com/fhir/StructureDefinition/modal-title",Wn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",zr="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",hn="http://icanbwell.com/fhir/StructureDefinition/button-text",Ln="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",mr="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",wn="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Zr="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",n0="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",It="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Fe="http://icanbwell.com/fhir/StructureDefinition/trigger-color",ot="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Je="http://hl7.org/fhir/StructureDefinition/mimeType",tt="http://hl7.org/fhir/StructureDefinition/maxSize",rt="http://icanbwell.com/fhir/StructureDefinition/message-severity",lt="http://icanbwell.com/fhir/StructureDefinition/alert-color",St="http://icanbwell.com/fhir/StructureDefinition/hideLabel",st="http://icanbwell.com/fhir/StructureDefinition/placeholder",le="http://icanbwell.com/fhir/StructureDefinition/hint-text",ye="ui-toolkit/PrefilledMemberDemographicsAlert",Ue="http://hl7.org/fhir/issue-severity",Te="http://icanbwell.com/fhir/StructureDefinition/button-type",zt="http://icanbwell.com/fhir/StructureDefinition/button-action",Yt="button-type",vn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",$n="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ar="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Wt="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",we="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Ze={},At={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":E.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":h,"link-03":p,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x,"briefcase-01":z,"translate-01":T,"annotation-question":S,"globe-05":C,"shield-01":y,"upload-01":R}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>w,$O:()=>mt,CP:()=>Xt,Fy:()=>xt,GN:()=>be,J4:()=>lt,MU:()=>G,Nw:()=>ot,Qr:()=>C,Ue:()=>St,Yo:()=>Ee,a0:()=>T,cz:()=>y,di:()=>I,eC:()=>st,iI:()=>k,lv:()=>q,mR:()=>vn,nt:()=>S,od:()=>V,t7:()=>Lt,u0:()=>x,yQ:()=>Yt,zj:()=>ue});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),g=e(45250),c=e.n(g),u=e(16681),E=e(18807),A=e(1053),m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(Rt,Ct,bt)=>Ct in Rt?m(Rt,Ct,{enumerable:!0,configurable:!0,writable:!0,value:bt}):Rt[Ct]=bt,b=(Rt,Ct)=>{for(var bt in Ct||(Ct={}))h.call(Ct,bt)&&f(Rt,bt,Ct[bt]);if(v)for(var bt of v(Ct))p.call(Ct,bt)&&f(Rt,bt,Ct[bt]);return Rt},M=(Rt,Ct)=>d(Rt,O(Ct));const x=(Rt,Ct,bt,kt)=>{if(Rt){const mn=Rt(Ct,b({defaultValue:bt},kt));if(mn&&mn!==Ct)return mn}return kt?Object.entries(kt).reduce((mn,[Tn,Or])=>mn.replace(`{{${Tn}}}`,String(Or)),bt):bt},z=Rt=>{var Ct;return(Ct=Rt.filter(bt=>bt.url.includes("questionnaire-itemControl")).flatMap(bt=>{var kt,mn;return(mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)!=null?mn:[]}).find(bt=>{var kt;return(kt=bt.code)==null?void 0:kt.startsWith("ui-toolkit/")}))==null?void 0:Ct.code},T=Rt=>{var Ct;const bt=(Ct=Rt.extension)==null?void 0:Ct.find(kt=>kt.url===A.V7);return bt?.valueCode||"off"},S=(Rt,Ct,bt)=>{const kt=(0,E.A)(bt);return Rt&&Ct&&bt?kt.replace("<p>",`<span>${Ct} `).replace("</p>","</span>").trim():kt.replace("<p>","<span>").replace("</p>","</span>").trim()},C=Rt=>{const Ct=Rt?.find(bt=>bt.url===A.Vp);return Ct?.valueInteger},y=Rt=>{const Ct=Rt?.find(bt=>bt.url===A.Z_);return Ct?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},P="Type your response here...",L=(Rt,Ct)=>{const bt=Rt?.find(kt=>kt.url===PLACEHOLDER_EXTENSION_URL);return bt?.valueString||Ct&&R[Ct]||P},D=Rt=>{const Ct=Rt?.find(bt=>bt.url===HINT_TEXT_EXTENSION_URL);return Ct?.valueString},w=Rt=>{const Ct=Rt?.filter(bt=>bt.url===A.GT&&bt.valueCode).map(bt=>A.hr[bt.valueCode]||bt.valueCode);return Ct?.length?Ct.join(","):void 0},N=Rt=>Rt.split(",").map(kt=>kt.trim()).map(kt=>A.JL[kt]||kt).filter((kt,mn,Tn)=>Tn.indexOf(kt)===mn).join(", "),V=(Rt,Ct,bt)=>{const kt=N(Rt),mn=kt.lastIndexOf(","),Tn=mn!==-1?`${kt.substring(0,mn)} or${kt.substring(mn+1)}`:kt,Or=[Ct&&`max. ${(Ct/(1e3*1e3)).toFixed(0)}MB`,bt&&`upto ${bt} file${bt>1?"s":""}`].filter(Boolean);return Or.length>0?`${Tn} (${Or.join(", ")})`:Tn},q=Rt=>{const Ct=Rt?.find(bt=>bt?.url===A.zD||bt?.url===A.UZ);return Ct?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(Rt,Ct)=>{var bt,kt,mn;const Tn=Ct?.find(Or=>Or.url.includes(Rt));return(mn=(kt=(bt=Tn?.valueInteger)!=null?bt:Tn?.valueDecimal)!=null?kt:Tn?.valueString)!=null?mn:Tn?.valueDate},k=Rt=>{if(!!Rt){if(/^\d{4}-\d{2}-\d{2}$/.test(Rt))return Rt;try{const Ct=(0,i.evaluate)({},Rt);if(Array.isArray(Ct)&&Ct.length>0){const bt=Ct[0];if(bt instanceof Date&&!isNaN(bt.getTime())){const kt=bt.getFullYear(),mn=String(bt.getMonth()+1).padStart(2,"0"),Tn=String(bt.getDate()).padStart(2,"0");return`${kt}-${mn}-${Tn}`}if(typeof bt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(bt))return bt}}catch{}}},U=(Rt,Ct)=>{var bt,kt;const mn=Ct?.find(Or=>Or.url===Rt);if(!mn)return;const Tn=(bt=mn.valueString)!=null?bt:mn.valueDate;return Tn||k((kt=mn.valueExpression)==null?void 0:kt.expression)},F=(Rt,Ct)=>{if(!(!Rt||Rt.length===0))for(const bt of Rt){const kt=I(Ct,bt.extension);if(kt!==void 0)return kt;if(bt.item&&bt.item.length>0){const mn=F(bt.item,Ct);if(mn!==void 0)return mn}}},K=(Rt,Ct)=>{try{const bt=String(Rt??Ct);let kt;if(bt.includes("/"))kt=(0,n.A)(bt,"MM/dd/yyyy",new Date);else{const mn=bt.split("T")[0];kt=(0,t.A)(mn)}return(0,r.A)(kt)}catch(bt){return console.error("Date parsing error:",bt,Rt),null}},G=(Rt,Ct)=>{var bt;for(const kt of Rt){if(kt.linkId===Ct)return kt;if((bt=kt.item)!=null&&bt.length){const mn=G(kt.item,Ct);if(mn!==void 0)return mn}}},se=(Rt,Ct)=>{var bt;const kt=[];for(const mn of Rt)if(mn.linkId===Ct&&kt.push(mn),(bt=mn.item)!=null&&bt.length){const Tn=se(mn.item,Ct);kt.push(...Tn)}return kt},oe=(Rt,Ct,bt=0)=>se(Rt,Ct)[bt];function te(Rt){return Rt!=null}const pe=(Rt,Ct)=>{var bt,kt,mn;if("answerString"in Rt&&te(Rt.answerString)){if(Rt.operator==="=")return Ct?.valueString===Rt.answerString;if(Rt.operator==="!=")return Ct?.valueString!==Rt.answerString}if("answerBoolean"in Rt&&te(Rt.answerBoolean)){if(Rt.operator==="=")return Ct?.valueBoolean===Rt.answerBoolean;if(Rt.operator==="!=")return Ct?.valueBoolean!==Rt.answerBoolean}if("answerInteger"in Rt&&te(Rt.answerInteger)||"answerDecimal"in Rt&&te(Rt.answerDecimal)){const Tn=Number(Ct?.valueInteger||Ct?.valueDecimal),Or=Number(Rt.answerInteger||Rt.answerDecimal);if(Rt.operator==="=")return Tn===Or;if(Rt.operator==="!=")return Tn!==Or;if(Rt.operator===">")return Tn>Or;if(Rt.operator==="<")return Tn<Or;if(Rt.operator===">=")return Tn>=Or;if(Rt.operator==="<=")return Tn<=Or}if("answerQuantity"in Rt&&te(Rt.answerQuantity)){const Tn=Ct?.valueQuantity,Or=Rt.answerQuantity;if(Tn?.unit!==Or?.unit)return!1;if(Rt.operator==="=")return Tn.value===Or.value;if(Rt.operator==="!=")return Tn.value!==Or.value;if(Rt.operator===">")return Tn.value>Or.value;if(Rt.operator==="<")return Tn.value<Or.value;if(Rt.operator===">=")return Tn.value>=Or.value;if(Rt.operator==="<=")return Tn.value<=Or.value}if("answerCoding"in Rt&&te(Rt.answerCoding)){const Tn=Ct?.valueCoding,Or=Rt.answerCoding;if(Rt.operator==="=")return Tn?.code===Or.code;if(Rt.operator==="!=")return Tn?.code!==Or.code}if("answerReference"in Rt&&te(Rt.answerReference)){const Tn=Ct?.valueReference,Or=Rt.answerReference;if(Rt.operator==="=")return Tn?.reference===Or.reference;if(Rt.operator==="!=")return Tn?.reference!==Or.reference}if("answerDate"in Rt&&te(Rt.answerDate)||"answerDateTime"in Rt&&te(Rt.answerDateTime)||"answerTime"in Rt&&te(Rt.answerTime)){const Tn=new Date((mn=(kt=(bt=Ct?.valueDate)!=null?bt:Ct?.valueDateTime)!=null?kt:Ct?.valueTime)!=null?mn:""),Or=new Date(Rt.answerDate||Rt.answerDateTime||Rt.answerTime||"");if(Rt.operator==="=")return Tn.getTime()===Or.getTime();if(Rt.operator==="!=")return Tn.getTime()!==Or.getTime();if(Rt.operator===">")return Tn.getTime()>Or.getTime();if(Rt.operator==="<")return Tn.getTime()<Or.getTime();if(Rt.operator===">=")return Tn.getTime()>=Or.getTime();if(Rt.operator==="<=")return Tn.getTime()<=Or.getTime()}return Rt.operator==="exists"?Ct!=null===Rt.answerBoolean:!0},be=(Rt,Ct,bt)=>{const kt=mn=>{const Tn=se(bt,mn.question);return Tn.length===0||Tn.every(Or=>!Or.answer||Or.answer.length===0)?pe(mn,void 0):Tn.some(Or=>{var Cn;return(Cn=Or.answer)==null?void 0:Cn.some(gn=>pe(mn,gn&&Object.keys(gn).length>0?gn:void 0))})};return Rt&&Rt?.length>0?Ct==="any"?Rt?.some(mn=>kt(mn)):Rt?.every(mn=>kt(mn)):!0},Se=(Rt,Ct,bt,kt,mn)=>{if(!Rt||Rt.length===0)return!0;const Tn=Or=>{var Cn;let gn;if(kt&&typeof mn=="number"){const Mt=bt.filter(Pt=>Pt.linkId===kt)[mn];if(Mt?.item){const Pt=Mt.item.find(Ut=>Ut.linkId===Or.question);if(Pt?.answer&&Pt.answer.length>0)return(Cn=Pt?.answer)==null?void 0:Cn.some(Ut=>pe(Or,Ut&&Object.keys(Ut).length>0?Ut:void 0))}}if(!gn){const rn=se(bt,Or.question);if(rn.length>0)return rn.some(Mt=>{var Pt;return(Pt=Mt.answer)==null?void 0:Pt.some(Ut=>pe(Or,Ut&&Object.keys(Ut).length>0?Ut:void 0))});gn=void 0}return pe(Or,gn)};return Ct==="any"?Rt.some(Or=>Tn(Or)):Rt.every(Or=>Tn(Or))},ge=(Rt,Ct)=>{var bt;if(!!((bt=Rt?.valueExpression)!=null&&bt.expression))try{const kt=evaluate(Ct,Rt.valueExpression.expression);return Array.isArray(kt)?kt.some(mn=>Boolean(mn)):Boolean(kt)}catch{return}},ne=(Rt,Ct)=>{var bt;const kt=(bt=Rt.extension)==null?void 0:bt.find(Tn=>Tn.url===READ_ONLY_EXPRESSION_EXTENSION_URL),mn=ge(kt,Ct);return M(b({},Rt),{readOnly:mn??Rt.readOnly})},ae=(Rt,Ct,bt,kt)=>{const{required:mn,maxLength:Tn,type:Or,extension:Cn,enableWhen:gn,enableBehavior:rn,repeats:Mt,answerOption:Pt}=Rt;if(!be(gn,rn,Ct)||Rt.type==="group"||Rt.type==="display")return"";if(Mt)return me(Rt,Ct,bt,kt);const Ut=re(Rt,Ct);return Ut&&J(Ut,Rt)?ve(Rt,Ct,bt,Ut,kt):ue(Cn,Or,mn,Tn,bt,Pt,kt)},me=(Rt,Ct,bt,kt)=>{const{required:mn}=Rt;if(mn){if(!bt||bt.length===0)return x(kt,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let Tn=!1;for(let Or=0;Or<bt.length;Or++){const Cn=bt[Or];if(Cn&&Object.keys(Cn).length>0&&Object.values(Cn).some(rn=>rn!=null&&rn!==""&&(Array.isArray(rn)?rn.length>0:!0))){Tn=!0;const rn=ue(Rt.extension,Rt.type,!0,Rt.maxLength,[Cn],Rt.answerOption,kt);if(rn)return x(kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Or+1,error:rn});if(Rt.item&&Rt.item.length>0){const Mt=he(Rt.item,Ct,Rt.linkId,Or,kt);if(Mt)return x(kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Or+1,error:Mt})}}else return x(kt,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:Or+1})}if(!Tn)return x(kt,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(bt&&bt.length>0)for(let Tn=0;Tn<bt.length;Tn++){const Or=bt[Tn];if(Or&&Object.keys(Or).length>0&&Object.values(Or).some(gn=>gn!=null&&gn!==""&&(Array.isArray(gn)?gn.length>0:!0))){const gn=ue(Rt.extension,Rt.type,!1,Rt.maxLength,[Or],Rt.answerOption,kt);if(gn)return x(kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Tn+1,error:gn});if(Rt.item&&Rt.item.length>0){const rn=he(Rt.item,Ct,Rt.linkId,Tn,kt);if(rn)return x(kt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Tn+1,error:rn})}}}return""},he=(Rt,Ct,bt,kt,mn)=>{var Tn,Or;for(const Cn of Rt){if(!Se(Cn.enableWhen,Cn.enableBehavior,Ct,bt,kt))continue;const gn=G(Ct,bt),rn=(Tn=gn?.item)==null?void 0:Tn.find(Pt=>Pt.linkId===Cn.linkId),Mt=(Or=rn?.answer)!=null&&Or[kt]?[rn.answer[kt]]:void 0;if(Cn.required){if(!Mt||!Mt[0]||!ce(Mt[0]))return x(mn,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Cn.text||Cn.linkId});const Pt=ue(Cn.extension,Cn.type,!0,Cn.maxLength,Mt,Cn.answerOption,mn);if(Pt)return`${Cn.text||Cn.linkId}: ${Pt}`}else if(Mt&&Mt[0]&&ce(Mt[0])){const Pt=ue(Cn.extension,Cn.type,!1,Cn.maxLength,Mt,Cn.answerOption,mn);if(Pt)return`${Cn.text||Cn.linkId}: ${Pt}`}if(Cn.item&&Cn.item.length>0){const Pt=he(Cn.item,Ct,Cn.linkId,kt,mn);if(Pt)return Pt}}return""},ce=Rt=>!Rt||Object.keys(Rt).length===0?!1:Object.values(Rt).some(Ct=>Ct!=null&&Ct!==""&&(Array.isArray(Ct)?Ct.length>0:!0)),ue=(Rt,Ct,bt,kt,mn,Tn,Or)=>{var Cn,gn,rn,Mt,Pt;let Ut="";const ln=!!Rt?.find(Lr=>{var $r,d0;return Lr.url===A.gD&&((d0=($r=Lr.valueCodeableConcept)==null?void 0:$r.coding)==null?void 0:d0.some(Lo=>Lo.system===A.n4&&Lo.code===A.GI))}),Jt=mn?.[0],Sn={choice:((Cn=Jt?.valueCoding)==null?void 0:Cn.code)||(Jt?.valueString&&Tn?.some(Lr=>Lr.valueString===Jt.valueString)?Jt.valueString:null),"open-choice":((gn=Jt?.valueCoding)==null?void 0:gn.code)||Jt?.valueString,boolean:Jt?.valueBoolean,string:Jt?.valueString,text:Jt?.valueString,url:Jt?.valueUri,integer:Jt?.valueInteger,decimal:Jt?.valueDecimal,dateTime:Jt?.valueDateTime,date:Jt?.valueDate,time:Jt?.valueTime,quantity:(rn=Jt?.valueQuantity)==null?void 0:rn.value,reference:(Mt=Jt?.valueReference)==null?void 0:Mt.display,attachment:(Pt=Jt?.valueAttachment)==null?void 0:Pt.title};if(!(Ct in Sn))return"";const jn=Sn[Ct],Hr={required:()=>bt&&(jn==null||jn===""||jn==="NaN"||Number.isNaN(jn)||Ct==="boolean"&&jn!==!0&&ln)?x(Or,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>kt&&jn!==null&&jn!==void 0&&jn.toString().length>kt?x(Or,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:kt}):"",minLength:()=>{const Lr=I("minLength",Rt);return Lr&&jn!==null&&jn!==void 0&&jn.toString().length<Number(Lr)?x(Or,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:Lr}):""},urlRegex:()=>{const Lr=new RegExp(A.rx),$r=I("regexError",Rt),d0=$r??x(Or,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return Lr&&Ct==="url"&&jn&&!Lr.test(jn)?String(d0):""},regex:()=>{const Lr=I("regex",Rt);if(!Lr||typeof jn!="string")return"";const $r=new RegExp(Lr),d0=I("regexError",Rt),Lo=d0??x(Or,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return $r&&jn&&!$r.test(jn)?String(Lo):""},dateTime:()=>{if(Ct==="dateTime"&&jn){const Lr=jn?.toString(),$r=new Date(Lr);return isNaN($r.getTime())?x(Or,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(Ct!=="date"||!jn)return"";const Lr=jn.replace(/\D/g,"");return Lr.length>0&&Lr.length<8||isNaN(new Date(jn).getTime())?x(Or,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var Lr;if(Ct==="date"){const d0=U(A.dU,Rt),Lo=K(d0??"01/01/1900","01/01/1900"),N0=K(jn,"");if(!Lo||!N0)return"";if((0,s.A)(N0,Lo)){const Q0=(Lr=Rt?.find(q0=>q0.url===A.Ck))==null?void 0:Lr.valueString;return Q0??x(Or,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:d0??"01/01/1900"})}return""}const $r=I("minValue",Rt);return $r!=null&&jn!==null&&jn!==void 0&&jn<$r?x(Or,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:$r}):""},maxValue:()=>{var Lr;if(Ct==="date"){const d0=U(A.bK,Rt),Lo=K(d0??"01/01/2100","01/01/2100"),N0=K(jn,"");if(!Lo||!N0)return"";if((0,o.A)(N0,Lo)){const Q0=(Lr=Rt?.find(q0=>q0.url===A.Cx))==null?void 0:Lr.valueString;return Q0??x(Or,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:d0??"01/01/2100"})}return""}const $r=I("maxValue",Rt);return $r!=null&&jn!==null&&jn!==void 0&&jn>$r?x(Or,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:$r}):""}};return Ut=Hr.required()||Hr.maxLength()||Hr.minLength()||Hr.urlRegex()||Hr.regex()||Hr.dateTime()||Hr.date()||Hr.minValue()||Hr.maxValue()||"",Ut},re=(Rt,Ct)=>{for(const bt of Ct)if(bt.item){if(bt.item.find(Tn=>Tn.linkId===Rt.linkId))return bt;const mn=re(Rt,bt.item);if(mn)return mn}return null},J=(Rt,Ct)=>{if(Rt.answer&&Rt.answer.length>1)return!0;if(Rt.item){const bt=Rt.item.find(kt=>kt.linkId===Ct.linkId);if(bt&&bt.answer&&bt.answer.length>1)return!0}return!1},ve=(Rt,Ct,bt,kt,mn)=>{var Tn,Or;const{required:Cn}=Rt,gn=(Tn=kt.item)==null?void 0:Tn.find(Pt=>Pt.linkId===Rt.linkId),rn=gn?.answer||[],Mt=((Or=kt.answer)==null?void 0:Or.length)||1;for(let Pt=0;Pt<Mt;Pt++){const Ut=rn[Pt];if(Cn){if(!Ut||!ce(Ut))return x(mn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:x(mn,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Rt.text||Rt.linkId})});const ln=ue(Rt.extension,Rt.type,!0,Rt.maxLength,[Ut],Rt.answerOption,mn);if(ln)return x(mn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:ln})}else if(Ut&&ce(Ut)){const ln=ue(Rt.extension,Rt.type,!1,Rt.maxLength,[Ut],Rt.answerOption,mn);if(ln)return x(mn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:ln})}}return""},Ee=(Rt,Ct)=>{for(const bt of Rt){if(bt?.linkId===Ct)return bt;if(bt?.item&&bt.item.length>0){const kt=Ee(bt.item,Ct);if(kt)return kt}}},De=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>{var kt,mn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)==null?void 0:mn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===FOOTER_CODE))}))},ze=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>bt.url===A.oA&&bt.valueBoolean))},Ie=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>{var kt,mn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)==null?void 0:mn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===HEADER_CODE))}))},xe=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>{var kt,mn;return bt.url===A.gD&&((mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)==null?void 0:mn.some(Tn=>Tn.system===A.n4&&Tn.code===A._l))}))},$e=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>bt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&bt.valueBoolean))},it=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>{var kt,mn;return bt.url===ITEM_CONTROL_EXTENSION_URL&&((mn=(kt=bt.valueCodeableConcept)==null?void 0:kt.coding)==null?void 0:mn.some(Tn=>Tn.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Tn.code===CHECKBOX_CODE))}))},mt=Rt=>{var Ct;const bt=(Ct=Rt.extension)==null?void 0:Ct.find(kt=>kt.url===A.fe);return bt?.valueInteger},Lt=Rt=>{var Ct;const bt=(Ct=Rt.extension)==null?void 0:Ct.find(kt=>kt.url===A.zO);return bt?.valueInteger},$t=Rt=>{var Ct;const bt=(Ct=Rt?.extension)==null?void 0:Ct.find(kt=>kt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return bt?.valueInteger},Kt=(Rt,Ct,bt,kt,mn,Tn)=>{const Or=gn=>Ct.filter(rn=>rn.linkId===gn),Cn=new Set;return Rt.map(gn=>{if(Cn.has(gn.linkId)||De(gn))return null;const Mt=Or(gn.linkId),Pt=gn.type==="group"&&gn.repeats;if(Cn.add(gn.linkId),Pt){const Ut=[];if(Mt.forEach((ln,Jt)=>{const Sn={linkId:gn.linkId,text:gn.text};let jn;if(bt===gn.linkId&&typeof Tn=="number"&&Tn===Jt&&mn&&mn.length>0){const Hr=ln?.item||[];jn=[...Hr],mn.forEach(Lr=>{const $r=jn.findIndex(d0=>d0.linkId===Lr.linkId);$r>=0?jn[$r]=M(b({},Hr[$r]),{answer:Lr.answer}):jn.push(Lr)})}else gn.item&&(jn=Kt(gn.item,ln?.item||[],bt,kt,mn,Jt));bt===gn.linkId&&typeof Tn=="number"&&Tn===Jt&&kt?Sn.answer=kt:Sn.answer=ln.answer||[{}],jn&&jn.length>0?Sn.item=jn:ln.item&&(Sn.item=ln.item),Ut.push(Sn)}),bt===gn.linkId&&typeof Tn=="number"&&Tn>=Mt.length)for(let ln=Mt.length;ln<=Tn;ln++){const Jt={linkId:gn.linkId,text:gn.text,answer:ln===Tn&&kt?kt:[{}]};ln===Tn&&mn&&mn.length>0?Jt.item=mn:gn.item&&(Jt.item=Kt(gn.item,[],void 0,void 0,void 0,void 0)),Ut.push(Jt)}return Ut}else if(gn.repeats&&typeof Tn=="number"&&bt===gn.linkId){const Ut=Mt[0]||{linkId:gn.linkId,text:gn.text,answer:[]},ln={linkId:gn.linkId,text:gn.text,answer:[...Ut.answer||[]]};if(kt&&kt.length>0){for(;ln.answer.length<=Tn;)ln.answer.push({});ln.answer[Tn]=kt[0]}return ln}else{const Ut=Mt[0],ln=gn.item?Kt(gn.item,Ut?.item||[],bt,kt,mn,Tn):void 0,Jt=ln&&ln.length>0,Sn={linkId:gn.linkId,text:gn.text};return bt&&gn.linkId===bt&&typeof Tn!="number"?(kt||!kt&&!mn?Sn.answer=kt:Ut?.answer&&(Sn.answer=Ut.answer),mn?Sn.item=mn:Jt&&(Sn.item=ln)):(Ut?.answer?Sn.answer=Ut.answer:Sn.answer=[{}],Jt&&(Sn.item=ln)),Sn}}).filter(Boolean).flat()},Et=(Rt,Ct)=>{for(const bt of Rt)if(bt.linkId===Ct||bt.item&&Et(bt.item,Ct))return bt.linkId;return null},Xe=(Rt,Ct,bt,kt)=>{var mn;const Tn=(mn=Rt?.item)!=null?mn:kt;return!Tn||Tn.length===0?!0:Tn.every(Or=>{var Cn;const gn=se(Ct,Or.linkId);if(gn.length===0){const rn=(Cn=G(Ct,Or.linkId))==null?void 0:Cn.answer;if(ae(Or,Ct,rn)&&be(Or.enableWhen,Or.enableBehavior,Ct)&&bt.includes(Or.linkId))return!1}else for(const rn of gn)if(ae(Or,Ct,rn.answer)&&be(Or.enableWhen,Or.enableBehavior,Ct)&&bt.includes(Or.linkId))return!1;return Or.item?Xe(Or,Ct,bt):!0})},We=(Rt,Ct,bt=!0)=>{for(const kt of Rt)if(kt.linkId===Ct&&kt.answer&&kt.answer.length>0||kt.item&&kt.item.length>0&&We(kt.item,Ct,bt))return!0;return!1},Ot=(Rt,Ct,bt=0)=>{const kt=Rt.filter(mn=>mn.linkId===Ct);if(kt.length>bt){const mn=kt[bt];if(mn.answer&&mn.answer.length>0)return mn.answer.some(Tn=>Tn&&Object.keys(Tn).length>0&&Object.values(Tn).some(Or=>Or!=null&&Or!==""));if(mn.item&&mn.item.length>0)return We(mn.item,Ct,!1)}return We(Rt,Ct,!1)},Qe=(Rt,Ct)=>{if(!Rt||!Rt.item)return!1;const bt=kt=>{var mn;if(ze(kt)&&kt.required&&be(kt.enableWhen,kt.enableBehavior,Ct)){const Tn=G(Ct,kt.linkId),Or=ue(kt.extension,kt.type,kt.required,kt.maxLength,Tn?.answer,kt.answerOption);if(!((mn=Tn?.answer)!=null&&mn.length)||Or)return!0}if(kt.item){for(const Tn of kt.item)if(bt(Tn))return!0}return!1};for(const kt of Rt.item)if(bt(kt))return!0;return!1},Ye=Rt=>{var Ct,bt,kt;if(Rt.valueString!==void 0)return Rt.valueString;if(Rt.valueBoolean!==void 0)return Rt.valueBoolean;if(Rt.valueInteger!==void 0)return Rt.valueInteger;if(Rt.valueDecimal!==void 0)return Rt.valueDecimal;if(Rt.valueDate!==void 0)return Rt.valueDate;if(Rt.valueDateTime!==void 0)return Rt.valueDateTime;if(((Ct=Rt.valueCoding)==null?void 0:Ct.code)!==void 0)return Rt.valueCoding.code;if(((bt=Rt.valueReference)==null?void 0:bt.reference)!==void 0)return Rt.valueReference.reference;if(((kt=Rt.valueQuantity)==null?void 0:kt.value)!==void 0)return Rt.valueQuantity.value;if(Rt.valueAttachment!==void 0)return Rt.valueAttachment},Dt=Rt=>{const Ct={linkId:Rt.linkId};if(Rt.answer&&Rt.answer.length>0){const bt=Rt.answer.map(kt=>Ye(kt)).filter(kt=>kt!==void 0);bt.length>0&&(Ct.answer=bt)}if(Rt.item&&Rt.item.length>0){const bt=Rt.item.map(kt=>Dt(kt)).filter(kt=>{const mn=Object.keys(kt);return mn.length>1||mn.length===1&&mn[0]!=="linkId"});bt.length>0&&(Ct.item=bt)}return Ct},pn=(Rt,Ct,bt,kt,mn,Tn)=>{var Or;const Cn=(Or=Ct?.item)==null?void 0:Or[bt[kt]],gn=Cn?.linkId;if(!gn)return!1;const rn=se(Rt,gn),Mt=se(mn,gn),Pt=Ut=>{if(Ut!=null){if(Array.isArray(Ut)){const ln=Ut.filter(Jt=>Jt!=null).map(Jt=>Pt(Jt)).filter(Jt=>Jt!==void 0);return ln.length===0||ln.length===1&&typeof ln[0]=="object"&&Object.keys(ln[0]).length===0?void 0:ln}if(typeof Ut=="object"){const ln={};for(const[Jt,Sn]of Object.entries(Ut))if(Sn!=null){const jn=Pt(Sn);jn!==void 0&&(ln[Jt]=jn)}return Object.keys(ln).length===0?void 0:ln}return Ut}};if(rn.length!==Mt.length)return!1;for(let Ut=0;Ut<rn.length;Ut++){const ln=rn[Ut],Jt=Mt[Ut];if(!ln||!Jt)return!1;const Sn=Dt(Pt(ln)),jn=Dt(Pt(Jt));if(!_.isEqual(Sn,jn))return!1}return kt!==Tn},zn=(Rt,Ct,bt,kt)=>bt&&bt.length>0&&!(bt.length===1&&Object.keys(bt[0]).length===0)&&ae(Rt,Ct,bt,kt)||null,et=(Rt,Ct,bt)=>{const kt={},mn=Tn=>{Tn.forEach(Or=>{const Cn=se(Ct,Or.linkId);if(ye(Or,Rt)||Or.repeats)for(let gn=0;gn<Cn.length;gn++){const rn=Cn[gn];if(rn?.answer&&rn.answer.length>0){const Mt=zn(Or,Ct,rn.answer,bt);Mt&&(kt[Or.linkId]=M(b({},kt[Or.linkId]),{[gn]:Mt}))}}else{const gn=G(Ct,Or.linkId);if(gn?.answer&&gn.answer.length>0){const rn=zn(Or,Ct,gn.answer,bt);rn&&(kt[Or.linkId]={0:rn})}}Or.item&&Or.item.length>0&&mn(Or.item)})};return mn(Rt),kt},xt=Rt=>{if(!Rt)return"";const Ct=Rt.split("-");if(Ct.length===3){const[bt,kt,mn]=Ct;return`${bt.slice(-4)}-${kt}-${mn}`}return""},Xt=Rt=>Rt.trim().replace(/[A-Za-z]+/g,""),Wn=(Rt,Ct)=>{const bt=(kt,mn)=>{for(const Tn of kt){if(Tn.linkId===mn)return Tn.answer;if(Tn.item&&Tn.item.length>0){const Or=bt(Tn.item,mn);if(Or!==void 0)return Or}}};return bt(Rt,Ct)},zr=(Rt,Ct)=>{if(!Ct||Ct.length===0)return null;const bt=Rt.linkId,kt=(mn,Tn,Or=[])=>{for(const Cn of mn){const gn=[...Or,Cn];if(Cn.item){if(Cn.item.some(Pt=>Pt.linkId===Tn))return gn.some(Pt=>Pt.repeats===!0)?Cn:null;if(kt(Cn.item,Tn,gn))return Cn}}return null};return kt(Ct,bt)},hn=(Rt,Ct)=>{if(!Ct||Ct.length===0)return!1;const bt=Rt.linkId,kt=(mn,Tn,Or=[])=>{for(const Cn of mn){const gn=[...Or,Cn];if(Cn.item){if(Cn.item.some(Pt=>Pt.linkId===Tn))return gn.some(Pt=>{const Ut=z(Pt.extension||[]);return!!Ut&&Ut!==UI_TOOLKIT_FORM_CONTAINER});if(kt(Cn.item,Tn,gn))return!0}}return!1};return kt(Ct,bt)},Ln=(Rt,Ct,bt)=>{const kt={};if(!Rt)return kt;const{linkId:mn}=Ct;if(Rt[mn]){const Tn=Rt[mn];kt[mn]=Tn[bt]||""}return Ct.item&&Ct.item.length>0&&Ct.item.forEach(Tn=>{if(Rt[Tn.linkId]){const Or=Rt[Tn.linkId];kt[Tn.linkId]=Or[bt]||""}}),kt},mr=(Rt,Ct)=>{const bt={};if(!Rt||!Rt[Ct])return bt;const kt=Rt[Ct];return bt[Ct]=kt[0]||"",bt},wn=Rt=>{const Ct=Rt.findIndex(Tn=>!ze(Tn)),bt=Ct>=0?[Ct]:[],kt=new Map;let mn=null;if(Rt.forEach((Tn,Or)=>{const Cn=xe(Tn);if(Cn&&Tn.type==="group")Or!==Ct&&bt.push(Or),kt.set(Or,[Or]),mn=Or;else if(mn!==null&&!Cn){const gn=kt.get(mn)||[];kt.set(mn,[...gn,Or])}}),Rt.length>0&&bt.length>0){const Tn=bt[0];if(!kt.has(Tn)){const Or=bt.find(gn=>gn>Tn),Cn=[];for(let gn=Tn;gn<(Or??Rt.length);gn++)Cn.push(gn);kt.set(Tn,Cn)}}return{groupIndices:bt,itemsToRenderMap:kt}},Zr=(Rt,Ct,bt,kt)=>{let mn=[...kt];const Tn=(Or,Cn)=>{Or.forEach(gn=>{if((!gn?.enableWhen||be(gn?.enableWhen,gn.enableBehavior,Cn))&&gn.initial&&!We(Cn,gn.linkId))if(gn.repeats){const rn=Cn.filter(Mt=>Mt.linkId===gn.linkId);rn.length>0?rn.forEach((Mt,Pt)=>{Ot(Cn,gn.linkId,Pt)||(mn=Kt(bt,mn,gn.linkId,gn.initial,void 0,Pt))}):mn=Kt(bt,mn,gn.linkId,gn.initial)}else mn=Kt(bt,mn,gn.linkId,gn.initial);gn.item&&Tn(gn.item,Cn)})};return Tn(Rt,Ct),mn},n0=(Rt,Ct,bt)=>{if(!Rt)return[];const kt=[],mn=Tn=>{Tn.required===Ct&&be(Tn.enableWhen,Tn.enableBehavior,bt)&&!ze(Tn)&&Tn.type!=="display"&&kt.push(Tn),Tn.item&&Tn.item.length>0&&Tn.item.forEach(mn)};return Rt.forEach(mn),kt},It=(Rt,Ct)=>Rt.every(bt=>{var kt;const mn=se(Ct,bt.linkId);if(mn.length>0)return mn.every(Tn=>!ae(bt,Ct,Tn.answer));{const Tn=(kt=G(Ct,bt.linkId))==null?void 0:kt.answer;return!ae(bt,Ct,Tn)}}),Fe=(Rt,Ct)=>{let bt=-1;for(let kt=Rt.length-1;kt>=0;kt--)if(Rt[kt].linkId===Ct){bt=kt;break}return bt},ot=(Rt,Ct)=>Rt.filter(bt=>bt.linkId!==Ct).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:ot(bt.item,Ct)}):bt),Je=(Rt,Ct,bt=Rt)=>Rt.reduce((kt,mn)=>{const Tn=Ee(Ct,mn.linkId);return Tn?.enableWhen&&!be(Tn.enableWhen,Tn.enableBehavior,bt)||(mn.item&&mn.item.length>0?kt.push(M(b({},mn),{item:Je(mn.item,Ct,bt)})):kt.push(mn)),kt},[]),tt=(Rt,Ct,bt=[])=>{const kt=[],mn=Tn=>{Tn.forEach(Or=>{kt.push(Or.linkId),Or.item&&Or.item.length>0&&mn(Or.item)})};for(let Tn=0;Tn<Rt.length;Tn++){const Or=Rt[Tn];if(Or.linkId===Ct){const Cn=Rt.slice(0,Tn+1),gn=Rt.slice(Tn+1),{kept:rn,removed:Mt}=gn.reduce((Pt,Ut)=>{const ln=Ee(bt,Ut.linkId);return!ln||ze(ln)&&be(ln.enableWhen,ln.enableBehavior,Cn)?Pt.kept.push(Ut):Pt.removed.push(Ut),Pt},{kept:[],removed:[]});return mn(Mt),{trimmedData:[...Cn,...rn],trimmedLinkIds:kt,found:!0}}if(Or.item&&Or.item.length>0){const Cn=tt(Or.item,Ct,bt);if(Cn.found){const gn=Rt.slice(0,Tn),rn=Rt.slice(Tn+1),Mt=[...gn,M(b({},Or),{item:Cn.trimmedData})],{kept:Pt,removed:Ut}=rn.reduce((ln,Jt)=>{const Sn=Ee(bt,Jt.linkId);return!Sn||ze(Sn)&&be(Sn.enableWhen,Sn.enableBehavior,Mt)?ln.kept.push(Jt):ln.removed.push(Jt),ln},{kept:[],removed:[]});return mn(Ut),{trimmedData:[...Mt,...Pt],trimmedLinkIds:[...Cn.trimmedLinkIds,...kt],found:!0}}}}return{trimmedData:Rt,trimmedLinkIds:[],found:!1}},rt=(Rt,Ct)=>Rt.filter(bt=>!Ct.includes(bt.linkId)).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:rt(bt.item,Ct)}):bt),lt=Rt=>{var Ct;if(!Rt)return"empty";const bt=A.Z$.find(({patterns:kt})=>kt.some(mn=>Rt.includes(mn)));return(Ct=bt?.type)!=null?Ct:"empty"},St=(Rt,Ct)=>{const{groupIndices:bt}=wn(Rt),kt=Rt.findIndex(mn=>mn.linkId===Ct);return kt!==-1?bt.indexOf(kt):-1},st=Rt=>{if(!Rt)return{restriction:null,warning:null};const Ct=bt=>{const kt=Rt.find(Tn=>Tn.url===bt&&Tn.valueString);if(!kt?.valueString)return null;const mn=kt.valueString.replace(/\\n/g,`
|
|
870
870
|
`).split(`
|
|
871
871
|
`).map(Tn=>Tn.trim()).filter(Boolean).map(Tn=>Tn.startsWith("*")?Tn.substring(1).trim():Tn);return mn.length===0?null:mn.length===1?{isList:!1,items:mn}:{isList:!0,items:mn}};return{restriction:Ct("restriction"),warning:Ct("warning")}},le=(Rt,Ct)=>{var bt;switch(Ct.type){case"boolean-to-string":return typeof Rt=="boolean"?Rt?Ct.trueValue:Ct.falseValue:Rt;case"map":return Ct.mapping&&Rt in Ct.mapping?Ct.mapping[Rt]:Rt;case"date-format":return Rt;case"number-format":if(typeof Rt=="number"){let kt=Rt.toFixed((bt=Ct.decimals)!=null?bt:0);return Ct.prefix&&(kt=Ct.prefix+kt),Ct.suffix&&(kt=kt+Ct.suffix),kt}return Rt;case"passthrough":default:return Rt}},ye=(Rt,Ct)=>{const bt=Rt.linkId,kt=(Tn,Or,Cn=[])=>{for(const gn of Tn){const rn=[...Cn,gn];if(gn.item){if(gn.item.some(Ut=>Ut.linkId===Or))return rn.filter(Ut=>Ut.repeats===!0);const Pt=kt(gn.item,Or,rn);if(Pt.length>0)return Pt}}return[]},mn=kt(Ct,bt);return mn.length>0?mn[mn.length-1]:null},Ue=(Rt,Ct)=>{if(!Rt?.item)return[];const bt=[];for(const kt of Rt.item){if(kt.type!=="group")continue;be(kt.enableWhen,kt.enableBehavior,Ct||[])&&kt.linkId&&bt.push(kt.linkId)}return bt},Te=(Rt,Ct)=>{const bt=Ue(Rt,Ct||void 0);return bt[bt.length-1]},zt=({questionnaire:Rt,extensionUrl:Ct,errorCode:bt})=>{if(!bt||!Rt?.item)return;const kt=Rt.item.find(mn=>{var Tn;return(Tn=mn.extension)==null?void 0:Tn.some(Or=>Or.url===Ct&&Or.valueString===bt)});return kt?.linkId},Yt=(Rt,Ct)=>{var bt;const kt=(bt=Rt.extension)==null?void 0:bt.find(Tn=>Tn.url===A.rb);if(!kt?.valueString)return;const mn=kt.valueString;return Ee(Ct,mn)},vn=Rt=>{var Ct;return!!((Ct=Rt.extension)!=null&&Ct.find(bt=>bt.url===A.rb))},$n=(Rt,Ct)=>Rt.filter(bt=>bt.linkId!==Ct).map(bt=>bt.item&&bt.item.length>0?M(b({},bt),{item:$n(bt.item,Ct)}):bt),Ar=Rt=>{const Ct=I(ANALYTICS_FORM_NAME_EXTENSION_URL,Rt.extension);return Ct??F(Rt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},Wt=Rt=>I(ANALYTICS_EVENT_NAME_EXTENSION_URL,Rt.extension),we=Rt=>I(ANALYTICS_PAGE_NAME_EXTENSION_URL,Rt.extension),Ze=Rt=>I(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,Rt.extension),At=Rt=>I(ANALYTICS_OPTION_NAME_EXTENSION_URL,Rt),jt=(Rt,Ct)=>{var bt,kt,mn;if(!Rt.answerOption)return;const Tn=G(Ct,Rt.linkId),Or=(mn=(kt=(bt=Tn?.answer)==null?void 0:bt[0])==null?void 0:kt.valueCoding)==null?void 0:mn.code;if(!Or)return;const Cn=Rt.answerOption.find(gn=>{var rn;return((rn=gn.valueCoding)==null?void 0:rn.code)===Or});if(!!Cn)return At(Cn.extension)},Qt=(Rt,Ct)=>{const bt={},kt=mn=>{if(!!mn)for(const Tn of mn){const Or=Ze(Tn);if(Or){let Cn;switch(Tn.type){case"choice":Cn=jt(Tn,Ct);break;default:break}Cn&&(bt[Or]=Cn)}Tn.item&&Tn.item.length>0&&kt(Tn.item)}};return kt(Rt.item),bt},nn=Rt=>!!(Rt.initial&&Rt.initial.length>0),Hn=(Rt,Ct,bt)=>{if(!Rt)return[];const kt=[],mn=Tn=>{Tn.forEach(Or=>{if(bt&&bt.includes(Or.linkId))return;const Cn=ze(Or),gn=Ct.includes(Or.linkId);(gn||Cn&&Or.required)&&kt.push(Or),gn&&Or.item&&Or.item.length>0&&mn(Or.item)})};return mn(Rt),kt},Vr=(Rt,Ct,bt,kt,mn,Tn)=>{var Or;if(bt<0||!kt?.item)return!0;const Cn=mn.current[bt],gn=bt+1,rn=mn.current[gn],Mt=bt===0?0:Cn,Pt=rn??kt.item.length,Ut=[];for(let Hr=Mt;Hr<Pt;Hr++){const Lr=(Or=kt?.item)==null?void 0:Or[Hr];if(Lr){if(Tn&&Tn.includes(Lr.linkId))continue;const $r=ze(Lr);(Ct.includes(Lr.linkId)||$r&&Lr.required)&&Ut.push(Lr),Lr.item&&Lr.item.length>0&&Ut.push(...Hn(Lr.item,Ct,Tn))}}const ln=Ut.filter(Hr=>Hr.required===!0),Jt=Ut.filter(Hr=>Hr.required!==!0),Sn=It(ln,Rt),jn=Jt?.every(Hr=>{var Lr;const $r=(Lr=G(Rt,Hr.linkId))==null?void 0:Lr.answer;return $r?!ae(Hr,Rt,$r):!0});return!ln?.length||Sn&&jn}},32957:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(61784),s=e(36087),o=e(8322),i=e(1053),a=e(25624);const g=({item:Gn})=>{const Wr=Gn.text||"",Ur=Gn.extension||[],Go=_i=>{var Di;return(Di=Ur.find(Ri=>Ri.url===_i))==null?void 0:Di.valueString},jo=Go(i.$7),ci=Go(i.pc)||"default";return(0,n.jsx)(s.AlertFloating,{title:Wr,description:jo??"",color:ci})};var c=e(7630),u=e(16212),E=Object.defineProperty,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(Gn,Wr,Ur)=>Wr in Gn?E(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,v=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))m.call(Wr,Ur)&&O(Gn,Ur,Wr[Ur]);if(A)for(var Ur of A(Wr))d.call(Wr,Ur)&&O(Gn,Ur,Wr[Ur]);return Gn};const h=({item:Gn})=>{const[Wr,Ur]=(0,t.useState)(!1),Go=Gn.extension||[],jo=en=>{var Pn;return(Pn=Go.find(rr=>rr.url===en))==null?void 0:Pn.valueString},ci=jo(i.PS)||Gn.text||"",_i=jo(i.Iz)||"button",Di=jo(i.VF),Ri=jo(i.PV),Ui=jo(i.vf),ui=Ui?i.JP[Ui]:void 0,ea=jo(i.D_)||"",Aa=jo(i.$e),Dr=jo(i.GQ),nr=jo(i.qT)||"gray",hr=jo(i.hZ),Pe=jo(i.wG),Ce=jo(i.q3),Ve=Dr?i.JP[Dr]:void 0,gt=()=>Ur(!0),qt=()=>{switch(_i){case"icon-button":return(0,n.jsxs)("button",{onClick:gt,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":ci||ea||void 0,children:[ui&&(0,n.jsx)(ui,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),ci&&(0,n.jsx)("span",{className:"text-sm",children:ci})]});default:return(0,n.jsx)(s.Button,{color:Di??"secondary",size:Ri??"md",iconLeading:ui,onClick:gt,"aria-label":ci,children:ci})}};return(0,n.jsxs)(n.Fragment,{children:[qt(),(0,n.jsx)(s.Modal,v(v(v({id:`modal-${Gn.linkId}`,isOpen:Wr,onOpenChange:Ur,title:{content:ea},description:{content:Aa?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:u.Wp.sanitizeHtml(Aa)}}):void 0},closeButton:{onCloseClick:()=>Ur(!1)}},Ve?{featuredIcon:{icon:Ve,color:nr,size:"lg",className:"bg-white"}}:{}),hr?{primaryButton:{children:hr,onClick:()=>{var en,Pn;Pe==="open-zendesk"&&((Pn=(en=globalThis.zE)==null?void 0:en.activate)==null||Pn.call(en,{hideOnClose:!0})),Ur(!1)}}}:{}),Ce?{secondaryButton:{children:Ce,onClick:()=>Ur(!1)}}:{}))]})};var p=e(18522);const f=({item:Gn})=>{var Wr,Ur,Go,jo,ci,_i,Di,Ri,Ui,ui,ea,Aa;const{hasExternalError:Dr}=(0,p.c)(),nr=Gn.text||"",hr=(Ur=(Wr=Gn.extension)==null?void 0:Wr.find(xr=>xr.url===i.ao))==null?void 0:Ur.valueString,Pe=Dr&&hr?hr:nr,Ce=(jo=(Go=Gn.extension)==null?void 0:Go.find(xr=>xr.url===i.$7))==null?void 0:jo.valueString,Ve=(_i=(ci=Gn.extension)==null?void 0:ci.find(xr=>xr.url===i.el))==null?void 0:_i.valueString,gt=Dr&&Ve?Ve:Ce,qt=(Ri=(Di=Gn.extension)==null?void 0:Di.find(xr=>xr.url===i.g4))==null?void 0:Ri.valueString,en=(ui=(Ui=Gn.extension)==null?void 0:Ui.find(xr=>xr.url===i.Fp))==null?void 0:ui.valueString,Pn=qt?i.JP[qt]:void 0,rr=en?i.JP[en]:void 0,bn=Dr&&rr?rr:Pn,Xn=((Aa=(ea=Gn.extension)==null?void 0:ea.find(xr=>xr.url===i.WS))==null?void 0:Aa.valueString)===i._W.LEFT,un=Xn?"items-start":"items-center",dr=Xn?"text-left":"text-center",pr=Xn?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${un} gap-4`,children:[bn&&(0,n.jsx)(s.FeaturedIcon,{icon:bn,color:Dr&&rr?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${un} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${dr} ${pr} md:max-w-[352px]`,children:Pe}),(0,n.jsx)("p",{className:`text-md text-secondary ${dr}`,children:gt})]})]})};var b=e(15297),M=e(17814),x=Object.defineProperty,z=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,C=(Gn,Wr,Ur)=>Wr in Gn?x(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,y=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))T.call(Wr,Ur)&&C(Gn,Ur,Wr[Ur]);if(z)for(var Ur of z(Wr))S.call(Wr,Ur)&&C(Gn,Ur,Wr[Ur]);return Gn};const R=({item:Gn})=>{const[Wr,Ur]=(0,t.useState)(!1),Go=(0,M.T$)(),jo=Gn.extension||[],ci=hr=>{var Pe;return(Pe=jo.find(Ce=>Ce.url===hr))==null?void 0:Pe.valueString},_i=Gn.text||"",Di=ci(i.PS)||"",Ri=ci(i.D_)||"",Ui=ci(i.$e),ui=ci(i.GQ),ea=ci(i.qT)||"gray",Aa=ci(i.hZ),Dr=ci(i.q3),nr=ui?i.JP[ui]:void 0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-secondary ring-border-secondary flex items-center justify-between rounded-lg px-4 py-2.5 ring-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(b.d,{className:"text-tertiary size-4 shrink-0"}),(0,n.jsx)("span",{className:"text-primary text-sm font-semibold",children:_i})]}),Di&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>Ur(!0),children:Di})]}),(0,n.jsx)(s.Modal,y(y(y({id:`modal-${Gn.linkId}`,isOpen:Wr,onOpenChange:Ur,title:{content:Ri},description:{content:Ui?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:u.Wp.sanitizeHtml(Ui)}}):void 0},closeButton:{onCloseClick:()=>Ur(!1)}},nr?{featuredIcon:{icon:nr,color:ea,size:"lg",className:"bg-white"}}:{}),Aa?{primaryButton:{children:Aa,onClick:()=>{Ur(!1),Go.navigate({id:"profile"})}}}:{}),Dr?{secondaryButton:{children:Dr,onClick:()=>Ur(!1)}}:{}))]})},P=({item:Gn,selectedAnswer:Wr,handleInputChange:Ur})=>{var Go,jo,ci;const _i=(Go=Gn.answerOption)!=null?Go:[],Di=(ci=(jo=Wr?.[0])==null?void 0:jo.valueCoding)==null?void 0:ci.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:_i.map(Ri=>{var Ui,ui,ea,Aa,Dr,nr,hr;const Pe=(ui=(Ui=Ri.valueCoding)==null?void 0:Ui.code)!=null?ui:"",Ce=(Aa=(ea=Ri.valueCoding)==null?void 0:ea.display)!=null?Aa:"",Ve=Di===Pe,gt=(Dr=Ri.extension)==null?void 0:Dr.find(rr=>rr.url===i.g4),qt=(nr=Ri.extension)==null?void 0:nr.find(rr=>rr.url===i.rz),en=gt?.valueString?i.JP[gt.valueString]:void 0,Pn=(hr=qt?.valueString)!=null?hr:"";return(0,n.jsx)(s.SelectableOption,{icon:en,title:Ce,description:Pn,isSelected:Ve,onSelect:()=>{Ur(Gn,[{valueCoding:{code:Pe,display:Ce}}])}},Pe)})})};var L=e(72866),D=e(94043),w=e(94627);const N=({text:Gn,isLabel:Wr,required:Ur,className:Go,id:jo})=>(0,n.jsxs)("p",{id:jo,className:Go??"mb-md text-md",children:[(0,n.jsx)(s.Content,{as:"span",className:(0,D.cx)(Wr&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,w.p)(Gn||"")}}),Ur&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),V="(###) ###-####",q=(Gn,Wr)=>{const Ur=Gn.replace(/\D/g,"");let Go="",jo=0;for(let ci=0;ci<Wr.length&&jo<Ur.length;ci++)Wr[ci]==="#"?(Go+=Ur[jo],jo++):Go+=Wr[ci];return Go},I=Gn=>{if(!Gn)return V;const Wr=Gn.find(Ur=>Ur.url===i.Md);return Wr?.valueString||V},k=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i})=>{var Di;const{linkId:Ri,text:Ui,required:ui,prefix:ea,readOnly:Aa,extension:Dr}=Gn,nr=I(Dr),hr=((Di=Ur?.[0])==null?void 0:Di.valueString)||"",[Pe,Ce]=(0,t.useState)("");(0,t.useEffect)(()=>{if(hr){const Pn=q(hr,nr);Ce(Pn)}},[hr,nr]);const Ve=Ui?(0,a.nt)(jo,ea,Ui):"",gt=ci?.[Ri]||"",qt=Pn=>{const rr=q(Pn,nr);Ce(rr),Go(Gn,[{valueString:rr}])},en=()=>{Wr&&Wr(Ri)};return(0,n.jsxs)("div",{"data-testid":Ri,children:[Ve&&(0,n.jsx)(N,{isLabel:!0,text:Ve,required:ui||!1}),(0,n.jsx)(s.Input,{id:Ri,"aria-label":Ri,"data-testid":Ri,type:"tel",placeholder:"Enter phone number",value:Pe,onChange:qt,onBlur:en,isDisabled:Aa||_i,isRequired:ui,hint:gt,isInvalid:!!gt,size:"md"},Ri)]})},U=({item:Gn,questionnaireSchemaItems:Wr})=>{var Ur;const{isLoading:Go,setCurrentGroupIndex:jo}=(0,p.c)(),ci=(Ur=Gn.extension)==null?void 0:Ur.find(Ui=>Ui.url===i.Uf),_i=ci?.valueString,Di=Gn.text||"Save & continue",Ri=()=>{if(_i){const Ui=(0,a.Ue)(Wr||[],_i);Ui!==-1&&jo(Ui)}};return(0,n.jsx)("div",{"data-testid":Gn.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(s.Button,{className:"md:w-xxs h-10 w-full text-sm",color:"primary",isLoading:Go,onClick:Ri,isDisabled:Gn.readOnly,children:Di})})},F=({size:Gn=24,color:Wr="currentColor",...Ur})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Gn,height:Gn,stroke:Wr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Ur},t.createElement("path",{d:"M10 16h4m-5.2 6h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V6.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 2 16.88 2 15.2 2H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 22 7.12 22 8.8 22ZM15 9a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));F.displayName="Passport";var K=e(56327);const G=({size:Gn=24,color:Wr="currentColor",...Ur})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Gn,height:Gn,stroke:Wr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Ur},t.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));G.displayName="UserCircle";var se=e(14711);const oe=({size:Gn=24,color:Wr="currentColor",...Ur})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Gn,height:Gn,stroke:Wr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Ur},t.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));oe.displayName="Mail01";var te=e(31165),pe=e(14449),be=e(59931),Se=e(27163);const ge=Gn=>{try{const Wr=Gn.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!Wr)return Gn;const[,Ur,Go,jo]=Wr;return new Date(Date.UTC(parseInt(Ur),parseInt(Go)-1,parseInt(jo))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return Gn}},ne=Gn=>{try{if(Gn.includes("AM")||Gn.includes("PM"))return Gn;const Wr=Gn.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!Wr)return Gn;const[,Ur,Go]=Wr,jo=parseInt(Ur),ci=jo>=12?"PM":"AM";return`${jo%12||12}:${Go} ${ci}`}catch{return Gn}},ae=(Gn,Wr,Ur=b.d)=>{var Go;const jo=(Go=Gn.extension)==null?void 0:Go.find(ci=>ci.url===i.g4);return jo?.valueString&&i.JP[jo.valueString]?i.JP[jo.valueString]:Gn.linkId&&Wr[Gn.linkId]?Wr[Gn.linkId]:Ur},me={"appointment-review/first-name":F,"appointment-review/last-name":F,"appointment-review/dob":K.V,"appointment-review/gender":G,"appointment-review/phone":se.b,"appointment-review/email":oe,"appointment-review/vaccines":s.Vaccine,"appointment-review/appointment-date":K.V,"appointment-review/appointment-time":te.z,"appointment-review/facility-name":s.HospitalBuilding,"appointment-review/facility-phone":se.b,"appointment-review/facility-address":pe.X},he=["appointment-review/appointment-date"],ce=["appointment-review/appointment-time"],ue=["appointment-review/facility-phone"],re=["appointment-review/facility-address"],J=["appointment-review/phone","appointment-review/facility-phone"],ve=({item:Gn,questionnaireSchemaItems:Wr})=>{var Ur;const{setCurrentGroupIndex:Go}=(0,p.c)(),{trackEvent:jo}=(0,o.st)(),ci=Gn.item||[];if(ci.length===0)return null;const _i=(Ur=Gn.extension)==null?void 0:Ur.find(ui=>ui.url===i.Uf),Di=_i?.valueString,Ri=()=>{if(jo("edit_info_clicked",{section:Gn.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),Di){const ui=(0,a.Ue)(Wr||[],Di);ui!==-1&&Go(ui)}},Ui=ci.map(ui=>{let ea="";if(ui.initial&&ui.initial.length>0){const nr=ui.initial.map(hr=>{var Pe,Ce,Ve,gt,qt,en,Pn,rr;let bn=((Pe=hr.valueCoding)==null?void 0:Pe.display)||((Ce=hr.valueReference)==null?void 0:Ce.display)||hr.valueString||"";if(bn&&typeof bn=="string"){if(he.includes(ui.linkId)){const Xn=(qt=(gt=(Ve=hr.valueReference)==null?void 0:Ve.extension)==null?void 0:gt.find(un=>un?.url===i.zD||un?.url===i.UZ))==null?void 0:qt.valueCode;if(Xn)try{bn=(0,be.formatToTimeZone)(bn,"YYYY-MM-DD",{timeZone:Xn})}catch{}bn=ge(bn)}else if(ce.includes(ui.linkId)){const Xn=(rr=(Pn=(en=hr.valueReference)==null?void 0:en.extension)==null?void 0:Pn.find(un=>un?.url===i.zD||un?.url===i.UZ))==null?void 0:rr.valueCode;if(Xn)try{bn=(0,be.formatToTimeZone)(bn,"h:mm A",{timeZone:Xn})}catch{bn=ne(bn)}else bn=ne(bn)}}return bn}).filter(Boolean);nr.length>1||ui.repeats&&nr.length>0?ea=nr:nr.length===1&&(ea=nr[0])}if(!ea||Array.isArray(ea)&&ea.length===0)return null;let Aa;ue.includes(ui.linkId)?Aa="phone":re.includes(ui.linkId)&&(Aa="address");let Dr;return J.includes(ui.linkId)&&(Dr="phone"),{Icon:ae(ui,me),label:ui.text||ui.linkId,value:ea,linkType:Aa,displayType:Dr}}).filter(Boolean);return Ui.length===0?null:(0,n.jsx)("div",{"data-testid":Gn.linkId,children:(0,n.jsx)(Se.InfoCard,{title:Gn.text||"Details",infoDetails:Ui,actionButtonText:Di&&"Edit info",onActionButtonClick:Di?Ri:void 0})})},Ee=({size:Gn=24,color:Wr="currentColor",...Ur})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Gn,height:Gn,stroke:Wr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Ur},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"}));Ee.displayName="AlertTriangle";var De=e(18807);const ze=({item:Gn})=>{const{setHideFooterButton:Wr,incrementCustomErrorCount:Ur,decrementCustomErrorCount:Go}=(0,p.c)();return(0,t.useEffect)(()=>(Wr(!0),Ur(),()=>{Wr(!1),Go()}),[Wr,Ur,Go]),(0,n.jsx)("div",{"data-testid":Gn.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(s.EmptyState,{className:"mt-5xl",description:(0,n.jsx)(s.Content,{as:"span",dangerouslySetInnerHTML:{__html:(0,De.p)(Gn.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(Ee,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},Ie={information:"info",warning:"warning",error:"error",fatal:"error",success:"success"},xe=({item:Gn})=>{var Wr,Ur,Go,jo;const{incrementCustomErrorCount:ci,decrementCustomErrorCount:_i,setHideFooterButton:Di}=(0,p.c)(),[Ri,Ui]=(0,t.useState)(!1),ui=(Wr=Gn.extension)==null?void 0:Wr.find(Pe=>Pe.url===i.gi),ea=(Go=(Ur=ui?.valueCodeableConcept)==null?void 0:Ur.coding)==null?void 0:Go.find(Pe=>Pe.system===i.tn),Aa=ea?.code||"error",Dr=Ie[Aa]||"error";(0,t.useEffect)(()=>{if(Dr==="error")return ci(),Di(!0),Ui(!0),()=>{_i(),Di(!1)};Ui(!0)},[Dr,ci,_i,Di]);const nr=ea?.display||"Error",hr=(jo=Gn.text)!=null?jo:"";return Ri?(0,n.jsx)("div",{"data-testid":Gn.linkId,children:(0,n.jsx)(s.InfoBanner,{type:Dr,title:nr,description:hr})}):null};var $e=e(65735);const it=({configKey:Gn,customErrorConfigurations:Wr})=>{if(!Wr)return null;const Ur=Wr[Gn];if(!Ur)return null;const{icon:Go,title:jo,description:ci,primaryButton:_i,secondaryButton:Di}=Ur;return(0,n.jsx)(s.EmptyState,{className:"mt-5xl",title:jo,description:ci,featuredIconProps:{icon:Go,color:"gray"},primaryButton:_i,secondaryButton:Di})},mt=10,Lt=({item:Gn,customErrorConfigurations:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i})=>{var Di,Ri,Ui,ui;const{trackEvent:ea}=(0,o.st)(),{setHideFooterButton:Aa}=(0,p.c)(),{linkId:Dr,text:nr,required:hr,answerOption:Pe,prefix:Ce,readOnly:Ve}=Gn,gt=Gn?.type==="reference",qt=(Di=Ur?.map(cn=>{var qn,tr;return gt?(qn=cn.valueReference)==null?void 0:qn.display:(tr=cn.valueCoding)==null?void 0:tr.code}).filter(cn=>cn!==void 0))!=null?Di:[],[en,Pn]=(0,t.useState)(qt.length),rr=nr?(0,a.nt)(jo,Ce,nr):"",bn=(Ui=(Ri=Gn.extension)==null?void 0:Ri.find(cn=>cn.url===i.Z_))==null?void 0:Ui.valueInteger,Xn=(ui=Pe?.map(cn=>{var qn,tr,Jr,f0;return{value:gt?((qn=cn.valueReference)==null?void 0:qn.display)||"":((tr=cn.valueCoding)==null?void 0:tr.code)||"",label:gt?((Jr=cn.valueReference)==null?void 0:Jr.display)||"":((f0=cn.valueCoding)==null?void 0:f0.display)||"",valueReference:cn.valueReference}}))!=null?ui:[],un=ci?.[Dr],dr=Xn.length>mt,pr=dr?Xn.slice(0,mt):Xn,xr=dr?Xn.slice(mt):[],M0=xr.some(cn=>qt?.includes(cn?.value)),[u0,J0]=(0,t.useState)(M0);if(!(Gn.answerOption&&Gn.answerOption.length>0))return Aa(!0),(0,n.jsx)(it,{configKey:Gn.linkId,customErrorConfigurations:Wr});const ft=Xn.filter(cn=>qt?.includes(cn?.value)).map(cn=>{var qn;const{restriction:tr,warning:Jr}=gt?(0,a.eC)((qn=cn.valueReference)==null?void 0:qn.extension):{restriction:null,warning:null};return{label:cn.label,restriction:tr,warning:Jr}}).filter(cn=>cn.restriction||cn.warning),Vt=(cn,qn)=>{var tr;ea("vaccine_type_checkbox_selected",{on_or_off:cn?"on":"off",vaccine:qn,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let Jr;if(cn){const f0=Xn.find(vo=>vo.value===qn);Jr=[...(tr=Ur?.filter(vo=>Object.keys(vo).length!==0))!=null?tr:[],gt?{valueReference:f0?.valueReference}:{valueCoding:{code:qn,display:f0?.label}}],Pn(vo=>vo+1)}else Jr=Ur?.filter(f0=>{var vo,y0;return gt?((vo=f0.valueReference)==null?void 0:vo.display)!==qn:((y0=f0.valueCoding)==null?void 0:y0.code)!==qn})||[{}],Pn(f0=>f0-1);Go&&Go(Gn,Jr)};return(0,n.jsxs)("div",{"data-testid":Dr,children:[rr&&(0,n.jsx)(N,{text:rr,required:hr||!1}),dr&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:pr.map((cn,qn)=>{const tr=qt?.includes(cn?.value),Jr=!tr&&bn?en>=bn:!1;return(0,n.jsx)("div",{className:qn!==pr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(s.Checkbox,{size:"md","data-testid":cn.value,id:qn.toString(),name:cn.label,isInvalid:!!un,isSelected:tr,label:cn.label,onChange:f0=>Vt(f0,cn.value),isDisabled:Ve||_i||Jr})},qn)})}),dr&&!u0&&!M0&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(s.Button,{type:"button",onClick:()=>{J0(!0),ea("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:Ve||_i,children:"See all"})}),dr&&u0&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),dr&&u0&&(0,n.jsx)("div",{children:xr.map((cn,qn)=>{const tr=qt?.includes(cn?.value),Jr=!tr&&bn?en>=bn:!1;return(0,n.jsx)("div",{className:qn!==xr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(s.Checkbox,{size:"md","data-testid":cn.value,id:(mt+qn).toString(),name:cn.label,isInvalid:!!un,isSelected:tr,label:cn.label,onChange:f0=>Vt(f0,cn.value),isDisabled:Ve||_i||Jr})},mt+qn)})}),(0,n.jsx)(s.HintText,{isInvalid:!!un,children:un}),ft.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:ft.map((cn,qn)=>(0,n.jsxs)("div",{children:[cn.restriction&&(0,n.jsx)(s.InfoBanner,{type:"warning",title:`[Restriction] ${cn.label}`,description:cn.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:cn.restriction.items.map((tr,Jr)=>(0,n.jsx)("li",{className:"text-sm",children:tr},Jr))}):(0,n.jsx)("p",{className:"text-sm",children:cn.restriction.items[0]})}),cn.warning&&(0,n.jsx)("div",{className:cn.restriction?"mt-2":"",children:(0,n.jsx)(s.InfoBanner,{type:"warning",title:`[Warning] ${cn.label}`,description:cn.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:cn.warning.items.map((tr,Jr)=>(0,n.jsx)("li",{className:"text-sm",children:tr},Jr))}):(0,n.jsx)("p",{className:"text-sm",children:cn.warning.items[0]})})})]},qn))})]})};var $t=e(76323),Kt=e(56192),Et=e(66267),Xe=Object.defineProperty,We=Object.defineProperties,Ot=Object.getOwnPropertyDescriptors,Qe=Object.getOwnPropertySymbols,Ye=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,pn=(Gn,Wr,Ur)=>Wr in Gn?Xe(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,zn=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))Ye.call(Wr,Ur)&&pn(Gn,Ur,Wr[Ur]);if(Qe)for(var Ur of Qe(Wr))Dt.call(Wr,Ur)&&pn(Gn,Ur,Wr[Ur]);return Gn},et=(Gn,Wr)=>We(Gn,Ot(Wr)),xt=(Gn,Wr,Ur)=>new Promise((Go,jo)=>{var ci=Ri=>{try{Di(Ur.next(Ri))}catch(Ui){jo(Ui)}},_i=Ri=>{try{Di(Ur.throw(Ri))}catch(Ui){jo(Ui)}},Di=Ri=>Ri.done?Go(Ri.value):Promise.resolve(Ri.value).then(ci,_i);Di((Ur=Ur.apply(Gn,Wr)).next())});const Xt=({item:Gn,handleInputChange:Wr,onCompleteHandler:Ur,errors:Go})=>{const{i18n:{t:jo},loading:ci}=(0,Et.E_)({keys:["shared-translations","ui-toolkit-modern"]}),{trackEvent:_i}=(0,o.st)(),{linkId:Di,required:Ri,readOnly:Ui}=Gn,ui=Go?.[Di]||"",[ea,Aa]=(0,t.useState)($t.LocationType.CURRENT_LOCATION),[Dr,nr]=(0,t.useState)(""),hr=(0,t.useRef)({}),[Pe,Ce]=(0,t.useState)([{id:$t.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:$t.LocationType.ADDRESS,label:"Address"},{id:$t.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:Ve,setIsLoading:gt,setIsCurrentFormValid:qt,isCurrentFormValid:en}=(0,p.c)(),{position:Pn,loading:rr,locationPermission:bn}=(0,$t.useDeviceLocationContext)(),{queryParams:Xn,setQueryParams:un}=(0,$t.useSearchQueryParams)(),[dr,{loading:pr}]=(0,Kt.qtq)({fetchPolicy:"cache-first"}),[xr,{loading:M0}]=(0,Kt.YyG)({fetchPolicy:"cache-first"}),u0=Gn.item?(0,a.Yo)(Gn.item,"postal-code"):void 0,J0=Gn.item?(0,a.Yo)(Gn.item,"state"):void 0,_o=Gn.item?(0,a.Yo)(Gn.item,"latitude"):void 0,ft=Gn.item?(0,a.Yo)(Gn.item,"longitude"):void 0,Vt=G0=>{if(!G0||!u0)return nr(""),!1;const Oo=(0,a.zj)(u0.extension,u0.type,!1,u0.maxLength,[{valueString:G0}],void 0,jo);return Oo?(nr(ea!==$t.LocationType.ZIP_CODE?jo("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Oo),!1):(nr(""),!0)},cn=()=>{const{latitude:G0,longitude:Oo,state:Io,zipcode:X0}=hr.current;return!!(G0&&Oo&&Io&&X0)},qn=(0,t.useCallback)(G0=>{hr.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},Gn.item&&(J0&&Wr(J0,[{valueString:""}]),_o&&Wr(_o,[{valueDecimal:void 0}]),ft&&Wr(ft,[{valueDecimal:void 0}]),u0&&Wr(u0,[{valueString:""}])),un({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:G0,locationPermission:bn}),qt&&qt(!1),nr("")},[Wr,Gn.item,_o,bn,ft,qt,un,J0,u0]);(0,t.useEffect)(()=>{if(!Ri)return;!cn()&&qt&&qt(!1)},[en,Ri,qt]);const tr=G0=>{hr.current=zn(zn({},hr.current),G0),G0.addressDescription&&_i("address_selected",{value:G0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),vo(hr.current.latitude,hr.current.longitude,hr.current.state,hr.current.zipcode,hr.current.placeId,hr.current.addressDescription)},Jr=G0=>xt(void 0,null,function*(){var Oo,Io,X0;if(nr(""),hr.current.zipcode=G0,qt&&qt(!1),Vt(G0)){_i("zip_code_entered",{value:G0,_event_metadata:{description:"A user entered a zip code."}});const to=yield xr({variables:{location:G0}}),C0=(Oo=to?.data)==null?void 0:Oo.geocoding,v0=to?.error;if(C0){const vi=C0.stateCode||"",ko=(Io=C0.latitude)!=null?Io:void 0,Ti=(X0=C0.longitude)!=null?X0:void 0;tr({latitude:ko,longitude:Ti,state:vi,zipcode:G0,placeId:void 0,addressDescription:void 0})}else v0&&(tr({latitude:void 0,longitude:void 0,state:void 0,zipcode:G0,placeId:void 0,addressDescription:void 0}),nr(jo("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else vo(hr.current.latitude,hr.current.longitude,hr.current.state,G0)}),f0=()=>{const G0=hr.current.zipcode||"";!G0||ea!==$t.LocationType.ZIP_CODE||Vt(G0)};(0,t.useEffect)(()=>{Xn.locationType&&(Aa(Xn.locationType),Xn.locationType===$t.LocationType.ZIP_CODE&&Xn.zipCode&&Jr(Xn.zipCode),Xn.locationType===$t.LocationType.ADDRESS&&Xn.placeId&&Xn.addressDescription&&(hr.current.addressDescription=Xn.addressDescription,hr.current.placeId=Xn.placeId))},[]),(0,t.useEffect)(()=>{const G0=[$t.LocationPermissionEnum.DENIED,$t.LocationPermissionEnum.UNAVAILABLE,$t.LocationPermissionEnum.BLOCKED].includes(Xn.locationPermission),Oo=[$t.LocationPermissionEnum.GRANTED,$t.LocationPermissionEnum.PROMPT].includes(Xn.locationPermission);if(G0&&Pe.length!==2){if(Ce([{id:$t.LocationType.ADDRESS,label:"Address"},{id:$t.LocationType.ZIP_CODE,label:"Zip code"}]),ea===$t.LocationType.CURRENT_LOCATION||!Xn.locationType||Xn.locationType===""){const Io=Xn.locationType===$t.LocationType.ZIP_CODE?$t.LocationType.ZIP_CODE:$t.LocationType.ADDRESS;Aa(Io),un(et(zn({},Xn),{locationType:Io})),qn(Io)}nr("")}Oo&&Pe.length!==3&&Ce([{id:$t.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:$t.LocationType.ADDRESS,label:"Address"},{id:$t.LocationType.ZIP_CODE,label:"Zip code"}])},[ea,bn,Pe.length,Xn,un,qn]);const vo=(G0,Oo,Io,X0,to,C0)=>{if(!Gn.item)return;J0&&Wr(J0,[{valueString:Io||""}]),_o&&Wr(_o,[{valueDecimal:G0}]),ft&&Wr(ft,[{valueDecimal:Oo}]),u0&&Wr(u0,[{valueString:X0||""}]),un(et(zn({},Xn),{lat:String(G0),lng:String(Oo),location:`${G0},${Oo}`,zipCode:X0||"",placeId:to||"",addressDescription:C0||"",locationPermission:bn}));const v0=cn()&&Vt(X0||"");qt&&qt(v0),Ur&&Ur(Di)};(0,t.useEffect)(()=>{const G0=()=>xt(void 0,null,function*(){var Oo;try{const Io=yield dr({variables:{latitude:String(Pn?.coords.latitude),longitude:String(Pn?.coords.longitude)}}),X0=(Oo=Io?.data)==null?void 0:Oo.geocodingByLatLon,to=X0?.stateCode||"",C0=X0?.zipCode||"";(!C0||!to)&&nr(jo("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),tr({latitude:Pn?.coords.latitude,longitude:Pn?.coords.longitude,state:to,zipcode:C0,placeId:void 0,addressDescription:void 0})}catch{Aa($t.LocationType.ADDRESS)}});ea===$t.LocationType.CURRENT_LOCATION&&Pn&&G0()},[ea,Pn]);const y0=G0=>{if(!G0||!G0.latitude||!G0.longitude||!G0.zipCode||!G0.stateCode){tr({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),G0&&typeof G0.value=="string"&&G0.value.trim().length!==0&&nr(jo("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}tr({latitude:G0.latitude,longitude:G0.longitude,state:G0.stateCode,zipcode:G0.zipCode,placeId:G0.placeId,addressDescription:G0.description})};return(0,t.useEffect)(()=>{gt(rr||pr||M0||ci)},[rr,pr,M0,ci,gt]),(0,t.useEffect)(()=>{Xn.locationType!==ea&&un(et(zn({},Xn),{locationType:ea}))},[ea]),(0,n.jsxs)("div",{"data-testid":Gn.linkId,children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:Ri||!1}),(0,n.jsx)(s.Select,{id:Di,"aria-label":Di,"data-testid":Di,isDisabled:Ui||pr||M0||Ve,selectedKey:ea,onSelectionChange:G0=>{var Oo;_i("location_type_input_selected",{choice:(Oo=Pe.find(({id:Io})=>Io===G0))==null?void 0:Oo.label,_event_metadata:{description:"A user changed the location type input."}}),G0!==ea&&(qn(G0),Aa(G0))},hint:ui,isInvalid:!!ui,items:Pe,placeholder:"Select an option",isRequired:Ri,children:G0=>(0,n.jsx)(s.Select.Item,{id:G0.id,"data-testid":G0.id,value:G0,children:G0.label},G0.id)},Di),ea===$t.LocationType.CURRENT_LOCATION&&(0,n.jsx)(s.HintText,{isInvalid:!!Dr,children:Dr}),ea===$t.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:Ri||!1}),(0,n.jsx)($t.AddressTypeahead,{onValueChange:y0,isDisabled:Ve,setIsLoading:gt,initialValue:{placeId:hr.current.placeId||"",description:hr.current.addressDescription||""},errorText:Dr||ui})]}),ea===$t.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:Ri||!1}),(0,n.jsx)(s.Input,{isRequired:Ri,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${Di}-zipcode`,placeholder:"Type your response here...",value:hr.current.zipcode||"",onChange:Jr,onBlur:f0,isDisabled:Ui||M0||Ve,hint:Dr||ui,isInvalid:!!Dr||!!ui,autoComplete:"postal-code"},`${Di}-zipcode`)]})]})},Wn=Gn=>(0,n.jsx)($t.DeviceLocationProvider,{children:(0,n.jsx)(Xt,zn({},Gn))}),zr={[i.cX]:Wn,[i.G6]:ve,[i.c3]:Lt,[i.AA]:xe,[i.mO]:f,[i.PM]:U,[i.HH]:k,[i.Us]:ze,[i.Tl]:P,[i.G0]:h,[i.m3]:g,[i.PU]:R,[i.XP]:c.l,[i.uH]:L.v,[i.it]:$e.d};var hn,Ln=new Uint8Array(16);function mr(){if(!hn&&(hn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!hn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hn(Ln)}const wn=/^(?:[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 Zr(Gn){return typeof Gn=="string"&&wn.test(Gn)}const n0=Zr;for(var It=[],Fe=0;Fe<256;++Fe)It.push((Fe+256).toString(16).substr(1));function ot(Gn){var Wr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Ur=(It[Gn[Wr+0]]+It[Gn[Wr+1]]+It[Gn[Wr+2]]+It[Gn[Wr+3]]+"-"+It[Gn[Wr+4]]+It[Gn[Wr+5]]+"-"+It[Gn[Wr+6]]+It[Gn[Wr+7]]+"-"+It[Gn[Wr+8]]+It[Gn[Wr+9]]+"-"+It[Gn[Wr+10]]+It[Gn[Wr+11]]+It[Gn[Wr+12]]+It[Gn[Wr+13]]+It[Gn[Wr+14]]+It[Gn[Wr+15]]).toLowerCase();if(!n0(Ur))throw TypeError("Stringified UUID is invalid");return Ur}const Je=ot;function tt(Gn,Wr,Ur){Gn=Gn||{};var Go=Gn.random||(Gn.rng||mr)();if(Go[6]=Go[6]&15|64,Go[8]=Go[8]&63|128,Wr){Ur=Ur||0;for(var jo=0;jo<16;++jo)Wr[Ur+jo]=Go[jo];return Wr}return Je(Go)}const rt=tt,lt=(Gn,Wr="application/octet-stream")=>{try{const Ur=window.atob(Gn),Go=new Uint8Array(Ur.length);for(let ci=0;ci<Ur.length;ci++)Go[ci]=Ur.charCodeAt(ci);return new Blob([Go],{type:Wr}).size}catch{return 0}},St=(Gn,Wr)=>`data:${Wr};base64,${Gn}`,st=(Gn,Wr,Ur=512)=>{const Go=window.atob(Gn),jo=[];for(let _i=0;_i<Go.length;_i+=Ur){const Di=Go.slice(_i,_i+Ur),Ri=new Array(Di.length);for(let ui=0;ui<Di.length;ui++)Ri[ui]=Di.charCodeAt(ui);const Ui=new Uint8Array(Ri);jo.push(Ui)}const ci=new Blob(jo,{type:Wr});return URL.createObjectURL(ci)},le=Gn=>{const Wr=new Date().toISOString().replace(/[:.-]/g,"");return`${Gn.split(" ").join("-")}_${Wr}`},ye=4e3,Ue=.8,Te=(Gn,Wr)=>{var Ur,Go;const jo=(Ur=Wr?.maxDimension)!=null?Ur:ye,ci=(Go=Wr?.quality)!=null?Go:Ue;return new Promise((_i,Di)=>{if(!Gn.type.startsWith("image/")){_i(Gn);return}if(Gn.type==="image/heic"||Gn.type==="image/heif"||Gn.name.toLowerCase().endsWith(".heic")||Gn.name.toLowerCase().endsWith(".heif")){_i(Gn);return}const Ui=new Image,ui=new FileReader;ui.onload=()=>{const ea=ui.result;Ui.onload=()=>{let{width:Aa,height:Dr}=Ui;if(Aa>jo||Dr>jo){const Ve=jo/Math.max(Aa,Dr);Aa=Math.round(Aa*Ve),Dr=Math.round(Dr*Ve)}const nr=document.createElement("canvas");nr.width=Aa,nr.height=Dr;const hr=nr.getContext("2d");if(!hr){_i(Gn);return}hr.drawImage(Ui,0,0,Aa,Dr);const Pe=Gn.type==="image/png"?"image/png":"image/jpeg",Ce=Gn.type==="image/png"?void 0:ci;nr.toBlob(Ve=>{if(!Ve||Ve.size>=Gn.size){_i(Gn);return}_i(new File([Ve],Gn.name,{type:Pe}))},Pe,Ce)},Ui.onerror=()=>{Di(new Error(`Failed to load image: ${Gn.name}`))},Ui.src=ea},ui.onerror=()=>{Di(new Error(`Failed to read file: ${Gn.name}`))},ui.readAsDataURL(Gn)})},zt=50,Yt=(Gn,Wr=zt)=>{if(Gn.length<=Wr)return Gn;const Ur=Gn.lastIndexOf("."),Go=Ur!==-1?Gn.slice(Ur):"",jo=Ur!==-1?Gn.slice(0,Ur):Gn,ci=Wr-Go.length-1,_i=Math.ceil(ci/2),Di=Math.floor(ci/2);return`${jo.slice(0,_i)}\u2026${jo.slice(-Di)}${Go}`};var vn=Object.defineProperty,$n=Object.defineProperties,Ar=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,we=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,At=(Gn,Wr,Ur)=>Wr in Gn?vn(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,jt=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))we.call(Wr,Ur)&&At(Gn,Ur,Wr[Ur]);if(Wt)for(var Ur of Wt(Wr))Ze.call(Wr,Ur)&&At(Gn,Ur,Wr[Ur]);return Gn},Qt=(Gn,Wr)=>$n(Gn,Ar(Wr)),nn=(Gn,Wr,Ur)=>new Promise((Go,jo)=>{var ci=Ri=>{try{Di(Ur.next(Ri))}catch(Ui){jo(Ui)}},_i=Ri=>{try{Di(Ur.throw(Ri))}catch(Ui){jo(Ui)}},Di=Ri=>Ri.done?Go(Ri.value):Promise.resolve(Ri.value).then(ci,_i);Di((Ur=Ur.apply(Gn,Wr)).next())});const Hn=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i})=>{const{linkId:Di,text:Ri,required:Ui,prefix:ui,readOnly:ea,repeats:Aa,extension:Dr}=Gn,nr=(0,a.Qr)(Dr),hr=(0,a.cz)(Dr),Pe=(0,a.$H)(Dr)||"image/*,.pdf,.doc,.docx",Ce=Ri?(0,a.nt)(jo,ui,Ri):"",Ve=ci?.[Di]||"",[gt,qt]=(0,t.useState)([]),en=(0,t.useRef)(Ur||[]);(0,t.useEffect)(()=>{Ur&&(en.current=Ur)},[Ur]),(0,t.useEffect)(()=>{Ur?.length&&qt(dr=>{const pr=dr.filter(M0=>M0.isLoading||M0.failed);return[...Ur.filter(M0=>M0.valueAttachment).map((M0,u0)=>{var J0,_o,ft,Vt,cn;const qn=((J0=M0.valueAttachment)==null?void 0:J0.title)||`attachment-${u0}`,tr=(_o=M0.valueAttachment)==null?void 0:_o.id,Jr=dr.find(y0=>tr&&y0.id===tr||!tr&&y0.id===`existing-${u0}`),f0=(ft=M0.valueAttachment)==null?void 0:ft.data,vo=f0?lt(f0,(Vt=M0.valueAttachment)==null?void 0:Vt.contentType):0;return{id:tr||Jr?.id||`existing-${u0}`,name:qn,size:Jr?.size||vo,progress:100,failed:!1,type:(0,a.J4)((cn=M0.valueAttachment)==null?void 0:cn.contentType),isLoading:!1}}),...pr]})},[Ur]);const Pn=dr=>{let pr=Array.from(dr);if(hr!==void 0){const M0=hr-gt.length;if(M0<=0)return;pr=pr.slice(0,M0)}const xr=pr.map(M0=>{const u0=nr&&M0.size>nr,J0=M0.name.replace(/\s+/g,"-");return{id:rt(),name:J0,size:M0.size,progress:0,type:(0,a.J4)(M0.type),failed:!!u0,isLoading:!u0,disableRetry:!!u0,errorMessage:u0?`File size exceeds ${(nr/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});qt(M0=>[...M0,...xr]),xr.filter(M0=>!M0.failed).forEach(M0=>{const u0=pr.find(J0=>J0.name.replace(/\s+/g,"-")===M0.name);u0&&rr(u0,M0.id)})},rr=(dr,pr)=>nn(void 0,null,function*(){try{const xr=yield Te(dr),M0=yield un(xr),u0=xr.name.replace(/\s+/g,"-");qt(Vt=>Vt.map(cn=>cn.id===pr?Qt(jt({},cn),{isLoading:!1,progress:100,failed:!1}):cn));const J0={valueAttachment:{id:pr,contentType:xr.type,data:M0,title:u0}},ft=[...(en.current||[]).filter(Vt=>Vt.valueAttachment||Object.keys(Vt).length>0),J0];en.current=ft,Go(Gn,ft),Wr(Di)}catch{qt(M0=>M0.map(u0=>u0.id===pr?Qt(jt({},u0),{isLoading:!1,failed:!0}):u0))}}),bn=dr=>{const pr=gt.find(xr=>xr.id===dr);if(qt(xr=>xr.filter(M0=>M0.id!==dr)),pr){const xr=(en.current||[]).filter((M0,u0)=>{var J0;if(dr.startsWith("existing-")){const _o=parseInt(dr.replace("existing-",""));return u0!==_o}return((J0=M0.valueAttachment)==null?void 0:J0.id)!==dr}).filter(M0=>M0.valueAttachment||Object.keys(M0).length>0);en.current=xr,Go(Gn,xr.length>0?xr:[{}])}},Xn=dr=>{const pr=gt.find(xr=>xr.id===dr);if(pr){qt(M0=>M0.map(u0=>u0.id===dr?Qt(jt({},u0),{failed:!1,isLoading:!0,progress:0}):u0));const xr=new File([""],pr.name,{type:"application/octet-stream"});rr(xr,dr)}},un=dr=>new Promise((pr,xr)=>{const M0=new FileReader;M0.onload=()=>{const J0=M0.result.split(",")[1];pr(J0)},M0.onerror=xr,M0.readAsDataURL(dr)});return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Ui||!1}),(0,n.jsx)(s.FileUpload,{files:gt,onDropFiles:Pn,onDeleteFile:bn,onRetryFile:Xn,onDropUnacceptedFiles:()=>{},hint:(0,a.od)(Pe,nr,hr),accept:Pe,allowsMultiple:Aa!==!1,isDisabled:ea||_i||hr!==void 0&>.length>=hr,className:"w-full",showDisclosureModal:!0}),Ve&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:Ve})]})},Vr=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i})=>{var Di,Ri;const{linkId:Ui,text:ui,prefix:ea,readOnly:Aa,required:Dr,extension:nr}=Gn,{trackQuestionnaireEvent:hr}=(0,p.c)(),Pe=ui?(0,a.nt)(jo,ea,ui):"",Ce=ci?.[Ui];return nr?.find(gt=>{var qt,en;return gt.url===i.gD&&((en=(qt=gt.valueCodeableConcept)==null?void 0:qt.coding)==null?void 0:en.some(Pn=>Pn.system===i.n4&&Pn.code===i.GI))})?(0,n.jsxs)("div",{"data-testid":Ui,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":Ui,children:[(0,n.jsx)(s.Checkbox,{size:"md",id:Ui,name:Ui,isDisabled:Aa||_i,isSelected:(Di=Ur?.[0])==null?void 0:Di.valueBoolean,"aria-label":Ui,label:"",className:"mt-1",onChange:gt=>{hr(Gn.linkId,{value:gt}),Go(Gn,[{valueBoolean:gt}]),Wr(Gn.linkId)}}),Pe&&(0,n.jsx)(N,{isLabel:!0,text:Pe,required:Dr||!1})]}),(0,n.jsx)(s.HintText,{isInvalid:!!Ce,children:Ce})]}):(0,n.jsxs)("div",{"data-testid":Ui,children:[Pe&&(0,n.jsx)(N,{isLabel:!0,text:Pe,required:Dr||!1}),(0,n.jsxs)(s.RadioGroup,{size:"md",id:Ui,name:Ui,"aria-label":Ui,value:String((Ri=Ur?.[0])==null?void 0:Ri.valueBoolean)||"",onChange:gt=>{Go(Gn,[{valueBoolean:gt==="true"}]),Wr(Gn.linkId)},isInvalid:!!Ce,children:[(0,n.jsx)(s.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Aa||_i}),(0,n.jsx)(s.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Aa||_i})]},Ui),Ce&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,D.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Ce})})]})};var Rt=Object.defineProperty,Ct=Object.getOwnPropertySymbols,bt=Object.prototype.hasOwnProperty,kt=Object.prototype.propertyIsEnumerable,mn=(Gn,Wr,Ur)=>Wr in Gn?Rt(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,Tn=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))bt.call(Wr,Ur)&&mn(Gn,Ur,Wr[Ur]);if(Ct)for(var Ur of Ct(Wr))kt.call(Wr,Ur)&&mn(Gn,Ur,Wr[Ur]);return Gn};const Or=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i,placeholder:Di,hintText:Ri})=>{var Ui,ui,ea;const{linkId:Aa,text:Dr,required:nr,answerOption:hr,prefix:Pe,readOnly:Ce}=Gn,Ve=Dr?(0,a.nt)(jo,Pe,Dr):"",gt=hr?.map(Pn=>{var rr,bn,Xn,un;return{id:((rr=Pn.valueCoding)==null?void 0:rr.code)||Pn.valueString||"",label:((bn=Pn.valueCoding)==null?void 0:bn.display)||Pn.valueString||"",value:((Xn=Pn.valueCoding)==null?void 0:Xn.code)||Pn.valueString||"",extension:Pn.extension||[],system:((un=Pn.valueCoding)==null?void 0:un.system)||void 0}})||[],qt=((ui=(Ui=Ur?.[0])==null?void 0:Ui.valueCoding)==null?void 0:ui.code)||((ea=Ur?.[0])==null?void 0:ea.valueString)||"",en=ci?.[Aa];return(0,n.jsxs)("div",{children:[Ve&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ve,required:nr||!1}),(0,n.jsx)(s.Select,{id:Aa,"aria-label":Aa,"data-testid":Aa,isDisabled:Ce||_i,selectedKey:qt,onSelectionChange:Pn=>{const rr=String(Pn),bn=gt.find(dr=>dr.value===rr),Xn=bn?bn.label:"",un=Boolean(hr?.find(dr=>dr.valueString===rr));Go(Gn,[un?{valueString:rr}:{valueCoding:Tn({code:rr,display:Xn},bn?.system?{system:bn.system}:{}),extension:bn?.extension||[]}]),Wr(Gn.linkId)},isInvalid:!!en,hint:en||Ri,items:gt,placeholder:Di,isRequired:nr,children:Pn=>(0,n.jsx)(s.Select.Item,{id:Pn.id,"data-testid":Pn.value,value:Pn.value,children:Pn.label},Pn.id)},Aa)]})};var Cn=Object.defineProperty,gn=Object.getOwnPropertySymbols,rn=Object.prototype.hasOwnProperty,Mt=Object.prototype.propertyIsEnumerable,Pt=(Gn,Wr,Ur)=>Wr in Gn?Cn(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,Ut=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))rn.call(Wr,Ur)&&Pt(Gn,Ur,Wr[Ur]);if(gn)for(var Ur of gn(Wr))Mt.call(Wr,Ur)&&Pt(Gn,Ur,Wr[Ur]);return Gn};const ln=Gn=>{var Wr,Ur,Go;const{item:jo,selectedAnswer:ci,updatedText:_i,required:Di,errorMessage:Ri}=Gn,Ui=jo?.type==="reference",ui=(Wr=ci?.map(hr=>{var Pe,Ce;return Ui?(Pe=hr.valueReference)==null?void 0:Pe.display:(Ce=hr.valueCoding)==null?void 0:Ce.code}).filter(hr=>hr!==void 0))!=null?Wr:[],[ea,Aa]=(0,t.useState)(ui.length),Dr=(Go=(Ur=jo.extension)==null?void 0:Ur.find(hr=>hr.url===i.Z_))==null?void 0:Go.valueInteger,nr=(hr,Pe)=>{var Ce,Ve,gt;let qt;if(hr){const en=Gn.options.find(Pn=>Pn.value===Pe);qt=[...(Ve=(Ce=Gn.selectedAnswer)==null?void 0:Ce.filter(Pn=>Object.keys(Pn).length!==0))!=null?Ve:[],Ui?{valueReference:en?.valueReference}:{valueCoding:Ut({code:Pe,display:en?.label},en?.system?{system:en.system}:{}),extension:en?.extension||[]}],Aa(Pn=>Pn+1)}else qt=((gt=Gn.selectedAnswer)==null?void 0:gt.filter(en=>{var Pn,rr;return Ui?((Pn=en.valueReference)==null?void 0:Pn.display)!==Pe:((rr=en.valueCoding)==null?void 0:rr.code)!==Pe}))||[{}],Aa(en=>en-1);Gn.handleInputChange(Gn.item,qt)};return(0,n.jsxs)("div",{"data-testid":jo.linkId,children:[_i&&(0,n.jsx)(N,{isLabel:!0,text:_i,required:Di||!1}),(0,n.jsx)("div",{children:Gn.options.map((hr,Pe)=>(0,n.jsx)(s.Checkbox,{size:"md","data-testid":hr.value,id:Pe.toString(),className:Pe!==Gn.options.length-1?"mb-2xl":"",name:hr.label,isInvalid:!!Ri,isSelected:ui?.includes(hr?.value),label:hr.label,onChange:Ce=>nr(Ce,hr.value),isDisabled:Gn.readOnly||Gn.isLoading||(!ui?.includes(hr?.value)&&Dr?ea>=Dr:!1)},Pe))}),(0,n.jsx)(s.HintText,{isInvalid:!!Ri,children:Ri})]})},Jt=({item:Gn,onCompleteHandler:Wr,updatedText:Ur,options:Go,handleInputChange:jo,errorMessage:ci,readOnly:_i,initialValue:Di,selectedAnswer:Ri,isLoading:Ui,required:ui})=>{var ea,Aa;const Dr=`${Gn.linkId}-label`,nr=`${Gn.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":Gn.linkId,children:[Ur&&(0,n.jsx)(N,{id:Dr,isLabel:!0,text:Ur,required:ui||!1}),(0,n.jsx)(s.RadioGroup,{size:"md",id:Gn.linkId,name:Gn.linkId,"aria-labelledby":Ur?Dr:void 0,"aria-describedby":ci?nr:void 0,isRequired:ui,className:Go.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Aa=(ea=Ri?.[0])==null?void 0:ea.valueCoding)==null?void 0:Aa.code)||Di||"",onChange:hr=>{const Pe=hr,Ce=Go.find(gt=>gt.value===Pe),Ve=Ce?Ce.label:"";jo(Gn,[{valueCoding:{code:Pe,display:Ve,system:Ce?.system||void 0},extension:Ce?.extension||[]}]),Wr(Gn.linkId)},isInvalid:!!ci,children:Go.map(hr=>(0,n.jsx)(s.RadioButton,{size:"md","data-testid":hr.value,isDisabled:_i||Ui,value:hr.value,label:hr.label},hr.value))},Gn.linkId),ci&&(0,n.jsx)("div",{id:nr,children:(0,n.jsx)("span",{className:(0,D.cx)("text-error-primary","text-sm","mt-[1.5]"),children:ci})})]})};var Sn=Object.defineProperty,jn=Object.getOwnPropertySymbols,Hr=Object.prototype.hasOwnProperty,Lr=Object.prototype.propertyIsEnumerable,$r=(Gn,Wr,Ur)=>Wr in Gn?Sn(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,d0=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))Hr.call(Wr,Ur)&&$r(Gn,Ur,Wr[Ur]);if(jn)for(var Ur of jn(Wr))Lr.call(Wr,Ur)&&$r(Gn,Ur,Wr[Ur]);return Gn};const Lo=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i,placeholder:Di,hintText:Ri})=>{var Ui,ui,ea,Aa,Dr;const{linkId:nr,text:hr,required:Pe,answerOption:Ce,prefix:Ve,readOnly:gt}=Gn,qt=Gn?.type==="reference",en=hr?(0,a.nt)(jo,Ve,hr):"",rr=(()=>{var xr,M0;const u0=Ce?.find(J0=>J0.initialSelected===!0);return u0?qt?((xr=u0.valueReference)==null?void 0:xr.display)||"":((M0=u0?.valueCoding)==null?void 0:M0.code)||"":""})(),bn=(Ce?.map(xr=>{var M0,u0,J0,_o,ft;return{label:((M0=xr?.valueCoding)==null?void 0:M0.display)||((u0=xr?.valueReference)==null?void 0:u0.display)||"",value:qt?((J0=xr.valueReference)==null?void 0:J0.display)||"":((_o=xr.valueCoding)==null?void 0:_o.code)||"",valueReference:qt?xr.valueReference:{},extension:xr.extension||[],system:((ft=xr.valueCoding)==null?void 0:ft.system)||""}})||[]).filter(xr=>xr.label),Xn=ci?.[nr],un=(Dr=(Aa=(ea=(ui=(Ui=Gn?.extension)==null?void 0:Ui.find(xr=>xr.url.includes("questionnaire-itemControl")))==null?void 0:ui.valueCodeableConcept)==null?void 0:ea.coding)==null?void 0:Aa[0])==null?void 0:Dr.code;let dr=null;const pr={item:Gn,onCompleteHandler:Wr,updatedText:en,options:bn,handleInputChange:Go,errorMessage:Xn,required:Pe,readOnly:gt,initialValue:rr,selectedAnswer:Ur,isLoading:_i,showQuestionPrefix:jo,placeholder:Di,hintText:Ri};switch(un){case"drop-down":dr=(0,n.jsx)(Or,d0({},pr));break;case"check-box":dr=(0,n.jsx)(ln,d0({},pr));break;case"radio-button":dr=(0,n.jsx)(Jt,d0({},pr));break}return(0,n.jsx)(n.Fragment,{children:dr})};var N0=e(73697),Q0=e(71924),q0=e(46776),ho=e(16681);const br=Gn=>`${String(Gn.month).padStart(2,"0")}/${String(Gn.day).padStart(2,"0")}/${Gn.year}`,Mr=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i,placeholder:Di,hintText:Ri})=>{var Ui,ui,ea;const{linkId:Aa,text:Dr,required:nr,prefix:hr,readOnly:Pe}=Gn,Ce=(0,t.useRef)(null),[Ve,gt]=(0,t.useState)(!1),[qt,en]=(0,t.useState)(null),{t:Pn}=(0,r.SS)(),{setIsCurrentFormValid:rr,isCurrentFormValid:bn,trackQuestionnaireEvent:Xn}=(0,p.c)(),un=Dr?(0,a.nt)(jo,hr,Dr):"",dr=ci?.[Aa]||"",pr=(Ui=Gn.extension)==null?void 0:Ui.find(X0=>X0.url===i.dU),xr=(ui=Gn.extension)==null?void 0:ui.find(X0=>X0.url===i.bK),M0=(0,t.useMemo)(()=>{var X0;const to=pr?.valueString||pr?.valueDate;return to||(0,a.iI)((X0=pr?.valueExpression)==null?void 0:X0.expression)},[pr]),u0=(0,t.useMemo)(()=>{var X0;const to=xr?.valueString||xr?.valueDate;return to||(0,a.iI)((X0=xr?.valueExpression)==null?void 0:X0.expression)},[xr]),J0=(0,t.useMemo)(()=>{if(M0&&/^\d{4}-\d{2}-\d{2}$/.test(M0))try{return(0,N0._U)(M0)}catch{}return(0,N0._U)("1900-01-01")},[M0]),_o=(0,t.useMemo)(()=>{if(u0&&/^\d{4}-\d{2}-\d{2}$/.test(u0))try{return(0,N0._U)(u0)}catch(X0){console.warn("Failed to parse maxDateStr:",u0,X0)}return(0,N0._U)("2099-12-31")},[u0]),Vt=(X0=>{if(!X0)return"";const to=X0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!to)return X0;const[,C0,v0,vi]=to;return`${v0}/${vi}/${C0}`})(((ea=Ur?.[0])==null?void 0:ea.valueDate)||""),cn=X0=>{if(!X0)return"";const to=X0.replace(/\D/g,"");if(to.length===0)return"";if(to.length<=2)return to.length===2?`${to}/`:to;const C0=vi=>{const ko=vi.slice(0,2),Ti=vi.slice(2);return Ti.length===2?`${ko}/${Ti}/`:`${ko}/${Ti}`},v0=vi=>{const ko=vi.slice(0,2),Ti=vi.slice(2,4),xi=vi.slice(4,8);return`${ko}/${Ti}/${xi}`};return to.length<=4?C0(to):v0(to)},qn=()=>{if(Pe||_i)return;if(Vt.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const to=(0,N0._U)(Vt);en(to)}catch{en(null)}else{const to=Vt.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(to){const[,C0,v0,vi]=to,ko=parseInt(C0,10),Ti=parseInt(v0,10);if(ko>=1&&ko<=12&&Ti>=1&&Ti<=31)try{const xi=(0,N0._U)(`${vi}-${C0}-${v0}`);en(xi)}catch{en(null)}else en(null)}else en(null)}gt(!0)},tr=()=>{if(qt){const X0=`${qt.year}-${String(qt.month).padStart(2,"0")}-${String(qt.day).padStart(2,"0")}`;Xn(Gn.linkId,{value:(0,a.CP)(`${String(qt.month).padStart(2,"0")}/${String(qt.day).padStart(2,"0")}/${qt.year}`)}),Go(Gn,[{valueDate:(0,a.Fy)(X0)}])}gt(!1),en(null)},Jr=()=>{gt(!1),en(null)},f0=X0=>{var to;const C0=((to=Ce.current)==null?void 0:to.selectionStart)||0,v0=Vt,vi=cn(X0),ko=vi.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(ko){const[,Ti,xi,Oa]=ko,ba=parseInt(Ti,10),e1=parseInt(xi,10),Fs=parseInt(Oa,10);if(vo(ba,e1,Fs).isValid){const Zi=`${Oa}-${Ti}-${xi}`;Xn(Gn.linkId,{value:(0,a.CP)(`${Ti}/${xi}/${Oa}`)}),Go(Gn,[{valueDate:(0,a.Fy)(Zi)}])}else Go(Gn,[{valueDate:vi}])}else Go(Gn,[{valueDate:vi}]);setTimeout(()=>{if(Ce.current){const Ti=v0.replace(/\D/g,""),xi=vi.replace(/\D/g,"");let Oa=C0;vi===v0&&(Oa=C0-1),xi.length>=Ti.length&&vi!==v0?vi[C0-1]==="/"?Oa=C0+1:Oa=C0:xi.length<Ti.length&&(v0[C0-1]==="/"?Oa=Math.max(0,C0-1):Oa=C0),Ce.current.setSelectionRange(Oa,Oa)}},0)},vo=(X0,to,C0)=>{if(X0<1||X0>12)return{isValid:!1,error:(0,a.u0)(Pn,ho.p.VALIDATION_MONTH_RANGE,"Month must be between 01 and 12")};if(to<1||to>31)return{isValid:!1,error:(0,a.u0)(Pn,ho.p.VALIDATION_DAY_RANGE,"Day must be between 01 and 31")};const v0=new Date(C0,X0,0).getDate();if(to>v0)return{isValid:!1,error:(0,a.u0)(Pn,ho.p.VALIDATION_INVALID_DAY_FOR_MONTH,"Invalid day for the selected month")};if(M0||u0){const vi=new Q0.ng(C0,X0,to);if(M0&&/^\d{4}-\d{2}-\d{2}$/.test(M0))try{const ko=(0,N0._U)(M0);if(vi.compare(ko)<0){const Ti=(0,a.di)(i.Ck,Gn.extension);if(Ti)return{isValid:!1,error:Ti};const xi=br(ko);return{isValid:!1,error:(0,a.u0)(Pn,ho.p.VALIDATION_DATE_ON_OR_AFTER,"Date must be on or after {{minDate}}",{minDate:xi})}}}catch{}if(u0&&/^\d{4}-\d{2}-\d{2}$/.test(u0))try{const ko=(0,N0._U)(u0);if(vi.compare(ko)>0){const Ti=(0,a.di)(i.Cx,Gn.extension);if(Ti)return{isValid:!1,error:Ti};const xi=br(ko);return{isValid:!1,error:(0,a.u0)(Pn,ho.p.VALIDATION_DATE_ON_OR_BEFORE,"Date must be on or before {{maxDate}}",{maxDate:xi})}}}catch{}}return{isValid:!0,error:""}},y0=()=>{const X0=Vt.replace(/\D/g,"");if(X0.length>0&&X0.length<8){Wr(Gn.linkId);return}const to=Vt.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!to&&X0.length>=6){Wr(Gn.linkId);return}if(to){const[,C0,v0,vi]=to,ko=parseInt(C0,10),Ti=parseInt(v0,10),xi=parseInt(vi,10);if(vo(ko,Ti,xi).isValid){const Oa=`${vi}-${C0}-${v0}`;Go(Gn,[{valueDate:(0,a.Fy)(Oa)}])}}Wr(Gn.linkId)},Oo=(()=>{if(!Vt)return"";const X0=Vt.replace(/\D/g,"");if(X0.length>0&&X0.length<8)return"";const to=Vt.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!to&&X0.length>=6)return bn&&rr(!1),(0,a.u0)(Pn,ho.p.VALIDATION_INVALID_DATE,"Invalid date");if(to){const[,C0,v0,vi]=to,ko=parseInt(C0,10),Ti=parseInt(v0,10),xi=parseInt(vi,10),{isValid:Oa,error:ba}=vo(ko,Ti,xi);if(!Oa)return bn&&rr(!1),ba||(0,a.u0)(Pn,ho.p.VALIDATION_INVALID_DATE,"Invalid date")}return""})(),Io=!!dr||!!Oo;return(0,n.jsxs)("div",{children:[un&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:un,required:nr||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Pe||_i,className:(0,D.cx)("absolute top-3 right-3.5 z-3 cursor-pointer","outline-focus-ring rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2",(Pe||_i)&&"cursor-not-allowed opacity-50"),onClick:qn,"aria-label":"Open calendar",children:(0,n.jsx)(K.V,{className:"size-5 text-gray-400"})}),(0,n.jsx)("div",{className:(0,D.cx)("pointer-events-none absolute top-[7px] right-[2px] z-2 h-[30px] w-[35px] bg-white",(Pe||_i)&&"bg-disabled_subtle")}),(0,n.jsx)(s.Input,{ref:Ce,isRequired:nr,size:"md",type:"text",name:Aa,"data-testid":Aa,id:Aa,value:Vt,onChange:f0,placeholder:Di,isDisabled:Pe||_i,onBlur:y0,hint:Oo||dr||Ri,isInvalid:Io,className:(0,D.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Aa)]}),(0,n.jsx)(s.Modal,{id:"calendar-date-picker-modal",isOpen:Ve,onOpenChange:X0=>{X0||Jr()},primaryButton:{children:"Apply",onClick:tr,isDisabled:!qt},secondaryButton:{children:"Cancel",onClick:Jr},children:(0,n.jsx)(q0.lr,{value:qt,onChange:en,minValue:J0,maxValue:_o,children:(0,n.jsx)(s.Calendar,{showDateInput:!1,minValue:J0,maxValue:_o,onYearPickerOpen:()=>{en(null)}})})})]})},yr=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i})=>{var Di;const{linkId:Ri,text:Ui,required:ui,prefix:ea,readOnly:Aa}=Gn,Dr=Ui?(0,a.nt)(jo,ea,Ui):"",nr=ci?.[Ri]||"";return(0,n.jsxs)("div",{children:[Dr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Dr,required:ui||!1}),(0,n.jsx)(s.Input,{isRequired:ui,size:"md",type:"datetime-local",id:Ri,"aria-label":Ri,"data-testid":Ri,placeholder:"Type your response here...",value:((Di=Ur?.[0])==null?void 0:Di.valueDateTime)||"",onChange:hr=>{let Pe=hr;const[Ce,Ve]=Pe.split("T");Ce&&Ve&&(Pe=`${(0,a.Fy)(Ce)}T${Ve}:00`),Go(Gn,[{valueDateTime:Pe}])},isDisabled:Aa||_i,onBlur:()=>{Wr(Gn.linkId)},hint:nr,isInvalid:!!nr},Ri)]})},R0=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i,placeholder:Di,hintText:Ri})=>{var Ui;const{linkId:ui,text:ea,required:Aa,prefix:Dr,readOnly:nr}=Gn,hr=ea?(0,a.nt)(jo,Dr,ea):"",Pe=ci?.[ui]||"",Ce=(0,a.a0)(Gn),Ve=(Ui=Ur?.[0])==null?void 0:Ui.valueDecimal,[gt,qt]=(0,t.useState)(String(Ve??""));return(0,t.useEffect)(()=>{qt(String(Ve??""))},[Ve]),(0,n.jsxs)("div",{children:[hr&&(0,n.jsx)(N,{isLabel:!0,text:hr,required:Aa||!1}),(0,n.jsx)(s.Input,{isRequired:Aa,size:"md",id:ui,"aria-label":ui,"data-testid":ui,placeholder:Di,value:gt,onChange:en=>{qt(en)},isDisabled:nr||_i,onBlur:()=>{const en=parseFloat(gt);qt(isNaN(en)?"":String(en)),Go(Gn,[{valueDecimal:isNaN(en)?void 0:en}]),Wr(Gn.linkId)},type:"number",hint:Pe||Ri,isInvalid:!!Pe,autoComplete:Ce},ui)]})},m0=({item:Gn,showStepper:Wr=!1})=>{var Ur;const{text:Go,linkId:jo,type:ci}=Gn,_i=Go&&(0,a.nt)(!1,"",Go),Di=(Ur=Gn.extension)==null?void 0:Ur.find(ea=>ea.url===i.Yt),Ri=Di?.valueBoolean===!0,Ui=ci==="group"&&(0,a.$O)(Gn)!==void 0,ui=()=>{const ea=(0,a.$O)(Gn),Aa=(0,a.t7)(Gn);if(ea===void 0||Aa===void 0||Aa<=0)return[];const Dr=[];for(let nr=1;nr<=Aa;nr++){let hr="incomplete";nr<ea?hr="complete":nr===ea&&(hr="current"),Dr.push({title:"",description:"",status:hr})}return Dr};return _i&&!Ri?(0,n.jsxs)("div",{"data-testid":jo,children:[(0,n.jsx)(N,{text:_i,required:!1,className:""}),Wr&&Ui&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(s.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:ui()})})]}):null},no=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i,placeholder:Di,hintText:Ri})=>{var Ui;const{linkId:ui,text:ea,required:Aa,prefix:Dr,readOnly:nr}=Gn,hr=ea?(0,a.nt)(jo,Dr,ea):"",Pe=ci?.[ui]||"",Ce=(0,a.a0)(Gn);return(0,n.jsxs)("div",{children:[hr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:hr,required:Aa||!1}),(0,n.jsx)(s.Input,{isRequired:Aa,"data-testid":ui,size:"md",id:ui,"aria-label":ui,placeholder:Di,value:String((Ui=Ur?.[0])==null?void 0:Ui.valueInteger)||"",onChange:Ve=>{Go(Gn,[{valueInteger:Number(Ve)}])},isDisabled:nr||_i,onBlur:()=>{Wr(Gn.linkId)},type:"number",hint:Pe||Ri,isInvalid:!!Pe,autoComplete:Ce},ui)]})},Fo=({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i,placeholder:Di,hintText:Ri})=>{var Ui,ui,ea;const{linkId:Aa,text:Dr,extension:nr,required:hr,prefix:Pe,readOnly:Ce}=Gn,Ve=Dr?(0,a.nt)(jo,Pe,Dr):"",gt=nr?.find(Pn=>Pn.url.includes("questionnaire-unitOption")),qt=ci?.[Aa],en=(0,a.a0)(Gn);return(0,n.jsxs)("div",{children:[Ve&&(0,n.jsx)(N,{isLabel:!0,text:Ve,required:hr||!1}),(0,n.jsx)(s.InputGroup,{isRequired:hr,size:"md",id:Aa,"aria-label":Aa,"data-testid":Aa,value:(Ui=Ur?.[0])!=null&&Ui.valueQuantity?String((ui=Ur[0].valueQuantity)==null?void 0:ui.value):"",onChange:Pn=>{Go(Gn,[{valueQuantity:{value:parseFloat(Pn)}}])},isDisabled:Ce||_i,onBlur:()=>{var Pn,rr,bn;const Xn=(Pn=Ur?.[0])!=null&&Pn.valueQuantity?parseFloat(String((bn=(rr=Ur?.[0])==null?void 0:rr.valueQuantity)==null?void 0:bn.value)).toFixed(2):"";Go(Gn,[{valueQuantity:{value:parseFloat(Xn)}}]),Wr(Gn.linkId)},hint:qt||Ri,isInvalid:!!qt,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:(ea=gt?.valueCoding)==null?void 0:ea.display}),children:(0,n.jsx)(s.InputBase,{type:"number",placeholder:Di,autoComplete:en})},Aa)]})},Uo={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},si={[Uo.CURRENT_LOCATION]:ho.p.CURRENT_LOCATION,[Uo.ZIP_CODE]:ho.p.ZIP_CODE,[Uo.ADDRESS]:ho.p.ADDRESS},Pi={mi:{singular:ho.p.MILE,plural:ho.p.MILES}},Li=({resourceData:Gn,handleInputChange:Wr,item:Ur,questionnaireSchemaItems:Go})=>{var jo;const{t:ci}=(0,r.SS)(),{queryParams:_i}=(0,$t.useSearchQueryParams)(),Di=_i.locationType||"",{setCurrentGroupIndex:Ri,handleContinueButtonClick:Ui,setHideFooterButton:ui}=(0,p.c)(),{trackEvent:ea}=(0,o.st)();(0,t.useEffect)(()=>{if(!Ur.readOnly)return ui(!0),()=>{ui(!1)}},[Ur.readOnly,ui]);const Aa=(jo=Ur.extension)==null?void 0:jo.find(rr=>rr.url===i.Uf),Dr=Aa?.valueString,nr=()=>{if(Dr){const rr=(0,a.Ue)(Go||[],Dr);rr!==-1&&Ri(rr)}},hr=rr=>{const bn=rr.find(Xn=>Xn.url.includes("description"));return bn?.valueString||""},Pe=rr=>{const bn=rr.find(M0=>M0.url.includes("distance-value")),Xn=rr.find(M0=>M0.url.includes("distance-unit")),un=bn?.valueString?Number(bn.valueString):NaN,dr=Xn?.valueString||"";if(!dr||isNaN(un))return null;const pr=Math.round(un);let xr=dr;return Pi[dr]&&(xr=ci(pr===1?Pi[dr].singular:Pi[dr].plural)),Di&&si[Di]?ci(ho.p.LOCATION_DISTANCE,{distance:`${pr} ${xr}`,locationType:ci(si[Di])}):ci(ho.p.LOCATION_DISTANCE_AWAY,{distance:`${pr} ${xr}`})},Ce=rr=>({id:rr.id||"",providerName:rr.name||"",specialty:"",distance:Pe(rr.extension||[])||"",placeholderIcon:s.WalgreensLogo,address:rr.address||"",valueReference:rr.valueReference||{reference:rr.id}}),Ve=rr=>{var bn,Xn,un,dr;const pr=rr;return Ce({id:pr.id,name:(bn=pr.name)!=null?bn:"",address:(dr=(un=(Xn=pr?.address)==null?void 0:Xn.line)==null?void 0:un[0])!=null?dr:"",extension:pr?.extension,valueReference:{reference:pr.id}})},gt=rr=>Ce({id:rr?.reference,name:rr?.display,address:hr(rr?.extension||[]),extension:rr?.extension,valueReference:rr}),en=(()=>Gn&&Array.isArray(Gn)&&Gn.length>0?Gn.map(Ve):Ur.initial&&Array.isArray(Ur.initial)&&Ur.initial.length>0?Ur.initial.map(rr=>gt(rr.valueReference)):Ur.answerOption?Ur.answerOption.map(rr=>gt(rr.valueReference)):[])(),Pn=rr=>{Wr(Ur,[{valueReference:rr}])};return(0,n.jsx)("div",{className:(0,s.cx)("gap-md flex flex-col",!Ur.readOnly&&"pb-4xl"),children:Ur.readOnly?en.map(({address:rr,id:bn,providerName:Xn,placeholderIcon:un,distance:dr})=>(0,n.jsx)($t.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:un},locationName:Xn,address:rr,distance:dr,actionButtonText:Dr?"Change location":void 0,onActionButtonClick:Dr?nr:void 0},bn)):en.map(({address:rr,id:bn,providerName:Xn,placeholderIcon:un,specialty:dr,valueReference:pr,distance:xr})=>(0,n.jsx)(s.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:un},providerName:{content:Xn},specialty:{content:dr},location:{address:rr,distance:xr},actionButton:{children:"Schedule appointment",onClick:()=>{ea("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:rr,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),Pn(pr),Ui?.()}}},bn))})};var fi=e(79079),Ni=e(32066),hi=e(43915),qi=e(36181),Vi=e(37234),Xa=e(65388),Nr=Object.defineProperty,er=Object.defineProperties,Yr=Object.getOwnPropertyDescriptors,Ir=Object.getOwnPropertySymbols,V0=Object.prototype.hasOwnProperty,Mn=Object.prototype.propertyIsEnumerable,Fn=(Gn,Wr,Ur)=>Wr in Gn?Nr(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,Tr=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))V0.call(Wr,Ur)&&Fn(Gn,Ur,Wr[Ur]);if(Ir)for(var Ur of Ir(Wr))Mn.call(Wr,Ur)&&Fn(Gn,Ur,Wr[Ur]);return Gn},c0=(Gn,Wr)=>er(Gn,Yr(Wr));const Zn={"ui-toolkit/LocationCard":Li,"ui-toolkit/TimeSlotSelection":({resourceData:Gn,item:Wr,handleInputChange:Ur,selectedAnswer:Go,questionnaireSchemaItems:jo,formData:ci,onCompleteHandler:_i})=>{var Di,Ri;const{t:Ui}=(0,fi.S)(),{trackEvent:ui}=(0,o.st)(),{isLoading:ea,setIsInlineNextQuestionTriggered:Aa}=(0,p.c)(),Dr=C0=>{const v0=C0.match(/^(\d{4}-\d{2}-\d{2})/);return v0?v0[1]:C0},nr=(0,t.useCallback)(C0=>{var v0;return(v0=C0.find(vi=>vi?.url===i.zD||vi?.url===i.UZ))==null?void 0:v0.valueCode},[]),hr=(0,t.useCallback)((C0,v0)=>{const vi=nr(v0);if(!vi)return ne(C0);try{return(0,be.formatToTimeZone)(C0,"h:mm A",{timeZone:vi})}catch{return ne(C0)}},[nr]),Pe=(0,t.useCallback)((C0,v0)=>{const vi=nr(v0);if(!vi)return Dr(C0);try{return(0,be.formatToTimeZone)(C0,"YYYY-MM-DD",{timeZone:vi})}catch{return Dr(C0)}},[nr]),Ce=C0=>{const v0=C0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(v0){const[,vi,ko,Ti]=v0;return new Date(parseInt(vi),parseInt(ko)-1,parseInt(Ti))}return new Date},gt=(()=>{var C0;if((C0=Go?.[0])!=null&&C0.valueReference){const v0=Go[0].valueReference,vi=v0.display||"",ko=Pe(vi,v0.extension||[]);if(ko)return{date:Ce(ko),slotId:v0.reference||""}}return{date:new Date,slotId:""}})(),[qt,en]=(0,t.useState)(gt.date),[Pn,rr]=(0,t.useState)(gt.slotId),[bn,Xn]=(0,t.useState)(new Set),un=(0,t.useMemo)(()=>new Q0.ng(qt.getFullYear(),qt.getMonth()+1,qt.getDate()),[qt]),dr=C0=>({display:C0.display||"",id:C0.id||"",start:C0.start||"",extension:Array.isArray(C0.extension)?C0.extension:[],identifier:Array.isArray(C0.identifier)?C0.identifier:[],type:C0.type||""}),pr=C0=>{var v0;return dr({display:(v0=C0.start)!=null?v0:"",id:C0.id,start:C0.start,extension:C0.extension,identifier:C0.identifier})},xr=C0=>dr({display:C0?.display||"",id:C0?.reference,start:C0?.display,extension:C0?.extension,identifier:C0?.identifier,type:C0?.type}),M0=()=>{if(Array.isArray(Gn)&&Gn.length>0)return Gn.filter(C0=>C0.resourceType==="Appointment").map(pr);if(Wr.initial&&Array.isArray(Wr.initial)&&Wr.initial.length>0)return Wr.initial.map(C0=>xr(C0.valueReference));if(Wr.answerOption)return Wr.answerOption.map(C0=>xr(C0.valueReference))},u0=(0,t.useMemo)(()=>M0()||[],[Gn,Go,Wr]),J0=(0,t.useMemo)(()=>{const C0={};return u0.forEach(v0=>{if(v0.start&&v0.id){const vi=Pe(v0.start,v0.extension);C0[vi]||(C0[vi]=[]),C0[vi].push({display:v0.display,id:v0.id,start:v0.start,extension:v0.extension})}}),C0},[u0,Pe]),_o=(0,t.useMemo)(()=>{const C0=Object.keys(J0).sort(),v0=[];if(C0.length===0)return v0.push(un),bn.forEach(Ti=>{const xi=(0,hi.A)(Ti);v0.push(new Q0.ng(xi.getFullYear(),xi.getMonth()+1,xi.getDate()))}),v0;const vi=(0,hi.A)(C0[C0.length-1]),ko=new Q0.ng(vi.getFullYear(),vi.getMonth()+1,vi.getDate());for(let Ti=un;Ti.compare(ko)<=0;Ti=Ti.add({days:1})){const xi=`${Ti.year}-${String(Ti.month).padStart(2,"0")}-${String(Ti.day).padStart(2,"0")}`;J0[xi]||v0.push(Ti)}if(!(0,a.mR)(Wr)){const Ti=(0,Ni.Ec)((0,Ni.Xj)()).add({days:30});let xi=ko.add({days:1});for(;xi.compare(Ti)<=0;)v0.push(xi),xi=xi.add({days:1})}return bn.forEach(Ti=>{const xi=(0,hi.A)(Ti),Oa=new Q0.ng(xi.getFullYear(),xi.getMonth()+1,xi.getDate());v0.some(ba=>ba.year===Oa.year&&ba.month===Oa.month&&ba.day===Oa.day)||v0.push(Oa)}),v0},[J0,bn,un,Wr]),ft=(0,t.useMemo)(()=>(0,a.mR)(Wr)?s.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[Wr]),Vt=(0,t.useMemo)(()=>Object.keys(J0).map(C0=>{const v0=(0,hi.A)(C0);return new Q0.ng(v0.getFullYear(),v0.getMonth()+1,v0.getDate())}),[J0]),cn=(0,qi.A)((0,Vi.A)(qt),"yyyy-MM-dd"),qn=(0,t.useMemo)(()=>J0[cn]||[],[J0,cn]);(0,t.useEffect)(()=>{const C0=Object.entries(J0).sort(([v0],[vi])=>v0.localeCompare(vi)).slice(0,3).reduce((v0,[vi,ko])=>c0(Tr({},v0),{[`${vi} ${vo}`]:ko.map(Ti=>{var xi;return(0,Xa.YX)({time:Ti.start,timeZone:(0,a.lv)((xi=qn[0])==null?void 0:xi.extension)}).time})}),{});ui("slots_returned",{Specialty:"Vaccines",first_three_days_slots:C0,_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 tr=t.useRef(null),Jr=t.useRef(null),f0=t.useRef(!1);(0,t.useEffect)(()=>{var C0;const v0=Object.keys(J0).sort();v0.length===0||f0.current||(f0.current=!0,(C0=Go?.[0])!=null&&C0.valueReference||en((0,hi.A)(v0[0])))},[J0]),(0,t.useEffect)(()=>{var C0;const v0=Object.keys(J0).sort();if(v0.length===0)return;const ko=!(tr.current===null)&&JSON.stringify(tr.current)!==JSON.stringify(J0);if(tr.current=J0,!!ko&&(Xn(new Set),Jr.current)){const Ti=Jr.current;if(!(((C0=J0[Ti])==null?void 0:C0.length)>0)){const Oa=new Set,ba=(0,hi.A)(Ti),e1=(0,hi.A)(v0[0]);let Fs=ba;for(;Fs<e1;){const Zi=(0,qi.A)(Fs,"yyyy-MM-dd");Oa.add(Zi),Fs=new Date(Fs),Fs.setDate(Fs.getDate()+1)}Xn(Oa),rr("")}Jr.current=null}},[J0]);const vo=(0,t.useMemo)(()=>{const C0=qn[0];if(!C0?.extension)return"";const v0=nr(C0.extension);try{return(0,be.formatToTimeZone)(new Date,"(z)",{timeZone:v0??""})}catch{return""}},[qn,nr]),y0=(0,t.useMemo)(()=>{const C0=Ui(s.Translations.NEXT_AVAILABLE_APPOINTMENTS);return vo?`${C0} ${vo}`:C0},[Ui,vo]),G0=(0,t.useMemo)(()=>{const C0=(0,Ni.Ec)((0,Ni.Xj)()).add({days:ft}),v0=`${C0.year}-${String(C0.month).padStart(2,"0")}-${String(C0.day).padStart(2,"0")}`,ko=Object.keys(J0).sort().find(Ti=>Ti>cn&&Ti<=v0);if(ko){const Ti=(0,hi.A)(ko);return new Q0.ng(Ti.getFullYear(),Ti.getMonth()+1,Ti.getDate())}return null},[J0,cn,ft]),Oo=()=>{if(G0){const C0=G0.toDate((0,Ni.Xj)());en(C0),rr("")}},Io=C0=>{if(!C0){rr(""),Ur(Wr,void 0);return}rr(C0.id);const v0=[{valueReference:{display:C0.display,reference:C0.id,extension:C0.extension,identifier:C0.identifier,type:C0.type}}];Ur(Wr,v0)},X0=C0=>{var v0;if(!C0||ea||!f0.current)return;const vi=Object.keys(J0).sort(),ko=vi[vi.length-1],Ti=vi[0],xi=`${C0.year}-${String(C0.month).padStart(2,"0")}-${String(C0.day).padStart(2,"0")}`;if(ko&&(xi>ko||Ti&&xi<Ti)&&(0,a.mR)(Wr)&&jo&&!_o?.some(ba=>ba.compare(C0)===0)){const ba=(0,a.yQ)(Wr,jo);if(ba){Jr.current=xi;let e1="-06:00";if((v0=u0[0])!=null&&v0.start){const Gs=u0[0].start.match(/([+-]\d{2}:\d{2})$/);Gs&&(e1=Gs[1])}const Zi=[{valueDateTime:`${xi}T23:59:59${e1}`}],M1=Ur(ba,Zi);Ur(Wr,void 0,(0,a.Nw)(M1||ci||[],Wr.linkId),void 0,!0),Aa(!0),_i(ba.linkId,!0,!0)}}const Oa=C0.toDate((0,Ni.Xj)());en(Oa),rr("")},to=C0=>{if(!C0)return;const v0=qn.find(vi=>vi.id===C0);ui("slot_selected",{Specialty:"Vaccines",time_slot:v0?(0,Xa.YX)({time:v0.start,timeZone:(0,a.lv)(qn[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."}}),Io(v0??null)};return(0,n.jsx)(s.TimeSlot,{onChange:X0,disabledDates:_o,highlightedDates:Vt,loading:ea,minValue:(0,Ni.Ec)((0,Ni.Xj)()),maxValue:(0,Ni.Ec)((0,Ni.Xj)()).add({days:ft}),value:un,defaultValue:un,appointmentSlots:{title:y0,onChange:to,defaultValue:Go&&((Ri=(Di=Go[0])==null?void 0:Di.valueReference)==null?void 0:Ri.reference)||void 0,value:Pn||void 0,items:qn.map(C0=>({label:hr(C0.start,C0.extension),value:C0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[Ui(s.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),G0&&(0,n.jsx)("button",{onClick:Oo,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:Ui(s.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var Fr=Object.defineProperty,ao=Object.defineProperties,qo=Object.getOwnPropertyDescriptors,Yi=Object.getOwnPropertySymbols,Hi=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,zo=(Gn,Wr,Ur)=>Wr in Gn?Fr(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,x0=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))Hi.call(Wr,Ur)&&zo(Gn,Ur,Wr[Ur]);if(Yi)for(var Ur of Yi(Wr))sa.call(Wr,Ur)&&zo(Gn,Ur,Wr[Ur]);return Gn},ja=(Gn,Wr)=>ao(Gn,qo(Wr)),ys=(Gn,Wr)=>{var Ur={};for(var Go in Gn)Hi.call(Gn,Go)&&Wr.indexOf(Go)<0&&(Ur[Go]=Gn[Go]);if(Gn!=null&&Yi)for(var Go of Yi(Gn))Wr.indexOf(Go)<0&&sa.call(Gn,Go)&&(Ur[Go]=Gn[Go]);return Ur};const Rs=(Gn,Wr)=>Gn.answerOption?Gn.answerOption.map(Ur=>{var Go,jo;const ci=(jo=(Go=Ur.valueReference)==null?void 0:Go.reference)==null?void 0:jo.replace("#","");return Wr.find(_i=>_i.id===ci)}).filter(Boolean):[],zs=Gn=>{var Wr,Ur,Go;const jo=Gn.find(ci=>{var _i,Di;return ci.url.includes("questionnaire-itemControl")&&((Di=(_i=ci.valueCodeableConcept)==null?void 0:_i.coding)==null?void 0:Di.some(Ri=>{var Ui;return(Ui=Ri.code)==null?void 0:Ui.startsWith("ui-toolkit/")}))});return(Go=(Ur=(Wr=jo?.valueCodeableConcept)==null?void 0:Wr.coding)==null?void 0:Ur.find(ci=>{var _i;return(_i=ci.code)==null?void 0:_i.startsWith("ui-toolkit/")}))==null?void 0:Go.code},is=Gn=>{var{uiToolkitCode:Wr,props:Ur}=Gn,Go=Ur,{item:jo,contained:ci=[],customErrorConfigurations:_i}=Go,Di=ys(Go,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:Ri}=(0,p.c)(),Ui=Zn[Wr];if(!Ui)return(0,n.jsx)(n.Fragment,{});const ui=Rs(jo,ci),ea=ui.length>0;return!(jo.answerOption&&jo.answerOption.length>0)&&!ea&&!jo.readOnly?(Ri(!0),(0,n.jsx)(it,{configKey:Wr,customErrorConfigurations:_i})):(0,n.jsx)(Ui,ja(x0({},Di),{item:jo,contained:ci,customErrorConfigurations:_i,resourceData:ui,"data-testid":jo.linkId}))},ar={attachment:Hn,choice:Lo,boolean:Vr,integer:no,string:({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i,placeholder:Di,hintText:Ri})=>{var Ui;const{linkId:ui,text:ea,required:Aa,prefix:Dr,readOnly:nr}=Gn,hr=ea?(0,a.nt)(jo,Dr,ea):"",Pe=ci?.[ui]||"",Ce=(0,a.a0)(Gn);return(0,n.jsxs)("div",{children:[hr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:hr,required:Aa||!1}),(0,n.jsx)(s.Input,{isRequired:Aa,size:"md","aria-label":ui,"data-testid":ui,id:ui,type:Ce==="tel"?"tel":"text",placeholder:Di,value:((Ui=Ur?.[0])==null?void 0:Ui.valueString)||"",onChange:Ve=>{Go(Gn,[{valueString:Ve}])},isDisabled:nr||_i,onBlur:Ve=>{const gt=Ve.target.value,qt=gt.trim();qt!==gt&&Go(Gn,[{valueString:qt}]),Wr(Gn.linkId)},hint:Pe||Ri,isInvalid:!!Pe,autoComplete:Ce},ui)]})},url:({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i,placeholder:Di,hintText:Ri})=>{var Ui;const{linkId:ui,text:ea,required:Aa,prefix:Dr,readOnly:nr}=Gn,hr=ea?(0,a.nt)(jo,Dr,ea):"",Pe=ci?.[ui]||"",Ce=(0,a.a0)(Gn);return(0,n.jsxs)("div",{children:[hr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:hr,required:Aa||!1}),(0,n.jsx)(s.Input,{isRequired:Aa,size:"md",type:"url",id:ui,"data-testid":ui,"aria-label":ui,placeholder:Di,value:((Ui=Ur?.[0])==null?void 0:Ui.valueUri)||"",onChange:Ve=>{Go(Gn,[{valueUri:Ve}])},isDisabled:nr||_i,onBlur:Ve=>{const gt=Ve.target.value,qt=gt.trim();qt!==gt&&Go(Gn,[{valueUri:qt}]),Wr(Gn.linkId)},hint:Pe||Ri,isInvalid:!!Pe,autoComplete:Ce},ui)]})},text:({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i,placeholder:Di,hintText:Ri})=>{var Ui;const{linkId:ui,text:ea,required:Aa,prefix:Dr,readOnly:nr,maxLength:hr}=Gn,Pe=ea?(0,a.nt)(jo,Dr,ea):"",Ce=ci?.[ui]||"",Ve=(0,a.a0)(Gn);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Aa||!1}),(0,n.jsx)(s.TextArea,{isRequired:Aa,id:ui,"aria-label":ui,"data-testid":ui,rows:3,placeholder:Di,value:((Ui=Ur?.[0])==null?void 0:Ui.valueString)||"",onChange:gt=>{Go(Gn,[{valueString:gt}])},isDisabled:nr||_i,onBlur:gt=>{const qt=gt.target.value,en=qt.trim();en!==qt&&Go(Gn,[{valueString:en}]),Wr(Gn.linkId)},hint:Ce||Ri,counter:!0,isInvalid:!!Ce,maxLength:hr,autoComplete:Ve},ui)]})},date:Mr,time:({item:Gn,onCompleteHandler:Wr,selectedAnswer:Ur,handleInputChange:Go,showQuestionPrefix:jo,errors:ci,isLoading:_i})=>{var Di;const{linkId:Ri,text:Ui,required:ui,prefix:ea,readOnly:Aa}=Gn,Dr=Ui?(0,a.nt)(jo,ea,Ui):"",nr=ci?.[Ri]||"";return(0,n.jsxs)("div",{children:[Dr&&(0,n.jsx)(N,{isLabel:!0,text:Dr,required:ui||!1}),(0,n.jsx)(s.Input,{isRequired:ui,size:"md",type:"time",id:Ri,"data-testid":Ri,"aria-label":Ri,placeholder:"Type your response here...",value:((Di=Ur?.[0])==null?void 0:Di.valueTime)||"",onChange:hr=>{Go(Gn,[{valueTime:hr}])},isDisabled:Aa||_i,onBlur:()=>{Wr(Gn.linkId)},hint:nr,isInvalid:!!nr},Ri)]})},dateTime:yr,quantity:Fo,decimal:R0,question:m0,display:m0,group:m0,reference:Gn=>{var Wr,Ur,Go,jo,ci;const{setHideFooterButton:_i}=(0,p.c)(),{item:Di,customErrorConfigurations:Ri}=Gn,Ui=Di.extension||[],ui=zs(Ui);return ui?(0,n.jsx)(is,{uiToolkitCode:ui,props:Gn}):((ci=(jo=(Go=(Ur=(Wr=Di?.extension)==null?void 0:Wr.find(Aa=>Aa.url.includes("questionnaire-itemControl")))==null?void 0:Ur.valueCodeableConcept)==null?void 0:Go.coding)==null?void 0:jo[0])==null?void 0:ci.code)==="check-box"?Di.answerOption&&Di.answerOption.length>0?(0,n.jsx)(Lo,ja(x0({},Gn),{item:Di})):(_i(!0),(0,n.jsx)(it,{configKey:Di.linkId,customErrorConfigurations:Ri})):null}};var O0=(Gn,Wr,Ur)=>new Promise((Go,jo)=>{var ci=Ri=>{try{Di(Ur.next(Ri))}catch(Ui){jo(Ui)}},_i=Ri=>{try{Di(Ur.throw(Ri))}catch(Ui){jo(Ui)}},Di=Ri=>Ri.done?Go(Ri.value):Promise.resolve(Ri.value).then(ci,_i);Di((Ur=Ur.apply(Gn,Wr)).next())});const F0=({item:Gn,selectedAnswer:Wr,showQuestionPrefix:Ur})=>{const{text:Go,prefix:jo,required:ci}=Gn,_i=Go?getUpdatedQuestionText(Ur,jo,Go):"",[Di,Ri]=useState(null),[Ui,ui]=useState(!1),{documentDownload:ea,webview:Aa}=useNativeBridge(),Dr=(Wr||[]).filter(Ce=>{var Ve,gt;return((Ve=Ce.valueAttachment)==null?void 0:Ve.data)&&((gt=Ce.valueAttachment)==null?void 0:gt.title)}).map((Ce,Ve)=>{var gt,qt,en,Pn,rr,bn,Xn;return{id:((gt=Ce.valueAttachment)==null?void 0:gt.id)||`preview-${Ve}`,fileName:((qt=Ce.valueAttachment)==null?void 0:qt.title)||`attachment-${Ve}`,contentType:((en=Ce.valueAttachment)==null?void 0:en.contentType)||"application/octet-stream",base64Data:((Pn=Ce.valueAttachment)==null?void 0:Pn.data)||"",size:getBase64Size(((rr=Ce.valueAttachment)==null?void 0:rr.data)||"",(bn=Ce.valueAttachment)==null?void 0:bn.contentType),type:getFileTypeFromMimeType((Xn=Ce.valueAttachment)==null?void 0:Xn.contentType)}}),nr=useCallback(Ce=>{const{fileName:Ve,contentType:gt,base64Data:qt}=Ce;if(Aa.isWithin)Ri({fileName:Ve,contentType:gt,base64Data:qt}),ui(!0);else{const en=base64toObjectUrl(qt,gt),Pn=document.createElement("a");Pn.href=en,Pn.download=Ve,document.body.appendChild(Pn),Pn.click(),document.body.removeChild(Pn),URL.revokeObjectURL(en)}},[Aa.isWithin]),hr=useCallback(()=>O0(void 0,null,function*(){!Di||(yield ea.writeFile(Di.fileName,prepareDataUrl(Di.base64Data,Di.contentType)))}),[Di,ea]),Pe=useCallback(()=>{ui(!1),Ri(null)},[]);return Dr.length?jsxs("div",{children:[_i&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:_i,required:ci||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:Dr.map(Ce=>jsx("button",{type:"button",onClick:()=>nr(Ce),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(Ce.fileName),size:Ce.size,type:Ce.type})},Ce.id))}),jsx(DownloadDisclosureModal,{opened:Ui,onClose:Pe,onDownload:hr,contentType:Di?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var Ft=Object.defineProperty,Ke=Object.defineProperties,ut=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertySymbols,Dn=Object.prototype.hasOwnProperty,sr=Object.prototype.propertyIsEnumerable,Pr=(Gn,Wr,Ur)=>Wr in Gn?Ft(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,S0=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))Dn.call(Wr,Ur)&&Pr(Gn,Ur,Wr[Ur]);if(Nt)for(var Ur of Nt(Wr))sr.call(Wr,Ur)&&Pr(Gn,Ur,Wr[Ur]);return Gn},H0=(Gn,Wr)=>Ke(Gn,ut(Wr));const K0=(Gn,Wr,Ur,Go)=>{var jo;const ci=Gn.extension||[];if(Go?.[BUTTON_TYPE_EXTERNAL_KEY]&&ci.some(ui=>ui.url===BUTTON_TYPE_EXTENSION_URL))return Go[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(Gn)||hasParentWithUIToolkitWidget(Gn,Wr))return null;if(Ur&&Gn.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const _i=getUIToolkitCode(ci),Di=ci.filter(ui=>ui.url.includes("questionnaire-itemControl")).flatMap(ui=>{var ea,Aa;return(Aa=(ea=ui.valueCodeableConcept)==null?void 0:ea.coding)!=null?Aa:[]})||[];let Ri;return Go&&(Ri=(jo=Di.find(ui=>ui.code&&Go[ui.code]))==null?void 0:jo.code),(Ri&&Go?Go[Ri]:void 0)||UI_TOOLKIT_WIDGET_MAP[_i||""]||typeToRenderFunctionMap[Gn.type]||null},ri=Gn=>{var Wr;const{item:Ur,selectedAnswer:Go,handleInputChange:jo,showQuestionPrefix:ci,errors:_i,questionnaireSchemaItems:Di,formData:Ri,isNestedRepeatedItem:Ui=!1}=Gn,{linkId:ui,text:ea,prefix:Aa,required:Dr,repeats:nr}=Ur,hr=getMaxOccursFromExtensions(Ur.extension),Pe=getPlaceholderFromExtensions(Ur.extension,Ur.type),[Ce,Ve]=useState(()=>{if(Ur.type==="group"&&Ur.item&&Ur.item.length>0){const xr=Ri?.filter(M0=>M0.linkId===Ur.linkId)||[];if(xr.length>0)return xr.map((M0,u0)=>u0)}else if(Go&&Go.length>0)return Go.map((xr,M0)=>M0);return[0]}),gt=hr!==void 0&&Ce.length>=hr,qt=ea?getUpdatedQuestionText(ci,Aa,ea):"",en=()=>{const xr=Math.max(...Ce,-1)+1,M0=[...Ce,xr];if(Ve(M0),Ur.type==="group"&&Ur.item&&Ur.item.length>0){const u0=Ur.item.map(_o=>({linkId:_o.linkId,text:_o.text,answer:[{}]})),J0={linkId:Ur.linkId,text:Ur.text,answer:[{}],item:u0};jo(Ur,void 0,[J0])}else{const u0=[...Go||[]];u0.push({}),jo(Ur,u0)}},Pn=xr=>{if(Ce.length<=1)return;const M0=Ce.filter((u0,J0)=>J0!==Ce.length-1);if(Ve(M0),Ur.type==="group"&&Ur.item&&Ur.item.length>0){const u0=[];if(Ri?.forEach((J0,_o)=>{J0.linkId===ui&&u0.push({item:J0,originalIndex:_o})}),xr>=0&&xr<u0.length){const J0=u0[xr],_o=Ri?.filter((ft,Vt)=>Vt!==J0.originalIndex);jo(Ur,void 0,_o,void 0,!0)}}else{const u0=Go?.filter((J0,_o)=>_o!==xr)||[];jo(Ur,u0.length>0?u0:[{}])}},rr=xr=>{if(!Ri||!Ur.item)return[];const M0=_o=>{const ft=[];for(const Vt of _o)if(Vt.linkId===Ur.linkId&&ft.push(Vt),Vt.item&&Vt.item.length>0){const cn=M0(Vt.item);ft.push(...cn)}return ft},J0=M0(Ri)[xr];return J0?.item?J0.item:[]},bn=(xr,M0)=>{if(isHiddenExtensionPresent(xr))return null;const u0=rr(M0);if(!isQuestionEnabledForInstance(xr.enableWhen,xr.enableBehavior,Ri||[],Ur.linkId,M0))return null;if(xr.repeats){const cn=findNestedAnswer(u0,xr.linkId),qn=H0(S0({},Gn),{item:xr,selectedAnswer:cn||[{}],errors:getInstanceErrors(_i,Ur,M0),handleInputChange:(tr,Jr,f0)=>jo(tr,Jr,f0,M0)});return jsx("div",{children:jsx(ri,H0(S0({},qn),{isNestedRepeatedItem:!0}))},xr.linkId)}if(xr.type==="group"&&xr.item&&!getUIToolkitCode(xr?.extension||[]))return jsxs("div",{children:[xr.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:xr.text}),jsx("div",{className:"space-y-3",children:xr.item.map(cn=>{if(!isQuestionEnabledForInstance(cn.enableWhen,cn.enableBehavior,Ri||[],Ur.linkId,M0))return null;const tr=K0(cn,Di,Gn.isLoading,Gn.externalComponentRenderMap);if(!tr)return null;const Jr=findNestedAnswer(u0,cn.linkId),f0=H0(S0({},Gn),{item:cn,selectedAnswer:Jr,placeholder:getPlaceholderFromExtensions(cn.extension,cn.type),errors:getInstanceErrors(_i,Ur,M0),handleInputChange:(vo,y0,G0)=>jo(vo,y0,G0,M0)});return createElement(tr,H0(S0({},f0),{key:cn.linkId}))})})]},xr.linkId);const _o=K0(xr,Di,Gn.isLoading,Gn.externalComponentRenderMap);if(!_o)return null;const ft=findNestedAnswer(u0,xr.linkId),Vt=H0(S0({},Gn),{item:xr,selectedAnswer:ft,placeholder:getPlaceholderFromExtensions(xr.extension,xr.type),errors:getInstanceErrors(_i,Ur,M0),handleInputChange:(cn,qn,tr)=>jo(cn,qn,tr,M0)});return createElement(_o,H0(S0({},Vt),{key:`${xr.linkId}-${M0}`}))},Xn=()=>{const xr=getDirectErrors(_i,ui);return jsxs("div",{className:"flex flex-col gap-2",children:[xr[ui]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:xr[ui]}),!gt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:en,className:"mt-4 text-center",isDisabled:Gn.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},un=xr=>Ce.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>Pn(xr),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${xr+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:Gn.isLoading}),dr=K0(Ur,Di,Gn.isLoading,Gn.externalComponentRenderMap);return hasRepeatingParent(Ur,Di)&&!Ui?null:!nr||nr&&hasCheckboxExtension(Ur)?dr?jsx(dr,H0(S0({},Gn),{placeholder:Pe,errors:{[Ur.linkId]:((Wr=_i?.[Ur.linkId])==null?void 0:Wr[0])||""}})):null:Ur.type==="group"&&Ur.item&&Ur.item.length>0&&Ur.repeats?jsxs("div",{"data-testid":`${ui}-repeating`,children:[qt&&jsx(FHIRQuestionnaireQuestionText,{text:qt,required:Dr||!1}),Ce.map(xr=>{var M0;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${xr>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",xr+1]}),un(xr)]}),jsx("div",{className:"space-y-4",children:(M0=Ur.item)==null?void 0:M0.map(u0=>bn(u0,xr))})]},`${ui}-instance-${xr}`)}),Xn()]}):dr?jsxs("div",{"data-testid":`${ui}-repeating`,children:[Ce.map(xr=>{const M0=Go?.[xr]?[Go[xr]]:void 0,u0=H0(S0({},Gn),{item:Ur,selectedAnswer:M0,errors:getInstanceErrors(_i,Ur,xr),handleInputChange:(J0,_o,ft)=>jo(J0,_o,ft,xr)});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 ",xr+1]}),un(xr)]}),jsx(dr,S0({},u0))]},`${ui}-instance-${xr}`)}),jsxs("div",{children:[(()=>{const M0=getDirectErrors(_i,ui)[ui];return M0&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:M0})})(),!gt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:en,className:"mt-4 text-center",isDisabled:Gn.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var Qo=Object.defineProperty,li=Object.defineProperties,Bi=Object.getOwnPropertyDescriptors,ha=Object.getOwnPropertySymbols,ra=Object.prototype.hasOwnProperty,va=Object.prototype.propertyIsEnumerable,Za=(Gn,Wr,Ur)=>Wr in Gn?Qo(Gn,Wr,{enumerable:!0,configurable:!0,writable:!0,value:Ur}):Gn[Wr]=Ur,os=(Gn,Wr)=>{for(var Ur in Wr||(Wr={}))ra.call(Wr,Ur)&&Za(Gn,Ur,Wr[Ur]);if(ha)for(var Ur of ha(Wr))va.call(Wr,Ur)&&Za(Gn,Ur,Wr[Ur]);return Gn},Wa=(Gn,Wr)=>li(Gn,Bi(Wr));const js=null,s1=({formId:Gn,questionnaireSchema:Wr,questionnaireResponseItem:Ur,errorConfig:Go,customErrorConfigurations:jo,showQuestionPrefix:ci=!0,isAdaptiveFlow:_i=!1,status:Di,hideBackButton:Ri=!1,showStepper:Ui=!1,onComplete:ui,onClearError:ea,handleHiddenQuestion:Aa,onGoBack:Dr,onFormDataChange:nr=()=>{},externalComponentRenderMap:hr,children:Pe})=>{var Ce,Ve;const{setHandleContinueButtonClick:gt,setHandleBackButtonClick:qt,setIsCurrentFormValid:en,setCurrentGroupLinkId:Pn,setCurrentGroupIndex:rr,setTotalSteps:bn,setHideFooterButton:Xn,setIsInlineNextQuestionTriggered:un,isCurrentFormValid:dr,currentGroupIndex:pr,isLoading:xr,hasCustomError:M0,groupItemIndicesRef:u0}=useFHIRQuestionnaire(),{trackEvent:J0}=useAnalytics(),{t:_o}=useUIToolkitTranslations(),[ft,Vt]=useState([]),[cn,qn]=useState(new Set),[tr,Jr]=useState([]),[f0,vo]=useState([]),y0=u0,G0=useRef(new Map),Oo=useRef(new Set),[Io,X0]=useState({}),[to,C0]=useState(!1),[v0,vi]=useState(Wr),ko=useRef(Ur||[]),Ti=useRef(!1),xi=useRef(!1),Oa=useMemo(()=>getTotalStepsFromQuestionnaire(Wr),[Wr]),[ba,e1]=useState(!1),Fs=useRef([]),Zi=(Zo,$o)=>{var ji,Wo,Qi,Da,wa;if(isCallNextQuestionExtensionPresent(Zo))return Zo.linkId;const es=validateCurrentPage($o,ft,pr,v0,y0),ka=y0.current[pr],Vs=pr+1,g1=y0.current[Vs],wl=pr===0?0:ka,ol=(Wo=g1??((ji=v0?.item)==null?void 0:ji.length))!=null?Wo:0;let Hl=-1;for(let fo=wl;fo<ol;fo++){const Vn=(Qi=v0?.item)==null?void 0:Qi[fo];if(Vn?.linkId===Zo.linkId){Hl=fo;break}}const Il=(fo,Vn=[])=>(fo.forEach(gi=>{var ki;if((!gi.enableWhen||isQuestionEnabled(gi.enableWhen,gi.enableBehavior,$o))&&isCallNextQuestionExtensionPresent(gi)&&!Fs.current.includes(gi.linkId))if(gi.required){const Ea=(ki=findResponseItem($o,gi.linkId))==null?void 0:ki.answer;(Ea&&Ea.length>0&&Object.keys(Ea[0]).length>0||gi.initial&&gi.initial.length>0&&!cn.has(gi.linkId))&&Vn.push(gi.linkId)}else Vn.push(gi.linkId);gi.item&&gi.item.length>0&&Il(gi.item,Vn)}),Vn),fu=[],ou=Hl!==-1?Hl+1:ol;for(let fo=wl;fo<ou;fo++){const Vn=(Da=v0?.item)==null?void 0:Da[fo];Vn&&Il([Vn],fu)}if(fu.length>0&&es){const fo=fu[fu.length-1],Vn=Ea=>Ea.flatMap(z1=>[z1,...z1.item?Vn(z1.item):[]]),gi=Vn((wa=v0?.item)!=null?wa:[]),ki=gi.findIndex(Ea=>Ea.linkId===fo),Qa=gi.findIndex(Ea=>Ea.linkId===Zo.linkId);return ki!==-1&&Qa>ki?void 0:fo}},M1=Zo=>Zi(Zo,ko.current)?!0:Zo.item&&Zo.item.length>0?Zo.item.some(M1):!1,Gs=()=>{var Zo;if(!_i||pr<0||!v0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const $o=y0.current[pr],Wo=(G0.current.get($o)||[$o]).some(wa=>{var es;const ka=(es=v0.item)==null?void 0:es[wa];return ka?M1(ka):!1}),Qi=pr<y0.current.length-1;let Da=!1;if(Wo&&Qi){const wa=pr+1,es=y0.current[wa],ka=(Zo=v0?.item)==null?void 0:Zo[es],Vs=!ka?.enableWhen||isQuestionEnabled(ka.enableWhen,ka.enableBehavior,ko.current),g1=ka?isPageExtensionPresent(ka):!1;Da=Vs&&g1}return{shouldTriggerInlineLoading:Wo,canNavigateToNextGroup:Da,hasMoreGroups:Qi}},ds=(Zo,$o,ji,Wo)=>{const Qi=getUpdatedFormData(v0?.item||[],ko.current,Zo,$o,ji,Wo);return ko.current=Qi,nr(Qi),Qi},W1=(Zo,$o,ji,Wo,Qi)=>{ds($o,ji,Wo,Qi),Wo.forEach(Da=>{const wa=getValidationError(Wa(os({},Zo),{linkId:Da.linkId}),ko.current,Da.answer,_o);wa&&X0(es=>Wa(os({},es),{[Da.linkId]:typeof Qi=="number"?Wa(os({},es[Da.linkId]),{[Qi]:wa}):wa}))})},Cr=(Zo,$o,ji,Wo,Qi)=>{var Da;const wa=ds($o,ji,Wo,Qi),es=(Da=findResponseItem(wa,$o))==null?void 0:Da.answer,ka=getValidationError(Zo,ko.current,es,_o);X0(Vs=>Wa(os({},Vs),{[$o]:typeof Qi=="number"?Wa(os({},Vs[$o]),{[Qi]:ka}):ka}))},Qn=(Zo,$o)=>{const ji=validateCurrentPage($o,ft,pr,v0,y0);if(en(ji),v0?.item){const Wo=validateAllItemsRecursively(v0.item,$o,_o);if(Object.keys(Wo).length>0)X0(Qi=>os(os({},Qi),Wo));else{const Qi=v0.item,Da={},wa=es=>{es.forEach(ka=>{Da[ka.linkId]={},ka.item&&wa(ka.item)})};wa(Qi),X0(es=>os(os({},es),Da))}}},Br=(Zo,$o,ji,Wo,Qi=!1)=>{var Da;const{linkId:wa}=Zo;if(Qi)return ko.current=ji||[],Qn(wa,ji||[]),ko.current;if(ji&&ji.length>0&&Zo.type==="group"&&Zo.repeats){let g1=ko.current.length;for(let ol=ko.current.length-1;ol>=0;ol--)if(ko.current[ol].linkId===wa){g1=ol+1;break}const wl=[...ko.current.slice(0,g1),...ji,...ko.current.slice(g1)];return ko.current=wl,Qn(wa,wl),ko.current}if(typeof Wo=="number"&&$o){const g1=hasRepeatingParent(Zo,v0?.item||[]);if(g1){const wl=ko.current.filter(Hl=>Hl.linkId===g1.linkId);if(Wo<wl.length){const Hl=ko.current.map(Il=>{if(Il.linkId===g1.linkId&&ko.current.slice(0,ko.current.indexOf(Il)).filter(ou=>ou.linkId===g1.linkId).length===Wo){const ou=(gi,ki)=>{const Qa=new Map(gi.map(z1=>[z1.linkId,z1])),Ea=[];return ki?.forEach(z1=>{const fl=Qa.get(z1.linkId);if(z1.linkId===wa)Ea.push(os({linkId:z1.linkId,text:z1.text,answer:$o},fl?.item&&{item:fl.item}));else if(fl)if(z1.item&&z1.item.length>0){const Ul=ou(fl.item||[],z1.item);Ea.push(Wa(os({},fl),{item:Ul}))}else Ea.push(fl);else if(z1.item&&z1.item.length>0){const Ul=ou([],z1.item);Ul.some(v1=>v1.linkId===wa||v1.item&&fo(v1.item,wa))&&Ea.push({linkId:z1.linkId,text:z1.text,answer:[{}],item:Ul})}Qa.delete(z1.linkId)}),Qa.forEach(z1=>{Ea.push(z1)}),Ea},fo=(gi,ki)=>gi.some(Qa=>Qa.linkId===ki||Qa.item&&fo(Qa.item,ki)),Vn=ou(Il.item||[],g1.item);return Wa(os({},Il),{item:Vn})}return Il});ko.current=Hl,nr(Hl)}else{const Hl=Wo+1,Il=wl.length;if(Il<Hl||Hl===1){const fu=[],ou=(gi,ki,Qa)=>gi.map(Ea=>{const z1={linkId:Ea.linkId,text:Ea.text,answer:Ea.linkId===ki?Qa:[{}]};return Ea.item&&Ea.item.length>0&&(z1.item=ou(Ea.item,ki,Qa)),z1});for(let gi=Il;gi<Hl;gi++){const ki=g1.item?ou(g1.item,wa,$o):[],Qa={linkId:g1.linkId,text:g1.text,answer:[{}],item:ki};fu.push(Qa)}let fo=ko.current.length;for(let gi=ko.current.length-1;gi>=0;gi--)if(ko.current[gi].linkId===g1.linkId){fo=gi+1;break}const Vn=[...ko.current.slice(0,fo),...fu,...ko.current.slice(fo)];ko.current=Vn,nr(Vn)}}const ol=getValidationError(Zo,ko.current,$o,_o);return X0(Hl=>Wa(os({},Hl),{[wa]:typeof Wo=="number"?Wa(os({},Hl[wa]),{[Wo]:ol}):ol})),Qn(wa,ko.current),ko.current}}if(typeof Wo=="number")return ji&&ji.length>0?W1(Zo,wa,$o,ji,Wo):Cr(Zo,wa,$o,ji,Wo),ko.current;const es=ds(wa,$o,ji),ka=(Da=findResponseItem(es,wa))==null?void 0:Da.answer,Vs=getValidationError(Zo,es,ka,_o);return X0(g1=>Wa(os({},g1),{[wa]:typeof Wo=="number"?Wa(os({},g1[wa]),{[Wo]:Vs}):Vs})),Qn(wa,es),ko.current},fr=()=>{var Zo;for(let $o=pr+1;$o<y0.current.length;$o++){const ji=y0.current[$o],Wo=(Zo=v0?.item)==null?void 0:Zo[ji];if(!!Wo&&(!Wo.enableWhen||isQuestionEnabled(Wo.enableWhen,Wo.enableBehavior,ko.current)))return!0}return!1},qr=()=>{var Zo,$o,ji,Wo,Qi;const Da=(Zo=Wr?.item)==null?void 0:Zo[y0.current[pr]];if(Da){const ka=($o=getAnalyticsEventName(Da))!=null?$o:"questionnaire_form",Vs=getAnalyticsPageName(Da);if(Vs){const g1=(ji=getAnalyticsFormName(Wr))!=null?ji:Wr.name,wl=collectAnalyticsProperties(Da,ko.current),ol={};g1&&(ol.form_name=g1),ol.page_name=Vs,Object.assign(ol,wl),J0(ka,ol)}}const wa=pr<y0.current.length-1,es=checkCurrentStepDataMatch(ko.current,v0,y0.current,pr,Ur,y0.current.length-1);if(_i&&wa){const ka=pr+1,Vs=y0.current[ka],g1=(Wo=v0?.item)==null?void 0:Wo[Vs],wl=!g1?.enableWhen||isQuestionEnabled(g1.enableWhen,g1.enableBehavior,ko.current),ol=g1?isPageExtensionPresent(g1):!1;if(wl&&ol&&es){rr(ka),en(!1),window.scrollTo(0,0);return}}if(es&&y0.current.length>0){fr()?rr(pr+1):(ui(removeDisabledItems(ko.current,v0?.item||[])),en(!1),window.scrollTo(0,0));return}if(pr<y0.current.length-1){const ka=(Qi=v0?.item)==null?void 0:Qi[y0.current[pr]];if(!ka){ui(removeDisabledItems(ko.current,v0?.item||[]));return}const Vs=ka.linkId,g1=findLastGroupInstanceIndex(ko.current,Vs),wl=ko.current.slice(0,g1+1);if(!validateCurrentPage(wl,ft,pr,v0,y0))return;_i?(ko.current=wl,nr(wl),ui(ko.current),en(!1)):y0.current.length>0&&(fr()?rr(pr+1):(ui(removeDisabledItems(ko.current,v0?.item||[])),window.scrollTo(0,0)))}else ui(removeDisabledItems(ko.current,v0?.item||[])),en(!1),window.scrollTo(0,0)};useEffect(()=>{var Zo;gt(()=>qr),qt(()=>ni),en(dr);const $o=(Zo=v0?.item)==null?void 0:Zo[y0.current[pr]];$o&&Pn($o.linkId)},[dr,pr]),useEffect(()=>{if(!Wr?.item)return;const{groupIndices:Zo,itemsToRenderMap:$o}=collectGroupItemIndices(Wr.item);y0.current=Zo,G0.current=$o;const ji=Oa??Zo.length;bn(ji),Jr(Zo),_i?(xi.current||rr(Zo.length>0?Zo.length-1:0),un(!1),xi.current=!1):pr===-1&&rr(0)},[Wr?.item,Oa]),useEffect(()=>{if(pr<0||!v0?.item)return;const Zo=validateCurrentPage(ko.current,ft,pr,v0,y0);if(!Zo){en(!1);return}const{shouldTriggerInlineLoading:$o,canNavigateToNextGroup:ji,hasMoreGroups:Wo}=Gs();if(_i&&$o){if(!Wo){en(!1);return}if(ji&&Zo){en(!0);return}else{en(!1);return}}en(Zo)},[pr,v0?.item,M0,_i,ko.current,ft]),useEffect(()=>{if(!Wr?.item||Ti.current)return;const Zo=initializeQuestionnaireItems(Wr.item,ko.current,Wr.item,ko.current);if(Zo!==ko.current){ko.current=Zo;const ji=(Qi=>{const Da=new Set,wa=es=>{es.forEach(ka=>{var Vs;const g1=ka.initial&&ka.initial.length>0,wl=(ka.type==="choice"||ka.type==="open-choice")&&((Vs=ka.answerOption)==null?void 0:Vs.some(ol=>ol.initialSelected===!0));(g1||wl)&&(!ka.enableWhen||isQuestionEnabled(ka.enableWhen,ka.enableBehavior,ko.current))&&Da.add(ka.linkId),ka.item&&wa(ka.item)})};return wa(Qi),Da})(v0?.item||[]);qn(ji);const Wo=validateAllItemsRecursively(v0?.item||[],ko.current,_o);Object.keys(Wo).length>0&&X0(Qi=>os(os({},Qi),Wo))}Ti.current=!0},[v0?.item,Wr,_o]),useEffect(()=>{vi(Wr)},[Wr]),useEffect(()=>{pr>=0&&window.scrollTo(0,0)},[pr]),useEffect(()=>{var Zo;if(!_i||ft.length===0||xr||!v0?.item)return;const $o=y0.current[pr];if($o===void 0)return;const ji=G0.current.get($o)||[$o],Wo=[];if(ji.forEach(ka=>{var Vs;const g1=(Vs=v0?.item)==null?void 0:Vs[ka];g1&&hasInitialValue(g1)&&Wo.push(g1)}),Wo.length===0||!Wo.some(ka=>Zi(ka,ko.current)&&!Fs.current.includes(ka.linkId)?(Fs.current.push(ka.linkId),!0):!1))return;const Da=validateCurrentPage(ko.current,ft,pr,v0,y0),wa=(Zo=v0?.item)==null?void 0:Zo[$o],es=isHiddenAnswerInValid(wa,ko.current);!Da||es||(Oo.current.add(pr),un(!0),xi.current=!0,$0(Wo[Wo.length-1].linkId))},[pr,ft,_i,xr,v0]);const $0=(Zo,$o=!1,ji=!1)=>{var Wo;if($o){ui(removeDisabledItems(ko.current,v0?.item||[]),ji),en(!1);return}const Qi=findQuestionByLinkId(v0?.item||[],Zo);if(!Qi)return;const Da=(Wo=findResponseItem(ko.current,Zo))==null?void 0:Wo.answer;if(getValidationError(Qi,ko.current,Da,_o))return;const wa=getUpdatedFormData(v0?.item||[],ko.current,Zo,Da),es=Zi(Qi,wa);if(!es)return;en(!1);const ka=findRootGroupLinkId(v0?.item||[],Zo);let Vs=wa,g1=[];const wl=deepTrimFormData(wa,es,v0?.item||[]);Vs=wl.trimmedData,g1=wl.trimmedLinkIds;const ol=findQuestionByLinkId(v0?.item||[],ka||"");ko.current=Vs;const Hl=findGroupPositionByLinkId(v0?.item||[],Zo||""),Il=Hl!==-1?Hl:pr;if(validateCurrentPage(Vs,ft,Il,v0,y0,g1)&&!isHiddenAnswerInValid(ol,Vs)){un(!0),xi.current=!0;let ou;const fo=(()=>{var ki;const Qa=r1=>r1.flatMap(v1=>[v1,...v1.item?Qa(v1.item):[]]),Ea=Qa((ki=v0?.item)!=null?ki:[]),z1=Ea.findIndex(r1=>r1.linkId===es),fl=new Set;let Ul=!0;for(;Ul;){Ul=!1;for(const r1 of Ea){if(fl.has(r1.linkId)||!r1.enableWhen)continue;r1.enableWhen.some(b1=>{const Z1=Ea.findIndex(Bl=>Bl.linkId===b1.question);return Z1!==-1&&Z1<=z1||fl.has(b1.question)})&&(fl.add(r1.linkId),Ul=!0)}}return g1.filter(r1=>!fl.has(r1))})();fo.length>0&&(ou=removeItemsFromSchema(v0?.item||[],fo),vi(Wa(os({},v0),{item:ou})));const gi=((ki,Qa)=>{const Ea=[];let z1=!1;const fl=Ul=>{for(const r1 of Ul)z1?(Ea.push(r1.linkId),r1.item&&fl(r1.item)):r1.linkId===Qa?z1=!0:r1.item&&fl(r1.item)};return fl(ki),Ea})(v0?.item||[],es);gi.length>0&&(Fs.current=Fs.current.filter(ki=>!gi.includes(ki)),qn(ki=>{const Qa=new Set(ki);return gi.forEach(Ea=>Qa.delete(Ea)),Qa})),Fs.current.push(es),ui(removeDisabledItems(Vs,v0?.item||[]),!0,ou)}},Y0=(Zo,$o,ji=!1)=>{const Wo=updateItemWithReadOnlyExpression(Zo,v0),Qi={item:Wo,selectedAnswer:$o,handleInputChange:Br,showQuestionPrefix:ci,onCompleteHandler:$0,errors:Io,isLoading:xr,isCurrentFormValid:dr,contained:v0?.contained,questionnaireSchemaItems:v0?.item,customErrorConfigurations:jo,formData:ko.current,showStepper:Ui,totalStepsFromExtension:Oa,externalComponentRenderMap:hr,hintText:getHintTextFromExtensions(Wo.extension)};if(typeof Aa=="function"&&ji)Aa(Zo,Qi,ko.current);else if(Zo.type in typeToRenderFunctionMap&&!ji)return ft.includes(Zo.linkId)||Vt(Da=>[...Da,Zo.linkId]),jsx(RenderFHIRQuestionnaireItem,os({},Qi),Zo.linkId);return null},wt=Zo=>Zo.map($o=>{var ji,Wo;const Qi=isHiddenExtensionPresent($o);let Da=(ji=findResponseItem(ko.current,$o.linkId))==null?void 0:ji.answer;if((!Da||Object.keys((Wo=Da?.[0])!=null?Wo:{}).length===0)&&!cn.has($o.linkId)){if($o.initial&&$o.initial.length>0)Da=$o.initial,qn(wa=>new Set(wa).add($o.linkId));else if(($o.type==="choice"||$o.type==="open-choice")&&$o.answerOption){const wa=$o.answerOption.filter(es=>es.initialSelected===!0);wa.length>0&&(Da=wa.map(es=>{let ka={};return es.valueCoding?ka={valueCoding:{code:es.valueCoding.code,display:es.valueCoding.display,system:es.valueCoding.system}}:es.valueReference&&(ka={valueReference:{reference:es.valueReference.reference,display:es.valueReference.display}}),ka}).filter(es=>Object.keys(es).length>0),qn(es=>new Set(es).add($o.linkId)))}Da&&(ko.current=getUpdatedFormData(v0?.item||[],ko.current,$o.linkId,Da))}if(!$o?.enableWhen||isQuestionEnabled($o?.enableWhen,$o.enableBehavior,ko.current)){const wa=js.includes($o.linkId)||getUIToolkitCode($o.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[Y0($o,Da,Qi),$o.item&&!Qi&&(wa?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:wt($o.item)})}):wt($o.item))]},$o.linkId)}else if($o.type==="group"&&!Qi)return f0.includes($o.linkId)||(Oa===void 0&&bn(y0.current.length-1||-1),y0.current=y0.current.filter((wa,es)=>es!==pr),vo(wa=>[...wa,$o.linkId])),null});if(pr>=0){const Zo=[];let $o=0,ji=0;for(;$o<tr.length&&ji<y0.current.length;){const Wo=tr[$o],Qi=y0.current[ji];if(Wo<Qi){const Da=(Ce=v0?.item)==null?void 0:Ce[Wo];(!Da?.enableWhen||isQuestionEnabled(Da.enableWhen,Da.enableBehavior,ko.current))&&Zo.push($o),$o++}else Wo===Qi&&$o++,ji++}for(;$o<tr.length;){const Wo=tr[$o],Qi=(Ve=v0?.item)==null?void 0:Ve[Wo];(!Qi?.enableWhen||isQuestionEnabled(Qi.enableWhen,Qi.enableBehavior,ko.current))&&Zo.push($o),$o++}if(Zo.length>0){Oa===void 0&&bn(y0.current.length+Zo.length),Zo.reverse().forEach(Qi=>{const Da=tr[Qi];let wa=0;for(let es=0;es<y0.current.length;es++){if(y0.current[es]>Da){wa=es;break}wa=es+1}y0.current.splice(wa,0,Da)});const Wo=Zo.map(Qi=>{var Da;const wa=tr[Qi],es=(Da=v0?.item)==null?void 0:Da[wa];return es?.linkId}).filter(Boolean);vo(Qi=>Qi.filter(Da=>!Wo.includes(Da)))}tr.forEach(Wo=>{var Qi;const Da=(Qi=v0?.item)==null?void 0:Qi[Wo];Da?.enableWhen&&!isQuestionEnabled(Da.enableWhen,Da.enableBehavior,ko.current)&&ko.current.some(es=>es.linkId===Da.linkId)&&(ko.current=removeAnswerFromFormData(ko.current,Da.linkId))})}const ni=()=>{var Zo;if(Go&&!to&&pr>0&&Di!=="completed")rr(y0.current.length-1),C0(!0),Xn(!1),ea?.();else if(pr>0&&Di!=="completed"){let $o=pr-1;for(;$o>0;){const ji=y0.current[$o],Wo=(Zo=v0?.item)==null?void 0:Zo[ji];if(!Wo?.enableWhen||isQuestionEnabled(Wo.enableWhen,Wo.enableBehavior,ko.current))break;$o--}rr($o),en(!0),Xn(!1),ea?.()}else Dr?.()},Ci=Zo=>Zo.preventDefault();return useEffect(()=>{const Zo=setTimeout(()=>{e1(!0)},0);return()=>clearTimeout(Zo)},[]),ba?jsxs(Fragment,{children:[jsxs("form",{id:Gn,className:"w-full","data-testid":"questionnaire-form",onSubmit:Ci,children:[!Ri&&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:()=>ni(),onKeyDown:Zo=>{(Zo.key==="Enter"||Zo.key===" ")&&ni()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Go&&!to?jsx(EmptyState,{className:"mt-5xl",title:Go.title,description:Go.description,featuredIconProps:{icon:Go.icon,color:"gray"},primaryButton:Go.primaryButton,secondaryButton:Go.secondaryButton?Wa(os({},Go.secondaryButton),{onClick:ni}):void 0}):jsxs(Fragment,{children:[!v0?.item&&xr&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),v0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:wt(pr>=0?v0.item.filter((Zo,$o)=>{const ji=y0.current[pr];return(G0.current.get(ji)||[ji]).includes($o)}):v0?.item||[])})]})]}),Ti.current&&Pe]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Y,l,e)=>{"use strict";e.d(l,{l:()=>h});var n=e(31085),t=e(14041),r=e(36087),s=e(1053),o=e(25624),i=e(18522),a=Object.defineProperty,g=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,m=(p,f,b)=>f in p?a(p,f,{enumerable:!0,configurable:!0,writable:!0,value:b}):p[f]=b,d=(p,f)=>{for(var b in f||(f={}))E.call(f,b)&&m(p,b,f[b]);if(u)for(var b of u(f))A.call(f,b)&&m(p,b,f[b]);return p},O=(p,f)=>g(p,c(f));const v=({selected:p,onClick:f,icon:b,title:M,description:x,readOnly:z})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",p?"bg-utility-accent-500/20":"bg-gray-100",p?"text-accent-800":"text-quaternary"),children:b}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:M})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:x})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",z?"cursor-not-allowed":"cursor-pointer",z?"border-gray-200 bg-white":p?"border-blue-700 bg-white":"border-gray-100 bg-white",!z&&!p&&"hover:border-gray-400");return z?(0,n.jsx)("div",{className:S,children:T}):(0,n.jsx)("button",{type:"button",onClick:f,className:S,"aria-pressed":!!p,children:T})},h=({item:p,handleInputChange:f,formData:b,isLoading:M})=>{const{incrementCustomErrorCount:x,decrementCustomErrorCount:z}=(0,i.c)(),T=(0,t.useMemo)(()=>{var w;return(w=p.item)!=null?w:[]},[p.item]),S=p.readOnly===!0,C=(0,t.useMemo)(()=>T.filter(w=>!w.enableWhen||(0,o.GN)(w.enableWhen,w.enableBehavior,b??[])),[T,b]),y=(0,t.useMemo)(()=>T.filter(w=>w.enableWhen&&!(0,o.GN)(w.enableWhen,w.enableBehavior,b??[])),[T,b]),R=w=>{var N,V;if(!b)return!1;const q=(0,o.MU)(b,w);return((V=(N=q?.answer)==null?void 0:N[0])==null?void 0:V.valueBoolean)===!0},P=(0,t.useMemo)(()=>C.some(w=>R(w.linkId)),[C,b]),L=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||C.length===0){L.current&&(z(),L.current=!1);return}!P&&!L.current?(x(),L.current=!0):P&&L.current&&(z(),L.current=!1)},[P,S,C.length,x,z]),(0,t.useEffect)(()=>{y.forEach(w=>{var N,V;const q=b?(0,o.MU)(b,w.linkId):void 0;(!q||((V=(N=q.answer)==null?void 0:N[0])==null?void 0:V.valueBoolean)!==!1)&&f(w,[{valueBoolean:!1}])})},[y]),(0,t.useEffect)(()=>()=>{L.current&&z()},[]);const D=w=>{const N=R(w.linkId);f(w,[{valueBoolean:!N}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},M?{inert:""}:{}),{children:C.map(w=>{var N,V,q,I;const k=R(w.linkId),U=(N=w.extension)==null?void 0:N.find(se=>se.url===s.g4),F=(V=w.extension)==null?void 0:V.find(se=>se.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(q=F?.valueString)!=null?q:"";return(0,n.jsx)(v,{icon:K?(0,n.jsx)(K,{className:"h-6 w-6"}):void 0,title:(I=w.text)!=null?I:"",description:G,selected:k,readOnly:S,onClick:S?void 0:()=>D(w)},w.linkId)})}))}},72866:(Y,l,e)=>{"use strict";e.d(l,{v:()=>i});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const o=({selected:a,onClick:g,label:c,readOnly:u})=>{const E=(0,r.cx)("rounded-sm border-2 px-3 py-2 text-sm font-medium transition-colors",u?"cursor-default":"cursor-pointer",a?"border-brand bg-brand-50 text-primary":"border-secondary bg-primary text-secondary",!u&&!a&&"hover:border-tertiary");return u?(0,n.jsx)("div",{className:E,children:c}):(0,n.jsx)("button",{type:"button",onClick:g,className:E,"aria-pressed":!!a,children:c})},i=({item:a,handleInputChange:g,formData:c})=>{var u;const E=(u=a.item)!=null?u:[],A=a.readOnly===!0,m=O=>{var v,h;if(!c)return!1;const p=(0,s.MU)(c,O);return((h=(v=p?.answer)==null?void 0:v[0])==null?void 0:h.valueBoolean)===!0},d=O=>{const v=m(O.linkId);g(O,[{valueBoolean:!v}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[a.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(a.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:E.map(O=>{var v;const h=m(O.linkId);return(0,n.jsx)(o,{label:(v=O.text)!=null?v:"",selected:h,readOnly:A,onClick:A?void 0:()=>d(O)},O.linkId)})})]})}},65735:(Y,l,e)=>{"use strict";e.d(l,{d:()=>s});var n=e(31085),t=e(36087),r=e(1053);const s=({item:o})=>{var i,a,g,c;const u=o.text||"",E=(a=(i=o.extension)==null?void 0:i.find(d=>d.url===r.rz))==null?void 0:a.valueString,A=(c=(g=o.extension)==null?void 0:g.find(d=>d.url===r.g4))==null?void 0:c.valueString,m=A?r.JP[A]:void 0;return(0,n.jsxs)("div",{className:"bg-primary flex items-start gap-4 rounded-lg px-4 py-6 shadow-sm","data-testid":o.linkId,children:[m&&(0,n.jsx)(t.FeaturedIcon,{icon:m,color:"brand",size:"lg",className:"text-accent-600 size-14"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-primary text-lg font-semibold",children:u}),E&&(0,n.jsx)("p",{className:"text-secondary text-sm",children:E})]})]})}},18522:(Y,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),o=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,E=(h,p,f)=>p in h?o(h,p,{enumerable:!0,configurable:!0,writable:!0,value:f}):h[p]=f,A=(h,p)=>{for(var f in p||(p={}))c.call(p,f)&&E(h,f,p[f]);if(g)for(var f of g(p))u.call(p,f)&&E(h,f,p[f]);return h},m=(h,p)=>i(h,a(p));const d=(0,t.createContext)(void 0),O=()=>{const h=(0,t.useContext)(d);if(!h)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return h},v=({children:h,analyticsConfig:p})=>{const{trackEvent:f}=useAnalytics(),[b,M]=useState(null),[x,z]=useState(null),[T,S]=useState(!1),[C,y]=useState(null),[R,P]=useState(-1),[L,D]=useState(!1),[w,N]=useState(-1),[V,q]=useState(!1),[I,k]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),se=useRef([]),oe=()=>{k(ne=>ne+1)},te=useCallback(ne=>{F(ne)},[]),pe=()=>{k(ne=>Math.max(0,ne-1))},be=I>0,Se=useCallback((ne,ae,me)=>{if(!p)return;const he=p[ne];if(!he)return;let ce;if(Array.isArray(he))if(me)ce=he.find(Ee=>Ee.inputType===me);else{console.warn(`Multiple analytics configs found for linkId "${ne}" but no inputType provided. Skipping tracking.`);return}else{if(me&&he.inputType&&he.inputType!==me)return;ce=he}if(!ce)return;let ue=A({},ae);ce.valueTransform&&(ue=Object.keys(ae).reduce((Ee,De)=>{var ze;const Ie=(ze=ce.valueTransform)==null?void 0:ze[De];return Ee[De]=Ie?applyValueTransform(ae[De],Ie):ae[De],Ee},{}));let re=A({},ue);ce.propertyMapping&&(re=Object.keys(ue).reduce((Ee,De)=>{var ze;const Ie=((ze=ce.propertyMapping)==null?void 0:ze[De])||De;return Ee[Ie]=ue[De],Ee},{}));const J=ce.eventName,ve=ce.description;f(J,m(A(A({},re),ce.properties),{_event_metadata:ve?{description:ve}:void 0}))},[p,f]),ge={isCurrentFormValid:T,currentGroupLinkId:C,currentGroupIndex:R,hideFooterButton:L,totalSteps:w,isLoading:V,isInlineNextQuestionTriggered:K,hasCustomError:be,analyticsConfig:p,hasExternalError:U,handleContinueButtonClick:b,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:y,setCurrentGroupIndex:P,setHideFooterButton:D,setTotalSteps:N,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:oe,decrementCustomErrorCount:pe,trackQuestionnaireEvent:Se,setHasExternalError:te,groupItemIndicesRef:se};return jsx(d.Provider,{value:ge,children:h})}},35473:(Y,l,e)=>{"use strict";var n=e(32957),t=e(18522),r=e(78912),s=e.n(r);e.o(r,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return r.BWELL_STORED_TOKENS_KEY}}),e.o(r,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return r.LocationPermissionEnum}}),e.o(r,"LocationType")&&e.d(l,{LocationType:function(){return r.LocationType}}),e.o(r,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return r.SchedulingLocationCard}}),e.o(r,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return r.formatPhoneNumber}}),e.o(r,"getInitials")&&e.d(l,{getInitials:function(){return r.getInitials}}),e.o(r,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return r.removeAfterLastComma}}),e.o(r,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return r.shouldForceLogoutAfterAuthFailure}}),e.o(r,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return r.unformatPhoneNumber}}),e.o(r,"useDebounce")&&e.d(l,{useDebounce:function(){return r.useDebounce}}),e.o(r,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return r.useDeviceDetection}}),e.o(r,"useRedirect")&&e.d(l,{useRedirect:function(){return r.useRedirect}}),e.o(r,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return r.useSearchQueryParams}});var o=e(25624),i=e(1053),a=e(7630),g=e(72866),c=e(65735)},61388:(Y,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:o,onActionButtonClick:i,title:a,infoDetails:g})=>(0,n.jsxs)("div",{className:"bg-primary py-2xl px-lg rounded-2xl shadow-sm",children:[(0,n.jsxs)("div",{className:"gap-lg mb-2xl flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-primary text-md font-semibold",children:a}),o&&i&&(0,n.jsx)(t.Button,{color:"link-color",onClick:i,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:o})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Y,l,e)=>{"use strict";e.d(l,{d:()=>o});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const o=({infoDetails:i,className:a})=>{const{redirectToBook:g,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),E=(d,O,v)=>{d.preventDefault(),O.linkType==="phone"?g(v):O.linkType==="address"?c({address:v}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},A=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},m=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:v=>E(v,O,d),className:"text-md text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary text-left font-normal! wrap-anywhere underline underline-offset-2",children:A(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:A(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",a),children:i.map((d,O)=>{const v=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(v,{className:"text-fg-secondary"}),size:"lg",color:"gray"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-tertiary m-0 mb-1 text-sm",children:d.label}),(()=>{const h=Array.isArray(d.value)?d.value:[d.value];return h.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:h.map((p,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(p,d)},f))}):m(h[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.d});var n=e(97257),t=e(71428),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},33180:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.InfoCardDetails});var n=e(3203);e.o(n,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return n.BWELL_STORED_TOKENS_KEY}}),e.o(n,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return n.LocationPermissionEnum}}),e.o(n,"LocationType")&&e.d(l,{LocationType:function(){return n.LocationType}}),e.o(n,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return n.SchedulingLocationCard}}),e.o(n,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return n.formatPhoneNumber}}),e.o(n,"getInitials")&&e.d(l,{getInitials:function(){return n.getInitials}}),e.o(n,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return n.removeAfterLastComma}}),e.o(n,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return n.shouldForceLogoutAfterAuthFailure}}),e.o(n,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return n.unformatPhoneNumber}}),e.o(n,"useDebounce")&&e.d(l,{useDebounce:function(){return n.useDebounce}}),e.o(n,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return n.useDeviceDetection}}),e.o(n,"useRedirect")&&e.d(l,{useRedirect:function(){return n.useRedirect}}),e.o(n,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return n.useSearchQueryParams}})},27163:(Y,l,e)=>{"use strict";e.d(l,{InfoCard:()=>n.n});var n=e(61388),t=e(79286),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(33180);e.o(s,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return s.BWELL_STORED_TOKENS_KEY}}),e.o(s,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return s.LocationPermissionEnum}}),e.o(s,"LocationType")&&e.d(l,{LocationType:function(){return s.LocationType}}),e.o(s,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return s.SchedulingLocationCard}}),e.o(s,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return s.formatPhoneNumber}}),e.o(s,"getInitials")&&e.d(l,{getInitials:function(){return s.getInitials}}),e.o(s,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return s.removeAfterLastComma}}),e.o(s,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return s.shouldForceLogoutAfterAuthFailure}}),e.o(s,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return s.unformatPhoneNumber}}),e.o(s,"useDebounce")&&e.d(l,{useDebounce:function(){return s.useDebounce}}),e.o(s,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return s.useDeviceDetection}}),e.o(s,"useRedirect")&&e.d(l,{useRedirect:function(){return s.useRedirect}}),e.o(s,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return s.useSearchQueryParams}})},98549:(Y,l,e)=>{"use strict";var n=e(31085);const t=({currentStep:r,totalSteps:s})=>jsx(Stack,{"data-testid":"stepper",width:"100%",children:jsx(LinearProgress,{"aria-label":`Progress bar showing step ${r} of ${s}`,sx:{height:"2px",backgroundColor:"rgba(0,0,0,0.1)","& .MuiLinearProgress-bar":{backgroundColor:"accessibility.info",borderRadius:2}},value:r/s*100,variant:"determinate"})})},26877:(Y,l,e)=>{"use strict";e.d(l,{J:()=>M});var n=e(31085),t=e(14041);const r=({size:x=24,color:z="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:x,height:x,stroke:z,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...T},t.createElement("path",{d:"M3.413 10.745c-.595-.232-.893-.348-.98-.515a.5.5 0 0 1 0-.461c.087-.167.385-.283.98-.515L20.3 2.664c.537-.21.806-.315.978-.258a.5.5 0 0 1 .316.316c.057.172-.048.44-.258.977l-6.59 16.888c-.232.595-.348.893-.515.98a.5.5 0 0 1-.462 0c-.167-.088-.282-.385-.514-.98l-2.628-6.759a1.075 1.075 0 0 0-.107-.232.5.5 0 0 0-.116-.117 1.069 1.069 0 0 0-.232-.106l-6.759-2.628Z"}));r.displayName="NavigationPointer01";var s=e(8322),o=e(76808),i=e(92094),a=e(5380),g=e(54783),c=e(53151),u=e(85449),E=Object.defineProperty,A=Object.defineProperties,m=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,h=(x,z,T)=>z in x?E(x,z,{enumerable:!0,configurable:!0,writable:!0,value:T}):x[z]=T,p=(x,z)=>{for(var T in z||(z={}))O.call(z,T)&&h(x,T,z[T]);if(d)for(var T of d(z))v.call(z,T)&&h(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),b=(x,z,T)=>new Promise((S,C)=>{var y=L=>{try{P(T.next(L))}catch(D){C(D)}},R=L=>{try{P(T.throw(L))}catch(D){C(D)}},P=L=>L.done?S(L.value):Promise.resolve(L.value).then(y,R);P((T=T.apply(x,z)).next())});const M=({setLocationUpdating:x,title:z,description:T,isOpen:S,onClose:C})=>{const{locationPermission:y,position:R,requestPosition:P,setLocationPermission:L}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:w,setQueryParams:N}=(0,g.i)(),[V,q]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),k=S!==void 0?S:V;(0,t.useEffect)(()=>{(k||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,k,D]);const U=(0,t.useCallback)(be=>{N(f(p({},w),{location:be,locationType:a.iF.CURRENT_LOCATION,locationPermission:y||""}))},[y,w,N]),F=(0,t.useCallback)(()=>{S===void 0&&(!y||[a.Ef.GRANTED].includes(y)&&I.get()||[a.Ef.PROMPT].includes(y)&&I.get()&&R||q([a.Ef.PROMPT,a.Ef.GRANTED].includes(y)))},[S,y,I,R]);(0,t.useEffect)(()=>{F()},[F]);const K=(0,o.Ul)(),G=(0,t.useCallback)(()=>b(void 0,null,function*(){x&&x(!0);let be;try{be=yield P(),be&&U&&U(`${be.coords.latitude},${be.coords.longitude}`)}catch(Se){Se instanceof Error?K?.error(Se,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Se)}`),S!==void 0&&C?C():q(!1)}return x&&x(!1),!!be}),[K,U,P,x,S,C]),se=(0,t.useCallback)(()=>b(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&C?C():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,C,I,G]),oe=(0,t.useCallback)(be=>{D("location_permissions_cta_clicked",{click:be==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),L(a.Ef.DENIED),N(f(p({},w),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&C?C():q(!1)},[D,L,N,w,I,S,C]),te=(0,t.useCallback)(()=>oe("close"),[oe]),pe=(0,t.useCallback)(()=>oe("cancel"),[oe]);return(0,n.jsx)(i.Modal,{id:"location-modal",isOpen:k,className:"sm:max-w-md",title:{content:z,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:te},primaryButton:{children:"Use my current location",onClick:se},secondaryButton:{children:"Search another way",onClick:pe}})}},35471:(Y,l,e)=>{"use strict";var n=e(26877)},98741:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(E,A,m)=>A in E?r(E,A,{enumerable:!0,configurable:!0,writable:!0,value:m}):E[A]=m,g=(E,A)=>{for(var m in A||(A={}))o.call(A,m)&&a(E,m,A[m]);if(s)for(var m of s(A))i.call(A,m)&&a(E,m,A[m]);return E};const c=E=>{if(!E||typeof E!="object")throw new Error("Invalid animation data");const A=m=>{if(!m||typeof m!="object")return m;if(Array.isArray(m))return m.map(A);const d=g({},m);delete d.ef,delete d.expr,typeof d.x=="string"&&delete d.x;for(const O in d)typeof d[O]=="object"&&(d[O]=A(d[O]));return d};return A(E)},u=({animationData:E,loop:A=!0,autoplay:m=!0,className:d=""})=>{const O=useRef(null),v=useRef(null);return useEffect(()=>{if(!!O.current){try{const h=c(E);v.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:h})}catch(h){console.error("Failed to load Lottie animation:",h)}return()=>{var h;(h=v.current)==null||h.destroy()}}},[E,A,m]),jsx("div",{ref:O,className:d})}},81304:(Y,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const o=E=>E*1609.34;var i=e(27419);const a={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var g=e(92469);const c=({center:E,isLoading:A=!1,searchRadius:m,className:d,height:O="350px",width:v="100%",googleMapsApiKey:h})=>{const p=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:h||""}),b={height:typeof O=="number"?`${O}px`:O,width:typeof v=="number"?`${v}px`:v},M=(0,t.useCallback)(z=>{google.maps.event.addListenerOnce(z,"idle",()=>{if(m&&E.lat&&E.lng){const S=new google.maps.Circle({center:{lat:E.lat,lng:E.lng},radius:o(m)}).getBounds();S&&z.fitBounds(S,0)}})},[E,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,i.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:p("LOADING_MAP")})});if(!E.lat||!E.lng)return(0,n.jsx)("div",{className:(0,i.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:p("UNABLE_TO_LOAD_MAP_NO_LOCATION")})});const x={clickableIcons:!1,disableDefaultUI:!0,disableDoubleClickZoom:!0,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:a.gray50}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:a.gray100}]},{featureType:"water",elementType:"geometry",stylers:[{color:a.blue100}]}]};return(0,n.jsx)("div",{className:(0,i.cx)("overflow-hidden rounded-lg",d),children:(0,n.jsx)(r.u6,{center:{lat:E.lat,lng:E.lng},mapContainerStyle:b,onLoad:M,options:x,zoom:12,children:(0,n.jsx)(g.I,{center:E})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Y,l,e)=>{"use strict";e.d(l,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(92469)},92469:(Y,l,e)=>{"use strict";e.d(l,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:s})=>typeof s?.lat=="number"&&typeof s?.lng=="number"&&!isNaN(s.lat)&&!isNaN(s.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:s.lat,lng:s.lng}}):null},43743:(Y,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:i,profileUrl:a,subTitle:g,variant:c="default",showChevron:u=!0,onClick:E,pendingText:A})=>{const m=!!A,d=!m&&!!E,O=u&&d;return jsxs("button",{type:"button",onClick:d?E:void 0,disabled:!d,className:cx("bg-primary border-primary flex w-full items-center justify-between gap-3 rounded-lg border p-4 text-left",c==="compact"&&"rounded-xl p-3",!O&&"justify-start",d?"cursor-pointer":"cursor-default",m&&"opacity-60"),children:[jsx(Avatar,{src:a,alt:i,size:"md",initials:getInitials(i),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:i}),m?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),A]}):jsx("span",{className:"text-secondary text-sm",children:g})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},o=()=>jsx("div",{className:"bg-primary border-primary animate-pulse items-center justify-between rounded-lg border p-4",children:jsxs("div",{className:"flex items-center space-x-4",children:[jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300"}),jsxs("div",{className:"flex-1 space-y-2",children:[jsx("div",{className:"h-4 w-3/4 rounded bg-gray-300"}),jsx("div",{className:"h-3 w-1/2 rounded bg-gray-300"})]})]})})},4062:(Y,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:o,fullImageHeader:i=!1,header:a,title:g})=>jsx("div",{className:"tw-preflight gap-lg flex h-full w-full items-center justify-center",children:jsxs("div",{className:"max-w-16xl flex h-fit w-full flex-col items-center justify-center self-center overflow-hidden rounded-2xl",children:[i?a:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:a}),jsxs("div",{className:"gap-lg p-sm md:pb-2xl h-fit w-full md:p-[55px]",children:[jsxs("div",{className:"text-center",children:[jsx("h1",{className:"font-display text-primary mb-md px-5 text-3xl leading-[38px] font-normal tracking-tight",children:g}),o&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:o})]}),s]})]})}),r=null},51254:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:o,icon:i})=>{var a;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:i.icon,color:(a=i.color)!=null?a:"brand",size:"lg",className:i.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),o&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:o})]})]})}},69092:()=>{},33457:(Y,l,e)=>{"use strict";var n=e(51254),t=e(69092),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},77057:(Y,l,e)=>{"use strict";e.d(l,{i:()=>Qe});var n=e(31085),t=e(36087),r=e(14041);const s=({size:Ye=24,color:Dt="currentColor",...pn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Ye,height:Ye,stroke:Dt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...pn},r.createElement("path",{d:"M9.5 7h5m-5 4h5m-5 4h5m3.5 6V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C16.48 3 15.92 3 14.8 3H9.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C6 4.52 6 5.08 6 6.2V21m14 0H4"}));s.displayName="Building04";var o=e(14449),i=e(14711),a=e(58139),g=e(37121),c=e(43144);function u(Ye){Ye()}let E=null;const A=Ye=>E=Ye,m=()=>E,d=(0,r.createContext)(null),O=null;function v(){return(0,r.useContext)(d)}let p=()=>{throw new Error("uSES not initialized!")};const f=Ye=>{p=Ye},b=(Ye,Dt)=>Ye===Dt;function M(Ye=d){const Dt=Ye===d?v:()=>(0,r.useContext)(Ye);return function(zn,et=b){const{store:xt,subscription:Xt,getServerState:Wn}=Dt(),zr=p(Xt.addNestedSub,xt.getState,Wn||xt.getState,zn,et);return(0,r.useDebugValue)(zr),zr}}const x=M();var z=e(75985),T=e(524);function S(){const Ye=getBatch();let Dt=null,pn=null;return{clear(){Dt=null,pn=null},notify(){Ye(()=>{let zn=Dt;for(;zn;)zn.callback(),zn=zn.next})},get(){let zn=[],et=Dt;for(;et;)zn.push(et),et=et.next;return zn},subscribe(zn){let et=!0,xt=pn={callback:zn,next:null,prev:pn};return xt.prev?xt.prev.next=xt:Dt=xt,function(){!et||Dt===null||(et=!1,xt.next?xt.next.prev=xt.prev:pn=xt.prev,xt.prev?xt.prev.next=xt.next:Dt=xt.next)}}}}const C={notify(){},get:()=>[]};function y(Ye,Dt){let pn,zn=C;function et(mr){return zr(),zn.subscribe(mr)}function xt(){zn.notify()}function Xt(){Ln.onStateChange&&Ln.onStateChange()}function Wn(){return Boolean(pn)}function zr(){pn||(pn=Dt?Dt.addNestedSub(Xt):Ye.subscribe(Xt),zn=S())}function hn(){pn&&(pn(),pn=void 0,zn.clear(),zn=C)}const Ln={addNestedSub:et,notifyNestedSubs:xt,handleChangeWrapper:Xt,isSubscribed:Wn,trySubscribe:zr,tryUnsubscribe:hn,getListeners:()=>zn};return Ln}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",P=null,L=null;let D=null;const w=Ye=>{D=Ye},N=null,V=null,q=Ye=>{try{return JSON.stringify(Ye)}catch{return String(Ye)}};function I(Ye,Dt,pn){useIsomorphicLayoutEffect(()=>Ye(...Dt),pn)}function k(Ye,Dt,pn,zn,et,xt){Ye.current=zn,pn.current=!1,et.current&&(et.current=null,xt())}function U(Ye,Dt,pn,zn,et,xt,Xt,Wn,zr,hn,Ln){if(!Ye)return()=>{};let mr=!1,wn=null;const Zr=()=>{if(mr||!Wn.current)return;const It=Dt.getState();let Fe,ot;try{Fe=zn(It,et.current)}catch(Je){ot=Je,wn=Je}ot||(wn=null),Fe===xt.current?Xt.current||hn():(xt.current=Fe,zr.current=Fe,Xt.current=!0,Ln())};return pn.onStateChange=Zr,pn.trySubscribe(),Zr(),()=>{if(mr=!0,pn.tryUnsubscribe(),pn.onStateChange=null,wn)throw wn}}const F=()=>N;function K(Ye,Dt){return Ye===Dt}let G=!1;function se(Ye,Dt,pn,{pure:zn,areStatesEqual:et=K,areOwnPropsEqual:xt=shallowEqual,areStatePropsEqual:Xt=shallowEqual,areMergedPropsEqual:Wn=shallowEqual,forwardRef:zr=!1,context:hn=ReactReduxContext}={}){const Ln=hn,mr=mapStateToPropsFactory(Ye),wn=mapDispatchToPropsFactory(Dt),Zr=mergePropsFactory(pn),n0=Boolean(Ye);return Fe=>{const ot=Fe.displayName||Fe.name||"Component",Je=`Connect(${ot})`,tt={shouldHandleStateChanges:n0,displayName:Je,wrappedComponentName:ot,WrappedComponent:Fe,initMapStateToProps:mr,initMapDispatchToProps:wn,initMergeProps:Zr,areStatesEqual:et,areStatePropsEqual:Xt,areOwnPropsEqual:xt,areMergedPropsEqual:Wn};function rt(st){const[le,ye,Ue]=useMemo(()=>{const{reactReduxForwardedRef:Cn}=st,gn=_objectWithoutPropertiesLoose(st,L);return[st.context,Cn,gn]},[st]),Te=useMemo(()=>le&&le.Consumer&&isContextConsumer(React.createElement(le.Consumer,null))?le:Ln,[le,Ln]),zt=useContext(Te),Yt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),vn=Boolean(zt)&&Boolean(zt.store),$n=Yt?st.store:zt.store,Ar=vn?zt.getServerState:$n.getState,Wt=useMemo(()=>defaultSelectorFactory($n.dispatch,tt),[$n]),[we,Ze]=useMemo(()=>{if(!n0)return V;const Cn=createSubscription($n,Yt?void 0:zt.subscription),gn=Cn.notifyNestedSubs.bind(Cn);return[Cn,gn]},[$n,Yt,zt]),At=useMemo(()=>Yt?zt:_extends({},zt,{subscription:we}),[Yt,zt,we]),jt=useRef(),Qt=useRef(Ue),nn=useRef(),Hn=useRef(!1),Vr=useRef(!1),Rt=useRef(!1),Ct=useRef();useIsomorphicLayoutEffect(()=>(Rt.current=!0,()=>{Rt.current=!1}),[]);const bt=useMemo(()=>()=>nn.current&&Ue===Qt.current?nn.current:Wt($n.getState(),Ue),[$n,Ue]),kt=useMemo(()=>gn=>we?U(n0,$n,we,Wt,Qt,jt,Hn,Rt,nn,Ze,gn):()=>{},[we]);I(k,[Qt,jt,Hn,Ue,nn,Ze]);let mn;try{mn=D(kt,bt,Ar?()=>Wt(Ar(),Ue):bt)}catch(Cn){throw Ct.current&&(Cn.message+=`
|
|
872
872
|
The error may be correlated with this previous error:
|
package/native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1139.0",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.14.2"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1390.0",D="@icanbwell/composite. repo version: 0.1390.0",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icanbwell/composite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1139.0",
|
|
4
4
|
"author": "icanbwell",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -43,6 +43,6 @@
|
|
|
43
43
|
"optional": true
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"repoVersion": "0.
|
|
47
|
-
"description": "@icanbwell/composite. repo version: 0.
|
|
46
|
+
"repoVersion": "0.1390.0",
|
|
47
|
+
"description": "@icanbwell/composite. repo version: 0.1390.0"
|
|
48
48
|
}
|