@openmrs/esm-implementer-tools-app 11.0.1-pre.5908 → 11.0.1-pre.5932
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.turbo/turbo-build.log
CHANGED
package/dist/7575.js
CHANGED
|
@@ -25,4 +25,4 @@ To fix this, ensure that you define the "description" field inside the feature f
|
|
|
25
25
|
To fix this, ensure that you define the "label" field inside the feature flag definition.`,t):console.error(`A feature flag definition in ${e} is missing a name and thus cannot be registered.
|
|
26
26
|
To fix this, ensure that you define the "name" field inside the feature flag definition.`,t);else console.warn(`A feature flag for ${e} could not be registered as it does not appear to have the required properties`,t)})}})(e,t))}function sO(){sP.sort((e,t)=>e.appName.localeCompare(t.appName,"en"));let e=new Map;for(let t of sP){e.has(t.appName)?e.set(t.appName,e.get(t.appName)+1):e.set(t.appName,0);let n=e.get(t.appName),o=`${t.appName}-page-${n}`,r=t.containerDomId??"omrs-apps-container",i=document.getElementById(r),s=`single-spa-application:${o}`;if(i){let e=document.createElement("div");e.id=s,i?.appendChild(e)}else throw Error(`${t.appName} ${t.component} cannot be mounted to "${r}"; DOM element does not exist.`);!function(e,t){let n=void 0!==t.route?t.route:void 0!==t.routeRegex&&new RegExp(t.routeRegex);if(!1===n)return console.warn(`A registered page definition is missing a route and thus cannot be registered.
|
|
27
27
|
To fix this, ensure that you define the "route" (or alternatively the "routeRegex") field inside the extension definition.`,e);if(!t.component)return console.warn(`A registered page definition is missing a component and thus cannot be registered.
|
|
28
|
-
To fix this, ensure that you define the "component" field inside the page definition.`,e);let o=function(e,{featureFlag:t}){return t?n=>!!oM(t)&&e(n):e}(function e(t){if(Array.isArray(t)){let n=t.map(e);return e=>n.some(t=>t(e))}return"string"==typeof t?(0,ta.fz)(window.getOpenmrsSpaBase()+t):t instanceof RegExp?e=>t.test(e.pathname.replace(window.getOpenmrsSpaBase(),"")):()=>t}(n),t);(0,ta.AG)(e,()=>sk(t.appName,t.component),o)}(o,t)}}let sA={PHONE_MIN:0,PHONE_MAX:600,TABLET_MIN:601,TABLET_MAX:1023,SMALL_DESKTOP_MIN:1024,SMALL_DESKTOP_MAX:1439,LARGE_DESKTOP_MIN:1440,LARGE_DESKTOP_MAX:Number.MAX_SAFE_INTEGER};function sR(){document.body.classList.toggle("omrs-breakpoint-lt-tablet",window.innerWidth<sA.TABLET_MIN),document.body.classList.toggle("omrs-breakpoint-gt-phone",window.innerWidth>sA.PHONE_MAX),document.body.classList.toggle("omrs-breakpoint-gt-tablet",window.innerWidth>sA.TABLET_MAX),document.body.classList.toggle("omrs-breakpoint-lt-desktop",window.innerWidth<sA.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-small-desktop",window.innerWidth<sA.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-large-desktop",window.innerWidth<sA.LARGE_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-gt-small-desktop",window.innerWidth>sA.SMALL_DESKTOP_MAX)}let sT=!1;function s$(){sT||(window.addEventListener("resize",sR),sR(),sT=!0)}var sM=n(5530),sL=n.n(sM);function sW({title:e,children:t}){let n="tablet"===i3();return(0,rG.jsxs)("div",{className:sL()({"-esm-implementer-tools__card-header-module__tabletHeader___Vkmd-":n,"-esm-implementer-tools__card-header-module__desktopHeader___ocWGq":!n}),children:[(0,rG.jsx)("h4",{children:e}),t]})}let sD=["red","magenta","purple","blue","teal","cyan","gray","green","warm-gray","cool-gray","high-contrast","outline"],sU={primaryColor:{_type:G.String,_description:"The color for displaying primary diagnoses tags",_default:"blue",_validators:[e7.oneOf(sD)]},secondaryColor:{_type:G.String,_description:"The color for displaying secondary diagnoses tags",_default:"gray",_validators:[e7.oneOf(sD)]}},sB={"Brand color #1":{_default:"#005d5d",_type:G.String},"Brand color #2":{_default:"#004144",_type:G.String},"Brand color #3":{_default:"#007d79",_type:G.String},excludePatientIdentifierCodeTypes:{uuids:{_type:G.Array,_description:"List of UUIDs of patient identifier types to exclude from rendering in the patient banner",_default:[],_elements:{_type:G.UUID}}},implementationName:{_type:G.String,_description:"A name of the place (or authority) where all possible locations a user can choose are located.",_default:"Clinic"},logo:{src:{_type:G.String,_default:"",_description:"The path or URL to the logo shown on the login page and while the server is starting up. If set to an empty string, the default OpenMRS logo is used.",_validators:[e7.isUrl]},alt:{_type:G.String,_default:"Logo",_description:"The alternative text for the logo image, displayed when the image cannot be loaded or on hover."}},patientPhotoConceptUuid:{_type:G.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:G.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[e7.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}},preferredDateLocale:{_type:G.Object,_description:"Allows setting the locale used for date formatting for any browser locale. Does not affect time formatting. Keys should be locale codes, and values should be the preferred locale for formatting dates. For example, {'en': 'en-US', 'fr-CA': 'en-CA'}.",_default:{en:"en-GB"},_elements:{_type:G.String}},diagnosisTags:sU};var sF=n(8326);let sH={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},sV=e=>(0,rG.jsx)(sF.TableBatchActions,{translateWithId:(e,t)=>{let n=sH[e];return n?tm(n,e,t):e},...e}),sG="-esm-implementer-tools__custom-overflow-menu-module__container___8PykS",sz="-esm-implementer-tools__custom-overflow-menu-module__menu___qsOLn",sq="-esm-implementer-tools__custom-overflow-menu-module__show___BserJ",sJ="-esm-implementer-tools__custom-overflow-menu-module__overflowMenuButton___n86Gz",sK=(0,rF.createContext)(null);function sX(){let e=(0,rF.useContext)(sK);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function sY({menuTitle:e,children:t}){let[n,o]=rH().useState(!1),r=so(()=>o(!1),n),i="tablet"===i3(),s=(0,rF.useCallback)(()=>o(e=>!e),[]),a=(0,rF.useRef)(null),l=(0,rF.useRef)(null),c=(0,rF.useId)(),u=`custom-overflow-menu-trigger-${c}`,d=`custom-overflow-menu-${c}`,m=(0,rF.useCallback)(()=>{o(!1),a.current?.focus()},[]),p=(0,rF.useMemo)(()=>({closeMenu:m}),[m]),f=(0,rF.useCallback)(e=>{"Escape"===e.key&&n&&(e.stopPropagation(),m())},[m,n]),g=rF.Children.toArray(t);(0,rF.useEffect)(()=>{if(n&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[n]);let h=(0,rF.useCallback)(({currentIndex:e,direction:t})=>{let n=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!n?.length)return;let o=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,r=Array.from(n).indexOf(o);if(-1===r)return void n[t>0?0:n.length-1]?.focus();let i=r+t,s=i<0?n.length-1:i>=n.length?0:i;n[s]?.focus()},[]),w=g.map((e,t)=>(0,rF.isValidElement)(e)?(0,rF.cloneElement)(e,{closeMenu:m,handleOverflowMenuItemFocus:h,index:t}):e);return(0,rG.jsxs)("div",{"data-overflow-menu":!0,className:sL()("cds--overflow-menu",sG),ref:r,children:[(0,rG.jsx)("button",{className:sL()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":n},sJ),"aria-controls":d,"aria-expanded":n,"aria-haspopup":"true",id:u,onClick:s,onKeyDown:f,ref:a,children:e}),(0,rG.jsxs)("div",{className:sL()("cds--overflow-menu-options","cds--overflow-menu--flip",sz,{[sq]:n}),"aria-labelledby":u,"data-floating-menu-direction":"bottom",id:d,onKeyDown:f,ref:l,role:"menu",tabIndex:-1,children:[(0,rG.jsx)("ul",{className:sL()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":i}),children:(0,rG.jsx)(sK.Provider,{value:p,children:w})}),(0,rG.jsx)("span",{})]})]})}function sZ(e){let t=(0,rF.useContext)(sK);return(0,rG.jsx)(sF.OverflowMenuItem,{...e,closeMenu:t?.closeMenu})}var sQ=n(2277),s0=n(4194);let s1=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-chart-line","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-mobile-check","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-two-factor-authentication","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],s2=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),s5=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-add",iconProps:e})})),s6=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),s8=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),s4=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),s3=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),s7=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),s9=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),ae=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),at=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),an=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),ao=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),ar=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),ai=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),as=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),aa=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),al=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),ac=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),au=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),ad=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),am=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),ap=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),af=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-close",iconProps:e})})),ag=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),ah=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),aw=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-document",iconProps:e})})),a_=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),ay=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-download",iconProps:e})})),av=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),ab=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),ax=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),aS=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-events",iconProps:e})})),aj=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),ak=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),aN=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),aC=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),aE=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),aP=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-group",iconProps:e})})),aI=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),aO=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),aA=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),aR=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-information",iconProps:e})})),aT=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),a$=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),aM=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),aL=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),aW=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),aD=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-location",iconProps:e})})),aU=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),aB=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),aF=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),aH=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),aV=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),aG=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),az=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-money",iconProps:e})})),aq=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),aJ=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),aK=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),aX=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),aY=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-password",iconProps:e})})),aZ=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),aQ=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),a0=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),a1=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),a2=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),a5=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),a6=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),a8=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-report",iconProps:e})})),a4=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),a3=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-save",iconProps:e})})),a7=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-search",iconProps:e})})),a9=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),le=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),lt=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),ln=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),lo=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),lr=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),li=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),ls=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-table",iconProps:e})})),la=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-time",iconProps:e})})),ll=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),lc=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),lu=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),ld=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),lm=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),lp=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),lf=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),lg=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),lh=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-user",iconProps:e})})),lw=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),l_=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-view",iconProps:e})})),ly=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),lv=ly,lb=a_,lx=aW,lS=aA,lj=ln,lk=(0,rF.memo)((0,rF.forwardRef)(function({icon:e,fallback:t,...n},o){let r=(0,rF.useRef)(e?document.getElementById(e):void 0);return(0,rF.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(r.current=e?document.getElementById(e):void 0)});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,rG.jsx)(iS,{value:r.current,fallback:t,children:(0,rG.jsx)(lN,{ref:o,icon:e,iconProps:n})})})),lN=(0,rF.memo)((0,rF.forwardRef)(function({icon:e,iconProps:t},n){let{className:o,fill:r,size:i}=Object.assign({},{fill:"currentColor",size:20},t);(i<=0||i>72)&&(console.error(`Invalid size '${i}' specified for ${e}. Defaulting to 20.`),i=20);let s=(0,rF.useRef)(null);return(0,rF.useImperativeHandle)(n,()=>s.current),(0,rF.useEffect)(()=>{s.current&&"currentColor"!==r&&s.current.style.setProperty("--omrs-icon-fill",r)},[]),(0,rG.jsx)("svg",{ref:s,className:sL()("omrs-icon","-esm-implementer-tools__icons-module__icon___BfFhd",o),height:i,width:i,viewBox:"0 0 16 16",children:(0,rG.jsx)("use",{href:`#${e}`})})})),lC=({path:e,title:t,basePath:n,icon:o})=>{let{t:r}=(0,it.useTranslation)(),i=(0,sQ.zy)(),s=(0,rF.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let n=t.split("/").map(e=>decodeURIComponent(e)),o=(i.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return o.some((e,t)=>n.every((e,n)=>o[t+n]===e))},[i.pathname,e]);return(0,rG.jsx)("div",{children:(0,rG.jsx)(rz,{className:sL()("cds--side-nav__link",{"active-left-nav-link":s}),to:`${n}/${encodeURIComponent(e)}`,children:(0,rG.jsxs)("span",{className:"-esm-implementer-tools__dashboard-module__menu___ds1tf",children:[(0,rG.jsx)(lk,{icon:o,className:"-esm-implementer-tools__dashboard-module__icon___4Zrrh",size:16}),(0,rG.jsx)("span",{children:r(t)})]})})},e)};function lE(e){return function({basePath:t}){return(0,rG.jsx)(s0.Kd,{children:(0,rG.jsx)(lC,{basePath:t,...e})})}}var lP=n(7715),lI=n(7532),lO=n(3692),lA=n(7615),lR=n(700),lT=n(6816),l$=n(1168);function lM(e){return rH().createElement(l$.C,e)}var lL=n(3010),lW=n(6513),lD=n(6190);function lU(e,t,n=!1){if(null==e)return n?e:void 0;if("string"==typeof e&&!e)return n?null:void 0;if(e instanceof lL.ng||e instanceof lL._l||e instanceof lL.Ip)return t?(0,lW.yP)(e,t):e;{let n=sg()(e).toDate(),o=new lL.ng(n.getFullYear(),n.getMonth()+1,n.getDate());return t?(0,lW.yP)(o,t):o}}function lB(e){if(e)return e.toDate((0,lD.Xj)())}var lF=n(9002);function lH(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function lV(e){let t=e??"",n=lH(t);if(!n)return t;try{return new Intl.DisplayNames([n],{type:"language"}).of(n)??t}catch{return t}}function lG(){let e=window.i18next.language,t=lH(e)??e;return"ht"===t&&(t="fr-HT"),t}var lz=n(7883),lq=n(424),lJ=n(1492),lK=n(8271);function lX(e,t){var n=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return n.get?n.get.call(e):n.value}sf.extend(sh),sf.extend(lJ),sf.extend(lq);let lY="YYYY-MM-DDTHH:mm:ss.SSSZZ",lZ=/^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$/;function lQ(e,t){let n=lZ.exec(e);if(!n)return(0,lz.CD)(e,t);let o=Number(n[1]),r=void 0===n[2]?void 0:Number(n[2]),i=void 0===n[3]?void 0:Number(n[3]),s=new Date(0);return(s.setUTCFullYear(o,(r??1)-1,i??1),s.getUTCFullYear()!==o||s.getUTCMonth()!==(r??1)-1||s.getUTCDate()!==(i??1))?{invalid:`Invalid ISO calendar date '${e}'`}:{year:o,...void 0!==r&&{month:r},...void 0!==i&&{day:i}}}function l0(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&sf(e,lY).isValid()}function l1(e){return sf(e).isToday()}function l2(e){return l0(e)?sf(e,lY).toDate():null}function l5(e,t=!1){let n=sf(e);return t&&(n=n.utc()),n.format(lY)}function l6(e){return sf(e).toDate()}var l8=new WeakMap;let l4=new class{register(e,t){lX(this,l8).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(lX(this,l8).has(t))return lX(this,l8).get(t)}if(e.language&&lX(this,l8).has(e.language))return lX(this,l8).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return lX(this,l8).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}(this,l8,{writable:!0,value:new Map})}};function l3(e,t){l4.register(e,t)}function l7(e){let t=e??lG();return l4.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let l9={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function ce(e,t={}){let n=lQ(e,lG());if(n.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!(0,lK.A)(n.day)&&(0,lK.A)(n.month)&&(n=Object.assign({},(0,H.A)(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},(0,H.A)(n,"day"),{date:n.day}));let o=sf().set(n).toDate();return(0,lK.A)(n.year)&&(t.year=!1),(0,lK.A)(n.month)&&(t.month=!1),(0,lK.A)(n.date)&&(t.day=!1),ct(o,t)}function ct(e,t){let n,o=t?.locale??lG(),r=new Intl.Locale(o),{calendar:i,mode:s,time:a,day:l,month:c,year:u,noToday:d,numberingSystem:m}={...l9,...{noToday:"am"===r.language},...t},p={calendar:i??l7(r),year:u?"numeric":void 0,month:c?"short":void 0,day:l?"2-digit":void 0,numberingSystem:m},f=sf(e).isToday();if(f&&!d)n=(n=new Intl.RelativeTimeFormat(o,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(o)+n.slice(1);else{"en"===r.language&&(o="en-GB");let t=new Intl.DateTimeFormat(o,p).formatToParts(e);("en"===r.language||"am"===r.language)&&"standard"==s&&u&&l&&(t=t.map(cn("-"))),"wide"==s&&(t=t.map(cn(" — "))),"ethiopic"===p.calendar&&(t=t.filter((e,t,n)=>"era"!==e.type&&("literal"!==e.type||!(t<n.length-1)||"era"!==n[t+1].type))),n=t.map(e=>e.value).join("")}return(!0===a||f&&"for today"===a)&&(n+=`, ${co(e)}`),n}let cn=e=>(t,n,o)=>"literal"!==t.type||" "!==t.value||n<o.length-1&&"era"===o[n+1].type?t:{type:"literal",value:e};function co(e){return e.toLocaleTimeString(lG(),{hour:"2-digit",minute:"2-digit"})}function cr(e,t){return ct(e,{...t,time:!0})}function ci(e,t){let n=l7("string"==typeof t?new Intl.Locale(t):t);return n?(0,lW.yP)(e,(0,lF.d)(n)):e}function cs(e,t){return new Intl.DurationFormat(lG(),t).format(e)}function ca(e,t){if(null==e)return null;if("string"==typeof e){let n=lQ(e,lG());return n.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(n.day&&!n.month&&(n={...(0,H.A)(n,"day"),...{month:n.day}}),n.month&&(n.month-=1),n.day&&(n={...(0,H.A)(n,"day"),...{date:n.day}}),sf(t).set(n))}return sf(e)}let cl=["years","months","days","hours","minutes","seconds"],cc={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},cu={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function cd(e,t=sf(),n){let o,r=sf(t),i=ca(e,r);if(null==i)return null;if("string"==typeof n){let e=cc[n]??n;return{[e]:r.diff(i,e)}}let{thresholds:s,largestUnit:a,smallestUnit:l}=n??{};if(void 0!==a||void 0!==l){let e,t=l?cc[l]??l:void 0;return e="auto"===a||void 0===a?function(e,t,n){let o=cl.indexOf(n);for(let r=0;r<cl.length;r++){let i=cl[r];if(t.diff(e,i)>0)return r<=o?i:n}return n}(i,r,t??"seconds"):cc[a]??a,function(e,t,n,o){let r=cl.indexOf(n),i=cl.indexOf(o),s=cl.slice(r,i+1),a={},l=e;for(let e of s){let n=t.diff(l,e);a[e]=n,l=l.add(n,e)}return a}(i,r,e,t??e)}let c=(o=function(e){let t={...cu};if(e)for(let[n,o]of Object.entries(e))void 0!==o&&(t[cc[n]??n]=o);return t}(s),r.diff(i,"seconds")<o.seconds?"seconds":r.diff(i,"minutes")<o.minutes?"minutes":r.diff(i,"hours")<o.hours?"hours":r.diff(i,"days")<o.days?"days":r.diff(i,"months")<o.months?"months":"years");return{[c]:r.diff(i,c)}}let cm={style:"short",localeMatcher:"lookup"};function cp(e,t=sf(),n){let o=cd(e,t,n);return null==o?null:cs(o,"object"==typeof n&&n.formatOptions?{...cm,...n.formatOptions}:cm)}let cf=(0,rF.createContext)(null);function cg(){let e=iT({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,rF.useMemo)(()=>{let t=lG();return e[t]&&(t=e[t]),t},[window.i18next.language]),n=(0,rF.useMemo)(()=>{let e=l7(t);return void 0!==e?(0,lF.d)(e):void 0},[t]),o=(0,rF.useMemo)(()=>new Intl.Locale(t,{calendar:n?.identifier}),[t,n]),r=(0,rF.useMemo)(()=>n?(0,lW.yP)((0,lD.Ec)((0,lD.Xj)()),n):(0,lD.Ec)((0,lD.Xj)()),[n]);return{calendar:n,intlLocale:o,today_:r}}let ch=new lL.ng(1793,1,1);var cw=n(5830),c_=n(5354),cy=n(4745),cv=n(1202);function cb(e,t){return Number.parseInt(ct(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let cx=(0,rF.forwardRef)(function(e,t){let{className:n}=e,o=(0,rF.useContext)(cw.f2),r=(0,rF.useContext)(cw._I),i=o??r,s=(0,rF.useContext)(cf),a=(0,lD.Xj)(),l=ct(i.visibleRange.start.toDate(a),{calendar:s.calendar,locale:s.baseName,day:!1,year:!1,noToday:!0}),c=cb(i.visibleRange.start.toDate(a),s),u=i.maxValue?cb(i.maxValue.toDate(a),s):void 0,d=i.minValue?cb(i.minValue.toDate(a),s):void 0,m=(0,rF.useCallback)(e=>{i.setFocusedDate(i.focusedDate.cycle("year",e-i.focusedDate.year))},[]);return i&&(0,rG.jsxs)("span",{ref:t,className:n,children:[(0,rG.jsx)("span",{children:l}),(0,rG.jsxs)(cy.oz,{formatOptions:{useGrouping:!1},maxValue:u,minValue:d,onChange:m,value:c,children:[(0,rG.jsx)(cv.p,{}),(0,rG.jsxs)(lA.Y,{children:[(0,rG.jsx)(lR.$,{slot:"increment",children:(0,rG.jsx)(ar,{size:8})}),(0,rG.jsx)(lR.$,{slot:"decrement",children:(0,rG.jsx)(at,{size:8})})]})]})]})});var cS=n(9588);let cj="-esm-implementer-tools__datepicker-module__inputGroup___+4zks",ck="-esm-implementer-tools__datepicker-module__inputSegment___wiExn",cN="-esm-implementer-tools__datepicker-module__dateInputWrapper___uiyAC",cC="-esm-implementer-tools__datepicker-module__invalidText___SxtTL",cE="-esm-implementer-tools__datepicker-module__flatButton___UU1Qp",cP="-esm-implementer-tools__datepicker-module__flatButtonMd___fhR-1",cI="-esm-implementer-tools__datepicker-module__flatButtonSm___5INZ7",cO="-esm-implementer-tools__datepicker-module__flatButtonLg___RFMrl";function cA({children:e}){let t=(0,rF.useContext)(lI.Pg),n=(0,rF.useContext)(lI.a8),o=t??n,r=so(()=>o?.close());return(0,rG.jsx)(cS.lG,{className:"-esm-implementer-tools__datepicker-module__dialog___qllIf",ref:r,children:e})}let cR=(0,rF.forwardRef)(function({variant:e,today_:t,minDate:n,maxDate:o},r){let i="range"===e,s=i?cw._e:cw.Vv;return(0,rG.jsx)(c_.A,{ref:r,className:"-esm-implementer-tools__datepicker-module__popover___16UMX",placement:"bottom start",offset:1,isNonModal:!0,children:(0,rG.jsx)(cA,{children:(0,rG.jsxs)(s,{...i?{minValue:n,maxValue:o,className:"cds--date-picker__calendar"}:{},children:[(0,rG.jsxs)("header",{className:"-esm-implementer-tools__datepicker-module__header___WAVlD",children:[(0,rG.jsx)(lR.$,{className:sL()(cE,cP),slot:"previous",children:(0,rG.jsx)(ad,{size:16})}),(0,rG.jsx)(cx,{className:"-esm-implementer-tools__datepicker-module__monthYear___A3aKF"}),(0,rG.jsx)(lR.$,{className:sL()(cE,cP),slot:"next",children:(0,rG.jsx)(am,{size:16})})]}),(0,rG.jsx)(cw.r8,{className:"-esm-implementer-tools__datepicker-module__calendarGrid___6qRB2",children:e=>(0,rG.jsx)(cw.Zr,{className:sL()("cds--date-picker__day",{"-esm-implementer-tools__datepicker-module__today___TZl6M":0===t.compare(e)}),date:e},e.toString())})]})})})});var cT=n(8017),c$=n(9774),cM=n(7956);let cL=(0,rF.forwardRef)(function(e,t){let n=(0,rF.useContext)(lI.Pg),[o,r]=(0,lP.JT)({slot:e.slot},t,c$.cQ),{locale:i}=(0,l$.Y)(),s=(0,cM.F)({...o,locale:i,createCalendar:lF.d}),a=(0,rF.useRef)(null),{fieldProps:l,inputProps:c}=(0,cT.cJ)({...o,inputRef:a},s,r),u=(0,rF.useCallback)(()=>{s.isDisabled||n.toggle()},[]);return(0,rG.jsxs)(lP.Kq,{values:[[c$.$,s],[cv.E,{...c,ref:a}],[lA.t,{...l,ref:r,isInvalid:s.isInvalid}]],children:[(0,rG.jsx)(lA.Y,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:s.isDisabled,isInvalid:s.isInvalid,onClick:u,children:s.segments.map((t,n)=>(0,rF.cloneElement)(e.children(t),{key:n}))}),(0,rG.jsx)(cv.p,{})]})}),cW=(0,rF.forwardRef)(function(e,t){let n=(0,rF.useContext)(lI.Pg),o=(0,rF.useContext)(lI.a8);return(n??o).isInvalid?(0,rG.jsx)(ly,{ref:t,size:16,...e}):(0,rG.jsx)(ae,{ref:t,size:16,...e})});var cD=n(64),cU=n(5503),cB=n(1697),cF=n(7866),cH=n(8035),cV=n(2231);let cG=(0,rF.forwardRef)(function({segment:e,...t},n){let o=(0,rF.useContext)(c$.$),r=(0,cD.U)(n),{segmentProps:i}=(0,cU.V)(e,o,r),{focusProps:s,isFocused:a,isFocusVisible:l}=(0,cB.o)(),{hoverProps:c,isHovered:u}=(0,cF.M)({...t,isDisabled:o.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:n,children:o,defaultClassName:r,defaultChildren:i,defaultStyle:s,values:a}=e;return(0,rF.useMemo)(()=>{let e,l,c;return e="function"==typeof t?t({...a,defaultClassName:r}):t,l="function"==typeof n?n({...a,defaultStyle:s||{}}):n,c="function"==typeof o?o({...a,defaultChildren:i}):null==o?i:o,{className:e??r,style:l||s?{...s,...l}:void 0,children:c??i,"data-rac":""}},[t,n,o,r,i,s,a])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:o.isInvalid,isDisabled:o.isDisabled,isHovered:u,isFocused:a,isFocusVisible:l},defaultChildren:e.text}),m=(0,rF.useCallback)(e=>{e.stopPropagation()},[]);return(0,rG.jsx)("span",{...(0,cH.v)((0,cV.$)(t),i,s,c),...d,ref:r,style:i.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":o.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":o.isDisabled||void 0,"data-type":e.type,"data-hovered":u||void 0,"data-focused":a||void 0,"data-focus-visible":l||void 0,onClick:m})}),cz={short:!1,size:"md"},cq=(0,rF.forwardRef)(function(e,t){let{className:n,defaultValue:o,isDisabled:r,invalid:i,invalidText:s,isInvalid:a,label:l,labelText:c,light:u,maxDate:d,minDate:m,onChange:p,onChangeRaw:f,short:g,size:h,value:w,..._}={...cz,...e},{calendar:y,intlLocale:v,today_:b}=cg(),x=(0,rF.useId)(),S=!!(c??l),j=(0,rF.useMemo)(()=>lU(o,y),[o,y]),k=(0,rF.useMemo)(()=>lU(w,y,!0),[w,y]),N=(0,rF.useMemo)(()=>lU(d,y),[d,y]),C=(0,rF.useMemo)(()=>lU(m??ch,y),[m,y]),E=(0,rF.useMemo)(()=>i||a,[i,a]),P=(0,rF.useMemo)(()=>(f&&p&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),f??(e=>p?.(lB(e)))),[f,p]);return(0,rG.jsx)(lM,{locale:v.toString(),children:(0,rG.jsx)("div",{className:sL()("cds--form-item",n),children:(0,rG.jsx)(lP.Kq,{values:[[cf,v]],children:(0,rG.jsxs)(lI.lr,{className:sL()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":g,"cds--date-picker--light":u}),defaultValue:j,isDisabled:r,isInvalid:E,maxValue:N,minValue:C,value:k,shouldForceLeadingZeros:"en"===v.language||void 0,..._,onChange:P,children:[(0,rG.jsxs)("div",{className:"cds--date-picker-container",children:[S&&(0,rG.jsx)(lO.J,{className:sL()("cds--label",{"cds--label--disabled":r}),htmlFor:x,children:c??l}),(0,rG.jsxs)(lA.Y,{className:cj,children:[(0,rG.jsx)(cL,{id:S?x:void 0,ref:t,className:sL()("cds--date-picker-input__wrapper","-esm-implementer-tools__datepicker-module__inputWrapper___kykar",{"-esm-implementer-tools__datepicker-module__inputWrapperSm___KJtg-":"sm"===h,"-esm-implementer-tools__datepicker-module__inputWrapperMd___ablE9":"md"===h||!h||0===h.length,"-esm-implementer-tools__datepicker-module__inputWrapperLg___5dkQp":"lg"===h}),children:e=>"era"!==e.type?(0,rG.jsx)(cG,{className:ck,segment:e}):(0,rG.jsx)(rH().Fragment,{})}),(0,rG.jsx)(lR.$,{className:sL()(cE,{[cI]:"sm"===h,[cP]:"md"===h||!h||0===h.length,[cO]:"lg"===h}),children:(0,rG.jsx)(cW,{})})]}),(0,rG.jsx)(lT.b,{className:cC,children:s})]}),(0,rG.jsx)(cR,{variant:"single",today_:b})]})})})})}),cJ=(0,rF.forwardRef)(function({className:e,defaultValue:t,invalid:n,invalidText:o,isDisabled:r,isInvalid:i,label:s,labelText:a,light:l,maxDate:c,minDate:u,onChange:d,onChangeRaw:m,size:p="md",value:f,...g},h){let{calendar:w,intlLocale:_,today_:y}=cg(),v=(0,rF.useId)(),b=!!(a??s),x=(0,rF.useMemo)(()=>{if(f)return{start:lU(f[0],w,!1),end:lU(f[1],w,!1)}},[f,w]),S=(0,rF.useMemo)(()=>{if(t)return{start:lU(t[0],w,!1),end:lU(t[1],w,!1)}},[t,w]),j=(0,rF.useMemo)(()=>lU(u??ch,w,!0),[u,w]),k=(0,rF.useMemo)(()=>lU(c,w,!0),[c,w]),N=(0,rF.useMemo)(()=>n||i,[n,i]),C=(0,rF.useMemo)(()=>(m&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),m??(e=>d?.([lB(e.start),lB(e.end)]))),[m,d]);return(0,rG.jsx)(lM,{locale:_.toString(),children:(0,rG.jsx)("div",{className:sL()("cds--form-item",e),children:(0,rG.jsx)(lP.Kq,{values:[[cf,_]],children:(0,rG.jsx)(lI.Ur,{id:b?v:void 0,className:sL()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":r}),isInvalid:N,shouldForceLeadingZeros:"en"===_.language||void 0,maxValue:k,minValue:j,value:x,defaultValue:S,ref:h,isDisabled:r,...g,onChange:C,children:(0,rG.jsxs)("div",{className:"cds--date-picker-container",children:[b&&(0,rG.jsx)(lO.J,{className:sL()("cds--label",{"cds--label--disabled":r}),htmlFor:v,children:a??s}),(0,rG.jsxs)(lA.Y,{className:cj,children:[(0,rG.jsxs)("div",{className:sL()("-esm-implementer-tools__datepicker-module__inputsWrapper___YlkGh",{"-esm-implementer-tools__datepicker-module__inputsWrapperSm___fAKhS":"sm"===p,"-esm-implementer-tools__datepicker-module__inputsWrapperMd___XVgGP":"md"===p||!p||0===p.length,"-esm-implementer-tools__datepicker-module__inputsWrapperLg___UgHJ1":"lg"===p}),children:[(0,rG.jsx)(c$.J3,{className:sL()("cds--date-picker-input__wrapper","-esm-implementer-tools__datepicker-module__startInput___qgbQm",cN),slot:"start",children:e=>(0,rG.jsx)(cG,{className:ck,segment:e})}),(0,rG.jsx)("div",{className:"-esm-implementer-tools__datepicker-module__separator___79vXZ",children:(0,rG.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,rG.jsx)(c$.J3,{className:sL()("cds--date-picker-input__wrapper","-esm-implementer-tools__datepicker-module__endInput___huv7x",cN),slot:"end",children:e=>(0,rG.jsx)(cG,{className:ck,segment:e})})]}),(0,rG.jsx)(lR.$,{className:sL()(cE,{[cI]:"sm"===p,[cP]:"md"===p||!p||0===p.length,[cO]:"lg"===p}),children:(0,rG.jsx)(cW,{})})]}),(0,rG.jsx)(lT.b,{className:cC,children:o}),(0,rG.jsx)(cR,{variant:"range",today_:y,minDate:j,maxDate:k})]})})})})})});var cK=n(9606);let cX=({diagnoses:e,showCertainty:t=!1})=>{let{diagnosisTags:n}=iT({externalModuleName:"@openmrs/esm-styleguide"});return(0,rG.jsx)("div",{className:"-esm-implementer-tools__diagnosis-tags-module__container___8kut8",children:e.map(e=>{let o=t&&"PROVISIONAL"===e.certainty,r=1===e.rank?n?.primaryColor??"blue":n?.secondaryColor??"gray";return(0,rG.jsx)(cY,{color:r,isProvisional:o,name:e.display},e.uuid)})})};function cY({color:e,isProvisional:t,name:n}){let[o,r]=(0,rF.useState)(!1),[i,s]=(0,rF.useState)(!1),[a,l]=(0,rF.useState)(!1),c=a||i,u=(0,rF.useRef)(null);(0,rF.useLayoutEffect)(()=>{let e=u.current;if(!e)return;let t=()=>{let t=e.scrollWidth>e.clientWidth;l(t),t||r(!1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[n,t,c]);let d=sL()("cds--tag","cds--tag--md","cds--layout--size-md",`cds--tag--${e}`,"-esm-implementer-tools__diagnosis-tags-module__diagnosisTag___PFhpl"),m=(0,rG.jsxs)(rG.Fragment,{children:[t&&(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("span",{"aria-hidden":"true",className:"-esm-implementer-tools__diagnosis-tags-module__provisionalMark___8o6l4",children:"?"}),(0,rG.jsxs)("span",{className:"cds--visually-hidden",children:[tm("provisional","Provisional")," "]})]}),(0,rG.jsx)("span",{ref:u,className:"cds--tag__label",children:n})]});return c?(0,rG.jsxs)(cK.k$,{delay:0,closeDelay:150,isOpen:o,onOpenChange:r,children:[(0,rG.jsx)(lR.$,{className:d,"data-testid":"diagnosis-tag",onFocusChange:s,onPress:()=>r(!0),children:m}),(0,rG.jsx)(cK.m_,{className:"-esm-implementer-tools__diagnosis-tags-module__tagTooltip___asRTH",placement:"bottom",offset:4,containerPadding:8,children:n})]}):(0,rG.jsx)("span",{className:d,"data-testid":"diagnosis-tag",children:m})}let cZ={action:"-esm-implementer-tools__empty-card-module__action___Y0dul",content:"-esm-implementer-tools__empty-card-module__content___fo0nB",desktopHeading:"-esm-implementer-tools__empty-card-module__desktopHeading___0Cg1N",tabletHeading:"-esm-implementer-tools__empty-card-module__tabletHeading___BogTF",tile:"-esm-implementer-tools__empty-card-module__tile___QB8Ld"},cQ=({width:e="64",height:t="64"})=>(0,rG.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,rG.jsx)("use",{href:"#omrs-empty-data-illustration"})}),c0=e=>{let t="tablet"===i3(),n=e.launchForm;return(0,rG.jsx)(sF.Layer,{className:cZ.layer,children:(0,rG.jsxs)(sF.Tile,{className:cZ.tile,children:[(0,rG.jsx)("div",{className:t?cZ.tabletHeading:cZ.desktopHeading,children:(0,rG.jsx)("h4",{children:e.headerTitle})}),(0,rG.jsx)(cQ,{}),(0,rG.jsx)("p",{className:cZ.content,children:tm("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,rG.jsx)("p",{className:cZ.action,children:n&&(0,rG.jsx)(sF.Button,{onClick:()=>n(),kind:"ghost",size:t?"lg":"sm",children:tm("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},c1=({error:e,headerTitle:t})=>{let n="tablet"===i3();return(0,rG.jsx)(sF.Layer,{children:(0,rG.jsxs)(sF.Tile,{className:"-esm-implementer-tools__error-state-module__tile___dd418",children:[(0,rG.jsx)("div",{className:n?"-esm-implementer-tools__error-state-module__tabletHeading___g5rjg":"-esm-implementer-tools__error-state-module__desktopHeading___Nd9u2",children:(0,rG.jsx)("h4",{children:t})}),(0,rG.jsxs)("p",{className:"-esm-implementer-tools__error-state-module__errorMessage___z2RiN",children:[tm("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,rG.jsx)("p",{className:"-esm-implementer-tools__error-state-module__errorCopy___dq+e2",children:tm("errorCopy")})]})})},c2=c1,c5=rH().forwardRef((e,t)=>{let{slotName:n,basePath:o,componentContext:r,state:i}=se(),s=window.location??{pathname:""},a=r6(n??"");return e.isChildOfHeader&&n&&a.length>0?(0,rG.jsxs)(sF.SideNav,{"aria-label":tm("leftNavigation","Left navigation"),className:"-esm-implementer-tools__left-nav-module__leftNav___jzTJK",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,rG.jsx)(r3,{name:"global-nav-menu-slot"}),n?(0,rG.jsx)(iS,{value:r,fallback:(0,rG.jsx)(r3,{name:n,state:{basePath:o,currentPath:s,...i}}),children:(0,rG.jsx)(rV.Provider,{value:r,children:(0,rG.jsx)(r3,{name:n,state:{basePath:o,currentPath:s,...i}})})}):null]}):null}),c6=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:n,locationsPerRequest:o=50,onChange:r})=>{let[i,s]=(0,rF.useState)(""),a=(0,rF.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:n,error:o,isLoading:r}=iW()(t,tP,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,rF.useMemo)(()=>({location:n?.data?.entry?n.data.entry[0]:null,error:t?o:null,isLoading:!!t&&r}),[n,r,o,t])}(t),{locations:c,isLoading:u,hasMore:d,loadingNewData:m,error:p,setPage:f}=function(e,t=0,n=""){let o=iM(n),{data:r,isLoading:i,isValidating:s,setSize:a,error:l}=iQ()(function(n,r){if(r){let e=r.data?.link?.find(e=>"next"===e.relation);if(!e)return null;let t=new URL(e.url);return t.origin===window.location.origin?e.url:new URL(`${t.pathname}${t.search?`?${t.search}`:""}`,window.location.origin).toString()}let i=`${tN}/Location?`,s=new URLSearchParams;return s.append("_summary","data"),t&&s.append("_count",""+t),n&&s.append("_getpagesoffset",""+n*t),e&&s.append("_tag",e),"string"==typeof o&&""!==o&&s.append("name:contains",o),i+s.toString()},tP);return(0,rF.useMemo)(()=>({locations:r?.length?r?.flatMap(e=>e?.data?.entry??[]):[],isLoading:i,totalResults:r?.[0]?.data?.total,hasMore:!!r?.length&&r?.[r.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:s,error:l||null,setPage:a}),[i,r,s,a,l])}(n,o,i),g=(0,rF.useMemo)(()=>l&&!i&&t?[l,...c.filter(({resource:e})=>e.id!==t)]:c??[],[l,c,t,i]),h=(0,rF.useCallback)(e=>{r(),s(e.trim())},[r]),w=sr((0,rF.useCallback)(()=>{!m&&d&&f(e=>e+1)},[m,d,f])),_=d?Math.max(0,Math.floor(g.length-o/2)):-1;return(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)(sF.Search,{"aria-describedby":p?`${a}-error`:void 0,labelText:tm("searchForLocation"),id:a,placeholder:tm("searchForLocation"),onChange:e=>h(e.target.value),size:"lg"}),p&&(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__errorNotification___vWBFD",id:`${a}-error`,children:(0,rG.jsx)(sF.InlineNotification,{kind:"error",subtitle:tm("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:tm("error","Error")})}),(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__searchResults___Gbet+",children:u?(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__loadingContainer___QO-zj",children:Array.from({length:5}).map((e,t)=>(0,rG.jsx)(sF.RadioButtonSkeleton,{className:"-esm-implementer-tools__location-picker-module__radioButtonSkeleton___otoCy",role:"progressbar"},t))}):(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__locationResultsContainer___6Pasf",children:g.length>0?(0,rG.jsx)(sF.RadioButtonGroup,{name:"loginLocations",onChange:e=>{r(e?.toString())},orientation:"vertical",valueSelected:e,children:g.map((e,t)=>(0,rG.jsx)(sF.RadioButton,{className:"-esm-implementer-tools__location-picker-module__locationRadioButton___rTDPj",id:e.resource.id,labelText:(0,rG.jsx)("span",{ref:t===_?w:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__emptyState___w4-Ca",children:(0,rG.jsx)("p",{className:"-esm-implementer-tools__location-picker-module__locationNotFound___Of2MJ",children:tm("noResultsToDisplay")})})}),m&&(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__loadingIcon___NAwSB",children:(0,rG.jsx)(sF.InlineLoading,{description:tm("loading")})})]})})]})},c8=R("modalState",{modalContainer:null,modalStack:[]}),c4=0;async function c3(e,t,n={}){let o=rN(t),r=null;if(e){if(!o)throw Error(`No modal named '${t}' has been registered.`);let{load:i}=o,s=await i(),a=c4++;r=await rW({...s,name:`${t}-${a}`},{...n,domElement:e})}else y(`Failed to launch modal. Please notify your administrator. Modal name: ${t}`);return r}function c7(e){return"TO_BE_DELETED"===e.state||"DELETED"===e.state}function c9(e,t){t?.unmount&&(t.unmountPromise?.catch(()=>{}),t.unmount().catch(t=>{console.error(`The modal '${e}' failed to unmount`,t)}))}function ue(e){return e.find(e=>!c7(e))}function ut(e,t){e.container&&(e.container.style.visibility=t?"unset":"hidden")}let un=window.getComputedStyle(document.body).overflow;function uo({modalStack:e,modalContainer:t}){if(t)if(e.length){t.style.visibility||(addEventListener("keydown",ui),document.body.style.overflow="hidden",t.style.visibility="unset");let n=ue(e);e.forEach(e=>{switch(e.state){case"NEW":{let n=function({size:e}){let t=document.createElement("div");return t.className=`cds--modal-container cds--modal-container--${e}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}({size:e.props?.size??"md"});e.container=n,e.state="MOUNTING",c3(n,e.modalName,e.props).then(o=>{c7(e)?c9(e.modalName,o):o?(e.parcel=o,t.prepend(n),ut(e,ue(c8.getState().modalStack)===e),o.mountPromise.then(()=>{c7(e)||(e.state="MOUNTED")},t=>{y(t),e.parcel=null,ur(e)})):ur(e)},t=>{y(t),ur(e)});break}case"MOUNTING":case"MOUNTED":ut(e,e===n);break;case"TO_BE_DELETED":e.state="DELETED",e.onClose(),c9(e.modalName,e.parcel),e.container?.remove(),setTimeout(()=>{let t=c8.getState();c8.setState({...t,modalStack:t.modalStack.filter(t=>t!==e)})},0)}})}else t.style.removeProperty("visibility"),document.body.style.overflow=un,removeEventListener("keydown",ui)}function ur(e){if(c7(e))return;e.state="TO_BE_DELETED";let t=c8.getState();c8.setState({...t,modalStack:[...t.modalStack]})}function ui(e){"Escape"===e.key&&function(){let[e]=c8.getState().modalStack;e&&ur(e)}()}function us(e){c8.subscribe(uo),c8.setState({...c8.getState(),modalContainer:e})}function ua(e,t={},n=()=>{}){let o=()=>{let e=c8.getState().modalStack.find(e=>e.onClose===n);e&&ur(e)};if(rN(e)){var r;let i,s;r={state:"NEW",onClose:n,modalName:e,props:{close:o,...t}},s=[r,...(i=c8.getState()).modalStack],c8.setState({...i,modalStack:s})}else y(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return o}var ul=n(9685);let uc=({notification:e})=>{let{description:t,action:n,kind:o,critical:r,title:i,onAction:s}=e;return(0,rG.jsx)(sF.ActionableNotification,{actionButtonLabel:n,kind:o||"info",lowContrast:r,subtitle:t,title:i||"",inline:!0,onActionButtonClick:s})},uu=({subject:e})=>{let[t,n]=(0,rF.useState)([]);return(0,rF.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.action!==e.action||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsx)(uc,{notification:e},e.id))})},ud=({notification:e})=>{let{actionButtonLabel:t,onActionButtonClick:n=()=>{},subtitle:o,kind:r,title:i,critical:s,progressActionLabel:a,id:l,...c}=e,[u,d]=(0,rF.useState)(t);return(0,rG.jsx)(sF.ActionableNotification,{kind:r||"info",actionButtonLabel:u,ariaLabel:tm("closesActionableNotification","Closes actionable notification"),onActionButtonClick:()=>{n(),a&&d(a)},statusIconDescription:tm("actionableNotification","Actionable notification"),subtitle:o,title:i,lowContrast:s,inline:!0,...c})},um=({subject:e})=>{let[t,n]=(0,rF.useState)([]);return(0,rF.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsx)(ud,{notification:e},e.id))})};class up{subscribe(e){return this.listeners.add(e),{unsubscribe:()=>{this.listeners.delete(e)}}}next(e){for(let t of[...this.listeners])t(e)}constructor(){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"listeners",new Set)}}let uf=new up,ug=0,uh=new up,uw=0;function u_(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(uu,{subject:uf}))}function uy(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!(0,ul.A)(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{uf.next({...e,id:ug++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function uv(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(um,{subject:uh}))}function ub(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!(0,ul.A)(t))?setTimeout(()=>{uh.next({...e,id:uw++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let ux=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],uS=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"],uj={container:"-esm-implementer-tools__numeric-observation-module__container___NfxbH",card:"-esm-implementer-tools__numeric-observation-module__card___9oQAh","abnormal-value":"-esm-implementer-tools__numeric-observation-module__abnormal-value___drvEi","critical-value":"-esm-implementer-tools__numeric-observation-module__critical-value___JAIHt",cell:"-esm-implementer-tools__numeric-observation-module__cell___lTunW","critically-high":"-esm-implementer-tools__numeric-observation-module__critically-high___aDUjc","critically-low":"-esm-implementer-tools__numeric-observation-module__critically-low___5srAK",high:"-esm-implementer-tools__numeric-observation-module__high___7KiyK",low:"-esm-implementer-tools__numeric-observation-module__low___Zs2ct","label-container":"-esm-implementer-tools__numeric-observation-module__label-container___lGnGH","value-container":"-esm-implementer-tools__numeric-observation-module__value-container___hHPXt",label:"-esm-implementer-tools__numeric-observation-module__label___WFuxk",value:"-esm-implementer-tools__numeric-observation-module__value___6fHUr",units:"-esm-implementer-tools__numeric-observation-module__units___EdVuw","pad-right":"-esm-implementer-tools__numeric-observation-module__pad-right___6T9Cd","off-scale-low":"-esm-implementer-tools__numeric-observation-module__off-scale-low___Sc1CV","off-scale-high":"-esm-implementer-tools__numeric-observation-module__off-scale-high___cWpU2",arrow:"-esm-implementer-tools__numeric-observation-module__arrow___SLGUh"},uk=({value:e,unit:t,label:n,interpretation:o,referenceRange:r,conceptUuid:i,variant:s="card",patientUuid:a})=>{let l=(0,rF.useId)(),{referenceRange:c,isLoading:u}=function(e,t){let n=null;e&&(n=t?`${tk}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${tk}/conceptreferencerange/?concept=${e}&v=full`);let{data:o,error:r,isLoading:i}=iW()(n,tP),s=o?.data?.results?.[0];return{referenceRange:s?{hiNormal:s.hiNormal??null,hiAbsolute:s.hiAbsolute??null,hiCritical:s.hiCritical??null,lowNormal:s.lowNormal??null,lowAbsolute:s.lowAbsolute??null,lowCritical:s.lowCritical??null}:void 0,error:r,isLoading:i}}(r||o?void 0:i,a),d=r??c,m=(0,rF.useMemo)(()=>{if(o)return o?"--"===o?"normal":ux.includes(o)?o.toLowerCase():uS.includes(o)?o:"normal":void 0;if(d&&!u){if(!d||null==e||""===e)return"normal";let t="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(t)?"normal":null!==d.hiAbsolute&&void 0!==d.hiAbsolute&&t>d.hiAbsolute?"off_scale_high":null!==d.hiCritical&&void 0!==d.hiCritical&&t>=d.hiCritical?"critically_high":null!==d.hiNormal&&void 0!==d.hiNormal&&t>d.hiNormal?"high":null!==d.lowAbsolute&&void 0!==d.lowAbsolute&&t<d.lowAbsolute?"off_scale_low":null!==d.lowCritical&&void 0!==d.lowCritical&&t<=d.lowCritical?"critically_low":null!==d.lowNormal&&void 0!==d.lowNormal&&t<d.lowNormal?"low":"normal"}return"normal"},[o,d,e,u])??"normal",p="critically_low"===m||"critically_high"===m||"off_scale_low"===m||"off_scale_high"===m,f="normal"!==m,g=n?`omrs-numeric-obs-label-${n.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,h=`omrs-numeric-obs-value-${l}`,w=`omrs-numeric-obs-unit-${l}`,_=null!=e&&""!==e,y=_?e:tm("notAvailable","Not available"),v=sL()({[uj["critically-low"]]:"critically_low"===m||"off_scale_low"===m,[uj["critically-high"]]:"critically_high"===m||"off_scale_high"===m,[uj.low]:"low"===m,[uj.high]:"high"===m,[uj["off-scale-low"]]:"off_scale_low"===m,[uj["off-scale-high"]]:"off_scale_high"===m}),b=sL()({[uj.container]:!0,[uj.card]:!0,[uj["critical-value"]]:p,[uj["abnormal-value"]]:f&&!p}),x=sL()({[uj.cell]:!0,[v]:!0});return"cell"===s?(0,rG.jsxs)("div",{className:x,children:[y,_&&t?` ${t}`:""]}):(0,rG.jsxs)("section",{className:b,"data-testid":"numeric-observation-card",children:[n&&(0,rG.jsxs)("div",{className:uj["label-container"],children:[(0,rG.jsx)("span",{id:g,className:uj.label,children:n}),f&&(0,rG.jsx)("span",{className:uj[m.replace("_","-")],title:tm("abnormalValue","Abnormal value")})]}),(0,rG.jsxs)("div",{className:uj["value-container"],children:[(0,rG.jsx)("span",{id:h,"aria-labelledby":g&&w?`${g} ${w}`:g||w||void 0,className:uj.value,children:y}),_&&t&&(0,rG.jsx)("span",{id:w,className:uj.units,children:t})]})]})},uN="-esm-implementer-tools__page-header-module__pageHeader___YOpQL",uC=e=>{if("children"in e){let{children:t,className:n,...o}=e;return(0,rG.jsx)("div",{className:sL()(uN,n),...o,children:t})}{let{title:t,illustration:n,className:o,...r}=e;return(0,rG.jsx)("div",{className:sL()(uN,o),...r,children:(0,rG.jsx)(uE,{title:t,illustration:n})})}},uE=({title:e,illustration:t,className:n})=>{let[o,r]=(0,rF.useState)(null);return(0,rF.useEffect)(()=>{eM("@openmrs/esm-styleguide").then(e=>{r(e)})},[]),(0,rG.jsxs)("div",{className:sL()("-esm-implementer-tools__page-header-module__pageHeaderContent___PjsJm",n),children:[t,(0,rG.jsxs)("div",{className:"-esm-implementer-tools__page-header-module__pageLabels___pPcKj",children:[o?.implementationName&&(0,rG.jsx)("p",{children:tm(o.implementationName)}),(0,rG.jsx)("h1",{className:"-esm-implementer-tools__page-header-module__pageName___3d4IC",children:e})]})]})},uP=({totalItems:e,pageSize:t,onPageNumberChange:n,pageNumber:o,dashboardLinkUrl:r,currentItems:i,dashboardLinkLabel:s})=>{let{pageSizes:a,pageItemsCount:l}=sa(t,e,o,i),c="tablet"===i3(),u=tm("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,rG.jsx)(rG.Fragment,{children:e>0&&(0,rG.jsxs)("div",{className:sL()({"-esm-implementer-tools__pagination-module__tablet___lQ3ak":c,"-esm-implementer-tools__pagination-module__desktop___HfUTY":!c}),children:[(0,rG.jsxs)("div",{children:[u,r&&(0,rG.jsx)(rz,{to:r,className:"-esm-implementer-tools__pagination-module__configurableLink___NM9v7",children:s??tm("seeAll","See all")})]}),(0,rG.jsx)(sF.Pagination,{className:"-esm-implementer-tools__pagination-module__pagination___WzkBs",page:o,pageSize:t,pageSizes:a,totalItems:e,onChange:n,pageRangeText:(e,t)=>tm("paginationOfPages","of {{count}} pages",{count:t}),size:c?"lg":"sm"})]})})};function uI(e){return uA(uT(e,"usual","official"))}function uO(e){return uI(e)}function uA(e){var t;let n;return e?e.text??(n=(t=e).given??[],(t.family?n.concat(t.family):n).join(" ")):""}function uR(e){return uA(e)}function uT(e,...t){for(let n of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,o;return t=e,o=n,t.use?t.use===o:"usual"===o});if(t)return t}}function u$(e,t=sf()){let n=sf(t),o=ca(e,n);if(null==o)return null;let r=n.diff(o,"hours"),i=n.diff(o,"days"),s=n.diff(o,"weeks"),a=n.diff(o,"months"),l=n.diff(o,"years"),c={};if(r<2)c.minutes=n.diff(o,"minutes");else if(i<2)c.hours=r;else if(s<4)c.days=i;else if(l<1){let e=n.subtract(s,"weeks").diff(o,"days");c.weeks=s,c.days=e}else if(l<2){let e=n.subtract(a,"months").diff(o,"days");c.months=a,c.days=e}else if(l<18){let e=n.subtract(l,"year").diff(o,"months");c.years=l,c.months=e}else c.years=l;return c}function uM(e,t=sf()){let n=u$(e,t);if(null==n)return null;let o={style:"short",localeMatcher:"lookup"};return"minutes"in n&&0===n.minutes&&(o.minutesDisplay="always"),cs(n,o)}let uL={container:"-esm-implementer-tools__patient-banner-patient-info-module__container___Gjd-4",activePatientContainer:"-esm-implementer-tools__patient-banner-patient-info-module__activePatientContainer___QLcpg",patientBanner:"-esm-implementer-tools__patient-banner-patient-info-module__patientBanner___7nrgC",patientName:"-esm-implementer-tools__patient-banner-patient-info-module__patientName___-bF9a",patientAvatar:"-esm-implementer-tools__patient-banner-patient-info-module__patientAvatar___AkN3H",patientAvatarButton:"-esm-implementer-tools__patient-banner-patient-info-module__patientAvatarButton___KDxA6",patientInfo:"-esm-implementer-tools__patient-banner-patient-info-module__patientInfo___+WtDB",demographics:"-esm-implementer-tools__patient-banner-patient-info-module__demographics___Vtf3v",row:"-esm-implementer-tools__patient-banner-patient-info-module__row___NIOYI",flexRow:"-esm-implementer-tools__patient-banner-patient-info-module__flexRow___VxdGB",tagsSlot:"-esm-implementer-tools__patient-banner-patient-info-module__tagsSlot___lU6+4",identifiers:"-esm-implementer-tools__patient-banner-patient-info-module__identifiers___tehd8",identifier:"-esm-implementer-tools__patient-banner-patient-info-module__identifier___bSJIF",primaryIdentifier:"-esm-implementer-tools__patient-banner-patient-info-module__primaryIdentifier___yOV1B",secondaryIdentifier:"-esm-implementer-tools__patient-banner-patient-info-module__secondaryIdentifier___WvJbh",value:"-esm-implementer-tools__patient-banner-patient-info-module__value___sBM-q",tag:"-esm-implementer-tools__patient-banner-patient-info-module__tag___BEvEV",gender:"-esm-implementer-tools__patient-banner-patient-info-module__gender___4XkLq",separator:"-esm-implementer-tools__patient-banner-patient-info-module__separator___iYBA3",tooltipPadding:"-esm-implementer-tools__patient-banner-patient-info-module__tooltipPadding___EWVCK",tooltipSmallText:"-esm-implementer-tools__patient-banner-patient-info-module__tooltipSmallText___yDmRU",actionsButtonText:"-esm-implementer-tools__patient-banner-patient-info-module__actionsButtonText___mn139"};function uW({showIdentifierLabel:e,type:t,value:n}){return(0,rG.jsx)("span",{className:uL.primaryIdentifier,children:(0,rG.jsxs)(sF.Tag,{className:uL.tag,type:"gray",children:[e&&t?.text&&(0,rG.jsxs)("span",{className:uL.label,children:[t.text,": "]}),(0,rG.jsx)("span",{className:uL.value,children:n})]})})}function uD({showIdentifierLabel:e,type:t,value:n}){return(0,rG.jsxs)(sF.FormLabel,{className:uL.secondaryIdentifier,id:`patient-banner-identifier-${n}`,children:[e&&(0,rG.jsxs)("span",{className:uL.label,children:[t?.text,": "]}),(0,rG.jsx)("span",{className:uL.value,children:n})]})}function uU({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:n}=iT(),{primaryIdentifierCode:o}=su(),r=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!n?.uuids.includes(t)})??[];return(0,rG.jsx)(rG.Fragment,{children:r?.length?r.map(({value:e,type:n},i)=>(0,rG.jsxs)(rH().Fragment,{children:[(0,rG.jsx)("span",{className:uL.identifier,children:n?.coding?.[0]?.code===o?(0,rG.jsx)(uW,{showIdentifierLabel:t,type:n,value:e}):(0,rG.jsx)(uD,{showIdentifierLabel:t,type:n,value:e})}),i<r.length-1&&(0,rG.jsx)("span",{className:uL.separator,children:"\xb7"})]},e)):""})}let uB={Female:aj,Male:ak,Other:aN,Unknown:aC},uF=({gender:e})=>{let t=uB[e];return t?(0,rG.jsx)(t,{fill:"#525252"}):null},uH={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function uV({patient:e,renderedFrom:t}){var n;let o,r,i=uI(e),s=e?.gender&&(r=uH[o=(n=e.gender).toLowerCase()]??"Unknown",{displayText:tm(o,n),iconKey:r}),a=(0,rF.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,rG.jsxs)("div",{className:uL.patientInfo,children:[(0,rG.jsx)("div",{className:sL()(uL.row,uL.patientNameRow),children:(0,rG.jsxs)("div",{className:uL.flexRow,children:[(0,rG.jsx)("span",{className:uL.patientName,children:i}),s&&(0,rG.jsxs)("div",{className:uL.gender,children:[(0,rG.jsx)(uF,{gender:s.iconKey}),(0,rG.jsx)("span",{children:s.displayText})]}),(0,rG.jsx)(r3,{className:uL.tagsSlot,name:"patient-banner-tags-slot",state:a})]})}),(0,rG.jsxs)("div",{className:uL.demographics,children:[e.birthDate&&(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("span",{children:uM(e.birthDate)}),(0,rG.jsx)("span",{className:uL.separator,children:"\xb7"}),(0,rG.jsx)("span",{children:ce(e.birthDate,{time:!1})}),(0,rG.jsx)("span",{className:uL.separator,children:"\xb7"})]}),(0,rG.jsx)(uU,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,rG.jsx)(r3,{className:uL.extensionSlot,name:"patient-banner-bottom-slot",state:a})]})]})}var uG=n(7683);function uz({patient:e,patientUuid:t,actionsSlotName:n,additionalActionsSlotState:o}){let[r,i]=(0,rF.useState)(!1),{extensions:s}=r8(n),a="tablet"===i3(),l=so(()=>i(!1),r),c=(0,rF.useRef)(null),u=(0,rF.useRef)(null),d=(0,rF.useId)(),m=`patient-actions-menu-trigger-${d}`,p=`patient-actions-menu-${d}`,f=(0,rF.useCallback)(()=>i(e=>!e),[]),g=(0,rF.useCallback)(()=>{i(!1),c.current?.focus()},[]),h=(0,rF.useCallback)(e=>{if("Escape"===e.key&&r){e.stopPropagation(),g();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&r){e.preventDefault();let t=u.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,o=Array.from(t).indexOf(n);if(-1===o)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let r=o+("ArrowDown"===e.key?1:-1),i=r<0?t.length-1:r>=t.length?0:r;t[i]?.focus()}},[g,r]);(0,rF.useEffect)(()=>{if(r&&u.current){let e=u.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[r]);let w=(0,rF.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:g,...o}),[t,e,g,o]);return 0===s.length?null:(0,rG.jsx)("div",{className:"-esm-implementer-tools__patient-banner-actions-menu-module__overflowMenuContainer___lXHHD",children:(0,rG.jsxs)("div",{"data-overflow-menu":!0,className:sL()("cds--overflow-menu",sG),ref:l,children:[(0,rG.jsxs)("button",{className:sL()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":r},sJ),"aria-controls":p,"aria-expanded":r,"aria-haspopup":"true",id:m,onClick:f,onKeyDown:h,ref:c,children:[(0,rG.jsx)("span",{className:"-esm-implementer-tools__patient-banner-actions-menu-module__actionsButtonText___SdOyM",children:tm("actions","Actions")})," ",(0,rG.jsx)(uG.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,rG.jsxs)("div",{className:sL()("cds--overflow-menu-options","cds--overflow-menu--flip",sz,{[sq]:r}),"aria-labelledby":m,"data-floating-menu-direction":"bottom",id:p,onKeyDown:h,ref:u,role:"menu",tabIndex:-1,children:[(0,rG.jsx)("ul",{className:sL()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":a}),children:(0,rG.jsx)(r3,{name:n,state:w},n)}),(0,rG.jsx)("span",{})]})]})})}var uq=n(397),uJ=n.n(uq);function uK(e){let{patientPhotoConceptUuid:t}=iT({externalModuleName:"@openmrs/esm-styleguide"}),n=t?`${tk}/obs?patient=${e}&concept=${t}&v=full`:null,{data:o,error:r,isLoading:i}=ir()(e?n:null,tP),s=o?.data?.results[0];return{data:s?{dateTime:s?.obsDatetime,imageSrc:s?.value?.links?.uri}:null,error:r,isLoading:i}}let uX=({width:e=56,height:t=56,"aria-label":n})=>{let{t:o}=(0,it.useTranslation)();return(0,rG.jsxs)("svg",{"aria-label":n??o("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,rG.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,rG.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"})]})},uY="-esm-implementer-tools__patient-photo-module__avatar___t5TmZ";function uZ({patientUuid:e,patientName:t,alt:n}){let{data:o,isLoading:r}=uK(e),[i,s]=(0,rF.useState)(null),[a,l]=(0,rF.useState)(!1),c=(0,rF.useMemo)(()=>uJ().generate(e),[e]);(0,rF.useEffect)(()=>{if(o?.imageSrc){let e=new URL(o.imageSrc,window.location.origin).pathname;l(!0);let t=!1,n=new Image;return n.onload=()=>{t||(s(e),l(!1))},n.onerror=()=>{t||(s(null),l(!1))},n.src=e,()=>{t=!0}}s(null),l(!1)},[o?.imageSrc]);let u=(0,rF.useMemo)(()=>n||(i?tm("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):tm("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[n,i,t]);return r||a?(0,rG.jsx)(sF.SkeletonIcon,{className:"-esm-implementer-tools__patient-photo-module__skeleton___ueN8Q","data-testid":"skeleton-icon"}):o?.imageSrc&&!i?(0,rG.jsx)(uX,{"aria-label":tm("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):i?(0,rG.jsx)("div",{"aria-label":u,children:(0,rG.jsx)("img",{className:uY,src:i,alt:u,title:t})}):(0,rG.jsx)("div",{"aria-label":u,children:(0,rG.jsx)("div",{className:uY,title:t,style:{backgroundImage:c.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,rG.jsx)("span",{className:"-esm-implementer-tools__patient-photo-module__initials___-k9Hv",children:function(e,t=3){return e.split(/\s+/).filter(Boolean).slice(0,t).map(e=>e[0]).join("")}(t)})})})}let uQ=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-cohorts","omrs-pict-concept-dictionary","omrs-pict-ct-scan","omrs-pict-data-entry","omrs-pict-dentistry","omrs-pict-digital-trust","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-metadata-export","omrs-pict-obstetrics","omrs-pict-patient-documents","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-reports","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-system-administration","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],u0=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),u1=u0,u2=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),u5=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),u6=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),u8=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),u4=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-cohorts",pictogramProps:e})})),u3=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-concept-dictionary",pictogramProps:e})})),u7=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),u9=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-data-entry",pictogramProps:e})})),de=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),dt=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),dn=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),dr=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),di=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),ds=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),da=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),dl=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),dc=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),du=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-metadata-export",pictogramProps:e})})),dd=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),dm=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-patient-documents",pictogramProps:e})})),dp=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),df=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),dg=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),dh=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),dw=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),d_=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),dy=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-reports",pictogramProps:e})})),dv=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),db=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),dx=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-system-administration",pictogramProps:e})})),dS=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),dj=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),dk=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),dN=dr,dC=df,dE=(0,rF.memo)((0,rF.forwardRef)(function({pictogram:e,fallback:t,...n},o){let r=(0,rF.useRef)(document.getElementById(e));return(0,rF.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(r.current=document.getElementById(e))});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,rG.jsx)(iS,{value:r.current,fallback:t,children:(0,rG.jsx)(dP,{ref:o,pictogram:e,pictogramProps:n})})})),dP=(0,rF.memo)((0,rF.forwardRef)(function({pictogram:e,pictogramProps:t},n){let{className:o,size:r}=Object.assign({},{size:92},t);return(r<=26||r>144)&&(console.error(`Invalid size '${r}' specified for ${e}. Defaulting to 92.`),r=92),(0,rG.jsx)("svg",{ref:n,className:sL()("-esm-implementer-tools__pictograms-module__pictogram___wXX7t",o),height:r,width:r,children:(0,rG.jsx)("use",{href:`#${e}`})})})),dI=({children:e})=>"tablet"===i3()?(0,rG.jsx)(sF.Layer,{children:e}):(0,rG.jsx)(rG.Fragment,{children:e}),dO=({snackbar:e,closeSnackbar:t})=>{let{actionButtonLabel:n="",kind:o="success",onActionButtonClick:r=()=>{},isLowContrast:i="error"!==o,progressActionLabel:s,subtitle:a="",timeoutInMs:l=5e3,autoClose:c="error"!==o,title:u,id:d,...m}=e,[p,f]=(0,rF.useState)(n),[g,h]=(0,rF.useState)(!0),[w,_]=(0,rF.useState)(!1),y=(0,rF.useCallback)(()=>{setTimeout(t,250)},[t]),v=(0,rF.useCallback)(()=>{_(!0),y()},[y]);return(0,rF.useEffect)(()=>{if(c){let e=setTimeout(v,l);return()=>clearTimeout(e)}},[l,c,v]),(0,rF.useEffect)(()=>{h(!1),window.setTimeout(()=>{h(!0)},0)},[]),(0,rG.jsx)(sF.ActionableNotification,{actionButtonLabel:p,"aria-label":tm("closeSnackbar","Close snackbar"),className:sL()("-esm-implementer-tools__snackbar-module__slideIn___-oZIt",{"-esm-implementer-tools__snackbar-module__animated___M2YBU":g,"-esm-implementer-tools__snackbar-module__slideOut___yEmGT":w}),kind:o,lowContrast:i,onActionButtonClick:()=>{r(),v(),s&&f(s)},onClose:y,statusIconDescription:tm("snackbarNotification","Snackbar notification"),subtitle:a,title:u,...m})},dA=({subject:e})=>{let[t,n]=(0,rF.useState)([]),o=(0,rF.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,rF.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsx)(dO,{snackbar:e,closeSnackbar:()=>o(e)},e.id))})},dR=new up,dT=0;function d$(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(dA,{subject:dR}))}function dM(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{dR.next({...e,id:dT++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let dL=({toast:e,closeToast:t})=>{let{description:n,kind:o,critical:r,title:i,actionButtonLabel:s,onActionButtonClick:a=()=>{}}=e,l=(0,rF.useCallback)(()=>{a(),t()},[t,a]);return(0,rG.jsx)("div",{children:(0,rG.jsx)(sF.ActionableNotification,{actionButtonLabel:s,kind:o||"info",lowContrast:r,subtitle:n,title:i||"",onActionButtonClick:l,onClose:t})})},dW=({subject:e})=>{let[t,n]=(0,rF.useState)([]),o=(0,rF.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,rF.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.kind!==e.kind||t.title!==e.title||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick),e]));return()=>t.unsubscribe()},[e]),(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsx)(dL,{toast:e,closeToast:()=>o(e)},e.id))})},dD=new up,dU=0;function dB(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(dW,{subject:dD}))}function dF(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!(0,ul.A)(t))?setTimeout(()=>{dD.next({...e,id:dU++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}var dH=n(4656);async function dV(e,t){let{openedGroup:n}=rC.getState();if(n){if(n.groupName===e&&dq(n.props,t))return!0;else if(!await dX({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return rC.setState(n=>({...n,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function dG(e){let{openedGroup:t,openedWindows:n}=rC.getState();if(t){if(n.length>0&&!(e||await dX({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;rC.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function dz(e,t=null,n=null,o=null){let r=rC.getState();if(!r.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let i=rE(e);if(!i)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:s}=r,{name:a}=i,l=rP(a);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${i.name} is not registered to a workspace group`);let c=rI(e);if(s&&(s.groupName!==l.name||!dq(s.props,o)))return!!await dX({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(rC.setState({...r,openedGroup:{groupName:l.name,props:o},openedWindows:[{windowName:a,openedWorkspaces:[d3(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(c>=0){let o=r.openedWindows[c],i=r.openedGroup?.props??{},s=r.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:u}=o;if(dq(o.props,n)){let d=u.find(t=>t.workspaceName===e);return d&&dq(d.props,t)?((s||c!==r.openedWindows.length-1)&&rC.setState(d2.restoreWindow(r,a)),!0):!!await dX({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:a,workspaceName:e})&&(rC.setState({...r,openedGroup:{groupName:l.name,props:r?.openedGroup?.props??i},openedWindows:[...r.openedWindows.filter((e,t)=>t!==c),{windowName:a,openedWorkspaces:[d3(e,t)],props:o?.props??n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await dX({reason:"CLOSE_WINDOW",explicit:!1,windowName:a})&&(rC.setState({...r,openedGroup:{groupName:l.name,props:i??r?.openedGroup?.props},openedWindows:[...r.openedWindows.filter((e,t)=>t!==c),{windowName:a,openedWorkspaces:[d3(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(rC.setState({...r,openedGroup:{groupName:l.name,props:o??r?.openedGroup?.props??null},openedWindows:[...r.openedWindows,{windowName:a,openedWorkspaces:[d3(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await dX({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:i.name})&&(rC.setState({...r,openedGroup:{groupName:l.name,props:o??r?.openedGroup?.props??null},openedWindows:[{windowName:a,openedWorkspaces:[d3(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function dq(e,t){return null==e||null==t||x(e,t)}function dJ(e,t){let n=[];for(let o=e.openedWorkspaces.length-1;o>=0;o--){let r=e.openedWorkspaces[o];if(r.hasUnsavedChanges&&n.push(r),t&&r.workspaceName===t)break}return n}function dK(e){return 0===e.length?Promise.resolve(!0):new Promise(t=>{let n=ua("workspace2-close-prompt",{size:"sm",onConfirm:()=>{n(),t(!0)},onCancel:()=>{n(),t(!1)},affectedWorkspaceTitles:e.map(e=>e.title??"")})})}function dX(e){let{openedWindows:t}=rC.getState(),n=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":n=t.flatMap(e=>dJ(e));break;case"CLOSE_WINDOW":{let o=t.find(t=>t.windowName===e.windowName);if(!o)throw Error(`Window ${e.windowName} not found in opened windows.`);n=dJ(o);break}case"CLOSE_WORKSPACE":{let o=t.find(t=>t.windowName===e.windowName);if(!o)throw Error(`Window ${e.windowName} not found in opened windows.`);n=dJ(o,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":n=t.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>dJ(e))}return dK(n)}function dY(e,t){return dK(dJ(e,t))}function dZ(e,t){let n=e.openedWorkspaces.findIndex(e=>e.workspaceName===t);return n<0?e:0===n?null:{...e,openedWorkspaces:e.openedWorkspaces.slice(0,n)}}function dQ(e,t,n,o){let{registeredWorkspacesByName:r}=rC.getState(),i=r[n];if(!i)throw Error(`No workspace named "${n}" registered`);let s=r[t];if(!s)throw Error(`No workspace named "${t}" registered`);if(s.window!==i.window)throw Error(`Child workspace ${n} does not belong to the same workspace window as parent workspace ${t}`);if(i.window!==e.windowName)throw Error(`Cannot open child workspace ${n} as window ${i.window} is not opened`);let{openedWorkspaces:a}=e,l=a.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${n} from parent workspace ${t} as the parent is not opened within the workspace window`);let c=a.slice(0,l+1);return{...e,openedWorkspaces:[...c,d3(n,o)]}}function d0(e,t,n){let o=e.openedWorkspaces.findIndex(e=>e.uuid===t);if(o<0)return e;let r=e.openedWorkspaces[o];if(Object.keys(n).every(e=>r[e]===n[e]))return e;let i=[...e.openedWorkspaces];return i[o]={...r,...n},{...e,openedWorkspaces:i}}function d1(e,t,n){let o=e.openedWindows.findIndex(e=>e.openedWorkspaces.some(e=>e.uuid===t));if(o<0)return e;let r=e.openedWindows[o],i=d0(r,t,n);if(i===r)return e;let s=[...e.openedWindows];return s[o]=i,{...e,openedWindows:s}}let d2={setWindowMaximized(e,t,n){let o=e.openedWindows.findIndex(e=>e.windowName===t),r=[...e.openedWindows],i={...r[o],maximized:n};return r[o]=i,{...e,openedWindows:r}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let n=e.openedWindows.findIndex(e=>e.windowName===t),o=e.openedWindows[n],r=[...e.openedWindows.filter((e,t)=>t!==n),o];return{...e,openedWindows:r,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let n=e.openedWindows.findIndex(e=>e.openedWorkspaces.some(e=>e.workspaceName===t));if(n<0)return e;let o=dZ(e.openedWindows[n],t),r=[...e.openedWindows],i=e.isMostRecentlyOpenedWindowHidden;if(null===o){let t=n===e.openedWindows.length-1;r.splice(n,1),t&&r.length>0&&(i=!1)}else r[n]=o;return{...e,openedWindows:r,isMostRecentlyOpenedWindowHidden:i}},openChildWorkspace(e,t,n,o){let r=e.registeredWorkspacesByName[n];if(!r)throw Error(`No workspace named "${n}" registered`);let i=e.openedWindows.findIndex(e=>e.windowName===r.window);if(-1==i)throw Error(`Cannot open child workspace ${n} as window ${r.window} is not opened`);let s=[...e.openedWindows];return s[i]=dQ(e.openedWindows[i],t,n,o),{...e,openedWindows:s}},setHasUnsavedChanges:(e,t,n)=>d1(e,t,{hasUnsavedChanges:n}),setWorkspaceTitle:(e,t,n)=>d1(e,t,{title:n})};function d5(){return rZ(rC,d2)}let d6=()=>(0,rF.useContext)(ie.i),d8=()=>Object.keys(rC.getState().registeredWorkspacesByName);function d4(e,t,n){let o=e.openedWorkspaces[e.openedWorkspaces.length-1];return(o?t[o.workspaceName]?.width:void 0)??n[e.windowName]?.width??"narrow"}function d3(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:(0,dH.A)()}}function d7(e,t,n){let o=rC.getState().registeredWorkspacesByName[e];return o?{windowName:o.window,openedWorkspaces:[d3(e,t)],props:n??null,maximized:!1}:null}let d9=({title:e,children:t,hasUnsavedChanges:n=!1})=>{let{setHasUnsavedChanges:o,setWorkspaceTitle:r}=d6();return(0,rF.useEffect)(()=>{o(n??!1)},[n,o]),(0,rF.useEffect)(()=>{r(e)},[e,r]),(0,rG.jsx)(rG.Fragment,{children:t})};var me=n(1820),mt=n(3173),mn=n(185);let mo={workspaceOuterContainer:"-esm-implementer-tools__workspace2-module__workspaceOuterContainer___bPVpy",narrowWorkspace:"-esm-implementer-tools__workspace2-module__narrowWorkspace___kSYS7",widerWorkspace:"-esm-implementer-tools__workspace2-module__widerWorkspace___nW2HB",extraWideWorkspace:"-esm-implementer-tools__workspace2-module__extraWideWorkspace___em5yA",workspaceMiddleContainer:"-esm-implementer-tools__workspace2-module__workspaceMiddleContainer___Bx1i6",maximized:"-esm-implementer-tools__workspace2-module__maximized___Kfygr",hidden:"-esm-implementer-tools__workspace2-module__hidden___RPimX",workspaceInnerContainer:"-esm-implementer-tools__workspace2-module__workspaceInnerContainer___5zxpt",workspaceSpacer:"-esm-implementer-tools__workspace2-module__workspaceSpacer___E+982",loader:"-esm-implementer-tools__workspace2-module__loader___vmBQn",hiddenExtraWorkspace:"-esm-implementer-tools__workspace2-module__hiddenExtraWorkspace___qkbMG",header:"-esm-implementer-tools__workspace2-module__header___IZ-2+",headerButtons:"-esm-implementer-tools__workspace2-module__headerButtons___81a2N",workspaceContent:"-esm-implementer-tools__workspace2-module__workspaceContent___eetPy",overlayHeaderSpacer:"-esm-implementer-tools__workspace2-module__overlayHeaderSpacer___ruc6r",isActionMenuOpened:"-esm-implementer-tools__workspace2-module__isActionMenuOpened___XgCkc",showActionMenu:"-esm-implementer-tools__workspace2-module__showActionMenu___sHRt1",marginWorkspaceContent:"-esm-implementer-tools__workspace2-module__marginWorkspaceContent___TN+S+",workspaceContainerWithActionMenu:"-esm-implementer-tools__workspace2-module__workspaceContainerWithActionMenu___xLg8e",workspaceFixedContainer:"-esm-implementer-tools__workspace2-module__workspaceFixedContainer___W9cgZ",workspaceContainerWithoutActionMenu:"-esm-implementer-tools__workspace2-module__workspaceContainerWithoutActionMenu___fRrxd"},mr=e=>e.registeredWorkspacesByName,mi=({lifeCycle:e,openedWorkspace:t,openedWindow:n,groupProps:o,actions:r,renderChrome:i,isRootWorkspace:s,isLeafWorkspace:a,showActionMenu:l})=>{let c=(0,rF.useMemo)(()=>t&&{closeWorkspace:async(e={})=>{let{closeWindow:o=!1,discardUnsavedChanges:i=!1}=e;return o?!!(i||await r.promptForClosingWorkspaces())&&(r.closeWorkspace(n.openedWorkspaces[0].workspaceName),!0):!!(i||await r.promptForClosingWorkspaces(t.workspaceName))&&(r.closeWorkspace(t.workspaceName),!0)},launchChildWorkspace:async(e,o)=>{let i=t.workspaceName,{openedWorkspaces:s}=n,a=s.findIndex(e=>e.workspaceName===i);-1===a||a!==s.length-1&&s.slice(a+1).some(e=>e.hasUnsavedChanges)&&!await r.promptForClosingWorkspaces(s[a+1].workspaceName)||r.openChildWorkspace(i,e,o||{})},setWorkspaceTitle:e=>r.setWorkspaceTitle(t.uuid,e),setHasUnsavedChanges:e=>r.setHasUnsavedChanges(t.uuid,e),workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:n.props,groupProps:o,workspaceMeta:rC.getState().registeredWorkspacesByName[t.workspaceName]?.meta??{},isRootWorkspace:s,isLeafWorkspace:a,windowName:n.windowName,showActionMenu:l},[t,n,o,r,s,a,l]),u=!i&&!a,d=(0,rF.useMemo)(()=>e?(0,rG.jsx)(me.A,{config:e,mountParcel:rU,wrapWith:"div",wrapClassName:sL()(mo.workspaceContent,{[mo.hiddenExtraWorkspace]:u}),...c},t.workspaceName):null===e?(0,rG.jsx)("div",{className:sL()(mo.workspaceContent,{[mo.hiddenExtraWorkspace]:u}),children:(0,rG.jsx)(sF.InlineNotification,{kind:"error",title:tm("error"),subtitle:tm("somethingWentWrongTryReloading"),hideCloseButton:!0})}):null,[e,t.workspaceName,c,u]);return i?(0,rG.jsx)("div",{children:(0,rG.jsx)(ms,{openedWorkspace:t,openedWindow:n,isRootWorkspace:s,showActionMenu:l,closeWindow:()=>c.closeWorkspace({closeWindow:!0}),children:d})}):d??(0,rG.jsx)(sF.InlineLoading,{className:sL()(mo.loader,{[mo.hiddenExtraWorkspace]:u}),description:`${tm("loading")}`})},ms=({openedWorkspace:e,openedWindow:t,isRootWorkspace:n,showActionMenu:o,closeWindow:r,children:i})=>{let s=i3(),{openedGroup:a,openedWindows:l,registeredWindowsByName:c,registeredWorkspacesByName:u,registeredGroupsByName:d,isMostRecentlyOpenedWindowHidden:m,setWindowMaximized:p,hideWindow:f}=d5(),g=t.windowName,{maximized:h}=t,w=e.title??"",_=c[g],y=d4(t,u,c),v=_?.icon,b=_?.canMaximize,x=!!a&&d[a.groupName]?.persistence==="closable",S=!!v&&!x,j=l.findIndex(e=>e.windowName===g)<l.length-1||m,k=Object.values(c).some(e=>e.group===a?.groupName&&void 0!==e.icon);return(0,rG.jsxs)("div",{className:sL()(mo.workspaceOuterContainer,{[mo.narrowWorkspace]:"narrow"===y,[mo.widerWorkspace]:"wider"===y,[mo.extraWideWorkspace]:"extra-wide"===y,[mo.isActionMenuOpened]:k}),children:[(0,rG.jsx)("div",{className:sL()(mo.workspaceSpacer,{[mo.hidden]:j})}),(0,rG.jsx)("div",{className:sL()(mo.workspaceMiddleContainer,{[mo.maximized]:h,[mo.hidden]:j,[mo.isRootWorkspace]:n,[mo.showActionMenu]:o}),children:(0,rG.jsx)("div",{className:sL()(mo.workspaceInnerContainer,{[mo.maximized]:h,[mo.hidden]:j,[mo.isRootWorkspace]:n}),children:i?(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsxs)(sF.Header,{"aria-label":tm("workspaceHeader"),className:mo.header,children:[(0,rG.jsx)(sF.HeaderName,{prefix:"",children:w}),(0,rG.jsx)("div",{className:mo.overlayHeaderSpacer}),(0,rG.jsx)(sF.HeaderGlobalBar,{className:mo.headerButtons,children:i7(s)?(0,rG.jsxs)(rG.Fragment,{children:[(b||h)&&(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":h?tm("minimize"):tm("maximize"),onClick:()=>p(g,!h),children:h?(0,rG.jsx)(mt.Xj,{}):(0,rG.jsx)(mt.hz,{})}),S&&(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":tm("hide"),onClick:()=>f(),children:(0,rG.jsx)(s4,{})}),!x&&(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":tm("close"),onClick:r,children:(0,rG.jsx)(af,{})})]}):(0,rG.jsxs)(rG.Fragment,{children:[S&&(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":tm("hide"),onClick:()=>f(),children:(0,rG.jsx)(mn.d3,{})}),(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":tm("close"),onClick:()=>{x?dG():r()},children:(0,rG.jsx)(af,{})})]})})]}),i]}):(0,rG.jsx)(sF.InlineLoading,{className:mo.loader,description:`${tm("loading")} ...`})})})]})},ma=({openedWindow:e,groupProps:t,actions:n,renderChrome:o,showActionMenu:r})=>{let{openedWorkspaces:i}=e,[s,a]=(0,rF.useState)({}),l=rY(rC,mr),c=(0,rF.useRef)(new Set);return(0,rF.useEffect)(()=>{let e=!1;return Promise.all(i.map(async t=>{let n=l[t.workspaceName];if(!n)return null;let{moduleName:o,component:r}=n;try{return[t.uuid,await sk(o,r)]}catch(n){return e||c.current.has(t.uuid)||(c.current.add(t.uuid),y(n)),[t.uuid,null]}})).then(t=>{e||a(Object.fromEntries(t.filter(e=>null!=e)))},y),()=>{e=!0}},[i,l]),(0,rG.jsx)(rG.Fragment,{children:i.map((a,l)=>(0,rG.jsx)(mi,{openedWorkspace:a,openedWindow:e,groupProps:t,actions:n,renderChrome:o,lifeCycle:s[a.uuid],isRootWorkspace:0===l,isLeafWorkspace:l===i.length-1,showActionMenu:r},a.uuid))})},ml=e=>e.registeredWorkspacesByName,mc=({name:e,workspaceProps:t,windowProps:n,groupProps:o,onWindowChanged:r})=>{let i=rY(rC,ml),s=rY(rC,t=>{let n=t.registeredWorkspacesByName[e]?.window;return n?t.registeredWindowsByName[n]:void 0}),a={name:e,workspaceProps:t,windowProps:n,groupProps:o},l=(0,rF.useRef)(),c=(0,rF.useRef)(null);if(!l.current){let r=d7(e,t,n);l.current=T({openedWindow:r,groupProps:o??null}),r&&(c.current=a)}let u=l.current;(0,rF.useEffect)(()=>{let r=c.current;if(r&&r.name===e&&x(r.workspaceProps,t)&&x(r.windowProps,n)&&x(r.groupProps,o))return;let i=d7(e,t,n);u.setState({openedWindow:i,groupProps:o??null},!0),c.current=i?a:null},[e,t,n,o,i,u]);let d=(0,rF.useMemo)(()=>(function(e){function t(t){e.setState(e=>{if(!e.openedWindow)return e;let n=t(e.openedWindow);return n===e.openedWindow?e:{...e,openedWindow:n}})}return{closeWorkspace(e){t(t=>dZ(t,e))},openChildWorkspace(e,n,o){t(t=>dQ(t,e,n,o))},setWorkspaceTitle(e,n){t(t=>d0(t,e,{title:n}))},setHasUnsavedChanges(e,n){t(t=>d0(t,e,{hasUnsavedChanges:n}))},promptForClosingWorkspaces(t){let{openedWindow:n}=e.getState();return n?dY(n,t):Promise.resolve(!0)}}})(u),[u]),{openedWindow:m,groupProps:p}=rY(u),f=m?.openedWorkspaces[m.openedWorkspaces.length-1],g=f?.workspaceName??null,h=f?.title??"",w=m?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,_=s?.width??"narrow",y=(0,rF.useRef)(r);return(0,rF.useEffect)(()=>{y.current=r}),(0,rF.useEffect)(()=>{y.current?.({workspaceName:g,windowWidth:_,title:h,hasUnsavedChanges:w})},[g,_,h,w]),(0,rG.jsx)("div",{className:"-esm-implementer-tools__exported-workspace-module__exportedWorkspace___7PE0H",children:m?(0,rG.jsx)(ma,{openedWindow:m,groupProps:p,actions:d,renderChrome:!1,showActionMenu:!1}):null})},mu="-esm-implementer-tools__action-menu-button2-module__container___jc6--",md="-esm-implementer-tools__action-menu-button2-module__elementContainer___whLL8",mm="-esm-implementer-tools__action-menu-button2-module__active___fbyFm",mp="-esm-implementer-tools__action-menu-button2-module__focused___+aVpz";function mf({getIcon:e,hasUnsavedChanges:t,tagContent:n}){return(0,rG.jsxs)(rG.Fragment,{children:[e({size:16}),t?(0,rG.jsx)("span",{className:"-esm-implementer-tools__action-menu-button2-module__interruptedTag___sRkvS",children:"!"}):(0,rG.jsx)("span",{className:"-esm-implementer-tools__action-menu-button2-module__countTag___XMH0D",children:n})]})}let mg=({icon:e,label:t,tagContent:n,workspaceToLaunch:o,onBeforeWorkspaceLaunch:r,hidden:i,disabled:s})=>{let a=i3(),{openedWindows:l,restoreWindow:c,hideWindow:u,isMostRecentlyOpenedWindowHidden:d}=d5(),{extension:m}=(0,rF.useContext)(rV),p=l.findIndex(e=>e.windowName===m?.extensionId),f=l[p],g=null!=f,h=g&&(p<l.length-1||d),w=g&&!h,_=f?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,y=async()=>{if(g)h?c(f.windowName):u();else if(await (r?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:n}=o;dz(e,t,n)}};return i?.(l)?null:"tablet"===a||"phone"===a?(0,rG.jsxs)(sF.Button,{className:sL()(mu,{[mm]:g&&!w,[mp]:w}),iconDescription:t,kind:"ghost",onClick:y,role:"button",tabIndex:0,size:"md",disabled:s?.(l),children:[(0,rG.jsx)("span",{className:md,children:(0,rG.jsx)(mf,{hasUnsavedChanges:_,getIcon:e,tagContent:n})}),(0,rG.jsx)("span",{children:t})]}):(0,rG.jsx)(sF.IconButton,{align:"left","aria-label":t,className:sL()(mu,{[mm]:g&&!w,[mp]:w}),enterDelayMs:300,kind:"ghost",label:t,onClick:y,size:"md",disabled:s?.(l),children:(0,rG.jsx)("div",{className:md,children:(0,rG.jsx)(mf,{hasUnsavedChanges:_,getIcon:e,tagContent:n})})})};function mh({showContactDetails:e,toggleContactDetails:t,className:n}){return(0,rG.jsx)(sF.Button,{className:n,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?ap:au,children:e?tm("showLess","Show less"):tm("showMore","Show more")})}let mw={contactDetails:"-esm-implementer-tools__patient-banner-contact-details-module__contactDetails___R7vfY",deceased:"-esm-implementer-tools__patient-banner-contact-details-module__deceased___nTt+l",heading:"-esm-implementer-tools__patient-banner-contact-details-module__heading___x7UoT",row:"-esm-implementer-tools__patient-banner-contact-details-module__row___qFgIi",col:"-esm-implementer-tools__patient-banner-contact-details-module__col___JXUlg",relationship:"-esm-implementer-tools__patient-banner-contact-details-module__relationship___T3LO-"},m_=({patientUuid:e})=>{let{cohorts:t=[],isLoading:n}=function(e){let t=e?`${tk}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:n,isLoading:o}=ir()(t,tP),r=n?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,rF.useMemo)(()=>({cohorts:r,isLoading:o}),[o,r])}(e);return(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsxs)("p",{className:mw.heading,children:[tm("patientLists","Patient Lists")," (",t?.length??0,")"]}),n?(0,rG.jsx)(sF.InlineLoading,{description:`${tm("loading","Loading")} ...`,role:"progressbar"}):(0,rG.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>l6(e?.startDate).getTime()-l6(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,rG.jsx)("li",{children:(0,rG.jsx)(rz,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,rG.jsx)("li",{children:"--"})})(),t.length>3&&(0,rG.jsx)("li",{className:mw.link,children:(0,rG.jsx)(rz,{to:`${window.spaBase}/home/patient-lists`,children:tm("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},my=({patientId:e})=>{let{patient:t,isLoading:n}=sc(e),o=t?.address?.find(e=>"home"===e.use),r=e=>e.split("#")[1];return n?(0,rG.jsx)(sF.InlineLoading,{description:`${tm("loading","Loading")} ...`,role:"progressbar"}):(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("p",{className:mw.heading,children:tm("address","Address")}),(0,rG.jsx)("ul",{children:o?Object.entries(o).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?o.extension?.[0]?.extension?.map((t,n)=>(0,rG.jsxs)("li",{children:[tm(r(t.url),r(t.url)),": ",t.valueString]},`address-${e}-${n}`)):(0,rG.jsxs)("li",{children:[tm(e,e),": ",t]},`address-${e}`)):(0,rG.jsx)("li",{children:"--"})})]})},mv=({patientUuid:e})=>{let{isLoading:t,contactAttributes:n}=(e=>{let{contactAttributeTypes:t=[]}=iT({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:n,error:o,isLoading:r}=(e=>{let{data:t,error:n,isLoading:o}=iW()(`${tk}/patient/${e}?v=custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))`,tP);return{isLoading:o,attributes:t?.data.person.attributes??[],error:n}})(e);return{contactAttributes:(0,rF.useMemo)(()=>n.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[n,t]),isLoading:r,error:o}})(e),o=(0,rF.useMemo)(()=>n?[...n?.map(e=>[e.attributeType.display?tm(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[n]);return(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("p",{className:mw.heading,children:tm("contactDetails","Contact Details")}),t?(0,rG.jsx)(sF.InlineLoading,{description:`${tm("loading","Loading")} ...`,role:"progressbar"}):(0,rG.jsx)("ul",{children:o.length?o.map(([e,t],n)=>(0,rG.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${n}`)):(0,rG.jsx)("li",{children:"--"})})]})},mb=({patientId:e})=>{let{data:t,isLoading:n}=function(e){let t=`${tk}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:n,error:o,isLoading:r,isValidating:i}=ir()(e?t:null,tP),s=n?.data?.results?.length?function(e,t){let n=[];for(let o of t)e===o.personA.uuid?n.push({uuid:`${o.uuid}`,display:o.personB.display,relativeAge:o.personB.age,relativeUuid:o.personB.uuid,relationshipType:o.relationshipType.bIsToA}):n.push({uuid:`${o.uuid}`,display:o.personA.display,relativeAge:o.personA.age,relativeUuid:o.personA.uuid,relationshipType:o.relationshipType.aIsToB});return n}(e,n.data.results):null;return{data:n?s:null,error:o,isLoading:r,isValidating:i}}(e);return(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("p",{className:mw.heading,children:tm("relationships","Relationships")}),n?(0,rG.jsx)(sF.InlineLoading,{description:`${tm("loading","Loading")} ...`,role:"progressbar"}):(0,rG.jsx)("ul",{children:t&&t.length>0?(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsxs)("li",{className:mw.relationship,children:[(0,rG.jsx)("div",{children:(0,rG.jsx)(rz,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,rG.jsx)("div",{children:e.relationshipType}),(0,rG.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?tm("yearAbbreviation","yr"):tm("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,rG.jsx)("li",{children:"--"})})]})};function mx({patientId:e,deceased:t}){return(0,rG.jsxs)("div",{className:sL()(mw.contactDetails,{[mw.deceased]:t}),children:[(0,rG.jsxs)("div",{className:mw.row,children:[(0,rG.jsx)("div",{className:mw.col,children:(0,rG.jsx)(my,{patientId:e})}),(0,rG.jsx)("div",{className:mw.col,children:(0,rG.jsx)(mv,{patientUuid:e})})]}),(0,rG.jsxs)("div",{className:mw.row,children:[(0,rG.jsx)("div",{className:mw.col,children:(0,rG.jsx)(mb,{patientId:e})}),(0,rG.jsx)("div",{className:mw.col,children:(0,rG.jsx)(m_,{patientUuid:e})})]})]})}function mS(e){let t=document.querySelector("template#loading-spinner");if(t){let n=t.content.cloneNode(!0),o=Array.prototype.map.call(n.childNodes,e=>e);return e.appendChild(n),()=>o.forEach(e=>e.remove())}return()=>{}}let mj="-esm-implementer-tools__action-menu2-module__container___6Gke0";function mk({workspaceGroup:e,groupProps:t}){let n=i3(),{persistence:o}=e;return(0,rG.jsx)("aside",{className:"-esm-implementer-tools__action-menu2-module__sideRail___T2lMV",children:(0,rG.jsxs)("div",{className:mj,children:["closable"==o&&i7(n)&&(0,rG.jsx)(sF.IconButton,{align:"left",onClick:()=>dG(),label:tm("close"),kind:"ghost",children:(0,rG.jsx)(af,{})}),(0,rG.jsx)(rV.Provider,{value:{moduleName:e.moduleName,featureName:e.name},children:(0,rG.jsx)(r3,{className:mj,name:e.name,state:{groupProps:t}})})]})})}function mN(e){let t=new URL(e,window.location.origin).pathname,n=new URL(window.getOpenmrsSpaBase?.()??"/",window.location.origin).pathname,o=n.endsWith("/")?n.slice(0,-1):n,r=null;return o?o===t?r="/":t.startsWith(`${o}/`)&&(r=t.slice(o.length)):r=t,{full:t,spaRelative:r}}function mC(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(mE,{}))}function mE(){let{openedGroup:e,openedWindows:t,registeredGroupsByName:n,registeredWindowsByName:o}=d5();if((0,rF.useEffect)(()=>nG("before-page-changed",t=>{let{newPage:o,cancelNavigation:r,oldUrl:i,newUrl:s}=t;if(!e)return;if(o)return void r(dG().then(e=>!e));let a=n[e.groupName],l=a?.scopePattern;l&&function(e,t,n){try{let o=new RegExp(e),r=mN(t),i=mN(n);if(null===r.spaRelative||null===i.spaRelative)return!0;let s=o.exec(r.spaRelative),a=o.exec(i.spaRelative);if(s&&a||(s=o.exec(r.full),a=o.exec(i.full)),!s||!a)return!0;if(s.length>1)return!s.slice(1).every((e,t)=>e===a[t+1]);return!1}catch{return!0}}(l,i,s)&&r(dG().then(e=>!e))}),[e,n]),!e)return null;let r=n[e.groupName],i=t.some(e=>e.maximized),{name:s}=r,a=Object.values(o).filter(e=>e.group===s&&void 0!==e.icon).sort((e,t)=>(e.order??Number.MAX_VALUE)-(t.order??Number.MAX_VALUE)).length>0;return(0,rG.jsxs)("div",{className:sL()("-esm-implementer-tools__workspace-windows-and-menu-module__workspaceWindowsAndMenuContainer___2u2mc",{"-esm-implementer-tools__workspace-windows-and-menu-module__overlay___7RHYZ":r.overlay,"-esm-implementer-tools__workspace-windows-and-menu-module__hasMaximizedWindow___gvJRd":i}),children:[(0,rG.jsx)("div",{className:"-esm-implementer-tools__workspace-windows-and-menu-module__workspaceWindowsContainer___40ITO",children:t.map(t=>(0,rG.jsx)(mP,{openedWindow:t,groupProps:e.props,showActionMenu:a},t.windowName))}),a&&(0,rG.jsx)(mk,{workspaceGroup:r,groupProps:e.props})]})}function mP({openedWindow:e,groupProps:t,showActionMenu:n}){let{windowName:o}=e,r=(0,rF.useMemo)(()=>({closeWorkspace(e){rC.setState(t=>d2.closeWorkspace(t,e))},openChildWorkspace(e,t,n){rC.setState(o=>d2.openChildWorkspace(o,e,t,n))},setWorkspaceTitle(e,t){rC.setState(n=>d2.setWorkspaceTitle(n,e,t))},setHasUnsavedChanges(e,t){rC.setState(n=>d2.setHasUnsavedChanges(n,e,t))},promptForClosingWorkspaces(e){let t=rC.getState().openedWindows.find(e=>e.windowName===o);return t?dY(t,e):Promise.resolve(!0)}}),[o]);return(0,rG.jsx)(ma,{openedWindow:e,groupProps:t,actions:r,renderChrome:!0,showActionMenu:n})}function mI(e,t,n){if(null==e)return n;let o=lH(e);if(!o)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),n;let r=[];for(let e of t){let t=lH(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}r.push({canonical:t,original:e})}let i=o;for(;i;){let e=r.find(e=>e.canonical===i);if(e)return e.original;let t=i+"-",n=r.find(e=>e.canonical.startsWith(t));if(n)return n.original;if("ht"===i){i="fr-HT";continue}let o=i.lastIndexOf("-");if(-1===o)break;let s=(i=i.slice(0,o)).lastIndexOf("-");-1!==s&&i.length-s==2&&(i=i.slice(0,s))}return n}function mO(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function mA(e){return!!e&&e.constructor===Object}var mR=n(3376);function mT(e){let[t,n,o]=e.split(".");return`${t}.${n}.${o}`}function m$(e,t){return mR(function(e){let t=e.indexOf("-");if(t>=0){let n=mT(e.slice(0,t)),o=e.slice(t+1);return`${n}-${o}`}return mT(e)}(t),e,{includePrerelease:!0})}async function mM(e,t={}){let n,{shouldRetry:o,getDelay:r,onError:i}=t;o=o??(e=>e<=5),r=r??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let s=0;do try{return await mL(r(s)),await e()}catch(e){i?.(e,s),n=e}while(o(s++));throw n}async function mL(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}function mW(e,t,n,o){}function mD(e){}function mU(e){return Promise.resolve([])}function mB(e){return Promise.resolve([])}function mF(e){return Promise.resolve({success:!1,result:void 0,error:"No service worker has been registered. Offline-related features have been removed from the framework."})}function mH(e){return()=>{}}function mV(){return!0}}}]);
|
|
28
|
+
To fix this, ensure that you define the "component" field inside the page definition.`,e);let o=function(e,{featureFlag:t}){return t?n=>!!oM(t)&&e(n):e}(function e(t){if(Array.isArray(t)){let n=t.map(e);return e=>n.some(t=>t(e))}return"string"==typeof t?(0,ta.fz)(window.getOpenmrsSpaBase()+t):t instanceof RegExp?e=>t.test(e.pathname.replace(window.getOpenmrsSpaBase(),"")):()=>t}(n),t);(0,ta.AG)(e,()=>sk(t.appName,t.component),o)}(o,t)}}let sA={PHONE_MIN:0,PHONE_MAX:600,TABLET_MIN:601,TABLET_MAX:1023,SMALL_DESKTOP_MIN:1024,SMALL_DESKTOP_MAX:1439,LARGE_DESKTOP_MIN:1440,LARGE_DESKTOP_MAX:Number.MAX_SAFE_INTEGER};function sR(){document.body.classList.toggle("omrs-breakpoint-lt-tablet",window.innerWidth<sA.TABLET_MIN),document.body.classList.toggle("omrs-breakpoint-gt-phone",window.innerWidth>sA.PHONE_MAX),document.body.classList.toggle("omrs-breakpoint-gt-tablet",window.innerWidth>sA.TABLET_MAX),document.body.classList.toggle("omrs-breakpoint-lt-desktop",window.innerWidth<sA.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-small-desktop",window.innerWidth<sA.SMALL_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-lt-large-desktop",window.innerWidth<sA.LARGE_DESKTOP_MIN),document.body.classList.toggle("omrs-breakpoint-gt-small-desktop",window.innerWidth>sA.SMALL_DESKTOP_MAX)}let sT=!1;function s$(){sT||(window.addEventListener("resize",sR),sR(),sT=!0)}var sM=n(5530),sL=n.n(sM);function sW({title:e,children:t}){let n="tablet"===i3();return(0,rG.jsxs)("div",{className:sL()({"-esm-implementer-tools__card-header-module__tabletHeader___Vkmd-":n,"-esm-implementer-tools__card-header-module__desktopHeader___ocWGq":!n}),children:[(0,rG.jsx)("h4",{children:e}),t]})}let sD=["red","magenta","purple","blue","teal","cyan","gray","green","warm-gray","cool-gray","high-contrast","outline"],sU={primaryColor:{_type:G.String,_description:"The color for displaying primary diagnoses tags",_default:"blue",_validators:[e7.oneOf(sD)]},secondaryColor:{_type:G.String,_description:"The color for displaying secondary diagnoses tags",_default:"gray",_validators:[e7.oneOf(sD)]}},sB={"Brand color #1":{_default:"#005d5d",_type:G.String},"Brand color #2":{_default:"#004144",_type:G.String},"Brand color #3":{_default:"#007d79",_type:G.String},excludePatientIdentifierCodeTypes:{uuids:{_type:G.Array,_description:"List of UUIDs of patient identifier types to exclude from rendering in the patient banner",_default:[],_elements:{_type:G.UUID}}},implementationName:{_type:G.String,_description:"A name of the place (or authority) where all possible locations a user can choose are located.",_default:"Clinic"},logo:{src:{_type:G.String,_default:"",_description:"The path or URL to the logo shown on the login page and while the server is starting up. If set to an empty string, the default OpenMRS logo is used.",_validators:[e7.isUrl]},alt:{_type:G.String,_default:"Logo",_description:"The alternative text for the logo image, displayed when the image cannot be loaded or on hover."}},patientPhotoConceptUuid:{_type:G.ConceptUuid,_default:"736e8771-e501-4615-bfa7-570c03f4bef5",_description:"Used to look up the patient photo, which is stored as an attachment obs. Set to `null` in order to disable the feature and use only generated avatars. To remove the avatars entirely, use extension configuration's `remove` feature."},preferredCalendar:{_type:G.Object,_description:"Keys should be locale codes, and values should be the preferred calendar for that locale. For example, {'am': 'ethiopic'}.",_default:{am:"ethiopic"},_elements:{_validators:[e7.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}},preferredDateLocale:{_type:G.Object,_description:"Allows setting the locale used for date formatting for any browser locale. Does not affect time formatting. Keys should be locale codes, and values should be the preferred locale for formatting dates. For example, {'en': 'en-US', 'fr-CA': 'en-CA'}.",_default:{en:"en-GB"},_elements:{_type:G.String}},diagnosisTags:sU};var sF=n(8326);let sH={"carbon.table.batch.cancel":"cancel","carbon.table.batch.items.selected":"batchActionsItemsSelected","carbon.table.batch.item.selected":"batchActionItemSelected","carbon.table.batch.selectAll":"selectAll"},sV=e=>(0,rG.jsx)(sF.TableBatchActions,{translateWithId:(e,t)=>{let n=sH[e];return n?tm(n,e,t):e},...e}),sG="-esm-implementer-tools__custom-overflow-menu-module__container___8PykS",sz="-esm-implementer-tools__custom-overflow-menu-module__menu___qsOLn",sq="-esm-implementer-tools__custom-overflow-menu-module__show___BserJ",sJ="-esm-implementer-tools__custom-overflow-menu-module__overflowMenuButton___n86Gz",sK=(0,rF.createContext)(null);function sX(){let e=(0,rF.useContext)(sK);if(!e)throw Error("useCustomOverflowMenu must be used within a CustomOverflowMenu");return e}function sY({menuTitle:e,children:t}){let[n,o]=rH().useState(!1),r=so(()=>o(!1),n),i="tablet"===i3(),s=(0,rF.useCallback)(()=>o(e=>!e),[]),a=(0,rF.useRef)(null),l=(0,rF.useRef)(null),c=(0,rF.useId)(),u=`custom-overflow-menu-trigger-${c}`,d=`custom-overflow-menu-${c}`,m=(0,rF.useCallback)(()=>{o(!1),a.current?.focus()},[]),p=(0,rF.useMemo)(()=>({closeMenu:m}),[m]),f=(0,rF.useCallback)(e=>{"Escape"===e.key&&n&&(e.stopPropagation(),m())},[m,n]),g=rF.Children.toArray(t);(0,rF.useEffect)(()=>{if(n&&l.current){let e=l.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[n]);let h=(0,rF.useCallback)(({currentIndex:e,direction:t})=>{let n=l.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!n?.length)return;let o=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,r=Array.from(n).indexOf(o);if(-1===r)return void n[t>0?0:n.length-1]?.focus();let i=r+t,s=i<0?n.length-1:i>=n.length?0:i;n[s]?.focus()},[]),w=g.map((e,t)=>(0,rF.isValidElement)(e)?(0,rF.cloneElement)(e,{closeMenu:m,handleOverflowMenuItemFocus:h,index:t}):e);return(0,rG.jsxs)("div",{"data-overflow-menu":!0,className:sL()("cds--overflow-menu",sG),ref:r,children:[(0,rG.jsx)("button",{className:sL()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":n},sJ),"aria-controls":d,"aria-expanded":n,"aria-haspopup":"true",id:u,onClick:s,onKeyDown:f,ref:a,children:e}),(0,rG.jsxs)("div",{className:sL()("cds--overflow-menu-options","cds--overflow-menu--flip",sz,{[sq]:n}),"aria-labelledby":u,"data-floating-menu-direction":"bottom",id:d,onKeyDown:f,ref:l,role:"menu",tabIndex:-1,children:[(0,rG.jsx)("ul",{className:sL()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":i}),children:(0,rG.jsx)(sK.Provider,{value:p,children:w})}),(0,rG.jsx)("span",{})]})]})}function sZ(e){let t=(0,rF.useContext)(sK);return(0,rG.jsx)(sF.OverflowMenuItem,{...e,closeMenu:t?.closeMenu})}var sQ=n(2277),s0=n(4194);let s1=["omrs-icon-activity","omrs-icon-add","omrs-icon-arrow-down","omrs-icon-arrow-left","omrs-icon-arrow-right","omrs-icon-arrow-up","omrs-icon-baby","omrs-icon-calendar-heat-map","omrs-icon-calendar","omrs-icon-caret-down","omrs-icon-caret-left","omrs-icon-caret-right","omrs-icon-caret-up","omrs-icon-chart-average","omrs-icon-chart-line","omrs-icon-checkmark-filled","omrs-icon-checkmark-outline","omrs-icon-chemistry","omrs-icon-chevron-down","omrs-icon-chevron-left","omrs-icon-chevron-right","omrs-icon-chevron-up","omrs-icon-close","omrs-icon-close-filled","omrs-icon-close-outline","omrs-icon-document","omrs-icon-document-attachment","omrs-icon-download","omrs-icon-drug-order","omrs-icon-edit","omrs-icon-event-schedule","omrs-icon-events","omrs-icon-gender-female","omrs-icon-gender-male","omrs-icon-gender-other","omrs-icon-gender-unknown","omrs-icon-generic-order-type","omrs-icon-group","omrs-icon-group-access","omrs-icon-hospital-bed","omrs-icon-image-medical","omrs-icon-information","omrs-icon-information-filled","omrs-icon-information-square","omrs-icon-inventory-management","omrs-icon-lab-order","omrs-icon-list-checked","omrs-icon-location","omrs-icon-material-order","omrs-icon-maximize","omrs-icon-medication","omrs-icon-message-queue","omrs-icon-microscope","omrs-icon-mobile-check","omrs-icon-money","omrs-icon-mother","omrs-icon-movement","omrs-icon-overflow-menu--horizontal","omrs-icon-overflow-menu--vertical","omrs-icon-password","omrs-icon-pedestrian-family","omrs-icon-pen","omrs-icon-printer","omrs-icon-procedure-order","omrs-icon-programs","omrs-icon-renew","omrs-icon-referral-order","omrs-icon-report","omrs-icon-reset","omrs-icon-save","omrs-icon-search","omrs-icon-settings","omrs-icon-shopping-cart","omrs-icon-shopping-cart--arrow-down","omrs-icon-sticky-note-add","omrs-icon-switcher","omrs-icon-syringe","omrs-icon-table-of-contents","omrs-icon-table","omrs-icon-time","omrs-icon-tools","omrs-icon-translate","omrs-icon-trash-can","omrs-icon-tree-view--alt","omrs-icon-two-factor-authentication","omrs-icon-user-avatar","omrs-icon-user-follow","omrs-icon-user-xray","omrs-icon-user","omrs-icon-view-off","omrs-icon-view","omrs-icon-warning"],s2=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-activity",iconProps:e})})),s5=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-add",iconProps:e})})),s6=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-arrow-down",iconProps:e})})),s8=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-arrow-left",iconProps:e})})),s4=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-arrow-right",iconProps:e})})),s3=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-arrow-up",iconProps:e})})),s7=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-baby",iconProps:e})})),s9=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-calendar-heat-map",iconProps:e})})),ae=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-calendar",iconProps:e})})),at=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-caret-down",iconProps:e})})),an=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-caret-left",iconProps:e})})),ao=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-caret-right",iconProps:e})})),ar=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-caret-up",iconProps:e})})),ai=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chart-average",iconProps:e})})),as=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chart-line",iconProps:e})})),aa=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-checkmark-filled",iconProps:e})})),al=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-checkmark-outline",iconProps:e})})),ac=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chemistry",iconProps:e})})),au=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chevron-down",iconProps:e})})),ad=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chevron-left",iconProps:e})})),am=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chevron-right",iconProps:e})})),ap=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-chevron-up",iconProps:e})})),af=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-close",iconProps:e})})),ag=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-close-filled",iconProps:e})})),ah=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-close-outline",iconProps:e})})),aw=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-document",iconProps:e})})),a_=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-document-attachment",iconProps:e})})),ay=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-download",iconProps:e})})),av=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-drug-order",iconProps:e})})),ab=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-edit",iconProps:e})})),ax=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-event-schedule",iconProps:e})})),aS=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-events",iconProps:e})})),aj=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-gender-female",iconProps:e})})),ak=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-gender-male",iconProps:e})})),aN=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-gender-other",iconProps:e})})),aC=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-gender-unknown",iconProps:e})})),aE=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-generic-order-type",iconProps:e})})),aP=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-group",iconProps:e})})),aI=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-group-access",iconProps:e})})),aO=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-hospital-bed",iconProps:e})})),aA=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-image-medical",iconProps:e})})),aR=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-information",iconProps:e})})),aT=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-information-filled",iconProps:e})})),a$=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-information-square",iconProps:e})})),aM=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-inventory-management",iconProps:e})})),aL=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-lab-order",iconProps:e})})),aW=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-list-checked",iconProps:e})})),aD=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-location",iconProps:e})})),aU=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-material-order",iconProps:e})})),aB=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-maximize",iconProps:e})})),aF=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-medication",iconProps:e})})),aH=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-message-queue",iconProps:e})})),aV=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-microscope",iconProps:e})})),aG=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-mobile-check",iconProps:e})})),az=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-money",iconProps:e})})),aq=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-mother",iconProps:e})})),aJ=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-movement",iconProps:e})})),aK=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),aX=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-overflow-menu--horizontal",iconProps:e})})),aY=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-password",iconProps:e})})),aZ=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-pedestrian-family",iconProps:e})})),aQ=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-pen",iconProps:e})})),a0=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-printer",iconProps:e})})),a1=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-procedure-order",iconProps:e})})),a2=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-programs",iconProps:e})})),a5=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-referral-order",iconProps:e})})),a6=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-renew",iconProps:e})})),a8=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-report",iconProps:e})})),a4=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-reset",iconProps:e})})),a3=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-save",iconProps:e})})),a7=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-search",iconProps:e})})),a9=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-settings",iconProps:e})})),le=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-switcher",iconProps:e})})),lt=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-shopping-cart",iconProps:e})})),ln=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-shopping-cart--arrow-down",iconProps:e})})),lo=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-sticky-note-add",iconProps:e})})),lr=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-syringe",iconProps:e})})),li=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-table-of-contents",iconProps:e})})),ls=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-table",iconProps:e})})),la=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-time",iconProps:e})})),ll=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-tools",iconProps:e})})),lc=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-translate",iconProps:e})})),lu=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-trash-can",iconProps:e})})),ld=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-tree-view--alt",iconProps:e})})),lm=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-two-factor-authentication",iconProps:e})})),lp=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-user-avatar",iconProps:e})})),lf=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-user-follow",iconProps:e})})),lg=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-user-xray",iconProps:e})})),lh=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-user",iconProps:e})})),lw=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-view-off",iconProps:e})})),l_=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-view",iconProps:e})})),ly=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(lN,{ref:t,icon:"omrs-icon-warning",iconProps:e})})),lv=ly,lb=a_,lx=aW,lS=aA,lj=ln,lk=(0,rF.memo)((0,rF.forwardRef)(function({icon:e,fallback:t,...n},o){let r=(0,rF.useRef)(e?document.getElementById(e):void 0);return(0,rF.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(r.current=e?document.getElementById(e):void 0)});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,rG.jsx)(iS,{value:r.current,fallback:t,children:(0,rG.jsx)(lN,{ref:o,icon:e,iconProps:n})})})),lN=(0,rF.memo)((0,rF.forwardRef)(function({icon:e,iconProps:t},n){let{className:o,fill:r,size:i}=Object.assign({},{fill:"currentColor",size:20},t);(i<=0||i>72)&&(console.error(`Invalid size '${i}' specified for ${e}. Defaulting to 20.`),i=20);let s=(0,rF.useRef)(null);return(0,rF.useImperativeHandle)(n,()=>s.current),(0,rF.useEffect)(()=>{s.current&&"currentColor"!==r&&s.current.style.setProperty("--omrs-icon-fill",r)},[]),(0,rG.jsx)("svg",{ref:s,className:sL()("omrs-icon","-esm-implementer-tools__icons-module__icon___BfFhd",o),height:i,width:i,viewBox:"0 0 16 16",children:(0,rG.jsx)("use",{href:`#${e}`})})})),lC=({path:e,title:t,basePath:n,icon:o})=>{let{t:r}=(0,it.useTranslation)(),i=(0,sQ.zy)(),s=(0,rF.useMemo)(()=>{if(!e)return!1;let t=e.startsWith("/")?e.slice(1):e;if(t.startsWith("http"))return t===window.location.href;let n=t.split("/").map(e=>decodeURIComponent(e)),o=(i.pathname??"").split("/").slice(1).map(e=>decodeURIComponent(e));return o.some((e,t)=>n.every((e,n)=>o[t+n]===e))},[i.pathname,e]);return(0,rG.jsx)("div",{children:(0,rG.jsx)(rz,{className:sL()("cds--side-nav__link",{"active-left-nav-link":s}),to:`${n}/${encodeURIComponent(e)}`,children:(0,rG.jsxs)("span",{className:"-esm-implementer-tools__dashboard-module__menu___ds1tf",children:[(0,rG.jsx)(lk,{icon:o,className:"-esm-implementer-tools__dashboard-module__icon___4Zrrh",size:16}),(0,rG.jsx)("span",{children:r(t)})]})})},e)};function lE(e){return function({basePath:t}){return(0,rG.jsx)(s0.Kd,{children:(0,rG.jsx)(lC,{basePath:t,...e})})}}var lP=n(7715),lI=n(7532),lO=n(3692),lA=n(7615),lR=n(700),lT=n(6816),l$=n(1168);function lM(e){return rH().createElement(l$.C,e)}var lL=n(3010),lW=n(6513),lD=n(6190);function lU(e,t,n=!1){if(null==e)return n?e:void 0;if("string"==typeof e&&!e)return n?null:void 0;if(e instanceof lL.ng||e instanceof lL._l||e instanceof lL.Ip)return t?(0,lW.yP)(e,t):e;{let n=sg()(e).toDate(),o=new lL.ng(n.getFullYear(),n.getMonth()+1,n.getDate());return t?(0,lW.yP)(o,t):o}}function lB(e){if(e)return e.toDate((0,lD.Xj)())}var lF=n(9002);function lH(e){if("string"==typeof e&&0!==e.trim().length)try{return new Intl.Locale(e.replace(/[_@]/g,"-")).toString()}catch{return}}function lV(e){let t=e??"",n=lH(t);if(!n)return t;try{return new Intl.DisplayNames([n],{type:"language"}).of(n)??t}catch{return t}}function lG(){let e=window.i18next.language,t=lH(e)??e;return"ht"===t&&(t="fr-HT"),t}var lz=n(7883),lq=n(424),lJ=n(1492),lK=n(8271);function lX(e,t){var n=function(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return n.get?n.get.call(e):n.value}sf.extend(sh),sf.extend(lJ),sf.extend(lq);let lY="YYYY-MM-DDTHH:mm:ss.SSSZZ",lZ=/^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$/;function lQ(e,t){let n=lZ.exec(e);if(!n)return(0,lz.CD)(e,t);let o=Number(n[1]),r=void 0===n[2]?void 0:Number(n[2]),i=void 0===n[3]?void 0:Number(n[3]),s=new Date(0);return(s.setUTCFullYear(o,(r??1)-1,i??1),s.getUTCFullYear()!==o||s.getUTCMonth()!==(r??1)-1||s.getUTCDate()!==(i??1))?{invalid:`Invalid ISO calendar date '${e}'`}:{year:o,...void 0!==r&&{month:r},...void 0!==i&&{day:i}}}function l0(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&sf(e,lY).isValid()}function l1(e){return sf(e).isToday()}function l2(e){return l0(e)?sf(e,lY).toDate():null}function l5(e,t=!1){let n=sf(e);return t&&(n=n.utc()),n.format(lY)}function l6(e){return sf(e).toDate()}var l8=new WeakMap;let l4=new class{register(e,t){lX(this,l8).set(e,t)}getCalendar(e){if(!e)return;if(e.calendar)return e.calendar;if(e.region){let t=`${e.language}-${e.region}`;if(lX(this,l8).has(t))return lX(this,l8).get(t)}if(e.language&&lX(this,l8).has(e.language))return lX(this,l8).get(e.language);let t=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return lX(this,l8).set(`${e.language}${e.region?`-${e.region}`:""}`,t),t}constructor(){!function(e,t,n){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object");t.set(e,n)}(this,l8,{writable:!0,value:new Map})}};function l3(e,t){l4.register(e,t)}function l7(e){let t=e??lG();return l4.getCalendar(t instanceof Intl.Locale?t:new Intl.Locale(t))}let l9={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1};function ce(e,t={}){let n=lQ(e,lG());if(n.invalid)return console.warn(`Could not parse invalid date '${e}'`),null;!(0,lK.A)(n.day)&&(0,lK.A)(n.month)&&(n=Object.assign({},(0,H.A)(n,"day"),{month:n.day})),n.month&&(n.month-=1),n.day&&(n=Object.assign({},(0,H.A)(n,"day"),{date:n.day}));let o=sf().set(n).toDate();return(0,lK.A)(n.year)&&(t.year=!1),(0,lK.A)(n.month)&&(t.month=!1),(0,lK.A)(n.date)&&(t.day=!1),ct(o,t)}function ct(e,t){let n,o=t?.locale??lG(),r=new Intl.Locale(o),{calendar:i,mode:s,time:a,day:l,month:c,year:u,noToday:d,numberingSystem:m}={...l9,...{noToday:"am"===r.language},...t},p={calendar:i??l7(r),year:u?"numeric":void 0,month:c?"short":void 0,day:l?"2-digit":void 0,numberingSystem:m},f=sf(e).isToday();if(f&&!d)n=(n=new Intl.RelativeTimeFormat(o,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(o)+n.slice(1);else{"en"===r.language&&(o="en-GB");let t=new Intl.DateTimeFormat(o,p).formatToParts(e);("en"===r.language||"am"===r.language)&&"standard"==s&&u&&l&&(t=t.map(cn("-"))),"wide"==s&&(t=t.map(cn(" — "))),"ethiopic"===p.calendar&&(t=t.filter((e,t,n)=>"era"!==e.type&&("literal"!==e.type||!(t<n.length-1)||"era"!==n[t+1].type))),n=t.map(e=>e.value).join("")}return(!0===a||f&&"for today"===a)&&(n+=`, ${co(e)}`),n}let cn=e=>(t,n,o)=>"literal"!==t.type||" "!==t.value||n<o.length-1&&"era"===o[n+1].type?t:{type:"literal",value:e};function co(e){return e.toLocaleTimeString(lG(),{hour:"2-digit",minute:"2-digit"})}function cr(e,t){return ct(e,{...t,time:!0})}function ci(e,t){let n=l7("string"==typeof t?new Intl.Locale(t):t);return n?(0,lW.yP)(e,(0,lF.d)(n)):e}function cs(e,t){return new Intl.DurationFormat(lG(),t).format(e)}function ca(e,t){if(null==e)return null;if("string"==typeof e){let n=lQ(e,lG());return n.invalid?(console.warn(`Could not interpret '${e}' as a date`),null):(n.day&&!n.month&&(n={...(0,H.A)(n,"day"),...{month:n.day}}),n.month&&(n.month-=1),n.day&&(n={...(0,H.A)(n,"day"),...{date:n.day}}),sf(t).set(n))}return sf(e)}let cl=["years","months","days","hours","minutes","seconds"],cc={second:"seconds",minute:"minutes",hour:"hours",day:"days",month:"months",year:"years"},cu={seconds:45,minutes:45,hours:22,days:26,months:11,years:1/0};function cd(e,t=sf(),n){let o,r=sf(t),i=ca(e,r);if(null==i)return null;if("string"==typeof n){let e=cc[n]??n;return{[e]:r.diff(i,e)}}let{thresholds:s,largestUnit:a,smallestUnit:l}=n??{};if(void 0!==a||void 0!==l){let e,t=l?cc[l]??l:void 0;return e="auto"===a||void 0===a?function(e,t,n){let o=cl.indexOf(n);for(let r=0;r<cl.length;r++){let i=cl[r];if(t.diff(e,i)>0)return r<=o?i:n}return n}(i,r,t??"seconds"):cc[a]??a,function(e,t,n,o){let r=cl.indexOf(n),i=cl.indexOf(o),s=cl.slice(r,i+1),a={},l=e;for(let e of s){let n=t.diff(l,e);a[e]=n,l=l.add(n,e)}return a}(i,r,e,t??e)}let c=(o=function(e){let t={...cu};if(e)for(let[n,o]of Object.entries(e))void 0!==o&&(t[cc[n]??n]=o);return t}(s),r.diff(i,"seconds")<o.seconds?"seconds":r.diff(i,"minutes")<o.minutes?"minutes":r.diff(i,"hours")<o.hours?"hours":r.diff(i,"days")<o.days?"days":r.diff(i,"months")<o.months?"months":"years");return{[c]:r.diff(i,c)}}let cm={style:"short",localeMatcher:"lookup"};function cp(e,t=sf(),n){let o=cd(e,t,n);return null==o?null:cs(o,"object"==typeof n&&n.formatOptions?{...cm,...n.formatOptions}:cm)}let cf=(0,rF.createContext)(null);function cg(){let e=iT({externalModuleName:"@openmrs/esm-styleguide"}).preferredDateLocale,t=(0,rF.useMemo)(()=>{let t=lG();return e[t]&&(t=e[t]),t},[window.i18next.language]),n=(0,rF.useMemo)(()=>{let e=l7(t);return void 0!==e?(0,lF.d)(e):void 0},[t]),o=(0,rF.useMemo)(()=>new Intl.Locale(t,{calendar:n?.identifier}),[t,n]),r=(0,rF.useMemo)(()=>n?(0,lW.yP)((0,lD.Ec)((0,lD.Xj)()),n):(0,lD.Ec)((0,lD.Xj)()),[n]);return{calendar:n,intlLocale:o,today_:r}}let ch=new lL.ng(1793,1,1);var cw=n(5830),c_=n(5354),cy=n(4745),cv=n(1202);function cb(e,t){return Number.parseInt(ct(e,{calendar:t.calendar,locale:t.baseName,day:!1,month:!1,noToday:!0,numberingSystem:"latn"}))}let cx=(0,rF.forwardRef)(function(e,t){let{className:n}=e,o=(0,rF.useContext)(cw.f2),r=(0,rF.useContext)(cw._I),i=o??r,s=(0,rF.useContext)(cf),a=(0,lD.Xj)(),l=ct(i.visibleRange.start.toDate(a),{calendar:s.calendar,locale:s.baseName,day:!1,year:!1,noToday:!0}),c=cb(i.visibleRange.start.toDate(a),s),u=i.maxValue?cb(i.maxValue.toDate(a),s):void 0,d=i.minValue?cb(i.minValue.toDate(a),s):void 0,m=(0,rF.useCallback)(e=>{i.setFocusedDate(i.focusedDate.cycle("year",e-i.focusedDate.year))},[]);return i&&(0,rG.jsxs)("span",{ref:t,className:n,children:[(0,rG.jsx)("span",{children:l}),(0,rG.jsxs)(cy.oz,{formatOptions:{useGrouping:!1},maxValue:u,minValue:d,onChange:m,value:c,children:[(0,rG.jsx)(cv.p,{}),(0,rG.jsxs)(lA.Y,{children:[(0,rG.jsx)(lR.$,{slot:"increment",children:(0,rG.jsx)(ar,{size:8})}),(0,rG.jsx)(lR.$,{slot:"decrement",children:(0,rG.jsx)(at,{size:8})})]})]})]})});var cS=n(9588);let cj="-esm-implementer-tools__datepicker-module__inputGroup___+4zks",ck="-esm-implementer-tools__datepicker-module__inputSegment___wiExn",cN="-esm-implementer-tools__datepicker-module__dateInputWrapper___uiyAC",cC="-esm-implementer-tools__datepicker-module__invalidText___SxtTL",cE="-esm-implementer-tools__datepicker-module__flatButton___UU1Qp",cP="-esm-implementer-tools__datepicker-module__flatButtonMd___fhR-1",cI="-esm-implementer-tools__datepicker-module__flatButtonSm___5INZ7",cO="-esm-implementer-tools__datepicker-module__flatButtonLg___RFMrl";function cA({children:e}){let t=(0,rF.useContext)(lI.Pg),n=(0,rF.useContext)(lI.a8),o=t??n,r=so(()=>o?.close());return(0,rG.jsx)(cS.lG,{className:"-esm-implementer-tools__datepicker-module__dialog___qllIf",ref:r,children:e})}let cR=(0,rF.forwardRef)(function({variant:e,today_:t,minDate:n,maxDate:o},r){let i="range"===e,s=i?cw._e:cw.Vv;return(0,rG.jsx)(c_.A,{ref:r,className:"-esm-implementer-tools__datepicker-module__popover___16UMX",placement:"bottom start",offset:1,isNonModal:!0,children:(0,rG.jsx)(cA,{children:(0,rG.jsxs)(s,{...i?{minValue:n,maxValue:o,className:"cds--date-picker__calendar"}:{},children:[(0,rG.jsxs)("header",{className:"-esm-implementer-tools__datepicker-module__header___WAVlD",children:[(0,rG.jsx)(lR.$,{className:sL()(cE,cP),slot:"previous",children:(0,rG.jsx)(ad,{size:16})}),(0,rG.jsx)(cx,{className:"-esm-implementer-tools__datepicker-module__monthYear___A3aKF"}),(0,rG.jsx)(lR.$,{className:sL()(cE,cP),slot:"next",children:(0,rG.jsx)(am,{size:16})})]}),(0,rG.jsx)(cw.r8,{className:"-esm-implementer-tools__datepicker-module__calendarGrid___6qRB2",children:e=>(0,rG.jsx)(cw.Zr,{className:sL()("cds--date-picker__day",{"-esm-implementer-tools__datepicker-module__today___TZl6M":0===t.compare(e)}),date:e},e.toString())})]})})})});var cT=n(8017),c$=n(9774),cM=n(7956);let cL=(0,rF.forwardRef)(function(e,t){let n=(0,rF.useContext)(lI.Pg),[o,r]=(0,lP.JT)({slot:e.slot},t,c$.cQ),{locale:i}=(0,l$.Y)(),s=(0,cM.F)({...o,locale:i,createCalendar:lF.d}),a=(0,rF.useRef)(null),{fieldProps:l,inputProps:c}=(0,cT.cJ)({...o,inputRef:a},s,r),u=(0,rF.useCallback)(()=>{s.isDisabled||n.toggle()},[]);return(0,rG.jsxs)(lP.Kq,{values:[[c$.$,s],[cv.E,{...c,ref:a}],[lA.t,{...l,ref:r,isInvalid:s.isInvalid}]],children:[(0,rG.jsx)(lA.Y,{...e,id:e.id,ref:t,slot:e.slot||void 0,className:e.className,isDisabled:s.isDisabled,isInvalid:s.isInvalid,onClick:u,children:s.segments.map((t,n)=>(0,rF.cloneElement)(e.children(t),{key:n}))}),(0,rG.jsx)(cv.p,{})]})}),cW=(0,rF.forwardRef)(function(e,t){let n=(0,rF.useContext)(lI.Pg),o=(0,rF.useContext)(lI.a8);return(n??o).isInvalid?(0,rG.jsx)(ly,{ref:t,size:16,...e}):(0,rG.jsx)(ae,{ref:t,size:16,...e})});var cD=n(64),cU=n(5503),cB=n(1697),cF=n(7866),cH=n(8035),cV=n(2231);let cG=(0,rF.forwardRef)(function({segment:e,...t},n){let o=(0,rF.useContext)(c$.$),r=(0,cD.U)(n),{segmentProps:i}=(0,cU.V)(e,o,r),{focusProps:s,isFocused:a,isFocusVisible:l}=(0,cB.o)(),{hoverProps:c,isHovered:u}=(0,cF.M)({...t,isDisabled:o.isDisabled||"literal"===e.type}),d=function(e){let{className:t,style:n,children:o,defaultClassName:r,defaultChildren:i,defaultStyle:s,values:a}=e;return(0,rF.useMemo)(()=>{let e,l,c;return e="function"==typeof t?t({...a,defaultClassName:r}):t,l="function"==typeof n?n({...a,defaultStyle:s||{}}):n,c="function"==typeof o?o({...a,defaultChildren:i}):null==o?i:o,{className:e??r,style:l||s?{...s,...l}:void 0,children:c??i,"data-rac":""}},[t,n,o,r,i,s,a])}({...t,values:{...e,isReadOnly:!e.isEditable,isInvalid:o.isInvalid,isDisabled:o.isDisabled,isHovered:u,isFocused:a,isFocusVisible:l},defaultChildren:e.text}),m=(0,rF.useCallback)(e=>{e.stopPropagation()},[]);return(0,rG.jsx)("span",{...(0,cH.v)((0,cV.$)(t),i,s,c),...d,ref:r,style:i.style,"data-placeholder":e.isPlaceholder||void 0,"data-invalid":o.isInvalid||void 0,"data-readonly":!e.isEditable||void 0,"data-disabled":o.isDisabled||void 0,"data-type":e.type,"data-hovered":u||void 0,"data-focused":a||void 0,"data-focus-visible":l||void 0,onClick:m})}),cz={short:!1,size:"md"},cq=(0,rF.forwardRef)(function(e,t){let{className:n,defaultValue:o,isDisabled:r,invalid:i,invalidText:s,isInvalid:a,label:l,labelText:c,light:u,maxDate:d,minDate:m,onChange:p,onChangeRaw:f,short:g,size:h,value:w,..._}={...cz,...e},{calendar:y,intlLocale:v,today_:b}=cg(),x=(0,rF.useId)(),S=!!(c??l),j=(0,rF.useMemo)(()=>lU(o,y),[o,y]),k=(0,rF.useMemo)(()=>lU(w,y,!0),[w,y]),N=(0,rF.useMemo)(()=>lU(d,y),[d,y]),C=(0,rF.useMemo)(()=>lU(m??ch,y),[m,y]),E=(0,rF.useMemo)(()=>i||a,[i,a]),P=(0,rF.useMemo)(()=>(f&&p&&console.error("An OpenmrsDatePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),f??(e=>p?.(lB(e)))),[f,p]);return(0,rG.jsx)(lM,{locale:v.toString(),children:(0,rG.jsx)("div",{className:sL()("cds--form-item",n),children:(0,rG.jsx)(lP.Kq,{values:[[cf,v]],children:(0,rG.jsxs)(lI.lr,{className:sL()("cds--date-picker","cds--date-picker--single",{"cds--date-picker--short":g,"cds--date-picker--light":u}),defaultValue:j,isDisabled:r,isInvalid:E,maxValue:N,minValue:C,value:k,shouldForceLeadingZeros:"en"===v.language||void 0,..._,onChange:P,children:[(0,rG.jsxs)("div",{className:"cds--date-picker-container",children:[S&&(0,rG.jsx)(lO.J,{className:sL()("cds--label",{"cds--label--disabled":r}),htmlFor:x,children:c??l}),(0,rG.jsxs)(lA.Y,{className:cj,children:[(0,rG.jsx)(cL,{id:S?x:void 0,ref:t,className:sL()("cds--date-picker-input__wrapper","-esm-implementer-tools__datepicker-module__inputWrapper___kykar",{"-esm-implementer-tools__datepicker-module__inputWrapperSm___KJtg-":"sm"===h,"-esm-implementer-tools__datepicker-module__inputWrapperMd___ablE9":"md"===h||!h||0===h.length,"-esm-implementer-tools__datepicker-module__inputWrapperLg___5dkQp":"lg"===h}),children:e=>"era"!==e.type?(0,rG.jsx)(cG,{className:ck,segment:e}):(0,rG.jsx)(rH().Fragment,{})}),(0,rG.jsx)(lR.$,{className:sL()(cE,{[cI]:"sm"===h,[cP]:"md"===h||!h||0===h.length,[cO]:"lg"===h}),children:(0,rG.jsx)(cW,{})})]}),(0,rG.jsx)(lT.b,{className:cC,children:s})]}),(0,rG.jsx)(cR,{variant:"single",today_:b})]})})})})}),cJ=(0,rF.forwardRef)(function({className:e,defaultValue:t,invalid:n,invalidText:o,isDisabled:r,isInvalid:i,label:s,labelText:a,light:l,maxDate:c,minDate:u,onChange:d,onChangeRaw:m,size:p="md",value:f,...g},h){let{calendar:w,intlLocale:_,today_:y}=cg(),v=(0,rF.useId)(),b=!!(a??s),x=(0,rF.useMemo)(()=>{if(f)return{start:lU(f[0],w,!1),end:lU(f[1],w,!1)}},[f,w]),S=(0,rF.useMemo)(()=>{if(t)return{start:lU(t[0],w,!1),end:lU(t[1],w,!1)}},[t,w]),j=(0,rF.useMemo)(()=>lU(u??ch,w,!0),[u,w]),k=(0,rF.useMemo)(()=>lU(c,w,!0),[c,w]),N=(0,rF.useMemo)(()=>n||i,[n,i]),C=(0,rF.useMemo)(()=>(m&&d&&console.error("An OpenmrsDateRangePicker component was created with both onChange and onChangeRaw handlers defined. Only onChangeRaw will be used."),m??(e=>d?.([lB(e.start),lB(e.end)]))),[m,d]);return(0,rG.jsx)(lM,{locale:_.toString(),children:(0,rG.jsx)("div",{className:sL()("cds--form-item",e),children:(0,rG.jsx)(lP.Kq,{values:[[cf,_]],children:(0,rG.jsx)(lI.Ur,{id:b?v:void 0,className:sL()("cds--date-picker",{"cds--date-picker--light":l,"cds--date-picker--disabled":r}),isInvalid:N,shouldForceLeadingZeros:"en"===_.language||void 0,maxValue:k,minValue:j,value:x,defaultValue:S,ref:h,isDisabled:r,...g,onChange:C,children:(0,rG.jsxs)("div",{className:"cds--date-picker-container",children:[b&&(0,rG.jsx)(lO.J,{className:sL()("cds--label",{"cds--label--disabled":r}),htmlFor:v,children:a??s}),(0,rG.jsxs)(lA.Y,{className:cj,children:[(0,rG.jsxs)("div",{className:sL()("-esm-implementer-tools__datepicker-module__inputsWrapper___YlkGh",{"-esm-implementer-tools__datepicker-module__inputsWrapperSm___fAKhS":"sm"===p,"-esm-implementer-tools__datepicker-module__inputsWrapperMd___XVgGP":"md"===p||!p||0===p.length,"-esm-implementer-tools__datepicker-module__inputsWrapperLg___UgHJ1":"lg"===p}),children:[(0,rG.jsx)(c$.J3,{className:sL()("cds--date-picker-input__wrapper","-esm-implementer-tools__datepicker-module__startInput___qgbQm",cN),slot:"start",children:e=>(0,rG.jsx)(cG,{className:ck,segment:e})}),(0,rG.jsx)("div",{className:"-esm-implementer-tools__datepicker-module__separator___79vXZ",children:(0,rG.jsx)("span",{"aria-hidden":"true","data-readonly":!0,children:"–"})}),(0,rG.jsx)(c$.J3,{className:sL()("cds--date-picker-input__wrapper","-esm-implementer-tools__datepicker-module__endInput___huv7x",cN),slot:"end",children:e=>(0,rG.jsx)(cG,{className:ck,segment:e})})]}),(0,rG.jsx)(lR.$,{className:sL()(cE,{[cI]:"sm"===p,[cP]:"md"===p||!p||0===p.length,[cO]:"lg"===p}),children:(0,rG.jsx)(cW,{})})]}),(0,rG.jsx)(lT.b,{className:cC,children:o}),(0,rG.jsx)(cR,{variant:"range",today_:y,minDate:j,maxDate:k})]})})})})})});var cK=n(9606);let cX=({diagnoses:e,showCertainty:t=!1})=>{let{diagnosisTags:n}=iT({externalModuleName:"@openmrs/esm-styleguide"});return(0,rG.jsx)("div",{className:"-esm-implementer-tools__diagnosis-tags-module__container___8kut8",children:e.map(e=>{let o=t&&"PROVISIONAL"===e.certainty,r=1===e.rank?n?.primaryColor??"blue":n?.secondaryColor??"gray";return(0,rG.jsx)(cY,{color:r,isProvisional:o,name:e.display},e.uuid)})})};function cY({color:e,isProvisional:t,name:n}){let[o,r]=(0,rF.useState)(!1),[i,s]=(0,rF.useState)(!1),[a,l]=(0,rF.useState)(!1),c=a||i,u=(0,rF.useRef)(null);(0,rF.useLayoutEffect)(()=>{let e=u.current;if(!e)return;let t=()=>{let t=e.scrollWidth>e.clientWidth;l(t),t||r(!1)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[n,t,c]);let d=sL()("cds--tag","cds--tag--md","cds--layout--size-md",`cds--tag--${e}`,"-esm-implementer-tools__diagnosis-tags-module__diagnosisTag___PFhpl"),m=(0,rG.jsxs)(rG.Fragment,{children:[t&&(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("span",{"aria-hidden":"true",className:"-esm-implementer-tools__diagnosis-tags-module__provisionalMark___8o6l4",children:"?"}),(0,rG.jsxs)("span",{className:"cds--visually-hidden",children:[tm("provisional","Provisional")," "]})]}),(0,rG.jsx)("span",{ref:u,className:"cds--tag__label",children:n})]});return c?(0,rG.jsxs)(cK.k$,{delay:0,closeDelay:150,isOpen:o,onOpenChange:r,children:[(0,rG.jsx)(lR.$,{className:d,"data-testid":"diagnosis-tag",onFocusChange:s,onPress:()=>r(!0),children:m}),(0,rG.jsx)(cK.m_,{className:"-esm-implementer-tools__diagnosis-tags-module__tagTooltip___asRTH",placement:"bottom",offset:4,containerPadding:8,children:n})]}):(0,rG.jsx)("span",{className:d,"data-testid":"diagnosis-tag",children:m})}let cZ={action:"-esm-implementer-tools__empty-card-module__action___Y0dul",content:"-esm-implementer-tools__empty-card-module__content___fo0nB",desktopHeading:"-esm-implementer-tools__empty-card-module__desktopHeading___0Cg1N",tabletHeading:"-esm-implementer-tools__empty-card-module__tabletHeading___BogTF",tile:"-esm-implementer-tools__empty-card-module__tile___QB8Ld"},cQ=({width:e="64",height:t="64"})=>(0,rG.jsx)("svg",{width:e,height:t,viewBox:"0 0 64 64",children:(0,rG.jsx)("use",{href:"#omrs-empty-data-illustration"})}),c0=e=>{let t="tablet"===i3(),n=e.launchForm;return(0,rG.jsx)(sF.Layer,{className:cZ.layer,children:(0,rG.jsxs)(sF.Tile,{className:cZ.tile,children:[(0,rG.jsx)("div",{className:t?cZ.tabletHeading:cZ.desktopHeading,children:(0,rG.jsx)("h4",{children:e.headerTitle})}),(0,rG.jsx)(cQ,{}),(0,rG.jsx)("p",{className:cZ.content,children:tm("emptyStateText","There are no {{displayText}} to display",{displayText:e.displayText})}),(0,rG.jsx)("p",{className:cZ.action,children:n&&(0,rG.jsx)(sF.Button,{onClick:()=>n(),kind:"ghost",size:t?"lg":"sm",children:tm("recordNewEntry","Record {{ displayText }}",{displayText:e.displayText})})})]})})},c1=({error:e,headerTitle:t})=>{let n="tablet"===i3();return(0,rG.jsx)(sF.Layer,{children:(0,rG.jsxs)(sF.Tile,{className:"-esm-implementer-tools__error-state-module__tile___dd418",children:[(0,rG.jsx)("div",{className:n?"-esm-implementer-tools__error-state-module__tabletHeading___g5rjg":"-esm-implementer-tools__error-state-module__desktopHeading___Nd9u2",children:(0,rG.jsx)("h4",{children:t})}),(0,rG.jsxs)("p",{className:"-esm-implementer-tools__error-state-module__errorMessage___z2RiN",children:[tm("error","Error")," ",`${e?.response?.status}: `,e?.response?.statusText]}),(0,rG.jsx)("p",{className:"-esm-implementer-tools__error-state-module__errorCopy___dq+e2",children:tm("errorCopy")})]})})},c2=c1,c5=rH().forwardRef((e,t)=>{let{slotName:n,basePath:o,componentContext:r,state:i}=se(),s=window.location??{pathname:""},a=r6(n??"");return e.isChildOfHeader&&n&&a.length>0?(0,rG.jsxs)(sF.SideNav,{"aria-label":tm("leftNavigation","Left navigation"),className:"-esm-implementer-tools__left-nav-module__leftNav___jzTJK",expanded:!0,isFixedNav:!0,ref:t,...e,children:[(0,rG.jsx)(r3,{name:"global-nav-menu-slot"}),n?(0,rG.jsx)(iS,{value:r,fallback:(0,rG.jsx)(r3,{name:n,state:{basePath:o,currentPath:s,...i}}),children:(0,rG.jsx)(rV.Provider,{value:r,children:(0,rG.jsx)(r3,{name:n,state:{basePath:o,currentPath:s,...i}})})}):null]}):null}),c6=({selectedLocationUuid:e,defaultLocationUuid:t,locationTag:n,locationsPerRequest:o=50,onChange:r})=>{let[i,s]=(0,rF.useState)(""),a=(0,rF.useId)(),{location:l}=function(e){let t=e?`/ws/fhir2/R4/Location?_id=${e}`:null,{data:n,error:o,isLoading:r}=iW()(t,tP,{shouldRetryOnError:e=>!!e?.response?.status&&e.response.status>=500});return(0,rF.useMemo)(()=>({location:n?.data?.entry?n.data.entry[0]:null,error:t?o:null,isLoading:!!t&&r}),[n,r,o,t])}(t),{locations:c,isLoading:u,hasMore:d,loadingNewData:m,error:p,setPage:f}=function(e,t=0,n=""){let o=iM(n),{data:r,isLoading:i,isValidating:s,setSize:a,error:l}=iQ()(function(n,r){if(r){let e=r.data?.link?.find(e=>"next"===e.relation);if(!e)return null;let t=new URL(e.url);return t.origin===window.location.origin?e.url:new URL(`${t.pathname}${t.search?`?${t.search}`:""}`,window.location.origin).toString()}let i=`${tN}/Location?`,s=new URLSearchParams;return s.append("_summary","data"),t&&s.append("_count",""+t),n&&s.append("_getpagesoffset",""+n*t),e&&s.append("_tag",e),"string"==typeof o&&""!==o&&s.append("name:contains",o),i+s.toString()},tP);return(0,rF.useMemo)(()=>({locations:r?.length?r?.flatMap(e=>e?.data?.entry??[]):[],isLoading:i,totalResults:r?.[0]?.data?.total,hasMore:!!r?.length&&r?.[r.length-1]?.data?.link?.some(e=>"next"===e.relation),loadingNewData:s,error:l||null,setPage:a}),[i,r,s,a,l])}(n,o,i),g=(0,rF.useMemo)(()=>l&&!i&&t?[l,...c.filter(({resource:e})=>e.id!==t)]:c??[],[l,c,t,i]),h=(0,rF.useCallback)(e=>{r(),s(e.trim())},[r]),w=sr((0,rF.useCallback)(()=>{!m&&d&&f(e=>e+1)},[m,d,f])),_=d?Math.max(0,Math.floor(g.length-o/2)):-1;return(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)(sF.Search,{"aria-describedby":p?`${a}-error`:void 0,labelText:tm("searchForLocation"),id:a,placeholder:tm("searchForLocation"),onChange:e=>h(e.target.value),size:"lg"}),p&&(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__errorNotification___vWBFD",id:`${a}-error`,children:(0,rG.jsx)(sF.InlineNotification,{kind:"error",subtitle:tm("errorLoadingLoginLocations","Unable to load login locations. Please try again or contact support if the problem persists."),title:tm("error","Error")})}),(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__searchResults___Gbet+",children:u?(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__loadingContainer___QO-zj",children:Array.from({length:5}).map((e,t)=>(0,rG.jsx)(sF.RadioButtonSkeleton,{className:"-esm-implementer-tools__location-picker-module__radioButtonSkeleton___otoCy",role:"progressbar"},t))}):(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__locationResultsContainer___6Pasf",children:g.length>0?(0,rG.jsx)(sF.RadioButtonGroup,{name:"loginLocations",onChange:e=>{r(e?.toString())},orientation:"vertical",valueSelected:e,children:g.map((e,t)=>(0,rG.jsx)(sF.RadioButton,{className:"-esm-implementer-tools__location-picker-module__locationRadioButton___rTDPj",id:e.resource.id,labelText:(0,rG.jsx)("span",{ref:t===_?w:null,children:e.resource.name}),name:e.resource.name,value:e.resource.id},e.resource.id))}):(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__emptyState___w4-Ca",children:(0,rG.jsx)("p",{className:"-esm-implementer-tools__location-picker-module__locationNotFound___Of2MJ",children:tm("noResultsToDisplay")})})}),m&&(0,rG.jsx)("div",{className:"-esm-implementer-tools__location-picker-module__loadingIcon___NAwSB",children:(0,rG.jsx)(sF.InlineLoading,{description:tm("loading")})})]})})]})},c8=R("modalState",{modalContainer:null,modalStack:[]}),c4=0;async function c3(e,t,n={}){let o=rN(t),r=null;if(e){if(!o)throw Error(`No modal named '${t}' has been registered.`);let{load:i}=o,s=await i(),a=c4++;r=await rW({...s,name:`${t}-${a}`},{...n,domElement:e})}else y(`Failed to launch modal. Please notify your administrator. Modal name: ${t}`);return r}function c7(e){return"TO_BE_DELETED"===e.state||"DELETED"===e.state}function c9(e,t){t?.unmount&&(t.unmountPromise?.catch(()=>{}),t.unmount().catch(t=>{console.error(`The modal '${e}' failed to unmount`,t)}))}function ue(e){return e.find(e=>!c7(e))}function ut(e,t){e.container&&(e.container.style.visibility=t?"unset":"hidden")}let un=window.getComputedStyle(document.body).overflow;function uo({modalStack:e,modalContainer:t}){if(t)if(e.length){t.style.visibility||(addEventListener("keydown",ui),document.body.style.overflow="hidden",t.style.visibility="unset");let n=ue(e);e.forEach(e=>{switch(e.state){case"NEW":{let n=function({size:e}){let t=document.createElement("div");return t.className=`cds--modal-container cds--modal-container--${e}`,t.setAttribute("role","dialog"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-modal","true"),t}({size:e.props?.size??"md"});e.container=n,e.state="MOUNTING",c3(n,e.modalName,e.props).then(o=>{c7(e)?c9(e.modalName,o):o?(e.parcel=o,t.prepend(n),ut(e,ue(c8.getState().modalStack)===e),o.mountPromise.then(()=>{c7(e)||(e.state="MOUNTED")},t=>{y(t),e.parcel=null,ur(e)})):ur(e)},t=>{y(t),ur(e)});break}case"MOUNTING":case"MOUNTED":ut(e,e===n);break;case"TO_BE_DELETED":e.state="DELETED",e.onClose(),c9(e.modalName,e.parcel),e.container?.remove(),setTimeout(()=>{let t=c8.getState();c8.setState({...t,modalStack:t.modalStack.filter(t=>t!==e)})},0)}})}else t.style.removeProperty("visibility"),document.body.style.overflow=un,removeEventListener("keydown",ui)}function ur(e){if(c7(e))return;e.state="TO_BE_DELETED";let t=c8.getState();c8.setState({...t,modalStack:[...t.modalStack]})}function ui(e){"Escape"===e.key&&function(){let[e]=c8.getState().modalStack;e&&ur(e)}()}function us(e){c8.subscribe(uo),c8.setState({...c8.getState(),modalContainer:e})}function ua(e,t={},n=()=>{}){let o=()=>{let e=c8.getState().modalStack.find(e=>e.onClose===n);e&&ur(e)};if(rN(e)){var r;let i,s;r={state:"NEW",onClose:n,modalName:e,props:{close:o,...t}},s=[r,...(i=c8.getState()).modalStack],c8.setState({...i,modalStack:s})}else y(`Failed to launch modal. Please notify your administrator. Modal name: "${e}"`);return o}var ul=n(9685);let uc=({notification:e})=>{let{description:t,action:n,kind:o,critical:r,title:i,onAction:s}=e;return(0,rG.jsx)(sF.ActionableNotification,{actionButtonLabel:n,kind:o||"info",lowContrast:r,subtitle:t,title:i||"",inline:!0,onActionButtonClick:s})},uu=({subject:e})=>{let[t,n]=(0,rF.useState)([]);return(0,rF.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.action!==e.action||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsx)(uc,{notification:e},e.id))})},ud=({notification:e})=>{let{actionButtonLabel:t,onActionButtonClick:n=()=>{},subtitle:o,kind:r,title:i,critical:s,progressActionLabel:a,id:l,...c}=e,[u,d]=(0,rF.useState)(t);return(0,rG.jsx)(sF.ActionableNotification,{kind:r||"info",actionButtonLabel:u,ariaLabel:tm("closesActionableNotification","Closes actionable notification"),onActionButtonClick:()=>{n(),a&&d(a)},statusIconDescription:tm("actionableNotification","Actionable notification"),subtitle:o,title:i,lowContrast:s,inline:!0,...c})},um=({subject:e})=>{let[t,n]=(0,rF.useState)([]);return(0,rF.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsx)(ud,{notification:e},e.id))})};class up{subscribe(e){return this.listeners.add(e),{unsubscribe:()=>{this.listeners.delete(e)}}}next(e){for(let t of[...this.listeners])t(e)}constructor(){!function(e,t,n){t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n}(this,"listeners",new Set)}}let uf=new up,ug=0,uh=new up,uw=0;function u_(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(uu,{subject:uf}))}function uy(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&(t instanceof Error||!(0,ul.A)(t)))?(e.description instanceof Error&&(e.description=e.description.toLocaleString()),setTimeout(()=>{uf.next({...e,id:ug++})},0)):console.error("showNotification must be called with an object having a 'description' property that is a non-empty string or object")}function uv(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(um,{subject:uh}))}function ub(e){var t;e&&("string"==typeof(t=e.actionButtonLabel)?t.trim().length>0:"object"==typeof t&&!(0,ul.A)(t))?setTimeout(()=>{uh.next({...e,id:uw++})},0):console.error("showActionableNotification must be called with an actionButtonLabel that is a non-empty string")}let ux=["NORMAL","HIGH","CRITICALLY_HIGH","OFF_SCALE_HIGH","LOW","CRITICALLY_LOW","OFF_SCALE_LOW"],uS=["critically_low","critically_high","high","low","normal","off_scale_low","off_scale_high"],uj={container:"-esm-implementer-tools__numeric-observation-module__container___NfxbH",card:"-esm-implementer-tools__numeric-observation-module__card___9oQAh","abnormal-value":"-esm-implementer-tools__numeric-observation-module__abnormal-value___drvEi","critical-value":"-esm-implementer-tools__numeric-observation-module__critical-value___JAIHt",cell:"-esm-implementer-tools__numeric-observation-module__cell___lTunW","critically-high":"-esm-implementer-tools__numeric-observation-module__critically-high___aDUjc","critically-low":"-esm-implementer-tools__numeric-observation-module__critically-low___5srAK",high:"-esm-implementer-tools__numeric-observation-module__high___7KiyK",low:"-esm-implementer-tools__numeric-observation-module__low___Zs2ct","label-container":"-esm-implementer-tools__numeric-observation-module__label-container___lGnGH","value-container":"-esm-implementer-tools__numeric-observation-module__value-container___hHPXt",label:"-esm-implementer-tools__numeric-observation-module__label___WFuxk",value:"-esm-implementer-tools__numeric-observation-module__value___6fHUr",units:"-esm-implementer-tools__numeric-observation-module__units___EdVuw","pad-right":"-esm-implementer-tools__numeric-observation-module__pad-right___6T9Cd","off-scale-low":"-esm-implementer-tools__numeric-observation-module__off-scale-low___Sc1CV","off-scale-high":"-esm-implementer-tools__numeric-observation-module__off-scale-high___cWpU2",arrow:"-esm-implementer-tools__numeric-observation-module__arrow___SLGUh"},uk=({value:e,unit:t,label:n,interpretation:o,referenceRange:r,conceptUuid:i,variant:s="card",patientUuid:a})=>{let l=(0,rF.useId)(),{referenceRange:c,isLoading:u}=function(e,t){let n=null;e&&(n=t?`${tk}/conceptreferencerange/?patient=${t}&concept=${e}&v=full`:`${tk}/conceptreferencerange/?concept=${e}&v=full`);let{data:o,error:r,isLoading:i}=iW()(n,tP),s=o?.data?.results?.[0];return{referenceRange:s?{hiNormal:s.hiNormal??null,hiAbsolute:s.hiAbsolute??null,hiCritical:s.hiCritical??null,lowNormal:s.lowNormal??null,lowAbsolute:s.lowAbsolute??null,lowCritical:s.lowCritical??null}:void 0,error:r,isLoading:i}}(r||o?void 0:i,a),d=r??c,m=(0,rF.useMemo)(()=>{if(o)return o?"--"===o?"normal":ux.includes(o)?o.toLowerCase():uS.includes(o)?o:"normal":void 0;if(d&&!u){if(!d||null==e||""===e)return"normal";let t="string"==typeof e?Number.parseFloat(e):e;return Number.isNaN(t)?"normal":null!==d.hiAbsolute&&void 0!==d.hiAbsolute&&t>d.hiAbsolute?"off_scale_high":null!==d.hiCritical&&void 0!==d.hiCritical&&t>=d.hiCritical?"critically_high":null!==d.hiNormal&&void 0!==d.hiNormal&&t>d.hiNormal?"high":null!==d.lowAbsolute&&void 0!==d.lowAbsolute&&t<d.lowAbsolute?"off_scale_low":null!==d.lowCritical&&void 0!==d.lowCritical&&t<=d.lowCritical?"critically_low":null!==d.lowNormal&&void 0!==d.lowNormal&&t<d.lowNormal?"low":"normal"}return"normal"},[o,d,e,u])??"normal",p="critically_low"===m||"critically_high"===m||"off_scale_low"===m||"off_scale_high"===m,f="normal"!==m,g=n?`omrs-numeric-obs-label-${n.replaceAll(/\s+/g,"-").toLowerCase()}-${l}`:void 0,h=`omrs-numeric-obs-value-${l}`,w=`omrs-numeric-obs-unit-${l}`,_=null!=e&&""!==e,y=_?e:tm("notAvailable","Not available"),v=sL()({[uj["critically-low"]]:"critically_low"===m||"off_scale_low"===m,[uj["critically-high"]]:"critically_high"===m||"off_scale_high"===m,[uj.low]:"low"===m,[uj.high]:"high"===m,[uj["off-scale-low"]]:"off_scale_low"===m,[uj["off-scale-high"]]:"off_scale_high"===m}),b=sL()({[uj.container]:!0,[uj.card]:!0,[uj["critical-value"]]:p,[uj["abnormal-value"]]:f&&!p}),x=sL()({[uj.cell]:!0,[v]:!0});return"cell"===s?(0,rG.jsxs)("div",{className:x,children:[y,_&&t?` ${t}`:""]}):(0,rG.jsxs)("section",{className:b,"data-testid":"numeric-observation-card",children:[n&&(0,rG.jsxs)("div",{className:uj["label-container"],children:[(0,rG.jsx)("span",{id:g,className:uj.label,children:n}),f&&(0,rG.jsx)("span",{className:uj[m.replace("_","-")],title:tm("abnormalValue","Abnormal value")})]}),(0,rG.jsxs)("div",{className:uj["value-container"],children:[(0,rG.jsx)("span",{id:h,"aria-labelledby":g&&w?`${g} ${w}`:g||w||void 0,className:uj.value,children:y}),_&&t&&(0,rG.jsx)("span",{id:w,className:uj.units,children:t})]})]})},uN="-esm-implementer-tools__page-header-module__pageHeader___YOpQL",uC=e=>{if("children"in e){let{children:t,className:n,...o}=e;return(0,rG.jsx)("div",{className:sL()(uN,n),...o,children:t})}{let{title:t,illustration:n,className:o,...r}=e;return(0,rG.jsx)("div",{className:sL()(uN,o),...r,children:(0,rG.jsx)(uE,{title:t,illustration:n})})}},uE=({title:e,illustration:t,className:n})=>{let[o,r]=(0,rF.useState)(null);return(0,rF.useEffect)(()=>{eM("@openmrs/esm-styleguide").then(e=>{r(e)})},[]),(0,rG.jsxs)("div",{className:sL()("-esm-implementer-tools__page-header-module__pageHeaderContent___PjsJm",n),children:[t,(0,rG.jsxs)("div",{className:"-esm-implementer-tools__page-header-module__pageLabels___pPcKj",children:[o?.implementationName&&(0,rG.jsx)("p",{children:tm(o.implementationName)}),(0,rG.jsx)("h1",{className:"-esm-implementer-tools__page-header-module__pageName___3d4IC",children:e})]})]})},uP=({totalItems:e,pageSize:t,onPageNumberChange:n,pageNumber:o,dashboardLinkUrl:r,currentItems:i,dashboardLinkLabel:s})=>{let{pageSizes:a,pageItemsCount:l}=sa(t,e,o,i),c="tablet"===i3(),u=tm("paginationItemsCount","{{pageItemsCount}} / {{totalItems}} items",{totalItems:e,pageItemsCount:l});return(0,rG.jsx)(rG.Fragment,{children:e>0&&(0,rG.jsxs)("div",{className:sL()({"-esm-implementer-tools__pagination-module__tablet___lQ3ak":c,"-esm-implementer-tools__pagination-module__desktop___HfUTY":!c}),children:[(0,rG.jsxs)("div",{children:[u,r&&(0,rG.jsx)(rz,{to:r,className:"-esm-implementer-tools__pagination-module__configurableLink___NM9v7",children:s??tm("seeAll","See all")})]}),(0,rG.jsx)(sF.Pagination,{className:"-esm-implementer-tools__pagination-module__pagination___WzkBs",page:o,pageSize:t,pageSizes:a,totalItems:e,onChange:n,pageRangeText:(e,t)=>tm("paginationOfPages","of {{count}} pages",{count:t}),size:c?"lg":"sm"})]})})};function uI(e){return uA(uT(e,"usual","official"))}function uO(e){return uI(e)}function uA(e){var t;let n;return e?e.text??(n=(t=e).given??[],(t.family?n.concat(t.family):n).join(" ")):""}function uR(e){return uA(e)}function uT(e,...t){for(let n of(0==t.length&&(t=["usual"]),t)){let t=e.name?.find(e=>{var t,o;return t=e,o=n,t.use?t.use===o:"usual"===o});if(t)return t}}function u$(e,t=sf()){let n=sf(t),o=ca(e,n);if(null==o)return null;let r=n.diff(o,"hours"),i=n.diff(o,"days"),s=n.diff(o,"weeks"),a=n.diff(o,"months"),l=n.diff(o,"years"),c={};if(r<2)c.minutes=n.diff(o,"minutes");else if(i<2)c.hours=r;else if(s<4)c.days=i;else if(l<1){let e=n.subtract(s,"weeks").diff(o,"days");c.weeks=s,c.days=e}else if(l<2){let e=n.subtract(a,"months").diff(o,"days");c.months=a,c.days=e}else if(l<18){let e=n.subtract(l,"year").diff(o,"months");c.years=l,c.months=e}else c.years=l;return c}function uM(e,t=sf()){let n=u$(e,t);if(null==n)return null;let o={style:"short",localeMatcher:"lookup"};return"minutes"in n&&0===n.minutes&&(o.minutesDisplay="always"),cs(n,o)}let uL={container:"-esm-implementer-tools__patient-banner-patient-info-module__container___Gjd-4",activePatientContainer:"-esm-implementer-tools__patient-banner-patient-info-module__activePatientContainer___QLcpg",patientBanner:"-esm-implementer-tools__patient-banner-patient-info-module__patientBanner___7nrgC",patientName:"-esm-implementer-tools__patient-banner-patient-info-module__patientName___-bF9a",patientAvatar:"-esm-implementer-tools__patient-banner-patient-info-module__patientAvatar___AkN3H",patientAvatarButton:"-esm-implementer-tools__patient-banner-patient-info-module__patientAvatarButton___KDxA6",patientInfo:"-esm-implementer-tools__patient-banner-patient-info-module__patientInfo___+WtDB",demographics:"-esm-implementer-tools__patient-banner-patient-info-module__demographics___Vtf3v",row:"-esm-implementer-tools__patient-banner-patient-info-module__row___NIOYI",flexRow:"-esm-implementer-tools__patient-banner-patient-info-module__flexRow___VxdGB",tagsSlot:"-esm-implementer-tools__patient-banner-patient-info-module__tagsSlot___lU6+4",identifiers:"-esm-implementer-tools__patient-banner-patient-info-module__identifiers___tehd8",identifier:"-esm-implementer-tools__patient-banner-patient-info-module__identifier___bSJIF",primaryIdentifier:"-esm-implementer-tools__patient-banner-patient-info-module__primaryIdentifier___yOV1B",secondaryIdentifier:"-esm-implementer-tools__patient-banner-patient-info-module__secondaryIdentifier___WvJbh",value:"-esm-implementer-tools__patient-banner-patient-info-module__value___sBM-q",tag:"-esm-implementer-tools__patient-banner-patient-info-module__tag___BEvEV",gender:"-esm-implementer-tools__patient-banner-patient-info-module__gender___4XkLq",separator:"-esm-implementer-tools__patient-banner-patient-info-module__separator___iYBA3",tooltipPadding:"-esm-implementer-tools__patient-banner-patient-info-module__tooltipPadding___EWVCK",tooltipSmallText:"-esm-implementer-tools__patient-banner-patient-info-module__tooltipSmallText___yDmRU",actionsButtonText:"-esm-implementer-tools__patient-banner-patient-info-module__actionsButtonText___mn139"};function uW({showIdentifierLabel:e,type:t,value:n}){return(0,rG.jsx)("span",{className:uL.primaryIdentifier,children:(0,rG.jsxs)(sF.Tag,{className:uL.tag,type:"gray",children:[e&&t?.text&&(0,rG.jsxs)("span",{className:uL.label,children:[t.text,": "]}),(0,rG.jsx)("span",{className:uL.value,children:n})]})})}function uD({showIdentifierLabel:e,type:t,value:n}){return(0,rG.jsxs)(sF.FormLabel,{className:uL.secondaryIdentifier,id:`patient-banner-identifier-${n}`,children:[e&&(0,rG.jsxs)("span",{className:uL.label,children:[t?.text,": "]}),(0,rG.jsx)("span",{className:uL.value,children:n})]})}function uU({identifiers:e,showIdentifierLabel:t}){let{excludePatientIdentifierCodeTypes:n}=iT(),{primaryIdentifierCode:o}=su(),r=e?.filter(e=>{let t=e.type?.coding?.[0]?.code;return t&&!n?.uuids.includes(t)})??[];return(0,rG.jsx)(rG.Fragment,{children:r?.length?r.map(({value:e,type:n},i)=>(0,rG.jsxs)(rH().Fragment,{children:[(0,rG.jsx)("span",{className:uL.identifier,children:n?.coding?.[0]?.code===o?(0,rG.jsx)(uW,{showIdentifierLabel:t,type:n,value:e}):(0,rG.jsx)(uD,{showIdentifierLabel:t,type:n,value:e})}),i<r.length-1&&(0,rG.jsx)("span",{className:uL.separator,children:"\xb7"})]},e)):""})}let uB={Female:aj,Male:ak,Other:aN,Unknown:aC},uF=({gender:e})=>{let t=uB[e];return t?(0,rG.jsx)(t,{fill:"#525252"}):null},uH={male:"Male",female:"Female",other:"Other",unknown:"Unknown"};function uV({patient:e,renderedFrom:t}){var n;let o,r,i=uI(e),s=e?.gender&&(r=uH[o=(n=e.gender).toLowerCase()]??"Unknown",{displayText:tm(o,n),iconKey:r}),a=(0,rF.useMemo)(()=>({patientUuid:e.id,patient:e,renderedFrom:t}),[e.id,e,t]);return(0,rG.jsxs)("div",{className:uL.patientInfo,children:[(0,rG.jsx)("div",{className:sL()(uL.row,uL.patientNameRow),children:(0,rG.jsxs)("div",{className:uL.flexRow,children:[(0,rG.jsx)("span",{className:uL.patientName,children:i}),s&&(0,rG.jsxs)("div",{className:uL.gender,children:[(0,rG.jsx)(uF,{gender:s.iconKey}),(0,rG.jsx)("span",{children:s.displayText})]}),(0,rG.jsx)(r3,{className:uL.tagsSlot,name:"patient-banner-tags-slot",state:a})]})}),(0,rG.jsxs)("div",{className:uL.demographics,children:[e.birthDate&&(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("span",{children:uM(e.birthDate)}),(0,rG.jsx)("span",{className:uL.separator,children:"\xb7"}),(0,rG.jsx)("span",{children:ce(e.birthDate,{time:!1,noToday:!0})}),(0,rG.jsx)("span",{className:uL.separator,children:"\xb7"})]}),(0,rG.jsx)(uU,{identifiers:e.identifier,showIdentifierLabel:!0}),(0,rG.jsx)(r3,{className:uL.extensionSlot,name:"patient-banner-bottom-slot",state:a})]})]})}var uG=n(7683);function uz({patient:e,patientUuid:t,actionsSlotName:n,additionalActionsSlotState:o}){let[r,i]=(0,rF.useState)(!1),{extensions:s}=r8(n),a="tablet"===i3(),l=so(()=>i(!1),r),c=(0,rF.useRef)(null),u=(0,rF.useRef)(null),d=(0,rF.useId)(),m=`patient-actions-menu-trigger-${d}`,p=`patient-actions-menu-${d}`,f=(0,rF.useCallback)(()=>i(e=>!e),[]),g=(0,rF.useCallback)(()=>{i(!1),c.current?.focus()},[]),h=(0,rF.useCallback)(e=>{if("Escape"===e.key&&r){e.stopPropagation(),g();return}if(("ArrowDown"===e.key||"ArrowUp"===e.key)&&r){e.preventDefault();let t=u.current?.querySelectorAll('[role="menuitem"]:not([disabled])');if(!t?.length)return;let n=document.activeElement?.closest?.('[role="menuitem"]')??document.activeElement,o=Array.from(t).indexOf(n);if(-1===o)return void t["ArrowDown"===e.key?0:t.length-1]?.focus();let r=o+("ArrowDown"===e.key?1:-1),i=r<0?t.length-1:r>=t.length?0:r;t[i]?.focus()}},[g,r]);(0,rF.useEffect)(()=>{if(r&&u.current){let e=u.current.querySelector('[role="menuitem"]:not([disabled])');e?.focus()}},[r]);let w=(0,rF.useMemo)(()=>({patientUuid:t,patient:e,closeMenu:g,...o}),[t,e,g,o]);return 0===s.length?null:(0,rG.jsx)("div",{className:"-esm-implementer-tools__patient-banner-actions-menu-module__overflowMenuContainer___lXHHD",children:(0,rG.jsxs)("div",{"data-overflow-menu":!0,className:sL()("cds--overflow-menu",sG),ref:l,children:[(0,rG.jsxs)("button",{className:sL()("cds--btn","cds--btn--ghost","cds--overflow-menu__trigger",{"cds--overflow-menu--open":r},sJ),"aria-controls":p,"aria-expanded":r,"aria-haspopup":"true",id:m,onClick:f,onKeyDown:h,ref:c,children:[(0,rG.jsx)("span",{className:"-esm-implementer-tools__patient-banner-actions-menu-module__actionsButtonText___SdOyM",children:tm("actions","Actions")})," ",(0,rG.jsx)(uG.CH,{size:16,style:{marginLeft:"0.5rem",fill:"#78A9FF"}})]}),(0,rG.jsxs)("div",{className:sL()("cds--overflow-menu-options","cds--overflow-menu--flip",sz,{[sq]:r}),"aria-labelledby":m,"data-floating-menu-direction":"bottom",id:p,onKeyDown:h,ref:u,role:"menu",tabIndex:-1,children:[(0,rG.jsx)("ul",{className:sL()("cds--overflow-menu-options__content",{"cds--overflow-menu-options--lg":a}),children:(0,rG.jsx)(r3,{name:n,state:w},n)}),(0,rG.jsx)("span",{})]})]})})}var uq=n(397),uJ=n.n(uq);function uK(e){let{patientPhotoConceptUuid:t}=iT({externalModuleName:"@openmrs/esm-styleguide"}),n=t?`${tk}/obs?patient=${e}&concept=${t}&v=full`:null,{data:o,error:r,isLoading:i}=ir()(e?n:null,tP),s=o?.data?.results[0];return{data:s?{dateTime:s?.obsDatetime,imageSrc:s?.value?.links?.uri}:null,error:r,isLoading:i}}let uX=({width:e=56,height:t=56,"aria-label":n})=>{let{t:o}=(0,it.useTranslation)();return(0,rG.jsxs)("svg",{"aria-label":n??o("patientPhotoPlaceholder","Patient photo placeholder"),width:e,height:t,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,rG.jsx)("path",{fill:"#ffffff",d:"M0 0h56v56H0z"}),(0,rG.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m36.75 20.134-.884-.884L19.25 35.866l.884.884 1.25-1.25H34.25a1.252 1.252 0 0 0 1.25-1.25V21.384l1.25-1.25Zm-2.5 14.116H22.634l4.87-4.87 1.487 1.486a1.25 1.25 0 0 0 1.768 0l.991-.991 2.5 2.498v1.877Zm0-3.645-1.616-1.616a1.25 1.25 0 0 0-1.768 0l-.991.991-1.486-1.486 5.861-5.86v7.971Zm-12.5 1.145v-1.875l3.125-3.123.858.859.885-.885-.86-.86a1.25 1.25 0 0 0-1.767 0l-2.241 2.242V21.75h10V20.5h-10c-.69 0-1.25.56-1.25 1.25v10h1.25Z",fill:"#8D8D8D"})]})},uY="-esm-implementer-tools__patient-photo-module__avatar___t5TmZ";function uZ({patientUuid:e,patientName:t,alt:n}){let{data:o,isLoading:r}=uK(e),[i,s]=(0,rF.useState)(null),[a,l]=(0,rF.useState)(!1),c=(0,rF.useMemo)(()=>uJ().generate(e),[e]);(0,rF.useEffect)(()=>{if(o?.imageSrc){let e=new URL(o.imageSrc,window.location.origin).pathname;l(!0);let t=!1,n=new Image;return n.onload=()=>{t||(s(e),l(!1))},n.onerror=()=>{t||(s(null),l(!1))},n.src=e,()=>{t=!0}}s(null),l(!1)},[o?.imageSrc]);let u=(0,rF.useMemo)(()=>n||(i?tm("patientPhotoAlt","Profile photo of {{patientName}}",{patientName:t}):tm("patientAvatarAlt","Avatar for {{patientName}}",{patientName:t})),[n,i,t]);return r||a?(0,rG.jsx)(sF.SkeletonIcon,{className:"-esm-implementer-tools__patient-photo-module__skeleton___ueN8Q","data-testid":"skeleton-icon"}):o?.imageSrc&&!i?(0,rG.jsx)(uX,{"aria-label":tm("patientPhotoPlaceholder","Photo placeholder for {{patientName}}",{patientName:t})}):i?(0,rG.jsx)("div",{"aria-label":u,children:(0,rG.jsx)("img",{className:uY,src:i,alt:u,title:t})}):(0,rG.jsx)("div",{"aria-label":u,children:(0,rG.jsx)("div",{className:uY,title:t,style:{backgroundImage:c.toDataUrl(),backgroundRepeat:"no-repeat",backgroundSize:"cover"},children:(0,rG.jsx)("span",{className:"-esm-implementer-tools__patient-photo-module__initials___-k9Hv",children:function(e,t=3){return e.split(/\s+/).filter(Boolean).slice(0,t).map(e=>e[0]).join("")}(t)})})})}let uQ=["omrs-pict-appointments","omrs-pict-assessment-1","omrs-pict-assessment-2","omrs-pict-blood-bank","omrs-pict-cardiology","omrs-pict-cohorts","omrs-pict-concept-dictionary","omrs-pict-ct-scan","omrs-pict-data-entry","omrs-pict-dentistry","omrs-pict-digital-trust","omrs-pict-emergency-department","omrs-pict-facility","omrs-pict-geriatrics","omrs-pict-gynaecology","omrs-pict-in-patient","omrs-pict-laboratory","omrs-pict-labs-2","omrs-pict-metadata-export","omrs-pict-obstetrics","omrs-pict-patient-documents","omrs-pict-patient-search","omrs-pict-patients","omrs-pict-payments-desk","omrs-pict-pharmacy","omrs-pict-pharmacy-2","omrs-pict-registration","omrs-pict-reports","omrs-pict-service-queues","omrs-pict-stock-management","omrs-pict-system-administration","omrs-pict-transfer","omrs-pict-triage","omrs-pict-x-ray"],u0=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-appointments",pictogramProps:e})})),u1=u0,u2=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-assessment-1",pictogramProps:e})})),u5=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-assessment-2",pictogramProps:e})})),u6=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-blood-bank",pictogramProps:e})})),u8=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-cardiology",pictogramProps:e})})),u4=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-cohorts",pictogramProps:e})})),u3=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-concept-dictionary",pictogramProps:e})})),u7=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-ct-scan",pictogramProps:e})})),u9=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-data-entry",pictogramProps:e})})),de=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-dentistry",pictogramProps:e})})),dt=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-digital-trust",pictogramProps:e})})),dn=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-emergency-department",pictogramProps:e})})),dr=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-facility",pictogramProps:e})})),di=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-geriatrics",pictogramProps:e})})),ds=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-gynaecology",pictogramProps:e})})),da=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-in-patient",pictogramProps:e})})),dl=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-laboratory",pictogramProps:e})})),dc=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-labs-2",pictogramProps:e})})),du=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-metadata-export",pictogramProps:e})})),dd=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-obstetrics",pictogramProps:e})})),dm=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-patient-documents",pictogramProps:e})})),dp=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-patient-search",pictogramProps:e})})),df=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-patients",pictogramProps:e})})),dg=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-payments-desk",pictogramProps:e})})),dh=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-pharmacy",pictogramProps:e})})),dw=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-pharmacy-2",pictogramProps:e})})),d_=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-registration",pictogramProps:e})})),dy=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-reports",pictogramProps:e})})),dv=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-service-queues",pictogramProps:e})})),db=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-stock-management",pictogramProps:e})})),dx=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-system-administration",pictogramProps:e})})),dS=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-transfer",pictogramProps:e})})),dj=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-triage",pictogramProps:e})})),dk=(0,rF.memo)((0,rF.forwardRef)(function(e,t){return(0,rG.jsx)(dP,{ref:t,pictogram:"omrs-pict-x-ray",pictogramProps:e})})),dN=dr,dC=df,dE=(0,rF.memo)((0,rF.forwardRef)(function({pictogram:e,fallback:t,...n},o){let r=(0,rF.useRef)(document.getElementById(e));return(0,rF.useEffect)(()=>{let t=document.getElementById("omrs-svgs-container"),n=new MutationObserver(t=>{for(let n of t)"childList"===n.type&&(r.current=document.getElementById(e))});return t&&n.observe(t,{childList:!0}),()=>n.disconnect()},[e]),(0,rG.jsx)(iS,{value:r.current,fallback:t,children:(0,rG.jsx)(dP,{ref:o,pictogram:e,pictogramProps:n})})})),dP=(0,rF.memo)((0,rF.forwardRef)(function({pictogram:e,pictogramProps:t},n){let{className:o,size:r}=Object.assign({},{size:92},t);return(r<=26||r>144)&&(console.error(`Invalid size '${r}' specified for ${e}. Defaulting to 92.`),r=92),(0,rG.jsx)("svg",{ref:n,className:sL()("-esm-implementer-tools__pictograms-module__pictogram___wXX7t",o),height:r,width:r,children:(0,rG.jsx)("use",{href:`#${e}`})})})),dI=({children:e})=>"tablet"===i3()?(0,rG.jsx)(sF.Layer,{children:e}):(0,rG.jsx)(rG.Fragment,{children:e}),dO=({snackbar:e,closeSnackbar:t})=>{let{actionButtonLabel:n="",kind:o="success",onActionButtonClick:r=()=>{},isLowContrast:i="error"!==o,progressActionLabel:s,subtitle:a="",timeoutInMs:l=5e3,autoClose:c="error"!==o,title:u,id:d,...m}=e,[p,f]=(0,rF.useState)(n),[g,h]=(0,rF.useState)(!0),[w,_]=(0,rF.useState)(!1),y=(0,rF.useCallback)(()=>{setTimeout(t,250)},[t]),v=(0,rF.useCallback)(()=>{_(!0),y()},[y]);return(0,rF.useEffect)(()=>{if(c){let e=setTimeout(v,l);return()=>clearTimeout(e)}},[l,c,v]),(0,rF.useEffect)(()=>{h(!1),window.setTimeout(()=>{h(!0)},0)},[]),(0,rG.jsx)(sF.ActionableNotification,{actionButtonLabel:p,"aria-label":tm("closeSnackbar","Close snackbar"),className:sL()("-esm-implementer-tools__snackbar-module__slideIn___-oZIt",{"-esm-implementer-tools__snackbar-module__animated___M2YBU":g,"-esm-implementer-tools__snackbar-module__slideOut___yEmGT":w}),kind:o,lowContrast:i,onActionButtonClick:()=>{r(),v(),s&&f(s)},onClose:y,statusIconDescription:tm("snackbarNotification","Snackbar notification"),subtitle:a,title:u,...m})},dA=({subject:e})=>{let[t,n]=(0,rF.useState)([]),o=(0,rF.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,rF.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.subtitle!==e.subtitle||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick||t.kind!==e.kind||t.title!==e.title),e]));return()=>t.unsubscribe()},[e]),(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsx)(dO,{snackbar:e,closeSnackbar:()=>o(e)},e.id))})},dR=new up,dT=0;function d$(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(dA,{subject:dR}))}function dM(e){var t;e&&"string"==typeof(t=e.title)&&t.trim().length>0?setTimeout(()=>{dR.next({...e,id:dT++})},0):console.error("showSnackbar must be called with an object having a 'title' property that is a non-empty string")}let dL=({toast:e,closeToast:t})=>{let{description:n,kind:o,critical:r,title:i,actionButtonLabel:s,onActionButtonClick:a=()=>{}}=e,l=(0,rF.useCallback)(()=>{a(),t()},[t,a]);return(0,rG.jsx)("div",{children:(0,rG.jsx)(sF.ActionableNotification,{actionButtonLabel:s,kind:o||"info",lowContrast:r,subtitle:n,title:i||"",onActionButtonClick:l,onClose:t})})},dW=({subject:e})=>{let[t,n]=(0,rF.useState)([]),o=(0,rF.useCallback)(e=>{n(t=>t.filter(t=>t!==e))},[]);return(0,rF.useEffect)(()=>{let t=e.subscribe(e=>n(t=>[...t.filter(t=>t.description!==e.description||t.kind!==e.kind||t.title!==e.title||t.actionButtonLabel!==e.actionButtonLabel||t.onActionButtonClick!==e.onActionButtonClick),e]));return()=>t.unsubscribe()},[e]),(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsx)(dL,{toast:e,closeToast:()=>o(e)},e.id))})},dD=new up,dU=0;function dB(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(dW,{subject:dD}))}function dF(e){var t;e&&("string"==typeof(t=e.description)?t.trim().length>0:"object"==typeof t&&!(0,ul.A)(t))?setTimeout(()=>{dD.next({...e,id:dU++})},0):console.error("showToast must be called with an object having a 'description' property that is a non-empty string or object")}var dH=n(4656);async function dV(e,t){let{openedGroup:n}=rC.getState();if(n){if(n.groupName===e&&dq(n.props,t))return!0;else if(!await dX({reason:"CLOSE_WORKSPACE_GROUP",explicit:!1}))return!1}return rC.setState(n=>({...n,openedGroup:{groupName:e,props:t},openedWindows:[]})),!0}async function dG(e){let{openedGroup:t,openedWindows:n}=rC.getState();if(t){if(n.length>0&&!(e||await dX({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})))return!1;rC.setState(e=>({...e,openedGroup:null,openedWindows:[]}))}return!0}async function dz(e,t=null,n=null,o=null){let r=rC.getState();if(!r.registeredWorkspacesByName[e])throw Error(`Unable to launch workspace ${e}. Workspace is not registered`);let i=rE(e);if(!i)throw Error(`Unable to launch workspace ${e}. Workspace is not registered to a workspace window`);let{openedGroup:s}=r,{name:a}=i,l=rP(a);if(!l)throw Error(`Unable to launch workspace ${e}. Workspace window ${i.name} is not registered to a workspace group`);let c=rI(e);if(s&&(s.groupName!==l.name||!dq(s.props,o)))return!!await dX({reason:"CLOSE_WORKSPACE_GROUP",explicit:!0})&&(rC.setState({...r,openedGroup:{groupName:l.name,props:o},openedWindows:[{windowName:a,openedWorkspaces:[d3(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0);if(c>=0){let o=r.openedWindows[c],i=r.openedGroup?.props??{},s=r.isMostRecentlyOpenedWindowHidden,{openedWorkspaces:u}=o;if(dq(o.props,n)){let d=u.find(t=>t.workspaceName===e);return d&&dq(d.props,t)?((s||c!==r.openedWindows.length-1)&&rC.setState(d2.restoreWindow(r,a)),!0):!!await dX({reason:"CLOSE_WORKSPACE",explicit:!1,windowName:a,workspaceName:e})&&(rC.setState({...r,openedGroup:{groupName:l.name,props:r?.openedGroup?.props??i},openedWindows:[...r.openedWindows.filter((e,t)=>t!==c),{windowName:a,openedWorkspaces:[d3(e,t)],props:o?.props??n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return!!await dX({reason:"CLOSE_WINDOW",explicit:!1,windowName:a})&&(rC.setState({...r,openedGroup:{groupName:l.name,props:i??r?.openedGroup?.props},openedWindows:[...r.openedWindows.filter((e,t)=>t!==c),{windowName:a,openedWorkspaces:[d3(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}return"closable"!=l.persistence?(rC.setState({...r,openedGroup:{groupName:l.name,props:o??r?.openedGroup?.props??null},openedWindows:[...r.openedWindows,{windowName:a,openedWorkspaces:[d3(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0):!!await dX({reason:"CLOSE_OTHER_WINDOWS",explicit:!1,windowNameToSpare:i.name})&&(rC.setState({...r,openedGroup:{groupName:l.name,props:o??r?.openedGroup?.props??null},openedWindows:[{windowName:a,openedWorkspaces:[d3(e,t)],props:n,maximized:!1}],isMostRecentlyOpenedWindowHidden:!1}),!0)}function dq(e,t){return null==e||null==t||x(e,t)}function dJ(e,t){let n=[];for(let o=e.openedWorkspaces.length-1;o>=0;o--){let r=e.openedWorkspaces[o];if(r.hasUnsavedChanges&&n.push(r),t&&r.workspaceName===t)break}return n}function dK(e){return 0===e.length?Promise.resolve(!0):new Promise(t=>{let n=ua("workspace2-close-prompt",{size:"sm",onConfirm:()=>{n(),t(!0)},onCancel:()=>{n(),t(!1)},affectedWorkspaceTitles:e.map(e=>e.title??"")})})}function dX(e){let{openedWindows:t}=rC.getState(),n=[];switch(e.reason){case"CLOSE_WORKSPACE_GROUP":n=t.flatMap(e=>dJ(e));break;case"CLOSE_WINDOW":{let o=t.find(t=>t.windowName===e.windowName);if(!o)throw Error(`Window ${e.windowName} not found in opened windows.`);n=dJ(o);break}case"CLOSE_WORKSPACE":{let o=t.find(t=>t.windowName===e.windowName);if(!o)throw Error(`Window ${e.windowName} not found in opened windows.`);n=dJ(o,e.workspaceName);break}case"CLOSE_OTHER_WINDOWS":n=t.filter(t=>t.windowName!==e.windowNameToSpare).flatMap(e=>dJ(e))}return dK(n)}function dY(e,t){return dK(dJ(e,t))}function dZ(e,t){let n=e.openedWorkspaces.findIndex(e=>e.workspaceName===t);return n<0?e:0===n?null:{...e,openedWorkspaces:e.openedWorkspaces.slice(0,n)}}function dQ(e,t,n,o){let{registeredWorkspacesByName:r}=rC.getState(),i=r[n];if(!i)throw Error(`No workspace named "${n}" registered`);let s=r[t];if(!s)throw Error(`No workspace named "${t}" registered`);if(s.window!==i.window)throw Error(`Child workspace ${n} does not belong to the same workspace window as parent workspace ${t}`);if(i.window!==e.windowName)throw Error(`Cannot open child workspace ${n} as window ${i.window} is not opened`);let{openedWorkspaces:a}=e,l=a.findIndex(e=>e.workspaceName===t);if(-1===l)throw Error(`Cannot open child workspace ${n} from parent workspace ${t} as the parent is not opened within the workspace window`);let c=a.slice(0,l+1);return{...e,openedWorkspaces:[...c,d3(n,o)]}}function d0(e,t,n){let o=e.openedWorkspaces.findIndex(e=>e.uuid===t);if(o<0)return e;let r=e.openedWorkspaces[o];if(Object.keys(n).every(e=>r[e]===n[e]))return e;let i=[...e.openedWorkspaces];return i[o]={...r,...n},{...e,openedWorkspaces:i}}function d1(e,t,n){let o=e.openedWindows.findIndex(e=>e.openedWorkspaces.some(e=>e.uuid===t));if(o<0)return e;let r=e.openedWindows[o],i=d0(r,t,n);if(i===r)return e;let s=[...e.openedWindows];return s[o]=i,{...e,openedWindows:s}}let d2={setWindowMaximized(e,t,n){let o=e.openedWindows.findIndex(e=>e.windowName===t),r=[...e.openedWindows],i={...r[o],maximized:n};return r[o]=i,{...e,openedWindows:r}},hideWindow:e=>({...e,isMostRecentlyOpenedWindowHidden:!0}),restoreWindow(e,t){let n=e.openedWindows.findIndex(e=>e.windowName===t),o=e.openedWindows[n],r=[...e.openedWindows.filter((e,t)=>t!==n),o];return{...e,openedWindows:r,isMostRecentlyOpenedWindowHidden:!1}},closeWorkspace(e,t){let n=e.openedWindows.findIndex(e=>e.openedWorkspaces.some(e=>e.workspaceName===t));if(n<0)return e;let o=dZ(e.openedWindows[n],t),r=[...e.openedWindows],i=e.isMostRecentlyOpenedWindowHidden;if(null===o){let t=n===e.openedWindows.length-1;r.splice(n,1),t&&r.length>0&&(i=!1)}else r[n]=o;return{...e,openedWindows:r,isMostRecentlyOpenedWindowHidden:i}},openChildWorkspace(e,t,n,o){let r=e.registeredWorkspacesByName[n];if(!r)throw Error(`No workspace named "${n}" registered`);let i=e.openedWindows.findIndex(e=>e.windowName===r.window);if(-1==i)throw Error(`Cannot open child workspace ${n} as window ${r.window} is not opened`);let s=[...e.openedWindows];return s[i]=dQ(e.openedWindows[i],t,n,o),{...e,openedWindows:s}},setHasUnsavedChanges:(e,t,n)=>d1(e,t,{hasUnsavedChanges:n}),setWorkspaceTitle:(e,t,n)=>d1(e,t,{title:n})};function d5(){return rZ(rC,d2)}let d6=()=>(0,rF.useContext)(ie.i),d8=()=>Object.keys(rC.getState().registeredWorkspacesByName);function d4(e,t,n){let o=e.openedWorkspaces[e.openedWorkspaces.length-1];return(o?t[o.workspaceName]?.width:void 0)??n[e.windowName]?.width??"narrow"}function d3(e,t){return{workspaceName:e,props:t??{},hasUnsavedChanges:!1,uuid:(0,dH.A)()}}function d7(e,t,n){let o=rC.getState().registeredWorkspacesByName[e];return o?{windowName:o.window,openedWorkspaces:[d3(e,t)],props:n??null,maximized:!1}:null}let d9=({title:e,children:t,hasUnsavedChanges:n=!1})=>{let{setHasUnsavedChanges:o,setWorkspaceTitle:r}=d6();return(0,rF.useEffect)(()=>{o(n??!1)},[n,o]),(0,rF.useEffect)(()=>{r(e)},[e,r]),(0,rG.jsx)(rG.Fragment,{children:t})};var me=n(1820),mt=n(3173),mn=n(185);let mo={workspaceOuterContainer:"-esm-implementer-tools__workspace2-module__workspaceOuterContainer___bPVpy",narrowWorkspace:"-esm-implementer-tools__workspace2-module__narrowWorkspace___kSYS7",widerWorkspace:"-esm-implementer-tools__workspace2-module__widerWorkspace___nW2HB",extraWideWorkspace:"-esm-implementer-tools__workspace2-module__extraWideWorkspace___em5yA",workspaceMiddleContainer:"-esm-implementer-tools__workspace2-module__workspaceMiddleContainer___Bx1i6",maximized:"-esm-implementer-tools__workspace2-module__maximized___Kfygr",hidden:"-esm-implementer-tools__workspace2-module__hidden___RPimX",workspaceInnerContainer:"-esm-implementer-tools__workspace2-module__workspaceInnerContainer___5zxpt",workspaceSpacer:"-esm-implementer-tools__workspace2-module__workspaceSpacer___E+982",loader:"-esm-implementer-tools__workspace2-module__loader___vmBQn",hiddenExtraWorkspace:"-esm-implementer-tools__workspace2-module__hiddenExtraWorkspace___qkbMG",header:"-esm-implementer-tools__workspace2-module__header___IZ-2+",headerButtons:"-esm-implementer-tools__workspace2-module__headerButtons___81a2N",workspaceContent:"-esm-implementer-tools__workspace2-module__workspaceContent___eetPy",overlayHeaderSpacer:"-esm-implementer-tools__workspace2-module__overlayHeaderSpacer___ruc6r",isActionMenuOpened:"-esm-implementer-tools__workspace2-module__isActionMenuOpened___XgCkc",showActionMenu:"-esm-implementer-tools__workspace2-module__showActionMenu___sHRt1",marginWorkspaceContent:"-esm-implementer-tools__workspace2-module__marginWorkspaceContent___TN+S+",workspaceContainerWithActionMenu:"-esm-implementer-tools__workspace2-module__workspaceContainerWithActionMenu___xLg8e",workspaceFixedContainer:"-esm-implementer-tools__workspace2-module__workspaceFixedContainer___W9cgZ",workspaceContainerWithoutActionMenu:"-esm-implementer-tools__workspace2-module__workspaceContainerWithoutActionMenu___fRrxd"},mr=e=>e.registeredWorkspacesByName,mi=({lifeCycle:e,openedWorkspace:t,openedWindow:n,groupProps:o,actions:r,renderChrome:i,isRootWorkspace:s,isLeafWorkspace:a,showActionMenu:l})=>{let c=(0,rF.useMemo)(()=>t&&{closeWorkspace:async(e={})=>{let{closeWindow:o=!1,discardUnsavedChanges:i=!1}=e;return o?!!(i||await r.promptForClosingWorkspaces())&&(r.closeWorkspace(n.openedWorkspaces[0].workspaceName),!0):!!(i||await r.promptForClosingWorkspaces(t.workspaceName))&&(r.closeWorkspace(t.workspaceName),!0)},launchChildWorkspace:async(e,o)=>{let i=t.workspaceName,{openedWorkspaces:s}=n,a=s.findIndex(e=>e.workspaceName===i);-1===a||a!==s.length-1&&s.slice(a+1).some(e=>e.hasUnsavedChanges)&&!await r.promptForClosingWorkspaces(s[a+1].workspaceName)||r.openChildWorkspace(i,e,o||{})},setWorkspaceTitle:e=>r.setWorkspaceTitle(t.uuid,e),setHasUnsavedChanges:e=>r.setHasUnsavedChanges(t.uuid,e),workspaceName:t.workspaceName,workspaceProps:t.props,windowProps:n.props,groupProps:o,workspaceMeta:rC.getState().registeredWorkspacesByName[t.workspaceName]?.meta??{},isRootWorkspace:s,isLeafWorkspace:a,windowName:n.windowName,showActionMenu:l},[t,n,o,r,s,a,l]),u=!i&&!a,d=(0,rF.useMemo)(()=>e?(0,rG.jsx)(me.A,{config:e,mountParcel:rU,wrapWith:"div",wrapClassName:sL()(mo.workspaceContent,{[mo.hiddenExtraWorkspace]:u}),...c},t.workspaceName):null===e?(0,rG.jsx)("div",{className:sL()(mo.workspaceContent,{[mo.hiddenExtraWorkspace]:u}),children:(0,rG.jsx)(sF.InlineNotification,{kind:"error",title:tm("error"),subtitle:tm("somethingWentWrongTryReloading"),hideCloseButton:!0})}):null,[e,t.workspaceName,c,u]);return i?(0,rG.jsx)("div",{children:(0,rG.jsx)(ms,{openedWorkspace:t,openedWindow:n,isRootWorkspace:s,showActionMenu:l,closeWindow:()=>c.closeWorkspace({closeWindow:!0}),children:d})}):d??(0,rG.jsx)(sF.InlineLoading,{className:sL()(mo.loader,{[mo.hiddenExtraWorkspace]:u}),description:`${tm("loading")}`})},ms=({openedWorkspace:e,openedWindow:t,isRootWorkspace:n,showActionMenu:o,closeWindow:r,children:i})=>{let s=i3(),{openedGroup:a,openedWindows:l,registeredWindowsByName:c,registeredWorkspacesByName:u,registeredGroupsByName:d,isMostRecentlyOpenedWindowHidden:m,setWindowMaximized:p,hideWindow:f}=d5(),g=t.windowName,{maximized:h}=t,w=e.title??"",_=c[g],y=d4(t,u,c),v=_?.icon,b=_?.canMaximize,x=!!a&&d[a.groupName]?.persistence==="closable",S=!!v&&!x,j=l.findIndex(e=>e.windowName===g)<l.length-1||m,k=Object.values(c).some(e=>e.group===a?.groupName&&void 0!==e.icon);return(0,rG.jsxs)("div",{className:sL()(mo.workspaceOuterContainer,{[mo.narrowWorkspace]:"narrow"===y,[mo.widerWorkspace]:"wider"===y,[mo.extraWideWorkspace]:"extra-wide"===y,[mo.isActionMenuOpened]:k}),children:[(0,rG.jsx)("div",{className:sL()(mo.workspaceSpacer,{[mo.hidden]:j})}),(0,rG.jsx)("div",{className:sL()(mo.workspaceMiddleContainer,{[mo.maximized]:h,[mo.hidden]:j,[mo.isRootWorkspace]:n,[mo.showActionMenu]:o}),children:(0,rG.jsx)("div",{className:sL()(mo.workspaceInnerContainer,{[mo.maximized]:h,[mo.hidden]:j,[mo.isRootWorkspace]:n}),children:i?(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsxs)(sF.Header,{"aria-label":tm("workspaceHeader"),className:mo.header,children:[(0,rG.jsx)(sF.HeaderName,{prefix:"",children:w}),(0,rG.jsx)("div",{className:mo.overlayHeaderSpacer}),(0,rG.jsx)(sF.HeaderGlobalBar,{className:mo.headerButtons,children:i7(s)?(0,rG.jsxs)(rG.Fragment,{children:[(b||h)&&(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":h?tm("minimize"):tm("maximize"),onClick:()=>p(g,!h),children:h?(0,rG.jsx)(mt.Xj,{}):(0,rG.jsx)(mt.hz,{})}),S&&(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":tm("hide"),onClick:()=>f(),children:(0,rG.jsx)(s4,{})}),!x&&(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":tm("close"),onClick:r,children:(0,rG.jsx)(af,{})})]}):(0,rG.jsxs)(rG.Fragment,{children:[S&&(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":tm("hide"),onClick:()=>f(),children:(0,rG.jsx)(mn.d3,{})}),(0,rG.jsx)(sF.HeaderGlobalAction,{"aria-label":tm("close"),onClick:()=>{x?dG():r()},children:(0,rG.jsx)(af,{})})]})})]}),i]}):(0,rG.jsx)(sF.InlineLoading,{className:mo.loader,description:`${tm("loading")} ...`})})})]})},ma=({openedWindow:e,groupProps:t,actions:n,renderChrome:o,showActionMenu:r})=>{let{openedWorkspaces:i}=e,[s,a]=(0,rF.useState)({}),l=rY(rC,mr),c=(0,rF.useRef)(new Set);return(0,rF.useEffect)(()=>{let e=!1;return Promise.all(i.map(async t=>{let n=l[t.workspaceName];if(!n)return null;let{moduleName:o,component:r}=n;try{return[t.uuid,await sk(o,r)]}catch(n){return e||c.current.has(t.uuid)||(c.current.add(t.uuid),y(n)),[t.uuid,null]}})).then(t=>{e||a(Object.fromEntries(t.filter(e=>null!=e)))},y),()=>{e=!0}},[i,l]),(0,rG.jsx)(rG.Fragment,{children:i.map((a,l)=>(0,rG.jsx)(mi,{openedWorkspace:a,openedWindow:e,groupProps:t,actions:n,renderChrome:o,lifeCycle:s[a.uuid],isRootWorkspace:0===l,isLeafWorkspace:l===i.length-1,showActionMenu:r},a.uuid))})},ml=e=>e.registeredWorkspacesByName,mc=({name:e,workspaceProps:t,windowProps:n,groupProps:o,onWindowChanged:r})=>{let i=rY(rC,ml),s=rY(rC,t=>{let n=t.registeredWorkspacesByName[e]?.window;return n?t.registeredWindowsByName[n]:void 0}),a={name:e,workspaceProps:t,windowProps:n,groupProps:o},l=(0,rF.useRef)(),c=(0,rF.useRef)(null);if(!l.current){let r=d7(e,t,n);l.current=T({openedWindow:r,groupProps:o??null}),r&&(c.current=a)}let u=l.current;(0,rF.useEffect)(()=>{let r=c.current;if(r&&r.name===e&&x(r.workspaceProps,t)&&x(r.windowProps,n)&&x(r.groupProps,o))return;let i=d7(e,t,n);u.setState({openedWindow:i,groupProps:o??null},!0),c.current=i?a:null},[e,t,n,o,i,u]);let d=(0,rF.useMemo)(()=>(function(e){function t(t){e.setState(e=>{if(!e.openedWindow)return e;let n=t(e.openedWindow);return n===e.openedWindow?e:{...e,openedWindow:n}})}return{closeWorkspace(e){t(t=>dZ(t,e))},openChildWorkspace(e,n,o){t(t=>dQ(t,e,n,o))},setWorkspaceTitle(e,n){t(t=>d0(t,e,{title:n}))},setHasUnsavedChanges(e,n){t(t=>d0(t,e,{hasUnsavedChanges:n}))},promptForClosingWorkspaces(t){let{openedWindow:n}=e.getState();return n?dY(n,t):Promise.resolve(!0)}}})(u),[u]),{openedWindow:m,groupProps:p}=rY(u),f=m?.openedWorkspaces[m.openedWorkspaces.length-1],g=f?.workspaceName??null,h=f?.title??"",w=m?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,_=s?.width??"narrow",y=(0,rF.useRef)(r);return(0,rF.useEffect)(()=>{y.current=r}),(0,rF.useEffect)(()=>{y.current?.({workspaceName:g,windowWidth:_,title:h,hasUnsavedChanges:w})},[g,_,h,w]),(0,rG.jsx)("div",{className:"-esm-implementer-tools__exported-workspace-module__exportedWorkspace___7PE0H",children:m?(0,rG.jsx)(ma,{openedWindow:m,groupProps:p,actions:d,renderChrome:!1,showActionMenu:!1}):null})},mu="-esm-implementer-tools__action-menu-button2-module__container___jc6--",md="-esm-implementer-tools__action-menu-button2-module__elementContainer___whLL8",mm="-esm-implementer-tools__action-menu-button2-module__active___fbyFm",mp="-esm-implementer-tools__action-menu-button2-module__focused___+aVpz";function mf({getIcon:e,hasUnsavedChanges:t,tagContent:n}){return(0,rG.jsxs)(rG.Fragment,{children:[e({size:16}),t?(0,rG.jsx)("span",{className:"-esm-implementer-tools__action-menu-button2-module__interruptedTag___sRkvS",children:"!"}):(0,rG.jsx)("span",{className:"-esm-implementer-tools__action-menu-button2-module__countTag___XMH0D",children:n})]})}let mg=({icon:e,label:t,tagContent:n,workspaceToLaunch:o,onBeforeWorkspaceLaunch:r,hidden:i,disabled:s})=>{let a=i3(),{openedWindows:l,restoreWindow:c,hideWindow:u,isMostRecentlyOpenedWindowHidden:d}=d5(),{extension:m}=(0,rF.useContext)(rV),p=l.findIndex(e=>e.windowName===m?.extensionId),f=l[p],g=null!=f,h=g&&(p<l.length-1||d),w=g&&!h,_=f?.openedWorkspaces.some(e=>e.hasUnsavedChanges)??!1,y=async()=>{if(g)h?c(f.windowName):u();else if(await (r?.()??!0)){let{workspaceName:e,workspaceProps:t,windowProps:n}=o;dz(e,t,n)}};return i?.(l)?null:"tablet"===a||"phone"===a?(0,rG.jsxs)(sF.Button,{className:sL()(mu,{[mm]:g&&!w,[mp]:w}),iconDescription:t,kind:"ghost",onClick:y,role:"button",tabIndex:0,size:"md",disabled:s?.(l),children:[(0,rG.jsx)("span",{className:md,children:(0,rG.jsx)(mf,{hasUnsavedChanges:_,getIcon:e,tagContent:n})}),(0,rG.jsx)("span",{children:t})]}):(0,rG.jsx)(sF.IconButton,{align:"left","aria-label":t,className:sL()(mu,{[mm]:g&&!w,[mp]:w}),enterDelayMs:300,kind:"ghost",label:t,onClick:y,size:"md",disabled:s?.(l),children:(0,rG.jsx)("div",{className:md,children:(0,rG.jsx)(mf,{hasUnsavedChanges:_,getIcon:e,tagContent:n})})})};function mh({showContactDetails:e,toggleContactDetails:t,className:n}){return(0,rG.jsx)(sF.Button,{className:n,iconDescription:"Toggle contact details",kind:"ghost",onClick:t,renderIcon:e?ap:au,children:e?tm("showLess","Show less"):tm("showMore","Show more")})}let mw={contactDetails:"-esm-implementer-tools__patient-banner-contact-details-module__contactDetails___R7vfY",deceased:"-esm-implementer-tools__patient-banner-contact-details-module__deceased___nTt+l",heading:"-esm-implementer-tools__patient-banner-contact-details-module__heading___x7UoT",row:"-esm-implementer-tools__patient-banner-contact-details-module__row___qFgIi",col:"-esm-implementer-tools__patient-banner-contact-details-module__col___JXUlg",relationship:"-esm-implementer-tools__patient-banner-contact-details-module__relationship___T3LO-"},m_=({patientUuid:e})=>{let{cohorts:t=[],isLoading:n}=function(e){let t=e?`${tk}/cohortm/cohortmember?patient=${e}&v=custom:(uuid,patient:ref,cohort:(uuid,name,startDate,endDate))`:null,{data:n,isLoading:o}=ir()(t,tP),r=n?.data?.results.map(e=>({uuid:e.cohort.uuid,name:e.cohort.name,startDate:e.cohort.startDate,endDate:e.cohort.endDate}));return(0,rF.useMemo)(()=>({cohorts:r,isLoading:o}),[o,r])}(e);return(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsxs)("p",{className:mw.heading,children:[tm("patientLists","Patient Lists")," (",t?.length??0,")"]}),n?(0,rG.jsx)(sF.InlineLoading,{description:`${tm("loading","Loading")} ...`,role:"progressbar"}):(0,rG.jsxs)("ul",{children:[(()=>{if(t?.length>0){let e=t.sort((e,t)=>l6(e?.startDate).getTime()-l6(t?.startDate).getTime()).slice(0,3);return e?.map(e=>(0,rG.jsx)("li",{children:(0,rG.jsx)(rz,{to:`${window.spaBase}/home/patient-lists/${e.uuid}`,children:e.name},e.uuid)},e.uuid))}return(0,rG.jsx)("li",{children:"--"})})(),t.length>3&&(0,rG.jsx)("li",{className:mw.link,children:(0,rG.jsx)(rz,{to:`${window.spaBase}/home/patient-lists`,children:tm("seeMoreLists","See {{count}} more lists",{count:t?.length-3})})})]})]})},my=({patientId:e})=>{let{patient:t,isLoading:n}=sc(e),o=t?.address?.find(e=>"home"===e.use),r=e=>e.split("#")[1];return n?(0,rG.jsx)(sF.InlineLoading,{description:`${tm("loading","Loading")} ...`,role:"progressbar"}):(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("p",{className:mw.heading,children:tm("address","Address")}),(0,rG.jsx)("ul",{children:o?Object.entries(o).filter(([e])=>"id"!==e&&"use"!==e).map(([e,t])=>"extension"===e?o.extension?.[0]?.extension?.map((t,n)=>(0,rG.jsxs)("li",{children:[tm(r(t.url),r(t.url)),": ",t.valueString]},`address-${e}-${n}`)):(0,rG.jsxs)("li",{children:[tm(e,e),": ",t]},`address-${e}`)):(0,rG.jsx)("li",{children:"--"})})]})},mv=({patientUuid:e})=>{let{isLoading:t,contactAttributes:n}=(e=>{let{contactAttributeTypes:t=[]}=iT({externalModuleName:"@openmrs/esm-patient-banner-app"}),{attributes:n,error:o,isLoading:r}=(e=>{let{data:t,error:n,isLoading:o}=iW()(`${tk}/patient/${e}?v=custom:(uuid,display,identifiers:(identifier,uuid,preferred,location:(uuid,name),identifierType:(uuid,name,format,formatDescription,validator)),person:(uuid,display,gender,birthdate,dead,age,deathDate,birthdateEstimated,causeOfDeath,preferredName:(uuid,preferred,givenName,middleName,familyName),attributes,preferredAddress:(uuid,preferred,address1,address2,cityVillage,longitude,stateProvince,latitude,country,postalCode,countyDistrict,address3,address4,address5,address6,address7)))`,tP);return{isLoading:o,attributes:t?.data.person.attributes??[],error:n}})(e);return{contactAttributes:(0,rF.useMemo)(()=>n.filter(({attributeType:e})=>t?.some(t=>e.uuid===t)),[n,t]),isLoading:r,error:o}})(e),o=(0,rF.useMemo)(()=>n?[...n?.map(e=>[e.attributeType.display?tm(e.attributeType.display,e.attributeType.display):"",e.value])]:[],[n]);return(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("p",{className:mw.heading,children:tm("contactDetails","Contact Details")}),t?(0,rG.jsx)(sF.InlineLoading,{description:`${tm("loading","Loading")} ...`,role:"progressbar"}):(0,rG.jsx)("ul",{children:o.length?o.map(([e,t],n)=>(0,rG.jsxs)("li",{children:[e,": ",t]},`${e}-${t}-${n}`)):(0,rG.jsx)("li",{children:"--"})})]})},mb=({patientId:e})=>{let{data:t,isLoading:n}=function(e){let t=`${tk}/relationship?v=custom:(display,uuid,personA:(age,display,birthdate,uuid),personB:(age,display,birthdate,uuid),relationshipType:(uuid,display,description,aIsToB,bIsToA))&person=${e}`,{data:n,error:o,isLoading:r,isValidating:i}=ir()(e?t:null,tP),s=n?.data?.results?.length?function(e,t){let n=[];for(let o of t)e===o.personA.uuid?n.push({uuid:`${o.uuid}`,display:o.personB.display,relativeAge:o.personB.age,relativeUuid:o.personB.uuid,relationshipType:o.relationshipType.bIsToA}):n.push({uuid:`${o.uuid}`,display:o.personA.display,relativeAge:o.personA.age,relativeUuid:o.personA.uuid,relationshipType:o.relationshipType.aIsToB});return n}(e,n.data.results):null;return{data:n?s:null,error:o,isLoading:r,isValidating:i}}(e);return(0,rG.jsxs)(rG.Fragment,{children:[(0,rG.jsx)("p",{className:mw.heading,children:tm("relationships","Relationships")}),n?(0,rG.jsx)(sF.InlineLoading,{description:`${tm("loading","Loading")} ...`,role:"progressbar"}):(0,rG.jsx)("ul",{children:t&&t.length>0?(0,rG.jsx)(rG.Fragment,{children:t.map(e=>(0,rG.jsxs)("li",{className:mw.relationship,children:[(0,rG.jsx)("div",{children:(0,rG.jsx)(rz,{to:`${window.spaBase}/patient/${e.relativeUuid}/chart`,children:e.display})}),(0,rG.jsx)("div",{children:e.relationshipType}),(0,rG.jsx)("div",{children:`${e.relativeAge?e.relativeAge:"--"} ${e.relativeAge?1===e.relativeAge?tm("yearAbbreviation","yr"):tm("yearsAbbreviation","yrs"):""}`})]},e.uuid))}):(0,rG.jsx)("li",{children:"--"})})]})};function mx({patientId:e,deceased:t}){return(0,rG.jsxs)("div",{className:sL()(mw.contactDetails,{[mw.deceased]:t}),children:[(0,rG.jsxs)("div",{className:mw.row,children:[(0,rG.jsx)("div",{className:mw.col,children:(0,rG.jsx)(my,{patientId:e})}),(0,rG.jsx)("div",{className:mw.col,children:(0,rG.jsx)(mv,{patientUuid:e})})]}),(0,rG.jsxs)("div",{className:mw.row,children:[(0,rG.jsx)("div",{className:mw.col,children:(0,rG.jsx)(mb,{patientId:e})}),(0,rG.jsx)("div",{className:mw.col,children:(0,rG.jsx)(m_,{patientUuid:e})})]})]})}function mS(e){let t=document.querySelector("template#loading-spinner");if(t){let n=t.content.cloneNode(!0),o=Array.prototype.map.call(n.childNodes,e=>e);return e.appendChild(n),()=>o.forEach(e=>e.remove())}return()=>{}}let mj="-esm-implementer-tools__action-menu2-module__container___6Gke0";function mk({workspaceGroup:e,groupProps:t}){let n=i3(),{persistence:o}=e;return(0,rG.jsx)("aside",{className:"-esm-implementer-tools__action-menu2-module__sideRail___T2lMV",children:(0,rG.jsxs)("div",{className:mj,children:["closable"==o&&i7(n)&&(0,rG.jsx)(sF.IconButton,{align:"left",onClick:()=>dG(),label:tm("close"),kind:"ghost",children:(0,rG.jsx)(af,{})}),(0,rG.jsx)(rV.Provider,{value:{moduleName:e.moduleName,featureName:e.name},children:(0,rG.jsx)(r3,{className:mj,name:e.name,state:{groupProps:t}})})]})})}function mN(e){let t=new URL(e,window.location.origin).pathname,n=new URL(window.getOpenmrsSpaBase?.()??"/",window.location.origin).pathname,o=n.endsWith("/")?n.slice(0,-1):n,r=null;return o?o===t?r="/":t.startsWith(`${o}/`)&&(r=t.slice(o.length)):r=t,{full:t,spaRelative:r}}function mC(e){e&&(0,r7.createRoot)(e).render((0,rG.jsx)(mE,{}))}function mE(){let{openedGroup:e,openedWindows:t,registeredGroupsByName:n,registeredWindowsByName:o}=d5();if((0,rF.useEffect)(()=>nG("before-page-changed",t=>{let{newPage:o,cancelNavigation:r,oldUrl:i,newUrl:s}=t;if(!e)return;if(o)return void r(dG().then(e=>!e));let a=n[e.groupName],l=a?.scopePattern;l&&function(e,t,n){try{let o=new RegExp(e),r=mN(t),i=mN(n);if(null===r.spaRelative||null===i.spaRelative)return!0;let s=o.exec(r.spaRelative),a=o.exec(i.spaRelative);if(s&&a||(s=o.exec(r.full),a=o.exec(i.full)),!s||!a)return!0;if(s.length>1)return!s.slice(1).every((e,t)=>e===a[t+1]);return!1}catch{return!0}}(l,i,s)&&r(dG().then(e=>!e))}),[e,n]),!e)return null;let r=n[e.groupName],i=t.some(e=>e.maximized),{name:s}=r,a=Object.values(o).filter(e=>e.group===s&&void 0!==e.icon).sort((e,t)=>(e.order??Number.MAX_VALUE)-(t.order??Number.MAX_VALUE)).length>0;return(0,rG.jsxs)("div",{className:sL()("-esm-implementer-tools__workspace-windows-and-menu-module__workspaceWindowsAndMenuContainer___2u2mc",{"-esm-implementer-tools__workspace-windows-and-menu-module__overlay___7RHYZ":r.overlay,"-esm-implementer-tools__workspace-windows-and-menu-module__hasMaximizedWindow___gvJRd":i}),children:[(0,rG.jsx)("div",{className:"-esm-implementer-tools__workspace-windows-and-menu-module__workspaceWindowsContainer___40ITO",children:t.map(t=>(0,rG.jsx)(mP,{openedWindow:t,groupProps:e.props,showActionMenu:a},t.windowName))}),a&&(0,rG.jsx)(mk,{workspaceGroup:r,groupProps:e.props})]})}function mP({openedWindow:e,groupProps:t,showActionMenu:n}){let{windowName:o}=e,r=(0,rF.useMemo)(()=>({closeWorkspace(e){rC.setState(t=>d2.closeWorkspace(t,e))},openChildWorkspace(e,t,n){rC.setState(o=>d2.openChildWorkspace(o,e,t,n))},setWorkspaceTitle(e,t){rC.setState(n=>d2.setWorkspaceTitle(n,e,t))},setHasUnsavedChanges(e,t){rC.setState(n=>d2.setHasUnsavedChanges(n,e,t))},promptForClosingWorkspaces(e){let t=rC.getState().openedWindows.find(e=>e.windowName===o);return t?dY(t,e):Promise.resolve(!0)}}),[o]);return(0,rG.jsx)(ma,{openedWindow:e,groupProps:t,actions:r,renderChrome:!0,showActionMenu:n})}function mI(e,t,n){if(null==e)return n;let o=lH(e);if(!o)return console.warn(`matchLocale: invalid requested locale tag: ${JSON.stringify(e)}`),n;let r=[];for(let e of t){let t=lH(e);if(!t){console.warn(`matchLocale: skipping invalid available locale tag: ${JSON.stringify(e)}`);continue}r.push({canonical:t,original:e})}let i=o;for(;i;){let e=r.find(e=>e.canonical===i);if(e)return e.original;let t=i+"-",n=r.find(e=>e.canonical.startsWith(t));if(n)return n.original;if("ht"===i){i="fr-HT";continue}let o=i.lastIndexOf("-");if(-1===o)break;let s=(i=i.slice(0,o)).lastIndexOf("-");-1!==s&&i.length-s==2&&(i=i.slice(0,s))}return n}function mO(e=window.localStorage){try{return e.getItem("test"),!0}catch{return!1}}function mA(e){return!!e&&e.constructor===Object}var mR=n(3376);function mT(e){let[t,n,o]=e.split(".");return`${t}.${n}.${o}`}function m$(e,t){return mR(function(e){let t=e.indexOf("-");if(t>=0){let n=mT(e.slice(0,t)),o=e.slice(t+1);return`${n}-${o}`}return mT(e)}(t),e,{includePrerelease:!0})}async function mM(e,t={}){let n,{shouldRetry:o,getDelay:r,onError:i}=t;o=o??(e=>e<=5),r=r??(e=>(function(e,t=!1){return 1e3*Math.pow(2,t?e+1:e)})(e));let s=0;do try{return await mL(r(s)),await e()}catch(e){i?.(e,s),n=e}while(o(s++));throw n}async function mL(e){if(!(e<=0))return new Promise(t=>setTimeout(t,e))}function mW(e,t,n,o){}function mD(e){}function mU(e){return Promise.resolve([])}function mB(e){return Promise.resolve([])}function mF(e){return Promise.resolve({success:!1,result:void 0,error:"No service worker has been registered. Offline-related features have been removed from the framework."})}function mH(e){return()=>{}}function mV(){return!0}}}]);
|