@openmrs/esm-appointments-app 9.2.1-pre.7334 → 9.2.1-pre.7346

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/9190.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 9190.js.LICENSE.txt */
2
+ (globalThis.webpackChunk_openmrs_esm_appointments_app=globalThis.webpackChunk_openmrs_esm_appointments_app||[]).push([[9190],{422:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.subscribeToArray=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}}},521:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(39600),o="object"==typeof exports&&exports&&!exports.nodeType&&exports,i=o&&"object"==typeof module&&module&&!module.nodeType&&module,s=i&&i.exports===o?r.A.Buffer:void 0,a=s?s.allocUnsafe:void 0;const u=function(t,e){if(e)return t.slice();var n=t.length,r=a?a(n):new t.constructor(n);return t.copy(r),r}},1359:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e,n,r){var o=t.call(this)||this;return o.parent=e,o.outerValue=n,o.outerIndex=r,o.index=0,o}return o(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(n(77759).Subscriber);e.InnerSubscriber=i},2519:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}();e.ArgumentOutOfRangeError=n},3069:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.flush=function(t){this.active=!0,this.scheduled=void 0;var e,n=this.actions,r=-1,o=n.length;t=t||n.shift();do{if(e=t.execute(t.state,t.delay))break}while(++r<o&&(t=n.shift()));if(this.active=!1,e){for(;++r<o&&(t=n.shift());)t.unsubscribe();throw e}},e}(n(25646).AsyncScheduler);e.AsapScheduler=i},3375:(t,e,n)=>{"use strict";var r;n.d(e,{A:()=>l});var o=new Uint8Array(16);function i(){if(!r&&!(r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return r(o)}const s=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var a=[],u=0;u<256;++u)a.push((u+256).toString(16).substr(1));const c=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=(a[t[e+0]]+a[t[e+1]]+a[t[e+2]]+a[t[e+3]]+"-"+a[t[e+4]]+a[t[e+5]]+"-"+a[t[e+6]]+a[t[e+7]]+"-"+a[t[e+8]]+a[t[e+9]]+"-"+a[t[e+10]]+a[t[e+11]]+a[t[e+12]]+a[t[e+13]]+a[t[e+14]]+a[t[e+15]]).toLowerCase();if(!function(t){return"string"==typeof t&&s.test(t)}(n))throw TypeError("Stringified UUID is invalid");return n},l=function(t,e,n){var r=(t=t||{}).random||(t.rng||i)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(var o=0;o<16;++o)e[n+o]=r[o];return e}return c(r)}},4349:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(21016);e.finalize=function(t){return function(e){return e.lift(new a(t))}};var a=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.callback))},t}(),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new s.Subscription(n)),r}return o(e,t),e}(i.Subscriber)},4942:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,o=n(34914),i=n(47986),s=n(11673);(r=e.NotificationKind||(e.NotificationKind={})).NEXT="N",r.ERROR="E",r.COMPLETE="C";var a=function(){function t(t,e,n){this.kind=t,this.value=e,this.error=n,this.hasValue="N"===t}return t.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},t.prototype.do=function(t,e,n){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return n&&n()}},t.prototype.accept=function(t,e,n){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,n)},t.prototype.toObservable=function(){switch(this.kind){case"N":return i.of(this.value);case"E":return s.throwError(this.error);case"C":return o.empty()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return void 0!==e?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();e.Notification=a},5179:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.takeWhile=function(t,e){return void 0===e&&(e=!1),function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.inclusive))},t}(),a=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.inclusive=r,o.index=0,o}return o(e,t),e.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},e}(i.Subscriber)},5319:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=!1;e.config={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+e.stack)}else n&&console.log("RxJS: Back to a better error behavior. Thank you. <3");n=t},get useDeprecatedSynchronousErrorHandling(){return n}}},6047:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(62637),o=n(64629),i=n(96696),s=n(8347),a=n(90952),u=n(78522);e.last=function(t,e){var n=arguments.length>=2;return function(c){return c.pipe(t?o.filter(function(e,n){return t(e,n,c)}):u.identity,i.takeLast(1),n?a.defaultIfEmpty(e):s.throwIfEmpty(function(){return new r.EmptyError}))}}},6727:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isObject=function(t){return null!==t&&"object"==typeof t}},7406:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(86735),a=n(15019);e.throttleTime=function(t,e,n){return void 0===e&&(e=s.async),void 0===n&&(n=a.defaultThrottleConfig),function(r){return r.lift(new u(t,e,n.leading,n.trailing))}};var u=function(){function t(t,e,n,r){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),c=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.duration=n,s.scheduler=r,s.leading=o,s.trailing=i,s._hasTrailingValue=!1,s._trailingValue=null,s}return o(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(l,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(i.Subscriber);function l(t){t.subscriber.clearThrottle()}},8347:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(62637),s=n(77759);e.throwIfEmpty=function(t){return void 0===t&&(t=c),function(e){return e.lift(new a(t))}};var a=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.errorFactory))},t}(),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.errorFactory=n,r.hasValue=!1,r}return o(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(s.Subscriber);function c(){return new i.EmptyError}},8674:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(32376);e.findIndex=function(t,e){return function(n){return n.lift(new r.FindValueOperator(t,n,!0,e))}}},8791:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(71077),s=n(18860),a=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return o(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new s.ObjectUnsubscribedError;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(i.Subject);e.BehaviorSubject=a},9166:(t,e,n)=>{"use strict";n.d(e,{dx:()=>x,Cj:()=>O,Zu:()=>o,cD:()=>a,Rb:()=>S,SY:()=>u,hG:()=>l,KU:()=>i,Bv:()=>s,Vs:()=>d,DK:()=>T,BX:()=>P,Pu:()=>b,BR:()=>C,Ds:()=>A,NH:()=>j,E$:()=>p,Qx:()=>y,xL:()=>k});var r=n(20367);const o=`${r.Jj}/attachment`;function i(t,e){return(0,r.lo)(`${o}/${t}`,{signal:e.signal})}function s(t,e,n){return(0,r.lo)(`${o}?patient=${t}&includeEncounterless=${e}`,{signal:n.signal})}async function a(t,e){const n=new FormData;return n.append("fileCaption",e.fileDescription),n.append("patient",t),e.file?n.append("file",e.file,e.fileName):(n.append("file",new File([""],e.fileName),e.fileName),n.append("base64Content",e.base64Content)),(0,r.lo)(`${o}`,{method:"POST",body:n})}function u(t,e){return(0,r.lo)(`${o}/${t}`,{method:"DELETE",signal:e.signal})}var c=n(39644);async function l(t,e,n=!0){if(t){let o=null;const[i,s]=await Promise.all([(0,r.lo)(`${r.IU}/Patient/${t}`,e).catch(t=>o=t),n?h(t):Promise.resolve(null)]);if(i.ok)return i.data;if(s)return s;if(o)throw o}return null}async function h(t){const e=(await(0,c.pb)("patient-registration")).find(e=>e.fhirPatient.id===t);return e?.fhirPatient??null}var f=n(99549);function p(t){return{uuid:t.uuid,display:t.display}}function d(t=null,e=null){const n=new URLSearchParams;t&&n.set("tag",t),e&&n.set("q",e);const o=n.toString(),i=`${r.Jj}/location${o?"?"+o:""}`;return(0,r.ut)(i).pipe((0,f.Tj)(t=>t.data.results.map(p))).pipe((0,f.s)(1))}function y(t){return{uuid:t.uuid,display:t.display,name:t.name}}function b(){return(0,r.ut)(`${r.Jj}/visittype`).pipe((0,f.Tj)(t=>t.data.results.map(y))).pipe((0,f.s)(1))}var m=n(23790),v=n(32505),g=n(75772),_=n(20320),w=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return v.C6(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new _.P;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(g.B7),x=function(t){return t.NEWVISIT="startVisit",t.EDITVISIT="editVisit",t.LOADING="loadingVisit",t}({}),O=function(t){return t.NOTSTARTED="notStarted",t.ONGOING="ongoing",t}({});const S="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))",E=function(){try{return JSON.parse(sessionStorage.getItem("openmrs:visitStoreState")||"null")}catch(t){return null}}()||{patientUuid:null,manuallySetVisitUuid:null,mutateVisitCallbacks:{}};function P(){return(0,m.jf)("visit",E)}function j(t,e){P().setState({patientUuid:t,manuallySetVisitUuid:e})}function A(t,e){return(0,r.lo)(`${r.Jj}/visit`,{signal:e.signal,method:"POST",headers:{"Content-type":"application/json"},body:t})}function k(t,e,n){return(0,r.lo)(`${r.Jj}/visit/${t}`,{signal:n.signal,method:"POST",headers:{"Content-type":"application/json"},body:e})}function C(t,e,n){const o=n??S;return(0,r.lo)(`${r.Jj}/visit?patient=${t}&v=${o}`,{signal:e.signal,method:"GET",headers:{"Content-type":"application/json"}})}P().subscribe(t=>{var e;e=t,sessionStorage.setItem("openmrs:visitStoreState",JSON.stringify(e))});const T=new w(null)},11305:(t,e,n)=>{"use strict";function r(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function o(t){return t&&t.sensitive?"":"i"}function i(t,e,n){return function(t,e,n){void 0===n&&(n={});for(var i=n.strict,s=void 0!==i&&i,a=n.start,u=void 0===a||a,c=n.end,l=void 0===c||c,h=n.encode,f=void 0===h?function(t){return t}:h,p="["+r(n.endsWith||"")+"]|$",d="["+r(n.delimiter||"/#?")+"]",y=u?"^":"",b=0,m=t;b<m.length;b++){var v=m[b];if("string"==typeof v)y+=r(f(v));else{var g=r(f(v.prefix)),_=r(f(v.suffix));if(v.pattern)if(e&&e.push(v),g||_)if("+"===v.modifier||"*"===v.modifier){var w="*"===v.modifier?"?":"";y+="(?:"+g+"((?:"+v.pattern+")(?:"+_+g+"(?:"+v.pattern+"))*)"+_+")"+w}else y+="(?:"+g+"("+v.pattern+")"+_+")"+v.modifier;else y+="("+v.pattern+")"+v.modifier;else y+="(?:"+g+_+")"+v.modifier}}if(l)s||(y+=d+"?"),y+=n.endsWith?"(?="+p+")":"$";else{var x=t[t.length-1],O="string"==typeof x?d.indexOf(x[x.length-1])>-1:void 0===x;s||(y+="(?:"+d+"(?="+p+"))?"),O||(y+="(?="+d+"|"+p+")")}return new RegExp(y,o(n))}(function(t,e){void 0===e&&(e={});for(var n=function(t){for(var e=[],n=0;n<t.length;){var r=t[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)e.push({type:"CHAR",index:n,value:t[n++]});else{var o=1,i="";if("?"===t[a=n+1])throw new TypeError('Pattern cannot start with "?" at '+a);for(;a<t.length;)if("\\"!==t[a]){if(")"===t[a]){if(0===--o){a++;break}}else if("("===t[a]&&(o++,"?"!==t[a+1]))throw new TypeError("Capturing groups are not allowed at "+a);i+=t[a++]}else i+=t[a++]+t[a++];if(o)throw new TypeError("Unbalanced pattern at "+n);if(!i)throw new TypeError("Missing pattern at "+n);e.push({type:"PATTERN",index:n,value:i}),n=a}else{for(var s="",a=n+1;a<t.length;){var u=t.charCodeAt(a);if(!(u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||95===u))break;s+=t[a++]}if(!s)throw new TypeError("Missing parameter name at "+n);e.push({type:"NAME",index:n,value:s}),n=a}else e.push({type:"CLOSE",index:n,value:t[n++]});else e.push({type:"OPEN",index:n,value:t[n++]});else e.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});else e.push({type:"MODIFIER",index:n,value:t[n++]})}return e.push({type:"END",index:n,value:""}),e}(t),o=e.prefixes,i=void 0===o?"./":o,s="[^"+r(e.delimiter||"/#?")+"]+?",a=[],u=0,c=0,l="",h=function(t){if(c<n.length&&n[c].type===t)return n[c++].value},f=function(t){var e=h(t);if(void 0!==e)return e;var r=n[c],o=r.type,i=r.index;throw new TypeError("Unexpected "+o+" at "+i+", expected "+t)},p=function(){for(var t,e="";t=h("CHAR")||h("ESCAPED_CHAR");)e+=t;return e};c<n.length;){var d=h("CHAR"),y=h("NAME"),b=h("PATTERN");if(y||b){var m=d||"";-1===i.indexOf(m)&&(l+=m,m=""),l&&(a.push(l),l=""),a.push({name:y||u++,prefix:m,suffix:"",pattern:b||s,modifier:h("MODIFIER")||""})}else{var v=d||h("ESCAPED_CHAR");if(v)l+=v;else if(l&&(a.push(l),l=""),h("OPEN")){m=p();var g=h("NAME")||"",_=h("PATTERN")||"",w=p();f("CLOSE"),a.push({name:g||(_?u++:""),pattern:g&&!_?s:_,prefix:m,suffix:w,modifier:h("MODIFIER")||""})}else f("END")}}return a}(t,n),e,n)}function s(t,e,n){return t instanceof RegExp?function(t,e){if(!e)return t;var n=t.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)e.push({name:r,prefix:"",suffix:"",modifier:"",pattern:""});return t}(t,e):Array.isArray(t)?function(t,e,n){var r=t.map(function(t){return s(t,e,n).source});return new RegExp("(?:"+r.join("|")+")",o(n))}(t,e,n):i(t,e,n)}n.d(e,{g4:()=>S,D_:()=>p,lz:()=>h,qh:()=>d,JK:()=>x,tA:()=>O,zl:()=>m,JG:()=>b,oo:()=>v,vf:()=>c,MY:()=>l,Wh:()=>w});const a=(0,n(23790).Zd)("breadcrumbs",[]);function u(t){return t.matcher instanceof RegExp?t.matcher:"string"==typeof t.matcher?s(t.matcher):s(t.path)}function c(t){return l([t])}function l(t){const e=[...h(),...t.map(t=>({matcher:u(t),settings:t}))];a.setState(e,!0)}function h(){return a.getState()}function f(t,e){if(e)return function(t,e){const[n]=t.filter(t=>t.matcher.test(e));return n}(t,e)||function(t,e){const n=e.split("/");for(;n.length>1;){n.pop();const e=f(t,n.join("/"));if(e)return e}}(t,e)}function p(t,e){if(t.length>0){const n=f(t,e);if(n){const e=[n];let r=f(t,n.settings.parent);for(;void 0!==r;)e.push(r),r=f(t,r.settings.parent);return e.reverse()}}return[]}function d(t){return p(h(),t)}var y=n(22244);function b(t,e){const n=window.getOpenmrsSpaBase().replace(/\/$/,"");return m(t,{openmrsBase:window.openmrsBase,openmrsSpaBase:n,...e}).replace(/^\/\//,"/")}function m(t,e){return Object.keys(e).reduce((t,n)=>t.split("${"+n+"}").join(e[n]),t)}function v({to:t,templateParams:e}){const n=window.getOpenmrsSpaBase().replace(/\/$/,""),r=b(t,e).replace(window.location.origin,"");r.startsWith(n)?(0,y.EH)(r):window.location.assign(r)}const g="openmrs:history";function _(t){let e=JSON.parse(sessionStorage.getItem(g)??"[]")||[];e.push(t),e.length>50&&(e=e.slice(-50)),sessionStorage.setItem(g,JSON.stringify(e))}function w(){0===JSON.parse(sessionStorage.getItem(g)??"[]").length&&document.referrer&&_(document.referrer),window.addEventListener("single-spa:routing-event",t=>{const e=x();"replaceState"==t.detail.originalEvent?.singleSpaTrigger?(e[e.length-1]=window.location.href,sessionStorage.setItem(g,JSON.stringify(e))):!t.detail.originalEvent?.singleSpa&&e.includes(window.location.href)?O({toUrl:window.location.href}):e[e.length-1]!==window.location.href&&_(window.location.href)})}function x(){return JSON.parse(sessionStorage.getItem(g)??"[]")}function O({toUrl:t}){const e=x(),n=e.lastIndexOf(t);if(-1==n)throw new Error(`URL ${t} not found in history; cannot go back to it.`);{const t=e.slice(0,n+1);v({to:e[n]}),sessionStorage.setItem(g,JSON.stringify(t))}}function S(){sessionStorage.removeItem(g)}},11673:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092);function o(t){var e=t.error;t.subscriber.error(e)}e.throwError=function(t,e){return e?new r.Observable(function(n){return e.schedule(o,0,{error:t,subscriber:n})}):new r.Observable(function(e){return e.error(t)})}},11806:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}();e.UnsubscriptionError=n},11853:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.buffer=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.closingNotifier))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(i.innerSubscribe(n,new i.SimpleInnerSubscriber(r))),r}return o(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(){var t=this.buffer;this.buffer=[],this.destination.next(t)},e}(i.SimpleOuterSubscriber)},12873:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092),o=n(21016),i=n(46713);e.scheduleObservable=function(t,e){return new r.Observable(function(n){var r=new o.Subscription;return r.add(e.schedule(function(){var o=t[i.observable]();r.add(o.subscribe({next:function(t){r.add(e.schedule(function(){return n.next(t)}))},error:function(t){r.add(e.schedule(function(){return n.error(t)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r})}},13394:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(46713);e.subscribeToObservable=function(t){return function(e){var n=t[r.observable]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(e)}}},13441:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(86735),o=n(18780),i=n(27954);e.auditTime=function(t,e){return void 0===e&&(e=r.async),o.audit(function(){return i.timer(t,e)})}},14779:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(33395);e.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(r.merge.apply(void 0,[e].concat(t)))}}},15019:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.defaultThrottleConfig={leading:!0,trailing:!1},e.throttle=function(t,n){return void 0===n&&(n=e.defaultThrottleConfig),function(e){return e.lift(new s(t,!!n.leading,!!n.trailing))}};var s=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.durationSelector,this.leading,this.trailing))},t}(),a=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.destination=e,i.durationSelector=n,i._leading=r,i._trailing=o,i._hasValue=!1,i}return o(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=i.innerSubscribe(e,new i.SimpleInnerSubscriber(this)))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=void 0,e&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(i.SimpleOuterSubscriber)},15150:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(9158),o=n(97942),i=n(71140);var s=Object.prototype.hasOwnProperty;const a=function(t){if(!(0,o.A)(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=(0,i.A)(t),n=[];for(var r in t)("constructor"!=r||!e&&s.call(t,r))&&n.push(r);return n};var u=n(31475);const c=function(t){return(0,u.A)(t)?(0,r.A)(t,!0):a(t)}},17436:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(86735),s=n(66740),a=n(77759),u=n(4942);e.delay=function(t,e){void 0===e&&(e=i.async);var n=s.isDate(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new c(n,e))}};var c=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.delay,this.scheduler))},t}(),l=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.delay=n,o.scheduler=r,o.queue=[],o.active=!1,o.errored=!1,o}return o(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,o=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(o);if(n.length>0){var i=Math.max(0,n[0].time-r.now());this.schedule(t,i)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new h(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(u.Notification.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(u.Notification.createComplete()),this.unsubscribe()},e}(a.Subscriber),h=function(t,e){this.time=t,this.notification=e}},17563:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(95092),s=n(73766),a=n(19673),u=function(t){function e(e,n,r){void 0===n&&(n=0),void 0===r&&(r=s.asap);var o=t.call(this)||this;return o.source=e,o.delayTime=n,o.scheduler=r,(!a.isNumeric(n)||n<0)&&(o.delayTime=0),r&&"function"==typeof r.schedule||(o.scheduler=s.asap),o}return o(e,t),e.create=function(t,n,r){return void 0===n&&(n=0),void 0===r&&(r=s.asap),new e(t,n,r)},e.dispatch=function(t){var e=t.source,n=t.subscriber;return this.add(e.subscribe(n))},e.prototype._subscribe=function(t){var n=this.delayTime,r=this.source;return this.scheduler.schedule(e.dispatch,n,{source:r,subscriber:t})},e}(i.Observable);e.SubscribeOnObservable=u},18364:(t,e,n)=>{"use strict";function r(t){return"function"==typeof t}n.d(e,{T:()=>r})},18780:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.audit=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.durationSelector))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return o(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=i.innerSubscribe(e,new i.SimpleInnerSubscriber(this));!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},e.prototype.clearThrottle=function(){var t=this,e=t.value,n=t.hasValue,r=t.throttled;r&&(this.remove(r),this.throttled=void 0,r.unsubscribe()),n&&(this.value=void 0,this.hasValue=!1,this.destination.next(e))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(i.SimpleOuterSubscriber)},18860:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}();e.ObjectUnsubscribedError=n},18904:(t,e,n)=>{"use strict";n.d(e,{D:()=>r});var r=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},19109:(t,e,n)=>{"use strict";var r=n(89710),o=n(51812),i=n(32742),s=n(83153),a={baseColor:"#933c3c"},u=["octogons","overlappingCircles","plusSigns","xes","sineWaves","hexagons","overlappingRings","plaid","triangles","squares","concentricCircles","diamonds","tessellation","nestedSquares","mosaicSquares","chevrons"],c="#000",l=.02;function h(t,e,n){return parseInt(t.substr(e,n||1),16)}function f(t,e,n,r,o){return(parseFloat(t)-e)*(o-r)/(n-e)+r}function p(t){return t%2==0?"#ddd":"#222"}function d(t){return f(t,0,15,.02,.15)}var y=t.exports=function(t,e){return this.opts=r({},a,e),this.hash=e.hash||i(t),this.svg=new s,this.generateBackground(),this.generatePattern(),this};function b(t){return[[t,0,t,3*t],[0,t,3*t,t]]}function m(t){return[0,0,t,t,0,t,0,0].join(",")}function v(t,e,n,r,o){var i=m(r),s=d(o[0]),a=p(o[0]),u={stroke:c,"stroke-opacity":l,"fill-opacity":s,fill:a};t.polyline(i,u).transform({translate:[e+r,n],scale:[-1,1]}),t.polyline(i,u).transform({translate:[e+r,n+2*r],scale:[1,-1]}),s=d(o[1]),a=p(o[1]),u={stroke:c,"stroke-opacity":l,"fill-opacity":s,fill:a},t.polyline(i,u).transform({translate:[e+r,n+2*r],scale:[-1,-1]}),t.polyline(i,u).transform({translate:[e+r,n],scale:[1,1]})}function g(t,e,n,r,o){var i=d(o),s=p(o),a=m(r),u={stroke:c,"stroke-opacity":l,"fill-opacity":i,fill:s};t.polyline(a,u).transform({translate:[e,n+r],scale:[1,-1]}),t.polyline(a,u).transform({translate:[e+2*r,n+r],scale:[-1,-1]}),t.polyline(a,u).transform({translate:[e,n+r],scale:[1,1]}),t.polyline(a,u).transform({translate:[e+2*r,n+r],scale:[-1,1]})}y.prototype.toSvg=function(){return this.svg.toString()},y.prototype.toString=function(){return this.toSvg()},y.prototype.toBase64=function(){var t=this.toSvg();return"undefined"!=typeof window&&"function"==typeof window.btoa?window.btoa(t):new Buffer(t).toString("base64")},y.prototype.toDataUri=function(){return"data:image/svg+xml;base64,"+this.toBase64()},y.prototype.toDataUrl=function(){return'url("'+this.toDataUri()+'")'},y.prototype.generateBackground=function(){var t,e,n,r;this.opts.color?n=o.hex2rgb(this.opts.color):(e=f(h(this.hash,14,3),0,4095,0,359),r=h(this.hash,17),(t=o.rgb2hsl(o.hex2rgb(this.opts.baseColor))).h=(360*t.h-e+360)%360/360,t.s=r%2==0?Math.min(1,(100*t.s+r)/100):Math.max(0,(100*t.s-r)/100),n=o.hsl2rgb(t)),this.color=o.rgb2hex(n),this.svg.rect(0,0,"100%","100%",{fill:o.rgb2rgbString(n)})},y.prototype.generatePattern=function(){var t=this.opts.generator;if(t){if(u.indexOf(t)<0)throw new Error("The generator "+t+" does not exist.")}else t=u[h(this.hash,20)];return this["geo"+t.slice(0,1).toUpperCase()+t.slice(1)]()},y.prototype.geoHexagons=function(){var t,e,n,r,o,i,s,a=f(h(this.hash,0),0,15,8,60),u=a*Math.sqrt(3),y=2*a,b=function(t){var e=t,n=e/2,r=Math.sin(60*Math.PI/180)*e;return[0,r,n,0,n+e,0,2*e,r,n+e,2*r,n,2*r,0,r].join(",")}(a);for(this.svg.setWidth(3*y+3*a),this.svg.setHeight(6*u),e=0,s=0;s<6;s++)for(i=0;i<6;i++)t=i%2==0?s*u:s*u+u/2,n=d(o=h(this.hash,e)),r={fill:p(o),"fill-opacity":n,stroke:c,"stroke-opacity":l},this.svg.polyline(b,r).transform({translate:[i*a*1.5-y/2,t-u/2]}),0===i&&this.svg.polyline(b,r).transform({translate:[6*a*1.5-y/2,t-u/2]}),0===s&&(t=i%2==0?6*u:6*u+u/2,this.svg.polyline(b,r).transform({translate:[i*a*1.5-y/2,t-u/2]})),0===i&&0===s&&this.svg.polyline(b,r).transform({translate:[6*a*1.5-y/2,5*u+u/2]}),e++},y.prototype.geoSineWaves=function(){var t,e,n,r,o,i,s=Math.floor(f(h(this.hash,0),0,15,100,400)),a=Math.floor(f(h(this.hash,1),0,15,30,100)),u=Math.floor(f(h(this.hash,2),0,15,3,30));for(this.svg.setWidth(s),this.svg.setHeight(36*u),t=0;t<36;t++)e=d(o=h(this.hash,t)),r={fill:"none",stroke:p(o),opacity:e,"stroke-width":u+"px"},n="M0 "+a+" C "+(i=s/4*.7)+" 0, "+(s/2-i)+" 0, "+s/2+" "+a+" S "+(s-i)+" "+2*a+", "+s+" "+a+" S "+(1.5*s-i)+" 0, "+1.5*s+", "+a,this.svg.path(n,r).transform({translate:[-s/4,u*t-1.5*a]}),this.svg.path(n,r).transform({translate:[-s/4,u*t-1.5*a+36*u]})},y.prototype.geoChevrons=function(){var t,e,n,r,o,i,s,a,u,y,b=f(h(this.hash,0),0,15,30,80),m=f(h(this.hash,0),0,15,30,80),v=[[0,0,(t=b)/2,(e=m)-(n=.66*e),t/2,e,0,n,0,0],[t/2,e-n,t,0,t,n,t/2,e,t/2,e-n]].map(function(t){return t.join(",")});for(this.svg.setWidth(6*b),this.svg.setHeight(6*m*.66),o=0,y=0;y<6;y++)for(u=0;u<6;u++)i=d(a=h(this.hash,o)),r=p(a),s={stroke:c,"stroke-opacity":l,fill:r,"fill-opacity":i,"stroke-width":1},this.svg.group(s).transform({translate:[u*b,y*m*.66-m/2]}).polyline(v).end(),0===y&&this.svg.group(s).transform({translate:[u*b,6*m*.66-m/2]}).polyline(v).end(),o+=1},y.prototype.geoPlusSigns=function(){var t,e,n,r,o,i,s,a=f(h(this.hash,0),0,15,10,25),u=3*a,y=b(a);for(this.svg.setWidth(12*a),this.svg.setHeight(12*a),e=0,s=0;s<6;s++)for(i=0;i<6;i++)n=d(o=h(this.hash,e)),t=s%2==0?0:1,r={fill:p(o),stroke:c,"stroke-opacity":l,"fill-opacity":n},this.svg.group(r).transform({translate:[i*u-i*a+t*a-a,s*u-s*a-u/2]}).rect(y).end(),0===i&&this.svg.group(r).transform({translate:[4*u-i*a+t*a-a,s*u-s*a-u/2]}).rect(y).end(),0===s&&this.svg.group(r).transform({translate:[i*u-i*a+t*a-a,4*u-s*a-u/2]}).rect(y).end(),0===i&&0===s&&this.svg.group(r).transform({translate:[4*u-i*a+t*a-a,4*u-s*a-u/2]}).rect(y).end(),e++},y.prototype.geoXes=function(){var t,e,n,r,o,i,s,a=f(h(this.hash,0),0,15,10,25),u=b(a),c=3*a*.943;for(this.svg.setWidth(3*c),this.svg.setHeight(3*c),e=0,s=0;s<6;s++)for(i=0;i<6;i++)n=d(o=h(this.hash,e)),t=i%2==0?s*c-.5*c:s*c-.5*c+c/4,r={fill:p(o),opacity:n},this.svg.group(r).transform({translate:[i*c/2-c/2,t-s*c/2],rotate:[45,c/2,c/2]}).rect(u).end(),0===i&&this.svg.group(r).transform({translate:[6*c/2-c/2,t-s*c/2],rotate:[45,c/2,c/2]}).rect(u).end(),0===s&&(t=i%2==0?6*c-c/2:6*c-c/2+c/4,this.svg.group(r).transform({translate:[i*c/2-c/2,t-6*c/2],rotate:[45,c/2,c/2]}).rect(u).end()),5===s&&this.svg.group(r).transform({translate:[i*c/2-c/2,t-11*c/2],rotate:[45,c/2,c/2]}).rect(u).end(),0===i&&0===s&&this.svg.group(r).transform({translate:[6*c/2-c/2,t-6*c/2],rotate:[45,c/2,c/2]}).rect(u).end(),e++},y.prototype.geoOverlappingCircles=function(){var t,e,n,r,o,i,s=f(h(this.hash,0),0,15,25,200)/2;for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),t=0,i=0;i<6;i++)for(o=0;o<6;o++)e=d(r=h(this.hash,t)),n={fill:p(r),opacity:e},this.svg.circle(o*s,i*s,s,n),0===o&&this.svg.circle(6*s,i*s,s,n),0===i&&this.svg.circle(o*s,6*s,s,n),0===o&&0===i&&this.svg.circle(6*s,6*s,s,n),t++},y.prototype.geoOctogons=function(){var t,e,n,r,o,i,s=f(h(this.hash,0),0,15,10,60),a=function(t){var e=.33*t;return[e,0,t-e,0,t,e,t,t-e,t-e,t,e,t,0,t-e,0,e,e,0].join(",")}(s);for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),e=0,i=0;i<6;i++)for(o=0;o<6;o++)n=d(r=h(this.hash,e)),t=p(r),this.svg.polyline(a,{fill:t,"fill-opacity":n,stroke:c,"stroke-opacity":l}).transform({translate:[o*s,i*s]}),e+=1},y.prototype.geoSquares=function(){var t,e,n,r,o,i,s=f(h(this.hash,0),0,15,10,60);for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),e=0,i=0;i<6;i++)for(o=0;o<6;o++)n=d(r=h(this.hash,e)),t=p(r),this.svg.rect(o*s,i*s,s,s,{fill:t,"fill-opacity":n,stroke:c,"stroke-opacity":l}),e+=1},y.prototype.geoConcentricCircles=function(){var t,e,n,r,o,i,s=f(h(this.hash,0),0,15,10,60),a=s/5;for(this.svg.setWidth(6*(s+a)),this.svg.setHeight(6*(s+a)),e=0,i=0;i<6;i++)for(o=0;o<6;o++)n=d(r=h(this.hash,e)),t=p(r),this.svg.circle(o*s+o*a+(s+a)/2,i*s+i*a+(s+a)/2,s/2,{fill:"none",stroke:t,opacity:n,"stroke-width":a+"px"}),n=d(r=h(this.hash,39-e)),t=p(r),this.svg.circle(o*s+o*a+(s+a)/2,i*s+i*a+(s+a)/2,s/4,{fill:t,"fill-opacity":n}),e+=1},y.prototype.geoOverlappingRings=function(){var t,e,n,r,o,i,s=f(h(this.hash,0),0,15,10,60),a=s/4;for(this.svg.setWidth(6*s),this.svg.setHeight(6*s),t=0,i=0;i<6;i++)for(o=0;o<6;o++)e=d(r=h(this.hash,t)),n={fill:"none",stroke:p(r),opacity:e,"stroke-width":a+"px"},this.svg.circle(o*s,i*s,s-a/2,n),0===o&&this.svg.circle(6*s,i*s,s-a/2,n),0===i&&this.svg.circle(o*s,6*s,s-a/2,n),0===o&&0===i&&this.svg.circle(6*s,6*s,s-a/2,n),t+=1},y.prototype.geoTriangles=function(){var t,e,n,r,o,i,s,a=f(h(this.hash,0),0,15,15,80),u=a/2*Math.sqrt(3),y=function(t,e){var n=t/2;return[n,0,t,e,0,e,n,0].join(",")}(a,u);for(this.svg.setWidth(3*a),this.svg.setHeight(6*u),t=0,s=0;s<6;s++)for(i=0;i<6;i++)e=d(o=h(this.hash,t)),r={fill:p(o),"fill-opacity":e,stroke:c,"stroke-opacity":l},n=s%2==0?i%2==0?180:0:i%2!=0?180:0,this.svg.polyline(y,r).transform({translate:[i*a*.5-a/2,u*s],rotate:[n,a/2,u/2]}),0===i&&this.svg.polyline(y,r).transform({translate:[6*a*.5-a/2,u*s],rotate:[n,a/2,u/2]}),t+=1},y.prototype.geoDiamonds=function(){var t,e,n,r,o,i,s,a,u,y=f(h(this.hash,0),0,15,10,50),b=f(h(this.hash,1),0,15,10,50),m=[(t=y)/2,0,t,(e=b)/2,t/2,e,0,e/2].join(",");for(this.svg.setWidth(6*y),this.svg.setHeight(3*b),r=0,u=0;u<6;u++)for(a=0;a<6;a++)o=d(s=h(this.hash,r)),i={fill:p(s),"fill-opacity":o,stroke:c,"stroke-opacity":l},n=u%2==0?0:y/2,this.svg.polyline(m,i).transform({translate:[a*y-y/2+n,b/2*u-b/2]}),0===a&&this.svg.polyline(m,i).transform({translate:[6*y-y/2+n,b/2*u-b/2]}),0===u&&this.svg.polyline(m,i).transform({translate:[a*y-y/2+n,b/2*6-b/2]}),0===a&&0===u&&this.svg.polyline(m,i).transform({translate:[6*y-y/2+n,b/2*6-b/2]}),r+=1},y.prototype.geoNestedSquares=function(){var t,e,n,r,o,i,s=f(h(this.hash,0),0,15,4,12),a=7*s;for(this.svg.setWidth(6*(a+s)+6*s),this.svg.setHeight(6*(a+s)+6*s),t=0,i=0;i<6;i++)for(o=0;o<6;o++)e=d(r=h(this.hash,t)),n={fill:"none",stroke:p(r),opacity:e,"stroke-width":s+"px"},this.svg.rect(o*a+o*s*2+s/2,i*a+i*s*2+s/2,a,a,n),e=d(r=h(this.hash,39-t)),n={fill:"none",stroke:p(r),opacity:e,"stroke-width":s+"px"},this.svg.rect(o*a+o*s*2+s/2+2*s,i*a+i*s*2+s/2+2*s,3*s,3*s,n),t+=1},y.prototype.geoMosaicSquares=function(){var t,e,n,r=f(h(this.hash,0),0,15,15,50);for(this.svg.setWidth(8*r),this.svg.setHeight(8*r),t=0,n=0;n<4;n++)for(e=0;e<4;e++)e%2==0?n%2==0?g(this.svg,e*r*2,n*r*2,r,h(this.hash,t)):v(this.svg,e*r*2,n*r*2,r,[h(this.hash,t),h(this.hash,t+1)]):n%2==0?v(this.svg,e*r*2,n*r*2,r,[h(this.hash,t),h(this.hash,t+1)]):g(this.svg,e*r*2,n*r*2,r,h(this.hash,t)),t+=1},y.prototype.geoPlaid=function(){var t,e,n,r,o,i,s=0,a=0;for(e=0;e<36;)s+=h(this.hash,e)+5,n=d(i=h(this.hash,e+1)),t=p(i),r=i+5,this.svg.rect(0,s,"100%",r,{opacity:n,fill:t}),s+=r,e+=2;for(e=0;e<36;)a+=h(this.hash,e)+5,n=d(i=h(this.hash,e+1)),t=p(i),o=i+5,this.svg.rect(a,0,o,"100%",{opacity:n,fill:t}),a+=o,e+=2;this.svg.setWidth(a),this.svg.setHeight(s)},y.prototype.geoTessellation=function(){var t,e,n,r,o,i=f(h(this.hash,0),0,15,5,40),s=i*Math.sqrt(3),a=2*i,u=i/2*Math.sqrt(3),y=function(t,e){return[0,0,e,t/2,0,t,0,0].join(",")}(i,u),b=3*i+2*u,m=2*s+2*i;for(this.svg.setWidth(b),this.svg.setHeight(m),e=0;e<20;e++)switch(n=d(o=h(this.hash,e)),t=p(o),r={stroke:c,"stroke-opacity":l,fill:t,"fill-opacity":n,"stroke-width":1},e){case 0:this.svg.rect(-i/2,-i/2,i,i,r),this.svg.rect(b-i/2,-i/2,i,i,r),this.svg.rect(-i/2,m-i/2,i,i,r),this.svg.rect(b-i/2,m-i/2,i,i,r);break;case 1:this.svg.rect(a/2+u,s/2,i,i,r);break;case 2:this.svg.rect(-i/2,m/2-i/2,i,i,r),this.svg.rect(b-i/2,m/2-i/2,i,i,r);break;case 3:this.svg.rect(a/2+u,1.5*s+i,i,i,r);break;case 4:this.svg.polyline(y,r).transform({translate:[i/2,-i/2],rotate:[0,i/2,u/2]}),this.svg.polyline(y,r).transform({translate:[i/2,m- -i/2],rotate:[0,i/2,u/2],scale:[1,-1]});break;case 5:this.svg.polyline(y,r).transform({translate:[b-i/2,-i/2],rotate:[0,i/2,u/2],scale:[-1,1]}),this.svg.polyline(y,r).transform({translate:[b-i/2,m+i/2],rotate:[0,i/2,u/2],scale:[-1,-1]});break;case 6:this.svg.polyline(y,r).transform({translate:[b/2+i/2,s/2]});break;case 7:this.svg.polyline(y,r).transform({translate:[b-b/2-i/2,s/2],scale:[-1,1]});break;case 8:this.svg.polyline(y,r).transform({translate:[b/2+i/2,m-s/2],scale:[1,-1]});break;case 9:this.svg.polyline(y,r).transform({translate:[b-b/2-i/2,m-s/2],scale:[-1,-1]});break;case 10:this.svg.polyline(y,r).transform({translate:[i/2,m/2-i/2]});break;case 11:this.svg.polyline(y,r).transform({translate:[b-i/2,m/2-i/2],scale:[-1,1]});break;case 12:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,i/2],rotate:[-30,0,0]});break;case 13:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[i/2-b,i/2],rotate:[-30,0,0]});break;case 14:this.svg.rect(0,0,i,i,r).transform({translate:[i/2,m/2-i/2-i],rotate:[30,0,i]});break;case 15:this.svg.rect(0,0,i,i,r).transform({scale:[-1,1],translate:[i/2-b,m/2-i/2-i],rotate:[30,0,i]});break;case 16:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,m/2-m-i/2-i],rotate:[30,0,i]});break;case 17:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[i/2-b,m/2-m-i/2-i],rotate:[30,0,i]});break;case 18:this.svg.rect(0,0,i,i,r).transform({scale:[1,-1],translate:[i/2,i/2-m],rotate:[-30,0,0]});break;case 19:this.svg.rect(0,0,i,i,r).transform({scale:[-1,-1],translate:[i/2-b,i/2-m],rotate:[-30,0,0]})}}},19673:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(80743);e.isNumeric=function(t){return!r.isArray(t)&&t-parseFloat(t)+1>=0}},19758:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});class r{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+r.version}static addUnaryOp(t){return r.max_unop_len=Math.max(t.length,r.max_unop_len),r.unary_ops[t]=1,r}static addBinaryOp(t,e,n){return r.max_binop_len=Math.max(t.length,r.max_binop_len),r.binary_ops[t]=e,n?r.right_associative.add(t):r.right_associative.delete(t),r}static addIdentifierChar(t){return r.additional_identifier_chars.add(t),r}static addLiteral(t,e){return r.literals[t]=e,r}static removeUnaryOp(t){return delete r.unary_ops[t],t.length===r.max_unop_len&&(r.max_unop_len=r.getMaxKeyLen(r.unary_ops)),r}static removeAllUnaryOps(){return r.unary_ops={},r.max_unop_len=0,r}static removeIdentifierChar(t){return r.additional_identifier_chars.delete(t),r}static removeBinaryOp(t){return delete r.binary_ops[t],t.length===r.max_binop_len&&(r.max_binop_len=r.getMaxKeyLen(r.binary_ops)),r.right_associative.delete(t),r}static removeAllBinaryOps(){return r.binary_ops={},r.max_binop_len=0,r}static removeLiteral(t){return delete r.literals[t],r}static removeAllLiterals(){return r.literals={},r}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new r(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(t=>t.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return r.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!r.binary_ops[String.fromCharCode(t)]||r.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return r.isIdentifierStart(t)||r.isDecimalDigit(t)}throwError(t){const e=new Error(t+" at character "+this.index);throw e.index=this.index,e.description=t,e}runHook(t,e){if(r.hooks[t]){const n={context:this,node:e};return r.hooks.run(t,n),n.node}return e}searchHook(t){if(r.hooks[t]){const e={context:this};return r.hooks[t].find(function(t){return t.call(e.context,e),e.node}),e.node}}gobbleSpaces(){let t=this.code;for(;t===r.SPACE_CODE||t===r.TAB_CODE||t===r.LF_CODE||t===r.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const t=this.gobbleExpressions(),e=1===t.length?t[0]:{type:r.COMPOUND,body:t};return this.runHook("after-all",e)}gobbleExpressions(t){let e,n,o=[];for(;this.index<this.expr.length;)if(e=this.code,e===r.SEMCOL_CODE||e===r.COMMA_CODE)this.index++;else if(n=this.gobbleExpression())o.push(n);else if(this.index<this.expr.length){if(e===t)break;this.throwError('Unexpected "'+this.char+'"')}return o}gobbleExpression(){const t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,r.max_binop_len),e=t.length;for(;e>0;){if(r.binary_ops.hasOwnProperty(t)&&(!r.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!r.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=e,t;t=t.substr(0,--e)}return!1}gobbleBinaryExpression(){let t,e,n,o,i,s,a,u,c;if(s=this.gobbleToken(),!s)return s;if(e=this.gobbleBinaryOp(),!e)return s;for(i={value:e,prec:r.binaryPrecedence(e),right_a:r.right_associative.has(e)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+e),o=[s,i,a];e=this.gobbleBinaryOp();){if(n=r.binaryPrecedence(e),0===n){this.index-=e.length;break}i={value:e,prec:n,right_a:r.right_associative.has(e)},c=e;const u=t=>i.right_a&&t.right_a?n>t.prec:n<=t.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),e=o.pop().value,s=o.pop(),t={type:r.BINARY_EXP,operator:e,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+c),o.push(i,t)}for(u=o.length-1,t=o[u];u>1;)t={type:r.BINARY_EXP,operator:o[u-1].value,left:o[u-2],right:t},u-=2;return t}gobbleToken(){let t,e,n,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,r.isDecimalDigit(t)||t===r.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===r.SQUOTE_CODE||t===r.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===r.OBRACK_CODE)o=this.gobbleArray();else{for(e=this.expr.substr(this.index,r.max_unop_len),n=e.length;n>0;){if(r.unary_ops.hasOwnProperty(e)&&(!r.isIdentifierStart(this.code)||this.index+e.length<this.expr.length&&!r.isIdentifierPart(this.expr.charCodeAt(this.index+e.length)))){this.index+=n;const t=this.gobbleToken();return t||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:r.UNARY_EXP,operator:e,argument:t,prefix:!0})}e=e.substr(0,--n)}r.isIdentifierStart(t)?(o=this.gobbleIdentifier(),r.literals.hasOwnProperty(o.name)?o={type:r.LITERAL,value:r.literals[o.name],raw:o.name}:o.name===r.this_str&&(o={type:r.THIS_EXP})):t===r.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let e=this.code;for(;e===r.PERIOD_CODE||e===r.OBRACK_CODE||e===r.OPAREN_CODE||e===r.QUMARK_CODE;){let n;if(e===r.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==r.PERIOD_CODE)break;n=!0,this.index+=2,this.gobbleSpaces(),e=this.code}this.index++,e===r.OBRACK_CODE?((t={type:r.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()}).property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),e=this.code,e!==r.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):e===r.OPAREN_CODE?t={type:r.CALL_EXP,arguments:this.gobbleArguments(r.CPAREN_CODE),callee:t}:(e===r.PERIOD_CODE||n)&&(n&&this.index--,this.gobbleSpaces(),t={type:r.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),n&&(t.optional=!0),this.gobbleSpaces(),e=this.code}return t}gobbleNumericLiteral(){let t,e,n="";for(;r.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(this.code===r.PERIOD_CODE)for(n+=this.expr.charAt(this.index++);r.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);if(t=this.char,"e"===t||"E"===t){for(n+=this.expr.charAt(this.index++),t=this.char,"+"!==t&&"-"!==t||(n+=this.expr.charAt(this.index++));r.isDecimalDigit(this.code);)n+=this.expr.charAt(this.index++);r.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+n+this.char+")")}return e=this.code,r.isIdentifierStart(e)?this.throwError("Variable names cannot start with a number ("+n+this.char+")"):(e===r.PERIOD_CODE||1===n.length&&n.charCodeAt(0)===r.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:r.LITERAL,value:parseFloat(n),raw:n}}gobbleStringLiteral(){let t="";const e=this.index,n=this.expr.charAt(this.index++);let o=!1;for(;this.index<this.expr.length;){let e=this.expr.charAt(this.index++);if(e===n){o=!0;break}if("\\"===e)switch(e=this.expr.charAt(this.index++),e){case"n":t+="\n";break;case"r":t+="\r";break;case"t":t+="\t";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=e}else t+=e}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:r.LITERAL,value:t,raw:this.expr.substring(e,this.index)}}gobbleIdentifier(){let t=this.code,e=this.index;for(r.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,r.isIdentifierPart(t));)this.index++;return{type:r.IDENTIFIER,name:this.expr.slice(e,this.index)}}gobbleArguments(t){const e=[];let n=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let i=this.code;if(i===t){n=!0,this.index++,t===r.CPAREN_CODE&&o&&o>=e.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}if(i===r.COMMA_CODE){if(this.index++,o++,o!==e.length)if(t===r.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===r.CBRACK_CODE)for(let t=e.length;t<o;t++)e.push(null)}else if(e.length!==o&&0!==o)this.throwError("Expected comma");else{const t=this.gobbleExpression();t&&t.type!==r.COMPOUND||this.throwError("Expected comma"),e.push(t)}}return n||this.throwError("Expected "+String.fromCharCode(t)),e}gobbleGroup(){this.index++;let t=this.gobbleExpressions(r.CPAREN_CODE);if(this.code===r.CPAREN_CODE)return this.index++,1===t.length?t[0]:!!t.length&&{type:r.SEQUENCE_EXP,expressions:t};this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:r.ARRAY_EXP,elements:this.gobbleArguments(r.CBRACK_CODE)}}}const o=new class{add(t,e,n){if("string"!=typeof arguments[0])for(let t in arguments[0])this.add(t,arguments[0][t],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(t){this[t]=this[t]||[],e&&this[t][n?"unshift":"push"](e)},this)}run(t,e){this[t]=this[t]||[],this[t].forEach(function(t){t.call(e&&e.context?e.context:e,e)})}};Object.assign(r,{hooks:o,plugins:new class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(t=>{if("object"!=typeof t||!t.name||!t.init)throw new Error("Invalid JSEP plugin format");this.registered[t.name]||(t.init(this.jsep),this.registered[t.name]=t)})}}(r),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),r.max_unop_len=r.getMaxKeyLen(r.unary_ops),r.max_binop_len=r.getMaxKeyLen(r.binary_ops);const i=t=>new r(t).parse(),s=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(r).filter(t=>!s.includes(t)&&void 0===i[t]).forEach(t=>{i[t]=r[t]}),i.Jsep=r;var a={name:"ternary",init(t){t.hooks.add("after-expression",function(e){if(e.node&&this.code===t.QUMARK_CODE){this.index++;const n=e.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===t.COLON_CODE){this.index++;const o=this.gobbleExpression();if(o||this.throwError("Expected expression"),e.node={type:"ConditionalExpression",test:n,consequent:r,alternate:o},n.operator&&t.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&t.binary_ops[r.right.operator]<=.9;)r=r.right;e.node.test=r.right,r.right=e.node,e.node=n}}else this.throwError("Expected :")}})}};i.plugins.register(a)},20206:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(61758),o=n(14151);const i=r.A?function(t,e){return(0,r.A)(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:o.A;var s=Date.now;const a=(u=i,c=0,l=0,function(){var t=s(),e=16-(t-l);if(l=t,e>0){if(++c>=800)return arguments[0]}else c=0;return u.apply(void 0,arguments)});var u,c,l},20232:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(38513),o=n(49529);e.publishLast=function(){return function(t){return o.multicast(new r.AsyncSubject)(t)}}},20320:(t,e,n)=>{"use strict";n.d(e,{P:()=>r});var r=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}()},20328:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(71077),s=n(63792),a=n(21016),u=n(24654),c=n(18860),l=n(43716),h=function(t){function e(e,n,r){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=r,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return o(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var n=this._events;n.push(e),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new f(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,n=this._infiniteTimeWindow,r=n?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=r.length;if(this.closed)throw new c.ObjectUnsubscribedError;if(this.isStopped||this.hasError?e=a.Subscription.EMPTY:(this.observers.push(t),e=new l.SubjectSubscription(this,t)),o&&t.add(t=new u.ObserveOnSubscriber(t,o)),n)for(var s=0;s<i&&!t.closed;s++)t.next(r[s]);else for(s=0;s<i&&!t.closed;s++)t.next(r[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||s.queue).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,n=this._windowTime,r=this._events,o=r.length,i=0;i<o&&!(t-r[i].time<n);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&r.splice(0,i),r},e}(i.Subject);e.ReplaySubject=h;var f=function(t,e){this.time=t,this.value=e}},20367:(t,e,n)=>{"use strict";n.d(e,{$f:()=>g,QE:()=>M,g$:()=>P,IU:()=>d,HW:()=>x,xC:()=>A,Kx:()=>k,EW:()=>O,L7:()=>I,Gm:()=>b,lo:()=>m,ut:()=>v,yH:()=>E,Jj:()=>p,Ct:()=>y,eA:()=>_,Gp:()=>C,E4:()=>S,Fi:()=>T,Y0:()=>R,st:()=>j});var r=n(60937),o=n(23790);const i=function(t){return void 0===t};var s=n(87635),a=n(78938),u=n(95819),c=n(11305);const l="${openmrsSpaBase}/login",h={redirectAuthFailure:{enabled:{_type:u.ZU.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:u.ZU.String,_default:l,_validators:[u.y$.isUrl],_description:"The url to which users will be redirected when they are logged out. If set to blank, the `location` header from the response will be used."},errors:{_type:u.ZU.Array,_default:[401],_elements:{_type:u.ZU.Number,_validators:[u.y$.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:u.ZU.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."}},followRedirects:{_type:u.ZU.Boolean,_default:!0,_description:"Whether openmrsFetch should support redirects returned from the backend"}};function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const p="/ws/rest/v1",d="/ws/fhir2/R4",y=`${p}/session`;function b(t){return t&&t.startsWith("http")?t:("/"!==t[0]&&(t="/"+t),window.openmrsBase+t)}function m(t,e={}){if("string"!=typeof t)throw Error("The first argument to @openmrs/api's openmrsFetch function must be a url string");if("object"!=typeof e)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.");let n=b(t);if(e.headers||(e.headers={}),(0,a.A)(e.body)&&(e.body=JSON.stringify(e.body)),void 0===e.headers.Accept&&(e.headers.Accept="application/json"),null===e.headers.Accept&&delete e.headers.Accept,t.startsWith(p)&&void 0===e.headers["Disable-WWW-Authenticate"]&&(e.headers["Disable-WWW-Authenticate"]="true"),t.startsWith(d)){const t=new URL(n,window.location.toString());t.searchParams.has("_summary")||(t.searchParams.set("_summary","data"),n=t.toString())}const r=Error();return window.fetch(n,e).then(async t=>{const e=t,{redirectAuthFailure:o,followRedirects:i}=await(0,u.zj)("@openmrs/esm-api");if(e.ok){if(204===e.status){if(i&&e.headers.has("location")){const t=e.headers.get("location");t&&(0,c.oo)({to:t})}return e.data=null,e}return e.clone().text().then(t=>{try{t&&(e.data=JSON.parse(t))}catch(t){}return e})}if(n===b(y)&&403===e.status||o.enabled&&o.errors.includes(e.status)){(0,c.g4)();const t=o.url||e.headers.get("location")||l;return(0,c.oo)({to:t}),o.resolvePromise?Promise.resolve():new Promise(()=>{})}return e.clone().text().then(t=>{let o=t;try{o=JSON.parse(t)}catch(t){}throw new g(n,e,o,r)},t=>{throw new g(n,e,null,r)})})}function v(t,e={}){if("object"!=typeof e)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const n=new AbortController;return e.signal=n.signal,new s.c(r=>{let o=!1;return m(t,e).then(t=>{o=!0,r.next(t),r.complete()},t=>{o=!0,r.error(t)}),()=>{o||n.abort()}})}class g extends Error{constructor(t,e,n,r){super(),f(this,"response",void 0),f(this,"responseBody",void 0),this.message=`Server responded with ${e.status} (${e.statusText}) for url ${t}. Check err.responseBody or network tab in dev tools for more info`,r.message=this.message,this.responseBody=n,this.response=e,this.stack=`Stacktrace for outgoing request:\n${r.stack}\nStacktrace for incoming response:\n${this.stack}`}}const _=(0,o.Zd)("session",{loaded:!1,session:null});let w=0;function x(t={includeAuthStatus:!0}){return(w<Date.now()-6e4||!_.getState().loaded)&&E(),new s.c(e=>{const n=n=>{n.loaded&&(t.includeAuthStatus?e.next(n.session):e.next(n.session?.user))};return n(_.getState()),_.subscribe(n)})}function O(){return(w<Date.now()-6e4||!_.getState().loaded)&&E(),_}function S(t){let e=t.locale??t.user?.userProperties?.defaultLocale;e&&e.includes("_")&&(e=e.replaceAll("_","-")),function(t){if(void 0===t||"string"!=typeof t)return!1;try{new Intl.Locale(t)}catch(t){return!1}return!0}(e)&&e!==document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",e)}function E(t,e){w=Date.now();let n={};return t&&e&&(n.Authorization=`Basic ${window.btoa(`${t}:${e}`)}`),N(m(y,{headers:n}))}function P(){_.setState({loaded:!0,session:{authenticated:!1,sessionId:""}})}function j(t,e){return void 0===e?!Boolean(t):!Boolean(t)||function(t,e){return"string"==typeof t?!i(e.privileges.find(e=>t===e.display)):Array.isArray(t)?t.every(t=>!i(e.privileges.find(e=>t===e.display))):(i(t)||console.error(`Could not understand privileges "${t}"`),!0)}(t,e)||function(t){return!i(t.roles.find(t=>"System Developer"===t.display))}(e)}function A(){let t,e;return new Promise(n=>{const r=r=>{r.loaded&&r.session.user&&(t=r.session.user,n(r.session.user),e&&e())};r(_.getState()),t||(e=_.subscribe(r))})}function k(){return new Promise((t,e)=>{x().subscribe(e=>{t(e.sessionLocation)},e).unsubscribe()})}async function C(t,e){return N(m(y,{method:"POST",body:{sessionLocation:t},headers:{"Content-Type":"application/json"},signal:e.signal}))}async function T(t,e,n){return n||(n=new AbortController),await m(`${p}/user/${t}`,{method:"POST",body:{userProperties:e},headers:{"Content-Type":"application/json"},signal:n.signal}),E()}function N(t){return new Promise((e,n)=>{t.then(t=>{let r;"object"==typeof t?.data?(r={loaded:!0,session:t.data},_.setState(r),e(r)):(r={loaded:!1,session:null},_.setState(r),n(r))}).catch(t=>{(0,r.N)(`Failed to fetch new session information: ${t}`);const e={loaded:!1,session:null};_.setState(e),n(e)})})}function I(){return"development"===window.spaEnv||"true"===localStorage.getItem("openmrs:devtools")}_.subscribe(t=>{t.loaded&&t.session&&S(t.session)});const M={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"};function R(){(0,u.T0)("@openmrs/esm-api",h),E()}},20917:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(89233),s=n(85295),a=n(75901);e.switchMap=function t(e,n){return"function"==typeof n?function(r){return r.pipe(t(function(t,r){return s.from(e(t,r)).pipe(i.map(function(e,o){return n(t,e,r,o)}))}))}:function(t){return t.lift(new u(e))}};var u=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project))},t}(),c=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return o(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e)},e.prototype._innerSub=function(t){var e=this.innerSubscription;e&&e.unsubscribe();var n=new a.SimpleInnerSubscriber(this),r=this.destination;r.add(n),this.innerSubscription=a.innerSubscribe(t,n),this.innerSubscription!==n&&r.add(this.innerSubscription)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t){this.destination.next(t)},e}(a.SimpleOuterSubscriber)},21016:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(80743),o=n(6727),i=n(84864),s=n(11806),a=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this,a=n._parentOrParents,c=n._ctorUnsubscribe,l=n._unsubscribe,h=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,a instanceof t)a.remove(this);else if(null!==a)for(var f=0;f<a.length;++f)a[f].remove(this);if(i.isFunction(l)){c&&(this._unsubscribe=void 0);try{l.call(this)}catch(t){e=t instanceof s.UnsubscriptionError?u(t.errors):[t]}}if(r.isArray(h)){f=-1;for(var p=h.length;++f<p;){var d=h[f];if(o.isObject(d))try{d.unsubscribe()}catch(t){e=e||[],t instanceof s.UnsubscriptionError?e=e.concat(u(t.errors)):e.push(t)}}}if(e)throw new s.UnsubscriptionError(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof t){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function u(t){return t.reduce(function(t,e){return t.concat(e instanceof s.UnsubscriptionError?e.errors:e)},[])}e.Subscription=a},21226:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(77759);e.canReportError=function(t){for(;t;){var e=t,n=e.closed,o=e.destination,i=e.isStopped;if(n||i)return!1;t=o&&o instanceof r.Subscriber?o:null}return!0}},21324:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20917),o=n(78522);e.switchAll=function(){return r.switchMap(o.identity)}},21547:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(71929);e.min=function(t){var e="function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t<e?t:e};return r.reduce(e)}},22244:(t,e,n)=>{"use strict";n.d(e,{AG:()=>Et,EH:()=>rt,fz:()=>Tt,xL:()=>F});var r=Object.freeze({__proto__:null,get start(){return Bt},get ensureJQuerySupport(){return pt},get setBootstrapMaxTime(){return H},get setMountMaxTime(){return G},get setUnmountMaxTime(){return Y},get setUnloadMaxTime(){return J},get registerApplication(){return Et},get unregisterApplication(){return jt},get getMountedApps(){return wt},get getAppStatus(){return Ot},get unloadApplication(){return At},get checkActivityFunctions(){return Pt},get getAppNames(){return xt},get pathToActiveWhen(){return Tt},get navigateToUrl(){return rt},get patchHistoryApi(){return lt},get triggerAppChange(){return Rt},get addErrorHandler(){return u},get removeErrorHandler(){return c},get mountRootParcel(){return F},get NOT_LOADED(){return f},get LOADING_SOURCE_CODE(){return p},get NOT_BOOTSTRAPPED(){return d},get BOOTSTRAPPING(){return y},get NOT_MOUNTED(){return b},get MOUNTING(){return m},get UPDATING(){return g},get LOAD_ERROR(){return x},get MOUNTED(){return v},get UNLOADING(){return w},get UNMOUNTING(){return _},get SKIP_BECAUSE_BROKEN(){return O}}),o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n};let s=[];function a(t,e,n){const r=h(t,e,n);s.length?s.forEach(t=>t(r)):setTimeout(()=>{throw r})}function u(t){if("function"!=typeof t)throw Error(l(28,!1));s.push(t)}function c(t){if("function"!=typeof t)throw Error(l(29,!1));let e=!1;return s=s.filter(n=>{const r=n===t;return e=e||r,!r}),e}function l(t,e,...n){return`single-spa minified message #${t}: ${e?e+" ":""}See https://single-spa.js.org/error/?code=${t}${n.length?`&arg=${n.join("&arg=")}`:""}`}function h(t,e,n){const r=`${A(e)} '${P(e)}' died in status ${e.status}: `;let o;if(t instanceof Error){try{t.message=r+t.message}catch(t){}o=t}else{console.warn(l(30,!1,e.status,P(e)));try{o=Error(r+JSON.stringify(t))}catch(e){o=t}}return o.appOrParcelName=P(e),e.status=n,o}const f="NOT_LOADED",p="LOADING_SOURCE_CODE",d="NOT_BOOTSTRAPPED",y="BOOTSTRAPPING",b="NOT_MOUNTED",m="MOUNTING",v="MOUNTED",g="UPDATING",_="UNMOUNTING",w="UNLOADING",x="LOAD_ERROR",O="SKIP_BECAUSE_BROKEN";function S(t){return t.status===v}function E(t){try{return t.activeWhen(window.location)}catch(e){return a(e,t,O),!1}}function P(t){return t.name}function j(t){return Boolean(t.unmountThisParcel)}function A(t){return j(t)?"parcel":"application"}function k(){for(let t=arguments.length-1;t>0;t--)for(let e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function C(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function T(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!C(e,t=>"function"!=typeof t)));var e}function N(t,e){let n=t[e]||[];n=Array.isArray(n)?n:[n],0===n.length&&(n=[()=>Promise.resolve()]);const r=A(t),o=P(t);return function(t){return n.reduce((n,i,s)=>n.then(()=>{const n=i(t);return I(n)?n:Promise.reject(l(15,!1,r,o,e,s))}),Promise.resolve())}}function I(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}let M=[];function R(t,e){return Promise.resolve().then(()=>t.status!==d?t:(t.status=y,t.bootstrap?Q(t,"bootstrap").then(n).catch(n=>{if(e)throw h(n,t,O);return a(n,t,O),t}):Promise.resolve().then(n)));function n(){return t.status=b,t}}function D(t,e){return Promise.resolve().then(()=>{if(t.status!==v)return t;t.status=_;const n=Object.keys(t.parcels).map(e=>t.parcels[e].unmountThisParcel());return Promise.all(n).then(r,n=>r().then(()=>{const r=Error(n.message);if(e)throw h(r,t,O);a(r,t,O)})).then(()=>t);function r(){return Q(t,"unmount").then(()=>{t.status=b},n=>{if(e)throw h(n,t,O);a(n,t,O)})}})}let $=!1,L=!1;function B(t,e){return Promise.resolve().then(()=>t.status!==b?t:($||(window.dispatchEvent(new i("single-spa:before-first-mount")),$=!0),t.status=m,Q(t,"mount").then(()=>(t.status=v,L||(window.dispatchEvent(new i("single-spa:first-mount")),L=!0),t)).catch(n=>{return t.status=v,D(t,!0).then(r,r);function r(){if(e)throw h(n,t,O);return a(n,t,O),t}})))}let U=0;const V={parcels:{}};function F(){return K.apply(V,arguments)}function K(t,e){const n=this;if(!t||"object"!=typeof t&&"function"!=typeof t)throw Error(l(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(l(3,!1,typeof t.name));const r=U++;let o=t.name||`parcel-${r}`;if("object"!=typeof e)throw Error(l(4,!1,o,typeof e));if(!e.domElement)throw Error(l(5,!1,o));const i="function"==typeof t,s=i?t:()=>Promise.resolve(t),a={id:r,parcels:{},status:i?p:d,customProps:e,parentName:P(n),unmountThisParcel:()=>y.then(()=>{if(a.status!==v)throw Error(l(6,!1,o,a.status));return D(a,!0)}).then(t=>(a.parentName&&delete n.parcels[a.id],t)).then(t=>(m(t),t)).catch(t=>{throw a.status=O,_(t),t})};let u;n.parcels[r]=a;let c=s();if(!c||"function"!=typeof c.then)throw Error(l(7,!1));c=c.then(t=>{if(!t)throw Error(l(8,!1));if(o=t.name||`parcel-${r}`,Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!T(t.bootstrap))throw Error(l(9,!1,o));if(!T(t.mount))throw Error(l(10,!1,o));if(!T(t.unmount))throw Error(l(11,!1,o));if(t.update&&!T(t.update))throw Error(l(12,!1,o));const e=N(t,"bootstrap"),n=N(t,"mount"),i=N(t,"unmount");a.status=d,a.name=o,a.bootstrap=e,a.mount=n,a.unmount=i,a.timeouts=X(t.timeouts),t.update&&(a.update=N(t,"update"),u.update=function(t){return a.customProps=t,W((e=a,Promise.resolve().then(()=>{if(e.status!==v)throw Error(l(32,!1,P(e)));return e.status=g,Q(e,"update").then(()=>(e.status=v,e)).catch(t=>{throw h(t,e,O)})})));var e})});const f=c.then(()=>R(a,!0)),y=f.then(()=>B(a,!0));let m,_;const w=new Promise((t,e)=>{m=t,_=e});return u={mount:()=>W(Promise.resolve().then(()=>{if(a.status!==b)throw Error(l(13,!1,o,a.status));return n.parcels[r]=a,B(a)})),unmount:()=>W(a.unmountThisParcel()),getStatus:()=>a.status,loadPromise:W(c),bootstrapPromise:W(f),mountPromise:W(y),unmountPromise:W(w)},u}function W(t){return t.then(()=>null)}function q(t){const e=P(t);let n="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!=typeof n||null===n||Array.isArray(n))&&(n={},console.warn(l(40,!1),e,n));const o=k({},n,{name:e,mountParcel:K.bind(t),singleSpa:r});return j(t)&&(o.unmountSelf=t.unmountThisParcel),o}const z={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 H(t,e,n){if("number"!=typeof t||t<=0)throw Error(l(16,!1));z.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function G(t,e,n){if("number"!=typeof t||t<=0)throw Error(l(17,!1));z.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function Y(t,e,n){if("number"!=typeof t||t<=0)throw Error(l(18,!1));z.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function J(t,e,n){if("number"!=typeof t||t<=0)throw Error(l(19,!1));z.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function Q(t,e){const n=t.timeouts[e],r=n.warningMillis,o=A(t);return new Promise((i,s)=>{let a=!1,u=!1;t[e](q(t)).then(t=>{a=!0,i(t)}).catch(t=>{a=!0,s(t)}),setTimeout(()=>h(1),r),setTimeout(()=>h(!0),n.millis);const c=l(31,!1,e,o,P(t),n.millis);function h(t){if(!a)if(!0===t)u=!0,n.dieOnTimeout?s(Error(c)):console.error(c);else if(!u){const e=t,o=e*r;console.warn(c),o+r<n.millis&&setTimeout(()=>h(e+1),r)}}})}function X(t){const e={};for(let n in z)e[n]=k({},z[n],t&&t[n]||{});return e}function Z(t){return Promise.resolve().then(()=>{if(t.loadPromise)return t.loadPromise;if(t.status!==f&&t.status!==x)return t;let e,n;return t.status=p,t.loadPromise=Promise.resolve().then(()=>{const r=t.loadApp(q(t));if(!I(r))throw n=!0,Error(l(33,!1,P(t)));return r.then(n=>{let r;t.loadErrorTime=null,e=n,"object"!=typeof e&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!T(e.bootstrap)&&(r=35),T(e.mount)||(r=36),T(e.unmount)||(r=37);const o=A(e);if(r){let n;try{n=JSON.stringify(e)}catch(t){}return console.error(l(r,!1,o,P(t),n),e),a(void 0,t,O),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=k({},t.devtools.overlays,e.devtools.overlays)),t.status=d,t.bootstrap=N(e,"bootstrap"),t.mount=N(e,"mount"),t.unmount=N(e,"unmount"),t.unload=N(e,"unload"),t.timeouts=X(e.timeouts),delete t.loadPromise,t})}).catch(e=>{let r;return delete t.loadPromise,n?r=O:(r=x,t.loadErrorTime=(new Date).getTime()),a(e,t,r),t})})}const tt="undefined"!=typeof window,et={hashchange:[],popstate:[]},nt=["hashchange","popstate"];function rt(t){let e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(l(14,!1));e=t.currentTarget.href,t.preventDefault()}const n=ht(window.location.href),r=ht(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function ot(t){if(t){const e=t[0].type;nt.indexOf(e)>=0&&et[e].forEach(e=>{try{e.apply(this,t)}catch(t){setTimeout(()=>{throw t})}})}}let it;function st(){Dt([],arguments)}function at(t,e){return function(){const n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return it&&n===o||window.dispatchEvent(function(t,e){let n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){n=document.createEvent("PopStateEvent"),n.initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}(window.history.state,e)),r}}let ut=null,ct=!1;function lt(t){if(ct)throw Error(l(43,!1));it=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,ct=!0,ut=window.history.replaceState,window.addEventListener("hashchange",st),window.addEventListener("popstate",st);const e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0)||C(et[t],t=>t===n))return e.apply(this,arguments);et[t].push(n)},window.removeEventListener=function(t,e){return"function"==typeof e&&nt.indexOf(t)>=0&&(et[t]=et[t].filter(t=>t!==e)),n.apply(this,arguments)},window.history.pushState=at(window.history.pushState,"pushState"),window.history.replaceState=at(ut,"replaceState")}function ht(t){const e=document.createElement("a");return e.href=t,e}tt&&(window.singleSpaNavigate?console.warn(l(41,!1)):window.singleSpaNavigate=rt);let ft=!1;function pt(t=window.jQuery){if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ft){const e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return dt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return dt.call(this,n,window.removeEventListener,t,e,arguments)},ft=!0}}function dt(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach(t=>{nt.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))}),""===n.trim()?this:t.apply(this,o))}const yt={};function bt(t){return Promise.resolve().then(()=>{const e=yt[P(t)];if(!e)return t;if(t.status===f)return mt(t,e),t;if(t.status===w)return e.promise.then(()=>t);if(t.status!==b&&t.status!==x)return t;const n=t.status===x?Promise.resolve():Q(t,"unload");return t.status=w,n.then(()=>(mt(t,e),t)).catch(n=>(function(t,e,n){delete yt[P(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(n,t,O),e.reject(n)}(t,e,n),t))})}function mt(t,e){delete yt[P(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=f,e.resolve()}function vt(t,e,n,r){yt[P(t)]={app:t,resolve:n,reject:r},Object.defineProperty(yt[P(t)],"promise",{get:e})}function gt(t){return yt[t]}const _t=[];function wt(){return _t.filter(S).map(P)}function xt(){return _t.map(P)}function Ot(t){const e=C(_t,e=>P(e)===t);return e?e.status:null}let St=!1;function Et(t,e,n,r){const o=function(t,e,n,r){const o={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof t?(function(t){if(Array.isArray(t)||null===t)throw Error(l(39,!1));const e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce((t,n)=>e.indexOf(n)>=0?t:t.concat(n),[]);if(0!==n.length)throw Error(l(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(l(20,!1));if("object"!=typeof t.app&&"function"!=typeof t.app)throw Error(l(20,!1));const r=t=>"string"==typeof t||"function"==typeof t;if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(l(24,!1));if(!Ct(t.customProps))throw Error(l(22,!1))}(t),o.name=t.name,o.loadApp=t.app,o.activeWhen=t.activeWhen,o.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(l(20,!1));if(!e)throw Error(l(23,!1));if("function"!=typeof n)throw Error(l(24,!1));if(!Ct(r))throw Error(l(22,!1))}(t,e,n,r),o.name=t,o.loadApp=e,o.activeWhen=n,o.customProps=r),o.loadApp="function"!=typeof(i=o.loadApp)?()=>Promise.resolve(i):i,o.customProps=function(t){return t||{}}(o.customProps),o.activeWhen=function(t){let e=Array.isArray(t)?t:[t];return e=e.map(t=>"function"==typeof t?t:Tt(t)),t=>e.some(e=>e(t))}(o.activeWhen),o;var i}(t,e,n,r);if(Ut()||St||(St=!0,setTimeout(()=>{Ut()||console.warn(l(1,!1))},5e3)),-1!==xt().indexOf(o.name))throw Error(l(21,!1,o.name));_t.push(k({loadErrorTime:null,status:f,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),tt&&(pt(),Dt())}function Pt(t=window.location){return _t.filter(e=>e.activeWhen(t)).map(P)}function jt(t){if(0===_t.filter(e=>P(e)===t).length)throw Error(l(25,!1,t));return(tt?At(t,{waitForUnmount:!1}):Promise.resolve()).then(()=>{const e=_t.map(P).indexOf(t);_t.splice(e,1)})}function At(t,e={waitForUnmount:!1}){if("string"!=typeof t)throw Error(l(26,!1));const n=C(_t,e=>P(e)===t);if(!n)throw Error(l(27,!1,t));const r=gt(P(n));if(e&&e.waitForUnmount){if(r)return r.promise;{const t=new Promise((e,r)=>{vt(n,()=>t,e,r)});return t}}{let t;return r?(t=r.promise,kt(n,r.resolve,r.reject)):t=new Promise((e,r)=>{vt(n,()=>t,e,r),kt(n,e,r)}),t}}function kt(t,e,n){Promise.resolve().then(()=>{if(C(Pt(),e=>e===P(t)))return Rt()}).then(()=>D(t).then(bt).then(()=>{e(),setTimeout(()=>{Dt()})})).catch(n)}function Ct(t){return!t||"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)}function Tt(t,e){const n=function(t,e){let n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(let e=0;e<t.length;e++){const n=t[e];(!r&&":"===n||r&&"/"===n)&&i(e)}return i(t.length),new RegExp(o,"i");function i(i){const s=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":s,i===t.length)if(r)e&&(o+="$");else{const t=e?"":".*";o="/"===o.charAt(o.length-1)?`${o}${t}$`:`${o}(/${t})?(#.*)?$`}r=!r,n=i}}(t,e);return t=>{let e=t.origin;e||(e=`${t.protocol}//${t.host}`);const r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}let Nt=!1,It=[],Mt=tt&&window.location.href;function Rt(){return Dt()}function Dt(t=[],e,n=!1){if(Nt)return new Promise((t,n)=>{It.push({resolve:t,reject:n,eventArguments:e})});const{appsToUnload:r,appsToUnmount:o,appsToLoad:s,appsToMount:a}=function(){const t=[],e=[],n=[],r=[],o=(new Date).getTime();return _t.forEach(i=>{const s=i.status!==O&&E(i);switch(i.status){case x:s&&o-i.loadErrorTime>=200&&n.push(i);break;case f:case p:s&&n.push(i);break;case d:case b:!s&&gt(P(i))?t.push(i):s&&r.push(i);break;case v:s||e.push(i)}}),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}();let u,c=[],h=Mt,y=Mt=window.location.href;return Ut()?(Nt=!0,u=r.concat(s,o,a),Promise.resolve().then(()=>(S(0===u.length?"before-no-app-change":"before-app-change",w(!0)),S("before-routing-event",w(!0,{cancelNavigation:m})),Promise.all(c).then(n=>{if(n.some(t=>t))return ut.call(window.history,history.state,"",h.substring(location.origin.length)),Mt=location.href,Nt=!1,Dt(t,e,!0);const i=r.map(bt),u=o.map(D).map(t=>t.then(bt)).concat(i),c=Promise.all(u);c.then(()=>{S("before-mount-routing-event",w(!0))},t=>{throw t});const l=s.map(t=>Z(t).then(t=>$t(t,c))),f=a.filter(t=>s.indexOf(t)<0).map(t=>$t(t,c));return c.catch(t=>{throw _(),t}).then(()=>(_(),Promise.all(l.concat(f)).catch(e=>{throw t.forEach(t=>t.reject(e)),e}).then(g).then(()=>{},t=>{throw t})))})))):(u=s,Promise.resolve().then(()=>{const t=s.map(Z);return Promise.all(t).then(_).then(()=>[]).catch(t=>{throw _(),t}).finally(()=>{})}));function m(t=!0){const e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);c.push(e.catch(t=>(console.warn(Error(l(42,!1))),console.warn(t),!1)))}function g(){const e=wt();t.forEach(t=>t.resolve(e));try{S(0===u.length?"no-app-change":"app-change",w()),S("routing-event",w())}catch(t){setTimeout(()=>{throw t})}if(Nt=!1,It.length>0){const t=It;It=[],Dt(t)}return e}function _(){n||(t.forEach(t=>{ot(t.eventArguments)}),ot(e))}function w(t=!1,n){const i={},c={[v]:[],[b]:[],[f]:[],[O]:[]};t?(s.concat(a).forEach((t,e)=>{p(t,v)}),r.forEach(t=>{p(t,f)}),o.forEach(t=>{p(t,b)})):u.forEach(t=>{p(t)});const l={detail:{newAppStatuses:i,appsByNewStatus:c,totalAppChanges:u.length,originalEvent:null==e?void 0:e[0],oldUrl:h,newUrl:y}};return n&&k(l.detail,n),l;function p(t,e){const n=P(t);e=e||Ot(n),i[n]=e,(c[e]=c[e]||[]).push(n)}}function S(t,e){n||window.dispatchEvent(new i(`single-spa:${t}`,e))}}function $t(t,e){return E(t)?R(t).then(t=>e.then(()=>E(t)?B(t):t)):e.then(()=>t)}let Lt=!1;function Bt(t){Lt=!0,tt&&(lt(t),Dt())}function Ut(){return Lt}var Vt={getRawAppData:function(){return[..._t]},reroute:Dt,NOT_LOADED:f,toLoadPromise:Z,toBootstrapPromise:R,unregisterApplication:jt,getProfilerData:function(){return M}};tt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Vt)},22363:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(71077),s=n(75901);e.window=function(t){return function(e){return e.lift(new a(t))}};var a=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var n=new u(t),r=e.subscribe(n);return r.closed||n.add(s.innerSubscribe(this.windowBoundaries,new s.SimpleInnerSubscriber(n))),r},t}(),u=function(t){function e(e){var n=t.call(this,e)||this;return n.window=new i.Subject,e.next(n.window),n}return o(e,t),e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,n=this.window=new i.Subject;e.next(n)},e}(s.SimpleOuterSubscriber)},23184:(t,e,n)=>{"use strict";n.d(e,{$3:()=>b,FI:()=>d,LQ:()=>y,Vt:()=>m,Yt:()=>o,bJ:()=>v,bK:()=>g,dX:()=>_,ff:()=>c,gj:()=>i,ls:()=>w,pc:()=>u,sT:()=>s});const r="openmrs:connectivity-changed";function o(t){window.dispatchEvent(new CustomEvent(r,{detail:{online:t}}))}function i(t){if(!window.offlineEnabled)return()=>{};const e=e=>t(e.detail);return window.addEventListener(r,e),()=>window.removeEventListener(r,e)}function s(t){return t({online:!window.offlineEnabled||navigator.onLine}),i(t)}const a="openmrs:precache-static-dependencies";function u(t={}){window.dispatchEvent(new CustomEvent(a,{detail:t}))}function c(t){const e=e=>t(e.detail);return window.addEventListener(a,e),()=>window.removeEventListener(a,e)}const l="openmrs:notification-shown",h="openmrs:actionable-notification-shown",f="openmrs:toast-shown",p="openmrs:snack-bar-shown";function d(t){window.dispatchEvent(new CustomEvent(l,{detail:t}))}function y(t){window.dispatchEvent(new CustomEvent(h,{detail:t}))}function b(t){window.dispatchEvent(new CustomEvent(p,{detail:t}))}function m(t){window.dispatchEvent(new CustomEvent(f,{detail:t}))}function v(t){const e=e=>t(e.detail);return window.addEventListener(l,e),()=>window.removeEventListener(l,e)}function g(t){const e=e=>t(e.detail);return window.addEventListener(h,e),()=>window.removeEventListener(h,e)}function _(t){const e=e=>t(e.detail);return window.addEventListener(f,e),()=>window.removeEventListener(f,e)}function w(t){const e=e=>t(e.detail);return window.addEventListener(p,e),()=>window.removeEventListener(p,e)}},23790:(t,e,n)=>{"use strict";n.d(e,{Zd:()=>a,jf:()=>c,CE:()=>u,i7:()=>l});var r=n(27388),o=n(43132);function i(){try{return"undefined"!=typeof process&&("true"===process.env.VITEST||void 0!==process.env.JEST_WORKER_ID)||"undefined"!=typeof globalThis&&("__vitest_worker__"in globalThis||"__jest__"in globalThis)}catch{return!1}}const s={};function a(t,e){const n=s[t];if(n)return n.active?i()||console.error(`Attempted to override the existing store ${t}. Make sure that stores are only created once.`):n.value.setState(e,!0),n.active=!0,n.value;{const n=(0,o.y)()(()=>e);return s[t]={value:n,active:!0},n}}function u(t,e){const n=s[t];return n?(n.active?i()||console.error(`Attempted to override the existing store ${t}. Make sure that stores are only created once.`):n.value=e,n.active=!0,n.value):(s[t]={value:e,active:!0},e)}function c(t,e){const n=s[t];if(!n){const n=(0,o.y)()(()=>e??{});return s[t]={value:n,active:!1},n}return n.value}function l(...t){const[e,n,o]=t,i=void 0===o?n:o,s=void 0===o?t=>t:n;let a=s(e.getState());return i(a),e.subscribe(t=>{const e=s(t);(0,r.b)(a,e)||(a=e,i(e))})}globalThis.setTimeout?.(()=>{"undefined"!=typeof window&&"development"===window.spaEnv&&(window.stores=s)},1e3)},23935:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isScheduler=function(t){return t&&"function"==typeof t.schedule}},24355:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20328),o=n(49529);e.publishReplay=function(t,e,n,i){n&&"function"!=typeof n&&(i=n);var s="function"==typeof n?n:void 0,a=new r.ReplaySubject(t,e,i);return function(t){return o.multicast(function(){return a},s)(t)}}},24654:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(4942);e.observeOn=function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.scheduler,this.delay))},t}();e.ObserveOnOperator=a;var u=function(t){function e(e,n,r){void 0===r&&(r=0);var o=t.call(this,e)||this;return o.scheduler=n,o.delay=r,o}return o(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new c(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(s.Notification.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(s.Notification.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(s.Notification.createComplete()),this.unsubscribe()},e}(i.Subscriber);e.ObserveOnSubscriber=u;var c=function(t,e){this.notification=t,this.destination=e};e.ObserveOnMessage=c},25646:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(94688),s=function(t){function e(n,r){void 0===r&&(r=i.Scheduler.now);var o=t.call(this,n,function(){return e.delegate&&e.delegate!==o?e.delegate.now():r()})||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return o(e,t),e.prototype.schedule=function(n,r,o){return void 0===r&&(r=0),e.delegate&&e.delegate!==this?e.delegate.schedule(n,r,o):t.prototype.schedule.call(this,n,r,o)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var n;this.active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(i.Scheduler);e.AsyncScheduler=s},25873:(t,e,n)=>{"use strict";var r=n(98241);e.createRoot=r.createRoot,e.hydrateRoot=r.hydrateRoot},26691:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092),o=n(85295),i=n(34914);e.defer=function(t){return new r.Observable(function(e){var n;try{n=t()}catch(t){return void e.error(t)}return(n?o.from(n):i.empty()).subscribe(e)})}},27296:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.mapTo=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.value))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return o(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(i.Subscriber)},27337:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(64103),o=n(64629);e.partition=function(t,e){return function(n){return[o.filter(t,e)(n),o.filter(r.not(t,e))(n)]}}},27354:(t,e,n)=>{"use strict";n.d(e,{K0:()=>st,dO:()=>V,Ef:()=>F,Yo:()=>at,No:()=>ut,zx:()=>ht,a9:()=>q,ES:()=>nt,Tj:()=>ot,xg:()=>rt,zF:()=>H,o1:()=>Nt,Fg:()=>_t,YX:()=>It,Ml:()=>Tt,Q_:()=>At,Xb:()=>jt,Gp:()=>yt,VK:()=>it,FY:()=>ft,Ju:()=>gt,pm:()=>St,io:()=>Et,rD:()=>Mt,Qb:()=>Rt,Uh:()=>Dt,wG:()=>Bt,cL:()=>dt,Vx:()=>bt,sr:()=>mt,ap:()=>pt,DQ:()=>z,J_:()=>Ct});var r=n(20367),o=n(95819),i=n(87440),s=n(76110),a=n(23184),u=n(52834),c=n(42853),l=n(39791),h=n(99271),f=n(26979);const p=function(t,e,n){(void 0!==n&&!(0,f.A)(t[e],n)||void 0===n&&!(e in t))&&(0,h.A)(t,e,n)},d=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),s=i.length;s--;){var a=i[++r];if(!1===e(o[a],a,o))break}return t};var y=n(521),b=n(65246),m=n(80084),v=n(33339),g=n(61697),_=n(96956),w=n(31475),x=n(47313);var O=n(15821),S=n(50405),E=n(97942),P=n(78938),j=n(17283);const A=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]};var k=n(28078),C=n(15150);const T=function(t,e,n,r,o,i,s){var a,u=A(t,n),c=A(e,n),l=s.get(c);if(l)p(t,n,l);else{var h=i?i(u,c,n+"",t,e,s):void 0,f=void 0===h;if(f){var d=(0,_.A)(c),T=!d&&(0,O.A)(c),N=!d&&!T&&(0,j.A)(c);h=c,d||T||N?(0,_.A)(u)?h=u:(a=u,(0,x.A)(a)&&(0,w.A)(a)?h=(0,m.A)(u):T?(f=!1,h=(0,y.A)(c,!0)):N?(f=!1,h=(0,b.A)(c,!0)):h=[]):(0,P.A)(c)||(0,g.A)(c)?(h=u,(0,g.A)(u)?h=function(t){return(0,k.A)(t,(0,C.A)(t))}(u):(0,E.A)(u)&&!(0,S.A)(u)||(h=(0,v.A)(c))):f=!1}f&&(s.set(c,h),o(h,c,r,i,s),s.delete(c)),p(t,n,h)}},N=function t(e,n,r,o,i){e!==n&&d(n,function(s,a){if(i||(i=new l.A),(0,E.A)(s))T(e,n,a,r,t,o,i);else{var u=o?o(A(e,a),s,a+"",e,n,i):void 0;void 0===u&&(u=s),p(e,a,u)}},C.A)};var I=n(14151),M=n(63220),R=n(20206);var D=n(85378);const $=(L=function(t,e,n){N(t,e,n)},B=function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=L.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!(0,E.A)(n))return!1;var r=typeof e;return!!("number"==r?(0,w.A)(n)&&(0,D.A)(e,n.length):"string"==r&&e in n)&&(0,f.A)(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var s=e[n];s&&L(t,s,n)}return t},(0,R.A)((0,M.A)(B,U,I.A),B+""));var L,B,U;function V(t=!0,e=!1){return F((0,u.s)(),t,e)}function F(t,e=!0,n=!1){return Boolean(t?e:n)}var K=n(23790);const W=(0,K.Zd)("extensionsInternal",{slots:{},extensions:{}}),q=()=>(0,K.jf)("extensionsInternal",{slots:{},extensions:{}});function z(t){const e=W.getState(),n=t(e);n!==e&&W.setState(n)}const H=()=>(0,K.jf)("extensions",{slots:{}});function G(t){const e=[];for(let n of Object.values(t.extensions))for(let t of n.instances)e.push({slotModuleName:t.slotModuleName,extensionModuleName:n.moduleName,slotName:t.slotName,extensionId:t.id});(0,c.A)(o.hs.getState().mountedExtensions,e)||o.hs.setState({mountedExtensions:e})}G(W.getState()),W.subscribe(G);const Y=q(),J=H(),Q=(0,o.YP)(),X=(0,o.GI)();function Z(t,e,n,r,i){const s={},a=(0,u.s)(),l=Object.entries(r.flags).filter(([,{enabled:t}])=>t).map(([t])=>t);for(let[r,u]of Object.entries(t.slots)){const{config:c}=(0,o.vu)(e,u.name),h=lt(r,t,c,n,l,a,i.session);s[r]={moduleName:u.moduleName,assignedExtensions:h}}(0,c.A)(J.getState().slots,s)||J.setState({slots:s})}function tt(){Z(Y.getState(),Q.getState(),X.getState(),s.jX.getState(),r.eA.getState())}function et(t,e,n){return{moduleName:e,name:t,attachedIds:[],config:null,state:n}}function nt(t){const[e]=t.split("#");return e}function rt(t,e){const n=nt(e);return t.extensions[n]}function ot(t){return rt(Y.getState(),t)}Y.subscribe(t=>{Z(t,Q.getState(),X.getState(),s.jX.getState(),r.eA.getState())}),Q.subscribe(t=>{Z(Y.getState(),t,X.getState(),s.jX.getState(),r.eA.getState())}),X.subscribe(t=>{Z(Y.getState(),Q.getState(),t,s.jX.getState(),r.eA.getState())}),s.jX.subscribe(t=>{Z(Y.getState(),Q.getState(),X.getState(),t,r.eA.getState())}),r.eA.subscribe(t=>{Z(Y.getState(),Q.getState(),X.getState(),s.jX.getState(),t)}),tt(),(0,a.gj)(tt);const it=t=>Y.setState(e=>(e.extensions[t.name]={...t,instances:[]},e));function st(t,e){z(n=>{const r=n.slots[t];return r?{...n,slots:{...n.slots,[t]:{...r,attachedIds:[...r.attachedIds,e]}}}:{...n,slots:{...n.slots,[t]:{...et(t),attachedIds:[e]}}}})}function at(t,e){z(n=>{const r=n.slots[t];return r&&r.attachedIds.includes(e)?{...n,slots:{...n.slots,[t]:{...r,attachedIds:r.attachedIds.filter(t=>t!==e)}}}:n})}function ut(t){z(e=>{const n=e.slots[t];return n?{...e,slots:{...e.slots,[t]:{...n,attachedIds:[]}}}:e})}function ct(t,e,n,r){const o=e.indexOf(t);if(-1!==o)return o;if(void 0!==n)return 1e3+n;{const e=r.indexOf(t);return-1!==e?2e3+e:-1}}function lt(t,e,n,s,a,u,c){const l=function(t,e){const n=t.add||[],r=t.remove||[],o=t.order||[],{extensions:i}=Y.getState();return[...e,...n].filter(t=>!r.includes(t)).sort((t,n)=>{const r=ct(t,o,i[nt(t)]?.order,e),s=ct(n,o,i[nt(n)]?.order,e);return-1===s?-1:-1===r?1:r-s})}(n,e.slots[t].attachedIds),h=[],f=e.slots[t]?.state,p=f&&"object"==typeof f?{session:c,...f}:{session:c};for(let f of l){const{config:l}=(0,o.P0)(s,t,f),d=(0,o.g$)(n,t,f),y=$(l,d),b=nt(f),m=e.extensions[b];if(m){const e=y?.["Display conditions"]?.privileges??m.privileges??[];if(e&&("string"==typeof e||Array.isArray(e)&&e.length>0)){if(!c?.user)continue;if(!(0,r.st)(e,c.user))continue}const n=y?.["Display conditions"]?.expression||m.displayExpression;if(void 0!==n&&"string"==typeof n&&n.trim().length>0)try{if(!(0,i.eb)(n,p))continue}catch(e){console.error(`Error while evaluating expression '${n}' for extension ${b} in slot ${t}`,e);continue}if(m.featureFlag&&!a.includes(m.featureFlag))continue;if(window.offlineEnabled&&!F(u,m.online,m.offline))continue;h.push({id:f,name:b,moduleName:m.moduleName,config:y,featureFlag:m.featureFlag,meta:m.meta,online:y?.["Display conditions"]?.online??m.online??!0,offline:y?.["Display conditions"]?.offline??m.offline??!1})}}return h}function ht(t){const e=Y.getState(),{config:n}=(0,o.G9)(t),i=X.getState(),a=s.jX.getState(),c=r.eA.getState(),l=(0,u.s)();return lt(t,e,n,i,Object.entries(a.flags).filter(([,{enabled:t}])=>t).map(([t])=>t),l,c.session)}const ft=(t,e,n)=>Y.setState(r=>{const o=r.slots[e]?.moduleName;if(o&&o!=t)return console.warn(`An extension slot with the name '${e}' already exists. Refusing to register the same slot name twice (in "registerExtensionSlot"). The existing one is from module ${o}.`),r;if(o&&o==t)return r;if(r.slots[e])return{...r,slots:{...r.slots,[e]:{...r.slots[e],moduleName:t,state:n}}};const i=et(e,t,n);return{...r,slots:{...r.slots,[e]:{...i}}}});function pt(t,e,n=!1){Y.setState(r=>{const o=n?$(r.slots[t].state,e):e;return{...r,slots:{...r.slots,[t]:{...r.slots[t],state:o}}}})}const dt=()=>J.setState(()=>({slots:{},extensions:{}})),yt=(0,K.Zd)("left-nav",{slotName:null,basePath:window.spaBase,mode:"normal"});function bt({name:t,basePath:e,mode:n,componentContext:r,state:o}){yt.setState({slotName:t,basePath:e,mode:n??"normal",componentContext:r,state:o})}function mt(t){yt.getState().slotName===t&&yt.setState(yt.getInitialState(),!0)}const vt=(0,K.Zd)("modalRegistry",{modals:{}});function gt(t){vt.setState(e=>(e.modals[t.name]=t,e))}function _t(t){let e=vt.getState().modals[t];if(!e){const n=ot(t);n&&(e={name:t,load:n.load,moduleName:n.moduleName},console.warn(`Modal ${t} 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.`),gt(e))}return e}var wt=n(50103);const xt=(0,K.Zd)("workspaceRegistrations",{workspaces:{}}),Ot=(0,K.Zd)("workspaceGroups",{workspaceGroups:{}});function St(t){xt.setState(e=>({workspaces:{...e.workspaces,[t.name]:{...t,load:t.load,preferredWindowSize:t.preferredWindowSize??"normal",type:t.type??"form",canHide:t.canHide??!1,canMaximize:t.canMaximize??!1,width:t.width??"narrow",groups:t.groups??[]}}}))}function Et(t){Ot.setState(e=>{const n=e.workspaceGroups[t.name];return n?{workspaceGroups:{...e.workspaceGroups,[t.name]:{...n,members:Array.from(new Set([...n.members,...t.members]))}}}:{workspaceGroups:{...e.workspaceGroups,[t.name]:{name:t.name,members:t.members}}}})}const Pt=new Set;function jt(t){const e=xt.getState().workspaces;if(e[t])return e[t];{const e=ot(t);if(e)return Pt.has(t)||(console.warn(`The workspace '${t}' is registered as an extension. This is deprecated. Please register it in the "workspaces" section of the routes.json file.`),Pt.add(t)),{name:e.name,title:kt(e),moduleName:e.moduleName,preferredWindowSize:e.meta?.screenSize??"normal",load:e.load,type:e.meta?.type??"form",canHide:e.meta?.canHide??!1,canMaximize:e.meta?.canMaximize??!1,width:e.meta?.width??"narrow",groups:e.meta?.groups??[]};throw new Error(`No workspace named '${t}' has been registered.`)}}function At(t){const e=Ot.getState().workspaceGroups;if(e[t])return e[t];throw new Error(`No workspace group named '${t}' has been registered.`)}function kt(t){const e=t?.meta?.title;return"string"==typeof e?e:e&&"object"==typeof e?(0,wt.t)(t.moduleName,e.key,e.default):t.name}const Ct=(0,K.Zd)("workspace2",{registeredGroupsByName:{},registeredWindowsByName:{},registeredWorkspacesByName:{},openedGroup:null,openedWindows:[],workspaceTitleByWorkspaceName:{}});function Tt(t){const{registeredWorkspacesByName:e,registeredWindowsByName:n}=Ct.getState(),r=e[t];if(r){const e=n[r.window];if(e)return e;throw new Error(`No workspace window found with name: ${r.window} for workspace: ${t}`)}throw new Error(`No workspace found with name: ${t}`)}function Nt(t){const{registeredGroupsByName:e,registeredWindowsByName:n}=Ct.getState(),r=n[t];if(r){const n=e[r.group];if(n)return n;throw new Error(`No workspace group found with name: ${r.group} for window: ${t}`)}throw new Error(`No workspace window found with name: ${t}`)}function It(t){const{openedWindows:e}=Ct.getState();return e.findIndex(e=>e.openedWorkspaces.find(e=>e.workspaceName===t))}function Mt(t){if(0==t.length)return;const{registeredGroupsByName:e}=Ct.getState(),n={...e};for(const e of t){if(n[e.name])throw new Error(`Cannot register workspace group ${e.name} more than once`);n[e.name]=e}Ct.setState({registeredGroupsByName:n})}function Rt(t,e){if(0==e.length)return;const{registeredWindowsByName:n}=Ct.getState(),r={...n};for(const n of e){if(r[n.name])throw new Error(`Cannot register workspace window ${n.name} more than once`);const e={...n,moduleName:t};r[n.name]=e}Ct.setState({registeredWindowsByName:r})}function Dt(t,e){if(0==e.length)return;const{registeredWorkspacesByName:n}=Ct.getState(),r={...n};for(const n of e){if(r[n.name])throw new Error(`Cannot register workspace ${n.name} more than once`);const e={...n,moduleName:t};r[n.name]=e}Ct.setState({registeredWorkspacesByName:r})}var $t=n(22244);let Lt=0;async function Bt(t,e,n,r,o=t=>t,i={}){const s=nt(r),a=ot(r);let u=null;if(t){if(!a)throw Error(`Couldn't find extension '${s}' to attach to '${e}'`);const{meta:c,moduleName:l,online:h,offline:f,load:p}=a;if(V(h,f)){z(o=>{const i={domElement:t,id:r,slotName:e,slotModuleName:n};return{...o,extensions:{...o.extensions,[s]:{...o.extensions[s],instances:[...o.extensions[s].instances,i]}}}});const a=await p(),h=Lt++;u=(0,$t.xL)(o({...a,name:`${e}/${s}-${h}`}),{...i,_meta:c,_extensionContext:{extensionId:r,extensionSlotName:e,extensionSlotModuleName:n,extensionModuleName:l},domElement:t})}}else console.warn(`Tried to render ${r} into ${e} but no DOM element was available.`);return u}},27388:(t,e,n)=>{"use strict";function r(t,e){if(t===e||Object.is(t,e))return!0;if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}if(Array.isArray(e))return!1;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const n=Object.getOwnPropertyNames(t),r=Object.getOwnPropertyNames(e);return n.length===r.length&&n.every(n=>t[n]===e[n])}n.d(e,{b:()=>r})},27432:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i,s=n(71077),a=n(95092),u=n(77759),c=n(21016),l=n(85203),h=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return o(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new c.Subscription).add(this.source.subscribe(new f(this.getSubject(),this))),t.closed&&(this._connection=null,t=c.Subscription.EMPTY)),t},e.prototype.refCount=function(){return l.refCount()(this)},e}(a.Observable);e.ConnectableObservable=h,e.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:(i=h.prototype)._subscribe},_isComplete:{value:i._isComplete,writable:!0},getSubject:{value:i.getSubject},connect:{value:i.connect},refCount:{value:i.refCount}};var f=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return o(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(s.SubjectSubscriber);!function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}o(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null}}(u.Subscriber)},27539:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(71077),s=n(89152),a=n(87778);e.windowWhen=function(t){return function(e){return e.lift(new u(t))}};var u=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.closingSelector))},t}(),c=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.closingSelector=n,r.openWindow(),r}return o(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.openWindow(o)},e.prototype.notifyError=function(t){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var n,r=this.window=new i.Subject;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=a.subscribeToResult(this,n))},e}(s.OuterSubscriber)},27677:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.sample=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new a(t),r=e.subscribe(n);return r.add(i.innerSubscribe(this.notifier,new i.SimpleInnerSubscriber(n))),r},t}(),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return o(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(i.SimpleOuterSubscriber)},27928:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(78522);function o(t){return 0===t.length?r.identity:1===t.length?t[0]:function(e){return t.reduce(function(t,e){return e(t)},e)}}e.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o(t)},e.pipeFromArray=o},27954:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092),o=n(86735),i=n(19673),s=n(23935);function a(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}e.timer=function(t,e,n){void 0===t&&(t=0);var u=-1;return i.isNumeric(e)?u=Number(e)<1?1:Number(e):s.isScheduler(e)&&(n=e),s.isScheduler(n)||(n=o.async),new r.Observable(function(e){var r=i.isNumeric(t)?t:+t-n.now();return n.schedule(a,r,{index:0,period:u,subscriber:e})})}},28078:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(76124),o=n(99271);const i=function(t,e,n,i){var s=!n;n||(n={});for(var a=-1,u=e.length;++a<u;){var c=e[a],l=i?i(n[c],t[c],c,n,t):void 0;void 0===l&&(l=t[c]),s?(0,o.A)(n,c,l):(0,r.A)(n,c,l)}return n}},29075:(t,e,n)=>{"use strict";n.d(e,{y:()=>a});var r=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function o(t){return null!==t&&"object"==typeof t}var i=n(18364),s=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),a=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}var e;return t.prototype.unsubscribe=function(){var e;if(!this.closed){var n=this,a=n._parentOrParents,c=n._ctorUnsubscribe,l=n._unsubscribe,h=n._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,a instanceof t)a.remove(this);else if(null!==a)for(var f=0;f<a.length;++f)a[f].remove(this);if((0,i.T)(l)){c&&(this._unsubscribe=void 0);try{l.call(this)}catch(t){e=t instanceof s?u(t.errors):[t]}}if(r(h)){f=-1;for(var p=h.length;++f<p;){var d=h[f];if(o(d))try{d.unsubscribe()}catch(t){e=e||[],t instanceof s?e=e.concat(u(t.errors)):e.push(t)}}}if(e)throw new s(e)}},t.prototype.add=function(e){var n=e;if(!e)return t.EMPTY;switch(typeof e){case"function":n=new t(e);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if(!(n instanceof t)){var r=n;(n=new t)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=n._parentOrParents;if(null===o)n._parentOrParents=this;else if(o instanceof t){if(o===this)return n;n._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return n;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[n]:i.push(n),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function u(t){return t.reduce(function(t,e){return t.concat(e instanceof s?e.errors:e)},[])}},29219:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(89233),s=n(85295),a=n(75901);e.exhaustMap=function t(e,n){return n?function(r){return r.pipe(t(function(t,r){return s.from(e(t,r)).pipe(i.map(function(e,o){return n(t,e,r,o)}))}))}:function(t){return t.lift(new u(e))}};var u=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.project))},t}(),c=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return o(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new a.SimpleInnerSubscriber(this),n=this.destination;n.add(e);var r=a.innerSubscribe(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(a.SimpleOuterSubscriber)},30068:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(34914);e.repeat=function(t){return void 0===t&&(t=-1),function(e){return 0===t?s.empty():t<0?e.lift(new a(-1,e)):e.lift(new a(t-1,e))}};var a=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.count,this.source))},t}(),u=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.count=n,o.source=r,o}return o(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(i.Subscriber)},30162:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17563);e.subscribeOn=function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new o(t,e))}};var o=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new r.SubscribeOnObservable(e,this.delay,this.scheduler).subscribe(t)},t}()},31027:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}();e.TimeoutError=n},31444:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(2519);e.skipLast=function(t){return function(e){return e.lift(new a(t))}};var a=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new i.Subscriber(t)):e.subscribe(new u(t,this._skipCount))},t}(),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return o(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n<e)this._ring[n]=t;else{var r=n%e,o=this._ring,i=o[r];o[r]=t,this.destination.next(i)}},e}(i.Subscriber)},32216:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(71077);e.windowCount=function(t,e){return void 0===e&&(e=0),function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.windowSize,this.startWindowEvery))},t}(),u=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.destination=e,o.windowSize=n,o.startWindowEvery=r,o.windows=[new s.Subject],o.count=0,e.next(o.windows[0]),o}return o(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,o=this.windows,i=o.length,a=0;a<i&&!this.closed;a++)o[a].next(t);var u=this.count-r+1;if(u>=0&&u%e===0&&!this.closed&&o.shift().complete(),++this.count%e===0&&!this.closed){var c=new s.Subject;o.push(c),n.next(c)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(i.Subscriber)},32376:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.find=function(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new s(t,n,!1,e))}};var s=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}();e.FindValueOperator=s;var a=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.predicate=n,s.source=r,s.yieldIndex=o,s.thisArg=i,s.index=0,s}return o(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(i.Subscriber);e.FindValueSubscriber=a},32505:(t,e,n)=>{"use strict";n.d(e,{C6:()=>o});var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}},32742:t=>{"use strict";function e(){var t=1732584193,e=4023233417,n=2562383102,r=271733878,o=3285377520,i=new Uint32Array(80),s=0,a=24,u=0;function c(){for(var a=16;a<80;a++){var u=i[a-3]^i[a-8]^i[a-14]^i[a-16];i[a]=u<<1|u>>>31}var c,l,h=t,f=e,p=n,d=r,y=o;for(a=0;a<80;a++){a<20?(c=d^f&(p^d),l=1518500249):a<40?(c=f^p^d,l=1859775393):a<60?(c=f&p|d&(f|p),l=2400959708):(c=f^p^d,l=3395469782);var b=(h<<5|h>>>27)+c+y+l+(0|i[a]);y=d,d=p,p=f<<30|f>>>2,f=h,h=b}for(t=t+h|0,e=e+f|0,n=n+p|0,r=r+d|0,o=o+y|0,s=0,a=0;a<16;a++)i[a]=0}function l(t){i[s]|=(255&t)<<a,a?a-=8:(s++,a=24),16===s&&c()}function h(t){for(var e="",n=28;n>=0;n-=4)e+=(t>>n&15).toString(16);return e}return{update:function(t){if("string"==typeof t)return function(t){var e=t.length;u+=8*e;for(var n=0;n<e;n++)l(t.charCodeAt(n))}(t);var e=t.length;u+=8*e;for(var n=0;n<e;n++)l(t[n])},digest:function(){l(128),(s>14||14===s&&a<24)&&c(),s=14,a=24,l(0),l(0),l(u>0xffffffffff?u/1099511627776:0),l(u>4294967295?u/4294967296:0);for(var i=24;i>=0;i-=8)l(u>>i);return h(t)+h(e)+h(n)+h(r)+h(o)}}}t.exports=function(t){if(void 0===t)return e();var n=e();return n.update(t),n.digest()}},33339:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(97942),o=Object.create;const i=function(){function t(){}return function(e){if(!(0,r.A)(e))return{};if(o)return o(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();var s=n(34878),a=n(71140);const u=function(t){return"function"!=typeof t.constructor||(0,a.A)(t)?{}:i((0,s.A)(t))}},33395:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092),o=n(23935),i=n(80980),s=n(67446);e.merge=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,a=null,u=t[t.length-1];return o.isScheduler(u)?(a=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof u&&(n=t.pop()),null===a&&1===t.length&&t[0]instanceof r.Observable?t[0]:i.mergeAll(n)(s.fromArray(t,a))}},34178:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092),o=n(21016),i=n(78258);e.scheduleIterable=function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.Observable(function(n){var r,s=new o.Subscription;return s.add(function(){r&&"function"==typeof r.return&&r.return()}),s.add(e.schedule(function(){r=t[i.iterator](),s.add(e.schedule(function(){if(!n.closed){var t,e;try{var o=r.next();t=o.value,e=o.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}}))})),s})}},34878:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});const r=(0,n(67244).A)(Object.getPrototypeOf,Object)},34914:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092);e.EMPTY=new r.Observable(function(t){return t.complete()}),e.empty=function(t){return t?function(t){return new r.Observable(function(e){return t.schedule(function(){return e.complete()})})}(t):e.EMPTY}},35428:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20917);e.switchMapTo=function(t,e){return e?r.switchMap(function(){return t},e):r.switchMap(function(){return t})}},35570:(t,e,n)=>{!function(e){"use strict";var r=n(19109);function o(t){return function(e,n){return"object"==typeof e&&(n=e,e=null),null==e&&(e=(new Date).toString()),n||(n={}),t.call(this,e,n)}}var i=t.exports={generate:o(function(t,e){return new r(t,e)})};e&&(e.fn.geopattern=o(function(t,n){return this.each(function(){var r=e(this).attr("data-title-sha");r&&(n=e.extend({hash:r},n));var o=i.generate(t,n);e(this).css("background-image",o.toDataUrl())})}))}("undefined"!=typeof jQuery?jQuery:null)},35816:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(86735),s=n(66740),a=n(75901);e.timeoutWith=function(t,e,n){return void 0===n&&(n=i.async),function(r){var o=s.isDate(t),i=o?+t-n.now():Math.abs(t);return r.lift(new u(i,o,e,n))}};var u=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),c=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.absoluteTimeout=n,s.waitFor=r,s.withObservable=o,s.scheduler=i,s.scheduleTimeout(),s}return o(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(a.innerSubscribe(e,new a.SimpleInnerSubscriber(t)))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(a.SimpleOuterSubscriber)},36217:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(21016),a=n(95092),u=n(71077);e.groupBy=function(t,e,n,r){return function(o){return o.lift(new c(t,e,n,r))}};var c=function(){function t(t,e,n,r){this.keySelector=t,this.elementSelector=e,this.durationSelector=n,this.subjectSelector=r}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),l=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;return s.keySelector=n,s.elementSelector=r,s.durationSelector=o,s.subjectSelector=i,s.groups=null,s.attemptedToUnsubscribe=!1,s.count=0,s}return o(e,t),e.prototype._next=function(t){var e;try{e=this.keySelector(t)}catch(t){return void this.error(t)}this._group(t,e)},e.prototype._group=function(t,e){var n=this.groups;n||(n=this.groups=new Map);var r,o=n.get(e);if(this.elementSelector)try{r=this.elementSelector(t)}catch(t){this.error(t)}else r=t;if(!o){o=this.subjectSelector?this.subjectSelector():new u.Subject,n.set(e,o);var i=new f(e,o,this);if(this.destination.next(i),this.durationSelector){var s=void 0;try{s=this.durationSelector(new f(e,o))}catch(t){return void this.error(t)}this.add(s.subscribe(new h(e,o,this)))}}o.closed||o.next(r)},e.prototype._error=function(t){var e=this.groups;e&&(e.forEach(function(e,n){e.error(t)}),e.clear()),this.destination.error(t)},e.prototype._complete=function(){var t=this.groups;t&&(t.forEach(function(t,e){t.complete()}),t.clear()),this.destination.complete()},e.prototype.removeGroup=function(t){this.groups.delete(t)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&t.prototype.unsubscribe.call(this))},e}(i.Subscriber),h=function(t){function e(e,n,r){var o=t.call(this,n)||this;return o.key=e,o.group=n,o.parent=r,o}return o(e,t),e.prototype._next=function(t){this.complete()},e.prototype._unsubscribe=function(){var t=this.parent,e=this.key;this.key=this.parent=null,t&&t.removeGroup(e)},e}(i.Subscriber),f=function(t){function e(e,n,r){var o=t.call(this)||this;return o.key=e,o.groupSubject=n,o.refCountSubscription=r,o}return o(e,t),e.prototype._subscribe=function(t){var e=new s.Subscription,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&e.add(new p(n)),e.add(r.subscribe(t)),e},e}(a.Observable);e.GroupedObservable=f;var p=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,e.count++,n}return o(e,t),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(t.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(s.Subscription)},38513:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(71077),s=n(21016),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return o(e,t),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),s.Subscription.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),s.Subscription.EMPTY):t.prototype._subscribe.call(this,e)},e.prototype.next=function(t){this.hasCompleted||(this.value=t,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||t.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(i.Subject);e.AsyncSubject=a},39644:(t,e,n)=>{"use strict";n.d(e,{nr:()=>P,FO:()=>Hr,xN:()=>zr,lY:()=>Gr,sA:()=>ro,wJ:()=>S,FE:()=>uo,WA:()=>co,qb:()=>so,C$:()=>Wr,xc:()=>Fr,e:()=>Tr,WK:()=>go,LM:()=>Rr,Rs:()=>b,Gp:()=>qr,pb:()=>Kr,Io:()=>Vr,bO:()=>oo,ms:()=>w,jU:()=>no,JC:()=>g,UH:()=>m,Gj:()=>v,yD:()=>lo,ff:()=>ho,Zr:()=>Ur,Iq:()=>Br,KG:()=>_o,sZ:()=>y,NU:()=>fo,wn:()=>po,AO:()=>Dr,Og:()=>E,iD:()=>ao,cy:()=>Yr,Td:()=>yo,u1:()=>bo,sK:()=>wo});try{self["workbox:window:6.5.4"]&&_()}catch(r){}function r(t,e){return new Promise(function(n){var r=new MessageChannel;r.port1.onmessage=function(t){n(t.data)},t.postMessage(e,[r.port2])})}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[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=t[Symbol.iterator]()).next.bind(n)}try{self["workbox:core:6.5.4"]&&_()}catch(r){}var s=function(){var t=this;this.promise=new Promise(function(e,n){t.resolve=e,t.reject=n})};function a(t,e){var n=location.href;return new URL(t,n).href===new URL(e,n).href}var u=function(t,e){this.type=t,Object.assign(this,e)};function c(t,e,n){return n?e?e(t):t:(t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t)}function l(){}var h={type:"SKIP_WAITING"};function f(t,e){if(!e)return t&&t.then?t.then(l):Promise.resolve()}var p=function(t){var e,n;function o(e,n){var r,o;return void 0===n&&(n={}),(r=t.call(this)||this).nn={},r.tn=0,r.rn=new s,r.en=new s,r.on=new s,r.un=0,r.an=new Set,r.cn=function(){var t=r.fn,e=t.installing;r.tn>0||!a(e.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=e,t.removeEventListener("updatefound",r.cn)):(r.hn=e,r.an.add(e),r.rn.resolve(e)),++r.tn,e.addEventListener("statechange",r.ln)},r.ln=function(t){var e=r.fn,n=t.target,o=n.state,i=n===r.vn,s={sw:n,isExternal:i,originalEvent:t};!i&&r.mn&&(s.isUpdate=!0),r.dispatchEvent(new u(o,s)),"installed"===o?r.wn=self.setTimeout(function(){"installed"===o&&e.waiting===n&&r.dispatchEvent(new u("waiting",s))},200):"activating"===o&&(clearTimeout(r.wn),i||r.en.resolve(n))},r.dn=function(t){var e=r.hn,n=e!==navigator.serviceWorker.controller;r.dispatchEvent(new u("controlling",{isExternal:n,originalEvent:t,sw:e,isUpdate:r.mn})),n||r.on.resolve(e)},r.gn=(o=function(t){var e=t.data,n=t.ports,o=t.source;return c(r.getSW(),function(){r.an.has(o)&&r.dispatchEvent(new u("message",{data:e,originalEvent:t,ports:n,sw:o}))})},function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];try{return Promise.resolve(o.apply(this,t))}catch(t){return Promise.reject(t)}}),r.sn=e,r.nn=n,navigator.serviceWorker.addEventListener("message",r.gn),r}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i,l=o.prototype;return l.register=function(t){var e=(void 0===t?{}:t).immediate,n=void 0!==e&&e;try{var r=this;return function(t,e){var n=t();return n&&n.then?n.then(e):e()}(function(){if(!n&&"complete"!==document.readyState)return f(new Promise(function(t){return window.addEventListener("load",t)}))},function(){return r.mn=Boolean(navigator.serviceWorker.controller),r.yn=r.pn(),c(r.bn(),function(t){r.fn=t,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 e=r.fn.waiting;return e&&a(e.scriptURL,r.sn.toString())&&(r.hn=e,Promise.resolve().then(function(){r.dispatchEvent(new u("waiting",{sw:e,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(t){return Promise.reject(t)}},l.update=function(){try{return this.fn?f(this.fn.update()):void 0}catch(t){return Promise.reject(t)}},l.getSW=function(){return void 0!==this.hn?Promise.resolve(this.hn):this.rn.promise},l.messageSW=function(t){try{return c(this.getSW(),function(e){return r(e,t)})}catch(t){return Promise.reject(t)}},l.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&r(this.fn.waiting,h)},l.pn=function(){var t=navigator.serviceWorker.controller;return t&&a(t.scriptURL,this.sn.toString())?t:void 0},l.bn=function(){try{var t=this;return function(t,e){try{var n=t()}catch(t){return e(t)}return n&&n.then?n.then(void 0,e):n}(function(){return c(navigator.serviceWorker.register(t.sn,t.nn),function(e){return t.un=performance.now(),e})},function(t){throw t})}catch(t){return Promise.reject(t)}},(i=[{key:"active",get:function(){return this.en.promise}},{key:"controlling",get:function(){return this.on.promise}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(o.prototype,i),o}(function(){function t(){this.Pn=new Map}var e=t.prototype;return e.addEventListener=function(t,e){this.Sn(t).add(e)},e.removeEventListener=function(t,e){this.Sn(t).delete(e)},e.dispatchEvent=function(t){t.target=this;for(var e,n=i(this.Sn(t.type));!(e=n()).done;)(0,e.value)(t)},e.Sn=function(t){return this.Pn.has(t)||this.Pn.set(t,new Set),this.Pn.get(t)},t}());let d;function y(t,e){if(void 0!==d)return console.warn(`The application's Service Worker has already been registered. The new service worker at ${t} will not be registered.`),d;if(!("serviceWorker"in navigator))throw new Error("Registering the Service Worker is not possible due to missing browser capabilities.");const n=new p(t,e);return d=n.register().then(()=>n.controlling.then(()=>n)),d}function b(){return d??Promise.resolve(void 0)}const m="x-omrs-offline-response-body",v="x-omrs-offline-response-status",g="x-omrs-offline-caching-strategy";async function w(t){const e=await b();return e?await e.messageSW(t):{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."}}const x="openmrs3:offline-mode";let O="unavailable";function S(){return{current:O,notAvailable:"unavailable"===O,active:"on"===O}}function E(t){"unavailable"!==O&&"unavailable"!==t&&(localStorage.setItem(x,"on"===t?"active":"disabled"),O=t)}async function P(){await async function(){return await async function(){return new Promise(t=>{const e=indexedDB.open("test");e.onerror=()=>t(!0),e.onsuccess=()=>t(!1)})}()||await async function(){return!window.indexedDB}()||await async function(){const t=window.sessionStorage;try{t.setItem("someKeyHere","test"),t.removeItem("someKeyHere")}catch(e){if(e.code===DOMException.QUOTA_EXCEEDED_ERR&&0===t.length)return!0}return!1}()}()||(O="active"===localStorage.getItem(x)?"on":"off"),navigator.onLine}const j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,A=Object.keys,k=Array.isArray;function C(t,e){return"object"!=typeof e||A(e).forEach(function(n){t[n]=e[n]}),t}"undefined"==typeof Promise||j.Promise||(j.Promise=Promise);const T=Object.getPrototypeOf,N={}.hasOwnProperty;function I(t,e){return N.call(t,e)}function M(t,e){"function"==typeof e&&(e=e(T(t))),("undefined"==typeof Reflect?A:Reflect.ownKeys)(e).forEach(n=>{D(t,n,e[n])})}const R=Object.defineProperty;function D(t,e,n,r){R(t,e,C(n&&I(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function $(t){return{from:function(e){return t.prototype=Object.create(e.prototype),D(t.prototype,"constructor",t),{extend:M.bind(null,t.prototype)}}}}const L=Object.getOwnPropertyDescriptor;function B(t,e){let n;return L(t,e)||(n=T(t))&&B(n,e)}const U=[].slice;function V(t,e,n){return U.call(t,e,n)}function F(t,e){return e(t)}function K(t){if(!t)throw new Error("Assertion Failed")}function W(t){j.setImmediate?setImmediate(t):setTimeout(t,0)}function q(t,e){return t.reduce((t,n,r)=>{var o=e(n,r);return o&&(t[o[0]]=o[1]),t},{})}function z(t,e){if("string"==typeof e&&I(t,e))return t[e];if(!e)return t;if("string"!=typeof e){for(var n=[],r=0,o=e.length;r<o;++r){var i=z(t,e[r]);n.push(i)}return n}var s=e.indexOf(".");if(-1!==s){var a=t[e.substr(0,s)];return null==a?void 0:z(a,e.substr(s+1))}}function H(t,e,n){if(t&&void 0!==e&&(!("isFrozen"in Object)||!Object.isFrozen(t)))if("string"!=typeof e&&"length"in e){K("string"!=typeof n&&"length"in n);for(var r=0,o=e.length;r<o;++r)H(t,e[r],n[r])}else{var i=e.indexOf(".");if(-1!==i){var s=e.substr(0,i),a=e.substr(i+1);if(""===a)void 0===n?k(t)&&!isNaN(parseInt(s))?t.splice(s,1):delete t[s]:t[s]=n;else{var u=t[s];u&&I(t,s)||(u=t[s]={}),H(u,a,n)}}else void 0===n?k(t)&&!isNaN(parseInt(e))?t.splice(e,1):delete t[e]:t[e]=n}}function G(t){var e={};for(var n in t)I(t,n)&&(e[n]=t[n]);return e}const Y=[].concat;function J(t){return Y.apply([],t)}const Q="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(J([8,16,32,64].map(t=>["Int","Uint","Float"].map(e=>e+t+"Array")))).filter(t=>j[t]),X=Q.map(t=>j[t]);q(Q,t=>[t,!0]);let Z=null;function tt(t){Z="undefined"!=typeof WeakMap&&new WeakMap;const e=et(t);return Z=null,e}function et(t){if(!t||"object"!=typeof t)return t;let e=Z&&Z.get(t);if(e)return e;if(k(t)){e=[],Z&&Z.set(t,e);for(var n=0,r=t.length;n<r;++n)e.push(et(t[n]))}else if(X.indexOf(t.constructor)>=0)e=t;else{const n=T(t);for(var o in e=n===Object.prototype?{}:Object.create(n),Z&&Z.set(t,e),t)I(t,o)&&(e[o]=et(t[o]))}return e}const{toString:nt}={};function rt(t){return nt.call(t).slice(8,-1)}const ot="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",it="symbol"==typeof ot?function(t){var e;return null!=t&&(e=t[ot])&&e.apply(t)}:function(){return null},st={};function at(t){var e,n,r,o;if(1===arguments.length){if(k(t))return t.slice();if(this===st&&"string"==typeof t)return[t];if(o=it(t)){for(n=[];!(r=o.next()).done;)n.push(r.value);return n}if(null==t)return[t];if("number"==typeof(e=t.length)){for(n=new Array(e);e--;)n[e]=t[e];return n}return[t]}for(e=arguments.length,n=new Array(e);e--;)n[e]=arguments[e];return n}const ut="undefined"!=typeof Symbol?t=>"AsyncFunction"===t[Symbol.toStringTag]:()=>!1;var ct="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function lt(t,e){ct=t,ht=e}var ht=()=>!0;const ft=!new Error("").stack;function pt(){if(ft)try{throw pt.arguments,new Error}catch(t){return t}return new Error}function dt(t,e){var n=t.stack;return n?(e=e||0,0===n.indexOf(t.name)&&(e+=(t.name+t.message).split("\n").length),n.split("\n").slice(e).filter(ht).map(t=>"\n"+t).join("")):""}var yt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],bt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(yt),mt={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"};function vt(t,e){this._e=pt(),this.name=t,this.message=e}function gt(t,e){return t+". Errors: "+Object.keys(e).map(t=>e[t].toString()).filter((t,e,n)=>n.indexOf(t)===e).join("\n")}function _t(t,e,n,r){this._e=pt(),this.failures=e,this.failedKeys=r,this.successCount=n,this.message=gt(t,e)}function wt(t,e){this._e=pt(),this.name="BulkError",this.failures=Object.keys(e).map(t=>e[t]),this.failuresByPos=e,this.message=gt(t,e)}$(vt).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+dt(this._e,2))}},toString:function(){return this.name+": "+this.message}}),$(_t).from(vt),$(wt).from(vt);var xt=bt.reduce((t,e)=>(t[e]=e+"Error",t),{});const Ot=vt;var St=bt.reduce((t,e)=>{var n=e+"Error";function r(t,r){this._e=pt(),this.name=n,t?"string"==typeof t?(this.message=`${t}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof t&&(this.message=`${t.name} ${t.message}`,this.inner=t):(this.message=mt[e]||n,this.inner=null)}return $(r).from(Ot),t[e]=r,t},{});St.Syntax=SyntaxError,St.Type=TypeError,St.Range=RangeError;var Et=yt.reduce((t,e)=>(t[e+"Error"]=St[e],t),{}),Pt=bt.reduce((t,e)=>(-1===["Syntax","Type","Range"].indexOf(e)&&(t[e+"Error"]=St[e]),t),{});function jt(){}function At(t){return t}function kt(t,e){return null==t||t===At?e:function(n){return e(t(n))}}function Ct(t,e){return function(){t.apply(this,arguments),e.apply(this,arguments)}}function Tt(t,e){return t===jt?e:function(){var n=t.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var i=e.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Ct(r,this.onsuccess):r),o&&(this.onerror=this.onerror?Ct(o,this.onerror):o),void 0!==i?i:n}}function Nt(t,e){return t===jt?e:function(){t.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,e.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Ct(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Ct(r,this.onerror):r)}}function It(t,e){return t===jt?e:function(n){var r=t.apply(this,arguments);C(n,r);var o=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var s=e.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?Ct(o,this.onsuccess):o),i&&(this.onerror=this.onerror?Ct(i,this.onerror):i),void 0===r?void 0===s?void 0:s:C(r,s)}}function Mt(t,e){return t===jt?e:function(){return!1!==e.apply(this,arguments)&&t.apply(this,arguments)}}function Rt(t,e){return t===jt?e:function(){var n=t.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 e.apply(r,i)})}return e.apply(this,arguments)}}Pt.ModifyError=_t,Pt.DexieError=vt,Pt.BulkError=wt;var Dt={};const[$t,Lt,Bt]="undefined"==typeof Promise?[]:(()=>{let t=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[t,T(t),t];const e=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[e,T(e),t]})(),Ut=Lt&&Lt.then,Vt=$t&&$t.constructor,Ft=!!Bt;var Kt=!1,Wt=Bt?()=>{Bt.then(pe)}:j.setImmediate?setImmediate.bind(null,pe):j.MutationObserver?()=>{var t=document.createElement("div");new MutationObserver(()=>{pe(),t=null}).observe(t,{attributes:!0}),t.setAttribute("i","1")}:()=>{setTimeout(pe,0)},qt=function(t,e){te.push([t,e]),Ht&&(Wt(),Ht=!1)},zt=!0,Ht=!0,Gt=[],Yt=[],Jt=null,Qt=At,Xt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Le,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach(t=>{try{Le(t[0],t[1])}catch(t){}})}},Zt=Xt,te=[],ee=0,ne=[];function re(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=jt,this._lib=!1;var e=this._PSD=Zt;if(ct&&(this._stackHolder=pt(),this._prev=null,this._numPrev=0),"function"!=typeof t){if(t!==Dt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&ae(this,this._value))}this._state=null,this._value=null,++e.ref,se(this,t)}const oe={get:function(){var t=Zt,e=Oe;function n(n,r){var o=!t.global&&(t!==Zt||e!==Oe);const i=o&&!je();var s=new re((e,s)=>{ce(this,new ie(Re(n,t,o,i),Re(r,t,o,i),e,s,t))});return ct&&fe(s,this),s}return n.prototype=Dt,n},set:function(t){D(this,"then",t&&t.prototype===Dt?oe:{get:function(){return t},set:oe.set})}};function ie(t,e,n,r,o){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=r,this.psd=o}function se(t,e){try{e(e=>{if(null===t._state){if(e===t)throw new TypeError("A promise cannot be resolved with itself.");var n=t._lib&&de();e&&"function"==typeof e.then?se(t,(t,n)=>{e instanceof re?e._then(t,n):e.then(t,n)}):(t._state=!0,t._value=e,ue(t)),n&&ye()}},ae.bind(null,t))}catch(e){ae(t,e)}}function ae(t,e){if(Yt.push(e),null===t._state){var n=t._lib&&de();e=Qt(e),t._state=!1,t._value=e,ct&&null!==e&&"object"==typeof e&&!e._promise&&function(t){try{t.apply(null,void 0)}catch(t){}}(()=>{var n=B(e,"stack");e._promise=t,D(e,"stack",{get:()=>Kt?n&&(n.get?n.get.apply(e):n.value):t.stack})}),function(t){Gt.some(e=>e._value===t._value)||Gt.push(t)}(t),ue(t),n&&ye()}}function ue(t){var e=t._listeners;t._listeners=[];for(var n=0,r=e.length;n<r;++n)ce(t,e[n]);var o=t._PSD;--o.ref||o.finalize(),0===ee&&(++ee,qt(()=>{0==--ee&&be()},[]))}function ce(t,e){if(null!==t._state){var n=t._state?e.onFulfilled:e.onRejected;if(null===n)return(t._state?e.resolve:e.reject)(t._value);++e.psd.ref,++ee,qt(le,[n,t,e])}else t._listeners.push(e)}function le(t,e,n){try{Jt=e;var r,o=e._value;e._state?r=t(o):(Yt.length&&(Yt=[]),r=t(o),-1===Yt.indexOf(o)&&function(t){for(var e=Gt.length;e;)if(Gt[--e]._value===t._value)return void Gt.splice(e,1)}(e)),n.resolve(r)}catch(t){n.reject(t)}finally{Jt=null,0==--ee&&be(),--n.psd.ref||n.psd.finalize()}}function he(t,e,n){if(e.length===n)return e;var r="";if(!1===t._state){var o,i,s=t._value;null!=s?(o=s.name||"Error",i=s.message||s,r=dt(s,0)):(o=s,i=""),e.push(o+(i?": "+i:"")+r)}return ct&&((r=dt(t._stackHolder,2))&&-1===e.indexOf(r)&&e.push(r),t._prev&&he(t._prev,e,n)),e}function fe(t,e){var n=e?e._numPrev+1:0;n<100&&(t._prev=e,t._numPrev=n)}function pe(){de()&&ye()}function de(){var t=zt;return zt=!1,Ht=!1,t}function ye(){var t,e,n;do{for(;te.length>0;)for(t=te,te=[],n=t.length,e=0;e<n;++e){var r=t[e];r[0].apply(null,r[1])}}while(te.length>0);zt=!0,Ht=!0}function be(){var t=Gt;Gt=[],t.forEach(t=>{t._PSD.onunhandled.call(null,t._value,t)});for(var e=ne.slice(0),n=e.length;n;)e[--n]()}function me(t){return new re(Dt,!1,t)}function ve(t,e){var n=Zt;return function(){var r=de(),o=Zt;try{return Te(n,!0),t.apply(this,arguments)}catch(t){e&&e(t)}finally{Te(o,!1),r&&ye()}}}M(re.prototype,{then:oe,_then:function(t,e){ce(this,new ie(null,null,t,e,Zt))},catch:function(t){if(1===arguments.length)return this.then(null,t);var e=arguments[0],n=arguments[1];return"function"==typeof e?this.then(null,t=>t instanceof e?n(t):me(t)):this.then(null,t=>t&&t.name===e?n(t):me(t))},finally:function(t){return this.then(e=>(t(),e),e=>(t(),me(e)))},stack:{get:function(){if(this._stack)return this._stack;try{Kt=!0;var t=he(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=t),t}finally{Kt=!1}}},timeout:function(t,e){return t<1/0?new re((n,r)=>{var o=setTimeout(()=>r(new St.Timeout(e)),t);this.then(n,r).finally(clearTimeout.bind(null,o))}):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&D(re.prototype,Symbol.toStringTag,"Dexie.Promise"),Xt.env=Ne(),M(re,{all:function(){var t=at.apply(null,arguments).map(Ae);return new re(function(e,n){0===t.length&&e([]);var r=t.length;t.forEach((o,i)=>re.resolve(o).then(n=>{t[i]=n,--r||e(t)},n))})},resolve:t=>{if(t instanceof re)return t;if(t&&"function"==typeof t.then)return new re((e,n)=>{t.then(e,n)});var e=new re(Dt,!0,t);return fe(e,Jt),e},reject:me,race:function(){var t=at.apply(null,arguments).map(Ae);return new re((e,n)=>{t.map(t=>re.resolve(t).then(e,n))})},PSD:{get:()=>Zt,set:t=>Zt=t},totalEchoes:{get:()=>Oe},newPSD:Ee,usePSD:Ie,scheduler:{get:()=>qt,set:t=>{qt=t}},rejectionMapper:{get:()=>Qt,set:t=>{Qt=t}},follow:(t,e)=>new re((n,r)=>Ee((e,n)=>{var r=Zt;r.unhandleds=[],r.onunhandled=n,r.finalize=Ct(function(){!function(t){ne.push(function e(){t(),ne.splice(ne.indexOf(e),1)}),++ee,qt(()=>{0==--ee&&be()},[])}(()=>{0===this.unhandleds.length?e():n(this.unhandleds[0])})},r.finalize),t()},e,n,r))}),Vt&&(Vt.allSettled&&D(re,"allSettled",function(){const t=at.apply(null,arguments).map(Ae);return new re(e=>{0===t.length&&e([]);let n=t.length;const r=new Array(n);t.forEach((t,o)=>re.resolve(t).then(t=>r[o]={status:"fulfilled",value:t},t=>r[o]={status:"rejected",reason:t}).then(()=>--n||e(r)))})}),Vt.any&&"undefined"!=typeof AggregateError&&D(re,"any",function(){const t=at.apply(null,arguments).map(Ae);return new re((e,n)=>{0===t.length&&n(new AggregateError([]));let r=t.length;const o=new Array(r);t.forEach((t,i)=>re.resolve(t).then(t=>e(t),t=>{o[i]=t,--r||n(new AggregateError(o))}))})}));const ge={awaits:0,echoes:0,id:0};var _e=0,we=[],xe=0,Oe=0,Se=0;function Ee(t,e,n,r){var o=Zt,i=Object.create(o);i.parent=o,i.ref=0,i.global=!1,i.id=++Se;var s=Xt.env;i.env=Ft?{Promise:re,PromiseProp:{value:re,configurable:!0,writable:!0},all:re.all,race:re.race,allSettled:re.allSettled,any:re.any,resolve:re.resolve,reject:re.reject,nthen:De(s.nthen,i),gthen:De(s.gthen,i)}:{},e&&C(i,e),++o.ref,i.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=Ie(i,t,n,r);return 0===i.ref&&i.finalize(),a}function Pe(){return ge.id||(ge.id=++_e),++ge.awaits,ge.echoes+=100,ge.id}function je(){return!!ge.awaits&&(0==--ge.awaits&&(ge.id=0),ge.echoes=100*ge.awaits,!0)}function Ae(t){return ge.echoes&&t&&t.constructor===Vt?(Pe(),t.then(t=>(je(),t),t=>(je(),Be(t)))):t}function ke(t){++Oe,ge.echoes&&0!=--ge.echoes||(ge.echoes=ge.id=0),we.push(Zt),Te(t,!0)}function Ce(){var t=we[we.length-1];we.pop(),Te(t,!1)}function Te(t,e){var n=Zt;if((e?!ge.echoes||xe++&&t===Zt:!xe||--xe&&t===Zt)||Me(e?ke.bind(null,t):Ce),t!==Zt&&(Zt=t,n===Xt&&(Xt.env=Ne()),Ft)){var r=Xt.env.Promise,o=t.env;Lt.then=o.nthen,r.prototype.then=o.gthen,(n.global||t.global)&&(Object.defineProperty(j,"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))}}function Ne(){var t=j.Promise;return Ft?{Promise:t,PromiseProp:Object.getOwnPropertyDescriptor(j,"Promise"),all:t.all,race:t.race,allSettled:t.allSettled,any:t.any,resolve:t.resolve,reject:t.reject,nthen:Lt.then,gthen:t.prototype.then}:{}}function Ie(t,e,n,r,o){var i=Zt;try{return Te(t,!0),e(n,r,o)}finally{Te(i,!1)}}function Me(t){Ut.call($t,t)}function Re(t,e,n,r){return"function"!=typeof t?t:function(){var o=Zt;n&&Pe(),Te(e,!0);try{return t.apply(this,arguments)}finally{Te(o,!1),r&&Me(je)}}}function De(t,e){return function(n,r){return t.call(this,Re(n,e),Re(r,e))}}-1===(""+Ut).indexOf("[native code]")&&(Pe=je=jt);const $e="unhandledrejection";function Le(t,e){var n;try{n=e.onuncatched(t)}catch(t){}if(!1!==n)try{var r,o={promise:e,reason:t};if(j.document&&document.createEvent?((r=document.createEvent("Event")).initEvent($e,!0,!0),C(r,o)):j.CustomEvent&&C(r=new CustomEvent($e,{detail:o}),o),r&&j.dispatchEvent&&(dispatchEvent(r),!j.PromiseRejectionEvent&&j.onunhandledrejection))try{j.onunhandledrejection(r)}catch(t){}ct&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${t.stack||t}`)}catch(t){}}var Be=re.reject;function Ue(t,e,n,r){if(t.idbdb&&(t._state.openComplete||Zt.letThrough||t._vip)){var o=t._createTransaction(e,n,t._dbSchema);try{o.create(),t._state.PR1398_maxLoop=3}catch(o){return o.name===xt.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>Ue(t,e,n,r))):Be(o)}return o._promise(e,(t,e)=>Ee(()=>(Zt.trans=o,r(t,e,o)))).then(t=>o._completion.then(()=>t))}if(t._state.openComplete)return Be(new St.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._options.autoOpen)return Be(new St.DatabaseClosed);t.open().catch(jt)}return t._state.dbReadyPromise.then(()=>Ue(t,e,n,r))}const Ve="3.2.7",Fe=String.fromCharCode(65535),Ke=-1/0,We="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",qe="String expected.",ze=[],He="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Ge=He,Ye=He,Je=t=>!/(dexie\.js|dexie\.min\.js)/.test(t),Qe="__dbnames",Xe="readonly",Ze="readwrite";function tn(t,e){return t?e?function(){return t.apply(this,arguments)&&e.apply(this,arguments)}:t:e}const en={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function nn(t){return"string"!=typeof t||/\./.test(t)?t=>t:e=>(void 0===e[t]&&t in e&&delete(e=tt(e))[t],e)}class rn{_trans(t,e,n){const r=this._tx||Zt.trans,o=this.name;function i(t,n,r){if(!r.schema[o])throw new St.NotFound("Table "+o+" not part of transaction");return e(r.idbtrans,r)}const s=de();try{return r&&r.db===this.db?r===Zt.trans?r._promise(t,i,n):Ee(()=>r._promise(t,i,n),{trans:r,transless:Zt.transless||Zt}):Ue(this.db,t,[this.name],i)}finally{s&&ye()}}get(t,e){return t&&t.constructor===Object?this.where(t).first(e):this._trans("readonly",e=>this.core.get({trans:e,key:t}).then(t=>this.hook.reading.fire(t))).then(e)}where(t){if("string"==typeof t)return new this.db.WhereClause(this,t);if(k(t))return new this.db.WhereClause(this,`[${t.join("+")}]`);const e=A(t);if(1===e.length)return this.where(e[0]).equals(t[e[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter(t=>{if(t.compound&&e.every(e=>t.keyPath.indexOf(e)>=0)){for(let n=0;n<e.length;++n)if(-1===e.indexOf(t.keyPath[n]))return!1;return!0}return!1}).sort((t,e)=>t.keyPath.length-e.keyPath.length)[0];if(n&&this.db._maxKey!==Fe){const r=n.keyPath.slice(0,e.length);return this.where(r).equals(r.map(e=>t[e]))}!n&&ct&&console.warn(`The query ${JSON.stringify(t)} on ${this.name} would benefit of a compound index [${e.join("+")}]`);const{idxByName:r}=this.schema,o=this.db._deps.indexedDB;function i(t,e){try{return 0===o.cmp(t,e)}catch(t){return!1}}const[s,a]=e.reduce(([e,n],o)=>{const s=r[o],a=t[o];return[e||s,e||!s?tn(n,s&&s.multi?t=>{const e=z(t,o);return k(e)&&e.some(t=>i(a,t))}:t=>i(a,z(t,o))):n]},[null,null]);return s?this.where(s.name).equals(t[s.keyPath]).filter(a):n?this.filter(a):this.where(e).equals("")}filter(t){return this.toCollection().and(t)}count(t){return this.toCollection().count(t)}offset(t){return this.toCollection().offset(t)}limit(t){return this.toCollection().limit(t)}each(t){return this.toCollection().each(t)}toArray(t){return this.toCollection().toArray(t)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(t){return new this.db.Collection(new this.db.WhereClause(this,k(t)?`[${t.join("+")}]`:t))}reverse(){return this.toCollection().reverse()}mapToClass(t){this.schema.mappedClass=t;const e=e=>{if(!e)return e;const n=Object.create(t.prototype);for(var r in e)if(I(e,r))try{n[r]=e[r]}catch(t){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=e,this.hook("reading",e),t}defineClass(){return this.mapToClass(function(t){C(this,t)})}add(t,e){const{auto:n,keyPath:r}=this.schema.primKey;let o=t;return r&&n&&(o=nn(r)(t)),this._trans("readwrite",t=>this.core.mutate({trans:t,type:"add",keys:null!=e?[e]:null,values:[o]})).then(t=>t.numFailures?re.reject(t.failures[0]):t.lastResult).then(e=>{if(r)try{H(t,r,e)}catch(t){}return e})}update(t,e){if("object"!=typeof t||k(t))return this.where(":id").equals(t).modify(e);{const n=z(t,this.schema.primKey.keyPath);if(void 0===n)return Be(new St.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof e?A(e).forEach(n=>{H(t,n,e[n])}):e(t,{value:t,primKey:n})}catch(t){}return this.where(":id").equals(n).modify(e)}}put(t,e){const{auto:n,keyPath:r}=this.schema.primKey;let o=t;return r&&n&&(o=nn(r)(t)),this._trans("readwrite",t=>this.core.mutate({trans:t,type:"put",values:[o],keys:null!=e?[e]:null})).then(t=>t.numFailures?re.reject(t.failures[0]):t.lastResult).then(e=>{if(r)try{H(t,r,e)}catch(t){}return e})}delete(t){return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"delete",keys:[t]})).then(t=>t.numFailures?re.reject(t.failures[0]):void 0)}clear(){return this._trans("readwrite",t=>this.core.mutate({trans:t,type:"deleteRange",range:en})).then(t=>t.numFailures?re.reject(t.failures[0]):void 0)}bulkGet(t){return this._trans("readonly",e=>this.core.getMany({keys:t,trans:e}).then(t=>t.map(t=>this.hook.reading.fire(t))))}bulkAdd(t,e,n){const r=Array.isArray(e)?e:void 0,o=(n=n||(r?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",e=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new St.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==t.length)throw new St.InvalidArgument("Arguments objects and keys must have the same length");const s=t.length;let a=i&&n?t.map(nn(i)):t;return this.core.mutate({trans:e,type:"add",keys:r,values:a,wantResults:o}).then(({numFailures:t,results:e,lastResult:n,failures:r})=>{if(0===t)return o?e:n;throw new wt(`${this.name}.bulkAdd(): ${t} of ${s} operations failed`,r)})})}bulkPut(t,e,n){const r=Array.isArray(e)?e:void 0,o=(n=n||(r?void 0:e))?n.allKeys:void 0;return this._trans("readwrite",e=>{const{auto:n,keyPath:i}=this.schema.primKey;if(i&&r)throw new St.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==t.length)throw new St.InvalidArgument("Arguments objects and keys must have the same length");const s=t.length;let a=i&&n?t.map(nn(i)):t;return this.core.mutate({trans:e,type:"put",keys:r,values:a,wantResults:o}).then(({numFailures:t,results:e,lastResult:n,failures:r})=>{if(0===t)return o?e:n;throw new wt(`${this.name}.bulkPut(): ${t} of ${s} operations failed`,r)})})}bulkDelete(t){const e=t.length;return this._trans("readwrite",e=>this.core.mutate({trans:e,type:"delete",keys:t})).then(({numFailures:t,lastResult:n,failures:r})=>{if(0===t)return n;throw new wt(`${this.name}.bulkDelete(): ${t} of ${e} operations failed`,r)})}}function on(t){var e={},n=function(n,r){if(r){for(var o=arguments.length,i=new Array(o-1);--o;)i[o-1]=arguments[o];return e[n].subscribe.apply(null,i),t}if("string"==typeof n)return e[n]};n.addEventType=i;for(var r=1,o=arguments.length;r<o;++r)i(arguments[r]);return n;function i(t,r,o){if("object"!=typeof t){var s;r||(r=Mt),o||(o=jt);var a={subscribers:[],fire:o,subscribe:function(t){-1===a.subscribers.indexOf(t)&&(a.subscribers.push(t),a.fire=r(a.fire,t))},unsubscribe:function(t){a.subscribers=a.subscribers.filter(function(e){return e!==t}),a.fire=a.subscribers.reduce(r,o)}};return e[t]=n[t]=a,a}A(s=t).forEach(function(t){var e=s[t];if(k(e))i(t,s[t][0],s[t][1]);else{if("asap"!==e)throw new St.InvalidArgument("Invalid event config");var n=i(t,At,function(){for(var t=arguments.length,e=new Array(t);t--;)e[t]=arguments[t];n.subscribers.forEach(function(t){W(function(){t.apply(null,e)})})})}})}}function sn(t,e){return $(e).from({prototype:t}),e}function an(t,e){return!(t.filter||t.algorithm||t.or)&&(e?t.justLimit:!t.replayFilter)}function un(t,e){t.filter=tn(t.filter,e)}function cn(t,e,n){var r=t.replayFilter;t.replayFilter=r?()=>tn(r(),e()):e,t.justLimit=n&&!r}function ln(t,e){if(t.isPrimKey)return e.primaryKey;const n=e.getIndexByKeyPath(t.index);if(!n)throw new St.Schema("KeyPath "+t.index+" on object store "+e.name+" is not indexed");return n}function hn(t,e,n){const r=ln(t,e.schema);return e.openCursor({trans:n,values:!t.keysOnly,reverse:"prev"===t.dir,unique:!!t.unique,query:{index:r,range:t.range}})}function fn(t,e,n,r){const o=t.replayFilter?tn(t.filter,t.replayFilter()):t.filter;if(t.or){const i={},s=(t,n,r)=>{if(!o||o(n,r,t=>n.stop(t),t=>n.fail(t))){var s=n.primaryKey,a=""+s;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(s)),I(i,a)||(i[a]=!0,e(t,n,r))}};return Promise.all([t.or._iterate(s,n),pn(hn(t,r,n),t.algorithm,s,!t.keysOnly&&t.valueMapper)])}return pn(hn(t,r,n),tn(t.algorithm,o),e,!t.keysOnly&&t.valueMapper)}function pn(t,e,n,r){var o=ve(r?(t,e,o)=>n(r(t),e,o):n);return t.then(t=>{if(t)return t.start(()=>{var n=()=>t.continue();e&&!e(t,t=>n=t,e=>{t.stop(e),n=jt},e=>{t.fail(e),n=jt})||o(t.value,t,t=>n=t),n()})})}function dn(t,e){try{const n=yn(t),r=yn(e);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 t>e?1:t<e?-1:0;case"binary":return function(t,e){const n=t.length,r=e.length,o=n<r?n:r;for(let n=0;n<o;++n)if(t[n]!==e[n])return t[n]<e[n]?-1:1;return n===r?0:n<r?-1:1}(bn(t),bn(e));case"Array":return function(t,e){const n=t.length,r=e.length,o=n<r?n:r;for(let n=0;n<o;++n){const r=dn(t[n],e[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(t,e)}}catch(t){}return NaN}function yn(t){const e=typeof t;if("object"!==e)return e;if(ArrayBuffer.isView(t))return"binary";const n=rt(t);return"ArrayBuffer"===n?"binary":n}function bn(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):new Uint8Array(t)}class mn{_read(t,e){var n=this._ctx;return n.error?n.table._trans(null,Be.bind(null,n.error)):n.table._trans("readonly",t).then(e)}_write(t){var e=this._ctx;return e.error?e.table._trans(null,Be.bind(null,e.error)):e.table._trans("readwrite",t,"locked")}_addAlgorithm(t){var e=this._ctx;e.algorithm=tn(e.algorithm,t)}_iterate(t,e){return fn(this._ctx,t,e,this._ctx.table.core)}clone(t){var e=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return t&&C(n,t),e._ctx=n,e}raw(){return this._ctx.valueMapper=null,this}each(t){var e=this._ctx;return this._read(n=>fn(e,t,n,e.table.core))}count(t){return this._read(t=>{const e=this._ctx,n=e.table.core;if(an(e,!0))return n.count({trans:t,query:{index:ln(e,n.schema),range:e.range}}).then(t=>Math.min(t,e.limit));var r=0;return fn(e,()=>(++r,!1),t,n).then(()=>r)}).then(t)}sortBy(t,e){const n=t.split(".").reverse(),r=n[0],o=n.length-1;function i(t,e){return e?i(t[n[e]],e-1):t[r]}var s="next"===this._ctx.dir?1:-1;function a(t,e){var n=i(t,o),r=i(e,o);return n<r?-s:n>r?s:0}return this.toArray(function(t){return t.sort(a)}).then(e)}toArray(t){return this._read(t=>{var e=this._ctx;if("next"===e.dir&&an(e,!0)&&e.limit>0){const{valueMapper:n}=e,r=ln(e,e.table.core.schema);return e.table.core.query({trans:t,limit:e.limit,values:!0,query:{index:r,range:e.range}}).then(({result:t})=>n?t.map(n):t)}{const n=[];return fn(e,t=>n.push(t),t,e.table.core).then(()=>n)}},t)}offset(t){var e=this._ctx;return t<=0||(e.offset+=t,an(e)?cn(e,()=>{var e=t;return(t,n)=>0===e||(1===e?(--e,!1):(n(()=>{t.advance(e),e=0}),!1))}):cn(e,()=>{var e=t;return()=>--e<0})),this}limit(t){return this._ctx.limit=Math.min(this._ctx.limit,t),cn(this._ctx,()=>{var e=t;return function(t,n,r){return--e<=0&&n(r),e>=0}},!0),this}until(t,e){return un(this._ctx,function(n,r,o){return!t(n.value)||(r(o),e)}),this}first(t){return this.limit(1).toArray(function(t){return t[0]}).then(t)}last(t){return this.reverse().first(t)}filter(t){var e,n;return un(this._ctx,function(e){return t(e.value)}),e=this._ctx,n=t,e.isMatch=tn(e.isMatch,n),this}and(t){return this.filter(t)}or(t){return new this.db.WhereClause(this._ctx.table,t,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each(function(e,n){t(n.key,n)})}eachUniqueKey(t){return this._ctx.unique="unique",this.eachKey(t)}eachPrimaryKey(t){var e=this._ctx;return e.keysOnly=!e.isMatch,this.each(function(e,n){t(n.primaryKey,n)})}keys(t){var e=this._ctx;e.keysOnly=!e.isMatch;var n=[];return this.each(function(t,e){n.push(e.key)}).then(function(){return n}).then(t)}primaryKeys(t){var e=this._ctx;if("next"===e.dir&&an(e,!0)&&e.limit>0)return this._read(t=>{var n=ln(e,e.table.core.schema);return e.table.core.query({trans:t,values:!1,limit:e.limit,query:{index:n,range:e.range}})}).then(({result:t})=>t).then(t);e.keysOnly=!e.isMatch;var n=[];return this.each(function(t,e){n.push(e.primaryKey)}).then(function(){return n}).then(t)}uniqueKeys(t){return this._ctx.unique="unique",this.keys(t)}firstKey(t){return this.limit(1).keys(function(t){return t[0]}).then(t)}lastKey(t){return this.reverse().firstKey(t)}distinct(){var t=this._ctx,e=t.index&&t.table.schema.idxByName[t.index];if(!e||!e.multi)return this;var n={};return un(this._ctx,function(t){var e=t.primaryKey.toString(),r=I(n,e);return n[e]=!0,!r}),this}modify(t){var e=this._ctx;return this._write(n=>{var r;if("function"==typeof t)r=t;else{var o=A(t),i=o.length;r=function(e){for(var n=!1,r=0;r<i;++r){var s=o[r],a=t[s];z(e,s)!==a&&(H(e,s,a),n=!0)}return n}}const s=e.table.core,{outbound:a,extractKey:u}=s.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const f=[],p=(t,e)=>{const{failures:n,numFailures:r}=e;h+=t-r;for(let t of A(n))l.push(n[t])};return this.clone().primaryKeys().then(o=>{const i=l=>{const h=Math.min(c,o.length-l);return s.getMany({trans:n,keys:o.slice(l,l+h),cache:"immutable"}).then(f=>{const d=[],y=[],b=a?[]:null,m=[];for(let t=0;t<h;++t){const e=f[t],n={value:tt(e),primKey:o[l+t]};!1!==r.call(n,n.value,n)&&(null==n.value?m.push(o[l+t]):a||0===dn(u(e),u(n.value))?(y.push(n.value),a&&b.push(o[l+t])):(m.push(o[l+t]),d.push(n.value)))}const v=an(e)&&e.limit===1/0&&("function"!=typeof t||t===vn)&&{index:e.index,range:e.range};return Promise.resolve(d.length>0&&s.mutate({trans:n,type:"add",values:d}).then(t=>{for(let e in t.failures)m.splice(parseInt(e),1);p(d.length,t)})).then(()=>(y.length>0||v&&"object"==typeof t)&&s.mutate({trans:n,type:"put",keys:b,values:y,criteria:v,changeSpec:"function"!=typeof t&&t}).then(t=>p(y.length,t))).then(()=>(m.length>0||v&&t===vn)&&s.mutate({trans:n,type:"delete",keys:m,criteria:v}).then(t=>p(m.length,t))).then(()=>o.length>l+h&&i(l+c))})};return i(0).then(()=>{if(l.length>0)throw new _t("Error modifying one or more objects",l,h,f);return o.length})})})}delete(){var t=this._ctx,e=t.range;return an(t)&&(t.isPrimKey&&!Ye||3===e.type)?this._write(n=>{const{primaryKey:r}=t.table.core.schema,o=e;return t.table.core.count({trans:n,query:{index:r,range:o}}).then(e=>t.table.core.mutate({trans:n,type:"deleteRange",range:o}).then(({failures:t,lastResult:n,results:r,numFailures:o})=>{if(o)throw new _t("Could not delete some values",Object.keys(t).map(e=>t[e]),e-o);return e-o}))}):this.modify(vn)}}const vn=(t,e)=>e.value=null;function gn(t,e){return t<e?-1:t===e?0:1}function _n(t,e){return t>e?-1:t===e?0:1}function wn(t,e,n){var r=t instanceof jn?new t.Collection(t):t;return r._ctx.error=n?new n(e):new TypeError(e),r}function xn(t){return new t.Collection(t,()=>Pn("")).limit(0)}function On(t,e,n,r,o,i){for(var s=Math.min(t.length,r.length),a=-1,u=0;u<s;++u){var c=e[u];if(c!==r[u])return o(t[u],n[u])<0?t.substr(0,u)+n[u]+n.substr(u+1):o(t[u],r[u])<0?t.substr(0,u)+r[u]+n.substr(u+1):a>=0?t.substr(0,a)+e[a]+n.substr(a+1):null;o(t[u],c)<0&&(a=u)}return s<r.length&&"next"===i?t+n.substr(t.length):s<t.length&&"prev"===i?t.substr(0,n.length):a<0?null:t.substr(0,a)+r[a]+n.substr(a+1)}function Sn(t,e,n,r){var o,i,s,a,u,c,l,h=n.length;if(!n.every(t=>"string"==typeof t))return wn(t,qe);function f(t){o=function(t){return"next"===t?t=>t.toUpperCase():t=>t.toLowerCase()}(t),i=function(t){return"next"===t?t=>t.toLowerCase():t=>t.toUpperCase()}(t),s="next"===t?gn:_n;var e=n.map(function(t){return{lower:i(t),upper:o(t)}}).sort(function(t,e){return s(t.lower,e.lower)});a=e.map(function(t){return t.upper}),u=e.map(function(t){return t.lower}),c=t,l="next"===t?"":r}f("next");var p=new t.Collection(t,()=>En(a[0],u[h-1]+r));p._ondirectionchange=function(t){f(t)};var d=0;return p._addAlgorithm(function(t,n,r){var o=t.key;if("string"!=typeof o)return!1;var f=i(o);if(e(f,u,d))return!0;for(var p=null,y=d;y<h;++y){var b=On(o,f,a[y],u[y],s,c);null===b&&null===p?d=y+1:(null===p||s(p,b)>0)&&(p=b)}return n(null!==p?function(){t.continue(p+l)}:r),!1}),p}function En(t,e,n,r){return{type:2,lower:t,upper:e,lowerOpen:n,upperOpen:r}}function Pn(t){return{type:1,lower:t,upper:t}}class jn{get Collection(){return this._ctx.table.db.Collection}between(t,e,n,r){n=!1!==n,r=!0===r;try{return this._cmp(t,e)>0||0===this._cmp(t,e)&&(n||r)&&(!n||!r)?xn(this):new this.Collection(this,()=>En(t,e,!n,!r))}catch(t){return wn(this,We)}}equals(t){return null==t?wn(this,We):new this.Collection(this,()=>Pn(t))}above(t){return null==t?wn(this,We):new this.Collection(this,()=>En(t,void 0,!0))}aboveOrEqual(t){return null==t?wn(this,We):new this.Collection(this,()=>En(t,void 0,!1))}below(t){return null==t?wn(this,We):new this.Collection(this,()=>En(void 0,t,!1,!0))}belowOrEqual(t){return null==t?wn(this,We):new this.Collection(this,()=>En(void 0,t))}startsWith(t){return"string"!=typeof t?wn(this,qe):this.between(t,t+Fe,!0,!0)}startsWithIgnoreCase(t){return""===t?this.startsWith(t):Sn(this,(t,e)=>0===t.indexOf(e[0]),[t],Fe)}equalsIgnoreCase(t){return Sn(this,(t,e)=>t===e[0],[t],"")}anyOfIgnoreCase(){var t=at.apply(st,arguments);return 0===t.length?xn(this):Sn(this,(t,e)=>-1!==e.indexOf(t),t,"")}startsWithAnyOfIgnoreCase(){var t=at.apply(st,arguments);return 0===t.length?xn(this):Sn(this,(t,e)=>e.some(e=>0===t.indexOf(e)),t,Fe)}anyOf(){const t=at.apply(st,arguments);let e=this._cmp;try{t.sort(e)}catch(t){return wn(this,We)}if(0===t.length)return xn(this);const n=new this.Collection(this,()=>En(t[0],t[t.length-1]));n._ondirectionchange=n=>{e="next"===n?this._ascending:this._descending,t.sort(e)};let r=0;return n._addAlgorithm((n,o,i)=>{const s=n.key;for(;e(s,t[r])>0;)if(++r,r===t.length)return o(i),!1;return 0===e(s,t[r])||(o(()=>{n.continue(t[r])}),!1)}),n}notEqual(t){return this.inAnyRange([[Ke,t],[t,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const t=at.apply(st,arguments);if(0===t.length)return new this.Collection(this);try{t.sort(this._ascending)}catch(t){return wn(this,We)}const e=t.reduce((t,e)=>t?t.concat([[t[t.length-1][1],e]]):[[Ke,e]],null);return e.push([t[t.length-1],this.db._maxKey]),this.inAnyRange(e,{includeLowers:!1,includeUppers:!1})}inAnyRange(t,e){const n=this._cmp,r=this._ascending,o=this._descending,i=this._min,s=this._max;if(0===t.length)return xn(this);if(!t.every(t=>void 0!==t[0]&&void 0!==t[1]&&r(t[0],t[1])<=0))return wn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",St.InvalidArgument);const a=!e||!1!==e.includeLowers,u=e&&!0===e.includeUppers;let c,l=r;function h(t,e){return l(t[0],e[0])}try{c=t.reduce(function(t,e){let r=0,o=t.length;for(;r<o;++r){const o=t[r];if(n(e[0],o[1])<0&&n(e[1],o[0])>0){o[0]=i(o[0],e[0]),o[1]=s(o[1],e[1]);break}}return r===o&&t.push(e),t},[]),c.sort(h)}catch(t){return wn(this,We)}let f=0;const p=u?t=>r(t,c[f][1])>0:t=>r(t,c[f][1])>=0,d=a?t=>o(t,c[f][0])>0:t=>o(t,c[f][0])>=0;let y=p;const b=new this.Collection(this,()=>En(c[0][0],c[c.length-1][1],!a,!u));return b._ondirectionchange=t=>{"next"===t?(y=p,l=r):(y=d,l=o),c.sort(h)},b._addAlgorithm((t,e,n)=>{for(var o=t.key;y(o);)if(++f,f===c.length)return e(n),!1;return!!function(t){return!p(t)&&!d(t)}(o)||(0===this._cmp(o,c[f][1])||0===this._cmp(o,c[f][0])||e(()=>{l===r?t.continue(c[f][0]):t.continue(c[f][1])}),!1)}),b}startsWithAnyOf(){const t=at.apply(st,arguments);return t.every(t=>"string"==typeof t)?0===t.length?xn(this):this.inAnyRange(t.map(t=>[t,t+Fe])):wn(this,"startsWithAnyOf() only works with strings")}}function An(t){return ve(function(e){return kn(e),t(e.target.error),!1})}function kn(t){t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault()}const Cn="storagemutated",Tn="x-storagemutated-1",Nn=on(null,Cn);class In{_lock(){return K(!Zt.global),++this._reculock,1!==this._reculock||Zt.global||(Zt.lockOwnerFor=this),this}_unlock(){if(K(!Zt.global),0==--this._reculock)for(Zt.global||(Zt.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var t=this._blockedFuncs.shift();try{Ie(t[1],t[0])}catch(t){}}return this}_locked(){return this._reculock&&Zt.lockOwnerFor!==this}create(t){if(!this.mode)return this;const e=this.db.idbdb,n=this.db._state.dbOpenError;if(K(!this.idbtrans),!t&&!e)switch(n&&n.name){case"DatabaseClosedError":throw new St.DatabaseClosed(n);case"MissingAPIError":throw new St.MissingAPI(n.message,n);default:throw new St.OpenFailed(n)}if(!this.active)throw new St.TransactionInactive;return K(null===this._completion._state),(t=this.idbtrans=t||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):e.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=ve(e=>{kn(e),this._reject(t.error)}),t.onabort=ve(e=>{kn(e),this.active&&this._reject(new St.Abort(t.error)),this.active=!1,this.on("abort").fire(e)}),t.oncomplete=ve(()=>{this.active=!1,this._resolve(),"mutatedParts"in t&&Nn.storagemutated.fire(t.mutatedParts)}),this}_promise(t,e,n){if("readwrite"===t&&"readwrite"!==this.mode)return Be(new St.ReadOnly("Transaction is readonly"));if(!this.active)return Be(new St.TransactionInactive);if(this._locked())return new re((r,o)=>{this._blockedFuncs.push([()=>{this._promise(t,e,n).then(r,o)},Zt])});if(n)return Ee(()=>{var t=new re((t,n)=>{this._lock();const r=e(t,n,this);r&&r.then&&r.then(t,n)});return t.finally(()=>this._unlock()),t._lib=!0,t});var r=new re((t,n)=>{var r=e(t,n,this);r&&r.then&&r.then(t,n)});return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(t){var e=this._root();const n=re.resolve(t);if(e._waitingFor)e._waitingFor=e._waitingFor.then(()=>n);else{e._waitingFor=n,e._waitingQueue=[];var r=e.idbtrans.objectStore(e.storeNames[0]);!function t(){for(++e._spinCount;e._waitingQueue.length;)e._waitingQueue.shift()();e._waitingFor&&(r.get(-1/0).onsuccess=t)}()}var o=e._waitingFor;return new re((t,r)=>{n.then(n=>e._waitingQueue.push(ve(t.bind(null,n))),t=>e._waitingQueue.push(ve(r.bind(null,t)))).finally(()=>{e._waitingFor===o&&(e._waitingFor=null)})})}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new St.Abort))}table(t){const e=this._memoizedTables||(this._memoizedTables={});if(I(e,t))return e[t];const n=this.schema[t];if(!n)throw new St.NotFound("Table "+t+" not part of transaction");const r=new this.db.Table(t,n,this);return r.core=this.db.core.table(t),e[t]=r,r}}function Mn(t,e,n,r,o,i,s){return{name:t,keyPath:e,unique:n,multi:r,auto:o,compound:i,src:(n&&!s?"&":"")+(r?"*":"")+(o?"++":"")+Rn(e)}}function Rn(t){return"string"==typeof t?t:t?"["+[].join.call(t,"+")+"]":""}function Dn(t,e,n){return{name:t,primKey:e,indexes:n,mappedClass:null,idxByName:q(n,t=>[t.name,t])}}let $n=t=>{try{return t.only([[]]),$n=()=>[[]],[[]]}catch(t){return $n=()=>Fe,Fe}};function Ln(t){return null==t?()=>{}:"string"==typeof t?function(t){return 1===t.split(".").length?e=>e[t]:e=>z(e,t)}(t):e=>z(e,t)}function Bn(t){return[].slice.call(t)}let Un=0;function Vn(t){return null==t?":id":"string"==typeof t?t:`[${t.join("+")}]`}function Fn({_novip:t},e){const n=e.db,r=function(t,e,{IDBKeyRange:n,indexedDB:r},o){const i=function(t,e){return e.reduce((t,{create:e})=>({...t,...e(t)}),t)}(function(t,e,n){function r(t){if(3===t.type)return null;if(4===t.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:n,upper:r,lowerOpen:o,upperOpen:i}=t;return void 0===n?void 0===r?null:e.upperBound(r,!!i):void 0===r?e.lowerBound(n,!!o):e.bound(n,r,!!o,!!i)}const{schema:o,hasGetAll:i}=function(t,e){const n=Bn(t.objectStoreNames);return{schema:{name:t.name,tables:n.map(t=>e.objectStore(t)).map(t=>{const{keyPath:e,autoIncrement:n}=t,r=k(e),o=null==e,i={},s={name:t.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:o,compound:r,keyPath:e,autoIncrement:n,unique:!0,extractKey:Ln(e)},indexes:Bn(t.indexNames).map(e=>t.index(e)).map(t=>{const{name:e,unique:n,multiEntry:r,keyPath:o}=t,s={name:e,compound:k(o),keyPath:o,unique:n,multiEntry:r,extractKey:Ln(o)};return i[Vn(o)]=s,s}),getIndexByKeyPath:t=>i[Vn(t)]};return i[":id"]=s.primaryKey,null!=e&&(i[Vn(e)]=s.primaryKey),s})},hasGetAll:n.length>0&&"getAll"in e.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(t,n),s=o.tables.map(t=>function(t){const e=t.name;return{name:e,schema:t,mutate:function({trans:t,type:n,keys:o,values:i,range:s}){return new Promise((a,u)=>{a=ve(a);const c=t.objectStore(e),l=null==c.keyPath,h="put"===n||"add"===n;if(!h&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:f}=o||i||{length:1};if(o&&i&&o.length!==i.length)throw new Error("Given keys array must have same length as given values array.");if(0===f)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let p;const d=[],y=[];let b=0;const m=t=>{++b,kn(t)};if("deleteRange"===n){if(4===s.type)return a({numFailures:b,failures:y,results:[],lastResult:void 0});3===s.type?d.push(p=c.clear()):d.push(p=c.delete(r(s)))}else{const[t,e]=h?l?[i,o]:[i,null]:[o,null];if(h)for(let r=0;r<f;++r)d.push(p=e&&void 0!==e[r]?c[n](t[r],e[r]):c[n](t[r])),p.onerror=m;else for(let e=0;e<f;++e)d.push(p=c[n](t[e])),p.onerror=m}const v=t=>{const e=t.target.result;d.forEach((t,e)=>null!=t.error&&(y[e]=t.error)),a({numFailures:b,failures:y,results:"delete"===n?o:d.map(t=>t.result),lastResult:e})};p.onerror=t=>{m(t),v(t)},p.onsuccess=v})},getMany:({trans:t,keys:n})=>new Promise((r,o)=>{r=ve(r);const i=t.objectStore(e),s=n.length,a=new Array(s);let u,c=0,l=0;const h=t=>{const e=t.target;a[e._pos]=e.result,++l===c&&r(a)},f=An(o);for(let t=0;t<s;++t)null!=n[t]&&(u=i.get(n[t]),u._pos=t,u.onsuccess=h,u.onerror=f,++c);0===c&&r(a)}),get:({trans:t,key:n})=>new Promise((r,o)=>{r=ve(r);const i=t.objectStore(e).get(n);i.onsuccess=t=>r(t.target.result),i.onerror=An(o)}),query:function(t){return n=>new Promise((o,i)=>{o=ve(o);const{trans:s,values:a,limit:u,query:c}=n,l=u===1/0?void 0:u,{index:h,range:f}=c,p=s.objectStore(e),d=h.isPrimaryKey?p:p.index(h.name),y=r(f);if(0===u)return o({result:[]});if(t){const t=a?d.getAll(y,l):d.getAllKeys(y,l);t.onsuccess=t=>o({result:t.target.result}),t.onerror=An(i)}else{let t=0;const e=a||!("openKeyCursor"in d)?d.openCursor(y):d.openKeyCursor(y),n=[];e.onsuccess=r=>{const i=e.result;return i?(n.push(a?i.value:i.primaryKey),++t===u?o({result:n}):void i.continue()):o({result:n})},e.onerror=An(i)}})}(i),openCursor:function({trans:t,values:n,query:o,reverse:i,unique:s}){return new Promise((a,u)=>{a=ve(a);const{index:c,range:l}=o,h=t.objectStore(e),f=c.isPrimaryKey?h:h.index(c.name),p=i?s?"prevunique":"prev":s?"nextunique":"next",d=n||!("openKeyCursor"in f)?f.openCursor(r(l),p):f.openKeyCursor(r(l),p);d.onerror=An(u),d.onsuccess=ve(e=>{const n=d.result;if(!n)return void a(null);n.___id=++Un,n.done=!1;const r=n.continue.bind(n);let o=n.continuePrimaryKey;o&&(o=o.bind(n));const i=n.advance.bind(n),s=()=>{throw new Error("Cursor not stopped")};n.trans=t,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=ve(u),n.next=function(){let t=1;return this.start(()=>t--?this.continue():this.stop()).then(()=>this)},n.start=t=>{const e=new Promise((t,e)=>{t=ve(t),d.onerror=An(e),n.fail=e,n.stop=e=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=s,t(e)}}),a=()=>{if(d.result)try{t()}catch(t){n.fail(t)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return d.onsuccess=ve(t=>{d.onsuccess=a,a()}),n.continue=r,n.continuePrimaryKey=o,n.advance=i,a(),e},a(n)},u)})},count({query:t,trans:n}){const{index:o,range:i}=t;return new Promise((t,s)=>{const a=n.objectStore(e),u=o.isPrimaryKey?a:a.index(o.name),c=r(i),l=c?u.count(c):u.count();l.onsuccess=ve(e=>t(e.target.result)),l.onerror=An(s)})}}}(t)),a={};return s.forEach(t=>a[t.name]=t),{stack:"dbcore",transaction:t.transaction.bind(t),table(t){if(!a[t])throw new Error(`Table '${t}' not found`);return a[t]},MIN_KEY:-1/0,MAX_KEY:$n(e),schema:o}}(e,n,o),t.dbcore);return{dbcore:i}}(t._middlewares,n,t._deps,e);t.core=r.dbcore,t.tables.forEach(e=>{const n=e.name;t.core.schema.tables.some(t=>t.name===n)&&(e.core=t.core.table(n),t[n]instanceof t.Table&&(t[n].core=e.core))})}function Kn({_novip:t},e,n,r){n.forEach(n=>{const o=r[n];e.forEach(e=>{const r=B(e,n);(!r||"value"in r&&void 0===r.value)&&(e===t.Transaction.prototype||e instanceof t.Transaction?D(e,n,{get(){return this.table(n)},set(t){R(this,n,{value:t,writable:!0,configurable:!0,enumerable:!0})}}):e[n]=new t.Table(n,o))})})}function Wn({_novip:t},e){e.forEach(e=>{for(let n in e)e[n]instanceof t.Table&&delete e[n]})}function qn(t,e){return t._cfg.version-e._cfg.version}function zn(t,e){const n={del:[],add:[],change:[]};let r;for(r in t)e[r]||n.del.push(r);for(r in e){const o=t[r],i=e[r];if(o){const t={name:r,def:i,recreate:!1,del:[],add:[],change:[]};if(""+(o.primKey.keyPath||"")!=""+(i.primKey.keyPath||"")||o.primKey.auto!==i.primKey.auto&&!He)t.recreate=!0,n.change.push(t);else{const e=o.idxByName,r=i.idxByName;let s;for(s in e)r[s]||t.del.push(s);for(s in r){const n=e[s],o=r[s];n?n.src!==o.src&&t.change.push(o):t.add.push(o)}(t.del.length>0||t.add.length>0||t.change.length>0)&&n.change.push(t)}}else n.add.push([r,i])}return n}function Hn(t,e,n,r){const o=t.db.createObjectStore(e,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach(t=>Gn(o,t)),o}function Gn(t,e){t.createIndex(e.name,e.keyPath,{unique:e.unique,multiEntry:e.multi})}function Yn(t,e,n){const r={};return V(e.objectStoreNames,0).forEach(t=>{const e=n.objectStore(t);let o=e.keyPath;const i=Mn(Rn(o),o||"",!1,!1,!!e.autoIncrement,o&&"string"!=typeof o,!0),s=[];for(let t=0;t<e.indexNames.length;++t){const n=e.index(e.indexNames[t]);o=n.keyPath;var a=Mn(n.name,o,!!n.unique,!!n.multiEntry,!1,o&&"string"!=typeof o,!1);s.push(a)}r[t]=Dn(t,i,s)}),r}function Jn({_novip:t},e,n){const r=n.db.objectStoreNames;for(let o=0;o<r.length;++o){const i=r[o],s=n.objectStore(i);t._hasGetAll="getAll"in s;for(let t=0;t<s.indexNames.length;++t){const n=s.indexNames[t],r=s.index(n).keyPath,o="string"==typeof r?r:"["+V(r).join("+")+"]";if(e[i]){const t=e[i].idxByName[o];t&&(t.name=n,delete e[i].idxByName[o],e[i].idxByName[n]=t)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&j.WorkerGlobalScope&&j instanceof j.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(t._hasGetAll=!1)}class Qn{_parseStoresSpec(t,e){A(t).forEach(n=>{if(null!==t[n]){var r=t[n].split(",").map((t,e)=>{const n=(t=t.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return Mn(n,r||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),k(r),0===e)}),o=r.shift();if(o.multi)throw new St.Schema("Primary key cannot be multi-valued");r.forEach(t=>{if(t.auto)throw new St.Schema("Only primary key can be marked as autoIncrement (++)");if(!t.keyPath)throw new St.Schema("Index must have a name and cannot be an empty string")}),e[n]=Dn(n,o,r)}})}stores(t){const e=this.db;this._cfg.storesSource=this._cfg.storesSource?C(this._cfg.storesSource,t):t;const n=e._versions,r={};let o={};return n.forEach(t=>{C(r,t._cfg.storesSource),o=t._cfg.dbschema={},t._parseStoresSpec(r,o)}),e._dbSchema=o,Wn(e,[e._allTables,e,e.Transaction.prototype]),Kn(e,[e._allTables,e,e.Transaction.prototype,this._cfg.tables],A(o),o),e._storeNames=A(o),this}upgrade(t){return this._cfg.contentUpgrade=Rt(this._cfg.contentUpgrade||jt,t),this}}function Xn(t,e){let n=t._dbNamesDB;return n||(n=t._dbNamesDB=new gr(Qe,{addons:[],indexedDB:t,IDBKeyRange:e}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function Zn(t){return t&&"function"==typeof t.databases}function tr(t){return Ee(function(){return Zt.letThrough=!0,t()})}function er(){var t;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){var n=function(){return indexedDB.databases().finally(e)};t=setInterval(n,100),n()}).finally(function(){return clearInterval(t)}):Promise.resolve()}function nr(t){var e=e=>t.next(e),n=o(e),r=o(e=>t.throw(e));function o(t){return e=>{var o=t(e),i=o.value;return o.done?i:i&&"function"==typeof i.then?i.then(n,r):k(i)?Promise.all(i).then(n,r):n(i)}}return o(e)()}function rr(t,e,n){var r=arguments.length;if(r<2)throw new St.InvalidArgument("Too few arguments");for(var o=new Array(r-1);--r;)o[r-1]=arguments[r];return n=o.pop(),[t,J(o),n]}function or(t,e,n,r,o){return re.resolve().then(()=>{const i=Zt.transless||Zt,s=t._createTransaction(e,n,t._dbSchema,r),a={trans:s,transless:i};if(r)s.idbtrans=r.idbtrans;else try{s.create(),t._state.PR1398_maxLoop=3}catch(r){return r.name===xt.InvalidState&&t.isOpen()&&--t._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),t._close(),t.open().then(()=>or(t,e,n,null,o))):Be(r)}const u=ut(o);let c;u&&Pe();const l=re.follow(()=>{if(c=o.call(s,s),c)if(u){var t=je.bind(null,null);c.then(t,t)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=nr(c))},a);return(c&&"function"==typeof c.then?re.resolve(c).then(t=>s.active?t:Be(new St.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))):l.then(()=>c)).then(t=>(r&&s._resolve(),s._completion.then(()=>t))).catch(t=>(s._reject(t),Be(t)))})}function ir(t,e,n){const r=k(t)?t.slice():[t];for(let t=0;t<n;++t)r.push(e);return r}const sr={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(t){return{...t,table(e){const n=t.table(e),{schema:r}=n,o={},i=[];function s(t,e,n){const r=Vn(t),a=o[r]=o[r]||[],u=null==t?0:"string"==typeof t?1:t.length,c=e>0,l={...n,isVirtual:c,keyTail:e,keyLength:u,extractKey:Ln(t),unique:!c&&n.unique};return a.push(l),l.isPrimaryKey||i.push(l),u>1&&s(2===u?t[0]:t.slice(0,u-1),e+1,n),a.sort((t,e)=>t.keyTail-e.keyTail),l}const a=s(r.primaryKey.keyPath,0,r.primaryKey);o[":id"]=[a];for(const t of r.indexes)s(t.keyPath,0,t);function u(e){const n=e.query.index;return n.isVirtual?{...e,query:{index:n,range:(r=e.query.range,o=n.keyTail,{type:1===r.type?2:r.type,lower:ir(r.lower,r.lowerOpen?t.MAX_KEY:t.MIN_KEY,o),lowerOpen:!0,upper:ir(r.upper,r.upperOpen?t.MIN_KEY:t.MAX_KEY,o),upperOpen:!0})}}:e;var r,o}const c={...n,schema:{...r,primaryKey:a,indexes:i,getIndexByKeyPath:function(t){const e=o[Vn(t)];return e&&e[0]}},count:t=>n.count(u(t)),query:t=>n.query(u(t)),openCursor(e){const{keyTail:r,isVirtual:o,keyLength:i}=e.query.index;return o?n.openCursor(u(e)).then(n=>n&&function(n){const o=Object.create(n,{continue:{value:function(o){null!=o?n.continue(ir(o,e.reverse?t.MAX_KEY:t.MIN_KEY,r)):e.unique?n.continue(n.key.slice(0,i).concat(e.reverse?t.MIN_KEY:t.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(e,o){n.continuePrimaryKey(ir(e,t.MAX_KEY,r),o)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const t=n.key;return 1===i?t[0]:t.slice(0,i)}},value:{get:()=>n.value}});return o}(n)):n.openCursor(e)}};return c}}}};function ar(t,e,n,r){return n=n||{},r=r||"",A(t).forEach(o=>{if(I(e,o)){var i=t[o],s=e[o];if("object"==typeof i&&"object"==typeof s&&i&&s){const t=rt(i);t!==rt(s)?n[r+o]=e[o]:"Object"===t?ar(i,s,n,r+o+"."):i!==s&&(n[r+o]=e[o])}else i!==s&&(n[r+o]=e[o])}else n[r+o]=void 0}),A(e).forEach(o=>{I(t,o)||(n[r+o]=e[o])}),n}const ur={stack:"dbcore",name:"HooksMiddleware",level:2,create:t=>({...t,table(e){const n=t.table(e),{primaryKey:r}=n.schema,o={...n,mutate(t){const o=Zt.trans,{deleting:i,creating:s,updating:a}=o.table(e).hook;switch(t.type){case"add":if(s.fire===jt)break;return o._promise("readwrite",()=>u(t),!0);case"put":if(s.fire===jt&&a.fire===jt)break;return o._promise("readwrite",()=>u(t),!0);case"delete":if(i.fire===jt)break;return o._promise("readwrite",()=>u(t),!0);case"deleteRange":if(i.fire===jt)break;return o._promise("readwrite",()=>function(t){return c(t.trans,t.range,1e4)}(t),!0)}return n.mutate(t);function u(t){const e=Zt.trans,o=t.keys||function(t,e){return"delete"===e.type?e.keys:e.keys||e.values.map(t.extractKey)}(r,t);if(!o)throw new Error("Keys missing");return"delete"!==(t="add"===t.type||"put"===t.type?{...t,keys:o}:{...t}).type&&(t.values=[...t.values]),t.keys&&(t.keys=[...t.keys]),function(t,e,n){return"add"===e.type?Promise.resolve([]):t.getMany({trans:e.trans,keys:n,cache:"immutable"})}(n,t,o).then(u=>{const c=o.map((n,o)=>{const c=u[o],l={onerror:null,onsuccess:null};if("delete"===t.type)i.fire.call(l,n,c,e);else if("add"===t.type||void 0===c){const i=s.fire.call(l,n,t.values[o],e);null==n&&null!=i&&(n=i,t.keys[o]=n,r.outbound||H(t.values[o],r.keyPath,n))}else{const r=ar(c,t.values[o]),i=a.fire.call(l,r,n,c,e);if(i){const e=t.values[o];Object.keys(i).forEach(t=>{I(e,t)?e[t]=i[t]:H(e,t,i[t])})}}return l});return n.mutate(t).then(({failures:e,results:n,numFailures:r,lastResult:i})=>{for(let r=0;r<o.length;++r){const i=n?n[r]:o[r],s=c[r];null==i?s.onerror&&s.onerror(e[r]):s.onsuccess&&s.onsuccess("put"===t.type&&u[r]?t.values[r]:i)}return{failures:e,results:n,numFailures:r,lastResult:i}}).catch(t=>(c.forEach(e=>e.onerror&&e.onerror(t)),Promise.reject(t)))})}function c(t,e,o){return n.query({trans:t,values:!1,query:{index:r,range:e},limit:o}).then(({result:n})=>u({type:"delete",keys:n,trans:t}).then(r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<o?{failures:[],numFailures:0,lastResult:void 0}:c(t,{...e,lower:n[n.length-1],lowerOpen:!0},o)))}}};return o}})};function cr(t,e,n){try{if(!e)return null;if(e.keys.length<t.length)return null;const r=[];for(let o=0,i=0;o<e.keys.length&&i<t.length;++o)0===dn(e.keys[o],t[i])&&(r.push(n?tt(e.values[o]):e.values[o]),++i);return r.length===t.length?r:null}catch(t){return null}}const lr={stack:"dbcore",level:-1,create:t=>({table:e=>{const n=t.table(e);return{...n,getMany:t=>{if(!t.cache)return n.getMany(t);const e=cr(t.keys,t.trans._cache,"clone"===t.cache);return e?re.resolve(e):n.getMany(t).then(e=>(t.trans._cache={keys:t.keys,values:"clone"===t.cache?tt(e):e},e))},mutate:t=>("add"!==t.type&&(t.trans._cache=null),n.mutate(t))}}})};function hr(t){return!("from"in t)}const fr=function(t,e){if(!this){const e=new fr;return t&&"d"in t&&C(e,t),e}C(this,arguments.length?{d:1,from:t,to:arguments.length>1?e:t}:{d:0})};function pr(t,e,n){const r=dn(e,n);if(isNaN(r))return;if(r>0)throw RangeError();if(hr(t))return C(t,{from:e,to:n,d:1});const o=t.l,i=t.r;if(dn(n,t.from)<0)return o?pr(o,e,n):t.l={from:e,to:n,d:1,l:null,r:null},br(t);if(dn(e,t.to)>0)return i?pr(i,e,n):t.r={from:e,to:n,d:1,l:null,r:null},br(t);dn(e,t.from)<0&&(t.from=e,t.l=null,t.d=i?i.d+1:1),dn(n,t.to)>0&&(t.to=n,t.r=null,t.d=t.l?t.l.d+1:1);const s=!t.r;o&&!t.l&&dr(t,o),i&&s&&dr(t,i)}function dr(t,e){hr(e)||function t(e,{from:n,to:r,l:o,r:i}){pr(e,n,r),o&&t(e,o),i&&t(e,i)}(t,e)}function yr(t){let e=hr(t)?null:{s:0,n:t};return{next(t){const n=arguments.length>0;for(;e;)switch(e.s){case 0:if(e.s=1,n)for(;e.n.l&&dn(t,e.n.from)<0;)e={up:e,n:e.n.l,s:1};else for(;e.n.l;)e={up:e,n:e.n.l,s:1};case 1:if(e.s=2,!n||dn(t,e.n.to)<=0)return{value:e.n,done:!1};case 2:if(e.n.r){e.s=3,e={up:e,n:e.n.r,s:0};continue}case 3:e=e.up}return{done:!0}}}}function br(t){var e,n;const r=((null===(e=t.r)||void 0===e?void 0:e.d)||0)-((null===(n=t.l)||void 0===n?void 0:n.d)||0),o=r>1?"r":r<-1?"l":"";if(o){const e="r"===o?"l":"r",n={...t},r=t[o];t.from=r.from,t.to=r.to,t[o]=r[o],n[o]=r[e],t[e]=n,n.d=mr(n)}t.d=mr(t)}function mr({r:t,l:e}){return(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}M(fr.prototype,{add(t){return dr(this,t),this},addKey(t){return pr(this,t,t),this},addKeys(t){return t.forEach(t=>pr(this,t,t)),this},[ot](){return yr(this)}});const vr={stack:"dbcore",level:0,create:t=>{const e=t.schema.name,n=new fr(t.MIN_KEY,t.MAX_KEY);return{...t,table:r=>{const o=t.table(r),{schema:i}=o,{primaryKey:s}=i,{extractKey:a,outbound:u}=s,c={...o,mutate:t=>{const s=t.trans,a=s.mutatedParts||(s.mutatedParts={}),u=t=>{const n=`idb://${e}/${r}/${t}`;return a[n]||(a[n]=new fr)},c=u(""),l=u(":dels"),{type:h}=t;let[f,p]="deleteRange"===t.type?[t.range]:"delete"===t.type?[t.keys]:t.values.length<50?[[],t.values]:[];const d=t.trans._cache;return o.mutate(t).then(t=>{if(k(f)){"delete"!==h&&(f=t.results),c.addKeys(f);const e=cr(f,d);e||"add"===h||l.addKeys(f),(e||p)&&function(t,e,n,r){e.indexes.forEach(function(e){const o=t(e.name||"");function i(t){return null!=t?e.extractKey(t):null}const s=t=>e.multiEntry&&k(t)?t.forEach(t=>o.addKey(t)):o.addKey(t);(n||r).forEach((t,e)=>{const o=n&&i(n[e]),a=r&&i(r[e]);0!==dn(o,a)&&(null!=o&&s(o),null!=a&&s(a))})})}(u,i,e,p)}else if(f){const t={from:f.lower,to:f.upper};l.add(t),c.add(t)}else c.add(n),l.add(n),i.indexes.forEach(t=>u(t.name).add(n));return t})}},l=({query:{index:e,range:n}})=>{var r,o;return[e,new fr(null!==(r=n.lower)&&void 0!==r?r:t.MIN_KEY,null!==(o=n.upper)&&void 0!==o?o:t.MAX_KEY)]},h={get:t=>[s,new fr(t.key)],getMany:t=>[s,(new fr).addKeys(t.keys)],count:l,query:l,openCursor:l};return A(h).forEach(t=>{c[t]=function(i){const{subscr:s}=Zt;if(s){const c=t=>{const n=`idb://${e}/${r}/${t}`;return s[n]||(s[n]=new fr)},l=c(""),f=c(":dels"),[p,d]=h[t](i);if(c(p.name||"").add(d),!p.isPrimaryKey){if("count"!==t){const e="query"===t&&u&&i.values&&o.query({...i,values:!1});return o[t].apply(this,arguments).then(n=>{if("query"===t){if(u&&i.values)return e.then(({result:t})=>(l.addKeys(t),n));const t=i.values?n.result.map(a):n.result;i.values?l.addKeys(t):f.addKeys(t)}else if("openCursor"===t){const t=n,e=i.values;return t&&Object.create(t,{key:{get:()=>(f.addKey(t.primaryKey),t.key)},primaryKey:{get(){const e=t.primaryKey;return f.addKey(e),e}},value:{get:()=>(e&&l.addKey(t.primaryKey),t.value)}})}return n})}f.add(n)}}return o[t].apply(this,arguments)}}),c}}}};class gr{constructor(t,e){this._middlewares={},this.verno=0;const n=gr.dependencies;this._options=e={addons:gr.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...e},this._deps={indexedDB:e.indexedDB,IDBKeyRange:e.IDBKeyRange};const{addons:r}=e;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const o={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:jt,dbReadyPromise:null,cancelOpen:jt,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var i;o.dbReadyPromise=new re(t=>{o.dbReadyResolve=t}),o.openCanceller=new re((t,e)=>{o.cancelOpen=e}),this._state=o,this.name=t,this.on=on(this,"populate","blocked","versionchange","close",{ready:[Rt,jt]}),this.on.ready.subscribe=F(this.on.ready.subscribe,t=>(e,n)=>{gr.vip(()=>{const r=this._state;if(r.openComplete)r.dbOpenError||re.resolve().then(e),n&&t(e);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(e),n&&t(e);else{t(e);const r=this;n||t(function t(){r.on.ready.unsubscribe(e),r.on.ready.unsubscribe(t)})}})}),this.Collection=(i=this,sn(mn.prototype,function(t,e){this.db=i;let n=en,r=null;if(e)try{n=e()}catch(t){r=t}const o=t._ctx,s=o.table,a=s.hook.reading.fire;this._ctx={table:s,index:o.index,isPrimKey:!o.index||s.schema.primKey.keyPath&&o.index===s.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!==At?a:null}})),this.Table=function(t){return sn(rn.prototype,function(e,n,r){this.db=t,this._tx=r,this.name=e,this.schema=n,this.hook=t._allTables[e]?t._allTables[e].hook:on(null,{creating:[Tt,jt],reading:[kt,At],updating:[It,jt],deleting:[Nt,jt]})})}(this),this.Transaction=function(t){return sn(In.prototype,function(e,n,r,o,i){this.db=t,this.mode=e,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=o,this.idbtrans=null,this.on=on(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 re((t,e)=>{this._resolve=t,this._reject=e}),this._completion.then(()=>{this.active=!1,this.on.complete.fire()},t=>{var e=this.active;return this.active=!1,this.on.error.fire(t),this.parent?this.parent._reject(t):e&&this.idbtrans&&this.idbtrans.abort(),Be(t)})})}(this),this.Version=function(t){return sn(Qn.prototype,function(e){this.db=t,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})}(this),this.WhereClause=function(t){return sn(jn.prototype,function(e,n,r){this.db=t,this._ctx={table:e,index:":id"===n?null:n,or:r};const o=t._deps.indexedDB;if(!o)throw new St.MissingAPI;this._cmp=this._ascending=o.cmp.bind(o),this._descending=(t,e)=>o.cmp(e,t),this._max=(t,e)=>o.cmp(t,e)>0?t:e,this._min=(t,e)=>o.cmp(t,e)<0?t:e,this._IDBKeyRange=t._deps.IDBKeyRange})}(this),this.on("versionchange",t=>{t.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()}),this.on("blocked",t=>{!t.newVersion||t.newVersion<t.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${t.oldVersion/10}`)}),this._maxKey=$n(e.IDBKeyRange),this._createTransaction=(t,e,n,r)=>new this.Transaction(t,e,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=t=>{this.on("blocked").fire(t),ze.filter(t=>t.name===this.name&&t!==this&&!t._state.vcFired).map(e=>e.on("versionchange").fire(t))},this.use(sr),this.use(ur),this.use(vr),this.use(lr),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach(t=>t(this))}version(t){if(isNaN(t)||t<.1)throw new St.Type("Given version is not a positive number");if(t=Math.round(10*t)/10,this.idbdb||this._state.isBeingOpened)throw new St.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,t);const e=this._versions;var n=e.filter(e=>e._cfg.version===t)[0];return n||(n=new this.Version(t),e.push(n),e.sort(qn),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(t){return this.idbdb&&(this._state.openComplete||Zt.letThrough||this._vip)?t():new re((t,e)=>{if(this._state.openComplete)return e(new St.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void e(new St.DatabaseClosed);this.open().catch(jt)}this._state.dbReadyPromise.then(t,e)}).then(t)}use({stack:t,create:e,level:n,name:r}){r&&this.unuse({stack:t,name:r});const o=this._middlewares[t]||(this._middlewares[t]=[]);return o.push({stack:t,create:e,level:null==n?10:n,name:r}),o.sort((t,e)=>t.level-e.level),this}unuse({stack:t,name:e,create:n}){return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(t=>n?t.create!==n:!!e&&t.name!==e)),this}open(){return function(t){const e=t._state,{indexedDB:n}=t._deps;if(e.isBeingOpened||t.idbdb)return e.dbReadyPromise.then(()=>e.dbOpenError?Be(e.dbOpenError):t);ct&&(e.openCanceller._stackHolder=pt()),e.isBeingOpened=!0,e.dbOpenError=null,e.openComplete=!1;const r=e.openCanceller;function o(){if(e.openCanceller!==r)throw new St.DatabaseClosed("db.open() was cancelled")}let i=e.dbReadyResolve,s=null,a=!1;const u=()=>new re((r,i)=>{if(o(),!n)throw new St.MissingAPI;const u=t.name,c=e.autoSchema?n.open(u):n.open(u,Math.round(10*t.verno));if(!c)throw new St.MissingAPI;c.onerror=An(i),c.onblocked=ve(t._fireOnBlocked),c.onupgradeneeded=ve(r=>{if(s=c.transaction,e.autoSchema&&!t._options.allowEmptyDB){c.onerror=kn,s.abort(),c.result.close();const t=n.deleteDatabase(u);t.onsuccess=t.onerror=ve(()=>{i(new St.NoSuchDatabase(`Database ${u} doesnt exist`))})}else{s.onerror=An(i);var o=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=o<1,t._novip.idbdb=c.result,function(t,e,n,r){const o=t._dbSchema,i=t._createTransaction("readwrite",t._storeNames,o);i.create(n),i._completion.catch(r);const s=i._reject.bind(i),a=Zt.transless||Zt;Ee(()=>{Zt.trans=i,Zt.transless=a,0===e?(A(o).forEach(t=>{Hn(n,t,o[t].primKey,o[t].indexes)}),Fn(t,n),re.follow(()=>t.on.populate.fire(i)).catch(s)):function({_novip:t},e,n,r){const o=[],i=t._versions;let s=t._dbSchema=Yn(0,t.idbdb,r),a=!1;const u=i.filter(t=>t._cfg.version>=e);return u.forEach(i=>{o.push(()=>{const o=s,u=i._cfg.dbschema;Jn(t,o,r),Jn(t,u,r),s=t._dbSchema=u;const c=zn(o,u);c.add.forEach(t=>{Hn(r,t[0],t[1].primKey,t[1].indexes)}),c.change.forEach(t=>{if(t.recreate)throw new St.Upgrade("Not yet support for changing primary key");{const e=r.objectStore(t.name);t.add.forEach(t=>Gn(e,t)),t.change.forEach(t=>{e.deleteIndex(t.name),Gn(e,t)}),t.del.forEach(t=>e.deleteIndex(t))}});const l=i._cfg.contentUpgrade;if(l&&i._cfg.version>e){Fn(t,r),n._memoizedTables={},a=!0;let e=G(u);c.del.forEach(t=>{e[t]=o[t]}),Wn(t,[t.Transaction.prototype]),Kn(t,[t.Transaction.prototype],A(e),e),n.schema=e;const i=ut(l);let s;i&&Pe();const h=re.follow(()=>{if(s=l(n),s&&i){var t=je.bind(null,null);s.then(t,t)}});return s&&"function"==typeof s.then?re.resolve(s):h.then(()=>s)}}),o.push(e=>{a&&Ge||function(t,e){[].slice.call(e.db.objectStoreNames).forEach(n=>null==t[n]&&e.db.deleteObjectStore(n))}(i._cfg.dbschema,e),Wn(t,[t.Transaction.prototype]),Kn(t,[t.Transaction.prototype],t._storeNames,t._dbSchema),n.schema=t._dbSchema})}),function t(){return o.length?re.resolve(o.shift()(n.idbtrans)).then(t):re.resolve()}().then(()=>{var t,e;e=r,A(t=s).forEach(n=>{e.db.objectStoreNames.contains(n)||Hn(e,n,t[n].primKey,t[n].indexes)})})}(t,e,i,n).catch(s)})}(t,o/10,s,i)}},i),c.onsuccess=ve(()=>{s=null;const n=t._novip.idbdb=c.result,o=V(n.objectStoreNames);if(o.length>0)try{const r=n.transaction(1===(i=o).length?i[0]:i,"readonly");e.autoSchema?function({_novip:t},e,n){t.verno=e.version/10;const r=t._dbSchema=Yn(0,e,n);t._storeNames=V(e.objectStoreNames,0),Kn(t,[t._allTables],A(r),r)}(t,n,r):(Jn(t,t._dbSchema,r),function(t,e){const n=zn(Yn(0,t.idbdb,e),t._dbSchema);return!(n.add.length||n.change.some(t=>t.add.length||t.change.length))}(t,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),Fn(t,r)}catch(t){}var i;ze.push(t),n.onversionchange=ve(n=>{e.vcFired=!0,t.on("versionchange").fire(n)}),n.onclose=ve(e=>{t.on("close").fire(e)}),a&&function({indexedDB:t,IDBKeyRange:e},n){!Zn(t)&&n!==Qe&&Xn(t,e).put({name:n}).catch(jt)}(t._deps,u),r()},i)}).catch(t=>t&&"UnknownError"===t.name&&e.PR1398_maxLoop>0?(e.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),u()):re.reject(t));return re.race([r,("undefined"==typeof navigator?re.resolve():er()).then(u)]).then(()=>(o(),e.onReadyBeingFired=[],re.resolve(tr(()=>t.on.ready.fire(t.vip))).then(function n(){if(e.onReadyBeingFired.length>0){let r=e.onReadyBeingFired.reduce(Rt,jt);return e.onReadyBeingFired=[],re.resolve(tr(()=>r(t.vip))).then(n)}}))).finally(()=>{e.onReadyBeingFired=null,e.isBeingOpened=!1}).then(()=>t).catch(n=>{e.dbOpenError=n;try{s&&s.abort()}catch(t){}return r===e.openCanceller&&t._close(),Be(n)}).finally(()=>{e.openComplete=!0,i()})}(this)}_close(){const t=this._state,e=ze.indexOf(this);if(e>=0&&ze.splice(e,1),this.idbdb){try{this.idbdb.close()}catch(t){}this._novip.idbdb=null}t.dbReadyPromise=new re(e=>{t.dbReadyResolve=e}),t.openCanceller=new re((e,n)=>{t.cancelOpen=n})}close(){this._close();const t=this._state;this._options.autoOpen=!1,t.dbOpenError=new St.DatabaseClosed,t.isBeingOpened&&t.cancelOpen(t.dbOpenError)}delete(){const t=arguments.length>0,e=this._state;return new re((n,r)=>{const o=()=>{this.close();var t=this._deps.indexedDB.deleteDatabase(this.name);t.onsuccess=ve(()=>{!function({indexedDB:t,IDBKeyRange:e},n){!Zn(t)&&n!==Qe&&Xn(t,e).delete(n).catch(jt)}(this._deps,this.name),n()}),t.onerror=An(r),t.onblocked=this._fireOnBlocked};if(t)throw new St.InvalidArgument("Arguments not allowed in db.delete()");e.isBeingOpened?e.dbReadyPromise.then(o):o()})}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const t=this._state.dbOpenError;return t&&"DatabaseClosed"===t.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return A(this._allTables).map(t=>this._allTables[t])}transaction(){const t=rr.apply(this,arguments);return this._transaction.apply(this,t)}_transaction(t,e,n){let r=Zt.trans;r&&r.db===this&&-1===t.indexOf("!")||(r=null);const o=-1!==t.indexOf("?");let i,s;t=t.replace("!","").replace("?","");try{if(s=e.map(t=>{var e=t instanceof this.Table?t.name:t;if("string"!=typeof e)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return e}),"r"==t||t===Xe)i=Xe;else{if("rw"!=t&&t!=Ze)throw new St.InvalidArgument("Invalid transaction mode: "+t);i=Ze}if(r){if(r.mode===Xe&&i===Ze){if(!o)throw new St.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&s.forEach(t=>{if(r&&-1===r.storeNames.indexOf(t)){if(!o)throw new St.SubTransaction("Table "+t+" not included in parent transaction.");r=null}}),o&&r&&!r.active&&(r=null)}}catch(t){return r?r._promise(null,(e,n)=>{n(t)}):Be(t)}const a=or.bind(null,this,i,s,r,n);return r?r._promise(i,a,"lock"):Zt.trans?Ie(Zt.transless,()=>this._whenReady(a)):this._whenReady(a)}table(t){if(!I(this._allTables,t))throw new St.InvalidTable(`Table ${t} does not exist`);return this._allTables[t]}}const _r="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class wr{constructor(t){this._subscribe=t}subscribe(t,e,n){return this._subscribe(t&&"function"!=typeof t?t:{next:t,error:e,complete:n})}[_r](){return this}}function xr(t,e){return A(e).forEach(n=>{dr(t[n]||(t[n]=new fr),e[n])}),t}let Or;try{Or={indexedDB:j.indexedDB||j.mozIndexedDB||j.webkitIndexedDB||j.msIndexedDB,IDBKeyRange:j.IDBKeyRange||j.webkitIDBKeyRange}}catch(i){Or={indexedDB:null,IDBKeyRange:null}}const Sr=gr;function Er(t){let e=Pr;try{Pr=!0,Nn.storagemutated.fire(t)}finally{Pr=e}}M(Sr,{...Pt,delete:t=>new Sr(t,{addons:[]}).delete(),exists:t=>new Sr(t,{addons:[]}).open().then(t=>(t.close(),!0)).catch("NoSuchDatabaseError",()=>!1),getDatabaseNames(t){try{return function({indexedDB:t,IDBKeyRange:e}){return Zn(t)?Promise.resolve(t.databases()).then(t=>t.map(t=>t.name).filter(t=>t!==Qe)):Xn(t,e).toCollection().primaryKeys()}(Sr.dependencies).then(t)}catch(t){return Be(new St.MissingAPI)}},defineClass:()=>function(t){C(this,t)},ignoreTransaction:t=>Zt.trans?Ie(Zt.transless,t):t(),vip:tr,async:function(t){return function(){try{var e=nr(t.apply(this,arguments));return e&&"function"==typeof e.then?e:re.resolve(e)}catch(t){return Be(t)}}},spawn:function(t,e,n){try{var r=nr(t.apply(n,e||[]));return r&&"function"==typeof r.then?r:re.resolve(r)}catch(t){return Be(t)}},currentTransaction:{get:()=>Zt.trans||null},waitFor:function(t,e){const n=re.resolve("function"==typeof t?Sr.ignoreTransaction(t):t).timeout(e||6e4);return Zt.trans?Zt.trans.waitFor(n):n},Promise:re,debug:{get:()=>ct,set:t=>{lt(t,"dexie"===t?()=>!0:Je)}},derive:$,extend:C,props:M,override:F,Events:on,on:Nn,liveQuery:function(t){let e,n=!1;const r=new wr(r=>{const o=ut(t);let i=!1,s={},a={};const u={get closed(){return i},unsubscribe:()=>{i=!0,Nn.storagemutated.unsubscribe(f)}};r.start&&r.start(u);let c=!1,l=!1;function h(){return A(a).some(t=>s[t]&&function(t,e){const n=yr(e);let r=n.next();if(r.done)return!1;let o=r.value;const i=yr(t);let s=i.next(o.from),a=s.value;for(;!r.done&&!s.done;){if(dn(a.from,o.to)<=0&&dn(a.to,o.from)>=0)return!0;dn(o.from,a.from)<0?o=(r=n.next(a.from)).value:a=(s=i.next(o.from)).value}return!1}(s[t],a[t]))}const f=t=>{xr(s,t),h()&&p()},p=()=>{if(c||i)return;s={};const d={},y=function(e){o&&Pe();const n=()=>Ee(t,{subscr:e,trans:null}),r=Zt.trans?Ie(Zt.transless,n):n();return o&&r.then(je,je),r}(d);l||(Nn(Cn,f),l=!0),c=!0,Promise.resolve(y).then(t=>{n=!0,e=t,c=!1,i||(h()?p():(s={},a=d,r.next&&r.next(t)))},t=>{c=!1,n=!1,r.error&&r.error(t),u.unsubscribe()})};return p(),u});return r.hasValue=()=>n,r.getValue=()=>e,r},extendObservabilitySet:xr,getByKeyPath:z,setByKeyPath:H,delByKeyPath:function(t,e){"string"==typeof e?H(t,e,void 0):"length"in e&&[].map.call(e,function(e){H(t,e,void 0)})},shallowClone:G,deepClone:tt,getObjectDiff:ar,cmp:dn,asap:W,minKey:Ke,addons:[],connections:ze,errnames:xt,dependencies:Or,semVer:Ve,version:Ve.split(".").map(t=>parseInt(t)).reduce((t,e,n)=>t+e/Math.pow(10,2*n))}),Sr.maxKey=$n(Sr.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Nn(Cn,t=>{if(!Pr){let e;He?(e=document.createEvent("CustomEvent"),e.initCustomEvent(Tn,!0,!0,t)):e=new CustomEvent(Tn,{detail:t}),Pr=!0,dispatchEvent(e),Pr=!1}}),addEventListener(Tn,({detail:t})=>{Pr||Er(t)}));let Pr=!1;if("undefined"!=typeof BroadcastChannel){const t=new BroadcastChannel(Tn);"function"==typeof t.unref&&t.unref(),Nn(Cn,e=>{Pr||t.postMessage(e)}),t.onmessage=t=>{t.data&&Er(t.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Nn(Cn,t=>{try{Pr||("undefined"!=typeof localStorage&&localStorage.setItem(Tn,JSON.stringify({trig:Math.random(),changedParts:t})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach(e=>e.postMessage({type:Tn,changedParts:t})))}catch(t){}}),"undefined"!=typeof addEventListener&&addEventListener("storage",t=>{if(t.key===Tn){const e=JSON.parse(t.newValue);e&&Er(e.changedParts)}});const t=self.document&&navigator.serviceWorker;t&&t.addEventListener("message",function({data:t}){t&&t.type===Tn&&Er(t.changedParts)})}re.rejectionMapper=function(t,e){if(!t||t instanceof vt||t instanceof TypeError||t instanceof SyntaxError||!t.name||!Et[t.name])return t;var n=new Et[t.name](e||t.message,t);return"stack"in t&&D(n,"stack",{get:function(){return this.inner.stack}}),n},lt(ct,Je);var jr=n(20367),Ar=n(23790);function kr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class Cr extends gr{constructor(){super("EsmOffline"),kr(this,"syncQueue",void 0),kr(this,"dynamicOfflineData",void 0),this.version(4).stores({syncQueue:"++id,userId,type,[userId+type]",dynamicOfflineData:"++id,type,identifier,*users,&[type+identifier]"}),this.syncQueue=this.table("syncQueue"),this.dynamicOfflineData=this.table("dynamicOfflineData")}}function Tr(){return new Cr}const Nr=new Cr,Ir={},Mr=(0,Ar.Zd)("offline-synchronization",{});function Rr(){return Mr}async function Dr(){if(Mr.getState().synchronization)return;const t=await Nr.syncQueue.count(),e={},n=Object.entries(Ir),r=n.length,o={},i=new AbortController,s=()=>{const t=Mr.getState().synchronization;Mr.setState({synchronization:{...t,pendingCount:t.pendingCount-1}})};try{Mr.setState({synchronization:{totalCount:t,pendingCount:t,abortController:i}});for(let t=0;t<r&&n.length>0;t++)for(let t=n.length;t--;){const[r,a]=n[t],u=a.dependsOn.map(t=>e[t]);u.every(Boolean)&&(o[r]={},await Promise.all(u),e[r]=$r(a,o,i,s),n.splice(t,1))}await Promise.allSettled(Object.values(e))}finally{Mr.setState({synchronization:void 0})}}async function $r({type:t,dependsOn:e,process:n},r,o,i){const s=[],a=[],u=await Lr();await Nr.syncQueue.where({type:t,userId:u}).each((t,e)=>{s.push([e.primaryKey,t.content,t.descriptor]),a.push(t.content)});for(let c=0;c<s.length;c++){const[l,h,{id:f,dependencies:p=[]}]=s[c];try{const i=await n(h,{abort:o,index:c,items:a,userId:u,dependencies:p.map(({id:t,type:n})=>e.includes(n)?r[n][t]:void 0)});void 0!==f&&(r[t][f]=i),await Nr.syncQueue.delete(l)}catch(t){await Nr.syncQueue.update(l,{lastError:{name:t?.name,message:t?.message??t?.toString()}})}finally{i()}}}async function Lr(){const t=await(0,jr.xC)();return t?.uuid||"*"}async function Br(t,e,n,r){const o=r&&r.id;return void 0!==o&&await Nr.syncQueue.where({type:e,userId:t}).filter(t=>t?.descriptor.id===o).delete().catch(gr.errnames.DatabaseClosed),await Nr.syncQueue.add({type:e,content:n,userId:t,descriptor:r||{},createdOn:new Date}).catch(gr.errnames.DatabaseClosed,()=>-1)}async function Ur(t,e,n){const r=await Lr();return await Br(r,t,e,n)}async function Vr(t,e){return(await Fr(t,e)).map(t=>t.content)}async function Fr(t,e){const n=e?{type:e,userId:t}:{userId:t};return await Nr.syncQueue.where(n).toArray().catch(gr.errnames.DatabaseClosed,()=>[])}async function Kr(t){const e=await Lr();return await Vr(e,t)}async function Wr(t){const e=await Lr();return await Fr(e,t)}async function qr(t){return await Nr.syncQueue.get(t).catch(gr.errnames.DatabaseClosed,()=>{})}function zr(t){return!!Ir[t]?.options.onBeginEditSyncItem}async function Hr(t){const e=await qr(t);if(!e)throw new Error(`No sync item with the ID ${t} exists.`);const n=Ir[e.type]?.options.onBeginEditSyncItem;if(!n)throw new Error(`A sync item with the ID ${t} 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 "${e.type}" supports editing items.`);n(e)}async function Gr(t){await Nr.syncQueue.delete(t).catch(gr.errnames.DatabaseClosed)}function Yr(t,e,n,r={}){Ir[t]={type:t,dependsOn:e,process:n,options:r}}const Jr={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Qr;const Xr=new Uint8Array(16);function Zr(){if(!Qr&&(Qr="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qr(Xr)}const to=[];for(let t=0;t<256;++t)to.push((t+256).toString(16).slice(1));const eo=function(t,e,n){if(Jr.randomUUID&&!e&&!t)return Jr.randomUUID();const r=(t=t||{}).random||(t.rng||Zr)();if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,e){n=n||0;for(let t=0;t<16;++t)e[n+t]=r[t];return e}return function(t,e=0){return to[t[e+0]]+to[t[e+1]]+to[t[e+2]]+to[t[e+3]]+"-"+to[t[e+4]]+to[t[e+5]]+"-"+to[t[e+6]]+to[t[e+7]]+"-"+to[t[e+8]]+to[t[e+9]]+"-"+to[t[e+10]]+to[t[e+11]]+to[t[e+12]]+to[t[e+13]]+to[t[e+14]]+to[t[e+15]]}(r)},no="OFFLINE+";function ro(){return no+eo()}function oo(t){return t.startsWith(no)}const io={};function so(){return Object.values(io)}function ao(t){io[t.id]&&console.warn(`[setupDynamicOfflineDataHandler] Another second handler with the ID "${t.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.`),io[t.id]=t}async function uo(t){const e=await mo();return await co(e,t)}async function co(t,e){const n=e?{type:e,users:t}:{users:t},r=new Cr;return await r.dynamicOfflineData.where(n).toArray().catch(gr.errnames.DatabaseClosed,()=>[])}async function lo(t,e){const n=await mo();return await ho(n,t,e)}async function ho(t,e,n){const r=new Cr,o=await r.dynamicOfflineData.get({type:e,identifier:n}).catch(gr.errnames.DatabaseClosed,()=>{});o?o.users.includes(t)||await r.dynamicOfflineData.update(o.id,{users:[...o.users,t]}).catch(gr.errnames.DatabaseClosed):await r.dynamicOfflineData.add({users:[t],type:e,identifier:n}).catch(gr.errnames.DatabaseClosed)}async function fo(t,e){const n=await mo();return await po(n,t,e)}async function po(t,e,n){const r=new Cr,o=await r.dynamicOfflineData.get({type:e,identifier:n,users:t}).catch(gr.errnames.DatabaseClosed,()=>{});o&&(o.users.length>1?await r.dynamicOfflineData.update(o.id,{users:o.users.filter(e=>e!==t)}).catch(gr.errnames.DatabaseClosed):await r.dynamicOfflineData.delete(o.id).catch(gr.errnames.DatabaseClosed))}async function yo(t,e){const n=await uo(t);await Promise.all(n.map(async t=>bo(t.type,t.identifier,e)))}async function bo(t,e,n){await lo(t,e);const r=new Cr,o=await mo(),i=await r.dynamicOfflineData.get({type:t,identifier:e}).catch(gr.errnames.DatabaseClosed,()=>{}),s=so().filter(e=>e.type===t);if(!i)return;const a=await Promise.all(s.map(async t=>{try{return t.sync(e,n),{id:t.id,error:void 0}}catch(e){const n=e.message?.toString()??e.toString();return{id:t.id,error:n}}})),u=a.filter(t=>!t.error).map(t=>t.id),c=a.filter(t=>t.error).map(t=>t.id),l=a.filter(t=>t.error).map(t=>({handlerId:t.id,message:t.error})),h={syncedOn:new Date,syncedBy:o,succeededHandlers:u,erroredHandlers:c,errors:l};i.id&&await r.dynamicOfflineData.update(i.id,{syncState:h}).catch(gr.errnames.DatabaseClosed)}async function mo(){const t=(await(0,jr.xC)()).uuid;if(!t)throw new Error("Using the dynamic offline data API requires a logged in user.");return t}const vo=(0,Ar.Zd)("offline-patients",{offlinePatientDataSyncState:{},handlers:{}});function go(){return xo(),vo}function _o(t,e){xo(),ao({type:"patient",displayName:e.displayName,id:t,isSynced:()=>Promise.resolve(!0),sync:(t,n)=>e.onOfflinePatientAdded({patientUuid:t,signal:n??(new AbortController).signal})})}async function wo(t){xo(),await bo("patient",t)}function xo(){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.")}},39933:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.retry=function(t){return void 0===t&&(t=-1),function(e){return e.lift(new s(t,e))}};var s=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.count,this.source))},t}(),a=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.count=n,o.source=r,o}return o(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(i.Subscriber)},41136:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(95092),a=n(89152),u=n(87778);e.delayWhen=function(t,e){return e?function(n){return new h(n,e).lift(new c(t))}:function(e){return e.lift(new c(t))}};var c=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.delayDurationSelector))},t}(),l=function(t){function e(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return o(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(t),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var n=u.subscribeToResult(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(a.OuterSubscriber),h=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return o(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new f(t,this.source))},e}(s.Observable),f=function(t){function e(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return o(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(i.Subscriber)},41534:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.takeUntil=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new a(t),r=i.innerSubscribe(this.notifier,new i.SimpleInnerSubscriber(n));return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),a=function(t){function e(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return o(e,t),e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(i.SimpleOuterSubscriber)},41727:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(422),o=n(63266),i=n(47429),s=n(13394),a=n(90624),u=n(94215),c=n(6727),l=n(78258),h=n(46713);e.subscribeTo=function(t){if(t&&"function"==typeof t[h.observable])return s.subscribeToObservable(t);if(a.isArrayLike(t))return r.subscribeToArray(t);if(u.isPromise(t))return o.subscribeToPromise(t);if(t&&"function"==typeof t[l.iterator])return i.subscribeToIterable(t);var e=c.isObject(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}},42748:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(86735),o=n(89233);e.timestamp=function(t){return void 0===t&&(t=r.async),o.map(function(e){return new i(e,t.now())})};var i=function(t,e){this.value=t,this.timestamp=e};e.Timestamp=i},42839:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=1,r=Promise.resolve(),o={};function i(t){return t in o&&(delete o[t],!0)}e.Immediate={setImmediate:function(t){var e=n++;return o[e]=!0,r.then(function(){return i(e)&&t()}),e},clearImmediate:function(t){i(t)}},e.TestTools={pending:function(){return Object.keys(o).length}}},42853:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(43944);const o=function(t,e){return(0,r.A)(t,e)}},43132:(t,e,n)=>{"use strict";n.d(e,{y:()=>o});const r=t=>{let e;const n=new Set,r=(t,r)=>{const o="function"==typeof t?t(e):t;if(!Object.is(o,e)){const t=e;e=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},e,o),n.forEach(n=>n(e,t))}},o=()=>e,i={setState:r,getState:o,getInitialState:()=>s,subscribe:t=>(n.add(t),()=>n.delete(t)),destroy:()=>{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()}},s=e=t(r,o,i);return i},o=t=>t?r(t):r},43381:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(21016),s=n(87778),a=n(89152);e.bufferToggle=function(t,e){return function(n){return n.lift(new u(t,e))}};var u=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.openings,this.closingSelector))},t}(),c=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.closingSelector=r,o.contexts=[],o.add(s.subscribeToResult(o,n)),o}return o(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r<n;r++)e[r].buffer.push(t)},e.prototype._error=function(e){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new i.Subscription,r={buffer:[],subscription:n};e.push(r);var o=s.subscribeToResult(this,t,r);!o||o.closed?this.closeBuffer(r):(o.context=r,this.add(o),n.add(o))},e}(a.OuterSubscriber)},43670:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(88179);e.distinctUntilKeyChanged=function(t,e){return r.distinctUntilChanged(function(n,r){return e?e(n[t],r[t]):n[t]===r[t]})}},43716:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return o(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n(21016).Subscription);e.SubjectSubscription=i},44856:(t,e,n)=>{"use strict";function r(t){setTimeout(function(){throw t},0)}n.d(e,{T:()=>r})},45276:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(85295),s=n(80743),a=n(75901);e.onErrorResumeNext=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&s.isArray(t[0])&&(t=t[0]),function(e){return e.lift(new u(t))}},e.onErrorResumeNextStatic=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n;return 1===t.length&&s.isArray(t[0])&&(t=t[0]),n=t.shift(),i.from(n).lift(new u(t))};var u=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.nextSources))},t}(),c=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return o(e,t),e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new a.SimpleInnerSubscriber(this),n=this.destination;n.add(e);var r=a.innerSubscribe(t,e);r!==e&&n.add(r)}else this.destination.complete()},e}(a.SimpleOuterSubscriber)},46713:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.observable="function"==typeof Symbol&&Symbol.observable||"@@observable"},47429:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(78258);e.subscribeToIterable=function(t){return function(e){for(var n=t[r.iterator]();;){var o=void 0;try{o=n.next()}catch(t){return e.error(t),e}if(o.done){e.complete();break}if(e.next(o.value),e.closed)break}return"function"==typeof n.return&&e.add(function(){n.return&&n.return()}),e}}},47986:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(23935),o=n(67446),i=n(85791);e.of=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return r.isScheduler(n)?(t.pop(),i.scheduleArray(t,n)):o.fromArray(t)}},49184:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(49529),o=n(85203),i=n(71077);function s(){return new i.Subject}e.share=function(){return function(t){return o.refCount()(r.multicast(s)(t))}}},49529:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(27432);e.multicast=function(t,e){return function(n){var i;if(i="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new o(i,e));var s=Object.create(n,r.connectableObservableDescriptor);return s.source=n,s.subjectFactory=i,s}};var o=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),o=n(r).subscribe(t);return o.add(e.subscribe(r)),o},t}();e.MulticastOperator=o},50103:(t,e,n)=>{"use strict";n.d(e,{V:()=>J,t:()=>Y});const r={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",district:"District",postalCode:"Postal code",state:"State",stateProvince:"State",closeAllOpenedWorkspaces:"Discard changes in {{count}} workspaces",closingAllWorkspacesPromptBody:"There may be 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 may have unsaved changes in the opened workspace. Do you want to discard these changes?",unsavedChangesInWorkspace:'There may be unsaved changes in "{{workspaceName}}". Please save them before opening another workspace.',unsavedChangesTitleText:"Unsaved changes",workspaceHeader:"Workspace header",closeWorkspaces2PromptTitle:"Close workspace(s)",closeWorkspaces2PromptBody:"You are about to close the following workspace(s), which might have unsaved changes:",actions:"Actions",actionableNotification:"Actionable notification",address:"Address",age:"Age",cancel:"Cancel",change:"Change",Clinic:"Clinic",close:"Close",closesActionableNotification:"Closes actionable notification",closeSnackbar:"Close snackbar",confirm:"Confirm",contactAdministratorIfIssuePersists:"Contact your system administrator if the problem persists.",contactDetails:"Contact details",delete:"Delete",discardChanges:"Discard changes",edit:"Edit",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.",errorLoadingLoginLocations:"Unable to load login locations. Please try again or contact support if the problem persists.",female:"Female",leftNavigation:"Left navigation",loading:"Loading",male:"Male",noResultsToDisplay:"No results to display",other:"Other",patientAvatarAlt:"Avatar for {{patientName}}",patientIdentifierSticker:"Patient identifier sticker",patientLists:"Patient lists",patientPhotoAlt:"Profile photo of {{patientName}}",patientPhotoPlaceholder:"Photo placeholder for {{patientName}}",print:"Print",printError:"Print error",printErrorExplainer:"An error occurred in {{errorLocation}}",printIdentifierSticker:"Print identifier sticker",printing:"Printing",relationships:"Relationships",resetOverrides:"Reset overrides",save:"Save",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.",searchForLocation:"Search for a location",seeMoreLists:"See {{count}} more lists",sex:"Sex",showLess:"Show less",showMore:"Show more",snackbarNotification:"Snackbar notification",toggleDevTools:"Toggle dev tools",unknown:"Unknown",yearAbbreviation:"yr",yearsAbbreviation:"yrs"},o=t=>"string"==typeof t,i=()=>{let t,e;const n=new Promise((n,r)=>{t=n,e=r});return n.resolve=t,n.reject=e,n},s=t=>null==t?"":""+t,a=/###/g,u=t=>t&&t.indexOf("###")>-1?t.replace(a,"."):t,c=t=>!t||o(t),l=(t,e,n)=>{const r=o(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(c(t))return{};const e=u(r[i]);!t[e]&&n&&(t[e]=new n),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{},++i}return c(t)?{}:{obj:t,k:u(r[i])}},h=(t,e,n)=>{const{obj:r,k:o}=l(t,e,Object);if(void 0!==r||1===e.length)return void(r[o]=n);let i=e[e.length-1],s=e.slice(0,e.length-1),a=l(t,s,Object);for(;void 0===a.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),a=l(t,s,Object),a?.obj&&void 0!==a.obj[`${a.k}.${i}`]&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},f=(t,e)=>{const{obj:n,k:r}=l(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},p=(t,e,n)=>{for(const r in e)"__proto__"!==r&&"constructor"!==r&&(r in t?o(t[r])||t[r]instanceof String||o(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):p(t[r],e[r],n):t[r]=e[r]);return t},d=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var y={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const b=t=>o(t)?t.replace(/[&<>"'\/]/g,t=>y[t]):t,m=[" ",",","?","!",";"],v=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const e=this.regExpMap.get(t);if(void 0!==e)return e;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}(20),g=(t,e,n=".")=>{if(!t)return;if(t[e]){if(!Object.prototype.hasOwnProperty.call(t,e))return;return t[e]}const r=e.split(n);let o=t;for(let t=0;t<r.length;){if(!o||"object"!=typeof o)return;let e,i="";for(let s=t;s<r.length;++s)if(s!==t&&(i+=n),i+=r[s],e=o[i],void 0!==e){if(["string","number","boolean"].indexOf(typeof e)>-1&&s<r.length-1)continue;t+=s-t+1;break}o=e}return o},_=t=>t?.replace("_","-"),w={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class x{constructor(t,e={}){this.init(t,e)}init(t,e={}){this.prefix=e.prefix||"i18next:",this.logger=t||w,this.options=e,this.debug=e.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,e,n,r){return r&&!this.debug?null:(o(t[0])&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[e](t))}create(t){return new x(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new x(this.logger,t)}}var O=new x;class S{constructor(){this.observers={}}on(t,e){return t.split(" ").forEach(t=>{this.observers[t]||(this.observers[t]=new Map);const n=this.observers[t].get(e)||0;this.observers[t].set(e,n+1)}),this}off(t,e){this.observers[t]&&(e?this.observers[t].delete(e):delete this.observers[t])}emit(t,...e){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([t,n])=>{for(let r=0;r<n;r++)t(...e)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let o=0;o<r;o++)n.apply(n,[t,...e])})}}class E extends S{constructor(t,e={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,n,r={}){const i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,s=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,e],n&&(Array.isArray(n)?a.push(...n):o(n)&&i?a.push(...n.split(i)):a.push(n)));const u=f(this.data,a);return!u&&!e&&!n&&t.indexOf(".")>-1&&(t=a[0],e=a[1],n=a.slice(2).join(".")),!u&&s&&o(n)?g(this.data?.[t]?.[e],n,i):u}addResource(t,e,n,r,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let s=[t,e];n&&(s=s.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(s=t.split("."),r=e,e=s[1]),this.addNamespaces(e),h(this.data,s,r),o.silent||this.emit("added",t,e,n,r)}addResources(t,e,n,r={silent:!1}){for(const r in n)(o(n[r])||Array.isArray(n[r]))&&this.addResource(t,e,r,n[r],{silent:!0});r.silent||this.emit("added",t,e,n)}addResourceBundle(t,e,n,r,o,i={silent:!1,skipCopy:!1}){let s=[t,e];t.indexOf(".")>-1&&(s=t.split("."),r=n,n=e,e=s[1]),this.addNamespaces(e);let a=f(this.data,s)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),r?p(a,n,o):a={...a,...n},h(this.data,s,a),i.silent||this.emit("added",t,e,n)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find(t=>e[t]&&Object.keys(e[t]).length>0)}toJSON(){return this.data}}var P={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,o){return t.forEach(t=>{e=this.processors[t]?.process(e,n,r,o)??e}),e}};const j=Symbol("i18next/PATH_KEY");function A(t,e){const{[j]:n}=t(function(){const t=[],e=Object.create(null);let n;return e.get=(r,o)=>(n?.revoke?.(),o===j?t:(t.push(o),n=Proxy.revocable(r,e),n.proxy)),Proxy.revocable(Object.create(null),e).proxy}());return n.join(e?.keySeparator??".")}const k={},C=t=>!o(t)&&"boolean"!=typeof t&&"number"!=typeof t;class T extends S{constructor(t,e={}){var n,r;super(),n=t,r=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(t=>{n[t]&&(r[t]=n[t])}),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=O.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,e={interpolation:{}}){const n={...e};if(null==t)return!1;const r=this.resolve(t,n);if(void 0===r?.res)return!1;const o=C(r.res);return!1!==n.returnObjects||!o}extractFromKey(t,e){let n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let i=e.ns||this.options.defaultNS||[];const s=n&&t.indexOf(n)>-1,a=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||((t,e,n)=>{e=e||"",n=n||"";const r=m.filter(t=>e.indexOf(t)<0&&n.indexOf(t)<0);if(0===r.length)return!0;const o=v.getRegExp(`(${r.map(t=>"?"===t?"\\?":t).join("|")})`);let i=!o.test(t);if(!i){const e=t.indexOf(n);e>0&&!o.test(t.substring(0,e))&&(i=!0)}return i})(t,n,r));if(s&&!a){const e=t.match(this.interpolator.nestingRegexp);if(e&&e.length>0)return{key:t,namespaces:o(i)?[i]:i};const s=t.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(i=s.shift()),t=s.join(r)}return{key:t,namespaces:o(i)?[i]:i}}translate(t,e,n){let r="object"==typeof e?{...e}:e;if("object"!=typeof r&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof r&&(r={...r}),r||(r={}),null==t)return"";"function"==typeof t&&(t=A(t,{...this.options,...r})),Array.isArray(t)||(t=[String(t)]);const i=void 0!==r.returnDetails?r.returnDetails:this.options.returnDetails,s=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,{key:a,namespaces:u}=this.extractFromKey(t[t.length-1],r),c=u[u.length-1];let l=void 0!==r.nsSeparator?r.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const h=r.lng||this.language,f=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===h?.toLowerCase())return f?i?{res:`${c}${l}${a}`,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:`${c}${l}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:c,usedParams:this.getUsedParamsDetails(r)}:a;const p=this.resolve(t,r);let d=p?.res;const y=p?.usedKey||a,b=p?.exactUsedKey||a,m=void 0!==r.joinArrays?r.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,g=void 0!==r.count&&!o(r.count),_=T.hasDefaultValue(r),w=g?this.pluralResolver.getSuffix(h,r.count,r):"",x=r.ordinal&&g?this.pluralResolver.getSuffix(h,r.count,{ordinal:!1}):"",O=g&&!r.ordinal&&0===r.count,S=O&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${w}`]||r[`defaultValue${x}`]||r.defaultValue;let E=d;v&&!d&&_&&(E=S);const P=C(E),j=Object.prototype.toString.apply(E);if(!(v&&E&&P&&["[object Number]","[object Function]","[object RegExp]"].indexOf(j)<0)||o(m)&&Array.isArray(E))if(v&&o(m)&&Array.isArray(d))d=d.join(m),d&&(d=this.extendTranslation(d,t,r,n));else{let e=!1,o=!1;!this.isValidLookup(d)&&_&&(e=!0,d=S),this.isValidLookup(d)||(o=!0,d=a);const i=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:d,u=_&&S!==d&&this.options.updateMissing;if(o||e||u){if(this.logger.log(u?"updateKey":"missingKey",h,c,a,u?S:d),s){const t=this.resolve(a,{...r,keySeparator:!1});t&&t.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 t=[];const e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if("fallback"===this.options.saveMissingTo&&e&&e[0])for(let n=0;n<e.length;n++)t.push(e[n]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(r.lng||this.language):t.push(r.lng||this.language);const n=(t,e,n)=>{const o=_&&n!==d?n:i;this.options.missingKeyHandler?this.options.missingKeyHandler(t,c,e,o,u,r):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,c,e,o,u,r),this.emit("missingKey",t,c,e,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&g?t.forEach(t=>{const e=this.pluralResolver.getSuffixes(t,r);O&&r[`defaultValue${this.options.pluralSeparator}zero`]&&e.indexOf(`${this.options.pluralSeparator}zero`)<0&&e.push(`${this.options.pluralSeparator}zero`),e.forEach(e=>{n([t],a+e,r[`defaultValue${e}`]||S)})}):n(t,a,S))}d=this.extendTranslation(d,t,r,p,n),o&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${c}${l}${a}`),(o||e)&&this.options.parseMissingKeyHandler&&(d=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${l}${a}`:a,e?d:void 0,r))}else{if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,E,{...r,ns:u}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(p.res=t,p.usedParams=this.getUsedParamsDetails(r),p):t}if(s){const t=Array.isArray(E),e=t?[]:{},n=t?b:y;for(const t in E)if(Object.prototype.hasOwnProperty.call(E,t)){const o=`${n}${s}${t}`;e[t]=_&&!d?this.translate(o,{...r,defaultValue:C(S)?S[t]:void 0,joinArrays:!1,ns:u}):this.translate(o,{...r,joinArrays:!1,ns:u}),e[t]===o&&(e[t]=E[t])}d=e}}return i?(p.res=d,p.usedParams=this.getUsedParamsDetails(r),p):d}extendTranslation(t,e,n,r,i){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...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 s=o(t)&&(void 0!==n?.interpolation?.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(s){const e=t.match(this.interpolator.nestingRegexp);a=e&&e.length}let u=n.replace&&!o(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),t=this.interpolator.interpolate(t,u,n.lng||this.language||r.usedLng,n),s){const e=t.match(this.interpolator.nestingRegexp);a<(e&&e.length)&&(n.nest=!1)}!n.lng&&r&&r.res&&(n.lng=this.language||r.usedLng),!1!==n.nest&&(t=this.interpolator.nest(t,(...t)=>i?.[0]!==t[0]||n.context?this.translate(...t,e):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${e[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const s=n.postProcess||this.options.postProcess,a=o(s)?[s]:s;return null!=t&&a?.length&&!1!==n.applyPostProcessor&&(t=P.handle(a,t,e,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...r,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t,e={}){let n,r,i,s,a;return o(t)&&(t=[t]),t.forEach(t=>{if(this.isValidLookup(n))return;const u=this.extractFromKey(t,e),c=u.key;r=c;let l=u.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const h=void 0!==e.count&&!o(e.count),f=h&&!e.ordinal&&0===e.count,p=void 0!==e.context&&(o(e.context)||"number"==typeof e.context)&&""!==e.context,d=e.lngs?e.lngs:this.languageUtils.toResolveHierarchy(e.lng||this.language,e.fallbackLng);l.forEach(t=>{this.isValidLookup(n)||(a=t,k[`${d[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(a)||(k[`${d[0]}-${t}`]=!0,this.logger.warn(`key "${r}" for languages "${d.join(", ")}" won't get resolved as namespace "${a}" 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!!!")),d.forEach(r=>{if(this.isValidLookup(n))return;s=r;const o=[c];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(o,c,r,t,e);else{let t;h&&(t=this.pluralResolver.getSuffix(r,e.count,e));const n=`${this.options.pluralSeparator}zero`,i=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(e.ordinal&&0===t.indexOf(i)&&o.push(c+t.replace(i,this.options.pluralSeparator)),o.push(c+t),f&&o.push(c+n)),p){const r=`${c}${this.options.contextSeparator||"_"}${e.context}`;o.push(r),h&&(e.ordinal&&0===t.indexOf(i)&&o.push(r+t.replace(i,this.options.pluralSeparator)),o.push(r+t),f&&o.push(r+n))}}let a;for(;a=o.pop();)this.isValidLookup(n)||(i=a,n=this.getResource(r,t,a,e))}))})}),{res:n,usedKey:r,exactUsedKey:i,usedLng:s,usedNS:a}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,n,r={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,e,n,r):this.resourceStore.getResource(t,e,n,r)}getUsedParamsDetails(t={}){const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&!o(t.replace);let r=n?t.replace:t;if(n&&void 0!==t.count&&(r.count=t.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const t of e)delete r[t]}return r}static hasDefaultValue(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,12)&&void 0!==t[e])return!0;return!1}}class N{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=O.create("languageUtils")}getScriptPartFromCode(t){if(!(t=_(t))||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=_(t))||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if(o(t)&&t.indexOf("-")>-1){let e;try{e=Intl.getCanonicalLocales(t)[0]}catch(t){}return e&&this.options.lowerCaseLng&&(e=e.toLowerCase()),e||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach(t=>{if(e)return;const n=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(n)||(e=n)}),!e&&this.options.supportedLngs&&t.forEach(t=>{if(e)return;const n=this.getScriptPartFromCode(t);if(this.isSupportedCode(n))return e=n;const r=this.getLanguagePartFromCode(t);if(this.isSupportedCode(r))return e=r;e=this.options.supportedLngs.find(t=>t===r?t:t.indexOf("-")<0&&r.indexOf("-")<0?void 0:t.indexOf("-")>0&&r.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===r||0===t.indexOf(r)&&r.length>1?t:void 0)}),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),o(t)&&(t=[t]),Array.isArray(t))return t;if(!e)return t.default||[];let n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}toResolveHierarchy(t,e){const n=this.getFallbackCodes((!1===e?[]:e)||this.options.fallbackLng||[],t),r=[],i=t=>{t&&(this.isSupportedCode(t)?r.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return o(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):o(t)&&i(this.formatLanguageCode(t)),n.forEach(t=>{r.indexOf(t)<0&&i(this.formatLanguageCode(t))}),r}}const I={zero:0,one:1,two:2,few:3,many:4,other:5},M={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class R{constructor(t,e={}){this.languageUtils=t,this.options=e,this.logger=O.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,e){this.rules[t]=e}clearCache(){this.pluralRulesCache={}}getRule(t,e={}){const n=_("dev"===t?"en":t),r=e.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:r});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(n,{type:r})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),M;if(!t.match(/-|_/))return M;const r=this.languageUtils.getLanguagePartFromCode(t);i=this.getRule(r,e)}return this.pluralRulesCache[o]=i,i}needsPlural(t,e={}){let n=this.getRule(t,e);return n||(n=this.getRule("dev",e)),n?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,e,n={}){return this.getSuffixes(t,n).map(t=>`${e}${t}`)}getSuffixes(t,e={}){let n=this.getRule(t,e);return n||(n=this.getRule("dev",e)),n?n.resolvedOptions().pluralCategories.sort((t,e)=>I[t]-I[e]).map(t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`):[]}getSuffix(t,e,n={}){const r=this.getRule(t,n);return r?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(e)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",e,n))}}const D=(t,e,n,r=".",i=!0)=>{let s=((t,e,n)=>{const r=f(t,n);return void 0!==r?r:f(e,n)})(t,e,n);return!s&&i&&o(n)&&(s=g(t,n,r),void 0===s&&(s=g(e,n,r))),s},$=t=>t.replace(/\$/g,"$$$$");class L{constructor(t={}){this.logger=O.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:e,escapeValue:n,useRawValueToEscape:r,prefix:o,prefixEscaped:i,suffix:s,suffixEscaped:a,formatSeparator:u,unescapeSuffix:c,unescapePrefix:l,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:y,nestingOptionsSeparator:m,maxReplaces:v,alwaysFormat:g}=t.interpolation;this.escape=void 0!==e?e:b,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==r&&r,this.prefix=o?d(o):i||"{{",this.suffix=s?d(s):a||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?d(h):f||d("$t("),this.nestingSuffix=p?d(p):y||d(")"),this.nestingOptionsSeparator=m||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==g&&g,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,e)=>t?.source===e?(t.lastIndex=0,t):new RegExp(e,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,e,n,r){let i,a,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=t=>{if(t.indexOf(this.formatSeparator)<0){const o=D(e,c,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...e,interpolationkey:t}):o}const o=t.split(this.formatSeparator),i=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format(D(e,c,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,n,{...r,...e,interpolationkey:i})};this.resetRegExp();const h=r?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=void 0!==r?.interpolation?.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>$(t)},{regex:this.regexp,safeValue:t=>this.escapeValue?$(this.escape(t)):$(t)}].forEach(e=>{for(u=0;i=e.regex.exec(t);){const n=i[1].trim();if(a=l(n),void 0===a)if("function"==typeof h){const e=h(t,i,r);a=o(e)?e:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a="";else{if(f){a=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${t}`),a=""}else o(a)||this.useRawValueToEscape||(a=s(a));const c=e.safeValue(a);if(t=t.replace(i[0],c),f?(e.regex.lastIndex+=a.length,e.regex.lastIndex-=i[0].length):e.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),t}nest(t,e,n={}){let r,i,a;const u=(t,e)=>{const n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;const r=t.split(new RegExp(`${n}[ ]*{`));let o=`{${r[1]}`;t=r[0],o=this.interpolate(o,a);const i=o.match(/'/g),s=o.match(/"/g);((i?.length??0)%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{a=JSON.parse(o),e&&(a={...e,...a})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${n}${o}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,t};for(;r=this.nestingRegexp.exec(t);){let c=[];a={...n},a=a.replace&&!o(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const l=/{.*}/.test(r[1])?r[1].lastIndexOf("}")+1:r[1].indexOf(this.formatSeparator);if(-1!==l&&(c=r[1].slice(l).split(this.formatSeparator).map(t=>t.trim()).filter(Boolean),r[1]=r[1].slice(0,l)),i=e(u.call(this,r[1].trim(),a),a),i&&r[0]===t&&!o(i))return i;o(i)||(i=s(i)),i||(this.logger.warn(`missed to resolve ${r[1]} for nesting ${t}`),i=""),c.length&&(i=c.reduce((t,e)=>this.format(t,e,n.lng,{...n,interpolationkey:r[1].trim()}),i.trim())),t=t.replace(r[0],i),this.regexp.lastIndex=0}return t}}const B=t=>{const e={};return(n,r,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=r+JSON.stringify(i);let a=e[s];return a||(a=t(_(r),o),e[s]=a),a(n)}},U=t=>(e,n,r)=>t(_(n),r)(e);class V{constructor(t={}){this.logger=O.create("formatter"),this.options=t,this.init(t)}init(t,e={interpolation:{}}){this.formatSeparator=e.interpolation.formatSeparator||",";const n=e.cacheInBuiltFormats?B:U;this.formats={number:n((t,e)=>{const n=new Intl.NumberFormat(t,{...e});return t=>n.format(t)}),currency:n((t,e)=>{const n=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>n.format(t)}),datetime:n((t,e)=>{const n=new Intl.DateTimeFormat(t,{...e});return t=>n.format(t)}),relativetime:n((t,e)=>{const n=new Intl.RelativeTimeFormat(t,{...e});return t=>n.format(t,e.range||"day")}),list:n((t,e)=>{const n=new Intl.ListFormat(t,{...e});return t=>n.format(t)})}}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=B(e)}format(t,e,n,r={}){const o=e.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(t=>t.indexOf(")")>-1)){const t=o.findIndex(t=>t.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,t)].join(this.formatSeparator)}return o.reduce((t,e)=>{const{formatName:o,formatOptions:i}=(t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===e&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===e&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(t=>{if(t){const[e,...r]=t.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,""),i=e.trim();n[i]||(n[i]=o),"false"===o&&(n[i]=!1),"true"===o&&(n[i]=!0),isNaN(o)||(n[i]=parseInt(o,10))}})}return{formatName:e,formatOptions:n}})(e);if(this.formats[o]){let e=t;try{const s=r?.formatParams?.[r.interpolationkey]||{},a=s.locale||s.lng||r.locale||r.lng||n;e=this.formats[o](t,a,{...i,...r,...s})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${o}`),t},t)}}class F extends S{constructor(t,e,n,r={}){super(),this.backend=t,this.store=e,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=O.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?.init?.(n,r.backend,r)}queueLoad(t,e,n,r){const o={},i={},s={},a={};return t.forEach(t=>{let r=!0;e.forEach(e=>{const s=`${t}|${e}`;!n.reload&&this.store.hasResourceBundle(t,e)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,r=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===a[e]&&(a[e]=!0)))}),r||(s[t]=!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(s),toLoadNamespaces:Object.keys(a)}}loaded(t,e,n){const r=t.split("|"),o=r[0],i=r[1];e&&this.emit("failedLoading",o,i,e),!e&&n&&this.store.addResourceBundle(o,i,n,void 0,void 0,{skipCopy:!0}),this.state[t]=e?-1:2,e&&n&&(this.state[t]=0);const s={};this.queue.forEach(n=>{((t,e,n)=>{const{obj:r,k:o}=l(t,e,Object);r[o]=r[o]||[],r[o].push(n)})(n.loaded,[o],i),((t,e)=>{void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)})(n,t),e&&n.errors.push(e),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(t=>{s[t]||(s[t]={});const e=n.loaded[t];e.length&&e.forEach(e=>{void 0===s[t][e]&&(s[t][e]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(t=>!t.done)}read(t,e,n,r=0,o=this.retryTimeout,i){if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:n,tried:r,wait:o,callback:i});this.readingCalls++;const s=(s,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}s&&a&&r<this.maxRetries?setTimeout(()=>{this.read.call(this,t,e,n,r+1,2*o,i)},o):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(t,e,s);try{const n=a(t,e);n&&"function"==typeof n.then?n.then(t=>s(null,t)).catch(s):s(null,n)}catch(t){s(t)}}prepareLoading(t,e,n={},r){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();o(t)&&(t=this.languageUtils.toResolveHierarchy(t)),o(e)&&(e=[e]);const i=this.queueLoad(t,e,n,r);if(!i.toLoad.length)return i.pending.length||r(),null;i.toLoad.forEach(t=>{this.loadOne(t)})}load(t,e,n){this.prepareLoading(t,e,{},n)}reload(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}loadOne(t,e=""){const n=t.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,(n,i)=>{n&&this.logger.warn(`${e}loading namespace ${o} for language ${r} failed`,n),!n&&i&&this.logger.log(`${e}loaded namespace ${o} for language ${r}`,i),this.loaded(t,n,i)})}saveMissing(t,e,n,r,o,i={},s=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(e)){if(null!=n&&""!==n){if(this.backend?.create){const a={...i,isUpdate:o},u=this.backend.create.bind(this.backend);if(u.length<6)try{let o;o=5===u.length?u(t,e,n,r,a):u(t,e,n,r),o&&"function"==typeof o.then?o.then(t=>s(null,t)).catch(s):s(null,o)}catch(t){s(t)}else u(t,e,n,r,s,a)}t&&t[0]&&this.store.addResource(t[0],e,n,r)}}else this.logger.warn(`did not save key "${n}" as the namespace "${e}" 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!!!")}}const K=()=>({debug:!1,initAsync:!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:t=>{let e={};if("object"==typeof t[1]&&(e=t[1]),o(t[1])&&(e.defaultValue=t[1]),o(t[2])&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const n=t[3]||t[2];Object.keys(n).forEach(t=>{e[t]=n[t]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),W=t=>(o(t.ns)&&(t.ns=[t.ns]),o(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),o(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),q=()=>{};class z extends S{constructor(t={},e){var n;if(super(),this.options=W(t),this.services={},this.logger=O,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{"function"==typeof n[t]&&(n[t]=n[t].bind(n))}),e&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,e),this;setTimeout(()=>{this.init(t,e)},0)}}init(t={},e){this.isInitializing=!0,"function"==typeof t&&(e=t,t={}),null==t.defaultNS&&t.ns&&(o(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const n=K();this.options={...n,...this.options,...W(t)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);const r=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;this.modules.logger?O.init(r(this.modules.logger),this.options):O.init(null,this.options),t=this.modules.formatter?this.modules.formatter:V;const e=new N(this.options);this.store=new E(this.options.resources,this.options);const o=this.services;o.logger=O,o.resourceStore=this.store,o.languageUtils=e,o.pluralResolver=new R(e,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(o.formatter=r(t),o.formatter.init&&o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new L(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new F(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(t,...e)=>{this.emit(t,...e)}),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new T(this.services,this.options),this.translator.on("*",(t,...e)=>{this.emit(t,...e)}),this.modules.external.forEach(t=>{t.init&&t.init(this)})}if(this.format=this.options.interpolation.format,e||(e=q),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[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]=(...e)=>this.store[t](...e)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=(...e)=>(this.store[t](...e),this)});const s=i(),a=()=>{const t=(t,n)=>{this.isInitializing=!1,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),s.resolve(n),e(t,n)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?a():setTimeout(a,0),s}loadResources(t,e=q){let n=e;const r=o(t)?t:this.language;if("function"==typeof t&&(n=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===r?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return n();const t=[],e=e=>{e&&"cimode"!==e&&this.services.languageUtils.toResolveHierarchy(e).forEach(e=>{"cimode"!==e&&t.indexOf(e)<0&&t.push(e)})};r?e(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(t=>e(t)),this.options.preload?.forEach?.(t=>e(t)),this.services.backendConnector.load(t,this.options.ns,t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(t)})}else n(null)}reloadResources(t,e,n){const r=i();return"function"==typeof t&&(n=t,t=void 0),"function"==typeof e&&(n=e,e=void 0),t||(t=this.languages),e||(e=this.options.ns),n||(n=q),this.services.backendConnector.reload(t,e,t=>{r.resolve(),n(t)}),r}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&P.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const e=this.languages[t];if(!(["cimode","dev"].indexOf(e)>-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,e){this.isLanguageChangingTo=t;const n=i();this.emit("languageChanging",t);const r=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},s=(o,i)=>{i?this.isLanguageChangingTo===t&&(r(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,n.resolve((...t)=>this.t(...t)),e&&e(o,(...t)=>this.t(...t))},a=e=>{t||e||!this.services.languageDetector||(e=[]);const n=o(e)?e:e&&e[0],i=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(o(e)?[e]:e);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector?.cacheUserLanguage?.(i)),this.loadResources(i,t=>{s(t,i)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&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(t):a(this.services.languageDetector.detect()),n}getFixedT(t,e,n){const r=(t,e,...o)=>{let i;i="object"!=typeof e?this.options.overloadTranslationOptionHandler([t,e].concat(o)):{...e},i.lng=i.lng||r.lng,i.lngs=i.lngs||r.lngs,i.ns=i.ns||r.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||n||r.keyPrefix);const s=this.options.keySeparator||".";let a;return i.keyPrefix&&Array.isArray(t)?a=t.map(t=>("function"==typeof t&&(t=A(t,{...this.options,...e})),`${i.keyPrefix}${s}${t}`)):("function"==typeof t&&(t=A(t,{...this.options,...e})),a=i.keyPrefix?`${i.keyPrefix}${s}${t}`:t),this.t(a,i)};return o(t)?r.lng=t:r.lngs=t,r.ns=e,r.keyPrefix=n,r}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,e={}){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=e.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=(t,e)=>{const n=this.services.backendConnector.state[`${t}|${e}`];return-1===n||0===n||2===n};if(e.precheck){const t=e.precheck(this,i);if(void 0!==t)return t}return!(!this.hasResourceBundle(n,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!i(n,t)||r&&!i(o,t)))}loadNamespaces(t,e){const n=i();return this.options.ns?(o(t)&&(t=[t]),t.forEach(t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}),this.loadResources(t=>{n.resolve(),e&&e(t)}),n):(e&&e(),Promise.resolve())}loadLanguages(t,e){const n=i();o(t)&&(t=[t]);const r=this.options.preload||[],s=t.filter(t=>r.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t));return s.length?(this.options.preload=r.concat(s),this.loadResources(t=>{n.resolve(),e&&e(t)}),n):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const e=new Intl.Locale(t);if(e&&e.getTextInfo){const t=e.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const e=this.services?.languageUtils||new N(K());return t.toLowerCase().indexOf("-latn")>1?"ltr":["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(e.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},e){return new z(t,e)}cloneInstance(t={},e=q){const n=t.forkResourceStore;n&&delete t.forkResourceStore;const r={...this.options,...t,isClone:!0},o=new z(r);if(void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t)),["store","services","language"].forEach(t=>{o[t]=this[t]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const t=Object.keys(this.store.data).reduce((t,e)=>(t[e]={...this.store.data[e]},t[e]=Object.keys(t[e]).reduce((n,r)=>(n[r]={...t[e][r]},n),t[e]),t),{});o.store=new E(t,r),o.services.resourceStore=o.store}return o.translator=new T(o.services,r),o.translator.on("*",(t,...e)=>{o.emit(t,...e)}),o.init(r,e),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 H=z.createInstance();H.createInstance=z.createInstance,H.createInstance,H.dir,H.init,H.loadResources,H.reloadResources,H.use,H.changeLanguage,H.getFixedT,H.t,H.exists,H.setDefaultNamespace,H.hasLoadedNamespace,H.loadNamespaces,H.loadLanguages;const G=H.default||H;function Y(t,e,n,r){return G.t(e,{ns:t,defaultValue:n,...r})}function J(t,e,n){return r[t]?Y("core",t,e??r[t],n):(console.error(`O3 Core Translations does not provide key '${t}'. The key itself is being rendered as text.`),t)}G.on("initialized",function(){window.i18next.loadNamespaces(["core"])})},51026:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.skipUntil=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.notifier))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;r.hasValue=!1;var o=new i.SimpleInnerSubscriber(r);r.add(o),r.innerSubscription=o;var s=i.innerSubscribe(n,o);return s!==o&&(r.add(s),r.innerSubscription=s),r}return o(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(i.SimpleOuterSubscriber)},51069:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(21016),s=n(75901);e.bufferWhen=function(t){return function(e){return e.lift(new a(t))}};var a=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.closingSelector))},t}(),u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return o(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new i.Subscription,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(s.innerSubscribe(e,new s.SimpleInnerSubscriber(this))),this.subscribing=!1},e}(s.SimpleOuterSubscriber)},51812:t=>{"use strict";t.exports={hex2rgb:function(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,n,r){return e+e+n+n+r+r});var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},rgb2hex:function(t){return"#"+["r","g","b"].map(function(e){return("0"+t[e].toString(16)).slice(-2)}).join("")},rgb2hsl:function(t){var e=t.r,n=t.g,r=t.b;e/=255,n/=255,r/=255;var o,i,s=Math.max(e,n,r),a=Math.min(e,n,r),u=(s+a)/2;if(s===a)o=i=0;else{var c=s-a;switch(i=u>.5?c/(2-s-a):c/(s+a),s){case e:o=(n-r)/c+(n<r?6:0);break;case n:o=(r-e)/c+2;break;case r:o=(e-n)/c+4}o/=6}return{h:o,s:i,l:u}},hsl2rgb:function(t){function e(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var n,r,o,i=t.h,s=t.s,a=t.l;if(0===s)n=r=o=a;else{var u=a<.5?a*(1+s):a+s-a*s,c=2*a-u;n=e(c,u,i+1/3),r=e(c,u,i),o=e(c,u,i-1/3)}return{r:Math.round(255*n),g:Math.round(255*r),b:Math.round(255*o)}},rgb2rgbString:function(t){return"rgb("+[t.r,t.g,t.b].join(",")+")"}}},52834:(t,e,n)=>{"use strict";function r(t){return!window.offlineEnabled||(t??navigator.onLine)}n.d(e,{s:()=>r})},53325:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(71077),s=n(75901);e.retryWhen=function(t){return function(e){return e.lift(new a(t,e))}};var a=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,this.source))},t}(),u=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.notifier=n,o.source=r,o}return o(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,o=this.retriesSubscription;if(r)this.errors=void 0,this.retriesSubscription=void 0;else{n=new i.Subject;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}o=s.innerSubscribe(r,new s.SimpleInnerSubscriber(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=o,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var t=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=t,this.source.subscribe(this)},e}(s.SimpleOuterSubscriber)},53912:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.noop=function(){}},54332:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.sequenceEqual=function(t,e){return function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.compareTo,this.comparator))},t}();e.SequenceEqualOperator=s;var a=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.compareTo=n,o.comparator=r,o._a=[],o._b=[],o._oneComplete=!1,o.destination.add(n.subscribe(new u(e,o))),o}return o(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this,e=t._a,n=t._b,r=t.comparator;e.length>0&&n.length>0;){var o=e.shift(),i=n.shift(),s=!1;try{s=r?r(o,i):o===i}catch(t){this.destination.error(t)}s||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(i.Subscriber);e.SequenceEqualSubscriber=a;var u=function(t){function e(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return o(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(i.Subscriber)},55169:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e,n){return t.call(this)||this}return o(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(n(21016).Subscription);e.Action=i},55985:(t,e,n)=>{"use strict";n.d(e,{A:()=>f});var r=n(61469),o=n(1343);function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function s(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?i(Object(n),!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h(t){var e=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(t){return!1}}();return function(){var n,r=u(t);if(e){var o=u(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return l(t)}(this,n)}}var f=function(){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(n,o.Component);var t,e=h(n);function n(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),a(l(r=e.call(this,t)),"handleRef",function(t){r.el=t}),a(l(r),"addThingToDo",function(t,e){r.state.hasError&&"unmount"!==t||(r.nextThingToDo=(r.nextThingToDo||Promise.resolve()).then(function(){if(!r.unmounted||"unmount"===t)return e.apply(void 0,arguments)}).catch(function(e){throw r.nextThingToDo=Promise.resolve(),r.setState({hasError:!0}),e&&e.message&&(e.message="During '".concat(t,"', parcel threw an error: ").concat(e.message)),r.props.handleError?r.props.handleError(e):setTimeout(function(){throw e}),e}))}),a(l(r),"getParcelProps",function(){var t=s(s({},r.props),{},{domElement:r.el});return delete t.mountParcel,delete t.config,delete t.wrapWith,delete t.wrapStyle,delete t.appendTo,delete t.handleError,delete t.parcelDidMount,t}),r.state={hasError:!1},!t.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 r}return(t=[{key:"componentDidMount",value:function(){var t=this;this.unmounted=!1,this.addThingToDo("mount",function(){var e,n=t.props.mountParcel||t.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 t.el?e=t.el:(t.createdDomElement=e=document.createElement(t.props.wrapWith),Object.keys(t.props.wrapStyle).forEach(function(n){e.style[n]=t.props.wrapStyle[n]}),t.props.appendTo.appendChild(e)),t.parcel=n(t.props.config,s({domElement:e},t.getParcelProps())),t.parcel.mountPromise.then(t.props.parcelDidMount),t.parcel.mountPromise})}},{key:"componentDidUpdate",value:function(){var t=this;this.addThingToDo("update",function(){if(t.parcel&&t.parcel.update)return t.parcel.update(t.getParcelProps())})}},{key:"componentWillUnmount",value:function(){var t=this;this.addThingToDo("unmount",function(){if(t.parcel&&"MOUNTED"===t.parcel.getStatus())return t.parcel.unmount()}),this.createdDomElement&&this.createdDomElement.parentNode.removeChild(this.createdDomElement),this.unmounted=!0}},{key:"render",value:function(){var t=this;if(this.props.appendTo)return r.i&&r.i.Consumer?o.createElement(r.i.Consumer,null,function(e){return t.mountParcel=e?e.mountParcel:null,null}):null;var e=r.i&&r.i.Consumer?o.createElement(r.i.Consumer,null,function(e){return t.mountParcel=e?e.mountParcel:null,null}):void 0;return o.createElement(this.props.wrapWith,{ref:this.handleRef,style:this.props.wrapStyle,className:this.props.wrapClassName},e)}}])&&function(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(n.prototype,t),n}();a(f,"defaultProps",{wrapWith:"div",wrapStyle:{},parcelDidMount:function(){}})},56051:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.dematerialize=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(i.Subscriber)},57001:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(71929);e.max=function(t){var e="function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e};return r.reduce(e)}},57338:t=>{"use strict";var e=t.exports=function(t){return this instanceof e?(this.tagName=t,this.attributes=Object.create(null),this.children=[],this.lastChild=null,this):new e(t)};e.prototype.appendChild=function(t){return this.children.push(t),this.lastChild=t,this},e.prototype.setAttribute=function(t,e){return this.attributes[t]=e,this},e.prototype.toString=function(){var t=this;return["<",t.tagName,Object.keys(t.attributes).map(function(e){return[" ",e,'="',t.attributes[e],'"'].join("")}).join(""),">",t.children.map(function(t){return t.toString()}).join(""),"</",t.tagName,">"].join("")}},57366:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2519),o=n(64629),i=n(8347),s=n(90952),a=n(85624);e.elementAt=function(t,e){if(t<0)throw new r.ArgumentOutOfRangeError;var n=arguments.length>=2;return function(u){return u.pipe(o.filter(function(e,n){return n===t}),a.take(1),n?s.defaultIfEmpty(e):i.throwIfEmpty(function(){return new r.ArgumentOutOfRangeError}))}}},57894:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(80743),s=n(67446),a=n(89152),u=n(87778);e.race=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!i.isArray(t[0]))return t[0];t=t[0]}return s.fromArray(t,void 0).lift(new c)};var c=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new l(t))},t}();e.RaceOperator=c;var l=function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return o(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=t[n],o=u.subscribeToResult(this,r,void 0,n);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(t,e,n){if(!this.hasFirst){this.hasFirst=!0;for(var r=0;r<this.subscriptions.length;r++)if(r!==n){var o=this.subscriptions[r];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(e)},e}(a.OuterSubscriber);e.RaceSubscriber=l},58379:(t,e,n)=>{"use strict";n.d(e,{zq:()=>o,i_:()=>s,YY:()=>u,W3:()=>v,p6:()=>P,fS:()=>j,qw:()=>k,rr:()=>p,sc:()=>V,ns:()=>B,mw:()=>gt,JK:()=>L,g9:()=>U,xl:()=>kt,F7:()=>$,Ie:()=>F,Us:()=>W,Tt:()=>z,CX:()=>y,_9:()=>G,yJ:()=>Y,UK:()=>tt,zD:()=>et,Fx:()=>ot,d7:()=>it,jn:()=>E,E4:()=>ut,$B:()=>ct,br:()=>b,Wq:()=>lt,uL:()=>d,Gz:()=>ht,u:()=>pt,oq:()=>Et,vL:()=>Pt,to:()=>vt,CH:()=>dt,qv:()=>At,if:()=>Ct,TA:()=>Tt,kH:()=>Nt,Wr:()=>It,Jm:()=>Mt,Bf:()=>Ot,iy:()=>wt,Ed:()=>yt,M3:()=>Rt,WQ:()=>$t,tQ:()=>Bt,wJ:()=>Ut,oU:()=>Vt,wV:()=>Yt,Pj:()=>h,mQ:()=>f,fq:()=>zt,xH:()=>qt,wr:()=>Ht});var r=n(1343);const o=(0,r.createContext)({moduleName:"",featureName:""});var i=n(11305);function s({to:t,templateParams:e,onBeforeNavigate:n,children:o,...s}){return(0,r.useEffect)(()=>{s.href&&console.warn(`ConfigurableLink does not support the href prop. Use the 'to' prop instead. The provided href value is '${s.href}'`),s.onClick&&console.warn(`ConfigurableLink does not support the onClick prop. Use the 'onBeforeNavigate' prop instead. The 'to' prop of the offending link is ${t}`)},[]),r.createElement("a",{onClick:r=>function(t,e,n,r){0!==t.button||t.ctrlKey||t.shiftKey||t.altKey||t.metaKey||(t.preventDefault(),r?.(t),(0,i.oo)({to:e,templateParams:n})),0===t.button&&(t.ctrlKey||t.metaKey)&&r?.(t),0===t.button&&t.shiftKey&&r?.(t),1===t.button&&r?.(t)}(r,t,e,n),href:(0,i.JG)(t,e),...s},o)}var a=n(27354);const u=({state:t,children:e,...n})=>{const{extension:i}=(0,r.useContext)(o),s=(0,r.useRef)(null),u=(0,r.useRef)(Promise.resolve()),c=(0,r.useCallback)(e=>{i?.extensionSlotName&&i.extensionSlotModuleName&&i.extensionSlotModuleName&&!s.current&&(0,a.wG)(e,i.extensionSlotName,i.extensionSlotModuleName,i.extensionId,void 0,t).then(t=>{s.current=t})},[]);return(0,r.useEffect)(()=>()=>{if(s&&s.current)switch(s.current.getStatus()){case"MOUNTING":s.current.mountPromise.then(()=>{"MOUNTED"===s.current?.getStatus()&&s.current.unmount()});break;case"MOUNTED":s.current.unmount();break;case"UPDATING":u.current&&u.current.then(()=>{"MOUNTED"===s.current?.getStatus()&&s.current.unmount()})}},[]),(0,r.useEffect)(()=>{s.current&&s.current.update&&"UNMOUNTING"!==s.current.getStatus()&&Promise.all([s.current.mountPromise,u.current]).then(()=>{"MOUNTED"===s?.current?.getStatus()&&s.current.update&&(u.current=s.current.update({...t}).catch(t=>{if(!(t instanceof Error&&t.message.includes("minified message #32")&&"MOUNTED"!==s.current?.getStatus()))throw t}))})},[t]),i?r.createElement("div",{ref:c,"data-extension-id":i?.extensionId,style:{position:"relative"},...n}):null};function c(t,e){"function"==typeof e&&(e=e(t));const n={};for(const[r,o]of Object.entries(e)){const e=function(...e){t.setState(t=>o(t,...e))};n[r]=e}return n}const l=()=>t=>t;function h(t,e=l(),n){const o=(0,r.useCallback)(e=>t.subscribe(e),[t]),i=(0,r.useCallback)(()=>e(t.getState()),[t,e]);return{...(0,r.useSyncExternalStore)(o,i,i),...(0,r.useMemo)(()=>n?c(t,n):{},[t,n])}}function f(t,e){return h(t,l(),e)}function p(t){return function(e){const n=(0,r.useCallback)(e=>t.subscribe(e),[]),o=(0,r.useCallback)(()=>t.getState(),[]);return{...(0,r.useSyncExternalStore)(n,o,o),...(0,r.useMemo)(()=>e?c(t,e):{},[e])}}}const d=t=>h((0,a.zF)(),e=>e.slots?.[t]);function y(t){const e=d(t);return e?.assignedExtensions??[]}function b(t,e){const{moduleName:n}=(0,r.useContext)(o),i=(0,r.useRef)(!0);if(!n)throw Error("ComponentContext has not been provided. This should come from @openmrs/esm-react-utils.");return(0,r.useEffect)(()=>{(0,a.FY)(n,t,e),i.current=!1},[]),(0,r.useEffect)(()=>{i.current||(0,a.ap)(t,e)},[t,e]),{extensions:y(t),extensionSlotName:t,extensionSlotModuleName:n}}function m(t){return t}function v({name:t,extensionSlotName:e,select:n=m,children:i,state:s,style:a,...c}){if(i&&s)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.");const l=t??e,h=(0,r.useRef)(null),{extensions:f,extensionSlotModuleName:p}=b(l,s),d=(0,r.useMemo)(()=>n(f),[n,f]),y=(0,r.useMemo)(()=>{if("function"==typeof i&&!r.isValidElement(i))return d.map(t=>i(t,s))},[i,d]);return r.createElement("div",{ref:h,"data-extension-slot-name":l,"data-extension-slot-module-name":p,style:{...a,position:"relative"},...c},l&&d?.map((t,e)=>r.createElement(o.Provider,{key:t.id,value:{moduleName:p,featureName:"",extension:{extensionId:t.id,extensionSlotName:l,extensionSlotModuleName:p}}},y?.[e]??("function"!=typeof i?i:null)??r.createElement(u,{state:s}))))}var g=n(43132),_=n(23790);const w=(0,g.y)()(()=>({}));(0,_.CE)("openmrs-app-context",w);const x=Object();function O(t,e){w.setState(n=>(t in n||(n[t]={}),n[t]=e(n[t]),Object.assign({},n)))}var S=n(27388);function E(t,e){const n=(0,r.useRef)(e??{}),o=(0,r.useRef)(e=>O(t,e));return(0,r.useEffect)(()=>(function(t,e=x){w.setState(n=>{if(t in n)throw new Error(`Attempted to re-register namespace ${t} in the app context. Each namespace must be unregistered before the name can be registered again.`);return Object.assign({},n,{[t]:e===x?{}:e})})}(t,e??{}),()=>{!function(t){w.setState(e=>(t in e&&delete e[t],e))}(t)}),[t]),(0,r.useEffect)(()=>{let r=e??{};(0,S.b)(n.current,r)||(O(t,()=>r),n.current=r)},[e]),o.current}function P({namespace:t,value:e}){return E(t,e),null}const j=({children:t,value:e,fallback:n})=>Boolean(e)?r.createElement(r.Fragment,null,t):n?r.createElement(r.Fragment,null,n):null;var A=n(20367);const k=({privilege:t,fallback:e,children:n})=>{const[o,i]=(0,r.useState)(null);return(0,r.useEffect)(()=>{const t=(0,A.HW)({includeAuthStatus:!1}).subscribe(i);return()=>t.unsubscribe()},[]),o&&(0,A.st)(t,o)?r.createElement(r.Fragment,null,n):e?r.createElement(r.Fragment,null,e):null};var C=n(25873),T=n(61469),N=n(72339),I=n(71123);const M={strictMode:!0,throwErrorsToConsole:!0,disableTranslations:!1},R=new Map,D={errorRetryCount:3,fetcher:A.lo,focusThrottleInterval:18e5,revalidateIfStale:!0,revalidateOnFocus:!1,revalidateOnReconnect:!1,refreshInterval:0,shouldRetryOnError:t=>{if(t instanceof A.$f){const e=t.response.status;return e>=500||401===e||403===e||429===e}return!0},provider:()=>R};function $(t){if("object"!=typeof t||"string"!=typeof t.featureName||"string"!=typeof t.moduleName)throw new Error("Invalid options");const e=Object.assign({},M,t),n={...D,...e.swrConfig};return function(t){var i,s,a,u;return s=i=class extends r.Component{componentDidCatch(t,n){n&&n.componentStack&&(t.extra=Object.assign(t.extra||{},{componentStack:n.componentStack})),e.throwErrorsToConsole&&setTimeout(()=>{throw t}),this.setState({caughtError:t,caughtErrorInfo:n})}render(){if(this.state.caughtError)return r.createElement("div",null,"An error has occurred. Please try reloading the page.");{const i=r.createElement(r.Suspense,{fallback:null},r.createElement(I.BE,{value:n},r.createElement(o.Provider,{value:this.state.config},e.disableTranslations?r.createElement(t,this.props):r.createElement(N.I18nextProvider,{i18n:window.i18next,defaultNS:this.state.config.extension?`${this.state.config.moduleName}___${this.state.config.extension.extensionSlotName}___${this.state.config.extension.extensionId}`:this.state.config.moduleName},r.createElement(t,this.props)))));return e.strictMode&&r.StrictMode?r.createElement(r.StrictMode,null,i):i}}constructor(t){super(t),this.state={caughtError:null,caughtErrorInfo:null,config:{moduleName:e.moduleName,featureName:e.featureName,extension:t._extensionContext}}}},a="displayName",u=`OpenmrsReactComponent(${e.featureName})`,a in s?Object.defineProperty(s,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):s[a]=u,i}}function L(t,e){return(0,T.A)({React:r,ReactDOMClient:C,rootComponent:$(e)(t)})}function B(t,e){return()=>t().then(({default:t})=>L(t,e))}function U(t,e){return()=>Promise.resolve(L(t,e))}const V=B;function F(){const t=(0,r.useRef)();return t.current&&!t.current.signal.aborted||(t.current=new AbortController),(0,r.useEffect)(()=>{const e=t.current;return()=>e?.abort()},[]),t.current}const K=F;function W(t,e=t=>t??{}){const[n,o]=(0,r.useState)();return(0,r.useEffect)(()=>{if(null==t||""===t.replace(" ",""))throw new Error(`The namespace supplied to useAppContext must be a non-empty string, but was "${t}".`)},[t]),(0,r.useEffect)(()=>function(t,e){let n=function(t,e=t=>t){const n=w.getState();return t in n?Object.freeze(Object.assign({},e?e(n[t]):n[t])):null}(t);return e(Object.freeze(Object.assign({},n))),w.subscribe(r=>{let o=t in r?r[t]:null;o!==n&&(n=o,e(Object.freeze(Object.assign({},o))))})}(t,t=>{if(void 0!==t){const r=e?e(t):t??{};(0,S.b)(n,r)||o(r)}}),[]),n}var q=n(42853);function z(t){const[e,n]=(0,r.useState)([]);return(0,r.useEffect)(()=>(0,a.zF)().subscribe(r=>{const o=r.slots[t]?.assignedExtensions.map(t=>t.id)??[];(0,q.A)(o,e)||n(o)}),[]),e}var H=n(9166);function G(t,e){const{data:n,error:o,mutate:i,isLoading:s,isValidating:a}=(0,I.Ay)(`${H.Zu}?patient=${t}&includeEncounterless=${e}`,A.lo);return(0,r.useMemo)(()=>({isLoading:s,data:n?.data.results??[],error:o,mutate:i,isValidating:a}),[n,o,s,a,i])}function Y(t){(0,r.useEffect)(()=>{if(t){const t=window.getComputedStyle(document.body).overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}}},[t])}var J=n(95819);const Q={},X='No ComponentContext has been provided. This should come from "openmrsComponentDecorator".\nUsually this is already applied when using "getAsyncLifecycle" or "getSyncLifecycle".';function Z(t){const e=(0,r.useMemo)(J.GI,[]),n=function(t,e){const[n,o]=(0,r.useState)(function(t,e){return e?()=>{const n=t.getState(),r=(0,J.P0)(n,e.extensionSlotName,e.extensionId);if(r.loaded&&r.config)return r.config}:null}(t,e));return(0,r.useEffect)(()=>{if(e)return t.subscribe(t=>{const r=(0,J.P0)(t,e.extensionSlotName,e.extensionId);r.loaded&&r.config&&!(0,q.A)(r.config,n)&&o(r.config)})},[t,e,n]),n}(e,t);if(!n&&t){const n=`${t.extensionSlotName}-${t.extensionId}`;throw!Q[n]&&e&&(Q[n]=function(t,e){return new Promise(n=>{const r=t.subscribe(t=>{const o=(0,J.P0)(t,e.extensionSlotName,e.extensionId);o.loaded&&o.config&&(n(o.config),r())})})}(e,t)),Q[n]}return n||{}}function tt(t){const{moduleName:e,extension:n}=(0,r.useContext)(o),i=t?.externalModuleName??e;if(!i&&!n)throw Error(X);const s=function(t){const e=(0,r.useMemo)(()=>(0,J.IS)(t),[t]),n=t,o=function(t){const[e,n]=(0,r.useState)(function(t){return()=>{const e=t.getState();return e.loaded&&e.config?e.config:null}}(t));return(0,r.useEffect)(()=>t?.subscribe(t=>{t.loaded&&t.config&&n(t.config)}),[t]),e}(e);if(!o)throw Q[n]||(Q[n]=function(t){return new Promise(e=>{const n=t.subscribe(t=>{t.loaded&&t.config&&(e(t.config),n())})})}(e)),Q[n];return o}(i),a=Z(n);return(0,r.useMemo)(()=>t?.externalModuleName&&i===t.externalModuleName?{...s}:{...s,...a},[i,t?.externalModuleName,s,a])}const et=y;var nt=n(23184),rt=n(52834);function ot(){let[t,e]=(0,r.useState)((0,rt.s)());return(0,r.useEffect)(()=>(0,nt.gj)(({online:t})=>e(t)),[]),t}function it(t,e=300){const[n,o]=(0,r.useState)(t);return(0,r.useEffect)(()=>{const n=setTimeout(()=>{o(t)},e);return()=>{clearTimeout(n)}},[t,e]),n}var st=n(88010);const at=`custom:${[["admissionDecisionConcept","ref"],["admissionEncounterType","ref"],["admissionForm","ref"],["atFacilityVisitType","ref"],["bedAssignmentEncounterType","ref"],["cancelADTRequestEncounterType","ref"],["checkInClerkEncounterRole","ref"],["checkInEncounterType","ref"],["clinicianEncounterRole","ref"],["conceptSourcesForDiagnosisSearch","ref"],["consultEncounterType","ref"],["consultFreeTextCommentsConcept","ref"],["denyAdmissionConcept","ref"],["diagnosisMetadata","ref"],["diagnosisSets","ref"],["dischargeForm","ref"],["dispositionDescriptor","ref"],["dispositions","ref"],["emrApiConceptSource","ref"],["exitFromInpatientEncounterType","ref"],["extraPatientIdentifierTypes","ref"],["fullPrivilegeLevel","ref"],["highPrivilegeLevel","ref"],["identifierTypesToSearch","ref"],["inpatientNoteEncounterType","ref"],["lastViewedPatientSizeLimit","ref"],["metadataSourceName","ref"],["motherChildRelationshipType","ref"],["narrowerThanConceptMapType","ref"],["nonDiagnosisConceptSets","ref"],["orderingProviderEncounterRole","ref"],["patientDiedConcept","ref"],["personImageDirectory","ref"],["primaryIdentifierType","ref"],["sameAsConceptMapType","ref"],["suppressedDiagnosisConcepts","ref"],["supportsAdmissionLocationTag","(uuid,display,name,links)"],["supportsLoginLocationTag","(uuid,display,name,links)"],["supportsTransferLocationTag","(uuid,display,name,links)"],["supportsVisitsLocationTag","(uuid,display,name,links)"],["telephoneAttributeType","ref"],["testPatientPersonAttributeType","ref"],["transferForm","ref"],["transferRequestEncounterType","ref"],["transferWithinHospitalEncounterType","ref"],["unknownCauseOfDeathConcept","ref"],["unknownLocation","ref"],["unknownPatientPersonAttributeType","ref"],["unknownProvider","ref"],["visitAssignmentHandlerAdjustEncounterTimeOfDayIfNecessary","ref"],["visitExpireHours","ref"],["visitNoteEncounterType","ref"]].map(([t,e])=>`${t}:${e}`).join(",")}`;function ut(){const t=`${A.Jj}/emrapi/configuration?v=${at}`,e=st(t,A.lo);return(0,r.useMemo)(()=>({emrConfiguration:e.data?.data,isLoadingEmrConfiguration:e.isLoading,mutateEmrConfiguration:e.mutate,errorFetchingEmrConfiguration:e.error}),[e])}const ct=p((0,a.a9)());function lt(t){const e=y(t);return(0,r.useMemo)(()=>Object.fromEntries(e.map(t=>[t.name,t.meta])),[e])}const ht=p((0,a.zF)());var ft=n(76110);function pt(t){const{flags:e}=h(ft.jX);return e[t]?.enabled??!1}function dt(){const[,t]=(0,r.useState)(0);return(0,r.useCallback)(()=>{t(t=>t+1)},[])}function yt(t,e,n={}){return mt(t,e,bt,n)}const bt={getPaginatedUrl:(t,e,n)=>{if(t){const r=new URL((0,A.Gm)(t.toString()),window.location.toString());return r.searchParams.set("limit",""+e),r.searchParams.set("startIndex",""+n),r.searchParams.set("totalCount","true"),r.toString()}return null},getNextUrl:t=>{const e=t?.links?.find(t=>"next"==t.rel)?.uri;if(e){const t=new URL(e);return t.host=window.location.host,t.protocol=window.location.protocol,t.toString()}return null},getTotalCount:t=>t?.totalCount??Number.NaN,getCurrentPageSize:t=>t?.results?.length??Number.NaN,getData:t=>t?.results};function mt(t,e,n,o={}){const{getPaginatedUrl:i,getTotalCount:s,getCurrentPageSize:a,getData:u}=n,{immutable:c,swrConfig:l}=o,h=o.fetcher??A.lo,[f,p]=(0,r.useState)(1),d=(0,r.useRef)(Number.NaN),y=(0,r.useRef)(Number.NaN),b=e,m=(f-1)*e,v=(0,r.useMemo)(()=>i(t,b,m),[t,b,m]),g=c?st:I.Ay,{data:_,...w}=g(v,h,l);_?.data&&(d.current=s(_?.data),y.current=a(_?.data));const x=Math.ceil(d.current/e),O=(0,r.useCallback)(t=>{0<t&&t<=x?p(t):console.warn("Invalid attempt to go to out of bounds page: "+t)},[t,f,x]),S=(0,r.useCallback)(()=>{O(f+1)},[t,f,x]),E=(0,r.useCallback)(()=>{O(f-1)},[t,f,x]);return{data:u(_?.data),totalPages:x,totalCount:d.current,currentPage:f,currentPageSize:y,paginated:x>1,showNextButton:f<x,showPreviousButton:f>1,goTo:O,goToNext:S,goToPrevious:E,...w}}function vt(t,e,n={}){return mt(t,e,gt(),n)}function gt(){return{getPaginatedUrl:(t,e,n)=>{if(t){const r=new URL((0,A.Gm)(t.toString()),window.location.toString());return r.searchParams.set("_count",""+e),r.searchParams.set("_getpagesoffset",""+n),r.toString()}return null},getNextUrl:t=>{const e=t?.link?.find(t=>"next"==t.relation)?.url;if(e){const t=new URL(e);return t.host=window.location.host,t.protocol=window.location.protocol,t.toString()}return null},getTotalCount:t=>t?.total??Number.NaN,getCurrentPageSize:t=>t?.entry?.length??Number.NaN,getData:t=>t?.entry?.map(t=>t.resource)}}var _t=n(98394);function wt(t,e={}){return xt(t,bt,e)}function xt(t,e,n={}){const{swrInfiniteConfig:o,immutable:i}=n,{getNextUrl:s,getTotalCount:a,getData:u}=e,c=n.fetcher??A.lo,l=(0,r.useCallback)((n,r)=>0==n?t?.toString()??null:e.getNextUrl(r.data),[t]),{data:h,size:f,setSize:p,...d}=_t(l,c,{...o,...i?{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1}:{}}),y=s(h?.[h.length-1].data),b=null!=y,m=a(h?.[0]?.data);return{data:h?.flatMap(t=>u(t.data)),totalCount:m,hasMore:b,loadMore:()=>{p((h?.length??0)+1)},nextUri:y,...d}}function Ot(t,e={}){return St(t,bt,e)}function St(t,e,n={}){const o=xt(t,e,n),{hasMore:i,error:s,data:a,loadMore:u,isLoading:c,nextUri:l}=o;return(0,r.useEffect)(()=>{i&&!s&&u()},[i,l]),n.partialData?o:{...o,data:i||s?void 0:a,isLoading:c||i}}function Et(t,e={}){return St(t,gt(),e)}function Pt(t,e={}){return xt(t,gt(),e)}function jt(){let t="tablet";return document.body.classList.forEach(e=>{switch(e){case"omrs-breakpoint-lt-tablet":t="phone";break;case"omrs-breakpoint-gt-small-desktop":t="large-desktop";break;case"omrs-breakpoint-gt-tablet":t="small-desktop"}}),t}function At(){const[t,e]=(0,r.useState)(jt);return(0,r.useEffect)(()=>{const t=()=>{e(jt())};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),t}const kt=t=>"small-desktop"===t||"large-desktop"===t;function Ct(t){const e=(0,r.useContext)(o);(0,r.useEffect)(()=>(e&&e.moduleName&&(t.componentContext=e),(0,a.Vx)(t),()=>{(0,a.sr)(t.name)}),[e,t])}function Tt(){return h(a.Gp)}function Nt(t=null,e=null){const[n,o]=(0,r.useState)([]);return(0,r.useEffect)(()=>{const n=(0,H.Vs)(t,e).subscribe(t=>{o(t)},t=>{console.error(t)});return()=>n.unsubscribe()},[t,e]),n}function It(t,e=!0){const n=(0,r.useRef)(null);return(0,r.useEffect)(()=>{const r=r=>{e&&n.current&&r.target&&r.target instanceof Node&&(n.current.contains(r.target)||t(r))};return window.addEventListener("mousedown",r),window.addEventListener("touchstart",r),()=>{window.removeEventListener("mousedown",r),window.removeEventListener("touchstart",r)}},[t,e]),n}function Mt(t){const e=(0,r.useRef)();return(0,r.useEffect)(()=>{const n=new IntersectionObserver(e=>{for(const n of e)if(n.isIntersecting)return void t()},{threshold:1});return e.current&&n.observe(e.current),()=>{e.current&&n.unobserve(e.current)}},[e.current,t]),e}function Rt(t,e={}){const{abortController:n,fetchInit:o,url:i,swrConfig:s}=e,a=K(),u=(0,r.useMemo)(()=>o?.signal??n?.signal??a.signal,[n?.signal,o?.signal,a.signal]),c=(0,r.useCallback)(t=>{const e=function(t,e){if(e)return"function"==typeof e?e(t):e;if("string"==typeof t)return t;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 ${t}.`)}(t,i);return(0,A.lo)(e,{...o,signal:u})},[u,o,i]);return(0,I.Ay)(t,c,s)}const Dt=10;function $t(t=[],e=Dt){const[n,o]=(0,r.useState)(1),i=(0,r.useMemo)(()=>"number"==typeof e&&e>0?Math.max(1,Math.ceil(t.length/e)):1,[t.length,e]),s=(0,r.useMemo)(()=>{const r=(n-1)*e,o=(n+0)*e;return t.slice(r,o)},[t,n,e]),a=(0,r.useCallback)(t=>{o(Math.max(1,Math.min(i,t)))},[o,i]),u=(0,r.useCallback)(()=>{n<i&&o(n+1)},[n,i,o]),c=(0,r.useCallback)(()=>{n>1&&o(n-1)},[n,o]);return(0,r.useMemo)(()=>({results:s,totalPages:i,currentPage:n,paginated:t.length>e,showNextButton:n<i,showPreviousButton:n>1,goTo:a,goToNext:u,goToPrevious:c}),[s,i,t.length,e,n,a,u,c])}function Lt(){const t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}function Bt(t){const[e,n]=(0,r.useState)(t??Lt()),{data:o,error:i,isValidating:s}=(0,I.Ay)(e?["patient",e]:null,()=>(0,H.hG)(e,{}));return(0,r.useEffect)(()=>{const t=()=>{const t=Lt();t!==e&&n(t)};return window.addEventListener("single-spa:routing-event",t),()=>window.removeEventListener("single-spa:routing-event",t)},[e]),(0,r.useMemo)(()=>({isLoading:s&&!i&&!o,patient:o,patientUuid:e,error:i}),[s,i,o,e])}function Ut(){const t=`${A.Jj}/metadatamapping/termmapping?v=custom:(metadataUuid)&code=emr.primaryIdentifierType`,{data:e,error:n,isLoading:o}=(0,I.Ay)(t,A.lo);return(0,r.useMemo)(()=>({primaryIdentifierCode:e?.data?.results[0]?.metadataUuid,isLoading:o,error:n}),[e,n,o])}function Vt(t){const{extensions:e,extensionSlotModuleName:n}=b(t);return t?e.map(e=>({state:i})=>r.createElement(o.Provider,{value:{moduleName:n,featureName:"",extension:{extensionId:e.id,extensionSlotName:t,extensionSlotModuleName:n}}},r.createElement(u,{state:i}))):[]}var Ft=n(23464),Kt=n(85602);const Wt={setVisitContext:(t,e)=>null==e?{manuallySetVisitUuid:null}:{manuallySetVisitUuid:e.uuid,patientUuid:e.patient?.uuid},mutateVisit(t){for(const e of Object.values(t.mutateVisitCallbacks??{}))e();return{}}};function qt(t){const e=(0,r.useId)();return(0,r.useEffect)(()=>{const n=(0,H.BX)();return t&&n.setState({mutateVisitCallbacks:{...n.getState().mutateVisitCallbacks,[e]:t}}),()=>{if(t){const t={...n.getState().mutateVisitCallbacks};delete t[e],n.setState({mutateVisitCallbacks:t})}}},[e,t]),f((0,H.BX)(),Wt)}function zt(t,e=H.Rb){const{patientUuid:n,manuallySetVisitUuid:o,setVisitContext:i}=qt(),s=t&&n==t?o:null,a=`?patient=${t}&v=${e}&includeInactive=false`,u=`/${s}?v=${e}`,{data:c,error:l,mutate:h,isValidating:f}=(0,I.Ay)(t?`${A.Jj}/visit${a}`:null,A.lo),{data:p,error:d,mutate:y,isValidating:b}=(0,I.Ay)(t&&s?`${A.Jj}/visit${u}`:null,A.lo),m=(0,r.useMemo)(()=>c?.data.results.find(t=>null===t.stopDatetime)??null,[c]),v=(0,r.useMemo)(()=>s&&p?p.data:null,[p,s]),g=(0,r.useRef)(null);(0,r.useEffect)(()=>{!f&&m&&n===t&&null===o&&i(m),b||(g.current&&v&&g.current.uuid===v.uuid&&!g.current.stopDatetime&&v.stopDatetime&&i(null),g.current=v)},[v,o,m,f,b,n]);const _=(0,r.useCallback)(()=>{h(),y()},[h,y]);qt(_);const w=Boolean(!c||s&&!p),x=Boolean(s?d:l),O=w&&!x;return{error:l||d,mutate:_,isValidating:f||b,activeVisit:m,currentVisit:v,currentVisitIsRetrospective:Boolean(s),isLoading:O}}function Ht(){const[t,e]=(0,r.useState)([]);return(0,r.useEffect)(()=>{const t=(0,H.Pu)().subscribe(t=>{e(t)},t=>console.error(t));return()=>t.unsubscribe()},[]),t}let Gt;function Yt(){const t=(0,r.useRef)(),[e,n]=(0,r.useState)(null);let o=null;if(!e){if(Gt){const t=(0,A.EW)().getState();t.loaded&&(o=t.session)}else Gt=new Promise(e=>{const n=({loaded:n,session:r})=>{n&&(e(r),o=r,t.current&&(t.current(),t.current=void 0))};n((0,A.EW)().getState()),o||(t.current=(0,A.EW)().subscribe(n))});if(!o)throw Gt;n(o)}(0,r.useEffect)(()=>(t.current||(t.current=(0,A.EW)().subscribe(({loaded:t,session:e})=>{t&&(o=e,n(e))})),()=>{t.current&&(t.current(),t.current=void 0)}),[]);const i=e||o;if(!i)throw Gt?(console.warn("useSession is in an unexpected state. Attempting to recover."),Gt):Error("useSession is in an invalid state.");return i}Ft.extend(Kt)},58440:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(71077),s=n(75901);e.repeatWhen=function(t){return function(e){return e.lift(new a(t))}};var a=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.notifier,e))},t}(),u=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.notifier=n,o.source=r,o.sourceIsBeingSubscribedTo=!0,o}return o(e,t),e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=void 0),e&&(e.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new i.Subject;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=s.innerSubscribe(e,new s.SimpleInnerSubscriber(this))},e}(s.SimpleOuterSubscriber)},58538:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return o(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(n(70469).AsyncAction);e.QueueAction=i},58636:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rxSubscriber="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),e.$$rxSubscriber=e.rxSubscriber},59468:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hostReportError=function(t){setTimeout(function(){throw t},0)}},59768:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.debounce=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.durationSelector))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return o(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=i.innerSubscribe(e,new i.SimpleInnerSubscriber(this)))&&!n.closed&&this.add(this.durationSubscription=n)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(i.SimpleOuterSubscriber)},60208:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(80980);e.concatAll=function(){return r.mergeAll(1)}},60315:(t,e,n)=>{"use strict";n.d(e,{$:()=>o});var r=!1,o={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack,r=t},get useDeprecatedSynchronousErrorHandling(){return r}}},60781:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(89233),s=n(85295),a=n(75901);function u(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?function(r){return r.pipe(u(function(n,r){return s.from(t(n,r)).pipe(i.map(function(t,o){return e(n,t,r,o)}))},n))}:("number"==typeof e&&(n=e),function(e){return e.lift(new c(t,n))})}e.mergeMap=u;var c=function(){function t(t,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.project,this.concurrent))},t}();e.MergeMapOperator=c;var l=function(t){function e(e,n,r){void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=n,o.concurrent=r,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return o(e,t),e.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new a.SimpleInnerSubscriber(this),n=this.destination;n.add(e);var r=a.innerSubscribe(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(a.SimpleOuterSubscriber);e.MergeMapSubscriber=l,e.flatMap=u},60937:(t,e,n)=>{"use strict";n.d(e,{J:()=>i,N:()=>o});var r=n(23184);function o(t){const e=s(t);setTimeout(()=>{throw e})}function i(){const t=Error();return e=>{s(e).stack+=`\nAsync stacktrace:\n${t.stack}`,o(e)}}function s(t){let e;if(t instanceof Error)return t;if(null===t)return Error("'null' was thrown as an error");if("object"==typeof t){try{e=`Object thrown as error: ${JSON.stringify(t)}`}catch(n){e=`Object thrown as error with the following properties: ${Object.keys(t)}`}return Error(e)}return void 0===t?Error("'undefined' was thrown as an error"):Error(t.toString())}window.onerror=function(t){return console.error("Unexpected error: ",t),(0,r.Vt)({description:t??"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(t){console.error("Unhandled rejection: ",t.reason),(0,r.Vt)({description:t.reason??"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}},61115:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(86735),o=n(85002),i=n(26691),s=n(89233);e.timeInterval=function(t){return void 0===t&&(t=r.async),function(e){return i.defer(function(){return e.pipe(o.scan(function(e,n){var r=e.current;return{value:n,current:t.now(),last:r}},{current:t.now(),value:void 0,last:void 0}),s.map(function(t){var e=t.current,n=t.last,r=t.value;return new a(r,e-n)}))})}};var a=function(t,e){this.value=t,this.interval=e};e.TimeInterval=a},61171:(t,e,n)=>{"use strict";n.d(e,{v:()=>l});var r=n(32505),o=n(18364),i=n(90979),s=n(29075),a=n(18904),u=n(60315),c=n(44856),l=function(t){function e(n,r,o){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=i.I;break;case 1:if(!n){s.destination=i.I;break}if("object"==typeof n){n instanceof e?(s.syncErrorThrowable=n.syncErrorThrowable,s.destination=n,n.add(s)):(s.syncErrorThrowable=!0,s.destination=new h(s,n));break}default:s.syncErrorThrowable=!0,s.destination=new h(s,n,r,o)}return s}return r.C6(e,t),e.prototype[a.D]=function(){return this},e.create=function(t,n,r){var o=new e(t,n,r);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(s.y),h=function(t){function e(e,n,r,s){var a,u=t.call(this)||this;u._parentSubscriber=e;var c=u;return(0,o.T)(n)?a=n:n&&(a=n.next,r=n.error,s=n.complete,n!==i.I&&(c=Object.create(n),(0,o.T)(c.unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=a,u._error=r,u._complete=s,u}return r.C6(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;u.$.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=u.$.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):(0,c.T)(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;(0,c.T)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};u.$.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),u.$.useDeprecatedSynchronousErrorHandling)throw t;(0,c.T)(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!u.$.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return u.$.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):((0,c.T)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(l)},61469:(t,e,n)=>{"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){s(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){var n;if("function"!=typeof(n=e.domElement?function(){return e.domElement}:e.domElementGetter?e.domElementGetter:t.domElementGetter?t.domElementGetter:function(t){var e=t.appName||t.name;if(!e)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(e);return function(){var t=document.getElementById(n);return t||((t=document.createElement("div")).id=n,document.body.appendChild(t)),t}}(e)))throw Error("single-spa's dom-element-getter-helpers was given an invalid domElementGetter for application or parcel '".concat(e.name,"'. Expected a function, received ").concat(a(n)));return function(){var t=n(e);if(!(t instanceof HTMLElement))throw Error("single-spa's dom-element-getter-helpers: domElementGetter returned an invalid dom element for application or parcel '".concat(e.name,"'. Expected HTMLElement, received ").concat(a(t)));return t}}n.d(e,{A:()=>h,i:()=>c});var c=null;try{c=require("react").createContext()}catch(r){}var l={React:null,ReactDOM:null,ReactDOMClient:null,rootComponent:null,loadRootComponent:null,errorBoundary:null,errorBoundaryClass:null,domElementGetter:null,parcelCanUpdate:!0,suppressComponentDidCatchWarning:!1,domElements:{},renderResults:{},updateResolves:{},unmountResolves:{}};function h(t){if("object"!==i(t))throw new Error("single-spa-react requires a configuration object");var e,n=o(o({},l),t);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!==(e=n.ReactDOMClient)&&void 0!==e&&e.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");!c&&n.React.createContext&&(c=n.React.createContext()),n.SingleSpaRoot=function(t){function e(t){e.displayName="SingleSpaRoot(".concat(t.name,")")}return e.prototype=Object.create(t.React.Component.prototype),e.prototype.componentDidMount=function(){setTimeout(this.props.mountFinished)},e.prototype.componentWillUnmount=function(){setTimeout(this.props.unmountFinished)},e.prototype.render=function(){return setTimeout(this.props.updateFinished),this.props.children},e}(n);var r={bootstrap:f.bind(null,n),mount:p.bind(null,n),unmount:d.bind(null,n)};return n.parcelCanUpdate&&(r.update=y.bind(null,n)),r}function f(t,e){return t.rootComponent?Promise.resolve():t.loadRootComponent(e).then(function(e){t.rootComponent=e})}function p(t,e){return new Promise(function(n,r){t.suppressComponentDidCatchWarning||!function(t){if(!(t&&"string"==typeof t.version&&t.version.indexOf(".")>=0))return!1;var e=t.version.slice(0,t.version.indexOf("."));try{return Number(e)>=16}catch(t){return!1}}(t.React)||t.errorBoundary||t.errorBoundaryClass||(t.rootComponent.prototype?t.rootComponent.prototype.componentDidCatch||console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent should implement componentDidCatch to avoid accidentally unmounting the entire single-spa application.")):console.warn("single-spa-react: ".concat(e.name||e.appName||e.childAppName,"'s rootComponent does not implement an error boundary. If using a functional component, consider providing an opts.errorBoundary to singleSpaReact(opts).")));var o=v(t,e,function(){n(this)}),i=u(t,e)(),s=function(t){var e=t.renderType,n=t.elementToRender,r=t.domElement,o=t.reactDom[e];if("function"!=typeof o)throw new Error('renderType "'.concat(e,'" did not return a function.'));switch(e){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:b(t),renderType:m(t)});t.domElements[e.name]=i,t.renderResults[e.name]=s})}function d(t,e){return new Promise(function(n){t.unmountResolves[e.name]=n;var r=t.renderResults[e.name];r&&r.unmount?r.unmount():b(t).unmountComponentAtNode(t.domElements[e.name]),delete t.domElements[e.name],delete t.renderResults[e.name]})}function y(t,e){return new Promise(function(n){t.updateResolves[e.name]||(t.updateResolves[e.name]=[]),t.updateResolves[e.name].push(n);var r=v(t,e,null),o=t.renderResults[e.name];if(o&&o.render)o.render(r);else{var i=u(t,e)();b(t).render(r,i)}})}function b(t){return t.ReactDOMClient||t.ReactDOM}function m(t){return"function"==typeof t.renderType?t.renderType():t.renderType}function v(t,e,n){var r=t.React.createElement(t.rootComponent,e),i=c?t.React.createElement(c.Provider,{value:e},r):r;return(t.errorBoundary||e.errorBoundary||t.errorBoundaryClass||e.errorBoundaryClass)&&(t.errorBoundaryClass=t.errorBoundaryClass||e.errorBoundaryClass||function(t,e){function n(e){t.React.Component.apply(this,arguments),this.state={caughtError:null,caughtErrorInfo:null},n.displayName="SingleSpaReactErrorBoundary(".concat(e.name,")")}return n.prototype=Object.create(t.React.Component.prototype),n.prototype.render=function(){return this.state.caughtError?(t.errorBoundary||e.errorBoundary)(this.state.caughtError,this.state.caughtErrorInfo,this.props):this.props.children},n.prototype.componentDidCatch=function(t,e){this.setState({caughtError:t,caughtErrorInfo:e})},n}(t,e),i=t.React.createElement(t.errorBoundaryClass,e,i)),t.React.createElement(t.SingleSpaRoot,o(o({},e),{},{mountFinished:n,updateFinished:function(){t.updateResolves[e.name]&&(t.updateResolves[e.name].forEach(function(t){return t()}),delete t.updateResolves[e.name])},unmountFinished:function(){t.unmountResolves[e.name]&&(t.unmountResolves[e.name](),delete t.unmountResolves[e.name])}}),i)}},61650:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(99623),o=n(47986);e.endWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return r.concat(e,o.of.apply(void 0,t))}}},61758:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(91465);const o=function(){try{var t=(0,r.A)(Object,"defineProperty");return t({},"",{}),t}catch(t){}}()},62637:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}();e.EmptyError=n},62988:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(60781);e.mergeMapTo=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?r.mergeMap(function(){return t},e,n):("number"==typeof e&&(n=e),r.mergeMap(function(){return t},n))}},63220:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=Math.max;const o=function(t,e,n){return e=r(void 0===e?t.length-1:e,0),function(){for(var o=arguments,i=-1,s=r(o.length-e,0),a=Array(s);++i<s;)a[i]=o[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=o[i];return u[e]=n(a),function(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}(t,this,u)}}},63266:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(59468);e.subscribeToPromise=function(t){return function(e){return t.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,r.hostReportError),e}}},63792:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(58538),o=n(78831);e.queueScheduler=new o.QueueScheduler(r.QueueAction),e.queue=e.queueScheduler},64103:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.not=function(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}},64629:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.filter=function(t,e){return function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.thisArg))},t}(),a=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.thisArg=r,o.count=0,o}return o(e,t),e.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}e&&this.destination.next(t)},e}(i.Subscriber)},64868:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(85356);e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(r.zip.apply(void 0,[e].concat(t)))}}},65246:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(88724);const o=function(t,e){var n=e?(0,r.A)(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}},65893:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.exhaust=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return o(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(i.innerSubscribe(t,new i.SimpleInnerSubscriber(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(i.SimpleOuterSubscriber)},66255:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(99623);e.concat=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(r.concat.apply(void 0,[e].concat(t)))}}},66740:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isDate=function(t){return t instanceof Date&&!isNaN(+t)}},67124:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.skip=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.total))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return o(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(i.Subscriber)},67446:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092),o=n(422),i=n(85791);e.fromArray=function(t,e){return e?i.scheduleArray(t,e):new r.Observable(o.subscribeToArray(t))}},67595:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(77759),o=n(58636),i=n(74143);e.toSubscriber=function(t,e,n){if(t){if(t instanceof r.Subscriber)return t;if(t[o.rxSubscriber])return t[o.rxSubscriber]()}return t||e||n?new r.Subscriber(t,e,n):new r.Subscriber(i.empty)}},67606:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(46713);e.isInteropObservable=function(t){return t&&"function"==typeof t[r.observable]}},67670:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12873),o=n(91039),i=n(85791),s=n(34178),a=n(67606),u=n(94215),c=n(90624),l=n(74442);e.scheduled=function(t,e){if(null!=t){if(a.isInteropObservable(t))return r.scheduleObservable(t,e);if(u.isPromise(t))return o.schedulePromise(t,e);if(c.isArrayLike(t))return i.scheduleArray(t,e);if(l.isIterable(t)||"string"==typeof t)return s.scheduleIterable(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}},68022:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(53912),a=n(84864);e.tap=function(t,e,n){return function(r){return r.lift(new u(t,e,n))}};var u=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.nextOrObserver,this.error,this.complete))},t}(),c=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i._tapNext=s.noop,i._tapError=s.noop,i._tapComplete=s.noop,i._tapError=r||s.noop,i._tapComplete=o||s.noop,a.isFunction(n)?(i._context=i,i._tapNext=n):n&&(i._context=n,i._tapNext=n.next||s.noop,i._tapError=n.error||s.noop,i._tapComplete=n.complete||s.noop),i}return o(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(i.Subscriber)},70469:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return o(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),setInterval(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n=!1,r=void 0;try{this.work(t)}catch(t){n=!0,r=!!t&&t||new Error(t)}if(n)return this.unsubscribe(),r},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,n=e.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(n(55169).Action);e.AsyncAction=i},71077:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(95092),s=n(77759),a=n(21016),u=n(18860),c=n(43716),l=n(58636),h=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return o(e,t),e}(s.Subscriber);e.SubjectSubscriber=h;var f=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return o(e,t),e.prototype[l.rxSubscriber]=function(){return new h(this)},e.prototype.lift=function(t){var e=new p(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new u.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new u.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new u.ObjectUnsubscribedError;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new u.ObjectUnsubscribedError;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new u.ObjectUnsubscribedError;return this.hasError?(t.error(this.thrownError),a.Subscription.EMPTY):this.isStopped?(t.complete(),a.Subscription.EMPTY):(this.observers.push(t),new c.SubjectSubscription(this,t))},e.prototype.asObservable=function(){var t=new i.Observable;return t.source=this,t},e.create=function(t,e){return new p(t,e)},e}(i.Observable);e.Subject=f;var p=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return o(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):a.Subscription.EMPTY},e}(f);e.AnonymousSubject=p},71929:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(85002),o=n(96696),i=n(90952),s=n(27928);e.reduce=function(t,e){return arguments.length>=2?function(n){return s.pipe(r.scan(t,e),o.takeLast(1),i.defaultIfEmpty(e))(n)}:function(e){return s.pipe(r.scan(function(e,n,r){return t(e,n,r+1)}),o.takeLast(1))(e)}}},73766:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(82900),o=n(3069);e.asapScheduler=new o.AsapScheduler(r.AsapAction),e.asap=e.asapScheduler},74143:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5319),o=n(59468);e.empty={closed:!0,next:function(t){},error:function(t){if(r.config.useDeprecatedSynchronousErrorHandling)throw t;o.hostReportError(t)},complete:function(){}}},74442:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(78258);e.isIterable=function(t){return t&&"function"==typeof t[r.iterator]}},75434:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(4942);e.materialize=function(){return function(t){return t.lift(new a)}};var a=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new u(t))},t}(),u=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype._next=function(t){this.destination.next(s.Notification.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(s.Notification.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(s.Notification.createComplete()),t.complete()},e}(i.Subscriber)},75772:(t,e,n)=>{"use strict";n.d(e,{B7:()=>h});var r=n(32505),o=n(87635),i=n(61171),s=n(29075),a=n(20320),u=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.C6(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(s.y),c=n(18904),l=function(t){function e(e){var n=t.call(this,e)||this;return n.destination=e,n}return r.C6(e,t),e}(i.v),h=function(t){function e(){var e=t.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return r.C6(e,t),e.prototype[c.D]=function(){return new l(this)},e.prototype.lift=function(t){var e=new f(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.P;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new a.P;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new a.P;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new a.P;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new a.P;return this.hasError?(t.error(this.thrownError),s.y.EMPTY):this.isStopped?(t.complete(),s.y.EMPTY):(this.observers.push(t),new u(this,t))},e.prototype.asObservable=function(){var t=new o.c;return t.source=this,t},e.create=function(t,e){return new f(t,e)},e}(o.c),f=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return r.C6(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):s.y.EMPTY},e}(h)},75901:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(95092),a=n(41727),u=function(t){function e(e){var n=t.call(this)||this;return n.parent=e,n}return o(e,t),e.prototype._next=function(t){this.parent.notifyNext(t)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(i.Subscriber);e.SimpleInnerSubscriber=u;var c=function(t){function e(e,n,r){var o=t.call(this)||this;return o.parent=e,o.outerValue=n,o.outerIndex=r,o}return o(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this)},e.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(i.Subscriber);e.ComplexInnerSubscriber=c;var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.notifyNext=function(t){this.destination.next(t)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(i.Subscriber);e.SimpleOuterSubscriber=l;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.notifyNext=function(t,e,n,r){this.destination.next(e)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(i.Subscriber);e.ComplexOuterSubscriber=h,e.innerSubscribe=function(t,e){if(!e.closed){if(t instanceof s.Observable)return t.subscribe(e);var n;try{n=a.subscribeTo(t)(e)}catch(t){e.error(t)}return n}}},76003:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(62637);e.single=function(t){return function(e){return e.lift(new a(t,e))}};var a=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.predicate,this.source))},t}(),u=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.seenValue=!1,o.index=0,o}return o(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new s.EmptyError)},e}(i.Subscriber)},76024:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.ignoreElements=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype._next=function(t){},e}(i.Subscriber)},76110:(t,e,n)=>{"use strict";n.d(e,{D3:()=>a,jX:()=>i,jj:()=>u,uA:()=>s,B4:()=>l,sM:()=>c});var r=n(23790);const o={flags:function(){const t={};for(const e of Object.keys(localStorage))if(e.startsWith("openmrs:feature-flag:")){const n=e.replace("openmrs:feature-flag:",""),r=JSON.parse(localStorage.getItem(`openmrs:feature-flag-meta:${n}`)||"{}");t[n]={enabled:"true"===localStorage.getItem(e),...r}}return t}()},i=(0,r.jf)("feature-flags",o);function s(t,e,n){i.setState(r=>({flags:{...r.flags,[t]:{enabled:r.flags[t]?.enabled??!1,label:e,description:n}}}))}function a(){const t=i.getState().flags;Object.keys(localStorage).filter(t=>t.startsWith("openmrs:feature-flag:")).forEach(e=>{const n=e.replace("openmrs:feature-flag:","");t[n]||(localStorage.removeItem(e),localStorage.removeItem(`openmrs:feature-flag-meta:${n}`))})}function u(t){return i.getState().flags[t].enabled}function c(t,e){i.subscribe(n=>{e(n.flags[t].enabled)})}function l(t,e){i.setState(n=>({flags:{...n.flags,[t]:{...n.flags[t],enabled:e}}}))}i.subscribe(t=>{for(const[e,n]of Object.entries(t.flags))localStorage.setItem(`openmrs:feature-flag:${e}`,n.enabled.toString()),localStorage.setItem(`openmrs:feature-flag-meta:${e}`,JSON.stringify({label:n.label,description:n.description}))})},76124:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(99271),o=n(26979),i=Object.prototype.hasOwnProperty;const s=function(t,e,n){var s=t[e];i.call(t,e)&&(0,o.A)(s,n)&&(void 0!==n||e in t)||(0,r.A)(t,e,n)}},76527:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.expand=function(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.concurrent,this.scheduler))},t}();e.ExpandOperator=s;var a=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.project=n,i.concurrent=r,i.scheduler=o,i.index=0,i.active=0,i.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(i.buffer=[]),i}return o(e,t),e.dispatch=function(t){var e=t.subscriber,n=t.result,r=t.value,o=t.index;e.subscribeToProjection(n,r,o)},e.prototype._next=function(t){var n=this.destination;if(n.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){n.next(t);try{var o=(0,this.project)(t,r);if(this.scheduler){var i={subscriber:this,result:o,value:t,index:r};this.destination.add(this.scheduler.schedule(e.dispatch,0,i))}else this.subscribeToProjection(o,t,r)}catch(t){n.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,n){this.active++,this.destination.add(i.innerSubscribe(t,new i.SimpleInnerSubscriber(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t){this._next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t&&t.length>0&&this._next(t.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(i.SimpleOuterSubscriber);e.ExpandSubscriber=a},76788:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(89152),s=n(87778);e.withLatestFrom=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new a(r,n))}};var a=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.observables,this.project))},t}(),u=function(t){function e(e,n,r){var o=t.call(this,e)||this;o.observables=n,o.project=r,o.toRespond=[];var i=n.length;o.values=new Array(i);for(var a=0;a<i;a++)o.toRespond.push(a);for(a=0;a<i;a++){var u=n[a];o.add(s.subscribeToResult(o,u,void 0,a))}return o}return o(e,t),e.prototype.notifyNext=function(t,e,n){this.values[n]=e;var r=this.toRespond;if(r.length>0){var o=r.indexOf(n);-1!==o&&r.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.OuterSubscriber)},77089:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(62637),o=n(64629),i=n(85624),s=n(90952),a=n(8347),u=n(78522);e.first=function(t,e){var n=arguments.length>=2;return function(c){return c.pipe(t?o.filter(function(e,n){return t(e,n,c)}):u.identity,i.take(1),n?s.defaultIfEmpty(e):a.throwIfEmpty(function(){return new r.EmptyError}))}}},77650:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.bufferCount=function(t,e){return void 0===e&&(e=null),function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?u:a}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return o(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(i.Subscriber),u=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.bufferSize=n,o.startBufferEvery=r,o.buffers=[],o.count=0,o}return o(e,t),e.prototype._next=function(t){var e=this,n=e.bufferSize,r=e.startBufferEvery,o=e.buffers,i=e.count;this.count++,i%r===0&&o.push([]);for(var s=o.length;s--;){var a=o[s];a.push(t),a.length===n&&(o.splice(s,1),this.destination.next(a))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(i.Subscriber)},77759:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(84864),s=n(74143),a=n(21016),u=n(58636),c=n(5319),l=n(59468),h=function(t){function e(n,r,o){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=s.empty;break;case 1:if(!n){i.destination=s.empty;break}if("object"==typeof n){n instanceof e?(i.syncErrorThrowable=n.syncErrorThrowable,i.destination=n,n.add(i)):(i.syncErrorThrowable=!0,i.destination=new f(i,n));break}default:i.syncErrorThrowable=!0,i.destination=new f(i,n,r,o)}return i}return o(e,t),e.prototype[u.rxSubscriber]=function(){return this},e.create=function(t,n,r){var o=new e(t,n,r);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},e}(a.Subscription);e.Subscriber=h;var f=function(t){function e(e,n,r,o){var a,u=t.call(this)||this;u._parentSubscriber=e;var c=u;return i.isFunction(n)?a=n:n&&(a=n.next,r=n.error,o=n.complete,n!==s.empty&&(c=Object.create(n),i.isFunction(c.unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=a,u._error=r,u._complete=o,u}return o(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;c.config.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,n=c.config.useDeprecatedSynchronousErrorHandling;if(this._error)n&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)n?(e.syncErrorValue=t,e.syncErrorThrown=!0):l.hostReportError(t),this.unsubscribe();else{if(this.unsubscribe(),n)throw t;l.hostReportError(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};c.config.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),c.config.useDeprecatedSynchronousErrorHandling)throw t;l.hostReportError(t)}},e.prototype.__tryOrSetError=function(t,e,n){if(!c.config.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,n)}catch(e){return c.config.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(l.hostReportError(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(h);e.SafeSubscriber=f},78258:(t,e)=>{"use strict";function n(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}Object.defineProperty(e,"__esModule",{value:!0}),e.getSymbolIterator=n,e.iterator=n(),e.$$iterator=e.iterator},78522:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.identity=function(t){return t}},78831:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(n(25646).AsyncScheduler);e.QueueScheduler=i},78938:(t,e,n)=>{"use strict";n.d(e,{A:()=>h});var r=n(62135),o=n(34878),i=n(47313),s=Function.prototype,a=Object.prototype,u=s.toString,c=a.hasOwnProperty,l=u.call(Object);const h=function(t){if(!(0,i.A)(t)||"[object Object]"!=(0,r.A)(t))return!1;var e=(0,o.A)(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},79159:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.skipWhile=function(t){return function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return o(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(i.Subscriber)},79397:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(80743),o=n(92413),i=n(85295);e.combineLatest=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&r.isArray(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(i.from([e].concat(t)),new o.CombineLatestOperator(n))}}},80084:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});const r=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}},80743:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length}},80980:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(60781),o=n(78522);e.mergeAll=function(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),r.mergeMap(o.identity,t)}},82334:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8791),o=n(49529);e.publishBehavior=function(t){return function(e){return o.multicast(new r.BehaviorSubject(t))(e)}}},82784:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(86735),o=n(31027),i=n(35816),s=n(11673);e.timeout=function(t,e){return void 0===e&&(e=r.async),i.timeoutWith(t,s.throwError(new o.TimeoutError),e)}},82900:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(42839),s=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return o(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e.scheduled||(e.scheduled=i.Immediate.setImmediate(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);0===e.actions.length&&(i.Immediate.clearImmediate(n),e.scheduled=void 0)},e}(n(70469).AsyncAction);e.AsapAction=s},83153:(t,e,n)=>{"use strict";var r=n(89710),o=n(57338);function i(){return this.width=100,this.height=100,this.svg=o("svg"),this.context=[],this.setAttributes(this.svg,{xmlns:"http://www.w3.org/2000/svg",width:this.width,height:this.height}),this}t.exports=i,i.prototype.currentContext=function(){return this.context[this.context.length-1]||this.svg},i.prototype.end=function(){return this.context.pop(),this},i.prototype.currentNode=function(){var t=this.currentContext();return t.lastChild||t},i.prototype.transform=function(t){return this.currentNode().setAttribute("transform",Object.keys(t).map(function(e){return e+"("+t[e].join(",")+")"}).join(" ")),this},i.prototype.setAttributes=function(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n])})},i.prototype.setWidth=function(t){this.svg.setAttribute("width",Math.floor(t))},i.prototype.setHeight=function(t){this.svg.setAttribute("height",Math.floor(t))},i.prototype.toString=function(){return this.svg.toString()},i.prototype.rect=function(t,e,n,i,s){var a=this;if(Array.isArray(t))return t.forEach(function(t){a.rect.apply(a,t.concat(s))}),this;var u=o("rect");return this.currentContext().appendChild(u),this.setAttributes(u,r({x:t,y:e,width:n,height:i},s)),this},i.prototype.circle=function(t,e,n,i){var s=o("circle");return this.currentContext().appendChild(s),this.setAttributes(s,r({cx:t,cy:e,r:n},i)),this},i.prototype.path=function(t,e){var n=o("path");return this.currentContext().appendChild(n),this.setAttributes(n,r({d:t},e)),this},i.prototype.polyline=function(t,e){var n=this;if(Array.isArray(t))return t.forEach(function(t){n.polyline(t,e)}),this;var i=o("polyline");return this.currentContext().appendChild(i),this.setAttributes(i,r({points:t},e)),this},i.prototype.group=function(t){var e=o("g");return this.currentContext().appendChild(e),this.context.push(e),this.setAttributes(e,r({},t)),this}},83232:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(92209);e.concatMapTo=function(t,e){return r.concatMap(function(){return t},e)}},83903:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(71077),s=n(21016),a=n(89152),u=n(87778);e.windowToggle=function(t,e){return function(n){return n.lift(new c(t,e))}};var c=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.openings,this.closingSelector))},t}(),l=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.openings=n,o.closingSelector=r,o.contexts=[],o.add(o.openSubscription=u.subscribeToResult(o,n,n)),o}return o(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r<n;r++)e[r].window.next(t)},e.prototype._error=function(e){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,o=-1;++o<r;){var i=n[o];i.window.error(e),i.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var n=e.length,r=-1;++r<n;){var o=e[r];o.window.complete(),o.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,n=-1;++n<e;){var r=t[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,n,r,o){if(t===this.openings){var a=void 0;try{a=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var c=new i.Subject,l=new s.Subscription,h={window:c,subscription:l};this.contexts.push(h);var f=u.subscribeToResult(this,a,h);f.closed?this.closeWindow(this.contexts.length-1):(f.context=h,l.add(f)),this.destination.next(c)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,n=e[t],r=n.window,o=n.subscription;e.splice(t,1),r.complete(),o.unsubscribe()}},e}(a.OuterSubscriber)},84864:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isFunction=function(t){return"function"==typeof t}},85002:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.scan=function(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.accumulator,this.seed,this.hasSeed))},t}(),a=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.accumulator=n,i._seed=r,i.hasSeed=o,i.index=0,i}return o(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(i.Subscriber)},85203:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.refCount=function(){return function(t){return t.lift(new s(t))}};var s=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new a(t,n),o=e.subscribe(r);return r.closed||(r.connection=n.connect()),o},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return o(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},e}(i.Subscriber)},85295:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092),o=n(41727),i=n(67670);e.from=function(t,e){return e?i.scheduled(t,e):t instanceof r.Observable?t:new r.Observable(o.subscribeTo(t))}},85343:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.distinct=function(t,e){return function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.keySelector,this.flushes))},t}(),a=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.keySelector=n,o.values=new Set,r&&o.add(i.innerSubscribe(r,new i.SimpleInnerSubscriber(o))),o}return o(e,t),e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(t){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(i.SimpleOuterSubscriber);e.DistinctSubscriber=a},85356:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(67446),s=n(80743),a=n(77759),u=n(78258),c=n(75901);e.zip=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return"function"==typeof n&&t.pop(),i.fromArray(t,void 0).lift(new l(n))};var l=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new h(t,this.resultSelector))},t}();e.ZipOperator=l;var h=function(t){function e(e,n,r){void 0===r&&(r=Object.create(null));var o=t.call(this,e)||this;return o.resultSelector=n,o.iterators=[],o.active=0,o.resultSelector="function"==typeof n?n:void 0,o}return o(e,t),e.prototype._next=function(t){var e=this.iterators;s.isArray(t)?e.push(new p(t)):"function"==typeof t[u.iterator]?e.push(new f(t[u.iterator]())):e.push(new d(this.destination,this,t))},e.prototype._complete=function(){var t=this.iterators,e=t.length;if(this.unsubscribe(),0!==e){this.active=e;for(var n=0;n<e;n++){var r=t[n];r.stillUnsubscribed?this.destination.add(r.subscribe()):this.active--}}else this.destination.complete()},e.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},e.prototype.checkIterators=function(){for(var t=this.iterators,e=t.length,n=this.destination,r=0;r<e;r++)if("function"==typeof(s=t[r]).hasValue&&!s.hasValue())return;var o=!1,i=[];for(r=0;r<e;r++){var s,a=(s=t[r]).next();if(s.hasCompleted()&&(o=!0),a.done)return void n.complete();i.push(a.value)}this.resultSelector?this._tryresultSelector(i):n.next(i),o&&n.complete()},e.prototype._tryresultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(a.Subscriber);e.ZipSubscriber=h;var f=function(){function t(t){this.iterator=t,this.nextResult=t.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var t=this.nextResult;return this.nextResult=this.iterator.next(),t},t.prototype.hasCompleted=function(){var t=this.nextResult;return Boolean(t&&t.done)},t}(),p=function(){function t(t){this.array=t,this.index=0,this.length=0,this.length=t.length}return t.prototype[u.iterator]=function(){return this},t.prototype.next=function(t){var e=this.index++,n=this.array;return e<this.length?{value:n[e],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),d=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.parent=n,o.observable=r,o.stillUnsubscribed=!0,o.buffer=[],o.isComplete=!1,o}return o(e,t),e.prototype[u.iterator]=function(){return this},e.prototype.next=function(){var t=this.buffer;return 0===t.length&&this.isComplete?{value:null,done:!0}:{value:t.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(t){this.buffer.push(t),this.parent.checkIterators()},e.prototype.subscribe=function(){return c.innerSubscribe(this.observable,new c.SimpleInnerSubscriber(this))},e}(c.SimpleOuterSubscriber)},85476:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.count=function(t){return function(e){return e.lift(new s(t,e))}};var s=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.source))},t}(),a=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.count=0,o.index=0,o}return o(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(i.Subscriber)},85517:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(85356);e.zipAll=function(t){return function(e){return e.lift(new r.ZipOperator(t))}}},85602:function(t){t.exports=function(){"use strict";return function(t,e,n){e.prototype.isToday=function(){var t="YYYY-MM-DD",e=n();return this.format(t)===e.format(t)}}}()},85624:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(2519),a=n(34914);e.take=function(t){return function(e){return 0===t?a.empty():e.lift(new u(t))}};var u=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.total))},t}(),c=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return o(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(i.Subscriber)},85791:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092),o=n(21016);e.scheduleArray=function(t,e){return new r.Observable(function(n){var r=new o.Subscription,i=0;return r.add(e.schedule(function(){i!==t.length?(n.next(t[i++]),n.closed||r.add(this.schedule())):n.complete()})),r})}},85916:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.catchError=function(t){return function(e){var n=new s(t),r=e.lift(n);return n.caught=r}};var s=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.selector,this.caught))},t}(),a=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.selector=n,o.caught=r,o}return o(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new i.SimpleInnerSubscriber(this);this.add(r);var o=i.innerSubscribe(n,r);o!==r&&this.add(o)}},e}(i.SimpleOuterSubscriber)},86050:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(89233);e.pluck=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(e){return r.map(function(t,e){return function(n){for(var r=n,o=0;o<e;o++){var i=null!=r?r[t[o]]:void 0;if(void 0===i)return;r=i}return r}}(t,n))(e)}}},86430:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(75901);e.mergeScan=function(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.accumulator,this.seed,this.concurrent))},t}();e.MergeScanOperator=s;var a=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.accumulator=n,i.acc=r,i.concurrent=o,i.hasValue=!1,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return o(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,t,e)}catch(t){return n.error(t)}this.active++,this._innerSub(r)}else this.buffer.push(t)},e.prototype._innerSub=function(t){var e=new i.SimpleInnerSubscriber(this),n=this.destination;n.add(e);var r=i.innerSubscribe(t,e);r!==e&&n.add(r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t){var e=this.destination;this.acc=t,this.hasValue=!0,e.next(t)},e.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(i.SimpleOuterSubscriber);e.MergeScanSubscriber=a},86735:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(70469),o=n(25646);e.asyncScheduler=new o.AsyncScheduler(r.AsyncAction),e.async=e.asyncScheduler},87362:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.isEmpty=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){return t.call(this,e)||this}return o(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(i.Subscriber)},87440:(t,e,n)=>{"use strict";n.d(e,{wE:()=>_,_3:()=>f,eb:()=>d,Gz:()=>y,dX:()=>b,$F:()=>m,Sj:()=>v,uN:()=>g,mv:()=>p,PQ:()=>r.A});var r=n(19758);const o="ArrowFunctionExpression";var i={name:"arrow",init(t){function e(n){n&&(Object.values(n).forEach(t=>{t&&"object"==typeof t&&e(t)}),"=>"===n.operator&&(n.type=o,n.params=n.left?[n.left]:null,n.body=n.right,n.params&&n.params[0].type===t.SEQUENCE_EXP&&(n.params=n.params[0].expressions),delete n.left,delete n.right,delete n.operator))}t.addBinaryOp("=>",.1,!0),t.hooks.add("gobble-expression",function(e){if(this.gobbleSpaces(),this.code===t.OPAREN_CODE){const n=this.index;if(this.index++,this.gobbleSpaces(),this.code===t.CPAREN_CODE){this.index++;const t=this.gobbleBinaryOp();if("=>"===t){const n=this.gobbleBinaryExpression();return n||this.throwError("Expected expression after "+t),void(e.node={type:o,params:null,body:n})}}this.index=n}}),t.hooks.add("after-expression",function(t){e(t.node)})}},s={name:"new",init(t){t.addUnaryOp("new"),t.hooks.add("after-token",function(e){const n=e.node;if(n&&"new"===n.operator){n.argument&&[t.CALL_EXP,t.MEMBER_EXP].includes(n.argument.type)||this.throwError("Expected new function()"),e.node=n.argument;let r=e.node;for(;r.type===t.MEMBER_EXP||r.type===t.CALL_EXP&&r.callee.type===t.MEMBER_EXP;)r=r.type===t.MEMBER_EXP?r.object:r.callee.object;r.type="NewExpression"}})}},a={name:"numbers",init(t){function e(t){return"x"===t||"X"===t?(this.index+=2,[[48,57],[65,70],[97,102]]):"b"===t||"B"===t?(this.index+=2,[[48,49]]):"o"===t||"O"===t||t>="0"&&t<="7"?(this.index+=t<="7"?1:2,[[48,55]]):null}function n(t){return"x"===t||"X"===t?16:"b"===t||"B"===t?2:8}function r(t,e){return 95===t||e.some(([e,n])=>t>=e&&t<=n)}function o(e){const n=this.index;let r="";const o=()=>{for(;t.isDecimalDigit(this.code)||95===this.code;)95===this.code?this.index++:r+=this.expr.charAt(this.index++)};o(),this.code===t.PERIOD_CODE&&(r+=this.expr.charAt(this.index++),o());let i=this.char;"e"!==i&&"E"!==i||(r+=this.expr.charAt(this.index++),i=this.char,"+"!==i&&"-"!==i||(r+=this.expr.charAt(this.index++)),o(),t.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+r+this.char+")"));const s=this.code;if(t.isIdentifierStart(s))this.throwError("Variable names cannot start with a number ("+r+this.char+")");else if(s===t.PERIOD_CODE)return r.length>1&&this.throwError(`Unexpected period ${JSON.stringify({chCode:s,number:r},null,2)}`),void(this.index=n);e.node={type:t.LITERAL,value:parseFloat(r),raw:this.expr.substring(n,this.index)}}t.hooks.add("gobble-token",function(i){if(48===this.code){const s=this.index,a=this.expr.charAt(this.index+1),u=e.call(this,a);if(!u)return;let c="";for(;r(this.code,u);)95===this.code?this.index++:c+=this.expr.charAt(this.index++);if(t.isIdentifierPart(this.code)){if(t.isDecimalDigit(this.code)&&t.isDecimalDigit(a.charCodeAt(0)))return this.index=s+1,void o.call(this,i);this.throwError("unexpected char within number")}i.node={type:t.LITERAL,value:parseInt(c,n(a)),raw:this.expr.substring(s,this.index)}}else(t.isDecimalDigit(this.code)||this.code===t.PERIOD_CODE)&&o.call(this,i)})}},u={name:"regex",init(t){t.hooks.add("gobble-token",function(e){if(47===this.code){const n=++this.index;let r=!1;for(;this.index<this.expr.length;){if(47===this.code&&!r){const r=this.expr.slice(n,this.index);let o,i="";for(;++this.index<this.expr.length;){const t=this.code;if(!(t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57))break;i+=this.char}try{o=new RegExp(r,i)}catch(t){this.throwError(t.message)}return e.node={type:t.LITERAL,value:o,raw:this.expr.slice(n-1,this.index)},e.node=this.gobbleTokenProperty(e.node),e.node}this.code===t.OBRACK_CODE?r=!0:r&&this.code===t.CBRACK_CODE&&(r=!1),this.index+=92===this.code?2:1}this.throwError("Unclosed Regex")}})}},c={name:"ternary",init(t){t.hooks.add("after-expression",function(e){if(e.node&&this.code===t.QUMARK_CODE){this.index++;const n=e.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===t.COLON_CODE){this.index++;const o=this.gobbleExpression();if(o||this.throwError("Expected expression"),e.node={type:"ConditionalExpression",test:n,consequent:r,alternate:o},n.operator&&t.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&t.binary_ops[r.right.operator]<=.9;)r=r.right;e.node.test=r.right,r.right=e.node,e.node=n}}else this.throwError("Expected :")}})}},l={name:"jsepTemplateLiteral",init(t){function e(t,e=!0){if(96===this.code){const n={type:"TemplateLiteral",quasis:[],expressions:[]};let r="",o="",i=!1;const s=this.expr.length,a=()=>n.quasis.push({type:"TemplateElement",value:{raw:o,cooked:r},tail:i});for(;this.index<s;){let s=this.expr.charAt(++this.index);if("`"===s)return this.index+=1,i=!0,a(),t.node=n,e&&(t.node=this.gobbleTokenProperty(t.node)),t.node;if("$"===s&&"{"===this.expr.charAt(this.index+1))this.index+=2,a(),o="",r="",n.expressions.push(...this.gobbleExpressions(125)),125!==this.code&&this.throwError("unclosed ${");else if("\\"===s)switch(o+=s,s=this.expr.charAt(++this.index),o+=s,s){case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+=s}else r+=s,o+=s}this.throwError("Unclosed `")}}t.hooks.add("gobble-token",e),t.hooks.add("after-token",function(n){if((n.node.type===t.IDENTIFIER||n.node.type===t.MEMBER_EXP)&&96===this.code)return n.node={type:"TaggedTemplateExpression",tag:n.node,quasi:e.bind(this)(n,!1)},n.node=this.gobbleTokenProperty(n.node),n.node})}},h=n(89987);function f(t,e={}){return v(t,e,w)}async function p(t,e={}){return g(t,e,w)}function d(t,e={}){return v(t,e,x)}function y(t,e={}){return g(t,e,x)}function b(t,e={}){return v(t,e,O)}function m(t,e={}){return g(t,e,O)}function v(t,e={},n){if(!("string"==typeof t||"object"==typeof t&&t&&"type"in t))throw`Unknown expression type ${t}. Expressions must either be a string or pre-compiled string.`;if("string"==typeof t&&0===t.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==e&&(e={});const o=function(t){return P(t,h.z)}(e),i=S("string"==typeof t?(0,r.A)(t):t,o);if(n(i))return i;throw{type:"Invalid result",message:"string"==typeof t?`The expression ${t} did not produce a valid result`:"The expression did not produce a valid result"}}async function g(t,e={},n){if(!("string"==typeof t||"object"==typeof t&&t&&"type"in t))return Promise.reject(`Unknown expression type ${t}. Expressions must either be a string or pre-compiled string.`);if("string"==typeof t&&0===t.trim().length)throw{type:"Empty expression",message:"Expression cannot be an empty string"};null==e&&(e={});const o=function(t){return P(t,h.f)}(e);return Promise.resolve(S("string"==typeof t?(0,r.A)(t):t,o)).then(e=>{if(n(e))return e;throw{type:"Invalid result",message:"string"==typeof t?`The expression ${t} did not produce a valid result`:"The expression did not produce a valid result"}})}function _(t){return(0,r.A)(t)}function w(t){return"string"==typeof t||"number"==typeof t||"boolean"==typeof t||null==t||t instanceof Date}function x(t){return"boolean"==typeof t}function O(t){return"number"==typeof t}function S(t,e){switch(t.type){case"UnaryExpression":return function(t,e){const n=S(t.argument,e);switch(t.operator){case"+":return+n;case"-":return-n;case"~":return~n;case"!":return!n;default:throw`Expression evaluator does not support operator '${t.operator}''`}}(t,e);case"BinaryExpression":return function(t,e){let n=S(t.left,e),r=S(t.right,e);switch(t.operator){case"+":return n+r;case"-":return n-r;case"*":return n*r;case"/":return n/r;case"%":return n%r;case"**":return n**r;case"==":return n==r;case"===":return n===r;case"!=":return n!=r;case"!==":return n!==r;case">":return n>r;case">=":return n>=r;case"<":return n<r;case"<=":return n<=r;case"in":return n in r;case"&&":return n&&r;case"||":return n||r;case"??":return n??r;default:throw`Expression evaluator does not support operator '${t.operator}' operator`}}(t,e);case"ConditionalExpression":return function(t,e){const n=S(t.test,e);return S(n?t.consequent:t.alternate,e)}(t,e);case"CallExpression":return function(t,e){let n=t.arguments?.map(j(e)),r=S(t.callee,e);if(!r)throw`No function named ${C(t.callee)} is defined in this context`;if("function"!=typeof r)throw`${C(t.callee)} is not a function`;return r(...n)}(t,e);case"ArrowFunctionExpression":return function(t,e){const n=t.params?.map(t=>{if("Identifier"===t.type)return t.name;throw`Cannot handle parameter of type ${t.type}`})??[];return function(...r){if(r.length<n.length)throw`Required argument(s) ${n.slice(r.length,-1).join(", ")} were not provided`;const o=Object.fromEntries(n.reduce((t,e,n)=>{const o=r[n];return k(o)&&t.push([e,o]),t},[]));return S(t.body,e.addVariables(o))}.bind(e.thisObj??null)}(t,e);case"MemberExpression":return function(t,e){let n=S(t.object,e);if(void 0===n)switch(t.object.type){case"Identifier":{let n=E(t.object,e);throw ReferenceError(`ReferenceError: ${n} is not defined`)}case"MemberExpression":{let n=E(t.property,e);throw TypeError(`TypeError: cannot read properties of undefined (reading '${n}')`)}default:throw`VisitMemberExpression does not support operator '${t.object.type}' type`}let r,o=n;if("string"==typeof n)o=String.prototype;else if("number"==typeof n)o=Number.prototype;else if("function"==typeof n);else if("object"!=typeof n)throw"VisitMemberExpression does not support member access on type "+typeof n;switch(e.thisObj=o,t.property.type){case"Identifier":case"MemberExpression":r=S(t.property,e);break;default:{const o=S(t.property,e);if(void 0===o)throw{type:"Illegal property access",message:"No property was supplied to the property access"};A(o),r=n[o]}}return"function"==typeof r?r.bind(n):r}(t,e);case"ArrayExpression":return function(t,e){return t.elements?.map(j(e))}(t,e);case"SequenceExpression":return function(t,e){const n=t.expressions.map(j(e));return n[n.length-1]}(t,e);case"NewExpression":return function(t,e){if(!t.callee||"Identifier"!==t.callee.type)throw t.callee?"new must be called with either Date or RegExp":'Could not handle "new" without a specified class';{let n=t.arguments?.map(j(e));switch(t.callee.name){case"Date":return new Date(...n);case"RegExp":return new RegExp(...n);default:throw`Cannot instantiate object of type ${t.callee.name}`}}}(t,e);case"Literal":return function(t){return A(t.value),t.value}(t);case"Identifier":return function(t,e){A(t.name);const n=e.thisObj;if(n&&("object"==typeof n||"function"==typeof n)&&t.name in n){const e=n[t.name];return A(e),e}if(e.variables&&t.name in e.variables){const n=e.variables[t.name];return A(n),n}return t.name in e.globals?e.globals[t.name]:void 0}(t,e);case"TemplateLiteral":return function(t,e){const n=t.expressions?.map(j(e))??[],r=t.quasis?.map(j(e))??[];return r.filter(t=>!t.tail).map(t=>t.value).join("")+n.join("")+r.filter(t=>t.tail).map(t=>t.value).join("")}(t,e);case"TemplateElement":return function(t){return{value:t.cooked,tail:t.tail}}(t);default:throw`Expression evaluator does not support expression of type '${t.type}'`}}function E(t,e){switch(t.type){case"Literal":return t.value;case"Identifier":return t.name;case"MemberExpression":return E(t.property,e);default:throw`VisitExpressionName does not support expression of type '${t.type}'`}}function P(t,e){const n={thisObj:void 0,variables:{...t},globals:{...e},addVariables(t){return this.variables={...this.variables,...t},this}};return n.addVariables.bind(n),n}function j(t){return function(e){return null===e?null:S(e,t)}}function A(t){if("__proto__"===t||"prototype"===t||"constructor"===t)throw{type:"Illegal property access",message:`Cannot access the ${t} property of objects`}}function k(t){if("string"==typeof t||"number"==typeof t||"boolean"==typeof t||"function"==typeof t||null===t||t instanceof RegExp)return!0;if("object"==typeof t){for(const e of Object.keys(t))if(!k(t[e]))return!1;return!0}if(Array.isArray(t))for(const e of t)if(!k(e))return!1;return!1}function C(t){return t?"MemberExpression"===t.type?t.property?.name:t.name:null}r.A.plugins.register(i),r.A.plugins.register(s),r.A.plugins.register(a),r.A.plugins.register(u),r.A.plugins.register(c),r.A.plugins.register(l),r.A.addBinaryOp("in",7),r.A.addBinaryOp("??",1)},87635:(t,e,n)=>{"use strict";n.d(e,{c:()=>c});var r=n(61171),o=n(18904),i=n(90979),s=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function a(t){return t}var u=n(60315),c=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var s=this.operator,a=function(t,e,n){if(t){if(t instanceof r.v)return t;if(t[o.D])return t[o.D]()}return t||e||n?new r.v(t,e,n):new r.v(i.I)}(t,e,n);if(s?a.add(s.call(a,this.source)):a.add(this.source||u.$.useDeprecatedSynchronousErrorHandling&&!a.syncErrorThrowable?this._subscribe(a):this._trySubscribe(a)),u.$.useDeprecatedSynchronousErrorHandling&&a.syncErrorThrowable&&(a.syncErrorThrowable=!1,a.syncErrorThrown))throw a.syncErrorValue;return a},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){u.$.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(t){for(;t;){var e=t,n=e.closed,o=e.destination,i=e.isStopped;if(n||i)return!1;t=o&&o instanceof r.v?o:null}return!0}(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=l(e))(function(e,r){var o;o=n.subscribe(function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}},r,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[s]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:(0===(n=t).length?a:1===n.length?n[0]:function(t){return n.reduce(function(t,e){return e(t)},t)})(this);var n},t.prototype.toPromise=function(t){var e=this;return new(t=l(t))(function(t,n){var r;e.subscribe(function(t){return r=t},function(t){return n(t)},function(){return t(r)})})},t.create=function(e){return new t(e)},t}();function l(t){if(t||(t=u.$.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},87778:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1359),o=n(41727),i=n(95092);e.subscribeToResult=function(t,e,n,s,a){if(void 0===a&&(a=new r.InnerSubscriber(t,n,s)),!a.closed)return e instanceof i.Observable?e.subscribe(a):o.subscribeTo(e)(a)}},88179:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.distinctUntilChanged=function(t,e){return function(n){return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.compare,this.keySelector))},t}(),a=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.keySelector=r,o.hasKey=!1,"function"==typeof n&&(o.compare=n),o}return o(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(i.Subscriber)},88360:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(86735);e.sampleTime=function(t,e){return void 0===e&&(e=s.async),function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.period,this.scheduler))},t}(),u=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.period=n,o.scheduler=r,o.hasValue=!1,o.add(r.schedule(c,n,{subscriber:o,period:n})),o}return o(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(i.Subscriber);function c(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}},88724:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(97913);const o=function(t){var e=new t.constructor(t.byteLength);return new r.A(e).set(new r.A(t)),e}},89133:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(71929);function o(t,e,n){return 0===n?[e]:(t.push(e),t)}e.toArray=function(){return r.reduce(o,[])}},89152:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(n(77759).Subscriber);e.OuterSubscriber=i},89155:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(99623),o=n(23935);e.startWith=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return o.isScheduler(n)?(t.pop(),function(e){return r.concat(t,e,n)}):function(e){return r.concat(t,e)}}},89233:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.map=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new s(t,e))}};var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.thisArg))},t}();e.MapOperator=s;var a=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.project=n,o.count=0,o.thisArg=r||o,o}return o(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.Subscriber)},89646:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(80743),o=n(57894);e.race=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&r.isArray(t[0])&&(t=t[0]),e.lift.call(o.race.apply(void 0,[e].concat(t)))}}},89710:t=>{var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function r(t){if(!t||"[object Object]"!==n.call(t)||t.nodeType||t.setInterval)return!1;var r,o=e.call(t,"constructor"),i=e.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!o&&!i)return!1;for(r in t);return void 0===r||e.call(t,r)}t.exports=function t(){var e,n,o,i,s,a,u=arguments[0]||{},c=1,l=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},c=2),"object"!=typeof u&&"function"!=typeof u&&(u={});c<l;c++)if(null!=(e=arguments[c]))for(n in e)o=u[n],u!==(i=e[n])&&(h&&i&&(r(i)||(s=Array.isArray(i)))?(s?(s=!1,a=o&&Array.isArray(o)?o:[]):a=o&&r(o)?o:{},u[n]=t(h,a,i)):void 0!==i&&(u[n]=i));return u}},89987:(t,e,n)=>{"use strict";n.d(e,{f:()=>o,z:()=>r});const r={Array,Boolean,Symbol,Infinity:1/0,NaN:NaN,Math,Number,BigInt,String,RegExp,JSON,isFinite,isNaN,parseFloat,parseInt,decodeURI,encodeURI,encodeURIComponent,Object:{__proto__:void 0,assign:Object.assign.bind(null),fromEntries:Object.fromEntries.bind(null),hasOwn:Object.hasOwn.bind(null),keys:Object.keys.bind(null),is:Object.is.bind(null),values:Object.values.bind(null)}},o={...r,Promise}},90239:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(92413);e.combineAll=function(t){return function(e){return e.lift(new r.CombineLatestOperator(t))}}},90624:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isArrayLike=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},90952:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.defaultIfEmpty=function(t){return void 0===t&&(t=null),function(e){return e.lift(new s(t))}};var s=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.defaultValue))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return o(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(i.Subscriber)},90979:(t,e,n)=>{"use strict";n.d(e,{I:()=>i});var r=n(60315),o=n(44856),i={closed:!0,next:function(t){},error:function(t){if(r.$.useDeprecatedSynchronousErrorHandling)throw t;(0,o.T)(t)},complete:function(){}}},91039:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(95092),o=n(21016);e.schedulePromise=function(t,e){return new r.Observable(function(n){var r=new o.Subscription;return r.add(e.schedule(function(){return t.then(function(t){r.add(e.schedule(function(){n.next(t),r.add(e.schedule(function(){return n.complete()}))}))},function(t){r.add(e.schedule(function(){return n.error(t)}))})})),r})}},91451:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20328);e.shareReplay=function(t,e,n){var o;return o=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,o=t.bufferSize,i=void 0===o?Number.POSITIVE_INFINITY:o,s=t.windowTime,a=void 0===s?Number.POSITIVE_INFINITY:s,u=t.refCount,c=t.scheduler,l=0,h=!1,f=!1;return function(t){var o;l++,!e||h?(h=!1,e=new r.ReplaySubject(i,a,c),o=e.subscribe(this),n=t.subscribe({next:function(t){e.next(t)},error:function(t){h=!0,e.error(t)},complete:function(){f=!0,n=void 0,e.complete()}}),f&&(n=void 0)):o=e.subscribe(this),this.add(function(){l--,o.unsubscribe(),o=void 0,n&&!f&&u&&0===l&&(n.unsubscribe(),n=void 0,e=void 0)})}}(o))}}},92209:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(60781);e.concatMap=function(t,e){return r.mergeMap(t,e,1)}},92413:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(23935),s=n(80743),a=n(89152),u=n(87778),c=n(67446),l={};e.combineLatest=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=void 0,r=void 0;return i.isScheduler(t[t.length-1])&&(r=t.pop()),"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&s.isArray(t[0])&&(t=t[0]),c.fromArray(t,r).lift(new h(n))};var h=function(){function t(t){this.resultSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.resultSelector))},t}();e.CombineLatestOperator=h;var f=function(t){function e(e,n){var r=t.call(this,e)||this;return r.resultSelector=n,r.active=0,r.values=[],r.observables=[],r}return o(e,t),e.prototype._next=function(t){this.values.push(l),this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var n=0;n<e;n++){var r=t[n];this.add(u.subscribeToResult(this,r,void 0,n))}}},e.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(t,e,n){var r=this.values,o=r[n],i=this.toRespond?o===l?--this.toRespond:this.toRespond:0;r[n]=e,0===i&&(this.resultSelector?this._tryResultSelector(r):this.destination.next(r.slice()))},e.prototype._tryResultSelector=function(t){var e;try{e=this.resultSelector.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(a.OuterSubscriber);e.CombineLatestSubscriber=f},92472:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.every=function(t,e){return function(n){return n.lift(new s(t,e,n))}};var s=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.predicate,this.thisArg,this.source))},t}(),a=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.source=o,i.index=0,i.thisArg=r||i,i}return o(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(i.Subscriber)},92661:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(86735);e.debounceTime=function(t,e){return void 0===e&&(e=s.async),function(n){return n.lift(new a(t,e))}};var a=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.dueTime,this.scheduler))},t}(),u=function(t){function e(e,n,r){var o=t.call(this,e)||this;return o.dueTime=n,o.scheduler=r,o.debouncedSubscription=null,o.lastValue=null,o.hasValue=!1,o}return o(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(c,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(i.Subscriber);function c(t){t.debouncedNext()}},93886:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(71077),s=n(86735),a=n(77759),u=n(19673),c=n(23935);e.windowTime=function(t){var e=s.async,n=null,r=Number.POSITIVE_INFINITY;return c.isScheduler(arguments[3])&&(e=arguments[3]),c.isScheduler(arguments[2])?e=arguments[2]:u.isNumeric(arguments[2])&&(r=Number(arguments[2])),c.isScheduler(arguments[1])?e=arguments[1]:u.isNumeric(arguments[1])&&(n=Number(arguments[1])),function(o){return o.lift(new l(t,n,r,e))}};var l=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return o(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(i.Subject),f=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;s.destination=e,s.windowTimeSpan=n,s.windowCreationInterval=r,s.maxWindowSize=o,s.scheduler=i,s.windows=[];var a=s.openWindow();if(null!==r&&r>=0){var u={subscriber:s,window:a,context:null},c={windowTimeSpan:n,windowCreationInterval:r,subscriber:s,scheduler:i};s.add(i.schedule(y,n,u)),s.add(i.schedule(d,r,c))}else{var l={subscriber:s,window:a,windowTimeSpan:n};s.add(i.schedule(p,n,l))}return s}return o(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r<n;r++){var o=e[r];o.closed||(o.next(t),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new h;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(a.Subscriber);function p(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function d(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,o=t.windowCreationInterval,i=n.openWindow(),s=this,a={action:s,subscription:null},u={subscriber:n,window:i,context:a};a.subscription=r.schedule(y,e,u),s.add(a.subscription),s.schedule(t,o)}function y(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}},94215:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isPromise=function(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}},94360:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(86735),s=n(77759),a=n(23935);e.bufferTime=function(t){var e=arguments.length,n=i.async;a.isScheduler(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var o=Number.POSITIVE_INFINITY;return e>=3&&(o=arguments[2]),function(e){return e.lift(new u(t,r,o,n))}};var u=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new l(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),c=function(){this.buffer=[]},l=function(t){function e(e,n,r,o,i){var s=t.call(this,e)||this;s.bufferTimeSpan=n,s.bufferCreationInterval=r,s.maxBufferSize=o,s.scheduler=i,s.contexts=[];var a=s.openContext();if(s.timespanOnly=null==r||r<0,s.timespanOnly){var u={subscriber:s,context:a,bufferTimeSpan:n};s.add(a.closeAction=i.schedule(h,n,u))}else{var c={subscriber:s,context:a},l={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:s,scheduler:i};s.add(a.closeAction=i.schedule(p,n,c)),s.add(i.schedule(f,r,l))}return s}return o(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,o=0;o<r;o++){var i=n[o],s=i.buffer;s.push(t),s.length==this.maxBufferSize&&(e=i)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,n=this.destination;e.length>0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(h,n,r))}},e.prototype.openContext=function(){var t=new c;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(s.Subscriber);function h(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function f(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,o=t.scheduler,i=r.openContext();r.closed||(r.add(i.closeAction=o.schedule(p,n,{subscriber:r,context:i})),this.schedule(t,e))}function p(t){var e=t.subscriber,n=t.context;e.closeContext(n)}},94688:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(e,n){void 0===n&&(n=t.now),this.SchedulerAction=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},t.now=function(){return Date.now()},t}();e.Scheduler=n},95092:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(21226),o=n(67595),i=n(46713),s=n(27928),a=n(5319),u=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,i=o.toSubscriber(t,e,n);if(r?i.add(r.call(i,this.source)):i.add(this.source||a.config.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),a.config.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){a.config.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),r.canReportError(t)?t.error(e):console.warn(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=c(e))(function(e,r){var o;o=n.subscribe(function(e){try{t(e)}catch(t){r(t),o&&o.unsubscribe()}},r,e)})},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[i.observable]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:s.pipeFromArray(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=c(t))(function(t,n){var r;e.subscribe(function(t){return r=t},function(t){return n(t)},function(){return t(r)})})},t.create=function(e){return new t(e)},t}();function c(t){if(t||(t=a.config.Promise||Promise),!t)throw new Error("no Promise impl found");return t}e.Observable=u},95819:(t,e,n)=>{"use strict";function r(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function o(t){return function e(n){return 0===arguments.length||r(n)?e:t.apply(this,arguments)}}function i(t){return function e(n,i){switch(arguments.length){case 0:return e;case 1:return r(n)?e:o(function(e){return t(n,e)});default:return r(n)&&r(i)?e:r(n)?o(function(e){return t(e,i)}):r(i)?o(function(e){return t(n,e)}):t(n,i)}}}function s(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}function a(t,e,n){for(var r=0,o=n.length;r<o;){if(t(e,n[r]))return!0;r+=1}return!1}function u(t,e){return Object.prototype.hasOwnProperty.call(e,t)}n.d(e,{ZU:()=>V,Nh:()=>Vt,hs:()=>Z,Rt:()=>Q,T0:()=>ft,ks:()=>bt,zj:()=>vt,IS:()=>tt,UY:()=>it,g$:()=>at,P0:()=>st,G9:()=>nt,vu:()=>rt,YP:()=>et,GI:()=>ot,td:()=>gt,tN:()=>ut,r4:()=>qt,gU:()=>Ht,qG:()=>zt,yL:()=>Gt,mq:()=>_t,Gt:()=>mt,kl:()=>dt,FL:()=>pt,GV:()=>yt,Nz:()=>Ft,H:()=>X,Nc:()=>F,y$:()=>Yt});const c="function"==typeof Object.is?Object.is:function(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e};var l=Object.prototype.toString;const h=function(){return"[object Arguments]"===l.call(arguments)?function(t){return"[object Arguments]"===l.call(t)}:function(t){return u("callee",t)}}();var f=!{toString:null}.propertyIsEnumerable("toString"),p=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],d=function(){return arguments.propertyIsEnumerable("length")}(),y=function(t,e){for(var n=0;n<t.length;){if(t[n]===e)return!0;n+=1}return!1};const b="function"!=typeof Object.keys||d?o(function(t){if(Object(t)!==t)return[];var e,n,r=[],o=d&&h(t);for(e in t)!u(e,t)||o&&"length"===e||(r[r.length]=e);if(f)for(n=p.length-1;n>=0;)u(e=p[n],t)&&!y(r,e)&&(r[r.length]=e),n-=1;return r}):o(function(t){return Object(t)!==t?[]:Object.keys(t)}),m=o(function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)});function v(t,e,n,r){var o=s(t);function i(t,e){return g(t,e,n.slice(),r.slice())}return!a(function(t,e){return!a(i,e,t)},s(e),o)}function g(t,e,n,r){if(c(t,e))return!0;var o,i,s=m(t);if(s!==m(e))return!1;if("function"==typeof t["fantasy-land/equals"]||"function"==typeof e["fantasy-land/equals"])return"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e)&&"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t);if("function"==typeof t.equals||"function"==typeof e.equals)return"function"==typeof t.equals&&t.equals(e)&&"function"==typeof e.equals&&e.equals(t);switch(s){case"Arguments":case"Array":case"Object":if("function"==typeof t.constructor&&"Promise"===(o=t.constructor,null==(i=String(o).match(/^function (\w*)/))?"":i[1]))return t===e;break;case"Boolean":case"Number":case"String":if(typeof t!=typeof e||!c(t.valueOf(),e.valueOf()))return!1;break;case"Date":if(!c(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(t.source!==e.source||t.global!==e.global||t.ignoreCase!==e.ignoreCase||t.multiline!==e.multiline||t.sticky!==e.sticky||t.unicode!==e.unicode)return!1}for(var a=n.length-1;a>=0;){if(n[a]===t)return r[a]===e;a-=1}switch(s){case"Map":return t.size===e.size&&v(t.entries(),e.entries(),n.concat([t]),r.concat([e]));case"Set":return t.size===e.size&&v(t.values(),e.values(),n.concat([t]),r.concat([e]));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 l=b(t);if(l.length!==b(e).length)return!1;var h=n.concat([t]),f=r.concat([e]);for(a=l.length-1;a>=0;){var p=l[a];if(!u(p,e)||!g(e[p],t[p],h,f))return!1;a-=1}return!0}const _=i(function(t,e){return g(t,e,[],[])});function w(t){return function e(n,s,a){switch(arguments.length){case 0:return e;case 1:return r(n)?e:i(function(e,r){return t(n,e,r)});case 2:return r(n)&&r(s)?e:r(n)?i(function(e,n){return t(e,s,n)}):r(s)?i(function(e,r){return t(n,e,r)}):o(function(e){return t(n,s,e)});default:return r(n)&&r(s)&&r(a)?e:r(n)&&r(s)?i(function(e,n){return t(e,n,a)}):r(n)&&r(a)?i(function(e,n){return t(e,s,n)}):r(s)&&r(a)?i(function(e,r){return t(n,e,r)}):r(n)?o(function(e){return t(e,s,a)}):r(s)?o(function(e){return t(n,e,a)}):r(a)?o(function(e){return t(n,s,e)}):t(n,s,a)}}}function x(t){return"[object Object]"===Object.prototype.toString.call(t)}const O=w(function(t,e,n){var r,o={};for(r in n=n||{},e=e||{})u(r,e)&&(o[r]=u(r,n)?t(r,e[r],n[r]):e[r]);for(r in n)u(r,n)&&!u(r,o)&&(o[r]=n[r]);return o}),S=w(function t(e,n,r){return O(function(n,r,o){return x(r)&&x(o)?t(e,r,o):e(n,r,o)},n,r)}),E=i(function(t,e){return S(function(t,e,n){return n},t,e)}),P=i(function(t,e){for(var n={},r={},o=0,i=t.length;o<i;)r[t[o]]=1,o+=1;for(var s in e)r.hasOwnProperty(s)||(n[s]=e[s]);return n});function j(t,e,n){if(n||(n=new A),o=typeof(r=t),null==r||"object"!=o&&"function"!=o)return t;var r,o,i,s=function(r){var o=n.get(t);if(o)return o;for(var i in n.set(t,r),t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=e?j(t[i],!0,n):t[i]);return r};switch(m(t)){case"Object":return s(Object.create(Object.getPrototypeOf(t)));case"Array":return s(Array(t.length));case"Date":return new Date(t.valueOf());case"RegExp":return i=t,new RegExp(i.source,i.flags?i.flags:(i.global?"g":"")+(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.sticky?"y":"")+(i.unicode?"u":"")+(i.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return t.slice();default:return t}}var A=function(){function t(){this.map={},this.length=0}return t.prototype.set=function(t,e){var n=this.hash(t),r=this.map[n];r||(this.map[n]=r=[]),r.push([t,e]),this.length+=1},t.prototype.hash=function(t){var e=[];for(var n in t)e.push(Object.prototype.toString.call(t[n]));return e.join()},t.prototype.get=function(t){if(this.length<=180){for(var e in this.map)for(var n=this.map[e],r=0;r<n.length;r+=1)if((i=n[r])[0]===t)return i[1]}else{var o=this.hash(t);if(n=this.map[o])for(r=0;r<n.length;r+=1){var i;if((i=n[r])[0]===t)return i[1]}}},t}();const k=o(function(t){return null!=t&&"function"==typeof t.clone?t.clone():j(t,!0)}),C=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)},T=o(function(t){return!!C(t)||!!t&&"object"==typeof t&&!function(t){return"[object String]"===Object.prototype.toString.call(t)}(t)&&(0===t.length||t.length>0&&t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1))});var N="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function I(t,e,n){return function(r,o,i){if(T(i))return t(r,o,i);if(null==i)return o;if("function"==typeof i["fantasy-land/reduce"])return e(r,o,i,"fantasy-land/reduce");if(null!=i[N])return n(r,o,i[N]());if("function"==typeof i.next)return n(r,o,i);if("function"==typeof i.reduce)return e(r,o,i,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function M(t,e,n){for(var r=0,o=n.length;r<o;){if((e=t["@@transducer/step"](e,n[r]))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r+=1}return t["@@transducer/result"](e)}const R=i(function(t,e){return function(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(t){return e.apply(this,arguments)};case 2:return function(t,n){return e.apply(this,arguments)};case 3:return function(t,n,r){return e.apply(this,arguments)};case 4:return function(t,n,r,o){return e.apply(this,arguments)};case 5:return function(t,n,r,o,i){return e.apply(this,arguments)};case 6:return function(t,n,r,o,i,s){return e.apply(this,arguments)};case 7:return function(t,n,r,o,i,s,a){return e.apply(this,arguments)};case 8:return function(t,n,r,o,i,s,a,u){return e.apply(this,arguments)};case 9:return function(t,n,r,o,i,s,a,u,c){return e.apply(this,arguments)};case 10:return function(t,n,r,o,i,s,a,u,c,l){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}(t.length,function(){return t.apply(e,arguments)})});function D(t,e,n){for(var r=n.next();!r.done;){if((e=t["@@transducer/step"](e,r.value))&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}r=n.next()}return t["@@transducer/result"](e)}function $(t,e,n,r){return t["@@transducer/result"](n[r](R(t["@@transducer/step"],t),e))}const L=I(M,$,D);var B=function(){function t(t){this.f=t}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(t){return t},t.prototype["@@transducer/step"]=function(t,e){return this.f(t,e)},t}();const U=w(function(t,e,n){return L("function"==typeof t?new B(t):t,e,n)});var V=function(t){return t.Array="Array",t.Boolean="Boolean",t.ConceptUuid="ConceptUuid",t.Number="Number",t.Object="Object",t.String="String",t.UUID="UUID",t.PersonAttributeTypeUuid="PersonAttributeTypeUuid",t.PatientIdentifierTypeUuid="PatientIdentifierTypeUuid",t}({});function F(t,e){return n=>{if(!t(n))return"function"==typeof e?e(n):e}}const K=F(t=>Array.isArray(t),"must be an array"),W=F(t=>"boolean"==typeof t,"must be a boolean"),q=F(t=>"number"==typeof t,"must be a number"),z=F(t=>"string"==typeof t,"must be a string"),H=F(t=>"object"==typeof t&&!Array.isArray(t)&&null!==t,"must be an object (not an array or null)"),G=F(t=>/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t)||/^[0-9a-f]{36}$/i.test(t),"must be a valid UUID or a 36-character hexadecimal string");var Y=n(23790),J=n(27388);const Q=(0,Y.Zd)("config-internal",{providedConfigs:[],schemas:{},moduleLoaded:{}}),X=(0,Y.Zd)("temporary-config",{config:function(){try{return JSON.parse(localStorage.getItem("openmrs:temporaryConfig")||"{}")}catch(t){return{}}}()});X.subscribe(t=>{var e;e=t.config,localStorage.setItem("openmrs:temporaryConfig",JSON.stringify(e))});const Z=(0,Y.Zd)("config-store-of-extension-state",{mountedExtensions:[]});function tt(t){return(0,Y.jf)(`config-module-${t}`,{config:null,loaded:!1,translationOverridesLoaded:!1})}function et(){return(0,Y.jf)("config-extension-slots",{slots:{}})}function nt(t){return rt(et().getState(),t)}function rt(t,e){return t.slots[e]??{loaded:!1,config:{}}}function ot(){return(0,Y.jf)("config-extensions",{configs:{}})}function it(t,e){if("string"!=typeof t||"string"!=typeof e||"__proto__"===t||"__proto__"===e||"constructor"===t||"constructor"===e||"prototype"===t||"prototype"===e)throw new Error("Attempted to call `getExtensionConfig()` with invalid argument");const n=ot(),r=n=>n.configs[t]?.[e];return{getInitialState:()=>r(n.getInitialState()),getState:()=>r(n.getState())??{loaded:!1,config:null},setState(r,o=!1){n.setState(n=>{n.configs[t]||(n.configs[t]={});const i="function"==typeof r?r(n.configs.slotName[e]):r;return n.configs[t][e]=o?Object.assign({},i):Object.assign({},n.configs[t][e],i),n})},subscribe:t=>n.subscribe((e,n)=>{const o=r(e),i=r(n);(0,J.b)(o,i)||t(o,i)}),destroy(){}}}function st(t,e,n){const r=t.configs[e]?.[n];return r??{loaded:!1,config:null}}function at(t,e,n){const r=t.configure?.[n];return r??null}const ut=(0,Y.Zd)("config-implementer-tools",{config:{}}),ct=[];function lt(){const t=Q.getState(),e=X.getState(),n=Z.getState();!function(t,e){for(let n of Object.keys(t.schemas)){const r=tt(n);let o;o=t.moduleLoaded[n]?{translationOverridesLoaded:!0,loaded:!0,config:jt(n,t,e)}:{translationOverridesLoaded:!0,loaded:!1,config:At(n,t,e)},r.setState(o)}}(t,e),function(t,e){const n=ut.getState(),r=function(t,e){let n=xt(k(t.schemas));const r=[...t.providedConfigs.map(t=>[t.config,t.source]),[e.config,"temporary config"]];for(let[t,e]of r)n=Ct([n,Ot(t,e)]);return n}(t,e),o={config:r};_(n.config,o.config)||ut.setState(o)}(t,e),function(t,e){const n=function(t,e){const n=Ct(Et(t,e)),r=Object.keys(n).reduce((t,e)=>(n[e]?.extensionSlots&&(t[e]=n[e]?.extensionSlots),t),{});!function(t){for(let[e,n]of Object.entries(t))for(let[t,r]of Object.entries(n))St(r,e,t)}(r);return Object.keys(r).reduce((t,e)=>({...t,...r[e]}),{})}(t,e),r=Object.fromEntries(Object.entries(n).map(([t,e])=>[t,{loaded:!0,config:e}])),o=et(),i=o.getState(),s={slots:{...i.slots,...r}};_(i.slots,s.slots)||o.setState(s)}(t,e),function(t,e,n){const r={};for(let o of e.mountedExtensions){const e=wt(o.slotModuleName,o.extensionModuleName,o.slotName,o.extensionId,t,n);r[o.slotName]||(r[o.slotName]={}),r[o.slotName][o.extensionId]={config:e,loaded:!0}}const o=ot(),i=o.getState(),s={configs:r};_(i.configs,s.configs)||o.setState(s)}(t,n,e)}function ht(){lt(),ct.push(Q.subscribe(lt)),ct.push(X.subscribe(lt)),ct.push(Z.subscribe(lt))}function ft(t,e){Pt(t,e);const n=E(e,Wt);Q.setState(e=>({...e,schemas:{...e.schemas,[t]:n},moduleLoaded:{...e.moduleLoaded,[t]:!0}}))}function pt(t){Q.setState(e=>({...e,schemas:{...e.schemas,[t]:Wt}}))}function dt(t){Q.setState(e=>({...e,moduleLoaded:{...e.moduleLoaded,[t]:!0}}))}function yt(t){Q.setState(e=>({...e,schemas:{...e.schemas,[t]:Kt}}))}function bt(t,e){Pt(t,e);const n=E(e,Wt);Q.getState().schemas[t]&&console.error(`Config schema for extension ${t} already exists. If there are multiple extensions with this same name, one will probably crash.`),Q.setState(e=>({...e,schemas:{...e.schemas,[t]:n}}))}function mt(t,e="provided"){Q.setState(n=>({...n,providedConfigs:[...n.providedConfigs,{source:e,config:t}]}))}function vt(t){return new Promise(e=>{const n=tt(t);function r(t){if(t.loaded&&t.config){const n=P(["Display conditions","Translation overrides"],t.config);e(n),o&&o()}}r(n.getState());const o=n.subscribe(r)})}function gt(t,e,n){const r=[new Promise(e=>{const n=tt(t);function r(t){if(t.translationOverridesLoaded&&t.config){const n=t.config["Translation overrides"]??{};e(n),o&&o()}}r(n.getState());const o=n.subscribe(r)})];return e&&n&&r.push(new Promise(t=>{const r=it(e,n);function o(e){if(e.loaded&&e.config){const n=e.config["Translation overrides"]??{};t(n),i&&i()}}o(r.getState());const i=r.subscribe(o)})),Promise.all(r)}function _t(t,e,n){Tt(t,e,n);const r=Dt(t,e);return It(t,r,n),r}function wt(t,e,n,r,o,i){const s=function(t){const[e]=t.split("#");return e}(r),a=o.schemas[s],u=a?s:e,c=Et(o,i),l=kt(t,c),h=l?.extensionSlots?.[n]?.configure?.[r]??{},f=Ct([kt(u,c),h]),p=a??o.schemas[e];Tt(p,f,u);const d=Dt(p,f);return It(p,d,u),delete d.extensionSlots,d}function xt(t){return t.hasOwnProperty("_default")?{...t,_value:t._default,_source:"default"}:Lt(t)?Object.keys(t).reduce((e,n)=>(e[n]=xt(t[n]),e),{}):{}}function Ot(t,e){return Lt(t)?Object.keys(t).reduce((n,r)=>(n[r]=Ot(t[r],e),n),{}):{_value:t,_source:e}}function St(t,e,n){const r=`${e}.extensionSlots.${n}`,o=`Extension slot config '${r}'`,i=Object.keys(t).filter(t=>!["add","remove","order","configure"].includes(t));i.length&&Ut(r,o+`' contains invalid keys '${i.join("', '")}'`),t.add&&(Array.isArray(t.add)&&t.add.every(t=>"string"==typeof t)||Ut(r,o+".add' is invalid. Must be an array of strings (extension IDs)")),t.remove&&(Array.isArray(t.remove)&&t.remove.every(t=>"string"==typeof t)||Ut(r,o+".remove' is invalid. Must be an array of strings (extension IDs)")),t.order&&(Array.isArray(t.order)&&t.order.every(t=>"string"==typeof t)||Ut(r,o+".order' is invalid. Must be an array of strings (extension IDs)")),t.configure&&(Lt(t.configure)||Ut(r,o+".configure' is invalid. Must be an object with extension IDs for keys"))}function Et(t,e){return[...t.providedConfigs.map(t=>t.config),e.config]}function Pt(t,e,n=""){const r="Please verify that you are running the latest version and, if so, alert the maintainer.";for(const o of Object.keys(e).filter(t=>!t.startsWith("_"))){const i=n+(n&&".")+o,s=e[o];if("Display conditions"===i&&console.error(`${t} declares a configuration option called "Display conditions"; the "Display conditions" option is a reserved name. ${r}`),"Translation overrides"===i&&console.error(`${t} declares a configuration option called "Translation overrides"; the "Translation overrides" option is a reserved name. ${r}`),!Lt(s)){console.error(`${t} has bad config schema definition for key '${i}'. ${r}`);continue}s.hasOwnProperty("_default")||Pt(t,s,i);const a=s._elements;if($t(a)&&Pt(t,a,i+"._elements"),s._validators)for(let e of s._validators)"function"!=typeof e&&console.error(`${t} has invalid validator for key '${i}' ${r}.\n\nIf you're the maintainer: validators must be functions that return either undefined or an error string. Received ${e}.`);const u=s._type;u&&!Object.values(V).includes(u)&&console.error(`${t} has invalid type for key '${i}' ${r}.\n\nIf you're the maintainer: the allowed types are ${Object.values(V).join(", ")}. Received '${u}'`),Object.keys(s).every(t=>["_description","_validators","_elements","_type"].includes(t))&&!n.includes("._elements")&&console.error(`${t} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: all config elements must have a default. Received ${JSON.stringify(s)}`),a&&u&&![V.Array,V.Object].includes(u)&&console.error(`${t} has bad config schema definition for key '${i}'. ${r}.\n\nIf you're the maintainer: the 'elements' key only works with '_type' equal to 'Array' or 'Object'. Received ${JSON.stringify(u)}`)}}function jt(t,e,n){const r=e.schemas[t],o=kt(t,Et(e,n));Tt(r,o,t);const i=Dt(r,o);return It(r,i,t),delete i.extensionSlots,i}function At(t,e,n){const r=kt(t,Et(e,n)),o=Dt(Wt,r);return It(Wt,o,t),delete o.extensionSlots,o}function kt(t,e){return Ct(e.map(({[t]:e})=>e).filter(t=>!!t))}function Ct(t){return U(E)({},t)}function Tt(t,e,n=""){for(const r of Object.keys(e)){const o=e[r],i=n+"."+r,s=t[r];t.hasOwnProperty(r)?Nt(s,o,i):"extensionSlots"===r&&""!==n||Ut(i,`Unknown config key '${i}' provided. Ignoring.`)}}function Nt(t,e,n){Mt(n,t._type,e),Lt(e)?t._type===V.Object?function(t,e,n){if(t._elements)for(const r of Object.keys(e)){const o=e[r];Nt(t._elements,o,`${n}.${r}`)}}(t,e,n):t.hasOwnProperty("_default")||t.hasOwnProperty("_type")||Tt(t,e,n):t._type===V.Array&&function(t,e,n){if(Mt(n,V.Array,e)){if($t(t._elements))for(let r=0;r<e.length;r++)Nt(t._elements,e[r],`${n}[${r}]`);for(let r=0;r<e.length;r++)Mt(`${n}[${r}]`,t._elements?._type,e[r])}}(t,e,n)}function It(t,e,n=""){if(t)if(e!==t._default&&Rt(n,t._validators,e),Lt(e))for(const r of Object.keys(e)){const o=e[r],i=n+"."+r,s=t[r];t._type===V.Object&&t._elements?It(t._elements,o,i):It(s,o,i)}else if(Array.isArray(e)&&t._elements)for(let r=0;r<e.length;r++)It(t._elements,e[r],`${n}[${r}]`)}function Mt(t,e,n){return!e||Rt(t,[{Array:K,Boolean:W,ConceptUuid:G,Number:q,Object:H,String:z,UUID:G,PersonAttributeTypeUuid:G,PatientIdentifierTypeUuid:G}[e]],n)}function Rt(t,e,n){let r=!0;if(e)try{for(let o of e){const e=o(n);"string"==typeof e&&(Ut(t,"object"==typeof n?`Invalid configuration for ${t}: ${e}`:`Invalid configuration value ${n} for ${t}: ${e}`),r=!1)}}catch(e){console.error(`Skipping invalid validator at "${t}". Encountered error\n\t${e}`)}return r}ht();const Dt=(t,e)=>{const n=k(e);if(!t)return n;for(const e of Object.keys(t)){const r=n[e],o=t[e];if(o&&(o.hasOwnProperty("_type")||o.hasOwnProperty("_default"))){n.hasOwnProperty(e)||(n[e]=o._default);const t=o._elements;if(r&&$t(t))if(o._type===V.Array&&Array.isArray(r)){const o=r.map(e=>Dt(t,e));n[e]=o}else if(o._type===V.Object)for(let e of Object.keys(r))r[e]=Dt(t,r[e])}else if(Lt(o)){const t=r??{};Lt(t)&&(n[e]=Dt(o,t))}}return n};function $t(t){return!!t&&Object.keys(t).filter(t=>!["_default","_validators"].includes(t)).length>0}function Lt(t){return"object"==typeof t&&!Array.isArray(t)&&null!==t}let Bt=new Set;function Ut(t,e){const n=`${t}:::${e}`;Bt||(Bt=new Set),Bt.has(n)||(console.error(e),Bt.add(n))}function Vt(t){t?Bt.forEach(e=>{e.startsWith(t)&&Bt.delete(e)}):Bt.clear()}function Ft(){ct.forEach(t=>t()),ct.length=0,ht()}const Kt={"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:V.Object,_default:{},_validators:[F(t=>Object.keys(t).every(t=>/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)),t=>`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: ${Object.keys(t).filter(t=>!/^[a-z]{2,3}(-[A-Z]{2,3})?$/.test(t)).join(", ")}.`)]}},Wt={"Display conditions":{privileges:{_description:"The privilege(s) the user must have to use this extension",_type:V.Array,_default:[]},expression:{_description:"The expression that determines whether the extension is displayed",_type:V.String,_default:void 0}},...Kt},qt=(t,e)=>F(n=>t<=n&&n<=e,`must be between ${t} and ${e}`),zt=t=>{const e=t.concat(["openmrsBase","openmrsSpaBase"]);return F(t=>{if(!t||"string"!=typeof t)return!1;const n=/\${(.*?)}/g;let r=n.exec(t);for(;r;){if(!e.includes(r[1]))return!1;r=n.exec(t)}return!0},"Should be a URL or path. The allowed template parameters are "+e.map(t=>"${"+t+"}").join(", "))},Ht=zt([]),Gt=t=>F(e=>t.includes(e),`Must be one of the following: '${t.join("', '")}'.`),Yt={inRange:qt,isUrl:Ht,isUrlWithTemplateParameters:zt,oneOf:Gt}},96696:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759),s=n(2519),a=n(34914);e.takeLast=function(t){return function(e){return 0===t?a.empty():e.lift(new u(t))}};var u=function(){function t(t){if(this.total=t,this.total<0)throw new s.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new c(t,this.total))},t}(),c=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return o(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,o=0;o<n;o++){var i=e++%n;t.next(r[i])}t.complete()},e}(i.Subscriber)},96904:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(71077),o=n(49529);e.publish=function(t){return t?o.multicast(function(){return new r.Subject},t):o.multicast(new r.Subject)}},98155:function(t,e,n){"use strict";var r,o=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},r(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var i=n(77759);e.pairwise=function(){return function(t){return t.lift(new s)}};var s=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new a(t))},t}(),a=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return o(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(i.Subscriber)},99271:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(61758);const o=function(t,e,n){"__proto__"==e&&r.A?(0,r.A)(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}},99549:(t,e,n)=>{"use strict";n(18780).audit,n(13441).auditTime,n(11853).buffer,n(77650).bufferCount,n(94360).bufferTime,n(43381).bufferToggle,n(51069).bufferWhen,n(85916).catchError,n(90239).combineAll,n(79397).combineLatest,n(66255).concat,n(60208).concatAll,n(92209).concatMap,n(83232).concatMapTo,n(85476).count,n(59768).debounce,n(92661).debounceTime,n(90952).defaultIfEmpty,n(17436).delay,n(41136).delayWhen,n(56051).dematerialize,n(85343).distinct,n(88179).distinctUntilChanged,n(43670).distinctUntilKeyChanged,n(57366).elementAt,n(61650).endWith,n(92472).every,n(65893).exhaust,n(29219).exhaustMap,n(76527).expand,n(64629).filter,n(4349).finalize,n(32376).find,n(8674).findIndex,n(77089).first,n(36217).groupBy,n(76024).ignoreElements,n(87362).isEmpty,n(6047).last;var r=n(89233);e.Tj=r.map,n(27296).mapTo,n(75434).materialize,n(57001).max,n(14779).merge,n(80980).mergeAll;var o=n(60781);o.mergeMap,o.flatMap,n(62988).mergeMapTo,n(86430).mergeScan,n(21547).min,n(49529).multicast,n(24654).observeOn,n(45276).onErrorResumeNext,n(98155).pairwise,n(27337).partition,n(86050).pluck,n(96904).publish,n(82334).publishBehavior,n(20232).publishLast,n(24355).publishReplay,n(89646).race,n(71929).reduce,n(30068).repeat,n(58440).repeatWhen,n(39933).retry,n(53325).retryWhen,n(85203).refCount,n(27677).sample,n(88360).sampleTime,n(85002).scan,n(54332).sequenceEqual,n(49184).share,n(91451).shareReplay,n(76003).single,n(67124).skip,n(31444).skipLast,n(51026).skipUntil,n(79159).skipWhile,n(89155).startWith,n(30162).subscribeOn,n(21324).switchAll,n(20917).switchMap,n(35428).switchMapTo;var i=n(85624);e.s=i.take,n(96696).takeLast,n(41534).takeUntil,n(5179).takeWhile,n(68022).tap,n(15019).throttle,n(7406).throttleTime,n(8347).throwIfEmpty,n(61115).timeInterval,n(82784).timeout,n(35816).timeoutWith,n(42748).timestamp,n(89133).toArray,n(22363).window,n(32216).windowCount,n(93886).windowTime,n(83903).windowToggle,n(27539).windowWhen,n(76788).withLatestFrom,n(64868).zip,n(85517).zipAll},99623:(t,e,n)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(47986),o=n(60208);e.concat=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return o.concatAll()(r.of.apply(void 0,t))}}}]);