ode-ts-client 1.2.6-develop-integration.202606031822 → 1.2.7-develop-b2school.202606081819

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(C,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(C=typeof globalThis<"u"?globalThis:C||self,A(C["ode-ts-client"]={}))})(this,function(exports){"use strict";var _=Object.defineProperty;var O=(C,A,S)=>A in C?_(C,A,{enumerable:!0,configurable:!0,writable:!0,value:S}):C[A]=S;var E=(C,A,S)=>(O(C,typeof A!="symbol"?A+"":A,S),S);var C;const ERROR_CODE={SUCCESS:"0000",UNKNOWN:"0010",NOT_INITIALIZED:"0020",NOT_SUPPORTED:"0030",APP_NOT_FOUND:"0040",AGENT_NOT_FOUND:"0050",TRANSPORT_ERROR:"0060",TIME_OUT:"0070",MALFORMED_DATA:"0080",NOT_LOGGED_IN:"0090"},APP={EXPLORER:"explorer",PORTAL:"portal",BLOG:"blog",EXERCIZER:"exercizer",TIMELINE:"timeline",CAS:"cas",VIDEO:"video",MINDMAP:"mindmap"},USER_PREFS={APPS:"apps",WIDGETS:"widgets",LANGUAGE:"language",AUTH_CONNECTOR_ACCESSED:"authenticatedConnectorsAccessed",CURSUS:"cursus",INFOTIP:"infotip",RGPD_COOKIES:"rgpdCookies"},RESOURCE={FOLDER:"folder",BLOG:"blog",EXERCISE:"exercise",MINDMAP:"mindmap"},appNameForResource={folder:APP.EXPLORER,blog:APP.BLOG,exercise:APP.EXERCIZER,mindmap:APP.MINDMAP},ACTION={INITIALIZE:"initialize",SEARCH:"search",CREATE:"create",OPEN:"open",MANAGE:"manage",UPD_PROPS:"properties",COMMENT:"comment",DELETE:"delete",TRASH:"trash",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PAGES_LIST:"pages_list",DISTRIBUTE:"distribute",REGISTER:"register",PUBLISH:"publish",PUBLISH_MOODLE:"publish_moodle"},FOLDER={BIN:"bin",DEFAULT:"default"},BOOLEAN_FILTER={OWNER:"owner",SHARED:"shared",PUBLIC:"public",FAVORITE:"favorite"},STRING_FILTER={},SORT_ORDER={ASC:"asc",DESC:"desc"},SORT_BY={NAME:"name",MODIFY_DATE:"updatedAt",CREATEDAT:"createdAt",APPLICATION:"application",RESOURCE_TYPE:"resourceType"},PROP_KEY={TITLE:"title",IMAGE:"image",COLOR:"color",DESCRIPTION:"description",URL:"url"},PROP_MODE={READONLY:"RO",READWRITE:"RW"},PROP_TYPE={TEXT:"text",NUMBER:"number",DATE:"date",IMAGE:"image"},PROP_FORMAT={PLAIN:"plain"};/*! *****************************************************************************
1
+ (function(C,A){typeof exports=="object"&&typeof module<"u"?A(exports):typeof define=="function"&&define.amd?define(["exports"],A):(C=typeof globalThis<"u"?globalThis:C||self,A(C["ode-ts-client"]={}))})(this,function(exports){"use strict";var _=Object.defineProperty;var O=(C,A,S)=>A in C?_(C,A,{enumerable:!0,configurable:!0,writable:!0,value:S}):C[A]=S;var v=(C,A,S)=>(O(C,typeof A!="symbol"?A+"":A,S),S);var C;const ERROR_CODE={SUCCESS:"0000",UNKNOWN:"0010",NOT_INITIALIZED:"0020",NOT_SUPPORTED:"0030",APP_NOT_FOUND:"0040",AGENT_NOT_FOUND:"0050",TRANSPORT_ERROR:"0060",TIME_OUT:"0070",MALFORMED_DATA:"0080",NOT_LOGGED_IN:"0090"},APP={EXPLORER:"explorer",PORTAL:"portal",BLOG:"blog",EXERCIZER:"exercizer",TIMELINE:"timeline",CAS:"cas",VIDEO:"video",MINDMAP:"mindmap"},USER_PREFS={APPS:"apps",WIDGETS:"widgets",LANGUAGE:"language",AUTH_CONNECTOR_ACCESSED:"authenticatedConnectorsAccessed",CURSUS:"cursus",INFOTIP:"infotip",RGPD_COOKIES:"rgpdCookies"},RESOURCE={FOLDER:"folder",BLOG:"blog",EXERCISE:"exercise",MINDMAP:"mindmap"},appNameForResource={folder:APP.EXPLORER,blog:APP.BLOG,exercise:APP.EXERCIZER,mindmap:APP.MINDMAP},ACTION={INITIALIZE:"initialize",SEARCH:"search",CREATE:"create",OPEN:"open",MANAGE:"manage",UPD_PROPS:"properties",COMMENT:"comment",DELETE:"delete",TRASH:"trash",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PAGES_LIST:"pages_list",DISTRIBUTE:"distribute",REGISTER:"register",PUBLISH:"publish",PUBLISH_MOODLE:"publish_moodle"},FOLDER={BIN:"bin",DEFAULT:"default"},BOOLEAN_FILTER={OWNER:"owner",SHARED:"shared",PUBLIC:"public",FAVORITE:"favorite"},STRING_FILTER={},SORT_ORDER={ASC:"asc",DESC:"desc"},SORT_BY={NAME:"name",MODIFY_DATE:"updatedAt",CREATEDAT:"createdAt",APPLICATION:"application",RESOURCE_TYPE:"resourceType"},PROP_KEY={TITLE:"title",IMAGE:"image",COLOR:"color",DESCRIPTION:"description",URL:"url"},PROP_MODE={READONLY:"RO",READWRITE:"RW"},PROP_TYPE={TEXT:"text",NUMBER:"number",DATE:"date",IMAGE:"image"},PROP_FORMAT={PLAIN:"plain"};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -13,6 +13,6 @@
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
14
  ***************************************************************************** */var extendStatics=function(n,e){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},extendStatics(n,e)};function __extends(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");extendStatics(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function __awaiter(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function u(l){try{a(r.next(l))}catch(p){o(p)}}function c(l){try{a(r.throw(l))}catch(p){o(p)}}function a(l){l.done?s(l.value):i(l.value).then(u,c)}a((r=r.apply(n,[])).next())})}function __generator(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(a){return function(l){return c([a,l])}}function c(a){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return t.label++,{value:a[1],done:!1};case 5:t.label++,i=a[1],a=[0];continue;case 7:a=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){t.label=a[1];break}if(a[0]===6&&t.label<s[1]){t.label=s[1],s=a;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(a);break}s[2]&&t.ops.pop(),t.trys.pop();continue}a=e.call(n,t)}catch(l){a=[6,l],i=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}function __values(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function __spreadArray(n,e){for(var t=0,r=e.length,i=n.length;t<r;t++,i++)n[i]=e[t];return n}function __await(n){return this instanceof __await?(this.v=n,this):new __await(n)}function __asyncGenerator(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(d){r[d]&&(i[d]=function(f){return new Promise(function(m,h){s.push([d,f,m,h])>1||u(d,f)})})}function u(d,f){try{c(r[d](f))}catch(m){p(s[0][3],m)}}function c(d){d.value instanceof __await?Promise.resolve(d.value.v).then(a,l):p(s[0][2],d)}function a(d){u("next",d)}function l(d){u("throw",d)}function p(d,f){d(f),s.shift(),s.length&&u(s[0][0],s[0][1])}}function __asyncValues(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof __values=="function"?__values(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(u,c){o=n[s](o),i(u,c,o.done,o.value)})}}function i(s,o,u,c){Promise.resolve(c).then(function(a){s({value:a,done:u})},o)}}function isFunction$1(n){return typeof n=="function"}function createErrorClass(n){var e=function(r){Error.call(r),r.stack=new Error().stack},t=n(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var UnsubscriptionError=createErrorClass(function(n){return function(t){n(this),this.message=t?t.length+` errors occurred during unsubscription:
15
15
  `+t.map(function(r,i){return i+1+") "+r.toString()}).join(`
16
- `):"",this.name="UnsubscriptionError",this.errors=t}});function arrRemove(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var Subscription=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}return n.prototype.unsubscribe=function(){var e,t,r,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var u=__values(o),c=u.next();!c.done;c=u.next()){var a=c.value;a.remove(this)}}catch(h){e={error:h}}finally{try{c&&!c.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(isFunction$1(l))try{l()}catch(h){s=h instanceof UnsubscriptionError?h.errors:[h]}var p=this._teardowns;if(p){this._teardowns=null;try{for(var d=__values(p),f=d.next();!f.done;f=d.next()){var m=f.value;try{execTeardown(m)}catch(h){s=s??[],h instanceof UnsubscriptionError?s=__spreadArray(__spreadArray([],__read(s)),__read(h.errors)):s.push(h)}}}catch(h){r={error:h}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}if(s)throw new UnsubscriptionError(s)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)execTeardown(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=(t=this._teardowns)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&arrRemove(t,e)},n.prototype.remove=function(e){var t=this._teardowns;t&&arrRemove(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}(),EMPTY_SUBSCRIPTION=Subscription.EMPTY;function isSubscription(n){return n instanceof Subscription||n&&"closed"in n&&isFunction$1(n.remove)&&isFunction$1(n.add)&&isFunction$1(n.unsubscribe)}function execTeardown(n){isFunction$1(n)?n():n.unsubscribe()}var config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},timeoutProvider={setTimeout:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return setTimeout.apply(void 0,__spreadArray([],__read(n)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function reportUnhandledError(n){timeoutProvider.setTimeout(function(){var e=config.onUnhandledError;if(e)e(n);else throw n})}function noop(){}var COMPLETE_NOTIFICATION=function(){return createNotification("C",void 0,void 0)}();function errorNotification(n){return createNotification("E",void 0,n)}function nextNotification(n){return createNotification("N",n,void 0)}function createNotification(n,e,t){return{kind:n,value:e,error:t}}var context=null;function errorContext(n){if(config.useDeprecatedSynchronousErrorHandling){var e=!context;if(e&&(context={errorThrown:!1,error:null}),n(),e){var t=context,r=t.errorThrown,i=t.error;if(context=null,r)throw i}}else n()}function captureError(n){config.useDeprecatedSynchronousErrorHandling&&context&&(context.errorThrown=!0,context.error=n)}var Subscriber=function(n){__extends(e,n);function e(t){var r=n.call(this)||this;return r.isStopped=!1,t?(r.destination=t,isSubscription(t)&&t.add(r)):r.destination=EMPTY_OBSERVER,r}return e.create=function(t,r,i){return new SafeSubscriber(t,r,i)},e.prototype.next=function(t){this.isStopped?handleStoppedNotification(nextNotification(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?handleStoppedNotification(errorNotification(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?handleStoppedNotification(COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Subscription),SafeSubscriber=function(n){__extends(e,n);function e(t,r,i){var s=n.call(this)||this,o;if(isFunction$1(t))o=t;else if(t){o=t.next,r=t.error,i=t.complete;var u;s&&config.useDeprecatedNextContext?(u=Object.create(t),u.unsubscribe=function(){return s.unsubscribe()}):u=t,o=o==null?void 0:o.bind(u),r=r==null?void 0:r.bind(u),i=i==null?void 0:i.bind(u)}return s.destination={next:o?wrapForErrorHandling(o):noop,error:wrapForErrorHandling(r??defaultErrorHandler),complete:i?wrapForErrorHandling(i):noop},s}return e}(Subscriber);function wrapForErrorHandling(n,e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{n.apply(void 0,__spreadArray([],__read(t)))}catch(i){config.useDeprecatedSynchronousErrorHandling?captureError(i):reportUnhandledError(i)}}}function defaultErrorHandler(n){throw n}function handleStoppedNotification(n,e){var t=config.onStoppedNotification;t&&timeoutProvider.setTimeout(function(){return t(n,e)})}var EMPTY_OBSERVER={closed:!0,next:noop,error:defaultErrorHandler,complete:noop},observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function identity(n){return n}function pipe(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return pipeFromArray(n)}function pipeFromArray(n){return n.length===0?identity:n.length===1?n[0]:function(t){return n.reduce(function(r,i){return i(r)},t)}}var Observable=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,r){var i=this,s=isSubscriber(e)?e:new SafeSubscriber(e,t,r);return errorContext(function(){var o=i,u=o.operator,c=o.source;s.add(u?u.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var r=this;return t=getPromiseCtor(t),new t(function(i,s){var o;o=r.subscribe(function(u){try{e(u)}catch(c){s(c),o==null||o.unsubscribe()}},s,i)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[observable]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pipeFromArray(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=getPromiseCtor(e),new e(function(r,i){var s;t.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},n.create=function(e){return new n(e)},n}();function getPromiseCtor(n){var e;return(e=n??config.Promise)!==null&&e!==void 0?e:Promise}function isObserver(n){return n&&isFunction$1(n.next)&&isFunction$1(n.error)&&isFunction$1(n.complete)}function isSubscriber(n){return n&&n instanceof Subscriber||isObserver(n)&&isSubscription(n)}function hasLift(n){return isFunction$1(n==null?void 0:n.lift)}function operate(n){return function(e){if(hasLift(e))return e.lift(function(t){try{return n(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}var OperatorSubscriber=function(n){__extends(e,n);function e(t,r,i,s,o){var u=n.call(this,t)||this;return u.onFinalize=o,u._next=r?function(c){try{r(c)}catch(a){t.error(a)}}:n.prototype._next,u._error=s?function(c){try{s(c)}catch(a){t.error(a)}finally{this.unsubscribe()}}:n.prototype._error,u._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,u}return e.prototype.unsubscribe=function(){var t,r=this.closed;n.prototype.unsubscribe.call(this),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))},e}(Subscriber);function refCount(){return operate(function(n,e){var t=null;n._refCount++;var r=new OperatorSubscriber(e,void 0,void 0,void 0,function(){if(!n||n._refCount<=0||0<--n._refCount){t=null;return}var i=n._connection,s=t;t=null,i&&(!s||i===s)&&i.unsubscribe(),e.unsubscribe()});n.subscribe(r),r.closed||(t=n.connect())})}var ConnectableObservable=function(n){__extends(e,n);function e(t,r){var i=n.call(this)||this;return i.source=t,i.subjectFactory=r,i._subject=null,i._refCount=0,i._connection=null,hasLift(t)&&(i.lift=t.lift),i}return e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,t==null||t.unsubscribe()},e.prototype.connect=function(){var t=this,r=this._connection;if(!r){r=this._connection=new Subscription;var i=this.getSubject();r.add(this.source.subscribe(new OperatorSubscriber(i,void 0,function(){t._teardown(),i.complete()},function(s){t._teardown(),i.error(s)},function(){return t._teardown()}))),r.closed&&(this._connection=null,r=Subscription.EMPTY)}return r},e.prototype.refCount=function(){return refCount()(this)},e}(Observable),performanceTimestampProvider={now:function(){return(performanceTimestampProvider.delegate||performance).now()},delegate:void 0},animationFrameProvider={schedule:function(n){var e=requestAnimationFrame,t=cancelAnimationFrame,r=e(function(i){t=void 0,n(i)});return new Subscription(function(){return t==null?void 0:t(r)})},requestAnimationFrame:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return requestAnimationFrame.apply(void 0,__spreadArray([],__read(n)))},cancelAnimationFrame:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return cancelAnimationFrame.apply(void 0,__spreadArray([],__read(n)))},delegate:void 0};function animationFrames(n){return n?animationFramesFactory(n):DEFAULT_ANIMATION_FRAMES}function animationFramesFactory(n){var e=animationFrameProvider.schedule;return new Observable(function(t){var r=new Subscription,i=n||performanceTimestampProvider,s=i.now(),o=function(u){var c=i.now();t.next({timestamp:n?c:u,elapsed:c-s}),t.closed||r.add(e(o))};return r.add(e(o)),r})}var DEFAULT_ANIMATION_FRAMES=animationFramesFactory(),ObjectUnsubscribedError=createErrorClass(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Subject=function(n){__extends(e,n);function e(){var t=n.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var r=new AnonymousSubject(this,this);return r.operator=t,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new ObjectUnsubscribedError},e.prototype.next=function(t){var r=this;errorContext(function(){var i,s;if(r._throwIfClosed(),!r.isStopped){var o=r.observers.slice();try{for(var u=__values(o),c=u.next();!c.done;c=u.next()){var a=c.value;a.next(t)}}catch(l){i={error:l}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var r=this;errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var i=r.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var r=t.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var r=this,i=r.hasError,s=r.isStopped,o=r.observers;return i||s?EMPTY_SUBSCRIPTION:(o.push(t),new Subscription(function(){return arrRemove(o,t)}))},e.prototype._checkFinalizedStatuses=function(t){var r=this,i=r.hasError,s=r.thrownError,o=r.isStopped;i?t.error(s):o&&t.complete()},e.prototype.asObservable=function(){var t=new Observable;return t.source=this,t},e.create=function(t,r){return new AnonymousSubject(t,r)},e}(Observable),AnonymousSubject=function(n){__extends(e,n);function e(t,r){var i=n.call(this)||this;return i.destination=t,i.source=r,i}return e.prototype.next=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,t)},e.prototype.error=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,t)},e.prototype.complete=function(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)},e.prototype._subscribe=function(t){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&i!==void 0?i:EMPTY_SUBSCRIPTION},e}(Subject),BehaviorSubject=function(n){__extends(e,n);function e(t){var r=n.call(this)||this;return r._value=t,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var r=n.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},e.prototype.getValue=function(){var t=this,r=t.hasError,i=t.thrownError,s=t._value;if(r)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e}(Subject),dateTimestampProvider={now:function(){return(dateTimestampProvider.delegate||Date).now()},delegate:void 0},ReplaySubject=function(n){__extends(e,n);function e(t,r,i){t===void 0&&(t=1/0),r===void 0&&(r=1/0),i===void 0&&(i=dateTimestampProvider);var s=n.call(this)||this;return s._bufferSize=t,s._windowTime=r,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=r===1/0,s._bufferSize=Math.max(1,t),s._windowTime=Math.max(1,r),s}return e.prototype.next=function(t){var r=this,i=r.isStopped,s=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,c=r._windowTime;i||(s.push(t),!o&&s.push(u.now()+c)),this._trimBuffer(),n.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(t),i=this,s=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),c=0;c<u.length&&!t.closed;c+=s?1:2)t.next(u[c]);return this._checkFinalizedStatuses(t),r},e.prototype._trimBuffer=function(){var t=this,r=t._bufferSize,i=t._timestampProvider,s=t._buffer,o=t._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<s.length&&s.splice(0,s.length-u),!o){for(var c=i.now(),a=0,l=1;l<s.length&&s[l]<=c;l+=2)a=l;a&&s.splice(0,a+1)}},e}(Subject),AsyncSubject=function(n){__extends(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return e.prototype._checkFinalizedStatuses=function(t){var r=this,i=r.hasError,s=r._hasValue,o=r._value,u=r.thrownError,c=r.isStopped,a=r._isComplete;i?t.error(u):(c||a)&&(s&&t.next(o),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var t=this,r=t._hasValue,i=t._value,s=t._isComplete;s||(this._isComplete=!0,r&&n.prototype.next.call(this,i),n.prototype.complete.call(this))},e}(Subject),Action=function(n){__extends(e,n);function e(t,r){return n.call(this)||this}return e.prototype.schedule=function(t,r){return this},e}(Subscription),intervalProvider={setInterval:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return setInterval.apply(void 0,__spreadArray([],__read(n)))},clearInterval:function(n){return clearInterval(n)},delegate:void 0},AsyncAction=function(n){__extends(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(t,r){if(r===void 0&&(r=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,r)),this.pending=!0,this.delay=r,this.id=this.id||this.requestAsyncId(s,this.id,r),this},e.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),intervalProvider.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;intervalProvider.clearInterval(r)},e.prototype.execute=function(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,r){var i=!1,s;try{this.work(t)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,r=t.id,i=t.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,arrRemove(s,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},e}(Action),nextHandle=1,resolved,activeHandles={};function findAndClearHandle(n){return n in activeHandles?(delete activeHandles[n],!0):!1}var Immediate={setImmediate:function(n){var e=nextHandle++;return activeHandles[e]=!0,resolved||(resolved=Promise.resolve()),resolved.then(function(){return findAndClearHandle(e)&&n()}),e},clearImmediate:function(n){findAndClearHandle(n)}},setImmediate=Immediate.setImmediate,clearImmediate=Immediate.clearImmediate,immediateProvider={setImmediate:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return setImmediate.apply(void 0,__spreadArray([],__read(n)))},clearImmediate:function(n){return clearImmediate(n)},delegate:void 0},AsapAction=function(n){__extends(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.scheduler=t,i.work=r,i}return e.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),i!==null&&i>0?n.prototype.requestAsyncId.call(this,t,r,i):(t.actions.push(this),t._scheduled||(t._scheduled=immediateProvider.setImmediate(t.flush.bind(t,void 0))))},e.prototype.recycleAsyncId=function(t,r,i){if(i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0)return n.prototype.recycleAsyncId.call(this,t,r,i);t.actions.length===0&&(immediateProvider.clearImmediate(r),t._scheduled=void 0)},e}(AsyncAction),Scheduler=function(){function n(e,t){t===void 0&&(t=n.now),this.schedulerActionCtor=e,this.now=t}return n.prototype.schedule=function(e,t,r){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},n.now=dateTimestampProvider.now,n}(),AsyncScheduler=function(n){__extends(e,n);function e(t,r){r===void 0&&(r=Scheduler.now);var i=n.call(this,t,r)||this;return i.actions=[],i._active=!1,i._scheduled=void 0,i}return e.prototype.flush=function(t){var r=this.actions;if(this._active){r.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,i){for(;t=r.shift();)t.unsubscribe();throw i}},e}(Scheduler),AsapScheduler=function(n){__extends(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0,this._scheduled=void 0;var r=this.actions,i,s=-1;t=t||r.shift();var o=r.length;do if(i=t.execute(t.state,t.delay))break;while(++s<o&&(t=r.shift()));if(this._active=!1,i){for(;++s<o&&(t=r.shift());)t.unsubscribe();throw i}},e}(AsyncScheduler),asapScheduler=new AsapScheduler(AsapAction),asap=asapScheduler,asyncScheduler=new AsyncScheduler(AsyncAction),async=asyncScheduler,QueueAction=function(n){__extends(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.scheduler=t,i.work=r,i}return e.prototype.schedule=function(t,r){return r===void 0&&(r=0),r>0?n.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},e.prototype.execute=function(t,r){return r>0||this.closed?n.prototype.execute.call(this,t,r):this._execute(t,r)},e.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0?n.prototype.requestAsyncId.call(this,t,r,i):t.flush(this)},e}(AsyncAction),QueueScheduler=function(n){__extends(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(AsyncScheduler),queueScheduler=new QueueScheduler(QueueAction),queue=queueScheduler,AnimationFrameAction=function(n){__extends(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.scheduler=t,i.work=r,i}return e.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),i!==null&&i>0?n.prototype.requestAsyncId.call(this,t,r,i):(t.actions.push(this),t._scheduled||(t._scheduled=animationFrameProvider.requestAnimationFrame(function(){return t.flush(void 0)})))},e.prototype.recycleAsyncId=function(t,r,i){if(i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0)return n.prototype.recycleAsyncId.call(this,t,r,i);t.actions.length===0&&(animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},e}(AsyncAction),AnimationFrameScheduler=function(n){__extends(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0,this._scheduled=void 0;var r=this.actions,i,s=-1;t=t||r.shift();var o=r.length;do if(i=t.execute(t.state,t.delay))break;while(++s<o&&(t=r.shift()));if(this._active=!1,i){for(;++s<o&&(t=r.shift());)t.unsubscribe();throw i}},e}(AsyncScheduler),animationFrameScheduler=new AnimationFrameScheduler(AnimationFrameAction),animationFrame=animationFrameScheduler,VirtualTimeScheduler=function(n){__extends(e,n);function e(t,r){t===void 0&&(t=VirtualAction),r===void 0&&(r=1/0);var i=n.call(this,t,function(){return i.frame})||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var t=this,r=t.actions,i=t.maxFrames,s,o;(o=r[0])&&o.delay<=i&&(r.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=r.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(AsyncScheduler),VirtualAction=function(n){__extends(e,n);function e(t,r,i){i===void 0&&(i=t.index+=1);var s=n.call(this,t,r)||this;return s.scheduler=t,s.work=r,s.index=i,s.active=!0,s.index=t.index=i,s}return e.prototype.schedule=function(t,r){if(r===void 0&&(r=0),Number.isFinite(r)){if(!this.id)return n.prototype.schedule.call(this,t,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(t,r)}else return Subscription.EMPTY},e.prototype.requestAsyncId=function(t,r,i){i===void 0&&(i=0),this.delay=t.frame+i;var s=t.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,r,i){},e.prototype._execute=function(t,r){if(this.active===!0)return n.prototype._execute.call(this,t,r)},e.sortActions=function(t,r){return t.delay===r.delay?t.index===r.index?0:t.index>r.index?1:-1:t.delay>r.delay?1:-1},e}(AsyncAction),EMPTY=new Observable(function(n){return n.complete()});function empty(n){return n?emptyScheduled(n):EMPTY}function emptyScheduled(n){return new Observable(function(e){return n.schedule(function(){return e.complete()})})}function scheduleArray(n,e){return new Observable(function(t){var r=0;return e.schedule(function(){r===n.length?t.complete():(t.next(n[r++]),t.closed||this.schedule())})})}var isArrayLike=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function isPromise(n){return isFunction$1(n==null?void 0:n.then)}function scheduleObservable(n,e){return new Observable(function(t){var r=new Subscription;return r.add(e.schedule(function(){var i=n[observable]();r.add(i.subscribe({next:function(s){r.add(e.schedule(function(){return t.next(s)}))},error:function(s){r.add(e.schedule(function(){return t.error(s)}))},complete:function(){r.add(e.schedule(function(){return t.complete()}))}}))})),r})}function schedulePromise(n,e){return new Observable(function(t){return e.schedule(function(){return n.then(function(r){t.add(e.schedule(function(){t.next(r),t.add(e.schedule(function(){return t.complete()}))}))},function(r){t.add(e.schedule(function(){return t.error(r)}))})})})}function getSymbolIterator(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var iterator=getSymbolIterator();function caughtSchedule(n,e,t,r){r===void 0&&(r=0);var i=e.schedule(function(){try{t.call(this)}catch(s){n.error(s)}},r);return n.add(i),i}function scheduleIterable(n,e){return new Observable(function(t){var r;return t.add(e.schedule(function(){r=n[iterator](),caughtSchedule(t,e,function(){var i=r.next(),s=i.value,o=i.done;o?t.complete():(t.next(s),this.schedule())})})),function(){return isFunction$1(r==null?void 0:r.return)&&r.return()}})}function scheduleAsyncIterable(n,e){if(!n)throw new Error("Iterable cannot be null");return new Observable(function(t){var r=new Subscription;return r.add(e.schedule(function(){var i=n[Symbol.asyncIterator]();r.add(e.schedule(function(){var s=this;i.next().then(function(o){o.done?t.complete():(t.next(o.value),s.schedule())})}))})),r})}function isInteropObservable(n){return isFunction$1(n[observable])}function isIterable(n){return isFunction$1(n==null?void 0:n[iterator])}function isAsyncIterable(n){return Symbol.asyncIterator&&isFunction$1(n==null?void 0:n[Symbol.asyncIterator])}function createInvalidObservableTypeError(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function readableStreamLikeToAsyncGenerator(n){return __asyncGenerator(this,arguments,function(){var t,r,i,s;return __generator(this,function(o){switch(o.label){case 0:t=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,__await(t.read())];case 3:return r=o.sent(),i=r.value,s=r.done,s?[4,__await(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,__await(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function isReadableStreamLike(n){return isFunction$1(n==null?void 0:n.getReader)}function scheduleReadableStreamLike(n,e){return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(n),e)}function scheduled(n,e){if(n!=null){if(isInteropObservable(n))return scheduleObservable(n,e);if(isArrayLike(n))return scheduleArray(n,e);if(isPromise(n))return schedulePromise(n,e);if(isAsyncIterable(n))return scheduleAsyncIterable(n,e);if(isIterable(n))return scheduleIterable(n,e);if(isReadableStreamLike(n))return scheduleReadableStreamLike(n,e)}throw createInvalidObservableTypeError(n)}function from(n,e){return e?scheduled(n,e):innerFrom(n)}function innerFrom(n){if(n instanceof Observable)return n;if(n!=null){if(isInteropObservable(n))return fromInteropObservable(n);if(isArrayLike(n))return fromArrayLike(n);if(isPromise(n))return fromPromise(n);if(isAsyncIterable(n))return fromAsyncIterable(n);if(isIterable(n))return fromIterable(n);if(isReadableStreamLike(n))return fromReadableStreamLike(n)}throw createInvalidObservableTypeError(n)}function fromInteropObservable(n){return new Observable(function(e){var t=n[observable]();if(isFunction$1(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function fromArrayLike(n){return new Observable(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function fromPromise(n){return new Observable(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,reportUnhandledError)})}function fromIterable(n){return new Observable(function(e){var t,r;try{for(var i=__values(n),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(u){t={error:u}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}e.complete()})}function fromAsyncIterable(n){return new Observable(function(e){process$1(n,e).catch(function(t){return e.error(t)})})}function fromReadableStreamLike(n){return fromAsyncIterable(readableStreamLikeToAsyncGenerator(n))}function process$1(n,e){var t,r,i,s;return __awaiter(this,void 0,void 0,function(){var o,u;return __generator(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=__asyncValues(n),c.label=1;case 1:return[4,t.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=c.sent(),i={error:u},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function internalFromArray(n,e){return e?scheduleArray(n,e):fromArrayLike(n)}function isScheduler(n){return n&&isFunction$1(n.schedule)}function last$1(n){return n[n.length-1]}function popResultSelector(n){return isFunction$1(last$1(n))?n.pop():void 0}function popScheduler(n){return isScheduler(last$1(n))?n.pop():void 0}function popNumber(n,e){return typeof last$1(n)=="number"?n.pop():e}function of(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n);return t?scheduleArray(n,t):internalFromArray(n)}function throwError(n,e){var t=isFunction$1(n)?n:function(){return n},r=function(i){return i.error(t())};return new Observable(e?function(i){return e.schedule(r,0,i)}:r)}var NotificationKind;(function(n){n.NEXT="N",n.ERROR="E",n.COMPLETE="C"})(NotificationKind||(NotificationKind={}));var Notification$1=function(){function n(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue=e==="N"}return n.prototype.observe=function(e){return observeNotification(this,e)},n.prototype.do=function(e,t,r){var i=this,s=i.kind,o=i.value,u=i.error;return s==="N"?e==null?void 0:e(o):s==="E"?t==null?void 0:t(u):r==null?void 0:r()},n.prototype.accept=function(e,t,r){var i;return isFunction$1((i=e)===null||i===void 0?void 0:i.next)?this.observe(e):this.do(e,t,r)},n.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,i=e.error,s=t==="N"?of(r):t==="E"?throwError(function(){return i}):t==="C"?EMPTY:0;if(!s)throw new TypeError("Unexpected notification kind "+t);return s},n.createNext=function(e){return new n("N",e)},n.createError=function(e){return new n("E",void 0,e)},n.createComplete=function(){return n.completeNotification},n.completeNotification=new n("C"),n}();function observeNotification(n,e){var t,r,i,s=n,o=s.kind,u=s.value,c=s.error;if(typeof o!="string")throw new TypeError('Invalid notification, missing "kind"');o==="N"?(t=e.next)===null||t===void 0||t.call(e,u):o==="E"?(r=e.error)===null||r===void 0||r.call(e,c):(i=e.complete)===null||i===void 0||i.call(e)}function isObservable(n){return!!n&&(n instanceof Observable||isFunction$1(n.lift)&&isFunction$1(n.subscribe))}var EmptyError=createErrorClass(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function lastValueFrom(n,e){var t=typeof e=="object";return new Promise(function(r,i){var s=!1,o;n.subscribe({next:function(u){o=u,s=!0},error:i,complete:function(){s?r(o):t?r(e.defaultValue):i(new EmptyError)}})})}function firstValueFrom(n,e){var t=typeof e=="object";return new Promise(function(r,i){var s=new SafeSubscriber({next:function(o){r(o),s.unsubscribe()},error:i,complete:function(){t?r(e.defaultValue):i(new EmptyError)}});n.subscribe(s)})}var ArgumentOutOfRangeError=createErrorClass(function(n){return function(){n(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}),NotFoundError=createErrorClass(function(n){return function(t){n(this),this.name="NotFoundError",this.message=t}}),SequenceError=createErrorClass(function(n){return function(t){n(this),this.name="SequenceError",this.message=t}});function isValidDate(n){return n instanceof Date&&!isNaN(n)}var TimeoutError=createErrorClass(function(n){return function(t){t===void 0&&(t=null),n(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function timeout(n,e){var t=isValidDate(n)?{first:n}:typeof n=="number"?{each:n}:n,r=t.first,i=t.each,s=t.with,o=s===void 0?timeoutErrorFactory:s,u=t.scheduler,c=u===void 0?e??asyncScheduler:u,a=t.meta,l=a===void 0?null:a;if(r==null&&i==null)throw new TypeError("No timeout provided.");return operate(function(p,d){var f,m,h=null,v=0,g=function(b){m=caughtSchedule(d,c,function(){f.unsubscribe(),innerFrom(o({meta:l,lastValue:h,seen:v})).subscribe(d)},b)};f=p.subscribe(new OperatorSubscriber(d,function(b){m==null||m.unsubscribe(),v++,d.next(h=b),i>0&&g(i)},void 0,void 0,function(){m!=null&&m.closed||m==null||m.unsubscribe(),h=null})),g(r!=null?typeof r=="number"?r:+r-c.now():i)})}function timeoutErrorFactory(n){throw new TimeoutError(n)}function subscribeOn(n,e){return e===void 0&&(e=0),operate(function(t,r){r.add(n.schedule(function(){return t.subscribe(r)},e))})}function map(n,e){return operate(function(t,r){var i=0;t.subscribe(new OperatorSubscriber(r,function(s){r.next(n.call(e,s,i++))}))})}var isArray$3=Array.isArray;function callOrApply(n,e){return isArray$3(e)?n.apply(void 0,__spreadArray([],__read(e))):n(e)}function mapOneOrManyArgs(n){return map(function(e){return callOrApply(n,e)})}function observeOn(n,e){return e===void 0&&(e=0),operate(function(t,r){t.subscribe(new OperatorSubscriber(r,function(i){return r.add(n.schedule(function(){return r.next(i)},e))},function(){return r.add(n.schedule(function(){return r.complete()},e))},function(i){return r.add(n.schedule(function(){return r.error(i)},e))}))})}function bindCallbackInternals(n,e,t,r){if(t)if(isScheduler(t))r=t;else return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return bindCallbackInternals(n,e,r).apply(this,i).pipe(mapOneOrManyArgs(t))};return r?function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return bindCallbackInternals(n,e).apply(this,i).pipe(subscribeOn(r),observeOn(r))}:function(){for(var i=this,s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var u=new AsyncSubject,c=!0;return new Observable(function(a){var l=u.subscribe(a);if(c){c=!1;var p=!1,d=!1;e.apply(i,__spreadArray(__spreadArray([],__read(s)),[function(){for(var f=[],m=0;m<arguments.length;m++)f[m]=arguments[m];if(n){var h=f.shift();if(h!=null){u.error(h);return}}u.next(1<f.length?f:f[0]),d=!0,p&&u.complete()}])),d&&u.complete(),p=!0}return l})}}function bindCallback(n,e,t){return bindCallbackInternals(!1,n,e,t)}function bindNodeCallback(n,e,t){return bindCallbackInternals(!0,n,e,t)}var isArray$2=Array.isArray,getPrototypeOf=Object.getPrototypeOf,objectProto=Object.prototype,getKeys=Object.keys;function argsArgArrayOrObject(n){if(n.length===1){var e=n[0];if(isArray$2(e))return{args:e,keys:null};if(isPOJO(e)){var t=getKeys(e);return{args:t.map(function(r){return e[r]}),keys:t}}}return{args:n,keys:null}}function isPOJO(n){return n&&typeof n=="object"&&getPrototypeOf(n)===objectProto}function createObject(n,e){return n.reduce(function(t,r,i){return t[r]=e[i],t},{})}function combineLatest$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n),r=popResultSelector(n),i=argsArgArrayOrObject(n),s=i.args,o=i.keys;if(s.length===0)return from([],t);var u=new Observable(combineLatestInit(s,t,o?function(c){return createObject(o,c)}:identity));return r?u.pipe(mapOneOrManyArgs(r)):u}function combineLatestInit(n,e,t){return t===void 0&&(t=identity),function(r){maybeSchedule(e,function(){for(var i=n.length,s=new Array(i),o=i,u=i,c=function(l){maybeSchedule(e,function(){var p=from(n[l],e),d=!1;p.subscribe(new OperatorSubscriber(r,function(f){s[l]=f,d||(d=!0,u--),u||r.next(t(s.slice()))},function(){--o||r.complete()}))},r)},a=0;a<i;a++)c(a)},r)}}function maybeSchedule(n,e,t){n?t.add(n.schedule(e)):e()}function mergeInternals(n,e,t,r,i,s,o,u){var c=[],a=0,l=0,p=!1,d=function(){p&&!c.length&&!a&&e.complete()},f=function(h){return a<r?m(h):c.push(h)},m=function(h){s&&e.next(h),a++;var v=!1;innerFrom(t(h,l++)).subscribe(new OperatorSubscriber(e,function(g){i==null||i(g),s?f(g):e.next(g)},function(){v=!0},void 0,function(){if(v)try{a--;for(var g=function(){var b=c.shift();o?e.add(o.schedule(function(){return m(b)})):m(b)};c.length&&a<r;)g();d()}catch(b){e.error(b)}}))};return n.subscribe(new OperatorSubscriber(e,f,function(){p=!0,d()})),function(){u==null||u()}}function mergeMap(n,e,t){return t===void 0&&(t=1/0),isFunction$1(e)?mergeMap(function(r,i){return map(function(s,o){return e(r,s,i,o)})(innerFrom(n(r,i)))},t):(typeof e=="number"&&(t=e),operate(function(r,i){return mergeInternals(r,i,n,t)}))}function mergeAll(n){return n===void 0&&(n=1/0),mergeMap(identity,n)}function concatAll(){return mergeAll(1)}function concat$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return concatAll()(internalFromArray(n,popScheduler(n)))}function defer(n){return new Observable(function(e){innerFrom(n()).subscribe(e)})}var DEFAULT_CONFIG$1={connector:function(){return new Subject},resetOnDisconnect:!0};function connectable(n,e){e===void 0&&(e=DEFAULT_CONFIG$1);var t=null,r=e.connector,i=e.resetOnDisconnect,s=i===void 0?!0:i,o=r(),u=new Observable(function(c){return o.subscribe(c)});return u.connect=function(){return(!t||t.closed)&&(t=defer(function(){return n}).subscribe(o),s&&t.add(function(){return o=r()})),t},u}function forkJoin(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popResultSelector(n),r=argsArgArrayOrObject(n),i=r.args,s=r.keys,o=new Observable(function(u){var c=i.length;if(!c){u.complete();return}for(var a=new Array(c),l=c,p=c,d=function(m){var h=!1;innerFrom(i[m]).subscribe(new OperatorSubscriber(u,function(v){h||(h=!0,p--),a[m]=v},function(){(!--l||!h)&&(p||u.next(s?createObject(s,a):a),u.complete())}))},f=0;f<c;f++)d(f)});return t?o.pipe(mapOneOrManyArgs(t)):o}var nodeEventEmitterMethods=["addListener","removeListener"],eventTargetMethods=["addEventListener","removeEventListener"],jqueryMethods=["on","off"];function fromEvent(n,e,t,r){if(isFunction$1(t)&&(r=t,t=void 0),r)return fromEvent(n,e,t).pipe(mapOneOrManyArgs(r));var i=__read(isEventTarget(n)?eventTargetMethods.map(function(u){return function(c){return n[u](e,c,t)}}):isNodeStyleEventEmitter(n)?nodeEventEmitterMethods.map(toCommonHandlerRegistry(n,e)):isJQueryStyleEventEmitter(n)?jqueryMethods.map(toCommonHandlerRegistry(n,e)):[],2),s=i[0],o=i[1];if(!s&&isArrayLike(n))return mergeMap(function(u){return fromEvent(u,e,t)})(internalFromArray(n));if(!s)throw new TypeError("Invalid event target");return new Observable(function(u){var c=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return u.next(1<a.length?a:a[0])};return s(c),function(){return o(c)}})}function toCommonHandlerRegistry(n,e){return function(t){return function(r){return n[t](e,r)}}}function isNodeStyleEventEmitter(n){return isFunction$1(n.addListener)&&isFunction$1(n.removeListener)}function isJQueryStyleEventEmitter(n){return isFunction$1(n.on)&&isFunction$1(n.off)}function isEventTarget(n){return isFunction$1(n.addEventListener)&&isFunction$1(n.removeEventListener)}function fromEventPattern(n,e,t){return t?fromEventPattern(n,e).pipe(mapOneOrManyArgs(t)):new Observable(function(r){var i=function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return r.next(o.length===1?o[0]:o)},s=n(i);return isFunction$1(e)?function(){return e(i,s)}:void 0})}function generate(n,e,t,r,i){var s,o,u,c;arguments.length===1?(s=n,c=s.initialState,e=s.condition,t=s.iterate,o=s.resultSelector,u=o===void 0?identity:o,i=s.scheduler):(c=n,!r||isScheduler(r)?(u=identity,i=r):u=r);function a(){var l;return __generator(this,function(p){switch(p.label){case 0:l=c,p.label=1;case 1:return!e||e(l)?[4,u(l)]:[3,4];case 2:p.sent(),p.label=3;case 3:return l=t(l),[3,1];case 4:return[2]}})}return defer(i?function(){return scheduleIterable(a(),i)}:a)}function iif(n,e,t){return defer(function(){return n()?e:t})}function timer(n,e,t){n===void 0&&(n=0),t===void 0&&(t=async);var r=-1;return e!=null&&(isScheduler(e)?t=e:r=e),new Observable(function(i){var s=isValidDate(n)?+n-t.now():n;s<0&&(s=0);var o=0;return t.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},s)})}function interval(n,e){return n===void 0&&(n=0),e===void 0&&(e=asyncScheduler),n<0&&(n=0),timer(n,n,e)}function merge$2(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n),r=popNumber(n,1/0),i=n;return i.length?i.length===1?innerFrom(i[0]):mergeAll(r)(internalFromArray(i,t)):EMPTY}var NEVER=new Observable(noop);function never(){return NEVER}var isArray$1=Array.isArray;function argsOrArgArray(n){return n.length===1&&isArray$1(n[0])?n[0]:n}function onErrorResumeNext$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=argsOrArgArray(n);return operate(function(r,i){var s=__spreadArray([r],__read(t)),o=function(){if(!i.closed)if(s.length>0){var u=void 0;try{u=innerFrom(s.shift())}catch{o();return}var c=new OperatorSubscriber(i,void 0,noop,noop);i.add(u.subscribe(c)),c.add(o)}else i.complete()};o()})}function onErrorResumeNext(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return onErrorResumeNext$1(argsOrArgArray(n))(EMPTY)}function pairs(n,e){return from(Object.entries(n),e)}function not(n,e){return function(t,r){return!n.call(e,t,r)}}function filter(n,e){return operate(function(t,r){var i=0;t.subscribe(new OperatorSubscriber(r,function(s){return n.call(e,s,i++)&&r.next(s)}))})}function partition(n,e,t){return[filter(e,t)(innerFrom(n)),filter(not(e,t))(innerFrom(n))]}function race(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n=argsOrArgArray(n),n.length===1?innerFrom(n[0]):new Observable(raceInit(n))}function raceInit(n){return function(e){for(var t=[],r=function(s){t.push(innerFrom(n[s]).subscribe(new OperatorSubscriber(e,function(o){if(t){for(var u=0;u<t.length;u++)u!==s&&t[u].unsubscribe();t=null}e.next(o)})))},i=0;t&&!e.closed&&i<n.length;i++)r(i)}}function range(n,e,t){if(e==null&&(e=n,n=0),e<=0)return EMPTY;var r=e+n;return new Observable(t?function(i){var s=n;return t.schedule(function(){s<r?(i.next(s++),this.schedule()):i.complete()})}:function(i){for(var s=n;s<r&&!i.closed;)i.next(s++);i.complete()})}function using(n,e){return new Observable(function(t){var r=n(),i=e(r),s=i?innerFrom(i):EMPTY;return s.subscribe(t),function(){r&&r.unsubscribe()}})}function zip$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popResultSelector(n),r=argsOrArgArray(n);return r.length?new Observable(function(i){var s=r.map(function(){return[]}),o=r.map(function(){return!1});i.add(function(){s=o=null});for(var u=function(a){innerFrom(r[a]).subscribe(new OperatorSubscriber(i,function(l){if(s[a].push(l),s.every(function(d){return d.length})){var p=s.map(function(d){return d.shift()});i.next(t?t.apply(void 0,__spreadArray([],__read(p))):p),s.some(function(d,f){return!d.length&&o[f]})&&i.complete()}},function(){o[a]=!0,!s[a].length&&i.complete()}))},c=0;!i.closed&&c<r.length;c++)u(c);return function(){s=o=null}}):EMPTY}function audit(n){return operate(function(e,t){var r=!1,i=null,s=null,o=!1,u=function(){if(s==null||s.unsubscribe(),s=null,r){r=!1;var a=i;i=null,t.next(a)}o&&t.complete()},c=function(){s=null,o&&t.complete()};e.subscribe(new OperatorSubscriber(t,function(a){r=!0,i=a,s||innerFrom(n(a)).subscribe(s=new OperatorSubscriber(t,u,c))},function(){o=!0,(!r||!s||s.closed)&&t.complete()}))})}function auditTime(n,e){return e===void 0&&(e=async),audit(function(){return timer(n,e)})}function buffer(n){return operate(function(e,t){var r=[];return e.subscribe(new OperatorSubscriber(t,function(i){return r.push(i)},function(){t.next(r),t.complete()})),n.subscribe(new OperatorSubscriber(t,function(){var i=r;r=[],t.next(i)},noop)),function(){r=null}})}function bufferCount(n,e){return e===void 0&&(e=null),e=e??n,operate(function(t,r){var i=[],s=0;t.subscribe(new OperatorSubscriber(r,function(o){var u,c,a,l,p=null;s++%e===0&&i.push([]);try{for(var d=__values(i),f=d.next();!f.done;f=d.next()){var m=f.value;m.push(o),n<=m.length&&(p=p??[],p.push(m))}}catch(g){u={error:g}}finally{try{f&&!f.done&&(c=d.return)&&c.call(d)}finally{if(u)throw u.error}}if(p)try{for(var h=__values(p),v=h.next();!v.done;v=h.next()){var m=v.value;arrRemove(i,m),r.next(m)}}catch(g){a={error:g}}finally{try{v&&!v.done&&(l=h.return)&&l.call(h)}finally{if(a)throw a.error}}},function(){var o,u;try{for(var c=__values(i),a=c.next();!a.done;a=c.next()){var l=a.value;r.next(l)}}catch(p){o={error:p}}finally{try{a&&!a.done&&(u=c.return)&&u.call(c)}finally{if(o)throw o.error}}r.complete()},void 0,function(){i=null}))})}function bufferTime(n){for(var e,t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s=(e=popScheduler(r))!==null&&e!==void 0?e:asyncScheduler,o=(t=r[0])!==null&&t!==void 0?t:null,u=r[1]||1/0;return operate(function(c,a){var l=[],p=!1,d=function(h){var v=h.buffer,g=h.subs;g.unsubscribe(),arrRemove(l,h),a.next(v),p&&f()},f=function(){if(l){var h=new Subscription;a.add(h);var v=[],g={buffer:v,subs:h};l.push(g),h.add(s.schedule(function(){return d(g)},n))}};o!==null&&o>=0?a.add(s.schedule(function(){f(),!this.closed&&a.add(this.schedule(null,o))},o)):p=!0,f();var m=new OperatorSubscriber(a,function(h){var v,g,b=l.slice();try{for(var x=__values(b),y=x.next();!y.done;y=x.next()){var w=y.value,F=w.buffer;F.push(h),u<=F.length&&d(w)}}catch(R){v={error:R}}finally{try{y&&!y.done&&(g=x.return)&&g.call(x)}finally{if(v)throw v.error}}},function(){for(;l!=null&&l.length;)a.next(l.shift().buffer);m==null||m.unsubscribe(),a.complete(),a.unsubscribe()},void 0,function(){return l=null});c.subscribe(m)})}function bufferToggle(n,e){return operate(function(t,r){var i=[];innerFrom(n).subscribe(new OperatorSubscriber(r,function(s){var o=[];i.push(o);var u=new Subscription,c=function(){arrRemove(i,o),r.next(o),u.unsubscribe()};u.add(innerFrom(e(s)).subscribe(new OperatorSubscriber(r,c,noop)))},noop)),t.subscribe(new OperatorSubscriber(r,function(s){var o,u;try{for(var c=__values(i),a=c.next();!a.done;a=c.next()){var l=a.value;l.push(s)}}catch(p){o={error:p}}finally{try{a&&!a.done&&(u=c.return)&&u.call(c)}finally{if(o)throw o.error}}},function(){for(;i.length>0;)r.next(i.shift());r.complete()}))})}function bufferWhen(n){return operate(function(e,t){var r=null,i=null,s=function(){i==null||i.unsubscribe();var o=r;r=[],o&&t.next(o),innerFrom(n()).subscribe(i=new OperatorSubscriber(t,s,noop))};s(),e.subscribe(new OperatorSubscriber(t,function(o){return r==null?void 0:r.push(o)},function(){r&&t.next(r),t.complete()},void 0,function(){return r=i=null}))})}function catchError(n){return operate(function(e,t){var r=null,i=!1,s;r=e.subscribe(new OperatorSubscriber(t,void 0,void 0,function(o){s=innerFrom(n(o,catchError(n)(e))),r?(r.unsubscribe(),r=null,s.subscribe(t)):i=!0})),i&&(r.unsubscribe(),r=null,s.subscribe(t))})}function scanInternals(n,e,t,r,i){return function(s,o){var u=t,c=e,a=0;s.subscribe(new OperatorSubscriber(o,function(l){var p=a++;c=u?n(c,l,p):(u=!0,l),r&&o.next(c)},i&&function(){u&&o.next(c),o.complete()}))}}function reduce(n,e){return operate(scanInternals(n,e,arguments.length>=2,!1,!0))}var arrReducer=function(n,e){return n.push(e),n};function toArray(){return operate(function(n,e){reduce(arrReducer,[])(n).subscribe(e)})}function joinAllInternals(n,e){return pipe(toArray(),mergeMap(function(t){return n(t)}),e?mapOneOrManyArgs(e):identity)}function combineLatestAll(n){return joinAllInternals(combineLatest$1,n)}var combineAll=combineLatestAll;function combineLatest(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popResultSelector(n);return t?pipe(combineLatest.apply(void 0,__spreadArray([],__read(n))),mapOneOrManyArgs(t)):operate(function(r,i){combineLatestInit(__spreadArray([r],__read(argsOrArgArray(n))))(i)})}function combineLatestWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return combineLatest.apply(void 0,__spreadArray([],__read(n)))}function concatMap(n,e){return isFunction$1(e)?mergeMap(n,e,1):mergeMap(n,1)}function concatMapTo(n,e){return isFunction$1(e)?concatMap(function(){return n},e):concatMap(function(){return n})}function concat(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n);return operate(function(r,i){concatAll()(internalFromArray(__spreadArray([r],__read(n)),t)).subscribe(i)})}function concatWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return concat.apply(void 0,__spreadArray([],__read(n)))}function fromSubscribable(n){return new Observable(function(e){return n.subscribe(e)})}var DEFAULT_CONFIG={connector:function(){return new Subject}};function connect(n,e){e===void 0&&(e=DEFAULT_CONFIG);var t=e.connector;return operate(function(r,i){var s=t();from(n(fromSubscribable(s))).subscribe(i),i.add(r.subscribe(s))})}function count(n){return reduce(function(e,t,r){return!n||n(t,r)?e+1:e},0)}function debounce(n){return operate(function(e,t){var r=!1,i=null,s=null,o=function(){if(s==null||s.unsubscribe(),s=null,r){r=!1;var u=i;i=null,t.next(u)}};e.subscribe(new OperatorSubscriber(t,function(u){s==null||s.unsubscribe(),r=!0,i=u,s=new OperatorSubscriber(t,o,noop),innerFrom(n(u)).subscribe(s)},function(){o(),t.complete()},void 0,function(){i=s=null}))})}function debounceTime(n,e){return e===void 0&&(e=asyncScheduler),operate(function(t,r){var i=null,s=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var a=s;s=null,r.next(a)}};function c(){var a=o+n,l=e.now();if(l<a){i=this.schedule(void 0,a-l),r.add(i);return}u()}t.subscribe(new OperatorSubscriber(r,function(a){s=a,o=e.now(),i||(i=e.schedule(c,n),r.add(i))},function(){u(),r.complete()},void 0,function(){s=i=null}))})}function defaultIfEmpty(n){return operate(function(e,t){var r=!1;e.subscribe(new OperatorSubscriber(t,function(i){r=!0,t.next(i)},function(){r||t.next(n),t.complete()}))})}function take(n){return n<=0?function(){return EMPTY}:operate(function(e,t){var r=0;e.subscribe(new OperatorSubscriber(t,function(i){++r<=n&&(t.next(i),n<=r&&t.complete())}))})}function ignoreElements(){return operate(function(n,e){n.subscribe(new OperatorSubscriber(e,noop))})}function mapTo(n){return map(function(){return n})}function delayWhen(n,e){return e?function(t){return concat$1(e.pipe(take(1),ignoreElements()),t.pipe(delayWhen(n)))}:mergeMap(function(t,r){return n(t,r).pipe(take(1),mapTo(t))})}function delay(n,e){e===void 0&&(e=asyncScheduler);var t=timer(n,e);return delayWhen(function(){return t})}function dematerialize(){return operate(function(n,e){n.subscribe(new OperatorSubscriber(e,function(t){return observeNotification(t,e)}))})}function distinct(n,e){return operate(function(t,r){var i=new Set;t.subscribe(new OperatorSubscriber(r,function(s){var o=n?n(s):s;i.has(o)||(i.add(o),r.next(s))})),e==null||e.subscribe(new OperatorSubscriber(r,function(){return i.clear()},noop))})}function distinctUntilChanged(n,e){return e===void 0&&(e=identity),n=n??defaultCompare,operate(function(t,r){var i,s=!0;t.subscribe(new OperatorSubscriber(r,function(o){var u=e(o);(s||!n(i,u))&&(s=!1,i=u,r.next(o))}))})}function defaultCompare(n,e){return n===e}function distinctUntilKeyChanged(n,e){return distinctUntilChanged(function(t,r){return e?e(t[n],r[n]):t[n]===r[n]})}function throwIfEmpty(n){return n===void 0&&(n=defaultErrorFactory),operate(function(e,t){var r=!1;e.subscribe(new OperatorSubscriber(t,function(i){r=!0,t.next(i)},function(){return r?t.complete():t.error(n())}))})}function defaultErrorFactory(){return new EmptyError}function elementAt(n,e){if(n<0)throw new ArgumentOutOfRangeError;var t=arguments.length>=2;return function(r){return r.pipe(filter(function(i,s){return s===n}),take(1),t?defaultIfEmpty(e):throwIfEmpty(function(){return new ArgumentOutOfRangeError}))}}function endWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return concat$1(t,of.apply(void 0,__spreadArray([],__read(n))))}}function every(n,e){return operate(function(t,r){var i=0;t.subscribe(new OperatorSubscriber(r,function(s){n.call(e,s,i++,t)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})}function exhaustAll(){return operate(function(n,e){var t=!1,r=null;n.subscribe(new OperatorSubscriber(e,function(i){r||(r=innerFrom(i).subscribe(new OperatorSubscriber(e,void 0,function(){r=null,t&&e.complete()})))},function(){t=!0,!r&&e.complete()}))})}var exhaust=exhaustAll;function exhaustMap(n,e){return e?function(t){return t.pipe(exhaustMap(function(r,i){return innerFrom(n(r,i)).pipe(map(function(s,o){return e(r,s,i,o)}))}))}:operate(function(t,r){var i=0,s=null,o=!1;t.subscribe(new OperatorSubscriber(r,function(u){s||(s=new OperatorSubscriber(r,void 0,function(){s=null,o&&r.complete()}),innerFrom(n(u,i++)).subscribe(s))},function(){o=!0,!s&&r.complete()}))})}function expand(n,e,t){return e===void 0&&(e=1/0),e=(e||0)<1?1/0:e,operate(function(r,i){return mergeInternals(r,i,n,e,void 0,!0,t)})}function finalize(n){return operate(function(e,t){try{e.subscribe(t)}finally{t.add(n)}})}function find(n,e){return operate(createFind(n,e,"value"))}function createFind(n,e,t){var r=t==="index";return function(i,s){var o=0;i.subscribe(new OperatorSubscriber(s,function(u){var c=o++;n.call(e,u,c,i)&&(s.next(r?c:u),s.complete())},function(){s.next(r?-1:void 0),s.complete()}))}}function findIndex(n,e){return operate(createFind(n,e,"index"))}function first(n,e){var t=arguments.length>=2;return function(r){return r.pipe(n?filter(function(i,s){return n(i,s,r)}):identity,take(1),t?defaultIfEmpty(e):throwIfEmpty(function(){return new EmptyError}))}}function groupBy(n,e,t,r){return operate(function(i,s){var o;!e||typeof e=="function"?o=e:(t=e.duration,o=e.element,r=e.connector);var u=new Map,c=function(d){u.forEach(d),d(s)},a=function(d){return c(function(f){return f.error(d)})},l=new GroupBySubscriber(s,function(d){try{var f=n(d),m=u.get(f);if(!m){u.set(f,m=r?r():new Subject);var h=p(f,m);if(s.next(h),t){var v=new OperatorSubscriber(m,function(){m.complete(),v==null||v.unsubscribe()},void 0,void 0,function(){return u.delete(f)});l.add(innerFrom(t(h)).subscribe(v))}}m.next(o?o(d):d)}catch(g){a(g)}},function(){return c(function(d){return d.complete()})},a,function(){return u.clear()});i.subscribe(l);function p(d,f){var m=new Observable(function(h){l.activeGroups++;var v=f.subscribe(h);return function(){v.unsubscribe(),--l.activeGroups===0&&l.teardownAttempted&&l.unsubscribe()}});return m.key=d,m}})}var GroupBySubscriber=function(n){__extends(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.activeGroups=0,t.teardownAttempted=!1,t}return e.prototype.unsubscribe=function(){this.teardownAttempted=!0,this.activeGroups===0&&n.prototype.unsubscribe.call(this)},e}(OperatorSubscriber);function isEmpty(){return operate(function(n,e){n.subscribe(new OperatorSubscriber(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}function takeLast(n){return n<=0?function(){return EMPTY}:operate(function(e,t){var r=[];e.subscribe(new OperatorSubscriber(t,function(i){r.push(i),n<r.length&&r.shift()},function(){var i,s;try{for(var o=__values(r),u=o.next();!u.done;u=o.next()){var c=u.value;t.next(c)}}catch(a){i={error:a}}finally{try{u&&!u.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}t.complete()},void 0,function(){r=null}))})}function last(n,e){var t=arguments.length>=2;return function(r){return r.pipe(n?filter(function(i,s){return n(i,s,r)}):identity,takeLast(1),t?defaultIfEmpty(e):throwIfEmpty(function(){return new EmptyError}))}}function materialize(){return operate(function(n,e){n.subscribe(new OperatorSubscriber(e,function(t){e.next(Notification$1.createNext(t))},function(){e.next(Notification$1.createComplete()),e.complete()},function(t){e.next(Notification$1.createError(t)),e.complete()}))})}function max(n){return reduce(isFunction$1(n)?function(e,t){return n(e,t)>0?e:t}:function(e,t){return e>t?e:t})}var flatMap=mergeMap;function mergeMapTo(n,e,t){return t===void 0&&(t=1/0),isFunction$1(e)?mergeMap(function(){return n},e,t):(typeof e=="number"&&(t=e),mergeMap(function(){return n},t))}function mergeScan(n,e,t){return t===void 0&&(t=1/0),operate(function(r,i){var s=e;return mergeInternals(r,i,function(o,u){return n(s,o,u)},t,function(o){s=o},!1,void 0,function(){return s=null})})}function merge$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n),r=popNumber(n,1/0);return n=argsOrArgArray(n),operate(function(i,s){mergeAll(r)(internalFromArray(__spreadArray([i],__read(n)),t)).subscribe(s)})}function mergeWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return merge$1.apply(void 0,__spreadArray([],__read(n)))}function min(n){return reduce(isFunction$1(n)?function(e,t){return n(e,t)<0?e:t}:function(e,t){return e<t?e:t})}function multicast(n,e){var t=isFunction$1(n)?n:function(){return n};return isFunction$1(e)?connect(e,{connector:t}):function(r){return new ConnectableObservable(r,t)}}function pairwise(){return operate(function(n,e){var t,r=!1;n.subscribe(new OperatorSubscriber(e,function(i){var s=t;t=i,r&&e.next([s,i]),r=!0}))})}function pluck(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=n.length;if(t===0)throw new Error("list of properties cannot be empty.");return map(function(r){for(var i=r,s=0;s<t;s++){var o=i==null?void 0:i[n[s]];if(typeof o<"u")i=o;else return}return i})}function publish(n){return n?function(e){return connect(n)(e)}:function(e){return multicast(new Subject)(e)}}function publishBehavior(n){return function(e){var t=new BehaviorSubject(n);return new ConnectableObservable(e,function(){return t})}}function publishLast(){return function(n){var e=new AsyncSubject;return new ConnectableObservable(n,function(){return e})}}function publishReplay(n,e,t,r){t&&!isFunction$1(t)&&(r=t);var i=isFunction$1(t)?t:void 0;return function(s){return multicast(new ReplaySubject(n,e,r),i)(s)}}function raceWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length?operate(function(t,r){raceInit(__spreadArray([t],__read(n)))(r)}):identity}function repeat(n){return n===void 0&&(n=1/0),n<=0?function(){return EMPTY}:operate(function(e,t){var r=0,i,s=function(){var o=!1;i=e.subscribe(new OperatorSubscriber(t,void 0,function(){++r<n?i?(i.unsubscribe(),i=null,s()):o=!0:t.complete()})),o&&(i.unsubscribe(),i=null,s())};s()})}function repeatWhen(n){return operate(function(e,t){var r,i=!1,s,o=!1,u=!1,c=function(){return u&&o&&(t.complete(),!0)},a=function(){return s||(s=new Subject,n(s).subscribe(new OperatorSubscriber(t,function(){r?l():i=!0},function(){o=!0,c()}))),s},l=function(){u=!1,r=e.subscribe(new OperatorSubscriber(t,void 0,function(){u=!0,!c()&&a().next()})),i&&(r.unsubscribe(),r=null,i=!1,l())};l()})}function retry(n){n===void 0&&(n=1/0);var e;n&&typeof n=="object"?e=n:e={count:n};var t=e.count,r=t===void 0?1/0:t,i=e.delay,s=e.resetOnSuccess,o=s===void 0?!1:s;return r<=0?identity:operate(function(u,c){var a=0,l,p=function(){var d=!1;l=u.subscribe(new OperatorSubscriber(c,function(f){o&&(a=0),c.next(f)},void 0,function(f){if(a++<r){var m=function(){l?(l.unsubscribe(),l=null,p()):d=!0};if(i!=null){var h=typeof i=="number"?timer(i):innerFrom(i(f,a)),v=new OperatorSubscriber(c,function(){v.unsubscribe(),m()},function(){c.complete()});h.subscribe(v)}else m()}else c.error(f)})),d&&(l.unsubscribe(),l=null,p())};p()})}function retryWhen(n){return operate(function(e,t){var r,i=!1,s,o=function(){r=e.subscribe(new OperatorSubscriber(t,void 0,void 0,function(u){s||(s=new Subject,n(s).subscribe(new OperatorSubscriber(t,function(){return r?o():i=!0}))),s&&s.next(u)})),i&&(r.unsubscribe(),r=null,i=!1,o())};o()})}function sample(n){return operate(function(e,t){var r=!1,i=null;e.subscribe(new OperatorSubscriber(t,function(o){r=!0,i=o}));var s=function(){if(r){r=!1;var o=i;i=null,t.next(o)}};n.subscribe(new OperatorSubscriber(t,s,noop))})}function sampleTime(n,e){return e===void 0&&(e=asyncScheduler),sample(interval(n,e))}function scan(n,e){return operate(scanInternals(n,e,arguments.length>=2,!0))}function sequenceEqual(n,e){return e===void 0&&(e=function(t,r){return t===r}),operate(function(t,r){var i=createState(),s=createState(),o=function(c){r.next(c),r.complete()},u=function(c,a){var l=new OperatorSubscriber(r,function(p){var d=a.buffer,f=a.complete;d.length===0?f?o(!1):c.buffer.push(p):!e(p,d.shift())&&o(!1)},function(){c.complete=!0;var p=a.complete,d=a.buffer;p&&o(d.length===0),l==null||l.unsubscribe()});return l};t.subscribe(u(i,s)),n.subscribe(u(s,i))})}function createState(){return{buffer:[],complete:!1}}function share(n){n===void 0&&(n={});var e=n.connector,t=e===void 0?function(){return new Subject}:e,r=n.resetOnError,i=r===void 0?!0:r,s=n.resetOnComplete,o=s===void 0?!0:s,u=n.resetOnRefCountZero,c=u===void 0?!0:u;return function(a){var l=null,p=null,d=null,f=0,m=!1,h=!1,v=function(){p==null||p.unsubscribe(),p=null},g=function(){v(),l=d=null,m=h=!1},b=function(){var x=l;g(),x==null||x.unsubscribe()};return operate(function(x,y){f++,!h&&!m&&v();var w=d=d??t();y.add(function(){f--,f===0&&!h&&!m&&(p=handleReset(b,c))}),w.subscribe(y),l||(l=new SafeSubscriber({next:function(F){return w.next(F)},error:function(F){h=!0,v(),p=handleReset(g,i,F),w.error(F)},complete:function(){m=!0,v(),p=handleReset(g,o),w.complete()}}),from(x).subscribe(l))})(a)}}function handleReset(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return e===!0?(n(),null):e===!1?null:e.apply(void 0,__spreadArray([],__read(t))).pipe(take(1)).subscribe(function(){return n()})}function shareReplay(n,e,t){var r,i,s,o=!1;return n&&typeof n=="object"?(s=(r=n.bufferSize)!==null&&r!==void 0?r:1/0,e=(i=n.windowTime)!==null&&i!==void 0?i:1/0,o=!!n.refCount,t=n.scheduler):s=n??1/0,share({connector:function(){return new ReplaySubject(s,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function single(n){return operate(function(e,t){var r=!1,i,s=!1,o=0;e.subscribe(new OperatorSubscriber(t,function(u){s=!0,(!n||n(u,o++,e))&&(r&&t.error(new SequenceError("Too many matching values")),r=!0,i=u)},function(){r?(t.next(i),t.complete()):t.error(s?new NotFoundError("No matching values"):new EmptyError)}))})}function skip(n){return filter(function(e,t){return n<=t})}function skipLast(n){return n<=0?identity:operate(function(e,t){var r=new Array(n),i=0;return e.subscribe(new OperatorSubscriber(t,function(s){var o=i++;if(o<n)r[o]=s;else{var u=o%n,c=r[u];r[u]=s,t.next(c)}})),function(){r=null}})}function skipUntil(n){return operate(function(e,t){var r=!1,i=new OperatorSubscriber(t,function(){i==null||i.unsubscribe(),r=!0},noop);innerFrom(n).subscribe(i),e.subscribe(new OperatorSubscriber(t,function(s){return r&&t.next(s)}))})}function skipWhile(n){return operate(function(e,t){var r=!1,i=0;e.subscribe(new OperatorSubscriber(t,function(s){return(r||(r=!n(s,i++)))&&t.next(s)}))})}function startWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n);return operate(function(r,i){(t?concat$1(n,r,t):concat$1(n,r)).subscribe(i)})}function switchMap(n,e){return operate(function(t,r){var i=null,s=0,o=!1,u=function(){return o&&!i&&r.complete()};t.subscribe(new OperatorSubscriber(r,function(c){i==null||i.unsubscribe();var a=0,l=s++;innerFrom(n(c,l)).subscribe(i=new OperatorSubscriber(r,function(p){return r.next(e?e(c,p,l,a++):p)},function(){i=null,u()}))},function(){o=!0,u()}))})}function switchAll(){return switchMap(identity)}function switchMapTo(n,e){return isFunction$1(e)?switchMap(function(){return n},e):switchMap(function(){return n})}function switchScan(n,e){return operate(function(t,r){var i=e;return switchMap(function(s,o){return n(i,s,o)},function(s,o){return i=o,o})(t).subscribe(r),function(){i=null}})}function takeUntil(n){return operate(function(e,t){innerFrom(n).subscribe(new OperatorSubscriber(t,function(){return t.complete()},noop)),!t.closed&&e.subscribe(t)})}function takeWhile(n,e){return e===void 0&&(e=!1),operate(function(t,r){var i=0;t.subscribe(new OperatorSubscriber(r,function(s){var o=n(s,i++);(o||e)&&r.next(s),!o&&r.complete()}))})}function tap(n,e,t){var r=isFunction$1(n)||e||t?{next:n,error:e,complete:t}:n;return r?operate(function(i,s){var o;(o=r.subscribe)===null||o===void 0||o.call(r);var u=!0;i.subscribe(new OperatorSubscriber(s,function(c){var a;(a=r.next)===null||a===void 0||a.call(r,c),s.next(c)},function(){var c;u=!1,(c=r.complete)===null||c===void 0||c.call(r),s.complete()},function(c){var a;u=!1,(a=r.error)===null||a===void 0||a.call(r,c),s.error(c)},function(){var c,a;u&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(a=r.finalize)===null||a===void 0||a.call(r)}))}):identity}var defaultThrottleConfig={leading:!0,trailing:!1};function throttle(n,e){var t=e===void 0?defaultThrottleConfig:e,r=t.leading,i=t.trailing;return operate(function(s,o){var u=!1,c=null,a=null,l=!1,p=function(){a==null||a.unsubscribe(),a=null,i&&(m(),l&&o.complete())},d=function(){a=null,l&&o.complete()},f=function(h){return a=innerFrom(n(h)).subscribe(new OperatorSubscriber(o,p,d))},m=function(){if(u){u=!1;var h=c;c=null,o.next(h),!l&&f(h)}};s.subscribe(new OperatorSubscriber(o,function(h){u=!0,c=h,!(a&&!a.closed)&&(r?m():f(h))},function(){l=!0,!(i&&u&&a&&!a.closed)&&o.complete()}))})}function throttleTime(n,e,t){e===void 0&&(e=asyncScheduler),t===void 0&&(t=defaultThrottleConfig);var r=timer(n,e);return throttle(function(){return r},t)}function timeInterval(n){return n===void 0&&(n=async),function(e){return defer(function(){return e.pipe(scan(function(t,r){var i=t.current;return{value:r,current:n.now(),last:i}},{current:n.now(),value:void 0,last:void 0}),map(function(t){var r=t.current,i=t.last,s=t.value;return new TimeInterval(s,r-i)}))})}}var TimeInterval=function(){function n(e,t){this.value=e,this.interval=t}return n}();function timeoutWith(n,e,t){var r,i,s;if(t=t??async,isValidDate(n)?r=n:typeof n=="number"&&(i=n),e)s=function(){return e};else throw new TypeError("No observable provided to switch to");if(r==null&&i==null)throw new TypeError("No timeout provided.");return timeout({first:r,each:i,scheduler:t,with:s})}function timestamp(n){return n===void 0&&(n=dateTimestampProvider),map(function(e){return{value:e,timestamp:n.now()}})}function window$1(n){return operate(function(e,t){var r=new Subject;t.next(r.asObservable());var i=function(s){r.error(s),t.error(s)};return e.subscribe(new OperatorSubscriber(t,function(s){return r==null?void 0:r.next(s)},function(){r.complete(),t.complete()},i)),n.subscribe(new OperatorSubscriber(t,function(){r.complete(),t.next(r=new Subject)},noop,i)),function(){r==null||r.unsubscribe(),r=null}})}function windowCount(n,e){e===void 0&&(e=0);var t=e>0?e:n;return operate(function(r,i){var s=[new Subject],o=[],u=0;i.next(s[0].asObservable()),r.subscribe(new OperatorSubscriber(i,function(c){var a,l;try{for(var p=__values(s),d=p.next();!d.done;d=p.next()){var f=d.value;f.next(c)}}catch(v){a={error:v}}finally{try{d&&!d.done&&(l=p.return)&&l.call(p)}finally{if(a)throw a.error}}var m=u-n+1;if(m>=0&&m%t===0&&s.shift().complete(),++u%t===0){var h=new Subject;s.push(h),i.next(h.asObservable())}},function(){for(;s.length>0;)s.shift().complete();i.complete()},function(c){for(;s.length>0;)s.shift().error(c);i.error(c)},function(){o=null,s=null}))})}function windowTime(n){for(var e,t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s=(e=popScheduler(r))!==null&&e!==void 0?e:asyncScheduler,o=(t=r[0])!==null&&t!==void 0?t:null,u=r[1]||1/0;return operate(function(c,a){var l=[],p=!1,d=function(v){var g=v.window,b=v.subs;g.complete(),b.unsubscribe(),arrRemove(l,v),p&&f()},f=function(){if(l){var v=new Subscription;a.add(v);var g=new Subject,b={window:g,subs:v,seen:0};l.push(b),a.next(g.asObservable()),v.add(s.schedule(function(){return d(b)},n))}};o!==null&&o>=0?a.add(s.schedule(function(){f(),!this.closed&&a.add(this.schedule(null,o))},o)):p=!0,f();var m=function(v){return l.slice().forEach(v)},h=function(v){m(function(g){var b=g.window;return v(b)}),v(a),a.unsubscribe()};return c.subscribe(new OperatorSubscriber(a,function(v){m(function(g){g.window.next(v),u<=++g.seen&&d(g)})},function(){return h(function(v){return v.complete()})},function(v){return h(function(g){return g.error(v)})})),function(){l=null}})}function windowToggle(n,e){return operate(function(t,r){var i=[],s=function(o){for(;0<i.length;)i.shift().error(o);r.error(o)};innerFrom(n).subscribe(new OperatorSubscriber(r,function(o){var u=new Subject;i.push(u);var c=new Subscription,a=function(){arrRemove(i,u),u.complete(),c.unsubscribe()},l;try{l=innerFrom(e(o))}catch(p){s(p);return}r.next(u.asObservable()),c.add(l.subscribe(new OperatorSubscriber(r,a,noop,s)))},noop)),t.subscribe(new OperatorSubscriber(r,function(o){var u,c,a=i.slice();try{for(var l=__values(a),p=l.next();!p.done;p=l.next()){var d=p.value;d.next(o)}}catch(f){u={error:f}}finally{try{p&&!p.done&&(c=l.return)&&c.call(l)}finally{if(u)throw u.error}}},function(){for(;0<i.length;)i.shift().complete();r.complete()},s,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function windowWhen(n){return operate(function(e,t){var r,i,s=function(u){r.error(u),t.error(u)},o=function(){i==null||i.unsubscribe(),r==null||r.complete(),r=new Subject,t.next(r.asObservable());var u;try{u=innerFrom(n())}catch(c){s(c);return}u.subscribe(i=new OperatorSubscriber(t,o,o,s))};o(),e.subscribe(new OperatorSubscriber(t,function(u){return r.next(u)},function(){r.complete(),t.complete()},s,function(){i==null||i.unsubscribe(),r=null}))})}function withLatestFrom(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popResultSelector(n);return operate(function(r,i){for(var s=n.length,o=new Array(s),u=n.map(function(){return!1}),c=!1,a=function(p){innerFrom(n[p]).subscribe(new OperatorSubscriber(i,function(d){o[p]=d,!c&&!u[p]&&(u[p]=!0,(c=u.every(identity))&&(u=null))},noop))},l=0;l<s;l++)a(l);r.subscribe(new OperatorSubscriber(i,function(p){if(c){var d=__spreadArray([p],__read(o));i.next(t?t.apply(void 0,__spreadArray([],__read(d))):d)}}))})}function zipAll(n){return joinAllInternals(zip$1,n)}function zip(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return operate(function(t,r){zip$1.apply(void 0,__spreadArray([t],__read(n))).subscribe(r)})}function zipWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return zip.apply(void 0,__spreadArray([],__read(n)))}const index=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError,AsyncSubject,BehaviorSubject,ConnectableObservable,EMPTY,EmptyError,NEVER,NotFoundError,Notification:Notification$1,get NotificationKind(){return NotificationKind},ObjectUnsubscribedError,Observable,ReplaySubject,Scheduler,SequenceError,Subject,Subscriber,Subscription,TimeoutError,UnsubscriptionError,VirtualAction,VirtualTimeScheduler,animationFrame,animationFrameScheduler,animationFrames,asap,asapScheduler,async,asyncScheduler,audit,auditTime,bindCallback,bindNodeCallback,buffer,bufferCount,bufferTime,bufferToggle,bufferWhen,catchError,combineAll,combineLatest:combineLatest$1,combineLatestAll,combineLatestWith,concat:concat$1,concatAll,concatMap,concatMapTo,concatWith,config,connect,connectable,count,debounce,debounceTime,defaultIfEmpty,defer,delay,delayWhen,dematerialize,distinct,distinctUntilChanged,distinctUntilKeyChanged,elementAt,empty,endWith,every,exhaust,exhaustAll,exhaustMap,expand,filter,finalize,find,findIndex,first,firstValueFrom,flatMap,forkJoin,from,fromEvent,fromEventPattern,generate,groupBy,identity,ignoreElements,iif,interval,isEmpty,isObservable,last,lastValueFrom,map,mapTo,materialize,max,merge:merge$2,mergeAll,mergeMap,mergeMapTo,mergeScan,mergeWith,min,multicast,never,noop,observable,observeOn,of,onErrorResumeNext,pairs,pairwise,partition,pipe,pluck,publish,publishBehavior,publishLast,publishReplay,queue,queueScheduler,race,raceWith,range,reduce,refCount,repeat,repeatWhen,retry,retryWhen,sample,sampleTime,scan,scheduled,sequenceEqual,share,shareReplay,single,skip,skipLast,skipUntil,skipWhile,startWith,subscribeOn,switchAll,switchMap,switchMapTo,switchScan,take,takeLast,takeUntil,takeWhile,tap,throttle,throttleTime,throwError,throwIfEmpty,timeInterval,timeout,timeoutWith,timer,timestamp,toArray,using,window:window$1,windowCount,windowTime,windowToggle,windowWhen,withLatestFrom,zip:zip$1,zipAll,zipWith},Symbol.toStringTag,{value:"Module"})),ASYNC_DATA_NAME={SESSION_READY:"sessionReady",LANG_READY:"langReady",SKIN_READY:"skinReady",OVERRIDE_READY:"overrideReady"};class Promisified{constructor(){E(this,"_resolution");E(this,"_rejection");E(this,"_promise",new Promise((e,t)=>{this._resolution=e,this._rejection=t}))}get promise(){return this._promise}resolve(e){this._resolution&&this._resolution(e)}reject(e){this._rejection&&this._rejection(e)}}class NotifyFramework{constructor(){E(this,"promises",{});E(this,"subject",new Subject)}asyncData(e){return typeof this.promises[e]>"u"&&(this.promises[e]=new Promisified),this.promises[e]}onSessionReady(){return this.asyncData(ASYNC_DATA_NAME.SESSION_READY)}onLangReady(){return this.asyncData(ASYNC_DATA_NAME.LANG_READY)}onSkinReady(){return this.asyncData(ASYNC_DATA_NAME.SKIN_READY)}onOverridesReady(){return this.asyncData(ASYNC_DATA_NAME.OVERRIDE_READY)}promisify(){return new Promisified}events(){return this.subject}}const notify=new NotifyFramework;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",EXPLORER:"explorer"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",SEARCH_RESULTED:"searchResulted"};function getDefaultExportFromCjs(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var axios$3={exports:{}},bind$2=function(e,t){return function(){for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];return e.apply(t,i)}},bind$1=bind$2,toString=Object.prototype.toString;function isArray(n){return toString.call(n)==="[object Array]"}function isUndefined(n){return typeof n>"u"}function isBuffer(n){return n!==null&&!isUndefined(n)&&n.constructor!==null&&!isUndefined(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function isArrayBuffer(n){return toString.call(n)==="[object ArrayBuffer]"}function isFormData(n){return typeof FormData<"u"&&n instanceof FormData}function isArrayBufferView(n){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&n.buffer instanceof ArrayBuffer,e}function isString(n){return typeof n=="string"}function isNumber(n){return typeof n=="number"}function isObject(n){return n!==null&&typeof n=="object"}function isPlainObject(n){if(toString.call(n)!=="[object Object]")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}function isDate(n){return toString.call(n)==="[object Date]"}function isFile(n){return toString.call(n)==="[object File]"}function isBlob(n){return toString.call(n)==="[object Blob]"}function isFunction(n){return toString.call(n)==="[object Function]"}function isStream(n){return isObject(n)&&isFunction(n.pipe)}function isURLSearchParams(n){return typeof URLSearchParams<"u"&&n instanceof URLSearchParams}function trim(n){return n.replace(/^\s*/,"").replace(/\s*$/,"")}function isStandardBrowserEnv(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function forEach(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),isArray(n))for(var t=0,r=n.length;t<r;t++)e.call(null,n[t],t,n);else for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.call(null,n[i],i,n)}function merge(){var n={};function e(i,s){isPlainObject(n[s])&&isPlainObject(i)?n[s]=merge(n[s],i):isPlainObject(i)?n[s]=merge({},i):isArray(i)?n[s]=i.slice():n[s]=i}for(var t=0,r=arguments.length;t<r;t++)forEach(arguments[t],e);return n}function extend(n,e,t){return forEach(e,function(i,s){t&&typeof i=="function"?n[s]=bind$1(i,t):n[s]=i}),n}function stripBOM(n){return n.charCodeAt(0)===65279&&(n=n.slice(1)),n}var utils$9={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isObject,isPlainObject,isUndefined,isDate,isFile,isBlob,isFunction,isStream,isURLSearchParams,isStandardBrowserEnv,forEach,merge,extend,trim,stripBOM},utils$8=utils$9;function encode(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$1=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(utils$8.isURLSearchParams(t))i=t.toString();else{var s=[];utils$8.forEach(t,function(c,a){c===null||typeof c>"u"||(utils$8.isArray(c)?a=a+"[]":c=[c],utils$8.forEach(c,function(p){utils$8.isDate(p)?p=p.toISOString():utils$8.isObject(p)&&(p=JSON.stringify(p)),s.push(encode(a)+"="+encode(p))}))}),i=s.join("&")}if(i){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e},utils$7=utils$9;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},InterceptorManager$1.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager$1.prototype.forEach=function(e){utils$7.forEach(this.handlers,function(r){r!==null&&e(r)})};var InterceptorManager_1=InterceptorManager$1,utils$6=utils$9,transformData$1=function(e,t,r){return utils$6.forEach(r,function(s){e=s(e,t)}),e},isCancel$1,hasRequiredIsCancel;function requireIsCancel(){return hasRequiredIsCancel||(hasRequiredIsCancel=1,isCancel$1=function(e){return!!(e&&e.__CANCEL__)}),isCancel$1}var utils$5=utils$9,normalizeHeaderName$1=function(e,t){utils$5.forEach(e,function(i,s){s!==t&&s.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[s])})},enhanceError,hasRequiredEnhanceError;function requireEnhanceError(){return hasRequiredEnhanceError||(hasRequiredEnhanceError=1,enhanceError=function(e,t,r,i,s){return e.config=t,r&&(e.code=r),e.request=i,e.response=s,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}),enhanceError}var createError,hasRequiredCreateError;function requireCreateError(){if(hasRequiredCreateError)return createError;hasRequiredCreateError=1;var n=requireEnhanceError();return createError=function(t,r,i,s,o){var u=new Error(t);return n(u,r,i,s,o)},createError}var settle,hasRequiredSettle;function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var n=requireCreateError();return settle=function(t,r,i){var s=i.config.validateStatus;!i.status||!s||s(i.status)?t(i):r(n("Request failed with status code "+i.status,i.config,null,i.request,i))},settle}var cookies,hasRequiredCookies;function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var n=utils$9;return cookies=n.isStandardBrowserEnv()?function(){return{write:function(r,i,s,o,u,c){var a=[];a.push(r+"="+encodeURIComponent(i)),n.isNumber(s)&&a.push("expires="+new Date(s).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(u)&&a.push("domain="+u),c===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(r){var i=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),cookies}var isAbsoluteURL,hasRequiredIsAbsoluteURL;function requireIsAbsoluteURL(){return hasRequiredIsAbsoluteURL||(hasRequiredIsAbsoluteURL=1,isAbsoluteURL=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}),isAbsoluteURL}var combineURLs,hasRequiredCombineURLs;function requireCombineURLs(){return hasRequiredCombineURLs||(hasRequiredCombineURLs=1,combineURLs=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),combineURLs}var buildFullPath,hasRequiredBuildFullPath;function requireBuildFullPath(){if(hasRequiredBuildFullPath)return buildFullPath;hasRequiredBuildFullPath=1;var n=requireIsAbsoluteURL(),e=requireCombineURLs();return buildFullPath=function(r,i){return r&&!n(i)?e(r,i):i},buildFullPath}var parseHeaders,hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var n=utils$9,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(r){var i={},s,o,u;return r&&n.forEach(r.split(`
17
- `),function(a){if(u=a.indexOf(":"),s=n.trim(a.substr(0,u)).toLowerCase(),o=n.trim(a.substr(u+1)),s){if(i[s]&&e.indexOf(s)>=0)return;s==="set-cookie"?i[s]=(i[s]?i[s]:[]).concat([o]):i[s]=i[s]?i[s]+", "+o:o}}),i},parseHeaders}var isURLSameOrigin,hasRequiredIsURLSameOrigin;function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var n=utils$9;return isURLSameOrigin=n.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),i;function s(o){var u=o;return t&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=s(window.location.href),function(u){var c=n.isString(u)?s(u):u;return c.protocol===i.protocol&&c.host===i.host}}():function(){return function(){return!0}}(),isURLSameOrigin}var xhr,hasRequiredXhr;function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var n=utils$9,e=requireSettle(),t=requireCookies(),r=buildURL$1,i=requireBuildFullPath(),s=requireParseHeaders(),o=requireIsURLSameOrigin(),u=requireCreateError();return xhr=function(a){return new Promise(function(p,d){var f=a.data,m=a.headers;n.isFormData(f)&&delete m["Content-Type"];var h=new XMLHttpRequest;if(a.auth){var v=a.auth.username||"",g=a.auth.password?unescape(encodeURIComponent(a.auth.password)):"";m.Authorization="Basic "+btoa(v+":"+g)}var b=i(a.baseURL,a.url);if(h.open(a.method.toUpperCase(),r(b,a.params,a.paramsSerializer),!0),h.timeout=a.timeout,h.onreadystatechange=function(){if(!(!h||h.readyState!==4)&&!(h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0))){var w="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,F=!a.responseType||a.responseType==="text"?h.responseText:h.response,R={data:F,status:h.status,statusText:h.statusText,headers:w,config:a,request:h};e(p,d,R),h=null}},h.onabort=function(){h&&(d(u("Request aborted",a,"ECONNABORTED",h)),h=null)},h.onerror=function(){d(u("Network Error",a,null,h)),h=null},h.ontimeout=function(){var w="timeout of "+a.timeout+"ms exceeded";a.timeoutErrorMessage&&(w=a.timeoutErrorMessage),d(u(w,a,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var x=(a.withCredentials||o(b))&&a.xsrfCookieName?t.read(a.xsrfCookieName):void 0;x&&(m[a.xsrfHeaderName]=x)}if("setRequestHeader"in h&&n.forEach(m,function(w,F){typeof f>"u"&&F.toLowerCase()==="content-type"?delete m[F]:h.setRequestHeader(F,w)}),n.isUndefined(a.withCredentials)||(h.withCredentials=!!a.withCredentials),a.responseType)try{h.responseType=a.responseType}catch(y){if(a.responseType!=="json")throw y}typeof a.onDownloadProgress=="function"&&h.addEventListener("progress",a.onDownloadProgress),typeof a.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",a.onUploadProgress),a.cancelToken&&a.cancelToken.promise.then(function(w){h&&(h.abort(),d(w),h=null)}),f||(f=null),h.send(f)})},xhr}var utils$4=utils$9,normalizeHeaderName=normalizeHeaderName$1,DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(n,e){!utils$4.isUndefined(n)&&utils$4.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}function getDefaultAdapter(){var n;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(n=requireXhr()),n}var defaults$2={adapter:getDefaultAdapter(),transformRequest:[function(e,t){return normalizeHeaderName(t,"Accept"),normalizeHeaderName(t,"Content-Type"),utils$4.isFormData(e)||utils$4.isArrayBuffer(e)||utils$4.isBuffer(e)||utils$4.isStream(e)||utils$4.isFile(e)||utils$4.isBlob(e)?e:utils$4.isArrayBufferView(e)?e.buffer:utils$4.isURLSearchParams(e)?(setContentTypeIfUnset(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):utils$4.isObject(e)?(setContentTypeIfUnset(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};defaults$2.headers={common:{Accept:"application/json, text/plain, */*"}},utils$4.forEach(["delete","get","head"],function(e){defaults$2.headers[e]={}}),utils$4.forEach(["post","put","patch"],function(e){defaults$2.headers[e]=utils$4.merge(DEFAULT_CONTENT_TYPE)});var defaults_1=defaults$2,utils$3=utils$9,transformData=transformData$1,isCancel=requireIsCancel(),defaults$1=defaults_1;function throwIfCancellationRequested(n){n.cancelToken&&n.cancelToken.throwIfRequested()}var dispatchRequest$1=function(e){throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=transformData(e.data,e.headers,e.transformRequest),e.headers=utils$3.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),utils$3.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var t=e.adapter||defaults$1.adapter;return t(e).then(function(i){return throwIfCancellationRequested(e),i.data=transformData(i.data,i.headers,e.transformResponse),i},function(i){return isCancel(i)||(throwIfCancellationRequested(e),i&&i.response&&(i.response.data=transformData(i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})},utils$2=utils$9,mergeConfig$2=function(e,t){t=t||{};var r={},i=["url","method","data"],s=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function c(d,f){return utils$2.isPlainObject(d)&&utils$2.isPlainObject(f)?utils$2.merge(d,f):utils$2.isPlainObject(f)?utils$2.merge({},f):utils$2.isArray(f)?f.slice():f}function a(d){utils$2.isUndefined(t[d])?utils$2.isUndefined(e[d])||(r[d]=c(void 0,e[d])):r[d]=c(e[d],t[d])}utils$2.forEach(i,function(f){utils$2.isUndefined(t[f])||(r[f]=c(void 0,t[f]))}),utils$2.forEach(s,a),utils$2.forEach(o,function(f){utils$2.isUndefined(t[f])?utils$2.isUndefined(e[f])||(r[f]=c(void 0,e[f])):r[f]=c(void 0,t[f])}),utils$2.forEach(u,function(f){f in t?r[f]=c(e[f],t[f]):f in e&&(r[f]=c(void 0,e[f]))});var l=i.concat(s).concat(o).concat(u),p=Object.keys(e).concat(Object.keys(t)).filter(function(f){return l.indexOf(f)===-1});return utils$2.forEach(p,a),r},utils$1=utils$9,buildURL=buildURL$1,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2;function Axios$1(n){this.defaults=n,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=mergeConfig$1(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[dispatchRequest,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(s){t.unshift(s.fulfilled,s.rejected)}),this.interceptors.response.forEach(function(s){t.push(s.fulfilled,s.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},Axios$1.prototype.getUri=function(e){return e=mergeConfig$1(this.defaults,e),buildURL(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},utils$1.forEach(["delete","get","head","options"],function(e){Axios$1.prototype[e]=function(t,r){return this.request(mergeConfig$1(r||{},{method:e,url:t,data:(r||{}).data}))}}),utils$1.forEach(["post","put","patch"],function(e){Axios$1.prototype[e]=function(t,r,i){return this.request(mergeConfig$1(i||{},{method:e,url:t,data:r}))}});var Axios_1=Axios$1,Cancel_1,hasRequiredCancel;function requireCancel(){if(hasRequiredCancel)return Cancel_1;hasRequiredCancel=1;function n(e){this.message=e}return n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,Cancel_1=n,Cancel_1}var CancelToken_1,hasRequiredCancelToken;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var n=requireCancel();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(o){r=o});var i=this;t(function(o){i.reason||(i.reason=new n(o),r(i.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.source=function(){var r,i=new e(function(o){r=o});return{token:i,cancel:r}},CancelToken_1=e,CancelToken_1}var spread,hasRequiredSpread;function requireSpread(){return hasRequiredSpread||(hasRequiredSpread=1,spread=function(e){return function(r){return e.apply(null,r)}}),spread}var isAxiosError,hasRequiredIsAxiosError;function requireIsAxiosError(){return hasRequiredIsAxiosError||(hasRequiredIsAxiosError=1,isAxiosError=function(e){return typeof e=="object"&&e.isAxiosError===!0}),isAxiosError}var utils=utils$9,bind=bind$2,Axios=Axios_1,mergeConfig=mergeConfig$2,defaults=defaults_1;function createInstance(n){var e=new Axios(n),t=bind(Axios.prototype.request,e);return utils.extend(t,Axios.prototype,e),utils.extend(t,e),t}var axios$2=createInstance(defaults);axios$2.Axios=Axios,axios$2.create=function(e){return createInstance(mergeConfig(axios$2.defaults,e))},axios$2.Cancel=requireCancel(),axios$2.CancelToken=requireCancelToken(),axios$2.isCancel=requireIsCancel(),axios$2.all=function(e){return Promise.all(e)},axios$2.spread=requireSpread(),axios$2.isAxiosError=requireIsAxiosError(),axios$3.exports=axios$2,axios$3.exports.default=axios$2;var axiosExports=axios$3.exports,axios=axiosExports;const axios$1=getDefaultExportFromCjs(axios),loadedScripts$1={};class Http{constructor(e){E(this,"axios");E(this,"_latestResponse");this.axios=axios$1.create(e)}setCdn(e){e&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=e,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const t=arguments[1];return t.startsWith("/infra/public")&&(arguments[1]=e+t),/^\/([^\/]*)\/public/.test(t)&&(arguments[1]=e+t),t.startsWith("/assets")&&(arguments[1]=e+t),t=="/conf/public"&&(arguments[1]=t),t.startsWith("http")&&(arguments[1]=t),this.baseOpen.apply(this,arguments)})}toAxiosConfig(e){if(e){const t=Object.assign({},this.axios.defaults);return e.headers&&(t.headers&&(t.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(t.headers,e.headers)),e.responseType&&(t.responseType=e.responseType),e.queryParams&&(t.params=Object.assign({},e.queryParams)),t}else return this.axios.defaults}toCdnUrl(e){const t=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((t==null?void 0:t.length)>0&&e!=="/conf/public"){const r=""+e;(r.startsWith("/infra/public")||r.startsWith("/assets")||/^\/([^\/]*)\/public/.test(r))&&(e=t+r)}return e}mapAxiosError(e,t){return e.response?this._latestResponse=e.response:e.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!t||t.disableNotifications,this._latestResponse}mapAxiosResponse(e,t){return this._latestResponse=e,e.data}get latestResponse(){return this._latestResponse}get(e,t){return this.axios.get(this.toCdnUrl(e),this.toAxiosConfig(t)).then(r=>this.mapAxiosResponse(r,t)).catch(r=>this.mapAxiosError(r,t))}post(e,t,r){return this.axios.post(e,t,this.toAxiosConfig(r)).then(i=>this.mapAxiosResponse(i,r)).catch(i=>this.mapAxiosError(i,r))}postFile(e,t,r){const i=this.toAxiosConfig(r);return i.headers&&i.headers["Content-Type"]&&delete i.headers["Content-Type"],this.axios.post(e,t,i).then(s=>this.mapAxiosResponse(s,r)).catch(s=>this.mapAxiosError(s,r))}postJson(e,t,r){const i=this.toAxiosConfig();return i.headers&&(i.headers["Content-Type"]="application/json"),this.axios.post(e,t,this.toAxiosConfig(r)).then(s=>this.mapAxiosResponse(s,r)).catch(s=>this.mapAxiosError(s,r))}put(e,t,r){return this.axios.put(e,t,this.toAxiosConfig(r)).then(i=>this.mapAxiosResponse(i,r)).catch(i=>this.mapAxiosError(i,r))}putJson(e,t,r){const i=this.toAxiosConfig(r);return i.headers&&(i.headers["Content-Type"]="application/json"),this.axios.put(e,t,i).then(s=>this.mapAxiosResponse(s,r)).catch(s=>this.mapAxiosError(s,r))}delete(e,t){return this.axios.delete(e,this.toAxiosConfig(t)).then(r=>this.mapAxiosResponse(r,t)).catch(r=>this.mapAxiosError(r,t))}deleteJson(e,t){return this.axios.delete(e,{data:t}).then(r=>this.mapAxiosResponse(r)).catch(r=>this.mapAxiosError(r))}getScript(e,t,r){const i=r??"exports",s=this.toAxiosConfig(t);return s.headers&&(s.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(e),s).then(o=>this.mapAxiosResponse(o,t)).then(o=>{try{const u=`"use strict";var ${i.split(".")[0]}={};${o};return ${i};`;return Function(u)()}catch{return o}}).catch(o=>{throw this.mapAxiosError(o,t),o})}loadScript(e,t){return loadedScripts$1[e]?Promise.resolve():this.getScript(e,t).then(r=>{loadedScripts$1[e]=!0})}}class TransportFramework{constructor(){E(this,"_http",new Http)}get http(){return this._http}newHttpInstance(e){return new Http(e)}}const transport=new TransportFramework;class TransportFrameworkFactory{static instance(){return transport}}const http$2=transport.http;class Session{constructor(){E(this,"_me",null);E(this,"_currentLanguage","");E(this,"_notLoggedIn",!0);E(this,"_description");E(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let e=this.description.photo;return(!e||e==="no-avatar.jpg"||e==="no-avatar.svg")&&(e=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),e}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(e=>{if(http$2.latestResponse.status<200||http$2.latestResponse.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(e),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(e=>(this.setCurrentLanguage(e),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(e=>{if(e===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(e)})}setCurrentModel(e){this._me=e,this._notLoggedIn=!(e&&e.sessionMetadata&&e.sessionMetadata.userId)}hasWorkflow(e){var t;return e===void 0||((t=this._me)==null?void 0:t.authorizedActions.findIndex(r=>r.name===e))!==-1}hasRight(e,t){if(t==="owner")return e.owner&&e.owner.userId===this._me.userId;const r=t.right||t,s=e.shared.filter(u=>(this._me.groupsIds||[]).indexOf(u.groupId)!==-1||u.userId===this._me.userId).find(u=>u[r]||u.manager)!==void 0,o=t.workflow?this.hasWorkflow(t.workflow):!0;return s&&o}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(e=>(this._description&&(this._description.quota=e.quota,this._description.storage=e.storage),e)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(e){this._currentLanguage=e,notify.onLangReady().resolve(e)}loadDefaultLanguage(){return http$2.get("/locale").then(e=>e.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(e=>(e[0].status==="ok"&&e[0].result&&e[0].result.length>0?this._description=e[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,e[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(e=>e.result).then(e=>this._profile=e[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(e=>{try{return JSON.parse(e.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(e){return http$2.put("/directory/user/mailstate",{email:e})}tryEmailValidation(e){return http$2.post("/directory/user/mailstate",{key:e})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(e){return http$2.put("/directory/user/mobilestate",{mobile:e})}tryMobileValidation(e){return http$2.post("/directory/user/mobilestate",{key:e})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(e){return http$2.post("/auth/user/mfa/code",{key:e})}}class SessionFramework{constructor(){E(this,"session",new Session)}initialize(){return this.session.initialize()}login(e,t,r,i){const s=new FormData;return s.append("email",e),s.append("password",t),typeof r<"u"&&s.append("rememberMe",""+r),typeof i<"u"&&s.append("secureLocation",""+i),transport.http.post("/auth/login",s,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){E(this,"_conf");E(this,"_loaded");E(this,"skinName","");E(this,"themeName","");E(this,"skin","raw");E(this,"themeUrl","/assets/themes/raw/default/");E(this,"templateOverrides",{});E(this,"portalTemplate","/assets/themes/raw/portal.html");E(this,"basePath","");E(this,"logoutCallback","/");E(this,"skins",[]);E(this,"is1D",!1);E(this,"is2D",!1);E(this,"_onSkinReady",notify.onSkinReady());E(this,"_onOverrideReady",notify.onOverridesReady())}initialize(e){return notify.onSessionReady().promise.then(()=>this.load(e))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(e){return this._conf=this._conf??await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:e??this.version}},"exports.conf"),this._conf}load(e){return e=e??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(e):this.loadConnected(e)).then(async()=>{var r,i;const t=await this.listSkins();this.is1D=((r=t.find(s=>s.child===this.skin))==null?void 0:r.parent)==="panda",this.is2D=((i=t.find(s=>s.child===this.skin))==null?void 0:i.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(e){return new Promise((t,r)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(i=>{this.skin=i.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${i.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${i.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:e}}).then(s=>{this.templateOverrides=s,this._onOverrideReady.resolve(s),t()}).catch(s=>{if(transport.http.latestResponse.status===404)t();else throw s})}).catch(i=>{this._onSkinReady.reject(i),this._onOverrideReady.reject(i),r()})})}loadConnected(e){return new Promise((t,r)=>{this.loadDefaultTheme(e).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:e}}).then(i=>{this.templateOverrides=i,this._onOverrideReady.resolve(i),t()}).catch(i=>{if(transport.http.latestResponse.status===404)t(),this._onSkinReady.reject(i),this._onOverrideReady.reject(i);else throw i})})})}async loadDefaultTheme(e){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:e}}).then(t=>{this.skinName=t.skinName,this.themeName=t.themeName,this.themeUrl=t.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=t.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(e){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+e._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(e=>{const t=e.overriding.find(r=>r.child===this.skin);return t!=null&&t.group?this.skins=this.skins.concat(e.overriding.filter(r=>r.group===t.group)):this.skins=this.skins.concat(e.overriding),this.skins})}async getHelpPath(){const t=(await this.listSkins()).find(r=>r.child===this.skin);return(t==null?void 0:t.help)??"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(e,t){e=e??"";let r=bundle$1[e]===void 0?e:bundle$1[e];if(t&&typeof t=="object")for(let i in t)typeof t[i]<"u"&&(r=r.replace(new RegExp("\\${"+i+"}","g"),""+t[i]));return r}addBundlePromise(e){return this.loadBundlePromise(session.session.currentLanguage,e)}addBundle(e,t){this.loadBundle(session.session.currentLanguage,e,t)}loadBundlePromise(e,t){return this.loadBundle(e,t),promises$1[t]}loadBundle(e,t,r){const i=promises$1[t];if(i)r&&i.then(r).catch(r);else{const s=new Promisified;promises$1[t]=s.promise;const o={};e&&(o["Accept-Language"]=e),transport.http.get(t,{headers:o}).then(u=>{Object.assign(bundle$1,u),typeof r=="function"&&r(),s.resolve()}).catch(u=>{typeof r=="function"&&r(),s.reject()})}}addTranslations(e,t){notify.onLangReady().promise.then(r=>{this.loadBundle(r,e+"/"+r+".json",t)})}addAllTranslations(e){return e&&e.length>0?notify.onLangReady().promise.then(t=>Promise.all(e.map(r=>this.loadBundlePromise(t,r+"/"+t+".json")))).then(()=>{}):Promise.reject()}addKeys(e){for(var t in e)typeof bundle$1[t]!="string"&&(bundle$1[t]=e[t])}removeAccents(e){for(var t=0;t<defaultDiacriticsRemovalMap$1.length;t++)e=e.replace(defaultDiacriticsRemovalMap$1[t].letters,defaultDiacriticsRemovalMap$1[t].base);return e}}class UserPreferences{constructor(){E(this,"data",{})}get(e){return this.data[e]}load(e,t){return transport.http.get("/userbook/preference/"+e).then(r=>{try{return JSON.parse(r.preference)}catch{return t??{}}}).then(r=>(this.data[e]=r??{},r))}update(e,t){return t!==void 0&&(this.data[e]=t),this}save(e){return transport.http.putJson("/userbook/preference/"+e,this.data[e])}}class User{constructor(){E(this,"_me",null);E(this,"_keepOpenOnLogout",!1);E(this,"_preferences",new UserPreferences);E(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(e){return this.loadPublicConf(),notify.onSessionReady().promise.then(t=>{t&&this.setCurrentModel(t)})}setCurrentModel(e){this._me=e,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(e=>(this._keepOpenOnLogout=(e==null?void 0:e.keepOpenOnLogout)||!1,e))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(e=>{e.preference||(e.preference=null);const t=JSON.parse(e.preference);let r;if(t&&t.length&&typeof t.concat=="function"){this._bookmarkedApps=t,r={bookmarks:t.map(o=>o.name),applications:[]},transport.http.putJson("/userbook/preference/apps",r);return}else r=t;r||(r={bookmarks:[],applications:[]});let i=!0;const s=[];r.bookmarks.forEach((o,u)=>{const c=this._me.apps.find(a=>a.name===o);if(c){let a=Object.assign({},c);this._bookmarkedApps.push(a)}else s.push(o),i=!1}),s.forEach(o=>{let u=r.bookmarks.indexOf(o);u!==-1&&r.bookmarks.splice(u,1)}),i||transport.http.putJson("/userbook/preference/apps",r)})}loadAppPrefs(e){return this.preferences.load(e,{})}saveAppPrefs(e){return this.preferences.save(e)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(e=>e["default-domain"])}saveLanguage(e){return this.preferences.update("language",{"default-domain":e}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){E(this,"_publicConf",{});E(this,"_currentApp");E(this,"_appConf",{})}get currentApp(){return this._currentApp??null}setCurrentApp(e){return this._currentApp=e,this}async initialize(e,t=!1){t||this.setCurrentApp(e),await Promise.all([this.getPublicConf(e),this.loadI18n(e)])}async getPublicConf(e){return this._publicConf[e]||(this._publicConf[e]=await http$1.get(`/${e}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[e]}async getWebAppConf(e){let t;return this._appConf[e]||(await http$1.get("/applications-list")).apps.forEach(i=>{if(i!=null&&i.prefix){const s=i.prefix.replace("/","");this._appConf[s]=i}else i!=null&&i.name&&i.name.toLowerCase()==e&&(t=i)}),this._appConf[e]??t}async loadI18n(e){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${e}/i18n`)}}class Analytics{constructor(){E(this,"_status","void");E(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(e){return this.parametersWithCheck(e,!0)}async parametersWithCheck(e,t){return this.initialize().promise.then(r=>!t||r.type===e||r.type==="multiple"?r[e]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async e=>{var t;if(!e||!e[0]||!e[0].type)throw ERROR_CODE.MALFORMED_DATA;e[1]&&e[1].active&&(e[0].xiti=await this.initializeXiti(e[1])),(t=this._params)==null||t.resolve(e[0]),this._status="ready"}).catch(e=>{var t;throw this._status="failed",(t=this._params)==null||t.reject(),e})),this._params}async initializeXiti(e){if(!e.structureMap||!configure.Platform.apps.currentApp)return;const t=await notify.onSessionReady().promise,r=session.session.description;let i;for(let a of t.structures){const l=e.structureMap[a];if(l&&l.collectiviteId&&l.UAI){i=l;break}}if(!i||!i.active)return;const s=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!s)return;const o=s.xiti;if(!o||!o.LIBELLE_SERVICE||!i.UAI)return;function u(a){let l="";for(let p=0;p<a.length;p++)l+=a.charCodeAt(p);return l}const c={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:o.LIBELLE_SERVICE,TYPE:o.OUTIL?"TIERS":"NATIF",OUTIL:o.OUTIL?o.OUTIL:"",STRUCT_ID:i.collectiviteId,STRUCT_UAI:i.UAI,PROJET:i.projetId?i.projetId:e.ID_PROJET,EXPLOITANT:e.ID_EXPLOITANT,PLATFORME:i.plateformeId?i.plateformeId:e.ID_PLATEFORME,ID_PERSO:u(t.userId),PROFILE:r.profiles&&r.profiles.length>0?c[r.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){E(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")});E(this,"School",{});E(this,"User",new User)}async initialize(e,t){if(!e){const i=a=>(a<10?"0":"")+a.toFixed(0),s=new Date,o=s.getFullYear(),u=s.getMonth()+1,c=s.getDate();e=`${o}${i(u)}${i(c)}`}const r=e;this.Platform.deploymentTag=e,typeof t=="string"&&t.length>0&&(this.Platform.cdnDomain=t),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(r),notify.onSessionReady().promise.then(i=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(r)])}}const configure=new ConfigurationFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}class SessionFrameworkFactory{static instance(){return session}}const WIDGET_POSITION={LEFT:"left",RIGHT:"right"},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT,"edumalin-widget":WIDGET_POSITION.RIGHT,"mediacentre-widget":WIDGET_POSITION.RIGHT,"evaluation-widget":WIDGET_POSITION.LEFT,"cantine-widget":WIDGET_POSITION.LEFT,"ptit-observatoire-widget":WIDGET_POSITION.RIGHT,"screen-time-widget":WIDGET_POSITION.RIGHT,"bibliocollege-widget":WIDGET_POSITION.LEFT,"e-sidoc-widget":WIDGET_POSITION.LEFT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140,"edumalin-widget":35,"mediacentre-widget":145,"cantine-widget":21,"evaluation-widget":35,"ptit-observatoire-widget":35,"screen-time-widget":35,"bibliocollege-widget":35,"e-sidoc-widget":35};class WidgetFramework{constructor(){E(this,"_initialized");E(this,"_widgets",[]);E(this,"_userPrefs",{})}initialize(e,t){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(r=>{var i;r&&r.widgets?(r.widgets.forEach(s=>{this._widgets.push(new Widget(s))}),this.loadUserPrefs().then(()=>{var s;(s=this._initialized)==null||s.resolve()}).catch(s=>{var o;(o=this._initialized)==null||o.reject()})):(i=this._initialized)==null||i.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(e){return this._widgets.find(t=>t.platformConf.name===e)}lookupDefaultPosition(e){return defaultWidgetPosition[e]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(e=>this.applyUserPrefs(e))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().next({name:EVENT_NAME.USERPREF_CHANGED,layer:LAYER_NAME.WIDGETS})})}async applyUserPrefs(e){this._userPrefs=e??this._userPrefs;const t=configure.Platform.theme,r=[];t.listSkins().then(i=>{var u;const s=((u=i.find(c=>c.child===t.skin))==null?void 0:u.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((c,a)=>{const l=c.platformConf.name;return s.indexOf(l)!==-1?!1:(this._userPrefs[l]||(this._userPrefs[l]={index:defaultWidgetOrder[l]??999,show:!0,position:c.platformConf.position}),c.platformConf.mandatory&&(this._userPrefs[l].show=!0,this._userPrefs[l].index=defaultWidgetOrder[l]??999),c.platformConf.i18n&&r.push(c.platformConf.i18n),c.applyUserPref(this._userPrefs[l]),!0)});const o=new Idiom;this._widgets=this._widgets.sort((c,a)=>{const l=o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(),p=o.translate(`timeline.settings.${a.platformConf.name}`).toLowerCase();return l<p?-1:l>p?1:0})})}}class Widget{constructor(e){E(this,"_schoolConf",{});E(this,"_userPref");this._platformConf=e,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(e){this._userPref=e,this._userPref.position=this._userPref.position??widgets.lookupDefaultPosition(this._platformConf.name)??"left"}}const widgets=new WidgetFramework;class LastInfosWidget{loadInfos(e){return transport.http.get("/actualites/api/v1/infos/preview/last/"+e)}getMaxResults(){return transport.http.get("/userbook/preference/maxInfos").then(e=>e.preference?parseInt(e.preference):4)}setMaxResults(e){return transport.http.putJson("/userbook/preference/maxInfos",`"${e}"`)}}const WIDGET_NAME={LAST_INFOS:"last-infos-widget",BIRTHDAY:"birthday",CALENDAR:"calendar-widget",CARNET:"carnet-de-bord",RECORD:"record-me",MOOD:"mood",MY_APPS:"my-apps",NOTES:"notes",RSS:"rss-widget",BOOKMARK:"bookmark-widget",QWANT:"qwant",QWANT_JUNIOR:"qwant-junior",AGENDA:"agenda-widget",CURSUS:"cursus-widget",MAXICOURS:"maxicours-widget",UNIVERSALIS:"universalis-widget",BRIEFME:"briefme-widget",SCHOOL:"school-widget",EDUMALIN:"edumalin-widget",MEDIACENTRE:"mediacentre-widget",EVALUATION:"evaluation-widget",CANTINE:"cantine-widget",PTIT_OBSERVATOIRE:"ptit-observatoire-widget",SCREEN_TIME:"screen-time-widget",BIBLIOCOLLEGE:"bibliocollege-widget",E_SIDOC:"e-sidoc-widget"};class WidgetFrameworkFactory{static instance(){return widgets}}const http=transport==null?void 0:transport.http,me=(C=session==null?void 0:session.session)==null?void 0:C.user;class Notification{constructor(e){E(this,"_id");E(this,"model");e.reported=e.reporters&&e.reporters.length>0,this._id=e._id,this.model=e}isUnread(){var e;return((e=this.model.recipients)==null?void 0:e.find(t=>t.userId===me.userId))!==void 0}delete(){return http.delete("/timeline/"+this._id)}discard(){return http.put("/timeline/"+this._id)}report(){return http.put("/timeline/"+this._id+"/report")}}class TimelineApp{constructor(){E(this,"_notifications",[]);E(this,"_notificationTypes",[]);E(this,"_flashMessages",[]);E(this,"_pageNumber",0);E(this,"_lastPage",!1);E(this,"_loading",!1);E(this,"showMine",!1)}get notifications(){return this._notifications}get isLoading(){return this._loading}get page(){return this._pageNumber}get hasMorePage(){return!this._lastPage}get notificationTypes(){return this._notificationTypes}get selectedNotificationTypes(){return this.preferences.type=this.preferences.type||[],this.preferences.type}get preferences(){return configure.User.preferences.get(APP.TIMELINE)}get flashMessages(){return this._flashMessages}savePreferences(){return configure.User.saveAppPrefs(APP.TIMELINE)}resetPagination(){this._pageNumber=0,this._lastPage=!1,this._loading=!1}initialize(){return Promise.all([configure.User.loadAppPrefs(APP.TIMELINE),transport.http.get("/timeline/types")]).then(e=>{this._notificationTypes=e[1]})}loadNotifications(e){if(this._loading||this._lastPage)return Promise.resolve();e&&(this._pageNumber++,this._lastPage=!1);let t=this.selectedNotificationTypes;if(t.length===0)return this._lastPage=!0,Promise.resolve();let r={page:this.page,mine:1};return this.showMine||delete r.mine,this._loading=!0,transport.http.get(`/timeline/lastNotifications?type=${t.join("&type=")}`,{queryParams:r}).then(i=>{if(this._loading=!1,i.status==="ok")if(i.number&&i.results){const s=i.results.filter(o=>this._notifications.findIndex(u=>u._id===o._id)===-1).map(o=>new Notification(o));this._notifications=this._notifications.concat(s),this._pageNumber++}else this._lastPage=!0}).catch(i=>{this._loading=!1})}loadFlashMessages(){return transport.http.get("/timeline/flashmsg/listuser").then(e=>{this._flashMessages=e})}markAsRead(e){return transport.http.put("/timeline/flashmsg/"+e.id+"/markasread")}}class ITimelineFactory{static createInstance(){return new TimelineApp}}const A=class A{constructor(e){E(this,"checkHttpResponse",e=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return e});this.context=e}static register({application:e,resourceType:t},r){A.registry.set(`${e}:main`,r),A.registry.set(`${e}:${t}`,r)}static findService({application:e,resourceType:t},r){const i=A.registry.get(`${e}:${t}`);if(i===void 0)throw`Service not found: ${e}:${t}`;return i(r)}static findMainService({application:e},t){const r=A.registry.get(`${e}:main`);if(r===void 0)throw`Service not found: ${e}`;return r(t)}get http(){return this.context.http()}getShareReadUrl(e){return`/${this.getApplication()}/share/json/${e}?search=`}getSaveShareUrl(e){return`/${this.getApplication()}/share/resource/${e}`}gotoPrint(e,t){window.open(this.getPrintUrl(e,t),"_blank")}gotoView(e){window.open(this.getViewUrl(e),"_self")}gotoForm(e){window.open(this.getFormUrl(e),"_self")}async publish(e){const t=new FormData;t.append("title",e.title),t.append("cover",e.cover),t.append("coverName",e.cover.name),t.append("coverType",e.cover.type),t.append("teacherAvatar",e.teacherAvatar),t.append("teacherAvatarName",e.teacherAvatar.name||`teacherAvatar_${e.userId}`),t.append("teacherAvatarType",e.teacherAvatar.type),t.append("language",e.language),e.activityType.forEach(s=>{t.append("activityType[]",s)}),e.subjectArea.forEach(s=>{t.append("subjectArea[]",s)}),e.age.forEach(s=>{t.append("age[]",s.toString())}),t.append("description",e.description),e.keyWords.split(",").forEach(s=>{t.append("keyWords[]",s.trim())}),t.append("licence",e.licence),t.append("pdfUri",`${window.location.origin}${this.getPrintUrl(e.resourceEntId)}`),t.append("application",e.application?e.application:""),t.append("resourceId",e.resourceId),t.append("teacherSchool",e.userStructureName);const i=await this.http.post("/appregistry/library/resource",t,{headers:{"Content-Type":"multipart/form-data"}});return this.checkHttpResponse(i)}async createContext(e){const t=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(e)});return this.checkHttpResponse(t)}async searchContext(e){const t=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(e)});return this.checkHttpResponse(t)}async createFolder(e){const t=await this.http.post("/explorer/folders",this.createFolderToBodyParams(e));return this.checkHttpResponse(t)}async updateFolder(e){const t=await this.http.put(`/explorer/folders/${e.folderId}`,this.createFolderToBodyParams(e));return this.checkHttpResponse(t)}async moveToFolder(e){const t=await this.http.post(`/explorer/folders/${e.folderId}/move`,this.moveToBodyParams(e));return this.checkHttpResponse(t)}async listSubfolders(e){const t=await this.http.get(`/explorer/folders/${e}`);return this.checkHttpResponse(t)}async deleteAll(e){const t=await this.http.deleteJson("/explorer",e);return this.checkHttpResponse(t)}async trashAll({resourceType:e,...t}){const r=await this.http.putJson("/explorer/trash",t);return this.checkHttpResponse(r)}async restoreAll({resourceType:e,...t}){const r=await this.http.putJson("/explorer/restore",t);return this.checkHttpResponse(r)}async getThumbnailPath(e){if(typeof e>"u")return e;if(typeof e=="string")if(e.startsWith("blob:")){const t=await fetch(e).then(i=>i.blob());return`/workspace/document/${(await this.context.workspace().saveFile(t,{visibility:"protected",application:this.getApplication()}))._id}`}else return e;else return`/workspace/document/${(await this.context.workspace().saveFile(e,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(e){let t={application:e.app,start_idx:e.pagination.startIdx,page_size:e.pagination.pageSize,resource_type:e.types[0],trashed:e.trashed};if(e.orders&&Object.entries(e.orders).length){const[[r,i]]=Object.entries(e.orders);t.order_by=`${r}:${i}`}return e.filters&&Object.assign(t,e.filters),typeof e.search=="string"&&(t.search=e.search),t}createFolderToBodyParams(e){return{application:e.app,resourceType:e.type,parentId:e.parentId,name:e.name}}moveToBodyParams(e){return{application:e.application,resourceType:this.getResourceType(),resourceIds:e.resourceIds,folderIds:e.folderIds}}};E(A,"registry",new Map);let ResourceService=A;class BlogResourceService extends ResourceService{async create(e){const t=e.thumbnail?await this.getThumbnailPath(e.thumbnail):"",r=e.public?"/blog/pub":"/blog",i=await this.http.post(r,{title:e.name,description:e.description,visibility:e.public?"PUBLIC":"OWNER",thumbnail:t,trashed:!1,slug:e.public?e.slug:"","publish-type":e.publishType||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(i),i}async update(e){const t=await this.getThumbnailPath(e.thumbnail),r=await this.http.put(`/blog/${e.entId}`,{trashed:e.trashed,_id:e.entId,title:e.name,thumbnail:t,description:e.description,visibility:e.public?"PUBLIC":"OWNER",slug:e.public?e.slug:"","publish-type":e["publish-type"]||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(r),{thumbnail:t,entId:e.entId}}getResourceType(){return RESOURCE.BLOG}getApplication(){return APP.BLOG}getFormUrl(e){return e?`/blog?folderid=${e}#/edit/new`:"/blog#/edit/new"}getViewUrl(e){return`/blog#/view/${e}`}getPrintUrl(e,t){return`/blog/print/blog#/print/${e}?comments=${t||!0}`}}ResourceService.register({application:RESOURCE.BLOG,resourceType:RESOURCE.BLOG},n=>new BlogResourceService(n));class MindmapResourceService extends ResourceService{async create(e){const t=e.thumbnail?await this.getThumbnailPath(e.thumbnail):"",r=await this.http.post("/mindmap",{name:e.name,description:e.description,thumbnail:t,folder:e.folder,map:`<map version="tango" theme="prism"><topic central="true" text="${e.name}"/></map>`,trashed:!1,visibility:"OWNER"});return this.checkHttpResponse(r),{entId:r._id,thumbnail:t}}async update(e){const t=e.thumbnail?await this.getThumbnailPath(e.thumbnail):"",r=await this.http.put(`/mindmap/${e.entId}`,{trashed:e.trashed,_id:e.entId,name:e.name,thumbnail:t,description:e.description,visibility:e.public?"PUBLIC":"OWNER"});return this.checkHttpResponse(r),{thumbnail:t,entId:e.entId}}getResourceType(){return RESOURCE.MINDMAP}getApplication(){return APP.MINDMAP}getFormUrl(e){return e?`/mindmap?folderid=${e}/new`:"/mindmap/new"}getViewUrl(e){return`/mindmap/id/${e}`}getPrintUrl(e,t){return`/mindmap/print/id/${e}?comments=${t||!0}`}}ResourceService.register({application:RESOURCE.MINDMAP,resourceType:RESOURCE.MINDMAP},n=>new MindmapResourceService(n));const globalCache={},mutexPromise={};class CacheService{constructor(e){this.context=e}get http(){return this.context.http()}async fromCacheIfPossible(e,t,r){if(mutexPromise[e]&&await mutexPromise[e],globalCache[e])return globalCache[e];try{const i=t();mutexPromise[e]=i;const s=await i;return r(s)&&(globalCache[e]=s),s}catch(i){throw console.error(`Failed to retrieve value for: ${e}`,i),i}}clearCache(e){if(e)delete globalCache[e];else for(const t in globalCache)globalCache.hasOwnProperty(t)&&delete globalCache[t]}async httpGet(e,t){return this.fromCacheIfPossible(e,async()=>{const r=await this.http.get(e,t),i={...this.http.latestResponse};return{value:r,response:i}},({response:r})=>!(r.status<200||r.status>=300))}async httpGetJson(e,t){const{response:r,value:i}=await this.httpGet(e,t);if(r.status<200||r.status>=300)throw`Bad http status (${r.status}) for url: ${e}`;return i}}class ConfService{constructor(e){this.context=e}get http(){return this.context.http()}get cdnDomain(){return configure.Platform.cdnDomain}async getConf(e){const[t,r]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[i,s,o]=await Promise.all([this.getTheme({conf:t}),this.getWebAppConf({app:e,applications:r}),this.getExtendedTheme()]);return{applications:r,conf:t,currentApp:s,theme:i,extendedTheme:o}}getCdnUrl(){console.warn("[getCdnUrl] Not implemented yet")}async savePreference(e,t){this.http.putJson(`/userbook/preference/${e}`,t)}async getPreference(e){const t=await this.http.get(`/userbook/preference/${e}`);return JSON.parse(t.preference)}async getThemeConf(e){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:e}},"exports.conf")}async getExtendedTheme(){try{return await this.http.get("/assets/extended-theme.json")}catch{return console.error("[getExtendedTheme] could not found /assets/extended-theme.json"),{}}}async getApplicationsList(){return(await this.http.get("/applications-list")).apps}async getWebAppConf({app:e,applications:t}){return t.find(i=>{if(i!=null&&i.prefix)return(i==null?void 0:i.prefix.replace("/",""))===e})}async getTheme({version:e,conf:t}){const r=await this.http.get("/theme",{queryParams:{_:e}}),i=r.themeName,s=t==null?void 0:t.overriding.find(a=>a.child===i).skins,o="/assets/themes/edifice-bootstrap",u=t==null?void 0:t.overriding.find(a=>a.child===i).bootstrapVersion.split("-").at(-1),c=(t==null?void 0:t.overriding.find(a=>a.child===i).parent)==="panda";return{basePath:`${this.cdnDomain}${r.skin}../../`,bootstrapPath:o,bootstrapVersion:u,is1d:c,logoutCallback:r.logoutCallback,skin:r.skin.split("/assets/themes/")[1].split("/")[0],skinName:r.skinName,skins:s,themeName:r.themeName,themeUrl:r.skin}}}class DirectoryService{constructor(e){this.odeServices=e}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(e,t,r="100x100"){return t==="user"?`/userbook/avatar/${e}?thumbnail=${r}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(e,t){return t==="user"?`/userbook/annuaire#/${e}`:`/userbook/annuaire#/group-view/${e}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:t,name:r})=>({id:t,displayName:r,members:[]}))}async getBookMarkById(e){const{groups:t,id:r,name:i,users:s}=await this.http.get(`/directory/sharebookmark/${e}`);return{id:r,displayName:i,groups:t.map(({name:o,id:u})=>({displayName:o,id:u})),users:s.map(({displayName:o,id:u,profile:c})=>({profile:c,displayName:o,firstName:"",lastName:"",login:"",id:u}))}}async saveBookmarks(e,{bookmarks:t,groups:r,users:i}){this.cache.clearCache("/directory/sharebookmark/all");const s=i.map(d=>typeof d=="string"?d:d.id),o=r.map(d=>typeof d=="string"?d:d.id),u=t.map(async d=>{if(typeof d=="string"){const{displayName:f,groups:m,id:h,users:v}=await this.getBookMarkById(d),g=v.map(y=>y.id),b=m.map(y=>y.id);return{displayName:f,id:h,members:[...b,...g]}}else return Promise.resolve(d)}),a=(await Promise.all(u)).map(d=>d.members).reduce((d,f)=>[...d,...f],[]),l={name:e,members:[...s,...o,...a]},{id:p}=await this.http.postJson("/directory/sharebookmark",l);return{id:p,displayName:e,members:l.members}}}const loadedScripts={};class HttpService{constructor(e,t){E(this,"axios");E(this,"_latestResponse");this.context=e,this.axios=axios$1.create(t)}setCdn(e){e&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=e,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const t=arguments[1];return t.startsWith("/infra/public")&&(arguments[1]=e+t),/^\/([^\/]*)\/public/.test(t)&&(arguments[1]=e+t),t.startsWith("/assets")&&(arguments[1]=e+t),t=="/conf/public"&&(arguments[1]=t),t.startsWith("http")&&(arguments[1]=t),this.baseOpen.apply(this,arguments)})}toAxiosConfig(e){if(e){const t=Object.assign({},this.axios.defaults);return e.headers&&(t.headers=Object.assign({},this.axios.defaults.headers),Object.assign(t.headers,e.headers)),e.responseType&&(t.responseType=e.responseType),e.queryParams&&(t.params=Object.assign({},e.queryParams)),t}else return this.axios.defaults}toCdnUrl(e){const t=this.context.conf().getCdnUrl()||"";if(t.length>0&&e!=="/conf/public"){const r=""+e;(r.startsWith("/infra/public")||r.startsWith("/assets")||/^\/([^\/]*)\/public/.test(r))&&(e=t+r)}return e}mapAxiosError(e,t){return console.error("[HttpService]",e),e.response?this._latestResponse=e.response:e.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!t||t.disableNotifications,this._latestResponse}mapAxiosResponse(e,t){return this._latestResponse=e,e.data}get latestResponse(){return this._latestResponse}async get(e,t){try{const r=await this.axios.get(this.toCdnUrl(e),this.toAxiosConfig(t));return this.mapAxiosResponse(r,t)}catch(r){return this.mapAxiosError(r,t)}}async post(e,t,r){try{const i=await this.axios.post(e,t,this.toAxiosConfig(r));return this.mapAxiosResponse(i,r)}catch(i){return this.mapAxiosError(i,r)}}async postFile(e,t,r){const i=this.toAxiosConfig(r);i.headers&&i.headers["Content-Type"]&&delete i.headers["Content-Type"];try{const s=await this.axios.post(e,t,{...i,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(s,r)}catch(s){return this.mapAxiosError(s,r)}}async postJson(e,t,r){const i=this.toAxiosConfig();i.headers&&(i.headers["Content-Type"]="application/json");try{const s=await this.axios.post(e,t,this.toAxiosConfig(r));return this.mapAxiosResponse(s,r)}catch(s){return this.mapAxiosError(s,r)}}async put(e,t,r){try{const i=await this.axios.put(e,t,this.toAxiosConfig(r));return this.mapAxiosResponse(i,r)}catch(i){return this.mapAxiosError(i,r)}}async putFile(e,t,r){try{const i=this.toAxiosConfig(r);i.headers&&i.headers["Content-Type"]&&delete i.headers["Content-Type"];const s=await this.axios.put(e,t,{...i,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(s,r)}catch(i){return this.mapAxiosError(i,r)}}async putJson(e,t,r){const i=this.toAxiosConfig(r);i.headers&&(i.headers["Content-Type"]="application/json");try{const s=await this.axios.put(e,t,i);return this.mapAxiosResponse(s,r)}catch(s){return this.mapAxiosError(s,r)}}async delete(e,t){try{const r=await this.axios.delete(e,this.toAxiosConfig(t));return this.mapAxiosResponse(r,t)}catch(r){return this.mapAxiosError(r,t)}}async deleteJson(e,t){try{const r=await this.axios.delete(e,{data:t});return this.mapAxiosResponse(r)}catch(r){return this.mapAxiosError(r)}}getScript(e,t,r){const i=r??"exports",s=this.toAxiosConfig(t);return s.headers&&(s.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(e),s).then(o=>this.mapAxiosResponse(o,t)).then(o=>{try{const u=`"use strict";var ${i.split(".")[0]}={};${o};return ${i};`;return Function(u)()}catch{return o}}).catch(o=>{throw this.mapAxiosError(o,t),o})}loadScript(e,t){return loadedScripts[e]?Promise.resolve():this.getScript(e,t).then(r=>{loadedScripts[e]=!0})}}class RightService{constructor(e){this.context=e}get session(){return this.context.session()}parseResourceRight(e){const t=e.split(":");if(t.length===2){if(t[0]==="creator")return{id:t[1],right:"creator",type:"creator"}}else return t.length===3?{id:t[1],right:t[2],type:t[0]}:void 0}parseResourceRights(e){return e.map(r=>this.parseResourceRight(r)).filter(r=>r!==void 0)}hasResourceRight({id:e,groupIds:t},r,i){const s=i.map(o=>typeof o=="string"?this.parseResourceRight(o):o).filter(o=>o!==void 0);for(const o of s){if(o.id===e&&o.type==="creator")return!0;if(o.id===e&&o.type==="user"&&o.right===r)return!0;if(t.includes(o.id)&&o.type==="group"&&o.right===r)return!0}return!1}async sessionHasResourceRight(e,t){try{const r=await this.session.getUser();return!!r&&this.hasResourceRight({groupIds:r.groupsIds,id:r.userId},e,t)}catch(r){return console.error(r),!1}}async sessionHasAtLeastOneResourceRight(e,t){for(const r of e)if(await this.sessionHasResourceRight(r,t))return!0;return!1}async sessionHasResourceRightForEachList(e,t){let r=0;for(const i of t)await this.sessionHasResourceRight(e,i)&&r++;return r===t.length}async sessionHasAtLeastOneResourceRightForEachList(e,t){for(const r of e){let i=0;for(const s of t)await this.sessionHasResourceRight(r,s)&&i++;if(i===t.length)return!0}return!1}hasWorkflowRight(e,t){return t.findIndex(r=>r===e)!==-1}async sessionHasWorkflowRight(e){try{const t=await this.session.getUser();return!!t&&this.hasWorkflowRight(e,t.authorizedActions.map(r=>r.name))}catch(t){return console.error(t),!1}}async sessionHasWorkflowRights(e){const t={};try{const r=await this.session.getUser();for(const i of e)t[i]=!!r&&this.hasWorkflowRight(i,r.authorizedActions.map(s=>s.name))}catch(r){console.error(r);for(const i of e)t[i]=!1}return t}}class SessionService{constructor(e){this.context=e}get http(){return this.context.http()}get cache(){return this.context.cache()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const e=await this.getUser(),[t,r,i,s,o]=await Promise.all([this.getCurrentLanguage(e),this.latestQuotaAndUsage(e),this.loadDescription(e),this.getUserProfile(),this.getBookmarks(e)]);return{user:e,quotaAndUsage:r,currentLanguage:t,userDescription:i,userProfile:s,bookmarkedApps:o}}login(e,t,r,i){const s=new FormData;return s.append("email",e),s.append("password",t),typeof r<"u"&&s.append("rememberMe",""+r),typeof i<"u"&&s.append("secureLocation",""+i),this.http.post("/auth/login",s,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return this.http.get("/auth/logout").finally(()=>{})}async latestQuotaAndUsage(e){try{return await this.http.get(`/workspace/quota/user/${e==null?void 0:e.userId}`)}catch(t){return console.error(t),{quota:0,storage:0}}}async getCurrentLanguage(e){const t=(e==null?void 0:e.sessionMetadata)&&(e==null?void 0:e.sessionMetadata.userId);try{let r;return t?r=await this.loadUserLanguage():r=await this.loadDefaultLanguage(),r}catch(r){console.error(r)}}async loadUserLanguage(){try{const e=await this.http.get("/userbook/preference/language");return JSON.parse(e.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:e,value:t}=await this.cache.httpGet("/auth/oauth2/userinfo");if(e.status<200||e.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return t}hasWorkflow({workflowName:e,user:t}){return e===void 0||(t==null?void 0:t.authorizedActions.findIndex(r=>r.name===e))!==-1}async loadDescription(e){try{const[t,r]=await Promise.all([this.getUserProfile({requestName:"refreshAvatar"}),this.http.get("/directory/userbook/"+(e==null?void 0:e.userId))]);return{...t,...r}}catch(t){return console.error(t),{}}}async getBookmarks(e){const t=await this.http.get("/userbook/preference/apps");t.preference||(t.preference=null);const r=JSON.parse(t.preference);let i;i=r,i||(i={bookmarks:[],applications:[]});let s=[];return i.bookmarks.forEach((o,u)=>{const c=e==null?void 0:e.apps.find(a=>a.name===o);if(c){let a=Object.assign({},c);s.push(a)}}),s}async getUserProfile(e){const{response:t,value:r}=await this.cache.httpGet("/userbook/api/person",e);if(t.status<200||t.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return r.result[0].type}async isAdml(){const e=await this.getUser();return(e==null?void 0:e.functions.ADMIN_LOCAL)!==void 0}}class StringUtils{static removeAccents(e){for(var t=0;t<defaultDiacriticsRemovalMap$1.length;t++)e=e.replace(defaultDiacriticsRemovalMap$1[t].letters,defaultDiacriticsRemovalMap$1[t].base);return e}}class ShareService{constructor(e){this.context=e}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(e,t,r){const i=StringUtils.removeAccents(r).toLowerCase(),s=await this.cache.httpGetJson(`/${e}/share/json/${t}?search=${r}`),o=s.users.visibles.filter(({username:l,firstName:p,lastName:d,login:f})=>{const m=StringUtils.removeAccents(d||"").toLowerCase(),h=StringUtils.removeAccents(p||"").toLowerCase(),v=StringUtils.removeAccents(l||"").toLowerCase(),g=StringUtils.removeAccents(f||"").toLowerCase();return v.includes(i)||h.includes(i)||m.includes(i)||g.includes(i)}).map(l=>({avatarUrl:this.directory.getAvatarUrl(l.id,"user"),directoryUrl:this.directory.getDirectoryUrl(l.id,"user"),displayName:l.username,id:l.id,profile:l.profile,type:"user"})),u=s.groups.visibles.filter(({name:l})=>StringUtils.removeAccents(l||"").toLowerCase().includes(i)).map(l=>({avatarUrl:this.directory.getAvatarUrl(l.id,"group"),directoryUrl:this.directory.getDirectoryUrl(l.id,"group"),displayName:l.name,id:l.id,type:"group"}));return[...(await this.directory.getBookMarks()).filter(({displayName:l})=>StringUtils.removeAccents(l||"").toLowerCase().includes(i)).map(l=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:l.displayName,id:l.id,type:"sharebookmark"})),...o,...u]}async getShareMapping(e){const t=await this.cache.httpGetJson(`/${e}/rights/sharing`);for(const r of Object.keys(t))if(r.includes(".")){const i=r.split(".")[1],s=t[r];delete t[r],t[i]=s}return t}getActionsAvailableFor({id:e,type:t},r,i){const o=(t==="user"?r.users.checked[e]:r.groups.checked[e])||[],u=Object.keys(i),c=[];for(const a of u)i[a].filter(d=>o.includes(d)).length>0&&c.push(a);return c}async getRightsForResource(e,t){const r=await this.directory.getBookMarks(),i=this.context.resource(e,e).getShareReadUrl(t),s=await this.cache.httpGetJson(i),o=await this.getShareMapping(e),u=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),c=Object.keys(s.users.checked).map(f=>s.users.visibles.find(h=>h.id===f)).filter(f=>f!==void 0).map(f=>{const m=this.getActionsAvailableFor({id:f.id,type:"user"},s,o);return{id:f.id,type:"user",displayName:f.username,profile:f.profile,avatarUrl:this.directory.getAvatarUrl(f.id,"user"),directoryUrl:this.directory.getDirectoryUrl(f.id,"user"),actions:m.map(v=>{const g=u[v];return{displayName:v,id:v,priority:g.priority}})}}).sort((f,m)=>(f.displayName||"").localeCompare(m.displayName)),a=Object.keys(s.groups.checked).map(f=>s.groups.visibles.find(h=>h.id===f)).filter(f=>f!==void 0).map(f=>{const m=this.getActionsAvailableFor({id:f.id,type:"group"},s,o);return{id:f.id,type:"group",displayName:f.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(f.id,"group"),directoryUrl:this.directory.getDirectoryUrl(f.id,"group"),actions:m.map(v=>{const g=u[v];return{displayName:v,id:v,priority:g.priority}})}}).sort((f,m)=>(f.displayName||"").localeCompare(m.displayName)),l=[...c,...a],p=s.groups.visibles.map(({groupDisplayName:f,id:m,name:h})=>({displayName:f||h,id:m})),d=s.users.visibles.map(({id:f,profile:m,username:h,firstName:v,lastName:g,login:b})=>({displayName:h,firstName:v,lastName:g,login:b,profile:m,id:f}));return{rights:l,visibleBookmarks:r,visibleGroups:p,visibleUsers:d}}async saveRights(e,t,r){const i=await this.getShareMapping(e),s={bookmarks:{},groups:{},users:{}};for(const a of r){const l=a.actions.map(d=>i[d.id]).reduce((d,f)=>[...d,...f],[]),p=[...new Set(l)];p.length>0&&(a.type==="user"?s.users[a.id]=p:a.type==="group"?s.groups[a.id]=p:s.bookmarks[a.id]=p)}const o=this.context.resource(e,e),u=o.getSaveShareUrl(t);return this.cache.clearCache(o.getShareReadUrl(t)),await this.http.putJson(u,s)}async getActionsForApp(e){const t=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),r=await this.getShareMapping(e);return Object.keys(t).map(s=>{const o=t[s];return{displayName:s,id:s,priority:o.priority,requires:o.requires}}).filter(s=>{var o;return((o=r[s.id])==null?void 0:o.length)>0}).sort((s,o)=>s.priority-o.priority)}}const S=class S{constructor(){E(this,"wordExtensions",new Set);E(this,"excelExtensions",new Set);E(this,"pptExtensions",new Set);E(this,"fileExtensionMap",new Map);E(this,"csvContentType",new Set);E(this,"csvExtensions",new Set);E(this,"txtExtensions",new Set);E(this,"PDF","application/pdf");E(this,"OCTET_STREAM","application/octet-stream");this.txtExtensions.add("txt"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(e){if(this.fileExtensionMap.has(e))return this.fileExtensionMap.get(e)}getExtensionForContentType(e){for(const t of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(t)||"").toLowerCase()==(e||"").toLowerCase())return t;return null}isWordLike(e,t){const r=this.getExtensionForContentType(e);return r?this.wordExtensions.has(r):e==this.OCTET_STREAM&&t?this.wordExtensions.has(t):!1}isExcelLike(e,t){const r=this.getExtensionForContentType(e);return r?this.excelExtensions.has(r):e==this.OCTET_STREAM&&t?this.excelExtensions.has(t):!1}isCsvLike(e,t){return this.csvContentType.has(e)?!0:e==this.OCTET_STREAM&&t?this.csvExtensions.has(t):!1}isPowerpointLike(e,t){const r=this.getExtensionForContentType(e);return r?this.pptExtensions.has(r):e==this.OCTET_STREAM&&t?this.pptExtensions.has(t):!1}isTxtLike(e,t){const r=this.getExtensionForContentType(e);return r?this.txtExtensions.has(r):e==this.OCTET_STREAM&&t?this.txtExtensions.has(t):!1}};E(S,"INSTANCE",new S);let MimeTypeUtils=S;class FileTypeUtils{static registerContentTypeToFileType(e){this.fileTypes.push(e)}static getFileType(e,t=!1,r){if(r&&(r=r.trim()),!e)return"unknown";this.fileTypes||console.warn("[Element.role] should not have emptyRoles",this);for(let s of this.fileTypes||[]){const o=s(e,t);if(o)return o}const i={csv:function(s){return!!MimeTypeUtils.INSTANCE.isCsvLike(s,r)},doc:function(s){return MimeTypeUtils.INSTANCE.isWordLike(s,r)?!0:s.indexOf("document")!==-1&&s.indexOf("wordprocessing")!==-1},xls:function(s){return MimeTypeUtils.INSTANCE.isExcelLike(s,r)?!0:s.indexOf("document")!==-1&&s.indexOf("spreadsheet")!==-1||s.indexOf("ms-excel")!==-1},img:function(s){return s.indexOf("image")!==-1},pdf:function(s){return s.indexOf("pdf")!==-1||s==="application/x-download"},ppt:function(s){return MimeTypeUtils.INSTANCE.isPowerpointLike(s,r)?!0:s.indexOf("document")!==-1&&s.indexOf("presentation")!==-1||s.indexOf("powerpoint")!==-1},txt:function(s){return MimeTypeUtils.INSTANCE.isTxtLike(s,r)},video:function(s){return s.indexOf("video")!==-1},audio:function(s){return s.indexOf("audio")!==-1},zip:function(s){return s.indexOf("zip")!==-1||s.indexOf("rar")!==-1||s.indexOf("tar")!==-1||s.indexOf("7z")!==-1}};for(let s in i)if(i[s](e))return s;return"unknown"}}E(FileTypeUtils,"fileTypes",[]);class WorkspaceService{constructor(e){this.context=e}get http(){return this.context.http()}async saveFile(e,t){const r=e.name||"",i=r.split("."),s=e.type||"application/octet-stream",o=i.length>1?i[i.length-1]:"",u={size:e.size,extension:o,role:FileTypeUtils.getFileType(s,!1,o)},c=r.replace("."+u.extension,""),a=u.extension?c+"."+u.extension:c,l=new FormData;l.append("file",e,a);const p=[];return((t==null?void 0:t.visibility)==="public"||(t==null?void 0:t.visibility)==="protected")&&p.push(`${t.visibility}=true`),t!=null&&t.application&&p.push(`application=${t.application}`),u.role==="img"&&p.push("quality=1"),t!=null&&t.parentId&&p.push(`parentId=${t.parentId}`),await this.http.postFile(`/workspace/document?${p.join("&")}`,l)}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(e){this.context=e}get http(){return this.context.http()}async getIdiom(e,t){await Promise.all([this.addBundlePromise(e,"/i18n"),this.addBundlePromise(e,`/${t}/i18n`)])}translate(e,t){e=e??"";let r=bundle[e]===void 0?e:bundle[e];if(t&&typeof t=="object")for(let i in t)typeof t[i]<"u"&&(r=r.replace(new RegExp("\\${"+i+"}","g"),""+t[i]));return r}addBundlePromise(e,t){return this.loadBundlePromise(e,t)}addBundle(e,t,r){this.loadBundle(e,t,r)}loadBundlePromise(e,t){return this.loadBundle(e,t),promises[t]}loadBundle(e,t,r){const i=promises[t];if(i)r&&i.then(r).catch(r);else{const s=new Promisified;promises[t]=s.promise;const o={};e&&(o["Accept-Language"]=e),this.http.get(t,{headers:o}).then(u=>{Object.assign(bundle,u),typeof r=="function"&&r(),s.resolve()}).catch(u=>{typeof r=="function"&&r(),s.reject()})}}addTranslations(e,t){notify.onLangReady().promise.then(r=>{this.loadBundle(r,e+"/"+r+".json",t)})}addAllTranslations(e){return e&&e.length>0?notify.onLangReady().promise.then(t=>Promise.all(e.map(r=>this.loadBundlePromise(t,r+"/"+t+".json")))).then(()=>{}):Promise.reject()}addKeys(e){for(var t in e)typeof bundle[t]!="string"&&(bundle[t]=e[t])}removeAccents(e){for(var t=0;t<defaultDiacriticsRemovalMap.length;t++)e=e.replace(defaultDiacriticsRemovalMap[t].letters,defaultDiacriticsRemovalMap[t].base);return e}}let ATTag;class AnalyticsService{constructor(n){this.context=n}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(n,e){const[t]=await Promise.all([this.getXitiConfig(e.name.toLowerCase()),this.loadXitiScript()]);if(!t||!ATInternet)return;let r=t.LIBELLE_SERVICE.default||null;for(let i in t.LIBELLE_SERVICE)if(i!=="default"&&n.indexOf(i)>=0){r=t.LIBELLE_SERVICE[i];break}ATTag=new ATInternet.Tracker.Tag({site:t.STRUCT_ID}),ATTag.setProps({SERVICE:r,TYPE:t.TYPE,OUTIL:t.OUTIL,UAI:t.STRUCT_UAI,PROJET:t.PROJET,EXPLOITANT:t.EXPLOITANT,PLATEFORME:t.PLATFORME,PROFIL:t.PROFILE},!0),ATTag.identifiedVisitor.set({id:t.ID_PERSO,category:t.PROFILE}),ATTag.page.set({name:(e==null?void 0:e.prefix)==="userbook"?"directory":e==null?void 0:e.prefix,chapter1:"",chapter2:"",chapter3:"",level2:t.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(n){const[e,t]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(e!=null&&e.type))throw ERROR_CODE.MALFORMED_DATA;return t!=null&&t.active&&(e.xiti=await this.getXitiTrackingParams(t,n)),e.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(n,e){if(!n.structureMap||!e)return;const t=await this.session.getUser(),r=await this.session.getUserProfile();let i;if(!(t!=null&&t.structures))return;for(let a of t.structures){const l=n.structureMap[a];if(l&&l.collectiviteId&&l.UAI){i=l;break}}if(!i||!i.active)return;const s=await configure.Platform.apps.getPublicConf(e);if(!s)return;const o=s.xiti;if(!o||!o.LIBELLE_SERVICE||!i.UAI)return;function u(a){let l="";for(let p=0;p<a.length;p++)l+=a.charCodeAt(p);return l}const c={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:o.LIBELLE_SERVICE,TYPE:o.OUTIL?"TIERS":"NATIF",OUTIL:o.OUTIL?o.OUTIL:"",STRUCT_ID:i.collectiviteId,STRUCT_UAI:i.UAI,PROJET:i.projetId?i.projetId:n.ID_PROJET,EXPLOITANT:n.ID_EXPLOITANT,PLATFORME:i.plateformeId?i.plateformeId:n.ID_PLATEFORME,ID_PERSO:u(t.userId),PROFILE:r&&r.length>0?c[r[0]]??"":""}}}class OdeServices{constructor(){E(this,"_analytics");E(this,"_cache");E(this,"_conf");E(this,"_directory");E(this,"_http");E(this,"_idiom");E(this,"_rights");E(this,"_session");E(this,"_share");E(this,"_workspace");this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._workspace=new WorkspaceService(this)}analytics(){return this._analytics}cache(){return this._cache}conf(){return this._conf}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}resource(e,t){return t?ResourceService.findService({application:e,resourceType:t},this):ResourceService.findMainService({application:e},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}workspace(){return this._workspace}}const odeServices=new OdeServices;typeof window<"u"&&(window.entcore=window.entcore??{},window.entcore["ode-ts-client"]=window.entcore["ode-ts-client"]??exports??(module==null?void 0:module.exports)),exports.ACTION=ACTION,exports.APP=APP,exports.BOOLEAN_FILTER=BOOLEAN_FILTER,exports.ConfigurationFrameworkFactory=ConfigurationFrameworkFactory,exports.ERROR_CODE=ERROR_CODE,exports.EVENT_NAME=EVENT_NAME,exports.FOLDER=FOLDER,exports.ITimelineFactory=ITimelineFactory,exports.LAYER_NAME=LAYER_NAME,exports.LastInfosWidget=LastInfosWidget,exports.NotifyFrameworkFactory=NotifyFrameworkFactory,exports.PROP_FORMAT=PROP_FORMAT,exports.PROP_KEY=PROP_KEY,exports.PROP_MODE=PROP_MODE,exports.PROP_TYPE=PROP_TYPE,exports.RESOURCE=RESOURCE,exports.RxJS=index,exports.SORT_BY=SORT_BY,exports.SORT_ORDER=SORT_ORDER,exports.STRING_FILTER=STRING_FILTER,exports.SessionFrameworkFactory=SessionFrameworkFactory,exports.TransportFrameworkFactory=TransportFrameworkFactory,exports.USER_PREFS=USER_PREFS,exports.WIDGET_NAME=WIDGET_NAME,exports.WIDGET_POSITION=WIDGET_POSITION,exports.WidgetFrameworkFactory=WidgetFrameworkFactory,exports.appNameForResource=appNameForResource,exports.odeServices=odeServices,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
16
+ `):"",this.name="UnsubscriptionError",this.errors=t}});function arrRemove(n,e){if(n){var t=n.indexOf(e);0<=t&&n.splice(t,1)}}var Subscription=function(){function n(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._teardowns=null}return n.prototype.unsubscribe=function(){var e,t,r,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var u=__values(o),c=u.next();!c.done;c=u.next()){var a=c.value;a.remove(this)}}catch(h){e={error:h}}finally{try{c&&!c.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else o.remove(this);var l=this.initialTeardown;if(isFunction$1(l))try{l()}catch(h){s=h instanceof UnsubscriptionError?h.errors:[h]}var p=this._teardowns;if(p){this._teardowns=null;try{for(var d=__values(p),f=d.next();!f.done;f=d.next()){var m=f.value;try{execTeardown(m)}catch(h){s=s??[],h instanceof UnsubscriptionError?s=__spreadArray(__spreadArray([],__read(s)),__read(h.errors)):s.push(h)}}}catch(h){r={error:h}}finally{try{f&&!f.done&&(i=d.return)&&i.call(d)}finally{if(r)throw r.error}}}if(s)throw new UnsubscriptionError(s)}},n.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)execTeardown(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._teardowns=(t=this._teardowns)!==null&&t!==void 0?t:[]).push(e)}},n.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},n.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},n.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&arrRemove(t,e)},n.prototype.remove=function(e){var t=this._teardowns;t&&arrRemove(t,e),e instanceof n&&e._removeParent(this)},n.EMPTY=function(){var e=new n;return e.closed=!0,e}(),n}(),EMPTY_SUBSCRIPTION=Subscription.EMPTY;function isSubscription(n){return n instanceof Subscription||n&&"closed"in n&&isFunction$1(n.remove)&&isFunction$1(n.add)&&isFunction$1(n.unsubscribe)}function execTeardown(n){isFunction$1(n)?n():n.unsubscribe()}var config={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},timeoutProvider={setTimeout:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return setTimeout.apply(void 0,__spreadArray([],__read(n)))},clearTimeout:function(n){return clearTimeout(n)},delegate:void 0};function reportUnhandledError(n){timeoutProvider.setTimeout(function(){var e=config.onUnhandledError;if(e)e(n);else throw n})}function noop(){}var COMPLETE_NOTIFICATION=function(){return createNotification("C",void 0,void 0)}();function errorNotification(n){return createNotification("E",void 0,n)}function nextNotification(n){return createNotification("N",n,void 0)}function createNotification(n,e,t){return{kind:n,value:e,error:t}}var context=null;function errorContext(n){if(config.useDeprecatedSynchronousErrorHandling){var e=!context;if(e&&(context={errorThrown:!1,error:null}),n(),e){var t=context,r=t.errorThrown,i=t.error;if(context=null,r)throw i}}else n()}function captureError(n){config.useDeprecatedSynchronousErrorHandling&&context&&(context.errorThrown=!0,context.error=n)}var Subscriber=function(n){__extends(e,n);function e(t){var r=n.call(this)||this;return r.isStopped=!1,t?(r.destination=t,isSubscription(t)&&t.add(r)):r.destination=EMPTY_OBSERVER,r}return e.create=function(t,r,i){return new SafeSubscriber(t,r,i)},e.prototype.next=function(t){this.isStopped?handleStoppedNotification(nextNotification(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?handleStoppedNotification(errorNotification(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?handleStoppedNotification(COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,n.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Subscription),SafeSubscriber=function(n){__extends(e,n);function e(t,r,i){var s=n.call(this)||this,o;if(isFunction$1(t))o=t;else if(t){o=t.next,r=t.error,i=t.complete;var u;s&&config.useDeprecatedNextContext?(u=Object.create(t),u.unsubscribe=function(){return s.unsubscribe()}):u=t,o=o==null?void 0:o.bind(u),r=r==null?void 0:r.bind(u),i=i==null?void 0:i.bind(u)}return s.destination={next:o?wrapForErrorHandling(o):noop,error:wrapForErrorHandling(r??defaultErrorHandler),complete:i?wrapForErrorHandling(i):noop},s}return e}(Subscriber);function wrapForErrorHandling(n,e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{n.apply(void 0,__spreadArray([],__read(t)))}catch(i){config.useDeprecatedSynchronousErrorHandling?captureError(i):reportUnhandledError(i)}}}function defaultErrorHandler(n){throw n}function handleStoppedNotification(n,e){var t=config.onStoppedNotification;t&&timeoutProvider.setTimeout(function(){return t(n,e)})}var EMPTY_OBSERVER={closed:!0,next:noop,error:defaultErrorHandler,complete:noop},observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function identity(n){return n}function pipe(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return pipeFromArray(n)}function pipeFromArray(n){return n.length===0?identity:n.length===1?n[0]:function(t){return n.reduce(function(r,i){return i(r)},t)}}var Observable=function(){function n(e){e&&(this._subscribe=e)}return n.prototype.lift=function(e){var t=new n;return t.source=this,t.operator=e,t},n.prototype.subscribe=function(e,t,r){var i=this,s=isSubscriber(e)?e:new SafeSubscriber(e,t,r);return errorContext(function(){var o=i,u=o.operator,c=o.source;s.add(u?u.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},n.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},n.prototype.forEach=function(e,t){var r=this;return t=getPromiseCtor(t),new t(function(i,s){var o;o=r.subscribe(function(u){try{e(u)}catch(c){s(c),o==null||o.unsubscribe()}},s,i)})},n.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},n.prototype[observable]=function(){return this},n.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return pipeFromArray(e)(this)},n.prototype.toPromise=function(e){var t=this;return e=getPromiseCtor(e),new e(function(r,i){var s;t.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},n.create=function(e){return new n(e)},n}();function getPromiseCtor(n){var e;return(e=n??config.Promise)!==null&&e!==void 0?e:Promise}function isObserver(n){return n&&isFunction$1(n.next)&&isFunction$1(n.error)&&isFunction$1(n.complete)}function isSubscriber(n){return n&&n instanceof Subscriber||isObserver(n)&&isSubscription(n)}function hasLift(n){return isFunction$1(n==null?void 0:n.lift)}function operate(n){return function(e){if(hasLift(e))return e.lift(function(t){try{return n(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}var OperatorSubscriber=function(n){__extends(e,n);function e(t,r,i,s,o){var u=n.call(this,t)||this;return u.onFinalize=o,u._next=r?function(c){try{r(c)}catch(a){t.error(a)}}:n.prototype._next,u._error=s?function(c){try{s(c)}catch(a){t.error(a)}finally{this.unsubscribe()}}:n.prototype._error,u._complete=i?function(){try{i()}catch(c){t.error(c)}finally{this.unsubscribe()}}:n.prototype._complete,u}return e.prototype.unsubscribe=function(){var t,r=this.closed;n.prototype.unsubscribe.call(this),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))},e}(Subscriber);function refCount(){return operate(function(n,e){var t=null;n._refCount++;var r=new OperatorSubscriber(e,void 0,void 0,void 0,function(){if(!n||n._refCount<=0||0<--n._refCount){t=null;return}var i=n._connection,s=t;t=null,i&&(!s||i===s)&&i.unsubscribe(),e.unsubscribe()});n.subscribe(r),r.closed||(t=n.connect())})}var ConnectableObservable=function(n){__extends(e,n);function e(t,r){var i=n.call(this)||this;return i.source=t,i.subjectFactory=r,i._subject=null,i._refCount=0,i._connection=null,hasLift(t)&&(i.lift=t.lift),i}return e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return(!t||t.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,t==null||t.unsubscribe()},e.prototype.connect=function(){var t=this,r=this._connection;if(!r){r=this._connection=new Subscription;var i=this.getSubject();r.add(this.source.subscribe(new OperatorSubscriber(i,void 0,function(){t._teardown(),i.complete()},function(s){t._teardown(),i.error(s)},function(){return t._teardown()}))),r.closed&&(this._connection=null,r=Subscription.EMPTY)}return r},e.prototype.refCount=function(){return refCount()(this)},e}(Observable),performanceTimestampProvider={now:function(){return(performanceTimestampProvider.delegate||performance).now()},delegate:void 0},animationFrameProvider={schedule:function(n){var e=requestAnimationFrame,t=cancelAnimationFrame,r=e(function(i){t=void 0,n(i)});return new Subscription(function(){return t==null?void 0:t(r)})},requestAnimationFrame:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return requestAnimationFrame.apply(void 0,__spreadArray([],__read(n)))},cancelAnimationFrame:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return cancelAnimationFrame.apply(void 0,__spreadArray([],__read(n)))},delegate:void 0};function animationFrames(n){return n?animationFramesFactory(n):DEFAULT_ANIMATION_FRAMES}function animationFramesFactory(n){var e=animationFrameProvider.schedule;return new Observable(function(t){var r=new Subscription,i=n||performanceTimestampProvider,s=i.now(),o=function(u){var c=i.now();t.next({timestamp:n?c:u,elapsed:c-s}),t.closed||r.add(e(o))};return r.add(e(o)),r})}var DEFAULT_ANIMATION_FRAMES=animationFramesFactory(),ObjectUnsubscribedError=createErrorClass(function(n){return function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Subject=function(n){__extends(e,n);function e(){var t=n.call(this)||this;return t.closed=!1,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var r=new AnonymousSubject(this,this);return r.operator=t,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new ObjectUnsubscribedError},e.prototype.next=function(t){var r=this;errorContext(function(){var i,s;if(r._throwIfClosed(),!r.isStopped){var o=r.observers.slice();try{for(var u=__values(o),c=u.next();!c.done;c=u.next()){var a=c.value;a.next(t)}}catch(l){i={error:l}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(i)throw i.error}}}})},e.prototype.error=function(t){var r=this;errorContext(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var i=r.observers;i.length;)i.shift().error(t)}})},e.prototype.complete=function(){var t=this;errorContext(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var r=t.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),n.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var r=this,i=r.hasError,s=r.isStopped,o=r.observers;return i||s?EMPTY_SUBSCRIPTION:(o.push(t),new Subscription(function(){return arrRemove(o,t)}))},e.prototype._checkFinalizedStatuses=function(t){var r=this,i=r.hasError,s=r.thrownError,o=r.isStopped;i?t.error(s):o&&t.complete()},e.prototype.asObservable=function(){var t=new Observable;return t.source=this,t},e.create=function(t,r){return new AnonymousSubject(t,r)},e}(Observable),AnonymousSubject=function(n){__extends(e,n);function e(t,r){var i=n.call(this)||this;return i.destination=t,i.source=r,i}return e.prototype.next=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,t)},e.prototype.error=function(t){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,t)},e.prototype.complete=function(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)},e.prototype._subscribe=function(t){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&i!==void 0?i:EMPTY_SUBSCRIPTION},e}(Subject),BehaviorSubject=function(n){__extends(e,n);function e(t){var r=n.call(this)||this;return r._value=t,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(t){var r=n.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},e.prototype.getValue=function(){var t=this,r=t.hasError,i=t.thrownError,s=t._value;if(r)throw i;return this._throwIfClosed(),s},e.prototype.next=function(t){n.prototype.next.call(this,this._value=t)},e}(Subject),dateTimestampProvider={now:function(){return(dateTimestampProvider.delegate||Date).now()},delegate:void 0},ReplaySubject=function(n){__extends(e,n);function e(t,r,i){t===void 0&&(t=1/0),r===void 0&&(r=1/0),i===void 0&&(i=dateTimestampProvider);var s=n.call(this)||this;return s._bufferSize=t,s._windowTime=r,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=r===1/0,s._bufferSize=Math.max(1,t),s._windowTime=Math.max(1,r),s}return e.prototype.next=function(t){var r=this,i=r.isStopped,s=r._buffer,o=r._infiniteTimeWindow,u=r._timestampProvider,c=r._windowTime;i||(s.push(t),!o&&s.push(u.now()+c)),this._trimBuffer(),n.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(t),i=this,s=i._infiniteTimeWindow,o=i._buffer,u=o.slice(),c=0;c<u.length&&!t.closed;c+=s?1:2)t.next(u[c]);return this._checkFinalizedStatuses(t),r},e.prototype._trimBuffer=function(){var t=this,r=t._bufferSize,i=t._timestampProvider,s=t._buffer,o=t._infiniteTimeWindow,u=(o?1:2)*r;if(r<1/0&&u<s.length&&s.splice(0,s.length-u),!o){for(var c=i.now(),a=0,l=1;l<s.length&&s[l]<=c;l+=2)a=l;a&&s.splice(0,a+1)}},e}(Subject),AsyncSubject=function(n){__extends(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}return e.prototype._checkFinalizedStatuses=function(t){var r=this,i=r.hasError,s=r._hasValue,o=r._value,u=r.thrownError,c=r.isStopped,a=r._isComplete;i?t.error(u):(c||a)&&(s&&t.next(o),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var t=this,r=t._hasValue,i=t._value,s=t._isComplete;s||(this._isComplete=!0,r&&n.prototype.next.call(this,i),n.prototype.complete.call(this))},e}(Subject),Action=function(n){__extends(e,n);function e(t,r){return n.call(this)||this}return e.prototype.schedule=function(t,r){return this},e}(Subscription),intervalProvider={setInterval:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return setInterval.apply(void 0,__spreadArray([],__read(n)))},clearInterval:function(n){return clearInterval(n)},delegate:void 0},AsyncAction=function(n){__extends(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(t,r){if(r===void 0&&(r=0),this.closed)return this;this.state=t;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,r)),this.pending=!0,this.delay=r,this.id=this.id||this.requestAsyncId(s,this.id,r),this},e.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),intervalProvider.setInterval(t.flush.bind(t,this),i)},e.prototype.recycleAsyncId=function(t,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;intervalProvider.clearInterval(r)},e.prototype.execute=function(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(t,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,r){var i=!1,s;try{this.work(t)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,r=t.id,i=t.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,arrRemove(s,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,n.prototype.unsubscribe.call(this)}},e}(Action),nextHandle=1,resolved,activeHandles={};function findAndClearHandle(n){return n in activeHandles?(delete activeHandles[n],!0):!1}var Immediate={setImmediate:function(n){var e=nextHandle++;return activeHandles[e]=!0,resolved||(resolved=Promise.resolve()),resolved.then(function(){return findAndClearHandle(e)&&n()}),e},clearImmediate:function(n){findAndClearHandle(n)}},setImmediate=Immediate.setImmediate,clearImmediate=Immediate.clearImmediate,immediateProvider={setImmediate:function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return setImmediate.apply(void 0,__spreadArray([],__read(n)))},clearImmediate:function(n){return clearImmediate(n)},delegate:void 0},AsapAction=function(n){__extends(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.scheduler=t,i.work=r,i}return e.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),i!==null&&i>0?n.prototype.requestAsyncId.call(this,t,r,i):(t.actions.push(this),t._scheduled||(t._scheduled=immediateProvider.setImmediate(t.flush.bind(t,void 0))))},e.prototype.recycleAsyncId=function(t,r,i){if(i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0)return n.prototype.recycleAsyncId.call(this,t,r,i);t.actions.length===0&&(immediateProvider.clearImmediate(r),t._scheduled=void 0)},e}(AsyncAction),Scheduler=function(){function n(e,t){t===void 0&&(t=n.now),this.schedulerActionCtor=e,this.now=t}return n.prototype.schedule=function(e,t,r){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},n.now=dateTimestampProvider.now,n}(),AsyncScheduler=function(n){__extends(e,n);function e(t,r){r===void 0&&(r=Scheduler.now);var i=n.call(this,t,r)||this;return i.actions=[],i._active=!1,i._scheduled=void 0,i}return e.prototype.flush=function(t){var r=this.actions;if(this._active){r.push(t);return}var i;this._active=!0;do if(i=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,i){for(;t=r.shift();)t.unsubscribe();throw i}},e}(Scheduler),AsapScheduler=function(n){__extends(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0,this._scheduled=void 0;var r=this.actions,i,s=-1;t=t||r.shift();var o=r.length;do if(i=t.execute(t.state,t.delay))break;while(++s<o&&(t=r.shift()));if(this._active=!1,i){for(;++s<o&&(t=r.shift());)t.unsubscribe();throw i}},e}(AsyncScheduler),asapScheduler=new AsapScheduler(AsapAction),asap=asapScheduler,asyncScheduler=new AsyncScheduler(AsyncAction),async=asyncScheduler,QueueAction=function(n){__extends(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.scheduler=t,i.work=r,i}return e.prototype.schedule=function(t,r){return r===void 0&&(r=0),r>0?n.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},e.prototype.execute=function(t,r){return r>0||this.closed?n.prototype.execute.call(this,t,r):this._execute(t,r)},e.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0?n.prototype.requestAsyncId.call(this,t,r,i):t.flush(this)},e}(AsyncAction),QueueScheduler=function(n){__extends(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e}(AsyncScheduler),queueScheduler=new QueueScheduler(QueueAction),queue=queueScheduler,AnimationFrameAction=function(n){__extends(e,n);function e(t,r){var i=n.call(this,t,r)||this;return i.scheduler=t,i.work=r,i}return e.prototype.requestAsyncId=function(t,r,i){return i===void 0&&(i=0),i!==null&&i>0?n.prototype.requestAsyncId.call(this,t,r,i):(t.actions.push(this),t._scheduled||(t._scheduled=animationFrameProvider.requestAnimationFrame(function(){return t.flush(void 0)})))},e.prototype.recycleAsyncId=function(t,r,i){if(i===void 0&&(i=0),i!=null&&i>0||i==null&&this.delay>0)return n.prototype.recycleAsyncId.call(this,t,r,i);t.actions.length===0&&(animationFrameProvider.cancelAnimationFrame(r),t._scheduled=void 0)},e}(AsyncAction),AnimationFrameScheduler=function(n){__extends(e,n);function e(){return n!==null&&n.apply(this,arguments)||this}return e.prototype.flush=function(t){this._active=!0,this._scheduled=void 0;var r=this.actions,i,s=-1;t=t||r.shift();var o=r.length;do if(i=t.execute(t.state,t.delay))break;while(++s<o&&(t=r.shift()));if(this._active=!1,i){for(;++s<o&&(t=r.shift());)t.unsubscribe();throw i}},e}(AsyncScheduler),animationFrameScheduler=new AnimationFrameScheduler(AnimationFrameAction),animationFrame=animationFrameScheduler,VirtualTimeScheduler=function(n){__extends(e,n);function e(t,r){t===void 0&&(t=VirtualAction),r===void 0&&(r=1/0);var i=n.call(this,t,function(){return i.frame})||this;return i.maxFrames=r,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var t=this,r=t.actions,i=t.maxFrames,s,o;(o=r[0])&&o.delay<=i&&(r.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=r.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(AsyncScheduler),VirtualAction=function(n){__extends(e,n);function e(t,r,i){i===void 0&&(i=t.index+=1);var s=n.call(this,t,r)||this;return s.scheduler=t,s.work=r,s.index=i,s.active=!0,s.index=t.index=i,s}return e.prototype.schedule=function(t,r){if(r===void 0&&(r=0),Number.isFinite(r)){if(!this.id)return n.prototype.schedule.call(this,t,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(t,r)}else return Subscription.EMPTY},e.prototype.requestAsyncId=function(t,r,i){i===void 0&&(i=0),this.delay=t.frame+i;var s=t.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,r,i){},e.prototype._execute=function(t,r){if(this.active===!0)return n.prototype._execute.call(this,t,r)},e.sortActions=function(t,r){return t.delay===r.delay?t.index===r.index?0:t.index>r.index?1:-1:t.delay>r.delay?1:-1},e}(AsyncAction),EMPTY=new Observable(function(n){return n.complete()});function empty(n){return n?emptyScheduled(n):EMPTY}function emptyScheduled(n){return new Observable(function(e){return n.schedule(function(){return e.complete()})})}function scheduleArray(n,e){return new Observable(function(t){var r=0;return e.schedule(function(){r===n.length?t.complete():(t.next(n[r++]),t.closed||this.schedule())})})}var isArrayLike=function(n){return n&&typeof n.length=="number"&&typeof n!="function"};function isPromise(n){return isFunction$1(n==null?void 0:n.then)}function scheduleObservable(n,e){return new Observable(function(t){var r=new Subscription;return r.add(e.schedule(function(){var i=n[observable]();r.add(i.subscribe({next:function(s){r.add(e.schedule(function(){return t.next(s)}))},error:function(s){r.add(e.schedule(function(){return t.error(s)}))},complete:function(){r.add(e.schedule(function(){return t.complete()}))}}))})),r})}function schedulePromise(n,e){return new Observable(function(t){return e.schedule(function(){return n.then(function(r){t.add(e.schedule(function(){t.next(r),t.add(e.schedule(function(){return t.complete()}))}))},function(r){t.add(e.schedule(function(){return t.error(r)}))})})})}function getSymbolIterator(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var iterator=getSymbolIterator();function caughtSchedule(n,e,t,r){r===void 0&&(r=0);var i=e.schedule(function(){try{t.call(this)}catch(s){n.error(s)}},r);return n.add(i),i}function scheduleIterable(n,e){return new Observable(function(t){var r;return t.add(e.schedule(function(){r=n[iterator](),caughtSchedule(t,e,function(){var i=r.next(),s=i.value,o=i.done;o?t.complete():(t.next(s),this.schedule())})})),function(){return isFunction$1(r==null?void 0:r.return)&&r.return()}})}function scheduleAsyncIterable(n,e){if(!n)throw new Error("Iterable cannot be null");return new Observable(function(t){var r=new Subscription;return r.add(e.schedule(function(){var i=n[Symbol.asyncIterator]();r.add(e.schedule(function(){var s=this;i.next().then(function(o){o.done?t.complete():(t.next(o.value),s.schedule())})}))})),r})}function isInteropObservable(n){return isFunction$1(n[observable])}function isIterable(n){return isFunction$1(n==null?void 0:n[iterator])}function isAsyncIterable(n){return Symbol.asyncIterator&&isFunction$1(n==null?void 0:n[Symbol.asyncIterator])}function createInvalidObservableTypeError(n){return new TypeError("You provided "+(n!==null&&typeof n=="object"?"an invalid object":"'"+n+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function readableStreamLikeToAsyncGenerator(n){return __asyncGenerator(this,arguments,function(){var t,r,i,s;return __generator(this,function(o){switch(o.label){case 0:t=n.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,__await(t.read())];case 3:return r=o.sent(),i=r.value,s=r.done,s?[4,__await(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,__await(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function isReadableStreamLike(n){return isFunction$1(n==null?void 0:n.getReader)}function scheduleReadableStreamLike(n,e){return scheduleAsyncIterable(readableStreamLikeToAsyncGenerator(n),e)}function scheduled(n,e){if(n!=null){if(isInteropObservable(n))return scheduleObservable(n,e);if(isArrayLike(n))return scheduleArray(n,e);if(isPromise(n))return schedulePromise(n,e);if(isAsyncIterable(n))return scheduleAsyncIterable(n,e);if(isIterable(n))return scheduleIterable(n,e);if(isReadableStreamLike(n))return scheduleReadableStreamLike(n,e)}throw createInvalidObservableTypeError(n)}function from(n,e){return e?scheduled(n,e):innerFrom(n)}function innerFrom(n){if(n instanceof Observable)return n;if(n!=null){if(isInteropObservable(n))return fromInteropObservable(n);if(isArrayLike(n))return fromArrayLike(n);if(isPromise(n))return fromPromise(n);if(isAsyncIterable(n))return fromAsyncIterable(n);if(isIterable(n))return fromIterable(n);if(isReadableStreamLike(n))return fromReadableStreamLike(n)}throw createInvalidObservableTypeError(n)}function fromInteropObservable(n){return new Observable(function(e){var t=n[observable]();if(isFunction$1(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function fromArrayLike(n){return new Observable(function(e){for(var t=0;t<n.length&&!e.closed;t++)e.next(n[t]);e.complete()})}function fromPromise(n){return new Observable(function(e){n.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,reportUnhandledError)})}function fromIterable(n){return new Observable(function(e){var t,r;try{for(var i=__values(n),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(u){t={error:u}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}e.complete()})}function fromAsyncIterable(n){return new Observable(function(e){process$1(n,e).catch(function(t){return e.error(t)})})}function fromReadableStreamLike(n){return fromAsyncIterable(readableStreamLikeToAsyncGenerator(n))}function process$1(n,e){var t,r,i,s;return __awaiter(this,void 0,void 0,function(){var o,u;return __generator(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=__asyncValues(n),c.label=1;case 1:return[4,t.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return u=c.sent(),i={error:u},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=t.return)?[4,s.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function internalFromArray(n,e){return e?scheduleArray(n,e):fromArrayLike(n)}function isScheduler(n){return n&&isFunction$1(n.schedule)}function last$1(n){return n[n.length-1]}function popResultSelector(n){return isFunction$1(last$1(n))?n.pop():void 0}function popScheduler(n){return isScheduler(last$1(n))?n.pop():void 0}function popNumber(n,e){return typeof last$1(n)=="number"?n.pop():e}function of(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n);return t?scheduleArray(n,t):internalFromArray(n)}function throwError(n,e){var t=isFunction$1(n)?n:function(){return n},r=function(i){return i.error(t())};return new Observable(e?function(i){return e.schedule(r,0,i)}:r)}var NotificationKind;(function(n){n.NEXT="N",n.ERROR="E",n.COMPLETE="C"})(NotificationKind||(NotificationKind={}));var Notification$1=function(){function n(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue=e==="N"}return n.prototype.observe=function(e){return observeNotification(this,e)},n.prototype.do=function(e,t,r){var i=this,s=i.kind,o=i.value,u=i.error;return s==="N"?e==null?void 0:e(o):s==="E"?t==null?void 0:t(u):r==null?void 0:r()},n.prototype.accept=function(e,t,r){var i;return isFunction$1((i=e)===null||i===void 0?void 0:i.next)?this.observe(e):this.do(e,t,r)},n.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,i=e.error,s=t==="N"?of(r):t==="E"?throwError(function(){return i}):t==="C"?EMPTY:0;if(!s)throw new TypeError("Unexpected notification kind "+t);return s},n.createNext=function(e){return new n("N",e)},n.createError=function(e){return new n("E",void 0,e)},n.createComplete=function(){return n.completeNotification},n.completeNotification=new n("C"),n}();function observeNotification(n,e){var t,r,i,s=n,o=s.kind,u=s.value,c=s.error;if(typeof o!="string")throw new TypeError('Invalid notification, missing "kind"');o==="N"?(t=e.next)===null||t===void 0||t.call(e,u):o==="E"?(r=e.error)===null||r===void 0||r.call(e,c):(i=e.complete)===null||i===void 0||i.call(e)}function isObservable(n){return!!n&&(n instanceof Observable||isFunction$1(n.lift)&&isFunction$1(n.subscribe))}var EmptyError=createErrorClass(function(n){return function(){n(this),this.name="EmptyError",this.message="no elements in sequence"}});function lastValueFrom(n,e){var t=typeof e=="object";return new Promise(function(r,i){var s=!1,o;n.subscribe({next:function(u){o=u,s=!0},error:i,complete:function(){s?r(o):t?r(e.defaultValue):i(new EmptyError)}})})}function firstValueFrom(n,e){var t=typeof e=="object";return new Promise(function(r,i){var s=new SafeSubscriber({next:function(o){r(o),s.unsubscribe()},error:i,complete:function(){t?r(e.defaultValue):i(new EmptyError)}});n.subscribe(s)})}var ArgumentOutOfRangeError=createErrorClass(function(n){return function(){n(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}}),NotFoundError=createErrorClass(function(n){return function(t){n(this),this.name="NotFoundError",this.message=t}}),SequenceError=createErrorClass(function(n){return function(t){n(this),this.name="SequenceError",this.message=t}});function isValidDate(n){return n instanceof Date&&!isNaN(n)}var TimeoutError=createErrorClass(function(n){return function(t){t===void 0&&(t=null),n(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}});function timeout(n,e){var t=isValidDate(n)?{first:n}:typeof n=="number"?{each:n}:n,r=t.first,i=t.each,s=t.with,o=s===void 0?timeoutErrorFactory:s,u=t.scheduler,c=u===void 0?e??asyncScheduler:u,a=t.meta,l=a===void 0?null:a;if(r==null&&i==null)throw new TypeError("No timeout provided.");return operate(function(p,d){var f,m,h=null,E=0,g=function(b){m=caughtSchedule(d,c,function(){f.unsubscribe(),innerFrom(o({meta:l,lastValue:h,seen:E})).subscribe(d)},b)};f=p.subscribe(new OperatorSubscriber(d,function(b){m==null||m.unsubscribe(),E++,d.next(h=b),i>0&&g(i)},void 0,void 0,function(){m!=null&&m.closed||m==null||m.unsubscribe(),h=null})),g(r!=null?typeof r=="number"?r:+r-c.now():i)})}function timeoutErrorFactory(n){throw new TimeoutError(n)}function subscribeOn(n,e){return e===void 0&&(e=0),operate(function(t,r){r.add(n.schedule(function(){return t.subscribe(r)},e))})}function map(n,e){return operate(function(t,r){var i=0;t.subscribe(new OperatorSubscriber(r,function(s){r.next(n.call(e,s,i++))}))})}var isArray$3=Array.isArray;function callOrApply(n,e){return isArray$3(e)?n.apply(void 0,__spreadArray([],__read(e))):n(e)}function mapOneOrManyArgs(n){return map(function(e){return callOrApply(n,e)})}function observeOn(n,e){return e===void 0&&(e=0),operate(function(t,r){t.subscribe(new OperatorSubscriber(r,function(i){return r.add(n.schedule(function(){return r.next(i)},e))},function(){return r.add(n.schedule(function(){return r.complete()},e))},function(i){return r.add(n.schedule(function(){return r.error(i)},e))}))})}function bindCallbackInternals(n,e,t,r){if(t)if(isScheduler(t))r=t;else return function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return bindCallbackInternals(n,e,r).apply(this,i).pipe(mapOneOrManyArgs(t))};return r?function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return bindCallbackInternals(n,e).apply(this,i).pipe(subscribeOn(r),observeOn(r))}:function(){for(var i=this,s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var u=new AsyncSubject,c=!0;return new Observable(function(a){var l=u.subscribe(a);if(c){c=!1;var p=!1,d=!1;e.apply(i,__spreadArray(__spreadArray([],__read(s)),[function(){for(var f=[],m=0;m<arguments.length;m++)f[m]=arguments[m];if(n){var h=f.shift();if(h!=null){u.error(h);return}}u.next(1<f.length?f:f[0]),d=!0,p&&u.complete()}])),d&&u.complete(),p=!0}return l})}}function bindCallback(n,e,t){return bindCallbackInternals(!1,n,e,t)}function bindNodeCallback(n,e,t){return bindCallbackInternals(!0,n,e,t)}var isArray$2=Array.isArray,getPrototypeOf=Object.getPrototypeOf,objectProto=Object.prototype,getKeys=Object.keys;function argsArgArrayOrObject(n){if(n.length===1){var e=n[0];if(isArray$2(e))return{args:e,keys:null};if(isPOJO(e)){var t=getKeys(e);return{args:t.map(function(r){return e[r]}),keys:t}}}return{args:n,keys:null}}function isPOJO(n){return n&&typeof n=="object"&&getPrototypeOf(n)===objectProto}function createObject(n,e){return n.reduce(function(t,r,i){return t[r]=e[i],t},{})}function combineLatest$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n),r=popResultSelector(n),i=argsArgArrayOrObject(n),s=i.args,o=i.keys;if(s.length===0)return from([],t);var u=new Observable(combineLatestInit(s,t,o?function(c){return createObject(o,c)}:identity));return r?u.pipe(mapOneOrManyArgs(r)):u}function combineLatestInit(n,e,t){return t===void 0&&(t=identity),function(r){maybeSchedule(e,function(){for(var i=n.length,s=new Array(i),o=i,u=i,c=function(l){maybeSchedule(e,function(){var p=from(n[l],e),d=!1;p.subscribe(new OperatorSubscriber(r,function(f){s[l]=f,d||(d=!0,u--),u||r.next(t(s.slice()))},function(){--o||r.complete()}))},r)},a=0;a<i;a++)c(a)},r)}}function maybeSchedule(n,e,t){n?t.add(n.schedule(e)):e()}function mergeInternals(n,e,t,r,i,s,o,u){var c=[],a=0,l=0,p=!1,d=function(){p&&!c.length&&!a&&e.complete()},f=function(h){return a<r?m(h):c.push(h)},m=function(h){s&&e.next(h),a++;var E=!1;innerFrom(t(h,l++)).subscribe(new OperatorSubscriber(e,function(g){i==null||i(g),s?f(g):e.next(g)},function(){E=!0},void 0,function(){if(E)try{a--;for(var g=function(){var b=c.shift();o?e.add(o.schedule(function(){return m(b)})):m(b)};c.length&&a<r;)g();d()}catch(b){e.error(b)}}))};return n.subscribe(new OperatorSubscriber(e,f,function(){p=!0,d()})),function(){u==null||u()}}function mergeMap(n,e,t){return t===void 0&&(t=1/0),isFunction$1(e)?mergeMap(function(r,i){return map(function(s,o){return e(r,s,i,o)})(innerFrom(n(r,i)))},t):(typeof e=="number"&&(t=e),operate(function(r,i){return mergeInternals(r,i,n,t)}))}function mergeAll(n){return n===void 0&&(n=1/0),mergeMap(identity,n)}function concatAll(){return mergeAll(1)}function concat$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return concatAll()(internalFromArray(n,popScheduler(n)))}function defer(n){return new Observable(function(e){innerFrom(n()).subscribe(e)})}var DEFAULT_CONFIG$1={connector:function(){return new Subject},resetOnDisconnect:!0};function connectable(n,e){e===void 0&&(e=DEFAULT_CONFIG$1);var t=null,r=e.connector,i=e.resetOnDisconnect,s=i===void 0?!0:i,o=r(),u=new Observable(function(c){return o.subscribe(c)});return u.connect=function(){return(!t||t.closed)&&(t=defer(function(){return n}).subscribe(o),s&&t.add(function(){return o=r()})),t},u}function forkJoin(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popResultSelector(n),r=argsArgArrayOrObject(n),i=r.args,s=r.keys,o=new Observable(function(u){var c=i.length;if(!c){u.complete();return}for(var a=new Array(c),l=c,p=c,d=function(m){var h=!1;innerFrom(i[m]).subscribe(new OperatorSubscriber(u,function(E){h||(h=!0,p--),a[m]=E},function(){(!--l||!h)&&(p||u.next(s?createObject(s,a):a),u.complete())}))},f=0;f<c;f++)d(f)});return t?o.pipe(mapOneOrManyArgs(t)):o}var nodeEventEmitterMethods=["addListener","removeListener"],eventTargetMethods=["addEventListener","removeEventListener"],jqueryMethods=["on","off"];function fromEvent(n,e,t,r){if(isFunction$1(t)&&(r=t,t=void 0),r)return fromEvent(n,e,t).pipe(mapOneOrManyArgs(r));var i=__read(isEventTarget(n)?eventTargetMethods.map(function(u){return function(c){return n[u](e,c,t)}}):isNodeStyleEventEmitter(n)?nodeEventEmitterMethods.map(toCommonHandlerRegistry(n,e)):isJQueryStyleEventEmitter(n)?jqueryMethods.map(toCommonHandlerRegistry(n,e)):[],2),s=i[0],o=i[1];if(!s&&isArrayLike(n))return mergeMap(function(u){return fromEvent(u,e,t)})(internalFromArray(n));if(!s)throw new TypeError("Invalid event target");return new Observable(function(u){var c=function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return u.next(1<a.length?a:a[0])};return s(c),function(){return o(c)}})}function toCommonHandlerRegistry(n,e){return function(t){return function(r){return n[t](e,r)}}}function isNodeStyleEventEmitter(n){return isFunction$1(n.addListener)&&isFunction$1(n.removeListener)}function isJQueryStyleEventEmitter(n){return isFunction$1(n.on)&&isFunction$1(n.off)}function isEventTarget(n){return isFunction$1(n.addEventListener)&&isFunction$1(n.removeEventListener)}function fromEventPattern(n,e,t){return t?fromEventPattern(n,e).pipe(mapOneOrManyArgs(t)):new Observable(function(r){var i=function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];return r.next(o.length===1?o[0]:o)},s=n(i);return isFunction$1(e)?function(){return e(i,s)}:void 0})}function generate(n,e,t,r,i){var s,o,u,c;arguments.length===1?(s=n,c=s.initialState,e=s.condition,t=s.iterate,o=s.resultSelector,u=o===void 0?identity:o,i=s.scheduler):(c=n,!r||isScheduler(r)?(u=identity,i=r):u=r);function a(){var l;return __generator(this,function(p){switch(p.label){case 0:l=c,p.label=1;case 1:return!e||e(l)?[4,u(l)]:[3,4];case 2:p.sent(),p.label=3;case 3:return l=t(l),[3,1];case 4:return[2]}})}return defer(i?function(){return scheduleIterable(a(),i)}:a)}function iif(n,e,t){return defer(function(){return n()?e:t})}function timer(n,e,t){n===void 0&&(n=0),t===void 0&&(t=async);var r=-1;return e!=null&&(isScheduler(e)?t=e:r=e),new Observable(function(i){var s=isValidDate(n)?+n-t.now():n;s<0&&(s=0);var o=0;return t.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},s)})}function interval(n,e){return n===void 0&&(n=0),e===void 0&&(e=asyncScheduler),n<0&&(n=0),timer(n,n,e)}function merge$2(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n),r=popNumber(n,1/0),i=n;return i.length?i.length===1?innerFrom(i[0]):mergeAll(r)(internalFromArray(i,t)):EMPTY}var NEVER=new Observable(noop);function never(){return NEVER}var isArray$1=Array.isArray;function argsOrArgArray(n){return n.length===1&&isArray$1(n[0])?n[0]:n}function onErrorResumeNext$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=argsOrArgArray(n);return operate(function(r,i){var s=__spreadArray([r],__read(t)),o=function(){if(!i.closed)if(s.length>0){var u=void 0;try{u=innerFrom(s.shift())}catch{o();return}var c=new OperatorSubscriber(i,void 0,noop,noop);i.add(u.subscribe(c)),c.add(o)}else i.complete()};o()})}function onErrorResumeNext(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return onErrorResumeNext$1(argsOrArgArray(n))(EMPTY)}function pairs(n,e){return from(Object.entries(n),e)}function not(n,e){return function(t,r){return!n.call(e,t,r)}}function filter(n,e){return operate(function(t,r){var i=0;t.subscribe(new OperatorSubscriber(r,function(s){return n.call(e,s,i++)&&r.next(s)}))})}function partition(n,e,t){return[filter(e,t)(innerFrom(n)),filter(not(e,t))(innerFrom(n))]}function race(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n=argsOrArgArray(n),n.length===1?innerFrom(n[0]):new Observable(raceInit(n))}function raceInit(n){return function(e){for(var t=[],r=function(s){t.push(innerFrom(n[s]).subscribe(new OperatorSubscriber(e,function(o){if(t){for(var u=0;u<t.length;u++)u!==s&&t[u].unsubscribe();t=null}e.next(o)})))},i=0;t&&!e.closed&&i<n.length;i++)r(i)}}function range(n,e,t){if(e==null&&(e=n,n=0),e<=0)return EMPTY;var r=e+n;return new Observable(t?function(i){var s=n;return t.schedule(function(){s<r?(i.next(s++),this.schedule()):i.complete()})}:function(i){for(var s=n;s<r&&!i.closed;)i.next(s++);i.complete()})}function using(n,e){return new Observable(function(t){var r=n(),i=e(r),s=i?innerFrom(i):EMPTY;return s.subscribe(t),function(){r&&r.unsubscribe()}})}function zip$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popResultSelector(n),r=argsOrArgArray(n);return r.length?new Observable(function(i){var s=r.map(function(){return[]}),o=r.map(function(){return!1});i.add(function(){s=o=null});for(var u=function(a){innerFrom(r[a]).subscribe(new OperatorSubscriber(i,function(l){if(s[a].push(l),s.every(function(d){return d.length})){var p=s.map(function(d){return d.shift()});i.next(t?t.apply(void 0,__spreadArray([],__read(p))):p),s.some(function(d,f){return!d.length&&o[f]})&&i.complete()}},function(){o[a]=!0,!s[a].length&&i.complete()}))},c=0;!i.closed&&c<r.length;c++)u(c);return function(){s=o=null}}):EMPTY}function audit(n){return operate(function(e,t){var r=!1,i=null,s=null,o=!1,u=function(){if(s==null||s.unsubscribe(),s=null,r){r=!1;var a=i;i=null,t.next(a)}o&&t.complete()},c=function(){s=null,o&&t.complete()};e.subscribe(new OperatorSubscriber(t,function(a){r=!0,i=a,s||innerFrom(n(a)).subscribe(s=new OperatorSubscriber(t,u,c))},function(){o=!0,(!r||!s||s.closed)&&t.complete()}))})}function auditTime(n,e){return e===void 0&&(e=async),audit(function(){return timer(n,e)})}function buffer(n){return operate(function(e,t){var r=[];return e.subscribe(new OperatorSubscriber(t,function(i){return r.push(i)},function(){t.next(r),t.complete()})),n.subscribe(new OperatorSubscriber(t,function(){var i=r;r=[],t.next(i)},noop)),function(){r=null}})}function bufferCount(n,e){return e===void 0&&(e=null),e=e??n,operate(function(t,r){var i=[],s=0;t.subscribe(new OperatorSubscriber(r,function(o){var u,c,a,l,p=null;s++%e===0&&i.push([]);try{for(var d=__values(i),f=d.next();!f.done;f=d.next()){var m=f.value;m.push(o),n<=m.length&&(p=p??[],p.push(m))}}catch(g){u={error:g}}finally{try{f&&!f.done&&(c=d.return)&&c.call(d)}finally{if(u)throw u.error}}if(p)try{for(var h=__values(p),E=h.next();!E.done;E=h.next()){var m=E.value;arrRemove(i,m),r.next(m)}}catch(g){a={error:g}}finally{try{E&&!E.done&&(l=h.return)&&l.call(h)}finally{if(a)throw a.error}}},function(){var o,u;try{for(var c=__values(i),a=c.next();!a.done;a=c.next()){var l=a.value;r.next(l)}}catch(p){o={error:p}}finally{try{a&&!a.done&&(u=c.return)&&u.call(c)}finally{if(o)throw o.error}}r.complete()},void 0,function(){i=null}))})}function bufferTime(n){for(var e,t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s=(e=popScheduler(r))!==null&&e!==void 0?e:asyncScheduler,o=(t=r[0])!==null&&t!==void 0?t:null,u=r[1]||1/0;return operate(function(c,a){var l=[],p=!1,d=function(h){var E=h.buffer,g=h.subs;g.unsubscribe(),arrRemove(l,h),a.next(E),p&&f()},f=function(){if(l){var h=new Subscription;a.add(h);var E=[],g={buffer:E,subs:h};l.push(g),h.add(s.schedule(function(){return d(g)},n))}};o!==null&&o>=0?a.add(s.schedule(function(){f(),!this.closed&&a.add(this.schedule(null,o))},o)):p=!0,f();var m=new OperatorSubscriber(a,function(h){var E,g,b=l.slice();try{for(var x=__values(b),y=x.next();!y.done;y=x.next()){var w=y.value,F=w.buffer;F.push(h),u<=F.length&&d(w)}}catch(R){E={error:R}}finally{try{y&&!y.done&&(g=x.return)&&g.call(x)}finally{if(E)throw E.error}}},function(){for(;l!=null&&l.length;)a.next(l.shift().buffer);m==null||m.unsubscribe(),a.complete(),a.unsubscribe()},void 0,function(){return l=null});c.subscribe(m)})}function bufferToggle(n,e){return operate(function(t,r){var i=[];innerFrom(n).subscribe(new OperatorSubscriber(r,function(s){var o=[];i.push(o);var u=new Subscription,c=function(){arrRemove(i,o),r.next(o),u.unsubscribe()};u.add(innerFrom(e(s)).subscribe(new OperatorSubscriber(r,c,noop)))},noop)),t.subscribe(new OperatorSubscriber(r,function(s){var o,u;try{for(var c=__values(i),a=c.next();!a.done;a=c.next()){var l=a.value;l.push(s)}}catch(p){o={error:p}}finally{try{a&&!a.done&&(u=c.return)&&u.call(c)}finally{if(o)throw o.error}}},function(){for(;i.length>0;)r.next(i.shift());r.complete()}))})}function bufferWhen(n){return operate(function(e,t){var r=null,i=null,s=function(){i==null||i.unsubscribe();var o=r;r=[],o&&t.next(o),innerFrom(n()).subscribe(i=new OperatorSubscriber(t,s,noop))};s(),e.subscribe(new OperatorSubscriber(t,function(o){return r==null?void 0:r.push(o)},function(){r&&t.next(r),t.complete()},void 0,function(){return r=i=null}))})}function catchError(n){return operate(function(e,t){var r=null,i=!1,s;r=e.subscribe(new OperatorSubscriber(t,void 0,void 0,function(o){s=innerFrom(n(o,catchError(n)(e))),r?(r.unsubscribe(),r=null,s.subscribe(t)):i=!0})),i&&(r.unsubscribe(),r=null,s.subscribe(t))})}function scanInternals(n,e,t,r,i){return function(s,o){var u=t,c=e,a=0;s.subscribe(new OperatorSubscriber(o,function(l){var p=a++;c=u?n(c,l,p):(u=!0,l),r&&o.next(c)},i&&function(){u&&o.next(c),o.complete()}))}}function reduce(n,e){return operate(scanInternals(n,e,arguments.length>=2,!1,!0))}var arrReducer=function(n,e){return n.push(e),n};function toArray(){return operate(function(n,e){reduce(arrReducer,[])(n).subscribe(e)})}function joinAllInternals(n,e){return pipe(toArray(),mergeMap(function(t){return n(t)}),e?mapOneOrManyArgs(e):identity)}function combineLatestAll(n){return joinAllInternals(combineLatest$1,n)}var combineAll=combineLatestAll;function combineLatest(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popResultSelector(n);return t?pipe(combineLatest.apply(void 0,__spreadArray([],__read(n))),mapOneOrManyArgs(t)):operate(function(r,i){combineLatestInit(__spreadArray([r],__read(argsOrArgArray(n))))(i)})}function combineLatestWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return combineLatest.apply(void 0,__spreadArray([],__read(n)))}function concatMap(n,e){return isFunction$1(e)?mergeMap(n,e,1):mergeMap(n,1)}function concatMapTo(n,e){return isFunction$1(e)?concatMap(function(){return n},e):concatMap(function(){return n})}function concat(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n);return operate(function(r,i){concatAll()(internalFromArray(__spreadArray([r],__read(n)),t)).subscribe(i)})}function concatWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return concat.apply(void 0,__spreadArray([],__read(n)))}function fromSubscribable(n){return new Observable(function(e){return n.subscribe(e)})}var DEFAULT_CONFIG={connector:function(){return new Subject}};function connect(n,e){e===void 0&&(e=DEFAULT_CONFIG);var t=e.connector;return operate(function(r,i){var s=t();from(n(fromSubscribable(s))).subscribe(i),i.add(r.subscribe(s))})}function count(n){return reduce(function(e,t,r){return!n||n(t,r)?e+1:e},0)}function debounce(n){return operate(function(e,t){var r=!1,i=null,s=null,o=function(){if(s==null||s.unsubscribe(),s=null,r){r=!1;var u=i;i=null,t.next(u)}};e.subscribe(new OperatorSubscriber(t,function(u){s==null||s.unsubscribe(),r=!0,i=u,s=new OperatorSubscriber(t,o,noop),innerFrom(n(u)).subscribe(s)},function(){o(),t.complete()},void 0,function(){i=s=null}))})}function debounceTime(n,e){return e===void 0&&(e=asyncScheduler),operate(function(t,r){var i=null,s=null,o=null,u=function(){if(i){i.unsubscribe(),i=null;var a=s;s=null,r.next(a)}};function c(){var a=o+n,l=e.now();if(l<a){i=this.schedule(void 0,a-l),r.add(i);return}u()}t.subscribe(new OperatorSubscriber(r,function(a){s=a,o=e.now(),i||(i=e.schedule(c,n),r.add(i))},function(){u(),r.complete()},void 0,function(){s=i=null}))})}function defaultIfEmpty(n){return operate(function(e,t){var r=!1;e.subscribe(new OperatorSubscriber(t,function(i){r=!0,t.next(i)},function(){r||t.next(n),t.complete()}))})}function take(n){return n<=0?function(){return EMPTY}:operate(function(e,t){var r=0;e.subscribe(new OperatorSubscriber(t,function(i){++r<=n&&(t.next(i),n<=r&&t.complete())}))})}function ignoreElements(){return operate(function(n,e){n.subscribe(new OperatorSubscriber(e,noop))})}function mapTo(n){return map(function(){return n})}function delayWhen(n,e){return e?function(t){return concat$1(e.pipe(take(1),ignoreElements()),t.pipe(delayWhen(n)))}:mergeMap(function(t,r){return n(t,r).pipe(take(1),mapTo(t))})}function delay(n,e){e===void 0&&(e=asyncScheduler);var t=timer(n,e);return delayWhen(function(){return t})}function dematerialize(){return operate(function(n,e){n.subscribe(new OperatorSubscriber(e,function(t){return observeNotification(t,e)}))})}function distinct(n,e){return operate(function(t,r){var i=new Set;t.subscribe(new OperatorSubscriber(r,function(s){var o=n?n(s):s;i.has(o)||(i.add(o),r.next(s))})),e==null||e.subscribe(new OperatorSubscriber(r,function(){return i.clear()},noop))})}function distinctUntilChanged(n,e){return e===void 0&&(e=identity),n=n??defaultCompare,operate(function(t,r){var i,s=!0;t.subscribe(new OperatorSubscriber(r,function(o){var u=e(o);(s||!n(i,u))&&(s=!1,i=u,r.next(o))}))})}function defaultCompare(n,e){return n===e}function distinctUntilKeyChanged(n,e){return distinctUntilChanged(function(t,r){return e?e(t[n],r[n]):t[n]===r[n]})}function throwIfEmpty(n){return n===void 0&&(n=defaultErrorFactory),operate(function(e,t){var r=!1;e.subscribe(new OperatorSubscriber(t,function(i){r=!0,t.next(i)},function(){return r?t.complete():t.error(n())}))})}function defaultErrorFactory(){return new EmptyError}function elementAt(n,e){if(n<0)throw new ArgumentOutOfRangeError;var t=arguments.length>=2;return function(r){return r.pipe(filter(function(i,s){return s===n}),take(1),t?defaultIfEmpty(e):throwIfEmpty(function(){return new ArgumentOutOfRangeError}))}}function endWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return function(t){return concat$1(t,of.apply(void 0,__spreadArray([],__read(n))))}}function every(n,e){return operate(function(t,r){var i=0;t.subscribe(new OperatorSubscriber(r,function(s){n.call(e,s,i++,t)||(r.next(!1),r.complete())},function(){r.next(!0),r.complete()}))})}function exhaustAll(){return operate(function(n,e){var t=!1,r=null;n.subscribe(new OperatorSubscriber(e,function(i){r||(r=innerFrom(i).subscribe(new OperatorSubscriber(e,void 0,function(){r=null,t&&e.complete()})))},function(){t=!0,!r&&e.complete()}))})}var exhaust=exhaustAll;function exhaustMap(n,e){return e?function(t){return t.pipe(exhaustMap(function(r,i){return innerFrom(n(r,i)).pipe(map(function(s,o){return e(r,s,i,o)}))}))}:operate(function(t,r){var i=0,s=null,o=!1;t.subscribe(new OperatorSubscriber(r,function(u){s||(s=new OperatorSubscriber(r,void 0,function(){s=null,o&&r.complete()}),innerFrom(n(u,i++)).subscribe(s))},function(){o=!0,!s&&r.complete()}))})}function expand(n,e,t){return e===void 0&&(e=1/0),e=(e||0)<1?1/0:e,operate(function(r,i){return mergeInternals(r,i,n,e,void 0,!0,t)})}function finalize(n){return operate(function(e,t){try{e.subscribe(t)}finally{t.add(n)}})}function find(n,e){return operate(createFind(n,e,"value"))}function createFind(n,e,t){var r=t==="index";return function(i,s){var o=0;i.subscribe(new OperatorSubscriber(s,function(u){var c=o++;n.call(e,u,c,i)&&(s.next(r?c:u),s.complete())},function(){s.next(r?-1:void 0),s.complete()}))}}function findIndex(n,e){return operate(createFind(n,e,"index"))}function first(n,e){var t=arguments.length>=2;return function(r){return r.pipe(n?filter(function(i,s){return n(i,s,r)}):identity,take(1),t?defaultIfEmpty(e):throwIfEmpty(function(){return new EmptyError}))}}function groupBy(n,e,t,r){return operate(function(i,s){var o;!e||typeof e=="function"?o=e:(t=e.duration,o=e.element,r=e.connector);var u=new Map,c=function(d){u.forEach(d),d(s)},a=function(d){return c(function(f){return f.error(d)})},l=new GroupBySubscriber(s,function(d){try{var f=n(d),m=u.get(f);if(!m){u.set(f,m=r?r():new Subject);var h=p(f,m);if(s.next(h),t){var E=new OperatorSubscriber(m,function(){m.complete(),E==null||E.unsubscribe()},void 0,void 0,function(){return u.delete(f)});l.add(innerFrom(t(h)).subscribe(E))}}m.next(o?o(d):d)}catch(g){a(g)}},function(){return c(function(d){return d.complete()})},a,function(){return u.clear()});i.subscribe(l);function p(d,f){var m=new Observable(function(h){l.activeGroups++;var E=f.subscribe(h);return function(){E.unsubscribe(),--l.activeGroups===0&&l.teardownAttempted&&l.unsubscribe()}});return m.key=d,m}})}var GroupBySubscriber=function(n){__extends(e,n);function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.activeGroups=0,t.teardownAttempted=!1,t}return e.prototype.unsubscribe=function(){this.teardownAttempted=!0,this.activeGroups===0&&n.prototype.unsubscribe.call(this)},e}(OperatorSubscriber);function isEmpty(){return operate(function(n,e){n.subscribe(new OperatorSubscriber(e,function(){e.next(!1),e.complete()},function(){e.next(!0),e.complete()}))})}function takeLast(n){return n<=0?function(){return EMPTY}:operate(function(e,t){var r=[];e.subscribe(new OperatorSubscriber(t,function(i){r.push(i),n<r.length&&r.shift()},function(){var i,s;try{for(var o=__values(r),u=o.next();!u.done;u=o.next()){var c=u.value;t.next(c)}}catch(a){i={error:a}}finally{try{u&&!u.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}t.complete()},void 0,function(){r=null}))})}function last(n,e){var t=arguments.length>=2;return function(r){return r.pipe(n?filter(function(i,s){return n(i,s,r)}):identity,takeLast(1),t?defaultIfEmpty(e):throwIfEmpty(function(){return new EmptyError}))}}function materialize(){return operate(function(n,e){n.subscribe(new OperatorSubscriber(e,function(t){e.next(Notification$1.createNext(t))},function(){e.next(Notification$1.createComplete()),e.complete()},function(t){e.next(Notification$1.createError(t)),e.complete()}))})}function max(n){return reduce(isFunction$1(n)?function(e,t){return n(e,t)>0?e:t}:function(e,t){return e>t?e:t})}var flatMap=mergeMap;function mergeMapTo(n,e,t){return t===void 0&&(t=1/0),isFunction$1(e)?mergeMap(function(){return n},e,t):(typeof e=="number"&&(t=e),mergeMap(function(){return n},t))}function mergeScan(n,e,t){return t===void 0&&(t=1/0),operate(function(r,i){var s=e;return mergeInternals(r,i,function(o,u){return n(s,o,u)},t,function(o){s=o},!1,void 0,function(){return s=null})})}function merge$1(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n),r=popNumber(n,1/0);return n=argsOrArgArray(n),operate(function(i,s){mergeAll(r)(internalFromArray(__spreadArray([i],__read(n)),t)).subscribe(s)})}function mergeWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return merge$1.apply(void 0,__spreadArray([],__read(n)))}function min(n){return reduce(isFunction$1(n)?function(e,t){return n(e,t)<0?e:t}:function(e,t){return e<t?e:t})}function multicast(n,e){var t=isFunction$1(n)?n:function(){return n};return isFunction$1(e)?connect(e,{connector:t}):function(r){return new ConnectableObservable(r,t)}}function pairwise(){return operate(function(n,e){var t,r=!1;n.subscribe(new OperatorSubscriber(e,function(i){var s=t;t=i,r&&e.next([s,i]),r=!0}))})}function pluck(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=n.length;if(t===0)throw new Error("list of properties cannot be empty.");return map(function(r){for(var i=r,s=0;s<t;s++){var o=i==null?void 0:i[n[s]];if(typeof o<"u")i=o;else return}return i})}function publish(n){return n?function(e){return connect(n)(e)}:function(e){return multicast(new Subject)(e)}}function publishBehavior(n){return function(e){var t=new BehaviorSubject(n);return new ConnectableObservable(e,function(){return t})}}function publishLast(){return function(n){var e=new AsyncSubject;return new ConnectableObservable(n,function(){return e})}}function publishReplay(n,e,t,r){t&&!isFunction$1(t)&&(r=t);var i=isFunction$1(t)?t:void 0;return function(s){return multicast(new ReplaySubject(n,e,r),i)(s)}}function raceWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return n.length?operate(function(t,r){raceInit(__spreadArray([t],__read(n)))(r)}):identity}function repeat(n){return n===void 0&&(n=1/0),n<=0?function(){return EMPTY}:operate(function(e,t){var r=0,i,s=function(){var o=!1;i=e.subscribe(new OperatorSubscriber(t,void 0,function(){++r<n?i?(i.unsubscribe(),i=null,s()):o=!0:t.complete()})),o&&(i.unsubscribe(),i=null,s())};s()})}function repeatWhen(n){return operate(function(e,t){var r,i=!1,s,o=!1,u=!1,c=function(){return u&&o&&(t.complete(),!0)},a=function(){return s||(s=new Subject,n(s).subscribe(new OperatorSubscriber(t,function(){r?l():i=!0},function(){o=!0,c()}))),s},l=function(){u=!1,r=e.subscribe(new OperatorSubscriber(t,void 0,function(){u=!0,!c()&&a().next()})),i&&(r.unsubscribe(),r=null,i=!1,l())};l()})}function retry(n){n===void 0&&(n=1/0);var e;n&&typeof n=="object"?e=n:e={count:n};var t=e.count,r=t===void 0?1/0:t,i=e.delay,s=e.resetOnSuccess,o=s===void 0?!1:s;return r<=0?identity:operate(function(u,c){var a=0,l,p=function(){var d=!1;l=u.subscribe(new OperatorSubscriber(c,function(f){o&&(a=0),c.next(f)},void 0,function(f){if(a++<r){var m=function(){l?(l.unsubscribe(),l=null,p()):d=!0};if(i!=null){var h=typeof i=="number"?timer(i):innerFrom(i(f,a)),E=new OperatorSubscriber(c,function(){E.unsubscribe(),m()},function(){c.complete()});h.subscribe(E)}else m()}else c.error(f)})),d&&(l.unsubscribe(),l=null,p())};p()})}function retryWhen(n){return operate(function(e,t){var r,i=!1,s,o=function(){r=e.subscribe(new OperatorSubscriber(t,void 0,void 0,function(u){s||(s=new Subject,n(s).subscribe(new OperatorSubscriber(t,function(){return r?o():i=!0}))),s&&s.next(u)})),i&&(r.unsubscribe(),r=null,i=!1,o())};o()})}function sample(n){return operate(function(e,t){var r=!1,i=null;e.subscribe(new OperatorSubscriber(t,function(o){r=!0,i=o}));var s=function(){if(r){r=!1;var o=i;i=null,t.next(o)}};n.subscribe(new OperatorSubscriber(t,s,noop))})}function sampleTime(n,e){return e===void 0&&(e=asyncScheduler),sample(interval(n,e))}function scan(n,e){return operate(scanInternals(n,e,arguments.length>=2,!0))}function sequenceEqual(n,e){return e===void 0&&(e=function(t,r){return t===r}),operate(function(t,r){var i=createState(),s=createState(),o=function(c){r.next(c),r.complete()},u=function(c,a){var l=new OperatorSubscriber(r,function(p){var d=a.buffer,f=a.complete;d.length===0?f?o(!1):c.buffer.push(p):!e(p,d.shift())&&o(!1)},function(){c.complete=!0;var p=a.complete,d=a.buffer;p&&o(d.length===0),l==null||l.unsubscribe()});return l};t.subscribe(u(i,s)),n.subscribe(u(s,i))})}function createState(){return{buffer:[],complete:!1}}function share(n){n===void 0&&(n={});var e=n.connector,t=e===void 0?function(){return new Subject}:e,r=n.resetOnError,i=r===void 0?!0:r,s=n.resetOnComplete,o=s===void 0?!0:s,u=n.resetOnRefCountZero,c=u===void 0?!0:u;return function(a){var l=null,p=null,d=null,f=0,m=!1,h=!1,E=function(){p==null||p.unsubscribe(),p=null},g=function(){E(),l=d=null,m=h=!1},b=function(){var x=l;g(),x==null||x.unsubscribe()};return operate(function(x,y){f++,!h&&!m&&E();var w=d=d??t();y.add(function(){f--,f===0&&!h&&!m&&(p=handleReset(b,c))}),w.subscribe(y),l||(l=new SafeSubscriber({next:function(F){return w.next(F)},error:function(F){h=!0,E(),p=handleReset(g,i,F),w.error(F)},complete:function(){m=!0,E(),p=handleReset(g,o),w.complete()}}),from(x).subscribe(l))})(a)}}function handleReset(n,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];return e===!0?(n(),null):e===!1?null:e.apply(void 0,__spreadArray([],__read(t))).pipe(take(1)).subscribe(function(){return n()})}function shareReplay(n,e,t){var r,i,s,o=!1;return n&&typeof n=="object"?(s=(r=n.bufferSize)!==null&&r!==void 0?r:1/0,e=(i=n.windowTime)!==null&&i!==void 0?i:1/0,o=!!n.refCount,t=n.scheduler):s=n??1/0,share({connector:function(){return new ReplaySubject(s,e,t)},resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:o})}function single(n){return operate(function(e,t){var r=!1,i,s=!1,o=0;e.subscribe(new OperatorSubscriber(t,function(u){s=!0,(!n||n(u,o++,e))&&(r&&t.error(new SequenceError("Too many matching values")),r=!0,i=u)},function(){r?(t.next(i),t.complete()):t.error(s?new NotFoundError("No matching values"):new EmptyError)}))})}function skip(n){return filter(function(e,t){return n<=t})}function skipLast(n){return n<=0?identity:operate(function(e,t){var r=new Array(n),i=0;return e.subscribe(new OperatorSubscriber(t,function(s){var o=i++;if(o<n)r[o]=s;else{var u=o%n,c=r[u];r[u]=s,t.next(c)}})),function(){r=null}})}function skipUntil(n){return operate(function(e,t){var r=!1,i=new OperatorSubscriber(t,function(){i==null||i.unsubscribe(),r=!0},noop);innerFrom(n).subscribe(i),e.subscribe(new OperatorSubscriber(t,function(s){return r&&t.next(s)}))})}function skipWhile(n){return operate(function(e,t){var r=!1,i=0;e.subscribe(new OperatorSubscriber(t,function(s){return(r||(r=!n(s,i++)))&&t.next(s)}))})}function startWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popScheduler(n);return operate(function(r,i){(t?concat$1(n,r,t):concat$1(n,r)).subscribe(i)})}function switchMap(n,e){return operate(function(t,r){var i=null,s=0,o=!1,u=function(){return o&&!i&&r.complete()};t.subscribe(new OperatorSubscriber(r,function(c){i==null||i.unsubscribe();var a=0,l=s++;innerFrom(n(c,l)).subscribe(i=new OperatorSubscriber(r,function(p){return r.next(e?e(c,p,l,a++):p)},function(){i=null,u()}))},function(){o=!0,u()}))})}function switchAll(){return switchMap(identity)}function switchMapTo(n,e){return isFunction$1(e)?switchMap(function(){return n},e):switchMap(function(){return n})}function switchScan(n,e){return operate(function(t,r){var i=e;return switchMap(function(s,o){return n(i,s,o)},function(s,o){return i=o,o})(t).subscribe(r),function(){i=null}})}function takeUntil(n){return operate(function(e,t){innerFrom(n).subscribe(new OperatorSubscriber(t,function(){return t.complete()},noop)),!t.closed&&e.subscribe(t)})}function takeWhile(n,e){return e===void 0&&(e=!1),operate(function(t,r){var i=0;t.subscribe(new OperatorSubscriber(r,function(s){var o=n(s,i++);(o||e)&&r.next(s),!o&&r.complete()}))})}function tap(n,e,t){var r=isFunction$1(n)||e||t?{next:n,error:e,complete:t}:n;return r?operate(function(i,s){var o;(o=r.subscribe)===null||o===void 0||o.call(r);var u=!0;i.subscribe(new OperatorSubscriber(s,function(c){var a;(a=r.next)===null||a===void 0||a.call(r,c),s.next(c)},function(){var c;u=!1,(c=r.complete)===null||c===void 0||c.call(r),s.complete()},function(c){var a;u=!1,(a=r.error)===null||a===void 0||a.call(r,c),s.error(c)},function(){var c,a;u&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(a=r.finalize)===null||a===void 0||a.call(r)}))}):identity}var defaultThrottleConfig={leading:!0,trailing:!1};function throttle(n,e){var t=e===void 0?defaultThrottleConfig:e,r=t.leading,i=t.trailing;return operate(function(s,o){var u=!1,c=null,a=null,l=!1,p=function(){a==null||a.unsubscribe(),a=null,i&&(m(),l&&o.complete())},d=function(){a=null,l&&o.complete()},f=function(h){return a=innerFrom(n(h)).subscribe(new OperatorSubscriber(o,p,d))},m=function(){if(u){u=!1;var h=c;c=null,o.next(h),!l&&f(h)}};s.subscribe(new OperatorSubscriber(o,function(h){u=!0,c=h,!(a&&!a.closed)&&(r?m():f(h))},function(){l=!0,!(i&&u&&a&&!a.closed)&&o.complete()}))})}function throttleTime(n,e,t){e===void 0&&(e=asyncScheduler),t===void 0&&(t=defaultThrottleConfig);var r=timer(n,e);return throttle(function(){return r},t)}function timeInterval(n){return n===void 0&&(n=async),function(e){return defer(function(){return e.pipe(scan(function(t,r){var i=t.current;return{value:r,current:n.now(),last:i}},{current:n.now(),value:void 0,last:void 0}),map(function(t){var r=t.current,i=t.last,s=t.value;return new TimeInterval(s,r-i)}))})}}var TimeInterval=function(){function n(e,t){this.value=e,this.interval=t}return n}();function timeoutWith(n,e,t){var r,i,s;if(t=t??async,isValidDate(n)?r=n:typeof n=="number"&&(i=n),e)s=function(){return e};else throw new TypeError("No observable provided to switch to");if(r==null&&i==null)throw new TypeError("No timeout provided.");return timeout({first:r,each:i,scheduler:t,with:s})}function timestamp(n){return n===void 0&&(n=dateTimestampProvider),map(function(e){return{value:e,timestamp:n.now()}})}function window$1(n){return operate(function(e,t){var r=new Subject;t.next(r.asObservable());var i=function(s){r.error(s),t.error(s)};return e.subscribe(new OperatorSubscriber(t,function(s){return r==null?void 0:r.next(s)},function(){r.complete(),t.complete()},i)),n.subscribe(new OperatorSubscriber(t,function(){r.complete(),t.next(r=new Subject)},noop,i)),function(){r==null||r.unsubscribe(),r=null}})}function windowCount(n,e){e===void 0&&(e=0);var t=e>0?e:n;return operate(function(r,i){var s=[new Subject],o=[],u=0;i.next(s[0].asObservable()),r.subscribe(new OperatorSubscriber(i,function(c){var a,l;try{for(var p=__values(s),d=p.next();!d.done;d=p.next()){var f=d.value;f.next(c)}}catch(E){a={error:E}}finally{try{d&&!d.done&&(l=p.return)&&l.call(p)}finally{if(a)throw a.error}}var m=u-n+1;if(m>=0&&m%t===0&&s.shift().complete(),++u%t===0){var h=new Subject;s.push(h),i.next(h.asObservable())}},function(){for(;s.length>0;)s.shift().complete();i.complete()},function(c){for(;s.length>0;)s.shift().error(c);i.error(c)},function(){o=null,s=null}))})}function windowTime(n){for(var e,t,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var s=(e=popScheduler(r))!==null&&e!==void 0?e:asyncScheduler,o=(t=r[0])!==null&&t!==void 0?t:null,u=r[1]||1/0;return operate(function(c,a){var l=[],p=!1,d=function(E){var g=E.window,b=E.subs;g.complete(),b.unsubscribe(),arrRemove(l,E),p&&f()},f=function(){if(l){var E=new Subscription;a.add(E);var g=new Subject,b={window:g,subs:E,seen:0};l.push(b),a.next(g.asObservable()),E.add(s.schedule(function(){return d(b)},n))}};o!==null&&o>=0?a.add(s.schedule(function(){f(),!this.closed&&a.add(this.schedule(null,o))},o)):p=!0,f();var m=function(E){return l.slice().forEach(E)},h=function(E){m(function(g){var b=g.window;return E(b)}),E(a),a.unsubscribe()};return c.subscribe(new OperatorSubscriber(a,function(E){m(function(g){g.window.next(E),u<=++g.seen&&d(g)})},function(){return h(function(E){return E.complete()})},function(E){return h(function(g){return g.error(E)})})),function(){l=null}})}function windowToggle(n,e){return operate(function(t,r){var i=[],s=function(o){for(;0<i.length;)i.shift().error(o);r.error(o)};innerFrom(n).subscribe(new OperatorSubscriber(r,function(o){var u=new Subject;i.push(u);var c=new Subscription,a=function(){arrRemove(i,u),u.complete(),c.unsubscribe()},l;try{l=innerFrom(e(o))}catch(p){s(p);return}r.next(u.asObservable()),c.add(l.subscribe(new OperatorSubscriber(r,a,noop,s)))},noop)),t.subscribe(new OperatorSubscriber(r,function(o){var u,c,a=i.slice();try{for(var l=__values(a),p=l.next();!p.done;p=l.next()){var d=p.value;d.next(o)}}catch(f){u={error:f}}finally{try{p&&!p.done&&(c=l.return)&&c.call(l)}finally{if(u)throw u.error}}},function(){for(;0<i.length;)i.shift().complete();r.complete()},s,function(){for(;0<i.length;)i.shift().unsubscribe()}))})}function windowWhen(n){return operate(function(e,t){var r,i,s=function(u){r.error(u),t.error(u)},o=function(){i==null||i.unsubscribe(),r==null||r.complete(),r=new Subject,t.next(r.asObservable());var u;try{u=innerFrom(n())}catch(c){s(c);return}u.subscribe(i=new OperatorSubscriber(t,o,o,s))};o(),e.subscribe(new OperatorSubscriber(t,function(u){return r.next(u)},function(){r.complete(),t.complete()},s,function(){i==null||i.unsubscribe(),r=null}))})}function withLatestFrom(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];var t=popResultSelector(n);return operate(function(r,i){for(var s=n.length,o=new Array(s),u=n.map(function(){return!1}),c=!1,a=function(p){innerFrom(n[p]).subscribe(new OperatorSubscriber(i,function(d){o[p]=d,!c&&!u[p]&&(u[p]=!0,(c=u.every(identity))&&(u=null))},noop))},l=0;l<s;l++)a(l);r.subscribe(new OperatorSubscriber(i,function(p){if(c){var d=__spreadArray([p],__read(o));i.next(t?t.apply(void 0,__spreadArray([],__read(d))):d)}}))})}function zipAll(n){return joinAllInternals(zip$1,n)}function zip(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return operate(function(t,r){zip$1.apply(void 0,__spreadArray([t],__read(n))).subscribe(r)})}function zipWith(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return zip.apply(void 0,__spreadArray([],__read(n)))}const index=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError,AsyncSubject,BehaviorSubject,ConnectableObservable,EMPTY,EmptyError,NEVER,NotFoundError,Notification:Notification$1,get NotificationKind(){return NotificationKind},ObjectUnsubscribedError,Observable,ReplaySubject,Scheduler,SequenceError,Subject,Subscriber,Subscription,TimeoutError,UnsubscriptionError,VirtualAction,VirtualTimeScheduler,animationFrame,animationFrameScheduler,animationFrames,asap,asapScheduler,async,asyncScheduler,audit,auditTime,bindCallback,bindNodeCallback,buffer,bufferCount,bufferTime,bufferToggle,bufferWhen,catchError,combineAll,combineLatest:combineLatest$1,combineLatestAll,combineLatestWith,concat:concat$1,concatAll,concatMap,concatMapTo,concatWith,config,connect,connectable,count,debounce,debounceTime,defaultIfEmpty,defer,delay,delayWhen,dematerialize,distinct,distinctUntilChanged,distinctUntilKeyChanged,elementAt,empty,endWith,every,exhaust,exhaustAll,exhaustMap,expand,filter,finalize,find,findIndex,first,firstValueFrom,flatMap,forkJoin,from,fromEvent,fromEventPattern,generate,groupBy,identity,ignoreElements,iif,interval,isEmpty,isObservable,last,lastValueFrom,map,mapTo,materialize,max,merge:merge$2,mergeAll,mergeMap,mergeMapTo,mergeScan,mergeWith,min,multicast,never,noop,observable,observeOn,of,onErrorResumeNext,pairs,pairwise,partition,pipe,pluck,publish,publishBehavior,publishLast,publishReplay,queue,queueScheduler,race,raceWith,range,reduce,refCount,repeat,repeatWhen,retry,retryWhen,sample,sampleTime,scan,scheduled,sequenceEqual,share,shareReplay,single,skip,skipLast,skipUntil,skipWhile,startWith,subscribeOn,switchAll,switchMap,switchMapTo,switchScan,take,takeLast,takeUntil,takeWhile,tap,throttle,throttleTime,throwError,throwIfEmpty,timeInterval,timeout,timeoutWith,timer,timestamp,toArray,using,window:window$1,windowCount,windowTime,windowToggle,windowWhen,withLatestFrom,zip:zip$1,zipAll,zipWith},Symbol.toStringTag,{value:"Module"})),ASYNC_DATA_NAME={SESSION_READY:"sessionReady",LANG_READY:"langReady",SKIN_READY:"skinReady",OVERRIDE_READY:"overrideReady"};class Promisified{constructor(){v(this,"_resolution");v(this,"_rejection");v(this,"_promise",new Promise((e,t)=>{this._resolution=e,this._rejection=t}))}get promise(){return this._promise}resolve(e){this._resolution&&this._resolution(e)}reject(e){this._rejection&&this._rejection(e)}}class NotifyFramework{constructor(){v(this,"promises",{});v(this,"subject",new Subject)}asyncData(e){return typeof this.promises[e]>"u"&&(this.promises[e]=new Promisified),this.promises[e]}onSessionReady(){return this.asyncData(ASYNC_DATA_NAME.SESSION_READY)}onLangReady(){return this.asyncData(ASYNC_DATA_NAME.LANG_READY)}onSkinReady(){return this.asyncData(ASYNC_DATA_NAME.SKIN_READY)}onOverridesReady(){return this.asyncData(ASYNC_DATA_NAME.OVERRIDE_READY)}promisify(){return new Promisified}events(){return this.subject}}const notify=new NotifyFramework;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",EXPLORER:"explorer"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",SEARCH_RESULTED:"searchResulted"};function getDefaultExportFromCjs(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var axios$3={exports:{}},bind$2=function(e,t){return function(){for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];return e.apply(t,i)}},bind$1=bind$2,toString=Object.prototype.toString;function isArray(n){return toString.call(n)==="[object Array]"}function isUndefined(n){return typeof n>"u"}function isBuffer(n){return n!==null&&!isUndefined(n)&&n.constructor!==null&&!isUndefined(n.constructor)&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function isArrayBuffer(n){return toString.call(n)==="[object ArrayBuffer]"}function isFormData(n){return typeof FormData<"u"&&n instanceof FormData}function isArrayBufferView(n){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&n.buffer instanceof ArrayBuffer,e}function isString(n){return typeof n=="string"}function isNumber(n){return typeof n=="number"}function isObject(n){return n!==null&&typeof n=="object"}function isPlainObject(n){if(toString.call(n)!=="[object Object]")return!1;var e=Object.getPrototypeOf(n);return e===null||e===Object.prototype}function isDate(n){return toString.call(n)==="[object Date]"}function isFile(n){return toString.call(n)==="[object File]"}function isBlob(n){return toString.call(n)==="[object Blob]"}function isFunction(n){return toString.call(n)==="[object Function]"}function isStream(n){return isObject(n)&&isFunction(n.pipe)}function isURLSearchParams(n){return typeof URLSearchParams<"u"&&n instanceof URLSearchParams}function trim(n){return n.replace(/^\s*/,"").replace(/\s*$/,"")}function isStandardBrowserEnv(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function forEach(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),isArray(n))for(var t=0,r=n.length;t<r;t++)e.call(null,n[t],t,n);else for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.call(null,n[i],i,n)}function merge(){var n={};function e(i,s){isPlainObject(n[s])&&isPlainObject(i)?n[s]=merge(n[s],i):isPlainObject(i)?n[s]=merge({},i):isArray(i)?n[s]=i.slice():n[s]=i}for(var t=0,r=arguments.length;t<r;t++)forEach(arguments[t],e);return n}function extend(n,e,t){return forEach(e,function(i,s){t&&typeof i=="function"?n[s]=bind$1(i,t):n[s]=i}),n}function stripBOM(n){return n.charCodeAt(0)===65279&&(n=n.slice(1)),n}var utils$9={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isObject,isPlainObject,isUndefined,isDate,isFile,isBlob,isFunction,isStream,isURLSearchParams,isStandardBrowserEnv,forEach,merge,extend,trim,stripBOM},utils$8=utils$9;function encode(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$1=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(utils$8.isURLSearchParams(t))i=t.toString();else{var s=[];utils$8.forEach(t,function(c,a){c===null||typeof c>"u"||(utils$8.isArray(c)?a=a+"[]":c=[c],utils$8.forEach(c,function(p){utils$8.isDate(p)?p=p.toISOString():utils$8.isObject(p)&&(p=JSON.stringify(p)),s.push(encode(a)+"="+encode(p))}))}),i=s.join("&")}if(i){var o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e},utils$7=utils$9;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},InterceptorManager$1.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},InterceptorManager$1.prototype.forEach=function(e){utils$7.forEach(this.handlers,function(r){r!==null&&e(r)})};var InterceptorManager_1=InterceptorManager$1,utils$6=utils$9,transformData$1=function(e,t,r){return utils$6.forEach(r,function(s){e=s(e,t)}),e},isCancel$1,hasRequiredIsCancel;function requireIsCancel(){return hasRequiredIsCancel||(hasRequiredIsCancel=1,isCancel$1=function(e){return!!(e&&e.__CANCEL__)}),isCancel$1}var utils$5=utils$9,normalizeHeaderName$1=function(e,t){utils$5.forEach(e,function(i,s){s!==t&&s.toUpperCase()===t.toUpperCase()&&(e[t]=i,delete e[s])})},enhanceError,hasRequiredEnhanceError;function requireEnhanceError(){return hasRequiredEnhanceError||(hasRequiredEnhanceError=1,enhanceError=function(e,t,r,i,s){return e.config=t,r&&(e.code=r),e.request=i,e.response=s,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}),enhanceError}var createError,hasRequiredCreateError;function requireCreateError(){if(hasRequiredCreateError)return createError;hasRequiredCreateError=1;var n=requireEnhanceError();return createError=function(t,r,i,s,o){var u=new Error(t);return n(u,r,i,s,o)},createError}var settle,hasRequiredSettle;function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var n=requireCreateError();return settle=function(t,r,i){var s=i.config.validateStatus;!i.status||!s||s(i.status)?t(i):r(n("Request failed with status code "+i.status,i.config,null,i.request,i))},settle}var cookies,hasRequiredCookies;function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var n=utils$9;return cookies=n.isStandardBrowserEnv()?function(){return{write:function(r,i,s,o,u,c){var a=[];a.push(r+"="+encodeURIComponent(i)),n.isNumber(s)&&a.push("expires="+new Date(s).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(u)&&a.push("domain="+u),c===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(r){var i=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),cookies}var isAbsoluteURL,hasRequiredIsAbsoluteURL;function requireIsAbsoluteURL(){return hasRequiredIsAbsoluteURL||(hasRequiredIsAbsoluteURL=1,isAbsoluteURL=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}),isAbsoluteURL}var combineURLs,hasRequiredCombineURLs;function requireCombineURLs(){return hasRequiredCombineURLs||(hasRequiredCombineURLs=1,combineURLs=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}),combineURLs}var buildFullPath,hasRequiredBuildFullPath;function requireBuildFullPath(){if(hasRequiredBuildFullPath)return buildFullPath;hasRequiredBuildFullPath=1;var n=requireIsAbsoluteURL(),e=requireCombineURLs();return buildFullPath=function(r,i){return r&&!n(i)?e(r,i):i},buildFullPath}var parseHeaders,hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var n=utils$9,e=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(r){var i={},s,o,u;return r&&n.forEach(r.split(`
17
+ `),function(a){if(u=a.indexOf(":"),s=n.trim(a.substr(0,u)).toLowerCase(),o=n.trim(a.substr(u+1)),s){if(i[s]&&e.indexOf(s)>=0)return;s==="set-cookie"?i[s]=(i[s]?i[s]:[]).concat([o]):i[s]=i[s]?i[s]+", "+o:o}}),i},parseHeaders}var isURLSameOrigin,hasRequiredIsURLSameOrigin;function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var n=utils$9;return isURLSameOrigin=n.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),i;function s(o){var u=o;return t&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return i=s(window.location.href),function(u){var c=n.isString(u)?s(u):u;return c.protocol===i.protocol&&c.host===i.host}}():function(){return function(){return!0}}(),isURLSameOrigin}var xhr,hasRequiredXhr;function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var n=utils$9,e=requireSettle(),t=requireCookies(),r=buildURL$1,i=requireBuildFullPath(),s=requireParseHeaders(),o=requireIsURLSameOrigin(),u=requireCreateError();return xhr=function(a){return new Promise(function(p,d){var f=a.data,m=a.headers;n.isFormData(f)&&delete m["Content-Type"];var h=new XMLHttpRequest;if(a.auth){var E=a.auth.username||"",g=a.auth.password?unescape(encodeURIComponent(a.auth.password)):"";m.Authorization="Basic "+btoa(E+":"+g)}var b=i(a.baseURL,a.url);if(h.open(a.method.toUpperCase(),r(b,a.params,a.paramsSerializer),!0),h.timeout=a.timeout,h.onreadystatechange=function(){if(!(!h||h.readyState!==4)&&!(h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0))){var w="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,F=!a.responseType||a.responseType==="text"?h.responseText:h.response,R={data:F,status:h.status,statusText:h.statusText,headers:w,config:a,request:h};e(p,d,R),h=null}},h.onabort=function(){h&&(d(u("Request aborted",a,"ECONNABORTED",h)),h=null)},h.onerror=function(){d(u("Network Error",a,null,h)),h=null},h.ontimeout=function(){var w="timeout of "+a.timeout+"ms exceeded";a.timeoutErrorMessage&&(w=a.timeoutErrorMessage),d(u(w,a,"ECONNABORTED",h)),h=null},n.isStandardBrowserEnv()){var x=(a.withCredentials||o(b))&&a.xsrfCookieName?t.read(a.xsrfCookieName):void 0;x&&(m[a.xsrfHeaderName]=x)}if("setRequestHeader"in h&&n.forEach(m,function(w,F){typeof f>"u"&&F.toLowerCase()==="content-type"?delete m[F]:h.setRequestHeader(F,w)}),n.isUndefined(a.withCredentials)||(h.withCredentials=!!a.withCredentials),a.responseType)try{h.responseType=a.responseType}catch(y){if(a.responseType!=="json")throw y}typeof a.onDownloadProgress=="function"&&h.addEventListener("progress",a.onDownloadProgress),typeof a.onUploadProgress=="function"&&h.upload&&h.upload.addEventListener("progress",a.onUploadProgress),a.cancelToken&&a.cancelToken.promise.then(function(w){h&&(h.abort(),d(w),h=null)}),f||(f=null),h.send(f)})},xhr}var utils$4=utils$9,normalizeHeaderName=normalizeHeaderName$1,DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(n,e){!utils$4.isUndefined(n)&&utils$4.isUndefined(n["Content-Type"])&&(n["Content-Type"]=e)}function getDefaultAdapter(){var n;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(n=requireXhr()),n}var defaults$2={adapter:getDefaultAdapter(),transformRequest:[function(e,t){return normalizeHeaderName(t,"Accept"),normalizeHeaderName(t,"Content-Type"),utils$4.isFormData(e)||utils$4.isArrayBuffer(e)||utils$4.isBuffer(e)||utils$4.isStream(e)||utils$4.isFile(e)||utils$4.isBlob(e)?e:utils$4.isArrayBufferView(e)?e.buffer:utils$4.isURLSearchParams(e)?(setContentTypeIfUnset(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):utils$4.isObject(e)?(setContentTypeIfUnset(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if(typeof e=="string")try{e=JSON.parse(e)}catch{}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};defaults$2.headers={common:{Accept:"application/json, text/plain, */*"}},utils$4.forEach(["delete","get","head"],function(e){defaults$2.headers[e]={}}),utils$4.forEach(["post","put","patch"],function(e){defaults$2.headers[e]=utils$4.merge(DEFAULT_CONTENT_TYPE)});var defaults_1=defaults$2,utils$3=utils$9,transformData=transformData$1,isCancel=requireIsCancel(),defaults$1=defaults_1;function throwIfCancellationRequested(n){n.cancelToken&&n.cancelToken.throwIfRequested()}var dispatchRequest$1=function(e){throwIfCancellationRequested(e),e.headers=e.headers||{},e.data=transformData(e.data,e.headers,e.transformRequest),e.headers=utils$3.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),utils$3.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var t=e.adapter||defaults$1.adapter;return t(e).then(function(i){return throwIfCancellationRequested(e),i.data=transformData(i.data,i.headers,e.transformResponse),i},function(i){return isCancel(i)||(throwIfCancellationRequested(e),i&&i.response&&(i.response.data=transformData(i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})},utils$2=utils$9,mergeConfig$2=function(e,t){t=t||{};var r={},i=["url","method","data"],s=["headers","auth","proxy","params"],o=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function c(d,f){return utils$2.isPlainObject(d)&&utils$2.isPlainObject(f)?utils$2.merge(d,f):utils$2.isPlainObject(f)?utils$2.merge({},f):utils$2.isArray(f)?f.slice():f}function a(d){utils$2.isUndefined(t[d])?utils$2.isUndefined(e[d])||(r[d]=c(void 0,e[d])):r[d]=c(e[d],t[d])}utils$2.forEach(i,function(f){utils$2.isUndefined(t[f])||(r[f]=c(void 0,t[f]))}),utils$2.forEach(s,a),utils$2.forEach(o,function(f){utils$2.isUndefined(t[f])?utils$2.isUndefined(e[f])||(r[f]=c(void 0,e[f])):r[f]=c(void 0,t[f])}),utils$2.forEach(u,function(f){f in t?r[f]=c(e[f],t[f]):f in e&&(r[f]=c(void 0,e[f]))});var l=i.concat(s).concat(o).concat(u),p=Object.keys(e).concat(Object.keys(t)).filter(function(f){return l.indexOf(f)===-1});return utils$2.forEach(p,a),r},utils$1=utils$9,buildURL=buildURL$1,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2;function Axios$1(n){this.defaults=n,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=mergeConfig$1(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[dispatchRequest,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach(function(s){t.unshift(s.fulfilled,s.rejected)}),this.interceptors.response.forEach(function(s){t.push(s.fulfilled,s.rejected)});t.length;)r=r.then(t.shift(),t.shift());return r},Axios$1.prototype.getUri=function(e){return e=mergeConfig$1(this.defaults,e),buildURL(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},utils$1.forEach(["delete","get","head","options"],function(e){Axios$1.prototype[e]=function(t,r){return this.request(mergeConfig$1(r||{},{method:e,url:t,data:(r||{}).data}))}}),utils$1.forEach(["post","put","patch"],function(e){Axios$1.prototype[e]=function(t,r,i){return this.request(mergeConfig$1(i||{},{method:e,url:t,data:r}))}});var Axios_1=Axios$1,Cancel_1,hasRequiredCancel;function requireCancel(){if(hasRequiredCancel)return Cancel_1;hasRequiredCancel=1;function n(e){this.message=e}return n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,Cancel_1=n,Cancel_1}var CancelToken_1,hasRequiredCancelToken;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var n=requireCancel();function e(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(o){r=o});var i=this;t(function(o){i.reason||(i.reason=new n(o),r(i.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.source=function(){var r,i=new e(function(o){r=o});return{token:i,cancel:r}},CancelToken_1=e,CancelToken_1}var spread,hasRequiredSpread;function requireSpread(){return hasRequiredSpread||(hasRequiredSpread=1,spread=function(e){return function(r){return e.apply(null,r)}}),spread}var isAxiosError,hasRequiredIsAxiosError;function requireIsAxiosError(){return hasRequiredIsAxiosError||(hasRequiredIsAxiosError=1,isAxiosError=function(e){return typeof e=="object"&&e.isAxiosError===!0}),isAxiosError}var utils=utils$9,bind=bind$2,Axios=Axios_1,mergeConfig=mergeConfig$2,defaults=defaults_1;function createInstance(n){var e=new Axios(n),t=bind(Axios.prototype.request,e);return utils.extend(t,Axios.prototype,e),utils.extend(t,e),t}var axios$2=createInstance(defaults);axios$2.Axios=Axios,axios$2.create=function(e){return createInstance(mergeConfig(axios$2.defaults,e))},axios$2.Cancel=requireCancel(),axios$2.CancelToken=requireCancelToken(),axios$2.isCancel=requireIsCancel(),axios$2.all=function(e){return Promise.all(e)},axios$2.spread=requireSpread(),axios$2.isAxiosError=requireIsAxiosError(),axios$3.exports=axios$2,axios$3.exports.default=axios$2;var axiosExports=axios$3.exports,axios=axiosExports;const axios$1=getDefaultExportFromCjs(axios),loadedScripts$1={};class Http{constructor(e){v(this,"axios");v(this,"_latestResponse");this.axios=axios$1.create(e)}setCdn(e){e&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=e,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const t=arguments[1];return t.startsWith("/infra/public")&&(arguments[1]=e+t),/^\/([^\/]*)\/public/.test(t)&&(arguments[1]=e+t),t.startsWith("/assets")&&(arguments[1]=e+t),t=="/conf/public"&&(arguments[1]=t),t.startsWith("http")&&(arguments[1]=t),this.baseOpen.apply(this,arguments)})}toAxiosConfig(e){if(e){const t=Object.assign({},this.axios.defaults);return e.headers&&(t.headers&&(t.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(t.headers,e.headers)),e.responseType&&(t.responseType=e.responseType),e.queryParams&&(t.params=Object.assign({},e.queryParams)),t}else return this.axios.defaults}toCdnUrl(e){const t=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((t==null?void 0:t.length)>0&&e!=="/conf/public"){const r=""+e;(r.startsWith("/infra/public")||r.startsWith("/assets")||/^\/([^\/]*)\/public/.test(r))&&(e=t+r)}return e}mapAxiosError(e,t){return e.response?this._latestResponse=e.response:e.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!t||t.disableNotifications,this._latestResponse}mapAxiosResponse(e,t){return this._latestResponse=e,e.data}get latestResponse(){return this._latestResponse}get(e,t){return this.axios.get(this.toCdnUrl(e),this.toAxiosConfig(t)).then(r=>this.mapAxiosResponse(r,t)).catch(r=>this.mapAxiosError(r,t))}post(e,t,r){return this.axios.post(e,t,this.toAxiosConfig(r)).then(i=>this.mapAxiosResponse(i,r)).catch(i=>this.mapAxiosError(i,r))}postFile(e,t,r){const i=this.toAxiosConfig(r);return i.headers&&i.headers["Content-Type"]&&delete i.headers["Content-Type"],this.axios.post(e,t,i).then(s=>this.mapAxiosResponse(s,r)).catch(s=>this.mapAxiosError(s,r))}postJson(e,t,r){const i=this.toAxiosConfig();return i.headers&&(i.headers["Content-Type"]="application/json"),this.axios.post(e,t,this.toAxiosConfig(r)).then(s=>this.mapAxiosResponse(s,r)).catch(s=>this.mapAxiosError(s,r))}put(e,t,r){return this.axios.put(e,t,this.toAxiosConfig(r)).then(i=>this.mapAxiosResponse(i,r)).catch(i=>this.mapAxiosError(i,r))}putJson(e,t,r){const i=this.toAxiosConfig(r);return i.headers&&(i.headers["Content-Type"]="application/json"),this.axios.put(e,t,i).then(s=>this.mapAxiosResponse(s,r)).catch(s=>this.mapAxiosError(s,r))}delete(e,t){return this.axios.delete(e,this.toAxiosConfig(t)).then(r=>this.mapAxiosResponse(r,t)).catch(r=>this.mapAxiosError(r,t))}deleteJson(e,t){return this.axios.delete(e,{data:t}).then(r=>this.mapAxiosResponse(r)).catch(r=>this.mapAxiosError(r))}getScript(e,t,r){const i=r??"exports",s=this.toAxiosConfig(t);return s.headers&&(s.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(e),s).then(o=>this.mapAxiosResponse(o,t)).then(o=>{try{const u=`"use strict";var ${i.split(".")[0]}={};${o};return ${i};`;return Function(u)()}catch{return o}}).catch(o=>{throw this.mapAxiosError(o,t),o})}loadScript(e,t){return loadedScripts$1[e]?Promise.resolve():this.getScript(e,t).then(r=>{loadedScripts$1[e]=!0})}}class TransportFramework{constructor(){v(this,"_http",new Http)}get http(){return this._http}newHttpInstance(e){return new Http(e)}}const transport=new TransportFramework;class TransportFrameworkFactory{static instance(){return transport}}const http$2=transport.http;class Session{constructor(){v(this,"_me",null);v(this,"_currentLanguage","");v(this,"_notLoggedIn",!0);v(this,"_description");v(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let e=this.description.photo;return(!e||e==="no-avatar.jpg"||e==="no-avatar.svg")&&(e=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),e}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(e=>{if(http$2.latestResponse.status<200||http$2.latestResponse.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(e),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(e=>(this.setCurrentLanguage(e),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(e=>{if(e===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(e)})}setCurrentModel(e){this._me=e,this._notLoggedIn=!(e&&e.sessionMetadata&&e.sessionMetadata.userId)}hasWorkflow(e){var t;return e===void 0||((t=this._me)==null?void 0:t.authorizedActions.findIndex(r=>r.name===e))!==-1}hasRight(e,t){if(t==="owner")return e.owner&&e.owner.userId===this._me.userId;const r=t.right||t,s=e.shared.filter(u=>(this._me.groupsIds||[]).indexOf(u.groupId)!==-1||u.userId===this._me.userId).find(u=>u[r]||u.manager)!==void 0,o=t.workflow?this.hasWorkflow(t.workflow):!0;return s&&o}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(e=>(this._description&&(this._description.quota=e.quota,this._description.storage=e.storage),e)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(e){this._currentLanguage=e,notify.onLangReady().resolve(e)}loadDefaultLanguage(){return http$2.get("/locale").then(e=>e.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(e=>(e[0].status==="ok"&&e[0].result&&e[0].result.length>0?this._description=e[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,e[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(e=>e.result).then(e=>this._profile=e[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(e=>{try{return JSON.parse(e.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(e){return http$2.put("/directory/user/mailstate",{email:e})}tryEmailValidation(e){return http$2.post("/directory/user/mailstate",{key:e})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(e){return http$2.put("/directory/user/mobilestate",{mobile:e})}tryMobileValidation(e){return http$2.post("/directory/user/mobilestate",{key:e})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(e){return http$2.post("/auth/user/mfa/code",{key:e})}}class SessionFramework{constructor(){v(this,"session",new Session)}initialize(){return this.session.initialize()}login(e,t,r,i){const s=new FormData;return s.append("email",e),s.append("password",t),typeof r<"u"&&s.append("rememberMe",""+r),typeof i<"u"&&s.append("secureLocation",""+i),transport.http.post("/auth/login",s,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){v(this,"_conf");v(this,"_loaded");v(this,"skinName","");v(this,"themeName","");v(this,"skin","raw");v(this,"themeUrl","/assets/themes/raw/default/");v(this,"templateOverrides",{});v(this,"portalTemplate","/assets/themes/raw/portal.html");v(this,"basePath","");v(this,"logoutCallback","/");v(this,"skins",[]);v(this,"is1D",!1);v(this,"is2D",!1);v(this,"_onSkinReady",notify.onSkinReady());v(this,"_onOverrideReady",notify.onOverridesReady())}initialize(e){return notify.onSessionReady().promise.then(()=>this.load(e))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(e){return this._conf=this._conf??await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:e??this.version}},"exports.conf"),this._conf}load(e){return e=e??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(e):this.loadConnected(e)).then(async()=>{var r,i;const t=await this.listSkins();this.is1D=((r=t.find(s=>s.child===this.skin))==null?void 0:r.parent)==="panda",this.is2D=((i=t.find(s=>s.child===this.skin))==null?void 0:i.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(e){return new Promise((t,r)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(i=>{this.skin=i.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${i.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${i.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:e}}).then(s=>{this.templateOverrides=s,this._onOverrideReady.resolve(s),t()}).catch(s=>{if(transport.http.latestResponse.status===404)t();else throw s})}).catch(i=>{this._onSkinReady.reject(i),this._onOverrideReady.reject(i),r()})})}loadConnected(e){return new Promise((t,r)=>{this.loadDefaultTheme(e).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:e}}).then(i=>{this.templateOverrides=i,this._onOverrideReady.resolve(i),t()}).catch(i=>{if(transport.http.latestResponse.status===404)t(),this._onSkinReady.reject(i),this._onOverrideReady.reject(i);else throw i})})})}async loadDefaultTheme(e){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:e}}).then(t=>{this.skinName=t.skinName,this.themeName=t.themeName,this.themeUrl=t.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=t.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(e){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+e._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(e=>{const t=e.overriding.find(r=>r.child===this.skin);return t!=null&&t.group?this.skins=this.skins.concat(e.overriding.filter(r=>r.group===t.group)):this.skins=this.skins.concat(e.overriding),this.skins})}async getHelpPath(){const t=(await this.listSkins()).find(r=>r.child===this.skin);return(t==null?void 0:t.help)??"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(e,t){e=e??"";let r=bundle$1[e]===void 0?e:bundle$1[e];if(t&&typeof t=="object")for(let i in t)typeof t[i]<"u"&&(r=r.replace(new RegExp("\\${"+i+"}","g"),""+t[i]));return r}addBundlePromise(e){return this.loadBundlePromise(session.session.currentLanguage,e)}addBundle(e,t){this.loadBundle(session.session.currentLanguage,e,t)}loadBundlePromise(e,t){return this.loadBundle(e,t),promises$1[t]}loadBundle(e,t,r){const i=promises$1[t];if(i)r&&i.then(r).catch(r);else{const s=new Promisified;promises$1[t]=s.promise;const o={};e&&(o["Accept-Language"]=e),transport.http.get(t,{headers:o}).then(u=>{Object.assign(bundle$1,u),typeof r=="function"&&r(),s.resolve()}).catch(u=>{typeof r=="function"&&r(),s.reject()})}}addTranslations(e,t){notify.onLangReady().promise.then(r=>{this.loadBundle(r,e+"/"+r+".json",t)})}addAllTranslations(e){return e&&e.length>0?notify.onLangReady().promise.then(t=>Promise.all(e.map(r=>this.loadBundlePromise(t,r+"/"+t+".json")))).then(()=>{}):Promise.reject()}addKeys(e){for(var t in e)typeof bundle$1[t]!="string"&&(bundle$1[t]=e[t])}removeAccents(e){for(var t=0;t<defaultDiacriticsRemovalMap$1.length;t++)e=e.replace(defaultDiacriticsRemovalMap$1[t].letters,defaultDiacriticsRemovalMap$1[t].base);return e}}class UserPreferences{constructor(){v(this,"data",{})}get(e){return this.data[e]}load(e,t){return transport.http.get("/userbook/preference/"+e).then(r=>{try{return JSON.parse(r.preference)}catch{return t??{}}}).then(r=>(this.data[e]=r??{},r))}update(e,t){return t!==void 0&&(this.data[e]=t),this}save(e){return transport.http.putJson("/userbook/preference/"+e,this.data[e])}}class User{constructor(){v(this,"_me",null);v(this,"_keepOpenOnLogout",!1);v(this,"_preferences",new UserPreferences);v(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(e){return this.loadPublicConf(),notify.onSessionReady().promise.then(t=>{t&&this.setCurrentModel(t)})}setCurrentModel(e){this._me=e,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(e=>(this._keepOpenOnLogout=(e==null?void 0:e.keepOpenOnLogout)||!1,e))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(e=>{e.preference||(e.preference=null);const t=JSON.parse(e.preference);let r;if(t&&t.length&&typeof t.concat=="function"){this._bookmarkedApps=t,r={bookmarks:t.map(o=>o.name),applications:[]},transport.http.putJson("/userbook/preference/apps",r);return}else r=t;r||(r={bookmarks:[],applications:[]});let i=!0;const s=[];r.bookmarks.forEach((o,u)=>{const c=this._me.apps.find(a=>a.name===o);if(c){let a=Object.assign({},c);this._bookmarkedApps.push(a)}else s.push(o),i=!1}),s.forEach(o=>{let u=r.bookmarks.indexOf(o);u!==-1&&r.bookmarks.splice(u,1)}),i||transport.http.putJson("/userbook/preference/apps",r)})}loadAppPrefs(e){return this.preferences.load(e,{})}saveAppPrefs(e){return this.preferences.save(e)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(e=>e["default-domain"])}saveLanguage(e){return this.preferences.update("language",{"default-domain":e}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){v(this,"_publicConf",{});v(this,"_currentApp");v(this,"_appConf",{})}get currentApp(){return this._currentApp??null}setCurrentApp(e){return this._currentApp=e,this}async initialize(e,t=!1){t||this.setCurrentApp(e),await Promise.all([this.getPublicConf(e),this.loadI18n(e)])}async getPublicConf(e){return this._publicConf[e]||(this._publicConf[e]=await http$1.get(`/${e}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[e]}async getWebAppConf(e){let t;return this._appConf[e]||(await http$1.get("/applications-list")).apps.forEach(i=>{if(i!=null&&i.prefix){const s=i.prefix.replace("/","");this._appConf[s]=i}else i!=null&&i.name&&i.name.toLowerCase()==e&&(t=i)}),this._appConf[e]??t}async loadI18n(e){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${e}/i18n`)}}class Analytics{constructor(){v(this,"_status","void");v(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(e){return this.parametersWithCheck(e,!0)}async parametersWithCheck(e,t){return this.initialize().promise.then(r=>!t||r.type===e||r.type==="multiple"?r[e]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async e=>{var t;if(!e||!e[0]||!e[0].type)throw ERROR_CODE.MALFORMED_DATA;e[1]&&e[1].active&&(e[0].xiti=await this.initializeXiti(e[1])),(t=this._params)==null||t.resolve(e[0]),this._status="ready"}).catch(e=>{var t;throw this._status="failed",(t=this._params)==null||t.reject(),e})),this._params}async initializeXiti(e){if(!e.structureMap||!configure.Platform.apps.currentApp)return;const t=await notify.onSessionReady().promise,r=session.session.description;let i;for(let a of t.structures){const l=e.structureMap[a];if(l&&l.collectiviteId&&l.UAI){i=l;break}}if(!i||!i.active)return;const s=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!s)return;const o=s.xiti;if(!o||!o.LIBELLE_SERVICE||!i.UAI)return;function u(a){let l="";for(let p=0;p<a.length;p++)l+=a.charCodeAt(p);return l}const c={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:o.LIBELLE_SERVICE,TYPE:o.OUTIL?"TIERS":"NATIF",OUTIL:o.OUTIL?o.OUTIL:"",STRUCT_ID:i.collectiviteId,STRUCT_UAI:i.UAI,PROJET:i.projetId?i.projetId:e.ID_PROJET,EXPLOITANT:e.ID_EXPLOITANT,PLATFORME:i.plateformeId?i.plateformeId:e.ID_PLATEFORME,ID_PERSO:u(t.userId),PROFILE:r.profiles&&r.profiles.length>0?c[r.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){v(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")});v(this,"School",{});v(this,"User",new User)}async initialize(e,t){if(!e){const i=a=>(a<10?"0":"")+a.toFixed(0),s=new Date,o=s.getFullYear(),u=s.getMonth()+1,c=s.getDate();e=`${o}${i(u)}${i(c)}`}const r=e;this.Platform.deploymentTag=e,typeof t=="string"&&t.length>0&&(this.Platform.cdnDomain=t),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(r),notify.onSessionReady().promise.then(i=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(r)])}}const configure=new ConfigurationFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}class SessionFrameworkFactory{static instance(){return session}}const WIDGET_POSITION={LEFT:"left",RIGHT:"right"},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT,"edumalin-widget":WIDGET_POSITION.RIGHT,"mediacentre-widget":WIDGET_POSITION.RIGHT,"cantine-widget":WIDGET_POSITION.LEFT,"screen-time-widget":WIDGET_POSITION.RIGHT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140,"edumalin-widget":35,"mediacentre-widget":145,"cantine-widget":21,"screen-time-widget":35};class WidgetFramework{constructor(){v(this,"_initialized");v(this,"_widgets",[]);v(this,"_userPrefs",{})}initialize(e,t){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(r=>{var i;r&&r.widgets?(r.widgets.forEach(s=>{this._widgets.push(new Widget(s))}),this.loadUserPrefs().then(()=>{var s;(s=this._initialized)==null||s.resolve()}).catch(s=>{var o;(o=this._initialized)==null||o.reject()})):(i=this._initialized)==null||i.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(e){return this._widgets.find(t=>t.platformConf.name===e)}lookupDefaultPosition(e){return defaultWidgetPosition[e]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(e=>this.applyUserPrefs(e))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().next({name:EVENT_NAME.USERPREF_CHANGED,layer:LAYER_NAME.WIDGETS})})}async applyUserPrefs(e){this._userPrefs=e??this._userPrefs;const t=configure.Platform.theme,r=[];t.listSkins().then(i=>{var u;const s=((u=i.find(c=>c.child===t.skin))==null?void 0:u.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((c,a)=>{const l=c.platformConf.name;return s.indexOf(l)!==-1?!1:(this._userPrefs[l]||(this._userPrefs[l]={index:defaultWidgetOrder[l]??999,show:!0,position:c.platformConf.position}),c.platformConf.mandatory&&(this._userPrefs[l].show=!0,this._userPrefs[l].index=defaultWidgetOrder[l]??999),c.platformConf.i18n&&r.push(c.platformConf.i18n),c.applyUserPref(this._userPrefs[l]),!0)});const o=new Idiom;this._widgets=this._widgets.sort((c,a)=>{const l=o.translate(`timeline.settings.${c.platformConf.name}`).toLowerCase(),p=o.translate(`timeline.settings.${a.platformConf.name}`).toLowerCase();return l<p?-1:l>p?1:0})})}}class Widget{constructor(e){v(this,"_schoolConf",{});v(this,"_userPref");this._platformConf=e,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(e){this._userPref=e,this._userPref.position=this._userPref.position??widgets.lookupDefaultPosition(this._platformConf.name)??"left"}}const widgets=new WidgetFramework;class LastInfosWidget{loadInfos(e){return transport.http.get("/actualites/api/v1/infos/preview/last/"+e)}getMaxResults(){return transport.http.get("/userbook/preference/maxInfos").then(e=>e.preference?parseInt(e.preference):4)}setMaxResults(e){return transport.http.putJson("/userbook/preference/maxInfos",`"${e}"`)}}const WIDGET_NAME={LAST_INFOS:"last-infos-widget",BIRTHDAY:"birthday",CALENDAR:"calendar-widget",CARNET:"carnet-de-bord",RECORD:"record-me",MOOD:"mood",MY_APPS:"my-apps",NOTES:"notes",RSS:"rss-widget",BOOKMARK:"bookmark-widget",QWANT:"qwant",QWANT_JUNIOR:"qwant-junior",AGENDA:"agenda-widget",CURSUS:"cursus-widget",MAXICOURS:"maxicours-widget",UNIVERSALIS:"universalis-widget",BRIEFME:"briefme-widget",SCHOOL:"school-widget",EDUMALIN:"edumalin-widget",MEDIACENTRE:"mediacentre-widget",CANTINE:"cantine-widget",SCREEN_TIME:"screen-time-widget"};class WidgetFrameworkFactory{static instance(){return widgets}}const http=transport==null?void 0:transport.http,me=(C=session==null?void 0:session.session)==null?void 0:C.user;class Notification{constructor(e){v(this,"_id");v(this,"model");e.reported=e.reporters&&e.reporters.length>0,this._id=e._id,this.model=e}isUnread(){var e;return((e=this.model.recipients)==null?void 0:e.find(t=>t.userId===me.userId))!==void 0}delete(){return http.delete("/timeline/"+this._id)}discard(){return http.put("/timeline/"+this._id)}report(){return http.put("/timeline/"+this._id+"/report")}}class TimelineApp{constructor(){v(this,"_notifications",[]);v(this,"_notificationTypes",[]);v(this,"_flashMessages",[]);v(this,"_pageNumber",0);v(this,"_lastPage",!1);v(this,"_loading",!1);v(this,"showMine",!1)}get notifications(){return this._notifications}get isLoading(){return this._loading}get page(){return this._pageNumber}get hasMorePage(){return!this._lastPage}get notificationTypes(){return this._notificationTypes}get selectedNotificationTypes(){return this.preferences.type=this.preferences.type||[],this.preferences.type}get preferences(){return configure.User.preferences.get(APP.TIMELINE)}get flashMessages(){return this._flashMessages}savePreferences(){return configure.User.saveAppPrefs(APP.TIMELINE)}resetPagination(){this._pageNumber=0,this._lastPage=!1,this._loading=!1}initialize(){return Promise.all([configure.User.loadAppPrefs(APP.TIMELINE),transport.http.get("/timeline/types")]).then(e=>{this._notificationTypes=e[1]})}loadNotifications(e){if(this._loading||this._lastPage)return Promise.resolve();e&&(this._pageNumber++,this._lastPage=!1);let t=this.selectedNotificationTypes;if(t.length===0)return this._lastPage=!0,Promise.resolve();let r={page:this.page,mine:1};return this.showMine||delete r.mine,this._loading=!0,transport.http.get(`/timeline/lastNotifications?type=${t.join("&type=")}`,{queryParams:r}).then(i=>{if(this._loading=!1,i.status==="ok")if(i.number&&i.results){const s=i.results.filter(o=>this._notifications.findIndex(u=>u._id===o._id)===-1).map(o=>new Notification(o));this._notifications=this._notifications.concat(s),this._pageNumber++}else this._lastPage=!0}).catch(i=>{this._loading=!1})}loadFlashMessages(){return transport.http.get("/timeline/flashmsg/listuser").then(e=>{this._flashMessages=e})}markAsRead(e){return transport.http.put("/timeline/flashmsg/"+e.id+"/markasread")}}class ITimelineFactory{static createInstance(){return new TimelineApp}}const A=class A{constructor(e){v(this,"checkHttpResponse",e=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return e});this.context=e}static register({application:e,resourceType:t},r){A.registry.set(`${e}:main`,r),A.registry.set(`${e}:${t}`,r)}static findService({application:e,resourceType:t},r){const i=A.registry.get(`${e}:${t}`);if(i===void 0)throw`Service not found: ${e}:${t}`;return i(r)}static findMainService({application:e},t){const r=A.registry.get(`${e}:main`);if(r===void 0)throw`Service not found: ${e}`;return r(t)}get http(){return this.context.http()}getShareReadUrl(e){return`/${this.getApplication()}/share/json/${e}?search=`}getSaveShareUrl(e){return`/${this.getApplication()}/share/resource/${e}`}gotoPrint(e,t){window.open(this.getPrintUrl(e,t),"_blank")}gotoView(e){window.open(this.getViewUrl(e),"_self")}gotoForm(e){window.open(this.getFormUrl(e),"_self")}async publish(e){const t=new FormData;t.append("title",e.title),t.append("cover",e.cover),t.append("coverName",e.cover.name),t.append("coverType",e.cover.type),t.append("teacherAvatar",e.teacherAvatar),t.append("teacherAvatarName",e.teacherAvatar.name||`teacherAvatar_${e.userId}`),t.append("teacherAvatarType",e.teacherAvatar.type),t.append("language",e.language),e.activityType.forEach(s=>{t.append("activityType[]",s)}),e.subjectArea.forEach(s=>{t.append("subjectArea[]",s)}),e.age.forEach(s=>{t.append("age[]",s.toString())}),t.append("description",e.description),e.keyWords.split(",").forEach(s=>{t.append("keyWords[]",s.trim())}),t.append("licence",e.licence),t.append("pdfUri",`${window.location.origin}${this.getPrintUrl(e.resourceEntId)}`),t.append("application",e.application?e.application:""),t.append("resourceId",e.resourceId),t.append("teacherSchool",e.userStructureName);const i=await this.http.post("/appregistry/library/resource",t,{headers:{"Content-Type":"multipart/form-data"}});return this.checkHttpResponse(i)}async createContext(e){const t=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(e)});return this.checkHttpResponse(t)}async searchContext(e){const t=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(e)});return this.checkHttpResponse(t)}async createFolder(e){const t=await this.http.post("/explorer/folders",this.createFolderToBodyParams(e));return this.checkHttpResponse(t)}async updateFolder(e){const t=await this.http.put(`/explorer/folders/${e.folderId}`,this.createFolderToBodyParams(e));return this.checkHttpResponse(t)}async moveToFolder(e){const t=await this.http.post(`/explorer/folders/${e.folderId}/move`,this.moveToBodyParams(e));return this.checkHttpResponse(t)}async listSubfolders(e){const t=await this.http.get(`/explorer/folders/${e}`);return this.checkHttpResponse(t)}async deleteAll(e){const t=await this.http.deleteJson("/explorer",e);return this.checkHttpResponse(t)}async trashAll({resourceType:e,...t}){const r=await this.http.putJson("/explorer/trash",t);return this.checkHttpResponse(r)}async restoreAll({resourceType:e,...t}){const r=await this.http.putJson("/explorer/restore",t);return this.checkHttpResponse(r)}async getThumbnailPath(e){if(typeof e>"u")return e;if(typeof e=="string")if(e.startsWith("blob:")){const t=await fetch(e).then(i=>i.blob());return`/workspace/document/${(await this.context.workspace().saveFile(t,{visibility:"protected",application:this.getApplication()}))._id}`}else return e;else return`/workspace/document/${(await this.context.workspace().saveFile(e,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(e){let t={application:e.app,start_idx:e.pagination.startIdx,page_size:e.pagination.pageSize,resource_type:e.types[0],trashed:e.trashed};if(e.orders&&Object.entries(e.orders).length){const[[r,i]]=Object.entries(e.orders);t.order_by=`${r}:${i}`}return e.filters&&Object.assign(t,e.filters),typeof e.search=="string"&&(t.search=e.search),t}createFolderToBodyParams(e){return{application:e.app,resourceType:e.type,parentId:e.parentId,name:e.name}}moveToBodyParams(e){return{application:e.application,resourceType:this.getResourceType(),resourceIds:e.resourceIds,folderIds:e.folderIds}}};v(A,"registry",new Map);let ResourceService=A;class BlogResourceService extends ResourceService{async create(e){const t=e.thumbnail?await this.getThumbnailPath(e.thumbnail):"",r=e.public?"/blog/pub":"/blog",i=await this.http.post(r,{title:e.name,description:e.description,visibility:e.public?"PUBLIC":"OWNER",thumbnail:t,trashed:!1,slug:e.public?e.slug:"","publish-type":e.publishType||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(i),i}async update(e){const t=await this.getThumbnailPath(e.thumbnail),r=await this.http.put(`/blog/${e.entId}`,{trashed:e.trashed,_id:e.entId,title:e.name,thumbnail:t,description:e.description,visibility:e.public?"PUBLIC":"OWNER",slug:e.public?e.slug:"","publish-type":e["publish-type"]||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(r),{thumbnail:t,entId:e.entId}}getResourceType(){return RESOURCE.BLOG}getApplication(){return APP.BLOG}getFormUrl(e){return e?`/blog?folderid=${e}#/edit/new`:"/blog#/edit/new"}getViewUrl(e){return`/blog#/view/${e}`}getPrintUrl(e,t){return`/blog/print/blog#/print/${e}?comments=${t||!0}`}}ResourceService.register({application:RESOURCE.BLOG,resourceType:RESOURCE.BLOG},n=>new BlogResourceService(n));class MindmapResourceService extends ResourceService{async create(e){const t=e.thumbnail?await this.getThumbnailPath(e.thumbnail):"",r=await this.http.post("/mindmap",{name:e.name,description:e.description,thumbnail:t,folder:e.folder,map:`<map version="tango" theme="prism"><topic central="true" text="${e.name}"/></map>`,trashed:!1,visibility:"OWNER"});return this.checkHttpResponse(r),{entId:r._id,thumbnail:t}}async update(e){const t=e.thumbnail?await this.getThumbnailPath(e.thumbnail):"",r=await this.http.put(`/mindmap/${e.entId}`,{trashed:e.trashed,_id:e.entId,name:e.name,thumbnail:t,description:e.description,visibility:e.public?"PUBLIC":"OWNER"});return this.checkHttpResponse(r),{thumbnail:t,entId:e.entId}}getResourceType(){return RESOURCE.MINDMAP}getApplication(){return APP.MINDMAP}getFormUrl(e){return e?`/mindmap?folderid=${e}/new`:"/mindmap/new"}getViewUrl(e){return`/mindmap/id/${e}`}getPrintUrl(e,t){return`/mindmap/print/id/${e}?comments=${t||!0}`}}ResourceService.register({application:RESOURCE.MINDMAP,resourceType:RESOURCE.MINDMAP},n=>new MindmapResourceService(n));const globalCache={},mutexPromise={};class CacheService{constructor(e){this.context=e}get http(){return this.context.http()}async fromCacheIfPossible(e,t,r){if(mutexPromise[e]&&await mutexPromise[e],globalCache[e])return globalCache[e];try{const i=t();mutexPromise[e]=i;const s=await i;return r(s)&&(globalCache[e]=s),s}catch(i){throw console.error(`Failed to retrieve value for: ${e}`,i),i}}clearCache(e){if(e)delete globalCache[e];else for(const t in globalCache)globalCache.hasOwnProperty(t)&&delete globalCache[t]}async httpGet(e,t){return this.fromCacheIfPossible(e,async()=>{const r=await this.http.get(e,t),i={...this.http.latestResponse};return{value:r,response:i}},({response:r})=>!(r.status<200||r.status>=300))}async httpGetJson(e,t){const{response:r,value:i}=await this.httpGet(e,t);if(r.status<200||r.status>=300)throw`Bad http status (${r.status}) for url: ${e}`;return i}}class ConfService{constructor(e){this.context=e}get http(){return this.context.http()}get cdnDomain(){return configure.Platform.cdnDomain}async getConf(e){const[t,r]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[i,s,o]=await Promise.all([this.getTheme({conf:t}),this.getWebAppConf({app:e,applications:r}),this.getExtendedTheme()]);return{applications:r,conf:t,currentApp:s,theme:i,extendedTheme:o}}getCdnUrl(){console.warn("[getCdnUrl] Not implemented yet")}async savePreference(e,t){this.http.putJson(`/userbook/preference/${e}`,t)}async getPreference(e){const t=await this.http.get(`/userbook/preference/${e}`);return JSON.parse(t.preference)}async getThemeConf(e){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:e}},"exports.conf")}async getExtendedTheme(){try{return await this.http.get("/assets/extended-theme.json")}catch{return console.error("[getExtendedTheme] could not found /assets/extended-theme.json"),{}}}async getApplicationsList(){return(await this.http.get("/applications-list")).apps}async getWebAppConf({app:e,applications:t}){return t.find(i=>{if(i!=null&&i.prefix)return(i==null?void 0:i.prefix.replace("/",""))===e})}async getTheme({version:e,conf:t}){const r=await this.http.get("/theme",{queryParams:{_:e}}),i=r.themeName,s=t==null?void 0:t.overriding.find(a=>a.child===i).skins,o="/assets/themes/edifice-bootstrap",u=t==null?void 0:t.overriding.find(a=>a.child===i).bootstrapVersion.split("-").at(-1),c=(t==null?void 0:t.overriding.find(a=>a.child===i).parent)==="panda";return{basePath:`${this.cdnDomain}${r.skin}../../`,bootstrapPath:o,bootstrapVersion:u,is1d:c,logoutCallback:r.logoutCallback,skin:r.skin.split("/assets/themes/")[1].split("/")[0],skinName:r.skinName,skins:s,themeName:r.themeName,themeUrl:r.skin}}}class DirectoryService{constructor(e){this.odeServices=e}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(e,t,r="100x100"){return t==="user"?`/userbook/avatar/${e}?thumbnail=${r}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(e,t){return t==="user"?`/userbook/annuaire#/${e}`:`/userbook/annuaire#/group-view/${e}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:t,name:r})=>({id:t,displayName:r,members:[]}))}async getBookMarkById(e){const{groups:t,id:r,name:i,users:s}=await this.http.get(`/directory/sharebookmark/${e}`);return{id:r,displayName:i,groups:t.map(({name:o,id:u})=>({displayName:o,id:u})),users:s.map(({displayName:o,id:u,profile:c})=>({profile:c,displayName:o,firstName:"",lastName:"",login:"",id:u}))}}async saveBookmarks(e,{bookmarks:t,groups:r,users:i}){this.cache.clearCache("/directory/sharebookmark/all");const s=i.map(d=>typeof d=="string"?d:d.id),o=r.map(d=>typeof d=="string"?d:d.id),u=t.map(async d=>{if(typeof d=="string"){const{displayName:f,groups:m,id:h,users:E}=await this.getBookMarkById(d),g=E.map(y=>y.id),b=m.map(y=>y.id);return{displayName:f,id:h,members:[...b,...g]}}else return Promise.resolve(d)}),a=(await Promise.all(u)).map(d=>d.members).reduce((d,f)=>[...d,...f],[]),l={name:e,members:[...s,...o,...a]},{id:p}=await this.http.postJson("/directory/sharebookmark",l);return{id:p,displayName:e,members:l.members}}}const loadedScripts={};class HttpService{constructor(e,t){v(this,"axios");v(this,"_latestResponse");this.context=e,this.axios=axios$1.create(t)}setCdn(e){e&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=e,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const t=arguments[1];return t.startsWith("/infra/public")&&(arguments[1]=e+t),/^\/([^\/]*)\/public/.test(t)&&(arguments[1]=e+t),t.startsWith("/assets")&&(arguments[1]=e+t),t=="/conf/public"&&(arguments[1]=t),t.startsWith("http")&&(arguments[1]=t),this.baseOpen.apply(this,arguments)})}toAxiosConfig(e){if(e){const t=Object.assign({},this.axios.defaults);return e.headers&&(t.headers=Object.assign({},this.axios.defaults.headers),Object.assign(t.headers,e.headers)),e.responseType&&(t.responseType=e.responseType),e.queryParams&&(t.params=Object.assign({},e.queryParams)),t}else return this.axios.defaults}toCdnUrl(e){const t=this.context.conf().getCdnUrl()||"";if(t.length>0&&e!=="/conf/public"){const r=""+e;(r.startsWith("/infra/public")||r.startsWith("/assets")||/^\/([^\/]*)\/public/.test(r))&&(e=t+r)}return e}mapAxiosError(e,t){return console.error("[HttpService]",e),e.response?this._latestResponse=e.response:e.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!t||t.disableNotifications,this._latestResponse}mapAxiosResponse(e,t){return this._latestResponse=e,e.data}get latestResponse(){return this._latestResponse}async get(e,t){try{const r=await this.axios.get(this.toCdnUrl(e),this.toAxiosConfig(t));return this.mapAxiosResponse(r,t)}catch(r){return this.mapAxiosError(r,t)}}async post(e,t,r){try{const i=await this.axios.post(e,t,this.toAxiosConfig(r));return this.mapAxiosResponse(i,r)}catch(i){return this.mapAxiosError(i,r)}}async postFile(e,t,r){const i=this.toAxiosConfig(r);i.headers&&i.headers["Content-Type"]&&delete i.headers["Content-Type"];try{const s=await this.axios.post(e,t,{...i,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(s,r)}catch(s){return this.mapAxiosError(s,r)}}async postJson(e,t,r){const i=this.toAxiosConfig();i.headers&&(i.headers["Content-Type"]="application/json");try{const s=await this.axios.post(e,t,this.toAxiosConfig(r));return this.mapAxiosResponse(s,r)}catch(s){return this.mapAxiosError(s,r)}}async put(e,t,r){try{const i=await this.axios.put(e,t,this.toAxiosConfig(r));return this.mapAxiosResponse(i,r)}catch(i){return this.mapAxiosError(i,r)}}async putFile(e,t,r){try{const i=this.toAxiosConfig(r);i.headers&&i.headers["Content-Type"]&&delete i.headers["Content-Type"];const s=await this.axios.put(e,t,{...i,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(s,r)}catch(i){return this.mapAxiosError(i,r)}}async putJson(e,t,r){const i=this.toAxiosConfig(r);i.headers&&(i.headers["Content-Type"]="application/json");try{const s=await this.axios.put(e,t,i);return this.mapAxiosResponse(s,r)}catch(s){return this.mapAxiosError(s,r)}}async delete(e,t){try{const r=await this.axios.delete(e,this.toAxiosConfig(t));return this.mapAxiosResponse(r,t)}catch(r){return this.mapAxiosError(r,t)}}async deleteJson(e,t){try{const r=await this.axios.delete(e,{data:t});return this.mapAxiosResponse(r)}catch(r){return this.mapAxiosError(r)}}getScript(e,t,r){const i=r??"exports",s=this.toAxiosConfig(t);return s.headers&&(s.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(e),s).then(o=>this.mapAxiosResponse(o,t)).then(o=>{try{const u=`"use strict";var ${i.split(".")[0]}={};${o};return ${i};`;return Function(u)()}catch{return o}}).catch(o=>{throw this.mapAxiosError(o,t),o})}loadScript(e,t){return loadedScripts[e]?Promise.resolve():this.getScript(e,t).then(r=>{loadedScripts[e]=!0})}}class RightService{constructor(e){this.context=e}get session(){return this.context.session()}parseResourceRight(e){const t=e.split(":");if(t.length===2){if(t[0]==="creator")return{id:t[1],right:"creator",type:"creator"}}else return t.length===3?{id:t[1],right:t[2],type:t[0]}:void 0}parseResourceRights(e){return e.map(r=>this.parseResourceRight(r)).filter(r=>r!==void 0)}hasResourceRight({id:e,groupIds:t},r,i){const s=i.map(o=>typeof o=="string"?this.parseResourceRight(o):o).filter(o=>o!==void 0);for(const o of s){if(o.id===e&&o.type==="creator")return!0;if(o.id===e&&o.type==="user"&&o.right===r)return!0;if(t.includes(o.id)&&o.type==="group"&&o.right===r)return!0}return!1}async sessionHasResourceRight(e,t){try{const r=await this.session.getUser();return!!r&&this.hasResourceRight({groupIds:r.groupsIds,id:r.userId},e,t)}catch(r){return console.error(r),!1}}async sessionHasAtLeastOneResourceRight(e,t){for(const r of e)if(await this.sessionHasResourceRight(r,t))return!0;return!1}async sessionHasResourceRightForEachList(e,t){let r=0;for(const i of t)await this.sessionHasResourceRight(e,i)&&r++;return r===t.length}async sessionHasAtLeastOneResourceRightForEachList(e,t){for(const r of e){let i=0;for(const s of t)await this.sessionHasResourceRight(r,s)&&i++;if(i===t.length)return!0}return!1}hasWorkflowRight(e,t){return t.findIndex(r=>r===e)!==-1}async sessionHasWorkflowRight(e){try{const t=await this.session.getUser();return!!t&&this.hasWorkflowRight(e,t.authorizedActions.map(r=>r.name))}catch(t){return console.error(t),!1}}async sessionHasWorkflowRights(e){const t={};try{const r=await this.session.getUser();for(const i of e)t[i]=!!r&&this.hasWorkflowRight(i,r.authorizedActions.map(s=>s.name))}catch(r){console.error(r);for(const i of e)t[i]=!1}return t}}class SessionService{constructor(e){this.context=e}get http(){return this.context.http()}get cache(){return this.context.cache()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const e=await this.getUser(),[t,r,i,s,o]=await Promise.all([this.getCurrentLanguage(e),this.latestQuotaAndUsage(e),this.loadDescription(e),this.getUserProfile(),this.getBookmarks(e)]);return{user:e,quotaAndUsage:r,currentLanguage:t,userDescription:i,userProfile:s,bookmarkedApps:o}}login(e,t,r,i){const s=new FormData;return s.append("email",e),s.append("password",t),typeof r<"u"&&s.append("rememberMe",""+r),typeof i<"u"&&s.append("secureLocation",""+i),this.http.post("/auth/login",s,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return this.http.get("/auth/logout").finally(()=>{})}async latestQuotaAndUsage(e){try{return await this.http.get(`/workspace/quota/user/${e==null?void 0:e.userId}`)}catch(t){return console.error(t),{quota:0,storage:0}}}async getCurrentLanguage(e){const t=(e==null?void 0:e.sessionMetadata)&&(e==null?void 0:e.sessionMetadata.userId);try{let r;return t?r=await this.loadUserLanguage():r=await this.loadDefaultLanguage(),r}catch(r){console.error(r)}}async loadUserLanguage(){try{const e=await this.http.get("/userbook/preference/language");return JSON.parse(e.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:e,value:t}=await this.cache.httpGet("/auth/oauth2/userinfo");if(e.status<200||e.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return t}hasWorkflow({workflowName:e,user:t}){return e===void 0||(t==null?void 0:t.authorizedActions.findIndex(r=>r.name===e))!==-1}async loadDescription(e){try{const[t,r]=await Promise.all([this.getUserProfile({requestName:"refreshAvatar"}),this.http.get("/directory/userbook/"+(e==null?void 0:e.userId))]);return{...t,...r}}catch(t){return console.error(t),{}}}async getBookmarks(e){const t=await this.http.get("/userbook/preference/apps");t.preference||(t.preference=null);const r=JSON.parse(t.preference);let i;i=r,i||(i={bookmarks:[],applications:[]});let s=[];return i.bookmarks.forEach((o,u)=>{const c=e==null?void 0:e.apps.find(a=>a.name===o);if(c){let a=Object.assign({},c);s.push(a)}}),s}async getUserProfile(e){const{response:t,value:r}=await this.cache.httpGet("/userbook/api/person",e);if(t.status<200||t.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return r.result[0].type}async isAdml(){const e=await this.getUser();return(e==null?void 0:e.functions.ADMIN_LOCAL)!==void 0}}class StringUtils{static removeAccents(e){for(var t=0;t<defaultDiacriticsRemovalMap$1.length;t++)e=e.replace(defaultDiacriticsRemovalMap$1[t].letters,defaultDiacriticsRemovalMap$1[t].base);return e}}class ShareService{constructor(e){this.context=e}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(e,t,r){const i=StringUtils.removeAccents(r).toLowerCase(),s=await this.cache.httpGetJson(`/${e}/share/json/${t}?search=${r}`),o=s.users.visibles.filter(({username:l,firstName:p,lastName:d,login:f})=>{const m=StringUtils.removeAccents(d||"").toLowerCase(),h=StringUtils.removeAccents(p||"").toLowerCase(),E=StringUtils.removeAccents(l||"").toLowerCase(),g=StringUtils.removeAccents(f||"").toLowerCase();return E.includes(i)||h.includes(i)||m.includes(i)||g.includes(i)}).map(l=>({avatarUrl:this.directory.getAvatarUrl(l.id,"user"),directoryUrl:this.directory.getDirectoryUrl(l.id,"user"),displayName:l.username,id:l.id,profile:l.profile,type:"user"})),u=s.groups.visibles.filter(({name:l})=>StringUtils.removeAccents(l||"").toLowerCase().includes(i)).map(l=>({avatarUrl:this.directory.getAvatarUrl(l.id,"group"),directoryUrl:this.directory.getDirectoryUrl(l.id,"group"),displayName:l.name,id:l.id,type:"group"}));return[...(await this.directory.getBookMarks()).filter(({displayName:l})=>StringUtils.removeAccents(l||"").toLowerCase().includes(i)).map(l=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:l.displayName,id:l.id,type:"sharebookmark"})),...o,...u]}async getShareMapping(e){const t=await this.cache.httpGetJson(`/${e}/rights/sharing`);for(const r of Object.keys(t))if(r.includes(".")){const i=r.split(".")[1],s=t[r];delete t[r],t[i]=s}return t}getActionsAvailableFor({id:e,type:t},r,i){const o=(t==="user"?r.users.checked[e]:r.groups.checked[e])||[],u=Object.keys(i),c=[];for(const a of u)i[a].filter(d=>o.includes(d)).length>0&&c.push(a);return c}async getRightsForResource(e,t){const r=await this.directory.getBookMarks(),i=this.context.resource(e,e).getShareReadUrl(t),s=await this.cache.httpGetJson(i),o=await this.getShareMapping(e),u=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),c=Object.keys(s.users.checked).map(f=>s.users.visibles.find(h=>h.id===f)).filter(f=>f!==void 0).map(f=>{const m=this.getActionsAvailableFor({id:f.id,type:"user"},s,o);return{id:f.id,type:"user",displayName:f.username,profile:f.profile,avatarUrl:this.directory.getAvatarUrl(f.id,"user"),directoryUrl:this.directory.getDirectoryUrl(f.id,"user"),actions:m.map(E=>{const g=u[E];return{displayName:E,id:E,priority:g.priority}})}}).sort((f,m)=>(f.displayName||"").localeCompare(m.displayName)),a=Object.keys(s.groups.checked).map(f=>s.groups.visibles.find(h=>h.id===f)).filter(f=>f!==void 0).map(f=>{const m=this.getActionsAvailableFor({id:f.id,type:"group"},s,o);return{id:f.id,type:"group",displayName:f.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(f.id,"group"),directoryUrl:this.directory.getDirectoryUrl(f.id,"group"),actions:m.map(E=>{const g=u[E];return{displayName:E,id:E,priority:g.priority}})}}).sort((f,m)=>(f.displayName||"").localeCompare(m.displayName)),l=[...c,...a],p=s.groups.visibles.map(({groupDisplayName:f,id:m,name:h})=>({displayName:f||h,id:m})),d=s.users.visibles.map(({id:f,profile:m,username:h,firstName:E,lastName:g,login:b})=>({displayName:h,firstName:E,lastName:g,login:b,profile:m,id:f}));return{rights:l,visibleBookmarks:r,visibleGroups:p,visibleUsers:d}}async saveRights(e,t,r){const i=await this.getShareMapping(e),s={bookmarks:{},groups:{},users:{}};for(const a of r){const l=a.actions.map(d=>i[d.id]).reduce((d,f)=>[...d,...f],[]),p=[...new Set(l)];p.length>0&&(a.type==="user"?s.users[a.id]=p:a.type==="group"?s.groups[a.id]=p:s.bookmarks[a.id]=p)}const o=this.context.resource(e,e),u=o.getSaveShareUrl(t);return this.cache.clearCache(o.getShareReadUrl(t)),await this.http.putJson(u,s)}async getActionsForApp(e){const t=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),r=await this.getShareMapping(e);return Object.keys(t).map(s=>{const o=t[s];return{displayName:s,id:s,priority:o.priority,requires:o.requires}}).filter(s=>{var o;return((o=r[s.id])==null?void 0:o.length)>0}).sort((s,o)=>s.priority-o.priority)}}const S=class S{constructor(){v(this,"wordExtensions",new Set);v(this,"excelExtensions",new Set);v(this,"pptExtensions",new Set);v(this,"fileExtensionMap",new Map);v(this,"csvContentType",new Set);v(this,"csvExtensions",new Set);v(this,"txtExtensions",new Set);v(this,"PDF","application/pdf");v(this,"OCTET_STREAM","application/octet-stream");this.txtExtensions.add("txt"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(e){if(this.fileExtensionMap.has(e))return this.fileExtensionMap.get(e)}getExtensionForContentType(e){for(const t of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(t)||"").toLowerCase()==(e||"").toLowerCase())return t;return null}isWordLike(e,t){const r=this.getExtensionForContentType(e);return r?this.wordExtensions.has(r):e==this.OCTET_STREAM&&t?this.wordExtensions.has(t):!1}isExcelLike(e,t){const r=this.getExtensionForContentType(e);return r?this.excelExtensions.has(r):e==this.OCTET_STREAM&&t?this.excelExtensions.has(t):!1}isCsvLike(e,t){return this.csvContentType.has(e)?!0:e==this.OCTET_STREAM&&t?this.csvExtensions.has(t):!1}isPowerpointLike(e,t){const r=this.getExtensionForContentType(e);return r?this.pptExtensions.has(r):e==this.OCTET_STREAM&&t?this.pptExtensions.has(t):!1}isTxtLike(e,t){const r=this.getExtensionForContentType(e);return r?this.txtExtensions.has(r):e==this.OCTET_STREAM&&t?this.txtExtensions.has(t):!1}};v(S,"INSTANCE",new S);let MimeTypeUtils=S;class FileTypeUtils{static registerContentTypeToFileType(e){this.fileTypes.push(e)}static getFileType(e,t=!1,r){if(r&&(r=r.trim()),!e)return"unknown";this.fileTypes||console.warn("[Element.role] should not have emptyRoles",this);for(let s of this.fileTypes||[]){const o=s(e,t);if(o)return o}const i={csv:function(s){return!!MimeTypeUtils.INSTANCE.isCsvLike(s,r)},doc:function(s){return MimeTypeUtils.INSTANCE.isWordLike(s,r)?!0:s.indexOf("document")!==-1&&s.indexOf("wordprocessing")!==-1},xls:function(s){return MimeTypeUtils.INSTANCE.isExcelLike(s,r)?!0:s.indexOf("document")!==-1&&s.indexOf("spreadsheet")!==-1||s.indexOf("ms-excel")!==-1},img:function(s){return s.indexOf("image")!==-1},pdf:function(s){return s.indexOf("pdf")!==-1||s==="application/x-download"},ppt:function(s){return MimeTypeUtils.INSTANCE.isPowerpointLike(s,r)?!0:s.indexOf("document")!==-1&&s.indexOf("presentation")!==-1||s.indexOf("powerpoint")!==-1},txt:function(s){return MimeTypeUtils.INSTANCE.isTxtLike(s,r)},video:function(s){return s.indexOf("video")!==-1},audio:function(s){return s.indexOf("audio")!==-1},zip:function(s){return s.indexOf("zip")!==-1||s.indexOf("rar")!==-1||s.indexOf("tar")!==-1||s.indexOf("7z")!==-1}};for(let s in i)if(i[s](e))return s;return"unknown"}}v(FileTypeUtils,"fileTypes",[]);class WorkspaceService{constructor(e){this.context=e}get http(){return this.context.http()}async saveFile(e,t){const r=e.name||"",i=r.split("."),s=e.type||"application/octet-stream",o=i.length>1?i[i.length-1]:"",u={size:e.size,extension:o,role:FileTypeUtils.getFileType(s,!1,o)},c=r.replace("."+u.extension,""),a=u.extension?c+"."+u.extension:c,l=new FormData;l.append("file",e,a);const p=[];return((t==null?void 0:t.visibility)==="public"||(t==null?void 0:t.visibility)==="protected")&&p.push(`${t.visibility}=true`),t!=null&&t.application&&p.push(`application=${t.application}`),u.role==="img"&&p.push("quality=1"),t!=null&&t.parentId&&p.push(`parentId=${t.parentId}`),await this.http.postFile(`/workspace/document?${p.join("&")}`,l)}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(e){this.context=e}get http(){return this.context.http()}async getIdiom(e,t){await Promise.all([this.addBundlePromise(e,"/i18n"),this.addBundlePromise(e,`/${t}/i18n`)])}translate(e,t){e=e??"";let r=bundle[e]===void 0?e:bundle[e];if(t&&typeof t=="object")for(let i in t)typeof t[i]<"u"&&(r=r.replace(new RegExp("\\${"+i+"}","g"),""+t[i]));return r}addBundlePromise(e,t){return this.loadBundlePromise(e,t)}addBundle(e,t,r){this.loadBundle(e,t,r)}loadBundlePromise(e,t){return this.loadBundle(e,t),promises[t]}loadBundle(e,t,r){const i=promises[t];if(i)r&&i.then(r).catch(r);else{const s=new Promisified;promises[t]=s.promise;const o={};e&&(o["Accept-Language"]=e),this.http.get(t,{headers:o}).then(u=>{Object.assign(bundle,u),typeof r=="function"&&r(),s.resolve()}).catch(u=>{typeof r=="function"&&r(),s.reject()})}}addTranslations(e,t){notify.onLangReady().promise.then(r=>{this.loadBundle(r,e+"/"+r+".json",t)})}addAllTranslations(e){return e&&e.length>0?notify.onLangReady().promise.then(t=>Promise.all(e.map(r=>this.loadBundlePromise(t,r+"/"+t+".json")))).then(()=>{}):Promise.reject()}addKeys(e){for(var t in e)typeof bundle[t]!="string"&&(bundle[t]=e[t])}removeAccents(e){for(var t=0;t<defaultDiacriticsRemovalMap.length;t++)e=e.replace(defaultDiacriticsRemovalMap[t].letters,defaultDiacriticsRemovalMap[t].base);return e}}let ATTag;class AnalyticsService{constructor(n){this.context=n}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(n,e){const[t]=await Promise.all([this.getXitiConfig(e.name.toLowerCase()),this.loadXitiScript()]);if(!t||!ATInternet)return;let r=t.LIBELLE_SERVICE.default||null;for(let i in t.LIBELLE_SERVICE)if(i!=="default"&&n.indexOf(i)>=0){r=t.LIBELLE_SERVICE[i];break}ATTag=new ATInternet.Tracker.Tag({site:t.STRUCT_ID}),ATTag.setProps({SERVICE:r,TYPE:t.TYPE,OUTIL:t.OUTIL,UAI:t.STRUCT_UAI,PROJET:t.PROJET,EXPLOITANT:t.EXPLOITANT,PLATEFORME:t.PLATFORME,PROFIL:t.PROFILE},!0),ATTag.identifiedVisitor.set({id:t.ID_PERSO,category:t.PROFILE}),ATTag.page.set({name:(e==null?void 0:e.prefix)==="userbook"?"directory":e==null?void 0:e.prefix,chapter1:"",chapter2:"",chapter3:"",level2:t.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(n){const[e,t]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(e!=null&&e.type))throw ERROR_CODE.MALFORMED_DATA;return t!=null&&t.active&&(e.xiti=await this.getXitiTrackingParams(t,n)),e.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(n,e){if(!n.structureMap||!e)return;const t=await this.session.getUser(),r=await this.session.getUserProfile();let i;if(!(t!=null&&t.structures))return;for(let a of t.structures){const l=n.structureMap[a];if(l&&l.collectiviteId&&l.UAI){i=l;break}}if(!i||!i.active)return;const s=await configure.Platform.apps.getPublicConf(e);if(!s)return;const o=s.xiti;if(!o||!o.LIBELLE_SERVICE||!i.UAI)return;function u(a){let l="";for(let p=0;p<a.length;p++)l+=a.charCodeAt(p);return l}const c={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:o.LIBELLE_SERVICE,TYPE:o.OUTIL?"TIERS":"NATIF",OUTIL:o.OUTIL?o.OUTIL:"",STRUCT_ID:i.collectiviteId,STRUCT_UAI:i.UAI,PROJET:i.projetId?i.projetId:n.ID_PROJET,EXPLOITANT:n.ID_EXPLOITANT,PLATFORME:i.plateformeId?i.plateformeId:n.ID_PLATEFORME,ID_PERSO:u(t.userId),PROFILE:r&&r.length>0?c[r[0]]??"":""}}}class OdeServices{constructor(){v(this,"_analytics");v(this,"_cache");v(this,"_conf");v(this,"_directory");v(this,"_http");v(this,"_idiom");v(this,"_rights");v(this,"_session");v(this,"_share");v(this,"_workspace");this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._workspace=new WorkspaceService(this)}analytics(){return this._analytics}cache(){return this._cache}conf(){return this._conf}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}resource(e,t){return t?ResourceService.findService({application:e,resourceType:t},this):ResourceService.findMainService({application:e},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}workspace(){return this._workspace}}const odeServices=new OdeServices;typeof window<"u"&&(window.entcore=window.entcore??{},window.entcore["ode-ts-client"]=window.entcore["ode-ts-client"]??exports??(module==null?void 0:module.exports)),exports.ACTION=ACTION,exports.APP=APP,exports.BOOLEAN_FILTER=BOOLEAN_FILTER,exports.ConfigurationFrameworkFactory=ConfigurationFrameworkFactory,exports.ERROR_CODE=ERROR_CODE,exports.EVENT_NAME=EVENT_NAME,exports.FOLDER=FOLDER,exports.ITimelineFactory=ITimelineFactory,exports.LAYER_NAME=LAYER_NAME,exports.LastInfosWidget=LastInfosWidget,exports.NotifyFrameworkFactory=NotifyFrameworkFactory,exports.PROP_FORMAT=PROP_FORMAT,exports.PROP_KEY=PROP_KEY,exports.PROP_MODE=PROP_MODE,exports.PROP_TYPE=PROP_TYPE,exports.RESOURCE=RESOURCE,exports.RxJS=index,exports.SORT_BY=SORT_BY,exports.SORT_ORDER=SORT_ORDER,exports.STRING_FILTER=STRING_FILTER,exports.SessionFrameworkFactory=SessionFrameworkFactory,exports.TransportFrameworkFactory=TransportFrameworkFactory,exports.USER_PREFS=USER_PREFS,exports.WIDGET_NAME=WIDGET_NAME,exports.WIDGET_POSITION=WIDGET_POSITION,exports.WidgetFrameworkFactory=WidgetFrameworkFactory,exports.appNameForResource=appNameForResource,exports.odeServices=odeServices,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
18
18
  //# sourceMappingURL=ode-ts-client.js.map