@openmrs/esm-api
Advanced tools
Comparing version 3.1.10-pre.104 to 3.1.10-pre.105
@@ -1,2 +0,2 @@ | ||
System.register(["@openmrs/esm-config"],(function(t){var e;return{setters:[function(t){e=t}],execute:function(){t(function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=39)}([function(t,e,r){"use strict";r.d(e,"a",(function(){return i})); | ||
System.register(["@openmrs/esm-config"],(function(t){var e;return{setters:[function(t){e=t}],execute:function(){t(function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=34)}([function(t,e,r){"use strict";r.d(e,"a",(function(){return o})); | ||
/*! ***************************************************************************** | ||
@@ -16,3 +16,3 @@ Copyright (c) Microsoft Corporation. | ||
***************************************************************************** */ | ||
var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function i(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r(2);var i=r(10),o=r(14);var u=r(6),s=r(20);function c(t){return 0===t.length?s.a:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var a=r(4),f=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var u=this.operator,s=function(t,e,r){if(t){if(t instanceof n.a)return t;if(t[i.a])return t[i.a]()}return t||e||r?new n.a(t,e,r):new n.a(o.a)}(t,e,r);if(u?s.add(u.call(s,this.source)):s.add(this.source||a.a.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),a.a.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){a.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,r=e.closed,i=e.destination,o=e.isStopped;if(r||o)return!1;t=i&&i instanceof n.a?i:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=l(e))((function(e,n){var i;i=r.subscribe((function(e){try{t(e)}catch(t){n(t),i&&i.unsubscribe()}}),n,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[u.a]=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:c(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=l(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function l(t){if(t||(t=a.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r(0),i=r(11),o=r(14),u=r(3),s=r(10),c=r(4),a=r(7),f=function(t){function e(r,n,i){var u=t.call(this)||this;switch(u.syncErrorValue=null,u.syncErrorThrown=!1,u.syncErrorThrowable=!1,u.isStopped=!1,arguments.length){case 0:u.destination=o.a;break;case 1:if(!r){u.destination=o.a;break}if("object"==typeof r){r instanceof e?(u.syncErrorThrowable=r.syncErrorThrowable,u.destination=r,r.add(u)):(u.syncErrorThrowable=!0,u.destination=new l(u,r));break}default:u.syncErrorThrowable=!0,u.destination=new l(u,r,n,i)}return u}return n.a(e,t),e.prototype[s.a]=function(){return this},e.create=function(t,r,n){var i=new e(t,r,n);return i.syncErrorThrowable=!1,i},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}(u.a),l=function(t){function e(e,r,n,u){var s,c=t.call(this)||this;c._parentSubscriber=e;var a=c;return Object(i.a)(r)?s=r:r&&(s=r.next,n=r.error,u=r.complete,r!==o.a&&(a=Object.create(r),Object(i.a)(a.unsubscribe)&&c.add(a.unsubscribe.bind(a)),a.unsubscribe=c.unsubscribe.bind(c))),c._context=a,c._next=s,c._error=n,c._complete=u,c}return n.a(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;c.a.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,r=c.a.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(a.a)(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;Object(a.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};c.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),c.a.useDeprecatedSynchronousErrorHandling)throw t;Object(a.a)(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!c.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return c.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(Object(a.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(f)},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}(),i=r(19),o=r(11),u=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}(),s=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 r=this._parentOrParents,s=this._ctorUnsubscribe,a=this._unsubscribe,f=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var l=0;l<r.length;++l){r[l].remove(this)}if(Object(o.a)(a)){s&&(this._unsubscribe=void 0);try{a.call(this)}catch(t){e=t instanceof u?c(t.errors):[t]}}if(n(f)){l=-1;for(var h=f.length;++l<h;){var d=f[l];if(Object(i.a)(d))try{d.unsubscribe()}catch(t){e=e||[],t instanceof u?e=e.concat(c(t.errors)):e.push(t)}}}if(e)throw new u(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(null===i)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else{if(-1!==i.indexOf(this))return r;i.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[r]:o.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function c(t){return t.reduce((function(t,e){return t.concat(e instanceof u?e.errors:e)}),[])}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=!1,i={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;n=t},get useDeprecatedSynchronousErrorHandling(){return n}}},function(t,r){t.exports=e},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(t,e,r){"use strict";function n(t){setTimeout((function(){throw t}),0)}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));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}()},function(t,e,r){"use strict";r.d(e,"e",(function(){return S})),r.d(e,"b",(function(){return j})),r.d(e,"c",(function(){return P})),r.d(e,"d",(function(){return T})),r.d(e,"a",(function(){return A}));var n=r(1),i=r(35),o="object"==typeof self&&self&&self.Object===Object&&self,u=(i.a||o||Function("return this")()).Symbol,s=Object.prototype,c=s.hasOwnProperty,a=s.toString,f=u?u.toStringTag:void 0;var l=function(t){var e=c.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var i=a.call(t);return n&&(e?t[f]=r:delete t[f]),i},h=Object.prototype.toString;var d=function(t){return h.call(t)},p=u?u.toStringTag:void 0;var b=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":p&&p in Object(t)?l(t):d(t)};var v=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object);var y=function(t){return null!=t&&"object"==typeof t},m=Function.prototype,g=Object.prototype,w=m.toString,_=g.hasOwnProperty,x=w.call(Object);var E=function(t){if(!y(t)||"[object Object]"!=b(t))return!1;var e=v(t);if(null===e)return!0;var r=_.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&w.call(r)==x},O=r(5);const S="/ws/rest/v1/session";function j(t){return window.openmrsBase+t}function P(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.");const r=j(t);e.headers||(e.headers={}),E(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;const n=Error();return window.fetch(r,e).then(async t=>{const e=t;if(e.ok)return 204===e.status?(e.data=null,e):e.json().then(t=>(e.data=t,e));{const{redirectAuthFailure:t}=await Object(O.getConfig)("@openmrs/esm-api");return r===j(S)&&403===e.status||t.enabled&&t.errors.includes(e.status)?(Object(O.navigate)({to:t.url}),t.resolvePromise?Promise.resolve():new Promise(()=>{})):e.text().then(t=>{let i=t;try{i=JSON.parse(t)}catch(t){}throw new A(r,e,i,n)},t=>{throw new A(r,e,null,n)})}})}function T(t,e={}){if("object"!=typeof e)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const r=new AbortController;return e.signal=r.signal,new n.a(n=>{let i=!1;return P(t,e).then(t=>{i=!0,n.next(t),n.complete()},t=>{i=!0,n.error(t)}),()=>{i||r.abort()}})}class A extends Error{constructor(t,e,r,n){super(),this.message=`Server responded with ${e.status} (${e.statusText}) for url ${t}. Check err.responseBody or network tab in dev tools for more info`,n.message=this.message,this.responseBody=r,this.response=e,this.stack=`Stacktrace for outgoing request:\n${n.stack}\nStacktrace for incoming response:\n${this.stack}`}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(t,e,r){"use strict";function n(t){return"function"==typeof t}r.d(e,"a",(function(){return n}))},function(t,e,r){(function(){var t=r(44),n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,i=function(t){return t?t.toString().replace(n,""):""};e.trim=i;var o=function(t){return null==t&&void 0===t?String(t):{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"}[Object.prototype.toString.call(t)]};e.type=o;e.assertArray=function(t){if("array"!==o(t))throw"not array";return t};var u=function(t){if("object"!==o(t))throw"not object";return t};e.assertObject=u;var s=function(t,e,r){var n,i;return r||(r=[]),u(t),function(){var e;for(n in e=[],t)i=t[n],e.push([n,i]);return e}().reduce(e,r)};e.reduceMap=s;e.identity=function(t){return t};var c=function(){return Array.prototype.slice.call(arguments)};e.argsArray=c;e.mergeLists=function(){var e;return e=function(e,r){var n,i,o;for(n in i=t(!0,e),r)o=r[n],i[n]=(i[n]||[]).concat(o);return i},c.apply(null,arguments).reduce(e,{})};e.absoluteUrl=function(t,e){return e.match(/https?:\/\/./)?e:t+"/"+e};e.relativeUrl=function(t,e){return e.slice(e,t.length+1)===t+"/"?e.slice(t.length+1):e},e.resourceIdToUrl=function(t,e,r){return e=e.replace(/\/$/,""),(t=t.replace(/^\//,"")).indexOf("/")<0?e+"/"+r+"/"+t:0!==t.indexOf(e)?e+"/"+t:t};var a=function(t,e,r,n){var i;switch(o(r)){case"array":return e(r.map((function(e){return t(e,[r,n])})),n);case"object":return i=function(e,i){var o,u;return o=i[0],u=i[1],e[o]=t(u,[r].concat(n)),e},e(s(r,i,{}),n);default:return e(r,n)}};e.walk=a;var f=function(t,e,r){return e?a(f(t),t,e,r):function(e,r){return f(t,e,r)}};e.postwalk=f}).call(this)},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(1),i=r(3);function o(t,e){return new n.a((function(r){var n=new i.a,o=0;return n.add(e.schedule((function(){o!==t.length?(r.next(t[o++]),r.closed||n.add(this.schedule())):r.complete()}))),n}))}},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(4),i=r(7),o={closed:!0,next:function(t){},error:function(t){if(n.a.useDeprecatedSynchronousErrorHandling)throw t;Object(i.a)(t)},complete:function(){}}},function(t,e,r){(function(){var t=r(12),n=function(t){return t.and=function(e){return n((r=t,i=e,function(t){return r(i(t))}));var r,i},t.end=function(e){return t(e)},t};e.$$Simple=function(t){return function(e){return function(r){return e(t(r))}}};e.$$Attr=function(e,r){return n((function(n){return function(i){var o=null;return o="function"==t.type(r)?r(i):r,n(null==o&&null==o?i:function(t,e,r){for(var n=e.split("."),i=t,o=0;o<n.length-1;o++){var u=n[o];(i=t[u])||(i={},t[u]=i)}return i[n[n.length-1]]=r,t}(i,e,o))}}))};var i=function(t,e){return n((function(r){return function(n){return n[t]=e(n),r(n)}}))};e.Middleware=n,e.Attribute=i,e.Method=function(t){return i("method",(e=t,function(){return e}));var e}}).call(this)},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o}));var n=r(9);const i="/ws/fhir2/R4",o=r(43)({baseUrl:i},{http:t=>Object(n.c)(t.url,{method:t.method,headers:t.headers}).then(e=>({status:e.status,headers:e.headers,data:e.data,config:t}),e=>({status:e.response.status,headers:e.response.headers,data:e.responseBody,config:t}))})},function(t,e,r){"use strict";r.d(e,"a",(function(){return v})),r.d(e,"b",(function(){return m})),r.d(e,"c",(function(){return g}));var n=r(37),i=r(58),o=r(0),u=r(2);function s(){}var c=r(11);var a=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.nextOrObserver,this.error,this.complete))},t}(),f=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o._tapNext=s,o._tapError=s,o._tapComplete=s,o._tapError=n||s,o._tapComplete=i||s,Object(c.a)(r)?(o._context=o,o._tapNext=r):r&&(o._context=r,o._tapNext=r.next||s,o._tapError=r.error||s,o._tapComplete=r.complete||s),o}return o.a(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}(u.a),l=r(25),h=r(57),d=r(9);const p=new n.a(1);let b=0;function v(t={includeAuthStatus:!1}){return b<Date.now()-6e4&&m(),p.asObservable().pipe(Object(i.a)(),(e=y,function(t){return t.lift(new a(e,r,n))}),Object(l.a)(e=>t.includeAuthStatus?e.data:e.data.user),Object(h.a)(Boolean));var e,r,n}function y(t){var e,r,n;if(null==t||null===(e=t.data)||void 0===e||null===(r=e.user)||void 0===r||null===(n=r.userProperties)||void 0===n?void 0:n.defaultLocale){const e=t.data.user.userProperties.defaultLocale;e!=document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",e)}}function m(){b=Date.now(),p.next(Object(d.c)(d.e))}function g(t,e){return function(t,e){return e.privileges.find(e=>t===e.display)}(t,e)||function(t){return t.roles.find(t=>"System Developer"===t.display)}(e)}},function(t,e,r){"use strict";function n(t,e){void 0===e&&(e={});for(var r=function(t){for(var e=[],r=0;r<t.length;){var n=t[r];if("*"!==n&&"+"!==n&&"?"!==n)if("\\"!==n)if("{"!==n)if("}"!==n)if(":"!==n)if("("!==n)e.push({type:"CHAR",index:r,value:t[r++]});else{var i=1,o="";if("?"===t[s=r+1])throw new TypeError('Pattern cannot start with "?" at '+s);for(;s<t.length;)if("\\"!==t[s]){if(")"===t[s]){if(0===--i){s++;break}}else if("("===t[s]&&(i++,"?"!==t[s+1]))throw new TypeError("Capturing groups are not allowed at "+s);o+=t[s++]}else o+=t[s++]+t[s++];if(i)throw new TypeError("Unbalanced pattern at "+r);if(!o)throw new TypeError("Missing pattern at "+r);e.push({type:"PATTERN",index:r,value:o}),r=s}else{for(var u="",s=r+1;s<t.length;){var c=t.charCodeAt(s);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;u+=t[s++]}if(!u)throw new TypeError("Missing parameter name at "+r);e.push({type:"NAME",index:r,value:u}),r=s}else e.push({type:"CLOSE",index:r,value:t[r++]});else e.push({type:"OPEN",index:r,value:t[r++]});else e.push({type:"ESCAPED_CHAR",index:r++,value:t[r++]});else e.push({type:"MODIFIER",index:r,value:t[r++]})}return e.push({type:"END",index:r,value:""}),e}(t),n=e.prefixes,o=void 0===n?"./":n,u="[^"+i(e.delimiter||"/#?")+"]+?",s=[],c=0,a=0,f="",l=function(t){if(a<r.length&&r[a].type===t)return r[a++].value},h=function(t){var e=l(t);if(void 0!==e)return e;var n=r[a],i=n.type,o=n.index;throw new TypeError("Unexpected "+i+" at "+o+", expected "+t)},d=function(){for(var t,e="";t=l("CHAR")||l("ESCAPED_CHAR");)e+=t;return e};a<r.length;){var p=l("CHAR"),b=l("NAME"),v=l("PATTERN");if(b||v){var y=p||"";-1===o.indexOf(y)&&(f+=y,y=""),f&&(s.push(f),f=""),s.push({name:b||c++,prefix:y,suffix:"",pattern:v||u,modifier:l("MODIFIER")||""})}else{var m=p||l("ESCAPED_CHAR");if(m)f+=m;else if(f&&(s.push(f),f=""),l("OPEN")){y=d();var g=l("NAME")||"",w=l("PATTERN")||"",_=d();h("CLOSE"),s.push({name:g||(w?c++:""),pattern:g&&!w?u:w,prefix:y,suffix:_,modifier:l("MODIFIER")||""})}else h("END")}}return s}function i(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function o(t){return t&&t.sensitive?"":"i"}function u(t,e,r){return function(t,e,r){void 0===r&&(r={});for(var n=r.strict,u=void 0!==n&&n,s=r.start,c=void 0===s||s,a=r.end,f=void 0===a||a,l=r.encode,h=void 0===l?function(t){return t}:l,d="["+i(r.endsWith||"")+"]|$",p="["+i(r.delimiter||"/#?")+"]",b=c?"^":"",v=0,y=t;v<y.length;v++){var m=y[v];if("string"==typeof m)b+=i(h(m));else{var g=i(h(m.prefix)),w=i(h(m.suffix));if(m.pattern)if(e&&e.push(m),g||w)if("+"===m.modifier||"*"===m.modifier){var _="*"===m.modifier?"?":"";b+="(?:"+g+"((?:"+m.pattern+")(?:"+w+g+"(?:"+m.pattern+"))*)"+w+")"+_}else b+="(?:"+g+"("+m.pattern+")"+w+")"+m.modifier;else b+="("+m.pattern+")"+m.modifier;else b+="(?:"+g+w+")"+m.modifier}}if(f)u||(b+=p+"?"),b+=r.endsWith?"(?="+d+")":"$";else{var x=t[t.length-1],E="string"==typeof x?p.indexOf(x[x.length-1])>-1:void 0===x;u||(b+="(?:"+p+"(?="+d+"))?"),E||(b+="(?="+p+"|"+d+")")}return new RegExp(b,o(r))}(n(t,r),e,r)}function s(t,e,r){return t instanceof RegExp?function(t,e){if(!e)return t;var r=t.source.match(/\((?!\?)/g);if(r)for(var n=0;n<r.length;n++)e.push({name:n,prefix:"",suffix:"",modifier:"",pattern:""});return t}(t,e):Array.isArray(t)?function(t,e,r){var n=t.map((function(t){return s(t,e,r).source}));return new RegExp("(?:"+n.join("|")+")",o(r))}(t,e,r):u(t,e,r)}r.d(e,"b",(function(){return l})),r.d(e,"c",(function(){return h})),r.d(e,"a",(function(){return d}));var c=r(36);const a=Object(c.createGlobalStore)("breadcrumbs",[]);function f(t){return t.matcher instanceof RegExp?t.matcher:"string"==typeof t.matcher?s(t.matcher):s(t.path)}function l(t){return h([t])}function h(t){const e=[...d(),...t.map(t=>({matcher:f(t),settings:t}))];a.setState(e,!0)}function d(){return a.getState()}},function(t,e,r){"use strict";function n(t){return null!==t&&"object"==typeof t}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";function n(t){return t}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(0),i=function(t){function e(e,r){var n=t.call(this)||this;return n.subject=e,n.subscriber=r,n.closed=!1,n}return n.a(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 r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(r(3).a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}}},,function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var n=r(0),i=r(1),o=r(2),u=r(3),s=r(8),c=r(21),a=r(10),f=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return n.a(e,t),e}(o.a),l=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 n.a(e,t),e.prototype[a.a]=function(){return new f(this)},e.prototype.lift=function(t){var e=new h(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new s.a;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].next(t)},e.prototype.error=function(t){if(this.closed)throw new s.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new s.a;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].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 s.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new s.a;return this.hasError?(t.error(this.thrownError),u.a.EMPTY):this.isStopped?(t.complete(),u.a.EMPTY):(this.observers.push(t),new c.a(this,t))},e.prototype.asObservable=function(){var t=new i.a;return t.source=this,t},e.create=function(t,e){return new h(t,e)},e}(i.a),h=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return n.a(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):u.a.EMPTY},e}(l)},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(0),i=r(2);function o(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new u(t,e))}}var u=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.project,this.thisArg))},t}(),s=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.project=r,i.count=0,i.thisArg=n||i,i}return n.a(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.a)},function(t,e){},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(5),i=r(17);function o(){Object(n.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:n.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:n.Type.String,_default:"${openmrsSpaBase}/login",_validators:[n.validators.isUrl]},errors:{_type:n.Type.Array,_default:[401],_elements:{_type:n.Type.Number,_validators:[n.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:n.Type.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),Object(i.b)()}},function(t,e,r){"use strict";r.r(e);var n=r(18);r.d(e,"registerBreadcrumb",(function(){return n.b})),r.d(e,"registerBreadcrumbs",(function(){return n.c})),r.d(e,"getBreadcrumbs",(function(){return n.a}));var i=r(29);r.d(e,"filterBreadcrumbs",(function(){return i.a})),r.d(e,"getBreadcrumbsFor",(function(){return i.b}));var o=r(30);for(var u in o)["default","registerBreadcrumb","registerBreadcrumbs","getBreadcrumbs","filterBreadcrumbs","getBreadcrumbsFor"].indexOf(u)<0&&function(t){r.d(e,t,(function(){return o[t]}))}(u)},function(t,e,r){"use strict";r.d(e,"a",(function(){return o})),r.d(e,"b",(function(){return u}));var n=r(18);function i(t,e){if(e)return function(t,e){const[r]=t.filter(t=>t.matcher.test(e));return r}(t,e)||function(t,e){const r=e.split("/");for(;r.length>1;){r.pop();const e=i(t,r.join("/"));if(e)return e}}(t,e)}function o(t,e){if(t.length>0){const r=i(t,e);if(r){const e=[r];let n=i(t,r.settings.parent);for(;void 0!==n;)e.push(n),n=i(t,n.settings.parent);return e.reverse()}}return[]}function u(t){return o(Object(n.a)(),t)}},function(t,e){},function(t,e,r){"use strict";r.d(e,"a",(function(){return l})),r.d(e,"c",(function(){return h})),r.d(e,"b",(function(){return d}));var n=r(37),i=r(16),o=r(58),u=r(25),s=r(57);let c;const a=new n.a(1),f=new n.a(1);function l(t={includeConfig:!1}){return f.asObservable().pipe(Object(o.a)(),Object(u.a)(e=>t.includeConfig?e:e.data),Object(s.a)(Boolean))}function h(){f.next(i.a.read({type:"Patient",patient:c}))}function d(){return a.asObservable()}window.addEventListener("single-spa:routing-event",()=>{const t=function(){const t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}();t&&t!==c&&(c=t,a.next(t),t&&f.next(i.a.read({type:"Patient",patient:c})))})},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));const n={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}},function(t,e,r){"use strict";r.d(e,"b",(function(){return i})),r.d(e,"a",(function(){return o}));const n=new(r(24).a);function i(t){n.next(t)}function o(){return n.asObservable()}},function(t,e,r){function n(t,e){const r=document.createElement("a");r.href=t;const n="/"===r.pathname[0]?r.pathname:"/"+r.pathname;let i=0,o=n.length;for(;i!==e&&o>=0;){"/"===n[--o]&&i++}if(i!==e)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+e+") is greater than the number of directories ("+i+") in the URL path "+t);const u=n.slice(0,o+1);return r.protocol+"//"+r.host+u}e.setPublicPath=function(t,e){if(e||(e=1),"string"!=typeof t||0===t.trim().length)throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'");if("number"!=typeof e||e<=0||!i(e))throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'");let o;try{if(o=window.System.resolve(t),!o)throw Error()}catch(e){throw Error("systemjs-webpack-interop: There is no such module '"+t+"' in the SystemJS registry. Did you misspell the name of your module?")}r.p=n(o,e)},e.resolveDirectory=n;const i=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}},function(t,e,r){"use strict";(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.a=r}).call(this,r(42))},function(t,e){System.register([],(function(t){return{execute:function(){t(function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=1)}([function(t,e,r){function n(t,e){const r=document.createElement("a");r.href=t;const n="/"===r.pathname[0]?r.pathname:"/"+r.pathname;let i=0,o=n.length;for(;i!==e&&o>=0;)"/"===n[--o]&&i++;if(i!==e)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+e+") is greater than the number of directories ("+i+") in the URL path "+t);const u=n.slice(0,o+1);return r.protocol+"//"+r.host+u}e.setPublicPath=function(t,e){if(e||(e=1),"string"!=typeof t||0===t.trim().length)throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'");if("number"!=typeof e||e<=0||!i(e))throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'");let o;try{if(o=window.System.resolve(t),!o)throw Error()}catch(e){throw Error("systemjs-webpack-interop: There is no such module '"+t+"' in the SystemJS registry. Did you misspell the name of your module?")}r.p=n(o,e)},e.resolveDirectory=n;const i=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}},function(t,e,r){r(2),t.exports=r(3)},function(t,e,r){"use strict";r.r(e);var n=r(0);Object(n.setPublicPath)("@openmrs/esm-state")},function(t,e,r){"use strict";function n(t,e){for(var r in e)t[r]=e[r];return t}r.r(e),r.d(e,"createGlobalStore",(function(){return u})),r.d(e,"getGlobalStore",(function(){return s})),r.d(e,"createAppState",(function(){return c})),r.d(e,"getAppState",(function(){return a}));var i=function(t){var e=[];function r(t){for(var r=[],n=0;n<e.length;n++)e[n]===t?t=null:r.push(e[n]);e=r}function i(r,i,o){t=i?r:n(n({},t),r);for(var u=e,s=0;s<u.length;s++)u[s](t,o)}return t=t||{},{action:function(e){function r(t){i(t,!1,e)}return function(){for(var n=arguments,i=[t],o=0;o<arguments.length;o++)i.push(n[o]);var u=e.apply(this,i);if(null!=u)return u.then?u.then(r):r(u)}},setState:i,subscribe:function(t){return e.push(t),function(){r(t)}},unsubscribe:r,getState:function(){return t}}};const o={};function u(t,e){const r=o[t];if(r)return r.active?console.error("Cannot override an existing store. Make sure that stores are only created once."):r.value.setState(e,!0),r.active=!0,r.value;{const r=i(e);return o[t]={value:r,active:!0},r}}function s(t,e){const r=o[t];if(!r){const r=i(e);return o[t]={value:r,active:!1},r}return r.value}function c(t){return u("app",t)}function a(){return s("app",{})}}]))}}}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return O}));var n=r(0),i=r(24),o=r(3),u=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return n.a(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,n):e.flush(this)},e}(function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.pending=!1,n}return n.a(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!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 r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,r){return t.call(this)||this}return n.a(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(o.a))),s=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}(),c=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.a(e,t),e}(function(t){function e(r,n){void 0===n&&(n=s.now);var i=t.call(this,r,(function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return n.a(e,t),e.prototype.schedule=function(r,n,i){return void 0===n&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(s)))(u),a=r(2),f=r(1),l=new f.a((function(t){return t.complete()}));function h(t){return t?function(t){return new f.a((function(e){return t.schedule((function(){return e.complete()}))}))}(t):l}function d(t){return t&&"function"==typeof t.schedule}var p,b=r(22),v=r(13);function y(t,e){return e?Object(v.a)(t,e):new f.a(Object(b.a)(t))}function m(t){var e=t.error;t.subscriber.error(e)}p||(p={});var g=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,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,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){var t,e;switch(this.kind){case"N":return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return d(r)?(t.pop(),Object(v.a)(t,r)):y(t)}(this.value);case"E":return t=this.error,e?new f.a((function(r){return e.schedule(m,0,{error:t,subscriber:r})})):new f.a((function(e){return e.error(t)}));case"C":return h()}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}();var w=function(t){function e(e,r,n){void 0===n&&(n=0);var i=t.call(this,e)||this;return i.scheduler=r,i.delay=n,i}return n.a(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new _(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(g.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(g.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(g.createComplete()),this.unsubscribe()},e}(a.a),_=function(){return function(t,e){this.notification=t,this.destination=e}}(),x=r(8),E=r(21),O=function(t){function e(e,r,n){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var i=t.call(this)||this;return i.scheduler=n,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=e<1?1:e,i._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return n.a(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new S(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),i=this.scheduler,u=n.length;if(this.closed)throw new x.a;if(this.isStopped||this.hasError?e=o.a.EMPTY:(this.observers.push(t),e=new E.a(this,t)),i&&t.add(t=new w(t,i)),r)for(var s=0;s<u&&!t.closed;s++)t.next(n[s]);else for(s=0;s<u&&!t.closed;s++)t.next(n[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||c).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,n=this._events,i=n.length,o=0;o<i&&!(t-n[o].time<r);)o++;return i>e&&(o=Math.max(o,i-e)),o>0&&n.splice(0,o),n},e}(i.a),S=function(){return function(t,e){this.time=t,this.value=e}}()},,function(t,e,r){r(40),t.exports=r(41)},function(t,e,r){"use strict";r.r(e);var n=r(34);Object(n.setPublicPath)("@openmrs/esm-api")},function(t,e,r){"use strict";r.r(e);var n=r(26);for(var i in n)["default"].indexOf(i)<0&&function(t){r.d(e,t,(function(){return n[t]}))}(i);var o=r(9);r.d(e,"sessionEndpoint",(function(){return o.e})),r.d(e,"makeUrl",(function(){return o.b})),r.d(e,"openmrsFetch",(function(){return o.c})),r.d(e,"openmrsObservableFetch",(function(){return o.d})),r.d(e,"OpenmrsFetchError",(function(){return o.a}));var u=r(16);r.d(e,"fhirBaseUrl",(function(){return u.b})),r.d(e,"fhir",(function(){return u.a}));var s=r(27);r.d(e,"setupApiModule",(function(){return s.a}));var c=r(28);for(var i in c)["default","sessionEndpoint","makeUrl","openmrsFetch","openmrsObservableFetch","OpenmrsFetchError","fhirBaseUrl","fhir","setupApiModule"].indexOf(i)<0&&function(t){r.d(e,t,(function(){return c[t]}))}(i);var a=r(17);r.d(e,"getCurrentUser",(function(){return a.a})),r.d(e,"refetchCurrentUser",(function(){return a.b})),r.d(e,"userHasAccess",(function(){return a.c}));var f=r(31);r.d(e,"getCurrentPatient",(function(){return f.a})),r.d(e,"refetchCurrentPatient",(function(){return f.c})),r.d(e,"getCurrentPatientUuid",(function(){return f.b}));var l=r(32);r.d(e,"backendDependencies",(function(){return l.a}));var h=r(33);r.d(e,"newWorkspaceItem",(function(){return h.b})),r.d(e,"getNewWorkspaceItem",(function(){return h.a}))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(){r(12);var e=r(15),n=r(46),i=r(47),o=r(49),u=r(50),s=r(51),c=r(52),a=r(53),f=r(54),l=r(55),h=r(56);t.exports=function(t,r){var d=e.Middleware,p=e.$$Attr,b=function(t){return p("method",t)},v=function(t,e){return p("headers."+t,e)},y=d(u),m=d(s(t,r)).and(y).and(i.$Basic).and(i.$Bearer).and(i.$Credentials).and(o.$JsonData).and(v("Accept",t.headers&&t.headers.Accept?t.headers.Accept:"application/json")).and(v("Content-Type",t.headers&&t.headers["Content-Type"]?t.headers["Content-Type"]:"application/json")),g=m.and(b("GET")),w=m.and(b("POST")),_=m.and(b("PUT")),x=m.and(b("DELETE")),E=m.and(b("PATCH")),O=o.Http(t,r),S=l.Path,j=S(t.baseUrl),P=j.slash(":type || :resource.resourceType"),T=P.slash("_history"),A=P.slash(":id || :resource.id"),$=A.slash("_history"),I=A.slash(":versionId || :resource.meta.versionId"),N=j.slash(":target.resourceType || :target.type").slash(":target.id").slash(":target.versionId"),C=v("Prefer","return=representation"),k=d(n.$Paging);return h({conformance:g.and(j.slash("metadata")).end(O),document:w.and(j.slash("Document")).end(O),profile:g.and(j.slash("Profile").slash(":type")).end(O),transaction:w.and(j).end(O),history:g.and(j.slash("_history")).and(k).end(O),typeHistory:g.and(T).and(k).end(O),resourceHistory:g.and($).and(k).end(O),read:g.and(a.$WithPatient).and(A).end(O),vread:g.and(I).end(O),delete:x.and(A).and(C).end(O),create:w.and(P).and(C).end(O),validate:w.and(P.slash("_validate")).end(O),meta:{add:w.and(N.slash("$meta-add")).end(O),delete:w.and(N.slash("$meta-delete")).end(O),read:g.and(N.slash("$meta")).end(O)},search:g.and(P).and(a.$WithPatient).and(n.$SearchParams).and(k).end(O),update:_.and(A).and(C).end(O),conditionalUpdate:_.and(P).and(n.$SearchParams).and(C).end(O),conditionalDelete:x.and(P).and(n.$SearchParams).and(C).end(O),nextPage:g.and(c.$$BundleLinkUrl("next")).end(O),prevPage:g.and(c.$$BundleLinkUrl("previous")).and(c.$$BundleLinkUrl("prev")).end(O),getBundleByUrl:g.and(S(":url")).end(O),resolve:g.and(f.resolve).end(O),patch:E.and(A).and(v("Content-Type","application/json-patch+json")).end(O)},r)}}).call(this)},function(t,e,r){(function(t){!function(e){var r=function(t){return i(!0===t,!1,arguments)};function n(t,e){if("object"!==o(t))return e;for(var r in e)"object"===o(t[r])&&"object"===o(e[r])?t[r]=n(t[r],e[r]):t[r]=e[r];return t}function i(t,e,i){var u=i[0],s=i.length;(t||"object"!==o(u))&&(u={});for(var c=0;c<s;++c){var a=i[c];if("object"===o(a))for(var f in a)if("__proto__"!==f){var l=t?r.clone(a[f]):a[f];u[f]=e?n(u[f],l):l}}return u}function o(t){return{}.toString.call(t).slice(8,-1).toLowerCase()}r.recursive=function(t){return i(!0===t,!0,arguments)},r.clone=function(t){var e,n,i=t,u=o(t);if("array"===u)for(i=[],n=t.length,e=0;e<n;++e)i[e]=r.clone(t[e]);else if("object"===u)for(e in i={},t)i[e]=r.clone(t[e]);return i},e?t.exports=r:window.merge=r}(t&&"object"==typeof t.exports&&t.exports)}).call(this,r(45)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){(function(){var t=r(12),n=t.type,i=t.assertArray,o=(t.assertObject,t.reduceMap),u=t.identity,s={$gt:"gt",$lt:"lt",$lte:"lte",$gte:"gte",$ge:"ge",$le:"le"},c={$asc:":asc",$desc:":desc",$exact:":exact",$missing:":missing",$null:":missing",$text:":text"},a=function(t,e){if("$sort"===t)return function(t){var e,r,o,u;for(i(t),o=[],e=0,r=t.length;e<r;e++)switch(u=t[e],n(u)){case"array":o.push({param:"_sort",value:u[0],modifier:":"+u[1]});break;case"string":o.push({param:"_sort",value:u});break;default:o.push(void 0)}return o}(e);if("$has"===t)return o(e,(function(t,e){var r,i;return r=e[0],i=e[1],t.concat(function(){switch(n(i)){case"array":return i.map((function(t){return{param:"_has",value:r+"="+t}}));case"string":return[{param:"_has",value:r+"="+i}]}}())}));if("$include"===t||"$revInclude"===t)return function(t,e){return o(t,(function(t,r){var i,o;return i=r[0],o=r[1],t.concat(function(){switch(n(o)){case"array":return o.map((function(t){return{param:"$include"===e?"_include":"_revinclude",value:i+":"+t}}));case"string":return[{param:"$include"===e?"_include":"_revinclude",value:i+":"+o}]}}())}))}(e,t);switch(n(e)){case"object":return function(t,e){return o(e,(function(r,o){var u,f,l,h;return u=o[0],h=o[1],r.concat("$and"===u?i(h).reduce((function(e,r){return e.concat(a(t,r))}),[]):"$type"===u?[]:function(t){return 0===t.indexOf("$")}(u)?(f={param:t},"$or"===u?f.value=h:(s[u]&&(f.operator=s[u]),c[u]&&(f.modifier=c[u]),"object"===n(h)&&h.$or?f.value=h.$or:f.value=[h]),[f]):(e.$type&&(l=":"+e.$type),a(""+t+(l||"")+"."+u,h)))}))}(t,e);case"string":case"number":return[{param:t,value:[e]}];case"array":return[{param:t,value:[e.join("|")]}];default:throw"could not linearizeParams "+n(e)}},f=function(t){return o(t,(function(t,e){var r,n;return r=e[0],n=e[1],t.concat(a(r,n))}))},l=function(t){var e,r,n=["_include","_revinclude","_has"];return function(){var i,o,s,c;for(c=[],i=0,o=(s=f(t)).length;i<o;i++)e=s[i],r=-1===n.indexOf(e.param)?encodeURIComponent(e.value):e.value,c.push([e.param,e.modifier,"_has"==e.param?":":"=",e.operator,r].filter(u).join(""));return c}().join("&")};e._query=f,e.query=l;var h=r(15);e.$SearchParams=h.$$Attr("url",(function(t){var e=t.url;return t.query?e+"?"+l(t.query):e})),e.$Paging=function(t){return function(e){var r=e.params||{};return e.since&&(r._since=e.since),e.count&&(r._count=e.count),e.params=r,t(e)}}}).call(this)},function(t,e,r){(function(){var t,n=r(15),i=r(48).btoa;e.$Basic=n.$$Attr("headers.Authorization",(function(t){if(t.auth&&t.auth.user&&t.auth.pass)return"Basic "+i(t.auth.user+":"+t.auth.pass)})),e.$Bearer=n.$$Attr("headers.Authorization",(function(t){if(t.auth&&t.auth.bearer)return"Bearer "+t.auth.bearer})),e.$Credentials=n.Middleware(n.$$Attr("credentials",(function(e){return t=e.credentials,""}))).and(n.$$Attr("credentials",(function(e){if(["same-origin","include"].indexOf(t)>-1)return t})))}).call(this)},function(t,e,r){!function(){var t=e,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function n(t){this.message=t}n.prototype=new Error,n.prototype.name="InvalidCharacterError",t.btoa||(t.btoa=function(t){for(var e,i,o=String(t),u=0,s=r,c="";o.charAt(0|u)||(s="=",u%1);c+=s.charAt(63&e>>8-u%1*8)){if((i=o.charCodeAt(u+=3/4))>255)throw new n("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");e=e<<8|i}return c}),t.atob||(t.atob=function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var i,o,u=0,s=0,c="";o=e.charAt(s++);~o&&(i=u%4?64*i+o:o,u++%4)?c+=String.fromCharCode(255&i>>(-2*u&6)):0)o=r.indexOf(o);return c})}()},function(t,e,r){(function(){var t=r(12);e.Http=function(t,e){return function(r){r.debug&&console.log("\nDEBUG (request):",r.method,r.url,r);var n=(r.http||e.http||t.http)(r);return r.debug&&n&&n.then&&n.then((function(t){console.log("\nDEBUG: (responce)",t)})),n}};e.$JsonData=function(e){return function(r){var n,i=r.bundle||r.data||r.resource;return i&&(r.data=(n=i,"object"==t.type(n)||"array"==t.type(n)?JSON.stringify(n):n)),e(r)}}}).call(this)},function(t,e){t.exports=function(t){return function(e){try{return t(e)}catch(t){if(e.debug&&(console.log("\nDEBUG: (ERROR in middleware)"),console.log(t.message),console.log(t.stack)),!e.defer)throw console.log("\nDEBUG: (ERROR in middleware)"),console.log(t.message),console.log(t.stack),new Error("I need adapter.defer");var r=e.defer();return r.reject(t),r.promise}}}},function(t,e){(function(){var e=function(t,e,r){var n=t[r];return n&&!e[r]&&(e[r]=n),t};t.exports=function(t,r){return function(n){return function(i){return e(t,i,"baseUrl"),e(t,i,"cache"),e(t,i,"auth"),e(t,i,"patient"),e(t,i,"debug"),e(t,i,"credentials"),e(t,i,"headers"),e(t,i,"agentOptions"),e(r,i,"defer"),e(r,i,"http"),n(i)}}}}).call(this)},function(t,e){e.$$BundleLinkUrl=function(t){return function(e){return function(r){var n=r.bundle&&(r.bundle.link||[]).filter((function(e){return e.relation&&e.relation===t}))[0];return n&&n.url&&(r.url=n.url,r.data=null),e(r)}}}},function(t,e,r){(function(){var t=r(15),n=["Account","AllergyIntolerance","BodySite","CarePlan","Claim","ClinicalImpression","Communication","CommunicationRequest","Composition","Condition","Contract","DetectedIssue","Device","DeviceUseRequest","DeviceUseStatement","DiagnosticOrder","DiagnosticReport","DocumentManifest","DocumentReference","Encounter","EnrollmentRequest","EpisodeOfCare","FamilyMemberHistory","Flag","Goal","ImagingObjectSelection","ImagingStudy","Immunization","ImmunizationRecommendation","List","Media","MedicationAdministration","MedicationDispense","MedicationOrder","MedicationStatement","NutritionOrder","Observation","Order","Procedure","ProcedureRequest","QuestionnaireResponse","ReferralRequest","RelatedPerson","RiskAssessment","Specimen","SupplyDelivery","SupplyRequest","VisionPrescription"];e.$WithPatient=t.$$Simple((function(t){var e=t.type;return t.patient&&("Patient"===e?(t.query=t.query||{},t.query._id=t.patient,t.id=t.patient):n.indexOf(e)>=0&&(t.query=t.query||{},t.query.patient=t.patient)),t}))}).call(this)},function(t,e,r){(function(){var e=r(12),n=/^#(.*)/,i=function(t){var r=t.cache,i=t.reference,o=t.bundle,u=i;if(!u.reference)return null;if(u.reference.match(n))return function(t,e){var r=t.match(n)[1],i=(e.contained||[]).filter((function(t){return(t.id||t._id)==r}))[0];return i&&{content:i}||null}(u.reference,t.resource);var s=e.absoluteUrl(t.baseUrl,u.reference);return(o&&o.entry||[]).filter((function(t){return t.id===s}))[0]||(null!=r?r[s]:void 0)||null};t.exports.sync=i,t.exports.resolve=function(t){return function(r){var o=i(r),u=r.reference,s=r.defer();if(o){if(!r.defer)throw new Error("I need promise constructor 'adapter.defer' in adapter");return s.resolve(o),s.promise}if(!u)throw new Error("No reference found");if(u&&u.reference.match(n))throw new Error("Contained resource not found");return r.url=e.absoluteUrl(r.baseUrl,u.reference),r.data=null,t(r)}}}).call(this)},function(t,e,r){(function(){r(12);var t=r(15),n=function(e,r){var i=function(t){return r&&e.includes("target.versionId")&&!t.target.versionId?r(t):(r&&r(t)+"/"||"")+function(t,e){var r=function(t,e){return 0==t.indexOf(":")?function(t,e){for(var r,n=t.split("||").map((function(t){return t.trim().substring(1)})),i=0;i<n.length;i++){var o=(r=e,n[i].split(".").reduce((function(t,e){return"versionId"===e&&t[e]?"_history/"+t[e]:null==t||null==t?null:t[e]}),r));if(o)return o}return null}(t,e):t}(t.trim(),e);if((null==r||void 0===r)&&0==t.includes("target.versionId"))throw new Error("Parameter "+t+" is required: "+JSON.stringify(e));return r}(e,t)},o=t.Attribute("url",i);return o.slash=function(t){return n(t,i)},o};e.Path=n}).call(this)},function(t,e){(function(){var e,r;function n(t,n,i,o){r.defer();e.search(t).then((function(t){(function t(n,i){var o,u=n.data.entry||[],s=[];for(o=0;o<u.length;o++)s.push(u[o].resource);i(s);var c=r.defer();return e.nextPage({bundle:n.data}).then((function(e){t(e,i).then((function(t){c.resolve()}))}),(function(t){c.resolve()})),c.promise})(t,n).then((function(){i()}),(function(t){o(t)}))}),(function(t){o(t)}))}function i(t){var e=r.defer(),i=[];return n(t,(function(t){t.forEach((function(t){i.push(t)}))}),(function(){e.resolve(i)}),(function(t){e.reject(t)})),e.promise}function o(t,n){var i=r.defer();return e.search(t).then((function(t){var r={},o=[function(){i.resolve(t,r)}];function u(t,n,i){o.push((function(){!function(t,n,i){var o=i.reference;e.resolve({bundle:t,resource:n,reference:i}).then((function(t){var e=t.data||t.content;r[o]=e,s()}))}(t,n,i)}))}function s(){o.pop()()}var c=t.data;c.entry&&c.entry.forEach((function(t){var e=t.resource,i=e.resourceType;n&&n.forEach((function(t){var n=t.split("."),o=n[0],s=n[1],a=e[s];if(i===o&&a){var f=a.reference;r[f]||u(c,e,a)}}))})),s()}),(function(){i.reject("Could not fetch search results")})),i.promise}t.exports=function(t,u){return e=t,r=u,t.drain=n,t.fetchAll=i,t.fetchAllWithReferences=o,t}}).call(this)},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(0),i=r(2);function o(t,e){return function(r){return r.lift(new u(t,e))}}var u=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))},t}(),s=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.predicate=r,i.thisArg=n,i.count=0,i}return n.a(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.a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return S}));var n=r(0),i=r(25),o=r(1),u=r(22),s=r(7);function c(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var a=c(),f=r(6),l=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function h(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var d=r(19),p=function(t){if(t&&"function"==typeof t[f.a])return n=t,function(t){var e=n[f.a]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(l(t))return Object(u.a)(t);if(h(t))return r=t,function(t){return r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,s.a),t};if(t&&"function"==typeof t[a])return e=t,function(t){for(var r=e[a]();;){var n=void 0;try{n=r.next()}catch(e){return t.error(e),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof r.return&&t.add((function(){r.return&&r.return()})),t};var e,r,n,i=Object(d.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+i+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")},b=r(3);var v=r(13);function y(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[f.a]}(t))return function(t,e){return new o.a((function(r){var n=new b.a;return n.add(e.schedule((function(){var i=t[f.a]();n.add(i.subscribe({next:function(t){n.add(e.schedule((function(){return r.next(t)})))},error:function(t){n.add(e.schedule((function(){return r.error(t)})))},complete:function(){n.add(e.schedule((function(){return r.complete()})))}}))}))),n}))}(t,e);if(h(t))return function(t,e){return new o.a((function(r){var n=new b.a;return n.add(e.schedule((function(){return t.then((function(t){n.add(e.schedule((function(){r.next(t),n.add(e.schedule((function(){return r.complete()})))})))}),(function(t){n.add(e.schedule((function(){return r.error(t)})))}))}))),n}))}(t,e);if(l(t))return Object(v.a)(t,e);if(function(t){return t&&"function"==typeof t[a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new o.a((function(r){var n,i=new b.a;return i.add((function(){n&&"function"==typeof n.return&&n.return()})),i.add(e.schedule((function(){n=t[a](),i.add(e.schedule((function(){if(!r.closed){var t,e;try{var i=n.next();t=i.value,e=i.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),i}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}var m=r(2),g=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,r}return n.a(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}(m.a),w=(m.a,function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.a(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}(m.a));m.a;function _(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(n){return n.pipe(_((function(r,n){return(u=t(r,n),s?y(u,s):u instanceof o.a?u:new o.a(p(u))).pipe(Object(i.a)((function(t,i){return e(r,t,n,i)})));var u,s}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new x(t,r))})}var x=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 E(t,this.project,this.concurrent))},t}(),E=function(t){function e(e,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var i=t.call(this,e)||this;return i.project=r,i.concurrent=n,i.hasCompleted=!1,i.buffer=[],i.active=0,i.index=0,i}return n.a(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,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new g(this),r=this.destination;r.add(e);var n=function(t,e){if(!e.closed)return t instanceof o.a?t.subscribe(e):p(t)(e)}(t,e);n!==e&&r.add(n)},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}(w),O=r(20);function S(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),_(O.a,t)}}]))}}})); | ||
var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function o(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}},function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r(2);var o=r(10),i=r(14);var u=r(6),s=r(19);function c(t){return 0===t.length?s.a:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var a=r(4),f=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var u=this.operator,s=function(t,e,r){if(t){if(t instanceof n.a)return t;if(t[o.a])return t[o.a]()}return t||e||r?new n.a(t,e,r):new n.a(i.a)}(t,e,r);if(u?s.add(u.call(s,this.source)):s.add(this.source||a.a.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),a.a.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){a.a.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),!function(t){for(;t;){var e=t,r=e.closed,o=e.destination,i=e.isStopped;if(r||i)return!1;t=o&&o instanceof n.a?o:null}return!0}(t)?console.warn(e):t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=l(e))((function(e,n){var o;o=r.subscribe((function(e){try{t(e)}catch(t){n(t),o&&o.unsubscribe()}}),n,e)}))},t.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},t.prototype[u.a]=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:c(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=l(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function l(t){if(t||(t=a.a.Promise||Promise),!t)throw new Error("no Promise impl found");return t}},function(t,e,r){"use strict";r.d(e,"a",(function(){return f}));var n=r(0),o=r(11),i=r(14),u=r(3),s=r(10),c=r(4),a=r(7),f=function(t){function e(r,n,o){var u=t.call(this)||this;switch(u.syncErrorValue=null,u.syncErrorThrown=!1,u.syncErrorThrowable=!1,u.isStopped=!1,arguments.length){case 0:u.destination=i.a;break;case 1:if(!r){u.destination=i.a;break}if("object"==typeof r){r instanceof e?(u.syncErrorThrowable=r.syncErrorThrowable,u.destination=r,r.add(u)):(u.syncErrorThrowable=!0,u.destination=new l(u,r));break}default:u.syncErrorThrowable=!0,u.destination=new l(u,r,n,o)}return u}return n.a(e,t),e.prototype[s.a]=function(){return this},e.create=function(t,r,n){var o=new e(t,r,n);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}(u.a),l=function(t){function e(e,r,n,u){var s,c=t.call(this)||this;c._parentSubscriber=e;var a=c;return Object(o.a)(r)?s=r:r&&(s=r.next,n=r.error,u=r.complete,r!==i.a&&(a=Object.create(r),Object(o.a)(a.unsubscribe)&&c.add(a.unsubscribe.bind(a)),a.unsubscribe=c.unsubscribe.bind(c))),c._context=a,c._next=s,c._error=n,c._complete=u,c}return n.a(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;c.a.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,r=c.a.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):Object(a.a)(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;Object(a.a)(t)}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};c.a.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),c.a.useDeprecatedSynchronousErrorHandling)throw t;Object(a.a)(t)}},e.prototype.__tryOrSetError=function(t,e,r){if(!c.a.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,r)}catch(e){return c.a.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=e,t.syncErrorThrown=!0,!0):(Object(a.a)(e),!0)}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(f)},function(t,e,r){"use strict";r.d(e,"a",(function(){return s}));var n=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}(),o=r(18),i=r(11),u=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}(),s=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 r=this._parentOrParents,s=this._ctorUnsubscribe,a=this._unsubscribe,f=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof t)r.remove(this);else if(null!==r)for(var l=0;l<r.length;++l){r[l].remove(this)}if(Object(i.a)(a)){s&&(this._unsubscribe=void 0);try{a.call(this)}catch(t){e=t instanceof u?c(t.errors):[t]}}if(n(f)){l=-1;for(var h=f.length;++l<h;){var d=f[l];if(Object(o.a)(d))try{d.unsubscribe()}catch(t){e=e||[],t instanceof u?e=e.concat(c(t.errors)):e.push(t)}}}if(e)throw new u(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||"function"!=typeof r.unsubscribe)return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;(r=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=r._parentOrParents;if(null===o)r._parentOrParents=this;else if(o instanceof t){if(o===this)return r;r._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return r;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[r]:i.push(r),r},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},t.EMPTY=((e=new t).closed=!0,e),t}();function c(t){return t.reduce((function(t,e){return t.concat(e instanceof u?e.errors:e)}),[])}},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=!1,o={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){t&&(new Error).stack;n=t},get useDeprecatedSynchronousErrorHandling(){return n}}},function(t,r){t.exports=e},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}()},function(t,e,r){"use strict";function n(t){setTimeout((function(){throw t}),0)}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));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}()},function(t,e,r){"use strict";r.d(e,"e",(function(){return j})),r.d(e,"b",(function(){return S})),r.d(e,"c",(function(){return P})),r.d(e,"d",(function(){return T})),r.d(e,"a",(function(){return $}));var n=r(1),o=r(31),i="object"==typeof self&&self&&self.Object===Object&&self,u=(o.a||i||Function("return this")()).Symbol,s=Object.prototype,c=s.hasOwnProperty,a=s.toString,f=u?u.toStringTag:void 0;var l=function(t){var e=c.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var o=a.call(t);return n&&(e?t[f]=r:delete t[f]),o},h=Object.prototype.toString;var d=function(t){return h.call(t)},p=u?u.toStringTag:void 0;var b=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":p&&p in Object(t)?l(t):d(t)};var v=function(t,e){return function(r){return t(e(r))}}(Object.getPrototypeOf,Object);var y=function(t){return null!=t&&"object"==typeof t},m=Function.prototype,w=Object.prototype,g=m.toString,_=w.hasOwnProperty,x=g.call(Object);var E=function(t){if(!y(t)||"[object Object]"!=b(t))return!1;var e=v(t);if(null===e)return!0;var r=_.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&g.call(r)==x},O=r(5);const j="/ws/rest/v1/session";function S(t){return window.openmrsBase+t}function P(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.");const r=S(t);e.headers||(e.headers={}),E(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;const n=Error();return window.fetch(r,e).then(async t=>{const e=t;if(e.ok)return 204===e.status?(e.data=null,e):e.json().then(t=>(e.data=t,e));{const{redirectAuthFailure:t}=await Object(O.getConfig)("@openmrs/esm-api");return r===S(j)&&403===e.status||t.enabled&&t.errors.includes(e.status)?(Object(O.navigate)({to:t.url}),t.resolvePromise?Promise.resolve():new Promise(()=>{})):e.text().then(t=>{let o=t;try{o=JSON.parse(t)}catch(t){}throw new $(r,e,o,n)},t=>{throw new $(r,e,null,n)})}})}function T(t,e={}){if("object"!=typeof e)throw Error("The second argument to openmrsObservableFetch must be either omitted or an object");const r=new AbortController;return e.signal=r.signal,new n.a(n=>{let o=!1;return P(t,e).then(t=>{o=!0,n.next(t),n.complete()},t=>{o=!0,n.error(t)}),()=>{o||r.abort()}})}class $ extends Error{constructor(t,e,r,n){super(),this.message=`Server responded with ${e.status} (${e.statusText}) for url ${t}. Check err.responseBody or network tab in dev tools for more info`,n.message=this.message,this.responseBody=r,this.response=e,this.stack=`Stacktrace for outgoing request:\n${n.stack}\nStacktrace for incoming response:\n${this.stack}`}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}()},function(t,e,r){"use strict";function n(t){return"function"==typeof t}r.d(e,"a",(function(){return n}))},function(t,e,r){(function(){var t=r(39),n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=function(t){return t?t.toString().replace(n,""):""};e.trim=o;var i=function(t){return null==t&&void 0===t?String(t):{"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"}[Object.prototype.toString.call(t)]};e.type=i;e.assertArray=function(t){if("array"!==i(t))throw"not array";return t};var u=function(t){if("object"!==i(t))throw"not object";return t};e.assertObject=u;var s=function(t,e,r){var n,o;return r||(r=[]),u(t),function(){var e;for(n in e=[],t)o=t[n],e.push([n,o]);return e}().reduce(e,r)};e.reduceMap=s;e.identity=function(t){return t};var c=function(){return Array.prototype.slice.call(arguments)};e.argsArray=c;e.mergeLists=function(){var e;return e=function(e,r){var n,o,i;for(n in o=t(!0,e),r)i=r[n],o[n]=(o[n]||[]).concat(i);return o},c.apply(null,arguments).reduce(e,{})};e.absoluteUrl=function(t,e){return e.match(/https?:\/\/./)?e:t+"/"+e};e.relativeUrl=function(t,e){return e.slice(e,t.length+1)===t+"/"?e.slice(t.length+1):e},e.resourceIdToUrl=function(t,e,r){return e=e.replace(/\/$/,""),(t=t.replace(/^\//,"")).indexOf("/")<0?e+"/"+r+"/"+t:0!==t.indexOf(e)?e+"/"+t:t};var a=function(t,e,r,n){var o;switch(i(r)){case"array":return e(r.map((function(e){return t(e,[r,n])})),n);case"object":return o=function(e,o){var i,u;return i=o[0],u=o[1],e[i]=t(u,[r].concat(n)),e},e(s(r,o,{}),n);default:return e(r,n)}};e.walk=a;var f=function(t,e,r){return e?a(f(t),t,e,r):function(e,r){return f(t,e,r)}};e.postwalk=f}).call(this)},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(1),o=r(3);function i(t,e){return new n.a((function(r){var n=new o.a,i=0;return n.add(e.schedule((function(){i!==t.length?(r.next(t[i++]),r.closed||n.add(this.schedule())):r.complete()}))),n}))}},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(4),o=r(7),i={closed:!0,next:function(t){},error:function(t){if(n.a.useDeprecatedSynchronousErrorHandling)throw t;Object(o.a)(t)},complete:function(){}}},function(t,e,r){(function(){var t=r(12),n=function(t){return t.and=function(e){return n((r=t,o=e,function(t){return r(o(t))}));var r,o},t.end=function(e){return t(e)},t};e.$$Simple=function(t){return function(e){return function(r){return e(t(r))}}};e.$$Attr=function(e,r){return n((function(n){return function(o){var i=null;return i="function"==t.type(r)?r(o):r,n(null==i&&null==i?o:function(t,e,r){for(var n=e.split("."),o=t,i=0;i<n.length-1;i++){var u=n[i];(o=t[u])||(o={},t[u]=o)}return o[n[n.length-1]]=r,t}(o,e,i))}}))};var o=function(t,e){return n((function(r){return function(n){return n[t]=e(n),r(n)}}))};e.Middleware=n,e.Attribute=o,e.Method=function(t){return o("method",(e=t,function(){return e}));var e}}).call(this)},function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return i}));var n=r(9);const o="/ws/fhir2/R4",i=r(38)({baseUrl:o},{http:t=>Object(n.c)(t.url,{method:t.method,headers:t.headers}).then(e=>({status:e.status,headers:e.headers,data:e.data,config:t}),e=>({status:e.response.status,headers:e.response.headers,data:e.responseBody,config:t}))})},function(t,e,r){"use strict";r.d(e,"a",(function(){return v})),r.d(e,"b",(function(){return m})),r.d(e,"c",(function(){return w}));var n=r(32),o=r(53),i=r(0),u=r(2);function s(){}var c=r(11);var a=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new f(t,this.nextOrObserver,this.error,this.complete))},t}(),f=function(t){function e(e,r,n,o){var i=t.call(this,e)||this;return i._tapNext=s,i._tapError=s,i._tapComplete=s,i._tapError=n||s,i._tapComplete=o||s,Object(c.a)(r)?(i._context=i,i._tapNext=r):r&&(i._context=r,i._tapNext=r.next||s,i._tapError=r.error||s,i._tapComplete=r.complete||s),i}return i.a(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}(u.a),l=r(24),h=r(52),d=r(9);const p=new n.a(1);let b=0;function v(t={includeAuthStatus:!1}){return b<Date.now()-6e4&&m(),p.asObservable().pipe(Object(o.a)(),(e=y,function(t){return t.lift(new a(e,r,n))}),Object(l.a)(e=>t.includeAuthStatus?e.data:e.data.user),Object(h.a)(Boolean));var e,r,n}function y(t){var e,r,n;if(null==t||null===(e=t.data)||void 0===e||null===(r=e.user)||void 0===r||null===(n=r.userProperties)||void 0===n?void 0:n.defaultLocale){const e=t.data.user.userProperties.defaultLocale;e!=document.documentElement.getAttribute("lang")&&document.documentElement.setAttribute("lang",e)}}function m(){b=Date.now(),p.next(Object(d.c)(d.e))}function w(t,e){return function(t,e){return e.privileges.find(e=>t===e.display)}(t,e)||function(t){return t.roles.find(t=>"System Developer"===t.display)}(e)}},function(t,e,r){"use strict";function n(t){return null!==t&&"object"==typeof t}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";function n(t){return t}r.d(e,"a",(function(){return n}))},function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(0),o=function(t){function e(e,r){var n=t.call(this)||this;return n.subject=e,n.subscriber=r,n.closed=!1,n}return n.a(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 r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},e}(r(3).a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));var n=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}}},,function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var n=r(0),o=r(1),i=r(2),u=r(3),s=r(8),c=r(20),a=r(10),f=function(t){function e(e){var r=t.call(this,e)||this;return r.destination=e,r}return n.a(e,t),e}(i.a),l=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 n.a(e,t),e.prototype[a.a]=function(){return new f(this)},e.prototype.lift=function(t){var e=new h(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new s.a;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),o=0;o<r;o++)n[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new s.a;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),o=0;o<r;o++)n[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new s.a;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].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 s.a;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new s.a;return this.hasError?(t.error(this.thrownError),u.a.EMPTY):this.isStopped?(t.complete(),u.a.EMPTY):(this.observers.push(t),new c.a(this,t))},e.prototype.asObservable=function(){var t=new o.a;return t.source=this,t},e.create=function(t,e){return new h(t,e)},e}(o.a),h=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return n.a(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):u.a.EMPTY},e}(l)},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(0),o=r(2);function i(t,e){return function(r){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return r.lift(new u(t,e))}}var u=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.project,this.thisArg))},t}(),s=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.project=r,o.count=0,o.thisArg=n||o,o}return n.a(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}(o.a)},function(t,e){},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(5),o=r(17);function i(){Object(n.defineConfigSchema)("@openmrs/esm-api",{redirectAuthFailure:{enabled:{_type:n.Type.Boolean,_default:!0,_description:"Whether to redirect logged-out users to `redirectAuthFailure.url`"},url:{_type:n.Type.String,_default:"${openmrsSpaBase}/login",_validators:[n.validators.isUrl]},errors:{_type:n.Type.Array,_default:[401],_elements:{_type:n.Type.Number,_validators:[n.validators.inRange(100,600)]},_description:"The HTTP error codes for which users will be redirected"},resolvePromise:{_type:n.Type.Boolean,_default:!1,_description:"Changes how requests that fail authentication are handled. Try messing with this if redirects to the login page aren't working correctly."}}}),Object(o.b)()}},function(t,e,r){"use strict";r.d(e,"a",(function(){return l})),r.d(e,"c",(function(){return h})),r.d(e,"b",(function(){return d}));var n=r(32),o=r(16),i=r(53),u=r(24),s=r(52);let c;const a=new n.a(1),f=new n.a(1);function l(t={includeConfig:!1}){return f.asObservable().pipe(Object(i.a)(),Object(u.a)(e=>t.includeConfig?e:e.data),Object(s.a)(Boolean))}function h(){f.next(o.a.read({type:"Patient",patient:c}))}function d(){return a.asObservable()}window.addEventListener("single-spa:routing-event",()=>{const t=function(){const t=/\/patient\/([a-zA-Z0-9\-]+)\/?/.exec(location.pathname);return t&&t[1]}();t&&t!==c&&(c=t,a.next(t),t&&f.next(o.a.read({type:"Patient",patient:c})))})},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));const n={"webservices.rest":"2.24.0",fhir2:"1.0.0-SNAPSHOT"}},function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"a",(function(){return i}));const n=new(r(23).a);function o(t){n.next(t)}function i(){return n.asObservable()}},function(t,e,r){function n(t,e){const r=document.createElement("a");r.href=t;const n="/"===r.pathname[0]?r.pathname:"/"+r.pathname;let o=0,i=n.length;for(;o!==e&&i>=0;){"/"===n[--i]&&o++}if(o!==e)throw Error("systemjs-webpack-interop: rootDirectoryLevel ("+e+") is greater than the number of directories ("+o+") in the URL path "+t);const u=n.slice(0,i+1);return r.protocol+"//"+r.host+u}e.setPublicPath=function(t,e){if(e||(e=1),"string"!=typeof t||0===t.trim().length)throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName) must be called with a non-empty string 'systemjsModuleName'");if("number"!=typeof e||e<=0||!o(e))throw Error("systemjs-webpack-interop: setPublicPath(systemjsModuleName, rootDirectoryLevel) must be called with a positive integer 'rootDirectoryLevel'");let i;try{if(i=window.System.resolve(t),!i)throw Error()}catch(e){throw Error("systemjs-webpack-interop: There is no such module '"+t+"' in the SystemJS registry. Did you misspell the name of your module?")}r.p=n(i,e)},e.resolveDirectory=n;const o=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}},function(t,e,r){"use strict";(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.a=r}).call(this,r(37))},function(t,e,r){"use strict";r.d(e,"a",(function(){return O}));var n=r(0),o=r(23),i=r(3),u=function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n}return n.a(e,t),e.prototype.schedule=function(e,r){return void 0===r&&(r=0),r>0?t.prototype.schedule.call(this,e,r):(this.delay=r,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,r){return r>0||this.closed?t.prototype.execute.call(this,e,r):this._execute(e,r)},e.prototype.requestAsyncId=function(e,r,n){return void 0===n&&(n=0),null!==n&&n>0||null===n&&this.delay>0?t.prototype.requestAsyncId.call(this,e,r,n):e.flush(this)},e}(function(t){function e(e,r){var n=t.call(this,e,r)||this;return n.scheduler=e,n.work=r,n.pending=!1,n}return n.a(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},e.prototype.requestAsyncId=function(t,e,r){return void 0===r&&(r=0),setInterval(t.flush.bind(t,this),r)},e.prototype.recycleAsyncId=function(t,e,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!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 r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(t){r=!0,n=!!t&&t||new Error(t)}if(r)return this.unsubscribe(),n},e.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},e}(function(t){function e(e,r){return t.call(this)||this}return n.a(e,t),e.prototype.schedule=function(t,e){return void 0===e&&(e=0),this},e}(i.a))),s=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=function(){return Date.now()},t}(),c=new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.a(e,t),e}(function(t){function e(r,n){void 0===n&&(n=s.now);var o=t.call(this,r,(function(){return e.delegate&&e.delegate!==o?e.delegate.now():n()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return n.a(e,t),e.prototype.schedule=function(r,n,o){return void 0===n&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,o):t.prototype.schedule.call(this,r,n,o)},e.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},e}(s)))(u),a=r(2),f=r(1),l=new f.a((function(t){return t.complete()}));function h(t){return t?function(t){return new f.a((function(e){return t.schedule((function(){return e.complete()}))}))}(t):l}function d(t){return t&&"function"==typeof t.schedule}var p,b=r(21),v=r(13);function y(t,e){return e?Object(v.a)(t,e):new f.a(Object(b.a)(t))}function m(t){var e=t.error;t.subscriber.error(e)}p||(p={});var w=function(){function t(t,e,r){this.kind=t,this.value=e,this.error=r,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,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},t.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},t.prototype.toObservable=function(){var t,e;switch(this.kind){case"N":return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return d(r)?(t.pop(),Object(v.a)(t,r)):y(t)}(this.value);case"E":return t=this.error,e?new f.a((function(r){return e.schedule(m,0,{error:t,subscriber:r})})):new f.a((function(e){return e.error(t)}));case"C":return h()}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}();var g=function(t){function e(e,r,n){void 0===n&&(n=0);var o=t.call(this,e)||this;return o.scheduler=r,o.delay=n,o}return n.a(e,t),e.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new _(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(w.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(w.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(w.createComplete()),this.unsubscribe()},e}(a.a),_=function(){return function(t,e){this.notification=t,this.destination=e}}(),x=r(8),E=r(20),O=function(t){function e(e,r,n){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===r&&(r=Number.POSITIVE_INFINITY);var o=t.call(this)||this;return o.scheduler=n,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=r<1?1:r,r===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return n.a(e,t),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var r=this._events;r.push(e),r.length>this._bufferSize&&r.shift()}t.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new j(this._getNow(),e)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){var e,r=this._infiniteTimeWindow,n=r?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,u=n.length;if(this.closed)throw new x.a;if(this.isStopped||this.hasError?e=i.a.EMPTY:(this.observers.push(t),e=new E.a(this,t)),o&&t.add(t=new g(t,o)),r)for(var s=0;s<u&&!t.closed;s++)t.next(n[s]);else for(s=0;s<u&&!t.closed;s++)t.next(n[s].value);return this.hasError?t.error(this.thrownError):this.isStopped&&t.complete(),e},e.prototype._getNow=function(){return(this.scheduler||c).now()},e.prototype._trimBufferThenGetEvents=function(){for(var t=this._getNow(),e=this._bufferSize,r=this._windowTime,n=this._events,o=n.length,i=0;i<o&&!(t-n[i].time<r);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&n.splice(0,i),n},e}(o.a),j=function(){return function(t,e){this.time=t,this.value=e}}()},,function(t,e,r){r(35),t.exports=r(36)},function(t,e,r){"use strict";r.r(e);var n=r(30);Object(n.setPublicPath)("@openmrs/esm-api")},function(t,e,r){"use strict";r.r(e);var n=r(25);for(var o in n)["default"].indexOf(o)<0&&function(t){r.d(e,t,(function(){return n[t]}))}(o);var i=r(9);r.d(e,"sessionEndpoint",(function(){return i.e})),r.d(e,"makeUrl",(function(){return i.b})),r.d(e,"openmrsFetch",(function(){return i.c})),r.d(e,"openmrsObservableFetch",(function(){return i.d})),r.d(e,"OpenmrsFetchError",(function(){return i.a}));var u=r(16);r.d(e,"fhirBaseUrl",(function(){return u.b})),r.d(e,"fhir",(function(){return u.a}));var s=r(26);r.d(e,"setupApiModule",(function(){return s.a}));var c=r(17);r.d(e,"getCurrentUser",(function(){return c.a})),r.d(e,"refetchCurrentUser",(function(){return c.b})),r.d(e,"userHasAccess",(function(){return c.c}));var a=r(27);r.d(e,"getCurrentPatient",(function(){return a.a})),r.d(e,"refetchCurrentPatient",(function(){return a.c})),r.d(e,"getCurrentPatientUuid",(function(){return a.b}));var f=r(28);r.d(e,"backendDependencies",(function(){return f.a}));var l=r(29);r.d(e,"newWorkspaceItem",(function(){return l.b})),r.d(e,"getNewWorkspaceItem",(function(){return l.a}))},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(function(){r(12);var e=r(15),n=r(41),o=r(42),i=r(44),u=r(45),s=r(46),c=r(47),a=r(48),f=r(49),l=r(50),h=r(51);t.exports=function(t,r){var d=e.Middleware,p=e.$$Attr,b=function(t){return p("method",t)},v=function(t,e){return p("headers."+t,e)},y=d(u),m=d(s(t,r)).and(y).and(o.$Basic).and(o.$Bearer).and(o.$Credentials).and(i.$JsonData).and(v("Accept",t.headers&&t.headers.Accept?t.headers.Accept:"application/json")).and(v("Content-Type",t.headers&&t.headers["Content-Type"]?t.headers["Content-Type"]:"application/json")),w=m.and(b("GET")),g=m.and(b("POST")),_=m.and(b("PUT")),x=m.and(b("DELETE")),E=m.and(b("PATCH")),O=i.Http(t,r),j=l.Path,S=j(t.baseUrl),P=S.slash(":type || :resource.resourceType"),T=P.slash("_history"),$=P.slash(":id || :resource.id"),A=$.slash("_history"),I=$.slash(":versionId || :resource.meta.versionId"),N=S.slash(":target.resourceType || :target.type").slash(":target.id").slash(":target.versionId"),C=v("Prefer","return=representation"),k=d(n.$Paging);return h({conformance:w.and(S.slash("metadata")).end(O),document:g.and(S.slash("Document")).end(O),profile:w.and(S.slash("Profile").slash(":type")).end(O),transaction:g.and(S).end(O),history:w.and(S.slash("_history")).and(k).end(O),typeHistory:w.and(T).and(k).end(O),resourceHistory:w.and(A).and(k).end(O),read:w.and(a.$WithPatient).and($).end(O),vread:w.and(I).end(O),delete:x.and($).and(C).end(O),create:g.and(P).and(C).end(O),validate:g.and(P.slash("_validate")).end(O),meta:{add:g.and(N.slash("$meta-add")).end(O),delete:g.and(N.slash("$meta-delete")).end(O),read:w.and(N.slash("$meta")).end(O)},search:w.and(P).and(a.$WithPatient).and(n.$SearchParams).and(k).end(O),update:_.and($).and(C).end(O),conditionalUpdate:_.and(P).and(n.$SearchParams).and(C).end(O),conditionalDelete:x.and(P).and(n.$SearchParams).and(C).end(O),nextPage:w.and(c.$$BundleLinkUrl("next")).end(O),prevPage:w.and(c.$$BundleLinkUrl("previous")).and(c.$$BundleLinkUrl("prev")).end(O),getBundleByUrl:w.and(j(":url")).end(O),resolve:w.and(f.resolve).end(O),patch:E.and($).and(v("Content-Type","application/json-patch+json")).end(O)},r)}}).call(this)},function(t,e,r){(function(t){!function(e){var r=function(t){return o(!0===t,!1,arguments)};function n(t,e){if("object"!==i(t))return e;for(var r in e)"object"===i(t[r])&&"object"===i(e[r])?t[r]=n(t[r],e[r]):t[r]=e[r];return t}function o(t,e,o){var u=o[0],s=o.length;(t||"object"!==i(u))&&(u={});for(var c=0;c<s;++c){var a=o[c];if("object"===i(a))for(var f in a)if("__proto__"!==f){var l=t?r.clone(a[f]):a[f];u[f]=e?n(u[f],l):l}}return u}function i(t){return{}.toString.call(t).slice(8,-1).toLowerCase()}r.recursive=function(t){return o(!0===t,!0,arguments)},r.clone=function(t){var e,n,o=t,u=i(t);if("array"===u)for(o=[],n=t.length,e=0;e<n;++e)o[e]=r.clone(t[e]);else if("object"===u)for(e in o={},t)o[e]=r.clone(t[e]);return o},e?t.exports=r:window.merge=r}(t&&"object"==typeof t.exports&&t.exports)}).call(this,r(40)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){(function(){var t=r(12),n=t.type,o=t.assertArray,i=(t.assertObject,t.reduceMap),u=t.identity,s={$gt:"gt",$lt:"lt",$lte:"lte",$gte:"gte",$ge:"ge",$le:"le"},c={$asc:":asc",$desc:":desc",$exact:":exact",$missing:":missing",$null:":missing",$text:":text"},a=function(t,e){if("$sort"===t)return function(t){var e,r,i,u;for(o(t),i=[],e=0,r=t.length;e<r;e++)switch(u=t[e],n(u)){case"array":i.push({param:"_sort",value:u[0],modifier:":"+u[1]});break;case"string":i.push({param:"_sort",value:u});break;default:i.push(void 0)}return i}(e);if("$has"===t)return i(e,(function(t,e){var r,o;return r=e[0],o=e[1],t.concat(function(){switch(n(o)){case"array":return o.map((function(t){return{param:"_has",value:r+"="+t}}));case"string":return[{param:"_has",value:r+"="+o}]}}())}));if("$include"===t||"$revInclude"===t)return function(t,e){return i(t,(function(t,r){var o,i;return o=r[0],i=r[1],t.concat(function(){switch(n(i)){case"array":return i.map((function(t){return{param:"$include"===e?"_include":"_revinclude",value:o+":"+t}}));case"string":return[{param:"$include"===e?"_include":"_revinclude",value:o+":"+i}]}}())}))}(e,t);switch(n(e)){case"object":return function(t,e){return i(e,(function(r,i){var u,f,l,h;return u=i[0],h=i[1],r.concat("$and"===u?o(h).reduce((function(e,r){return e.concat(a(t,r))}),[]):"$type"===u?[]:function(t){return 0===t.indexOf("$")}(u)?(f={param:t},"$or"===u?f.value=h:(s[u]&&(f.operator=s[u]),c[u]&&(f.modifier=c[u]),"object"===n(h)&&h.$or?f.value=h.$or:f.value=[h]),[f]):(e.$type&&(l=":"+e.$type),a(""+t+(l||"")+"."+u,h)))}))}(t,e);case"string":case"number":return[{param:t,value:[e]}];case"array":return[{param:t,value:[e.join("|")]}];default:throw"could not linearizeParams "+n(e)}},f=function(t){return i(t,(function(t,e){var r,n;return r=e[0],n=e[1],t.concat(a(r,n))}))},l=function(t){var e,r,n=["_include","_revinclude","_has"];return function(){var o,i,s,c;for(c=[],o=0,i=(s=f(t)).length;o<i;o++)e=s[o],r=-1===n.indexOf(e.param)?encodeURIComponent(e.value):e.value,c.push([e.param,e.modifier,"_has"==e.param?":":"=",e.operator,r].filter(u).join(""));return c}().join("&")};e._query=f,e.query=l;var h=r(15);e.$SearchParams=h.$$Attr("url",(function(t){var e=t.url;return t.query?e+"?"+l(t.query):e})),e.$Paging=function(t){return function(e){var r=e.params||{};return e.since&&(r._since=e.since),e.count&&(r._count=e.count),e.params=r,t(e)}}}).call(this)},function(t,e,r){(function(){var t,n=r(15),o=r(43).btoa;e.$Basic=n.$$Attr("headers.Authorization",(function(t){if(t.auth&&t.auth.user&&t.auth.pass)return"Basic "+o(t.auth.user+":"+t.auth.pass)})),e.$Bearer=n.$$Attr("headers.Authorization",(function(t){if(t.auth&&t.auth.bearer)return"Bearer "+t.auth.bearer})),e.$Credentials=n.Middleware(n.$$Attr("credentials",(function(e){return t=e.credentials,""}))).and(n.$$Attr("credentials",(function(e){if(["same-origin","include"].indexOf(t)>-1)return t})))}).call(this)},function(t,e,r){!function(){var t=e,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function n(t){this.message=t}n.prototype=new Error,n.prototype.name="InvalidCharacterError",t.btoa||(t.btoa=function(t){for(var e,o,i=String(t),u=0,s=r,c="";i.charAt(0|u)||(s="=",u%1);c+=s.charAt(63&e>>8-u%1*8)){if((o=i.charCodeAt(u+=3/4))>255)throw new n("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");e=e<<8|o}return c}),t.atob||(t.atob=function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,i,u=0,s=0,c="";i=e.charAt(s++);~i&&(o=u%4?64*o+i:i,u++%4)?c+=String.fromCharCode(255&o>>(-2*u&6)):0)i=r.indexOf(i);return c})}()},function(t,e,r){(function(){var t=r(12);e.Http=function(t,e){return function(r){r.debug&&console.log("\nDEBUG (request):",r.method,r.url,r);var n=(r.http||e.http||t.http)(r);return r.debug&&n&&n.then&&n.then((function(t){console.log("\nDEBUG: (responce)",t)})),n}};e.$JsonData=function(e){return function(r){var n,o=r.bundle||r.data||r.resource;return o&&(r.data=(n=o,"object"==t.type(n)||"array"==t.type(n)?JSON.stringify(n):n)),e(r)}}}).call(this)},function(t,e){t.exports=function(t){return function(e){try{return t(e)}catch(t){if(e.debug&&(console.log("\nDEBUG: (ERROR in middleware)"),console.log(t.message),console.log(t.stack)),!e.defer)throw console.log("\nDEBUG: (ERROR in middleware)"),console.log(t.message),console.log(t.stack),new Error("I need adapter.defer");var r=e.defer();return r.reject(t),r.promise}}}},function(t,e){(function(){var e=function(t,e,r){var n=t[r];return n&&!e[r]&&(e[r]=n),t};t.exports=function(t,r){return function(n){return function(o){return e(t,o,"baseUrl"),e(t,o,"cache"),e(t,o,"auth"),e(t,o,"patient"),e(t,o,"debug"),e(t,o,"credentials"),e(t,o,"headers"),e(t,o,"agentOptions"),e(r,o,"defer"),e(r,o,"http"),n(o)}}}}).call(this)},function(t,e){e.$$BundleLinkUrl=function(t){return function(e){return function(r){var n=r.bundle&&(r.bundle.link||[]).filter((function(e){return e.relation&&e.relation===t}))[0];return n&&n.url&&(r.url=n.url,r.data=null),e(r)}}}},function(t,e,r){(function(){var t=r(15),n=["Account","AllergyIntolerance","BodySite","CarePlan","Claim","ClinicalImpression","Communication","CommunicationRequest","Composition","Condition","Contract","DetectedIssue","Device","DeviceUseRequest","DeviceUseStatement","DiagnosticOrder","DiagnosticReport","DocumentManifest","DocumentReference","Encounter","EnrollmentRequest","EpisodeOfCare","FamilyMemberHistory","Flag","Goal","ImagingObjectSelection","ImagingStudy","Immunization","ImmunizationRecommendation","List","Media","MedicationAdministration","MedicationDispense","MedicationOrder","MedicationStatement","NutritionOrder","Observation","Order","Procedure","ProcedureRequest","QuestionnaireResponse","ReferralRequest","RelatedPerson","RiskAssessment","Specimen","SupplyDelivery","SupplyRequest","VisionPrescription"];e.$WithPatient=t.$$Simple((function(t){var e=t.type;return t.patient&&("Patient"===e?(t.query=t.query||{},t.query._id=t.patient,t.id=t.patient):n.indexOf(e)>=0&&(t.query=t.query||{},t.query.patient=t.patient)),t}))}).call(this)},function(t,e,r){(function(){var e=r(12),n=/^#(.*)/,o=function(t){var r=t.cache,o=t.reference,i=t.bundle,u=o;if(!u.reference)return null;if(u.reference.match(n))return function(t,e){var r=t.match(n)[1],o=(e.contained||[]).filter((function(t){return(t.id||t._id)==r}))[0];return o&&{content:o}||null}(u.reference,t.resource);var s=e.absoluteUrl(t.baseUrl,u.reference);return(i&&i.entry||[]).filter((function(t){return t.id===s}))[0]||(null!=r?r[s]:void 0)||null};t.exports.sync=o,t.exports.resolve=function(t){return function(r){var i=o(r),u=r.reference,s=r.defer();if(i){if(!r.defer)throw new Error("I need promise constructor 'adapter.defer' in adapter");return s.resolve(i),s.promise}if(!u)throw new Error("No reference found");if(u&&u.reference.match(n))throw new Error("Contained resource not found");return r.url=e.absoluteUrl(r.baseUrl,u.reference),r.data=null,t(r)}}}).call(this)},function(t,e,r){(function(){r(12);var t=r(15),n=function(e,r){var o=function(t){return r&&e.includes("target.versionId")&&!t.target.versionId?r(t):(r&&r(t)+"/"||"")+function(t,e){var r=function(t,e){return 0==t.indexOf(":")?function(t,e){for(var r,n=t.split("||").map((function(t){return t.trim().substring(1)})),o=0;o<n.length;o++){var i=(r=e,n[o].split(".").reduce((function(t,e){return"versionId"===e&&t[e]?"_history/"+t[e]:null==t||null==t?null:t[e]}),r));if(i)return i}return null}(t,e):t}(t.trim(),e);if((null==r||void 0===r)&&0==t.includes("target.versionId"))throw new Error("Parameter "+t+" is required: "+JSON.stringify(e));return r}(e,t)},i=t.Attribute("url",o);return i.slash=function(t){return n(t,o)},i};e.Path=n}).call(this)},function(t,e){(function(){var e,r;function n(t,n,o,i){r.defer();e.search(t).then((function(t){(function t(n,o){var i,u=n.data.entry||[],s=[];for(i=0;i<u.length;i++)s.push(u[i].resource);o(s);var c=r.defer();return e.nextPage({bundle:n.data}).then((function(e){t(e,o).then((function(t){c.resolve()}))}),(function(t){c.resolve()})),c.promise})(t,n).then((function(){o()}),(function(t){i(t)}))}),(function(t){i(t)}))}function o(t){var e=r.defer(),o=[];return n(t,(function(t){t.forEach((function(t){o.push(t)}))}),(function(){e.resolve(o)}),(function(t){e.reject(t)})),e.promise}function i(t,n){var o=r.defer();return e.search(t).then((function(t){var r={},i=[function(){o.resolve(t,r)}];function u(t,n,o){i.push((function(){!function(t,n,o){var i=o.reference;e.resolve({bundle:t,resource:n,reference:o}).then((function(t){var e=t.data||t.content;r[i]=e,s()}))}(t,n,o)}))}function s(){i.pop()()}var c=t.data;c.entry&&c.entry.forEach((function(t){var e=t.resource,o=e.resourceType;n&&n.forEach((function(t){var n=t.split("."),i=n[0],s=n[1],a=e[s];if(o===i&&a){var f=a.reference;r[f]||u(c,e,a)}}))})),s()}),(function(){o.reject("Could not fetch search results")})),o.promise}t.exports=function(t,u){return e=t,r=u,t.drain=n,t.fetchAll=o,t.fetchAllWithReferences=i,t}}).call(this)},function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(0),o=r(2);function i(t,e){return function(r){return r.lift(new u(t,e))}}var u=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.predicate,this.thisArg))},t}(),s=function(t){function e(e,r,n){var o=t.call(this,e)||this;return o.predicate=r,o.thisArg=n,o.count=0,o}return n.a(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}(o.a)},function(t,e,r){"use strict";r.d(e,"a",(function(){return j}));var n=r(0),o=r(24),i=r(1),u=r(21),s=r(7);function c(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var a=c(),f=r(6),l=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function h(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}var d=r(18),p=function(t){if(t&&"function"==typeof t[f.a])return n=t,function(t){var e=n[f.a]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)};if(l(t))return Object(u.a)(t);if(h(t))return r=t,function(t){return r.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,s.a),t};if(t&&"function"==typeof t[a])return e=t,function(t){for(var r=e[a]();;){var n=void 0;try{n=r.next()}catch(e){return t.error(e),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof r.return&&t.add((function(){r.return&&r.return()})),t};var e,r,n,o=Object(d.a)(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+o+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")},b=r(3);var v=r(13);function y(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[f.a]}(t))return function(t,e){return new i.a((function(r){var n=new b.a;return n.add(e.schedule((function(){var o=t[f.a]();n.add(o.subscribe({next:function(t){n.add(e.schedule((function(){return r.next(t)})))},error:function(t){n.add(e.schedule((function(){return r.error(t)})))},complete:function(){n.add(e.schedule((function(){return r.complete()})))}}))}))),n}))}(t,e);if(h(t))return function(t,e){return new i.a((function(r){var n=new b.a;return n.add(e.schedule((function(){return t.then((function(t){n.add(e.schedule((function(){r.next(t),n.add(e.schedule((function(){return r.complete()})))})))}),(function(t){n.add(e.schedule((function(){return r.error(t)})))}))}))),n}))}(t,e);if(l(t))return Object(v.a)(t,e);if(function(t){return t&&"function"==typeof t[a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new i.a((function(r){var n,o=new b.a;return o.add((function(){n&&"function"==typeof n.return&&n.return()})),o.add(e.schedule((function(){n=t[a](),o.add(e.schedule((function(){if(!r.closed){var t,e;try{var o=n.next();t=o.value,e=o.done}catch(t){return void r.error(t)}e?r.complete():(r.next(t),this.schedule())}})))}))),o}))}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}var m=r(2),w=function(t){function e(e){var r=t.call(this)||this;return r.parent=e,r}return n.a(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}(m.a),g=(m.a,function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.a(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}(m.a));m.a;function _(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),"function"==typeof e?function(n){return n.pipe(_((function(r,n){return(u=t(r,n),s?y(u,s):u instanceof i.a?u:new i.a(p(u))).pipe(Object(o.a)((function(t,o){return e(r,t,n,o)})));var u,s}),r))}:("number"==typeof e&&(r=e),function(e){return e.lift(new x(t,r))})}var x=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 E(t,this.project,this.concurrent))},t}(),E=function(t){function e(e,r,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this,e)||this;return o.project=r,o.concurrent=n,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return n.a(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,r=this.index++;try{e=this.project(t,r)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(t){var e=new w(this),r=this.destination;r.add(e);var n=function(t,e){if(!e.closed)return t instanceof i.a?t.subscribe(e):p(t)(e)}(t,e);n!==e&&r.add(n)},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}(g),O=r(19);function j(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),_(O.a,t)}}]))}}})); | ||
//# sourceMappingURL=openmrs-esm-api.js.map |
@@ -13,4 +13,2 @@ [Back to README.md](../README.md) | ||
- [BreadcrumbRegistration](interfaces/breadcrumbregistration.md) | ||
- [BreadcrumbSettings](interfaces/breadcrumbsettings.md) | ||
- [CurrentUserOptions](interfaces/currentuseroptions.md) | ||
@@ -44,5 +42,2 @@ - [CurrentUserWithResponseOption](interfaces/currentuserwithresponseoption.md) | ||
- [filterBreadcrumbs](API.md#filterbreadcrumbs) | ||
- [getBreadcrumbs](API.md#getbreadcrumbs) | ||
- [getBreadcrumbsFor](API.md#getbreadcrumbsfor) | ||
- [getCurrentPatient](API.md#getcurrentpatient) | ||
@@ -58,4 +53,2 @@ - [getCurrentPatientUuid](API.md#getcurrentpatientuuid) | ||
- [refetchCurrentUser](API.md#refetchcurrentuser) | ||
- [registerBreadcrumb](API.md#registerbreadcrumb) | ||
- [registerBreadcrumbs](API.md#registerbreadcrumbs) | ||
- [setupApiModule](API.md#setupapimodule) | ||
@@ -121,45 +114,2 @@ - [userHasAccess](API.md#userhasaccess) | ||
### filterBreadcrumbs | ||
▸ **filterBreadcrumbs**(`list`: [*BreadcrumbRegistration*](interfaces/breadcrumbregistration.md)[], `path`: *string*): [*BreadcrumbRegistration*](interfaces/breadcrumbregistration.md)[] | ||
#### Parameters: | ||
Name | Type | | ||
:------ | :------ | | ||
`list` | [*BreadcrumbRegistration*](interfaces/breadcrumbregistration.md)[] | | ||
`path` | *string* | | ||
**Returns:** [*BreadcrumbRegistration*](interfaces/breadcrumbregistration.md)[] | ||
Defined in: [packages/esm-api/src/breadcrumbs/filter.ts:42](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/esm-api/src/breadcrumbs/filter.ts#L42) | ||
___ | ||
### getBreadcrumbs | ||
▸ **getBreadcrumbs**(): [*BreadcrumbRegistration*](interfaces/breadcrumbregistration.md)[] | ||
**Returns:** [*BreadcrumbRegistration*](interfaces/breadcrumbregistration.md)[] | ||
Defined in: [packages/esm-api/src/breadcrumbs/db.ts:34](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/esm-api/src/breadcrumbs/db.ts#L34) | ||
___ | ||
### getBreadcrumbsFor | ||
▸ **getBreadcrumbsFor**(`path`: *string*): [*BreadcrumbRegistration*](interfaces/breadcrumbregistration.md)[] | ||
#### Parameters: | ||
Name | Type | | ||
:------ | :------ | | ||
`path` | *string* | | ||
**Returns:** [*BreadcrumbRegistration*](interfaces/breadcrumbregistration.md)[] | ||
Defined in: [packages/esm-api/src/breadcrumbs/filter.ts:65](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/esm-api/src/breadcrumbs/filter.ts#L65) | ||
___ | ||
### getCurrentPatient | ||
@@ -351,34 +301,2 @@ | ||
### registerBreadcrumb | ||
▸ **registerBreadcrumb**(`breadcrumb`: [*BreadcrumbSettings*](interfaces/breadcrumbsettings.md)): *void* | ||
#### Parameters: | ||
Name | Type | | ||
:------ | :------ | | ||
`breadcrumb` | [*BreadcrumbSettings*](interfaces/breadcrumbsettings.md) | | ||
**Returns:** *void* | ||
Defined in: [packages/esm-api/src/breadcrumbs/db.ts:20](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/esm-api/src/breadcrumbs/db.ts#L20) | ||
___ | ||
### registerBreadcrumbs | ||
▸ **registerBreadcrumbs**(`breadcrumbs`: [*BreadcrumbSettings*](interfaces/breadcrumbsettings.md)[]): *void* | ||
#### Parameters: | ||
Name | Type | | ||
:------ | :------ | | ||
`breadcrumbs` | [*BreadcrumbSettings*](interfaces/breadcrumbsettings.md)[] | | ||
**Returns:** *void* | ||
Defined in: [packages/esm-api/src/breadcrumbs/db.ts:24](https://github.com/openmrs/openmrs-esm-core/blob/master/packages/esm-api/src/breadcrumbs/db.ts#L24) | ||
___ | ||
### setupApiModule | ||
@@ -385,0 +303,0 @@ |
{ | ||
"name": "@openmrs/esm-api", | ||
"version": "3.1.10-pre.104", | ||
"version": "3.1.10-pre.105", | ||
"license": "MPL-2.0", | ||
@@ -15,4 +15,3 @@ "description": "The javascript module for interacting with the OpenMRS API", | ||
"typescript": "tsc", | ||
"lint": "eslint src --ext ts,tsx", | ||
"format": "prettier --write src/**" | ||
"lint": "eslint src --ext ts,tsx" | ||
}, | ||
@@ -44,4 +43,3 @@ "keywords": [ | ||
"lodash-es": "^4.17.15", | ||
"systemjs-webpack-interop": "^2.1.2", | ||
"unistore": "^3.5.2" | ||
"systemjs-webpack-interop": "^2.1.2" | ||
}, | ||
@@ -53,9 +51,9 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@openmrs/esm-config": "^3.1.10-pre.104", | ||
"@openmrs/esm-error-handling": "^3.1.10-pre.104", | ||
"@openmrs/esm-state": "^3.1.10-pre.104", | ||
"@openmrs/esm-config": "^3.1.10-pre.105", | ||
"@openmrs/esm-error-handling": "^3.1.10-pre.105", | ||
"@openmrs/esm-state": "^3.1.10-pre.105", | ||
"@types/fhir": "0.0.31", | ||
"rxjs": "^6.5.3" | ||
}, | ||
"gitHead": "d9d0659283eff65e472897b2146cd0b8c5799adc" | ||
"gitHead": "7525e973b1d0c269ba10c7eb3630516bc2e1a6c3" | ||
} |
# openmrs-esm-api | ||
An [OpenMRS Microfrontend](https://wiki.openmrs.org/display/projects/Frontend+-+SPA+and+Microfrontends). | ||
An [OpenMRS Microfrontend](https://wiki.openmrs.org/display/projects/Frontend+-+SPA+and+Microfrontends) helper library. | ||
@@ -5,0 +5,0 @@ ## Contents |
@@ -5,3 +5,2 @@ export * from "./types"; | ||
export * from "./setup"; | ||
export * from "./breadcrumbs"; | ||
@@ -8,0 +7,0 @@ export * from "./shared-api-objects/current-user"; |
Sorry, the diff of this file is not supported yet
5
368233
42
1258
- Removedunistore@^3.5.2