@openmrs/esm-stock-management-app 1.0.1-pre.485 → 1.0.1-pre.489

Sign up to get free protection for your applications and to get access to all the features.
package/dist/793.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 793.js.LICENSE.txt */
2
+ (globalThis.webpackChunk_openmrs_esm_stock_management_app=globalThis.webpackChunk_openmrs_esm_stock_management_app||[]).push([[793],{6173:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function a(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}System.register(["@openmrs/esm-config","@openmrs/esm-navigation","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(e,t){var u={},s={},c={},l={};return{setters:[function(e){u.Type=e.Type,u.defineConfigSchema=e.defineConfigSchema,u.getConfig=e.getConfig,u.validators=e.validators},function(e){s.navigate=e.navigate},function(e){c.reportError=e.reportError},function(e){l.getSynchronizationItems=e.getSynchronizationItems}],execute:function(){e(function(){var e={385:function(){System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e,t){var n=s[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;var r=u()((function(){return t}));return s[e]={value:r,active:!0},r},t=function(e,t){var n=s[e];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=t,n.active=!0,n.value):(s[e]={value:t,active:!0},t)},n=function(e,t){var n=s[e];if(!n){var r=u()((function(){return null!=t?t:{}}));return s[e]={value:r,active:!1},r}return n.value},r=function(e,t,n){var r=t(e.getState());return e.subscribe((function(e){var o=t(e);o!==r&&(r=o,n(o))}))},o={d:function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return e},getGlobalStore:function(){return n},registerGlobalStore:function(){return t},subscribeTo:function(){return r}});var a=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,subscribe:function(e){return n.add(e),function(){return n.delete(e)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,i),i},u=function(e){return e?a(e):a},s={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=s)}),1e3),i}())}}}))},824:function(e){"use strict";e.exports=u},254:function(e){"use strict";e.exports=c},513:function(e){"use strict";e.exports=s},738:function(e){"use strict";e.exports=l}},t={};function f(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,f),o.exports}f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return function(){"use strict";var e=function(e,t){function n(){this.constructor=e}st(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},t=function(e){return"function"==typeof e},u=function(e){setTimeout((function(){throw e}),0)},s=function(e){return null!==e&&"object"==typeof e},c=function(e){return e.reduce((function(e,t){return e.concat(i(t,pt)?t.errors:t)}),[])},l=function(e){return e},h=function(e){if(e||(e=lt.Promise||Promise),!e)throw new Error("no Promise impl found");return e},p=function(e,t,n){var r=g(e,t,n);Gt.length?Gt.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))},y=function(e){if("function"!=typeof e)throw Error(m(28,!1));Gt.push(e)},v=function(e){if("function"!=typeof e)throw Error(m(29,!1));var t=!1;return Gt=Gt.filter((function(n){var r=n===e;return t=t||r,!r})),t},m=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},g=function(e,t,n){var r,o="".concat(O(t)," '").concat(_(t),"' died in status ").concat(t.status,": ");if(i(e,Error)){try{e.message=o+e.message}catch(e){}r=e}else{console.warn(m(30,!1,t.status,_(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=_(t),t.status=n,r},b=function(e){return e.status===Qt},w=function(e){try{return e.activeWhen(window.location)}catch(t){return p(t,e,nn),!1}},_=function(e){return e.name},S=function(e){return Boolean(e.unmountThisParcel)},O=function(e){return S(e)?"parcel":"application"},E=function(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]},x=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null},k=function(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!x(t,(function(e){return"function"!=typeof e}))));var t},P=function(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=O(e),o=_(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return j(n)?n:Promise.reject(m(15,!1,r,o,t,a))}))}),Promise.resolve())}},j=function(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch},A=function(e,t){return Promise.resolve().then((function(){return e.status!==Wt?e:(e.status=$t,e.bootstrap?U(e,"bootstrap").then(n).catch((function(n){if(t)throw g(n,e,nn);return p(n,e,nn),e})):Promise.resolve().then(n))}));function n(){return e.status=Yt,e}},T=function(e,t){return Promise.resolve().then((function(){var n=function(){return U(e,"unmount").then((function(){e.status=Yt}),(function(n){if(t)throw g(n,e,nn);p(n,e,nn)}))};if(e.status!==Qt)return e;e.status=Xt;var r=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(t)throw g(n,e,nn);p(n,e,nn)}))})).then((function(){return e}))}))},D=function(e,t){return Promise.resolve().then((function(){return e.status!==Yt?e:(on||(window.dispatchEvent(new Vt("single-spa:before-first-mount")),on=!0),e.status=Jt,U(e,"mount").then((function(){return e.status=Qt,an||(window.dispatchEvent(new Vt("single-spa:first-mount")),an=!0),e})).catch((function(n){var r=function(){if(t)throw g(n,e,nn);return p(n,e,nn),e};return e.status=Qt,T(e,!0).then(r,r)})))}))},C=function(){return I.apply(sn,arguments)},I=function(e,t){var n=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(m(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(m(3,!1,a(e.name)));var r=un++,o=e.name||"parcel-".concat(r);if("object"!=typeof t)throw Error(m(4,!1,o,void 0===t?"undefined":a(t)));if(!t.domElement)throw Error(m(5,!1,o));var i,u="function"==typeof e,s=u?e:function(){return Promise.resolve(e)},c={id:r,parcels:{},status:u?qt:Wt,customProps:t,parentName:_(n),unmountThisParcel:function(){return p.then((function(){if(c.status!==Qt)throw Error(m(6,!1,o,c.status));return T(c,!0)})).then((function(e){return c.parentName&&delete n.parcels[c.id],e})).then((function(e){return f(e),e})).catch((function(e){throw c.status=nn,d(e),e}))}};n.parcels[r]=c;var l=s();if(!l||"function"!=typeof l.then)throw Error(m(7,!1));l=l.then((function(e){if(!e)throw Error(m(8,!1));if(o=e.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!k(e.bootstrap))throw Error(m(9,!1,o));if(!k(e.mount))throw Error(m(10,!1,o));if(!k(e.unmount))throw Error(m(11,!1,o));if(e.update&&!k(e.update))throw Error(m(12,!1,o));var t=P(e,"bootstrap"),n=P(e,"mount"),a=P(e,"unmount");c.status=Wt,c.name=o,c.bootstrap=t,c.mount=n,c.unmount=a,c.timeouts=K(e.timeouts),e.update&&(c.update=P(e,"update"),i.update=function(e){return c.customProps=e,M((t=c,Promise.resolve().then((function(){if(t.status!==Qt)throw Error(m(32,!1,_(t)));return t.status=Zt,U(t,"update").then((function(){return t.status=Qt,t})).catch((function(e){throw g(e,t,nn)}))}))));var t})}));var f,d,h=l.then((function(){return A(c,!0)})),p=h.then((function(){return D(c,!0)})),y=new Promise((function(e,t){f=e,d=t}));return i={mount:function(){return M(Promise.resolve().then((function(){if(c.status!==Yt)throw Error(m(13,!1,o,c.status));return n.parcels[r]=c,D(c)})))},unmount:function(){return M(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:M(l),bootstrapPromise:M(h),mountPromise:M(p),unmountPromise:M(y)}},M=function(e){return e.then((function(){return null}))},R=function(e){var t=_(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(m(40,!1),t,n));var r=E({},n,{name:t,mountParcel:I.bind(e),singleSpa:Kt});return S(e)&&(r.unmountSelf=e.unmountThisParcel),r},N=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(16,!1));cn.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},L=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(17,!1));cn.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},F=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(18,!1));cn.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},B=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(19,!1));cn.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},U=function(e,t){var n=e.timeouts[t],r=n.warningMillis,o=O(e);return new Promise((function(i,a){var u=!1,s=!1;e[t](R(e)).then((function(e){u=!0,i(e)})).catch((function(e){u=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=m(31,!1,t,o,_(e),n.millis);function l(e){if(!u)if(!0===e)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))},K=function(e){var t={};for(var n in cn)t[n]=E({},cn[n],e&&e[n]||{});return t},z=function(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==Ht&&e.status!==tn?e:(e.status=qt,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(R(e));if(!j(r))throw n=!0,Error(m(33,!1,_(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!=typeof(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!k(t.bootstrap)&&(r=35),k(t.mount)||(r=36),k(t.unmount)||(r=37);var o=O(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error(m(r,!1,o,_(e),i),t),p(void 0,e,nn),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=E({},e.devtools.overlays,t.devtools.overlays)),e.status=Wt,e.bootstrap=P(t,"bootstrap"),e.mount=P(t,"mount"),e.unmount=P(t,"unmount"),e.unload=P(t,"unload"),e.timeouts=K(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=nn:(r=tn,e.loadErrorTime=(new Date).getTime()),p(t,e,r),e})));var t,n}))},V=function(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(m(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=$(window.location.href),r=$(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)},G=function(e){var t=this;if(e){var n=e[0].type;dn.indexOf(n)>=0&&fn[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}},H=function(){Sn([],arguments)},q=function(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return Ut&&n===o||window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}},W=function(e){if(pn)throw Error(m(43,!1));Ut=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,pn=!0,hn=window.history.replaceState,window.addEventListener("hashchange",H),window.addEventListener("popstate",H);var t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&dn.indexOf(e)>=0)||x(fn[e],(function(e){return e===n})))return t.apply(this,arguments);fn[e].push(n)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&dn.indexOf(e)>=0))return n.apply(this,arguments);fn[e]=fn[e].filter((function(e){return e!==t}))},window.history.pushState=q(window.history.pushState,"pushState"),window.history.replaceState=q(hn,"replaceState")},$=function(e){var t=document.createElement("a");return t.href=e,t},Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!yn){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return J.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return J.call(this,n,window.removeEventListener,e,t,arguments)},yn=!0}},J=function(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){dn.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))},Q=function(e){return Promise.resolve().then((function(){var t=vn[_(e)];if(!t)return e;if(e.status===Ht)return Z(e,t),e;if(e.status===en)return t.promise.then((function(){return e}));if(e.status!==Yt&&e.status!==tn)return e;var n=e.status===tn?Promise.resolve():U(e,"unload");return e.status=en,n.then((function(){return Z(e,t),e})).catch((function(n){return function(e,t,n){delete vn[_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,p(n,e,nn),t.reject(n)}(e,t,n),e}))}))},Z=function(e,t){delete vn[_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=Ht,t.resolve()},X=function(e,t,n,r){vn[_(e)]={app:e,resolve:n,reject:r},Object.defineProperty(vn[_(e)],"promise",{get:t})},ee=function(e){return vn[e]},te=function(){return mn.filter(b).map(_)},ne=function(){return mn.map(_)},re=function(e){var t=x(mn,(function(t){return _(t)===e}));return t?t.status:null},oe=function(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(m(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error(m(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error(m(20,!1));if("object"!=typeof e.app&&"function"!=typeof e.app)throw Error(m(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(m(24,!1));if(!ce(e.customProps))throw Error(m(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(m(20,!1));if(!t)throw Error(m(23,!1));if("function"!=typeof n)throw Error(m(24,!1));if(!ce(r))throw Error(m(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:le(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(pe()||gn||(gn=!0,setTimeout((function(){pe()||console.warn(m(1,!1))}),5e3)),-1!==ne().indexOf(o.name))throw Error(m(21,!1,o.name));mn.push(E({loadErrorTime:null,status:Ht,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),ln&&(Y(),Sn())},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return mn.filter((function(t){return t.activeWhen(e)})).map(_)},ae=function(e){if(0===mn.filter((function(t){return _(t)===e})).length)throw Error(m(25,!1,e));return(ln?ue(e,{waitForUnmount:!1}):Promise.resolve()).then((function(){var t=mn.map(_).indexOf(e);mn.splice(t,1)}))},ue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error(m(26,!1));var n=x(mn,(function(t){return _(t)===e}));if(!n)throw Error(m(27,!1,e));var r,o=ee(_(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){X(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,se(n,o.resolve,o.reject)):r=new Promise((function(e,t){X(n,(function(){return r}),e,t),se(n,e,t)})),r},se=function(e,t,n){Promise.resolve().then((function(){if(x(ie(),(function(t){return t===_(e)})))return fe()})).then((function(){return T(e).then(Q).then((function(){t(),setTimeout((function(){Sn()}))}))})).catch(n)},ce=function(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},le=function(e,t){var n=function(e,t){var n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(var i=0;i<e.length;i++){var a=e[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(e.length),new RegExp(o,"i");function u(i){var a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{var u=t?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}},fe=function(){return Sn()},de=function(e,t){return w(e)?A(e).then((function(e){return t.then((function(){return w(e)?D(e):e}))})):t.then((function(){return e}))},he=function(e){On=!0,ln&&(W(e),Sn())},pe=function(){return On},ye=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},ve=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},me=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},ge=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},be=function(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)},we=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");var n=be(e);if(t.headers||(t.headers={}),Nt(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(Tn)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(Dn)){var r=new URL(n,window.location.toString());r.searchParams.has("_summary")||(r.searchParams.set("_summary","data"),n=r.toString())}var o,i,a=Error();return window.fetch(n,t).then((o=function(e){var t,r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return(t=e).ok?204===t.status?(t.data=null,[2,t]):[2,t.clone().text().then((function(e){try{e&&(t.data=JSON.parse(e))}catch(e){}return t}))]:[3,1];case 1:return[4,(0,Lt.getConfig)("@openmrs/esm-api")];case 2:return r=o.sent().redirectAuthFailure,n===be(Cn)&&403===t.status||r.enabled&&r.errors.includes(t.status)?(sessionStorage.removeItem(xn),(0,Ft.navigate)({to:r.url}),[2,r.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,t.clone().text().then((function(e){var r=e;try{r=JSON.parse(e)}catch(e){}throw new In(n,t,r,a)}),(function(e){throw new In(n,t,null,a)}))];case 3:return[2]}}))},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){ve(i,n,r,a,u,"next",e)}function u(e){ve(i,n,r,a,u,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)}))},_e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return t.signal=n.signal,new wt((function(r){var o=!1;return we(e,t).then((function(e){o=!0,r.next(e),r.complete()}),(function(e){o=!0,r.error(e)})),function(){o||n.abort()}}))},Se=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},Oe=function(e,t){return we("".concat(Mn,"/").concat(e),{signal:t.signal})},Ee=function(e,t,n){return we("".concat(Mn,"?patient=").concat(e,"&includeEncounterless=").concat(t),{signal:n.signal})},xe=function(e,t){return Rn.apply(this,arguments)},ke=function(e,t){return we("".concat(Mn,"/").concat(e),{method:"DELETE",signal:t.signal})},Pe=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},je=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Pe(i,r,o,a,u,"next",e)}function u(e){Pe(i,r,o,a,u,"throw",e)}a(void 0)}))}},Ae=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Bn<Date.now()-6e4||!Fn.getState().loaded)&&Ie(),new wt((function(t){var n=function(n){var r;n.loaded&&(e.includeAuthStatus?t.next(n.session):t.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(Fn.getState()),Fn.subscribe(n)}))},De=function(){return(Bn<Date.now()-6e4||!Fn.getState().loaded)&&Ie(),Fn},Ce=function(e){var t,n,r,o=null!==(r=null==e||null===(t=e.user)||void 0===t||null===(n=t.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:e.locale,i=document.documentElement.getAttribute("lang");(function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0})(o)&&o!==i&&document.documentElement.setAttribute("lang",o)},Ie=function(e,t){Bn=Date.now();var n={};return e&&t&&(n.Authorization="Basic ".concat(window.btoa("".concat(e,":").concat(t)))),Ue(we(Cn,{headers:n}))},Me=function(){Fn.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},Re=function(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!Ln(t.privileges.find((function(t){return e===t.display}))):Array.isArray(e)?e.every((function(e){return!Ln(t.privileges.find((function(t){return e===t.display})))})):(Ln(e)||console.error('Could not understand privileges "'.concat(e,'"')),!0)}(e,t)||function(e){return!Ln(e.roles.find((function(e){return"System Developer"===e.display})))}(t)},Ne=function(){var e,t;return new Promise((function(n){var r=function(r){r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};r(Fn.getState()),e||(t=Fn.subscribe(r))}))},Le=function(){return new Promise((function(e,t){Te().subscribe((function(t){e(t.sessionLocation)}),t).unsubscribe()}))},Fe=function(e,t){return Un.apply(this,arguments)},Be=function(e,t,n){return Kn.apply(this,arguments)},Ue=function(e){return new Promise((function(t,n){e.then((function(e){var r;"object"==typeof(null==e?void 0:e.data)?(r={loaded:!0,session:e.data},Fn.setState(r),t(r)):(r={loaded:!1,session:null},Fn.setState(r),n(r))})).catch((function(e){(0,Nn.reportError)("Failed to fetch new session information: ".concat(e));var t={loaded:!1,session:null};Fn.setState(t),n(t)}))}))},Ke=function(){(0,Lt.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Lt.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Lt.Type.String,_default:"${openmrsSpaBase}/login",_validators:[Lt.validators.isUrl]},errors:{_type:Lt.Type.Array,_default:[401],_elements:{_type:Lt.Type.Number,_validators:[Lt.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Lt.Type.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),Ie()},ze=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ve=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},Ge=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ve(i,r,o,a,u,"next",e)}function u(e){Ve(i,r,o,a,u,"throw",e)}a(void 0)}))}},He=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ze(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},qe=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},We=function(e,t){return Vn.apply(this,arguments)},$e=function(e){return Gn.apply(this,arguments)},Ye=function(e){return function(t){return 0===e?Zn:t.lift(new Xn(e))}},Je=function(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new tr(e,t))}},Qe=function(){return(0,Bt.getGlobalStore)("visit",or)},Ze=function(e,t){Qe().setState({patientUuid:e,manuallySetVisitUuid:t})},Xe=function(e,t,n){var r=null!=n?n:rr;return _e("".concat(Tn,"/visit?patient=").concat(e,"&v=").concat(r),{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Ye(1)).pipe(Je((function(e){return e})))},et=function(e,t){return _e("".concat(Tn,"/visit"),{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})},tt=function(e,t,n){return _e("".concat(Tn,"/visit/").concat(e),{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})},nt=function(e){return{uuid:e.uuid,display:e.display,name:e.name}},rt=function(){return _e("".concat(Tn,"/visittype")).pipe(Je((function(e){return e.data.results.map(nt)}))).pipe(Ye(1))},ot=function(e){return{uuid:e.uuid,display:e.display}},it=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return _e("".concat(Tn,"/location")+(e?"?tag="+e:"")).pipe(Je((function(e){return e.data.results.map(ot)}))).pipe(Ye(1))};f.r(d),f.d(d,{OpenmrsFetchError:function(){return In},VisitMode:function(){return ir},VisitStatus:function(){return ar},attachmentUrl:function(){return Mn},backendDependencies:function(){return sr},clearCurrentUser:function(){return Me},createAttachment:function(){return xe},defaultVisitCustomRepresentation:function(){return rr},deleteAttachmentPermanently:function(){return ke},fetchCurrentPatient:function(){return We},fhirBaseUrl:function(){return Dn},getAttachmentByUuid:function(){return Oe},getAttachments:function(){return Ee},getCurrentUser:function(){return Te},getLocations:function(){return it},getLoggedInUser:function(){return Ne},getSessionLocation:function(){return Le},getSessionStore:function(){return De},getStartedVisit:function(){return ur},getVisitStore:function(){return Qe},getVisitTypes:function(){return rt},getVisitsForPatient:function(){return Xe},makeUrl:function(){return be},openmrsFetch:function(){return we},openmrsObservableFetch:function(){return _e},refetchCurrentUser:function(){return Ie},restBaseUrl:function(){return Tn},saveVisit:function(){return et},sessionEndpoint:function(){return Cn},setCurrentVisit:function(){return Ze},setSessionLocation:function(){return Fe},setUserLanguage:function(){return Ce},setUserProperties:function(){return Be},setupApiModule:function(){return Ke},toLocationObject:function(){return ot},toVisitTypeObject:function(){return nt},updateVisit:function(){return tt},userHasAccess:function(){return Re}});var at,ut,st=function(e,t){return st=Object.setPrototypeOf||i({__proto__:[]},Array)&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},st(e,t)},ct=!1,lt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,ct=e},get useDeprecatedSynchronousErrorHandling(){return ct}},ft={closed:!0,next:function(e){},error:function(e){if(lt.useDeprecatedSynchronousErrorHandling)throw e;u(e)},complete:function(){}},dt=Array.isArray||function(e){return e&&"number"==typeof e.length},ht=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),pt=ht,yt=function(){function e(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){var n;if(!this.closed){var r=this,o=r._parentOrParents,a=r._ctorUnsubscribe,u=r._unsubscribe,l=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i(o,e))o.remove(this);else if(null!==o)for(var f=0;f<o.length;++f)o[f].remove(this);if(t(u)){a&&(this._unsubscribe=void 0);try{u.call(this)}catch(e){n=i(e,pt)?c(e.errors):[e]}}if(dt(l)){f=-1;for(var d=l.length;++f<d;){var h=l[f];if(s(h))try{h.unsubscribe()}catch(e){n=n||[],i(e,pt)?n=n.concat(c(e.errors)):n.push(e)}}}if(n)throw new pt(n)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(void 0===t?"undefined":a(t)){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!i(n,e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(i(o,e)){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var u=this._subscriptions;return null===u?this._subscriptions=[n]:u.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}(),vt="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),mt=function(t){function n(e,r,o){var a=t.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=ft;break;case 1:if(!e){a.destination=ft;break}if("object"==typeof e){i(e,n)?(a.syncErrorThrowable=e.syncErrorThrowable,a.destination=e,e.add(a)):(a.syncErrorThrowable=!0,a.destination=new gt(a,e));break}default:a.syncErrorThrowable=!0,a.destination=new gt(a,e,r,o)}return a}return e(n,t),n.prototype[vt]=function(){return this},n.create=function(e,t,r){var o=new n(e,t,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(yt),gt=function(n){function r(e,r,o,i){var a,u=n.call(this)||this;u._parentSubscriber=e;var s=u;return t(r)?a=r:r&&(a=r.next,o=r.error,i=r.complete,r!==ft&&(t((s=Object.create(r)).unsubscribe)&&u.add(s.unsubscribe.bind(s)),s.unsubscribe=u.unsubscribe.bind(u))),u._context=s,u._next=a,u._error=o,u._complete=i,u}return e(r,n),r.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;lt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},r.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=lt.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):u(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;u(e)}}},r.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};lt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),lt.useDeprecatedSynchronousErrorHandling)throw e;u(e)}},r.prototype.__tryOrSetError=function(e,t,n){if(!lt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return lt.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(u(t),!0)}return!1},r.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},r}(mt),bt="function"==typeof Symbol&&Symbol.observable||"@@observable",wt=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,o=function(e,t,n){if(e){if(i(e,mt))return e;if(e[vt])return e[vt]()}return e||t||n?new mt(e,t,n):new mt(ft)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||lt.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),lt.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){lt.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e,n=t.closed,r=t.destination,o=t.isStopped;if(n||o)return!1;e=r&&i(r,mt)?r:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=h(t))((function(t,r){var o;o=n.subscribe((function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[bt]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:(0===(n=e).length?l:1===n.length?n[0]:function(e){return n.reduce((function(e,t){return t(e)}),e)})(this);var n},e.prototype.toPromise=function(e){var t=this;return new(e=h(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}(),_t="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,St="object"==typeof self&&self&&self.Object===Object&&self,Ot=(_t||St||Function("return this")()).Symbol,Et=Object.prototype,xt=Et.hasOwnProperty,kt=Et.toString,Pt=Ot?Ot.toStringTag:void 0,jt=Object.prototype.toString,At=Ot?Ot.toStringTag:void 0,Tt=(at=Object.getPrototypeOf,ut=Object,function(e){return at(ut(e))}),Dt=Function.prototype,Ct=Object.prototype,It=Dt.toString,Mt=Ct.hasOwnProperty,Rt=It.call(Object),Nt=function(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":At&&At in Object(e)?function(e){var t=xt.call(e,Pt),n=e[Pt];try{e[Pt]=void 0;var r=!0}catch(e){}var o=kt.call(e);return r&&(t?e[Pt]=n:delete e[Pt]),o}(e):function(e){return jt.call(e)}(e)}(e))return!1;var t=Tt(e);if(null===t)return!0;var n=Mt.call(t,"constructor")&&t.constructor;return"function"==typeof n&&i(n,n)&&It.call(n)==Rt},Lt=f(824),Ft=f(513),Bt=f(385);(0,Bt.createGlobalStore)("breadcrumbs",[]);var Ut,Kt=Object.freeze({__proto__:null,get start(){return he},get ensureJQuerySupport(){return Y},get setBootstrapMaxTime(){return N},get setMountMaxTime(){return L},get setUnmountMaxTime(){return F},get setUnloadMaxTime(){return B},get registerApplication(){return oe},get unregisterApplication(){return ae},get getMountedApps(){return te},get getAppStatus(){return re},get unloadApplication(){return ue},get checkActivityFunctions(){return ie},get getAppNames(){return ne},get pathToActiveWhen(){return le},get navigateToUrl(){return V},get patchHistoryApi(){return W},get triggerAppChange(){return fe},get addErrorHandler(){return y},get removeErrorHandler(){return v},get mountRootParcel(){return C},get NOT_LOADED(){return Ht},get LOADING_SOURCE_CODE(){return qt},get NOT_BOOTSTRAPPED(){return Wt},get BOOTSTRAPPING(){return $t},get NOT_MOUNTED(){return Yt},get MOUNTING(){return Jt},get UPDATING(){return Zt},get LOAD_ERROR(){return tn},get MOUNTED(){return Qt},get UNLOADING(){return en},get UNMOUNTING(){return Xt},get SKIP_BECAUSE_BROKEN(){return nn}}),zt=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,Vt=function(){try{var e=new zt("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?zt:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},Gt=[],Ht="NOT_LOADED",qt="LOADING_SOURCE_CODE",Wt="NOT_BOOTSTRAPPED",$t="BOOTSTRAPPING",Yt="NOT_MOUNTED",Jt="MOUNTING",Qt="MOUNTED",Zt="UPDATING",Xt="UNMOUNTING",en="UNLOADING",tn="LOAD_ERROR",nn="SKIP_BECAUSE_BROKEN",rn=[],on=!1,an=!1,un=0,sn={parcels:{}},cn={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},ln="undefined"!=typeof window,fn={hashchange:[],popstate:[]},dn=["hashchange","popstate"],hn=null,pn=!1;ln&&(window.singleSpaNavigate?console.warn(m(41,!1)):window.singleSpaNavigate=V);var yn=!1,vn={},mn=[],gn=!1,bn=!1,wn=[],_n=ln&&window.location.href;function Sn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(bn)return new Promise((function(e,n){wn.push({resolve:e,reject:n,eventArguments:t})}));var r,i=function(){var e=[],t=[],n=[],r=[],o=(new Date).getTime();return mn.forEach((function(i){var a=i.status!==nn&&w(i);switch(i.status){case tn:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Ht:case qt:a&&n.push(i);break;case Wt:case Yt:!a&&ee(_(i))?e.push(i):a&&r.push(i);break;case Qt:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}(),a=i.appsToUnload,u=i.appsToUnmount,s=i.appsToLoad,c=i.appsToMount,l=[],f=_n,d=_n=window.location.href;return pe()?(bn=!0,r=a.concat(s,u,c),Promise.resolve().then((function(){return g(0===r.length?"before-no-app-change":"before-app-change",v(!0)),g("before-routing-event",v(!0,{cancelNavigation:h})),Promise.all(l).then((function(n){if(n.some((function(e){return e})))return hn.call(window.history,history.state,"",f.substring(location.origin.length)),_n=location.href,bn=!1,Sn(e,t,!0);var r=a.map(Q),o=u.map(T).map((function(e){return e.then(Q)})).concat(r),i=Promise.all(o);i.then((function(){g("before-mount-routing-event",v(!0))}),(function(e){throw e}));var l=s.map((function(e){return z(e).then((function(e){return de(e,i)}))})),d=c.filter((function(e){return s.indexOf(e)<0})).map((function(e){return de(e,i)}));return i.catch((function(e){throw y(),e})).then((function(){return y(),Promise.all(l.concat(d)).catch((function(t){throw e.forEach((function(e){return e.reject(t)})),t})).then(p).then((function(){}),(function(e){throw e}))}))}))}))):(r=s,Promise.resolve().then((function(){var e=s.map(z);return Promise.all(e).then(y).then((function(){return[]})).catch((function(e){throw y(),e})).finally((function(){}))})));function h(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);l.push(t.catch((function(e){return console.warn(Error(m(42,!1))),console.warn(e),!1})))}function p(){var t=te();e.forEach((function(e){return e.resolve(t)}));try{g(0===r.length?"no-app-change":"app-change",v()),g("routing-event",v())}catch(e){setTimeout((function(){throw e}))}if(bn=!1,wn.length>0){var n=wn;wn=[],Sn(n)}return t}function y(){n||(e.forEach((function(e){G(e.eventArguments)})),G(t))}function v(){var e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,l={},h=(o(e={},Qt,[]),o(e,Yt,[]),o(e,Ht,[]),o(e,nn,[]),e);n?(s.concat(c).forEach((function(e,t){y(e,Qt)})),a.forEach((function(e){y(e,Ht)})),u.forEach((function(e){y(e,Yt)}))):r.forEach((function(e){y(e)}));var p={detail:{newAppStatuses:l,appsByNewStatus:h,totalAppChanges:r.length,originalEvent:null==t?void 0:t[0],oldUrl:f,newUrl:d}};return i&&E(p.detail,i),p;function y(e,t){var n=_(e);t=t||re(n),l[n]=t,(h[t]=h[t]||[]).push(n)}}function g(e,t){n||window.dispatchEvent(new Vt("single-spa:".concat(e),t))}}var On=!1,En={getRawAppData:function(){return function(e){if(Array.isArray(e))return r(e)}(e=mn)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var e},reroute:Sn,NOT_LOADED:Ht,toLoadPromise:z,toBootstrapPromise:A,unregisterApplication:ae,getProfilerData:function(){return rn}};ln&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=En);var xn="openmrs:history";function kn(e,t,n){return kn=ge()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&jn(o,n.prototype),o},kn.apply(null,arguments)}function Pn(e){return Pn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Pn(e)}function jn(e,t){return jn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jn(e,t)}function An(e){var t="function"==typeof Map?new Map:void 0;return An=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return kn(e,arguments,Pn(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),jn(r,e)},An(e)}var Tn="/ws/rest/v1",Dn="/ws/fhir2/R4",Cn="".concat(Tn,"/session"),In=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jn(e,t)}(o,e);var t,n,r=(t=o,n=ge(),function(){var e,r=Pn(t);if(n){var o=Pn(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":a(n))&&"function"!=typeof t?ye(e):t;var n}(this,e)});function o(e,t,n,a){var u;return function(e,t){if(!i(e,t))throw new TypeError("Cannot call a class as a function")}(this,o),me(ye(u=r.call(this)),"response",void 0),me(ye(u),"responseBody",void 0),u.message="Server responded with ".concat(t.status," (").concat(t.statusText,") for url ").concat(e,". Check err.responseBody or network tab in dev tools for more info"),a.message=u.message,u.responseBody=n,u.response=t,u.stack="Stacktrace for outgoing request:\n".concat(a.stack,"\nStacktrace for incoming response:\n").concat(u.stack),u}return o}(An(Error)),Mn="".concat(Tn,"/attachment");function Rn(){var e;return e=function(e,t){var n;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){return(n=new FormData).append("fileCaption",t.fileDescription),n.append("patient",e),t.file?n.append("file",t.file):(n.append("file",new File([""],t.fileName),t.fileName),n.append("base64Content",t.base64Content)),[2,we("".concat(Mn),{method:"POST",body:n})]}))},Rn=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Se(i,r,o,a,u,"next",e)}function u(e){Se(i,r,o,a,u,"throw",e)}a(void 0)}))},Rn.apply(this,arguments)}var Nn=f(254),Ln=function(e){return void 0===e},Fn=(0,Bt.createGlobalStore)("session",{loaded:!1,session:null}),Bn=0;function Un(){return(Un=je((function(e,t){return Ae(this,(function(n){return[2,Ue(we(Cn,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}))]}))}))).apply(this,arguments)}function Kn(){return(Kn=je((function(e,t,n){return Ae(this,(function(r){switch(r.label){case 0:return n||(n=new AbortController),[4,we("".concat(Tn,"/user/").concat(e),{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:n.signal})];case 1:return r.sent(),[2,Ie()]}}))}))).apply(this,arguments)}Fn.subscribe((function(e){return e.session&&Ce(e.session)}));var zn=f(738);function Vn(){return Vn=Ge((function(e,t){var n,r,o,i,a,u=arguments;return qe(this,(function(s){switch(s.label){case 0:return n=!(u.length>2&&void 0!==u[2])||u[2],e?(r=null,[4,Promise.all([we("".concat(Dn,"/Patient/").concat(e),t).catch((function(e){return r=e})),n?$e(e):Promise.resolve(null)])]):[3,2];case 1:if(o=He.apply(void 0,[s.sent(),2]),i=o[0],a=o[1],i.ok)return[2,i.data];if(a)return[2,a];if(r)throw r;s.label=2;case 2:return[2,null]}}))})),Vn.apply(this,arguments)}function Gn(){return(Gn=Ge((function(e){var t,n,r;return qe(this,(function(o){switch(o.label){case 0:return[4,(0,zn.getSynchronizationItems)("patient-registration")];case 1:return t=o.sent(),n=t.find((function(t){return t.fhirPatient.id===e})),[2,null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null]}}))}))).apply(this,arguments)}var Hn=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),qn=function(t){function n(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return e(n,t),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},n}(yt),Wn=function(t){function n(e){var n=t.call(this,e)||this;return n.destination=e,n}return e(n,t),n}(mt),$n=function(t){function n(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return e(n,t),n.prototype[vt]=function(){return new Wn(this)},n.prototype.lift=function(e){var t=new Yn(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new Hn;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},n.prototype.error=function(e){if(this.closed)throw new Hn;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Hn;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(e){if(this.closed)throw new Hn;return t.prototype._trySubscribe.call(this,e)},n.prototype._subscribe=function(e){if(this.closed)throw new Hn;return this.hasError?(e.error(this.thrownError),yt.EMPTY):this.isStopped?(e.complete(),yt.EMPTY):(this.observers.push(e),new qn(this,e))},n.prototype.asObservable=function(){var e=new wt;return e.source=this,e},n.create=function(e,t){return new Yn(e,t)},n}(wt),Yn=function(t){function n(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return e(n,t),n.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},n.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},n.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},n.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):yt.EMPTY},n}($n),Jn=function(t){function n(e){var n=t.call(this)||this;return n._value=e,n}return e(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Hn;return this._value},n.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},n}($n),Qn=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}(),Zn=new wt((function(e){return e.complete()})),Xn=function(){function e(e){if(this.total=e,this.total<0)throw new Qn}return e.prototype.call=function(e,t){return t.subscribe(new er(e,this.total))},e}(),er=function(t){function n(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return e(n,t),n.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},n}(mt),tr=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new nr(e,this.project,this.thisArg))},e}(),nr=function(t){function n(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return e(n,t),n.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(mt),rr="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",or=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};Qe().subscribe((function(e){var t;t=e,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))}));var ir,ar,ur=new Jn(null);!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(ir||(ir={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(ar||(ar={}));var sr={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}}(),d}())}}}))},1704:()=>{function e(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}System.register(["@openmrs/esm-state"],(function(t,n){var r={};return{setters:[function(e){r.createGlobalStore=e.createGlobalStore,r.getGlobalStore=e.getGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(e){e.exports=r}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){var t=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},n=function(e){return function n(r){return 0===arguments.length||t(r)?n:e.apply(this,arguments)}},r=function(e){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return t(o)?r:n((function(t){return e(o,t)}));default:return t(o)&&t(i)?r:t(o)?n((function(t){return e(t,i)})):t(i)?n((function(t){return e(o,t)})):e(o,i)}}},a=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n},u=function(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1},s=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},c=function(e,t,n,r){var o=a(e);function i(e,t){return fe(e,t,n.slice(),r.slice())}return!u((function(e,t){return!u(i,t,e)}),a(t),o)},l=function(e){return function o(i,a,u){switch(arguments.length){case 0:return o;case 1:return t(i)?o:r((function(t,n){return e(i,t,n)}));case 2:return t(i)&&t(a)?o:t(i)?r((function(t,n){return e(t,a,n)})):t(a)?r((function(t,n){return e(i,t,n)})):n((function(t){return e(i,a,t)}));default:return t(i)&&t(a)&&t(u)?o:t(i)&&t(a)?r((function(t,n){return e(t,n,u)})):t(i)&&t(u)?r((function(t,n){return e(t,a,n)})):t(a)&&t(u)?r((function(t,n){return e(i,t,n)})):t(i)?n((function(t){return e(t,a,u)})):t(a)?n((function(t){return e(i,t,u)})):t(u)?n((function(t){return e(i,a,t)})):e(i,a,u)}}},f=function(e){return"[object Object]"===Object.prototype.toString.call(e)},d=function(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)},h=function(e,t,n,r){return e["@@transducer/result"](n[r](Ee(e["@@transducer/step"],e),t))},p=function(e,t){return function(n){if(!e(n))return"function"==typeof t?t(n):t}},y=function(e){return(0,Ie.getGlobalStore)("config-module-".concat(e),{config:null,loaded:!1,translationOverridesLoaded:!1})},v=function(){return(0,Ie.getGlobalStore)("config-extension-slots",{slots:{}})},m=function(e){return g(v().getState(),e)},g=function(e,t){var n=e.slots[t];return null!=n?n:{loaded:!1,config:{}}},b=function(){return(0,Ie.getGlobalStore)("config-extensions",{configs:{}})},w=function(e,t){var n=Object.assign({},_(b().getState(),e,t));return n.config=ve(["Display conditions","Translation overrides"],n.config),n},_=function(e,t,n){var r,o=null===(r=e.configs[t])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}},S=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},O=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},E=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){O(e,t,n[t])}))}return e},x=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},k=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||j(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},P=function(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},j=function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}},A=function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(e.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=y(u);if(e.moduleLoaded[u]){var c=G(u,e,t);s.setState({translationOverridesLoaded:!0,loaded:!0,config:c})}else{var l=H(u,e,t);s.setState({translationOverridesLoaded:!0,loaded:!1,config:l})}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},T=function(e,t){var n,r,o=(n=W(V(e,t)),function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=k(o.value,2),u=a[0],s=a[1],c=!0,l=!1,f=void 0;try{for(var d,h=Object.entries(s)[Symbol.iterator]();!(c=(d=h.next()).done);c=!0){var p=k(d.value,2),y=p[0];z(p[1],u,y)}}catch(e){l=!0,f=e}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(e,t){var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{})),Object.keys(r).reduce((function(e,t){return E({},e,r[t])}),{})),i=Object.fromEntries(Object.entries(o).map((function(e){var t=k(e,2);return[t[0],{loaded:!0,config:t[1]}]}))),a=v(),u=a.getState(),s={slots:E({},u.slots,i)};de(u,s)||a.setState(s)},D=function(e,t){var n=function(e,t){var n=Fe(be(e.schemas)),r=P(e.providedConfigs.map((function(e){return[e.config,e.source]}))).concat([[t.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,s=r[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=k(u.value,2);n=W([n,Be(c[0],c[1])])}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return n}(e,t);Le.setState({config:n})},C=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=t.mountedExtensions[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value,l=K(c.slotModuleName,c.extensionModuleName,c.slotName,c.extensionId,e,n);r[c.slotName]=x(E({},r[c.slotName]),O({},c.extensionId,{config:l,loaded:!0}))}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}b().setState({configs:r})},I=function(e,t){Ue(e,t);var n=ye(t,qe);Me.setState((function(t){return x(E({},t),{schemas:x(E({},t.schemas),O({},e,n)),moduleLoaded:x(E({},t.moduleLoaded),O({},e,!0))})}))},M=function(e){var t=Me.getState();Me.setState({schemas:x(E({},t.schemas),O({},e,qe))})},R=function(e){var t=Me.getState();Me.setState({schemas:x(E({},t.schemas),O({},e,He))})},N=function(e,t){Ue(e,t);var n=ye(t,qe),r=Me.getState();r.schemas[e]&&console.error("Config schema for extension ".concat(e," already exists. If there are multiple extensions with this same name, one will probably crash.")),Me.setState({schemas:x(E({},r.schemas),O({},e,n))})},L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"provided";Me.setState((function(n){return x(E({},n),{providedConfigs:P(n.providedConfigs).concat([{source:t,config:e}])})}))},F=function(e){return new Promise((function(t){var n=function(e){if(e.loaded&&e.config){var n=ve(["Display conditions","Translation overrides"],e.config);t(n),o&&o()}},r=y(e);n(r.getState());var o=r.subscribe(n)}))},B=function(e){return new Promise((function(t){var n=function(e){if(e.translationOverridesLoaded&&e.config){var n,r=null!==(n=e.config["Translation overrides"])&&void 0!==n?n:{};t(r),o&&o()}},r=y(e);n(r.getState());var o=r.subscribe(n)}))},U=function(e,t,n){$(e,t,n);var r=Ve(e,t);return ze(e,r,n),r},K=function(e,t,n,r,o,i){var a,u,s,c,l=function(e){return k(e.split("#"),1)[0]}(r),f=o.schemas[l],d=f?l:t,h=V(o,i),p=q(e,h),y=null!==(c=null==p||null===(a=p.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(s=u.configure)||void 0===s?void 0:s[r])&&void 0!==c?c:{},v=W([q(d,h),y]),m=null!=f?f:o.schemas[t];$(m,v,d);var g=Ve(m,v);return ze(m,g,d),delete g.extensionSlots,g},z=function(e,t,n){var r="".concat(t,".extensionSlots.").concat(n),o="Extension slot config '".concat(r,"'"),i=Object.keys(e).filter((function(e){return!["add","remove","order","configure"].includes(e)}));i.length&&X(r,o+"' contains invalid keys '".concat(i.join("', '"),"'")),e.add&&(Array.isArray(e.add)&&e.add.every((function(e){return"string"==typeof e}))||X(r,o+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((function(e){return"string"==typeof e}))||X(r,o+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((function(e){return"string"==typeof e}))||X(r,o+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(Z(e.configure)||X(r,o+".configure' is invalid. Must be an object with extension IDs for keys"))},V=function(e,t){return P(e.providedConfigs.map((function(e){return e.config}))).concat([t.config])},G=function(e,t,n){var r=t.schemas[e],o=q(e,V(t,n));$(r,o,e);var i=Ve(r,o);return ze(r,i,e),delete i.extensionSlots,i},H=function(e,t,n){var r=q(e,V(t,n)),o=Ve(qe,r);return ze(qe,o,e),delete o.extensionSlots,o},q=function(e,t){return W(t.map((function(t){return t[e]})).filter((function(e){return!!e})))},W=function(e){return ke(ye)({},e)},$=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=t[s],l=n+"."+s,f=e[s];e.hasOwnProperty(s)?Ke(f,c,l):"extensionSlots"===s&&""!==n||X(l,"Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},Y=function(e,t,n){return!t||J(e,[{Array:Pe,Boolean:je,ConceptUuid:Ce,Number:Ae,Object:De,String:Te,UUID:Ce,PersonAttributeTypeUuid:Ce,PatientIdentifierTypeUuid:Ce}[t]],n)},J=function(e,t,n){var r=!0;if(t)try{var o=!0,i=!1,a=void 0;try{for(var u,s=t[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=(0,u.value)(n);"string"==typeof c&&(X(e,"object"==typeof n?"Invalid configuration for ".concat(e,": ").concat(c):"Invalid configuration value ".concat(n," for ").concat(e,": ").concat(c)),r=!1)}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}}catch(t){console.error('Skipping invalid validator at "'.concat(e,'". Encountered error\n\t').concat(t))}return r},Q=function(e){return!!e&&Object.keys(e).filter((function(e){return!["_default","_validators"].includes(e)})).length>0},Z=function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e},X=function(e,t){var n="".concat(e,":::").concat(t);Ge.has(n)||(console.error(t),Ge.add(n))},ee=function(e){e?Ge.forEach((function(t){t.startsWith(e)&&Ge.delete(t)})):Ge.clear()};o.r(i),o.d(i,{Type:function(){return ge},clearConfigErrors:function(){return ee},configExtensionStore:function(){return Ne},configInternalStore:function(){return Me},defineConfigSchema:function(){return I},defineExtensionConfigSchema:function(){return N},getConfig:function(){return F},getConfigStore:function(){return y},getExtensionConfig:function(){return w},getExtensionConfigFromStore:function(){return _},getExtensionSlotConfig:function(){return m},getExtensionSlotConfigFromStore:function(){return g},getExtensionSlotsConfigStore:function(){return v},getExtensionsConfigStore:function(){return b},getTranslationOverrides:function(){return B},implementerToolsConfigStore:function(){return Le},inRange:function(){return We},isUrl:function(){return Ye},isUrlWithTemplateParameters:function(){return $e},oneOf:function(){return Je},processConfig:function(){return U},provide:function(){return L},registerModuleWithConfigSystem:function(){return M},registerTranslationNamespace:function(){return R},temporaryConfigStore:function(){return Re},validator:function(){return p},validators:function(){return Qe}});var te="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},ne=Object.prototype.toString,re=function(){return"[object Arguments]"===ne.call(arguments)?function(e){return"[object Arguments]"===ne.call(e)}:function(e){return s("callee",e)}}(),oe=re,ie=!{toString:null}.propertyIsEnumerable("toString"),ae=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ue=function(){return arguments.propertyIsEnumerable("length")}(),se=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},ce="function"!=typeof Object.keys||ue?n((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=ue&&oe(e);for(t in e)!s(t,e)||o&&"length"===t||(r[r.length]=t);if(ie)for(n=ae.length-1;n>=0;)s(t=ae[n],e)&&!se(r,t)&&(r[r.length]=t),n-=1;return r})):n((function(e){return Object(e)!==e?[]:Object.keys(e)})),le=n((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function fe(t,n,r,o){if(te(t,n))return!0;var i,a,u=le(t);if(u!==le(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(i=t.constructor,null==(a=String(i).match(/^function (\w*)/))?"":a[1]))return t===n;break;case"Boolean":case"Number":case"String":if((void 0===t?"undefined":e(t))!=(void 0===n?"undefined":e(n))||!te(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!te(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var l=r.length-1;l>=0;){if(r[l]===t)return o[l]===n;l-=1}switch(u){case"Map":return t.size===n.size&&c(t.entries(),n.entries(),r.concat([t]),o.concat([n]));case"Set":return t.size===n.size&&c(t.values(),n.values(),r.concat([t]),o.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var f=ce(t);if(f.length!==ce(n).length)return!1;var d=r.concat([t]),h=o.concat([n]);for(l=f.length-1;l>=0;){var p=f[l];if(!s(p,n)||!fe(n[p],t[p],d,h))return!1;l-=1}return!0}var de=r((function(e,t){return fe(e,t,[],[])})),he=l((function(e,t,n){var r,o={};for(r in t)s(r,t)&&(o[r]=s(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)s(r,n)&&!s(r,o)&&(o[r]=n[r]);return o})),pe=l((function e(t,n,r){return he((function(n,r,o){return f(r)&&f(o)?e(t,r,o):t(n,r,o)}),n,r)})),ye=r((function(e,t){return pe((function(e,t,n){return n}),e,t)})),ve=r((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var a in t)r.hasOwnProperty(a)||(n[a]=t[a]);return n}));function me(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var u in t[a+1]=e,n[a+1]=o,e)o[u]=r?me(e[u],t,n,!0):e[u];return o};switch(le(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}var ge,be=n((function(e){return null!=e&&"function"==typeof e.clone?e.clone():me(e,[],[],!0)})),we=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},_e=n((function(e){return!!we(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))})),Se=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Oe=r((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,u){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,u,s){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,u,s,c){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,u,s,c,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))})),Ee=Oe,xe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ke=l((function(e,t,n){if("function"==typeof e&&(e=function(e){return new Se(e)}(e)),_e(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return h(e,t,n,"fantasy-land/reduce");if(null!=n[xe])return d(e,t,n[xe]());if("function"==typeof n.next)return d(e,t,n);if("function"==typeof n.reduce)return h(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));!function(e){e.Array="Array",e.Boolean="Boolean",e.ConceptUuid="ConceptUuid",e.Number="Number",e.Object="Object",e.String="String",e.UUID="UUID",e.PersonAttributeTypeUuid="PersonAttributeTypeUuid",e.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(ge||(ge={}));var Pe=p((function(e){return Array.isArray(e)}),"must be an array"),je=p((function(e){return"boolean"==typeof e}),"must be a boolean"),Ae=p((function(e){return"number"==typeof e}),"must be a number"),Te=p((function(e){return"string"==typeof e}),"must be a string"),De=p((function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}),"must be an object (not an array or null)"),Ce=p((function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)}),"must be a valid UUID or a 36-character hexadecimal string"),Ie=o(685),Me=(0,Ie.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),Re=(0,Ie.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});Re.subscribe((function(e){var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));var Ne=(0,Ie.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),Le=(0,Ie.createGlobalStore)("config-implementer-tools",{config:{}});function Fe(e){return e.hasOwnProperty("_default")?x(E({},e),{_value:e._default,_source:"default"}):Z(e)?Object.keys(e).reduce((function(t,n){return t[n]=Fe(e[n]),t}),{}):{}}function Be(e,t){return Z(e)?Object.keys(e).reduce((function(n,r){return n[r]=Be(e[r],t),n}),{}):{_value:e,_source:t}}function Ue(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="Please verify that you are running the latest version and, if so, alert the maintainer.",o=!0,i=!1,a=void 0;try{for(var u,s=function(){var o=u.value,i=n+(n&&".")+o,a=t[o];if("Display conditions"===i&&console.error("".concat(e,' declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ').concat(r)),"Translation overrides"===i&&console.error("".concat(e,' declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ').concat(r)),!Z(a))return console.error("".concat(e," has bad config schema definition for key '").concat(i,"'. ").concat(r)),"continue";a.hasOwnProperty("_default")||Ue(e,a,i);var s=a._elements;if(Q(s)&&Ue(e,s,i+"._elements"),a._validators){var c=!0,l=!1,f=void 0;try{for(var d,h=a._validators[Symbol.iterator]();!(c=(d=h.next()).done);c=!0){var p=d.value;"function"!=typeof p&&console.error("".concat(e," has invalid validator for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: validators must be functions that return either "+"undefined or an error string. Received ".concat(p,"."))}}catch(e){l=!0,f=e}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}var y=a._type;y&&!Object.values(ge).includes(y)&&console.error("".concat(e," has invalid type for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: the allowed types are ".concat(Object.values(ge).join(", "),". ")+"Received '".concat(y,"'")),Object.keys(a).every((function(e){return["_description","_validators","_elements","_type"].includes(e)}))&&!n.includes("._elements")&&console.error("".concat(e," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: all config elements must have a default. "+"Received ".concat(JSON.stringify(a))),s&&y&&![ge.Array,ge.Object].includes(y)&&console.error("".concat(e," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. "+"Received ".concat(JSON.stringify(y)))},c=Object.keys(t).filter((function(e){return!e.startsWith("_")}))[Symbol.iterator]();!(o=(u=c.next()).done);o=!0)s()}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function Ke(e,t,n){Y(n,e._type,t),Z(t)?e._type===ge.Object?function(e,t,n){if(e._elements){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=t[s];$(e._elements,c,"".concat(n,".").concat(s))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(e,t,n):e.hasOwnProperty("_default")||e.hasOwnProperty("_type")||$(e,t,n):e._type===ge.Array&&function(e,t,n){if(Y(n,ge.Array,t)){if(Q(e._elements))for(var r=0;r<t.length;r++)Ke(e._elements,t[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<t.length;o++){var i;Y("".concat(n,"[").concat(o,"]"),null===(i=e._elements)||void 0===i?void 0:i._type,t[o])}}}(e,t,n)}function ze(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e)if(t!==e._default&&J(n,e._validators,t),Z(t)){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=t[s],l=n+"."+s,f=e[s];e._type===ge.Object&&e._elements?ze(e._elements,c,l):ze(f,c,l)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(t)&&e._elements)for(var d=0;d<t.length;d++)ze(e._elements,t[d],"".concat(n,"[").concat(d,"]"))}A(Me.getState(),Re.getState()),Me.subscribe((function(e){return A(e,Re.getState())})),Re.subscribe((function(e){return A(Me.getState(),e)})),D(Me.getState(),Re.getState()),Me.subscribe((function(e){return D(e,Re.getState())})),Re.subscribe((function(e){return D(Me.getState(),e)})),T(Me.getState(),Re.getState()),Me.subscribe((function(e){return T(e,Re.getState())})),Re.subscribe((function(e){return T(Me.getState(),e)})),C(Me.getState(),Ne.getState(),Re.getState()),Me.subscribe((function(e){C(e,Ne.getState(),Re.getState())})),Ne.subscribe((function(e){C(Me.getState(),e,Re.getState())})),Re.subscribe((function(e){C(Me.getState(),Ne.getState(),e)}));var Ve=function(e,t){var n=be(t);if(!e)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var t=a.value,r=n[t],o=e[t];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(t)||(n[t]=o._default);var i=o._elements;if(r&&Q(i))if(o._type===ge.Array&&Array.isArray(r)){var u=r.map((function(e){return Ve(i,e)}));n[t]=u}else if(o._type===ge.Object){var s=!0,c=!1,l=void 0;try{for(var f,d=Object.keys(r)[Symbol.iterator]();!(s=(f=d.next()).done);s=!0){var h=f.value;r[h]=Ve(i,r[h])}}catch(e){c=!0,l=e}finally{try{s||null==d.return||d.return()}finally{if(c)throw l}}}}else if(Z(o)){var p=null!=r?r:{};Z(p)&&(n[t]=Ve(o,p))}},s=Object.keys(e)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u()}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},Ge=new Set,He={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:ge.Object,_default:{},_validators:[p((function(e){return Object.keys(e).every((function(e){return/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)}))}),(function(e){var t=Object.keys(e).filter((function(e){return!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)}));return"The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ".concat(t.join(", "),".")}))]}},qe=E({"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:ge.Array,_default:[]}}},He),We=function(e,t){return p((function(n){return e<=n&&n<=t}),"must be between ".concat(e," and ").concat(t))},$e=function(e){var t=e.concat(["openmrsBase","openmrsSpaBase"]);return p((function(e){if(!e||"string"!=typeof e)return!1;for(var n=/\${(.*?)}/g,r=n.exec(e);r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+t.map((function(e){return"${"+e+"}"})).join(", "))},Ye=$e([]),Je=function(e){return p((function(t){return e.includes(t)}),"Must be one of the following: '".concat(e.join("', '"),"'."))},Qe={inRange:We,isUrl:Ye,isUrlWithTemplateParameters:$e,oneOf:Je}}(),i}())}}}))},7910:()=>{System.register(["@openmrs/esm-globals","@openmrs/esm-translations"],(function(e,t){var n={},r={};return{setters:[function(e){n.dispatchToastShown=e.dispatchToastShown},function(e){r.getCoreTranslation=e.getCoreTranslation}],execute:function(){e(function(){"use strict";var e={728:function(e){e.exports=n},901:function(e){e.exports=r}},t={};function o(n){var r=t[n];if(void 0!==r)return r.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){o.S={};var e={},t={};o.I=function(n,r){r||(r=[]);var i=t[n];if(i||(i=t[n]={}),!(r.indexOf(i)>=0)){if(r.push(i),e[n])return e[n];o.o(o.S,n)||(o.S[n]={}),o.S[n];var a=[];return e[n]=a.length?Promise.all(a).then((function(){return e[n]=1})):1}}}();var i={};return function(){var e=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},t=function(t){return function(){var n=this,r=arguments;return new Promise((function(o,i){var a=t.apply(n,r);function u(t){e(a,o,i,u,s,"next",t)}function s(t){e(a,o,i,u,s,"throw",t)}u(void 0)}))}},n=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},r=function(e){return e.replace(/[\/\-@]/g,"_")},a=function(e){return f.apply(this,arguments)},u=function(e,t){return d.apply(this,arguments)},s=function(){return h.apply(this,arguments)};o.r(i),o.d(i,{getCurrentImportMap:function(){return s},importDynamic:function(){return a},preloadImport:function(){return u},slugify:function(){return r}});var c=o(728),l=o(901);function f(){return f=t((function(e){var t,i,a,s,c,l,f,d,h,p,y=arguments;return n(this,(function(n){switch(n.label){case 0:return t=y.length>1&&void 0!==y[1]?y[1]:"./start",a=!(null==(i=y.length>2?y[2]:void 0)?void 0:i.maxLoadingTime)||i.maxLoadingTime<=0?6e5:i.maxLoadingTime,s=void 0,[4,Promise.race([u(e,null==i?void 0:i.importMap),new Promise((function(t,n){s=setTimeout((function(){var t;n(new Error("Could not resolve requested script, ".concat(e,", within ").concat((t=a)<1e3?"".concat(t," milliseconds"):t<6e4?"".concat(Math.floor(t/1e3)," seconds"):t<36e5?"".concat(Math.floor(t/6e4)," minutes"):t<864e5?"".concat(Math.floor(t/36e5)," hours"):"".concat(Math.floor(t/864e5)," days"),".")))}),a)}))])];case 1:if(n.sent(),s&&clearTimeout(s),c=r(e),"object"!=typeof(v=l=window[c])||null===v||!("init"in v)||"function"!=typeof v.init||!("get"in v)||"function"!=typeof v.get)throw f="The global variable ".concat(c," does not refer to a federated module"),console.error(f),new Error(f);return l.init(o.S.default),[4,l.get(t)];case 2:if(d=n.sent(),"object"!=typeof(h=d())||null===h)throw p="Container for ".concat(e," did not return an ESM module as expected"),console.error(p),new Error(p);return[2,h]}var v}))})),f.apply(this,arguments)}function d(){return(d=t((function(e,t){var o,i,a,u,f,d,h,y;return n(this,(function(n){switch(n.label){case 0:if("string"!=typeof e||0===e.trim().length)throw o="Attempted to call importDynamic() without supplying a package to load",console.error(o),new Error(o);return i=r(e),window[i]?[3,7]:null==t?[3,1]:(u=t,[3,3]);case 1:return[4,s()];case 2:u=n.sent(),n.label=3;case 3:if(!(a=u).imports.hasOwnProperty(e))throw f="Could not find the package ".concat(e," defined in the current importmap"),console.error(f),new Error(f);(d=a.imports[e]).startsWith("./")&&(d=window.spaBase+d.substring(1)),h=!!window.localStorage.getItem("import-map-override:".concat(e)),n.label=4;case 4:return n.trys.push([4,6,,7]),[4,new Promise((function(e,t){!function(e,t,n){var r=document.head.querySelector('script[src="'.concat(e,'"]')),o=window[p];if(o||(o=window[p]=new Set([])),r){var i,a,u;o.has(e)?(u=function(){i&&r.removeEventListener("load",i),a&&r.removeEventListener("error",a)},i=function(){u(),t(null)},a=function(e){u(),n(e.message)},r.addEventListener("load",i),r.addEventListener("error",a)):(console.warn("Script at ".concat(e," already loaded. Not loading it again.")),t(null))}else{o.add(e);var s=document.createElement("script");s.src=e,s.type="text/javascript",s.async=!0;var c,l,f,d=setTimeout((function(){console.error("The script at ".concat(e," did not load within 5 seconds. This may indicate an issue with the imports in the script's entry-point file or with the script's bundler configuration."))}),5e3);f=function(){clearTimeout(d),o.delete(e),c&&s.removeEventListener("load",c),l&&s.removeEventListener("error",l)},c=function(){f(),t(null)},l=function(t){f();var r,o="Failed to load script from ".concat(e);console.error(o,t),n(null!==(r=t.message)&&void 0!==r?r:o)},s.addEventListener("load",c),s.addEventListener("error",l),document.head.appendChild(s)}}(d,e,t)}))];case 5:return[2,n.sent()];case 6:return y=n.sent(),h&&(0,c.dispatchToastShown)({kind:"error",title:(0,l.getCoreTranslation)("scriptLoadingFailed","Error: Script failed to load"),description:(0,l.getCoreTranslation)("scriptLoadingError","Failed to load overridden script from {{- url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",{url:d}),actionButtonLabel:(0,l.getCoreTranslation)("resetOverrides","Reset overrides"),onActionButtonClick:function(){window.importMapOverrides.resetOverrides(),window.location.reload()}}),[2,Promise.reject(y)];case 7:return[2,Promise.resolve()]}}))}))).apply(this,arguments)}function h(){return(h=t((function(){return n(this,(function(e){return[2,window.importMapOverrides.getCurrentPageMap()]}))}))).apply(this,arguments)}var p=Symbol("__openmrs_script_loading")}(),i}())}}}))},9855:()=>{System.register(["@openmrs/esm-globals"],(function(e,t){var n={};return{setters:[function(e){n.dispatchToastShown=e.dispatchToastShown}],execute:function(){e(function(){"use strict";var e={728:function(e){e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){var e=function(e){var t=n(e);setTimeout((function(){throw t}))},t=function(){var t=Error();return function(r){n(r).stack+="\nAsync stacktrace:\n".concat(t.stack),e(r)}},n=function(e){var t,n,r,o,i;if(n=e,null!=(r=Error)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):(o=n,null!=(i=r)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?i[Symbol.hasInstance](o):o instanceof i))return e;if(null===e)return Error("'null' was thrown as an error");if("object"==typeof e){try{t="Object thrown as error: ".concat(JSON.stringify(e))}catch(n){t="Object thrown as error with the following properties: ".concat(Object.keys(e))}return Error(t)}return void 0===e?Error("'undefined' was thrown as an error"):Error(e.toString())};r.r(o),r.d(o,{createErrorHandler:function(){return t},reportError:function(){return e}});var i=r(728);window.onerror=function(e){return console.error("Unexpected error: ",e),(0,i.dispatchToastShown)({description:null!=e?e:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){var t;console.error("Unhandled rejection: ",e.reason),(0,i.dispatchToastShown)({description:null!==(t=e.reason)&&void 0!==t?t:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}}(),o}())}}}))},1491:(e,t,n)=>{function r(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}e=n.nmd(e),System.register(["@openmrs/esm-config","@openmrs/esm-state","@openmrs/esm-api","@openmrs/esm-feature-flags","@openmrs/esm-utils","single-spa"],(function(i,a){var u={},s={},c={},l={},f={},d={};return{setters:[function(e){u.configExtensionStore=e.configExtensionStore,u.getExtensionConfigFromStore=e.getExtensionConfigFromStore,u.getExtensionSlotConfig=e.getExtensionSlotConfig,u.getExtensionSlotConfigFromStore=e.getExtensionSlotConfigFromStore,u.getExtensionSlotsConfigStore=e.getExtensionSlotsConfigStore,u.getExtensionsConfigStore=e.getExtensionsConfigStore},function(e){s.createGlobalStore=e.createGlobalStore,s.getGlobalStore=e.getGlobalStore},function(e){c.getSessionStore=e.getSessionStore,c.userHasAccess=e.userHasAccess},function(e){l.featureFlagsStore=e.featureFlagsStore},function(e){f.isOnline=e.isOnline},function(e){d.mountRootParcel=e.mountRootParcel}],execute:function(){i(function(){"use strict";var i={766:function(e){e.exports=c},824:function(e){e.exports=u},708:function(e){e.exports=l},685:function(e){e.exports=s},618:function(e){e.exports=f},645:function(e){e.exports=d}},a={};function h(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return i[e](n,n.exports,h),n.exports}h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var p={};return function(){var i=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},a=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},u=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},s=function(e){var t=this.__data__=new Re(e);this.size=t.size},c=function(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new dt;++t<n;)this.add(e[t])},l=function(e){var t=kn.getState(),n=e(t);n!==t&&kn.setState(n)},f=function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=Object.values(e.extensions)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=!0,c=!1,l=void 0;try{for(var f,d=u.instances[Symbol.iterator]();!(s=(f=d.next()).done);s=!0){var h=f.value;t.push({slotModuleName:h.slotModuleName,extensionModuleName:u.moduleName,slotName:h.slotName,extensionId:h.id})}}catch(e){c=!0,l=e}finally{try{s||null==d.return||d.return()}finally{if(c)throw l}}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}On(En.configExtensionStore.getState().mountedExtensions,t)||En.configExtensionStore.setState({mountedExtensions:t})},d=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},y=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},v=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){y(e,t,n[t])}))}return e},m=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},g=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||w(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},b=function(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},w=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}},_=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=Object.entries(e.slots)[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=g(u.value,2),l=c[0],f=c[1],d=D(l,e,(0,En.getExtensionSlotConfigFromStore)(t,f.name).config,n);r[l]={moduleName:f.moduleName,assignedExtensions:d}}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}On(Mn.getState().slots,r)||Mn.setState({slots:r})},S=function(e,t){return{moduleName:t,name:e,attachedIds:[],config:null}},O=function(e){return g(e.split("#"),1)[0]},E=function(e,t){var n=O(t);return e.extensions[n]},x=function(e){return E(In.getState(),e)},k=function(e,t){l((function(n){var r=n.slots[e];return m(v({},n),r?{slots:m(v({},n.slots),y({},e,m(v({},r),{attachedIds:b(r.attachedIds).concat([t])})))}:{slots:m(v({},n.slots),y({},e,m(v({},S(e)),{attachedIds:[t]})))})}))},P=function(e,t){l((function(n){var r=n.slots[e];return r&&r.attachedIds.includes(t)?m(v({},n),{slots:m(v({},n.slots),y({},e,m(v({},r),{attachedIds:r.attachedIds.filter((function(e){return e!==t}))})))}):n}))},j=function(e){l((function(t){var n=t.slots[e];return n?m(v({},t),{slots:m(v({},t.slots),y({},e,m(v({},n),{attachedIds:[]})))}):t}))},A=function(e,t,n,r){var o=t.indexOf(e);if(-1!==o)return o;if(void 0!==n)return 1e3+n;var i=r.indexOf(e);return-1!==i?2e3+i:-1},T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=(0,Dn.isOnline)(null!=t?t:void 0),o=null!=n?n:Object.entries(Tn.featureFlagsStore.getState().flags).filter((function(e){return g(e,2)[1].enabled})).map((function(e){return g(e,1)[0]}));return e.filter((function(e){return!window.offlineEnabled||Ee(r,e.online,e.offline)})).filter((function(e){return void 0===e.featureFlag||(null==o?void 0:o.includes(e.featureFlag))}))},D=function(e,t,n,r){var o=function(e,t){var n=e.add||[],r=e.remove||[],o=e.order||[],i=In.getState().extensions;return b(t).concat(b(n)).filter((function(e){return!r.includes(e)})).sort((function(e,n){var r,a,u=A(e,o,null===(r=i[O(e)])||void 0===r?void 0:r.order,t),s=A(n,o,null===(a=i[O(n)])||void 0===a?void 0:a.order,t);return-1===s?-1:-1===u?1:u-s}))}(n,t.slots[e].attachedIds),i=[],a=void 0,u=!0,s=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(u=(l=f.next()).done);u=!0){var d=l.value,h=(0,En.getExtensionConfigFromStore)(r,e,d).config,p=O(d),y=t.extensions[p];if(y){var v,m,g,w,_,S,E,x,k,P=null!==(_=null!==(w=null==h||null===(v=h["Display conditions"])||void 0===v?void 0:v.privileges)&&void 0!==w?w:y.privileges)&&void 0!==_?_:[];if(P&&("string"==typeof P||Array.isArray(P)&&P.length>0)){var j;if(Cn(a)&&(a=null===(j=(0,An.getSessionStore)().getState().session)||void 0===j?void 0:j.user),!a)continue;if(!(0,An.userHasAccess)(P,a))continue}i.push({id:d,name:p,moduleName:y.moduleName,config:h,featureFlag:y.featureFlag,meta:y.meta,online:null===(E=null!==(S=null==h||null===(m=h["Display conditions"])||void 0===m?void 0:m.online)&&void 0!==S?S:y.online)||void 0===E||E,offline:null!==(k=null!==(x=null==h||null===(g=h["Display conditions"])||void 0===g?void 0:g.offline)&&void 0!==x?x:y.offline)&&void 0!==k&&k})}}}catch(e){s=!0,c=e}finally{try{u||null==f.return||f.return()}finally{if(s)throw c}}return i},C=function(e){return D(e,In.getState(),(0,En.getExtensionSlotConfig)(e).config,Nn.getState())},I=function(e){zn.setState((function(t){return t.modals[e.name]=e,t}))},M=function(e){var t=zn.getState().modals[e];if(!t){var n=x(e);n&&(t={name:e,load:n.load,moduleName:n.moduleName},console.warn("Modal ".concat(e,' was registered as an extension. This is deprecated and will be removed in the future. Please register it in the "modals" section of routes.json instead of the "extensions" section.')),I(t))}return t},R=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},N=function(e,t){if(!r(e,t))throw new TypeError("Cannot call a class as a function")},L=function(e){var t=function(e,t){if("object"!==Vn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Vn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Vn(t)?t:String(t)},F=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,L(r.key),r)}},B=function(e,t,n){return t&&F(e.prototype,t),n&&F(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},U=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},K=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gn(e,t)},z=function(e,t){if(t&&("object"===Vn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return U(e)},V=function(e,t,n){return(t=L(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},G=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},H=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},q=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?H(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},W=function(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n},$=function(e){return null==e?"":""+e},Y=function(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}for(var i="string"!=typeof t?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),e=Object.prototype.hasOwnProperty.call(e,a)?e[a]:{}}return o()?{}:{obj:e,k:r(i.shift())}},J=function(e,t,n){var r=Y(e,t,Object);r.obj[r.k]=n},Q=function(e,t){var n=Y(e,t),r=n.obj,o=n.k;if(r)return r[o]},Z=function(e,t,n){var r=Q(e,n);return void 0!==r?r:Q(t,n)},X=function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},ee=function(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Qn[e]})):e},te=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},ne=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?te(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):te(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},re=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},oe=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},ie=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},ae=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},ue=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ae(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ae(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},se=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},ce=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?se(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},le=function(e){var t={};return function(n,r,o){var i=r+JSON.stringify(o),a=t[i];return a||(a=e(r,o),t[i]=a),a(n)}},fe=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},de=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fe(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},he=function(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e},pe=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},ye=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(n),!0).forEach((function(t){V(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},ve=function(){},me=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},ge=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},be=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ge(e,t,n[t])}))}return e},we=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},_e=function(e){var t,n,r,o,i,a,u;gr.setState((function(s){return{workspaces:we(be({},s.workspaces),ge({},e.name,we(be({},e),{preferredWindowSize:null!==(t=e.preferredWindowSize)&&void 0!==t?t:"normal",type:null!==(n=e.type)&&void 0!==n?n:"form",canHide:null!==(r=e.canHide)&&void 0!==r&&r,canMaximize:null!==(o=e.canMaximize)&&void 0!==o&&o,width:null!==(i=e.width)&&void 0!==i?i:"narrow",hasOwnSidebar:null!==(a=e.hasOwnSidebar)&&void 0!==a&&a,sidebarFamily:null!==(u=e.sidebarFamily)&&void 0!==u?u:"default"})))}}))},Se=function(e){var t=gr.getState().workspaces;if(t[e])return t[e];var n,r,o,i,a,u,s,c,l,f,d,h,p,y,v,m,g=x(e);if(g)return br.has(e)||(console.warn("The workspace '".concat(e,'\' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.')),br.add(e)),{name:g.name,title:(y=g,m=null==y||null===(v=y.meta)||void 0===v?void 0:v.title,"string"==typeof m?m:m&&"object"==typeof m?(d=y.moduleName,h=m.key,p=m.default,mr.t(h,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){me(e,t,n[t])}))}return e}({ns:d,defaultValue:p},void 0))):y.name),moduleName:g.moduleName,preferredWindowSize:null!==(u=null===(n=g.meta)||void 0===n?void 0:n.screenSize)&&void 0!==u?u:"normal",load:g.load,type:null!==(s=null===(r=g.meta)||void 0===r?void 0:r.type)&&void 0!==s?s:"form",canHide:null!==(c=null===(o=g.meta)||void 0===o?void 0:o.canHide)&&void 0!==c&&c,canMaximize:null!==(l=null===(i=g.meta)||void 0===i?void 0:i.canMaximize)&&void 0!==l&&l,width:null!==(f=null===(a=g.meta)||void 0===a?void 0:a.width)&&void 0!==f?f:"narrow",sidebarFamily:"default",hasOwnSidebar:!1};throw new Error("No workspace named '".concat(e,"' has been registered."))},Oe=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Ee((0,Dn.isOnline)(),e,t)},Ee=function(e){return Boolean(e?!(arguments.length>1&&void 0!==arguments[1])||arguments[1]:arguments.length>2&&void 0!==arguments[2]&&arguments[2])},xe=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},ke=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},Pe=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},je=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Pe(e,t,n[t])}))}return e},Ae=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},Te=function(e,t,n,r){return Sr.apply(this,arguments)};h.r(p),h.d(p,{attach:function(){return k},checkStatus:function(){return Oe},checkStatusFor:function(){return Ee},detach:function(){return P},detachAll:function(){return j},extensionStore:function(){return Or},getAssignedExtensions:function(){return C},getConnectedExtensions:function(){return T},getExtensionInternalStore:function(){return Pn},getExtensionNameFromId:function(){return O},getExtensionRegistration:function(){return x},getExtensionRegistrationFrom:function(){return E},getExtensionStore:function(){return jn},getModalRegistration:function(){return M},getWorkspaceRegistration:function(){return Se},registerExtension:function(){return Bn},registerExtensionSlot:function(){return Un},registerModal:function(){return I},registerWorkspace:function(){return _e},renderExtension:function(){return Te},reset:function(){return Kn},updateInternalExtensionStore:function(){return l}});var De=function(e,t){return e===t||e!=e&&t!=t},Ce=function(e,t){for(var n=e.length;n--;)if(De(e[n][0],t))return n;return-1},Ie=Array.prototype.splice;i.prototype.clear=function(){this.__data__=[],this.size=0},i.prototype.delete=function(e){var t=this.__data__,n=Ce(t,e);return!(n<0||(n==t.length-1?t.pop():Ie.call(t,n,1),--this.size,0))},i.prototype.get=function(e){var t=this.__data__,n=Ce(t,e);return n<0?void 0:t[n][1]},i.prototype.has=function(e){return Ce(this.__data__,e)>-1},i.prototype.set=function(e,t){var n=this.__data__,r=Ce(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Me,Re=i,Ne="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,Le="object"==typeof self&&self&&self.Object===Object&&self,Fe=Ne||Le||Function("return this")(),Be=Fe.Symbol,Ue=Object.prototype,Ke=Ue.hasOwnProperty,ze=Ue.toString,Ve=Be?Be.toStringTag:void 0,Ge=Object.prototype.toString,He=Be?Be.toStringTag:void 0,qe=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":He&&He in Object(e)?function(e){var t=Ke.call(e,Ve),n=e[Ve];try{e[Ve]=void 0;var r=!0}catch(e){}var o=ze.call(e);return r&&(t?e[Ve]=n:delete e[Ve]),o}(e):function(e){return Ge.call(e)}(e)},We=function(e){var t=void 0===e?"undefined":o(e);return null!=e&&("object"==t||"function"==t)},$e=function(e){if(!We(e))return!1;var t=qe(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ye=Fe["__core-js_shared__"],Je=(Me=/[^.]+$/.exec(Ye&&Ye.keys&&Ye.keys.IE_PROTO||""))?"Symbol(src)_1."+Me:"",Qe=Function.prototype.toString,Ze=function(e){if(null!=e){try{return Qe.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Xe=/^\[object .+?Constructor\]$/,et=Function.prototype,tt=Object.prototype,nt=et.toString,rt=tt.hasOwnProperty,ot=RegExp("^"+nt.call(rt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),it=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!We(e)||(t=e,Je&&Je in t))&&($e(e)?ot:Xe).test(Ze(e));var t}(n)?n:void 0},at=it(Fe,"Map"),ut=it(Object,"create"),st=Object.prototype.hasOwnProperty,ct=Object.prototype.hasOwnProperty;a.prototype.clear=function(){this.__data__=ut?ut(null):{},this.size=0},a.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},a.prototype.get=function(e){var t=this.__data__;if(ut){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return st.call(t,e)?t[e]:void 0},a.prototype.has=function(e){var t=this.__data__;return ut?void 0!==t[e]:ct.call(t,e)},a.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ut&&void 0===t?"__lodash_hash_undefined__":t,this};var lt=a,ft=function(e,t){var n,r,i=e.__data__;return("string"==(r=o(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};u.prototype.clear=function(){this.size=0,this.__data__={hash:new lt,map:new(at||Re),string:new lt}},u.prototype.delete=function(e){var t=ft(this,e).delete(e);return this.size-=t?1:0,t},u.prototype.get=function(e){return ft(this,e).get(e)},u.prototype.has=function(e){return ft(this,e).has(e)},u.prototype.set=function(e,t){var n=ft(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var dt=u;s.prototype.clear=function(){this.__data__=new Re,this.size=0},s.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},s.prototype.get=function(e){return this.__data__.get(e)},s.prototype.has=function(e){return this.__data__.has(e)},s.prototype.set=function(e,t){var n=this.__data__;if(r(n,Re)){var o=n.__data__;if(!at||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new dt(o)}return n.set(e,t),this.size=n.size,this};var ht=s;c.prototype.add=c.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},c.prototype.has=function(e){return this.__data__.has(e)};var pt=c,yt=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},vt=function(e,t,n,r,o,i){var a=1&n,u=e.length,s=t.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var f=-1,d=!0,h=2&n?new pt:void 0;for(i.set(e,t),i.set(t,e);++f<u;){var p=e[f],y=t[f];if(r)var v=a?r(y,p,f,t,e,i):r(p,y,f,e,t,i);if(void 0!==v){if(v)continue;d=!1;break}if(h){if(!yt(t,(function(e,t){if(a=t,!h.has(a)&&(p===e||o(p,e,n,r,i)))return h.push(t);var a}))){d=!1;break}}else if(p!==y&&!o(p,y,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},mt=Fe.Uint8Array,gt=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},bt=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},wt=Be?Be.prototype:void 0,_t=wt?wt.valueOf:void 0,St=Array.isArray,Ot=Object.prototype.propertyIsEnumerable,Et=Object.getOwnPropertySymbols,xt=Et?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a)&&(i[o++]=a)}return i}(Et(e),(function(t){return Ot.call(e,t)})))}:function(){return[]},kt=function(e){return null!=e&&"object"==typeof e},Pt=function(e){return kt(e)&&"[object Arguments]"==qe(e)},jt=Object.prototype,At=jt.hasOwnProperty,Tt=jt.propertyIsEnumerable,Dt=Pt(function(){return arguments}())?Pt:function(e){return kt(e)&&At.call(e,"callee")&&!Tt.call(e,"callee")},Ct=Dt,It=t&&!t.nodeType&&t,Mt=It&&e&&!e.nodeType&&e,Rt=Mt&&Mt.exports===It?Fe.Buffer:void 0,Nt=(Rt?Rt.isBuffer:void 0)||function(){return!1},Lt=/^(?:0|[1-9]\d*)$/,Ft=function(e,t){var n=void 0===e?"undefined":o(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Lt.test(e))&&e>-1&&e%1==0&&e<t},Bt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Ut={};Ut["[object Float32Array]"]=Ut["[object Float64Array]"]=Ut["[object Int8Array]"]=Ut["[object Int16Array]"]=Ut["[object Int32Array]"]=Ut["[object Uint8Array]"]=Ut["[object Uint8ClampedArray]"]=Ut["[object Uint16Array]"]=Ut["[object Uint32Array]"]=!0,Ut["[object Arguments]"]=Ut["[object Array]"]=Ut["[object ArrayBuffer]"]=Ut["[object Boolean]"]=Ut["[object DataView]"]=Ut["[object Date]"]=Ut["[object Error]"]=Ut["[object Function]"]=Ut["[object Map]"]=Ut["[object Number]"]=Ut["[object Object]"]=Ut["[object RegExp]"]=Ut["[object Set]"]=Ut["[object String]"]=Ut["[object WeakMap]"]=!1;var Kt,zt=t&&!t.nodeType&&t,Vt=zt&&e&&!e.nodeType&&e,Gt=Vt&&Vt.exports===zt&&Ne.process,Ht=function(){try{return Vt&&Vt.require&&Vt.require("util").types||Gt&&Gt.binding&&Gt.binding("util")}catch(e){}}(),qt=Ht&&Ht.isTypedArray,Wt=qt?(Kt=qt,function(e){return Kt(e)}):function(e){return kt(e)&&Bt(e.length)&&!!Ut[qe(e)]},$t=Object.prototype.hasOwnProperty,Yt=Object.prototype,Jt=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Qt=Object.prototype.hasOwnProperty,Zt=function(e){return null!=(t=e)&&Bt(t.length)&&!$e(t)?function(e,t){var n=St(e),r=!n&&Ct(e),o=!n&&!r&&Nt(e),i=!n&&!r&&!o&&Wt(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=u.length;for(var c in e)!$t.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ft(c,s))||u.push(c);return u}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Yt))return Jt(e);var t,n,r=[];for(var o in Object(e))Qt.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},Xt=function(e){return function(e,t,n){var r=t(e);return St(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Zt,xt)},en=Object.prototype.hasOwnProperty,tn=it(Fe,"DataView"),nn=it(Fe,"Promise"),rn=it(Fe,"Set"),on=it(Fe,"WeakMap"),an="[object Map]",un="[object Promise]",sn="[object Set]",cn="[object WeakMap]",ln="[object DataView]",fn=Ze(tn),dn=Ze(at),hn=Ze(nn),pn=Ze(rn),yn=Ze(on),vn=qe;(tn&&vn(new tn(new ArrayBuffer(1)))!=ln||at&&vn(new at)!=an||nn&&vn(nn.resolve())!=un||rn&&vn(new rn)!=sn||on&&vn(new on)!=cn)&&(vn=function(e){var t=qe(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ze(n):"";if(r)switch(r){case fn:return ln;case dn:return an;case hn:return un;case pn:return sn;case yn:return cn}return t});var mn=vn,gn="[object Arguments]",bn="[object Array]",wn="[object Object]",_n=Object.prototype.hasOwnProperty,Sn=function e(t,n,o,i,a){return t===n||(null==t||null==n||!kt(t)&&!kt(n)?t!=t&&n!=n:function(e,t,n,o,i,a){var u=St(e),s=St(t),c=u?bn:mn(e),l=s?bn:mn(t),f=(c=c==gn?wn:c)==wn,d=(l=l==gn?wn:l)==wn,h=c==l;if(h&&Nt(e)){if(!Nt(t))return!1;u=!0,f=!1}if(h&&!f)return a||(a=new ht),u||Wt(e)?vt(e,t,n,o,i,a):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new mt(e),new mt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return De(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=gt;case"[object Set]":var s=1&r;if(u||(u=bt),e.size!=t.size&&!s)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var l=vt(u(e),u(t),r,o,i,a);return a.delete(e),l;case"[object Symbol]":if(_t)return _t.call(e)==_t.call(t)}return!1}(e,t,c,n,o,i,a);if(!(1&n)){var p=f&&_n.call(e,"__wrapped__"),y=d&&_n.call(t,"__wrapped__");if(p||y){var v=p?e.value():e,m=y?t.value():t;return a||(a=new ht),i(v,m,n,o,a)}}return!!h&&(a||(a=new ht),function(e,t,n,o,i,a){var u=1&n,s=Xt(e),c=s.length;if(c!=Xt(t).length&&!u)return!1;for(var l=c;l--;){var f=s[l];if(!(u?f in t:en.call(t,f)))return!1}var d=a.get(e),h=a.get(t);if(d&&h)return d==t&&h==e;var p=!0;a.set(e,t),a.set(t,e);for(var y=u;++l<c;){var v=e[f=s[l]],m=t[f];if(o)var g=u?o(m,v,f,t,e,a):o(v,m,f,e,t,a);if(!(void 0===g?v===m||i(v,m,n,o,a):g)){p=!1;break}y||(y="constructor"==f)}if(p&&!y){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&r(b,b)&&"function"==typeof w&&r(w,w)||(p=!1)}return a.delete(e),a.delete(t),p}(e,t,n,o,i,a))}(t,n,o,i,e,a))},On=function(e,t){return Sn(e,t)},En=h(824),xn=h(685),kn=(0,xn.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),Pn=function(){return(0,xn.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}})},jn=function(){return(0,xn.getGlobalStore)("extensions",{slots:{}})};f(kn.getState()),kn.subscribe(f);var An=h(766),Tn=h(708),Dn=h(618),Cn=function(e){return void 0===e},In=Pn(),Mn=jn(),Rn=(0,En.getExtensionSlotsConfigStore)(),Nn=(0,En.getExtensionsConfigStore)();In.subscribe((function(e){_(e,Rn.getState(),Nn.getState())})),Rn.subscribe((function(e){_(In.getState(),e,Nn.getState())})),Nn.subscribe((function(e){_(In.getState(),Rn.getState(),e)}));var Ln,Fn,Bn=function(e){return In.setState((function(t){return t.extensions[e.name]=m(v({},e),{instances:[]}),t}))},Un=function(e,t){return In.setState((function(n){var r,o=null===(r=n.slots[t])||void 0===r?void 0:r.moduleName;if(o&&o!=e)return console.warn("An extension slot with the name '".concat(t,'\' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ').concat(o,".")),n;if(o&&o==e)return n;if(n.slots[t])return m(v({},n),{slots:m(v({},n.slots),y({},t,m(v({},n.slots[t]),{moduleName:e})))});var i=S(t,e);return m(v({},n),{slots:m(v({},n.slots),y({},t,i))})}))},Kn=function(){return Mn.setState((function(){return{slots:{},extensions:{}}}))},zn=(0,xn.createGlobalStore)("modalRegistry",{modals:{}});function Vn(e){return Vn="function"==typeof Symbol&&"symbol"==o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)},Vn(e)}function Gn(e,t){return Gn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Gn(e,t)}function Hn(e){return Hn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hn(e)}Ln=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){R(e,t,n[t])}))}return e}({},{address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",postalCode:"Postal code",state:"State",stateProvince:"State"},{closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:"There are unsaved changes in {{workspaceName}}. Please save them before opening another workspace.",unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header"}),Fn=null!=(Fn={actions:"Actions",address:"Address",age:"Age",cancel:"Cancel",change:"Change",close:"Close",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",female:"Female",hideDetails:"Hide details",loading:"Loading",male:"Male",other:"Other",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",seeMoreLists:"See {{count}} more lists",sex:"Sex",showDetails:"Show details",unknown:"Unknown"})?Fn:{},Object.getOwnPropertyDescriptors?Object.defineProperties(Ln,Object.getOwnPropertyDescriptors(Fn)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(Fn)).forEach((function(e){Object.defineProperty(Ln,e,Object.getOwnPropertyDescriptor(Fn,e))}));var qn={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},Wn=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};N(this,e),this.init(t,n)}return B(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||qn,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,q(q({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}(),$n=new Wn,Yn=function(){function e(){N(this,e),this.observers={}}return B(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function Jn(e,t,n){for(var o in t)"__proto__"!==o&&"constructor"!==o&&(o in e?"string"==typeof e[o]||r(e[o],String)||"string"==typeof t[o]||r(t[o],String)?n&&(e[o]=t[o]):Jn(e[o],t[o],n):e[o]=t[o]);return e}var Qn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},Zn="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Xn=[" ",",","?","!",";"];function er(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;i<r.length;++i){if(!o)return;if("string"==typeof o[r[i]]&&i+1<r.length)return;if(void 0===o[r[i]]){for(var a=2,u=r.slice(i,i+a).join(n),s=o[u];void 0===s&&r.length>i+a;)a++,s=o[u=r.slice(i,i+a).join(n)];if(void 0===s)return;if(null===s)return null;if(t.endsWith(u)){if("string"==typeof s)return s;if(u&&"string"==typeof s[u])return s[u]}var c=r.slice(i+a).join(n);return c?er(s,c,n):void 0}o=o[r[i]]}return o}}var tr=function(e){K(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Hn(t);if(n){var o=Hn(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return z(this,e)});function o(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return N(this,o),t=r.call(this),Zn&&Yn.call(U(t)),t.data=e||{},t.options=n,void 0===t.options.keySeparator&&(t.options.keySeparator="."),void 0===t.options.ignoreJSONStructure&&(t.options.ignoreJSONStructure=!0),t}return B(o,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));var u=Q(this.data,a);return u||!i||"string"!=typeof n?u:er(this.data&&this.data[e]&&this.data[e][t],n,o)}},{key:"addResource",value:function(e,t,n,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},i=this.options.keySeparator;void 0===i&&(i=".");var a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(r=t,t=(a=e.split("."))[1]),this.addNamespaces(t),J(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var u=Q(this.data,a)||{};r?Jn(u,n,o):u=ne(ne({},u),n),J(this.data,a,u),i.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?ne(ne({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),o}(Yn),nr={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,o){var i=this;return e.forEach((function(e){i.processors[e]&&(t=i.processors[e].process(t,n,r,o))})),t}},rr={},or=function(e){K(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Hn(t);if(n){var o=Hn(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return z(this,e)});function o(e){var t,n,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return N(this,o),t=r.call(this),Zn&&Yn.call(U(t)),n=e,i=U(t),["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((function(e){n[e]&&(i[e]=n[e])})),t.options=a,void 0===t.options.keySeparator&&(t.options.keySeparator="."),t.logger=$n.create("translator"),t}return B(o,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,o=t.ns||this.options.defaultNS||[],i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var r=Xn.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===r.length)return!0;var o=new RegExp("(".concat(r.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}(e,n,r));if(i&&!a){var u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:o};var s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(o=s.shift()),e=s.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}},{key:"translate",value:function(e,t,n){var r=this;if("object"!==Vn(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var i=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,a=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],t),s=u.key,c=u.namespaces,l=c[c.length-1],f=t.lng||this.language,d=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(d){var h=t.nsSeparator||this.options.nsSeparator;return i?(p.res="".concat(l).concat(h).concat(s),p):"".concat(l).concat(h).concat(s)}return i?(p.res=s,p):s}var p=this.resolve(e,t),y=p&&p.res,v=p&&p.usedKey||s,m=p&&p.exactUsedKey||s,g=Object.prototype.toString.apply(y),b=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,w=!this.i18nFormat||this.i18nFormat.handleAsObject;if(w&&y&&"string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0&&("string"!=typeof b||"[object Array]"!==g)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var _=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,y,oe(oe({},t),{},{ns:c})):"key '".concat(s," (").concat(this.language,")' returned an object instead of string.");return i?(p.res=_,p):_}if(a){var S="[object Array]"===g,O=S?[]:{},E=S?m:v;for(var x in y)if(Object.prototype.hasOwnProperty.call(y,x)){var k="".concat(E).concat(a).concat(x);O[x]=this.translate(k,oe(oe({},t),{joinArrays:!1,ns:c})),O[x]===k&&(O[x]=y[x])}y=O}}else if(w&&"string"==typeof b&&"[object Array]"===g)(y=y.join(b))&&(y=this.extendTranslation(y,e,t,n));else{var P=!1,j=!1,A=void 0!==t.count&&"string"!=typeof t.count,T=o.hasDefaultValue(t),D=A?this.pluralResolver.getSuffix(f,t.count,t):"",C=t["defaultValue".concat(D)]||t.defaultValue;!this.isValidLookup(y)&&T&&(P=!0,y=C),this.isValidLookup(y)||(j=!0,y=s);var I=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:y,M=T&&C!==y&&this.options.updateMissing;if(j||P||M){if(this.logger.log(M?"updateKey":"missingKey",f,l,s,M?C:y),a){var R=this.resolve(s,oe(oe({},t),{},{keySeparator:!1}));R&&R.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var N=[],L=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&L&&L[0])for(var F=0;F<L.length;F++)N.push(L[F]);else"all"===this.options.saveMissingTo?N=this.languageUtils.toResolveHierarchy(t.lng||this.language):N.push(t.lng||this.language);var B=function(e,n,o){var i=T&&o!==y?o:I;r.options.missingKeyHandler?r.options.missingKeyHandler(e,l,n,i,M,t):r.backendConnector&&r.backendConnector.saveMissing&&r.backendConnector.saveMissing(e,l,n,i,M,t),r.emit("missingKey",e,l,n,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?N.forEach((function(e){r.pluralResolver.getSuffixes(e,t).forEach((function(n){B([e],s+n,t["defaultValue".concat(n)]||C)}))})):B(N,s,C))}y=this.extendTranslation(y,e,t,p,n),j&&y===s&&this.options.appendNamespaceToMissingKey&&(y="".concat(l,":").concat(s)),(j||P)&&this.options.parseMissingKeyHandler&&(y="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(l,":").concat(s):s,P?y:void 0):this.options.parseMissingKeyHandler(y))}return i?(p.res=y,p):y}},{key:"extendTranslation",value:function(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,oe(oe({},this.options.interpolation.defaultVariables),n),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(oe(oe({},n),{interpolation:oe(oe({},this.options.interpolation),n.interpolation)}));var a,u="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(u){var s=e.match(this.interpolator.nestingRegexp);a=s&&s.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=oe(oe({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),u){var l=e.match(this.interpolator.nestingRegexp);a<(l&&l.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):i.translate.apply(i,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,d="string"==typeof f?[f]:f;return null!=e&&d&&d.length&&!1!==n.applyPostProcessor&&(e=nr.handle(d,e,t,this.options&&this.options.postProcessPassResolved?oe({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,o,i,a=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!a.isValidLookup(t)){var s=a.extractFromKey(e,u),c=s.key;n=c;var l=s.namespaces;a.options.fallbackNS&&(l=l.concat(a.options.fallbackNS));var f=void 0!==u.count&&"string"!=typeof u.count,d=f&&!u.ordinal&&0===u.count&&a.pluralResolver.shouldUseIntlApi(),h=void 0!==u.context&&("string"==typeof u.context||"number"==typeof u.context)&&""!==u.context,p=u.lngs?u.lngs:a.languageUtils.toResolveHierarchy(u.lng||a.language,u.fallbackLng);l.forEach((function(e){a.isValidLookup(t)||(i=e,!rr["".concat(p[0],"-").concat(e)]&&a.utils&&a.utils.hasLoadedNamespace&&!a.utils.hasLoadedNamespace(i)&&(rr["".concat(p[0],"-").concat(e)]=!0,a.logger.warn('key "'.concat(n,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((function(n){if(!a.isValidLookup(t)){o=n;var i,s=[c];if(a.i18nFormat&&a.i18nFormat.addLookupKeys)a.i18nFormat.addLookupKeys(s,c,n,e,u);else{var l;f&&(l=a.pluralResolver.getSuffix(n,u.count,u));var p="".concat(a.options.pluralSeparator,"zero");if(f&&(s.push(c+l),d&&s.push(c+p)),h){var y="".concat(c).concat(a.options.contextSeparator).concat(u.context);s.push(y),f&&(s.push(y+l),d&&s.push(y+p))}}for(;i=s.pop();)a.isValidLookup(t)||(r=i,t=a.getResource(n,e,i,u))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),o}(Yn),ir=function(){function e(t){N(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=$n.create("languageUtils")}return B(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=ie(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=ie(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=ie(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),o=[],i=function(e){e&&(n.isSupportedCode(e)?o.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(e))):"string"==typeof e&&i(this.formatLanguageCode(e)),r.forEach((function(e){o.indexOf(e)<0&&i(n.formatLanguageCode(e))})),o}}]),e}(),ar=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],ur={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},sr=["v1","v2","v3"],cr={zero:0,one:1,two:2,few:3,many:4,other:5},lr=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};N(this,e),this.languageUtils=t,this.options=r,this.logger=$n.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(n={},ar.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:ur[e.fc]}}))})),n)}return B(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((function(e,t){return cr[e]-cr[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):r.numbers.map((function(r){return t.getSuffix(e,r,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(e,n);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(t)):this.getSuffixRetroCompatible(r,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,r=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),o=e.numbers[r];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var i=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!sr.includes(this.options.compatibilityJSON)}}]),e}(),fr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};N(this,e),this.logger=$n.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return B(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:ee,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?X(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?X(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?X(t.nestingPrefix):t.nestingPrefixEscaped||X("$t("),this.nestingSuffix=t.nestingSuffix?X(t.nestingSuffix):t.nestingSuffixEscaped||X(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var o,i,a,u=this,s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(u.formatSeparator)<0){var o=Z(t,s,e);return u.alwaysFormat?u.format(o,void 0,n,ue(ue(ue({},r),t),{},{interpolationkey:e})):o}var i=e.split(u.formatSeparator),a=i.shift().trim(),c=i.join(u.formatSeparator).trim();return u.format(Z(t,s,a),c,n,ue(ue(ue({},r),t),{},{interpolationkey:a}))};this.resetRegExp();var f=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return u.escapeValue?c(u.escape(e)):c(e)}}].forEach((function(t){for(a=0;o=t.regex.exec(e);){var n=o[1].trim();if(void 0===(i=l(n)))if("function"==typeof f){var s=f(e,o,r);i="string"==typeof s?s:""}else if(r&&r.hasOwnProperty(n))i="";else{if(d){i=o[0];continue}u.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),i=""}else"string"==typeof i||u.useRawValueToEscape||(i=$(i));var c=t.safeValue(i);if(e=e.replace(o[0],c),d?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,++a>=u.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=ue({},i);function u(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(r[1]);e=r[0];var i=(o=this.interpolate(o,a)).match(/'/g),u=o.match(/"/g);(i&&i.length%2==0&&!u||u.length%2!=0)&&(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),t&&(a=ue(ue({},t),a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(o)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var s=[],c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),s=l,c=!0}if((r=t(u.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=$(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),c&&(r=s.reduce((function(e,t){return o.format(e,t,i.lng,ue(ue({},i),{},{interpolationkey:n[1].trim()}))}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}(),dr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};N(this,e),this.logger=$n.create("formatter"),this.options=t,this.formats={number:le((function(e,t){var n=new Intl.NumberFormat(e,t);return function(e){return n.format(e)}})),currency:le((function(e,t){var n=new Intl.NumberFormat(e,ce(ce({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:le((function(e,t){var n=new Intl.DateTimeFormat(e,ce({},t));return function(e){return n.format(e)}})),relativetime:le((function(e,t){var n=new Intl.RelativeTimeFormat(e,ce({},t));return function(e){return n.format(e,t.range||"day")}})),list:le((function(e,t){var n=new Intl.ListFormat(e,ce({},t));return function(e){return n.format(e)}}))},this.init(t)}return B(e,[{key:"init",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=le(t)}},{key:"format",value:function(e,t,n,r){var o=this;return t.split(this.formatSeparator).reduce((function(e,t){var i=function(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((function(e){if(e){var t=function(e){if(Array.isArray(e))return e}(i=e.split(":"))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return G(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?G(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],o=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[r.trim()]||(n[r.trim()]=o),"false"===o&&(n[r.trim()]=!1),"true"===o&&(n[r.trim()]=!0),isNaN(o)||(n[r.trim()]=parseInt(o,10))}var i}))}return{formatName:t,formatOptions:n}}(t),a=i.formatName,u=i.formatOptions;if(o.formats[a]){var s=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=c.locale||c.lng||r.locale||r.lng||n;s=o.formats[a](e,l,ce(ce(ce({},u),r),c))}catch(e){o.logger.warn(e)}return s}return o.logger.warn("there was no format function for ".concat(a)),e}),e)}}]),e}(),hr=function(e){K(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Hn(t);if(n){var o=Hn(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return z(this,e)});function o(e,t,n){var i,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return N(this,o),i=r.call(this),Zn&&Yn.call(U(i)),i.backend=e,i.store=t,i.services=n,i.languageUtils=n.languageUtils,i.options=a,i.logger=$n.create("backendConnector"),i.waitingReads=[],i.maxParallelReads=a.maxParallelReads||10,i.readingCalls=0,i.maxRetries=a.maxRetries>=0?a.maxRetries:5,i.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(n,a.backend,a),i}return B(o,[{key:"queueLoad",value:function(e,t,n,r){var o=this,i={},a={},u={},s={};return e.forEach((function(e){var r=!0;t.forEach((function(t){var u="".concat(e,"|").concat(t);!n.reload&&o.store.hasResourceBundle(e,t)?o.state[u]=2:o.state[u]<0||(1===o.state[u]?void 0===a[u]&&(a[u]=!0):(o.state[u]=1,r=!1,void 0===a[u]&&(a[u]=!0),void 0===i[u]&&(i[u]=!0),void 0===s[t]&&(s[t]=!0)))})),r||(u[e]=!0)})),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(s)}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;var a={};this.queue.forEach((function(n){var r,u,s,c,l;r=n.loaded,u=i,(c=(s=Y(r,[o],Object)).obj)[l=s.k]=c[l]||[],c[l].push(u),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((function(e){a[e]||(a[e]={});var t=n.loaded[e];t.length&&t.forEach((function(t){void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;return e.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:o,wait:i,callback:a}):(this.readingCalls++,this.backend[n](e,t,(function(u,s){if(r.readingCalls--,r.waitingReads.length>0){var c=r.waitingReads.shift();r.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}u&&s&&o<r.maxRetries?setTimeout((function(){r.read.call(r,e,t,n,o+1,2*i,a)}),i):a(u,s)}))):a(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var i=this.queueLoad(e,t,r,o);if(!i.toLoad.length)return i.pending.length||o(),null;i.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),o=r[0],i=r[1];this.read(o,i,"read",void 0,void 0,(function(r,a){r&&t.logger.warn("".concat(n,"loading namespace ").concat(i," for language ").concat(o," failed"),r),!r&&a&&t.logger.log("".concat(n,"loaded namespace ").concat(i," for language ").concat(o),a),t.loaded(e,r,a)}))}},{key:"saveMissing",value:function(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,de(de({},i),{},{isUpdate:o})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),o}(Yn),pr=function(e){K(o,e);var t,n,r=(t=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=Hn(t);if(n){var o=Hn(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return z(this,e)});function o(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(N(this,o),e=r.call(this),Zn&&Yn.call(U(e)),e.options=he(n),e.services={},e.logger=$n,e.modules={external:[]},t=U(e),Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((function(e){"function"==typeof t[e]&&(t[e]=t[e].bind(t))})),i&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,i),z(e,U(e));setTimeout((function(){e.init(n,i)}),0)}return e}return B(o,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var r={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===Vn(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===Vn(e[2])||"object"===Vn(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function o(e){return e?"function"==typeof e?new e:e:null}if(this.options=ye(ye(ye({},r),this.options),he(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=ye(ye({},r.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var i;this.modules.logger?$n.init(o(this.modules.logger),this.options):$n.init(null,this.options),this.modules.formatter?i=this.modules.formatter:"undefined"!=typeof Intl&&(i=dr);var a=new ir(this.options);this.store=new tr(this.options.resources,this.options);var u=this.services;u.logger=$n,u.resourceStore=this.store,u.languageUtils=a,u.pluralResolver=new lr(a,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!i||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(u.formatter=o(i),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new fr(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new hr(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new or(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=ve),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.length>0&&"dev"!==s[0]&&(this.options.lng=s[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var c=W(),l=function(){var t=function(t,r){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),c.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),c}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ve,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var o=[],i=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};r?i(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return i(e)})),this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),n(e)}))}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=W();return e||(e=this.languages),t||(t=this.options.ns),n||(n=ve),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&nr.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=W();this.emit("languageChanging",e);var o=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},i=function(i){e||i||!n.services.languageDetector||(i=[]);var a="string"==typeof i?i:n.services.languageUtils.getBestMatchFromCodes(i);a&&(n.language||o(a),n.translator.language||n.translator.changeLanguage(a),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(a)),n.loadResources(a,(function(e){!function(e,i){i?(o(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,a)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t,n){var r=this,o=function e(t,o){var i;if("object"!==Vn(o)){for(var a=arguments.length,u=new Array(a>2?a-2:0),s=2;s<a;s++)u[s-2]=arguments[s];i=r.options.overloadTranslationOptionHandler([t,o].concat(u))}else i=ye({},o);i.lng=i.lng||e.lng,i.lngs=i.lngs||e.lngs,i.ns=i.ns||e.ns,i.keyPrefix=i.keyPrefix||n||e.keyPrefix;var c=r.options.keySeparator||".",l=i.keyPrefix?"".concat(i.keyPrefix).concat(c).concat(t):t;return r.t(l,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var a=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var u=n.precheck(this,a);if(void 0!==u)return u}return!(!this.hasResourceBundle(r,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!a(r,e)||o&&!a(i,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=W();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=W();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],o=e.filter((function(e){return r.indexOf(e)<0}));return o.length?(this.options.preload=r.concat(o),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ve,r=ye(ye(ye({},this.options),t),{isClone:!0}),i=new o(r);return void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t)),["store","services","language"].forEach((function(t){i[t]=e[t]})),i.services=ye({},this.services),i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i.translator=new or(i.services,i.options),i.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];i.emit.apply(i,[e].concat(n))})),i.init(r,n),i.translator.options=i.options,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),o}(Yn);V(pr,"createInstance",(function(){return new pr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}));var yr=pr.createInstance();yr.createInstance=pr.createInstance,yr.createInstance,yr.init,yr.loadResources,yr.reloadResources,yr.use,yr.changeLanguage,yr.getFixedT,yr.t,yr.exists,yr.setDefaultNamespace,yr.hasLoadedNamespace,yr.loadNamespaces,yr.loadLanguages;var vr=yr,mr=vr.default||vr;mr.on("initialized",(function(){window.i18next.loadNamespaces(["core"])}));var gr=(0,xn.createGlobalStore)("workspaceRegistrations",{workspaces:{}}),br=new Set,wr=h(645),_r=0;function Sr(){var e;return e=function(e,t,n,r){var o,i,a,u,s,c,f,d,h,p,y,v,m,g,b=arguments;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(w){switch(w.label){case 0:if(o=b.length>4&&void 0!==b[4]?b[4]:function(e){return e},i=b.length>5&&void 0!==b[5]?b[5]:{},a=O(r),u=x(r),s=null,!e)return[3,3];if(!u)throw Error("Couldn't find extension '".concat(a,"' to attach to '").concat(t,"'"));return c=u.load,f=u.meta,d=u.moduleName,h=u.online,p=u.offline,Oe(h,p)?(l((function(o){var i,u={domElement:e,id:r,slotName:t,slotModuleName:n};return Ae(je({},o),{extensions:Ae(je({},o.extensions),Pe({},a,Ae(je({},o.extensions[a]),{instances:(i=o.extensions[a].instances,function(e){if(Array.isArray(e))return xe(e)}(i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return xe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xe(e,t):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([u])})))})})),[4,c()]):[3,2];case 1:y=w.sent(),v=y.default,m=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(y,["default"]),g=_r++,s=(0,wr.mountRootParcel)(o(Ae(je({},null!=v?v:m),{name:"".concat(t,"/").concat(a,"-").concat(g)})),Ae(je({},i),{_meta:f,_extensionContext:{extensionId:r,extensionSlotName:t,extensionSlotModuleName:n,extensionModuleName:d},domElement:e})),w.label=2;case 2:return[3,4];case 3:console.warn("Tried to render ".concat(r," into ").concat(t," but no DOM element was available.")),w.label=4;case 4:return[2,s]}}))},Sr=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ke(i,r,o,a,u,"next",e)}function u(e){ke(i,r,o,a,u,"throw",e)}a(void 0)}))},Sr.apply(this,arguments)}var Or=Pn()}(),p}())}}}))},6362:()=>{System.register(["@openmrs/esm-state"],(function(e,t){var n={};return{setters:[function(e){n.getGlobalStore=e.getGlobalStore}],execute:function(){e(function(){"use strict";var e={685:function(e){e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){var e=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},t=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},n=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(n){t(e,n,r[n])}))}return e},i=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},a=function(e,r,o){var a;d.setState((function(u){var s;return{flags:i(n({},u.flags),t({},e,{enabled:null!==(a=null===(s=u.flags[e])||void 0===s?void 0:s.enabled)&&void 0!==a&&a,label:r,description:o}))}}))},u=function(e){return d.getState().flags[e].enabled},s=function(e,t){d.subscribe((function(n){t(n.flags[e].enabled)}))},c=function(e,r){d.setState((function(o){return{flags:i(n({},o.flags),t({},e,i(n({},o.flags[e]),{enabled:r})))}}))};r.r(o),r.d(o,{featureFlagsStore:function(){return d},getFeatureFlag:function(){return u},registerFeatureFlag:function(){return a},setFeatureFlag:function(){return c},subscribeToFeatureFlag:function(){return s}});var l=r(685),f={flags:function(){var e={},t=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(localStorage)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var u=i.value;if(u.startsWith("openmrs:feature-flag:")){var s=u.replace("openmrs:feature-flag:",""),c=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(s))||"{}");e[s]=n({enabled:"true"===localStorage.getItem(u)},c)}}}catch(e){r=!0,o=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw o}}return e}()},d=(0,l.getGlobalStore)("feature-flags",f);d.subscribe((function(t){var n,r=!0,o=!1,i=void 0;try{for(var a,u=Object.entries(t.flags)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=function(e){if(Array.isArray(e))return e}(n=a.value)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n)||function(t,n){if(t){if("string"==typeof t)return e(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,2):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=s[0],l=s[1];localStorage.setItem("openmrs:feature-flag:".concat(c),l.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(c),JSON.stringify({label:l.label,description:l.description}))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}))}(),o}())}}}))},7350:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var a=e.apply(t,n);function u(e){o(a,r,i,u,s,"next",e)}function s(e){o(a,r,i,u,s,"throw",e)}u(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){c(e,t,n[t])}))}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function v(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}function m(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function g(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}e=n.nmd(e),System.register(["@openmrs/esm-error-handling","@openmrs/esm-extensions","@openmrs/esm-navigation","@openmrs/esm-react-utils","@openmrs/esm-state","@openmrs/esm-translations","dayjs","i18next","react","react-dom","rxjs"],(function(r,o){var u={},v={},b={},w={},S={},O={},E={},x={},k={},P={},j={};return Object.defineProperty(k,"__esModule",{value:!0}),Object.defineProperty(P,"__esModule",{value:!0}),{setters:[function(){},function(e){v.getExtensionInternalStore=e.getExtensionInternalStore,v.getExtensionStore=e.getExtensionStore},function(){},function(){},function(e){S.createGlobalStore=e.createGlobalStore,S.getGlobalStore=e.getGlobalStore},function(){},function(e){E.default=e.default},function(e){x.default=e.default},function(e){Object.keys(e).forEach((function(t){k[t]=e[t]}))},function(e){Object.keys(e).forEach((function(t){P[t]=e[t]}))},function(e){j.BehaviorSubject=e.BehaviorSubject,j.Subject=e.Subject}],execute:function(){r(function(){var r={976:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e,t=[],n=0;n<arguments.length;n++){var i=arguments[n];if(i){var a=void 0===i?"undefined":(e=i)&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":y(e);if("string"===a||"number"===a)t.push(i);else if(Array.isArray(i)){if(i.length){var u=o.apply(null,i);u&&t.push(u)}}else if("object"===a){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){t.push(i.toString());continue}for(var s in i)r.call(i,s)&&i[s]&&t.push(s)}}}return t.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},701:function(e){e.exports=function(){"use strict";return function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}}()},353:function(e,t,n){!function(t){"use strict";var r=function(e){return function(t,n){return"object"==typeof t&&(n=t,t=null),null==t&&(t=(new Date).toString()),n||(n={}),e.call(this,t,n)}},o=n(42),i=e.exports={generate:r((function(e,t){return new o(e,t)}))};t&&(t.fn.geopattern=r((function(e,n){return this.each((function(){var r=t(this).attr("data-title-sha");r&&(n=t.extend({hash:r},n));var o=i.generate(e,n);t(this).css("background-image",o.toDataUrl())}))})))}("undefined"!=typeof jQuery?jQuery:null)},851:function(e){"use strict";e.exports={hex2rgb:function(e){e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(e,t,n,r){return t+t+n+n+r+r}));var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},rgb2hex:function(e){return"#"+["r","g","b"].map((function(t){return("0"+e[t].toString(16)).slice(-2)})).join("")},rgb2hsl:function(e){var t=e.r,n=e.g,r=e.b;t/=255,n/=255,r/=255;var o,i,a=Math.max(t,n,r),u=Math.min(t,n,r),s=(a+u)/2;if(a===u)o=i=0;else{var c=a-u;switch(i=s>.5?c/(2-a-u):c/(a+u),a){case t:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-t)/c+2;break;case r:o=(t-n)/c+4}o/=6}return{h:o,s:i,l:s}},hsl2rgb:function(e){var t,n,r,o=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},i=e.h,a=e.s,u=e.l;if(0===a)t=n=r=u;else{var s=u<.5?u*(1+a):u+a-u*a,c=2*u-s;t=o(c,s,i+1/3),n=o(c,s,i),r=o(c,s,i-1/3)}return{r:Math.round(255*t),g:Math.round(255*n),b:Math.round(255*r)}},rgb2rgbString:function(e){return"rgb("+[e.r,e.g,e.b].join(",")+")"}}},42:function(e,t,n){"use strict";var r=function(e,t,n){return parseInt(e.substr(t,n||1),16)},o=function(e,t,n,r,o){return(parseFloat(e)-t)*(o-r)/(n-t)+r},i=function(e){return e%2==0?g:m},a=function(e){return o(e,0,15,_,S)},u=function(e){return[[e,0,e,3*e],[0,e,3*e,e]]},s=function(e){return[0,0,e,e,0,e,0,0].join(",")},c=function(e,t,n,r,o){var u=s(r),c=a(o[0]),l=i(o[0]),f={stroke:b,"stroke-opacity":w,"fill-opacity":c,fill:l};e.polyline(u,f).transform({translate:[t+r,n],scale:[-1,1]}),e.polyline(u,f).transform({translate:[t+r,n+2*r],scale:[1,-1]}),c=a(o[1]),l=i(o[1]),f={stroke:b,"stroke-opacity":w,"fill-opacity":c,fill:l},e.polyline(u,f).transform({translate:[t+r,n+2*r],scale:[-1,-1]}),e.polyline(u,f).transform({translate:[t+r,n],scale:[1,1]})},l=function(e,t,n,r,o){var u=a(o),c=i(o),l=s(r),f={stroke:b,"stroke-opacity":w,"fill-opacity":u,fill:c};e.polyline(l,f).transform({translate:[t,n+r],scale:[1,-1]}),e.polyline(l,f).transform({translate:[t+2*r,n+r],scale:[-1,-1]}),e.polyline(l,f).transform({translate:[t,n+r],scale:[1,1]}),e.polyline(l,f).transform({translate:[t+2*r,n+r],scale:[-1,1]})},f=n(495),d=n(851),h=n(451),p=n(138),y={baseColor:"#933c3c"},v=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],m="#222",g="#ddd",b="#000",w=.02,_=.02,S=.15,O=e.exports=function(e,t){return this.opts=f({},y,t),this.hash=t.hash||h(e),this.svg=new p,this.generateBackground(),this.generatePattern(),this};O.prototype.toSvg=function(){return this.svg.toString()},O.prototype.toString=function(){return this.toSvg()},O.prototype.toBase64=function(){var e=this.toSvg();return"undefined"!=typeof window&&"function"==typeof window.btoa?window.btoa(e):new Buffer(e).toString("base64")},O.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},O.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},O.prototype.generateBackground=function(){var e,t,n,i;this.opts.color?n=d.hex2rgb(this.opts.color):(t=o(r(this.hash,14,3),0,4095,0,359),i=r(this.hash,17),(e=d.rgb2hsl(d.hex2rgb(this.opts.baseColor))).h=(360*e.h-t+360)%360/360,e.s=i%2==0?Math.min(1,(100*e.s+i)/100):Math.max(0,(100*e.s-i)/100),n=d.hsl2rgb(e)),this.color=d.rgb2hex(n),this.svg.rect(0,0,"100%","100%",{fill:d.rgb2rgbString(n)})},O.prototype.generatePattern=function(){var e=this.opts.generator;if(e){if(v.indexOf(e)<0)throw new Error("The generator "+e+" does not exist.")}else e=v[r(this.hash,20)];return this["geo"+e.slice(0,1).toUpperCase()+e.slice(1)]()},O.prototype.geoHexagons=function(){var e,t,n,u,s,c,l,f=o(r(this.hash,0),0,15,8,60),d=f*Math.sqrt(3),h=2*f,p=function(e){var t=e,n=t/2,r=Math.sin(60*Math.PI/180)*t;return[0,r,n,0,n+t,0,2*t,r,n+t,2*r,n,2*r,0,r].join(",")}(f);for(this.svg.setWidth(3*h+3*f),this.svg.setHeight(6*d),t=0,l=0;l<6;l++)for(c=0;c<6;c++)e=c%2==0?l*d:l*d+d/2,n=a(s=r(this.hash,t)),u={fill:i(s),"fill-opacity":n,stroke:b,"stroke-opacity":w},this.svg.polyline(p,u).transform({translate:[c*f*1.5-h/2,e-d/2]}),0===c&&this.svg.polyline(p,u).transform({translate:[6*f*1.5-h/2,e-d/2]}),0===l&&(e=c%2==0?6*d:6*d+d/2,this.svg.polyline(p,u).transform({translate:[c*f*1.5-h/2,e-d/2]})),0===c&&0===l&&this.svg.polyline(p,u).transform({translate:[6*f*1.5-h/2,5*d+d/2]}),t++},O.prototype.geoSineWaves=function(){var e,t,n,u,s,c,l=Math.floor(o(r(this.hash,0),0,15,100,400)),f=Math.floor(o(r(this.hash,1),0,15,30,100)),d=Math.floor(o(r(this.hash,2),0,15,3,30));for(this.svg.setWidth(l),this.svg.setHeight(36*d),e=0;e<36;e++)t=a(s=r(this.hash,e)),u={fill:"none",stroke:i(s),opacity:t,"stroke-width":d+"px"},n="M0 "+f+" C "+(c=l/4*.7)+" 0, "+(l/2-c)+" 0, "+l/2+" "+f+" S "+(l-c)+" "+2*f+", "+l+" "+f+" S "+(1.5*l-c)+" 0, "+1.5*l+", "+f,this.svg.path(n,u).transform({translate:[-l/4,d*e-1.5*f]}),this.svg.path(n,u).transform({translate:[-l/4,d*e-1.5*f+36*d]})},O.prototype.geoChevrons=function(){var e,t,n,u,s,c,l,f,d,h,p=o(r(this.hash,0),0,15,30,80),y=o(r(this.hash,0),0,15,30,80),v=[[0,0,(e=p)/2,(t=y)-(n=.66*t),e/2,t,0,n,0,0],[e/2,t-n,e,0,e,n,e/2,t,e/2,t-n]].map((function(e){return e.join(",")}));for(this.svg.setWidth(6*p),this.svg.setHeight(6*y*.66),s=0,h=0;h<6;h++)for(d=0;d<6;d++)c=a(f=r(this.hash,s)),u=i(f),l={stroke:b,"stroke-opacity":w,fill:u,"fill-opacity":c,"stroke-width":1},this.svg.group(l).transform({translate:[d*p,h*y*.66-y/2]}).polyline(v).end(),0===h&&this.svg.group(l).transform({translate:[d*p,6*y*.66-y/2]}).polyline(v).end(),s+=1},O.prototype.geoPlusSigns=function(){var e,t,n,s,c,l,f,d=o(r(this.hash,0),0,15,10,25),h=3*d,p=u(d);for(this.svg.setWidth(12*d),this.svg.setHeight(12*d),t=0,f=0;f<6;f++)for(l=0;l<6;l++)n=a(c=r(this.hash,t)),e=f%2==0?0:1,s={fill:i(c),stroke:b,"stroke-opacity":w,"fill-opacity":n},this.svg.group(s).transform({translate:[l*h-l*d+e*d-d,f*h-f*d-h/2]}).rect(p).end(),0===l&&this.svg.group(s).transform({translate:[4*h-l*d+e*d-d,f*h-f*d-h/2]}).rect(p).end(),0===f&&this.svg.group(s).transform({translate:[l*h-l*d+e*d-d,4*h-f*d-h/2]}).rect(p).end(),0===l&&0===f&&this.svg.group(s).transform({translate:[4*h-l*d+e*d-d,4*h-f*d-h/2]}).rect(p).end(),t++},O.prototype.geoXes=function(){var e,t,n,s,c,l,f,d=o(r(this.hash,0),0,15,10,25),h=u(d),p=3*d*.943;for(this.svg.setWidth(3*p),this.svg.setHeight(3*p),t=0,f=0;f<6;f++)for(l=0;l<6;l++)n=a(c=r(this.hash,t)),e=l%2==0?f*p-.5*p:f*p-.5*p+p/4,s={fill:i(c),opacity:n},this.svg.group(s).transform({translate:[l*p/2-p/2,e-f*p/2],rotate:[45,p/2,p/2]}).rect(h).end(),0===l&&this.svg.group(s).transform({translate:[6*p/2-p/2,e-f*p/2],rotate:[45,p/2,p/2]}).rect(h).end(),0===f&&(e=l%2==0?6*p-p/2:6*p-p/2+p/4,this.svg.group(s).transform({translate:[l*p/2-p/2,e-6*p/2],rotate:[45,p/2,p/2]}).rect(h).end()),5===f&&this.svg.group(s).transform({translate:[l*p/2-p/2,e-11*p/2],rotate:[45,p/2,p/2]}).rect(h).end(),0===l&&0===f&&this.svg.group(s).transform({translate:[6*p/2-p/2,e-6*p/2],rotate:[45,p/2,p/2]}).rect(h).end(),t++},O.prototype.geoOverlappingCircles=function(){var e,t,n,u,s,c,l=o(r(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),e=0,c=0;c<6;c++)for(s=0;s<6;s++)t=a(u=r(this.hash,e)),n={fill:i(u),opacity:t},this.svg.circle(s*l,c*l,l,n),0===s&&this.svg.circle(6*l,c*l,l,n),0===c&&this.svg.circle(s*l,6*l,l,n),0===s&&0===c&&this.svg.circle(6*l,6*l,l,n),e++},O.prototype.geoOctogons=function(){var e,t,n,u,s,c,l=o(r(this.hash,0),0,15,10,60),f=function(e){var t=.33*e;return[t,0,e-t,0,e,t,e,e-t,e-t,e,t,e,0,e-t,0,t,t,0].join(",")}(l);for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),t=0,c=0;c<6;c++)for(s=0;s<6;s++)n=a(u=r(this.hash,t)),e=i(u),this.svg.polyline(f,{fill:e,"fill-opacity":n,stroke:b,"stroke-opacity":w}).transform({translate:[s*l,c*l]}),t+=1},O.prototype.geoSquares=function(){var e,t,n,u,s,c,l=o(r(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),t=0,c=0;c<6;c++)for(s=0;s<6;s++)n=a(u=r(this.hash,t)),e=i(u),this.svg.rect(s*l,c*l,l,l,{fill:e,"fill-opacity":n,stroke:b,"stroke-opacity":w}),t+=1},O.prototype.geoConcentricCircles=function(){var e,t,n,u,s,c,l=o(r(this.hash,0),0,15,10,60),f=l/5;for(this.svg.setWidth(6*(l+f)),this.svg.setHeight(6*(l+f)),t=0,c=0;c<6;c++)for(s=0;s<6;s++)n=a(u=r(this.hash,t)),e=i(u),this.svg.circle(s*l+s*f+(l+f)/2,c*l+c*f+(l+f)/2,l/2,{fill:"none",stroke:e,opacity:n,"stroke-width":f+"px"}),n=a(u=r(this.hash,39-t)),e=i(u),this.svg.circle(s*l+s*f+(l+f)/2,c*l+c*f+(l+f)/2,l/4,{fill:e,"fill-opacity":n}),t+=1},O.prototype.geoOverlappingRings=function(){var e,t,n,u,s,c,l=o(r(this.hash,0),0,15,10,60),f=l/4;for(this.svg.setWidth(6*l),this.svg.setHeight(6*l),e=0,c=0;c<6;c++)for(s=0;s<6;s++)t=a(u=r(this.hash,e)),n={fill:"none",stroke:i(u),opacity:t,"stroke-width":f+"px"},this.svg.circle(s*l,c*l,l-f/2,n),0===s&&this.svg.circle(6*l,c*l,l-f/2,n),0===c&&this.svg.circle(s*l,6*l,l-f/2,n),0===s&&0===c&&this.svg.circle(6*l,6*l,l-f/2,n),e+=1},O.prototype.geoTriangles=function(){var e,t,n,u,s,c,l,f=o(r(this.hash,0),0,15,15,80),d=f/2*Math.sqrt(3),h=function(e,t){var n=e/2;return[n,0,e,t,0,t,n,0].join(",")}(f,d);for(this.svg.setWidth(3*f),this.svg.setHeight(6*d),e=0,l=0;l<6;l++)for(c=0;c<6;c++)t=a(s=r(this.hash,e)),u={fill:i(s),"fill-opacity":t,stroke:b,"stroke-opacity":w},n=l%2==0?c%2==0?180:0:c%2!=0?180:0,this.svg.polyline(h,u).transform({translate:[c*f*.5-f/2,d*l],rotate:[n,f/2,d/2]}),0===c&&this.svg.polyline(h,u).transform({translate:[6*f*.5-f/2,d*l],rotate:[n,f/2,d/2]}),e+=1},O.prototype.geoDiamonds=function(){var e,t,n,u,s,c,l,f,d,h=o(r(this.hash,0),0,15,10,50),p=o(r(this.hash,1),0,15,10,50),y=[(e=h)/2,0,e,(t=p)/2,e/2,t,0,t/2].join(",");for(this.svg.setWidth(6*h),this.svg.setHeight(3*p),u=0,d=0;d<6;d++)for(f=0;f<6;f++)s=a(l=r(this.hash,u)),c={fill:i(l),"fill-opacity":s,stroke:b,"stroke-opacity":w},n=d%2==0?0:h/2,this.svg.polyline(y,c).transform({translate:[f*h-h/2+n,p/2*d-p/2]}),0===f&&this.svg.polyline(y,c).transform({translate:[6*h-h/2+n,p/2*d-p/2]}),0===d&&this.svg.polyline(y,c).transform({translate:[f*h-h/2+n,p/2*6-p/2]}),0===f&&0===d&&this.svg.polyline(y,c).transform({translate:[6*h-h/2+n,p/2*6-p/2]}),u+=1},O.prototype.geoNestedSquares=function(){var e,t,n,u,s,c,l=o(r(this.hash,0),0,15,4,12),f=7*l;for(this.svg.setWidth(6*(f+l)+6*l),this.svg.setHeight(6*(f+l)+6*l),e=0,c=0;c<6;c++)for(s=0;s<6;s++)t=a(u=r(this.hash,e)),n={fill:"none",stroke:i(u),opacity:t,"stroke-width":l+"px"},this.svg.rect(s*f+s*l*2+l/2,c*f+c*l*2+l/2,f,f,n),t=a(u=r(this.hash,39-e)),n={fill:"none",stroke:i(u),opacity:t,"stroke-width":l+"px"},this.svg.rect(s*f+s*l*2+l/2+2*l,c*f+c*l*2+l/2+2*l,3*l,3*l,n),e+=1},O.prototype.geoMosaicSquares=function(){var e,t,n,i=o(r(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*i),this.svg.setHeight(8*i),e=0,n=0;n<4;n++)for(t=0;t<4;t++)t%2==0?n%2==0?l(this.svg,t*i*2,n*i*2,i,r(this.hash,e)):c(this.svg,t*i*2,n*i*2,i,[r(this.hash,e),r(this.hash,e+1)]):n%2==0?c(this.svg,t*i*2,n*i*2,i,[r(this.hash,e),r(this.hash,e+1)]):l(this.svg,t*i*2,n*i*2,i,r(this.hash,e)),e+=1},O.prototype.geoPlaid=function(){var e,t,n,o,u,s,c=0,l=0;for(t=0;t<36;)c+=r(this.hash,t)+5,n=a(s=r(this.hash,t+1)),e=i(s),o=s+5,this.svg.rect(0,c,"100%",o,{opacity:n,fill:e}),c+=o,t+=2;for(t=0;t<36;)l+=r(this.hash,t)+5,n=a(s=r(this.hash,t+1)),e=i(s),u=s+5,this.svg.rect(l,0,u,"100%",{opacity:n,fill:e}),l+=u,t+=2;this.svg.setWidth(l),this.svg.setHeight(c)},O.prototype.geoTessellation=function(){var e,t,n,u,s,c=o(r(this.hash,0),0,15,5,40),l=c*Math.sqrt(3),f=2*c,d=c/2*Math.sqrt(3),h=function(e,t){return[0,0,t,e/2,0,e,0,0].join(",")}(c,d),p=3*c+2*d,y=2*l+2*c;for(this.svg.setWidth(p),this.svg.setHeight(y),t=0;t<20;t++)switch(n=a(s=r(this.hash,t)),e=i(s),u={stroke:b,"stroke-opacity":w,fill:e,"fill-opacity":n,"stroke-width":1},t){case 0:this.svg.rect(-c/2,-c/2,c,c,u),this.svg.rect(p-c/2,-c/2,c,c,u),this.svg.rect(-c/2,y-c/2,c,c,u),this.svg.rect(p-c/2,y-c/2,c,c,u);break;case 1:this.svg.rect(f/2+d,l/2,c,c,u);break;case 2:this.svg.rect(-c/2,y/2-c/2,c,c,u),this.svg.rect(p-c/2,y/2-c/2,c,c,u);break;case 3:this.svg.rect(f/2+d,1.5*l+c,c,c,u);break;case 4:this.svg.polyline(h,u).transform({translate:[c/2,-c/2],rotate:[0,c/2,d/2]}),this.svg.polyline(h,u).transform({translate:[c/2,y- -c/2],rotate:[0,c/2,d/2],scale:[1,-1]});break;case 5:this.svg.polyline(h,u).transform({translate:[p-c/2,-c/2],rotate:[0,c/2,d/2],scale:[-1,1]}),this.svg.polyline(h,u).transform({translate:[p-c/2,y+c/2],rotate:[0,c/2,d/2],scale:[-1,-1]});break;case 6:this.svg.polyline(h,u).transform({translate:[p/2+c/2,l/2]});break;case 7:this.svg.polyline(h,u).transform({translate:[p-p/2-c/2,l/2],scale:[-1,1]});break;case 8:this.svg.polyline(h,u).transform({translate:[p/2+c/2,y-l/2],scale:[1,-1]});break;case 9:this.svg.polyline(h,u).transform({translate:[p-p/2-c/2,y-l/2],scale:[-1,-1]});break;case 10:this.svg.polyline(h,u).transform({translate:[c/2,y/2-c/2]});break;case 11:this.svg.polyline(h,u).transform({translate:[p-c/2,y/2-c/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,c,c,u).transform({translate:[c/2,c/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,c,c,u).transform({scale:[-1,1],translate:[c/2-p,c/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,c,c,u).transform({translate:[c/2,y/2-c/2-c],rotate:[30,0,c]});break;case 15:this.svg.rect(0,0,c,c,u).transform({scale:[-1,1],translate:[c/2-p,y/2-c/2-c],rotate:[30,0,c]});break;case 16:this.svg.rect(0,0,c,c,u).transform({scale:[1,-1],translate:[c/2,y/2-y-c/2-c],rotate:[30,0,c]});break;case 17:this.svg.rect(0,0,c,c,u).transform({scale:[-1,-1],translate:[c/2-p,y/2-y-c/2-c],rotate:[30,0,c]});break;case 18:this.svg.rect(0,0,c,c,u).transform({scale:[1,-1],translate:[c/2,c/2-y],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,c,c,u).transform({scale:[-1,-1],translate:[c/2-p,c/2-y],rotate:[-30,0,0]})}}},451:function(e){"use strict";var t=function(){var e=function(){for(var e=16;e<80;e++){var t=s[e-3]^s[e-8]^s[e-14]^s[e-16];s[e]=t<<1|t>>>31}var n,l,f=r,d=o,h=i,p=a,y=u;for(e=0;e<80;e++){e<20?(n=p^d&(h^p),l=1518500249):e<40?(n=d^h^p,l=1859775393):e<60?(n=d&h|p&(d|h),l=2400959708):(n=d^h^p,l=3395469782);var v=(f<<5|f>>>27)+n+y+l+(0|s[e]);y=p,p=h,h=d<<30|d>>>2,d=f,f=v}for(r=r+f|0,o=o+d|0,i=i+h|0,a=a+p|0,u=u+y|0,c=0,e=0;e<16;e++)s[e]=0},t=function(t){s[c]|=(255&t)<<l,l?l-=8:(c++,l=24),16===c&&e()},n=function(e){for(var t="",n=28;n>=0;n-=4)t+=(e>>n&15).toString(16);return t},r=1732584193,o=4023233417,i=2562383102,a=271733878,u=3285377520,s=new Uint32Array(80),c=0,l=24,f=0;return{update:function(e){if("string"==typeof e)return function(e){var n=e.length;f+=8*n;for(var r=0;r<n;r++)t(e.charCodeAt(r))}(e);var n=e.length;f+=8*n;for(var r=0;r<n;r++)t(e[r])},digest:function(){t(128),(c>14||14===c&&l<24)&&e(),c=14,l=24,t(0),t(0),t(f>0xffffffffff?f/1099511627776:0),t(f>4294967295?f/4294967296:0);for(var s=24;s>=0;s-=8)t(f>>s);return n(r)+n(o)+n(i)+n(a)+n(u)}}};e.exports=function(e){if(void 0===e)return t();var n=t();return n.update(e),n.digest()}},138:function(e,t,n){"use strict";var r=function(){return this.width=100,this.height=100,this.svg=i("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this},o=n(495),i=n(97);e.exports=r,r.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},r.prototype.end=function(){return this.context.pop(),this},r.prototype.currentNode=function(){var e=this.currentContext();return e.lastChild||e},r.prototype.transform=function(e){return this.currentNode().setAttribute("transform",Object.keys(e).map((function(t){return t+"("+e[t].join(",")+")"})).join(" ")),this},r.prototype.setAttributes=function(e,t){Object.keys(t).forEach((function(n){e.setAttribute(n,t[n])}))},r.prototype.setWidth=function(e){this.svg.setAttribute("width",Math.floor(e))},r.prototype.setHeight=function(e){this.svg.setAttribute("height",Math.floor(e))},r.prototype.toString=function(){return this.svg.toString()},r.prototype.rect=function(e,t,n,r,a){var u=this;if(Array.isArray(e))return e.forEach((function(e){u.rect.apply(u,e.concat(a))})),this;var s=i("rect");return this.currentContext().appendChild(s),this.setAttributes(s,o({x:e,y:t,width:n,height:r},a)),this},r.prototype.circle=function(e,t,n,r){var a=i("circle");return this.currentContext().appendChild(a),this.setAttributes(a,o({cx:e,cy:t,r:n},r)),this},r.prototype.path=function(e,t){var n=i("path");return this.currentContext().appendChild(n),this.setAttributes(n,o({d:e},t)),this},r.prototype.polyline=function(e,t){var n=this;if(Array.isArray(e))return e.forEach((function(e){n.polyline(e,t)})),this;var r=i("polyline");return this.currentContext().appendChild(r),this.setAttributes(r,o({points:e},t)),this},r.prototype.group=function(e){var t=i("g");return this.currentContext().appendChild(t),this.context.push(t),this.setAttributes(t,o({},e)),this}},97:function(e){"use strict";var t=e.exports=function(e){return(null!=(n=t)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](this):l(this,n))?(this.tagName=e,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new t(e);var n};t.prototype.appendChild=function(e){return this.children.push(e),this.lastChild=e,this},t.prototype.setAttribute=function(e,t){return this.attributes[e]=t,this},t.prototype.toString=function(){var e=this;return["<",e.tagName,Object.keys(e.attributes).map((function(t){return[" ",t,'="',e.attributes[t],'"'].join("")})).join(""),">",e.children.map((function(e){return e.toString()})).join(""),"</",e.tagName,">"].join("")}},495:function(e){var t=function(e){if(!e||"[object Object]"!==r.call(e)||e.nodeType||e.setInterval)return!1;var t,o=n.call(e,"constructor"),i=n.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!i)return!1;for(t in e);return void 0===t||n.call(e,t)},n=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function e(){var n,r,o,i,a,u,s=arguments[0]||{},c=1,l=arguments.length,f=!1;for("boolean"==typeof s&&(f=s,s=arguments[1]||{},c=2),"object"!=typeof s&&"function"!=typeof s&&(s={});c<l;c++)if(null!=(n=arguments[c]))for(r in n)o=s[r],s!==(i=n[r])&&(f&&i&&(t(i)||(a=Array.isArray(i)))?(a?(a=!1,u=o&&Array.isArray(o)?o:[]):u=o&&t(o)?o:{},s[r]=e(f,u,i)):void 0!==i&&(s[r]=i));return s}},279:function(e,t,n){"use strict";var r=n(493);r.createRoot,r.hydrateRoot},978:function(e,t,n){"use strict";var r=function(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}},o=n(954),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=o.useState,u=o.useEffect,s=o.useLayoutEffect,c=o.useDebugValue,l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),o=a({inst:{value:n,getSnapshot:t}}),i=o[0].inst,l=o[1];return s((function(){i.value=n,i.getSnapshot=t,r(i)&&l({inst:i})}),[e,n,t]),u((function(){return r(i)&&l({inst:i}),e((function(){r(i)&&l({inst:i})}))}),[e]),c(n),n};t.useSyncExternalStore=void 0!==o.useSyncExternalStore?o.useSyncExternalStore:l},921:function(e,t,n){"use strict";e.exports=n(978)},641:function(e,t,n){var r=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},o=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},i=function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):l(e,t)},a=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":y(e)};System.register(["@openmrs/esm-config","@openmrs/esm-navigation","@openmrs/esm-error-handling","@openmrs/esm-offline"],(function(e,t){var u={},s={},c={},l={};return{setters:[function(e){u.Type=e.Type,u.defineConfigSchema=e.defineConfigSchema,u.getConfig=e.getConfig,u.validators=e.validators},function(e){s.navigate=e.navigate},function(e){c.reportError=e.reportError},function(e){l.getSynchronizationItems=e.getSynchronizationItems}],execute:function(){e(function(){var e={385:function(){System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e,t){var n=s[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;var r=u()((function(){return t}));return s[e]={value:r,active:!0},r},t=function(e,t){var n=s[e];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=t,n.active=!0,n.value):(s[e]={value:t,active:!0},t)},n=function(e,t){var n=s[e];if(!n){var r=u()((function(){return null!=t?t:{}}));return s[e]={value:r,active:!1},r}return n.value},r=function(e,t,n){var r=t(e.getState());return e.subscribe((function(e){var o=t(e);o!==r&&(r=o,n(o))}))},o={d:function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return e},getGlobalStore:function(){return n},registerGlobalStore:function(){return t},subscribeTo:function(){return r}});var a=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,subscribe:function(e){return n.add(e),function(){return n.delete(e)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,i),i},u=function(e){return e?a(e):a},s={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=s)}),1e3),i}())}}}))},824:function(e){"use strict";e.exports=u},254:function(e){"use strict";e.exports=c},513:function(e){"use strict";e.exports=s},738:function(e){"use strict";e.exports=l}},t={};function f(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,f),o.exports}f.d=function(e,t){for(var n in t)f.o(t,n)&&!f.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},f.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return function(){"use strict";var e=function(e,t){function n(){this.constructor=e}st(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},t=function(e){return"function"==typeof e},u=function(e){setTimeout((function(){throw e}),0)},s=function(e){return null!==e&&"object"==typeof e},c=function(e){return e.reduce((function(e,t){return e.concat(i(t,pt)?t.errors:t)}),[])},l=function(e){return e},h=function(e){if(e||(e=lt.Promise||Promise),!e)throw new Error("no Promise impl found");return e},p=function(e,t,n){var r=g(e,t,n);Gt.length?Gt.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))},y=function(e){if("function"!=typeof e)throw Error(m(28,!1));Gt.push(e)},v=function(e){if("function"!=typeof e)throw Error(m(29,!1));var t=!1;return Gt=Gt.filter((function(n){var r=n===e;return t=t||r,!r})),t},m=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},g=function(e,t,n){var r,o="".concat(O(t)," '").concat(_(t),"' died in status ").concat(t.status,": ");if(i(e,Error)){try{e.message=o+e.message}catch(e){}r=e}else{console.warn(m(30,!1,t.status,_(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=_(t),t.status=n,r},b=function(e){return e.status===Qt},w=function(e){try{return e.activeWhen(window.location)}catch(t){return p(t,e,nn),!1}},_=function(e){return e.name},S=function(e){return Boolean(e.unmountThisParcel)},O=function(e){return S(e)?"parcel":"application"},E=function(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]},x=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null},k=function(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!x(t,(function(e){return"function"!=typeof e}))));var t},P=function(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=O(e),o=_(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return j(n)?n:Promise.reject(m(15,!1,r,o,t,a))}))}),Promise.resolve())}},j=function(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch},A=function(e,t){return Promise.resolve().then((function(){return e.status!==Wt?e:(e.status=$t,e.bootstrap?U(e,"bootstrap").then(n).catch((function(n){if(t)throw g(n,e,nn);return p(n,e,nn),e})):Promise.resolve().then(n))}));function n(){return e.status=Yt,e}},T=function(e,t){return Promise.resolve().then((function(){if(e.status!==Qt)return e;e.status=Xt;var n=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(n).then(r,(function(n){return r().then((function(){var r=Error(n.message);if(t)throw g(r,e,nn);p(r,e,nn)}))})).then((function(){return e}));function r(){return U(e,"unmount").then((function(){e.status=Yt}),(function(n){if(t)throw g(n,e,nn);p(n,e,nn)}))}}))},D=function(e,t){return Promise.resolve().then((function(){return e.status!==Yt?e:(on||(window.dispatchEvent(new Vt("single-spa:before-first-mount")),on=!0),e.status=Jt,U(e,"mount").then((function(){return e.status=Qt,an||(window.dispatchEvent(new Vt("single-spa:first-mount")),an=!0),e})).catch((function(n){return e.status=Qt,T(e,!0).then(r,r);function r(){if(t)throw g(n,e,nn);return p(n,e,nn),e}})))}))},C=function(){return I.apply(sn,arguments)},I=function(e,t){var n=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(m(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(m(3,!1,a(e.name)));var r=un++,o=e.name||"parcel-".concat(r);if("object"!=typeof t)throw Error(m(4,!1,o,void 0===t?"undefined":a(t)));if(!t.domElement)throw Error(m(5,!1,o));var i,u="function"==typeof e,s=u?e:function(){return Promise.resolve(e)},c={id:r,parcels:{},status:u?qt:Wt,customProps:t,parentName:_(n),unmountThisParcel:function(){return p.then((function(){if(c.status!==Qt)throw Error(m(6,!1,o,c.status));return T(c,!0)})).then((function(e){return c.parentName&&delete n.parcels[c.id],e})).then((function(e){return f(e),e})).catch((function(e){throw c.status=nn,d(e),e}))}};n.parcels[r]=c;var l=s();if(!l||"function"!=typeof l.then)throw Error(m(7,!1));l=l.then((function(e){if(!e)throw Error(m(8,!1));if(o=e.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!k(e.bootstrap))throw Error(m(9,!1,o));if(!k(e.mount))throw Error(m(10,!1,o));if(!k(e.unmount))throw Error(m(11,!1,o));if(e.update&&!k(e.update))throw Error(m(12,!1,o));var t=P(e,"bootstrap"),n=P(e,"mount"),a=P(e,"unmount");c.status=Wt,c.name=o,c.bootstrap=t,c.mount=n,c.unmount=a,c.timeouts=K(e.timeouts),e.update&&(c.update=P(e,"update"),i.update=function(e){return c.customProps=e,M((t=c,Promise.resolve().then((function(){if(t.status!==Qt)throw Error(m(32,!1,_(t)));return t.status=Zt,U(t,"update").then((function(){return t.status=Qt,t})).catch((function(e){throw g(e,t,nn)}))}))));var t})}));var f,d,h=l.then((function(){return A(c,!0)})),p=h.then((function(){return D(c,!0)})),y=new Promise((function(e,t){f=e,d=t}));return i={mount:function(){return M(Promise.resolve().then((function(){if(c.status!==Yt)throw Error(m(13,!1,o,c.status));return n.parcels[r]=c,D(c)})))},unmount:function(){return M(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:M(l),bootstrapPromise:M(h),mountPromise:M(p),unmountPromise:M(y)}},M=function(e){return e.then((function(){return null}))},R=function(e){var t=_(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(m(40,!1),t,n));var r=E({},n,{name:t,mountParcel:I.bind(e),singleSpa:Kt});return S(e)&&(r.unmountSelf=e.unmountThisParcel),r},N=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(16,!1));cn.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},L=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(17,!1));cn.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},F=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(18,!1));cn.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},B=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(m(19,!1));cn.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},U=function(e,t){var n=e.timeouts[t],r=n.warningMillis,o=O(e);return new Promise((function(i,a){var u=!1,s=!1;e[t](R(e)).then((function(e){u=!0,i(e)})).catch((function(e){u=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=m(31,!1,t,o,_(e),n.millis);function l(e){if(!u)if(!0===e)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))},K=function(e){var t={};for(var n in cn)t[n]=E({},cn[n],e&&e[n]||{});return t},z=function(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==Ht&&e.status!==tn?e:(e.status=qt,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(R(e));if(!j(r))throw n=!0,Error(m(33,!1,_(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!=typeof(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!k(t.bootstrap)&&(r=35),k(t.mount)||(r=36),k(t.unmount)||(r=37);var o=O(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error(m(r,!1,o,_(e),i),t),p(void 0,e,nn),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=E({},e.devtools.overlays,t.devtools.overlays)),e.status=Wt,e.bootstrap=P(t,"bootstrap"),e.mount=P(t,"mount"),e.unmount=P(t,"unmount"),e.unload=P(t,"unload"),e.timeouts=K(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=nn:(r=tn,e.loadErrorTime=(new Date).getTime()),p(t,e,r),e})));var t,n}))},V=function(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(m(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=$(window.location.href),r=$(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)},G=function(e){var t=this;if(e){var n=e[0].type;dn.indexOf(n)>=0&&fn[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}},H=function(){Sn([],arguments)},q=function(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return Ut&&n===o||window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}},W=function(e){if(pn)throw Error(m(43,!1));Ut=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,pn=!0,hn=window.history.replaceState,window.addEventListener("hashchange",H),window.addEventListener("popstate",H);var t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&dn.indexOf(e)>=0)||x(fn[e],(function(e){return e===n})))return t.apply(this,arguments);fn[e].push(n)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&dn.indexOf(e)>=0))return n.apply(this,arguments);fn[e]=fn[e].filter((function(e){return e!==t}))},window.history.pushState=q(window.history.pushState,"pushState"),window.history.replaceState=q(hn,"replaceState")},$=function(e){var t=document.createElement("a");return t.href=e,t},Y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!yn){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return J.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return J.call(this,n,window.removeEventListener,e,t,arguments)},yn=!0}},J=function(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){dn.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))},Q=function(e){return Promise.resolve().then((function(){var t=vn[_(e)];if(!t)return e;if(e.status===Ht)return Z(e,t),e;if(e.status===en)return t.promise.then((function(){return e}));if(e.status!==Yt&&e.status!==tn)return e;var n=e.status===tn?Promise.resolve():U(e,"unload");return e.status=en,n.then((function(){return Z(e,t),e})).catch((function(n){return function(e,t,n){delete vn[_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,p(n,e,nn),t.reject(n)}(e,t,n),e}))}))},Z=function(e,t){delete vn[_(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=Ht,t.resolve()},X=function(e,t,n,r){vn[_(e)]={app:e,resolve:n,reject:r},Object.defineProperty(vn[_(e)],"promise",{get:t})},ee=function(e){return vn[e]},te=function(){return mn.filter(b).map(_)},ne=function(){return mn.map(_)},re=function(e){var t=x(mn,(function(t){return _(t)===e}));return t?t.status:null},oe=function(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(m(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error(m(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error(m(20,!1));if("object"!=typeof e.app&&"function"!=typeof e.app)throw Error(m(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(m(24,!1));if(!ce(e.customProps))throw Error(m(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(m(20,!1));if(!t)throw Error(m(23,!1));if("function"!=typeof n)throw Error(m(24,!1));if(!ce(r))throw Error(m(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:le(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(pe()||gn||(gn=!0,setTimeout((function(){pe()||console.warn(m(1,!1))}),5e3)),-1!==ne().indexOf(o.name))throw Error(m(21,!1,o.name));mn.push(E({loadErrorTime:null,status:Ht,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),ln&&(Y(),Sn())},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return mn.filter((function(t){return t.activeWhen(e)})).map(_)},ae=function(e){if(0===mn.filter((function(t){return _(t)===e})).length)throw Error(m(25,!1,e));return(ln?ue(e,{waitForUnmount:!1}):Promise.resolve()).then((function(){var t=mn.map(_).indexOf(e);mn.splice(t,1)}))},ue=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error(m(26,!1));var n=x(mn,(function(t){return _(t)===e}));if(!n)throw Error(m(27,!1,e));var r,o=ee(_(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){X(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,se(n,o.resolve,o.reject)):r=new Promise((function(e,t){X(n,(function(){return r}),e,t),se(n,e,t)})),r},se=function(e,t,n){Promise.resolve().then((function(){if(x(ie(),(function(t){return t===_(e)})))return fe()})).then((function(){return T(e).then(Q).then((function(){t(),setTimeout((function(){Sn()}))}))})).catch(n)},ce=function(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},le=function(e,t){var n=function(e,t){var n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(var i=0;i<e.length;i++){var a=e[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(e.length),new RegExp(o,"i");function u(i){var a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{var u=t?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}},fe=function(){return Sn()},de=function(e,t){return w(e)?A(e).then((function(e){return t.then((function(){return w(e)?D(e):e}))})):t.then((function(){return e}))},he=function(e){On=!0,ln&&(W(e),Sn())},pe=function(){return On},ye=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},ve=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},me=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},ge=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}},be=function(e){return e&&e.startsWith("http")?e:("/"!==e[0]&&(e="/"+e),window.openmrsBase+e)},we=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("string"!=typeof e)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof t)throw Error("The second argument to @openmrs/api's openmrsFetch function must be a plain object.");if(!window.openmrsBase)throw Error("@openmrs/api is running in a browser that doesn't have window.openmrsBase, which is provided by openmrs-module-spa's HTML file.");var n=be(e);if(t.headers||(t.headers={}),Nt(t.body)&&(t.body=JSON.stringify(t.body)),void 0===t.headers.Accept&&(t.headers.Accept="application/json"),null===t.headers.Accept&&delete t.headers.Accept,e.startsWith(Tn)&&void 0===t.headers["Disable-WWW-Authenticate"]&&(t.headers["Disable-WWW-Authenticate"]="true"),e.startsWith(Dn)){var r=new URL(n,window.location.toString());r.searchParams.has("_summary")||(r.searchParams.set("_summary","data"),n=r.toString())}var o,i,a=Error();return window.fetch(n,t).then((o=function(e){var t,r;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(o){switch(o.label){case 0:return(t=e).ok?204===t.status?(t.data=null,[2,t]):[2,t.clone().text().then((function(e){try{e&&(t.data=JSON.parse(e))}catch(e){}return t}))]:[3,1];case 1:return[4,(0,Lt.getConfig)("@openmrs/esm-api")];case 2:return r=o.sent().redirectAuthFailure,n===be(Cn)&&403===t.status||r.enabled&&r.errors.includes(t.status)?(sessionStorage.removeItem(xn),(0,Ft.navigate)({to:r.url}),[2,r.resolvePromise?Promise.resolve():new Promise((function(){}))]):[2,t.clone().text().then((function(e){var r=e;try{r=JSON.parse(e)}catch(e){}throw new In(n,t,r,a)}),(function(e){throw new In(n,t,null,a)}))];case 3:return[2]}}))},i=function(){var e=this,t=arguments;return new Promise((function(n,r){var i=o.apply(e,t);function a(e){ve(i,n,r,a,u,"next",e)}function u(e){ve(i,n,r,a,u,"throw",e)}a(void 0)}))},function(e){return i.apply(this,arguments)}))},_e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof t)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");var n=new AbortController;return t.signal=n.signal,new wt((function(r){var o=!1;return we(e,t).then((function(e){o=!0,r.next(e),r.complete()}),(function(e){o=!0,r.error(e)})),function(){o||n.abort()}}))},Se=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},Oe=function(e,t){return we("".concat(Mn,"/").concat(e),{signal:t.signal})},Ee=function(e,t,n){return we("".concat(Mn,"?patient=").concat(e,"&includeEncounterless=").concat(t),{signal:n.signal})},xe=function(e,t){return Rn.apply(this,arguments)},ke=function(e,t){return we("".concat(Mn,"/").concat(e),{method:"DELETE",signal:t.signal})},Pe=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},je=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Pe(i,r,o,a,u,"next",e)}function u(e){Pe(i,r,o,a,u,"throw",e)}a(void 0)}))}},Ae=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Te=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{includeAuthStatus:!0};return(Bn<Date.now()-6e4||!Fn.getState().loaded)&&Ie(),new wt((function(t){var n=function(n){var r;n.loaded&&(e.includeAuthStatus?t.next(n.session):t.next(null===(r=n.session)||void 0===r?void 0:r.user))};return n(Fn.getState()),Fn.subscribe(n)}))},De=function(){return(Bn<Date.now()-6e4||!Fn.getState().loaded)&&Ie(),Fn},Ce=function(e){var t,n,r,o=null!==(r=null==e||null===(t=e.user)||void 0===t||null===(n=t.userProperties)||void 0===n?void 0:n.defaultLocale)&&void 0!==r?r:e.locale,i=document.documentElement.getAttribute("lang");(function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0})(o)&&o!==i&&document.documentElement.setAttribute("lang",o)},Ie=function(e,t){Bn=Date.now();var n={};return e&&t&&(n.Authorization="Basic ".concat(window.btoa("".concat(e,":").concat(t)))),Ue(we(Cn,{headers:n}))},Me=function(){Fn.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})},Re=function(e,t){return void 0===t?Boolean(e):!Boolean(e)||function(e,t){return"string"==typeof e?!Ln(t.privileges.find((function(t){return e===t.display}))):Array.isArray(e)?e.every((function(e){return!Ln(t.privileges.find((function(t){return e===t.display})))})):(Ln(e)||console.error('Could not understand privileges "'.concat(e,'"')),!0)}(e,t)||function(e){return!Ln(e.roles.find((function(e){return"System Developer"===e.display})))}(t)},Ne=function(){var e,t;return new Promise((function(n){var r=function(r){r.loaded&&r.session.user&&(e=r.session.user,n(r.session.user),t&&t())};r(Fn.getState()),e||(t=Fn.subscribe(r))}))},Le=function(){return new Promise((function(e,t){Te().subscribe((function(t){e(t.sessionLocation)}),t).unsubscribe()}))},Fe=function(e,t){return Un.apply(this,arguments)},Be=function(e,t,n){return Kn.apply(this,arguments)},Ue=function(e){return new Promise((function(t,n){e.then((function(e){var r;"object"==typeof(null==e?void 0:e.data)?(r={loaded:!0,session:e.data},Fn.setState(r),t(r)):(r={loaded:!1,session:null},Fn.setState(r),n(r))})).catch((function(e){(0,Nn.reportError)("Failed to fetch new session information: ".concat(e));var t={loaded:!1,session:null};Fn.setState(t),n(t)}))}))},Ke=function(){(0,Lt.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:Lt.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:Lt.Type.String,_default:"${openmrsSpaBase}/login",_validators:[Lt.validators.isUrl]},errors:{_type:Lt.Type.Array,_default:[401],_elements:{_type:Lt.Type.Number,_validators:[Lt.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:Lt.Type.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),Ie()},ze=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ve=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},Ge=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ve(i,r,o,a,u,"next",e)}function u(e){Ve(i,r,o,a,u,"throw",e)}a(void 0)}))}},He=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ze(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ze(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},qe=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},We=function(e,t){return Vn.apply(this,arguments)},$e=function(e){return Gn.apply(this,arguments)},Ye=function(e){return function(t){return 0===e?Zn:t.lift(new Xn(e))}},Je=function(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new tr(e,t))}},Qe=function(){return(0,Bt.getGlobalStore)("visit",or)},Ze=function(e,t){Qe().setState({patientUuid:e,manuallySetVisitUuid:t})},Xe=function(e,t,n){var r=null!=n?n:rr;return _e("".concat(Tn,"/visit?patient=").concat(e,"&v=").concat(r),{signal:t.signal,method:"GET",headers:{"Content-type":"application/json"}}).pipe(Ye(1)).pipe(Je((function(e){return e})))},et=function(e,t){return _e("".concat(Tn,"/visit"),{signal:t.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})},tt=function(e,t,n){return _e("".concat(Tn,"/visit/").concat(e),{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})},nt=function(e){return{uuid:e.uuid,display:e.display,name:e.name}},rt=function(){return _e("".concat(Tn,"/visittype")).pipe(Je((function(e){return e.data.results.map(nt)}))).pipe(Ye(1))},ot=function(e){return{uuid:e.uuid,display:e.display}},it=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return _e("".concat(Tn,"/location")+(e?"?tag="+e:"")).pipe(Je((function(e){return e.data.results.map(ot)}))).pipe(Ye(1))};f.r(d),f.d(d,{OpenmrsFetchError:function(){return In},VisitMode:function(){return ir},VisitStatus:function(){return ar},attachmentUrl:function(){return Mn},backendDependencies:function(){return sr},clearCurrentUser:function(){return Me},createAttachment:function(){return xe},defaultVisitCustomRepresentation:function(){return rr},deleteAttachmentPermanently:function(){return ke},fetchCurrentPatient:function(){return We},fhirBaseUrl:function(){return Dn},getAttachmentByUuid:function(){return Oe},getAttachments:function(){return Ee},getCurrentUser:function(){return Te},getLocations:function(){return it},getLoggedInUser:function(){return Ne},getSessionLocation:function(){return Le},getSessionStore:function(){return De},getStartedVisit:function(){return ur},getVisitStore:function(){return Qe},getVisitTypes:function(){return rt},getVisitsForPatient:function(){return Xe},makeUrl:function(){return be},openmrsFetch:function(){return we},openmrsObservableFetch:function(){return _e},refetchCurrentUser:function(){return Ie},restBaseUrl:function(){return Tn},saveVisit:function(){return et},sessionEndpoint:function(){return Cn},setCurrentVisit:function(){return Ze},setSessionLocation:function(){return Fe},setUserLanguage:function(){return Ce},setUserProperties:function(){return Be},setupApiModule:function(){return Ke},toLocationObject:function(){return ot},toVisitTypeObject:function(){return nt},updateVisit:function(){return tt},userHasAccess:function(){return Re}});var at,ut,st=function(e,t){return st=Object.setPrototypeOf||i({__proto__:[]},Array)&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},st(e,t)},ct=!1,lt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e&&(new Error).stack,ct=e},get useDeprecatedSynchronousErrorHandling(){return ct}},ft={closed:!0,next:function(e){},error:function(e){if(lt.useDeprecatedSynchronousErrorHandling)throw e;u(e)},complete:function(){}},dt=Array.isArray||function(e){return e&&"number"==typeof e.length},ht=function(){var e=function(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this};return e.prototype=Object.create(Error.prototype),e}(),pt=ht,yt=function(){var e=function(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)};return e.prototype.unsubscribe=function(){var n;if(!this.closed){var r=this,o=r._parentOrParents,a=r._ctorUnsubscribe,u=r._unsubscribe,l=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,i(o,e))o.remove(this);else if(null!==o)for(var f=0;f<o.length;++f)o[f].remove(this);if(t(u)){a&&(this._unsubscribe=void 0);try{u.call(this)}catch(e){n=i(e,pt)?c(e.errors):[e]}}if(dt(l)){f=-1;for(var d=l.length;++f<d;){var h=l[f];if(s(h))try{h.unsubscribe()}catch(e){n=n||[],i(e,pt)?n=n.concat(c(e.errors)):n.push(e)}}}if(n)throw new pt(n)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(void 0===t?"undefined":a(t)){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!i(n,e)){var r=n;(n=new e)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(i(o,e)){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var u=this._subscriptions;return null===u?this._subscriptions=[n]:u.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;if(t){var n=t.indexOf(e);-1!==n&&t.splice(n,1)}},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}(),vt="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),mt=function(t){function n(e,r,o){var a=t.call(this)||this;switch(a.syncErrorValue=null,a.syncErrorThrown=!1,a.syncErrorThrowable=!1,a.isStopped=!1,arguments.length){case 0:a.destination=ft;break;case 1:if(!e){a.destination=ft;break}if("object"==typeof e){i(e,n)?(a.syncErrorThrowable=e.syncErrorThrowable,a.destination=e,e.add(a)):(a.syncErrorThrowable=!0,a.destination=new gt(a,e));break}default:a.syncErrorThrowable=!0,a.destination=new gt(a,e,r,o)}return a}return e(n,t),n.prototype[vt]=function(){return this},n.create=function(e,t,r){var o=new n(e,t,r);return o.syncErrorThrowable=!1,o},n.prototype.next=function(e){this.isStopped||this._next(e)},n.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},n.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},n.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},n.prototype._next=function(e){this.destination.next(e)},n.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},n.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},n.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},n}(yt),gt=function(n){var r=function(e,r,o,i){var a,u=n.call(this)||this;u._parentSubscriber=e;var s=u;return t(r)?a=r:r&&(a=r.next,o=r.error,i=r.complete,r!==ft&&(t((s=Object.create(r)).unsubscribe)&&u.add(s.unsubscribe.bind(s)),s.unsubscribe=u.unsubscribe.bind(u))),u._context=s,u._next=a,u._error=o,u._complete=i,u};return e(r,n),r.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;lt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},r.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=lt.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?(this.__tryOrSetError(t,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):u(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;u(e)}}},r.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};lt.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?(this.__tryOrSetError(t,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),lt.useDeprecatedSynchronousErrorHandling)throw e;u(e)}},r.prototype.__tryOrSetError=function(e,t,n){if(!lt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,n)}catch(t){return lt.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0,!0):(u(t),!0)}return!1},r.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},r}(mt),bt="function"==typeof Symbol&&Symbol.observable||"@@observable",wt=function(){var e=function(e){this._isScalar=!1,e&&(this._subscribe=e)};return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator,o=function(e,t,n){if(e){if(i(e,mt))return e;if(e[vt])return e[vt]()}return e||t||n?new mt(e,t,n):new mt(ft)}(e,t,n);if(r?o.add(r.call(o,this.source)):o.add(this.source||lt.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),lt.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){lt.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(e){for(;e;){var t=e,n=t.closed,r=t.destination,o=t.isStopped;if(n||o)return!1;e=r&&i(r,mt)?r:null}return!0}(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=h(t))((function(t,r){var o;o=n.subscribe((function(t){try{e(t)}catch(e){r(e),o&&o.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[bt]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:(0===(n=e).length?l:1===n.length?n[0]:function(e){return n.reduce((function(e,t){return t(e)}),e)})(this);var n},e.prototype.toPromise=function(e){var t=this;return new(e=h(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}(),_t="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,St="object"==typeof self&&self&&self.Object===Object&&self,Ot=(_t||St||Function("return this")()).Symbol,Et=Object.prototype,xt=Et.hasOwnProperty,kt=Et.toString,Pt=Ot?Ot.toStringTag:void 0,jt=Object.prototype.toString,At=Ot?Ot.toStringTag:void 0,Tt=(at=Object.getPrototypeOf,ut=Object,function(e){return at(ut(e))}),Dt=Function.prototype,Ct=Object.prototype,It=Dt.toString,Mt=Ct.hasOwnProperty,Rt=It.call(Object),Nt=function(e){if(!function(e){return null!=e&&"object"==typeof e}(e)||"[object Object]"!=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":At&&At in Object(e)?function(e){var t=xt.call(e,Pt),n=e[Pt];try{e[Pt]=void 0;var r=!0}catch(e){}var o=kt.call(e);return r&&(t?e[Pt]=n:delete e[Pt]),o}(e):function(e){return jt.call(e)}(e)}(e))return!1;var t=Tt(e);if(null===t)return!0;var n=Mt.call(t,"constructor")&&t.constructor;return"function"==typeof n&&i(n,n)&&It.call(n)==Rt},Lt=f(824),Ft=f(513),Bt=f(385);(0,Bt.createGlobalStore)("breadcrumbs",[]);var Ut,Kt=Object.freeze({__proto__:null,get start(){return he},get ensureJQuerySupport(){return Y},get setBootstrapMaxTime(){return N},get setMountMaxTime(){return L},get setUnmountMaxTime(){return F},get setUnloadMaxTime(){return B},get registerApplication(){return oe},get unregisterApplication(){return ae},get getMountedApps(){return te},get getAppStatus(){return re},get unloadApplication(){return ue},get checkActivityFunctions(){return ie},get getAppNames(){return ne},get pathToActiveWhen(){return le},get navigateToUrl(){return V},get patchHistoryApi(){return W},get triggerAppChange(){return fe},get addErrorHandler(){return y},get removeErrorHandler(){return v},get mountRootParcel(){return C},get NOT_LOADED(){return Ht},get LOADING_SOURCE_CODE(){return qt},get NOT_BOOTSTRAPPED(){return Wt},get BOOTSTRAPPING(){return $t},get NOT_MOUNTED(){return Yt},get MOUNTING(){return Jt},get UPDATING(){return Zt},get LOAD_ERROR(){return tn},get MOUNTED(){return Qt},get UNLOADING(){return en},get UNMOUNTING(){return Xt},get SKIP_BECAUSE_BROKEN(){return nn}}),zt=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,Vt=function(){try{var e=new zt("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?zt:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},Gt=[],Ht="NOT_LOADED",qt="LOADING_SOURCE_CODE",Wt="NOT_BOOTSTRAPPED",$t="BOOTSTRAPPING",Yt="NOT_MOUNTED",Jt="MOUNTING",Qt="MOUNTED",Zt="UPDATING",Xt="UNMOUNTING",en="UNLOADING",tn="LOAD_ERROR",nn="SKIP_BECAUSE_BROKEN",rn=[],on=!1,an=!1,un=0,sn={parcels:{}},cn={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},ln="undefined"!=typeof window,fn={hashchange:[],popstate:[]},dn=["hashchange","popstate"],hn=null,pn=!1;ln&&(window.singleSpaNavigate?console.warn(m(41,!1)):window.singleSpaNavigate=V);var yn=!1,vn={},mn=[],gn=!1,bn=!1,wn=[],_n=ln&&window.location.href;function Sn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(bn)return new Promise((function(e,n){wn.push({resolve:e,reject:n,eventArguments:t})}));var r,i=function(){var e=[],t=[],n=[],r=[],o=(new Date).getTime();return mn.forEach((function(i){var a=i.status!==nn&&w(i);switch(i.status){case tn:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Ht:case qt:a&&n.push(i);break;case Wt:case Yt:!a&&ee(_(i))?e.push(i):a&&r.push(i);break;case Qt:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}(),a=i.appsToUnload,u=i.appsToUnmount,s=i.appsToLoad,c=i.appsToMount,l=[],f=_n,d=_n=window.location.href;return pe()?(bn=!0,r=a.concat(s,u,c),Promise.resolve().then((function(){return g(0===r.length?"before-no-app-change":"before-app-change",v(!0)),g("before-routing-event",v(!0,{cancelNavigation:h})),Promise.all(l).then((function(n){if(n.some((function(e){return e})))return hn.call(window.history,history.state,"",f.substring(location.origin.length)),_n=location.href,bn=!1,Sn(e,t,!0);var r=a.map(Q),o=u.map(T).map((function(e){return e.then(Q)})).concat(r),i=Promise.all(o);i.then((function(){g("before-mount-routing-event",v(!0))}),(function(e){throw e}));var l=s.map((function(e){return z(e).then((function(e){return de(e,i)}))})),d=c.filter((function(e){return s.indexOf(e)<0})).map((function(e){return de(e,i)}));return i.catch((function(e){throw y(),e})).then((function(){return y(),Promise.all(l.concat(d)).catch((function(t){throw e.forEach((function(e){return e.reject(t)})),t})).then(p).then((function(){}),(function(e){throw e}))}))}))}))):(r=s,Promise.resolve().then((function(){var e=s.map(z);return Promise.all(e).then(y).then((function(){return[]})).catch((function(e){throw y(),e})).finally((function(){}))})));function h(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);l.push(t.catch((function(e){return console.warn(Error(m(42,!1))),console.warn(e),!1})))}function p(){var t=te();e.forEach((function(e){return e.resolve(t)}));try{g(0===r.length?"no-app-change":"app-change",v()),g("routing-event",v())}catch(e){setTimeout((function(){throw e}))}if(bn=!1,wn.length>0){var n=wn;wn=[],Sn(n)}return t}function y(){n||(e.forEach((function(e){G(e.eventArguments)})),G(t))}function v(){var e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,l={},h=(o(e={},Qt,[]),o(e,Yt,[]),o(e,Ht,[]),o(e,nn,[]),e);n?(s.concat(c).forEach((function(e,t){y(e,Qt)})),a.forEach((function(e){y(e,Ht)})),u.forEach((function(e){y(e,Yt)}))):r.forEach((function(e){y(e)}));var p={detail:{newAppStatuses:l,appsByNewStatus:h,totalAppChanges:r.length,originalEvent:null==t?void 0:t[0],oldUrl:f,newUrl:d}};return i&&E(p.detail,i),p;function y(e,t){var n=_(e);t=t||re(n),l[n]=t,(h[t]=h[t]||[]).push(n)}}function g(e,t){n||window.dispatchEvent(new Vt("single-spa:".concat(e),t))}}var On=!1,En={getRawAppData:function(){return function(e){if(Array.isArray(e))return r(e)}(e=mn)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var e},reroute:Sn,NOT_LOADED:Ht,toLoadPromise:z,toBootstrapPromise:A,unregisterApplication:ae,getProfilerData:function(){return rn}};ln&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=En);var xn="openmrs:history";function kn(e,t,n){return kn=ge()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&jn(o,n.prototype),o},kn.apply(null,arguments)}function Pn(e){return Pn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Pn(e)}function jn(e,t){return jn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jn(e,t)}function An(e){var t="function"==typeof Map?new Map:void 0;return An=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return kn(e,arguments,Pn(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),jn(r,e)},An(e)}var Tn="/ws/rest/v1",Dn="/ws/fhir2/R4",Cn="".concat(Tn,"/session"),In=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&jn(e,t)}(o,e);var t,n,r=(t=o,n=ge(),function(){var e,r=Pn(t);if(n){var o=Pn(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":a(n))&&"function"!=typeof t?ye(e):t;var n}(this,e)});function o(e,t,n,a){var u;return function(e,t){if(!i(e,t))throw new TypeError("Cannot call a class as a function")}(this,o),me(ye(u=r.call(this)),"response",void 0),me(ye(u),"responseBody",void 0),u.message="Server responded with ".concat(t.status," (").concat(t.statusText,") for url ").concat(e,". Check err.responseBody or network tab in dev tools for more info"),a.message=u.message,u.responseBody=n,u.response=t,u.stack="Stacktrace for outgoing request:\n".concat(a.stack,"\nStacktrace for incoming response:\n").concat(u.stack),u}return o}(An(Error)),Mn="".concat(Tn,"/attachment");function Rn(){var e;return e=function(e,t){var n;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){return(n=new FormData).append("fileCaption",t.fileDescription),n.append("patient",e),t.file?n.append("file",t.file):(n.append("file",new File([""],t.fileName),t.fileName),n.append("base64Content",t.base64Content)),[2,we("".concat(Mn),{method:"POST",body:n})]}))},Rn=function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Se(i,r,o,a,u,"next",e)}function u(e){Se(i,r,o,a,u,"throw",e)}a(void 0)}))},Rn.apply(this,arguments)}var Nn=f(254),Ln=function(e){return void 0===e},Fn=(0,Bt.createGlobalStore)("session",{loaded:!1,session:null}),Bn=0;function Un(){return(Un=je((function(e,t){return Ae(this,(function(n){return[2,Ue(we(Cn,{method:"POST",body:{sessionLocation:e},headers:{"Content-Type":"application/json"},signal:t.signal}))]}))}))).apply(this,arguments)}function Kn(){return(Kn=je((function(e,t,n){return Ae(this,(function(r){switch(r.label){case 0:return n||(n=new AbortController),[4,we("".concat(Tn,"/user/").concat(e),{method:"POST",body:{userProperties:t},headers:{"Content-Type":"application/json"},signal:n.signal})];case 1:return r.sent(),[2,Ie()]}}))}))).apply(this,arguments)}Fn.subscribe((function(e){return e.session&&Ce(e.session)}));var zn=f(738);function Vn(){return Vn=Ge((function(e,t){var n,r,o,i,a,u=arguments;return qe(this,(function(s){switch(s.label){case 0:return n=!(u.length>2&&void 0!==u[2])||u[2],e?(r=null,[4,Promise.all([we("".concat(Dn,"/Patient/").concat(e),t).catch((function(e){return r=e})),n?$e(e):Promise.resolve(null)])]):[3,2];case 1:if(o=He.apply(void 0,[s.sent(),2]),i=o[0],a=o[1],i.ok)return[2,i.data];if(a)return[2,a];if(r)throw r;s.label=2;case 2:return[2,null]}}))})),Vn.apply(this,arguments)}function Gn(){return(Gn=Ge((function(e){var t,n,r;return qe(this,(function(o){switch(o.label){case 0:return[4,(0,zn.getSynchronizationItems)("patient-registration")];case 1:return t=o.sent(),n=t.find((function(t){return t.fhirPatient.id===e})),[2,null!==(r=null==n?void 0:n.fhirPatient)&&void 0!==r?r:null]}}))}))).apply(this,arguments)}var Hn=function(){var e=function(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this};return e.prototype=Object.create(Error.prototype),e}(),qn=function(t){var n=function(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r};return e(n,t),n.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;if(this.subject=null,t&&0!==t.length&&!e.isStopped&&!e.closed){var n=t.indexOf(this.subscriber);-1!==n&&t.splice(n,1)}}},n}(yt),Wn=function(t){var n=function(e){var n=t.call(this,e)||this;return n.destination=e,n};return e(n,t),n}(mt),$n=function(t){var n=function(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e};return e(n,t),n.prototype[vt]=function(){return new Wn(this)},n.prototype.lift=function(e){var t=new Yn(this,this);return t.operator=e,t},n.prototype.next=function(e){if(this.closed)throw new Hn;if(!this.isStopped)for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].next(e)},n.prototype.error=function(e){if(this.closed)throw new Hn;this.hasError=!0,this.thrownError=e,this.isStopped=!0;for(var t=this.observers,n=t.length,r=t.slice(),o=0;o<n;o++)r[o].error(e);this.observers.length=0},n.prototype.complete=function(){if(this.closed)throw new Hn;this.isStopped=!0;for(var e=this.observers,t=e.length,n=e.slice(),r=0;r<t;r++)n[r].complete();this.observers.length=0},n.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},n.prototype._trySubscribe=function(e){if(this.closed)throw new Hn;return t.prototype._trySubscribe.call(this,e)},n.prototype._subscribe=function(e){if(this.closed)throw new Hn;return this.hasError?(e.error(this.thrownError),yt.EMPTY):this.isStopped?(e.complete(),yt.EMPTY):(this.observers.push(e),new qn(this,e))},n.prototype.asObservable=function(){var e=new wt;return e.source=this,e},n.create=function(e,t){return new Yn(e,t)},n}(wt),Yn=function(t){var n=function(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r};return e(n,t),n.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},n.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},n.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},n.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):yt.EMPTY},n}($n),Jn=function(t){var n=function(e){var n=t.call(this)||this;return n._value=e,n};return e(n,t),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Hn;return this._value},n.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},n}($n),Qn=function(){var e=function(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this};return e.prototype=Object.create(Error.prototype),e}(),Zn=new wt((function(e){return e.complete()})),Xn=function(){var e=function(e){if(this.total=e,this.total<0)throw new Qn};return e.prototype.call=function(e,t){return t.subscribe(new er(e,this.total))},e}(),er=function(t){var n=function(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r};return e(n,t),n.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},n}(mt),tr=function(){var e=function(e,t){this.project=e,this.thisArg=t};return e.prototype.call=function(e,t){return t.subscribe(new nr(e,this.project,this.thisArg))},e}(),nr=function(t){var n=function(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o};return e(n,t),n.prototype._next=function(e){var t;try{t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},n}(mt),rr="custom:(uuid,display,voided,indication,startDatetime,stopDatetime,encounters:(uuid,display,encounterDatetime,form:(uuid,name),location:ref,encounterType:ref,encounterProviders:(uuid,display,provider:(uuid,display))),patient:(uuid,display),visitType:(uuid,name,display),attributes:(uuid,display,attributeType:(name,datatypeClassname,uuid),value),location:(uuid,name,display))",or=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};Qe().subscribe((function(e){var t;t=e,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))}));var ir,ar,ur=new Jn(null);!function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(ir||(ir={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(ar||(ar={}));var sr={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}}(),d}())}}}))},714:function(){var e=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":y(e)};System.register(["@openmrs/esm-state"],(function(t,n){var r={};return{setters:[function(e){r.createGlobalStore=e.createGlobalStore,r.getGlobalStore=e.getGlobalStore}],execute:function(){t(function(){"use strict";var t={685:function(e){e.exports=r}},n={};function o(e){var r=n[e];if(void 0!==r)return r.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,o),i.exports}o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){var t=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},n=function(e){return function n(r){return 0===arguments.length||t(r)?n:e.apply(this,arguments)}},r=function(e){return function r(o,i){switch(arguments.length){case 0:return r;case 1:return t(o)?r:n((function(t){return e(o,t)}));default:return t(o)&&t(i)?r:t(o)?n((function(t){return e(t,i)})):t(i)?n((function(t){return e(o,t)})):e(o,i)}}},a=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n},u=function(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1},s=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},c=function(e,t,n,r){var o=a(e);function i(e,t){return fe(e,t,n.slice(),r.slice())}return!u((function(e,t){return!u(i,t,e)}),a(t),o)},l=function(e){return function o(i,a,u){switch(arguments.length){case 0:return o;case 1:return t(i)?o:r((function(t,n){return e(i,t,n)}));case 2:return t(i)&&t(a)?o:t(i)?r((function(t,n){return e(t,a,n)})):t(a)?r((function(t,n){return e(i,t,n)})):n((function(t){return e(i,a,t)}));default:return t(i)&&t(a)&&t(u)?o:t(i)&&t(a)?r((function(t,n){return e(t,n,u)})):t(i)&&t(u)?r((function(t,n){return e(t,a,n)})):t(a)&&t(u)?r((function(t,n){return e(i,t,n)})):t(i)?n((function(t){return e(t,a,u)})):t(a)?n((function(t){return e(i,t,u)})):t(u)?n((function(t){return e(i,a,t)})):e(i,a,u)}}},f=function(e){return"[object Object]"===Object.prototype.toString.call(e)},d=function(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)},h=function(e,t,n,r){return e["@@transducer/result"](n[r](Ee(e["@@transducer/step"],e),t))},p=function(e,t){return function(n){if(!e(n))return"function"==typeof t?t(n):t}},y=function(e){return(0,Ie.getGlobalStore)("config-module-".concat(e),{config:null,loaded:!1,translationOverridesLoaded:!1})},v=function(){return(0,Ie.getGlobalStore)("config-extension-slots",{slots:{}})},m=function(e){return g(v().getState(),e)},g=function(e,t){var n=e.slots[t];return null!=n?n:{loaded:!1,config:{}}},b=function(){return(0,Ie.getGlobalStore)("config-extensions",{configs:{}})},w=function(e,t){var n=Object.assign({},_(b().getState(),e,t));return n.config=ve(["Display conditions","Translation overrides"],n.config),n},_=function(e,t,n){var r,o=null===(r=e.configs[t])||void 0===r?void 0:r[n];return null!=o?o:{loaded:!1,config:null}},S=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},O=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},E=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){O(e,t,n[t])}))}return e},x=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},k=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||j(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},P=function(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||j(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},j=function(e,t){if(e){if("string"==typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}},A=function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(e.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=y(u);if(e.moduleLoaded[u]){var c=G(u,e,t);s.setState({translationOverridesLoaded:!0,loaded:!0,config:c})}else{var l=H(u,e,t);s.setState({translationOverridesLoaded:!0,loaded:!1,config:l})}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},T=function(e,t){var n,r,o=(n=W(V(e,t)),function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=k(o.value,2),u=a[0],s=a[1],c=!0,l=!1,f=void 0;try{for(var d,h=Object.entries(s)[Symbol.iterator]();!(c=(d=h.next()).done);c=!0){var p=k(d.value,2),y=p[0];z(p[1],u,y)}}catch(e){l=!0,f=e}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(e,t){var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{})),Object.keys(r).reduce((function(e,t){return E({},e,r[t])}),{})),i=Object.fromEntries(Object.entries(o).map((function(e){var t=k(e,2);return[t[0],{loaded:!0,config:t[1]}]}))),a=v(),u=a.getState(),s={slots:E({},u.slots,i)};de(u,s)||a.setState(s)},D=function(e,t){var n=function(e,t){var n=Fe(be(e.schemas)),r=P(e.providedConfigs.map((function(e){return[e.config,e.source]}))).concat([[t.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,s=r[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=k(u.value,2);n=W([n,Be(c[0],c[1])])}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return n}(e,t);Le.setState({config:n})},C=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=t.mountedExtensions[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value,l=K(c.slotModuleName,c.extensionModuleName,c.slotName,c.extensionId,e,n);r[c.slotName]=x(E({},r[c.slotName]),O({},c.extensionId,{config:l,loaded:!0}))}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}b().setState({configs:r})},I=function(e,t){Ue(e,t);var n=ye(t,qe);Me.setState((function(t){return x(E({},t),{schemas:x(E({},t.schemas),O({},e,n)),moduleLoaded:x(E({},t.moduleLoaded),O({},e,!0))})}))},M=function(e){var t=Me.getState();Me.setState({schemas:x(E({},t.schemas),O({},e,qe))})},R=function(e){var t=Me.getState();Me.setState({schemas:x(E({},t.schemas),O({},e,He))})},N=function(e,t){Ue(e,t);var n=ye(t,qe),r=Me.getState();r.schemas[e]&&console.error("Config schema for extension ".concat(e," already exists. If there are multiple extensions with this same name, one will probably crash.")),Me.setState({schemas:x(E({},r.schemas),O({},e,n))})},L=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"provided";Me.setState((function(n){return x(E({},n),{providedConfigs:P(n.providedConfigs).concat([{source:t,config:e}])})}))},F=function(e){return new Promise((function(t){var n=function(e){if(e.loaded&&e.config){var n=ve(["Display conditions","Translation overrides"],e.config);t(n),o&&o()}},r=y(e);n(r.getState());var o=r.subscribe(n)}))},B=function(e){return new Promise((function(t){var n=function(e){if(e.translationOverridesLoaded&&e.config){var n,r=null!==(n=e.config["Translation overrides"])&&void 0!==n?n:{};t(r),o&&o()}},r=y(e);n(r.getState());var o=r.subscribe(n)}))},U=function(e,t,n){$(e,t,n);var r=Ve(e,t);return ze(e,r,n),r},K=function(e,t,n,r,o,i){var a,u,s,c,l=function(e){return k(e.split("#"),1)[0]}(r),f=o.schemas[l],d=f?l:t,h=V(o,i),p=q(e,h),y=null!==(c=null==p||null===(a=p.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(s=u.configure)||void 0===s?void 0:s[r])&&void 0!==c?c:{},v=W([q(d,h),y]),m=null!=f?f:o.schemas[t];$(m,v,d);var g=Ve(m,v);return ze(m,g,d),delete g.extensionSlots,g},z=function(e,t,n){var r="".concat(t,".extensionSlots.").concat(n),o="Extension slot config '".concat(r,"'"),i=Object.keys(e).filter((function(e){return!["add","remove","order","configure"].includes(e)}));i.length&&X(r,o+"' contains invalid keys '".concat(i.join("', '"),"'")),e.add&&(Array.isArray(e.add)&&e.add.every((function(e){return"string"==typeof e}))||X(r,o+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((function(e){return"string"==typeof e}))||X(r,o+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((function(e){return"string"==typeof e}))||X(r,o+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(Z(e.configure)||X(r,o+".configure' is invalid. Must be an object with extension IDs for keys"))},V=function(e,t){return P(e.providedConfigs.map((function(e){return e.config}))).concat([t.config])},G=function(e,t,n){var r=t.schemas[e],o=q(e,V(t,n));$(r,o,e);var i=Ve(r,o);return ze(r,i,e),delete i.extensionSlots,i},H=function(e,t,n){var r=q(e,V(t,n)),o=Ve(qe,r);return ze(qe,o,e),delete o.extensionSlots,o},q=function(e,t){return W(t.map((function(t){return t[e]})).filter((function(e){return!!e})))},W=function(e){return ke(ye)({},e)},$=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=t[s],l=n+"."+s,f=e[s];e.hasOwnProperty(s)?Ke(f,c,l):"extensionSlots"===s&&""!==n||X(l,"Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},Y=function(e,t,n){return!t||J(e,[{Array:Pe,Boolean:je,ConceptUuid:Ce,Number:Ae,Object:De,String:Te,UUID:Ce,PersonAttributeTypeUuid:Ce,PatientIdentifierTypeUuid:Ce}[t]],n)},J=function(e,t,n){var r=!0;if(t)try{var o=!0,i=!1,a=void 0;try{for(var u,s=t[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=(0,u.value)(n);"string"==typeof c&&(X(e,"object"==typeof n?"Invalid configuration for ".concat(e,": ").concat(c):"Invalid configuration value ".concat(n," for ").concat(e,": ").concat(c)),r=!1)}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}}catch(t){console.error('Skipping invalid validator at "'.concat(e,'". Encountered error\n\t').concat(t))}return r},Q=function(e){return!!e&&Object.keys(e).filter((function(e){return!["_default","_validators"].includes(e)})).length>0},Z=function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e},X=function(e,t){var n="".concat(e,":::").concat(t);Ge.has(n)||(console.error(t),Ge.add(n))},ee=function(e){e?Ge.forEach((function(t){t.startsWith(e)&&Ge.delete(t)})):Ge.clear()};o.r(i),o.d(i,{Type:function(){return ge},clearConfigErrors:function(){return ee},configExtensionStore:function(){return Ne},configInternalStore:function(){return Me},defineConfigSchema:function(){return I},defineExtensionConfigSchema:function(){return N},getConfig:function(){return F},getConfigStore:function(){return y},getExtensionConfig:function(){return w},getExtensionConfigFromStore:function(){return _},getExtensionSlotConfig:function(){return m},getExtensionSlotConfigFromStore:function(){return g},getExtensionSlotsConfigStore:function(){return v},getExtensionsConfigStore:function(){return b},getTranslationOverrides:function(){return B},implementerToolsConfigStore:function(){return Le},inRange:function(){return We},isUrl:function(){return Ye},isUrlWithTemplateParameters:function(){return $e},oneOf:function(){return Je},processConfig:function(){return U},provide:function(){return L},registerModuleWithConfigSystem:function(){return M},registerTranslationNamespace:function(){return R},temporaryConfigStore:function(){return Re},validator:function(){return p},validators:function(){return Qe}});var te="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},ne=Object.prototype.toString,re=function(){return"[object Arguments]"===ne.call(arguments)?function(e){return"[object Arguments]"===ne.call(e)}:function(e){return s("callee",e)}}(),oe=re,ie=!{toString:null}.propertyIsEnumerable("toString"),ae=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ue=function(){return arguments.propertyIsEnumerable("length")}(),se=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},ce="function"!=typeof Object.keys||ue?n((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=ue&&oe(e);for(t in e)!s(t,e)||o&&"length"===t||(r[r.length]=t);if(ie)for(n=ae.length-1;n>=0;)s(t=ae[n],e)&&!se(r,t)&&(r[r.length]=t),n-=1;return r})):n((function(e){return Object(e)!==e?[]:Object.keys(e)})),le=n((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function fe(t,n,r,o){if(te(t,n))return!0;var i,a,u=le(t);if(u!==le(n))return!1;if(null==t||null==n)return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof n["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](n)&&"function"==typeof n["fantasy-land/equals"]&&n["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof n.equals)return"function"==typeof t.equals&&t.equals(n)&&"function"==typeof n.equals&&n.equals(t);switch(u){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(i=t.constructor,null==(a=String(i).match(/^function (\w*)/))?"":a[1]))return t===n;break;case"Boolean":case"Number":case"String":if((void 0===t?"undefined":e(t))!=(void 0===n?"undefined":e(n))||!te(t.valueOf(),n.valueOf()))return!1;break;case"Date":if(!te(t.valueOf(),n.valueOf()))return!1;break;case"Error":return t.name===n.name&&t.message===n.message;case"RegExp":if(t.source!==n.source||t.global!==n.global||t.ignoreCase!==n.ignoreCase||t.multiline!==n.multiline||t.sticky!==n.sticky||t.unicode!==n.unicode)return!1}for(var l=r.length-1;l>=0;){if(r[l]===t)return o[l]===n;l-=1}switch(u){case"Map":return t.size===n.size&&c(t.entries(),n.entries(),r.concat([t]),o.concat([n]));case"Set":return t.size===n.size&&c(t.values(),n.values(),r.concat([t]),o.concat([n]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var f=ce(t);if(f.length!==ce(n).length)return!1;var d=r.concat([t]),h=o.concat([n]);for(l=f.length-1;l>=0;){var p=f[l];if(!s(p,n)||!fe(n[p],t[p],d,h))return!1;l-=1}return!0}var de=r((function(e,t){return fe(e,t,[],[])})),he=l((function(e,t,n){var r,o={};for(r in t)s(r,t)&&(o[r]=s(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)s(r,n)&&!s(r,o)&&(o[r]=n[r]);return o})),pe=l((function e(t,n,r){return he((function(n,r,o){return f(r)&&f(o)?e(t,r,o):t(n,r,o)}),n,r)})),ye=r((function(e,t){return pe((function(e,t,n){return n}),e,t)})),ve=r((function(e,t){for(var n={},r={},o=0,i=e.length;o<i;)r[e[o]]=1,o+=1;for(var a in t)r.hasOwnProperty(a)||(n[a]=t[a]);return n}));function me(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var u in t[a+1]=e,n[a+1]=o,e)o[u]=r?me(e[u],t,n,!0):e[u];return o};switch(le(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}var ge,be=n((function(e){return null!=e&&"function"==typeof e.clone?e.clone():me(e,[],[],!0)})),we=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},_e=n((function(e){return!!we(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))})),Se=function(){var e=function(e){this.f=e};return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Oe=r((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,u){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,u,s){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,u,s,c){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,u,s,c,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))})),Ee=Oe,xe="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",ke=l((function(e,t,n){if("function"==typeof e&&(e=function(e){return new Se(e)}(e)),_e(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return h(e,t,n,"fantasy-land/reduce");if(null!=n[xe])return d(e,t,n[xe]());if("function"==typeof n.next)return d(e,t,n);if("function"==typeof n.reduce)return h(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")}));!function(e){e.Array="Array",e.Boolean="Boolean",e.ConceptUuid="ConceptUuid",e.Number="Number",e.Object="Object",e.String="String",e.UUID="UUID",e.PersonAttributeTypeUuid="PersonAttributeTypeUuid",e.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid"}(ge||(ge={}));var Pe=p((function(e){return Array.isArray(e)}),"must be an array"),je=p((function(e){return"boolean"==typeof e}),"must be a boolean"),Ae=p((function(e){return"number"==typeof e}),"must be a number"),Te=p((function(e){return"string"==typeof e}),"must be a string"),De=p((function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}),"must be an object (not an array or null)"),Ce=p((function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)}),"must be a valid UUID or a 36-character hexadecimal string"),Ie=o(685),Me=(0,Ie.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),Re=(0,Ie.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});Re.subscribe((function(e){var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));var Ne=(0,Ie.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),Le=(0,Ie.createGlobalStore)("config-implementer-tools",{config:{}});function Fe(e){return e.hasOwnProperty("_default")?x(E({},e),{_value:e._default,_source:"default"}):Z(e)?Object.keys(e).reduce((function(t,n){return t[n]=Fe(e[n]),t}),{}):{}}function Be(e,t){return Z(e)?Object.keys(e).reduce((function(n,r){return n[r]=Be(e[r],t),n}),{}):{_value:e,_source:t}}function Ue(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="Please verify that you are running the latest version and, if so, alert the maintainer.",o=!0,i=!1,a=void 0;try{for(var u,s=function(){var o=u.value,i=n+(n&&".")+o,a=t[o];if("Display conditions"===i&&console.error("".concat(e,' declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ').concat(r)),"Translation overrides"===i&&console.error("".concat(e,' declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ').concat(r)),!Z(a))return console.error("".concat(e," has bad config schema definition for key '").concat(i,"'. ").concat(r)),"continue";a.hasOwnProperty("_default")||Ue(e,a,i);var s=a._elements;if(Q(s)&&Ue(e,s,i+"._elements"),a._validators){var c=!0,l=!1,f=void 0;try{for(var d,h=a._validators[Symbol.iterator]();!(c=(d=h.next()).done);c=!0){var p=d.value;"function"!=typeof p&&console.error("".concat(e," has invalid validator for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: validators must be functions that return either "+"undefined or an error string. Received ".concat(p,"."))}}catch(e){l=!0,f=e}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}var y=a._type;y&&!Object.values(ge).includes(y)&&console.error("".concat(e," has invalid type for key '").concat(i,"' ").concat(r,".")+"\n\nIf you're the maintainer: the allowed types are ".concat(Object.values(ge).join(", "),". ")+"Received '".concat(y,"'")),Object.keys(a).every((function(e){return["_description","_validators","_elements","_type"].includes(e)}))&&!n.includes("._elements")&&console.error("".concat(e," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: all config elements must have a default. "+"Received ".concat(JSON.stringify(a))),s&&y&&![ge.Array,ge.Object].includes(y)&&console.error("".concat(e," has bad config schema definition for key '").concat(i,"'. ").concat(r,".")+"\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. "+"Received ".concat(JSON.stringify(y)))},c=Object.keys(t).filter((function(e){return!e.startsWith("_")}))[Symbol.iterator]();!(o=(u=c.next()).done);o=!0)s()}catch(e){i=!0,a=e}finally{try{o||null==c.return||c.return()}finally{if(i)throw a}}}function Ke(e,t,n){Y(n,e._type,t),Z(t)?e._type===ge.Object?function(e,t,n){if(e._elements){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=t[s];$(e._elements,c,"".concat(n,".").concat(s))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(e,t,n):e.hasOwnProperty("_default")||e.hasOwnProperty("_type")||$(e,t,n):e._type===ge.Array&&function(e,t,n){if(Y(n,ge.Array,t)){if(Q(e._elements))for(var r=0;r<t.length;r++)Ke(e._elements,t[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<t.length;o++){var i;Y("".concat(n,"[").concat(o,"]"),null===(i=e._elements)||void 0===i?void 0:i._type,t[o])}}}(e,t,n)}function ze(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e)if(t!==e._default&&J(n,e._validators,t),Z(t)){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=t[s],l=n+"."+s,f=e[s];e._type===ge.Object&&e._elements?ze(e._elements,c,l):ze(f,c,l)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(t)&&e._elements)for(var d=0;d<t.length;d++)ze(e._elements,t[d],"".concat(n,"[").concat(d,"]"))}A(Me.getState(),Re.getState()),Me.subscribe((function(e){return A(e,Re.getState())})),Re.subscribe((function(e){return A(Me.getState(),e)})),D(Me.getState(),Re.getState()),Me.subscribe((function(e){return D(e,Re.getState())})),Re.subscribe((function(e){return D(Me.getState(),e)})),T(Me.getState(),Re.getState()),Me.subscribe((function(e){return T(e,Re.getState())})),Re.subscribe((function(e){return T(Me.getState(),e)})),C(Me.getState(),Ne.getState(),Re.getState()),Me.subscribe((function(e){C(e,Ne.getState(),Re.getState())})),Ne.subscribe((function(e){C(Me.getState(),e,Re.getState())})),Re.subscribe((function(e){C(Me.getState(),Ne.getState(),e)}));var Ve=function(e,t){var n=be(t);if(!e)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var t=a.value,r=n[t],o=e[t];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(t)||(n[t]=o._default);var i=o._elements;if(r&&Q(i))if(o._type===ge.Array&&Array.isArray(r)){var u=r.map((function(e){return Ve(i,e)}));n[t]=u}else if(o._type===ge.Object){var s=!0,c=!1,l=void 0;try{for(var f,d=Object.keys(r)[Symbol.iterator]();!(s=(f=d.next()).done);s=!0){var h=f.value;r[h]=Ve(i,r[h])}}catch(e){c=!0,l=e}finally{try{s||null==d.return||d.return()}finally{if(c)throw l}}}}else if(Z(o)){var p=null!=r?r:{};Z(p)&&(n[t]=Ve(o,p))}},s=Object.keys(e)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u()}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},Ge=new Set,He={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:ge.Object,_default:{},_validators:[p((function(e){return Object.keys(e).every((function(e){return/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)}))}),(function(e){var t=Object.keys(e).filter((function(e){return!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)}));return"The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ".concat(t.join(", "),".")}))]}},qe=E({"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:ge.Array,_default:[]}}},He),We=function(e,t){return p((function(n){return e<=n&&n<=t}),"must be between ".concat(e," and ").concat(t))},$e=function(e){var t=e.concat(["openmrsBase","openmrsSpaBase"]);return p((function(e){if(!e||"string"!=typeof e)return!1;for(var n=/\${(.*?)}/g,r=n.exec(e);r;){if(!t.includes(r[1]))return!1;r=n.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+t.map((function(e){return"${"+e+"}"})).join(", "))},Ye=$e([]),Je=function(e){return p((function(t){return e.includes(t)}),"Must be one of the following: '".concat(e.join("', '"),"'."))},Qe={inRange:We,isUrl:Ye,isUrlWithTemplateParameters:$e,oneOf:Je}}(),i}())}}}))},570:function(){System.register(["@openmrs/esm-state"],(function(e,t){var n={};return{setters:[function(e){n.getGlobalStore=e.getGlobalStore}],execute:function(){e(function(){"use strict";var e={685:function(e){e.exports=n}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return function(){var e=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},t=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},n=function(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(n){t(e,n,r[n])}))}return e},i=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},a=function(e,r,o){var a;d.setState((function(u){var s;return{flags:i(n({},u.flags),t({},e,{enabled:null!==(a=null===(s=u.flags[e])||void 0===s?void 0:s.enabled)&&void 0!==a&&a,label:r,description:o}))}}))},u=function(e){return d.getState().flags[e].enabled},s=function(e,t){d.subscribe((function(n){t(n.flags[e].enabled)}))},c=function(e,r){d.setState((function(o){return{flags:i(n({},o.flags),t({},e,i(n({},o.flags[e]),{enabled:r})))}}))};r.r(o),r.d(o,{featureFlagsStore:function(){return d},getFeatureFlag:function(){return u},registerFeatureFlag:function(){return a},setFeatureFlag:function(){return c},subscribeToFeatureFlag:function(){return s}});var l=r(685),f={flags:function(){var e={},t=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(localStorage)[Symbol.iterator]();!(t=(i=a.next()).done);t=!0){var u=i.value;if(u.startsWith("openmrs:feature-flag:")){var s=u.replace("openmrs:feature-flag:",""),c=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(s))||"{}");e[s]=n({enabled:"true"===localStorage.getItem(u)},c)}}}catch(e){r=!0,o=e}finally{try{t||null==a.return||a.return()}finally{if(r)throw o}}return e}()},d=(0,l.getGlobalStore)("feature-flags",f);d.subscribe((function(t){var n,r=!0,o=!1,i=void 0;try{for(var a,u=Object.entries(t.flags)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=function(e){if(Array.isArray(e))return e}(n=a.value)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(n)||function(t,n){if(t){if("string"==typeof t)return e(t,2);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,2):void 0}}(n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),c=s[0],l=s[1];localStorage.setItem("openmrs:feature-flag:".concat(c),l.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(c),JSON.stringify({label:l.label,description:l.description}))}}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}))}(),o}())}}}))},103:function(){System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e){window.dispatchEvent(new CustomEvent(y,{detail:{online:e}}))},t=function(e){if(!window.offlineEnabled)return function(){};var t=function(t){return e(t.detail)};return window.addEventListener(y,t),function(){return window.removeEventListener(y,t)}},n=function(e){return e({online:!window.offlineEnabled||navigator.onLine}),t(e)},r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.dispatchEvent(new CustomEvent(v,{detail:e}))},o=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(v,t),function(){return window.removeEventListener(v,t)}},i=function(e){window.dispatchEvent(new CustomEvent(m,{detail:e}))},a=function(e){window.dispatchEvent(new CustomEvent(g,{detail:e}))},u=function(e){window.dispatchEvent(new CustomEvent(w,{detail:e}))},s=function(e){window.dispatchEvent(new CustomEvent(b,{detail:e}))},c=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(m,t),function(){return window.removeEventListener(m,t)}},l=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(g,t),function(){return window.removeEventListener(g,t)}},f=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(b,t),function(){return window.removeEventListener(b,t)}},d=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(w,t),function(){return window.removeEventListener(w,t)}},h={d:function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},p={};h.r(p),h.d(p,{dispatchActionableNotificationShown:function(){return a},dispatchConnectivityChanged:function(){return e},dispatchNotificationShown:function(){return i},dispatchPrecacheStaticDependencies:function(){return r},dispatchSnackbarShown:function(){return u},dispatchToastShown:function(){return s},subscribeActionableNotificationShown:function(){return l},subscribeConnectivity:function(){return n},subscribeConnectivityChanged:function(){return t},subscribeNotificationShown:function(){return c},subscribePrecacheStaticDependencies:function(){return o},subscribeSnackbarShown:function(){return d},subscribeToastShown:function(){return f}});var y="openmrs:connectivity-changed",v="openmrs:precache-static-dependencies",m="openmrs:notification-shown",g="openmrs:actionable-notification-shown",b="openmrs:toast-shown",w="openmrs:snack-bar-shown";return p}())}}}))},593:function(e,t,n){var r=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},o=function(e,t){if(!l(e,t))throw new TypeError("Cannot call a class as a function")},i=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}},a=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e},u=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},s=function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):l(e,t)},c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e},f=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},d=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},h=function(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},p=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":y(e)},v=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}};System.register(["@openmrs/esm-api","@openmrs/esm-state"],(function(e,t){var r={},i={};return{setters:[function(e){r.getLoggedInUser=e.getLoggedInUser},function(e){i.createGlobalStore=e.createGlobalStore}],execute:function(){e(function(){"use strict";var e={766:function(e){e.exports=r},685:function(e){e.exports=i}},t={};function l(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,l),o.exports}l.d=function(e,t){for(var n in t)l.o(t,n)&&!l.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var y={};return function(){var e=function(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))},t=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},r=function(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)},i=function(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href},v=function(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)},m=function(){},g=function(e,t){if(!t)return e&&e.then?e.then(m):Promise.resolve()},b=function(e,t){if(void 0!==In)return console.warn("The application's Service Worker has already been registered. The new service worker at ".concat(e," will not be registered.")),In;if(!("serviceWorker"in navigator))throw new Error("Registering the Service Worker is not possible due to missing browser capabilities.");var n=new Cn(e,t);return In=n.register().then((function(){return n.controlling.then((function(){return n}))}))},w=function(){return null!=In?In:Promise.resolve(void 0)},S=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},O=function(e){return Ln.apply(this,arguments)},E=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},x=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){E(i,r,o,a,u,"next",e)}function u(e){E(i,r,o,a,u,"throw",e)}a(void 0)}))}},k=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},P=function(){return Fn.apply(this,arguments)},j=function(){return Bn.apply(this,arguments)},A=function(){return Un.apply(this,arguments)},T=function(){return Kn.apply(this,arguments)},D=function(){return{current:Vn,notAvailable:"unavailable"===Vn,active:"on"===Vn}},C=function(e){"unavailable"!==Vn&&"unavailable"!==e&&(localStorage.setItem(zn,"on"===e?"active":"disabled"),Vn=e)},I=function(){return Gn.apply(this,arguments)},M=function(e,t){return"object"!=typeof t||qn(t).forEach((function(n){e[n]=t[n]})),e},R=function(e,t){return Yn.call(e,t)},N=function(e,t){"function"==typeof t&&(t=t($n(e))),("undefined"==typeof Reflect?qn:Reflect.ownKeys)(t).forEach((function(n){L(e,n,t[n])}))},L=function(e,t,n,r){Jn(e,t,M(n&&R(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))},F=function(e){return{from:function(t){return e.prototype=Object.create(t.prototype),L(e.prototype,"constructor",e),{extend:N.bind(null,e.prototype)}}}},B=function(e,t,n){return Xn.call(e,t,n)},U=function(e,t){return t(e)},K=function(e){if(!e)throw new Error("Assertion Failed")},z=function(e){Hn.setImmediate?setImmediate(e):setTimeout(e,0)},V=function(e,t){return e.reduce((function(e,n,r){var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})},G=function(e){var t={};for(var n in e)R(e,n)&&(t[n]=e[n]);return t},H=function(e){return nr.apply([],e)},q=function(e){ir="undefined"!=typeof WeakMap&&new WeakMap;var t=ar(e);return ir=null,t},W=function(e){return ur.call(e).slice(8,-1)},$=function(e){var t,n,r,o;if(1===arguments.length){if(Wn(e))return e.slice();if(this===lr&&"string"==typeof e)return[e];if(o=cr(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n},Y=function(e,t){dr=e,hr=t},J=function(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(hr).map((function(e){return"\n"+e})).join("")):""},Q=function(e,t){this._e=yr(),this.name=e,this.message=t},Z=function(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")},X=function(e,t,n,r){this._e=yr(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Z(e,t)},ee=function(e,t){this._e=yr(),this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=Z(e,t)},te=function(){},ne=function(e){return e},re=function(e,t){return null==e||e===ne?t:function(n){return t(e(n))}},oe=function(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}},ie=function(e,t){return e===te?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?oe(r,this.onsuccess):r),o&&(this.onerror=this.onerror?oe(o,this.onerror):o),void 0!==i?i:n}},ae=function(e,t){return e===te?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?oe(n,this.onsuccess):n),r&&(this.onerror=this.onerror?oe(r,this.onerror):r)}},ue=function(e,t){return e===te?t:function(n){var r=e.apply(this,arguments);M(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?oe(o,this.onsuccess):o),i&&(this.onerror=this.onerror?oe(i,this.onerror):i),void 0===r?void 0===a?void 0:a:M(r,a)}},se=function(e,t){return e===te?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}},ce=function(e,t){return e===te?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return t.apply(r,i)}))}return t.apply(this,arguments)}},le=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=te,this._lib=!1;var t=this._PSD=zr;if(dr&&(this._stackHolder=yr(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Er)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&de(this,this._value))}this._state=null,this._value=null,++t.ref,Wr(this,e)},fe=function(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o},de=function(e,t){if(Fr.push(t),null===e._state){var n=e._lib&&ge();t=Ur(t),e._state=!1,e._value=t,dr&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((function(){var n=Zn(t,"stack");t._promise=e,L(t,"stack",{get:function(){return Cr?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){Lr.some((function(t){return t._value===e._value}))||Lr.push(e)}(e),he(e),n&&be()}},he=function(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)pe(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===Gr&&(++Gr,Mr((function(){0==--Gr&&we()}),[]))},pe=function(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Gr,Mr(ye,[n,e,t])}else e._listeners.push(t)},ye=function(e,t,n){try{Br=t;var r,o=t._value;t._state?r=e(o):(Fr.length&&(Fr=[]),r=e(o),-1===Fr.indexOf(o)&&function(e){for(var t=Lr.length;t;)if(Lr[--t]._value===e._value)return void Lr.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{Br=null,0==--Gr&&we(),--n.psd.ref||n.psd.finalize()}},ve=function(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)},me=function(){ge()&&be()},ge=function(){var e=Rr;return Rr=!1,Nr=!1,e},be=function(){var e,t,n;do{for(;Vr.length>0;)for(e=Vr,Vr=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(Vr.length>0);Rr=!0,Nr=!0},we=function(){var e=Lr;Lr=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Hr.slice(0),n=t.length;n;)t[--n]()},_e=function(e){return new le(Er,!1,e)},Se=function(e,t){var n=zr;return function(){var r=ge(),o=zr;try{return Ae(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Ae(o,!1),r&&be()}}},Oe=function(e,t,n,r){var o=zr,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++eo;var a=Kr.env;i.env=Dr?{Promise:le,PromiseProp:{value:le,configurable:!0,writable:!0},all:le.all,race:le.race,allSettled:le.allSettled,any:le.any,resolve:le.resolve,reject:le.reject,nthen:Me(a.nthen,i),gthen:Me(a.gthen,i)}:{},t&&M(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=De(i,e,n,r);return 0===i.ref&&i.finalize(),u},Ee=function(){return Yr.id||(Yr.id=++Jr),++Yr.awaits,Yr.echoes+=100,Yr.id},xe=function(){return!!Yr.awaits&&(0==--Yr.awaits&&(Yr.id=0),Yr.echoes=100*Yr.awaits,!0)},ke=function(e){return Yr.echoes&&e&&e.constructor===Tr?(Ee(),e.then((function(e){return xe(),e}),(function(e){return xe(),to(e)}))):e},Pe=function(e){++Xr,Yr.echoes&&0!=--Yr.echoes||(Yr.echoes=Yr.id=0),Qr.push(zr),Ae(e,!0)},je=function(){var e=Qr[Qr.length-1];Qr.pop(),Ae(e,!1)},Ae=function(e,t){var n=zr;if((t?!Yr.echoes||Zr++&&e===zr:!Zr||--Zr&&e===zr)||Ce(t?Pe.bind(null,e):je),e!==zr&&(zr=e,n===Kr&&(Kr.env=Te()),Dr)){var r=Kr.env.Promise,o=e.env;Pr.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(Hn,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}},Te=function(){var e=Hn.Promise;return Dr?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Hn,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Pr.then,gthen:e.prototype.then}:{}},De=function(e,t,n,r,o){var i=zr;try{return Ae(e,!0),t(n,r,o)}finally{Ae(i,!1)}},Ce=function(e){Ar.call(kr,e)},Ie=function(e,t,n,r){return"function"!=typeof e?e:function(){var o=zr;n&&Ee(),Ae(t,!0);try{return e.apply(this,arguments)}finally{Ae(o,!1),r&&Ce(xe)}}},Me=function(e,t){return function(n,r){return e.call(this,Ie(n,t),Ie(r,t))}},Re=function(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(Hn.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),M(r,o)):Hn.CustomEvent&&M(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&Hn.dispatchEvent&&(dispatchEvent(r),!Hn.PromiseRejectionEvent&&Hn.onunhandledrejection))try{Hn.onunhandledrejection(r)}catch(e){}dr&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: ".concat(e.stack||e))}catch(e){}},Ne=function(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t},Le=function(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=q(t))[e],t}},Fe=function(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e)return function(e){qn(e).forEach((function(t){var n=e[t];if(Wn(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new _r.InvalidArgument("Invalid event config");var r=i(t,ne,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){z((function(){e.apply(null,t)}))}))}))}}))}(e);r||(r=se),o||(o=te);var a={subscribers:[],fire:o,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=r(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter((function(t){return t!==e})),a.fire=a.subscribers.reduce(r,o)}};return t[e]=n[e]=a,a}},Be=function(e,t){return F(t).from({prototype:e}),t},Ue=function(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)},Ke=function(e,t){e.filter=Ne(e.filter,t)},ze=function(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return Ne(r(),t())}:t,e.justLimit=n&&!r},Ve=function(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new _r.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n},Ge=function(e,t,n){var r=Ve(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})},He=function(e,t,n,r){var o=e.replayFilter?Ne(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},a=function(e,n,r){if(!o||o(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),R(i,u)||(i[u]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),qe(Ge(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return qe(Ge(e,r,n),Ne(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)},qe=function(e,t,n,r){var o=Se(r?function(e,t,o){return n(r(e),t,o)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=te}),(function(t){e.fail(t),n=te}))||o(e.value,e,(function(e){return n=e})),n()}))}))},We=function(e){var t=void 0===e?"undefined":p(e);if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";var n=W(e);return"ArrayBuffer"===n?"binary":n},$e=function(e){return s(e,Uint8Array)?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)},Ye=function(e,t){return e<t?-1:e===t?0:1},Je=function(e,t){return e>t?-1:e===t?0:1},Qe=function(e,t,n){var r=s(e,vo)?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r},Ze=function(e){return new e.Collection(e,(function(){return nt("")})).limit(0)},Xe=function(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),u=-1,s=0;s<a;++s){var c=t[s];if(c!==r[s])return o(e[s],n[s])<0?e.substr(0,s)+n[s]+n.substr(s+1):o(e[s],r[s])<0?e.substr(0,s)+r[s]+n.substr(s+1):u>=0?e.substr(0,u)+t[u]+n.substr(u+1):null;o(e[s],c)<0&&(u=s)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)},et=function(e,t,n,r){var o,i,a,u,s,c,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return Qe(e,"String expected.");function d(e){o=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),i=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?Ye:Je;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),s=t.map((function(e){return e.lower})),c=e,l="next"===e?"":r}d("next");var h=new e.Collection(e,(function(){return tt(u[0],s[f-1]+r)}));h._ondirectionchange=function(e){d(e)};var p=0;return h._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var d=i(o);if(t(d,s,p))return!0;for(var h=null,y=p;y<f;++y){var v=Xe(o,d,u[y],s[y],a,c);null===v&&null===h?p=y+1:(null===h||a(h,v)>0)&&(h=v)}return n(null!==h?function(){e.continue(h+l)}:r),!1})),h},tt=function(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}},nt=function(e){return{type:1,lower:e,upper:e}},rt=function(e){return Se((function(t){return ot(t),e(t.target.error),!1}))},ot=function(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()},it=function(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+at(t)}},at=function(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""},ut=function(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:V(n,(function(e){return[e.name,e]}))}},st=function(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return er(t,e)}}(e):function(t){return er(t,e)}},ct=function(e){return[].slice.call(e)},lt=function(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")},ft=function(e,t){var n=e._novip,r=t.db,o=function(e,t,n,r){var o=n.IDBKeyRange,i=(n.indexedDB,function(e,t){return t.reduce((function(e,t){return c({},e,(0,t.create)(e))}),e)}(function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,o=e.lowerOpen,i=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!i)}var o=function(e,t){var n=ct(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=Wn(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:st(t)},indexes:ct(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry,o=e.keyPath,a={name:t,compound:Wn(o),keyPath:o,unique:n,multiEntry:r,extractKey:st(o)};return i[lt(o)]=a,a})),getIndexByKeyPath:function(e){return i[lt(e)]}};return i[":id"]=a.primaryKey,null!=t&&(i[lt(t)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),i=o.schema,a=o.hasGetAll,u=i.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var n=e.trans,o=e.type,i=e.keys,a=e.values,u=e.range;return new Promise((function(e,s){e=Se(e);var c=n.objectStore(t),l=null==c.keyPath,f="put"===o||"add"===o;if(!f&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var h,p=(i||a||{length:1}).length;if(i&&a&&i.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var y=[],v=[],m=0,g=function(e){++m,ot(e)};if("deleteRange"===o){if(4===u.type)return e({numFailures:m,failures:v,results:[],lastResult:void 0});3===u.type?y.push(h=c.clear()):y.push(h=c.delete(r(u)))}else{var b=d(f?l?[a,i]:[a,null]:[i,null],2),w=b[0],_=b[1];if(f)for(var S=0;S<p;++S)y.push(h=_&&void 0!==_[S]?c[o](w[S],_[S]):c[o](w[S])),h.onerror=g;else for(var O=0;O<p;++O)y.push(h=c[o](w[O])),h.onerror=g}var E=function(t){var n=t.target.result;y.forEach((function(e,t){return null!=e.error&&(v[t]=e.error)})),e({numFailures:m,failures:v,results:"delete"===o?i:y.map((function(e){return e.result})),lastResult:n})};h.onerror=function(e){g(e),E(e)},h.onsuccess=E}))},getMany:function(e){var n=e.trans,r=e.keys;return new Promise((function(e,o){e=Se(e);for(var i,a=n.objectStore(t),u=r.length,s=new Array(u),c=0,l=0,f=function(t){var n=t.target;s[n._pos]=n.result,++l===c&&e(s)},d=rt(o),h=0;h<u;++h)null!=r[h]&&((i=a.get(r[h]))._pos=h,i.onsuccess=f,i.onerror=d,++c);0===c&&e(s)}))},get:function(e){var n=e.trans,r=e.key;return new Promise((function(e,o){e=Se(e);var i=n.objectStore(t).get(r);i.onsuccess=function(t){return e(t.target.result)},i.onerror=rt(o)}))},query:function(e){return function(n){return new Promise((function(o,i){o=Se(o);var a=n.trans,u=n.values,s=n.limit,c=n.query,l=s===1/0?void 0:s,f=c.index,d=c.range,h=a.objectStore(t),p=f.isPrimaryKey?h:h.index(f.name),y=r(d);if(0===s)return o({result:[]});if(e){var v=u?p.getAll(y,l):p.getAllKeys(y,l);v.onsuccess=function(e){return o({result:e.target.result})},v.onerror=rt(i)}else{var m=0,g=u||!("openKeyCursor"in p)?p.openCursor(y):p.openKeyCursor(y),b=[];g.onsuccess=function(e){var t=g.result;return t?(b.push(u?t.value:t.primaryKey),++m===s?o({result:b}):void t.continue()):o({result:b})},g.onerror=rt(i)}}))}}(a),openCursor:function(e){var n=e.trans,o=e.values,i=e.query,a=e.reverse,u=e.unique;return new Promise((function(e,s){e=Se(e);var c=i.index,l=i.range,f=n.objectStore(t),d=c.isPrimaryKey?f:f.index(c.name),h=a?u?"prevunique":"prev":u?"nextunique":"next",p=o||!("openKeyCursor"in d)?d.openCursor(r(l),h):d.openKeyCursor(r(l),h);p.onerror=rt(s),p.onsuccess=Se((function(t){var r=p.result;if(r){r.___id=++wo,r.done=!1;var o=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));var a=r.advance.bind(r),u=function(){throw new Error("Cursor not stopped")};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=function(){throw new Error("Cursor not started")},r.fail=Se(s),r.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},r.start=function(e){var t=new Promise((function(e,t){e=Se(e),p.onerror=rt(t),r.fail=t,r.stop=function(t){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,e(t)}})),n=function(){if(p.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return p.onsuccess=Se((function(e){p.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),t},e(r)}else e(null)}),s)}))},count:function(e){var n=e.query,o=e.trans,i=n.index,a=n.range;return new Promise((function(e,n){var u=o.objectStore(t),s=i.isPrimaryKey?u:u.index(i.name),c=r(a),l=c?s.count(c):s.count();l.onsuccess=Se((function(t){return e(t.target.result)})),l.onerror=rt(n)}))}}}(e)})),s={};return u.forEach((function(e){return s[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!s[e])throw new Error("Table '".concat(e,"' not found"));return s[e]},MIN_KEY:-1/0,MAX_KEY:bo(t),schema:i}}(t,o,r),e.dbcore));return{dbcore:i}}(n._middlewares,r,n._deps,t);n.core=o.dbcore,n.tables.forEach((function(e){var t=e.name;n.core.schema.tables.some((function(e){return e.name===t}))&&(e.core=n.core.table(t),s(n[t],n.Table)&&(n[t].core=e.core))}))},dt=function(e,t,n,r){var o=e._novip;n.forEach((function(e){var n=r[e];t.forEach((function(t){var r=Zn(t,e);(!r||"value"in r&&void 0===r.value)&&(t===o.Transaction.prototype||s(t,o.Transaction)?L(t,e,{get:function(){return this.table(e)},set:function(t){Jn(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):t[e]=new o.Table(e,n))}))}))},ht=function(e,t){var n=e._novip;t.forEach((function(e){for(var t in e)s(e[t],n.Table)&&delete e[t]}))},pt=function(e,t){return e._cfg.version-t._cfg.version},yt=function(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],i=t[n];if(o){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!ao)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,s=i.idxByName,c=void 0;for(c in u)s[c]||a.del.push(c);for(c in s){var l=u[c],f=s[c];l?l.src!==f.src&&a.change.push(f):a.add.push(f)}(a.del.length>0||a.add.length>0||a.change.length>0)&&r.change.push(a)}}else r.add.push([n,i])}return r},vt=function(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return mt(o,e)})),o},mt=function(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})},gt=function(e,t,n){var r={};return B(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),o=t.keyPath,i=it(at(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<t.indexNames.length;++u){var s=t.index(t.indexNames[u]);o=s.keyPath;var c=it(s.name,o,!!s.unique,!!s.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(c)}r[e]=ut(e,i,a)})),r},bt=function(e,t,n){for(var r=e._novip,o=n.db.objectStoreNames,i=0;i<o.length;++i){var a=o[i],u=n.objectStore(a);r._hasGetAll="getAll"in u;for(var c=0;c<u.indexNames.length;++c){var l=u.indexNames[c],f=u.index(l).keyPath,d="string"==typeof f?f:"["+B(f).join("+")+"]";if(t[a]){var h=t[a].idxByName[d];h&&(h.name=l,delete t[a].idxByName[d],t[a].idxByName[l]=h)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Hn.WorkerGlobalScope&&s(Hn,Hn.WorkerGlobalScope)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)},wt=function(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Do("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")},_t=function(e){return e&&"function"==typeof e.databases},St=function(e){return Oe((function(){return zr.letThrough=!0,e()}))},Ot=function(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()},Et=function(e){var t=function(t){return e.next(t)},n=o(t),r=o((function(t){return e.throw(t)}));function o(e){return function(t){var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):Wn(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()},xt=function(e,t,n){var r=arguments.length;if(r<2)throw new _r.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,H(o),n]},kt=function(e,t,n){for(var r=Wn(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r},Pt=function(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],o=0,i=0;o<t.keys.length&&i<e.length;++o)0===ho(t.keys[o],e[i])&&(r.push(n?q(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}},jt=function(e){return!("from"in e)},At=function(e,t){jt(t)||function e(t,n){var r=n.from,o=n.to,i=n.l,a=n.r;jo(t,r,o),i&&e(t,i),a&&e(t,a)}(e,t)},Tt=function(e){var t=jt(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&ho(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||ho(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}},Dt=function(e){var t,n,r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),o=r>1?"r":r<-1?"l":"";if(o){var i="r"===o?"l":"r",a=c({},e),u=e[o];e.from=u.from,e.to=u.to,e[o]=u[o],a[o]=u[i],e[i]=a,a.d=Ct(a)}e.d=Ct(e)},Ct=function(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1},It=function(e,t){return qn(t).forEach((function(n){At(e[n]||(e[n]=new Po),t[n])})),e},Mt=function(e){var t=Ro;try{Ro=!0,mo.storagemutated.fire(e)}finally{Ro=t}},Rt=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},Nt=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Lt=function(){return new zo},Ft=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Bt=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},Ut=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Bt(i,r,o,a,u,"next",e)}function u(e){Bt(i,r,o,a,u,"throw",e)}a(void 0)}))}},Kt=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},zt=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Kt(e,t,n[t])}))}return e},Vt=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},Gt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ht=function(){return Ho},qt=function(){return qo.apply(this,arguments)},Wt=function(){return $o.apply(this,arguments)},$t=function(e,t,n,r){return Yo.apply(this,arguments)},Yt=function(e,t,n){return Jo.apply(this,arguments)},Jt=function(e,t){return Qo.apply(this,arguments)},Qt=function(e,t){return Zo.apply(this,arguments)},Zt=function(e){return Xo.apply(this,arguments)},Xt=function(e){return ei.apply(this,arguments)},en=function(e){return ti.apply(this,arguments)},tn=function(e){var t;return!!(null===(t=Go[e])||void 0===t?void 0:t.options.onBeginEditSyncItem)},nn=function(e){return ni.apply(this,arguments)},rn=function(e){return ri.apply(this,arguments)},on=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Go[e]={type:e,dependsOn:t,process:n,options:r}},an=function(){if(!oi&&!(oi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oi(ai)},un=function(){return li+ci()},sn=function(e){return e.startsWith(li)},cn=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},ln=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},fn=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ln(i,r,o,a,u,"next",e)}function u(e){ln(i,r,o,a,u,"throw",e)}a(void 0)}))}},dn=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},hn=function(){return Object.values(fi)},pn=function(e){fi[e.id]&&console.warn('[setupDynamicOfflineDataHandler] Another second handler with the ID "'.concat(e.id,'" was registered. This handler will override the previous one. This could be unintended as the previous handler might run different flows than the newly registered one. If this is the case, ensure that you are setting up the handlers with different IDs.')),fi[e.id]=e},yn=function(e){return di.apply(this,arguments)},vn=function(e,t){return hi.apply(this,arguments)},mn=function(e,t){return pi.apply(this,arguments)},gn=function(e,t,n){return yi.apply(this,arguments)},bn=function(e,t){return vi.apply(this,arguments)},wn=function(e,t,n){return mi.apply(this,arguments)},_n=function(e,t){return gi.apply(this,arguments)},Sn=function(e,t,n){return bi.apply(this,arguments)},On=function(){return wi.apply(this,arguments)},En=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},xn=function(){return jn(),_i},kn=function(e,t){jn(),pn({type:"patient",displayName:t.displayName,id:e,isSynced:function(){return Promise.resolve(!0)},sync:function(e,n){return t.onOfflinePatientAdded({patientUuid:e,signal:null!=n?n:(new AbortController).signal})}})},Pn=function(e){return Si.apply(this,arguments)},jn=function(){console.warn("The offline patient API has been deprecated and will be removed in a future release. To prevent future crashes, the functions remain available for the moment, but any invocations should be migrated ASAP.")};l.r(y),l.d(y,{activateOfflineCapability:function(){return I},beginEditSynchronizationItem:function(){return nn},canBeginEditSynchronizationItemsOfType:function(){return tn},deleteSynchronizationItem:function(){return rn},generateOfflineUuid:function(){return un},getCurrentOfflineMode:function(){return D},getDynamicOfflineDataEntries:function(){return yn},getDynamicOfflineDataEntriesFor:function(){return vn},getDynamicOfflineDataHandlers:function(){return hn},getFullSynchronizationItems:function(){return Xt},getFullSynchronizationItemsFor:function(){return Qt},getOfflineDb:function(){return Lt},getOfflinePatientDataStore:function(){return xn},getOfflineSynchronizationStore:function(){return Ht},getOmrsServiceWorker:function(){return w},getSynchronizationItem:function(){return en},getSynchronizationItems:function(){return Zt},getSynchronizationItemsFor:function(){return Jt},isOfflineUuid:function(){return sn},messageOmrsServiceWorker:function(){return O},offlineUuidPrefix:function(){return li},omrsOfflineCachingStrategyHttpHeaderName:function(){return Nn},omrsOfflineResponseBodyHttpHeaderName:function(){return Mn},omrsOfflineResponseStatusHttpHeaderName:function(){return Rn},putDynamicOfflineData:function(){return mn},putDynamicOfflineDataFor:function(){return gn},queueSynchronizationItem:function(){return Yt},queueSynchronizationItemFor:function(){return $t},registerOfflinePatientHandler:function(){return kn},registerOmrsServiceWorker:function(){return b},removeDynamicOfflineData:function(){return bn},removeDynamicOfflineDataFor:function(){return wn},runSynchronization:function(){return qt},setCurrentOfflineMode:function(){return C},setupDynamicOfflineDataHandler:function(){return pn},setupOfflineSync:function(){return on},syncAllDynamicOfflineData:function(){return _n},syncDynamicOfflineData:function(){return Sn},syncOfflinePatientData:function(){return Pn}});try{self["workbox:window:6.5.4"]&&_()}catch(e){}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var An=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},Tn=function(e,t){this.type=e,Object.assign(this,t)},Dn={type:"SKIP_WAITING"},Cn=function(t){var n,r,o=function(e,n){var r,o;return void 0===n&&(n={}),(r=t.call(this)||this).nn={},r.tn=0,r.rn=new An,r.en=new An,r.on=new An,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!i(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(e){var t=r.fn,n=e.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new Tn(o,a)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new Tn("waiting",a))}),200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new Tn("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(o=function(e){var t=e.data,n=e.ports,o=e.source;return v(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new Tn("message",{data:t,originalEvent:e,ports:n,sw:o}))}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(o.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=e,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r};r=t,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var a,u=o.prototype;return u.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var r=this;return function(e,t){var n=e();return n&&n.then?n.then(t):t()}((function(){if(!n&&"complete"!==document.readyState)return g(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),v(r.bn(),(function(e){r.fn=e,r.yn&&(r.hn=r.yn,r.en.resolve(r.yn),r.on.resolve(r.yn),r.yn.addEventListener("statechange",r.ln,{once:!0}));var t=r.fn.waiting;return t&&i(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new Tn("waiting",{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener("updatefound",r.cn),navigator.serviceWorker.addEventListener("controllerchange",r.dn),r.fn}))}))}catch(e){return Promise.reject(e)}},u.update=function(){try{return this.fn?g(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},u.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},u.messageSW=function(t){try{return v(this.getSW(),(function(n){return e(n,t)}))}catch(e){return Promise.reject(e)}},u.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&e(this.fn.waiting,Dn)},u.pn=function(){var e=navigator.serviceWorker.controller;return e&&i(e.scriptURL,this.sn.toString())?e:void 0},u.bn=function(){try{var e=this;return function(t,n){try{var r=v(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}catch(t){return n(t)}return r&&r.then?r.then(void 0,n):r}((function(){return v(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e}))}catch(e){return Promise.reject(e)}},(a=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,a),o}(function(){var e=function(){this.Pn=new Map},t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=r(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}()),In=void 0,Mn="x-omrs-offline-response-body",Rn="x-omrs-offline-response-status",Nn="x-omrs-offline-caching-strategy";function Ln(){return Ln=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){S(i,r,o,a,u,"next",e)}function u(e){S(i,r,o,a,u,"throw",e)}a(void 0)}))}}((function(e){var t,n;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){switch(r.label){case 0:return[4,w()];case 1:return(t=r.sent())?[4,t.messageSW(e)]:[3,3];case 2:return n=r.sent(),[3,4];case 3:n={success:!1,result:void 0,error:"No service worker has been registered. This is typically the case when the application has been built without offline-related features."},r.label=4;case 4:return[2,n]}}))})),Ln.apply(this,arguments)}function Fn(){return Fn=x((function(){var e;return k(this,(function(t){e=window.sessionStorage;try{e.setItem("someKeyHere","test"),e.removeItem("someKeyHere")}catch(t){if(t.code===DOMException.QUOTA_EXCEEDED_ERR&&0===e.length)return[2,!0]}return[2,!1]}))})),Fn.apply(this,arguments)}function Bn(){return(Bn=x((function(){return k(this,(function(e){return[2,!window.indexedDB]}))}))).apply(this,arguments)}function Un(){return Un=x((function(){return k(this,(function(e){return[2,new Promise((function(e){var t=indexedDB.open("test");t.onerror=function(){return e(!0)},t.onsuccess=function(){return e(!1)}}))]}))})),Un.apply(this,arguments)}function Kn(){return(Kn=x((function(){var e,t;return k(this,(function(n){switch(n.label){case 0:return[4,A()];case 1:return(t=n.sent())?[3,3]:[4,j()];case 2:t=n.sent(),n.label=3;case 3:return(e=t)?[3,5]:[4,P()];case 4:e=n.sent(),n.label=5;case 5:return[2,e]}}))}))).apply(this,arguments)}var zn="openmrs3:offline-mode",Vn="unavailable";function Gn(){return(Gn=x((function(){return k(this,(function(e){switch(e.label){case 0:return[4,T()];case 1:return e.sent()||(Vn="active"===localStorage.getItem(zn)?"on":"off"),navigator.onLine,[2]}}))}))).apply(this,arguments)}var Hn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,qn=Object.keys,Wn=Array.isArray;"undefined"==typeof Promise||Hn.Promise||(Hn.Promise=Promise);var $n=Object.getPrototypeOf,Yn={}.hasOwnProperty,Jn=Object.defineProperty,Qn=Object.getOwnPropertyDescriptor;function Zn(e,t){var n;return Qn(e,t)||(n=$n(e))&&Zn(n,t)}var Xn=[].slice;function er(e,t){if(R(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=er(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var u=e[t.substr(0,a)];return void 0===u?void 0:er(u,t.substr(a+1))}}function tr(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){K("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)tr(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),u=t.substr(i+1);if(""===u)void 0===n?Wn(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var s=e[a];s&&R(e,a)||(s=e[a]={}),tr(s,u,n)}}else void 0===n?Wn(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}var nr=[].concat,rr="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(H([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return Hn[e]})),or=rr.map((function(e){return Hn[e]}));V(rr,(function(e){return[e,!0]}));var ir=null;function ar(e){if(!e||"object"!=typeof e)return e;var t=ir&&ir.get(e);if(t)return t;if(Wn(e)){t=[],ir&&ir.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(ar(e[n]))}else if(or.indexOf(e.constructor)>=0)t=e;else{var o=$n(e);for(var i in t=o===Object.prototype?{}:Object.create(o),ir&&ir.set(e,t),e)R(e,i)&&(t[i]=ar(e[i]))}return t}var ur={}.toString,sr="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",cr="symbol"==(void 0===sr?"undefined":p(sr))?function(e){var t;return null!=e&&(t=e[sr])&&t.apply(e)}:function(){return null},lr={},fr="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},dr="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),hr=function(){return!0},pr=!new Error("").stack;function yr(){if(pr)try{throw yr.arguments,new Error}catch(e){return e}return new Error}var vr=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],mr=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(vr),gr={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};F(Q).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+J(this._e,2))}},toString:function(){return this.name+": "+this.message}}),F(X).from(Q),F(ee).from(Q);var br=mr.reduce((function(e,t){return e[t]=t+"Error",e}),{}),wr=Q,_r=mr.reduce((function(e,t){var n=function(e,n){this._e=yr(),this.name=r,e?"string"==typeof e?(this.message="".concat(e).concat(n?"\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=gr[t]||r,this.inner=null)},r=t+"Error";return F(n).from(wr),e[t]=n,e}),{});_r.Syntax=SyntaxError,_r.Type=TypeError,_r.Range=RangeError;var Sr=vr.reduce((function(e,t){return e[t+"Error"]=_r[t],e}),{}),Or=mr.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=_r[t]),e}),{});Or.ModifyError=X,Or.DexieError=Q,Or.BulkError=ee;var Er={},xr=d("undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,$n(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,$n(t),e]}(),3),kr=xr[0],Pr=xr[1],jr=xr[2],Ar=Pr&&Pr.then,Tr=kr&&kr.constructor,Dr=!!jr,Cr=!1,Ir=jr?function(){jr.then(me)}:Hn.setImmediate?setImmediate.bind(null,me):Hn.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){me(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(me,0)},Mr=function(e,t){Vr.push([e,t]),Nr&&(Ir(),Nr=!1)},Rr=!0,Nr=!0,Lr=[],Fr=[],Br=null,Ur=ne,Kr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Re,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Re(e[0],e[1])}catch(e){}}))}},zr=Kr,Vr=[],Gr=0,Hr=[],qr={get:function(){var e=function(e,r){var o=this,i=!t.global&&(t!==zr||n!==Xr),a=i&&!xe(),u=new le((function(n,u){pe(o,new fe(Ie(e,t,i,a),Ie(r,t,i,a),n,u,t))}));return dr&&ve(u,this),u},t=zr,n=Xr;return e.prototype=Er,e},set:function(e){L(this,"then",e&&e.prototype===Er?qr:{get:function(){return e},set:qr.set})}};function Wr(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&ge();t&&"function"==typeof t.then?Wr(e,(function(e,n){s(t,le)?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,he(e)),n&&be()}}),de.bind(null,e))}catch(t){de(e,t)}}function $r(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,r=J(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+r)}return dr&&((r=J(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&$r(e._prev,t,n)),t}N(le.prototype,{then:qr,_then:function(e,t){pe(this,new fe(null,null,e,t,zr))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return s(e,t)?n(e):_e(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):_e(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),_e(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Cr=!0;var e=$r(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Cr=!1}}},timeout:function(e,t){var n=this;return e<1/0?new le((function(r,o){var i=setTimeout((function(){return o(new _r.Timeout(t))}),e);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&L(le.prototype,Symbol.toStringTag,"Dexie.Promise"),Kr.env=Te(),N(le,{all:function(){var e=$.apply(null,arguments).map(ke);return new le((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(o,i){return le.resolve(o).then((function(n){e[i]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(s(e,le))return e;if(e&&"function"==typeof e.then)return new le((function(t,n){e.then(t,n)}));var t=new le(Er,!0,e);return ve(t,Br),t},reject:_e,race:function(){var e=$.apply(null,arguments).map(ke);return new le((function(t,n){e.map((function(e){return le.resolve(e).then(t,n)}))}))},PSD:{get:function(){return zr},set:function(e){return zr=e}},totalEchoes:{get:function(){return Xr}},newPSD:Oe,usePSD:De,scheduler:{get:function(){return Mr},set:function(e){Mr=e}},rejectionMapper:{get:function(){return Ur},set:function(e){Ur=e}},follow:function(e,t){return new le((function(n,r){return Oe((function(t,n){var r=zr;r.unhandleds=[],r.onunhandled=n,r.finalize=oe((function(){var e=this;!function(e){Hr.push((function t(){e(),Hr.splice(Hr.indexOf(t),1)})),++Gr,Mr((function(){0==--Gr&&we()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}}),Tr&&(Tr.allSettled&&L(le,"allSettled",(function(){var e=$.apply(null,arguments).map(ke);return new le((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,o){return le.resolve(e).then((function(e){return r[o]={status:"fulfilled",value:e}}),(function(e){return r[o]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),Tr.any&&"undefined"!=typeof AggregateError&&L(le,"any",(function(){var e=$.apply(null,arguments).map(ke);return new le((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach((function(e,i){return le.resolve(e).then((function(e){return t(e)}),(function(e){o[i]=e,--r||n(new AggregateError(o))}))}))}))})));var Yr={awaits:0,echoes:0,id:0},Jr=0,Qr=[],Zr=0,Xr=0,eo=0;-1===(""+Ar).indexOf("[native code]")&&(Ee=xe=te);var to=le.reject;function no(e,t,n,r){if(e.idbdb&&(e._state.openComplete||zr.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===br.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return no(e,t,n,r)}))):to(o)}return o._promise(t,(function(e,t){return Oe((function(){return zr.trans=o,r(e,t,o)}))})).then((function(e){return o._completion.then((function(){return e}))}))}if(e._state.openComplete)return to(new _r.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return to(new _r.DatabaseClosed);e.open().catch(te)}return e._state.dbReadyPromise.then((function(){return no(e,t,n,r)}))}var ro=String.fromCharCode(65535),oo="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",io=[],ao="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),uo=ao,so=ao,co=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},lo={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},fo=function(){function e(){o(this,e)}return a(e,[{key:"_trans",value:function(e,t,n){var r=function(e,n,r){if(!r.schema[i])throw new _r.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)},o=this._tx||zr.trans,i=this.name,a=ge();try{return o&&o.db===this.db?o===zr.trans?o._promise(e,r,n):Oe((function(){return o._promise(e,r,n)}),{trans:o,transless:zr.transless||zr}):no(this.db,e,[this.name],r)}finally{a&&be()}}},{key:"get",value:function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)}},{key:"where",value:function(e){var t=function(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}};if("string"==typeof e)return new this.db.WhereClause(this,e);if(Wn(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var n=qn(e);if(1===n.length)return this.where(n[0]).equals(e[n[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&n.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return n.indexOf(e)>=0}))}))[0];if(r&&this.db._maxKey!==ro)return this.where(r.name).equals(r.keyPath.map((function(t){return e[t]})));!r&&dr&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit of a compound index [").concat(n.join("+"),"]"));var o=this.schema.idxByName,i=this.db._deps.indexedDB,a=d(n.reduce((function(n,r){var i=d(n,2),a=i[0],u=i[1],s=o[r],c=e[r];return[a||s,a||!s?Ne(u,s&&s.multi?function(e){var n=er(e,r);return Wn(n)&&n.some((function(e){return t(c,e)}))}:function(e){return t(c,er(e,r))}):u]}),[null,null]),2),u=a[0],s=a[1];return u?this.where(u.name).equals(e[u.keyPath]).filter(s):r?this.filter(s):this.where(n).equals("")}},{key:"filter",value:function(e){return this.toCollection().and(e)}},{key:"count",value:function(e){return this.toCollection().count(e)}},{key:"offset",value:function(e){return this.toCollection().offset(e)}},{key:"limit",value:function(e){return this.toCollection().limit(e)}},{key:"each",value:function(e){return this.toCollection().each(e)}},{key:"toArray",value:function(e){return this.toCollection().toArray(e)}},{key:"toCollection",value:function(){return new this.db.Collection(new this.db.WhereClause(this))}},{key:"orderBy",value:function(e){return new this.db.Collection(new this.db.WhereClause(this,Wn(e)?"[".concat(e.join("+"),"]"):e))}},{key:"reverse",value:function(){return this.toCollection().reverse()}},{key:"mapToClass",value:function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(R(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}},{key:"defineClass",value:function(){return this.mapToClass((function(e){M(this,e)}))}},{key:"add",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Le(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{tr(e,i,t)}catch(e){}return t}))}},{key:"update",value:function(e,t){if("object"!=typeof e||Wn(e))return this.where(":id").equals(e).modify(t);var n=er(e,this.schema.primKey.keyPath);if(void 0===n)return to(new _r.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?qn(t).forEach((function(n){tr(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}},{key:"put",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Le(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{tr(e,i,t)}catch(e){}return t}))}},{key:"delete",value:function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):void 0}))}},{key:"clear",value:function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:lo})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):void 0}))}},{key:"bulkGet",value:function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))}},{key:"bulkAdd",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new _r.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new _r.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(Le(u)):e;return r.core.mutate({trans:t,type:"add",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new ee("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkPut",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new _r.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new _r.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(Le(u)):e;return r.core.mutate({trans:t,type:"put",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new ee("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkDelete",value:function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,o=e.lastResult,i=e.failures;if(0===r)return o;throw new ee("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),i)}))}}]),e}();function ho(e,t){try{var n=We(e),r=We(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i)if(e[i]!==t[i])return e[i]<t[i]?-1:1;return n===r?0:n<r?-1:1}($e(e),$e(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i){var a=ho(e[i],t[i]);if(0!==a)return a}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}var po=function(){function e(){o(this,e)}return a(e,[{key:"_read",value:function(e,t){var n=this._ctx;return n.error?n.table._trans(null,to.bind(null,n.error)):n.table._trans("readonly",e).then(t)}},{key:"_write",value:function(e){var t=this._ctx;return t.error?t.table._trans(null,to.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}},{key:"_addAlgorithm",value:function(e){var t=this._ctx;t.algorithm=Ne(t.algorithm,e)}},{key:"_iterate",value:function(e,t){return He(this._ctx,e,t,this._ctx.table.core)}},{key:"clone",value:function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&M(n,e),t._ctx=n,t}},{key:"raw",value:function(){return this._ctx.valueMapper=null,this}},{key:"each",value:function(e){var t=this._ctx;return this._read((function(n){return He(t,e,n,t.table.core)}))}},{key:"count",value:function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(Ue(n,!0))return r.count({trans:e,query:{index:Ve(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var o=0;return He(n,(function(){return++o,!1}),e,r).then((function(){return o}))})).then(e)}},{key:"sortBy",value:function(e,t){var n=function(e,t){var n=a(e,i),r=a(t,i);return n<r?-u:n>r?u:0},r=e.split(".").reverse(),o=r[0],i=r.length-1;function a(e,t){return t?a(e[r[t]],t-1):e[o]}var u="next"===this._ctx.dir?1:-1;return this.toArray((function(e){return e.sort(n)})).then(t)}},{key:"toArray",value:function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&Ue(n,!0)&&n.limit>0){var r=n.valueMapper,o=Ve(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(e){var t=e.result;return r?t.map(r):t}))}var i=[];return He(n,(function(e){return i.push(e)}),e,n.table.core).then((function(){return i}))}),e)}},{key:"offset",value:function(e){var t=this._ctx;return e<=0||(t.offset+=e,Ue(t)?ze(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):ze(t,(function(){var t=e;return function(){return--t<0}}))),this}},{key:"limit",value:function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),ze(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}},{key:"until",value:function(e,t){return Ke(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this}},{key:"first",value:function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}},{key:"last",value:function(e){return this.reverse().first(e)}},{key:"filter",value:function(e){var t,n;return Ke(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Ne(t.isMatch,n),this}},{key:"and",value:function(e){return this.filter(e)}},{key:"or",value:function(e){return new this.db.WhereClause(this._ctx.table,e,this)}},{key:"reverse",value:function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}},{key:"desc",value:function(){return this.reverse()}},{key:"eachKey",value:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}},{key:"eachUniqueKey",value:function(e){return this._ctx.unique="unique",this.eachKey(e)}},{key:"eachPrimaryKey",value:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}},{key:"keys",value:function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}},{key:"primaryKeys",value:function(e){var t=this._ctx;if("next"===t.dir&&Ue(t,!0)&&t.limit>0)return this._read((function(e){var n=Ve(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}},{key:"uniqueKeys",value:function(e){return this._ctx.unique="unique",this.keys(e)}},{key:"firstKey",value:function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}},{key:"lastKey",value:function(e){return this.reverse().firstKey(e)}},{key:"distinct",value:function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return Ke(this._ctx,(function(e){var t=e.primaryKey.toString(),r=R(n,t);return n[t]=!0,!r})),this}},{key:"modify",value:function(e){var t=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof e)o=e;else{var i=qn(e),a=i.length;o=function(t){for(var n=!1,r=0;r<a;++r){var o=i[r],u=e[o];er(t,o)!==u&&(tr(t,o,u),n=!0)}return n}}var u=n.table.core,s=u.schema.primaryKey,c=s.outbound,l=s.extractKey,f=t.db._options.modifyChunkSize||200,d=[],h=0,p=[],y=function(e,t){var n=t.failures,r=t.numFailures;h+=e-r;var o=!0,i=!1,a=void 0;try{for(var u,s=qn(n)[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value;d.push(n[c])}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}};return t.clone().primaryKeys().then((function(t){var i=function(a){var s=Math.min(f,t.length-a);return u.getMany({trans:r,keys:t.slice(a,a+s),cache:"immutable"}).then((function(d){for(var h=[],p=[],v=c?[]:null,m=[],g=0;g<s;++g){var b=d[g],w={value:q(b),primKey:t[a+g]};!1!==o.call(w,w.value,w)&&(null==w.value?m.push(t[a+g]):c||0===ho(l(b),l(w.value))?(p.push(w.value),c&&v.push(t[a+g])):(m.push(t[a+g]),h.push(w.value)))}var _=Ue(n)&&n.limit===1/0&&("function"!=typeof e||e===yo)&&{index:n.index,range:n.range};return Promise.resolve(h.length>0&&u.mutate({trans:r,type:"add",values:h}).then((function(e){for(var t in e.failures)m.splice(parseInt(t),1);y(h.length,e)}))).then((function(){return(p.length>0||_&&"object"==typeof e)&&u.mutate({trans:r,type:"put",keys:v,values:p,criteria:_,changeSpec:"function"!=typeof e&&e}).then((function(e){return y(p.length,e)}))})).then((function(){return(m.length>0||_&&e===yo)&&u.mutate({trans:r,type:"delete",keys:m,criteria:_}).then((function(e){return y(m.length,e)}))})).then((function(){return t.length>a+s&&i(a+f)}))}))};return i(0).then((function(){if(d.length>0)throw new X("Error modifying one or more objects",d,h,p);return t.length}))}))}))}},{key:"delete",value:function(){var e=this._ctx,t=e.range;return Ue(e)&&(e.isPrimKey&&!so||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new X("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-r);return t-r}))}))})):this.modify(yo)}}]),e}(),yo=function(e,t){return t.value=null},vo=function(){function e(){o(this,e)}return a(e,[{key:"Collection",get:function(){return this._ctx.table.db.Collection}},{key:"between",value:function(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Ze(this):new this.Collection(this,(function(){return tt(e,t,!n,!r)}))}catch(e){return Qe(this,oo)}}},{key:"equals",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return nt(e)}))}},{key:"above",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return tt(e,void 0,!0)}))}},{key:"aboveOrEqual",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return tt(e,void 0,!1)}))}},{key:"below",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return tt(void 0,e,!1,!0)}))}},{key:"belowOrEqual",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return tt(void 0,e)}))}},{key:"startsWith",value:function(e){return"string"!=typeof e?Qe(this,"String expected."):this.between(e,e+ro,!0,!0)}},{key:"startsWithIgnoreCase",value:function(e){return""===e?this.startsWith(e):et(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],ro)}},{key:"equalsIgnoreCase",value:function(e){return et(this,(function(e,t){return e===t[0]}),[e],"")}},{key:"anyOfIgnoreCase",value:function(){var e=$.apply(lr,arguments);return 0===e.length?Ze(this):et(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")}},{key:"startsWithAnyOfIgnoreCase",value:function(){var e=$.apply(lr,arguments);return 0===e.length?Ze(this):et(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,ro)}},{key:"anyOf",value:function(){var e=this,t=$.apply(lr,arguments),n=this._cmp;try{t.sort(n)}catch(e){return Qe(this,oo)}if(0===t.length)return Ze(this);var r=new this.Collection(this,(function(){return tt(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm((function(e,r,i){for(var a=e.key;n(a,t[o])>0;)if(++o===t.length)return r(i),!1;return 0===n(a,t[o])||(r((function(){e.continue(t[o])})),!1)})),r}},{key:"notEqual",value:function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}},{key:"noneOf",value:function(){var e=$.apply(lr,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Qe(this,oo)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}},{key:"inAnyRange",value:function(e,t){var n=this,r=function(e,t){return d(e[0],t[0])},o=this._cmp,i=this._ascending,a=this._descending,u=this._min,s=this._max;if(0===e.length)return Ze(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&i(e[0],e[1])<=0})))return Qe(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",_r.InvalidArgument);var c,l=!t||!1!==t.includeLowers,f=t&&!0===t.includeUppers,d=i;try{c=e.reduce((function(e,t){for(var n=0,r=e.length;n<r;++n){var i=e[n];if(o(t[0],i[1])<0&&o(t[1],i[0])>0){i[0]=u(i[0],t[0]),i[1]=s(i[1],t[1]);break}}return n===r&&e.push(t),e}),[]),c.sort(r)}catch(e){return Qe(this,oo)}var h=0,p=f?function(e){return i(e,c[h][1])>0}:function(e){return i(e,c[h][1])>=0},y=l?function(e){return a(e,c[h][0])>0}:function(e){return a(e,c[h][0])>=0},v=p,m=new this.Collection(this,(function(){return tt(c[0][0],c[c.length-1][1],!l,!f)}));return m._ondirectionchange=function(e){"next"===e?(v=p,d=i):(v=y,d=a),c.sort(r)},m._addAlgorithm((function(e,t,r){for(var o=e.key;v(o);)if(++h===c.length)return t(r),!1;return!!function(e){return!p(e)&&!y(e)}(o)||(0===n._cmp(o,c[h][1])||0===n._cmp(o,c[h][0])||t((function(){d===i?e.continue(c[h][0]):e.continue(c[h][1])})),!1)})),m}},{key:"startsWithAnyOf",value:function(){var e=$.apply(lr,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Ze(this):this.inAnyRange(e.map((function(e){return[e,e+ro]}))):Qe(this,"startsWithAnyOf() only works with strings")}}]),e}(),mo=Fe(null,"storagemutated"),go=function(){function e(){o(this,e)}return a(e,[{key:"_lock",value:function(){return K(!zr.global),++this._reculock,1!==this._reculock||zr.global||(zr.lockOwnerFor=this),this}},{key:"_unlock",value:function(){if(K(!zr.global),0==--this._reculock)for(zr.global||(zr.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{De(e[1],e[0])}catch(e){}}return this}},{key:"_locked",value:function(){return this._reculock&&zr.lockOwnerFor!==this}},{key:"create",value:function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(K(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new _r.DatabaseClosed(r);case"MissingAPIError":throw new _r.MissingAPI(r.message,r);default:throw new _r.OpenFailed(r)}if(!this.active)throw new _r.TransactionInactive;return K(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Se((function(n){ot(n),t._reject(e.error)})),e.onabort=Se((function(n){ot(n),t.active&&t._reject(new _r.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Se((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&mo.storagemutated.fire(e.mutatedParts)})),this}},{key:"_promise",value:function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return to(new _r.ReadOnly("Transaction is readonly"));if(!this.active)return to(new _r.TransactionInactive);if(this._locked())return new le((function(o,i){r._blockedFuncs.push([function(){r._promise(e,t,n).then(o,i)},zr])}));if(n)return Oe((function(){var e=new le((function(e,n){r._lock();var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var o=new le((function(e,n){var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return o._lib=!0,o}},{key:"_root",value:function(){return this.parent?this.parent._root():this}},{key:"waitFor",value:function(e){var t=this._root(),n=le.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return n}));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new le((function(e,r){n.then((function(n){return t._waitingQueue.push(Se(e.bind(null,n)))}),(function(e){return t._waitingQueue.push(Se(r.bind(null,e)))})).finally((function(){t._waitingFor===o&&(t._waitingFor=null)}))}))}},{key:"abort",value:function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new _r.Abort))}},{key:"table",value:function(e){var t=this._memoizedTables||(this._memoizedTables={});if(R(t,e))return t[e];var n=this.schema[e];if(!n)throw new _r.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}]),e}(),bo=function(e){try{return e.only([[]]),bo=function(){return[[]]},[[]]}catch(e){return bo=function(){return ro},ro}},wo=0,_o=function(){function e(){o(this,e)}return a(e,[{key:"_parseStoresSpec",value:function(e,t){qn(e).forEach((function(n){if(null!==e[n]){var r=e[n].split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return it(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Wn(r),0===t)})),o=r.shift();if(o.multi)throw new _r.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new _r.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new _r.Schema("Index must have a name and cannot be an empty string")})),t[n]=ut(n,o,r)}}))}},{key:"stores",value:function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?M(this._cfg.storesSource,e):e;var n=t._versions,r={},o={};return n.forEach((function(e){M(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,ht(t,[t._allTables,t,t.Transaction.prototype]),dt(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],qn(o),o),t._storeNames=qn(o),this}},{key:"upgrade",value:function(e){return this._cfg.contentUpgrade=ce(this._cfg.contentUpgrade||te,e),this}}]),e}();function So(e,t,n,r,o){return le.resolve().then((function(){var i=zr.transless||zr,a=e._createTransaction(t,n,e._dbSchema,r),u={trans:a,transless:i};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===br.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return So(e,t,n,null,o)}))):to(r)}var s,c=fr(o);c&&Ee();var l=le.follow((function(){if(s=o.call(a,a))if(c){var e=xe.bind(null,null);s.then(e,e)}else"function"==typeof s.next&&"function"==typeof s.throw&&(s=Et(s))}),u);return(s&&"function"==typeof s.then?le.resolve(s).then((function(e){return a.active?e:to(new _r.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return s}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),to(e)}))}))}var Oo={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return f(c({},e),{table:function(t){var n=function(t){var n,r,o=t.query.index;return o.isVirtual?f(c({},t),{query:{index:o,range:(n=t.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:kt(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:kt(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}):t},r=e.table(t),o=r.schema,i={},a=[];function u(e,t,n){var r=lt(e),o=i[r]=i[r]||[],s=null==e?0:"string"==typeof e?1:e.length,l=t>0,d=f(c({},n),{isVirtual:l,keyTail:t,keyLength:s,extractKey:st(e),unique:!l&&n.unique});return o.push(d),d.isPrimaryKey||a.push(d),s>1&&u(2===s?e[0]:e.slice(0,s-1),t+1,n),o.sort((function(e,t){return e.keyTail-t.keyTail})),d}var s=u(o.primaryKey.keyPath,0,o.primaryKey);i[":id"]=[s];var l=!0,d=!1,h=void 0;try{for(var p,y=o.indexes[Symbol.iterator]();!(l=(p=y.next()).done);l=!0){var v=p.value;u(v.keyPath,0,v)}}catch(e){d=!0,h=e}finally{try{l||null==y.return||y.return()}finally{if(d)throw h}}var m=f(c({},r),{schema:f(c({},o),{primaryKey:s,indexes:a,getIndexByKeyPath:function(e){var t=i[lt(e)];return t&&t[0]}}),count:function(e){return r.count(n(e))},query:function(e){return r.query(n(e))},openCursor:function(t){var o=t.query.index,i=o.keyTail,a=o.isVirtual,u=o.keyLength;return a?r.openCursor(n(t)).then((function(n){return n&&function(n){var r=Object.create(n,{continue:{value:function(r){null!=r?n.continue(kt(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i)):t.unique?n.continue(n.key.slice(0,u).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(kt(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===u?e[0]:e.slice(0,u)}},value:{get:function(){return n.value}}});return r}(n)})):r.openCursor(t)}});return m}})}};function Eo(e,t,n,r){return n=n||{},r=r||"",qn(e).forEach((function(o){if(R(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=W(i);u!==W(a)?n[r+o]=t[o]:"Object"===u?Eo(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o])}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0})),qn(t).forEach((function(o){R(e,o)||(n[r+o]=t[o])})),n}var xo={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return f(c({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey,o=f(c({},n),{mutate:function(e){var o=function(e){var t=zr.trans,o=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!o)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?f(c({},e),{keys:o}):c({},e)).type&&(e.values=h(e.values)),e.keys&&(e.keys=h(e.keys)),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,o).then((function(i){var a=o.map((function(n,o){var a=i[o],c={onerror:null,onsuccess:null};if("delete"===e.type)u.fire.call(c,n,a,t);else if("add"===e.type||void 0===a){var f=s.fire.call(c,n,e.values[o],t);null==n&&null!=f&&(n=f,e.keys[o]=n,r.outbound||tr(e.values[o],r.keyPath,n))}else{var d=Eo(a,e.values[o]),h=l.fire.call(c,d,n,a,t);if(h){var p=e.values[o];Object.keys(h).forEach((function(e){R(p,e)?p[e]=h[e]:tr(p,e,h[e])}))}}return c}));return n.mutate(e).then((function(t){for(var n=t.failures,r=t.results,u=t.numFailures,s=t.lastResult,c=0;c<o.length;++c){var l=r?r[c]:o[c],f=a[c];null==l?f.onerror&&f.onerror(n[c]):f.onsuccess&&f.onsuccess("put"===e.type&&i[c]?e.values[c]:l)}return{failures:n,results:r,numFailures:u,lastResult:s}})).catch((function(e){return a.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))},i=zr.trans,a=i.table(t).hook,u=a.deleting,s=a.creating,l=a.updating;switch(e.type){case"add":if(s.fire===te)break;return i._promise("readwrite",(function(){return o(e)}),!0);case"put":if(s.fire===te&&l.fire===te)break;return i._promise("readwrite",(function(){return o(e)}),!0);case"delete":if(u.fire===te)break;return i._promise("readwrite",(function(){return o(e)}),!0);case"deleteRange":if(u.fire===te)break;return i._promise("readwrite",(function(){return function(e){return d(e.trans,e.range,1e4)}(e)}),!0)}return n.mutate(e);function d(e,t,i){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:i}).then((function(n){var r=n.result;return o({type:"delete",keys:r,trans:e}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<i?{failures:[],numFailures:0,lastResult:void 0}:d(e,f(c({},t),{lower:r[r.length-1],lowerOpen:!0}),i)}))}))}}});return o}})}},ko={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return f(c({},n),{getMany:function(e){if(!e.cache)return n.getMany(e);var t=Pt(e.keys,e.trans._cache,"clone"===e.cache);return t?le.resolve(t):n.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?q(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),n.mutate(e)}})}}}},Po=function(e,t){if(!this){var n=new Po;return e&&"d"in e&&M(n,e),n}M(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function jo(e,t,n){var r=ho(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(jt(e))return M(e,{from:t,to:n,d:1});var o=e.l,i=e.r;if(ho(n,e.from)<0)return o?jo(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Dt(e);if(ho(t,e.to)>0)return i?jo(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Dt(e);ho(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),ho(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;o&&!e.l&&At(e,o),i&&a&&At(e,i)}}N(Po.prototype,u({add:function(e){return At(this,e),this},addKey:function(e){return jo(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return jo(t,e,e)})),this}},sr,(function(){return Tt(this)})));var Ao,To={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new Po(e.MIN_KEY,e.MAX_KEY);return f(c({},e),{table:function(r){var o=e.table(r),i=o.schema,a=i.primaryKey,u=a.extractKey,s=a.outbound,l=f(c({},o),{mutate:function(e){var a=e.trans,u=a.mutatedParts||(a.mutatedParts={}),s=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return u[n]||(u[n]=new Po)},c=s(""),l=s(":dels"),f=e.type,h=d("deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],2),p=h[0],y=h[1],v=e.trans._cache;return o.mutate(e).then((function(e){if(Wn(p)){"delete"!==f&&(p=e.results),c.addKeys(p);var t=Pt(p,v);t||"add"===f||l.addKeys(p),(t||y)&&function(e,t,n,r){t.indexes.forEach((function(t){var o=function(e){return null!=e?t.extractKey(e):null},i=e(t.name||""),a=function(e){return t.multiEntry&&Wn(e)?e.forEach((function(e){return i.addKey(e)})):i.addKey(e)};(n||r).forEach((function(e,t){var i=n&&o(n[t]),u=r&&o(r[t]);0!==ho(i,u)&&(null!=i&&a(i),null!=u&&a(u))}))}))}(s,i,t,y)}else if(p){var r={from:p.lower,to:p.upper};l.add(r),c.add(r)}else c.add(n),l.add(n),i.indexes.forEach((function(e){return s(e.name).add(n)}));return e}))}}),h=function(t){var n,r,o=t.query,i=o.index,a=o.range;return[i,new Po(null!==(n=a.lower)&&void 0!==n?n:e.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:e.MAX_KEY)]},p={get:function(e){return[a,new Po(e.key)]},getMany:function(e){return[a,(new Po).addKeys(e.keys)]},count:h,query:h,openCursor:h};return qn(p).forEach((function(e){l[e]=function(i){var a=zr.subscr;if(a){var l=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return a[n]||(a[n]=new Po)},h=l(""),y=l(":dels"),v=d(p[e](i),2),m=v[0],g=v[1];if(l(m.name||"").add(g),!m.isPrimaryKey){if("count"!==e){var b="query"===e&&s&&i.values&&o.query(f(c({},i),{values:!1}));return o[e].apply(this,arguments).then((function(t){if("query"===e){if(s&&i.values)return b.then((function(e){var n=e.result;return h.addKeys(n),t}));var n=i.values?t.result.map(u):t.result;i.values?h.addKeys(n):y.addKeys(n)}else if("openCursor"===e){var r=t,o=i.values;return r&&Object.create(r,{key:{get:function(){return y.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return y.addKey(e),e}},value:{get:function(){return o&&h.addKey(r.primaryKey),r.value}}})}return t}))}y.add(n)}}return o[e].apply(this,arguments)}})),l}})}},Do=function(){function e(t,n){var r=this;o(this,e),this._middlewares={},this.verno=0;var i=e.dependencies;this._options=n=c({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var a=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var u,s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:te,dbReadyPromise:null,cancelOpen:te,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};s.dbReadyPromise=new le((function(e){s.dbReadyResolve=e})),s.openCanceller=new le((function(e,t){s.cancelOpen=t})),this._state=s,this.name=t,this.on=Fe(this,"populate","blocked","versionchange","close",{ready:[ce,te]}),this.on.ready.subscribe=U(this.on.ready.subscribe,(function(t){return function(n,o){e.vip((function(){var e=r._state;if(e.openComplete)e.dbOpenError||le.resolve().then(n),o&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),o&&t(n);else{t(n);var i=r;o||t((function e(){i.on.ready.unsubscribe(n),i.on.ready.unsubscribe(e)}))}}))}})),this.Collection=(u=this,Be(po.prototype,(function(e,t){this.db=u;var n=lo,r=null;if(t)try{n=t()}catch(e){r=e}var o=e._ctx,i=o.table,a=i.hook.reading.fire;this._ctx={table:i,index:o.index,isPrimKey:!o.index||i.schema.primKey.keyPath&&o.index===i.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:a!==ne?a:null}}))),this.Table=function(e){return Be(fo.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:Fe(null,{creating:[ie,te],reading:[re,ne],updating:[ue,te],deleting:[ae,te]})}))}(this),this.Transaction=function(e){return Be(go.prototype,(function(t,n,r,o,i){var a=this;this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Fe(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new le((function(e,t){a._resolve=e,a._reject=t})),this._completion.then((function(){a.active=!1,a.on.complete.fire()}),(function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),to(e)}))}))}(this),this.Version=function(e){return Be(_o.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Be(vo.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};var o=e._deps.indexedDB;if(!o)throw new _r.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(e,t){return o.cmp(t,e)},this._max=function(e,t){return o.cmp(e,t)>0?e:t},this._min=function(e,t){return o.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close()})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=bo(n.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,o)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),io.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Oo),this.use(xo),this.use(To),this.use(ko),this.vip=Object.create(this,{_vip:{value:!0}}),a.forEach((function(e){return e(r)}))}return a(e,[{key:"version",value:function(e){if(isNaN(e)||e<.1)throw new _r.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new _r.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(pt),n.stores({}),this._state.autoSchema=!1,n)}},{key:"_whenReady",value:function(e){var t=this;return this.idbdb&&(this._state.openComplete||zr.letThrough||this._vip)?e():new le((function(e,n){if(t._state.openComplete)return n(new _r.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void n(new _r.DatabaseClosed);t.open().catch(te)}t._state.dbReadyPromise.then(e,n)})).then(e)}},{key:"use",value:function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;o&&this.unuse({stack:t,name:o});var i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:null==r?10:r,name:o}),i.sort((function(e,t){return e.level-t.level})),this}},{key:"unuse",value:function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this}},{key:"open",value:function(){return function(e){var t=function(){if(n.openCanceller!==o)throw new _r.DatabaseClosed("db.open() was cancelled")},n=e._state,r=e._deps.indexedDB;if(n.isBeingOpened||e.idbdb)return n.dbReadyPromise.then((function(){return n.dbOpenError?to(n.dbOpenError):e}));dr&&(n.openCanceller._stackHolder=yr()),n.isBeingOpened=!0,n.dbOpenError=null,n.openComplete=!1;var o=n.openCanceller,i=n.dbReadyResolve,a=null,u=!1;return le.race([o,("undefined"==typeof navigator?le.resolve():Ot()).then((function(){return new le((function(o,i){if(t(),!r)throw new _r.MissingAPI;var s=e.name,c=n.autoSchema?r.open(s):r.open(s,Math.round(10*e.verno));if(!c)throw new _r.MissingAPI;c.onerror=rt(i),c.onblocked=Se(e._fireOnBlocked),c.onupgradeneeded=Se((function(t){if(a=c.transaction,n.autoSchema&&!e._options.allowEmptyDB){c.onerror=ot,a.abort(),c.result.close();var o=r.deleteDatabase(s);o.onsuccess=o.onerror=Se((function(){i(new _r.NoSuchDatabase("Database ".concat(s," doesnt exist")))}))}else{a.onerror=rt(i);var l=t.oldVersion>Math.pow(2,62)?0:t.oldVersion;u=l<1,e._novip.idbdb=c.result,function(e,t,n,r){var o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=zr.transless||zr;Oe((function(){zr.trans=i,zr.transless=u,0===t?(qn(o).forEach((function(e){vt(n,e,o[e].primKey,o[e].indexes)})),ft(e,n),le.follow((function(){return e.on.populate.fire(i)})).catch(a)):function(e,t,n,r){var o=e._novip,i=[],a=o._versions,u=o._dbSchema=gt(0,o.idbdb,r),s=!1;return a.filter((function(e){return e._cfg.version>=t})).forEach((function(e){i.push((function(){var i=u,a=e._cfg.dbschema;bt(o,i,r),bt(o,a,r),u=o._dbSchema=a;var c=yt(i,a);c.add.forEach((function(e){vt(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((function(e){if(e.recreate)throw new _r.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){return mt(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),mt(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=e._cfg.contentUpgrade;if(l&&e._cfg.version>t){ft(o,r),n._memoizedTables={},s=!0;var f=G(a);c.del.forEach((function(e){f[e]=i[e]})),ht(o,[o.Transaction.prototype]),dt(o,[o.Transaction.prototype],qn(f),f),n.schema=f;var d,h=fr(l);h&&Ee();var p=le.follow((function(){if((d=l(n))&&h){var e=xe.bind(null,null);d.then(e,e)}}));return d&&"function"==typeof d.then?le.resolve(d):p.then((function(){return d}))}})),i.push((function(t){s&&uo||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((function(n){return null==e[n]&&t.db.deleteObjectStore(n)}))}(e._cfg.dbschema,t),ht(o,[o.Transaction.prototype]),dt(o,[o.Transaction.prototype],o._storeNames,o._dbSchema),n.schema=o._dbSchema}))})),function e(){return i.length?le.resolve(i.shift()(n.idbtrans)).then(e):le.resolve()}().then((function(){var e,t;t=r,qn(e=u).forEach((function(n){t.db.objectStoreNames.contains(n)||vt(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(a)}))}(e,l/10,a,i)}}),i),c.onsuccess=Se((function(){a=null;var t,r=e._novip.idbdb=c.result,i=B(r.objectStoreNames);if(i.length>0)try{var l=r.transaction(1===(t=i).length?t[0]:t,"readonly");n.autoSchema?function(e,t,n){var r=e._novip;r.verno=t.version/10;var o=r._dbSchema=gt(0,t,n);r._storeNames=B(t.objectStoreNames,0),dt(r,[r._allTables],qn(o),o)}(e,r,l):(bt(e,e._dbSchema,l),function(e,t){var n=yt(gt(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((function(e){return e.add.length||e.change.length})))}(e,l)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),ft(e,l)}catch(e){}io.push(e),r.onversionchange=Se((function(t){n.vcFired=!0,e.on("versionchange").fire(t)})),r.onclose=Se((function(t){e.on("close").fire(t)})),u&&function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!_t(n)&&"__dbnames"!==t&&wt(n,r).put({name:t}).catch(te)}(e._deps,s),o()}),i)}))}))]).then((function(){return t(),n.onReadyBeingFired=[],le.resolve(St((function(){return e.on.ready.fire(e.vip)}))).then((function t(){if(n.onReadyBeingFired.length>0){var r=n.onReadyBeingFired.reduce(ce,te);return n.onReadyBeingFired=[],le.resolve(St((function(){return r(e.vip)}))).then(t)}}))})).finally((function(){n.onReadyBeingFired=null,n.isBeingOpened=!1})).then((function(){return e})).catch((function(t){n.dbOpenError=t;try{a&&a.abort()}catch(e){}return o===n.openCanceller&&e._close(),to(t)})).finally((function(){n.openComplete=!0,i()}))}(this)}},{key:"_close",value:function(){var e=this._state,t=io.indexOf(this);if(t>=0&&io.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new le((function(t){e.dbReadyResolve=t})),e.openCanceller=new le((function(t,n){e.cancelOpen=n}))}},{key:"close",value:function(){this._close();var e=this._state;this._options.autoOpen=!1,e.dbOpenError=new _r.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}},{key:"delete",value:function(){var e=this,t=arguments.length>0,n=this._state;return new le((function(r,o){var i=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=Se((function(){!function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!_t(n)&&"__dbnames"!==t&&wt(n,r).delete(t).catch(te)}(e._deps,e.name),r()})),t.onerror=rt(o),t.onblocked=e._fireOnBlocked};if(t)throw new _r.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))}},{key:"backendDB",value:function(){return this.idbdb}},{key:"isOpen",value:function(){return null!==this.idbdb}},{key:"hasBeenClosed",value:function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}},{key:"hasFailed",value:function(){return null!==this._state.dbOpenError}},{key:"dynamicallyOpened",value:function(){return this._state.autoSchema}},{key:"tables",get:function(){var e=this;return qn(this._allTables).map((function(t){return e._allTables[t]}))}},{key:"transaction",value:function(){var e=xt.apply(this,arguments);return this._transaction.apply(this,e)}},{key:"_transaction",value:function(e,t,n){var r=this,o=zr.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var i,a,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){var t=s(e,r.Table)?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)i="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new _r.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(o){if("readonly"===o.mode&&"readwrite"===i){if(!u)throw new _r.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(e){if(o&&-1===o.storeNames.indexOf(e)){if(!u)throw new _r.SubTransaction("Table "+e+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(function(t,n){n(e)})):to(e)}var c=So.bind(null,this,i,a,o,n);return o?o._promise(i,c,"lock"):zr.trans?De(zr.transless,(function(){return r._whenReady(c)})):this._whenReady(c)}},{key:"table",value:function(e){if(!R(this._allTables,e))throw new _r.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]}}]),e}(),Co="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",Io=function(){function e(t){o(this,e),this._subscribe=t}return a(e,[{key:"subscribe",value:function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}},{key:Co,value:function(){return this}}]),e}();try{Ao={indexedDB:Hn.indexedDB||Hn.mozIndexedDB||Hn.webkitIndexedDB||Hn.msIndexedDB,IDBKeyRange:Hn.IDBKeyRange||Hn.webkitIDBKeyRange}}catch(r){Ao={indexedDB:null,IDBKeyRange:null}}var Mo=Do;N(Mo,f(c({},Or),{delete:function(e){return new Mo(e,{addons:[]}).delete()},exists:function(e){return new Mo(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return function(e){var t=e.indexedDB,n=e.IDBKeyRange;return _t(t)?Promise.resolve(t.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return"__dbnames"!==e}))})):wt(t,n).toCollection().primaryKeys()}(Mo.dependencies).then(e)}catch(e){return to(new _r.MissingAPI)}},defineClass:function(){return function(e){M(this,e)}},ignoreTransaction:function(e){return zr.trans?De(zr.transless,e):e()},vip:St,async:function(e){return function(){try{var t=Et(e.apply(this,arguments));return t&&"function"==typeof t.then?t:le.resolve(t)}catch(e){return to(e)}}},spawn:function(e,t,n){try{var r=Et(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:le.resolve(r)}catch(e){return to(e)}},currentTransaction:{get:function(){return zr.trans||null}},waitFor:function(e,t){var n=le.resolve("function"==typeof e?Mo.ignoreTransaction(e):e).timeout(t||6e4);return zr.trans?zr.trans.waitFor(n):n},Promise:le,debug:{get:function(){return dr},set:function(e){Y(e,"dexie"===e?function(){return!0}:co)}},derive:F,extend:M,props:N,override:U,Events:Fe,on:mo,liveQuery:function(e){return new Io((function(t){var n=function(){return qn(a).some((function(e){return i[e]&&function(e,t){var n=Tt(t),r=n.next();if(r.done)return!1;for(var o=r.value,i=Tt(e),a=i.next(o.from),u=a.value;!r.done&&!a.done;){if(ho(u.from,o.to)<=0&&ho(u.to,o.from)>=0)return!0;ho(o.from,u.from)<0?o=(r=n.next(u.from)).value:u=(a=i.next(o.from)).value}return!1}(i[e],a[e])}))},r=fr(e),o=!1,i={},a={},u={get closed(){return o},unsubscribe:function(){o=!0,mo.storagemutated.unsubscribe(l)}};t.start&&t.start(u);var s=!1,c=!1,l=function(e){It(i,e),n()&&f()},f=function(){if(!s&&!o){i={};var d={},h=function(t){r&&Ee();var n=function(){return Oe(e,{subscr:t,trans:null})},o=zr.trans?De(zr.transless,n):n();return r&&o.then(xe,xe),o}(d);c||(mo("storagemutated",l),c=!0),s=!0,Promise.resolve(h).then((function(e){s=!1,o||(n()?f():(i={},a=d,t.next&&t.next(e)))}),(function(e){s=!1,t.error&&t.error(e),u.unsubscribe()}))}};return f(),u}))},extendObservabilitySet:It,getByKeyPath:er,setByKeyPath:tr,delByKeyPath:function(e,t){"string"==typeof t?tr(e,t,void 0):"length"in t&&[].map.call(t,(function(t){tr(e,t,void 0)}))},shallowClone:G,deepClone:q,getObjectDiff:Eo,cmp:ho,asap:z,minKey:-1/0,addons:[],connections:io,errnames:br,dependencies:Ao,semVer:"3.2.3",version:"3.2.3".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)}))})),Mo.maxKey=bo(Mo.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(mo("storagemutated",(function(e){var t;Ro||(ao?(t=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,e):t=new CustomEvent("x-storagemutated-1",{detail:e}),Ro=!0,dispatchEvent(t),Ro=!1)})),addEventListener("x-storagemutated-1",(function(e){var t=e.detail;Ro||Mt(t)})));var Ro=!1;if("undefined"!=typeof BroadcastChannel){var No=new BroadcastChannel("x-storagemutated-1");"function"==typeof No.unref&&No.unref(),mo("storagemutated",(function(e){Ro||No.postMessage(e)})),No.onmessage=function(e){e.data&&Mt(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){mo("storagemutated",(function(e){try{Ro||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&h(self.clients.matchAll({includeUncontrolled:!0})).forEach((function(t){return t.postMessage({type:"x-storagemutated-1",changedParts:e})})))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(function(e){if("x-storagemutated-1"===e.key){var t=JSON.parse(e.newValue);t&&Mt(t.changedParts)}}));var Lo=self.document&&navigator.serviceWorker;Lo&&Lo.addEventListener("message",(function(e){var t=e.data;t&&"x-storagemutated-1"===t.type&&Mt(t.changedParts)}))}le.rejectionMapper=function(e,t){if(!e||s(e,Q)||s(e,TypeError)||s(e,SyntaxError)||!e.name||!Sr[e.name])return e;var n=new Sr[e.name](t||e.message,e);return"stack"in e&&L(n,"stack",{get:function(){return this.inner.stack}}),n},Y(dr,co);var Fo=l(766),Bo=l(685);function Uo(e){return Uo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Uo(e)}function Ko(e,t){return Ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ko(e,t)}var zo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ko(e,t)}(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Uo(e);if(t){var o=Uo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":p(n))&&"function"!=typeof t?Rt(e):t;var n}(this,n)}}(n);function n(){var e;return function(e,t){if(!s(e,t))throw new TypeError("Cannot call a class as a function")}(this,n),Nt(Rt(e=t.call(this,"EsmOffline")),"syncQueue",void 0),Nt(Rt(e),"dynamicOfflineData",void 0),e.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),e.syncQueue=e.table("syncQueue"),e.dynamicOfflineData=e.table("dynamicOfflineData"),e}return n}(Do),Vo=new zo,Go={},Ho=(0,Bo.createGlobalStore)("offline-synchronization",{});function qo(){return qo=Ut((function(){var e,t,n,r,o,i,a,u,s,c,l,f,d;return Gt(this,(function(h){switch(h.label){case 0:return Ho.getState().synchronization?[2]:[4,Vo.syncQueue.count()];case 1:e=h.sent(),t={},n=Object.entries(Go),r=n.length,o={},i=new AbortController,a=function(){var e,t,n=Ho.getState().synchronization;Ho.setState({synchronization:(e=zt({},n),t={pendingCount:n.pendingCount-1},t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e)})},h.label=2;case 2:h.trys.push([2,,10,11]),Ho.setState({synchronization:{totalCount:e,pendingCount:e,abortController:i}}),u=0,h.label=3;case 3:if(!(u<r&&n.length>0))return[3,8];s=n.length,h.label=4;case 4:return s--?(c=Vt(n[s],2),l=c[0],f=c[1],(d=f.dependsOn.map((function(e){return t[e]}))).every(Boolean)?(o[l]={},[4,Promise.all(d)]):[3,6]):[3,7];case 5:h.sent(),t[l]=function(e,t,n,r){return Wo.apply(this,arguments)}(f,o,i,a),n.splice(s,1),h.label=6;case 6:return[3,4];case 7:return u++,[3,3];case 8:return[4,Promise.allSettled(Object.values(t))];case 9:return h.sent(),[3,11];case 10:return Ho.setState({synchronization:void 0}),[7];case 11:return[2]}}))})),qo.apply(this,arguments)}function Wo(){return Wo=Ut((function(e,t,n,r){var o,i,a,u,s,c,l,f,d,h,p,y,v,m,g,b,w;return Gt(this,(function(_){switch(_.label){case 0:return o=e.type,i=e.dependsOn,a=e.process,u=[],s=[],[4,Wt()];case 1:return c=_.sent(),[4,Vo.syncQueue.where({type:o,userId:c}).each((function(e,t){u.push([t.primaryKey,e.content,e.descriptor]),s.push(e.content)}))];case 2:_.sent(),l=0,_.label=3;case 3:if(!(l<u.length))return[3,11];f=Vt(u[l],3),d=f[0],h=f[1],p=f[2],y=p.id,v=p.dependencies,m=void 0===v?[]:v,_.label=4;case 4:return _.trys.push([4,7,9,10]),[4,a(h,{abort:n,index:l,items:s,userId:c,dependencies:m.map((function(e){var n=e.id,r=e.type;return i.includes(r)?t[r][n]:void 0}))})];case 5:return g=_.sent(),void 0!==y&&(t[o][y]=g),[4,Vo.syncQueue.delete(d)];case 6:return _.sent(),[3,10];case 7:return b=_.sent(),[4,Vo.syncQueue.update(d,{lastError:{name:null==b?void 0:b.name,message:null!==(w=null==b?void 0:b.message)&&void 0!==w?w:null==b?void 0:b.toString()}})];case 8:return _.sent(),[3,10];case 9:return r(),[7];case 10:return l++,[3,3];case 11:return[2]}}))})),Wo.apply(this,arguments)}function $o(){return($o=Ut((function(){var e;return Gt(this,(function(t){switch(t.label){case 0:return[4,(0,Fo.getLoggedInUser)()];case 1:return[2,(null==(e=t.sent())?void 0:e.uuid)||"*"]}}))}))).apply(this,arguments)}function Yo(){return(Yo=Ut((function(e,t,n,r){var o;return Gt(this,(function(i){switch(i.label){case 0:return void 0===(o=r&&r.id)?[3,2]:[4,Vo.syncQueue.where({type:t,userId:e}).filter((function(e){return(null==e?void 0:e.descriptor.id)===o})).delete().catch(Do.errnames.DatabaseClosed)];case 1:i.sent(),i.label=2;case 2:return[4,Vo.syncQueue.add({type:t,content:n,userId:e,descriptor:r||{},createdOn:new Date}).catch(Do.errnames.DatabaseClosed,(function(){return-1}))];case 3:return[2,i.sent()]}}))}))).apply(this,arguments)}function Jo(){return(Jo=Ut((function(e,t,n){return Gt(this,(function(r){switch(r.label){case 0:return[4,Wt()];case 1:return[4,$t(r.sent(),e,t,n)];case 2:return[2,r.sent()]}}))}))).apply(this,arguments)}function Qo(){return(Qo=Ut((function(e,t){return Gt(this,(function(n){switch(n.label){case 0:return[4,Qt(e,t)];case 1:return[2,n.sent().map((function(e){return e.content}))]}}))}))).apply(this,arguments)}function Zo(){return(Zo=Ut((function(e,t){var n;return Gt(this,(function(r){switch(r.label){case 0:return n=t?{type:t,userId:e}:{userId:e},[4,Vo.syncQueue.where(n).toArray().catch(Do.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function Xo(){return(Xo=Ut((function(e){return Gt(this,(function(t){switch(t.label){case 0:return[4,Wt()];case 1:return[4,Jt(t.sent(),e)];case 2:return[2,t.sent()]}}))}))).apply(this,arguments)}function ei(){return(ei=Ut((function(e){return Gt(this,(function(t){switch(t.label){case 0:return[4,Wt()];case 1:return[4,Qt(t.sent(),e)];case 2:return[2,t.sent()]}}))}))).apply(this,arguments)}function ti(){return(ti=Ut((function(e){return Gt(this,(function(t){switch(t.label){case 0:return[4,Vo.syncQueue.get(e).catch(Do.errnames.DatabaseClosed,(function(){}))];case 1:return[2,t.sent()]}}))}))).apply(this,arguments)}function ni(){return(ni=Ut((function(e){var t,n,r;return Gt(this,(function(o){switch(o.label){case 0:return[4,en(e)];case 1:if(!(n=o.sent()))throw new Error("No sync item with the ID ".concat(e," exists."));if(!(r=null===(t=Go[n.type])||void 0===t?void 0:t.options.onBeginEditSyncItem))throw new Error("A sync item with the ID ".concat(e,' exists, but the associated handler (if one exists) doesn\'t support editing the item. You can avoid this error by either verifying that sync items of this type can be edited via the "canEditSynchronizationItemsOfType(type: string)" function or alternatively ensure that the synchronizaton handler for sync items of type "').concat(n.type,'" supports editing items.'));return r(n),[2]}}))}))).apply(this,arguments)}function ri(){return(ri=Ut((function(e){return Gt(this,(function(t){switch(t.label){case 0:return[4,Vo.syncQueue.delete(e).catch(Do.errnames.DatabaseClosed)];case 1:return t.sent(),[2]}}))}))).apply(this,arguments)}for(var oi,ii={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},ai=new Uint8Array(16),ui=[],si=0;si<256;++si)ui.push((si+256).toString(16).slice(1));var ci=function(e,t,n){if(ii.randomUUID&&!t&&!e)return ii.randomUUID();var r=(e=e||{}).random||(e.rng||an)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(ui[e[t+0]]+ui[e[t+1]]+ui[e[t+2]]+ui[e[t+3]]+"-"+ui[e[t+4]]+ui[e[t+5]]+"-"+ui[e[t+6]]+ui[e[t+7]]+"-"+ui[e[t+8]]+ui[e[t+9]]+"-"+ui[e[t+10]]+ui[e[t+11]]+ui[e[t+12]]+ui[e[t+13]]+ui[e[t+14]]+ui[e[t+15]]).toLowerCase()}(r)},li="OFFLINE+",fi={};function di(){return(di=fn((function(e){return dn(this,(function(t){switch(t.label){case 0:return[4,On()];case 1:return[4,vn(t.sent(),e)];case 2:return[2,t.sent()]}}))}))).apply(this,arguments)}function hi(){return(hi=fn((function(e,t){var n;return dn(this,(function(r){switch(r.label){case 0:return n=t?{type:t,users:e}:{users:e},[4,(new zo).dynamicOfflineData.where(n).toArray().catch(Do.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function pi(){return(pi=fn((function(e,t){return dn(this,(function(n){switch(n.label){case 0:return[4,On()];case 1:return[4,gn(n.sent(),e,t)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function yi(){return yi=fn((function(e,t,n){var r,o;return dn(this,(function(i){switch(i.label){case 0:return[4,(r=new zo).dynamicOfflineData.get({type:t,identifier:n}).catch(Do.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?[3,3]:[4,r.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(Do.errnames.DatabaseClosed)];case 2:return i.sent(),[3,5];case 3:return o.users.includes(e)?[3,5]:[4,r.dynamicOfflineData.update(o.id,{users:(a=o.users,function(e){if(Array.isArray(e))return cn(e)}(a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return cn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e])}).catch(Do.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}var a}))})),yi.apply(this,arguments)}function vi(){return(vi=fn((function(e,t){return dn(this,(function(n){switch(n.label){case 0:return[4,On()];case 1:return[4,wn(n.sent(),e,t)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function mi(){return mi=fn((function(e,t,n){var r,o;return dn(this,(function(i){switch(i.label){case 0:return[4,(r=new zo).dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(Do.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?o.users.length>1?[4,r.dynamicOfflineData.update(o.id,{users:o.users.filter((function(t){return t!==e}))}).catch(Do.errnames.DatabaseClosed)]:[3,3]:[3,5];case 2:return i.sent(),[3,5];case 3:return[4,r.dynamicOfflineData.delete(o.id).catch(Do.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}}))})),mi.apply(this,arguments)}function gi(){return gi=fn((function(e,t){var n;return dn(this,(function(r){switch(r.label){case 0:return[4,yn(e)];case 1:return n=r.sent(),[4,Promise.all(n.map((o=fn((function(e){return dn(this,(function(n){return[2,Sn(e.type,e.identifier,t)]}))})),function(e){return o.apply(this,arguments)})))];case 2:return r.sent(),[2]}var o}))})),gi.apply(this,arguments)}function bi(){return bi=fn((function(e,t,n){var r,o,i,a,u,s,c,l,f;return dn(this,(function(d){switch(d.label){case 0:return[4,mn(e,t)];case 1:return d.sent(),r=new zo,[4,On()];case 2:return o=d.sent(),[4,r.dynamicOfflineData.get({type:e,identifier:t}).catch(Do.errnames.DatabaseClosed,(function(){}))];case 3:return i=d.sent(),a=hn().filter((function(t){return t.type===e})),i?[4,Promise.all(a.map((h=fn((function(e){var r,o,i;return dn(this,(function(a){try{return e.sync(t,n),[2,{id:e.id,error:void 0}]}catch(t){return i=null!==(o=null===(r=t.message)||void 0===r?void 0:r.toString())&&void 0!==o?o:t.toString(),[2,{id:e.id,error:i}]}return[2]}))})),function(e){return h.apply(this,arguments)})))]:[2];case 4:return u=d.sent(),s=u.filter((function(e){return!e.error})).map((function(e){return e.id})),c=u.filter((function(e){return e.error})).map((function(e){return e.id})),l=u.filter((function(e){return e.error})).map((function(e){return{handlerId:e.id,message:e.error}})),f={syncedOn:new Date,syncedBy:o,succeededHandlers:s,erroredHandlers:c,errors:l},i.id?[4,r.dynamicOfflineData.update(i.id,{syncState:f}).catch(Do.errnames.DatabaseClosed)]:[3,6];case 5:d.sent(),d.label=6;case 6:return[2]}var h}))})),bi.apply(this,arguments)}function wi(){return(wi=fn((function(){var e;return dn(this,(function(t){switch(t.label){case 0:return[4,(0,Fo.getLoggedInUser)()];case 1:if(!(e=t.sent().uuid))throw new Error("Using the dynamic offline data API requires a logged in user.");return[2,e]}}))}))).apply(this,arguments)}var _i=(0,Bo.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function Si(){return Si=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){En(i,r,o,a,u,"next",e)}function u(e){En(i,r,o,a,u,"throw",e)}a(void 0)}))}}((function(e){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(t){switch(t.label){case 0:return jn(),[4,Sn("patient",e)];case 1:return t.sent(),[2]}}))})),Si.apply(this,arguments)}}(),y}())}}}))},254:function(e){"use strict";e.exports=u},45:function(e){"use strict";e.exports=v},513:function(e){"use strict";e.exports=b},740:function(e){"use strict";e.exports=w},685:function(e){"use strict";e.exports=S},901:function(e){"use strict";e.exports=O},688:function(e){"use strict";e.exports=E},64:function(e){"use strict";e.exports=x},954:function(e){"use strict";e.exports=k},493:function(e){"use strict";e.exports=P},792:function(e){"use strict";e.exports=j}},o={};function A(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e].call(n.exports,n,n.exports,A),n.exports}A.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return A.d(t,{a:t}),t},A.d=function(e,t){for(var n in t)A.o(t,n)&&!A.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},A.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),A.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},A.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var T={};return function(){"use strict";var r=function(e,t){var n=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");n&&(n.id=e,Xr.appendChild(n))},o=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},u=function(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}},v=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},b=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},w=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},S=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":y(e)},O=function(e,t,n){var r=P(e,t,n);vo.length?vo.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))},E=function(e){if("function"!=typeof e)throw Error(k(28,!1));vo.push(e)},x=function(e){if("function"!=typeof e)throw Error(k(29,!1));var t=!1;return vo=vo.filter((function(n){var r=n===e;return t=t||r,!r})),t},k=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},P=function(e,t,n){var r,o,i,a="".concat(I(t)," '").concat(D(t),"' died in status ").concat(t.status,": ");if(o=e,null!=(i=Error)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?i[Symbol.hasInstance](o):l(o,i)){try{e.message=a+e.message}catch(e){}r=e}else{console.warn(k(30,!1,t.status,D(t)));try{r=Error(a+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=D(t),t.status=n,r},j=function(e){return e.status===Oo},T=function(e){try{return e.activeWhen(window.location)}catch(t){return O(t,e,jo),!1}},D=function(e){return e.name},C=function(e){return Boolean(e.unmountThisParcel)},I=function(e){return C(e)?"parcel":"application"},M=function(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]},R=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null},N=function(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!R(t,(function(e){return"function"!=typeof e}))));var t},L=function(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=I(e),o=D(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return F(n)?n:Promise.reject(k(15,!1,r,o,t,a))}))}),Promise.resolve())}},F=function(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch},B=function(e,t){var n=function(){return e.status=_o,e};return Promise.resolve().then((function(){return e.status!==bo?e:(e.status=wo,e.bootstrap?J(e,"bootstrap").then(n).catch((function(n){if(t)throw P(n,e,jo);return O(n,e,jo),e})):Promise.resolve().then(n))}))},U=function(e,t){return Promise.resolve().then((function(){var n=function(){return J(e,"unmount").then((function(){e.status=_o}),(function(n){if(t)throw P(n,e,jo);O(n,e,jo)}))};if(e.status!==Oo)return e;e.status=xo;var r=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(t)throw P(n,e,jo);O(n,e,jo)}))})).then((function(){return e}))}))},K=function(e,t){return Promise.resolve().then((function(){return e.status!==_o?e:(To||(window.dispatchEvent(new yo("single-spa:before-first-mount")),To=!0),e.status=So,J(e,"mount").then((function(){return e.status=Oo,Do||(window.dispatchEvent(new yo("single-spa:first-mount")),Do=!0),e})).catch((function(n){var r=function(){if(t)throw P(n,e,jo);return O(n,e,jo),e};return e.status=Oo,U(e,!0).then(r,r)})))}))},z=function(){return V.apply(Io,arguments)},V=function(e,t){var n=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(k(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(k(3,!1,S(e.name)));var r=Co++,o=e.name||"parcel-".concat(r);if("object"!=typeof t)throw Error(k(4,!1,o,void 0===t?"undefined":S(t)));if(!t.domElement)throw Error(k(5,!1,o));var i,a="function"==typeof e,u=a?e:function(){return Promise.resolve(e)},s={id:r,parcels:{},status:a?go:bo,customProps:t,parentName:D(n),unmountThisParcel:function(){return h.then((function(){if(s.status!==Oo)throw Error(k(6,!1,o,s.status));return U(s,!0)})).then((function(e){return s.parentName&&delete n.parcels[s.id],e})).then((function(e){return l(e),e})).catch((function(e){throw s.status=jo,f(e),e}))}};n.parcels[r]=s;var c=u();if(!c||"function"!=typeof c.then)throw Error(k(7,!1));c=c.then((function(e){if(!e)throw Error(k(8,!1));if(o=e.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!N(e.bootstrap))throw Error(k(9,!1,o));if(!N(e.mount))throw Error(k(10,!1,o));if(!N(e.unmount))throw Error(k(11,!1,o));if(e.update&&!N(e.update))throw Error(k(12,!1,o));var t=L(e,"bootstrap"),n=L(e,"mount"),a=L(e,"unmount");s.status=bo,s.name=o,s.bootstrap=t,s.mount=n,s.unmount=a,s.timeouts=Q(e.timeouts),e.update&&(s.update=L(e,"update"),i.update=function(e){return s.customProps=e,G((t=s,Promise.resolve().then((function(){if(t.status!==Oo)throw Error(k(32,!1,D(t)));return t.status=Eo,J(t,"update").then((function(){return t.status=Oo,t})).catch((function(e){throw P(e,t,jo)}))}))));var t})}));var l,f,d=c.then((function(){return B(s,!0)})),h=d.then((function(){return K(s,!0)})),p=new Promise((function(e,t){l=e,f=t}));return i={mount:function(){return G(Promise.resolve().then((function(){if(s.status!==_o)throw Error(k(13,!1,o,s.status));return n.parcels[r]=s,K(s)})))},unmount:function(){return G(s.unmountThisParcel())},getStatus:function(){return s.status},loadPromise:G(c),bootstrapPromise:G(d),mountPromise:G(h),unmountPromise:G(p)}},G=function(e){return e.then((function(){return null}))},H=function(e){var t=D(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(k(40,!1),t,n));var r=M({},n,{name:t,mountParcel:V.bind(e),singleSpa:ho});return C(e)&&(r.unmountSelf=e.unmountThisParcel),r},q=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(k(16,!1));Mo.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},W=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(k(17,!1));Mo.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},$=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(k(18,!1));Mo.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},Y=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(k(19,!1));Mo.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},J=function(e,t){var n=e.timeouts[t],r=n.warningMillis,o=I(e);return new Promise((function(i,a){var u=!1,s=!1;e[t](H(e)).then((function(e){u=!0,i(e)})).catch((function(e){u=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=k(31,!1,t,o,D(e),n.millis);function l(e){if(!u)if(!0===e)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))},Q=function(e){var t={};for(var n in Mo)t[n]=M({},Mo[n],e&&e[n]||{});return t},Z=function(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==mo&&e.status!==Po?e:(e.status=go,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(H(e));if(!F(r))throw n=!0,Error(k(33,!1,D(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!=typeof(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!N(t.bootstrap)&&(r=35),N(t.mount)||(r=36),N(t.unmount)||(r=37);var o=I(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error(k(r,!1,o,D(e),i),t),O(void 0,e,jo),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=M({},e.devtools.overlays,t.devtools.overlays)),e.status=bo,e.bootstrap=L(t,"bootstrap"),e.mount=L(t,"mount"),e.unmount=L(t,"unmount"),e.unload=L(t,"unload"),e.timeouts=Q(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=jo:(r=Po,e.loadErrorTime=(new Date).getTime()),O(t,e,r),e})));var t,n}))},X=function(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(k(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=oe(window.location.href),r=oe(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)},ee=function(e){var t=this;if(e){var n=e[0].type;Lo.indexOf(n)>=0&&No[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}},te=function(){Wo([],arguments)},ne=function(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return fo&&n===o||window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}},re=function(e){if(Bo)throw Error(k(43,!1));fo=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,Bo=!0,Fo=window.history.replaceState,window.addEventListener("hashchange",te),window.addEventListener("popstate",te);var t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&Lo.indexOf(e)>=0)||R(No[e],(function(e){return e===n})))return t.apply(this,arguments);No[e].push(n)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&Lo.indexOf(e)>=0))return n.apply(this,arguments);No[e]=No[e].filter((function(e){return e!==t}))},window.history.pushState=ne(window.history.pushState,"pushState"),window.history.replaceState=ne(Fo,"replaceState")},oe=function(e){var t=document.createElement("a");return t.href=e,t},ie=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!Uo){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return ae.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return ae.call(this,n,window.removeEventListener,e,t,arguments)},Uo=!0}},ae=function(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){Lo.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))},ue=function(e){return Promise.resolve().then((function(){var t=Ko[D(e)];if(!t)return e;if(e.status===mo)return se(e,t),e;if(e.status===ko)return t.promise.then((function(){return e}));if(e.status!==_o&&e.status!==Po)return e;var n=e.status===Po?Promise.resolve():J(e,"unload");return e.status=ko,n.then((function(){return se(e,t),e})).catch((function(n){return function(e,t,n){delete Ko[D(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,O(n,e,jo),t.reject(n)}(e,t,n),e}))}))},se=function(e,t){delete Ko[D(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=mo,t.resolve()},ce=function(e,t,n,r){Ko[D(e)]={app:e,resolve:n,reject:r},Object.defineProperty(Ko[D(e)],"promise",{get:t})},le=function(e){return Ko[e]},fe=function(){return zo.filter(j).map(D)},de=function(){return zo.map(D)},he=function(e){var t=R(zo,(function(t){return D(t)===e}));return t?t.status:null},pe=function(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(k(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error(k(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error(k(20,!1));if("object"!=typeof e.app&&"function"!=typeof e.app)throw Error(k(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(k(24,!1));if(!be(e.customProps))throw Error(k(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(k(20,!1));if(!t)throw Error(k(23,!1));if("function"!=typeof n)throw Error(k(24,!1));if(!be(r))throw Error(k(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:we(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(Ee()||Vo||(Vo=!0,setTimeout((function(){Ee()||console.warn(k(1,!1))}),5e3)),-1!==de().indexOf(o.name))throw Error(k(21,!1,o.name));zo.push(M({loadErrorTime:null,status:mo,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),Ro&&(ie(),Wo())},ye=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return zo.filter((function(t){return t.activeWhen(e)})).map(D)},ve=function(e){if(0===zo.filter((function(t){return D(t)===e})).length)throw Error(k(25,!1,e));return(Ro?me(e,{waitForUnmount:!1}):Promise.resolve()).then((function(){var t=zo.map(D).indexOf(e);zo.splice(t,1)}))},me=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error(k(26,!1));var n=R(zo,(function(t){return D(t)===e}));if(!n)throw Error(k(27,!1,e));var r,o=le(D(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){ce(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,ge(n,o.resolve,o.reject)):r=new Promise((function(e,t){ce(n,(function(){return r}),e,t),ge(n,e,t)})),r},ge=function(e,t,n){Promise.resolve().then((function(){if(R(ye(),(function(t){return t===D(e)})))return _e()})).then((function(){return U(e).then(ue).then((function(){t(),setTimeout((function(){Wo()}))}))})).catch(n)},be=function(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},we=function(e,t){var n=function(e,t){var n=function(n){var a=e.slice(r,n).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(i+=o?"[^/]+/?":a,n===e.length)if(o)t&&(i+="$");else{var u=t?"":".*";i="/"===i.charAt(i.length-1)?"".concat(i).concat(u,"$"):"".concat(i,"(/").concat(u,")?(#.*)?$")}o=!o,r=n},r=0,o=!1,i="^";"/"!==e[0]&&(e="/"+e);for(var a=0;a<e.length;a++){var u=e[a];(!o&&":"===u||o&&"/"===u)&&n(a)}return n(e.length),new RegExp(i,"i")}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}},_e=function(){return Wo()},Se=function(e,t){return T(e)?B(e).then((function(e){return t.then((function(){return T(e)?K(e):e}))})):t.then((function(){return e}))},Oe=function(e){$o=!0,Ro&&(re(e),Wo())},Ee=function(){return $o},xe=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},ke=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xe(Object(n),!0).forEach((function(t){Pe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},Pe=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},je=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},Ae=function(){return Mi.apply(this,arguments)},Te=function(e,t){return function(n){if(!e(n))return"function"==typeof t?t(n):t}},De=function(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]},Ce=function(e){return function t(n){return 0===arguments.length||De(n)?t:e.apply(this,arguments)}},Ie=function(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return De(n)?t:Ce((function(t){return e(n,t)}));default:return De(n)&&De(r)?t:De(n)?Ce((function(t){return e(t,r)})):De(r)?Ce((function(t){return e(n,t)})):e(n,r)}}},Me=function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n},Re=function(e,t,n){for(var r=0,o=n.length;r<o;){if(e(t,n[r]))return!0;r+=1}return!1},Ne=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)},Le=function(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":void 0===e?"undefined":y(e)},Fe=function(e,t,n,r){var o=function(e,t){return _a(e,t,n.slice(),r.slice())},i=Me(e);return!Re((function(e,t){return!Re(o,t,e)}),Me(t),i)},Be=function(e){return function t(n,r,o){switch(arguments.length){case 0:return t;case 1:return De(n)?t:Ie((function(t,r){return e(n,t,r)}));case 2:return De(n)&&De(r)?t:De(n)?Ie((function(t,n){return e(t,r,n)})):De(r)?Ie((function(t,r){return e(n,t,r)})):Ce((function(t){return e(n,r,t)}));default:return De(n)&&De(r)&&De(o)?t:De(n)&&De(r)?Ie((function(t,n){return e(t,n,o)})):De(n)&&De(o)?Ie((function(t,n){return e(t,r,n)})):De(r)&&De(o)?Ie((function(t,r){return e(n,t,r)})):De(n)?Ce((function(t){return e(t,r,o)})):De(r)?Ce((function(t){return e(n,t,o)})):De(o)?Ce((function(t){return e(n,r,t)})):e(n,r,o)}}},Ue=function(e,t,n){for(var r=n.next();!r.done;){if((t=e["@@transducer/step"](t,r.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r=n.next()}return e["@@transducer/result"](t)},Ke=function(e,t,n,r){return e["@@transducer/result"](n[r](Da(e["@@transducer/step"],e),t))},ze=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Ve=function(e){return(0,Jo.getGlobalStore)("config-module-".concat(e),{config:null,loaded:!1,translationOverridesLoaded:!1})},Ge=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},He=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},qe=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){He(e,t,n[t])}))}return e},We=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},$e=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||Je(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},Ye=function(e){return function(e){if(Array.isArray(e))return Ge(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Je(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},Je=function(e,t){if(e){if("string"==typeof e)return Ge(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ge(e,t):void 0}},Qe=function(e,t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(e.schemas)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=Ve(u);if(e.moduleLoaded[u]){var c=ot(u,e,t);s.setState({translationOverridesLoaded:!0,loaded:!0,config:c})}else{var l=it(u,e,t);s.setState({translationOverridesLoaded:!0,loaded:!1,config:l})}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}},Ze=function(e,t){var n,r,o=(n=ut(rt(e,t)),function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=$e(o.value,2),u=a[0],s=a[1],c=!0,l=!1,f=void 0;try{for(var d,h=Object.entries(s)[Symbol.iterator]();!(c=(d=h.next()).done);c=!0){var p=$e(d.value,2),y=p[0];nt(p[1],u,y)}}catch(e){l=!0,f=e}finally{try{c||null==h.return||h.return()}finally{if(l)throw f}}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}(r=Object.keys(n).reduce((function(e,t){var r,o;return(null===(r=n[t])||void 0===r?void 0:r.extensionSlots)&&(e[t]=null===(o=n[t])||void 0===o?void 0:o.extensionSlots),e}),{})),Object.keys(r).reduce((function(e,t){return qe({},e,r[t])}),{})),i=Object.fromEntries(Object.entries(o).map((function(e){var t=$e(e,2);return[t[0],{loaded:!0,config:t[1]}]}))),a=(0,Jo.getGlobalStore)("config-extension-slots",{slots:{}}),u=a.getState(),s={slots:qe({},u.slots,i)};Oa(u,s)||a.setState(s)},Xe=function(e,t){var n=function(e,t){var n=Ya(xa(e.schemas)),r=Ye(e.providedConfigs.map((function(e){return[e.config,e.source]}))).concat([[t.config,"temporary config"]]),o=!0,i=!1,a=void 0;try{for(var u,s=r[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=$e(u.value,2);n=ut([n,Ja(c[0],c[1])])}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return n}(e,t);$a.setState({config:n})},et=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=t.mountedExtensions[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value,l=tt(c.slotModuleName,c.extensionModuleName,c.slotName,c.extensionId,e,n);r[c.slotName]=We(qe({},r[c.slotName]),He({},c.extensionId,{config:l,loaded:!0}))}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}(0,Jo.getGlobalStore)("config-extensions",{configs:{}}).setState({configs:r})},tt=function(e,t,n,r,o,i){var a,u,s,c,l=function(e){return $e(e.split("#"),1)[0]}(r),f=o.schemas[l],d=f?l:t,h=rt(o,i),p=at(e,h),y=null!==(c=null==p||null===(a=p.extensionSlots)||void 0===a||null===(u=a[n])||void 0===u||null===(s=u.configure)||void 0===s?void 0:s[r])&&void 0!==c?c:{},v=ut([at(d,h),y]),m=null!=f?f:o.schemas[t];st(m,v,d);var g=Xa(m,v);return Za(m,g,d),delete g.extensionSlots,g},nt=function(e,t,n){var r="".concat(t,".extensionSlots.").concat(n),o="Extension slot config '".concat(r,"'"),i=Object.keys(e).filter((function(e){return!["add","remove","order","configure"].includes(e)}));i.length&&ht(r,o+"' contains invalid keys '".concat(i.join("', '"),"'")),e.add&&(Array.isArray(e.add)&&e.add.every((function(e){return"string"==typeof e}))||ht(r,o+".add' is invalid. Must be an array of strings (extension IDs)")),e.remove&&(Array.isArray(e.remove)&&e.remove.every((function(e){return"string"==typeof e}))||ht(r,o+".remove' is invalid. Must be an array of strings (extension IDs)")),e.order&&(Array.isArray(e.order)&&e.order.every((function(e){return"string"==typeof e}))||ht(r,o+".order' is invalid. Must be an array of strings (extension IDs)")),e.configure&&(dt(e.configure)||ht(r,o+".configure' is invalid. Must be an object with extension IDs for keys"))},rt=function(e,t){return Ye(e.providedConfigs.map((function(e){return e.config}))).concat([t.config])},ot=function(e,t,n){var r=t.schemas[e],o=at(e,rt(t,n));st(r,o,e);var i=Xa(r,o);return Za(r,i,e),delete i.extensionSlots,i},it=function(e,t,n){var r=at(e,rt(t,n)),o=Xa(nu,r);return Za(nu,o,e),delete o.extensionSlots,o},at=function(e,t){var n=t.map((function(t){return t[e]})).filter((function(e){return!!e}));return ut(n)},ut=function(e){return Ia(Fa)({},e)},st=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=t[s],l=n+"."+s,f=e[s];e.hasOwnProperty(s)?Qa(f,c,l):"extensionSlots"===s&&""!==n||ht(l,"Unknown config key '".concat(l,"' provided. Ignoring."))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}},ct=function(e,t,n){return!t||lt(e,[{Array:Ba,Boolean:Ua,ConceptUuid:Ga,Number:Ka,Object:Va,String:za,UUID:Ga,PersonAttributeTypeUuid:Ga,PatientIdentifierTypeUuid:Ga}[t]],n)},lt=function(e,t,n){var r=!0;if(t)try{var o=!0,i=!1,a=void 0;try{for(var u,s=t[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=(0,u.value)(n);"string"==typeof c&&(ht(e,"object"==typeof n?"Invalid configuration for ".concat(e,": ").concat(c):"Invalid configuration value ".concat(n," for ").concat(e,": ").concat(c)),r=!1)}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}}catch(t){console.error('Skipping invalid validator at "'.concat(e,'". Encountered error\n\t').concat(t))}return r},ft=function(e){return!!e&&Object.keys(e).filter((function(e){return!["_default","_validators"].includes(e)})).length>0},dt=function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e},ht=function(e,t){var n="".concat(e,":::").concat(t);eu.has(n)||(console.error(t),eu.add(n))},pt=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},yt=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},vt=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},mt=function(e){var t=this.__data__=new uu(e);this.size=t.size},gt=function(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Fu;++t<n;)this.add(e[t])},bt=function(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):l(e,t)},wt=function(e){var t=[],n=!0,r=!1,o=void 0;try{for(var i,a=Object.values(e.extensions)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var u=i.value,s=!0,c=!1,l=void 0;try{for(var f,d=u.instances[Symbol.iterator]();!(s=(f=d.next()).done);s=!0){var h=f.value;t.push({slotModuleName:h.slotModuleName,extensionModuleName:u.moduleName,slotName:h.slotName,extensionId:h.id})}}catch(e){c=!0,l=e}finally{try{s||null==d.return||d.return()}finally{if(c)throw l}}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}Ys(Yr.configExtensionStore.getState().mountedExtensions,t)||Yr.configExtensionStore.setState({mountedExtensions:t})},_t=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},St=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||Et(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},Ot=function(e){return function(e){if(Array.isArray(e))return _t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Et(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},Et=function(e,t){if(e){if("string"==typeof e)return _t(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_t(e,t):void 0}},xt=function(e,t,n){var r={},o=!0,i=!1,a=void 0;try{for(var u,s=Object.entries(e.slots)[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=St(u.value,2),l=c[0],f=c[1],d=jt(l,e,(0,Yr.getExtensionSlotConfigFromStore)(t,f.name).config,n);r[l]={moduleName:f.moduleName,assignedExtensions:d}}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}Ys(ec.getState().slots,r)||ec.setState({slots:r})},kt=function(e){return St(e.split("#"),1)[0]},Pt=function(e,t,n,r){var o=t.indexOf(e);if(-1!==o)return o;if(void 0!==n)return 1e3+n;var i=r.indexOf(e);return-1!==i?2e3+i:-1},jt=function(e,t,n,r){var o=function(e,t){var n=e.add||[],r=e.remove||[],o=e.order||[],i=Xs.getState().extensions;return Ot(t).concat(Ot(n)).filter((function(e){return!r.includes(e)})).sort((function(e,n){var r,a,u=Pt(e,o,null===(r=i[kt(e)])||void 0===r?void 0:r.order,t),s=Pt(n,o,null===(a=i[kt(n)])||void 0===a?void 0:a.order,t);return-1===s?-1:-1===u?1:u-s}))}(n,t.slots[e].attachedIds),i=[],a=void 0,u=!0,s=!1,c=void 0;try{for(var l,f=o[Symbol.iterator]();!(u=(l=f.next()).done);u=!0){var d=l.value,h=(0,Yr.getExtensionConfigFromStore)(r,e,d).config,p=kt(d),y=t.extensions[p];if(y){var v,m,g,b,w,_,S,O,E,x=null!==(w=null!==(b=null==h||null===(v=h["Display conditions"])||void 0===v?void 0:v.privileges)&&void 0!==b?b:y.privileges)&&void 0!==w?w:[];if(x&&("string"==typeof x||Array.isArray(x)&&x.length>0)){var k;if(Js(a)&&(a=null===(k=(0,Xi.getSessionStore)().getState().session)||void 0===k?void 0:k.user),!a)continue;if(!(0,Xi.userHasAccess)(x,a))continue}i.push({id:d,name:p,moduleName:y.moduleName,config:h,featureFlag:y.featureFlag,meta:y.meta,online:null===(S=null!==(_=null==h||null===(m=h["Display conditions"])||void 0===m?void 0:m.online)&&void 0!==_?_:y.online)||void 0===S||S,offline:null!==(E=null!==(O=null==h||null===(g=h["Display conditions"])||void 0===g?void 0:g.offline)&&void 0!==O?O:y.offline)&&void 0!==E&&E})}}}catch(e){s=!0,c=e}finally{try{u||null==f.return||f.return()}finally{if(s)throw c}}return i},At=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Tt=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Dt=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Tt(e,t,n[t])}))}return e},Ct=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return At(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?At(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},It=function(e,t){return"object"!=typeof t||ic(t).forEach((function(n){e[n]=t[n]})),e},Mt=function(e,t){return sc.call(e,t)},Rt=function(e,t){"function"==typeof t&&(t=t(uc(e))),("undefined"==typeof Reflect?ic:Reflect.ownKeys)(t).forEach((function(n){Nt(e,n,t[n])}))},Nt=function(e,t,n,r){cc(e,t,It(n&&Mt(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))},Lt=function(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Nt(e.prototype,"constructor",e),{extend:Rt.bind(null,e.prototype)}}}},Ft=function(e,t,n){return dc.call(e,t,n)},Bt=function(e,t){return t(e)},Ut=function(e){if(!e)throw new Error("Assertion Failed")},Kt=function(e){oc.setImmediate?setImmediate(e):setTimeout(e,0)},zt=function(e,t){return e.reduce((function(e,n,r){var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})},Vt=function(e){var t={};for(var n in e)Mt(e,n)&&(t[n]=e[n]);return t},Gt=function(e){return yc.apply([],e)},Ht=function(e){gc="undefined"!=typeof WeakMap&&new WeakMap;var t=bc(e);return gc=null,t},qt=function(e){return wc.call(e).slice(8,-1)},Wt=function(e){var t,n,r,o;if(1===arguments.length){if(ac(e))return e.slice();if(this===Oc&&"string"==typeof e)return[e];if(o=Sc(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n},$t=function(e,t){xc=e,kc=t},Yt=function(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(kc).map((function(e){return"\n"+e})).join("")):""},Jt=function(e,t){this._e=jc(),this.name=e,this.message=t},Qt=function(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")},Zt=function(e,t,n,r){this._e=jc(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Qt(e,t)},Xt=function(e,t){this._e=jc(),this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=Qt(e,t)},en=function(){},tn=function(e){return e},nn=function(e,t){return null==e||e===tn?t:function(n){return t(e(n))}},rn=function(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}},on=function(e,t){return e===en?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?rn(r,this.onsuccess):r),o&&(this.onerror=this.onerror?rn(o,this.onerror):o),void 0!==i?i:n}},an=function(e,t){return e===en?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?rn(n,this.onsuccess):n),r&&(this.onerror=this.onerror?rn(r,this.onerror):r)}},un=function(e,t){return e===en?t:function(n){var r=e.apply(this,arguments);It(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?rn(o,this.onsuccess):o),i&&(this.onerror=this.onerror?rn(i,this.onerror):i),void 0===r?void 0===a?void 0:a:It(r,a)}},sn=function(e,t){return e===en?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}},cn=function(e,t){return e===en?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return t.apply(r,i)}))}return t.apply(this,arguments)}},ln=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=en,this._lib=!1;var t=this._PSD=tl;if(xc&&(this._stackHolder=jc(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Lc)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&dn(this,this._value))}this._state=null,this._value=null,++t.ref,al(this,e)},fn=function(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o},dn=function(e,t){if(Qc.push(t),null===e._state){var n=e._lib&&gn();t=Xc(t),e._state=!1,e._value=t,xc&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((function(){var n=fc(t,"stack");t._promise=e,Nt(t,"stack",{get:function(){return Hc?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){Jc.some((function(t){return t._value===e._value}))||Jc.push(e)}(e),hn(e),n&&bn()}},hn=function(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)pn(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===rl&&(++rl,Wc((function(){0==--rl&&wn()}),[]))},pn=function(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++rl,Wc(yn,[n,e,t])}else e._listeners.push(t)},yn=function(e,t,n){try{Zc=t;var r,o=t._value;t._state?r=e(o):(Qc.length&&(Qc=[]),r=e(o),-1===Qc.indexOf(o)&&function(e){for(var t=Jc.length;t;)if(Jc[--t]._value===e._value)return void Jc.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{Zc=null,0==--rl&&wn(),--n.psd.ref||n.psd.finalize()}},vn=function(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)},mn=function(){gn()&&bn()},gn=function(){var e=$c;return $c=!1,Yc=!1,e},bn=function(){var e,t,n;do{for(;nl.length>0;)for(e=nl,nl=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(nl.length>0);$c=!0,Yc=!0},wn=function(){var e=Jc;Jc=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=ol.slice(0),n=t.length;n;)t[--n]()},_n=function(e){return new ln(Lc,!1,e)},Sn=function(e,t){var n=tl;return function(){var r=gn(),o=tl;try{return An(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{An(o,!1),r&&bn()}}},On=function(e,t,n,r){var o=tl,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++hl;var a=el.env;i.env=Gc?{Promise:ln,PromiseProp:{value:ln,configurable:!0,writable:!0},all:ln.all,race:ln.race,allSettled:ln.allSettled,any:ln.any,resolve:ln.resolve,reject:ln.reject,nthen:Mn(a.nthen,i),gthen:Mn(a.gthen,i)}:{},t&&It(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=Dn(i,e,n,r);return 0===i.ref&&i.finalize(),u},En=function(){return sl.id||(sl.id=++cl),++sl.awaits,sl.echoes+=100,sl.id},xn=function(){return!!sl.awaits&&(0==--sl.awaits&&(sl.id=0),sl.echoes=100*sl.awaits,!0)},kn=function(e){return sl.echoes&&e&&e.constructor===Vc?(En(),e.then((function(e){return xn(),e}),(function(e){return xn(),pl(e)}))):e},Pn=function(e){++dl,sl.echoes&&0!=--sl.echoes||(sl.echoes=sl.id=0),ll.push(tl),An(e,!0)},jn=function(){var e=ll[ll.length-1];ll.pop(),An(e,!1)},An=function(e,t){var n=tl;if((t?!sl.echoes||fl++&&e===tl:!fl||--fl&&e===tl)||Cn(t?Pn.bind(null,e):jn),e!==tl&&(tl=e,n===el&&(el.env=Tn()),Gc)){var r=el.env.Promise,o=e.env;Uc.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(oc,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}},Tn=function(){var e=oc.Promise;return Gc?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(oc,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Uc.then,gthen:e.prototype.then}:{}},Dn=function(e,t,n,r,o){var i=tl;try{return An(e,!0),t(n,r,o)}finally{An(i,!1)}},Cn=function(e){zc.call(Bc,e)},In=function(e,t,n,r){return"function"!=typeof e?e:function(){var o=tl;n&&En(),An(t,!0);try{return e.apply(this,arguments)}finally{An(o,!1),r&&Cn(xn)}}},Mn=function(e,t){return function(n,r){return e.call(this,In(n,t),In(r,t))}},Rn=function(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(oc.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),It(r,o)):oc.CustomEvent&&It(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&oc.dispatchEvent&&(dispatchEvent(r),!oc.PromiseRejectionEvent&&oc.onunhandledrejection))try{oc.onunhandledrejection(r)}catch(e){}xc&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: ".concat(e.stack||e))}catch(e){}},Nn=function(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t},Ln=function(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=Ht(t))[e],t}},Fn=function(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e)return function(e){ic(e).forEach((function(t){var n=e[t];if(ac(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Mc.InvalidArgument("Invalid event config");var r=i(t,tn,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){Kt((function(){e.apply(null,t)}))}))}))}}))}(e);r||(r=sn),o||(o=en);var a={subscribers:[],fire:o,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=r(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter((function(t){return t!==e})),a.fire=a.subscribers.reduce(r,o)}};return t[e]=n[e]=a,a}},Bn=function(e,t){return Lt(t).from({prototype:e}),t},Un=function(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)},Kn=function(e,t){e.filter=Nn(e.filter,t)},zn=function(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return Nn(r(),t())}:t,e.justLimit=n&&!r},Vn=function(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new Mc.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n},Gn=function(e,t,n){var r=Vn(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})},Hn=function(e,t,n,r){var o=e.replayFilter?Nn(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},a=function(e,n,r){if(!o||o(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),Mt(i,u)||(i[u]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),qn(Gn(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return qn(Gn(e,r,n),Nn(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)},qn=function(e,t,n,r){var o=Sn(r?function(e,t,o){return n(r(e),t,o)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=en}),(function(t){e.fail(t),n=en}))||o(e.value,e,(function(e){return n=e})),n()}))}))},Wn=function(e){var t=void 0===e?"undefined":y(e);if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";var n=qt(e);return"ArrayBuffer"===n?"binary":n},$n=function(e){return l(e,Uint8Array)?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)},Yn=function(e,t){return e<t?-1:e===t?0:1},Jn=function(e,t){return e>t?-1:e===t?0:1},Qn=function(e,t,n){var r=l(e,jl)?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r},Zn=function(e){return new e.Collection(e,(function(){return nr("")})).limit(0)},Xn=function(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),u=-1,s=0;s<a;++s){var c=t[s];if(c!==r[s])return o(e[s],n[s])<0?e.substr(0,s)+n[s]+n.substr(s+1):o(e[s],r[s])<0?e.substr(0,s)+r[s]+n.substr(s+1):u>=0?e.substr(0,u)+t[u]+n.substr(u+1):null;o(e[s],c)<0&&(u=s)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)},er=function(e,t,n,r){var o,i,a,u,s,c,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return Qn(e,"String expected.");function d(e){o=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),i=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?Yn:Jn;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),s=t.map((function(e){return e.lower})),c=e,l="next"===e?"":r}d("next");var h=new e.Collection(e,(function(){return tr(u[0],s[f-1]+r)}));h._ondirectionchange=function(e){d(e)};var p=0;return h._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var d=i(o);if(t(d,s,p))return!0;for(var h=null,y=p;y<f;++y){var v=Xn(o,d,u[y],s[y],a,c);null===v&&null===h?p=y+1:(null===h||a(h,v)>0)&&(h=v)}return n(null!==h?function(){e.continue(h+l)}:r),!1})),h},tr=function(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}},nr=function(e){return{type:1,lower:e,upper:e}},rr=function(e){return Sn((function(t){return or(t),e(t.target.error),!1}))},or=function(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()},ir=function(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+ar(t)}},ar=function(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""},ur=function(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:zt(n,(function(e){return[e.name,e]}))}},sr=function(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return hc(t,e)}}(e):function(t){return hc(t,e)}},cr=function(e){return[].slice.call(e)},lr=function(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")},fr=function(e,t){var n=e._novip,r=t.db,o=function(e,t,n,r){var o=n.IDBKeyRange,i=(n.indexedDB,function(e,t){return t.reduce((function(e,t){return f({},e,(0,t.create)(e))}),e)}(function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,o=e.lowerOpen,i=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!i)}var o=function(e,t){var n=cr(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=ac(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:sr(t)},indexes:cr(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry,o=e.keyPath,a={name:t,compound:ac(o),keyPath:o,unique:n,multiEntry:r,extractKey:sr(o)};return i[lr(o)]=a,a})),getIndexByKeyPath:function(e){return i[lr(e)]}};return i[":id"]=a.primaryKey,null!=t&&(i[lr(t)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),i=o.schema,a=o.hasGetAll,u=i.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var n=e.trans,o=e.type,i=e.keys,a=e.values,u=e.range;return new Promise((function(e,s){e=Sn(e);var c=n.objectStore(t),l=null==c.keyPath,f="put"===o||"add"===o;if(!f&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var d,p=(i||a||{length:1}).length;if(i&&a&&i.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var y=[],v=[],m=0,g=function(e){++m,or(e)};if("deleteRange"===o){if(4===u.type)return e({numFailures:m,failures:v,results:[],lastResult:void 0});3===u.type?y.push(d=c.clear()):y.push(d=c.delete(r(u)))}else{var b=h(f?l?[a,i]:[a,null]:[i,null],2),w=b[0],_=b[1];if(f)for(var S=0;S<p;++S)y.push(d=_&&void 0!==_[S]?c[o](w[S],_[S]):c[o](w[S])),d.onerror=g;else for(var O=0;O<p;++O)y.push(d=c[o](w[O])),d.onerror=g}var E=function(t){var n=t.target.result;y.forEach((function(e,t){return null!=e.error&&(v[t]=e.error)})),e({numFailures:m,failures:v,results:"delete"===o?i:y.map((function(e){return e.result})),lastResult:n})};d.onerror=function(e){g(e),E(e)},d.onsuccess=E}))},getMany:function(e){var n=e.trans,r=e.keys;return new Promise((function(e,o){e=Sn(e);for(var i,a=n.objectStore(t),u=r.length,s=new Array(u),c=0,l=0,f=function(t){var n=t.target;s[n._pos]=n.result,++l===c&&e(s)},d=rr(o),h=0;h<u;++h)null!=r[h]&&((i=a.get(r[h]))._pos=h,i.onsuccess=f,i.onerror=d,++c);0===c&&e(s)}))},get:function(e){var n=e.trans,r=e.key;return new Promise((function(e,o){e=Sn(e);var i=n.objectStore(t).get(r);i.onsuccess=function(t){return e(t.target.result)},i.onerror=rr(o)}))},query:function(e){return function(n){return new Promise((function(o,i){o=Sn(o);var a=n.trans,u=n.values,s=n.limit,c=n.query,l=s===1/0?void 0:s,f=c.index,d=c.range,h=a.objectStore(t),p=f.isPrimaryKey?h:h.index(f.name),y=r(d);if(0===s)return o({result:[]});if(e){var v=u?p.getAll(y,l):p.getAllKeys(y,l);v.onsuccess=function(e){return o({result:e.target.result})},v.onerror=rr(i)}else{var m=0,g=u||!("openKeyCursor"in p)?p.openCursor(y):p.openKeyCursor(y),b=[];g.onsuccess=function(e){var t=g.result;return t?(b.push(u?t.value:t.primaryKey),++m===s?o({result:b}):void t.continue()):o({result:b})},g.onerror=rr(i)}}))}}(a),openCursor:function(e){var n=e.trans,o=e.values,i=e.query,a=e.reverse,u=e.unique;return new Promise((function(e,s){e=Sn(e);var c=i.index,l=i.range,f=n.objectStore(t),d=c.isPrimaryKey?f:f.index(c.name),h=a?u?"prevunique":"prev":u?"nextunique":"next",p=o||!("openKeyCursor"in d)?d.openCursor(r(l),h):d.openKeyCursor(r(l),h);p.onerror=rr(s),p.onsuccess=Sn((function(t){var r=p.result;if(r){r.___id=++Cl,r.done=!1;var o=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));var a=r.advance.bind(r),u=function(){throw new Error("Cursor not stopped")};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=function(){throw new Error("Cursor not started")},r.fail=Sn(s),r.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},r.start=function(e){var t=new Promise((function(e,t){e=Sn(e),p.onerror=rr(t),r.fail=t,r.stop=function(t){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,e(t)}})),n=function(){if(p.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return p.onsuccess=Sn((function(e){p.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),t},e(r)}else e(null)}),s)}))},count:function(e){var n=e.query,o=e.trans,i=n.index,a=n.range;return new Promise((function(e,n){var u=o.objectStore(t),s=i.isPrimaryKey?u:u.index(i.name),c=r(a),l=c?s.count(c):s.count();l.onsuccess=Sn((function(t){return e(t.target.result)})),l.onerror=rr(n)}))}}}(e)})),s={};return u.forEach((function(e){return s[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!s[e])throw new Error("Table '".concat(e,"' not found"));return s[e]},MIN_KEY:-1/0,MAX_KEY:Dl(t),schema:i}}(t,o,r),e.dbcore));return{dbcore:i}}(n._middlewares,r,n._deps,t);n.core=o.dbcore,n.tables.forEach((function(e){var t=e.name;n.core.schema.tables.some((function(e){return e.name===t}))&&(e.core=n.core.table(t),l(n[t],n.Table)&&(n[t].core=e.core))}))},dr=function(e,t,n,r){var o=e._novip;n.forEach((function(e){var n=r[e];t.forEach((function(t){var r=fc(t,e);(!r||"value"in r&&void 0===r.value)&&(t===o.Transaction.prototype||l(t,o.Transaction)?Nt(t,e,{get:function(){return this.table(e)},set:function(t){cc(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):t[e]=new o.Table(e,n))}))}))},hr=function(e,t){var n=e._novip;t.forEach((function(e){for(var t in e)l(e[t],n.Table)&&delete e[t]}))},pr=function(e,t){return e._cfg.version-t._cfg.version},yr=function(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],i=t[n];if(o){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!bl)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,s=i.idxByName,c=void 0;for(c in u)s[c]||a.del.push(c);for(c in s){var l=u[c],f=s[c];l?l.src!==f.src&&a.change.push(f):a.add.push(f)}(a.del.length>0||a.add.length>0||a.change.length>0)&&r.change.push(a)}}else r.add.push([n,i])}return r},vr=function(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return mr(o,e)})),o},mr=function(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})},gr=function(e,t,n){var r={};return Ft(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),o=t.keyPath,i=ir(ar(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<t.indexNames.length;++u){var s=t.index(t.indexNames[u]);o=s.keyPath;var c=ir(s.name,o,!!s.unique,!!s.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(c)}r[e]=ur(e,i,a)})),r},br=function(e,t,n){for(var r=e._novip,o=n.db.objectStoreNames,i=0;i<o.length;++i){var a=o[i],u=n.objectStore(a);r._hasGetAll="getAll"in u;for(var s=0;s<u.indexNames.length;++s){var c=u.indexNames[s],f=u.index(c).keyPath,d="string"==typeof f?f:"["+Ft(f).join("+")+"]";if(t[a]){var h=t[a].idxByName[d];h&&(h.name=c,delete t[a].idxByName[d],t[a].idxByName[c]=h)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&oc.WorkerGlobalScope&&l(oc,oc.WorkerGlobalScope)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)},wr=function(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Vl("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")},_r=function(e){return e&&"function"==typeof e.databases},Sr=function(e){return On((function(){return tl.letThrough=!0,e()}))},Or=function(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()},Er=function(e){var t=function(t){return e.next(t)},n=o(t),r=o((function(t){return e.throw(t)}));function o(e){return function(t){var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):ac(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()},xr=function(e,t,n){var r=arguments.length;if(r<2)throw new Mc.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,Gt(o),n]},kr=function(e,t,n){for(var r=ac(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r},Pr=function(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],o=0,i=0;o<t.keys.length&&i<e.length;++o)0===xl(t.keys[o],e[i])&&(r.push(n?Ht(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}},jr=function(e){return!("from"in e)},Ar=function(e,t){jr(t)||function e(t,n){var r=n.from,o=n.to,i=n.l,a=n.r;Ul(t,r,o),i&&e(t,i),a&&e(t,a)}(e,t)},Tr=function(e){var t=jr(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&xl(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||xl(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}},Dr=function(e){var t,n,r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),o=r>1?"r":r<-1?"l":"";if(o){var i="r"===o?"l":"r",a=f({},e),u=e[o];e.from=u.from,e.to=u.to,e[o]=u[o],a[o]=u[i],e[i]=a,a.d=Cr(a)}e.d=Cr(e)},Cr=function(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1},Ir=function(e,t){return ic(t).forEach((function(n){Ar(e[n]||(e[n]=new Bl),t[n])})),e},Mr=function(e){var t=Wl;try{Wl=!0,Al.storagemutated.fire(e)}finally{Wl=t}},Rr=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},Nr=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Lr=function(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))},Fr=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Br=function(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href},Ur=function(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)},Kr=function(){},zr=function(e,t){if(!t)return e&&e.then?e.then(Kr):Promise.resolve()},Vr=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Gr=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Hr=function(e){return function(e){if(Array.isArray(e))return Vr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||qr(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},qr=function(e,t){if(e){if("string"==typeof e)return Vr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Vr(e,t):void 0}},Wr=function(e){return function(t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||qr(e,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,ro.useState)(e.getState())),r=n[0],o=n[1];return(0,ro.useEffect)((function(){return e.subscribe((function(e){return o(e)}))}),[]),function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Gr(e,t,n[t])}))}return e}({},r,(0,ro.useMemo)((function(){return t?function(e,t){var n=function(n){r[n]=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];e.setState((function(e){var r,i=[e].concat(Hr(o));return(r=t)[n].apply(r,Hr(i))}))}};"function"==typeof t&&(t=t(e));var r={};for(var o in t)n(o);return r}(e,t):{}}),[t]))}},$r=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Yr=A(714),Jr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 119"><path fill="var(--logo-red)" fill-rule="evenodd" d="M40.29 40.328a27.76 27.76 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.646 8.116l.021-18.54A42.84 42.84 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968z" clip-rule="evenodd"/><path fill="var(--logo-orange)" fill-rule="evenodd" d="M79.645 79.671a27.74 27.74 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.86 42.86 0 0 0 59.96 103a42.8 42.8 0 0 0 19.672-4.751z" clip-rule="evenodd"/><path fill="var(--logo-purple)" fill-rule="evenodd" d="M40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.8 42.8 0 0 0 4.752 19.672z" clip-rule="evenodd"/><path fill="var(--logo-green)" fill-rule="evenodd" d="M79.634 40.289a27.75 27.75 0 0 1 8.154 19.688 27.74 27.74 0 0 1-8.117 19.646l18.542.02a42.84 42.84 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675z" clip-rule="evenodd"/><path fill="var(--logo-black)" fill-rule="evenodd" d="M156.184 60.003c0-8.749-6.118-15.777-15.025-15.777-8.909 0-15.025 7.028-15.025 15.776s6.116 15.78 15.025 15.78c8.907 0 15.025-7.031 15.025-15.78m-34.881 0c0-11.483 8.318-19.96 19.856-19.96 11.536 0 19.855 8.478 19.855 19.96 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.964M179.514 75.54c5.507 0 9.05-4.14 9.05-9.482s-3.543-9.483-9.05-9.483c-5.505 0-9.046 4.142-9.046 9.483s3.541 9.482 9.046 9.482M166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248zM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868zM227.854 59.357c0-2.347-.216-4.361-.216-6.05h4.031c0 1.362.11 2.776.11 4.194h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25zM259.211 41.009h6.708L278.8 70.79h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507zM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037l10.784 17.492h-5.525l-10.304-17.063h-5.797V79h-4.506zM358.123 47.713c-1.506-2.414-4.187-3.487-6.926-3.487-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45zM185.885 90.998h1.424l2.734 6.326h.023l2.758-6.326h1.391v8.07h-.957v-6.77h-.024l-2.894 6.77h-.582l-2.894-6.77h-.022v6.77h-.957zM198.386 90.998h5.071v.889h-4.114v2.53h3.841v.89h-3.841v2.871h4.32v.89h-5.277zM207.891 98.178h1.822c1.848 0 3.25-.935 3.25-3.146s-1.402-3.145-3.25-3.145h-1.822zm-.957-7.18h3.1c1.583 0 3.953 1.06 3.953 4.034 0 2.976-2.37 4.036-3.953 4.036h-3.1zM217.007 99.068h.958v-8.07h-.958zM227.105 92.663c-.478-.651-1.242-.981-2.017-.981-1.8 0-3.077 1.584-3.077 3.35 0 1.87 1.266 3.352 3.077 3.352.98 0 1.767-.4 2.337-1.129l.718.603c-.718.97-1.766 1.414-3.055 1.414-2.314 0-4.102-1.79-4.102-4.24 0-2.37 1.709-4.239 4.102-4.239 1.095 0 2.166.377 2.849 1.266zM233.557 92.23h-.024l-1.675 3.965h3.294zm-.434-1.232h.9l3.43 8.07h-1.117l-.82-1.984h-4.034l-.832 1.984h-1.082zM240.006 90.998h.958v7.18h3.692v.89h-4.65zM252.793 94.554h.855c1.06 0 2.439 0 2.439-1.334 0-1.161-1.014-1.333-1.948-1.333h-1.346zm-.957-3.556h2.063c1.561 0 3.214.228 3.214 2.222 0 1.174-.764 1.938-2.018 2.132l2.291 3.716h-1.173l-2.19-3.625h-1.23v3.625h-.957zM260.51 90.998h5.07v.889h-4.112v2.53h3.84v.89h-3.84v2.871h4.318v.89h-5.276zM274.402 92.663c-.479-.651-1.242-.981-2.018-.981-1.8 0-3.077 1.584-3.077 3.35 0 1.87 1.266 3.352 3.077 3.352.98 0 1.767-.4 2.336-1.129l.718.603c-.718.97-1.766 1.414-3.054 1.414-2.313 0-4.102-1.79-4.102-4.24 0-2.37 1.709-4.239 4.102-4.239 1.094 0 2.166.377 2.85 1.266zM284.739 95.032c0-1.857-1.3-3.35-3.191-3.35-1.892 0-3.191 1.493-3.191 3.35 0 1.858 1.299 3.352 3.191 3.352s3.191-1.494 3.191-3.352m-7.409 0c0-2.439 1.767-4.239 4.218-4.239s4.217 1.8 4.217 4.239-1.767 4.24-4.217 4.24c-2.451 0-4.218-1.8-4.218-4.24M289.514 94.554h.855c1.059 0 2.438 0 2.438-1.334 0-1.161-1.014-1.333-1.948-1.333h-1.345zm-.958-3.556h2.062c1.563 0 3.215.228 3.215 2.222 0 1.174-.763 1.938-2.016 2.132l2.289 3.716h-1.173l-2.189-3.625h-1.23v3.625h-.958zM297.81 98.178h1.825c1.845 0 3.246-.935 3.246-3.146s-1.401-3.145-3.246-3.145h-1.825zm-.957-7.18h3.1c1.585 0 3.956 1.06 3.956 4.034 0 2.976-2.371 4.036-3.956 4.036h-3.1zM315.407 92.422c-.318-.513-.89-.74-1.47-.74-.844 0-1.721.4-1.721 1.356 0 .74.41 1.072 1.698 1.482 1.254.399 2.417.81 2.417 2.393 0 1.607-1.38 2.36-2.838 2.36-.935 0-1.938-.309-2.486-1.118l.821-.672c.342.593 1.026.9 1.721.9.821 0 1.754-.478 1.754-1.402 0-.991-.67-1.163-2.107-1.64-1.139-.377-2.006-.878-2.006-2.222 0-1.551 1.333-2.326 2.747-2.326.9 0 1.664.25 2.256.946zM320.844 95.591l-3.009-4.593h1.219l2.269 3.647 2.335-3.647h1.152l-3.01 4.593v3.477h-.956zM330.565 92.422c-.32-.513-.89-.74-1.471-.74-.843 0-1.72.4-1.72 1.356 0 .74.41 1.072 1.698 1.482 1.254.399 2.415.81 2.415 2.393 0 1.607-1.378 2.36-2.837 2.36-.934 0-1.937-.309-2.485-1.118l.821-.672c.342.593 1.026.9 1.721.9.821 0 1.754-.478 1.754-1.402 0-.991-.671-1.163-2.107-1.64-1.139-.377-2.006-.878-2.006-2.222 0-1.551 1.333-2.326 2.746-2.326.901 0 1.665.25 2.257.946zM339.283 91.887h-2.666v7.18h-.958v-7.18h-2.667v-.889h6.291zM341.665 90.998h5.071v.889h-4.113v2.53h3.84v.89h-3.84v2.871h4.319v.89h-5.277zM349.905 90.998h1.424l2.735 6.326h.023l2.758-6.326h1.391v8.07h-.958v-6.77h-.023l-2.894 6.77h-.582l-2.895-6.77h-.021v6.77h-.958z" clip-rule="evenodd"/></svg>',Qr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 119"><path fill="var(--logo-red)" fill-rule="evenodd" d="M40.29 40.328a27.76 27.76 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.647 8.116l.02-18.54A42.84 42.84 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968z" clip-rule="evenodd"/><path fill="var(--logo-orange)" fill-rule="evenodd" d="M79.645 79.671a27.74 27.74 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.86 42.86 0 0 0 59.96 103a42.8 42.8 0 0 0 19.672-4.751z" clip-rule="evenodd"/><path fill="var(--logo-purple)" fill-rule="evenodd" d="M40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.8 42.8 0 0 0 4.752 19.672z" clip-rule="evenodd"/><path fill="var(--logo-green)" fill-rule="evenodd" d="M79.634 40.289a27.75 27.75 0 0 1 8.154 19.688 27.74 27.74 0 0 1-8.117 19.646l18.542.02a42.84 42.84 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675z" clip-rule="evenodd"/><path fill="var(--logo-black)" fill-rule="evenodd" d="M156.184 60.003c0-8.749-6.118-15.777-15.025-15.777-8.909 0-15.025 7.028-15.025 15.776s6.116 15.78 15.025 15.78c8.907 0 15.025-7.031 15.025-15.78m-34.881 0c0-11.483 8.318-19.96 19.856-19.96 11.536 0 19.855 8.478 19.855 19.96 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.964M179.514 75.54c5.507 0 9.05-4.14 9.05-9.482s-3.543-9.483-9.05-9.483c-5.505 0-9.046 4.142-9.046 9.483s3.541 9.482 9.046 9.482M166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248zM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868zM227.854 59.357c0-2.347-.216-4.361-.216-6.05h4.031c0 1.362.11 2.776.11 4.194h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25zM259.211 41.009h6.708L278.8 70.79h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507zM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037L334.018 79h-5.525l-10.304-17.063h-5.797V79h-4.506zM358.123 47.713c-1.506-2.414-4.187-3.487-6.926-3.487-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45z" clip-rule="evenodd"/></svg>',Zr='<svg xmlns="http://www.w3.org/2000/svg" width="121" height="118"><path fill="var(--logo-red)" fill-rule="evenodd" d="M40.436 39.474a27.93 27.93 0 0 1 19.811-8.205c7.717 0 14.705 3.122 19.77 8.167l.021-18.656A43.1 43.1 0 0 0 60.247 16c-7.133 0-13.899 1.943-19.832 4.999z" clip-rule="evenodd"/><path fill="var(--logo-orange)" fill-rule="evenodd" d="M80.038 79.064a27.92 27.92 0 0 1-19.808 8.205c-7.717 0-14.705-3.121-19.774-8.167l-.02 18.657a43.1 43.1 0 0 0 19.794 4.78 43.1 43.1 0 0 0 19.794-4.781z" clip-rule="evenodd"/><path fill="var(--logo-purple)" fill-rule="evenodd" d="M40.474 79.089c-5.069-5.069-8.205-12.07-8.205-19.808 0-7.717 3.121-14.704 8.167-19.773l-18.657-.02A43.1 43.1 0 0 0 17 59.281a43.1 43.1 0 0 0 4.782 19.795z" clip-rule="evenodd"/><path fill="var(--logo-green)" fill-rule="evenodd" d="M80.027 39.435a27.93 27.93 0 0 1 8.205 19.811 27.92 27.92 0 0 1-8.168 19.769l18.658.021a43.1 43.1 0 0 0 4.779-19.79 43.1 43.1 0 0 0-4.781-19.798z" clip-rule="evenodd"/></svg>',Xr=document.createElement("div"),eo=function(){document.body.appendChild(Xr)};Xr.id="omrs-svgs-container",Xr.style.display="none","complete"===document.readyState?eo():window.addEventListener("load",eo);var to='<svg xmlns="http://www.w3.org/2000/svg"><path d="M9 2H7v2h2zM4 2H2v2h2zM14 2h-2v2h2zM9 7H7v2h2zM4 7H2v2h2zM14 7h-2v2h2zM9 12H7v2h2zM4 12H2v2h2zM14 12h-2v2h2z"/></svg>',no={"Brand color #1":{_default:"#005d5d",_type:Yr.Type.String},"Brand color #2":{_default:"#004144",_type:Yr.Type.String},"Brand color #3":{_default:"#007d79",_type:Yr.Type.String},patientPhotoConceptUuid:{_type:Yr.Type.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:Yr.Type.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:[Yr.validators.oneOf(["buddhist","chinese","coptic","dangi","ethioaa","ethiopic","gregory","hebrew","indian","islamic","islamic-umalqura","islamic-tbla","islamic-civil","islamic-rgsa","iso8601","japanese","persian","roc","islamicc"])]}}};Number.MAX_SAFE_INTEGER;var ro=A(954),oo=A(792),io={};try{process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES&&"true"===process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES?io.enableCssCustomProperties=!0:io.enableCssCustomProperties=!1,process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE&&"true"===process.env.CARBON_ENABLE_USE_CONTROLLED_STATE_WITH_VALUE?io.enableUseControlledStateWithValue=!0:io.enableUseControlledStateWithValue=!1,process.env.CARBON_ENABLE_CSS_GRID&&"true"===process.env.CARBON_ENABLE_CSS_GRID?io.enableCssGrid=!0:io.enableCssGrid=!1,process.env.CARBON_ENABLE_V11_RELEASE?"true"===process.env.CARBON_ENABLE_V11_RELEASE?io.enableV11Release=!0:io.enableV11Release=!1:io.enableV11Release=!0,process.env.CARBON_ENABLE_EXPERIMENTAL_TILE_CONTRAST&&"true"===process.env.CARBON_ENABLE_EXPERIMENTAL_TILE_CONTRAST?io.enableExperimentalTileContrast=!0:io.enableExperimentalTileContrast=!1,process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS&&"true"===process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS?io.enableV12TileDefaultIcons=!0:io.enableV12TileDefaultIcons=!1,process.env.CARBON_ENABLE_V12_OVERFLOWMENU&&"true"===process.env.CARBON_ENABLE_V12_OVERFLOWMENU?io.enableV12Overflowmenu=!0:io.enableV12Overflowmenu=!1}catch(e){io.enableCssCustomProperties=!1,io.enableUseControlledStateWithValue=!1,io.enableCssGrid=!1,io.enableV11Release=!0,io.enableExperimentalTileContrast=!1,io.enableV12TileDefaultIcons=!1,io.enableV12Overflowmenu=!1}for(var ao=[{name:"enable-css-custom-properties",description:"Describe what the flag does",enabled:io.enableCssCustomProperties},{name:"enable-use-controlled-state-with-value",description:"Enable components to be created in either a controlled or uncontrolled mode\n",enabled:io.enableUseControlledStateWithValue},{name:"enable-css-grid",description:"Enable CSS Grid Layout in the Grid and Column React components\n",enabled:io.enableCssGrid},{name:"enable-v11-release",description:"Enable the features and functionality for the v11 Release\n",enabled:io.enableV11Release},{name:"enable-experimental-tile-contrast",description:"Enable the experimental tile improved contrast styles\n",enabled:io.enableExperimentalTileContrast},{name:"enable-v12-tile-default-icons",description:"Enable rendering of default icons in the tile components\n",enabled:io.enableV12TileDefaultIcons},{name:"enable-v12-overflowmenu",description:"Enable the use of the v12 OverflowMenu leveraging the Menu subcomponents\n",enabled:io.enableV12Overflowmenu}],uo=function(){function e(t){var n=this;(function(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):l(n,r)))throw new TypeError("Cannot call a class as a function");var n,r})(this,e),this.flags=new Map,t&&Object.keys(t).forEach((function(e){n.flags.set(e,t[e])}))}var t,n;return t=e,n=[{key:"checkForFlag",value:function(e){if(!this.flags.has(e))throw new Error("Unable to find a feature flag with the name: `".concat(e,"`"))}},{key:"add",value:function(e,t){if(this.flags.has(e))throw new Error("The feature flag: ".concat(e," already exists"));this.flags.set(e,t)}},{key:"enable",value:function(e){this.checkForFlag(e),this.flags.set(e,!0)}},{key:"disable",value:function(e){this.checkForFlag(e),this.flags.set(e,!1)}},{key:"merge",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.flags.set(n,e[n])}))}},{key:"mergeWithScope",value:function(e){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(e.flags);try{for(n.s();!(t=n.n()).done;){var r=o(t.value,2),i=r[0],a=r[1];this.flags.has(i)||this.flags.set(i,a)}}catch(e){n.e(e)}finally{n.f()}}},{key:"enabled",value:function(e){return this.checkForFlag(e),this.flags.get(e)}}],n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,"symbol"==(void 0===(i=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key))?"undefined":(o=i)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":void 0===o?"undefined":y(o))?i:String(i),r)}var o,i}(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),so=new uo(void 0),co=0;co<ao.length;co++){var lo=ao[co];so.add(lo.name,lo.enabled)}!function(){so.merge.apply(so,arguments)}({"enable-css-custom-properties":!0,"enable-css-grid":!0,"enable-v11-release":!0,"enable-experimental-tile-contrast":!1}),A(279),new oo.Subject,new oo.Subject,new oo.Subject,A(976),new oo.Subject;var fo,ho=Object.freeze({__proto__:null,get start(){return Oe},get ensureJQuerySupport(){return ie},get setBootstrapMaxTime(){return q},get setMountMaxTime(){return W},get setUnmountMaxTime(){return $},get setUnloadMaxTime(){return Y},get registerApplication(){return pe},get unregisterApplication(){return ve},get getMountedApps(){return fe},get getAppStatus(){return he},get unloadApplication(){return me},get checkActivityFunctions(){return ye},get getAppNames(){return de},get pathToActiveWhen(){return we},get navigateToUrl(){return X},get patchHistoryApi(){return re},get triggerAppChange(){return _e},get addErrorHandler(){return E},get removeErrorHandler(){return x},get mountRootParcel(){return z},get NOT_LOADED(){return mo},get LOADING_SOURCE_CODE(){return go},get NOT_BOOTSTRAPPED(){return bo},get BOOTSTRAPPING(){return wo},get NOT_MOUNTED(){return _o},get MOUNTING(){return So},get UPDATING(){return Eo},get LOAD_ERROR(){return Po},get MOUNTED(){return Oo},get UNLOADING(){return ko},get UNMOUNTING(){return xo},get SKIP_BECAUSE_BROKEN(){return jo}}),po=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,yo=function(){try{var e=new po("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?po:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},vo=[],mo="NOT_LOADED",go="LOADING_SOURCE_CODE",bo="NOT_BOOTSTRAPPED",wo="BOOTSTRAPPING",_o="NOT_MOUNTED",So="MOUNTING",Oo="MOUNTED",Eo="UPDATING",xo="UNMOUNTING",ko="UNLOADING",Po="LOAD_ERROR",jo="SKIP_BECAUSE_BROKEN",Ao=[],To=!1,Do=!1,Co=0,Io={parcels:{}},Mo={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},Ro="undefined"!=typeof window,No={hashchange:[],popstate:[]},Lo=["hashchange","popstate"],Fo=null,Bo=!1;Ro&&(window.singleSpaNavigate?console.warn(k(41,!1)):window.singleSpaNavigate=X);var Uo=!1,Ko={},zo=[],Vo=!1,Go=!1,Ho=[],qo=Ro&&window.location.href;function Wo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);p.push(t.catch((function(e){return console.warn(Error(k(42,!1))),console.warn(e),!1})))},o=function(){var t=fe();e.forEach((function(e){return e.resolve(t)}));try{u(0===s.length?"no-app-change":"app-change",a()),u("routing-event",a())}catch(e){setTimeout((function(){throw e}))}if(Go=!1,Ho.length>0){var n=Ho;Ho=[],Wo(n)}return t},i=function(){n||(e.forEach((function(e){ee(e.eventArguments)})),ee(t))},a=function(){var e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=arguments.length>1?arguments[1]:void 0,o={},i=(w(e={},Oo,[]),w(e,_o,[]),w(e,mo,[]),w(e,jo,[]),e);n?(d.concat(h).forEach((function(e,t){u(e,Oo)})),l.forEach((function(e){u(e,mo)})),f.forEach((function(e){u(e,_o)}))):s.forEach((function(e){u(e)}));var a={detail:{newAppStatuses:o,appsByNewStatus:i,totalAppChanges:s.length,originalEvent:null==t?void 0:t[0],oldUrl:y,newUrl:v}};return r&&M(a.detail,r),a;function u(e,t){var n=D(e);t=t||he(n),o[n]=t,(i[t]=i[t]||[]).push(n)}},u=function(e,t){n||window.dispatchEvent(new yo("single-spa:".concat(e),t))};if(Go)return new Promise((function(e,n){Ho.push({resolve:e,reject:n,eventArguments:t})}));var s,c=function(){var e=[],t=[],n=[],r=[],o=(new Date).getTime();return zo.forEach((function(i){var a=i.status!==jo&&T(i);switch(i.status){case Po:a&&o-i.loadErrorTime>=200&&n.push(i);break;case mo:case go:a&&n.push(i);break;case bo:case _o:!a&&le(D(i))?e.push(i):a&&r.push(i);break;case Oo:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}(),l=c.appsToUnload,f=c.appsToUnmount,d=c.appsToLoad,h=c.appsToMount,p=[],y=qo,v=qo=window.location.href;return Ee()?(Go=!0,s=l.concat(d,f,h),Promise.resolve().then((function(){return u(0===s.length?"before-no-app-change":"before-app-change",a(!0)),u("before-routing-event",a(!0,{cancelNavigation:r})),Promise.all(p).then((function(n){if(n.some((function(e){return e})))return Fo.call(window.history,history.state,"",y.substring(location.origin.length)),qo=location.href,Go=!1,Wo(e,t,!0);var r=l.map(ue),s=f.map(U).map((function(e){return e.then(ue)})).concat(r),c=Promise.all(s);c.then((function(){u("before-mount-routing-event",a(!0))}),(function(e){throw e}));var p=d.map((function(e){return Z(e).then((function(e){return Se(e,c)}))})),v=h.filter((function(e){return d.indexOf(e)<0})).map((function(e){return Se(e,c)}));return c.catch((function(e){throw i(),e})).then((function(){return i(),Promise.all(p.concat(v)).catch((function(t){throw e.forEach((function(e){return e.reject(t)})),t})).then(o).then((function(){}),(function(e){throw e}))}))}))}))):(s=d,Promise.resolve().then((function(){var e=d.map(Z);return Promise.all(e).then(i).then((function(){return[]})).catch((function(e){throw i(),e})).finally((function(){}))})))}var $o=!1,Yo={getRawAppData:function(){return function(e){if(Array.isArray(e))return b(e)}(e=zo)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var e},reroute:Wo,NOT_LOADED:mo,toLoadPromise:Z,toBootstrapPromise:B,unregisterApplication:ve,getProfilerData:function(){return Ao}};Ro&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Yo);var Jo=A(685),Qo=A(45);A(254),(0,Jo.createGlobalStore)("modalState",{modalContainer:null,modalStack:[]}),window.getComputedStyle(document.body).overflow,A(740),A(513),A(901),(0,Jo.createGlobalStore)("workspace",{context:"",openWorkspaces:[],prompt:null,workspaceWindowState:"normal"});var Zo=null;try{Zo=n(1672).createContext()}catch(po){}function Xo(e){return(Xo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ei(e,t){return(ei=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var ti=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ei(e,t)}(r,ro.Component);var t,n=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Xo(e);if(t){var o=Xo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return je(e)}(this,n)}}(r);function r(e){var t;if(function(e,t){if(n=e,!(null!=(r=t)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):l(n,r)))throw new TypeError("Cannot call a class as a function");var n,r}(this,r),Pe(je(t=n.call(this,e)),"handleRef",(function(e){t.el=e})),Pe(je(t),"addThingToDo",(function(e,n){t.state.hasError&&"unmount"!==e||(t.nextThingToDo=(t.nextThingToDo||Promise.resolve()).then((function(){if(!t.unmounted||"unmount"===e)return n.apply(void 0,arguments)})).catch((function(n){throw t.nextThingToDo=Promise.resolve(),t.setState({hasError:!0}),n&&n.message&&(n.message="During '".concat(e,"', parcel threw an error: ").concat(n.message)),t.props.handleError?t.props.handleError(n):setTimeout((function(){throw n})),n})))})),Pe(je(t),"getParcelProps",(function(){var e=ke(ke({},t.props),{},{domElement:t.el});return delete e.mountParcel,delete e.config,delete e.wrapWith,delete e.wrapStyle,delete e.appendTo,delete e.handleError,delete e.parcelDidMount,e})),t.state={hasError:!1},!e.config)throw new Error("single-spa-react's Parcel component requires the 'config' prop to either be a parcel config or a loading function that returns a promise. See https://github.com/single-spa/single-spa-react");return t}return(t=[{key:"componentDidMount",value:function(){var e=this;this.addThingToDo("mount",(function(){var t,n=e.props.mountParcel||e.mountParcel;if(!n)throw new Error("\n\t\t\t\t <Parcel /> was not passed a mountParcel prop, nor is it rendered where mountParcel is within the React context.\n\t\t\t\t If you are using <Parcel /> within a module that is not a single-spa application, you will need to import mountRootParcel from single-spa and pass it into <Parcel /> as a mountParcel prop\t\n\t\t\t\t");return e.el?t=e.el:(e.createdDomElement=t=document.createElement(e.props.wrapWith),Object.keys(e.props.wrapStyle).forEach((function(n){t.style[n]=e.props.wrapStyle[n]})),e.props.appendTo.appendChild(t)),e.parcel=n(e.props.config,ke({domElement:t},e.getParcelProps())),e.parcel.mountPromise.then(e.props.parcelDidMount),e.parcel.mountPromise}))}},{key:"componentDidUpdate",value:function(){var e=this;this.addThingToDo("update",(function(){if(e.parcel&&e.parcel.update)return e.parcel.update(e.getParcelProps())}))}},{key:"componentWillUnmount",value:function(){var e=this;this.addThingToDo("unmount",(function(){if(e.parcel&&"MOUNTED"===e.parcel.getStatus())return e.parcel.unmount()})),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var e=this;if(this.props.appendTo)return Zo&&Zo.Consumer?ro.createElement(Zo.Consumer,null,(function(t){return e.mountParcel=t?t.mountParcel:null,null})):null;var t=Zo&&Zo.Consumer?ro.createElement(Zo.Consumer,null,(function(t){return e.mountParcel=t?t.mountParcel:null,null})):void 0;return ro.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},t)}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}();Pe(ti,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}}),(0,Jo.createGlobalStore)("left-nav",{slotName:null,basePath:window.spaBase});var ni=A(688);A(353);var ri=A(921),oi=function(){},ii=void 0,ai=Object,ui=function(e){return e===ii},si=function(e){return"function"==typeof e},ci=function(e,t){return f({},e,t)},li=new WeakMap,fi=0,di=function(e){var t,n,r=void 0===e?"undefined":y(e),o=e&&e.constructor,i=o==Date;if(ai(e)!==e||i||o==RegExp)t=i?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=li.get(e))return t;if(t=++fi+"~",li.set(e,t),o==Array){for(t="@",n=0;n<e.length;n++)t+=di(e[n])+",";li.set(e,t)}if(o==ai){t="#";for(var a=ai.keys(e).sort();!ui(n=a.pop());)ui(e[n])||(t+=n+":"+di(e[n])+",");li.set(e,t)}}return t},hi=new WeakMap,pi={},yi={},vi="undefined",mi=("undefined"==typeof window?"undefined":y(window))!=vi,gi=("undefined"==typeof document?"undefined":y(document))!=vi,bi=function(e,t){var n=hi.get(e);return[function(){return!ui(t)&&e.get(t)||pi},function(r){if(!ui(t)){var o=e.get(t);t in yi||(yi[t]=o),n[5](t,ci(o,r),o||pi)}},n[6],function(){return!ui(t)&&t in yi?yi[t]:!ui(t)&&e.get(t)||pi}]},wi=!0,_i=h(mi&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[oi,oi],2),Si=_i[0],Oi=_i[1],Ei={isOnline:function(){return wi},isVisible:function(){var e=gi&&document.visibilityState;return ui(e)||"hidden"!==e}},xi={initFocus:function(e){return gi&&document.addEventListener("visibilitychange",e),Si("focus",e),function(){gi&&document.removeEventListener("visibilitychange",e),Oi("focus",e)}},initReconnect:function(e){var t=function(){wi=!0,e()},n=function(){wi=!1};return Si("online",t),Si("offline",n),function(){Oi("online",t),Oi("offline",n)}}},ki=!ro.default.useId,Pi=!mi||"Deno"in window,ji=Pi?ro.useEffect:ro.useLayoutEffect,Ai="undefined"!=typeof navigator&&navigator.connection,Ti=!Pi&&Ai&&(["slow-2g","2g"].includes(Ai.effectiveType)||Ai.saveData),Di=function(e){if(si(e))try{e=e()}catch(t){e=""}var t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?di(e):"",t]},Ci=0,Ii=function(){return++Ci};function Mi(){return Mi=i((function(){var e,t,n,r,o,a,u,s,c,l,f,d,p,y,v,g,b,w,_,S,O,E,x,k=arguments;function P(e){return j.apply(this,arguments)}function j(){return j=i((function(e){var n,r,i,a,s,c,v,g,b,w,_,S,O,E,x,k,P,j,A,T;return m(this,(function(m){switch(m.label){case 0:if(n=h(Di(e),1),!(r=n[0]))return[2];if(i=h(bi(o,r),2),a=i[0],s=i[1],c=h(hi.get(o),4),v=c[0],g=c[1],b=c[2],w=c[3],_=function(){var e=v[r];return p&&(delete b[r],delete w[r],e&&e[0])?e[0](2).then((function(){return a().data})):a().data},t.length<3)return[2,_()];if(O=u,E=Ii(),g[r]=[E,0],x=!ui(d),k=a(),P=k.data,j=k._c,A=ui(j)?P:j,x&&(d=si(d)?d(A,P):d,s({data:d,_c:A})),si(O))try{O=O(A)}catch(e){S=e}return O&&function(e){return si(e.then)}(O)?[4,O.catch((function(e){S=e}))]:[3,2];case 1:if(O=m.sent(),E!==g[r][0]){if(S)throw S;return[2,O]}S&&x&&function(e){return"function"==typeof f?f(e):!1!==f}(S)&&(l=!0,s({data:A,_c:ii})),m.label=2;case 2:if(l&&!S&&(si(l)?(T=l(O,A),s({data:T,error:ii,_c:ii})):s({data:O,error:ii,_c:ii})),g[r][1]=Ii(),Promise.resolve(_()).then((function(){s({_c:ii})})),!S)return[2,O];if(y)throw S;return[2]}}))})),j.apply(this,arguments)}return m(this,(function(i){for(e=k.length,t=new Array(e),n=0;n<e;n++)t[n]=k[n];if(r=h(t,4),o=r[0],a=r[1],u=r[2],s=r[3],c=ci({populateCache:!0,throwOnError:!0},"boolean"==typeof s?{revalidate:s}:s||{}),l=c.populateCache,f=c.rollbackOnError,d=c.optimisticData,p=!1!==c.revalidate,y=c.throwOnError,si(a)){v=a,g=[],b=o.keys(),w=!0,_=!1,S=void 0;try{for(O=b[Symbol.iterator]();!(w=(E=O.next()).done);w=!0)x=E.value,!/^\$(inf|sub)\$/.test(x)&&v(o.get(x)._k)&&g.push(x)}catch(e){_=!0,S=e}finally{try{w||null==O.return||O.return()}finally{if(_)throw S}}return[2,Promise.all(g.map(P))]}return[2,P(a)]}))})),Mi.apply(this,arguments)}var Ri=function(e,t){for(var n in e)e[n][0]&&e[n][0](t)},Ni=function(e,t){if(!hi.has(e)){var n=ci(xi,t),r={},o=Ae.bind(ii,e),i=oi,a={},u=function(e,t){var n=a[e]||[];return a[e]=n,n.push(t),function(){return n.splice(n.indexOf(t),1)}},s=function(t,n,r){e.set(t,n);var o=a[t],i=!0,u=!1,s=void 0;if(o)try{for(var c,l=o[Symbol.iterator]();!(i=(c=l.next()).done);i=!0)(0,c.value)(n,r)}catch(e){u=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(u)throw s}}},c=function(){if(!hi.has(e)&&(hi.set(e,[r,{},{},{},o,s,u]),!Pi)){var t=n.initFocus(setTimeout.bind(ii,Ri.bind(ii,r,0))),a=n.initReconnect(setTimeout.bind(ii,Ri.bind(ii,r,1)));i=function(){t&&t(),a&&a(),hi.delete(e)}}};return c(),[e,o,c,i]}return[e,hi.get(e)[4]]},Li=h(Ni(new Map),2),Fi=Li[0],Bi=Li[1],Ui=ci({onLoadingSlow:oi,onSuccess:oi,onError:oi,onErrorRetry:function(e,t,n,r,o){var i=n.errorRetryCount,a=o.retryCount,u=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!ui(i)&&a>i||setTimeout(r,u,o)},onDiscarded:oi,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Ti?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:Ti?5e3:3e3,compare:function(e,t){return di(e)==di(t)},isPaused:function(){return!1},cache:Fi,mutate:Bi,fallback:{}},Ei),Ki=function(e,t){var n=ci(e,t);if(t){var r=e.use,o=e.fallback,i=t.use,a=t.fallback;r&&i&&(n.use=r.concat(i)),o&&a&&(n.fallback=ci(o,a))}return n},zi=(0,ro.createContext)({}),Vi="$inf$",Gi=mi&&window.__SWR_DEVTOOLS_USE__,Hi=Gi?window.__SWR_DEVTOOLS_USE__:[],qi=function(e){return si(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}]},Wi=Hi.concat((function(e){return function(t,n,r){return e(t,n&&function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i=h(Di(t),1)[0],a=h(hi.get(Fi),4)[3];if(i.startsWith(Vi))return n.apply(void 0,p(r));var u=a[i];return ui(u)?n.apply(void 0,p(r)):(delete a[i],u)},r)}})),$i=function(e,t){return function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];var i=h(qi(r),3),a=i[0],u=i[1],s=i[2],c=(s.use||[]).concat(t);return e(a,u,d(f({},s),{use:c}))}};Gi&&(window.__SWR_DEVTOOLS_REACT__=ro.default);var Yi,Ji=ro.default.use||function(e){if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then((function(t){e.status="fulfilled",e.value=t}),(function(t){e.status="rejected",e.reason=t})),e)},Qi={dedupe:!0},Zi=(ai.defineProperty((function(e){var t=e.value,n=(0,ro.useContext)(zi),r=si(t),o=(0,ro.useMemo)((function(){return r?t(n):t}),[r,n,t]),i=(0,ro.useMemo)((function(){return r?o:Ki(n,o)}),[r,n,o]),a=o&&o.provider,u=(0,ro.useRef)(ii);a&&!u.current&&(u.current=Ni(a(i.cache||Fi),o));var s=u.current;return s&&(i.cache=s[0],i.mutate=s[1]),ji((function(){if(s)return s[2]&&s[2](),s[3]}),[]),(0,ro.createElement)(zi.Provider,ci(e,{value:i}))}),"defaultValue",{value:Ui}),Yi=function(e,t,n){var r=n.cache,o=n.compare,a=n.suspense,u=n.fallbackData,s=n.revalidateOnMount,c=n.revalidateIfStale,l=n.refreshInterval,d=n.refreshWhenHidden,v=n.refreshWhenOffline,g=n.keepPreviousData,b=h(hi.get(r),4),w=b[0],_=b[1],S=b[2],O=b[3],E=h(Di(e),2),x=E[0],k=E[1],P=(0,ro.useRef)(!1),j=(0,ro.useRef)(!1),A=(0,ro.useRef)(x),T=(0,ro.useRef)(t),D=(0,ro.useRef)(n),C=function(){return D.current},I=function(){return C().isVisible()&&C().isOnline()},M=h(bi(r,x),4),R=M[0],N=M[1],L=M[2],F=M[3],B=(0,ro.useRef)({}).current,U=ui(u)?n.fallback[x]:u,K=function(e,t){for(var n in B){var r=n;if("data"===r){if(!o(e[r],t[r])){if(!ui(e[r]))return!1;if(!o(J,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},z=(0,ro.useMemo)((function(){var e=!!x&&!!t&&(ui(s)?!C().isPaused()&&!a&&(!!ui(c)||c):s),n=function(t){var n=ci(t);return delete n._k,e?f({isValidating:!0,isLoading:!0},n):n},r=R(),o=F(),i=n(r),u=r===o?i:n(o),l=i;return[function(){var e=n(R());return K(e,l)?(l.data=e.data,l.isLoading=e.isLoading,l.isValidating=e.isValidating,l.error=e.error,l):(l=e,e)},function(){return u}]}),[r,x]),V=(0,ri.useSyncExternalStore)((0,ro.useCallback)((function(e){return L(x,(function(t,n){K(n,t)||e()}))}),[r,x]),z[0],z[1]),G=!P.current,H=w[x]&&w[x].length>0,q=V.data,W=ui(q)?U:q,$=V.error,Y=(0,ro.useRef)(W),J=g?ui(q)?Y.current:q:W,Q=!(H&&!ui($))&&(G&&!ui(s)?s:!C().isPaused()&&(a?!ui(W)&&c:ui(W)||c)),Z=!!(x&&t&&G&&Q),X=ui(V.isValidating)?Z:V.isValidating,ee=ui(V.isLoading)?Z:V.isLoading,te=(0,ro.useCallback)(function(){var e=i((function(e){var t,r,i,a,u,s,c,l,f,d,p,y,v,g,b,O,E;return m(this,(function(m){switch(m.label){case 0:if(t=T.current,!x||!t||j.current||C().isPaused())return[2,!1];a=!0,u=e||{},s=!S[x]||!u.dedupe,c=function(){return ki?!j.current&&x===A.current&&P.current:x===A.current},l={isValidating:!1,isLoading:!1},f=function(){N(l)},d=function(){var e=S[x];e&&e[1]===i&&delete S[x]},p={isValidating:!0},ui(R().data)&&(p.isLoading=!0),m.label=1;case 1:return m.trys.push([1,3,,4]),s&&(N(p),n.loadingTimeout&&ui(R().data)&&setTimeout((function(){a&&c()&&C().onLoadingSlow(x,n)}),n.loadingTimeout),S[x]=[t(k),Ii()]),y=h(S[x],2),r=y[0],i=y[1],[4,r];case 2:return r=m.sent(),s&&setTimeout(d,n.dedupingInterval),S[x]&&S[x][1]===i?(l.error=ii,v=_[x],!ui(v)&&(i<=v[0]||i<=v[1]||0===v[1])?[2,(f(),s&&c()&&C().onDiscarded(x),!1)]:(g=R().data,l.data=o(g,r)?g:r,s&&c()&&C().onSuccess(r,x,n),[3,4])):[2,(s&&c()&&C().onDiscarded(x),!1)];case 3:return b=m.sent(),d(),O=C(),E=O.shouldRetryOnError,O.isPaused()||(l.error=b,s&&c()&&(O.onError(b,x,O),(!0===E||si(E)&&E(b))&&I()&&O.onErrorRetry(b,x,O,(function(e){var t=w[x];t&&t[0]&&t[0](3,e)}),{retryCount:(u.retryCount||0)+1,dedupe:!0}))),[3,4];case 4:return[2,(a=!1,f(),!0)]}}))}));return function(t){return e.apply(this,arguments)}}(),[x,r]),ne=(0,ro.useCallback)((function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ae.apply(void 0,[r,A.current].concat(p(t)))}),[]);if(ji((function(){T.current=t,D.current=n,ui(q)||(Y.current=q)})),ji((function(){if(x){var e=te.bind(ii,Qi),t=0,n=function(e,t,n){var r=t[e]||(t[e]=[]);return r.push(n),function(){var e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}}(x,w,(function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(0==n){var o=Date.now();C().revalidateOnFocus&&o>t&&I()&&(t=o+C().focusThrottleInterval,e())}else if(1==n)C().revalidateOnReconnect&&I()&&e();else{if(2==n)return te();if(3==n)return te(r)}}));return j.current=!1,A.current=x,P.current=!0,N({_k:k}),Q&&(ui(W)||Pi?e():function(e){mi&&y(window.requestAnimationFrame)!=vi?window.requestAnimationFrame(e):setTimeout(e,1)}(e)),function(){j.current=!0,n()}}}),[x]),ji((function(){var e,t=function(){var t=si(l)?l(R().data):l;t&&-1!==e&&(e=setTimeout(n,t))},n=function(){R().error||!d&&!C().isVisible()||!v&&!C().isOnline()?t():te(Qi).then(t)};return t(),function(){e&&(clearTimeout(e),e=-1)}}),[l,d,v,x]),(0,ro.useDebugValue)(J),a&&ui(W)&&x){if(!ki&&Pi)throw new Error("Fallback data is required when using suspense in SSR.");T.current=t,D.current=n,j.current=!1;var re=O[x];if(!ui(re)){var oe=ne(re);Ji(oe)}if(!ui($))throw $;var ie=te(Qi);ui(J)||(ie.status="fulfilled",ie.value=!0),Ji(ie)}return{mutate:ne,get data(){return B.data=!0,J},get error(){return B.error=!0,$},get isValidating(){return B.isValidating=!0,X},get isLoading(){return B.isLoading=!0,ee}}},function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=ci(Ui,(0,ro.useContext)(zi)),o=h(qi(t),3),i=o[0],a=o[1],u=o[2],s=Ki(r,u),c=Yi,l=(s.use||[]).concat(Wi),f=l.length;f--;)c=l[f](c);return c(i,a||s.fetcher||null,s)}),Xi=A(641);function ea(e,t,n){return ea=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&na(o,n.prototype),o},ea.apply(null,arguments)}function ta(e){return ta=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ta(e)}function na(e,t){return na=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},na(e,t)}function ra(e){var t="function"==typeof Map?new Map:void 0;return ra=function(e){if(null===e||!function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return ea(e,arguments,ta(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),na(n,e)},ra(e)}(0,Jo.createGlobalStore)("breadcrumbs",[]);var oa="/ws/rest/v1";"".concat(oa,"/session"),ra(Error),"".concat(oa,"/attachment"),(0,Jo.createGlobalStore)("session",{loaded:!1,session:null}).subscribe((function(e){return e.session&&(i=null!==(o=null==(t=e.session)||null===(n=t.user)||void 0===n||null===(r=n.userProperties)||void 0===r?void 0:r.defaultLocale)&&void 0!==o?o:t.locale,a=document.documentElement.getAttribute("lang"),void(function(e){if(void 0===e||"string"!=typeof e)return!1;try{new Intl.Locale(e)}catch(e){return!1}return!0}(i)&&i!==a&&document.documentElement.setAttribute("lang",i)));var t,n,r,o,i,a})),A(593);var ia,aa,ua,sa,ca,la=function(){try{return JSON.parse(localStorage.getItem("openmrs:visitStoreState")||"null")}catch(e){return null}}()||{patientUuid:null,manuallySetVisitUuid:null};(0,Jo.getGlobalStore)("visit",la).subscribe((function(e){var t;t=e,localStorage.setItem("openmrs:visitStoreState",JSON.stringify(t))})),new oo.BehaviorSubject(null),function(e){e.NEWVISIT="startVisit",e.EDITVISIT="editVisit",e.LOADING="loadingVisit"}(ia||(ia={})),function(e){e.NOTSTARTED="notStarted",e.ONGOING="ongoing"}(aa||(aa={})),(sa=ua||(ua={})).Array="Array",sa.Boolean="Boolean",sa.ConceptUuid="ConceptUuid",sa.Number="Number",sa.Object="Object",sa.String="String",sa.UUID="UUID",sa.PersonAttributeTypeUuid="PersonAttributeTypeUuid",sa.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid",Te((function(e){if(!e||"string"!=typeof e)return!1;for(var t=/\${(.*?)}/g,n=t.exec(e);n;){if(!ca.includes(n[1]))return!1;n=t.exec(e)}return!0}),"Should be a URL or path. The allowed template parameters are "+(ca=[].concat(["openmrsBase","openmrsSpaBase"])).map((function(e){return"${"+e+"}"})).join(", "));var fa="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t},da=Object.prototype.toString,ha=function(){return"[object Arguments]"===da.call(arguments)?function(e){return"[object Arguments]"===da.call(e)}:function(e){return Ne("callee",e)}}(),pa=ha,ya=!{toString:null}.propertyIsEnumerable("toString"),va=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],ma=function(){return arguments.propertyIsEnumerable("length")}(),ga=function(e,t){for(var n=0;n<e.length;){if(e[n]===t)return!0;n+=1}return!1},ba="function"!=typeof Object.keys||ma?Ce((function(e){if(Object(e)!==e)return[];var t,n,r=[],o=ma&&pa(e);for(t in e)!Ne(t,e)||o&&"length"===t||(r[r.length]=t);if(ya)for(n=va.length-1;n>=0;)Ne(t=va[n],e)&&!ga(r,t)&&(r[r.length]=t),n-=1;return r})):Ce((function(e){return Object(e)!==e?[]:Object.keys(e)})),wa=Ce((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));function _a(e,t,n,r){if(fa(e,t))return!0;var o=wa(e);if(o!==wa(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(o){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if((void 0===e?"undefined":Le(e))!==(void 0===t?"undefined":Le(t))||!fa(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!fa(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var i=n.length-1;i>=0;){if(n[i]===e)return r[i]===t;i-=1}switch(o){case"Map":return e.size===t.size&&Fe(e.entries(),t.entries(),n.concat([e]),r.concat([t]));case"Set":return e.size===t.size&&Fe(e.values(),t.values(),n.concat([e]),r.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var a=ba(e);if(a.length!==ba(t).length)return!1;var u=n.concat([e]),s=r.concat([t]);for(i=a.length-1;i>=0;){var c=a[i];if(!Ne(c,t)||!_a(t[c],e[c],u,s))return!1;i-=1}return!0}var Sa=Ie((function(e,t){return _a(e,t,[],[])})),Oa=Sa;function Ea(e,t,n,r){var o,i=function(o){for(var i=t.length,a=0;a<i;){if(e===t[a])return n[a];a+=1}for(var u in t[a+1]=e,n[a+1]=o,e)o[u]=r?Ea(e[u],t,n,!0):e[u];return o};switch(wa(e)){case"Object":return i({});case"Array":return i([]);case"Date":return new Date(e.valueOf());case"RegExp":return o=e,new RegExp(o.source,(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.sticky?"y":"")+(o.unicode?"u":""));default:return e}}var xa=Ce((function(e){return null!=e&&"function"==typeof e.clone?e.clone():Ea(e,[],[],!0)})),ka=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)},Pa=Ce((function(e){return!!ka(e)||!!e&&"object"==typeof e&&!function(e){return"[object String]"===Object.prototype.toString.call(e)}(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1))})),ja=Pa,Aa=function(){var e=function(e){this.f=e};return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}(),Ta=Ie((function(e,t){return function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,n){return t.apply(this,arguments)};case 3:return function(e,n,r){return t.apply(this,arguments)};case 4:return function(e,n,r,o){return t.apply(this,arguments)};case 5:return function(e,n,r,o,i){return t.apply(this,arguments)};case 6:return function(e,n,r,o,i,a){return t.apply(this,arguments)};case 7:return function(e,n,r,o,i,a,u){return t.apply(this,arguments)};case 8:return function(e,n,r,o,i,a,u,s){return t.apply(this,arguments)};case 9:return function(e,n,r,o,i,a,u,s,c){return t.apply(this,arguments)};case 10:return function(e,n,r,o,i,a,u,s,c,l){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(e.length,(function(){return e.apply(t,arguments)}))})),Da=Ta,Ca="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Ia=Be((function(e,t,n){if("function"==typeof e&&(e=function(e){return new Aa(e)}(e)),ja(n))return function(e,t,n){for(var r=0,o=n.length;r<o;){if((t=e["@@transducer/step"](t,n[r]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}r+=1}return e["@@transducer/result"](t)}(e,t,n);if("function"==typeof n["fantasy-land/reduce"])return Ke(e,t,n,"fantasy-land/reduce");if(null!=n[Ca])return Ue(e,t,n[Ca]());if("function"==typeof n.next)return Ue(e,t,n);if("function"==typeof n.reduce)return Ke(e,t,n,"reduce");throw new TypeError("reduce: list must be array or iterable")})),Ma=Be((function(e,t,n){var r,o={};for(r in t)Ne(r,t)&&(o[r]=Ne(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)Ne(r,n)&&!Ne(r,o)&&(o[r]=n[r]);return o})),Ra=Ma,Na=Be((function e(t,n,r){return Ra((function(n,r,o){return ze(r)&&ze(o)?e(t,r,o):t(n,r,o)}),n,r)})),La=Na,Fa=Ie((function(e,t){return La((function(e,t,n){return n}),e,t)})),Ba=Te((function(e){return Array.isArray(e)}),"must be an array"),Ua=Te((function(e){return"boolean"==typeof e}),"must be a boolean"),Ka=Te((function(e){return"number"==typeof e}),"must be a number"),za=Te((function(e){return"string"==typeof e}),"must be a string"),Va=Te((function(e){return"object"==typeof e&&!Array.isArray(e)&&null!==e}),"must be an object (not an array or null)"),Ga=Te((function(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)||/^[0-9a-f]{36}$/i.test(e)}),"must be a valid UUID or a 36-character hexadecimal string"),Ha=(0,Jo.createGlobalStore)("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),qa=(0,Jo.createGlobalStore)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(e){return{}}}()});qa.subscribe((function(e){var t;t=e.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(t))}));var Wa=(0,Jo.createGlobalStore)("config-store-of-extension-state",{mountedExtensions:[]}),$a=(0,Jo.createGlobalStore)("config-implementer-tools",{config:{}});function Ya(e){return e.hasOwnProperty("_default")?We(qe({},e),{_value:e._default,_source:"default"}):dt(e)?Object.keys(e).reduce((function(t,n){return t[n]=Ya(e[n]),t}),{}):{}}function Ja(e,t){return dt(e)?Object.keys(e).reduce((function(n,r){return n[r]=Ja(e[r],t),n}),{}):{_value:e,_source:t}}function Qa(e,t,n){ct(n,e._type,t),dt(t)?e._type===ua.Object?function(e,t,n){if(e._elements){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=t[s];st(e._elements,c,"".concat(n,".").concat(s))}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}}(e,t,n):e.hasOwnProperty("_default")||e.hasOwnProperty("_type")||st(e,t,n):e._type===ua.Array&&function(e,t,n){if(ct(n,ua.Array,t)){if(ft(e._elements))for(var r=0;r<t.length;r++)Qa(e._elements,t[r],"".concat(n,"[").concat(r,"]"));for(var o=0;o<t.length;o++){var i;ct("".concat(n,"[").concat(o,"]"),null===(i=e._elements)||void 0===i?void 0:i._type,t[o])}}}(e,t,n)}function Za(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(e)if(t!==e._default&&lt(n,e._validators,t),dt(t)){var r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(t)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value,c=t[s],l=n+"."+s,f=e[s];e._type===ua.Object&&e._elements?Za(e._elements,c,l):Za(f,c,l)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}}else if(Array.isArray(t)&&e._elements)for(var d=0;d<t.length;d++)Za(e._elements,t[d],"".concat(n,"[").concat(d,"]"))}Qe(Ha.getState(),qa.getState()),Ha.subscribe((function(e){return Qe(e,qa.getState())})),qa.subscribe((function(e){return Qe(Ha.getState(),e)})),Xe(Ha.getState(),qa.getState()),Ha.subscribe((function(e){return Xe(e,qa.getState())})),qa.subscribe((function(e){return Xe(Ha.getState(),e)})),Ze(Ha.getState(),qa.getState()),Ha.subscribe((function(e){return Ze(e,qa.getState())})),qa.subscribe((function(e){return Ze(Ha.getState(),e)})),et(Ha.getState(),Wa.getState(),qa.getState()),Ha.subscribe((function(e){et(e,Wa.getState(),qa.getState())})),Wa.subscribe((function(e){et(Ha.getState(),e,qa.getState())})),qa.subscribe((function(e){et(Ha.getState(),Wa.getState(),e)}));var Xa=function(e,t){var n=xa(t);if(!e)return n;var r=!0,o=!1,i=void 0;try{for(var a,u=function(){var t=a.value,r=n[t],o=e[t];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(t)||(n[t]=o._default);var i=o._elements;if(r&&ft(i))if(o._type===ua.Array&&Array.isArray(r)){var u=r.map((function(e){return Xa(i,e)}));n[t]=u}else if(o._type===ua.Object){var s=!0,c=!1,l=void 0;try{for(var f,d=Object.keys(r)[Symbol.iterator]();!(s=(f=d.next()).done);s=!0){var h=f.value;r[h]=Xa(i,r[h])}}catch(e){c=!0,l=e}finally{try{s||null==d.return||d.return()}finally{if(c)throw l}}}}else if(dt(o)){var p=null!=r?r:{};dt(p)&&(n[t]=Xa(o,p))}},s=Object.keys(e)[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u()}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return n},eu=new Set,tu={"Translation overrides":{_description:"Per-language overrides for frontend translations should be keyed by language code and each language dictionary contains the translation key and the display value",_type:ua.Object,_default:{},_validators:[Te((function(e){return Object.keys(e).every((function(e){return/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)}))}),(function(e){var t=Object.keys(e).filter((function(e){return!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(e)}));return"The 'Translation overrides' object should have language codes for keys. Language codes must be in the form of a two-to-three letter language code optionally followed by a hyphen and a two-to-three letter country code. The following keys do not conform: ".concat(t.join(", "),".")}))]}},nu=qe({"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:ua.Array,_default:[]}}},tu);A(570);var ru=function(e,t){return e===t||e!=e&&t!=t},ou=function(e,t){for(var n=e.length;n--;)if(ru(e[n][0],t))return n;return-1},iu=Array.prototype.splice;pt.prototype.clear=function(){this.__data__=[],this.size=0},pt.prototype.delete=function(e){var t=this.__data__,n=ou(t,e);return!(n<0||(n==t.length-1?t.pop():iu.call(t,n,1),--this.size,0))},pt.prototype.get=function(e){var t=this.__data__,n=ou(t,e);return n<0?void 0:t[n][1]},pt.prototype.has=function(e){return ou(this.__data__,e)>-1},pt.prototype.set=function(e,t){var n=this.__data__,r=ou(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var au,uu=pt,su="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,cu="object"==typeof self&&self&&self.Object===Object&&self,lu=su||cu||Function("return this")(),fu=lu.Symbol,du=Object.prototype,hu=du.hasOwnProperty,pu=du.toString,yu=fu?fu.toStringTag:void 0,vu=Object.prototype.toString,mu=fu?fu.toStringTag:void 0,gu=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":mu&&mu in Object(e)?function(e){var t=hu.call(e,yu),n=e[yu];try{e[yu]=void 0;var r=!0}catch(e){}var o=pu.call(e);return r&&(t?e[yu]=n:delete e[yu]),o}(e):function(e){return vu.call(e)}(e)},bu=function(e){var t,n=void 0===e?"undefined":(t=e)&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":void 0===t?"undefined":y(t);return null!=e&&("object"==n||"function"==n)},wu=function(e){if(!bu(e))return!1;var t=gu(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},_u=lu["__core-js_shared__"],Su=(au=/[^.]+$/.exec(_u&&_u.keys&&_u.keys.IE_PROTO||""))?"Symbol(src)_1."+au:"",Ou=Function.prototype.toString,Eu=function(e){if(null!=e){try{return Ou.call(e)}catch(e){}try{return e+""}catch(e){}}return""},xu=/^\[object .+?Constructor\]$/,ku=Function.prototype,Pu=Object.prototype,ju=ku.toString,Au=Pu.hasOwnProperty,Tu=RegExp("^"+ju.call(Au).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Du=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!bu(e)||(t=e,Su&&Su in t))&&(wu(e)?Tu:xu).test(Eu(e));var t}(n)?n:void 0},Cu=Du(lu,"Map"),Iu=Du(Object,"create"),Mu=Object.prototype.hasOwnProperty,Ru=Object.prototype.hasOwnProperty;yt.prototype.clear=function(){this.__data__=Iu?Iu(null):{},this.size=0},yt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},yt.prototype.get=function(e){var t=this.__data__;if(Iu){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Mu.call(t,e)?t[e]:void 0},yt.prototype.has=function(e){var t=this.__data__;return Iu?void 0!==t[e]:Ru.call(t,e)},yt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Iu&&void 0===t?"__lodash_hash_undefined__":t,this};var Nu=yt,Lu=function(e,t){var n,r,o,i=e.__data__;return("string"==(o=void 0===(n=t)?"undefined":(r=n)&&"undefined"!=typeof Symbol&&r.constructor===Symbol?"symbol":void 0===r?"undefined":y(r))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};vt.prototype.clear=function(){this.size=0,this.__data__={hash:new Nu,map:new(Cu||uu),string:new Nu}},vt.prototype.delete=function(e){var t=Lu(this,e).delete(e);return this.size-=t?1:0,t},vt.prototype.get=function(e){return Lu(this,e).get(e)},vt.prototype.has=function(e){return Lu(this,e).has(e)},vt.prototype.set=function(e,t){var n=Lu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var Fu=vt;mt.prototype.clear=function(){this.__data__=new uu,this.size=0},mt.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},mt.prototype.get=function(e){return this.__data__.get(e)},mt.prototype.has=function(e){return this.__data__.has(e)},mt.prototype.set=function(e,t){var n,r,o=this.__data__;if(n=o,null!=(r=uu)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):l(n,r)){var i=o.__data__;if(!Cu||i.length<199)return i.push([e,t]),this.size=++o.size,this;o=this.__data__=new Fu(i)}return o.set(e,t),this.size=o.size,this};var Bu=mt;gt.prototype.add=gt.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},gt.prototype.has=function(e){return this.__data__.has(e)};var Uu=gt,Ku=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},zu=function(e,t){return e.has(t)},Vu=function(e,t,n,r,o,i){var a=1&n,u=e.length,s=t.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var f=-1,d=!0,h=2&n?new Uu:void 0;for(i.set(e,t),i.set(t,e);++f<u;){var p=e[f],y=t[f];if(r)var v=a?r(y,p,f,t,e,i):r(p,y,f,e,t,i);if(void 0!==v){if(v)continue;d=!1;break}if(h){if(!Ku(t,(function(e,t){if(!zu(h,t)&&(p===e||o(p,e,n,r,i)))return h.push(t)}))){d=!1;break}}else if(p!==y&&!o(p,y,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},Gu=lu.Uint8Array,Hu=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},qu=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},Wu=fu?fu.prototype:void 0,$u=Wu?Wu.valueOf:void 0,Yu=Array.isArray,Ju=Object.prototype.propertyIsEnumerable,Qu=Object.getOwnPropertySymbols,Zu=Qu?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a)&&(i[o++]=a)}return i}(Qu(e),(function(t){return Ju.call(e,t)})))}:function(){return[]},Xu=function(e){return null!=e&&"object"==typeof e},es=function(e){return Xu(e)&&"[object Arguments]"==gu(e)},ts=Object.prototype,ns=ts.hasOwnProperty,rs=ts.propertyIsEnumerable,os=es(function(){return arguments}())?es:function(e){return Xu(e)&&ns.call(e,"callee")&&!rs.call(e,"callee")},is=os,as=t&&!t.nodeType&&t,us=as&&e&&!e.nodeType&&e,ss=us&&us.exports===as?lu.Buffer:void 0,cs=(ss?ss.isBuffer:void 0)||function(){return!1},ls=/^(?:0|[1-9]\d*)$/,fs=function(e,t){var n,r=void 0===e?"undefined":(n=e)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":y(n);return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&ls.test(e))&&e>-1&&e%1==0&&e<t},ds=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},hs={};hs["[object Float32Array]"]=hs["[object Float64Array]"]=hs["[object Int8Array]"]=hs["[object Int16Array]"]=hs["[object Int32Array]"]=hs["[object Uint8Array]"]=hs["[object Uint8ClampedArray]"]=hs["[object Uint16Array]"]=hs["[object Uint32Array]"]=!0,hs["[object Arguments]"]=hs["[object Array]"]=hs["[object ArrayBuffer]"]=hs["[object Boolean]"]=hs["[object DataView]"]=hs["[object Date]"]=hs["[object Error]"]=hs["[object Function]"]=hs["[object Map]"]=hs["[object Number]"]=hs["[object Object]"]=hs["[object RegExp]"]=hs["[object Set]"]=hs["[object String]"]=hs["[object WeakMap]"]=!1;var ps,ys=t&&!t.nodeType&&t,vs=ys&&e&&!e.nodeType&&e,ms=vs&&vs.exports===ys&&su.process,gs=function(){try{return vs&&vs.require&&vs.require("util").types||ms&&ms.binding&&ms.binding("util")}catch(e){}}(),bs=gs&&gs.isTypedArray,ws=bs?(ps=bs,function(e){return ps(e)}):function(e){return Xu(e)&&ds(e.length)&&!!hs[gu(e)]},_s=Object.prototype.hasOwnProperty,Ss=Object.prototype,Os=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Es=Object.prototype.hasOwnProperty,xs=function(e){return null!=(t=e)&&ds(t.length)&&!wu(t)?function(e,t){var n=Yu(e),r=!n&&is(e),o=!n&&!r&&cs(e),i=!n&&!r&&!o&&ws(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=u.length;for(var c in e)!_s.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||fs(c,s))||u.push(c);return u}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Ss))return Os(e);var t,n,r=[];for(var o in Object(e))Es.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},ks=function(e){return function(e,t,n){var r=t(e);return Yu(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,xs,Zu)},Ps=Object.prototype.hasOwnProperty,js=Du(lu,"DataView"),As=Du(lu,"Promise"),Ts=Du(lu,"Set"),Ds=Du(lu,"WeakMap"),Cs="[object Map]",Is="[object Promise]",Ms="[object Set]",Rs="[object WeakMap]",Ns="[object DataView]",Ls=Eu(js),Fs=Eu(Cu),Bs=Eu(As),Us=Eu(Ts),Ks=Eu(Ds),zs=gu;(js&&zs(new js(new ArrayBuffer(1)))!=Ns||Cu&&zs(new Cu)!=Cs||As&&zs(As.resolve())!=Is||Ts&&zs(new Ts)!=Ms||Ds&&zs(new Ds)!=Rs)&&(zs=function(e){var t=gu(e),n="[object Object]"==t?e.constructor:void 0,r=n?Eu(n):"";if(r)switch(r){case Ls:return Ns;case Fs:return Cs;case Bs:return Is;case Us:return Ms;case Ks:return Rs}return t});var Vs=zs,Gs="[object Arguments]",Hs="[object Array]",qs="[object Object]",Ws=Object.prototype.hasOwnProperty,$s=function e(t,n,r,o,i){return t===n||(null==t||null==n||!Xu(t)&&!Xu(n)?t!=t&&n!=n:function(e,t,n,r,o,i){var a=Yu(e),u=Yu(t),s=a?Hs:Vs(e),c=u?Hs:Vs(t),l=(s=s==Gs?qs:s)==qs,f=(c=c==Gs?qs:c)==qs,d=s==c;if(d&&cs(e)){if(!cs(t))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new Bu),a||ws(e)?Vu(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new Gu(e),new Gu(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ru(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=Hu;case"[object Set]":var s=1&r;if(u||(u=qu),e.size!=t.size&&!s)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var l=Vu(u(e),u(t),r,o,i,a);return a.delete(e),l;case"[object Symbol]":if($u)return $u.call(e)==$u.call(t)}return!1}(e,t,s,n,r,o,i);if(!(1&n)){var h=l&&Ws.call(e,"__wrapped__"),p=f&&Ws.call(t,"__wrapped__");if(h||p){var y=h?e.value():e,v=p?t.value():t;return i||(i=new Bu),o(y,v,n,r,i)}}return!!d&&(i||(i=new Bu),function(e,t,n,r,o,i){var a=1&n,u=ks(e),s=u.length;if(s!=ks(t).length&&!a)return!1;for(var c=s;c--;){var l=u[c];if(!(a?l in t:Ps.call(t,l)))return!1}var f=i.get(e),d=i.get(t);if(f&&d)return f==t&&d==e;var h=!0;i.set(e,t),i.set(t,e);for(var p=a;++c<s;){var y=e[l=u[c]],v=t[l];if(r)var m=a?r(v,y,l,t,e,i):r(y,v,l,e,t,i);if(!(void 0===m?y===v||o(y,v,n,r,i):m)){h=!1;break}p||(p="constructor"==l)}if(h&&!p){var g=e.constructor,b=t.constructor;g==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&bt(g,g)&&"function"==typeof b&&bt(b,b)||(h=!1)}return i.delete(e),i.delete(t),h}(e,t,n,r,o,i))}(t,n,r,o,e,i))},Ys=function(e,t){return $s(e,t)},Js=function(e){return void 0===e},Qs=(0,Jo.createGlobalStore)("extensionsInternal",{slots:{},extensions:{}}),Zs=function(){return(0,Jo.getGlobalStore)("extensionsInternal",{slots:{},extensions:{}})};wt(Qs.getState()),Qs.subscribe(wt),(0,Jo.createGlobalStore)("modalRegistry",{modals:{}}),(0,Jo.createGlobalStore)("workspaceRegistrations",{workspaces:{}}),new Set,Zs();var Xs=Zs(),ec=(0,Jo.getGlobalStore)("extensions",{slots:{}}),tc=(0,Yr.getExtensionSlotsConfigStore)(),nc=(0,Yr.getExtensionsConfigStore)();Xs.subscribe((function(e){xt(e,tc.getState(),nc.getState())})),tc.subscribe((function(e){xt(Xs.getState(),e,nc.getState())})),nc.subscribe((function(e){xt(Xs.getState(),tc.getState(),e)}));var rc={flags:function(){var e={},t=!0,n=!1,r=void 0;try{for(var o,i=Object.keys(localStorage)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;if(a.startsWith("openmrs:feature-flag:")){var u=a.replace("openmrs:feature-flag:",""),s=JSON.parse(localStorage.getItem("openmrs:feature-flag-meta:".concat(u))||"{}");e[u]=Dt({enabled:"true"===localStorage.getItem(a)},s)}}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return e}()};(0,Jo.getGlobalStore)("feature-flags",rc).subscribe((function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=Object.entries(e.flags)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=Ct(o.value,2),u=a[0],s=a[1];localStorage.setItem("openmrs:feature-flag:".concat(u),s.enabled.toString()),localStorage.setItem("openmrs:feature-flag-meta:".concat(u),JSON.stringify({label:s.label,description:s.description}))}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}));var oc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,ic=Object.keys,ac=Array.isArray;"undefined"==typeof Promise||oc.Promise||(oc.Promise=Promise);var uc=Object.getPrototypeOf,sc={}.hasOwnProperty,cc=Object.defineProperty,lc=Object.getOwnPropertyDescriptor;function fc(e,t){var n;return lc(e,t)||(n=uc(e))&&fc(n,t)}var dc=[].slice;function hc(e,t){if(Mt(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=hc(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var u=e[t.substr(0,a)];return void 0===u?void 0:hc(u,t.substr(a+1))}}function pc(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Ut("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)pc(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),u=t.substr(i+1);if(""===u)void 0===n?ac(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var s=e[a];s&&Mt(e,a)||(s=e[a]={}),pc(s,u,n)}}else void 0===n?ac(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}var yc=[].concat,vc="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Gt([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return oc[e]})),mc=vc.map((function(e){return oc[e]}));zt(vc,(function(e){return[e,!0]}));var gc=null;function bc(e){if(!e||"object"!=typeof e)return e;var t=gc&&gc.get(e);if(t)return t;if(ac(e)){t=[],gc&&gc.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(bc(e[n]))}else if(mc.indexOf(e.constructor)>=0)t=e;else{var o=uc(e);for(var i in t=o===Object.prototype?{}:Object.create(o),gc&&gc.set(e,t),e)Mt(e,i)&&(t[i]=bc(e[i]))}return t}var wc={}.toString,_c="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",Sc="symbol"==(void 0===_c?"undefined":y(_c))?function(e){var t;return null!=e&&(t=e[_c])&&t.apply(e)}:function(){return null},Oc={},Ec="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},xc="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),kc=function(){return!0},Pc=!new Error("").stack;function jc(){if(Pc)try{throw jc.arguments,new Error}catch(e){return e}return new Error}var Ac=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Tc=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ac),Dc={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};Lt(Jt).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Yt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),Lt(Zt).from(Jt),Lt(Xt).from(Jt);var Cc=Tc.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Ic=Jt,Mc=Tc.reduce((function(e,t){var n=function(e,n){this._e=jc(),this.name=r,e?"string"==typeof e?(this.message="".concat(e).concat(n?"\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=Dc[t]||r,this.inner=null)},r=t+"Error";return Lt(n).from(Ic),e[t]=n,e}),{});Mc.Syntax=SyntaxError,Mc.Type=TypeError,Mc.Range=RangeError;var Rc=Ac.reduce((function(e,t){return e[t+"Error"]=Mc[t],e}),{}),Nc=Tc.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Mc[t]),e}),{});Nc.ModifyError=Zt,Nc.DexieError=Jt,Nc.BulkError=Xt;var Lc={},Fc=h("undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,uc(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,uc(t),e]}(),3),Bc=Fc[0],Uc=Fc[1],Kc=Fc[2],zc=Uc&&Uc.then,Vc=Bc&&Bc.constructor,Gc=!!Kc,Hc=!1,qc=Kc?function(){Kc.then(mn)}:oc.setImmediate?setImmediate.bind(null,mn):oc.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){mn(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(mn,0)},Wc=function(e,t){nl.push([e,t]),Yc&&(qc(),Yc=!1)},$c=!0,Yc=!0,Jc=[],Qc=[],Zc=null,Xc=tn,el={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Rn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Rn(e[0],e[1])}catch(e){}}))}},tl=el,nl=[],rl=0,ol=[],il={get:function(){var e=tl,t=dl;function n(n,r){var o=this,i=!e.global&&(e!==tl||t!==dl),a=i&&!xn(),u=new ln((function(t,u){pn(o,new fn(In(n,e,i,a),In(r,e,i,a),t,u,e))}));return xc&&vn(u,this),u}return n.prototype=Lc,n},set:function(e){Nt(this,"then",e&&e.prototype===Lc?il:{get:function(){return e},set:il.set})}};function al(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&gn();t&&"function"==typeof t.then?al(e,(function(e,n){l(t,ln)?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,hn(e)),n&&bn()}}),dn.bind(null,e))}catch(t){dn(e,t)}}function ul(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,r=Yt(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+r)}return xc&&((r=Yt(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&ul(e._prev,t,n)),t}Rt(ln.prototype,{then:il,_then:function(e,t){pn(this,new fn(null,null,e,t,tl))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return l(e,t)?n(e):_n(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):_n(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),_n(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Hc=!0;var e=ul(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Hc=!1}}},timeout:function(e,t){var n=this;return e<1/0?new ln((function(r,o){var i=setTimeout((function(){return o(new Mc.Timeout(t))}),e);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Nt(ln.prototype,Symbol.toStringTag,"Dexie.Promise"),el.env=Tn(),Rt(ln,{all:function(){var e=Wt.apply(null,arguments).map(kn);return new ln((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(o,i){return ln.resolve(o).then((function(n){e[i]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(l(e,ln))return e;if(e&&"function"==typeof e.then)return new ln((function(t,n){e.then(t,n)}));var t=new ln(Lc,!0,e);return vn(t,Zc),t},reject:_n,race:function(){var e=Wt.apply(null,arguments).map(kn);return new ln((function(t,n){e.map((function(e){return ln.resolve(e).then(t,n)}))}))},PSD:{get:function(){return tl},set:function(e){return tl=e}},totalEchoes:{get:function(){return dl}},newPSD:On,usePSD:Dn,scheduler:{get:function(){return Wc},set:function(e){Wc=e}},rejectionMapper:{get:function(){return Xc},set:function(e){Xc=e}},follow:function(e,t){return new ln((function(n,r){return On((function(t,n){var r=tl;r.unhandleds=[],r.onunhandled=n,r.finalize=rn((function(){var e=this;!function(e){ol.push((function t(){e(),ol.splice(ol.indexOf(t),1)})),++rl,Wc((function(){0==--rl&&wn()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}}),Vc&&(Vc.allSettled&&Nt(ln,"allSettled",(function(){var e=Wt.apply(null,arguments).map(kn);return new ln((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,o){return ln.resolve(e).then((function(e){return r[o]={status:"fulfilled",value:e}}),(function(e){return r[o]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),Vc.any&&"undefined"!=typeof AggregateError&&Nt(ln,"any",(function(){var e=Wt.apply(null,arguments).map(kn);return new ln((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach((function(e,i){return ln.resolve(e).then((function(e){return t(e)}),(function(e){o[i]=e,--r||n(new AggregateError(o))}))}))}))})));var sl={awaits:0,echoes:0,id:0},cl=0,ll=[],fl=0,dl=0,hl=0;-1===(""+zc).indexOf("[native code]")&&(En=xn=en);var pl=ln.reject;function yl(e,t,n,r){if(e.idbdb&&(e._state.openComplete||tl.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===Cc.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return yl(e,t,n,r)}))):pl(o)}return o._promise(t,(function(e,t){return On((function(){return tl.trans=o,r(e,t,o)}))})).then((function(e){return o._completion.then((function(){return e}))}))}if(e._state.openComplete)return pl(new Mc.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return pl(new Mc.DatabaseClosed);e.open().catch(en)}return e._state.dbReadyPromise.then((function(){return yl(e,t,n,r)}))}var vl=String.fromCharCode(65535),ml="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",gl=[],bl="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),wl=bl,_l=bl,Sl=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},Ol={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},El=function(){function e(){a(this,e)}return s(e,[{key:"_trans",value:function(e,t,n){var r=this._tx||tl.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new Mc.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}var a=gn();try{return r&&r.db===this.db?r===tl.trans?r._promise(e,i,n):On((function(){return r._promise(e,i,n)}),{trans:r,transless:tl.transless||tl}):yl(this.db,e,[this.name],i)}finally{a&&bn()}}},{key:"get",value:function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)}},{key:"where",value:function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(ac(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=ic(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return t.indexOf(e)>=0}))}))[0];if(n&&this.db._maxKey!==vl)return this.where(n.name).equals(n.keyPath.map((function(t){return e[t]})));!n&&xc&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit of a compound index [").concat(t.join("+"),"]"));var r=this.schema.idxByName,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}var a=h(t.reduce((function(t,n){var o=h(t,2),a=o[0],u=o[1],s=r[n],c=e[n];return[a||s,a||!s?Nn(u,s&&s.multi?function(e){var t=hc(e,n);return ac(t)&&t.some((function(e){return i(c,e)}))}:function(e){return i(c,hc(e,n))}):u]}),[null,null]),2),u=a[0],s=a[1];return u?this.where(u.name).equals(e[u.keyPath]).filter(s):n?this.filter(s):this.where(t).equals("")}},{key:"filter",value:function(e){return this.toCollection().and(e)}},{key:"count",value:function(e){return this.toCollection().count(e)}},{key:"offset",value:function(e){return this.toCollection().offset(e)}},{key:"limit",value:function(e){return this.toCollection().limit(e)}},{key:"each",value:function(e){return this.toCollection().each(e)}},{key:"toArray",value:function(e){return this.toCollection().toArray(e)}},{key:"toCollection",value:function(){return new this.db.Collection(new this.db.WhereClause(this))}},{key:"orderBy",value:function(e){return new this.db.Collection(new this.db.WhereClause(this,ac(e)?"[".concat(e.join("+"),"]"):e))}},{key:"reverse",value:function(){return this.toCollection().reverse()}},{key:"mapToClass",value:function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(Mt(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}},{key:"defineClass",value:function(){return this.mapToClass((function(e){It(this,e)}))}},{key:"add",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Ln(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?ln.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{pc(e,i,t)}catch(e){}return t}))}},{key:"update",value:function(e,t){if("object"!=typeof e||ac(e))return this.where(":id").equals(e).modify(t);var n=hc(e,this.schema.primKey.keyPath);if(void 0===n)return pl(new Mc.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?ic(t).forEach((function(n){pc(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}},{key:"put",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Ln(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?ln.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{pc(e,i,t)}catch(e){}return t}))}},{key:"delete",value:function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?ln.reject(e.failures[0]):void 0}))}},{key:"clear",value:function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:Ol})})).then((function(e){return e.numFailures?ln.reject(e.failures[0]):void 0}))}},{key:"bulkGet",value:function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))}},{key:"bulkAdd",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Mc.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Mc.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(Ln(u)):e;return r.core.mutate({trans:t,type:"add",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new Xt("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkPut",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new Mc.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new Mc.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(Ln(u)):e;return r.core.mutate({trans:t,type:"put",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new Xt("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkDelete",value:function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,o=e.lastResult,i=e.failures;if(0===r)return o;throw new Xt("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),i)}))}}]),e}();function xl(e,t){try{var n=Wn(e),r=Wn(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i)if(e[i]!==t[i])return e[i]<t[i]?-1:1;return n===r?0:n<r?-1:1}($n(e),$n(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i){var a=xl(e[i],t[i]);if(0!==a)return a}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}var kl=function(){function e(){a(this,e)}return s(e,[{key:"_read",value:function(e,t){var n=this._ctx;return n.error?n.table._trans(null,pl.bind(null,n.error)):n.table._trans("readonly",e).then(t)}},{key:"_write",value:function(e){var t=this._ctx;return t.error?t.table._trans(null,pl.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}},{key:"_addAlgorithm",value:function(e){var t=this._ctx;t.algorithm=Nn(t.algorithm,e)}},{key:"_iterate",value:function(e,t){return Hn(this._ctx,e,t,this._ctx.table.core)}},{key:"clone",value:function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&It(n,e),t._ctx=n,t}},{key:"raw",value:function(){return this._ctx.valueMapper=null,this}},{key:"each",value:function(e){var t=this._ctx;return this._read((function(n){return Hn(t,e,n,t.table.core)}))}},{key:"count",value:function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(Un(n,!0))return r.count({trans:e,query:{index:Vn(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var o=0;return Hn(n,(function(){return++o,!1}),e,r).then((function(){return o}))})).then(e)}},{key:"sortBy",value:function(e,t){var n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function u(e,t){var n=i(e,o),r=i(t,o);return n<r?-a:n>r?a:0}return this.toArray((function(e){return e.sort(u)})).then(t)}},{key:"toArray",value:function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&Un(n,!0)&&n.limit>0){var r=n.valueMapper,o=Vn(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(e){var t=e.result;return r?t.map(r):t}))}var i=[];return Hn(n,(function(e){return i.push(e)}),e,n.table.core).then((function(){return i}))}),e)}},{key:"offset",value:function(e){var t=this._ctx;return e<=0||(t.offset+=e,Un(t)?zn(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):zn(t,(function(){var t=e;return function(){return--t<0}}))),this}},{key:"limit",value:function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),zn(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}},{key:"until",value:function(e,t){return Kn(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this}},{key:"first",value:function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}},{key:"last",value:function(e){return this.reverse().first(e)}},{key:"filter",value:function(e){var t,n;return Kn(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Nn(t.isMatch,n),this}},{key:"and",value:function(e){return this.filter(e)}},{key:"or",value:function(e){return new this.db.WhereClause(this._ctx.table,e,this)}},{key:"reverse",value:function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}},{key:"desc",value:function(){return this.reverse()}},{key:"eachKey",value:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}},{key:"eachUniqueKey",value:function(e){return this._ctx.unique="unique",this.eachKey(e)}},{key:"eachPrimaryKey",value:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}},{key:"keys",value:function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}},{key:"primaryKeys",value:function(e){var t=this._ctx;if("next"===t.dir&&Un(t,!0)&&t.limit>0)return this._read((function(e){var n=Vn(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}},{key:"uniqueKeys",value:function(e){return this._ctx.unique="unique",this.keys(e)}},{key:"firstKey",value:function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}},{key:"lastKey",value:function(e){return this.reverse().firstKey(e)}},{key:"distinct",value:function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return Kn(this._ctx,(function(e){var t=e.primaryKey.toString(),r=Mt(n,t);return n[t]=!0,!r})),this}},{key:"modify",value:function(e){var t=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof e)o=e;else{var i=ic(e),a=i.length;o=function(t){for(var n=!1,r=0;r<a;++r){var o=i[r],u=e[o];hc(t,o)!==u&&(pc(t,o,u),n=!0)}return n}}var u=n.table.core,s=u.schema.primaryKey,c=s.outbound,l=s.extractKey,f=t.db._options.modifyChunkSize||200,d=[],h=0,p=[],y=function(e,t){var n=t.failures,r=t.numFailures;h+=e-r;var o=!0,i=!1,a=void 0;try{for(var u,s=ic(n)[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value;d.push(n[c])}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}};return t.clone().primaryKeys().then((function(t){var i=function(a){var s=Math.min(f,t.length-a);return u.getMany({trans:r,keys:t.slice(a,a+s),cache:"immutable"}).then((function(d){for(var h=[],p=[],v=c?[]:null,m=[],g=0;g<s;++g){var b=d[g],w={value:Ht(b),primKey:t[a+g]};!1!==o.call(w,w.value,w)&&(null==w.value?m.push(t[a+g]):c||0===xl(l(b),l(w.value))?(p.push(w.value),c&&v.push(t[a+g])):(m.push(t[a+g]),h.push(w.value)))}var _=Un(n)&&n.limit===1/0&&("function"!=typeof e||e===Pl)&&{index:n.index,range:n.range};return Promise.resolve(h.length>0&&u.mutate({trans:r,type:"add",values:h}).then((function(e){for(var t in e.failures)m.splice(parseInt(t),1);y(h.length,e)}))).then((function(){return(p.length>0||_&&"object"==typeof e)&&u.mutate({trans:r,type:"put",keys:v,values:p,criteria:_,changeSpec:"function"!=typeof e&&e}).then((function(e){return y(p.length,e)}))})).then((function(){return(m.length>0||_&&e===Pl)&&u.mutate({trans:r,type:"delete",keys:m,criteria:_}).then((function(e){return y(m.length,e)}))})).then((function(){return t.length>a+s&&i(a+f)}))}))};return i(0).then((function(){if(d.length>0)throw new Zt("Error modifying one or more objects",d,h,p);return t.length}))}))}))}},{key:"delete",value:function(){var e=this._ctx,t=e.range;return Un(e)&&(e.isPrimKey&&!_l||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new Zt("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-r);return t-r}))}))})):this.modify(Pl)}}]),e}(),Pl=function(e,t){return t.value=null},jl=function(){function e(){a(this,e)}return s(e,[{key:"Collection",get:function(){return this._ctx.table.db.Collection}},{key:"between",value:function(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Zn(this):new this.Collection(this,(function(){return tr(e,t,!n,!r)}))}catch(e){return Qn(this,ml)}}},{key:"equals",value:function(e){return null==e?Qn(this,ml):new this.Collection(this,(function(){return nr(e)}))}},{key:"above",value:function(e){return null==e?Qn(this,ml):new this.Collection(this,(function(){return tr(e,void 0,!0)}))}},{key:"aboveOrEqual",value:function(e){return null==e?Qn(this,ml):new this.Collection(this,(function(){return tr(e,void 0,!1)}))}},{key:"below",value:function(e){return null==e?Qn(this,ml):new this.Collection(this,(function(){return tr(void 0,e,!1,!0)}))}},{key:"belowOrEqual",value:function(e){return null==e?Qn(this,ml):new this.Collection(this,(function(){return tr(void 0,e)}))}},{key:"startsWith",value:function(e){return"string"!=typeof e?Qn(this,"String expected."):this.between(e,e+vl,!0,!0)}},{key:"startsWithIgnoreCase",value:function(e){return""===e?this.startsWith(e):er(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],vl)}},{key:"equalsIgnoreCase",value:function(e){return er(this,(function(e,t){return e===t[0]}),[e],"")}},{key:"anyOfIgnoreCase",value:function(){var e=Wt.apply(Oc,arguments);return 0===e.length?Zn(this):er(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")}},{key:"startsWithAnyOfIgnoreCase",value:function(){var e=Wt.apply(Oc,arguments);return 0===e.length?Zn(this):er(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,vl)}},{key:"anyOf",value:function(){var e=this,t=Wt.apply(Oc,arguments),n=this._cmp;try{t.sort(n)}catch(e){return Qn(this,ml)}if(0===t.length)return Zn(this);var r=new this.Collection(this,(function(){return tr(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm((function(e,r,i){for(var a=e.key;n(a,t[o])>0;)if(++o===t.length)return r(i),!1;return 0===n(a,t[o])||(r((function(){e.continue(t[o])})),!1)})),r}},{key:"notEqual",value:function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}},{key:"noneOf",value:function(){var e=Wt.apply(Oc,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Qn(this,ml)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}},{key:"inAnyRange",value:function(e,t){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===e.length)return Zn(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&o(e[0],e[1])<=0})))return Qn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Mc.InvalidArgument);var s,c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,f=o;function d(e,t){return f(e[0],t[0])}try{s=e.reduce((function(e,t){for(var n=0,o=e.length;n<o;++n){var i=e[n];if(r(t[0],i[1])<0&&r(t[1],i[0])>0){i[0]=a(i[0],t[0]),i[1]=u(i[1],t[1]);break}}return n===o&&e.push(t),e}),[]),s.sort(d)}catch(e){return Qn(this,ml)}var h=0,p=l?function(e){return o(e,s[h][1])>0}:function(e){return o(e,s[h][1])>=0},y=c?function(e){return i(e,s[h][0])>0}:function(e){return i(e,s[h][0])>=0},v=p,m=new this.Collection(this,(function(){return tr(s[0][0],s[s.length-1][1],!c,!l)}));return m._ondirectionchange=function(e){"next"===e?(v=p,f=o):(v=y,f=i),s.sort(d)},m._addAlgorithm((function(e,t,r){for(var i=e.key;v(i);)if(++h===s.length)return t(r),!1;return!!function(e){return!p(e)&&!y(e)}(i)||(0===n._cmp(i,s[h][1])||0===n._cmp(i,s[h][0])||t((function(){f===o?e.continue(s[h][0]):e.continue(s[h][1])})),!1)})),m}},{key:"startsWithAnyOf",value:function(){var e=Wt.apply(Oc,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Zn(this):this.inAnyRange(e.map((function(e){return[e,e+vl]}))):Qn(this,"startsWithAnyOf() only works with strings")}}]),e}(),Al=Fn(null,"storagemutated"),Tl=function(){function e(){a(this,e)}return s(e,[{key:"_lock",value:function(){return Ut(!tl.global),++this._reculock,1!==this._reculock||tl.global||(tl.lockOwnerFor=this),this}},{key:"_unlock",value:function(){if(Ut(!tl.global),0==--this._reculock)for(tl.global||(tl.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Dn(e[1],e[0])}catch(e){}}return this}},{key:"_locked",value:function(){return this._reculock&&tl.lockOwnerFor!==this}},{key:"create",value:function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(Ut(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new Mc.DatabaseClosed(r);case"MissingAPIError":throw new Mc.MissingAPI(r.message,r);default:throw new Mc.OpenFailed(r)}if(!this.active)throw new Mc.TransactionInactive;return Ut(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Sn((function(n){or(n),t._reject(e.error)})),e.onabort=Sn((function(n){or(n),t.active&&t._reject(new Mc.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Sn((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&Al.storagemutated.fire(e.mutatedParts)})),this}},{key:"_promise",value:function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return pl(new Mc.ReadOnly("Transaction is readonly"));if(!this.active)return pl(new Mc.TransactionInactive);if(this._locked())return new ln((function(o,i){r._blockedFuncs.push([function(){r._promise(e,t,n).then(o,i)},tl])}));if(n)return On((function(){var e=new ln((function(e,n){r._lock();var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var o=new ln((function(e,n){var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return o._lib=!0,o}},{key:"_root",value:function(){return this.parent?this.parent._root():this}},{key:"waitFor",value:function(e){var t=this._root(),n=ln.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return n}));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new ln((function(e,r){n.then((function(n){return t._waitingQueue.push(Sn(e.bind(null,n)))}),(function(e){return t._waitingQueue.push(Sn(r.bind(null,e)))})).finally((function(){t._waitingFor===o&&(t._waitingFor=null)}))}))}},{key:"abort",value:function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Mc.Abort))}},{key:"table",value:function(e){var t=this._memoizedTables||(this._memoizedTables={});if(Mt(t,e))return t[e];var n=this.schema[e];if(!n)throw new Mc.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}]),e}(),Dl=function(e){try{return e.only([[]]),Dl=function(){return[[]]},[[]]}catch(e){return Dl=function(){return vl},vl}},Cl=0,Il=function(){function e(){a(this,e)}return s(e,[{key:"_parseStoresSpec",value:function(e,t){ic(e).forEach((function(n){if(null!==e[n]){var r=e[n].split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return ir(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),ac(r),0===t)})),o=r.shift();if(o.multi)throw new Mc.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new Mc.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Mc.Schema("Index must have a name and cannot be an empty string")})),t[n]=ur(n,o,r)}}))}},{key:"stores",value:function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?It(this._cfg.storesSource,e):e;var n=t._versions,r={},o={};return n.forEach((function(e){It(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,hr(t,[t._allTables,t,t.Transaction.prototype]),dr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],ic(o),o),t._storeNames=ic(o),this}},{key:"upgrade",value:function(e){return this._cfg.contentUpgrade=cn(this._cfg.contentUpgrade||en,e),this}}]),e}();function Ml(e,t,n,r,o){return ln.resolve().then((function(){var i=tl.transless||tl,a=e._createTransaction(t,n,e._dbSchema,r),u={trans:a,transless:i};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===Cc.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return Ml(e,t,n,null,o)}))):pl(r)}var s,c=Ec(o);c&&En();var l=ln.follow((function(){if(s=o.call(a,a))if(c){var e=xn.bind(null,null);s.then(e,e)}else"function"==typeof s.next&&"function"==typeof s.throw&&(s=Er(s))}),u);return(s&&"function"==typeof s.then?ln.resolve(s).then((function(e){return a.active?e:pl(new Mc.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return s}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),pl(e)}))}))}var Rl={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return d(f({},e),{table:function(t){var n=e.table(t),r=n.schema,o={},i=[];function a(e,t,n){var r=lr(e),u=o[r]=o[r]||[],s=null==e?0:"string"==typeof e?1:e.length,c=t>0,l=d(f({},n),{isVirtual:c,keyTail:t,keyLength:s,extractKey:sr(e),unique:!c&&n.unique});return u.push(l),l.isPrimaryKey||i.push(l),s>1&&a(2===s?e[0]:e.slice(0,s-1),t+1,n),u.sort((function(e,t){return e.keyTail-t.keyTail})),l}var u=a(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[u];var s=!0,c=!1,l=void 0;try{for(var h,p=r.indexes[Symbol.iterator]();!(s=(h=p.next()).done);s=!0){var y=h.value;a(y.keyPath,0,y)}}catch(e){c=!0,l=e}finally{try{s||null==p.return||p.return()}finally{if(c)throw l}}function v(t){var n,r,o=t.query.index;return o.isVirtual?d(f({},t),{query:{index:o,range:(n=t.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:kr(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:kr(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}):t}var m=d(f({},n),{schema:d(f({},r),{primaryKey:u,indexes:i,getIndexByKeyPath:function(e){var t=o[lr(e)];return t&&t[0]}}),count:function(e){return n.count(v(e))},query:function(e){return n.query(v(e))},openCursor:function(t){var r=t.query.index,o=r.keyTail,i=r.isVirtual,a=r.keyLength;return i?n.openCursor(v(t)).then((function(n){return n&&function(n){var r=Object.create(n,{continue:{value:function(r){null!=r?n.continue(kr(r,t.reverse?e.MAX_KEY:e.MIN_KEY,o)):t.unique?n.continue(n.key.slice(0,a).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(kr(t,e.MAX_KEY,o),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return n.value}}});return r}(n)})):n.openCursor(t)}});return m}})}};function Nl(e,t,n,r){return n=n||{},r=r||"",ic(e).forEach((function(o){if(Mt(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=qt(i);u!==qt(a)?n[r+o]=t[o]:"Object"===u?Nl(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o])}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0})),ic(t).forEach((function(o){Mt(e,o)||(n[r+o]=t[o])})),n}var Ll={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return d(f({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey,o=d(f({},n),{mutate:function(e){var o=tl.trans,i=o.table(t).hook,a=i.deleting,u=i.creating,s=i.updating;switch(e.type){case"add":if(u.fire===en)break;return o._promise("readwrite",(function(){return c(e)}),!0);case"put":if(u.fire===en&&s.fire===en)break;return o._promise("readwrite",(function(){return c(e)}),!0);case"delete":if(a.fire===en)break;return o._promise("readwrite",(function(){return c(e)}),!0);case"deleteRange":if(a.fire===en)break;return o._promise("readwrite",(function(){return function(e){return l(e.trans,e.range,1e4)}(e)}),!0)}return n.mutate(e);function c(e){var t=tl.trans,o=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!o)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?d(f({},e),{keys:o}):f({},e)).type&&(e.values=p(e.values)),e.keys&&(e.keys=p(e.keys)),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,o).then((function(i){var c=o.map((function(n,o){var c=i[o],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,n,c,t);else if("add"===e.type||void 0===c){var f=u.fire.call(l,n,e.values[o],t);null==n&&null!=f&&(n=f,e.keys[o]=n,r.outbound||pc(e.values[o],r.keyPath,n))}else{var d=Nl(c,e.values[o]),h=s.fire.call(l,d,n,c,t);if(h){var p=e.values[o];Object.keys(h).forEach((function(e){Mt(p,e)?p[e]=h[e]:pc(p,e,h[e])}))}}return l}));return n.mutate(e).then((function(t){for(var n=t.failures,r=t.results,a=t.numFailures,u=t.lastResult,s=0;s<o.length;++s){var l=r?r[s]:o[s],f=c[s];null==l?f.onerror&&f.onerror(n[s]):f.onsuccess&&f.onsuccess("put"===e.type&&i[s]?e.values[s]:l)}return{failures:n,results:r,numFailures:a,lastResult:u}})).catch((function(e){return c.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function l(e,t,o){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:o}).then((function(n){var r=n.result;return c({type:"delete",keys:r,trans:e}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:l(e,d(f({},t),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}}});return o}})}},Fl={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return d(f({},n),{getMany:function(e){if(!e.cache)return n.getMany(e);var t=Pr(e.keys,e.trans._cache,"clone"===e.cache);return t?ln.resolve(t):n.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?Ht(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),n.mutate(e)}})}}}},Bl=function(e,t){if(!this){var n=new Bl;return e&&"d"in e&&It(n,e),n}It(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function Ul(e,t,n){var r=xl(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(jr(e))return It(e,{from:t,to:n,d:1});var o=e.l,i=e.r;if(xl(n,e.from)<0)return o?Ul(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Dr(e);if(xl(t,e.to)>0)return i?Ul(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Dr(e);xl(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),xl(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;o&&!e.l&&Ar(e,o),i&&a&&Ar(e,i)}}Rt(Bl.prototype,c({add:function(e){return Ar(this,e),this},addKey:function(e){return Ul(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return Ul(t,e,e)})),this}},_c,(function(){return Tr(this)})));var Kl,zl={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new Bl(e.MIN_KEY,e.MAX_KEY);return d(f({},e),{table:function(r){var o=e.table(r),i=o.schema,a=i.primaryKey,u=a.extractKey,s=a.outbound,c=d(f({},o),{mutate:function(e){var a=e.trans,u=a.mutatedParts||(a.mutatedParts={}),s=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return u[n]||(u[n]=new Bl)},c=s(""),l=s(":dels"),f=e.type,d=h("deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],2),p=d[0],y=d[1],v=e.trans._cache;return o.mutate(e).then((function(e){if(ac(p)){"delete"!==f&&(p=e.results),c.addKeys(p);var t=Pr(p,v);t||"add"===f||l.addKeys(p),(t||y)&&function(e,t,n,r){t.indexes.forEach((function(t){var o=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}var a=function(e){return t.multiEntry&&ac(e)?e.forEach((function(e){return o.addKey(e)})):o.addKey(e)};(n||r).forEach((function(e,t){var o=n&&i(n[t]),u=r&&i(r[t]);0!==xl(o,u)&&(null!=o&&a(o),null!=u&&a(u))}))}))}(s,i,t,y)}else if(p){var r={from:p.lower,to:p.upper};l.add(r),c.add(r)}else c.add(n),l.add(n),i.indexes.forEach((function(e){return s(e.name).add(n)}));return e}))}}),l=function(t){var n,r,o=t.query,i=o.index,a=o.range;return[i,new Bl(null!==(n=a.lower)&&void 0!==n?n:e.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:e.MAX_KEY)]},p={get:function(e){return[a,new Bl(e.key)]},getMany:function(e){return[a,(new Bl).addKeys(e.keys)]},count:l,query:l,openCursor:l};return ic(p).forEach((function(e){c[e]=function(i){var a=tl.subscr;if(a){var c=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return a[n]||(a[n]=new Bl)},l=c(""),y=c(":dels"),v=h(p[e](i),2),m=v[0],g=v[1];if(c(m.name||"").add(g),!m.isPrimaryKey){if("count"!==e){var b="query"===e&&s&&i.values&&o.query(d(f({},i),{values:!1}));return o[e].apply(this,arguments).then((function(t){if("query"===e){if(s&&i.values)return b.then((function(e){var n=e.result;return l.addKeys(n),t}));var n=i.values?t.result.map(u):t.result;i.values?l.addKeys(n):y.addKeys(n)}else if("openCursor"===e){var r=t,o=i.values;return r&&Object.create(r,{key:{get:function(){return y.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return y.addKey(e),e}},value:{get:function(){return o&&l.addKey(r.primaryKey),r.value}}})}return t}))}y.add(n)}}return o[e].apply(this,arguments)}})),c}})}},Vl=function(){function e(t,n){var r=this;a(this,e),this._middlewares={},this.verno=0;var o=e.dependencies;this._options=n=f({addons:e.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var i=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var u,s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:en,dbReadyPromise:null,cancelOpen:en,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};s.dbReadyPromise=new ln((function(e){s.dbReadyResolve=e})),s.openCanceller=new ln((function(e,t){s.cancelOpen=t})),this._state=s,this.name=t,this.on=Fn(this,"populate","blocked","versionchange","close",{ready:[cn,en]}),this.on.ready.subscribe=Bt(this.on.ready.subscribe,(function(t){return function(n,o){e.vip((function(){var e=r._state;if(e.openComplete)e.dbOpenError||ln.resolve().then(n),o&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),o&&t(n);else{t(n);var i=r;o||t((function e(){i.on.ready.unsubscribe(n),i.on.ready.unsubscribe(e)}))}}))}})),this.Collection=(u=this,Bn(kl.prototype,(function(e,t){this.db=u;var n=Ol,r=null;if(t)try{n=t()}catch(e){r=e}var o=e._ctx,i=o.table,a=i.hook.reading.fire;this._ctx={table:i,index:o.index,isPrimKey:!o.index||i.schema.primKey.keyPath&&o.index===i.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:a!==tn?a:null}}))),this.Table=function(e){return Bn(El.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:Fn(null,{creating:[on,en],reading:[nn,tn],updating:[un,en],deleting:[an,en]})}))}(this),this.Transaction=function(e){return Bn(Tl.prototype,(function(t,n,r,o,i){var a=this;this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Fn(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ln((function(e,t){a._resolve=e,a._reject=t})),this._completion.then((function(){a.active=!1,a.on.complete.fire()}),(function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),pl(e)}))}))}(this),this.Version=function(e){return Bn(Il.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Bn(jl.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};var o=e._deps.indexedDB;if(!o)throw new Mc.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(e,t){return o.cmp(t,e)},this._max=function(e,t){return o.cmp(e,t)>0?e:t},this._min=function(e,t){return o.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close()})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=Dl(n.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,o)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),gl.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Rl),this.use(Ll),this.use(zl),this.use(Fl),this.vip=Object.create(this,{_vip:{value:!0}}),i.forEach((function(e){return e(r)}))}return s(e,[{key:"version",value:function(e){if(isNaN(e)||e<.1)throw new Mc.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Mc.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(pr),n.stores({}),this._state.autoSchema=!1,n)}},{key:"_whenReady",value:function(e){var t=this;return this.idbdb&&(this._state.openComplete||tl.letThrough||this._vip)?e():new ln((function(e,n){if(t._state.openComplete)return n(new Mc.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void n(new Mc.DatabaseClosed);t.open().catch(en)}t._state.dbReadyPromise.then(e,n)})).then(e)}},{key:"use",value:function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;o&&this.unuse({stack:t,name:o});var i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:null==r?10:r,name:o}),i.sort((function(e,t){return e.level-t.level})),this}},{key:"unuse",value:function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this}},{key:"open",value:function(){return function(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?pl(t.dbOpenError):e}));xc&&(t.openCanceller._stackHolder=jc()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller;function o(){if(t.openCanceller!==r)throw new Mc.DatabaseClosed("db.open() was cancelled")}var i=t.dbReadyResolve,a=null,u=!1;return ln.race([r,("undefined"==typeof navigator?ln.resolve():Or()).then((function(){return new ln((function(r,i){if(o(),!n)throw new Mc.MissingAPI;var s=e.name,c=t.autoSchema?n.open(s):n.open(s,Math.round(10*e.verno));if(!c)throw new Mc.MissingAPI;c.onerror=rr(i),c.onblocked=Sn(e._fireOnBlocked),c.onupgradeneeded=Sn((function(r){if(a=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=or,a.abort(),c.result.close();var o=n.deleteDatabase(s);o.onsuccess=o.onerror=Sn((function(){i(new Mc.NoSuchDatabase("Database ".concat(s," doesnt exist")))}))}else{a.onerror=rr(i);var l=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;u=l<1,e._novip.idbdb=c.result,function(e,t,n,r){var o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=tl.transless||tl;On((function(){tl.trans=i,tl.transless=u,0===t?(ic(o).forEach((function(e){vr(n,e,o[e].primKey,o[e].indexes)})),fr(e,n),ln.follow((function(){return e.on.populate.fire(i)})).catch(a)):function(e,t,n,r){var o=e._novip,i=[],a=o._versions,u=o._dbSchema=gr(0,o.idbdb,r),s=!1;return a.filter((function(e){return e._cfg.version>=t})).forEach((function(e){i.push((function(){var i=u,a=e._cfg.dbschema;br(o,i,r),br(o,a,r),u=o._dbSchema=a;var c=yr(i,a);c.add.forEach((function(e){vr(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((function(e){if(e.recreate)throw new Mc.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){return mr(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),mr(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=e._cfg.contentUpgrade;if(l&&e._cfg.version>t){fr(o,r),n._memoizedTables={},s=!0;var f=Vt(a);c.del.forEach((function(e){f[e]=i[e]})),hr(o,[o.Transaction.prototype]),dr(o,[o.Transaction.prototype],ic(f),f),n.schema=f;var d,h=Ec(l);h&&En();var p=ln.follow((function(){if((d=l(n))&&h){var e=xn.bind(null,null);d.then(e,e)}}));return d&&"function"==typeof d.then?ln.resolve(d):p.then((function(){return d}))}})),i.push((function(t){s&&wl||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((function(n){return null==e[n]&&t.db.deleteObjectStore(n)}))}(e._cfg.dbschema,t),hr(o,[o.Transaction.prototype]),dr(o,[o.Transaction.prototype],o._storeNames,o._dbSchema),n.schema=o._dbSchema}))})),function e(){return i.length?ln.resolve(i.shift()(n.idbtrans)).then(e):ln.resolve()}().then((function(){var e,t;t=r,ic(e=u).forEach((function(n){t.db.objectStoreNames.contains(n)||vr(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(a)}))}(e,l/10,a,i)}}),i),c.onsuccess=Sn((function(){a=null;var n,o=e._novip.idbdb=c.result,i=Ft(o.objectStoreNames);if(i.length>0)try{var l=o.transaction(1===(n=i).length?n[0]:n,"readonly");t.autoSchema?function(e,t,n){var r=e._novip;r.verno=t.version/10;var o=r._dbSchema=gr(0,t,n);r._storeNames=Ft(t.objectStoreNames,0),dr(r,[r._allTables],ic(o),o)}(e,o,l):(br(e,e._dbSchema,l),function(e,t){var n=yr(gr(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((function(e){return e.add.length||e.change.length})))}(e,l)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),fr(e,l)}catch(e){}gl.push(e),o.onversionchange=Sn((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),o.onclose=Sn((function(t){e.on("close").fire(t)})),u&&function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!_r(n)&&"__dbnames"!==t&&wr(n,r).put({name:t}).catch(en)}(e._deps,s),r()}),i)}))}))]).then((function(){return o(),t.onReadyBeingFired=[],ln.resolve(Sr((function(){return e.on.ready.fire(e.vip)}))).then((function n(){if(t.onReadyBeingFired.length>0){var r=t.onReadyBeingFired.reduce(cn,en);return t.onReadyBeingFired=[],ln.resolve(Sr((function(){return r(e.vip)}))).then(n)}}))})).finally((function(){t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((function(){return e})).catch((function(n){t.dbOpenError=n;try{a&&a.abort()}catch(e){}return r===t.openCanceller&&e._close(),pl(n)})).finally((function(){t.openComplete=!0,i()}))}(this)}},{key:"_close",value:function(){var e=this._state,t=gl.indexOf(this);if(t>=0&&gl.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new ln((function(t){e.dbReadyResolve=t})),e.openCanceller=new ln((function(t,n){e.cancelOpen=n}))}},{key:"close",value:function(){this._close();var e=this._state;this._options.autoOpen=!1,e.dbOpenError=new Mc.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}},{key:"delete",value:function(){var e=this,t=arguments.length>0,n=this._state;return new ln((function(r,o){var i=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=Sn((function(){!function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!_r(n)&&"__dbnames"!==t&&wr(n,r).delete(t).catch(en)}(e._deps,e.name),r()})),t.onerror=rr(o),t.onblocked=e._fireOnBlocked};if(t)throw new Mc.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))}},{key:"backendDB",value:function(){return this.idbdb}},{key:"isOpen",value:function(){return null!==this.idbdb}},{key:"hasBeenClosed",value:function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}},{key:"hasFailed",value:function(){return null!==this._state.dbOpenError}},{key:"dynamicallyOpened",value:function(){return this._state.autoSchema}},{key:"tables",get:function(){var e=this;return ic(this._allTables).map((function(t){return e._allTables[t]}))}},{key:"transaction",value:function(){var e=xr.apply(this,arguments);return this._transaction.apply(this,e)}},{key:"_transaction",value:function(e,t,n){var r=this,o=tl.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var i,a,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){var t=l(e,r.Table)?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)i="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new Mc.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(o){if("readonly"===o.mode&&"readwrite"===i){if(!u)throw new Mc.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(e){if(o&&-1===o.storeNames.indexOf(e)){if(!u)throw new Mc.SubTransaction("Table "+e+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(function(t,n){n(e)})):pl(e)}var s=Ml.bind(null,this,i,a,o,n);return o?o._promise(i,s,"lock"):tl.trans?Dn(tl.transless,(function(){return r._whenReady(s)})):this._whenReady(s)}},{key:"table",value:function(e){if(!Mt(this._allTables,e))throw new Mc.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]}}]),e}(),Gl="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",Hl=function(){function e(t){a(this,e),this._subscribe=t}return s(e,[{key:"subscribe",value:function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}},{key:Gl,value:function(){return this}}]),e}();try{Kl={indexedDB:oc.indexedDB||oc.mozIndexedDB||oc.webkitIndexedDB||oc.msIndexedDB,IDBKeyRange:oc.IDBKeyRange||oc.webkitIDBKeyRange}}catch(po){Kl={indexedDB:null,IDBKeyRange:null}}var ql=Vl;Rt(ql,d(f({},Nc),{delete:function(e){return new ql(e,{addons:[]}).delete()},exists:function(e){return new ql(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return function(e){var t=e.indexedDB,n=e.IDBKeyRange;return _r(t)?Promise.resolve(t.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return"__dbnames"!==e}))})):wr(t,n).toCollection().primaryKeys()}(ql.dependencies).then(e)}catch(e){return pl(new Mc.MissingAPI)}},defineClass:function(){return function(e){It(this,e)}},ignoreTransaction:function(e){return tl.trans?Dn(tl.transless,e):e()},vip:Sr,async:function(e){return function(){try{var t=Er(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ln.resolve(t)}catch(e){return pl(e)}}},spawn:function(e,t,n){try{var r=Er(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:ln.resolve(r)}catch(e){return pl(e)}},currentTransaction:{get:function(){return tl.trans||null}},waitFor:function(e,t){var n=ln.resolve("function"==typeof e?ql.ignoreTransaction(e):e).timeout(t||6e4);return tl.trans?tl.trans.waitFor(n):n},Promise:ln,debug:{get:function(){return xc},set:function(e){$t(e,"dexie"===e?function(){return!0}:Sl)}},derive:Lt,extend:It,props:Rt,override:Bt,Events:Fn,on:Al,liveQuery:function(e){return new Hl((function(t){var n=function(){return ic(a).some((function(e){return i[e]&&function(e,t){var n=Tr(t),r=n.next();if(r.done)return!1;for(var o=r.value,i=Tr(e),a=i.next(o.from),u=a.value;!r.done&&!a.done;){if(xl(u.from,o.to)<=0&&xl(u.to,o.from)>=0)return!0;xl(o.from,u.from)<0?o=(r=n.next(u.from)).value:u=(a=i.next(o.from)).value}return!1}(i[e],a[e])}))},r=Ec(e),o=!1,i={},a={},u={get closed(){return o},unsubscribe:function(){o=!0,Al.storagemutated.unsubscribe(l)}};t.start&&t.start(u);var s=!1,c=!1,l=function(e){Ir(i,e),n()&&f()},f=function(){if(!s&&!o){i={};var d={},h=function(t){r&&En();var n=function(){return On(e,{subscr:t,trans:null})},o=tl.trans?Dn(tl.transless,n):n();return r&&o.then(xn,xn),o}(d);c||(Al("storagemutated",l),c=!0),s=!0,Promise.resolve(h).then((function(e){s=!1,o||(n()?f():(i={},a=d,t.next&&t.next(e)))}),(function(e){s=!1,t.error&&t.error(e),u.unsubscribe()}))}};return f(),u}))},extendObservabilitySet:Ir,getByKeyPath:hc,setByKeyPath:pc,delByKeyPath:function(e,t){"string"==typeof t?pc(e,t,void 0):"length"in t&&[].map.call(t,(function(t){pc(e,t,void 0)}))},shallowClone:Vt,deepClone:Ht,getObjectDiff:Nl,cmp:xl,asap:Kt,minKey:-1/0,addons:[],connections:gl,errnames:Cc,dependencies:Kl,semVer:"3.2.3",version:"3.2.3".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)}))})),ql.maxKey=Dl(ql.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Al("storagemutated",(function(e){var t;Wl||(bl?(t=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,e):t=new CustomEvent("x-storagemutated-1",{detail:e}),Wl=!0,dispatchEvent(t),Wl=!1)})),addEventListener("x-storagemutated-1",(function(e){var t=e.detail;Wl||Mr(t)})));var Wl=!1;if("undefined"!=typeof BroadcastChannel){var $l=new BroadcastChannel("x-storagemutated-1");"function"==typeof $l.unref&&$l.unref(),Al("storagemutated",(function(e){Wl||$l.postMessage(e)})),$l.onmessage=function(e){e.data&&Mr(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Al("storagemutated",(function(e){try{Wl||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&p(self.clients.matchAll({includeUncontrolled:!0})).forEach((function(t){return t.postMessage({type:"x-storagemutated-1",changedParts:e})})))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(function(e){if("x-storagemutated-1"===e.key){var t=JSON.parse(e.newValue);t&&Mr(t.changedParts)}}));var Yl=self.document&&navigator.serviceWorker;Yl&&Yl.addEventListener("message",(function(e){var t=e.data;t&&"x-storagemutated-1"===t.type&&Mr(t.changedParts)}))}function Jl(e){return Jl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Jl(e)}function Ql(e,t){return Ql=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ql(e,t)}ln.rejectionMapper=function(e,t){if(!e||l(e,Jt)||l(e,TypeError)||l(e,SyntaxError)||!e.name||!Rc[e.name])return e;var n=new Rc[e.name](t||e.message,e);return"stack"in e&&Nt(n,"stack",{get:function(){return this.inner.stack}}),n},$t(xc,Sl);var Zl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ql(e,t)}(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Jl(e);if(t){var o=Jl(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":y(n))&&"function"!=typeof t?Rr(e):t;var n}(this,n)}}(n);function n(){var e;return function(e,t){if(!l(e,t))throw new TypeError("Cannot call a class as a function")}(this,n),Nr(Rr(e=t.call(this,"EsmOffline")),"syncQueue",void 0),Nr(Rr(e),"dynamicOfflineData",void 0),e.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),e.syncQueue=e.table("syncQueue"),e.dynamicOfflineData=e.table("dynamicOfflineData"),e}return n}(Vl);(0,Jo.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});try{self["workbox:window:6.5.4"]&&_()}catch(yo){}try{self["workbox:core:6.5.4"]&&_()}catch(yo){}var Xl,ef=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},tf=function(e,t){this.type=e,Object.assign(this,t)},nf={type:"SKIP_WAITING"};!function(e){var t,n;function r(t,n){var r,o;return void 0===n&&(n={}),(r=e.call(this)||this).nn={},r.tn=0,r.rn=new ef,r.en=new ef,r.on=new ef,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!Br(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(e){var t=r.fn,n=e.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new tf(o,a)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new tf("waiting",a))}),200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new tf("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(o=function(e){var t=e.data,n=e.ports,o=e.source;return Ur(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new tf("message",{data:t,originalEvent:e,ports:n,sw:o}))}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(o.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=t,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n;var o,i=r.prototype;i.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var r=this;return function(e,t){var n=e();return n&&n.then?n.then(t):t()}((function(){if(!n&&"complete"!==document.readyState)return zr(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),Ur(r.bn(),(function(e){r.fn=e,r.yn&&(r.hn=r.yn,r.en.resolve(r.yn),r.on.resolve(r.yn),r.yn.addEventListener("statechange",r.ln,{once:!0}));var t=r.fn.waiting;return t&&Br(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new tf("waiting",{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener("updatefound",r.cn),navigator.serviceWorker.addEventListener("controllerchange",r.dn),r.fn}))}))}catch(e){return Promise.reject(e)}},i.update=function(){try{return this.fn?zr(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},i.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},i.messageSW=function(e){try{return Ur(this.getSW(),(function(t){return Lr(t,e)}))}catch(e){return Promise.reject(e)}},i.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&Lr(this.fn.waiting,nf)},i.pn=function(){var e=navigator.serviceWorker.controller;return e&&Br(e.scriptURL,this.sn.toString())?e:void 0},i.bn=function(){try{var e=this;return function(t,n){try{var r=Ur(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}catch(t){return n(t)}return r&&r.then?r.then(void 0,n):r}((function(){return Ur(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e}))}catch(e){return Promise.reject(e)}},(o=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,o)}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=function(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Fr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fr(e,t):void 0}}(e))){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(n=e[Symbol.iterator]()).next.bind(n)}(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}()),new Zl,(0,Jo.createGlobalStore)("offline-synchronization",{}),ro.default.createContext({moduleName:"",featureName:""}),A(103),Wr((0,Qo.getExtensionStore)()),Xi.openmrsFetch,Wr((0,Qo.getExtensionInternalStore)()),function(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(Xl||(Xl={}));var rf=A(701),of=A.n(rf);ni.default.extend(of());var af={};setTimeout((function(){"development"===window.spaEnv&&(window.stores=af)}),1e3),uf=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){$r(e,t,n[t])}))}return e}({},{address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",postalCode:"Postal code",state:"State",stateProvince:"State"},{closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:"There are unsaved changes in {{workspaceName}}. Please save them before opening another workspace.",unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header"}),sf=null!=(sf={actions:"Actions",address:"Address",age:"Age",cancel:"Cancel",change:"Change",close:"Close",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",female:"Female",hideDetails:"Hide details",loading:"Loading",male:"Male",other:"Other",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",seeMoreLists:"See {{count}} more lists",sex:"Sex",showDetails:"Show details",unknown:"Unknown"})?sf:{},Object.getOwnPropertyDescriptors?Object.defineProperties(uf,Object.getOwnPropertyDescriptors(sf)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(sf)).forEach((function(e){Object.defineProperty(uf,e,Object.getOwnPropertyDescriptor(sf,e))}));var uf,sf,cf=A(64);(cf.default.default||cf.default).on("initialized",(function(){window.i18next.loadNamespaces(["core"])})),$i(Zi,(function(e){return function(t,n,r){return r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,e(t,n,r)}}));var lf,ff=Promise.resolve();$i(Zi,(function(e){return function(t,n,r){var o,a=(0,ro.useRef)(!1),u=r.cache,s=r.initialSize,c=void 0===s?1:s,l=r.revalidateAll,p=void 0!==l&&l,y=r.persistSize,v=void 0!==y&&y,b=r.revalidateFirstPage,w=void 0===b||b,_=r.revalidateOnMount,S=void 0!==_&&_,O=r.parallel,E=void 0!==O&&O,x=h(hi.get(Fi),4)[3];try{o=function(e){return Di(e?e(0,null):null)[0]}(t),o&&(o=Vi+o)}catch(e){}var k=h(bi(u,o),3),P=k[0],j=k[1],A=k[2],T=(0,ro.useCallback)((function(){return ui(P()._l)?c:P()._l}),[u,o,c]);(0,ri.useSyncExternalStore)((0,ro.useCallback)((function(e){return o?A(o,(function(){e()})):function(){}}),[u,o]),T,T);var D=(0,ro.useCallback)((function(){var e=P()._l;return ui(e)?c:e}),[o,c]),C=(0,ro.useRef)(D());ji((function(){a.current?o&&j({_l:v?C.current:D()}):a.current=!0}),[o,u]);var I=S&&!a.current,M=e(o,function(){var e=i((function(e){var o,a,s,c,l,f,d,y,v,b;return m(this,(function(_){switch(_.label){case 0:o=function(e){var o,c,l,f,g,b,_,S,O;return m(this,(function(k){switch(k.label){case 0:return o=h(Di(t(e,E?null:v)),2),c=o[0],l=o[1],c?(f=h(bi(u,c),2),g=f[0],b=f[1],_=g().data,S=p||a||ui(_)||w&&!e&&!ui(d)||I||d&&!ui(d[e])&&!r.compare(d[e],_),n&&S?(O=function(){var t=i((function(){var t;return m(this,(function(r){switch(r.label){case 0:return c in x?(t=x[c],delete x[c],[4,t]):[3,2];case 1:return _=r.sent(),[3,4];case 2:return[4,n(l)];case 3:_=r.sent(),r.label=4;case 4:return b({data:_,_k:l}),s[e]=_,[2]}}))}));return function(){return t.apply(this,arguments)}}(),E?(y.push(O),[3,3]):[3,1]):[3,4]):[2,"break"];case 1:return[4,O()];case 2:k.sent(),k.label=3;case 3:return[3,5];case 4:s[e]=_,k.label=5;case 5:return E||(v=_),[2]}}))},a=P()._i,s=[],c=D(),l=h(bi(u,e),1),f=l[0],d=f().data,y=[],v=null,b=0,_.label=1;case 1:return b<c?[5,g(o(b))]:[3,4];case 2:if("break"===_.sent())return[3,4];_.label=3;case 3:return++b,[3,1];case 4:return E?[4,Promise.all(y.map((function(e){return e()})))]:[3,6];case 5:_.sent(),_.label=6;case 6:return[2,(j({_i:ii}),s)]}}))}));return function(t){return e.apply(this,arguments)}}(),r),R=(0,ro.useCallback)((function(e,t){var n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return o?(r&&(ui(e)?j({_i:!0}):j({_i:!1})),arguments.length?M.mutate(e,d(f({},n),{revalidate:r})):M.mutate()):ff}),[o,u]),N=(0,ro.useCallback)((function(e){if(!o)return ff;var n,r=h(bi(u,o),2)[1];if(si(e)?n=e(D()):"number"==typeof e&&(n=e),"number"!=typeof n)return ff;r({_l:n}),C.current=n;for(var i=[],a=h(bi(u,o),1)[0],s=null,c=0;c<n;++c){var l=h(Di(t(c,s)),1)[0],f=h(bi(u,l),1)[0],d=l?f().data:ii;if(ui(d))return R(a().data);i.push(d),s=d}return R(i)}),[o,u,R,D]);return{size:D(),setSize:N,mutate:R,get data(){return M.data},get error(){return M.error},get isValidating(){return M.isValidating},get isLoading(){return M.isLoading}}}})),(0,Yr.defineConfigSchema)("@openmrs/esm-styleguide",no),lf=function(e,t){document.documentElement.style.setProperty(e,t)},(0,Yr.getConfigStore)("@openmrs/esm-styleguide").subscribe((function(e){e.loaded&&e.config&&(lf("--brand-01",e.config["Brand color #1"]),lf("--brand-02",e.config["Brand color #2"]),lf("--brand-03",e.config["Brand color #3"]))})),r("omrs-logo-full-color",Jr),r("omrs-logo-full-mono",Jr),r("omrs-logo-full-grey",Jr),r("omrs-logo-partial-color",Qr),r("omrs-logo-partial-mono",Qr),r("omrs-logo-partial-grey",Qr),r("omrs-logo-icon-color",Zr),r("omrs-logo-icon-mono",Zr),r("omrs-logo-icon-grey",Zr),r("omrs-logo-white",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 119"><path fill="var(--logo-white)" fill-rule="evenodd" d="M40.29 40.328a27.76 27.76 0 0 1 19.688-8.154c7.669 0 14.613 3.102 19.647 8.116l.02-18.54A42.84 42.84 0 0 0 59.978 17c-7.089 0-13.813 1.93-19.709 4.968zM79.645 79.671a27.74 27.74 0 0 1-19.684 8.154c-7.67 0-14.614-3.101-19.651-8.116l-.02 18.54A42.86 42.86 0 0 0 59.96 103a42.8 42.8 0 0 0 19.672-4.751z" clip-rule="evenodd"/><path fill="var(--logo-grey)" fill-rule="evenodd" d="M40.328 79.696c-5.038-5.037-8.154-11.995-8.154-19.685 0-7.669 3.102-14.612 8.116-19.65l-18.54-.02A42.85 42.85 0 0 0 17 60.012a42.8 42.8 0 0 0 4.752 19.672zM79.634 40.289a27.75 27.75 0 0 1 8.154 19.688 27.74 27.74 0 0 1-8.117 19.646l18.542.02a42.84 42.84 0 0 0 4.749-19.666c0-7.09-1.714-13.779-4.751-19.675z" clip-rule="evenodd"/><path fill="var(--logo-white)" fill-rule="evenodd" d="M156.184 60.003c0-8.749-6.118-15.777-15.025-15.777-8.909 0-15.025 7.028-15.025 15.776s6.116 15.78 15.025 15.78c8.907 0 15.025-7.031 15.025-15.78m-34.881 0c0-11.483 8.318-19.96 19.856-19.96 11.536 0 19.855 8.478 19.855 19.96 0 11.484-8.319 19.964-19.855 19.964-11.538 0-19.856-8.48-19.856-19.964M179.514 75.54c5.507 0 9.05-4.14 9.05-9.482s-3.543-9.483-9.05-9.483c-5.505 0-9.046 4.142-9.046 9.483s3.541 9.482 9.046 9.482M166.22 53.306h4.248v3.704h.11c2.344-2.725 5.449-4.36 9.154-4.36 8.014 0 13.408 5.67 13.408 13.408 0 7.63-5.613 13.406-12.752 13.406-4.58 0-8.231-2.29-9.81-5.178h-.11V90.87h-4.248zM217.773 63.768c-.163-4.305-3-7.193-7.686-7.193-4.685 0-7.79 2.888-8.335 7.193zm3.653 10.412c-3.001 3.868-6.596 5.284-11.339 5.284-8.01 0-12.914-5.993-12.914-13.406 0-7.901 5.559-13.407 13.08-13.407 7.196 0 12.096 4.906 12.096 13.354v1.362h-20.597c.325 4.413 3.704 8.173 8.335 8.173 3.65 0 6.105-1.307 8.12-3.868zM227.854 59.357c0-2.347-.216-4.361-.216-6.05h4.031c0 1.362.11 2.776.11 4.194h.11c1.144-2.505 4.306-4.85 8.5-4.85 6.705 0 9.699 4.252 9.699 10.41v15.748h-4.248v-15.31c0-4.253-1.856-6.924-5.833-6.924-5.503 0-7.903 3.979-7.903 9.811V78.81h-4.25zM259.211 41.009h6.708L278.8 70.79h.107l12.982-29.782h6.549v37.99h-4.506V47.124h-.106L280.192 79h-2.738l-13.629-31.875h-.107V79h-4.507zM312.392 57.752h4.023c4.992 0 11.487 0 11.487-6.282 0-5.47-4.776-6.276-9.177-6.276h-6.333zm-4.506-16.744h9.711c7.352 0 15.132 1.072 15.132 10.462 0 5.527-3.594 9.125-9.495 10.037L334.018 79h-5.525l-10.304-17.063h-5.797V79h-4.506zM358.123 47.713c-1.506-2.414-4.187-3.487-6.926-3.487-3.973 0-8.1 1.88-8.1 6.385 0 3.49 1.931 5.047 7.994 6.98 5.903 1.878 11.377 3.809 11.377 11.267 0 7.567-6.495 11.11-13.36 11.11-4.402 0-9.125-1.45-11.7-5.262l3.862-3.165c1.61 2.794 4.83 4.24 8.105 4.24 3.862 0 8.263-2.253 8.263-6.601 0-4.669-3.165-5.474-9.928-7.728-5.366-1.771-9.442-4.134-9.442-10.463 0-7.298 6.277-10.945 12.929-10.945 4.241 0 7.836 1.178 10.625 4.45z" clip-rule="evenodd"/></svg>'),r("omrs-icon-activity",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M6 14.5a.5.5 0 0 1-.46-.31L3.165 8.5H1v-1h2.5a.5.5 0 0 1 .46.31L6 12.64l4.03-10.815a.5.5 0 0 1 .47-.325.5.5 0 0 1 .465.34L12.86 7.5H15v1h-2.5a.5.5 0 0 1-.475-.34L10.5 3.5 6.47 14.175A.5.5 0 0 1 6 14.5"/></svg>'),r("omrs-icon-add",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8.5 7.5V4h-1v3.5H4v1h3.5V12h1V8.5H12v-1z"/></svg>'),r("omrs-icon-arrow-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12.295 8.295 8.5 12.085V2h-1v10.085l-3.795-3.79L3 9l5 5 5-5z"/></svg>'),r("omrs-icon-arrow-left",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m7 13 .705-.705L3.915 8.5H14v-1H3.915l3.79-3.795L7 3 2 8z"/></svg>'),r("omrs-icon-arrow-right",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m9 3-.715.696 3.79 3.804H2v1h10.075l-3.79 3.787L9 13l5-5z"/></svg>'),r("omrs-icon-arrow-up",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 2 3 7l.705.705L7.5 3.915V14h1V3.915l3.795 3.79L13 7z"/></svg>'),r("omrs-icon-calendar-heat-map",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 2h-2V1h-1v1H6V1H5v1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1M3 3h2v1h1V3h4v1h1V3h2v2H3zm0 3h2.5v3H3zm6.5 7h-3v-3h3zm0-4h-3V6h3zm1 4v-3H13v3z"/></svg>'),r("omrs-icon-calendar",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 2h-2V1h-1v1H6V1H5v1H3c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h10c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1m0 11H3V6h10zm0-8H3V3h2v1h1V3h4v1h1V3h2z"/></svg>'),r("omrs-icon-caret-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12 6-4 5-4-5z"/></svg>'),r("omrs-icon-caret-left",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10 12 5 8l5-4z"/></svg>'),r("omrs-icon-caret-right",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m6 4 5 4-5 4z"/></svg>'),r("omrs-icon-caret-up",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m4 10 4-5 4 5z"/></svg>'),r("omrs-icon-chart-average",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11.5 12c-1.8 0-2.515-2.088-3.206-4.107C7.638 5.979 6.96 4 5.5 4a1.72 1.72 0 0 0-1.527 1.16l-.947-.318C3.05 4.767 3.66 3 5.5 3c2.175 0 3.006 2.427 3.74 4.569C9.844 9.333 10.415 11 11.5 11a1.72 1.72 0 0 0 1.527-1.16l.947.318C13.95 10.233 13.34 12 11.5 12"/><path d="M2 14V8.5h1v-1H2V1H1v13a1 1 0 0 0 1 1h13v-1z"/><path d="M5 7.5H4v1h1zM7 7.5H6v1h1zM11 7.5h-1v1h1zM13 7.5h-1v1h1zM15 7.5h-1v1h1z"/></svg>'),r("omrs-icon-chemistry",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13.616 11.81 10 6.836V2h1V1H5v1h1v4.837L2.384 11.81A2.009 2.009 0 0 0 4.01 15h7.982a2.01 2.01 0 0 0 1.625-3.19M7 7.162V2h2v5.163L10.336 9H5.664zM11.99 14H4.01a1.01 1.01 0 0 1-.817-1.603L4.936 10h6.128l1.743 2.397A1.011 1.011 0 0 1 11.991 14"/></svg>'),r("omrs-icon-chevron-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 11 3 6l.7-.7L8 9.6l4.3-4.3.7.7z"/></svg>'),r("omrs-icon-chevron-left",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m5 8 5-5 .7.7L6.4 8l4.3 4.3-.7.7z"/></svg>'),r("omrs-icon-chevron-right",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m11 8-5 5-.7-.7L9.6 8 5.3 3.7 6 3z"/></svg>'),r("omrs-icon-chevron-up",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m8 5 5 5-.7.7L8 6.4l-4.3 4.3L3 10z"/></svg>'),r("omrs-icon-close",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12 4.7-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8z"/></svg>'),r("omrs-icon-close-filled",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7m2.7 10.5L8 8.8l-2.7 2.7-.8-.8L7.2 8 4.5 5.3l.8-.8L8 7.2l2.7-2.7.8.8L8.8 8l2.7 2.7z"/></svg>'),r("omrs-icon-close-outline",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 1C4.1 1 1 4.1 1 8s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7m0 13c-3.3 0-6-2.7-6-6s2.7-6 6-6 6 2.7 6 6-2.7 6-6 6"/><path d="M10.7 11.5 8 8.8l-2.7 2.7-.8-.8L7.2 8 4.5 5.3l.8-.8L8 7.2l2.7-2.7.8.8L8.8 8l2.7 2.7z"/></svg>'),r("omrs-icon-document",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12.85 4.65-3.5-3.5C9.25 1.05 9.15 1 9 1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h8c.55 0 1-.45 1-1V5c0-.15-.05-.25-.15-.35M9 2.2 11.8 5H9zM12 14H4V2h4v3c0 .55.45 1 1 1h3z"/><path d="M11 11H5v1h6zM11 8H5v1h6z"/></svg>'),r("omrs-icon-document-attachment",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 15H5.5a1 1 0 0 1-1-1v-3h1v3H13V3H8.5V2H13a1 1 0 0 1 1 1v11a1 1 0 0 1-1 1"/><path d="M12 5H8.5v1H12zM12 7.5H8v1h4zM12 10H7.5v1H12zM4.5 9.5A2.503 2.503 0 0 1 2 7V1.5h1V7a1.5 1.5 0 0 0 3 0V2.5a.5.5 0 1 0-1 0v5H4v-5a1.5 1.5 0 0 1 3 0V7a2.503 2.503 0 0 1-2.5 2.5"/></svg>'),r("omrs-icon-download",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 12v2H3v-2H2v2a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-2zM13 7l-.705-.705-3.795 3.79V1h-1v9.085l-3.795-3.79L3 7l5 5z"/></svg>'),r("omrs-icon-edit",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15 13H1v1h14zM12.7 4.5c.4-.4.4-1 0-1.4l-1.8-1.8c-.4-.4-1-.4-1.4 0L2 8.8V12h3.2zM10.2 2 12 3.8l-1.5 1.5-1.8-1.8zM3 11V9.2l5-5L9.8 6l-5 5z"/></svg>'),r("omrs-icon-event-schedule",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10.5 15a4 4 0 1 1 0-8 4 4 0 0 1 0 8m0-7a3 3 0 1 0 0 6 3 3 0 0 0 0-6"/><path d="M11.295 12.5 10 11.205V9h1v1.795l1 1z"/><path d="M14 3a1 1 0 0 0-1-1h-2V1h-1v1H6V1H5v1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2v-1H3V3h2v1h1V3h4v1h1V3h2v3h1z"/></svg>'),r("omrs-icon-events",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 7h-1v1h1a1.5 1.5 0 0 1 1.5 1.5v2h1v-2A2.503 2.503 0 0 0 13 7M12 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M11.5 15h-1v-1A1.5 1.5 0 0 0 9 12.5H7A1.5 1.5 0 0 0 5.5 14v1h-1v-1A2.503 2.503 0 0 1 7 11.5h2a2.503 2.503 0 0 1 2.5 2.5zM8 6.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M4 7H3A2.503 2.503 0 0 0 .5 9.5v2h1v-2A1.5 1.5 0 0 1 3 8h1zM4 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"/></svg>'),r("omrs-icon-group",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15.5 15h-1v-1.5A1.5 1.5 0 0 0 13 12h-2a1.5 1.5 0 0 0-1.5 1.5V15h-1v-1.5A2.5 2.5 0 0 1 11 11h2a2.5 2.5 0 0 1 2.5 2.5zM12 6a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M7.5 11h-1V9.5A1.5 1.5 0 0 0 5 8H3a1.5 1.5 0 0 0-1.5 1.5V11h-1V9.5A2.5 2.5 0 0 1 3 7h2a2.5 2.5 0 0 1 2.5 2.5zM4 2a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"/></svg>'),r("omrs-icon-group-access",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M4 9.5H3v-1A1.5 1.5 0 0 1 4.5 7H7v1H4.5a.5.5 0 0 0-.5.5zM6 6.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M10 10a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M13 13h-1v-1a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5v1H7v-1a1.5 1.5 0 0 1 1.5-1.5h3A1.5 1.5 0 0 1 13 12z"/><path d="M4 15H2a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h2v1H2v12h2zM14 15h-2v-1h2V2h-2V1h2a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1"/></svg>'),r("omrs-icon-hospital-bed",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12.5 8h-4a1 1 0 0 0-1 1v3H2V7H1v8h1v-2h12v2h1v-4.5A2.503 2.503 0 0 0 12.5 8m1.5 4H8.5V9h4a1.5 1.5 0 0 1 1.5 1.5z"/><path d="M4.75 8.5a.75.75 0 1 1 0 1.5.75.75 0 0 1 0-1.5m0-1a1.75 1.75 0 1 0 0 3.5 1.75 1.75 0 0 0 0-3.5M10.5 3h-2V1h-1v2h-2v1h2v2h1V4h2z"/></svg>'),r("omrs-icon-image-medical",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13 3v10H3V3zm0-1H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1"/><path d="M11 8V7H8.5V6H10V5H8.5V4h-1v1H6v1h1.5v1H5v1h2.5v1H5v1h2.5v1H6v1h4v-1H8.5v-1H11V9H8.5V8z"/></svg>'),r("omrs-icon-inventory-management",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11.5 12h-2v2h2zM15 12h-2v2h2zM11.5 8.5h-2v2h2zM15 8.5h-2v2h2z"/><path d="M8.5 12H2V5h12v2.5h1V5a1 1 0 0 0-1-1h-3V2a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v2H2a1 1 0 0 0-1 1v7a1 1 0 0 0 1 1h6.5zM6 2h4v2H6z"/></svg>'),r("omrs-icon-list-checked",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15 4H8v1h7zM3 5.295 1.705 4 1 4.705l2 2 4-4L6.295 2zM15 11H8v1h7zM3 12.295 1.705 11 1 11.705l2 2 4-4L6.295 9z"/></svg>'),r("omrs-icon-location",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 9a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5m0-4a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3"/><path d="m8 15-4.218-4.974-.174-.226A5.44 5.44 0 0 1 2.5 6.5a5.5 5.5 0 1 1 11 0 5.44 5.44 0 0 1-1.107 3.299h-.001s-.15.198-.172.225zM4.406 9.198s.117.154.144.187L8 13.454l3.455-4.075.14-.183A4.45 4.45 0 0 0 12.5 6.5a4.5 4.5 0 1 0-9 0 4.45 4.45 0 0 0 .906 2.698"/></svg>'),r("omrs-icon-maximize",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10 1v1h3.293L9 6.291 9.707 7 14 2.707V6h1V1zM7 9.708 6.296 9 2 13.293V10H1v5h5v-1H2.707z"/></svg>'),r("omrs-icon-medication",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12 1H4a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1v9a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1V5a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1M5 7h1.5v5H5zm6 7H5v-1h2.5V6H5V5h6zM4 4V2h8v2z"/></svg>'),r("omrs-icon-message-queue",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14 14H2a1 1 0 0 1-1-1v-2.5h1V13h12v-2.5h1V13a1 1 0 0 1-1 1"/><path d="M12.5 10.5h-9v1h9zM12.5 8h-9v1h9zM12.5 5.5h-9v1h9zM12.5 3h-9v1h9z"/></svg>'),r("omrs-icon-microscope",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M12.697 12a3.94 3.94 0 0 0-.835-4.284 1.96 1.96 0 0 0-.542-2.207l1.388-1.388a1 1 0 0 0 0-1.415l-1.415-1.414a1 1 0 0 0-1.414 0L3.293 7.88a1 1 0 0 0 0 1.414l1.414 1.414a1 1 0 0 0 1.414 0L8.51 8.319a1.966 1.966 0 0 0 2.757.217A2.97 2.97 0 0 1 11.589 12H8v2H2v1h12v-3zm-7.283-2L4 8.586l.94-.94L6.353 9.06zM8 7q0 .19.038.376l-.977.977L5.646 6.94 10.586 2l1.415 1.414-1.625 1.625A1.99 1.99 0 0 0 8 7m2 1a1 1 0 1 1 0-2 1 1 0 0 1 0 2m3 6H9v-1h4z"/></svg>'),r("omrs-icon-money",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15 11H1v1h14zM15 13H1v1h14zM12 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2M8 8a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M4 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/><path d="M14 10H2a1.003 1.003 0 0 1-1-1V3a1.003 1.003 0 0 1 1-1h12a1.003 1.003 0 0 1 1 1v6a1 1 0 0 1-1 1m0-7H2v6h12z"/></svg>'),r("omrs-icon-movement",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m12 10-.705.705 1.79 1.795H5a2 2 0 1 1 0-4h6a3 3 0 0 0 0-6H2.915L4.705.705 4 0 1 3l3 3 .705-.705L2.915 3.5H11a2 2 0 0 1 0 4H5a3 3 0 1 0 0 6h8.085l-1.79 1.795L12 16l3-3z"/></svg>'),r("omrs-icon-overflow-menu--horizontal",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M4 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2M8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2M12 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'),r("omrs-icon-overflow-menu--vertical",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 5a1 1 0 1 0 0-2 1 1 0 0 0 0 2M8 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'),r("omrs-icon-pedestrian-family",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10 15H8.5a1 1 0 0 1-1-1v-2.5h1V14H10v-2.5h1v-2a.5.5 0 0 0-.5-.5H6.14l-1-3H2a.5.5 0 0 0-.5.5v3h1V14h2v-3.5h1V14a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-3.5a1 1 0 0 1-1-1v-3A1.5 1.5 0 0 1 2 5h3.14a1 1 0 0 1 .948.684L6.86 8h3.64A1.5 1.5 0 0 1 12 9.5v2a1 1 0 0 1-1 1V14a1 1 0 0 1-1 1M14 15h-1V9.5h1.5v-3A.5.5 0 0 0 14 6h-2V5h2a1.5 1.5 0 0 1 1.5 1.5v3a1 1 0 0 1-1 1H14zM3.5 4.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2M12.5 4.5a2 2 0 1 1 0-4 2 2 0 0 1 0 4m0-3a1 1 0 1 0 0 2 1 1 0 0 0 0-2"/><path d="M9.25 7.5a1.75 1.75 0 1 1 0-3.5 1.75 1.75 0 0 1 0 3.5m0-2.5a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5"/></svg>'),r("omrs-icon-pen",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13.654 3.053 15 1.707 14.293 1l-1.346 1.346L12.4 1.8a.967.967 0 0 0-1.4 0l-9 9V14h3.2l9-9a.967.967 0 0 0 0-1.4zM4.8 13H3v-1.8l8.7-8.7 1.8 1.8zM8.293 2 4.5 5.793l.707.707L9 2.707z"/></svg>'),r("omrs-icon-printer",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14 4.5h-1.5v-3h-9v3H2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1h1.5v3h9v-3H14a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1m-9.5-2h7v2h-7zm7 11h-7v-5h7zm2.5-3h-1.5v-3h-9v3H2v-5h12z"/></svg>'),r("omrs-icon-renew",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M6 5H3.39A5.5 5.5 0 0 1 13.5 8h1A6.5 6.5 0 0 0 3 3.84V2H2v4h4zM10 11h2.61A5.5 5.5 0 0 1 2.5 8h-1A6.5 6.5 0 0 0 13 12.16V14h1v-4h-4z"/></svg>'),r("omrs-icon-password",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M10.5 1a4.5 4.5 0 0 0-4.306 5.806L1 12v3h3l5.194-5.194A4.5 4.5 0 1 0 10.5 1m0 8c-.344 0-.687-.051-1.016-.151l-.573-.174-2.015 2.014L6.207 10l-.707.707.69.69-.794.792-.689-.689-.707.707.69.69L3.585 14H2v-1.586L7.325 7.09l-.174-.573A3.5 3.5 0 1 1 10.5 9"/><path d="M11 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2"/></svg>'),r("omrs-icon-reset",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="#161616" d="M9 14a6 6 0 1 0-6-6v3.1L1.2 9.3l-.7.7 3 3 3-3-.7-.7L4 11.1V8a5 5 0 1 1 5 5z"/></svg>'),r("omrs-icon-search",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m14.5 13.793-3.776-3.776a5.508 5.508 0 1 0-.707.707l3.776 3.776zM2 6.5a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0"/></svg>'),r("omrs-icon-save",'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none"><path fill="#161616" d="m13.855 4.645-2.5-2.5A.5.5 0 0 0 11 2H3a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5a.5.5 0 0 0-.145-.355M6 3h4v2H6zm4 10H6V9h4zm1 0V9a1 1 0 0 0-1-1H6a1 1 0 0 0-1 1v4H3V3h2v2a1 1 0 0 0 1 1h4a1 1 0 0 0 1-1V3.205l2 2V13z"/></svg>'),r("omrs-icon-shopping-cart",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M5 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M12 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M14 3.5H2.91L2.5 1.4A.5.5 0 0 0 2 1H0v1h1.59l1.91 9.6a.5.5 0 0 0 .5.4h9v-1H4.41L4 9h9a.5.5 0 0 0 .5-.39l1-4.5a.5.5 0 0 0-.5-.61M12.6 8H3.81l-.7-3.5h10.265z"/></svg>'),r("omrs-icon-shopping-cart--arrow-down",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M5 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M12 15a1 1 0 1 0 0-2 1 1 0 0 0 0 2M2.49 1.402A.5.5 0 0 0 2 1H0v1h1.59l1.92 9.598A.5.5 0 0 0 4 12h9v-1H4.41l-.4-2H13a.5.5 0 0 0 .488-.392L14.622 3.5h-1.024L12.6 8H3.81z"/><path d="M10.793 3.293 9 5.086V1H8v4.086L6.207 3.293 5.5 4l3 3 3-3z"/></svg>'),r("omrs-icon-sticky-note-add",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11.5 1h-1v2h-2v1h2v2h1V4h2V3h-2z"/><path d="M7.5 2h-4a1.003 1.003 0 0 0-1 1v10a1.003 1.003 0 0 0 1 1h6a.45.45 0 0 0 .35-.15l3.5-3.5a.45.45 0 0 0 .15-.35V7h-1v2h-3a1.003 1.003 0 0 0-1 1v3h-5V3h4zm4.8 8-2.8 2.8V10z"/></svg>'),r("omrs-icon-switcher",to),r("omrs-icon-switcher",to),r("omrs-icon-table-of-contents",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M11 3H2v1h9zM11 6H2v1h9zM11 9H2v1h9zM11 12H2v1h9zM14 3h-1v1h1zM14 6h-1v1h1zM14 9h-1v1h1zM14 12h-1v1h1z"/></svg>'),r("omrs-icon-table",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M14.5 2.5a1 1 0 0 0-1-1h-11a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1zm-1 0v2h-11v-2zm0 11h-11v-2h11zm0-3h-11v-2h11zm0-3h-11v-2h11z"/></svg>'),r("omrs-icon-time",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2"/><path d="M10.295 11 7.5 8.205V3.5h1v4.29l2.5 2.505z"/></svg>'),r("omrs-icon-tools",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M6.05 1a4.9 4.9 0 0 0-2.7.8L6.55 5a1.05 1.05 0 0 1 .1 1.5 1.05 1.05 0 0 1-1.5-.1l-3.3-3.2A4.9 4.9 0 0 0 1 6.05a5.07 5.07 0 0 0 5.05 5.05c.438.002.874-.048 1.3-.15l3.35 3.35a2.51 2.51 0 1 0 3.55-3.55L10.9 7.4q.153-.641.15-1.3a5 5 0 0 0-5-5.1m4 5.05c0 .355-.051.709-.15 1.05l-.15.55.4.4 3.35 3.35a1.44 1.44 0 0 1 .45 1.05 1.36 1.36 0 0 1-.45 1.05 1.45 1.45 0 0 1-2.1 0l-3.35-3.35-.4-.4-.55.15c-.341.099-.695.15-1.05.15A4.14 4.14 0 0 1 3.2 8.9 3.82 3.82 0 0 1 2 6.05c0-.372.051-.742.15-1.1l2.2 2.2a2.07 2.07 0 0 0 2.95.1 2.07 2.07 0 0 0-.1-2.95L5 2.1c.323-.102.66-.153 1-.15A4.14 4.14 0 0 1 8.85 3.1a4.25 4.25 0 0 1 1.2 2.95"/></svg>'),r("omrs-icon-translate",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M13.925 14.5H15L12 7h-1.175l-3 7.5H8.9l.8-2h3.425zm-3.825-3 1.31-3.28 1.315 3.28zM9 3.5v-1H5.5V1h-1v1.5H1v1h5.37a7.36 7.36 0 0 1-1.595 3.09A6.8 6.8 0 0 1 3.63 4.5H2.58a8.2 8.2 0 0 0 1.5 2.79A8.4 8.4 0 0 1 1.5 9l.375.93A9.2 9.2 0 0 0 4.765 8a8.5 8.5 0 0 0 2.88 1.92L8 9a7.2 7.2 0 0 1-2.56-1.685A8.8 8.8 0 0 0 7.4 3.5z"/></svg>'),r("omrs-icon-trash-can",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M7 6H6v6h1zM10 6H9v6h1z"/><path d="M2 3v1h1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4h1V3zm2 11V4h8v10zM10 1H6v1h4z"/></svg>'),r("omrs-icon-tree-view--alt",'<svg xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M11.5 4.502h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v.5h-5v-.5a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-.5h2v10a1 1 0 0 0 1 1h2v.5a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v.5h-2v-4.5h2v.5a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1h-3a1 1 0 0 0-1 1v.5h-2v-4.5h2v.5a1 1 0 0 0 1 1m0-3h3v2h-3zm-7 2h-3v-2h3zm7 9h3v2h-3zm0-5.5h3v2h-3z"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>'),r("omrs-icon-user-avatar",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 4a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m0 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/><path d="M8 1a7 7 0 1 0 7 7 7.01 7.01 0 0 0-7-7M5 13.188V12.5A1.5 1.5 0 0 1 6.5 11h3a1.5 1.5 0 0 1 1.5 1.5v.688a5.95 5.95 0 0 1-6 0m6.996-.725A2.5 2.5 0 0 0 9.5 10h-3a2.5 2.5 0 0 0-2.496 2.463 6 6 0 1 1 7.992 0"/></svg>'),r("omrs-icon-user-follow",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M16 7h-2V5h-1v2h-2v1h2v2h1V8h2zM6 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5m0-1a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M11 15h-1v-2.5A2.5 2.5 0 0 0 7.5 10h-3A2.5 2.5 0 0 0 2 12.5V15H1v-2.5A3.5 3.5 0 0 1 4.5 9h3a3.5 3.5 0 0 1 3.5 3.5z"/></svg>'),r("omrs-icon-user-xray",'<svg xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#a)"><path d="M15.5 1.5h-7A.5.5 0 0 0 8 2v6.5a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5V2a.5.5 0 0 0-.5-.5m-1.5 3h-1.5V6H14v1h-1.5v1h-1V7H10V6h1.5V4.5H10v-1h1.5v-1h1v1H14zM7.5 15h-1v-2A1.473 1.473 0 0 0 5 11.5H3A1.474 1.474 0 0 0 1.5 13v2h-1v-2A2.475 2.475 0 0 1 3 10.5h2A2.476 2.476 0 0 1 7.5 13zM4 5.5a1.5 1.5 0 1 1 0 3 1.5 1.5 0 0 1 0-3m0-1a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>'),r("omrs-icon-user",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 2a2.5 2.5 0 1 1 0 5 2.5 2.5 0 0 1 0-5m0-1a3.5 3.5 0 1 0 0 7 3.5 3.5 0 0 0 0-7M13 15h-1v-2.5A2.5 2.5 0 0 0 9.5 10h-3A2.5 2.5 0 0 0 4 12.5V15H3v-2.5A3.5 3.5 0 0 1 6.5 9h3a3.5 3.5 0 0 1 3.5 3.5z"/></svg>'),r("omrs-icon-view-off",'<svg xmlns="http://www.w3.org/2000/svg"><path d="m2.62 11.255.715-.71A7 7 0 0 1 1.535 8C2.55 5.465 5.35 3.5 8 3.5a6.2 6.2 0 0 1 2 .36l.775-.78A7.4 7.4 0 0 0 8 2.5 8.35 8.35 0 0 0 .53 7.83a.5.5 0 0 0 0 .34 8 8 0 0 0 2.09 3.085"/><path d="M6 7.865a2 2 0 0 1 1.85-1.85l.905-.91A3 3 0 0 0 5.09 8.77zM15.47 7.83a8.2 8.2 0 0 0-2.87-3.72L15 1.705 14.295 1 1 14.295l.705.705 2.55-2.55A7.65 7.65 0 0 0 8 13.5a8.35 8.35 0 0 0 7.47-5.33.5.5 0 0 0 0-.34M10 8a2 2 0 0 1-3 1.72L9.72 7A2 2 0 0 1 10 8m-2 4.5a6.5 6.5 0 0 1-3-.79l1.27-1.27a3 3 0 0 0 4.175-4.175L11.88 4.83A7.27 7.27 0 0 1 14.465 8C13.45 10.535 10.65 12.5 8 12.5"/></svg>'),r("omrs-icon-view",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M15.47 7.83A8.34 8.34 0 0 0 8 2.5 8.35 8.35 0 0 0 .53 7.83a.5.5 0 0 0 0 .34A8.35 8.35 0 0 0 8 13.5a8.35 8.35 0 0 0 7.47-5.33.5.5 0 0 0 0-.34M8 12.5c-2.65 0-5.45-1.965-6.465-4.5C2.55 5.465 5.35 3.5 8 3.5s5.45 1.965 6.465 4.5C13.45 10.535 10.65 12.5 8 12.5"/><path d="M8 5a3 3 0 1 0 0 6 3 3 0 0 0 0-6m0 5a2 2 0 1 1 0-4 2 2 0 0 1 0 4"/></svg>'),r("omrs-icon-warning",'<svg xmlns="http://www.w3.org/2000/svg"><path d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1m0 13A6 6 0 1 1 8 2a6 6 0 0 1 0 12"/><path d="M8.5 4h-1v5.5h1zM8 11a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5"/></svg>')}(),function(){"use strict";A.r(T)}(),T}())}}}))},1793:(e,t,n)=>{"use strict";n.r(t),n.d(t,{addRoutesOverride:()=>p.Uo,finishRegisteringAllApps:()=>p.QZ,getCoreTranslation:()=>m.R,initializeApp:()=>p.ZF,isOpenmrsAppRoutes:()=>p.tW,isOpenmrsRoutes:()=>p.Hs,localStorageRoutesPrefix:()=>p.F,registerApp:()=>p.VG,removeRoutesOverride:()=>p.n,resetAllRoutesOverrides:()=>p.O$,translateFrom:()=>m.a,tryRegisterExtension:()=>p.VN});var r=n(6173),o={};for(const e in r)"default"!==e&&(o[e]=()=>r[e]);n.d(t,o);var i=n(1704);o={};for(const e in i)"default"!==e&&(o[e]=()=>i[e]);n.d(t,o);var a=n(7910);o={};for(const e in a)"default"!==e&&(o[e]=()=>a[e]);n.d(t,o);var u=n(9855);o={};for(const e in u)"default"!==e&&(o[e]=()=>u[e]);n.d(t,o);var s=n(1491);o={};for(const e in s)"default"!==e&&(o[e]=()=>s[e]);n.d(t,o);var c=n(6362);o={};for(const e in c)"default"!==e&&(o[e]=()=>c[e]);n.d(t,o);var l=n(7295);o={};for(const e in l)"default"!==e&&(o[e]=()=>l[e]);n.d(t,o);var f=n(2431);o={};for(const e in f)"default"!==e&&(o[e]=()=>f[e]);n.d(t,o);var d=n(1912);o={};for(const e in d)"default"!==e&&(o[e]=()=>d[e]);n.d(t,o);var h=n(3419);o={};for(const e in h)"default"!==e&&(o[e]=()=>h[e]);n.d(t,o);var p=n(3691),y=n(8050);o={};for(const e in y)["default","addRoutesOverride","finishRegisteringAllApps","initializeApp","isOpenmrsAppRoutes","isOpenmrsRoutes","localStorageRoutesPrefix","registerApp","removeRoutesOverride","resetAllRoutesOverrides","tryRegisterExtension"].indexOf(e)<0&&(o[e]=()=>y[e]);n.d(t,o);var v=n(7350);o={};for(const e in v)["default","addRoutesOverride","finishRegisteringAllApps","initializeApp","isOpenmrsAppRoutes","isOpenmrsRoutes","localStorageRoutesPrefix","registerApp","removeRoutesOverride","resetAllRoutesOverrides","tryRegisterExtension"].indexOf(e)<0&&(o[e]=()=>v[e]);n.d(t,o);var m=n(58),g=n(9523);o={};for(const e in g)["default","addRoutesOverride","finishRegisteringAllApps","initializeApp","isOpenmrsAppRoutes","isOpenmrsRoutes","localStorageRoutesPrefix","registerApp","removeRoutesOverride","resetAllRoutesOverrides","tryRegisterExtension","getCoreTranslation","translateFrom"].indexOf(e)<0&&(o[e]=()=>g[e]);n.d(t,o)},7295:()=>{System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e){window.dispatchEvent(new CustomEvent(y,{detail:{online:e}}))},t=function(e){if(!window.offlineEnabled)return function(){};var t=function(t){return e(t.detail)};return window.addEventListener(y,t),function(){return window.removeEventListener(y,t)}},n=function(e){return e({online:!window.offlineEnabled||navigator.onLine}),t(e)},r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};window.dispatchEvent(new CustomEvent(v,{detail:e}))},o=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(v,t),function(){return window.removeEventListener(v,t)}},i=function(e){window.dispatchEvent(new CustomEvent(m,{detail:e}))},a=function(e){window.dispatchEvent(new CustomEvent(g,{detail:e}))},u=function(e){window.dispatchEvent(new CustomEvent(w,{detail:e}))},s=function(e){window.dispatchEvent(new CustomEvent(b,{detail:e}))},c=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(m,t),function(){return window.removeEventListener(m,t)}},l=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(g,t),function(){return window.removeEventListener(g,t)}},f=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(b,t),function(){return window.removeEventListener(b,t)}},d=function(e){var t=function(t){return e(t.detail)};return window.addEventListener(w,t),function(){return window.removeEventListener(w,t)}},h={d:function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},p={};h.r(p),h.d(p,{dispatchActionableNotificationShown:function(){return a},dispatchConnectivityChanged:function(){return e},dispatchNotificationShown:function(){return i},dispatchPrecacheStaticDependencies:function(){return r},dispatchSnackbarShown:function(){return u},dispatchToastShown:function(){return s},subscribeActionableNotificationShown:function(){return l},subscribeConnectivity:function(){return n},subscribeConnectivityChanged:function(){return t},subscribeNotificationShown:function(){return c},subscribePrecacheStaticDependencies:function(){return o},subscribeSnackbarShown:function(){return d},subscribeToastShown:function(){return f}});var y="openmrs:connectivity-changed",v="openmrs:precache-static-dependencies",m="openmrs:notification-shown",g="openmrs:actionable-notification-shown",b="openmrs:toast-shown",w="openmrs:snack-bar-shown";return p}())}}}))},2431:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function a(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}System.register(["@openmrs/esm-state"],(function(e,t){var u={};return{setters:[function(e){u.createGlobalStore=e.createGlobalStore}],execute:function(){e(function(){"use strict";var e={685:function(e){e.exports=u}},t={};function s(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,s),o.exports}s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var c={};return function(){var e=function(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")},t=function(e){return e&&e.sensitive?"":"i"},u=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},l=function(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return u(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},f=function(e){return t=e.matcher,(null!=(n=RegExp)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](t):i(t,n))?e.matcher:"string"==typeof e.matcher?je(e.matcher):je(e.path);var t,n},d=function(e){return h([e])},h=function(e){var t=p(),n=e.map((function(e){return{matcher:f(e),settings:e}})),r=l(t).concat(l(n));Ae.setState(r,!0)},p=function(){return Ae.getState()},y=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},v=function(e,t){if(e.length>0){var n=Te(e,t);if(n){for(var r=[n],o=Te(e,n.settings.parent);void 0!==o;)r.push(o),o=Te(e,o.settings.parent);return r.reverse()}}return[]},m=function(e){return v(p(),e)},g=function(e,t,n){var r=S(e,t,n);Re.length?Re.forEach((function(e){return e(r)})):setTimeout((function(){throw r}))},b=function(e){if("function"!=typeof e)throw Error(_(28,!1));Re.push(e)},w=function(e){if("function"!=typeof e)throw Error(_(29,!1));var t=!1;return Re=Re.filter((function(n){var r=n===e;return t=t||r,!r})),t},_=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];return"single-spa minified message #".concat(e,": ").concat(t?t+" ":"","See https://single-spa.js.org/error/?code=").concat(e).concat(r.length?"&arg=".concat(r.join("&arg=")):"")},S=function(e,t,n){var r,o="".concat(P(t)," '").concat(x(t),"' died in status ").concat(t.status,": ");if(i(e,Error)){try{e.message=o+e.message}catch(e){}r=e}else{console.warn(_(30,!1,t.status,x(t)));try{r=Error(o+JSON.stringify(e))}catch(t){r=e}}return r.appOrParcelName=x(t),t.status=n,r},O=function(e){return e.status===ze},E=function(e){try{return e.activeWhen(window.location)}catch(t){return g(t,e,We),!1}},x=function(e){return e.name},k=function(e){return Boolean(e.unmountThisParcel)},P=function(e){return k(e)?"parcel":"application"},j=function(){for(var e=arguments.length-1;e>0;e--)for(var t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]},A=function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n];return null},T=function(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!A(t,(function(e){return"function"!=typeof e}))));var t},D=function(e,t){var n=e[t]||[];0===(n=Array.isArray(n)?n:[n]).length&&(n=[function(){return Promise.resolve()}]);var r=P(e),o=x(e);return function(e){return n.reduce((function(n,i,a){return n.then((function(){var n=i(e);return C(n)?n:Promise.reject(_(15,!1,r,o,t,a))}))}),Promise.resolve())}},C=function(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch},I=function(e,t){return Promise.resolve().then((function(){return e.status!==Fe?e:(e.status=Be,e.bootstrap?G(e,"bootstrap").then(n).catch((function(n){if(t)throw S(n,e,We);return g(n,e,We),e})):Promise.resolve().then(n))}));function n(){return e.status=Ue,e}},M=function(e,t){return Promise.resolve().then((function(){var n=function(){return G(e,"unmount").then((function(){e.status=Ue}),(function(n){if(t)throw S(n,e,We);g(n,e,We)}))};if(e.status!==ze)return e;e.status=Ge;var r=Object.keys(e.parcels).map((function(t){return e.parcels[t].unmountThisParcel()}));return Promise.all(r).then(n,(function(r){return n().then((function(){var n=Error(r.message);if(t)throw S(n,e,We);g(n,e,We)}))})).then((function(){return e}))}))},R=function(e,t){return Promise.resolve().then((function(){return e.status!==Ue?e:(Ye||(window.dispatchEvent(new Me("single-spa:before-first-mount")),Ye=!0),e.status=Ke,G(e,"mount").then((function(){return e.status=ze,Je||(window.dispatchEvent(new Me("single-spa:first-mount")),Je=!0),e})).catch((function(n){var r=function(){if(t)throw S(n,e,We);return g(n,e,We),e};return e.status=ze,M(e,!0).then(r,r)})))}))},N=function(){return L.apply(Ze,arguments)},L=function(e,t){var n=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(_(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(_(3,!1,a(e.name)));var r=Qe++,o=e.name||"parcel-".concat(r);if("object"!=typeof t)throw Error(_(4,!1,o,void 0===t?"undefined":a(t)));if(!t.domElement)throw Error(_(5,!1,o));var i,u="function"==typeof e,s=u?e:function(){return Promise.resolve(e)},c={id:r,parcels:{},status:u?Le:Fe,customProps:t,parentName:x(n),unmountThisParcel:function(){return p.then((function(){if(c.status!==ze)throw Error(_(6,!1,o,c.status));return M(c,!0)})).then((function(e){return c.parentName&&delete n.parcels[c.id],e})).then((function(e){return f(e),e})).catch((function(e){throw c.status=We,d(e),e}))}};n.parcels[r]=c;var l=s();if(!l||"function"!=typeof l.then)throw Error(_(7,!1));l=l.then((function(e){if(!e)throw Error(_(8,!1));if(o=e.name||"parcel-".concat(r),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!T(e.bootstrap))throw Error(_(9,!1,o));if(!T(e.mount))throw Error(_(10,!1,o));if(!T(e.unmount))throw Error(_(11,!1,o));if(e.update&&!T(e.update))throw Error(_(12,!1,o));var t=D(e,"bootstrap"),n=D(e,"mount"),a=D(e,"unmount");c.status=Fe,c.name=o,c.bootstrap=t,c.mount=n,c.unmount=a,c.timeouts=H(e.timeouts),e.update&&(c.update=D(e,"update"),i.update=function(e){return c.customProps=e,F((t=c,Promise.resolve().then((function(){if(t.status!==ze)throw Error(_(32,!1,x(t)));return t.status=Ve,G(t,"update").then((function(){return t.status=ze,t})).catch((function(e){throw S(e,t,We)}))}))));var t})}));var f,d,h=l.then((function(){return I(c,!0)})),p=h.then((function(){return R(c,!0)})),y=new Promise((function(e,t){f=e,d=t}));return i={mount:function(){return F(Promise.resolve().then((function(){if(c.status!==Ue)throw Error(_(13,!1,o,c.status));return n.parcels[r]=c,R(c)})))},unmount:function(){return F(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:F(l),bootstrapPromise:F(h),mountPromise:F(p),unmountPromise:F(y)}},F=function(e){return e.then((function(){return null}))},B=function(e){var t=x(e),n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(_(40,!1),t,n));var r=j({},n,{name:t,mountParcel:L.bind(e),singleSpa:Ce});return k(e)&&(r.unmountSelf=e.unmountThisParcel),r},U=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(_(16,!1));Xe.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},K=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(_(17,!1));Xe.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},z=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(_(18,!1));Xe.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},V=function(e,t,n){if("number"!=typeof e||e<=0)throw Error(_(19,!1));Xe.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}},G=function(e,t){var n=e.timeouts[t],r=n.warningMillis,o=P(e);return new Promise((function(i,a){var u=!1,s=!1;e[t](B(e)).then((function(e){u=!0,i(e)})).catch((function(e){u=!0,a(e)})),setTimeout((function(){return l(1)}),r),setTimeout((function(){return l(!0)}),n.millis);var c=_(31,!1,t,o,x(e),n.millis);function l(e){if(!u)if(!0===e)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){var t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((function(){return l(t+1)}),r)}}}))},H=function(e){var t={};for(var n in Xe)t[n]=j({},Xe[n],e&&e[n]||{});return t},q=function(e){return Promise.resolve().then((function(){return e.loadPromise?e.loadPromise:e.status!==Ne&&e.status!==qe?e:(e.status=Le,e.loadPromise=Promise.resolve().then((function(){var r=e.loadApp(B(e));if(!C(r))throw n=!0,Error(_(33,!1,x(e)));return r.then((function(n){var r;e.loadErrorTime=null,"object"!=typeof(t=n)&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!T(t.bootstrap)&&(r=35),T(t.mount)||(r=36),T(t.unmount)||(r=37);var o=P(t);if(r){var i;try{i=JSON.stringify(t)}catch(e){}return console.error(_(r,!1,o,x(e),i),t),g(void 0,e,We),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=j({},e.devtools.overlays,t.devtools.overlays)),e.status=Fe,e.bootstrap=D(t,"bootstrap"),e.mount=D(t,"mount"),e.unmount=D(t,"unmount"),e.unload=D(t,"unload"),e.timeouts=H(t.timeouts),delete e.loadPromise,e}))})).catch((function(t){var r;return delete e.loadPromise,n?r=We:(r=qe,e.loadErrorTime=(new Date).getTime()),g(t,e,r),e})));var t,n}))},W=function(e){var t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(_(14,!1));t=e.currentTarget.href,e.preventDefault()}var n=Z(window.location.href),r=Z(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)},$=function(e){var t=this;if(e){var n=e[0].type;nt.indexOf(n)>=0&&tt[n].forEach((function(n){try{n.apply(t,e)}catch(e){setTimeout((function(){throw e}))}}))}},Y=function(){dt([],arguments)},J=function(e,t){return function(){var n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return De&&n===o||window.dispatchEvent(function(e,t){var n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){(n=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}},Q=function(e){if(ot)throw Error(_(43,!1));De=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,ot=!0,rt=window.history.replaceState,window.addEventListener("hashchange",Y),window.addEventListener("popstate",Y);var t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&nt.indexOf(e)>=0)||A(tt[e],(function(e){return e===n})))return t.apply(this,arguments);tt[e].push(n)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&nt.indexOf(e)>=0))return n.apply(this,arguments);tt[e]=tt[e].filter((function(e){return e!==t}))},window.history.pushState=J(window.history.pushState,"pushState"),window.history.replaceState=J(rt,"replaceState")},Z=function(e){var t=document.createElement("a");return t.href=e,t},X=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!it){var t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return ee.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return ee.call(this,n,window.removeEventListener,e,t,arguments)},it=!0}},ee=function(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((function(e){nt.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))},te=function(e){return Promise.resolve().then((function(){var t=at[x(e)];if(!t)return e;if(e.status===Ne)return ne(e,t),e;if(e.status===He)return t.promise.then((function(){return e}));if(e.status!==Ue&&e.status!==qe)return e;var n=e.status===qe?Promise.resolve():G(e,"unload");return e.status=He,n.then((function(){return ne(e,t),e})).catch((function(n){return function(e,t,n){delete at[x(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,g(n,e,We),t.reject(n)}(e,t,n),e}))}))},ne=function(e,t){delete at[x(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=Ne,t.resolve()},re=function(e,t,n,r){at[x(e)]={app:e,resolve:n,reject:r},Object.defineProperty(at[x(e)],"promise",{get:t})},oe=function(e){return at[e]},ie=function(){return ut.filter(O).map(x)},ae=function(){return ut.map(x)},ue=function(e){var t=A(ut,(function(t){return x(t)===e}));return t?t.status:null},se=function(e,t,n,r){var o=function(e,t,n,r){var o,i={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(_(39,!1));var t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce((function(e,n){return t.indexOf(n)>=0?e:e.concat(n)}),[]);if(0!==n.length)throw Error(_(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error(_(20,!1));if("object"!=typeof e.app&&"function"!=typeof e.app)throw Error(_(20,!1));var r=function(e){return"string"==typeof e||"function"==typeof e};if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(_(24,!1));if(!he(e.customProps))throw Error(_(22,!1))}(e),i.name=e.name,i.loadApp=e.app,i.activeWhen=e.activeWhen,i.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(_(20,!1));if(!t)throw Error(_(23,!1));if("function"!=typeof n)throw Error(_(24,!1));if(!he(r))throw Error(_(22,!1))}(e,t,n,r),i.name=e,i.loadApp=t,i.activeWhen=n,i.customProps=r),i.loadApp="function"!=typeof(o=i.loadApp)?function(){return Promise.resolve(o)}:o,i.customProps=function(e){return e||{}}(i.customProps),i.activeWhen=function(e){var t=Array.isArray(e)?e:[e];return t=t.map((function(e){return"function"==typeof e?e:pe(e)})),function(e){return t.some((function(t){return t(e)}))}}(i.activeWhen),i}(e,t,n,r);if(ge()||st||(st=!0,setTimeout((function(){ge()||console.warn(_(1,!1))}),5e3)),-1!==ae().indexOf(o.name))throw Error(_(21,!1,o.name));ut.push(j({loadErrorTime:null,status:Ne,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),et&&(X(),dt())},ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return ut.filter((function(t){return t.activeWhen(e)})).map(x)},le=function(e){if(0===ut.filter((function(t){return x(t)===e})).length)throw Error(_(25,!1,e));return(et?fe(e,{waitForUnmount:!1}):Promise.resolve()).then((function(){var t=ut.map(x).indexOf(e);ut.splice(t,1)}))},fe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof e)throw Error(_(26,!1));var n=A(ut,(function(t){return x(t)===e}));if(!n)throw Error(_(27,!1,e));var r,o=oe(x(n));if(t&&t.waitForUnmount){if(o)return o.promise;var i=new Promise((function(e,t){re(n,(function(){return i}),e,t)}));return i}return o?(r=o.promise,de(n,o.resolve,o.reject)):r=new Promise((function(e,t){re(n,(function(){return r}),e,t),de(n,e,t)})),r},de=function(e,t,n){Promise.resolve().then((function(){if(A(ce(),(function(t){return t===x(e)})))return ye()})).then((function(){return M(e).then(te).then((function(){t(),setTimeout((function(){dt()}))}))})).catch(n)},he=function(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},pe=function(e,t){var n=function(e,t){var n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(var i=0;i<e.length;i++){var a=e[i];(!r&&":"===a||r&&"/"===a)&&u(i)}return u(e.length),new RegExp(o,"i");function u(i){var a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{var u=t?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(u,"$"):"".concat(o,"(/").concat(u,")?(#.*)?$")}r=!r,n=i}}(e,t);return function(e){var t=e.origin;t||(t="".concat(e.protocol,"//").concat(e.host));var r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}},ye=function(){return dt()},ve=function(e,t){return E(e)?I(e).then((function(e){return t.then((function(){return E(e)?R(e):e}))})):t.then((function(){return e}))},me=function(e){ht=!0,et&&(Q(e),dt())},ge=function(){return ht},be=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},we=function(e,t){var n=window.getOpenmrsSpaBase().replace(/\/$/,"");return _e(e,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){be(e,t,n[t])}))}return e}({openmrsBase:window.openmrsBase,openmrsSpaBase:n},t)).replace(/^\/\//,"/")},_e=function(e,t){return Object.keys(t).reduce((function(e,n){return e.split("${"+n+"}").join(t[n])}),e)},Se=function(e){var t=e.to,n=e.templateParams,r=window.getOpenmrsSpaBase().replace(/\/$/,""),o=we(t,n).replace(window.location.origin,"");o.startsWith(r)?W(o):window.location.assign(o)},Oe=function(e){var t,n=JSON.parse(null!==(t=sessionStorage.getItem(yt))&&void 0!==t?t:"[]")||[];n.push(e),n.length>50&&(n=n.slice(-50)),sessionStorage.setItem(yt,JSON.stringify(n))},Ee=function(){var e;0===JSON.parse(null!==(e=sessionStorage.getItem(yt))&&void 0!==e?e:"[]").length&&document.referrer&&Oe(document.referrer),window.addEventListener("single-spa:routing-event",(function(e){var t,n,r=xe();"replaceState"==(null===(t=e.detail.originalEvent)||void 0===t?void 0:t.singleSpaTrigger)?(r[r.length-1]=window.location.href,sessionStorage.setItem(yt,JSON.stringify(r))):!(null===(n=e.detail.originalEvent)||void 0===n?void 0:n.singleSpa)&&r.includes(window.location.href)?ke({toUrl:window.location.href}):r[r.length-1]!==window.location.href&&Oe(window.location.href)}))},xe=function(){var e;return JSON.parse(null!==(e=sessionStorage.getItem(yt))&&void 0!==e?e:"[]")},ke=function(e){var t=e.toUrl,n=xe(),r=n.lastIndexOf(t);if(-1==r)throw new Error("URL ".concat(t," not found in history; cannot go back to it."));var o=n.slice(0,r+1);Se({to:n[r]}),sessionStorage.setItem(yt,JSON.stringify(o))},Pe=function(){sessionStorage.removeItem(yt)};function je(n,r,o){return i(n,RegExp)?function(e,t){if(!t)return e;var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:"",suffix:"",modifier:"",pattern:""});return e}(n,r):Array.isArray(n)?function(e,n,r){var o=e.map((function(e){return je(e,n,r).source}));return new RegExp("(?:"+o.join("|")+")",t(r))}(n,r,o):function(n,r,o){return function(n,r,o){void 0===o&&(o={});for(var i=o.strict,a=void 0!==i&&i,u=o.start,s=void 0===u||u,c=o.end,l=void 0===c||c,f=o.encode,d=void 0===f?function(e){return e}:f,h="["+e(o.endsWith||"")+"]|$",p="["+e(o.delimiter||"/#?")+"]",y=s?"^":"",v=0,m=n;v<m.length;v++){var g=m[v];if("string"==typeof g)y+=e(d(g));else{var b=e(d(g.prefix)),w=e(d(g.suffix));if(g.pattern)if(r&&r.push(g),b||w)if("+"===g.modifier||"*"===g.modifier){var _="*"===g.modifier?"?":"";y+="(?:"+b+"((?:"+g.pattern+")(?:"+w+b+"(?:"+g.pattern+"))*)"+w+")"+_}else y+="(?:"+b+"("+g.pattern+")"+w+")"+g.modifier;else y+="("+g.pattern+")"+g.modifier;else y+="(?:"+b+w+")"+g.modifier}}if(l)a||(y+=p+"?"),y+=o.endsWith?"(?="+h+")":"$";else{var S=n[n.length-1],O="string"==typeof S?p.indexOf(S[S.length-1])>-1:void 0===S;a||(y+="(?:"+p+"(?="+h+"))?"),O||(y+="(?="+p+"|"+h+")")}return new RegExp(y,t(o))}(function(t,n){void 0===n&&(n={});for(var r=function(e){for(var t=[],n=0;n<e.length;){var r=e[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)t.push({type:"CHAR",index:n,value:e[n++]});else{var o=1,i="";if("?"===e[u=n+1])throw new TypeError('Pattern cannot start with "?" at '+u);for(;u<e.length;)if("\\"!==e[u]){if(")"===e[u]){if(0==--o){u++;break}}else if("("===e[u]&&(o++,"?"!==e[u+1]))throw new TypeError("Capturing groups are not allowed at "+u);i+=e[u++]}else i+=e[u++]+e[u++];if(o)throw new TypeError("Unbalanced pattern at "+n);if(!i)throw new TypeError("Missing pattern at "+n);t.push({type:"PATTERN",index:n,value:i}),n=u}else{for(var a="",u=n+1;u<e.length;){var s=e.charCodeAt(u);if(!(s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122||95===s))break;a+=e[u++]}if(!a)throw new TypeError("Missing parameter name at "+n);t.push({type:"NAME",index:n,value:a}),n=u}else t.push({type:"CLOSE",index:n,value:e[n++]});else t.push({type:"OPEN",index:n,value:e[n++]});else t.push({type:"ESCAPED_CHAR",index:n++,value:e[n++]});else t.push({type:"MODIFIER",index:n,value:e[n++]})}return t.push({type:"END",index:n,value:""}),t}(t),o=n.prefixes,i=void 0===o?"./":o,a="[^"+e(n.delimiter||"/#?")+"]+?",u=[],s=0,c=0,l="",f=function(e){if(c<r.length&&r[c].type===e)return r[c++].value},d=function(e){var t=f(e);if(void 0!==t)return t;var n=r[c],o=n.type,i=n.index;throw new TypeError("Unexpected "+o+" at "+i+", expected "+e)},h=function(){for(var e,t="";e=f("CHAR")||f("ESCAPED_CHAR");)t+=e;return t};c<r.length;){var p=f("CHAR"),y=f("NAME"),v=f("PATTERN");if(y||v){var m=p||"";-1===i.indexOf(m)&&(l+=m,m=""),l&&(u.push(l),l=""),u.push({name:y||s++,prefix:m,suffix:"",pattern:v||a,modifier:f("MODIFIER")||""})}else{var g=p||f("ESCAPED_CHAR");if(g)l+=g;else if(l&&(u.push(l),l=""),f("OPEN")){m=h();var b=f("NAME")||"",w=f("PATTERN")||"",_=h();d("CLOSE"),u.push({name:b||(w?s++:""),pattern:b&&!w?a:w,prefix:m,suffix:_,modifier:f("MODIFIER")||""})}else d("END")}}return u}(n,o),r,o)}(n,r,o)}s.r(c),s.d(c,{clearHistory:function(){return Pe},filterBreadcrumbs:function(){return v},getBreadcrumbs:function(){return p},getBreadcrumbsFor:function(){return m},getHistory:function(){return xe},goBackInHistory:function(){return ke},interpolateString:function(){return _e},interpolateUrl:function(){return we},navigate:function(){return Se},registerBreadcrumb:function(){return d},registerBreadcrumbs:function(){return h},setupHistory:function(){return Ee}});var Ae=(0,s(685).createGlobalStore)("breadcrumbs",[]);function Te(e,t){if(t)return function(e,t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,1);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,1):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e.filter((function(e){return e.matcher.test(t)})));return n[0]}(e,t)||function(e,t){for(var n=t.split("/");n.length>1;){n.pop();var r=Te(e,n.join("/"));if(r)return r}}(e,t)}var De,Ce=Object.freeze({__proto__:null,get start(){return me},get ensureJQuerySupport(){return X},get setBootstrapMaxTime(){return U},get setMountMaxTime(){return K},get setUnmountMaxTime(){return z},get setUnloadMaxTime(){return V},get registerApplication(){return se},get unregisterApplication(){return le},get getMountedApps(){return ie},get getAppStatus(){return ue},get unloadApplication(){return fe},get checkActivityFunctions(){return ce},get getAppNames(){return ae},get pathToActiveWhen(){return pe},get navigateToUrl(){return W},get patchHistoryApi(){return Q},get triggerAppChange(){return ye},get addErrorHandler(){return b},get removeErrorHandler(){return w},get mountRootParcel(){return N},get NOT_LOADED(){return Ne},get LOADING_SOURCE_CODE(){return Le},get NOT_BOOTSTRAPPED(){return Fe},get BOOTSTRAPPING(){return Be},get NOT_MOUNTED(){return Ue},get MOUNTING(){return Ke},get UPDATING(){return Ve},get LOAD_ERROR(){return qe},get MOUNTED(){return ze},get UNLOADING(){return He},get UNMOUNTING(){return Ge},get SKIP_BECAUSE_BROKEN(){return We}}),Ie=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{}).CustomEvent,Me=function(){try{var e=new Ie("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?Ie:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n},Re=[],Ne="NOT_LOADED",Le="LOADING_SOURCE_CODE",Fe="NOT_BOOTSTRAPPED",Be="BOOTSTRAPPING",Ue="NOT_MOUNTED",Ke="MOUNTING",ze="MOUNTED",Ve="UPDATING",Ge="UNMOUNTING",He="UNLOADING",qe="LOAD_ERROR",We="SKIP_BECAUSE_BROKEN",$e=[],Ye=!1,Je=!1,Qe=0,Ze={parcels:{}},Xe={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}},et="undefined"!=typeof window,tt={hashchange:[],popstate:[]},nt=["hashchange","popstate"],rt=null,ot=!1;et&&(window.singleSpaNavigate?console.warn(_(41,!1)):window.singleSpaNavigate=W);var it=!1,at={},ut=[],st=!1,ct=!1,lt=[],ft=et&&window.location.href;function dt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(ct)return new Promise((function(e,n){lt.push({resolve:e,reject:n,eventArguments:t})}));var r,i=function(){var e=[],t=[],n=[],r=[],o=(new Date).getTime();return ut.forEach((function(i){var a=i.status!==We&&E(i);switch(i.status){case qe:a&&o-i.loadErrorTime>=200&&n.push(i);break;case Ne:case Le:a&&n.push(i);break;case Fe:case Ue:!a&&oe(x(i))?e.push(i):a&&r.push(i);break;case ze:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}(),a=i.appsToUnload,u=i.appsToUnmount,s=i.appsToLoad,c=i.appsToMount,l=[],f=ft,d=ft=window.location.href;return ge()?(ct=!0,r=a.concat(s,u,c),Promise.resolve().then((function(){return m(0===r.length?"before-no-app-change":"before-app-change",v(!0)),m("before-routing-event",v(!0,{cancelNavigation:h})),Promise.all(l).then((function(n){if(n.some((function(e){return e})))return rt.call(window.history,history.state,"",f.substring(location.origin.length)),ft=location.href,ct=!1,dt(e,t,!0);var r=a.map(te),o=u.map(M).map((function(e){return e.then(te)})).concat(r),i=Promise.all(o);i.then((function(){m("before-mount-routing-event",v(!0))}),(function(e){throw e}));var l=s.map((function(e){return q(e).then((function(e){return ve(e,i)}))})),d=c.filter((function(e){return s.indexOf(e)<0})).map((function(e){return ve(e,i)}));return i.catch((function(e){throw y(),e})).then((function(){return y(),Promise.all(l.concat(d)).catch((function(t){throw e.forEach((function(e){return e.reject(t)})),t})).then(p).then((function(){}),(function(e){throw e}))}))}))}))):(r=s,Promise.resolve().then((function(){var e=s.map(q);return Promise.all(e).then(y).then((function(){return[]})).catch((function(e){throw y(),e})).finally((function(){}))})));function h(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);l.push(t.catch((function(e){return console.warn(Error(_(42,!1))),console.warn(e),!1})))}function p(){var t=ie();e.forEach((function(e){return e.resolve(t)}));try{m(0===r.length?"no-app-change":"app-change",v()),m("routing-event",v())}catch(e){setTimeout((function(){throw e}))}if(ct=!1,lt.length>0){var n=lt;lt=[],dt(n)}return t}function y(){n||(e.forEach((function(e){$(e.eventArguments)})),$(t))}function v(){var e,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,l={},h=(o(e={},ze,[]),o(e,Ue,[]),o(e,Ne,[]),o(e,We,[]),e);n?(s.concat(c).forEach((function(e,t){y(e,ze)})),a.forEach((function(e){y(e,Ne)})),u.forEach((function(e){y(e,Ue)}))):r.forEach((function(e){y(e)}));var p={detail:{newAppStatuses:l,appsByNewStatus:h,totalAppChanges:r.length,originalEvent:null==t?void 0:t[0],oldUrl:f,newUrl:d}};return i&&j(p.detail,i),p;function y(e,t){var n=x(e);t=t||ue(n),l[n]=t,(h[t]=h[t]||[]).push(n)}}function m(e,t){n||window.dispatchEvent(new Me("single-spa:".concat(e),t))}}var ht=!1,pt={getRawAppData:function(){return function(e){if(Array.isArray(e))return r(e)}(e=ut)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var e},reroute:dt,NOT_LOADED:Ne,toLoadPromise:q,toBootstrapPromise:I,unregisterApplication:le,getProfilerData:function(){return $e}};et&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=pt);var yt="openmrs:history"}(),c}())}}}))},1912:(e,t,n)=>{function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){u(e,t,n[t])}))}return e}function l(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function p(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}System.register(["@openmrs/esm-api","@openmrs/esm-state"],(function(e,t){var r={},i={};return{setters:[function(e){r.getLoggedInUser=e.getLoggedInUser},function(e){i.createGlobalStore=e.createGlobalStore}],execute:function(){e(function(){"use strict";var e={766:function(e){e.exports=r},685:function(e){e.exports=i}},t={};function p(n){var r=t[n];if(void 0!==r)return r.exports;var o=t[n]={exports:{}};return e[n](o,o.exports,p),o.exports}p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var y={};return function(){var e=function(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))},t=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},r=function(e,n){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){r&&(e=r);var o=0;return function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}return(r=e[Symbol.iterator]()).next.bind(r)},i=function(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href},v=function(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)},m=function(){},g=function(e,t){if(!t)return e&&e.then?e.then(m):Promise.resolve()},b=function(e,t){if(void 0!==In)return console.warn("The application's Service Worker has already been registered. The new service worker at ".concat(e," will not be registered.")),In;if(!("serviceWorker"in navigator))throw new Error("Registering the Service Worker is not possible due to missing browser capabilities.");var n=new Cn(e,t);return In=n.register().then((function(){return n.controlling.then((function(){return n}))}))},w=function(){return null!=In?In:Promise.resolve(void 0)},S=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},O=function(e){return Ln.apply(this,arguments)},E=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},x=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){E(i,r,o,a,u,"next",e)}function u(e){E(i,r,o,a,u,"throw",e)}a(void 0)}))}},k=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},P=function(){return Fn.apply(this,arguments)},j=function(){return Bn.apply(this,arguments)},A=function(){return Un.apply(this,arguments)},T=function(){return Kn.apply(this,arguments)},D=function(){return{current:Vn,notAvailable:"unavailable"===Vn,active:"on"===Vn}},C=function(e){"unavailable"!==Vn&&"unavailable"!==e&&(localStorage.setItem(zn,"on"===e?"active":"disabled"),Vn=e)},I=function(){return Gn.apply(this,arguments)},M=function(e,t){return"object"!=typeof t||qn(t).forEach((function(n){e[n]=t[n]})),e},R=function(e,t){return Yn.call(e,t)},N=function(e,t){"function"==typeof t&&(t=t($n(e))),("undefined"==typeof Reflect?qn:Reflect.ownKeys)(t).forEach((function(n){L(e,n,t[n])}))},L=function(e,t,n,r){Jn(e,t,M(n&&R(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))},F=function(e){return{from:function(t){return e.prototype=Object.create(t.prototype),L(e.prototype,"constructor",e),{extend:N.bind(null,e.prototype)}}}},B=function(e,t,n){return Xn.call(e,t,n)},U=function(e,t){return t(e)},K=function(e){if(!e)throw new Error("Assertion Failed")},z=function(e){Hn.setImmediate?setImmediate(e):setTimeout(e,0)},V=function(e,t){return e.reduce((function(e,n,r){var o=t(n,r);return o&&(e[o[0]]=o[1]),e}),{})},G=function(e){var t={};for(var n in e)R(e,n)&&(t[n]=e[n]);return t},H=function(e){return nr.apply([],e)},q=function(e){ir="undefined"!=typeof WeakMap&&new WeakMap;var t=ar(e);return ir=null,t},W=function(e){return ur.call(e).slice(8,-1)},$=function(e){var t,n,r,o;if(1===arguments.length){if(Wn(e))return e.slice();if(this===lr&&"string"==typeof e)return[e];if(o=cr(e)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n},Y=function(e,t){dr=e,hr=t},J=function(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(hr).map((function(e){return"\n"+e})).join("")):""},Q=function(e,t){this._e=yr(),this.name=e,this.message=t},Z=function(e,t){return e+". Errors: "+Object.keys(t).map((function(e){return t[e].toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")},X=function(e,t,n,r){this._e=yr(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=Z(e,t)},ee=function(e,t){this._e=yr(),this.name="BulkError",this.failures=Object.keys(t).map((function(e){return t[e]})),this.failuresByPos=t,this.message=Z(e,t)},te=function(){},ne=function(e){return e},re=function(e,t){return null==e||e===ne?t:function(n){return t(e(n))}},oe=function(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}},ie=function(e,t){return e===te?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?oe(r,this.onsuccess):r),o&&(this.onerror=this.onerror?oe(o,this.onerror):o),void 0!==i?i:n}},ae=function(e,t){return e===te?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?oe(n,this.onsuccess):n),r&&(this.onerror=this.onerror?oe(r,this.onerror):r)}},ue=function(e,t){return e===te?t:function(n){var r=e.apply(this,arguments);M(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?oe(o,this.onsuccess):o),i&&(this.onerror=this.onerror?oe(i,this.onerror):i),void 0===r?void 0===a?void 0:a:M(r,a)}},se=function(e,t){return e===te?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}},ce=function(e,t){return e===te?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,o=arguments.length,i=new Array(o);o--;)i[o]=arguments[o];return n.then((function(){return t.apply(r,i)}))}return t.apply(this,arguments)}},le=function(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=te,this._lib=!1;var t=this._PSD=zr;if(dr&&(this._stackHolder=yr(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Er)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&de(this,this._value))}this._state=null,this._value=null,++t.ref,Wr(this,e)},fe=function(e,t,n,r,o){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=o},de=function(e,t){if(Fr.push(t),null===e._state){var n=e._lib&&ge();t=Ur(t),e._state=!1,e._value=t,dr&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((function(){var n=Zn(t,"stack");t._promise=e,L(t,"stack",{get:function(){return Cr?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){Lr.some((function(t){return t._value===e._value}))||Lr.push(e)}(e),he(e),n&&be()}},he=function(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)pe(e,t[n]);var o=e._PSD;--o.ref||o.finalize(),0===Gr&&(++Gr,Mr((function(){0==--Gr&&we()}),[]))},pe=function(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Gr,Mr(ye,[n,e,t])}else e._listeners.push(t)},ye=function(e,t,n){try{Br=t;var r,o=t._value;t._state?r=e(o):(Fr.length&&(Fr=[]),r=e(o),-1===Fr.indexOf(o)&&function(e){for(var t=Lr.length;t;)if(Lr[--t]._value===e._value)return void Lr.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{Br=null,0==--Gr&&we(),--n.psd.ref||n.psd.finalize()}},ve=function(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)},me=function(){ge()&&be()},ge=function(){var e=Rr;return Rr=!1,Nr=!1,e},be=function(){var e,t,n;do{for(;Vr.length>0;)for(e=Vr,Vr=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(Vr.length>0);Rr=!0,Nr=!0},we=function(){var e=Lr;Lr=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Hr.slice(0),n=t.length;n;)t[--n]()},_e=function(e){return new le(Er,!1,e)},Se=function(e,t){var n=zr;return function(){var r=ge(),o=zr;try{return Ae(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Ae(o,!1),r&&be()}}},Oe=function(e,t,n,r){var o=zr,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++eo;var a=Kr.env;i.env=Dr?{Promise:le,PromiseProp:{value:le,configurable:!0,writable:!0},all:le.all,race:le.race,allSettled:le.allSettled,any:le.any,resolve:le.resolve,reject:le.reject,nthen:Me(a.nthen,i),gthen:Me(a.gthen,i)}:{},t&&M(i,t),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var u=De(i,e,n,r);return 0===i.ref&&i.finalize(),u},Ee=function(){return Yr.id||(Yr.id=++Jr),++Yr.awaits,Yr.echoes+=100,Yr.id},xe=function(){return!!Yr.awaits&&(0==--Yr.awaits&&(Yr.id=0),Yr.echoes=100*Yr.awaits,!0)},ke=function(e){return Yr.echoes&&e&&e.constructor===Tr?(Ee(),e.then((function(e){return xe(),e}),(function(e){return xe(),to(e)}))):e},Pe=function(e){++Xr,Yr.echoes&&0!=--Yr.echoes||(Yr.echoes=Yr.id=0),Qr.push(zr),Ae(e,!0)},je=function(){var e=Qr[Qr.length-1];Qr.pop(),Ae(e,!1)},Ae=function(e,t){var n=zr;if((t?!Yr.echoes||Zr++&&e===zr:!Zr||--Zr&&e===zr)||Ce(t?Pe.bind(null,e):je),e!==zr&&(zr=e,n===Kr&&(Kr.env=Te()),Dr)){var r=Kr.env.Promise,o=e.env;Pr.then=o.nthen,r.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(Hn,"Promise",o.PromiseProp),r.all=o.all,r.race=o.race,r.resolve=o.resolve,r.reject=o.reject,o.allSettled&&(r.allSettled=o.allSettled),o.any&&(r.any=o.any))}},Te=function(){var e=Hn.Promise;return Dr?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Hn,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Pr.then,gthen:e.prototype.then}:{}},De=function(e,t,n,r,o){var i=zr;try{return Ae(e,!0),t(n,r,o)}finally{Ae(i,!1)}},Ce=function(e){Ar.call(kr,e)},Ie=function(e,t,n,r){return"function"!=typeof e?e:function(){var o=zr;n&&Ee(),Ae(t,!0);try{return e.apply(this,arguments)}finally{Ae(o,!1),r&&Ce(xe)}}},Me=function(e,t){return function(n,r){return e.call(this,Ie(n,t),Ie(r,t))}},Re=function(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,o={promise:t,reason:e};if(Hn.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),M(r,o)):Hn.CustomEvent&&M(r=new CustomEvent("unhandledrejection",{detail:o}),o),r&&Hn.dispatchEvent&&(dispatchEvent(r),!Hn.PromiseRejectionEvent&&Hn.onunhandledrejection))try{Hn.onunhandledrejection(r)}catch(e){}dr&&r&&!r.defaultPrevented&&console.warn("Unhandled rejection: ".concat(e.stack||e))}catch(e){}},Ne=function(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t},Le=function(e){return"string"!=typeof e||/\./.test(e)?function(e){return e}:function(t){return void 0===t[e]&&e in t&&delete(t=q(t))[e],t}},Fe=function(e){var t={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return t[n].subscribe.apply(null,i),e}if("string"==typeof n)return t[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(e,r,o){if("object"==typeof e)return function(e){qn(e).forEach((function(t){var n=e[t];if(Wn(n))i(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new _r.InvalidArgument("Invalid event config");var r=i(t,ne,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){z((function(){e.apply(null,t)}))}))}))}}))}(e);r||(r=se),o||(o=te);var a={subscribers:[],fire:o,subscribe:function(e){-1===a.subscribers.indexOf(e)&&(a.subscribers.push(e),a.fire=r(a.fire,e))},unsubscribe:function(e){a.subscribers=a.subscribers.filter((function(t){return t!==e})),a.fire=a.subscribers.reduce(r,o)}};return t[e]=n[e]=a,a}},Be=function(e,t){return F(t).from({prototype:e}),t},Ue=function(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)},Ke=function(e,t){e.filter=Ne(e.filter,t)},ze=function(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return Ne(r(),t())}:t,e.justLimit=n&&!r},Ve=function(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new _r.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n},Ge=function(e,t,n){var r=Ve(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})},He=function(e,t,n,r){var o=e.replayFilter?Ne(e.filter,e.replayFilter()):e.filter;if(e.or){var i={},a=function(e,n,r){if(!o||o(n,r,(function(e){return n.stop(e)}),(function(e){return n.fail(e)}))){var a=n.primaryKey,u=""+a;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(a)),R(i,u)||(i[u]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(a,n),qe(Ge(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])}return qe(Ge(e,r,n),Ne(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)},qe=function(e,t,n,r){var o=Se(r?function(e,t,o){return n(r(e),t,o)}:n);return e.then((function(e){if(e)return e.start((function(){var n=function(){return e.continue()};t&&!t(e,(function(e){return n=e}),(function(t){e.stop(t),n=te}),(function(t){e.fail(t),n=te}))||o(e.value,e,(function(e){return n=e})),n()}))}))},We=function(e){var t=void 0===e?"undefined":h(e);if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";var n=W(e);return"ArrayBuffer"===n?"binary":n},$e=function(e){return s(e,Uint8Array)?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)},Ye=function(e,t){return e<t?-1:e===t?0:1},Je=function(e,t){return e>t?-1:e===t?0:1},Qe=function(e,t,n){var r=s(e,vo)?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r},Ze=function(e){return new e.Collection(e,(function(){return nt("")})).limit(0)},Xe=function(e,t,n,r,o,i){for(var a=Math.min(e.length,r.length),u=-1,s=0;s<a;++s){var c=t[s];if(c!==r[s])return o(e[s],n[s])<0?e.substr(0,s)+n[s]+n.substr(s+1):o(e[s],r[s])<0?e.substr(0,s)+r[s]+n.substr(s+1):u>=0?e.substr(0,u)+t[u]+n.substr(u+1):null;o(e[s],c)<0&&(u=s)}return a<r.length&&"next"===i?e+n.substr(e.length):a<e.length&&"prev"===i?e.substr(0,n.length):u<0?null:e.substr(0,u)+r[u]+n.substr(u+1)},et=function(e,t,n,r){var o,i,a,u,s,c,l,f=n.length;if(!n.every((function(e){return"string"==typeof e})))return Qe(e,"String expected.");function d(e){o=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),i=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),a="next"===e?Ye:Je;var t=n.map((function(e){return{lower:i(e),upper:o(e)}})).sort((function(e,t){return a(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),s=t.map((function(e){return e.lower})),c=e,l="next"===e?"":r}d("next");var h=new e.Collection(e,(function(){return tt(u[0],s[f-1]+r)}));h._ondirectionchange=function(e){d(e)};var p=0;return h._addAlgorithm((function(e,n,r){var o=e.key;if("string"!=typeof o)return!1;var d=i(o);if(t(d,s,p))return!0;for(var h=null,y=p;y<f;++y){var v=Xe(o,d,u[y],s[y],a,c);null===v&&null===h?p=y+1:(null===h||a(h,v)>0)&&(h=v)}return n(null!==h?function(){e.continue(h+l)}:r),!1})),h},tt=function(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}},nt=function(e){return{type:1,lower:e,upper:e}},rt=function(e){return Se((function(t){return ot(t),e(t.target.error),!1}))},ot=function(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()},it=function(e,t,n,r,o,i,a){return{name:e,keyPath:t,unique:n,multi:r,auto:o,compound:i,src:(n&&!a?"&":"")+(r?"*":"")+(o?"++":"")+at(t)}},at=function(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""},ut=function(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:V(n,(function(e){return[e.name,e]}))}},st=function(e){return null==e?function(){}:"string"==typeof e?function(e){return 1===e.split(".").length?function(t){return t[e]}:function(t){return er(t,e)}}(e):function(t){return er(t,e)}},ct=function(e){return[].slice.call(e)},lt=function(e){return null==e?":id":"string"==typeof e?e:"[".concat(e.join("+"),"]")},ft=function(e,t){var n=e._novip,r=t.db,o=function(e,t,n,r){var o=n.IDBKeyRange,i=(n.indexedDB,function(e,t){return t.reduce((function(e,t){return c({},e,(0,t.create)(e))}),e)}(function(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");var n=e.lower,r=e.upper,o=e.lowerOpen,i=e.upperOpen;return void 0===n?void 0===r?null:t.upperBound(r,!!i):void 0===r?t.lowerBound(n,!!o):t.bound(n,r,!!o,!!i)}var o=function(e,t){var n=ct(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((function(e){return t.objectStore(e)})).map((function(e){var t=e.keyPath,n=e.autoIncrement,r=Wn(t),o=null==t,i={},a={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:st(t)},indexes:ct(e.indexNames).map((function(t){return e.index(t)})).map((function(e){var t=e.name,n=e.unique,r=e.multiEntry,o=e.keyPath,a={name:t,compound:Wn(o),keyPath:o,unique:n,multiEntry:r,extractKey:st(o)};return i[lt(o)]=a,a})),getIndexByKeyPath:function(e){return i[lt(e)]}};return i[":id"]=a.primaryKey,null!=t&&(i[lt(t)]=a.primaryKey),a}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),i=o.schema,a=o.hasGetAll,u=i.tables.map((function(e){return function(e){var t=e.name;return{name:t,schema:e,mutate:function(e){var n=e.trans,o=e.type,i=e.keys,a=e.values,u=e.range;return new Promise((function(e,s){e=Se(e);var c=n.objectStore(t),l=null==c.keyPath,d="put"===o||"add"===o;if(!d&&"delete"!==o&&"deleteRange"!==o)throw new Error("Invalid operation type: "+o);var h,p=(i||a||{length:1}).length;if(i&&a&&i.length!==a.length)throw new Error("Given keys array must have same length as given values array.");if(0===p)return e({numFailures:0,failures:{},results:[],lastResult:void 0});var y=[],v=[],m=0,g=function(e){++m,ot(e)};if("deleteRange"===o){if(4===u.type)return e({numFailures:m,failures:v,results:[],lastResult:void 0});3===u.type?y.push(h=c.clear()):y.push(h=c.delete(r(u)))}else{var b=f(d?l?[a,i]:[a,null]:[i,null],2),w=b[0],_=b[1];if(d)for(var S=0;S<p;++S)y.push(h=_&&void 0!==_[S]?c[o](w[S],_[S]):c[o](w[S])),h.onerror=g;else for(var O=0;O<p;++O)y.push(h=c[o](w[O])),h.onerror=g}var E=function(t){var n=t.target.result;y.forEach((function(e,t){return null!=e.error&&(v[t]=e.error)})),e({numFailures:m,failures:v,results:"delete"===o?i:y.map((function(e){return e.result})),lastResult:n})};h.onerror=function(e){g(e),E(e)},h.onsuccess=E}))},getMany:function(e){var n=e.trans,r=e.keys;return new Promise((function(e,o){e=Se(e);for(var i,a=n.objectStore(t),u=r.length,s=new Array(u),c=0,l=0,f=function(t){var n=t.target;s[n._pos]=n.result,++l===c&&e(s)},d=rt(o),h=0;h<u;++h)null!=r[h]&&((i=a.get(r[h]))._pos=h,i.onsuccess=f,i.onerror=d,++c);0===c&&e(s)}))},get:function(e){var n=e.trans,r=e.key;return new Promise((function(e,o){e=Se(e);var i=n.objectStore(t).get(r);i.onsuccess=function(t){return e(t.target.result)},i.onerror=rt(o)}))},query:function(e){return function(n){return new Promise((function(o,i){o=Se(o);var a=n.trans,u=n.values,s=n.limit,c=n.query,l=s===1/0?void 0:s,f=c.index,d=c.range,h=a.objectStore(t),p=f.isPrimaryKey?h:h.index(f.name),y=r(d);if(0===s)return o({result:[]});if(e){var v=u?p.getAll(y,l):p.getAllKeys(y,l);v.onsuccess=function(e){return o({result:e.target.result})},v.onerror=rt(i)}else{var m=0,g=u||!("openKeyCursor"in p)?p.openCursor(y):p.openKeyCursor(y),b=[];g.onsuccess=function(e){var t=g.result;return t?(b.push(u?t.value:t.primaryKey),++m===s?o({result:b}):void t.continue()):o({result:b})},g.onerror=rt(i)}}))}}(a),openCursor:function(e){var n=e.trans,o=e.values,i=e.query,a=e.reverse,u=e.unique;return new Promise((function(e,s){e=Se(e);var c=i.index,l=i.range,f=n.objectStore(t),d=c.isPrimaryKey?f:f.index(c.name),h=a?u?"prevunique":"prev":u?"nextunique":"next",p=o||!("openKeyCursor"in d)?d.openCursor(r(l),h):d.openKeyCursor(r(l),h);p.onerror=rt(s),p.onsuccess=Se((function(t){var r=p.result;if(r){r.___id=++wo,r.done=!1;var o=r.continue.bind(r),i=r.continuePrimaryKey;i&&(i=i.bind(r));var a=r.advance.bind(r),u=function(){throw new Error("Cursor not stopped")};r.trans=n,r.stop=r.continue=r.continuePrimaryKey=r.advance=function(){throw new Error("Cursor not started")},r.fail=Se(s),r.next=function(){var e=this,t=1;return this.start((function(){return t--?e.continue():e.stop()})).then((function(){return e}))},r.start=function(e){var t=new Promise((function(e,t){e=Se(e),p.onerror=rt(t),r.fail=t,r.stop=function(t){r.stop=r.continue=r.continuePrimaryKey=r.advance=u,e(t)}})),n=function(){if(p.result)try{e()}catch(e){r.fail(e)}else r.done=!0,r.start=function(){throw new Error("Cursor behind last entry")},r.stop()};return p.onsuccess=Se((function(e){p.onsuccess=n,n()})),r.continue=o,r.continuePrimaryKey=i,r.advance=a,n(),t},e(r)}else e(null)}),s)}))},count:function(e){var n=e.query,o=e.trans,i=n.index,a=n.range;return new Promise((function(e,n){var u=o.objectStore(t),s=i.isPrimaryKey?u:u.index(i.name),c=r(a),l=c?s.count(c):s.count();l.onsuccess=Se((function(t){return e(t.target.result)})),l.onerror=rt(n)}))}}}(e)})),s={};return u.forEach((function(e){return s[e.name]=e})),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(e){if(!s[e])throw new Error("Table '".concat(e,"' not found"));return s[e]},MIN_KEY:-1/0,MAX_KEY:bo(t),schema:i}}(t,o,r),e.dbcore));return{dbcore:i}}(n._middlewares,r,n._deps,t);n.core=o.dbcore,n.tables.forEach((function(e){var t=e.name;n.core.schema.tables.some((function(e){return e.name===t}))&&(e.core=n.core.table(t),s(n[t],n.Table)&&(n[t].core=e.core))}))},dt=function(e,t,n,r){var o=e._novip;n.forEach((function(e){var n=r[e];t.forEach((function(t){var r=Zn(t,e);(!r||"value"in r&&void 0===r.value)&&(t===o.Transaction.prototype||s(t,o.Transaction)?L(t,e,{get:function(){return this.table(e)},set:function(t){Jn(this,e,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):t[e]=new o.Table(e,n))}))}))},ht=function(e,t){var n=e._novip;t.forEach((function(e){for(var t in e)s(e[t],n.Table)&&delete e[t]}))},pt=function(e,t){return e._cfg.version-t._cfg.version},yt=function(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var o=e[n],i=t[n];if(o){var a={name:n,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!ao)a.recreate=!0,r.change.push(a);else{var u=o.idxByName,s=i.idxByName,c=void 0;for(c in u)s[c]||a.del.push(c);for(c in s){var l=u[c],f=s[c];l?l.src!==f.src&&a.change.push(f):a.add.push(f)}(a.del.length>0||a.add.length>0||a.change.length>0)&&r.change.push(a)}}else r.add.push([n,i])}return r},vt=function(e,t,n,r){var o=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){return mt(o,e)})),o},mt=function(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})},gt=function(e,t,n){var r={};return B(t.objectStoreNames,0).forEach((function(e){for(var t=n.objectStore(e),o=t.keyPath,i=it(at(o),o||"",!1,!1,!!t.autoIncrement,o&&"string"!=typeof o,!0),a=[],u=0;u<t.indexNames.length;++u){var s=t.index(t.indexNames[u]);o=s.keyPath;var c=it(s.name,o,!!s.unique,!!s.multiEntry,!1,o&&"string"!=typeof o,!1);a.push(c)}r[e]=ut(e,i,a)})),r},bt=function(e,t,n){for(var r=e._novip,o=n.db.objectStoreNames,i=0;i<o.length;++i){var a=o[i],u=n.objectStore(a);r._hasGetAll="getAll"in u;for(var c=0;c<u.indexNames.length;++c){var l=u.indexNames[c],f=u.index(l).keyPath,d="string"==typeof f?f:"["+B(f).join("+")+"]";if(t[a]){var h=t[a].idxByName[d];h&&(h.name=l,delete t[a].idxByName[d],t[a].idxByName[l]=h)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Hn.WorkerGlobalScope&&s(Hn,Hn.WorkerGlobalScope)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)},wt=function(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Do("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")},_t=function(e){return e&&"function"==typeof e.databases},St=function(e){return Oe((function(){return zr.letThrough=!0,e()}))},Ot=function(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()},Et=function(e){var t=function(t){return e.next(t)},n=o(t),r=o((function(t){return e.throw(t)}));function o(e){return function(t){var o=e(t),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):Wn(i)?Promise.all(i).then(n,r):n(i)}}return o(t)()},xt=function(e,t,n){var r=arguments.length;if(r<2)throw new _r.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[e,H(o),n]},kt=function(e,t,n){for(var r=Wn(e)?e.slice():[e],o=0;o<n;++o)r.push(t);return r},Pt=function(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;for(var r=[],o=0,i=0;o<t.keys.length&&i<e.length;++o)0===ho(t.keys[o],e[i])&&(r.push(n?q(t.values[o]):t.values[o]),++i);return r.length===e.length?r:null}catch(e){return null}},jt=function(e){return!("from"in e)},At=function(e,t){jt(t)||function e(t,n){var r=n.from,o=n.to,i=n.l,a=n.r;jo(t,r,o),i&&e(t,i),a&&e(t,a)}(e,t)},Tt=function(e){var t=jt(e)?null:{s:0,n:e};return{next:function(e){for(var n=arguments.length>0;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&ho(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||ho(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}},Dt=function(e){var t,n,r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),o=r>1?"r":r<-1?"l":"";if(o){var i="r"===o?"l":"r",a=c({},e),u=e[o];e.from=u.from,e.to=u.to,e[o]=u[o],a[o]=u[i],e[i]=a,a.d=Ct(a)}e.d=Ct(e)},Ct=function(e){var t=e.r,n=e.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1},It=function(e,t){return qn(t).forEach((function(n){At(e[n]||(e[n]=new Po),t[n])})),e},Mt=function(e){var t=Ro;try{Ro=!0,mo.storagemutated.fire(e)}finally{Ro=t}},Rt=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},Nt=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Lt=function(){return new zo},Ft=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Bt=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},Ut=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Bt(i,r,o,a,u,"next",e)}function u(e){Bt(i,r,o,a,u,"throw",e)}a(void 0)}))}},Kt=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},zt=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Kt(e,t,n[t])}))}return e},Vt=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ft(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},Gt=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},Ht=function(){return Ho},qt=function(){return qo.apply(this,arguments)},Wt=function(){return $o.apply(this,arguments)},$t=function(e,t,n,r){return Yo.apply(this,arguments)},Yt=function(e,t,n){return Jo.apply(this,arguments)},Jt=function(e,t){return Qo.apply(this,arguments)},Qt=function(e,t){return Zo.apply(this,arguments)},Zt=function(e){return Xo.apply(this,arguments)},Xt=function(e){return ei.apply(this,arguments)},en=function(e){return ti.apply(this,arguments)},tn=function(e){var t;return!!(null===(t=Go[e])||void 0===t?void 0:t.options.onBeginEditSyncItem)},nn=function(e){return ni.apply(this,arguments)},rn=function(e){return ri.apply(this,arguments)},on=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};Go[e]={type:e,dependsOn:t,process:n,options:r}},an=function(){if(!oi&&!(oi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oi(ai)},un=function(){return li+ci()},sn=function(e){return e.startsWith(li)},cn=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},ln=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},fn=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ln(i,r,o,a,u,"next",e)}function u(e){ln(i,r,o,a,u,"throw",e)}a(void 0)}))}},dn=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},hn=function(){return Object.values(fi)},pn=function(e){fi[e.id]&&console.warn('[setupDynamicOfflineDataHandler] Another second handler with the ID "'.concat(e.id,'" was registered. This handler will override the previous one. This could be unintended as the previous handler might run different flows than the newly registered one. If this is the case, ensure that you are setting up the handlers with different IDs.')),fi[e.id]=e},yn=function(e){return di.apply(this,arguments)},vn=function(e,t){return hi.apply(this,arguments)},mn=function(e,t){return pi.apply(this,arguments)},gn=function(e,t,n){return yi.apply(this,arguments)},bn=function(e,t){return vi.apply(this,arguments)},wn=function(e,t,n){return mi.apply(this,arguments)},_n=function(e,t){return gi.apply(this,arguments)},Sn=function(e,t,n){return bi.apply(this,arguments)},On=function(){return wi.apply(this,arguments)},En=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},xn=function(){return jn(),_i},kn=function(e,t){jn(),pn({type:"patient",displayName:t.displayName,id:e,isSynced:function(){return Promise.resolve(!0)},sync:function(e,n){return t.onOfflinePatientAdded({patientUuid:e,signal:null!=n?n:(new AbortController).signal})}})},Pn=function(e){return Si.apply(this,arguments)},jn=function(){console.warn("The offline patient API has been deprecated and will be removed in a future release. To prevent future crashes, the functions remain available for the moment, but any invocations should be migrated ASAP.")};p.r(y),p.d(y,{activateOfflineCapability:function(){return I},beginEditSynchronizationItem:function(){return nn},canBeginEditSynchronizationItemsOfType:function(){return tn},deleteSynchronizationItem:function(){return rn},generateOfflineUuid:function(){return un},getCurrentOfflineMode:function(){return D},getDynamicOfflineDataEntries:function(){return yn},getDynamicOfflineDataEntriesFor:function(){return vn},getDynamicOfflineDataHandlers:function(){return hn},getFullSynchronizationItems:function(){return Xt},getFullSynchronizationItemsFor:function(){return Qt},getOfflineDb:function(){return Lt},getOfflinePatientDataStore:function(){return xn},getOfflineSynchronizationStore:function(){return Ht},getOmrsServiceWorker:function(){return w},getSynchronizationItem:function(){return en},getSynchronizationItems:function(){return Zt},getSynchronizationItemsFor:function(){return Jt},isOfflineUuid:function(){return sn},messageOmrsServiceWorker:function(){return O},offlineUuidPrefix:function(){return li},omrsOfflineCachingStrategyHttpHeaderName:function(){return Nn},omrsOfflineResponseBodyHttpHeaderName:function(){return Mn},omrsOfflineResponseStatusHttpHeaderName:function(){return Rn},putDynamicOfflineData:function(){return mn},putDynamicOfflineDataFor:function(){return gn},queueSynchronizationItem:function(){return Yt},queueSynchronizationItemFor:function(){return $t},registerOfflinePatientHandler:function(){return kn},registerOmrsServiceWorker:function(){return b},removeDynamicOfflineData:function(){return bn},removeDynamicOfflineDataFor:function(){return wn},runSynchronization:function(){return qt},setCurrentOfflineMode:function(){return C},setupDynamicOfflineDataHandler:function(){return pn},setupOfflineSync:function(){return on},syncAllDynamicOfflineData:function(){return _n},syncDynamicOfflineData:function(){return Sn},syncOfflinePatientData:function(){return Pn}});try{self["workbox:window:6.5.4"]&&_()}catch(e){}try{self["workbox:core:6.5.4"]&&_()}catch(e){}var An=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))},Tn=function(e,t){this.type=e,Object.assign(this,t)},Dn={type:"SKIP_WAITING"},Cn=function(t){var n,r;function o(e,n){var r,o;return void 0===n&&(n={}),(r=t.call(this)||this).nn={},r.tn=0,r.rn=new An,r.en=new An,r.on=new An,r.un=0,r.an=new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!i(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener("updatefound",r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener("statechange",r.ln)},r.ln=function(e){var t=r.fn,n=e.target,o=n.state,i=n===r.vn,a={sw:n,isExternal:i,originalEvent:e};!i&&r.mn&&(a.isUpdate=!0),r.dispatchEvent(new Tn(o,a)),"installed"===o?r.wn=self.setTimeout((function(){"installed"===o&&t.waiting===n&&r.dispatchEvent(new Tn("waiting",a))}),200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new Tn("controlling",{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(o=function(e){var t=e.data,n=e.ports,o=e.source;return v(r.getSW(),(function(){r.an.has(o)&&r.dispatchEvent(new Tn("message",{data:t,originalEvent:e,ports:n,sw:o}))}))},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return Promise.resolve(o.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=e,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r}r=t,(n=o).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r;var a,u=o.prototype;return u.register=function(e){var t=(void 0===e?{}:e).immediate,n=void 0!==t&&t;try{var r=this;return function(e,t){var n=e();return n&&n.then?n.then(t):t()}((function(){if(!n&&"complete"!==document.readyState)return g(new Promise((function(e){return window.addEventListener("load",e)})))}),(function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),v(r.bn(),(function(e){r.fn=e,r.yn&&(r.hn=r.yn,r.en.resolve(r.yn),r.on.resolve(r.yn),r.yn.addEventListener("statechange",r.ln,{once:!0}));var t=r.fn.waiting;return t&&i(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new Tn("waiting",{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener("updatefound",r.cn),navigator.serviceWorker.addEventListener("controllerchange",r.dn),r.fn}))}))}catch(e){return Promise.reject(e)}},u.update=function(){try{return this.fn?g(this.fn.update()):void 0}catch(e){return Promise.reject(e)}},u.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},u.messageSW=function(t){try{return v(this.getSW(),(function(n){return e(n,t)}))}catch(e){return Promise.reject(e)}},u.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&e(this.fn.waiting,Dn)},u.pn=function(){var e=navigator.serviceWorker.controller;return e&&i(e.scriptURL,this.sn.toString())?e:void 0},u.bn=function(){try{var e=this;return function(t,n){try{var r=v(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}catch(t){return n(t)}return r&&r.then?r.then(void 0,n):r}((function(){return v(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e}))}catch(e){return Promise.reject(e)}},(a=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(o.prototype,a),o}(function(){function e(){this.Pn=new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.Sn(e).add(t)},t.removeEventListener=function(e,t){this.Sn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=r(this.Sn(e.type));!(t=n()).done;)(0,t.value)(e)},t.Sn=function(e){return this.Pn.has(e)||this.Pn.set(e,new Set),this.Pn.get(e)},e}()),In=void 0,Mn="x-omrs-offline-response-body",Rn="x-omrs-offline-response-status",Nn="x-omrs-offline-caching-strategy";function Ln(){return Ln=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){S(i,r,o,a,u,"next",e)}function u(e){S(i,r,o,a,u,"throw",e)}a(void 0)}))}}((function(e){var t,n;return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(r){switch(r.label){case 0:return[4,w()];case 1:return(t=r.sent())?[4,t.messageSW(e)]:[3,3];case 2:return n=r.sent(),[3,4];case 3:n={success:!1,result:void 0,error:"No service worker has been registered. This is typically the case when the application has been built without offline-related features."},r.label=4;case 4:return[2,n]}}))})),Ln.apply(this,arguments)}function Fn(){return Fn=x((function(){var e;return k(this,(function(t){e=window.sessionStorage;try{e.setItem("someKeyHere","test"),e.removeItem("someKeyHere")}catch(t){if(t.code===DOMException.QUOTA_EXCEEDED_ERR&&0===e.length)return[2,!0]}return[2,!1]}))})),Fn.apply(this,arguments)}function Bn(){return(Bn=x((function(){return k(this,(function(e){return[2,!window.indexedDB]}))}))).apply(this,arguments)}function Un(){return Un=x((function(){return k(this,(function(e){return[2,new Promise((function(e){var t=indexedDB.open("test");t.onerror=function(){return e(!0)},t.onsuccess=function(){return e(!1)}}))]}))})),Un.apply(this,arguments)}function Kn(){return(Kn=x((function(){var e,t;return k(this,(function(n){switch(n.label){case 0:return[4,A()];case 1:return(t=n.sent())?[3,3]:[4,j()];case 2:t=n.sent(),n.label=3;case 3:return(e=t)?[3,5]:[4,P()];case 4:e=n.sent(),n.label=5;case 5:return[2,e]}}))}))).apply(this,arguments)}var zn="openmrs3:offline-mode",Vn="unavailable";function Gn(){return(Gn=x((function(){return k(this,(function(e){switch(e.label){case 0:return[4,T()];case 1:return e.sent()||(Vn="active"===localStorage.getItem(zn)?"on":"off"),navigator.onLine,[2]}}))}))).apply(this,arguments)}var Hn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,qn=Object.keys,Wn=Array.isArray;"undefined"==typeof Promise||Hn.Promise||(Hn.Promise=Promise);var $n=Object.getPrototypeOf,Yn={}.hasOwnProperty,Jn=Object.defineProperty,Qn=Object.getOwnPropertyDescriptor;function Zn(e,t){var n;return Qn(e,t)||(n=$n(e))&&Zn(n,t)}var Xn=[].slice;function er(e,t){if(R(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,o=t.length;r<o;++r){var i=er(e,t[r]);n.push(i)}return n}var a=t.indexOf(".");if(-1!==a){var u=e[t.substr(0,a)];return void 0===u?void 0:er(u,t.substr(a+1))}}function tr(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){K("string"!=typeof n&&"length"in n);for(var r=0,o=t.length;r<o;++r)tr(e,t[r],n[r])}else{var i=t.indexOf(".");if(-1!==i){var a=t.substr(0,i),u=t.substr(i+1);if(""===u)void 0===n?Wn(e)&&!isNaN(parseInt(a))?e.splice(a,1):delete e[a]:e[a]=n;else{var s=e[a];s&&R(e,a)||(s=e[a]={}),tr(s,u,n)}}else void 0===n?Wn(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}var nr=[].concat,rr="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(H([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return Hn[e]})),or=rr.map((function(e){return Hn[e]}));V(rr,(function(e){return[e,!0]}));var ir=null;function ar(e){if(!e||"object"!=typeof e)return e;var t=ir&&ir.get(e);if(t)return t;if(Wn(e)){t=[],ir&&ir.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(ar(e[n]))}else if(or.indexOf(e.constructor)>=0)t=e;else{var o=$n(e);for(var i in t=o===Object.prototype?{}:Object.create(o),ir&&ir.set(e,t),e)R(e,i)&&(t[i]=ar(e[i]))}return t}var ur={}.toString,sr="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",cr="symbol"==(void 0===sr?"undefined":h(sr))?function(e){var t;return null!=e&&(t=e[sr])&&t.apply(e)}:function(){return null},lr={},fr="undefined"!=typeof Symbol?function(e){return"AsyncFunction"===e[Symbol.toStringTag]}:function(){return!1},dr="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href),hr=function(){return!0},pr=!new Error("").stack;function yr(){if(pr)try{throw yr.arguments,new Error}catch(e){return e}return new Error}var vr=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],mr=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(vr),gr={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};F(Q).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+J(this._e,2))}},toString:function(){return this.name+": "+this.message}}),F(X).from(Q),F(ee).from(Q);var br=mr.reduce((function(e,t){return e[t]=t+"Error",e}),{}),wr=Q,_r=mr.reduce((function(e,t){var n=function(e,n){this._e=yr(),this.name=r,e?"string"==typeof e?(this.message="".concat(e).concat(n?"\n "+n:""),this.inner=n||null):"object"==typeof e&&(this.message="".concat(e.name," ").concat(e.message),this.inner=e):(this.message=gr[t]||r,this.inner=null)},r=t+"Error";return F(n).from(wr),e[t]=n,e}),{});_r.Syntax=SyntaxError,_r.Type=TypeError,_r.Range=RangeError;var Sr=vr.reduce((function(e,t){return e[t+"Error"]=_r[t],e}),{}),Or=mr.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=_r[t]),e}),{});Or.ModifyError=X,Or.DexieError=Q,Or.BulkError=ee;var Er={},xr=f("undefined"==typeof Promise?[]:function(){var e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,$n(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,$n(t),e]}(),3),kr=xr[0],Pr=xr[1],jr=xr[2],Ar=Pr&&Pr.then,Tr=kr&&kr.constructor,Dr=!!jr,Cr=!1,Ir=jr?function(){jr.then(me)}:Hn.setImmediate?setImmediate.bind(null,me):Hn.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){me(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(me,0)},Mr=function(e,t){Vr.push([e,t]),Nr&&(Ir(),Nr=!1)},Rr=!0,Nr=!0,Lr=[],Fr=[],Br=null,Ur=ne,Kr={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Re,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Re(e[0],e[1])}catch(e){}}))}},zr=Kr,Vr=[],Gr=0,Hr=[],qr={get:function(){var e=zr,t=Xr;function n(n,r){var o=this,i=!e.global&&(e!==zr||t!==Xr),a=i&&!xe(),u=new le((function(t,u){pe(o,new fe(Ie(n,e,i,a),Ie(r,e,i,a),t,u,e))}));return dr&&ve(u,this),u}return n.prototype=Er,n},set:function(e){L(this,"then",e&&e.prototype===Er?qr:{get:function(){return e},set:qr.set})}};function Wr(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&ge();t&&"function"==typeof t.then?Wr(e,(function(e,n){s(t,le)?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,he(e)),n&&be()}}),de.bind(null,e))}catch(t){de(e,t)}}function $r(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var o,i,a=e._value;null!=a?(o=a.name||"Error",i=a.message||a,r=J(a,0)):(o=a,i=""),t.push(o+(i?": "+i:"")+r)}return dr&&((r=J(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&$r(e._prev,t,n)),t}N(le.prototype,{then:qr,_then:function(e,t){pe(this,new fe(null,null,e,t,zr))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return s(e,t)?n(e):_e(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):_e(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),_e(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Cr=!0;var e=$r(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Cr=!1}}},timeout:function(e,t){var n=this;return e<1/0?new le((function(r,o){var i=setTimeout((function(){return o(new _r.Timeout(t))}),e);n.then(r,o).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&L(le.prototype,Symbol.toStringTag,"Dexie.Promise"),Kr.env=Te(),N(le,{all:function(){var e=$.apply(null,arguments).map(ke);return new le((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(o,i){return le.resolve(o).then((function(n){e[i]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(s(e,le))return e;if(e&&"function"==typeof e.then)return new le((function(t,n){e.then(t,n)}));var t=new le(Er,!0,e);return ve(t,Br),t},reject:_e,race:function(){var e=$.apply(null,arguments).map(ke);return new le((function(t,n){e.map((function(e){return le.resolve(e).then(t,n)}))}))},PSD:{get:function(){return zr},set:function(e){return zr=e}},totalEchoes:{get:function(){return Xr}},newPSD:Oe,usePSD:De,scheduler:{get:function(){return Mr},set:function(e){Mr=e}},rejectionMapper:{get:function(){return Ur},set:function(e){Ur=e}},follow:function(e,t){return new le((function(n,r){return Oe((function(t,n){var r=zr;r.unhandleds=[],r.onunhandled=n,r.finalize=oe((function(){var e=this;!function(e){Hr.push((function t(){e(),Hr.splice(Hr.indexOf(t),1)})),++Gr,Mr((function(){0==--Gr&&we()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}}),Tr&&(Tr.allSettled&&L(le,"allSettled",(function(){var e=$.apply(null,arguments).map(ke);return new le((function(t){0===e.length&&t([]);var n=e.length,r=new Array(n);e.forEach((function(e,o){return le.resolve(e).then((function(e){return r[o]={status:"fulfilled",value:e}}),(function(e){return r[o]={status:"rejected",reason:e}})).then((function(){return--n||t(r)}))}))}))})),Tr.any&&"undefined"!=typeof AggregateError&&L(le,"any",(function(){var e=$.apply(null,arguments).map(ke);return new le((function(t,n){0===e.length&&n(new AggregateError([]));var r=e.length,o=new Array(r);e.forEach((function(e,i){return le.resolve(e).then((function(e){return t(e)}),(function(e){o[i]=e,--r||n(new AggregateError(o))}))}))}))})));var Yr={awaits:0,echoes:0,id:0},Jr=0,Qr=[],Zr=0,Xr=0,eo=0;-1===(""+Ar).indexOf("[native code]")&&(Ee=xe=te);var to=le.reject;function no(e,t,n,r){if(e.idbdb&&(e._state.openComplete||zr.letThrough||e._vip)){var o=e._createTransaction(t,n,e._dbSchema);try{o.create(),e._state.PR1398_maxLoop=3}catch(o){return o.name===br.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return no(e,t,n,r)}))):to(o)}return o._promise(t,(function(e,t){return Oe((function(){return zr.trans=o,r(e,t,o)}))})).then((function(e){return o._completion.then((function(){return e}))}))}if(e._state.openComplete)return to(new _r.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return to(new _r.DatabaseClosed);e.open().catch(te)}return e._state.dbReadyPromise.then((function(){return no(e,t,n,r)}))}var ro=String.fromCharCode(65535),oo="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",io=[],ao="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),uo=ao,so=ao,co=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)},lo={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1},fo=function(){function e(){o(this,e)}return a(e,[{key:"_trans",value:function(e,t,n){var r=this._tx||zr.trans,o=this.name;function i(e,n,r){if(!r.schema[o])throw new _r.NotFound("Table "+o+" not part of transaction");return t(r.idbtrans,r)}var a=ge();try{return r&&r.db===this.db?r===zr.trans?r._promise(e,i,n):Oe((function(){return r._promise(e,i,n)}),{trans:r,transless:zr.transless||zr}):no(this.db,e,[this.name],i)}finally{a&&be()}}},{key:"get",value:function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(function(t){return n.core.get({trans:t,key:e}).then((function(e){return n.hook.reading.fire(e)}))})).then(t)}},{key:"where",value:function(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(Wn(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=qn(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return t.indexOf(e)>=0}))}))[0];if(n&&this.db._maxKey!==ro)return this.where(n.name).equals(n.keyPath.map((function(t){return e[t]})));!n&&dr&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit of a compound index [").concat(t.join("+"),"]"));var r=this.schema.idxByName,o=this.db._deps.indexedDB;function i(e,t){try{return 0===o.cmp(e,t)}catch(e){return!1}}var a=f(t.reduce((function(t,n){var o=f(t,2),a=o[0],u=o[1],s=r[n],c=e[n];return[a||s,a||!s?Ne(u,s&&s.multi?function(e){var t=er(e,n);return Wn(t)&&t.some((function(e){return i(c,e)}))}:function(e){return i(c,er(e,n))}):u]}),[null,null]),2),u=a[0],s=a[1];return u?this.where(u.name).equals(e[u.keyPath]).filter(s):n?this.filter(s):this.where(t).equals("")}},{key:"filter",value:function(e){return this.toCollection().and(e)}},{key:"count",value:function(e){return this.toCollection().count(e)}},{key:"offset",value:function(e){return this.toCollection().offset(e)}},{key:"limit",value:function(e){return this.toCollection().limit(e)}},{key:"each",value:function(e){return this.toCollection().each(e)}},{key:"toArray",value:function(e){return this.toCollection().toArray(e)}},{key:"toCollection",value:function(){return new this.db.Collection(new this.db.WhereClause(this))}},{key:"orderBy",value:function(e){return new this.db.Collection(new this.db.WhereClause(this,Wn(e)?"[".concat(e.join("+"),"]"):e))}},{key:"reverse",value:function(){return this.toCollection().reverse()}},{key:"mapToClass",value:function(e){this.schema.mappedClass=e;var t=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(R(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}},{key:"defineClass",value:function(){return this.mapToClass((function(e){M(this,e)}))}},{key:"add",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Le(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[a]})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{tr(e,i,t)}catch(e){}return t}))}},{key:"update",value:function(e,t){if("object"!=typeof e||Wn(e))return this.where(":id").equals(e).modify(t);var n=er(e,this.schema.primKey.keyPath);if(void 0===n)return to(new _r.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?qn(t).forEach((function(n){tr(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}},{key:"put",value:function(e,t){var n=this,r=this.schema.primKey,o=r.auto,i=r.keyPath,a=e;return i&&o&&(a=Le(i)(e)),this._trans("readwrite",(function(e){return n.core.mutate({trans:e,type:"put",values:[a],keys:null!=t?[t]:null})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):e.lastResult})).then((function(t){if(i)try{tr(e,i,t)}catch(e){}return t}))}},{key:"delete",value:function(e){var t=this;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:[e]})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):void 0}))}},{key:"clear",value:function(){var e=this;return this._trans("readwrite",(function(t){return e.core.mutate({trans:t,type:"deleteRange",range:lo})})).then((function(e){return e.numFailures?le.reject(e.failures[0]):void 0}))}},{key:"bulkGet",value:function(e){var t=this;return this._trans("readonly",(function(n){return t.core.getMany({keys:e,trans:n}).then((function(e){return e.map((function(e){return t.hook.reading.fire(e)}))}))}))}},{key:"bulkAdd",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new _r.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new _r.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(Le(u)):e;return r.core.mutate({trans:t,type:"add",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new ee("".concat(r.name,".bulkAdd(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkPut",value:function(e,t,n){var r=this,o=Array.isArray(t)?t:void 0,i=(n=n||(o?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(function(t){var n=r.schema.primKey,a=n.auto,u=n.keyPath;if(u&&o)throw new _r.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(o&&o.length!==e.length)throw new _r.InvalidArgument("Arguments objects and keys must have the same length");var s=e.length,c=u&&a?e.map(Le(u)):e;return r.core.mutate({trans:t,type:"put",keys:o,values:c,wantResults:i}).then((function(e){var t=e.numFailures,n=e.results,o=e.lastResult,a=e.failures;if(0===t)return i?n:o;throw new ee("".concat(r.name,".bulkPut(): ").concat(t," of ").concat(s," operations failed"),a)}))}))}},{key:"bulkDelete",value:function(e){var t=this,n=e.length;return this._trans("readwrite",(function(n){return t.core.mutate({trans:n,type:"delete",keys:e})})).then((function(e){var r=e.numFailures,o=e.lastResult,i=e.failures;if(0===r)return o;throw new ee("".concat(t.name,".bulkDelete(): ").concat(r," of ").concat(n," operations failed"),i)}))}}]),e}();function ho(e,t){try{var n=We(e),r=We(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i)if(e[i]!==t[i])return e[i]<t[i]?-1:1;return n===r?0:n<r?-1:1}($e(e),$e(t));case"Array":return function(e,t){for(var n=e.length,r=t.length,o=n<r?n:r,i=0;i<o;++i){var a=ho(e[i],t[i]);if(0!==a)return a}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}var po=function(){function e(){o(this,e)}return a(e,[{key:"_read",value:function(e,t){var n=this._ctx;return n.error?n.table._trans(null,to.bind(null,n.error)):n.table._trans("readonly",e).then(t)}},{key:"_write",value:function(e){var t=this._ctx;return t.error?t.table._trans(null,to.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}},{key:"_addAlgorithm",value:function(e){var t=this._ctx;t.algorithm=Ne(t.algorithm,e)}},{key:"_iterate",value:function(e,t){return He(this._ctx,e,t,this._ctx.table.core)}},{key:"clone",value:function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&M(n,e),t._ctx=n,t}},{key:"raw",value:function(){return this._ctx.valueMapper=null,this}},{key:"each",value:function(e){var t=this._ctx;return this._read((function(n){return He(t,e,n,t.table.core)}))}},{key:"count",value:function(e){var t=this;return this._read((function(e){var n=t._ctx,r=n.table.core;if(Ue(n,!0))return r.count({trans:e,query:{index:Ve(n,r.schema),range:n.range}}).then((function(e){return Math.min(e,n.limit)}));var o=0;return He(n,(function(){return++o,!1}),e,r).then((function(){return o}))})).then(e)}},{key:"sortBy",value:function(e,t){var n=e.split(".").reverse(),r=n[0],o=n.length-1;function i(e,t){return t?i(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function u(e,t){var n=i(e,o),r=i(t,o);return n<r?-a:n>r?a:0}return this.toArray((function(e){return e.sort(u)})).then(t)}},{key:"toArray",value:function(e){var t=this;return this._read((function(e){var n=t._ctx;if("next"===n.dir&&Ue(n,!0)&&n.limit>0){var r=n.valueMapper,o=Ve(n,n.table.core.schema);return n.table.core.query({trans:e,limit:n.limit,values:!0,query:{index:o,range:n.range}}).then((function(e){var t=e.result;return r?t.map(r):t}))}var i=[];return He(n,(function(e){return i.push(e)}),e,n.table.core).then((function(){return i}))}),e)}},{key:"offset",value:function(e){var t=this._ctx;return e<=0||(t.offset+=e,Ue(t)?ze(t,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):ze(t,(function(){var t=e;return function(){return--t<0}}))),this}},{key:"limit",value:function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),ze(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}},{key:"until",value:function(e,t){return Ke(this._ctx,(function(n,r,o){return!e(n.value)||(r(o),t)})),this}},{key:"first",value:function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}},{key:"last",value:function(e){return this.reverse().first(e)}},{key:"filter",value:function(e){var t,n;return Ke(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=Ne(t.isMatch,n),this}},{key:"and",value:function(e){return this.filter(e)}},{key:"or",value:function(e){return new this.db.WhereClause(this._ctx.table,e,this)}},{key:"reverse",value:function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}},{key:"desc",value:function(){return this.reverse()}},{key:"eachKey",value:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}},{key:"eachUniqueKey",value:function(e){return this._ctx.unique="unique",this.eachKey(e)}},{key:"eachPrimaryKey",value:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}},{key:"keys",value:function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}},{key:"primaryKeys",value:function(e){var t=this._ctx;if("next"===t.dir&&Ue(t,!0)&&t.limit>0)return this._read((function(e){var n=Ve(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((function(e){return e.result})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}},{key:"uniqueKeys",value:function(e){return this._ctx.unique="unique",this.keys(e)}},{key:"firstKey",value:function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}},{key:"lastKey",value:function(e){return this.reverse().firstKey(e)}},{key:"distinct",value:function(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return Ke(this._ctx,(function(e){var t=e.primaryKey.toString(),r=R(n,t);return n[t]=!0,!r})),this}},{key:"modify",value:function(e){var t=this,n=this._ctx;return this._write((function(r){var o;if("function"==typeof e)o=e;else{var i=qn(e),a=i.length;o=function(t){for(var n=!1,r=0;r<a;++r){var o=i[r],u=e[o];er(t,o)!==u&&(tr(t,o,u),n=!0)}return n}}var u=n.table.core,s=u.schema.primaryKey,c=s.outbound,l=s.extractKey,f=t.db._options.modifyChunkSize||200,d=[],h=0,p=[],y=function(e,t){var n=t.failures,r=t.numFailures;h+=e-r;var o=!0,i=!1,a=void 0;try{for(var u,s=qn(n)[Symbol.iterator]();!(o=(u=s.next()).done);o=!0){var c=u.value;d.push(n[c])}}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}};return t.clone().primaryKeys().then((function(t){var i=function(a){var s=Math.min(f,t.length-a);return u.getMany({trans:r,keys:t.slice(a,a+s),cache:"immutable"}).then((function(d){for(var h=[],p=[],v=c?[]:null,m=[],g=0;g<s;++g){var b=d[g],w={value:q(b),primKey:t[a+g]};!1!==o.call(w,w.value,w)&&(null==w.value?m.push(t[a+g]):c||0===ho(l(b),l(w.value))?(p.push(w.value),c&&v.push(t[a+g])):(m.push(t[a+g]),h.push(w.value)))}var _=Ue(n)&&n.limit===1/0&&("function"!=typeof e||e===yo)&&{index:n.index,range:n.range};return Promise.resolve(h.length>0&&u.mutate({trans:r,type:"add",values:h}).then((function(e){for(var t in e.failures)m.splice(parseInt(t),1);y(h.length,e)}))).then((function(){return(p.length>0||_&&"object"==typeof e)&&u.mutate({trans:r,type:"put",keys:v,values:p,criteria:_,changeSpec:"function"!=typeof e&&e}).then((function(e){return y(p.length,e)}))})).then((function(){return(m.length>0||_&&e===yo)&&u.mutate({trans:r,type:"delete",keys:m,criteria:_}).then((function(e){return y(m.length,e)}))})).then((function(){return t.length>a+s&&i(a+f)}))}))};return i(0).then((function(){if(d.length>0)throw new X("Error modifying one or more objects",d,h,p);return t.length}))}))}))}},{key:"delete",value:function(){var e=this._ctx,t=e.range;return Ue(e)&&(e.isPrimKey&&!so||3===t.type)?this._write((function(n){var r=e.table.core.schema.primaryKey,o=t;return e.table.core.count({trans:n,query:{index:r,range:o}}).then((function(t){return e.table.core.mutate({trans:n,type:"deleteRange",range:o}).then((function(e){var n=e.failures,r=(e.lastResult,e.results,e.numFailures);if(r)throw new X("Could not delete some values",Object.keys(n).map((function(e){return n[e]})),t-r);return t-r}))}))})):this.modify(yo)}}]),e}(),yo=function(e,t){return t.value=null},vo=function(){function e(){o(this,e)}return a(e,[{key:"Collection",get:function(){return this._ctx.table.db.Collection}},{key:"between",value:function(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Ze(this):new this.Collection(this,(function(){return tt(e,t,!n,!r)}))}catch(e){return Qe(this,oo)}}},{key:"equals",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return nt(e)}))}},{key:"above",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return tt(e,void 0,!0)}))}},{key:"aboveOrEqual",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return tt(e,void 0,!1)}))}},{key:"below",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return tt(void 0,e,!1,!0)}))}},{key:"belowOrEqual",value:function(e){return null==e?Qe(this,oo):new this.Collection(this,(function(){return tt(void 0,e)}))}},{key:"startsWith",value:function(e){return"string"!=typeof e?Qe(this,"String expected."):this.between(e,e+ro,!0,!0)}},{key:"startsWithIgnoreCase",value:function(e){return""===e?this.startsWith(e):et(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],ro)}},{key:"equalsIgnoreCase",value:function(e){return et(this,(function(e,t){return e===t[0]}),[e],"")}},{key:"anyOfIgnoreCase",value:function(){var e=$.apply(lr,arguments);return 0===e.length?Ze(this):et(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")}},{key:"startsWithAnyOfIgnoreCase",value:function(){var e=$.apply(lr,arguments);return 0===e.length?Ze(this):et(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,ro)}},{key:"anyOf",value:function(){var e=this,t=$.apply(lr,arguments),n=this._cmp;try{t.sort(n)}catch(e){return Qe(this,oo)}if(0===t.length)return Ze(this);var r=new this.Collection(this,(function(){return tt(t[0],t[t.length-1])}));r._ondirectionchange=function(r){n="next"===r?e._ascending:e._descending,t.sort(n)};var o=0;return r._addAlgorithm((function(e,r,i){for(var a=e.key;n(a,t[o])>0;)if(++o===t.length)return r(i),!1;return 0===n(a,t[o])||(r((function(){e.continue(t[o])})),!1)})),r}},{key:"notEqual",value:function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}},{key:"noneOf",value:function(){var e=$.apply(lr,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Qe(this,oo)}var t=e.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}},{key:"inAnyRange",value:function(e,t){var n=this,r=this._cmp,o=this._ascending,i=this._descending,a=this._min,u=this._max;if(0===e.length)return Ze(this);if(!e.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&o(e[0],e[1])<=0})))return Qe(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",_r.InvalidArgument);var s,c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,f=o;function d(e,t){return f(e[0],t[0])}try{s=e.reduce((function(e,t){for(var n=0,o=e.length;n<o;++n){var i=e[n];if(r(t[0],i[1])<0&&r(t[1],i[0])>0){i[0]=a(i[0],t[0]),i[1]=u(i[1],t[1]);break}}return n===o&&e.push(t),e}),[]),s.sort(d)}catch(e){return Qe(this,oo)}var h=0,p=l?function(e){return o(e,s[h][1])>0}:function(e){return o(e,s[h][1])>=0},y=c?function(e){return i(e,s[h][0])>0}:function(e){return i(e,s[h][0])>=0},v=p,m=new this.Collection(this,(function(){return tt(s[0][0],s[s.length-1][1],!c,!l)}));return m._ondirectionchange=function(e){"next"===e?(v=p,f=o):(v=y,f=i),s.sort(d)},m._addAlgorithm((function(e,t,r){for(var i=e.key;v(i);)if(++h===s.length)return t(r),!1;return!!function(e){return!p(e)&&!y(e)}(i)||(0===n._cmp(i,s[h][1])||0===n._cmp(i,s[h][0])||t((function(){f===o?e.continue(s[h][0]):e.continue(s[h][1])})),!1)})),m}},{key:"startsWithAnyOf",value:function(){var e=$.apply(lr,arguments);return e.every((function(e){return"string"==typeof e}))?0===e.length?Ze(this):this.inAnyRange(e.map((function(e){return[e,e+ro]}))):Qe(this,"startsWithAnyOf() only works with strings")}}]),e}(),mo=Fe(null,"storagemutated"),go=function(){function e(){o(this,e)}return a(e,[{key:"_lock",value:function(){return K(!zr.global),++this._reculock,1!==this._reculock||zr.global||(zr.lockOwnerFor=this),this}},{key:"_unlock",value:function(){if(K(!zr.global),0==--this._reculock)for(zr.global||(zr.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{De(e[1],e[0])}catch(e){}}return this}},{key:"_locked",value:function(){return this._reculock&&zr.lockOwnerFor!==this}},{key:"create",value:function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,r=this.db._state.dbOpenError;if(K(!this.idbtrans),!e&&!n)switch(r&&r.name){case"DatabaseClosedError":throw new _r.DatabaseClosed(r);case"MissingAPIError":throw new _r.MissingAPI(r.message,r);default:throw new _r.OpenFailed(r)}if(!this.active)throw new _r.TransactionInactive;return K(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):n.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=Se((function(n){ot(n),t._reject(e.error)})),e.onabort=Se((function(n){ot(n),t.active&&t._reject(new _r.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Se((function(){t.active=!1,t._resolve(),"mutatedParts"in e&&mo.storagemutated.fire(e.mutatedParts)})),this}},{key:"_promise",value:function(e,t,n){var r=this;if("readwrite"===e&&"readwrite"!==this.mode)return to(new _r.ReadOnly("Transaction is readonly"));if(!this.active)return to(new _r.TransactionInactive);if(this._locked())return new le((function(o,i){r._blockedFuncs.push([function(){r._promise(e,t,n).then(o,i)},zr])}));if(n)return Oe((function(){var e=new le((function(e,n){r._lock();var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var o=new le((function(e,n){var o=t(e,n,r);o&&o.then&&o.then(e,n)}));return o._lib=!0,o}},{key:"_root",value:function(){return this.parent?this.parent._root():this}},{key:"waitFor",value:function(e){var t=this._root(),n=le.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return n}));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var o=t._waitingFor;return new le((function(e,r){n.then((function(n){return t._waitingQueue.push(Se(e.bind(null,n)))}),(function(e){return t._waitingQueue.push(Se(r.bind(null,e)))})).finally((function(){t._waitingFor===o&&(t._waitingFor=null)}))}))}},{key:"abort",value:function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new _r.Abort))}},{key:"table",value:function(e){var t=this._memoizedTables||(this._memoizedTables={});if(R(t,e))return t[e];var n=this.schema[e];if(!n)throw new _r.NotFound("Table "+e+" not part of transaction");var r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}]),e}(),bo=function(e){try{return e.only([[]]),bo=function(){return[[]]},[[]]}catch(e){return bo=function(){return ro},ro}},wo=0,_o=function(){function e(){o(this,e)}return a(e,[{key:"_parseStoresSpec",value:function(e,t){qn(e).forEach((function(n){if(null!==e[n]){var r=e[n].split(",").map((function(e,t){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return it(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Wn(r),0===t)})),o=r.shift();if(o.multi)throw new _r.Schema("Primary key cannot be multi-valued");r.forEach((function(e){if(e.auto)throw new _r.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new _r.Schema("Index must have a name and cannot be an empty string")})),t[n]=ut(n,o,r)}}))}},{key:"stores",value:function(e){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?M(this._cfg.storesSource,e):e;var n=t._versions,r={},o={};return n.forEach((function(e){M(r,e._cfg.storesSource),o=e._cfg.dbschema={},e._parseStoresSpec(r,o)})),t._dbSchema=o,ht(t,[t._allTables,t,t.Transaction.prototype]),dt(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],qn(o),o),t._storeNames=qn(o),this}},{key:"upgrade",value:function(e){return this._cfg.contentUpgrade=ce(this._cfg.contentUpgrade||te,e),this}}]),e}();function So(e,t,n,r,o){return le.resolve().then((function(){var i=zr.transless||zr,a=e._createTransaction(t,n,e._dbSchema,r),u={trans:a,transless:i};if(r)a.idbtrans=r.idbtrans;else try{a.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===br.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((function(){return So(e,t,n,null,o)}))):to(r)}var s,c=fr(o);c&&Ee();var l=le.follow((function(){if(s=o.call(a,a))if(c){var e=xe.bind(null,null);s.then(e,e)}else"function"==typeof s.next&&"function"==typeof s.throw&&(s=Et(s))}),u);return(s&&"function"==typeof s.then?le.resolve(s).then((function(e){return a.active?e:to(new _r.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):l.then((function(){return s}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),to(e)}))}))}var Oo={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return l(c({},e),{table:function(t){var n=e.table(t),r=n.schema,o={},i=[];function a(e,t,n){var r=lt(e),u=o[r]=o[r]||[],s=null==e?0:"string"==typeof e?1:e.length,f=t>0,d=l(c({},n),{isVirtual:f,keyTail:t,keyLength:s,extractKey:st(e),unique:!f&&n.unique});return u.push(d),d.isPrimaryKey||i.push(d),s>1&&a(2===s?e[0]:e.slice(0,s-1),t+1,n),u.sort((function(e,t){return e.keyTail-t.keyTail})),d}var u=a(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[u];var s=!0,f=!1,d=void 0;try{for(var h,p=r.indexes[Symbol.iterator]();!(s=(h=p.next()).done);s=!0){var y=h.value;a(y.keyPath,0,y)}}catch(e){f=!0,d=e}finally{try{s||null==p.return||p.return()}finally{if(f)throw d}}function v(t){var n,r,o=t.query.index;return o.isVirtual?l(c({},t),{query:{index:o,range:(n=t.query.range,r=o.keyTail,{type:1===n.type?2:n.type,lower:kt(n.lower,n.lowerOpen?e.MAX_KEY:e.MIN_KEY,r),lowerOpen:!0,upper:kt(n.upper,n.upperOpen?e.MIN_KEY:e.MAX_KEY,r),upperOpen:!0})}}):t}var m=l(c({},n),{schema:l(c({},r),{primaryKey:u,indexes:i,getIndexByKeyPath:function(e){var t=o[lt(e)];return t&&t[0]}}),count:function(e){return n.count(v(e))},query:function(e){return n.query(v(e))},openCursor:function(t){var r=t.query.index,o=r.keyTail,i=r.isVirtual,a=r.keyLength;return i?n.openCursor(v(t)).then((function(n){return n&&function(n){var r=Object.create(n,{continue:{value:function(r){null!=r?n.continue(kt(r,t.reverse?e.MAX_KEY:e.MIN_KEY,o)):t.unique?n.continue(n.key.slice(0,a).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,o)):n.continue()}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(kt(t,e.MAX_KEY,o),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return 1===a?e[0]:e.slice(0,a)}},value:{get:function(){return n.value}}});return r}(n)})):n.openCursor(t)}});return m}})}};function Eo(e,t,n,r){return n=n||{},r=r||"",qn(e).forEach((function(o){if(R(t,o)){var i=e[o],a=t[o];if("object"==typeof i&&"object"==typeof a&&i&&a){var u=W(i);u!==W(a)?n[r+o]=t[o]:"Object"===u?Eo(i,a,n,r+o+"."):i!==a&&(n[r+o]=t[o])}else i!==a&&(n[r+o]=t[o])}else n[r+o]=void 0})),qn(t).forEach((function(o){R(e,o)||(n[r+o]=t[o])})),n}var xo={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return l(c({},e),{table:function(t){var n=e.table(t),r=n.schema.primaryKey,o=l(c({},n),{mutate:function(e){var o=zr.trans,i=o.table(t).hook,a=i.deleting,u=i.creating,s=i.updating;switch(e.type){case"add":if(u.fire===te)break;return o._promise("readwrite",(function(){return f(e)}),!0);case"put":if(u.fire===te&&s.fire===te)break;return o._promise("readwrite",(function(){return f(e)}),!0);case"delete":if(a.fire===te)break;return o._promise("readwrite",(function(){return f(e)}),!0);case"deleteRange":if(a.fire===te)break;return o._promise("readwrite",(function(){return function(e){return h(e.trans,e.range,1e4)}(e)}),!0)}return n.mutate(e);function f(e){var t=zr.trans,o=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!o)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?l(c({},e),{keys:o}):c({},e)).type&&(e.values=d(e.values)),e.keys&&(e.keys=d(e.keys)),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,o).then((function(i){var c=o.map((function(n,o){var c=i[o],l={onerror:null,onsuccess:null};if("delete"===e.type)a.fire.call(l,n,c,t);else if("add"===e.type||void 0===c){var f=u.fire.call(l,n,e.values[o],t);null==n&&null!=f&&(n=f,e.keys[o]=n,r.outbound||tr(e.values[o],r.keyPath,n))}else{var d=Eo(c,e.values[o]),h=s.fire.call(l,d,n,c,t);if(h){var p=e.values[o];Object.keys(h).forEach((function(e){R(p,e)?p[e]=h[e]:tr(p,e,h[e])}))}}return l}));return n.mutate(e).then((function(t){for(var n=t.failures,r=t.results,a=t.numFailures,u=t.lastResult,s=0;s<o.length;++s){var l=r?r[s]:o[s],f=c[s];null==l?f.onerror&&f.onerror(n[s]):f.onsuccess&&f.onsuccess("put"===e.type&&i[s]?e.values[s]:l)}return{failures:n,results:r,numFailures:a,lastResult:u}})).catch((function(e){return c.forEach((function(t){return t.onerror&&t.onerror(e)})),Promise.reject(e)}))}))}function h(e,t,o){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:o}).then((function(n){var r=n.result;return f({type:"delete",keys:r,trans:e}).then((function(n){return n.numFailures>0?Promise.reject(n.failures[0]):r.length<o?{failures:[],numFailures:0,lastResult:void 0}:h(e,l(c({},t),{lower:r[r.length-1],lowerOpen:!0}),o)}))}))}}});return o}})}},ko={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return l(c({},n),{getMany:function(e){if(!e.cache)return n.getMany(e);var t=Pt(e.keys,e.trans._cache,"clone"===e.cache);return t?le.resolve(t):n.getMany(e).then((function(t){return e.trans._cache={keys:e.keys,values:"clone"===e.cache?q(t):t},t}))},mutate:function(e){return"add"!==e.type&&(e.trans._cache=null),n.mutate(e)}})}}}},Po=function(e,t){if(!this){var n=new Po;return e&&"d"in e&&M(n,e),n}M(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function jo(e,t,n){var r=ho(t,n);if(!isNaN(r)){if(r>0)throw RangeError();if(jt(e))return M(e,{from:t,to:n,d:1});var o=e.l,i=e.r;if(ho(n,e.from)<0)return o?jo(o,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Dt(e);if(ho(t,e.to)>0)return i?jo(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Dt(e);ho(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),ho(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);var a=!e.r;o&&!e.l&&At(e,o),i&&a&&At(e,i)}}N(Po.prototype,u({add:function(e){return At(this,e),this},addKey:function(e){return jo(this,e,e),this},addKeys:function(e){var t=this;return e.forEach((function(e){return jo(t,e,e)})),this}},sr,(function(){return Tt(this)})));var Ao,To={stack:"dbcore",level:0,create:function(e){var t=e.schema.name,n=new Po(e.MIN_KEY,e.MAX_KEY);return l(c({},e),{table:function(r){var o=e.table(r),i=o.schema,a=i.primaryKey,u=a.extractKey,s=a.outbound,d=l(c({},o),{mutate:function(e){var a=e.trans,u=a.mutatedParts||(a.mutatedParts={}),s=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return u[n]||(u[n]=new Po)},c=s(""),l=s(":dels"),d=e.type,h=f("deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[],2),p=h[0],y=h[1],v=e.trans._cache;return o.mutate(e).then((function(e){if(Wn(p)){"delete"!==d&&(p=e.results),c.addKeys(p);var t=Pt(p,v);t||"add"===d||l.addKeys(p),(t||y)&&function(e,t,n,r){t.indexes.forEach((function(t){var o=e(t.name||"");function i(e){return null!=e?t.extractKey(e):null}var a=function(e){return t.multiEntry&&Wn(e)?e.forEach((function(e){return o.addKey(e)})):o.addKey(e)};(n||r).forEach((function(e,t){var o=n&&i(n[t]),u=r&&i(r[t]);0!==ho(o,u)&&(null!=o&&a(o),null!=u&&a(u))}))}))}(s,i,t,y)}else if(p){var r={from:p.lower,to:p.upper};l.add(r),c.add(r)}else c.add(n),l.add(n),i.indexes.forEach((function(e){return s(e.name).add(n)}));return e}))}}),h=function(t){var n,r,o=t.query,i=o.index,a=o.range;return[i,new Po(null!==(n=a.lower)&&void 0!==n?n:e.MIN_KEY,null!==(r=a.upper)&&void 0!==r?r:e.MAX_KEY)]},p={get:function(e){return[a,new Po(e.key)]},getMany:function(e){return[a,(new Po).addKeys(e.keys)]},count:h,query:h,openCursor:h};return qn(p).forEach((function(e){d[e]=function(i){var a=zr.subscr;if(a){var d=function(e){var n="idb://".concat(t,"/").concat(r,"/").concat(e);return a[n]||(a[n]=new Po)},h=d(""),y=d(":dels"),v=f(p[e](i),2),m=v[0],g=v[1];if(d(m.name||"").add(g),!m.isPrimaryKey){if("count"!==e){var b="query"===e&&s&&i.values&&o.query(l(c({},i),{values:!1}));return o[e].apply(this,arguments).then((function(t){if("query"===e){if(s&&i.values)return b.then((function(e){var n=e.result;return h.addKeys(n),t}));var n=i.values?t.result.map(u):t.result;i.values?h.addKeys(n):y.addKeys(n)}else if("openCursor"===e){var r=t,o=i.values;return r&&Object.create(r,{key:{get:function(){return y.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return y.addKey(e),e}},value:{get:function(){return o&&h.addKey(r.primaryKey),r.value}}})}return t}))}y.add(n)}}return o[e].apply(this,arguments)}})),d}})}},Do=function(){function e(t,n){var r=this;o(this,e),this._middlewares={},this.verno=0;var i=e.dependencies;this._options=n=c({addons:e.addons,autoOpen:!0,indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange};var a=n.addons;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var u,s={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:te,dbReadyPromise:null,cancelOpen:te,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};s.dbReadyPromise=new le((function(e){s.dbReadyResolve=e})),s.openCanceller=new le((function(e,t){s.cancelOpen=t})),this._state=s,this.name=t,this.on=Fe(this,"populate","blocked","versionchange","close",{ready:[ce,te]}),this.on.ready.subscribe=U(this.on.ready.subscribe,(function(t){return function(n,o){e.vip((function(){var e=r._state;if(e.openComplete)e.dbOpenError||le.resolve().then(n),o&&t(n);else if(e.onReadyBeingFired)e.onReadyBeingFired.push(n),o&&t(n);else{t(n);var i=r;o||t((function e(){i.on.ready.unsubscribe(n),i.on.ready.unsubscribe(e)}))}}))}})),this.Collection=(u=this,Be(po.prototype,(function(e,t){this.db=u;var n=lo,r=null;if(t)try{n=t()}catch(e){r=e}var o=e._ctx,i=o.table,a=i.hook.reading.fire;this._ctx={table:i,index:o.index,isPrimKey:!o.index||i.schema.primKey.keyPath&&o.index===i.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:o.or,valueMapper:a!==ne?a:null}}))),this.Table=function(e){return Be(fo.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:Fe(null,{creating:[ie,te],reading:[re,ne],updating:[ue,te],deleting:[ae,te]})}))}(this),this.Transaction=function(e){return Be(go.prototype,(function(t,n,r,o,i){var a=this;this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=Fe(this,"complete","error","abort"),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new le((function(e,t){a._resolve=e,a._reject=t})),this._completion.then((function(){a.active=!1,a.on.complete.fire()}),(function(e){var t=a.active;return a.active=!1,a.on.error.fire(e),a.parent?a.parent._reject(e):t&&a.idbtrans&&a.idbtrans.abort(),to(e)}))}))}(this),this.Version=function(e){return Be(_o.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return Be(vo.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};var o=e._deps.indexedDB;if(!o)throw new _r.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=function(e,t){return o.cmp(t,e)},this._max=function(e,t){return o.cmp(e,t)>0?e:t},this._min=function(e,t){return o.cmp(e,t)<0?e:t},this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '".concat(r.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(r.name,"'. Closing db now to resume the delete request.")),r.close()})),this.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('".concat(r.name,"') was blocked")):console.warn("Upgrade '".concat(r.name,"' blocked by other connection holding version ").concat(e.oldVersion/10))})),this._maxKey=bo(n.IDBKeyRange),this._createTransaction=function(e,t,n,o){return new r.Transaction(e,t,n,r._options.chromeTransactionDurability,o)},this._fireOnBlocked=function(e){r.on("blocked").fire(e),io.filter((function(e){return e.name===r.name&&e!==r&&!e._state.vcFired})).map((function(t){return t.on("versionchange").fire(e)}))},this.use(Oo),this.use(xo),this.use(To),this.use(ko),this.vip=Object.create(this,{_vip:{value:!0}}),a.forEach((function(e){return e(r)}))}return a(e,[{key:"version",value:function(e){if(isNaN(e)||e<.1)throw new _r.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new _r.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter((function(t){return t._cfg.version===e}))[0];return n||(n=new this.Version(e),t.push(n),t.sort(pt),n.stores({}),this._state.autoSchema=!1,n)}},{key:"_whenReady",value:function(e){var t=this;return this.idbdb&&(this._state.openComplete||zr.letThrough||this._vip)?e():new le((function(e,n){if(t._state.openComplete)return n(new _r.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return void n(new _r.DatabaseClosed);t.open().catch(te)}t._state.dbReadyPromise.then(e,n)})).then(e)}},{key:"use",value:function(e){var t=e.stack,n=e.create,r=e.level,o=e.name;o&&this.unuse({stack:t,name:o});var i=this._middlewares[t]||(this._middlewares[t]=[]);return i.push({stack:t,create:n,level:null==r?10:r,name:o}),i.sort((function(e,t){return e.level-t.level})),this}},{key:"unuse",value:function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter((function(e){return r?e.create!==r:!!n&&e.name!==n}))),this}},{key:"open",value:function(){return function(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((function(){return t.dbOpenError?to(t.dbOpenError):e}));dr&&(t.openCanceller._stackHolder=yr()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller;function o(){if(t.openCanceller!==r)throw new _r.DatabaseClosed("db.open() was cancelled")}var i=t.dbReadyResolve,a=null,u=!1;return le.race([r,("undefined"==typeof navigator?le.resolve():Ot()).then((function(){return new le((function(r,i){if(o(),!n)throw new _r.MissingAPI;var s=e.name,c=t.autoSchema?n.open(s):n.open(s,Math.round(10*e.verno));if(!c)throw new _r.MissingAPI;c.onerror=rt(i),c.onblocked=Se(e._fireOnBlocked),c.onupgradeneeded=Se((function(r){if(a=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=ot,a.abort(),c.result.close();var o=n.deleteDatabase(s);o.onsuccess=o.onerror=Se((function(){i(new _r.NoSuchDatabase("Database ".concat(s," doesnt exist")))}))}else{a.onerror=rt(i);var l=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;u=l<1,e._novip.idbdb=c.result,function(e,t,n,r){var o=e._dbSchema,i=e._createTransaction("readwrite",e._storeNames,o);i.create(n),i._completion.catch(r);var a=i._reject.bind(i),u=zr.transless||zr;Oe((function(){zr.trans=i,zr.transless=u,0===t?(qn(o).forEach((function(e){vt(n,e,o[e].primKey,o[e].indexes)})),ft(e,n),le.follow((function(){return e.on.populate.fire(i)})).catch(a)):function(e,t,n,r){var o=e._novip,i=[],a=o._versions,u=o._dbSchema=gt(0,o.idbdb,r),s=!1;return a.filter((function(e){return e._cfg.version>=t})).forEach((function(e){i.push((function(){var i=u,a=e._cfg.dbschema;bt(o,i,r),bt(o,a,r),u=o._dbSchema=a;var c=yt(i,a);c.add.forEach((function(e){vt(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((function(e){if(e.recreate)throw new _r.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){return mt(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),mt(t,e)})),e.del.forEach((function(e){return t.deleteIndex(e)}))}));var l=e._cfg.contentUpgrade;if(l&&e._cfg.version>t){ft(o,r),n._memoizedTables={},s=!0;var f=G(a);c.del.forEach((function(e){f[e]=i[e]})),ht(o,[o.Transaction.prototype]),dt(o,[o.Transaction.prototype],qn(f),f),n.schema=f;var d,h=fr(l);h&&Ee();var p=le.follow((function(){if((d=l(n))&&h){var e=xe.bind(null,null);d.then(e,e)}}));return d&&"function"==typeof d.then?le.resolve(d):p.then((function(){return d}))}})),i.push((function(t){s&&uo||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((function(n){return null==e[n]&&t.db.deleteObjectStore(n)}))}(e._cfg.dbschema,t),ht(o,[o.Transaction.prototype]),dt(o,[o.Transaction.prototype],o._storeNames,o._dbSchema),n.schema=o._dbSchema}))})),function e(){return i.length?le.resolve(i.shift()(n.idbtrans)).then(e):le.resolve()}().then((function(){var e,t;t=r,qn(e=u).forEach((function(n){t.db.objectStoreNames.contains(n)||vt(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,i,n).catch(a)}))}(e,l/10,a,i)}}),i),c.onsuccess=Se((function(){a=null;var n,o=e._novip.idbdb=c.result,i=B(o.objectStoreNames);if(i.length>0)try{var l=o.transaction(1===(n=i).length?n[0]:n,"readonly");t.autoSchema?function(e,t,n){var r=e._novip;r.verno=t.version/10;var o=r._dbSchema=gt(0,t,n);r._storeNames=B(t.objectStoreNames,0),dt(r,[r._allTables],qn(o),o)}(e,o,l):(bt(e,e._dbSchema,l),function(e,t){var n=yt(gt(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((function(e){return e.add.length||e.change.length})))}(e,l)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),ft(e,l)}catch(e){}io.push(e),o.onversionchange=Se((function(n){t.vcFired=!0,e.on("versionchange").fire(n)})),o.onclose=Se((function(t){e.on("close").fire(t)})),u&&function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!_t(n)&&"__dbnames"!==t&&wt(n,r).put({name:t}).catch(te)}(e._deps,s),r()}),i)}))}))]).then((function(){return o(),t.onReadyBeingFired=[],le.resolve(St((function(){return e.on.ready.fire(e.vip)}))).then((function n(){if(t.onReadyBeingFired.length>0){var r=t.onReadyBeingFired.reduce(ce,te);return t.onReadyBeingFired=[],le.resolve(St((function(){return r(e.vip)}))).then(n)}}))})).finally((function(){t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((function(){return e})).catch((function(n){t.dbOpenError=n;try{a&&a.abort()}catch(e){}return r===t.openCanceller&&e._close(),to(n)})).finally((function(){t.openComplete=!0,i()}))}(this)}},{key:"_close",value:function(){var e=this._state,t=io.indexOf(this);if(t>=0&&io.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new le((function(t){e.dbReadyResolve=t})),e.openCanceller=new le((function(t,n){e.cancelOpen=n}))}},{key:"close",value:function(){this._close();var e=this._state;this._options.autoOpen=!1,e.dbOpenError=new _r.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}},{key:"delete",value:function(){var e=this,t=arguments.length>0,n=this._state;return new le((function(r,o){var i=function(){e.close();var t=e._deps.indexedDB.deleteDatabase(e.name);t.onsuccess=Se((function(){!function(e,t){var n=e.indexedDB,r=e.IDBKeyRange;!_t(n)&&"__dbnames"!==t&&wt(n,r).delete(t).catch(te)}(e._deps,e.name),r()})),t.onerror=rt(o),t.onblocked=e._fireOnBlocked};if(t)throw new _r.InvalidArgument("Arguments not allowed in db.delete()");n.isBeingOpened?n.dbReadyPromise.then(i):i()}))}},{key:"backendDB",value:function(){return this.idbdb}},{key:"isOpen",value:function(){return null!==this.idbdb}},{key:"hasBeenClosed",value:function(){var e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}},{key:"hasFailed",value:function(){return null!==this._state.dbOpenError}},{key:"dynamicallyOpened",value:function(){return this._state.autoSchema}},{key:"tables",get:function(){var e=this;return qn(this._allTables).map((function(t){return e._allTables[t]}))}},{key:"transaction",value:function(){var e=xt.apply(this,arguments);return this._transaction.apply(this,e)}},{key:"_transaction",value:function(e,t,n){var r=this,o=zr.trans;o&&o.db===this&&-1===e.indexOf("!")||(o=null);var i,a,u=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{if(a=t.map((function(e){var t=s(e,r.Table)?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)i="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new _r.InvalidArgument("Invalid transaction mode: "+e);i="readwrite"}if(o){if("readonly"===o.mode&&"readwrite"===i){if(!u)throw new _r.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");o=null}o&&a.forEach((function(e){if(o&&-1===o.storeNames.indexOf(e)){if(!u)throw new _r.SubTransaction("Table "+e+" not included in parent transaction.");o=null}})),u&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,(function(t,n){n(e)})):to(e)}var c=So.bind(null,this,i,a,o,n);return o?o._promise(i,c,"lock"):zr.trans?De(zr.transless,(function(){return r._whenReady(c)})):this._whenReady(c)}},{key:"table",value:function(e){if(!R(this._allTables,e))throw new _r.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]}}]),e}(),Co="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable",Io=function(){function e(t){o(this,e),this._subscribe=t}return a(e,[{key:"subscribe",value:function(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}},{key:Co,value:function(){return this}}]),e}();try{Ao={indexedDB:Hn.indexedDB||Hn.mozIndexedDB||Hn.webkitIndexedDB||Hn.msIndexedDB,IDBKeyRange:Hn.IDBKeyRange||Hn.webkitIDBKeyRange}}catch(r){Ao={indexedDB:null,IDBKeyRange:null}}var Mo=Do;N(Mo,l(c({},Or),{delete:function(e){return new Mo(e,{addons:[]}).delete()},exists:function(e){return new Mo(e,{addons:[]}).open().then((function(e){return e.close(),!0})).catch("NoSuchDatabaseError",(function(){return!1}))},getDatabaseNames:function(e){try{return function(e){var t=e.indexedDB,n=e.IDBKeyRange;return _t(t)?Promise.resolve(t.databases()).then((function(e){return e.map((function(e){return e.name})).filter((function(e){return"__dbnames"!==e}))})):wt(t,n).toCollection().primaryKeys()}(Mo.dependencies).then(e)}catch(e){return to(new _r.MissingAPI)}},defineClass:function(){return function(e){M(this,e)}},ignoreTransaction:function(e){return zr.trans?De(zr.transless,e):e()},vip:St,async:function(e){return function(){try{var t=Et(e.apply(this,arguments));return t&&"function"==typeof t.then?t:le.resolve(t)}catch(e){return to(e)}}},spawn:function(e,t,n){try{var r=Et(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:le.resolve(r)}catch(e){return to(e)}},currentTransaction:{get:function(){return zr.trans||null}},waitFor:function(e,t){var n=le.resolve("function"==typeof e?Mo.ignoreTransaction(e):e).timeout(t||6e4);return zr.trans?zr.trans.waitFor(n):n},Promise:le,debug:{get:function(){return dr},set:function(e){Y(e,"dexie"===e?function(){return!0}:co)}},derive:F,extend:M,props:N,override:U,Events:Fe,on:mo,liveQuery:function(e){return new Io((function(t){var n=function(){return qn(a).some((function(e){return i[e]&&function(e,t){var n=Tt(t),r=n.next();if(r.done)return!1;for(var o=r.value,i=Tt(e),a=i.next(o.from),u=a.value;!r.done&&!a.done;){if(ho(u.from,o.to)<=0&&ho(u.to,o.from)>=0)return!0;ho(o.from,u.from)<0?o=(r=n.next(u.from)).value:u=(a=i.next(o.from)).value}return!1}(i[e],a[e])}))},r=fr(e),o=!1,i={},a={},u={get closed(){return o},unsubscribe:function(){o=!0,mo.storagemutated.unsubscribe(l)}};t.start&&t.start(u);var s=!1,c=!1,l=function(e){It(i,e),n()&&f()},f=function(){if(!s&&!o){i={};var d={},h=function(t){r&&Ee();var n=function(){return Oe(e,{subscr:t,trans:null})},o=zr.trans?De(zr.transless,n):n();return r&&o.then(xe,xe),o}(d);c||(mo("storagemutated",l),c=!0),s=!0,Promise.resolve(h).then((function(e){s=!1,o||(n()?f():(i={},a=d,t.next&&t.next(e)))}),(function(e){s=!1,t.error&&t.error(e),u.unsubscribe()}))}};return f(),u}))},extendObservabilitySet:It,getByKeyPath:er,setByKeyPath:tr,delByKeyPath:function(e,t){"string"==typeof t?tr(e,t,void 0):"length"in t&&[].map.call(t,(function(t){tr(e,t,void 0)}))},shallowClone:G,deepClone:q,getObjectDiff:Eo,cmp:ho,asap:z,minKey:-1/0,addons:[],connections:io,errnames:br,dependencies:Ao,semVer:"3.2.3",version:"3.2.3".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)}))})),Mo.maxKey=bo(Mo.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(mo("storagemutated",(function(e){var t;Ro||(ao?(t=document.createEvent("CustomEvent")).initCustomEvent("x-storagemutated-1",!0,!0,e):t=new CustomEvent("x-storagemutated-1",{detail:e}),Ro=!0,dispatchEvent(t),Ro=!1)})),addEventListener("x-storagemutated-1",(function(e){var t=e.detail;Ro||Mt(t)})));var Ro=!1;if("undefined"!=typeof BroadcastChannel){var No=new BroadcastChannel("x-storagemutated-1");"function"==typeof No.unref&&No.unref(),mo("storagemutated",(function(e){Ro||No.postMessage(e)})),No.onmessage=function(e){e.data&&Mt(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){mo("storagemutated",(function(e){try{Ro||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&d(self.clients.matchAll({includeUncontrolled:!0})).forEach((function(t){return t.postMessage({type:"x-storagemutated-1",changedParts:e})})))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(function(e){if("x-storagemutated-1"===e.key){var t=JSON.parse(e.newValue);t&&Mt(t.changedParts)}}));var Lo=self.document&&navigator.serviceWorker;Lo&&Lo.addEventListener("message",(function(e){var t=e.data;t&&"x-storagemutated-1"===t.type&&Mt(t.changedParts)}))}le.rejectionMapper=function(e,t){if(!e||s(e,Q)||s(e,TypeError)||s(e,SyntaxError)||!e.name||!Sr[e.name])return e;var n=new Sr[e.name](t||e.message,e);return"stack"in e&&L(n,"stack",{get:function(){return this.inner.stack}}),n},Y(dr,co);var Fo=p(766),Bo=p(685);function Uo(e){return Uo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Uo(e)}function Ko(e,t){return Ko=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Ko(e,t)}var zo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Ko(e,t)}(n,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Uo(e);if(t){var o=Uo(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":h(n))&&"function"!=typeof t?Rt(e):t;var n}(this,n)}}(n);function n(){var e;return function(e,t){if(!s(e,t))throw new TypeError("Cannot call a class as a function")}(this,n),Nt(Rt(e=t.call(this,"EsmOffline")),"syncQueue",void 0),Nt(Rt(e),"dynamicOfflineData",void 0),e.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),e.syncQueue=e.table("syncQueue"),e.dynamicOfflineData=e.table("dynamicOfflineData"),e}return n}(Do),Vo=new zo,Go={},Ho=(0,Bo.createGlobalStore)("offline-synchronization",{});function qo(){return qo=Ut((function(){var e,t,n,r,o,i,a,u,s,c,l,f,d;return Gt(this,(function(h){switch(h.label){case 0:return Ho.getState().synchronization?[2]:[4,Vo.syncQueue.count()];case 1:e=h.sent(),t={},n=Object.entries(Go),r=n.length,o={},i=new AbortController,a=function(){var e,t,n=Ho.getState().synchronization;Ho.setState({synchronization:(e=zt({},n),t={pendingCount:n.pendingCount-1},t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e)})},h.label=2;case 2:h.trys.push([2,,10,11]),Ho.setState({synchronization:{totalCount:e,pendingCount:e,abortController:i}}),u=0,h.label=3;case 3:if(!(u<r&&n.length>0))return[3,8];s=n.length,h.label=4;case 4:return s--?(c=Vt(n[s],2),l=c[0],f=c[1],(d=f.dependsOn.map((function(e){return t[e]}))).every(Boolean)?(o[l]={},[4,Promise.all(d)]):[3,6]):[3,7];case 5:h.sent(),t[l]=function(e,t,n,r){return Wo.apply(this,arguments)}(f,o,i,a),n.splice(s,1),h.label=6;case 6:return[3,4];case 7:return u++,[3,3];case 8:return[4,Promise.allSettled(Object.values(t))];case 9:return h.sent(),[3,11];case 10:return Ho.setState({synchronization:void 0}),[7];case 11:return[2]}}))})),qo.apply(this,arguments)}function Wo(){return Wo=Ut((function(e,t,n,r){var o,i,a,u,s,c,l,f,d,h,p,y,v,m,g,b,w;return Gt(this,(function(_){switch(_.label){case 0:return o=e.type,i=e.dependsOn,a=e.process,u=[],s=[],[4,Wt()];case 1:return c=_.sent(),[4,Vo.syncQueue.where({type:o,userId:c}).each((function(e,t){u.push([t.primaryKey,e.content,e.descriptor]),s.push(e.content)}))];case 2:_.sent(),l=0,_.label=3;case 3:if(!(l<u.length))return[3,11];f=Vt(u[l],3),d=f[0],h=f[1],p=f[2],y=p.id,v=p.dependencies,m=void 0===v?[]:v,_.label=4;case 4:return _.trys.push([4,7,9,10]),[4,a(h,{abort:n,index:l,items:s,userId:c,dependencies:m.map((function(e){var n=e.id,r=e.type;return i.includes(r)?t[r][n]:void 0}))})];case 5:return g=_.sent(),void 0!==y&&(t[o][y]=g),[4,Vo.syncQueue.delete(d)];case 6:return _.sent(),[3,10];case 7:return b=_.sent(),[4,Vo.syncQueue.update(d,{lastError:{name:null==b?void 0:b.name,message:null!==(w=null==b?void 0:b.message)&&void 0!==w?w:null==b?void 0:b.toString()}})];case 8:return _.sent(),[3,10];case 9:return r(),[7];case 10:return l++,[3,3];case 11:return[2]}}))})),Wo.apply(this,arguments)}function $o(){return($o=Ut((function(){var e;return Gt(this,(function(t){switch(t.label){case 0:return[4,(0,Fo.getLoggedInUser)()];case 1:return[2,(null==(e=t.sent())?void 0:e.uuid)||"*"]}}))}))).apply(this,arguments)}function Yo(){return(Yo=Ut((function(e,t,n,r){var o;return Gt(this,(function(i){switch(i.label){case 0:return void 0===(o=r&&r.id)?[3,2]:[4,Vo.syncQueue.where({type:t,userId:e}).filter((function(e){return(null==e?void 0:e.descriptor.id)===o})).delete().catch(Do.errnames.DatabaseClosed)];case 1:i.sent(),i.label=2;case 2:return[4,Vo.syncQueue.add({type:t,content:n,userId:e,descriptor:r||{},createdOn:new Date}).catch(Do.errnames.DatabaseClosed,(function(){return-1}))];case 3:return[2,i.sent()]}}))}))).apply(this,arguments)}function Jo(){return(Jo=Ut((function(e,t,n){return Gt(this,(function(r){switch(r.label){case 0:return[4,Wt()];case 1:return[4,$t(r.sent(),e,t,n)];case 2:return[2,r.sent()]}}))}))).apply(this,arguments)}function Qo(){return(Qo=Ut((function(e,t){return Gt(this,(function(n){switch(n.label){case 0:return[4,Qt(e,t)];case 1:return[2,n.sent().map((function(e){return e.content}))]}}))}))).apply(this,arguments)}function Zo(){return(Zo=Ut((function(e,t){var n;return Gt(this,(function(r){switch(r.label){case 0:return n=t?{type:t,userId:e}:{userId:e},[4,Vo.syncQueue.where(n).toArray().catch(Do.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function Xo(){return(Xo=Ut((function(e){return Gt(this,(function(t){switch(t.label){case 0:return[4,Wt()];case 1:return[4,Jt(t.sent(),e)];case 2:return[2,t.sent()]}}))}))).apply(this,arguments)}function ei(){return(ei=Ut((function(e){return Gt(this,(function(t){switch(t.label){case 0:return[4,Wt()];case 1:return[4,Qt(t.sent(),e)];case 2:return[2,t.sent()]}}))}))).apply(this,arguments)}function ti(){return(ti=Ut((function(e){return Gt(this,(function(t){switch(t.label){case 0:return[4,Vo.syncQueue.get(e).catch(Do.errnames.DatabaseClosed,(function(){}))];case 1:return[2,t.sent()]}}))}))).apply(this,arguments)}function ni(){return(ni=Ut((function(e){var t,n,r;return Gt(this,(function(o){switch(o.label){case 0:return[4,en(e)];case 1:if(!(n=o.sent()))throw new Error("No sync item with the ID ".concat(e," exists."));if(!(r=null===(t=Go[n.type])||void 0===t?void 0:t.options.onBeginEditSyncItem))throw new Error("A sync item with the ID ".concat(e,' exists, but the associated handler (if one exists) doesn\'t support editing the item. You can avoid this error by either verifying that sync items of this type can be edited via the "canEditSynchronizationItemsOfType(type: string)" function or alternatively ensure that the synchronizaton handler for sync items of type "').concat(n.type,'" supports editing items.'));return r(n),[2]}}))}))).apply(this,arguments)}function ri(){return(ri=Ut((function(e){return Gt(this,(function(t){switch(t.label){case 0:return[4,Vo.syncQueue.delete(e).catch(Do.errnames.DatabaseClosed)];case 1:return t.sent(),[2]}}))}))).apply(this,arguments)}for(var oi,ii={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},ai=new Uint8Array(16),ui=[],si=0;si<256;++si)ui.push((si+256).toString(16).slice(1));var ci=function(e,t,n){if(ii.randomUUID&&!t&&!e)return ii.randomUUID();var r=(e=e||{}).random||(e.rng||an)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){n=n||0;for(var o=0;o<16;++o)t[n+o]=r[o];return t}return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(ui[e[t+0]]+ui[e[t+1]]+ui[e[t+2]]+ui[e[t+3]]+"-"+ui[e[t+4]]+ui[e[t+5]]+"-"+ui[e[t+6]]+ui[e[t+7]]+"-"+ui[e[t+8]]+ui[e[t+9]]+"-"+ui[e[t+10]]+ui[e[t+11]]+ui[e[t+12]]+ui[e[t+13]]+ui[e[t+14]]+ui[e[t+15]]).toLowerCase()}(r)},li="OFFLINE+",fi={};function di(){return(di=fn((function(e){return dn(this,(function(t){switch(t.label){case 0:return[4,On()];case 1:return[4,vn(t.sent(),e)];case 2:return[2,t.sent()]}}))}))).apply(this,arguments)}function hi(){return(hi=fn((function(e,t){var n;return dn(this,(function(r){switch(r.label){case 0:return n=t?{type:t,users:e}:{users:e},[4,(new zo).dynamicOfflineData.where(n).toArray().catch(Do.errnames.DatabaseClosed,(function(){return[]}))];case 1:return[2,r.sent()]}}))}))).apply(this,arguments)}function pi(){return(pi=fn((function(e,t){return dn(this,(function(n){switch(n.label){case 0:return[4,On()];case 1:return[4,gn(n.sent(),e,t)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function yi(){return yi=fn((function(e,t,n){var r,o;return dn(this,(function(i){switch(i.label){case 0:return[4,(r=new zo).dynamicOfflineData.get({type:t,identifier:n}).catch(Do.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?[3,3]:[4,r.dynamicOfflineData.add({users:[e],type:t,identifier:n}).catch(Do.errnames.DatabaseClosed)];case 2:return i.sent(),[3,5];case 3:return o.users.includes(e)?[3,5]:[4,r.dynamicOfflineData.update(o.id,{users:(a=o.users,function(e){if(Array.isArray(e))return cn(e)}(a)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return cn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cn(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([e])}).catch(Do.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}var a}))})),yi.apply(this,arguments)}function vi(){return(vi=fn((function(e,t){return dn(this,(function(n){switch(n.label){case 0:return[4,On()];case 1:return[4,wn(n.sent(),e,t)];case 2:return[2,n.sent()]}}))}))).apply(this,arguments)}function mi(){return mi=fn((function(e,t,n){var r,o;return dn(this,(function(i){switch(i.label){case 0:return[4,(r=new zo).dynamicOfflineData.get({type:t,identifier:n,users:e}).catch(Do.errnames.DatabaseClosed,(function(){}))];case 1:return(o=i.sent())?o.users.length>1?[4,r.dynamicOfflineData.update(o.id,{users:o.users.filter((function(t){return t!==e}))}).catch(Do.errnames.DatabaseClosed)]:[3,3]:[3,5];case 2:return i.sent(),[3,5];case 3:return[4,r.dynamicOfflineData.delete(o.id).catch(Do.errnames.DatabaseClosed)];case 4:i.sent(),i.label=5;case 5:return[2]}}))})),mi.apply(this,arguments)}function gi(){return gi=fn((function(e,t){var n;return dn(this,(function(r){switch(r.label){case 0:return[4,yn(e)];case 1:return n=r.sent(),[4,Promise.all(n.map((o=fn((function(e){return dn(this,(function(n){return[2,Sn(e.type,e.identifier,t)]}))})),function(e){return o.apply(this,arguments)})))];case 2:return r.sent(),[2]}var o}))})),gi.apply(this,arguments)}function bi(){return bi=fn((function(e,t,n){var r,o,i,a,u,s,c,l,f;return dn(this,(function(d){switch(d.label){case 0:return[4,mn(e,t)];case 1:return d.sent(),r=new zo,[4,On()];case 2:return o=d.sent(),[4,r.dynamicOfflineData.get({type:e,identifier:t}).catch(Do.errnames.DatabaseClosed,(function(){}))];case 3:return i=d.sent(),a=hn().filter((function(t){return t.type===e})),i?[4,Promise.all(a.map((h=fn((function(e){var r,o,i;return dn(this,(function(a){try{return e.sync(t,n),[2,{id:e.id,error:void 0}]}catch(t){return i=null!==(o=null===(r=t.message)||void 0===r?void 0:r.toString())&&void 0!==o?o:t.toString(),[2,{id:e.id,error:i}]}return[2]}))})),function(e){return h.apply(this,arguments)})))]:[2];case 4:return u=d.sent(),s=u.filter((function(e){return!e.error})).map((function(e){return e.id})),c=u.filter((function(e){return e.error})).map((function(e){return e.id})),l=u.filter((function(e){return e.error})).map((function(e){return{handlerId:e.id,message:e.error}})),f={syncedOn:new Date,syncedBy:o,succeededHandlers:s,erroredHandlers:c,errors:l},i.id?[4,r.dynamicOfflineData.update(i.id,{syncState:f}).catch(Do.errnames.DatabaseClosed)]:[3,6];case 5:d.sent(),d.label=6;case 6:return[2]}var h}))})),bi.apply(this,arguments)}function wi(){return(wi=fn((function(){var e;return dn(this,(function(t){switch(t.label){case 0:return[4,(0,Fo.getLoggedInUser)()];case 1:if(!(e=t.sent().uuid))throw new Error("Using the dynamic offline data API requires a logged in user.");return[2,e]}}))}))).apply(this,arguments)}var _i=(0,Bo.createGlobalStore)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function Si(){return Si=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){En(i,r,o,a,u,"next",e)}function u(e){En(i,r,o,a,u,"throw",e)}a(void 0)}))}}((function(e){return function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}(this,(function(t){switch(t.label){case 0:return jn(),[4,Sn("patient",e)];case 1:return t.sent(),[2]}}))})),Si.apply(this,arguments)}}(),y}())}}}))},3419:(e,t,n)=>{function r(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function o(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}e=n.nmd(e),System.register(["react","@openmrs/esm-navigation","@openmrs/esm-extensions","@openmrs/esm-globals","@openmrs/esm-utils","@openmrs/esm-feature-flags","@openmrs/esm-api","react-dom","react-i18next","swr","@openmrs/esm-context","@openmrs/esm-config","dayjs"],(function(i,a){var u={},s={},c={},l={},f={},d={},h={},p={},y={},v={},m={},g={},b={};return Object.defineProperty(p,"__esModule",{value:!0}),{setters:[function(e){u.Suspense=e.Suspense,u.default=e.default,u.useCallback=e.useCallback,u.useContext=e.useContext,u.useEffect=e.useEffect,u.useMemo=e.useMemo,u.useReducer=e.useReducer,u.useRef=e.useRef,u.useState=e.useState},function(e){s.interpolateUrl=e.interpolateUrl,s.navigate=e.navigate},function(e){c.getConnectedExtensions=e.getConnectedExtensions,c.getExtensionInternalStore=e.getExtensionInternalStore,c.getExtensionStore=e.getExtensionStore,c.registerExtensionSlot=e.registerExtensionSlot,c.renderExtension=e.renderExtension},function(e){l.subscribeConnectivityChanged=e.subscribeConnectivityChanged},function(e){f.isOnline=e.isOnline,f.shallowEqual=e.shallowEqual},function(e){d.featureFlagsStore=e.featureFlagsStore},function(e){h.attachmentUrl=e.attachmentUrl,h.defaultVisitCustomRepresentation=e.defaultVisitCustomRepresentation,h.fetchCurrentPatient=e.fetchCurrentPatient,h.getCurrentUser=e.getCurrentUser,h.getLocations=e.getLocations,h.getSessionStore=e.getSessionStore,h.getVisitStore=e.getVisitStore,h.getVisitTypes=e.getVisitTypes,h.openmrsFetch=e.openmrsFetch,h.restBaseUrl=e.restBaseUrl,h.userHasAccess=e.userHasAccess},function(e){Object.keys(e).forEach((function(t){p[t]=e[t]}))},function(e){y.I18nextProvider=e.I18nextProvider},function(e){v.SWRConfig=e.SWRConfig,v.default=e.default},function(e){m.registerContext=e.registerContext,m.subscribeToContext=e.subscribeToContext,m.unregisterContext=e.unregisterContext,m.updateContext=e.updateContext},function(e){g.getConfigStore=e.getConfigStore,g.getExtensionConfigFromStore=e.getExtensionConfigFromStore,g.getExtensionsConfigStore=e.getExtensionsConfigStore},function(e){b.default=e.default}],execute:function(){i(function(){var i={332:function(e){e.exports=function(){"use strict";return function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}}()},645:function(e,t,n){"use strict";var r=n(493);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},385:function(){System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e,t){var n=s[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;var r=u()((function(){return t}));return s[e]={value:r,active:!0},r},t=function(e,t){var n=s[e];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=t,n.active=!0,n.value):(s[e]={value:t,active:!0},t)},n=function(e,t){var n=s[e];if(!n){var r=u()((function(){return null!=t?t:{}}));return s[e]={value:r,active:!1},r}return n.value},r=function(e,t,n){var r=t(e.getState());return e.subscribe((function(e){var o=t(e);o!==r&&(r=o,n(o))}))},o={d:function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return e},getGlobalStore:function(){return n},registerGlobalStore:function(){return t},subscribeTo:function(){return r}});var a=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,subscribe:function(e){return n.add(e),function(){return n.delete(e)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,i),i},u=function(e){return e?a(e):a},s={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=s)}),1e3),i}())}}}))},766:function(e){"use strict";e.exports=h},824:function(e){"use strict";e.exports=g},743:function(e){"use strict";e.exports=m},45:function(e){"use strict";e.exports=c},708:function(e){"use strict";e.exports=d},728:function(e){"use strict";e.exports=l},513:function(e){"use strict";e.exports=s},618:function(e){"use strict";e.exports=f},688:function(e){"use strict";e.exports=b},954:function(e){"use strict";e.exports=u},493:function(e){"use strict";e.exports=p},281:function(e){"use strict";e.exports=y},725:function(e){"use strict";e.exports=v}},a={};function w(e){var t=a[e];if(void 0!==t)return t.exports;var n=a[e]={exports:{}};return i[e].call(n.exports,n,n.exports,w),n.exports}w.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return w.d(t,{a:t}),t},w.d=function(e,t){for(var n in t)w.o(t,n)&&!w.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},w.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},w.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var _={};return function(){"use strict";var i=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},a=function(e){var t=e.to,n=e.templateParams,r=e.onBeforeNavigate,o=e.children,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["to","templateParams","onBeforeNavigate","children"]);return(0,Ge.useEffect)((function(){a.href&&console.warn("ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '".concat(a.href,"'")),a.onClick&&console.warn("ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ".concat(t))}),[]),Ge.default.createElement("a",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){i(e,t,n[t])}))}return e}({onClick:function(e){return function(e,t,n,r){0!==e.button||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),null==r||r(e),(0,qe.navigate)({to:t,templateParams:n})),0===e.button&&(e.ctrlKey||e.metaKey)&&(null==r||r(e)),0===e.button&&e.shiftKey&&(null==r||r(e)),1===e.button&&(null==r||r(e))}(e,t,n,r)},href:(0,qe.interpolateUrl)(t,n)},a),o)},u=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},s=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},c=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){s(e,t,n[t])}))}return e},l=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},f=function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,Ge.useState)((0,Je.isOnline)()))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return l(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],r=t[1];return(0,Ge.useEffect)((function(){return(0,Ye.subscribeConnectivityChanged)((function(e){var t=e.online;return r(t)}))}),[]),n},d=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},h=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},p=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){h(e,t,n[t])}))}return e},y=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},v=function(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},m=function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}},g=function(e,t){var n=function(n){r[n]=function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];e.setState((function(e){var r,i=[e].concat(v(o));return(r=t)[n].apply(r,v(i))}))}};"function"==typeof t&&(t=t(e));var r={};for(var o in t)n(o);return r},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ze,n=arguments.length>2?arguments[2]:void 0,r=y((0,Ge.useState)((function(){return t(e.getState())})),2),o=r[0],i=r[1];return(0,Ge.useEffect)((function(){return(0,Qe.subscribeTo)(e,t,i)}),[e,t]),p({},o,(0,Ge.useMemo)((function(){return n?g(e,n):{}}),[e,n]))},S=function(e,t){return b(e,Ze,t)},O=function(e){return function(t){var n=y((0,Ge.useState)(e.getState()),2),r=n[0],o=n[1];return(0,Ge.useEffect)((function(){return e.subscribe((function(e){return o(e)}))}),[]),p({},r,(0,Ge.useMemo)((function(){return t?g(e,t):{}}),[t]))}},E=function(e){var t=Xe().slots;return(0,Ge.useMemo)((function(){var n,r;return null!==(r=null===(n=t[e])||void 0===n?void 0:n.assignedExtensions)&&void 0!==r?r:[]}),[t,e])},x=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},k=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?x(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},P=function(e){var t=f(),n=E(e),r=b(et.featureFlagsStore),o=(0,Ge.useMemo)((function(){return Object.entries(r.flags).filter((function(e){return k(e,2)[1].enabled})).map((function(e){return k(e,1)[0]}))}),[r.flags]);return(0,Ge.useMemo)((function(){return(0,We.getConnectedExtensions)(n,t,o)}),[n,t,o])},j=function(e){var t=(0,Ge.useContext)(He).moduleName;if(!t)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,Ge.useEffect)((function(){(0,We.registerExtensionSlot)(t,e)}),[]),{extensions:P(e),extensionSlotName:e,extensionSlotModuleName:t}},A=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},T=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){A(e,t,n[t])}))}return e},D=function(e){return e},C=function(e){var t=e.name,n=e.extensionSlotName,r=e.select,o=void 0===r?D:r,i=e.children,a=e.state,u=e.style,s=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["name","extensionSlotName","select","children","state","style"]);if(i&&a)throw new Error("Both children and state have been provided. If children are provided, the state must be passed as a prop to the `Extension` component.");var c,l,f,d,h=null!=t?t:n,p=(0,Ge.useRef)(null),y=j(h),v=y.extensions,m=y.extensionSlotModuleName,g=(0,Ge.useMemo)((function(){return o(v)}),[o,v]),b=(0,Ge.useMemo)((function(){if("function"==typeof i&&!Ge.default.isValidElement(i))return g.map((function(e){return i(e)}))}),[i,g]);return Ge.default.createElement("div",T({ref:p,"data-extension-slot-name":h,"data-extension-slot-module-name":m,style:(f=T({},u),d={position:"relative"},d=null!=d?d:{},Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(d)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(d)).forEach((function(e){Object.defineProperty(f,e,Object.getOwnPropertyDescriptor(d,e))})),f)},s),h&&g.map((function(e,t){return Ge.default.createElement(He.Provider,{key:e.id,value:{moduleName:m,featureName:"",extension:{extensionId:e.id,extensionSlotName:h,extensionSlotModuleName:m}}},null!==(l=null!==(c=null==b?void 0:b[t])&&void 0!==c?c:"function"!=typeof i?i:null)&&void 0!==l?l:Ge.default.createElement($e,{state:a}))})))},I=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},M=function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n},R=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){N(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e},N=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},L=function(e,t){var n;if("function"!=typeof(n=t.domElement?function(){return t.domElement}:t.domElementGetter?t.domElementGetter:e.domElementGetter?e.domElementGetter:function(e){var t=e.appName||e.name;if(!t)throw Error("single-spa's dom-element-getter-helpers was not given an application name as a prop, so it can't make a unique dom element container for the react application");var n="single-spa-application:".concat(t);return function(){var e=document.getElementById(n);return e||((e=document.createElement("div")).id=n,document.body.appendChild(e)),e}}(t)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(t.name,"'. Expected a function, received ").concat(it(n)));return function(){var e=n(t);if(!r(e,HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(t.name,"'. Expected HTMLElement, received ").concat(it(e)));return e}},F=function(e,t){return e.rootComponent?Promise.resolve():e.loadRootComponent(t).then((function(t){e.rootComponent=t}))},B=function(e,t){return new Promise((function(n,r){e.suppressComponentDidCatchWarning||!function(e){if(!(e&&"string"==typeof e.version&&e.version.indexOf(".")>=0))return!1;var t=e.version.slice(0,e.version.indexOf("."));try{return Number(t)>=16}catch(e){return!1}}(e.React)||e.errorBoundary||e.errorBoundaryClass||(e.rootComponent.prototype?e.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(t.name||t.appName||t.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=G(e,t,(function(){n(this)})),i=L(e,t)(),a=function(e){var t=e.renderType,n=e.elementToRender,r=e.domElement,o=e.reactDom[t];if("function"!=typeof o)throw new Error('renderType "'.concat(t,'" did not return a function.'));switch(t){case"createRoot":case"unstable_createRoot":case"createBlockingRoot":case"unstable_createBlockingRoot":var i=o(r);return i.render(n),i;case"hydrateRoot":return o(r,n);default:return o(n,r),null}}({elementToRender:o,domElement:i,reactDom:z(e),renderType:V(e)});e.domElements[t.name]=i,e.renderResults[t.name]=a}))},U=function(e,t){return new Promise((function(n){e.unmountResolves[t.name]=n;var r=e.renderResults[t.name];r&&r.unmount?r.unmount():z(e).unmountComponentAtNode(e.domElements[t.name]),delete e.domElements[t.name],delete e.renderResults[t.name]}))},K=function(e,t){return new Promise((function(n){e.updateResolves[t.name]||(e.updateResolves[t.name]=[]),e.updateResolves[t.name].push(n);var r=G(e,t,null),o=e.renderResults[t.name];if(o&&o.render)o.render(r);else{var i=L(e,t)();z(e).render(r,i)}}))},z=function(e){return e.ReactDOMClient||e.ReactDOM},V=function(e){return"function"==typeof e.renderType?e.renderType():e.renderType},G=function(e,t,n){var r=e.React.createElement(e.rootComponent,t),o=at?e.React.createElement(at.Provider,{value:t},r):r;return(e.errorBoundary||t.errorBoundary||e.errorBoundaryClass||t.errorBoundaryClass)&&(e.errorBoundaryClass=e.errorBoundaryClass||t.errorBoundaryClass||function(e,t){function n(t){e.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(t.name,")")}return n.prototype=Object.create(e.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(e.errorBoundary||t.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(e,t){this.setState({caughtError:e,caughtErrorInfo:t})},n}(e,t),o=e.React.createElement(e.errorBoundaryClass,t,o)),e.React.createElement(e.SingleSpaRoot,R(R({},t),{},{mountFinished:n,updateFinished:function(){e.updateResolves[t.name]&&(e.updateResolves[t.name].forEach((function(e){return e()})),delete e.updateResolves[t.name])},unmountFinished:function(){e.unmountResolves[t.name]&&(e.unmountResolves[t.name](),delete e.unmountResolves[t.name])}}),o)},H=function(e){if("object"!=typeof e||"string"!=typeof e.featureName||"string"!=typeof e.moduleName)throw new Error("Invalid options");var t=Object.assign({},dt,e);return function(e){var n,i,a,u;return i=n=function(n){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ft(e,t)}(u,n);var i,a=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=lt(e);if(t){var i=lt(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(e,t){return!t||"object"!=((n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":void 0===n?"undefined":o(n))&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t;var n}(this,n)}}(u);function u(e){var n;return function(e,t){if(!r(e,t))throw new TypeError("Cannot call a class as a function")}(this,u),(n=a.call(this,e)).state={caughtError:null,caughtErrorInfo:null,config:{moduleName:t.moduleName,featureName:t.featureName,extension:e._extensionContext}},n}return(i=[{key:"componentDidCatch",value:function(e,n){n&&n.componentStack&&(e.extra=Object.assign(e.extra||{},{componentStack:n.componentStack})),t.throwErrorsToConsole&&setTimeout((function(){throw e})),this.setState({caughtError:e,caughtErrorInfo:n})}},{key:"render",value:function(){if(this.state.caughtError)return Ge.default.createElement("div",null,"An error has occurred. Please try reloading the page.");var n=Ge.default.createElement(Ge.Suspense,{fallback:null},Ge.default.createElement(ct.SWRConfig,{value:ht},Ge.default.createElement(He.Provider,{value:this.state.config},t.disableTranslations?Ge.default.createElement(e,this.props):Ge.default.createElement(st.I18nextProvider,{i18n:window.i18next,defaultNS:t.moduleName},Ge.default.createElement(e,this.props)))));return t.strictMode||!Ge.default.StrictMode?n:Ge.default.createElement(Ge.default.StrictMode,null,n)}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(u.prototype,i),u}(Ge.default.Component),a="displayName",u="OpenmrsReactComponent(".concat(t.featureName,")"),a in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,n}},q=function(e,t){return function(e){if("object"!==ot(e))throw new Error("single-spa-react requires a configuration object");var t,n=R(R({},ut),e);if(!n.React)throw new Error("single-spa-react must be passed opts.React");if(!n.ReactDOM&&!n.ReactDOMClient)throw new Error("single-spa-react must be passed opts.ReactDOM or opts.ReactDOMClient");if(n.renderType||(null!==(t=n.ReactDOMClient)&&void 0!==t&&t.createRoot?n.renderType="createRoot":n.renderType="render"),!n.rootComponent&&!n.loadRootComponent)throw new Error("single-spa-react must be passed opts.rootComponent or opts.loadRootComponent");if(n.errorBoundary&&"function"!=typeof n.errorBoundary)throw Error("The errorBoundary opt for single-spa-react must either be omitted or be a function that returns React elements");!at&&n.React.createContext&&(at=n.React.createContext()),n.SingleSpaRoot=function(e){function t(e){t.displayName="SingleSpaRoot(".concat(e.name,")")}return t.prototype=Object.create(e.React.Component.prototype),t.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},t.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},t.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},t}(n);var r={bootstrap:F.bind(null,n),mount:B.bind(null,n),unmount:U.bind(null,n)};return n.parcelCanUpdate&&(r.update=K.bind(null,n)),r}({React:Ge.default,ReactDOMClient:rt,rootComponent:H(t)(e)})},W=function(e,t){return function(){return e().then((function(e){return q(e.default,t)}))}},$=function(e,t){return function(){return Promise.resolve(q(e,t))}},Y=function(e,t){var n=(0,Ge.useRef)(null!=t?t:{}),r=(0,Ge.useRef)((function(t){return(0,yt.updateContext)(e,t)}));return(0,Ge.useEffect)((function(){return(0,yt.registerContext)(e,null!=t?t:{}),function(){(0,yt.unregisterContext)(e)}}),[e]),(0,Ge.useEffect)((function(){var r=null!=t?t:{};(0,Je.shallowEqual)(n.current,r)||((0,yt.updateContext)(e,(function(){return r})),n.current=r)}),[t]),r.current},J=function(e){return Y(e.namespace,e.value),null},Q=function(){var e=(0,Ge.useRef)();return e.current&&!e.current.signal.aborted||(e.current=new AbortController),(0,Ge.useEffect)((function(){var t=e.current;return function(){return null==t?void 0:t.abort()}}),[]),e.current},Z=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},X=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e){return null!=e?e:{}},r=function(e){if(Array.isArray(e))return e}(t=(0,Ge.useState)())||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(e,t){if(e){if("string"==typeof e)return Z(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Z(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1];return(0,Ge.useEffect)((function(){if(null==e||""===e.replace(" ",""))throw new Error('The namespace supplied to useAppContext must be a non-empty string, but was "'.concat(e,'".'))}),[e]),(0,Ge.useEffect)((function(){return(0,yt.subscribeToContext)(e,(function(e){if(void 0!==e){var t=n?n(e):null!=e?e:{};(0,Je.shallowEqual)(o,t)||i(t)}}))}),[]),o},ee=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},te=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},ne=function(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}},re=function(e){var t=this.__data__=new _t(e);this.size=t.size},oe=function(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Zt;++t<n;)this.add(e[t])},ie=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},ae=function(e){var t,n=function(e){if(Array.isArray(e))return e}(t=(0,Ge.useState)([]))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(e,t){if(e){if("string"==typeof e)return ie(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,Ge.useEffect)((function(){return(0,We.getExtensionStore)().subscribe((function(t){var n,i,a=null!==(i=null===(n=t.slots[e])||void 0===n?void 0:n.assignedExtensions.map((function(e){return e.id})))&&void 0!==i?i:[];lr(a,r)||o(a)}))}),[]),r},ue=function(e,t){var n,r=(0,ct.default)("".concat(tt.attachmentUrl,"?patient=").concat(e,"&includeEncounterless=").concat(t),tt.openmrsFetch),o=r.data,i=r.error,a=r.mutate,u=r.isLoading,s=r.isValidating;return(0,Ge.useMemo)((function(){return{isLoading:u,data:null!==(n=null==o?void 0:o.data.results)&&void 0!==n?n:[],error:i,mutate:a,isValidating:s}}),[o,i,u,s,a])},se=function(e){(0,Ge.useEffect)((function(){if(e){var t=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",function(){document.body.style.overflow=t}}}),[e])},ce=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},le=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},fe=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){le(e,t,n[t])}))}return e},de=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()},he=function(e){var t,n=(0,Ge.useContext)(He),r=n.moduleName,o=n.extension,i=null!==(t=null==e?void 0:e.externalModuleName)&&void 0!==t?t:r;if(!i&&!o)throw Error(hr);var a=function(e){var t=(0,Ge.useMemo)((function(){return(0,fr.getConfigStore)(e)}),[e]),n=e,r=function(e){var t=de((0,Ge.useState)(function(e){return function(){var t=e.getState();return t.loaded&&t.config?t.config:null}}(e)),2),n=t[0],r=t[1];return(0,Ge.useEffect)((function(){return null==e?void 0:e.subscribe((function(e){e.loaded&&e.config&&r(e.config)}))}),[e]),n}(t);if(!r)throw dr[n]||(dr[n]=function(e){return new Promise((function(t){var n=e.subscribe((function(e){e.loaded&&e.config&&(t(e.config),n())}))}))}(t)),dr[n];return r}(i),u=function(e){var t=(0,Ge.useMemo)(fr.getExtensionsConfigStore,[]),n=function(e,t){var n=de((0,Ge.useState)(function(e,t){return t?function(){var n=e.getState(),r=(0,fr.getExtensionConfigFromStore)(n,t.extensionSlotName,t.extensionId);if(r.loaded&&r.config)return r.config}:null}(e,t)),2),r=n[0],o=n[1];return(0,Ge.useEffect)((function(){if(t)return e.subscribe((function(e){var n=(0,fr.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);n.loaded&&n.config&&!lr(n.config,r)&&o(n.config)}))}),[e,t,r]),r}(t,e);if(!n&&e){var r="".concat(e.extensionSlotName,"-").concat(e.extensionId);throw!dr[r]&&t&&(dr[r]=function(e,t){return new Promise((function(n){var r=e.subscribe((function(e){var o=(0,fr.getExtensionConfigFromStore)(e,t.extensionSlotName,t.extensionId);o.loaded&&o.config&&(n(o.config),r())}))}))}(t,e)),dr[r]}return n||{}}(o);return(0,Ge.useMemo)((function(){return(null==e?void 0:e.externalModuleName)&&i===e.externalModuleName?fe({},a):fe({},a,u)}),[i,null==e?void 0:e.externalModuleName,a,u])},pe=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},ye=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,r=function(e){if(Array.isArray(e))return e}(t=(0,Ge.useState)(e))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(e,t){if(e){if("string"==typeof e)return pe(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pe(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1];return(0,Ge.useEffect)((function(){var t=setTimeout((function(){i(e)}),n);return function(){clearTimeout(t)}}),[e,n]),o},ve=function(e){var t=P(e);return(0,Ge.useMemo)((function(){return Object.fromEntries(t.map((function(e){return[e.name,e.meta]})))}),[t])},me=function(e){var t,n=b(et.featureFlagsStore).flags;return(0,Ge.useEffect)((function(){n[e]||console.error('useFeatureFlag: Attempted to get value of non-existent flag "'.concat(e,'". Did you forget to call registerFeatureFlag?'))}),[n[e]]),null===(t=n[e])||void 0===t?void 0:t.enabled},ge=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},be=function(){var e,t=(e=(0,Ge.useState)(0),function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return ge(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ge(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1];return(0,Ge.useCallback)((function(){t((function(e){return e+1}))}),[])},we=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},_e=function(){var e="tablet";return document.body.classList.forEach((function(t){switch(t){case"omrs-breakpoint-lt-tablet":e="phone";break;case"omrs-breakpoint-gt-small-desktop":e="large-desktop";break;case"omrs-breakpoint-gt-tablet":e="small-desktop"}})),e},Se=function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,Ge.useState)(_e))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return we(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?we(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],r=t[1];return(0,Ge.useEffect)((function(){var e=function(){r(_e())};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]),n},Oe=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ee=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=function(e){if(Array.isArray(e))return e}(e=(0,Ge.useState)([]))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return Oe(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oe(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,Ge.useEffect)((function(){var e=(0,tt.getLocations)(t).subscribe((function(e){o(e)}),(function(e){console.error(e)}));return function(){return e.unsubscribe()}}),[]),r},xe=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=(0,Ge.useRef)(null);return(0,Ge.useEffect)((function(){var r=function(r){t&&n.current&&!n.current.contains(r.target)&&e(r)};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),function(){window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}}),[e,t]),n},ke=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Pe=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=r.abortController,i=r.fetchInit,a=r.url,u=r.swrConfig,s=vt(),c=(0,Ge.useMemo)((function(){return null!==(n=null!==(t=null==i?void 0:i.signal)&&void 0!==t?t:null==o?void 0:o.signal)&&void 0!==n?n:s.signal}),[null==o?void 0:o.signal,null==i?void 0:i.signal,s.signal]),l=(0,Ge.useCallback)((function(e){var t,n,r=function(e,t){if(t)return"function"==typeof t?t(e):t;if("string"==typeof e)return e;throw new Error("When using useOpenmrsSWR with a key that is not a string, you must provide a url() function that converts the key to a valid url. The key for this hook is ".concat(e,"."))}(e,a);return(0,tt.openmrsFetch)(r,(t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ke(e,t,n[t])}))}return e}({},i),n=null!=(n={signal:c})?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})),t))}),[c,i,a]);return(0,ct.default)(e,l,u)},je=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ae=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},Te=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){Ae(e,t,n[t])}))}return e},De=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e},Ce=function(){var e=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return e&&e[1]},Ie=function(e,t){switch(t.type){case rr.loadPatient:return De(Te({},e),{patientUuid:t.patientUuid,patient:null,isPendingUuid:!1,isLoadingPatient:!0,err:null});case rr.newPatient:return De(Te({},e),{patient:t.patient,isPendingUuid:!1,isLoadingPatient:!1,err:null});case rr.loadError:return De(Te({},e),{patient:null,isPendingUuid:!1,isLoadingPatient:!1,err:t.err});default:return e}},Me=function(e){var t,n=function(e){if(Array.isArray(e))return e}(t=(0,Ge.useReducer)(Ie,De(Te({},mr),{patientUuid:null!=e?e:null,isPendingUuid:!e,isLoadingPatient:!!e})))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(e,t){if(e){if("string"==typeof e)return je(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1];return(0,Ge.useEffect)((function(){if(r.isPendingUuid){var e=Ce();o(e?{type:rr.loadPatient,patientUuid:e}:{type:rr.newPatient,patient:null})}var t=!0;return r.isLoadingPatient&&r.patientUuid&&(0,tt.fetchCurrentPatient)(r.patientUuid).then((function(e){return t&&o({patient:e,type:rr.newPatient})}),(function(e){return t&&o({err:e,type:rr.loadError})})),function(){t=!1}}),[r.isPendingUuid,r.isLoadingPatient,r.patientUuid]),(0,Ge.useEffect)((function(){var e=function(e){var t=Ce();t!=r.patientUuid&&o({type:rr.loadPatient,patientUuid:t})};return window.addEventListener("single-spa:routing-event",e),function(){return window.removeEventListener("single-spa:routing-event",e)}}),[r.patientUuid]),{isLoading:r.isPendingUuid||r.isLoadingPatient,patient:r.patient,patientUuid:null!=e?e:r.patientUuid,error:r.err}},Re=function(e){var t=j(e),n=t.extensions,r=t.extensionSlotModuleName;return e?n.map((function(t){return function(n){var o=n.state;return Ge.default.createElement(He.Provider,{value:{moduleName:r,featureName:"",extension:{extensionId:t.id,extensionSlotName:e,extensionSlotModuleName:r}}},Ge.default.createElement($e,{state:o}))}})):[]},Ne=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Le=function(){var e,t=(0,Ge.useRef)(),n=function(e){if(Array.isArray(e))return e}(e=(0,Ge.useState)(null))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return Ne(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ne(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1],i=null;if(!r){if(vr){var a=(0,tt.getSessionStore)().getState();a.loaded&&(i=a.session)}else vr=new Promise((function(e){var n=function(n){var r=n.loaded,o=n.session;r&&(e(o),i=o,t.current&&t.current(),t.current=void 0)};n((0,tt.getSessionStore)().getState()),i||(t.current=(0,tt.getSessionStore)().subscribe(n))}));if(!i)throw vr;o(i)}(0,Ge.useEffect)((function(){return t.current||(t.current=(0,tt.getSessionStore)().subscribe((function(e){var t=e.loaded,n=e.session;t&&(i=n,o(n))}))),function(){t.current&&t.current(),t.current=void 0}}),[]);var u=r||i;if(!u)throw vr?(console.warn("useSession is in an unexpected state. Attempting to recover."),vr):Error("useSession is in an invalid state.");return u},Fe=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tt.defaultVisitCustomRepresentation,r=b((0,tt.getVisitStore)()),o=r.patientUuid,i=r.manuallySetVisitUuid,a=e&&o==e?i:null,u="?patient=".concat(e,"&v=").concat(n,"&includeInactive=false"),s="/".concat(a,"?v=").concat(n),c=(0,ct.default)(e?"".concat(tt.restBaseUrl,"/visit").concat(u):null,tt.openmrsFetch),l=c.data,f=c.error,d=c.mutate,h=c.isValidating,p=(0,ct.default)(e&&a?"".concat(tt.restBaseUrl,"/visit").concat(s):null,tt.openmrsFetch),y=p.data,v=p.error,m=p.mutate,g=p.isValidating,w=(0,Ge.useMemo)((function(){return null!==(t=null==l?void 0:l.data.results.find((function(e){return null===e.stopDatetime})))&&void 0!==t?t:null}),[l]),_=(0,Ge.useMemo)((function(){return a?null==y?void 0:y.data:null!=w?w:null}),[y,w,a]);return{error:f||v,mutate:function(){d(),m()},isValidating:h||g,activeVisit:w,currentVisit:_,currentVisitIsRetrospective:Boolean(a),isLoading:Boolean((!l||a&&!y)&&(!f||!v))}},Be=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ue=function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,Ge.useState)([]))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return Be(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Be(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],r=t[1];return(0,Ge.useEffect)((function(){var e=(0,tt.getVisitTypes)().subscribe((function(e){r(e)}),(function(e){return console.error(e)}));return function(){return e.unsubscribe()}}),[]),n},Ke=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},ze=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_r,r=function(e){if(Array.isArray(e))return e}(e=(0,Ge.useState)(1))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e)||function(e,t){if(e){if("string"==typeof e)return Ke(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ke(e,2):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1],a=(0,Ge.useMemo)((function(){return"number"==typeof n&&n>0?Math.max(1,Math.ceil(t.length/n)):1}),[t.length,n]),u=(0,Ge.useMemo)((function(){var e=(o-1)*n,r=(o+0)*n;return t.slice(e,r)}),[t,o,n]),s=(0,Ge.useCallback)((function(e){i(Math.max(1,Math.min(a,e)))}),[i,a]),c=(0,Ge.useCallback)((function(){o<a&&i(o+1)}),[o,a,i]),l=(0,Ge.useCallback)((function(){o>1&&i(o-1)}),[o,i]);return(0,Ge.useMemo)((function(){return{results:u,totalPages:a,currentPage:o,paginated:t.length>n,showNextButton:o<a,showPreviousButton:o>1,goTo:s,goToNext:c,goToPrevious:l}}),[u,a,t.length,n,o,s,c,l])},Ve=function(){var e="".concat(tt.restBaseUrl,"/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType"),t=(0,ct.default)(e,tt.openmrsFetch),n=t.data,r=t.error,o=t.isLoading;return(0,Ge.useMemo)((function(){var e,t;return{primaryIdentifierCode:null===(e=null==n||null===(t=n.data)||void 0===t?void 0:t.results[0])||void 0===e?void 0:e.metadataUuid,isLoading:o,error:r}}),[n,r,o])};w.r(_),w.d(_,{ComponentContext:function(){return He},ConfigurableLink:function(){return a},Extension:function(){return $e},ExtensionSlot:function(){return C},OpenmrsAppContext:function(){return J},UserHasAccess:function(){return nt},createUseStore:function(){return O},getAsyncExtensionLifecycle:function(){return pt},getAsyncLifecycle:function(){return W},getLifecycle:function(){return q},getSyncLifecycle:function(){return $},isDesktop:function(){return yr},openmrsComponentDecorator:function(){return H},useAbortController:function(){return Q},useAppContext:function(){return X},useAssignedExtensionIds:function(){return ae},useAssignedExtensions:function(){return E},useAttachments:function(){return ue},useBodyScrollLock:function(){return se},useConfig:function(){return he},useConnectedExtensions:function(){return P},useConnectivity:function(){return f},useDebounce:function(){return ye},useDefineAppContext:function(){return Y},useExtensionInternalStore:function(){return pr},useExtensionSlot:function(){return j},useExtensionSlotMeta:function(){return ve},useExtensionStore:function(){return Xe},useFeatureFlag:function(){return me},useForceUpdate:function(){return be},useLayoutType:function(){return Se},useLocations:function(){return Ee},useOnClickOutside:function(){return xe},useOpenmrsSWR:function(){return Pe},usePagination:function(){return ze},usePatient:function(){return Me},usePrimaryIdentifierCode:function(){return Ve},useRenderableExtensions:function(){return Re},useSession:function(){return Le},useStore:function(){return b},useStoreWithActions:function(){return S},useVisit:function(){return Fe},useVisitTypes:function(){return Ue}});var Ge=w(954),He=Ge.default.createContext({moduleName:"",featureName:""}),qe=w(513),We=w(45),$e=function(e){var t,n=e.state,o=e.children,i=e.wrap,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,["state","children","wrap"]),s=function(e){if(Array.isArray(e))return e}(t=(0,Ge.useState)())||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(e,t){if(e){if("string"==typeof e)return u(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=s[0],f=s[1],d=(0,Ge.useContext)(He).extension,h=(0,Ge.useRef)(null),p=(0,Ge.useRef)(Promise.resolve()),y=(0,Ge.useRef)(!1);(0,Ge.useEffect)((function(){i&&console.warn("'wrap' prop of Extension is being used ".concat((null==d?void 0:d.extensionId)?"by ".concat(d.extensionId," in ").concat(d.extensionSlotName):"",". This will be removed in a future release."))}),[]);var v=(0,Ge.useCallback)((function(e){f(e)}),[f]);(0,Ge.useEffect)((function(){if(null!=l&&(null==d?void 0:d.extensionSlotName)&&d.extensionSlotModuleName&&d.extensionSlotModuleName&&!h.current&&!y.current)return y.current=!0,(0,We.renderExtension)(l,d.extensionSlotName,d.extensionSlotModuleName,d.extensionId,void 0,n).then((function(e){h.current=e,y.current=!1})),function(){if(h&&h.current)switch(h.current.getStatus()){case"MOUNTING":h.current.mountPromise.then((function(){var e;"MOUNTED"===(null===(e=h.current)||void 0===e?void 0:e.getStatus())&&h.current.unmount()}));break;case"MOUNTED":h.current.unmount();break;case"UPDATING":p.current&&p.current.then((function(){var e;"MOUNTED"===(null===(e=h.current)||void 0===e?void 0:e.getStatus())&&h.current.unmount()}))}}}),[null==d?void 0:d.extensionSlotName,null==d?void 0:d.extensionId,null==d?void 0:d.extensionSlotModuleName,l]),(0,Ge.useEffect)((function(){h.current&&h.current.update&&"UNMOUNTING"!==h.current.getStatus()&&Promise.all([h.current.mountPromise,p.current]).then((function(){var e;"MOUNTED"===(null==h||null===(e=h.current)||void 0===e?void 0:e.getStatus())&&h.current.update&&(p.current=h.current.update(c({},n)).catch((function(e){var t,n,o;if(n=e,!(null!=(o=Error)&&"undefined"!=typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](n):r(n,o))||!e.message.includes("minified message #32")||"MOUNTED"===(null===(t=h.current)||void 0===t?void 0:t.getStatus()))throw e})))}))}),[n]);var m=Ge.default.createElement("div",c({ref:v,"data-extension-id":null==d?void 0:d.extensionId,style:{position:"relative"}},a));return"function"!=typeof o||Ge.default.isValidElement(o)?d&&i?i(m,d):m:Ge.default.createElement(Ge.default.Fragment,null,o(m,d))},Ye=w(728),Je=w(618),Qe=w(385),Ze=function(e){return e},Xe=O((0,We.getExtensionStore)()),et=w(708),tt=w(766),nt=function(e){var t,n=e.privilege,r=e.fallback,o=e.children,i=function(e){if(Array.isArray(e))return e}(t=(0,Ge.useState)(null))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(e,t){if(e){if("string"==typeof e)return I(e,2);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?I(e,2):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],u=i[1];return(0,Ge.useEffect)((function(){var e=(0,tt.getCurrentUser)({includeAuthStatus:!1}).subscribe(u);return function(){return e.unsubscribe()}}),[]),a&&(0,tt.userHasAccess)(n,a)?Ge.default.createElement(Ge.default.Fragment,null,o):r?Ge.default.createElement(Ge.default.Fragment,null,r):null},rt=w(645);function ot(e){return(ot="function"==typeof Symbol&&"symbol"==o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)})(e)}function it(e){return(it="function"==typeof Symbol&&"symbol"==o(Symbol.iterator)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":o(e)})(e)}var at=null;try{at=n(1672).createContext()}catch(M){}var ut={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}},st=w(281),ct=w(725);function lt(e){return lt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},lt(e)}function ft(e,t){return ft=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ft(e,t)}var dt={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},ht={errorRetryCount:3,fetcher:tt.openmrsFetch,focusThrottleInterval:3e4},pt=W,yt=w(743),vt=Q,mt=function(e,t){return e===t||e!=e&&t!=t},gt=function(e,t){for(var n=e.length;n--;)if(mt(e[n][0],t))return n;return-1},bt=Array.prototype.splice;ee.prototype.clear=function(){this.__data__=[],this.size=0},ee.prototype.delete=function(e){var t=this.__data__,n=gt(t,e);return!(n<0||(n==t.length-1?t.pop():bt.call(t,n,1),--this.size,0))},ee.prototype.get=function(e){var t=this.__data__,n=gt(t,e);return n<0?void 0:t[n][1]},ee.prototype.has=function(e){return gt(this.__data__,e)>-1},ee.prototype.set=function(e,t){var n=this.__data__,r=gt(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var wt,_t=ee,St="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,Ot="object"==typeof self&&self&&self.Object===Object&&self,Et=St||Ot||Function("return this")(),xt=Et.Symbol,kt=Object.prototype,Pt=kt.hasOwnProperty,jt=kt.toString,At=xt?xt.toStringTag:void 0,Tt=Object.prototype.toString,Dt=xt?xt.toStringTag:void 0,Ct=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Dt&&Dt in Object(e)?function(e){var t=Pt.call(e,At),n=e[At];try{e[At]=void 0;var r=!0}catch(e){}var o=jt.call(e);return r&&(t?e[At]=n:delete e[At]),o}(e):function(e){return Tt.call(e)}(e)},It=function(e){var t=void 0===e?"undefined":o(e);return null!=e&&("object"==t||"function"==t)},Mt=function(e){if(!It(e))return!1;var t=Ct(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Rt=Et["__core-js_shared__"],Nt=(wt=/[^.]+$/.exec(Rt&&Rt.keys&&Rt.keys.IE_PROTO||""))?"Symbol(src)_1."+wt:"",Lt=Function.prototype.toString,Ft=function(e){if(null!=e){try{return Lt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},Bt=/^\[object .+?Constructor\]$/,Ut=Function.prototype,Kt=Object.prototype,zt=Ut.toString,Vt=Kt.hasOwnProperty,Gt=RegExp("^"+zt.call(Vt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ht=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!It(e)||(t=e,Nt&&Nt in t))&&(Mt(e)?Gt:Bt).test(Ft(e));var t}(n)?n:void 0},qt=Ht(Et,"Map"),Wt=Ht(Object,"create"),$t=Object.prototype.hasOwnProperty,Yt=Object.prototype.hasOwnProperty;te.prototype.clear=function(){this.__data__=Wt?Wt(null):{},this.size=0},te.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},te.prototype.get=function(e){var t=this.__data__;if(Wt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return $t.call(t,e)?t[e]:void 0},te.prototype.has=function(e){var t=this.__data__;return Wt?void 0!==t[e]:Yt.call(t,e)},te.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Wt&&void 0===t?"__lodash_hash_undefined__":t,this};var Jt=te,Qt=function(e,t){var n,r,i=e.__data__;return("string"==(r=o(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};ne.prototype.clear=function(){this.size=0,this.__data__={hash:new Jt,map:new(qt||_t),string:new Jt}},ne.prototype.delete=function(e){var t=Qt(this,e).delete(e);return this.size-=t?1:0,t},ne.prototype.get=function(e){return Qt(this,e).get(e)},ne.prototype.has=function(e){return Qt(this,e).has(e)},ne.prototype.set=function(e,t){var n=Qt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var Zt=ne;re.prototype.clear=function(){this.__data__=new _t,this.size=0},re.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},re.prototype.get=function(e){return this.__data__.get(e)},re.prototype.has=function(e){return this.__data__.has(e)},re.prototype.set=function(e,t){var n=this.__data__;if(r(n,_t)){var o=n.__data__;if(!qt||o.length<199)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new Zt(o)}return n.set(e,t),this.size=n.size,this};var Xt=re;oe.prototype.add=oe.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},oe.prototype.has=function(e){return this.__data__.has(e)};var en=oe,tn=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},nn=function(e,t,n,r,o,i){var a=1&n,u=e.length,s=t.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(e),l=i.get(t);if(c&&l)return c==t&&l==e;var f=-1,d=!0,h=2&n?new en:void 0;for(i.set(e,t),i.set(t,e);++f<u;){var p=e[f],y=t[f];if(r)var v=a?r(y,p,f,t,e,i):r(p,y,f,e,t,i);if(void 0!==v){if(v)continue;d=!1;break}if(h){if(!tn(t,(function(e,t){if(a=t,!h.has(a)&&(p===e||o(p,e,n,r,i)))return h.push(t);var a}))){d=!1;break}}else if(p!==y&&!o(p,y,n,r,i)){d=!1;break}}return i.delete(e),i.delete(t),d},rn=Et.Uint8Array,on=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},an=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},un=xt?xt.prototype:void 0,sn=un?un.valueOf:void 0,cn=Array.isArray,ln=Object.prototype.propertyIsEnumerable,fn=Object.getOwnPropertySymbols,dn=fn?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a)&&(i[o++]=a)}return i}(fn(e),(function(t){return ln.call(e,t)})))}:function(){return[]},hn=function(e){return null!=e&&"object"==typeof e},pn=function(e){return hn(e)&&"[object Arguments]"==Ct(e)},yn=Object.prototype,vn=yn.hasOwnProperty,mn=yn.propertyIsEnumerable,gn=pn(function(){return arguments}())?pn:function(e){return hn(e)&&vn.call(e,"callee")&&!mn.call(e,"callee")},bn=gn,wn=t&&!t.nodeType&&t,_n=wn&&e&&!e.nodeType&&e,Sn=_n&&_n.exports===wn?Et.Buffer:void 0,On=(Sn?Sn.isBuffer:void 0)||function(){return!1},En=/^(?:0|[1-9]\d*)$/,xn=function(e,t){var n=void 0===e?"undefined":o(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&En.test(e))&&e>-1&&e%1==0&&e<t},kn=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},Pn={};Pn["[object Float32Array]"]=Pn["[object Float64Array]"]=Pn["[object Int8Array]"]=Pn["[object Int16Array]"]=Pn["[object Int32Array]"]=Pn["[object Uint8Array]"]=Pn["[object Uint8ClampedArray]"]=Pn["[object Uint16Array]"]=Pn["[object Uint32Array]"]=!0,Pn["[object Arguments]"]=Pn["[object Array]"]=Pn["[object ArrayBuffer]"]=Pn["[object Boolean]"]=Pn["[object DataView]"]=Pn["[object Date]"]=Pn["[object Error]"]=Pn["[object Function]"]=Pn["[object Map]"]=Pn["[object Number]"]=Pn["[object Object]"]=Pn["[object RegExp]"]=Pn["[object Set]"]=Pn["[object String]"]=Pn["[object WeakMap]"]=!1;var jn,An=t&&!t.nodeType&&t,Tn=An&&e&&!e.nodeType&&e,Dn=Tn&&Tn.exports===An&&St.process,Cn=function(){try{return Tn&&Tn.require&&Tn.require("util").types||Dn&&Dn.binding&&Dn.binding("util")}catch(e){}}(),In=Cn&&Cn.isTypedArray,Mn=In?(jn=In,function(e){return jn(e)}):function(e){return hn(e)&&kn(e.length)&&!!Pn[Ct(e)]},Rn=Object.prototype.hasOwnProperty,Nn=Object.prototype,Ln=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Fn=Object.prototype.hasOwnProperty,Bn=function(e){return null!=(t=e)&&kn(t.length)&&!Mt(t)?function(e,t){var n=cn(e),r=!n&&bn(e),o=!n&&!r&&On(e),i=!n&&!r&&!o&&Mn(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=u.length;for(var c in e)!Rn.call(e,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||xn(c,s))||u.push(c);return u}(e):function(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||Nn))return Ln(e);var t,n,r=[];for(var o in Object(e))Fn.call(e,o)&&"constructor"!=o&&r.push(o);return r}(e);var t},Un=function(e){return function(e,t,n){var r=t(e);return cn(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Bn,dn)},Kn=Object.prototype.hasOwnProperty,zn=Ht(Et,"DataView"),Vn=Ht(Et,"Promise"),Gn=Ht(Et,"Set"),Hn=Ht(Et,"WeakMap"),qn="[object Map]",Wn="[object Promise]",$n="[object Set]",Yn="[object WeakMap]",Jn="[object DataView]",Qn=Ft(zn),Zn=Ft(qt),Xn=Ft(Vn),er=Ft(Gn),tr=Ft(Hn),nr=Ct;(zn&&nr(new zn(new ArrayBuffer(1)))!=Jn||qt&&nr(new qt)!=qn||Vn&&nr(Vn.resolve())!=Wn||Gn&&nr(new Gn)!=$n||Hn&&nr(new Hn)!=Yn)&&(nr=function(e){var t=Ct(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ft(n):"";if(r)switch(r){case Qn:return Jn;case Zn:return qn;case Xn:return Wn;case er:return $n;case tr:return Yn}return t});var rr,or=nr,ir="[object Arguments]",ar="[object Array]",ur="[object Object]",sr=Object.prototype.hasOwnProperty,cr=function e(t,n,o,i,a){return t===n||(null==t||null==n||!hn(t)&&!hn(n)?t!=t&&n!=n:function(e,t,n,o,i,a){var u=cn(e),s=cn(t),c=u?ar:or(e),l=s?ar:or(t),f=(c=c==ir?ur:c)==ur,d=(l=l==ir?ur:l)==ur,h=c==l;if(h&&On(e)){if(!On(t))return!1;u=!0,f=!1}if(h&&!f)return a||(a=new Xt),u||Mn(e)?nn(e,t,n,o,i,a):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new rn(e),new rn(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return mt(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=on;case"[object Set]":var s=1&r;if(u||(u=an),e.size!=t.size&&!s)return!1;var c=a.get(e);if(c)return c==t;r|=2,a.set(e,t);var l=nn(u(e),u(t),r,o,i,a);return a.delete(e),l;case"[object Symbol]":if(sn)return sn.call(e)==sn.call(t)}return!1}(e,t,c,n,o,i,a);if(!(1&n)){var p=f&&sr.call(e,"__wrapped__"),y=d&&sr.call(t,"__wrapped__");if(p||y){var v=p?e.value():e,m=y?t.value():t;return a||(a=new Xt),i(v,m,n,o,a)}}return!!h&&(a||(a=new Xt),function(e,t,n,o,i,a){var u=1&n,s=Un(e),c=s.length;if(c!=Un(t).length&&!u)return!1;for(var l=c;l--;){var f=s[l];if(!(u?f in t:Kn.call(t,f)))return!1}var d=a.get(e),h=a.get(t);if(d&&h)return d==t&&h==e;var p=!0;a.set(e,t),a.set(t,e);for(var y=u;++l<c;){var v=e[f=s[l]],m=t[f];if(o)var g=u?o(m,v,f,t,e,a):o(v,m,f,e,t,a);if(!(void 0===g?v===m||i(v,m,n,o,a):g)){p=!1;break}y||(y="constructor"==f)}if(p&&!y){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&r(b,b)&&"function"==typeof w&&r(w,w)||(p=!1)}return a.delete(e),a.delete(t),p}(e,t,n,o,i,a))}(t,n,o,i,e,a))},lr=function(e,t){return cr(e,t)},fr=w(824),dr={},hr='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".',pr=O((0,We.getExtensionInternalStore)()),yr=function(e){return"small-desktop"===e||"large-desktop"===e};!function(e){e.loadPatient="loadPatient",e.newPatient="newPatient",e.loadError="patientLoadError"}(rr||(rr={}));var vr,mr={patientUuid:null,patient:null,isPendingUuid:!0,isLoadingPatient:!1,err:null},gr=w(688),br=w(332),wr=w.n(br);gr.default.extend(wr());var _r=10}(),_}())}}}))},3691:(e,t,n)=>{"use strict";n.d(t,{Uo:()=>lt,QZ:()=>at,ZF:()=>f,tW:()=>pt,Hs:()=>yt,F:()=>r,VG:()=>it,n:()=>ft,O$:()=>dt,VN:()=>tt});var r="openmrs-routes:",o=n(7910),i={bootstrap:function(){return Promise.resolve()},mount:function(){return Promise.resolve()},unmount:function(){return Promise.resolve()}};function a(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)}function u(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function u(e){a(i,r,o,u,s,"next",e)}function s(e){a(i,r,o,u,s,"throw",e)}u(void 0)}))}}function s(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var c=new Map;function l(e,t){return u((function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,(0,o.importDynamic)(e)];case 1:return(n=r.sent())&&Object.hasOwn(n,t)&&"function"==typeof n[t]?[2,f(e,n).then((function(){return n[t]()}))]:(n&&Object.hasOwn(n,t)?console.warn("The export ".concat(t," of the app ").concat(e," is not a function")):console.warn("The app ".concat(e," does not define a component called ").concat(t,", this cannot be loaded")),[2,i])}}))}))}function f(e,t){return d.apply(this,arguments)}function d(){return(d=u((function(e,t){var n,r;return s(this,(function(i){switch(i.label){case 0:return e in c?[3,5]:null==t?[3,1]:(r=t,[3,3]);case 1:return[4,(0,o.importDynamic)(e)];case 2:r=i.sent(),i.label=3;case 3:return n=r,[4,c[e]=new Promise((function(e,t){if(Object.hasOwn(n,"startupApp")){var r=n.startupApp;if("function"==typeof r)return Promise.resolve(r()).then(e).catch(t)}e(null)}))];case 4:return i.sent(),[3,7];case 5:return[4,c[e]];case 6:i.sent(),i.label=7;case 7:return[2]}}))}))).apply(this,arguments)}var h=Object.freeze({__proto__:null,get start(){return Ye},get ensureJQuerySupport(){return Oe},get setBootstrapMaxTime(){return re},get setMountMaxTime(){return oe},get setUnmountMaxTime(){return ie},get setUnloadMaxTime(){return ae},get registerApplication(){return Re},get unregisterApplication(){return Le},get getMountedApps(){return De},get getAppStatus(){return Ie},get unloadApplication(){return Fe},get checkActivityFunctions(){return Ne},get getAppNames(){return Ce},get pathToActiveWhen(){return Ke},get navigateToUrl(){return he},get patchHistoryApi(){return we},get triggerAppChange(){return He},get addErrorHandler(){return g},get removeErrorHandler(){return b},get mountRootParcel(){return Z},get NOT_LOADED(){return S},get LOADING_SOURCE_CODE(){return O},get NOT_BOOTSTRAPPED(){return E},get BOOTSTRAPPING(){return x},get NOT_MOUNTED(){return k},get MOUNTING(){return P},get UPDATING(){return A},get LOAD_ERROR(){return C},get MOUNTED(){return j},get UNLOADING(){return D},get UNMOUNTING(){return T},get SKIP_BECAUSE_BROKEN(){return I}}),p=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,y=function(){try{var e=new p("cat",{detail:{foo:"bar"}});return"cat"===e.type&&"bar"===e.detail.foo}catch(e){}return!1}()?p:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(e,t){var n=document.createEvent("CustomEvent");return t?n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail):n.initCustomEvent(e,!1,!1,void 0),n}:function(e,t){var n=document.createEventObject();return n.type=e,t?(n.bubbles=Boolean(t.bubbles),n.cancelable=Boolean(t.cancelable),n.detail=t.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n};let v=[];function m(e,t,n){const r=_(e,t,n);v.length?v.forEach((e=>e(r))):setTimeout((()=>{throw r}))}function g(e){if("function"!=typeof e)throw Error(w(28,!1));v.push(e)}function b(e){if("function"!=typeof e)throw Error(w(29,!1));let t=!1;return v=v.filter((n=>{const r=n===e;return t=t||r,!r})),t}function w(e,t,...n){return`single-spa minified message #${e}: ${t?t+" ":""}See https://single-spa.js.org/error/?code=${e}${n.length?`&arg=${n.join("&arg=")}`:""}`}function _(e,t,n){const r=`${F(t)} '${N(t)}' died in status ${t.status}: `;let o;if(e instanceof Error){try{e.message=r+e.message}catch(e){}o=e}else{console.warn(w(30,!1,t.status,N(t)));try{o=Error(r+JSON.stringify(e))}catch(t){o=e}}return o.appOrParcelName=N(t),t.status=n,o}const S="NOT_LOADED",O="LOADING_SOURCE_CODE",E="NOT_BOOTSTRAPPED",x="BOOTSTRAPPING",k="NOT_MOUNTED",P="MOUNTING",j="MOUNTED",A="UPDATING",T="UNMOUNTING",D="UNLOADING",C="LOAD_ERROR",I="SKIP_BECAUSE_BROKEN";function M(e){return e.status===j}function R(e){try{return e.activeWhen(window.location)}catch(t){return m(t,e,I),!1}}function N(e){return e.name}function L(e){return Boolean(e.unmountThisParcel)}function F(e){return L(e)?"parcel":"application"}function B(){for(let e=arguments.length-1;e>0;e--)for(let t in arguments[e])"__proto__"!==t&&(arguments[e-1][t]=arguments[e][t]);return arguments[0]}function U(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n];return null}function K(e){return e&&("function"==typeof e||(t=e,Array.isArray(t)&&!U(t,(e=>"function"!=typeof e))));var t}function z(e,t){let n=e[t]||[];n=Array.isArray(n)?n:[n],0===n.length&&(n=[()=>Promise.resolve()]);const r=F(e),o=N(e);return function(e){return n.reduce(((n,i,a)=>n.then((()=>{const n=i(e);return V(n)?n:Promise.reject(w(15,!1,r,o,t,a))}))),Promise.resolve())}}function V(e){return e&&"function"==typeof e.then&&"function"==typeof e.catch}let G=[];function H(e,t){return Promise.resolve().then((()=>e.status!==E?e:(e.status=x,e.bootstrap?ue(e,"bootstrap").then(n).catch((n=>{if(t)throw _(n,e,I);return m(n,e,I),e})):Promise.resolve().then(n))));function n(){return e.status=k,e}}function q(e,t){return Promise.resolve().then((()=>{if(e.status!==j)return e;e.status=T;const n=Object.keys(e.parcels).map((t=>e.parcels[t].unmountThisParcel()));return Promise.all(n).then(r,(n=>r().then((()=>{const r=Error(n.message);if(t)throw _(r,e,I);m(r,e,I)})))).then((()=>e));function r(){return ue(e,"unmount").then((()=>{e.status=k}),(n=>{if(t)throw _(n,e,I);m(n,e,I)}))}}))}let W=!1,$=!1;function Y(e,t){return Promise.resolve().then((()=>e.status!==k?e:(W||(window.dispatchEvent(new y("single-spa:before-first-mount")),W=!0),e.status=P,ue(e,"mount").then((()=>(e.status=j,$||(window.dispatchEvent(new y("single-spa:first-mount")),$=!0),e))).catch((n=>{return e.status=j,q(e,!0).then(r,r);function r(){if(t)throw _(n,e,I);return m(n,e,I),e}})))))}let J=0;const Q={parcels:{}};function Z(){return X.apply(Q,arguments)}function X(e,t){const n=this;if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error(w(2,!1));if(e.name&&"string"!=typeof e.name)throw Error(w(3,!1,typeof e.name));const r=J++;let o=e.name||`parcel-${r}`;if("object"!=typeof t)throw Error(w(4,!1,o,typeof t));if(!t.domElement)throw Error(w(5,!1,o));const i="function"==typeof e,a=i?e:()=>Promise.resolve(e),u={id:r,parcels:{},status:i?O:E,customProps:t,parentName:N(n),unmountThisParcel:()=>f.then((()=>{if(u.status!==j)throw Error(w(6,!1,o,u.status));return q(u,!0)})).then((e=>(u.parentName&&delete n.parcels[u.id],e))).then((e=>(d(e),e))).catch((e=>{throw u.status=I,h(e),e}))};let s;n.parcels[r]=u;let c=a();if(!c||"function"!=typeof c.then)throw Error(w(7,!1));c=c.then((e=>{if(!e)throw Error(w(8,!1));if(o=e.name||`parcel-${r}`,Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!K(e.bootstrap))throw Error(w(9,!1,o));if(!K(e.mount))throw Error(w(10,!1,o));if(!K(e.unmount))throw Error(w(11,!1,o));if(e.update&&!K(e.update))throw Error(w(12,!1,o));const t=z(e,"bootstrap"),n=z(e,"mount"),i=z(e,"unmount");u.status=E,u.name=o,u.bootstrap=t,u.mount=n,u.unmount=i,u.timeouts=se(e.timeouts),e.update&&(u.update=z(e,"update"),s.update=function(e){return u.customProps=e,ee((t=u,Promise.resolve().then((()=>{if(t.status!==j)throw Error(w(32,!1,N(t)));return t.status=A,ue(t,"update").then((()=>(t.status=j,t))).catch((e=>{throw _(e,t,I)}))}))));var t})}));const l=c.then((()=>H(u,!0))),f=l.then((()=>Y(u,!0)));let d,h;const p=new Promise(((e,t)=>{d=e,h=t}));return s={mount:()=>ee(Promise.resolve().then((()=>{if(u.status!==k)throw Error(w(13,!1,o,u.status));return n.parcels[r]=u,Y(u)}))),unmount:()=>ee(u.unmountThisParcel()),getStatus:()=>u.status,loadPromise:ee(c),bootstrapPromise:ee(l),mountPromise:ee(f),unmountPromise:ee(p)},s}function ee(e){return e.then((()=>null))}function te(e){const t=N(e);let n="function"==typeof e.customProps?e.customProps(t,window.location):e.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(w(40,!1),t,n));const r=B({},n,{name:t,mountParcel:X.bind(e),singleSpa:h});return L(e)&&(r.unmountSelf=e.unmountThisParcel),r}const ne={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function re(e,t,n){if("number"!=typeof e||e<=0)throw Error(w(16,!1));ne.bootstrap={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function oe(e,t,n){if("number"!=typeof e||e<=0)throw Error(w(17,!1));ne.mount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function ie(e,t,n){if("number"!=typeof e||e<=0)throw Error(w(18,!1));ne.unmount={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function ae(e,t,n){if("number"!=typeof e||e<=0)throw Error(w(19,!1));ne.unload={millis:e,dieOnTimeout:t,warningMillis:n||1e3}}function ue(e,t){const n=e.timeouts[t],r=n.warningMillis,o=F(e);return new Promise(((i,a)=>{let u=!1,s=!1;e[t](te(e)).then((e=>{u=!0,i(e)})).catch((e=>{u=!0,a(e)})),setTimeout((()=>l(1)),r),setTimeout((()=>l(!0)),n.millis);const c=w(31,!1,t,o,N(e),n.millis);function l(e){if(!u)if(!0===e)s=!0,n.dieOnTimeout?a(Error(c)):console.error(c);else if(!s){const t=e,o=t*r;console.warn(c),o+r<n.millis&&setTimeout((()=>l(t+1)),r)}}}))}function se(e){const t={};for(let n in ne)t[n]=B({},ne[n],e&&e[n]||{});return t}function ce(e){return Promise.resolve().then((()=>{if(e.loadPromise)return e.loadPromise;if(e.status!==S&&e.status!==C)return e;let t,n;return e.status=O,e.loadPromise=Promise.resolve().then((()=>{const r=e.loadApp(te(e));if(!V(r))throw n=!0,Error(w(33,!1,N(e)));return r.then((n=>{let r;e.loadErrorTime=null,t=n,"object"!=typeof t&&(r=34),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!K(t.bootstrap)&&(r=35),K(t.mount)||(r=36),K(t.unmount)||(r=37);const o=F(t);if(r){let n;try{n=JSON.stringify(t)}catch(e){}return console.error(w(r,!1,o,N(e),n),t),m(void 0,e,I),e}return t.devtools&&t.devtools.overlays&&(e.devtools.overlays=B({},e.devtools.overlays,t.devtools.overlays)),e.status=E,e.bootstrap=z(t,"bootstrap"),e.mount=z(t,"mount"),e.unmount=z(t,"unmount"),e.unload=z(t,"unload"),e.timeouts=se(t.timeouts),delete e.loadPromise,e}))})).catch((t=>{let r;return delete e.loadPromise,n?r=I:(r=C,e.loadErrorTime=(new Date).getTime()),m(t,e,r),e}))}))}const le="undefined"!=typeof window,fe={hashchange:[],popstate:[]},de=["hashchange","popstate"];function he(e){let t;if("string"==typeof e)t=e;else if(this&&this.href)t=this.href;else{if(!(e&&e.currentTarget&&e.currentTarget.href&&e.preventDefault))throw Error(w(14,!1));t=e.currentTarget.href,e.preventDefault()}const n=_e(window.location.href),r=_e(t);0===t.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=t:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,t)}function pe(e){if(e){const t=e[0].type;de.indexOf(t)>=0&&fe[t].forEach((t=>{try{t.apply(this,e)}catch(e){setTimeout((()=>{throw e}))}}))}}let ye;function ve(){qe([],arguments)}function me(e,t){return function(){const n=window.location.href,r=e.apply(this,arguments),o=window.location.href;return ye&&n===o||window.dispatchEvent(function(e,t){let n;try{n=new PopStateEvent("popstate",{state:e})}catch(t){n=document.createEvent("PopStateEvent"),n.initPopStateEvent("popstate",!1,!1,e)}return n.singleSpa=!0,n.singleSpaTrigger=t,n}(window.history.state,t)),r}}let ge=null,be=!1;function we(e){if(be)throw Error(w(43,!1));ye=!e||!e.hasOwnProperty("urlRerouteOnly")||e.urlRerouteOnly,be=!0,ge=window.history.replaceState,window.addEventListener("hashchange",ve),window.addEventListener("popstate",ve);const t=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(e,n){if(!("function"==typeof n&&de.indexOf(e)>=0)||U(fe[e],(e=>e===n)))return t.apply(this,arguments);fe[e].push(n)},window.removeEventListener=function(e,t){if(!("function"==typeof t&&de.indexOf(e)>=0))return n.apply(this,arguments);fe[e]=fe[e].filter((e=>e!==t))},window.history.pushState=me(window.history.pushState,"pushState"),window.history.replaceState=me(ge,"replaceState")}function _e(e){const t=document.createElement("a");return t.href=e,t}le&&(window.singleSpaNavigate?console.warn(w(41,!1)):window.singleSpaNavigate=he);let Se=!1;function Oe(e=window.jQuery){if(e||window.$&&window.$.fn&&window.$.fn.jquery&&(e=window.$),e&&!Se){const t=e.fn.on,n=e.fn.off;e.fn.on=function(e,n){return Ee.call(this,t,window.addEventListener,e,n,arguments)},e.fn.off=function(e,t){return Ee.call(this,n,window.removeEventListener,e,t,arguments)},Se=!0}}function Ee(e,t,n,r,o){return"string"!=typeof n?e.apply(this,o):(n.split(/\s+/).forEach((e=>{de.indexOf(e)>=0&&(t(e,r),n=n.replace(e,""))})),""===n.trim()?this:e.apply(this,o))}const xe={};function ke(e){return Promise.resolve().then((()=>{const t=xe[N(e)];if(!t)return e;if(e.status===S)return Pe(e,t),e;if(e.status===D)return t.promise.then((()=>e));if(e.status!==k&&e.status!==C)return e;const n=e.status===C?Promise.resolve():ue(e,"unload");return e.status=D,n.then((()=>(Pe(e,t),e))).catch((n=>(function(e,t,n){delete xe[N(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,m(n,e,I),t.reject(n)}(e,t,n),e)))}))}function Pe(e,t){delete xe[N(e)],delete e.bootstrap,delete e.mount,delete e.unmount,delete e.unload,e.status=S,t.resolve()}function je(e,t,n,r){xe[N(e)]={app:e,resolve:n,reject:r},Object.defineProperty(xe[N(e)],"promise",{get:t})}function Ae(e){return xe[e]}const Te=[];function De(){return Te.filter(M).map(N)}function Ce(){return Te.map(N)}function Ie(e){const t=U(Te,(t=>N(t)===e));return t?t.status:null}let Me=!1;function Re(e,t,n,r){const o=function(e,t,n,r){const o={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof e?(function(e){if(Array.isArray(e)||null===e)throw Error(w(39,!1));const t=["name","app","activeWhen","customProps"],n=Object.keys(e).reduce(((e,n)=>t.indexOf(n)>=0?e:e.concat(n)),[]);if(0!==n.length)throw Error(w(38,!1,t.join(", "),n.join(", ")));if("string"!=typeof e.name||0===e.name.length)throw Error(w(20,!1));if("object"!=typeof e.app&&"function"!=typeof e.app)throw Error(w(20,!1));const r=e=>"string"==typeof e||"function"==typeof e;if(!(r(e.activeWhen)||Array.isArray(e.activeWhen)&&e.activeWhen.every(r)))throw Error(w(24,!1));if(!Ue(e.customProps))throw Error(w(22,!1))}(e),o.name=e.name,o.loadApp=e.app,o.activeWhen=e.activeWhen,o.customProps=e.customProps):(function(e,t,n,r){if("string"!=typeof e||0===e.length)throw Error(w(20,!1));if(!t)throw Error(w(23,!1));if("function"!=typeof n)throw Error(w(24,!1));if(!Ue(r))throw Error(w(22,!1))}(e,t,n,r),o.name=e,o.loadApp=t,o.activeWhen=n,o.customProps=r),o.loadApp="function"!=typeof(i=o.loadApp)?()=>Promise.resolve(i):i,o.customProps=function(e){return e||{}}(o.customProps),o.activeWhen=function(e){let t=Array.isArray(e)?e:[e];return t=t.map((e=>"function"==typeof e?e:Ke(e))),e=>t.some((t=>t(e)))}(o.activeWhen),o;var i}(e,t,n,r);if(Je()||Me||(Me=!0,setTimeout((()=>{Je()||console.warn(w(1,!1))}),5e3)),-1!==Ce().indexOf(o.name))throw Error(w(21,!1,o.name));Te.push(B({loadErrorTime:null,status:S,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),le&&(Oe(),qe())}function Ne(e=window.location){return Te.filter((t=>t.activeWhen(e))).map(N)}function Le(e){if(0===Te.filter((t=>N(t)===e)).length)throw Error(w(25,!1,e));return(le?Fe(e,{waitForUnmount:!1}):Promise.resolve()).then((()=>{const t=Te.map(N).indexOf(e);Te.splice(t,1)}))}function Fe(e,t={waitForUnmount:!1}){if("string"!=typeof e)throw Error(w(26,!1));const n=U(Te,(t=>N(t)===e));if(!n)throw Error(w(27,!1,e));const r=Ae(N(n));if(t&&t.waitForUnmount){if(r)return r.promise;{const e=new Promise(((t,r)=>{je(n,(()=>e),t,r)}));return e}}{let e;return r?(e=r.promise,Be(n,r.resolve,r.reject)):e=new Promise(((t,r)=>{je(n,(()=>e),t,r),Be(n,t,r)})),e}}function Be(e,t,n){Promise.resolve().then((()=>{if(U(Ne(),(t=>t===N(e))))return He()})).then((()=>q(e).then(ke).then((()=>{t(),setTimeout((()=>{qe()}))})))).catch(n)}function Ue(e){return!e||"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)}function Ke(e,t){const n=function(e,t){let n=0,r=!1,o="^";"/"!==e[0]&&(e="/"+e);for(let t=0;t<e.length;t++){const n=e[t];(!r&&":"===n||r&&"/"===n)&&i(t)}return i(e.length),new RegExp(o,"i");function i(i){const a=e.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":a,i===e.length)if(r)t&&(o+="$");else{const e=t?"":".*";o="/"===o.charAt(o.length-1)?`${o}${e}$`:`${o}(/${e})?(#.*)?$`}r=!r,n=i}}(e,t);return e=>{let t=e.origin;t||(t=`${e.protocol}//${e.host}`);const r=e.href.replace(t,"").replace(e.search,"").split("?")[0];return n.test(r)}}let ze=!1,Ve=[],Ge=le&&window.location.href;function He(){return qe()}function qe(e=[],t,n=!1){if(ze)return new Promise(((e,n)=>{Ve.push({resolve:e,reject:n,eventArguments:t})}));const{appsToUnload:r,appsToUnmount:o,appsToLoad:i,appsToMount:a}=function(){const e=[],t=[],n=[],r=[],o=(new Date).getTime();return Te.forEach((i=>{const a=i.status!==I&&R(i);switch(i.status){case C:a&&o-i.loadErrorTime>=200&&n.push(i);break;case S:case O:a&&n.push(i);break;case E:case k:!a&&Ae(N(i))?e.push(i):a&&r.push(i);break;case j:a||t.push(i)}})),{appsToUnload:e,appsToUnmount:t,appsToLoad:n,appsToMount:r}}();let u,s=[],c=Ge,l=Ge=window.location.href;return Je()?(ze=!0,u=r.concat(i,o,a),Promise.resolve().then((()=>(v(0===u.length?"before-no-app-change":"before-app-change",p(!0)),v("before-routing-event",p(!0,{cancelNavigation:f})),Promise.all(s).then((n=>{if(n.some((e=>e)))return ge.call(window.history,history.state,"",c.substring(location.origin.length)),Ge=location.href,ze=!1,qe(e,t,!0);const u=r.map(ke),s=o.map(q).map((e=>e.then(ke))).concat(u),l=Promise.all(s);l.then((()=>{v("before-mount-routing-event",p(!0))}),(e=>{throw e}));const f=i.map((e=>ce(e).then((e=>We(e,l))))),y=a.filter((e=>i.indexOf(e)<0)).map((e=>We(e,l)));return l.catch((e=>{throw h(),e})).then((()=>(h(),Promise.all(f.concat(y)).catch((t=>{throw e.forEach((e=>e.reject(t))),t})).then(d).then((()=>{}),(e=>{throw e})))))})))))):(u=i,Promise.resolve().then((()=>{const e=i.map(ce);return Promise.all(e).then(h).then((()=>[])).catch((e=>{throw h(),e})).finally((()=>{}))})));function f(e=!0){const t="function"==typeof(null==e?void 0:e.then)?e:Promise.resolve(e);s.push(t.catch((e=>(console.warn(Error(w(42,!1))),console.warn(e),!1))))}function d(){const t=De();e.forEach((e=>e.resolve(t)));try{v(0===u.length?"no-app-change":"app-change",p()),v("routing-event",p())}catch(e){setTimeout((()=>{throw e}))}if(ze=!1,Ve.length>0){const e=Ve;Ve=[],qe(e)}return t}function h(){n||(e.forEach((e=>{pe(e.eventArguments)})),pe(t))}function p(e=!1,n){const s={},f={[j]:[],[k]:[],[S]:[],[I]:[]};e?(i.concat(a).forEach(((e,t)=>{h(e,j)})),r.forEach((e=>{h(e,S)})),o.forEach((e=>{h(e,k)}))):u.forEach((e=>{h(e)}));const d={detail:{newAppStatuses:s,appsByNewStatus:f,totalAppChanges:u.length,originalEvent:null==t?void 0:t[0],oldUrl:c,newUrl:l}};return n&&B(d.detail,n),d;function h(e,t){const n=N(e);t=t||Ie(n),s[n]=t,(f[t]=f[t]||[]).push(n)}}function v(e,t){n||window.dispatchEvent(new y(`single-spa:${e}`,t))}}function We(e,t){return R(e)?H(e).then((e=>t.then((()=>R(e)?Y(e):e)))):t.then((()=>e))}let $e=!1;function Ye(e){$e=!0,le&&(we(e),qe())}function Je(){return $e}var Qe={getRawAppData:function(){return[...Te]},reroute:qe,NOT_LOADED:S,toLoadPromise:ce,toBootstrapPromise:H,unregisterApplication:Le,getProfilerData:function(){return G}};le&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Qe);var Ze=n(1704),Xe=n(6362),et=n(1491);function tt(e,t){var n=t.name;if(n){t.slots&&t.slot&&console.warn("The extension ".concat(n," from ").concat(e," declares both a 'slots' property and\na 'slot' property. Only the 'slots' property will be honored."));var r=t.slots?t.slots:t.slot?[t.slot]:[];if(t.component||t.load){var o,i,a=void 0;if(t.component)a=l(e,t.component);else if(t.load){if("function"!=typeof t.load)return void console.error("The extension ".concat(n," from ").concat(e," declares a 'load' property that is not a function. This is not\nsupported, so the extension will not be loaded."));a=t.load}a&&(0,et.registerExtension)({name:n,load:a,meta:t.meta||{},order:t.order,moduleName:e,privileges:t.privileges,online:null===(o=t.online)||void 0===o||o,offline:null!==(i=t.offline)&&void 0!==i&&i,featureFlag:t.featureFlag});var u=!0,s=!1,c=void 0;try{for(var f,d=r[Symbol.iterator]();!(u=(f=d.next()).done);u=!0){var h=f.value;(0,et.attach)(h,n)}}catch(e){s=!0,c=e}finally{try{u||null==d.return||d.return()}finally{if(s)throw c}}}else console.error("The extension ".concat(n," from ").concat(e," is missing a 'component' entry and thus cannot be registered.\nTo fix this, ensure that you define a 'component' field inside the extension definition."),t)}else console.error("An extension definition in ".concat(e,' is missing an name and thus cannot be\nregistered. To fix this, ensure that you define the "name" field inside the\nextension definition.'),t)}function nt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var rt=[];function ot(e){if(Array.isArray(e)){var t=e.map(ot);return function(e){return t.some((function(t){return t(e)}))}}return"string"==typeof e?Ke(window.getOpenmrsSpaBase()+e):(n=e,(null!=(r=RegExp)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](n):n instanceof r)?function(t){return function(e,t){return e.test(t.pathname.replace(window.getOpenmrsSpaBase(),""))}(e,t)}:function(){return e});var n,r}function it(e,t){if(e&&t&&"object"==typeof t){var n,r;(0,Ze.registerModuleWithConfigSystem)(e);var o,i,a,u=null!==(r=t.extensions)&&void 0!==r?r:[],s=null!==(o=t.modals)&&void 0!==o?o:[],c=null!==(i=t.workspaces)&&void 0!==i?i:[],f=null!==(a=t.featureFlags)&&void 0!==a?a:[];null===(n=t.pages)||void 0===n||n.forEach((function(t){var n,r,o;t&&"object"==typeof t&&Object.hasOwn(t,"component")&&(Object.hasOwn(t,"route")||Object.hasOwn(t,"routeRegex")||Object.hasOwn(t,"routes"))?rt.push((r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){nt(e,t,n[t])}))}return e}({},t),o=null!=(o={order:null!==(n=t.order)&&void 0!==n?n:Number.MAX_SAFE_INTEGER,appName:e})?o:{},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))})),r)):console.warn("A page for ".concat(e," could not be registered as it does not appear to have the required properties"),t)})),u.forEach((function(t){t&&"object"==typeof t&&Object.hasOwn(t,"name")&&Object.hasOwn(t,"component")?tt(e,t):console.warn("An extension for ".concat(e," could not be registered as it does not appear to have the required properties"),t)})),s.forEach((function(t){t&&"object"==typeof t&&Object.hasOwn(t,"name")&&Object.hasOwn(t,"component")?function(e,t){var n=t.name;if(n)if(t.component||t.load){var r=void 0;if(t.component)r=l(e,t.component);else if(t.load){if("function"!=typeof t.load)return void console.error("The modal ".concat(n," from ").concat(e," declares a 'load' property that is not a function. This is not\nsupported, so the modal will not be loaded."));r=t.load}r&&(0,et.registerModal)({name:n,load:r,moduleName:e})}else console.error("The modal ".concat(n," from ").concat(e," is missing a 'component' entry and thus cannot be registered.\nTo fix this, ensure that you define a 'component' field inside the modal definition."),t);else console.error("A modal definition in ".concat(e,' is missing an name and thus cannot be\nregistered. To fix this, ensure that you define the "name" field inside the\nmodal definition.'),t)}(e,t):console.warn("A modal for ".concat(e," could not be registered as it does not appear to have the required properties"),t)})),c.forEach((function(t){t&&"object"==typeof t&&Object.hasOwn(t,"name")&&Object.hasOwn(t,"component")?function(e,t){var n=t.name;if(n){var r=t.title;if(r)if(t.component||t.load){var o=void 0;if(t.component)o=l(e,t.component);else if(t.load){if("function"!=typeof t.load)return void console.error("The workspace ".concat(n," from ").concat(e," declares a 'load' property that is not a function. This is not\nsupported, so the workspace will not be loaded."));o=t.load}o&&(0,et.registerWorkspace)({name:n,title:r,load:o,moduleName:e,type:t.type,canHide:t.canHide,canMaximize:t.canMaximize,width:t.width,hasOwnSidebar:t.hasOwnSidebar,sidebarFamily:t.sidebarFamily,preferredWindowSize:t.preferredWindowSize})}else console.error("The workspace ".concat(n," from ").concat(e," is missing a 'component' entry and thus cannot be registered.\nTo fix this, ensure that you define a 'component' field inside the workspace definition."),t);else console.error("A workspace definition in ".concat(e,' is missing a title and thus cannot be registered.\nTo fix this, ensure that you define the "title" field inside the workspace definition.'),t)}else console.error("A workspace definition in ".concat(e,' is missing a name and thus cannot be registered.\nTo fix this, ensure that you define the "name" field inside the workspace definition.'),t)}(e,t):console.warn("A workspace for ".concat(e," could not be registered as it does not appear to have the required properties"),t)})),f.forEach((function(t){t&&"object"==typeof t&&Object.hasOwn(t,"flagName")?function(e,t){t.flagName?t.label?t.description?(0,Xe.registerFeatureFlag)(t.flagName,t.label,t.description):console.error("A feature flag definition in ".concat(e,' is missing a description and thus cannot be registered.\nTo fix this, ensure that you define the "description" field inside the feature flag definition.'),t):console.error("A feature flag definition in ".concat(e,' is missing a description and thus cannot be registered.\nTo fix this, ensure that you define the "label" field inside the feature flag definition.'),t):console.error("A feature flag definition in ".concat(e,' is missing a name and thus cannot be registered.\nTo fix this, ensure that you define the "name" field inside the feature flag definition.'),t)}(e,t):console.warn("A feature flag for ".concat(e," could not be registered as it does not appear to have the required properties"),t)}))}}function at(){rt.sort((function(e,t){var n=e.order-t.order;return 0!=n?n:e.appName.localeCompare(t.appName,"en")}));var e=new Map,t=!0,n=!1,r=void 0;try{for(var o,i=rt[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){var a=o.value;e.has(a.appName)?e.set(a.appName,e.get(a.appName)+1):e.set(a.appName,0);var u=e.get(a.appName),s="".concat(a.appName,"-page-").concat(u),c=document.createElement("div");c.id="single-spa-application:".concat(s),document.body.appendChild(c),ut(s,a)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}}function ut(e,t){var n=void 0!==t.route?t.route:void 0!==t.routeRegex&&new RegExp(t.routeRegex);if(!1!==n)if(t.component){var r=function(e,t){var n=t.online,r=t.offline,o=t.featureFlag;return window.offlineEnabled?function(t){return!!(navigator.onLine&&(null==n||n)||!navigator.onLine&&null!=r&&r)&&!(o&&!(0,Xe.getFeatureFlag)(o))&&e(t)}:e}(ot(n),t);Re(e,l(t.appName,t.component),r)}else console.warn('A registered page definition is missing a component and thus cannot be registered.\nTo fix this, ensure that you define the "component" field inside the page definition.',e);else console.warn('A registered page definition is missing a route and thus cannot be registered.\nTo fix this, ensure that you define the "route" (or alternatively the "routeRegex") field inside the extension definition.',e)}function st(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ct=(0,n(9523).canAccessStorage)();function lt(e,t){if(ct){if("string"==typeof t){if(t.startsWith("http"))return ht(e,t);try{var n=JSON.parse(t);if(pt(n))return ht(e,n);console.error("The supplied routes for ".concat(e," is not a valid OpenmrsAppRoutes object"),t)}catch(t){console.error("Could not add routes override for ".concat(e,": "),t)}}else{if(r=t,null!=(o=URL)&&"undefined"!=typeof Symbol&&o[Symbol.hasInstance]?o[Symbol.hasInstance](r):r instanceof o)return ht(e,t.toString());if(pt(t))return ht(e,t)}var r,o;console.error("Override for ".concat(e," is not in a valid format. Expected either a Javascript Object, a JSON string of a Javascript object, or a URL"),t)}}function ft(e){if(ct){var t=r+e;localStorage.removeItem(t)}}function dt(){if(ct)for(var e=window.localStorage,t=0;t<e.length;t++){var n=e.key(t);(null==n?void 0:n.startsWith(r))&&e.removeItem(n)}}function ht(e,t){var n=r+e;localStorage.setItem(n,JSON.stringify(t))}function pt(e){if(e&&"object"==typeof e){var t=Object.prototype.hasOwnProperty,n=e;return!!((!t.call(e,"pages")||Boolean(n.pages)&&Array.isArray(n.pages))&&(!t.call(e,"extensions")||Boolean(n.extensions)&&Array.isArray(n.extensions))&&(!t.call(e,"workspaces")||Boolean(n.workspaces)&&Array.isArray(n.workspaces))&&(!t.call(e,"modals")||Boolean(n.modals)&&Array.isArray(n.modals)))}return!1}function yt(e){if(e&&"object"==typeof e){var t=e;return Object.entries(t).every((function(e){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return st(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?st(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e,2),n=t[0],r=t[1];return"string"==typeof n&&pt(r)}))}return!1}},8050:()=>{System.register([],(function(e,t){return{execute:function(){e(function(){"use strict";var e=function(e,t){var n=s[e];if(n)return n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value.setState(t,!0),n.active=!0,n.value;var r=u()((function(){return t}));return s[e]={value:r,active:!0},r},t=function(e,t){var n=s[e];return n?(n.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):n.value=t,n.active=!0,n.value):(s[e]={value:t,active:!0},t)},n=function(e,t){var n=s[e];if(!n){var r=u()((function(){return null!=t?t:{}}));return s[e]={value:r,active:!1},r}return n.value},r=function(e,t,n){var r=t(e.getState());return e.subscribe((function(e){var o=t(e);o!==r&&(r=o,n(o))}))},o={d:function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},i={};o.r(i),o.d(i,{createGlobalStore:function(){return e},getGlobalStore:function(){return n},registerGlobalStore:function(){return t},subscribeTo:function(){return r}});var a=function(e){var t,n=new Set,r=function(e,r){var o="function"==typeof e?e(t):e;if(!Object.is(o,t)){var i=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((function(e){return e(t,i)}))}},o=function(){return t},i={setState:r,getState:o,subscribe:function(e){return n.add(e),function(){return n.delete(e)}},destroy:function(){console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,i),i},u=function(e){return e?a(e):a},s={};return setTimeout((function(){"development"===window.spaEnv&&(window.stores=s)}),1e3),i}())}}}))},58:(e,t,n)=>{"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,{R:()=>$,a:()=>W});var o,i,a=(o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(t){r(e,t,n[t])}))}return e}({},{address1:"Address line 1",address2:"Address line 2",address3:"Address line 3",address4:"Address line 4",address5:"Address line 5",address6:"Address line 6",city:"City",cityVillage:"City",country:"Country",countyDistrict:"District",postalCode:"Postal code",state:"State",stateProvince:"State"},{closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There are unsaved changes in the following workspaces. Do you want to discard changes in the following workspaces? {{workspaceNames}}",closingAllWorkspacesPromptTitle:"You have unsaved changes",discard:"Discard",hide:"Hide",maximize:"Maximize",minimize:"Minimize",openAnyway:"Open anyway",unsavedChangesInOpenedWorkspace:"You have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:"There are unsaved changes in {{workspaceName}}. Please save them before opening another workspace.",unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header"}),i=null!=(i={actions:"Actions",address:"Address",age:"Age",cancel:"Cancel",change:"Change",close:"Close",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",error:"Error",errorCopy:"Sorry, there was a problem displaying this information. You can try to reload this page, or contact the site administrator and quote the error code above.",female:"Female",hideDetails:"Hide details",loading:"Loading",male:"Male",other:"Other",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",scriptLoadingFailed:"Error: Script failed to load",scriptLoadingError:"Failed to load overridden script from {{url}}. Please check that the bundled script is available at the expected URL. Click the button below to reset all import map overrides.",seeMoreLists:"See {{count}} more lists",sex:"Sex",showDetails:"Show details",unknown:"Unknown"})?i:{},Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(i)).forEach((function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(i,e))})),o);const u={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class s{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||u,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new s(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new s(this.logger,e)}}var c=new s;class l{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach((e=>{this.observers[e]=this.observers[e]||[],this.observers[e].push(t)})),this}off(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((e=>e!==t)):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((e=>{e(...n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((t=>{t.apply(t,[e,...n])}))}}function f(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n}function d(e){return null==e?"":""+e}function h(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}const i="string"!=typeof t?[].concat(t):t.split(".");for(;i.length>1;){if(o())return{};const t=r(i.shift());!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}return o()?{}:{obj:e,k:r(i.shift())}}function p(e,t,n){const{obj:r,k:o}=h(e,t,Object);r[o]=n}function y(e,t){const{obj:n,k:r}=h(e,t);if(n)return n[r]}function v(e,t,n){for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):v(e[r],t[r],n):e[r]=t[r]);return e}function m(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var g={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function b(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(e=>g[e])):e}const w=[" ",",","?","!",";"];function _(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let e=0;e<r.length;++e){if(!o)return;if("string"==typeof o[r[e]]&&e+1<r.length)return;if(void 0===o[r[e]]){let i=2,a=r.slice(e,e+i).join(n),u=o[a];for(;void 0===u&&r.length>e+i;)i++,a=r.slice(e,e+i).join(n),u=o[a];if(void 0===u)return;if(null===u)return null;if(t.endsWith(a)){if("string"==typeof u)return u;if(a&&"string"==typeof u[a])return u[a]}const s=r.slice(e+i).join(n);return s?_(u,s,n):void 0}o=o[r[e]]}return o}function S(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class O extends l{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,i=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a=[e,t];n&&"string"!=typeof n&&(a=a.concat(n)),n&&"string"==typeof n&&(a=a.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(a=e.split("."));const u=y(this.data,a);return u||!i||"string"!=typeof n?u:_(this.data&&this.data[e]&&this.data[e][t],n,o)}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let a=[e,t];n&&(a=a.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(a=e.split("."),r=t,t=a[1]),this.addNamespaces(t),p(this.data,a,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const r in n)"string"!=typeof n[r]&&"[object Array]"!==Object.prototype.toString.apply(n[r])||this.addResource(e,t,r,n[r],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(a=e.split("."),r=n,n=t,t=a[1]),this.addNamespaces(t);let u=y(this.data,a)||{};r?v(u,n,o):u={...u,...n},p(this.data,a,u),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var E={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach((e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))})),t}};const x={};class k extends l{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,r;super(),n=e,r=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((e=>{n[e]&&(r[e]=n[e])})),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=c.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";const r=w.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const o=new RegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i}(e,n,r));if(i&&!a){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o};const i=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(e[e.length-1],t),u=a[a.length-1],s=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(s&&"cimode"===s.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${u}${e}${i}`,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:`${u}${e}${i}`}return r?{res:i,usedKey:i,exactUsedKey:i,usedLng:s,usedNS:u,usedParams:this.getUsedParamsDetails(t)}:i}const l=this.resolve(e,t);let f=l&&l.res;const d=l&&l.usedKey||i,h=l&&l.exactUsedKey||i,p=Object.prototype.toString.apply(f),y=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&f&&"string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f&&["[object Number]","[object Function]","[object RegExp]"].indexOf(p)<0&&("string"!=typeof y||"[object Array]"!==p)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(d,f,{...t,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return r?(l.res=e,l.usedParams=this.getUsedParamsDetails(t),l):e}if(o){const e="[object Array]"===p,n=e?[]:{},r=e?h:d;for(const e in f)if(Object.prototype.hasOwnProperty.call(f,e)){const i=`${r}${o}${e}`;n[e]=this.translate(i,{...t,joinArrays:!1,ns:a}),n[e]===i&&(n[e]=f[e])}f=n}}else if(v&&"string"==typeof y&&"[object Array]"===p)f=f.join(y),f&&(f=this.extendTranslation(f,e,t,n));else{let r=!1,a=!1;const c=void 0!==t.count&&"string"!=typeof t.count,d=k.hasDefaultValue(t),h=c?this.pluralResolver.getSuffix(s,t.count,t):"",p=t.ordinal&&c?this.pluralResolver.getSuffix(s,t.count,{ordinal:!1}):"",y=t[`defaultValue${h}`]||t[`defaultValue${p}`]||t.defaultValue;!this.isValidLookup(f)&&d&&(r=!0,f=y),this.isValidLookup(f)||(a=!0,f=i);const v=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&a?void 0:f,m=d&&y!==f&&this.options.updateMissing;if(a||r||m){if(this.logger.log(m?"updateKey":"missingKey",s,u,i,m?y:f),o){const e=this.resolve(i,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t<n.length;t++)e.push(n[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);const r=(e,n,r)=>{const o=d&&r!==f?r:v;this.options.missingKeyHandler?this.options.missingKeyHandler(e,u,n,o,m,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,u,n,o,m,t),this.emit("missingKey",e,u,n,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach((e=>{this.pluralResolver.getSuffixes(e,t).forEach((n=>{r([e],i+n,t[`defaultValue${n}`]||y)}))})):r(e,i,y))}f=this.extendTranslation(f,e,t,l,n),a&&f===i&&this.options.appendNamespaceToMissingKey&&(f=`${u}:${i}`),(a||r)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}:${i}`:i,r?f:void 0):this.options.parseMissingKeyHandler(f))}return r?(l.res=f,l.usedParams=this.getUsedParamsDetails(t),l):f}extendTranslation(e,t,n,r,o){var i=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const a="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(a){const t=e.match(this.interpolator.nestingRegexp);u=t&&t.length}let s=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language,n),a){const t=e.match(this.interpolator.nestingRegexp);u<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];return o&&o[0]===r[0]&&!n.context?(i.logger.warn(`It seems you are nesting recursively key: ${r[0]} in key: ${t[0]}`),null):i.translate(...r,t)}),n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,u="string"==typeof a?[a]:a;return null!=e&&u&&u.length&&!1!==n.applyPostProcessor&&(e=E.handle(u,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let t,n,r,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const u=this.extractFromKey(e,a),s=u.key;n=s;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const l=void 0!==a.count&&"string"!=typeof a.count,f=l&&!a.ordinal&&0===a.count&&this.pluralResolver.shouldUseIntlApi(),d=void 0!==a.context&&("string"==typeof a.context||"number"==typeof a.context)&&""!==a.context,h=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(i=e,!x[`${h[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(i)&&(x[`${h[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${h.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((n=>{if(this.isValidLookup(t))return;o=n;const i=[s];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(i,s,n,e,a);else{let e;l&&(e=this.pluralResolver.getSuffix(n,a.count,a));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(l&&(i.push(s+e),a.ordinal&&0===e.indexOf(r)&&i.push(s+e.replace(r,this.options.pluralSeparator)),f&&i.push(s+t)),d){const n=`${s}${this.options.contextSeparator}${a.context}`;i.push(n),l&&(i.push(n+e),a.ordinal&&0===e.indexOf(r)&&i.push(n+e.replace(r,this.options.pluralSeparator)),f&&i.push(n+t))}}let u;for(;u=i.pop();)this.isValidLookup(t)||(r=u,t=this.getResource(n,e,u,a))})))}))})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&"string"!=typeof e.replace;let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}function P(e){return e.charAt(0).toUpperCase()+e.slice(1)}class j{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=c.create("languageUtils")}getScriptPartFromCode(e){if(!(e=S(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=S(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map((e=>e.toLowerCase())):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=P(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=P(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=P(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:0===e.indexOf(n)?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))})),r}}let A=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],T={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};const D=["v1","v2","v3"],C=["v4"],I={zero:0,one:1,two:2,few:3,many:4,other:5};class M{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=c.create("pluralResolver"),this.options.compatibilityJSON&&!C.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){const e={};return A.forEach((t=>{t.lngs.forEach((n=>{e[n]={numbers:t.nr,plurals:T[t.fc]}}))})),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(S(e),{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(((e,t)=>I[e]-I[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):n.numbers.map((n=>this.getSuffix(e,n,t))):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!D.includes(this.options.compatibilityJSON)}}function R(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=function(e,t,n){const r=y(e,n);return void 0!==r?r:y(t,n)}(e,t,n);return!i&&o&&"string"==typeof n&&(i=_(e,n,r),void 0===i&&(i=_(t,n,r))),i}class N{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=c.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const t=e.interpolation;this.escape=void 0!==t.escape?t.escape:b,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?m(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?m(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?m(t.nestingPrefix):t.nestingPrefixEscaped||m("$t("),this.nestingSuffix=t.nestingSuffix?m(t.nestingSuffix):t.nestingSuffixEscaped||m(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");const t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(t,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(e,t,n,r){let o,i,a;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function s(e){return e.replace(/\$/g,"$$$$")}const c=e=>{if(e.indexOf(this.formatSeparator)<0){const o=R(t,u,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),a=o.join(this.formatSeparator).trim();return this.format(R(t,u,i,this.options.keySeparator,this.options.ignoreJSONStructure),a,n,{...r,...t,interpolationkey:i})};this.resetRegExp();const l=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>s(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?s(this.escape(e)):s(e)}].forEach((t=>{for(a=0;o=t.regex.exec(e);){const n=o[1].trim();if(i=c(n),void 0===i)if("function"==typeof l){const t=l(e,o,r);i="string"==typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))i="";else{if(f){i=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),i=""}else"string"==typeof i||this.useRawValueToEscape||(i=d(i));const u=t.safeValue(i);if(e=e.replace(o[0],u),f?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,a++,a>=this.maxReplaces)break}})),e}nest(e,t){let n,r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function a(e,t){const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let i=`{${r[1]}`;e=r[0],i=this.interpolate(i,o);const a=i.match(/'/g),u=i.match(/"/g);(a&&a.length%2==0&&!u||u.length%2!=0)&&(i=i.replace(/'/g,'"'));try{o=JSON.parse(i),t&&(o={...t,...o})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${i}`}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){let u=[];o={...i},o=o.replace&&"string"!=typeof o.replace?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let s=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),u=e,s=!0}if(r=t(a.call(this,n[1].trim(),o),o),r&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=d(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),s&&(r=u.reduce(((e,t)=>this.format(e,t,i.lng,{...i,interpolationkey:n[1].trim()})),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}function L(e){const t={};return function(n,r,o){const i=r+JSON.stringify(o);let a=t[i];return a||(a=e(S(r),o),t[i]=a),a(n)}}class F{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=c.create("formatter"),this.options=e,this.formats={number:L(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:L(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:L(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:L(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:L(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=L(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce(((e,t)=>{const{formatName:o,formatOptions:i}=function(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((e=>{if(!e)return;const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,"");n[t.trim()]||(n[t.trim()]=o),"false"===o&&(n[t.trim()]=!1),"true"===o&&(n[t.trim()]=!0),isNaN(o)||(n[t.trim()]=parseInt(o,10))}))}return{formatName:t,formatOptions:n}}(t);if(this.formats[o]){let t=e;try{const a=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=a.locale||a.lng||r.locale||r.lng||n;t=this.formats[o](e,u,{...i,...r,...a})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e}),e)}}class B extends l{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=c.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const o={},i={},a={},u={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const a=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[a]=2:this.state[a]<0||(1===this.state[a]?void 0===i[a]&&(i[a]=!0):(this.state[a]=1,r=!1,void 0===i[a]&&(i[a]=!0),void 0===o[a]&&(o[a]=!0),void 0===u[t]&&(u[t]=!0)))})),r||(a[e]=!0)})),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(u)}}loaded(e,t,n){const r=e.split("|"),o=r[0],i=r[1];t&&this.emit("failedLoading",o,i,t),n&&this.store.addResourceBundle(o,i,n),this.state[e]=t?-1:2;const a={};this.queue.forEach((n=>{!function(e,t,n,r){const{obj:o,k:i}=h(e,t,Object);o[i]=o[i]||[],o[i].push(n)}(n.loaded,[o],i),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{a[e]||(a[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===a[e][t]&&(a[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",a),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const a=(a,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}a&&u&&r<this.maxRetries?setTimeout((()=>{this.read.call(this,e,t,n,r+1,2*o,i)}),o):i(a,u)},u=this.backend[n].bind(this.backend);if(2!==u.length)return u(e,t,a);try{const n=u(e,t);n&&"function"==typeof n.then?n.then((e=>a(null,e))).catch(a):a(null,n)}catch(e){a(e)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,((n,i)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,i),this.loaded(e,n,i)}))}saveMissing(e,t,n,r,o){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const u={...i,isUpdate:o},s=this.backend.create.bind(this.backend);if(s.length<6)try{let o;o=5===s.length?s(e,t,n,r,u):s(e,t,n,r),o&&"function"==typeof o.then?o.then((e=>a(null,e))).catch(a):a(null,o)}catch(e){a(e)}else s(e,t,n,r,a,u)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}function U(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function K(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function z(){}class V extends l{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=K(e),this.services={},this.logger=c,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=U();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options={...r,...this.options,...K(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?c.init(o(this.modules.logger),this.options):c.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=F);const n=new j(this.options);this.store=new O(this.options.resources,this.options);const i=this.services;i.logger=c,i.resourceStore=this.store,i.languageUtils=n,i.pluralResolver=new M(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(i.formatter=o(t),i.formatter.init(i,this.options),this.options.interpolation.format=i.formatter.format.bind(i.formatter)),i.interpolator=new N(this.options),i.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},i.backendConnector=new B(o(this.modules.backend),i.resourceStore,i,this.options),i.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)})),this.modules.languageDetector&&(i.languageDetector=o(this.modules.languageDetector),i.languageDetector.init&&i.languageDetector.init(i,this.options.detection,this.options)),this.modules.i18nFormat&&(i.i18nFormat=o(this.modules.i18nFormat),i.i18nFormat.init&&i.i18nFormat.init(this)),this.translator=new k(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];e.emit(t,...r)})),this.modules.external.forEach((e=>{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=z),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const i=f(),a=()=>{const e=(e,t)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?a():setTimeout(a,0),i}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;const n="string"==typeof e?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};n?r(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>r(e))),this.options.preload&&this.options.preload.forEach((e=>r(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const r=f();return e||(e=this.languages),t||(t=this.options.ns),n||(n=z),this.services.backendConnector.reload(e,t,(e=>{r.resolve(),n(e)})),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&E.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=f();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},i=(e,i)=>{i?(o(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,r.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},a=t=>{e||t||!this.services.languageDetector||(t=[]);const n="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,(e=>{i(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e):a(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const o=function(e,t){let i;if("object"!=typeof t){for(var a=arguments.length,u=new Array(a>2?a-2:0),s=2;s<a;s++)u[s-2]=arguments[s];i=r.options.overloadTranslationOptionHandler([e,t].concat(u))}else i={...t};i.lng=i.lng||o.lng,i.lngs=i.lngs||o.lngs,i.ns=i.ns||o.ns,i.keyPrefix=i.keyPrefix||n||o.keyPrefix;const c=r.options.keySeparator||".";let l;return l=i.keyPrefix&&Array.isArray(e)?e.map((e=>`${i.keyPrefix}${c}${e}`)):i.keyPrefix?`${i.keyPrefix}${c}${e}`:e,r.t(l,i)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const i=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||2===n};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!(!this.hasResourceBundle(n,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!i(n,e)||r&&!i(o,e)))}loadNamespaces(e,t){const n=f();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=f();"string"==typeof e&&(e=[e]);const r=this.options.preload||[],o=e.filter((e=>r.indexOf(e)<0));return o.length?(this.options.preload=r.concat(o),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new j(U());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new V(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:z;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new V(r);return void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e)),["store","services","language"].forEach((e=>{o[e]=this[e]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new O(this.store.data,r),o.services.resourceStore=o.store),o.translator=new k(o.services,r),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o.emit(e,...n)})),o.init(r,t),o.translator.options=r,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const G=V.createInstance();function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}G.createInstance=V.createInstance,G.createInstance,G.dir,G.init,G.loadResources,G.reloadResources,G.use,G.changeLanguage,G.getFixedT,G.t,G.exists,G.setDefaultNamespace,G.hasLoadedNamespace,G.loadNamespaces,G.loadLanguages;var q=G.default||G;function W(e,t,n,r){return q.t(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){H(e,t,n[t])}))}return e}({ns:e,defaultValue:n},r))}function $(e,t,n){return a[e]?W("core",e,null!=t?t:a[e],n):(console.error("O3 Core Translations does not provide key '".concat(e,"'. The key itself is being rendered as text.")),e)}q.on("initialized",(function(){window.i18next.loadNamespaces(["core"])}))},9523:()=>{function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function o(e,t,n){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=i(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(n||e):o.value}},o(e,t,n||e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}function u(e,t){return null!=t&&"undefined"!=typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t}function s(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e,t){return c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},c(e,t)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,t)||h(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||h(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function h(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?e(t,n):void 0}}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=i(e);if(t){var o=i(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return s(this,n)}}System.register(["dayjs"],(function(e,n){var c={};return{setters:[function(e){c.default=e.default}],execute:function(){e(function(){var e={6893:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(2712).__exportStar(n(715),t)},2943:function(e,t,n){"use strict";var r=function(e){return Intl.getCanonicalLocales(e)},o=function(e,t){var n=t.zoneNames,r=t.uppercaseLinks,o=e.toUpperCase(),i=n.reduce((function(e,t){return e[t.toUpperCase()]=t,e}),{}),a=r[o]||i[o];return"Etc/UTC"===a||"Etc/GMT"===a?"UTC":a},i=function(e){if("symbol"==(void 0===e?"undefined":d(e)))throw TypeError("Cannot convert a Symbol value to a string");return String(e)},a=function(e){if(void 0===e)return NaN;if(null===e)return 0;if("boolean"==typeof e)return e?1:0;if("number"==typeof e)return e;if("symbol"==(void 0===e?"undefined":d(e))||"bigint"==(void 0===e?"undefined":d(e)))throw new TypeError("Cannot convert symbol/bigint to number");return Number(e)},s=function(e){return isFinite(e)?Math.abs(e)>8640000000000001?NaN:function(e){var t=a(e);if(isNaN(t)||l(t,-0))return 0;if(isFinite(t))return t;var n=Math.floor(Math.abs(t));return t<0&&(n=-n),l(n,-0)?0:n}(e):NaN},c=function(e){if(null==e)throw new TypeError("undefined/null cannot be converted to object");return Object(e)},l=function(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t},f=function(e){return new Array(e)},h=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},p=function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":"symbol"==(void 0===e?"undefined":d(e))?"Symbol":"bigint"==(void 0===e?"undefined":d(e))?"BigInt":void 0},y=function(e,t){return e-Math.floor(e/t)*t},v=function(e){return Math.floor(e/xe)},m=function(e){return y(v(e)+4,7)},g=function(e){return Date.UTC(e,0)/xe},b=function(e){return Date.UTC(e,0)},w=function(e){return new Date(e).getUTCFullYear()},_=function(e){return e%4!=0?365:e%100!=0?366:e%400!=0?365:366},S=function(e){return v(e)-g(w(e))},O=function(e){return 365===_(w(e))?0:1},E=function(e){var t=S(e),n=O(e);if(t>=0&&t<31)return 0;if(t<59+n)return 1;if(t<90+n)return 2;if(t<120+n)return 3;if(t<151+n)return 4;if(t<181+n)return 5;if(t<212+n)return 6;if(t<243+n)return 7;if(t<273+n)return 8;if(t<304+n)return 9;if(t<334+n)return 10;if(t<365+n)return 11;throw new Error("Invalid time")},x=function(e){var t=S(e),n=E(e),r=O(e);if(0===n)return t+1;if(1===n)return t-30;if(2===n)return t-58-r;if(3===n)return t-89-r;if(4===n)return t-119-r;if(5===n)return t-150-r;if(6===n)return t-180-r;if(7===n)return t-211-r;if(8===n)return t-242-r;if(9===n)return t-272-r;if(10===n)return t-303-r;if(11===n)return t-333-r;throw new Error("Invalid time")},k=function(e){return y(Math.floor(e/De),ke)},P=function(e){return y(Math.floor(e/Te),Pe)},j=function(e){return y(Math.floor(e/Ae),je)},A=function(e,t,n){if("function"!=typeof e)return!1;if(null==n?void 0:n.boundTargetFunction)return u(t,null==n?void 0:n.boundTargetFunction);if("object"!=typeof t)return!1;var r=e.prototype;if("object"!=typeof r)throw new TypeError("OrdinaryHasInstance called on an object with an invalid prototype property.");return Object.prototype.isPrototypeOf.call(r,t)},T=function(e){return y(e,Ae)},D=function(e){return void 0===e?Object.create(null):c(e)},C=function(e,t,n,r){if(void 0===e)return r;var o=Number(e);if(isNaN(o)||o<t||o>n)throw new RangeError("".concat(o," is outside of range [").concat(t,", ").concat(n,"]"));return Math.floor(o)},I=function(e,t,n,r,o){return C(e[t],n,r,o)},M=function(e,t,n,r,o){if("object"!=typeof e)throw new TypeError("Options must be an object");var a=e[t];if(void 0!==a){if("boolean"!==n&&"string"!==n)throw new TypeError("invalid type");if("boolean"===n&&(a=Boolean(a)),"string"===n&&(a=i(a)),void 0!==r&&!r.filter((function(e){return e==a})).length)throw new RangeError("".concat(a," is not within ").concat(r.join(", ")));return a}return o},R=function(e){if(void 0===e)return Object.create(null);if("object"==typeof e)return e;throw new TypeError("Options must be an object")},N=function(e,t,n,r,o,a){var u=e[t];if(void 0===u)return a;if(!0===u)return r;if(!1===Boolean(u))return o;if("true"===(u=i(u))||"false"===u)return a;if(-1===(n||[]).indexOf(u))throw new RangeError("Invalid value ".concat(u));return u},L=function(e){return e.slice(e.indexOf("-")+1)},F=function(e){return Ie.indexOf(e)>-1},B=function(e,t){var n=t.zoneNamesFromData,r=t.uppercaseLinks,o=e.toUpperCase(),i=new Set,a=new Set;return n.map((function(e){return e.toUpperCase()})).forEach((function(e){return i.add(e)})),Object.keys(r).forEach((function(e){a.add(e.toUpperCase()),i.add(r[e].toUpperCase())})),i.has(o)||a.has(o)},U=function(e){return 3===(e=e.replace(/([a-z])/g,(function(e,t){return t.toUpperCase()}))).length&&!Me.test(e)},K=function(e){if(F(e=e.replace(/([A-Z])/g,(function(e,t){return t.toLowerCase()}))))return!0;var t=e.split("-per-");if(2!==t.length)return!1;var n=t[0],r=t[1];return!(!F(n)||!F(r))},z=function(e,t,n,r){if(e===t)return t;if(void 0===r)throw new Error("unsignedRoundingMode is mandatory");if("zero"===r)return t;if("infinity"===r)return n;var o=e-t,i=n-e;if(o<i)return t;if(i<o)return n;if(o!==i)throw new Error("Unexpected error");if("half-zero"===r)return t;if("half-infinity"===r)return n;if("half-even"!==r)throw new Error("Unexpected value for unsignedRoundingMode: ".concat(r));return 0==t/(n-t)%2?t:n},V=function(e){return e},G=function(e){return Math.floor(Math.log(e)*Math.LOG10E)},H=function(e,t){if("function"==typeof e.repeat)return e.repeat(t);for(var n=new Array(t),r=0;r<n.length;r++)n[r]=e;return n.join("")},q=function(e,t,n,r){e.get(t)||e.set(t,Object.create(null)),e.get(t)[n]=r},W=function(e,t,n){for(var r=0,o=Object.keys(n);r<o.length;r++){var i=o[r];q(e,t,i,n[i])}},$=function(e,t,n){return Y(e,t,n)[n]},Y=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=e.get(t);if(!o)throw new TypeError("".concat(t," InternalSlot has not been initialized"));return n.reduce((function(e,t){return e[t]=o[t],e}),Object.create(null))},J=function(e){return"literal"===e.type},Q=function(e,t,n){var r=n.value;Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:!0,value:r})},Z=function(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n})},X=function(e,t,n){if(void 0===n&&(n=Error),!e)throw new n(t)},ee=function(e,t,n){var r=(0,n.getInternalSlots)(e),o=r.notation,i=r.dataLocaleData,a=r.numberingSystem;switch(o){case"standard":return 0;case"scientific":return t;case"engineering":return 3*Math.floor(t/3);default:var u=r.compactDisplay,s=r.style,c=r.currencyDisplay,l=void 0;if("currency"===s&&"name"!==c)l=(i.numbers.currency[a]||i.numbers.currency[i.numbers.nu[0]]).short;else{var f=i.numbers.decimal[a]||i.numbers.decimal[i.numbers.nu[0]];l="long"===u?f.long:f.short}if(!l)return 0;var d=String(Math.pow(10,t)),h=Object.keys(l);if(d<h[0])return 0;if(d>h[h.length-1])return h[h.length-1].length-1;var p=h.indexOf(d);if(-1===p)return 0;var y=h[p];return"0"===l[y].other?0:y.length-l[y].other.match(/0+/)[0].length}},te=function(e,t,n){var r,o,i,a,u=n;if(0===e)r=H("0",u),o=0,i=0;else{var s=e.toString(),c=s.indexOf("e"),l=s.split("e"),f=l[0],d=l[1],h=f.replace(".","");if(c>=0&&h.length<=u)o=+d,r=h+H("0",u-h.length),i=e;else{var p=(o=G(e))-u+1,y=Math.round(m(e,p));m(y,u-1)>=10&&(o+=1,y=Math.floor(y/10)),r=y.toString(),i=m(y,u-1-o)}}if(o>=u-1?(r+=H("0",o-u+1),a=o+1):o>=0?(r="".concat(r.slice(0,o+1),".").concat(r.slice(o+1)),a=o+1):(r="0.".concat(H("0",-o-1)).concat(r),a=1),r.indexOf(".")>=0&&n>t){for(var v=n-t;v>0&&"0"===r[r.length-1];)r=r.slice(0,-1),v--;"."===r[r.length-1]&&(r=r.slice(0,-1))}return{formattedString:r,roundedNumber:i,integerDigitsCount:a};function m(e,t){return t<0?e*Math.pow(10,-t):e/Math.pow(10,t)}},ne=function(e,t,n){var r,o,i=n,a=Math.round(e*Math.pow(10,i)),u=a/Math.pow(10,i);if(a<1e21)r=a.toString();else{var s=(r=a.toString()).split("e"),c=s[0],l=s[1];r=c.replace(".",""),r+=H("0",Math.max(+l-r.length+1,0))}if(0!==i){var f=r.length;f<=i&&(r=H("0",i+1-f)+r,f=i+1);var d=r.slice(0,f-i),h=r.slice(f-i);r="".concat(d,".").concat(h),o=d.length}else o=r.length;for(var p=n-t;p>0&&"0"===r[r.length-1];)r=r.slice(0,-1),p--;return"."===r[r.length-1]&&(r=r.slice(0,-1)),{formattedString:r,roundedNumber:u,integerDigitsCount:o}},re=function(e,t){var n,r=t<0||l(t,-0);switch(r&&(t=-t),e.roundingType){case"significantDigits":n=te(t,e.minimumSignificantDigits,e.maximumSignificantDigits);break;case"fractionDigits":n=ne(t,e.minimumFractionDigits,e.maximumFractionDigits);break;default:(n=te(t,1,2)).integerDigitsCount>1&&(n=ne(t,0,0))}t=n.roundedNumber;var o=n.formattedString,i=n.integerDigitsCount,a=e.minimumIntegerDigits;return i<a&&(o=H("0",a-i)+o),r&&(t=-t),{roundedNumber:t,formattedString:o}},oe=function(e,t,n){var r=n.getInternalSlots;if(0===t)return[0,0];t<0&&(t=-t);var o=G(t),i=ee(e,o,{getInternalSlots:r});t=i<0?t*Math.pow(10,-i):t/Math.pow(10,i);var a=re(r(e),t);return 0===a.roundedNumber||G(a.roundedNumber)===o-i?[i,o]:[ee(e,o+1,{getInternalSlots:r}),o+1]},ie=function(e,t){var n=t.currencyDigitsData;return h(n,e)?n[e]:2},ae=function(e,t,n){var r=(0,n.getInternalSlots)(e),o=r.dataLocaleData.numbers.symbols[r.numberingSystem].approximatelySign;return t.push({type:"approximatelySign",value:o}),t},ue=function(e,t,n,r){var o,i,a=e.sign,u=e.exponent,s=e.magnitude,c=r.notation,l=r.style,f=r.numberingSystem,d=t.numbers.nu[0],h=null;if("compact"===c&&s&&(h=function(e,t,n,r,o,i,a){var u,s,c=e.roundedNumber,l=e.sign,f=e.magnitude,d=String(Math.pow(10,f)),h=n.numbers.nu[0];if("currency"===r&&"name"!==i){var p=null===(u=((y=n.numbers.currency)[a]||y[h]).short)||void 0===u?void 0:u[d];if(!p)return null;s=le(t,c,p)}else{var y,v=((y=n.numbers.decimal)[a]||y[h])[o][d];if(!v)return null;s=le(t,c,v)}return"0"===s?null:s=ce(s,l).replace(/([^\s;\-\+\d¤]+)/g,"{c:$1}").replace(/0+/,"0")}(e,n,t,l,r.compactDisplay,r.currencyDisplay,f)),"currency"===l&&"name"!==r.currencyDisplay){var p=t.currencies[r.currency];if(p)switch(r.currencyDisplay){case"code":o=r.currency;break;case"symbol":o=p.symbol;break;default:o=p.narrow}else o=r.currency}i=h||("decimal"===l||"unit"===l||"currency"===l&&"name"===r.currencyDisplay?ce((t.numbers.decimal[f]||t.numbers.decimal[d]).standard,a):ce("currency"===l?(v=t.numbers.currency[f]||t.numbers.currency[d])[r.currencySign]:t.numbers.percent[f]||t.numbers.percent[d],a));var y=Be.exec(i)[0];if(i=i.replace(Be,"{0}").replace(/'(.)'/g,"$1"),"currency"===l&&"name"!==r.currencyDisplay){var v,m=(v=t.numbers.currency[f]||t.numbers.currency[d]).currencySpacing.afterInsertBetween;m&&!Fe.test(o)&&(i=i.replace("¤{0}","¤".concat(m,"{0}")));var g=v.currencySpacing.beforeInsertBetween;g&&!Le.test(o)&&(i=i.replace("{0}¤","{0}".concat(g,"¤")))}for(var b=i.split(/({c:[^}]+}|\{0\}|[¤%\-\+])/g),w=[],_=t.numbers.symbols[f]||t.numbers.symbols[d],S=0,O=b;S<O.length;S++)if(z=O[S])switch(z){case"{0}":w.push.apply(w,se(_,e,c,u,f,!h&&Boolean(r.useGrouping),y,l));break;case"-":w.push({type:"minusSign",value:_.minusSign});break;case"+":w.push({type:"plusSign",value:_.plusSign});break;case"%":w.push({type:"percentSign",value:_.percentSign});break;case"¤":w.push({type:"currency",value:o});break;default:/^\{c:/.test(z)?w.push({type:"compact",value:z.substring(3,z.length-1)}):w.push({type:"literal",value:z})}switch(l){case"currency":if("name"===r.currencyDisplay){var E,x=(t.numbers.currency[f]||t.numbers.currency[d]).unitPattern,k=t.currencies[r.currency];E=k?le(n,e.roundedNumber*Math.pow(10,u),k.displayName):r.currency;for(var P=[],j=0,A=x.split(/(\{[01]\})/g);j<A.length;j++)switch(z=A[j]){case"{0}":P.push.apply(P,w);break;case"{1}":P.push({type:"currency",value:E});break;default:z&&P.push({type:"literal",value:z})}return P}return w;case"unit":var T=r.unit,D=r.unitDisplay,C=t.units.simple[T];if(x=void 0,C)x=le(n,e.roundedNumber*Math.pow(10,u),t.units.simple[T][D]);else{var I=T.split("-per-"),M=I[0],R=I[1];C=t.units.simple[M];var N=le(n,e.roundedNumber*Math.pow(10,u),t.units.simple[M][D]),L=t.units.simple[R].perUnit[D];if(L)x=L.replace("{0}",N);else{var F=t.units.compound.per[D],B=le(n,1,t.units.simple[R][D]);x=x=F.replace("{0}",N).replace("{1}",B.replace("{0}",""))}}P=[];for(var U=0,K=x.split(/(\s*\{0\}\s*)/);U<K.length;U++){var z=K[U],V=/^(\s*)\{0\}(\s*)$/.exec(z);V?(V[1]&&P.push({type:"literal",value:V[1]}),P.push.apply(P,w),V[2]&&P.push({type:"literal",value:V[2]})):z&&P.push({type:"unit",value:z})}return P;default:return w}},se=function(e,t,n,r,o,i,a,u){var s=[],c=t.formattedString,l=t.roundedNumber;if(isNaN(l))return[{type:"nan",value:c}];if(!isFinite(l))return[{type:"infinity",value:c}];var f=Ne[o];f&&(c=c.replace(/\d/g,(function(e){return f[+e]||e})));var d,h,p=c.indexOf(".");if(p>0?(d=c.slice(0,p),h=c.slice(p+1)):d=c,i&&("compact"!==n||l>=1e4)){var y="currency"===u&&null!=e.currencyGroup?e.currencyGroup:e.group,v=[],m=a.split(".")[0].split(","),g=3,b=3;m.length>1&&(g=m[m.length-1].length),m.length>2&&(b=m[m.length-2].length);var w=d.length-g;if(w>0){for(v.push(d.slice(w,w+g)),w-=b;w>0;w-=b)v.push(d.slice(w,w+b));v.push(d.slice(0,w+b))}else v.push(d);for(;v.length>0;){var _=v.pop();s.push({type:"integer",value:_}),v.length>0&&s.push({type:"group",value:y})}}else s.push({type:"integer",value:d});if(void 0!==h){var S="currency"===u&&null!=e.currencyDecimal?e.currencyDecimal:e.decimal;s.push({type:"decimal",value:S},{type:"fraction",value:h})}if(("scientific"===n||"engineering"===n)&&isFinite(l)){s.push({type:"exponentSeparator",value:e.exponential}),r<0&&(s.push({type:"exponentMinusSign",value:e.minusSign}),r=-r);var O=ne(r,0,0);s.push({type:"exponentInteger",value:O.formattedString})}return s},ce=function(e,t){e.indexOf(";")<0&&(e="".concat(e,";-").concat(e));var n=e.split(";"),r=n[0],o=n[1];switch(t){case 0:return r;case-1:return o;default:return o.indexOf("-")>=0?o.replace(/-/g,"+"):"+".concat(r)}},le=function(e,t,n){return n[e.select(t)]||n.other},fe=function(e,t,n){var r,o,i,a=n.getInternalSlots,u=a(e),s=u.pl,c=u.dataLocaleData,f=u.numberingSystem,d=c.numbers.symbols[f]||c.numbers.symbols[c.numbers.nu[0]],h=0,p=0;if(isNaN(t))o=d.nan;else if(t==Number.POSITIVE_INFINITY||t==Number.NEGATIVE_INFINITY)o=d.infinity;else{if(!l(t,-0)){if(!isFinite(t))throw new Error("Input must be a mathematical value");"percent"==u.style&&(t*=100),p=(r=oe(e,t,{getInternalSlots:a}))[0],h=r[1],t=p<0?t*Math.pow(10,-p):t/Math.pow(10,p)}var y=re(u,t);o=y.formattedString,t=y.roundedNumber}switch(u.signDisplay){case"never":i=0;break;case"auto":i=l(t,0)||t>0||isNaN(t)?0:-1;break;case"always":i=l(t,0)||t>0||isNaN(t)?1:-1;break;default:i=0===t||isNaN(t)?0:t>0?1:-1}return ue({roundedNumber:t,formattedString:o,exponent:p,magnitude:h,sign:i},u.dataLocaleData,s,u)},de=function(e,t,n,r){var o=r.getInternalSlots;if(isNaN(t)||isNaN(n))throw new RangeError("Input must be a number");var i=[],a=fe(e,t,{getInternalSlots:o}),u=fe(e,n,{getInternalSlots:o});if(a===u)return ae(e,a,{getInternalSlots:o});for(var s=0,c=a;s<c.length;s++)c[s].source="startRange";i=i.concat(a);var l=o(e),f=l.dataLocaleData.numbers.symbols[l.numberingSystem];i.push({type:"literal",value:f.rangeSign,source:"shared"});for(var d=0,h=u;d<h.length;d++)h[d].source="endRange";return i.concat(u)},he=function(e,t,n,r){return de(e,t,n,{getInternalSlots:r.getInternalSlots}).map((function(e){return e.value})).join("")},pe=function(e,t,n,r){return de(e,t,n,{getInternalSlots:r.getInternalSlots}).map((function(e,t){return{type:e.type,value:e.value,source:e.source,result:t.toString()}}))},ye=function(e,t,n){for(var r=fe(e,t,n),o=f(0),i=0,a=r;i<a.length;i++){var u=a[i];o.push({type:u.type,value:u.value})}return o},ve=function(e,t){return t?Ue[e]:Ke[e]},me=function(e,t,n,r,o){var i=I(t,"minimumIntegerDigits",1,21,1),a=t.minimumFractionDigits,u=t.maximumFractionDigits,s=t.minimumSignificantDigits,c=t.maximumSignificantDigits;e.minimumIntegerDigits=i;var l=M(t,"roundingPriority","string",["auto","morePrecision","lessPrecision"],"auto"),f=void 0!==s||void 0!==c,d=void 0!==a||void 0!==u,h=!0,p=!0;if("auto"===l&&(h=f,(f||!d&&"compact"===o)&&(p=!1)),h&&(f?(s=C(s,1,21,1),c=C(c,s,21,21),e.minimumSignificantDigits=s,e.maximumSignificantDigits=c):(e.minimumSignificantDigits=1,e.maximumSignificantDigits=21)),p)if(d){if(a=C(a,0,20,void 0),u=C(u,0,20,void 0),void 0===a)a=Math.min(n,u);else if(void 0===u)u=Math.max(r,a);else if(a>u)throw new RangeError("Invalid range, ".concat(a," > ").concat(u));e.minimumFractionDigits=a,e.maximumFractionDigits=u}else e.minimumFractionDigits=n,e.maximumFractionDigits=r;h||p?e.roundingType="morePrecision"===l?"morePrecision":"lessPrecision"===l?"lessPrecision":f?"significantDigits":"fractionDigits":(e.roundingType="morePrecision",e.minimumFractionDigits=0,e.maximumFractionDigits=0,e.minimumSignificantDigits=1,e.maximumSignificantDigits=2)},ge=function(e,t,n){void 0===t&&(t=Object.create(null));var r=(0,n.getInternalSlots)(e),o=M(t,"style","string",["decimal","percent","currency","unit"],"decimal");r.style=o;var i=M(t,"currency","string",void 0,void 0);if(void 0!==i&&!U(i))throw RangeError("Malformed currency code");if("currency"===o&&void 0===i)throw TypeError("currency cannot be undefined");var a=M(t,"currencyDisplay","string",["code","symbol","narrowSymbol","name"],"symbol"),u=M(t,"currencySign","string",["standard","accounting"],"standard"),s=M(t,"unit","string",void 0,void 0);if(void 0!==s&&!K(s))throw RangeError("Invalid unit argument for Intl.NumberFormat()");if("unit"===o&&void 0===s)throw TypeError("unit cannot be undefined");var c=M(t,"unitDisplay","string",["short","narrow","long"],"short");"currency"===o&&(r.currency=i.toUpperCase(),r.currencyDisplay=a,r.currencySign=u),"unit"===o&&(r.unit=s,r.unitDisplay=c)},be=function(e,t,n,o){var i=o.getInternalSlots,a=o.localeData,u=o.availableLocales,s=o.numberingSystemNames,c=o.getDefaultLocale,l=o.currencyDigitsData,f=r(t),d=D(n),h=Object.create(null),p=M(d,"localeMatcher","string",["lookup","best fit"],"best fit");h.localeMatcher=p;var y=M(d,"numberingSystem","string",void 0,void 0);if(void 0!==y&&s.indexOf(y)<0)throw RangeError("Invalid numberingSystems: ".concat(y));h.nu=y;var v=(0,ze.ResolveLocale)(Array.from(u),f,h,["nu"],a,c),m=a[v.dataLocale];X(!!m,"Missing locale data for ".concat(v.dataLocale));var g=i(e);g.locale=v.locale,g.dataLocale=v.dataLocale,g.numberingSystem=v.nu,g.dataLocaleData=m,ge(e,d,{getInternalSlots:i});var b,w,_=g.style;if("currency"===_){var S=ie(g.currency,{currencyDigitsData:l});b=S,w=S}else b=0,w="percent"===_?0:3;var O=M(d,"notation","string",["standard","scientific","engineering","compact"],"standard");g.notation=O,me(g,d,b,w,O);var E=I(d,"roundingIncrement",1,5e3,1);if(-1===Ve.indexOf(E))throw new RangeError("Invalid rounding increment value: ".concat(E,".\nValid values are ").concat(Ve,"."));if(1!==E&&"fractionDigits"!==g.roundingType)throw new TypeError("For roundingIncrement > 1 only fractionDigits is a valid roundingType");if(1!==E&&g.maximumFractionDigits!==g.minimumFractionDigits)throw new RangeError("With roundingIncrement > 1, maximumFractionDigits and minimumFractionDigits must be equal.");g.roundingIncrement=E;var x=M(d,"trailingZeroDisplay","string",["auto","stripIfInteger"],"auto");g.trailingZeroDisplay=x;var k=M(d,"compactDisplay","string",["short","long"],"short"),P="auto";return"compact"===O&&(g.compactDisplay=k,P="min2"),g.useGrouping=N(d,"useGrouping",["min2","auto","always"],"always",!1,P),g.signDisplay=M(d,"signDisplay","string",["auto","never","always","exceptZero","negative"],"auto"),g.roundingMode=M(d,"roundingMode","string",["ceil","floor","expand","trunc","halfCeil","halfFloor","halfExpand","halfTrunc","halfEven"],"halfExpand"),e},we=function(e){for(var t=[],n=e.indexOf("{"),r=0,o=0,i=e.length;n<e.length&&n>-1;)X((r=e.indexOf("}",n))>n,"Invalid pattern ".concat(e)),n>o&&t.push({type:"literal",value:e.substring(o,n)}),t.push({type:e.substring(n+1,r),value:void 0}),o=r+1,n=e.indexOf("{",o);return o<i&&t.push({type:"literal",value:e.substring(o,i)}),t},_e=function(e,t,n){return void 0!==n&&M(n=c(n),"localeMatcher","string",["lookup","best fit"],"best fit"),(0,ze.LookupSupportedLocales)(Array.from(e),t)},Se=function(e){return"MISSING_LOCALE_DATA"===e.type};n.r(t),n.d(t,{ApplyUnsignedRoundingMode:function(){return z},ArrayCreate:function(){return f},CanonicalizeLocaleList:function(){return r},CanonicalizeTimeZoneName:function(){return o},CoerceOptionsToObject:function(){return D},CollapseNumberRange:function(){return V},ComputeExponent:function(){return oe},ComputeExponentForMagnitude:function(){return ee},CurrencyDigits:function(){return ie},DateFromTime:function(){return x},Day:function(){return v},DayFromYear:function(){return g},DayWithinYear:function(){return S},DaysInYear:function(){return _},FormatApproximately:function(){return ae},FormatNumericRange:function(){return he},FormatNumericRangeToParts:function(){return pe},FormatNumericToParts:function(){return ye},FormatNumericToString:function(){return re},GetNumberOption:function(){return I},GetOption:function(){return M},GetOptionsObject:function(){return R},GetStringOrBooleanOption:function(){return N},GetUnsignedRoundingMode:function(){return ve},HasOwnProperty:function(){return h},HourFromTime:function(){return k},InLeapYear:function(){return O},InitializeNumberFormat:function(){return be},IsSanctionedSimpleUnitIdentifier:function(){return F},IsValidTimeZoneName:function(){return B},IsWellFormedCurrencyCode:function(){return U},IsWellFormedUnitIdentifier:function(){return K},MinFromTime:function(){return P},MonthFromTime:function(){return E},OrdinaryHasInstance:function(){return A},PartitionNumberPattern:function(){return fe},PartitionNumberRangePattern:function(){return de},PartitionPattern:function(){return we},RangePatternType:function(){return Oe},SANCTIONED_UNITS:function(){return Ce},SIMPLE_UNITS:function(){return Ie},SameValue:function(){return l},SecFromTime:function(){return j},SetNumberFormatDigitOptions:function(){return me},SetNumberFormatUnitOptions:function(){return ge},SupportedLocales:function(){return _e},TimeClip:function(){return s},TimeFromYear:function(){return b},ToNumber:function(){return a},ToObject:function(){return c},ToRawFixed:function(){return ne},ToRawPrecision:function(){return te},ToString:function(){return i},Type:function(){return p},WeekDay:function(){return m},YearFromTime:function(){return w},_formatToParts:function(){return ue},createDataProperty:function(){return Z},defineProperty:function(){return Q},getInternalSlot:function(){return $},getMagnitude:function(){return G},getMultiInternalSlots:function(){return Y},invariant:function(){return X},isLiteralPart:function(){return J},isMissingLocaleDataError:function(){return Se},msFromTime:function(){return T},removeUnitNamespace:function(){return L},setInternalSlot:function(){return q},setMultiInternalSlots:function(){return W}});var Oe,Ee,xe=864e5,ke=24,Pe=60,je=60,Ae=1e3,Te=Ae*je,De=Te*Pe,Ce=["angle-degree","area-acre","area-hectare","concentr-percent","digital-bit","digital-byte","digital-gigabit","digital-gigabyte","digital-kilobit","digital-kilobyte","digital-megabit","digital-megabyte","digital-petabyte","digital-terabit","digital-terabyte","duration-day","duration-hour","duration-millisecond","duration-minute","duration-month","duration-second","duration-week","duration-year","length-centimeter","length-foot","length-inch","length-kilometer","length-meter","length-mile-scandinavian","length-mile","length-millimeter","length-yard","mass-gram","mass-kilogram","mass-ounce","mass-pound","mass-stone","temperature-celsius","temperature-fahrenheit","volume-fluid-ounce","volume-gallon","volume-liter","volume-milliliter"],Ie=Ce.map(L),Me=/[^A-Z]/,Re=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/,Ne={adlm:["𞥐","𞥑","𞥒","𞥓","𞥔","𞥕","𞥖","𞥗","𞥘","𞥙"],ahom:["𑜰","𑜱","𑜲","𑜳","𑜴","𑜵","𑜶","𑜷","𑜸","𑜹"],arab:["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],arabext:["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],bali:["᭐","᭑","᭒","᭓","᭔","᭕","᭖","᭗","᭘","᭙"],beng:["০","১","২","৩","৪","৫","৬","৭","৮","৯"],bhks:["𑱐","𑱑","𑱒","𑱓","𑱔","𑱕","𑱖","𑱗","𑱘","𑱙"],brah:["𑁦","𑁧","𑁨","𑁩","𑁪","𑁫","𑁬","𑁭","𑁮","𑁯"],cakm:["𑄶","𑄷","𑄸","𑄹","𑄺","𑄻","𑄼","𑄽","𑄾","𑄿"],cham:["꩐","꩑","꩒","꩓","꩔","꩕","꩖","꩗","꩘","꩙"],deva:["०","१","२","३","४","५","६","७","८","९"],diak:["𑥐","𑥑","𑥒","𑥓","𑥔","𑥕","𑥖","𑥗","𑥘","𑥙"],fullwide:["0","1","2","3","4","5","6","7","8","9"],gong:["𑶠","𑶡","𑶢","𑶣","𑶤","𑶥","𑶦","𑶧","𑶨","𑶩"],gonm:["𑵐","𑵑","𑵒","𑵓","𑵔","𑵕","𑵖","𑵗","𑵘","𑵙"],gujr:["૦","૧","૨","૩","૪","૫","૬","૭","૮","૯"],guru:["੦","੧","੨","੩","੪","੫","੬","੭","੮","੯"],hanidec:["〇","一","二","三","四","五","六","七","八","九"],hmng:["𖭐","𖭑","𖭒","𖭓","𖭔","𖭕","𖭖","𖭗","𖭘","𖭙"],hmnp:["𞅀","𞅁","𞅂","𞅃","𞅄","𞅅","𞅆","𞅇","𞅈","𞅉"],java:["꧐","꧑","꧒","꧓","꧔","꧕","꧖","꧗","꧘","꧙"],kali:["꤀","꤁","꤂","꤃","꤄","꤅","꤆","꤇","꤈","꤉"],khmr:["០","១","២","៣","៤","៥","៦","៧","៨","៩"],knda:["೦","೧","೨","೩","೪","೫","೬","೭","೮","೯"],lana:["᪀","᪁","᪂","᪃","᪄","᪅","᪆","᪇","᪈","᪉"],lanatham:["᪐","᪑","᪒","᪓","᪔","᪕","᪖","᪗","᪘","᪙"],laoo:["໐","໑","໒","໓","໔","໕","໖","໗","໘","໙"],lepc:["᪐","᪑","᪒","᪓","᪔","᪕","᪖","᪗","᪘","᪙"],limb:["᥆","᥇","᥈","᥉","᥊","᥋","᥌","᥍","᥎","᥏"],mathbold:["𝟎","𝟏","𝟐","𝟑","𝟒","𝟓","𝟔","𝟕","𝟖","𝟗"],mathdbl:["𝟘","𝟙","𝟚","𝟛","𝟜","𝟝","𝟞","𝟟","𝟠","𝟡"],mathmono:["𝟶","𝟷","𝟸","𝟹","𝟺","𝟻","𝟼","𝟽","𝟾","𝟿"],mathsanb:["𝟬","𝟭","𝟮","𝟯","𝟰","𝟱","𝟲","𝟳","𝟴","𝟵"],mathsans:["𝟢","𝟣","𝟤","𝟥","𝟦","𝟧","𝟨","𝟩","𝟪","𝟫"],mlym:["൦","൧","൨","൩","൪","൫","൬","൭","൮","൯"],modi:["𑙐","𑙑","𑙒","𑙓","𑙔","𑙕","𑙖","𑙗","𑙘","𑙙"],mong:["᠐","᠑","᠒","᠓","᠔","᠕","᠖","᠗","᠘","᠙"],mroo:["𖩠","𖩡","𖩢","𖩣","𖩤","𖩥","𖩦","𖩧","𖩨","𖩩"],mtei:["꯰","꯱","꯲","꯳","꯴","꯵","꯶","꯷","꯸","꯹"],mymr:["၀","၁","၂","၃","၄","၅","၆","၇","၈","၉"],mymrshan:["႐","႑","႒","႓","႔","႕","႖","႗","႘","႙"],mymrtlng:["꧰","꧱","꧲","꧳","꧴","꧵","꧶","꧷","꧸","꧹"],newa:["𑑐","𑑑","𑑒","𑑓","𑑔","𑑕","𑑖","𑑗","𑑘","𑑙"],nkoo:["߀","߁","߂","߃","߄","߅","߆","߇","߈","߉"],olck:["᱐","᱑","᱒","᱓","᱔","᱕","᱖","᱗","᱘","᱙"],orya:["୦","୧","୨","୩","୪","୫","୬","୭","୮","୯"],osma:["𐒠","𐒡","𐒢","𐒣","𐒤","𐒥","𐒦","𐒧","𐒨","𐒩"],rohg:["𐴰","𐴱","𐴲","𐴳","𐴴","𐴵","𐴶","𐴷","𐴸","𐴹"],saur:["꣐","꣑","꣒","꣓","꣔","꣕","꣖","꣗","꣘","꣙"],segment:["🯰","🯱","🯲","🯳","🯴","🯵","🯶","🯷","🯸","🯹"],shrd:["𑇐","𑇑","𑇒","𑇓","𑇔","𑇕","𑇖","𑇗","𑇘","𑇙"],sind:["𑋰","𑋱","𑋲","𑋳","𑋴","𑋵","𑋶","𑋷","𑋸","𑋹"],sinh:["෦","෧","෨","෩","෪","෫","෬","෭","෮","෯"],sora:["𑃰","𑃱","𑃲","𑃳","𑃴","𑃵","𑃶","𑃷","𑃸","𑃹"],sund:["᮰","᮱","᮲","᮳","᮴","᮵","᮶","᮷","᮸","᮹"],takr:["𑛀","𑛁","𑛂","𑛃","𑛄","𑛅","𑛆","𑛇","𑛈","𑛉"],talu:["᧐","᧑","᧒","᧓","᧔","᧕","᧖","᧗","᧘","᧙"],tamldec:["௦","௧","௨","௩","௪","௫","௬","௭","௮","௯"],telu:["౦","౧","౨","౩","౪","౫","౬","౭","౮","౯"],thai:["๐","๑","๒","๓","๔","๕","๖","๗","๘","๙"],tibt:["༠","༡","༢","༣","༤","༥","༦","༧","༨","༩"],tirh:["𑓐","𑓑","𑓒","𑓓","𑓔","𑓕","𑓖","𑓗","𑓘","𑓙"],vaii:["ᘠ","ᘡ","ᘢ","ᘣ","ᘤ","ᘥ","ᘦ","ᘧ","ᘨ","ᘩ"],wara:["𑣠","𑣡","𑣢","𑣣","𑣤","𑣥","𑣦","𑣧","𑣨","𑣩"],wcho:["𞋰","𞋱","𞋲","𞋳","𞋴","𞋵","𞋶","𞋷","𞋸","𞋹"]},Le=new RegExp("^".concat(Re.source)),Fe=new RegExp("".concat(Re.source,"$")),Be=/[#0](?:[\.,][#0]+)*/g,Ue={ceil:"zero",floor:"infinity",expand:"infinity",trunc:"zero",halfCeil:"half-zero",halfFloor:"half-infinity",halfExpand:"half-infinity",halfTrunc:"half-zero",halfEven:"half-even"},Ke={ceil:"infinity",floor:"zero",expand:"infinity",trunc:"zero",halfCeil:"half-infinity",halfFloor:"half-zero",halfExpand:"half-infinity",halfTrunc:"half-zero",halfEven:"half-even"},ze=n(3367),Ve=[1,2,5,10,20,25,50,100,200,250,500,1e3,2e3],Ge=n(2712);Ee=Error,(0,Ge.__extends)((function(){var e=null!==Ee&&Ee.apply(this,arguments)||this;return e.type="MISSING_LOCALE_DATA",e}),Ee),function(e){e.startRange="startRange",e.shared="shared",e.endRange="endRange"}(Oe||(Oe={}))},6979:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DurationRecordSign=void 0;var r=n(2552);t.DurationRecordSign=function(e){for(var t=0,n=r.TABLE_1;t<n.length;t++){var o=n[t];if(e[o]<0)return-1;if(e[o]>0)return 1}return 0}},7332:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetDurationUnitOptions=void 0;var r=n(2943);t.GetDurationUnitOptions=function(e,t,n,o,i,a){var u=(0,r.GetOption)(t,e,"string",o,void 0),s="always";void 0===u&&("digital"===n?("hours"!==e&&"minutes"!==e&&"seconds"!==e&&(s="auto"),u=i):(s="auto",u="numeric"===a||"2-digit"===a?"numeric":n));var c="".concat(e,"Display"),l=(0,r.GetOption)(t,c,"string",["always","auto"],s);if("numeric"===a||"2-digit"===a){if("numeric"!==u&&"2-digit"!==u)throw new RangeError("Can't mix numeric and non-numeric styles");if("minutes"!==e&&"seconds"!==e||(u="2-digit"),"numeric"===u&&"always"===l&&("milliseconds"===e||"microseconds"===e||"nanoseconds"===e))throw new RangeError("Can't display milliseconds, microseconds, or nanoseconds in numeric format")}return{style:u,display:l}}},1076:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IsValidDurationRecord=void 0;var r=n(2943),o=n(2552),i=n(6979);t.IsValidDurationRecord=function(e){for(var t=(0,i.DurationRecordSign)(e),n=0,a=o.TABLE_1;n<a.length;n++){var u=a[n],s=e[u];if((0,r.invariant)(isFinite(Number(s)),"".concat(u," is not finite")),s<0&&t>0)return!1;if(s>0&&t<0)return!1}return!0}},984:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PartitionDurationFormatPattern=void 0;var r=n(2943),o=n(2552),i=n(715),a=n(6732);t.PartitionDurationFormatPattern=function(e,t){var n=[],u=!1,s=!1,c=(0,a.getInternalSlots)(e),l=c.dataLocale,f=i.DurationFormat.localeData[l];if(!f)throw new TypeError("Invalid locale");for(var d=c.numberingSystem,h=f.digitalFormat[d],p=function(e){var r=o.TABLE_2[e],i=t[r.valueField],a=c[r.styleSlot],l=c[r.displaySlot],f=r.unit,d=r.numberFormatUnit,p=Object.create(null);if("seconds"!==f&&"milliseconds"!==f&&"microseconds"!==f||"numeric"===("seconds"===f?c.milliseconds:"milliseconds"===f?c.microseconds:c.nanoseconds)&&(i+="seconds"===f?t.milliseconds/1e3+t.microseconds/1e6+t.nanoseconds/1e9:"milliseconds"===f?t.microseconds/1e3+t.nanoseconds/1e6:t.nanoseconds/1e3,void 0===c.fractionalDigits?(p.maximumFractionDigits=9,p.minimumFractionDigits=0):(p.maximumFractionDigits=c.fractionalDigits,p.minimumFractionDigits=c.fractionalDigits),p.roundingMode="trunc",u=!0),0!==i||"auto"!==l){p.numberingSystem=c.numberingSystem,"2-digit"===a&&(p.minimumIntegerDigits=2),"2-digit"!==a&&"numeric"!==a&&(p.style="unit",p.unit=d,p.unitDisplay=a);var y,v=new Intl.NumberFormat(c.locale,p);s?(y=n[n.length-1]).push({type:"literal",value:h}):y=[],v.formatToParts(i).forEach((function(e){var t=e.type,n=e.value;y.push({type:t,value:n,unit:d})})),s||("2-digit"!==a&&"numeric"!==a||(s=!0),n.push(y))}else s=!1},y=0;y<o.TABLE_2.length&&!u;y++)p(y);var v=Object.create(null);v.type="unit";var m=c.style;"digital"===m&&(m="short"),v.style=m;for(var g=new Intl.ListFormat(c.locale,v),b=[],w=0,_=n;w<_.length;w++){for(var S="",O=0,E=_[w];O<E.length;O++)S+=I=E[O].value;b.push(S)}for(var x=g.formatToParts(b),k=0,P=n.length,j=[],A=0,T=x;A<T.length;A++){var D=T[A],C=D.type,I=D.value;if("element"===C){(0,r.invariant)(k<P,"Index out of bounds");for(var M=0,R=n[k];M<R.length;M++){var N=R[M];j.push(N)}k++}else(0,r.invariant)("literal"===C,"Type must be literal"),j.push({type:"literal",value:I})}return j}},8905:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToDurationRecord=void 0;var r=n(1076),o=n(1370);t.ToDurationRecord=function(e){if("object"!=typeof e){if("string"==typeof e)throw new RangeError("Invalid duration format");throw new TypeError("Invalid duration")}var t={years:0,months:0,weeks:0,days:0,hours:0,minutes:0,seconds:0,milliseconds:0,microseconds:0,nanoseconds:0};if(void 0!==e.days&&(t.days=(0,o.ToIntegerIfIntegral)(e.days)),void 0!==e.hours&&(t.hours=(0,o.ToIntegerIfIntegral)(e.hours)),void 0!==e.microseconds&&(t.microseconds=(0,o.ToIntegerIfIntegral)(e.microseconds)),void 0!==e.milliseconds&&(t.milliseconds=(0,o.ToIntegerIfIntegral)(e.milliseconds)),void 0!==e.minutes&&(t.minutes=(0,o.ToIntegerIfIntegral)(e.minutes)),void 0!==e.months&&(t.months=(0,o.ToIntegerIfIntegral)(e.months)),void 0!==e.nanoseconds&&(t.nanoseconds=(0,o.ToIntegerIfIntegral)(e.nanoseconds)),void 0!==e.seconds&&(t.seconds=(0,o.ToIntegerIfIntegral)(e.seconds)),void 0!==e.weeks&&(t.weeks=(0,o.ToIntegerIfIntegral)(e.weeks)),void 0!==e.years&&(t.years=(0,o.ToIntegerIfIntegral)(e.years)),void 0===e.years&&void 0===e.months&&void 0===e.weeks&&void 0===e.days&&void 0===e.hours&&void 0===e.minutes&&void 0===e.seconds&&void 0===e.milliseconds&&void 0===e.microseconds&&void 0===e.nanoseconds)throw new TypeError("Invalid duration format");if(!(0,r.IsValidDurationRecord)(t))throw new RangeError("Invalid duration format");return t}},1370:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ToIntegerIfIntegral=void 0;var r=n(2943);t.ToIntegerIfIntegral=function(e){var t=(0,r.ToNumber)(e);if(!Number.isInteger(t))throw new RangeError("".concat(e," is not an integer"));return t}},2552:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TABLE_2=t.TABLE_1=void 0,t.TABLE_1=["years","months","weeks","days","hours","minutes","seconds","milliseconds","microseconds","nanoseconds"],t.TABLE_2=[{valueField:"years",styleSlot:"years",displaySlot:"yearsDisplay",unit:"years",numberFormatUnit:"year"},{valueField:"months",styleSlot:"months",displaySlot:"monthsDisplay",unit:"months",numberFormatUnit:"month"},{valueField:"weeks",styleSlot:"weeks",displaySlot:"weeksDisplay",unit:"weeks",numberFormatUnit:"week"},{valueField:"days",styleSlot:"days",displaySlot:"daysDisplay",unit:"days",numberFormatUnit:"day"},{valueField:"hours",styleSlot:"hours",displaySlot:"hoursDisplay",unit:"hours",numberFormatUnit:"hour"},{valueField:"minutes",styleSlot:"minutes",displaySlot:"minutesDisplay",unit:"minutes",numberFormatUnit:"minute"},{valueField:"seconds",styleSlot:"seconds",displaySlot:"secondsDisplay",unit:"seconds",numberFormatUnit:"second"},{valueField:"milliseconds",styleSlot:"milliseconds",displaySlot:"millisecondsDisplay",unit:"milliseconds",numberFormatUnit:"millisecond"},{valueField:"microseconds",styleSlot:"microseconds",displaySlot:"microsecondsDisplay",unit:"microseconds",numberFormatUnit:"microsecond"},{valueField:"nanoseconds",styleSlot:"nanoseconds",displaySlot:"nanosecondsDisplay",unit:"nanoseconds",numberFormatUnit:"nanosecond"}]},715:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DurationFormat=void 0;var r=n(2943),o=n(3367),i=n(7332),a=n(984),s=n(8905),c=n(6732),l=n(743),f=n(2052),d=["locale","style","years","yearsDisplay","months","monthsDisplay","weeks","weeksDisplay","days","daysDisplay","hours","hoursDisplay","minutes","minutesDisplay","seconds","secondsDisplay","milliseconds","millisecondsDisplay","microseconds","microsecondsDisplay","nanoseconds","nanosecondsDisplay","numberingSystem","fractionalDigits"],h=[{styleSlot:"years",displaySlot:"yearsDisplay",unit:"years",values:["long","short","narrow"],digitalDefault:"short"},{styleSlot:"months",displaySlot:"monthsDisplay",unit:"months",values:["long","short","narrow"],digitalDefault:"short"},{styleSlot:"weeks",displaySlot:"weeksDisplay",unit:"weeks",values:["long","short","narrow"],digitalDefault:"short"},{styleSlot:"days",displaySlot:"daysDisplay",unit:"days",values:["long","short","narrow"],digitalDefault:"short"},{styleSlot:"hours",displaySlot:"hoursDisplay",unit:"hours",values:["long","short","narrow","numeric","2-digit"],digitalDefault:"numeric"},{styleSlot:"minutes",displaySlot:"minutesDisplay",unit:"minutes",values:["long","short","narrow","numeric","2-digit"],digitalDefault:"numeric"},{styleSlot:"seconds",displaySlot:"secondsDisplay",unit:"seconds",values:["long","short","narrow","numeric","2-digit"],digitalDefault:"numeric"},{styleSlot:"milliseconds",displaySlot:"millisecondsDisplay",unit:"milliseconds",values:["long","short","narrow","numeric"],digitalDefault:"numeric"},{styleSlot:"microseconds",displaySlot:"microsecondsDisplay",unit:"microseconds",values:["long","short","narrow","numeric"],digitalDefault:"numeric"},{styleSlot:"nanoseconds",displaySlot:"nanosecondsDisplay",unit:"nanoseconds",values:["long","short","narrow","numeric"],digitalDefault:"numeric"}],p=function(){function e(t,n){if(!(this&&u(this,e)?this.constructor:void 0))throw new TypeError("Intl.DurationFormat must be called with 'new'");var a=(0,r.CanonicalizeLocaleList)(t),s=Object.create(null),f=void 0===n?Object.create(null):(0,r.ToObject)(n),d=(0,r.GetOption)(f,"localeMatcher","string",["best fit","lookup"],"best fit"),p=(0,r.GetOption)(f,"numberingSystem","string",void 0,void 0);if(void 0!==p&&l.numberingSystemNames.indexOf(p)<0)throw RangeError("Invalid numberingSystems: ".concat(p));s.nu=p,s.localeMatcher=d;var y=e.localeData,v=e.availableLocales,m=(0,o.ResolveLocale)(v,a,s,["nu"],y,e.getDefaultLocale),g=m.locale,b=(0,c.getInternalSlots)(this);b.initializedDurationFormat=!0,b.locale=g,b.numberingSystem=m.nu;var w=(0,r.GetOption)(f,"style","string",["long","short","narrow","digital"],"short");b.style=w,b.dataLocale=m.dataLocale;var _="";h.forEach((function(e){var t=e.styleSlot,n=e.displaySlot,r=e.unit,o=e.values,a=e.digitalDefault,u=(0,i.GetDurationUnitOptions)(r,f,w,o,a,_);b[t]=u.style,b[n]=u.display,"hours"!==r&&"minutes"!==r&&"seconds"!==r&&"milliseconds"!==r&&"microseconds"!==r||(_=u.style)})),b.fractionalDigits=(0,r.GetNumberOption)(f,"fractionalDigits",0,9,void 0)}return e.prototype.resolvedOptions=function(){if("object"!=typeof this||!(0,r.OrdinaryHasInstance)(e,this))throw TypeError("Method Intl.DurationFormat.prototype.resolvedOptions called on incompatible receiver");for(var t=(0,c.getInternalSlots)(this),n={},o=0,i=d;o<i.length;o++){var a=i[o],u=t[a];"fractionalDigits"===a?void 0!==u&&(u=Number(u)):(0,r.invariant)(void 0!==u,"Missing internal slot ".concat(a)),n[a]=u}return n},e.prototype.formatToParts=function(e){if(void 0===(0,c.getInternalSlots)(this).initializedDurationFormat)throw new TypeError("Error uninitialized locale");for(var t=(0,s.ToDurationRecord)(e),n=[],r=0,o=(0,a.PartitionDurationFormatPattern)(this,t);r<o.length;r++){var i=o[r],u=i.type,l=i.unit,f={type:u,value:i.value};l&&(f.unit=l),n.push(f)}return n},e.prototype.format=function(e){if(void 0===(0,c.getInternalSlots)(this).initializedDurationFormat)throw new TypeError("Error uninitialized locale");for(var t=(0,s.ToDurationRecord)(e),n="",r=0,o=(0,a.PartitionDurationFormatPattern)(this,t);r<o.length;r++)n+=o[r].value;return n},e.supportedLocalesOf=function(t,n){return(0,r.SupportedLocales)(e.availableLocales,(0,r.CanonicalizeLocaleList)(t),n)},e.__defaultLocale="en",e.availableLocales=new Set,e.localeData=Object.keys(f.TIME_SEPARATORS.localeData).reduce((function(t,n){e.availableLocales.add(n);var r=f.TIME_SEPARATORS.localeData[n].nu;return t[n]={nu:r,digitalFormat:f.TIME_SEPARATORS.localeData[n].separator||r.reduce((function(e,t){return e[t]=f.TIME_SEPARATORS.default,e}),{})},t}),{}),e.getDefaultLocale=function(){return e.__defaultLocale},e.polyfilled=!0,e}();t.DurationFormat=p},6732:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInternalSlots=void 0;var n=new WeakMap;t.getInternalSlots=function(e){var t=n.get(e);return t||(t=Object.create(null),n.set(e,t)),t}},743:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numberingSystemNames=void 0,t.numberingSystemNames=["adlm","ahom","arab","arabext","armn","armnlow","bali","beng","bhks","brah","cakm","cham","cyrl","deva","diak","ethi","fullwide","geor","gong","gonm","grek","greklow","gujr","guru","hanidays","hanidec","hans","hansfin","hant","hantfin","hebr","hmng","hmnp","java","jpan","jpanfin","jpanyear","kali","kawi","khmr","knda","lana","lanatham","laoo","latn","lepc","limb","mathbold","mathdbl","mathmono","mathsanb","mathsans","mlym","modi","mong","mroo","mtei","mymr","mymrshan","mymrtlng","nagm","newa","nkoo","olck","orya","osma","rohg","roman","romanlow","saur","segment","shrd","sind","sinh","sora","sund","takr","talu","taml","tamldec","telu","thai","tibt","tirh","tnsa","vaii","wara","wcho"]},2052:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TIME_SEPARATORS=void 0,t.TIME_SEPARATORS={default:":",localeData:{aa:{nu:["latn"]},"aa-DJ":{nu:["latn"]},"aa-ER":{nu:["latn"]},ab:{nu:["latn"]},af:{nu:["latn"]},"af-NA":{nu:["latn"]},agq:{nu:["latn"]},ak:{nu:["latn"]},am:{nu:["latn"]},an:{nu:["latn"]},ann:{nu:["latn"]},apc:{nu:["latn"]},ar:{nu:["arab","latn"]},"ar-AE":{nu:["latn","latn"]},"ar-BH":{nu:["arab","latn"]},"ar-DJ":{nu:["arab","latn"]},"ar-DZ":{nu:["latn","latn"]},"ar-EG":{nu:["arab","latn"]},"ar-EH":{nu:["latn","latn"]},"ar-ER":{nu:["arab","latn"]},"ar-IL":{nu:["arab","latn"]},"ar-IQ":{nu:["arab","latn"]},"ar-JO":{nu:["arab","latn"]},"ar-KM":{nu:["arab","latn"]},"ar-KW":{nu:["arab","latn"]},"ar-LB":{nu:["arab","latn"]},"ar-LY":{nu:["latn","latn"]},"ar-MA":{nu:["latn","latn"]},"ar-MR":{nu:["arab","latn"]},"ar-OM":{nu:["arab","latn"]},"ar-PS":{nu:["arab","latn"]},"ar-QA":{nu:["arab","latn"]},"ar-SA":{nu:["arab","latn"]},"ar-SD":{nu:["arab","latn"]},"ar-SO":{nu:["arab","latn"]},"ar-SS":{nu:["arab","latn"]},"ar-SY":{nu:["arab","latn"]},"ar-TD":{nu:["arab","latn"]},"ar-TN":{nu:["latn","latn"]},"ar-YE":{nu:["arab","latn"]},arn:{nu:["latn"]},as:{nu:["beng"]},asa:{nu:["latn"]},ast:{nu:["latn"]},az:{nu:["latn"]},"az-Arab":{nu:["arabext"]},"az-Arab-IQ":{nu:["arabext"]},"az-Arab-TR":{nu:["arabext"]},"az-Cyrl":{nu:["latn"]},"az-Latn":{nu:["latn"]},ba:{nu:["latn"]},bal:{nu:["latn"]},"bal-Arab":{nu:["latn"]},"bal-Latn":{nu:["latn"]},bas:{nu:["latn"]},be:{nu:["latn"]},"be-tarask":{nu:["latn"]},bem:{nu:["latn"]},bez:{nu:["latn"]},bg:{nu:["latn"]},bgc:{nu:["deva"]},bgn:{nu:["arabext"]},"bgn-AE":{nu:["arabext"]},"bgn-AF":{nu:["arabext"]},"bgn-IR":{nu:["arabext"]},"bgn-OM":{nu:["arabext"]},bho:{nu:["deva"]},blt:{nu:["latn"]},bm:{nu:["latn"]},"bm-Nkoo":{nu:["latn"]},bn:{nu:["beng"]},"bn-IN":{nu:["beng"]},bo:{nu:["latn"]},"bo-IN":{nu:["latn"]},br:{nu:["latn"]},brx:{nu:["latn"]},bs:{nu:["latn"]},"bs-Cyrl":{nu:["latn"]},"bs-Latn":{nu:["latn"]},bss:{nu:["latn"]},byn:{nu:["latn"]},ca:{nu:["latn"]},"ca-AD":{nu:["latn"]},"ca-ES-valencia":{nu:["latn"]},"ca-FR":{nu:["latn"]},"ca-IT":{nu:["latn"]},cad:{nu:["latn"]},cch:{nu:["latn"]},ccp:{nu:["cakm"]},"ccp-IN":{nu:["cakm"]},ce:{nu:["latn"]},ceb:{nu:["latn"]},cgg:{nu:["latn"]},cho:{nu:["latn"]},chr:{nu:["latn"]},cic:{nu:["latn"]},ckb:{nu:["arab"]},"ckb-IR":{nu:["arab"]},co:{nu:["latn"]},cs:{nu:["latn"]},cu:{nu:["latn"]},cv:{nu:["latn"]},cy:{nu:["latn"]},da:{nu:["latn"],separator:{latn:"."}},"da-GL":{nu:["latn"],separator:{latn:"."}},dav:{nu:["latn"]},de:{nu:["latn"]},"de-AT":{nu:["latn"]},"de-BE":{nu:["latn"]},"de-CH":{nu:["latn"]},"de-IT":{nu:["latn"]},"de-LI":{nu:["latn"]},"de-LU":{nu:["latn"]},dje:{nu:["latn"]},doi:{nu:["latn"]},dsb:{nu:["latn"]},dua:{nu:["latn"]},dv:{nu:["latn"]},dyo:{nu:["latn"]},dz:{nu:["tibt"]},ebu:{nu:["latn"]},ee:{nu:["latn"]},"ee-TG":{nu:["latn"]},el:{nu:["latn"]},"el-CY":{nu:["latn"]},"el-polyton":{nu:["latn"]},en:{nu:["latn"]},"en-001":{nu:["latn"]},"en-150":{nu:["latn"]},"en-AE":{nu:["latn"]},"en-AG":{nu:["latn"]},"en-AI":{nu:["latn"]},"en-AS":{nu:["latn"]},"en-AT":{nu:["latn"]},"en-AU":{nu:["latn"]},"en-BB":{nu:["latn"]},"en-BE":{nu:["latn"]},"en-BI":{nu:["latn"]},"en-BM":{nu:["latn"]},"en-BS":{nu:["latn"]},"en-BW":{nu:["latn"]},"en-BZ":{nu:["latn"]},"en-CA":{nu:["latn"]},"en-CC":{nu:["latn"]},"en-CH":{nu:["latn"]},"en-CK":{nu:["latn"]},"en-CM":{nu:["latn"]},"en-CX":{nu:["latn"]},"en-CY":{nu:["latn"]},"en-DE":{nu:["latn"]},"en-DG":{nu:["latn"]},"en-DK":{nu:["latn"],separator:{latn:"."}},"en-DM":{nu:["latn"]},"en-Dsrt":{nu:["latn"]},"en-ER":{nu:["latn"]},"en-FI":{nu:["latn"],separator:{latn:"."}},"en-FJ":{nu:["latn"]},"en-FK":{nu:["latn"]},"en-FM":{nu:["latn"]},"en-GB":{nu:["latn"]},"en-GD":{nu:["latn"]},"en-GG":{nu:["latn"]},"en-GH":{nu:["latn"]},"en-GI":{nu:["latn"]},"en-GM":{nu:["latn"]},"en-GU":{nu:["latn"]},"en-GY":{nu:["latn"]},"en-HK":{nu:["latn"]},"en-IE":{nu:["latn"]},"en-IL":{nu:["latn"]},"en-IM":{nu:["latn"]},"en-IN":{nu:["latn"]},"en-IO":{nu:["latn"]},"en-JE":{nu:["latn"]},"en-JM":{nu:["latn"]},"en-KE":{nu:["latn"]},"en-KI":{nu:["latn"]},"en-KN":{nu:["latn"]},"en-KY":{nu:["latn"]},"en-LC":{nu:["latn"]},"en-LR":{nu:["latn"]},"en-LS":{nu:["latn"]},"en-MG":{nu:["latn"]},"en-MH":{nu:["latn"]},"en-MO":{nu:["latn"]},"en-MP":{nu:["latn"]},"en-MS":{nu:["latn"]},"en-MT":{nu:["latn"]},"en-MU":{nu:["latn"]},"en-MV":{nu:["latn"]},"en-MW":{nu:["latn"]},"en-MY":{nu:["latn"]},"en-NA":{nu:["latn"]},"en-NF":{nu:["latn"]},"en-NG":{nu:["latn"]},"en-NL":{nu:["latn"]},"en-NR":{nu:["latn"]},"en-NU":{nu:["latn"]},"en-NZ":{nu:["latn"]},"en-PG":{nu:["latn"]},"en-PH":{nu:["latn"]},"en-PK":{nu:["latn"]},"en-PN":{nu:["latn"]},"en-PR":{nu:["latn"]},"en-PW":{nu:["latn"]},"en-RW":{nu:["latn"]},"en-SB":{nu:["latn"]},"en-SC":{nu:["latn"]},"en-SD":{nu:["latn"]},"en-SE":{nu:["latn"]},"en-SG":{nu:["latn"]},"en-SH":{nu:["latn"]},"en-SI":{nu:["latn"]},"en-SL":{nu:["latn"]},"en-SS":{nu:["latn"]},"en-SX":{nu:["latn"]},"en-SZ":{nu:["latn"]},"en-Shaw":{nu:["latn"]},"en-TC":{nu:["latn"]},"en-TK":{nu:["latn"]},"en-TO":{nu:["latn"]},"en-TT":{nu:["latn"]},"en-TV":{nu:["latn"]},"en-TZ":{nu:["latn"]},"en-UG":{nu:["latn"]},"en-UM":{nu:["latn"]},"en-VC":{nu:["latn"]},"en-VG":{nu:["latn"]},"en-VI":{nu:["latn"]},"en-VU":{nu:["latn"]},"en-WS":{nu:["latn"]},"en-ZA":{nu:["latn"]},"en-ZM":{nu:["latn"]},"en-ZW":{nu:["latn"]},eo:{nu:["latn"]},es:{nu:["latn"]},"es-419":{nu:["latn"]},"es-AR":{nu:["latn"]},"es-BO":{nu:["latn"]},"es-BR":{nu:["latn"]},"es-BZ":{nu:["latn"]},"es-CL":{nu:["latn"]},"es-CO":{nu:["latn"]},"es-CR":{nu:["latn"]},"es-CU":{nu:["latn"]},"es-DO":{nu:["latn"]},"es-EA":{nu:["latn"]},"es-EC":{nu:["latn"]},"es-GQ":{nu:["latn"]},"es-GT":{nu:["latn"]},"es-HN":{nu:["latn"]},"es-IC":{nu:["latn"]},"es-MX":{nu:["latn"]},"es-NI":{nu:["latn"]},"es-PA":{nu:["latn"]},"es-PE":{nu:["latn"]},"es-PH":{nu:["latn"]},"es-PR":{nu:["latn"]},"es-PY":{nu:["latn"]},"es-SV":{nu:["latn"]},"es-US":{nu:["latn"]},"es-UY":{nu:["latn"]},"es-VE":{nu:["latn"]},et:{nu:["latn"]},eu:{nu:["latn"]},ewo:{nu:["latn"]},fa:{nu:["arabext"]},"fa-AF":{nu:["arabext"]},ff:{nu:["latn"]},"ff-Adlm":{nu:["adlm"]},"ff-Adlm-BF":{nu:["adlm"]},"ff-Adlm-CM":{nu:["adlm"]},"ff-Adlm-GH":{nu:["adlm"]},"ff-Adlm-GM":{nu:["adlm"]},"ff-Adlm-GW":{nu:["adlm"]},"ff-Adlm-LR":{nu:["adlm"]},"ff-Adlm-MR":{nu:["adlm"]},"ff-Adlm-NE":{nu:["adlm"]},"ff-Adlm-NG":{nu:["adlm"]},"ff-Adlm-SL":{nu:["adlm"]},"ff-Adlm-SN":{nu:["adlm"]},"ff-Latn":{nu:["latn"]},"ff-Latn-BF":{nu:["latn"]},"ff-Latn-CM":{nu:["latn"]},"ff-Latn-GH":{nu:["latn"]},"ff-Latn-GM":{nu:["latn"]},"ff-Latn-GN":{nu:["latn"]},"ff-Latn-GW":{nu:["latn"]},"ff-Latn-LR":{nu:["latn"]},"ff-Latn-MR":{nu:["latn"]},"ff-Latn-NE":{nu:["latn"]},"ff-Latn-NG":{nu:["latn"]},"ff-Latn-SL":{nu:["latn"]},fi:{nu:["latn"],separator:{latn:"."}},fil:{nu:["latn"]},fo:{nu:["latn"]},"fo-DK":{nu:["latn"]},fr:{nu:["latn"]},"fr-BE":{nu:["latn"]},"fr-BF":{nu:["latn"]},"fr-BI":{nu:["latn"]},"fr-BJ":{nu:["latn"]},"fr-BL":{nu:["latn"]},"fr-CA":{nu:["latn"]},"fr-CD":{nu:["latn"]},"fr-CF":{nu:["latn"]},"fr-CG":{nu:["latn"]},"fr-CH":{nu:["latn"]},"fr-CI":{nu:["latn"]},"fr-CM":{nu:["latn"]},"fr-DJ":{nu:["latn"]},"fr-DZ":{nu:["latn"]},"fr-GA":{nu:["latn"]},"fr-GF":{nu:["latn"]},"fr-GN":{nu:["latn"]},"fr-GP":{nu:["latn"]},"fr-GQ":{nu:["latn"]},"fr-HT":{nu:["latn"]},"fr-KM":{nu:["latn"]},"fr-LU":{nu:["latn"]},"fr-MA":{nu:["latn"]},"fr-MC":{nu:["latn"]},"fr-MF":{nu:["latn"]},"fr-MG":{nu:["latn"]},"fr-ML":{nu:["latn"]},"fr-MQ":{nu:["latn"]},"fr-MR":{nu:["latn"]},"fr-MU":{nu:["latn"]},"fr-NC":{nu:["latn"]},"fr-NE":{nu:["latn"]},"fr-PF":{nu:["latn"]},"fr-PM":{nu:["latn"]},"fr-RE":{nu:["latn"]},"fr-RW":{nu:["latn"]},"fr-SC":{nu:["latn"]},"fr-SN":{nu:["latn"]},"fr-SY":{nu:["latn"]},"fr-TD":{nu:["latn"]},"fr-TG":{nu:["latn"]},"fr-TN":{nu:["latn"]},"fr-VU":{nu:["latn"]},"fr-WF":{nu:["latn"]},"fr-YT":{nu:["latn"]},frr:{nu:["latn"]},fur:{nu:["latn"]},fy:{nu:["latn"]},ga:{nu:["latn"]},"ga-GB":{nu:["latn"]},gaa:{nu:["latn"]},gd:{nu:["latn"]},gez:{nu:["latn"]},"gez-ER":{nu:["latn"]},gl:{nu:["latn"]},gn:{nu:["latn"]},gsw:{nu:["latn"]},"gsw-FR":{nu:["latn"]},"gsw-LI":{nu:["latn"]},gu:{nu:["latn"]},guz:{nu:["latn"]},gv:{nu:["latn"]},ha:{nu:["latn"]},"ha-Arab":{nu:["latn"]},"ha-Arab-SD":{nu:["latn"]},"ha-GH":{nu:["latn"]},"ha-NE":{nu:["latn"]},haw:{nu:["latn"]},he:{nu:["latn"]},hi:{nu:["latn"]},"hi-Latn":{nu:["latn"]},hnj:{nu:["hmnp","latn"]},"hnj-Hmnp":{nu:["hmnp","latn"]},hr:{nu:["latn"]},"hr-BA":{nu:["latn"]},hsb:{nu:["latn"]},hu:{nu:["latn"]},hy:{nu:["latn"]},ia:{nu:["latn"]},id:{nu:["latn"],separator:{latn:"."}},ig:{nu:["latn"]},ii:{nu:["latn"]},io:{nu:["latn"]},is:{nu:["latn"]},it:{nu:["latn"]},"it-CH":{nu:["latn"]},"it-SM":{nu:["latn"]},"it-VA":{nu:["latn"]},iu:{nu:["latn"]},"iu-Latn":{nu:["latn"]},ja:{nu:["latn"]},jbo:{nu:["latn"]},jgo:{nu:["latn"]},jmc:{nu:["latn"]},jv:{nu:["latn"]},ka:{nu:["latn"]},kab:{nu:["latn"]},kaj:{nu:["latn"]},kam:{nu:["latn"]},kcg:{nu:["latn"]},kde:{nu:["latn"]},kea:{nu:["latn"]},ken:{nu:["latn"]},kgp:{nu:["latn"]},khq:{nu:["latn"]},ki:{nu:["latn"]},kk:{nu:["latn"]},kkj:{nu:["latn"]},kl:{nu:["latn"]},kln:{nu:["latn"]},km:{nu:["latn"]},kn:{nu:["latn"]},ko:{nu:["latn"]},"ko-KP":{nu:["latn"]},kok:{nu:["latn"]},kpe:{nu:["latn"]},"kpe-GN":{nu:["latn"]},ks:{nu:["arabext"]},"ks-Arab":{nu:["arabext"]},"ks-Deva":{nu:["latn"]},ksb:{nu:["latn"]},ksf:{nu:["latn"]},ksh:{nu:["latn"]},ku:{nu:["latn"]},kw:{nu:["latn"]},ky:{nu:["latn"]},la:{nu:["latn"]},lag:{nu:["latn"]},lb:{nu:["latn"]},lg:{nu:["latn"]},lij:{nu:["latn"]},lkt:{nu:["latn"]},lmo:{nu:["latn"]},ln:{nu:["latn"]},"ln-AO":{nu:["latn"]},"ln-CF":{nu:["latn"]},"ln-CG":{nu:["latn"]},lo:{nu:["latn"]},lrc:{nu:["arabext"]},"lrc-IQ":{nu:["arabext"]},lt:{nu:["latn"]},lu:{nu:["latn"]},luo:{nu:["latn"]},luy:{nu:["latn"]},lv:{nu:["latn"]},mai:{nu:["latn"]},mas:{nu:["latn"]},"mas-TZ":{nu:["latn"]},mdf:{nu:["latn"]},mer:{nu:["latn"]},mfe:{nu:["latn"]},mg:{nu:["latn"]},mgh:{nu:["latn"]},mgo:{nu:["latn"]},mi:{nu:["latn"]},mk:{nu:["latn"]},ml:{nu:["latn"]},mn:{nu:["latn"]},"mn-Mong":{nu:["latn"]},"mn-Mong-MN":{nu:["latn"]},mni:{nu:["beng"]},"mni-Beng":{nu:["beng"]},"mni-Mtei":{nu:["mtei"]},moh:{nu:["latn"]},mr:{nu:["deva"]},ms:{nu:["latn"]},"ms-Arab":{nu:["latn"]},"ms-Arab-BN":{nu:["latn"]},"ms-BN":{nu:["latn"]},"ms-ID":{nu:["latn"],separator:{latn:"."}},"ms-SG":{nu:["latn"]},mt:{nu:["latn"]},mua:{nu:["latn"]},mus:{nu:["latn"]},my:{nu:["mymr"]},myv:{nu:["latn"]},mzn:{nu:["arabext"]},naq:{nu:["latn"]},nb:{nu:["latn"]},"nb-SJ":{nu:["latn"]},nd:{nu:["latn"]},nds:{nu:["latn"]},"nds-NL":{nu:["latn"]},ne:{nu:["deva"]},"ne-IN":{nu:["deva"]},nl:{nu:["latn"]},"nl-AW":{nu:["latn"]},"nl-BE":{nu:["latn"]},"nl-BQ":{nu:["latn"]},"nl-CW":{nu:["latn"]},"nl-SR":{nu:["latn"]},"nl-SX":{nu:["latn"]},nmg:{nu:["latn"]},nn:{nu:["latn"]},nnh:{nu:["latn"]},no:{nu:["latn"]},nqo:{nu:["nkoo"]},nr:{nu:["latn"]},nso:{nu:["latn"]},nus:{nu:["latn"]},nv:{nu:["latn"]},ny:{nu:["latn"]},nyn:{nu:["latn"]},oc:{nu:["latn"]},"oc-ES":{nu:["latn"]},om:{nu:["latn"]},"om-KE":{nu:["latn"]},or:{nu:["latn"]},os:{nu:["latn"]},"os-RU":{nu:["latn"]},osa:{nu:["latn"]},pa:{nu:["latn"]},"pa-Arab":{nu:["arabext"]},"pa-Guru":{nu:["latn"]},pap:{nu:["latn"]},"pap-AW":{nu:["latn"]},pcm:{nu:["latn"]},pis:{nu:["latn"]},pl:{nu:["latn"]},prg:{nu:["latn"]},ps:{nu:["arabext"]},"ps-PK":{nu:["arabext"]},pt:{nu:["latn"]},"pt-AO":{nu:["latn"]},"pt-CH":{nu:["latn"]},"pt-CV":{nu:["latn"]},"pt-GQ":{nu:["latn"]},"pt-GW":{nu:["latn"]},"pt-LU":{nu:["latn"]},"pt-MO":{nu:["latn"]},"pt-MZ":{nu:["latn"]},"pt-PT":{nu:["latn"]},"pt-ST":{nu:["latn"]},"pt-TL":{nu:["latn"]},qu:{nu:["latn"]},"qu-BO":{nu:["latn"]},"qu-EC":{nu:["latn"]},quc:{nu:["latn"]},raj:{nu:["deva"]},rhg:{nu:["latn"]},"rhg-Rohg":{nu:["latn"]},"rhg-Rohg-BD":{nu:["latn"]},rif:{nu:["latn"]},rm:{nu:["latn"]},rn:{nu:["latn"]},ro:{nu:["latn"]},"ro-MD":{nu:["latn"]},rof:{nu:["latn"]},ru:{nu:["latn"]},"ru-BY":{nu:["latn"]},"ru-KG":{nu:["latn"]},"ru-KZ":{nu:["latn"]},"ru-MD":{nu:["latn"]},"ru-UA":{nu:["latn"]},rw:{nu:["latn"]},rwk:{nu:["latn"]},sa:{nu:["deva"]},sah:{nu:["latn"]},saq:{nu:["latn"]},sat:{nu:["olck"]},"sat-Deva":{nu:["deva"]},"sat-Olck":{nu:["olck"]},sbp:{nu:["latn"]},sc:{nu:["latn"]},scn:{nu:["latn"]},sd:{nu:["arab"]},"sd-Arab":{nu:["arab"]},"sd-Deva":{nu:["latn"]},sdh:{nu:["arab"]},"sdh-IQ":{nu:["arab"]},se:{nu:["latn"]},"se-FI":{nu:["latn"]},"se-SE":{nu:["latn"]},seh:{nu:["latn"]},ses:{nu:["latn"]},sg:{nu:["latn"]},shi:{nu:["latn"]},"shi-Latn":{nu:["latn"]},"shi-Tfng":{nu:["latn"]},shn:{nu:["latn"]},"shn-TH":{nu:["latn"]},si:{nu:["latn"],separator:{latn:"."}},sid:{nu:["latn"]},sk:{nu:["latn"]},sl:{nu:["latn"]},sma:{nu:["latn"]},"sma-NO":{nu:["latn"]},smj:{nu:["latn"]},"smj-NO":{nu:["latn"]},smn:{nu:["latn"],separator:{latn:"."}},sms:{nu:["latn"]},sn:{nu:["latn"]},so:{nu:["latn"]},"so-DJ":{nu:["latn"]},"so-ET":{nu:["latn"]},"so-KE":{nu:["latn"]},sq:{nu:["latn"]},"sq-MK":{nu:["latn"]},"sq-XK":{nu:["latn"]},sr:{nu:["latn"]},"sr-Cyrl":{nu:["latn"]},"sr-Cyrl-BA":{nu:["latn"]},"sr-Cyrl-ME":{nu:["latn"]},"sr-Cyrl-XK":{nu:["latn"]},"sr-Latn":{nu:["latn"]},"sr-Latn-BA":{nu:["latn"]},"sr-Latn-ME":{nu:["latn"]},"sr-Latn-XK":{nu:["latn"]},ss:{nu:["latn"]},"ss-SZ":{nu:["latn"]},ssy:{nu:["latn"]},st:{nu:["latn"]},"st-LS":{nu:["latn"]},su:{nu:["latn"],separator:{latn:"."}},"su-Latn":{nu:["latn"],separator:{latn:"."}},sv:{nu:["latn"]},"sv-AX":{nu:["latn"]},"sv-FI":{nu:["latn"],separator:{latn:"."}},sw:{nu:["latn"]},"sw-CD":{nu:["latn"]},"sw-KE":{nu:["latn"]},"sw-UG":{nu:["latn"]},syr:{nu:["latn"]},"syr-SY":{nu:["latn"]},szl:{nu:["latn"]},ta:{nu:["latn"]},"ta-LK":{nu:["latn"]},"ta-MY":{nu:["latn"]},"ta-SG":{nu:["latn"]},te:{nu:["latn"]},teo:{nu:["latn"]},"teo-KE":{nu:["latn"]},tg:{nu:["latn"]},th:{nu:["latn"]},ti:{nu:["latn"]},"ti-ER":{nu:["latn"]},tig:{nu:["latn"]},tk:{nu:["latn"]},tn:{nu:["latn"]},"tn-BW":{nu:["latn"]},to:{nu:["latn"]},tok:{nu:["latn"]},tpi:{nu:["latn"]},tr:{nu:["latn"]},"tr-CY":{nu:["latn"]},trv:{nu:["latn"]},trw:{nu:["latn"]},ts:{nu:["latn"]},tt:{nu:["latn"]},twq:{nu:["latn"]},tzm:{nu:["latn"]},ug:{nu:["latn"]},uk:{nu:["latn"]},und:{nu:["latn"]},ur:{nu:["latn"]},"ur-IN":{nu:["arabext"],separator:{arabext:"٫"}},uz:{nu:["latn"]},"uz-Arab":{nu:["arabext"]},"uz-Cyrl":{nu:["latn"]},"uz-Latn":{nu:["latn"]},vai:{nu:["latn"]},"vai-Latn":{nu:["latn"]},"vai-Vaii":{nu:["latn"]},ve:{nu:["latn"]},vec:{nu:["latn"]},vi:{nu:["latn"]},vo:{nu:["latn"]},vun:{nu:["latn"]},wa:{nu:["latn"]},wae:{nu:["latn"]},wal:{nu:["latn"]},wbp:{nu:["latn"]},wo:{nu:["latn"]},xh:{nu:["latn"]},xog:{nu:["latn"]},yav:{nu:["latn"]},yi:{nu:["latn"]},yo:{nu:["latn"]},"yo-BJ":{nu:["latn"]},yrl:{nu:["latn"]},"yrl-CO":{nu:["latn"]},"yrl-VE":{nu:["latn"]},yue:{nu:["latn"]},"yue-Hans":{nu:["latn"]},"yue-Hant":{nu:["latn"]},zgh:{nu:["latn"]},zh:{nu:["latn"]},"zh-Hans":{nu:["latn"]},"zh-Hans-HK":{nu:["latn"]},"zh-Hans-MO":{nu:["latn"]},"zh-Hans-SG":{nu:["latn"]},"zh-Hant":{nu:["latn"]},"zh-Hant-HK":{nu:["latn"]},"zh-Hant-MO":{nu:["latn"]},zu:{nu:["latn"]}}}},3367:function(e,t,n){"use strict";var r=function(e,t,n){if(void 0===n&&(n=Error),!e)throw new n(t)},o=function(e,t,n){var r=t.split("-"),o=r[0],i=r[1],a=r[2],u=!0;if(a&&"$"===a[0]){var s="!"!==a[1],c=(s?n[a.slice(1)]:n[a.slice(2)]).map((function(e){return m[e]||[e]})).reduce((function(e,t){return(0,y.__spreadArray)((0,y.__spreadArray)([],e,!0),t,!0)}),[]);u&&(u=!(c.indexOf(e.region||"")>1!=s))}else u&&(u=!e.region||"*"===a||a===e.region);return u&&(u=!e.script||"*"===i||i===e.script),u&&(u=!e.language||"*"===o||o===e.language),u},i=function(e){return[e.language,e.script,e.region].filter(Boolean).join("-")},a=function(e,t,n){for(var r=0,a=n.matches;r<a.length;r++){var u=a[r],s=o(e,u.desired,n.matchVariables)&&o(t,u.supported,n.matchVariables);if(u.oneway||s||(s=o(e,u.supported,n.matchVariables)&&o(t,u.desired,n.matchVariables)),s){var c=10*u.distance;return n.paradigmLocales.indexOf(i(e))>-1!=n.paradigmLocales.indexOf(i(t))>-1?c-1:c}}throw new Error("No matching distance found")},u=function(e,t,n){var r,o,i=[],u=t.reduce((function(e,t){var n=t.replace(g,"");return i.push(n),e[n]=t,e}),{}),s=function(e,t,n){void 0===n&&(n=b);var r=1/0,o={matchedDesiredLocale:"",distances:{}};return e.forEach((function(e,n){o.distances[e]||(o.distances[e]={}),t.forEach((function(t){var i=function(e,t){var n=new Intl.Locale(e).maximize(),r=new Intl.Locale(t).maximize(),o={language:n.language,script:n.script||"",region:n.region||""},i={language:r.language,script:r.script||"",region:r.region||""},u=0,s=function(){var e,t;if(!p){var n=null===(t=null===(e=v.supplemental.languageMatching["written-new"][0])||void 0===e?void 0:e.paradigmLocales)||void 0===t?void 0:t._locales.split(" "),r=v.supplemental.languageMatching["written-new"].slice(1,5),o=v.supplemental.languageMatching["written-new"].slice(5).map((function(e){var t=Object.keys(e)[0],n=e[t];return{supported:t,desired:n._desired,distance:+n._distance,oneway:"true"===n.oneway}}),{});p={matches:o,matchVariables:r.reduce((function(e,t){var n=Object.keys(t)[0],r=t[n];return e[n.slice(1)]=r._value.split("+"),e}),{}),paradigmLocales:(0,y.__spreadArray)((0,y.__spreadArray)([],n,!0),n.map((function(e){return new Intl.Locale(e.replace(/_/g,"-")).maximize().toString()})),!0)}}return p}();return o.language!==i.language&&(u+=a({language:n.language,script:"",region:""},{language:r.language,script:"",region:""},s)),o.script!==i.script&&(u+=a({language:n.language,script:o.script,region:""},{language:r.language,script:o.script,region:""},s)),o.region!==i.region&&(u+=a(o,i,s)),u}(e,t)+0+40*n;o.distances[e][t]=i,i<r&&(r=i,o.matchedDesiredLocale=e,o.matchedSupportedLocale=t)}))})),r>=n&&(o.matchedDesiredLocale=void 0,o.matchedSupportedLocale=void 0),o}(i,e);return s.matchedSupportedLocale&&s.matchedDesiredLocale&&(r=s.matchedSupportedLocale,o=u[s.matchedDesiredLocale].slice(s.matchedDesiredLocale.length)||void 0),r?{locale:r,extension:o}:{locale:n()}},s=function(e,t){for(var n=t;;){if(e.indexOf(n)>-1)return n;var r=n.lastIndexOf("-");if(!~r)return;r>=2&&"-"===n[r-2]&&(r-=2),n=n.slice(0,r)}},c=function(e,t){r(2===t.length,"key must have 2 elements");var n=e.length,o="-".concat(t,"-"),i=e.indexOf(o);if(-1!==i){for(var a=i+4,u=a,s=a,c=!1;!c;){var l=e.indexOf("-",s);2==(-1===l?n-s:l-s)?c=!0:-1===l?(u=n,c=!0):(u=l,s=l+1)}return e.slice(a,u)}if(o="-".concat(t),-1!==(i=e.indexOf(o))&&i+3===n)return""},l=function(e,t,n,o,i,a){var l;l="lookup"===n.localeMatcher?function(e,t,n){for(var r={locale:""},o=0,i=t;o<i.length;o++){var a=i[o],u=a.replace(g,""),c=s(e,u);if(c)return r.locale=c,a!==u&&(r.extension=a.slice(u.length,a.length)),r}return r.locale=n(),r}(Array.from(e),t,a):u(Array.from(e),t,a);for(var f=l.locale,h={locale:"",dataLocale:f},p="-u",y=0,v=o;y<v.length;y++){var m=v[y];r(f in i,"Missing locale data for ".concat(f));var b=i[f];r("object"==typeof b&&null!==b,"locale data ".concat(m," must be an object"));var w=b[m];r(Array.isArray(w),"keyLocaleData for ".concat(m," must be an array"));var _=w[0];r("string"==typeof _||null===_,"value must be string or null but got ".concat(void 0===_?"undefined":d(_)," in key ").concat(m));var S="";if(l.extension){var O=c(l.extension,m);void 0!==O&&(""!==O?~w.indexOf(O)&&(_=O,S="-".concat(m,"-").concat(_)):~O.indexOf("true")&&(_="true",S="-".concat(m)))}if(m in n){var E=n[m];r("string"==typeof E||null==E,"optionsValue must be String, Undefined or Null"),~w.indexOf(E)&&E!==_&&(_=E,S="")}h[m]=_,p+=S}if(p.length>2){var x=f.indexOf("-x-");if(-1===x)f+=p;else{var k=f.slice(0,x),P=f.slice(x,f.length);f=k+p+P}f=Intl.getCanonicalLocales(f)[0]}return h.locale=f,h},f=function(e,t){for(var n=[],r=0,o=t;r<o.length;r++){var i=s(e,o[r].replace(g,""));i&&n.push(i)}return n},h=function(e,t,n,r){return l(t,(o=e,Intl.getCanonicalLocales(o)),{localeMatcher:(null==r?void 0:r.algorithm)||"best fit"},[],{},(function(){return n})).locale;var o};n.r(t),n.d(t,{LookupSupportedLocales:function(){return f},ResolveLocale:function(){return l},match:function(){return h}});var p,y=n(2712),v={supplemental:{languageMatching:{"written-new":[{paradigmLocales:{_locales:"en en_GB es es_419 pt_BR pt_PT"}},{$enUS:{_value:"AS+CA+GU+MH+MP+PH+PR+UM+US+VI"}},{$cnsar:{_value:"HK+MO"}},{$americas:{_value:"019"}},{$maghreb:{_value:"MA+DZ+TN+LY+MR+EH"}},{no:{_desired:"nb",_distance:"1"}},{bs:{_desired:"hr",_distance:"4"}},{bs:{_desired:"sh",_distance:"4"}},{hr:{_desired:"sh",_distance:"4"}},{sr:{_desired:"sh",_distance:"4"}},{aa:{_desired:"ssy",_distance:"4"}},{de:{_desired:"gsw",_distance:"4",_oneway:"true"}},{de:{_desired:"lb",_distance:"4",_oneway:"true"}},{no:{_desired:"da",_distance:"8"}},{nb:{_desired:"da",_distance:"8"}},{ru:{_desired:"ab",_distance:"30",_oneway:"true"}},{en:{_desired:"ach",_distance:"30",_oneway:"true"}},{nl:{_desired:"af",_distance:"20",_oneway:"true"}},{en:{_desired:"ak",_distance:"30",_oneway:"true"}},{en:{_desired:"am",_distance:"30",_oneway:"true"}},{es:{_desired:"ay",_distance:"20",_oneway:"true"}},{ru:{_desired:"az",_distance:"30",_oneway:"true"}},{ur:{_desired:"bal",_distance:"20",_oneway:"true"}},{ru:{_desired:"be",_distance:"20",_oneway:"true"}},{en:{_desired:"bem",_distance:"30",_oneway:"true"}},{hi:{_desired:"bh",_distance:"30",_oneway:"true"}},{en:{_desired:"bn",_distance:"30",_oneway:"true"}},{zh:{_desired:"bo",_distance:"20",_oneway:"true"}},{fr:{_desired:"br",_distance:"20",_oneway:"true"}},{es:{_desired:"ca",_distance:"20",_oneway:"true"}},{fil:{_desired:"ceb",_distance:"30",_oneway:"true"}},{en:{_desired:"chr",_distance:"20",_oneway:"true"}},{ar:{_desired:"ckb",_distance:"30",_oneway:"true"}},{fr:{_desired:"co",_distance:"20",_oneway:"true"}},{fr:{_desired:"crs",_distance:"20",_oneway:"true"}},{sk:{_desired:"cs",_distance:"20"}},{en:{_desired:"cy",_distance:"20",_oneway:"true"}},{en:{_desired:"ee",_distance:"30",_oneway:"true"}},{en:{_desired:"eo",_distance:"30",_oneway:"true"}},{es:{_desired:"eu",_distance:"20",_oneway:"true"}},{da:{_desired:"fo",_distance:"20",_oneway:"true"}},{nl:{_desired:"fy",_distance:"20",_oneway:"true"}},{en:{_desired:"ga",_distance:"20",_oneway:"true"}},{en:{_desired:"gaa",_distance:"30",_oneway:"true"}},{en:{_desired:"gd",_distance:"20",_oneway:"true"}},{es:{_desired:"gl",_distance:"20",_oneway:"true"}},{es:{_desired:"gn",_distance:"20",_oneway:"true"}},{hi:{_desired:"gu",_distance:"30",_oneway:"true"}},{en:{_desired:"ha",_distance:"30",_oneway:"true"}},{en:{_desired:"haw",_distance:"20",_oneway:"true"}},{fr:{_desired:"ht",_distance:"20",_oneway:"true"}},{ru:{_desired:"hy",_distance:"30",_oneway:"true"}},{en:{_desired:"ia",_distance:"30",_oneway:"true"}},{en:{_desired:"ig",_distance:"30",_oneway:"true"}},{en:{_desired:"is",_distance:"20",_oneway:"true"}},{id:{_desired:"jv",_distance:"20",_oneway:"true"}},{en:{_desired:"ka",_distance:"30",_oneway:"true"}},{fr:{_desired:"kg",_distance:"30",_oneway:"true"}},{ru:{_desired:"kk",_distance:"30",_oneway:"true"}},{en:{_desired:"km",_distance:"30",_oneway:"true"}},{en:{_desired:"kn",_distance:"30",_oneway:"true"}},{en:{_desired:"kri",_distance:"30",_oneway:"true"}},{tr:{_desired:"ku",_distance:"30",_oneway:"true"}},{ru:{_desired:"ky",_distance:"30",_oneway:"true"}},{it:{_desired:"la",_distance:"20",_oneway:"true"}},{en:{_desired:"lg",_distance:"30",_oneway:"true"}},{fr:{_desired:"ln",_distance:"30",_oneway:"true"}},{en:{_desired:"lo",_distance:"30",_oneway:"true"}},{en:{_desired:"loz",_distance:"30",_oneway:"true"}},{fr:{_desired:"lua",_distance:"30",_oneway:"true"}},{hi:{_desired:"mai",_distance:"20",_oneway:"true"}},{en:{_desired:"mfe",_distance:"30",_oneway:"true"}},{fr:{_desired:"mg",_distance:"30",_oneway:"true"}},{en:{_desired:"mi",_distance:"20",_oneway:"true"}},{en:{_desired:"ml",_distance:"30",_oneway:"true"}},{ru:{_desired:"mn",_distance:"30",_oneway:"true"}},{hi:{_desired:"mr",_distance:"30",_oneway:"true"}},{id:{_desired:"ms",_distance:"30",_oneway:"true"}},{en:{_desired:"mt",_distance:"30",_oneway:"true"}},{en:{_desired:"my",_distance:"30",_oneway:"true"}},{en:{_desired:"ne",_distance:"30",_oneway:"true"}},{nb:{_desired:"nn",_distance:"20"}},{no:{_desired:"nn",_distance:"20"}},{en:{_desired:"nso",_distance:"30",_oneway:"true"}},{en:{_desired:"ny",_distance:"30",_oneway:"true"}},{en:{_desired:"nyn",_distance:"30",_oneway:"true"}},{fr:{_desired:"oc",_distance:"20",_oneway:"true"}},{en:{_desired:"om",_distance:"30",_oneway:"true"}},{en:{_desired:"or",_distance:"30",_oneway:"true"}},{en:{_desired:"pa",_distance:"30",_oneway:"true"}},{en:{_desired:"pcm",_distance:"20",_oneway:"true"}},{en:{_desired:"ps",_distance:"30",_oneway:"true"}},{es:{_desired:"qu",_distance:"30",_oneway:"true"}},{de:{_desired:"rm",_distance:"20",_oneway:"true"}},{en:{_desired:"rn",_distance:"30",_oneway:"true"}},{fr:{_desired:"rw",_distance:"30",_oneway:"true"}},{hi:{_desired:"sa",_distance:"30",_oneway:"true"}},{en:{_desired:"sd",_distance:"30",_oneway:"true"}},{en:{_desired:"si",_distance:"30",_oneway:"true"}},{en:{_desired:"sn",_distance:"30",_oneway:"true"}},{en:{_desired:"so",_distance:"30",_oneway:"true"}},{en:{_desired:"sq",_distance:"30",_oneway:"true"}},{en:{_desired:"st",_distance:"30",_oneway:"true"}},{id:{_desired:"su",_distance:"20",_oneway:"true"}},{en:{_desired:"sw",_distance:"30",_oneway:"true"}},{en:{_desired:"ta",_distance:"30",_oneway:"true"}},{en:{_desired:"te",_distance:"30",_oneway:"true"}},{ru:{_desired:"tg",_distance:"30",_oneway:"true"}},{en:{_desired:"ti",_distance:"30",_oneway:"true"}},{ru:{_desired:"tk",_distance:"30",_oneway:"true"}},{en:{_desired:"tlh",_distance:"30",_oneway:"true"}},{en:{_desired:"tn",_distance:"30",_oneway:"true"}},{en:{_desired:"to",_distance:"30",_oneway:"true"}},{ru:{_desired:"tt",_distance:"30",_oneway:"true"}},{en:{_desired:"tum",_distance:"30",_oneway:"true"}},{zh:{_desired:"ug",_distance:"20",_oneway:"true"}},{ru:{_desired:"uk",_distance:"20",_oneway:"true"}},{en:{_desired:"ur",_distance:"30",_oneway:"true"}},{ru:{_desired:"uz",_distance:"30",_oneway:"true"}},{fr:{_desired:"wo",_distance:"30",_oneway:"true"}},{en:{_desired:"xh",_distance:"30",_oneway:"true"}},{en:{_desired:"yi",_distance:"30",_oneway:"true"}},{en:{_desired:"yo",_distance:"30",_oneway:"true"}},{zh:{_desired:"za",_distance:"20",_oneway:"true"}},{en:{_desired:"zu",_distance:"30",_oneway:"true"}},{ar:{_desired:"aao",_distance:"10",_oneway:"true"}},{ar:{_desired:"abh",_distance:"10",_oneway:"true"}},{ar:{_desired:"abv",_distance:"10",_oneway:"true"}},{ar:{_desired:"acm",_distance:"10",_oneway:"true"}},{ar:{_desired:"acq",_distance:"10",_oneway:"true"}},{ar:{_desired:"acw",_distance:"10",_oneway:"true"}},{ar:{_desired:"acx",_distance:"10",_oneway:"true"}},{ar:{_desired:"acy",_distance:"10",_oneway:"true"}},{ar:{_desired:"adf",_distance:"10",_oneway:"true"}},{ar:{_desired:"aeb",_distance:"10",_oneway:"true"}},{ar:{_desired:"aec",_distance:"10",_oneway:"true"}},{ar:{_desired:"afb",_distance:"10",_oneway:"true"}},{ar:{_desired:"ajp",_distance:"10",_oneway:"true"}},{ar:{_desired:"apc",_distance:"10",_oneway:"true"}},{ar:{_desired:"apd",_distance:"10",_oneway:"true"}},{ar:{_desired:"arq",_distance:"10",_oneway:"true"}},{ar:{_desired:"ars",_distance:"10",_oneway:"true"}},{ar:{_desired:"ary",_distance:"10",_oneway:"true"}},{ar:{_desired:"arz",_distance:"10",_oneway:"true"}},{ar:{_desired:"auz",_distance:"10",_oneway:"true"}},{ar:{_desired:"avl",_distance:"10",_oneway:"true"}},{ar:{_desired:"ayh",_distance:"10",_oneway:"true"}},{ar:{_desired:"ayl",_distance:"10",_oneway:"true"}},{ar:{_desired:"ayn",_distance:"10",_oneway:"true"}},{ar:{_desired:"ayp",_distance:"10",_oneway:"true"}},{ar:{_desired:"bbz",_distance:"10",_oneway:"true"}},{ar:{_desired:"pga",_distance:"10",_oneway:"true"}},{ar:{_desired:"shu",_distance:"10",_oneway:"true"}},{ar:{_desired:"ssh",_distance:"10",_oneway:"true"}},{az:{_desired:"azb",_distance:"10",_oneway:"true"}},{et:{_desired:"vro",_distance:"10",_oneway:"true"}},{ff:{_desired:"ffm",_distance:"10",_oneway:"true"}},{ff:{_desired:"fub",_distance:"10",_oneway:"true"}},{ff:{_desired:"fue",_distance:"10",_oneway:"true"}},{ff:{_desired:"fuf",_distance:"10",_oneway:"true"}},{ff:{_desired:"fuh",_distance:"10",_oneway:"true"}},{ff:{_desired:"fui",_distance:"10",_oneway:"true"}},{ff:{_desired:"fuq",_distance:"10",_oneway:"true"}},{ff:{_desired:"fuv",_distance:"10",_oneway:"true"}},{gn:{_desired:"gnw",_distance:"10",_oneway:"true"}},{gn:{_desired:"gui",_distance:"10",_oneway:"true"}},{gn:{_desired:"gun",_distance:"10",_oneway:"true"}},{gn:{_desired:"nhd",_distance:"10",_oneway:"true"}},{iu:{_desired:"ikt",_distance:"10",_oneway:"true"}},{kln:{_desired:"enb",_distance:"10",_oneway:"true"}},{kln:{_desired:"eyo",_distance:"10",_oneway:"true"}},{kln:{_desired:"niq",_distance:"10",_oneway:"true"}},{kln:{_desired:"oki",_distance:"10",_oneway:"true"}},{kln:{_desired:"pko",_distance:"10",_oneway:"true"}},{kln:{_desired:"sgc",_distance:"10",_oneway:"true"}},{kln:{_desired:"tec",_distance:"10",_oneway:"true"}},{kln:{_desired:"tuy",_distance:"10",_oneway:"true"}},{kok:{_desired:"gom",_distance:"10",_oneway:"true"}},{kpe:{_desired:"gkp",_distance:"10",_oneway:"true"}},{luy:{_desired:"ida",_distance:"10",_oneway:"true"}},{luy:{_desired:"lkb",_distance:"10",_oneway:"true"}},{luy:{_desired:"lko",_distance:"10",_oneway:"true"}},{luy:{_desired:"lks",_distance:"10",_oneway:"true"}},{luy:{_desired:"lri",_distance:"10",_oneway:"true"}},{luy:{_desired:"lrm",_distance:"10",_oneway:"true"}},{luy:{_desired:"lsm",_distance:"10",_oneway:"true"}},{luy:{_desired:"lto",_distance:"10",_oneway:"true"}},{luy:{_desired:"lts",_distance:"10",_oneway:"true"}},{luy:{_desired:"lwg",_distance:"10",_oneway:"true"}},{luy:{_desired:"nle",_distance:"10",_oneway:"true"}},{luy:{_desired:"nyd",_distance:"10",_oneway:"true"}},{luy:{_desired:"rag",_distance:"10",_oneway:"true"}},{lv:{_desired:"ltg",_distance:"10",_oneway:"true"}},{mg:{_desired:"bhr",_distance:"10",_oneway:"true"}},{mg:{_desired:"bjq",_distance:"10",_oneway:"true"}},{mg:{_desired:"bmm",_distance:"10",_oneway:"true"}},{mg:{_desired:"bzc",_distance:"10",_oneway:"true"}},{mg:{_desired:"msh",_distance:"10",_oneway:"true"}},{mg:{_desired:"skg",_distance:"10",_oneway:"true"}},{mg:{_desired:"tdx",_distance:"10",_oneway:"true"}},{mg:{_desired:"tkg",_distance:"10",_oneway:"true"}},{mg:{_desired:"txy",_distance:"10",_oneway:"true"}},{mg:{_desired:"xmv",_distance:"10",_oneway:"true"}},{mg:{_desired:"xmw",_distance:"10",_oneway:"true"}},{mn:{_desired:"mvf",_distance:"10",_oneway:"true"}},{ms:{_desired:"bjn",_distance:"10",_oneway:"true"}},{ms:{_desired:"btj",_distance:"10",_oneway:"true"}},{ms:{_desired:"bve",_distance:"10",_oneway:"true"}},{ms:{_desired:"bvu",_distance:"10",_oneway:"true"}},{ms:{_desired:"coa",_distance:"10",_oneway:"true"}},{ms:{_desired:"dup",_distance:"10",_oneway:"true"}},{ms:{_desired:"hji",_distance:"10",_oneway:"true"}},{ms:{_desired:"id",_distance:"10",_oneway:"true"}},{ms:{_desired:"jak",_distance:"10",_oneway:"true"}},{ms:{_desired:"jax",_distance:"10",_oneway:"true"}},{ms:{_desired:"kvb",_distance:"10",_oneway:"true"}},{ms:{_desired:"kvr",_distance:"10",_oneway:"true"}},{ms:{_desired:"kxd",_distance:"10",_oneway:"true"}},{ms:{_desired:"lce",_distance:"10",_oneway:"true"}},{ms:{_desired:"lcf",_distance:"10",_oneway:"true"}},{ms:{_desired:"liw",_distance:"10",_oneway:"true"}},{ms:{_desired:"max",_distance:"10",_oneway:"true"}},{ms:{_desired:"meo",_distance:"10",_oneway:"true"}},{ms:{_desired:"mfa",_distance:"10",_oneway:"true"}},{ms:{_desired:"mfb",_distance:"10",_oneway:"true"}},{ms:{_desired:"min",_distance:"10",_oneway:"true"}},{ms:{_desired:"mqg",_distance:"10",_oneway:"true"}},{ms:{_desired:"msi",_distance:"10",_oneway:"true"}},{ms:{_desired:"mui",_distance:"10",_oneway:"true"}},{ms:{_desired:"orn",_distance:"10",_oneway:"true"}},{ms:{_desired:"ors",_distance:"10",_oneway:"true"}},{ms:{_desired:"pel",_distance:"10",_oneway:"true"}},{ms:{_desired:"pse",_distance:"10",_oneway:"true"}},{ms:{_desired:"tmw",_distance:"10",_oneway:"true"}},{ms:{_desired:"urk",_distance:"10",_oneway:"true"}},{ms:{_desired:"vkk",_distance:"10",_oneway:"true"}},{ms:{_desired:"vkt",_distance:"10",_oneway:"true"}},{ms:{_desired:"xmm",_distance:"10",_oneway:"true"}},{ms:{_desired:"zlm",_distance:"10",_oneway:"true"}},{ms:{_desired:"zmi",_distance:"10",_oneway:"true"}},{ne:{_desired:"dty",_distance:"10",_oneway:"true"}},{om:{_desired:"gax",_distance:"10",_oneway:"true"}},{om:{_desired:"hae",_distance:"10",_oneway:"true"}},{om:{_desired:"orc",_distance:"10",_oneway:"true"}},{or:{_desired:"spv",_distance:"10",_oneway:"true"}},{ps:{_desired:"pbt",_distance:"10",_oneway:"true"}},{ps:{_desired:"pst",_distance:"10",_oneway:"true"}},{qu:{_desired:"qub",_distance:"10",_oneway:"true"}},{qu:{_desired:"qud",_distance:"10",_oneway:"true"}},{qu:{_desired:"quf",_distance:"10",_oneway:"true"}},{qu:{_desired:"qug",_distance:"10",_oneway:"true"}},{qu:{_desired:"quh",_distance:"10",_oneway:"true"}},{qu:{_desired:"quk",_distance:"10",_oneway:"true"}},{qu:{_desired:"qul",_distance:"10",_oneway:"true"}},{qu:{_desired:"qup",_distance:"10",_oneway:"true"}},{qu:{_desired:"qur",_distance:"10",_oneway:"true"}},{qu:{_desired:"qus",_distance:"10",_oneway:"true"}},{qu:{_desired:"quw",_distance:"10",_oneway:"true"}},{qu:{_desired:"qux",_distance:"10",_oneway:"true"}},{qu:{_desired:"quy",_distance:"10",_oneway:"true"}},{qu:{_desired:"qva",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvc",_distance:"10",_oneway:"true"}},{qu:{_desired:"qve",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvh",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvi",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvj",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvl",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvm",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvn",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvo",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvp",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvs",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvw",_distance:"10",_oneway:"true"}},{qu:{_desired:"qvz",_distance:"10",_oneway:"true"}},{qu:{_desired:"qwa",_distance:"10",_oneway:"true"}},{qu:{_desired:"qwc",_distance:"10",_oneway:"true"}},{qu:{_desired:"qwh",_distance:"10",_oneway:"true"}},{qu:{_desired:"qws",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxa",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxc",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxh",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxl",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxn",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxo",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxp",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxr",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxt",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxu",_distance:"10",_oneway:"true"}},{qu:{_desired:"qxw",_distance:"10",_oneway:"true"}},{sc:{_desired:"sdc",_distance:"10",_oneway:"true"}},{sc:{_desired:"sdn",_distance:"10",_oneway:"true"}},{sc:{_desired:"sro",_distance:"10",_oneway:"true"}},{sq:{_desired:"aae",_distance:"10",_oneway:"true"}},{sq:{_desired:"aat",_distance:"10",_oneway:"true"}},{sq:{_desired:"aln",_distance:"10",_oneway:"true"}},{syr:{_desired:"aii",_distance:"10",_oneway:"true"}},{uz:{_desired:"uzs",_distance:"10",_oneway:"true"}},{yi:{_desired:"yih",_distance:"10",_oneway:"true"}},{zh:{_desired:"cdo",_distance:"10",_oneway:"true"}},{zh:{_desired:"cjy",_distance:"10",_oneway:"true"}},{zh:{_desired:"cpx",_distance:"10",_oneway:"true"}},{zh:{_desired:"czh",_distance:"10",_oneway:"true"}},{zh:{_desired:"czo",_distance:"10",_oneway:"true"}},{zh:{_desired:"gan",_distance:"10",_oneway:"true"}},{zh:{_desired:"hak",_distance:"10",_oneway:"true"}},{zh:{_desired:"hsn",_distance:"10",_oneway:"true"}},{zh:{_desired:"lzh",_distance:"10",_oneway:"true"}},{zh:{_desired:"mnp",_distance:"10",_oneway:"true"}},{zh:{_desired:"nan",_distance:"10",_oneway:"true"}},{zh:{_desired:"wuu",_distance:"10",_oneway:"true"}},{zh:{_desired:"yue",_distance:"10",_oneway:"true"}},{"*":{_desired:"*",_distance:"80"}},{"en-Latn":{_desired:"am-Ethi",_distance:"10",_oneway:"true"}},{"ru-Cyrl":{_desired:"az-Latn",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"bn-Beng",_distance:"10",_oneway:"true"}},{"zh-Hans":{_desired:"bo-Tibt",_distance:"10",_oneway:"true"}},{"ru-Cyrl":{_desired:"hy-Armn",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ka-Geor",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"km-Khmr",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"kn-Knda",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"lo-Laoo",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ml-Mlym",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"my-Mymr",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ne-Deva",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"or-Orya",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"pa-Guru",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ps-Arab",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"sd-Arab",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"si-Sinh",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ta-Taml",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"te-Telu",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ti-Ethi",_distance:"10",_oneway:"true"}},{"ru-Cyrl":{_desired:"tk-Latn",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"ur-Arab",_distance:"10",_oneway:"true"}},{"ru-Cyrl":{_desired:"uz-Latn",_distance:"10",_oneway:"true"}},{"en-Latn":{_desired:"yi-Hebr",_distance:"10",_oneway:"true"}},{"sr-Cyrl":{_desired:"sr-Latn",_distance:"5"}},{"zh-Hans":{_desired:"za-Latn",_distance:"10",_oneway:"true"}},{"zh-Hans":{_desired:"zh-Hani",_distance:"20",_oneway:"true"}},{"zh-Hant":{_desired:"zh-Hani",_distance:"20",_oneway:"true"}},{"ar-Arab":{_desired:"ar-Latn",_distance:"20",_oneway:"true"}},{"bn-Beng":{_desired:"bn-Latn",_distance:"20",_oneway:"true"}},{"gu-Gujr":{_desired:"gu-Latn",_distance:"20",_oneway:"true"}},{"hi-Deva":{_desired:"hi-Latn",_distance:"20",_oneway:"true"}},{"kn-Knda":{_desired:"kn-Latn",_distance:"20",_oneway:"true"}},{"ml-Mlym":{_desired:"ml-Latn",_distance:"20",_oneway:"true"}},{"mr-Deva":{_desired:"mr-Latn",_distance:"20",_oneway:"true"}},{"ta-Taml":{_desired:"ta-Latn",_distance:"20",_oneway:"true"}},{"te-Telu":{_desired:"te-Latn",_distance:"20",_oneway:"true"}},{"zh-Hans":{_desired:"zh-Latn",_distance:"20",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Latn",_distance:"5",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Hani",_distance:"5",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Hira",_distance:"5",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Kana",_distance:"5",_oneway:"true"}},{"ja-Jpan":{_desired:"ja-Hrkt",_distance:"5",_oneway:"true"}},{"ja-Hrkt":{_desired:"ja-Hira",_distance:"5",_oneway:"true"}},{"ja-Hrkt":{_desired:"ja-Kana",_distance:"5",_oneway:"true"}},{"ko-Kore":{_desired:"ko-Hani",_distance:"5",_oneway:"true"}},{"ko-Kore":{_desired:"ko-Hang",_distance:"5",_oneway:"true"}},{"ko-Kore":{_desired:"ko-Jamo",_distance:"5",_oneway:"true"}},{"ko-Hang":{_desired:"ko-Jamo",_distance:"5",_oneway:"true"}},{"*-*":{_desired:"*-*",_distance:"50"}},{"ar-*-$maghreb":{_desired:"ar-*-$maghreb",_distance:"4"}},{"ar-*-$!maghreb":{_desired:"ar-*-$!maghreb",_distance:"4"}},{"ar-*-*":{_desired:"ar-*-*",_distance:"5"}},{"en-*-$enUS":{_desired:"en-*-$enUS",_distance:"4"}},{"en-*-GB":{_desired:"en-*-$!enUS",_distance:"3"}},{"en-*-$!enUS":{_desired:"en-*-$!enUS",_distance:"4"}},{"en-*-*":{_desired:"en-*-*",_distance:"5"}},{"es-*-$americas":{_desired:"es-*-$americas",_distance:"4"}},{"es-*-$!americas":{_desired:"es-*-$!americas",_distance:"4"}},{"es-*-*":{_desired:"es-*-*",_distance:"5"}},{"pt-*-$americas":{_desired:"pt-*-$americas",_distance:"4"}},{"pt-*-$!americas":{_desired:"pt-*-$!americas",_distance:"4"}},{"pt-*-*":{_desired:"pt-*-*",_distance:"5"}},{"zh-Hant-$cnsar":{_desired:"zh-Hant-$cnsar",_distance:"4"}},{"zh-Hant-$!cnsar":{_desired:"zh-Hant-$!cnsar",_distance:"4"}},{"zh-Hant-*":{_desired:"zh-Hant-*",_distance:"5"}},{"*-*-*":{_desired:"*-*-*",_distance:"4"}}]}}},m={"001":["001","001-status-grouping","002","005","009","011","013","014","015","017","018","019","021","029","030","034","035","039","053","054","057","061","142","143","145","150","151","154","155","AC","AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CP","CQ","CR","CU","CV","CW","CX","CY","CZ","DE","DG","DJ","DK","DM","DO","DZ","EA","EC","EE","EG","EH","ER","ES","ET","EU","EZ","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","IC","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","QO","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TA","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","UN","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],"002":["002","002-status-grouping","011","014","015","017","018","202","AO","BF","BI","BJ","BW","CD","CF","CG","CI","CM","CV","DJ","DZ","EA","EG","EH","ER","ET","GA","GH","GM","GN","GQ","GW","IC","IO","KE","KM","LR","LS","LY","MA","MG","ML","MR","MU","MW","MZ","NA","NE","NG","RE","RW","SC","SD","SH","SL","SN","SO","SS","ST","SZ","TD","TF","TG","TN","TZ","UG","YT","ZA","ZM","ZW"],"003":["003","013","021","029","AG","AI","AW","BB","BL","BM","BQ","BS","BZ","CA","CR","CU","CW","DM","DO","GD","GL","GP","GT","HN","HT","JM","KN","KY","LC","MF","MQ","MS","MX","NI","PA","PM","PR","SV","SX","TC","TT","US","VC","VG","VI"],"005":["005","AR","BO","BR","BV","CL","CO","EC","FK","GF","GS","GY","PE","PY","SR","UY","VE"],"009":["009","053","054","057","061","AC","AQ","AS","AU","CC","CK","CP","CX","DG","FJ","FM","GU","HM","KI","MH","MP","NC","NF","NR","NU","NZ","PF","PG","PN","PW","QO","SB","TA","TK","TO","TV","UM","VU","WF","WS"],"011":["011","BF","BJ","CI","CV","GH","GM","GN","GW","LR","ML","MR","NE","NG","SH","SL","SN","TG"],"013":["013","BZ","CR","GT","HN","MX","NI","PA","SV"],"014":["014","BI","DJ","ER","ET","IO","KE","KM","MG","MU","MW","MZ","RE","RW","SC","SO","SS","TF","TZ","UG","YT","ZM","ZW"],"015":["015","DZ","EA","EG","EH","IC","LY","MA","SD","TN"],"017":["017","AO","CD","CF","CG","CM","GA","GQ","ST","TD"],"018":["018","BW","LS","NA","SZ","ZA"],"019":["003","005","013","019","019-status-grouping","021","029","419","AG","AI","AR","AW","BB","BL","BM","BO","BQ","BR","BS","BV","BZ","CA","CL","CO","CR","CU","CW","DM","DO","EC","FK","GD","GF","GL","GP","GS","GT","GY","HN","HT","JM","KN","KY","LC","MF","MQ","MS","MX","NI","PA","PE","PM","PR","PY","SR","SV","SX","TC","TT","US","UY","VC","VE","VG","VI"],"021":["021","BM","CA","GL","PM","US"],"029":["029","AG","AI","AW","BB","BL","BQ","BS","CU","CW","DM","DO","GD","GP","HT","JM","KN","KY","LC","MF","MQ","MS","PR","SX","TC","TT","VC","VG","VI"],"030":["030","CN","HK","JP","KP","KR","MN","MO","TW"],"034":["034","AF","BD","BT","IN","IR","LK","MV","NP","PK"],"035":["035","BN","ID","KH","LA","MM","MY","PH","SG","TH","TL","VN"],"039":["039","AD","AL","BA","ES","GI","GR","HR","IT","ME","MK","MT","PT","RS","SI","SM","VA","XK"],"053":["053","AU","CC","CX","HM","NF","NZ"],"054":["054","FJ","NC","PG","SB","VU"],"057":["057","FM","GU","KI","MH","MP","NR","PW","UM"],"061":["061","AS","CK","NU","PF","PN","TK","TO","TV","WF","WS"],142:["030","034","035","142","143","145","AE","AF","AM","AZ","BD","BH","BN","BT","CN","CY","GE","HK","ID","IL","IN","IQ","IR","JO","JP","KG","KH","KP","KR","KW","KZ","LA","LB","LK","MM","MN","MO","MV","MY","NP","OM","PH","PK","PS","QA","SA","SG","SY","TH","TJ","TL","TM","TR","TW","UZ","VN","YE"],143:["143","KG","KZ","TJ","TM","UZ"],145:["145","AE","AM","AZ","BH","CY","GE","IL","IQ","JO","KW","LB","OM","PS","QA","SA","SY","TR","YE"],150:["039","150","151","154","155","AD","AL","AT","AX","BA","BE","BG","BY","CH","CQ","CZ","DE","DK","EE","ES","FI","FO","FR","GB","GG","GI","GR","HR","HU","IE","IM","IS","IT","JE","LI","LT","LU","LV","MC","MD","ME","MK","MT","NL","NO","PL","PT","RO","RS","RU","SE","SI","SJ","SK","SM","UA","VA","XK"],151:["151","BG","BY","CZ","HU","MD","PL","RO","RU","SK","UA"],154:["154","AX","CQ","DK","EE","FI","FO","GB","GG","IE","IM","IS","JE","LT","LV","NO","SE","SJ"],155:["155","AT","BE","CH","DE","FR","LI","LU","MC","NL"],202:["011","014","017","018","202","AO","BF","BI","BJ","BW","CD","CF","CG","CI","CM","CV","DJ","ER","ET","GA","GH","GM","GN","GQ","GW","IO","KE","KM","LR","LS","MG","ML","MR","MU","MW","MZ","NA","NE","NG","RE","RW","SC","SH","SL","SN","SO","SS","ST","SZ","TD","TF","TG","TZ","UG","YT","ZA","ZM","ZW"],419:["005","013","029","419","AG","AI","AR","AW","BB","BL","BO","BQ","BR","BS","BV","BZ","CL","CO","CR","CU","CW","DM","DO","EC","FK","GD","GF","GP","GS","GT","GY","HN","HT","JM","KN","KY","LC","MF","MQ","MS","MX","NI","PA","PE","PR","PY","SR","SV","SX","TC","TT","UY","VC","VE","VG","VI"],EU:["AT","BE","BG","CY","CZ","DE","DK","EE","ES","EU","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK"],EZ:["AT","BE","CY","DE","EE","ES","EZ","FI","FR","GR","IE","IT","LT","LU","LV","MT","NL","PT","SI","SK"],QO:["AC","AQ","CP","DG","QO","TA"],UN:["AD","AE","AF","AG","AL","AM","AO","AR","AT","AU","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BN","BO","BR","BS","BT","BW","BY","BZ","CA","CD","CF","CG","CH","CI","CL","CM","CN","CO","CR","CU","CV","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","ER","ES","ET","FI","FJ","FM","FR","GA","GB","GD","GE","GH","GM","GN","GQ","GR","GT","GW","GY","HN","HR","HT","HU","ID","IE","IL","IN","IQ","IR","IS","IT","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MG","MH","MK","ML","MM","MN","MR","MT","MU","MV","MW","MX","MY","MZ","NA","NE","NG","NI","NL","NO","NP","NR","NZ","OM","PA","PE","PG","PH","PK","PL","PT","PW","PY","QA","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SI","SK","SL","SM","SN","SO","SR","SS","ST","SV","SY","SZ","TD","TG","TH","TJ","TL","TM","TN","TO","TR","TT","TV","TZ","UA","UG","UN","US","UY","UZ","VC","VE","VN","VU","WS","YE","ZA","ZM","ZW"]},g=/-u(?:-[0-9a-z]{2,8})+/gi,b=838},4332:function(e){e.exports=function(){"use strict";return function(e,t,n){t.prototype.isToday=function(){var e="YYYY-MM-DD",t=n();return this.format(e)===t.format(e)}}}()},9014:function(e){e.exports=function(){"use strict";var e="minute",t=/[+-]\d\d(?::?\d\d)?/g,n=/([+-]|\d\d)/g;return function(r,o,i){var a=o.prototype;i.utc=function(e){return new o({date:e,utc:!0,args:arguments})},a.utc=function(t){var n=i(this.toDate(),{locale:this.$L,utc:!0});return t?n.add(this.utcOffset(),e):n},a.local=function(){return i(this.toDate(),{locale:this.$L,utc:!1})};var u=a.parse;a.parse=function(e){e.utc&&(this.$u=!0),this.$utils().u(e.$offset)||(this.$offset=e.$offset),u.call(this,e)};var s=a.init;a.init=function(){if(this.$u){var e=this.$d;this.$y=e.getUTCFullYear(),this.$M=e.getUTCMonth(),this.$D=e.getUTCDate(),this.$W=e.getUTCDay(),this.$H=e.getUTCHours(),this.$m=e.getUTCMinutes(),this.$s=e.getUTCSeconds(),this.$ms=e.getUTCMilliseconds()}else s.call(this)};var c=a.utcOffset;a.utcOffset=function(r,o){var i=this.$utils().u;if(i(r))return this.$u?0:i(this.$offset)?c.call(this):this.$offset;if("string"==typeof r&&(r=function(e){void 0===e&&(e="");var r=e.match(t);if(!r)return null;var o=(""+r[0]).match(n)||["-",0,0],i=o[0],a=60*+o[1]+ +o[2];return 0===a?0:"+"===i?a:-a}(r),null===r))return this;var a=Math.abs(r)<=16?60*r:r,u=this;if(o)return u.$offset=a,u.$u=0===r,u;if(0!==r){var s=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(u=this.local().add(a+s,e)).$offset=a,u.$x.$localOffset=s}else u=this.utc();return u};var l=a.format;a.format=function(e){var t=e||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return l.call(this,t)},a.valueOf=function(){var e=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*e},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var f=a.toDate;a.toDate=function(e){return"s"===e&&this.$offset?i(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():f.call(this)};var d=a.diff;a.diff=function(e,t,n){if(e&&this.$u===e.$u)return d.call(this,e,t,n);var r=this.local(),o=i(e).local();return d.call(r,o,t,n)}}}()},2257:function(e,n,o){var i=Symbol("SemVer ANY"),a=function(){"use strict";function e(n,r){if(t(this,e),r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),u(n,e)){if(n.loose===!!r.loose)return n;n=n.value}d("comparator",n,r),this.options=r,this.loose=!!r.loose,this.parse(n),this.semver===i?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}return r(e,[{key:"parse",value:function(e){var t=this.options.loose?c[l.COMPARATORLOOSE]:c[l.COMPARATOR],n=e.match(t);if(!n)throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new h(n[2],this.options.loose):this.semver=i}},{key:"toString",value:function(){return this.value}},{key:"test",value:function(e){if(d("Comparator.test",e,this.options.loose),this.semver===i||e===i)return!0;if("string"==typeof e)try{e=new h(e,this.options)}catch(e){return!1}return f(e,this.operator,this.semver,this.options)}},{key:"intersects",value:function(t,n){if(!u(t,e))throw new TypeError("a Comparator is required");if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new p(t.value,n).test(this.value);if(""===t.operator)return""===t.value||new p(this.value,n).test(t.semver);var r=!(">="!==this.operator&&">"!==this.operator||">="!==t.operator&&">"!==t.operator),o=!("<="!==this.operator&&"<"!==this.operator||"<="!==t.operator&&"<"!==t.operator),i=this.semver.version===t.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==t.operator&&"<="!==t.operator),s=f(this.semver,"<",t.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===t.operator||"<"===t.operator),c=f(this.semver,">",t.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===t.operator||">"===t.operator);return r||o||i&&a||s||c}}],[{key:"ANY",get:function(){return i}}]),e}();e.exports=a;var s=o(5765),c=s.re,l=s.t,f=o(7539),d=o(4225),h=o(6376),p=o(6902)},6902:function(e,n,o){var i=function(){"use strict";function e(n,r){var o=this;if(t(this,e),r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),u(n,e))return n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease?n:new e(n.raw,r);if(u(n,a))return this.raw=n.value,this.set=[[n]],this.format(),this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=n,this.set=n.split(/\s*\|\|\s*/).map((function(e){return o.parseRange(e.trim())})).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(n));this.format()}return r(e,[{key:"format",value:function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range}},{key:"toString",value:function(){return this.range}},{key:"parseRange",value:function(e){var t=this,n=this.options.loose;e=e.trim();var r=n?f[d.HYPHENRANGELOOSE]:f[d.HYPHENRANGE];e=e.replace(r,P(this.options.includePrerelease)),s("hyphen replace",e),e=e.replace(f[d.COMPARATORTRIM],h),s("comparator trim",e,f[d.COMPARATORTRIM]),e=(e=(e=e.replace(f[d.TILDETRIM],p)).replace(f[d.CARETTRIM],y)).split(/\s+/).join(" ");var o=n?f[d.COMPARATORLOOSE]:f[d.COMPARATOR];return e.split(" ").map((function(e){return m(e,t.options)})).join(" ").split(/\s+/).map((function(e){return k(e,t.options)})).filter(this.options.loose?function(e){return!!e.match(o)}:function(){return!0}).map((function(e){return new a(e,t.options)}))}},{key:"intersects",value:function(t,n){if(!u(t,e))throw new TypeError("a Range is required");return this.set.some((function(e){return v(e,n)&&t.set.some((function(t){return v(t,n)&&e.every((function(e){return t.every((function(t){return e.intersects(t,n)}))}))}))}))}},{key:"test",value:function(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(var t=0;t<this.set.length;t++)if(j(this.set[t],e,this.options))return!0;return!1}}]),e}();e.exports=i;var a=o(2257),s=o(4225),c=o(6376),l=o(5765),f=l.re,d=l.t,h=l.comparatorTrimReplace,p=l.tildeTrimReplace,y=l.caretTrimReplace,v=function(e,t){for(var n=!0,r=e.slice(),o=r.pop();n&&r.length;)n=r.every((function(e){return o.intersects(e,t)})),o=r.pop();return n},m=function(e,t){return s("comp",e,t),e=_(e,t),s("caret",e),e=b(e,t),s("tildes",e),e=O(e,t),s("xrange",e),e=x(e,t),s("stars",e),e},g=function(e){return!e||"x"===e.toLowerCase()||"*"===e},b=function(e,t){return e.trim().split(/\s+/).map((function(e){return w(e,t)})).join(" ")},w=function(e,t){var n=t.loose?f[d.TILDELOOSE]:f[d.TILDE];return e.replace(n,(function(t,n,r,o,i){var a;return s("tilde",e,t,n,r,o,i),g(n)?a="":g(r)?a=">=".concat(n,".0.0 <").concat(+n+1,".0.0-0"):g(o)?a=">=".concat(n,".").concat(r,".0 <").concat(n,".").concat(+r+1,".0-0"):i?(s("replaceTilde pr",i),a=">=".concat(n,".").concat(r,".").concat(o,"-").concat(i," <").concat(n,".").concat(+r+1,".0-0")):a=">=".concat(n,".").concat(r,".").concat(o," <").concat(n,".").concat(+r+1,".0-0"),s("tilde return",a),a}))},_=function(e,t){return e.trim().split(/\s+/).map((function(e){return S(e,t)})).join(" ")},S=function(e,t){s("caret",e,t);var n=t.loose?f[d.CARETLOOSE]:f[d.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,(function(t,n,o,i,a){var u;return s("caret",e,t,n,o,i,a),g(n)?u="":g(o)?u=">=".concat(n,".0.0").concat(r," <").concat(+n+1,".0.0-0"):g(i)?u="0"===n?">=".concat(n,".").concat(o,".0").concat(r," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".0").concat(r," <").concat(+n+1,".0.0-0"):a?(s("replaceCaret pr",a),u="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(i,"-").concat(a," <").concat(n,".").concat(o,".").concat(+i+1,"-0"):">=".concat(n,".").concat(o,".").concat(i,"-").concat(a," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(i,"-").concat(a," <").concat(+n+1,".0.0-0")):(s("no pr"),u="0"===n?"0"===o?">=".concat(n,".").concat(o,".").concat(i).concat(r," <").concat(n,".").concat(o,".").concat(+i+1,"-0"):">=".concat(n,".").concat(o,".").concat(i).concat(r," <").concat(n,".").concat(+o+1,".0-0"):">=".concat(n,".").concat(o,".").concat(i," <").concat(+n+1,".0.0-0")),s("caret return",u),u}))},O=function(e,t){return s("replaceXRanges",e,t),e.split(/\s+/).map((function(e){return E(e,t)})).join(" ")},E=function(e,t){e=e.trim();var n=t.loose?f[d.XRANGELOOSE]:f[d.XRANGE];return e.replace(n,(function(n,r,o,i,a,u){s("xRange",e,n,r,o,i,a,u);var c=g(o),l=c||g(i),f=l||g(a),d=f;return"="===r&&d&&(r=""),u=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(l&&(i=0),a=0,">"===r?(r=">=",l?(o=+o+1,i=0,a=0):(i=+i+1,a=0)):"<="===r&&(r="<",l?o=+o+1:i=+i+1),"<"===r&&(u="-0"),n="".concat(r+o,".").concat(i,".").concat(a).concat(u)):l?n=">=".concat(o,".0.0").concat(u," <").concat(+o+1,".0.0-0"):f&&(n=">=".concat(o,".").concat(i,".0").concat(u," <").concat(o,".").concat(+i+1,".0-0")),s("xRange return",n),n}))},x=function(e,t){return s("replaceStars",e,t),e.trim().replace(f[d.STAR],"")},k=function(e,t){return s("replaceGTE0",e,t),e.trim().replace(f[t.includePrerelease?d.GTE0PRE:d.GTE0],"")},P=function(e){return function(t,n,r,o,i,a,u,s,c,l,f,d,h){return"".concat(n=g(r)?"":g(o)?">=".concat(r,".0.0").concat(e?"-0":""):g(i)?">=".concat(r,".").concat(o,".0").concat(e?"-0":""):a?">=".concat(n):">=".concat(n).concat(e?"-0":"")," ").concat(s=g(c)?"":g(l)?"<".concat(+c+1,".0.0-0"):g(f)?"<".concat(c,".").concat(+l+1,".0-0"):d?"<=".concat(c,".").concat(l,".").concat(f,"-").concat(d):e?"<".concat(c,".").concat(l,".").concat(+f+1,"-0"):"<=".concat(s)).trim()}},j=function(e,t,n){for(var r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(var o=0;o<e.length;o++)if(s(e[o].semver),e[o].semver!==a.ANY&&e[o].semver.prerelease.length>0){var i=e[o].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}},6376:function(e,n,o){var i=o(4225),a=o(3295),s=a.MAX_LENGTH,c=a.MAX_SAFE_INTEGER,l=o(5765),f=l.re,d=l.t,h=o(6742).compareIdentifiers,p=function(){"use strict";function e(n,r){if(t(this,e),r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),u(n,e)){if(n.loose===!!r.loose&&n.includePrerelease===!!r.includePrerelease)return n;n=n.version}else if("string"!=typeof n)throw new TypeError("Invalid Version: ".concat(n));if(n.length>s)throw new TypeError("version is longer than ".concat(s," characters"));i("SemVer",n,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;var o=n.trim().match(r.loose?f[d.LOOSE]:f[d.FULL]);if(!o)throw new TypeError("Invalid Version: ".concat(n));if(this.raw=n,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>c||this.major<0)throw new TypeError("Invalid major version");if(this.minor>c||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>c||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<c)return t}return e})):this.prerelease=[],this.build=o[5]?o[5].split("."):[],this.format()}return r(e,[{key:"format",value:function(){return this.version="".concat(this.major,".").concat(this.minor,".").concat(this.patch),this.prerelease.length&&(this.version+="-".concat(this.prerelease.join("."))),this.version}},{key:"toString",value:function(){return this.version}},{key:"compare",value:function(t){if(i("SemVer.compare",this.version,this.options,t),!u(t,e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}},{key:"compareMain",value:function(t){return u(t,e)||(t=new e(t,this.options)),h(this.major,t.major)||h(this.minor,t.minor)||h(this.patch,t.patch)}},{key:"comparePre",value:function(t){if(u(t,e)||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;var n=0;do{var r=this.prerelease[n],o=t.prerelease[n];if(i("prerelease compare",n,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return h(r,o)}while(++n)}},{key:"compareBuild",value:function(t){u(t,e)||(t=new e(t,this.options));var n=0;do{var r=this.build[n],o=t.build[n];if(i("prerelease compare",n,r,o),void 0===r&&void 0===o)return 0;if(void 0===o)return 1;if(void 0===r)return-1;if(r!==o)return h(r,o)}while(++n)}},{key:"inc",value:function(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var n=this.prerelease.length;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);-1===n&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error("invalid increment argument: ".concat(e))}return this.format(),this.raw=this.version,this}}]),e}();e.exports=p},3507:function(e,t,n){var r=n(3959);e.exports=function(e,t){var n=r(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}},7539:function(e,t,n){var r=n(8718),o=n(1194),i=n(1312),a=n(5903),u=n(1544),s=n(2056);e.exports=function(e,t,n,c){switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return r(e,n,c);case"!=":return o(e,n,c);case">":return i(e,n,c);case">=":return a(e,n,c);case"<":return u(e,n,c);case"<=":return s(e,n,c);default:throw new TypeError("Invalid operator: ".concat(t))}}},9038:function(e,t,n){var r=n(6376),o=n(3959),i=n(5765),a=i.re,s=i.t;e.exports=function(e,t){if(u(e,r))return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;var n=null;if((t=t||{}).rtl){for(var i;(i=a[s.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&i.index+i[0].length===n.index+n[0].length||(n=i),a[s.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;a[s.COERCERTL].lastIndex=-1}else n=e.match(a[s.COERCE]);return null===n?null:o("".concat(n[2],".").concat(n[3]||"0",".").concat(n[4]||"0"),t)}},8880:function(e,t,n){var r=n(6376);e.exports=function(e,t,n){var o=new r(e,n),i=new r(t,n);return o.compare(i)||o.compareBuild(i)}},7880:function(e,t,n){var r=n(6269);e.exports=function(e,t){return r(e,t,!0)}},6269:function(e,t,n){var r=n(6376);e.exports=function(e,t,n){return new r(e,n).compare(new r(t,n))}},2378:function(e,t,n){var r=n(3959),o=n(8718);e.exports=function(e,t){if(o(e,t))return null;var n=r(e),i=r(t),a=n.prerelease.length||i.prerelease.length,u=a?"pre":"",s=a?"prerelease":"";for(var c in n)if(("major"===c||"minor"===c||"patch"===c)&&n[c]!==i[c])return u+c;return s}},8718:function(e,t,n){var r=n(6269);e.exports=function(e,t,n){return 0===r(e,t,n)}},1312:function(e,t,n){var r=n(6269);e.exports=function(e,t,n){return r(e,t,n)>0}},5903:function(e,t,n){var r=n(6269);e.exports=function(e,t,n){return r(e,t,n)>=0}},253:function(e,t,n){var r=n(6376);e.exports=function(e,t,n,o){"string"==typeof n&&(o=n,n=void 0);try{return new r(e,n).inc(t,o).version}catch(e){return null}}},1544:function(e,t,n){var r=n(6269);e.exports=function(e,t,n){return r(e,t,n)<0}},2056:function(e,t,n){var r=n(6269);e.exports=function(e,t,n){return r(e,t,n)<=0}},8679:function(e,t,n){var r=n(6376);e.exports=function(e,t){return new r(e,t).major}},7789:function(e,t,n){var r=n(6376);e.exports=function(e,t){return new r(e,t).minor}},1194:function(e,t,n){var r=n(6269);e.exports=function(e,t,n){return 0!==r(e,t,n)}},3959:function(e,t,n){var r=n(3295).MAX_LENGTH,o=n(5765),i=o.re,a=o.t,s=n(6376);e.exports=function(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),u(e,s))return e;if("string"!=typeof e)return null;if(e.length>r)return null;if(!(t.loose?i[a.LOOSE]:i[a.FULL]).test(e))return null;try{return new s(e,t)}catch(e){return null}}},2358:function(e,t,n){var r=n(6376);e.exports=function(e,t){return new r(e,t).patch}},7559:function(e,t,n){var r=n(3959);e.exports=function(e,t){var n=r(e,t);return n&&n.prerelease.length?n.prerelease:null}},9795:function(e,t,n){var r=n(6269);e.exports=function(e,t,n){return r(t,e,n)}},3657:function(e,t,n){var r=n(8880);e.exports=function(e,t){return e.sort((function(e,n){return r(n,e,t)}))}},5712:function(e,t,n){var r=n(6902);e.exports=function(e,t,n){try{t=new r(t,n)}catch(e){return!1}return t.test(e)}},1100:function(e,t,n){var r=n(8880);e.exports=function(e,t){return e.sort((function(e,n){return r(e,n,t)}))}},6397:function(e,t,n){var r=n(3959);e.exports=function(e,t){var n=r(e,t);return n?n.version:null}},1249:function(e,t,n){var r=n(5765);e.exports={re:r.re,src:r.src,tokens:r.t,SEMVER_SPEC_VERSION:n(3295).SEMVER_SPEC_VERSION,SemVer:n(6376),compareIdentifiers:n(6742).compareIdentifiers,rcompareIdentifiers:n(6742).rcompareIdentifiers,parse:n(3959),valid:n(6397),clean:n(3507),inc:n(253),diff:n(2378),major:n(8679),minor:n(7789),patch:n(2358),prerelease:n(7559),compare:n(6269),rcompare:n(9795),compareLoose:n(7880),compareBuild:n(8880),sort:n(1100),rsort:n(3657),gt:n(1312),lt:n(1544),eq:n(8718),neq:n(1194),gte:n(5903),lte:n(2056),cmp:n(7539),coerce:n(9038),Comparator:n(2257),Range:n(6902),satisfies:n(5712),toComparators:n(1042),maxSatisfying:n(5775),minSatisfying:n(1657),minVersion:n(5316),validRange:n(9042),outside:n(6826),gtr:n(7606),ltr:n(32),intersects:n(2937),simplifyRange:n(7908),subset:n(799)}},3295:function(e){var t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:t,MAX_SAFE_COMPONENT_LENGTH:16}},4225:function(e){var t,n="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return(t=console).error.apply(t,["SEMVER"].concat(f(n)))}:function(){};e.exports=n},6742:function(e){var t=/^[0-9]+$/,n=function(e,n){var r=t.test(e),o=t.test(n);return r&&o&&(e=+e,n=+n),e===n?0:r&&!o?-1:o&&!r?1:e<n?-1:1};e.exports={compareIdentifiers:n,rcompareIdentifiers:function(e,t){return n(t,e)}}},5765:function(e,t,n){var r=n(3295).MAX_SAFE_COMPONENT_LENGTH,o=n(4225),i=(t=e.exports={}).re=[],a=t.src=[],u=t.t={},s=0,c=function(e,t,n){var r=s++;o(r,t),u[e]=r,a[r]=t,i[r]=new RegExp(t,n?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION","(".concat(a[u.NUMERICIDENTIFIER],")\\.(").concat(a[u.NUMERICIDENTIFIER],")\\.(").concat(a[u.NUMERICIDENTIFIER],")")),c("MAINVERSIONLOOSE","(".concat(a[u.NUMERICIDENTIFIERLOOSE],")\\.(").concat(a[u.NUMERICIDENTIFIERLOOSE],")\\.(").concat(a[u.NUMERICIDENTIFIERLOOSE],")")),c("PRERELEASEIDENTIFIER","(?:".concat(a[u.NUMERICIDENTIFIER],"|").concat(a[u.NONNUMERICIDENTIFIER],")")),c("PRERELEASEIDENTIFIERLOOSE","(?:".concat(a[u.NUMERICIDENTIFIERLOOSE],"|").concat(a[u.NONNUMERICIDENTIFIER],")")),c("PRERELEASE","(?:-(".concat(a[u.PRERELEASEIDENTIFIER],"(?:\\.").concat(a[u.PRERELEASEIDENTIFIER],")*))")),c("PRERELEASELOOSE","(?:-?(".concat(a[u.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(a[u.PRERELEASEIDENTIFIERLOOSE],")*))")),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD","(?:\\+(".concat(a[u.BUILDIDENTIFIER],"(?:\\.").concat(a[u.BUILDIDENTIFIER],")*))")),c("FULLPLAIN","v?".concat(a[u.MAINVERSION]).concat(a[u.PRERELEASE],"?").concat(a[u.BUILD],"?")),c("FULL","^".concat(a[u.FULLPLAIN],"$")),c("LOOSEPLAIN","[v=\\s]*".concat(a[u.MAINVERSIONLOOSE]).concat(a[u.PRERELEASELOOSE],"?").concat(a[u.BUILD],"?")),c("LOOSE","^".concat(a[u.LOOSEPLAIN],"$")),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE","".concat(a[u.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),c("XRANGEIDENTIFIER","".concat(a[u.NUMERICIDENTIFIER],"|x|X|\\*")),c("XRANGEPLAIN","[v=\\s]*(".concat(a[u.XRANGEIDENTIFIER],")(?:\\.(").concat(a[u.XRANGEIDENTIFIER],")(?:\\.(").concat(a[u.XRANGEIDENTIFIER],")(?:").concat(a[u.PRERELEASE],")?").concat(a[u.BUILD],"?)?)?")),c("XRANGEPLAINLOOSE","[v=\\s]*(".concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:\\.(").concat(a[u.XRANGEIDENTIFIERLOOSE],")(?:").concat(a[u.PRERELEASELOOSE],")?").concat(a[u.BUILD],"?)?)?")),c("XRANGE","^".concat(a[u.GTLT],"\\s*").concat(a[u.XRANGEPLAIN],"$")),c("XRANGELOOSE","^".concat(a[u.GTLT],"\\s*").concat(a[u.XRANGEPLAINLOOSE],"$")),c("COERCE","(^|[^\\d])(\\d{1,".concat(r,"})(?:\\.(\\d{1,").concat(r,"}))?(?:\\.(\\d{1,").concat(r,"}))?(?:$|[^\\d])")),c("COERCERTL",a[u.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM","(\\s*)".concat(a[u.LONETILDE],"\\s+"),!0),t.tildeTrimReplace="$1~",c("TILDE","^".concat(a[u.LONETILDE]).concat(a[u.XRANGEPLAIN],"$")),c("TILDELOOSE","^".concat(a[u.LONETILDE]).concat(a[u.XRANGEPLAINLOOSE],"$")),c("LONECARET","(?:\\^)"),c("CARETTRIM","(\\s*)".concat(a[u.LONECARET],"\\s+"),!0),t.caretTrimReplace="$1^",c("CARET","^".concat(a[u.LONECARET]).concat(a[u.XRANGEPLAIN],"$")),c("CARETLOOSE","^".concat(a[u.LONECARET]).concat(a[u.XRANGEPLAINLOOSE],"$")),c("COMPARATORLOOSE","^".concat(a[u.GTLT],"\\s*(").concat(a[u.LOOSEPLAIN],")$|^$")),c("COMPARATOR","^".concat(a[u.GTLT],"\\s*(").concat(a[u.FULLPLAIN],")$|^$")),c("COMPARATORTRIM","(\\s*)".concat(a[u.GTLT],"\\s*(").concat(a[u.LOOSEPLAIN],"|").concat(a[u.XRANGEPLAIN],")"),!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE","^\\s*(".concat(a[u.XRANGEPLAIN],")\\s+-\\s+(").concat(a[u.XRANGEPLAIN],")\\s*$")),c("HYPHENRANGELOOSE","^\\s*(".concat(a[u.XRANGEPLAINLOOSE],")\\s+-\\s+(").concat(a[u.XRANGEPLAINLOOSE],")\\s*$")),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0.0.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")},7606:function(e,t,n){var r=n(6826);e.exports=function(e,t,n){return r(e,t,">",n)}},2937:function(e,t,n){var r=n(6902);e.exports=function(e,t,n){return e=new r(e,n),t=new r(t,n),e.intersects(t)}},32:function(e,t,n){var r=n(6826);e.exports=function(e,t,n){return r(e,t,"<",n)}},5775:function(e,t,n){var r=n(6376),o=n(6902);e.exports=function(e,t,n){var i=null,a=null,u=null;try{u=new o(t,n)}catch(e){return null}return e.forEach((function(e){u.test(e)&&(i&&-1!==a.compare(e)||(a=new r(i=e,n)))})),i}},1657:function(e,t,n){var r=n(6376),o=n(6902);e.exports=function(e,t,n){var i=null,a=null,u=null;try{u=new o(t,n)}catch(e){return null}return e.forEach((function(e){u.test(e)&&(i&&1!==a.compare(e)||(a=new r(i=e,n)))})),i}},5316:function(e,t,n){var r=n(6376),o=n(6902),i=n(1312);e.exports=function(e,t){e=new o(e,t);var n=new r("0.0.0");if(e.test(n))return n;if(n=new r("0.0.0-0"),e.test(n))return n;n=null;for(var a=0;a<e.set.length;++a)e.set[a].forEach((function(e){var t=new r(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":n&&!i(n,t)||(n=t);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: ".concat(e.operator))}}));return n&&e.test(n)?n:null}},6826:function(e,t,n){var r=n(6376),o=n(2257),i=o.ANY,a=n(6902),u=n(5712),s=n(1312),c=n(1544),l=n(2056),f=n(5903);e.exports=function(e,t,n,h){var p,y,v,m,g,b=function(n){var r=t.set[n],a=null,u=null;return r.forEach((function(e){e.semver===i&&(e=new o(">=0.0.0")),a=a||e,u=u||e,p(e.semver,a.semver,h)?a=e:v(e.semver,u.semver,h)&&(u=e)})),a.operator===m||a.operator===g?{v:!1}:u.operator&&u.operator!==m||!y(e,u.semver)?u.operator===g&&v(e,u.semver)?{v:!1}:void 0:{v:!1}};switch(e=new r(e,h),t=new a(t,h),n){case">":p=s,y=l,v=c,m=">",g=">=";break;case"<":p=c,y=f,v=s,m="<",g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(u(e,t,h))return!1;for(var w=0;w<t.set.length;++w){var _=b(w);if("object"===d(_))return _.v}return!0}},7908:function(e,t,n){var r=n(5712),o=n(6269);e.exports=function(e,t,n){var i=[],a=null,u=null,s=e.sort((function(e,t){return o(e,t,n)})),c=!0,f=!1,d=void 0;try{for(var h,p=s[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var y=h.value;r(y,t,n)?(u=y,a||(a=y)):(u&&i.push([a,u]),u=null,a=null)}}catch(e){f=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}a&&i.push([a,null]);var v=[],m=!0,g=!1,b=void 0;try{for(var w,_=i[Symbol.iterator]();!(m=(w=_.next()).done);m=!0){var S=l(w.value,2),O=S[0],E=S[1];O===E?v.push(O):E||O!==s[0]?E?O===s[0]?v.push("<=".concat(E)):v.push("".concat(O," - ").concat(E)):v.push(">=".concat(O)):v.push("*")}}catch(e){g=!0,b=e}finally{try{m||null==_.return||_.return()}finally{if(g)throw b}}var x=v.join(" || "),k="string"==typeof t.raw?t.raw:String(t);return x.length<k.length?x:t}},799:function(e,t,n){var r=n(6902),o=n(2257).ANY,i=n(5712),a=n(6269),u=function(e,t,n){if(1===e.length&&e[0].semver===o)return 1===t.length&&t[0].semver===o;var r,u,l,f,d,h=new Set,p=!0,y=!1,v=void 0;try{for(var m,g=e[Symbol.iterator]();!(p=(m=g.next()).done);p=!0){var b=m.value;">"===b.operator||">="===b.operator?r=s(r,b,n):"<"===b.operator||"<="===b.operator?u=c(u,b,n):h.add(b.semver)}}catch(e){y=!0,v=e}finally{try{p||null==g.return||g.return()}finally{if(y)throw v}}if(h.size>1)return null;if(r&&u){if((l=a(r.semver,u.semver,n))>0)return null;if(0===l&&(">="!==r.operator||"<="!==u.operator))return null}var w=!0,_=!1,S=void 0;try{for(var O,E=h[Symbol.iterator]();!(w=(O=E.next()).done);w=!0){var x=O.value;if(r&&!i(x,String(r),n))return null;if(u&&!i(x,String(u),n))return null;var k=!0,P=!1,j=void 0;try{for(var A,T=t[Symbol.iterator]();!(k=(A=T.next()).done);k=!0){var D=A.value;if(!i(x,String(D),n))return!1}}catch(e){P=!0,j=e}finally{try{k||null==T.return||T.return()}finally{if(P)throw j}}return!0}}catch(e){_=!0,S=e}finally{try{w||null==E.return||E.return()}finally{if(_)throw S}}var C=!0,I=!1,M=void 0;try{for(var R,N=t[Symbol.iterator]();!(C=(R=N.next()).done);C=!0){var L=R.value;if(d=d||">"===L.operator||">="===L.operator,f=f||"<"===L.operator||"<="===L.operator,r)if(">"===L.operator||">="===L.operator){if(s(r,L,n)===L)return!1}else if(">="===r.operator&&!i(r.semver,String(L),n))return!1;if(u)if("<"===L.operator||"<="===L.operator){if(c(u,L,n)===L)return!1}else if("<="===u.operator&&!i(u.semver,String(L),n))return!1;if(!L.operator&&(u||r)&&0!==l)return!1}}catch(e){I=!0,M=e}finally{try{C||null==N.return||N.return()}finally{if(I)throw M}}return!(r&&f&&!u&&0!==l||u&&d&&!r&&0!==l)},s=function(e,t,n){if(!e)return t;var r=a(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},c=function(e,t,n){if(!e)return t;var r=a(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=function(e,t,n){e=new r(e,n),t=new r(t,n);var o=!1,i=!0,a=!1,s=void 0;try{e:for(var c,l=e.set[Symbol.iterator]();!(i=(c=l.next()).done);i=!0){var f=c.value,d=!0,h=!1,p=void 0;try{for(var y,v=t.set[Symbol.iterator]();!(d=(y=v.next()).done);d=!0){var m=y.value,g=u(f,m,n);if(o=o||null!==g,g)continue e}}catch(e){h=!0,p=e}finally{try{d||null==v.return||v.return()}finally{if(h)throw p}}if(o)return!1}}catch(e){a=!0,s=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw s}}return!0}},1042:function(e,t,n){var r=n(6902);e.exports=function(e,t){return new r(e,t).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))}},9042:function(e,t,n){var r=n(6902);e.exports=function(e,t){try{return new r(e,t).range||"*"}catch(e){return null}}},9688:function(e){"use strict";e.exports=c},2712:function(e,t,n){"use strict";var r=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}I(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)},o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},i=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},a=function(e,t){return function(n,r){t(n,r,e)}},s=function(e,t,n,r,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var u,s=r.kind,c="getter"===s?"get":"setter"===s?"set":"value",l=!t&&e?r.static?e:e.prototype:null,f=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d=!1,h=n.length-1;h>=0;h--){var p={};for(var y in r)p[y]="access"===y?{}:r[y];for(var y in r.access)p.access[y]=r.access[y];p.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var v=(0,n[h])("accessor"===s?{get:f.get,set:f.set}:f[c],p);if("accessor"===s){if(void 0===v)continue;if(null===v||"object"!=typeof v)throw new TypeError("Object expected");(u=a(v.get))&&(f.get=u),(u=a(v.set))&&(f.set=u),(u=a(v.init))&&o.unshift(u)}else(u=a(v))&&("field"===s?o.unshift(u):f[c]=u)}l&&Object.defineProperty(l,r.name,f),d=!0},c=function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0},l=function(e){return"symbol"==(void 0===e?"undefined":d(e))?e:"".concat(e)},f=function(e,t,n){return"symbol"==(void 0===t?"undefined":d(t))&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},h=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},p=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,u(t,n)?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},y=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(s){return function(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,r=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],r=0}finally{n=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,s])}}},v=function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||R(t,e,n)},m=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},g=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},b=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(g(arguments[t]));return e},w=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,u=i.length;a<u;a++,o++)r[o]=i[a];return r},_=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},S=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||s(e,t)}))})}function s(e,t){try{u((n=o[e](t)).value,N)?Promise.resolve(n.value.v).then(c,l):f(i[0][2],n)}catch(e){f(i[0][3],e)}var n}function c(e){s("next",e)}function l(e){s("throw",e)}function f(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}},O=function(e){var t,n;return t={},r("next"),r("throw",(function(e){throw e})),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:N(e[r](t)),done:!1}:o?o(t):t}:o}},E=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=m(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,o,(t=e[n](t)).done,t.value)}))}}},x=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},k=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&R(t,e,n);return L(t,e),t},P=function(e){return e&&e.__esModule?e:{default:e}},j=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},A=function(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n},T=function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)},D=function(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t},C=function(e){function t(t){e.error=e.hasError?new F(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var r=e.stack.pop();try{var o=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(o).then(n,(function(e){return t(e),n()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()};n.r(t),n.d(t,{__addDisposableResource:function(){return D},__assign:function(){return M},__asyncDelegator:function(){return O},__asyncGenerator:function(){return S},__asyncValues:function(){return E},__await:function(){return N},__awaiter:function(){return p},__classPrivateFieldGet:function(){return j},__classPrivateFieldIn:function(){return T},__classPrivateFieldSet:function(){return A},__createBinding:function(){return R},__decorate:function(){return i},__disposeResources:function(){return C},__esDecorate:function(){return s},__exportStar:function(){return v},__extends:function(){return r},__generator:function(){return y},__importDefault:function(){return P},__importStar:function(){return k},__makeTemplateObject:function(){return x},__metadata:function(){return h},__param:function(){return a},__propKey:function(){return l},__read:function(){return g},__rest:function(){return o},__runInitializers:function(){return c},__setFunctionName:function(){return f},__spread:function(){return b},__spreadArray:function(){return _},__spreadArrays:function(){return w},__values:function(){return m},default:function(){return B}});var I=function(e,t){return I=Object.setPrototypeOf||u({__proto__:[]},Array)&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},I(e,t)},M=function(){return M=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},M.apply(this,arguments)},R=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function N(e){return u(this,N)?(this.v=e,this):new N(e)}var L=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t},F="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r},B={__extends:r,__assign:M,__rest:o,__decorate:i,__param:a,__metadata:h,__awaiter:p,__generator:y,__createBinding:R,__exportStar:v,__values:m,__read:g,__spread:b,__spreadArrays:w,__spreadArray:_,__await:N,__asyncGenerator:S,__asyncDelegator:O,__asyncValues:E,__makeTemplateObject:x,__importStar:k,__importDefault:P,__classPrivateFieldGet:j,__classPrivateFieldSet:A,__classPrivateFieldIn:T,__addDisposableResource:D,__disposeResources:C}}},n={};function h(t){var r=n[t];if(void 0!==r)return r.exports;var o=n[t]={exports:{}};return e[t].call(o.exports,o,o.exports,h),o.exports}h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,{a:t}),t},h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var y={};return function(){"use strict";var e=function(e,t){var r=e.copy(),o="hour"in r?function(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,function(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=w(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=w(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=w(e.minute,60);var t=Math.floor(e.hour/24);return e.hour=w(e.hour,24),t}(e)}(r,t):0;n(r,t.years||0),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e),r.month+=t.months||0,c(r),v(r),r.day+=7*(t.weeks||0),r.day+=t.days||0,r.day+=o,function(e){for(;e.day<1;)e.month--,c(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,c(e)}(r),r.calendar.balanceDate&&r.calendar.balanceDate(r),r.year<1&&(r.year=1,r.month=1,r.day=1);var i=r.calendar.getYearsInEra(r);if(r.year>i){var a,u,s=null===(a=(u=r.calendar).isInverseEra)||void 0===a?void 0:a.call(u,r);r.year=i,r.month=s?1:r.calendar.getMonthsInYear(r),r.day=s?1:r.calendar.getDaysInMonth(r)}r.month<1&&(r.month=1,r.day=1);var l=r.calendar.getMonthsInYear(r);return r.month>l&&(r.month=l,r.day=r.calendar.getDaysInMonth(r)),r.day=Math.max(1,Math.min(r.calendar.getDaysInMonth(r),r.day)),r},n=function(e,t){var n,r;(null===(n=(r=e.calendar).isInverseEra)||void 0===n?void 0:n.call(r,e))&&(t=-t),e.year+=t},c=function(e){for(;e.month<1;)n(e,-1),e.month+=e.calendar.getMonthsInYear(e);for(var t=0;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,n(e,1)},v=function(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))},m=function(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),v(e)},g=function(t,n){return e(t,function(e){var t={};for(var n in e)"number"==typeof e[n]&&(t[n]=-e[n]);return t}(n))},b=function(e,t){var n=e.copy();return null!=t.era&&(n.era=t.era),null!=t.year&&(n.year=t.year),null!=t.month&&(n.month=t.month),null!=t.day&&(n.day=t.day),m(n),n},w=function(e,t){var n=e%t;return n<0&&(n+=t),n},_=function(e,t,n,r){var o=e.copy();switch(t){case"era":var i=e.calendar.getEras(),a=i.indexOf(e.era);if(a<0)throw new Error("Invalid era: "+e.era);a=S(a,n,0,i.length-1,null==r?void 0:r.round),o.era=i[a],m(o);break;case"year":var u,s;(null===(u=(s=o.calendar).isInverseEra)||void 0===u?void 0:u.call(s,o))&&(n=-n),o.year=S(e.year,n,-1/0,9999,null==r?void 0:r.round),o.year===-1/0&&(o.year=1),o.calendar.balanceYearMonth&&o.calendar.balanceYearMonth(o,e);break;case"month":o.month=S(e.month,n,1,e.calendar.getMonthsInYear(e),null==r?void 0:r.round);break;case"day":o.day=S(e.day,n,1,e.calendar.getDaysInMonth(e),null==r?void 0:r.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(o),m(o),o},S=function(e,t,n,r){if(arguments.length>4&&void 0!==arguments[4]&&arguments[4]){(e+=Math.sign(t))<n&&(e=r);var o=Math.abs(t);(e=t>0?Math.ceil(e/o)*o:Math.floor(e/o)*o)>r&&(e=n)}else(e+=t)<n?e=r-(n-e-1):e>r&&(e=n+(e-r-1));return e},O=function(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)},E=function(e){return 36e5*e.hour+6e4*e.minute+1e3*e.second+e.millisecond},x=function(){return null==$e&&($e=(new Intl.DateTimeFormat).resolvedOptions().timeZone),$e},k=function(e,t){return e-t*Math.floor(e/t)},P=function(e,t,n,r){var o=(t=A(e,t))-1,i=-2;return n<=2?i=0:j(t)&&(i=-1),1721425+365*o+Math.floor(o/4)-Math.floor(o/100)+Math.floor(o/400)+Math.floor((367*n-362)/12+i+r)},j=function(e){return e%4==0&&(e%100!=0||e%400==0)},A=function(e,t){return"BC"===e?1-t:t},T=function(e){var t="AD";return e<=0&&(t="BC",e=1-e),[t,e]},D=function(e){var t=U(e,new Ze);return"".concat(String(t.year).padStart(4,"0"),"-").concat(String(t.month).padStart(2,"0"),"-").concat(String(t.day).padStart(2,"0"))},C=function(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)},I=function(e){var t,n="object"==typeof e[0]?e.shift():new Ze;if("string"==typeof e[0])t=e.shift();else{var r=n.getEras();t=r[r.length-1]}return[n,t,e.shift(),e.shift(),e.shift()]},M=function(e){return R(A((e=U(e,new Ze)).era,e.year),e.month,e.day,e.hour,e.minute,e.second,e.millisecond)},R=function(e,t,n,r,o,i,a){var u=new Date;return u.setUTCHours(r,o,i,a),u.setUTCFullYear(e,t-1,n),u.getTime()},N=function(e,t){if("UTC"===t)return 0;if(e>0&&t===x())return-6e4*new Date(e).getTimezoneOffset();var n=L(e,t),r=n.year,o=n.month,i=n.day,a=n.hour,u=n.minute,s=n.second;return R(r,o,i,a,u,s,0)-1e3*Math.floor(e/1e3)},L=function(e,t){var n=rt.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),rt.set(t,n));var r=n.formatToParts(new Date(e)),o={},i=!0,a=!1,u=void 0;try{for(var s,c=r[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var l=s.value;"literal"!==l.type&&(o[l.type]=l.value)}}catch(e){a=!0,u=e}finally{try{i||null==c.return||c.return()}finally{if(a)throw u}}return{year:"BC"===o.era||"B"===o.era?1-o.year:+o.year,month:+o.month,day:+o.day,hour:"24"===o.hour?0:+o.hour,minute:+o.minute,second:+o.second}},F=function(e,t){return new Date(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compatible",r=B(e);if("UTC"===t)return M(r);if(t===x()&&"compatible"===n){r=U(r,new Ze);var o=new Date,i=A(r.era,r.year);return o.setFullYear(i,r.month-1,r.day),o.setHours(r.hour,r.minute,r.second,r.millisecond),o.getTime()}var a=M(r),u=N(a-ot,t),s=N(a+ot,t),c=function(e,t,n,r){return(n===r?[n]:[n,r]).filter((function(n){return function(e,t,n){var r=L(n,t);return e.year===r.year&&e.month===r.month&&e.day===r.day&&e.hour===r.hour&&e.minute===r.minute&&e.second===r.second}(e,t,n)}))}(r,t,a-u,a-s);if(1===c.length)return c[0];if(c.length>1)switch(n){case"compatible":case"earlier":return c[0];case"later":return c[c.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(a-u,a-s);case"compatible":case"later":return Math.max(a-u,a-s);case"reject":throw new RangeError("No such absolute time found")}}(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"compatible"))},B=function(e,t){var n,r,o=0,i=0,a=0,u=0;if("timeZone"in e)o=(n=e).hour,i=n.minute,a=n.second,u=n.millisecond;else if("hour"in e&&!t)return e;return t&&(o=(r=t).hour,i=r.minute,a=r.second,u=r.millisecond),new nt(e.calendar,e.era,e.year,e.month,e.day,o,i,a,u)},U=function(e,t){if(e.calendar.identifier===t.identifier)return e;var n=t.fromJulianDay(e.calendar.toJulianDay(e)),r=e.copy();return r.calendar=t,r.era=n.era,r.year=n.year,r.month=n.month,r.day=n.day,m(r),r},K=function(e){var t=l(T(e.year+-543),2),n=t[0],r=t[1];return new et(n,r,e.month,e.day)},z=function(e,t,n,r){return e+365*t+Math.floor(t/4)+30*(n-1)+r-1},V=function(e,t){var n=Math.floor(4*(t-e)/1461),r=1+Math.floor((t-z(e,n,1,1))/30);return[n,r,t+1-z(e,n,r,1)]},G=function(e){return Math.floor(e%4/3)},H=function(e,t){return t%13!=0?30:G(e)+5},q=function(e){return k(7*e+1,19)<7},W=function(e){var t=Math.floor((235*e-234)/19),n=12084+13753*t,r=29*t+Math.floor(n/25920);return k(3*(r+1),7)<3&&(r+=1),r},$=function(e){return W(e)+function(e){var t=W(e-1),n=W(e);return W(e+1)-n==356?2:n-t==382?1:0}(e)},Y=function(e){return $(e+1)-$(e)},J=function(e,t){if(t>=6&&!q(e)&&t++,4===t||7===t||9===t||11===t||13===t)return 29;var n=function(e){var t=Y(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}(e);return 2===t?2===n?30:29:3===t?0===n?29:30:6===t?q(e)?30:0:30},Q=function(e,t,n,r){return r+Math.ceil(29.5*(n-1))+354*(t-1)+Math.floor((3+11*t)/30)+e-1},Z=function(e,t,n){var r=Math.floor((30*(n-t)+10646)/10631),o=Math.min(12,Math.ceil((n-(29+Q(t,r,1,1)))/29.5)+1),i=n-Q(t,r,o,1)+1;return new et(e,r,o,i)},X=function(e){return(14+11*e)%30<11},ee=function(e){return bt+Je[e-mt]},te=function(e,t){var n=1<<11-(t-1);return 0==(Ye[e-mt]&n)?29:30},ne=function(e,t){for(var n=ee(e),r=1;r<t;r++)n+=te(e,r);return n},re=function(e){return Je[e+1-mt]-Je[e-mt]},oe=function(e){var t=Ot.findIndex((function(t){var n=l(t,3),r=n[0],o=n[1],i=n[2];return e.year<r||e.year===r&&e.month<o||e.year===r&&e.month===o&&e.day<i}));return-1===t?Ot.length-1:0===t?0:t-1},ie=function(e){var t=xt[kt.indexOf(e.era)];if(!t)throw new Error("Unknown era: "+e.era);return new et(e.year+t,e.month,e.day)},ae=function(e){if(1===e.year){var t=kt.indexOf(e.era);return Ot[t]}},ue=function(e){return"minguo"===e.era?e.year+Tt:1-e.year+Tt},se=function(e){var t=e-Tt;return t>0?["minguo",t]:["before_minguo",1-t]},ce=function(e){var t=l(T(ue(e)),2),n=t[0],r=t[1];return new et(n,r,e.month,e.day)},le=function(e,t){var n=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}(e,t);return function(e,t){return t.get?t.get.call(e):t.value}(e,n)},fe=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},de=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){fe(e,t,n[t])}))}return e},he=function(e){return null!=e&&28===e.trim().length&&"T"===(e=e.trim())[10]&&":"===e[13]&&":"===e[16]&&"."===e[19]&&("+"===e[23]||"-"===e[23])&&(0,We.default)(e,Nt).isValid()},pe=function(e){return(0,We.default)(e).isToday()},ye=function(e){return he(e)?(0,We.default)(e,Nt).toDate():null},ve=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(0,We.default)(e);return t&&(n=n.utc()),n.format(Nt)},me=function(e){return(0,We.default)(e).format("HH:mm")},ge=function(e){return We.default.utc(e).format("HH:mm A")},be=function(e){return _e(e,"DD - MMM - YYYY")},we=function(e){return _e(e,"DD-MMM")},_e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MMM-DD";return(0,We.default)(e).format(t)},Se=function(e){return(0,We.default)(e).toDate()},Oe=function(e,t){Bt.register(e,t)},Ee=function(e){var t,n,r=null!=e?e:je();return Bt.getCalendar((t=r,(null!=(n=Intl.Locale)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](t):u(t,n))?r:new Intl.Locale(r)))},xe=function(e,t){var n,r,o=null!==(n=null==t?void 0:t.locale)&&void 0!==n?n:je(),i=new Intl.Locale(o),a=de({},Lt,{noToday:"am"===i.language},t),u=a.calendar,s=a.mode,c=a.time,l=a.day,f=a.month,d=a.year,h=a.noToday,p=a.numberingSystem,y={calendar:null!=u?u:Ee(i),year:d?"numeric":void 0,month:f?"short":void 0,day:l?"2-digit":void 0,numberingSystem:p},v=(0,We.default)(e).isToday();if(v&&!h)r=(r=new Intl.RelativeTimeFormat(o,{numeric:"auto"}).format(0,"day"))[0].toLocaleUpperCase(o)+r.slice(1);else{"en"===i.language&&(o="en-GB");var m=new Intl.DateTimeFormat(o,y).formatToParts(e);("en"===i.language||"am"===i.language)&&"standard"==s&&d&&l&&(m=m.map(Ut("-"))),"wide"==s&&(m=m.map(Ut(" — "))),"ethiopic"===y.calendar&&(m=m.filter((function(e,t,n){return!("era"===e.type||"literal"===e.type&&t<n.length-1&&"era"===n[t+1].type)}))),r=m.map((function(e){return e.value})).join("")}return(!0===c||v&&"for today"===c)&&(r+=", ".concat(ke(e))),r},ke=function(e){return e.toLocaleTimeString(je(),{hour:"2-digit",minute:"2-digit"})},Pe=function(e,t){return xe(e,(n=de({},t),r=null!=(r={time:!0})?r:{},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(r)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n.push.apply(n,r)}return n}(Object(r)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(r,e))})),n));var n,r},je=function(){var e=window.i18next.language;return"ht"===(e=e.replace("_","-"))&&(e="fr-HT"),e},Ae=function(e,t){var n=Ee("string"==typeof t?new Intl.Locale(t):t);return n?U(e,function(e){switch(e){case"buddhist":return new it;case"ethiopic":return new ct;case"ethioaa":return new lt;case"coptic":return new ft;case"hebrew":return new ht;case"indian":return new pt;case"islamic-civil":return new wt;case"islamic-tbla":return new _t;case"islamic-umalqura":return new St;case"japanese":return new Pt;case"persian":return new At;case"roc":return new Dt;default:return new Ze}}(n)):e},Te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,We.default)(),n=(0,We.default)(t),r=(0,We.default)(e),o=n.diff(r,"hours"),i=n.diff(r,"days"),a=n.diff(r,"weeks"),u=n.diff(r,"months"),s=n.diff(r,"years"),c={},l=je();if(o<2){var f=n.diff(r,"minutes");c.minutes=f}else if(i<2)c.hours=o;else if(a<4)c.days=i;else if(s<1){var d=n.subtract(a,"weeks").diff(r,"days");c.weeks=a,c.days=d}else if(s<2){var h=n.subtract(u,"months").diff(r,"days");c.months=u,c.days=h}else if(s<18){var p=n.subtract(s,"year").diff(r,"months");c.years=s,c.months=p}else c.years=s;return new Kt.DurationFormat(l,{style:"short"}).format(c)},De=function(e){return!window.offlineEnabled||(null!=e?e:navigator.onLine)},Ce=function(e){return Me(Ne(e,"usual","official"))},Ie=function(e){return Ce(e)},Me=function(e){var t;return e?null!==(t=e.text)&&void 0!==t?t:function(e){var t,n=null!==(t=e.given)&&void 0!==t?t:[];return(e.family?n.concat(e.family):n).join(" ")}(e):""},Re=function(e){return Me(e)},Ne=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];0==n.length&&(n=["usual"]);var o,i=!0,a=!1,u=void 0;try{for(var s,c=function(){var t,n=s.value,r=null===(t=e.name)||void 0===t?void 0:t.find((function(e){return function(e,t){return e.use?e.use===t:"usual"===t}(e,n)}));if(r)return{v:r}},l=n[Symbol.iterator]();!(i=(s=l.next()).done);i=!0){var f=c();if("object"==((o=f)&&"undefined"!=typeof Symbol&&o.constructor===Symbol?"symbol":void 0===o?"undefined":d(o)))return f.v}}catch(e){a=!0,u=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw u}}},Le=function(e,t){if(e===t||Object.is(e,t))return!0;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}if(Array.isArray(t))return!1;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);return r.length===o.length&&r.every((function(n){return e[n]===t[n]}))},Fe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.localStorage;try{return e.getItem("test"),!0}catch(e){return!1}},Be=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},Ue=function(e){var t,n=function(e){if(Array.isArray(e))return e}(t=e.split("."))||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),3!==i.length);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t)||function(e,t){if(e){if("string"==typeof e)return Be(e,3);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Be(e,3):void 0}}(t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=n[0],o=n[1],i=n[2];return"".concat(r,".").concat(o,".").concat(i)},Ke=function(e,t){var n=function(e){var t=e.indexOf("-");if(t>=0){var n=Ue(e.slice(0,t)),r=e.slice(t+1);return"".concat(n,"-").concat(r)}return Ue(e)}(t);return Vt.satisfies(n,e,{includePrerelease:!0})},ze=function(e,t,n,r,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void n(e)}u.done?t(s):Promise.resolve(s).then(r,o)},Ve=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){ze(i,r,o,a,u,"next",e)}function u(e){ze(i,r,o,a,u,"throw",e)}a(void 0)}))}},Ge=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},He=function(e){return Gt.apply(this,arguments)},qe=function(e){return Ht.apply(this,arguments)};h.r(y),h.d(y,{age:function(){return Te},canAccessStorage:function(){return Fe},convertToLocaleCalendar:function(){return Ae},displayName:function(){return Ie},formatDate:function(){return xe},formatDatetime:function(){return Pe},formatPatientName:function(){return Me},formatTime:function(){return ke},formattedName:function(){return Re},getDefaultCalendar:function(){return Ee},getDefaultsFromConfigSchema:function(){return zt},getLocale:function(){return je},getPatientName:function(){return Ce},isOmrsDateStrict:function(){return he},isOmrsDateToday:function(){return pe},isOnline:function(){return De},isVersionSatisfied:function(){return Ke},parseDate:function(){return Se},registerDefaultCalendar:function(){return Oe},retry:function(){return He},selectPreferredName:function(){return Ne},shallowEqual:function(){return Le},toDateObjectStrict:function(){return ye},toOmrsDateFormat:function(){return _e},toOmrsDayDateFormat:function(){return be},toOmrsIsoString:function(){return ve},toOmrsTimeString:function(){return ge},toOmrsTimeString24:function(){return me},toOmrsYearlessDateFormat:function(){return we}});var We=h(9688),$e=null;new Map;var Ye,Je,Qe={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]},Ze=function(){function e(){t(this,e),this.identifier="gregory"}return r(e,[{key:"fromJulianDay",value:function(e){var t=e,n=t-1721426,r=Math.floor(n/146097),o=k(n,146097),i=Math.floor(o/36524),a=k(o,36524),u=Math.floor(a/1461),s=k(a,1461),c=Math.floor(s/365),f=l(T(400*r+100*i+4*u+c+(4!==i&&4!==c?1:0)),2),d=f[0],h=f[1],p=t-P(d,h,1,1),y=2;t<P(d,h,3,1)?y=0:j(h)&&(y=1);var v=Math.floor((12*(p+y)+373)/367),m=t-P(d,h,v,1)+1;return new et(d,h,v,m)}},{key:"toJulianDay",value:function(e){return P(e.era,e.year,e.month,e.day)}},{key:"getDaysInMonth",value:function(e){return Qe[j(e.year)?"leapyear":"standard"][e.month-1]}},{key:"getMonthsInYear",value:function(e){return 12}},{key:"getDaysInYear",value:function(e){return j(e.year)?366:365}},{key:"getYearsInEra",value:function(e){return 9999}},{key:"getEras",value:function(){return["BC","AD"]}},{key:"isInverseEra",value:function(e){return"BC"===e.era}},{key:"balanceDate",value:function(e){e.year<=0&&(e.era="BC"===e.era?"AD":"BC",e.year=1-e.year)}}]),e}(),Xe=new WeakMap,et=function(){function n(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];t(this,n),C(this,Xe,{writable:!0,value:void 0});var i=l(I(r),5),a=i[0],u=i[1],s=i[2],c=i[3],f=i[4];this.calendar=a,this.era=u,this.year=s,this.month=c,this.day=f,m(this)}return r(n,[{key:"copy",value:function(){return this.era?new n(this.calendar,this.era,this.year,this.month,this.day):new n(this.calendar,this.year,this.month,this.day)}},{key:"add",value:function(t){return e(this,t)}},{key:"subtract",value:function(e){return g(this,e)}},{key:"set",value:function(e){return b(this,e)}},{key:"cycle",value:function(e,t,n){return _(this,e,t,n)}},{key:"toDate",value:function(e){return F(this,e)}},{key:"toString",value:function(){return D(this)}},{key:"compare",value:function(e){return O(this,e)}}]),n}(),tt=new WeakMap,nt=function(){function n(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];t(this,n),C(this,tt,{writable:!0,value:void 0});var i=l(I(r),5),a=i[0],u=i[1],s=i[2],c=i[3],f=i[4];this.calendar=a,this.era=u,this.year=s,this.month=c,this.day=f,this.hour=r.shift()||0,this.minute=r.shift()||0,this.second=r.shift()||0,this.millisecond=r.shift()||0,m(this)}return r(n,[{key:"copy",value:function(){return this.era?new n(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new n(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}},{key:"add",value:function(t){return e(this,t)}},{key:"subtract",value:function(e){return g(this,e)}},{key:"set",value:function(e){return b(function(e,t){var n,r=e.copy();return null!=t.hour&&(r.hour=t.hour),null!=t.minute&&(r.minute=t.minute),null!=t.second&&(r.second=t.second),null!=t.millisecond&&(r.millisecond=t.millisecond),(n=r).millisecond=Math.max(0,Math.min(n.millisecond,1e3)),n.second=Math.max(0,Math.min(n.second,59)),n.minute=Math.max(0,Math.min(n.minute,59)),n.hour=Math.max(0,Math.min(n.hour,23)),r}(this,e),e)}},{key:"cycle",value:function(e,t,n){switch(e){case"era":case"year":case"month":case"day":return _(this,e,t,n);default:return function(e,t,n,r){var o=e.copy();switch(t){case"hour":var i=e.hour,a=0,u=23;if(12===(null==r?void 0:r.hourCycle)){var s=i>=12;a=s?12:0,u=s?23:11}o.hour=S(i,n,a,u,null==r?void 0:r.round);break;case"minute":o.minute=S(e.minute,n,0,59,null==r?void 0:r.round);break;case"second":o.second=S(e.second,n,0,59,null==r?void 0:r.round);break;case"millisecond":o.millisecond=S(e.millisecond,n,0,999,null==r?void 0:r.round);break;default:throw new Error("Unsupported field "+t)}return o}(this,e,t,n)}}},{key:"toDate",value:function(e,t){return F(this,e,t)}},{key:"toString",value:function(){return"".concat(D(this),"T").concat((e=this,"".concat(String(e.hour).padStart(2,"0"),":").concat(String(e.minute).padStart(2,"0"),":").concat(String(e.second).padStart(2,"0")).concat(e.millisecond?String(e.millisecond/1e3).slice(1):"")));var e}},{key:"compare",value:function(e){var t=O(this,e);return 0===t?function(e,t){return E(e)-E(t)}(this,B(e)):t}}]),n}(),rt=new Map,ot=864e5,it=function(e){a(u,e);var n=p(u);function u(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i;return t(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="buddhist",s(i)}return r(u,[{key:"fromJulianDay",value:function(e){var t=o(i(u.prototype),"fromJulianDay",this).call(this,e),n=A(t.era,t.year);return new et(this,n- -543,t.month,t.day)}},{key:"toJulianDay",value:function(e){return o(i(u.prototype),"toJulianDay",this).call(this,K(e))}},{key:"getEras",value:function(){return["BE"]}},{key:"getDaysInMonth",value:function(e){return o(i(u.prototype),"getDaysInMonth",this).call(this,K(e))}},{key:"balanceDate",value:function(){}}]),u}(Ze),at=1723856,ut=1824665,st=5500,ct=function(){function e(){t(this,e),this.identifier="ethiopic"}return r(e,[{key:"fromJulianDay",value:function(e){var t=l(V(at,e),3),n=t[0],r=t[1],o=t[2],i="AM";return n<=0&&(i="AA",n+=st),new et(this,i,n,r,o)}},{key:"toJulianDay",value:function(e){var t=e.year;return"AA"===e.era&&(t-=st),z(at,t,e.month,e.day)}},{key:"getDaysInMonth",value:function(e){return H(e.year,e.month)}},{key:"getMonthsInYear",value:function(){return 13}},{key:"getDaysInYear",value:function(e){return 365+G(e.year)}},{key:"getYearsInEra",value:function(e){return"AA"===e.era?9999:9991}},{key:"getEras",value:function(){return["AA","AM"]}}]),e}(),lt=function(e){a(o,e);var n=p(o);function o(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var a;return t(this,o),(a=n.call.apply(n,[this].concat(f(r)))).identifier="ethioaa",s(a)}return r(o,[{key:"fromJulianDay",value:function(e){var t=l(V(at,e),3),n=t[0],r=t[1],o=t[2];return new et(this,"AA",n+=st,r,o)}},{key:"getEras",value:function(){return["AA"]}},{key:"getYearsInEra",value:function(){return 9999}}]),o}(ct),ft=function(e){a(o,e);var n=p(o);function o(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var a;return t(this,o),(a=n.call.apply(n,[this].concat(f(r)))).identifier="coptic",s(a)}return r(o,[{key:"fromJulianDay",value:function(e){var t=l(V(ut,e),3),n=t[0],r=t[1],o=t[2],i="CE";return n<=0&&(i="BCE",n=1-n),new et(this,i,n,r,o)}},{key:"toJulianDay",value:function(e){var t=e.year;return"BCE"===e.era&&(t=1-t),z(ut,t,e.month,e.day)}},{key:"getDaysInMonth",value:function(e){var t=e.year;return"BCE"===e.era&&(t=1-t),H(t,e.month)}},{key:"isInverseEra",value:function(e){return"BCE"===e.era}},{key:"balanceDate",value:function(e){e.year<=0&&(e.era="BCE"===e.era?"CE":"BCE",e.year=1-e.year)}},{key:"getEras",value:function(){return["BCE","CE"]}},{key:"getYearsInEra",value:function(e){return"BCE"===e.era?9999:9715}}]),o}(ct),dt=347997,ht=function(){function e(){t(this,e),this.identifier="hebrew"}return r(e,[{key:"fromJulianDay",value:function(e){for(var t=e-dt,n=25920*t/765433,r=Math.floor((19*n+234)/235)+1,o=$(r),i=Math.floor(t-o);i<1;)r--,o=$(r),i=Math.floor(t-o);for(var a=1,u=0;u<i;)u+=J(r,a),a++;return a--,u-=J(r,a),new et(this,r,a,i-u)}},{key:"toJulianDay",value:function(e){for(var t=$(e.year),n=1;n<e.month;n++)t+=J(e.year,n);return t+e.day+dt}},{key:"getDaysInMonth",value:function(e){return J(e.year,e.month)}},{key:"getMonthsInYear",value:function(e){return q(e.year)?13:12}},{key:"getDaysInYear",value:function(e){return Y(e.year)}},{key:"getYearsInEra",value:function(){return 9999}},{key:"getEras",value:function(){return["AM"]}},{key:"balanceYearMonth",value:function(e,t){t.year!==e.year&&(q(t.year)&&!q(e.year)&&t.month>6?e.month--:!q(t.year)&&q(e.year)&&t.month>6&&e.month++)}}]),e}(),pt=function(e){a(u,e);var n=p(u);function u(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i;return t(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="indian",s(i)}return r(u,[{key:"fromJulianDay",value:function(e){var t,n,r,a=o(i(u.prototype),"fromJulianDay",this).call(this,e),s=a.year-78,c=e-P(a.era,a.year,1,1);if(c<80?(s--,c+=155+(t=j(a.year-1)?31:30)+90+10):(t=j(a.year)?31:30,c-=80),c<t)n=1,r=c+1;else{var l=c-t;l<155?(n=Math.floor(l/31)+2,r=l%31+1):(l-=155,n=Math.floor(l/30)+7,r=l%30+1)}return new et(this,s,n,r)}},{key:"toJulianDay",value:function(e){var t,n,r=e.year+78,o=l(T(r),2),i=o[0],a=o[1];return j(a)?(t=31,n=P(i,a,3,21)):(t=30,n=P(i,a,3,22)),1===e.month?n+e.day-1:(n+=t+31*Math.min(e.month-2,5),e.month>=8&&(n+=30*(e.month-7)),n+=e.day-1)}},{key:"getDaysInMonth",value:function(e){return 1===e.month&&j(e.year+78)||e.month>=2&&e.month<=6?31:30}},{key:"getYearsInEra",value:function(){return 9919}},{key:"getEras",value:function(){return["saka"]}},{key:"balanceDate",value:function(){}}]),u}(Ze),yt=1948440,vt=1948439,mt=1300,gt=1600,bt=460322,wt=function(){function e(){t(this,e),this.identifier="islamic-civil"}return r(e,[{key:"fromJulianDay",value:function(e){return Z(this,yt,e)}},{key:"toJulianDay",value:function(e){return Q(yt,e.year,e.month,e.day)}},{key:"getDaysInMonth",value:function(e){var t=29+e.month%2;return 12===e.month&&X(e.year)&&t++,t}},{key:"getMonthsInYear",value:function(){return 12}},{key:"getDaysInYear",value:function(e){return X(e.year)?355:354}},{key:"getYearsInEra",value:function(){return 9665}},{key:"getEras",value:function(){return["AH"]}}]),e}(),_t=function(e){a(o,e);var n=p(o);function o(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];var a;return t(this,o),(a=n.call.apply(n,[this].concat(f(r)))).identifier="islamic-tbla",s(a)}return r(o,[{key:"fromJulianDay",value:function(e){return Z(this,vt,e)}},{key:"toJulianDay",value:function(e){return Q(vt,e.year,e.month,e.day)}}]),o}(wt),St=function(e){a(u,e);var n=p(u);function u(){var e;if(t(this,u),(e=n.call(this)).identifier="islamic-umalqura",Ye||(Ye=new Uint16Array(Uint8Array.from(atob("qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI="),(function(e){return e.charCodeAt(0)})).buffer)),!Je){Je=new Uint32Array(gt-mt+1);for(var r=0,o=mt;o<=gt;o++){Je[o-mt]=r;for(var i=1;i<=12;i++)r+=te(o,i)}}return s(e)}return r(u,[{key:"fromJulianDay",value:function(e){var t=e-yt,n=ee(mt),r=ee(gt);if(t<n||t>r)return o(i(u.prototype),"fromJulianDay",this).call(this,e);for(var a=mt-1,s=1,c=1;c>0;){a++,c=t-ee(a)+1;var l=re(a);if(c===l){s=12;break}if(c<l){var f=te(a,s);for(s=1;c>f;)c-=f,s++,f=te(a,s);break}}return new et(this,a,s,t-ne(a,s)+1)}},{key:"toJulianDay",value:function(e){return e.year<mt||e.year>gt?o(i(u.prototype),"toJulianDay",this).call(this,e):yt+ne(e.year,e.month)+(e.day-1)}},{key:"getDaysInMonth",value:function(e){return e.year<mt||e.year>gt?o(i(u.prototype),"getDaysInMonth",this).call(this,e):te(e.year,e.month)}},{key:"getDaysInYear",value:function(e){return e.year<mt||e.year>gt?o(i(u.prototype),"getDaysInYear",this).call(this,e):re(e.year)}}]),u}(wt),Ot=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],Et=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],xt=[1867,1911,1925,1988,2018],kt=["meiji","taisho","showa","heisei","reiwa"],Pt=function(e){a(u,e);var n=p(u);function u(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i;return t(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="japanese",s(i)}return r(u,[{key:"fromJulianDay",value:function(e){var t=o(i(u.prototype),"fromJulianDay",this).call(this,e),n=oe(t);return new et(this,kt[n],t.year-xt[n],t.month,t.day)}},{key:"toJulianDay",value:function(e){return o(i(u.prototype),"toJulianDay",this).call(this,ie(e))}},{key:"balanceDate",value:function(e){var t=ie(e),n=oe(t);kt[n]!==e.era&&(e.era=kt[n],e.year=t.year-xt[n]),this.constrainDate(e)}},{key:"constrainDate",value:function(e){var t=kt.indexOf(e.era),n=Et[t];if(null!=n){var r=l(n,3),o=r[0],i=r[1],a=r[2],u=o-xt[t];e.year=Math.max(1,Math.min(u,e.year)),e.year===u&&(e.month=Math.min(i,e.month),e.month===i&&(e.day=Math.min(a,e.day)))}if(1===e.year&&t>=0){var s=l(Ot[t],3),c=s[1],f=s[2];e.month=Math.max(c,e.month),e.month===c&&(e.day=Math.max(f,e.day))}}},{key:"getEras",value:function(){return kt}},{key:"getYearsInEra",value:function(e){var t=kt.indexOf(e.era),n=Ot[t],r=Ot[t+1];if(null==r)return 9999-n[0]+1;var o=r[0]-n[0];return(e.month<r[1]||e.month===r[1]&&e.day<r[2])&&o++,o}},{key:"getDaysInMonth",value:function(e){return o(i(u.prototype),"getDaysInMonth",this).call(this,ie(e))}},{key:"getMinimumMonthInYear",value:function(e){var t=ae(e);return t?t[1]:1}},{key:"getMinimumDayInMonth",value:function(e){var t=ae(e);return t&&e.month===t[1]?t[2]:1}}]),u}(Ze),jt=[0,31,62,93,124,155,186,216,246,276,306,336],At=function(){function e(){t(this,e),this.identifier="persian"}return r(e,[{key:"fromJulianDay",value:function(e){var t=e-1948320,n=1+Math.floor((33*t+3)/12053),r=t-(365*(n-1)+Math.floor((8*n+21)/33)),o=r<216?Math.floor(r/31):Math.floor((r-6)/30);return new et(this,n,o+1,r-jt[o]+1)}},{key:"toJulianDay",value:function(e){var t=1948319+365*(e.year-1)+Math.floor((8*e.year+21)/33);return(t+=jt[e.month-1])+e.day}},{key:"getMonthsInYear",value:function(){return 12}},{key:"getDaysInMonth",value:function(e){return e.month<=6?31:e.month<=11||k(25*e.year+11,33)<8?30:29}},{key:"getEras",value:function(){return["AP"]}},{key:"getYearsInEra",value:function(){return 9377}}]),e}(),Tt=1911,Dt=function(e){a(u,e);var n=p(u);function u(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];var i;return t(this,u),(i=n.call.apply(n,[this].concat(f(r)))).identifier="roc",s(i)}return r(u,[{key:"fromJulianDay",value:function(e){var t=o(i(u.prototype),"fromJulianDay",this).call(this,e),n=A(t.era,t.year),r=l(se(n),2),a=r[0],s=r[1];return new et(this,a,s,t.month,t.day)}},{key:"toJulianDay",value:function(e){return o(i(u.prototype),"toJulianDay",this).call(this,ce(e))}},{key:"getEras",value:function(){return["before_minguo","minguo"]}},{key:"balanceDate",value:function(e){var t=l(se(ue(e)),2),n=t[0],r=t[1];e.era=n,e.year=r}},{key:"isInverseEra",value:function(e){return"before_minguo"===e.era}},{key:"getDaysInMonth",value:function(e){return o(i(u.prototype),"getDaysInMonth",this).call(this,ce(e))}},{key:"getYearsInEra",value:function(e){return"before_minguo"===e.era?9999:9999-Tt}}]),u}(Ze),Ct=h(9014),It=h.n(Ct),Mt=h(4332),Rt=h.n(Mt);We.default.extend(It()),We.default.extend(Rt());var Nt="YYYY-MM-DDTHH:mm:ss.SSSZZ",Lt={mode:"standard",time:"for today",day:!0,month:!0,year:!0,noToday:!1},Ft=new WeakMap,Bt=new(function(){function e(){var t,n;!function(e,t){if(!u(e,t))throw new TypeError("Cannot call a class as a function")}(this,e),t=Ft,n={writable:!0,value:new Map},function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(this,t),t.set(this,n),le(this,Ft).set("am","ethiopic")}var t;return(t=[{key:"register",value:function(e,t){le(this,Ft).set(e,t)}},{key:"getCalendar",value:function(e){if(Boolean(e)){if(e.calendar)return e.calendar;if(e.region){var t="".concat(e.language,"-").concat(e.region);if(le(this,Ft).has(t))return le(this,Ft).get(t)}if(e.language&&le(this,Ft).has(e.language))return le(this,Ft).get(e.language);var n=new Intl.DateTimeFormat(e.toString()).resolvedOptions().calendar;return le(this,Ft).set("".concat(e.language).concat(e.region?"-".concat(e.region):""),n),n}}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}()),Ut=function(e){return function(t,n,r){return"literal"!==t.type||" "!==t.value||n<r.length-1&&"era"===r[n+1].type?t:{type:"literal",value:e}}},Kt=h(6893);function zt(e){var t,n={},r=!0,o=!1,i=void 0;try{for(var a,u=Object.keys(e)[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var s=a.value;if(e[s].hasOwnProperty("_default"))n[s]=e[s]._default;else{if(s.startsWith("_"))continue;(t=e[s])&&t.constructor===Object?n[s]=zt(e[s]):n[s]=e[s]}}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}var Vt=h(1249);function Gt(){return Gt=Ve((function(e){var t,n,r,o,i,a,u,s=arguments;return Ge(this,(function(c){switch(c.label){case 0:n=(t=s.length>1&&void 0!==s[1]?s[1]:{}).shouldRetry,r=t.getDelay,o=t.onError,n=null!=n?n:function(e){return function(e,t){return e<=5}(e)},r=null!=r?r:function(e){return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e+1:e;return t*Math.pow(2,n)}(e,1e3)},i=0,a=void 0,c.label=1;case 1:return c.trys.push([1,4,,5]),[4,qe(r(i))];case 2:return c.sent(),[4,e()];case 3:return[2,c.sent()];case 4:return u=c.sent(),null==o||o(u,i),a=u,[3,5];case 5:if(n(i++))return[3,1];c.label=6;case 6:throw a}}))})),Gt.apply(this,arguments)}function Ht(){return(Ht=Ve((function(e){return Ge(this,(function(t){return e<=0?[2]:[2,new Promise((function(t){return setTimeout(t,e)}))]}))}))).apply(this,arguments)}}(),y}())}}}))}}]);