@icanbwell/composite 1.1162.0 → 1.1162.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/native.js +1 -1
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -866,7 +866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
866
866
  <div class="wrapper">
867
867
  <bwell-error-component />
868
868
  </div>
869
- `}}customElements.get(ve)===void 0&&customElements.define(ve,xe);const we=[{name:"loader",defaultElement:document.createElement(ne)},{name:"error",defaultElement:document.createElement(ve)}],ze=["error","loading"],De={error:"error",loading:"loader"},Se=({src:At,elementNameSuffix:Tt,version:Yt,prefetchFeatureApp:zt})=>(0,g.__awaiter)(void 0,void 0,void 0,function*(){var Ye,Ke,It,nt,et,Zt,Tn,On,at,Wt,Bt,An,Gn,rn,Ln;window.bwell||(window.bwell=new le({metadata:{version:Yt}}));const nr=`bwell-${Tt}`;if(customElements.get(nr)!==void 0)return;class In extends h{constructor(){super(),Ye.add(this),Ke.set(this,(0,T.nanoid)()),It.set(this,void 0),nt.set(this,document.createElement("feature-app-loader")),et.set(this,new k.EventEmitter),Zt.set(this,void 0),Tn.set(this,void 0),On.set(this,void 0),at.set(this,void 0),Wt.set(this,void 0),Bt.set(this,void 0),this.attachShadow({mode:"open"});const Vr=new ce(we).attachToShadowRoot(this.shadowRoot);Vr.addEventListener("visibilitychange",({visibility:Dt,container:Fe,name:rt})=>{rt==="error"&&Dt==="visible"&&window.bwell._registerEmbeddableContent(Fe),(0,g.__classPrivateFieldGet)(this,nt,"f").style.display=Dt==="hidden"?"unset":"hidden"}),(0,g.__classPrivateFieldSet)(this,Bt,{slots:Vr,attributes:new V().bindTo(this),loaderEventEmitter:(0,g.__classPrivateFieldGet)(this,et,"f")},"f"),(0,g.__classPrivateFieldSet)(this,Zt,(0,g.__classPrivateFieldGet)(this,Ye,"m",An).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,Tn,(0,g.__classPrivateFieldGet)(this,Ye,"m",Gn).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,On,(0,g.__classPrivateFieldGet)(this,Ye,"m",Ln).call(this,"error"),"f"),(0,g.__classPrivateFieldSet)(this,at,(0,g.__classPrivateFieldGet)(this,Ye,"m",Ln).call(this,"loading"),"f")}connectedCallback(){return(0,g.__awaiter)(this,void 0,void 0,function*(){(0,g.__classPrivateFieldGet)(this,On,"f").call(this,(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get("error")),(0,g.__classPrivateFieldGet)(this,at,"f").call(this,(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get("loading")),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.addEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,Tn,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.addChangeListener("error",(0,g.__classPrivateFieldGet)(this,On,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.addChangeListener("loading",(0,g.__classPrivateFieldGet)(this,at,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}(0,g.__classPrivateFieldSet)(this,Ke,this.id||(0,g.__classPrivateFieldGet)(this,Ke,"f"),"f"),(0,g.__classPrivateFieldSet)(this,It,new x((0,g.__classPrivateFieldGet)(this,Ke,"f")),"f"),(0,g.__classPrivateFieldGet)(this,It,"f").registerDispatcher(Vr=>this.dispatchEvent(Vr)),window.bwell.isInitialized?(0,g.__classPrivateFieldGet)(this,Zt,"f").call(this):(window.bwell.once("initialized",(0,g.__classPrivateFieldGet)(this,Zt,"f")),window.bwell.once("error",()=>{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}),zt&&(0,M.h)(At).catch(()=>{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}))})}disconnectedCallback(){var Vr;(0,g.__classPrivateFieldGet)(this,et,"f").emit("disconnect"),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.removeEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,Tn,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.removeChangeListener("error",(0,g.__classPrivateFieldGet)(this,On,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.removeChangeListener("loading",(0,g.__classPrivateFieldGet)(this,at,"f")),(Vr=(0,g.__classPrivateFieldGet)(this,It,"f"))===null||Vr===void 0||Vr.deregister(),(0,g.__classPrivateFieldGet)(this,et,"f").removeAllListeners()}}Ke=new WeakMap,It=new WeakMap,nt=new WeakMap,et=new WeakMap,Zt=new WeakMap,Tn=new WeakMap,On=new WeakMap,at=new WeakMap,Wt=new WeakMap,Bt=new WeakMap,Ye=new WeakSet,An=function(){(0,g.__classPrivateFieldGet)(this,nt,"f").setAttribute("featureAppId",`bwell-embeddable:${nr}`),(0,g.__classPrivateFieldGet)(this,nt,"f").setAttribute("src",At),(0,g.__classPrivateFieldGet)(this,nt,"f").config={id:(0,g.__classPrivateFieldGet)(this,Ke,"f"),name:Tt,elementName:nr,utils:(0,g.__classPrivateFieldGet)(this,Bt,"f")},this.shadowRoot.appendChild((0,g.__classPrivateFieldGet)(this,nt,"f"))},Gn=function({visibility:Vr,name:Dt}){(0,g.__classPrivateFieldGet)(this,nt,"f").style.display=Vr==="hidden"?"unset":"hidden"},rn=function(Vr){(0,g.__classPrivateFieldGet)(this,Wt,"f")(),(0,g.__classPrivateFieldSet)(this,Wt,void 0,"f")},Ln=function(Vr){return Dt=>{const Fe=ze.findIndex(Ze=>Ze===Vr);if(!ze.slice(0,Fe).some(Ze=>(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get(Ze)!==null)){if(Dt!==null)(0,g.__classPrivateFieldGet)(this,Wt,"f")&&(0,g.__classPrivateFieldGet)(this,Ye,"m",rn).call(this,Vr),(0,g.__classPrivateFieldSet)(this,Wt,(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlotLocked(De[Vr]),"f");else if(Dt===null&&(0,g.__classPrivateFieldGet)(this,Wt,"f")){(0,g.__classPrivateFieldGet)(this,Ye,"m",rn).call(this,Vr);const Ze=ze.find(Qe=>(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get(Qe)!==null);Ze&&(0,g.__classPrivateFieldSet)(this,Wt,(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlotLocked(De[Ze]),"f")}}}},customElements.define(nr,In)}),We={rE:"1.1162.0"},ot="composite";var ht=e(67321);Se({src:`https://embeddables.prod.icanbwell.com/${ot}/${We.rE}/scripts/embeddable.federated.js`,elementNameSuffix:ot,version:We.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),a=Object.defineProperty,i=Object.defineProperties,b=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,m=(M,h,f)=>h in M?a(M,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):M[h]=f,p=(M,h)=>{for(var f in h||(h={}))u.call(h,f)&&m(M,f,h[f]);if(c)for(var f of c(h))y.call(h,f)&&m(M,f,h[f]);return M},d=(M,h)=>i(M,b(h));const O=(M,h,f)=>{const v=_.cloneDeep(M);if(!v.contained||h<0)return v;const A=v.contained.findIndex(z=>z.resourceType==="Questionnaire");if(A!==-1&&!f){const z=v.contained[A];if(z.item){if(!z.item.some(C=>isPageExtensionPresent(C)))return v;let T=0,S=z.item.length;for(let C=0;C<z.item.length;C++){const E=z.item[C];if(isPageExtensionPresent(E)){if(T===h+1){S=C;break}T++}}z.item=z.item.slice(0,S),v.contained[A]=z}}else f&&A!==-1&&(v.contained[A]=d(p({},v.contained[A]),{item:f}));return v},g=({formId:M,questionnaireResponse:h,showQuestionPrefix:f,nextQuestion:v,onGoBack:A,handleHiddenQuestion:z,errorConfig:x,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:P,className:L,children:D})=>{var N,w,V;const{currentGroupIndex:k,hasCustomError:I}=useFHIRQuestionnaire(),q=(N=h.questionnaire)==null?void 0:N.replace("#",""),U=(w=h?.contained)==null?void 0:w.find(X=>X.id===q&&X.resourceType==="Questionnaire"),$=(X,G,ae)=>{let re=_.cloneDeep(h);re.item=X,re=trimQuestionnaireItems(re,k,ae),v(re,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,L),children:jsx(FHIRQuestionnaire,{formId:M,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:f,errorConfig:x,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:$,onGoBack:A,onClearError:T,handleHiddenQuestion:z,showStepper:C,hideBackButton:E,externalComponentRenderMap:P,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),a=e(56192),i=e(76808),b=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(A,z,x)=>z in A?c(A,z,{enumerable:!0,configurable:!0,writable:!0,value:x}):A[z]=x,g=(A,z)=>{for(var x in z||(z={}))p.call(z,x)&&O(A,x,z[x]);if(m)for(var x of m(z))d.call(z,x)&&O(A,x,z[x]);return A},M=(A,z)=>u(A,y(z)),h=(A,z,x)=>new Promise((T,S)=>{var C=P=>{try{R(x.next(P))}catch(L){S(L)}},E=P=>{try{R(x.throw(P))}catch(L){S(L)}},R=P=>P.done?T(P.value):Promise.resolve(P.value).then(C,E);R((x=x.apply(A,z)).next())});const f=10,v=({id:A="location-filter-desktop",initialValue:z,onInputChange:x,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:E,errorText:R})=>{const P=(0,i.Ul)(),{i18n:{t:L},loading:D}=(0,b.E_)({keys:["shared-translations"]}),N=z?.placeId,w=z?.description,[V,k]=(0,t.useState)(""),[I,q]=(0,t.useState)(""),[U,$]=(0,t.useState)(null),[X,G]=(0,t.useState)(null),[ae,re]=(0,t.useState)(!1),J=(0,t.useRef)(!1),ce=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ge,Ae]=(0,t.useState)(ce),[be,oe]=(0,t.useState)(ce),[ue,{loading:me,error:de}]=(0,a.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[fe,{loading:le,error:ne}]=(0,a.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[te,{loading:ve,error:xe}]=(0,a.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Ae(ce)},onCompleted:Yt=>{var zt,Ye;const Ke=(Ye=(zt=Yt.placeAutocomplete)==null?void 0:zt.predictions)==null?void 0:Ye.map(It=>{var nt;return{id:It.placeId,label:(0,s.removeAfterLastComma)(It.description),mainText:It?.mainText||((nt=It.description.split(",")[0])==null?void 0:nt.trim()),secondaryText:(0,s.removeAfterLastComma)(It?.secondaryText||It.description.split(",").slice(1).join(",").trim())}});Ae(Ke?.length?Ke:ce)}}),we=(0,t.useMemo)(()=>ge.map(Yt=>M(g({},Yt),{displayLabel:(0,r.RZ)(Yt?.label||"",V)})),[V,ge]),ze=Yt=>h(void 0,null,function*(){var zt,Ye,Ke,It,nt,et,Zt,Tn,On,at,Wt,Bt,An,Gn,rn,Ln;if($(Yt),G(Yt),re(!1),Yt&&typeof Yt=="string"){const nr=ge.find(Qe=>Qe.id===Yt),In=nr?.label||V;if(!nr)return;k(In),q(In),setTimeout(()=>{const Qe=[{id:nr.id,label:nr.label}];Ae(Qe),oe(Qe)},f);const Ur=yield ue({variables:{placeId:Yt}}),Vr=(Ye=(zt=Ur?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ye.latitude,Dt=(It=(Ke=Ur?.data)==null?void 0:Ke.geocodingByPlaceId)==null?void 0:It.longitude,Fe=((et=(nt=Ur?.data)==null?void 0:nt.geocodingByPlaceId)==null?void 0:et.zipCode)||"",rt=((Tn=(Zt=Ur?.data)==null?void 0:Zt.geocodingByPlaceId)==null?void 0:Tn.state)||"",Ze=((at=(On=Ur?.data)==null?void 0:On.geocodingByPlaceId)==null?void 0:at.stateCode)||"";if(Vr&&Dt)if(!Fe||!Ze){const Qe=yield fe({variables:{latitude:String(Vr),longitude:String(Dt)}}),Je=((Bt=(Wt=Qe?.data)==null?void 0:Wt.geocodingByLatLon)==null?void 0:Bt.zipCode)||"",lt=((Gn=(An=Qe?.data)==null?void 0:An.geocodingByLatLon)==null?void 0:Gn.state)||"",Ct=((Ln=(rn=Qe?.data)==null?void 0:rn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Vr,longitude:Dt,zipCode:Je,state:lt,stateCode:Ct,placeId:Yt,description:In,value:Yt})}else T({latitude:Vr,longitude:Dt,zipCode:Fe,state:rt,stateCode:Ze,placeId:Yt,description:In,value:Yt});else re(!0)}}),De=()=>!0,Se=(0,s.useDebounce)(Yt=>h(void 0,null,function*(){return yield te({variables:{input:Yt,types:"geocode"}})})),We=Yt=>h(void 0,null,function*(){if(re(!1),k(Yt),x?.(Yt),!Yt||Yt.trim().length===0){$(null),Ae(ce),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Yt});return}const zt=Yt.trim();zt.length>=2?yield Se(zt):Ae(ce)}),ot=Yt=>{J.current=Yt},ht=()=>{k(I),Ae(be),$(X)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var zt,Ye,Ke,It,nt,et,Zt,Tn,On,at,Wt,Bt,An,Gn,rn,Ln;if(N&&w){Ae([{id:N,label:V||w}]),oe([{id:N,label:V||w}]),$(N),G(N),k(w),q(w),w===V&&k(w);const nr=yield ue({variables:{placeId:N}}),In=(Ye=(zt=nr?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ye.latitude,Ur=(It=(Ke=nr?.data)==null?void 0:Ke.geocodingByPlaceId)==null?void 0:It.longitude,Vr=((et=(nt=nr?.data)==null?void 0:nt.geocodingByPlaceId)==null?void 0:et.zipCode)||"",Dt=((Tn=(Zt=nr?.data)==null?void 0:Zt.geocodingByPlaceId)==null?void 0:Tn.state)||"",Fe=((at=(On=nr?.data)==null?void 0:On.geocodingByPlaceId)==null?void 0:at.stateCode)||"";if(In&&Ur)if(!Vr||!Dt||!Fe){const rt=yield fe({variables:{latitude:String(In),longitude:String(Ur)}}),Ze=((Bt=(Wt=rt?.data)==null?void 0:Wt.geocodingByLatLon)==null?void 0:Bt.zipCode)||"",Qe=((Gn=(An=rt?.data)==null?void 0:An.geocodingByLatLon)==null?void 0:Gn.state)||"",Je=((Ln=(rn=rt?.data)==null?void 0:rn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:In,longitude:Ur,zipCode:Ze,state:Qe,stateCode:Je,placeId:N,description:w,value:N})}else T({latitude:In,longitude:Ur,zipCode:Vr,state:Dt,stateCode:Fe,placeId:N,description:w,value:N})}else $(null),G(null),k(""),q(""),Ae(ce),oe(ce)}))()},[]);const At=ae||!!de||!!ne||!!xe||!!R,Tt=At?R||L("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||le||D)},[E,me,le,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:A,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||le,placeholder:L("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:we,selectedKey:U,onSelectionChange:ze,onInputChange:We,defaultFilter:De,onOpenChange:ot,onBlur:ht,isInvalid:At,hint:Tt,autoComplete:"address-line1",className:"w-full",children:Yt=>{const zt=Yt,Ye=V.trim().length>=2,Ke=zt.mainText||"",It=zt.secondaryText||"",nt=Ke.trim().length>0,et=It.trim().length>0,Zt=nt?(0,r.RZ)(Ke,V):{beforePart:"",highlightedPart:"",remainingPart:""},Tn=et?(0,r.RZ)(It,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:zt.id,supportingText:zt.supportingText,isDisabled:zt.isDisabled,icon:zt.icon,avatarUrl:zt.avatarUrl,textValue:zt.label,children:Ye&&nt?(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:Zt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Zt.highlightedPart}),(0,n.jsx)("span",{children:Zt.remainingPart})]}),et&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:Tn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Tn.highlightedPart}),(0,n.jsx)("span",{children:Tn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:zt.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:a})=>{const{isSmallScreen:i}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${i?"-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 ${i?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[a,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 a=({className:i})=>{const{pathname:b}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:m,i18n:{t:p}}=useI18nChild({keys:["shared"]}),d=getPathSegments(b).flatMap(O=>{const g=c.getId(O),M=c.getRouteMeta(g)||{},h=getBreadcrumbTitleKey(g,M,u);if(!h||M.breadcrumbHide)return[];const f=y[g];let v=c.getHref(g),A=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:g,search:f.search})),f.titleKey&&(A=f.titleKey)),[{routeId:g,href:v,label:p(A),onClick:f?.onClick}]});return m||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",i),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),a=e(5380),i=e(87896),b=e(26877);const c=(E,R)=>new Promise((P,L)=>setTimeout(()=>L(new Error(R)),E)),u=(E,R,P)=>Promise.race([E,c(R,P)]),y=5e3,m=1e4;var p=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(E,R,P)=>R in E?p(E,R,{enumerable:!0,configurable:!0,writable:!0,value:P}):E[R]=P,v=(E,R)=>{for(var P in R||(R={}))M.call(R,P)&&f(E,P,R[P]);if(g)for(var P of g(R))h.call(R,P)&&f(E,P,R[P]);return E},A=(E,R)=>d(E,O(R)),z=(E,R,P)=>new Promise((L,D)=>{var N=k=>{try{V(P.next(k))}catch(I){D(I)}},w=k=>{try{V(P.throw(k))}catch(I){D(I)}},V=k=>k.done?L(k.value):Promise.resolve(k.value).then(N,w);V((P=P.apply(E,R)).next())});const x={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:E})=>{var R;const{mobileOS:P}=(0,r.useDeviceDetection)(),L=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,i.useSearchQueryParams)(),V=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,q]=(0,t.useState)(!1),[U,$]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[X,G]=(0,t.useState)(),[ae,re]=(0,t.useState)(!1),J=(0,t.useCallback)(ve=>{$(ve);try{w(A(v({},k.current),{locationPermission:ve||a.Ef.UNAVAILABLE}))}catch(xe){xe instanceof Error?L?.error(xe,"Failed to update query params"):L?.error(`Failed to update query params - ${JSON.stringify(xe)}`)}},[w,L]),ce=(0,t.useCallback)(()=>z(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]),ge=(0,t.useCallback)(ve=>z(void 0,null,function*(){const xe=D.getCurrentPosition(ve).then(we=>{if(!we||!we.coords)throw new Error("Location data is invalid or unavailable");return we});try{return yield u(xe,y,"Location request timed out. Please check that location services are enabled.")}catch(we){throw we instanceof Error&&L?.error(we,"Geolocation timeout or error"),we}}),[D,L]),Ae=(0,t.useCallback)(()=>z(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),be=(0,t.useCallback)(()=>z(void 0,null,function*(){return u(D.requestPermission(),m,"Permission request timed out - user did not respond to permission dialog")}),[D]),oe=(0,t.useCallback)(()=>z(void 0,null,function*(){try{if(!(yield ce()))return L?.error("Location services not available"),!1;const xe=yield Ae();return xe!==a.Ef.GRANTED&&xe!==a.Ef.PROMPT?(L?.error(`Location permission not granted: ${xe}`),!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}}),[ce,L,Ae]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>z(void 0,null,function*(){const xe=N.locationPermission;if(xe===a.Ef.DENIED||xe===a.Ef.BLOCKED||xe===a.Ef.UNAVAILABLE){$(xe);return}q(!0);try{if(!(yield ce())){J(a.Ef.UNAVAILABLE);return}if(xe===a.Ef.GRANTED){try{const De=yield Ae();if(De===a.Ef.GRANTED){const Se=yield ge(x);Se&&(G(Se),J(a.Ef.GRANTED))}else De===a.Ef.PROMPT?(J(De),re(!0)):J(De)}catch(De){De instanceof Error?L?.error(De,"Error getting initial location with granted permission"):L?.error(`Error getting initial location with granted permission - ${JSON.stringify(De)}`),J(a.Ef.UNAVAILABLE)}return}const ze=yield Ae();if(J(ze),ze===a.Ef.GRANTED)try{const De=yield ge(x);De?G(De):J(a.Ef.UNAVAILABLE)}catch(De){De instanceof Error?L?.error(De,"Error getting initial location"):L?.error(`Error getting initial location - ${JSON.stringify(De)}`),J(a.Ef.UNAVAILABLE)}else ze===a.Ef.PROMPT&&re(!0)}catch(we){we instanceof Error?L?.error(we,"Error initializing location permission"):L?.error(`Error initializing location permission - ${JSON.stringify(we)}`),J(a.Ef.UNAVAILABLE)}finally{q(!1)}}))()},[]);const ue=(0,t.useCallback)(()=>z(void 0,null,function*(){try{if(!(yield oe())){J(a.Ef.UNAVAILABLE);return}q(!0);let xe=yield Ae();if(J(xe),xe===a.Ef.GRANTED||xe===a.Ef.PROMPT){if(P==="Android"&&xe===a.Ef.GRANTED)try{xe=yield be(),J(xe)}catch(we){we instanceof Error?L?.error(we,"Error re-requesting Android permission"):L?.error(`Error re-requesting Android permission - ${JSON.stringify(we)}`);return}if(xe!==a.Ef.UNAVAILABLE){const we=yield ge(x);return G(we),we}}return}catch(ve){J(a.Ef.UNAVAILABLE),ve instanceof Error?L?.error(ve,"Error refreshing location"):L?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{q(!1)}}),[oe,L,P,J,ge,Ae,be]),me=(0,t.useCallback)(()=>z(void 0,null,function*(){try{return(yield ce())?yield Ae():a.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location permission"):L?.error(`Error checking location permission - ${JSON.stringify(ve)}`),a.Ef.UNAVAILABLE}}),[ce,L,Ae]),de=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield ce())){J(a.Ef.UNAVAILABLE);return}const xe=yield Ae();J(xe)}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)}`),J(a.Ef.UNAVAILABLE)}finally{q(!1)}}),[ce,L,J,Ae]),fe=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield ce())){J(a.Ef.UNAVAILABLE);return}const xe=yield Ae();if(xe===a.Ef.DENIED||xe===a.Ef.BLOCKED||xe===a.Ef.UNAVAILABLE){J(xe);return}const we=yield be();if(J(we),["granted","prompt"].includes(we)){const ze=yield ge(x);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 xe=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);xe?.includes("User denied Geolocation")||L?.error(`Error requesting location - ${xe}`)}J(a.Ef.UNAVAILABLE);return}finally{q(!1)}}),[ce,L,J,ge,be,Ae]),le=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield ce())){J(a.Ef.UNAVAILABLE);return}const xe=yield ge(x);xe&&(G(xe),$(a.Ef.GRANTED),w(A(v({},k.current),{location:`${xe.coords.latitude},${xe.coords.longitude}`,locationType:a.iF.CURRENT_LOCATION,lat:`${xe.coords.latitude}`,lng:`${xe.coords.longitude}`,locationPermission:a.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?L?.error(ve,"Error requesting current location"):L?.error(`Error requesting current location - ${JSON.stringify(ve)}`),J(a.Ef.UNAVAILABLE),ve}finally{q(!1)}}),[ce,L,w,J,ge]),ne=(0,t.useCallback)(()=>z(void 0,null,function*(){try{q(!0);const ve=yield ue();ve&&w(A(v({},k.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:a.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||a.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?L?.error(ve,"Error overriding search settings"):L?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{q(!1)}}),[L,U,ue,w]),te=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:ne,locationPermission:U,setLocationPermission:$,position:X,refreshPosition:ue,requestPosition:fe,requestCurrentLocation:le,checkAndSetLocationPermission:de,checkLocaitonPermission:me}),[I,ne,U,X,ue,fe,le,de,me]);return(0,n.jsxs)(T.Provider,{value:te,children:[ae&&(0,n.jsx)(b.J,{isOpen:ae,onClose:()=>re(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},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:()=>ge,rz:()=>at,Fp:()=>On,el:()=>Tn,ao:()=>Zt,oA:()=>D,Yt:()=>Ct,g4:()=>et,tn:()=>Ve,n4:()=>N,gD:()=>L,Vp:()=>Qe,Cx:()=>q,bK:()=>k,gi:()=>Je,Z$:()=>de,GT:()=>Ze,hr:()=>fe,JL:()=>le,Ck:()=>I,dU:()=>V,wG:()=>nr,hZ:()=>rn,$e:()=>Wt,qT:()=>Gn,GQ:()=>An,q3:()=>Ln,D_:()=>Bt,Uf:()=>$,_l:()=>be,Md:()=>ae,V7:()=>G,fe:()=>ue,JP:()=>Et,Z_:()=>w,zO:()=>me,UZ:()=>J,$7:()=>Ye,rb:()=>X,_W:()=>It,WS:()=>Ke,VF:()=>Fe,vf:()=>Ur,PV:()=>rt,PS:()=>In,Iz:()=>Dt,zD:()=>re,m3:()=>At,XP:()=>Tt,PM:()=>we,cX:()=>ne,G6:()=>te,Us:()=>De,AA:()=>xe,G0:()=>ht,mO:()=>We,HH:()=>ze,PU:()=>Ce,it:()=>zt,Tl:()=>ot,uH:()=>Yt,c3:()=>ve,rx:()=>P});var n=e(36087),t=e(14041);const r=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));o.displayName="UserPlus01";var a=e(8957);const i=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));i.displayName="UserX01";const b=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));b.displayName="Users01";const c=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),y=e(22716),m=e(9495);const p=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));p.displayName="Hash01";const d=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const g=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));g.displayName="Virus";const M=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));M.displayName="CreditCard02";const h=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const v=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));v.displayName="ClipboardCheck";const A=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));A.displayName="ClipboardPlus";const z=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));z.displayName="Route";const x=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 7c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.121-2.122C13.395 3 12.93 3 12 3c-.93 0-1.395 0-1.777.102a3 3 0 0 0-2.12 2.122C8 5.605 8 6.07 8 7M5.2 21h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 19.48 22 18.92 22 17.8v-7.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 7 19.92 7 18.8 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 21 4.08 21 5.2 21Z"}));x.displayName="Briefcase01";const T=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12.913 17h7.174m-7.174 0L11 21m1.913-4 2.865-5.991c.231-.483.347-.724.505-.8a.5.5 0 0 1 .434 0c.158.076.274.317.505.8L20.087 17m0 0L22 21M2 5h6m0 0h3.5M8 5V3m3.5 2H14m-2.5 0c-.496 2.957-1.647 5.636-3.334 7.884M10 14a9.396 9.396 0 0 1-1.834-1.116m0 0C6.813 11.848 5.603 10.427 5 9m3.166 3.884A17.295 17.295 0 0 1 2 18"}));T.displayName="Translate01";const S=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 8.502a2.248 2.248 0 0 1 4.37.75c0 1.499-2.25 2.248-2.25 2.248m.03 3h.01M9.9 19.2l1.46 1.947c.217.29.326.434.459.486a.5.5 0 0 0 .362 0c.133-.052.242-.197.459-.486L14.1 19.2c.293-.39.44-.586.619-.735a2 2 0 0 1 .822-.412c.226-.053.47-.053.959-.053 1.398 0 2.097 0 2.648-.228a3 3 0 0 0 1.624-1.624C21 15.597 21 14.898 21 13.5V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v5.7c0 1.398 0 2.097.228 2.648a3 3 0 0 0 1.624 1.624C5.403 18 6.102 18 7.5 18c.489 0 .733 0 .96.053a2 2 0 0 1 .821.412c.18.149.326.344.619.735Z"}));S.displayName="AnnotationQuestion";const C=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M15 2.458A9.996 9.996 0 0 0 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.715-.432-3.33-1.193-4.74M17 5.75h.005M10.5 21.888v-2.203a.5.5 0 0 1 .12-.325l2.486-2.9a.5.5 0 0 0-.131-.76l-2.857-1.632a.499.499 0 0 1-.186-.187L8.07 10.62a.5.5 0 0 0-.478-.25l-5.528.492M21 6c0 2.21-2 4-4 6-2-2-4-3.79-4-6a4 4 0 0 1 8 0Zm-3.75-.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0Z"}));C.displayName="Globe05";const E=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));E.displayName="Shield01";const R=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M21 15v1.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V15m14-7-5-5m0 0L7 8m5-5v12"}));R.displayName="Upload01";const P=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,L="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",N="http://hl7.org/fhir/questionnaire-item-control",w="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",k="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",q="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",$="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",X="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",G="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",ae="http://hl7.org/fhir/StructureDefinition/entryFormat",re="http://hl7.org/fhir/StructureDefinition/tz-code",J="tz-code",ce="footer",ge="check-box",Ae="header",be="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ue="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",de=[{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"}],fe={"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"},le={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ne="ui-toolkit/CoordinatePicker",te="ui-toolkit/DetailsInfo",ve="ui-toolkit/ServiceChoice",xe="ui-toolkit/InfoBanner",we="ui-toolkit/Button",ze="ui-toolkit/Phone",De="ui-toolkit/ErrorCard",Se="ui-toolkit/FormContainer",We="ui-toolkit/PageHeader",ot="ui-toolkit/SelectableOption",ht="ui-toolkit/Modal",At="ui-toolkit/Alert",Tt="ui-toolkit/AppSectionAccess",Yt="ui-toolkit/SensitiveDataCategory",zt="ui-toolkit/QuestCard",Ye="http://icanbwell.com/fhir/StructureDefinition/subtitle",Ke="http://icanbwell.com/fhir/StructureDefinition/text-align",It={LEFT:"left",CENTER:"center"},nt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},et="http://icanbwell.com/fhir/StructureDefinition/icon-name",Zt="http://icanbwell.com/fhir/StructureDefinition/error-title",Tn="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",On="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",at="http://icanbwell.com/fhir/StructureDefinition/description",Wt="http://icanbwell.com/fhir/StructureDefinition/modal-description",Bt="http://icanbwell.com/fhir/StructureDefinition/modal-title",An="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",Gn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",rn="http://icanbwell.com/fhir/StructureDefinition/button-text",Ln="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",nr="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",In="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Ur="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Vr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",Dt="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Fe="http://icanbwell.com/fhir/StructureDefinition/trigger-color",rt="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Ze="http://hl7.org/fhir/StructureDefinition/mimeType",Qe="http://hl7.org/fhir/StructureDefinition/maxSize",Je="http://icanbwell.com/fhir/StructureDefinition/message-severity",lt="http://icanbwell.com/fhir/StructureDefinition/alert-color",Ct="http://icanbwell.com/fhir/StructureDefinition/hideLabel",st="http://icanbwell.com/fhir/StructureDefinition/placeholder",se="http://icanbwell.com/fhir/StructureDefinition/hint-text",Ce="ui-toolkit/PrefilledMemberDemographicsAlert",Ve="http://hl7.org/fhir/issue-severity",Te="http://icanbwell.com/fhir/StructureDefinition/button-type",xt="http://icanbwell.com/fhir/StructureDefinition/button-action",Kt="button-type",Cn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",jn="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Sr="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Ft="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",Ne="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Xe={},Et={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":a.f,"user-x":i,"users-01":b,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:m.X,hash:p,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:g,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":M,"link-03":h,"search-lg":f.q,"clipboard-check":v,"clipboard-plus":A,route:z,"briefcase-01":x,"translate-01":T,"annotation-question":S,"globe-05":C,"shield-01":E,"upload-01":R}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>N,$O:()=>ht,CP:()=>Bt,Fy:()=>Wt,GN:()=>ge,J4:()=>lt,MU:()=>G,Nw:()=>rt,Qr:()=>C,Ue:()=>Ct,Yo:()=>xe,a0:()=>T,cz:()=>E,di:()=>I,eC:()=>st,iI:()=>q,lv:()=>k,mR:()=>Cn,nt:()=>S,od:()=>V,t7:()=>At,u0:()=>z,yQ:()=>Kt,zj:()=>le});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),a=e(27779),i=e.n(a),b=e(45250),c=e.n(b),u=e(16681),y=e(18807),m=e(1053),p=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(Lt,dn,cn)=>dn in Lt?p(Lt,dn,{enumerable:!0,configurable:!0,writable:!0,value:cn}):Lt[dn]=cn,v=(Lt,dn)=>{for(var cn in dn||(dn={}))M.call(dn,cn)&&f(Lt,cn,dn[cn]);if(g)for(var cn of g(dn))h.call(dn,cn)&&f(Lt,cn,dn[cn]);return Lt},A=(Lt,dn)=>d(Lt,O(dn));const z=(Lt,dn,cn,Dn)=>{if(Lt){const Jt=Lt(dn,v({defaultValue:cn},Dn));if(Jt&&Jt!==dn)return Jt}return Dn?Object.entries(Dn).reduce((Jt,[Ut,Bn])=>Jt.replace(`{{${Ut}}}`,String(Bn)),cn):cn},x=Lt=>{var dn;return(dn=Lt.filter(cn=>cn.url.includes("questionnaire-itemControl")).flatMap(cn=>{var Dn,Jt;return(Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)!=null?Jt:[]}).find(cn=>{var Dn;return(Dn=cn.code)==null?void 0:Dn.startsWith("ui-toolkit/")}))==null?void 0:dn.code},T=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.V7);return cn?.valueCode||"off"},S=(Lt,dn,cn)=>{const Dn=(0,y.A)(cn);return Lt&&dn&&cn?Dn.replace("<p>",`<span>${dn} `).replace("</p>","</span>").trim():Dn.replace("<p>","<span>").replace("</p>","</span>").trim()},C=Lt=>{const dn=Lt?.find(cn=>cn.url===m.Vp);return dn?.valueInteger},E=Lt=>{const dn=Lt?.find(cn=>cn.url===m.Z_);return dn?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},P="Type your response here...",L=(Lt,dn)=>{const cn=Lt?.find(Dn=>Dn.url===PLACEHOLDER_EXTENSION_URL);return cn?.valueString||dn&&R[dn]||P},D=Lt=>{const dn=Lt?.find(cn=>cn.url===HINT_TEXT_EXTENSION_URL);return dn?.valueString},N=Lt=>{const dn=Lt?.filter(cn=>cn.url===m.GT&&cn.valueCode).map(cn=>m.hr[cn.valueCode]||cn.valueCode);return dn?.length?dn.join(","):void 0},w=Lt=>Lt.split(",").map(Dn=>Dn.trim()).map(Dn=>m.JL[Dn]||Dn).filter((Dn,Jt,Ut)=>Ut.indexOf(Dn)===Jt).join(", "),V=(Lt,dn,cn)=>{const Dn=w(Lt),Jt=Dn.lastIndexOf(","),Ut=Jt!==-1?`${Dn.substring(0,Jt)} or${Dn.substring(Jt+1)}`:Dn,Bn=[dn&&`max. ${parseFloat((dn/(1e3*1e3)).toFixed(1))}MB`,cn&&`upto ${cn} file${cn>1?"s":""}`].filter(Boolean);return Bn.length>0?`${Ut} (${Bn.join(", ")})`:Ut},k=Lt=>{const dn=Lt?.find(cn=>cn?.url===m.zD||cn?.url===m.UZ);return dn?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(Lt,dn)=>{var cn,Dn,Jt;const Ut=dn?.find(Bn=>Bn.url.includes(Lt));return(Jt=(Dn=(cn=Ut?.valueInteger)!=null?cn:Ut?.valueDecimal)!=null?Dn:Ut?.valueString)!=null?Jt:Ut?.valueDate},q=Lt=>{if(!!Lt){if(/^\d{4}-\d{2}-\d{2}$/.test(Lt))return Lt;try{const dn=(0,a.evaluate)({},Lt);if(Array.isArray(dn)&&dn.length>0){const cn=dn[0];if(cn instanceof Date&&!isNaN(cn.getTime())){const Dn=cn.getFullYear(),Jt=String(cn.getMonth()+1).padStart(2,"0"),Ut=String(cn.getDate()).padStart(2,"0");return`${Dn}-${Jt}-${Ut}`}if(typeof cn=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(cn))return cn}}catch{}}},U=(Lt,dn)=>{var cn,Dn;const Jt=dn?.find(Bn=>Bn.url===Lt);if(!Jt)return;const Ut=(cn=Jt.valueString)!=null?cn:Jt.valueDate;return Ut||q((Dn=Jt.valueExpression)==null?void 0:Dn.expression)},$=(Lt,dn)=>{if(!(!Lt||Lt.length===0))for(const cn of Lt){const Dn=I(dn,cn.extension);if(Dn!==void 0)return Dn;if(cn.item&&cn.item.length>0){const Jt=$(cn.item,dn);if(Jt!==void 0)return Jt}}},X=(Lt,dn)=>{try{const cn=String(Lt??dn);let Dn;if(cn.includes("/"))Dn=(0,n.A)(cn,"MM/dd/yyyy",new Date);else{const Jt=cn.split("T")[0];Dn=(0,t.A)(Jt)}return(0,r.A)(Dn)}catch(cn){return console.error("Date parsing error:",cn,Lt),null}},G=(Lt,dn)=>{var cn;for(const Dn of Lt){if(Dn.linkId===dn)return Dn;if((cn=Dn.item)!=null&&cn.length){const Jt=G(Dn.item,dn);if(Jt!==void 0)return Jt}}},ae=(Lt,dn)=>{var cn;const Dn=[];for(const Jt of Lt)if(Jt.linkId===dn&&Dn.push(Jt),(cn=Jt.item)!=null&&cn.length){const Ut=ae(Jt.item,dn);Dn.push(...Ut)}return Dn},re=(Lt,dn,cn=0)=>ae(Lt,dn)[cn];function J(Lt){return Lt!=null}const ce=(Lt,dn)=>{var cn,Dn,Jt;if("answerString"in Lt&&J(Lt.answerString)){if(Lt.operator==="=")return dn?.valueString===Lt.answerString;if(Lt.operator==="!=")return dn?.valueString!==Lt.answerString}if("answerBoolean"in Lt&&J(Lt.answerBoolean)){if(Lt.operator==="=")return dn?.valueBoolean===Lt.answerBoolean;if(Lt.operator==="!=")return dn?.valueBoolean!==Lt.answerBoolean}if("answerInteger"in Lt&&J(Lt.answerInteger)||"answerDecimal"in Lt&&J(Lt.answerDecimal)){const Ut=Number(dn?.valueInteger||dn?.valueDecimal),Bn=Number(Lt.answerInteger||Lt.answerDecimal);if(Lt.operator==="=")return Ut===Bn;if(Lt.operator==="!=")return Ut!==Bn;if(Lt.operator===">")return Ut>Bn;if(Lt.operator==="<")return Ut<Bn;if(Lt.operator===">=")return Ut>=Bn;if(Lt.operator==="<=")return Ut<=Bn}if("answerQuantity"in Lt&&J(Lt.answerQuantity)){const Ut=dn?.valueQuantity,Bn=Lt.answerQuantity;if(Ut?.unit!==Bn?.unit)return!1;if(Lt.operator==="=")return Ut.value===Bn.value;if(Lt.operator==="!=")return Ut.value!==Bn.value;if(Lt.operator===">")return Ut.value>Bn.value;if(Lt.operator==="<")return Ut.value<Bn.value;if(Lt.operator===">=")return Ut.value>=Bn.value;if(Lt.operator==="<=")return Ut.value<=Bn.value}if("answerCoding"in Lt&&J(Lt.answerCoding)){const Ut=dn?.valueCoding,Bn=Lt.answerCoding;if(Lt.operator==="=")return Ut?.code===Bn.code;if(Lt.operator==="!=")return Ut?.code!==Bn.code}if("answerReference"in Lt&&J(Lt.answerReference)){const Ut=dn?.valueReference,Bn=Lt.answerReference;if(Lt.operator==="=")return Ut?.reference===Bn.reference;if(Lt.operator==="!=")return Ut?.reference!==Bn.reference}if("answerDate"in Lt&&J(Lt.answerDate)||"answerDateTime"in Lt&&J(Lt.answerDateTime)||"answerTime"in Lt&&J(Lt.answerTime)){const Ut=new Date((Jt=(Dn=(cn=dn?.valueDate)!=null?cn:dn?.valueDateTime)!=null?Dn:dn?.valueTime)!=null?Jt:""),Bn=new Date(Lt.answerDate||Lt.answerDateTime||Lt.answerTime||"");if(Lt.operator==="=")return Ut.getTime()===Bn.getTime();if(Lt.operator==="!=")return Ut.getTime()!==Bn.getTime();if(Lt.operator===">")return Ut.getTime()>Bn.getTime();if(Lt.operator==="<")return Ut.getTime()<Bn.getTime();if(Lt.operator===">=")return Ut.getTime()>=Bn.getTime();if(Lt.operator==="<=")return Ut.getTime()<=Bn.getTime()}return Lt.operator==="exists"?dn!=null===Lt.answerBoolean:!0},ge=(Lt,dn,cn)=>{const Dn=Jt=>{const Ut=ae(cn,Jt.question);return Ut.length===0||Ut.every(Bn=>!Bn.answer||Bn.answer.length===0)?ce(Jt,void 0):Ut.some(Bn=>{var ln;return(ln=Bn.answer)==null?void 0:ln.some(pn=>ce(Jt,pn&&Object.keys(pn).length>0?pn:void 0))})};return Lt&&Lt?.length>0?dn==="any"?Lt?.some(Jt=>Dn(Jt)):Lt?.every(Jt=>Dn(Jt)):!0},Ae=(Lt,dn,cn,Dn,Jt)=>{if(!Lt||Lt.length===0)return!0;const Ut=Bn=>{var ln;let pn;if(Dn&&typeof Jt=="number"){const pt=cn.filter(Pt=>Pt.linkId===Dn)[Jt];if(pt?.item){const Pt=pt.item.find(jt=>jt.linkId===Bn.question);if(Pt?.answer&&Pt.answer.length>0)return(ln=Pt?.answer)==null?void 0:ln.some(jt=>ce(Bn,jt&&Object.keys(jt).length>0?jt:void 0))}}if(!pn){const kt=ae(cn,Bn.question);if(kt.length>0)return kt.some(pt=>{var Pt;return(Pt=pt.answer)==null?void 0:Pt.some(jt=>ce(Bn,jt&&Object.keys(jt).length>0?jt:void 0))});pn=void 0}return ce(Bn,pn)};return dn==="any"?Lt.some(Bn=>Ut(Bn)):Lt.every(Bn=>Ut(Bn))},be=(Lt,dn)=>{var cn;if(!!((cn=Lt?.valueExpression)!=null&&cn.expression))try{const Dn=evaluate(dn,Lt.valueExpression.expression);return Array.isArray(Dn)?Dn.some(Jt=>Boolean(Jt)):Boolean(Dn)}catch{return}},oe=(Lt,dn)=>{var cn;const Dn=(cn=Lt.extension)==null?void 0:cn.find(Ut=>Ut.url===READ_ONLY_EXPRESSION_EXTENSION_URL),Jt=be(Dn,dn);return A(v({},Lt),{readOnly:Jt??Lt.readOnly})},ue=(Lt,dn,cn,Dn)=>{const{required:Jt,maxLength:Ut,type:Bn,extension:ln,enableWhen:pn,enableBehavior:kt,repeats:pt,answerOption:Pt}=Lt;if(!ge(pn,kt,dn)||Lt.type==="group"||Lt.type==="display")return"";if(pt)return me(Lt,dn,cn,Dn);const jt=ne(Lt,dn);return jt&&te(jt,Lt)?ve(Lt,dn,cn,jt,Dn):le(ln,Bn,Jt,Ut,cn,Pt,Dn)},me=(Lt,dn,cn,Dn)=>{const{required:Jt}=Lt;if(Jt){if(!cn||cn.length===0)return z(Dn,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let Ut=!1;for(let Bn=0;Bn<cn.length;Bn++){const ln=cn[Bn];if(ln&&Object.keys(ln).length>0&&Object.values(ln).some(kt=>kt!=null&&kt!==""&&(Array.isArray(kt)?kt.length>0:!0))){Ut=!0;const kt=le(Lt.extension,Lt.type,!0,Lt.maxLength,[ln],Lt.answerOption,Dn);if(kt)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Bn+1,error:kt});if(Lt.item&&Lt.item.length>0){const pt=de(Lt.item,dn,Lt.linkId,Bn,Dn);if(pt)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Bn+1,error:pt})}}else return z(Dn,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:Bn+1})}if(!Ut)return z(Dn,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(cn&&cn.length>0)for(let Ut=0;Ut<cn.length;Ut++){const Bn=cn[Ut];if(Bn&&Object.keys(Bn).length>0&&Object.values(Bn).some(pn=>pn!=null&&pn!==""&&(Array.isArray(pn)?pn.length>0:!0))){const pn=le(Lt.extension,Lt.type,!1,Lt.maxLength,[Bn],Lt.answerOption,Dn);if(pn)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Ut+1,error:pn});if(Lt.item&&Lt.item.length>0){const kt=de(Lt.item,dn,Lt.linkId,Ut,Dn);if(kt)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Ut+1,error:kt})}}}return""},de=(Lt,dn,cn,Dn,Jt)=>{var Ut,Bn;for(const ln of Lt){if(!Ae(ln.enableWhen,ln.enableBehavior,dn,cn,Dn))continue;const pn=G(dn,cn),kt=(Ut=pn?.item)==null?void 0:Ut.find(Pt=>Pt.linkId===ln.linkId),pt=(Bn=kt?.answer)!=null&&Bn[Dn]?[kt.answer[Dn]]:void 0;if(ln.required){if(!pt||!pt[0]||!fe(pt[0]))return z(Jt,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:ln.text||ln.linkId});const Pt=le(ln.extension,ln.type,!0,ln.maxLength,pt,ln.answerOption,Jt);if(Pt)return`${ln.text||ln.linkId}: ${Pt}`}else if(pt&&pt[0]&&fe(pt[0])){const Pt=le(ln.extension,ln.type,!1,ln.maxLength,pt,ln.answerOption,Jt);if(Pt)return`${ln.text||ln.linkId}: ${Pt}`}if(ln.item&&ln.item.length>0){const Pt=de(ln.item,dn,ln.linkId,Dn,Jt);if(Pt)return Pt}}return""},fe=Lt=>!Lt||Object.keys(Lt).length===0?!1:Object.values(Lt).some(dn=>dn!=null&&dn!==""&&(Array.isArray(dn)?dn.length>0:!0)),le=(Lt,dn,cn,Dn,Jt,Ut,Bn)=>{var ln,pn,kt,pt,Pt;let jt="";const Mn=!!Lt?.find(Or=>{var Dr,oo;return Or.url===m.gD&&((oo=(Dr=Or.valueCodeableConcept)==null?void 0:Dr.coding)==null?void 0:oo.some(mi=>mi.system===m.n4&&mi.code===m.GI))}),nn=Jt?.[0],yn={choice:((ln=nn?.valueCoding)==null?void 0:ln.code)||(nn?.valueString&&Ut?.some(Or=>Or.valueString===nn.valueString)?nn.valueString:null),"open-choice":((pn=nn?.valueCoding)==null?void 0:pn.code)||nn?.valueString,boolean:nn?.valueBoolean,string:nn?.valueString,text:nn?.valueString,url:nn?.valueUri,integer:nn?.valueInteger,decimal:nn?.valueDecimal,dateTime:nn?.valueDateTime,date:nn?.valueDate,time:nn?.valueTime,quantity:(kt=nn?.valueQuantity)==null?void 0:kt.value,reference:(pt=nn?.valueReference)==null?void 0:pt.display,attachment:(Pt=nn?.valueAttachment)==null?void 0:Pt.title};if(!(dn in yn))return"";const Yn=yn[dn],kr={required:()=>cn&&(Yn==null||Yn===""||Yn==="NaN"||Number.isNaN(Yn)||dn==="boolean"&&Yn!==!0&&Mn)?z(Bn,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Dn&&Yn!==null&&Yn!==void 0&&Yn.toString().length>Dn?z(Bn,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:Dn}):"",minLength:()=>{const Or=I("minLength",Lt);return Or&&Yn!==null&&Yn!==void 0&&Yn.toString().length<Number(Or)?z(Bn,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:Or}):""},urlRegex:()=>{const Or=new RegExp(m.rx),Dr=I("regexError",Lt),oo=Dr??z(Bn,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return Or&&dn==="url"&&Yn&&!Or.test(Yn)?String(oo):""},regex:()=>{const Or=I("regex",Lt);if(!Or||typeof Yn!="string")return"";const Dr=new RegExp(Or),oo=I("regexError",Lt),mi=oo??z(Bn,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Dr&&Yn&&!Dr.test(Yn)?String(mi):""},dateTime:()=>{if(dn==="dateTime"&&Yn){const Or=Yn?.toString(),Dr=new Date(Or);return isNaN(Dr.getTime())?z(Bn,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(dn!=="date"||!Yn)return"";const Or=Yn.replace(/\D/g,"");return Or.length>0&&Or.length<8||isNaN(new Date(Yn).getTime())?z(Bn,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var Or;if(dn==="date"){const oo=U(m.dU,Lt),mi=X(oo??"01/01/1900","01/01/1900"),Do=X(Yn,"");if(!mi||!Do)return"";if((0,s.A)(Do,mi)){const qo=(Or=Lt?.find(Lo=>Lo.url===m.Ck))==null?void 0:Or.valueString;return qo??z(Bn,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:oo??"01/01/1900"})}return""}const Dr=I("minValue",Lt);return Dr!=null&&Yn!==null&&Yn!==void 0&&Yn<Dr?z(Bn,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Dr}):""},maxValue:()=>{var Or;if(dn==="date"){const oo=U(m.bK,Lt),mi=X(oo??"01/01/2100","01/01/2100"),Do=X(Yn,"");if(!mi||!Do)return"";if((0,o.A)(Do,mi)){const qo=(Or=Lt?.find(Lo=>Lo.url===m.Cx))==null?void 0:Or.valueString;return qo??z(Bn,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:oo??"01/01/2100"})}return""}const Dr=I("maxValue",Lt);return Dr!=null&&Yn!==null&&Yn!==void 0&&Yn>Dr?z(Bn,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:Dr}):""}};return jt=kr.required()||kr.maxLength()||kr.minLength()||kr.urlRegex()||kr.regex()||kr.dateTime()||kr.date()||kr.minValue()||kr.maxValue()||"",jt},ne=(Lt,dn)=>{for(const cn of dn)if(cn.item){if(cn.item.find(Ut=>Ut.linkId===Lt.linkId))return cn;const Jt=ne(Lt,cn.item);if(Jt)return Jt}return null},te=(Lt,dn)=>{if(Lt.answer&&Lt.answer.length>1)return!0;if(Lt.item){const cn=Lt.item.find(Dn=>Dn.linkId===dn.linkId);if(cn&&cn.answer&&cn.answer.length>1)return!0}return!1},ve=(Lt,dn,cn,Dn,Jt)=>{var Ut,Bn;const{required:ln}=Lt,pn=(Ut=Dn.item)==null?void 0:Ut.find(Pt=>Pt.linkId===Lt.linkId),kt=pn?.answer||[],pt=((Bn=Dn.answer)==null?void 0:Bn.length)||1;for(let Pt=0;Pt<pt;Pt++){const jt=kt[Pt];if(ln){if(!jt||!fe(jt))return z(Jt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:z(Jt,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Lt.text||Lt.linkId})});const Mn=le(Lt.extension,Lt.type,!0,Lt.maxLength,[jt],Lt.answerOption,Jt);if(Mn)return z(Jt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:Mn})}else if(jt&&fe(jt)){const Mn=le(Lt.extension,Lt.type,!1,Lt.maxLength,[jt],Lt.answerOption,Jt);if(Mn)return z(Jt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:Mn})}}return""},xe=(Lt,dn)=>{for(const cn of Lt){if(cn?.linkId===dn)return cn;if(cn?.item&&cn.item.length>0){const Dn=xe(cn.item,dn);if(Dn)return Dn}}},we=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,Jt;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:Jt.some(Ut=>Ut.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ut.code===FOOTER_CODE))}))},ze=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===m.oA&&cn.valueBoolean))},De=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,Jt;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:Jt.some(Ut=>Ut.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ut.code===HEADER_CODE))}))},Se=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,Jt;return cn.url===m.gD&&((Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:Jt.some(Ut=>Ut.system===m.n4&&Ut.code===m._l))}))},We=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&cn.valueBoolean))},ot=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,Jt;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:Jt.some(Ut=>Ut.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ut.code===CHECKBOX_CODE))}))},ht=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.fe);return cn?.valueInteger},At=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.zO);return cn?.valueInteger},Tt=Lt=>{var dn;const cn=(dn=Lt?.extension)==null?void 0:dn.find(Dn=>Dn.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return cn?.valueInteger},Yt=(Lt,dn,cn,Dn,Jt,Ut)=>{const Bn=pn=>dn.filter(kt=>kt.linkId===pn),ln=new Set;return Lt.map(pn=>{if(ln.has(pn.linkId)||we(pn))return null;const pt=Bn(pn.linkId),Pt=pn.type==="group"&&pn.repeats;if(ln.add(pn.linkId),Pt){const jt=[];if(pt.forEach((Mn,nn)=>{const yn={linkId:pn.linkId,text:pn.text};let Yn;if(cn===pn.linkId&&typeof Ut=="number"&&Ut===nn&&Jt&&Jt.length>0){const kr=Mn?.item||[];Yn=[...kr],Jt.forEach(Or=>{const Dr=Yn.findIndex(oo=>oo.linkId===Or.linkId);Dr>=0?Yn[Dr]=A(v({},kr[Dr]),{answer:Or.answer}):Yn.push(Or)})}else pn.item&&(Yn=Yt(pn.item,Mn?.item||[],cn,Dn,Jt,nn));cn===pn.linkId&&typeof Ut=="number"&&Ut===nn&&Dn?yn.answer=Dn:yn.answer=Mn.answer||[{}],Yn&&Yn.length>0?yn.item=Yn:Mn.item&&(yn.item=Mn.item),jt.push(yn)}),cn===pn.linkId&&typeof Ut=="number"&&Ut>=pt.length)for(let Mn=pt.length;Mn<=Ut;Mn++){const nn={linkId:pn.linkId,text:pn.text,answer:Mn===Ut&&Dn?Dn:[{}]};Mn===Ut&&Jt&&Jt.length>0?nn.item=Jt:pn.item&&(nn.item=Yt(pn.item,[],void 0,void 0,void 0,void 0)),jt.push(nn)}return jt}else if(pn.repeats&&typeof Ut=="number"&&cn===pn.linkId){const jt=pt[0]||{linkId:pn.linkId,text:pn.text,answer:[]},Mn={linkId:pn.linkId,text:pn.text,answer:[...jt.answer||[]]};if(Dn&&Dn.length>0){for(;Mn.answer.length<=Ut;)Mn.answer.push({});Mn.answer[Ut]=Dn[0]}return Mn}else{const jt=pt[0],Mn=pn.item?Yt(pn.item,jt?.item||[],cn,Dn,Jt,Ut):void 0,nn=Mn&&Mn.length>0,yn={linkId:pn.linkId,text:pn.text};return cn&&pn.linkId===cn&&typeof Ut!="number"?(Dn||!Dn&&!Jt?yn.answer=Dn:jt?.answer&&(yn.answer=jt.answer),Jt?yn.item=Jt:nn&&(yn.item=Mn)):(jt?.answer?yn.answer=jt.answer:yn.answer=[{}],nn&&(yn.item=Mn)),yn}}).filter(Boolean).flat()},zt=(Lt,dn)=>{for(const cn of Lt)if(cn.linkId===dn||cn.item&&zt(cn.item,dn))return cn.linkId;return null},Ye=(Lt,dn,cn,Dn)=>{var Jt;const Ut=(Jt=Lt?.item)!=null?Jt:Dn;return!Ut||Ut.length===0?!0:Ut.every(Bn=>{var ln;const pn=ae(dn,Bn.linkId);if(pn.length===0){const kt=(ln=G(dn,Bn.linkId))==null?void 0:ln.answer;if(ue(Bn,dn,kt)&&ge(Bn.enableWhen,Bn.enableBehavior,dn)&&cn.includes(Bn.linkId))return!1}else for(const kt of pn)if(ue(Bn,dn,kt.answer)&&ge(Bn.enableWhen,Bn.enableBehavior,dn)&&cn.includes(Bn.linkId))return!1;return Bn.item?Ye(Bn,dn,cn):!0})},Ke=(Lt,dn,cn=!0)=>{for(const Dn of Lt)if(Dn.linkId===dn&&Dn.answer&&Dn.answer.length>0||Dn.item&&Dn.item.length>0&&Ke(Dn.item,dn,cn))return!0;return!1},It=(Lt,dn,cn=0)=>{const Dn=Lt.filter(Jt=>Jt.linkId===dn);if(Dn.length>cn){const Jt=Dn[cn];if(Jt.answer&&Jt.answer.length>0)return Jt.answer.some(Ut=>Ut&&Object.keys(Ut).length>0&&Object.values(Ut).some(Bn=>Bn!=null&&Bn!==""));if(Jt.item&&Jt.item.length>0)return Ke(Jt.item,dn,!1)}return Ke(Lt,dn,!1)},nt=(Lt,dn)=>{if(!Lt||!Lt.item)return!1;const cn=Dn=>{var Jt;if(ze(Dn)&&Dn.required&&ge(Dn.enableWhen,Dn.enableBehavior,dn)){const Ut=G(dn,Dn.linkId),Bn=le(Dn.extension,Dn.type,Dn.required,Dn.maxLength,Ut?.answer,Dn.answerOption);if(!((Jt=Ut?.answer)!=null&&Jt.length)||Bn)return!0}if(Dn.item){for(const Ut of Dn.item)if(cn(Ut))return!0}return!1};for(const Dn of Lt.item)if(cn(Dn))return!0;return!1},et=Lt=>{var dn,cn,Dn;if(Lt.valueString!==void 0)return Lt.valueString;if(Lt.valueBoolean!==void 0)return Lt.valueBoolean;if(Lt.valueInteger!==void 0)return Lt.valueInteger;if(Lt.valueDecimal!==void 0)return Lt.valueDecimal;if(Lt.valueDate!==void 0)return Lt.valueDate;if(Lt.valueDateTime!==void 0)return Lt.valueDateTime;if(((dn=Lt.valueCoding)==null?void 0:dn.code)!==void 0)return Lt.valueCoding.code;if(((cn=Lt.valueReference)==null?void 0:cn.reference)!==void 0)return Lt.valueReference.reference;if(((Dn=Lt.valueQuantity)==null?void 0:Dn.value)!==void 0)return Lt.valueQuantity.value;if(Lt.valueAttachment!==void 0)return Lt.valueAttachment},Zt=Lt=>{const dn={linkId:Lt.linkId};if(Lt.answer&&Lt.answer.length>0){const cn=Lt.answer.map(Dn=>et(Dn)).filter(Dn=>Dn!==void 0);cn.length>0&&(dn.answer=cn)}if(Lt.item&&Lt.item.length>0){const cn=Lt.item.map(Dn=>Zt(Dn)).filter(Dn=>{const Jt=Object.keys(Dn);return Jt.length>1||Jt.length===1&&Jt[0]!=="linkId"});cn.length>0&&(dn.item=cn)}return dn},Tn=(Lt,dn,cn,Dn,Jt,Ut)=>{var Bn;const ln=(Bn=dn?.item)==null?void 0:Bn[cn[Dn]],pn=ln?.linkId;if(!pn)return!1;const kt=ae(Lt,pn),pt=ae(Jt,pn),Pt=jt=>{if(jt!=null){if(Array.isArray(jt)){const Mn=jt.filter(nn=>nn!=null).map(nn=>Pt(nn)).filter(nn=>nn!==void 0);return Mn.length===0||Mn.length===1&&typeof Mn[0]=="object"&&Object.keys(Mn[0]).length===0?void 0:Mn}if(typeof jt=="object"){const Mn={};for(const[nn,yn]of Object.entries(jt))if(yn!=null){const Yn=Pt(yn);Yn!==void 0&&(Mn[nn]=Yn)}return Object.keys(Mn).length===0?void 0:Mn}return jt}};if(kt.length!==pt.length)return!1;for(let jt=0;jt<kt.length;jt++){const Mn=kt[jt],nn=pt[jt];if(!Mn||!nn)return!1;const yn=Zt(Pt(Mn)),Yn=Zt(Pt(nn));if(!_.isEqual(yn,Yn))return!1}return Dn!==Ut},On=(Lt,dn,cn,Dn)=>cn&&cn.length>0&&!(cn.length===1&&Object.keys(cn[0]).length===0)&&ue(Lt,dn,cn,Dn)||null,at=(Lt,dn,cn)=>{const Dn={},Jt=Ut=>{Ut.forEach(Bn=>{const ln=ae(dn,Bn.linkId);if(Ce(Bn,Lt)||Bn.repeats)for(let pn=0;pn<ln.length;pn++){const kt=ln[pn];if(kt?.answer&&kt.answer.length>0){const pt=On(Bn,dn,kt.answer,cn);pt&&(Dn[Bn.linkId]=A(v({},Dn[Bn.linkId]),{[pn]:pt}))}}else{const pn=G(dn,Bn.linkId);if(pn?.answer&&pn.answer.length>0){const kt=On(Bn,dn,pn.answer,cn);kt&&(Dn[Bn.linkId]={0:kt})}}Bn.item&&Bn.item.length>0&&Jt(Bn.item)})};return Jt(Lt),Dn},Wt=Lt=>{if(!Lt)return"";const dn=Lt.split("-");if(dn.length===3){const[cn,Dn,Jt]=dn;return`${cn.slice(-4)}-${Dn}-${Jt}`}return""},Bt=Lt=>Lt.trim().replace(/[A-Za-z]+/g,""),An=(Lt,dn)=>{const cn=(Dn,Jt)=>{for(const Ut of Dn){if(Ut.linkId===Jt)return Ut.answer;if(Ut.item&&Ut.item.length>0){const Bn=cn(Ut.item,Jt);if(Bn!==void 0)return Bn}}};return cn(Lt,dn)},Gn=(Lt,dn)=>{if(!dn||dn.length===0)return null;const cn=Lt.linkId,Dn=(Jt,Ut,Bn=[])=>{for(const ln of Jt){const pn=[...Bn,ln];if(ln.item){if(ln.item.some(Pt=>Pt.linkId===Ut))return pn.some(Pt=>Pt.repeats===!0)?ln:null;if(Dn(ln.item,Ut,pn))return ln}}return null};return Dn(dn,cn)},rn=(Lt,dn)=>{if(!dn||dn.length===0)return!1;const cn=Lt.linkId,Dn=(Jt,Ut,Bn=[])=>{for(const ln of Jt){const pn=[...Bn,ln];if(ln.item){if(ln.item.some(Pt=>Pt.linkId===Ut))return pn.some(Pt=>{const jt=x(Pt.extension||[]);return!!jt&&jt!==UI_TOOLKIT_FORM_CONTAINER});if(Dn(ln.item,Ut,pn))return!0}}return!1};return Dn(dn,cn)},Ln=(Lt,dn,cn)=>{const Dn={};if(!Lt)return Dn;const{linkId:Jt}=dn;if(Lt[Jt]){const Ut=Lt[Jt];Dn[Jt]=Ut[cn]||""}return dn.item&&dn.item.length>0&&dn.item.forEach(Ut=>{if(Lt[Ut.linkId]){const Bn=Lt[Ut.linkId];Dn[Ut.linkId]=Bn[cn]||""}}),Dn},nr=(Lt,dn)=>{const cn={};if(!Lt||!Lt[dn])return cn;const Dn=Lt[dn];return cn[dn]=Dn[0]||"",cn},In=Lt=>{const dn=Lt.findIndex(Ut=>!ze(Ut)),cn=dn>=0?[dn]:[],Dn=new Map;let Jt=null;if(Lt.forEach((Ut,Bn)=>{const ln=Se(Ut);if(ln&&Ut.type==="group")Bn!==dn&&cn.push(Bn),Dn.set(Bn,[Bn]),Jt=Bn;else if(Jt!==null&&!ln){const pn=Dn.get(Jt)||[];Dn.set(Jt,[...pn,Bn])}}),Lt.length>0&&cn.length>0){const Ut=cn[0];if(!Dn.has(Ut)){const Bn=cn.find(pn=>pn>Ut),ln=[];for(let pn=Ut;pn<(Bn??Lt.length);pn++)ln.push(pn);Dn.set(Ut,ln)}}return{groupIndices:cn,itemsToRenderMap:Dn}},Ur=(Lt,dn,cn,Dn)=>{let Jt=[...Dn];const Ut=(Bn,ln)=>{Bn.forEach(pn=>{if((!pn?.enableWhen||ge(pn?.enableWhen,pn.enableBehavior,ln))&&pn.initial&&!Ke(ln,pn.linkId))if(pn.repeats){const kt=ln.filter(pt=>pt.linkId===pn.linkId);kt.length>0?kt.forEach((pt,Pt)=>{It(ln,pn.linkId,Pt)||(Jt=Yt(cn,Jt,pn.linkId,pn.initial,void 0,Pt))}):Jt=Yt(cn,Jt,pn.linkId,pn.initial)}else Jt=Yt(cn,Jt,pn.linkId,pn.initial);pn.item&&Ut(pn.item,ln)})};return Ut(Lt,dn),Jt},Vr=(Lt,dn,cn)=>{if(!Lt)return[];const Dn=[],Jt=Ut=>{Ut.required===dn&&ge(Ut.enableWhen,Ut.enableBehavior,cn)&&!ze(Ut)&&Ut.type!=="display"&&Dn.push(Ut),Ut.item&&Ut.item.length>0&&Ut.item.forEach(Jt)};return Lt.forEach(Jt),Dn},Dt=(Lt,dn)=>Lt.every(cn=>{var Dn;const Jt=ae(dn,cn.linkId);if(Jt.length>0)return Jt.every(Ut=>!ue(cn,dn,Ut.answer));{const Ut=(Dn=G(dn,cn.linkId))==null?void 0:Dn.answer;return!ue(cn,dn,Ut)}}),Fe=(Lt,dn)=>{let cn=-1;for(let Dn=Lt.length-1;Dn>=0;Dn--)if(Lt[Dn].linkId===dn){cn=Dn;break}return cn},rt=(Lt,dn)=>Lt.filter(cn=>cn.linkId!==dn).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:rt(cn.item,dn)}):cn),Ze=(Lt,dn,cn=Lt)=>Lt.reduce((Dn,Jt)=>{const Ut=xe(dn,Jt.linkId);return Ut?.enableWhen&&!ge(Ut.enableWhen,Ut.enableBehavior,cn)||(Jt.item&&Jt.item.length>0?Dn.push(A(v({},Jt),{item:Ze(Jt.item,dn,cn)})):Dn.push(Jt)),Dn},[]),Qe=(Lt,dn,cn=[])=>{const Dn=[],Jt=Ut=>{Ut.forEach(Bn=>{Dn.push(Bn.linkId),Bn.item&&Bn.item.length>0&&Jt(Bn.item)})};for(let Ut=0;Ut<Lt.length;Ut++){const Bn=Lt[Ut];if(Bn.linkId===dn){const ln=Lt.slice(0,Ut+1),pn=Lt.slice(Ut+1),{kept:kt,removed:pt}=pn.reduce((Pt,jt)=>{const Mn=xe(cn,jt.linkId);return!Mn||ze(Mn)&&ge(Mn.enableWhen,Mn.enableBehavior,ln)?Pt.kept.push(jt):Pt.removed.push(jt),Pt},{kept:[],removed:[]});return Jt(pt),{trimmedData:[...ln,...kt],trimmedLinkIds:Dn,found:!0}}if(Bn.item&&Bn.item.length>0){const ln=Qe(Bn.item,dn,cn);if(ln.found){const pn=Lt.slice(0,Ut),kt=Lt.slice(Ut+1),pt=[...pn,A(v({},Bn),{item:ln.trimmedData})],{kept:Pt,removed:jt}=kt.reduce((Mn,nn)=>{const yn=xe(cn,nn.linkId);return!yn||ze(yn)&&ge(yn.enableWhen,yn.enableBehavior,pt)?Mn.kept.push(nn):Mn.removed.push(nn),Mn},{kept:[],removed:[]});return Jt(jt),{trimmedData:[...pt,...Pt],trimmedLinkIds:[...ln.trimmedLinkIds,...Dn],found:!0}}}}return{trimmedData:Lt,trimmedLinkIds:[],found:!1}},Je=(Lt,dn)=>Lt.filter(cn=>!dn.includes(cn.linkId)).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:Je(cn.item,dn)}):cn),lt=Lt=>{var dn;if(!Lt)return"empty";const cn=m.Z$.find(({patterns:Dn})=>Dn.some(Jt=>Lt.includes(Jt)));return(dn=cn?.type)!=null?dn:"empty"},Ct=(Lt,dn)=>{const{groupIndices:cn}=In(Lt),Dn=Lt.findIndex(Jt=>Jt.linkId===dn);return Dn!==-1?cn.indexOf(Dn):-1},st=Lt=>{if(!Lt)return{restriction:null,warning:null};const dn=cn=>{const Dn=Lt.find(Ut=>Ut.url===cn&&Ut.valueString);if(!Dn?.valueString)return null;const Jt=Dn.valueString.replace(/\\n/g,`
869
+ `}}customElements.get(ve)===void 0&&customElements.define(ve,xe);const we=[{name:"loader",defaultElement:document.createElement(ne)},{name:"error",defaultElement:document.createElement(ve)}],ze=["error","loading"],De={error:"error",loading:"loader"},Se=({src:At,elementNameSuffix:Tt,version:Yt,prefetchFeatureApp:zt})=>(0,g.__awaiter)(void 0,void 0,void 0,function*(){var Ye,Ke,It,nt,et,Zt,Tn,On,at,Wt,Bt,An,Gn,rn,Ln;window.bwell||(window.bwell=new le({metadata:{version:Yt}}));const nr=`bwell-${Tt}`;if(customElements.get(nr)!==void 0)return;class In extends h{constructor(){super(),Ye.add(this),Ke.set(this,(0,T.nanoid)()),It.set(this,void 0),nt.set(this,document.createElement("feature-app-loader")),et.set(this,new k.EventEmitter),Zt.set(this,void 0),Tn.set(this,void 0),On.set(this,void 0),at.set(this,void 0),Wt.set(this,void 0),Bt.set(this,void 0),this.attachShadow({mode:"open"});const Vr=new ce(we).attachToShadowRoot(this.shadowRoot);Vr.addEventListener("visibilitychange",({visibility:Dt,container:Fe,name:rt})=>{rt==="error"&&Dt==="visible"&&window.bwell._registerEmbeddableContent(Fe),(0,g.__classPrivateFieldGet)(this,nt,"f").style.display=Dt==="hidden"?"unset":"hidden"}),(0,g.__classPrivateFieldSet)(this,Bt,{slots:Vr,attributes:new V().bindTo(this),loaderEventEmitter:(0,g.__classPrivateFieldGet)(this,et,"f")},"f"),(0,g.__classPrivateFieldSet)(this,Zt,(0,g.__classPrivateFieldGet)(this,Ye,"m",An).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,Tn,(0,g.__classPrivateFieldGet)(this,Ye,"m",Gn).bind(this),"f"),(0,g.__classPrivateFieldSet)(this,On,(0,g.__classPrivateFieldGet)(this,Ye,"m",Ln).call(this,"error"),"f"),(0,g.__classPrivateFieldSet)(this,at,(0,g.__classPrivateFieldGet)(this,Ye,"m",Ln).call(this,"loading"),"f")}connectedCallback(){return(0,g.__awaiter)(this,void 0,void 0,function*(){(0,g.__classPrivateFieldGet)(this,On,"f").call(this,(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get("error")),(0,g.__classPrivateFieldGet)(this,at,"f").call(this,(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get("loading")),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.addEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,Tn,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.addChangeListener("error",(0,g.__classPrivateFieldGet)(this,On,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.addChangeListener("loading",(0,g.__classPrivateFieldGet)(this,at,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}(0,g.__classPrivateFieldSet)(this,Ke,this.id||(0,g.__classPrivateFieldGet)(this,Ke,"f"),"f"),(0,g.__classPrivateFieldSet)(this,It,new x((0,g.__classPrivateFieldGet)(this,Ke,"f")),"f"),(0,g.__classPrivateFieldGet)(this,It,"f").registerDispatcher(Vr=>this.dispatchEvent(Vr)),window.bwell.isInitialized?(0,g.__classPrivateFieldGet)(this,Zt,"f").call(this):(window.bwell.once("initialized",(0,g.__classPrivateFieldGet)(this,Zt,"f")),window.bwell.once("error",()=>{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}),zt&&(0,M.h)(At).catch(()=>{(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlot("error")}))})}disconnectedCallback(){var Vr;(0,g.__classPrivateFieldGet)(this,et,"f").emit("disconnect"),(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.removeEventListener("visibilitychange",(0,g.__classPrivateFieldGet)(this,Tn,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.removeChangeListener("error",(0,g.__classPrivateFieldGet)(this,On,"f")),(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.removeChangeListener("loading",(0,g.__classPrivateFieldGet)(this,at,"f")),(Vr=(0,g.__classPrivateFieldGet)(this,It,"f"))===null||Vr===void 0||Vr.deregister(),(0,g.__classPrivateFieldGet)(this,et,"f").removeAllListeners()}}Ke=new WeakMap,It=new WeakMap,nt=new WeakMap,et=new WeakMap,Zt=new WeakMap,Tn=new WeakMap,On=new WeakMap,at=new WeakMap,Wt=new WeakMap,Bt=new WeakMap,Ye=new WeakSet,An=function(){(0,g.__classPrivateFieldGet)(this,nt,"f").setAttribute("featureAppId",`bwell-embeddable:${nr}`),(0,g.__classPrivateFieldGet)(this,nt,"f").setAttribute("src",At),(0,g.__classPrivateFieldGet)(this,nt,"f").config={id:(0,g.__classPrivateFieldGet)(this,Ke,"f"),name:Tt,elementName:nr,utils:(0,g.__classPrivateFieldGet)(this,Bt,"f")},this.shadowRoot.appendChild((0,g.__classPrivateFieldGet)(this,nt,"f"))},Gn=function({visibility:Vr,name:Dt}){(0,g.__classPrivateFieldGet)(this,nt,"f").style.display=Vr==="hidden"?"unset":"hidden"},rn=function(Vr){(0,g.__classPrivateFieldGet)(this,Wt,"f")(),(0,g.__classPrivateFieldSet)(this,Wt,void 0,"f")},Ln=function(Vr){return Dt=>{const Fe=ze.findIndex(Ze=>Ze===Vr);if(!ze.slice(0,Fe).some(Ze=>(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get(Ze)!==null)){if(Dt!==null)(0,g.__classPrivateFieldGet)(this,Wt,"f")&&(0,g.__classPrivateFieldGet)(this,Ye,"m",rn).call(this,Vr),(0,g.__classPrivateFieldSet)(this,Wt,(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlotLocked(De[Vr]),"f");else if(Dt===null&&(0,g.__classPrivateFieldGet)(this,Wt,"f")){(0,g.__classPrivateFieldGet)(this,Ye,"m",rn).call(this,Vr);const Ze=ze.find(Qe=>(0,g.__classPrivateFieldGet)(this,Bt,"f").attributes.get(Qe)!==null);Ze&&(0,g.__classPrivateFieldSet)(this,Wt,(0,g.__classPrivateFieldGet)(this,Bt,"f").slots.showSlotLocked(De[Ze]),"f")}}}},customElements.define(nr,In)}),We={rE:"1.1162.1"},ot="composite";var ht=e(67321);Se({src:`https://embeddables.prod.icanbwell.com/${ot}/${We.rE}/scripts/embeddable.federated.js`,elementNameSuffix:ot,version:We.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),a=Object.defineProperty,i=Object.defineProperties,b=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,m=(M,h,f)=>h in M?a(M,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):M[h]=f,p=(M,h)=>{for(var f in h||(h={}))u.call(h,f)&&m(M,f,h[f]);if(c)for(var f of c(h))y.call(h,f)&&m(M,f,h[f]);return M},d=(M,h)=>i(M,b(h));const O=(M,h,f)=>{const v=_.cloneDeep(M);if(!v.contained||h<0)return v;const A=v.contained.findIndex(z=>z.resourceType==="Questionnaire");if(A!==-1&&!f){const z=v.contained[A];if(z.item){if(!z.item.some(C=>isPageExtensionPresent(C)))return v;let T=0,S=z.item.length;for(let C=0;C<z.item.length;C++){const E=z.item[C];if(isPageExtensionPresent(E)){if(T===h+1){S=C;break}T++}}z.item=z.item.slice(0,S),v.contained[A]=z}}else f&&A!==-1&&(v.contained[A]=d(p({},v.contained[A]),{item:f}));return v},g=({formId:M,questionnaireResponse:h,showQuestionPrefix:f,nextQuestion:v,onGoBack:A,handleHiddenQuestion:z,errorConfig:x,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:P,className:L,children:D})=>{var N,w,V;const{currentGroupIndex:k,hasCustomError:I}=useFHIRQuestionnaire(),q=(N=h.questionnaire)==null?void 0:N.replace("#",""),U=(w=h?.contained)==null?void 0:w.find(X=>X.id===q&&X.resourceType==="Questionnaire"),$=(X,G,ae)=>{let re=_.cloneDeep(h);re.item=X,re=trimQuestionnaireItems(re,k,ae),v(re,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,L),children:jsx(FHIRQuestionnaire,{formId:M,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:f,errorConfig:x,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:$,onGoBack:A,onClearError:T,handleHiddenQuestion:z,showStepper:C,hideBackButton:E,externalComponentRenderMap:P,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>v});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),a=e(56192),i=e(76808),b=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(A,z,x)=>z in A?c(A,z,{enumerable:!0,configurable:!0,writable:!0,value:x}):A[z]=x,g=(A,z)=>{for(var x in z||(z={}))p.call(z,x)&&O(A,x,z[x]);if(m)for(var x of m(z))d.call(z,x)&&O(A,x,z[x]);return A},M=(A,z)=>u(A,y(z)),h=(A,z,x)=>new Promise((T,S)=>{var C=P=>{try{R(x.next(P))}catch(L){S(L)}},E=P=>{try{R(x.throw(P))}catch(L){S(L)}},R=P=>P.done?T(P.value):Promise.resolve(P.value).then(C,E);R((x=x.apply(A,z)).next())});const f=10,v=({id:A="location-filter-desktop",initialValue:z,onInputChange:x,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:E,errorText:R})=>{const P=(0,i.Ul)(),{i18n:{t:L},loading:D}=(0,b.E_)({keys:["shared-translations"]}),N=z?.placeId,w=z?.description,[V,k]=(0,t.useState)(""),[I,q]=(0,t.useState)(""),[U,$]=(0,t.useState)(null),[X,G]=(0,t.useState)(null),[ae,re]=(0,t.useState)(!1),J=(0,t.useRef)(!1),ce=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ge,Ae]=(0,t.useState)(ce),[be,oe]=(0,t.useState)(ce),[ue,{loading:me,error:de}]=(0,a.Ncb)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode data")}}),[fe,{loading:le,error:ne}]=(0,a.qtq)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch geocode by lat/lon data")}}),[te,{loading:ve,error:xe}]=(0,a.zUC)({fetchPolicy:"cache-first",onError:()=>{P?.error("Failed to fetch place autocomplete data"),Ae(ce)},onCompleted:Yt=>{var zt,Ye;const Ke=(Ye=(zt=Yt.placeAutocomplete)==null?void 0:zt.predictions)==null?void 0:Ye.map(It=>{var nt;return{id:It.placeId,label:(0,s.removeAfterLastComma)(It.description),mainText:It?.mainText||((nt=It.description.split(",")[0])==null?void 0:nt.trim()),secondaryText:(0,s.removeAfterLastComma)(It?.secondaryText||It.description.split(",").slice(1).join(",").trim())}});Ae(Ke?.length?Ke:ce)}}),we=(0,t.useMemo)(()=>ge.map(Yt=>M(g({},Yt),{displayLabel:(0,r.RZ)(Yt?.label||"",V)})),[V,ge]),ze=Yt=>h(void 0,null,function*(){var zt,Ye,Ke,It,nt,et,Zt,Tn,On,at,Wt,Bt,An,Gn,rn,Ln;if($(Yt),G(Yt),re(!1),Yt&&typeof Yt=="string"){const nr=ge.find(Qe=>Qe.id===Yt),In=nr?.label||V;if(!nr)return;k(In),q(In),setTimeout(()=>{const Qe=[{id:nr.id,label:nr.label}];Ae(Qe),oe(Qe)},f);const Ur=yield ue({variables:{placeId:Yt}}),Vr=(Ye=(zt=Ur?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ye.latitude,Dt=(It=(Ke=Ur?.data)==null?void 0:Ke.geocodingByPlaceId)==null?void 0:It.longitude,Fe=((et=(nt=Ur?.data)==null?void 0:nt.geocodingByPlaceId)==null?void 0:et.zipCode)||"",rt=((Tn=(Zt=Ur?.data)==null?void 0:Zt.geocodingByPlaceId)==null?void 0:Tn.state)||"",Ze=((at=(On=Ur?.data)==null?void 0:On.geocodingByPlaceId)==null?void 0:at.stateCode)||"";if(Vr&&Dt)if(!Fe||!Ze){const Qe=yield fe({variables:{latitude:String(Vr),longitude:String(Dt)}}),Je=((Bt=(Wt=Qe?.data)==null?void 0:Wt.geocodingByLatLon)==null?void 0:Bt.zipCode)||"",lt=((Gn=(An=Qe?.data)==null?void 0:An.geocodingByLatLon)==null?void 0:Gn.state)||"",Ct=((Ln=(rn=Qe?.data)==null?void 0:rn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Vr,longitude:Dt,zipCode:Je,state:lt,stateCode:Ct,placeId:Yt,description:In,value:Yt})}else T({latitude:Vr,longitude:Dt,zipCode:Fe,state:rt,stateCode:Ze,placeId:Yt,description:In,value:Yt});else re(!0)}}),De=()=>!0,Se=(0,s.useDebounce)(Yt=>h(void 0,null,function*(){return yield te({variables:{input:Yt,types:"geocode"}})})),We=Yt=>h(void 0,null,function*(){if(re(!1),k(Yt),x?.(Yt),!Yt||Yt.trim().length===0){$(null),Ae(ce),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Yt});return}const zt=Yt.trim();zt.length>=2?yield Se(zt):Ae(ce)}),ot=Yt=>{J.current=Yt},ht=()=>{k(I),Ae(be),$(X)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var zt,Ye,Ke,It,nt,et,Zt,Tn,On,at,Wt,Bt,An,Gn,rn,Ln;if(N&&w){Ae([{id:N,label:V||w}]),oe([{id:N,label:V||w}]),$(N),G(N),k(w),q(w),w===V&&k(w);const nr=yield ue({variables:{placeId:N}}),In=(Ye=(zt=nr?.data)==null?void 0:zt.geocodingByPlaceId)==null?void 0:Ye.latitude,Ur=(It=(Ke=nr?.data)==null?void 0:Ke.geocodingByPlaceId)==null?void 0:It.longitude,Vr=((et=(nt=nr?.data)==null?void 0:nt.geocodingByPlaceId)==null?void 0:et.zipCode)||"",Dt=((Tn=(Zt=nr?.data)==null?void 0:Zt.geocodingByPlaceId)==null?void 0:Tn.state)||"",Fe=((at=(On=nr?.data)==null?void 0:On.geocodingByPlaceId)==null?void 0:at.stateCode)||"";if(In&&Ur)if(!Vr||!Dt||!Fe){const rt=yield fe({variables:{latitude:String(In),longitude:String(Ur)}}),Ze=((Bt=(Wt=rt?.data)==null?void 0:Wt.geocodingByLatLon)==null?void 0:Bt.zipCode)||"",Qe=((Gn=(An=rt?.data)==null?void 0:An.geocodingByLatLon)==null?void 0:Gn.state)||"",Je=((Ln=(rn=rt?.data)==null?void 0:rn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:In,longitude:Ur,zipCode:Ze,state:Qe,stateCode:Je,placeId:N,description:w,value:N})}else T({latitude:In,longitude:Ur,zipCode:Vr,state:Dt,stateCode:Fe,placeId:N,description:w,value:N})}else $(null),G(null),k(""),q(""),Ae(ce),oe(ce)}))()},[]);const At=ae||!!de||!!ne||!!xe||!!R,Tt=At?R||L("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||le||D)},[E,me,le,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:A,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||le,placeholder:L("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:we,selectedKey:U,onSelectionChange:ze,onInputChange:We,defaultFilter:De,onOpenChange:ot,onBlur:ht,isInvalid:At,hint:Tt,autoComplete:"address-line1",className:"w-full",children:Yt=>{const zt=Yt,Ye=V.trim().length>=2,Ke=zt.mainText||"",It=zt.secondaryText||"",nt=Ke.trim().length>0,et=It.trim().length>0,Zt=nt?(0,r.RZ)(Ke,V):{beforePart:"",highlightedPart:"",remainingPart:""},Tn=et?(0,r.RZ)(It,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:zt.id,supportingText:zt.supportingText,isDisabled:zt.isDisabled,icon:zt.icon,avatarUrl:zt.avatarUrl,textValue:zt.label,children:Ye&&nt?(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:Zt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Zt.highlightedPart}),(0,n.jsx)("span",{children:Zt.remainingPart})]}),et&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:Tn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Tn.highlightedPart}),(0,n.jsx)("span",{children:Tn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:zt.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:a})=>{const{isSmallScreen:i}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${i?"-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 ${i?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[a,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 a=({className:i})=>{const{pathname:b}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:m,i18n:{t:p}}=useI18nChild({keys:["shared"]}),d=getPathSegments(b).flatMap(O=>{const g=c.getId(O),M=c.getRouteMeta(g)||{},h=getBreadcrumbTitleKey(g,M,u);if(!h||M.breadcrumbHide)return[];const f=y[g];let v=c.getHref(g),A=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:g,search:f.search})),f.titleKey&&(A=f.titleKey)),[{routeId:g,href:v,label:p(A),onClick:f?.onClick}]});return m||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",i),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),a=e(5380),i=e(87896),b=e(26877);const c=(E,R)=>new Promise((P,L)=>setTimeout(()=>L(new Error(R)),E)),u=(E,R,P)=>Promise.race([E,c(R,P)]),y=5e3,m=1e4;var p=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(E,R,P)=>R in E?p(E,R,{enumerable:!0,configurable:!0,writable:!0,value:P}):E[R]=P,v=(E,R)=>{for(var P in R||(R={}))M.call(R,P)&&f(E,P,R[P]);if(g)for(var P of g(R))h.call(R,P)&&f(E,P,R[P]);return E},A=(E,R)=>d(E,O(R)),z=(E,R,P)=>new Promise((L,D)=>{var N=k=>{try{V(P.next(k))}catch(I){D(I)}},w=k=>{try{V(P.throw(k))}catch(I){D(I)}},V=k=>k.done?L(k.value):Promise.resolve(k.value).then(N,w);V((P=P.apply(E,R)).next())});const x={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:E})=>{var R;const{mobileOS:P}=(0,r.useDeviceDetection)(),L=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,i.useSearchQueryParams)(),V=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,q]=(0,t.useState)(!1),[U,$]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[X,G]=(0,t.useState)(),[ae,re]=(0,t.useState)(!1),J=(0,t.useCallback)(ve=>{$(ve);try{w(A(v({},k.current),{locationPermission:ve||a.Ef.UNAVAILABLE}))}catch(xe){xe instanceof Error?L?.error(xe,"Failed to update query params"):L?.error(`Failed to update query params - ${JSON.stringify(xe)}`)}},[w,L]),ce=(0,t.useCallback)(()=>z(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]),ge=(0,t.useCallback)(ve=>z(void 0,null,function*(){const xe=D.getCurrentPosition(ve).then(we=>{if(!we||!we.coords)throw new Error("Location data is invalid or unavailable");return we});try{return yield u(xe,y,"Location request timed out. Please check that location services are enabled.")}catch(we){throw we instanceof Error&&L?.error(we,"Geolocation timeout or error"),we}}),[D,L]),Ae=(0,t.useCallback)(()=>z(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),be=(0,t.useCallback)(()=>z(void 0,null,function*(){return u(D.requestPermission(),m,"Permission request timed out - user did not respond to permission dialog")}),[D]),oe=(0,t.useCallback)(()=>z(void 0,null,function*(){try{if(!(yield ce()))return L?.error("Location services not available"),!1;const xe=yield Ae();return xe!==a.Ef.GRANTED&&xe!==a.Ef.PROMPT?(L?.error(`Location permission not granted: ${xe}`),!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}}),[ce,L,Ae]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>z(void 0,null,function*(){const xe=N.locationPermission;if(xe===a.Ef.DENIED||xe===a.Ef.BLOCKED||xe===a.Ef.UNAVAILABLE){$(xe);return}q(!0);try{if(!(yield ce())){J(a.Ef.UNAVAILABLE);return}if(xe===a.Ef.GRANTED){try{const De=yield Ae();if(De===a.Ef.GRANTED){const Se=yield ge(x);Se&&(G(Se),J(a.Ef.GRANTED))}else De===a.Ef.PROMPT?(J(De),re(!0)):J(De)}catch(De){De instanceof Error?L?.error(De,"Error getting initial location with granted permission"):L?.error(`Error getting initial location with granted permission - ${JSON.stringify(De)}`),J(a.Ef.UNAVAILABLE)}return}const ze=yield Ae();if(J(ze),ze===a.Ef.GRANTED)try{const De=yield ge(x);De?G(De):J(a.Ef.UNAVAILABLE)}catch(De){De instanceof Error?L?.error(De,"Error getting initial location"):L?.error(`Error getting initial location - ${JSON.stringify(De)}`),J(a.Ef.UNAVAILABLE)}else ze===a.Ef.PROMPT&&re(!0)}catch(we){we instanceof Error?L?.error(we,"Error initializing location permission"):L?.error(`Error initializing location permission - ${JSON.stringify(we)}`),J(a.Ef.UNAVAILABLE)}finally{q(!1)}}))()},[]);const ue=(0,t.useCallback)(()=>z(void 0,null,function*(){try{if(!(yield oe())){J(a.Ef.UNAVAILABLE);return}q(!0);let xe=yield Ae();if(J(xe),xe===a.Ef.GRANTED||xe===a.Ef.PROMPT){if(P==="Android"&&xe===a.Ef.GRANTED)try{xe=yield be(),J(xe)}catch(we){we instanceof Error?L?.error(we,"Error re-requesting Android permission"):L?.error(`Error re-requesting Android permission - ${JSON.stringify(we)}`);return}if(xe!==a.Ef.UNAVAILABLE){const we=yield ge(x);return G(we),we}}return}catch(ve){J(a.Ef.UNAVAILABLE),ve instanceof Error?L?.error(ve,"Error refreshing location"):L?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{q(!1)}}),[oe,L,P,J,ge,Ae,be]),me=(0,t.useCallback)(()=>z(void 0,null,function*(){try{return(yield ce())?yield Ae():a.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?L?.error(ve,"Error checking location permission"):L?.error(`Error checking location permission - ${JSON.stringify(ve)}`),a.Ef.UNAVAILABLE}}),[ce,L,Ae]),de=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield ce())){J(a.Ef.UNAVAILABLE);return}const xe=yield Ae();J(xe)}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)}`),J(a.Ef.UNAVAILABLE)}finally{q(!1)}}),[ce,L,J,Ae]),fe=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield ce())){J(a.Ef.UNAVAILABLE);return}const xe=yield Ae();if(xe===a.Ef.DENIED||xe===a.Ef.BLOCKED||xe===a.Ef.UNAVAILABLE){J(xe);return}const we=yield be();if(J(we),["granted","prompt"].includes(we)){const ze=yield ge(x);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 xe=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);xe?.includes("User denied Geolocation")||L?.error(`Error requesting location - ${xe}`)}J(a.Ef.UNAVAILABLE);return}finally{q(!1)}}),[ce,L,J,ge,be,Ae]),le=(0,t.useCallback)(()=>z(void 0,null,function*(){q(!0);try{if(!(yield ce())){J(a.Ef.UNAVAILABLE);return}const xe=yield ge(x);xe&&(G(xe),$(a.Ef.GRANTED),w(A(v({},k.current),{location:`${xe.coords.latitude},${xe.coords.longitude}`,locationType:a.iF.CURRENT_LOCATION,lat:`${xe.coords.latitude}`,lng:`${xe.coords.longitude}`,locationPermission:a.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?L?.error(ve,"Error requesting current location"):L?.error(`Error requesting current location - ${JSON.stringify(ve)}`),J(a.Ef.UNAVAILABLE),ve}finally{q(!1)}}),[ce,L,w,J,ge]),ne=(0,t.useCallback)(()=>z(void 0,null,function*(){try{q(!0);const ve=yield ue();ve&&w(A(v({},k.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:a.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||a.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?L?.error(ve,"Error overriding search settings"):L?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{q(!1)}}),[L,U,ue,w]),te=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:ne,locationPermission:U,setLocationPermission:$,position:X,refreshPosition:ue,requestPosition:fe,requestCurrentLocation:le,checkAndSetLocationPermission:de,checkLocaitonPermission:me}),[I,ne,U,X,ue,fe,le,de,me]);return(0,n.jsxs)(T.Provider,{value:te,children:[ae&&(0,n.jsx)(b.J,{isOpen:ae,onClose:()=>re(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},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:()=>ge,rz:()=>at,Fp:()=>On,el:()=>Tn,ao:()=>Zt,oA:()=>D,Yt:()=>Ct,g4:()=>et,tn:()=>Ve,n4:()=>N,gD:()=>L,Vp:()=>Qe,Cx:()=>q,bK:()=>k,gi:()=>Je,Z$:()=>de,GT:()=>Ze,hr:()=>fe,JL:()=>le,Ck:()=>I,dU:()=>V,wG:()=>nr,hZ:()=>rn,$e:()=>Wt,qT:()=>Gn,GQ:()=>An,q3:()=>Ln,D_:()=>Bt,Uf:()=>$,_l:()=>be,Md:()=>ae,V7:()=>G,fe:()=>ue,JP:()=>Et,Z_:()=>w,zO:()=>me,UZ:()=>J,$7:()=>Ye,rb:()=>X,_W:()=>It,WS:()=>Ke,VF:()=>Fe,vf:()=>Ur,PV:()=>rt,PS:()=>In,Iz:()=>Dt,zD:()=>re,m3:()=>At,XP:()=>Tt,PM:()=>we,cX:()=>ne,G6:()=>te,Us:()=>De,AA:()=>xe,G0:()=>ht,mO:()=>We,HH:()=>ze,PU:()=>Ce,it:()=>zt,Tl:()=>ot,uH:()=>Yt,c3:()=>ve,rx:()=>P});var n=e(36087),t=e(14041);const r=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));o.displayName="UserPlus01";var a=e(8957);const i=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));i.displayName="UserX01";const b=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));b.displayName="Users01";const c=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),y=e(22716),m=e(9495);const p=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));p.displayName="Hash01";const d=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const g=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));g.displayName="Virus";const M=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));M.displayName="CreditCard02";const h=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const v=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));v.displayName="ClipboardCheck";const A=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));A.displayName="ClipboardPlus";const z=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));z.displayName="Route";const x=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M16 7c0-.93 0-1.395-.102-1.776a3 3 0 0 0-2.121-2.122C13.395 3 12.93 3 12 3c-.93 0-1.395 0-1.777.102a3 3 0 0 0-2.12 2.122C8 5.605 8 6.07 8 7M5.2 21h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 19.48 22 18.92 22 17.8v-7.6c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 7 19.92 7 18.8 7H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 8.52 2 9.08 2 10.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 21 4.08 21 5.2 21Z"}));x.displayName="Briefcase01";const T=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M12.913 17h7.174m-7.174 0L11 21m1.913-4 2.865-5.991c.231-.483.347-.724.505-.8a.5.5 0 0 1 .434 0c.158.076.274.317.505.8L20.087 17m0 0L22 21M2 5h6m0 0h3.5M8 5V3m3.5 2H14m-2.5 0c-.496 2.957-1.647 5.636-3.334 7.884M10 14a9.396 9.396 0 0 1-1.834-1.116m0 0C6.813 11.848 5.603 10.427 5 9m3.166 3.884A17.295 17.295 0 0 1 2 18"}));T.displayName="Translate01";const S=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M10 8.502a2.248 2.248 0 0 1 4.37.75c0 1.499-2.25 2.248-2.25 2.248m.03 3h.01M9.9 19.2l1.46 1.947c.217.29.326.434.459.486a.5.5 0 0 0 .362 0c.133-.052.242-.197.459-.486L14.1 19.2c.293-.39.44-.586.619-.735a2 2 0 0 1 .822-.412c.226-.053.47-.053.959-.053 1.398 0 2.097 0 2.648-.228a3 3 0 0 0 1.624-1.624C21 15.597 21 14.898 21 13.5V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C18.72 3 17.88 3 16.2 3H7.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C3 5.28 3 6.12 3 7.8v5.7c0 1.398 0 2.097.228 2.648a3 3 0 0 0 1.624 1.624C5.403 18 6.102 18 7.5 18c.489 0 .733 0 .96.053a2 2 0 0 1 .821.412c.18.149.326.344.619.735Z"}));S.displayName="AnnotationQuestion";const C=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M15 2.458A9.996 9.996 0 0 0 12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10c0-1.715-.432-3.33-1.193-4.74M17 5.75h.005M10.5 21.888v-2.203a.5.5 0 0 1 .12-.325l2.486-2.9a.5.5 0 0 0-.131-.76l-2.857-1.632a.499.499 0 0 1-.186-.187L8.07 10.62a.5.5 0 0 0-.478-.25l-5.528.492M21 6c0 2.21-2 4-4 6-2-2-4-3.79-4-6a4 4 0 0 1 8 0Zm-3.75-.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0Z"}));C.displayName="Globe05";const E=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M11.302 21.615c.221.129.332.194.488.227.122.026.298.026.42 0 .156-.034.267-.098.488-.227C14.646 20.478 20 16.908 20 12V7.217c0-.799 0-1.199-.13-1.542a2 2 0 0 0-.548-.79c-.275-.243-.65-.383-1.398-.664l-5.362-2.01c-.208-.078-.312-.117-.419-.133a1 1 0 0 0-.286 0c-.107.016-.21.055-.419.133L6.076 4.22c-.748.28-1.122.421-1.398.664a2 2 0 0 0-.547.79C4 6.018 4 6.418 4 7.217V12c0 4.908 5.354 8.478 7.302 9.615Z"}));E.displayName="Shield01";const R=({size:Ht=24,color:Qt="currentColor",...tn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ht,height:Ht,stroke:Qt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...tn},t.createElement("path",{d:"M21 15v1.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V15m14-7-5-5m0 0L7 8m5-5v12"}));R.displayName="Upload01";const P=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,L="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",D="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",N="http://hl7.org/fhir/questionnaire-item-control",w="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",V="http://hl7.org/fhir/StructureDefinition/minValue",k="http://hl7.org/fhir/StructureDefinition/maxValue",I="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",q="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",U="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",$="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",X="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",G="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",ae="http://hl7.org/fhir/StructureDefinition/entryFormat",re="http://hl7.org/fhir/StructureDefinition/tz-code",J="tz-code",ce="footer",ge="check-box",Ae="header",be="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ue="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",me="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",de=[{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"}],fe={"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"},le={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ne="ui-toolkit/CoordinatePicker",te="ui-toolkit/DetailsInfo",ve="ui-toolkit/ServiceChoice",xe="ui-toolkit/InfoBanner",we="ui-toolkit/Button",ze="ui-toolkit/Phone",De="ui-toolkit/ErrorCard",Se="ui-toolkit/FormContainer",We="ui-toolkit/PageHeader",ot="ui-toolkit/SelectableOption",ht="ui-toolkit/Modal",At="ui-toolkit/Alert",Tt="ui-toolkit/AppSectionAccess",Yt="ui-toolkit/SensitiveDataCategory",zt="ui-toolkit/QuestCard",Ye="http://icanbwell.com/fhir/StructureDefinition/subtitle",Ke="http://icanbwell.com/fhir/StructureDefinition/text-align",It={LEFT:"left",CENTER:"center"},nt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},et="http://icanbwell.com/fhir/StructureDefinition/icon-name",Zt="http://icanbwell.com/fhir/StructureDefinition/error-title",Tn="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",On="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",at="http://icanbwell.com/fhir/StructureDefinition/description",Wt="http://icanbwell.com/fhir/StructureDefinition/modal-description",Bt="http://icanbwell.com/fhir/StructureDefinition/modal-title",An="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",Gn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",rn="http://icanbwell.com/fhir/StructureDefinition/button-text",Ln="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",nr="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",In="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Ur="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Vr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",Dt="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Fe="http://icanbwell.com/fhir/StructureDefinition/trigger-color",rt="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Ze="http://hl7.org/fhir/StructureDefinition/mimeType",Qe="http://hl7.org/fhir/StructureDefinition/maxSize",Je="http://icanbwell.com/fhir/StructureDefinition/message-severity",lt="http://icanbwell.com/fhir/StructureDefinition/alert-color",Ct="http://icanbwell.com/fhir/StructureDefinition/hideLabel",st="http://icanbwell.com/fhir/StructureDefinition/placeholder",se="http://icanbwell.com/fhir/StructureDefinition/hint-text",Ce="ui-toolkit/PrefilledMemberDemographicsAlert",Ve="http://hl7.org/fhir/issue-severity",Te="http://icanbwell.com/fhir/StructureDefinition/button-type",xt="http://icanbwell.com/fhir/StructureDefinition/button-action",Kt="button-type",Cn="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",jn="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Sr="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Ft="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",Ne="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Xe={},Et={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":a.f,"user-x":i,"users-01":b,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:m.X,hash:p,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:g,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":M,"link-03":h,"search-lg":f.q,"clipboard-check":v,"clipboard-plus":A,route:z,"briefcase-01":x,"translate-01":T,"annotation-question":S,"globe-05":C,"shield-01":E,"upload-01":R}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>N,$O:()=>ht,CP:()=>Bt,Fy:()=>Wt,GN:()=>ge,J4:()=>lt,MU:()=>G,Nw:()=>rt,Qr:()=>C,Ue:()=>Ct,Yo:()=>xe,a0:()=>T,cz:()=>E,di:()=>I,eC:()=>st,iI:()=>q,lv:()=>k,mR:()=>Cn,nt:()=>S,od:()=>V,t7:()=>At,u0:()=>z,yQ:()=>Kt,zj:()=>le});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),a=e(27779),i=e.n(a),b=e(45250),c=e.n(b),u=e(16681),y=e(18807),m=e(1053),p=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(Lt,dn,cn)=>dn in Lt?p(Lt,dn,{enumerable:!0,configurable:!0,writable:!0,value:cn}):Lt[dn]=cn,v=(Lt,dn)=>{for(var cn in dn||(dn={}))M.call(dn,cn)&&f(Lt,cn,dn[cn]);if(g)for(var cn of g(dn))h.call(dn,cn)&&f(Lt,cn,dn[cn]);return Lt},A=(Lt,dn)=>d(Lt,O(dn));const z=(Lt,dn,cn,Dn)=>{if(Lt){const Jt=Lt(dn,v({defaultValue:cn},Dn));if(Jt&&Jt!==dn)return Jt}return Dn?Object.entries(Dn).reduce((Jt,[Ut,Bn])=>Jt.replace(`{{${Ut}}}`,String(Bn)),cn):cn},x=Lt=>{var dn;return(dn=Lt.filter(cn=>cn.url.includes("questionnaire-itemControl")).flatMap(cn=>{var Dn,Jt;return(Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)!=null?Jt:[]}).find(cn=>{var Dn;return(Dn=cn.code)==null?void 0:Dn.startsWith("ui-toolkit/")}))==null?void 0:dn.code},T=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.V7);return cn?.valueCode||"off"},S=(Lt,dn,cn)=>{const Dn=(0,y.A)(cn);return Lt&&dn&&cn?Dn.replace("<p>",`<span>${dn} `).replace("</p>","</span>").trim():Dn.replace("<p>","<span>").replace("</p>","</span>").trim()},C=Lt=>{const dn=Lt?.find(cn=>cn.url===m.Vp);return dn?.valueInteger},E=Lt=>{const dn=Lt?.find(cn=>cn.url===m.Z_);return dn?.valueInteger},R={date:"MM/DD/YYYY",choice:"Select an option"},P="Type your response here...",L=(Lt,dn)=>{const cn=Lt?.find(Dn=>Dn.url===PLACEHOLDER_EXTENSION_URL);return cn?.valueString||dn&&R[dn]||P},D=Lt=>{const dn=Lt?.find(cn=>cn.url===HINT_TEXT_EXTENSION_URL);return dn?.valueString},N=Lt=>{const dn=Lt?.filter(cn=>cn.url===m.GT&&cn.valueCode).map(cn=>m.hr[cn.valueCode]||cn.valueCode);return dn?.length?dn.join(","):void 0},w=Lt=>Lt.split(",").map(Dn=>Dn.trim()).map(Dn=>m.JL[Dn]||Dn).filter((Dn,Jt,Ut)=>Ut.indexOf(Dn)===Jt).join(", "),V=(Lt,dn,cn)=>{const Dn=w(Lt),Jt=Dn.lastIndexOf(","),Ut=Jt!==-1?`${Dn.substring(0,Jt)} or${Dn.substring(Jt+1)}`:Dn,Bn=[dn&&`max. ${parseFloat((dn/(1e3*1e3)).toFixed(1))}MB`,cn&&`upto ${cn} file${cn>1?"s":""}`].filter(Boolean);return Bn.length>0?`${Ut} (${Bn.join(", ")})`:Ut},k=Lt=>{const dn=Lt?.find(cn=>cn?.url===m.zD||cn?.url===m.UZ);return dn?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},I=(Lt,dn)=>{var cn,Dn,Jt;const Ut=dn?.find(Bn=>Bn.url.includes(Lt));return(Jt=(Dn=(cn=Ut?.valueInteger)!=null?cn:Ut?.valueDecimal)!=null?Dn:Ut?.valueString)!=null?Jt:Ut?.valueDate},q=Lt=>{if(!!Lt){if(/^\d{4}-\d{2}-\d{2}$/.test(Lt))return Lt;try{const dn=(0,a.evaluate)({},Lt);if(Array.isArray(dn)&&dn.length>0){const cn=dn[0];if(cn instanceof Date&&!isNaN(cn.getTime())){const Dn=cn.getFullYear(),Jt=String(cn.getMonth()+1).padStart(2,"0"),Ut=String(cn.getDate()).padStart(2,"0");return`${Dn}-${Jt}-${Ut}`}if(typeof cn=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(cn))return cn}}catch{}}},U=(Lt,dn)=>{var cn,Dn;const Jt=dn?.find(Bn=>Bn.url===Lt);if(!Jt)return;const Ut=(cn=Jt.valueString)!=null?cn:Jt.valueDate;return Ut||q((Dn=Jt.valueExpression)==null?void 0:Dn.expression)},$=(Lt,dn)=>{if(!(!Lt||Lt.length===0))for(const cn of Lt){const Dn=I(dn,cn.extension);if(Dn!==void 0)return Dn;if(cn.item&&cn.item.length>0){const Jt=$(cn.item,dn);if(Jt!==void 0)return Jt}}},X=(Lt,dn)=>{try{const cn=String(Lt??dn);let Dn;if(cn.includes("/"))Dn=(0,n.A)(cn,"MM/dd/yyyy",new Date);else{const Jt=cn.split("T")[0];Dn=(0,t.A)(Jt)}return(0,r.A)(Dn)}catch(cn){return console.error("Date parsing error:",cn,Lt),null}},G=(Lt,dn)=>{var cn;for(const Dn of Lt){if(Dn.linkId===dn)return Dn;if((cn=Dn.item)!=null&&cn.length){const Jt=G(Dn.item,dn);if(Jt!==void 0)return Jt}}},ae=(Lt,dn)=>{var cn;const Dn=[];for(const Jt of Lt)if(Jt.linkId===dn&&Dn.push(Jt),(cn=Jt.item)!=null&&cn.length){const Ut=ae(Jt.item,dn);Dn.push(...Ut)}return Dn},re=(Lt,dn,cn=0)=>ae(Lt,dn)[cn];function J(Lt){return Lt!=null}const ce=(Lt,dn)=>{var cn,Dn,Jt;if("answerString"in Lt&&J(Lt.answerString)){if(Lt.operator==="=")return dn?.valueString===Lt.answerString;if(Lt.operator==="!=")return dn?.valueString!==Lt.answerString}if("answerBoolean"in Lt&&J(Lt.answerBoolean)){if(Lt.operator==="=")return dn?.valueBoolean===Lt.answerBoolean;if(Lt.operator==="!=")return dn?.valueBoolean!==Lt.answerBoolean}if("answerInteger"in Lt&&J(Lt.answerInteger)||"answerDecimal"in Lt&&J(Lt.answerDecimal)){const Ut=Number(dn?.valueInteger||dn?.valueDecimal),Bn=Number(Lt.answerInteger||Lt.answerDecimal);if(Lt.operator==="=")return Ut===Bn;if(Lt.operator==="!=")return Ut!==Bn;if(Lt.operator===">")return Ut>Bn;if(Lt.operator==="<")return Ut<Bn;if(Lt.operator===">=")return Ut>=Bn;if(Lt.operator==="<=")return Ut<=Bn}if("answerQuantity"in Lt&&J(Lt.answerQuantity)){const Ut=dn?.valueQuantity,Bn=Lt.answerQuantity;if(Ut?.unit!==Bn?.unit)return!1;if(Lt.operator==="=")return Ut.value===Bn.value;if(Lt.operator==="!=")return Ut.value!==Bn.value;if(Lt.operator===">")return Ut.value>Bn.value;if(Lt.operator==="<")return Ut.value<Bn.value;if(Lt.operator===">=")return Ut.value>=Bn.value;if(Lt.operator==="<=")return Ut.value<=Bn.value}if("answerCoding"in Lt&&J(Lt.answerCoding)){const Ut=dn?.valueCoding,Bn=Lt.answerCoding;if(Lt.operator==="=")return Ut?.code===Bn.code;if(Lt.operator==="!=")return Ut?.code!==Bn.code}if("answerReference"in Lt&&J(Lt.answerReference)){const Ut=dn?.valueReference,Bn=Lt.answerReference;if(Lt.operator==="=")return Ut?.reference===Bn.reference;if(Lt.operator==="!=")return Ut?.reference!==Bn.reference}if("answerDate"in Lt&&J(Lt.answerDate)||"answerDateTime"in Lt&&J(Lt.answerDateTime)||"answerTime"in Lt&&J(Lt.answerTime)){const Ut=new Date((Jt=(Dn=(cn=dn?.valueDate)!=null?cn:dn?.valueDateTime)!=null?Dn:dn?.valueTime)!=null?Jt:""),Bn=new Date(Lt.answerDate||Lt.answerDateTime||Lt.answerTime||"");if(Lt.operator==="=")return Ut.getTime()===Bn.getTime();if(Lt.operator==="!=")return Ut.getTime()!==Bn.getTime();if(Lt.operator===">")return Ut.getTime()>Bn.getTime();if(Lt.operator==="<")return Ut.getTime()<Bn.getTime();if(Lt.operator===">=")return Ut.getTime()>=Bn.getTime();if(Lt.operator==="<=")return Ut.getTime()<=Bn.getTime()}return Lt.operator==="exists"?dn!=null===Lt.answerBoolean:!0},ge=(Lt,dn,cn)=>{const Dn=Jt=>{const Ut=ae(cn,Jt.question);return Ut.length===0||Ut.every(Bn=>!Bn.answer||Bn.answer.length===0)?ce(Jt,void 0):Ut.some(Bn=>{var ln;return(ln=Bn.answer)==null?void 0:ln.some(pn=>ce(Jt,pn&&Object.keys(pn).length>0?pn:void 0))})};return Lt&&Lt?.length>0?dn==="any"?Lt?.some(Jt=>Dn(Jt)):Lt?.every(Jt=>Dn(Jt)):!0},Ae=(Lt,dn,cn,Dn,Jt)=>{if(!Lt||Lt.length===0)return!0;const Ut=Bn=>{var ln;let pn;if(Dn&&typeof Jt=="number"){const pt=cn.filter(Pt=>Pt.linkId===Dn)[Jt];if(pt?.item){const Pt=pt.item.find(jt=>jt.linkId===Bn.question);if(Pt?.answer&&Pt.answer.length>0)return(ln=Pt?.answer)==null?void 0:ln.some(jt=>ce(Bn,jt&&Object.keys(jt).length>0?jt:void 0))}}if(!pn){const kt=ae(cn,Bn.question);if(kt.length>0)return kt.some(pt=>{var Pt;return(Pt=pt.answer)==null?void 0:Pt.some(jt=>ce(Bn,jt&&Object.keys(jt).length>0?jt:void 0))});pn=void 0}return ce(Bn,pn)};return dn==="any"?Lt.some(Bn=>Ut(Bn)):Lt.every(Bn=>Ut(Bn))},be=(Lt,dn)=>{var cn;if(!!((cn=Lt?.valueExpression)!=null&&cn.expression))try{const Dn=evaluate(dn,Lt.valueExpression.expression);return Array.isArray(Dn)?Dn.some(Jt=>Boolean(Jt)):Boolean(Dn)}catch{return}},oe=(Lt,dn)=>{var cn;const Dn=(cn=Lt.extension)==null?void 0:cn.find(Ut=>Ut.url===READ_ONLY_EXPRESSION_EXTENSION_URL),Jt=be(Dn,dn);return A(v({},Lt),{readOnly:Jt??Lt.readOnly})},ue=(Lt,dn,cn,Dn)=>{const{required:Jt,maxLength:Ut,type:Bn,extension:ln,enableWhen:pn,enableBehavior:kt,repeats:pt,answerOption:Pt}=Lt;if(!ge(pn,kt,dn)||Lt.type==="group"||Lt.type==="display")return"";if(pt)return me(Lt,dn,cn,Dn);const jt=ne(Lt,dn);return jt&&te(jt,Lt)?ve(Lt,dn,cn,jt,Dn):le(ln,Bn,Jt,Ut,cn,Pt,Dn)},me=(Lt,dn,cn,Dn)=>{const{required:Jt}=Lt;if(Jt){if(!cn||cn.length===0)return z(Dn,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required");let Ut=!1;for(let Bn=0;Bn<cn.length;Bn++){const ln=cn[Bn];if(ln&&Object.keys(ln).length>0&&Object.values(ln).some(kt=>kt!=null&&kt!==""&&(Array.isArray(kt)?kt.length>0:!0))){Ut=!0;const kt=le(Lt.extension,Lt.type,!0,Lt.maxLength,[ln],Lt.answerOption,Dn);if(kt)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Bn+1,error:kt});if(Lt.item&&Lt.item.length>0){const pt=de(Lt.item,dn,Lt.linkId,Bn,Dn);if(pt)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Bn+1,error:pt})}}else return z(Dn,Translations.VALIDATION_ITEM_FIELD_REQUIRED,"Item {{index}}: This field is required",{index:Bn+1})}if(!Ut)return z(Dn,Translations.VALIDATION_AT_LEAST_ONE_REQUIRED,"At least one item is required")}else if(cn&&cn.length>0)for(let Ut=0;Ut<cn.length;Ut++){const Bn=cn[Ut];if(Bn&&Object.keys(Bn).length>0&&Object.values(Bn).some(pn=>pn!=null&&pn!==""&&(Array.isArray(pn)?pn.length>0:!0))){const pn=le(Lt.extension,Lt.type,!1,Lt.maxLength,[Bn],Lt.answerOption,Dn);if(pn)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Ut+1,error:pn});if(Lt.item&&Lt.item.length>0){const kt=de(Lt.item,dn,Lt.linkId,Ut,Dn);if(kt)return z(Dn,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Ut+1,error:kt})}}}return""},de=(Lt,dn,cn,Dn,Jt)=>{var Ut,Bn;for(const ln of Lt){if(!Ae(ln.enableWhen,ln.enableBehavior,dn,cn,Dn))continue;const pn=G(dn,cn),kt=(Ut=pn?.item)==null?void 0:Ut.find(Pt=>Pt.linkId===ln.linkId),pt=(Bn=kt?.answer)!=null&&Bn[Dn]?[kt.answer[Dn]]:void 0;if(ln.required){if(!pt||!pt[0]||!fe(pt[0]))return z(Jt,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:ln.text||ln.linkId});const Pt=le(ln.extension,ln.type,!0,ln.maxLength,pt,ln.answerOption,Jt);if(Pt)return`${ln.text||ln.linkId}: ${Pt}`}else if(pt&&pt[0]&&fe(pt[0])){const Pt=le(ln.extension,ln.type,!1,ln.maxLength,pt,ln.answerOption,Jt);if(Pt)return`${ln.text||ln.linkId}: ${Pt}`}if(ln.item&&ln.item.length>0){const Pt=de(ln.item,dn,ln.linkId,Dn,Jt);if(Pt)return Pt}}return""},fe=Lt=>!Lt||Object.keys(Lt).length===0?!1:Object.values(Lt).some(dn=>dn!=null&&dn!==""&&(Array.isArray(dn)?dn.length>0:!0)),le=(Lt,dn,cn,Dn,Jt,Ut,Bn)=>{var ln,pn,kt,pt,Pt;let jt="";const Mn=!!Lt?.find(Or=>{var Dr,oo;return Or.url===m.gD&&((oo=(Dr=Or.valueCodeableConcept)==null?void 0:Dr.coding)==null?void 0:oo.some(mi=>mi.system===m.n4&&mi.code===m.GI))}),nn=Jt?.[0],yn={choice:((ln=nn?.valueCoding)==null?void 0:ln.code)||(nn?.valueString&&Ut?.some(Or=>Or.valueString===nn.valueString)?nn.valueString:null),"open-choice":((pn=nn?.valueCoding)==null?void 0:pn.code)||nn?.valueString,boolean:nn?.valueBoolean,string:nn?.valueString,text:nn?.valueString,url:nn?.valueUri,integer:nn?.valueInteger,decimal:nn?.valueDecimal,dateTime:nn?.valueDateTime,date:nn?.valueDate,time:nn?.valueTime,quantity:(kt=nn?.valueQuantity)==null?void 0:kt.value,reference:(pt=nn?.valueReference)==null?void 0:pt.display,attachment:(Pt=nn?.valueAttachment)==null?void 0:Pt.title};if(!(dn in yn))return"";const Yn=yn[dn],kr={required:()=>cn&&(Yn==null||Yn===""||Yn==="NaN"||Number.isNaN(Yn)||dn==="boolean"&&Yn!==!0&&Mn)?z(Bn,u.p.VALIDATION_FIELD_REQUIRED,"This field is required"):"",maxLength:()=>Dn&&Yn!==null&&Yn!==void 0&&Yn.toString().length>Dn?z(Bn,u.p.VALIDATION_MAX_LENGTH,"Input should not exceed {{maxLength}} characters",{maxLength:Dn}):"",minLength:()=>{const Or=I("minLength",Lt);return Or&&Yn!==null&&Yn!==void 0&&Yn.toString().length<Number(Or)?z(Bn,u.p.VALIDATION_MIN_LENGTH,"Input should be at least {{minLength}} characters",{minLength:Or}):""},urlRegex:()=>{const Or=new RegExp(m.rx),Dr=I("regexError",Lt),oo=Dr??z(Bn,u.p.VALIDATION_INVALID_URL,"Please enter a valid url starting from http:// and https://");return Or&&dn==="url"&&Yn&&!Or.test(Yn)?String(oo):""},regex:()=>{const Or=I("regex",Lt);if(!Or||typeof Yn!="string")return"";const Dr=new RegExp(Or),oo=I("regexError",Lt),mi=oo??z(Bn,u.p.VALIDATION_INVALID_INPUT,"Please enter a valid input");return Dr&&Yn&&!Dr.test(Yn)?String(mi):""},dateTime:()=>{if(dn==="dateTime"&&Yn){const Or=Yn?.toString(),Dr=new Date(Or);return isNaN(Dr.getTime())?z(Bn,u.p.VALIDATION_INVALID_DATETIME,"Please enter a valid date-time"):""}return""},date:()=>{if(dn!=="date"||!Yn)return"";const Or=Yn.replace(/\D/g,"");return Or.length>0&&Or.length<8||isNaN(new Date(Yn).getTime())?z(Bn,u.p.VALIDATION_INVALID_DATE,"Invalid date"):""},minValue:()=>{var Or;if(dn==="date"){const oo=U(m.dU,Lt),mi=X(oo??"01/01/1900","01/01/1900"),Do=X(Yn,"");if(!mi||!Do)return"";if((0,s.A)(Do,mi)){const qo=(Or=Lt?.find(Lo=>Lo.url===m.Ck))==null?void 0:Or.valueString;return qo??z(Bn,u.p.VALIDATION_DATE_BEFORE_MIN,"Date should not be before {{minDate}}",{minDate:oo??"01/01/1900"})}return""}const Dr=I("minValue",Lt);return Dr!=null&&Yn!==null&&Yn!==void 0&&Yn<Dr?z(Bn,u.p.VALIDATION_MIN_VALUE,"Input should not be less than {{minValue}}",{minValue:Dr}):""},maxValue:()=>{var Or;if(dn==="date"){const oo=U(m.bK,Lt),mi=X(oo??"01/01/2100","01/01/2100"),Do=X(Yn,"");if(!mi||!Do)return"";if((0,o.A)(Do,mi)){const qo=(Or=Lt?.find(Lo=>Lo.url===m.Cx))==null?void 0:Or.valueString;return qo??z(Bn,u.p.VALIDATION_DATE_AFTER_MAX,"Date should not be after {{maxDate}}",{maxDate:oo??"01/01/2100"})}return""}const Dr=I("maxValue",Lt);return Dr!=null&&Yn!==null&&Yn!==void 0&&Yn>Dr?z(Bn,u.p.VALIDATION_MAX_VALUE,"Input should not exceed {{maxValue}}",{maxValue:Dr}):""}};return jt=kr.required()||kr.maxLength()||kr.minLength()||kr.urlRegex()||kr.regex()||kr.dateTime()||kr.date()||kr.minValue()||kr.maxValue()||"",jt},ne=(Lt,dn)=>{for(const cn of dn)if(cn.item){if(cn.item.find(Ut=>Ut.linkId===Lt.linkId))return cn;const Jt=ne(Lt,cn.item);if(Jt)return Jt}return null},te=(Lt,dn)=>{if(Lt.answer&&Lt.answer.length>1)return!0;if(Lt.item){const cn=Lt.item.find(Dn=>Dn.linkId===dn.linkId);if(cn&&cn.answer&&cn.answer.length>1)return!0}return!1},ve=(Lt,dn,cn,Dn,Jt)=>{var Ut,Bn;const{required:ln}=Lt,pn=(Ut=Dn.item)==null?void 0:Ut.find(Pt=>Pt.linkId===Lt.linkId),kt=pn?.answer||[],pt=((Bn=Dn.answer)==null?void 0:Bn.length)||1;for(let Pt=0;Pt<pt;Pt++){const jt=kt[Pt];if(ln){if(!jt||!fe(jt))return z(Jt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:z(Jt,Translations.VALIDATION_NAMED_FIELD_REQUIRED,"{{fieldName}} is required",{fieldName:Lt.text||Lt.linkId})});const Mn=le(Lt.extension,Lt.type,!0,Lt.maxLength,[jt],Lt.answerOption,Jt);if(Mn)return z(Jt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:Mn})}else if(jt&&fe(jt)){const Mn=le(Lt.extension,Lt.type,!1,Lt.maxLength,[jt],Lt.answerOption,Jt);if(Mn)return z(Jt,Translations.VALIDATION_ITEM_ERROR,"Item {{index}}: {{error}}",{index:Pt+1,error:Mn})}}return""},xe=(Lt,dn)=>{for(const cn of Lt){if(cn?.linkId===dn)return cn;if(cn?.item&&cn.item.length>0){const Dn=xe(cn.item,dn);if(Dn)return Dn}}},we=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,Jt;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:Jt.some(Ut=>Ut.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ut.code===FOOTER_CODE))}))},ze=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===m.oA&&cn.valueBoolean))},De=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,Jt;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:Jt.some(Ut=>Ut.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ut.code===HEADER_CODE))}))},Se=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,Jt;return cn.url===m.gD&&((Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:Jt.some(Ut=>Ut.system===m.n4&&Ut.code===m._l))}))},We=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&cn.valueBoolean))},ot=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>{var Dn,Jt;return cn.url===ITEM_CONTROL_EXTENSION_URL&&((Jt=(Dn=cn.valueCodeableConcept)==null?void 0:Dn.coding)==null?void 0:Jt.some(Ut=>Ut.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Ut.code===CHECKBOX_CODE))}))},ht=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.fe);return cn?.valueInteger},At=Lt=>{var dn;const cn=(dn=Lt.extension)==null?void 0:dn.find(Dn=>Dn.url===m.zO);return cn?.valueInteger},Tt=Lt=>{var dn;const cn=(dn=Lt?.extension)==null?void 0:dn.find(Dn=>Dn.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return cn?.valueInteger},Yt=(Lt,dn,cn,Dn,Jt,Ut)=>{const Bn=pn=>dn.filter(kt=>kt.linkId===pn),ln=new Set;return Lt.map(pn=>{if(ln.has(pn.linkId)||we(pn))return null;const pt=Bn(pn.linkId),Pt=pn.type==="group"&&pn.repeats;if(ln.add(pn.linkId),Pt){const jt=[];if(pt.forEach((Mn,nn)=>{const yn={linkId:pn.linkId,text:pn.text};let Yn;if(cn===pn.linkId&&typeof Ut=="number"&&Ut===nn&&Jt&&Jt.length>0){const kr=Mn?.item||[];Yn=[...kr],Jt.forEach(Or=>{const Dr=Yn.findIndex(oo=>oo.linkId===Or.linkId);Dr>=0?Yn[Dr]=A(v({},kr[Dr]),{answer:Or.answer}):Yn.push(Or)})}else pn.item&&(Yn=Yt(pn.item,Mn?.item||[],cn,Dn,Jt,nn));cn===pn.linkId&&typeof Ut=="number"&&Ut===nn&&Dn?yn.answer=Dn:yn.answer=Mn.answer||[{}],Yn&&Yn.length>0?yn.item=Yn:Mn.item&&(yn.item=Mn.item),jt.push(yn)}),cn===pn.linkId&&typeof Ut=="number"&&Ut>=pt.length)for(let Mn=pt.length;Mn<=Ut;Mn++){const nn={linkId:pn.linkId,text:pn.text,answer:Mn===Ut&&Dn?Dn:[{}]};Mn===Ut&&Jt&&Jt.length>0?nn.item=Jt:pn.item&&(nn.item=Yt(pn.item,[],void 0,void 0,void 0,void 0)),jt.push(nn)}return jt}else if(pn.repeats&&typeof Ut=="number"&&cn===pn.linkId){const jt=pt[0]||{linkId:pn.linkId,text:pn.text,answer:[]},Mn={linkId:pn.linkId,text:pn.text,answer:[...jt.answer||[]]};if(Dn&&Dn.length>0){for(;Mn.answer.length<=Ut;)Mn.answer.push({});Mn.answer[Ut]=Dn[0]}return Mn}else{const jt=pt[0],Mn=pn.item?Yt(pn.item,jt?.item||[],cn,Dn,Jt,Ut):void 0,nn=Mn&&Mn.length>0,yn={linkId:pn.linkId,text:pn.text};return cn&&pn.linkId===cn&&typeof Ut!="number"?(Dn||!Dn&&!Jt?yn.answer=Dn:jt?.answer&&(yn.answer=jt.answer),Jt?yn.item=Jt:nn&&(yn.item=Mn)):(jt?.answer?yn.answer=jt.answer:yn.answer=[{}],nn&&(yn.item=Mn)),yn}}).filter(Boolean).flat()},zt=(Lt,dn)=>{for(const cn of Lt)if(cn.linkId===dn||cn.item&&zt(cn.item,dn))return cn.linkId;return null},Ye=(Lt,dn,cn,Dn)=>{var Jt;const Ut=(Jt=Lt?.item)!=null?Jt:Dn;return!Ut||Ut.length===0?!0:Ut.every(Bn=>{var ln;const pn=ae(dn,Bn.linkId);if(pn.length===0){const kt=(ln=G(dn,Bn.linkId))==null?void 0:ln.answer;if(ue(Bn,dn,kt)&&ge(Bn.enableWhen,Bn.enableBehavior,dn)&&cn.includes(Bn.linkId))return!1}else for(const kt of pn)if(ue(Bn,dn,kt.answer)&&ge(Bn.enableWhen,Bn.enableBehavior,dn)&&cn.includes(Bn.linkId))return!1;return Bn.item?Ye(Bn,dn,cn):!0})},Ke=(Lt,dn,cn=!0)=>{for(const Dn of Lt)if(Dn.linkId===dn&&Dn.answer&&Dn.answer.length>0||Dn.item&&Dn.item.length>0&&Ke(Dn.item,dn,cn))return!0;return!1},It=(Lt,dn,cn=0)=>{const Dn=Lt.filter(Jt=>Jt.linkId===dn);if(Dn.length>cn){const Jt=Dn[cn];if(Jt.answer&&Jt.answer.length>0)return Jt.answer.some(Ut=>Ut&&Object.keys(Ut).length>0&&Object.values(Ut).some(Bn=>Bn!=null&&Bn!==""));if(Jt.item&&Jt.item.length>0)return Ke(Jt.item,dn,!1)}return Ke(Lt,dn,!1)},nt=(Lt,dn)=>{if(!Lt||!Lt.item)return!1;const cn=Dn=>{var Jt;if(ze(Dn)&&Dn.required&&ge(Dn.enableWhen,Dn.enableBehavior,dn)){const Ut=G(dn,Dn.linkId),Bn=le(Dn.extension,Dn.type,Dn.required,Dn.maxLength,Ut?.answer,Dn.answerOption);if(!((Jt=Ut?.answer)!=null&&Jt.length)||Bn)return!0}if(Dn.item){for(const Ut of Dn.item)if(cn(Ut))return!0}return!1};for(const Dn of Lt.item)if(cn(Dn))return!0;return!1},et=Lt=>{var dn,cn,Dn;if(Lt.valueString!==void 0)return Lt.valueString;if(Lt.valueBoolean!==void 0)return Lt.valueBoolean;if(Lt.valueInteger!==void 0)return Lt.valueInteger;if(Lt.valueDecimal!==void 0)return Lt.valueDecimal;if(Lt.valueDate!==void 0)return Lt.valueDate;if(Lt.valueDateTime!==void 0)return Lt.valueDateTime;if(((dn=Lt.valueCoding)==null?void 0:dn.code)!==void 0)return Lt.valueCoding.code;if(((cn=Lt.valueReference)==null?void 0:cn.reference)!==void 0)return Lt.valueReference.reference;if(((Dn=Lt.valueQuantity)==null?void 0:Dn.value)!==void 0)return Lt.valueQuantity.value;if(Lt.valueAttachment!==void 0)return Lt.valueAttachment},Zt=Lt=>{const dn={linkId:Lt.linkId};if(Lt.answer&&Lt.answer.length>0){const cn=Lt.answer.map(Dn=>et(Dn)).filter(Dn=>Dn!==void 0);cn.length>0&&(dn.answer=cn)}if(Lt.item&&Lt.item.length>0){const cn=Lt.item.map(Dn=>Zt(Dn)).filter(Dn=>{const Jt=Object.keys(Dn);return Jt.length>1||Jt.length===1&&Jt[0]!=="linkId"});cn.length>0&&(dn.item=cn)}return dn},Tn=(Lt,dn,cn,Dn,Jt,Ut)=>{var Bn;const ln=(Bn=dn?.item)==null?void 0:Bn[cn[Dn]],pn=ln?.linkId;if(!pn)return!1;const kt=ae(Lt,pn),pt=ae(Jt,pn),Pt=jt=>{if(jt!=null){if(Array.isArray(jt)){const Mn=jt.filter(nn=>nn!=null).map(nn=>Pt(nn)).filter(nn=>nn!==void 0);return Mn.length===0||Mn.length===1&&typeof Mn[0]=="object"&&Object.keys(Mn[0]).length===0?void 0:Mn}if(typeof jt=="object"){const Mn={};for(const[nn,yn]of Object.entries(jt))if(yn!=null){const Yn=Pt(yn);Yn!==void 0&&(Mn[nn]=Yn)}return Object.keys(Mn).length===0?void 0:Mn}return jt}};if(kt.length!==pt.length)return!1;for(let jt=0;jt<kt.length;jt++){const Mn=kt[jt],nn=pt[jt];if(!Mn||!nn)return!1;const yn=Zt(Pt(Mn)),Yn=Zt(Pt(nn));if(!_.isEqual(yn,Yn))return!1}return Dn!==Ut},On=(Lt,dn,cn,Dn)=>cn&&cn.length>0&&!(cn.length===1&&Object.keys(cn[0]).length===0)&&ue(Lt,dn,cn,Dn)||null,at=(Lt,dn,cn)=>{const Dn={},Jt=Ut=>{Ut.forEach(Bn=>{const ln=ae(dn,Bn.linkId);if(Ce(Bn,Lt)||Bn.repeats)for(let pn=0;pn<ln.length;pn++){const kt=ln[pn];if(kt?.answer&&kt.answer.length>0){const pt=On(Bn,dn,kt.answer,cn);pt&&(Dn[Bn.linkId]=A(v({},Dn[Bn.linkId]),{[pn]:pt}))}}else{const pn=G(dn,Bn.linkId);if(pn?.answer&&pn.answer.length>0){const kt=On(Bn,dn,pn.answer,cn);kt&&(Dn[Bn.linkId]={0:kt})}}Bn.item&&Bn.item.length>0&&Jt(Bn.item)})};return Jt(Lt),Dn},Wt=Lt=>{if(!Lt)return"";const dn=Lt.split("-");if(dn.length===3){const[cn,Dn,Jt]=dn;return`${cn.slice(-4)}-${Dn}-${Jt}`}return""},Bt=Lt=>Lt.trim().replace(/[A-Za-z]+/g,""),An=(Lt,dn)=>{const cn=(Dn,Jt)=>{for(const Ut of Dn){if(Ut.linkId===Jt)return Ut.answer;if(Ut.item&&Ut.item.length>0){const Bn=cn(Ut.item,Jt);if(Bn!==void 0)return Bn}}};return cn(Lt,dn)},Gn=(Lt,dn)=>{if(!dn||dn.length===0)return null;const cn=Lt.linkId,Dn=(Jt,Ut,Bn=[])=>{for(const ln of Jt){const pn=[...Bn,ln];if(ln.item){if(ln.item.some(Pt=>Pt.linkId===Ut))return pn.some(Pt=>Pt.repeats===!0)?ln:null;if(Dn(ln.item,Ut,pn))return ln}}return null};return Dn(dn,cn)},rn=(Lt,dn)=>{if(!dn||dn.length===0)return!1;const cn=Lt.linkId,Dn=(Jt,Ut,Bn=[])=>{for(const ln of Jt){const pn=[...Bn,ln];if(ln.item){if(ln.item.some(Pt=>Pt.linkId===Ut))return pn.some(Pt=>{const jt=x(Pt.extension||[]);return!!jt&&jt!==UI_TOOLKIT_FORM_CONTAINER});if(Dn(ln.item,Ut,pn))return!0}}return!1};return Dn(dn,cn)},Ln=(Lt,dn,cn)=>{const Dn={};if(!Lt)return Dn;const{linkId:Jt}=dn;if(Lt[Jt]){const Ut=Lt[Jt];Dn[Jt]=Ut[cn]||""}return dn.item&&dn.item.length>0&&dn.item.forEach(Ut=>{if(Lt[Ut.linkId]){const Bn=Lt[Ut.linkId];Dn[Ut.linkId]=Bn[cn]||""}}),Dn},nr=(Lt,dn)=>{const cn={};if(!Lt||!Lt[dn])return cn;const Dn=Lt[dn];return cn[dn]=Dn[0]||"",cn},In=Lt=>{const dn=Lt.findIndex(Ut=>!ze(Ut)),cn=dn>=0?[dn]:[],Dn=new Map;let Jt=null;if(Lt.forEach((Ut,Bn)=>{const ln=Se(Ut);if(ln&&Ut.type==="group")Bn!==dn&&cn.push(Bn),Dn.set(Bn,[Bn]),Jt=Bn;else if(Jt!==null&&!ln){const pn=Dn.get(Jt)||[];Dn.set(Jt,[...pn,Bn])}}),Lt.length>0&&cn.length>0){const Ut=cn[0];if(!Dn.has(Ut)){const Bn=cn.find(pn=>pn>Ut),ln=[];for(let pn=Ut;pn<(Bn??Lt.length);pn++)ln.push(pn);Dn.set(Ut,ln)}}return{groupIndices:cn,itemsToRenderMap:Dn}},Ur=(Lt,dn,cn,Dn)=>{let Jt=[...Dn];const Ut=(Bn,ln)=>{Bn.forEach(pn=>{if((!pn?.enableWhen||ge(pn?.enableWhen,pn.enableBehavior,ln))&&pn.initial&&!Ke(ln,pn.linkId))if(pn.repeats){const kt=ln.filter(pt=>pt.linkId===pn.linkId);kt.length>0?kt.forEach((pt,Pt)=>{It(ln,pn.linkId,Pt)||(Jt=Yt(cn,Jt,pn.linkId,pn.initial,void 0,Pt))}):Jt=Yt(cn,Jt,pn.linkId,pn.initial)}else Jt=Yt(cn,Jt,pn.linkId,pn.initial);pn.item&&Ut(pn.item,ln)})};return Ut(Lt,dn),Jt},Vr=(Lt,dn,cn)=>{if(!Lt)return[];const Dn=[],Jt=Ut=>{Ut.required===dn&&ge(Ut.enableWhen,Ut.enableBehavior,cn)&&!ze(Ut)&&Ut.type!=="display"&&Dn.push(Ut),Ut.item&&Ut.item.length>0&&Ut.item.forEach(Jt)};return Lt.forEach(Jt),Dn},Dt=(Lt,dn)=>Lt.every(cn=>{var Dn;const Jt=ae(dn,cn.linkId);if(Jt.length>0)return Jt.every(Ut=>!ue(cn,dn,Ut.answer));{const Ut=(Dn=G(dn,cn.linkId))==null?void 0:Dn.answer;return!ue(cn,dn,Ut)}}),Fe=(Lt,dn)=>{let cn=-1;for(let Dn=Lt.length-1;Dn>=0;Dn--)if(Lt[Dn].linkId===dn){cn=Dn;break}return cn},rt=(Lt,dn)=>Lt.filter(cn=>cn.linkId!==dn).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:rt(cn.item,dn)}):cn),Ze=(Lt,dn,cn=Lt)=>Lt.reduce((Dn,Jt)=>{const Ut=xe(dn,Jt.linkId);return Ut?.enableWhen&&!ge(Ut.enableWhen,Ut.enableBehavior,cn)||(Jt.item&&Jt.item.length>0?Dn.push(A(v({},Jt),{item:Ze(Jt.item,dn,cn)})):Dn.push(Jt)),Dn},[]),Qe=(Lt,dn,cn=[])=>{const Dn=[],Jt=Ut=>{Ut.forEach(Bn=>{Dn.push(Bn.linkId),Bn.item&&Bn.item.length>0&&Jt(Bn.item)})};for(let Ut=0;Ut<Lt.length;Ut++){const Bn=Lt[Ut];if(Bn.linkId===dn){const ln=Lt.slice(0,Ut+1),pn=Lt.slice(Ut+1),{kept:kt,removed:pt}=pn.reduce((Pt,jt)=>{const Mn=xe(cn,jt.linkId);return!Mn||ze(Mn)&&ge(Mn.enableWhen,Mn.enableBehavior,ln)?Pt.kept.push(jt):Pt.removed.push(jt),Pt},{kept:[],removed:[]});return Jt(pt),{trimmedData:[...ln,...kt],trimmedLinkIds:Dn,found:!0}}if(Bn.item&&Bn.item.length>0){const ln=Qe(Bn.item,dn,cn);if(ln.found){const pn=Lt.slice(0,Ut),kt=Lt.slice(Ut+1),pt=[...pn,A(v({},Bn),{item:ln.trimmedData})],{kept:Pt,removed:jt}=kt.reduce((Mn,nn)=>{const yn=xe(cn,nn.linkId);return!yn||ze(yn)&&ge(yn.enableWhen,yn.enableBehavior,pt)?Mn.kept.push(nn):Mn.removed.push(nn),Mn},{kept:[],removed:[]});return Jt(jt),{trimmedData:[...pt,...Pt],trimmedLinkIds:[...ln.trimmedLinkIds,...Dn],found:!0}}}}return{trimmedData:Lt,trimmedLinkIds:[],found:!1}},Je=(Lt,dn)=>Lt.filter(cn=>!dn.includes(cn.linkId)).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:Je(cn.item,dn)}):cn),lt=Lt=>{var dn;if(!Lt)return"empty";const cn=m.Z$.find(({patterns:Dn})=>Dn.some(Jt=>Lt.includes(Jt)));return(dn=cn?.type)!=null?dn:"empty"},Ct=(Lt,dn)=>{const{groupIndices:cn}=In(Lt),Dn=Lt.findIndex(Jt=>Jt.linkId===dn);return Dn!==-1?cn.indexOf(Dn):-1},st=Lt=>{if(!Lt)return{restriction:null,warning:null};const dn=cn=>{const Dn=Lt.find(Ut=>Ut.url===cn&&Ut.valueString);if(!Dn?.valueString)return null;const Jt=Dn.valueString.replace(/\\n/g,`
870
870
  `).split(`
871
871
  `).map(Ut=>Ut.trim()).filter(Boolean).map(Ut=>Ut.startsWith("*")?Ut.substring(1).trim():Ut);return Jt.length===0?null:Jt.length===1?{isList:!1,items:Jt}:{isList:!0,items:Jt}};return{restriction:dn("restriction"),warning:dn("warning")}},se=(Lt,dn)=>{var cn;switch(dn.type){case"boolean-to-string":return typeof Lt=="boolean"?Lt?dn.trueValue:dn.falseValue:Lt;case"map":return dn.mapping&&Lt in dn.mapping?dn.mapping[Lt]:Lt;case"date-format":return Lt;case"number-format":if(typeof Lt=="number"){let Dn=Lt.toFixed((cn=dn.decimals)!=null?cn:0);return dn.prefix&&(Dn=dn.prefix+Dn),dn.suffix&&(Dn=Dn+dn.suffix),Dn}return Lt;case"passthrough":default:return Lt}},Ce=(Lt,dn)=>{const cn=Lt.linkId,Dn=(Ut,Bn,ln=[])=>{for(const pn of Ut){const kt=[...ln,pn];if(pn.item){if(pn.item.some(jt=>jt.linkId===Bn))return kt.filter(jt=>jt.repeats===!0);const Pt=Dn(pn.item,Bn,kt);if(Pt.length>0)return Pt}}return[]},Jt=Dn(dn,cn);return Jt.length>0?Jt[Jt.length-1]:null},Ve=(Lt,dn)=>{if(!Lt?.item)return[];const cn=[];for(const Dn of Lt.item){if(Dn.type!=="group")continue;ge(Dn.enableWhen,Dn.enableBehavior,dn||[])&&Dn.linkId&&cn.push(Dn.linkId)}return cn},Te=(Lt,dn)=>{const cn=Ve(Lt,dn||void 0);return cn[cn.length-1]},xt=({questionnaire:Lt,extensionUrl:dn,errorCode:cn})=>{if(!cn||!Lt?.item)return;const Dn=Lt.item.find(Jt=>{var Ut;return(Ut=Jt.extension)==null?void 0:Ut.some(Bn=>Bn.url===dn&&Bn.valueString===cn)});return Dn?.linkId},Kt=(Lt,dn)=>{var cn;const Dn=(cn=Lt.extension)==null?void 0:cn.find(Ut=>Ut.url===m.rb);if(!Dn?.valueString)return;const Jt=Dn.valueString;return xe(dn,Jt)},Cn=Lt=>{var dn;return!!((dn=Lt.extension)!=null&&dn.find(cn=>cn.url===m.rb))},jn=(Lt,dn)=>Lt.filter(cn=>cn.linkId!==dn).map(cn=>cn.item&&cn.item.length>0?A(v({},cn),{item:jn(cn.item,dn)}):cn),Sr=Lt=>{const dn=I(ANALYTICS_FORM_NAME_EXTENSION_URL,Lt.extension);return dn??$(Lt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},Ft=Lt=>I(ANALYTICS_EVENT_NAME_EXTENSION_URL,Lt.extension),Ne=Lt=>I(ANALYTICS_PAGE_NAME_EXTENSION_URL,Lt.extension),Xe=Lt=>I(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,Lt.extension),Et=Lt=>I(ANALYTICS_OPTION_NAME_EXTENSION_URL,Lt),Ht=(Lt,dn)=>{var cn,Dn,Jt;if(!Lt.answerOption)return;const Ut=G(dn,Lt.linkId),Bn=(Jt=(Dn=(cn=Ut?.answer)==null?void 0:cn[0])==null?void 0:Dn.valueCoding)==null?void 0:Jt.code;if(!Bn)return;const ln=Lt.answerOption.find(pn=>{var kt;return((kt=pn.valueCoding)==null?void 0:kt.code)===Bn});if(!!ln)return Et(ln.extension)},Qt=(Lt,dn)=>{const cn={},Dn=Jt=>{if(!!Jt)for(const Ut of Jt){const Bn=Xe(Ut);if(Bn){let ln;switch(Ut.type){case"choice":ln=Ht(Ut,dn);break;default:break}ln&&(cn[Bn]=ln)}Ut.item&&Ut.item.length>0&&Dn(Ut.item)}};return Dn(Lt.item),cn},tn=Lt=>!!(Lt.initial&&Lt.initial.length>0),kn=(Lt,dn,cn,Dn)=>{if(!Lt)return[];const Jt=[],Ut=Bn=>{Bn.forEach(ln=>{if(cn&&cn.includes(ln.linkId)||Dn&&ln.enableWhen&&!ge(ln.enableWhen,ln.enableBehavior,Dn))return;const pn=ze(ln),kt=dn.includes(ln.linkId);(kt||pn&&ln.required)&&Jt.push(ln),kt&&ln.item&&ln.item.length>0&&Ut(ln.item)})};return Ut(Lt),Jt},Hr=(Lt,dn,cn,Dn,Jt,Ut)=>{var Bn;if(cn<0||!Dn?.item)return!0;const ln=Jt.current[cn],pn=cn+1,kt=Jt.current[pn],pt=cn===0?0:ln,Pt=kt??Dn.item.length,jt=[];for(let kr=pt;kr<Pt;kr++){const Or=(Bn=Dn?.item)==null?void 0:Bn[kr];if(Or){if(Ut&&Ut.includes(Or.linkId)||Or.enableWhen&&!ge(Or.enableWhen,Or.enableBehavior,Lt))continue;const Dr=ze(Or);(dn.includes(Or.linkId)||Dr&&Or.required)&&jt.push(Or),Or.item&&Or.item.length>0&&jt.push(...kn(Or.item,dn,Ut,Lt))}}const Mn=jt.filter(kr=>kr.required===!0),nn=jt.filter(kr=>kr.required!==!0),yn=Dt(Mn,Lt),Yn=nn?.every(kr=>{var Or;const Dr=(Or=G(Lt,kr.linkId))==null?void 0:Or.answer;return Dr?!ue(kr,Lt,Dr):!0});return!Mn?.length||yn&&Yn}},32957:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(44738),s=e(36087),o=e(8322),a=e(1053),i=e(25624);const b=({item:Qn})=>{const Fr=Qn.text||"",qr=Qn.extension||[],Hi=H0=>{var W0;return(W0=qr.find(L0=>L0.url===H0))==null?void 0:W0.valueString},$i=Hi(a.$7),Wi=Hi(a.pc)||"default";return(0,n.jsx)(s.AlertFloating,{title:Fr,description:$i??"",color:Wi})};var c=e(7630),u=e(16212),y=Object.defineProperty,m=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(Qn,Fr,qr)=>Fr in Qn?y(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,g=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))p.call(Fr,qr)&&O(Qn,qr,Fr[qr]);if(m)for(var qr of m(Fr))d.call(Fr,qr)&&O(Qn,qr,Fr[qr]);return Qn};const M=({item:Qn})=>{const[Fr,qr]=(0,t.useState)(!1),Hi=Qn.extension||[],$i=sn=>{var $n;return($n=Hi.find(dr=>dr.url===sn))==null?void 0:$n.valueString},Wi=$i(a.PS)||Qn.text||"",H0=$i(a.Iz)||"button",W0=$i(a.VF),L0=$i(a.PV),$0=$i(a.vf),d0=$0?a.JP[$0]:void 0,K0=$i(a.D_)||"",Aa=$i(a.$e),Lr=$i(a.GQ),ir=$i(a.qT)||"gray",mr=$i(a.hZ),Pe=$i(a.wG),Ee=$i(a.q3),$e=Lr?a.JP[Lr]:void 0,vt=()=>qr(!0),Gt=()=>{switch(H0){case"icon-button":return(0,n.jsxs)("button",{onClick:vt,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":Wi||K0||void 0,children:[d0&&(0,n.jsx)(d0,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),Wi&&(0,n.jsx)("span",{className:"text-sm",children:Wi})]});default:return(0,n.jsx)(s.Button,{color:W0??"secondary",size:L0??"md",iconLeading:d0,onClick:vt,"aria-label":Wi,children:Wi})}};return(0,n.jsxs)(n.Fragment,{children:[Gt(),(0,n.jsx)(s.Modal,g(g(g({id:`modal-${Qn.linkId}`,isOpen:Fr,onOpenChange:qr,title:{content:K0},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:()=>qr(!1)}},$e?{featuredIcon:{icon:$e,color:ir,size:"lg",className:"bg-white"}}:{}),mr?{primaryButton:{children:mr,onClick:()=>{var sn,$n;Pe==="open-zendesk"&&(($n=(sn=globalThis.zE)==null?void 0:sn.activate)==null||$n.call(sn,{hideOnClose:!0})),qr(!1)}}}:{}),Ee?{secondaryButton:{children:Ee,onClick:()=>qr(!1)}}:{}))]})};var h=e(18522);const f=({item:Qn})=>{var Fr,qr,Hi,$i,Wi,H0,W0,L0,$0,d0,K0,Aa;const{hasExternalError:Lr}=(0,h.c)(),ir=Qn.text||"",mr=(qr=(Fr=Qn.extension)==null?void 0:Fr.find(zr=>zr.url===a.ao))==null?void 0:qr.valueString,Pe=Lr&&mr?mr:ir,Ee=($i=(Hi=Qn.extension)==null?void 0:Hi.find(zr=>zr.url===a.$7))==null?void 0:$i.valueString,$e=(H0=(Wi=Qn.extension)==null?void 0:Wi.find(zr=>zr.url===a.el))==null?void 0:H0.valueString,vt=Lr&&$e?$e:Ee,Gt=(L0=(W0=Qn.extension)==null?void 0:W0.find(zr=>zr.url===a.g4))==null?void 0:L0.valueString,sn=(d0=($0=Qn.extension)==null?void 0:$0.find(zr=>zr.url===a.Fp))==null?void 0:d0.valueString,$n=Gt?a.JP[Gt]:void 0,dr=sn?a.JP[sn]:void 0,xn=Lr&&dr?dr:$n,tr=((Aa=(K0=Qn.extension)==null?void 0:K0.find(zr=>zr.url===a.WS))==null?void 0:Aa.valueString)===a._W.LEFT,gn=tr?"items-start":"items-center",vr=tr?"text-left":"text-center",br=tr?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${gn} gap-4`,children:[xn&&(0,n.jsx)(s.FeaturedIcon,{icon:xn,color:Lr&&dr?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${gn} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${vr} ${br} md:max-w-[352px]`,children:Pe}),(0,n.jsx)("p",{className:`text-md text-secondary ${vr}`,children:vt})]})]})};var v=e(15297),A=e(17814),z=Object.defineProperty,x=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable,C=(Qn,Fr,qr)=>Fr in Qn?z(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,E=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))T.call(Fr,qr)&&C(Qn,qr,Fr[qr]);if(x)for(var qr of x(Fr))S.call(Fr,qr)&&C(Qn,qr,Fr[qr]);return Qn};const R=({item:Qn})=>{const[Fr,qr]=(0,t.useState)(!1),Hi=(0,A.T$)(),$i=Qn.extension||[],Wi=mr=>{var Pe;return(Pe=$i.find(Ee=>Ee.url===mr))==null?void 0:Pe.valueString},H0=Qn.text||"",W0=Wi(a.PS)||"",L0=Wi(a.D_)||"",$0=Wi(a.$e),d0=Wi(a.GQ),K0=Wi(a.qT)||"gray",Aa=Wi(a.hZ),Lr=Wi(a.q3),ir=d0?a.JP[d0]: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)(v.d,{className:"text-tertiary size-4 shrink-0"}),(0,n.jsx)("span",{className:"text-primary text-sm font-semibold",children:H0})]}),W0&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>qr(!0),children:W0})]}),(0,n.jsx)(s.Modal,E(E(E({id:`modal-${Qn.linkId}`,isOpen:Fr,onOpenChange:qr,title:{content:L0},description:{content:$0?(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($0)}}):void 0},closeButton:{onCloseClick:()=>qr(!1)}},ir?{featuredIcon:{icon:ir,color:K0,size:"lg",className:"bg-white"}}:{}),Aa?{primaryButton:{children:Aa,onClick:()=>{qr(!1),Hi.navigate({id:"profile"})}}}:{}),Lr?{secondaryButton:{children:Lr,onClick:()=>qr(!1)}}:{}))]})},P=({item:Qn,selectedAnswer:Fr,handleInputChange:qr})=>{var Hi,$i,Wi;const H0=(Hi=Qn.answerOption)!=null?Hi:[],W0=(Wi=($i=Fr?.[0])==null?void 0:$i.valueCoding)==null?void 0:Wi.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:H0.map(L0=>{var $0,d0,K0,Aa,Lr,ir,mr;const Pe=(d0=($0=L0.valueCoding)==null?void 0:$0.code)!=null?d0:"",Ee=(Aa=(K0=L0.valueCoding)==null?void 0:K0.display)!=null?Aa:"",$e=W0===Pe,vt=(Lr=L0.extension)==null?void 0:Lr.find(dr=>dr.url===a.g4),Gt=(ir=L0.extension)==null?void 0:ir.find(dr=>dr.url===a.rz),sn=vt?.valueString?a.JP[vt.valueString]:void 0,$n=(mr=Gt?.valueString)!=null?mr:"";return(0,n.jsx)(s.SelectableOption,{icon:sn,title:Ee,description:$n,isSelected:$e,onSelect:()=>{qr(Qn,[{valueCoding:{code:Pe,display:Ee}}])}},Pe)})})};var L=e(72866),D=e(94043),N=e(94627);const w=({text:Qn,isLabel:Fr,required:qr,className:Hi,id:$i})=>(0,n.jsxs)("p",{id:$i,className:Hi??"mb-md text-md",children:[(0,n.jsx)(s.Content,{as:"span",className:(0,D.cx)(Fr&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,N.p)(Qn||"")}}),qr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),V="(###) ###-####",k=(Qn,Fr)=>{const qr=Qn.replace(/\D/g,"");let Hi="",$i=0;for(let Wi=0;Wi<Fr.length&&$i<qr.length;Wi++)Fr[Wi]==="#"?(Hi+=qr[$i],$i++):Hi+=Fr[Wi];return Hi},I=Qn=>{if(!Qn)return V;const Fr=Qn.find(qr=>qr.url===a.Md);return Fr?.valueString||V},q=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0})=>{var W0;const{linkId:L0,text:$0,required:d0,prefix:K0,readOnly:Aa,extension:Lr}=Qn,ir=I(Lr),mr=((W0=qr?.[0])==null?void 0:W0.valueString)||"",[Pe,Ee]=(0,t.useState)("");(0,t.useEffect)(()=>{if(mr){const $n=k(mr,ir);Ee($n)}},[mr,ir]);const $e=$0?(0,i.nt)($i,K0,$0):"",vt=Wi?.[L0]||"",Gt=$n=>{const dr=k($n,ir);Ee(dr),Hi(Qn,[{valueString:dr}])},sn=()=>{Fr&&Fr(L0)};return(0,n.jsxs)("div",{"data-testid":L0,children:[$e&&(0,n.jsx)(w,{isLabel:!0,text:$e,required:d0||!1}),(0,n.jsx)(s.Input,{id:L0,"aria-label":L0,"data-testid":L0,type:"tel",placeholder:"Enter phone number",value:Pe,onChange:Gt,onBlur:sn,isDisabled:Aa||H0,isRequired:d0,hint:vt,isInvalid:!!vt,size:"md"},L0)]})},U=({item:Qn,questionnaireSchemaItems:Fr})=>{var qr;const{isLoading:Hi,setCurrentGroupIndex:$i}=(0,h.c)(),Wi=(qr=Qn.extension)==null?void 0:qr.find($0=>$0.url===a.Uf),H0=Wi?.valueString,W0=Qn.text||"Save & continue",L0=()=>{if(H0){const $0=(0,i.Ue)(Fr||[],H0);$0!==-1&&$i($0)}};return(0,n.jsx)("div",{"data-testid":Qn.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:Hi,onClick:L0,isDisabled:Qn.readOnly,children:W0})})},$=({size:Qn=24,color:Fr="currentColor",...qr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Qn,height:Qn,stroke:Fr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...qr},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"}));$.displayName="Passport";var X=e(56327);const G=({size:Qn=24,color:Fr="currentColor",...qr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Qn,height:Qn,stroke:Fr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...qr},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 ae=e(14711);const re=({size:Qn=24,color:Fr="currentColor",...qr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Qn,height:Qn,stroke:Fr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...qr},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"}));re.displayName="Mail01";var J=e(31165),ce=e(14449),ge=e(59931),Ae=e(27163);const be=Qn=>{try{const Fr=Qn.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!Fr)return Qn;const[,qr,Hi,$i]=Fr;return new Date(Date.UTC(parseInt(qr),parseInt(Hi)-1,parseInt($i))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return Qn}},oe=Qn=>{try{if(Qn.includes("AM")||Qn.includes("PM"))return Qn;const Fr=Qn.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!Fr)return Qn;const[,qr,Hi]=Fr,$i=parseInt(qr),Wi=$i>=12?"PM":"AM";return`${$i%12||12}:${Hi} ${Wi}`}catch{return Qn}},ue=(Qn,Fr,qr=v.d)=>{var Hi;const $i=(Hi=Qn.extension)==null?void 0:Hi.find(Wi=>Wi.url===a.g4);return $i?.valueString&&a.JP[$i.valueString]?a.JP[$i.valueString]:Qn.linkId&&Fr[Qn.linkId]?Fr[Qn.linkId]:qr},me={"appointment-review/first-name":$,"appointment-review/last-name":$,"appointment-review/dob":X.V,"appointment-review/gender":G,"appointment-review/phone":ae.b,"appointment-review/email":re,"appointment-review/vaccines":s.Vaccine,"appointment-review/appointment-date":X.V,"appointment-review/appointment-time":J.z,"appointment-review/facility-name":s.HospitalBuilding,"appointment-review/facility-phone":ae.b,"appointment-review/facility-address":ce.X},de=["appointment-review/appointment-date"],fe=["appointment-review/appointment-time"],le=["appointment-review/facility-phone"],ne=["appointment-review/facility-address"],te=["appointment-review/phone","appointment-review/facility-phone"],ve=({item:Qn,questionnaireSchemaItems:Fr})=>{var qr;const{setCurrentGroupIndex:Hi}=(0,h.c)(),{trackEvent:$i}=(0,o.st)(),Wi=Qn.item||[];if(Wi.length===0)return null;const H0=(qr=Qn.extension)==null?void 0:qr.find(d0=>d0.url===a.Uf),W0=H0?.valueString,L0=()=>{if($i("edit_info_clicked",{section:Qn.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),W0){const d0=(0,i.Ue)(Fr||[],W0);d0!==-1&&Hi(d0)}},$0=Wi.map(d0=>{let K0="";if(d0.initial&&d0.initial.length>0){const ir=d0.initial.map(mr=>{var Pe,Ee,$e,vt,Gt,sn,$n,dr;let xn=((Pe=mr.valueCoding)==null?void 0:Pe.display)||((Ee=mr.valueReference)==null?void 0:Ee.display)||mr.valueString||"";if(xn&&typeof xn=="string"){if(de.includes(d0.linkId)){const tr=(Gt=(vt=($e=mr.valueReference)==null?void 0:$e.extension)==null?void 0:vt.find(gn=>gn?.url===a.zD||gn?.url===a.UZ))==null?void 0:Gt.valueCode;if(tr)try{xn=(0,ge.formatToTimeZone)(xn,"YYYY-MM-DD",{timeZone:tr})}catch{}xn=be(xn)}else if(fe.includes(d0.linkId)){const tr=(dr=($n=(sn=mr.valueReference)==null?void 0:sn.extension)==null?void 0:$n.find(gn=>gn?.url===a.zD||gn?.url===a.UZ))==null?void 0:dr.valueCode;if(tr)try{xn=(0,ge.formatToTimeZone)(xn,"h:mm A",{timeZone:tr})}catch{xn=oe(xn)}else xn=oe(xn)}}return xn}).filter(Boolean);ir.length>1||d0.repeats&&ir.length>0?K0=ir:ir.length===1&&(K0=ir[0])}if(!K0||Array.isArray(K0)&&K0.length===0)return null;let Aa;le.includes(d0.linkId)?Aa="phone":ne.includes(d0.linkId)&&(Aa="address");let Lr;return te.includes(d0.linkId)&&(Lr="phone"),{Icon:ue(d0,me),label:d0.text||d0.linkId,value:K0,linkType:Aa,displayType:Lr}}).filter(Boolean);return $0.length===0?null:(0,n.jsx)("div",{"data-testid":Qn.linkId,children:(0,n.jsx)(Ae.InfoCard,{title:Qn.text||"Details",infoDetails:$0,actionButtonText:W0&&"Edit info",onActionButtonClick:W0?L0:void 0})})},xe=({size:Qn=24,color:Fr="currentColor",...qr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Qn,height:Qn,stroke:Fr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...qr},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"}));xe.displayName="AlertTriangle";var we=e(18807);const ze=({item:Qn})=>{const{setHideFooterButton:Fr,incrementCustomErrorCount:qr,decrementCustomErrorCount:Hi,addErrorLinkId:$i,removeErrorLinkId:Wi}=(0,h.c)();return(0,t.useEffect)(()=>(Fr(!0),qr(),$i(Qn.linkId),()=>{Fr(!1),Hi(),Wi(Qn.linkId)}),[Fr,qr,Hi,$i,Wi,Qn.linkId]),(0,n.jsx)("div",{"data-testid":Qn.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,we.p)(Qn.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(xe,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},De={information:"info",warning:"warning",error:"error",fatal:"fatal",success:"success"},Se=({item:Qn})=>{var Fr,qr,Hi,$i;const{incrementCustomErrorCount:Wi,decrementCustomErrorCount:H0,addErrorLinkId:W0,removeErrorLinkId:L0,setHideFooterButton:$0}=(0,h.c)(),[d0,K0]=(0,t.useState)(!1),Aa=(Fr=Qn.extension)==null?void 0:Fr.find($e=>$e.url===a.gi),Lr=(Hi=(qr=Aa?.valueCodeableConcept)==null?void 0:qr.coding)==null?void 0:Hi.find($e=>$e.system===a.tn),ir=Lr?.code||"error",mr=De[ir]||"error";(0,t.useEffect)(()=>{if(mr==="error")return Wi(),$0(!0),K0(!0),()=>{H0(),$0(!1)};if(mr==="fatal")return Wi(),W0(Qn.linkId),$0(!0),K0(!0),()=>{H0(),L0(Qn.linkId),$0(!1)};K0(!0)},[mr]);const Pe=Lr?.display||"Error",Ee=($i=Qn.text)!=null?$i:"";return d0?(0,n.jsx)("div",{"data-testid":Qn.linkId,children:(0,n.jsx)(s.InfoBanner,{type:mr==="fatal"?"error":mr,title:Pe,description:Ee})}):null};var We=e(65735);const ot=({configKey:Qn,customErrorConfigurations:Fr})=>{if(!Fr)return null;const qr=Fr[Qn];if(!qr)return null;const{icon:Hi,title:$i,description:Wi,primaryButton:H0,secondaryButton:W0}=qr;return(0,n.jsx)(s.EmptyState,{className:"mt-5xl",title:$i,description:Wi,featuredIconProps:{icon:Hi,color:"gray"},primaryButton:H0,secondaryButton:W0})},ht=10,At=({item:Qn,customErrorConfigurations:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0})=>{var W0,L0,$0,d0;const{trackEvent:K0}=(0,o.st)(),{setHideFooterButton:Aa}=(0,h.c)(),{linkId:Lr,text:ir,required:mr,answerOption:Pe,prefix:Ee,readOnly:$e}=Qn,vt=Qn?.type==="reference",Gt=(W0=qr?.map(Jo=>{var Ui,gi;return vt?(Ui=Jo.valueReference)==null?void 0:Ui.display:(gi=Jo.valueCoding)==null?void 0:gi.code}).filter(Jo=>Jo!==void 0))!=null?W0:[],[sn,$n]=(0,t.useState)(Gt.length),dr=ir?(0,i.nt)($i,Ee,ir):"",xn=($0=(L0=Qn.extension)==null?void 0:L0.find(Jo=>Jo.url===a.Z_))==null?void 0:$0.valueInteger,tr=(d0=Pe?.map(Jo=>{var Ui,gi,t0,Ji;return{value:vt?((Ui=Jo.valueReference)==null?void 0:Ui.display)||"":((gi=Jo.valueCoding)==null?void 0:gi.code)||"",label:vt?((t0=Jo.valueReference)==null?void 0:t0.display)||"":((Ji=Jo.valueCoding)==null?void 0:Ji.display)||"",valueReference:Jo.valueReference}}))!=null?d0:[],gn=Wi?.[Lr],vr=tr.length>ht,br=vr?tr.slice(0,ht):tr,zr=vr?tr.slice(ht):[],mo=zr.some(Jo=>Gt?.includes(Jo?.value)),[uo,Xo]=(0,t.useState)(mo);if(!(Qn.answerOption&&Qn.answerOption.length>0))return Aa(!0),(0,n.jsx)(ot,{configKey:Qn.linkId,customErrorConfigurations:Fr});const Gi=tr.filter(Jo=>Gt?.includes(Jo?.value)).map(Jo=>{var Ui;const{restriction:gi,warning:t0}=vt?(0,i.eC)((Ui=Jo.valueReference)==null?void 0:Ui.extension):{restriction:null,warning:null};return{label:Jo.label,restriction:gi,warning:t0}}).filter(Jo=>Jo.restriction||Jo.warning),Di=(Jo,Ui)=>{var gi;K0("vaccine_type_checkbox_selected",{on_or_off:Jo?"on":"off",vaccine:Ui,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let t0;if(Jo){const Ji=tr.find(ja=>ja.value===Ui);t0=[...(gi=qr?.filter(ja=>Object.keys(ja).length!==0))!=null?gi:[],vt?{valueReference:Ji?.valueReference}:{valueCoding:{code:Ui,display:Ji?.label}}],$n(ja=>ja+1)}else t0=qr?.filter(Ji=>{var ja,U0;return vt?((ja=Ji.valueReference)==null?void 0:ja.display)!==Ui:((U0=Ji.valueCoding)==null?void 0:U0.code)!==Ui})||[{}],$n(Ji=>Ji-1);Hi&&Hi(Qn,t0)};return(0,n.jsxs)("div",{"data-testid":Lr,children:[dr&&(0,n.jsx)(w,{text:dr,required:mr||!1}),vr&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:br.map((Jo,Ui)=>{const gi=Gt?.includes(Jo?.value),t0=!gi&&xn?sn>=xn:!1;return(0,n.jsx)("div",{className:Ui!==br.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(s.Checkbox,{size:"md","data-testid":Jo.value,id:Ui.toString(),name:Jo.label,isInvalid:!!gn,isSelected:gi,label:Jo.label,onChange:Ji=>Di(Ji,Jo.value),isDisabled:$e||H0||t0})},Ui)})}),vr&&!uo&&!mo&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(s.Button,{type:"button",onClick:()=>{Xo(!0),K0("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:$e||H0,children:"See all"})}),vr&&uo&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),vr&&uo&&(0,n.jsx)("div",{children:zr.map((Jo,Ui)=>{const gi=Gt?.includes(Jo?.value),t0=!gi&&xn?sn>=xn:!1;return(0,n.jsx)("div",{className:Ui!==zr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(s.Checkbox,{size:"md","data-testid":Jo.value,id:(ht+Ui).toString(),name:Jo.label,isInvalid:!!gn,isSelected:gi,label:Jo.label,onChange:Ji=>Di(Ji,Jo.value),isDisabled:$e||H0||t0})},ht+Ui)})}),(0,n.jsx)(s.HintText,{isInvalid:!!gn,children:gn}),Gi.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:Gi.map((Jo,Ui)=>(0,n.jsxs)("div",{children:[Jo.restriction&&(0,n.jsx)(s.InfoBanner,{type:"warning",title:`[Restriction] ${Jo.label}`,description:Jo.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:Jo.restriction.items.map((gi,t0)=>(0,n.jsx)("li",{className:"text-sm",children:gi},t0))}):(0,n.jsx)("p",{className:"text-sm",children:Jo.restriction.items[0]})}),Jo.warning&&(0,n.jsx)("div",{className:Jo.restriction?"mt-2":"",children:(0,n.jsx)(s.InfoBanner,{type:"warning",title:`[Warning] ${Jo.label}`,description:Jo.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:Jo.warning.items.map((gi,t0)=>(0,n.jsx)("li",{className:"text-sm",children:gi},t0))}):(0,n.jsx)("p",{className:"text-sm",children:Jo.warning.items[0]})})})]},Ui))})]})};var Tt=e(76323),Yt=e(56192),zt=e(66267),Ye=Object.defineProperty,Ke=Object.defineProperties,It=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,et=Object.prototype.hasOwnProperty,Zt=Object.prototype.propertyIsEnumerable,Tn=(Qn,Fr,qr)=>Fr in Qn?Ye(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,On=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))et.call(Fr,qr)&&Tn(Qn,qr,Fr[qr]);if(nt)for(var qr of nt(Fr))Zt.call(Fr,qr)&&Tn(Qn,qr,Fr[qr]);return Qn},at=(Qn,Fr)=>Ke(Qn,It(Fr)),Wt=(Qn,Fr,qr)=>new Promise((Hi,$i)=>{var Wi=L0=>{try{W0(qr.next(L0))}catch($0){$i($0)}},H0=L0=>{try{W0(qr.throw(L0))}catch($0){$i($0)}},W0=L0=>L0.done?Hi(L0.value):Promise.resolve(L0.value).then(Wi,H0);W0((qr=qr.apply(Qn,Fr)).next())});const Bt=({item:Qn,handleInputChange:Fr,onCompleteHandler:qr,errors:Hi})=>{const{i18n:{t:$i},loading:Wi}=(0,zt.E_)({keys:["shared-translations","ui-toolkit-modern"]}),{trackEvent:H0}=(0,o.st)(),{linkId:W0,required:L0,readOnly:$0}=Qn,d0=Hi?.[W0]||"",[K0,Aa]=(0,t.useState)(Tt.LocationType.CURRENT_LOCATION),[Lr,ir]=(0,t.useState)(""),mr=(0,t.useRef)({}),[Pe,Ee]=(0,t.useState)([{id:Tt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:Tt.LocationType.ADDRESS,label:"Address"},{id:Tt.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:$e,setIsLoading:vt,setIsCurrentFormValid:Gt,isCurrentFormValid:sn}=(0,h.c)(),{position:$n,loading:dr,locationPermission:xn}=(0,Tt.useDeviceLocationContext)(),{queryParams:tr,setQueryParams:gn}=(0,Tt.useSearchQueryParams)(),[vr,{loading:br}]=(0,Yt.qtq)({fetchPolicy:"cache-first"}),[zr,{loading:mo}]=(0,Yt.YyG)({fetchPolicy:"cache-first"}),uo=Qn.item?(0,i.Yo)(Qn.item,"postal-code"):void 0,Xo=Qn.item?(0,i.Yo)(Qn.item,"state"):void 0,_i=Qn.item?(0,i.Yo)(Qn.item,"latitude"):void 0,Gi=Qn.item?(0,i.Yo)(Qn.item,"longitude"):void 0,Di=s0=>{if(!s0||!uo)return ir(""),!1;const Sa=(0,i.zj)(uo.extension,uo.type,!1,uo.maxLength,[{valueString:s0}],void 0,$i);return Sa?(ir(K0!==Tt.LocationType.ZIP_CODE?$i("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Sa),!1):(ir(""),!0)},Jo=()=>{const{latitude:s0,longitude:Sa,state:ls,zipcode:k0}=mr.current;return!!(s0&&Sa&&ls&&k0)},Ui=(0,t.useCallback)(s0=>{mr.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},Qn.item&&(Xo&&Fr(Xo,[{valueString:""}]),_i&&Fr(_i,[{valueDecimal:void 0}]),Gi&&Fr(Gi,[{valueDecimal:void 0}]),uo&&Fr(uo,[{valueString:""}])),gn({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:s0,locationPermission:xn}),Gt&&Gt(!1),ir("")},[Fr,Qn.item,_i,xn,Gi,Gt,gn,Xo,uo]);(0,t.useEffect)(()=>{if(!L0)return;!Jo()&&Gt&&Gt(!1)},[sn,L0,Gt]);const gi=s0=>{mr.current=On(On({},mr.current),s0),s0.addressDescription&&H0("address_selected",{value:s0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),ja(mr.current.latitude,mr.current.longitude,mr.current.state,mr.current.zipcode,mr.current.placeId,mr.current.addressDescription)},t0=s0=>Wt(void 0,null,function*(){var Sa,ls,k0;if(ir(""),mr.current.zipcode=s0,Gt&&Gt(!1),Di(s0)){H0("zip_code_entered",{value:s0,_event_metadata:{description:"A user entered a zip code."}});const w0=yield zr({variables:{location:s0}}),ui=(Sa=w0?.data)==null?void 0:Sa.geocoding,l0=w0?.error;if(ui){const Mi=ui.stateCode||"",Ga=(ls=ui.latitude)!=null?ls:void 0,qi=(k0=ui.longitude)!=null?k0:void 0;gi({latitude:Ga,longitude:qi,state:Mi,zipcode:s0,placeId:void 0,addressDescription:void 0})}else l0&&(gi({latitude:void 0,longitude:void 0,state:void 0,zipcode:s0,placeId:void 0,addressDescription:void 0}),ir($i("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else ja(mr.current.latitude,mr.current.longitude,mr.current.state,s0)}),Ji=()=>{const s0=mr.current.zipcode||"";!s0||K0!==Tt.LocationType.ZIP_CODE||Di(s0)};(0,t.useEffect)(()=>{tr.locationType&&(Aa(tr.locationType),tr.locationType===Tt.LocationType.ZIP_CODE&&tr.zipCode&&t0(tr.zipCode),tr.locationType===Tt.LocationType.ADDRESS&&tr.placeId&&tr.addressDescription&&(mr.current.addressDescription=tr.addressDescription,mr.current.placeId=tr.placeId))},[]),(0,t.useEffect)(()=>{const s0=[Tt.LocationPermissionEnum.DENIED,Tt.LocationPermissionEnum.UNAVAILABLE,Tt.LocationPermissionEnum.BLOCKED].includes(tr.locationPermission),Sa=[Tt.LocationPermissionEnum.GRANTED,Tt.LocationPermissionEnum.PROMPT].includes(tr.locationPermission);if(s0&&Pe.length!==2){if(Ee([{id:Tt.LocationType.ADDRESS,label:"Address"},{id:Tt.LocationType.ZIP_CODE,label:"Zip code"}]),K0===Tt.LocationType.CURRENT_LOCATION||!tr.locationType||tr.locationType===""){const ls=tr.locationType===Tt.LocationType.ZIP_CODE?Tt.LocationType.ZIP_CODE:Tt.LocationType.ADDRESS;Aa(ls),gn(at(On({},tr),{locationType:ls})),Ui(ls)}ir("")}Sa&&Pe.length!==3&&Ee([{id:Tt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:Tt.LocationType.ADDRESS,label:"Address"},{id:Tt.LocationType.ZIP_CODE,label:"Zip code"}])},[K0,xn,Pe.length,tr,gn,Ui]);const ja=(s0,Sa,ls,k0,w0,ui)=>{if(!Qn.item)return;Xo&&Fr(Xo,[{valueString:ls||""}]),_i&&Fr(_i,[{valueDecimal:s0}]),Gi&&Fr(Gi,[{valueDecimal:Sa}]),uo&&Fr(uo,[{valueString:k0||""}]),gn(at(On({},tr),{lat:String(s0),lng:String(Sa),location:`${s0},${Sa}`,zipCode:k0||"",placeId:w0||"",addressDescription:ui||"",locationPermission:xn}));const l0=Jo()&&Di(k0||"");Gt&&Gt(l0),qr&&qr(W0)};(0,t.useEffect)(()=>{const s0=()=>Wt(void 0,null,function*(){var Sa;try{const ls=yield vr({variables:{latitude:String($n?.coords.latitude),longitude:String($n?.coords.longitude)}}),k0=(Sa=ls?.data)==null?void 0:Sa.geocodingByLatLon,w0=k0?.stateCode||"",ui=k0?.zipCode||"";(!ui||!w0)&&ir($i("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),gi({latitude:$n?.coords.latitude,longitude:$n?.coords.longitude,state:w0,zipcode:ui,placeId:void 0,addressDescription:void 0})}catch{Aa(Tt.LocationType.ADDRESS)}});K0===Tt.LocationType.CURRENT_LOCATION&&$n&&s0()},[K0,$n]);const U0=s0=>{if(!s0||!s0.latitude||!s0.longitude||!s0.zipCode||!s0.stateCode){gi({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),s0&&typeof s0.value=="string"&&s0.value.trim().length!==0&&ir($i("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}gi({latitude:s0.latitude,longitude:s0.longitude,state:s0.stateCode,zipcode:s0.zipCode,placeId:s0.placeId,addressDescription:s0.description})};return(0,t.useEffect)(()=>{vt(dr||br||mo||Wi)},[dr,br,mo,Wi,vt]),(0,t.useEffect)(()=>{tr.locationType!==K0&&gn(at(On({},tr),{locationType:K0}))},[K0]),(0,n.jsxs)("div",{"data-testid":Qn.linkId,children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:L0||!1}),(0,n.jsx)(s.Select,{id:W0,"aria-label":W0,"data-testid":W0,isDisabled:$0||br||mo||$e,selectedKey:K0,onSelectionChange:s0=>{var Sa;H0("location_type_input_selected",{choice:(Sa=Pe.find(({id:ls})=>ls===s0))==null?void 0:Sa.label,_event_metadata:{description:"A user changed the location type input."}}),s0!==K0&&(Ui(s0),Aa(s0))},hint:d0,isInvalid:!!d0,items:Pe,placeholder:"Select an option",isRequired:L0,children:s0=>(0,n.jsx)(s.Select.Item,{id:s0.id,"data-testid":s0.id,value:s0,children:s0.label},s0.id)},W0),K0===Tt.LocationType.CURRENT_LOCATION&&(0,n.jsx)(s.HintText,{isInvalid:!!Lr,children:Lr}),K0===Tt.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:L0||!1}),(0,n.jsx)(Tt.AddressTypeahead,{onValueChange:U0,isDisabled:$e,setIsLoading:vt,initialValue:{placeId:mr.current.placeId||"",description:mr.current.addressDescription||""},errorText:Lr||d0})]}),K0===Tt.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:L0||!1}),(0,n.jsx)(s.Input,{isRequired:L0,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${W0}-zipcode`,placeholder:"Type your response here...",value:mr.current.zipcode||"",onChange:t0,onBlur:Ji,isDisabled:$0||mo||$e,hint:Lr||d0,isInvalid:!!Lr||!!d0,autoComplete:"postal-code"},`${W0}-zipcode`)]})]})},An=Qn=>(0,n.jsx)(Tt.DeviceLocationProvider,{children:(0,n.jsx)(Bt,On({},Qn))}),Gn={[a.cX]:An,[a.G6]:ve,[a.c3]:At,[a.AA]:Se,[a.mO]:f,[a.PM]:U,[a.HH]:q,[a.Us]:ze,[a.Tl]:P,[a.G0]:M,[a.m3]:b,[a.PU]:R,[a.XP]:c.l,[a.uH]:L.v,[a.it]:We.d};var rn,Ln=new Uint8Array(16);function nr(){if(!rn&&(rn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!rn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return rn(Ln)}const In=/^(?:[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 Ur(Qn){return typeof Qn=="string"&&In.test(Qn)}const Vr=Ur;for(var Dt=[],Fe=0;Fe<256;++Fe)Dt.push((Fe+256).toString(16).substr(1));function rt(Qn){var Fr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,qr=(Dt[Qn[Fr+0]]+Dt[Qn[Fr+1]]+Dt[Qn[Fr+2]]+Dt[Qn[Fr+3]]+"-"+Dt[Qn[Fr+4]]+Dt[Qn[Fr+5]]+"-"+Dt[Qn[Fr+6]]+Dt[Qn[Fr+7]]+"-"+Dt[Qn[Fr+8]]+Dt[Qn[Fr+9]]+"-"+Dt[Qn[Fr+10]]+Dt[Qn[Fr+11]]+Dt[Qn[Fr+12]]+Dt[Qn[Fr+13]]+Dt[Qn[Fr+14]]+Dt[Qn[Fr+15]]).toLowerCase();if(!Vr(qr))throw TypeError("Stringified UUID is invalid");return qr}const Ze=rt;function Qe(Qn,Fr,qr){Qn=Qn||{};var Hi=Qn.random||(Qn.rng||nr)();if(Hi[6]=Hi[6]&15|64,Hi[8]=Hi[8]&63|128,Fr){qr=qr||0;for(var $i=0;$i<16;++$i)Fr[qr+$i]=Hi[$i];return Fr}return Ze(Hi)}const Je=Qe,lt=(Qn,Fr="application/octet-stream")=>{try{const qr=window.atob(Qn),Hi=new Uint8Array(qr.length);for(let Wi=0;Wi<qr.length;Wi++)Hi[Wi]=qr.charCodeAt(Wi);return new Blob([Hi],{type:Fr}).size}catch{return 0}},Ct=(Qn,Fr)=>`data:${Fr};base64,${Qn}`,st=(Qn,Fr,qr=512)=>{const Hi=window.atob(Qn),$i=[];for(let H0=0;H0<Hi.length;H0+=qr){const W0=Hi.slice(H0,H0+qr),L0=new Array(W0.length);for(let d0=0;d0<W0.length;d0++)L0[d0]=W0.charCodeAt(d0);const $0=new Uint8Array(L0);$i.push($0)}const Wi=new Blob($i,{type:Fr});return URL.createObjectURL(Wi)},se=Qn=>{const Fr=new Date().toISOString().replace(/[:.-]/g,"");return`${Qn.split(" ").join("-")}_${Fr}`},Ce=4e3,Ve=.8,Te=(Qn,Fr)=>{var qr,Hi;const $i=(qr=Fr?.maxDimension)!=null?qr:Ce,Wi=(Hi=Fr?.quality)!=null?Hi:Ve;return new Promise((H0,W0)=>{if(!Qn.type.startsWith("image/")){H0(Qn);return}if(Qn.type==="image/heic"||Qn.type==="image/heif"||Qn.name.toLowerCase().endsWith(".heic")||Qn.name.toLowerCase().endsWith(".heif")){H0(Qn);return}const $0=new Image,d0=new FileReader;d0.onload=()=>{const K0=d0.result;$0.onload=()=>{let{width:Aa,height:Lr}=$0;if(Aa>$i||Lr>$i){const $e=$i/Math.max(Aa,Lr);Aa=Math.round(Aa*$e),Lr=Math.round(Lr*$e)}const ir=document.createElement("canvas");ir.width=Aa,ir.height=Lr;const mr=ir.getContext("2d");if(!mr){H0(Qn);return}mr.drawImage($0,0,0,Aa,Lr);const Pe=Qn.type==="image/png"?"image/png":"image/jpeg",Ee=Qn.type==="image/png"?void 0:Wi;ir.toBlob($e=>{if(!$e||$e.size>=Qn.size){H0(Qn);return}H0(new File([$e],Qn.name,{type:Pe}))},Pe,Ee)},$0.onerror=()=>{W0(new Error(`Failed to load image: ${Qn.name}`))},$0.src=K0},d0.onerror=()=>{W0(new Error(`Failed to read file: ${Qn.name}`))},d0.readAsDataURL(Qn)})},xt=50,Kt=(Qn,Fr=xt)=>{if(Qn.length<=Fr)return Qn;const qr=Qn.lastIndexOf("."),Hi=qr!==-1?Qn.slice(qr):"",$i=qr!==-1?Qn.slice(0,qr):Qn,Wi=Fr-Hi.length-1,H0=Math.ceil(Wi/2),W0=Math.floor(Wi/2);return`${$i.slice(0,H0)}\u2026${$i.slice(-W0)}${Hi}`};var Cn=Object.defineProperty,jn=Object.defineProperties,Sr=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertySymbols,Ne=Object.prototype.hasOwnProperty,Xe=Object.prototype.propertyIsEnumerable,Et=(Qn,Fr,qr)=>Fr in Qn?Cn(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,Ht=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))Ne.call(Fr,qr)&&Et(Qn,qr,Fr[qr]);if(Ft)for(var qr of Ft(Fr))Xe.call(Fr,qr)&&Et(Qn,qr,Fr[qr]);return Qn},Qt=(Qn,Fr)=>jn(Qn,Sr(Fr)),tn=(Qn,Fr,qr)=>new Promise((Hi,$i)=>{var Wi=L0=>{try{W0(qr.next(L0))}catch($0){$i($0)}},H0=L0=>{try{W0(qr.throw(L0))}catch($0){$i($0)}},W0=L0=>L0.done?Hi(L0.value):Promise.resolve(L0.value).then(Wi,H0);W0((qr=qr.apply(Qn,Fr)).next())});const kn=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0})=>{const{linkId:W0,text:L0,required:$0,prefix:d0,readOnly:K0,repeats:Aa,extension:Lr}=Qn,ir=(0,i.Qr)(Lr),mr=(0,i.cz)(Lr),Pe=(0,i.$H)(Lr)||"image/*,.pdf,.doc,.docx",Ee=L0?(0,i.nt)($i,d0,L0):"",$e=Wi?.[W0]||"",[vt,Gt]=(0,t.useState)([]),sn=(0,t.useRef)(qr||[]);(0,t.useEffect)(()=>{qr&&(sn.current=qr)},[qr]),(0,t.useEffect)(()=>{qr?.length&&Gt(vr=>{const br=vr.filter(mo=>mo.isLoading||mo.failed);return[...qr.filter(mo=>mo.valueAttachment).map((mo,uo)=>{var Xo,_i,Gi,Di,Jo;const Ui=((Xo=mo.valueAttachment)==null?void 0:Xo.title)||`attachment-${uo}`,gi=(_i=mo.valueAttachment)==null?void 0:_i.id,t0=vr.find(U0=>gi&&U0.id===gi||!gi&&U0.id===`existing-${uo}`),Ji=(Gi=mo.valueAttachment)==null?void 0:Gi.data,ja=Ji?lt(Ji,(Di=mo.valueAttachment)==null?void 0:Di.contentType):0;return{id:gi||t0?.id||`existing-${uo}`,name:Ui,size:t0?.size||ja,progress:100,failed:!1,type:(0,i.J4)((Jo=mo.valueAttachment)==null?void 0:Jo.contentType),isLoading:!1}}),...br]})},[qr]);const $n=vr=>{let br=Array.from(vr);if(mr!==void 0){const mo=mr-vt.length;if(mo<=0)return;br=br.slice(0,mo)}const zr=br.map(mo=>{const uo=mo.name.replace(/\s+/g,"-");return{id:Je(),name:uo,size:mo.size,progress:0,type:(0,i.J4)(mo.type),failed:!1,isLoading:!0}});Gt(mo=>[...mo,...zr]),zr.forEach(mo=>{const uo=br.find(Xo=>Xo.name.replace(/\s+/g,"-")===mo.name);uo&&dr(uo,mo.id)})},dr=(vr,br)=>tn(void 0,null,function*(){try{const zr=yield Te(vr);if(ir&&zr.size>ir){const Di=parseFloat((ir/1e6).toFixed(1));Gt(Jo=>Jo.map(Ui=>Ui.id===br?Qt(Ht({},Ui),{isLoading:!1,failed:!0,disableRetry:!0,errorMessage:`File size exceeds ${Di} MB limit`}):Ui));return}const mo=yield gn(zr),uo=zr.name.replace(/\s+/g,"-");Gt(Di=>Di.map(Jo=>Jo.id===br?Qt(Ht({},Jo),{isLoading:!1,progress:100,failed:!1}):Jo));const Xo={valueAttachment:{id:br,contentType:zr.type,data:mo,title:uo}},Gi=[...(sn.current||[]).filter(Di=>Di.valueAttachment||Object.keys(Di).length>0),Xo];sn.current=Gi,Hi(Qn,Gi),Fr(W0)}catch{Gt(mo=>mo.map(uo=>uo.id===br?Qt(Ht({},uo),{isLoading:!1,failed:!0}):uo))}}),xn=vr=>{const br=vt.find(zr=>zr.id===vr);if(Gt(zr=>zr.filter(mo=>mo.id!==vr)),br){const zr=(sn.current||[]).filter((mo,uo)=>{var Xo;if(vr.startsWith("existing-")){const _i=parseInt(vr.replace("existing-",""));return uo!==_i}return((Xo=mo.valueAttachment)==null?void 0:Xo.id)!==vr}).filter(mo=>mo.valueAttachment||Object.keys(mo).length>0);sn.current=zr,Hi(Qn,zr.length>0?zr:[{}])}},tr=vr=>{const br=vt.find(zr=>zr.id===vr);if(br){Gt(mo=>mo.map(uo=>uo.id===vr?Qt(Ht({},uo),{failed:!1,isLoading:!0,progress:0}):uo));const zr=new File([""],br.name,{type:"application/octet-stream"});dr(zr,vr)}},gn=vr=>new Promise((br,zr)=>{const mo=new FileReader;mo.onload=()=>{const Xo=mo.result.split(",")[1];br(Xo)},mo.onerror=zr,mo.readAsDataURL(vr)});return(0,n.jsxs)("div",{children:[Ee&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Ee,required:$0||!1}),(0,n.jsx)(s.FileUpload,{files:vt,onDropFiles:$n,onDeleteFile:xn,onRetryFile:tr,onDropUnacceptedFiles:()=>{},hint:(0,i.od)(Pe,ir,mr),accept:Pe,allowsMultiple:Aa!==!1,isDisabled:K0||H0||mr!==void 0&&vt.length>=mr,className:"w-full",showDisclosureModal:!0}),$e&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:$e})]})},Hr=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0})=>{var W0,L0;const{linkId:$0,text:d0,prefix:K0,readOnly:Aa,required:Lr,extension:ir}=Qn,{trackQuestionnaireEvent:mr}=(0,h.c)(),Pe=d0?(0,i.nt)($i,K0,d0):"",Ee=Wi?.[$0];return ir?.find(vt=>{var Gt,sn;return vt.url===a.gD&&((sn=(Gt=vt.valueCodeableConcept)==null?void 0:Gt.coding)==null?void 0:sn.some($n=>$n.system===a.n4&&$n.code===a.GI))})?(0,n.jsxs)("div",{"data-testid":$0,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":$0,children:[(0,n.jsx)(s.Checkbox,{size:"md",id:$0,name:$0,isDisabled:Aa||H0,isSelected:(W0=qr?.[0])==null?void 0:W0.valueBoolean,"aria-label":$0,label:"",className:"mt-1",onChange:vt=>{mr(Qn.linkId,{value:vt}),Hi(Qn,[{valueBoolean:vt}]),Fr(Qn.linkId)}}),Pe&&(0,n.jsx)(w,{isLabel:!0,text:Pe,required:Lr||!1})]}),(0,n.jsx)(s.HintText,{isInvalid:!!Ee,children:Ee})]}):(0,n.jsxs)("div",{"data-testid":$0,children:[Pe&&(0,n.jsx)(w,{isLabel:!0,text:Pe,required:Lr||!1}),(0,n.jsxs)(s.RadioGroup,{size:"md",id:$0,name:$0,"aria-label":$0,value:String((L0=qr?.[0])==null?void 0:L0.valueBoolean)||"",onChange:vt=>{Hi(Qn,[{valueBoolean:vt==="true"}]),Fr(Qn.linkId)},isInvalid:!!Ee,children:[(0,n.jsx)(s.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Aa||H0}),(0,n.jsx)(s.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Aa||H0})]},$0),Ee&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,D.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Ee})})]})};var Lt=Object.defineProperty,dn=Object.getOwnPropertySymbols,cn=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,Jt=(Qn,Fr,qr)=>Fr in Qn?Lt(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,Ut=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))cn.call(Fr,qr)&&Jt(Qn,qr,Fr[qr]);if(dn)for(var qr of dn(Fr))Dn.call(Fr,qr)&&Jt(Qn,qr,Fr[qr]);return Qn};const Bn=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0,placeholder:W0,hintText:L0})=>{var $0,d0,K0;const{linkId:Aa,text:Lr,required:ir,answerOption:mr,prefix:Pe,readOnly:Ee}=Qn,$e=Lr?(0,i.nt)($i,Pe,Lr):"",vt=mr?.map($n=>{var dr,xn,tr,gn;return{id:((dr=$n.valueCoding)==null?void 0:dr.code)||$n.valueString||"",label:((xn=$n.valueCoding)==null?void 0:xn.display)||$n.valueString||"",value:((tr=$n.valueCoding)==null?void 0:tr.code)||$n.valueString||"",extension:$n.extension||[],system:((gn=$n.valueCoding)==null?void 0:gn.system)||void 0}})||[],Gt=((d0=($0=qr?.[0])==null?void 0:$0.valueCoding)==null?void 0:d0.code)||((K0=qr?.[0])==null?void 0:K0.valueString)||"",sn=Wi?.[Aa];return(0,n.jsxs)("div",{children:[$e&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:$e,required:ir||!1}),(0,n.jsx)(s.Select,{id:Aa,"aria-label":Aa,"data-testid":Aa,isDisabled:Ee||H0,selectedKey:Gt,onSelectionChange:$n=>{const dr=String($n),xn=vt.find(vr=>vr.value===dr),tr=xn?xn.label:"",gn=Boolean(mr?.find(vr=>vr.valueString===dr));Hi(Qn,[gn?{valueString:dr}:{valueCoding:Ut({code:dr,display:tr},xn?.system?{system:xn.system}:{}),extension:xn?.extension||[]}]),Fr(Qn.linkId)},isInvalid:!!sn,hint:sn||L0,items:vt,placeholder:W0,isRequired:ir,children:$n=>(0,n.jsx)(s.Select.Item,{id:$n.id,"data-testid":$n.value,value:$n.value,children:$n.label},$n.id)},Aa)]})};var ln=Object.defineProperty,pn=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,Pt=(Qn,Fr,qr)=>Fr in Qn?ln(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,jt=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))kt.call(Fr,qr)&&Pt(Qn,qr,Fr[qr]);if(pn)for(var qr of pn(Fr))pt.call(Fr,qr)&&Pt(Qn,qr,Fr[qr]);return Qn};const Mn=Qn=>{var Fr,qr,Hi;const{item:$i,selectedAnswer:Wi,updatedText:H0,required:W0,errorMessage:L0}=Qn,$0=$i?.type==="reference",d0=(Fr=Wi?.map(mr=>{var Pe,Ee;return $0?(Pe=mr.valueReference)==null?void 0:Pe.display:(Ee=mr.valueCoding)==null?void 0:Ee.code}).filter(mr=>mr!==void 0))!=null?Fr:[],[K0,Aa]=(0,t.useState)(d0.length),Lr=(Hi=(qr=$i.extension)==null?void 0:qr.find(mr=>mr.url===a.Z_))==null?void 0:Hi.valueInteger,ir=(mr,Pe)=>{var Ee,$e,vt;let Gt;if(mr){const sn=Qn.options.find($n=>$n.value===Pe);Gt=[...($e=(Ee=Qn.selectedAnswer)==null?void 0:Ee.filter($n=>Object.keys($n).length!==0))!=null?$e:[],$0?{valueReference:sn?.valueReference}:{valueCoding:jt({code:Pe,display:sn?.label},sn?.system?{system:sn.system}:{}),extension:sn?.extension||[]}],Aa($n=>$n+1)}else Gt=((vt=Qn.selectedAnswer)==null?void 0:vt.filter(sn=>{var $n,dr;return $0?(($n=sn.valueReference)==null?void 0:$n.display)!==Pe:((dr=sn.valueCoding)==null?void 0:dr.code)!==Pe}))||[{}],Aa(sn=>sn-1);Qn.handleInputChange(Qn.item,Gt)};return(0,n.jsxs)("div",{"data-testid":$i.linkId,children:[H0&&(0,n.jsx)(w,{isLabel:!0,text:H0,required:W0||!1}),(0,n.jsx)("div",{children:Qn.options.map((mr,Pe)=>(0,n.jsx)(s.Checkbox,{size:"md","data-testid":mr.value,id:Pe.toString(),className:Pe!==Qn.options.length-1?"mb-2xl":"",name:mr.label,isInvalid:!!L0,isSelected:d0?.includes(mr?.value),label:mr.label,onChange:Ee=>ir(Ee,mr.value),isDisabled:Qn.readOnly||Qn.isLoading||(!d0?.includes(mr?.value)&&Lr?K0>=Lr:!1)},Pe))}),(0,n.jsx)(s.HintText,{isInvalid:!!L0,children:L0})]})},nn=({item:Qn,onCompleteHandler:Fr,updatedText:qr,options:Hi,handleInputChange:$i,errorMessage:Wi,readOnly:H0,initialValue:W0,selectedAnswer:L0,isLoading:$0,required:d0})=>{var K0,Aa;const Lr=`${Qn.linkId}-label`,ir=`${Qn.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":Qn.linkId,children:[qr&&(0,n.jsx)(w,{id:Lr,isLabel:!0,text:qr,required:d0||!1}),(0,n.jsx)(s.RadioGroup,{size:"md",id:Qn.linkId,name:Qn.linkId,"aria-labelledby":qr?Lr:void 0,"aria-describedby":Wi?ir:void 0,isRequired:d0,className:Hi.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Aa=(K0=L0?.[0])==null?void 0:K0.valueCoding)==null?void 0:Aa.code)||W0||"",onChange:mr=>{const Pe=mr,Ee=Hi.find(vt=>vt.value===Pe),$e=Ee?Ee.label:"";$i(Qn,[{valueCoding:{code:Pe,display:$e,system:Ee?.system||void 0},extension:Ee?.extension||[]}]),Fr(Qn.linkId)},isInvalid:!!Wi,children:Hi.map(mr=>(0,n.jsx)(s.RadioButton,{size:"md","data-testid":mr.value,isDisabled:H0||$0,value:mr.value,label:mr.label},mr.value))},Qn.linkId),Wi&&(0,n.jsx)("div",{id:ir,children:(0,n.jsx)("span",{className:(0,D.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Wi})})]})};var yn=Object.defineProperty,Yn=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,Dr=(Qn,Fr,qr)=>Fr in Qn?yn(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,oo=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))kr.call(Fr,qr)&&Dr(Qn,qr,Fr[qr]);if(Yn)for(var qr of Yn(Fr))Or.call(Fr,qr)&&Dr(Qn,qr,Fr[qr]);return Qn};const mi=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0,placeholder:W0,hintText:L0})=>{var $0,d0,K0,Aa,Lr;const{linkId:ir,text:mr,required:Pe,answerOption:Ee,prefix:$e,readOnly:vt}=Qn,Gt=Qn?.type==="reference",sn=mr?(0,i.nt)($i,$e,mr):"",dr=(()=>{var zr,mo;const uo=Ee?.find(Xo=>Xo.initialSelected===!0);return uo?Gt?((zr=uo.valueReference)==null?void 0:zr.display)||"":((mo=uo?.valueCoding)==null?void 0:mo.code)||"":""})(),xn=(Ee?.map(zr=>{var mo,uo,Xo,_i,Gi;return{label:((mo=zr?.valueCoding)==null?void 0:mo.display)||((uo=zr?.valueReference)==null?void 0:uo.display)||"",value:Gt?((Xo=zr.valueReference)==null?void 0:Xo.display)||"":((_i=zr.valueCoding)==null?void 0:_i.code)||"",valueReference:Gt?zr.valueReference:{},extension:zr.extension||[],system:((Gi=zr.valueCoding)==null?void 0:Gi.system)||""}})||[]).filter(zr=>zr.label),tr=Wi?.[ir],gn=(Lr=(Aa=(K0=(d0=($0=Qn?.extension)==null?void 0:$0.find(zr=>zr.url.includes("questionnaire-itemControl")))==null?void 0:d0.valueCodeableConcept)==null?void 0:K0.coding)==null?void 0:Aa[0])==null?void 0:Lr.code;let vr=null;const br={item:Qn,onCompleteHandler:Fr,updatedText:sn,options:xn,handleInputChange:Hi,errorMessage:tr,required:Pe,readOnly:vt,initialValue:dr,selectedAnswer:qr,isLoading:H0,showQuestionPrefix:$i,placeholder:W0,hintText:L0};switch(gn){case"drop-down":vr=(0,n.jsx)(Bn,oo({},br));break;case"check-box":vr=(0,n.jsx)(Mn,oo({},br));break;case"radio-button":vr=(0,n.jsx)(nn,oo({},br));break}return(0,n.jsx)(n.Fragment,{children:vr})};var Do=e(8077),qo=e(31936),Lo=e(77806),ii=e(16681);const fr=Qn=>`${String(Qn.month).padStart(2,"0")}/${String(Qn.day).padStart(2,"0")}/${Qn.year}`,Tr=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0,placeholder:W0,hintText:L0})=>{var $0,d0,K0;const{linkId:Aa,text:Lr,required:ir,prefix:mr,readOnly:Pe}=Qn,Ee=(0,t.useRef)(null),[$e,vt]=(0,t.useState)(!1),[Gt,sn]=(0,t.useState)(null),{t:$n}=(0,r.SS)(),{setIsCurrentFormValid:dr,isCurrentFormValid:xn,trackQuestionnaireEvent:tr}=(0,h.c)(),gn=Lr?(0,i.nt)($i,mr,Lr):"",vr=Wi?.[Aa]||"",br=($0=Qn.extension)==null?void 0:$0.find(k0=>k0.url===a.dU),zr=(d0=Qn.extension)==null?void 0:d0.find(k0=>k0.url===a.bK),mo=(0,t.useMemo)(()=>{var k0;const w0=br?.valueString||br?.valueDate;return w0||(0,i.iI)((k0=br?.valueExpression)==null?void 0:k0.expression)},[br]),uo=(0,t.useMemo)(()=>{var k0;const w0=zr?.valueString||zr?.valueDate;return w0||(0,i.iI)((k0=zr?.valueExpression)==null?void 0:k0.expression)},[zr]),Xo=(0,t.useMemo)(()=>{if(mo&&/^\d{4}-\d{2}-\d{2}$/.test(mo))try{return(0,Do._U)(mo)}catch{}return(0,Do._U)("1900-01-01")},[mo]),_i=(0,t.useMemo)(()=>{if(uo&&/^\d{4}-\d{2}-\d{2}$/.test(uo))try{return(0,Do._U)(uo)}catch(k0){console.warn("Failed to parse maxDateStr:",uo,k0)}return(0,Do._U)("2099-12-31")},[uo]),Di=(k0=>{if(!k0)return"";const w0=k0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!w0)return k0;const[,ui,l0,Mi]=w0;return`${l0}/${Mi}/${ui}`})(((K0=qr?.[0])==null?void 0:K0.valueDate)||""),Jo=k0=>{if(!k0)return"";const w0=k0.replace(/\D/g,"");if(w0.length===0)return"";if(w0.length<=2)return w0.length===2?`${w0}/`:w0;const ui=Mi=>{const Ga=Mi.slice(0,2),qi=Mi.slice(2);return qi.length===2?`${Ga}/${qi}/`:`${Ga}/${qi}`},l0=Mi=>{const Ga=Mi.slice(0,2),qi=Mi.slice(2,4),$a=Mi.slice(4,8);return`${Ga}/${qi}/${$a}`};return w0.length<=4?ui(w0):l0(w0)},Ui=()=>{if(Pe||H0)return;if(Di.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const w0=(0,Do._U)(Di);sn(w0)}catch{sn(null)}else{const w0=Di.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(w0){const[,ui,l0,Mi]=w0,Ga=parseInt(ui,10),qi=parseInt(l0,10);if(Ga>=1&&Ga<=12&&qi>=1&&qi<=31)try{const $a=(0,Do._U)(`${Mi}-${ui}-${l0}`);sn($a)}catch{sn(null)}else sn(null)}else sn(null)}vt(!0)},gi=()=>{if(Gt){const k0=`${Gt.year}-${String(Gt.month).padStart(2,"0")}-${String(Gt.day).padStart(2,"0")}`;tr(Qn.linkId,{value:(0,i.CP)(`${String(Gt.month).padStart(2,"0")}/${String(Gt.day).padStart(2,"0")}/${Gt.year}`)}),Hi(Qn,[{valueDate:(0,i.Fy)(k0)}])}vt(!1),sn(null)},t0=()=>{vt(!1),sn(null)},Ji=k0=>{var w0;const ui=((w0=Ee.current)==null?void 0:w0.selectionStart)||0,l0=Di,Mi=Jo(k0),Ga=Mi.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Ga){const[,qi,$a,$s]=Ga,Zs=parseInt(qi,10),_1=parseInt($a,10),P1=parseInt($s,10);if(ja(Zs,_1,P1).isValid){const J0=`${$s}-${qi}-${$a}`;tr(Qn.linkId,{value:(0,i.CP)(`${qi}/${$a}/${$s}`)}),Hi(Qn,[{valueDate:(0,i.Fy)(J0)}])}else Hi(Qn,[{valueDate:Mi}])}else Hi(Qn,[{valueDate:Mi}]);setTimeout(()=>{if(Ee.current){const qi=l0.replace(/\D/g,""),$a=Mi.replace(/\D/g,"");let $s=ui;Mi===l0&&($s=ui-1),$a.length>=qi.length&&Mi!==l0?Mi[ui-1]==="/"?$s=ui+1:$s=ui:$a.length<qi.length&&(l0[ui-1]==="/"?$s=Math.max(0,ui-1):$s=ui),Ee.current.setSelectionRange($s,$s)}},0)},ja=(k0,w0,ui)=>{if(k0<1||k0>12)return{isValid:!1,error:(0,i.u0)($n,ii.p.VALIDATION_MONTH_RANGE,"Month must be between 01 and 12")};if(w0<1||w0>31)return{isValid:!1,error:(0,i.u0)($n,ii.p.VALIDATION_DAY_RANGE,"Day must be between 01 and 31")};const l0=new Date(ui,k0,0).getDate();if(w0>l0)return{isValid:!1,error:(0,i.u0)($n,ii.p.VALIDATION_INVALID_DAY_FOR_MONTH,"Invalid day for the selected month")};if(mo||uo){const Mi=new qo.ng(ui,k0,w0);if(mo&&/^\d{4}-\d{2}-\d{2}$/.test(mo))try{const Ga=(0,Do._U)(mo);if(Mi.compare(Ga)<0){const qi=(0,i.di)(a.Ck,Qn.extension);if(qi)return{isValid:!1,error:qi};const $a=fr(Ga);return{isValid:!1,error:(0,i.u0)($n,ii.p.VALIDATION_DATE_ON_OR_AFTER,"Date must be on or after {{minDate}}",{minDate:$a})}}}catch{}if(uo&&/^\d{4}-\d{2}-\d{2}$/.test(uo))try{const Ga=(0,Do._U)(uo);if(Mi.compare(Ga)>0){const qi=(0,i.di)(a.Cx,Qn.extension);if(qi)return{isValid:!1,error:qi};const $a=fr(Ga);return{isValid:!1,error:(0,i.u0)($n,ii.p.VALIDATION_DATE_ON_OR_BEFORE,"Date must be on or before {{maxDate}}",{maxDate:$a})}}}catch{}}return{isValid:!0,error:""}},U0=()=>{const k0=Di.replace(/\D/g,"");if(k0.length>0&&k0.length<8){Fr(Qn.linkId);return}const w0=Di.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!w0&&k0.length>=6){Fr(Qn.linkId);return}if(w0){const[,ui,l0,Mi]=w0,Ga=parseInt(ui,10),qi=parseInt(l0,10),$a=parseInt(Mi,10);if(ja(Ga,qi,$a).isValid){const $s=`${Mi}-${ui}-${l0}`;Hi(Qn,[{valueDate:(0,i.Fy)($s)}])}}Fr(Qn.linkId)},Sa=(()=>{if(!Di)return"";const k0=Di.replace(/\D/g,"");if(k0.length>0&&k0.length<8)return"";const w0=Di.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!w0&&k0.length>=6)return xn&&dr(!1),(0,i.u0)($n,ii.p.VALIDATION_INVALID_DATE,"Invalid date");if(w0){const[,ui,l0,Mi]=w0,Ga=parseInt(ui,10),qi=parseInt(l0,10),$a=parseInt(Mi,10),{isValid:$s,error:Zs}=ja(Ga,qi,$a);if(!$s)return xn&&dr(!1),Zs||(0,i.u0)($n,ii.p.VALIDATION_INVALID_DATE,"Invalid date")}return""})(),ls=!!vr||!!Sa;return(0,n.jsxs)("div",{children:[gn&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:gn,required:ir||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Pe||H0,className:(0,D.cx)("absolute top-2.5 right-3 z-3 cursor-pointer p-0.5","outline-focus-ring rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2",(Pe||H0)&&"cursor-not-allowed opacity-50"),onClick:Ui,"aria-label":"Open calendar",children:(0,n.jsx)(X.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||H0)&&"bg-disabled_subtle")}),(0,n.jsx)(s.Input,{ref:Ee,isRequired:ir,size:"md",type:"text",name:Aa,"data-testid":Aa,id:Aa,value:Di,onChange:Ji,placeholder:W0,isDisabled:Pe||H0,onBlur:U0,hint:Sa||vr||L0,isInvalid:ls,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:$e,onOpenChange:k0=>{k0||t0()},primaryButton:{children:"Apply",onClick:gi,isDisabled:!Gt},secondaryButton:{children:"Cancel",onClick:t0},children:(0,n.jsx)(Lo.lr,{value:Gt,onChange:sn,minValue:Xo,maxValue:_i,children:(0,n.jsx)(s.Calendar,{showDateInput:!1,minValue:Xo,maxValue:_i,onYearPickerOpen:()=>{sn(null)}})})})]})},Br=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0})=>{var W0;const{linkId:L0,text:$0,required:d0,prefix:K0,readOnly:Aa}=Qn,Lr=$0?(0,i.nt)($i,K0,$0):"",ir=Wi?.[L0]||"";return(0,n.jsxs)("div",{children:[Lr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Lr,required:d0||!1}),(0,n.jsx)(s.Input,{isRequired:d0,size:"md",type:"datetime-local",id:L0,"aria-label":L0,"data-testid":L0,placeholder:"Type your response here...",value:((W0=qr?.[0])==null?void 0:W0.valueDateTime)||"",onChange:mr=>{let Pe=mr;const[Ee,$e]=Pe.split("T");Ee&&$e&&(Pe=`${(0,i.Fy)(Ee)}T${$e}:00`),Hi(Qn,[{valueDateTime:Pe}])},isDisabled:Aa||H0,onBlur:()=>{Fr(Qn.linkId)},hint:ir,isInvalid:!!ir},L0)]})},To=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0,placeholder:W0,hintText:L0})=>{var $0;const{linkId:d0,text:K0,required:Aa,prefix:Lr,readOnly:ir}=Qn,mr=K0?(0,i.nt)($i,Lr,K0):"",Pe=Wi?.[d0]||"",Ee=(0,i.a0)(Qn),$e=($0=qr?.[0])==null?void 0:$0.valueDecimal,[vt,Gt]=(0,t.useState)(String($e??""));return(0,t.useEffect)(()=>{Gt(String($e??""))},[$e]),(0,n.jsxs)("div",{children:[mr&&(0,n.jsx)(w,{isLabel:!0,text:mr,required:Aa||!1}),(0,n.jsx)(s.Input,{isRequired:Aa,size:"md",id:d0,"aria-label":d0,"data-testid":d0,placeholder:W0,value:vt,onChange:sn=>{Gt(sn)},isDisabled:ir||H0,onBlur:()=>{const sn=parseFloat(vt);Gt(isNaN(sn)?"":String(sn)),Hi(Qn,[{valueDecimal:isNaN(sn)?void 0:sn}]),Fr(Qn.linkId)},type:"number",hint:Pe||L0,isInvalid:!!Pe,autoComplete:Ee},d0)]})},bo=({item:Qn,showStepper:Fr=!1})=>{var qr;const{text:Hi,linkId:$i,type:Wi}=Qn,H0=Hi&&(0,i.nt)(!1,"",Hi),W0=(qr=Qn.extension)==null?void 0:qr.find(K0=>K0.url===a.Yt),L0=W0?.valueBoolean===!0,$0=Wi==="group"&&(0,i.$O)(Qn)!==void 0,d0=()=>{const K0=(0,i.$O)(Qn),Aa=(0,i.t7)(Qn);if(K0===void 0||Aa===void 0||Aa<=0)return[];const Lr=[];for(let ir=1;ir<=Aa;ir++){let mr="incomplete";ir<K0?mr="complete":ir===K0&&(mr="current"),Lr.push({title:"",description:"",status:mr})}return Lr};return H0&&!L0?(0,n.jsxs)("div",{"data-testid":$i,children:[(0,n.jsx)(w,{text:H0,required:!1,className:""}),Fr&&$0&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(s.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:d0()})})]}):null},Ei=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0,placeholder:W0,hintText:L0})=>{var $0;const{linkId:d0,text:K0,required:Aa,prefix:Lr,readOnly:ir}=Qn,mr=K0?(0,i.nt)($i,Lr,K0):"",Pe=Wi?.[d0]||"",Ee=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[mr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:mr,required:Aa||!1}),(0,n.jsx)(s.Input,{isRequired:Aa,"data-testid":d0,size:"md",id:d0,"aria-label":d0,placeholder:W0,value:String(($0=qr?.[0])==null?void 0:$0.valueInteger)||"",onChange:$e=>{Hi(Qn,[{valueInteger:Number($e)}])},isDisabled:ir||H0,onBlur:()=>{Fr(Qn.linkId)},type:"number",hint:Pe||L0,isInvalid:!!Pe,autoComplete:Ee},d0)]})},Ii=({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0,placeholder:W0,hintText:L0})=>{var $0,d0,K0;const{linkId:Aa,text:Lr,extension:ir,required:mr,prefix:Pe,readOnly:Ee}=Qn,$e=Lr?(0,i.nt)($i,Pe,Lr):"",vt=ir?.find($n=>$n.url.includes("questionnaire-unitOption")),Gt=Wi?.[Aa],sn=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[$e&&(0,n.jsx)(w,{isLabel:!0,text:$e,required:mr||!1}),(0,n.jsx)(s.InputGroup,{isRequired:mr,size:"md",id:Aa,"aria-label":Aa,"data-testid":Aa,value:($0=qr?.[0])!=null&&$0.valueQuantity?String((d0=qr[0].valueQuantity)==null?void 0:d0.value):"",onChange:$n=>{Hi(Qn,[{valueQuantity:{value:parseFloat($n)}}])},isDisabled:Ee||H0,onBlur:()=>{var $n,dr,xn;const tr=($n=qr?.[0])!=null&&$n.valueQuantity?parseFloat(String((xn=(dr=qr?.[0])==null?void 0:dr.valueQuantity)==null?void 0:xn.value)).toFixed(2):"";Hi(Qn,[{valueQuantity:{value:parseFloat(tr)}}]),Fr(Qn.linkId)},hint:Gt||L0,isInvalid:!!Gt,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:(K0=vt?.valueCoding)==null?void 0:K0.display}),children:(0,n.jsx)(s.InputBase,{type:"number",placeholder:W0,autoComplete:sn})},Aa)]})},Fi={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},i0={[Fi.CURRENT_LOCATION]:ii.p.CURRENT_LOCATION,[Fi.ZIP_CODE]:ii.p.ZIP_CODE,[Fi.ADDRESS]:ii.p.ADDRESS},ea={mi:{singular:ii.p.MILE,plural:ii.p.MILES}},R0=({resourceData:Qn,handleInputChange:Fr,item:qr,questionnaireSchemaItems:Hi})=>{var $i;const{t:Wi}=(0,r.SS)(),{queryParams:H0}=(0,Tt.useSearchQueryParams)(),W0=H0.locationType||"",{setCurrentGroupIndex:L0,handleContinueButtonClick:$0,setHideFooterButton:d0}=(0,h.c)(),{trackEvent:K0}=(0,o.st)();(0,t.useEffect)(()=>{if(!qr.readOnly)return d0(!0),()=>{d0(!1)}},[qr.readOnly,d0]);const Aa=($i=qr.extension)==null?void 0:$i.find(dr=>dr.url===a.Uf),Lr=Aa?.valueString,ir=()=>{if(Lr){const dr=(0,i.Ue)(Hi||[],Lr);dr!==-1&&L0(dr)}},mr=dr=>{const xn=dr.find(tr=>tr.url.includes("description"));return xn?.valueString||""},Pe=dr=>{const xn=dr.find(mo=>mo.url.includes("distance-value")),tr=dr.find(mo=>mo.url.includes("distance-unit")),gn=xn?.valueString?Number(xn.valueString):NaN,vr=tr?.valueString||"";if(!vr||isNaN(gn))return null;const br=Math.round(gn);let zr=vr;return ea[vr]&&(zr=Wi(br===1?ea[vr].singular:ea[vr].plural)),W0&&i0[W0]?Wi(ii.p.LOCATION_DISTANCE,{distance:`${br} ${zr}`,locationType:Wi(i0[W0])}):Wi(ii.p.LOCATION_DISTANCE_AWAY,{distance:`${br} ${zr}`})},Ee=dr=>({id:dr.id||"",providerName:dr.name||"",specialty:"",distance:Pe(dr.extension||[])||"",placeholderIcon:s.WalgreensLogo,address:dr.address||"",valueReference:dr.valueReference||{reference:dr.id}}),$e=dr=>{var xn,tr,gn,vr;const br=dr;return Ee({id:br.id,name:(xn=br.name)!=null?xn:"",address:(vr=(gn=(tr=br?.address)==null?void 0:tr.line)==null?void 0:gn[0])!=null?vr:"",extension:br?.extension,valueReference:{reference:br.id}})},vt=dr=>Ee({id:dr?.reference,name:dr?.display,address:mr(dr?.extension||[]),extension:dr?.extension,valueReference:dr}),sn=(()=>Qn&&Array.isArray(Qn)&&Qn.length>0?Qn.map($e):qr.initial&&Array.isArray(qr.initial)&&qr.initial.length>0?qr.initial.map(dr=>vt(dr.valueReference)):qr.answerOption?qr.answerOption.map(dr=>vt(dr.valueReference)):[])(),$n=dr=>{Fr(qr,[{valueReference:dr}])};return(0,n.jsx)("div",{className:(0,s.cx)("gap-md flex flex-col",!qr.readOnly&&"pb-4xl"),children:qr.readOnly?sn.map(({address:dr,id:xn,providerName:tr,placeholderIcon:gn,distance:vr})=>(0,n.jsx)(Tt.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:gn},locationName:tr,address:dr,distance:vr,actionButtonText:Lr?"Change location":void 0,onActionButtonClick:Lr?ir:void 0},xn)):sn.map(({address:dr,id:xn,providerName:tr,placeholderIcon:gn,specialty:vr,valueReference:br,distance:zr})=>(0,n.jsx)(s.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:gn},providerName:{content:tr},specialty:{content:vr},location:{address:dr,distance:zr},actionButton:{children:"Schedule appointment",onClick:()=>{K0("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:dr,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),$n(br),$0?.()}}},xn))})};var Ca=e(79079),Y0=e(21886),m0=e(43915),Qi=e(36181),O0=e(37234),Ia=e(65388),Mr=Object.defineProperty,or=Object.defineProperties,Yr=Object.getOwnPropertyDescriptors,Ir=Object.getOwnPropertySymbols,Ho=Object.prototype.hasOwnProperty,En=Object.prototype.propertyIsEnumerable,Xn=(Qn,Fr,qr)=>Fr in Qn?Mr(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,xr=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))Ho.call(Fr,qr)&&Xn(Qn,qr,Fr[qr]);if(Ir)for(var qr of Ir(Fr))En.call(Fr,qr)&&Xn(Qn,qr,Fr[qr]);return Qn},co=(Qn,Fr)=>or(Qn,Yr(Fr));const er={"ui-toolkit/LocationCard":R0,"ui-toolkit/TimeSlotSelection":({resourceData:Qn,item:Fr,handleInputChange:qr,selectedAnswer:Hi,questionnaireSchemaItems:$i,formData:Wi,onCompleteHandler:H0})=>{var W0,L0;const{t:$0}=(0,Ca.S)(),{trackEvent:d0}=(0,o.st)(),{isLoading:K0,setIsInlineNextQuestionTriggered:Aa}=(0,h.c)(),Lr=ui=>{const l0=ui.match(/^(\d{4}-\d{2}-\d{2})/);return l0?l0[1]:ui},ir=(0,t.useCallback)(ui=>{var l0;return(l0=ui.find(Mi=>Mi?.url===a.zD||Mi?.url===a.UZ))==null?void 0:l0.valueCode},[]),mr=(0,t.useCallback)((ui,l0)=>{const Mi=ir(l0);if(!Mi)return oe(ui);try{return(0,ge.formatToTimeZone)(ui,"h:mm A",{timeZone:Mi})}catch{return oe(ui)}},[ir]),Pe=(0,t.useCallback)((ui,l0)=>{const Mi=ir(l0);if(!Mi)return Lr(ui);try{return(0,ge.formatToTimeZone)(ui,"YYYY-MM-DD",{timeZone:Mi})}catch{return Lr(ui)}},[ir]),Ee=ui=>{const l0=ui.match(/^(\d{4})-(\d{2})-(\d{2})/);if(l0){const[,Mi,Ga,qi]=l0;return new Date(parseInt(Mi),parseInt(Ga)-1,parseInt(qi))}return new Date},vt=(()=>{var ui;if((ui=Hi?.[0])!=null&&ui.valueReference){const l0=Hi[0].valueReference,Mi=l0.display||"",Ga=Pe(Mi,l0.extension||[]);if(Ga)return{date:Ee(Ga),slotId:l0.reference||""}}return{date:new Date,slotId:""}})(),[Gt,sn]=(0,t.useState)(vt.date),[$n,dr]=(0,t.useState)(vt.slotId),[xn,tr]=(0,t.useState)(new Set),gn=(0,t.useMemo)(()=>new qo.ng(Gt.getFullYear(),Gt.getMonth()+1,Gt.getDate()),[Gt]),vr=ui=>({display:ui.display||"",id:ui.id||"",start:ui.start||"",extension:Array.isArray(ui.extension)?ui.extension:[],identifier:Array.isArray(ui.identifier)?ui.identifier:[],type:ui.type||""}),br=ui=>{var l0;return vr({display:(l0=ui.start)!=null?l0:"",id:ui.id,start:ui.start,extension:ui.extension,identifier:ui.identifier})},zr=ui=>vr({display:ui?.display||"",id:ui?.reference,start:ui?.display,extension:ui?.extension,identifier:ui?.identifier,type:ui?.type}),mo=()=>{if(Array.isArray(Qn)&&Qn.length>0)return Qn.filter(ui=>ui.resourceType==="Appointment").map(br);if(Fr.initial&&Array.isArray(Fr.initial)&&Fr.initial.length>0)return Fr.initial.map(ui=>zr(ui.valueReference));if(Fr.answerOption)return Fr.answerOption.map(ui=>zr(ui.valueReference))},uo=(0,t.useMemo)(()=>mo()||[],[Qn,Hi,Fr]),Xo=(0,t.useMemo)(()=>{const ui={};return uo.forEach(l0=>{if(l0.start&&l0.id){const Mi=Pe(l0.start,l0.extension);ui[Mi]||(ui[Mi]=[]),ui[Mi].push({display:l0.display,id:l0.id,start:l0.start,extension:l0.extension})}}),ui},[uo,Pe]),_i=(0,t.useMemo)(()=>{const ui=Object.keys(Xo).sort(),l0=[];if(ui.length===0)return l0.push(gn),xn.forEach(qi=>{const $a=(0,m0.A)(qi);l0.push(new qo.ng($a.getFullYear(),$a.getMonth()+1,$a.getDate()))}),l0;const Mi=(0,m0.A)(ui[ui.length-1]),Ga=new qo.ng(Mi.getFullYear(),Mi.getMonth()+1,Mi.getDate());for(let qi=gn;qi.compare(Ga)<=0;qi=qi.add({days:1})){const $a=`${qi.year}-${String(qi.month).padStart(2,"0")}-${String(qi.day).padStart(2,"0")}`;Xo[$a]||l0.push(qi)}if(!(0,i.mR)(Fr)){const qi=(0,Y0.Ec)((0,Y0.Xj)()).add({days:30});let $a=Ga.add({days:1});for(;$a.compare(qi)<=0;)l0.push($a),$a=$a.add({days:1})}return xn.forEach(qi=>{const $a=(0,m0.A)(qi),$s=new qo.ng($a.getFullYear(),$a.getMonth()+1,$a.getDate());l0.some(Zs=>Zs.year===$s.year&&Zs.month===$s.month&&Zs.day===$s.day)||l0.push($s)}),l0},[Xo,xn,gn,Fr]),Gi=(0,t.useMemo)(()=>(0,i.mR)(Fr)?s.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[Fr]),Di=(0,t.useMemo)(()=>Object.keys(Xo).map(ui=>{const l0=(0,m0.A)(ui);return new qo.ng(l0.getFullYear(),l0.getMonth()+1,l0.getDate())}),[Xo]),Jo=(0,Qi.A)((0,O0.A)(Gt),"yyyy-MM-dd"),Ui=(0,t.useMemo)(()=>Xo[Jo]||[],[Xo,Jo]);(0,t.useEffect)(()=>{const ui=Object.entries(Xo).sort(([l0],[Mi])=>l0.localeCompare(Mi)).slice(0,3).reduce((l0,[Mi,Ga])=>co(xr({},l0),{[`${Mi} ${ja}`]:Ga.map(qi=>{var $a;return(0,Ia.YX)({time:qi.start,timeZone:(0,i.lv)(($a=Ui[0])==null?void 0:$a.extension)}).time})}),{});d0("slots_returned",{Specialty:"Vaccines",first_three_days_slots:ui,_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 gi=t.useRef(null),t0=t.useRef(null),Ji=t.useRef(!1);(0,t.useEffect)(()=>{var ui;const l0=Object.keys(Xo).sort();l0.length===0||Ji.current||(Ji.current=!0,(ui=Hi?.[0])!=null&&ui.valueReference||sn((0,m0.A)(l0[0])))},[Xo]),(0,t.useEffect)(()=>{var ui;const l0=Object.keys(Xo).sort();if(l0.length===0)return;const Ga=!(gi.current===null)&&JSON.stringify(gi.current)!==JSON.stringify(Xo);if(gi.current=Xo,!!Ga&&(tr(new Set),t0.current)){const qi=t0.current;if(!(((ui=Xo[qi])==null?void 0:ui.length)>0)){const $s=new Set,Zs=(0,m0.A)(qi),_1=(0,m0.A)(l0[0]);let P1=Zs;for(;P1<_1;){const J0=(0,Qi.A)(P1,"yyyy-MM-dd");$s.add(J0),P1=new Date(P1),P1.setDate(P1.getDate()+1)}tr($s),dr("")}t0.current=null}},[Xo]);const ja=(0,t.useMemo)(()=>{const ui=Ui[0];if(!ui?.extension)return"";const l0=ir(ui.extension);try{return(0,ge.formatToTimeZone)(new Date,"(z)",{timeZone:l0??""})}catch{return""}},[Ui,ir]),U0=(0,t.useMemo)(()=>{const ui=$0(s.Translations.NEXT_AVAILABLE_APPOINTMENTS);return ja?`${ui} ${ja}`:ui},[$0,ja]),s0=(0,t.useMemo)(()=>{const ui=(0,Y0.Ec)((0,Y0.Xj)()).add({days:Gi}),l0=`${ui.year}-${String(ui.month).padStart(2,"0")}-${String(ui.day).padStart(2,"0")}`,Ga=Object.keys(Xo).sort().find(qi=>qi>Jo&&qi<=l0);if(Ga){const qi=(0,m0.A)(Ga);return new qo.ng(qi.getFullYear(),qi.getMonth()+1,qi.getDate())}return null},[Xo,Jo,Gi]),Sa=()=>{if(s0){const ui=s0.toDate((0,Y0.Xj)());sn(ui),dr("")}},ls=ui=>{if(!ui){dr(""),qr(Fr,void 0);return}dr(ui.id);const l0=[{valueReference:{display:ui.display,reference:ui.id,extension:ui.extension,identifier:ui.identifier,type:ui.type}}];qr(Fr,l0)},k0=ui=>{var l0;if(!ui||K0||!Ji.current)return;const Mi=Object.keys(Xo).sort(),Ga=Mi[Mi.length-1],qi=Mi[0],$a=`${ui.year}-${String(ui.month).padStart(2,"0")}-${String(ui.day).padStart(2,"0")}`;if(Ga&&($a>Ga||qi&&$a<qi)&&(0,i.mR)(Fr)&&$i&&!_i?.some(Zs=>Zs.compare(ui)===0)){const Zs=(0,i.yQ)(Fr,$i);if(Zs){t0.current=$a;let _1="-06:00";if((l0=uo[0])!=null&&l0.start){const j1=uo[0].start.match(/([+-]\d{2}:\d{2})$/);j1&&(_1=j1[1])}const J0=[{valueDateTime:`${$a}T23:59:59${_1}`}],el=qr(Zs,J0);qr(Fr,void 0,(0,i.Nw)(el||Wi||[],Fr.linkId),void 0,!0),Aa(!0),H0(Zs.linkId,!0,!0)}}const $s=ui.toDate((0,Y0.Xj)());sn($s)},w0=ui=>{if(!ui)return;const l0=Ui.find(Mi=>Mi.id===ui);d0("slot_selected",{Specialty:"Vaccines",time_slot:l0?(0,Ia.YX)({time:l0.start,timeZone:(0,i.lv)(Ui[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."}}),ls(l0??null)};return(0,n.jsx)(s.TimeSlot,{onChange:k0,disabledDates:_i,highlightedDates:Di,loading:K0,minValue:(0,Y0.Ec)((0,Y0.Xj)()),maxValue:(0,Y0.Ec)((0,Y0.Xj)()).add({days:Gi}),value:gn,defaultValue:gn,appointmentSlots:{title:U0,onChange:w0,defaultValue:Hi&&((L0=(W0=Hi[0])==null?void 0:W0.valueReference)==null?void 0:L0.reference)||void 0,value:$n||void 0,items:Ui.map(ui=>({label:mr(ui.start,ui.extension),value:ui.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[$0(s.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),s0&&(0,n.jsx)("button",{onClick:Sa,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:$0(s.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var Wr=Object.defineProperty,ni=Object.defineProperties,Yi=Object.getOwnPropertyDescriptors,ta=Object.getOwnPropertySymbols,X0=Object.prototype.hasOwnProperty,sa=Object.prototype.propertyIsEnumerable,Ti=(Qn,Fr,qr)=>Fr in Qn?Wr(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,So=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))X0.call(Fr,qr)&&Ti(Qn,qr,Fr[qr]);if(ta)for(var qr of ta(Fr))sa.call(Fr,qr)&&Ti(Qn,qr,Fr[qr]);return Qn},Wa=(Qn,Fr)=>ni(Qn,Yi(Fr)),vs=(Qn,Fr)=>{var qr={};for(var Hi in Qn)X0.call(Qn,Hi)&&Fr.indexOf(Hi)<0&&(qr[Hi]=Qn[Hi]);if(Qn!=null&&ta)for(var Hi of ta(Qn))Fr.indexOf(Hi)<0&&sa.call(Qn,Hi)&&(qr[Hi]=Qn[Hi]);return qr};const Ls=(Qn,Fr)=>Qn.answerOption?Qn.answerOption.map(qr=>{var Hi,$i;const Wi=($i=(Hi=qr.valueReference)==null?void 0:Hi.reference)==null?void 0:$i.replace("#","");return Fr.find(H0=>H0.id===Wi)}).filter(Boolean):[],zs=Qn=>{var Fr,qr,Hi;const $i=Qn.find(Wi=>{var H0,W0;return Wi.url.includes("questionnaire-itemControl")&&((W0=(H0=Wi.valueCodeableConcept)==null?void 0:H0.coding)==null?void 0:W0.some(L0=>{var $0;return($0=L0.code)==null?void 0:$0.startsWith("ui-toolkit/")}))});return(Hi=(qr=(Fr=$i?.valueCodeableConcept)==null?void 0:Fr.coding)==null?void 0:qr.find(Wi=>{var H0;return(H0=Wi.code)==null?void 0:H0.startsWith("ui-toolkit/")}))==null?void 0:Hi.code},ss=Qn=>{var{uiToolkitCode:Fr,props:qr}=Qn,Hi=qr,{item:$i,contained:Wi=[],customErrorConfigurations:H0}=Hi,W0=vs(Hi,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:L0}=(0,h.c)(),$0=er[Fr];if(!$0)return(0,n.jsx)(n.Fragment,{});const d0=Ls($i,Wi),K0=d0.length>0;return!($i.answerOption&&$i.answerOption.length>0)&&!K0&&!$i.readOnly?(L0(!0),(0,n.jsx)(ot,{configKey:Fr,customErrorConfigurations:H0})):(0,n.jsx)($0,Wa(So({},W0),{item:$i,contained:Wi,customErrorConfigurations:H0,resourceData:d0,"data-testid":$i.linkId}))},ar={attachment:kn,choice:mi,boolean:Hr,integer:Ei,string:({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0,placeholder:W0,hintText:L0})=>{var $0;const{linkId:d0,text:K0,required:Aa,prefix:Lr,readOnly:ir}=Qn,mr=K0?(0,i.nt)($i,Lr,K0):"",Pe=Wi?.[d0]||"",Ee=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[mr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:mr,required:Aa||!1}),(0,n.jsx)(s.Input,{isRequired:Aa,size:"md","aria-label":d0,"data-testid":d0,id:d0,type:Ee==="tel"?"tel":"text",placeholder:W0,value:(($0=qr?.[0])==null?void 0:$0.valueString)||"",onChange:$e=>{Hi(Qn,[{valueString:$e}])},isDisabled:ir||H0,onBlur:$e=>{const vt=$e.target.value,Gt=vt.trim();Gt!==vt&&Hi(Qn,[{valueString:Gt}]),Fr(Qn.linkId)},hint:Pe||L0,isInvalid:!!Pe,autoComplete:Ee},d0)]})},url:({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0,placeholder:W0,hintText:L0})=>{var $0;const{linkId:d0,text:K0,required:Aa,prefix:Lr,readOnly:ir}=Qn,mr=K0?(0,i.nt)($i,Lr,K0):"",Pe=Wi?.[d0]||"",Ee=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[mr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:mr,required:Aa||!1}),(0,n.jsx)(s.Input,{isRequired:Aa,size:"md",type:"url",id:d0,"data-testid":d0,"aria-label":d0,placeholder:W0,value:(($0=qr?.[0])==null?void 0:$0.valueUri)||"",onChange:$e=>{Hi(Qn,[{valueUri:$e}])},isDisabled:ir||H0,onBlur:$e=>{const vt=$e.target.value,Gt=vt.trim();Gt!==vt&&Hi(Qn,[{valueUri:Gt}]),Fr(Qn.linkId)},hint:Pe||L0,isInvalid:!!Pe,autoComplete:Ee},d0)]})},text:({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0,placeholder:W0,hintText:L0})=>{var $0;const{linkId:d0,text:K0,required:Aa,prefix:Lr,readOnly:ir,maxLength:mr}=Qn,Pe=K0?(0,i.nt)($i,Lr,K0):"",Ee=Wi?.[d0]||"",$e=(0,i.a0)(Qn);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Aa||!1}),(0,n.jsx)(s.TextArea,{isRequired:Aa,id:d0,"aria-label":d0,"data-testid":d0,rows:3,placeholder:W0,value:(($0=qr?.[0])==null?void 0:$0.valueString)||"",onChange:vt=>{Hi(Qn,[{valueString:vt}])},isDisabled:ir||H0,onBlur:vt=>{const Gt=vt.target.value,sn=Gt.trim();sn!==Gt&&Hi(Qn,[{valueString:sn}]),Fr(Qn.linkId)},hint:Ee||L0,counter:!0,isInvalid:!!Ee,maxLength:mr,autoComplete:$e},d0)]})},date:Tr,time:({item:Qn,onCompleteHandler:Fr,selectedAnswer:qr,handleInputChange:Hi,showQuestionPrefix:$i,errors:Wi,isLoading:H0})=>{var W0;const{linkId:L0,text:$0,required:d0,prefix:K0,readOnly:Aa}=Qn,Lr=$0?(0,i.nt)($i,K0,$0):"",ir=Wi?.[L0]||"";return(0,n.jsxs)("div",{children:[Lr&&(0,n.jsx)(w,{isLabel:!0,text:Lr,required:d0||!1}),(0,n.jsx)(s.Input,{isRequired:d0,size:"md",type:"time",id:L0,"data-testid":L0,"aria-label":L0,placeholder:"Type your response here...",value:((W0=qr?.[0])==null?void 0:W0.valueTime)||"",onChange:mr=>{Hi(Qn,[{valueTime:mr}])},isDisabled:Aa||H0,onBlur:()=>{Fr(Qn.linkId)},hint:ir,isInvalid:!!ir},L0)]})},dateTime:Br,quantity:Ii,decimal:To,question:bo,display:bo,group:bo,reference:Qn=>{var Fr,qr,Hi,$i,Wi;const{setHideFooterButton:H0}=(0,h.c)(),{item:W0,customErrorConfigurations:L0}=Qn,$0=W0.extension||[],d0=zs($0);return d0?(0,n.jsx)(ss,{uiToolkitCode:d0,props:Qn}):((Wi=($i=(Hi=(qr=(Fr=W0?.extension)==null?void 0:Fr.find(Aa=>Aa.url.includes("questionnaire-itemControl")))==null?void 0:qr.valueCodeableConcept)==null?void 0:Hi.coding)==null?void 0:$i[0])==null?void 0:Wi.code)==="check-box"?W0.answerOption&&W0.answerOption.length>0?(0,n.jsx)(mi,Wa(So({},Qn),{item:W0})):(H0(!0),(0,n.jsx)(ot,{configKey:W0.linkId,customErrorConfigurations:L0})):null}};var vo=(Qn,Fr,qr)=>new Promise((Hi,$i)=>{var Wi=L0=>{try{W0(qr.next(L0))}catch($0){$i($0)}},H0=L0=>{try{W0(qr.throw(L0))}catch($0){$i($0)}},W0=L0=>L0.done?Hi(L0.value):Promise.resolve(L0.value).then(Wi,H0);W0((qr=qr.apply(Qn,Fr)).next())});const Wo=({item:Qn,selectedAnswer:Fr,showQuestionPrefix:qr})=>{const{text:Hi,prefix:$i,required:Wi}=Qn,H0=Hi?getUpdatedQuestionText(qr,$i,Hi):"",[W0,L0]=useState(null),[$0,d0]=useState(!1),{documentDownload:K0,webview:Aa}=useNativeBridge(),Lr=(Fr||[]).filter(Ee=>{var $e,vt;return(($e=Ee.valueAttachment)==null?void 0:$e.data)&&((vt=Ee.valueAttachment)==null?void 0:vt.title)}).map((Ee,$e)=>{var vt,Gt,sn,$n,dr,xn,tr;return{id:((vt=Ee.valueAttachment)==null?void 0:vt.id)||`preview-${$e}`,fileName:((Gt=Ee.valueAttachment)==null?void 0:Gt.title)||`attachment-${$e}`,contentType:((sn=Ee.valueAttachment)==null?void 0:sn.contentType)||"application/octet-stream",base64Data:(($n=Ee.valueAttachment)==null?void 0:$n.data)||"",size:getBase64Size(((dr=Ee.valueAttachment)==null?void 0:dr.data)||"",(xn=Ee.valueAttachment)==null?void 0:xn.contentType),type:getFileTypeFromMimeType((tr=Ee.valueAttachment)==null?void 0:tr.contentType)}}),ir=useCallback(Ee=>{const{fileName:$e,contentType:vt,base64Data:Gt}=Ee;if(Aa.isWithin)L0({fileName:$e,contentType:vt,base64Data:Gt}),d0(!0);else{const sn=base64toObjectUrl(Gt,vt),$n=document.createElement("a");$n.href=sn,$n.download=$e,document.body.appendChild($n),$n.click(),document.body.removeChild($n),URL.revokeObjectURL(sn)}},[Aa.isWithin]),mr=useCallback(()=>vo(void 0,null,function*(){!W0||(yield K0.writeFile(W0.fileName,prepareDataUrl(W0.base64Data,W0.contentType)))}),[W0,K0]),Pe=useCallback(()=>{d0(!1),L0(null)},[]);return Lr.length?jsxs("div",{children:[H0&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:H0,required:Wi||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:Lr.map(Ee=>jsx("button",{type:"button",onClick:()=>ir(Ee),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(Ee.fileName),size:Ee.size,type:Ee.type})},Ee.id))}),jsx(DownloadDisclosureModal,{opened:$0,onClose:Pe,onDownload:mr,contentType:W0?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var Vt=Object.defineProperty,Ge=Object.defineProperties,ct=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,Vn=Object.prototype.hasOwnProperty,pr=Object.prototype.propertyIsEnumerable,Pr=(Qn,Fr,qr)=>Fr in Qn?Vt(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,yo=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))Vn.call(Fr,qr)&&Pr(Qn,qr,Fr[qr]);if(wt)for(var qr of wt(Fr))pr.call(Fr,qr)&&Pr(Qn,qr,Fr[qr]);return Qn},Vo=(Qn,Fr)=>Ge(Qn,ct(Fr));const Go=(Qn,Fr,qr,Hi)=>{var $i;const Wi=Qn.extension||[];if(Hi?.[BUTTON_TYPE_EXTERNAL_KEY]&&Wi.some(d0=>d0.url===BUTTON_TYPE_EXTENSION_URL))return Hi[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(Qn)||hasParentWithUIToolkitWidget(Qn,Fr))return null;if(qr&&Qn.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const H0=getUIToolkitCode(Wi),W0=Wi.filter(d0=>d0.url.includes("questionnaire-itemControl")).flatMap(d0=>{var K0,Aa;return(Aa=(K0=d0.valueCodeableConcept)==null?void 0:K0.coding)!=null?Aa:[]})||[];let L0;return Hi&&(L0=($i=W0.find(d0=>d0.code&&Hi[d0.code]))==null?void 0:$i.code),(L0&&Hi?Hi[L0]:void 0)||UI_TOOLKIT_WIDGET_MAP[H0||""]||typeToRenderFunctionMap[Qn.type]||null},a0=Qn=>{var Fr;const{item:qr,selectedAnswer:Hi,handleInputChange:$i,showQuestionPrefix:Wi,errors:H0,questionnaireSchemaItems:W0,formData:L0,isNestedRepeatedItem:$0=!1}=Qn,{linkId:d0,text:K0,prefix:Aa,required:Lr,repeats:ir}=qr,mr=getMaxOccursFromExtensions(qr.extension),Pe=getPlaceholderFromExtensions(qr.extension,qr.type),[Ee,$e]=useState(()=>{if(qr.type==="group"&&qr.item&&qr.item.length>0){const zr=L0?.filter(mo=>mo.linkId===qr.linkId)||[];if(zr.length>0)return zr.map((mo,uo)=>uo)}else if(Hi&&Hi.length>0)return Hi.map((zr,mo)=>mo);return[0]}),vt=mr!==void 0&&Ee.length>=mr,Gt=K0?getUpdatedQuestionText(Wi,Aa,K0):"",sn=()=>{const zr=Math.max(...Ee,-1)+1,mo=[...Ee,zr];if($e(mo),qr.type==="group"&&qr.item&&qr.item.length>0){const uo=qr.item.map(_i=>({linkId:_i.linkId,text:_i.text,answer:[{}]})),Xo={linkId:qr.linkId,text:qr.text,answer:[{}],item:uo};$i(qr,void 0,[Xo])}else{const uo=[...Hi||[]];uo.push({}),$i(qr,uo)}},$n=zr=>{if(Ee.length<=1)return;const mo=Ee.filter((uo,Xo)=>Xo!==Ee.length-1);if($e(mo),qr.type==="group"&&qr.item&&qr.item.length>0){const uo=[];if(L0?.forEach((Xo,_i)=>{Xo.linkId===d0&&uo.push({item:Xo,originalIndex:_i})}),zr>=0&&zr<uo.length){const Xo=uo[zr],_i=L0?.filter((Gi,Di)=>Di!==Xo.originalIndex);$i(qr,void 0,_i,void 0,!0)}}else{const uo=Hi?.filter((Xo,_i)=>_i!==zr)||[];$i(qr,uo.length>0?uo:[{}])}},dr=zr=>{if(!L0||!qr.item)return[];const mo=_i=>{const Gi=[];for(const Di of _i)if(Di.linkId===qr.linkId&&Gi.push(Di),Di.item&&Di.item.length>0){const Jo=mo(Di.item);Gi.push(...Jo)}return Gi},Xo=mo(L0)[zr];return Xo?.item?Xo.item:[]},xn=(zr,mo)=>{if(isHiddenExtensionPresent(zr))return null;const uo=dr(mo);if(!isQuestionEnabledForInstance(zr.enableWhen,zr.enableBehavior,L0||[],qr.linkId,mo))return null;if(zr.repeats){const Jo=findNestedAnswer(uo,zr.linkId),Ui=Vo(yo({},Qn),{item:zr,selectedAnswer:Jo||[{}],errors:getInstanceErrors(H0,qr,mo),handleInputChange:(gi,t0,Ji)=>$i(gi,t0,Ji,mo)});return jsx("div",{children:jsx(a0,Vo(yo({},Ui),{isNestedRepeatedItem:!0}))},zr.linkId)}if(zr.type==="group"&&zr.item&&!getUIToolkitCode(zr?.extension||[]))return jsxs("div",{children:[zr.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:zr.text}),jsx("div",{className:"space-y-3",children:zr.item.map(Jo=>{if(!isQuestionEnabledForInstance(Jo.enableWhen,Jo.enableBehavior,L0||[],qr.linkId,mo))return null;const gi=Go(Jo,W0,Qn.isLoading,Qn.externalComponentRenderMap);if(!gi)return null;const t0=findNestedAnswer(uo,Jo.linkId),Ji=Vo(yo({},Qn),{item:Jo,selectedAnswer:t0,placeholder:getPlaceholderFromExtensions(Jo.extension,Jo.type),errors:getInstanceErrors(H0,qr,mo),handleInputChange:(ja,U0,s0)=>$i(ja,U0,s0,mo)});return createElement(gi,Vo(yo({},Ji),{key:Jo.linkId}))})})]},zr.linkId);const _i=Go(zr,W0,Qn.isLoading,Qn.externalComponentRenderMap);if(!_i)return null;const Gi=findNestedAnswer(uo,zr.linkId),Di=Vo(yo({},Qn),{item:zr,selectedAnswer:Gi,placeholder:getPlaceholderFromExtensions(zr.extension,zr.type),errors:getInstanceErrors(H0,qr,mo),handleInputChange:(Jo,Ui,gi)=>$i(Jo,Ui,gi,mo)});return createElement(_i,Vo(yo({},Di),{key:`${zr.linkId}-${mo}`}))},tr=()=>{const zr=getDirectErrors(H0,d0);return jsxs("div",{className:"flex flex-col gap-2",children:[zr[d0]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:zr[d0]}),!vt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:sn,className:"mt-4 text-center",isDisabled:Qn.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},gn=zr=>Ee.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>$n(zr),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${zr+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:Qn.isLoading}),vr=Go(qr,W0,Qn.isLoading,Qn.externalComponentRenderMap);return hasRepeatingParent(qr,W0)&&!$0?null:!ir||ir&&hasCheckboxExtension(qr)?vr?jsx(vr,Vo(yo({},Qn),{placeholder:Pe,errors:{[qr.linkId]:((Fr=H0?.[qr.linkId])==null?void 0:Fr[0])||""}})):null:qr.type==="group"&&qr.item&&qr.item.length>0&&qr.repeats?jsxs("div",{"data-testid":`${d0}-repeating`,children:[Gt&&jsx(FHIRQuestionnaireQuestionText,{text:Gt,required:Lr||!1}),Ee.map(zr=>{var mo;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${zr>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",zr+1]}),gn(zr)]}),jsx("div",{className:"space-y-4",children:(mo=qr.item)==null?void 0:mo.map(uo=>xn(uo,zr))})]},`${d0}-instance-${zr}`)}),tr()]}):vr?jsxs("div",{"data-testid":`${d0}-repeating`,children:[Ee.map(zr=>{const mo=Hi?.[zr]?[Hi[zr]]:void 0,uo=Vo(yo({},Qn),{item:qr,selectedAnswer:mo,errors:getInstanceErrors(H0,qr,zr),handleInputChange:(Xo,_i,Gi)=>$i(Xo,_i,Gi,zr)});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 ",zr+1]}),gn(zr)]}),jsx(vr,yo({},uo))]},`${d0}-instance-${zr}`)}),jsxs("div",{children:[(()=>{const mo=getDirectErrors(H0,d0)[d0];return mo&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:mo})})(),!vt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:sn,className:"mt-4 text-center",isDisabled:Qn.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var Ki=Object.defineProperty,f0=Object.defineProperties,B0=Object.getOwnPropertyDescriptors,Oa=Object.getOwnPropertySymbols,oa=Object.prototype.hasOwnProperty,pa=Object.prototype.propertyIsEnumerable,Ja=(Qn,Fr,qr)=>Fr in Qn?Ki(Qn,Fr,{enumerable:!0,configurable:!0,writable:!0,value:qr}):Qn[Fr]=qr,is=(Qn,Fr)=>{for(var qr in Fr||(Fr={}))oa.call(Fr,qr)&&Ja(Qn,qr,Fr[qr]);if(Oa)for(var qr of Oa(Fr))pa.call(Fr,qr)&&Ja(Qn,qr,Fr[qr]);return Qn},Fa=(Qn,Fr)=>f0(Qn,B0(Fr));const qs=null,h1=({formId:Qn,questionnaireSchema:Fr,questionnaireResponseItem:qr,errorConfig:Hi,customErrorConfigurations:$i,showQuestionPrefix:Wi=!0,isAdaptiveFlow:H0=!1,status:W0,hideBackButton:L0=!1,showStepper:$0=!1,onComplete:d0,onClearError:K0,handleHiddenQuestion:Aa,onGoBack:Lr,onFormDataChange:ir=()=>{},externalComponentRenderMap:mr,children:Pe})=>{var Ee,$e;const{setHandleContinueButtonClick:vt,setHandleBackButtonClick:Gt,setIsCurrentFormValid:sn,setCurrentGroupLinkId:$n,setCurrentGroupIndex:dr,setTotalSteps:xn,setHideFooterButton:tr,setIsInlineNextQuestionTriggered:gn,isCurrentFormValid:vr,currentGroupIndex:br,isLoading:zr,hasCustomError:mo,groupItemIndicesRef:uo,errorLinkIds:Xo}=useFHIRQuestionnaire(),{trackEvent:_i}=useAnalytics(),{t:Gi}=useUIToolkitTranslations(),[Di,Jo]=useState([]),[Ui,gi]=useState(new Set),[t0,Ji]=useState([]),[ja,U0]=useState([]),s0=uo,Sa=useRef(new Map),ls=useRef(new Set),[k0,w0]=useState({}),[ui,l0]=useState(!1),[Mi,Ga]=useState(Fr),qi=useRef(qr||[]),$a=useRef(!1),$s=useRef(!1),Zs=useMemo(()=>getTotalStepsFromQuestionnaire(Fr),[Fr]),[_1,P1]=useState(!1),J0=useRef([]),el=(No,Ai)=>{var Ko,u0,e0,T0,ma,z0;if(isCallNextQuestionExtensionPresent(No))return No.linkId;const D0=validateCurrentPage(Ai,Di,br,Mi,s0),Is=ba=>{for(const Ys of ba){if((!Ys.enableWhen||isQuestionEnabled(Ys.enableWhen,Ys.enableBehavior,Ai))&&isCallNextQuestionExtensionPresent(Ys))return Ys.linkId;if(Ys.item){const Z1=Is(Ys.item);if(Z1)return Z1}}},As=(ba,Ys)=>{for(const js of ba)if(js.item){const Z1=js.item.findIndex(r1=>r1.linkId===Ys);if(Z1!==-1)return Is(js.item.slice(Z1+1));const f1=As(js.item,Ys);if(f1!==void 0)return f1}},R1=As((Ko=Mi?.item)!=null?Ko:[],No.linkId);if(R1)return R1;const k1=s0.current[br],V1=br+1,bl=s0.current[V1],uu=br===0?0:k1,si=(e0=bl??((u0=Mi?.item)==null?void 0:u0.length))!=null?e0:0;let Un=-1;for(let ba=uu;ba<si;ba++){const Ys=(T0=Mi?.item)==null?void 0:T0[ba];if(Ys?.linkId===No.linkId){Un=ba;break}}const P0=(ba,Ys=[])=>(ba.forEach(js=>{var Z1;if((!js.enableWhen||isQuestionEnabled(js.enableWhen,js.enableBehavior,Ai))&&isCallNextQuestionExtensionPresent(js))if(js.required){const r1=(Z1=findResponseItem(Ai,js.linkId))==null?void 0:Z1.answer;(r1&&r1.length>0&&Object.keys(r1[0]).length>0||js.initial&&js.initial.length>0&&!Ui.has(js.linkId))&&Ys.push(js.linkId)}else Ys.push(js.linkId);js.item&&js.item.length>0&&P0(js.item,Ys)}),Ys),q0=[],Xa=Un!==-1?Un+1:si;for(let ba=uu;ba<Xa;ba++){const Ys=(ma=Mi?.item)==null?void 0:ma[ba];Ys&&P0([Ys],q0)}if(q0.length>0&&D0){const ba=q0[q0.length-1],Ys=r1=>r1.flatMap(Ns=>[Ns,...Ns.item?Ys(Ns.item):[]]),js=Ys((z0=Mi?.item)!=null?z0:[]),Z1=js.findIndex(r1=>r1.linkId===ba),f1=js.findIndex(r1=>r1.linkId===No.linkId);return Z1!==-1&&f1>Z1?void 0:ba}},j1=No=>el(No,qi.current)?!0:No.item&&No.item.length>0?No.item.some(j1):!1,St=()=>{var No,Ai;if(!H0||br<0||!Mi?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const Ko=s0.current[br],u0=Sa.current.get(Ko)||[Ko],e0=(No=Mi.item)==null?void 0:No[u0[u0.length-1]],T0=e0?j1(e0):!1,ma=br<s0.current.length-1;let z0=!1;if(T0&&ma){const D0=br+1,Is=s0.current[D0],As=(Ai=Mi?.item)==null?void 0:Ai[Is],R1=!As?.enableWhen||isQuestionEnabled(As.enableWhen,As.enableBehavior,qi.current),k1=As?isPageExtensionPresent(As):!1;z0=R1&&k1}return{shouldTriggerInlineLoading:T0,canNavigateToNextGroup:z0,hasMoreGroups:ma}},on=(No,Ai,Ko,u0)=>{const e0=getUpdatedFormData(Mi?.item||[],qi.current,No,Ai,Ko,u0);return qi.current=e0,ir(e0),e0},Mt=(No,Ai,Ko,u0,e0)=>{on(Ai,Ko,u0,e0),u0.forEach(T0=>{const ma=getValidationError(Fa(is({},No),{linkId:T0.linkId}),qi.current,T0.answer,Gi);ma&&w0(z0=>Fa(is({},z0),{[T0.linkId]:typeof e0=="number"?Fa(is({},z0[T0.linkId]),{[e0]:ma}):ma}))})},yt=(No,Ai,Ko,u0,e0)=>{var T0;const ma=on(Ai,Ko,u0,e0),z0=(T0=findResponseItem(ma,Ai))==null?void 0:T0.answer,D0=getValidationError(No,qi.current,z0,Gi);w0(Is=>Fa(is({},Is),{[Ai]:typeof e0=="number"?Fa(is({},Is[Ai]),{[e0]:D0}):D0}))},an=(No,Ai)=>{const Ko=validateCurrentPage(Ai,Di,br,Mi,s0);if(sn(Ko),Mi?.item){const u0=validateAllItemsRecursively(Mi.item,Ai,Gi);if(Object.keys(u0).length>0)w0(e0=>is(is({},e0),u0));else{const e0=Mi.item,T0={},ma=z0=>{z0.forEach(D0=>{T0[D0.linkId]={},D0.item&&ma(D0.item)})};ma(e0),w0(z0=>is(is({},z0),T0))}}},en=(No,Ai,Ko,u0,e0=!1)=>{var T0;const{linkId:ma}=No;if(e0)return qi.current=Ko||[],an(ma,Ko||[]),qi.current;if(Ko&&Ko.length>0&&No.type==="group"&&No.repeats){let As=qi.current.length;for(let k1=qi.current.length-1;k1>=0;k1--)if(qi.current[k1].linkId===ma){As=k1+1;break}const R1=[...qi.current.slice(0,As),...Ko,...qi.current.slice(As)];return qi.current=R1,an(ma,R1),qi.current}if(typeof u0=="number"&&Ai){const As=hasRepeatingParent(No,Mi?.item||[]);if(As){const R1=qi.current.filter(V1=>V1.linkId===As.linkId);if(u0<R1.length){const V1=qi.current.map(bl=>{if(bl.linkId===As.linkId&&qi.current.slice(0,qi.current.indexOf(bl)).filter(si=>si.linkId===As.linkId).length===u0){const si=(q0,Xa)=>{const ba=new Map(q0.map(js=>[js.linkId,js])),Ys=[];return Xa?.forEach(js=>{const Z1=ba.get(js.linkId);if(js.linkId===ma)Ys.push(is({linkId:js.linkId,text:js.text,answer:Ai},Z1?.item&&{item:Z1.item}));else if(Z1)if(js.item&&js.item.length>0){const f1=si(Z1.item||[],js.item);Ys.push(Fa(is({},Z1),{item:f1}))}else Ys.push(Z1);else if(js.item&&js.item.length>0){const f1=si([],js.item);f1.some(Ns=>Ns.linkId===ma||Ns.item&&Un(Ns.item,ma))&&Ys.push({linkId:js.linkId,text:js.text,answer:[{}],item:f1})}ba.delete(js.linkId)}),ba.forEach(js=>{Ys.push(js)}),Ys},Un=(q0,Xa)=>q0.some(ba=>ba.linkId===Xa||ba.item&&Un(ba.item,Xa)),P0=si(bl.item||[],As.item);return Fa(is({},bl),{item:P0})}return bl});qi.current=V1,ir(V1)}else{const V1=u0+1,bl=R1.length;if(bl<V1||V1===1){const uu=[],si=(q0,Xa,ba)=>q0.map(Ys=>{const js={linkId:Ys.linkId,text:Ys.text,answer:Ys.linkId===Xa?ba:[{}]};return Ys.item&&Ys.item.length>0&&(js.item=si(Ys.item,Xa,ba)),js});for(let q0=bl;q0<V1;q0++){const Xa=As.item?si(As.item,ma,Ai):[],ba={linkId:As.linkId,text:As.text,answer:[{}],item:Xa};uu.push(ba)}let Un=qi.current.length;for(let q0=qi.current.length-1;q0>=0;q0--)if(qi.current[q0].linkId===As.linkId){Un=q0+1;break}const P0=[...qi.current.slice(0,Un),...uu,...qi.current.slice(Un)];qi.current=P0,ir(P0)}}const k1=getValidationError(No,qi.current,Ai,Gi);return w0(V1=>Fa(is({},V1),{[ma]:typeof u0=="number"?Fa(is({},V1[ma]),{[u0]:k1}):k1})),an(ma,qi.current),qi.current}}if(typeof u0=="number")return Ko&&Ko.length>0?Mt(No,ma,Ai,Ko,u0):yt(No,ma,Ai,Ko,u0),qi.current;const z0=on(ma,Ai,Ko),D0=(T0=findResponseItem(z0,ma))==null?void 0:T0.answer,Is=getValidationError(No,z0,D0,Gi);return w0(As=>Fa(is({},As),{[ma]:typeof u0=="number"?Fa(is({},As[ma]),{[u0]:Is}):Is})),an(ma,z0),qi.current},wn=()=>{var No;for(let Ai=br+1;Ai<s0.current.length;Ai++){const Ko=s0.current[Ai],u0=(No=Mi?.item)==null?void 0:No[Ko];if(!!u0&&(!u0.enableWhen||isQuestionEnabled(u0.enableWhen,u0.enableBehavior,qi.current)))return!0}return!1},_r=()=>{var No,Ai,Ko,u0,e0;const T0=(No=Fr?.item)==null?void 0:No[s0.current[br]];if(T0){const D0=(Ai=getAnalyticsEventName(T0))!=null?Ai:"questionnaire_form",Is=getAnalyticsPageName(T0);if(Is){const As=(Ko=getAnalyticsFormName(Fr))!=null?Ko:Fr.name,R1=collectAnalyticsProperties(T0,qi.current),k1={};As&&(k1.form_name=As),k1.page_name=Is,Object.assign(k1,R1),_i(D0,k1)}}const ma=br<s0.current.length-1,z0=checkCurrentStepDataMatch(qi.current,Mi,s0.current,br,qr,s0.current.length-1);if(H0&&ma){const D0=br+1,Is=s0.current[D0],As=(u0=Mi?.item)==null?void 0:u0[Is],R1=!As?.enableWhen||isQuestionEnabled(As.enableWhen,As.enableBehavior,qi.current),k1=As?isPageExtensionPresent(As):!1;if(R1&&k1&&z0){dr(D0),sn(!1),window.scrollTo(0,0);return}}if(z0&&s0.current.length>0){wn()?dr(br+1):(d0(removeDisabledItems(qi.current,Mi?.item||[])),sn(!1),window.scrollTo(0,0));return}if(br<s0.current.length-1){const D0=(e0=Mi?.item)==null?void 0:e0[s0.current[br]];if(!D0){d0(removeDisabledItems(qi.current,Mi?.item||[]));return}const Is=D0.linkId,As=findLastGroupInstanceIndex(qi.current,Is),R1=qi.current.slice(0,As+1);if(!validateCurrentPage(R1,Di,br,Mi,s0))return;H0?(qi.current=R1,ir(R1),d0(qi.current),sn(!1)):s0.current.length>0&&(wn()?dr(br+1):(d0(removeDisabledItems(qi.current,Mi?.item||[])),window.scrollTo(0,0)))}else d0(removeDisabledItems(qi.current,Mi?.item||[])),sn(!1),window.scrollTo(0,0)};useEffect(()=>{var No;vt(()=>_r),Gt(()=>xo),sn(vr);const Ai=(No=Mi?.item)==null?void 0:No[s0.current[br]];Ai&&$n(Ai.linkId)},[vr,br]),useEffect(()=>{if(!Fr?.item)return;const{groupIndices:No,itemsToRenderMap:Ai}=collectGroupItemIndices(Fr.item);s0.current=No,Sa.current=Ai;const Ko=Zs??No.length;xn(Ko),Ji(No),H0?($s.current||dr(No.length>0?No.length-1:0),gn(!1),$s.current=!1):br===-1&&dr(0)},[Fr?.item,Zs]),useEffect(()=>{if(br<0||!Mi?.item)return;const No=validateCurrentPage(qi.current,Di,br,Mi,s0);if(!No){sn(!1);return}const{shouldTriggerInlineLoading:Ai,canNavigateToNextGroup:Ko,hasMoreGroups:u0}=St();if(H0&&Ai){if(!u0){sn(!1);return}if(Ko&&No){sn(!0);return}else{sn(!1);return}}sn(No)},[br,Mi?.item,mo,H0,qi.current,Di]),useEffect(()=>{if(!Fr?.item||$a.current)return;const No=initializeQuestionnaireItems(Fr.item,qi.current,Fr.item,qi.current);if(No!==qi.current){qi.current=No;const Ko=(e0=>{const T0=new Set,ma=z0=>{z0.forEach(D0=>{var Is;const As=D0.initial&&D0.initial.length>0,R1=(D0.type==="choice"||D0.type==="open-choice")&&((Is=D0.answerOption)==null?void 0:Is.some(k1=>k1.initialSelected===!0));(As||R1)&&(!D0.enableWhen||isQuestionEnabled(D0.enableWhen,D0.enableBehavior,qi.current))&&T0.add(D0.linkId),D0.item&&ma(D0.item)})};return ma(e0),T0})(Mi?.item||[]);gi(Ko);const u0=validateAllItemsRecursively(Mi?.item||[],qi.current,Gi);Object.keys(u0).length>0&&w0(e0=>is(is({},e0),u0))}$a.current=!0},[Mi?.item,Fr,Gi]),useEffect(()=>{Ga(Fr)},[Fr]),useEffect(()=>{if(Xo.size===0)return;const No=z0=>!z0.enableWhen||isQuestionEnabled(z0.enableWhen,z0.enableBehavior,qi.current)?Xo.has(z0.linkId)?!0:(z0.item||[]).some(No):!1,Ai=z0=>z0.flatMap(D0=>[D0.linkId,...Ai(D0.item||[])]),Ko=z0=>{const D0=z0.findIndex(No);return D0===-1?z0.flatMap(Is=>Ko(Is.item||[])):z0.slice(D0+1).flatMap(Is=>[Is.linkId,...Ai(Is.item||[])])};if(!Mi?.item)return;const u0=Ko(Mi.item);if(u0.length===0)return;Ga(z0=>z0?.item?Fa(is({},z0),{item:removeItemsFromSchema(z0.item,u0)}):z0);const e0=z0=>z0.flatMap(D0=>[D0,...D0.item?e0(D0.item):[]]),T0=Mi.item,ma=T0.findIndex(z0=>e0([z0]).some(D0=>Xo.has(D0.linkId)&&(!D0.enableWhen||isQuestionEnabled(D0.enableWhen,D0.enableBehavior,qi.current))));if(ma!==-1){const z0=new Set(e0(T0.slice(ma)).map(D0=>D0.linkId));J0.current=J0.current.filter(D0=>!z0.has(D0))}gi(z0=>{const D0=new Set(z0);return u0.forEach(Is=>D0.delete(Is)),D0})},[Xo]),useEffect(()=>{br>=0&&window.scrollTo(0,0)},[br]),useEffect(()=>{var No;if(!H0||Di.length===0||zr||Xo.size>0||!Mi?.item)return;const Ai=s0.current[br];if(Ai===void 0)return;const Ko=Sa.current.get(Ai)||[Ai],u0=[];if(Ko.forEach(D0=>{var Is;const As=(Is=Mi?.item)==null?void 0:Is[D0];As&&hasInitialValue(As)&&u0.push(As)}),u0.length===0||!u0.some(D0=>el(D0,qi.current)&&!J0.current.includes(D0.linkId)?(J0.current.push(D0.linkId),!0):!1))return;const T0=validateCurrentPage(qi.current,Di,br,Mi,s0),ma=(No=Mi?.item)==null?void 0:No[Ai],z0=isHiddenAnswerInValid(ma,qi.current);!T0||z0||(ls.current.add(br),gn(!0),$s.current=!0,Nr(u0[u0.length-1].linkId))},[br,Di,H0,zr,Mi]);const Nr=(No,Ai=!1,Ko=!1)=>{var u0,e0,T0;if(Ai){d0(removeDisabledItems(qi.current,Mi?.item||[]),Ko),sn(!1);return}const ma=findQuestionByLinkId(Mi?.item||[],No);if(!ma)return;const z0=(u0=findResponseItem(qi.current,No))==null?void 0:u0.answer;if(getValidationError(ma,qi.current,z0,Gi))return;const D0=getUpdatedFormData(Mi?.item||[],qi.current,No,z0),Is=el(ma,D0);if(!Is)return;const As=(e0=findResponseItem(qr||[],No))==null?void 0:e0.answer,R1=r1=>JSON.stringify(r1,(Ns,T1)=>T1??void 0);if(R1(z0)===R1(As)||No!==Is&&J0.current.includes(Is))return;sn(!1);const k1=findRootGroupLinkId(Mi?.item||[],No);let V1=D0,bl=[];const uu=deepTrimFormData(D0,Is,Mi?.item||[]);V1=uu.trimmedData,bl=uu.trimmedLinkIds;const si=findQuestionByLinkId(Mi?.item||[],k1||"");qi.current=V1;const Un=findGroupPositionByLinkId(Mi?.item||[],No||""),P0=Un!==-1?Un:br;let q0;const Xa=(()=>{var r1;const Ns=(r1=Mi?.item)!=null?r1:[],T1=(b1,au)=>b1.some(Vu=>Vu.linkId===au||(Vu.item?T1(Vu.item,au):!1)),rl=Ns.findIndex(b1=>b1.linkId===Is||(b1.item?T1(b1.item,Is):!1));if(rl===-1)return[];const H1=b1=>b1.flatMap(au=>[au.linkId,...au.item?H1(au.item):[]]),Ll=b1=>b1.flatMap(au=>[au,...au.item?Ll(au.item):[]]),Yl=Ll(Ns),bu=Yl.findIndex(b1=>b1.linkId===Is),G1=new Set;let uc=!0;for(;uc;){uc=!1;for(const b1 of Yl){if(G1.has(b1.linkId)||!b1.enableWhen)continue;b1.enableWhen.some(Vu=>{const Jc=Yl.findIndex(bc=>bc.linkId===Vu.question);return Jc!==-1&&Jc<=bu||G1.has(Vu.question)})&&(G1.add(b1.linkId),uc=!0)}}const cc=J0.current.includes(Is)?(()=>{const b1=new Set(H1([Ns[rl]]));return Yl.slice(bu+1).filter(au=>b1.has(au.linkId)&&!G1.has(au.linkId)&&!isHiddenExtensionPresent(au)).map(au=>au.linkId)})():[],nc=Ll(Ns.slice(rl+1)).filter(b1=>!G1.has(b1.linkId)&&!isHiddenExtensionPresent(b1)).map(b1=>b1.linkId);return[...cc,...nc]})();if(Xa.length>0){q0=removeItemsFromSchema(Mi?.item||[],Xa),Ga(Fa(is({},Mi),{item:q0}));const r1=new Set(Xa);J0.current=J0.current.filter(Ns=>!r1.has(Ns))}const ba=[...bl,...Xa],Ys=validateCurrentPage(V1,Di,P0,Mi,s0,ba),js=findQuestionByLinkId(Mi?.item||[],Is),Z1=(T0=findResponseItem(V1,Is))==null?void 0:T0.answer,f1=!js?.required||Z1!==void 0&&Z1.length>0&&Object.keys(Z1[0]).length>0;if(Ys&&f1&&!isHiddenAnswerInValid(si,V1)){gn(!0),$s.current=!0;const Ns=((T1,rl)=>{const H1=[];let Ll=!1;const Yl=bu=>{for(const G1 of bu)Ll?(H1.push(G1.linkId),G1.item&&Yl(G1.item)):G1.linkId===rl?Ll=!0:G1.item&&Yl(G1.item)};return Yl(T1),H1})(Mi?.item||[],Is);Ns.length>0&&(J0.current=J0.current.filter(T1=>!Ns.includes(T1)),gi(T1=>{const rl=new Set(T1);return Ns.forEach(H1=>rl.delete(H1)),rl})),J0.current.push(Is),d0(removeDisabledItems(V1,Mi?.item||[]),!0,q0||Mi.item)}},bt=(No,Ai,Ko=!1)=>{const u0=updateItemWithReadOnlyExpression(No,Mi),e0={item:u0,selectedAnswer:Ai,handleInputChange:en,showQuestionPrefix:Wi,onCompleteHandler:Nr,errors:k0,isLoading:zr,isCurrentFormValid:vr,contained:Mi?.contained,questionnaireSchemaItems:Mi?.item,customErrorConfigurations:$i,formData:qi.current,showStepper:$0,totalStepsFromExtension:Zs,externalComponentRenderMap:mr,hintText:getHintTextFromExtensions(u0.extension)};if(typeof Aa=="function"&&Ko)Aa(No,e0,qi.current);else if(No.type in typeToRenderFunctionMap&&!Ko)return Di.includes(No.linkId)||Jo(T0=>[...T0,No.linkId]),jsx(RenderFHIRQuestionnaireItem,is({},e0),No.linkId);return null},Ao=No=>{const Ai=e0=>!e0.enableWhen||isQuestionEnabled(e0.enableWhen,e0.enableBehavior,qi.current)?Xo.has(e0.linkId)?!0:(e0.item||[]).some(Ai):!1,Ko=No.findIndex(Ai),u0=Ko!==-1?No.slice(0,Ko+1):No;return Ko!==-1&&No.slice(Ko+1).forEach(e0=>{qi.current.some(ma=>ma.linkId===e0.linkId)&&(qi.current=removeAnswerFromFormData(qi.current,e0.linkId))}),u0.map(e0=>{var T0,ma;const z0=isHiddenExtensionPresent(e0);let D0=(T0=findResponseItem(qi.current,e0.linkId))==null?void 0:T0.answer;if((!D0||Object.keys((ma=D0?.[0])!=null?ma:{}).length===0)&&!Ui.has(e0.linkId)){if(e0.initial&&e0.initial.length>0)D0=e0.initial,gi(Is=>new Set(Is).add(e0.linkId));else if((e0.type==="choice"||e0.type==="open-choice")&&e0.answerOption){const Is=e0.answerOption.filter(As=>As.initialSelected===!0);Is.length>0&&(D0=Is.map(As=>{let R1={};return As.valueCoding?R1={valueCoding:{code:As.valueCoding.code,display:As.valueCoding.display,system:As.valueCoding.system}}:As.valueReference&&(R1={valueReference:{reference:As.valueReference.reference,display:As.valueReference.display}}),R1}).filter(As=>Object.keys(As).length>0),gi(As=>new Set(As).add(e0.linkId)))}D0&&(qi.current=getUpdatedFormData(Mi?.item||[],qi.current,e0.linkId,D0))}if(!e0?.enableWhen||isQuestionEnabled(e0?.enableWhen,e0.enableBehavior,qi.current)){const Is=qs.includes(e0.linkId)||getUIToolkitCode(e0.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[bt(e0,D0,z0),e0.item&&!z0&&(Is?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:Ao(e0.item)})}):Ao(e0.item))]},e0.linkId)}else if(e0.type==="group"&&!z0)return ja.includes(e0.linkId)||(Zs===void 0&&xn(s0.current.length-1||-1),s0.current=s0.current.filter((Is,As)=>As!==br),U0(Is=>[...Is,e0.linkId])),null})};if(br>=0){const No=[];let Ai=0,Ko=0;for(;Ai<t0.length&&Ko<s0.current.length;){const u0=t0[Ai],e0=s0.current[Ko];if(u0<e0){const T0=(Ee=Mi?.item)==null?void 0:Ee[u0];(!T0?.enableWhen||isQuestionEnabled(T0.enableWhen,T0.enableBehavior,qi.current))&&No.push(Ai),Ai++}else u0===e0&&Ai++,Ko++}for(;Ai<t0.length;){const u0=t0[Ai],e0=($e=Mi?.item)==null?void 0:$e[u0];(!e0?.enableWhen||isQuestionEnabled(e0.enableWhen,e0.enableBehavior,qi.current))&&No.push(Ai),Ai++}if(No.length>0){Zs===void 0&&xn(s0.current.length+No.length),No.reverse().forEach(e0=>{const T0=t0[e0];let ma=0;for(let z0=0;z0<s0.current.length;z0++){if(s0.current[z0]>T0){ma=z0;break}ma=z0+1}s0.current.splice(ma,0,T0)});const u0=No.map(e0=>{var T0;const ma=t0[e0],z0=(T0=Mi?.item)==null?void 0:T0[ma];return z0?.linkId}).filter(Boolean);U0(e0=>e0.filter(T0=>!u0.includes(T0)))}t0.forEach(u0=>{var e0;const T0=(e0=Mi?.item)==null?void 0:e0[u0];T0?.enableWhen&&!isQuestionEnabled(T0.enableWhen,T0.enableBehavior,qi.current)&&qi.current.some(z0=>z0.linkId===T0.linkId)&&(qi.current=removeAnswerFromFormData(qi.current,T0.linkId))})}const xo=()=>{var No;if(Hi&&!ui&&br>0&&W0!=="completed")dr(s0.current.length-1),l0(!0),tr(!1),K0?.();else if(br>0&&W0!=="completed"){let Ai=br-1;for(;Ai>0;){const Ko=s0.current[Ai],u0=(No=Mi?.item)==null?void 0:No[Ko];if(!u0?.enableWhen||isQuestionEnabled(u0.enableWhen,u0.enableBehavior,qi.current))break;Ai--}dr(Ai),sn(!0),tr(!1),K0?.()}else Lr?.()},ki=No=>No.preventDefault();return useEffect(()=>{const No=setTimeout(()=>{P1(!0)},0);return()=>clearTimeout(No)},[]),_1?jsxs(Fragment,{children:[jsxs("form",{id:Qn,className:"w-full","data-testid":"questionnaire-form",onSubmit:ki,children:[!L0&&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:()=>xo(),onKeyDown:No=>{(No.key==="Enter"||No.key===" ")&&xo()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Hi&&!ui?jsx(EmptyState,{className:"mt-5xl",title:Hi.title,description:Hi.description,featuredIconProps:{icon:Hi.icon,color:"gray"},primaryButton:Hi.primaryButton,secondaryButton:Hi.secondaryButton?Fa(is({},Hi.secondaryButton),{onClick:xo}):void 0}):jsxs(Fragment,{children:[!Mi?.item&&zr&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),Mi?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:Ao(br>=0?Mi.item.filter((No,Ai)=>{const Ko=s0.current[br];return(Sa.current.get(Ko)||[Ko]).includes(Ai)}):Mi?.item||[])})]})]}),$a.current&&Pe]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Y,l,e)=>{"use strict";e.d(l,{l:()=>M});var n=e(31085),t=e(14041),r=e(36087),s=e(1053),o=e(25624),a=e(18522),i=Object.defineProperty,b=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,p=(h,f,v)=>f in h?i(h,f,{enumerable:!0,configurable:!0,writable:!0,value:v}):h[f]=v,d=(h,f)=>{for(var v in f||(f={}))y.call(f,v)&&p(h,v,f[v]);if(u)for(var v of u(f))m.call(f,v)&&p(h,v,f[v]);return h},O=(h,f)=>b(h,c(f));const g=({selected:h,onClick:f,icon:v,title:A,description:z,readOnly:x})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",h?"bg-utility-accent-500/20":"bg-gray-100",h?"text-accent-800":"text-quaternary"),children:v}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:A})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:z})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",x?"cursor-not-allowed":"cursor-pointer",x?"border-gray-200 bg-white":h?"border-blue-700 bg-white":"border-gray-100 bg-white",!x&&!h&&"hover:border-gray-400");return x?(0,n.jsx)("div",{className:S,children:T}):(0,n.jsx)("button",{type:"button",onClick:f,className:S,"aria-pressed":!!h,children:T})},M=({item:h,handleInputChange:f,formData:v,isLoading:A})=>{const{incrementCustomErrorCount:z,decrementCustomErrorCount:x}=(0,a.c)(),T=(0,t.useMemo)(()=>{var N;return(N=h.item)!=null?N:[]},[h.item]),S=h.readOnly===!0,C=(0,t.useMemo)(()=>T.filter(N=>!N.enableWhen||(0,o.GN)(N.enableWhen,N.enableBehavior,v??[])),[T,v]),E=(0,t.useMemo)(()=>T.filter(N=>N.enableWhen&&!(0,o.GN)(N.enableWhen,N.enableBehavior,v??[])),[T,v]),R=N=>{var w,V;if(!v)return!1;const k=(0,o.MU)(v,N);return((V=(w=k?.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)===!0},P=(0,t.useMemo)(()=>C.some(N=>R(N.linkId)),[C,v]),L=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||C.length===0){L.current&&(x(),L.current=!1);return}!P&&!L.current?(z(),L.current=!0):P&&L.current&&(x(),L.current=!1)},[P,S,C.length,z,x]),(0,t.useEffect)(()=>{E.forEach(N=>{var w,V;const k=v?(0,o.MU)(v,N.linkId):void 0;(!k||((V=(w=k.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)!==!1)&&f(N,[{valueBoolean:!1}])})},[E]),(0,t.useEffect)(()=>()=>{L.current&&x()},[]);const D=N=>{const w=R(N.linkId);f(N,[{valueBoolean:!w}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},A?{inert:""}:{}),{children:C.map(N=>{var w,V,k,I;const q=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(ae=>ae.url===s.g4),$=(V=N.extension)==null?void 0:V.find(ae=>ae.url===s.rz),X=U?.valueString?s.JP[U.valueString]:void 0,G=(k=$?.valueString)!=null?k:"";return(0,n.jsx)(g,{icon:X?(0,n.jsx)(X,{className:"h-6 w-6"}):void 0,title:(I=N.text)!=null?I:"",description:G,selected:q,readOnly:S,onClick:S?void 0:()=>D(N)},N.linkId)})}))}},72866:(Y,l,e)=>{"use strict";e.d(l,{v:()=>a});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const o=({selected:i,onClick:b,label:c,readOnly:u})=>{const y=(0,r.cx)("rounded-sm border-2 px-3 py-2 text-sm font-medium transition-colors",u?"cursor-default":"cursor-pointer",i?"border-brand bg-brand-50 text-primary":"border-secondary bg-primary text-secondary",!u&&!i&&"hover:border-tertiary");return u?(0,n.jsx)("div",{className:y,children:c}):(0,n.jsx)("button",{type:"button",onClick:b,className:y,"aria-pressed":!!i,children:c})},a=({item:i,handleInputChange:b,formData:c})=>{var u;const y=(u=i.item)!=null?u:[],m=i.readOnly===!0,p=O=>{var g,M;if(!c)return!1;const h=(0,s.MU)(c,O);return((M=(g=h?.answer)==null?void 0:g[0])==null?void 0:M.valueBoolean)===!0},d=O=>{const g=p(O.linkId);b(O,[{valueBoolean:!g}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[i.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(i.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:y.map(O=>{var g;const M=p(O.linkId);return(0,n.jsx)(o,{label:(g=O.text)!=null?g:"",selected:M,readOnly:m,onClick:m?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 a,i,b,c;const u=o.text||"",y=(i=(a=o.extension)==null?void 0:a.find(d=>d.url===r.rz))==null?void 0:i.valueString,m=(c=(b=o.extension)==null?void 0:b.find(d=>d.url===r.g4))==null?void 0:c.valueString,p=m?r.JP[m]: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:[p&&(0,n.jsx)(t.FeaturedIcon,{icon:p,color:"brand",size:"lg",className:"text-accent-600 size-14"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-primary text-lg font-semibold",children:u}),y&&(0,n.jsx)("p",{className:"text-secondary text-sm",children:y})]})]})}},18522:(Y,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),o=Object.defineProperty,a=Object.defineProperties,i=Object.getOwnPropertyDescriptors,b=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(M,h,f)=>h in M?o(M,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):M[h]=f,m=(M,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(M,f,h[f]);if(b)for(var f of b(h))u.call(h,f)&&y(M,f,h[f]);return M},p=(M,h)=>a(M,i(h));const d=(0,t.createContext)(void 0),O=()=>{const M=(0,t.useContext)(d);if(!M)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return M},g=({children:M,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[v,A]=useState(null),[z,x]=useState(null),[T,S]=useState(!1),[C,E]=useState(null),[R,P]=useState(-1),[L,D]=useState(!1),[N,w]=useState(-1),[V,k]=useState(!1),[I,q]=useState(0),[U,$]=useState(!1),[X,G]=useState(!1),ae=useRef([]),[re,J]=useState(new Set),ce=useCallback(fe=>{J(le=>{const ne=new Set(le);return ne.add(fe),ne})},[]),ge=useCallback(fe=>{J(le=>{const ne=new Set(le);return ne.delete(fe),ne})},[]),Ae=useCallback(()=>{q(fe=>fe+1)},[]),be=useCallback(fe=>{$(fe)},[]),oe=useCallback(()=>{q(fe=>Math.max(0,fe-1))},[]),ue=I>0,me=useCallback((fe,le,ne)=>{if(!h)return;const te=h[fe];if(!te)return;let ve;if(Array.isArray(te))if(ne)ve=te.find(Se=>Se.inputType===ne);else{console.warn(`Multiple analytics configs found for linkId "${fe}" but no inputType provided. Skipping tracking.`);return}else{if(ne&&te.inputType&&te.inputType!==ne)return;ve=te}if(!ve)return;let xe=m({},le);ve.valueTransform&&(xe=Object.keys(le).reduce((Se,We)=>{var ot;const ht=(ot=ve.valueTransform)==null?void 0:ot[We];return Se[We]=ht?applyValueTransform(le[We],ht):le[We],Se},{}));let we=m({},xe);ve.propertyMapping&&(we=Object.keys(xe).reduce((Se,We)=>{var ot;const ht=((ot=ve.propertyMapping)==null?void 0:ot[We])||We;return Se[ht]=xe[We],Se},{}));const ze=ve.eventName,De=ve.description;f(ze,p(m(m({},we),ve.properties),{_event_metadata:De?{description:De}:void 0}))},[h,f]),de={isCurrentFormValid:T,currentGroupLinkId:C,currentGroupIndex:R,hideFooterButton:L,totalSteps:N,isLoading:V,isInlineNextQuestionTriggered:X,hasCustomError:ue,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:v,handleBackButtonClick:z,setHandleContinueButtonClick:A,setHandleBackButtonClick:x,setIsCurrentFormValid:S,setCurrentGroupLinkId:E,setCurrentGroupIndex:P,setHideFooterButton:D,setTotalSteps:w,setIsLoading:k,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:Ae,decrementCustomErrorCount:oe,errorLinkIds:re,addErrorLinkId:ce,removeErrorLinkId:ge,trackQuestionnaireEvent:me,setHasExternalError:be,groupItemIndicesRef:ae};return jsx(d.Provider,{value:de,children:M})}},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),a=e(1053),i=e(7630),b=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:a,title:i,infoDetails:b})=>(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:i}),o&&a&&(0,n.jsx)(t.Button,{color:"link-color",onClick:a,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:b})]})},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:a,className:i})=>{const{redirectToBook:b,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(d,O,g)=>{d.preventDefault(),O.linkType==="phone"?b(g):O.linkType==="address"?c({address:g}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},m=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},p=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:g=>y(g,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:m(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:m(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",i),children:a.map((d,O)=>{const g=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(g,{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 M=Array.isArray(d.value)?d.value:[d.value];return M.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:M.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:p(h,d)},f))}):p(M[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:()=>A});var n=e(31085),t=e(14041);const r=({size:z=24,color:x="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:z,height:z,stroke:x,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),a=e(92094),i=e(5380),b=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,m=Object.defineProperties,p=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,g=Object.prototype.propertyIsEnumerable,M=(z,x,T)=>x in z?y(z,x,{enumerable:!0,configurable:!0,writable:!0,value:T}):z[x]=T,h=(z,x)=>{for(var T in x||(x={}))O.call(x,T)&&M(z,T,x[T]);if(d)for(var T of d(x))g.call(x,T)&&M(z,T,x[T]);return z},f=(z,x)=>m(z,p(x)),v=(z,x,T)=>new Promise((S,C)=>{var E=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(E,R);P((T=T.apply(z,x)).next())});const A=({setLocationUpdating:z,title:x,description:T,isOpen:S,onClose:C})=>{const{locationPermission:E,position:R,requestPosition:P,setLocationPermission:L}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:N,setQueryParams:w}=(0,b.i)(),[V,k]=(0,t.useState)(!1),I=(0,c.s)(i.so.LAST_LOCATION_PROMPT),q=S!==void 0?S:V;(0,t.useEffect)(()=>{(q||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,q,D]);const U=(0,t.useCallback)(ge=>{w(f(h({},N),{location:ge,locationType:i.iF.CURRENT_LOCATION,locationPermission:E||""}))},[E,N,w]),$=(0,t.useCallback)(()=>{S===void 0&&(!E||[i.Ef.GRANTED].includes(E)&&I.get()||[i.Ef.PROMPT].includes(E)&&I.get()&&R||k([i.Ef.PROMPT,i.Ef.GRANTED].includes(E)))},[S,E,I,R]);(0,t.useEffect)(()=>{$()},[$]);const X=(0,o.Ul)(),G=(0,t.useCallback)(()=>v(void 0,null,function*(){z&&z(!0);let ge;try{ge=yield P(),ge&&U&&U(`${ge.coords.latitude},${ge.coords.longitude}`)}catch(Ae){Ae instanceof Error?X?.error(Ae,"Error requesting location"):X?.error(`Error requesting location - ${JSON.stringify(Ae)}`),S!==void 0&&C?C():k(!1)}return z&&z(!1),!!ge}),[X,U,P,z,S,C]),ae=(0,t.useCallback)(()=>v(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&C?C():k(!1),I.set(new Date().toISOString()),yield G()}),[D,S,C,I,G]),re=(0,t.useCallback)(ge=>{D("location_permissions_cta_clicked",{click:ge==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),L(i.Ef.DENIED),w(f(h({},N),{locationPermission:i.Ef.DENIED})),I.remove(),S!==void 0&&C?C():k(!1)},[D,L,w,N,I,S,C]),J=(0,t.useCallback)(()=>re("close"),[re]),ce=(0,t.useCallback)(()=>re("cancel"),[re]);return(0,n.jsx)(a.Modal,{id:"location-modal",isOpen:q,className:"sm:max-w-md",title:{content:x,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:J},primaryButton:{children:"Use my current location",onClick:ae},secondaryButton:{children:"Search another way",onClick:ce}})}},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,a=Object.prototype.propertyIsEnumerable,i=(y,m,p)=>m in y?r(y,m,{enumerable:!0,configurable:!0,writable:!0,value:p}):y[m]=p,b=(y,m)=>{for(var p in m||(m={}))o.call(m,p)&&i(y,p,m[p]);if(s)for(var p of s(m))a.call(m,p)&&i(y,p,m[p]);return y};const c=y=>{if(!y||typeof y!="object")throw new Error("Invalid animation data");const m=p=>{if(!p||typeof p!="object")return p;if(Array.isArray(p))return p.map(m);const d=b({},p);delete d.ef,delete d.expr,typeof d.x=="string"&&delete d.x;for(const O in d)typeof d[O]=="object"&&(d[O]=m(d[O]));return d};return m(y)},u=({animationData:y,loop:m=!0,autoplay:p=!0,className:d=""})=>{const O=useRef(null),g=useRef(null);return useEffect(()=>{if(!!O.current){try{const M=c(y);g.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:m,autoplay:p,animationData:M})}catch(M){console.error("Failed to load Lottie animation:",M)}return()=>{var M;(M=g.current)==null||M.destroy()}}},[y,m,p]),jsx("div",{ref:O,className:d})}},81304:(Y,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const o=y=>y*1609.34;var a=e(27419);const i={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var b=e(92469);const c=({center:y,isLoading:m=!1,searchRadius:p,className:d,height:O="350px",width:g="100%",googleMapsApiKey:M,ariaLabel:h})=>{const f=(0,s.Bd)(),{isLoaded:v}=(0,r.KD)({googleMapsApiKey:M||""}),A={height:typeof O=="number"?`${O}px`:O,width:typeof g=="number"?`${g}px`:g},z=(0,t.useCallback)(T=>{google.maps.event.addListenerOnce(T,"idle",()=>{if(p&&y.lat&&y.lng){const C=new google.maps.Circle({center:{lat:y.lat,lng:y.lng},radius:o(p)}).getBounds();C&&T.fitBounds(C,0)}if(h){const C=T.getDiv().querySelector('[role="region"][aria-label="Map"]');C&&C.setAttribute("aria-label",h)}})},[y,p,h]);if(!v||m)return(0,n.jsx)("div",{className:(0,a.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:A,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:f("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,a.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:A,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:f("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:i.gray50}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:i.gray100}]},{featureType:"water",elementType:"geometry",stylers:[{color:i.blue100}]}]};return(0,n.jsx)("div",{className:(0,a.cx)("focus-within:ring-focus-ring overflow-hidden rounded-lg focus-within:ring-2 focus-within:ring-offset-2 [&_iframe]:outline-none",d),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:A,onLoad:z,options:x,zoom:12,children:(0,n.jsx)(b.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Y,l,e)=>{"use strict";e.d(l,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(92469)},92469:(Y,l,e)=>{"use strict";e.d(l,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:s})=>typeof s?.lat=="number"&&typeof s?.lng=="number"&&!isNaN(s.lat)&&!isNaN(s.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:s.lat,lng:s.lng}}):null},43743:(Y,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:a,profileUrl:i,subTitle:b,variant:c="default",showChevron:u=!0,onClick:y,pendingText:m})=>{const p=!!m,d=!p&&!!y,O=u&&d;return jsxs("button",{type:"button",onClick:d?y:void 0,disabled:!d,className:cx("bg-primary border-primary flex w-full items-center justify-between gap-3 rounded-lg border p-4 text-left",c==="compact"&&"rounded-xl p-3",!O&&"justify-start",d?"cursor-pointer":"cursor-default",p&&"opacity-60"),children:[jsx(Avatar,{src:i,alt:a,size:"md",initials:getInitials(a),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:a}),p?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),m]}):jsx("span",{className:"text-secondary text-sm",children:b})]}),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:a=!1,header:i,title:b})=>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:[a?i:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:i}),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:b}),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:a})=>{var i;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:a.icon,color:(i=a.color)!=null?i:"brand",size:"lg",className:a.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:()=>nt});var n=e(31085),t=e(36087),r=e(14041);const s=({size:et=24,color:Zt="currentColor",...Tn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:et,height:et,stroke:Zt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Tn},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),a=e(14711),i=e(58139),b=e(37121),c=e(43144);function u(et){et()}let y=null;const m=et=>y=et,p=()=>y,d=(0,r.createContext)(null),O=null;function g(){return(0,r.useContext)(d)}let h=()=>{throw new Error("uSES not initialized!")};const f=et=>{h=et},v=(et,Zt)=>et===Zt;function A(et=d){const Zt=et===d?g:()=>(0,r.useContext)(et);return function(On,at=v){const{store:Wt,subscription:Bt,getServerState:An}=Zt(),Gn=h(Bt.addNestedSub,Wt.getState,An||Wt.getState,On,at);return(0,r.useDebugValue)(Gn),Gn}}const z=A();var x=e(75985),T=e(524);function S(){const et=getBatch();let Zt=null,Tn=null;return{clear(){Zt=null,Tn=null},notify(){et(()=>{let On=Zt;for(;On;)On.callback(),On=On.next})},get(){let On=[],at=Zt;for(;at;)On.push(at),at=at.next;return On},subscribe(On){let at=!0,Wt=Tn={callback:On,next:null,prev:Tn};return Wt.prev?Wt.prev.next=Wt:Zt=Wt,function(){!at||Zt===null||(at=!1,Wt.next?Wt.next.prev=Wt.prev:Tn=Wt.prev,Wt.prev?Wt.prev.next=Wt.next:Zt=Wt.next)}}}}const C={notify(){},get:()=>[]};function E(et,Zt){let Tn,On=C;function at(nr){return Gn(),On.subscribe(nr)}function Wt(){On.notify()}function Bt(){Ln.onStateChange&&Ln.onStateChange()}function An(){return Boolean(Tn)}function Gn(){Tn||(Tn=Zt?Zt.addNestedSub(Bt):et.subscribe(Bt),On=S())}function rn(){Tn&&(Tn(),Tn=void 0,On.clear(),On=C)}const Ln={addNestedSub:at,notifyNestedSubs:Wt,handleChangeWrapper:Bt,isSubscribed:An,trySubscribe:Gn,tryUnsubscribe:rn,getListeners:()=>On};return Ln}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",P=null,L=null;let D=null;const N=et=>{D=et},w=null,V=null,k=et=>{try{return JSON.stringify(et)}catch{return String(et)}};function I(et,Zt,Tn){useIsomorphicLayoutEffect(()=>et(...Zt),Tn)}function q(et,Zt,Tn,On,at,Wt){et.current=On,Tn.current=!1,at.current&&(at.current=null,Wt())}function U(et,Zt,Tn,On,at,Wt,Bt,An,Gn,rn,Ln){if(!et)return()=>{};let nr=!1,In=null;const Ur=()=>{if(nr||!An.current)return;const Dt=Zt.getState();let Fe,rt;try{Fe=On(Dt,at.current)}catch(Ze){rt=Ze,In=Ze}rt||(In=null),Fe===Wt.current?Bt.current||rn():(Wt.current=Fe,Gn.current=Fe,Bt.current=!0,Ln())};return Tn.onStateChange=Ur,Tn.trySubscribe(),Ur(),()=>{if(nr=!0,Tn.tryUnsubscribe(),Tn.onStateChange=null,In)throw In}}const $=()=>w;function X(et,Zt){return et===Zt}let G=!1;function ae(et,Zt,Tn,{pure:On,areStatesEqual:at=X,areOwnPropsEqual:Wt=shallowEqual,areStatePropsEqual:Bt=shallowEqual,areMergedPropsEqual:An=shallowEqual,forwardRef:Gn=!1,context:rn=ReactReduxContext}={}){const Ln=rn,nr=mapStateToPropsFactory(et),In=mapDispatchToPropsFactory(Zt),Ur=mergePropsFactory(Tn),Vr=Boolean(et);return Fe=>{const rt=Fe.displayName||Fe.name||"Component",Ze=`Connect(${rt})`,Qe={shouldHandleStateChanges:Vr,displayName:Ze,wrappedComponentName:rt,WrappedComponent:Fe,initMapStateToProps:nr,initMapDispatchToProps:In,initMergeProps:Ur,areStatesEqual:at,areStatePropsEqual:Bt,areOwnPropsEqual:Wt,areMergedPropsEqual:An};function Je(st){const[se,Ce,Ve]=useMemo(()=>{const{reactReduxForwardedRef:ln}=st,pn=_objectWithoutPropertiesLoose(st,L);return[st.context,ln,pn]},[st]),Te=useMemo(()=>se&&se.Consumer&&isContextConsumer(React.createElement(se.Consumer,null))?se:Ln,[se,Ln]),xt=useContext(Te),Kt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),Cn=Boolean(xt)&&Boolean(xt.store),jn=Kt?st.store:xt.store,Sr=Cn?xt.getServerState:jn.getState,Ft=useMemo(()=>defaultSelectorFactory(jn.dispatch,Qe),[jn]),[Ne,Xe]=useMemo(()=>{if(!Vr)return V;const ln=createSubscription(jn,Kt?void 0:xt.subscription),pn=ln.notifyNestedSubs.bind(ln);return[ln,pn]},[jn,Kt,xt]),Et=useMemo(()=>Kt?xt:_extends({},xt,{subscription:Ne}),[Kt,xt,Ne]),Ht=useRef(),Qt=useRef(Ve),tn=useRef(),kn=useRef(!1),Hr=useRef(!1),Lt=useRef(!1),dn=useRef();useIsomorphicLayoutEffect(()=>(Lt.current=!0,()=>{Lt.current=!1}),[]);const cn=useMemo(()=>()=>tn.current&&Ve===Qt.current?tn.current:Ft(jn.getState(),Ve),[jn,Ve]),Dn=useMemo(()=>pn=>Ne?U(Vr,jn,Ne,Ft,Qt,Ht,kn,Lt,tn,Xe,pn):()=>{},[Ne]);I(q,[Qt,Ht,kn,Ve,tn,Xe]);let Jt;try{Jt=D(Dn,cn,Sr?()=>Ft(Sr(),Ve):cn)}catch(ln){throw dn.current&&(ln.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.1162.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.1421.0",D="@icanbwell/composite. repo version: 0.1421.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};
1
+ import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1162.1",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.14.2"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1421.1",D="@icanbwell/composite. repo version: 0.1421.1",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/composite",
3
- "version": "1.1162.0",
3
+ "version": "1.1162.1",
4
4
  "author": "icanbwell",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -43,6 +43,6 @@
43
43
  "optional": true
44
44
  }
45
45
  },
46
- "repoVersion": "0.1421.0",
47
- "description": "@icanbwell/composite. repo version: 0.1421.0"
46
+ "repoVersion": "0.1421.1",
47
+ "description": "@icanbwell/composite. repo version: 0.1421.1"
48
48
  }