@olympeio/runtime-node 9.1.2 → 9.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -211,805 +211,807 @@ da('String.prototype.padStart',function(a){return a?a:function(b,c){var d=fa(thi
211
211
  da('Array.prototype.flatMap',function(a){return a?a:function(b,c){for(var d=[],e=0;e<this.length;e++){var f=b.call(c,this[e],e,this);Array.isArray(f)?d.push.apply(d,f):d.push(f)}return d}});da('Object.entries',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push([d,b[d]]);return c}});da('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push(b[d]);return c}});
212
212
  da('Promise.prototype.finally',function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});
213
213
  da('Object.fromEntries',function(a){return a?a:function(b){var c={};if(!(Symbol.iterator in b))throw new TypeError(''+b+' is not iterable');b=b[Symbol.iterator].call(b);for(var d=b.next();!d.done;d=b.next()){d=d.value;if(Object(d)!==d)throw new TypeError('iterable for fromEntries should yield objects');c[d[0]]=d[1]}return c}});var ia=this||self;
214
- function z(a,b){a=a.split('.');let c=ia;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={gj:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.gj().olympe=olympe;olympe.NC=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};olympe.ha={};olympe.ha.node={};'function'!==typeof require||global.Blob||(global.Blob=require('cross-blob'));olympe.T={};olympe.T.Bf={};olympe.T.Bf.mo=class{process(a){const b=Object.keys(a.Ae);let c,d;c=0;for(d=b.length;c<d;c++)if(a.Pd(b[c]).lj())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.T.Bf.mo.la=[olympe.T.Bf.sq];olympe.T.Bf.no=class{process(a){function b(g,h){if(0<=h.indexOf(g))throw Error('Circular dependency detected: '+h.join(' > ')+' > '+g);h=h.concat(g);if(f[g]&&(delete f[g],g=a.Pd(g),c(g.ej(),h),g=g.Fi,null!==g))for(let k=0,l=g.length;k<l;k++)c(g[k].ej(),h)}function c(g,h){for(let k=0,l=g.length,n;k<l;k++)n=g[k],n instanceof olympe.T.zb&&b(n.Z(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Ae);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
215
- !0;for(;void 0!==(e=d());)b(e,[])}};olympe.T.Bf.no.la=[olympe.T.Bf.sq];olympe.T.Bf.sq=class{process(){}};const ja=[],ka=[];olympe.T.qo=class{constructor(){}static C(a,b){ja.push(new olympe.T.xl(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});ka.push(new olympe.T.xl(b,c,a))}};olympe.T.config=olympe.T.qo.C;olympe.T.run=olympe.T.qo.F;olympe.T.pl=class{constructor(){}getValue(){}};olympe.T.xl=class{constructor(a,b,c){this.F=a;this.G=[];this.C=b;if(void 0!==c){this.G=c;for(let d=0,e=c.length;d<e;d++)'string'===typeof c[d]&&(c[d]=new olympe.T.zb(c[d]))}}ej(){return this.G}};function la(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.T.gf.C.Gh)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.N.error('Error during instantiation of service '+b),f;}!e.F&&(a.C[b]=d)}return d}function ma(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.N.C++,f=b[e],d[e]=f instanceof olympe.T.pl?f.getValue(a):f,na(a.N);return d}
216
- olympe.T.gf=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.N=new olympe.T.Pp(c);a=olympe.T.P.cg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}Xa(){return this.N}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.T.gf.C={Zs:'exception',Gh:'null'};function oa(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function A(a,b,c,...d){pa(a.N,'Defining service '+b);a.C(b,c,d,!1,!1)}function qa(a,b,c,...d){pa(a.N,'Defining service '+b);a.C(b,c,d,!1,!0)}
217
- function C(a,b,c,d,e=!1){pa(a.N,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function ra(a,b,c,d=!1){pa(a.N,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function sa(a,b){pa(a.N,'Defining abstract service '+b);a.C(b).Ui=!0}function ta(a,b){a.parameters[olympe.H.Config.io.toLowerCase()]=b}function D(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
218
- olympe.T.Ms=class{constructor(a){var b=ua,c=va;this.Ae=Object.create(null);this.parameters=Object.create(null);this.L=[new olympe.T.Bf.mo,new olympe.T.Bf.no];this.F=[];b&&oa(this,b);c&&oa(this,c,'version');a&&oa(this,a);a=this.getParameter(olympe.T.Config.$t);this.G=void 0!==a?a:3;this.N=new olympe.T.Pp(this.G)}Xa(){return this.N}C(a,b,c,d,e){const f=a instanceof olympe.T.zb?a.Z():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Ae[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
219
- var g=this.Ae[f];g.id=g.id+'!!'+ ++olympe.T.Cl.C;g.F=!0;g=g.id;c[h]=g;this.Ae[g]=this.Ae[f]}}this.Ae[f]=new olympe.T.Cl(b,c,d||!1,f,e||!1);return this.Ae[f]}Pd(a){a=this.Ae[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){var a=this.F;this.N.debug('Calling '+a.length+' configure callbacks');this.N.C++;for(let b=0,c=a.length;b<c;b++)pa(this.N,'Calling callback'),this.N.C++,a[b].call(null,this),na(this.N);na(this.N);this.N.debug('Configuration summary: '+
220
- Object.keys(this.Ae).length+' definitions');this.N.debug('Compiling...');this.N.C++;a=this.L;for(let b=0,c=a.length;b<c;b++)this.N.debug('running compilation pass '+(b+1)+': '+a[b].constructor.name),a[b].process(this);na(this.N);this.N.debug('Compilation done, returning container');return new olympe.T.gf(this.Ae,this.parameters,this.G)}};olympe.T.Cl=class{constructor(a,b,c,d,e=!0){this.G=a||null;this.L=!!c;this.C=[];this.Ui=!1;this.Fi=null;if(b){this.C=b;for(let f=0,g=b.length;f<g;f++)'string'===typeof b[f]&&(b[f]=new olympe.T.zb(b[f]))}this.id=d||'';this.U=e;this.F=!1}Z(){return this.id}instantiate(a){const b=a.Xa();b.debug('Resolving arguments for '+this.id);const c=this.G;let d=ma(a,this.C);const e=()=>{if(this.L)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};pa(b,'Instantiating '+this.id);const f=olympe.D?
221
- olympe.D.mh().run(()=>e()):e(),g=this.Fi;let h,k,l;if(null!==g&&0<g.length){b.C++;pa(b,'Calling configuration callbacks:');k=0;for(l=g.length;k<l;k++)b.C++,h=g[k],pa(b,'Calling additional configuration callback '+h.C),d=ma(a,h.ej()),d.push(f),h.F.apply(null,d),na(b);na(b)}pa(b,'Done instantiating '+this.id);return f}nj(){return this.U}ej(){return this.C}lj(){return this.Ui}config(a,b,c){null===this.Fi&&(this.Fi=[]);this.Fi.push(new olympe.T.xl(b,c,a))}};olympe.T.Cl.C=0;function na(a){0<a.C&&a.C--}function pa(a,b){1>=a.F&&wa(a,'log','DI: '+b)}function wa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.T.Pp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&wa(this,'log','DI: '+a)}info(a){3>=this.F&&wa(this,'info','DI: '+a)}warn(a){4>=this.F&&wa(this,'warn','DI: '+a)}error(a){5>=this.F&&wa(this,'error','DI: '+a)}};olympe.T.fa=class extends olympe.T.pl{constructor(a){super();this.id=a}Z(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.T.zb=class extends olympe.T.pl{constructor(a,b){super();this.id=a;this.C=b||olympe.T.gf.C.Zs}Z(){return this.id}getValue(a){return la(a,this.id,this.C)}};olympe.T.P={cg:'di.Container',GA:'di.PublicContainer'};olympe.T.Config={$t:'logging.di'};olympe.T.run([olympe.T.P.cg],a=>{olympe.T.getParameter=b=>a.getParameter(b)});olympe.W={};function xa(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function ya(){var a=Math.random();return xa((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let za=Math.pow(2,32)-1;olympe.W.fc=function(){return ya()};olympe.W.dj=function(){return ya()};olympe.W.Uk=function(a,b=1){const c=a.substr(12,a.length-12);return xa(parseInt(a.substr(0,12),16)+b)+c};
222
- olympe.W.Yw=function(a){return xa(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Aa=0,Ba=0;olympe.W.iw=function(){var a=(new Date).getTime();a<=Aa?4294967295===Ba?(Ba=Math.floor(Math.random()/4*za),Aa+=1):Ba=Math.floor(Ba+(4294967295-Ba)/2):(Ba=Math.floor(Math.random()/4*za),Aa=a);a='00000000'+Ba.toString(16);return xa(Aa)+a.substr(a.length-8,8)};olympe.W.mD=function(){for(let a=0;1E4>a;a++)console.log(olympe.W.iw())};
223
- olympe.W.yg=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.W.SC=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.W.PC=function(a,b){return(b?b:'UI')+'-'+a};olympe.W.Ap=class{constructor(a){this.id=a||olympe.W.Ap.C++}qb(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.W.Ap.C=0;olympe.W.sA=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.W.Eh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.W.Eh.F=function(a){return new olympe.W.Eh(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.W.Eh.C=function(){return new olympe.W.Eh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.W.Eh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.W.Eh.prototype.get=function(a,b){return this.values[5*a+b]};function Ca(a){return(new TextEncoder).encode(a).buffer}function Da(a){return(new TextDecoder('utf8')).decode(a)}olympe.W.tl=class{U(){}C(){}G(){}L(){}F(){}Y(){}};olympe.W.Cr=a=>a.replace('+','-').replace('/','_');olympe.W.Ev=a=>a.replace('-','+').replace('_','/');function Ea(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.G&&a.G(d));0<a.values.size?Ea(a):a.F&&a.F()},a.L)}function Fa(a,b){a.G=b;return a}
224
- olympe.W.fr=class{constructor(a,b=a/2){this.timeout=a;this.L=b;this.values=new Map;this.F=this.G=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Ea(this)}has(a){return this.values.has(a)}delete(a){a=this.values.delete(a);0===this.values.size&&(this.C&&clearTimeout(this.C),this.C=null,this.F&&this.F());return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};olympe.W.wm=class{constructor(a){this.F=Fa(new olympe.W.fr(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);this.C&&this.C(b,c)});this.values=new Map;this.C=null}set(a,b){this.values.set(a,b);this.F.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}delete(a){this.values.delete(a);return this.F.delete(a)}clear(){this.F.clear();this.values.clear();return this}};function Ga(a,b){return a+b&4294967295}
214
+ function z(a,b){a=a.split('.');let c=ia;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={ij:()=>'object'===typeof window?window:'object'===typeof global?global:self};olympe.ij().olympe=olympe;olympe.OC=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};olympe.ia={};olympe.ia.node={};'function'!==typeof require||global.Blob||(global.Blob=require('cross-blob'));olympe.T={};olympe.T.Cf={};olympe.T.Cf.mo=class{process(a){const b=Object.keys(a.Be);let c,d;c=0;for(d=b.length;c<d;c++)if(a.Pd(b[c]).nj())throw Error('Service "'+b[c]+'" is defined as abstract and needs to be overridden');}};olympe.T.Cf.mo.la=[olympe.T.Cf.sq];olympe.T.Cf.no=class{process(a){function b(g,h){if(0<=h.indexOf(g))throw Error('Circular dependency detected: '+h.join(' > ')+' > '+g);h=h.concat(g);if(f[g]&&(delete f[g],g=a.Pd(g),c(g.gj(),h),g=g.Hi,null!==g))for(let k=0,l=g.length;k<l;k++)c(g[k].gj(),h)}function c(g,h){for(let k=0,l=g.length,n;k<l;k++)n=g[k],n instanceof olympe.T.zb&&b(n.Z(),h)}function d(){for(const g in f)if(Object.prototype.hasOwnProperty.call(f,g))return g}var e=Object.keys(a.Be);const f={};for(let g=0,h=e.length;g<h;g++)f[e[g]]=
215
+ !0;for(;void 0!==(e=d());)b(e,[])}};olympe.T.Cf.no.la=[olympe.T.Cf.sq];olympe.T.Cf.sq=class{process(){}};const ja=[],ka=[];olympe.T.qo=class{constructor(){}static C(a,b){ja.push(new olympe.T.yl(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});ka.push(new olympe.T.yl(b,c,a))}};olympe.T.config=olympe.T.qo.C;olympe.T.run=olympe.T.qo.F;olympe.T.ql=class{constructor(){}getValue(){}};olympe.T.yl=class{constructor(a,b,c){this.F=a;this.G=[];this.C=b;if(void 0!==c){this.G=c;for(let d=0,e=c.length;d<e;d++)'string'===typeof c[d]&&(c[d]=new olympe.T.zb(c[d]))}}gj(){return this.G}};function la(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.T.hf.C.Hh)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.L.error('Error during instantiation of service '+b),f;}!e.F&&(a.C[b]=d)}return d}function ma(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.L.C++,f=b[e],d[e]=f instanceof olympe.T.ql?f.getValue(a):f,na(a.L);return d}
216
+ olympe.T.hf=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.L=new olympe.T.Pp(c);a=olympe.T.P.dg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}Xa(){return this.L}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.T.hf.C={bt:'exception',Hh:'null'};function oa(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function A(a,b,c,...d){pa(a.L,'Defining service '+b);a.C(b,c,d,!1,!1)}function qa(a,b,c,...d){pa(a.L,'Defining service '+b);a.C(b,c,d,!1,!0)}
217
+ function C(a,b,c,d,e=!1){pa(a.L,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function ra(a,b,c,d=!1){pa(a.L,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function sa(a,b){pa(a.L,'Defining abstract service '+b);a.C(b).Wi=!0}function ta(a,b){a.parameters[olympe.H.Config.io.toLowerCase()]=b}function D(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
218
+ olympe.T.Os=class{constructor(a){var b=ua,c=va;this.Be=Object.create(null);this.parameters=Object.create(null);this.N=[new olympe.T.Cf.mo,new olympe.T.Cf.no];this.F=[];b&&oa(this,b);c&&oa(this,c,'version');a&&oa(this,a);a=this.getParameter(olympe.T.Config.cu);this.G=void 0!==a?a:3;this.L=new olympe.T.Pp(this.G)}Xa(){return this.L}C(a,b,c,d,e){const f=a instanceof olympe.T.zb?a.Z():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Be[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
219
+ var g=this.Be[f];g.id=g.id+'!!'+ ++olympe.T.Dl.C;g.F=!0;g=g.id;c[h]=g;this.Be[g]=this.Be[f]}}this.Be[f]=new olympe.T.Dl(b,c,d||!1,f,e||!1);return this.Be[f]}Pd(a){a=this.Be[a];if(void 0===a)throw Error();return a}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){var a=this.F;this.L.debug('Calling '+a.length+' configure callbacks');this.L.C++;for(let b=0,c=a.length;b<c;b++)pa(this.L,'Calling callback'),this.L.C++,a[b].call(null,this),na(this.L);na(this.L);this.L.debug('Configuration summary: '+
220
+ Object.keys(this.Be).length+' definitions');this.L.debug('Compiling...');this.L.C++;a=this.N;for(let b=0,c=a.length;b<c;b++)this.L.debug('running compilation pass '+(b+1)+': '+a[b].constructor.name),a[b].process(this);na(this.L);this.L.debug('Compilation done, returning container');return new olympe.T.hf(this.Be,this.parameters,this.G)}};olympe.T.Dl=class{constructor(a,b,c,d,e=!0){this.G=a||null;this.N=!!c;this.C=[];this.Wi=!1;this.Hi=null;if(b){this.C=b;for(let f=0,g=b.length;f<g;f++)'string'===typeof b[f]&&(b[f]=new olympe.T.zb(b[f]))}this.id=d||'';this.U=e;this.F=!1}Z(){return this.id}instantiate(a){const b=a.Xa();b.debug('Resolving arguments for '+this.id);const c=this.G;let d=ma(a,this.C);const e=()=>{if(this.N)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};pa(b,'Instantiating '+this.id);const f=olympe.D?
221
+ olympe.D.nh().run(()=>e()):e(),g=this.Hi;let h,k,l;if(null!==g&&0<g.length){b.C++;pa(b,'Calling configuration callbacks:');k=0;for(l=g.length;k<l;k++)b.C++,h=g[k],pa(b,'Calling additional configuration callback '+h.C),d=ma(a,h.gj()),d.push(f),h.F.apply(null,d),na(b);na(b)}pa(b,'Done instantiating '+this.id);return f}pj(){return this.U}gj(){return this.C}nj(){return this.Wi}config(a,b,c){null===this.Hi&&(this.Hi=[]);this.Hi.push(new olympe.T.yl(b,c,a))}};olympe.T.Dl.C=0;function na(a){0<a.C&&a.C--}function pa(a,b){1>=a.F&&wa(a,'log','DI: '+b)}function wa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.T.Pp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&wa(this,'log','DI: '+a)}info(a){3>=this.F&&wa(this,'info','DI: '+a)}warn(a){4>=this.F&&wa(this,'warn','DI: '+a)}error(a){5>=this.F&&wa(this,'error','DI: '+a)}};olympe.T.fa=class extends olympe.T.ql{constructor(a){super();this.id=a}Z(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.T.zb=class extends olympe.T.ql{constructor(a,b){super();this.id=a;this.C=b||olympe.T.hf.C.bt}Z(){return this.id}getValue(a){return la(a,this.id,this.C)}};olympe.T.P={dg:'di.Container',HA:'di.PublicContainer'};olympe.T.Config={cu:'logging.di'};olympe.T.run([olympe.T.P.dg],a=>{olympe.T.getParameter=b=>a.getParameter(b)});olympe.W={};function xa(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function ya(){var a=Math.random();return xa((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}let za=Math.pow(2,32)-1;olympe.W.hc=function(){return ya()};olympe.W.fj=function(){return ya()};olympe.W.Vk=function(a,b=1){const c=a.substr(12,a.length-12);return xa(parseInt(a.substr(0,12),16)+b)+c};
222
+ olympe.W.ax=function(a){return xa(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Aa=0,Ba=0;olympe.W.lw=function(){var a=(new Date).getTime();a<=Aa?4294967295===Ba?(Ba=Math.floor(Math.random()/4*za),Aa+=1):Ba=Math.floor(Ba+(4294967295-Ba)/2):(Ba=Math.floor(Math.random()/4*za),Aa=a);a='00000000'+Ba.toString(16);return xa(Aa)+a.substr(a.length-8,8)};olympe.W.nD=function(){for(let a=0;1E4>a;a++)console.log(olympe.W.lw())};
223
+ olympe.W.zg=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.W.TC=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.W.QC=function(a,b){return(b?b:'UI')+'-'+a};olympe.W.Ap=class{constructor(a){this.id=a||olympe.W.Ap.C++}qb(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.W.Ap.C=0;olympe.W.tA=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.W.Fh=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.W.Fh.F=function(a){return new olympe.W.Fh(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.W.Fh.C=function(){return new olympe.W.Fh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.W.Fh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.W.Fh.prototype.get=function(a,b){return this.values[5*a+b]};function Ca(a){return(new TextEncoder).encode(a).buffer}function Da(a){return(new TextDecoder('utf8')).decode(a)}olympe.W.ul=class{U(){}C(){}G(){}N(){}F(){}Y(){}};olympe.W.Dr=a=>a.replace('+','-').replace('/','_');olympe.W.Hv=a=>a.replace('-','+').replace('_','/');function Ea(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.G&&a.G(d));0<a.values.size?Ea(a):a.F&&a.F()},a.N)}function Fa(a,b){a.G=b;return a}
224
+ olympe.W.gr=class{constructor(a,b=a/2){this.timeout=a;this.N=b;this.values=new Map;this.F=this.G=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Ea(this)}has(a){return this.values.has(a)}delete(a){a=this.values.delete(a);0===this.values.size&&(this.C&&clearTimeout(this.C),this.C=null,this.F&&this.F());return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};olympe.W.wm=class{constructor(a){this.F=Fa(new olympe.W.gr(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);this.C&&this.C(b,c)});this.values=new Map;this.C=null}set(a,b){this.values.set(a,b);this.F.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}delete(a){this.values.delete(a);return this.F.delete(a)}clear(){this.F.clear();this.values.clear();return this}};function Ga(a,b){return a+b&4294967295}
225
225
  function Ha(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=F(c,d,e,f,b[0],7,-680876936);f=F(f,c,d,e,b[1],12,-389564586);e=F(e,f,c,d,b[2],17,606105819);d=F(d,e,f,c,b[3],22,-1044525330);c=F(c,d,e,f,b[4],7,-176418897);f=F(f,c,d,e,b[5],12,1200080426);e=F(e,f,c,d,b[6],17,-1473231341);d=F(d,e,f,c,b[7],22,-45705983);c=F(c,d,e,f,b[8],7,1770035416);f=F(f,c,d,e,b[9],12,-1958414417);e=F(e,f,c,d,b[10],17,-42063);d=F(d,e,f,c,b[11],22,-1990404162);c=F(c,d,e,f,b[12],7,1804603682);f=F(f,c,d,e,b[13],12,-40341101);e=F(e,f,
226
226
  c,d,b[14],17,-1502002290);d=F(d,e,f,c,b[15],22,1236535329);c=G(c,d,e,f,b[1],5,-165796510);f=G(f,c,d,e,b[6],9,-1069501632);e=G(e,f,c,d,b[11],14,643717713);d=G(d,e,f,c,b[0],20,-373897302);c=G(c,d,e,f,b[5],5,-701558691);f=G(f,c,d,e,b[10],9,38016083);e=G(e,f,c,d,b[15],14,-660478335);d=G(d,e,f,c,b[4],20,-405537848);c=G(c,d,e,f,b[9],5,568446438);f=G(f,c,d,e,b[14],9,-1019803690);e=G(e,f,c,d,b[3],14,-187363961);d=G(d,e,f,c,b[8],20,1163531501);c=G(c,d,e,f,b[13],5,-1444681467);f=G(f,c,d,e,b[2],9,-51403784);
227
227
  e=G(e,f,c,d,b[7],14,1735328473);d=G(d,e,f,c,b[12],20,-1926607734);c=H(d^e^f,c,d,b[5],4,-378558);f=H(c^d^e,f,c,b[8],11,-2022574463);e=H(f^c^d,e,f,b[11],16,1839030562);d=H(e^f^c,d,e,b[14],23,-35309556);c=H(d^e^f,c,d,b[1],4,-1530992060);f=H(c^d^e,f,c,b[4],11,1272893353);e=H(f^c^d,e,f,b[7],16,-155497632);d=H(e^f^c,d,e,b[10],23,-1094730640);c=H(d^e^f,c,d,b[13],4,681279174);f=H(c^d^e,f,c,b[0],11,-358537222);e=H(f^c^d,e,f,b[3],16,-722521979);d=H(e^f^c,d,e,b[6],23,76029189);c=H(d^e^f,c,d,b[9],4,-640364487);
228
228
  f=H(c^d^e,f,c,b[12],11,-421815835);e=H(f^c^d,e,f,b[15],16,530742520);d=H(e^f^c,d,e,b[2],23,-995338651);c=J(c,d,e,f,b[0],6,-198630844);f=J(f,c,d,e,b[7],10,1126891415);e=J(e,f,c,d,b[14],15,-1416354905);d=J(d,e,f,c,b[5],21,-57434055);c=J(c,d,e,f,b[12],6,1700485571);f=J(f,c,d,e,b[3],10,-1894986606);e=J(e,f,c,d,b[10],15,-1051523);d=J(d,e,f,c,b[1],21,-2054922799);c=J(c,d,e,f,b[8],6,1873313359);f=J(f,c,d,e,b[15],10,-30611744);e=J(e,f,c,d,b[6],15,-1560198380);d=J(d,e,f,c,b[13],21,1309151649);c=J(c,d,e,f,
229
229
  b[4],6,-145523070);f=J(f,c,d,e,b[11],10,-1120210379);e=J(e,f,c,d,b[2],15,718787259);d=J(d,e,f,c,b[9],21,-343485551);a[0]=Ga(c,a[0]);a[1]=Ga(d,a[1]);a[2]=Ga(e,a[2]);a[3]=Ga(f,a[3])}function H(a,b,c,d,e,f){b=Ga(Ga(b,a),Ga(d,f));return Ga(b<<e|b>>>32-e,c)}function F(a,b,c,d,e,f,g){return H(b&c|~b&d,a,b,e,f,g)}function G(a,b,c,d,e,f,g){return H(b&d|c&~d,a,b,e,f,g)}function J(a,b,c,d,e,f,g){return H(c^(b|~d),a,b,e,f,g)}
230
230
  function Ia(a,b=32){const c='0123456789abcdef'.split('');var d=a,e=d.length;a=[1732584193,-271733879,-1732584194,271733878];var f;for(f=64;f<=d.length;f+=64){var g=d.substring(f-64,f),h=[];for(let k=0;64>k;k+=4)h[k>>2]=g.charCodeAt(k)+(g.charCodeAt(k+1)<<8)+(g.charCodeAt(k+2)<<16)+(g.charCodeAt(k+3)<<24);Ha(a,h)}d=d.substring(f-64);g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<d.length;f++)g[f>>2]|=d.charCodeAt(f)<<(f%4<<3);g[f>>2]|=128<<(f%4<<3);if(55<f)for(Ha(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
231
- Ha(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Ia('hello')&&(Ga=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.W.mb=Ia;olympe.W.ky=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
232
- r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,DC:g||null,ss:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,QC:f||null,parameters:b}};olympe.W.hD=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.W.kD=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};
233
- olympe.W.Sr=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};olympe.W.xn=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.W.xn(a[c],d):a[c]=d}};olympe.W.an=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.W.xn(d,e);b(`conf.d/${a}`,f=>{olympe.W.xn(d,f);c(d)})})};olympe.W.AC=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Ag(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.W.bz=class{constructor(a,b,c,d){this.from=a;this.target=b;this.C=c;this.F=d}toString(){return`(${this.from.toString()}, ${this.target.toString()}, ${this.C.toString()}, ${this.F.toString()})`}};olympe.W.cu=class{constructor(a,b){this.start=a;this.end=b}};olympe.W.cu.C={Gi:'left',Oi:'right',$y:'bottom',WB:'top'};function Ja(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.W.Sh.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.W.Sh.C:new olympe.W.Sh(b,c,d,a[4])}function Ka(a){return`${a.C}.${a.F}.${a.G}`}
234
- olympe.W.Sh=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.L=d||null}Vk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}zj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<a.G}qb(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.L?`-${this.L}`:'')}};olympe.W.Sh.C=new olympe.W.Sh(Number.NaN,Number.NaN,Number.NaN);olympe.W.P={vh:'utils.binaryConverter',zs:'utils.base64Converter'};olympe.T.config(a=>{sa(a,olympe.W.P.vh);ra(a,olympe.W.P.zs,olympe.W.P.vh,!0)},'Utils services');olympe.T.run([olympe.W.P.vh],a=>{olympe.W.ai=()=>a});olympe.ra={};olympe.ra.Pb=class{L(){}oa(){}G(){}aa(){}ja(){}Da(){}U(){}Y(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ra.Pb.prototype.fatal=olympe.ra.Pb.prototype.fatal;olympe.ra.Pb.prototype.error=olympe.ra.Pb.prototype.error;olympe.ra.Pb.prototype.warn=olympe.ra.Pb.prototype.warn;olympe.ra.Pb.prototype.info=olympe.ra.Pb.prototype.info;olympe.ra.Pb.prototype.log=olympe.ra.Pb.prototype.log;olympe.ra.Pb.prototype.debug=olympe.ra.Pb.prototype.debug;olympe.ra.Pb.prototype.trace=olympe.ra.Pb.prototype.trace;
235
- olympe.ra.Pb.C={av:0,dg:1,Zt:2,wp:3,kv:4,uc:5,bt:6,am:7};olympe.ra.Pb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ra.sa=class{Rc(){}};olympe.ra.rd={};function La(a,b,c,d,e,f){var g=new Date;g=('00'+g.getHours()).substr(-2)+':'+('00'+g.getMinutes()).substr(-2)+':'+('00'+g.getSeconds()).substr(-2)+'.'+('00'+g.getMilliseconds()).substr(-3);f=a.Ya?`%c[${g}] [${f.toUpperCase()}] ${c}:%c`:`%c[${g}] ${c}:%c`;for(const h of d)f+=' '+h;a.Sa[b](f,'color: '+e,'color: #444');for(const h of a.Ld.values())h(g,c,b,...d)}
236
- olympe.ra.rd.Pb=class{constructor(a,b,c){this.name=a;this.C=b;this.Ya=c;this.F=a.toUpperCase();this.Ld=new Map;this.Sa=console}L(){return this.C}oa(){return this.C<=olympe.ra.Pb.C.av}G(){return this.C<=olympe.ra.Pb.C.dg}ja(){return this.C<=olympe.ra.Pb.C.Zt}aa(){return this.C<=olympe.ra.Pb.C.wp}Da(){return this.C<=olympe.ra.Pb.C.kv}U(){return this.C<=olympe.ra.Pb.C.uc}Y(){return this.C<=olympe.ra.Pb.C.bt}trace(...a){this.oa()&&La(this,'log',this.F,a,'#99b','trace')}debug(...a){this.G()&&La(this,'log',
237
- this.F,a,'#888','debug')}log(...a){this.ja()&&La(this,'log',this.F,a,'#000','log')}info(...a){this.aa()&&La(this,'info',this.F,a,'#00f','info')}warn(...a){this.Da()&&La(this,'warn',this.F,a,'#684911','warn')}error(...a){this.U()&&La(this,'error',this.F,a,'#f00','error')}fatal(...a){this.Y()&&La(this,'error',this.F,a,'#f00','fatal')}};olympe.ra.rd.Pb.la=[olympe.ra.Pb];olympe.ra.rd.sa=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.N=this.Rc('logging');this.N.info('Logging initialized, global log level is '+olympe.ra.Pb.F[b])}Rc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.ra.Config.Es}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.ra.Config.Pu}`;Object.prototype.hasOwnProperty.call(this.C.parameters,
238
- c.toLowerCase())&&(d=!0===this.C.getParameter(c));b=new olympe.ra.rd.Pb(a,b,d);this.channels.set(a,b)}return b}};olympe.ra.rd.sa.la=[olympe.ra.sa];olympe.ra.P={xa:'logging.Manager'};olympe.ra.Config={Xo:'logging',Yo:'logging.showLogLevel',Es:'logging',Pu:'showLogLevel'};olympe.T.config(function(a){D(a,olympe.ra.Config.Xo,olympe.ra.Pb.C.wp);D(a,olympe.ra.Config.Yo,!0);qa(a,olympe.ra.P.xa,olympe.ra.rd.sa,olympe.T.P.cg,new olympe.T.fa(olympe.ra.Config.Xo),new olympe.T.fa(olympe.ra.Config.Yo))},'olympe.logging');olympe.T.run([olympe.ra.P.xa],a=>{olympe.ra.Xa=b=>a.Rc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.Config={Vp:'df.nodeCreationThreshold'};const Ma=[];function Na(){}function Oa(){}olympe.D.J=class a{constructor(b,c,d){this.C=void 0===b?Na:b;this.F=void 0===c?Ma:c;this.aa=d}static L(){var b=[];return void 0===b||0===b.length?olympe.D.J.ja:new a(Oa,b)}L(){return this.C?this.C():void 0}G(){return this.F?this.F:Ma}U(){return null===this.C&&null===this.F}Y(){return this.C===Oa}};olympe.D.J.aa=new olympe.D.J;olympe.D.J.C=new olympe.D.J(null,null);olympe.D.J.ja=new olympe.D.J(Oa);olympe.D.J.G=new olympe.D.J(()=>olympe.D.ea);
239
- olympe.D.J.F=new olympe.D.J(()=>olympe.D.Wa);olympe.D.J.U=new olympe.D.J(()=>olympe.D.qa);olympe.D.J.Y=new olympe.D.J(()=>olympe.D.lc);olympe.D.yh=class{Z(){return''}Lb(){return''}destroy(){}Ab(){return!1}G(){return!1}run(a,...b){return a(...b)}C(a){return a}getParent(){return null}be(){}kh(){}wc(){}ad(){}Nk(){}aa(){}onDestroy(){return''}Je(){}zc(){return''}Lc(){}};olympe.D.yh.prototype.offDestroy=olympe.D.yh.prototype.Je;olympe.D.yh.prototype.onDestroy=olympe.D.yh.prototype.onDestroy;let Pa=0;olympe.T.run([new olympe.T.fa(olympe.D.Config.Vp)],()=>{});
240
- olympe.D.Xb=class{constructor(a='SimpleContext',b){++Pa;this.children=new Map;this.Da=new Map;this.oa=new Map;this.wb=0;this.name=a;this.id=String(Pa);this.ab=this.Sa=!1;(this.parent=void 0===b?olympe.D.Ja():b)&&this.parent.wc(this);this.debug=!1}Z(){return this.id}Lb(){return this.name}run(a,...b){if(!this.Sa){var c=olympe.D.ls(this);a=a(...b);c&&olympe.D.ls(c);return a}}C(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Sa&&!this.ab){this.ab=!0;this.aa();for(const a of this.Da.keys())this.Da.has(a)&&
241
- this.Da.get(a)();this.Da.clear();this.oa.clear();this.parent&&(this.parent.ad(this,!1),this.parent=null);this.Sa=!0;this.ab=!1;this.aa()}}Ab(){return this.Sa}G(){return this.ab}wc(a){if(!this.Sa){var b;olympe.D.lb(a)?b=a.Na:olympe.D.qn(a)&&(b=a);b&&this.children.set(b.Z(),b)}}ad(a,b=!0){let c;olympe.D.lb(a)?c=a.Na:olympe.D.qn(a)&&(c=a);c&&this.children.has(c.Z())&&(b&&c.Nk(this),this.children.delete(c.Z()))}Nk(){this.parent=null;this.destroy()}aa(){const a=this.children;for(const b of a.keys())a.has(b)&&
242
- a.get(b).Nk(this);this.children.clear();for(const b of this.oa.keys())this.oa.has(b)&&this.oa.get(b)();this.oa.clear()}onDestroy(a,b){void 0===b&&(++this.wb,b=String(this.wb));this.Da.set(b,a);return b}Je(a){this.Da.delete(a)}zc(a){if(void 0===b){++this.wb;var b=String(this.wb)}this.oa.set(b,a);return b}Lc(a){this.oa.delete(a)}be(a){this.parent&&this.parent.ad(this,!1);(this.parent=a||null)&&this.parent.wc(this)}getParent(){return this.parent}kh(){return this.children}};
243
- olympe.D.Iq=class extends olympe.D.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Je(){}};olympe.D.yh.la=[olympe.D.yh];let Qa=0;
244
- function Ra(a,b){a.Y||(a.Y=new Map);a.Y.set(b.Z(),b);switch(b.Rd()){case olympe.D.Node.C.Fh:break;case olympe.D.Node.C.Rh:break;case olympe.D.Node.C.ik:case olympe.D.Node.C.fg:olympe.D.N.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.zh:Sa(a,olympe.D.Node.C.zh);break;case olympe.D.Node.C.OBSOLETE:a.ac=!0;a.F!==olympe.D.Node.C.zh&&Sa(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.eg:olympe.D.N.warn('Adding a destroyed node as upstream => should never happen!');break;
245
- default:olympe.D.N.warn('Unknown state, investigate: ',b.Rd())}Ta(b,a)}
246
- function Ua(a){if(a.Bd){var b=[],c=[];if(a.Xf)if(a.Xf instanceof olympe.D.Node)if(Va(a.Xf))b=a.Xf.Kb;else return;else b=a.Xf;else b=null;if(null!==a.ja){const e=a.ug;for(let f=0,g=a.ja.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ja[f];if(Va(h))c.push(h.Kb);else return}else c.push(a.ja[f])}if(a.Bd instanceof Function)var d=a.Bd;else b&&(b[a.Bd]||olympe.D.N.warn('looks like you forget a cast somewhere around '+a.Bd),d=b[a.Bd]);a.run(()=>{a.aa();if(void 0!==d){const e=d.apply(b,c);e&&e.wr?
247
- Wa(a,e.Na):e instanceof olympe.D.Node?Wa(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Sa(a,olympe.D.Node.C.Rh))}else Xa(a)})}}function L(a){void 0===a.Ib&&(a.Ib=a.valueType===olympe.D.Proxy?Ya(void 0,a.yd):Ya(a.valueType,a.yd),a.Ib.Na=a);return a.Ib}function Za(a){void 0!==a.L&&($a(a.L,a),a.L=void 0)}function ab(a){if(a.F===olympe.D.Node.C.OBSOLETE&&(a.F=olympe.D.Node.C.Rh,null!==a.U))for(const b of a.U.values())bb(b)}function Sa(a,b){b!==a.F&&(a.F=b)}
248
- function cb(a){if(a.F!==olympe.D.Node.C.OBSOLETE&&a.F!==olympe.D.Node.C.ik&&a.F!==olympe.D.Node.C.Fh&&a.F!==olympe.D.Node.C.zh){Sa(a,olympe.D.Node.C.ik);var b=a.U;if(b)for(const c of b.values())b.has(c.Z())&&cb(c);Sa(a,olympe.D.Node.C.OBSOLETE)}}function db(a,b,c){if(a.F!==olympe.D.Node.C.fg)if(b===a.L)K(a,c,!0);else{if(a.F===olympe.D.Node.C.OBSOLETE||a.F===olympe.D.Node.C.ik)a.ac=!0;Ua(a)}}
249
- function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.N.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Kb);a.Ya||c||void 0===a.L||Za(a);if(void 0!==b){if((a.Ya||a.F===olympe.D.Node.C.Rh||a.F===olympe.D.Node.C.OBSOLETE)&&!olympe.D.lb(b)&&void 0!==a.Kb){if(null===b&&null===a.Kb){ab(a);return}if(null!==b&&null!==a.Kb&&(b.valueOf()===a.Kb.valueOf()||a.Kb.qb&&a.Kb.qb(b))){ab(a);return}}if(!0===a.Ya)olympe.D.N.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
- a.Z()+') value to get updated !');else{a.F===olympe.D.Node.C.eg&&olympe.D.N.warn(`trying to set a value on a destroyed node (#${a.Z()} ${a.zd?', '+a.zd:''})`);a.F===olympe.D.Node.C.fg&&olympe.D.N.warn(`trying to set a value on a node being destroyed (#${a.Z()} ${a.zd?', '+a.zd:''})`);a.Ya=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
251
- Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Wa?(c=olympe.D.Bb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ea?(c=olympe.D.za(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.qa&&(c=olympe.D.Cc(c),d=!1)));a.Kb=c;Sa(a,olympe.D.Node.C.Rh);if(b=a.U){d=0;for(const f of b.values())0<d&&cb(f),d++;for(const f of b.values())db(f,a,c)}a.Ya=!1}}}
252
- function eb(a,b){if(a.F!==olympe.D.Node.C.fg&&a.F!==olympe.D.Node.C.eg&&(a.F!==olympe.D.Node.C.Fh||a.Bd)){var c=void 0!==a.defaultValue;a.Bd&&b!==a.L&&a.aa();if(c)K(a,a.defaultValue,!0);else if(a.Kb=void 0,Sa(a,olympe.D.Node.C.Fh),b=a.U)for(const d of b.values())eb(d,a)}}function Xa(a){if(a.F!==olympe.D.Node.C.zh){Sa(a,olympe.D.Node.C.zh);var b=a.U;if(b)for(const c of b.values())Xa(c);a.aa();void 0!==a.L&&Za(a);a.Kb=a.defaultValue}}function Va(a){return a.F===olympe.D.Node.C.Rh}
253
- function Wa(a,b){b===a?olympe.D.N.error('Setting a node as provider of itself. Ignoring'):(a.L&&a.L!==b&&Za(a),Ta(b,a),Va(b)?K(a,b.Kb,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):eb(a),a.L=b)}function fb(a,b){a.Bd&&(a.Bd=void 0);a.zd='Repeater';Wa(a,b)}function bb(a){a.L?ab(a):null!==a.Y&&0===Array.from(a.Y.values()).filter(b=>!Va(b)).length&&(a.ac&&(a.ac=!1,Ua(a)),ab(a))}
254
- function Ta(a,b){a.U||(a.U=new Map);a.U.set(b.Z(),b);a.F===olympe.D.Node.C.eg&&olympe.D.N.warn('adding a downstream node on a deleted one (#'+a.Z()+') !')}function $a(a,b){a.U&&(b=b.Z(),a.U.has(b)&&(a.U.delete(b),gb(a)))}function gb(a){if(null===a.getParent()){var b=a.U;b&&0<b.size||a.destroy()}}
255
- olympe.D.Node=class extends olympe.D.Xb{constructor({valueType:a,Bd:b,ny:c=!0,Xf:d,ln:e,debug:f=!1,ug:g=null,zd:h='Node',Vi:k}={}){++Qa;super(String(Qa));this.debug=!!f;this.zd=h;h&&'string'===typeof h||(b?this.zd=b.name?b.name:'anon()':this.zd='Node');this.ja=e&&0<e.length?e:null;this.ug=g&&0<g.length?g:null;this.valueType=a;this.Kb=void 0;this.Ya=!1;this.F=olympe.D.Node.C.Fh;this.ac=!1;this.U=this.Y=null;this.Bd=b;this.Xf=d||null;this.defaultValue=this.Ib=this.L=void 0;this.Vi=k;d&&d instanceof
256
- olympe.D.Node&&Ra(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ra(this,a);c&&Ua(this)}bf(a){this.defaultValue=a;this.F===olympe.D.Node.C.Fh&&K(this,a,!0);return this}Zi(a){this.valueType=a}Yb(){return this.valueType||Object}Rd(){return this.F}Ab(){return this.F===olympe.D.Node.C.eg}G(){return this.F===olympe.D.Node.C.fg}yd(...a){if(this.Vi instanceof Function)return this.Vi(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.Rd();a!==olympe.D.Node.C.fg&&
257
- a!==olympe.D.Node.C.eg||olympe.D.N.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.lb(g)&&b.push(g.Na);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.zf&&(e[g]=f.Na,b.push(g));return L(new olympe.D.Node({valueType:d.L(),Bd:c,Xf:this,ln:e,debug:!1,ug:b,zd:'Proxy.'+c+'()'}))}Nk(a){if(null===this.getParent())olympe.D.N.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.N.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
- a,this.getParent());return}this.be(null);gb(this)}destroy(){var a=this.F;if(a!==olympe.D.Node.C.fg&&a!==olympe.D.Node.C.eg){Sa(this,olympe.D.Node.C.fg);if(a=this.U){for(const c of a.values())if(a.has(c.Z())){var b=c;b.Y&&b.Y.delete(this.Z());b.L&&b.L.Z()===this.Z()?b.L=void 0:b.destroy()}a.clear()}this.U=null;super.destroy();if(this.Y){for(const c of this.Y.values())this.Y.has(c.Z())&&$a(c,this);this.Y.clear()}this.Y=null;this.L&&($a(this.L,this),this.L=void 0);this.Kb=void 0;this.ja&&(this.ja.length=
259
- 0,this.ja=null);this.ug&&(this.ug.length=0,this.ug=null);this.Vi=this.Bd=void 0;this.defaultValue=this.Xf=null;this.zd=`** Destroyed ** ${this.zd}`;Sa(this,olympe.D.Node.C.eg)}}Lb(){return this.zd}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Fh:0,Rh:1,zh:3,ik:4,OBSOLETE:5,fg:6,eg:7};function Ya(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.N.error('investigate');c=Object.create(hb(c,a.prototype));c.Hk=a;c.xr=b;return c}function hb(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.km)||Object.defineProperty(b,olympe.D.Proxy.km,{enumerable:!1,configurable:!1,writable:!1,value:ib(a,b)});return b[olympe.D.Proxy.km]}
260
- function jb(a,b){if(a.Hk!==b){a.Hk=b;b.prototype||olympe.D.N.error('Cast not possible, provided type is not a valid type!');var c=hb(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Na&&a.Na.Zi(b)}}
261
- function ib(a,b){let c={};if(b.prototype)olympe.D.N.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(hb(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.U()?c[d]=function(...f){var g=this.Na;if(g&&Va(g)&&(g=g.Kb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.aa,c[d]=function(...f){f=this.xr.call(this.Na,
262
- ...f,e,d);const g=e.aa;if(g){const h=this.Na.Kb;h&&h[g]&&jb(f,h[g])}return e.Y()?this:f})}});return c}function kb(a,b){K(a.Na,b)}function lb(a){eb(a.Na)}function mb(a){olympe.D.Ec([olympe.D.qa.C],b=>{a.Na.bf(b)},'setDefaultValue');return a}function nb(a,b){fb(a.Na,olympe.D.Uf(b)?b:b.Na)}function ob(a,b){olympe.D.lb(b)||olympe.D.Uf(b)?nb(a,b):kb(a,b)}
263
- olympe.D.Proxy=class{constructor(a,b){this.Na=null;this.Hk=a;this.xr=b}static lb(a){return!(!a||!a.zf)}qb(a){return olympe.D.Fa([this,a],(b,c)=>b===c,Boolean)}Td(a){return olympe.D.Fa([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.qa.F:olympe.D.qa.C:b.valueOf()===c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa)}wr(){return this.Na}};olympe.D.Proxy.km='__opp__';olympe.D.Proxy.prototype.zf=!0;function pb(a,b){a.node.bf(b);return a}olympe.D.Uj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.lb(a)?K(this.node,olympe.D.bb(a)):K(this.node,a);return this}repeat(a){fb(this.node,olympe.D.lb(a)?a.Na:a);return this}clear(){eb(this.node);return this}Fb(){return L(this.node)}};function qb(a,b,c=1E3,d,e){const f=olympe.D.Uc(olympe.D.ea),g=d||olympe.D.ea.Do.Lp;let h,k,l,n;f.update(olympe.D.za(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.node.Ab()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.D.za(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.Fb()}
264
- olympe.D.ea=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static nc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.za(b.value)}Jn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Cc(!this.Jn())}Vc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Bb(''):olympe.D.Bb(this.value.toString())}toString(a,b){return void 0!==
231
+ Ha(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Ia('hello')&&(Ga=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.W.mb=Ia;olympe.W.ny=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
232
+ r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,EC:g||null,ts:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,RC:f||null,parameters:b}};olympe.W.iD=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.W.lD=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};
233
+ olympe.W.Tr=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};olympe.W.xn=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.W.xn(a[c],d):a[c]=d}};olympe.W.an=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.W.xn(d,e);b(`conf.d/${a}`,f=>{olympe.W.xn(d,f);c(d)})})};olympe.W.BC=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Bg(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.W.ez=class{constructor(a,b,c,d){this.from=a;this.target=b;this.C=c;this.F=d}toString(){return`(${this.from.toString()}, ${this.target.toString()}, ${this.C.toString()}, ${this.F.toString()})`}};olympe.W.fu=class{constructor(a,b){this.start=a;this.end=b}};olympe.W.fu.C={Ii:'left',Qi:'right',cz:'bottom',XB:'top'};function Ja(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.W.Uh.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.W.Uh.C:new olympe.W.Uh(b,c,d,a[4])}function Ka(a){return`${a.C}.${a.F}.${a.G}`}
234
+ olympe.W.Uh=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.N=d||null}Wk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}Bj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<a.G}qb(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.N?`-${this.N}`:'')}};olympe.W.Uh.C=new olympe.W.Uh(Number.NaN,Number.NaN,Number.NaN);olympe.W.P={wh:'utils.binaryConverter',As:'utils.base64Converter'};olympe.T.config(a=>{sa(a,olympe.W.P.wh);ra(a,olympe.W.P.As,olympe.W.P.wh,!0)},'Utils services');olympe.T.run([olympe.W.P.wh],a=>{olympe.W.ci=()=>a});olympe.ra={};olympe.ra.Pb=class{N(){}oa(){}G(){}aa(){}ha(){}Da(){}U(){}Y(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ra.Pb.prototype.fatal=olympe.ra.Pb.prototype.fatal;olympe.ra.Pb.prototype.error=olympe.ra.Pb.prototype.error;olympe.ra.Pb.prototype.warn=olympe.ra.Pb.prototype.warn;olympe.ra.Pb.prototype.info=olympe.ra.Pb.prototype.info;olympe.ra.Pb.prototype.log=olympe.ra.Pb.prototype.log;olympe.ra.Pb.prototype.debug=olympe.ra.Pb.prototype.debug;olympe.ra.Pb.prototype.trace=olympe.ra.Pb.prototype.trace;
235
+ olympe.ra.Pb.C={ev:0,eg:1,bu:2,wp:3,ov:4,cc:5,et:6,bm:7};olympe.ra.Pb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ra.sa=class{Rc(){}};olympe.ra.rd={};function La(a,b,c,d,e,f){var g=new Date;g=('00'+g.getHours()).substr(-2)+':'+('00'+g.getMinutes()).substr(-2)+':'+('00'+g.getSeconds()).substr(-2)+'.'+('00'+g.getMilliseconds()).substr(-3);f=a.Ya?`%c[${g}] [${f.toUpperCase()}] ${c}:%c`:`%c[${g}] ${c}:%c`;for(const h of d)f+=' '+h;a.Sa[b](f,'color: '+e,'color: #444');for(const h of a.Ld.values())h(g,c,b,...d)}
236
+ olympe.ra.rd.Pb=class{constructor(a,b,c){this.name=a;this.C=b;this.Ya=c;this.F=a.toUpperCase();this.Ld=new Map;this.Sa=console}N(){return this.C}oa(){return this.C<=olympe.ra.Pb.C.ev}G(){return this.C<=olympe.ra.Pb.C.eg}ha(){return this.C<=olympe.ra.Pb.C.bu}aa(){return this.C<=olympe.ra.Pb.C.wp}Da(){return this.C<=olympe.ra.Pb.C.ov}U(){return this.C<=olympe.ra.Pb.C.cc}Y(){return this.C<=olympe.ra.Pb.C.et}trace(...a){this.oa()&&La(this,'log',this.F,a,'#99b','trace')}debug(...a){this.G()&&La(this,'log',
237
+ this.F,a,'#888','debug')}log(...a){this.ha()&&La(this,'log',this.F,a,'#000','log')}info(...a){this.aa()&&La(this,'info',this.F,a,'#00f','info')}warn(...a){this.Da()&&La(this,'warn',this.F,a,'#684911','warn')}error(...a){this.U()&&La(this,'error',this.F,a,'#f00','error')}fatal(...a){this.Y()&&La(this,'error',this.F,a,'#f00','fatal')}};olympe.ra.rd.Pb.la=[olympe.ra.Pb];olympe.ra.rd.sa=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.L=this.Rc('logging');this.L.info('Logging initialized, global log level is '+olympe.ra.Pb.F[b])}Rc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.ra.Config.Fs}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.ra.Config.Su}`;Object.prototype.hasOwnProperty.call(this.C.parameters,
238
+ c.toLowerCase())&&(d=!0===this.C.getParameter(c));b=new olympe.ra.rd.Pb(a,b,d);this.channels.set(a,b)}return b}};olympe.ra.rd.sa.la=[olympe.ra.sa];olympe.ra.P={xa:'logging.Manager'};olympe.ra.Config={Xo:'logging',Yo:'logging.showLogLevel',Fs:'logging',Su:'showLogLevel'};olympe.T.config(function(a){D(a,olympe.ra.Config.Xo,olympe.ra.Pb.C.wp);D(a,olympe.ra.Config.Yo,!0);qa(a,olympe.ra.P.xa,olympe.ra.rd.sa,olympe.T.P.dg,new olympe.T.fa(olympe.ra.Config.Xo),new olympe.T.fa(olympe.ra.Config.Yo))},'olympe.logging');olympe.T.run([olympe.ra.P.xa],a=>{olympe.ra.Xa=b=>a.Rc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.Config={Vp:'df.nodeCreationThreshold'};const Ma=[];function Na(){}function Oa(){}olympe.D.J=class a{constructor(b,c,d){this.C=void 0===b?Na:b;this.F=void 0===c?Ma:c;this.aa=d}static N(){var b=[];return void 0===b||0===b.length?olympe.D.J.ha:new a(Oa,b)}N(){return this.C?this.C():void 0}G(){return this.F?this.F:Ma}U(){return null===this.C&&null===this.F}Y(){return this.C===Oa}};olympe.D.J.aa=new olympe.D.J;olympe.D.J.C=new olympe.D.J(null,null);olympe.D.J.ha=new olympe.D.J(Oa);olympe.D.J.G=new olympe.D.J(()=>olympe.D.ea);
239
+ olympe.D.J.F=new olympe.D.J(()=>olympe.D.Wa);olympe.D.J.U=new olympe.D.J(()=>olympe.D.qa);olympe.D.J.Y=new olympe.D.J(()=>olympe.D.mc);olympe.D.zh=class{Z(){return''}Lb(){return''}destroy(){}Ab(){return!1}G(){return!1}run(a,...b){return a(...b)}C(a){return a}getParent(){return null}be(){}lh(){}wc(){}ad(){}Ok(){}aa(){}onDestroy(){return''}Ke(){}zc(){return''}Lc(){}};olympe.D.zh.prototype.offDestroy=olympe.D.zh.prototype.Ke;olympe.D.zh.prototype.onDestroy=olympe.D.zh.prototype.onDestroy;let Pa=0;olympe.T.run([new olympe.T.fa(olympe.D.Config.Vp)],()=>{});
240
+ olympe.D.Xb=class{constructor(a='SimpleContext',b){++Pa;this.children=new Map;this.Da=new Map;this.oa=new Map;this.wb=0;this.name=a;this.id=String(Pa);this.ab=this.Sa=!1;(this.parent=void 0===b?olympe.D.Ja():b)&&this.parent.wc(this);this.debug=!1}Z(){return this.id}Lb(){return this.name}run(a,...b){if(!this.Sa){var c=olympe.D.ms(this);a=a(...b);c&&olympe.D.ms(c);return a}}C(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Sa&&!this.ab){this.ab=!0;this.aa();for(const a of this.Da.keys())this.Da.has(a)&&
241
+ this.Da.get(a)();this.Da.clear();this.oa.clear();this.parent&&(this.parent.ad(this,!1),this.parent=null);this.Sa=!0;this.ab=!1;this.aa()}}Ab(){return this.Sa}G(){return this.ab}wc(a){if(!this.Sa){var b;olympe.D.lb(a)?b=a.Na:olympe.D.qn(a)&&(b=a);b&&this.children.set(b.Z(),b)}}ad(a,b=!0){let c;olympe.D.lb(a)?c=a.Na:olympe.D.qn(a)&&(c=a);c&&this.children.has(c.Z())&&(b&&c.Ok(this),this.children.delete(c.Z()))}Ok(){this.parent=null;this.destroy()}aa(){const a=this.children;for(const b of a.keys())a.has(b)&&
242
+ a.get(b).Ok(this);this.children.clear();for(const b of this.oa.keys())this.oa.has(b)&&this.oa.get(b)();this.oa.clear()}onDestroy(a,b){void 0===b&&(++this.wb,b=String(this.wb));this.Da.set(b,a);return b}Ke(a){this.Da.delete(a)}zc(a){if(void 0===b){++this.wb;var b=String(this.wb)}this.oa.set(b,a);return b}Lc(a){this.oa.delete(a)}be(a){this.parent&&this.parent.ad(this,!1);(this.parent=a||null)&&this.parent.wc(this)}getParent(){return this.parent}lh(){return this.children}};
243
+ olympe.D.Jq=class extends olympe.D.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Ke(){}};olympe.D.zh.la=[olympe.D.zh];let Qa=0;
244
+ function Ra(a,b){a.Y||(a.Y=new Map);a.Y.set(b.Z(),b);switch(b.Rd()){case olympe.D.Node.C.Gh:break;case olympe.D.Node.C.Th:break;case olympe.D.Node.C.jk:case olympe.D.Node.C.gg:olympe.D.L.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Ah:Sa(a,olympe.D.Node.C.Ah);break;case olympe.D.Node.C.OBSOLETE:a.ac=!0;a.F!==olympe.D.Node.C.Ah&&Sa(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.fg:olympe.D.L.warn('Adding a destroyed node as upstream => should never happen!');break;
245
+ default:olympe.D.L.warn('Unknown state, investigate: ',b.Rd())}Ta(b,a)}
246
+ function Ua(a){if(a.Bd){var b=[],c=[];if(a.Yf)if(a.Yf instanceof olympe.D.Node)if(Va(a.Yf))b=a.Yf.Kb;else return;else b=a.Yf;else b=null;if(null!==a.ha){const e=a.vg;for(let f=0,g=a.ha.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ha[f];if(Va(h))c.push(h.Kb);else return}else c.push(a.ha[f])}if(a.Bd instanceof Function)var d=a.Bd;else b&&(b[a.Bd]||olympe.D.L.warn('looks like you forget a cast somewhere around '+a.Bd),d=b[a.Bd]);a.run(()=>{a.aa();if(void 0!==d){const e=d.apply(b,c);e&&e.xr?
247
+ Wa(a,e.Na):e instanceof olympe.D.Node?Wa(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Sa(a,olympe.D.Node.C.Th))}else Xa(a)})}}function L(a){void 0===a.Ib&&(a.Ib=a.valueType===olympe.D.Proxy?Ya(void 0,a.yd):Ya(a.valueType,a.yd),a.Ib.Na=a);return a.Ib}function Za(a){void 0!==a.N&&($a(a.N,a),a.N=void 0)}function ab(a){if(a.F===olympe.D.Node.C.OBSOLETE&&(a.F=olympe.D.Node.C.Th,null!==a.U))for(const b of a.U.values())bb(b)}function Sa(a,b){b!==a.F&&(a.F=b)}
248
+ function cb(a){if(a.F!==olympe.D.Node.C.OBSOLETE&&a.F!==olympe.D.Node.C.jk&&a.F!==olympe.D.Node.C.Gh&&a.F!==olympe.D.Node.C.Ah){Sa(a,olympe.D.Node.C.jk);var b=a.U;if(b)for(const c of b.values())b.has(c.Z())&&cb(c);Sa(a,olympe.D.Node.C.OBSOLETE)}}function db(a,b,c){if(a.F!==olympe.D.Node.C.gg)if(b===a.N)K(a,c,!0);else{if(a.F===olympe.D.Node.C.OBSOLETE||a.F===olympe.D.Node.C.jk)a.ac=!0;Ua(a)}}
249
+ function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.L.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Kb);a.Ya||c||void 0===a.N||Za(a);if(void 0!==b){if((a.Ya||a.F===olympe.D.Node.C.Th||a.F===olympe.D.Node.C.OBSOLETE)&&!olympe.D.lb(b)&&void 0!==a.Kb){if(null===b&&null===a.Kb){ab(a);return}if(null!==b&&null!==a.Kb&&(b.valueOf()===a.Kb.valueOf()||a.Kb.qb&&a.Kb.qb(b))){ab(a);return}}if(!0===a.Ya)olympe.D.L.error("Circular dependency detected: updating a downstream node caused this node's (#"+
250
+ a.Z()+') value to get updated !');else{a.F===olympe.D.Node.C.fg&&olympe.D.L.warn(`trying to set a value on a destroyed node (#${a.Z()} ${a.zd?', '+a.zd:''})`);a.F===olympe.D.Node.C.gg&&olympe.D.L.warn(`trying to set a value on a node being destroyed (#${a.Z()} ${a.zd?', '+a.zd:''})`);a.Ya=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
251
+ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Wa?(c=olympe.D.Bb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ea?(c=olympe.D.za(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.qa&&(c=olympe.D.Cc(c),d=!1)));a.Kb=c;Sa(a,olympe.D.Node.C.Th);if(b=a.U){d=0;for(const f of b.values())0<d&&cb(f),d++;for(const f of b.values())db(f,a,c)}a.Ya=!1}}}
252
+ function eb(a,b){if(a.F!==olympe.D.Node.C.gg&&a.F!==olympe.D.Node.C.fg&&(a.F!==olympe.D.Node.C.Gh||a.Bd)){var c=void 0!==a.defaultValue;a.Bd&&b!==a.N&&a.aa();if(c)K(a,a.defaultValue,!0);else if(a.Kb=void 0,Sa(a,olympe.D.Node.C.Gh),b=a.U)for(const d of b.values())eb(d,a)}}function Xa(a){if(a.F!==olympe.D.Node.C.Ah){Sa(a,olympe.D.Node.C.Ah);var b=a.U;if(b)for(const c of b.values())Xa(c);a.aa();void 0!==a.N&&Za(a);a.Kb=a.defaultValue}}function Va(a){return a.F===olympe.D.Node.C.Th}
253
+ function Wa(a,b){b===a?olympe.D.L.error('Setting a node as provider of itself. Ignoring'):(a.N&&a.N!==b&&Za(a),Ta(b,a),Va(b)?K(a,b.Kb,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):eb(a),a.N=b)}function fb(a,b){a.Bd&&(a.Bd=void 0);a.zd='Repeater';Wa(a,b)}function bb(a){a.N?ab(a):null!==a.Y&&0===Array.from(a.Y.values()).filter(b=>!Va(b)).length&&(a.ac&&(a.ac=!1,Ua(a)),ab(a))}
254
+ function Ta(a,b){a.U||(a.U=new Map);a.U.set(b.Z(),b);a.F===olympe.D.Node.C.fg&&olympe.D.L.warn('adding a downstream node on a deleted one (#'+a.Z()+') !')}function $a(a,b){a.U&&(b=b.Z(),a.U.has(b)&&(a.U.delete(b),gb(a)))}function gb(a){if(null===a.getParent()){var b=a.U;b&&0<b.size||a.destroy()}}
255
+ olympe.D.Node=class extends olympe.D.Xb{constructor({valueType:a,Bd:b,qy:c=!0,Yf:d,ln:e,debug:f=!1,vg:g=null,zd:h='Node',Xi:k}={}){++Qa;super(String(Qa));this.debug=!!f;this.zd=h;h&&'string'===typeof h||(b?this.zd=b.name?b.name:'anon()':this.zd='Node');this.ha=e&&0<e.length?e:null;this.vg=g&&0<g.length?g:null;this.valueType=a;this.Kb=void 0;this.Ya=!1;this.F=olympe.D.Node.C.Gh;this.ac=!1;this.U=this.Y=null;this.Bd=b;this.Yf=d||null;this.defaultValue=this.Ib=this.N=void 0;this.Xi=k;d&&d instanceof
256
+ olympe.D.Node&&Ra(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ra(this,a);c&&Ua(this)}cf(a){this.defaultValue=a;this.F===olympe.D.Node.C.Gh&&K(this,a,!0);return this}aj(a){this.valueType=a}Yb(){return this.valueType||Object}Rd(){return this.F}Ab(){return this.F===olympe.D.Node.C.fg}G(){return this.F===olympe.D.Node.C.gg}yd(...a){if(this.Xi instanceof Function)return this.Xi(...a);var b=a.length;--b;const c=a[b];--b;const d=a[b],e=Array(b);for(var f=0;f<b;f++)e[f]=a[f];a=this.Rd();a!==olympe.D.Node.C.gg&&
257
+ a!==olympe.D.Node.C.fg||olympe.D.L.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.lb(g)&&b.push(g.Na);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Af&&(e[g]=f.Na,b.push(g));return L(new olympe.D.Node({valueType:d.N(),Bd:c,Yf:this,ln:e,debug:!1,vg:b,zd:'Proxy.'+c+'()'}))}Ok(a){if(null===this.getParent())olympe.D.L.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.L.warn('Investigate a potential issue in creator-createe link: create node mismatch',
258
+ a,this.getParent());return}this.be(null);gb(this)}destroy(){var a=this.F;if(a!==olympe.D.Node.C.gg&&a!==olympe.D.Node.C.fg){Sa(this,olympe.D.Node.C.gg);if(a=this.U){for(const c of a.values())if(a.has(c.Z())){var b=c;b.Y&&b.Y.delete(this.Z());b.N&&b.N.Z()===this.Z()?b.N=void 0:b.destroy()}a.clear()}this.U=null;super.destroy();if(this.Y){for(const c of this.Y.values())this.Y.has(c.Z())&&$a(c,this);this.Y.clear()}this.Y=null;this.N&&($a(this.N,this),this.N=void 0);this.Kb=void 0;this.ha&&(this.ha.length=
259
+ 0,this.ha=null);this.vg&&(this.vg.length=0,this.vg=null);this.Xi=this.Bd=void 0;this.defaultValue=this.Yf=null;this.zd=`** Destroyed ** ${this.zd}`;Sa(this,olympe.D.Node.C.fg)}}Lb(){return this.zd}};olympe.D.Node.F='rootNode';olympe.D.Node.C={Gh:0,Th:1,Ah:3,jk:4,OBSOLETE:5,gg:6,fg:7};function Ya(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.L.error('investigate');c=Object.create(hb(c,a.prototype));c.Ik=a;c.yr=b;return c}function hb(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.km)||Object.defineProperty(b,olympe.D.Proxy.km,{enumerable:!1,configurable:!1,writable:!1,value:ib(a,b)});return b[olympe.D.Proxy.km]}
260
+ function jb(a,b){if(a.Ik!==b){a.Ik=b;b.prototype||olympe.D.L.error('Cast not possible, provided type is not a valid type!');var c=hb(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Na&&a.Na.aj(b)}}
261
+ function ib(a,b){let c={};if(b.prototype)olympe.D.L.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(hb(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.U()?c[d]=function(...f){var g=this.Na;if(g&&Va(g)&&(g=g.Kb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.aa,c[d]=function(...f){f=this.yr.call(this.Na,
262
+ ...f,e,d);const g=e.aa;if(g){const h=this.Na.Kb;h&&h[g]&&jb(f,h[g])}return e.Y()?this:f})}});return c}function kb(a,b){K(a.Na,b)}function lb(a){eb(a.Na)}function mb(a){olympe.D.Ec([olympe.D.qa.C],b=>{a.Na.cf(b)},'setDefaultValue');return a}function nb(a,b){fb(a.Na,olympe.D.Vf(b)?b:b.Na)}function ob(a,b){olympe.D.lb(b)||olympe.D.Vf(b)?nb(a,b):kb(a,b)}
263
+ olympe.D.Proxy=class{constructor(a,b){this.Na=null;this.Ik=a;this.yr=b}static lb(a){return!(!a||!a.Af)}qb(a){return olympe.D.Fa([this,a],(b,c)=>b===c,Boolean)}Td(a){return olympe.D.Fa([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.qa.F:olympe.D.qa.C:b.valueOf()===c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa)}xr(){return this.Na}};olympe.D.Proxy.km='__opp__';olympe.D.Proxy.prototype.Af=!0;function pb(a,b){a.node.cf(b);return a}olympe.D.Wj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.lb(a)?K(this.node,olympe.D.bb(a)):K(this.node,a);return this}repeat(a){fb(this.node,olympe.D.lb(a)?a.Na:a);return this}clear(){eb(this.node);return this}Fb(){return L(this.node)}};function qb(a,b,c=1E3,d,e){const f=olympe.D.Uc(olympe.D.ea),g=d||olympe.D.ea.Do.Lp;let h,k,l,n;f.update(olympe.D.za(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.node.Ab()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.D.za(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.Fb()}
264
+ olympe.D.ea=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static oc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.za(b.value)}Jn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Cc(!this.Jn())}Vc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Bb(''):olympe.D.Bb(this.value.toString())}toString(a,b){return void 0!==
265
265
  this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.Jn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.Uc(olympe.D.ea,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.za(c))};a.forEach((f,g)=>{olympe.D.Ec([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.node.Ab()){var g=b.get(f);b.delete(f);g===c&&
266
- e()}});return d.Fb()}he(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()+c.valueOf()),olympe.D.ea,'ONumber.plus')}th(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()-c.valueOf()),olympe.D.ea,'ONumber.minus')}round(){return olympe.D.za(Math.round(this.valueOf()))}Aj(){return olympe.D.za(-this.valueOf())}cl(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()*c.valueOf()),olympe.D.ea,'ONumber.mul')}$i(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()/c.valueOf()),
267
- olympe.D.ea,'ONumber.div')}Kx(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()%c.valueOf()),olympe.D.ea,'ONumber.div')}floor(){return olympe.D.za(Math.floor(this.valueOf()))}ceil(){return olympe.D.za(Math.ceil(this.valueOf()))}trunc(){return olympe.D.za(Math.trunc(this.valueOf()))}log(){return olympe.D.za(Math.log(this.valueOf()))}pow(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ea,'ONumber.pow')}exp(){return olympe.D.za(Math.exp(this.valueOf()))}Td(a){return olympe.D.Fa([this,
268
- a],(b,c)=>olympe.D.Cc(b.qb(c)),olympe.D.qa,'ONumber.oEquals')}qb(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Qw(){return this.valueOf()}nn(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'ONumber.isBiggerThan')}oy(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.za(c),olympe.D.ea,'ONumber.returnsBiggest')}js(a){return olympe.D.Fa([this,
269
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.za(c),olympe.D.ea,'ONumber.returnsSmallest')}zx(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'ONumber.isSmallerThan')}sin(){return olympe.D.za(Math.sin(this.valueOf()))}cos(){return olympe.D.za(Math.cos(this.valueOf()))}atan2(a){return olympe.D.lb(a)?olympe.D.ie([a],b=>olympe.D.za(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ea):olympe.D.za(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.za(Math.abs(this.valueOf()))}qj(a,
270
- b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.za(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ea):olympe.D.za(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static nv(a,b,c,d){'number'===typeof a&&(a=olympe.D.ge(a));'number'===typeof b&&(b=olympe.D.ge(b));'number'===typeof c&&(c=olympe.D.ge(c));let e=0;const f=olympe.D.ge(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.kn(b.nn(c),()=>{olympe.ra.Xa('df').warn('You have a min bigger than max, cap your inputs')});
271
- const k=(l,n)=>{n=olympe.D.ge(n);const p=olympe.D.ea.animate(n,500);nb(f,p);kb(n,olympe.D.za(l));e=l};olympe.D.ie([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):nb(f,olympe.D.ge(e))},olympe.D.ea);void 0!==b&&olympe.D.el(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.ge(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.za(g);K(n.Na,l);e=g;nb(f,p)}});void 0!==c&&olympe.D.el(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.ge(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.za(h);K(n.Na,l);e=h;nb(f,
272
- p)}});return f}static offset(a){let b;return olympe.D.ie([a],c=>{void 0===b&&(b=c);return olympe.D.za(c-b)},olympe.D.ea,'offset')}static Lr(a){let b,c,d;return olympe.D.Fa([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.za(0);d=window.performance.now();const f=olympe.D.za((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ea,'derivative')}static ux(a){let b=olympe.D.za(0),c,d,e;return olympe.D.Fa([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.za(0);
273
- e=window.performance.now();b=b.he((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ea,'integrate')}static Tv(a){let b;return olympe.D.Fa([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.za(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ea,'diff')}static Hv(a,b,c){return olympe.D.ie([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.D.za(d>=e?d<=f?d:f:e)},olympe.D.ea)}static animate(a,b,c,d){let e;
274
- return e=olympe.D.Fa([a],f=>{const g=olympe.D.bb(b,1E3),h=olympe.D.bb(e);return void 0===h?olympe.D.za(f):qb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ea)}static zv(a,b,c){let d,e,f,g,h,k,l=olympe.D.ge(),n;olympe.D.Ec([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);kb(l,olympe.D.za(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Vc(a){return olympe.D.lb(a)?
275
- olympe.D.Fa([a],b=>olympe.D.Bb(b.valueOf().toString()),olympe.D.Wa):olympe.D.Bb(a)}static Aj(a){return olympe.D.lb(a)?olympe.D.Fa([a],b=>olympe.D.za(-b.valueOf()),olympe.D.ea):olympe.D.za(-a.valueOf())}static he(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.Fa([a,b],(c,d)=>olympe.D.za(c.valueOf()+d.valueOf()),olympe.D.ea,'plus'):olympe.D.za(a.valueOf()+b.valueOf())}static th(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.za(c.valueOf()-d.valueOf()),olympe.D.ea,
276
- 'minus'):olympe.D.za(a.valueOf()-b.valueOf())}static $i(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.za(c.valueOf()/d.valueOf()),olympe.D.ea,'div'):olympe.D.za(a.valueOf()/b.valueOf())}static ly(a,b){if(void 0===b)return a;olympe.D.Ec([b],c=>{c=olympe.D.za(a.Na.Kb.valueOf()+c.valueOf());K(a.Na,c)},'plusEqual');return a}};olympe.D.ea.ZERO=new olympe.D.ea(0);olympe.D.ea.ONE=new olympe.D.ea(1);olympe.D.ea.dv=new olympe.D.ea(2);olympe.D.ea.PI=new olympe.D.ea(Math.PI);
277
- olympe.D.ea.st=new olympe.D.ea(Infinity);olympe.D.ea.ju=new olympe.D.ea(-Infinity);olympe.D.ea.Up=new olympe.D.ea(NaN);olympe.D.ea.IA=olympe.D.ea.ly;olympe.D.ea.Qy=olympe.D.ea.nv;olympe.D.ea.yA=olympe.D.ea.offset;olympe.D.ea.qz=olympe.D.ea.Lr;olympe.D.ea.KC=olympe.D.ea.Lr;olympe.D.ea.jA=olympe.D.ea.ux;olympe.D.ea.rz=olympe.D.ea.Tv;olympe.D.ea.fz=olympe.D.ea.Hv;olympe.D.ea.Ry=olympe.D.ea.animate;olympe.D.ea.Sy=olympe.D.ea.zv;olympe.D.ea.XB=olympe.D.ea.Vc;olympe.D.ea.YB=olympe.D.ea.Aj;
278
- olympe.D.ea.HA=olympe.D.ea.he;olympe.D.ea.tA=olympe.D.ea.th;olympe.D.ea.sz=olympe.D.ea.$i;
279
- olympe.D.ea.Do={Lp:function(a,b,c,d){return c*a/d+b},Nz:function(a,b,c,d){a/=d;return c*a*a+b},Xz:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},Jz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},Cz:function(a,b,c,d){a/=d;return c*a*a*a+b},Tz:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},Hz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},Oz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Yz:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
- Kz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},Pz:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},Zz:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Lz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},Qz:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},$z:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Mz:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},Fz:function(a,b,c,d){return c*Math.pow(2,
281
- 10*(a/d-1))+b},Wz:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},Iz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},Bz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Sz:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},Gz:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},wz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},xz:function(a,b,c,d){d=(a/=d)*a;return b+
282
- c*(2*d*d+2*d*a+-3*d)},yz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},zz:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Vz:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},Uz:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},Ez:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},Dz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Rz:function(a,
283
- b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},Az:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.ea.prototype;m.toJSON.K=olympe.D.J.C;m.Jn.K=olympe.D.J.C;m.isNaN.K=olympe.D.J.U;m.Vc.K=olympe.D.J.F;
284
- m.toString.K=new olympe.D.J(()=>String,[]);m.toFixed.K=new olympe.D.J(()=>String,[]);m.he.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.th.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.round.K=olympe.D.J.G;m.Aj.K=olympe.D.J.G;m.cl.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.$i.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.Kx.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.floor.K=olympe.D.J.G;m.ceil.K=olympe.D.J.G;m.trunc.K=olympe.D.J.G;m.log.K=olympe.D.J.G;m.pow.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.exp.K=olympe.D.J.G;
285
- m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.qb.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.Qw.K=olympe.D.J.C;m.nn.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.oy.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.js.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.zx.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.sin.K=olympe.D.J.G;m.cos.K=olympe.D.J.G;m.atan2.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.abs.K=olympe.D.J.G;m.qj.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);olympe.D.Wa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static nc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Bb(b.value)}Hr(a){return olympe.D.Wa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.Fa([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.Bb(d)},olympe.D.Wa,'OString.concat')}Vc(){return this}Ky(a){return olympe.D.za(parseInt(this.value,
286
- a))}qs(){return olympe.D.za(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}qb(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Td(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Cc(c&&b.valueOf()===c.valueOf()),olympe.D.qa,'OString.oEquals')}Sf(){return olympe.D.Cc(!this.value||0===this.value.length)}contains(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Cc((c instanceof olympe.D.Wa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
287
- olympe.D.qa,'OString.contains')}startsWith(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.Cc(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.qa,'OString.startsWith')}endsWith(a,b){return olympe.D.Fa([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Ag().valueOf()+e.valueOf()+1;return olympe.D.Cc(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.qa,'OString.endsWith')}indexOf(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.za(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
288
- olympe.D.ea,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.Fa([this,a,b||Infinity],(c,d,e)=>olympe.D.za(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.lastIndexOf')}slice(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Wa,'OString.slice')}Ag(){return olympe.D.za(this.value.length)}threshold(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Wa.EMPTY,olympe.D.Wa,'OString.threshold')}toLowerCase(){return olympe.D.Bb(this.value.toLowerCase())}toUpperCase(){return olympe.D.Bb(this.value.toUpperCase())}trim(){return olympe.D.Bb(this.value.trim())}padStart(a,
289
- b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.padStart')}padEnd(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.padEnd')}replace(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.replace')}Hy(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().substr(d.valueOf(),
290
- e.valueOf())),olympe.D.Wa,'OString.subOStr')}static concat(...a){return olympe.D.Bb('').concat(...a)}};olympe.D.Wa.EMPTY=new olympe.D.Wa('');olympe.D.Wa.Qu=new olympe.D.Wa(' ');m=olympe.D.Wa.prototype;m.toJSON.K=olympe.D.J.C;m.Hr.K=new olympe.D.J(()=>olympe.D.Wa,[0,1]);m.concat.K=olympe.D.J.F;m.Vc.K=olympe.D.J.F;m.Ky.K=olympe.D.J.G;m.qs.K=olympe.D.J.G;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.Sf.K=olympe.D.J.U;
291
- m.contains.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.startsWith.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.endsWith.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.indexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.lastIndexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.slice.K=new olympe.D.J(()=>olympe.D.Wa,[0,1]);m.Ag.K=olympe.D.J.G;m.threshold.K=new olympe.D.J(()=>olympe.D.Wa,[0]);m.toLowerCase.K=olympe.D.J.F;m.toUpperCase.K=olympe.D.J.F;m.trim.K=olympe.D.J.F;m.padStart.K=olympe.D.J.F;m.padEnd.K=olympe.D.J.F;
292
- m.replace.K=olympe.D.J.F;m.Hy.K=olympe.D.J.F;olympe.D.qa=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static nc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.qa.F:olympe.D.qa.C}and(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.ie([a],b=>new olympe.D.qa(this.valueOf()&&b.valueOf()),olympe.D.qa,'and'):this.value&&a.valueOf()?olympe.D.qa.F:olympe.D.qa.C}qb(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Td(a){if(void 0!==a)return olympe.D.lb(a)?
293
- olympe.D.ie([a],b=>new olympe.D.qa(this.valueOf()===b.valueOf()),olympe.D.qa,'oEquals'):this.qb(a)?olympe.D.qa.F:olympe.D.qa.C}not(){return this.value?olympe.D.qa.C:olympe.D.qa.F}yv(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.ie([a],b=>new olympe.D.qa(!(this.valueOf()&&b.valueOf())),olympe.D.qa,'andNot'):this.value&&!a.valueOf()?olympe.D.qa.F:olympe.D.qa.C}or(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.ie([a],b=>new olympe.D.qa(this.valueOf()||b.valueOf()),olympe.D.qa,'or'):this.value||a.valueOf()?
294
- olympe.D.qa.F:olympe.D.qa.C}xor(a){return olympe.D.Fa([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Cc(b&&!c||!b&&c)},olympe.D.qa,'OBoolean.xor')}kw(){return this.value}Tr(){return!0===this.value?olympe.D.ea.ONE:olympe.D.ea.ZERO}Vc(){return olympe.D.Bb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.qa.F=new olympe.D.qa(!0);olympe.D.qa.C=new olympe.D.qa(!1);m=olympe.D.qa.prototype;m.toJSON.K=olympe.D.J.C;
295
- m.and.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.qb.K=olympe.D.J.C;m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.not.K=olympe.D.J.U;m.yv.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.or.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.xor.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.kw.K=new olympe.D.J(()=>Boolean,[]);m.Tr.K=olympe.D.J.G;m.Vc.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;function rb(a){return new olympe.D.jb(new Date(a))}
296
- olympe.D.jb=class{constructor(a){this.yb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.yb.toJSON()+'" }'}static nc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.jb(new Date(b.value.valueOf()))}static now(){return new olympe.D.jb(new Date)}oj(){return this.yb&&!isNaN(this.yb.getTime())?olympe.D.qa.F:olympe.D.qa.C}zt(){return olympe.D.za(this.yb.getMilliseconds())}Bt(){return olympe.D.za(this.yb.getSeconds())}At(){return olympe.D.za(this.yb.getMinutes())}yt(){return olympe.D.za(this.yb.getHours())}uw(){return olympe.D.za(this.yb.getDate())}getMonth(){return olympe.D.za(this.yb.getMonth()+1)}Ct(){return olympe.D.za(this.yb.getFullYear())}getTime(){return this.yb.getTime()}Ey(){var a=
266
+ e()}});return d.Fb()}he(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()+c.valueOf()),olympe.D.ea,'ONumber.plus')}uh(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()-c.valueOf()),olympe.D.ea,'ONumber.minus')}round(){return olympe.D.za(Math.round(this.valueOf()))}Cj(){return olympe.D.za(-this.valueOf())}dl(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()*c.valueOf()),olympe.D.ea,'ONumber.mul')}bj(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()/c.valueOf()),
267
+ olympe.D.ea,'ONumber.div')}Nx(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(b.valueOf()%c.valueOf()),olympe.D.ea,'ONumber.div')}floor(){return olympe.D.za(Math.floor(this.valueOf()))}ceil(){return olympe.D.za(Math.ceil(this.valueOf()))}trunc(){return olympe.D.za(Math.trunc(this.valueOf()))}log(){return olympe.D.za(Math.log(this.valueOf()))}pow(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.za(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ea,'ONumber.pow')}exp(){return olympe.D.za(Math.exp(this.valueOf()))}Td(a){return olympe.D.Fa([this,
268
+ a],(b,c)=>olympe.D.Cc(b.qb(c)),olympe.D.qa,'ONumber.oEquals')}qb(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Tw(){return this.valueOf()}nn(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'ONumber.isBiggerThan')}sy(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.za(c),olympe.D.ea,'ONumber.returnsBiggest')}ks(a){return olympe.D.Fa([this,
269
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.za(c),olympe.D.ea,'ONumber.returnsSmallest')}Cx(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'ONumber.isSmallerThan')}sin(){return olympe.D.za(Math.sin(this.valueOf()))}cos(){return olympe.D.za(Math.cos(this.valueOf()))}atan2(a){return olympe.D.lb(a)?olympe.D.ie([a],b=>olympe.D.za(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ea):olympe.D.za(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.za(Math.abs(this.valueOf()))}sj(a,
270
+ b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.za(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ea):olympe.D.za(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static qv(a,b,c,d){'number'===typeof a&&(a=olympe.D.ge(a));'number'===typeof b&&(b=olympe.D.ge(b));'number'===typeof c&&(c=olympe.D.ge(c));let e=0;const f=olympe.D.ge(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.kn(b.nn(c),()=>{olympe.ra.Xa('df').warn('You have a min bigger than max, cap your inputs')});
271
+ const k=(l,n)=>{n=olympe.D.ge(n);const p=olympe.D.ea.animate(n,500);nb(f,p);kb(n,olympe.D.za(l));e=l};olympe.D.ie([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):nb(f,olympe.D.ge(e))},olympe.D.ea);void 0!==b&&olympe.D.fl(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.ge(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.za(g);K(n.Na,l);e=g;nb(f,p)}});void 0!==c&&olympe.D.fl(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.ge(e),p=olympe.D.ea.animate(n,400,d);l=olympe.D.za(h);K(n.Na,l);e=h;nb(f,
272
+ p)}});return f}static offset(a){let b;return olympe.D.ie([a],c=>{void 0===b&&(b=c);return olympe.D.za(c-b)},olympe.D.ea,'offset')}static Mr(a){let b,c,d;return olympe.D.Fa([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.za(0);d=window.performance.now();const f=olympe.D.za((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ea,'derivative')}static xx(a){let b=olympe.D.za(0),c,d,e;return olympe.D.Fa([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.za(0);
273
+ e=window.performance.now();b=b.he((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ea,'integrate')}static Wv(a){let b;return olympe.D.Fa([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.za(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ea,'diff')}static Kv(a,b,c){return olympe.D.ie([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.D.za(d>=e?d<=f?d:f:e)},olympe.D.ea)}static animate(a,b,c,d){let e;
274
+ return e=olympe.D.Fa([a],f=>{const g=olympe.D.bb(b,1E3),h=olympe.D.bb(e);return void 0===h?olympe.D.za(f):qb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ea)}static Cv(a,b,c){let d,e,f,g,h,k,l=olympe.D.ge(),n;olympe.D.Ec([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);kb(l,olympe.D.za(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Vc(a){return olympe.D.lb(a)?
275
+ olympe.D.Fa([a],b=>olympe.D.Bb(b.valueOf().toString()),olympe.D.Wa):olympe.D.Bb(a)}static Cj(a){return olympe.D.lb(a)?olympe.D.Fa([a],b=>olympe.D.za(-b.valueOf()),olympe.D.ea):olympe.D.za(-a.valueOf())}static he(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.Fa([a,b],(c,d)=>olympe.D.za(c.valueOf()+d.valueOf()),olympe.D.ea,'plus'):olympe.D.za(a.valueOf()+b.valueOf())}static uh(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.za(c.valueOf()-d.valueOf()),olympe.D.ea,
276
+ 'minus'):olympe.D.za(a.valueOf()-b.valueOf())}static bj(a,b){return olympe.D.lb(a)||olympe.D.lb(b)?olympe.D.ie([a,b],(c,d)=>olympe.D.za(c.valueOf()/d.valueOf()),olympe.D.ea,'div'):olympe.D.za(a.valueOf()/b.valueOf())}static oy(a,b){if(void 0===b)return a;olympe.D.Ec([b],c=>{c=olympe.D.za(a.Na.Kb.valueOf()+c.valueOf());K(a.Na,c)},'plusEqual');return a}};olympe.D.ea.ZERO=new olympe.D.ea(0);olympe.D.ea.ONE=new olympe.D.ea(1);olympe.D.ea.gv=new olympe.D.ea(2);olympe.D.ea.PI=new olympe.D.ea(Math.PI);
277
+ olympe.D.ea.vt=new olympe.D.ea(Infinity);olympe.D.ea.mu=new olympe.D.ea(-Infinity);olympe.D.ea.Up=new olympe.D.ea(NaN);olympe.D.ea.JA=olympe.D.ea.oy;olympe.D.ea.Ty=olympe.D.ea.qv;olympe.D.ea.zA=olympe.D.ea.offset;olympe.D.ea.sz=olympe.D.ea.Mr;olympe.D.ea.LC=olympe.D.ea.Mr;olympe.D.ea.kA=olympe.D.ea.xx;olympe.D.ea.uz=olympe.D.ea.Wv;olympe.D.ea.hz=olympe.D.ea.Kv;olympe.D.ea.Uy=olympe.D.ea.animate;olympe.D.ea.Vy=olympe.D.ea.Cv;olympe.D.ea.YB=olympe.D.ea.Vc;olympe.D.ea.ZB=olympe.D.ea.Cj;
278
+ olympe.D.ea.IA=olympe.D.ea.he;olympe.D.ea.uA=olympe.D.ea.uh;olympe.D.ea.vz=olympe.D.ea.bj;
279
+ olympe.D.ea.Do={Lp:function(a,b,c,d){return c*a/d+b},Oz:function(a,b,c,d){a/=d;return c*a*a+b},Yz:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},Kz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},Dz:function(a,b,c,d){a/=d;return c*a*a*a+b},Uz:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},Iz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},Pz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},Zz:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
280
+ Lz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},Qz:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},$z:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Mz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},Rz:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},aA:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Nz:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},Gz:function(a,b,c,d){return c*Math.pow(2,
281
+ 10*(a/d-1))+b},Xz:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},Jz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},Cz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},Tz:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},Hz:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},xz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},yz:function(a,b,c,d){d=(a/=d)*a;return b+
282
+ c*(2*d*d+2*d*a+-3*d)},zz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},Az:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},Wz:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},Vz:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},Fz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},Ez:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},Sz:function(a,
283
+ b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},Bz:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.ea.prototype;m.toJSON.K=olympe.D.J.C;m.Jn.K=olympe.D.J.C;m.isNaN.K=olympe.D.J.U;m.Vc.K=olympe.D.J.F;
284
+ m.toString.K=new olympe.D.J(()=>String,[]);m.toFixed.K=new olympe.D.J(()=>String,[]);m.he.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.uh.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.round.K=olympe.D.J.G;m.Cj.K=olympe.D.J.G;m.dl.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.bj.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.Nx.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.floor.K=olympe.D.J.G;m.ceil.K=olympe.D.J.G;m.trunc.K=olympe.D.J.G;m.log.K=olympe.D.J.G;m.pow.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.exp.K=olympe.D.J.G;
285
+ m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.qb.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.Tw.K=olympe.D.J.C;m.nn.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.sy.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.ks.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.Cx.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.sin.K=olympe.D.J.G;m.cos.K=olympe.D.J.G;m.atan2.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.abs.K=olympe.D.J.G;m.sj.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);olympe.D.Wa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static oc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Bb(b.value)}Ir(a){return olympe.D.Wa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.Fa([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.Bb(d)},olympe.D.Wa,'OString.concat')}Vc(){return this}Ny(a){return olympe.D.za(parseInt(this.value,
286
+ a))}rs(){return olympe.D.za(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}qb(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Td(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Cc(c&&b.valueOf()===c.valueOf()),olympe.D.qa,'OString.oEquals')}Tf(){return olympe.D.Cc(!this.value||0===this.value.length)}contains(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Cc((c instanceof olympe.D.Wa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
287
+ olympe.D.qa,'OString.contains')}startsWith(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.Cc(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.qa,'OString.startsWith')}endsWith(a,b){return olympe.D.Fa([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Bg().valueOf()+e.valueOf()+1;return olympe.D.Cc(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.qa,'OString.endsWith')}indexOf(a,b){return olympe.D.Fa([this,a,b||0],(c,d,e)=>olympe.D.za(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
288
+ olympe.D.ea,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.Fa([this,a,b||Infinity],(c,d,e)=>olympe.D.za(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.lastIndexOf')}slice(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Wa,'OString.slice')}Bg(){return olympe.D.za(this.value.length)}threshold(a){return olympe.D.Fa([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Wa.EMPTY,olympe.D.Wa,'OString.threshold')}toLowerCase(){return olympe.D.Bb(this.value.toLowerCase())}toUpperCase(){return olympe.D.Bb(this.value.toUpperCase())}trim(){return olympe.D.Bb(this.value.trim())}padStart(a,
289
+ b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.padStart')}padEnd(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.padEnd')}replace(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Wa,'OString.replace')}Ky(a,b){return olympe.D.Fa([this,a,b],(c,d,e)=>olympe.D.Bb(c.valueOf().substr(d.valueOf(),
290
+ e.valueOf())),olympe.D.Wa,'OString.subOStr')}static concat(...a){return olympe.D.Bb('').concat(...a)}};olympe.D.Wa.EMPTY=new olympe.D.Wa('');olympe.D.Wa.Tu=new olympe.D.Wa(' ');m=olympe.D.Wa.prototype;m.toJSON.K=olympe.D.J.C;m.Ir.K=new olympe.D.J(()=>olympe.D.Wa,[0,1]);m.concat.K=olympe.D.J.F;m.Vc.K=olympe.D.J.F;m.Ny.K=olympe.D.J.G;m.rs.K=olympe.D.J.G;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.Tf.K=olympe.D.J.U;
291
+ m.contains.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.startsWith.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.endsWith.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.indexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.lastIndexOf.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.slice.K=new olympe.D.J(()=>olympe.D.Wa,[0,1]);m.Bg.K=olympe.D.J.G;m.threshold.K=new olympe.D.J(()=>olympe.D.Wa,[0]);m.toLowerCase.K=olympe.D.J.F;m.toUpperCase.K=olympe.D.J.F;m.trim.K=olympe.D.J.F;m.padStart.K=olympe.D.J.F;m.padEnd.K=olympe.D.J.F;
292
+ m.replace.K=olympe.D.J.F;m.Ky.K=olympe.D.J.F;olympe.D.qa=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static oc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.qa.F:olympe.D.qa.C}and(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.ie([a],b=>new olympe.D.qa(this.valueOf()&&b.valueOf()),olympe.D.qa,'and'):this.value&&a.valueOf()?olympe.D.qa.F:olympe.D.qa.C}qb(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Td(a){if(void 0!==a)return olympe.D.lb(a)?
293
+ olympe.D.ie([a],b=>new olympe.D.qa(this.valueOf()===b.valueOf()),olympe.D.qa,'oEquals'):this.qb(a)?olympe.D.qa.F:olympe.D.qa.C}not(){return this.value?olympe.D.qa.C:olympe.D.qa.F}Bv(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.ie([a],b=>new olympe.D.qa(!(this.valueOf()&&b.valueOf())),olympe.D.qa,'andNot'):this.value&&!a.valueOf()?olympe.D.qa.F:olympe.D.qa.C}or(a){if(void 0!==a)return olympe.D.lb(a)?olympe.D.ie([a],b=>new olympe.D.qa(this.valueOf()||b.valueOf()),olympe.D.qa,'or'):this.value||a.valueOf()?
294
+ olympe.D.qa.F:olympe.D.qa.C}xor(a){return olympe.D.Fa([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Cc(b&&!c||!b&&c)},olympe.D.qa,'OBoolean.xor')}nw(){return this.value}Ur(){return!0===this.value?olympe.D.ea.ONE:olympe.D.ea.ZERO}Vc(){return olympe.D.Bb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.qa.F=new olympe.D.qa(!0);olympe.D.qa.C=new olympe.D.qa(!1);m=olympe.D.qa.prototype;m.toJSON.K=olympe.D.J.C;
295
+ m.and.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.qb.K=olympe.D.J.C;m.Td.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.not.K=olympe.D.J.U;m.Bv.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.or.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.xor.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.nw.K=new olympe.D.J(()=>Boolean,[]);m.Ur.K=olympe.D.J.G;m.Vc.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.valueOf.K=olympe.D.J.C;function rb(a){return new olympe.D.jb(new Date(a))}
296
+ olympe.D.jb=class{constructor(a){this.yb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.yb.toJSON()+'" }'}static oc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.jb(new Date(b.value.valueOf()))}static now(){return new olympe.D.jb(new Date)}qj(){return this.yb&&!isNaN(this.yb.getTime())?olympe.D.qa.F:olympe.D.qa.C}Ct(){return olympe.D.za(this.yb.getMilliseconds())}Et(){return olympe.D.za(this.yb.getSeconds())}Dt(){return olympe.D.za(this.yb.getMinutes())}Bt(){return olympe.D.za(this.yb.getHours())}xw(){return olympe.D.za(this.yb.getDate())}getMonth(){return olympe.D.za(this.yb.getMonth()+1)}Ft(){return olympe.D.za(this.yb.getFullYear())}getTime(){return this.yb.getTime()}Hy(){var a=
297
297
  olympe.D,b=a.Bb;var c=this.yb.getDate();c=10>c?'0'+c:c;var d=this.yb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.yb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.Bb(this.yb.toLocaleString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.Bb(b.yb.toLocaleString(c.valueOf())),olympe.D.Wa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.Bb(this.yb.toLocaleDateString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.Bb(b.yb.toLocaleDateString(c.valueOf())),
298
- olympe.D.Wa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Bb(this.yb.toLocaleTimeString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.Bb(b.yb.toLocaleTimeString(c.valueOf())),olympe.D.Wa)}Vc(){return olympe.D.Bb(this.yb.toISOString())}ps(){return new Date(this.getTime())}Jy(){return this}Ly(){return this}kg(a,b){return olympe.D.Fa([b],c=>{const d=new olympe.D.jb(new Date(this.yb.getTime()));d.yb['set'+a](this.yb['get'+a]()+c.valueOf());return d},olympe.D.jb)}pv(a){return this.kg('Milliseconds',
299
- a)}vv(a){return this.kg('Seconds',a)}qv(a){return this.kg('Minutes',a)}ov(a){return this.kg('Hours',a)}Hm(a){return this.kg('Date',a)}wv(a){return'number'===typeof a?this.Hm(7*a):this.Hm(a.cl(7))}rv(a){return this.kg('Month',a)}xv(a){return this.kg('FullYear',a)}Fy(){let a=this.yb.getDay();a=0===a?6:a-1;return new olympe.D.jb(new Date(this.yb.getFullYear(),this.yb.getMonth(),this.yb.getDate()-a))}Gy(){return new olympe.D.jb(new Date(this.yb.getFullYear(),this.yb.getMonth()))}Td(a){return olympe.D.Fa([a],
300
- b=>olympe.D.Cc(this.qb(b)),olympe.D.qa)}qb(a){return a instanceof olympe.D.jb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Jw(){let a=this.yb.getDay();0===a&&(a=7);return olympe.D.za(a)}yw(a,b){return olympe.D.Fa([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.yb.getFullYear()-c.yb.getFullYear():'months'===d?c=12*(this.yb.getFullYear()-c.yb.getFullYear())+(this.yb.getMonth()-c.yb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
- void 0===d&&(olympe.ra.Xa('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.yb.getTime()-c.yb.getTime())/d));return olympe.D.za(c)},olympe.D.ea)}xx(a){return olympe.D.Fa([a],b=>olympe.D.Cc(this.getTime()<b.getTime()),olympe.D.qa)}vx(a){return olympe.D.Fa([a],b=>olympe.D.Cc(this.getTime()>b.getTime()),olympe.D.qa)}yx(a,b){return olympe.D.Fa([a,b],(c,d)=>olympe.D.Cc(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.qa)}valueOf(){return this.oj().valueOf()?
302
- new Date(this.getTime()):new Date(0)}};olympe.D.jb.C=rb(0);olympe.D.jb.F=rb(Number.NaN);m=olympe.D.jb.prototype;m.oj.K=olympe.D.J.U;m.zt.K=olympe.D.J.G;m.Bt.K=olympe.D.J.G;m.At.K=olympe.D.J.G;m.yt.K=olympe.D.J.G;m.uw.K=olympe.D.J.G;m.getMonth.K=olympe.D.J.G;m.Ct.K=olympe.D.J.G;m.getTime.K=olympe.D.J.C;m.Ey.K=new olympe.D.J(()=>olympe.D.Wa,[0]);m.toLocaleString.K=olympe.D.J.F;m.toLocaleDateString.K=olympe.D.J.F;m.toLocaleTimeString.K=olympe.D.J.F;m.Vc.K=olympe.D.J.F;m.ps.K=olympe.D.J.C;
303
- m.Jy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Ly.K=new olympe.D.J(()=>olympe.D.jb,[]);m.kg.K=new olympe.D.J(()=>olympe.D.jb,[]);m.pv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.vv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.qv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.ov.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Hm.K=new olympe.D.J(()=>olympe.D.jb,[0]);m.wv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.rv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.xv.K=new olympe.D.J(()=>olympe.D.jb,[0]);
304
- m.Fy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Gy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Td.K=olympe.D.J.U;m.qb.K=olympe.D.J.C;m.Jw.K=olympe.D.J.G;m.yw.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.xx.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.vx.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.yx.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.valueOf.K=olympe.D.J.C;const sb=new Map,tb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,ub=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function vb(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=ub.exec(c)):(d=1,c=tb.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.Vf(a)?olympe.D.ie([a],b,olympe.D.Color):b(a)}
305
- olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.za(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.za(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.za(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.za(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return`{ "type": "color", "r": ${this.C.valueOf()}, "g": ${this.F.valueOf()}, "b": ${this.b.valueOf()}, "a": ${this.a.valueOf()} }`}static nc(a){let b;'string'===typeof a?b=
298
+ olympe.D.Wa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Bb(this.yb.toLocaleTimeString(a)):olympe.D.Fa([this,a],(b,c)=>olympe.D.Bb(b.yb.toLocaleTimeString(c.valueOf())),olympe.D.Wa)}Vc(){return olympe.D.Bb(this.yb.toISOString())}qs(){return new Date(this.getTime())}My(){return this}Oy(){return this}lg(a,b){return olympe.D.Fa([b],c=>{const d=new olympe.D.jb(new Date(this.yb.getTime()));d.yb['set'+a](this.yb['get'+a]()+c.valueOf());return d},olympe.D.jb)}tv(a){return this.lg('Milliseconds',
299
+ a)}yv(a){return this.lg('Seconds',a)}uv(a){return this.lg('Minutes',a)}rv(a){return this.lg('Hours',a)}Hm(a){return this.lg('Date',a)}zv(a){return'number'===typeof a?this.Hm(7*a):this.Hm(a.dl(7))}vv(a){return this.lg('Month',a)}Av(a){return this.lg('FullYear',a)}Iy(){let a=this.yb.getDay();a=0===a?6:a-1;return new olympe.D.jb(new Date(this.yb.getFullYear(),this.yb.getMonth(),this.yb.getDate()-a))}Jy(){return new olympe.D.jb(new Date(this.yb.getFullYear(),this.yb.getMonth()))}Td(a){return olympe.D.Fa([a],
300
+ b=>olympe.D.Cc(this.qb(b)),olympe.D.qa)}qb(a){return a instanceof olympe.D.jb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Mw(){let a=this.yb.getDay();0===a&&(a=7);return olympe.D.za(a)}Bw(a,b){return olympe.D.Fa([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.yb.getFullYear()-c.yb.getFullYear():'months'===d?c=12*(this.yb.getFullYear()-c.yb.getFullYear())+(this.yb.getMonth()-c.yb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
301
+ void 0===d&&(olympe.ra.Xa('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.yb.getTime()-c.yb.getTime())/d));return olympe.D.za(c)},olympe.D.ea)}Ax(a){return olympe.D.Fa([a],b=>olympe.D.Cc(this.getTime()<b.getTime()),olympe.D.qa)}yx(a){return olympe.D.Fa([a],b=>olympe.D.Cc(this.getTime()>b.getTime()),olympe.D.qa)}Bx(a,b){return olympe.D.Fa([a,b],(c,d)=>olympe.D.Cc(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.qa)}valueOf(){return this.qj().valueOf()?
302
+ new Date(this.getTime()):new Date(0)}};olympe.D.jb.C=rb(0);olympe.D.jb.F=rb(Number.NaN);m=olympe.D.jb.prototype;m.qj.K=olympe.D.J.U;m.Ct.K=olympe.D.J.G;m.Et.K=olympe.D.J.G;m.Dt.K=olympe.D.J.G;m.Bt.K=olympe.D.J.G;m.xw.K=olympe.D.J.G;m.getMonth.K=olympe.D.J.G;m.Ft.K=olympe.D.J.G;m.getTime.K=olympe.D.J.C;m.Hy.K=new olympe.D.J(()=>olympe.D.Wa,[0]);m.toLocaleString.K=olympe.D.J.F;m.toLocaleDateString.K=olympe.D.J.F;m.toLocaleTimeString.K=olympe.D.J.F;m.Vc.K=olympe.D.J.F;m.qs.K=olympe.D.J.C;
303
+ m.My.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Oy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.lg.K=new olympe.D.J(()=>olympe.D.jb,[]);m.tv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.yv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.uv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.rv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Hm.K=new olympe.D.J(()=>olympe.D.jb,[0]);m.zv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.vv.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Av.K=new olympe.D.J(()=>olympe.D.jb,[0]);
304
+ m.Iy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Jy.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Td.K=olympe.D.J.U;m.qb.K=olympe.D.J.C;m.Mw.K=olympe.D.J.G;m.Bw.K=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.Ax.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.yx.K=new olympe.D.J(()=>olympe.D.qa,[0]);m.Bx.K=new olympe.D.J(()=>olympe.D.qa,[0,1]);m.valueOf.K=olympe.D.J.C;const sb=new Map,tb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,ub=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function vb(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=ub.exec(c)):(d=1,c=tb.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.Wf(a)?olympe.D.ie([a],b,olympe.D.Color):b(a)}
305
+ olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.za(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.za(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.za(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.za(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return`{ "type": "color", "r": ${this.C.valueOf()}, "g": ${this.F.valueOf()}, "b": ${this.b.valueOf()}, "a": ${this.a.valueOf()} }`}static oc(a){let b;'string'===typeof a?b=
306
306
  JSON.parse(a):b=a;return olympe.D.Color.create(b.r,b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.Fa([a,b,c,d],(e,f,g,h)=>{e=olympe.D.za(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.za(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.za(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.za(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of sb.values())if(k&&k.C.qb(e)&&k.F.qb(f)&&k.b.qb(g)&&k.a.qb(h))return k;
307
- return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Qf(){return this.C}Ff(){return this.b}Kf(){return this.F}Ef(){return this.a}Fv(a,b){return olympe.D.Color.create(this.C.qj(a.Qf(),b),this.F.qj(a.Kf(),b),this.b.qj(a.Ff(),b),this.a.qj(a.Ef(),b))}aw(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}rs(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}In(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);
308
- return'#'+(a+b).toUpperCase()}toString(){return this.In()}qb(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.qb;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.In;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.rs;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Ef;
309
- olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Kf;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Ff;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Qf;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.K=olympe.D.J.C;m.Qf.K=olympe.D.J.G;m.Ff.K=olympe.D.J.G;m.Kf.K=olympe.D.J.G;m.Ef.K=olympe.D.J.G;m.Fv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.aw.K=new olympe.D.J(()=>olympe.D.Color,[]);m.rs.K=new olympe.D.J(()=>String,[]);
310
- m.In.K=new olympe.D.J(()=>String,[]);m.qb.K=olympe.D.J.C;olympe.D.File=class{ma(){}Bp(){}Rl(){}fn(){}Rk(){}bn(){}Sk(){}rename(){}};olympe.D.lc=class{constructor(a,b){this.x=olympe.D.ge(a);this.y=olympe.D.ge(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.bb(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.bb(this.y).valueOf())+' }'}static nc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.lc(b.x,b.y)}qx(){return this.x}Cy(a){ob(this.x,a)}sx(){return this.y}Dy(a){ob(this.y,a)}gx(){return this.x.js(this.y)}he(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.lc(b.x.he(c.x),b.y.he(c.y)),
311
- olympe.D.lc,'Vector2.plus')}th(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.lc(b.x.th(c.x),b.y.th(c.y)),olympe.D.lc,'Vector2.minus')}Nx(a){return new olympe.D.lc(this.x.cl(a),this.y.cl(a))}Wv(a){return new olympe.D.lc(this.x.$i(a),this.y.$i(a))}Qx(){return new olympe.D.lc(this.x.Aj(),this.y.Aj())}Xv(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Fa([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.za(d*f+e*g),olympe.D.ea),olympe.D.ea)}length(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.za(Math.sqrt(a*
312
- a+b*b)),olympe.D.ea)}normalize(){return olympe.D.Fa([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.lc(a/c,b/c)},olympe.D.lc)}floor(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.lc(Math.floor(a),Math.floor(b)),olympe.D.lc)}ceil(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.lc(Math.ceil(a),Math.ceil(b)),olympe.D.lc)}round(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.lc(Math.round(a),Math.round(b)),olympe.D.lc)}tv(a){return new olympe.D.lc(this.x.he(a),
313
- this.y.he(a))}uv(a,b){return new olympe.D.lc(this.x.he(a),this.y.he(b))}Vc(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.Bb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Wa)}toString(){return`Vector2[${this.x.Na.Kb}, ${this.y.Na.Kb}]`}qb(a){return this===a?!0:!1}};m=olympe.D.lc.prototype;m.toJSON.K=olympe.D.J.C;m.qx.K=olympe.D.J.G;m.Cy.K=olympe.D.J.C;m.sx.K=olympe.D.J.G;m.Dy.K=olympe.D.J.C;m.gx.K=olympe.D.J.G;m.he.K=new olympe.D.J(()=>olympe.D.lc,[0]);
314
- m.th.K=new olympe.D.J(()=>olympe.D.lc,[0]);m.Nx.K=olympe.D.J.Y;m.Wv.K=olympe.D.J.Y;m.Qx.K=olympe.D.J.Y;m.Xv.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.length.K=olympe.D.J.G;m.normalize.K=olympe.D.J.Y;m.floor.K=olympe.D.J.Y;m.ceil.K=olympe.D.J.Y;m.round.K=olympe.D.J.Y;m.tv.K=olympe.D.J.Y;m.uv.K=olympe.D.J.Y;m.Vc.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;olympe.D.Qg=class{constructor(){}Yb(){}Gd(){}get(){}lh(){}has(){}Eg(){}Sc(){}If(){}nf(){}zg(){}forEach(){}ce(){}};olympe.D.Qg.prototype.forEachCurrentValue=olympe.D.Qg.prototype.ce;olympe.D.Qg.prototype.forEach=olympe.D.Qg.prototype.forEach;m=olympe.D.Qg.prototype;m.has.K=olympe.D.J.U;m.Eg.K=olympe.D.J.C;m.Sc.K=new olympe.D.J(()=>Object,[]);m.If.K=new olympe.D.J(()=>String,[]);m.nf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.ce.K=olympe.D.J.C;olympe.D.pd=class extends olympe.D.Qg{constructor(){super()}fe(){}Hf(){}We(){}Gf(){}qe(){}Ve(){}bj(){}ci(){}};olympe.D.pd.prototype.getCurrentAt=olympe.D.pd.prototype.Ve;olympe.D.pd.prototype.getAt=olympe.D.pd.prototype.qe;olympe.D.pd.prototype.getCurrentKeyAt=olympe.D.pd.prototype.Gf;olympe.D.pd.prototype.getKeyAt=olympe.D.pd.prototype.We;olympe.D.pd.prototype.getCurrentRank=olympe.D.pd.prototype.Hf;olympe.D.pd.prototype.getRank=olympe.D.pd.prototype.fe;m=olympe.D.pd.prototype;m.fe.K=olympe.D.J.G;
315
- m.Hf.K=olympe.D.J.C;m.We.K=new olympe.D.J(()=>String,[]);m.Gf.K=olympe.D.J.C;m.qe.K=new olympe.D.J(()=>Object,[]);m.Ve.K=olympe.D.J.C;m.bj.K=olympe.D.J.C;m.ci.K=new olympe.D.J(()=>Array,[]);olympe.D.oi=class{constructor(a,b){this.U=b||olympe.D.Ja();this.valueType=a||Object;this.values={};this.wb=this.Sa=null;this.Xe=0;this.aa=Object.create(null);this.Ib=Object.create(null);this.size=0;this.L=null;this.U.onDestroy(()=>{const c=this.aa;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}Dh(){return this.U}Yb(){return this.valueType}Gd(a){this.valueType=a;const b=this.Sa;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
316
- c)&&jb(b[c],a)}get(a){const b=c=>{null===this.Sa&&(this.Sa={});return this.fj(this.Sa,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.Fa([a],c=>b(c),this.valueType)}lh(a){a=this.values[a];return olympe.D.lb(a)?Va(a.Na)?a.Na.Kb:void 0:a}has(a){const b=c=>{null===this.wb&&(this.wb={});return this.fj(this.wb,c,c in this.values?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'Map.has('+c+')')};return olympe.D.Fa([a],c=>b(c),olympe.D.qa)}Eg(a){return a in this.values}fj(a,b,c,d,e){let f=a[b];
317
- f||this.U.run(()=>{f=olympe.D.Nd(d,void 0,e);a[b]=f;f.Na.onDestroy(()=>delete a[b]);olympe.D.lb(c)?nb(f,c):kb(f,c)});return f}Sc(){throw Error('Abstract method getFirstKey needs to be overridden');}If(){throw Error('Abstract method getFirstKey needs to be overridden');}nf(){null===this.L&&this.U.run(()=>{this.L=olympe.D.Nd(olympe.D.ea,olympe.D.za(this.size));this.L.Na.onDestroy(()=>{this.L=null})});return this.L}zg(){return this.size}forEach(a,b){const c=this.Dm();a=this.yr(c,a,b);this.Cm(c,a)}Dm(){return String(++this.Xe)}Cm(a,
318
- b){this.Ib[a]=b;olympe.D.Ja().zc(()=>{const c=this.aa;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Ib[a]});this.ce(b)}yr(a,b,c){const d=olympe.D.Ja();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.Gm(a,f,g)})}}Gm(a,b,c){void 0===this.aa[b]&&(this.aa[b]={});this.aa[b][a]=c}ce(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&
319
- !1===a(b[c],c,this))break}Jk(a,b){void 0!==this.values[a]&&this.Ti(a,!0);this.values[a]=b;var c=this.Sa;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?nb(c[a],b):kb(c[a],b));c=this.wb;null!==c&&void 0!==c[a]&&ob(c[a],!0);this.size++;c=this.Ib;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Ti(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.zf?d.Na.Kb:d;var e=this.Sa;null!==e&&void 0!==e[a]&&lb(e[a]);e=this.wb;null!==e&&
320
- void 0!==e[a]&&ob(e[a],!1);delete c[a];this.size--;b||this.Af()}a=this.aa[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Af(){null!==this.L&&ob(this.L,this.size)}Uh(){var a=this.Sa;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&lb(a[c]);a=this.wb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&ob(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];
321
- for(const c in this.aa)if(Object.prototype.hasOwnProperty.call(this.aa,c)){b=this.aa[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.L&&ob(this.L,this.size)}Vg(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.oi.la=[olympe.D.Qg];m=olympe.D.oi.prototype;m.Dh.K=olympe.D.J.C;m.Yb.K=olympe.D.J.C;m.Gd.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>Object,[],'valueType');
322
- m.lh.K=olympe.D.J.C;m.has.K=olympe.D.J.U;m.Eg.K=olympe.D.J.C;m.fj.K=olympe.D.J.C;m.nf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.Dm.K=olympe.D.J.C;m.Cm.K=olympe.D.J.C;m.yr.K=olympe.D.J.C;m.Gm.K=olympe.D.J.C;m.ce.K=olympe.D.J.C;m.Jk.K=olympe.D.J.C;m.Ti.K=olympe.D.J.C;m.Af.K=olympe.D.J.C;m.Uh.K=olympe.D.J.C;m.Vg.K=olympe.D.J.C;olympe.D.Ej=class extends olympe.D.oi{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.Da=this.Ya=this.ab=this.oa=null}Gd(a){super.Gd(a);if(null!==this.Da)for(let b of this.Da.values())jb(b,a)}Sc(){return this.qe(0)}If(){return this.We(0)}fe(a){const b=c=>{null===this.ab&&(this.ab=Object.create(null));let d=this.Hf(a);d=void 0!==d?olympe.D.za(d):void 0;return this.fj(this.ab,c,d,olympe.D.ea,`List.getRank(${c})`)};return olympe.D.lb(a)?L(olympe.D.createNode(olympe.D.ea,b,null,
323
- [a.Na],[0],'onResolved('+(b.name||'')+')')):b(a)}Hf(a){return this.F[a]}We(a){const b=c=>{const d=c.valueOf(),e=this.Gf(d);null===this.Ya&&(this.Ya=Object.create(null));return this.fj(this.Ya,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.Fa([a],c=>b(c),String)}Gf(a){return this.C[a.valueOf()]}qe(a){if(olympe.D.lb(a))return this.get(olympe.D.Fa([a],c=>{c=this.We(c);if(!Va(c.Na)){const d=olympe.D.Ja();olympe.D.Uf(d)&&eb(d)}return c},String));null===this.Da&&(this.Da=new Map);let b=this.Da.get(a);
324
- b||this.U.run(()=>{b=this.get(this.We(a));this.Da.set(a,b);b.Na.onDestroy(()=>this.Da.delete(a))});return b}Ve(a){return this.lh(this.Gf(a))}bj(a,b,c,d){let e=this.Dm();a=this.cs(e,a,b,c,d);this.Cm(e,a)}cs(a,b,c,d,e){return olympe.D.Ja().C((f,g)=>{let h=!1,k=olympe.D.df([b,c,this.fe(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Gm(a,g,k)})}ci(){null===this.oa&&this.U.run(()=>{this.oa=olympe.D.Nd(Array,this.C.filter(a=>void 0!==a));
325
- this.oa.Na.onDestroy(()=>{this.L=null})});return this.oa}ce(a){if(this.C.length!==this.size)super.ce(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}Fm(a,b){const c=this.ab,d=this.Ya,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&lb(c[g]),void 0!==
326
- c[a]&&kb(c[a],olympe.D.za(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&lb(d[e]),void 0!==d[b]&&kb(d[b],a))}}Em(a){var b=this.Ya,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Na.Kb===a&&lb(b));delete this.F[a];this.C.splice(c,1);c=this.ab;null!==c&&void 0!==c[a]&&lb(c[a])}zr(){if(null!==this.oa){const a=this.C,b=this.oa.Na.Kb;b&&a.join(',')!==b.join(',')&&kb(this.oa,a)}}Af(){this.zr();super.Af()}Uh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.ab;if(null!==
327
- a)for(b in a)lb(a[b]);a=this.Ya;if(null!==a)for(b in a)lb(a[parseInt(b,10)]);var b=this.oa;null!==b&&(cb(b.Na),kb(b,this.C));return olympe.D.oi.prototype.Uh.call(this)}Vg(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.Ej.la=[olympe.D.pd];m=olympe.D.Ej.prototype;m.Gd.K=olympe.D.J.C;m.Sc.K=new olympe.D.J(()=>Object,[]);m.If.K=new olympe.D.J(()=>String,[]);m.fe.K=olympe.D.J.G;m.Hf.K=olympe.D.J.C;
328
- m.We.K=new olympe.D.J(()=>String,[]);m.Gf.K=olympe.D.J.C;m.qe.K=new olympe.D.J(()=>Object,[]);m.Ve.K=olympe.D.J.C;m.bj.K=new olympe.D.J(()=>{},[]);m.cs.K=olympe.D.J.C;m.ci.K=new olympe.D.J(()=>Array,[]);m.ce.K=olympe.D.J.C;m.Fm.K=olympe.D.J.C;m.Em.K=olympe.D.J.C;m.zr.K=olympe.D.J.C;m.Af.K=olympe.D.J.C;m.Uh.K=olympe.D.J.C;m.Vg.K=olympe.D.J.C;olympe.D.Map=class extends olympe.D.oi{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Gd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&jb(this.F,a);super.Gd(a)}Sc(){null===this.F&&this.Tm();return this.F}If(){null===this.C&&this.Tm();return this.C}Tm(){this.Dh().run(()=>{this.F=olympe.D.Nd(this.Yb());this.C=olympe.D.Nd(String);this.yj(this.Ym())})}Ym(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}yj(a){if(void 0!==
329
- a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?nb(this.F,b):kb(this.F,b);kb(this.C,a)}else void 0!==this.F.Na.Kb&&(lb(this.F),lb(this.C))}set(a,b){this.Jk(a,b);1===this.size&&null!==this.C&&this.yj(a);this.Af()}remove(a){const b=this.Ti(a);null!==this.C&&this.C.Na.Kb===a&&this.yj(this.Ym());return b}clear(){this.Uh();null!==this.C&&this.yj()}};m=olympe.D.Map.prototype;m.Gd.K=olympe.D.J.C;m.Sc.K=new olympe.D.J(()=>Object,[]);m.If.K=new olympe.D.J(()=>String,[]);m.Tm.K=olympe.D.J.C;
330
- m.Ym.K=olympe.D.J.C;m.yj.K=olympe.D.J.C;m.set.K=olympe.D.J.C;m.remove.K=new olympe.D.J(()=>Object,[]);m.clear.K=olympe.D.J.C;olympe.D.Wg=class extends olympe.D.Ej{constructor(a){super(a)}set(a,b,c){this.Jk(a,b);void 0!==c&&olympe.D.Ec([c],d=>{this.Fm(a,d)});this.Af()}remove(a){this.Em(a);return this.Ti(a)}clear(){this.Uh()}};olympe.D.Wg.prototype.remove.K=olympe.D.J.C;olympe.D.Wg.prototype.clear.K=olympe.D.J.C;olympe.D.xs=class extends olympe.D.Uj{constructor(a,b){super(olympe.D.ea,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ea.Do.Lp}Fb(){return olympe.D.Ux(this.node,this.duration,this.C,void 0)}};let wb=null;olympe.D.N=void 0;olympe.D.Bn=void 0;olympe.D.Yh=void 0;olympe.D.Th=new Map;olympe.D.Th.set(0,olympe.D.ea.ZERO);olympe.D.Th.set(1,olympe.D.ea.ONE);olympe.D.Th.set(2,olympe.D.ea.dv);olympe.D.Ik=new Map;olympe.D.Ik.set('',olympe.D.Wa.EMPTY);olympe.D.Ik.set(' ',olympe.D.Wa.Qu);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Bd:b,Xf:c,ln:d,debug:g,ug:e,zd:f,Vi:h})};olympe.D.Uf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
- olympe.D.Nd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Uf(b)?fb(a,b):olympe.D.lb(b)?fb(a,b.Na):K(a,b);return L(a)};olympe.D.lb=function(a){return!(!a||!a.zf)};olympe.D.Vf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.zf))};olympe.D.qn=function(a){return olympe.D.Uf(a)||a instanceof olympe.D.Xb||a instanceof olympe.D.Iq};olympe.D.fi=function(a){return a instanceof olympe.D.Uj};
332
- olympe.D.el=function(a,b){if(void 0!==a){olympe.D.fi(a)&&(a=a.Fb().Na);if(!olympe.D.Vf(a))return b(a);var c=[];olympe.D.lb(a)?c.push(a.Na):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.bb=function(a,b){let c=a;olympe.D.lb(a)?c=a.Na.Kb:olympe.D.Uf(a)?c=a.Kb:olympe.D.fi(a)&&(c=a.Fb().Na.Kb);return void 0===c?b:c};
333
- olympe.D.bf=function(a,b){let c;olympe.D.lb(a)?c=a.Na:olympe.D.Uf(a)?c=a:olympe.D.fi(a)&&(c=a.Fb().Na);c&&olympe.D.Ec([b],d=>{c.bf(d)},'setDefaultValue');return a};olympe.D.df=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.wr?(h=h.Na,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.fi(h)&&(h=h.Fb().Na,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
- olympe.D.ie=function(a,b,c,d){return L(olympe.D.df(a,b,c,d||'syncProxies'))};const xb=a=>{for(const b of a)if(olympe.D.Vf(b)||olympe.D.fi(b))return!1;return!0};olympe.D.Fa=function(a,b,c,d,e){if(xb(a))return b(...a);const f=olympe.D.df(a,b,c,d||'TransformFlows');e&&olympe.D.Ec([e],g=>{f.bf(g)},'setDefaultValue');return L(f)};olympe.D.Ec=function(a,b,c){xb(a)?b(...a):olympe.D.df(a,b,void 0,c||'processFlows')};
335
- olympe.D.gs=function(a,b){if(xb(a))b(...a);else{const c=olympe.D.Ja();olympe.D.df(a,(...d)=>{olympe.D.Ja().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.An=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.lb(g)?(g=g.Na,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.fi(g)&&(g=g.Fb().Na,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Bd:b,ln:e,ug:f,ny:!1,zd:c})};
336
- olympe.D.iD=function(a,b,c){const d=olympe.D.Ja();olympe.D.An(a,(...e)=>{olympe.D.Ja().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.JC=function(a,b,c){a=new olympe.D.Uj(a,c);b(a);return a.Fb()};olympe.D.Uc=function(a,b='flowSource'){return new olympe.D.Uj(a,b)};olympe.D.lD=function(a,b,c,d){const e=olympe.D.Ja();olympe.D.df(a,(...f)=>{olympe.D.Ja().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
- olympe.D.kn=function(a,b,c){olympe.D.Fa([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.OC=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.qD=function(a){return olympe.D.Ja().C(a)};olympe.D.MC=function(a,b,c){olympe.D.Yv(a?a.Na:a,b,c)};
338
- olympe.D.Yv=function(a,b,c){if(a){var d=a.Z();null===wb&&(wb={});if(wb[d])olympe.D.N.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{wb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.N.warn(e):olympe.D.N.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.N.log(f,'undefined'):null===g?olympe.D.N.log(f,'null'):olympe.D.N.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.N.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
- ''))});c.onDestroy(()=>{delete wb[d]})}}else olympe.D.N.log('NOT starting node dump, node is '+String(a))};olympe.D.LC=function(){let a='',b=olympe.D.Ja();for(;null!==b;)a+=b.Lb()+' --\x3e ',b=b.getParent();olympe.D.N.log(a)};
340
- olympe.D.za=function(a){if(void 0===a)return olympe.D.ea.ZERO;if(a instanceof olympe.D.ea)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ea.Up;if(a===Math.PI)return olympe.D.ea.PI;if(Infinity===a)return olympe.D.ea.st;if(-Infinity===a)return olympe.D.ea.ju;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Th.has(a)||olympe.D.Th.set(a,new olympe.D.ea(a)),olympe.D.Th.get(a)):new olympe.D.ea(a)}return null};
341
- olympe.D.ge=function(a){return void 0===a?olympe.D.Nd(olympe.D.ea):olympe.D.Nd(olympe.D.ea,olympe.D.Vf(a)?a:olympe.D.za(a))};olympe.D.Ux=olympe.D.ea.animate;olympe.D.cD=function(a,b){return new olympe.D.xs(a,b)};olympe.D.Bb=function(a){if(a instanceof olympe.D.Wa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.Ik.has(a)?olympe.D.Ik.get(a):new olympe.D.Wa(a)};
342
- olympe.D.fD=function(a){return void 0===a?olympe.D.Nd(olympe.D.Wa):olympe.D.Nd(olympe.D.Wa,olympe.D.Vf(a)?a:olympe.D.Bb(a))};olympe.D.Cc=function(a){return a instanceof olympe.D.qa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.qa.F:olympe.D.qa.C};olympe.D.iy=function(a){return void 0===a?olympe.D.Nd(olympe.D.qa):olympe.D.Nd(olympe.D.qa,olympe.D.Vf(a)?a:olympe.D.Cc(a))};olympe.D.Vx=function(a){if(a instanceof Date)return new olympe.D.jb(a)};
343
- olympe.D.eD=function(a){return olympe.D.Nd(olympe.D.jb,void 0!==a?new olympe.D.jb(a):null)};olympe.D.bs=a=>a instanceof olympe.D.qa||a instanceof olympe.D.ea||a instanceof olympe.D.Wa||a instanceof olympe.D.jb;olympe.D.gD=function(a,b){return olympe.D.Nd(olympe.D.lc,void 0===a&&void 0===b?void 0:new olympe.D.lc(a,b))};olympe.D.hy=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.Nd(olympe.D.Color,e)};olympe.D.dD=olympe.D.hy;
344
- olympe.D.Ov=function(a){olympe.D.N=a;olympe.D.Yh=olympe.D.mh()};olympe.D.mh=function(){olympe.D.Bn||(olympe.D.Bn=new olympe.D.Iq);return olympe.D.Bn};olympe.D.Ja=function(){olympe.D.Yh||(olympe.D.Yh=olympe.D.mh());return olympe.D.Yh};olympe.D.ls=function(a){const b=olympe.D.Yh;olympe.D.qn(a)&&(olympe.D.Yh=a);return b||null};
345
- olympe.D.nc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.jb.nc(a);break;case 'number':b=olympe.D.ea.nc(a);break;case 'string':b=olympe.D.Wa.nc(a);break;case 'vector2':b=olympe.D.lc.nc(a);break;case 'color':b=olympe.D.Color.nc(a);break;case 'boolean':b=olympe.D.qa.nc(a)}return b}return null};function yb(a){a.C.Ab()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.U.clear(),a.Y.length=0,a.L.length=0)}
346
- olympe.D.lB=class{constructor(){this.C=new olympe.D.Xb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.Uc(zb,'Last slot manager entry');this.size=pb(olympe.D.Uc(olympe.D.ea,'SlotManager size').repeat(this.F.Fb().dn()),olympe.D.ea.ZERO);this.U=pb(olympe.D.Uc(olympe.D.ea,'last valid slots'),olympe.D.za(-1))});this.Y=[];this.L=[];this.C.onDestroy(()=>{yb(this)})}};
347
- class zb{constructor(a,b,c,d){this.id=a;this.mc=new olympe.D.Xb('Slot manager entry');this.G=c;this.L=d;this.mc.run(()=>{const e=pb(olympe.D.Uc(olympe.D.ea),olympe.D.ea.ZERO);olympe.D.lb(b)?e.repeat(b):e.update(b);this.C=olympe.D.Uc(olympe.D.ea);this.F=this.C.Fb().he(e.Fb())});this.next=null}Z(){return this.id}kx(){return this.C.Fb()}dn(){return this.F}fe(){return this.G}wx(){return this.L}Ny(a){this.G=a}xy(a){null===a?this.C.update(olympe.D.ea.ZERO):(this.C.repeat(a.dn()),a.next=this)}Dt(){this.C.clear();
348
- this.next=null}destroy(){this.mc.destroy();this.F=this.C=this.next=null}}m=zb.prototype;m.Z.K=olympe.D.J.C;m.kx.K=new olympe.D.J(()=>olympe.D.ea);m.dn.K=new olympe.D.J(()=>olympe.D.ea);m.fe.K=olympe.D.J.C;m.wx.K=olympe.D.J.C;m.Ny.K=olympe.D.J.C;m.xy.K=olympe.D.J.C;m.Dt.K=olympe.D.J.C;m.destroy.K=olympe.D.J.C;olympe.D.P={Ea:'df.Logger'};olympe.T.config(a=>{D(a,olympe.D.Config.Vp,Number.POSITIVE_INFINITY);C(a,olympe.D.P.Ea,[olympe.ra.P.xa],b=>b.Rc('df'))},'olympe.df');olympe.T.run([olympe.D.P.Ea],a=>{olympe.D.Ov(a)},'olympe.df');olympe.host={};const Ab=new Map,Bb=new Map;olympe.host.Zp=class{static register(a,b,...c){Ab.set(a,b);0<c.length&&Bb.set(a,c)}static create(a,b,c,d){const e=Ab.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Bb.get(a);return void 0!==a?new e(b,c,...a.map(f=>la(d,f))):new e(b,c)}};function Cb(a,b,c){a.N.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Zp.create(c,b,a.N,a.L))}function Db(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.N.L()<=olympe.ra.Pb.C.dg&&a.N.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.lb(f))b.push(a.C.get(f.mv)||null);else if('function'===typeof f){const g=f,h=olympe.D.Ja();b.push((...k)=>{h.Ab()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
- function Eb(a){var b=olympe.host.ba.gd,c=olympe.host.ba.Yp.rr;++a.G;const d=a.G;Cb(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.lb(p)?(h.push(n),p=p.Na):olympe.D.Uf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Db(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
- {Db(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.zc(a.U.bind(a,d));a=L(e);a.mv=d;K(e,a);return a}olympe.host.sa=class{constructor(a,b){this.N=a;this.L=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}Xa(){return this.N}U(a){this.N.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Hd=class{constructor(a){this.C=a;this.F=olympe.D.Ja()}L(){return this.C}G(){return this.C.Na.G()||this.F.G()}Ab(){return this.C.Na.Ab()}};olympe.host.Hd.prototype.L.K=new olympe.D.J(()=>olympe.host.ba.Hd,[]);olympe.host.yk=class{};olympe.host.Ei=class{constructor(){}C(){}F(){}oj(){}};function Fb(a){return(a=a.find(b=>'authToken'===b.ma()))?a.getValue():null}olympe.host.Ei.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}ma(){return this.name}getValue(){return this.value}qb(a){return this.ma()===a.ma()&&this.getValue()===a.getValue()&&this.C===a.C}};function Gb(){const a={}.parameters;return new olympe.host.Ei.C(a?a.map(b=>new olympe.host.Ei.F(b.name,b.value,b.hidden)):[])}
351
- olympe.host.Ei.C=class{constructor(a){this.parameters=a}wn(a){const b=new Map(this.parameters.map((c,d)=>[c.ma(),d]));a.parameters.forEach(c=>{b.has(c.ma())?this.parameters[b.get(c.ma())]=c:this.parameters.push(c)})}};function Hb(a,b){var c=olympe.host.af;const d=olympe.W.fc(),e=new olympe.D.Xb('onTimeout context');c.C.aa(b,d,()=>{e.Ab()||e.G()||e.run(a);c.C.G(d)});return new olympe.host.gd.G(c.C,d)}function Ib(a,b){var c=olympe.host.af;const d=olympe.W.fc(),e=new olympe.D.Xb('onInterval context');c.C.Y(b,d,()=>{e.Ab()||e.G()?c.C.F(d):e.run(a)});return new olympe.host.gd.F(c.C,d)}function Jb(a){var b=olympe.host.af;a=a instanceof olympe.host.gd.F?a.Z():a;b.C.F(a)}olympe.host.gd=class{constructor(a){this.C=Eb(a)}};
352
- olympe.host.gd.C=class{constructor(a,b){this.af=a;this.id=b}Z(){return this.id}cancel(){}};olympe.host.gd.L=class extends olympe.host.gd.C{cancel(){this.af.U(this.id)}};olympe.host.gd.G=class extends olympe.host.gd.C{cancel(){this.af.G(this.id)}};olympe.host.gd.F=class extends olympe.host.gd.C{cancel(){this.af.F(this.id)}};olympe.host.ba={};olympe.host.ba.Hd=class{destroy(){}};olympe.host.ba.Hd.prototype.destroy=olympe.host.ba.Hd.prototype.destroy;olympe.host.ba.Yp={Vy:100,Xy:101,Wy:102,Zy:103,Yy:104,Uy:105,ZA:201,XA:202,UA:204,bB:205,TA:206,WA:207,$A:208,cB:209,dB:210,eB:211,VA:212,aB:218,YA:219,fB:220,SA:221,RA:222,oB:300,pB:301,qB:302,uB:303,vB:304,wB:305,rB:310,sB:311,tB:312,zA:400,AA:401,BA:402,vA:450,nA:500,lA:501,qA:502,pA:503,mA:504,oA:505,PB:600,GB:601,KB:602,CB:603,DB:604,AB:605,FB:606,VB:607,NB:608,xB:609,BB:610,EB:611,MB:612,RB:613,yB:614,QB:615,LB:616,UB:617,HB:618,IB:619,JB:620,OB:630,zB:631,SB:632,TB:633,wC:700,$B:701,aC:702,
353
- bC:703,dC:704,eC:705,fC:706,cC:707,hC:708,gC:709,iC:710,mC:711,uC:712,jC:713,kC:714,nC:715,oC:716,qC:717,rC:718,tC:719,pC:720,sC:721,vC:722,lC:723,xC:724,yC:725,rr:800};olympe.host.ba.gd=class{U(){}aa(){}G(){}Y(){}F(){}};olympe.host.P={Wq:'host.System',Il:'host.HistoryManager',Kq:'host.Scheduler',Ea:'host.platform.Logger',xa:'host.Manager'};olympe.host.af=null;olympe.T.config(function(a){sa(a,olympe.host.P.Wq);sa(a,olympe.host.P.Il);C(a,olympe.host.P.Ea,[olympe.ra.P.xa],function(b){return b.Rc('host')});A(a,olympe.host.P.xa,olympe.host.sa,olympe.host.P.Ea,olympe.T.P.cg);C(a,olympe.host.P.Kq,[olympe.host.P.xa],b=>{null===olympe.host.af&&(olympe.host.af=new olympe.host.gd(b));return olympe.host.af},!0)},'olympe.host');
354
- olympe.T.run([olympe.host.P.Kq],a=>a,'olympe.host.scheduler');olympe.T.run([olympe.host.P.xa],a=>a,'olympe.host');olympe.net={};olympe.net.cb={};olympe.net.cb.$d={jm:'POST',GET:'GET',pt:'HEAD',mk:'PUT',Hc:'DELETE',em:'OPTIONS',DA:'PATCH'};olympe.net.cb.ResponseType={zk:'text',ql:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.net.cb.Headers={Kj:'content-type',gz:'content-length',pi:'authorization',ws:'access-control-allow-origin'};olympe.net.cb.hz={dA:'text/html',JSON:'application/json',BC:'application/zip'};olympe.net.cb.hd={Ds:0,Hh:200,wl:201,Cj:202,Ty:400,gv:401,ft:403,xA:404,rA:405,Lq:500,Ou:503};function Kb(a){return a.host&&encodeURI(a.host)}function Lb(a){return encodeURI(a.path).replace(olympe.net.Gk.C,(b,c)=>'%'+c)}function Mb(a){return void 0===a.G?443===a.port:a.G}olympe.net.Gk=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${Mb(this)?'wss':'ws'}://${Kb(this)}:${this.port}/${Lb(this)}`}toString(){return`${Kb(this)}:${this.port}/${Lb(this)}`}};
355
- olympe.net.Gk.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ja(){}aa(){}U(){}};function Nb(a,b,c,d){a=olympe.W.ky(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Yj(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.ss&&(c=a.ss.split(':'),2===c.length&&(c=olympe.W.ai().C(Ca(`${c[0]}:${c[1]}`)),Ob(b,{Authorization:`Basic ${c}`})));return b}function Pb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}
307
+ return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Rf(){return this.C}Gf(){return this.b}Lf(){return this.F}Ff(){return this.a}Iv(a,b){return olympe.D.Color.create(this.C.sj(a.Rf(),b),this.F.sj(a.Lf(),b),this.b.sj(a.Gf(),b),this.a.sj(a.Ff(),b))}dw(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ss(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}In(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);
308
+ return'#'+(a+b).toUpperCase()}toString(){return this.In()}qb(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.qb;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.In;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.ss;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Ff;
309
+ olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Lf;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Gf;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Rf;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.K=olympe.D.J.C;m.Rf.K=olympe.D.J.G;m.Gf.K=olympe.D.J.G;m.Lf.K=olympe.D.J.G;m.Ff.K=olympe.D.J.G;m.Iv.K=new olympe.D.J(()=>olympe.D.Color,[]);m.dw.K=new olympe.D.J(()=>olympe.D.Color,[]);m.ss.K=new olympe.D.J(()=>String,[]);
310
+ m.In.K=new olympe.D.J(()=>String,[]);m.qb.K=olympe.D.J.C;olympe.D.File=class{ma(){}Bp(){}Sl(){}fn(){}Sk(){}bn(){}Tk(){}rename(){}};olympe.D.mc=class{constructor(a,b){this.x=olympe.D.ge(a);this.y=olympe.D.ge(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.bb(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.bb(this.y).valueOf())+' }'}static oc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.mc(b.x,b.y)}ux(){return this.x}Fy(a){ob(this.x,a)}vx(){return this.y}Gy(a){ob(this.y,a)}jx(){return this.x.ks(this.y)}he(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.mc(b.x.he(c.x),b.y.he(c.y)),
311
+ olympe.D.mc,'Vector2.plus')}uh(a){return olympe.D.Fa([this,a],(b,c)=>new olympe.D.mc(b.x.uh(c.x),b.y.uh(c.y)),olympe.D.mc,'Vector2.minus')}Qx(a){return new olympe.D.mc(this.x.dl(a),this.y.dl(a))}Zv(a){return new olympe.D.mc(this.x.bj(a),this.y.bj(a))}Tx(){return new olympe.D.mc(this.x.Cj(),this.y.Cj())}$v(a){return olympe.D.Fa([this,a],(b,c)=>olympe.D.Fa([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.za(d*f+e*g),olympe.D.ea),olympe.D.ea)}length(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.za(Math.sqrt(a*
312
+ a+b*b)),olympe.D.ea)}normalize(){return olympe.D.Fa([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.mc(a/c,b/c)},olympe.D.mc)}floor(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.mc(Math.floor(a),Math.floor(b)),olympe.D.mc)}ceil(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.mc(Math.ceil(a),Math.ceil(b)),olympe.D.mc)}round(){return olympe.D.Fa([this.x,this.y],(a,b)=>new olympe.D.mc(Math.round(a),Math.round(b)),olympe.D.mc)}wv(a){return new olympe.D.mc(this.x.he(a),
313
+ this.y.he(a))}xv(a,b){return new olympe.D.mc(this.x.he(a),this.y.he(b))}Vc(){return olympe.D.Fa([this.x,this.y],(a,b)=>olympe.D.Bb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Wa)}toString(){return`Vector2[${this.x.Na.Kb}, ${this.y.Na.Kb}]`}qb(a){return this===a?!0:!1}};m=olympe.D.mc.prototype;m.toJSON.K=olympe.D.J.C;m.ux.K=olympe.D.J.G;m.Fy.K=olympe.D.J.C;m.vx.K=olympe.D.J.G;m.Gy.K=olympe.D.J.C;m.jx.K=olympe.D.J.G;m.he.K=new olympe.D.J(()=>olympe.D.mc,[0]);
314
+ m.uh.K=new olympe.D.J(()=>olympe.D.mc,[0]);m.Qx.K=olympe.D.J.Y;m.Zv.K=olympe.D.J.Y;m.Tx.K=olympe.D.J.Y;m.$v.K=new olympe.D.J(()=>olympe.D.ea,[0]);m.length.K=olympe.D.J.G;m.normalize.K=olympe.D.J.Y;m.floor.K=olympe.D.J.Y;m.ceil.K=olympe.D.J.Y;m.round.K=olympe.D.J.Y;m.wv.K=olympe.D.J.Y;m.xv.K=olympe.D.J.Y;m.Vc.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;olympe.D.Rg=class{constructor(){}Yb(){}Gd(){}get(){}mh(){}has(){}Fg(){}Sc(){}Jf(){}pf(){}Ag(){}forEach(){}ce(){}};olympe.D.Rg.prototype.forEachCurrentValue=olympe.D.Rg.prototype.ce;olympe.D.Rg.prototype.forEach=olympe.D.Rg.prototype.forEach;m=olympe.D.Rg.prototype;m.has.K=olympe.D.J.U;m.Fg.K=olympe.D.J.C;m.Sc.K=new olympe.D.J(()=>Object,[]);m.Jf.K=new olympe.D.J(()=>String,[]);m.pf.K=olympe.D.J.G;m.Ag.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.ce.K=olympe.D.J.C;olympe.D.pd=class extends olympe.D.Rg{constructor(){super()}fe(){}If(){}Xe(){}Hf(){}re(){}We(){}dj(){}ei(){}};olympe.D.pd.prototype.getCurrentAt=olympe.D.pd.prototype.We;olympe.D.pd.prototype.getAt=olympe.D.pd.prototype.re;olympe.D.pd.prototype.getCurrentKeyAt=olympe.D.pd.prototype.Hf;olympe.D.pd.prototype.getKeyAt=olympe.D.pd.prototype.Xe;olympe.D.pd.prototype.getCurrentRank=olympe.D.pd.prototype.If;olympe.D.pd.prototype.getRank=olympe.D.pd.prototype.fe;m=olympe.D.pd.prototype;m.fe.K=olympe.D.J.G;
315
+ m.If.K=olympe.D.J.C;m.Xe.K=new olympe.D.J(()=>String,[]);m.Hf.K=olympe.D.J.C;m.re.K=new olympe.D.J(()=>Object,[]);m.We.K=olympe.D.J.C;m.dj.K=olympe.D.J.C;m.ei.K=new olympe.D.J(()=>Array,[]);olympe.D.ri=class{constructor(a,b){this.U=b||olympe.D.Ja();this.valueType=a||Object;this.values={};this.wb=this.Sa=null;this.Ye=0;this.aa=Object.create(null);this.Ib=Object.create(null);this.size=0;this.N=null;this.U.onDestroy(()=>{const c=this.aa;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}Eh(){return this.U}Yb(){return this.valueType}Gd(a){this.valueType=a;const b=this.Sa;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
316
+ c)&&jb(b[c],a)}get(a){const b=c=>{null===this.Sa&&(this.Sa={});return this.hj(this.Sa,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.Fa([a],c=>b(c),this.valueType)}mh(a){a=this.values[a];return olympe.D.lb(a)?Va(a.Na)?a.Na.Kb:void 0:a}has(a){const b=c=>{null===this.wb&&(this.wb={});return this.hj(this.wb,c,c in this.values?olympe.D.qa.F:olympe.D.qa.C,olympe.D.qa,'Map.has('+c+')')};return olympe.D.Fa([a],c=>b(c),olympe.D.qa)}Fg(a){return a in this.values}hj(a,b,c,d,e){let f=a[b];
317
+ f||this.U.run(()=>{f=olympe.D.Nd(d,void 0,e);a[b]=f;f.Na.onDestroy(()=>delete a[b]);olympe.D.lb(c)?nb(f,c):kb(f,c)});return f}Sc(){throw Error('Abstract method getFirstKey needs to be overridden');}Jf(){throw Error('Abstract method getFirstKey needs to be overridden');}pf(){null===this.N&&this.U.run(()=>{this.N=olympe.D.Nd(olympe.D.ea,olympe.D.za(this.size));this.N.Na.onDestroy(()=>{this.N=null})});return this.N}Ag(){return this.size}forEach(a,b){const c=this.Dm();a=this.zr(c,a,b);this.Cm(c,a)}Dm(){return String(++this.Ye)}Cm(a,
318
+ b){this.Ib[a]=b;olympe.D.Ja().zc(()=>{const c=this.aa;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Ib[a]});this.ce(b)}zr(a,b,c){const d=olympe.D.Ja();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.Gm(a,f,g)})}}Gm(a,b,c){void 0===this.aa[b]&&(this.aa[b]={});this.aa[b][a]=c}ce(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&
319
+ !1===a(b[c],c,this))break}Kk(a,b){void 0!==this.values[a]&&this.Vi(a,!0);this.values[a]=b;var c=this.Sa;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?nb(c[a],b):kb(c[a],b));c=this.wb;null!==c&&void 0!==c[a]&&ob(c[a],!0);this.size++;c=this.Ib;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Vi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Af?d.Na.Kb:d;var e=this.Sa;null!==e&&void 0!==e[a]&&lb(e[a]);e=this.wb;null!==e&&
320
+ void 0!==e[a]&&ob(e[a],!1);delete c[a];this.size--;b||this.Bf()}a=this.aa[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Bf(){null!==this.N&&ob(this.N,this.size)}Wh(){var a=this.Sa;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&lb(a[c]);a=this.wb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&ob(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];
321
+ for(const c in this.aa)if(Object.prototype.hasOwnProperty.call(this.aa,c)){b=this.aa[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.N&&ob(this.N,this.size)}Wg(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.ri.la=[olympe.D.Rg];m=olympe.D.ri.prototype;m.Eh.K=olympe.D.J.C;m.Yb.K=olympe.D.J.C;m.Gd.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>Object,[],'valueType');
322
+ m.mh.K=olympe.D.J.C;m.has.K=olympe.D.J.U;m.Fg.K=olympe.D.J.C;m.hj.K=olympe.D.J.C;m.pf.K=olympe.D.J.G;m.Ag.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.Dm.K=olympe.D.J.C;m.Cm.K=olympe.D.J.C;m.zr.K=olympe.D.J.C;m.Gm.K=olympe.D.J.C;m.ce.K=olympe.D.J.C;m.Kk.K=olympe.D.J.C;m.Vi.K=olympe.D.J.C;m.Bf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Wg.K=olympe.D.J.C;olympe.D.Gj=class extends olympe.D.ri{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.Da=this.Ya=this.ab=this.oa=null}Gd(a){super.Gd(a);if(null!==this.Da)for(let b of this.Da.values())jb(b,a)}Sc(){return this.re(0)}Jf(){return this.Xe(0)}fe(a){const b=c=>{null===this.ab&&(this.ab=Object.create(null));let d=this.If(a);d=void 0!==d?olympe.D.za(d):void 0;return this.hj(this.ab,c,d,olympe.D.ea,`List.getRank(${c})`)};return olympe.D.lb(a)?L(olympe.D.createNode(olympe.D.ea,b,null,
323
+ [a.Na],[0],'onResolved('+(b.name||'')+')')):b(a)}If(a){return this.F[a]}Xe(a){const b=c=>{const d=c.valueOf(),e=this.Hf(d);null===this.Ya&&(this.Ya=Object.create(null));return this.hj(this.Ya,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.Fa([a],c=>b(c),String)}Hf(a){return this.C[a.valueOf()]}re(a){if(olympe.D.lb(a))return this.get(olympe.D.Fa([a],c=>{c=this.Xe(c);if(!Va(c.Na)){const d=olympe.D.Ja();olympe.D.Vf(d)&&eb(d)}return c},String));null===this.Da&&(this.Da=new Map);let b=this.Da.get(a);
324
+ b||this.U.run(()=>{b=this.get(this.Xe(a));this.Da.set(a,b);b.Na.onDestroy(()=>this.Da.delete(a))});return b}We(a){return this.mh(this.Hf(a))}dj(a,b,c,d){let e=this.Dm();a=this.ds(e,a,b,c,d);this.Cm(e,a)}ds(a,b,c,d,e){return olympe.D.Ja().C((f,g)=>{let h=!1,k=olympe.D.ef([b,c,this.fe(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.Gm(a,g,k)})}ei(){null===this.oa&&this.U.run(()=>{this.oa=olympe.D.Nd(Array,this.C.filter(a=>void 0!==a));
325
+ this.oa.Na.onDestroy(()=>{this.N=null})});return this.oa}ce(a){if(this.C.length!==this.size)super.ce(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}Fm(a,b){const c=this.ab,d=this.Ya,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&lb(c[g]),void 0!==
326
+ c[a]&&kb(c[a],olympe.D.za(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&lb(d[e]),void 0!==d[b]&&kb(d[b],a))}}Em(a){var b=this.Ya,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Na.Kb===a&&lb(b));delete this.F[a];this.C.splice(c,1);c=this.ab;null!==c&&void 0!==c[a]&&lb(c[a])}Ar(){if(null!==this.oa){const a=this.C,b=this.oa.Na.Kb;b&&a.join(',')!==b.join(',')&&kb(this.oa,a)}}Bf(){this.Ar();super.Bf()}Wh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.ab;if(null!==
327
+ a)for(b in a)lb(a[b]);a=this.Ya;if(null!==a)for(b in a)lb(a[parseInt(b,10)]);var b=this.oa;null!==b&&(cb(b.Na),kb(b,this.C));return olympe.D.ri.prototype.Wh.call(this)}Wg(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.Gj.la=[olympe.D.pd];m=olympe.D.Gj.prototype;m.Gd.K=olympe.D.J.C;m.Sc.K=new olympe.D.J(()=>Object,[]);m.Jf.K=new olympe.D.J(()=>String,[]);m.fe.K=olympe.D.J.G;m.If.K=olympe.D.J.C;
328
+ m.Xe.K=new olympe.D.J(()=>String,[]);m.Hf.K=olympe.D.J.C;m.re.K=new olympe.D.J(()=>Object,[]);m.We.K=olympe.D.J.C;m.dj.K=new olympe.D.J(()=>{},[]);m.ds.K=olympe.D.J.C;m.ei.K=new olympe.D.J(()=>Array,[]);m.ce.K=olympe.D.J.C;m.Fm.K=olympe.D.J.C;m.Em.K=olympe.D.J.C;m.Ar.K=olympe.D.J.C;m.Bf.K=olympe.D.J.C;m.Wh.K=olympe.D.J.C;m.Wg.K=olympe.D.J.C;olympe.D.Map=class extends olympe.D.ri{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Gd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&jb(this.F,a);super.Gd(a)}Sc(){null===this.F&&this.Tm();return this.F}Jf(){null===this.C&&this.Tm();return this.C}Tm(){this.Eh().run(()=>{this.F=olympe.D.Nd(this.Yb());this.C=olympe.D.Nd(String);this.Aj(this.Ym())})}Ym(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Aj(a){if(void 0!==
329
+ a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?nb(this.F,b):kb(this.F,b);kb(this.C,a)}else void 0!==this.F.Na.Kb&&(lb(this.F),lb(this.C))}set(a,b){this.Kk(a,b);1===this.size&&null!==this.C&&this.Aj(a);this.Bf()}remove(a){const b=this.Vi(a);null!==this.C&&this.C.Na.Kb===a&&this.Aj(this.Ym());return b}clear(){this.Wh();null!==this.C&&this.Aj()}};m=olympe.D.Map.prototype;m.Gd.K=olympe.D.J.C;m.Sc.K=new olympe.D.J(()=>Object,[]);m.Jf.K=new olympe.D.J(()=>String,[]);m.Tm.K=olympe.D.J.C;
330
+ m.Ym.K=olympe.D.J.C;m.Aj.K=olympe.D.J.C;m.set.K=olympe.D.J.C;m.remove.K=new olympe.D.J(()=>Object,[]);m.clear.K=olympe.D.J.C;olympe.D.Xg=class extends olympe.D.Gj{constructor(a){super(a)}set(a,b,c){this.Kk(a,b);void 0!==c&&olympe.D.Ec([c],d=>{this.Fm(a,d)});this.Bf()}remove(a){this.Em(a);return this.Vi(a)}clear(){this.Wh()}};olympe.D.Xg.prototype.remove.K=olympe.D.J.C;olympe.D.Xg.prototype.clear.K=olympe.D.J.C;olympe.D.ys=class extends olympe.D.Wj{constructor(a,b){super(olympe.D.ea,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ea.Do.Lp}Fb(){return olympe.D.Xx(this.node,this.duration,this.C,void 0)}};let wb=null;olympe.D.L=void 0;olympe.D.Bn=void 0;olympe.D.$h=void 0;olympe.D.Vh=new Map;olympe.D.Vh.set(0,olympe.D.ea.ZERO);olympe.D.Vh.set(1,olympe.D.ea.ONE);olympe.D.Vh.set(2,olympe.D.ea.gv);olympe.D.Jk=new Map;olympe.D.Jk.set('',olympe.D.Wa.EMPTY);olympe.D.Jk.set(' ',olympe.D.Wa.Tu);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Bd:b,Yf:c,ln:d,debug:g,vg:e,zd:f,Xi:h})};olympe.D.Vf=function(a){return!!(a&&a instanceof olympe.D.Node)};
331
+ olympe.D.Nd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Vf(b)?fb(a,b):olympe.D.lb(b)?fb(a,b.Na):K(a,b);return L(a)};olympe.D.lb=function(a){return!(!a||!a.Af)};olympe.D.Wf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.Af))};olympe.D.qn=function(a){return olympe.D.Vf(a)||a instanceof olympe.D.Xb||a instanceof olympe.D.Jq};olympe.D.hi=function(a){return a instanceof olympe.D.Wj};
332
+ olympe.D.fl=function(a,b){if(void 0!==a){olympe.D.hi(a)&&(a=a.Fb().Na);if(!olympe.D.Wf(a))return b(a);var c=[];olympe.D.lb(a)?c.push(a.Na):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.bb=function(a,b){let c=a;olympe.D.lb(a)?c=a.Na.Kb:olympe.D.Vf(a)?c=a.Kb:olympe.D.hi(a)&&(c=a.Fb().Na.Kb);return void 0===c?b:c};
333
+ olympe.D.cf=function(a,b){let c;olympe.D.lb(a)?c=a.Na:olympe.D.Vf(a)?c=a:olympe.D.hi(a)&&(c=a.Fb().Na);c&&olympe.D.Ec([b],d=>{c.cf(d)},'setDefaultValue');return a};olympe.D.ef=function(a,b,c,d){const e=a.length,f=Array(e),g=[];let h;for(let k=0;k<e;k++)h=a[k],void 0!==h&&null!==h&&(void 0!==h.xr?(h=h.Na,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.hi(h)&&(h=h.Fb().Na,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
334
+ olympe.D.ie=function(a,b,c,d){return L(olympe.D.ef(a,b,c,d||'syncProxies'))};const xb=a=>{for(const b of a)if(olympe.D.Wf(b)||olympe.D.hi(b))return!1;return!0};olympe.D.Fa=function(a,b,c,d,e){if(xb(a))return b(...a);const f=olympe.D.ef(a,b,c,d||'TransformFlows');e&&olympe.D.Ec([e],g=>{f.cf(g)},'setDefaultValue');return L(f)};olympe.D.Ec=function(a,b,c){xb(a)?b(...a):olympe.D.ef(a,b,void 0,c||'processFlows')};
335
+ olympe.D.hs=function(a,b){if(xb(a))b(...a);else{const c=olympe.D.Ja();olympe.D.ef(a,(...d)=>{olympe.D.Ja().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.An=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.lb(g)?(g=g.Na,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.hi(g)&&(g=g.Fb().Na,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Bd:b,ln:e,vg:f,qy:!1,zd:c})};
336
+ olympe.D.jD=function(a,b,c){const d=olympe.D.Ja();olympe.D.An(a,(...e)=>{olympe.D.Ja().destroy();d.run(b,...e)},c||'processFutureFlowsOnce')};olympe.D.KC=function(a,b,c){a=new olympe.D.Wj(a,c);b(a);return a.Fb()};olympe.D.Uc=function(a,b='flowSource'){return new olympe.D.Wj(a,b)};olympe.D.mD=function(a,b,c,d){const e=olympe.D.Ja();olympe.D.ef(a,(...f)=>{olympe.D.Ja().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
337
+ olympe.D.kn=function(a,b,c){olympe.D.Fa([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.PC=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.rD=function(a){return olympe.D.Ja().C(a)};olympe.D.NC=function(a,b,c){olympe.D.aw(a?a.Na:a,b,c)};
338
+ olympe.D.aw=function(a,b,c){if(a){var d=a.Z();null===wb&&(wb={});if(wb[d])olympe.D.L.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{wb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.L.warn(e):olympe.D.L.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.L.log(f,'undefined'):null===g?olympe.D.L.log(f,'null'):olympe.D.L.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.L.log(`Node #${d} destroyed`+(b?`: ${b}`:
339
+ ''))});c.onDestroy(()=>{delete wb[d]})}}else olympe.D.L.log('NOT starting node dump, node is '+String(a))};olympe.D.MC=function(){let a='',b=olympe.D.Ja();for(;null!==b;)a+=b.Lb()+' --\x3e ',b=b.getParent();olympe.D.L.log(a)};
340
+ olympe.D.za=function(a){if(void 0===a)return olympe.D.ea.ZERO;if(a instanceof olympe.D.ea)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ea.Up;if(a===Math.PI)return olympe.D.ea.PI;if(Infinity===a)return olympe.D.ea.vt;if(-Infinity===a)return olympe.D.ea.mu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Vh.has(a)||olympe.D.Vh.set(a,new olympe.D.ea(a)),olympe.D.Vh.get(a)):new olympe.D.ea(a)}return null};
341
+ olympe.D.ge=function(a){return void 0===a?olympe.D.Nd(olympe.D.ea):olympe.D.Nd(olympe.D.ea,olympe.D.Wf(a)?a:olympe.D.za(a))};olympe.D.Xx=olympe.D.ea.animate;olympe.D.dD=function(a,b){return new olympe.D.ys(a,b)};olympe.D.Bb=function(a){if(a instanceof olympe.D.Wa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.Jk.has(a)?olympe.D.Jk.get(a):new olympe.D.Wa(a)};
342
+ olympe.D.gD=function(a){return void 0===a?olympe.D.Nd(olympe.D.Wa):olympe.D.Nd(olympe.D.Wa,olympe.D.Wf(a)?a:olympe.D.Bb(a))};olympe.D.Cc=function(a){return a instanceof olympe.D.qa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.qa.F:olympe.D.qa.C};olympe.D.ly=function(a){return void 0===a?olympe.D.Nd(olympe.D.qa):olympe.D.Nd(olympe.D.qa,olympe.D.Wf(a)?a:olympe.D.Cc(a))};olympe.D.Yx=function(a){if(a instanceof Date)return new olympe.D.jb(a)};
343
+ olympe.D.fD=function(a){return olympe.D.Nd(olympe.D.jb,void 0!==a?new olympe.D.jb(a):null)};olympe.D.cs=a=>a instanceof olympe.D.qa||a instanceof olympe.D.ea||a instanceof olympe.D.Wa||a instanceof olympe.D.jb;olympe.D.hD=function(a,b){return olympe.D.Nd(olympe.D.mc,void 0===a&&void 0===b?void 0:new olympe.D.mc(a,b))};olympe.D.ky=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.Nd(olympe.D.Color,e)};olympe.D.eD=olympe.D.ky;
344
+ olympe.D.Rv=function(a){olympe.D.L=a;olympe.D.$h=olympe.D.nh()};olympe.D.nh=function(){olympe.D.Bn||(olympe.D.Bn=new olympe.D.Jq);return olympe.D.Bn};olympe.D.Ja=function(){olympe.D.$h||(olympe.D.$h=olympe.D.nh());return olympe.D.$h};olympe.D.ms=function(a){const b=olympe.D.$h;olympe.D.qn(a)&&(olympe.D.$h=a);return b||null};
345
+ olympe.D.oc=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.jb.oc(a);break;case 'number':b=olympe.D.ea.oc(a);break;case 'string':b=olympe.D.Wa.oc(a);break;case 'vector2':b=olympe.D.mc.oc(a);break;case 'color':b=olympe.D.Color.oc(a);break;case 'boolean':b=olympe.D.qa.oc(a)}return b}return null};function yb(a){a.C.Ab()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.U.clear(),a.Y.length=0,a.N.length=0)}
346
+ olympe.D.mB=class{constructor(){this.C=new olympe.D.Xb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.Uc(zb,'Last slot manager entry');this.size=pb(olympe.D.Uc(olympe.D.ea,'SlotManager size').repeat(this.F.Fb().dn()),olympe.D.ea.ZERO);this.U=pb(olympe.D.Uc(olympe.D.ea,'last valid slots'),olympe.D.za(-1))});this.Y=[];this.N=[];this.C.onDestroy(()=>{yb(this)})}};
347
+ class zb{constructor(a,b,c,d){this.id=a;this.nc=new olympe.D.Xb('Slot manager entry');this.G=c;this.N=d;this.nc.run(()=>{const e=pb(olympe.D.Uc(olympe.D.ea),olympe.D.ea.ZERO);olympe.D.lb(b)?e.repeat(b):e.update(b);this.C=olympe.D.Uc(olympe.D.ea);this.F=this.C.Fb().he(e.Fb())});this.next=null}Z(){return this.id}nx(){return this.C.Fb()}dn(){return this.F}fe(){return this.G}zx(){return this.N}Qy(a){this.G=a}Ay(a){null===a?this.C.update(olympe.D.ea.ZERO):(this.C.repeat(a.dn()),a.next=this)}Gt(){this.C.clear();
348
+ this.next=null}destroy(){this.nc.destroy();this.F=this.C=this.next=null}}m=zb.prototype;m.Z.K=olympe.D.J.C;m.nx.K=new olympe.D.J(()=>olympe.D.ea);m.dn.K=new olympe.D.J(()=>olympe.D.ea);m.fe.K=olympe.D.J.C;m.zx.K=olympe.D.J.C;m.Qy.K=olympe.D.J.C;m.Ay.K=olympe.D.J.C;m.Gt.K=olympe.D.J.C;m.destroy.K=olympe.D.J.C;olympe.D.P={Ea:'df.Logger'};olympe.T.config(a=>{D(a,olympe.D.Config.Vp,Number.POSITIVE_INFINITY);C(a,olympe.D.P.Ea,[olympe.ra.P.xa],b=>b.Rc('df'))},'olympe.df');olympe.T.run([olympe.D.P.Ea],a=>{olympe.D.Rv(a)},'olympe.df');olympe.host={};const Ab=new Map,Bb=new Map;olympe.host.Zp=class{static register(a,b,...c){Ab.set(a,b);0<c.length&&Bb.set(a,c)}static create(a,b,c,d){const e=Ab.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Bb.get(a);return void 0!==a?new e(b,c,...a.map(f=>la(d,f))):new e(b,c)}};function Cb(a,b,c){a.L.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Zp.create(c,b,a.L,a.N))}function Db(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.L.N()<=olympe.ra.Pb.C.eg&&a.L.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.lb(f))b.push(a.C.get(f.pv)||null);else if('function'===typeof f){const g=f,h=olympe.D.Ja();b.push((...k)=>{h.Ab()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
349
+ function Eb(a){var b=olympe.host.ba.gd,c=olympe.host.ba.Yp.sr;++a.G;const d=a.G;Cb(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.lb(p)?(h.push(n),p=p.Na):olympe.D.Vf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Db(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
350
+ {Db(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.zc(a.U.bind(a,d));a=L(e);a.pv=d;K(e,a);return a}olympe.host.sa=class{constructor(a,b){this.L=a;this.N=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}Xa(){return this.L}U(a){this.L.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Hd=class{constructor(a){this.C=a;this.F=olympe.D.Ja()}N(){return this.C}G(){return this.C.Na.G()||this.F.G()}Ab(){return this.C.Na.Ab()}};olympe.host.Hd.prototype.N.K=new olympe.D.J(()=>olympe.host.ba.Hd,[]);olympe.host.zk=class{};olympe.host.Gi=class{constructor(){}C(){}F(){}qj(){}};function Fb(a){return(a=a.find(b=>'authToken'===b.ma()))?a.getValue():null}olympe.host.Gi.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}ma(){return this.name}getValue(){return this.value}qb(a){return this.ma()===a.ma()&&this.getValue()===a.getValue()&&this.C===a.C}};function Gb(){const a={}.parameters;return new olympe.host.Gi.C(a?a.map(b=>new olympe.host.Gi.F(b.name,b.value,b.hidden)):[])}
351
+ olympe.host.Gi.C=class{constructor(a){this.parameters=a}wn(a){const b=new Map(this.parameters.map((c,d)=>[c.ma(),d]));a.parameters.forEach(c=>{b.has(c.ma())?this.parameters[b.get(c.ma())]=c:this.parameters.push(c)})}};function Hb(a,b){var c=olympe.host.bf;const d=olympe.W.hc(),e=new olympe.D.Xb('onTimeout context');c.C.aa(b,d,()=>{e.Ab()||e.G()||e.run(a);c.C.G(d)});return new olympe.host.gd.G(c.C,d)}function Ib(a,b){var c=olympe.host.bf;const d=olympe.W.hc(),e=new olympe.D.Xb('onInterval context');c.C.Y(b,d,()=>{e.Ab()||e.G()?c.C.F(d):e.run(a)});return new olympe.host.gd.F(c.C,d)}function Jb(a){var b=olympe.host.bf;a=a instanceof olympe.host.gd.F?a.Z():a;b.C.F(a)}olympe.host.gd=class{constructor(a){this.C=Eb(a)}};
352
+ olympe.host.gd.C=class{constructor(a,b){this.bf=a;this.id=b}Z(){return this.id}cancel(){}};olympe.host.gd.N=class extends olympe.host.gd.C{cancel(){this.bf.U(this.id)}};olympe.host.gd.G=class extends olympe.host.gd.C{cancel(){this.bf.G(this.id)}};olympe.host.gd.F=class extends olympe.host.gd.C{cancel(){this.bf.F(this.id)}};olympe.host.ba={};olympe.host.ba.Hd=class{destroy(){}};olympe.host.ba.Hd.prototype.destroy=olympe.host.ba.Hd.prototype.destroy;olympe.host.ba.Yp={Yy:100,$y:101,Zy:102,bz:103,az:104,Xy:105,$A:201,YA:202,VA:204,cB:205,UA:206,XA:207,aB:208,dB:209,eB:210,fB:211,WA:212,bB:218,ZA:219,gB:220,TA:221,SA:222,pB:300,qB:301,rB:302,vB:303,wB:304,xB:305,sB:310,tB:311,uB:312,AA:400,BA:401,CA:402,wA:450,oA:500,mA:501,rA:502,qA:503,nA:504,pA:505,QB:600,HB:601,LB:602,DB:603,EB:604,BB:605,GB:606,WB:607,OB:608,yB:609,CB:610,FB:611,NB:612,SB:613,zB:614,RB:615,MB:616,VB:617,IB:618,JB:619,KB:620,PB:630,AB:631,TB:632,UB:633,xC:700,aC:701,bC:702,
353
+ cC:703,eC:704,fC:705,gC:706,dC:707,iC:708,hC:709,jC:710,nC:711,vC:712,kC:713,lC:714,oC:715,pC:716,rC:717,sC:718,uC:719,qC:720,tC:721,wC:722,mC:723,yC:724,zC:725,sr:800};olympe.host.ba.gd=class{U(){}aa(){}G(){}Y(){}F(){}};olympe.host.P={Xq:'host.System',Jl:'host.HistoryManager',Lq:'host.Scheduler',Ea:'host.platform.Logger',xa:'host.Manager'};olympe.host.bf=null;olympe.T.config(function(a){sa(a,olympe.host.P.Xq);sa(a,olympe.host.P.Jl);C(a,olympe.host.P.Ea,[olympe.ra.P.xa],function(b){return b.Rc('host')});A(a,olympe.host.P.xa,olympe.host.sa,olympe.host.P.Ea,olympe.T.P.dg);C(a,olympe.host.P.Lq,[olympe.host.P.xa],b=>{null===olympe.host.bf&&(olympe.host.bf=new olympe.host.gd(b));return olympe.host.bf},!0)},'olympe.host');
354
+ olympe.T.run([olympe.host.P.Lq],a=>a,'olympe.host.scheduler');olympe.T.run([olympe.host.P.xa],a=>a,'olympe.host');olympe.net={};olympe.net.cb={};olympe.net.cb.$d={jm:'POST',GET:'GET',st:'HEAD',nk:'PUT',Hc:'DELETE',em:'OPTIONS',EA:'PATCH'};olympe.net.cb.ResponseType={Ak:'text',rl:'blob',ARRAY_BUFFER:'arraybuffer'};olympe.net.cb.Headers={Mj:'content-type',iz:'content-length',si:'authorization',xs:'access-control-allow-origin'};olympe.net.cb.jz={eA:'text/html',JSON:'application/json',CC:'application/zip'};olympe.net.cb.hd={Es:0,Jh:200,xl:201,Ej:202,Wy:400,kv:401,it:403,yA:404,sA:405,Mq:500,Ru:503};function Kb(a){return a.host&&encodeURI(a.host)}function Lb(a){return encodeURI(a.path).replace(olympe.net.Hk.C,(b,c)=>'%'+c)}function Mb(a){return void 0===a.G?443===a.port:a.G}olympe.net.Hk=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${Mb(this)?'wss':'ws'}://${Kb(this)}:${this.port}/${Lb(this)}`}toString(){return`${Kb(this)}:${this.port}/${Lb(this)}`}};
355
+ olympe.net.Hk.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ha(){}aa(){}U(){}};function Nb(a,b,c,d){a=olympe.W.ny(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.$j(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.ts&&(c=a.ts.split(':'),2===c.length&&(c=olympe.W.ci().C(Ca(`${c[0]}:${c[1]}`)),Ob(b,{Authorization:`Basic ${c}`})));return b}function Pb(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}
356
356
  function Ob(a,b){for(let c in b)Object.prototype.hasOwnProperty.call(b,c)&&(a.headers[c]=b[c])}
357
- olympe.net.Yj=class extends olympe.net.Gk{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.cb.$d.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.cb.ResponseType.zk;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}hj(){return this.headers}C(){let a=Pb(this);a=a?`?${a}`:'';return Kb(this)?`${Mb(this)?'https':'http'}://${Kb(this)}:${this.port}/${Lb(this)}${a}`:`${Lb(this)}${a}`}toString(){return this.C()}};
358
- olympe.net.Yj.$d={jm:'POST',GET:'GET',pt:'HEAD',mk:'PUT',Hc:'DELETE',em:'OPTIONS'};olympe.net.Tg=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Rd(){return this.status}hj(){return this.headers}};function Qb(a,b,c){const d=olympe.D.Ja(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.C(f=>{d.Je(e);a.F().C.delete(b);c(f)})}olympe.net.sa=class{constructor(a){this.N=a;this.G=1;a='Initializing NET layer';this.N.G()&&(a+=' (implementation: '+this.U()+')');this.N.info(a);this.N.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}aa(){}C(){}L(){}U(){}};function Rb(a){return!(!a.client||!a.client.connected)}function Sb(a,b,c){a.connect();a.client.subscribe(b,void 0,d=>{d?a.N.error(`Failed to subscribe to topic ${b}: ${d}`):a.C.set(b,c)})}function Tb(a,b,c){a.connect();a.client.unsubscribe(b,void 0,c);a.C.delete(b)}
359
- olympe.net.gk=class{constructor(a,b){this.url=a;this.G=b||null;this.client=null;this.F=[];this.C=new Map;this.N=olympe.ra.Xa('MQTT')}connect(a){if(Rb(this))return a&&a(),this;a&&this.F.push(a);null===this.client&&(this.client=mqtt.connect(this.url,this.G),this.client.on(olympe.net.gk.C.iu,(b,c)=>{this.C.has(b)?this.C.get(b)(JSON.parse(c.toString())):this.N.warn('There is no subscriber for topic '+b)}),this.client.on(olympe.net.gk.C.Is,()=>this.F.forEach(b=>b())));return this}publish(a,b,c,d){this.connect();
360
- this.client.publish(a,JSON.stringify(b),c,e=>{d&&d(e);e&&this.N.error('Failed to publish a message '+b)});return this}end(a,b){this.client&&this.client.end(a,{},()=>{b&&b();this.client=null});return this}};olympe.net.gk.C={Is:'connect',iu:'message',cz:'close',uz:'end'};olympe.net.Fk=class{constructor(a){this.N=a}aa(){this.N.error('Try to set cors policies on a web server with the browser implementation.');return this}L(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Y(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};olympe.net.P={xa:'net.Manager',Ea:'net.Logger',Bm:'net.WebServer'};olympe.net.Config={Jl:'net.httpHost',Kl:'net.httpPort',mp:'net.httpSSL',kp:'net.httpBodyLimit'};
361
- olympe.T.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;D(a,olympe.net.Config.Jl,b);D(a,olympe.net.Config.Kl,c?3141:443);D(a,olympe.net.Config.mp,!c);D(a,olympe.net.Config.kp,100);sa(a,olympe.net.P.xa);C(a,olympe.net.P.Ea,[olympe.ra.P.xa],function(d){return d.Rc('net')});A(a,olympe.net.P.Bm,olympe.net.Fk,olympe.net.P.Ea)},'olympe.net');olympe.async={};function Ub(a,b){0<=b&&(a.timeout=b)}function Vb(a,b){a.L||a.Ld.push(a.G.C(b))}
362
- olympe.async.Lo=class{constructor(a,b=void 0===a){this.C=[];this.Ld=[];this.G=a||new olympe.D.Xb('Async executor context');this.oa=b;this.F=null;this.env=new Map;this.env.set('Executor',this);this.L=this.U=!1;this.N=null;this.Y=this.timeout=0}Xa(){return this.N}add(a){this.L||this.C.push(this.G.C(a));return this}start(){this.U||(this.N&&this.N.log('Executor started.'),this.U=!0,0<this.timeout&&(this.Y=setTimeout(()=>{this.F='Timeout expired.';this.Y=0;this.complete(!1)},this.timeout)))}clear(){this.C=
363
- [];this.Ld=[];this.env.clear();this.oa&&this.G.destroy()}complete(a){if(!this.L){this.L=!0;this.Y&&(clearTimeout(this.Y),this.Y=0);this.N&&this.N.log(a?'Executor completed successfully':`Executor completed with error: ${this.F}`);for(const b of this.Ld)b(a,a?null:this.F,this.env);this.clear()}}};
364
- function Wb(a){if(0<a.C.length){const b=a.C.shift();a.N&&a.N.log(`Executing next task. ${a.C.length} tasks left in the pipeline.`);a.G.run(()=>{b(()=>{Promise.resolve().then(()=>{Wb(a)})},c=>{c&&(a.F=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.wk=class extends olympe.async.Lo{static create(){return new olympe.async.wk(new olympe.D.Xb('SequencedExecutor'),!0)}insert(a){this.L||this.C.unshift(a);return this}start(){this.U||(super.start(),Wb(this))}};
365
- olympe.async.ng=class extends olympe.async.Lo{constructor(a,b){super(a,b);this.aa=0;this.ja=!0}static create(){return new olympe.async.ng(new olympe.D.Xb('ParallelExecutor'),!0)}run(a){this.N&&this.N.log('Starting a task');this.G.run(()=>{a(()=>{this.done()},b=>{this.ja=!1;b&&(this.F=this.F?`${this.F}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.U&&!this.L&&(this.aa++,this.run(a));return this}done(){this.aa--;0>=this.aa&&this.complete(this.ja)}start(){if(!this.U)if(super.start(),0<
366
- this.C.length){this.aa=this.C.length;for(const a of this.C)this.run(a)}else this.complete(!0)}};olympe.ic={};olympe.ic.Yt=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.ic.Xt=class{constructor(){}C(){}};olympe.ic.Storage=class{open(){}F(){}U(){}write(){}G(){}L(){}C(){}close(){}};function Xb(a,b,c){a.storage.F(c)}function Yb(a,b,c,d,e){a.storage.write(b,'transactions',c.toJSON(),'text/json',d,e)}function Zb(a,b){a.storage.G(b)}function $b(a,b){a.storage.C(b)}function ac(a,b,c,d,e,f){a.storage.write(b,'files',c,d,()=>{e('files/'+b)},f)}function bc(a,b){a.storage.U(b)}olympe.ic.Us=class{constructor(a){this.storage=a}};olympe.ic.P={ck:'localStorage.KeyValueManager',Qi:'localStorage.Storage',uo:'localStorage.DatacloudStorage',Ea:'localStorage.Logger'};olympe.T.config(function(a){sa(a,olympe.ic.P.ck);C(a,olympe.ic.P.Ea,[olympe.ra.P.xa],function(b){return b.Rc('localstorage')});A(a,olympe.ic.P.uo,olympe.ic.Us,olympe.ic.P.Qi)},'olympe.localstorage');olympe.auth={};olympe.auth.Wu=class{U(){}L(){}Sa(){}aa(){}hi(){}oh(){}Ur(){}};function cc(a){a.N.info('Initializing AUTH layer');let b=a.ac;if(a.ja){const c=a.ja.C(),d=Fb(c.parameters);b=d||b;d&&a.ja.F(c.parameters.filter(e=>'authToken'!==e.ma()))}b&&a.storage&&dc(a.storage,b,c=>{!c&&a.N.error('Could not store authToken')});a.N.debug('Asking to be notified when auth connector gets online');a.F.U(()=>{if(a.Ya)if(a.L=olympe.auth.sa.G.us,a.N.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.Y){const c=new olympe.auth.Request;c.set('username',
367
- a.Y);c.Fn(a.ab);a.N.log('Autologin with user "'+a.Y+'"');ec(a,c)}else a.N.error('autoLogin: auto user not specified.'),fc(a);else a.L=olympe.auth.sa.G.Ak,a.N.log('Connector online, attempting to log with token'),gc(a)});a.F.L(()=>{switch(olympe.D.bb(a.G)){case olympe.auth.sa.C.Ng:a.N.warn('Disconnected from server - session of user '+olympe.D.bb(a.C.Fb()).Sd()+' lost');break;case olympe.auth.sa.C.Ah:a.N.warn('Disconnected from server - guest session lost');break;case olympe.auth.sa.C.ni:a.N.warn('Disconnected from server - authentication aborted');
368
- break;case olympe.auth.sa.C.INIT:a.N.warn('Cannot open auth session - no server connection');break;default:a.N.error('Should not get there, investigate')}hc(a,olympe.auth.sa.C.gg)});a.F.Sa((c,d)=>{if(c===olympe.auth.sa.F.Cj)a.N.info('Authentication revoked'),fc(a),a.storage&&ic(a.storage),a.oa.forEach(e=>{e(c,d)});else if(c===olympe.auth.sa.F.pp)a.N.info('Redirection to IDP to invalidate token (SAML)'),a.storage&&ic(a.storage),a.Sa.F();else throw Error(`Unknown logout step coming from server : ${c}`);
369
- });a.N.log('DONE initializing AUTH layer (waiting for connector to be online)')}
370
- function gc(a){null!==a.storage?(a.N.debug('Retrieving token from local storage'),a.storage.bd(b=>{if(b){const d=new olympe.auth.Request;var c=b.Sd();d.set('username',c);b=b.Mf();d.set('nonce',b);a.N.debug('Token found, trying login with',d);ec(a,d,a.Lb)}else a.N.debug('No token found, cannot perform auto login. Falling back in GUEST state'),fc(a)})):(a.N.error('Cannot retrieve token: no storage configured, cannot perform auto login. Falling back in GUEST state'),fc(a))}
371
- function hc(a,b){a.N.log('State change: ',jc(a),'--\x3e',b);a.G.update(b)}function fc(a){a.C.update(a.Da);hc(a,olympe.auth.sa.C.Ah);a.N.info('Authenticated as guest')}function jc(a){return olympe.D.bb(a.G.Fb())}function kc(a){const b=olympe.auth.sa.C.Ng,c=olympe.auth.sa.C.Ah,d=olympe.auth.sa.C.ni,e=olympe.D.Uc(olympe.D.qa,'auth.isOnline');olympe.D.Ec([a.G],f=>{f=olympe.D.Cc(f===b||f===c||f===d);const g=olympe.D.bb(e);void 0!==g&&g.qb(f)||e.update(f)},'Router is online');return e.Fb()}
372
- function lc(a){var b=olympe.public.Ua.get(),c='logoutCallback';void 0===c&&(c=olympe.W.yg());b.oa.set(c,a)}function mc(a){return a.C.Fb().Mf()}function nc(a,b,c,d=!1){b=b+c?':'+c.message:'';a.N.error(b);a.error.update(olympe.D.Bb(b));hc(a,olympe.auth.sa.C.uc);if(d)throw Error(b);}
373
- function ec(a,b,c,d){void 0===c&&(c=a.wb);void 0===c&&nc(a,'No authentication provider specified',null,!0);const e=a.Jb.get(c);e||nc(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.U.set('login',d);a.N.log('Sending authentication request using "'+c+'" for '+b);e.bd(b,a.Ib.bind(a));hc(a,olympe.auth.sa.C.ni)}function oc(a,b,c){a.U.forEach(d=>{d(b,c)})}
374
- olympe.auth.sa=class{constructor(a,b,c,d,e,f,g,h,k,l,n,p){this.N=a;this.F=b;this.storage=c;this.Sa=d;this.ja=e;this.wb=g;this.Lb=h;this.Ya=void 0===k?!0:k;this.Y=l;this.ab=n;this.ac=p;this.Jb=new Map;this.G=olympe.D.Uc(String).update(olympe.auth.sa.C.INIT);this.error=olympe.D.Uc(olympe.D.Wa);this.L=null;this.Da=new olympe.auth.vf('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=olympe.D.Uc(olympe.auth.vf).update(this.Da);this.U=new Map;this.oa=new Map;f.forEach(q=>{const r=
375
- q.ma();if(this.Jb.has(r))throw Error('Provider "'+r+'" has already been registered !');this.Jb.set(r,q)});cc(this)}getState(){return this.G.Fb()}aa(){return this.error.Fb()}Sd(){return this.C.Fb().Sd()}Dg(){return this.C.Fb().Dg()}bi(){return this.C.Fb().bi()}oh(a,b){this.F.oh(a,olympe.D.bb(mc(this)),b)}un(){this.N.debug('Sending logout');ic(this.storage);this.F.aa(a=>{a?nc(this,'Logout request rejected:',a):this.N.debug('Logout request acknowledged')})}hi(){jc(this)===olympe.auth.sa.C.Ng&&this.F.hi(a=>
376
- {a&&this.N.error('Was not able to send the auth keep alive message:',a.message)})}Ib(a,b){const c=null===this.L?olympe.auth.sa.G.fu:this.L;this.L=null;a?(this.N.warn('Authentication rejected: '+a.message+'. Falling back into GUEST state'),ic(this.storage),this.error.update(olympe.D.Bb(a.message)),fc(this),oc(this,a,c)):(this.N.info('User '+b.Sd()+' (#'+b.Dg()+') successfully authenticated'),this.C.update(b),hc(this,olympe.auth.sa.C.Ng),oc(this,a,c),this.storage&&dc(this.storage,b));this.U.has('login')&&
377
- this.U.delete('login')}};olympe.auth.sa.C={INIT:'init',gg:'disconnected',Ah:'guest',ni:'authenticating',uc:'error',Ng:'authenticated'};olympe.auth.sa.G={fu:'manual',us:'auto',Ak:'tokenOnFirstConnection'};olympe.auth.sa.F={Cj:'accepted',pp:'redirect'};olympe.auth.Ni=class{ma(){}bd(){}};olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.Ec([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.zf&&(a=a.Na.Kb);return a?a.valueOf():a}Sd(){return this.get('username')}Fn(a){this.set('password',a)}Mf(){return this.get('nonce')}toString(){return this.Sd()+(this.Mf()?' with nonce':'')+(this.get('password')?' with password':'')}};olympe.auth.vf=class{constructor(a,b,c,d={}){this.user=a;this.Bj=b;this.F=c;this.G=d}Sd(){return this.user}Dg(){return this.Bj}Mf(){return this.F}ak(){return this.G}bi(){return null}ia(){var a=olympe.W,b=a.Cr;var c=JSON.stringify({user:this.user,userTag:this.Bj,nonce:this.F,payload:this.G});c=olympe.W.ai().C(Ca(c));return b.call(a,c)}};m=olympe.auth.vf.prototype;m.Sd.K=new olympe.D.J(()=>String,[]);m.Dg.K=new olympe.D.J(()=>String,[]);m.Mf.K=new olympe.D.J(()=>String,[]);
378
- m.ak.K=new olympe.D.J(()=>Object,[]);m.bi.K=new olympe.D.J(()=>String,[]);m.ia.K=new olympe.D.J(()=>String,[]);olympe.auth.hm=class extends olympe.auth.vf{constructor(a,b,c,d){super(a,b,c,d)}bi(){return this.ak().access_token||null}};olympe.auth.Jq=class extends olympe.auth.vf{constructor(a,b,c,d){super(a,b,c,d);this.C=null}bi(){return this.C}ia(){var a=olympe.W.ai(),b={user:this.Sd(),userTag:this.Dg(),nonce:this.Mf(),payload:this.ak(),fullToken:this.C},c=olympe.W,d=c.Cr;b=JSON.stringify(b);a=a.C(Ca(b));return d.call(c,a)}};function dc(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ia(),e=>{d.close();c&&c(e)})}function ic(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
379
- olympe.auth.xm=class{constructor(a,b,c){this.C=a;this.N=b;this.key='OlympeToken-'+c.C}bd(a){const b=this.C.C('AUTH');this.N.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.N.debug('olympe.auth.TokenStorage: Token retrieved successfully');{var e=JSON,f=e.parse;var g=Da(olympe.W.ai().U(olympe.W.Ev(c)));const h=f.call(e,g);if(h.fullToken){const k=new olympe.auth.Jq(h.user,h.userTag,h.nonce,h.payload);k.C=h.fullToken;d=k}else d=h.payload&&
380
- h.payload.id_token?new olympe.auth.hm(h.user,h.userTag,h.nonce,h.payload):new olympe.auth.vf(h.user,h.userTag,h.nonce,h.payload)}}catch(h){this.N.error('Error while unserializing token: ',h.message)}else this.N.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.xm.F='OlympeToken';olympe.auth.xm.C='AUTH';olympe.auth.tk=class{redirect(){}F(){}C(){}};olympe.auth.tk.C={GET:'GET',jm:'POST'};olympe.auth.ol=class{constructor(a){this.C=a||'default'}};olympe.auth.Jb={};olympe.auth.Jb.pa={};olympe.auth.Jb.pa.Ii=class{Y(){}};olympe.auth.Jb.pa.Oe=class{ja(){}};olympe.auth.Jb.pa.Ee=class{oa(){}Da(){}};function pc(a,b){return olympe.W.mb(b+'-olympe-'+a.C[b])}olympe.auth.Jb.Hi=class{constructor(a){this.C=a}ma(){return'local'}bd(a,b){const c=a.Sd();if(c){const d=a.get('password'),e=a.Mf();a.C.delete('password');if(void 0!==e&&pc(this,c)===e){b(null,new olympe.auth.vf(c,'',pc(this,c)));return}a=olympe.W.mb(d||'');if(this.C[c]===a){b(null,new olympe.auth.vf(c,'',pc(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.Jb.Hi.C='local';olympe.auth.Jb.Hi.la=[olympe.auth.Ni];olympe.auth.Jb.Ii=class{constructor(a,b){this.C=a;this.storage=b}ma(){return'localToken'}bd(a,b){this.storage.bd(c=>{this.C.Y(a,(d,e)=>{b(d,e||c)})})}};olympe.auth.Jb.Ii.C='localToken';olympe.auth.Jb.Ii.la=[olympe.auth.Ni];olympe.auth.Jb.gm=class{constructor(a,b){this.C=a;this.F=b}ma(){return'openID'}bd(){const a=this.C.C();this.C.redirect(`${this.F}/auth?url=${a}`,null,olympe.auth.tk.C.GET)}};olympe.auth.Jb.gm.C='openID';olympe.auth.Jb.gm.la=[olympe.auth.Ni];olympe.auth.Jb.Oe=class{constructor(a,b){this.F=a;this.C=b}ma(){return'saml'}bd(a,b){this.F.ja(c=>{c?b(c):this.C.F()})}};olympe.auth.Jb.Oe.C='saml';olympe.auth.Jb.Oe.la=[olympe.auth.Ni];olympe.auth.Jb.Ee=class{static cj(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}constructor(a){this.C=a;this.N=olympe.ra.Xa('auth')}ma(){return'srp'}bd(a,b){const c=a.get('password');a.C.delete('password');this.N.debug('Sending SRP request');this.C.oa(a,(d,e,f)=>{this.N.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.Sd(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);
381
- return}this.N.debug('Sending SRP A+M (proof) message');this.C.Da(a,b)}})}};olympe.auth.Jb.Ee.C='srp';olympe.auth.Jb.Ee.la=[olympe.auth.Ni];olympe.auth.P={xa:'auth.Manager',Ea:'auth.Logger',Qi:'auth.Storage',Dj:'auth.appNameToken',pk:'auth.Redirector'};olympe.auth.sd={xa:'auth.ManagerConnector',Jp:'auth.LocalTokenConnector',Ee:'auth.SRPConnector',Oe:'auth.SAMLConnector'};olympe.auth.Config={zl:'auth.defaultProvider',Kp:'auth.localTokenProvider',On:'auth.autoLogin',Sn:'auth.autoUser',Pn:'auth.autoPassword',Ak:'auth.token',Mn:'auth.appToken'};
382
- olympe.T.config(function(a){D(a,olympe.auth.Config.zl,'srp');D(a,olympe.auth.Config.Kp,'localToken');D(a,olympe.auth.Config.On,!1);D(a,olympe.auth.Config.Sn,'');D(a,olympe.auth.Config.Pn,'');D(a,olympe.auth.Config.Ak,'');D(a,olympe.auth.Config.Mn,'default');C(a,olympe.auth.P.Ea,[olympe.ra.P.xa],b=>b.Rc('auth'));A(a,olympe.auth.P.Dj,olympe.auth.ol,new olympe.T.fa(olympe.auth.Config.Mn));A(a,olympe.auth.P.Qi,olympe.auth.xm,olympe.ic.P.ck,olympe.auth.P.Ea,olympe.auth.P.Dj);sa(a,olympe.auth.sd.xa);sa(a,
383
- olympe.auth.P.pk);C(a,olympe.auth.P.xa,[olympe.auth.P.Ea,olympe.auth.sd.xa,olympe.host.P.Il,new olympe.T.zb(olympe.auth.P.Qi,olympe.T.gf.C.Gh),new olympe.T.fa(olympe.auth.Config.zl),new olympe.T.fa(olympe.auth.Config.Kp),new olympe.T.fa(olympe.auth.Config.On),new olympe.T.fa(olympe.auth.Config.Sn),new olympe.T.fa(olympe.auth.Config.Pn),new olympe.T.fa(olympe.auth.Config.Ak),new olympe.T.zb(olympe.auth.P.pk,olympe.T.gf.C.Gh),new olympe.T.zb(olympe.auth.sd.Jp,olympe.T.gf.C.Gh),new olympe.T.zb(olympe.auth.sd.Ee,
384
- olympe.T.gf.C.Gh),new olympe.T.zb(olympe.auth.sd.Oe,olympe.T.gf.C.Gh)],(b,c,d,e,f,g,h,k,l,n,p,q,r,t)=>{const u=[];q&&u.push(new olympe.auth.Jb.Ii(q,e));r&&u.push(new olympe.auth.Jb.Ee(r));t&&p&&u.push(new olympe.auth.Jb.Oe(t,p));p&&c&&u.push(new olympe.auth.Jb.gm(p,c.Ur()));if(0===u.length)throw Error('At least one provider is needed for auth to start');if(!u.map(v=>v.ma()).includes(f))throw Error('Default provider name'+f+'given by parameter'+olympe.auth.Config.zl+'cannot be found');return new olympe.auth.sa(b,
385
- c,e,p,d.oj()?d:null,u,f,g,h,k,l,n)},!0)},'olympe.auth');olympe.T.run([olympe.auth.P.xa],a=>{olympe.auth.Tc=()=>a});olympe.dc={};olympe.dc.Aa={ORIGIN:'<',DESTINATION:'>'};z('olympe.dc.Direction',olympe.dc.Aa);olympe.dc.kc={Xc:'ff022000000000000000',xi:'ff02200000000000000e',jo:'ff02200000000000000f'};olympe.dc.$b={VERSION:'@v',Jd:'@s'};olympe.dc.Ug={jc:'?'};olympe.dc.xk={cq:'online',bm:'offline',vt:'invalidate'};olympe.dc.Ga={rb:'self',Pc:'server',lq:'peer',jc:'server'};olympe.dc.wa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.bb(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.R?b=a.R():'function'===typeof a&&(b=olympe.dc.ya.Tb(a)));return b||''};z('olympe.dc.instanceToTag',olympe.dc.wa);olympe.dc.Oa=function(){return olympe.dc.Ad().view};olympe.dc.register=function(a,b){olympe.dc.ya.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.ta.Property(a)};
386
- olympe.dc.ih=function(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.Aa.DESTINATION){const e=olympe.dc.Aa.DESTINATION;return b===olympe.dc.Aa.ORIGIN||b===e?new olympe.dc.ta.Relation(a,b):new olympe.dc.ta.Relation(a,d,b,c)};olympe.dc.Rv=function(a){return a.Gc()};olympe.dc.Writable=class{F(){}tc(){}Mc(){}Ra(){}ec(){}};olympe.dc.lm=class{Qc(){}Z(){}G(){}};function qc(a,b,c,d,e,f,g){d=new olympe.dc.ga(olympe.dc.ga.ka.Qh,{file:b,url:null,content:c,Ye:e?h=>{rc(a,b,c);f(h)}:f,mimeType:d,se:g||null},[olympe.dc.Oa().source(b)||olympe.dc.Ga.Pc]);a.F.send(d)}function sc(a,b,c,d,e,f){c=c instanceof olympe.D.Wa?c.valueOf():c;'string'===typeof c?c=new Blob([Ca(c)],{type:d}):c instanceof ArrayBuffer&&(c=new Blob([c],{type:d}));qc(a,b,c,d,a.G,e,f)}
387
- function rc(a,b,c){const d=olympe.dc.wa(b);a.C.set(d,c);const e=olympe.W.yg();tc(olympe.dc.Oa(),d,f=>{f||(a.C.delete(d),uc(olympe.dc.Oa(),d,e))},e)}function vc(a,b,c,d){olympe.D.gs([b.$r(),b.R(),b.Rl(),b.fn()],(e,f,g,h)=>{a.C.has(f)?c(a.C.get(f)):(e=new olympe.dc.ga(olympe.dc.ga.ka.xh,{file:f,url:e.valueOf()?null:g,mimeType:h.valueOf(),Ye:a.G?k=>{rc(a,f,k);c(k)}:c,se:d},[olympe.dc.Oa().source(f)||olympe.dc.Ga.Pc]),a.F.send(e))})}
388
- olympe.dc.it=class{constructor(a,b,c,d,e){this.N=a;this.F=c;this.G=e;this.C=new Map}};olympe.dc.sa=class{constructor(a){this.N=a}};function wc(a,b){a.F=b;return a}function M(a,b){a.Vh.unshift(b);return a}olympe.dc.ga=class{constructor(a,b,c){this.type=a;this.content=b;this.C=c;this.Vh=[];this.F=olympe.D.Ja()}validate(a=null){this.Vh.forEach(b=>{b(a||null)})}toString(){const a=olympe.W.Sr(olympe.dc.ga.ka,this.type);return a?a:'UNKNOWN_MESSAGE'}};
389
- olympe.dc.ga.ka={uc:1,lg:2,Sg:10,bA:11,Ru:20,jB:21,kB:22,Tu:23,Ai:24,zi:25,cA:26,Zo:28,om:30,qm:31,Au:32,eh:40,Bk:41,wh:45,Ij:46,Sj:47,Qh:50,xh:51,wi:52,hv:60,Gu:61,kt:62,lt:63,Gs:64,sl:65,aA:90,yl:91,Hl:92,$o:93,Fp:94,hk:95,Su:96,QUERY_RESULT:97,pm:98};olympe.dc.og=class{process(){}};olympe.dc.mm=class{constructor(...a){this.Wb=a}process(a,b,c){const d=this.Wb.length,e=(f,g,h)=>{g||f>=d?c(g,h):this.Wb[f].process(a,h,e.bind(null,f+1))};e(0,null,b)}};olympe.dc.mm.la=[olympe.dc.og];olympe.dc.Jc=class{constructor(a){this.tag='string'===typeof a?a:a.R()}R(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}qb(a){return a instanceof olympe.dc.Jc&&this.tag===a.tag}static nc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.Jc(b.tag)}};olympe.dc.Jc.la=[olympe.dc.ze];olympe.dc.Jc.prototype.toJSON.K=olympe.D.J.C;olympe.dc.Jc.prototype.qb.K=olympe.D.J.C;olympe.dc.pg=class{send(){}C(){}oa(){}};const xc=olympe.dc.Aa.ORIGIN,yc=olympe.dc.Aa.DESTINATION,zc=new Map,Ac=new Map,Bc=new Map,Cc=new Map;function Dc(a,b){var c=olympe.dm.File;let d=c;'function'===typeof c&&(d=b.entry);c=[...(d.Hn||[])];return olympe.dc.ya.C(a,b,...c)}function Ec(a,b){Cc.set(a,b);return a}function Fc(a){return(a=zc.get(a))&&a.C||olympe.dc.CloudObject}function Gc(a,b,c){const d=a+'@'+(b===yc?xc:yc);if(Ac.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Ac.set(d,c)}
390
- function Hc(a){a=a.R()+'@'+a.Pa();return Ac.get(a)||olympe.dc.CloudObject}function N(a,b){b.NAME=a;Bc.set(a,b)}function O(a){return a.NAME||null}
391
- olympe.dc.ya=class{constructor(){}static C(a,b,...c){if(zc.has(a))throw Error(`Tag: ${a} - overwriting already defined sync ${zc.get(a).C.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.T.zb(g):g}}b=new olympe.dc.ta.Entry(a,b,d);zc.set(a,b);return b.C.entry=b}static Tb(a){return(a=a.entry)&&a.R()||null}};olympe.dc.ta={};function P(a,b){b=b.Gc();Gc(b.R(),b.Pa(),a.C);return b}function Ic(a){a.F=!0;return a}
392
- olympe.dc.ta.Entry=class{constructor(a,b,c){this.tag=a;this.C=b;this.Hn=c||null;this.F=!1}R(){return this.tag}instantiate(a,b){const c=this.C;if(this.lj()&&b.getParameter(olympe.dc.Config.Go)){var d=olympe.dc.Oa();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.R()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ra.Xa('dc').error(d)}return this.Hn?(a=[void 0,a].concat(ma(b,this.Hn)),new c(...a)):new c(void 0,
393
- a)}va(a){return new olympe.dc.ta.Property(a)}Ha(a,b=olympe.dc.Aa.DESTINATION){Gc(a,b,this.C);return new olympe.dc.X.Sb(a,b)}lj(){return this.F}};z('olympe.dc.registry.Entry',olympe.dc.ta.Entry);olympe.dc.ta.Entry.prototype.addRelation=olympe.dc.ta.Entry.prototype.Ha;olympe.dc.ta.Entry.prototype.addProperty=olympe.dc.ta.Entry.prototype.va;olympe.dc.ta.Entry.la=[olympe.dc.ze];olympe.dc.ta.Property=class{constructor(a){this.tag=a}R(){return this.tag}};olympe.dc.ta.Property.prototype.getTag=olympe.dc.ta.Property.prototype.R;olympe.dc.ta.Property.la=[olympe.dc.ze];olympe.dc.ta.Relation=class{constructor(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.wa(a);this.direction=b;this.origin=c;this.destination=d}R(){return this.tag}Pa(){return this.direction}type(){return this.destination}Gc(){return new olympe.dc.ta.Relation(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION,this.destination,this.origin)}qb(a){return a instanceof olympe.dc.ta.Relation?a.R()===this.R()&&
394
- a.Pa()===this.Pa():!1}toString(){return this.direction+this.tag}};olympe.dc.ta.Relation.prototype.getInverse=olympe.dc.ta.Relation.prototype.Gc;olympe.dc.ta.Relation.prototype.getDirection=olympe.dc.ta.Relation.prototype.Pa;olympe.dc.ta.Relation.prototype.getTag=olympe.dc.ta.Relation.prototype.R;olympe.dc.ta.Relation.la=[olympe.dc.ze];olympe.dc.db={};function Jc(a,b,c,d,e,f=olympe.dc.Ga.rb){const g=c.Z();Kc(a.C,b,c,d,e,f);return h=>{if(h)a.C.push(g);else{h=a.C;const k=h.F.get(g);if(void 0!==k){const l=h.C.indexOf(g);h.C.splice(l,1);Lc(h,Mc(h,k.C,h.C.length),k.source);h.F.delete(g)}}}}function Nc(a,b){a.Ka.Sa(b)}function Oc(a,b,c){b&&a.Ka.wc(b);c&&a.Ka.Lc(c)}
395
- olympe.dc.db.Ws=class{constructor(a,b,c,d,e){this.N=a;this.Ka=b;this.C=new olympe.dc.db.Ls(a,b,d);this.view=new olympe.dc.ib(a,b);this.Lx=new olympe.dc.db.lu(this.N,this.view,b,e)}Xa(){return this.N}persist(a){this.Ka.Da();this.Ka.wb(a,olympe.dc.db.Instance.C.oq);this.Ka.oa()}$e(a,b){this.C.$e(a,b)}};const Pc=olympe.dc.$b.VERSION,Qc=olympe.dc.$b.Jd,Rc=olympe.dc.kc.Xc,Sc=olympe.dc.kc.xi;
396
- olympe.dc.db.Database=class a extends Map{constructor(b,c){super();this.id=olympe.W.fc();this.N=b;this.Lb=olympe.D.Ja();this.Ge=c.get('defaultSource')||olympe.dc.Ga.rb;this.U=olympe.dc.db.Database.F.IDLE;this.ja=new Map;this.Ib=[];this.G=[];this.ab=new Map;b=c.get('garbageCollector')||olympe.dc.db.Bi.C.Bl;new olympe.dc.db.Bi(this,b,this.Lb);c.get('debug')&&this.Rf()}Z(){return this.id}getState(){return this.U}Xa(){return this.N}create(b,c){const d=this.L(b,!0);d.ac(c&&parseInt(c.get(Pc),10)||1);d.ki(c&&
397
- c.get(Qc)||this.Ge);c&&(c.delete(Pc),c.delete(Qc),this.yd(d,c));this.C(a.C.xp,b)}update(b,c,d=!1){if(void 0!==c&&null!==c){b=this.L(b,!0);var e=c&&parseInt(c.get(Pc),10);0>e||!d&&b.version()>=e||(c.delete(Pc),b.ac(isNaN(e)?b.version()+1:e),this.yd(b,c))}}Mc(b){const c=this.get(b);void 0!==c&&(this.Ya(c,!1),this.C(a.C.yp,b))}link(b,c,d){c=this.L(c,!0);d=this.L(d,!0);switch(b){case Rc:c.Df(d);break;case Sc:c.Ge(d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==
398
- d)switch(b){case Rc:c.al(d);break;case Sc:c.gi(d);break;default:c.unlink(b,d)}}wc(b){for(const c of b)this.L(c).aa()}Lc(b){for(const c of b)(b=this.get(c))&&b.ja()}wb(b,c){b.forEach(d=>{this.L(d).Xe(c)})}ac(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.C(a.C.Fo,b))}L(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.C(a.C.Eo,b),c&&this.C(a.C.Dk,b));return d}Y(b,c,d=!1,e=null){return{[Symbol.iterator]:function*(f){const g=olympe.dm.Relation.C.Ck,
399
- h=olympe.dm.Relation.C.rk,k=olympe.dc.Aa.ORIGIN,l=olympe.dc.Aa.DESTINATION,n=a.cc.Kh+c,p=d?h:g,q=d?g:h,r=(new Map).set(f,!1),t=(v,w)=>(v=this.get(v))&&0!==(v.get(n)&w),u=([v,w])=>!r.has(v)&&(e?e(w):!0);for(const v of r.keys())r.get(v)||(r.set(v,!0),yield v),f=this.get(v),void 0!==f&&f.forEach((w,y)=>{(y[0]===k&&t(y.substring(1),q)||y[0]===l&&t(y.substring(1),p))&&Array.from(w.entries()).filter(u).forEach(([B])=>{r.set(B,!1)})})}.bind(this,b)}}ad(b){this.G[0].Re(olympe.W.yg(),b)}aa(b){if(0===this.G.length)debugger;
400
- this.G[0].C.delete(b)}C(b,c,...d){this.ja.has(b)&&this.ja.get(b).forEach(e=>{e(c,...d)})}Ya(b,c){this.ab.set(b,c)}Df(b,c,d,e){0<this.G.length&&Tc(this.G[0],b).va(e?Uc+c:c,d)}Ue(b,c,d,e,f){if(0<this.G.length){var g=this.G[0];d===Vc?f?Tc(g,b).link(c,e):Tc(g,b).unlink(c,e):f?Tc(g,b).ab(c,e):Tc(g,b).wb(c,e)}}F(b,c){let d=this.ja.get(b);void 0===d&&(d=[],this.ja.set(b,d));d.push(c)}Sa(b){this.Ib.push(b)}be(b){return this.G.reduce((c,d)=>d.G.has(b)||c,!1)}Da(){this.U===a.F.IDLE&&(this.U=a.F.As);this.G.unshift(new olympe.dc.db.at(this,
401
- this.Lb))}oa(){this.U=a.F.bg;this.Xe();Wc(this.G[0]);this.G.shift();0===this.G.length&&(this.U=a.F.IDLE,this.Ib.forEach(b=>{b()}))}yd(b,c){const d=a.cc.jc;for(const [e,f]of c)void 0!==f&&(e[0]===d?b.vn(e.substr(1),f):b.update(e,f))}Xe(){const b=a.cc.ORIGIN,c=new Set,d=(f,g=[])=>{const h=f.tag();if(!c.has(h)&&(c.add(h),g.push(f),f=f.get(b+Rc)))for(const k of f.values())d(k,g);return g},e=this.G[0];for(const [f,g]of this.ab)d(f).filter(h=>h.yd(g)).forEach(h=>{h=h.tag();g?Tc(e,h).create():Tc(e,h).delete()});
402
- this.ab.clear()}Rf(){const b=a.cc.DESTINATION,c=a.C.Dl,d=a.C.qk,e=new Set,f=new Map;this.F(a.C.xp,g=>{e.add(g)});this.F(c,g=>{e.delete(g);f.delete(g)});this.F(d,(g,...h)=>{if(h[0]===Sc&&h[1]===b){const k=h[2];this.get(k).Eb()||(h=f.get(k)||new Set,0===h.size&&f.set(k,h),h.add(g))}});this.Sa(()=>{e.forEach(g=>{const h=this.get(g);h&&null===h.model()&&this.N.error(`\n[DEBUG - DATABASE]\nInstance ${g} created but does not exist !\n${h.toString()}`)});e.clear();f.forEach((g,h)=>{const k=this.get(h);k&&
403
- this.N.error(`\n[DEBUG - DATABASE]\nThe model ${h} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(g.values()).join(', ')}`+`\n\n ${k.toString()}`)});f.clear()})}};olympe.dc.db.Database.cc={Kh:'$',tt:'~',jc:'?',ml:'=',eo:'@',ORIGIN:olympe.dc.Aa.ORIGIN,DESTINATION:olympe.dc.Aa.DESTINATION};olympe.dc.db.Database.C={Eo:0,Fo:1,hr:2,Dk:3,fo:4,ho:5,Dl:6,Hc:7,qk:8,rm:9,xp:10,yp:11,Aq:12};olympe.dc.db.Database.F={IDLE:0,As:1,bg:2};const Q=olympe.dc.db.Database.C,Xc=olympe.dc.db.Database.cc.Kh,Yc=olympe.dc.db.Database.cc.tt,Zc=olympe.dc.db.Database.cc.jc,$c=olympe.dc.db.Database.cc.ml,ad=olympe.dc.db.Database.cc.eo,R=olympe.dc.Aa.ORIGIN,T=olympe.dc.Aa.DESTINATION,bd=olympe.dc.kc.Xc,cd=olympe.dc.kc.xi;
404
- olympe.dc.db.Instance=class a extends Map{constructor(b,c){super();this.C=b;this.Lc=olympe.dc.Ga.rb;this.e=!1;this.Lb=0;this.F=void 0;this.c=0;this.Da=a.C.oq;this.db=c}tag(){return this.C}Eb(){return this.e}Ib(){return this.db.be(this.C)}source(){return this.Lc}version(){return this.Lb}model(){const b=this.get(T+bd);return b&&b.values().next().value||null}Cf(){const b=this.get(T+cd);return b&&b.values().next().value||null}persisted(){return this.Da!==a.C.sr}toString(){var b=this.fb(olympe.dc.CloudObject.nameProp.R());
405
- b=`Instance: ${this.C}, Exist: ${this.e}, Name: ${b}`;var c=this.model();if(c){var d=c.fb(olympe.dc.CloudObject.nameProp.R())||'No model name';b+=`\nModel: ${c.C}, Exist: ${c.e}, Model name: ${d}`}else b+='\nModel: no model';(c=this.Cf())?(d=c.fb(olympe.dc.CloudObject.nameProp.R())||'No extension name',b+=`\nExtension: ${c.C}, Exist: ${c.e}, Extension name: ${d}`):b+='\nExtension: no extension';return b}fb(b,c=!1){const d=this.get(Xc+b);return c||void 0!==d?d:this.get($c+b)}Sa(b,c=!1){const d=this.get(Zc+
406
- b);return c||void 0!==d?d:this.get(Yc+b)}update(b,c){const d=Xc+b;var e=this.get(d),f=e=void 0===e?null:e;(null!==f&&'function'===typeof f.qb?f.qb(c):f===c)||(e instanceof olympe.dc.Jc&&(this.db.get(e.R()).ad(),this.db.Mc(e.R())),c instanceof olympe.dc.Jc&&(e=this.db.L(c.R(),!0),e.F&&e.F.tag!==this.C&&this.db.Xa().fatal('Instance',c.R(),'referenced multiple times!\nThis instance is currently property of',e.F.tag,'(for the property '+e.F.kb+')','and is assigned as a property of',this.C,'(for the property '+
407
- b+')'),e.sh(this.C,b)),e=$c+b,null===c?(this.delete(d),c=(c=this.model())&&c.Sa(b),void 0!==c?(this.set(e,c),this.L(b,c,!0)):this.L(b,null,!1)):(this.set(d,c),this.delete(e),this.L(b,c,!1)))}vn(b,c){const d=Zc+b;var e=this.get(d);(void 0===e?null:e)!==c&&(e=Yc+b,null===c?(this.delete(d),c=(c=this.Cf())&&c.Sa(b),c=void 0===c?null:c,null!==c&&this.set(e,c),this.Y((new Map).set(b,c))):(void 0!==this.get(e)&&this.delete(e),this.set(d,c),this.Y((new Map).set(b,c))))}link(b,c){var d=R+b;const e=this.wb(T+
408
- b);d=c.wb(d);e.has(c.C)||(e.set(c.C,c),d.set(this.C,this),this.db.C(Q.qk,this.C,b,T,c.C),this.db.C(Q.qk,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,T,c,!0),c.G(b,R,this,!0)))}unlink(b,c){const d=R+b;void 0!==this.ab(T+b,c.C)&&(c.ab(d,this.C),this.db.C(Q.rm,this.C,b,T,c.C),this.db.C(Q.rm,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,T,c,!1),c.G(b,R,this,!1)))}Df(b){const c=this.model();if(null!==c){if(c===b)return;this.unlink(bd,c)}this.link(bd,b);b.forEach((d,e)=>{if(e[0]===Zc||e[0]===Yc)e=e.substring(1),this.Ya(e,
409
- d)});(b.e||b===this)&&this.db.Ya(this,!0)}al(b){this.unlink(bd,b);this.forEach((c,d)=>{c=d.substring(1);this.Ya(c,null)});this.db.Ya(this,!1)}Ge(b){const c=this.Cf();if(null!==c){if(c===b)return;this.unlink(cd,c)}this.link(cd,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===Zc||f[0]===Yc)f=f.substring(1),this.has(Zc+f)||(this.set(Yc+f,e),d.set(f,e))});this.Y(d)}gi(b){this.unlink(cd,b);const c=new Map;this.forEach((d,e)=>{e[0]===Yc&&(this.delete(e),d=e.substring(1),c.set(d,null))});this.Y(c)}wc(b,c,
410
- d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=this.db.get(f[g-1]))&&(h?g.aa():g.ja());d(...f)};this.Re(b,c,e);return e}Re(b,c,d){const e=this.wb(ad+b);e.has(c)||(e.set(c,d),this.aa(),this.db.C(Q.fo,this.C,b,c))}U(b,c){const d=this.ab(ad+b,c);void 0!==d&&(this.ja(),this.db.C(Q.ho,this.C,b,c));return d}ki(b){this.Lc=b}ac(b){this.Lb=b}Xe(b){this.Da=b;this.oa()||this.db.C(Q.Dk,this.C)}yd(b){const c=this.e!==b;c&&(b?(this.e=b,this.Rf()):(this.Ue(),this.e=b),this.be(b));return c}aa(){this.c++;1===
411
- this.c&&this.db.C(Q.hr,this.C)}ja(){0<this.c?--this.c:this.db.C(Q.Aq,this.C,`Try to decrease references on instance ${this.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.C(Q.Dk,this.C)}oa(){return 0<this.c||this.Da===olympe.dc.db.Instance.C.pq}clear(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===T){const e=c.substring(1),
412
- f=d===R?T:R;b.forEach(g=>{const h=g.get(f+e);h.delete(this.C);0===h.size&&g.delete(f+e)})}d===Xc&&b instanceof olympe.dc.Jc&&this.db.get(b.R()).ad()});void 0!==this.F&&this.db.get(this.F.tag).delete(Xc+this.F.kb)}sh(b,c){void 0===this.F&&this.aa();this.F={tag:b,kb:c}}ad(){void 0!==this.F&&(this.ja(),this.F=void 0)}Rf(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===T){const e=c.substring(1),f=d===R?T:R;b.forEach(g=>{g.e&&(this.G(e,d,g,!0),g.G(e,f,this,!0))})}else if(d===Xc||d===$c)c=c.substring(1),
413
- this.L(c,b,d===$c)})}Ue(){this.forEach((b,c)=>{const d=c[0];if(d!==ad){var e=c.substring(1);d===R?b.forEach(f=>{f.unlink(e,this)}):d===T?b.forEach(f=>{this.unlink(e,f)}):d===Xc&&this.update(e,null);this.delete(c)}});this.Lb=0;if(void 0!==this.F){const b=this.db.get(this.F.tag),c=b.get(Xc+this.F.kb);c&&c.R&&c.R()===this.C&&b.update(this.F.kb,null)}}be(b){this.db.C(b?Q.Dl:Q.Hc,this.C)}L(b,c,d){this.e&&this.db.Df(this.C,b,c,d)}G(b,c,d,e){this.db.Ue(this.C,b,c,d.C,e)}Y(b,c=[]){var d=this.get(R+bd);void 0!==
414
- d&&d.forEach(e=>{b.forEach((f,g)=>e.Ya(g,f))});d=this.get(R+cd);void 0!==d&&d.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(Zc+k)||(g.set(k,h),null!==h?e.set(Yc+k,h):e.delete(Yc+k))});e.Y(g,[...c,f])}})}Ya(b,c){if(!this.has(Xc+b)){const d=$c+b,e=this.get(d);c!==(void 0!==e?e:null)&&(null===c?this.delete(d):this.set(d,c),this.L(b,c,null!==c))}}wb(b){let c=this.get(b);void 0===c&&(c=new Map,this.set(b,c));return c}ab(b,c){const d=this.get(b);if(void 0!==d){const e=d.get(c);
415
- d.delete(c);0===d.size&&this.delete(b);return e}}};olympe.dc.db.Instance.C={sr:0,pq:1,oq:2};const Vc=olympe.dc.db.Database.cc.DESTINATION,Uc=olympe.dc.db.Database.cc.ml,dd=olympe.dc.db.Database.cc.Kh,ed=olympe.dc.db.Database.cc.eo,fd=olympe.dc.db.Database.cc.ORIGIN+Vc,gd=dd+dd;
416
- function Wc(a){const b=a.Ka;a.F.forEach((c,d)=>{const e=b.get(d);if(c.re()||c.L()){var f=e.get(ed);f&&hd(a,f,c.re(),d);c.L()&&a.G.add(d)}for(const [l,n]of c.kd()){var g=l[0]===Uc;d=a;var h=e;f=g?l.substr(1):l;var k=n;const p=h.get(ed+dd+f);p&&hd(d,p,k,g);(h=h.get(ed+gd))&&hd(d,h,f,k,g)}for(const l of c.Sa())id(a,e,...l)});a.F.clear();jd(a)}function Tc(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.jg(b),a.F.set(b,c));return c}
417
- function hd(a,b,...c){b.forEach((d,e)=>{a.Re(e,d.bind(null,...c))})}function id(a,b,c,d,e,f){const g=b.get(ed+d+c);g&&hd(a,g,f,e);(b=b.get(ed+fd))&&hd(a,b,c,d,f,e)}function jd(a){a.L.run(()=>{const b=a.C;for(const [d,e]of a.buffer){var c=b.get(d);(c=c&&c[e])&&c()}});a.C.clear();a.buffer.length=0}
418
- olympe.dc.db.at=class{constructor(a,b){this.Ka=a;this.L=b;this.F=new Map;this.G=new Set;this.C=new Map;this.buffer=[]}Re(a,b){let c=this.C.get(a);void 0===c&&(c=[],this.C.set(a,c));this.buffer.push([a,c.length]);c.push(b)}};function kd(a){const b=olympe.dc.db.Database.C.Fo,c=olympe.dc.db.Database.C.Dl,d=olympe.dc.db.Database.C.Hc,e=olympe.dc.db.Database.C.qk,f=olympe.dc.db.Database.C.rm,g=olympe.dc.db.Database.C.fo,h=olympe.dc.db.Database.C.ho,k=()=>{};a.Ka.F(olympe.dc.db.Database.C.Eo,()=>{});a.Ka.F(b,()=>{});a.Ka.F(c,l=>{a.Ka.ad(()=>{ld(a.view,l,k,`monitorRelations${l}`)})});a.Ka.F(d,l=>{a.Ka.ad(()=>{md(a.view,l,`monitorRelations${l}`)})});a.Ka.F(e,()=>{});a.Ka.F(f,()=>{});a.Ka.F(g,()=>{});a.Ka.F(h,()=>{})}
419
- olympe.dc.db.lu=class{constructor(a,b,c,d){this.N=a;this.view=b;this.Ka=c;d&&kd(this)}debug(a){const b=olympe.dc.wa(a);if(this.Ka.has(b)){var c=this.Ka.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Eb()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.Ka.get(d[d.length-1]);const e=olympe.dc.db.Database.cc.Kh+olympe.dc.CloudObject.nameProp.R();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
420
- d.join(' --M--\x3e ')}this.N.info(a)}else this.N.info('[DATABASE] Instance',b,'has never been created or referred by the database')}};olympe.dc.db.Bi=class a{constructor(b,c,d){this.N=b.Xa();this.Ka=b;this.F=new Set;this.mode=c;this.L=d;this.C=!1;c!==a.C.Bl&&this.U()}run(){if(!this.C)switch(this.mode){case a.C.ts:this.C=!0;this.L.run(()=>{Hb(()=>{this.G();this.C=!1},0)});break;case a.C.Uq:this.C=!0,this.G(),this.C=!1}}G(){const b=this.Ka,c=olympe.dc.Ub.tf,d=this.F,e=h=>b.get(h);var f=h=>!(h.persisted()||h.oa());for(var g of d){const h=b.get(g);if(h&&!h.oa()){if(!h.persisted())continue;Array.from(b.Y(g,c,!1,f)).forEach(k=>{d.add(k)});
421
- b.ac(g)}d.delete(g)}for(const h of d)f=Array.from(b.Y(h,c,!0)).map(e),g=Array.from(b.Y(h,c)).map(e),f.some(k=>k.oa())?g.filter(k=>!k.persisted()).forEach(k=>{d.delete(k.tag())}):f.concat(g).filter(k=>!k.persisted()).map(k=>k.tag()).forEach(k=>{d.delete(k);b.ac(k)});d.clear()}U(){this.Ka.Sa(this.run.bind(this));const b=olympe.dc.db.Database.C.hr,c=olympe.dc.db.Database.C.yp,d=olympe.dc.db.Database.C.Aq,e=olympe.dc.db.Database.F.IDLE,f=g=>{this.F.add(g);this.Ka.getState()===e&&this.run()};this.Ka.F(olympe.dc.db.Database.C.Dk,
422
- f.bind(this));this.Ka.F(c,f.bind(this));this.Ka.F(b,g=>{this.F.delete(g)});this.Ka.F(d,(g,...h)=>{this.N.error(h[0])})}};olympe.dc.db.Bi.C={Bl:0,Uq:1,ts:2};const nd=olympe.dc.db.Database.cc.ORIGIN,od=olympe.dc.db.Database.cc.DESTINATION,pd=olympe.dc.db.Database.cc.Kh,qd=olympe.dc.db.Database.cc.ml,rd=nd+od,sd=pd+pd,td=olympe.dc.db.Database.F;function tc(a,b,c,d){const e=a.Ka.L(olympe.dc.wa(b));d=d||ud(a);e.Re('',d,c);e.Eb()&&a.G.run(()=>{c(!0,b)});return d}function uc(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=e.U('',c);void 0!==f&&(a.Ka.getState()===td.bg&&a.Ka.aa(c),!d&&e.Eb()&&a.G.run(()=>{f(!1,b)}))}}
423
- function ld(a,b,c,d){const e=a.Ka.L(olympe.dc.wa(b));b=d||ud(a);const f=e.wc(rd,b,c);e.Eb()&&e.forEach((g,h)=>{g=h[0];g!==nd&&g!==od||vd(a,e,h,!0,f,!0)})}function md(a,b,c){const d=U(a,b);if(null!==d){const e=d.U(rd,c);void 0!==e&&(a.Ka.getState()!==td.bg||d.Ib()||a.Ka.aa(c),d.Eb()&&d.forEach((f,g)=>{f=g[0];(f===nd||f===od)&&e&&vd(a,d,g,!1,e,!0)}))}}function ud(a){++a.L;return String(a.L)}
424
- function wd(a,b,c,d,e){b=a.Ka.L(olympe.dc.wa(b));c=olympe.dc.wa(c);const f=pd+c;e=e||ud(a);b.Re(f,e,d);if(b.Eb()){let g=!1,h=b.get(f);void 0===h&&(g=!0,h=b.get(qd+c));if(void 0===h)return e;a.G.run(()=>{d(h,g)})}return e}function U(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.Ka.get(olympe.dc.wa(b));return!a||c&&!a.Eb()?null:a}
425
- function xd(a,b,c){b=a.Ka.L(olympe.dc.wa(b));const d=ud(a);b.Re(sd,d,c);b.Eb()&&b.forEach((e,f)=>{const g=f[0];g!==pd&&g!==qd||a.G.run(()=>{c(f.substr(1),e,g===qd)})});return d}function yd(a,b,c){b=U(a,b);null!==b&&(b.U(sd,c),a.Ka.getState()===td.bg&&a.Ka.aa(c))}function vd(a,b,c,d,e,f){(b=b.get(c))&&b.forEach((g,h)=>{g.Eb()&&(f?a.G.run(()=>{e(c.substr(1),c[0],d,h)}):a.G.run(()=>{e(d,h)}))})}
426
- function V(a,b,c,d,e){b=a.Ka.L(olympe.dc.wa(b));c=c.Pa()+c.R();e=e||ud(a);d=b.wc(c,e,d);b.Eb()&&vd(a,b,c,!0,d,!1);return e}function zd(a,b,c){return c===olympe.dc.Ub.NONE?0:a.fb(b,c,!0)||0}function Ad(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===nd||c===od){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}
427
- function Bd(a,b,c){if(!a.Eb(b))return a.N.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.wa(b)];for(const f of e){const g=a.tb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.N.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.wa(b)}`);return d}function Cd(a,b,c){return null!==a.Zm(c,olympe.dc.CloudObject.extendRel,d=>olympe.dc.Oa().$k(d,olympe.dc.CloudObject.propertyRel,b))}
428
- function Dd(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Eb()).length:0}
429
- olympe.dc.ib=class{constructor(a,b){this.N=a;this.G=new olympe.D.Xb('DB View context');this.Ka=b;this.L=0}Z(){return this.Ka.Z()}F(a,b,c){a=U(this,a);null!==a&&(b=olympe.dc.wa(b),a.U(pd+b,c),this.Ka.getState()===td.bg&&this.Ka.aa(c))}C(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Pa()+b.R();const e=a.U(b,c);void 0!==e&&(this.Ka.getState()!==td.bg||a.Ib()&&!d||this.Ka.aa(c),!d&&a.Eb()&&vd(this,a,b,!1,e,!1))}}Eb(a){a=U(this,a);return!(!a||!a.Eb())}name(a){return(a=U(this,a))?a.fb(olympe.dc.CloudObject.nameProp.R()):
430
- ''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Cf(a){return(a=(a=U(this,a,!0))&&a.Cf())?a.tag():null}mj(a){a=U(this,a,!0);return!(!a||!a.Cf())}qh(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Tf(a.tag(),b))}version(a){return(a=U(this,a,!0))&&a.version()}source(a){return(a=U(this,a,!0))&&a.source()}Wf(a){return(a=U(this,a,!1))?!!a.persisted():!0}fb(a,b,c){b=(a=U(this,a,!0))?a.fb(olympe.dc.wa(b),c):null;return void 0!==b?b:null}kd(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,
431
- e]of c)c=d[0],(c===pd||!b&&c===qd)&&a.set(d.substring(1),e);return a}tb(a,b){return this.ij(a,[b])}$k(a,b,c){return this.tb(a,b).includes(olympe.dc.wa(c))}ij(a,b){a=U(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=U(this,d,!0).get(c.Pa()+c.R()),void 0!==a)for(const e of a.values())e.Eb()&&b.push(e.tag());a=b}return a}hc(a,b){var c=U(this,a,!0);return c?(c=c.get(b.Pa()+b.R()))&&1<c.size?(this.N.warn(`Relation ${b.R()} to instance ${a} is not unique: found ${c.size} related items`),
432
- null):(a=c?c.values().next().value:null)&&a.Eb()?a.tag():null:null}Pf(a,b,c){a=olympe.dc.wa(a);const d=Bd(this,a,b);d.delete(a);return c?(c=olympe.dc.wa(c),d.has(c)?Array.from(Bd(this,c,b.Gc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Zm(a,b,c){if(!this.Eb(a))return null;b=Bd(this,a,b);const d=[olympe.dc.wa(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}$m(a,b,c){return this.ij(a,b).find(c)||null}bw(a,b,c){return this.ij(a,
433
- b).filter(c)}Tk(a,b=olympe.dc.CloudObject){var c=U(this,a,!0);const d=b&&U(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Cf();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Eb())throw a=`Try to get all extensions of the model ${olympe.dc.wa(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=U(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);
434
- return e.map(f=>f.tag())}Tf(a,b){const c=olympe.dc.wa(b);return!!this.Zm(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ee(a){return this.tb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.ib.prototype.getInstances=olympe.dc.ib.prototype.ee;olympe.dc.ib.prototype.isExtending=olympe.dc.ib.prototype.Tf;olympe.dc.ib.prototype.getExtendedModels=olympe.dc.ib.prototype.Tk;olympe.dc.ib.prototype.findAllRelated=olympe.dc.ib.prototype.bw;olympe.dc.ib.prototype.findRelated=olympe.dc.ib.prototype.$m;
435
- olympe.dc.ib.prototype.findRecursive=olympe.dc.ib.prototype.Zm;olympe.dc.ib.prototype.getRecursiveRelated=olympe.dc.ib.prototype.Pf;olympe.dc.ib.prototype.getUniqueRelated=olympe.dc.ib.prototype.hc;olympe.dc.ib.prototype.getMultiRelated=olympe.dc.ib.prototype.ij;olympe.dc.ib.prototype.isRelated=olympe.dc.ib.prototype.$k;olympe.dc.ib.prototype.getRelated=olympe.dc.ib.prototype.tb;olympe.dc.ib.prototype.getProperties=olympe.dc.ib.prototype.kd;olympe.dc.ib.prototype.getProperty=olympe.dc.ib.prototype.fb;
436
- olympe.dc.ib.prototype.isPersisted=olympe.dc.ib.prototype.Wf;olympe.dc.ib.prototype.instanceOf=olympe.dc.ib.prototype.qh;olympe.dc.ib.prototype.isModel=olympe.dc.ib.prototype.mj;olympe.dc.ib.prototype.extension=olympe.dc.ib.prototype.Cf;olympe.dc.ib.prototype.model=olympe.dc.ib.prototype.model;olympe.dc.ib.prototype.name=olympe.dc.ib.prototype.name;olympe.dc.ib.prototype.exist=olympe.dc.ib.prototype.Eb;function Ed(a,b){let c=a.C.get(b);void 0===c&&(c=new olympe.dc.db.jg(b),a.C.set(b,c));return c}function Fd(a,b,c=olympe.dc.Ub.NONE){b=Gd(a,b,c);for(const d of b)Hd(a,d,!1),a.C.delete(d)}
437
- function Gd(a,b,c,d=!0){const e=olympe.dm.Relation.C.rk,f=olympe.dm.Relation.C.Ck,g=olympe.dc.Aa.ORIGIN,h=olympe.dc.Oa();b=new Set([b]);const k=new Set;for(const n of b){var l=a.C.get(n);if(void 0!==l){for(const [p,q,r]of l.ld())r&&zd(h,p,c)&f?b.add(q):d||r||k.add(`${n}.${p}.${q}`);for(const [p,q,r]of l.Ya())r&&zd(h,p,c)&e?b.add(q):d||r||k.add(`${q}.${p}.${n}`)}for(const [p,q,r]of Ad(h,n))l=q===g?e:f,!k.has(q===g?`${r}.${p}.${n}`:`${n}.${p}.${r}`)&&zd(h,p,c)&l&&b.add(r)}return Array.from(b).filter(n=>
438
- a.C.has(n))}function Hd(a,b,c){const d=olympe.dc.Aa.ORIGIN,e=olympe.dc.Aa.DESTINATION,f=a.C.get(b);for(const [h,k,l]of f.ld())if(l||!c){f.U(h,e,k);var g=a.C.get(k);g&&g.U(h,d,b)}for(const [h,k,l]of f.Ya())if(l||!c)f.U(h,d,k),(g=a.C.get(k))&&g.U(h,e,b)}function*Id(a,b,c,d,e=[]){e.push(b);b=a.Lf(b);for(const [f,g]of b.tb(c))e.includes(f)||(yield*Id(a,f,c,d,e),yield d(f,g))}function Jd(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.U(b,olympe.dc.Aa.DESTINATION,d);a&&a.U(b,olympe.dc.Aa.ORIGIN,c)}
439
- olympe.dc.db.Ac=class{constructor(a){this.id=a||olympe.W.dj();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substr(0,a.length-2));return a+'}}'}static nc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.Ac(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.jg.nc(b[c]);a.C.set(c,d)}return a}Z(){return this.id}Qc(a){const b=
440
- olympe.dc.db.jg.C.$l,c=olympe.dc.db.jg.C.Hc,d=olympe.dc.db.jg.C.Ek;this.C.forEach((e,f)=>{const g=e.getState();switch(g.id){case b:a.F(f,e.Y()?e.kd():void 0);break;case d:e.Y()&&a.tc(f,e.kd(),g.aj);break;case c:a.Mc(f,g.aj)}for(const [h,k,l]of e.ld())l?a.Ra(h,f,k):a.ec(h,f,k)})}G(){let a=0;this.C.forEach(b=>{a+=b.Lb()});return a}F(a,b){a=Ed(this,a).create();b&&a.oa(b)}tc(a,b,c){b&&(a=Ed(this,a).oa(b),c&&a.Ib())}Mc(a,b=olympe.dc.Ub.NONE){const c=this.C.get(a);if(c&&c.re())Fd(this,a,b);else{Ed(this,
441
- a).delete(b);for(const d of Gd(this,a,b,!1))this.C.get(d).kd().clear(),Hd(this,d,!0)}}Ra(a,b,c){Ed(this,b).link(a,c);Ed(this,c).ab(a,b)}ec(a,b,c){Ed(this,b).unlink(a,c);Ed(this,c).wb(a,b)}ee(){return function*(a){for(const b of a.values())if(b.re()||b.L()||b.Y())yield b}(this.C)}Lf(a){return this.C.get(olympe.dc.wa(a))||null}ld(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.ld((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Pf(a,b,c=(d,e)=>[d,e]){return Id(this,
442
- a,b,c)}};olympe.dc.db.Ac.la=[olympe.dc.Writable,olympe.dc.lm];const Kd=new Map;
443
- olympe.dc.db.jg=class a{constructor(b){this.ja=b;this.G=a.F(a.C.Ek,!1);this.F=this.La=this.C=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.ja)+', "state": '+JSON.stringify(this.G);if(this.C){b+=', "properties": {';for(var c of this.C.keys()){const d=this.C.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);b+=', '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}if(this.La){b+=', "relations": {';for(const d of this.La.keys()){c=this.La.get(d);b+=JSON.stringify(d)+
444
- ': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}return b+'}'}static nc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.jg(c.tag);b.G=c.state;const d=c.properties;if(d){b.C=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.Jc.nc(f):h=olympe.D.nc(f));null!==h&&void 0!==h&&b.C.set(e,h)}}if(c=
445
- c.relations){b.La=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.La.set(f,e)}}return b}static F(b,c){const d=String(b)+','+String(c);let e=Kd.get(d);void 0===e&&(e={id:b,aj:c},Kd.set(d,e));return e}tag(){return this.ja}getState(){return this.G}create(){this.G=a.F(a.C.$l);return this}delete(b=olympe.dc.Ub.NONE){this.G=a.F(a.C.Hc,b);this.C=null;return this}Ib(){this.G.id===a.C.Ek&&(this.G=a.F(a.C.Ek,!0))}va(b,c){if(this.G.type===a.C.Hc)return this;
357
+ olympe.net.$j=class extends olympe.net.Hk{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.cb.$d.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.cb.ResponseType.Ak;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}jj(){return this.headers}C(){let a=Pb(this);a=a?`?${a}`:'';return Kb(this)?`${Mb(this)?'https':'http'}://${Kb(this)}:${this.port}/${Lb(this)}${a}`:`${Lb(this)}${a}`}toString(){return this.C()}};
358
+ olympe.net.$j.$d={jm:'POST',GET:'GET',st:'HEAD',nk:'PUT',Hc:'DELETE',em:'OPTIONS'};olympe.net.Ug=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Rd(){return this.status}jj(){return this.headers}};function Qb(a,b,c){const d=olympe.D.Ja(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.C(f=>{d.Ke(e);a.F().C.delete(b);c(f)})}olympe.net.sa=class{constructor(a){this.L=a;this.G=1;a='Initializing NET layer';this.L.G()&&(a+=' (implementation: '+this.U()+')');this.L.info(a);this.L.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}aa(){}C(){}N(){}U(){}};function Rb(a){return!(!a.client||!a.client.connected)}function Sb(a,b,c){a.connect();a.client.subscribe(b,void 0,d=>{d?a.L.error(`Failed to subscribe to topic ${b}: ${d}`):a.C.set(b,c)})}function Tb(a,b,c){a.connect();a.client.unsubscribe(b,void 0,c);a.C.delete(b)}function Ub(a,b){a.F.push(b)}function Vb(a,b){a.client.on(olympe.net.ke.C.zq,b)}function Wb(a,b){a.client.on(olympe.net.ke.C.Ih,b)}function Xb(a,b){a.client.on(olympe.net.ke.C.cc,b)}
359
+ olympe.net.ke=class{constructor(a,b){this.url=a;this.G=b||null;this.client=null;this.F=[];this.C=new Map;this.L=olympe.ra.Xa('MQTT')}connect(a){if(Rb(this))return a&&a(),this;a&&this.F.push(a);null===this.client&&(this.client=mqtt.connect(this.url,this.G),this.client.on(olympe.net.ke.C.lu,(b,c)=>{this.C.has(b)?this.C.get(b)(JSON.parse(c.toString())):this.L.warn('There is no subscriber for topic '+b)}),this.client.on(olympe.net.ke.C.Ks,()=>{this.F.forEach(b=>b())}),this.client.on(olympe.net.ke.C.zq,
360
+ ()=>{this.L.warn('Mqtt client is reconnecting to bus ... ')}),this.client.on(olympe.net.ke.C.cc,b=>{this.L.error('Mqtt client error ',b)}),this.client.on(olympe.net.ke.C.Ih,()=>{this.L.error('Mqtt client is offline')}),this.client.on(olympe.net.ke.C.Js,()=>{this.L.error('Mqtt client is closed')}),this.client.on(olympe.net.ke.C.at,()=>{this.L.error('Mqtt client has ended')}));return this}publish(a,b,c,d){this.connect();this.client.publish(a,JSON.stringify(b),c,e=>{d&&d(e);e&&this.L.error('Failed to publish a message '+
361
+ b)});return this}end(a,b){this.client&&this.client.end(a,{},()=>{b&&b();this.client=null});return this}};olympe.net.ke.C={Ks:'connect',zq:'reconnect',lu:'message',Js:'close',at:'end',cc:'error',Ih:'offline'};olympe.net.Gk=class{constructor(a){this.L=a}aa(){this.L.error('Try to set cors policies on a web server with the browser implementation.');return this}N(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Y(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};olympe.net.P={xa:'net.Manager',Ea:'net.Logger',Bm:'net.WebServer'};olympe.net.Config={Kl:'net.httpHost',Ll:'net.httpPort',mp:'net.httpSSL',kp:'net.httpBodyLimit'};
362
+ olympe.T.config(function(a){const b='object'===typeof window&&window.location&&window.location.hostname||'localhost',c='localhost'===b;D(a,olympe.net.Config.Kl,b);D(a,olympe.net.Config.Ll,c?3141:443);D(a,olympe.net.Config.mp,!c);D(a,olympe.net.Config.kp,100);sa(a,olympe.net.P.xa);C(a,olympe.net.P.Ea,[olympe.ra.P.xa],function(d){return d.Rc('net')});A(a,olympe.net.P.Bm,olympe.net.Gk,olympe.net.P.Ea)},'olympe.net');olympe.async={};function Yb(a,b){0<=b&&(a.timeout=b)}function Zb(a,b){a.N||a.Ld.push(a.G.C(b))}
363
+ olympe.async.Lo=class{constructor(a,b=void 0===a){this.C=[];this.Ld=[];this.G=a||new olympe.D.Xb('Async executor context');this.oa=b;this.F=null;this.env=new Map;this.env.set('Executor',this);this.N=this.U=!1;this.L=null;this.Y=this.timeout=0}Xa(){return this.L}add(a){this.N||this.C.push(this.G.C(a));return this}start(){this.U||(this.L&&this.L.log('Executor started.'),this.U=!0,0<this.timeout&&(this.Y=setTimeout(()=>{this.F='Timeout expired.';this.Y=0;this.complete(!1)},this.timeout)))}clear(){this.C=
364
+ [];this.Ld=[];this.env.clear();this.oa&&this.G.destroy()}complete(a){if(!this.N){this.N=!0;this.Y&&(clearTimeout(this.Y),this.Y=0);this.L&&this.L.log(a?'Executor completed successfully':`Executor completed with error: ${this.F}`);for(const b of this.Ld)b(a,a?null:this.F,this.env);this.clear()}}};
365
+ function $b(a){if(0<a.C.length){const b=a.C.shift();a.L&&a.L.log(`Executing next task. ${a.C.length} tasks left in the pipeline.`);a.G.run(()=>{b(()=>{Promise.resolve().then(()=>{$b(a)})},c=>{c&&(a.F=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.xk=class extends olympe.async.Lo{static create(){return new olympe.async.xk(new olympe.D.Xb('SequencedExecutor'),!0)}insert(a){this.N||this.C.unshift(a);return this}start(){this.U||(super.start(),$b(this))}};
366
+ olympe.async.og=class extends olympe.async.Lo{constructor(a,b){super(a,b);this.aa=0;this.ha=!0}static create(){return new olympe.async.og(new olympe.D.Xb('ParallelExecutor'),!0)}run(a){this.L&&this.L.log('Starting a task');this.G.run(()=>{a(()=>{this.done()},b=>{this.ha=!1;b&&(this.F=this.F?`${this.F}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.U&&!this.N&&(this.aa++,this.run(a));return this}done(){this.aa--;0>=this.aa&&this.complete(this.ha)}start(){if(!this.U)if(super.start(),0<
367
+ this.C.length){this.aa=this.C.length;for(const a of this.C)this.run(a)}else this.complete(!0)}};olympe.jc={};olympe.jc.au=class{constructor(){}set(){}get(){}forEach(){}remove(){}clear(){}close(){}};olympe.jc.$t=class{constructor(){}C(){}};olympe.jc.Storage=class{open(){}F(){}U(){}write(){}G(){}N(){}C(){}close(){}};function ac(a,b,c){a.storage.F(c)}function bc(a,b,c,d,e){a.storage.write(b,'transactions',c.toJSON(),'text/json',d,e)}function cc(a,b){a.storage.G(b)}function dc(a,b){a.storage.C(b)}function ec(a,b,c,d,e,f){a.storage.write(b,'files',c,d,()=>{e('files/'+b)},f)}function fc(a,b){a.storage.U(b)}olympe.jc.Ws=class{constructor(a){this.storage=a}};olympe.jc.P={ek:'localStorage.KeyValueManager',Si:'localStorage.Storage',uo:'localStorage.DatacloudStorage',Ea:'localStorage.Logger'};olympe.T.config(function(a){sa(a,olympe.jc.P.ek);C(a,olympe.jc.P.Ea,[olympe.ra.P.xa],function(b){return b.Rc('localstorage')});A(a,olympe.jc.P.uo,olympe.jc.Ws,olympe.jc.P.Si)},'olympe.localstorage');olympe.auth={};olympe.auth.Zu=class{U(){}N(){}Sa(){}aa(){}ji(){}ph(){}Vr(){}};function gc(a){a.L.info('Initializing AUTH layer');let b=a.ac;if(a.ha){const c=a.ha.C(),d=Fb(c.parameters);b=d||b;d&&a.ha.F(c.parameters.filter(e=>'authToken'!==e.ma()))}b&&a.storage&&hc(a.storage,b,c=>{!c&&a.L.error('Could not store authToken')});a.L.debug('Asking to be notified when auth connector gets online');a.F.U(()=>{if(a.Ya)if(a.N=olympe.auth.sa.G.vs,a.L.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),a.Y){const c=new olympe.auth.Request;c.set('username',
368
+ a.Y);c.Fn(a.ab);a.L.log('Autologin with user "'+a.Y+'"');ic(a,c)}else a.L.error('autoLogin: auto user not specified.'),jc(a);else a.N=olympe.auth.sa.G.Bk,a.L.log('Connector online, attempting to log with token'),kc(a)});a.F.N(()=>{switch(olympe.D.bb(a.G)){case olympe.auth.sa.C.Og:a.L.warn('Disconnected from server - session of user '+olympe.D.bb(a.C.Fb()).Sd()+' lost');break;case olympe.auth.sa.C.Bh:a.L.warn('Disconnected from server - guest session lost');break;case olympe.auth.sa.C.pi:a.L.warn('Disconnected from server - authentication aborted');
369
+ break;case olympe.auth.sa.C.INIT:a.L.warn('Cannot open auth session - no server connection');break;default:a.L.error('Should not get there, investigate')}lc(a,olympe.auth.sa.C.hg)});a.F.Sa((c,d)=>{if(c===olympe.auth.sa.F.Ej)a.L.info('Authentication revoked'),jc(a),a.storage&&mc(a.storage),a.oa.forEach(e=>{e(c,d)});else if(c===olympe.auth.sa.F.pp)a.L.info('Redirection to IDP to invalidate token (SAML)'),a.storage&&mc(a.storage),a.Sa.F();else throw Error(`Unknown logout step coming from server : ${c}`);
370
+ });a.L.log('DONE initializing AUTH layer (waiting for connector to be online)')}
371
+ function kc(a){null!==a.storage?(a.L.debug('Retrieving token from local storage'),a.storage.bd(b=>{if(b){const d=new olympe.auth.Request;var c=b.Sd();d.set('username',c);b=b.Nf();d.set('nonce',b);a.L.debug('Token found, trying login with',d);ic(a,d,a.Lb)}else a.L.debug('No token found, cannot perform auto login. Falling back in GUEST state'),jc(a)})):(a.L.error('Cannot retrieve token: no storage configured, cannot perform auto login. Falling back in GUEST state'),jc(a))}
372
+ function lc(a,b){a.L.log('State change: ',nc(a),'--\x3e',b);a.G.update(b)}function jc(a){a.C.update(a.Da);lc(a,olympe.auth.sa.C.Bh);a.L.info('Authenticated as guest')}function nc(a){return olympe.D.bb(a.G.Fb())}function oc(a){const b=olympe.auth.sa.C.Og,c=olympe.auth.sa.C.Bh,d=olympe.auth.sa.C.pi,e=olympe.D.Uc(olympe.D.qa,'auth.isOnline');olympe.D.Ec([a.G],f=>{f=olympe.D.Cc(f===b||f===c||f===d);const g=olympe.D.bb(e);void 0!==g&&g.qb(f)||e.update(f)},'Router is online');return e.Fb()}
373
+ function pc(a){var b=olympe.public.Ua.get(),c='logoutCallback';void 0===c&&(c=olympe.W.zg());b.oa.set(c,a)}function qc(a){return a.C.Fb().Nf()}function rc(a,b,c,d=!1){b=b+c?':'+c.message:'';a.L.error(b);a.error.update(olympe.D.Bb(b));lc(a,olympe.auth.sa.C.cc);if(d)throw Error(b);}
374
+ function ic(a,b,c,d){void 0===c&&(c=a.wb);void 0===c&&rc(a,'No authentication provider specified',null,!0);const e=a.Jb.get(c);e||rc(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.U.set('login',d);a.L.log('Sending authentication request using "'+c+'" for '+b);e.bd(b,a.Ib.bind(a));lc(a,olympe.auth.sa.C.pi)}function sc(a,b,c){a.U.forEach(d=>{d(b,c)})}
375
+ olympe.auth.sa=class{constructor(a,b,c,d,e,f,g,h,k,l,n,p){this.L=a;this.F=b;this.storage=c;this.Sa=d;this.ha=e;this.wb=g;this.Lb=h;this.Ya=void 0===k?!0:k;this.Y=l;this.ab=n;this.ac=p;this.Jb=new Map;this.G=olympe.D.Uc(String).update(olympe.auth.sa.C.INIT);this.error=olympe.D.Uc(olympe.D.Wa);this.N=null;this.Da=new olympe.auth.wf('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=olympe.D.Uc(olympe.auth.wf).update(this.Da);this.U=new Map;this.oa=new Map;f.forEach(q=>{const r=
376
+ q.ma();if(this.Jb.has(r))throw Error('Provider "'+r+'" has already been registered !');this.Jb.set(r,q)});gc(this)}getState(){return this.G.Fb()}aa(){return this.error.Fb()}Sd(){return this.C.Fb().Sd()}Eg(){return this.C.Fb().Eg()}di(){return this.C.Fb().di()}ph(a,b){this.F.ph(a,olympe.D.bb(qc(this)),b)}un(){this.L.debug('Sending logout');mc(this.storage);this.F.aa(a=>{a?rc(this,'Logout request rejected:',a):this.L.debug('Logout request acknowledged')})}ji(){nc(this)===olympe.auth.sa.C.Og&&this.F.ji(a=>
377
+ {a&&this.L.error('Was not able to send the auth keep alive message:',a.message)})}Ib(a,b){const c=null===this.N?olympe.auth.sa.G.iu:this.N;this.N=null;a?(this.L.warn('Authentication rejected: '+a.message+'. Falling back into GUEST state'),mc(this.storage),this.error.update(olympe.D.Bb(a.message)),jc(this),sc(this,a,c)):(this.L.info('User '+b.Sd()+' (#'+b.Eg()+') successfully authenticated'),this.C.update(b),lc(this,olympe.auth.sa.C.Og),sc(this,a,c),this.storage&&hc(this.storage,b));this.U.has('login')&&
378
+ this.U.delete('login')}};olympe.auth.sa.C={INIT:'init',hg:'disconnected',Bh:'guest',pi:'authenticating',cc:'error',Og:'authenticated'};olympe.auth.sa.G={iu:'manual',vs:'auto',Bk:'tokenOnFirstConnection'};olympe.auth.sa.F={Ej:'accepted',pp:'redirect'};olympe.auth.Pi=class{ma(){}bd(){}};olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.Ec([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.Af&&(a=a.Na.Kb);return a?a.valueOf():a}Sd(){return this.get('username')}Fn(a){this.set('password',a)}Nf(){return this.get('nonce')}toString(){return this.Sd()+(this.Nf()?' with nonce':'')+(this.get('password')?' with password':'')}};olympe.auth.wf=class{constructor(a,b,c,d={}){this.user=a;this.Dj=b;this.F=c;this.G=d}Sd(){return this.user}Eg(){return this.Dj}Nf(){return this.F}ck(){return this.G}di(){return null}ja(){var a=olympe.W,b=a.Dr;var c=JSON.stringify({user:this.user,userTag:this.Dj,nonce:this.F,payload:this.G});c=olympe.W.ci().C(Ca(c));return b.call(a,c)}};m=olympe.auth.wf.prototype;m.Sd.K=new olympe.D.J(()=>String,[]);m.Eg.K=new olympe.D.J(()=>String,[]);m.Nf.K=new olympe.D.J(()=>String,[]);
379
+ m.ck.K=new olympe.D.J(()=>Object,[]);m.di.K=new olympe.D.J(()=>String,[]);m.ja.K=new olympe.D.J(()=>String,[]);olympe.auth.hm=class extends olympe.auth.wf{constructor(a,b,c,d){super(a,b,c,d)}di(){return this.ck().access_token||null}};olympe.auth.Kq=class extends olympe.auth.wf{constructor(a,b,c,d){super(a,b,c,d);this.C=null}di(){return this.C}ja(){var a=olympe.W.ci(),b={user:this.Sd(),userTag:this.Eg(),nonce:this.Nf(),payload:this.ck(),fullToken:this.C},c=olympe.W,d=c.Dr;b=JSON.stringify(b);a=a.C(Ca(b));return d.call(c,a)}};function hc(a,b,c){const d=a.C.C('AUTH');d.set(a.key,'string'===typeof b?b:b.ja(),e=>{d.close();c&&c(e)})}function mc(a){const b=a.C.C('AUTH');b.remove(a.key,()=>b.close())}
380
+ olympe.auth.xm=class{constructor(a,b,c){this.C=a;this.L=b;this.key='OlympeToken-'+c.C}bd(a){const b=this.C.C('AUTH');this.L.debug(`olympe.auth.TokenStorage: retrieve token with key ${this.key}`);b.get(this.key,c=>{let d=null;if(c)try{this.L.debug('olympe.auth.TokenStorage: Token retrieved successfully');{var e=JSON,f=e.parse;var g=Da(olympe.W.ci().U(olympe.W.Hv(c)));const h=f.call(e,g);if(h.fullToken){const k=new olympe.auth.Kq(h.user,h.userTag,h.nonce,h.payload);k.C=h.fullToken;d=k}else d=h.payload&&
381
+ h.payload.id_token?new olympe.auth.hm(h.user,h.userTag,h.nonce,h.payload):new olympe.auth.wf(h.user,h.userTag,h.nonce,h.payload)}}catch(h){this.L.error('Error while unserializing token: ',h.message)}else this.L.debug('olympe.auth.TokenStorage: No token found');b.close();a(d)})}};olympe.auth.xm.F='OlympeToken';olympe.auth.xm.C='AUTH';olympe.auth.uk=class{redirect(){}F(){}C(){}};olympe.auth.uk.C={GET:'GET',jm:'POST'};olympe.auth.pl=class{constructor(a){this.C=a||'default'}};olympe.auth.Jb={};olympe.auth.Jb.pa={};olympe.auth.Jb.pa.Ki=class{Y(){}};olympe.auth.Jb.pa.Pe=class{ha(){}};olympe.auth.Jb.pa.Fe=class{oa(){}Da(){}};function tc(a,b){return olympe.W.mb(b+'-olympe-'+a.C[b])}olympe.auth.Jb.Ji=class{constructor(a){this.C=a}ma(){return'local'}bd(a,b){const c=a.Sd();if(c){const d=a.get('password'),e=a.Nf();a.C.delete('password');if(void 0!==e&&tc(this,c)===e){b(null,new olympe.auth.wf(c,'',tc(this,c)));return}a=olympe.W.mb(d||'');if(this.C[c]===a){b(null,new olympe.auth.wf(c,'',tc(this,c)));return}}b(Error('Invalid login'))}};olympe.auth.Jb.Ji.C='local';olympe.auth.Jb.Ji.la=[olympe.auth.Pi];olympe.auth.Jb.Ki=class{constructor(a,b){this.C=a;this.storage=b}ma(){return'localToken'}bd(a,b){this.storage.bd(c=>{this.C.Y(a,(d,e)=>{b(d,e||c)})})}};olympe.auth.Jb.Ki.C='localToken';olympe.auth.Jb.Ki.la=[olympe.auth.Pi];olympe.auth.Jb.gm=class{constructor(a,b){this.C=a;this.F=b}ma(){return'openID'}bd(){const a=this.C.C();this.C.redirect(`${this.F}/auth?url=${a}`,null,olympe.auth.uk.C.GET)}};olympe.auth.Jb.gm.C='openID';olympe.auth.Jb.gm.la=[olympe.auth.Pi];olympe.auth.Jb.Pe=class{constructor(a,b){this.F=a;this.C=b}ma(){return'saml'}bd(a,b){this.F.ha(c=>{c?b(c):this.C.F()})}};olympe.auth.Jb.Pe.C='saml';olympe.auth.Jb.Pe.la=[olympe.auth.Pi];olympe.auth.Jb.Fe=class{static ej(a,b){const c=new SRPClient,d=c.generateRandomSalt();return{username:a,login:a,salt:d,verifier:c.generateVerifier(d,a,b)}}constructor(a){this.C=a;this.L=olympe.ra.Xa('auth')}ma(){return'srp'}bd(a,b){const c=a.get('password');a.C.delete('password');this.L.debug('Sending SRP request');this.C.oa(a,(d,e,f)=>{this.L.debug('Received Salt+B message');if(d)b(d);else{try{const g=new SRPClient;g.step1(a.Sd(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g);
382
+ return}this.L.debug('Sending SRP A+M (proof) message');this.C.Da(a,b)}})}};olympe.auth.Jb.Fe.C='srp';olympe.auth.Jb.Fe.la=[olympe.auth.Pi];olympe.auth.P={xa:'auth.Manager',Ea:'auth.Logger',Si:'auth.Storage',Fj:'auth.appNameToken',qk:'auth.Redirector'};olympe.auth.sd={xa:'auth.ManagerConnector',Jp:'auth.LocalTokenConnector',Fe:'auth.SRPConnector',Pe:'auth.SAMLConnector'};olympe.auth.Config={Al:'auth.defaultProvider',Kp:'auth.localTokenProvider',On:'auth.autoLogin',Sn:'auth.autoUser',Pn:'auth.autoPassword',Bk:'auth.token',Mn:'auth.appToken'};
383
+ olympe.T.config(function(a){D(a,olympe.auth.Config.Al,'srp');D(a,olympe.auth.Config.Kp,'localToken');D(a,olympe.auth.Config.On,!1);D(a,olympe.auth.Config.Sn,'');D(a,olympe.auth.Config.Pn,'');D(a,olympe.auth.Config.Bk,'');D(a,olympe.auth.Config.Mn,'default');C(a,olympe.auth.P.Ea,[olympe.ra.P.xa],b=>b.Rc('auth'));A(a,olympe.auth.P.Fj,olympe.auth.pl,new olympe.T.fa(olympe.auth.Config.Mn));A(a,olympe.auth.P.Si,olympe.auth.xm,olympe.jc.P.ek,olympe.auth.P.Ea,olympe.auth.P.Fj);sa(a,olympe.auth.sd.xa);sa(a,
384
+ olympe.auth.P.qk);C(a,olympe.auth.P.xa,[olympe.auth.P.Ea,olympe.auth.sd.xa,olympe.host.P.Jl,new olympe.T.zb(olympe.auth.P.Si,olympe.T.hf.C.Hh),new olympe.T.fa(olympe.auth.Config.Al),new olympe.T.fa(olympe.auth.Config.Kp),new olympe.T.fa(olympe.auth.Config.On),new olympe.T.fa(olympe.auth.Config.Sn),new olympe.T.fa(olympe.auth.Config.Pn),new olympe.T.fa(olympe.auth.Config.Bk),new olympe.T.zb(olympe.auth.P.qk,olympe.T.hf.C.Hh),new olympe.T.zb(olympe.auth.sd.Jp,olympe.T.hf.C.Hh),new olympe.T.zb(olympe.auth.sd.Fe,
385
+ olympe.T.hf.C.Hh),new olympe.T.zb(olympe.auth.sd.Pe,olympe.T.hf.C.Hh)],(b,c,d,e,f,g,h,k,l,n,p,q,r,t)=>{const u=[];q&&u.push(new olympe.auth.Jb.Ki(q,e));r&&u.push(new olympe.auth.Jb.Fe(r));t&&p&&u.push(new olympe.auth.Jb.Pe(t,p));p&&c&&u.push(new olympe.auth.Jb.gm(p,c.Vr()));if(0===u.length)throw Error('At least one provider is needed for auth to start');if(!u.map(v=>v.ma()).includes(f))throw Error('Default provider name'+f+'given by parameter'+olympe.auth.Config.Al+'cannot be found');return new olympe.auth.sa(b,
386
+ c,e,p,d.qj()?d:null,u,f,g,h,k,l,n)},!0)},'olympe.auth');olympe.T.run([olympe.auth.P.xa],a=>{olympe.auth.Tc=()=>a});olympe.dc={};olympe.dc.Aa={ORIGIN:'<',DESTINATION:'>'};z('olympe.dc.Direction',olympe.dc.Aa);olympe.dc.lc={Xc:'ff022000000000000000',zi:'ff02200000000000000e',jo:'ff02200000000000000f'};olympe.dc.$b={VERSION:'@v',Jd:'@s'};olympe.dc.Vg={kc:'?'};olympe.dc.yk={cq:'online',Ih:'offline',yt:'invalidate'};olympe.dc.Ga={rb:'self',Pc:'server',lq:'peer',kc:'server'};olympe.dc.wa=function(a){if('string'===typeof a)return a;let b=null;a=olympe.D.bb(a);void 0!==a&&null!==a&&(a=a.valueOf(),'string'===typeof a?b=a:a.R?b=a.R():'function'===typeof a&&(b=olympe.dc.ya.Tb(a)));return b||''};z('olympe.dc.instanceToTag',olympe.dc.wa);olympe.dc.Oa=function(){return olympe.dc.Ad().view};olympe.dc.register=function(a,b){olympe.dc.ya.C(a,b)};olympe.dc.defineProperty=function(a){return new olympe.dc.ta.Property(a)};
387
+ olympe.dc.jh=function(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.Aa.DESTINATION){const e=olympe.dc.Aa.DESTINATION;return b===olympe.dc.Aa.ORIGIN||b===e?new olympe.dc.ta.Relation(a,b):new olympe.dc.ta.Relation(a,d,b,c)};olympe.dc.Uv=function(a){return a.Gc()};olympe.dc.Writable=class{F(){}uc(){}Mc(){}Ra(){}fc(){}};olympe.dc.lm=class{Qc(){}Z(){}G(){}};function uc(a,b,c,d,e,f,g){d=new olympe.dc.ga(olympe.dc.ga.ka.Sh,{file:b,url:null,content:c,Ze:e?h=>{vc(a,b,c);f(h)}:f,mimeType:d,te:g||null},[olympe.dc.Oa().source(b)||olympe.dc.Ga.Pc]);a.F.send(d)}function wc(a,b,c,d,e,f){c=c instanceof olympe.D.Wa?c.valueOf():c;'string'===typeof c?c=new Blob([Ca(c)],{type:d}):c instanceof ArrayBuffer&&(c=new Blob([c],{type:d}));uc(a,b,c,d,a.G,e,f)}
388
+ function vc(a,b,c){const d=olympe.dc.wa(b);a.C.set(d,c);const e=olympe.W.zg();xc(olympe.dc.Oa(),d,f=>{f||(a.C.delete(d),yc(olympe.dc.Oa(),d,e))},e)}function zc(a,b,c,d){olympe.D.hs([b.bs(),b.R(),b.Sl(),b.fn()],(e,f,g,h)=>{a.C.has(f)?c(a.C.get(f)):(e=new olympe.dc.ga(olympe.dc.ga.ka.yh,{file:f,url:e.valueOf()?null:g,mimeType:h.valueOf(),Ze:a.G?k=>{vc(a,f,k);c(k)}:c,te:d},[olympe.dc.Oa().source(f)||olympe.dc.Ga.Pc]),a.F.send(e))})}
389
+ olympe.dc.lt=class{constructor(a,b,c,d,e){this.L=a;this.F=c;this.G=e;this.C=new Map}};olympe.dc.sa=class{constructor(a){this.L=a}};function Ac(a,b){a.F=b;return a}function M(a,b){a.Xh.unshift(b);return a}olympe.dc.ga=class{constructor(a,b,c){this.type=a;this.content=b;this.C=c;this.Xh=[];this.F=olympe.D.Ja()}validate(a=null){this.Xh.forEach(b=>{b(a||null)})}toString(){const a=olympe.W.Tr(olympe.dc.ga.ka,this.type);return a?a:'UNKNOWN_MESSAGE'}};
390
+ olympe.dc.ga.ka={cc:1,mg:2,Tg:10,cA:11,Uu:20,kB:21,lB:22,Wu:23,Ci:24,Bi:25,dA:26,Zo:28,om:30,qm:31,Du:32,fh:40,Ck:41,xh:45,Kj:46,Uj:47,Sh:50,yh:51,yi:52,mv:60,Ju:61,nt:62,ot:63,Hs:64,tl:65,bA:90,zl:91,Il:92,$o:93,Fp:94,ik:95,Vu:96,QUERY_RESULT:97,pm:98};olympe.dc.pg=class{process(){}};olympe.dc.mm=class{constructor(...a){this.Wb=a}process(a,b,c){const d=this.Wb.length,e=(f,g,h)=>{g||f>=d?c(g,h):this.Wb[f].process(a,h,e.bind(null,f+1))};e(0,null,b)}};olympe.dc.mm.la=[olympe.dc.pg];olympe.dc.Jc=class{constructor(a){this.tag='string'===typeof a?a:a.R()}R(){return this.tag}toJSON(){return'{ "type": "reference", "tag": '+JSON.stringify(this.tag)+' }'}qb(a){return a instanceof olympe.dc.Jc&&this.tag===a.tag}static oc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.Jc(b.tag)}};olympe.dc.Jc.la=[olympe.dc.Ae];olympe.dc.Jc.prototype.toJSON.K=olympe.D.J.C;olympe.dc.Jc.prototype.qb.K=olympe.D.J.C;olympe.dc.qg=class{send(){}C(){}oa(){}};const Bc=olympe.dc.Aa.ORIGIN,Cc=olympe.dc.Aa.DESTINATION,Dc=new Map,Ec=new Map,Fc=new Map,Gc=new Map;function Hc(a,b){var c=olympe.dm.File;let d=c;'function'===typeof c&&(d=b.entry);c=[...(d.Hn||[])];return olympe.dc.ya.C(a,b,...c)}function Ic(a,b){Gc.set(a,b);return a}function Jc(a){return(a=Dc.get(a))&&a.C||olympe.dc.CloudObject}function Kc(a,b,c){const d=a+'@'+(b===Cc?Bc:Cc);if(Ec.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Ec.set(d,c)}
391
+ function Lc(a){a=a.R()+'@'+a.Pa();return Ec.get(a)||olympe.dc.CloudObject}function N(a,b){b.NAME=a;Fc.set(a,b)}function O(a){return a.NAME||null}
392
+ olympe.dc.ya=class{constructor(){}static C(a,b,...c){if(Dc.has(a))throw Error(`Tag: ${a} - overwriting already defined sync ${Dc.get(a).C.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.T.zb(g):g}}b=new olympe.dc.ta.Entry(a,b,d);Dc.set(a,b);return b.C.entry=b}static Tb(a){return(a=a.entry)&&a.R()||null}};olympe.dc.ta={};function P(a,b){b=b.Gc();Kc(b.R(),b.Pa(),a.C);return b}function Mc(a){a.F=!0;return a}
393
+ olympe.dc.ta.Entry=class{constructor(a,b,c){this.tag=a;this.C=b;this.Hn=c||null;this.F=!1}R(){return this.tag}instantiate(a,b){const c=this.C;if(this.nj()&&b.getParameter(olympe.dc.Config.Go)){var d=olympe.dc.Oa();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.R()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ra.Xa('dc').error(d)}return this.Hn?(a=[void 0,a].concat(ma(b,this.Hn)),new c(...a)):new c(void 0,
394
+ a)}va(a){return new olympe.dc.ta.Property(a)}Ha(a,b=olympe.dc.Aa.DESTINATION){Kc(a,b,this.C);return new olympe.dc.X.Sb(a,b)}nj(){return this.F}};z('olympe.dc.registry.Entry',olympe.dc.ta.Entry);olympe.dc.ta.Entry.prototype.addRelation=olympe.dc.ta.Entry.prototype.Ha;olympe.dc.ta.Entry.prototype.addProperty=olympe.dc.ta.Entry.prototype.va;olympe.dc.ta.Entry.la=[olympe.dc.Ae];olympe.dc.ta.Property=class{constructor(a){this.tag=a}R(){return this.tag}};olympe.dc.ta.Property.prototype.getTag=olympe.dc.ta.Property.prototype.R;olympe.dc.ta.Property.la=[olympe.dc.Ae];olympe.dc.ta.Relation=class{constructor(a,b=olympe.dc.Aa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.wa(a);this.direction=b;this.origin=c;this.destination=d}R(){return this.tag}Pa(){return this.direction}type(){return this.destination}Gc(){return new olympe.dc.ta.Relation(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION,this.destination,this.origin)}qb(a){return a instanceof olympe.dc.ta.Relation?a.R()===this.R()&&
395
+ a.Pa()===this.Pa():!1}toString(){return this.direction+this.tag}};olympe.dc.ta.Relation.prototype.getInverse=olympe.dc.ta.Relation.prototype.Gc;olympe.dc.ta.Relation.prototype.getDirection=olympe.dc.ta.Relation.prototype.Pa;olympe.dc.ta.Relation.prototype.getTag=olympe.dc.ta.Relation.prototype.R;olympe.dc.ta.Relation.la=[olympe.dc.Ae];olympe.dc.db={};function Nc(a,b,c,d,e,f=olympe.dc.Ga.rb){const g=c.Z();Oc(a.C,b,c,d,e,f);return h=>{if(h)a.C.push(g);else{h=a.C;const k=h.F.get(g);if(void 0!==k){const l=h.C.indexOf(g);h.C.splice(l,1);Pc(h,Qc(h,k.C,h.C.length),k.source);h.F.delete(g)}}}}function Rc(a,b){a.Ka.Sa(b)}function Sc(a,b,c){b&&a.Ka.wc(b);c&&a.Ka.Lc(c)}
396
+ olympe.dc.db.Ys=class{constructor(a,b,c,d,e){this.L=a;this.Ka=b;this.C=new olympe.dc.db.Ns(a,b,d);this.view=new olympe.dc.ib(a,b);this.Ox=new olympe.dc.db.ou(this.L,this.view,b,e)}Xa(){return this.L}persist(a){this.Ka.Da();this.Ka.wb(a,olympe.dc.db.Instance.C.oq);this.Ka.oa()}af(a,b){this.C.af(a,b)}};const Tc=olympe.dc.$b.VERSION,Uc=olympe.dc.$b.Jd,Vc=olympe.dc.lc.Xc,Wc=olympe.dc.lc.zi;
397
+ olympe.dc.db.Database=class a extends Map{constructor(b,c){super();this.id=olympe.W.hc();this.L=b;this.Lb=olympe.D.Ja();this.He=c.get('defaultSource')||olympe.dc.Ga.rb;this.U=olympe.dc.db.Database.F.IDLE;this.ha=new Map;this.Ib=[];this.G=[];this.ab=new Map;b=c.get('garbageCollector')||olympe.dc.db.Di.C.Cl;new olympe.dc.db.Di(this,b,this.Lb);c.get('debug')&&this.Sf()}Z(){return this.id}getState(){return this.U}Xa(){return this.L}create(b,c){const d=this.N(b,!0);d.ac(c&&parseInt(c.get(Tc),10)||1);d.mi(c&&
398
+ c.get(Uc)||this.He);c&&(c.delete(Tc),c.delete(Uc),this.yd(d,c));this.C(a.C.xp,b)}update(b,c,d=!1){if(void 0!==c&&null!==c){b=this.N(b,!0);var e=c&&parseInt(c.get(Tc),10);0>e||!d&&b.version()>=e||(c.delete(Tc),b.ac(isNaN(e)?b.version()+1:e),this.yd(b,c))}}Mc(b){const c=this.get(b);void 0!==c&&(this.Ya(c,!1),this.C(a.C.yp,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case Vc:c.Ef(d);break;case Wc:c.He(d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==
399
+ d)switch(b){case Vc:c.bl(d);break;case Wc:c.ii(d);break;default:c.unlink(b,d)}}wc(b){for(const c of b)this.N(c).aa()}Lc(b){for(const c of b)(b=this.get(c))&&b.ha()}wb(b,c){b.forEach(d=>{this.N(d).Ye(c)})}ac(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.C(a.C.Fo,b))}N(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.C(a.C.Eo,b),c&&this.C(a.C.Ek,b));return d}Y(b,c,d=!1,e=null){return{[Symbol.iterator]:function*(f){const g=olympe.dm.Relation.C.Dk,
400
+ h=olympe.dm.Relation.C.sk,k=olympe.dc.Aa.ORIGIN,l=olympe.dc.Aa.DESTINATION,n=a.ec.Mh+c,p=d?h:g,q=d?g:h,r=(new Map).set(f,!1),t=(v,w)=>(v=this.get(v))&&0!==(v.get(n)&w),u=([v,w])=>!r.has(v)&&(e?e(w):!0);for(const v of r.keys())r.get(v)||(r.set(v,!0),yield v),f=this.get(v),void 0!==f&&f.forEach((w,y)=>{(y[0]===k&&t(y.substring(1),q)||y[0]===l&&t(y.substring(1),p))&&Array.from(w.entries()).filter(u).forEach(([B])=>{r.set(B,!1)})})}.bind(this,b)}}ad(b){this.G[0].Se(olympe.W.zg(),b)}aa(b){if(0===this.G.length)debugger;
401
+ this.G[0].C.delete(b)}C(b,c,...d){this.ha.has(b)&&this.ha.get(b).forEach(e=>{e(c,...d)})}Ya(b,c){this.ab.set(b,c)}Ef(b,c,d,e){0<this.G.length&&Xc(this.G[0],b).va(e?Yc+c:c,d)}Ve(b,c,d,e,f){if(0<this.G.length){var g=this.G[0];d===Zc?f?Xc(g,b).link(c,e):Xc(g,b).unlink(c,e):f?Xc(g,b).ab(c,e):Xc(g,b).wb(c,e)}}F(b,c){let d=this.ha.get(b);void 0===d&&(d=[],this.ha.set(b,d));d.push(c)}Sa(b){this.Ib.push(b)}be(b){return this.G.reduce((c,d)=>d.G.has(b)||c,!1)}Da(){this.U===a.F.IDLE&&(this.U=a.F.Bs);this.G.unshift(new olympe.dc.db.dt(this,
402
+ this.Lb))}oa(){this.U=a.F.cg;this.Ye();$c(this.G[0]);this.G.shift();0===this.G.length&&(this.U=a.F.IDLE,this.Ib.forEach(b=>{b()}))}yd(b,c){const d=a.ec.kc;for(const [e,f]of c)void 0!==f&&(e[0]===d?b.vn(e.substr(1),f):b.update(e,f))}Ye(){const b=a.ec.ORIGIN,c=new Set,d=(f,g=[])=>{const h=f.tag();if(!c.has(h)&&(c.add(h),g.push(f),f=f.get(b+Vc)))for(const k of f.values())d(k,g);return g},e=this.G[0];for(const [f,g]of this.ab)d(f).filter(h=>h.yd(g)).forEach(h=>{h=h.tag();g?Xc(e,h).create():Xc(e,h).delete()});
403
+ this.ab.clear()}Sf(){const b=a.ec.DESTINATION,c=a.C.El,d=a.C.rk,e=new Set,f=new Map;this.F(a.C.xp,g=>{e.add(g)});this.F(c,g=>{e.delete(g);f.delete(g)});this.F(d,(g,...h)=>{if(h[0]===Wc&&h[1]===b){const k=h[2];this.get(k).Eb()||(h=f.get(k)||new Set,0===h.size&&f.set(k,h),h.add(g))}});this.Sa(()=>{e.forEach(g=>{const h=this.get(g);h&&null===h.model()&&this.L.error(`\n[DEBUG - DATABASE]\nInstance ${g} created but does not exist !\n${h.toString()}`)});e.clear();f.forEach((g,h)=>{const k=this.get(h);k&&
404
+ this.L.error(`\n[DEBUG - DATABASE]\nThe model ${h} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(g.values()).join(', ')}`+`\n\n ${k.toString()}`)});f.clear()})}};olympe.dc.db.Database.ec={Mh:'$',wt:'~',kc:'?',nl:'=',eo:'@',ORIGIN:olympe.dc.Aa.ORIGIN,DESTINATION:olympe.dc.Aa.DESTINATION};olympe.dc.db.Database.C={Eo:0,Fo:1,ir:2,Ek:3,fo:4,ho:5,El:6,Hc:7,rk:8,rm:9,xp:10,yp:11,Bq:12};olympe.dc.db.Database.F={IDLE:0,Bs:1,cg:2};const Q=olympe.dc.db.Database.C,ad=olympe.dc.db.Database.ec.Mh,bd=olympe.dc.db.Database.ec.wt,cd=olympe.dc.db.Database.ec.kc,dd=olympe.dc.db.Database.ec.nl,ed=olympe.dc.db.Database.ec.eo,R=olympe.dc.Aa.ORIGIN,T=olympe.dc.Aa.DESTINATION,fd=olympe.dc.lc.Xc,gd=olympe.dc.lc.zi;
405
+ olympe.dc.db.Instance=class a extends Map{constructor(b,c){super();this.C=b;this.Lc=olympe.dc.Ga.rb;this.e=!1;this.Lb=0;this.F=void 0;this.c=0;this.Da=a.C.oq;this.db=c}tag(){return this.C}Eb(){return this.e}Ib(){return this.db.be(this.C)}source(){return this.Lc}version(){return this.Lb}model(){const b=this.get(T+fd);return b&&b.values().next().value||null}Df(){const b=this.get(T+gd);return b&&b.values().next().value||null}persisted(){return this.Da!==a.C.tr}toString(){var b=this.fb(olympe.dc.CloudObject.nameProp.R());
406
+ b=`Instance: ${this.C}, Exist: ${this.e}, Name: ${b}`;var c=this.model();if(c){var d=c.fb(olympe.dc.CloudObject.nameProp.R())||'No model name';b+=`\nModel: ${c.C}, Exist: ${c.e}, Model name: ${d}`}else b+='\nModel: no model';(c=this.Df())?(d=c.fb(olympe.dc.CloudObject.nameProp.R())||'No extension name',b+=`\nExtension: ${c.C}, Exist: ${c.e}, Extension name: ${d}`):b+='\nExtension: no extension';return b}fb(b,c=!1){const d=this.get(ad+b);return c||void 0!==d?d:this.get(dd+b)}Sa(b,c=!1){const d=this.get(cd+
407
+ b);return c||void 0!==d?d:this.get(bd+b)}update(b,c){const d=ad+b;var e=this.get(d),f=e=void 0===e?null:e;(null!==f&&'function'===typeof f.qb?f.qb(c):f===c)||(e instanceof olympe.dc.Jc&&(this.db.get(e.R()).ad(),this.db.Mc(e.R())),c instanceof olympe.dc.Jc&&(e=this.db.N(c.R(),!0),e.F&&e.F.tag!==this.C&&this.db.Xa().fatal('Instance',c.R(),'referenced multiple times!\nThis instance is currently property of',e.F.tag,'(for the property '+e.F.kb+')','and is assigned as a property of',this.C,'(for the property '+
408
+ b+')'),e.th(this.C,b)),e=dd+b,null===c?(this.delete(d),c=(c=this.model())&&c.Sa(b),void 0!==c?(this.set(e,c),this.N(b,c,!0)):this.N(b,null,!1)):(this.set(d,c),this.delete(e),this.N(b,c,!1)))}vn(b,c){const d=cd+b;var e=this.get(d);(void 0===e?null:e)!==c&&(e=bd+b,null===c?(this.delete(d),c=(c=this.Df())&&c.Sa(b),c=void 0===c?null:c,null!==c&&this.set(e,c),this.Y((new Map).set(b,c))):(void 0!==this.get(e)&&this.delete(e),this.set(d,c),this.Y((new Map).set(b,c))))}link(b,c){var d=R+b;const e=this.wb(T+
409
+ b);d=c.wb(d);e.has(c.C)||(e.set(c.C,c),d.set(this.C,this),this.db.C(Q.rk,this.C,b,T,c.C),this.db.C(Q.rk,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,T,c,!0),c.G(b,R,this,!0)))}unlink(b,c){const d=R+b;void 0!==this.ab(T+b,c.C)&&(c.ab(d,this.C),this.db.C(Q.rm,this.C,b,T,c.C),this.db.C(Q.rm,c.C,b,R,this.C),this.e&&c.e&&(this.G(b,T,c,!1),c.G(b,R,this,!1)))}Ef(b){const c=this.model();if(null!==c){if(c===b)return;this.unlink(fd,c)}this.link(fd,b);b.forEach((d,e)=>{if(e[0]===cd||e[0]===bd)e=e.substring(1),this.Ya(e,
410
+ d)});(b.e||b===this)&&this.db.Ya(this,!0)}bl(b){this.unlink(fd,b);this.forEach((c,d)=>{c=d.substring(1);this.Ya(c,null)});this.db.Ya(this,!1)}He(b){const c=this.Df();if(null!==c){if(c===b)return;this.unlink(gd,c)}this.link(gd,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===cd||f[0]===bd)f=f.substring(1),this.has(cd+f)||(this.set(bd+f,e),d.set(f,e))});this.Y(d)}ii(b){this.unlink(gd,b);const c=new Map;this.forEach((d,e)=>{e[0]===bd&&(this.delete(e),d=e.substring(1),c.set(d,null))});this.Y(c)}wc(b,c,
411
+ d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=this.db.get(f[g-1]))&&(h?g.aa():g.ha());d(...f)};this.Se(b,c,e);return e}Se(b,c,d){const e=this.wb(ed+b);e.has(c)||(e.set(c,d),this.aa(),this.db.C(Q.fo,this.C,b,c))}U(b,c){const d=this.ab(ed+b,c);void 0!==d&&(this.ha(),this.db.C(Q.ho,this.C,b,c));return d}mi(b){this.Lc=b}ac(b){this.Lb=b}Ye(b){this.Da=b;this.oa()||this.db.C(Q.Ek,this.C)}yd(b){const c=this.e!==b;c&&(b?(this.e=b,this.Sf()):(this.Ve(),this.e=b),this.be(b));return c}aa(){this.c++;1===
412
+ this.c&&this.db.C(Q.ir,this.C)}ha(){0<this.c?--this.c:this.db.C(Q.Bq,this.C,`Try to decrease references on instance ${this.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===this.c&&this.db.C(Q.Ek,this.C)}oa(){return 0<this.c||this.Da===olympe.dc.db.Instance.C.pq}clear(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===T){const e=c.substring(1),
413
+ f=d===R?T:R;b.forEach(g=>{const h=g.get(f+e);h.delete(this.C);0===h.size&&g.delete(f+e)})}d===ad&&b instanceof olympe.dc.Jc&&this.db.get(b.R()).ad()});void 0!==this.F&&this.db.get(this.F.tag).delete(ad+this.F.kb)}th(b,c){void 0===this.F&&this.aa();this.F={tag:b,kb:c}}ad(){void 0!==this.F&&(this.ha(),this.F=void 0)}Sf(){this.forEach((b,c)=>{const d=c[0];if(d===R||d===T){const e=c.substring(1),f=d===R?T:R;b.forEach(g=>{g.e&&(this.G(e,d,g,!0),g.G(e,f,this,!0))})}else if(d===ad||d===dd)c=c.substring(1),
414
+ this.N(c,b,d===dd)})}Ve(){this.forEach((b,c)=>{const d=c[0];if(d!==ed){var e=c.substring(1);d===R?b.forEach(f=>{f.unlink(e,this)}):d===T?b.forEach(f=>{this.unlink(e,f)}):d===ad&&this.update(e,null);this.delete(c)}});this.Lb=0;if(void 0!==this.F){const b=this.db.get(this.F.tag),c=b.get(ad+this.F.kb);c&&c.R&&c.R()===this.C&&b.update(this.F.kb,null)}}be(b){this.db.C(b?Q.El:Q.Hc,this.C)}N(b,c,d){this.e&&this.db.Ef(this.C,b,c,d)}G(b,c,d,e){this.db.Ve(this.C,b,c,d.C,e)}Y(b,c=[]){var d=this.get(R+fd);void 0!==
415
+ d&&d.forEach(e=>{b.forEach((f,g)=>e.Ya(g,f))});d=this.get(R+gd);void 0!==d&&d.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(cd+k)||(g.set(k,h),null!==h?e.set(bd+k,h):e.delete(bd+k))});e.Y(g,[...c,f])}})}Ya(b,c){if(!this.has(ad+b)){const d=dd+b,e=this.get(d);c!==(void 0!==e?e:null)&&(null===c?this.delete(d):this.set(d,c),this.N(b,c,null!==c))}}wb(b){let c=this.get(b);void 0===c&&(c=new Map,this.set(b,c));return c}ab(b,c){const d=this.get(b);if(void 0!==d){const e=d.get(c);
416
+ d.delete(c);0===d.size&&this.delete(b);return e}}};olympe.dc.db.Instance.C={tr:0,pq:1,oq:2};const Zc=olympe.dc.db.Database.ec.DESTINATION,Yc=olympe.dc.db.Database.ec.nl,hd=olympe.dc.db.Database.ec.Mh,id=olympe.dc.db.Database.ec.eo,jd=olympe.dc.db.Database.ec.ORIGIN+Zc,kd=hd+hd;
417
+ function $c(a){const b=a.Ka;a.F.forEach((c,d)=>{const e=b.get(d);if(c.se()||c.N()){var f=e.get(id);f&&ld(a,f,c.se(),d);c.N()&&a.G.add(d)}for(const [l,n]of c.kd()){var g=l[0]===Yc;d=a;var h=e;f=g?l.substr(1):l;var k=n;const p=h.get(id+hd+f);p&&ld(d,p,k,g);(h=h.get(id+kd))&&ld(d,h,f,k,g)}for(const l of c.Sa())md(a,e,...l)});a.F.clear();nd(a)}function Xc(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.kg(b),a.F.set(b,c));return c}
418
+ function ld(a,b,...c){b.forEach((d,e)=>{a.Se(e,d.bind(null,...c))})}function md(a,b,c,d,e,f){const g=b.get(id+d+c);g&&ld(a,g,f,e);(b=b.get(id+jd))&&ld(a,b,c,d,f,e)}function nd(a){a.N.run(()=>{const b=a.C;for(const [d,e]of a.buffer){var c=b.get(d);(c=c&&c[e])&&c()}});a.C.clear();a.buffer.length=0}
419
+ olympe.dc.db.dt=class{constructor(a,b){this.Ka=a;this.N=b;this.F=new Map;this.G=new Set;this.C=new Map;this.buffer=[]}Se(a,b){let c=this.C.get(a);void 0===c&&(c=[],this.C.set(a,c));this.buffer.push([a,c.length]);c.push(b)}};function od(a){const b=olympe.dc.db.Database.C.Fo,c=olympe.dc.db.Database.C.El,d=olympe.dc.db.Database.C.Hc,e=olympe.dc.db.Database.C.rk,f=olympe.dc.db.Database.C.rm,g=olympe.dc.db.Database.C.fo,h=olympe.dc.db.Database.C.ho,k=()=>{};a.Ka.F(olympe.dc.db.Database.C.Eo,()=>{});a.Ka.F(b,()=>{});a.Ka.F(c,l=>{a.Ka.ad(()=>{pd(a.view,l,k,`monitorRelations${l}`)})});a.Ka.F(d,l=>{a.Ka.ad(()=>{qd(a.view,l,`monitorRelations${l}`)})});a.Ka.F(e,()=>{});a.Ka.F(f,()=>{});a.Ka.F(g,()=>{});a.Ka.F(h,()=>{})}
420
+ olympe.dc.db.ou=class{constructor(a,b,c,d){this.L=a;this.view=b;this.Ka=c;d&&od(this)}debug(a){const b=olympe.dc.wa(a);if(this.Ka.has(b)){var c=this.Ka.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Eb()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.Ka.get(d[d.length-1]);const e=olympe.dc.db.Database.ec.Mh+olympe.dc.CloudObject.nameProp.R();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
421
+ d.join(' --M--\x3e ')}this.L.info(a)}else this.L.info('[DATABASE] Instance',b,'has never been created or referred by the database')}};olympe.dc.db.Di=class a{constructor(b,c,d){this.L=b.Xa();this.Ka=b;this.F=new Set;this.mode=c;this.N=d;this.C=!1;c!==a.C.Cl&&this.U()}run(){if(!this.C)switch(this.mode){case a.C.us:this.C=!0;this.N.run(()=>{Hb(()=>{this.G();this.C=!1},0)});break;case a.C.Vq:this.C=!0,this.G(),this.C=!1}}G(){const b=this.Ka,c=olympe.dc.Ub.uf,d=this.F,e=h=>b.get(h);var f=h=>!(h.persisted()||h.oa());for(var g of d){const h=b.get(g);if(h&&!h.oa()){if(!h.persisted())continue;Array.from(b.Y(g,c,!1,f)).forEach(k=>{d.add(k)});
422
+ b.ac(g)}d.delete(g)}for(const h of d)f=Array.from(b.Y(h,c,!0)).map(e),g=Array.from(b.Y(h,c)).map(e),f.some(k=>k.oa())?g.filter(k=>!k.persisted()).forEach(k=>{d.delete(k.tag())}):f.concat(g).filter(k=>!k.persisted()).map(k=>k.tag()).forEach(k=>{d.delete(k);b.ac(k)});d.clear()}U(){this.Ka.Sa(this.run.bind(this));const b=olympe.dc.db.Database.C.ir,c=olympe.dc.db.Database.C.yp,d=olympe.dc.db.Database.C.Bq,e=olympe.dc.db.Database.F.IDLE,f=g=>{this.F.add(g);this.Ka.getState()===e&&this.run()};this.Ka.F(olympe.dc.db.Database.C.Ek,
423
+ f.bind(this));this.Ka.F(c,f.bind(this));this.Ka.F(b,g=>{this.F.delete(g)});this.Ka.F(d,(g,...h)=>{this.L.error(h[0])})}};olympe.dc.db.Di.C={Cl:0,Vq:1,us:2};const rd=olympe.dc.db.Database.ec.ORIGIN,sd=olympe.dc.db.Database.ec.DESTINATION,td=olympe.dc.db.Database.ec.Mh,ud=olympe.dc.db.Database.ec.nl,vd=rd+sd,wd=td+td,xd=olympe.dc.db.Database.F;function xc(a,b,c,d){const e=a.Ka.N(olympe.dc.wa(b));d=d||yd(a);e.Se('',d,c);e.Eb()&&a.G.run(()=>{c(!0,b)});return d}function yc(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=e.U('',c);void 0!==f&&(a.Ka.getState()===xd.cg&&a.Ka.aa(c),!d&&e.Eb()&&a.G.run(()=>{f(!1,b)}))}}
424
+ function pd(a,b,c,d){const e=a.Ka.N(olympe.dc.wa(b));b=d||yd(a);const f=e.wc(vd,b,c);e.Eb()&&e.forEach((g,h)=>{g=h[0];g!==rd&&g!==sd||zd(a,e,h,!0,f,!0)})}function qd(a,b,c){const d=U(a,b);if(null!==d){const e=d.U(vd,c);void 0!==e&&(a.Ka.getState()!==xd.cg||d.Ib()||a.Ka.aa(c),d.Eb()&&d.forEach((f,g)=>{f=g[0];(f===rd||f===sd)&&e&&zd(a,d,g,!1,e,!0)}))}}function yd(a){++a.N;return String(a.N)}
425
+ function Ad(a,b,c,d,e){b=a.Ka.N(olympe.dc.wa(b));c=olympe.dc.wa(c);const f=td+c;e=e||yd(a);b.Se(f,e,d);if(b.Eb()){let g=!1,h=b.get(f);void 0===h&&(g=!0,h=b.get(ud+c));if(void 0===h)return e;a.G.run(()=>{d(h,g)})}return e}function U(a,b,c=!1){if(null===b||void 0===b)throw Error('Provided tag is null or undefined.');a=a.Ka.get(olympe.dc.wa(b));return!a||c&&!a.Eb()?null:a}
426
+ function Bd(a,b,c){b=a.Ka.N(olympe.dc.wa(b));const d=yd(a);b.Se(wd,d,c);b.Eb()&&b.forEach((e,f)=>{const g=f[0];g!==td&&g!==ud||a.G.run(()=>{c(f.substr(1),e,g===ud)})});return d}function Cd(a,b,c){b=U(a,b);null!==b&&(b.U(wd,c),a.Ka.getState()===xd.cg&&a.Ka.aa(c))}function zd(a,b,c,d,e,f){(b=b.get(c))&&b.forEach((g,h)=>{g.Eb()&&(f?a.G.run(()=>{e(c.substr(1),c[0],d,h)}):a.G.run(()=>{e(d,h)}))})}
427
+ function V(a,b,c,d,e){b=a.Ka.N(olympe.dc.wa(b));c=c.Pa()+c.R();e=e||yd(a);d=b.wc(c,e,d);b.Eb()&&zd(a,b,c,!0,d,!1);return e}function Dd(a,b,c){return c===olympe.dc.Ub.NONE?0:a.fb(b,c,!0)||0}function Ed(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===rd||c===sd){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}
428
+ function Fd(a,b,c){if(!a.Eb(b))return a.L.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.wa(b)];for(const f of e){const g=a.tb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.L.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.wa(b)}`);return d}function Gd(a,b,c){return null!==a.Zm(c,olympe.dc.CloudObject.extendRel,d=>olympe.dc.Oa().al(d,olympe.dc.CloudObject.propertyRel,b))}
429
+ function Hd(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Eb()).length:0}
430
+ olympe.dc.ib=class{constructor(a,b){this.L=a;this.G=new olympe.D.Xb('DB View context');this.Ka=b;this.N=0}Z(){return this.Ka.Z()}F(a,b,c){a=U(this,a);null!==a&&(b=olympe.dc.wa(b),a.U(td+b,c),this.Ka.getState()===xd.cg&&this.Ka.aa(c))}C(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Pa()+b.R();const e=a.U(b,c);void 0!==e&&(this.Ka.getState()!==xd.cg||a.Ib()&&!d||this.Ka.aa(c),!d&&a.Eb()&&zd(this,a,b,!1,e,!1))}}Eb(a){a=U(this,a);return!(!a||!a.Eb())}name(a){return(a=U(this,a))?a.fb(olympe.dc.CloudObject.nameProp.R()):
431
+ ''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Df(a){return(a=(a=U(this,a,!0))&&a.Df())?a.tag():null}oj(a){a=U(this,a,!0);return!(!a||!a.Df())}rh(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Uf(a.tag(),b))}version(a){return(a=U(this,a,!0))&&a.version()}source(a){return(a=U(this,a,!0))&&a.source()}Xf(a){return(a=U(this,a,!1))?!!a.persisted():!0}fb(a,b,c){b=(a=U(this,a,!0))?a.fb(olympe.dc.wa(b),c):null;return void 0!==b?b:null}kd(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,
432
+ e]of c)c=d[0],(c===td||!b&&c===ud)&&a.set(d.substring(1),e);return a}tb(a,b){return this.kj(a,[b])}al(a,b,c){return this.tb(a,b).includes(olympe.dc.wa(c))}kj(a,b){a=U(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=U(this,d,!0).get(c.Pa()+c.R()),void 0!==a)for(const e of a.values())e.Eb()&&b.push(e.tag());a=b}return a}ic(a,b){var c=U(this,a,!0);return c?(c=c.get(b.Pa()+b.R()))&&1<c.size?(this.L.warn(`Relation ${b.R()} to instance ${a} is not unique: found ${c.size} related items`),
433
+ null):(a=c?c.values().next().value:null)&&a.Eb()?a.tag():null:null}Qf(a,b,c){a=olympe.dc.wa(a);const d=Fd(this,a,b);d.delete(a);return c?(c=olympe.dc.wa(c),d.has(c)?Array.from(Fd(this,c,b.Gc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Zm(a,b,c){if(!this.Eb(a))return null;b=Fd(this,a,b);const d=[olympe.dc.wa(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}$m(a,b,c){return this.kj(a,b).find(c)||null}ew(a,b,c){return this.kj(a,
434
+ b).filter(c)}Uk(a,b=olympe.dc.CloudObject){var c=U(this,a,!0);const d=b&&U(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Df();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Eb())throw a=`Try to get all extensions of the model ${olympe.dc.wa(a)} but one of them does not exists (${c.tag()})`,Error(a);null!==c&&e.push(c)}c=U(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);
435
+ return e.map(f=>f.tag())}Uf(a,b){const c=olympe.dc.wa(b);return!!this.Zm(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ee(a){return this.tb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.ib.prototype.getInstances=olympe.dc.ib.prototype.ee;olympe.dc.ib.prototype.isExtending=olympe.dc.ib.prototype.Uf;olympe.dc.ib.prototype.getExtendedModels=olympe.dc.ib.prototype.Uk;olympe.dc.ib.prototype.findAllRelated=olympe.dc.ib.prototype.ew;olympe.dc.ib.prototype.findRelated=olympe.dc.ib.prototype.$m;
436
+ olympe.dc.ib.prototype.findRecursive=olympe.dc.ib.prototype.Zm;olympe.dc.ib.prototype.getRecursiveRelated=olympe.dc.ib.prototype.Qf;olympe.dc.ib.prototype.getUniqueRelated=olympe.dc.ib.prototype.ic;olympe.dc.ib.prototype.getMultiRelated=olympe.dc.ib.prototype.kj;olympe.dc.ib.prototype.isRelated=olympe.dc.ib.prototype.al;olympe.dc.ib.prototype.getRelated=olympe.dc.ib.prototype.tb;olympe.dc.ib.prototype.getProperties=olympe.dc.ib.prototype.kd;olympe.dc.ib.prototype.getProperty=olympe.dc.ib.prototype.fb;
437
+ olympe.dc.ib.prototype.isPersisted=olympe.dc.ib.prototype.Xf;olympe.dc.ib.prototype.instanceOf=olympe.dc.ib.prototype.rh;olympe.dc.ib.prototype.isModel=olympe.dc.ib.prototype.oj;olympe.dc.ib.prototype.extension=olympe.dc.ib.prototype.Df;olympe.dc.ib.prototype.model=olympe.dc.ib.prototype.model;olympe.dc.ib.prototype.name=olympe.dc.ib.prototype.name;olympe.dc.ib.prototype.exist=olympe.dc.ib.prototype.Eb;function Id(a,b){let c=a.C.get(b);void 0===c&&(c=new olympe.dc.db.kg(b),a.C.set(b,c));return c}function Jd(a,b,c=olympe.dc.Ub.NONE){b=Kd(a,b,c);for(const d of b)Ld(a,d,!1),a.C.delete(d)}
438
+ function Kd(a,b,c,d=!0){const e=olympe.dm.Relation.C.sk,f=olympe.dm.Relation.C.Dk,g=olympe.dc.Aa.ORIGIN,h=olympe.dc.Oa();b=new Set([b]);const k=new Set;for(const n of b){var l=a.C.get(n);if(void 0!==l){for(const [p,q,r]of l.ld())r&&Dd(h,p,c)&f?b.add(q):d||r||k.add(`${n}.${p}.${q}`);for(const [p,q,r]of l.Ya())r&&Dd(h,p,c)&e?b.add(q):d||r||k.add(`${q}.${p}.${n}`)}for(const [p,q,r]of Ed(h,n))l=q===g?e:f,!k.has(q===g?`${r}.${p}.${n}`:`${n}.${p}.${r}`)&&Dd(h,p,c)&l&&b.add(r)}return Array.from(b).filter(n=>
439
+ a.C.has(n))}function Ld(a,b,c){const d=olympe.dc.Aa.ORIGIN,e=olympe.dc.Aa.DESTINATION,f=a.C.get(b);for(const [h,k,l]of f.ld())if(l||!c){f.U(h,e,k);var g=a.C.get(k);g&&g.U(h,d,b)}for(const [h,k,l]of f.Ya())if(l||!c)f.U(h,d,k),(g=a.C.get(k))&&g.U(h,e,b)}function*Md(a,b,c,d,e=[]){e.push(b);b=a.Mf(b);for(const [f,g]of b.tb(c))e.includes(f)||(yield*Md(a,f,c,d,e),yield d(f,g))}function Nd(a,b,c,d){const e=a.C.get(c);a=a.C.get(d);e&&e.U(b,olympe.dc.Aa.DESTINATION,d);a&&a.U(b,olympe.dc.Aa.ORIGIN,c)}
440
+ olympe.dc.db.Ac=class{constructor(a){this.id=a||olympe.W.fj();this.C=new Map}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "instances": {';for(const b of this.C.keys()){const c=this.C.get(b);a+=JSON.stringify(b)+': '+c.toJSON()+', '}a.endsWith(', ')&&(a=a.substr(0,a.length-2));return a+'}}'}static oc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=new olympe.dc.db.Ac(b.id);b=b.instances;for(const c of Object.keys(b)){const d=olympe.dc.db.kg.oc(b[c]);a.C.set(c,d)}return a}Z(){return this.id}Qc(a){const b=
441
+ olympe.dc.db.kg.C.am,c=olympe.dc.db.kg.C.Hc,d=olympe.dc.db.kg.C.Fk;this.C.forEach((e,f)=>{const g=e.getState();switch(g.id){case b:a.F(f,e.Y()?e.kd():void 0);break;case d:e.Y()&&a.uc(f,e.kd(),g.cj);break;case c:a.Mc(f,g.cj)}for(const [h,k,l]of e.ld())l?a.Ra(h,f,k):a.fc(h,f,k)})}G(){let a=0;this.C.forEach(b=>{a+=b.Lb()});return a}F(a,b){a=Id(this,a).create();b&&a.oa(b)}uc(a,b,c){b&&(a=Id(this,a).oa(b),c&&a.Ib())}Mc(a,b=olympe.dc.Ub.NONE){const c=this.C.get(a);if(c&&c.se())Jd(this,a,b);else{Id(this,
442
+ a).delete(b);for(const d of Kd(this,a,b,!1))this.C.get(d).kd().clear(),Ld(this,d,!0)}}Ra(a,b,c){Id(this,b).link(a,c);Id(this,c).ab(a,b)}fc(a,b,c){Id(this,b).unlink(a,c);Id(this,c).wb(a,b)}ee(){return function*(a){for(const b of a.values())if(b.se()||b.N()||b.Y())yield b}(this.C)}Mf(a){return this.C.get(olympe.dc.wa(a))||null}ld(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.ld((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Qf(a,b,c=(d,e)=>[d,e]){return Md(this,
443
+ a,b,c)}};olympe.dc.db.Ac.la=[olympe.dc.Writable,olympe.dc.lm];const Od=new Map;
444
+ olympe.dc.db.kg=class a{constructor(b){this.ha=b;this.G=a.F(a.C.Fk,!1);this.F=this.La=this.C=null}toJSON(){let b='{ "tag": '+JSON.stringify(this.ha)+', "state": '+JSON.stringify(this.G);if(this.C){b+=', "properties": {';for(var c of this.C.keys()){const d=this.C.get(c);b+=JSON.stringify(c)+': ';b=d.toJSON?b+d.toJSON():b+JSON.stringify(d);b+=', '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}if(this.La){b+=', "relations": {';for(const d of this.La.keys()){c=this.La.get(d);b+=JSON.stringify(d)+
445
+ ': {';for(const e of c.keys())b+=JSON.stringify(e)+': '+JSON.stringify(c.get(e))+', ';b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}, '}b.endsWith(', ')&&(b=b.substr(0,b.length-2));b+='}'}return b+'}'}static oc(b){var c;'string'===typeof b?c=JSON.parse(b):c=b;b=new olympe.dc.db.kg(c.tag);b.G=c.state;const d=c.properties;if(d){b.C=new Map;for(var e of Object.keys(d)){const f=d[e],g=f.type;let h=f;g&&('reference'===g?h=olympe.dc.Jc.oc(f):h=olympe.D.oc(f));null!==h&&void 0!==h&&b.C.set(e,h)}}if(c=
446
+ c.relations){b.La=new Map;for(const f of Object.keys(c)){e=new Map;for(const g of Object.keys(c[f]))e.set(g,c[f][g]);b.La.set(f,e)}}return b}static F(b,c){const d=String(b)+','+String(c);let e=Od.get(d);void 0===e&&(e={id:b,cj:c},Od.set(d,e));return e}tag(){return this.ha}getState(){return this.G}create(){this.G=a.F(a.C.am);return this}delete(b=olympe.dc.Ub.NONE){this.G=a.F(a.C.Hc,b);this.C=null;return this}Ib(){this.G.id===a.C.Fk&&(this.G=a.F(a.C.Fk,!0))}va(b,c){if(this.G.type===a.C.Hc)return this;
446
447
  this.C||(this.C=new Map);this.C.set(b,c);return this}oa(b){this.C||(this.C=new Map);b.forEach((c,d)=>{this.C.set(d,c)});return this}Da(b){let c;null==(c=this.C)||c.delete(b);0===this.C.size&&(this.C=null)}link(b,c){null===this.La&&(this.La=new Map);this.Ha(this.La,b,c,!0);return this}unlink(b,c){null===this.La&&(this.La=new Map);this.Ha(this.La,b,c,!1);return this}ab(b,c){null===this.F&&(this.F=new Map);this.Ha(this.F,b,c,!0)}wb(b,c){null===this.F&&(this.F=new Map);this.Ha(this.F,b,c,!1)}ac(b,c,d){if(c=
447
- c===olympe.dc.Aa.ORIGIN?this.F:this.La)return(b=c.get(b))&&b.get(d)}U(b,c,d){const e=(c=c===olympe.dc.Aa.ORIGIN?this.F:this.La)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}re(){return this.G.id===a.C.$l}L(){return this.G.id===a.C.Hc}Lb(){let b=this.C?this.C.size:0;this.La&&this.La.forEach(c=>{b+=c.size});return b}Y(){return null!==this.C}kd(){return this.C||new Map}fb(b){if(this.C)return this.C.get(b)}tb(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.R()))for(const [e,f]of d)yield c(e,
448
- f)}(b.Pa()===olympe.dc.Aa.ORIGIN?this.F:this.La)}hc(b){const c=b.Pa()===olympe.dc.Aa.ORIGIN?this.F:this.La;return(b=c&&c.get(b.R()))&&0!==b.size?Array.from(b.keys())[0]:null}nh(){return this.hc(olympe.dc.CloudObject.modelRel)}ld(b=(c,d,e)=>[c,d,e]){return this.aa(this.La,b)}Ya(b=(c,d,e)=>[c,d,e]){return this.aa(this.F,b)}Sa(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.Aa.ORIGIN,d=olympe.dc.Aa.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.aa.bind(this),
449
- this.La,this.F)}Ha(b,c,d,e){if(this.G.id!==a.C.Hc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*aa(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.jg.C={$l:0,Ek:1,Hc:2};function Kc(a,b,c,d,e,f=olympe.dc.Ga.rb){const g=olympe.dc.db.Instance.C.pq,h=olympe.dc.db.Instance.C.sr,k=c.Z();if(a.F.has(k))throw Error(`You try to execute the patch ${k} a second times whereas the first execution has not been validated yet.`);const l=new Ld(c,Md(a,c),f);a.C.push(k);a.F.set(k,l);a.Ka.Da();a.Ka.wb(d,g);a.Ka.wb(e,h);Lc(a,c,f);const n=Array.from(c.ee()).filter(p=>p.re()).map(p=>p.tag());a.Ka.wc(n);a.Ka.oa();0<n.length&&b.zc(()=>{a.Ka.Da();a.Ka.Lc(n);a.Ka.oa()})}
450
- function Lc(a,b,c){a.G.process(c,b,d=>{d||a.N.debug('CommitController: Rebase of patch',b.Z(),'done')})}function Mc(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.$e(d):d,b)}
451
- function Md(a,b){const c=a.Ka,d=olympe.dc.db.Database.cc.Kh,e=olympe.dc.db.Database.cc.jc,f=olympe.dc.db.Database.cc.ORIGIN,g=olympe.dc.db.Database.cc.DESTINATION,h=olympe.dc.$b.VERSION,k=olympe.dc.$b.Jd,l=new olympe.dc.db.Ac('rev-'+b.Z());a.N.debug('Generate the reverse graphLayer of',b.Z());b.C.forEach((n,p)=>{if(n.re()){l.Mc(p,olympe.dc.Ub.NONE);for(const [t,u]of n.ld())l.ec(t,p,u)}else{var q=c.get(p);if(void 0!==q)if(n.L()){n=n.getState().aj;for(const t of c.Y(p,n)){p=c.get(t);const u=(new Map).set(h,
452
- q.version()).set(k,q.source());p.forEach((v,w)=>{const y=w[0],B=w.substr(1);y===d?u.set(B,v):y===e?u.set(w,v):y===f?v.forEach((E,S)=>{l.Ra(B,S,t,0)}):y===g&&v.forEach((E,S)=>{l.Ra(B,t,S,0)})});l.F(t,u,0)}}else{const t=(new Map).set(h,q.version());for(const u of n.kd().keys()){var r=u[0]===e;const v=r?u.substr(1):u;r=r?q.Sa(v,!0):q.fb(v,!0);t.set(u,void 0===r?null:r)}1<t.size&&l.tc(p,t,!0,0);for(const [u,v,w]of n.ld())w?l.ec(u,p,v):l.Ra(u,p,v)}}});return l}
453
- olympe.dc.db.Ls=class{constructor(a,b,c){this.N=a;this.Ka=b;this.G=c;this.C=[];this.F=new Map}$e(a,b){Lc(this,Mc(this,a,this.C.length),b)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Mc(this,c.F,b);this.F.delete(a)}}};function Nd(a,b,c,d){const e=olympe.dc.Aa.DESTINATION;c=c.tag();const f=a.C.Lf(c);b.kd().forEach((g,h)=>{f.va(h,g);b.Da(h)});for(const [g,h,k,l]of b.Sa()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ra(g,n,p);Jd(d,g,n,p)}}
454
- function Od(a,b,c,d){const e=olympe.dc.Aa.DESTINATION,f=c.tag(),g=a.C.Lf(f);b.kd().forEach((h,k)=>{void 0!==c.fb(k)&&(g.va(k,h),b.Da(k))});for(const [h,k,l]of b.ld()){const n=c.ac(h,e,k);void 0!==n&&(Jd(d,h,f,k),n===l&&Jd(a.C,h,f,k))}}
455
- class Ld{constructor(a,b,c){this.F=a;this.C=b;this.source=c;this.db=olympe.dc.Oa()}Z(){return this.F.Z()}$e(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.L()?c.re()||Fd(this.C,b,f.getState().aj):c.L()?(Nd(this,f,c,a),Fd(a,b,c.getState().aj)):Od(this,f,c,a))}return a}};olympe.dc.db.P={Ea:'dc.db.Logger',xa:'dc.db.DatabaseManager',Mj:'dc.db.Database',ib:'dc.db.Driver',mt:'dc.db.Graph',so:'dc.db.DataProcessor',wo:'dc.db.DebugProcessor',EA:'dc.db.PermissionProcessor',Ji:'dc.db.GraphMonitor'};olympe.dc.db.Config={Uo:'db.garbageCollector',Ji:'db.monitor',vo:'db.debug'};
456
- olympe.T.config(function(a){D(a,olympe.dc.db.Config.Uo,olympe.dc.db.Bi.C.Uq);D(a,olympe.dc.db.Config.Ji,!1);D(a,olympe.dc.db.Config.vo,!1);C(a,olympe.dc.db.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc.db'));C(a,olympe.dc.db.P.Mj,[olympe.dc.db.P.Ea,new olympe.T.fa(olympe.dc.Config.xo),new olympe.T.fa(olympe.dc.db.Config.Uo),new olympe.T.fa(olympe.dc.Config.$g),new olympe.T.fa(olympe.dc.db.Config.vo)],(b,c,d,e,f)=>{d=e?olympe.dc.db.Bi.C.Bl:d;c=(new Map).set('defaultSource',c).set('garbageCollector',d).set('debug',
457
- f);return new olympe.dc.db.Database(b,c)});C(a,olympe.dc.db.P.ib,[olympe.dc.db.P.xa],b=>b.view);C(a,olympe.dc.db.P.Ji,[olympe.dc.db.P.xa],b=>b.Lx);A(a,olympe.dc.db.P.wo,olympe.dc.db.Wb.Co,olympe.dc.P.Ea);C(a,olympe.dc.db.P.so,[olympe.dc.db.P.Ea,olympe.dc.db.P.Mj,olympe.T.P.cg,new olympe.T.fa(olympe.dc.Config.dg)],(b,c,d,e)=>{b=new olympe.dc.db.Wb.vr(b,c);e&&(b=new olympe.dc.mm(la(d,olympe.dc.db.P.wo),b));return b});A(a,olympe.dc.db.P.xa,olympe.dc.db.Ws,olympe.dc.db.P.Ea,olympe.dc.db.P.Mj,olympe.dc.P.me,
458
- olympe.dc.db.P.so,new olympe.T.fa(olympe.dc.db.Config.Ji))},'olympe.dc.db');olympe.T.run([olympe.dc.db.P.Mj,olympe.dc.db.P.Ji],(a,b)=>{olympe.gj().db=a;olympe.gj().dbMonitor=b},'DC.DB debug service injection');olympe.dc.db.Wb={};olympe.dc.db.Wb.vr=class{constructor(a,b){this.N=a;this.Ka=b;this.buffer=[]}process(a,b,c){this.Ka.Da();b.Qc(this);this.Ka.oa();c(null,b)}F(a,b){this.Ka.create(a,b)}tc(a,b,c){this.Ka.update(a,b,c)}Mc(a,b=olympe.dc.Ub.NONE){for(const c of this.Ka.Y(a,b))this.Ka.Mc(c)}Ra(a,b,c){this.Ka.link(a,b,c)}ec(a,b,c){this.Ka.unlink(a,b,c)}};olympe.dc.db.Wb.vr.la=[olympe.dc.og,olympe.dc.Writable];function Pd(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)d+=(d?', "':'"')+e+'":',f?f instanceof olympe.dc.Jc||f instanceof olympe.dc.CloudObject?d+='new olympe.dc.Reference("'+f.R()+'")':f instanceof olympe.D.Color?d+='new olympe.df.Color("'+f.Qf()+','+f.Kf()+','+f.Ff()+','+f.Ef()+'")':f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString')?d+=JSON.stringify(f.toString()):'object'===typeof f&&(d+=Pd(a,f,(c||0)+1)):d+=JSON.stringify(f);return'{'+
448
+ c===olympe.dc.Aa.ORIGIN?this.F:this.La)return(b=c.get(b))&&b.get(d)}U(b,c,d){const e=(c=c===olympe.dc.Aa.ORIGIN?this.F:this.La)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}se(){return this.G.id===a.C.am}N(){return this.G.id===a.C.Hc}Lb(){let b=this.C?this.C.size:0;this.La&&this.La.forEach(c=>{b+=c.size});return b}Y(){return null!==this.C}kd(){return this.C||new Map}fb(b){if(this.C)return this.C.get(b)}tb(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.R()))for(const [e,f]of d)yield c(e,
449
+ f)}(b.Pa()===olympe.dc.Aa.ORIGIN?this.F:this.La)}ic(b){const c=b.Pa()===olympe.dc.Aa.ORIGIN?this.F:this.La;return(b=c&&c.get(b.R()))&&0!==b.size?Array.from(b.keys())[0]:null}oh(){return this.ic(olympe.dc.CloudObject.modelRel)}ld(b=(c,d,e)=>[c,d,e]){return this.aa(this.La,b)}Ya(b=(c,d,e)=>[c,d,e]){return this.aa(this.F,b)}Sa(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.Aa.ORIGIN,d=olympe.dc.Aa.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.aa.bind(this),
450
+ this.La,this.F)}Ha(b,c,d,e){if(this.G.id!==a.C.Hc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*aa(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.kg.C={am:0,Fk:1,Hc:2};function Oc(a,b,c,d,e,f=olympe.dc.Ga.rb){const g=olympe.dc.db.Instance.C.pq,h=olympe.dc.db.Instance.C.tr,k=c.Z();if(a.F.has(k))throw Error(`You try to execute the patch ${k} a second times whereas the first execution has not been validated yet.`);const l=new Pd(c,Qd(a,c),f);a.C.push(k);a.F.set(k,l);a.Ka.Da();a.Ka.wb(d,g);a.Ka.wb(e,h);Pc(a,c,f);const n=Array.from(c.ee()).filter(p=>p.se()).map(p=>p.tag());a.Ka.wc(n);a.Ka.oa();0<n.length&&b.zc(()=>{a.Ka.Da();a.Ka.Lc(n);a.Ka.oa()})}
451
+ function Pc(a,b,c){a.G.process(c,b,d=>{d||a.L.debug('CommitController: Rebase of patch',b.Z(),'done')})}function Qc(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.af(d):d,b)}
452
+ function Qd(a,b){const c=a.Ka,d=olympe.dc.db.Database.ec.Mh,e=olympe.dc.db.Database.ec.kc,f=olympe.dc.db.Database.ec.ORIGIN,g=olympe.dc.db.Database.ec.DESTINATION,h=olympe.dc.$b.VERSION,k=olympe.dc.$b.Jd,l=new olympe.dc.db.Ac('rev-'+b.Z());a.L.debug('Generate the reverse graphLayer of',b.Z());b.C.forEach((n,p)=>{if(n.se()){l.Mc(p,olympe.dc.Ub.NONE);for(const [t,u]of n.ld())l.fc(t,p,u)}else{var q=c.get(p);if(void 0!==q)if(n.N()){n=n.getState().cj;for(const t of c.Y(p,n)){p=c.get(t);const u=(new Map).set(h,
453
+ q.version()).set(k,q.source());p.forEach((v,w)=>{const y=w[0],B=w.substr(1);y===d?u.set(B,v):y===e?u.set(w,v):y===f?v.forEach((E,S)=>{l.Ra(B,S,t,0)}):y===g&&v.forEach((E,S)=>{l.Ra(B,t,S,0)})});l.F(t,u,0)}}else{const t=(new Map).set(h,q.version());for(const u of n.kd().keys()){var r=u[0]===e;const v=r?u.substr(1):u;r=r?q.Sa(v,!0):q.fb(v,!0);t.set(u,void 0===r?null:r)}1<t.size&&l.uc(p,t,!0,0);for(const [u,v,w]of n.ld())w?l.fc(u,p,v):l.Ra(u,p,v)}}});return l}
454
+ olympe.dc.db.Ns=class{constructor(a,b,c){this.L=a;this.Ka=b;this.G=c;this.C=[];this.F=new Map}af(a,b){Pc(this,Qc(this,a,this.C.length),b)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);Qc(this,c.F,b);this.F.delete(a)}}};function Rd(a,b,c,d){const e=olympe.dc.Aa.DESTINATION;c=c.tag();const f=a.C.Mf(c);b.kd().forEach((g,h)=>{f.va(h,g);b.Da(h)});for(const [g,h,k,l]of b.Sa()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ra(g,n,p);Nd(d,g,n,p)}}
455
+ function Sd(a,b,c,d){const e=olympe.dc.Aa.DESTINATION,f=c.tag(),g=a.C.Mf(f);b.kd().forEach((h,k)=>{void 0!==c.fb(k)&&(g.va(k,h),b.Da(k))});for(const [h,k,l]of b.ld()){const n=c.ac(h,e,k);void 0!==n&&(Nd(d,h,f,k),n===l&&Nd(a.C,h,f,k))}}
456
+ class Pd{constructor(a,b,c){this.F=a;this.C=b;this.source=c;this.db=olympe.dc.Oa()}Z(){return this.F.Z()}af(a){var b=this.F.C,c=a.C;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.N()?c.se()||Jd(this.C,b,f.getState().cj):c.N()?(Rd(this,f,c,a),Jd(a,b,c.getState().cj)):Sd(this,f,c,a))}return a}};olympe.dc.db.P={Ea:'dc.db.Logger',xa:'dc.db.DatabaseManager',Oj:'dc.db.Database',ib:'dc.db.Driver',pt:'dc.db.Graph',so:'dc.db.DataProcessor',wo:'dc.db.DebugProcessor',FA:'dc.db.PermissionProcessor',Li:'dc.db.GraphMonitor'};olympe.dc.db.Config={Uo:'db.garbageCollector',Li:'db.monitor',vo:'db.debug'};
457
+ olympe.T.config(function(a){D(a,olympe.dc.db.Config.Uo,olympe.dc.db.Di.C.Vq);D(a,olympe.dc.db.Config.Li,!1);D(a,olympe.dc.db.Config.vo,!1);C(a,olympe.dc.db.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc.db'));C(a,olympe.dc.db.P.Oj,[olympe.dc.db.P.Ea,new olympe.T.fa(olympe.dc.Config.xo),new olympe.T.fa(olympe.dc.db.Config.Uo),new olympe.T.fa(olympe.dc.Config.ah),new olympe.T.fa(olympe.dc.db.Config.vo)],(b,c,d,e,f)=>{d=e?olympe.dc.db.Di.C.Cl:d;c=(new Map).set('defaultSource',c).set('garbageCollector',d).set('debug',
458
+ f);return new olympe.dc.db.Database(b,c)});C(a,olympe.dc.db.P.ib,[olympe.dc.db.P.xa],b=>b.view);C(a,olympe.dc.db.P.Li,[olympe.dc.db.P.xa],b=>b.Ox);A(a,olympe.dc.db.P.wo,olympe.dc.db.Wb.Co,olympe.dc.P.Ea);C(a,olympe.dc.db.P.so,[olympe.dc.db.P.Ea,olympe.dc.db.P.Oj,olympe.T.P.dg,new olympe.T.fa(olympe.dc.Config.eg)],(b,c,d,e)=>{b=new olympe.dc.db.Wb.wr(b,c);e&&(b=new olympe.dc.mm(la(d,olympe.dc.db.P.wo),b));return b});A(a,olympe.dc.db.P.xa,olympe.dc.db.Ys,olympe.dc.db.P.Ea,olympe.dc.db.P.Oj,olympe.dc.P.ne,
459
+ olympe.dc.db.P.so,new olympe.T.fa(olympe.dc.db.Config.Li))},'olympe.dc.db');olympe.T.run([olympe.dc.db.P.Oj,olympe.dc.db.P.Li],(a,b)=>{olympe.ij().db=a;olympe.ij().dbMonitor=b},'DC.DB debug service injection');olympe.dc.db.Wb={};olympe.dc.db.Wb.wr=class{constructor(a,b){this.L=a;this.Ka=b;this.buffer=[]}process(a,b,c){this.Ka.Da();b.Qc(this);this.Ka.oa();c(null,b)}F(a,b){this.Ka.create(a,b)}uc(a,b,c){this.Ka.update(a,b,c)}Mc(a,b=olympe.dc.Ub.NONE){for(const c of this.Ka.Y(a,b))this.Ka.Mc(c)}Ra(a,b,c){this.Ka.link(a,b,c)}fc(a,b,c){this.Ka.unlink(a,b,c)}};olympe.dc.db.Wb.wr.la=[olympe.dc.pg,olympe.dc.Writable];function Td(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)d+=(d?', "':'"')+e+'":',f?f instanceof olympe.dc.Jc||f instanceof olympe.dc.CloudObject?d+='new olympe.dc.Reference("'+f.R()+'")':f instanceof olympe.D.Color?d+='new olympe.df.Color("'+f.Rf()+','+f.Lf()+','+f.Gf()+','+f.Ff()+'")':f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString')?d+=JSON.stringify(f.toString()):'object'===typeof f&&(d+=Td(a,f,(c||0)+1)):d+=JSON.stringify(f);return'{'+
459
460
  (d?d:'')+'}'}
460
- olympe.dc.db.Wb.Co=class{constructor(a){this.N=a;this.output=''}process(a,b,c){this.output='Patch #'+b.Z()+' (source: '+a+')';b.Qc(this);this.N.info(this.output);this.output='';c(null,b)}log(a,b){this.output+='\ndb.'+a+';'+(b?' // '+b:'')}F(a,b){this.log('createInstance("'+a+'", '+Pd(this,b)+')')}tc(a,b){this.log('updateInstance("'+a+'", '+Pd(this,b)+')')}Mc(a,b){var c=olympe.dc.Oa();const d=c.model(a);c=d?c.name(d)+' #'+d:'';this.log('deleteInstance("'+a+'", rule: '+b+')',c)}Ra(a,b,c){this.log('createRelation("'+
461
- a+'", "'+b+'", "'+c+'")',a===olympe.dc.kc.Xc?'Model':'')}ec(a,b,c){this.log('deleteRelation("'+a+'", "'+b+'", "'+c+'")',a===olympe.dc.kc.Xc?'Model':'')}};olympe.dc.db.Wb.Co.la=[olympe.dc.Writable,olympe.dc.og];olympe.dc.transaction={};olympe.dc.ri=class a{constructor(b,c){this.id=b||olympe.W.fc();this.F=new olympe.D.Xb('BurstTransaction#'+this.id,c);this.Lb=Qd(this);this.Y=!1;this.F.onDestroy(()=>this.U());this.Da=new Set;this.G=new Map;this.L=new Set;this.C=null;this.ab=olympe.T.getParameter(olympe.dc.transaction.Config.Yn)||30;this.oa=[]}static C(b,c){return`${b},${c}`}Ib(b){for(const c of this.oa)c(b);this.stop()}Ya(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ja(this.L);0<b.size&&Rd(this,b,!1);this.L.clear()}ja(b){const c=
462
- new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}aa(b,c,d){this.Sa(b,c,d);this.Lb(b,c,d);null===this.C&&(this.C=setTimeout(this.Ya.bind(this),this.ab))}Sa(b,c,d){b=a.C(b,c);this.G.set(b,d);this.L.add(b)}wb(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.wa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.wa(f),this.wb(d,e)!==g&&this.aa(d,e,g.valueOf())});this.Da.add(b)}complete(){return new Promise((b,
463
- c)=>{this.U((d,e)=>{for(const f of this.Da)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.wa(b),f=olympe.dc.wa(c);void 0===e||void 0===f?olympe.dc.ei().Xa().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.An([d],g=>{this.Y=!0;g instanceof olympe.dc.Jc?olympe.dc.ei().Xa().error('Cannot send complex property values in burst transactions'):this.aa(e,f,g.valueOf())})}),this.F.zc(()=>{this.U()}))}stop(){this.F.destroy();this.oa.length=0}Z(){return this.id}rh(){return!1}U(b){if(this.Y){this.Y=
464
- !1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.L.clear();const c=this.ja(new Set(this.G.keys()));Rd(this,c,!0,b)}else b&&b(!0,null)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ri.prototype.complete=olympe.dc.ri.prototype.complete;olympe.dc.ri.prototype.push=olympe.dc.ri.prototype.push;olympe.dc.iq=class{C(){}toString(){}};olympe.dc.transaction.mg=class{constructor(a){this.id=a||olympe.W.dj();this.ua=[];this.size=0}Z(){return this.id}G(){return this.size}concat(a){this.ua.push(...a.ua)}Qc(a){const b=olympe.dc.transaction.mg.C,c=this.ua.length;let d=0;for(;d<c;)switch(this.ua[d]){case b.ko:a.F(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.gr:a.tc(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.yo:a.Mc(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.lo:a.Ra(this.ua[d+1],this.ua[d+
465
- 2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.zo:a.ec(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;default:throw Error('Invalid Patch operations "'+this.ua[d]+'"');}}F(a,b,c){this.ua.push(olympe.dc.transaction.mg.C.ko,a,b,c);this.size++}tc(a,b,c,d){this.ua.push(olympe.dc.transaction.mg.C.gr,a,b,c,d);this.size++}Mc(a,b=olympe.dc.Ub.NONE,c){this.ua.push(olympe.dc.transaction.mg.C.yo,a,b,c);this.size++}Ra(a,b,c,d){if('string'!==typeof a)throw Error('Relation should be created using a tag as string (most likely a relation object is given here instead)');
466
- this.ua.push(olympe.dc.transaction.mg.C.lo,a,b,c,d);this.size++}ec(a,b,c,d){this.ua.push(olympe.dc.transaction.mg.C.zo,a,b,c,d);this.size++}};olympe.dc.transaction.mg.C={ko:1,gr:2,yo:3,lo:4,zo:5};olympe.dc.transaction.mg.la=[olympe.dc.Writable,olympe.dc.lm];function Sd(a,b){return a.U.get(b)||a.db.source(b)||olympe.dc.Ga.jc}function Td(a,b){return a.L.has(b)?a.L.get(b):a.db.Wf(b)}function Ud(a,b,c,d){var e=d&&d.get(olympe.dc.$b.VERSION);a.versions.set(b,Number(e)||1);d&&a.U.set(b,d.get(olympe.dc.$b.Jd));e=Sd(a,b);a.L.set(b,c&&a.F);a.Dc(e,c,f=>{f.F(b,d,0)})}
467
- olympe.dc.transaction.yu=class{constructor(a,b){this.id=b||olympe.W.fc();this.db=a;this.C=new Map;this.G=new olympe.dc.db.Ac(b);this.versions=new Map;this.U=new Map;this.Y={};this.L=new Map;this.F=!0}Sf(){return 0===this.G.C.size}persist(a){this.F=a}tc(a,b,c=!1){var d=b&&b.get(olympe.dc.$b.VERSION);this.versions.set(a,Number(d)||1);d=Sd(this,a);if(!d)throw Error('Attempt to update an instance which has an unknown source.');this.Dc(d,Td(this,a),e=>{e.tc(a,b,c,0)})}Mc(a,b){const c=Sd(this,a),d=Td(this,
468
- a);this.Dc(c,d,e=>{e.Mc(a,b)})}Ra(a,b,c){const d=Sd(this,b),e=Sd(this,c);let f=Td(this,b)&&Td(this,c);f&&d!==e&&a!==olympe.dc.kc.Xc&&(olympe.ra.Xa('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);this.Dc(d,f,g=>{g.Ra(a,b,c,0)})}ec(a,b,c){const d=Sd(this,b),e=Sd(this,c);let f=Td(this,b)&&Td(this,c);f&&d!==e&&a!==olympe.dc.kc.Xc&&(olympe.ra.Xa('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
469
- f=!1);this.Dc(d,f,g=>{g.ec(a,b,c,0)})}Dc(a,b,c){c(this.G);b&&this.F&&(b=this.C.get(a),b||(b=new olympe.dc.db.Ac(this.id),this.C.set(a,b)),c(b))}};function Vd(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.$b.Jd)if(e===olympe.dc.Ga.rb)d[g]=olympe.dc.Oa().Z();else{if(e===olympe.dc.Ga.Pc)continue}else g.startsWith(olympe.dc.$b.VERSION)?(g=g.substr(1),e=null===e?1:e):g.startsWith(olympe.dc.Ug.jc)&&(g='fd'+g.substr(1));e=a.aa(e);c&&e instanceof Object&&8===e.c?a.Y.set(g,e):d[g]=e}return d}
470
- function Wd(a){if(0===a.Y.size)return null;const b=Object.create(null);a.Y.forEach((c,d)=>{b[d]=c});a.Y.clear();return b}
471
- class Xd{constructor(){this.Y=new Map}aa(a){return a instanceof olympe.D.Wa||a instanceof olympe.D.qa||a instanceof olympe.D.ea?a.valueOf():a instanceof Date||a instanceof olympe.D.jb?(a=a instanceof olympe.D.jb?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.D.Color?{c:7,r:a.Qf().valueOf(),g:a.Kf().valueOf(),b:a.Ff().valueOf(),a:a.Ef().valueOf()}:a&&'function'===
472
- typeof a.R?{c:8,t:a.R()}:a}}function Yd(a){a.Hg=[];a.Se=[];a.Zf=[];a.Ig=[];a.wg=[]}function Zd(a){const b={};0<a.wg.length&&(b.wg=a.wg);0<a.Se.length&&(b.Se=a.Se);0<a.Hg.length&&(b.Hg=a.Hg);0<a.Zf.length&&(b.Zf=a.Zf);0<a.Ig.length&&(b.Ig=a.Ig);Yd(a);return b}function $d(a){const b=[...a.wg,...a.Se,...a.Hg,...a.Zf,...a.Ig];Yd(a);return b}
473
- olympe.dc.transaction.vd=class{constructor(a=!1){this.Hg=[];this.Se=[];this.Zf=[];this.Ig=[];this.wg=[];this.G=a;this.C=olympe.D?new Xd:new class extends Xd{aa(b){return b&&'function'===typeof b.R?{c:8,t:b.R()}:b}}}flush(){return JSON.stringify($d(this))}F(a,b,c=-1){this.Hg.push({o:1,t:a,p:Vd(this.C,b||null,this.G),i:c});this.G&&(b=Wd(this.C))&&this.Zf.push({o:2,t:a,p:b,i:c})}tc(a,b,c,d=-1){this.Zf.push({o:2,t:a,p:Vd(this.C,b||null,!1),i:d})}Mc(a,b,c=-1){this.Se.push({o:3,t:a,f:b,i:c})}Ra(a,b,c,d=
474
- -1){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);this.Ig.push({o:4,m:a,l:b,r:c,i:d})}ec(a,b,c,d=-1){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');this.wg.push({o:5,m:a,
475
- l:b,r:c,i:d})}};olympe.dc.transaction.vd.la=[olympe.dc.Writable];olympe.dc.transaction.Ph=class{constructor(a){this.id=a||olympe.W.fc();this.C=new Map;this.La=new Map}Z(){return this.id}F(a,b){this.C.has(a)&&console.warn('Try to add twice the same instance in the graph');const c=new olympe.dc.transaction.Ph.Instance(a);if(b)for(const [d,e]of b)c.va(d,e);this.C.set(a,c)}tc(){throw Error('UpdateInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');}Mc(){throw Error('DeleteInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');
476
- }Ra(a,b,c){a=new olympe.dc.transaction.Ph.Relation(b,c,a);this.La.set(a.toString(),a)}ec(a,b,c){a=new olympe.dc.transaction.Ph.Relation(b,c,a);this.La.delete(a.F+'.'+a.G+'.'+a.C)}G(){return this.La.size+this.C.size}ee(){return this.C}Qc(a){const b=new Map;this.C.forEach((c,d)=>{const e=new Map;ae(c,(f,g)=>{if(g instanceof olympe.dc.Jc){const h=b.get(d)||new Map;h.set(f,g);b.set(d,h)}else e.set(f,g)});a.F(d,e)});b.forEach((c,d)=>{a.tc(d,c)});this.La.forEach(c=>{a.Ra(c.C,c.F,c.G)})}};
477
- function ae(a,b){a.C.forEach((c,d)=>{b(d,b)})}olympe.dc.transaction.Ph.Instance=class{constructor(a){this.tag=a;this.C=new Map}R(){return this.tag}va(a,b){this.C.set(a,b);return this}deleteProperty(a){this.C.delete(a);return this}};olympe.dc.transaction.Ph.Relation=class{constructor(a,b,c){this.F=a;this.G=b;this.C=olympe.dc.wa(c)}toString(){return this.F+'.'+this.G+'.'+this.C}};olympe.dc.transaction.Ph.la=[olympe.dc.Writable,olympe.dc.lm];function be(a,b){b&&a.ua.push(b);return b}function ce(a){return(b,c)=>a.forEach(d=>d&&d(b,c))}
478
- olympe.dc.Transaction=class{constructor(a){this.id=a||olympe.W.fc();this.ua=[];this.G=!0;this.F=[]}Z(){return this.id}persist(a){this.G=a;return this}C(a){a.persist(this.G);const b=this.ua;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){return be(this,new olympe.dc.transaction.ua.Wd(a,b))}vj(a,b=!0){const c=olympe.dc.wa(a);var d=this.ua.find(g=>g instanceof olympe.dc.transaction.ua.Wd&&g.R()===c);if(d)return d.persist(b);d=olympe.dc.Oa();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+
479
- a);if(d.Wf(a))return null;const f=d.source(a)||olympe.dc.Ga.jc;a=this.create(e,a).persist(b).ki(f);for(const [g,h,k]of Ad(d,a))g!==olympe.dc.kc.Xc&&d.Wf(k)&&this.Ra(g,h===olympe.dc.Aa.DESTINATION?a:k,h===olympe.dc.Aa.DESTINATION?k:a);return a}delete(a,b=olympe.dc.Ub.Hc){be(this,new olympe.dc.transaction.ua.Pj(a,b))}update(a,b,c){return be(this,new olympe.dc.transaction.ua.Si(a,b,c))}Ra(a,b,c){be(this,new olympe.dc.transaction.ua.ro(a,b,c))}ec(a,b,c,d){be(this,new olympe.dc.transaction.ua.Ys(a,b,c,
480
- d))}Um(a,b,c,d){be(this,new olympe.dc.transaction.ua.Xs(a,b,c,d))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);d.setProperty(olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Ug.jc+d.R(),e);this.Ra(olympe.dc.CloudObject.propertyRel,a,d);this.Ra(olympe.dm.Property.typeRel,d,b);this.Ra(olympe.dc.CloudObject.containsRel,a,d);return d}ih(a,b,c='',{Yi:d=olympe.dm.Relation.F.cm,Mr:e=olympe.dm.Relation.C.Bq,Kr:f=olympe.dm.Relation.C.rl,xj:g=olympe.dm.Relation.C.Nl,
481
- Xi:h=olympe.dm.Nc.NONE,uj:k=olympe.dm.Relation.L|h}={},l=olympe.W.fc()){c=this.create(olympe.dm.Relation,l).setProperty(olympe.dc.CloudObject.nameProp,c||'').setProperty(olympe.dm.Relation.Mm,d).setProperty(olympe.dm.Relation.zn,k).setProperty(olympe.dm.Relation.Wm,e).setProperty(olympe.dm.Relation.Gn,e).setProperty(olympe.dm.Relation.Vm,f).setProperty(olympe.dm.Relation.Cn,g).setProperty(olympe.dm.Relation.Br,h);this.Ra(olympe.dc.CloudObject.G,a,c);this.Ra(olympe.dm.Relation.destinationModelRel,
482
- c,b);this.Ra(olympe.dc.CloudObject.containsRel,a,c);return c}rh(){return!1}Km(a){this.F.push(olympe.D.Ja().C(a))}hb(a,b){a=ce([...this.F,a]);de(this,a,b)}Xm(a){a=ce([...this.F,a]);ee(olympe.dc.ei(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Transaction.la=[olympe.dc.iq];function Qd(a){var b=olympe.dc.ei();const c=a.Z();b.L.set(c,a);a.F.onDestroy(()=>{b.L.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.Ac(c);e=(new Map).set(olympe.dc.$b.VERSION,b.db.version(d)+1).set(e,f);g.tc(d,e,!1,0);olympe.dc.Ad().$e(g,olympe.dc.Ga.rb)}}
483
- function Rd(a,b,c,d){var e=olympe.dc.ei();const f=olympe.dc.$b.VERSION,g=olympe.dc.ga.ka.wh,h=olympe.dc.ga.ka.sl,k=a.Z(),l=a.rh(),n=new Map;for(const q of b.keys()){var p=e.db.source(q);if(p===olympe.dc.Ga.rb)continue;let r=n.get(p);r||(r=new olympe.dc.db.Ac(k),n.set(p,r));p=b.get(q);p.set(f,e.db.version(q)+1);r.tc(q,p,!1,0)}for(const [q,r]of n)b=wc(new olympe.dc.ga(c?h:g,{Dc:r,rh:l},[q]),a.F),c&&d&&M(b,t=>{t?d(!1,t.message):d(!0,null)}),e.G.send(b)}
484
- function de(a,b,c){var d=olympe.dc.ei();if(c&&b){const e=a.Z();d.F.set(e,b);ee(d,a,(f,g)=>{f||(d.F.delete(e),b(f,g))},!1)}else ee(d,a,b,!1)}
485
- function fe(a){const b=olympe.dc.ga.ka.Sj;a.G.C(olympe.dc.ga.ka.Ij,(c,d)=>{c=d.id;var e=d.rollback;d=d.error;const f=a.L.get(c);void 0!==f&&(a.L.delete(c),f.Ib(d));olympe.dc.Ad().$e(e,olympe.dc.Ga.rb);a.N.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.G.C(b,(c,d)=>{c=d.finalize;var e=d.error;(d=(d=a.C.get(d.id))&&d.pop())&&d(c,e)})}
486
- function ee(a,b,c,d=!1){const e=olympe.D.Ja(),f=c?e.C(c):void 0;c=olympe.dc.Ad();const g=b.Z(),h=new olympe.dc.transaction.yu(a.db,g);b.C(h);if(h.Sf())f&&f(!0,null);else{a.C.set(g,[]);const k=[],l=[];for(const p of h.versions.keys())Td(h,p)?k.push(p):l.push(p);const n=Jc(c,e,h.G,k,l);ge(a,h,(p,q,r)=>{q?(he(a,g,k,h.C.size),ie(a,h,d,b.rh(),(t,u)=>{t||je(a,g,u);n(t);p&&p(t);f&&f(t,u)})):(a.N.error(r),je(a,g,r),n(!1),f&&f(!1,r))})}}
487
- function ge(a,b,c){const d=[];for(const p of b.versions.keys())a.db.qh(p,olympe.dm.File)&&Td(b,p)&&d.push(p);if(0===d.length)c(null,!0,null);else{var e=olympe.dm.File.urlProp.R(),f=olympe.dm.File.C.R(),g=olympe.dm.File.modificationDateProp.R(),h=Array.from(b.C.values()),k=[],l=new olympe.async.ng(olympe.D.mh()),n=olympe.W.ai();d.forEach(p=>{l.add((q,r)=>{const t=a.db.fb(p,e,!0),u=a.db.fb(p,olympe.dm.File.mimeTypeProp)||'application/data';t.startsWith('blob:')?n.F(t,v=>{n.Y(t);null===v?q():sc(a.Y,
488
- p,v,u,w=>{const y=h.reduce((B,E)=>B||E.Lf(p),null);null!==y&&(y.va(e,w).va(f,!0),k.push([p,w]));q()},w=>{r(w)})}):(2048<t.length&&a.N.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',p),q())})});Vb(l,(p,q)=>{let r=null;if(p){const t=new olympe.dc.db.Ac;k.forEach(([u,v])=>{const w=new Map;w.set(e,v).set(f,!0).set(g,olympe.D.jb.now());t.tc(u,w,!0,0)});r=Jc(olympe.dc.Ad(),olympe.D.mh(),t,[],[])}c(r,p,q)});l.start()}}
489
- function he(a,b,c,d){const e=olympe.D.mh(),f=new olympe.async.ng(e);0<a.timeout&&Ub(f,a.timeout);const g=a.C.get(b);for(let h=0;h<d;h++)f.add((k,l,n)=>{g.push(e.C((p,q)=>{n.set('final',p);q?l(q):k()}))});Vb(f,(h,k,l)=>{h||a.N.warn(`An error occurred while processing the notification of transaction (${b}): ${k}.`);l.get('final')!==olympe.dc.transaction.rg.C.Xp&&olympe.dc.Ad().persist(c);je(a,b)});f.start()}
490
- function ie(a,b,c,d,e){b=b.C;if(0===b.size)e(!0,null);else{var f=c?olympe.dc.ga.ka.Bk:olympe.dc.ga.ka.eh;c=(h,k,l,n)=>{h=M(new olympe.dc.ga(f,{Dc:h,rh:d},[k]),p=>{p instanceof Error?n(p.message):l()});a.G.send(h)};var g=new olympe.async.ng(olympe.D.mh());for(const [h,k]of b)g.add(c.bind(null,k,h));Vb(g,e);g.start()}}
491
- function je(a,b,c){if(void 0!==c){var d;null==(d=a.C.get(b))||d.forEach(e=>{e(olympe.dc.transaction.rg.C.hk,c)})}a.C.delete(b);if(0===a.C.size){for(const e of a.U)e();a.U=[]}a.F.has(b)&&(d=a.F.get(b),a.F.delete(b),d(!0,null))}function ke(a,b){0<a.C.size?a.U.push(olympe.D.Ja().C(b)):b()}olympe.dc.transaction.rg=class{constructor(a,b,c,d,e){this.N=a;this.db=b;this.G=c;this.Y=d;this.timeout=e;this.L=new Map;this.C=new Map;this.U=[];this.F=new Map;fe(this)}Xa(){return this.N}};
492
- olympe.dc.transaction.rg.C={hk:0,Wp:1,Xp:2};olympe.dc.transaction.P={Ea:'dc.transaction.Logger',xa:'dc.transaction.Manager'};olympe.dc.transaction.Config={TIMEOUT:'dc.transaction.timeout',Yn:'dc.transaction.burstInterval'};
493
- olympe.T.config(function(a){D(a,olympe.dc.transaction.Config.TIMEOUT,6E4);D(a,olympe.dc.transaction.Config.Yn,30);C(a,olympe.dc.transaction.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc'));A(a,olympe.dc.transaction.P.xa,olympe.dc.transaction.rg,olympe.dc.transaction.P.Ea,olympe.dc.P.vi,olympe.dc.P.me,olympe.dc.P.yi,new olympe.T.fa(olympe.dc.transaction.Config.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ua={};function W(a){return olympe.dc.wa(a)}function le(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.bb(e));return c}olympe.dc.transaction.ua.Pg=class{C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}bb(a){a=olympe.D.bb(a);return void 0===a||null===a?null:olympe.D.bs(a)?a.valueOf():a}};olympe.dc.transaction.ua.Pg.la=[olympe.dc.iq];olympe.dc.transaction.ua.Wd=class extends olympe.dc.transaction.ua.Pg{constructor(a,b){super();this.tag=void 0!==b?b:olympe.W.fc();this.model=a;this.F=new Map;this.G=!0;this.F.set(olympe.dc.$b.VERSION,1)}R(){return W(this.tag)}Tb(){return W(this.model)}persist(a){this.G=a;return this}ki(a){this.F.set(olympe.dc.$b.Jd,a);return this}Bx(){this.F.set(olympe.dc.$b.Jd,olympe.dc.Ga.rb)}setProperty(a,b){this.F.set(olympe.dc.wa(a),b);return this}gl(a){this.setProperty(olympe.dc.CloudObject.nameProp.R(),a);
494
- return this}C(a){const b=olympe.dc.Oa(),c=this.Tb(),d=this.R();if(void 0===c)throw Error('OperationError: Cannot create instance, model tag is undefined');var e=olympe.dc.$b.Jd;if(!this.F.has(e)){var f=b.source(c);this.F.set(e,null!==f?f:olympe.dc.Ga.jc)}if(b.Eb(d)&&!b.Wf(d)&&this.G){e=new Map([...b.kd(d,!0),...le(this,this.F)]);for(const g of e.values())g instanceof olympe.dc.Jc&&!Td(a,g.R())&&(f=new olympe.dc.Transaction,f.vj(g.R()),f.C(a));Ud(a,d,this.G,e);a.Ra(olympe.dc.CloudObject.modelRel.R(),
495
- d,c);for(const [g,h,k]of Ad(b,d))Td(a,k)&&(h===olympe.dc.Aa.ORIGIN?a.Ra(g,k,d):a.Ra(g,d,k))}else b.Eb(d)||(Ud(a,d,this.G,le(this,this.F)),a.Ra(olympe.dc.CloudObject.modelRel.R(),d,c))}toString(){return`CreateInstance(${this.Tb()}, ${this.R()})`}};olympe.dc.transaction.ua.Wd.prototype.setProperty=olympe.dc.transaction.ua.Wd.prototype.setProperty;olympe.dc.transaction.ua.Wd.prototype.localSource=olympe.dc.transaction.ua.Wd.prototype.Bx;olympe.dc.transaction.ua.Wd.prototype.persist=olympe.dc.transaction.ua.Wd.prototype.persist;
496
- olympe.dc.transaction.ua.Wd.prototype.getModelTag=olympe.dc.transaction.ua.Wd.prototype.Tb;olympe.dc.transaction.ua.Wd.prototype.getTag=olympe.dc.transaction.ua.Wd.prototype.R;olympe.dc.transaction.ua.Wd.la=[olympe.dc.ze];olympe.dc.transaction.ua.ro=class extends olympe.dc.transaction.ua.Pg{constructor(a,b,c){super();this.type=a.Pa?a:new olympe.dc.X.Sb(W(a));this.F=b;this.G=c}Pa(){return this.bb(this.type).Pa()}C(a){const b=W(this.type);if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.kc.Xc)throw Error('OperationError: Cannot create the instance -> model relation');const c=W(this.F);if(''===c)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
497
- const d=W(this.G);if(''===d)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.Pa()===olympe.dc.Aa.DESTINATION?a.Ra(b,c,d):a.Ra(b,d,c)}toString(){return`CreateRelation('${this.Pa()}${W(this.type)}, ${W(this.F)}, ${W(this.G)})`}};olympe.dc.transaction.ua.pz=class extends olympe.dc.transaction.ua.Pg{constructor(a,b=olympe.dc.Ub.Hc){super();this.model=a;this.F=b}Tb(){return W(this.model)}C(a){const b=this.Tb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.Oa();for(const d of c.ee(b))d!==b&&(new olympe.dc.transaction.ua.Pj(d,this.F)).C(a)}toString(){return`DeleteAllInstances(${this.Tb()}, ${this.F})`}};olympe.dc.transaction.ua.Xs=class extends olympe.dc.transaction.ua.Pg{constructor(a,b,c,d){super();this.F=a.Pa?a:new olympe.dc.X.Sb(W(a));this.G=b;this.L=c||!1;this.U=d instanceof Array?d.map(e=>W(e)):null}Pa(){return this.bb(this.F).Pa()}C(a){const b=W(this.F);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.kc.Xc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.G);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');
498
- var d=olympe.dc.Oa();const e=this.Pa(),f=this.U;d=d.tb(c,this.F);for(const g of d)e===olympe.dc.Aa.DESTINATION?a.ec(b,c,g):a.ec(b,g,c),null!==f&&0<=f.indexOf(g)||this.L&&(new olympe.dc.transaction.ua.Pj(g,olympe.dc.Ub.Hc)).C(a)}toString(){return`DeleteAllRelations(${this.Pa()}${W(this.F)}, ${W(this.G)}, ${this.L})`}};olympe.dc.transaction.ua.Pj=class extends olympe.dc.transaction.ua.Pg{constructor(a,b=olympe.dc.Ub.Hc){super();this.tag=a;this.F=b}R(){return W(this.tag)}C(a){const b=olympe.dc.Oa(),c=this.R();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');const d=b.model(c);0<=b.version(c)&&d&&a.Mc(c,this.F)}toString(){return'DeleteInstance('+this.R()+', '+this.F+')'}};olympe.dc.transaction.ua.Ys=class extends olympe.dc.transaction.ua.ro{constructor(a,b,c,d=!1){super(a,b,c);this.L=d}C(a){const b=W(this.type);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.kc.Xc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.F);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=W(this.G);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
499
- this.Pa()===olympe.dc.Aa.DESTINATION?a.ec(b,c,d):a.ec(b,d,c);this.L&&(new olympe.dc.transaction.ua.Pj(d,olympe.dc.Ub.Hc)).C(a)}toString(){return'DeleteRelation('+this.Pa()+W(this.type)+', '+W(this.F)+', '+W(this.G)+', '+this.L+')'}};olympe.dc.transaction.ua.Si=class extends olympe.dc.transaction.ua.Pg{constructor(a,b,c){super();this.tag=a;this.F=new Map;this.F.set(olympe.dc.$b.VERSION,-1);void 0!==b&&this.setProperty(b,c)}R(){return W(this.tag)}setProperty(a,b){this.F.set(W(a),b);return this}C(a){const b=this.R();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.Oa();var d=c.version(b),e=a.versions.get(b);e=void 0!==e?e:d;if(null===e)throw Error('OperationError: Instance #'+
500
- b+' not found so it cannot be updated');d=le(this,this.F);0>=d.get(olympe.dc.$b.VERSION)&&d.set(olympe.dc.$b.VERSION,e+1);for(const [f,g]of d)e=c.fb(b,f),e instanceof olympe.dc.Jc&&(e=e.R(),a.Y[e]=!0),g instanceof olympe.dc.Jc&&!Td(a,g.R())&&(e=new olympe.dc.Transaction,e.vj(g.R()),e.C(a));a.tc(b,d)}toString(){return'UpdateInstance('+this.R()+', '+le(this,this.F)+')'}};olympe.dc.transaction.ua.Si.prototype.setProperty=olympe.dc.transaction.ua.Si.prototype.setProperty;
501
- olympe.dc.transaction.ua.Si.prototype.getTag=olympe.dc.transaction.ua.Si.prototype.R;olympe.dc.ba={};olympe.dc.ze=class{R(){}};olympe.dc.ze.prototype.getTag=olympe.dc.ze.prototype.R;olympe.dc.eA=olympe.dc.ze;olympe.dc.ba.lk={ASC:'ASC',DESC:'DESC'};function me(a){switch(a.pr){case 1:const c=a.v;switch(a.t){case 1:var b=c;break;case 2:b=new Date(c);break;case 3:b=olympe.dc.CloudObject.get(c);break;case 4:b=new olympe.D.Color(c.r,c.g,c.b,c.a)}return new olympe.dc.ba.V.Ic(a.p,b,olympe.dc.Oa());case 2:return new olympe.dc.ba.V.Wc(a.p,a.s,olympe.dc.Oa(),a.c);case 3:return new olympe.dc.ba.V.Ch(a.p,a.b,a.l,a.s);case 4:return new olympe.dc.ba.V.nd(me(a.v));case 5:return new olympe.dc.ba.V.wd(a.p,new RegExp(a.r),olympe.dc.Oa(),a.c);case 6:b=new olympe.dc.ba.V.De(a.d);
502
- for(const [d,e,f]of a.r)a=new olympe.dc.query.Relation(d,e,f),f?b.Ok(a):b.sb(a);return b;case 7:return new olympe.dc.ba.V.ae(...a.p.map(d=>me(d)));case 8:return new olympe.dc.ba.V.Ud(...a.p.map(d=>me(d)));default:return null}}
503
- olympe.dc.ba.$a=class{observe(){}hb(){}clear(){}ia(){}toString(){}static qb(a,b){return new olympe.dc.ba.V.Ic(a,b,olympe.dc.Oa())}static contains(a,b,c=!1){return new olympe.dc.ba.V.Wc(a,b,olympe.dc.Oa(),c)}static hs(a,b,c=!0){return new olympe.dc.ba.V.wd(a,b,olympe.dc.Oa(),c)}static Vk(a,b,c=!0){return new olympe.dc.ba.V.Ch(a,b,!1,c)}static zj(a,b,c=!0){return new olympe.dc.ba.V.Ch(a,b,!0,c)}static and(...a){return new olympe.dc.ba.V.Ud(...a)}static or(...a){return new olympe.dc.ba.V.ae(...a)}static not(a){return new olympe.dc.ba.V.nd(a)}};
504
- olympe.dc.ba.$a.not=olympe.dc.ba.$a.not;olympe.dc.ba.$a.or=olympe.dc.ba.$a.or;olympe.dc.ba.$a.and=olympe.dc.ba.$a.and;olympe.dc.ba.$a.smallerThan=olympe.dc.ba.$a.zj;olympe.dc.ba.$a.greaterThan=olympe.dc.ba.$a.Vk;olympe.dc.ba.$a.regex=olympe.dc.ba.$a.hs;olympe.dc.ba.$a.contains=olympe.dc.ba.$a.contains;olympe.dc.ba.$a.equals=olympe.dc.ba.$a.qb;function ne(a,b){return new olympe.dc.gb(a.G,a.source,b,a.F,{max:a.max,offset:a.offset})}function oe(a){return a.C.filter(b=>b instanceof olympe.dc.ba.Hb.hf||b instanceof olympe.dc.ba.Hb.jf).length}
505
- function pe(a){const b=olympe.dc.ba.Hb.Nh,c=olympe.dc.ba.Hb.hf,d=olympe.dc.ba.Hb.jf,e=0===a.F.size?a.Wi():a;let f=-1;a.C.reduce((g,h)=>{h instanceof b&&(f=g);return h instanceof c||h instanceof d?g+1:g},0);if(0<=f&&!e.F.has(f))throw Error('AndReturn was not called for the current level before sortBy operator');return e}
506
- function qe(a,b){const c=olympe.dc.Ed.SUBSCRIBE,d=olympe.dc.Ed.Li,e=new olympe.dc.kf(a.G,b?c:d);for(const f of a.C)f instanceof olympe.dc.ba.Hb.hf?e.sb(f.Qd()):f instanceof olympe.dc.ba.Hb.jf?e.sb(f.Qd(),!0):f instanceof olympe.dc.ba.Hb.vc&&(a=f.C,a instanceof olympe.dc.ba.V.De&&(a=a.ld(),a.forEach(g=>e.sb(g)),re(e,a.length)));return e}function se(a){return a.source||a.db.source(a.G)||olympe.dc.Ga.jc}
507
- function te(a){return new olympe.dc.gb(a.r,a.s,a.qp.map(b=>ue(b)),new Set(a.lv),{max:a.lp.m,offset:a.lp.o})}
508
- olympe.dc.gb=class{constructor(a,b=null,c=[],d=new Set,e={max:-1,offset:0}){this.db=olympe.dc.Oa();this.G=olympe.dc.wa(a);this.source=b;this.C=c;this.F=d;this.max=-1===e.max?-1:e.max;this.offset=e.offset;this.id=null}static from(a,b){return new olympe.dc.gb(a,b)}static Xk(a,b=olympe.dc.Ga.jc){return(new olympe.dc.gb(a,b)).sb(olympe.dc.CloudObject.instancesRel)}sb(a){const b=Array.from(this.C);b.push(new olympe.dc.ba.Hb.hf(this.db,a));return ne(this,b)}ew(a,b=!1){const c=Array.from(this.C);c.push(new olympe.dc.ba.Hb.jf(this.db,
509
- a,b));return ne(this,c)}Wi(){this.F.add(oe(this));return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:this.max,offset:this.offset})}filter(a){const b=Array.from(this.C);b.push(new olympe.dc.ba.Hb.vc(a));return ne(this,b)}Zi(){return this}limit(a,b=0){return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:a,offset:b})}jl(a,b=olympe.dc.ba.lk.ASC){const c=Array.from(this.C);c.push(new olympe.dc.ba.Hb.Nh(this.db,a,b));return ne(this,c)}hb(a){return ve(olympe.dc.Nf(),pe(this),'function'===
510
- typeof a.xc?a.xc():a)}observe(a){return we(olympe.dc.Nf(),pe(this),'function'===typeof a.xc?a.xc():a)}jd(){var a=pe(this);return olympe.dc.Nf().U.jd(a)}Z(){null===this.id&&(this.id=olympe.W.mb(this.G+this.C.reduce((a,b)=>a+b.toString(),'')+Array.from(this.F).toString()+this.offset+this.max));return this.id}ia(){return{r:this.G,qp:this.C.map(a=>a.ia()),lv:Array.from(this.F),s:this.source,lp:{m:this.max,o:this.offset}}}};olympe.dc.gb.prototype.executeFromCache=olympe.dc.gb.prototype.jd;
511
- olympe.dc.gb.prototype.observe=olympe.dc.gb.prototype.observe;olympe.dc.gb.prototype.execute=olympe.dc.gb.prototype.hb;olympe.dc.gb.prototype.sortBy=olympe.dc.gb.prototype.jl;olympe.dc.gb.prototype.limit=olympe.dc.gb.prototype.limit;olympe.dc.gb.prototype.cast=olympe.dc.gb.prototype.Zi;olympe.dc.gb.prototype.filter=olympe.dc.gb.prototype.filter;olympe.dc.gb.prototype.andReturn=olympe.dc.gb.prototype.Wi;olympe.dc.gb.prototype.followRecursively=olympe.dc.gb.prototype.ew;
512
- olympe.dc.gb.prototype.follow=olympe.dc.gb.prototype.sb;olympe.dc.gb.instancesOf=olympe.dc.gb.Xk;olympe.dc.gb.from=olympe.dc.gb.from;function ue(a){const b=olympe.dc.Oa();switch(a.t){case 1:return(a=me(a.p))?new olympe.dc.ba.Hb.vc(a):null;case 2:return new olympe.dc.ba.Hb.hf(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!1));case 3:var c=a.s;return new olympe.dc.ba.Hb.jf(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!0),c);case 4:return c=a.o,new olympe.dc.ba.Hb.Nh(b,new olympe.dc.ta.Property(a.p),c);default:return null}}olympe.dc.ba.nk=class{ia(){}F(){}hb(){}observe(){}toString(){}};function xe(a){return a.G.map(b=>a.F.get(a.C[b]))}function ye(a){return a.L.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function ze(a){a=Array.from(a.F.values()).flat();return new Set(a.map(b=>b.R()))}function Ae(a){return new Set(a.L.flatMap(b=>b.split('.')))}
513
- function Be(a,b){var c=olympe.dc.Oa();if(c.Eb(a)){b.F(a,c.kd(a,!0),0);b.Ra(olympe.dc.kc.Xc,a,c.model(a),0);for(const [d,e,f]of Ad(c,a))(c=b.Lf(f))&&c.re()&&(e===olympe.dc.Aa.DESTINATION?b.Ra(d,a,f,0):b.Ra(d,f,a,0))}else olympe.ra.Xa('Query Result').error(`Fail to serialize instance with tag ${a} not present in local DBView`)}
514
- function Ce(a,b,c=olympe.dc.Ga.Pc){b&&b((new olympe.dc.W.Ki(c)).C(a.p||[]));const d=olympe.dc.Oa();let e=!1;b=a.k.map(f=>{const g=f.split('.').map(h=>d.Eb(h)?olympe.dc.CloudObject.get(h):(olympe.ra.Xa('QueryResult').error(`CloudObject with tag ${h} not present but required for deserialization`),e=!0,null));return[f,1===g.length?g[0]:g]});return e?null:olympe.dc.Va.create(b,a.a,a.r)}
515
- olympe.dc.Va=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.L=[];this.hash=''}static empty(){return new olympe.dc.Va}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}ef(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.ef().includes(a)}indexOf(a){return null===
516
- a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.ef().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Sc(){return this.qe(0)}qe(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.ef();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.ef();a.pop();return a}shift(){if(0<this.C.length){const a=this.ef();a.shift();return a}return[]}filter(a){return this.ef().filter(a)}find(a){return(a=this.ef().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
517
- a(this.F.get(b),c))}map(a){return this.ef().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Va.create(b,Array.from(this.G),Array.from(this.L))}reduce(a,b){return this.ef().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.L.concat(...a.map(d=>d.L));return olympe.dc.Va.create(b,c,a)}static from(a,b){const c=olympe.dc.Oa();var d=De(b);if(b.Md){const {kb:k,
518
- order:l,Md:n,Iv:p}=b.Md,q=Array.from(b.G).sort().indexOf(p),r=l===olympe.dc.ba.lk.ASC?1:-1;d.sort((t,u)=>{u=u[q];t=c.fb(t[q],k);u=c.fb(u,k);return null===t?-r:null===u?r:r*n(t,u)})}else d.sort((k,l)=>k.reduce((n,p,q)=>n||p.localeCompare(l[q]),0));0<b.offset&&(d=d.slice(b.offset));-1<b.max&&(d=d.slice(0,b.max));b=olympe.W.mb(d.flat().join(''));if(b===a.hash)return a;d=d.map(k=>[k.join('.'),1===k.length?olympe.dc.CloudObject.get(k[0]):k.map(l=>olympe.dc.CloudObject.get(l))]);const e=new Set(d.map(k=>
519
- k[0])),f=new Set(a.keys()),g=[],h=[];d.forEach(([k],l)=>{!f.has(k)&&g.push(l)});f.forEach(k=>{!e.has(k)&&h.push(k)});return olympe.dc.Va.create(d,g,h,b)}static create(a,b,c,d){const e=new olympe.dc.Va;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.W.mb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.L=c||[];return e}ia(){const a=new olympe.dc.db.Ac;var b=new Set(this.G.flatMap(c=>this.C[c].split('.')));for(const c of b)Be(c,a);b=new olympe.dc.transaction.vd;a.Qc(b);return{k:this.C,p:$d(b),a:this.G,r:this.L}}};
461
+ olympe.dc.db.Wb.Co=class{constructor(a){this.L=a;this.output=''}process(a,b,c){this.output='Patch #'+b.Z()+' (source: '+a+')';b.Qc(this);this.L.info(this.output);this.output='';c(null,b)}log(a,b){this.output+='\ndb.'+a+';'+(b?' // '+b:'')}F(a,b){this.log('createInstance("'+a+'", '+Td(this,b)+')')}uc(a,b){this.log('updateInstance("'+a+'", '+Td(this,b)+')')}Mc(a,b){var c=olympe.dc.Oa();const d=c.model(a);c=d?c.name(d)+' #'+d:'';this.log('deleteInstance("'+a+'", rule: '+b+')',c)}Ra(a,b,c){this.log('createRelation("'+
462
+ a+'", "'+b+'", "'+c+'")',a===olympe.dc.lc.Xc?'Model':'')}fc(a,b,c){this.log('deleteRelation("'+a+'", "'+b+'", "'+c+'")',a===olympe.dc.lc.Xc?'Model':'')}};olympe.dc.db.Wb.Co.la=[olympe.dc.Writable,olympe.dc.pg];olympe.dc.transaction={};olympe.dc.ti=class a{constructor(b,c){this.id=b||olympe.W.hc();this.F=new olympe.D.Xb('BurstTransaction#'+this.id,c);this.Lb=Ud(this);this.Y=!1;this.F.onDestroy(()=>this.U());this.Da=new Set;this.G=new Map;this.N=new Set;this.C=null;this.ab=olympe.T.getParameter(olympe.dc.transaction.Config.Yn)||30;this.oa=[]}static C(b,c){return`${b},${c}`}Ib(b){for(const c of this.oa)c(b);this.stop()}Ya(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ha(this.N);0<b.size&&Vd(this,b,!1);this.N.clear()}ha(b){const c=
463
+ new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}aa(b,c,d){this.Sa(b,c,d);this.Lb(b,c,d);null===this.C&&(this.C=setTimeout(this.Ya.bind(this),this.ab))}Sa(b,c,d){b=a.C(b,c);this.G.set(b,d);this.N.add(b)}wb(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.wa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.wa(f),this.wb(d,e)!==g&&this.aa(d,e,g.valueOf())});this.Da.add(b)}complete(){return new Promise((b,
464
+ c)=>{this.U((d,e)=>{for(const f of this.Da)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.wa(b),f=olympe.dc.wa(c);void 0===e||void 0===f?olympe.dc.gi().Xa().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.An([d],g=>{this.Y=!0;g instanceof olympe.dc.Jc?olympe.dc.gi().Xa().error('Cannot send complex property values in burst transactions'):this.aa(e,f,g.valueOf())})}),this.F.zc(()=>{this.U()}))}stop(){this.F.destroy();this.oa.length=0}Z(){return this.id}sh(){return!1}U(b){if(this.Y){this.Y=
465
+ !1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.N.clear();const c=this.ha(new Set(this.G.keys()));Vd(this,c,!0,b)}else b&&b(!0,null)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ti.prototype.complete=olympe.dc.ti.prototype.complete;olympe.dc.ti.prototype.push=olympe.dc.ti.prototype.push;olympe.dc.iq=class{C(){}toString(){}};olympe.dc.transaction.ng=class{constructor(a){this.id=a||olympe.W.fj();this.ua=[];this.size=0}Z(){return this.id}G(){return this.size}concat(a){this.ua.push(...a.ua)}Qc(a){const b=olympe.dc.transaction.ng.C,c=this.ua.length;let d=0;for(;d<c;)switch(this.ua[d]){case b.ko:a.F(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.hr:a.uc(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.yo:a.Mc(this.ua[d+1],this.ua[d+2],this.ua[d+3]);d+=4;break;case b.lo:a.Ra(this.ua[d+1],this.ua[d+
466
+ 2],this.ua[d+3],this.ua[d+4]);d+=5;break;case b.zo:a.fc(this.ua[d+1],this.ua[d+2],this.ua[d+3],this.ua[d+4]);d+=5;break;default:throw Error('Invalid Patch operations "'+this.ua[d]+'"');}}F(a,b,c){this.ua.push(olympe.dc.transaction.ng.C.ko,a,b,c);this.size++}uc(a,b,c,d){this.ua.push(olympe.dc.transaction.ng.C.hr,a,b,c,d);this.size++}Mc(a,b=olympe.dc.Ub.NONE,c){this.ua.push(olympe.dc.transaction.ng.C.yo,a,b,c);this.size++}Ra(a,b,c,d){if('string'!==typeof a)throw Error('Relation should be created using a tag as string (most likely a relation object is given here instead)');
467
+ this.ua.push(olympe.dc.transaction.ng.C.lo,a,b,c,d);this.size++}fc(a,b,c,d){this.ua.push(olympe.dc.transaction.ng.C.zo,a,b,c,d);this.size++}};olympe.dc.transaction.ng.C={ko:1,hr:2,yo:3,lo:4,zo:5};olympe.dc.transaction.ng.la=[olympe.dc.Writable,olympe.dc.lm];function Wd(a,b){return a.U.get(b)||a.db.source(b)||olympe.dc.Ga.kc}function Xd(a,b){return a.N.has(b)?a.N.get(b):a.db.Xf(b)}function Yd(a,b,c,d){var e=d&&d.get(olympe.dc.$b.VERSION);a.versions.set(b,Number(e)||1);d&&a.U.set(b,d.get(olympe.dc.$b.Jd));e=Wd(a,b);a.N.set(b,c&&a.F);a.Dc(e,c,f=>{f.F(b,d,0)})}
468
+ olympe.dc.transaction.Bu=class{constructor(a,b){this.id=b||olympe.W.hc();this.db=a;this.C=new Map;this.G=new olympe.dc.db.Ac(b);this.versions=new Map;this.U=new Map;this.Y={};this.N=new Map;this.F=!0}Tf(){return 0===this.G.C.size}persist(a){this.F=a}uc(a,b,c=!1){var d=b&&b.get(olympe.dc.$b.VERSION);this.versions.set(a,Number(d)||1);d=Wd(this,a);if(!d)throw Error('Attempt to update an instance which has an unknown source.');this.Dc(d,Xd(this,a),e=>{e.uc(a,b,c,0)})}Mc(a,b){const c=Wd(this,a),d=Xd(this,
469
+ a);this.Dc(c,d,e=>{e.Mc(a,b)})}Ra(a,b,c){const d=Wd(this,b),e=Wd(this,c);let f=Xd(this,b)&&Xd(this,c);f&&d!==e&&a!==olympe.dc.lc.Xc&&(olympe.ra.Xa('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);this.Dc(d,f,g=>{g.Ra(a,b,c,0)})}fc(a,b,c){const d=Wd(this,b),e=Wd(this,c);let f=Xd(this,b)&&Xd(this,c);f&&d!==e&&a!==olympe.dc.lc.Xc&&(olympe.ra.Xa('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
470
+ f=!1);this.Dc(d,f,g=>{g.fc(a,b,c,0)})}Dc(a,b,c){c(this.G);b&&this.F&&(b=this.C.get(a),b||(b=new olympe.dc.db.Ac(this.id),this.C.set(a,b)),c(b))}};function Zd(a,b,c){const d=Object.create(null);if(!b)return d;for(const f of Array.from(b.keys()).sort()){let g=f;var e=b.get(f);if(g===olympe.dc.$b.Jd)if(e===olympe.dc.Ga.rb)d[g]=olympe.dc.Oa().Z();else{if(e===olympe.dc.Ga.Pc)continue}else g.startsWith(olympe.dc.$b.VERSION)?(g=g.substr(1),e=null===e?1:e):g.startsWith(olympe.dc.Vg.kc)&&(g='fd'+g.substr(1));e=a.aa(e);c&&e instanceof Object&&8===e.c?a.Y.set(g,e):d[g]=e}return d}
471
+ function $d(a){if(0===a.Y.size)return null;const b=Object.create(null);a.Y.forEach((c,d)=>{b[d]=c});a.Y.clear();return b}
472
+ class ae{constructor(){this.Y=new Map}aa(a){return a instanceof olympe.D.Wa||a instanceof olympe.D.qa||a instanceof olympe.D.ea?a.valueOf():a instanceof Date||a instanceof olympe.D.jb?(a=a instanceof olympe.D.jb?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.D.Color?{c:7,r:a.Rf().valueOf(),g:a.Lf().valueOf(),b:a.Gf().valueOf(),a:a.Ff().valueOf()}:a&&'function'===
473
+ typeof a.R?{c:8,t:a.R()}:a}}function be(a){a.Ig=[];a.Te=[];a.$f=[];a.Jg=[];a.xg=[]}function ce(a){const b={};0<a.xg.length&&(b.xg=a.xg);0<a.Te.length&&(b.Te=a.Te);0<a.Ig.length&&(b.Ig=a.Ig);0<a.$f.length&&(b.$f=a.$f);0<a.Jg.length&&(b.Jg=a.Jg);be(a);return b}function de(a){const b=[...a.xg,...a.Te,...a.Ig,...a.$f,...a.Jg];be(a);return b}
474
+ olympe.dc.transaction.vd=class{constructor(a=!1){this.Ig=[];this.Te=[];this.$f=[];this.Jg=[];this.xg=[];this.G=a;this.C=olympe.D?new ae:new class extends ae{aa(b){return b&&'function'===typeof b.R?{c:8,t:b.R()}:b}}}flush(){return JSON.stringify(de(this))}F(a,b,c=-1){this.Ig.push({o:1,t:a,p:Zd(this.C,b||null,this.G),i:c});this.G&&(b=$d(this.C))&&this.$f.push({o:2,t:a,p:b,i:c})}uc(a,b,c,d=-1){this.$f.push({o:2,t:a,p:Zd(this.C,b||null,!1),i:d})}Mc(a,b,c=-1){this.Te.push({o:3,t:a,f:b,i:c})}Ra(a,b,c,d=
475
+ -1){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);this.Jg.push({o:4,m:a,l:b,r:c,i:d})}fc(a,b,c,d=-1){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');this.xg.push({o:5,m:a,
476
+ l:b,r:c,i:d})}};olympe.dc.transaction.vd.la=[olympe.dc.Writable];olympe.dc.transaction.Rh=class{constructor(a){this.id=a||olympe.W.hc();this.C=new Map;this.La=new Map}Z(){return this.id}F(a,b){this.C.has(a)&&console.warn('Try to add twice the same instance in the graph');const c=new olympe.dc.transaction.Rh.Instance(a);if(b)for(const [d,e]of b)c.va(d,e);this.C.set(a,c)}uc(){throw Error('UpdateInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');}Mc(){throw Error('DeleteInstance should never be called on a SubGraph since it represents the result of a GraphDef Query');
477
+ }Ra(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.La.set(a.toString(),a)}fc(a,b,c){a=new olympe.dc.transaction.Rh.Relation(b,c,a);this.La.delete(a.F+'.'+a.G+'.'+a.C)}G(){return this.La.size+this.C.size}ee(){return this.C}Qc(a){const b=new Map;this.C.forEach((c,d)=>{const e=new Map;ee(c,(f,g)=>{if(g instanceof olympe.dc.Jc){const h=b.get(d)||new Map;h.set(f,g);b.set(d,h)}else e.set(f,g)});a.F(d,e)});b.forEach((c,d)=>{a.uc(d,c)});this.La.forEach(c=>{a.Ra(c.C,c.F,c.G)})}};
478
+ function ee(a,b){a.C.forEach((c,d)=>{b(d,b)})}olympe.dc.transaction.Rh.Instance=class{constructor(a){this.tag=a;this.C=new Map}R(){return this.tag}va(a,b){this.C.set(a,b);return this}deleteProperty(a){this.C.delete(a);return this}};olympe.dc.transaction.Rh.Relation=class{constructor(a,b,c){this.F=a;this.G=b;this.C=olympe.dc.wa(c)}toString(){return this.F+'.'+this.G+'.'+this.C}};olympe.dc.transaction.Rh.la=[olympe.dc.Writable,olympe.dc.lm];function fe(a,b){b&&a.ua.push(b);return b}function ge(a){return(b,c)=>a.forEach(d=>d&&d(b,c))}
479
+ olympe.dc.Transaction=class{constructor(a){this.id=a||olympe.W.hc();this.ua=[];this.G=!0;this.F=[]}Z(){return this.id}persist(a){this.G=a;return this}C(a){a.persist(this.G);const b=this.ua;for(let c=0,d=b.length;c<d;c++)b[c].C(a)}create(a,b){return fe(this,new olympe.dc.transaction.ua.Wd(a,b))}xj(a,b=!0){const c=olympe.dc.wa(a);var d=this.ua.find(g=>g instanceof olympe.dc.transaction.ua.Wd&&g.R()===c);if(d)return d.persist(b);d=olympe.dc.Oa();const e=d.model(a);if(null===e)throw Error('Try to persist a instance that does not exist: '+
480
+ a);if(d.Xf(a))return null;const f=d.source(a)||olympe.dc.Ga.kc;a=this.create(e,a).persist(b).mi(f);for(const [g,h,k]of Ed(d,a))g!==olympe.dc.lc.Xc&&d.Xf(k)&&this.Ra(g,h===olympe.dc.Aa.DESTINATION?a:k,h===olympe.dc.Aa.DESTINATION?k:a);return a}delete(a,b=olympe.dc.Ub.Hc){fe(this,new olympe.dc.transaction.ua.Rj(a,b))}update(a,b,c){return fe(this,new olympe.dc.transaction.ua.Ui(a,b,c))}Ra(a,b,c){fe(this,new olympe.dc.transaction.ua.ro(a,b,c))}fc(a,b,c,d){fe(this,new olympe.dc.transaction.ua.$s(a,b,c,
481
+ d))}Um(a,b,c,d){fe(this,new olympe.dc.transaction.ua.Zs(a,b,c,d))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);d.setProperty(olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Vg.kc+d.R(),e);this.Ra(olympe.dc.CloudObject.propertyRel,a,d);this.Ra(olympe.dm.Property.typeRel,d,b);this.Ra(olympe.dc.CloudObject.containsRel,a,d);return d}jh(a,b,c='',{$i:d=olympe.dm.Relation.F.cm,Nr:e=olympe.dm.Relation.C.Cq,Lr:f=olympe.dm.Relation.C.sl,zj:g=olympe.dm.Relation.C.Ol,
482
+ Zi:h=olympe.dm.Nc.NONE,wj:k=olympe.dm.Relation.N|h}={},l=olympe.W.hc()){c=this.create(olympe.dm.Relation,l).setProperty(olympe.dc.CloudObject.nameProp,c||'').setProperty(olympe.dm.Relation.Mm,d).setProperty(olympe.dm.Relation.zn,k).setProperty(olympe.dm.Relation.Wm,e).setProperty(olympe.dm.Relation.Gn,e).setProperty(olympe.dm.Relation.Vm,f).setProperty(olympe.dm.Relation.Cn,g).setProperty(olympe.dm.Relation.Cr,h);this.Ra(olympe.dc.CloudObject.G,a,c);this.Ra(olympe.dm.Relation.destinationModelRel,
483
+ c,b);this.Ra(olympe.dc.CloudObject.containsRel,a,c);return c}sh(){return!1}Km(a){this.F.push(olympe.D.Ja().C(a))}hb(a,b){a=ge([...this.F,a]);he(this,a,b)}Xm(a){a=ge([...this.F,a]);ie(olympe.dc.gi(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Transaction.la=[olympe.dc.iq];function Ud(a){var b=olympe.dc.gi();const c=a.Z();b.N.set(c,a);a.F.onDestroy(()=>{b.N.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.Ac(c);e=(new Map).set(olympe.dc.$b.VERSION,b.db.version(d)+1).set(e,f);g.uc(d,e,!1,0);olympe.dc.Ad().af(g,olympe.dc.Ga.rb)}}
484
+ function Vd(a,b,c,d){var e=olympe.dc.gi();const f=olympe.dc.$b.VERSION,g=olympe.dc.ga.ka.xh,h=olympe.dc.ga.ka.tl,k=a.Z(),l=a.sh(),n=new Map;for(const q of b.keys()){var p=e.db.source(q);if(p===olympe.dc.Ga.rb)continue;let r=n.get(p);r||(r=new olympe.dc.db.Ac(k),n.set(p,r));p=b.get(q);p.set(f,e.db.version(q)+1);r.uc(q,p,!1,0)}for(const [q,r]of n)b=Ac(new olympe.dc.ga(c?h:g,{Dc:r,sh:l},[q]),a.F),c&&d&&M(b,t=>{t?d(!1,t.message):d(!0,null)}),e.G.send(b)}
485
+ function he(a,b,c){var d=olympe.dc.gi();if(c&&b){const e=a.Z();d.F.set(e,b);ie(d,a,(f,g)=>{f||(d.F.delete(e),b(f,g))},!1)}else ie(d,a,b,!1)}
486
+ function je(a){const b=olympe.dc.ga.ka.Uj;a.G.C(olympe.dc.ga.ka.Kj,(c,d)=>{c=d.id;var e=d.rollback;d=d.error;const f=a.N.get(c);void 0!==f&&(a.N.delete(c),f.Ib(d));olympe.dc.Ad().af(e,olympe.dc.Ga.rb);a.L.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});a.G.C(b,(c,d)=>{c=d.finalize;var e=d.error;(d=(d=a.C.get(d.id))&&d.pop())&&d(c,e)})}
487
+ function ie(a,b,c,d=!1){const e=olympe.D.Ja(),f=c?e.C(c):void 0;c=olympe.dc.Ad();const g=b.Z(),h=new olympe.dc.transaction.Bu(a.db,g);b.C(h);if(h.Tf())f&&f(!0,null);else{a.C.set(g,[]);const k=[],l=[];for(const p of h.versions.keys())Xd(h,p)?k.push(p):l.push(p);const n=Nc(c,e,h.G,k,l);ke(a,h,(p,q,r)=>{q?(le(a,g,k,h.C.size),me(a,h,d,b.sh(),(t,u)=>{t||ne(a,g,u);n(t);p&&p(t);f&&f(t,u)})):(a.L.error(r),ne(a,g,r),n(!1),f&&f(!1,r))})}}
488
+ function ke(a,b,c){const d=[];for(const p of b.versions.keys())a.db.rh(p,olympe.dm.File)&&Xd(b,p)&&d.push(p);if(0===d.length)c(null,!0,null);else{var e=olympe.dm.File.urlProp.R(),f=olympe.dm.File.C.R(),g=olympe.dm.File.modificationDateProp.R(),h=Array.from(b.C.values()),k=[],l=new olympe.async.og(olympe.D.nh()),n=olympe.W.ci();d.forEach(p=>{l.add((q,r)=>{const t=a.db.fb(p,e,!0),u=a.db.fb(p,olympe.dm.File.mimeTypeProp)||'application/data';t.startsWith('blob:')?n.F(t,v=>{n.Y(t);null===v?q():wc(a.Y,
489
+ p,v,u,w=>{const y=h.reduce((B,E)=>B||E.Mf(p),null);null!==y&&(y.va(e,w).va(f,!0),k.push([p,w]));q()},w=>{r(w)})}):(2048<t.length&&a.L.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',p),q())})});Zb(l,(p,q)=>{let r=null;if(p){const t=new olympe.dc.db.Ac;k.forEach(([u,v])=>{const w=new Map;w.set(e,v).set(f,!0).set(g,olympe.D.jb.now());t.uc(u,w,!0,0)});r=Nc(olympe.dc.Ad(),olympe.D.nh(),t,[],[])}c(r,p,q)});l.start()}}
490
+ function le(a,b,c,d){const e=olympe.D.nh(),f=new olympe.async.og(e);0<a.timeout&&Yb(f,a.timeout);const g=a.C.get(b);for(let h=0;h<d;h++)f.add((k,l,n)=>{g.push(e.C((p,q)=>{n.set('final',p);q?l(q):k()}))});Zb(f,(h,k,l)=>{h||a.L.warn(`An error occurred while processing the notification of transaction (${b}): ${k}.`);l.get('final')!==olympe.dc.transaction.sg.C.Xp&&olympe.dc.Ad().persist(c);ne(a,b)});f.start()}
491
+ function me(a,b,c,d,e){b=b.C;if(0===b.size)e(!0,null);else{var f=c?olympe.dc.ga.ka.Ck:olympe.dc.ga.ka.fh;c=(h,k,l,n)=>{h=M(new olympe.dc.ga(f,{Dc:h,sh:d},[k]),p=>{p instanceof Error?n(p.message):l()});a.G.send(h)};var g=new olympe.async.og(olympe.D.nh());for(const [h,k]of b)g.add(c.bind(null,k,h));Zb(g,e);g.start()}}
492
+ function ne(a,b,c){if(void 0!==c){var d;null==(d=a.C.get(b))||d.forEach(e=>{e(olympe.dc.transaction.sg.C.ik,c)})}a.C.delete(b);if(0===a.C.size){for(const e of a.U)e();a.U=[]}a.F.has(b)&&(d=a.F.get(b),a.F.delete(b),d(!0,null))}function oe(a,b){0<a.C.size?a.U.push(olympe.D.Ja().C(b)):b()}olympe.dc.transaction.sg=class{constructor(a,b,c,d,e){this.L=a;this.db=b;this.G=c;this.Y=d;this.timeout=e;this.N=new Map;this.C=new Map;this.U=[];this.F=new Map;je(this)}Xa(){return this.L}};
493
+ olympe.dc.transaction.sg.C={ik:0,Wp:1,Xp:2};olympe.dc.transaction.P={Ea:'dc.transaction.Logger',xa:'dc.transaction.Manager'};olympe.dc.transaction.Config={TIMEOUT:'dc.transaction.timeout',Yn:'dc.transaction.burstInterval'};
494
+ olympe.T.config(function(a){D(a,olympe.dc.transaction.Config.TIMEOUT,6E4);D(a,olympe.dc.transaction.Config.Yn,30);C(a,olympe.dc.transaction.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc'));A(a,olympe.dc.transaction.P.xa,olympe.dc.transaction.sg,olympe.dc.transaction.P.Ea,olympe.dc.P.xi,olympe.dc.P.ne,olympe.dc.P.Ai,new olympe.T.fa(olympe.dc.transaction.Config.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.ua={};function W(a){return olympe.dc.wa(a)}function pe(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.bb(e));return c}olympe.dc.transaction.ua.Qg=class{C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}bb(a){a=olympe.D.bb(a);return void 0===a||null===a?null:olympe.D.cs(a)?a.valueOf():a}};olympe.dc.transaction.ua.Qg.la=[olympe.dc.iq];olympe.dc.transaction.ua.Wd=class extends olympe.dc.transaction.ua.Qg{constructor(a,b){super();this.tag=void 0!==b?b:olympe.W.hc();this.model=a;this.F=new Map;this.G=!0;this.F.set(olympe.dc.$b.VERSION,1)}R(){return W(this.tag)}Tb(){return W(this.model)}persist(a){this.G=a;return this}mi(a){this.F.set(olympe.dc.$b.Jd,a);return this}Ex(){this.F.set(olympe.dc.$b.Jd,olympe.dc.Ga.rb)}setProperty(a,b){this.F.set(olympe.dc.wa(a),b);return this}hl(a){this.setProperty(olympe.dc.CloudObject.nameProp.R(),a);
495
+ return this}C(a){const b=olympe.dc.Oa(),c=this.Tb(),d=this.R();if(void 0===c)throw Error('OperationError: Cannot create instance, model tag is undefined');var e=olympe.dc.$b.Jd;if(!this.F.has(e)){var f=b.source(c);this.F.set(e,null!==f?f:olympe.dc.Ga.kc)}if(b.Eb(d)&&!b.Xf(d)&&this.G){e=new Map([...b.kd(d,!0),...pe(this,this.F)]);for(const g of e.values())g instanceof olympe.dc.Jc&&!Xd(a,g.R())&&(f=new olympe.dc.Transaction,f.xj(g.R()),f.C(a));Yd(a,d,this.G,e);a.Ra(olympe.dc.CloudObject.modelRel.R(),
496
+ d,c);for(const [g,h,k]of Ed(b,d))Xd(a,k)&&(h===olympe.dc.Aa.ORIGIN?a.Ra(g,k,d):a.Ra(g,d,k))}else b.Eb(d)||(Yd(a,d,this.G,pe(this,this.F)),a.Ra(olympe.dc.CloudObject.modelRel.R(),d,c))}toString(){return`CreateInstance(${this.Tb()}, ${this.R()})`}};olympe.dc.transaction.ua.Wd.prototype.setProperty=olympe.dc.transaction.ua.Wd.prototype.setProperty;olympe.dc.transaction.ua.Wd.prototype.localSource=olympe.dc.transaction.ua.Wd.prototype.Ex;olympe.dc.transaction.ua.Wd.prototype.persist=olympe.dc.transaction.ua.Wd.prototype.persist;
497
+ olympe.dc.transaction.ua.Wd.prototype.getModelTag=olympe.dc.transaction.ua.Wd.prototype.Tb;olympe.dc.transaction.ua.Wd.prototype.getTag=olympe.dc.transaction.ua.Wd.prototype.R;olympe.dc.transaction.ua.Wd.la=[olympe.dc.Ae];olympe.dc.transaction.ua.ro=class extends olympe.dc.transaction.ua.Qg{constructor(a,b,c){super();this.type=a.Pa?a:new olympe.dc.X.Sb(W(a));this.F=b;this.G=c}Pa(){return this.bb(this.type).Pa()}C(a){const b=W(this.type);if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.lc.Xc)throw Error('OperationError: Cannot create the instance -> model relation');const c=W(this.F);if(''===c)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
498
+ const d=W(this.G);if(''===d)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.Pa()===olympe.dc.Aa.DESTINATION?a.Ra(b,c,d):a.Ra(b,d,c)}toString(){return`CreateRelation('${this.Pa()}${W(this.type)}, ${W(this.F)}, ${W(this.G)})`}};olympe.dc.transaction.ua.rz=class extends olympe.dc.transaction.ua.Qg{constructor(a,b=olympe.dc.Ub.Hc){super();this.model=a;this.F=b}Tb(){return W(this.model)}C(a){const b=this.Tb();if(void 0===b)throw Error('OperationError: Cannot delete instances of model, model is undefined');const c=olympe.dc.Oa();for(const d of c.ee(b))d!==b&&(new olympe.dc.transaction.ua.Rj(d,this.F)).C(a)}toString(){return`DeleteAllInstances(${this.Tb()}, ${this.F})`}};olympe.dc.transaction.ua.Zs=class extends olympe.dc.transaction.ua.Qg{constructor(a,b,c,d){super();this.F=a.Pa?a:new olympe.dc.X.Sb(W(a));this.G=b;this.N=c||!1;this.U=d instanceof Array?d.map(e=>W(e)):null}Pa(){return this.bb(this.F).Pa()}C(a){const b=W(this.F);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.lc.Xc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.G);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');
499
+ var d=olympe.dc.Oa();const e=this.Pa(),f=this.U;d=d.tb(c,this.F);for(const g of d)e===olympe.dc.Aa.DESTINATION?a.fc(b,c,g):a.fc(b,g,c),null!==f&&0<=f.indexOf(g)||this.N&&(new olympe.dc.transaction.ua.Rj(g,olympe.dc.Ub.Hc)).C(a)}toString(){return`DeleteAllRelations(${this.Pa()}${W(this.F)}, ${W(this.G)}, ${this.N})`}};olympe.dc.transaction.ua.Rj=class extends olympe.dc.transaction.ua.Qg{constructor(a,b=olympe.dc.Ub.Hc){super();this.tag=a;this.F=b}R(){return W(this.tag)}C(a){const b=olympe.dc.Oa(),c=this.R();if(void 0===c)throw Error('OperationError: Cannot delete instance, tag is undefined');const d=b.model(c);0<=b.version(c)&&d&&a.Mc(c,this.F)}toString(){return'DeleteInstance('+this.R()+', '+this.F+')'}};olympe.dc.transaction.ua.$s=class extends olympe.dc.transaction.ua.ro{constructor(a,b,c,d=!1){super(a,b,c);this.N=d}C(a){const b=W(this.type);if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.lc.Xc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=W(this.F);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=W(this.G);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
500
+ this.Pa()===olympe.dc.Aa.DESTINATION?a.fc(b,c,d):a.fc(b,d,c);this.N&&(new olympe.dc.transaction.ua.Rj(d,olympe.dc.Ub.Hc)).C(a)}toString(){return'DeleteRelation('+this.Pa()+W(this.type)+', '+W(this.F)+', '+W(this.G)+', '+this.N+')'}};olympe.dc.transaction.ua.Ui=class extends olympe.dc.transaction.ua.Qg{constructor(a,b,c){super();this.tag=a;this.F=new Map;this.F.set(olympe.dc.$b.VERSION,-1);void 0!==b&&this.setProperty(b,c)}R(){return W(this.tag)}setProperty(a,b){this.F.set(W(a),b);return this}C(a){const b=this.R();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');const c=olympe.dc.Oa();var d=c.version(b),e=a.versions.get(b);e=void 0!==e?e:d;if(null===e)throw Error('OperationError: Instance #'+
501
+ b+' not found so it cannot be updated');d=pe(this,this.F);0>=d.get(olympe.dc.$b.VERSION)&&d.set(olympe.dc.$b.VERSION,e+1);for(const [f,g]of d)e=c.fb(b,f),e instanceof olympe.dc.Jc&&(e=e.R(),a.Y[e]=!0),g instanceof olympe.dc.Jc&&!Xd(a,g.R())&&(e=new olympe.dc.Transaction,e.xj(g.R()),e.C(a));a.uc(b,d)}toString(){return'UpdateInstance('+this.R()+', '+pe(this,this.F)+')'}};olympe.dc.transaction.ua.Ui.prototype.setProperty=olympe.dc.transaction.ua.Ui.prototype.setProperty;
502
+ olympe.dc.transaction.ua.Ui.prototype.getTag=olympe.dc.transaction.ua.Ui.prototype.R;olympe.dc.ba={};olympe.dc.Ae=class{R(){}};olympe.dc.Ae.prototype.getTag=olympe.dc.Ae.prototype.R;olympe.dc.fA=olympe.dc.Ae;olympe.dc.ba.mk={ASC:'ASC',DESC:'DESC'};function qe(a){switch(a.pr){case 1:const c=a.v;switch(a.t){case 1:var b=c;break;case 2:b=new Date(c);break;case 3:b=olympe.dc.CloudObject.get(c);break;case 4:b=new olympe.D.Color(c.r,c.g,c.b,c.a)}return new olympe.dc.ba.V.Ic(a.p,b,olympe.dc.Oa());case 2:return new olympe.dc.ba.V.Wc(a.p,a.s,olympe.dc.Oa(),a.c);case 3:return new olympe.dc.ba.V.Dh(a.p,a.b,a.l,a.s);case 4:return new olympe.dc.ba.V.nd(qe(a.v));case 5:return new olympe.dc.ba.V.wd(a.p,new RegExp(a.r),olympe.dc.Oa(),a.c);case 6:b=new olympe.dc.ba.V.Ee(a.d);
503
+ for(const [d,e,f]of a.r)a=new olympe.dc.query.Relation(d,e,f),f?b.Pk(a):b.sb(a);return b;case 7:return new olympe.dc.ba.V.ae(...a.p.map(d=>qe(d)));case 8:return new olympe.dc.ba.V.Ud(...a.p.map(d=>qe(d)));default:return null}}
504
+ olympe.dc.ba.$a=class{observe(){}hb(){}clear(){}ja(){}toString(){}static qb(a,b){return new olympe.dc.ba.V.Ic(a,b,olympe.dc.Oa())}static contains(a,b,c=!1){return new olympe.dc.ba.V.Wc(a,b,olympe.dc.Oa(),c)}static js(a,b,c=!0){return new olympe.dc.ba.V.wd(a,b,olympe.dc.Oa(),c)}static Wk(a,b,c=!0){return new olympe.dc.ba.V.Dh(a,b,!1,c)}static Bj(a,b,c=!0){return new olympe.dc.ba.V.Dh(a,b,!0,c)}static and(...a){return new olympe.dc.ba.V.Ud(...a)}static or(...a){return new olympe.dc.ba.V.ae(...a)}static not(a){return new olympe.dc.ba.V.nd(a)}};
505
+ olympe.dc.ba.$a.not=olympe.dc.ba.$a.not;olympe.dc.ba.$a.or=olympe.dc.ba.$a.or;olympe.dc.ba.$a.and=olympe.dc.ba.$a.and;olympe.dc.ba.$a.smallerThan=olympe.dc.ba.$a.Bj;olympe.dc.ba.$a.greaterThan=olympe.dc.ba.$a.Wk;olympe.dc.ba.$a.regex=olympe.dc.ba.$a.js;olympe.dc.ba.$a.contains=olympe.dc.ba.$a.contains;olympe.dc.ba.$a.equals=olympe.dc.ba.$a.qb;function re(a,b){return new olympe.dc.gb(a.G,a.source,b,a.F,{max:a.max,offset:a.offset})}function se(a){return a.C.filter(b=>b instanceof olympe.dc.ba.Hb.jf||b instanceof olympe.dc.ba.Hb.kf).length}
506
+ function te(a){const b=olympe.dc.ba.Hb.Ph,c=olympe.dc.ba.Hb.jf,d=olympe.dc.ba.Hb.kf,e=0===a.F.size?a.Yi():a;let f=-1;a.C.reduce((g,h)=>{h instanceof b&&(f=g);return h instanceof c||h instanceof d?g+1:g},0);if(0<=f&&!e.F.has(f))throw Error('AndReturn was not called for the current level before sortBy operator');return e}
507
+ function ue(a,b){const c=olympe.dc.Ed.SUBSCRIBE,d=olympe.dc.Ed.Ni,e=new olympe.dc.lf(a.G,b?c:d);for(const f of a.C)f instanceof olympe.dc.ba.Hb.jf?e.sb(f.Qd()):f instanceof olympe.dc.ba.Hb.kf?e.sb(f.Qd(),!0):f instanceof olympe.dc.ba.Hb.vc&&(a=f.C,a instanceof olympe.dc.ba.V.Ee&&(a=a.ld(),a.forEach(g=>e.sb(g)),ve(e,a.length)));return e}function we(a){return a.source||a.db.source(a.G)||olympe.dc.Ga.kc}
508
+ function xe(a){return new olympe.dc.gb(a.r,a.s,a.qp.map(b=>ye(b)),new Set(a.lv),{max:a.lp.m,offset:a.lp.o})}
509
+ olympe.dc.gb=class{constructor(a,b=null,c=[],d=new Set,e={max:-1,offset:0}){this.db=olympe.dc.Oa();this.G=olympe.dc.wa(a);this.source=b;this.C=c;this.F=d;this.max=-1===e.max?-1:e.max;this.offset=e.offset;this.id=null}static from(a,b){return new olympe.dc.gb(a,b)}static Yk(a,b=olympe.dc.Ga.kc){return(new olympe.dc.gb(a,b)).sb(olympe.dc.CloudObject.instancesRel)}sb(a){const b=Array.from(this.C);b.push(new olympe.dc.ba.Hb.jf(this.db,a));return re(this,b)}hw(a,b=!1){const c=Array.from(this.C);c.push(new olympe.dc.ba.Hb.kf(this.db,
510
+ a,b));return re(this,c)}Yi(){this.F.add(se(this));return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:this.max,offset:this.offset})}filter(a){const b=Array.from(this.C);b.push(new olympe.dc.ba.Hb.vc(a));return re(this,b)}aj(){return this}limit(a,b=0){return new olympe.dc.gb(this.G,this.source,this.C,this.F,{max:a,offset:b})}kl(a,b=olympe.dc.ba.mk.ASC){const c=Array.from(this.C);c.push(new olympe.dc.ba.Hb.Ph(this.db,a,b));return re(this,c)}hb(a){return ze(olympe.dc.Of(),te(this),'function'===
511
+ typeof a.xc?a.xc():a)}observe(a){return Ae(olympe.dc.Of(),te(this),'function'===typeof a.xc?a.xc():a)}jd(){var a=te(this);return olympe.dc.Of().U.jd(a)}Z(){null===this.id&&(this.id=olympe.W.mb(this.G+this.C.reduce((a,b)=>a+b.toString(),'')+Array.from(this.F).toString()+this.offset+this.max));return this.id}ja(){return{r:this.G,qp:this.C.map(a=>a.ja()),lv:Array.from(this.F),s:this.source,lp:{m:this.max,o:this.offset}}}};olympe.dc.gb.prototype.executeFromCache=olympe.dc.gb.prototype.jd;
512
+ olympe.dc.gb.prototype.observe=olympe.dc.gb.prototype.observe;olympe.dc.gb.prototype.execute=olympe.dc.gb.prototype.hb;olympe.dc.gb.prototype.sortBy=olympe.dc.gb.prototype.kl;olympe.dc.gb.prototype.limit=olympe.dc.gb.prototype.limit;olympe.dc.gb.prototype.cast=olympe.dc.gb.prototype.aj;olympe.dc.gb.prototype.filter=olympe.dc.gb.prototype.filter;olympe.dc.gb.prototype.andReturn=olympe.dc.gb.prototype.Yi;olympe.dc.gb.prototype.followRecursively=olympe.dc.gb.prototype.hw;
513
+ olympe.dc.gb.prototype.follow=olympe.dc.gb.prototype.sb;olympe.dc.gb.instancesOf=olympe.dc.gb.Yk;olympe.dc.gb.from=olympe.dc.gb.from;function ye(a){const b=olympe.dc.Oa();switch(a.t){case 1:return(a=qe(a.p))?new olympe.dc.ba.Hb.vc(a):null;case 2:return new olympe.dc.ba.Hb.jf(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!1));case 3:var c=a.s;return new olympe.dc.ba.Hb.kf(b,new olympe.dc.query.Relation(a.r.t,a.r.d,!0),c);case 4:return c=a.o,new olympe.dc.ba.Hb.Ph(b,new olympe.dc.ta.Property(a.p),c);default:return null}}olympe.dc.ba.pk=class{ja(){}F(){}hb(){}observe(){}toString(){}};function Be(a){return a.G.map(b=>a.F.get(a.C[b]))}function Ce(a){return a.N.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function De(a){a=Array.from(a.F.values()).flat();return new Set(a.map(b=>b.R()))}function Ee(a){return new Set(a.N.flatMap(b=>b.split('.')))}
514
+ function Fe(a,b){var c=olympe.dc.Oa();if(c.Eb(a)){b.F(a,c.kd(a,!0),0);b.Ra(olympe.dc.lc.Xc,a,c.model(a),0);for(const [d,e,f]of Ed(c,a))(c=b.Mf(f))&&c.se()&&(e===olympe.dc.Aa.DESTINATION?b.Ra(d,a,f,0):b.Ra(d,f,a,0))}else olympe.ra.Xa('Query Result').error(`Fail to serialize instance with tag ${a} not present in local DBView`)}
515
+ function Ge(a,b,c=olympe.dc.Ga.Pc){b&&b((new olympe.dc.W.Mi(c)).C(a.p||[]));const d=olympe.dc.Oa();let e=!1;b=a.k.map(f=>{const g=f.split('.').map(h=>d.Eb(h)?olympe.dc.CloudObject.get(h):(olympe.ra.Xa('QueryResult').error(`CloudObject with tag ${h} not present but required for deserialization`),e=!0,null));return[f,1===g.length?g[0]:g]});return e?null:olympe.dc.Va.create(b,a.a,a.r)}
516
+ olympe.dc.Va=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.N=[];this.hash=''}static empty(){return new olympe.dc.Va}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}ff(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.ff().includes(a)}indexOf(a){return null===
517
+ a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.ff().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Sc(){return this.re(0)}re(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.ff();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.ff();a.pop();return a}shift(){if(0<this.C.length){const a=this.ff();a.shift();return a}return[]}filter(a){return this.ff().filter(a)}find(a){return(a=this.ff().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
518
+ a(this.F.get(b),c))}map(a){return this.ff().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Va.create(b,Array.from(this.G),Array.from(this.N))}reduce(a,b){return this.ff().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.N.concat(...a.map(d=>d.N));return olympe.dc.Va.create(b,c,a)}static from(a,b){const c=olympe.dc.Oa();var d=He(b);if(b.Md){const {kb:k,
519
+ order:l,Md:n,Lv:p}=b.Md,q=Array.from(b.G).sort().indexOf(p),r=l===olympe.dc.ba.mk.ASC?1:-1;d.sort((t,u)=>{u=u[q];t=c.fb(t[q],k);u=c.fb(u,k);return null===t?-r:null===u?r:r*n(t,u)})}else d.sort((k,l)=>k.reduce((n,p,q)=>n||p.localeCompare(l[q]),0));0<b.offset&&(d=d.slice(b.offset));-1<b.max&&(d=d.slice(0,b.max));b=olympe.W.mb(d.flat().join(''));if(b===a.hash)return a;d=d.map(k=>[k.join('.'),1===k.length?olympe.dc.CloudObject.get(k[0]):k.map(l=>olympe.dc.CloudObject.get(l))]);const e=new Set(d.map(k=>
520
+ k[0])),f=new Set(a.keys()),g=[],h=[];d.forEach(([k],l)=>{!f.has(k)&&g.push(l)});f.forEach(k=>{!e.has(k)&&h.push(k)});return olympe.dc.Va.create(d,g,h,b)}static create(a,b,c,d){const e=new olympe.dc.Va;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.W.mb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.N=c||[];return e}ja(){const a=new olympe.dc.db.Ac;var b=new Set(this.G.flatMap(c=>this.C[c].split('.')));for(const c of b)Fe(c,a);b=new olympe.dc.transaction.vd;a.Qc(b);return{k:this.C,p:de(b),a:this.G,r:this.N}}};
520
521
  olympe.dc.Va.prototype.concat=olympe.dc.Va.prototype.concat;olympe.dc.Va.prototype.reduce=olympe.dc.Va.prototype.reduce;olympe.dc.Va.prototype.sort=olympe.dc.Va.prototype.sort;olympe.dc.Va.prototype.map=olympe.dc.Va.prototype.map;olympe.dc.Va.prototype.forEach=olympe.dc.Va.prototype.forEach;olympe.dc.Va.prototype.find=olympe.dc.Va.prototype.find;olympe.dc.Va.prototype.filter=olympe.dc.Va.prototype.filter;olympe.dc.Va.prototype.shift=olympe.dc.Va.prototype.shift;olympe.dc.Va.prototype.pop=olympe.dc.Va.prototype.pop;
521
- olympe.dc.Va.prototype.push=olympe.dc.Va.prototype.push;olympe.dc.Va.prototype.getAt=olympe.dc.Va.prototype.qe;olympe.dc.Va.prototype.getFirst=olympe.dc.Va.prototype.Sc;olympe.dc.Va.prototype.get=olympe.dc.Va.prototype.get;olympe.dc.Va.prototype.indexOf=olympe.dc.Va.prototype.indexOf;olympe.dc.Va.prototype.has=olympe.dc.Va.prototype.has;olympe.dc.Va.prototype.size=olympe.dc.Va.prototype.size;olympe.dc.Va.prototype.toArray=olympe.dc.Va.prototype.ef;olympe.dc.Va.prototype.keys=olympe.dc.Va.prototype.keys;
522
- olympe.dc.Va.prototype.values=olympe.dc.Va.prototype.values;olympe.dc.Va.prototype.entries=olympe.dc.Va.prototype.entries;olympe.dc.Va.empty=olympe.dc.Va.empty;function De(a){var b=new Set(X(a,a.Ag()-1).keys());a.C.push((new Map).set('sink',b));b=[];for(const c of Ee(a,'sink',a.Ag()-1,''))b.push(c.slice(0,-1).split(';'));a.C.pop();return b}function Fe(a,b,c,d,e){a.Md={Md:b,Iv:c,order:d,kb:e}}function Ge(a){a.F||(a.F=!0)}function X(a,b){return b>=a.Ag()?new Map:a.C[b]}
523
- function Ee(a,b,c,d){if(0===c)return a.G.has(c)?(b=Array.from(X(a,0).keys())[0],(new Set).add(`${b};${d}`)):(new Set).add(d);const e=He(a,b,c),f=a.G.has(c)?`${b};${d}`:d;return e.reduce((g,h)=>{for(const k of Ee(a,h,c-1,f))g.add(k);return g},new Set)}function He(a,b,c){return 0===c?null:(a=X(a,c))&&a.has(b)?Array.from(a.get(b)):null}function Ie(a,b,c,d){X(a,c+1).forEach((e,f)=>{e.has(d)&&a.remove(f,c+1,b)});X(a,c).delete(d);Ge(a)}
524
- olympe.dc.ba.rq=class{constructor(a){this.C=Array.from({length:oe(a)+1},()=>new Map);this.G=new Set(Array.from(a.F));this.Md=null;this.F=!1;this.max=a.max;this.offset=a.offset}Ag(){return this.C.length}insert(a,b,c){var d=X(this,b);if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.ra.Xa('dc').error('Try to insert result entry linked to a non existing parent'),null;if(d.has(a)&&null!==c)return a=d.get(a),d=a.size,a.add(c),a.size>d&&Ge(this),!1;if(b>=this.Ag())return olympe.ra.Xa('dc').error('Try to insert result entry to a higher level than possible'),
525
- null;b=new Set;null!==c&&b.add(c);d.set(a,b);Ge(this);return!0}remove(a,b,c){var d=X(this,b);if(!d.has(a))return!0;if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.ra.Xa('dc').error('Try to remove result entry linked to a non existing parent'),null;d=d.get(a);c&&d.delete(c);if(1>d.size)return Ie(this,a,b,a),!0;Ge(this);return!1}};olympe.dc.od=class{constructor(a){this.query=a}static from(a){return new olympe.dc.od(olympe.dc.gb.from(a))}sb(a){return new olympe.dc.od(this.query.sb(a))}Zi(){return this}hb(a){return this.query.hb(a).then(b=>{const c=b.size();return 1<c?(olympe.ra.Xa('dc').warn('a follow() on a QuerySingle has '+c+' results (0 or 1 expected) -> returns null'),null):b.Sc()||null})}jd(){const a=this.query.jd(),b=a.size();return 1<b?(olympe.ra.Xa('dc').warn('a follow() on a QuerySingle has '+b+' results (0 or 1 expected) -> returns null'),
526
- null):a.Sc()||null}};olympe.dc.od.prototype.executeFromCache=olympe.dc.od.prototype.jd;olympe.dc.od.prototype.execute=olympe.dc.od.prototype.hb;olympe.dc.od.prototype.cast=olympe.dc.od.prototype.Zi;olympe.dc.od.prototype.follow=olympe.dc.od.prototype.sb;olympe.dc.ba.V={};olympe.dc.ba.V.Ud=class{constructor(...a){this.V=a}hb(a){return this.V.reduce((b,c)=>b&&c.hb(a),!0)}observe(a,b,c){const d=this.V.map(()=>!1),e=this.V.map(()=>null),f=(g,h)=>{d[h]=g;g=d.every(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.mb('AND-'+b+a+h),k=>f(k,h))})}ia(){return{pr:8,p:this.V.map(a=>a.ia())}}toString(){return'And-'+this.V.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.mb('AND-'+b+a+d))})}};
527
- olympe.dc.ba.V.Ud.C=8;olympe.dc.ba.V.Ud.la=[olympe.dc.ba.$a];olympe.dc.ba.V.Wc=class{constructor(a,b,c,d=!1){this.kb=olympe.dc.wa(a);this.substring=b;this.db=c;this.C=d}fb(){return this.kb}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){wd(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.kb+'-'+this.substring+'-'+this.C}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+
528
- a+this.toString()))}ia(){return{pr:2,p:this.kb,s:this.substring,c:this.C}}};olympe.dc.ba.V.Wc.C=2;olympe.dc.ba.V.Wc.la=[olympe.dc.ba.$a];olympe.dc.ba.V.Ic=class{constructor(a,b,c){this.kb=olympe.dc.wa(a);this.C=b;this.db=c}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){wd(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.qb(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.qb(this.C):!1:a===
529
- this.C}toString(){return'Equals-'+this.kb+'-'+this.C.toString()}fb(){return this.kb}ia(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.R();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.Qf().valueOf(),g:this.C.Kf().valueOf(),b:this.C.Ff().valueOf(),a:this.C.Ef().valueOf()}}return{pr:1,p:this.kb,t:a,v:b}}};olympe.dc.ba.V.Ic.C=1;olympe.dc.ba.V.Ic.la=[olympe.dc.ba.$a];function Je(a,b,c){return null===b?!1:null===c?!0:a.G?a.F?b<c:b>c:a.F?b<=c:b>=c}function Ke(a,b){return'number'===typeof a.C?a.C:a.db.fb(b,a.C)}function Le(a,b,c){return olympe.W.mb(c+b+a.C+a.kb)}
530
- olympe.dc.ba.V.Ch=class{constructor(a,b,c=!0,d=!0){this.db=olympe.dc.Oa();this.kb=olympe.dc.wa(a);this.C='number'===typeof b?b:olympe.dc.wa(b);this.F=c;this.G=d}fb(){return this.kb}hb(a){return Je(this,this.db.fb(a,this.kb),Ke(this,a))}observe(a,b,c){'string'===typeof this.C&&wd(this.db,a,this.C,d=>{const e=this.db.fb(a,this.kb);null!==e&&c(Je(this,e,d))},Le(this,a,b));wd(this.db,a,this.kb,d=>{const e=Ke(this,a);c(null!==e?Je(this,d,e):!0)},Le(this,a,b))}clear(a,b){this.db.F(a,this.kb,Le(this,a,b));
531
- 'string'===typeof this.C&&this.db.F(a,this.C,Le(this,a,b))}ia(){return{pr:3,p:this.kb,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.kb+'-'+this.G+'-'+this.C}};olympe.dc.ba.V.Ch.C=3;olympe.dc.ba.V.Ch.la=[olympe.dc.ba.$a];olympe.dc.ba.V.nd=class{constructor(a){this.C=a}hb(a){return!this.C.hb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.W.mb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}ia(){return{pr:4,v:this.C.ia()}}toString(){return`NOT-${this.C.toString()}`}clear(a,b){this.C.clear(a,olympe.W.mb('NOT'+b+a))}};olympe.dc.ba.V.nd.C=4;olympe.dc.ba.V.nd.la=[olympe.dc.ba.$a];olympe.dc.ba.V.ae=class{constructor(...a){this.V=a}hb(a){return this.V.reduce((b,c)=>b||c.hb(a),!1)}observe(a,b,c){const d=this.V.map(()=>!1),e=this.V.map(()=>null),f=(g,h)=>{d[h]=g;g=d.some(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.mb('OR-'+b+a+h),k=>f(k,h))})}ia(){return{pr:7,p:this.V.map(a=>a.ia())}}toString(){return'And-'+this.V.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.mb('OR-'+b+a+d))})}};
532
- olympe.dc.ba.V.ae.C=7;olympe.dc.ba.V.ae.la=[olympe.dc.ba.$a];olympe.dc.ba.V.wd=class{constructor(a,b,c,d=!0){this.kb=olympe.dc.wa(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}fb(){return this.kb}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){wd(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.kb+'-'+this.C.toString()+'-'+this.F}ia(){return{pr:5,
533
- p:this.kb,r:this.C.source,c:this.F}}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+a+this.toString()))}};olympe.dc.ba.V.wd.C=5;olympe.dc.ba.V.wd.la=[olympe.dc.ba.$a];olympe.dc.ba.V.De=class{constructor(a){this.db=olympe.dc.Oa();this.La=[];this.recursive=[];this.destination=a?olympe.dc.wa(a):null}ld(){return Array.from(this.La)}clear(a,b){0<this.La.length&&this.db.C(a,this.La[0],olympe.W.mb(b+0+a))}sb(a){this.La.push(a);this.recursive.push(!1);return this}Ok(a){this.La.push(a);this.recursive.push(!0);return this}hb(a){if(1>this.La.length)return olympe.ra.Xa('dc').error('RelatedTo executed with less than 1 relation'),!1;let b=[];const c=this.destination||'',d=(e,
534
- f,g,h)=>e?f?this.db.Pf(g,h,c):this.db.Pf(g,h):this.db.tb(g,h);for(let e=0;e<this.La.length;++e){const f=this.La[e],g=this.recursive[e],h=e===this.La.length-1;if(0===e)b=d(g,h,a,f);else if(b=b.flatMap(k=>d(g,h,k,f)),0===b.length)return!1}return c?b.includes(c):0<b.length}observe(a,b,c){const d=this.La.length;let e=0;const f=new Set,g=(k,l)=>{this.destination&&this.destination!==l||(e+=k?1:-1,1<e||c(0<e))},h=(k,l,n,p)=>{const q=this.La[k],r=this.recursive[k-1]?this.La[k-1]:null;l=olympe.W.mb(l+k+p);
535
- const t=olympe.W.mb(l+'rec');k===d?g(n,p):n?f.has(p)||(f.add(p),V(this.db,p,q,h.bind(this,k+1,l),l),r&&V(this.db,p,r,h.bind(this,k,t),t)):(f.delete(p),this.db.C(p,q,l),r&&this.db.C(p,r,t))};h(0,b,!0,a);0===e&&c(!1)}ia(){return{pr:6,r:this.La.map((a,b)=>[a.R(),a.Pa(),this.recursive[b]]),d:this.destination}}toString(){const a=this.La.reduce((b,c,d)=>b+c.R()+this.recursive[d],'');return`RelatedTo-${this.destination}-${a}`}};olympe.dc.ba.V.De.prototype.followRecursive=olympe.dc.ba.V.De.prototype.Ok;
536
- olympe.dc.ba.V.De.prototype.follow=olympe.dc.ba.V.De.prototype.sb;olympe.dc.ba.V.De.C=6;olympe.dc.ba.V.De.la=[olympe.dc.ba.$a];olympe.dc.ba.Hb={};olympe.dc.ba.Hb.vc=class{constructor(a){this.C=a}F(a){return a}hb(a,b){for(const c of X(a,b).keys())this.C.hb(c)||(0===b?a.remove(c,b,null):He(a,c,b).forEach(d=>{a.remove(c,b,d)}))}observe(a,b,c){let d=!1;return(e,f,g,h)=>{const k=olympe.W.mb(h+f+this.toString());e?this.C.observe(f,k,l=>{d||(l?a.insert(f,b,g):a.remove(f,b,g),c(l,f,g,k))}):(d=!0,this.C.clear(f,k),d=!1,c(!1,f,g,k))}}ia(){return{t:1,p:this.C.ia()}}toString(){return'filterQueryPart-'+this.C.toString()}};olympe.dc.ba.Hb.vc.C=1;
537
- olympe.dc.ba.Hb.vc.la=[olympe.dc.ba.nk];olympe.dc.ba.Hb.hf=class{constructor(a,b){this.db=a;this.C=b}Qd(){return this.C}F(a){return a+1}hb(a,b){for(const c of X(a,b).keys())this.db.tb(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){return(d,e,f,g)=>{const h=olympe.W.mb(g+e+this.toString());d?V(this.db,e,this.C,(k,l)=>{(k?a.insert(l,b+1,e):a.remove(l,b+1,e))&&c(k,l,e,h)},h):this.db.C(e,this.C,h)}}ia(){return{t:2,r:{t:this.C.R(),d:this.C.Pa()}}}toString(){return'followQueryPart-'+this.C.Pa()+this.C.R()}};olympe.dc.ba.Hb.hf.C=2;
538
- olympe.dc.ba.Hb.hf.la=[olympe.dc.ba.nk];olympe.dc.ba.Hb.jf=class{constructor(a,b,c=!1){this.db=a;this.C=b;this.G=c}Qd(){return this.C}F(a){return a+1}hb(a,b){for(const c of X(a,b).keys())this.G&&a.insert(c,b+1,c),this.db.Pf(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){const d=(g,h,k,l)=>olympe.W.mb(g+h+k+l+this.toString()),e=new Set,f=(g,h,k,l,n)=>{h=d(h,g,n,k);(this.G||0<k)&&(l?a.insert(n,b+1,g):a.remove(n,b+1,g))&&c(l,n,g,h);l?e.has(n)||(e.add(n),V(this.db,n,this.C,f.bind(this,g,h,k+1),h)):(e.delete(n),this.db.C(n,this.C,
539
- h))};return(g,h,k,l)=>f(h,l,0,g,h)}ia(){return{t:3,s:this.G,r:{t:this.C.R(),d:this.C.Pa()}}}toString(){return'followRecursivelyQueryPart-'+this.C.Pa()+this.C.R()}};olympe.dc.ba.Hb.jf.C=3;olympe.dc.ba.Hb.jf.la=[olympe.dc.ba.nk];function Me(a){a=a.db.hc(a.kb,olympe.dm.Property.typeRel);const b=olympe.dc.wa;if(a===b(olympe.dm.String))return Ne((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Ne((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Ne((c,d)=>c.getTime()-d.getTime());olympe.ra.Xa('dc').warn(`No comparator found for type with tag ${a}`);return Ne(()=>-1)}function Ne(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
540
- olympe.dc.ba.Hb.Nh=class{constructor(a,b,c){this.db=a;this.kb=b;this.order=c}F(a){return a}hb(a,b){Fe(a,Me(this),b,this.order,this.kb)}observe(a,b,c){Fe(a,Me(this),b,this.order,this.kb);return(d,e,f,g)=>{g=olympe.W.mb(g+this.toString());d?wd(this.db,e,this.kb,()=>{Ge(a)},g):this.db.F(e,this.kb,g);c(d,e,f,g)}}ia(){return{t:4,p:this.kb.R(),o:this.order}}toString(){return'sortByQueryPart-'+this.order+this.kb.R()}fb(){return this.kb}};olympe.dc.ba.Hb.Nh.C=4;olympe.dc.ba.Hb.Nh.la=[olympe.dc.ba.nk];olympe.dc.query={};function Oe(a,b,c,d){let e=a.C.get(b);void 0===e&&(e=new Set,a.C.set(b,e));a=olympe.W.fc();e.add(a);d.set(a,c)}function Pe(a,b,c){Oe(a,b,c,a.F)}function Qe(a,b,c){if(a.C.has(b)){for(const d of a.C.get(b))c.delete(d);a.C.delete(b)}}function Re(a,b,c,d,e){if(a.C.has(b)){if(!a.L.has(b)){a.L.add(b);for(const f of a.C.get(b))e=d.get(f),d.delete(f),c instanceof olympe.dc.query.errors.Xj?e(Error(c.aa()),c):'string'===typeof c?e(Error(c),null):e(null,c);a.C.delete(b);a.L.delete(b)}}else a.N.warn(e)}
541
- function Se(a,b,c){Re(a,b,c,a.F,`Graph result of graphdef ${b} has no associated handler in the datacloud`)}function Te(a,b,c){Oe(a,b,c,a.G)}olympe.dc.query.Ks=class{constructor(a){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.L=new Set}};olympe.dc.Ne=class{ma(){}L(){}G(){}U(){}ia(){}toString(){}};olympe.dc.Ed={SUBSCRIBE:0,Li:1,nm:2,hB:0,GET:1};olympe.dc.Ed.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Ed))if(c===a)return b;return null};function re(a,b=1){a.validate(olympe.dc.Ub.NONE,'back');let c=a.Y;for(let d=0;d<b&&null!==c;d++)c=a.F.get(c.F)||null;a.Y=c}function Ue(a){return'not_defined'===a.C?olympe.dc.Ub.NONE:a.C}function Ve(a,b){a.validate(b,'activateFollowRules');return a}function We(a){return'not_defined'!==a.C&&a.C!==olympe.dc.Ub.NONE}
542
- function Xe(a){if(We(a))throw Error('An implicit GraphDef has no blocks');return a.F.values()}
543
- function Ye(a,b,c){c=new olympe.dc.query.Relation(b.R(),b.Pa(),c||b instanceof olympe.dc.X.Fc);b=[];var d;for(var e of Ze(a)){if(d=a.F.get(e)){var f=new olympe.dc.query.Wj(c,d.id);d.children.has(f.Z())?d=d.children.get(f.Z()):(d.children.set(f.Z(),f),d=f)}else{d=a;var g=c;const h=olympe.W.mb(d.G);f=olympe.W.mb(h+g.toString());g=d.F.get(f)||new olympe.dc.query.Wj(g,h);d.U.set(f,g);d=g}f=d.Z();a.F.set(f,d);b.push(f)}e=b[0];a.oa.set(e,b);return a.F.get(e)}
544
- function $e(a,b){if(We(a))a.aa.push(b);else throw Error('You cannot add a "skip predicate" to an explicit graphdef. Please activate a follow rule first.');return a}function af(a,b){a.ja=b;return a}function bf(a){const b=new olympe.dc.kf(a.G,a.L);b.C=a.C;for(const [c,d]of a.U)b.U.set(c,d);for(const [c,d]of a.F)b.F.set(c,d);b.ja=a.ja;b.aa=[...a.aa];return b}function cf(a,b){return We(a)?new olympe.dc.query.Pl(bf(a),b||olympe.D.Ja()):new olympe.dc.query.Vj(bf(a),b||olympe.D.Ja())}
545
- function Ze(a){let b=a.Y;const c=[];for(;b&&b.Qd().recursive;)c.push(b.Z()),b=a.F.get(b.F)||null;c.push(b&&b.Z()||olympe.W.mb(a.G));const d=[];c.slice(0,5).forEach(e=>{d.push(...a.oa.get(e))});return d}
546
- olympe.dc.kf=class{constructor(a,b=olympe.dc.Ed.SUBSCRIBE){if(void 0===a||null===a)throw Error('Cannot create GraphDef with undefined or null baseTag');this.G=olympe.dc.wa(a);this.L=b;this.C='not_defined';this.aa=[];this.Y=null;this.U=new Map;this.F=new Map;this.ja=null;this.oa=(new Map).set(olympe.W.mb(this.G),[olympe.W.mb(this.G)])}static Mc(a,b){olympe.dc.kf.Se([a],b)}static Se(a,b){const c=new olympe.dc.Transaction;a.forEach(d=>c.delete(d,olympe.dc.Ub.Hc));c.hb(b)}toJSON(){const a=Object.create(null),
547
- b=c=>{const d=Object.create(null),e=c.Qd();d.t=e.R();d.d=e.Pa();d.r=e.recursive;d.c=c.kh().map(b);return d};a.t=this.G;a.o=this.L;a.f=Ue(this);a.b=Array.from(this.U.keys()).map(c=>b(this.F.get(c)));return JSON.stringify(a)}static nc(a){a='string'===typeof a?JSON.parse(a):a;const b=Ve(new olympe.dc.kf(a.t,a.o),a.f),c=d=>{const e=new olympe.dc.ta.Relation(d.t,d.d);b.sb(e,d.r);for(const f of d.c)c(f);re(b)};for(const d of a.b)c(d);return b}Z(){const a=olympe.W.mb,b=d=>d.Z()+d.kh().map(e=>b(e)).sort().join(''),
548
- c=Array.from(this.U,([,d])=>b(d)).sort().join('');return a(`${this.L}-${this.G}${c}-${Ue(this)}`)}add(a,b=!1){this.validate(olympe.dc.Ub.NONE,'add');Ye(this,a,b);return this}sb(a,b=!1){this.validate(olympe.dc.Ub.NONE,'follow');this.Y=Ye(this,a,b);return this}hb(a=b=>b){'not_defined'===this.C&&(this.C=olympe.dc.Ub.NONE);const b=olympe.dc.Nf();a=olympe.D.Ja().C(a);switch(this.L){case olympe.dc.Ed.SUBSCRIBE:case olympe.dc.Ed.Li:const c=df(b,this,a);olympe.D.Ja().zc(()=>{ef(olympe.dc.Nf(),c.Z())});break;
549
- case olympe.dc.Ed.nm:ff(b,this,a);break;default:throw Error('Wrong graph operation');}}validate(a,b){if('not_defined'!==this.C&&this.C!==a)throw Error(this.C!==olympe.dc.Ub.NONE?`Method ${b} can't be called on an implicit Graphdef`:`Method ${b} can't be called on an explicit Graphdef`);this.C=a}};function gf(a,b){a.data.Qc(b.data);a.C.forEach((c,d)=>{if(b.C.has(d))d=b.C.get(d),d.add.push(...c.add),d.remove.push(...c.remove);else{var e=c.remove;const f=new hf(d);f.add=c.add;f.remove=e;b.C.set(d,f)}})}function jf(a,b){a.C.forEach((c,d)=>b(d,c.add,c.remove))}olympe.dc.query.ot=class{constructor(a,b){this.id=a;this.C=new Map;this.data=b}Z(){return this.id}};class hf{constructor(a){this.id=a;this.add=[];this.remove=[]}Z(){return this.id}};function kf(a){return(a=a.C)&&olympe.dc.Oa().source(a)||olympe.dc.Ga.Pc}function lf(a){return Array.from(a.Da,b=>a.F.get(b))}function mf(a){if(!a.L){for(const b of a.U.values())b();a.U.clear();a.L=!0}}
550
- olympe.dc.query.Vj=class{constructor(a,b){this.ph=a;this.C=a.G;this.id=a.Z();this.aa=new olympe.D.Xb(`GraphSubscription ${this.id}`,b);this.N=olympe.ra.Xa('dc.query');this.Da=[];this.F=new Map;this.L=!1;this.U=new Map;b=olympe.W.mb(this.C);if(!We(a))for(const c of Xe(a))this.F.set(c.Z(),c),c.F===b&&this.Da.push(c.Z())}Z(){return this.id}Ke(a,b){b=b||olympe.W.fc();this.L?a():this.U.set(b,olympe.D.Ja().C(a));return b}sj(a){return this.U.delete(a)}onDestroy(a){this.aa.onDestroy(a)}release(){this.aa.destroy()}Y(){return function*(a,
551
- b){yield a;for(const c of b)yield*c.ee()}(this.C,this.F.values())}ja(a){const b=olympe.W.mb(this.C);nf(a,(c,d)=>{if(b!==c)if(c=this.F.get(c),void 0===c)this.N.error('Try to apply a block result that does not exists in the original query');else for(const e of d)c.C.add(e)})}oa(a){let b=[],c=[];const d=olympe.W.mb(this.C);jf(a,(e,f,g)=>{const h=d===e,k=this.F.get(e);h||void 0!==k?h?(b.push(...f),c.push(...g)):(b=b.concat(f.filter(l=>{k.C.has(l)?l=!1:(k.C.add(l),l=!0);return l})),c=c.concat(g.filter(l=>
552
- k.C.delete(l)))):this.N.error(`A notification contains a block ${e} which is not present in the current graph query ${this.id}`)});Oc(olympe.dc.Ad(),b,c)}Ir(a){const b=a.C,c=[],d=this.C;d===b&&c.push(olympe.W.mb(d));this.F.forEach((k,l)=>{k.C.has(b)&&c.push(l)});const e=olympe.W.mb,f=this.F,g=(k,l)=>{const n=l.Qd(),p=[e(k+n),e(k+new olympe.dc.query.Relation(n.tag,n.direction,!0))].filter(q=>f.has(q));return 0<p.length?l.kh().reduce((q,r)=>q&&g(p[0],r),!0):!1},h=lf(a);return void 0!==c.find(k=>{for(const l of h)if(!g(k,
553
- l))return!1;return!0})}};olympe.dc.query.Wj=class{constructor(a,b){this.G=a;this.children=new Map;this.C=new Set;this.F=b;this.id=olympe.W.mb(b+a.toString());this.apply=!0}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "parentId": '+JSON.stringify(this.F)+', "apply": '+JSON.stringify(this.apply)+', ';a+='"relation": '+this.G.toJSON();if(0<this.children.size){a+=', "children": [';for(const b of this.children.values())a+=b.toJSON()+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}if(0<this.C.size){a+=', "instances": [';
554
- for(const b of this.C)a+=JSON.stringify(b)+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}return a+'}'}static nc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=olympe.dc.query.Relation.nc(b.relation);a=new olympe.dc.query.Wj(a,b.parentId);a.id=b.id;a.apply=b.apply;if(b.instances)for(const c of b.instances)a.C.add(c);if(b.children)for(const c of b.children)b=olympe.dc.query.Wj.nc(c),a.children.set(b.id,b);return a}Z(){return this.id}Qd(){return this.G}kh(){return Array.from(this.children.values())}ee(){return this.C.values()}toString(){return this.F+
555
- this.G.toString()}};function nf(a,b){a.C.forEach((c,d)=>b(d,c))}
556
- olympe.dc.query.Ci=class{constructor(a,b,c,d){this.id=a;this.source=b;this.destination=c;this.C=new Map;this.Dc=d}toJSON(){let a=`{ "id": "${this.id}", "source": "${this.source}", "destination": "${this.destination}"`;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=', "blocks": {';for(const [b,c]of this.C)a+=`"${b}": ${JSON.stringify(Array.from(c))}, `;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=`}, "patch": ${this.Dc.toJSON()}`;return a+'}'}static nc(a){let b;'string'===typeof a?b=JSON.parse(a):
557
- b=a;a=olympe.dc.db.Ac.nc(b.patch);a=new olympe.dc.query.Ci(b.id,b.source,b.destination,a);for(const [c,d]of Object.entries(b.blocks))a.C.set(c,new Set(d));return a}Z(){return this.id}};const of=olympe.dc.kc.Xc,pf=olympe.dc.kc.xi,qf=olympe.dc.Aa.ORIGIN,rf=olympe.dc.Aa.DESTINATION;function sf(a,b,c){const d=a.ph.aa;return c.filter(e=>d.reduce((f,g)=>f&&!g(b,e.Qd()),!0))}
558
- olympe.dc.query.Pl=class extends olympe.dc.query.Vj{constructor(a,b){super(a,b);this.G=(new Set).add(a.G)}Y(){return this.G.values()}ja(a){a=a.Dc;for(const b of a.ee())b.L()?this.G.delete(b.tag()):b.re()&&this.G.add(b.tag())}oa(a){let b=[],c=[];jf(a,(d,e,f)=>{b=b.concat(e.filter(g=>{if(this.G.has(g)&&this.C!==g)return!1;this.G.add(g);return!0}));c=c.concat(f.filter(g=>this.G.delete(g)))});Oc(olympe.dc.Ad(),b,c)}Ir(a){var b=a.C,c=Array.from(a.F.values()),d=sf(this,b,c);if(d.length===c.length&&!this.G.has(b))return!1;
559
- b=olympe.dm.Relation.C.Ck;c=olympe.dm.Relation.C.rk;const e=olympe.dc.Oa();for(const h of d){var f=h.Qd(),g=f.R();d=f.Pa();if(d!==rf||g!==of&&g!==pf){if(!e.Eb(f))return this.N.info('ImplicitGraphQuery: checking coverage of graphPath',a.Z(),'failed at the relation',g,'which is not in local DB'),!1;f=zd(e,f,Ue(this.ph));g=0===h.kh().length;if(!(f&(d===qf?g?12:c:g?3:b)))return!1}}return!0}};function tf(a){let b=null;for(a=[...a.X];null===b&&0<a.length;)b=a.pop().Yb();return b}function uf(a,b){a.Y()||(a=`Calling "${b}" on subscription with id ${a.Z()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback.',olympe.ra.Xa('dc').warn(a))}
560
- function vf(a,b){const c=new olympe.D.Xb('listDef toObservable',a.pc().Dh());return new rxjs.Observable(d=>{c.run(()=>{olympe.D.Ec([b],e=>{d.next(e.valueOf())})});c.onDestroy(()=>{d.complete()});return c.destroy.bind(c)})}
561
- olympe.dc.Ca=class{constructor(a,b,c){void 0===a||null===a?olympe.ra.Xa('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.Fa([a],olympe.dc.wa,String),this.X=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||tf(this),this.C=null)}Tc(){return olympe.dc.Tc()}hb(){if(null===this.C){const a=olympe.dc.Nf();this.C=wf(a,this);null!==this.valueType&&this.C.Gd(this.valueType);olympe.D.Ja().zc(()=>{xf(a,this.C.Z());this.C=
562
- null})}return this}pc(){null===this.C&&this.hb();return this.C}Gd(a){this.valueType=a;null!==this.C&&this.C.Gd(this.valueType)}Yb(){return null!==this.C?this.C.Yb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Od(){return this.F}Sl(){return this.X}Ke(a,b){return this.pc().Ke(a,b)}sj(a){this.pc().sj(a)}Gt(){return this.pc().Ue()}Ft(){return this.pc().Y()}get(a){return this.pc().get(a)}ci(){return this.pc().ci()}lh(a){const b=this.pc();uf(b,'getCurrent');return b.lh(a)}has(a){return this.pc().has(a)}Eg(a){const b=
563
- this.pc();uf(b,'hasCurrent');return b.Eg(a)}qe(a){return this.pc().qe(a)}Xx(a){return vf(this,this.qe(a))}Ve(a){const b=this.pc();uf(b,'getCurrentAt');return b.Ve(a)}We(a){return this.pc().We(a)}Gf(a){const b=this.pc();uf(b,'getCurrentKeyAt');return b.Gf(a)}fe(a){return this.pc().fe(a)}ay(a){return vf(this,this.fe(a))}Hf(a){const b=this.pc();uf(b,'getCurrentRank');return b.Hf(a)}Sc(){return this.pc().Sc()}Yx(){return vf(this,this.Sc())}If(){return this.pc().If()}nf(){return this.pc().nf()}by(){return vf(this,
564
- this.nf())}zg(){const a=this.pc();uf(a,'getCurrentSize');return a.zg()}forEach(a,b){this.pc().forEach(a,b)}ce(a){const b=this.pc();uf(b,'forEachCurrentValue');return b.ce(a)}bj(a,b,c,d){a=new olympe.dc.X.Zd(a,b);(new olympe.dc.Ca(this.F,[...this.X,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.X];for(const c of b){if(void 0===
565
- c)throw Error('ListDef.transform(): Trying to set an undefined transformer');if(c instanceof olympe.dc.ta.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.getTransform)break;a.push(c)}b=new olympe.dc.Ca(this.F,a);b.Gd(tf(b)||this.valueType||Object);return b}ll(a){return this.transform(new olympe.dc.X.wf(a))}filter(a){return this.transform(new olympe.dc.X.vc(a))}vg(){const a=new olympe.dc.ek(this.F,null===this.valueType?
566
- void 0:this.valueType);let b=this.X;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.X;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.bb(this.F)+a+')'}Et(){return this.pc().Vg()}Vc(){return olympe.D.Fa([this.nf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Ve(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Bb(b+']')},olympe.D.Wa)}};olympe.dc.Ca.prototype.filter=olympe.dc.Ca.prototype.filter;olympe.dc.Ca.prototype.union=olympe.dc.Ca.prototype.ll;
567
- olympe.dc.Ca.prototype.transform=olympe.dc.Ca.prototype.transform;olympe.dc.Ca.prototype.forEachCurrentValue=olympe.dc.Ca.prototype.ce;olympe.dc.Ca.prototype.forEach=olympe.dc.Ca.prototype.forEach;olympe.dc.Ca.prototype.getCurrentSize=olympe.dc.Ca.prototype.zg;olympe.dc.Ca.prototype.observeSize=olympe.dc.Ca.prototype.by;olympe.dc.Ca.prototype.observeFirst=olympe.dc.Ca.prototype.Yx;olympe.dc.Ca.prototype.getCurrentRank=olympe.dc.Ca.prototype.Hf;olympe.dc.Ca.prototype.observeRank=olympe.dc.Ca.prototype.ay;
568
- olympe.dc.Ca.prototype.getCurrentAt=olympe.dc.Ca.prototype.Ve;olympe.dc.Ca.prototype.observeAt=olympe.dc.Ca.prototype.Xx;olympe.dc.Ca.prototype.offReady=olympe.dc.Ca.prototype.sj;olympe.dc.Ca.prototype.onReady=olympe.dc.Ca.prototype.Ke;olympe.dc.Ca.prototype.getBaseTag=olympe.dc.Ca.prototype.Od;olympe.dc.Ca.la=[olympe.D.pd];m=olympe.dc.Ca.prototype;m.Tc.K=olympe.D.J.C;m.hb.K=olympe.D.J.L();m.pc.K=new olympe.D.J(()=>olympe.dc.query.Subscription,[]);m.Gd.K=new olympe.D.J(()=>{},[]);
569
- m.Od.K=new olympe.D.J(()=>String,[]);m.Sl.K=new olympe.D.J(()=>Array,[]);m.Ke.K=new olympe.D.J(()=>String,[]);m.sj.K=new olympe.D.J(()=>{},[]);m.Gt.K=olympe.D.J.U;m.Ft.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.ci.K=new olympe.D.J(()=>Array,[]);m.lh.K=olympe.D.J.C;m.has.K=olympe.D.J.U;m.Eg.K=olympe.D.J.C;m.qe.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Ve.K=olympe.D.J.C;m.We.K=new olympe.D.J(()=>String,[]);m.Gf.K=olympe.D.J.C;m.fe.K=olympe.D.J.G;
570
- m.Hf.K=olympe.D.J.C;m.Sc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.If.K=new olympe.D.J(()=>String,[]);m.nf.K=olympe.D.J.G;m.zg.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.ce.K=olympe.D.J.C;m.bj.K=new olympe.D.J(()=>{},[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.ll.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.filter.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.vg.K=new olympe.D.J(()=>olympe.dc.ek,[]);m.toString.K=olympe.D.J.C;m.Et.K=olympe.D.J.C;m.Vc.K=olympe.D.J.F;const yf={Oy:'append',El:'filter_not',Po:'filter_and',Qo:'filter_or'};function zf(a,b){a=Af(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.na.Tn(a,b)).F}
571
- olympe.dc.ek=class{constructor(a,b){this.C=Af(a);this.N=olympe.dc.Nf().Xa();this.valueType=void 0===b?olympe.dc.CloudObject:b;this.X=[];this.ua=[]}pf(){return new olympe.dc.Ca(this.C,this.X,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Bf('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.ta.Property)throw new Bf('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.getTransform)throw new Bf('transform',
572
- 'one of the argument is not a Transformer '+d);const e=d.Yb();null!==e&&(this.valueType=e);this.X.push(d)}return this}ll(a){this.X.push(new olympe.dc.X.wf(a));return this}My(a){this.X.push(new olympe.dc.X.wf(Af(a)));return this}It(a){this.valueType=a;return this}sb(a){this.X.push(a);this.valueType=a.Yb()||olympe.dc.CloudObject;return this}gw(a){for(const b of a)this.X.push(b),this.valueType=b.Yb()||olympe.dc.CloudObject;return this}Ok(a,b,c){a=new olympe.dc.X.Fc(a,a.Pa(),b,c);this.X.push(a);this.valueType=
573
- a.Yb()||olympe.dc.CloudObject;return this}dw(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.R());void 0===c&&(c=e.Pa())}a=new olympe.dc.X.Be(b,c);this.X.push(a);this.valueType=a.Yb()||olympe.dc.CloudObject;return this}Ht(){this.sb(olympe.dc.CloudObject.instancesRel);return this}Te(a){var b=this.ua.pop();b===yf.El&&(a=new olympe.dc.V.nd(a),b=this.ua.pop());switch(b){case yf.Po:b=this.X.pop().C;b instanceof olympe.dc.V.Ud?(b=b.V,b.push(a),a=new olympe.dc.V.Ud(...b)):a=new olympe.dc.V.Ud(b,
574
- a);b=this.ua.pop();break;case yf.Qo:b=this.X.pop().C,b instanceof olympe.dc.V.ae?(b=b.V,b.push(a),a=new olympe.dc.V.ae(...b)):a=new olympe.dc.V.ae(b,a),b=this.ua.pop()}b===yf.El&&(a=new olympe.dc.V.nd(a),this.ua.pop());this.X.push(new olympe.dc.X.vc(a));return this}Zv(a,b,c){return this.Te(new olympe.dc.V.Ic(zf(a,c),new olympe.dc.na.Dd(b)))}contains(a,b,c=!1,d){return this.Te(new olympe.dc.V.Wc(zf(a,d),new olympe.dc.na.Dd(b),c))}qh(a){if(!(a instanceof Array))throw new Bf('instanceOf','Provided argument "models" must be an array.');
575
- const b=[];for(let c=0;c<a.length;c++)b.push(Af(a[c]));return this.Te(new olympe.dc.V.mf(b))}Wk(a){return this.Te(new olympe.dc.V.Ic(new olympe.dc.na.uf,new olympe.dc.na.Dd(Af(a))))}$v(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.not().Wk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().not().Wk(a[b])}return this}kj(a,b){if(!(a instanceof Array))throw new Bf('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];
576
- a.forEach(e=>{c.push(e);d.push(e.Pa())});return this.Te(new olympe.dc.V.lf(c,d,b))}Vk(a,b,c){a=zf(a,c);return this.Te(new olympe.dc.V.ye(a,new olympe.dc.na.Dd(b)))}zj(a,b,c){a=zf(a,c);return this.Te(new olympe.dc.V.Fe(a,new olympe.dc.na.Dd(b)))}Hx(a,b,c,d){a=zf(a,d);return this.Te(new olympe.dc.V.wd(a,b,c))}filter(a){const b=new class extends olympe.dc.V.Og{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Te(b)}not(){this.ua.push(yf.El);return this}and(){this.X[this.X.length-1]instanceof
577
- olympe.dc.X.vc&&this.ua.push(yf.Po);return this}or(){this.X[this.X.length-1]instanceof olympe.dc.X.vc&&this.ua.push(yf.Qo);return this}jl(a,b,c){a=Af(a);let d=null;switch(olympe.dc.Oa().hc(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.R():d=new olympe.dc.Cb.String(new olympe.dc.na.oe(a,c));break;case olympe.dm.Number.O.R():d=new olympe.dc.Cb.Number(new olympe.dc.na.ke(a,c));break;case olympe.dm.DateTime.O.R():d=new olympe.dc.Cb.DateTime(new olympe.dc.na.je(a,c))}c=d;null!==c&&this.X.push(new olympe.dc.X.Kd(c,
578
- b));return this}sort(a,b,c){const d=new class extends olympe.dc.Cb.Og{L(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.X.push(new olympe.dc.X.Kd(d,c));return this}Vv(){this.X.push(new olympe.dc.X.we);return this}limit(a,b){this.X.push(new olympe.dc.X.Zd(a,b));return this}};class Bf extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
579
- function Af(a){return'string'===typeof a||a instanceof olympe.D.Wa?a:'function'===typeof a?olympe.dc.ya.Tb(a):olympe.D.lb(a)?a.Hk===olympe.D.Wa?a:olympe.D.Fa([a],b=>olympe.D.Bb(olympe.dc.wa(b)),olympe.D.Wa):a.R()}m=olympe.dc.ek.prototype;m.pf.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.transform.K=olympe.D.J.L();m.ll.K=olympe.D.J.L();m.My.K=olympe.D.J.L();m.It.K=olympe.D.J.L();m.sb.K=olympe.D.J.L();m.gw.K=olympe.D.J.L();m.Ok.K=olympe.D.J.L();m.dw.K=olympe.D.J.L();m.Ht.K=olympe.D.J.L();m.Te.K=olympe.D.J.L();
580
- m.Zv.K=olympe.D.J.L();m.contains.K=olympe.D.J.L();m.qh.K=olympe.D.J.L();m.Wk.K=olympe.D.J.L();m.$v.K=olympe.D.J.L();m.kj.K=olympe.D.J.L();m.Vk.K=olympe.D.J.L();m.zj.K=olympe.D.J.L();m.Hx.K=olympe.D.J.L();m.filter.K=olympe.D.J.L();m.not.K=olympe.D.J.L();m.and.K=olympe.D.J.L();m.or.K=olympe.D.J.L();m.jl.K=olympe.D.J.L();m.sort.K=olympe.D.J.L();m.Vv.K=olympe.D.J.L();m.limit.K=olympe.D.J.L();olympe.dc.query.Mp=class{constructor(a){this.id=a;this.C=[];this.data=new olympe.dc.db.Ac}F(a){this.C.push(olympe.dc.wa(a))}Z(){return this.id}getData(){return this.data}};function Cf(a){return olympe.D.lb(a)?'Node#'+a.Na.Z():String(a)}function Df(a,b){return olympe.D.lb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
581
- olympe.dc.query.wu=class{constructor(){this.uid=0;this.values=null}add(a){let b;b=olympe.D.lb(a)?'n'+a.Na.Z():'p'+ ++this.uid;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.$a=class{ma(){}C(){}F(){}ia(){}toString(){}};function ve(a,b,c){return a.G.run(()=>a.U.hb(b,c))}function we(a,b,c){return a.G.run(()=>Ef(a.U,b,c))}
582
- function df(a,b,c){var d=olympe.dc.Ga.rb;const e=b.Z();let f=Ff(a.ta,e),g=olympe.dc.Ga.rb;null===f&&(f=cf(b,a.G),a.L||(g=kf(f)));Gf(a.ta,f,d,g);c&&Pe(a.F,e,c);b=olympe.dc.ga.ka.Ai;const h=olympe.dc.ga.ka.zi,k=l=>{if(null!==l){a.N.error(`graph subscription "${e}" failed to subscribe ${l}`);Hf(a.ta,e,d);var n=a.F;Qe(n,e,n.F);c(l,null)}};g===olympe.dc.Ga.rb?(a.N.debug('QueryManager: [ID:',e,'] GraphQuery processed locally'),a.Y.process(d,f,k)):(b=M(new olympe.dc.ga(f.ph.L===olympe.dc.Ed.Li?h:b,f,[g]),
583
- k),a.N.debug('QueryManager: [ID:',e,'] sending GraphQuery to',g),a.C.send(b));return f}function ef(a,b){var c=olympe.dc.Ga.rb;const d=olympe.dc.Ga.rb;if(c===d){const e=Ff(a.ta,b).ph.L,f=If(a.ta,b);Hf(a.ta,b,c)&&f!==d&&e===olympe.dc.Ed.SUBSCRIBE&&(c=M(new olympe.dc.ga(olympe.dc.ga.ka.Zo,String(b),[f]),g=>{g&&a.N.error(`Unsubscription of graphdef ${b} failed: ${g.message}`)}),a.C.send(c))}else Hf(a.ta,b,c)}
584
- function ff(a,b,c){var d=olympe.dc.Ga.rb;b=cf(b,a.G);const e=b.Z();var f=a.F.C.has(e);c&&Pe(a.F,e,c);if(!f){f=h=>{if(h){var k=a.F;Qe(k,e,k.F);c(h,null)}};var g=kf(b);g===olympe.dc.Ga.rb?a.Y.process(d,b,f):(d=M(new olympe.dc.ga(olympe.dc.ga.ka.zi,b,[g]),f),a.C.send(d))}}
585
- function wf(a,b){var c=olympe.dc.Ga.rb;const d=b.Od();var e=new olympe.dc.query.wu;let f;f=d;olympe.D.lb(f)&&(f=e.add(d));b=(b=b.Sl())?Array.isArray(b)?b:[b]:null;const g=olympe.dc.query.Subscription.G(f,b,e);e=Jf(a.ta,g);null===e&&(a.N.debug('QueryMGR: new',a.L?'local':'remote','subscription "',g,'": #',`${f},`,b),e=new olympe.dc.query.Subscription(g,d,b,a.G),a.L||e.yd());a.Sa.process(c,e,h=>{h&&(Kf(a.ta,g,c||olympe.dc.Ga.rb),a.N.error(`subscription "${g}" failed to subscribe ${h}`))});return e}
586
- function xf(a,b){var c=olympe.dc.Ga.rb;if(c===olympe.dc.Ga.rb){const d=If(a.ta,b);a.N.debug('QueryMGR: [ID:',b,'] - Unregistered');Kf(a.ta,b,c)&&d!==olympe.dc.Ga.rb&&(c=M(new olympe.dc.ga(olympe.dc.ga.ka.Tu,String(b),[d]),e=>{e&&a.N.error(`Unsubscription of listdef ${b} failed, ${e.message}`)}),a.C.send(c))}else Kf(a.ta,b,c)}
587
- function Lf(a){const b=olympe.dc.ga.ka.$o,c=olympe.dc.ga.ka.yl,d=olympe.dc.ga.ka.Fp;a.C.C(olympe.dc.ga.ka.Hl,(e,f)=>{Mf(a,f,e)});a.C.C(b,(e,f)=>{Nf(a,f,e)});a.C.C(c,(e,f)=>{a.aa.$e(f,e)});a.C.C(d,(e,f)=>{Of(a,f,e)});a.C.oa((e,f)=>{Pf(a,f,e)})}function Qf(a,b){a.N.log('Received subscribeToAll command');b=b?olympe.D.Ja().C(b):void 0;const c=new olympe.dc.ga(olympe.dc.ga.ka.Sg,null,[olympe.dc.Ga.Pc]);b&&M(c,b);a.C.send(c)}
588
- function Mf(a,b,c=olympe.dc.Ga.rb){b.destination!==olympe.dc.Ga.rb?a.N.error(`Graphdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.oa.process(c,b,d=>{d&&a.N.error(`An error occurred during the process of a graphdef result ${b.Z()}: ${d.message}`)})}
589
- function Nf(a,b,c=olympe.dc.Ga.rb){const d=Rf(a.ta,b.Z());0!==d.length&&(1<d.length||d[0]!==olympe.dc.Ga.rb?a.N.error(`Notification received for graphdefs subscription registered from peers. Not supported yet ! (id: ${b.Z()})`):a.ja.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a graphNotification ${b.Z()}`)}))}
590
- function Of(a,b,c=olympe.dc.Ga.rb){const d=Sf(a.ta,b.Z());1<d.length||d[0]!==olympe.dc.Ga.rb?a.N.error(`Listdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.Da.process(c,b,e=>{e&&a.N.error(`An error occurred during the process of a listNotification ${b.Z()}`)})}
591
- function Pf(a,b,c){a.N.debug('Source event',b,'received for source',c);if(b===olympe.dc.xk.cq){const d=(e,f)=>{f&&a.N.error(`Error after trying to resubscribe to ${e}: ${f}`)};Tf(a.ta,c).forEach(e=>{Pe(a.F,e.Z(),d.bind(a,e.Z()));a.N.debug(`resubscribing graph subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ka.Ai,e,[c]),d.bind(a,e.Z()));a.C.send(e)});Uf(a.ta,c).forEach(e=>{a.N.debug(`resubscribing list subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ka.Ru,
592
- e,[c]),d.bind(a,e.Z()));a.C.send(e)})}}olympe.dc.query.Cu=class{constructor(a,b,c,d,e,f,g,h){this.N=a;this.L=b;this.C=c;this.aa=d;this.ta=e;this.F=f;this.G=new olympe.D.Xb('Query Manager context');this.Sa=g[0];this.Y=g[1];this.oa=g[2];this.ja=g[3];this.Da=g[4];this.U=h;Lf(this)}Xa(){return this.N}};olympe.dc.query.Relation=class extends olympe.dc.ta.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.R())+', ';a+='"direction": '+JSON.stringify(this.Pa())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static nc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a){return new olympe.dc.query.Relation(a.R(),a.Pa(),a instanceof olympe.dc.X.Fc)}Gc(){const a=
593
- olympe.dc.Aa.DESTINATION,b=olympe.dc.Aa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.Subscription=class a extends olympe.D.Ej{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Xb('context subscription '+b,e));this.id=b;this.Df=c;this.X=d||null;this.G=this.U.run(()=>olympe.D.ge(olympe.dc.query.Subscription.C.INIT));this.Ge=!1;this.ja=this.be=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ia(d);else e+='|null';e=olympe.W.mb(e)}catch(f){e=olympe.W.fc()}return e}Z(){return this.id}Od(){return this.Df}Cg(){return this.X}yd(){const b=
594
- olympe.dc.Oa(),c=olympe.D.bb(this.Od());return c?b.Wf(c)?b.source(c)||olympe.dc.Ga.Pc:olympe.dc.Ga.rb:olympe.dc.Ga.Pc}sh(){const b=this.G.Na.Kb;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.Rq}gi(){if(this.G.Na.Ab())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.be;this.be=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);ob(this.G,olympe.D.ge(olympe.dc.query.Subscription.C.Rq))}Ue(){return olympe.D.Fa([this.G],()=>{},olympe.D.qa)}Y(){const b=
595
- this.G.Na.Kb;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.yq}Ke(b,c){this.Y()?b(this):(null===this.ja&&(this.ja=new Map),void 0===c&&(c=olympe.W.fc()),this.ja.set(c,olympe.D.Ja().C(b)));return c||''}sj(b){null!==this.ja&&b&&this.ja.delete(b)}ad(){const b=olympe.dc.query.Subscription.C.yq;if(!this.G.Na.Ab()&&olympe.D.bb(this.G)!==b&&(this.Af(),ob(this.G,b),null!==this.ja)){for(const c of this.ja.values())c(this);this.ja=null}}onDestroy(b){this.U.onDestroy(b)}release(){this.U.destroy()}Lb(b){if(!this.G.Na.Ab()){for(let c=
596
- 0,d=b.length;c<d;c++)this.Fm(b[c],c);if(this.Y())this.Af();else{this.Ge=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.ad()}}}Lc(b){const c=this.F;for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&b(c[d],d)}ac(b,c){if(!this.G.Na.Ab()&&(this.Jk(b,olympe.dc.CloudObject.get(c)),b=this.Y(),this.Ge&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,
597
- d)){b=!1;break}b&&this.ad()}}wc(b){this.G.Na.Ab()||(this.Em(b),this.Ti(b,!this.Y()))}Vg(){return this.Y()?super.Vg():'Subscription is not ready!'}Rf(){const b=olympe.D.bb(this.Od());return olympe.dc.query.Subscription.F(b,this.Cg())}static F(b,c){var d=new olympe.dc.kf(b,olympe.dc.Ed.SUBSCRIBE);if(null===c)return[d];b=[];b.push(d);for(let e=0,f=c.length;e<f;e++){const g=c[e];if(g instanceof olympe.dc.X.Sb||g instanceof olympe.dc.X.Fc)b.forEach(h=>{const k=olympe.dc.query.Relation.from(g);h.sb(k,k.recursive)});
598
- else if(g instanceof olympe.dc.X.wf)d=a.F(olympe.D.bb(g.Od()),g.Cg()),b.push(...d);else if(g instanceof olympe.dc.X.vc||g instanceof olympe.dc.X.Kd){const h=g.F();b.forEach(k=>{for(const l of h){for(const n of l)k.sb(n,n.recursive);re(k,l.length)}})}}return b}};olympe.dc.query.Subscription.C={INIT:0,Rq:1,yq:2};olympe.dc.query.Subscription.prototype.Vg.K=olympe.D.J.C;function Jf(a,b){return a.F.has(b)?a.F.get(b).F():null}function Kf(a,b,c){return Vf(a,a.F,b,c)}function If(a,b){for(const [c,d]of a.L)if(d.has(b))return c;return null}function Ff(a,b){return a.C.has(b)?a.C.get(b).F():null}function Gf(a,b,c,d){const e=b.Z();let f=a.C.get(e);void 0===f&&(f=new olympe.dc.query.ta.nt(b,a.U,a),a.C.set(e,f));f.L(c);Wf(a,e,d)}function Hf(a,b,c){return Vf(a,a.C,b,c)}function Rf(a,b){return(a=a.C.get(b))?Array.from(a.C.keys()):[]}
599
- function Sf(a,b){return(a=a.F.get(b))?Array.from(a.C.keys()):[]}function Tf(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.C.get(d))&&c.add(d.F())});return c}function Uf(a,b){const c=new Set;(a.L.get(b)||new Set).forEach(d=>{(d=a.F.get(d))&&c.add(d.F())});return c}function Xf(a,b,c){a=a.F.get(b);if(void 0===a)throw Error(`Check if the subscription ${b} has been processed, but it has never been registered`);b=a.G.get(c);a.G.set(c,!0);return b||!1}
600
- function Wf(a,b,c){let d=a.L.get(c);d?d.add(b):(d=(new Set).add(b),a.L.set(c,d))}function Yf(a,b,c){var d=olympe.dc.Ga.rb;const e=b.Z();let f=a.F.get(e);void 0===f&&(f=new olympe.dc.query.ta.eu(b,a.U),a.F.set(e,f));f.L(c);Wf(a,e,d)}function Vf(a,b,c,d){if(!b.has(c))return!1;const e=b.get(c);var f=e.C.get(d)-1;0===f?(e.C.delete(d),e.G.delete(d),f=0===e.C.size):(e.C.set(d,f),f=!1);return f?((d=If(a,c))&&a.L.get(d).delete(c),e.F().release(),b.delete(c),!0):0===e.C.get(d)}
601
- function Zf(a,b){const c=b.Z();let d=a.G.get(c);d||(d=new olympe.dc.query.ta.Du(b),a.G.set(c,d));d.counter++;return d}function $f(a){a.G.forEach(b=>b.update())}function ag(a,b,c){const d=a.C.get(b);d?c instanceof olympe.dc.query.Subscription?bg(d,c):cg(d,c):a.N.error(`Try to set the subscription ${c.Z()} as covered by a graphquery that is not registered (${b}).`)}olympe.dc.query.Yu=class{constructor(a,b){this.N=a;this.C=new Map;this.F=new Map;this.G=new Map;this.Y=new Set;this.L=new Map;this.U=b}};olympe.dc.$c=class{ma(){}Yb(){}getTransform(){}ia(){}toString(){}};olympe.dc.tq=class{F(){}};olympe.dc.yf=class{ma(){}getValue(){}C(){}ia(){}toString(){}};olympe.dc.query.P={Ea:'olympe.dc.query.Logger',xa:'olympe.dc.query.QueryManager'};olympe.dc.query.Mb={Pe:'olympe.dc.query.SubscriptionRegistry',Jj:'olympe.dc.query.CallbackRegistry',bp:'olympe.dc.query.GraphProcessor',ap:'olympe.dc.query.GraphNotificationProcessor',cp:'olympe.dc.query.GraphResultProcessor',Gp:'olympe.dc.query.ListProcessor',dk:'olympe.dc.query.ListNotificationProcessor',vq:'olympe.dc.query.QueryProcessor',vl:'olympe.dc.query.CoverageProcessor'};olympe.dc.query.Config={Sq:'subscription.debug'};
602
- olympe.T.config(function(a){D(a,olympe.dc.query.Config.Sq,!1);C(a,olympe.dc.query.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc.query'));A(a,olympe.dc.query.Mb.Pe,olympe.dc.query.Yu,olympe.dc.query.P.Ea,new olympe.T.fa(olympe.dc.query.Config.Sq));A(a,olympe.dc.query.Mb.Jj,olympe.dc.query.Ks,olympe.dc.query.P.Ea);A(a,olympe.dc.query.Mb.Gp,olympe.dc.query.Wb.Op,olympe.dc.query.P.Ea,olympe.dc.P.vi,olympe.dc.query.Mb.Pe,olympe.dc.query.Mb.vl,olympe.dc.transaction.P.xa,new olympe.T.fa(olympe.dc.Config.$g));A(a,olympe.dc.query.Mb.bp,
603
- olympe.dc.query.Wb.ip,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Pe,new olympe.T.fa(olympe.dc.Config.$g));A(a,olympe.dc.query.Mb.cp,olympe.dc.query.Wb.jp,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Pe,olympe.dc.query.Mb.Jj);A(a,olympe.dc.query.Mb.ap,olympe.dc.query.Wb.hp,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Pe);A(a,olympe.dc.query.Mb.dk,olympe.dc.query.Wb.Np,olympe.dc.query.P.Ea,olympe.dc.P.vi,olympe.dc.query.Mb.Pe);A(a,olympe.dc.query.Mb.vq,olympe.dc.query.Wb.Eu,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Pe,
604
- olympe.dc.query.Mb.vl,olympe.dc.query.Mb.Jj,olympe.dc.P.me,olympe.dc.db.P.xa);A(a,olympe.dc.query.Mb.vl,olympe.dc.query.Wb.Ns,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Pe,olympe.dc.transaction.P.xa);C(a,olympe.dc.query.P.xa,[olympe.dc.query.P.Ea,new olympe.T.fa(olympe.dc.Config.$g),olympe.dc.P.me,olympe.dc.db.P.xa,olympe.dc.query.Mb.Pe,olympe.dc.query.Mb.Jj,olympe.dc.query.Mb.Gp,olympe.dc.query.Mb.bp,olympe.dc.query.Mb.cp,olympe.dc.query.Mb.ap,olympe.dc.query.Mb.dk,olympe.dc.query.Mb.vq],(b,c,d,e,f,
605
- g,h,k,l,n,p,q)=>new olympe.dc.query.Cu(b,c,d,e,f,g,[h,k,l,n,p],q))});olympe.T.run([olympe.dc.query.Mb.Pe],a=>{olympe.gj().subscriptions=a});olympe.dc.query.ta={};function dg(){const a=Error.stackTraceLimit;Error.stackTraceLimit=16;let b=Error().stack||'';b=b.split('\n').map(d=>d.trim());var c='Error'===b[0]?2:1;b=b.slice(c,Error.stackTraceLimit+c).reverse();c=[];for(const d of b)if(c.push(' '+d),d.includes('at ListDef.')||d.includes('at GraphDef.'))break;Error.stackTraceLimit=a;3<c.length&&(c=c.slice(c.length-3));return c.join('\n')||b.join('\n')}
606
- olympe.dc.query.ta.ar=class{constructor(a,b){this.C=new Map;this.G=new Map;this.U=a;this.ja=b}F(){}L(a){var b=this.C.get(a);this.C.set(a,void 0!==b?b+1:1);b=this.G.get(a);this.G.set(a,void 0!==b?b:!1)}};function bg(a,b){const c=b.Z();a.Y.set(c,b);olympe.D.Ja().onDestroy(()=>{a.Y.delete(c)})}function cg(a,b){const c=b.Z();a.aa.set(c,b);olympe.D.Ja().onDestroy(()=>{a.aa.delete(c)})}olympe.dc.query.ta.nt=class extends olympe.dc.query.ta.ar{constructor(a,b,c){super(a,b);this.ta=c;this.Y=new Map;this.aa=new Map;b&&dg()}F(){return this.U}};olympe.dc.query.ta.eu=class extends olympe.dc.query.ta.ar{constructor(a,b){super(a,b);this.Y=new Map}F(){return this.U}L(a){super.L(a);if(this.ja){const b='md_'+olympe.W.fc();this.Y.set(b,dg());olympe.D.Ja().onDestroy(()=>{this.Y.delete(b)})}}};function eg(a,b){let c;a.C!==b&&(null==(c=a.C)?void 0:c.hash)!==b.hash&&(a.C=b,fg(a,!1),a.G.forEach(d=>d(b)))}function fg(a,b){var c=se(a.query);if(c!==olympe.dc.Ga.rb&&c!==olympe.dc.Ga.Pc){var d;c=null!=(d=a.C)?d:olympe.dc.Va.empty();Oc(a.U,null,b?ze(c):Ae(c))}}function gg(a,b){const c=a.Y++;a.G.set(c,b);a.C&&b(a.C);return()=>a.G.delete(c)}
607
- olympe.dc.query.ta.Du=class{constructor(a){this.query=a;this.U=olympe.dc.Ad();this.id=a.Z();this.C=null;this.F=new olympe.dc.ba.rq(a);this.counter=this.Y=0;this.G=new Map;this.L=[]}update(){var a=this.F;a.F?(a.F=!1,a=!0):a=!1;if(a){var b;a=null!=(b=this.C)?b:olympe.dc.Va.empty();b=olympe.dc.Va.from(a,this.F);eg(this,b)}}onDestroy(a){this.L.push(a)}destroy(){fg(this,!0);this.L.forEach(a=>a())}};olympe.dc.query.Wb={};function hg(a,b,c,d,e){a.N.debug('CoverageProcessor: [ID:',d,'] - checking coverage of remote query over',b.length,'paths.');const f=new olympe.async.ng(olympe.D.Ja()),g=k=>{f.add((l,n)=>{k.hb(p=>{p?n(`The query ${d} is not covered by an existing graphdef, `+`and the specific graphdef id ${k.Z()} has encountered an error: ${p}`):l()});ag(a.ta,k.Z(),c)})},h=Array.from(Tf(a.ta,olympe.dc.Ga.Pc));b.forEach(k=>{const l=cf(k);let n=!1;for(let p=0,q=h.length;p<q;p++){const r=h[p];if(r.Ir(l)){g(r.ph,!1);
608
- n=!0;break}}n?a.N.debug('CoverageProcessor: [ID:',d,'] - graphPath',k,' is covered'):g(k,!0)});Vb(f,(k,l)=>e(l));f.start()}function ig(a,b,c){const d=[b.Od()],e=g=>g instanceof olympe.dc.X.wf,f=(b.Cg()||[]).filter(e);for(const g of f)d.push(g.Od()),f.push(...(g.Cg()||[]).filter(e));ke(a.C,()=>{olympe.D.Ec(d,()=>{const g=b.Rf();hg(a,g,b,b.Z(),c)})})}function jg(a,b,c,d){const e=b.Z(),f=[qe(b,c)];ke(a.C,()=>hg(a,f,b,e,d))}olympe.dc.query.Wb.Ns=class{constructor(a,b,c){this.N=a;this.ta=b;this.C=c}};olympe.dc.query.Wb.hp=class{constructor(a,b){this.N=a;this.ta=b}process(a,b,c){const d=b.Z();this.ta.C.has(d)?(Ff(this.ta,d).oa(b),olympe.dc.Ad().$e(b.data,a),c(null,b)):c(Error(`Received a notification for the graphdef ${d} which does not exist.`),b)}};olympe.dc.query.Wb.hp.la=[olympe.dc.og];olympe.dc.query.Wb.ip=class{constructor(a,b,c){this.N=a;this.ta=b;this.C=c}process(a,b,c){var d=b.Z();if(a===olympe.dc.Ga.rb||this.ta.C.has(d)){if(c(null,b),a=Ff(this.ta,d),this.C||a&&a.L)a=olympe.dc.Ga.rb,d=new olympe.dc.query.Ci(d,a,a,new olympe.dc.db.Ac),Mf(olympe.dc.Nf(),d)}else c(Error('The local Graph Engine is not implemented yet. It should handle Graphdefs addressed to instances owned by this local OVM'),b)}};olympe.dc.query.Wb.ip.la=[olympe.dc.og];olympe.dc.query.Wb.jp=class{constructor(a,b,c){this.N=a;this.C=b;this.F=c}process(a,b,c){const d=b.Z();if(this.C.C.has(d)){const f=Ff(this.C,d);if(b instanceof olympe.dc.query.errors.Xj)Hf(this.C,d,a);else if(!f.L){f.ja(b);const g=olympe.dc.Ad();Oc(g,f.Y());g.$e(b.Dc,b.destination);f.onDestroy(()=>{Oc(g,null,f.Y())});mf(f)}}let e;b instanceof olympe.dc.query.errors.Xj&&(e=`graph subscription "${d}" failed to create the initial result: ${b.aa()}`,this.N.error(e));Se(this.F,b.Z(),b);c(e?Error(e):null,
609
- b)}};olympe.dc.query.Wb.jp.la=[olympe.dc.og];const kg=[],lg=new Map;function mg(a,b,c,d){tc(a.db,d,e=>{e?b.Eg(c)?a.N.warn('Adding the same index twice (should never happen) for sub #'+b.Z()+', index #'+c+', tag #'+d):b.ac(c,d):ng(a,b,c,d)},c)}function ng(a,b,c,d){uc(a.db,d,c,!0);b.wc(c);kg.length=0;b.Lc(function(e,f){kg[e]=f});c=a=0;for(d=kg.length;a<d;a++)'string'===typeof kg[a]&&(kg[c++]=kg[a]);kg.length=c;b.Lb(kg)}
610
- olympe.dc.query.Wb.Np=class{constructor(a,b,c){this.N=a;this.db=b;this.ta=c}process(a,b,c){const d=b.Z();a=b.C;const e=Jf(this.ta,d);if(null===e)c(Error(`Received list notification for undefined subscription "${d}"`),b);else{kg.length=a.length;e.Lc((f,g)=>{if(f=e.lh(g)){f=f.R();var h=lg.get(f);void 0===h?lg.set(f,g):'string'===typeof h?lg.set(f,[h,g]):h.push(g)}else this.N.warn('Subscription #'+d+' has a rank for index #'+g+' but no instance. This is caused by receiving a new list notification before receiving all instances of the previous list notification.')});
611
- for(let f=0,g=a.length;f<g;f++){const h=a[f];let k=lg.get(h);void 0===k?(k=olympe.W.fc(),mg(this,e,k,h)):'string'===typeof k?lg.delete(h):(k=k.pop(),0===k.length&&lg.delete(h));kg[f]=k}for(const [f,g]of lg){if('string'===typeof g)ng(this,e,g,f);else for(let h=0,k=g.length;h<k;h++)ng(this,e,g[h],f);lg.delete(f)}e.Lb(kg);c(null,b)}}};olympe.dc.query.Wb.Np.la=[olympe.dc.og];function og(a,b,c,d){const e=c.Z();a.N.debug('ListProcessor: [ID:',e,'] - processing with source ',b);Yf(a.ta,c,b);if(Xf(a.ta,e,olympe.dc.Ga.rb))a.N.debug('ListProcessor: [ID:',e,'] - id already processed');else{a.N.debug('ListProcessor: [ID:',e,'] - NOT processed yet.');const f=c.yd();a.F||f===olympe.dc.Ga.rb?(a.N.debug('QueryMGR: [ID:',e,'] - Local subscription, no need for coverage check, booting subscription '),pg(a,c)):c.Dh().run(()=>{ig(a.C,c,g=>{g?a.N.error(g):pg(a,c)})})}b===olympe.dc.Ga.rb||
612
- Xf(a.ta,e,b)||a.notify(b,c);d(null,c)}
613
- function pg(a,b){if(b.Y())a.N.debug('ListProcessor: [ID:',b.Z(),'] - Subscription already booted, ignoring');else{a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting subscription');var c=new olympe.dc.rc.$q(a.db,a.N),d=qg(a,b,c),e=b.Z();b.Dh().run(()=>{olympe.D.Ec([b.Od()],f=>{const g=olympe.dc.wa(f);a.N.debug('ListProcessor: [ID:',b.Z(),'] - Booting with baseTag',g);b.sh()||b.gi();tc(a.db,g,h=>d(h,g),e);olympe.D.Ja().zc(()=>uc(a.db,g,e));a.db.Eb(g.valueOf())||rg(c);b.Y()||(rg(c),b.Lb([]))})})}}
614
- function qg(a,b,c){const d=new olympe.dc.rc.Hj;let e=!1;const f=b.Dh(),g=b.Cg(),h=[];h[g?g.length:0]=f.C((k,l,n,p)=>{f.G()||f.Ab()||(k?b.Eg(n)?a.N.warn('Adding the same index twice (should never happen) for sub #',b.Z(),', index #',n,', tag #',l):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Adding Instance',l,'to the subscription'),b.ac(n,l)):(a.N.debug('ListProcessor: [ID:',b.Z(),'] - Removing Instance',l,'from the subscription'),b.wc(n)),e||(sg(c,()=>{p.tg();rg(c)}),p.Tc().Lg(b.Lb.bind(b)),e=!0),
615
- tg(c,n))});if(null!==g){const k=olympe.dc.Tc();for(let l=g.length-1;0<=l;l--)h[l]=f.C(g[l].getTransform(k,c,h[l+1]))}return(k,l)=>{const n=b.Z();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,ug(p,k,l,n))}}
616
- olympe.dc.query.Wb.Op=class{constructor(a,b,c,d,e,f){this.N=a;this.db=b;this.ta=c;this.C=d;this.F=f}process(a,b,c){og(this,a,b,c)}notify(a,b){const c=b.Z();this.N.debug(`Register notification of list subscription ${c} for destination ${a}`);const d=()=>{const f=new olympe.dc.query.Mp(c);b.ce(g=>f.F(g));Of(olympe.dc.Nf(),f)};let e=!1;b.forEach(()=>{e&&d()});b.Ke(()=>{e=!0;d()})}};olympe.dc.query.Wb.Op.la=[olympe.dc.og];function Ef(a,b,c){const d=b.Z(),e=se(b),f=a.ta.G.has(d),g=Zf(a.ta,b);return new rxjs.Observable(h=>{const k=gg(g,h.next.bind(h)),l=()=>{k();n&&c.Lc(n);{var p=a.ta;const r=p.G.get(d);var q;if(q=r)q=r,0<q.counter?q.counter--:olympe.ra.Xa('dc').warn('Try to decrement counter of query metadata below 0. Investigate...'),q=0===q.counter;q&&(r.destroy(),p.G.delete(d),p.Y.delete(d))}},n=c.zc(l);if(!f)if(e===olympe.dc.Ga.Pc)jg(a.L,b,!0,p=>{p?(h.error(p),l()):vg(a,d,b,g)});else if(e===olympe.dc.Ga.rb)vg(a,
617
- d,b,g);else{const p=M(wc(new olympe.dc.ga(olympe.dc.ga.ka.qm,b,[e]),c),q=>{q&&(h.error(q.message),l())});a.G.send(p)}return l})}
618
- function wg(a){const b=olympe.dc.ga.ka.pm,c=(d,e)=>Ce(d,f=>{Oc(a.F,Array.from(f.ee()).filter(g=>g.re()).map(g=>g.tag()));a.F.$e(f,e)},e);a.G.C(olympe.dc.ga.ka.QUERY_RESULT,(d,{i:e,r:f,s:g})=>{d=c(f,g);null===d?(d=a.C,Re(d,e,`Error while deserialization of QueryResult for query ${e}`,d.G,`Query result of query ${e} has no associated handler in the datacloud`)):(f=a.C,Re(f,e,d,f.G,`Query result of query ${e} has no associated handler in the datacloud`))});a.G.C(b,(d,{i:e,r:f,s:g})=>{if(d=c(f,g)){let h;
619
- null==(h=a.ta.G.get(e))||eg(h,d)}});Nc(a.F,()=>$f(a.ta))}function vg(a,b,c,d){let e=(p,q)=>{p?a.N.debug(`New result tuple for query ${b}, ${q}`):a.N.debug(`Removed result tuple for query ${b}, ${q}`)};const f=c.C,g=f.reduce((p,q)=>{p.push(q.F(p[p.length-1]));return p},[0]),h=d.F;for(let p=f.length-1;0<=p;p--)e=f[p].observe(h,g[p],e);const k=a.F.view,l=c.G,n=tc(k,l,(p,q)=>{p?h.insert(q,0,null):h.remove(q,0,null);e(p,q,null,b)});d.onDestroy(()=>uc(k,l,n));Ge(h);d.update()}
620
- olympe.dc.query.Wb.Eu=class{constructor(a,b,c,d,e,f){this.N=a;this.ta=b;this.L=c;this.C=d;this.G=e;this.F=f;wg(this)}hb(a,b){return new Promise((c,d)=>{var e=se(a);if(e===olympe.dc.Ga.Pc)jg(this.L,a,!1,f=>{f?d(f):c(this.jd(a))});else if(e===olympe.dc.Ga.rb)c(this.jd(a));else{const f=a.Z(),g=this.C.C.has(f),h=l=>{var n=this.C;Qe(n,f,n.G);d(l||`The execution of the query ${f} has been interrupted`)},k=b.zc(h);Te(this.C,f,(l,n)=>{b.Lc(k);l?d(l.message):(b.zc(()=>{Oc(this.F,null,ze(n))}),c(n))});g||(e=
621
- M(wc(new olympe.dc.ga(olympe.dc.ga.ka.om,a,[e]),b),l=>l&&h(l.message)),this.G.send(e))}})}jd(a){const b=new olympe.dc.ba.rq(a);b.insert(a.G,0,null);let c=0;for(const d of a.C)d.hb(b,c),c=d.F(c);return olympe.dc.Va.from(olympe.dc.Va.empty(),b)}};olympe.dc.query.errors={};olympe.dc.query.errors.Xj=class extends olympe.dc.query.Ci{constructor(a,b,c,d){super(a,b,c,new olympe.dc.db.Ac);this.error=d}aa(){return this.error}};olympe.dc.rc={};function ug(a,b,c,d){b?a.U[d]=c:delete a.U[d];null===a.F&&(a.F=new olympe.dc.rc.Oj(a.C,a));return a.F}function xg(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function yg(a,b){a=a.U;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.rc.Oj=class{constructor(a,b){this.C=a;this.parent=b||null;this.aa=b?b.aa+1:0;this.U=Object.create(null);this.F=null}Tc(){return this.C}tg(){this.C.U()?this.C.G():this.C.aa(this.aa-1)}};olympe.dc.rc.sa=class{constructor(){}C(){}U(){}aa(){}G(){}Lg(){}};olympe.dc.rc.Hj=class{constructor(){this.Y=this.L=this.index=this.F=null}U(){return null!==this.F}aa(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.L;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.rc.Oj(this),this.index=c,this.L=b):this.L=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.Y){const a=
622
- [];null!==this.L&&(0<=this.F?yg(xg(this.L,this.F),a):a.push(this.index));this.Y(a)}}Lg(a){this.Y=a}};olympe.dc.rc.Hj.la=[olympe.dc.rc.sa];function zg(a,b){olympe.D.Vf(a.value)?(a.node=olympe.D.el(a.value,b),Va(a.node)||b()):b()}function Ag(a,b){if(olympe.D.Vf(a.value)){const c=olympe.D.Ja(),d=a.L;olympe.D.Ec([a.value],e=>{d!==e.valueOf()&&(c.run(()=>zg(a,b)),olympe.D.Ja().destroy())})}}
623
- class Bg extends olympe.dc.rc.Oj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.L=this.bb();this.position=this.node=null;this.Y=!1;this.G=null}bb(){const a=olympe.D.bb(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}Ab(){return null===this.value}}
624
- function Cg(a,b){if(!b.Ab()){var c=a.F;const d=a.Da,e=b.bb();let f=0,g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].L,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].L,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.L=b.bb();c!==b.position&&(a.insert(b,c),b.Y&&a.G())}}function Dg(a){const b=a.Da;a.F.sort((c,d)=>b(c.bb(),d.bb()))}
625
- olympe.dc.rc.Zq=class{constructor(a){this.Da=a;this.L=null;this.F=[];this.Y=[];this.ja=null;this.oa=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new Bg(this,c,d),this.oa.set(b,f),this.U()?zg(f,()=>Cg(this,f)):(f.position=e.length,e.push(f));else{f=this.oa.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.oa.delete(b);null!==f.position&&(this.U()?this.remove(f):delete e[f.position]);f.destroy()}return f}U(){return null!==this.L}aa(a){if(null!==this.L)throw Error('Manager already activated (depth='+
626
- this.L+')');this.L=a;Dg(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;Ag(d,()=>Cg(this,d))}this.G()}G(){if(null===this.L)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.Y.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.Y){var b=e,c=this.L;b.Y=!0;b.G=xg(b,c)}0>this.L?this.Y.push(e.index):e.G&&yg(e.G,this.Y)}this.ja&&this.ja(this.Y)}Lg(a){this.ja=a}insert(a,b){const c=this.F;var d=c.length;let e=a.position;null===
627
- e&&(e=d);if(b<e)for(d=e;d>b;d--)c[d]=c[d-1],c[d].position=d;else for(d=e;d<b;d++)c[d]=c[d+1],c[d].position=d;c[b]=a;c[b].position=b}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.rc.Zq.la=[olympe.dc.rc.sa];class Eg extends olympe.dc.rc.Oj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.ja=this.Y=this.L=!1;this.G=null}}
628
- function Fg(a,b,c,d,e){const f=Object.create(null),g=a.order,h=a.L;let k,l,n;a.oa=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.L||(c.L=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.L&&(c.L=!1,e(!1,c.tag,c.index,c)),c.Y&&(c.G=null,delete h[k]),delete f[k]);a.oa=!1;null!==a.F&&a.G()}
629
- olympe.dc.rc.Zl=class{constructor(){this.L={};this.order=[];this.F=null;this.oa=!1;this.Y=[];this.ja=null}U(){return null!==this.F}aa(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.oa){var a=this.order,b=a.length,c=this.L,d;for(d=this.Y.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.Y.push(e.index);else{if(!e.ja){var f=e,g=this.F;f.ja=!0;
630
- f.G=xg(f,g)}null!==e.G&&yg(e.G,this.Y)}}this.ja&&this.ja(this.Y)}}Lg(a){this.ja=a}C(a,b,c){let d=this.L[c];a?void 0===d?(d=new Eg(this,c,b),this.L[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.rc.Zl.la=[olympe.dc.rc.sa];function rg(a){if(!a.F){for(let b in a.G)Gg(a.G[b]);a.F=!0}a.L=null;a.U=null}function sg(a,b,c){a.G[c||'root'].L=b}function tg(a,b,c){a.G[c||'root'].tg(b)}function Hg(a,b,c,d){const e=a.U,f=b+d+c;let g=e[f];void 0===g&&(g=Dd(a.db,b,c,d),e[f]=g);return g}function Ig(a,b){a.F||a.C.tg(b)}function Jg(a,b,c,d,e){if(!a.F){let f=Hg(a,c,d,e||olympe.dc.Aa.DESTINATION);e||(f+=Hg(a,c,d,olympe.dc.Aa.ORIGIN));0===f&&Ig(a,b)}}
631
- function Kg(a,b){const c=a.G[b];void 0!==c?(a.N&&a.N.debug('Set current block to',b,null!==c.parent?'parent = '+c.parent.Z():''),a.C=c):a.N&&a.N.error('Try to set a block that does not exists:',b)}function Lg(a){const b=String(++a.Y),c=a.C;a.G[b]=new Mg(b,c);Ng(c,b);c.F||(c.F=()=>Kg(a,c.Z()));return b}function Og(a,b){const c=a.C;a.C.F=()=>{Kg(a,c.Z());b()}}function Pg(a,b){Gg(b?a.G[b]:a.C)}
632
- olympe.dc.rc.$q=class{constructor(a,b){this.db=a;this.N=b||null;this.L=Object.create(null);this.U=Object.create(null);this.F=!1;this.Y=0;this.C=new Mg('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=Hg(this,c,d,e),d=this.L[b]||0,this.L[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function Ng(a,b){null===a.children&&(a.children=Object.create(null));a.children[b]=!1}function Gg(a){a.G=!0;null!==a.parent&&a.parent.notify(a.id)}
633
- class Mg{constructor(a,b){this.id=a;this.parent=b||null;this.C=this.L=this.F=this.children=null;this.G=!1}Z(){return this.id}tg(a){const b=this.L;if(this.G||this.C===a||null===a)b&&b(),!b&&Gg(this)}notify(a){const b=this.F,c=this.children;if(this.G)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.na={};olympe.dc.na.uf=class{ma(){return O(olympe.dc.na.uf)}C(){return[]}getValue(a,b){return b}ia(){return'{"c":"'+this.ma()+'","a":[]}'}toString(){return'Tag()'}};N('olympe.dc.valuedefs.Tag',olympe.dc.na.uf);olympe.dc.na.uf.la=[olympe.dc.yf];olympe.dc.na.Dd=class{constructor(a){this.value=a}ma(){return O(olympe.dc.na.Dd)}C(){return[]}getValue(){return this.value}ia(a){a=Df(a,this.value);return`{"c":"${this.ma()}","a":[${a}]}`}toString(){return`Constant(${Cf(this.value)})`}};N('olympe.dc.valuedefs.Constant',olympe.dc.na.Dd);olympe.dc.na.Dd.la=[olympe.dc.yf];function Qg(a,b,c,d){const e=olympe.dc.Oa(),f=new olympe.dc.rc.Hj,g=new olympe.dc.rc.$q(e);let h=!1;const k=Object.create(null),l=r=>{if(0<r.length)for(const t in k)r[0]===t&&d(k[t])};let n=(r,t,u,v)=>{const w=olympe.D.Ja();w.G()||w.Ab()||(h||(sg(g,()=>{v.tg();rg(g)}),v.Tc().Lg(l),h=!0),r?k[u]=t:delete k[u],tg(g,u))};const p=olympe.D.Ja();if(null!==c)for(let r=c.length-1;0<=r;r--)n=c[r].getTransform(a,g,p.C(n));n=p.C(n);const q=olympe.W.fc();tc(e,b,(r,t)=>{g.register(q,null);const u=f.C(r,b,q,null);
634
- n(r,t,q,ug(u,r,b,q))},q);p.onDestroy(()=>{uc(e,b,q)});e.Eb(b)||rg(g)}function Rg(a,b,c){const d=c.node,e=olympe.dc.Oa(),f=a.G(),g=wd(e,b,a.Ze,d.C(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>e.F(b,a.Ze,g))}
635
- olympe.dc.na.Oc=class{constructor(a,b,c){this.Ze=a&&a.R?a.R():a;this.X=b&&b.filter(d=>d instanceof olympe.dc.X.Sb||d instanceof olympe.dc.X.Fc)||null;this.F=c||null;this.defaultValue=null}ma(){}Yb(){}G(){}C(){return(this.X||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}bf(a){this.defaultValue=a;return this}Cg(){return this.X}Od(){return this.F}getValue(a,b){const c=olympe.D.Uc(this.Yb()||Object,'AbstractProperty valueType');null!==this.defaultValue&&pb(c,this.defaultValue);b=this.F||
636
- b;null!==this.X?Qg(a,b,this.X,d=>{Rg(this,d,c)}):Rg(this,b,c);return c.Fb()}ia(a){const b=Df(a,this.Ze),c=Df(a,this.F);let d='null';this.X&&(d=this.X.map(function(e){return e.ia(a)}).join(','));return`{"c":"${this.ma()}","a":["${b}",${d},${c}]}`}toString(){const a=Cf(this.Ze),b=this.F?','+Cf(this.F):'';let c='';this.X&&(c=','+this.X.join(','));return this.ma().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.na.Oc.la=[olympe.dc.yf];olympe.dc.na.ke=class extends olympe.dc.na.Oc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.ke)}G(){return olympe.dc.W.Vb.Pm}Yb(){return olympe.D.ea}};N('olympe.dc.valuedefs.NumberProperty',olympe.dc.na.ke);olympe.dc.na.oe=class extends olympe.dc.na.Oc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.oe)}G(){return olympe.dc.W.Vb.Qm}Yb(){return olympe.D.Wa}};N('olympe.dc.valuedefs.StringProperty',olympe.dc.na.oe);olympe.dc.na.te=class extends olympe.dc.na.Oc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.te)}G(){return olympe.dc.W.Vb.Nm}Yb(){return olympe.D.qa}};N('olympe.dc.valuedefs.BooleanProperty',olympe.dc.na.te);olympe.dc.na.je=class extends olympe.dc.na.Oc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.je)}G(){return olympe.dc.W.Vb.Om}Yb(){return olympe.D.jb}};N('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.na.je);olympe.dc.na.Tn=class{constructor(a,b){if(olympe.D.Vf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.R();var d=olympe.dc.Oa();const e=d.hc(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Pf(e,olympe.dc.CloudObject.extendRel,olympe.dm.rf);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.R():d=new olympe.dc.na.oe(c,b);break;case olympe.dm.Number.O.R():d=new olympe.dc.na.ke(c,
637
- b);break;case olympe.dm.Boolean.O.R():d=new olympe.dc.na.te(c,b);break;case olympe.dm.DateTime.O.R():d=new olympe.dc.na.je(c,b)}this.F=d}ma(){return this.F.ma()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ia(a){return this.F.ia(a)}toString(){return this.F.toString()}};olympe.dc.na.Tn.la=[olympe.dc.yf];olympe.dc.Cb={};olympe.dc.Cb.Number=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Cb.Number)}U(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.ma()}",a:[${this.C.ia(a)}]}`}toString(){return`Number(${this.C.toString()})`}};N('olympe.dc.comparators.Number',olympe.dc.Cb.Number);olympe.dc.Cb.Number.la=[olympe.dc.Ne];olympe.dc.Cb.String=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Cb.String)}U(){return this.C.C()}L(a,b){return olympe.D.Fa([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Wa)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ia(a){return`{"c":"${this.ma()}",a:[${this.C.ia(a)}]}`}toString(){return`String(${this.C.toString()})`}};N('olympe.dc.comparators.String',olympe.dc.Cb.String);olympe.dc.Cb.String.la=[olympe.dc.Ne];olympe.dc.Cb.DateTime=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Cb.DateTime)}U(){return this.C.C()}L(a,b){return this.C.getValue(a,b)}G(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ia(a){return'{"c":"'+this.ma()+'",a:['+this.C.ia(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};N('olympe.dc.comparators.DateTime',olympe.dc.Cb.DateTime);olympe.dc.Cb.DateTime.la=[olympe.dc.Ne];let Sg=0;olympe.dc.Cb.Og=class{constructor(){this.id=Sg++}ma(){return'CustomLocalComparator#'+Sg}U(){return[]}L(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ia(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.Cb.Og.la=[olympe.dc.Ne];olympe.dc.V={};olympe.dc.V.nd=class{constructor(a){this.G=a}ma(){return O(olympe.dc.V.nd)}F(){return this.G.F()}C(a,b){return olympe.D.el(this.G.C(a,b),c=>!c.valueOf())}ia(a){return`{"c":"${this.ma()}","a":[${this.G.ia(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};N('olympe.dc.predicates.Not',olympe.dc.V.nd);olympe.dc.V.nd.la=[olympe.dc.$a];olympe.dc.V.Ud=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}ma(){return O(olympe.dc.V.Ud)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.df(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(!arguments[d].valueOf())return!1;return!0})}ia(a){const b=this.V.map(c=>c.ia(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'And('+
638
- this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.And',olympe.dc.V.Ud);olympe.dc.V.Ud.la=[olympe.dc.$a];olympe.dc.V.ae=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}ma(){return O(olympe.dc.V.ae)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.df(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(arguments[d].valueOf())return!0;return!1})}ia(a){const b=this.V.map(c=>c.ia(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'Or('+
639
- this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.Or',olympe.dc.V.ae);olympe.dc.V.ae.la=[olympe.dc.$a];olympe.dc.V.nl=class{constructor(a,b){this.G=a;this.L=b}ma(){}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return this.U('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d))},Boolean)}U(){}ia(a){return'{"c":"'+this.ma()+'","a":['+this.G.ia(a)+','+this.L.ia(a)+']}'}toString(){return this.ma().replace(/^.+\./,'')+'('+this.G.toString()+','+this.L.toString()+')'}};olympe.dc.V.nl.la=[olympe.dc.$a];olympe.dc.V.Ic=class{constructor(a,b){this.G=a;this.L=b}ma(){return O(olympe.dc.V.Ic)}F(){return[this.G.C(),this.L.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.L.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Td?c.Td(d):'object'===typeof d&&void 0!==d.Td?d.Td(c):olympe.D.Cc(c.valueOf()===d.valueOf()),olympe.D.qa,'Test equal predicate')}ia(a){return'{"c":"'+this.ma()+'","a":['+this.G.ia(a)+','+this.L.ia(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.L.toString()+
640
- ')'}};N('olympe.dc.predicates.Equals',olympe.dc.V.Ic);olympe.dc.V.Ic.la=[olympe.dc.$a];olympe.dc.V.$s=class extends olympe.dc.V.Ic{constructor(a,b){super(a,new olympe.dc.na.Dd(b))}};olympe.dc.V.$s.la=[olympe.dc.$a];olympe.dc.V.ye=class extends olympe.dc.V.nl{constructor(a,b){super(a,b)}ma(){return O(olympe.dc.V.ye)}U(a,b){return a>b}};N('olympe.dc.predicates.Greater',olympe.dc.V.ye);olympe.dc.V.Fe=class extends olympe.dc.V.nl{constructor(a,b){super(a,b)}ma(){return O(olympe.dc.V.Fe)}U(a,b){return a<b}};N('olympe.dc.predicates.Smaller',olympe.dc.V.Fe);olympe.dc.V.Wc=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ma(){return O(olympe.dc.V.Wc)}F(){return[this.source.C(),this.value.C()]}getValue(){return this.value}C(a,b){return olympe.D.Fa([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Cc(c.includes(d))},olympe.D.qa)}ia(a){const b=this.source.ia(a),c=this.value.ia(a);a=Df(a,this.G);return'{"c":"'+this.ma()+'","a":['+
641
- b+','+c+','+a+']}'}toString(){const a=Cf(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};N('olympe.dc.predicates.Contains',olympe.dc.V.Wc);olympe.dc.V.Wc.la=[olympe.dc.$a];olympe.dc.V.wd=class{constructor(a,b,c){this.source=a;this.L=b;this.G=void 0===c?!0:c}ma(){return O(olympe.dc.V.wd)}F(){return[this.source.C()]}C(a,b){return olympe.D.df([this.source.getValue(a,b),this.L,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return(new RegExp(d)).test(c)})}ia(a){const b=this.source.ia(a),c=Df(a,this.L);a=Df(a,this.G);return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Cf(this.G);return'Regex('+this.source.toString()+
642
- ','+this.L+','+a+')'}};N('olympe.dc.predicates.Regex',olympe.dc.V.wd);olympe.dc.V.wd.la=[olympe.dc.$a];olympe.dc.V.mf=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.wa(b))}):this.G.add(olympe.dc.wa(a))}ma(){return O(olympe.dc.V.mf)}F(){return[]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Oa();let e=[];const f=()=>{e.forEach(h=>{d.C(h.tag,h.C,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.wa(olympe.dc.CloudObject))K(c,this.G.has(k)),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);this.G.has(k)?
643
- (K(c,!0),f()):(h=new Tg(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.C,g,h.id))}};a=new Tg(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.C,g,a.id);c.onDestroy(f);Va(c)||K(c,!1);return c}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Tg{constructor(a,b){this.tag=a;this.C=b;this.id=olympe.W.yg()}}N('olympe.dc.predicates.InstanceOf',olympe.dc.V.mf);olympe.dc.V.mf.la=[olympe.dc.$a];function Ug(a){return a.La.map(b=>b.R())}function Vg(a){return a.La.map(b=>b.Pa())}
644
- olympe.dc.V.lf=class{constructor(a,b,c){this.La=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.wa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Fc?this.La.push(new Wg(c.R(),c.Pa(),c.F,c.C)):this.La.push(new Wg(olympe.dc.wa(c),b[d],1,1))}ma(){return O(olympe.dc.V.lf)}F(){return[this.La.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.W.fc(),e=olympe.dc.Oa();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
645
- c.Ab()||(f+=h?1:-1,K(c,0<f))};const g=this.La;for(let h=g.length-1;0<=h;h--)a=Xg(g[h],e,a,d+h);tc(e,b,a,d);olympe.D.Ja().onDestroy(()=>{uc(e,b,d)});c.bf(!1);return c}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.La.map(a=>a.ia()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.La.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelated',olympe.dc.V.lf);
646
- function Xg(a,b,c,d){const e=Object.create(null);d+=olympe.W.yg();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,V(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.C(h,a,l))}};return(g,h)=>f(g,h,0)}class Wg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ia(){return`${this.R()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.V.lf.la=[olympe.dc.$a];olympe.dc.V.ul=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return olympe.D.df([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return(Number(c)&Number(d.valueOf()))===Number(c)})}ma(){return O(olympe.dc.V.ul)}F(){return[this.value.C()]}ia(a){const b=olympe.D.lb(this.G)?this.G.Na.Kb.valueOf():this.G.valueOf();return'{"c":"'+this.ma()+'","a":['+b+','+this.value.ia(a)+']}'}toString(){const a=olympe.D.lb(this.G)?this.G.Na.Kb.valueOf():this.G.valueOf();return this.ma().replace(/^.+\./,'')+
647
- '('+a.toString()+','+this.value.toString()+')'}};N('olympe.dc.predicates.BitMask',olympe.dc.V.ul);olympe.dc.V.ul.la=[olympe.dc.$a];let Yg=0;olympe.dc.V.Og=class{constructor(){this.id=Yg++}ma(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ia(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.V.Og.la=[olympe.dc.$a];olympe.dc.V.Ll=class{constructor(a,b,c){this.La=[];this.G=void 0!==c?c.map(olympe.dc.wa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Fc?this.La.push(new Zg(c.R(),c.Pa(),c.F,c.C)):this.La.push(new Zg(olympe.dc.wa(c),b[d],1,1))}ma(){return O(olympe.dc.V.Ll)}F(){return[this.La.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Oa(),e=olympe.W.yg();a=(h,k,l)=>{k&&(null===this.G||this.G.includes(l))&&h(1)};const f=this.La;
648
- for(let h=f.length-1;0<=h;h--)a=f[h].getTransform(d,a,e+h);let g=0;tc(d,b,a.bind(null,h=>{c.G()||c.Ab()||(g+=h,K(c,0<g))}),e);olympe.D.Ja().onDestroy(()=>uc(d,b,e));c.bf(!1);return c}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.La.map(a=>a.ia()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.La.map(a=>a.ia())+')'}};N('olympe.dc.predicates.HasRelatedTree',olympe.dc.V.Ll);
649
- class Zg extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.L=new Map;this.G=new Map}getTransform(a,b,c){const d=this.G,e=this.L,f=new Set,g=(k,l,n)=>{e.has(l)?e.get(l).set(c+n,k):e.set(l,(new Map).set(c+n,k))},h=(k,l,n,p,q)=>{const r=olympe.W.yg();if(p){const t=n+q,u=v=>{const w=e.get(q);if(f.has(t))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${n} and ${q}`);void 0!==w&&
650
- null!==w&&(f.add(t),d.set(q,(d.get(q)||0)+v),Array.from(w.values()).forEach(y=>y(v)));f.delete(t)};g(k,q,n);d.has(q)?k(d.get(q)):(l>=this.F&&b(v=>{d.set(q,(d.get(q)||0)+v);k(v)},p,q),(0>this.C||l<=this.C)&&q!==n&&V(a,q,this,h.bind(this,u,l+1,q),r))}else k(-d.get(q)),e.get(q).delete(c+n),0===e.get(q).size&&(d.delete(q),e.delete(q),a.C(q,this,r))};return(k,l,n)=>h(k,0,'origin',l,n)}ia(){return`${this.R()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.V.Ll.la=[olympe.dc.$a];olympe.dc.X={};olympe.dc.X.sk={et:1,rt:-1,vp:0};olympe.dc.X.mB={Py:!0,mz:!1};olympe.dc.X.Sb=class extends olympe.dc.ta.Relation{constructor(a,b){super(a,b||olympe.dc.Aa.DESTINATION)}Yb(){return Hc(this)}ma(){return O(olympe.dc.X.Sb)}Gc(){return new olympe.dc.X.Sb(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION)}getTransform(a,b,c){const d=olympe.dc.Oa(),e=this.R(),f=this.Pa();return(g,h,k,l)=>{Jg(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.W.mb(k+f+e+p,20),r=ug(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.C(h,this,k)}}ia(){return'{"c":"'+
651
- this.ma()+'","a":["'+this.R()+'","'+this.Pa()+'"]}'}toString(){return'Related('+this.Pa()+this.R()+')'}};N('olympe.dc.transformers.Related',olympe.dc.X.Sb);olympe.dc.X.Sb.la=[olympe.dc.$c];olympe.dc.X.Fc=class extends olympe.dc.ta.Relation{constructor(a,b=olympe.dc.Aa.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.C=d}Yb(){return Hc(this)}ma(){return O(olympe.dc.X.Fc)}getTransform(a,b,c){const d=olympe.dc.Oa(),e=Object.create(null),f=olympe.dc.Aa.ORIGIN,g=olympe.dc.Aa.DESTINATION,h=this.R(),k=this.Pa(),l=(p,q,r)=>{if(!(0<=this.C&&p>=this.C)){var t=d.tb(r,this);p+=1;for(let u=0,v=t.length;u<v;u++){if(void 0!==e[t[u]]||r===t[u])continue;const w=olympe.W.mb(q+k+(h+'_'+p)+t[u],20);b.register(w,
652
- q,r,h,k||g);null===k&&b.register(w,q,r,h,f)}}},n=(p,q,r,t,u,v)=>{u&&!b.F&&l(p,t,v);p>=this.F?c(u,v,t,ug(r,u,v,t)):Jg(b,t,v,h,k);0<=this.C&&p>=this.C||(u?e[v]||(e[v]=!0,V(d,v,this,(w,y)=>{const B=p+1,E=olympe.W.mb(t+k+(h+'_'+B)+y,20);n(B,v,r,E,w,y)},t)):(d.C(v,this,t),delete e[v]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ia(){return'{"c":"'+this.ma()+'","a":["'+this.R()+'","'+this.Pa()+'",'+this.F+','+this.C+']}'}toString(){return'RecursiveRelated('+this.Pa()+this.R()+'['+this.F+'..'+this.C+'])'}};
653
- N('olympe.dc.transformers.RecursiveRelated',olympe.dc.X.Fc);olympe.dc.X.Fc.la=[olympe.dc.$c];function $g(a){return a.La.map(b=>b.R())}
654
- olympe.dc.X.Be=class{constructor(a,b){this.direction=b||olympe.dc.Aa.DESTINATION;this.La=a.map(c=>new olympe.dc.ta.Relation(c,this.direction))}Yb(){return olympe.dc.CloudObject}ma(){return O(olympe.dc.X.Be)}Pa(){return this.direction}getTransform(a,b,c){const d=olympe.dc.Oa(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.Pa();var q=k.R();p=olympe.W.mb(g+p+q+n,20);q=ug(h,l,n,p);l&&b.register(p,g,f,k.R(),k.Pa());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.La.forEach(l=>{Jg(b,h,g,l.R(),l.Pa());e(g,h,k,l)}):this.La.forEach(l=>
655
- {d.C(g,l,h)})}}ia(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify($g(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Pa()+'['+$g(this).join(',')+'])'}};N('olympe.dc.transformers.MultiRelated',olympe.dc.X.Be);olympe.dc.X.Be.la=[olympe.dc.$c];olympe.dc.X.Fl=class{constructor(a,b,c,d){this.C=new olympe.dc.ta.Relation(olympe.dc.wa(a),c||olympe.dc.Aa.DESTINATION);this.F=new olympe.dc.ta.Relation(olympe.dc.wa(b),d||olympe.dc.Aa.DESTINATION)}Yb(){return Hc(this.C)}ma(){return O(olympe.dc.X.Fl)}getTransform(a,b,c){const d=olympe.dc.Oa(),e={},f=this.C.R(),g=this.C.Pa(),h=this.F.R(),k=this.F.Pa();let l=null,n=null;const p=(r,t,u,v,w,y)=>{if(w){if(w=()=>{const B=olympe.W.mb(u+g+(f+'_'+r)+y,20),E=ug(t,!0,y,B);l=r;n=()=>{c(!1,y,B,ug(t,!1,y,B))};
656
- b.register(B,u,v,f,g);c(!0,y,B,E)},w.Zr=r,e[v]=w,null===l||r<l)n&&n(),w()}else if(l===r){n();e[v]=!0;w=Infinity;let B=null;for(let E=Object.keys(e),S=E.length,I=0;I<S;I++){let Z=e[E[I]];Z.Zr<w&&(w=Z.Zr,B=Z)}B&&B()}},q=(r,t,u,v,w)=>{v?e[w]||(e[w]=!0,Jg(b,u,w,f,g),Jg(b,u,w,h,k),V(d,w,this.C,p.bind(this,r,t,u,w),u+'_val'),V(d,w,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.C(w,this.F,u+'_follow'),d.C(w,this.C,u+'_val'),delete e[w])};return(r,t,u,v)=>q(0,v,u,r,t)}ia(){return'{"c":"'+this.ma()+'","a":["'+
657
- this.C.toString()+'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.C.toString()+', '+this.F.toString()+')'}};N('olympe.dc.transformers.FirstRelated',olympe.dc.X.Fl);olympe.dc.X.Fl.la=[olympe.dc.$c];olympe.dc.X.we=class{Yb(){return null}ma(){return O(olympe.dc.X.we)}getTransform(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,ug(h,!0,f,f))):(d[f]++,Ig(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,ug(h,!1,f,f)))}}ia(){return'{"c":"'+this.ma()+'"}'}toString(){return'Distinct()'}};N('olympe.dc.transformers.Distinct',olympe.dc.X.we);olympe.dc.X.we.la=[olympe.dc.$c];olympe.dc.X.Kd=class{constructor(a,b){this.Md=a;this.C=void 0===b?!0:!!b}Yb(){return null}ma(){return O(olympe.dc.X.Kd)}F(){return[this.Md.U()]}getTransform(a,b,c){const d=new olympe.dc.rc.Zq(this.C?this.Md.G.bind(this.Md):(e,f)=>this.Md.G(f,e));return(e,f,g)=>{var h=e?this.Md.L(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ia(a){return'{"c":"'+this.ma()+'","a":['+this.Md.ia(a)+','+JSON.stringify(this.C)+']}'}toString(){return'Sort('+this.Md.toString()+','+JSON.stringify(this.C)+')'}};
658
- N('olympe.dc.transformers.Sort',olympe.dc.X.Kd);olympe.dc.X.Kd.la=[olympe.dc.$c,olympe.dc.tq];olympe.dc.X.vc=class{constructor(a){this.C=a}Yb(){return null}ma(){return O(olympe.dc.X.vc)}F(){return this.C.F()}getTransform(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Ig(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,ug(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;f?(f=this.C.C(a,g),olympe.D.lb(f)&&(f=f.Na),olympe.D.Uf(f)?(b.F||void 0!==olympe.D.bb(f)||Ig(b,h),e[l]=f,olympe.D.Ec([f],n=>{d(g,h,k,n)},'filterResultHandler')):d(g,h,k,f)):(void 0!==e[l]&&(e[l].destroy(),delete e[l]),d(g,h,k,!1),delete e[h])}}ia(a){return'{"c":"'+
659
- this.ma()+'","a":['+this.C.ia(a)+']}'}toString(){return'Filter('+this.C.toString()+')'}};N('olympe.dc.transformers.Filter',olympe.dc.X.vc);olympe.dc.X.vc.la=[olympe.dc.$c,olympe.dc.tq];olympe.dc.X.Zd=class{constructor(a,b){this.start=a;this.C=b}Yb(){return null}ma(){return O(olympe.dc.X.Zd)}getTransform(a,b,c){const d=new olympe.dc.rc.Zl;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);Fg(d,e,f,n,c)}};olympe.D.ie([this.start,this.C],(n,p)=>{f=n.valueOf();g=p.valueOf();k()});Og(b,k);const l=Lg(b);Kg(b,l);return(n,p,q,r)=>{h||(r.Tc().Lg(t=>{e=t;Pg(b,l)}),sg(b,()=>r.tg(),l),h=!0);d.C(n,p,q,null);tg(b,q,l)}}ia(a){return'{"c":"'+
660
- this.ma()+'","a":['+Df(a,this.start)+','+Df(a,this.C)+']}'}toString(){return`Limit(${olympe.D.bb(this.start)},${olympe.D.bb(this.C)})`}};N('olympe.dc.transformers.Limit',olympe.dc.X.Zd);olympe.dc.X.Zd.la=[olympe.dc.$c];function ah(a,b,c,d,e,f){function g(p,q){if(l)for(var r=l.length-1;0<=r;r--)f=l[r].getTransform(b,e,n.C(f));f=n.C(f);e.register(h,null);r=d.C(p,q,c,null);f(p,q,h,ug(r,p,q,h))}const h=olympe.W.fc(),k=olympe.dc.Oa(),l=a.X,n=olympe.D.Ja();olympe.D.Ec([a.C],p=>{bh(k,p,g,h);void 0===k.model(p)&&rg(e)})}function bh(a,b,c,d){const e=b&&b.valueOf();e&&(tc(a,e,c,d),olympe.D.Ja().zc(()=>uc(a,e,d)))}
661
- olympe.dc.X.wf=class{constructor(a,b){this.X=this.C=null;a instanceof olympe.dc.Ca?(this.C=a.Od(),this.X=a.Sl()):(this.C=a,b&&(this.X=b))}Yb(){return null}ma(){return O(olympe.dc.X.wf)||''}Cg(){return this.X}Od(){return this.C}getTransform(a,b,c){const d=new olympe.dc.rc.Zl,e=new olympe.dc.rc.Hj;let f=[],g=[],h=!1,k=!1;const l=Lg(b),n=Lg(b);Og(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):Pg(b);Fg(d,p,0,p.length,c)});Kg(b,n);ah(this,a,this.C,e,b,(p,q,r,t)=>{const u=olympe.D.Ja();
662
- u.G()||u.Ab()||(k||(t.Tc().Lg(v=>{g=v;Pg(b,n)}),sg(b,()=>t.tg(),n),k=!0),d.C(p,q,r),tg(b,r,n))});Kg(b,l);return(p,q,r,t)=>{h||(t.Tc().Lg(u=>{f=u;Pg(b,l)}),sg(b,()=>t.tg(),l),h=!0);d.C(p,q,r,l);tg(b,r,l)}}ia(a){const b=this.X?'['+this.X.map(c=>c.ia(a)).join(',')+']':'null';return'{"c":"'+this.ma()+'","a":['+Df(a,this.C)+','+b+']}'}toString(){const a=olympe.D.lb(this.C)?'N:'+this.C.Na.Z():this.C.valueOf(),b=this.X?','+this.X.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
663
- N('olympe.dc.transformers.Union',olympe.dc.X.wf);olympe.dc.X.wf.la=[olympe.dc.$c];olympe.dc.Mg={};function ch(a,b){let c=zc.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Cf(b);if(null===b)break;c=zc.get(b)||null}return c||null}olympe.dc.Mg.SyncManager=class{constructor(a,b,c){this.N=a;this.db=b;this.C=c}};olympe.dc.Mg.P={Ea:'dc.syncs.Logger',xa:'dc.syncs.SyncManager'};olympe.T.config(function(a){C(a,olympe.dc.Mg.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc'));A(a,olympe.dc.Mg.P.xa,olympe.dc.Mg.SyncManager,olympe.dc.Mg.P.Ea,olympe.dc.P.vi,olympe.T.P.cg)});olympe.dc.W={};olympe.dc.W.WC=function(a){a=olympe.dc.wa(a);const b=olympe.D.Uc(olympe.D.Wa,'getInstanceName'),c=olympe.dc.Oa(),d=wd(c,a,olympe.dc.CloudObject.nameProp,b.update.bind(b));olympe.D.Ja().zc(c.F.bind(c,a,olympe.dc.CloudObject.nameProp,d));return b.Fb()};olympe.dc.W.ZC=function(a){return olympe.D.Fa([a],b=>olympe.D.iy(olympe.dc.Oa().mj(b)),olympe.D.qa)};olympe.dc.W.$C=function(a){return(a=olympe.D.bb(a))?olympe.dc.Oa().mj(a):!1};olympe.dc.W.Ki=class a{constructor(b=olympe.dc.Ga.Pc){this.G=b}C(b){const c=new olympe.dc.db.Ac;this.F(b,c);return c}U(b,c,d){const e=new olympe.dc.db.Ac(b),f=new olympe.dc.query.Ci(b,this.G,c,e);this.F(d,e,(g,h)=>{h=h||[];const k=f.C.get(g)||new Set;for(const l of h)k.add(l);f.C.set(g,k)});return f}L(b,c){const d=new olympe.dc.db.Ac(b),e=new olympe.dc.query.ot(b,d);this.F(c,d,(f,g,h)=>{h=h||[];const k=new hf(f);k.add=g||[];k.remove=h;e.C.set(f,k)});return e}F(b,c,d){const e=olympe.dc.$b.Jd;for(const f of b)switch(b=
664
- f.i?f.i:-1,f.o){case 1:const g=a.C(f.p||{});g.has(e)||g.set(e,this.G);c.F(f.t,g,b);break;case 2:c.tc(f.t,a.C(f.p),!0,b);break;case 3:c.Mc(f.t,f.f,b);break;case 4:c.Ra(f.m,f.l,f.r,b);break;case 5:c.ec(f.m,f.l,f.r,b);break;case 6:d&&d(f.i,f.a,f.d);break;default:throw Error('Undefined patch operation: '+f.o);}}static C(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;if(b===olympe.dc.$b.Jd||b===olympe.dc.$b.VERSION){c.set(b,e);continue}else if('v'===d){c.set(olympe.dc.$b.VERSION,e);continue}let f=
665
- typeof e;b.startsWith('fd')&&(b=olympe.dc.Ug.jc+b.substr(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&
522
+ olympe.dc.Va.prototype.push=olympe.dc.Va.prototype.push;olympe.dc.Va.prototype.getAt=olympe.dc.Va.prototype.re;olympe.dc.Va.prototype.getFirst=olympe.dc.Va.prototype.Sc;olympe.dc.Va.prototype.get=olympe.dc.Va.prototype.get;olympe.dc.Va.prototype.indexOf=olympe.dc.Va.prototype.indexOf;olympe.dc.Va.prototype.has=olympe.dc.Va.prototype.has;olympe.dc.Va.prototype.size=olympe.dc.Va.prototype.size;olympe.dc.Va.prototype.toArray=olympe.dc.Va.prototype.ff;olympe.dc.Va.prototype.keys=olympe.dc.Va.prototype.keys;
523
+ olympe.dc.Va.prototype.values=olympe.dc.Va.prototype.values;olympe.dc.Va.prototype.entries=olympe.dc.Va.prototype.entries;olympe.dc.Va.empty=olympe.dc.Va.empty;function He(a){var b=new Set(X(a,a.Bg()-1).keys());a.C.push((new Map).set('sink',b));b=[];for(const c of Ie(a,'sink',a.Bg()-1,''))b.push(c.slice(0,-1).split(';'));a.C.pop();return b}function Je(a,b,c,d,e){a.Md={Md:b,Lv:c,order:d,kb:e}}function Ke(a){a.F||(a.F=!0)}function X(a,b){return b>=a.Bg()?new Map:a.C[b]}
524
+ function Ie(a,b,c,d){if(0===c)return a.G.has(c)?(b=Array.from(X(a,0).keys())[0],(new Set).add(`${b};${d}`)):(new Set).add(d);const e=Le(a,b,c),f=a.G.has(c)?`${b};${d}`:d;return e.reduce((g,h)=>{for(const k of Ie(a,h,c-1,f))g.add(k);return g},new Set)}function Le(a,b,c){return 0===c?null:(a=X(a,c))&&a.has(b)?Array.from(a.get(b)):null}function Me(a,b,c,d){X(a,c+1).forEach((e,f)=>{e.has(d)&&a.remove(f,c+1,b)});X(a,c).delete(d);Ke(a)}
525
+ olympe.dc.ba.rq=class{constructor(a){this.C=Array.from({length:se(a)+1},()=>new Map);this.G=new Set(Array.from(a.F));this.Md=null;this.F=!1;this.max=a.max;this.offset=a.offset}Bg(){return this.C.length}insert(a,b,c){var d=X(this,b);if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.ra.Xa('dc').error('Try to insert result entry linked to a non existing parent'),null;if(d.has(a)&&null!==c)return a=d.get(a),d=a.size,a.add(c),a.size>d&&Ke(this),!1;if(b>=this.Bg())return olympe.ra.Xa('dc').error('Try to insert result entry to a higher level than possible'),
526
+ null;b=new Set;null!==c&&b.add(c);d.set(a,b);Ke(this);return!0}remove(a,b,c){var d=X(this,b);if(!d.has(a))return!0;if(0<b&&(null===c||!X(this,b-1).has(c)))return olympe.ra.Xa('dc').error('Try to remove result entry linked to a non existing parent'),null;d=d.get(a);c&&d.delete(c);if(1>d.size)return Me(this,a,b,a),!0;Ke(this);return!1}};olympe.dc.od=class{constructor(a){this.query=a}static from(a){return new olympe.dc.od(olympe.dc.gb.from(a))}sb(a){return new olympe.dc.od(this.query.sb(a))}aj(){return this}hb(a){return this.query.hb(a).then(b=>{const c=b.size();return 1<c?(olympe.ra.Xa('dc').warn('a follow() on a QuerySingle has '+c+' results (0 or 1 expected) -> returns null'),null):b.Sc()||null})}jd(){const a=this.query.jd(),b=a.size();return 1<b?(olympe.ra.Xa('dc').warn('a follow() on a QuerySingle has '+b+' results (0 or 1 expected) -> returns null'),
527
+ null):a.Sc()||null}};olympe.dc.od.prototype.executeFromCache=olympe.dc.od.prototype.jd;olympe.dc.od.prototype.execute=olympe.dc.od.prototype.hb;olympe.dc.od.prototype.cast=olympe.dc.od.prototype.aj;olympe.dc.od.prototype.follow=olympe.dc.od.prototype.sb;olympe.dc.ba.V={};olympe.dc.ba.V.Ud=class{constructor(...a){this.V=a}hb(a){return this.V.reduce((b,c)=>b&&c.hb(a),!0)}observe(a,b,c){const d=this.V.map(()=>!1),e=this.V.map(()=>null),f=(g,h)=>{d[h]=g;g=d.every(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.mb('AND-'+b+a+h),k=>f(k,h))})}ja(){return{pr:8,p:this.V.map(a=>a.ja())}}toString(){return'And-'+this.V.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.mb('AND-'+b+a+d))})}};
528
+ olympe.dc.ba.V.Ud.C=8;olympe.dc.ba.V.Ud.la=[olympe.dc.ba.$a];olympe.dc.ba.V.Wc=class{constructor(a,b,c,d=!1){this.kb=olympe.dc.wa(a);this.substring=b;this.db=c;this.C=d}fb(){return this.kb}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){Ad(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.kb+'-'+this.substring+'-'+this.C}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+
529
+ a+this.toString()))}ja(){return{pr:2,p:this.kb,s:this.substring,c:this.C}}};olympe.dc.ba.V.Wc.C=2;olympe.dc.ba.V.Wc.la=[olympe.dc.ba.$a];olympe.dc.ba.V.Ic=class{constructor(a,b,c){this.kb=olympe.dc.wa(a);this.C=b;this.db=c}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){Ad(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.qb(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.qb(this.C):!1:a===
530
+ this.C}toString(){return'Equals-'+this.kb+'-'+this.C.toString()}fb(){return this.kb}ja(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.R();break;case this.C instanceof olympe.D.Color:a=4,b={r:this.C.Rf().valueOf(),g:this.C.Lf().valueOf(),b:this.C.Gf().valueOf(),a:this.C.Ff().valueOf()}}return{pr:1,p:this.kb,t:a,v:b}}};olympe.dc.ba.V.Ic.C=1;olympe.dc.ba.V.Ic.la=[olympe.dc.ba.$a];function Ne(a,b,c){return null===b?!1:null===c?!0:a.G?a.F?b<c:b>c:a.F?b<=c:b>=c}function Oe(a,b){return'number'===typeof a.C?a.C:a.db.fb(b,a.C)}function Pe(a,b,c){return olympe.W.mb(c+b+a.C+a.kb)}
531
+ olympe.dc.ba.V.Dh=class{constructor(a,b,c=!0,d=!0){this.db=olympe.dc.Oa();this.kb=olympe.dc.wa(a);this.C='number'===typeof b?b:olympe.dc.wa(b);this.F=c;this.G=d}fb(){return this.kb}hb(a){return Ne(this,this.db.fb(a,this.kb),Oe(this,a))}observe(a,b,c){'string'===typeof this.C&&Ad(this.db,a,this.C,d=>{const e=this.db.fb(a,this.kb);null!==e&&c(Ne(this,e,d))},Pe(this,a,b));Ad(this.db,a,this.kb,d=>{const e=Oe(this,a);c(null!==e?Ne(this,d,e):!0)},Pe(this,a,b))}clear(a,b){this.db.F(a,this.kb,Pe(this,a,b));
532
+ 'string'===typeof this.C&&this.db.F(a,this.C,Pe(this,a,b))}ja(){return{pr:3,p:this.kb,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.kb+'-'+this.G+'-'+this.C}};olympe.dc.ba.V.Dh.C=3;olympe.dc.ba.V.Dh.la=[olympe.dc.ba.$a];olympe.dc.ba.V.nd=class{constructor(a){this.C=a}hb(a){return!this.C.hb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.W.mb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}ja(){return{pr:4,v:this.C.ja()}}toString(){return`NOT-${this.C.toString()}`}clear(a,b){this.C.clear(a,olympe.W.mb('NOT'+b+a))}};olympe.dc.ba.V.nd.C=4;olympe.dc.ba.V.nd.la=[olympe.dc.ba.$a];olympe.dc.ba.V.ae=class{constructor(...a){this.V=a}hb(a){return this.V.reduce((b,c)=>b||c.hb(a),!1)}observe(a,b,c){const d=this.V.map(()=>!1),e=this.V.map(()=>null),f=(g,h)=>{d[h]=g;g=d.some(k=>k);e[h]!==g&&(e[h]=g,c(g))};this.V.forEach((g,h)=>{g.observe(a,olympe.W.mb('OR-'+b+a+h),k=>f(k,h))})}ja(){return{pr:7,p:this.V.map(a=>a.ja())}}toString(){return'And-'+this.V.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.V.forEach((c,d)=>{c.clear(a,olympe.W.mb('OR-'+b+a+d))})}};
533
+ olympe.dc.ba.V.ae.C=7;olympe.dc.ba.V.ae.la=[olympe.dc.ba.$a];olympe.dc.ba.V.wd=class{constructor(a,b,c,d=!0){this.kb=olympe.dc.wa(a);this.C=RegExp('');try{this.C=new RegExp(b)}catch(e){if(!(e instanceof SyntaxError))throw e;}this.db=c;this.F=d}fb(){return this.kb}hb(a){return this.apply(this.db.fb(a,this.kb))}observe(a,b,c){Ad(this.db,a,this.kb,d=>{c(this.apply(d))},olympe.W.mb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.F?this.C.test(a):this.C.test(a.toLowerCase()):!1}toString(){return'Regex'+this.kb+'-'+this.C.toString()+'-'+this.F}ja(){return{pr:5,
534
+ p:this.kb,r:this.C.source,c:this.F}}clear(a,b){this.db.F(a,this.kb,olympe.W.mb(b+a+this.toString()))}};olympe.dc.ba.V.wd.C=5;olympe.dc.ba.V.wd.la=[olympe.dc.ba.$a];olympe.dc.ba.V.Ee=class{constructor(a){this.db=olympe.dc.Oa();this.La=[];this.recursive=[];this.destination=a?olympe.dc.wa(a):null}ld(){return Array.from(this.La)}clear(a,b){0<this.La.length&&this.db.C(a,this.La[0],olympe.W.mb(b+0+a))}sb(a){this.La.push(a);this.recursive.push(!1);return this}Pk(a){this.La.push(a);this.recursive.push(!0);return this}hb(a){if(1>this.La.length)return olympe.ra.Xa('dc').error('RelatedTo executed with less than 1 relation'),!1;let b=[];const c=this.destination||'',d=(e,
535
+ f,g,h)=>e?f?this.db.Qf(g,h,c):this.db.Qf(g,h):this.db.tb(g,h);for(let e=0;e<this.La.length;++e){const f=this.La[e],g=this.recursive[e],h=e===this.La.length-1;if(0===e)b=d(g,h,a,f);else if(b=b.flatMap(k=>d(g,h,k,f)),0===b.length)return!1}return c?b.includes(c):0<b.length}observe(a,b,c){const d=this.La.length;let e=0;const f=new Set,g=(k,l)=>{this.destination&&this.destination!==l||(e+=k?1:-1,1<e||c(0<e))},h=(k,l,n,p)=>{const q=this.La[k],r=this.recursive[k-1]?this.La[k-1]:null;l=olympe.W.mb(l+k+p);
536
+ const t=olympe.W.mb(l+'rec');k===d?g(n,p):n?f.has(p)||(f.add(p),V(this.db,p,q,h.bind(this,k+1,l),l),r&&V(this.db,p,r,h.bind(this,k,t),t)):(f.delete(p),this.db.C(p,q,l),r&&this.db.C(p,r,t))};h(0,b,!0,a);0===e&&c(!1)}ja(){return{pr:6,r:this.La.map((a,b)=>[a.R(),a.Pa(),this.recursive[b]]),d:this.destination}}toString(){const a=this.La.reduce((b,c,d)=>b+c.R()+this.recursive[d],'');return`RelatedTo-${this.destination}-${a}`}};olympe.dc.ba.V.Ee.prototype.followRecursive=olympe.dc.ba.V.Ee.prototype.Pk;
537
+ olympe.dc.ba.V.Ee.prototype.follow=olympe.dc.ba.V.Ee.prototype.sb;olympe.dc.ba.V.Ee.C=6;olympe.dc.ba.V.Ee.la=[olympe.dc.ba.$a];olympe.dc.ba.Hb={};olympe.dc.ba.Hb.vc=class{constructor(a){this.C=a}F(a){return a}hb(a,b){for(const c of X(a,b).keys())this.C.hb(c)||(0===b?a.remove(c,b,null):Le(a,c,b).forEach(d=>{a.remove(c,b,d)}))}observe(a,b,c){let d=!1;return(e,f,g,h)=>{const k=olympe.W.mb(h+f+this.toString());e?this.C.observe(f,k,l=>{d||(l?a.insert(f,b,g):a.remove(f,b,g),c(l,f,g,k))}):(d=!0,this.C.clear(f,k),d=!1,c(!1,f,g,k))}}ja(){return{t:1,p:this.C.ja()}}toString(){return'filterQueryPart-'+this.C.toString()}};olympe.dc.ba.Hb.vc.C=1;
538
+ olympe.dc.ba.Hb.vc.la=[olympe.dc.ba.pk];olympe.dc.ba.Hb.jf=class{constructor(a,b){this.db=a;this.C=b}Qd(){return this.C}F(a){return a+1}hb(a,b){for(const c of X(a,b).keys())this.db.tb(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){return(d,e,f,g)=>{const h=olympe.W.mb(g+e+this.toString());d?V(this.db,e,this.C,(k,l)=>{(k?a.insert(l,b+1,e):a.remove(l,b+1,e))&&c(k,l,e,h)},h):this.db.C(e,this.C,h)}}ja(){return{t:2,r:{t:this.C.R(),d:this.C.Pa()}}}toString(){return'followQueryPart-'+this.C.Pa()+this.C.R()}};olympe.dc.ba.Hb.jf.C=2;
539
+ olympe.dc.ba.Hb.jf.la=[olympe.dc.ba.pk];olympe.dc.ba.Hb.kf=class{constructor(a,b,c=!1){this.db=a;this.C=b;this.G=c}Qd(){return this.C}F(a){return a+1}hb(a,b){for(const c of X(a,b).keys())this.G&&a.insert(c,b+1,c),this.db.Qf(c,this.C).forEach(d=>{a.insert(d,b+1,c)})}observe(a,b,c){const d=(g,h,k,l)=>olympe.W.mb(g+h+k+l+this.toString()),e=new Set,f=(g,h,k,l,n)=>{h=d(h,g,n,k);(this.G||0<k)&&(l?a.insert(n,b+1,g):a.remove(n,b+1,g))&&c(l,n,g,h);l?e.has(n)||(e.add(n),V(this.db,n,this.C,f.bind(this,g,h,k+1),h)):(e.delete(n),this.db.C(n,this.C,
540
+ h))};return(g,h,k,l)=>f(h,l,0,g,h)}ja(){return{t:3,s:this.G,r:{t:this.C.R(),d:this.C.Pa()}}}toString(){return'followRecursivelyQueryPart-'+this.C.Pa()+this.C.R()}};olympe.dc.ba.Hb.kf.C=3;olympe.dc.ba.Hb.kf.la=[olympe.dc.ba.pk];function Qe(a){a=a.db.ic(a.kb,olympe.dm.Property.typeRel);const b=olympe.dc.wa;if(a===b(olympe.dm.String))return Re((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Re((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Re((c,d)=>c.getTime()-d.getTime());olympe.ra.Xa('dc').warn(`No comparator found for type with tag ${a}`);return Re(()=>-1)}function Re(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
541
+ olympe.dc.ba.Hb.Ph=class{constructor(a,b,c){this.db=a;this.kb=b;this.order=c}F(a){return a}hb(a,b){Je(a,Qe(this),b,this.order,this.kb)}observe(a,b,c){Je(a,Qe(this),b,this.order,this.kb);return(d,e,f,g)=>{g=olympe.W.mb(g+this.toString());d?Ad(this.db,e,this.kb,()=>{Ke(a)},g):this.db.F(e,this.kb,g);c(d,e,f,g)}}ja(){return{t:4,p:this.kb.R(),o:this.order}}toString(){return'sortByQueryPart-'+this.order+this.kb.R()}fb(){return this.kb}};olympe.dc.ba.Hb.Ph.C=4;olympe.dc.ba.Hb.Ph.la=[olympe.dc.ba.pk];olympe.dc.query={};function Se(a,b,c,d){let e=a.C.get(b);void 0===e&&(e=new Set,a.C.set(b,e));a=olympe.W.hc();e.add(a);d.set(a,c)}function Te(a,b,c){Se(a,b,c,a.F)}function Ue(a,b,c){if(a.C.has(b)){for(const d of a.C.get(b))c.delete(d);a.C.delete(b)}}function Ve(a,b,c,d,e){if(a.C.has(b)){if(!a.N.has(b)){a.N.add(b);for(const f of a.C.get(b))e=d.get(f),d.delete(f),c instanceof olympe.dc.query.errors.Zj?e(Error(c.aa()),c):'string'===typeof c?e(Error(c),null):e(null,c);a.C.delete(b);a.N.delete(b)}}else a.L.warn(e)}
542
+ function We(a,b,c){Ve(a,b,c,a.F,`Graph result of graphdef ${b} has no associated handler in the datacloud`)}function Xe(a,b,c){Se(a,b,c,a.G)}olympe.dc.query.Ms=class{constructor(a){this.L=a;this.C=new Map;this.F=new Map;this.G=new Map;this.N=new Set}};olympe.dc.Oe=class{ma(){}N(){}G(){}U(){}ja(){}toString(){}};olympe.dc.Ed={SUBSCRIBE:0,Ni:1,nm:2,iB:0,GET:1};olympe.dc.Ed.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Ed))if(c===a)return b;return null};function ve(a,b=1){a.validate(olympe.dc.Ub.NONE,'back');let c=a.Y;for(let d=0;d<b&&null!==c;d++)c=a.F.get(c.F)||null;a.Y=c}function Ye(a){return'not_defined'===a.C?olympe.dc.Ub.NONE:a.C}function Ze(a,b){a.validate(b,'activateFollowRules');return a}function $e(a){return'not_defined'!==a.C&&a.C!==olympe.dc.Ub.NONE}
543
+ function af(a){if($e(a))throw Error('An implicit GraphDef has no blocks');return a.F.values()}
544
+ function bf(a,b,c){c=new olympe.dc.query.Relation(b.R(),b.Pa(),c||b instanceof olympe.dc.X.Fc);b=[];var d;for(var e of cf(a)){if(d=a.F.get(e)){var f=new olympe.dc.query.Yj(c,d.id);d.children.has(f.Z())?d=d.children.get(f.Z()):(d.children.set(f.Z(),f),d=f)}else{d=a;var g=c;const h=olympe.W.mb(d.G);f=olympe.W.mb(h+g.toString());g=d.F.get(f)||new olympe.dc.query.Yj(g,h);d.U.set(f,g);d=g}f=d.Z();a.F.set(f,d);b.push(f)}e=b[0];a.oa.set(e,b);return a.F.get(e)}
545
+ function df(a,b){if($e(a))a.aa.push(b);else throw Error('You cannot add a "skip predicate" to an explicit graphdef. Please activate a follow rule first.');return a}function ef(a,b){a.ha=b;return a}function ff(a){const b=new olympe.dc.lf(a.G,a.N);b.C=a.C;for(const [c,d]of a.U)b.U.set(c,d);for(const [c,d]of a.F)b.F.set(c,d);b.ha=a.ha;b.aa=[...a.aa];return b}function gf(a,b){return $e(a)?new olympe.dc.query.Ql(ff(a),b||olympe.D.Ja()):new olympe.dc.query.Xj(ff(a),b||olympe.D.Ja())}
546
+ function cf(a){let b=a.Y;const c=[];for(;b&&b.Qd().recursive;)c.push(b.Z()),b=a.F.get(b.F)||null;c.push(b&&b.Z()||olympe.W.mb(a.G));const d=[];c.slice(0,5).forEach(e=>{d.push(...a.oa.get(e))});return d}
547
+ olympe.dc.lf=class{constructor(a,b=olympe.dc.Ed.SUBSCRIBE){if(void 0===a||null===a)throw Error('Cannot create GraphDef with undefined or null baseTag');this.G=olympe.dc.wa(a);this.N=b;this.C='not_defined';this.aa=[];this.Y=null;this.U=new Map;this.F=new Map;this.ha=null;this.oa=(new Map).set(olympe.W.mb(this.G),[olympe.W.mb(this.G)])}static Mc(a,b){olympe.dc.lf.Te([a],b)}static Te(a,b){const c=new olympe.dc.Transaction;a.forEach(d=>c.delete(d,olympe.dc.Ub.Hc));c.hb(b)}toJSON(){const a=Object.create(null),
548
+ b=c=>{const d=Object.create(null),e=c.Qd();d.t=e.R();d.d=e.Pa();d.r=e.recursive;d.c=c.lh().map(b);return d};a.t=this.G;a.o=this.N;a.f=Ye(this);a.b=Array.from(this.U.keys()).map(c=>b(this.F.get(c)));return JSON.stringify(a)}static oc(a){a='string'===typeof a?JSON.parse(a):a;const b=Ze(new olympe.dc.lf(a.t,a.o),a.f),c=d=>{const e=new olympe.dc.ta.Relation(d.t,d.d);b.sb(e,d.r);for(const f of d.c)c(f);ve(b)};for(const d of a.b)c(d);return b}Z(){const a=olympe.W.mb,b=d=>d.Z()+d.lh().map(e=>b(e)).sort().join(''),
549
+ c=Array.from(this.U,([,d])=>b(d)).sort().join('');return a(`${this.N}-${this.G}${c}-${Ye(this)}`)}add(a,b=!1){this.validate(olympe.dc.Ub.NONE,'add');bf(this,a,b);return this}sb(a,b=!1){this.validate(olympe.dc.Ub.NONE,'follow');this.Y=bf(this,a,b);return this}hb(a=b=>b){'not_defined'===this.C&&(this.C=olympe.dc.Ub.NONE);const b=olympe.dc.Of();a=olympe.D.Ja().C(a);switch(this.N){case olympe.dc.Ed.SUBSCRIBE:case olympe.dc.Ed.Ni:const c=hf(b,this,a);olympe.D.Ja().zc(()=>{jf(olympe.dc.Of(),c.Z())});break;
550
+ case olympe.dc.Ed.nm:kf(b,this,a);break;default:throw Error('Wrong graph operation');}}validate(a,b){if('not_defined'!==this.C&&this.C!==a)throw Error(this.C!==olympe.dc.Ub.NONE?`Method ${b} can't be called on an implicit Graphdef`:`Method ${b} can't be called on an explicit Graphdef`);this.C=a}};function lf(a,b){a.data.Qc(b.data);a.C.forEach((c,d)=>{if(b.C.has(d))d=b.C.get(d),d.add.push(...c.add),d.remove.push(...c.remove);else{var e=c.remove;const f=new mf(d);f.add=c.add;f.remove=e;b.C.set(d,f)}})}function nf(a,b){a.C.forEach((c,d)=>b(d,c.add,c.remove))}olympe.dc.query.rt=class{constructor(a,b){this.id=a;this.C=new Map;this.data=b}Z(){return this.id}};class mf{constructor(a){this.id=a;this.add=[];this.remove=[]}Z(){return this.id}};function of(a){return(a=a.C)&&olympe.dc.Oa().source(a)||olympe.dc.Ga.Pc}function pf(a){return Array.from(a.Da,b=>a.F.get(b))}function qf(a){if(!a.N){for(const b of a.U.values())b();a.U.clear();a.N=!0}}
551
+ olympe.dc.query.Xj=class{constructor(a,b){this.qh=a;this.C=a.G;this.id=a.Z();this.aa=new olympe.D.Xb(`GraphSubscription ${this.id}`,b);this.L=olympe.ra.Xa('dc.query');this.Da=[];this.F=new Map;this.N=!1;this.U=new Map;b=olympe.W.mb(this.C);if(!$e(a))for(const c of af(a))this.F.set(c.Z(),c),c.F===b&&this.Da.push(c.Z())}Z(){return this.id}Le(a,b){b=b||olympe.W.hc();this.N?a():this.U.set(b,olympe.D.Ja().C(a));return b}uj(a){return this.U.delete(a)}onDestroy(a){this.aa.onDestroy(a)}release(){this.aa.destroy()}Y(){return function*(a,
552
+ b){yield a;for(const c of b)yield*c.ee()}(this.C,this.F.values())}ha(a){const b=olympe.W.mb(this.C);rf(a,(c,d)=>{if(b!==c)if(c=this.F.get(c),void 0===c)this.L.error('Try to apply a block result that does not exists in the original query');else for(const e of d)c.C.add(e)})}oa(a){let b=[],c=[];const d=olympe.W.mb(this.C);nf(a,(e,f,g)=>{const h=d===e,k=this.F.get(e);h||void 0!==k?h?(b.push(...f),c.push(...g)):(b=b.concat(f.filter(l=>{k.C.has(l)?l=!1:(k.C.add(l),l=!0);return l})),c=c.concat(g.filter(l=>
553
+ k.C.delete(l)))):this.L.error(`A notification contains a block ${e} which is not present in the current graph query ${this.id}`)});Sc(olympe.dc.Ad(),b,c)}Jr(a){const b=a.C,c=[],d=this.C;d===b&&c.push(olympe.W.mb(d));this.F.forEach((k,l)=>{k.C.has(b)&&c.push(l)});const e=olympe.W.mb,f=this.F,g=(k,l)=>{const n=l.Qd(),p=[e(k+n),e(k+new olympe.dc.query.Relation(n.tag,n.direction,!0))].filter(q=>f.has(q));return 0<p.length?l.lh().reduce((q,r)=>q&&g(p[0],r),!0):!1},h=pf(a);return void 0!==c.find(k=>{for(const l of h)if(!g(k,
554
+ l))return!1;return!0})}};olympe.dc.query.Yj=class{constructor(a,b){this.G=a;this.children=new Map;this.C=new Set;this.F=b;this.id=olympe.W.mb(b+a.toString());this.apply=!0}toJSON(){let a='{ "id": '+JSON.stringify(this.id)+', "parentId": '+JSON.stringify(this.F)+', "apply": '+JSON.stringify(this.apply)+', ';a+='"relation": '+this.G.toJSON();if(0<this.children.size){a+=', "children": [';for(const b of this.children.values())a+=b.toJSON()+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}if(0<this.C.size){a+=', "instances": [';
555
+ for(const b of this.C)a+=JSON.stringify(b)+', ';a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=']'}return a+'}'}static oc(a){var b;'string'===typeof a?b=JSON.parse(a):b=a;a=olympe.dc.query.Relation.oc(b.relation);a=new olympe.dc.query.Yj(a,b.parentId);a.id=b.id;a.apply=b.apply;if(b.instances)for(const c of b.instances)a.C.add(c);if(b.children)for(const c of b.children)b=olympe.dc.query.Yj.oc(c),a.children.set(b.id,b);return a}Z(){return this.id}Qd(){return this.G}lh(){return Array.from(this.children.values())}ee(){return this.C.values()}toString(){return this.F+
556
+ this.G.toString()}};function rf(a,b){a.C.forEach((c,d)=>b(d,c))}
557
+ olympe.dc.query.Ei=class{constructor(a,b,c,d){this.id=a;this.source=b;this.destination=c;this.C=new Map;this.Dc=d}toJSON(){let a=`{ "id": "${this.id}", "source": "${this.source}", "destination": "${this.destination}"`;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=', "blocks": {';for(const [b,c]of this.C)a+=`"${b}": ${JSON.stringify(Array.from(c))}, `;a.endsWith(', ')&&(a=a.substr(0,a.length-2));a+=`}, "patch": ${this.Dc.toJSON()}`;return a+'}'}static oc(a){let b;'string'===typeof a?b=JSON.parse(a):
558
+ b=a;a=olympe.dc.db.Ac.oc(b.patch);a=new olympe.dc.query.Ei(b.id,b.source,b.destination,a);for(const [c,d]of Object.entries(b.blocks))a.C.set(c,new Set(d));return a}Z(){return this.id}};const sf=olympe.dc.lc.Xc,tf=olympe.dc.lc.zi,uf=olympe.dc.Aa.ORIGIN,vf=olympe.dc.Aa.DESTINATION;function wf(a,b,c){const d=a.qh.aa;return c.filter(e=>d.reduce((f,g)=>f&&!g(b,e.Qd()),!0))}
559
+ olympe.dc.query.Ql=class extends olympe.dc.query.Xj{constructor(a,b){super(a,b);this.G=(new Set).add(a.G)}Y(){return this.G.values()}ha(a){a=a.Dc;for(const b of a.ee())b.N()?this.G.delete(b.tag()):b.se()&&this.G.add(b.tag())}oa(a){let b=[],c=[];nf(a,(d,e,f)=>{b=b.concat(e.filter(g=>{if(this.G.has(g)&&this.C!==g)return!1;this.G.add(g);return!0}));c=c.concat(f.filter(g=>this.G.delete(g)))});Sc(olympe.dc.Ad(),b,c)}Jr(a){var b=a.C,c=Array.from(a.F.values()),d=wf(this,b,c);if(d.length===c.length&&!this.G.has(b))return!1;
560
+ b=olympe.dm.Relation.C.Dk;c=olympe.dm.Relation.C.sk;const e=olympe.dc.Oa();for(const h of d){var f=h.Qd(),g=f.R();d=f.Pa();if(d!==vf||g!==sf&&g!==tf){if(!e.Eb(f))return this.L.info('ImplicitGraphQuery: checking coverage of graphPath',a.Z(),'failed at the relation',g,'which is not in local DB'),!1;f=Dd(e,f,Ye(this.qh));g=0===h.lh().length;if(!(f&(d===uf?g?12:c:g?3:b)))return!1}}return!0}};function xf(a){let b=null;for(a=[...a.X];null===b&&0<a.length;)b=a.pop().Yb();return b}function yf(a,b){a.Y()||(a=`Calling "${b}" on subscription with id ${a.Z()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback.',olympe.ra.Xa('dc').warn(a))}
561
+ function zf(a,b){const c=new olympe.D.Xb('listDef toObservable',a.qc().Eh());return new rxjs.Observable(d=>{c.run(()=>{olympe.D.Ec([b],e=>{d.next(e.valueOf())})});c.onDestroy(()=>{d.complete()});return c.destroy.bind(c)})}
562
+ olympe.dc.Ca=class{constructor(a,b,c){void 0===a||null===a?olympe.ra.Xa('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.Fa([a],olympe.dc.wa,String),this.X=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||xf(this),this.C=null)}Tc(){return olympe.dc.Tc()}hb(){if(null===this.C){const a=olympe.dc.Of();this.C=Af(a,this);null!==this.valueType&&this.C.Gd(this.valueType);olympe.D.Ja().zc(()=>{Bf(a,this.C.Z());this.C=
563
+ null})}return this}qc(){null===this.C&&this.hb();return this.C}Gd(a){this.valueType=a;null!==this.C&&this.C.Gd(this.valueType)}Yb(){return null!==this.C?this.C.Yb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Od(){return this.F}Tl(){return this.X}Le(a,b){return this.qc().Le(a,b)}uj(a){this.qc().uj(a)}Jt(){return this.qc().Ve()}It(){return this.qc().Y()}get(a){return this.qc().get(a)}ei(){return this.qc().ei()}mh(a){const b=this.qc();yf(b,'getCurrent');return b.mh(a)}has(a){return this.qc().has(a)}Fg(a){const b=
564
+ this.qc();yf(b,'hasCurrent');return b.Fg(a)}re(a){return this.qc().re(a)}$x(a){return zf(this,this.re(a))}We(a){const b=this.qc();yf(b,'getCurrentAt');return b.We(a)}Xe(a){return this.qc().Xe(a)}Hf(a){const b=this.qc();yf(b,'getCurrentKeyAt');return b.Hf(a)}fe(a){return this.qc().fe(a)}gy(a){return zf(this,this.fe(a))}If(a){const b=this.qc();yf(b,'getCurrentRank');return b.If(a)}Sc(){return this.qc().Sc()}ay(){return zf(this,this.Sc())}Jf(){return this.qc().Jf()}pf(){return this.qc().pf()}hy(){return zf(this,
565
+ this.pf())}Ag(){const a=this.qc();yf(a,'getCurrentSize');return a.Ag()}forEach(a,b){this.qc().forEach(a,b)}ce(a){const b=this.qc();yf(b,'forEachCurrentValue');return b.ce(a)}dj(a,b,c,d){a=new olympe.dc.X.Zd(a,b);(new olympe.dc.Ca(this.F,[...this.X,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.X];for(const c of b){if(void 0===
566
+ c)throw Error('ListDef.transform(): Trying to set an undefined transformer');if(c instanceof olympe.dc.ta.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.getTransform)break;a.push(c)}b=new olympe.dc.Ca(this.F,a);b.Gd(xf(b)||this.valueType||Object);return b}ml(a){return this.transform(new olympe.dc.X.xf(a))}filter(a){return this.transform(new olympe.dc.X.vc(a))}wg(){const a=new olympe.dc.gk(this.F,null===this.valueType?
567
+ void 0:this.valueType);let b=this.X;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.X;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.bb(this.F)+a+')'}Ht(){return this.qc().Wg()}Vc(){return olympe.D.Fa([this.pf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.We(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Bb(b+']')},olympe.D.Wa)}};olympe.dc.Ca.prototype.filter=olympe.dc.Ca.prototype.filter;olympe.dc.Ca.prototype.union=olympe.dc.Ca.prototype.ml;
568
+ olympe.dc.Ca.prototype.transform=olympe.dc.Ca.prototype.transform;olympe.dc.Ca.prototype.forEachCurrentValue=olympe.dc.Ca.prototype.ce;olympe.dc.Ca.prototype.forEach=olympe.dc.Ca.prototype.forEach;olympe.dc.Ca.prototype.getCurrentSize=olympe.dc.Ca.prototype.Ag;olympe.dc.Ca.prototype.observeSize=olympe.dc.Ca.prototype.hy;olympe.dc.Ca.prototype.observeFirst=olympe.dc.Ca.prototype.ay;olympe.dc.Ca.prototype.getCurrentRank=olympe.dc.Ca.prototype.If;olympe.dc.Ca.prototype.observeRank=olympe.dc.Ca.prototype.gy;
569
+ olympe.dc.Ca.prototype.getCurrentAt=olympe.dc.Ca.prototype.We;olympe.dc.Ca.prototype.observeAt=olympe.dc.Ca.prototype.$x;olympe.dc.Ca.prototype.offReady=olympe.dc.Ca.prototype.uj;olympe.dc.Ca.prototype.onReady=olympe.dc.Ca.prototype.Le;olympe.dc.Ca.prototype.getBaseTag=olympe.dc.Ca.prototype.Od;olympe.dc.Ca.la=[olympe.D.pd];m=olympe.dc.Ca.prototype;m.Tc.K=olympe.D.J.C;m.hb.K=olympe.D.J.N();m.qc.K=new olympe.D.J(()=>olympe.dc.query.Subscription,[]);m.Gd.K=new olympe.D.J(()=>{},[]);
570
+ m.Od.K=new olympe.D.J(()=>String,[]);m.Tl.K=new olympe.D.J(()=>Array,[]);m.Le.K=new olympe.D.J(()=>String,[]);m.uj.K=new olympe.D.J(()=>{},[]);m.Jt.K=olympe.D.J.U;m.It.K=olympe.D.J.C;m.get.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.ei.K=new olympe.D.J(()=>Array,[]);m.mh.K=olympe.D.J.C;m.has.K=olympe.D.J.U;m.Fg.K=olympe.D.J.C;m.re.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.We.K=olympe.D.J.C;m.Xe.K=new olympe.D.J(()=>String,[]);m.Hf.K=olympe.D.J.C;m.fe.K=olympe.D.J.G;
571
+ m.If.K=olympe.D.J.C;m.Sc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Jf.K=new olympe.D.J(()=>String,[]);m.pf.K=olympe.D.J.G;m.Ag.K=olympe.D.J.C;m.forEach.K=new olympe.D.J(()=>{},[]);m.ce.K=olympe.D.J.C;m.dj.K=new olympe.D.J(()=>{},[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.ml.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.filter.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.wg.K=new olympe.D.J(()=>olympe.dc.gk,[]);m.toString.K=olympe.D.J.C;m.Ht.K=olympe.D.J.C;m.Vc.K=olympe.D.J.F;const Cf={Ry:'append',Fl:'filter_not',Po:'filter_and',Qo:'filter_or'};function Df(a,b){a=Ef(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.na.Tn(a,b)).F}
572
+ olympe.dc.gk=class{constructor(a,b){this.C=Ef(a);this.L=olympe.dc.Of().Xa();this.valueType=void 0===b?olympe.dc.CloudObject:b;this.X=[];this.ua=[]}qf(){return new olympe.dc.Ca(this.C,this.X,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Ff('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.ta.Property)throw new Ff('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.getTransform)throw new Ff('transform',
573
+ 'one of the argument is not a Transformer '+d);const e=d.Yb();null!==e&&(this.valueType=e);this.X.push(d)}return this}ml(a){this.X.push(new olympe.dc.X.xf(a));return this}Py(a){this.X.push(new olympe.dc.X.xf(Ef(a)));return this}Lt(a){this.valueType=a;return this}sb(a){this.X.push(a);this.valueType=a.Yb()||olympe.dc.CloudObject;return this}jw(a){for(const b of a)this.X.push(b),this.valueType=b.Yb()||olympe.dc.CloudObject;return this}Pk(a,b,c){a=new olympe.dc.X.Fc(a,a.Pa(),b,c);this.X.push(a);this.valueType=
574
+ a.Yb()||olympe.dc.CloudObject;return this}gw(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.R());void 0===c&&(c=e.Pa())}a=new olympe.dc.X.Ce(b,c);this.X.push(a);this.valueType=a.Yb()||olympe.dc.CloudObject;return this}Kt(){this.sb(olympe.dc.CloudObject.instancesRel);return this}Ue(a){var b=this.ua.pop();b===Cf.Fl&&(a=new olympe.dc.V.nd(a),b=this.ua.pop());switch(b){case Cf.Po:b=this.X.pop().C;b instanceof olympe.dc.V.Ud?(b=b.V,b.push(a),a=new olympe.dc.V.Ud(...b)):a=new olympe.dc.V.Ud(b,
575
+ a);b=this.ua.pop();break;case Cf.Qo:b=this.X.pop().C,b instanceof olympe.dc.V.ae?(b=b.V,b.push(a),a=new olympe.dc.V.ae(...b)):a=new olympe.dc.V.ae(b,a),b=this.ua.pop()}b===Cf.Fl&&(a=new olympe.dc.V.nd(a),this.ua.pop());this.X.push(new olympe.dc.X.vc(a));return this}bw(a,b,c){return this.Ue(new olympe.dc.V.Ic(Df(a,c),new olympe.dc.na.Dd(b)))}contains(a,b,c=!1,d){return this.Ue(new olympe.dc.V.Wc(Df(a,d),new olympe.dc.na.Dd(b),c))}rh(a){if(!(a instanceof Array))throw new Ff('instanceOf','Provided argument "models" must be an array.');
576
+ const b=[];for(let c=0;c<a.length;c++)b.push(Ef(a[c]));return this.Ue(new olympe.dc.V.nf(b))}Xk(a){return this.Ue(new olympe.dc.V.Ic(new olympe.dc.na.vf,new olympe.dc.na.Dd(Ef(a))))}cw(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.not().Xk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().not().Xk(a[b])}return this}mj(a,b){if(!(a instanceof Array))throw new Ff('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];
577
+ a.forEach(e=>{c.push(e);d.push(e.Pa())});return this.Ue(new olympe.dc.V.mf(c,d,b))}Wk(a,b,c){a=Df(a,c);return this.Ue(new olympe.dc.V.ze(a,new olympe.dc.na.Dd(b)))}Bj(a,b,c){a=Df(a,c);return this.Ue(new olympe.dc.V.Ge(a,new olympe.dc.na.Dd(b)))}Kx(a,b,c,d){a=Df(a,d);return this.Ue(new olympe.dc.V.wd(a,b,c))}filter(a){const b=new class extends olympe.dc.V.Pg{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Ue(b)}not(){this.ua.push(Cf.Fl);return this}and(){this.X[this.X.length-1]instanceof
578
+ olympe.dc.X.vc&&this.ua.push(Cf.Po);return this}or(){this.X[this.X.length-1]instanceof olympe.dc.X.vc&&this.ua.push(Cf.Qo);return this}kl(a,b,c){a=Ef(a);let d=null;switch(olympe.dc.Oa().ic(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.R():d=new olympe.dc.Cb.String(new olympe.dc.na.pe(a,c));break;case olympe.dm.Number.O.R():d=new olympe.dc.Cb.Number(new olympe.dc.na.le(a,c));break;case olympe.dm.DateTime.O.R():d=new olympe.dc.Cb.DateTime(new olympe.dc.na.je(a,c))}c=d;null!==c&&this.X.push(new olympe.dc.X.Kd(c,
579
+ b));return this}sort(a,b,c){const d=new class extends olympe.dc.Cb.Pg{N(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.X.push(new olympe.dc.X.Kd(d,c));return this}Yv(){this.X.push(new olympe.dc.X.xe);return this}limit(a,b){this.X.push(new olympe.dc.X.Zd(a,b));return this}};class Ff extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
580
+ function Ef(a){return'string'===typeof a||a instanceof olympe.D.Wa?a:'function'===typeof a?olympe.dc.ya.Tb(a):olympe.D.lb(a)?a.Ik===olympe.D.Wa?a:olympe.D.Fa([a],b=>olympe.D.Bb(olympe.dc.wa(b)),olympe.D.Wa):a.R()}m=olympe.dc.gk.prototype;m.qf.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.transform.K=olympe.D.J.N();m.ml.K=olympe.D.J.N();m.Py.K=olympe.D.J.N();m.Lt.K=olympe.D.J.N();m.sb.K=olympe.D.J.N();m.jw.K=olympe.D.J.N();m.Pk.K=olympe.D.J.N();m.gw.K=olympe.D.J.N();m.Kt.K=olympe.D.J.N();m.Ue.K=olympe.D.J.N();
581
+ m.bw.K=olympe.D.J.N();m.contains.K=olympe.D.J.N();m.rh.K=olympe.D.J.N();m.Xk.K=olympe.D.J.N();m.cw.K=olympe.D.J.N();m.mj.K=olympe.D.J.N();m.Wk.K=olympe.D.J.N();m.Bj.K=olympe.D.J.N();m.Kx.K=olympe.D.J.N();m.filter.K=olympe.D.J.N();m.not.K=olympe.D.J.N();m.and.K=olympe.D.J.N();m.or.K=olympe.D.J.N();m.kl.K=olympe.D.J.N();m.sort.K=olympe.D.J.N();m.Yv.K=olympe.D.J.N();m.limit.K=olympe.D.J.N();olympe.dc.query.Mp=class{constructor(a){this.id=a;this.C=[];this.data=new olympe.dc.db.Ac}F(a){this.C.push(olympe.dc.wa(a))}Z(){return this.id}getData(){return this.data}};function Gf(a){return olympe.D.lb(a)?'Node#'+a.Na.Z():String(a)}function Hf(a,b){return olympe.D.lb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
582
+ olympe.dc.query.zu=class{constructor(){this.uid=0;this.values=null}add(a){let b;b=olympe.D.lb(a)?'n'+a.Na.Z():'p'+ ++this.uid;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.$a=class{ma(){}C(){}F(){}ja(){}toString(){}};function ze(a,b,c){return a.G.run(()=>a.U.hb(b,c))}function Ae(a,b,c){return a.G.run(()=>If(a.U,b,c))}
583
+ function hf(a,b,c){var d=olympe.dc.Ga.rb;const e=b.Z();let f=Jf(a.ta,e),g=olympe.dc.Ga.rb;null===f&&(f=gf(b,a.G),a.N||(g=of(f)));Kf(a.ta,f,d,g);c&&Te(a.F,e,c);b=olympe.dc.ga.ka.Ci;const h=olympe.dc.ga.ka.Bi,k=l=>{if(null!==l){a.L.error(`graph subscription "${e}" failed to subscribe ${l}`);Lf(a.ta,e,d);var n=a.F;Ue(n,e,n.F);c(l,null)}};g===olympe.dc.Ga.rb?(a.L.debug('QueryManager: [ID:',e,'] GraphQuery processed locally'),a.Y.process(d,f,k)):(b=M(new olympe.dc.ga(f.qh.N===olympe.dc.Ed.Ni?h:b,f,[g]),
584
+ k),a.L.debug('QueryManager: [ID:',e,'] sending GraphQuery to',g),a.C.send(b));return f}function jf(a,b){var c=olympe.dc.Ga.rb;const d=olympe.dc.Ga.rb;if(c===d){const e=Jf(a.ta,b).qh.N,f=Mf(a.ta,b);Lf(a.ta,b,c)&&f!==d&&e===olympe.dc.Ed.SUBSCRIBE&&(c=M(new olympe.dc.ga(olympe.dc.ga.ka.Zo,String(b),[f]),g=>{g&&a.L.error(`Unsubscription of graphdef ${b} failed: ${g.message}`)}),a.C.send(c))}else Lf(a.ta,b,c)}
585
+ function kf(a,b,c){var d=olympe.dc.Ga.rb;b=gf(b,a.G);const e=b.Z();var f=a.F.C.has(e);c&&Te(a.F,e,c);if(!f){f=h=>{if(h){var k=a.F;Ue(k,e,k.F);c(h,null)}};var g=of(b);g===olympe.dc.Ga.rb?a.Y.process(d,b,f):(d=M(new olympe.dc.ga(olympe.dc.ga.ka.Bi,b,[g]),f),a.C.send(d))}}
586
+ function Af(a,b){var c=olympe.dc.Ga.rb;const d=b.Od();var e=new olympe.dc.query.zu;let f;f=d;olympe.D.lb(f)&&(f=e.add(d));b=(b=b.Tl())?Array.isArray(b)?b:[b]:null;const g=olympe.dc.query.Subscription.G(f,b,e);e=Nf(a.ta,g);null===e&&(a.L.debug('QueryMGR: new',a.N?'local':'remote','subscription "',g,'": #',`${f},`,b),e=new olympe.dc.query.Subscription(g,d,b,a.G),a.N||e.yd());a.Sa.process(c,e,h=>{h&&(Of(a.ta,g,c||olympe.dc.Ga.rb),a.L.error(`subscription "${g}" failed to subscribe ${h}`))});return e}
587
+ function Bf(a,b){var c=olympe.dc.Ga.rb;if(c===olympe.dc.Ga.rb){const d=Mf(a.ta,b);a.L.debug('QueryMGR: [ID:',b,'] - Unregistered');Of(a.ta,b,c)&&d!==olympe.dc.Ga.rb&&(c=M(new olympe.dc.ga(olympe.dc.ga.ka.Wu,String(b),[d]),e=>{e&&a.L.error(`Unsubscription of listdef ${b} failed, ${e.message}`)}),a.C.send(c))}else Of(a.ta,b,c)}
588
+ function Pf(a){const b=olympe.dc.ga.ka.$o,c=olympe.dc.ga.ka.zl,d=olympe.dc.ga.ka.Fp;a.C.C(olympe.dc.ga.ka.Il,(e,f)=>{Qf(a,f,e)});a.C.C(b,(e,f)=>{Rf(a,f,e)});a.C.C(c,(e,f)=>{a.aa.af(f,e)});a.C.C(d,(e,f)=>{Sf(a,f,e)});a.C.oa((e,f)=>{Tf(a,f,e)})}function Uf(a,b){a.L.log('Received subscribeToAll command');b=b?olympe.D.Ja().C(b):void 0;const c=new olympe.dc.ga(olympe.dc.ga.ka.Tg,null,[olympe.dc.Ga.Pc]);b&&M(c,b);a.C.send(c)}
589
+ function Qf(a,b,c=olympe.dc.Ga.rb){b.destination!==olympe.dc.Ga.rb?a.L.error(`Graphdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.oa.process(c,b,d=>{d&&a.L.error(`An error occurred during the process of a graphdef result ${b.Z()}: ${d.message}`)})}
590
+ function Rf(a,b,c=olympe.dc.Ga.rb){const d=Vf(a.ta,b.Z());0!==d.length&&(1<d.length||d[0]!==olympe.dc.Ga.rb?a.L.error(`Notification received for graphdefs subscription registered from peers. Not supported yet ! (id: ${b.Z()})`):a.ha.process(c,b,e=>{e&&a.L.error(`An error occurred during the process of a graphNotification ${b.Z()}`)}))}
591
+ function Sf(a,b,c=olympe.dc.Ga.rb){const d=Wf(a.ta,b.Z());1<d.length||d[0]!==olympe.dc.Ga.rb?a.L.error(`Listdefs registered from peers is not supported yet ! (id: ${b.Z()})`):a.Da.process(c,b,e=>{e&&a.L.error(`An error occurred during the process of a listNotification ${b.Z()}`)})}
592
+ function Tf(a,b,c){a.L.debug('Source event',b,'received for source',c);if(b===olympe.dc.yk.cq){const d=(e,f)=>{f&&a.L.error(`Error after trying to resubscribe to ${e}: ${f}`)};Xf(a.ta,c).forEach(e=>{Te(a.F,e.Z(),d.bind(a,e.Z()));a.L.debug(`resubscribing graph subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ka.Ci,e,[c]),d.bind(a,e.Z()));a.C.send(e)});Yf(a.ta,c).forEach(e=>{a.L.debug(`resubscribing list subscription ${e.Z()} to destination : ${c}`);e=M(new olympe.dc.ga(olympe.dc.ga.ka.Uu,
593
+ e,[c]),d.bind(a,e.Z()));a.C.send(e)})}}olympe.dc.query.Fu=class{constructor(a,b,c,d,e,f,g,h){this.L=a;this.N=b;this.C=c;this.aa=d;this.ta=e;this.F=f;this.G=new olympe.D.Xb('Query Manager context');this.Sa=g[0];this.Y=g[1];this.oa=g[2];this.ha=g[3];this.Da=g[4];this.U=h;Pf(this)}Xa(){return this.L}};olympe.dc.query.Relation=class extends olympe.dc.ta.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.R())+', ';a+='"direction": '+JSON.stringify(this.Pa())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static oc(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a){return new olympe.dc.query.Relation(a.R(),a.Pa(),a instanceof olympe.dc.X.Fc)}Gc(){const a=
594
+ olympe.dc.Aa.DESTINATION,b=olympe.dc.Aa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.Subscription=class a extends olympe.D.Gj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Xb('context subscription '+b,e));this.id=b;this.Ef=c;this.X=d||null;this.G=this.U.run(()=>olympe.D.ge(olympe.dc.query.Subscription.C.INIT));this.He=!1;this.ha=this.be=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ja(d);else e+='|null';e=olympe.W.mb(e)}catch(f){e=olympe.W.hc()}return e}Z(){return this.id}Od(){return this.Ef}Dg(){return this.X}yd(){const b=
595
+ olympe.dc.Oa(),c=olympe.D.bb(this.Od());return c?b.Xf(c)?b.source(c)||olympe.dc.Ga.Pc:olympe.dc.Ga.rb:olympe.dc.Ga.Pc}th(){const b=this.G.Na.Kb;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.Sq}ii(){if(this.G.Na.Ab())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.be;this.be=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);ob(this.G,olympe.D.ge(olympe.dc.query.Subscription.C.Sq))}Ve(){return olympe.D.Fa([this.G],()=>{},olympe.D.qa)}Y(){const b=
596
+ this.G.Na.Kb;return b&&b.valueOf()>=olympe.dc.query.Subscription.C.yq}Le(b,c){this.Y()?b(this):(null===this.ha&&(this.ha=new Map),void 0===c&&(c=olympe.W.hc()),this.ha.set(c,olympe.D.Ja().C(b)));return c||''}uj(b){null!==this.ha&&b&&this.ha.delete(b)}ad(){const b=olympe.dc.query.Subscription.C.yq;if(!this.G.Na.Ab()&&olympe.D.bb(this.G)!==b&&(this.Bf(),ob(this.G,b),null!==this.ha)){for(const c of this.ha.values())c(this);this.ha=null}}onDestroy(b){this.U.onDestroy(b)}release(){this.U.destroy()}Lb(b){if(!this.G.Na.Ab()){for(let c=
597
+ 0,d=b.length;c<d;c++)this.Fm(b[c],c);if(this.Y())this.Bf();else{this.He=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.ad()}}}Lc(b){const c=this.F;for(let d in c)Object.prototype.hasOwnProperty.call(c,d)&&b(c[d],d)}ac(b,c){if(!this.G.Na.Ab()&&(this.Kk(b,olympe.dc.CloudObject.get(c)),b=this.Y(),this.He&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,
598
+ d)){b=!1;break}b&&this.ad()}}wc(b){this.G.Na.Ab()||(this.Em(b),this.Vi(b,!this.Y()))}Wg(){return this.Y()?super.Wg():'Subscription is not ready!'}Sf(){const b=olympe.D.bb(this.Od());return olympe.dc.query.Subscription.F(b,this.Dg())}static F(b,c){var d=new olympe.dc.lf(b,olympe.dc.Ed.SUBSCRIBE);if(null===c)return[d];b=[];b.push(d);for(let e=0,f=c.length;e<f;e++){const g=c[e];if(g instanceof olympe.dc.X.Sb||g instanceof olympe.dc.X.Fc)b.forEach(h=>{const k=olympe.dc.query.Relation.from(g);h.sb(k,k.recursive)});
599
+ else if(g instanceof olympe.dc.X.xf)d=a.F(olympe.D.bb(g.Od()),g.Dg()),b.push(...d);else if(g instanceof olympe.dc.X.vc||g instanceof olympe.dc.X.Kd){const h=g.F();b.forEach(k=>{for(const l of h){for(const n of l)k.sb(n,n.recursive);ve(k,l.length)}})}}return b}};olympe.dc.query.Subscription.C={INIT:0,Sq:1,yq:2};olympe.dc.query.Subscription.prototype.Wg.K=olympe.D.J.C;function Nf(a,b){return a.F.has(b)?a.F.get(b).F():null}function Of(a,b,c){return Zf(a,a.F,b,c)}function Mf(a,b){for(const [c,d]of a.N)if(d.has(b))return c;return null}function Jf(a,b){return a.C.has(b)?a.C.get(b).F():null}function Kf(a,b,c,d){const e=b.Z();let f=a.C.get(e);void 0===f&&(f=new olympe.dc.query.ta.qt(b,a.U,a),a.C.set(e,f));f.N(c);$f(a,e,d)}function Lf(a,b,c){return Zf(a,a.C,b,c)}function Vf(a,b){return(a=a.C.get(b))?Array.from(a.C.keys()):[]}
600
+ function Wf(a,b){return(a=a.F.get(b))?Array.from(a.C.keys()):[]}function Xf(a,b){const c=new Set;(a.N.get(b)||new Set).forEach(d=>{(d=a.C.get(d))&&c.add(d.F())});return c}function Yf(a,b){const c=new Set;(a.N.get(b)||new Set).forEach(d=>{(d=a.F.get(d))&&c.add(d.F())});return c}function ag(a,b,c){a=a.F.get(b);if(void 0===a)throw Error(`Check if the subscription ${b} has been processed, but it has never been registered`);b=a.G.get(c);a.G.set(c,!0);return b||!1}
601
+ function $f(a,b,c){let d=a.N.get(c);d?d.add(b):(d=(new Set).add(b),a.N.set(c,d))}function bg(a,b,c){var d=olympe.dc.Ga.rb;const e=b.Z();let f=a.F.get(e);void 0===f&&(f=new olympe.dc.query.ta.hu(b,a.U),a.F.set(e,f));f.N(c);$f(a,e,d)}function Zf(a,b,c,d){if(!b.has(c))return!1;const e=b.get(c);var f=e.C.get(d)-1;0===f?(e.C.delete(d),e.G.delete(d),f=0===e.C.size):(e.C.set(d,f),f=!1);return f?((d=Mf(a,c))&&a.N.get(d).delete(c),e.F().release(),b.delete(c),!0):0===e.C.get(d)}
602
+ function cg(a,b){const c=b.Z();let d=a.G.get(c);d||(d=new olympe.dc.query.ta.Gu(b),a.G.set(c,d));d.counter++;return d}function dg(a){a.G.forEach(b=>b.update())}function eg(a,b,c){const d=a.C.get(b);d?c instanceof olympe.dc.query.Subscription?fg(d,c):gg(d,c):a.L.error(`Try to set the subscription ${c.Z()} as covered by a graphquery that is not registered (${b}).`)}olympe.dc.query.av=class{constructor(a,b){this.L=a;this.C=new Map;this.F=new Map;this.G=new Map;this.Y=new Set;this.N=new Map;this.U=b}};olympe.dc.$c=class{ma(){}Yb(){}getTransform(){}ja(){}toString(){}};olympe.dc.tq=class{F(){}};olympe.dc.zf=class{ma(){}getValue(){}C(){}ja(){}toString(){}};olympe.dc.query.P={Ea:'olympe.dc.query.Logger',xa:'olympe.dc.query.QueryManager'};olympe.dc.query.Mb={Qe:'olympe.dc.query.SubscriptionRegistry',Lj:'olympe.dc.query.CallbackRegistry',bp:'olympe.dc.query.GraphProcessor',ap:'olympe.dc.query.GraphNotificationProcessor',cp:'olympe.dc.query.GraphResultProcessor',Gp:'olympe.dc.query.ListProcessor',fk:'olympe.dc.query.ListNotificationProcessor',vq:'olympe.dc.query.QueryProcessor',wl:'olympe.dc.query.CoverageProcessor'};olympe.dc.query.Config={Tq:'subscription.debug'};
603
+ olympe.T.config(function(a){D(a,olympe.dc.query.Config.Tq,!1);C(a,olympe.dc.query.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc.query'));A(a,olympe.dc.query.Mb.Qe,olympe.dc.query.av,olympe.dc.query.P.Ea,new olympe.T.fa(olympe.dc.query.Config.Tq));A(a,olympe.dc.query.Mb.Lj,olympe.dc.query.Ms,olympe.dc.query.P.Ea);A(a,olympe.dc.query.Mb.Gp,olympe.dc.query.Wb.Op,olympe.dc.query.P.Ea,olympe.dc.P.xi,olympe.dc.query.Mb.Qe,olympe.dc.query.Mb.wl,olympe.dc.transaction.P.xa,new olympe.T.fa(olympe.dc.Config.ah));A(a,olympe.dc.query.Mb.bp,
604
+ olympe.dc.query.Wb.ip,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Qe,new olympe.T.fa(olympe.dc.Config.ah));A(a,olympe.dc.query.Mb.cp,olympe.dc.query.Wb.jp,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Qe,olympe.dc.query.Mb.Lj);A(a,olympe.dc.query.Mb.ap,olympe.dc.query.Wb.hp,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Qe);A(a,olympe.dc.query.Mb.fk,olympe.dc.query.Wb.Np,olympe.dc.query.P.Ea,olympe.dc.P.xi,olympe.dc.query.Mb.Qe);A(a,olympe.dc.query.Mb.vq,olympe.dc.query.Wb.Hu,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Qe,
605
+ olympe.dc.query.Mb.wl,olympe.dc.query.Mb.Lj,olympe.dc.P.ne,olympe.dc.db.P.xa);A(a,olympe.dc.query.Mb.wl,olympe.dc.query.Wb.Ps,olympe.dc.query.P.Ea,olympe.dc.query.Mb.Qe,olympe.dc.transaction.P.xa);C(a,olympe.dc.query.P.xa,[olympe.dc.query.P.Ea,new olympe.T.fa(olympe.dc.Config.ah),olympe.dc.P.ne,olympe.dc.db.P.xa,olympe.dc.query.Mb.Qe,olympe.dc.query.Mb.Lj,olympe.dc.query.Mb.Gp,olympe.dc.query.Mb.bp,olympe.dc.query.Mb.cp,olympe.dc.query.Mb.ap,olympe.dc.query.Mb.fk,olympe.dc.query.Mb.vq],(b,c,d,e,f,
606
+ g,h,k,l,n,p,q)=>new olympe.dc.query.Fu(b,c,d,e,f,g,[h,k,l,n,p],q))});olympe.T.run([olympe.dc.query.Mb.Qe],a=>{olympe.ij().subscriptions=a});olympe.dc.query.ta={};function hg(){const a=Error.stackTraceLimit;Error.stackTraceLimit=16;let b=Error().stack||'';b=b.split('\n').map(d=>d.trim());var c='Error'===b[0]?2:1;b=b.slice(c,Error.stackTraceLimit+c).reverse();c=[];for(const d of b)if(c.push(' '+d),d.includes('at ListDef.')||d.includes('at GraphDef.'))break;Error.stackTraceLimit=a;3<c.length&&(c=c.slice(c.length-3));return c.join('\n')||b.join('\n')}
607
+ olympe.dc.query.ta.br=class{constructor(a,b){this.C=new Map;this.G=new Map;this.U=a;this.ha=b}F(){}N(a){var b=this.C.get(a);this.C.set(a,void 0!==b?b+1:1);b=this.G.get(a);this.G.set(a,void 0!==b?b:!1)}};function fg(a,b){const c=b.Z();a.Y.set(c,b);olympe.D.Ja().onDestroy(()=>{a.Y.delete(c)})}function gg(a,b){const c=b.Z();a.aa.set(c,b);olympe.D.Ja().onDestroy(()=>{a.aa.delete(c)})}olympe.dc.query.ta.qt=class extends olympe.dc.query.ta.br{constructor(a,b,c){super(a,b);this.ta=c;this.Y=new Map;this.aa=new Map;b&&hg()}F(){return this.U}};olympe.dc.query.ta.hu=class extends olympe.dc.query.ta.br{constructor(a,b){super(a,b);this.Y=new Map}F(){return this.U}N(a){super.N(a);if(this.ha){const b='md_'+olympe.W.hc();this.Y.set(b,hg());olympe.D.Ja().onDestroy(()=>{this.Y.delete(b)})}}};function ig(a,b){let c;a.C!==b&&(null==(c=a.C)?void 0:c.hash)!==b.hash&&(a.C=b,jg(a,!1),a.G.forEach(d=>d(b)))}function jg(a,b){var c=we(a.query);if(c!==olympe.dc.Ga.rb&&c!==olympe.dc.Ga.Pc){var d;c=null!=(d=a.C)?d:olympe.dc.Va.empty();Sc(a.U,null,b?De(c):Ee(c))}}function kg(a,b){const c=a.Y++;a.G.set(c,b);a.C&&b(a.C);return()=>a.G.delete(c)}
608
+ olympe.dc.query.ta.Gu=class{constructor(a){this.query=a;this.U=olympe.dc.Ad();this.id=a.Z();this.C=null;this.F=new olympe.dc.ba.rq(a);this.counter=this.Y=0;this.G=new Map;this.N=[]}update(){var a=this.F;a.F?(a.F=!1,a=!0):a=!1;if(a){var b;a=null!=(b=this.C)?b:olympe.dc.Va.empty();b=olympe.dc.Va.from(a,this.F);ig(this,b)}}onDestroy(a){this.N.push(a)}destroy(){jg(this,!0);this.N.forEach(a=>a())}};olympe.dc.query.Wb={};function lg(a,b,c,d,e){a.L.debug('CoverageProcessor: [ID:',d,'] - checking coverage of remote query over',b.length,'paths.');const f=new olympe.async.og(olympe.D.Ja()),g=k=>{f.add((l,n)=>{k.hb(p=>{p?n(`The query ${d} is not covered by an existing graphdef, `+`and the specific graphdef id ${k.Z()} has encountered an error: ${p}`):l()});eg(a.ta,k.Z(),c)})},h=Array.from(Xf(a.ta,olympe.dc.Ga.Pc));b.forEach(k=>{const l=gf(k);let n=!1;for(let p=0,q=h.length;p<q;p++){const r=h[p];if(r.Jr(l)){g(r.qh,!1);
609
+ n=!0;break}}n?a.L.debug('CoverageProcessor: [ID:',d,'] - graphPath',k,' is covered'):g(k,!0)});Zb(f,(k,l)=>e(l));f.start()}function mg(a,b,c){const d=[b.Od()],e=g=>g instanceof olympe.dc.X.xf,f=(b.Dg()||[]).filter(e);for(const g of f)d.push(g.Od()),f.push(...(g.Dg()||[]).filter(e));oe(a.C,()=>{olympe.D.Ec(d,()=>{const g=b.Sf();lg(a,g,b,b.Z(),c)})})}function ng(a,b,c,d){const e=b.Z(),f=[ue(b,c)];oe(a.C,()=>lg(a,f,b,e,d))}olympe.dc.query.Wb.Ps=class{constructor(a,b,c){this.L=a;this.ta=b;this.C=c}};olympe.dc.query.Wb.hp=class{constructor(a,b){this.L=a;this.ta=b}process(a,b,c){const d=b.Z();this.ta.C.has(d)?(Jf(this.ta,d).oa(b),olympe.dc.Ad().af(b.data,a),c(null,b)):c(Error(`Received a notification for the graphdef ${d} which does not exist.`),b)}};olympe.dc.query.Wb.hp.la=[olympe.dc.pg];olympe.dc.query.Wb.ip=class{constructor(a,b,c){this.L=a;this.ta=b;this.C=c}process(a,b,c){var d=b.Z();if(a===olympe.dc.Ga.rb||this.ta.C.has(d)){if(c(null,b),a=Jf(this.ta,d),this.C||a&&a.N)a=olympe.dc.Ga.rb,d=new olympe.dc.query.Ei(d,a,a,new olympe.dc.db.Ac),Qf(olympe.dc.Of(),d)}else c(Error('The local Graph Engine is not implemented yet. It should handle Graphdefs addressed to instances owned by this local OVM'),b)}};olympe.dc.query.Wb.ip.la=[olympe.dc.pg];olympe.dc.query.Wb.jp=class{constructor(a,b,c){this.L=a;this.C=b;this.F=c}process(a,b,c){const d=b.Z();if(this.C.C.has(d)){const f=Jf(this.C,d);if(b instanceof olympe.dc.query.errors.Zj)Lf(this.C,d,a);else if(!f.N){f.ha(b);const g=olympe.dc.Ad();Sc(g,f.Y());g.af(b.Dc,b.destination);f.onDestroy(()=>{Sc(g,null,f.Y())});qf(f)}}let e;b instanceof olympe.dc.query.errors.Zj&&(e=`graph subscription "${d}" failed to create the initial result: ${b.aa()}`,this.L.error(e));We(this.F,b.Z(),b);c(e?Error(e):null,
610
+ b)}};olympe.dc.query.Wb.jp.la=[olympe.dc.pg];const og=[],pg=new Map;function qg(a,b,c,d){xc(a.db,d,e=>{e?b.Fg(c)?a.L.warn('Adding the same index twice (should never happen) for sub #'+b.Z()+', index #'+c+', tag #'+d):b.ac(c,d):rg(a,b,c,d)},c)}function rg(a,b,c,d){yc(a.db,d,c,!0);b.wc(c);og.length=0;b.Lc(function(e,f){og[e]=f});c=a=0;for(d=og.length;a<d;a++)'string'===typeof og[a]&&(og[c++]=og[a]);og.length=c;b.Lb(og)}
611
+ olympe.dc.query.Wb.Np=class{constructor(a,b,c){this.L=a;this.db=b;this.ta=c}process(a,b,c){const d=b.Z();a=b.C;const e=Nf(this.ta,d);if(null===e)c(Error(`Received list notification for undefined subscription "${d}"`),b);else{og.length=a.length;e.Lc((f,g)=>{if(f=e.mh(g)){f=f.R();var h=pg.get(f);void 0===h?pg.set(f,g):'string'===typeof h?pg.set(f,[h,g]):h.push(g)}else this.L.warn('Subscription #'+d+' has a rank for index #'+g+' but no instance. This is caused by receiving a new list notification before receiving all instances of the previous list notification.')});
612
+ for(let f=0,g=a.length;f<g;f++){const h=a[f];let k=pg.get(h);void 0===k?(k=olympe.W.hc(),qg(this,e,k,h)):'string'===typeof k?pg.delete(h):(k=k.pop(),0===k.length&&pg.delete(h));og[f]=k}for(const [f,g]of pg){if('string'===typeof g)rg(this,e,g,f);else for(let h=0,k=g.length;h<k;h++)rg(this,e,g[h],f);pg.delete(f)}e.Lb(og);c(null,b)}}};olympe.dc.query.Wb.Np.la=[olympe.dc.pg];function sg(a,b,c,d){const e=c.Z();a.L.debug('ListProcessor: [ID:',e,'] - processing with source ',b);bg(a.ta,c,b);if(ag(a.ta,e,olympe.dc.Ga.rb))a.L.debug('ListProcessor: [ID:',e,'] - id already processed');else{a.L.debug('ListProcessor: [ID:',e,'] - NOT processed yet.');const f=c.yd();a.F||f===olympe.dc.Ga.rb?(a.L.debug('QueryMGR: [ID:',e,'] - Local subscription, no need for coverage check, booting subscription '),tg(a,c)):c.Eh().run(()=>{mg(a.C,c,g=>{g?a.L.error(g):tg(a,c)})})}b===olympe.dc.Ga.rb||
613
+ ag(a.ta,e,b)||a.notify(b,c);d(null,c)}
614
+ function tg(a,b){if(b.Y())a.L.debug('ListProcessor: [ID:',b.Z(),'] - Subscription already booted, ignoring');else{a.L.debug('ListProcessor: [ID:',b.Z(),'] - Booting subscription');var c=new olympe.dc.tc.ar(a.db,a.L),d=ug(a,b,c),e=b.Z();b.Eh().run(()=>{olympe.D.Ec([b.Od()],f=>{const g=olympe.dc.wa(f);a.L.debug('ListProcessor: [ID:',b.Z(),'] - Booting with baseTag',g);b.th()||b.ii();xc(a.db,g,h=>d(h,g),e);olympe.D.Ja().zc(()=>yc(a.db,g,e));a.db.Eb(g.valueOf())||vg(c);b.Y()||(vg(c),b.Lb([]))})})}}
615
+ function ug(a,b,c){const d=new olympe.dc.tc.Jj;let e=!1;const f=b.Eh(),g=b.Dg(),h=[];h[g?g.length:0]=f.C((k,l,n,p)=>{f.G()||f.Ab()||(k?b.Fg(n)?a.L.warn('Adding the same index twice (should never happen) for sub #',b.Z(),', index #',n,', tag #',l):(a.L.debug('ListProcessor: [ID:',b.Z(),'] - Adding Instance',l,'to the subscription'),b.ac(n,l)):(a.L.debug('ListProcessor: [ID:',b.Z(),'] - Removing Instance',l,'from the subscription'),b.wc(n)),e||(wg(c,()=>{p.ug();vg(c)}),p.Tc().Mg(b.Lb.bind(b)),e=!0),
616
+ xg(c,n))});if(null!==g){const k=olympe.dc.Tc();for(let l=g.length-1;0<=l;l--)h[l]=f.C(g[l].getTransform(k,c,h[l+1]))}return(k,l)=>{const n=b.Z();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,yg(p,k,l,n))}}
617
+ olympe.dc.query.Wb.Op=class{constructor(a,b,c,d,e,f){this.L=a;this.db=b;this.ta=c;this.C=d;this.F=f}process(a,b,c){sg(this,a,b,c)}notify(a,b){const c=b.Z();this.L.debug(`Register notification of list subscription ${c} for destination ${a}`);const d=()=>{const f=new olympe.dc.query.Mp(c);b.ce(g=>f.F(g));Sf(olympe.dc.Of(),f)};let e=!1;b.forEach(()=>{e&&d()});b.Le(()=>{e=!0;d()})}};olympe.dc.query.Wb.Op.la=[olympe.dc.pg];function If(a,b,c){const d=b.Z(),e=we(b),f=a.ta.G.has(d),g=cg(a.ta,b);return new rxjs.Observable(h=>{const k=kg(g,h.next.bind(h)),l=()=>{k();n&&c.Lc(n);{var p=a.ta;const r=p.G.get(d);var q;if(q=r)q=r,0<q.counter?q.counter--:olympe.ra.Xa('dc').warn('Try to decrement counter of query metadata below 0. Investigate...'),q=0===q.counter;q&&(r.destroy(),p.G.delete(d),p.Y.delete(d))}},n=c.zc(l);if(!f)if(e===olympe.dc.Ga.Pc)ng(a.N,b,!0,p=>{p?(h.error(p),l()):zg(a,d,b,g)});else if(e===olympe.dc.Ga.rb)zg(a,
618
+ d,b,g);else{const p=M(Ac(new olympe.dc.ga(olympe.dc.ga.ka.qm,b,[e]),c),q=>{q&&(h.error(q.message),l())});a.G.send(p)}return l})}
619
+ function Ag(a){const b=olympe.dc.ga.ka.pm,c=(d,e)=>Ge(d,f=>{Sc(a.F,Array.from(f.ee()).filter(g=>g.se()).map(g=>g.tag()));a.F.af(f,e)},e);a.G.C(olympe.dc.ga.ka.QUERY_RESULT,(d,{i:e,r:f,s:g})=>{d=c(f,g);null===d?(d=a.C,Ve(d,e,`Error while deserialization of QueryResult for query ${e}`,d.G,`Query result of query ${e} has no associated handler in the datacloud`)):(f=a.C,Ve(f,e,d,f.G,`Query result of query ${e} has no associated handler in the datacloud`))});a.G.C(b,(d,{i:e,r:f,s:g})=>{if(d=c(f,g)){let h;
620
+ null==(h=a.ta.G.get(e))||ig(h,d)}});Rc(a.F,()=>dg(a.ta))}function zg(a,b,c,d){let e=(p,q)=>{p?a.L.debug(`New result tuple for query ${b}, ${q}`):a.L.debug(`Removed result tuple for query ${b}, ${q}`)};const f=c.C,g=f.reduce((p,q)=>{p.push(q.F(p[p.length-1]));return p},[0]),h=d.F;for(let p=f.length-1;0<=p;p--)e=f[p].observe(h,g[p],e);const k=a.F.view,l=c.G,n=xc(k,l,(p,q)=>{p?h.insert(q,0,null):h.remove(q,0,null);e(p,q,null,b)});d.onDestroy(()=>yc(k,l,n));Ke(h);d.update()}
621
+ olympe.dc.query.Wb.Hu=class{constructor(a,b,c,d,e,f){this.L=a;this.ta=b;this.N=c;this.C=d;this.G=e;this.F=f;Ag(this)}hb(a,b){return new Promise((c,d)=>{var e=we(a);if(e===olympe.dc.Ga.Pc)ng(this.N,a,!1,f=>{f?d(f):c(this.jd(a))});else if(e===olympe.dc.Ga.rb)c(this.jd(a));else{const f=a.Z(),g=this.C.C.has(f),h=l=>{var n=this.C;Ue(n,f,n.G);d(l||`The execution of the query ${f} has been interrupted`)},k=b.zc(h);Xe(this.C,f,(l,n)=>{b.Lc(k);l?d(l.message):(b.zc(()=>{Sc(this.F,null,De(n))}),c(n))});g||(e=
622
+ M(Ac(new olympe.dc.ga(olympe.dc.ga.ka.om,a,[e]),b),l=>l&&h(l.message)),this.G.send(e))}})}jd(a){const b=new olympe.dc.ba.rq(a);b.insert(a.G,0,null);let c=0;for(const d of a.C)d.hb(b,c),c=d.F(c);return olympe.dc.Va.from(olympe.dc.Va.empty(),b)}};olympe.dc.query.errors={};olympe.dc.query.errors.Zj=class extends olympe.dc.query.Ei{constructor(a,b,c,d){super(a,b,c,new olympe.dc.db.Ac);this.error=d}aa(){return this.error}};olympe.dc.tc={};function yg(a,b,c,d){b?a.U[d]=c:delete a.U[d];null===a.F&&(a.F=new olympe.dc.tc.Qj(a.C,a));return a.F}function Bg(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function Cg(a,b){a=a.U;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.tc.Qj=class{constructor(a,b){this.C=a;this.parent=b||null;this.aa=b?b.aa+1:0;this.U=Object.create(null);this.F=null}Tc(){return this.C}ug(){this.C.U()?this.C.G():this.C.aa(this.aa-1)}};olympe.dc.tc.sa=class{constructor(){}C(){}U(){}aa(){}G(){}Mg(){}};olympe.dc.tc.Jj=class{constructor(){this.Y=this.N=this.index=this.F=null}U(){return null!==this.F}aa(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.N;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.tc.Qj(this),this.index=c,this.N=b):this.N=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.Y){const a=
623
+ [];null!==this.N&&(0<=this.F?Cg(Bg(this.N,this.F),a):a.push(this.index));this.Y(a)}}Mg(a){this.Y=a}};olympe.dc.tc.Jj.la=[olympe.dc.tc.sa];function Dg(a,b){olympe.D.Wf(a.value)?(a.node=olympe.D.fl(a.value,b),Va(a.node)||b()):b()}function Eg(a,b){if(olympe.D.Wf(a.value)){const c=olympe.D.Ja(),d=a.N;olympe.D.Ec([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Dg(a,b)),olympe.D.Ja().destroy())})}}
624
+ class Fg extends olympe.dc.tc.Qj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.N=this.bb();this.position=this.node=null;this.Y=!1;this.G=null}bb(){const a=olympe.D.bb(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}Ab(){return null===this.value}}
625
+ function Gg(a,b){if(!b.Ab()){var c=a.F;const d=a.Da,e=b.bb();let f=0,g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].N,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].N,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.N=b.bb();c!==b.position&&(a.insert(b,c),b.Y&&a.G())}}function Hg(a){const b=a.Da;a.F.sort((c,d)=>b(c.bb(),d.bb()))}
626
+ olympe.dc.tc.$q=class{constructor(a){this.Da=a;this.N=null;this.F=[];this.Y=[];this.ha=null;this.oa=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new Fg(this,c,d),this.oa.set(b,f),this.U()?Dg(f,()=>Gg(this,f)):(f.position=e.length,e.push(f));else{f=this.oa.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.oa.delete(b);null!==f.position&&(this.U()?this.remove(f):delete e[f.position]);f.destroy()}return f}U(){return null!==this.N}aa(a){if(null!==this.N)throw Error('Manager already activated (depth='+
627
+ this.N+')');this.N=a;Hg(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;Eg(d,()=>Gg(this,d))}this.G()}G(){if(null===this.N)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.Y.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.Y){var b=e,c=this.N;b.Y=!0;b.G=Bg(b,c)}0>this.N?this.Y.push(e.index):e.G&&Cg(e.G,this.Y)}this.ha&&this.ha(this.Y)}Mg(a){this.ha=a}insert(a,b){const c=this.F;var d=c.length;let e=a.position;null===
628
+ e&&(e=d);if(b<e)for(d=e;d>b;d--)c[d]=c[d-1],c[d].position=d;else for(d=e;d<b;d++)c[d]=c[d+1],c[d].position=d;c[b]=a;c[b].position=b}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.tc.$q.la=[olympe.dc.tc.sa];class Ig extends olympe.dc.tc.Qj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.ha=this.Y=this.N=!1;this.G=null}}
629
+ function Jg(a,b,c,d,e){const f=Object.create(null),g=a.order,h=a.N;let k,l,n;a.oa=!0;l=0;for(n=g.length;l<n;l++)f[g[l]]=null;g.length=0;l=c;for(n=Math.min(b.length,d);l<n;l++)k=b[l],c=h[k],void 0!==c&&(delete f[k],g.push(k),c.N||(c.N=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.N&&(c.N=!1,e(!1,c.tag,c.index,c)),c.Y&&(c.G=null,delete h[k]),delete f[k]);a.oa=!1;null!==a.F&&a.G()}
630
+ olympe.dc.tc.$l=class{constructor(){this.N={};this.order=[];this.F=null;this.oa=!1;this.Y=[];this.ha=null}U(){return null!==this.F}aa(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.oa){var a=this.order,b=a.length,c=this.N,d;for(d=this.Y.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.Y.push(e.index);else{if(!e.ha){var f=e,g=this.F;f.ha=!0;
631
+ f.G=Bg(f,g)}null!==e.G&&Cg(e.G,this.Y)}}this.ha&&this.ha(this.Y)}}Mg(a){this.ha=a}C(a,b,c){let d=this.N[c];a?void 0===d?(d=new Ig(this,c,b),this.N[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.tc.$l.la=[olympe.dc.tc.sa];function vg(a){if(!a.F){for(let b in a.G)Kg(a.G[b]);a.F=!0}a.N=null;a.U=null}function wg(a,b,c){a.G[c||'root'].N=b}function xg(a,b,c){a.G[c||'root'].ug(b)}function Lg(a,b,c,d){const e=a.U,f=b+d+c;let g=e[f];void 0===g&&(g=Hd(a.db,b,c,d),e[f]=g);return g}function Mg(a,b){a.F||a.C.ug(b)}function Ng(a,b,c,d,e){if(!a.F){let f=Lg(a,c,d,e||olympe.dc.Aa.DESTINATION);e||(f+=Lg(a,c,d,olympe.dc.Aa.ORIGIN));0===f&&Mg(a,b)}}
632
+ function Og(a,b){const c=a.G[b];void 0!==c?(a.L&&a.L.debug('Set current block to',b,null!==c.parent?'parent = '+c.parent.Z():''),a.C=c):a.L&&a.L.error('Try to set a block that does not exists:',b)}function Pg(a){const b=String(++a.Y),c=a.C;a.G[b]=new Qg(b,c);Rg(c,b);c.F||(c.F=()=>Og(a,c.Z()));return b}function Sg(a,b){const c=a.C;a.C.F=()=>{Og(a,c.Z());b()}}function Tg(a,b){Kg(b?a.G[b]:a.C)}
633
+ olympe.dc.tc.ar=class{constructor(a,b){this.db=a;this.L=b||null;this.N=Object.create(null);this.U=Object.create(null);this.F=!1;this.Y=0;this.C=new Qg('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=Lg(this,c,d,e),d=this.N[b]||0,this.N[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function Rg(a,b){null===a.children&&(a.children=Object.create(null));a.children[b]=!1}function Kg(a){a.G=!0;null!==a.parent&&a.parent.notify(a.id)}
634
+ class Qg{constructor(a,b){this.id=a;this.parent=b||null;this.C=this.N=this.F=this.children=null;this.G=!1}Z(){return this.id}ug(a){const b=this.N;if(this.G||this.C===a||null===a)b&&b(),!b&&Kg(this)}notify(a){const b=this.F,c=this.children;if(this.G)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.na={};olympe.dc.na.vf=class{ma(){return O(olympe.dc.na.vf)}C(){return[]}getValue(a,b){return b}ja(){return'{"c":"'+this.ma()+'","a":[]}'}toString(){return'Tag()'}};N('olympe.dc.valuedefs.Tag',olympe.dc.na.vf);olympe.dc.na.vf.la=[olympe.dc.zf];olympe.dc.na.Dd=class{constructor(a){this.value=a}ma(){return O(olympe.dc.na.Dd)}C(){return[]}getValue(){return this.value}ja(a){a=Hf(a,this.value);return`{"c":"${this.ma()}","a":[${a}]}`}toString(){return`Constant(${Gf(this.value)})`}};N('olympe.dc.valuedefs.Constant',olympe.dc.na.Dd);olympe.dc.na.Dd.la=[olympe.dc.zf];function Ug(a,b,c,d){const e=olympe.dc.Oa(),f=new olympe.dc.tc.Jj,g=new olympe.dc.tc.ar(e);let h=!1;const k=Object.create(null),l=r=>{if(0<r.length)for(const t in k)r[0]===t&&d(k[t])};let n=(r,t,u,v)=>{const w=olympe.D.Ja();w.G()||w.Ab()||(h||(wg(g,()=>{v.ug();vg(g)}),v.Tc().Mg(l),h=!0),r?k[u]=t:delete k[u],xg(g,u))};const p=olympe.D.Ja();if(null!==c)for(let r=c.length-1;0<=r;r--)n=c[r].getTransform(a,g,p.C(n));n=p.C(n);const q=olympe.W.hc();xc(e,b,(r,t)=>{g.register(q,null);const u=f.C(r,b,q,null);
635
+ n(r,t,q,yg(u,r,b,q))},q);p.onDestroy(()=>{yc(e,b,q)});e.Eb(b)||vg(g)}function Vg(a,b,c){const d=c.node,e=olympe.dc.Oa(),f=a.G(),g=Ad(e,b,a.$e,d.C(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>e.F(b,a.$e,g))}
636
+ olympe.dc.na.Oc=class{constructor(a,b,c){this.$e=a&&a.R?a.R():a;this.X=b&&b.filter(d=>d instanceof olympe.dc.X.Sb||d instanceof olympe.dc.X.Fc)||null;this.F=c||null;this.defaultValue=null}ma(){}Yb(){}G(){}C(){return(this.X||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}cf(a){this.defaultValue=a;return this}Dg(){return this.X}Od(){return this.F}getValue(a,b){const c=olympe.D.Uc(this.Yb()||Object,'AbstractProperty valueType');null!==this.defaultValue&&pb(c,this.defaultValue);b=this.F||
637
+ b;null!==this.X?Ug(a,b,this.X,d=>{Vg(this,d,c)}):Vg(this,b,c);return c.Fb()}ja(a){const b=Hf(a,this.$e),c=Hf(a,this.F);let d='null';this.X&&(d=this.X.map(function(e){return e.ja(a)}).join(','));return`{"c":"${this.ma()}","a":["${b}",${d},${c}]}`}toString(){const a=Gf(this.$e),b=this.F?','+Gf(this.F):'';let c='';this.X&&(c=','+this.X.join(','));return this.ma().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.na.Oc.la=[olympe.dc.zf];olympe.dc.na.le=class extends olympe.dc.na.Oc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.le)}G(){return olympe.dc.W.Vb.Pm}Yb(){return olympe.D.ea}};N('olympe.dc.valuedefs.NumberProperty',olympe.dc.na.le);olympe.dc.na.pe=class extends olympe.dc.na.Oc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.pe)}G(){return olympe.dc.W.Vb.Qm}Yb(){return olympe.D.Wa}};N('olympe.dc.valuedefs.StringProperty',olympe.dc.na.pe);olympe.dc.na.ue=class extends olympe.dc.na.Oc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.ue)}G(){return olympe.dc.W.Vb.Nm}Yb(){return olympe.D.qa}};N('olympe.dc.valuedefs.BooleanProperty',olympe.dc.na.ue);olympe.dc.na.je=class extends olympe.dc.na.Oc{constructor(a,b,c){super(a,b,c)}ma(){return O(olympe.dc.na.je)}G(){return olympe.dc.W.Vb.Om}Yb(){return olympe.D.jb}};N('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.na.je);olympe.dc.na.Tn=class{constructor(a,b){if(olympe.D.Wf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.R();var d=olympe.dc.Oa();const e=d.ic(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Qf(e,olympe.dc.CloudObject.extendRel,olympe.dm.sf);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.R():d=new olympe.dc.na.pe(c,b);break;case olympe.dm.Number.O.R():d=new olympe.dc.na.le(c,
638
+ b);break;case olympe.dm.Boolean.O.R():d=new olympe.dc.na.ue(c,b);break;case olympe.dm.DateTime.O.R():d=new olympe.dc.na.je(c,b)}this.F=d}ma(){return this.F.ma()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ja(a){return this.F.ja(a)}toString(){return this.F.toString()}};olympe.dc.na.Tn.la=[olympe.dc.zf];olympe.dc.Cb={};olympe.dc.Cb.Number=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Cb.Number)}U(){return this.C.C()}N(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ja(a){return`{"c":"${this.ma()}",a:[${this.C.ja(a)}]}`}toString(){return`Number(${this.C.toString()})`}};N('olympe.dc.comparators.Number',olympe.dc.Cb.Number);olympe.dc.Cb.Number.la=[olympe.dc.Oe];olympe.dc.Cb.String=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Cb.String)}U(){return this.C.C()}N(a,b){return olympe.D.Fa([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Wa)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ja(a){return`{"c":"${this.ma()}",a:[${this.C.ja(a)}]}`}toString(){return`String(${this.C.toString()})`}};N('olympe.dc.comparators.String',olympe.dc.Cb.String);olympe.dc.Cb.String.la=[olympe.dc.Oe];olympe.dc.Cb.DateTime=class{constructor(a){this.C=a}ma(){return O(olympe.dc.Cb.DateTime)}U(){return this.C.C()}N(a,b){return this.C.getValue(a,b)}G(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ja(a){return'{"c":"'+this.ma()+'",a:['+this.C.ja(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};N('olympe.dc.comparators.DateTime',olympe.dc.Cb.DateTime);olympe.dc.Cb.DateTime.la=[olympe.dc.Oe];let Wg=0;olympe.dc.Cb.Pg=class{constructor(){this.id=Wg++}ma(){return'CustomLocalComparator#'+Wg}U(){return[]}N(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ja(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.Cb.Pg.la=[olympe.dc.Oe];olympe.dc.V={};olympe.dc.V.nd=class{constructor(a){this.G=a}ma(){return O(olympe.dc.V.nd)}F(){return this.G.F()}C(a,b){return olympe.D.fl(this.G.C(a,b),c=>!c.valueOf())}ja(a){return`{"c":"${this.ma()}","a":[${this.G.ja(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};N('olympe.dc.predicates.Not',olympe.dc.V.nd);olympe.dc.V.nd.la=[olympe.dc.$a];olympe.dc.V.Ud=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}ma(){return O(olympe.dc.V.Ud)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.ef(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(!arguments[d].valueOf())return!1;return!0})}ja(a){const b=this.V.map(c=>c.ja(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'And('+
639
+ this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.And',olympe.dc.V.Ud);olympe.dc.V.Ud.la=[olympe.dc.$a];olympe.dc.V.ae=class{constructor(a){this.V=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.V=this.V.concat(arguments[c]):this.V.push(arguments[c])}ma(){return O(olympe.dc.V.ae)}F(){return this.V.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return olympe.D.ef(this.V.map(c=>c.C(a,b)),function(){for(let c=arguments.length,d=0;d<c;d++)if(arguments[d].valueOf())return!0;return!1})}ja(a){const b=this.V.map(c=>c.ja(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'Or('+
640
+ this.V.map(a=>a.toString()).join(',')+')'}};N('olympe.dc.predicates.Or',olympe.dc.V.ae);olympe.dc.V.ae.la=[olympe.dc.$a];olympe.dc.V.ol=class{constructor(a,b){this.G=a;this.N=b}ma(){}F(){return[this.G.C(),this.N.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.N.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return this.U('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d))},Boolean)}U(){}ja(a){return'{"c":"'+this.ma()+'","a":['+this.G.ja(a)+','+this.N.ja(a)+']}'}toString(){return this.ma().replace(/^.+\./,'')+'('+this.G.toString()+','+this.N.toString()+')'}};olympe.dc.V.ol.la=[olympe.dc.$a];olympe.dc.V.Ic=class{constructor(a,b){this.G=a;this.N=b}ma(){return O(olympe.dc.V.Ic)}F(){return[this.G.C(),this.N.C()]}C(a,b){return olympe.D.Fa([this.G.getValue(a,b),this.N.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Td?c.Td(d):'object'===typeof d&&void 0!==d.Td?d.Td(c):olympe.D.Cc(c.valueOf()===d.valueOf()),olympe.D.qa,'Test equal predicate')}ja(a){return'{"c":"'+this.ma()+'","a":['+this.G.ja(a)+','+this.N.ja(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.N.toString()+
641
+ ')'}};N('olympe.dc.predicates.Equals',olympe.dc.V.Ic);olympe.dc.V.Ic.la=[olympe.dc.$a];olympe.dc.V.ct=class extends olympe.dc.V.Ic{constructor(a,b){super(a,new olympe.dc.na.Dd(b))}};olympe.dc.V.ct.la=[olympe.dc.$a];olympe.dc.V.ze=class extends olympe.dc.V.ol{constructor(a,b){super(a,b)}ma(){return O(olympe.dc.V.ze)}U(a,b){return a>b}};N('olympe.dc.predicates.Greater',olympe.dc.V.ze);olympe.dc.V.Ge=class extends olympe.dc.V.ol{constructor(a,b){super(a,b)}ma(){return O(olympe.dc.V.Ge)}U(a,b){return a<b}};N('olympe.dc.predicates.Smaller',olympe.dc.V.Ge);olympe.dc.V.Wc=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ma(){return O(olympe.dc.V.Wc)}F(){return[this.source.C(),this.value.C()]}getValue(){return this.value}C(a,b){return olympe.D.Fa([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Cc(c.includes(d))},olympe.D.qa)}ja(a){const b=this.source.ja(a),c=this.value.ja(a);a=Hf(a,this.G);return'{"c":"'+this.ma()+'","a":['+
642
+ b+','+c+','+a+']}'}toString(){const a=Gf(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};N('olympe.dc.predicates.Contains',olympe.dc.V.Wc);olympe.dc.V.Wc.la=[olympe.dc.$a];olympe.dc.V.wd=class{constructor(a,b,c){this.source=a;this.N=b;this.G=void 0===c?!0:c}ma(){return O(olympe.dc.V.wd)}F(){return[this.source.C()]}C(a,b){return olympe.D.ef([this.source.getValue(a,b),this.N,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return(new RegExp(d)).test(c)})}ja(a){const b=this.source.ja(a),c=Hf(a,this.N);a=Hf(a,this.G);return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Gf(this.G);return'Regex('+this.source.toString()+
643
+ ','+this.N+','+a+')'}};N('olympe.dc.predicates.Regex',olympe.dc.V.wd);olympe.dc.V.wd.la=[olympe.dc.$a];olympe.dc.V.nf=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.wa(b))}):this.G.add(olympe.dc.wa(a))}ma(){return O(olympe.dc.V.nf)}F(){return[]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Oa();let e=[];const f=()=>{e.forEach(h=>{d.C(h.tag,h.C,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.wa(olympe.dc.CloudObject))K(c,this.G.has(k)),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);this.G.has(k)?
644
+ (K(c,!0),f()):(h=new Xg(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.C,g,h.id))}};a=new Xg(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.C,g,a.id);c.onDestroy(f);Va(c)||K(c,!1);return c}ja(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Xg{constructor(a,b){this.tag=a;this.C=b;this.id=olympe.W.zg()}}N('olympe.dc.predicates.InstanceOf',olympe.dc.V.nf);olympe.dc.V.nf.la=[olympe.dc.$a];function Yg(a){return a.La.map(b=>b.R())}function Zg(a){return a.La.map(b=>b.Pa())}
645
+ olympe.dc.V.mf=class{constructor(a,b,c){this.La=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.wa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Fc?this.La.push(new $g(c.R(),c.Pa(),c.F,c.C)):this.La.push(new $g(olympe.dc.wa(c),b[d],1,1))}ma(){return O(olympe.dc.V.mf)}F(){return[this.La.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.W.hc(),e=olympe.dc.Oa();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
646
+ c.Ab()||(f+=h?1:-1,K(c,0<f))};const g=this.La;for(let h=g.length-1;0<=h;h--)a=ah(g[h],e,a,d+h);xc(e,b,a,d);olympe.D.Ja().onDestroy(()=>{yc(e,b,d)});c.cf(!1);return c}ja(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.La.map(a=>a.ja()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.La.map(a=>a.ja())+')'}};N('olympe.dc.predicates.HasRelated',olympe.dc.V.mf);
647
+ function ah(a,b,c,d){const e=Object.create(null);d+=olympe.W.zg();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,V(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.C(h,a,l))}};return(g,h)=>f(g,h,0)}class $g extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ja(){return`${this.R()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.V.mf.la=[olympe.dc.$a];olympe.dc.V.vl=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return olympe.D.ef([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return(Number(c)&Number(d.valueOf()))===Number(c)})}ma(){return O(olympe.dc.V.vl)}F(){return[this.value.C()]}ja(a){const b=olympe.D.lb(this.G)?this.G.Na.Kb.valueOf():this.G.valueOf();return'{"c":"'+this.ma()+'","a":['+b+','+this.value.ja(a)+']}'}toString(){const a=olympe.D.lb(this.G)?this.G.Na.Kb.valueOf():this.G.valueOf();return this.ma().replace(/^.+\./,'')+
648
+ '('+a.toString()+','+this.value.toString()+')'}};N('olympe.dc.predicates.BitMask',olympe.dc.V.vl);olympe.dc.V.vl.la=[olympe.dc.$a];let bh=0;olympe.dc.V.Pg=class{constructor(){this.id=bh++}ma(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ja(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.V.Pg.la=[olympe.dc.$a];olympe.dc.V.Ml=class{constructor(a,b,c){this.La=[];this.G=void 0!==c?c.map(olympe.dc.wa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.X.Fc?this.La.push(new ch(c.R(),c.Pa(),c.F,c.C)):this.La.push(new ch(olympe.dc.wa(c),b[d],1,1))}ma(){return O(olympe.dc.V.Ml)}F(){return[this.La.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=olympe.D.createNode(Boolean),d=olympe.dc.Oa(),e=olympe.W.zg();a=(h,k,l)=>{k&&(null===this.G||this.G.includes(l))&&h(1)};const f=this.La;
649
+ for(let h=f.length-1;0<=h;h--)a=f[h].getTransform(d,a,e+h);let g=0;xc(d,b,a.bind(null,h=>{c.G()||c.Ab()||(g+=h,K(c,0<g))}),e);olympe.D.Ja().onDestroy(()=>yc(d,b,e));c.cf(!1);return c}ja(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.La.map(a=>a.ja()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.La.map(a=>a.ja())+')'}};N('olympe.dc.predicates.HasRelatedTree',olympe.dc.V.Ml);
650
+ class ch extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.N=new Map;this.G=new Map}getTransform(a,b,c){const d=this.G,e=this.N,f=new Set,g=(k,l,n)=>{e.has(l)?e.get(l).set(c+n,k):e.set(l,(new Map).set(c+n,k))},h=(k,l,n,p,q)=>{const r=olympe.W.zg();if(p){const t=n+q,u=v=>{const w=e.get(q);if(f.has(t))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${n} and ${q}`);void 0!==w&&
651
+ null!==w&&(f.add(t),d.set(q,(d.get(q)||0)+v),Array.from(w.values()).forEach(y=>y(v)));f.delete(t)};g(k,q,n);d.has(q)?k(d.get(q)):(l>=this.F&&b(v=>{d.set(q,(d.get(q)||0)+v);k(v)},p,q),(0>this.C||l<=this.C)&&q!==n&&V(a,q,this,h.bind(this,u,l+1,q),r))}else k(-d.get(q)),e.get(q).delete(c+n),0===e.get(q).size&&(d.delete(q),e.delete(q),a.C(q,this,r))};return(k,l,n)=>h(k,0,'origin',l,n)}ja(){return`${this.R()}, ${this.Pa()}, ${this.F}, ${this.C}`}}olympe.dc.V.Ml.la=[olympe.dc.$a];olympe.dc.X={};olympe.dc.X.tk={ht:1,ut:-1,vp:0};olympe.dc.X.nB={Sy:!0,oz:!1};olympe.dc.X.Sb=class extends olympe.dc.ta.Relation{constructor(a,b){super(a,b||olympe.dc.Aa.DESTINATION)}Yb(){return Lc(this)}ma(){return O(olympe.dc.X.Sb)}Gc(){return new olympe.dc.X.Sb(this.tag,this.direction===olympe.dc.Aa.DESTINATION?olympe.dc.Aa.ORIGIN:olympe.dc.Aa.DESTINATION)}getTransform(a,b,c){const d=olympe.dc.Oa(),e=this.R(),f=this.Pa();return(g,h,k,l)=>{Ng(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.W.mb(k+f+e+p,20),r=yg(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.C(h,this,k)}}ja(){return'{"c":"'+
652
+ this.ma()+'","a":["'+this.R()+'","'+this.Pa()+'"]}'}toString(){return'Related('+this.Pa()+this.R()+')'}};N('olympe.dc.transformers.Related',olympe.dc.X.Sb);olympe.dc.X.Sb.la=[olympe.dc.$c];olympe.dc.X.Fc=class extends olympe.dc.ta.Relation{constructor(a,b=olympe.dc.Aa.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.C=d}Yb(){return Lc(this)}ma(){return O(olympe.dc.X.Fc)}getTransform(a,b,c){const d=olympe.dc.Oa(),e=Object.create(null),f=olympe.dc.Aa.ORIGIN,g=olympe.dc.Aa.DESTINATION,h=this.R(),k=this.Pa(),l=(p,q,r)=>{if(!(0<=this.C&&p>=this.C)){var t=d.tb(r,this);p+=1;for(let u=0,v=t.length;u<v;u++){if(void 0!==e[t[u]]||r===t[u])continue;const w=olympe.W.mb(q+k+(h+'_'+p)+t[u],20);b.register(w,
653
+ q,r,h,k||g);null===k&&b.register(w,q,r,h,f)}}},n=(p,q,r,t,u,v)=>{u&&!b.F&&l(p,t,v);p>=this.F?c(u,v,t,yg(r,u,v,t)):Ng(b,t,v,h,k);0<=this.C&&p>=this.C||(u?e[v]||(e[v]=!0,V(d,v,this,(w,y)=>{const B=p+1,E=olympe.W.mb(t+k+(h+'_'+B)+y,20);n(B,v,r,E,w,y)},t)):(d.C(v,this,t),delete e[v]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ja(){return'{"c":"'+this.ma()+'","a":["'+this.R()+'","'+this.Pa()+'",'+this.F+','+this.C+']}'}toString(){return'RecursiveRelated('+this.Pa()+this.R()+'['+this.F+'..'+this.C+'])'}};
654
+ N('olympe.dc.transformers.RecursiveRelated',olympe.dc.X.Fc);olympe.dc.X.Fc.la=[olympe.dc.$c];function dh(a){return a.La.map(b=>b.R())}
655
+ olympe.dc.X.Ce=class{constructor(a,b){this.direction=b||olympe.dc.Aa.DESTINATION;this.La=a.map(c=>new olympe.dc.ta.Relation(c,this.direction))}Yb(){return olympe.dc.CloudObject}ma(){return O(olympe.dc.X.Ce)}Pa(){return this.direction}getTransform(a,b,c){const d=olympe.dc.Oa(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.Pa();var q=k.R();p=olympe.W.mb(g+p+q+n,20);q=yg(h,l,n,p);l&&b.register(p,g,f,k.R(),k.Pa());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.La.forEach(l=>{Ng(b,h,g,l.R(),l.Pa());e(g,h,k,l)}):this.La.forEach(l=>
656
+ {d.C(g,l,h)})}}ja(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(dh(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Pa()+'['+dh(this).join(',')+'])'}};N('olympe.dc.transformers.MultiRelated',olympe.dc.X.Ce);olympe.dc.X.Ce.la=[olympe.dc.$c];olympe.dc.X.Gl=class{constructor(a,b,c,d){this.C=new olympe.dc.ta.Relation(olympe.dc.wa(a),c||olympe.dc.Aa.DESTINATION);this.F=new olympe.dc.ta.Relation(olympe.dc.wa(b),d||olympe.dc.Aa.DESTINATION)}Yb(){return Lc(this.C)}ma(){return O(olympe.dc.X.Gl)}getTransform(a,b,c){const d=olympe.dc.Oa(),e={},f=this.C.R(),g=this.C.Pa(),h=this.F.R(),k=this.F.Pa();let l=null,n=null;const p=(r,t,u,v,w,y)=>{if(w){if(w=()=>{const B=olympe.W.mb(u+g+(f+'_'+r)+y,20),E=yg(t,!0,y,B);l=r;n=()=>{c(!1,y,B,yg(t,!1,y,B))};
657
+ b.register(B,u,v,f,g);c(!0,y,B,E)},w.$r=r,e[v]=w,null===l||r<l)n&&n(),w()}else if(l===r){n();e[v]=!0;w=Infinity;let B=null;for(let E=Object.keys(e),S=E.length,I=0;I<S;I++){let Z=e[E[I]];Z.$r<w&&(w=Z.$r,B=Z)}B&&B()}},q=(r,t,u,v,w)=>{v?e[w]||(e[w]=!0,Ng(b,u,w,f,g),Ng(b,u,w,h,k),V(d,w,this.C,p.bind(this,r,t,u,w),u+'_val'),V(d,w,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.C(w,this.F,u+'_follow'),d.C(w,this.C,u+'_val'),delete e[w])};return(r,t,u,v)=>q(0,v,u,r,t)}ja(){return'{"c":"'+this.ma()+'","a":["'+
658
+ this.C.toString()+'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.C.toString()+', '+this.F.toString()+')'}};N('olympe.dc.transformers.FirstRelated',olympe.dc.X.Gl);olympe.dc.X.Gl.la=[olympe.dc.$c];olympe.dc.X.xe=class{Yb(){return null}ma(){return O(olympe.dc.X.xe)}getTransform(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,yg(h,!0,f,f))):(d[f]++,Mg(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,yg(h,!1,f,f)))}}ja(){return'{"c":"'+this.ma()+'"}'}toString(){return'Distinct()'}};N('olympe.dc.transformers.Distinct',olympe.dc.X.xe);olympe.dc.X.xe.la=[olympe.dc.$c];olympe.dc.X.Kd=class{constructor(a,b){this.Md=a;this.C=void 0===b?!0:!!b}Yb(){return null}ma(){return O(olympe.dc.X.Kd)}F(){return[this.Md.U()]}getTransform(a,b,c){const d=new olympe.dc.tc.$q(this.C?this.Md.G.bind(this.Md):(e,f)=>this.Md.G(f,e));return(e,f,g)=>{var h=e?this.Md.N(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ja(a){return'{"c":"'+this.ma()+'","a":['+this.Md.ja(a)+','+JSON.stringify(this.C)+']}'}toString(){return'Sort('+this.Md.toString()+','+JSON.stringify(this.C)+')'}};
659
+ N('olympe.dc.transformers.Sort',olympe.dc.X.Kd);olympe.dc.X.Kd.la=[olympe.dc.$c,olympe.dc.tq];olympe.dc.X.vc=class{constructor(a){this.C=a}Yb(){return null}ma(){return O(olympe.dc.X.vc)}F(){return this.C.F()}getTransform(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Mg(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,yg(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;f?(f=this.C.C(a,g),olympe.D.lb(f)&&(f=f.Na),olympe.D.Vf(f)?(b.F||void 0!==olympe.D.bb(f)||Mg(b,h),e[l]=f,olympe.D.Ec([f],n=>{d(g,h,k,n)},'filterResultHandler')):d(g,h,k,f)):(void 0!==e[l]&&(e[l].destroy(),delete e[l]),d(g,h,k,!1),delete e[h])}}ja(a){return'{"c":"'+
660
+ this.ma()+'","a":['+this.C.ja(a)+']}'}toString(){return'Filter('+this.C.toString()+')'}};N('olympe.dc.transformers.Filter',olympe.dc.X.vc);olympe.dc.X.vc.la=[olympe.dc.$c,olympe.dc.tq];olympe.dc.X.Zd=class{constructor(a,b){this.start=a;this.C=b}Yb(){return null}ma(){return O(olympe.dc.X.Zd)}getTransform(a,b,c){const d=new olympe.dc.tc.$l;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);Jg(d,e,f,n,c)}};olympe.D.ie([this.start,this.C],(n,p)=>{f=n.valueOf();g=p.valueOf();k()});Sg(b,k);const l=Pg(b);Og(b,l);return(n,p,q,r)=>{h||(r.Tc().Mg(t=>{e=t;Tg(b,l)}),wg(b,()=>r.ug(),l),h=!0);d.C(n,p,q,null);xg(b,q,l)}}ja(a){return'{"c":"'+
661
+ this.ma()+'","a":['+Hf(a,this.start)+','+Hf(a,this.C)+']}'}toString(){return`Limit(${olympe.D.bb(this.start)},${olympe.D.bb(this.C)})`}};N('olympe.dc.transformers.Limit',olympe.dc.X.Zd);olympe.dc.X.Zd.la=[olympe.dc.$c];function eh(a,b,c,d,e,f){function g(p,q){if(l)for(var r=l.length-1;0<=r;r--)f=l[r].getTransform(b,e,n.C(f));f=n.C(f);e.register(h,null);r=d.C(p,q,c,null);f(p,q,h,yg(r,p,q,h))}const h=olympe.W.hc(),k=olympe.dc.Oa(),l=a.X,n=olympe.D.Ja();olympe.D.Ec([a.C],p=>{fh(k,p,g,h);void 0===k.model(p)&&vg(e)})}function fh(a,b,c,d){const e=b&&b.valueOf();e&&(xc(a,e,c,d),olympe.D.Ja().zc(()=>yc(a,e,d)))}
662
+ olympe.dc.X.xf=class{constructor(a,b){this.X=this.C=null;a instanceof olympe.dc.Ca?(this.C=a.Od(),this.X=a.Tl()):(this.C=a,b&&(this.X=b))}Yb(){return null}ma(){return O(olympe.dc.X.xf)||''}Dg(){return this.X}Od(){return this.C}getTransform(a,b,c){const d=new olympe.dc.tc.$l,e=new olympe.dc.tc.Jj;let f=[],g=[],h=!1,k=!1;const l=Pg(b),n=Pg(b);Sg(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):Tg(b);Jg(d,p,0,p.length,c)});Og(b,n);eh(this,a,this.C,e,b,(p,q,r,t)=>{const u=olympe.D.Ja();
663
+ u.G()||u.Ab()||(k||(t.Tc().Mg(v=>{g=v;Tg(b,n)}),wg(b,()=>t.ug(),n),k=!0),d.C(p,q,r),xg(b,r,n))});Og(b,l);return(p,q,r,t)=>{h||(t.Tc().Mg(u=>{f=u;Tg(b,l)}),wg(b,()=>t.ug(),l),h=!0);d.C(p,q,r,l);xg(b,r,l)}}ja(a){const b=this.X?'['+this.X.map(c=>c.ja(a)).join(',')+']':'null';return'{"c":"'+this.ma()+'","a":['+Hf(a,this.C)+','+b+']}'}toString(){const a=olympe.D.lb(this.C)?'N:'+this.C.Na.Z():this.C.valueOf(),b=this.X?','+this.X.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
664
+ N('olympe.dc.transformers.Union',olympe.dc.X.xf);olympe.dc.X.xf.la=[olympe.dc.$c];olympe.dc.Ng={};function gh(a,b){let c=Dc.get(b)||null,d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Df(b);if(null===b)break;c=Dc.get(b)||null}return c||null}olympe.dc.Ng.SyncManager=class{constructor(a,b,c){this.L=a;this.db=b;this.C=c}};olympe.dc.Ng.P={Ea:'dc.syncs.Logger',xa:'dc.syncs.SyncManager'};olympe.T.config(function(a){C(a,olympe.dc.Ng.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc'));A(a,olympe.dc.Ng.P.xa,olympe.dc.Ng.SyncManager,olympe.dc.Ng.P.Ea,olympe.dc.P.xi,olympe.T.P.dg)});olympe.dc.W={};olympe.dc.W.XC=function(a){a=olympe.dc.wa(a);const b=olympe.D.Uc(olympe.D.Wa,'getInstanceName'),c=olympe.dc.Oa(),d=Ad(c,a,olympe.dc.CloudObject.nameProp,b.update.bind(b));olympe.D.Ja().zc(c.F.bind(c,a,olympe.dc.CloudObject.nameProp,d));return b.Fb()};olympe.dc.W.$C=function(a){return olympe.D.Fa([a],b=>olympe.D.ly(olympe.dc.Oa().oj(b)),olympe.D.qa)};olympe.dc.W.aD=function(a){return(a=olympe.D.bb(a))?olympe.dc.Oa().oj(a):!1};olympe.dc.W.Mi=class a{constructor(b=olympe.dc.Ga.Pc){this.G=b}C(b){const c=new olympe.dc.db.Ac;this.F(b,c);return c}U(b,c,d){const e=new olympe.dc.db.Ac(b),f=new olympe.dc.query.Ei(b,this.G,c,e);this.F(d,e,(g,h)=>{h=h||[];const k=f.C.get(g)||new Set;for(const l of h)k.add(l);f.C.set(g,k)});return f}N(b,c){const d=new olympe.dc.db.Ac(b),e=new olympe.dc.query.rt(b,d);this.F(c,d,(f,g,h)=>{h=h||[];const k=new mf(f);k.add=g||[];k.remove=h;e.C.set(f,k)});return e}F(b,c,d){const e=olympe.dc.$b.Jd;for(const f of b)switch(b=
665
+ f.i?f.i:-1,f.o){case 1:const g=a.C(f.p||{});g.has(e)||g.set(e,this.G);c.F(f.t,g,b);break;case 2:c.uc(f.t,a.C(f.p),!0,b);break;case 3:c.Mc(f.t,f.f,b);break;case 4:c.Ra(f.m,f.l,f.r,b);break;case 5:c.fc(f.m,f.l,f.r,b);break;case 6:d&&d(f.i,f.a,f.d);break;default:throw Error('Undefined patch operation: '+f.o);}}static C(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;if(b===olympe.dc.$b.Jd||b===olympe.dc.$b.VERSION){c.set(b,e);continue}else if('v'===d){c.set(olympe.dc.$b.VERSION,e);continue}let f=
666
+ typeof e;b.startsWith('fd')&&(b=olympe.dc.Vg.kc+b.substr(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&
666
667
  e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.Jc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};olympe.dc.W.Vb={};olympe.dc.W.Vb.Qm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Bb(a):a instanceof olympe.D.Wa?a:null;olympe.dc.W.Vb.Nm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Cc(a):a instanceof olympe.D.qa?a:null;olympe.dc.W.Vb.Pm=a=>'number'===typeof a||a instanceof Number?olympe.D.za(a):'string'===typeof a||a instanceof String?olympe.D.za(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ea?a:null;
667
- olympe.dc.W.Vb.Om=function(a){return'number'===typeof a||a instanceof Number?rb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.jb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.jb(a):a instanceof olympe.D.jb?a:null};olympe.dc.W.Vb.Er=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?vb(a.valueOf()):null};olympe.dc.W.Vb.Fr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Jc?olympe.dc.CloudObject.get(a.tag):null;
668
- olympe.dc.W.Vb.hh=a=>a instanceof olympe.dc.Jc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.W.Vb.GC=a=>{switch(typeof a){case 'boolean':return olympe.D.Cc(a);case 'number':return olympe.D.za(a);case 'string':return olympe.D.Bb(a);case 'object':if(a instanceof Date)return olympe.D.Vx(a)}return a};
669
- olympe.dc.W.Vb.TC=a=>{switch(a){case olympe.D.qa:return olympe.dc.W.Vb.Nm;case olympe.D.Wa:return olympe.dc.W.Vb.Qm;case olympe.D.ea:return olympe.dc.W.Vb.Pm;case olympe.D.jb:return olympe.dc.W.Vb.Om;case olympe.D.Color:return olympe.dc.W.Vb.Er;case olympe.dc.CloudObject:return olympe.dc.W.Vb.Fr;default:return olympe.dc.W.Vb.hh}};olympe.dc.P={xa:'dc.Manager',mt:'dc.Graph',vi:'dc.DBView',Ea:'dc.Logger',bv:'dc.TransactionLogger',yi:'dc.FileServiceManager',me:'dc.Router'};olympe.dc.Config={dg:'dc.debug',$g:'dc.subscribeAll',xo:'dc.defaultSource',No:'dc.fileCache',Go:'dc.errorOnAbstractInstantiation'};
670
- olympe.T.config(function(a){D(a,olympe.dc.Config.dg,!1);D(a,olympe.dc.Config.$g,!1);D(a,olympe.dc.Config.xo,olympe.dc.Ga.Pc);D(a,olympe.dc.Config.No,!0);D(a,olympe.dc.Config.Go,!0);C(a,olympe.dc.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc'));ra(a,olympe.dc.P.bv,olympe.dc.transaction.P.Ea);ra(a,olympe.dc.P.vi,olympe.dc.db.P.ib);A(a,olympe.dc.P.yi,olympe.dc.it,olympe.dc.P.Ea,olympe.net.P.xa,olympe.dc.P.me,olympe.W.P.vh,new olympe.T.fa(olympe.dc.Config.No));sa(a,olympe.dc.P.me);A(a,olympe.dc.P.xa,olympe.dc.sa,
671
- olympe.dc.P.Ea,olympe.dc.db.P.xa,olympe.dc.query.P.xa,olympe.dc.transaction.P.xa,olympe.dc.Mg.P.xa,olympe.dc.P.yi)},'olympe.dc');olympe.T.run([olympe.dc.db.P.xa,olympe.dc.query.P.xa,olympe.dc.transaction.P.xa,olympe.dc.Mg.P.xa,olympe.dc.P.xa,olympe.dc.P.yi],(a,b,c,d,e,f)=>{olympe.dc.Ad=()=>a;olympe.dc.Nf=()=>b;olympe.dc.ei=()=>c;olympe.dc.Yr=()=>d;olympe.dc.Tc=()=>e;olympe.dc.Dw=()=>f},'DC singleton getter initialization');function dh(a){const b=olympe.dc.Oa(),c=new Map;b.Tk(a).forEach(d=>{b.tb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.Oa();this.model=null}static get(a){{var b=olympe.dc.Yr();a=olympe.dc.wa(a);const c=ch(b,b.db.model(a));null===c?(b.N.error(`Instantiation of a CloudObject (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
668
+ olympe.dc.W.Vb.Om=function(a){return'number'===typeof a||a instanceof Number?rb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.jb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.jb(a):a instanceof olympe.D.jb?a:null};olympe.dc.W.Vb.Fr=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?vb(a.valueOf()):null};olympe.dc.W.Vb.Gr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Jc?olympe.dc.CloudObject.get(a.tag):null;
669
+ olympe.dc.W.Vb.ih=a=>a instanceof olympe.dc.Jc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.W.Vb.HC=a=>{switch(typeof a){case 'boolean':return olympe.D.Cc(a);case 'number':return olympe.D.za(a);case 'string':return olympe.D.Bb(a);case 'object':if(a instanceof Date)return olympe.D.Yx(a)}return a};
670
+ olympe.dc.W.Vb.UC=a=>{switch(a){case olympe.D.qa:return olympe.dc.W.Vb.Nm;case olympe.D.Wa:return olympe.dc.W.Vb.Qm;case olympe.D.ea:return olympe.dc.W.Vb.Pm;case olympe.D.jb:return olympe.dc.W.Vb.Om;case olympe.D.Color:return olympe.dc.W.Vb.Fr;case olympe.dc.CloudObject:return olympe.dc.W.Vb.Gr;default:return olympe.dc.W.Vb.ih}};olympe.dc.P={xa:'dc.Manager',pt:'dc.Graph',xi:'dc.DBView',Ea:'dc.Logger',fv:'dc.TransactionLogger',Ai:'dc.FileServiceManager',ne:'dc.Router'};olympe.dc.Config={eg:'dc.debug',ah:'dc.subscribeAll',xo:'dc.defaultSource',No:'dc.fileCache',Go:'dc.errorOnAbstractInstantiation'};
671
+ olympe.T.config(function(a){D(a,olympe.dc.Config.eg,!1);D(a,olympe.dc.Config.ah,!1);D(a,olympe.dc.Config.xo,olympe.dc.Ga.Pc);D(a,olympe.dc.Config.No,!0);D(a,olympe.dc.Config.Go,!0);C(a,olympe.dc.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dc'));ra(a,olympe.dc.P.fv,olympe.dc.transaction.P.Ea);ra(a,olympe.dc.P.xi,olympe.dc.db.P.ib);A(a,olympe.dc.P.Ai,olympe.dc.lt,olympe.dc.P.Ea,olympe.net.P.xa,olympe.dc.P.ne,olympe.W.P.wh,new olympe.T.fa(olympe.dc.Config.No));sa(a,olympe.dc.P.ne);A(a,olympe.dc.P.xa,olympe.dc.sa,
672
+ olympe.dc.P.Ea,olympe.dc.db.P.xa,olympe.dc.query.P.xa,olympe.dc.transaction.P.xa,olympe.dc.Ng.P.xa,olympe.dc.P.Ai)},'olympe.dc');olympe.T.run([olympe.dc.db.P.xa,olympe.dc.query.P.xa,olympe.dc.transaction.P.xa,olympe.dc.Ng.P.xa,olympe.dc.P.xa,olympe.dc.P.Ai],(a,b,c,d,e,f)=>{olympe.dc.Ad=()=>a;olympe.dc.Of=()=>b;olympe.dc.gi=()=>c;olympe.dc.Zr=()=>d;olympe.dc.Tc=()=>e;olympe.dc.Gw=()=>f},'DC singleton getter initialization');function hh(a){const b=olympe.dc.Oa(),c=new Map;b.Uk(a).forEach(d=>{b.tb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.Oa();this.model=null}static get(a){{var b=olympe.dc.Zr();a=olympe.dc.wa(a);const c=gh(b,b.db.model(a));null===c?(b.L.error(`Instantiation of a CloudObject (tag = '${a}') that does not exist (or incompletely exists) in the local database.\n
672
673
  This could lead to unwanted behaviour and must be fixed.
673
- For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`),b=new olympe.dc.CloudObject(void 0,a)):b=c.instantiate(a,b.C)}return b}static Qv(a,b,c=olympe.dc.Ga.jc){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.Oa();let e=null;const f=h=>{null===e&&(e=dh(b||this));return e.has(h)?e.get(h):null},g=new Map;a.forEach((h,k)=>{d.Eb(olympe.dc.wa(k))?
674
- g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Transaction(!1);c=a.create(b||this,g,c);a.hb().catch(h=>olympe.ra.Xa('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${h}`));return this.get(c)}static Av(){return this.get(this)}static Xk(a){return olympe.dc.gb.Xk(a)}static kd(){return olympe.dc.Oa().tb(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.ta.Property(a))}static ld(){const a=olympe.dc.Oa();return a.tb(this,olympe.dc.CloudObject.G).map(b=>new olympe.dc.ta.Relation(b)).concat(a.tb(this,
675
- olympe.dc.CloudObject.U).map(b=>new olympe.dc.ta.Relation(b,olympe.dc.Aa.ORIGIN)))}static Lf(a){return olympe.dc.CloudObject.get(a)}static Iw(a){var b=ch(olympe.dc.Yr(),olympe.dc.wa(a));b=b&&b.C;return new olympe.dc.Ca(olympe.dc.wa(a),olympe.dc.CloudObject.instancesRel,b)}R(){return this.tag}name(){return this.db.name(this)}ma(){return this.Gb(olympe.dc.CloudObject.nameProp)}nh(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.gb.from(this)}Wf(){return this.db.Wf(this)}px(){return this.db.version(this)}Jt(){return this.db.source(this)}Rr(){return olympe.D.Fa([this.ma()],
676
- a=>olympe.D.Bb(a),olympe.D.Wa,'getDisplayName',olympe.D.Bb('('+this.toString()+')'))}Tb(){return this.model?this.model.R():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.xc?a.xc():a;return new rxjs.Observable(e=>{const f=this.db.fb(this.tag,b);c||null!==f||e.next(f);const g=wd(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.zc(()=>{e.complete();this.db.F(this.tag,b,g)});return()=>this.db.F(this.tag,b,g)})}yn(a){const b='function'===typeof a.xc?a.xc():a;
677
- return new rxjs.Observable(c=>{const d=xd(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.ta.Property(e),null]):c.next([new olympe.dc.ta.Property(e),f])});b.zc(()=>{c.complete();yd(this.db,this.tag,d)});return()=>yd(this.db,this.tag,d)})}$x(a){return this.observe(olympe.D.Ja(),a)}get(a){return this.db.fb(this.tag,a,!0)}fb(a){return this.get(a)}sb(a){return olympe.dc.gb.from(this).sb(a)}fw(a){return olympe.dc.od.from(this).sb(a)}qw(){return this.qc(olympe.dc.CloudObject.Lb,olympe.dc.CloudObject)}cn(){return this.tb(olympe.dc.CloudObject.containsRel,
678
- olympe.dc.CloudObject)}Of(a,b,c){const d=olympe.D.Uc(c,'Sync valueType'),e=wd(this.db,this.tag,a,olympe.D.Ja().C(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.node.onDestroy(()=>this.db.F(this.tag,a,e));return d.node}Gb(a){return L(this.Of(a,olympe.dc.W.Vb.Qm,olympe.D.Wa))}He(a){return L(this.Of(a,olympe.dc.W.Vb.Pm,olympe.D.ea))}Bg(a){return L(this.Of(a,olympe.dc.W.Vb.Nm,olympe.D.qa))}jj(a){return L(this.Of(a,olympe.dc.W.Vb.Om,olympe.D.jb))}Wr(){return L(this.Of(olympe.dm.Color.valueProp,
679
- olympe.dc.W.Vb.Er,olympe.D.Color))}Xr(){return L(this.Of(olympe.sc.workflow.Transition.processRefProp,olympe.dc.W.Vb.Fr,olympe.dc.CloudObject))}tb(a,b){a=a instanceof olympe.dc.X.Sb?a:new olympe.dc.X.Sb(a.R(),a.Pa());return new olympe.dc.Ca(this.R(),a,b)}qc(a,b){return this.tb(a,b).Sc()}Nr(a,b){const c=this.db,d=olympe.W.fc(),e=olympe.D.Ja(),f=new Map;V(c,this.tag,a,(g,h)=>{g?(g=new olympe.D.Xb(`forEachRelated: (${this.tag})-[:${a.R()}]-(${h})`,e),f.set(h,g),g.run(b,olympe.dc.CloudObject.get(h))):
680
- f.has(h)&&(f.get(h).destroy(),f.delete(h))},d);e.zc(()=>{c.C(this.tag,a,d)})}Iy(){return new olympe.dc.Ca(this.R(),[],Fc(this.R()))}transform(...a){return(new olympe.dc.Ca(this.R(),[],this.constructor)).transform(...a)}Vc(){return this.Rr()}toString(){if(!this.db.Eb(this.tag))return`unknown object #${this.tag||'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){if(!this.db.Eb(this.tag))return{CloudObject:'Unknown tag'};
681
- const a=this.db.model(this.tag),b=this.db.name(a),c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}uh(a=!1,b=!0){const c={};this.db.kd(this,b).forEach((d,e)=>{e=a?this.db.name(e):e;c[e]=d});return c}qb(a){return a instanceof olympe.dc.CloudObject?this.R()===a.R():!1}Td(a){return olympe.D.Fa([a],b=>olympe.D.Cc(this.qb(b)),olympe.D.qa)}Sv(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Transaction,c=!0;const d=olympe.dc.Aa.ORIGIN;for(const [e,f,g]of Ad(b,
682
- this))f===d?a.ec(e,g,this):e!==olympe.dc.CloudObject.modelRel.R()&&a.ec(e,this,g);a.delete(this,olympe.dc.Ub.NONE);c&&a.hb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.qb;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.uh;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.fw;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.fb;
683
- olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.$x;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.yn;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Tb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Wf;
684
- olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.nh;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.R;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Iw;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Lf;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.ld;
685
- olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.kd;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Xk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Av;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Qv;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.O=olympe.dc.ya.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.al=olympe.dc.CloudObject.O.va(olympe.dc.$b.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.va('ff023000000000000011');
686
- z('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.Y=olympe.dc.CloudObject.O.va('ff023000000000000012');olympe.dc.CloudObject.G=olympe.dc.CloudObject.O.Ha('ff02200000000000000a');olympe.dc.CloudObject.U=olympe.dc.CloudObject.O.Ha('ff02200000000000000b',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.Df=olympe.dc.CloudObject.O.Ha('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.be=olympe.dc.CloudObject.O.Ha('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.Ha('ff02200000000000000c');
687
- z('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.Ha('ff02200000000000000d',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.Ha(olympe.dc.kc.Xc);z('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);z('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
688
- olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.Ha(olympe.dc.kc.xi);z('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);z('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.Ha(olympe.dc.kc.jo);z('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
689
- olympe.dc.CloudObject.Lb=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.nB=olympe.dc.CloudObject;olympe.dc.CloudObject.la=[olympe.dc.ze];m=olympe.dc.CloudObject.prototype;m.R.K=new olympe.D.J(()=>String,[]);m.name.K=new olympe.D.J(()=>String,[]);m.ma.K=olympe.D.J.F;m.nh.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.px.K=new olympe.D.J(()=>Number,[]);m.Jt.K=new olympe.D.J(()=>String,[]);m.Rr.K=olympe.D.J.F;m.Tb.K=new olympe.D.J(()=>String,[]);
690
- m.qw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.cn.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Of.K=new olympe.D.J(()=>olympe.D.Node,[]);m.Gb.K=olympe.D.J.F;m.He.K=olympe.D.J.G;m.Bg.K=olympe.D.J.U;m.jj.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Wr.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Xr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.tb.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.qc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Nr.K=new olympe.D.J(()=>{},[]);
691
- m.Iy.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Vc.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;m.Td.K=olympe.D.J.U;m.Sv.K=new olympe.D.J(()=>{},[]);olympe.dc.fk=class{constructor(a){this.instance=a}R(){return this.instance.R()}lj(){return mb(this.instance.Bg(olympe.dc.CloudObject.Y))}Bw(){return this.instance.qc(olympe.dc.CloudObject.extendRel,olympe.dc.CloudObject)}Tk(){return this.instance.transform(new olympe.dc.X.Fc(olympe.dc.CloudObject.extendRel.R(),olympe.dc.Aa.DESTINATION,olympe.dc.X.sk.et))}hn(){return this.instance.transform(new olympe.dc.X.Fc(olympe.dc.CloudObject.extendRel.R(),olympe.dc.Aa.DESTINATION,olympe.dc.X.sk.vp))}kd(){return this.hn().transform(olympe.dc.CloudObject.propertyRel,
692
- new olympe.dc.X.we)}Rw(){return this.instance.transform(olympe.dc.CloudObject.propertyRel)}ld(){return this.hn().transform(olympe.dc.CloudObject.G,new olympe.dc.X.we)}Sw(){return this.instance.transform(olympe.dc.CloudObject.G)}static from(a){return olympe.D.Fa([a],b=>{const c=b.R(),d=olympe.dc.Oa();if(!d.mj(c))throw Error(`Instance "${d.name(c)}" (tag=${c}) is not a model.`);return new olympe.dc.fk(b)},olympe.dc.fk,'transformToModelInfo')}static lj(){return mb((void 0).Bg(olympe.dc.CloudObject.Y))}};
693
- olympe.dc.fk.la=[olympe.dc.ze];m=olympe.dc.fk.prototype;m.Bw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Tk.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.hn.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.kd.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Rw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.ld.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Sw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dc.uA=class{};olympe.dc.da={};olympe.dc.da.zp=class{constructor(a){this.N=a}};olympe.dc.da.zp.hd={Ri:0,MA:1,NA:3,wA:4};olympe.dc.da.Zj=class{};function Y(a){if(a.Y)throw Error('Cannot modify definition after definition is written');}
694
- olympe.dc.da.Zb=class{constructor(a,b){a=this.C=a;if(a.C)throw b=a.C.ma(),a=a.C.R(),Error('Cannot work on a new definition without calling done on the previous one or popping it. '+`Make sure done() method has been called on previous definition ${b} (${a})`);if(void 0===this)throw Error('Current def cannot be set to undefined.');a.C=this;this.tag=b;this.F=new Map;this.aa=olympe.dc.CloudObject.O.R();this.Da=new Map;this.oa=new Map;this.Y=this.ja=!1;this.U=null}En(a){Y(this);this.aa=a;return this}Tb(){return this.aa}ii(a){Y(this);
695
- this.U=a;return this}wy(){this.ja=!0;return this}vy(a){Y(this);const b=new Map;if('string'===typeof a){const c=olympe.dc.CloudObject.nameProp.R();b.set(c,a||'')}else Object.keys(a).forEach(c=>{b.set(c,a[c])});this.F=b;return this}ji(a){Y(this);Object.keys(a).forEach(b=>{this.F.set(b,a[b])});return this}setProperty(a,b){Y(this);this.F.set(a,b);return this}gl(a){Y(this);const b=olympe.dc.CloudObject.nameProp.R();this.F.set(b,a);return this}Jm(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');
696
- if(a===olympe.dc.CloudObject.containsRel.R())throw Error('Container must be defined using dedicated helpers setContainedIn');b&&this.Da.set(a+'.'+b,[a,b]);return this}Im(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');if(a===olympe.dc.CloudObject.containsRel.R())throw Error('Container must be defined using dedicated helper setContainedIn');b&&this.oa.set(a+'.'+b,[a,b]);return this}done(){if(this.Y)return this;const a=eh(this.C,this.ja);a.F(this.tag,this.F,
697
- -1);fh(this.C,this);a.Ra(olympe.dc.kc.Xc,this.tag,this.aa,-1);this.U&&a.Ra(olympe.dc.kc.jo,this.U,this.tag,-1);this.G(-1);this.Da.forEach(b=>{a.Ra(b[0],this.tag,b[1],-1)});this.oa.forEach(b=>{a.Ra(b[0],b[1],this.tag,-1)});this.Y=!0;this.C.C=void 0;return this}G(){}R(){return this.tag}ma(){return this.F.get('ff023000000000000011')}};olympe.dc.da.Zb.prototype.getName=olympe.dc.da.Zb.prototype.ma;olympe.dc.da.Zb.prototype.getTag=olympe.dc.da.Zb.prototype.R;olympe.dc.da.Zb.prototype.done=olympe.dc.da.Zb.prototype.done;
698
- olympe.dc.da.Zb.prototype.addRelationFrom=olympe.dc.da.Zb.prototype.Im;olympe.dc.da.Zb.prototype.addRelationTo=olympe.dc.da.Zb.prototype.Jm;olympe.dc.da.Zb.prototype.setName=olympe.dc.da.Zb.prototype.gl;olympe.dc.da.Zb.prototype.setProperty=olympe.dc.da.Zb.prototype.setProperty;olympe.dc.da.Zb.prototype.setProperties=olympe.dc.da.Zb.prototype.ji;olympe.dc.da.Zb.prototype.setNameOrProperties=olympe.dc.da.Zb.prototype.vy;olympe.dc.da.Zb.prototype.setOptional=olympe.dc.da.Zb.prototype.wy;
699
- olympe.dc.da.Zb.prototype.setContainedIn=olympe.dc.da.Zb.prototype.ii;olympe.dc.da.Zb.prototype.setModelTag=olympe.dc.da.Zb.prototype.En;olympe.dc.da.dd=class extends olympe.dc.da.Zb{constructor(a,b){super(a,b);this.Sa=this.C.OBJECT;this.Ya=new Map;this.ab=new Map}ms(a){Y(this);this.Sa=a;return this}extends(a){return this.ms(a)}Ui(){Y(this);this.setProperty(olympe.dc.CloudObject.Y.R(),!0);return this}defineProperty(a,b,c,d,e){Y(this);this.Ya.set(a,new olympe.dc.da.dd.Property(a,b,c,d));void 0!==d&&super.setProperty(olympe.dc.Ug.jc+a,d);void 0!==e&&(this.C.push(),this.C.Gg(this.C.Uk(a),olympe.sc.oc.O.R()).setProperty(olympe.sc.oc.C.R(),
700
- e).ii(this.tag).Jm(olympe.sc.oc.F.R(),a).done(),this.C.pop());return this}ih(a,b,c,d,e,{Yi:f=0,xj:g=0,il:h=d,Xi:k=olympe.dm.Nc.NONE,uj:l=olympe.dm.Relation.L|k}={}){Y(this);b=new olympe.dc.da.dd.Relation(a,this.R(),b,c||'',d,e,g,h,f,l,k);this.ab.set(a,b);return this}G(a){super.G(a);eh(this.C).Ra(olympe.dc.CloudObject.extendRel.R(),this.tag,this.Sa,a);this.Ya.forEach(b=>{const c={[olympe.dc.CloudObject.nameProp.R()]:b.name||''},d=olympe.dc.wa(olympe.dm.Property),e=olympe.dc.CloudObject.propertyRel.R(),
701
- f=b.tag;this.C.push();this.C.Gg(f,d).ji(c).done();this.C.pop();b=b.type;eh(this.C).Ra(e,this.R(),f,a);eh(this.C).Ra(olympe.dm.Property.typeRel.R(),f,b,a)});this.ab.forEach(b=>{this.C.ih(b.C,b.G,b.F,b.name,b.Mr,b.Kr,{xj:b.xj,il:b.il,Yi:b.Yi,uj:b.uj,Xi:b.Xi},a)})}};olympe.dc.da.dd.prototype.defineRelation=olympe.dc.da.dd.prototype.ih;olympe.dc.da.dd.prototype.defineProperty=olympe.dc.da.dd.prototype.defineProperty;olympe.dc.da.dd.prototype['abstract']=olympe.dc.da.dd.prototype.Ui;
702
- olympe.dc.da.dd.prototype['extends']=olympe.dc.da.dd.prototype.extends;olympe.dc.da.dd.prototype.setParentTag=olympe.dc.da.dd.prototype.ms;olympe.dc.da.dd.Property=class{constructor(a,b,c,d){this.tag=a;this.type=b;this.name=c||'';this.defaultValue=d}};olympe.dc.da.dd.Relation=class{constructor(a,b,c,d,e,f,g,h,k,l,n){this.C=a;this.G=b;this.F=c;this.name=d;this.Mr=e;this.Kr=f;this.xj=g;this.il=h;this.Yi=k;this.uj=l;this.Xi=n}};function eh(a,b){return b?a.Y:a.F}function fh(a,b){0<a.L.length&&(b.U||a.F.Ra(olympe.dc.CloudObject.containsRel.R(),a.L[a.L.length-1].R(),b.R(),-1))}
703
- olympe.dc.da.Qa=class{constructor(a){if(a&&void 0===a.log)throw Error('Argument of OSaveFileBuilder is not a logger - might be a source, adapt implementing classes');this.F=new olympe.dc.transaction.vd(!0);this.Y=new olympe.dc.transaction.vd(!0);this.N=a||null;this.Da=!1;this.G=null;this.oa=new Map;this.aa=null;this.ja=Object.create(null);this.C=void 0;this.L=[];this.U=!0;this.hs=/eval \(eval at process .*<anonymous>:(\d+):(\d+)\)/m;this.DEFAULT=olympe.dc.Ug.jc;this.OBJECT=olympe.dc.CloudObject.O.R();
704
- this.PROPERTY=olympe.dm.Property.O.R();this.RELATION=olympe.dm.Relation.O.R();this.STRING=olympe.dm.String.O.R();this.BOOLEAN=olympe.dm.Boolean.O.R();this.NUMBER=olympe.dm.Number.O.R();this.DATETIME=olympe.dm.DateTime.O.R();this.COLOR=olympe.dm.Color.O.R();this.FILE=olympe.dm.File.O.R();this.ROLE=olympe.dm.ed.O.R();this.USER=olympe.dm.User.O.R();this.ONE_ONE=olympe.dm.Relation.F.ou;this.ONE_MANY=olympe.dm.Relation.F.cm;this.MANY_ONE=olympe.dm.Relation.F.gu;this.MANY_MANY=olympe.dm.Relation.F.Yl;this.NONE=
705
- olympe.dm.Nc.NONE;this.DESTINATION_READ=olympe.dm.Nc.Rs;this.DESTINATION_CREATE=olympe.dm.Nc.Ao;this.DESTINATION_WRITE=olympe.dm.Nc.Ss;this.DESTINATION_DELETE=olympe.dm.Nc.Os;this.DESTINATION_LINK=olympe.dm.Nc.Qs;this.DESTINATION_FULL=olympe.dm.Nc.Ps;this.ORIGIN_READ=olympe.dm.Nc.su;this.ORIGIN_CREATE=olympe.dm.Nc.pu;this.ORIGIN_WRITE=olympe.dm.Nc.tu;this.ORIGIN_DELETE=olympe.dm.Nc.qu;this.ORIGIN_LINK=olympe.dm.Nc.hq;this.ORIGIN_FULL=olympe.dm.Nc.ru;this.FULL=olympe.dm.Nc.gt;this.DUMP_IGNORE=olympe.dm.Relation.C.Nl;
706
- this.DUMP_REF=olympe.dm.Relation.C.Bq;this.DUMP_REVERSE_REF=olympe.dm.Relation.C.Lu;this.DUMP_UNILATERAL=olympe.dm.Relation.C.Ck;this.DUMP_REVERSE_UNILATERAL=olympe.dm.Relation.C.rk;this.DUMP_EVERYTHING=olympe.dm.Relation.C.Ho;this.DUMP_DEFAULT=olympe.dm.Relation.C.jc;this.DUMP_REV_DEFAULT=olympe.dm.Relation.C.Ku;this.DELETE_REF=this.DUMP_BOTH_REF=olympe.dm.Relation.C.rl;this.DELETE_REF_AND_DESTINATION=olympe.dm.Relation.C.Hu;this.DELETE_REF_AND_ORIGIN=olympe.dm.Relation.C.Iu;this.DELETE_EVERYTHING=
707
- olympe.dm.Relation.C.Ho;this.OLYMPE_AUTHENTICATED_USERS=olympe.dm.ed.F}push(){this.L.push(this.C);this.C=void 0}pop(){if(this.C)throw Error('Cannot unstack definition: current definition not closed');this.C=this.L.pop()}cw(){const a=new Map,b=olympe.dc.da.Vu.C(this.aa,this.F,this.Y);for(const [c,d]of b.entries())a.set(c,d.uh());return a}$w(){return this.aa}uy(a){this.U=a}log(...a){this.U&&this.N&&this.N.log(...a)}tn(...a){this.U&&this.N&&this.N.debug(...a)}Cx(...a){this.U&&this.N&&this.N.warn(...a)}bl(...a){this.U&&
708
- this.N&&this.N.error(...a)}Cv(a){if(a&&20===a.length&&!this.Da){if(this.ja[a])throw Error('Tag '+a+' is used to define more than one keyword');return this.ja[a]=a}this.G=null===this.G?olympe.W.dj():olympe.W.Yw(this.G);this.log('Generating new tag to replace '+a+'. New tag is: '+this.G);return this.G}Uk(a){const b=this.oa.get(a)||1,c=olympe.W.Uk(a,b);this.oa.set(a,b+1);return c}Ay(a){this.Da=a}Uv(){}yy(a){this.aa=a}Gg(a,b){return(new olympe.dc.da.Zb(this,a)).En(b)}Sx(a,b){return(new olympe.dc.da.dd(this,
709
- a)).gl(b)}Rx(a,b){return(new olympe.dc.da.dd(this,a)).gl(b).Ui()}Tx(a){return new olympe.dc.da.xf(this,a)}dl(a,b,c){this.F.Ra(a,b,c,-1)}defineProperty(a,b,c,d,e){this.tn('Defining property ',d,' on model ',a);d={[olympe.dc.CloudObject.nameProp.R()]:d||''};void 0!==e&&this.tc(a,{[olympe.dc.Ug.jc+c]:e});this.C?(this.push(),this.Gg(c,olympe.dm.Property.O.R()).ji(d).done(),this.pop()):this.Gg(c,olympe.dm.Property.O.R()).ji(d).ii(a).done();this.dl(olympe.dc.CloudObject.propertyRel.R(),a,c);this.dl(olympe.dm.Property.typeRel.R(),
710
- c,b)}ih(a,b,c,d,e,f,{Yi:g=olympe.dm.Relation.F.cm,xj:h=olympe.dm.Relation.C.Nl,il:k=e,Xi:l=olympe.dm.Nc.NONE,uj:n=olympe.dm.Relation.L|l}={},p=-1){if(void 0===e||null===e)throw Error('Cannot define a relation without defining the dump follow rules (must be set to db.DUMP_<something> and cannot be undefined or null)');if(void 0===f||null===f)throw Error('Cannot define a relation without defining the delete follow rules (must be set to db.DELETE_<something> and cannot be undefined or null)');const q=
711
- olympe.dm.Relation;d={[olympe.dc.CloudObject.nameProp.R()]:d||'',[q.Mm.R()]:g,[q.zn.R()]:n,[q.Wm.R()]:e,[q.Vm.R()]:f,[q.Cn.R()]:h,[q.Gn.R()]:k,[q.Br.R()]:l};this.C?(this.push(),this.Gg(a,q.O.R()).ji(d).done(),this.pop()):this.Gg(a,q.O.R()).ji(d).ii(b).done();this.F.Ra(q.originModelRel.R(),b,a,p);this.F.Ra(q.destinationModelRel.R(),a,c,p)}Ax(a,b){this.F.Ra(olympe.dm.ed.C.R(),a,b,-1)}tc(a,b,c=!1){this.tn('Updating instance ',a);delete b[olympe.dc.$b.Jd];delete b[olympe.dc.$b.VERSION];const d=new Map;
712
- Object.keys(b).forEach(e=>{d.set(e,b[e])});this.F.tc(a,d,c,-1)}assign(a,b,c){this.dl(b,a,c)}Bv(a,b,c){this.Y.Ra(b,a,c,-1)}Pv(a){return new olympe.dc.Jc(a)}Kv(a,b,c,d){const e={c:7};e.r=a;e.g=b;e.b=c;e.a=d;return e}Lv({year:a=1970,month:b=1,day:c=1,hour:d=1,minute:e=0,second:f=0,bD:g=0,nD:h=0}={}){const k={c:4};k.y=a;k.M=b;k.d=c;k.h=d;k.m=e;k.s=f;k.S=g;k.z=h;return k}hw(a){a=new Date(Date.parse(a));const b={c:4};b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();b.h=a.getHours();b.m=a.getMinutes();
713
- b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=-a.getTimezoneOffset();return b}Mv(a){a='number'===typeof a?new Date(a):a;const b={c:4};b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=a.getTimezoneOffset();b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();return b}cj(a,b,c){return olympe.auth.Jb.Ee.cj(a,c)}Pr(a,b){return olympe.auth.Jb.Ee.cj(a,b)}ec(){throw Error('DeleteRelation method on OSaveFile is deprecated');}Mc(){throw Error('DeleteInstance method on OSaveFile is deprecated');
714
- }};olympe.dc.da.Qa.prototype.deleteInstance=olympe.dc.da.Qa.prototype.Mc;olympe.dc.da.Qa.prototype.deleteRelation=olympe.dc.da.Qa.prototype.ec;olympe.dc.da.Qa.prototype.generateAuthenticationData=olympe.dc.da.Qa.prototype.Pr;olympe.dc.da.Qa.prototype.generateAuthData=olympe.dc.da.Qa.prototype.cj;olympe.dc.da.Qa.prototype.createDateTimeLegacy=olympe.dc.da.Qa.prototype.Mv;olympe.dc.da.Qa.prototype.fromISODate=olympe.dc.da.Qa.prototype.hw;olympe.dc.da.Qa.prototype.createDateTime=olympe.dc.da.Qa.prototype.Lv;
715
- olympe.dc.da.Qa.prototype.createColor=olympe.dc.da.Qa.prototype.Kv;olympe.dc.da.Qa.prototype.createReference=olympe.dc.da.Qa.prototype.Pv;olympe.dc.da.Qa.prototype.assignOptional=olympe.dc.da.Qa.prototype.Bv;olympe.dc.da.Qa.prototype.assign=olympe.dc.da.Qa.prototype.assign;olympe.dc.da.Qa.prototype.updateInstance=olympe.dc.da.Qa.prototype.tc;olympe.dc.da.Qa.prototype.linkRoleToUser=olympe.dc.da.Qa.prototype.Ax;olympe.dc.da.Qa.prototype.defineRelation=olympe.dc.da.Qa.prototype.ih;
716
- olympe.dc.da.Qa.prototype.defineProperty=olympe.dc.da.Qa.prototype.defineProperty;olympe.dc.da.Qa.prototype.newRelation=olympe.dc.da.Qa.prototype.dl;olympe.dc.da.Qa.prototype.newUser=olympe.dc.da.Qa.prototype.Tx;olympe.dc.da.Qa.prototype.newAbstractModel=olympe.dc.da.Qa.prototype.Rx;olympe.dc.da.Qa.prototype.newModel=olympe.dc.da.Qa.prototype.Sx;olympe.dc.da.Qa.prototype.newInstance=olympe.dc.da.Qa.prototype.Gg;olympe.dc.da.Qa.prototype.setRootInstanceTag=olympe.dc.da.Qa.prototype.yy;
717
- olympe.dc.da.Qa.prototype.disableChecks=olympe.dc.da.Qa.prototype.Uv;olympe.dc.da.Qa.prototype.setUseNewTags=olympe.dc.da.Qa.prototype.Ay;olympe.dc.da.Qa.prototype.assignTag=olympe.dc.da.Qa.prototype.Cv;olympe.dc.da.Qa.prototype.logError=olympe.dc.da.Qa.prototype.bl;olympe.dc.da.Qa.prototype.logWarn=olympe.dc.da.Qa.prototype.Cx;olympe.dc.da.Qa.prototype.logDebug=olympe.dc.da.Qa.prototype.tn;olympe.dc.da.Qa.prototype.log=olympe.dc.da.Qa.prototype.log;olympe.dc.da.Qa.prototype.setLoggingEnabled=olympe.dc.da.Qa.prototype.uy;
718
- olympe.dc.da.Qa.prototype.getRootInstanceTag=olympe.dc.da.Qa.prototype.$w;olympe.dc.da.Qa.prototype.flushContents=olympe.dc.da.Qa.prototype.cw;olympe.dc.da.qg=class extends olympe.dc.da.dd{constructor(a,b,c){super(a,b);this.L=this.description=null;this.setProperty(olympe.dm.BrickMetadata.Ya.R(),olympe.dm.BrickMetadata.wb.vu);null!==c&&this.Ar(c)}Ar(a){this.ii(a);this.Im(olympe.dm.Qb.C.R(),a);return this}ty(a){this.F.set(olympe.dm.ve.Sa.R(),a);return this}qy(a){Y(this);this.description=a;return this}zy(a){Y(this);this.L=a;return this}G(a){super.G(a);if(null!==this.description||null!==this.L)this.C.push(),a=this.C.Gg(this.C.Uk(this.tag),olympe.sc.oc.O.R()),
719
- this.description&&a.setProperty(olympe.sc.oc.C.R(),this.description),this.L&&a.setProperty(olympe.sc.oc.L.R(),this.L),a.ii(this.tag).Jm(olympe.sc.oc.F.R(),this.tag).done(),this.C.pop()}};olympe.dc.da.qg.prototype.setSummary=olympe.dc.da.qg.prototype.zy;olympe.dc.da.qg.prototype.setDescription=olympe.dc.da.qg.prototype.qy;olympe.dc.da.qg.prototype.setIcon=olympe.dc.da.qg.prototype.ty;olympe.dc.da.qg.prototype.addToFolder=olympe.dc.da.qg.prototype.Ar;olympe.dc.da.Vu=class a{constructor(b,c,d){this.F=b;this.ua=c||[];this.C=d||[]}static C(b,c,d){if(c instanceof olympe.dc.transaction.vd&&d instanceof olympe.dc.transaction.vd){c=Zd(c);var e=Zd(d)}else e=new olympe.dc.transaction.vd(!0),c.Qc(e),c=Zd(e),d.Qc(e),e=Zd(e);d=new Map;var f=new a(b,c.wg,e.wg);f.Sf()||d.set('delRel',f);f=new a(b,c.Se,e.Se);f.Sf()||d.set('detInst',f);f=new a(b,c.Hg,e.Hg);f.Sf()||d.set('newInst',f);f=new a(b,c.Zf,e.Zf);f.Sf()||d.set('updateInst',f);b=new a(b,c.Ig,e.Ig);b.Sf()||
720
- d.set('newRel',b);return d}Sf(){return 0===this.ua.length+this.C.length}static wn(b){const c=Object.create(null),d=[],e=[];b.forEach(f=>{0===Object.keys(c).length&&(c.rootTag=f.rootTag);d.push(...(f.operations||[]));e.push(...(f.optionalOperations||[]))});0!==d.length&&(c.operations=d);0!==e.length&&(c.optionalOperations=e);return c}uh(){const b=(d,e)=>{var f=d.o,g=e.o;return f!==g?f<g?-1:1:1===f||2===f||3===f?(f=d.t,g=e.t,f===g?(d=Object.keys(d.p)[0],e=Object.keys(e.p)[0],void 0!==d?d.localeCompare(e):
721
- 1):f.localeCompare(g)):4===f||5===f?(f=d.l,g=e.l,f===g?(f=d.m,g=e.m,f===g?d.r.localeCompare(e.r):f.localeCompare(g)):f.localeCompare(g)):JSON.stringify(f).localeCompare(JSON.stringify(g))},c=Object.create(null);this.ua.sort(b);this.C.sort(b);c.rootTag=this.F;c.operations=this.ua;c.optionalOperations=this.C;return c}};olympe.dc.da.xf=class extends olympe.dc.da.Zb{constructor(a,b){super(a,b);this.password=this.L=null;this.En(olympe.dc.wa(olympe.dm.User))}By(a){Y(this);this.L=a;return this}Fn(a){Y(this);this.password=a;return this}sy(){return this}Dv(a){Y(this);this.Im(olympe.dm.User.C.R(),a);return this}G(a){super.G(a);if(null==this.L||''===this.L)throw Error('A username must be set when calling new User');if(null==this.password||''===this.password)throw Error('A password must be set when calling new User');const b=
722
- this.C.Pr(this.L,this.password),c=new Map;c.set(olympe.dm.User.loginProp.R(),b.login);c.set(olympe.dm.User.saltProp.R(),b.salt);c.set(olympe.dm.User.verifierProp.R(),b.verifier);eh(this.C).tc(this.R(),c,!1,a)}};olympe.dc.da.xf.prototype.awardRole=olympe.dc.da.xf.prototype.Dv;olympe.dc.da.xf.prototype.setDomain=olympe.dc.da.xf.prototype.sy;olympe.dc.da.xf.prototype.setPassword=olympe.dc.da.xf.prototype.Fn;olympe.dc.da.xf.prototype.setUsername=olympe.dc.da.xf.prototype.By;olympe.dc.da.P={xt:'dc.io.IOService',Bh:'dc.io.IOUrlsProvider'};olympe.T.config(function(a){sa(a,olympe.dc.da.P.Bh);C(a,olympe.dc.da.P.xt,[olympe.ra.P.xa,olympe.net.P.xa,olympe.auth.P.xa,olympe.dc.da.P.Bh],b=>new olympe.dc.da.zp(b.Rc('dc.io')))},'olympe.dc.io');olympe.dc.da.aD=function(a,b,c=!1){if(a.startsWith('@')||a.startsWith('v'))return!1;a.startsWith(olympe.dc.Ug.jc)&&(a=a.substring(1));const d=olympe.dc.Oa();return b?c?Cd(d,a,b):Cd(d,a,d.model(b)):d.Eb(a)};olympe.dm={};olympe.dm.Nc={NONE:0,Rs:1,Ao:2,Ss:4,Os:8,Qs:16,Ps:31,su:32,pu:64,tu:128,qu:256,hq:512,ru:992,gt:1023};olympe.dm.ed=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}ma(){return this.Gb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Wa.EMPTY}F(){return olympe.D.qa.C}};olympe.dm.ed.O=olympe.dc.ya.C('ff021000000000000002',olympe.dm.ed);olympe.dm.ed.ja=olympe.dm.ed.O.va('ff023000000000000035');olympe.dm.ed.C=olympe.dm.ed.O.Ha('ff022000000000000005');olympe.dm.ed.F=Ec('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.ed.aa=Ec('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
723
- olympe.dm.ed.L=Ec('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.ed.prototype.ma.K=olympe.D.J.F;olympe.dm.ed.prototype.C.K=olympe.D.J.F;olympe.dm.ed.prototype.F.K=olympe.D.J.U;olympe.dm.User=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Ew(){return this.en()}ma(){return this.en()}en(){return this.Gb(olympe.dm.User.loginProp)}Lt(){return this.Gb(olympe.dm.User.F)}Kt(){return olympe.D.Wa.EMPTY}bx(){return this.Gb(olympe.dm.User.saltProp)}ox(){return this.Gb(olympe.dm.User.verifierProp)}Zw(){return this.tb(olympe.dm.User.C,olympe.dm.ed)}};olympe.dm.User.O=olympe.dc.ya.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.va('ff023000000000000001');
724
- z('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.O.va('ff023000000000000002');olympe.dm.User.ja=olympe.dm.User.O.va('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.O.va('ff023000000000000004');z('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.va('ff023000000000000005');z('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.aa=olympe.dm.User.O.va('ff023000000000000020');
725
- olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.va('ff023000000000000036');z('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.C=P(olympe.dm.User.O,olympe.dm.ed.C);olympe.dm.User.oa=olympe.dm.User.O.Ha('ff022000000000000002');olympe.dm.User.L=Ec('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Ew.K=olympe.D.J.F;m.ma.K=olympe.D.J.F;m.en.K=olympe.D.J.F;m.Lt.K=olympe.D.J.F;m.Kt.K=olympe.D.J.F;m.bx.K=olympe.D.J.F;m.ox.K=olympe.D.J.F;
726
- m.Zw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.ve=class extends olympe.dc.CloudObject{ja(){return this.cn()}wb(){return this.Gb(olympe.dm.ve.Sa)}};olympe.dm.ve.O=olympe.dc.ya.C('01621fb84e3300000000',olympe.dm.ve);olympe.dm.ve.Sa=olympe.dm.ve.O.va('01609de3f292e3c2c6ff');olympe.dm.ve.prototype.ja.K=new olympe.D.J(()=>olympe.D.pd,[]);olympe.dm.ve.prototype.wb.K=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.ve{Ib(){return this.Gb(olympe.dm.BrickMetadata.Ya)}Rd(){return this.Gb(olympe.dm.BrickMetadata.ab)}C(){return null}};olympe.dm.BrickMetadata.O=Ic(olympe.dc.ya.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.Ya=olympe.dm.BrickMetadata.O.va('01621fb84e320000f001');olympe.dm.BrickMetadata.ab=olympe.dm.BrickMetadata.O.va('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Rf=olympe.dm.BrickMetadata.O.Ha('0161ae97622bb21f335b');
727
- olympe.dm.BrickMetadata.wb={FA:'private',vu:'public'};olympe.dm.BrickMetadata.ad=Ec('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.hd={vz:'experimental',QA:'stable',lz:'deprecated'};olympe.dm.BrickMetadata.prototype.Ib.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.Rd.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.C.K=new olympe.D.J(()=>String,[]);olympe.dm.Qb=class extends olympe.dm.BrickMetadata{U(){return new olympe.dc.Ca(this.R(),[new olympe.dc.X.Fc(olympe.dm.Qb.F.R(),olympe.dc.Aa.DESTINATION,olympe.dc.X.sk.vp,olympe.dc.X.sk.rt),olympe.dm.Qb.C])}C(){return null}F(){return this.tb(olympe.dm.Qb.F,olympe.dm.Qb)}Y(){return this.tb(olympe.dm.Qb.C)}};olympe.dm.Qb.O=olympe.dc.ya.C('01612df1db9749227626',olympe.dm.Qb);olympe.dm.Qb.F=olympe.dm.Qb.O.Ha('016a697ef00ce7554691');olympe.dm.Qb.Ib=P(olympe.dm.Qb.O,olympe.dm.Qb.F);olympe.dm.Qb.C=olympe.dm.Qb.O.Ha('016a697ef00ce7554692');
728
- P(olympe.dc.CloudObject.O,olympe.dm.Qb.C);olympe.dm.Qb.prototype.U.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Qb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Qb.prototype.Y.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Zc=class extends olympe.dm.Qb{F(){return this.R()===olympe.dm.Zc.Da?this.tb(olympe.dm.Zc.aa,olympe.dm.Qb):this.tb(olympe.dm.Zc.ja,olympe.dm.Qb)}};olympe.dm.Zc.O=olympe.dc.ya.C('ff021000000000000020',olympe.dm.Zc);olympe.dm.Zc.ja=olympe.dm.Zc.O.Ha('017e9c34cf48bd6965c1');olympe.dm.Zc.aa=olympe.dm.Zc.O.Ha('017e9c2e013e06bfffd9');olympe.dm.Zc.Xe=olympe.dm.Zc.O.Ha('01811f12ad77673770d4');olympe.dm.Zc.Da=Ec('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Zc.Lc=Ec('10000000000000000001','OLYMPE_FOLDER');
729
- olympe.dm.Zc.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Cw(){return this.Gb(olympe.dm.Module.ja)}Ow(){return this.He(olympe.dm.Module.oa)}Mt(){return this.Gb(olympe.dm.Module.F)}Tw(){return this.Gb(olympe.dm.Module.Da)}ow(){return this.Gb(olympe.dm.Module.L)}Pw(){return this.tb(olympe.dm.Module.aa,olympe.dm.Module)}ex(){return this.tb(olympe.dm.Module.C,olympe.dm.Fd)}};olympe.dm.Module.O=olympe.dc.ya.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.ja=olympe.dm.Module.O.va('ff023000000000000042');
730
- olympe.dm.Module.oa=olympe.dm.Module.O.va('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.O.va('ff023000000000000044');olympe.dm.Module.Da=olympe.dm.Module.O.va('ff023000000000000045');olympe.dm.Module.L=olympe.dm.Module.O.va('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.va('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.O.Ha('ff022000000000000013');olympe.dm.Module.aa=olympe.dm.Module.O.Ha('ff022000000000000014');
731
- olympe.dm.Module.Sa=Ec('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Cw.K=olympe.D.J.F;m.Ow.K=olympe.D.J.G;m.Mt.K=olympe.D.J.F;m.Tw.K=olympe.D.J.F;m.ow.K=olympe.D.J.F;m.Pw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.ex.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.File=class extends olympe.dc.CloudObject{constructor(a,b,c,d,e){super(a,b);this.F=c;this.G=d;this.C=e}fn(){return this.Gb(olympe.dm.File.mimeTypeProp)}Rk(a,b){const c=olympe.D.Ja().C(a),d=b&&olympe.D.Ja().C(b);(a=this.db.fb(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{this.C.G(e,c)},d):vc(this.F,this,e=>{this.C.G(e,c)},e=>{d&&d(e)})}bn(a,b){this.Rk(c=>{a(Da(c))},b)}Sk(a,b){const c=olympe.D.Ja().C(a);b=b&&olympe.D.Ja().C(b);const d=this.db.fb(this,olympe.dm.File.C),
732
- e=this.db.fb(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.fb(this,olympe.dm.File.mimeTypeProp);this.C.G(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?vc(this.F,this,f.bind(this),b):e&&e.startsWith('blob:')?this.C.F(e,f.bind(this),b):a(e)}rename(a,b){const c=b&&olympe.D.Ja().C(b);olympe.D.gs([a],d=>{const e=new olympe.dc.Transaction;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.nameProp,d);e.hb(f=>{c&&c(f)})})}py(){this.G.L(this.db.fb(this,olympe.dm.File.mimeTypeProp))}Rl(){return this.Gb(olympe.dm.File.urlProp)}Bp(){return this.Gb(olympe.dm.File.nameProp)}rw(){return this.jj(olympe.dm.File.creationDateProp)}Nw(){return this.jj(olympe.dm.File.modificationDateProp)}$r(){return this.Bg(olympe.dm.File.C)}static Nv(a,
733
- b,c,d,e,f){d=d||'application/data';c=olympe.W.ai().L(new Blob([c],{type:d}));return olympe.dm.File.Jr(a,b,c,d,e,f)}static Jr(a,b,c,d,e,f){const g=olympe.D.jb.now();b=(new Map).set(olympe.dm.File.nameProp,b||'file').set(olympe.dm.File.urlProp,c).set(olympe.dm.File.creationDateProp,g).set(olympe.dm.File.modificationDateProp,g).set(olympe.dm.File.mimeTypeProp,d||'application/data').set(olympe.dm.File.C,!1);return a.create(olympe.dm.File,b,e||olympe.dc.Ga.jc,f)}};olympe.dm.File.createFromURL=olympe.dm.File.Jr;
734
- olympe.dm.File.createFromContent=olympe.dm.File.Nv;olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.py;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Sk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.bn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Rk;olympe.dm.File.O=olympe.dc.ya.C('ff021000000000000030',olympe.dm.File,olympe.dc.P.yi,olympe.net.P.xa,olympe.W.P.vh);olympe.dm.File.nameProp=olympe.dm.File.O.va('ff023000000000000050');
674
+ For more information, activate the database debug mode or call "dbMonitor.debug(${a})" from this console.`),b=new olympe.dc.CloudObject(void 0,a)):b=c.instantiate(a,b.C)}return b}static Tv(a,b,c=olympe.dc.Ga.kc){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.Oa();let e=null;const f=h=>{null===e&&(e=hh(b||this));return e.has(h)?e.get(h):null},g=new Map;a.forEach((h,k)=>{d.Eb(olympe.dc.wa(k))?
675
+ g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Transaction(!1);c=a.create(b||this,g,c);a.hb().catch(h=>olympe.ra.Xa('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${h}`));return this.get(c)}static Dv(){return this.get(this)}static Yk(a){return olympe.dc.gb.Yk(a)}static kd(){return olympe.dc.Oa().tb(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.ta.Property(a))}static ld(){const a=olympe.dc.Oa();return a.tb(this,olympe.dc.CloudObject.G).map(b=>new olympe.dc.ta.Relation(b)).concat(a.tb(this,
676
+ olympe.dc.CloudObject.U).map(b=>new olympe.dc.ta.Relation(b,olympe.dc.Aa.ORIGIN)))}static Mf(a){return olympe.dc.CloudObject.get(a)}static Lw(a){var b=gh(olympe.dc.Zr(),olympe.dc.wa(a));b=b&&b.C;return new olympe.dc.Ca(olympe.dc.wa(a),olympe.dc.CloudObject.instancesRel,b)}R(){return this.tag}name(){return this.db.name(this)}ma(){return this.Gb(olympe.dc.CloudObject.nameProp)}oh(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.gb.from(this)}Xf(){return this.db.Xf(this)}tx(){return this.db.version(this)}Mt(){return this.db.source(this)}Sr(){return olympe.D.Fa([this.ma()],
677
+ a=>olympe.D.Bb(a),olympe.D.Wa,'getDisplayName',olympe.D.Bb('('+this.toString()+')'))}Tb(){return this.model?this.model.R():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.xc?a.xc():a;return new rxjs.Observable(e=>{const f=this.db.fb(this.tag,b);c||null!==f||e.next(f);const g=Ad(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.zc(()=>{e.complete();this.db.F(this.tag,b,g)});return()=>this.db.F(this.tag,b,g)})}yn(a){const b='function'===typeof a.xc?a.xc():a;
678
+ return new rxjs.Observable(c=>{const d=Bd(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.ta.Property(e),null]):c.next([new olympe.dc.ta.Property(e),f])});b.zc(()=>{c.complete();Cd(this.db,this.tag,d)});return()=>Cd(this.db,this.tag,d)})}ey(a){return this.observe(olympe.D.Ja(),a)}get(a){return this.db.fb(this.tag,a,!0)}fb(a){return this.get(a)}sb(a){return olympe.dc.gb.from(this).sb(a)}iw(a){return olympe.dc.od.from(this).sb(a)}tw(){return this.rc(olympe.dc.CloudObject.Lb,olympe.dc.CloudObject)}cn(){return this.tb(olympe.dc.CloudObject.containsRel,
679
+ olympe.dc.CloudObject)}Pf(a,b,c){const d=olympe.D.Uc(c,'Sync valueType'),e=Ad(this.db,this.tag,a,olympe.D.Ja().C(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.node.onDestroy(()=>this.db.F(this.tag,a,e));return d.node}Gb(a){return L(this.Pf(a,olympe.dc.W.Vb.Qm,olympe.D.Wa))}Ie(a){return L(this.Pf(a,olympe.dc.W.Vb.Pm,olympe.D.ea))}Cg(a){return L(this.Pf(a,olympe.dc.W.Vb.Nm,olympe.D.qa))}lj(a){return L(this.Pf(a,olympe.dc.W.Vb.Om,olympe.D.jb))}Xr(){return L(this.Pf(olympe.dm.Color.valueProp,
680
+ olympe.dc.W.Vb.Fr,olympe.D.Color))}Yr(){return L(this.Pf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.W.Vb.Gr,olympe.dc.CloudObject))}tb(a,b){a=a instanceof olympe.dc.X.Sb?a:new olympe.dc.X.Sb(a.R(),a.Pa());return new olympe.dc.Ca(this.R(),a,b)}rc(a,b){return this.tb(a,b).Sc()}Pr(a,b){const c=this.db,d=olympe.W.hc(),e=olympe.D.Ja(),f=new Map;V(c,this.tag,a,(g,h)=>{g?(g=new olympe.D.Xb(`forEachRelated: (${this.tag})-[:${a.R()}]-(${h})`,e),f.set(h,g),g.run(b,olympe.dc.CloudObject.get(h))):
681
+ f.has(h)&&(f.get(h).destroy(),f.delete(h))},d);e.zc(()=>{c.C(this.tag,a,d)})}Ly(){return new olympe.dc.Ca(this.R(),[],Jc(this.R()))}transform(...a){return(new olympe.dc.Ca(this.R(),[],this.constructor)).transform(...a)}Vc(){return this.Sr()}toString(){if(!this.db.Eb(this.tag))return`unknown object #${this.tag||'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){if(!this.db.Eb(this.tag))return{CloudObject:'Unknown tag'};
682
+ const a=this.db.model(this.tag),b=this.db.name(a),c=this.db.name(this.tag);return{CloudObject:this.tag,Name:c,Model:`${b} (${a})`}}vh(a=!1,b=!0){const c={};this.db.kd(this,b).forEach((d,e)=>{e=a?this.db.name(e):e;c[e]=d});return c}qb(a){return a instanceof olympe.dc.CloudObject?this.R()===a.R():!1}Td(a){return olympe.D.Fa([a],b=>olympe.D.Cc(this.qb(b)),olympe.D.qa)}Vv(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Transaction,c=!0;const d=olympe.dc.Aa.ORIGIN;for(const [e,f,g]of Ed(b,
683
+ this))f===d?a.fc(e,g,this):e!==olympe.dc.CloudObject.modelRel.R()&&a.fc(e,this,g);a.delete(this,olympe.dc.Ub.NONE);c&&a.hb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.qb;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.vh;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.iw;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.fb;
684
+ olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.ey;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.yn;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.Tb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Xf;
685
+ olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.oh;olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.R;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Lw;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Mf;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.ld;
686
+ olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.kd;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Yk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Dv;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Tv;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.O=olympe.dc.ya.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.bl=olympe.dc.CloudObject.O.va(olympe.dc.$b.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.va('ff023000000000000011');
687
+ z('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.Y=olympe.dc.CloudObject.O.va('ff023000000000000012');olympe.dc.CloudObject.G=olympe.dc.CloudObject.O.Ha('ff02200000000000000a');olympe.dc.CloudObject.U=olympe.dc.CloudObject.O.Ha('ff02200000000000000b',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.Ef=olympe.dc.CloudObject.O.Ha('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.be=olympe.dc.CloudObject.O.Ha('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.Ha('ff02200000000000000c');
688
+ z('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.Ha('ff02200000000000000d',olympe.dc.Aa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.Ha(olympe.dc.lc.Xc);z('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);z('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
689
+ olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.Ha(olympe.dc.lc.zi);z('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);z('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.Ha(olympe.dc.lc.jo);z('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
690
+ olympe.dc.CloudObject.Lb=P(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.oB=olympe.dc.CloudObject;olympe.dc.CloudObject.la=[olympe.dc.Ae];m=olympe.dc.CloudObject.prototype;m.R.K=new olympe.D.J(()=>String,[]);m.name.K=new olympe.D.J(()=>String,[]);m.ma.K=olympe.D.J.F;m.oh.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.tx.K=new olympe.D.J(()=>Number,[]);m.Mt.K=new olympe.D.J(()=>String,[]);m.Sr.K=olympe.D.J.F;m.Tb.K=new olympe.D.J(()=>String,[]);
691
+ m.tw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.cn.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Pf.K=new olympe.D.J(()=>olympe.D.Node,[]);m.Gb.K=olympe.D.J.F;m.Ie.K=olympe.D.J.G;m.Cg.K=olympe.D.J.U;m.lj.K=new olympe.D.J(()=>olympe.D.jb,[]);m.Xr.K=new olympe.D.J(()=>olympe.D.Color,[]);m.Yr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.tb.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.rc.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Pr.K=new olympe.D.J(()=>{},[]);
692
+ m.Ly.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.transform.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Vc.K=olympe.D.J.F;m.toString.K=olympe.D.J.C;m.qb.K=olympe.D.J.C;m.Td.K=olympe.D.J.U;m.Vv.K=new olympe.D.J(()=>{},[]);olympe.dc.hk=class{constructor(a){this.instance=a}R(){return this.instance.R()}nj(){return mb(this.instance.Cg(olympe.dc.CloudObject.Y))}Ew(){return this.instance.rc(olympe.dc.CloudObject.extendRel,olympe.dc.CloudObject)}Uk(){return this.instance.transform(new olympe.dc.X.Fc(olympe.dc.CloudObject.extendRel.R(),olympe.dc.Aa.DESTINATION,olympe.dc.X.tk.ht))}hn(){return this.instance.transform(new olympe.dc.X.Fc(olympe.dc.CloudObject.extendRel.R(),olympe.dc.Aa.DESTINATION,olympe.dc.X.tk.vp))}kd(){return this.hn().transform(olympe.dc.CloudObject.propertyRel,
693
+ new olympe.dc.X.xe)}Uw(){return this.instance.transform(olympe.dc.CloudObject.propertyRel)}ld(){return this.hn().transform(olympe.dc.CloudObject.G,new olympe.dc.X.xe)}Vw(){return this.instance.transform(olympe.dc.CloudObject.G)}static from(a){return olympe.D.Fa([a],b=>{const c=b.R(),d=olympe.dc.Oa();if(!d.oj(c))throw Error(`Instance "${d.name(c)}" (tag=${c}) is not a model.`);return new olympe.dc.hk(b)},olympe.dc.hk,'transformToModelInfo')}static nj(){return mb((void 0).Cg(olympe.dc.CloudObject.Y))}};
694
+ olympe.dc.hk.la=[olympe.dc.Ae];m=olympe.dc.hk.prototype;m.Ew.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Uk.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.hn.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.kd.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Uw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.ld.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Vw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dc.vA=class{};olympe.dc.da={};olympe.dc.da.zp=class{constructor(a){this.L=a}};olympe.dc.da.zp.hd={Ti:0,NA:1,OA:3,xA:4};olympe.dc.da.ak=class{};function Y(a){if(a.Y)throw Error('Cannot modify definition after definition is written');}
695
+ olympe.dc.da.Zb=class{constructor(a,b){a=this.C=a;if(a.C)throw b=a.C.ma(),a=a.C.R(),Error('Cannot work on a new definition without calling done on the previous one or popping it. '+`Make sure done() method has been called on previous definition ${b} (${a})`);if(void 0===this)throw Error('Current def cannot be set to undefined.');a.C=this;this.tag=b;this.F=new Map;this.aa=olympe.dc.CloudObject.O.R();this.Da=new Map;this.oa=new Map;this.Y=this.ha=!1;this.U=null}En(a){Y(this);this.aa=a;return this}Tb(){return this.aa}ki(a){Y(this);
696
+ this.U=a;return this}zy(){this.ha=!0;return this}yy(a){Y(this);const b=new Map;if('string'===typeof a){const c=olympe.dc.CloudObject.nameProp.R();b.set(c,a||'')}else Object.keys(a).forEach(c=>{b.set(c,a[c])});this.F=b;return this}li(a){Y(this);Object.keys(a).forEach(b=>{this.F.set(b,a[b])});return this}setProperty(a,b){Y(this);this.F.set(a,b);return this}hl(a){Y(this);const b=olympe.dc.CloudObject.nameProp.R();this.F.set(b,a);return this}Jm(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');
697
+ if(a===olympe.dc.CloudObject.containsRel.R())throw Error('Container must be defined using dedicated helpers setContainedIn');b&&this.Da.set(a+'.'+b,[a,b]);return this}Im(a,b){Y(this);if(!a)throw Error('Cannot relate an object to another without a relation tag');if(a===olympe.dc.CloudObject.containsRel.R())throw Error('Container must be defined using dedicated helper setContainedIn');b&&this.oa.set(a+'.'+b,[a,b]);return this}done(){if(this.Y)return this;const a=ih(this.C,this.ha);a.F(this.tag,this.F,
698
+ -1);jh(this.C,this);a.Ra(olympe.dc.lc.Xc,this.tag,this.aa,-1);this.U&&a.Ra(olympe.dc.lc.jo,this.U,this.tag,-1);this.G(-1);this.Da.forEach(b=>{a.Ra(b[0],this.tag,b[1],-1)});this.oa.forEach(b=>{a.Ra(b[0],b[1],this.tag,-1)});this.Y=!0;this.C.C=void 0;return this}G(){}R(){return this.tag}ma(){return this.F.get('ff023000000000000011')}};olympe.dc.da.Zb.prototype.getName=olympe.dc.da.Zb.prototype.ma;olympe.dc.da.Zb.prototype.getTag=olympe.dc.da.Zb.prototype.R;olympe.dc.da.Zb.prototype.done=olympe.dc.da.Zb.prototype.done;
699
+ olympe.dc.da.Zb.prototype.addRelationFrom=olympe.dc.da.Zb.prototype.Im;olympe.dc.da.Zb.prototype.addRelationTo=olympe.dc.da.Zb.prototype.Jm;olympe.dc.da.Zb.prototype.setName=olympe.dc.da.Zb.prototype.hl;olympe.dc.da.Zb.prototype.setProperty=olympe.dc.da.Zb.prototype.setProperty;olympe.dc.da.Zb.prototype.setProperties=olympe.dc.da.Zb.prototype.li;olympe.dc.da.Zb.prototype.setNameOrProperties=olympe.dc.da.Zb.prototype.yy;olympe.dc.da.Zb.prototype.setOptional=olympe.dc.da.Zb.prototype.zy;
700
+ olympe.dc.da.Zb.prototype.setContainedIn=olympe.dc.da.Zb.prototype.ki;olympe.dc.da.Zb.prototype.setModelTag=olympe.dc.da.Zb.prototype.En;olympe.dc.da.dd=class extends olympe.dc.da.Zb{constructor(a,b){super(a,b);this.Sa=this.C.OBJECT;this.Ya=new Map;this.ab=new Map}ns(a){Y(this);this.Sa=a;return this}extends(a){return this.ns(a)}Wi(){Y(this);this.setProperty(olympe.dc.CloudObject.Y.R(),!0);return this}defineProperty(a,b,c,d,e){Y(this);this.Ya.set(a,new olympe.dc.da.dd.Property(a,b,c,d));void 0!==d&&super.setProperty(olympe.dc.Vg.kc+a,d);void 0!==e&&(this.C.push(),this.C.Hg(this.C.Vk(a),olympe.sc.pc.O.R()).setProperty(olympe.sc.pc.C.R(),
701
+ e).ki(this.tag).Jm(olympe.sc.pc.F.R(),a).done(),this.C.pop());return this}jh(a,b,c,d,e,{$i:f=0,zj:g=0,jl:h=d,Zi:k=olympe.dm.Nc.NONE,wj:l=olympe.dm.Relation.N|k}={}){Y(this);b=new olympe.dc.da.dd.Relation(a,this.R(),b,c||'',d,e,g,h,f,l,k);this.ab.set(a,b);return this}G(a){super.G(a);ih(this.C).Ra(olympe.dc.CloudObject.extendRel.R(),this.tag,this.Sa,a);this.Ya.forEach(b=>{const c={[olympe.dc.CloudObject.nameProp.R()]:b.name||''},d=olympe.dc.wa(olympe.dm.Property),e=olympe.dc.CloudObject.propertyRel.R(),
702
+ f=b.tag;this.C.push();this.C.Hg(f,d).li(c).done();this.C.pop();b=b.type;ih(this.C).Ra(e,this.R(),f,a);ih(this.C).Ra(olympe.dm.Property.typeRel.R(),f,b,a)});this.ab.forEach(b=>{this.C.jh(b.C,b.G,b.F,b.name,b.Nr,b.Lr,{zj:b.zj,jl:b.jl,$i:b.$i,wj:b.wj,Zi:b.Zi},a)})}};olympe.dc.da.dd.prototype.defineRelation=olympe.dc.da.dd.prototype.jh;olympe.dc.da.dd.prototype.defineProperty=olympe.dc.da.dd.prototype.defineProperty;olympe.dc.da.dd.prototype['abstract']=olympe.dc.da.dd.prototype.Wi;
703
+ olympe.dc.da.dd.prototype['extends']=olympe.dc.da.dd.prototype.extends;olympe.dc.da.dd.prototype.setParentTag=olympe.dc.da.dd.prototype.ns;olympe.dc.da.dd.Property=class{constructor(a,b,c,d){this.tag=a;this.type=b;this.name=c||'';this.defaultValue=d}};olympe.dc.da.dd.Relation=class{constructor(a,b,c,d,e,f,g,h,k,l,n){this.C=a;this.G=b;this.F=c;this.name=d;this.Nr=e;this.Lr=f;this.zj=g;this.jl=h;this.$i=k;this.wj=l;this.Zi=n}};function ih(a,b){return b?a.Y:a.F}function jh(a,b){0<a.N.length&&(b.U||a.F.Ra(olympe.dc.CloudObject.containsRel.R(),a.N[a.N.length-1].R(),b.R(),-1))}
704
+ olympe.dc.da.Qa=class{constructor(a){if(a&&void 0===a.log)throw Error('Argument of OSaveFileBuilder is not a logger - might be a source, adapt implementing classes');this.F=new olympe.dc.transaction.vd(!0);this.Y=new olympe.dc.transaction.vd(!0);this.L=a||null;this.Da=!1;this.G=null;this.oa=new Map;this.aa=null;this.ha=Object.create(null);this.C=void 0;this.N=[];this.U=!0;this.js=/eval \(eval at process .*<anonymous>:(\d+):(\d+)\)/m;this.DEFAULT=olympe.dc.Vg.kc;this.OBJECT=olympe.dc.CloudObject.O.R();
705
+ this.PROPERTY=olympe.dm.Property.O.R();this.RELATION=olympe.dm.Relation.O.R();this.STRING=olympe.dm.String.O.R();this.BOOLEAN=olympe.dm.Boolean.O.R();this.NUMBER=olympe.dm.Number.O.R();this.DATETIME=olympe.dm.DateTime.O.R();this.COLOR=olympe.dm.Color.O.R();this.FILE=olympe.dm.File.O.R();this.ROLE=olympe.dm.ed.O.R();this.USER=olympe.dm.User.O.R();this.ONE_ONE=olympe.dm.Relation.F.ru;this.ONE_MANY=olympe.dm.Relation.F.cm;this.MANY_ONE=olympe.dm.Relation.F.ju;this.MANY_MANY=olympe.dm.Relation.F.Zl;this.NONE=
706
+ olympe.dm.Nc.NONE;this.DESTINATION_READ=olympe.dm.Nc.Ts;this.DESTINATION_CREATE=olympe.dm.Nc.Ao;this.DESTINATION_WRITE=olympe.dm.Nc.Us;this.DESTINATION_DELETE=olympe.dm.Nc.Qs;this.DESTINATION_LINK=olympe.dm.Nc.Ss;this.DESTINATION_FULL=olympe.dm.Nc.Rs;this.ORIGIN_READ=olympe.dm.Nc.vu;this.ORIGIN_CREATE=olympe.dm.Nc.su;this.ORIGIN_WRITE=olympe.dm.Nc.wu;this.ORIGIN_DELETE=olympe.dm.Nc.tu;this.ORIGIN_LINK=olympe.dm.Nc.hq;this.ORIGIN_FULL=olympe.dm.Nc.uu;this.FULL=olympe.dm.Nc.jt;this.DUMP_IGNORE=olympe.dm.Relation.C.Ol;
707
+ this.DUMP_REF=olympe.dm.Relation.C.Cq;this.DUMP_REVERSE_REF=olympe.dm.Relation.C.Ou;this.DUMP_UNILATERAL=olympe.dm.Relation.C.Dk;this.DUMP_REVERSE_UNILATERAL=olympe.dm.Relation.C.sk;this.DUMP_EVERYTHING=olympe.dm.Relation.C.Ho;this.DUMP_DEFAULT=olympe.dm.Relation.C.kc;this.DUMP_REV_DEFAULT=olympe.dm.Relation.C.Nu;this.DELETE_REF=this.DUMP_BOTH_REF=olympe.dm.Relation.C.sl;this.DELETE_REF_AND_DESTINATION=olympe.dm.Relation.C.Ku;this.DELETE_REF_AND_ORIGIN=olympe.dm.Relation.C.Lu;this.DELETE_EVERYTHING=
708
+ olympe.dm.Relation.C.Ho;this.OLYMPE_AUTHENTICATED_USERS=olympe.dm.ed.F}push(){this.N.push(this.C);this.C=void 0}pop(){if(this.C)throw Error('Cannot unstack definition: current definition not closed');this.C=this.N.pop()}fw(){const a=new Map,b=olympe.dc.da.Yu.C(this.aa,this.F,this.Y);for(const [c,d]of b.entries())a.set(c,d.vh());return a}ex(){return this.aa}xy(a){this.U=a}log(...a){this.U&&this.L&&this.L.log(...a)}tn(...a){this.U&&this.L&&this.L.debug(...a)}Fx(...a){this.U&&this.L&&this.L.warn(...a)}cl(...a){this.U&&
709
+ this.L&&this.L.error(...a)}Fv(a){if(a&&20===a.length&&!this.Da){if(this.ha[a])throw Error('Tag '+a+' is used to define more than one keyword');return this.ha[a]=a}this.G=null===this.G?olympe.W.fj():olympe.W.ax(this.G);this.log('Generating new tag to replace '+a+'. New tag is: '+this.G);return this.G}Vk(a){const b=this.oa.get(a)||1,c=olympe.W.Vk(a,b);this.oa.set(a,b+1);return c}Dy(a){this.Da=a}Xv(){}By(a){this.aa=a}Hg(a,b){return(new olympe.dc.da.Zb(this,a)).En(b)}Vx(a,b){return(new olympe.dc.da.dd(this,
710
+ a)).hl(b)}Ux(a,b){return(new olympe.dc.da.dd(this,a)).hl(b).Wi()}Wx(a){return new olympe.dc.da.yf(this,a)}el(a,b,c){this.F.Ra(a,b,c,-1)}defineProperty(a,b,c,d,e){this.tn('Defining property ',d,' on model ',a);d={[olympe.dc.CloudObject.nameProp.R()]:d||''};void 0!==e&&this.uc(a,{[olympe.dc.Vg.kc+c]:e});this.C?(this.push(),this.Hg(c,olympe.dm.Property.O.R()).li(d).done(),this.pop()):this.Hg(c,olympe.dm.Property.O.R()).li(d).ki(a).done();this.el(olympe.dc.CloudObject.propertyRel.R(),a,c);this.el(olympe.dm.Property.typeRel.R(),
711
+ c,b)}jh(a,b,c,d,e,f,{$i:g=olympe.dm.Relation.F.cm,zj:h=olympe.dm.Relation.C.Ol,jl:k=e,Zi:l=olympe.dm.Nc.NONE,wj:n=olympe.dm.Relation.N|l}={},p=-1){if(void 0===e||null===e)throw Error('Cannot define a relation without defining the dump follow rules (must be set to db.DUMP_<something> and cannot be undefined or null)');if(void 0===f||null===f)throw Error('Cannot define a relation without defining the delete follow rules (must be set to db.DELETE_<something> and cannot be undefined or null)');const q=
712
+ olympe.dm.Relation;d={[olympe.dc.CloudObject.nameProp.R()]:d||'',[q.Mm.R()]:g,[q.zn.R()]:n,[q.Wm.R()]:e,[q.Vm.R()]:f,[q.Cn.R()]:h,[q.Gn.R()]:k,[q.Cr.R()]:l};this.C?(this.push(),this.Hg(a,q.O.R()).li(d).done(),this.pop()):this.Hg(a,q.O.R()).li(d).ki(b).done();this.F.Ra(q.originModelRel.R(),b,a,p);this.F.Ra(q.destinationModelRel.R(),a,c,p)}Dx(a,b){this.F.Ra(olympe.dm.ed.C.R(),a,b,-1)}uc(a,b,c=!1){this.tn('Updating instance ',a);delete b[olympe.dc.$b.Jd];delete b[olympe.dc.$b.VERSION];const d=new Map;
713
+ Object.keys(b).forEach(e=>{d.set(e,b[e])});this.F.uc(a,d,c,-1)}assign(a,b,c){this.el(b,a,c)}Ev(a,b,c){this.Y.Ra(b,a,c,-1)}Sv(a){return new olympe.dc.Jc(a)}Nv(a,b,c,d){const e={c:7};e.r=a;e.g=b;e.b=c;e.a=d;return e}Ov({year:a=1970,month:b=1,day:c=1,hour:d=1,minute:e=0,second:f=0,cD:g=0,oD:h=0}={}){const k={c:4};k.y=a;k.M=b;k.d=c;k.h=d;k.m=e;k.s=f;k.S=g;k.z=h;return k}kw(a){a=new Date(Date.parse(a));const b={c:4};b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();b.h=a.getHours();b.m=a.getMinutes();
714
+ b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=-a.getTimezoneOffset();return b}Pv(a){a='number'===typeof a?new Date(a):a;const b={c:4};b.h=a.getHours();b.m=a.getMinutes();b.s=a.getSeconds();b.S=a.getMilliseconds();b.z=a.getTimezoneOffset();b.y=a.getFullYear();b.M=a.getMonth()+1;b.d=a.getDate();return b}ej(a,b,c){return olympe.auth.Jb.Fe.ej(a,c)}Qr(a,b){return olympe.auth.Jb.Fe.ej(a,b)}fc(){throw Error('DeleteRelation method on OSaveFile is deprecated');}Mc(){throw Error('DeleteInstance method on OSaveFile is deprecated');
715
+ }};olympe.dc.da.Qa.prototype.deleteInstance=olympe.dc.da.Qa.prototype.Mc;olympe.dc.da.Qa.prototype.deleteRelation=olympe.dc.da.Qa.prototype.fc;olympe.dc.da.Qa.prototype.generateAuthenticationData=olympe.dc.da.Qa.prototype.Qr;olympe.dc.da.Qa.prototype.generateAuthData=olympe.dc.da.Qa.prototype.ej;olympe.dc.da.Qa.prototype.createDateTimeLegacy=olympe.dc.da.Qa.prototype.Pv;olympe.dc.da.Qa.prototype.fromISODate=olympe.dc.da.Qa.prototype.kw;olympe.dc.da.Qa.prototype.createDateTime=olympe.dc.da.Qa.prototype.Ov;
716
+ olympe.dc.da.Qa.prototype.createColor=olympe.dc.da.Qa.prototype.Nv;olympe.dc.da.Qa.prototype.createReference=olympe.dc.da.Qa.prototype.Sv;olympe.dc.da.Qa.prototype.assignOptional=olympe.dc.da.Qa.prototype.Ev;olympe.dc.da.Qa.prototype.assign=olympe.dc.da.Qa.prototype.assign;olympe.dc.da.Qa.prototype.updateInstance=olympe.dc.da.Qa.prototype.uc;olympe.dc.da.Qa.prototype.linkRoleToUser=olympe.dc.da.Qa.prototype.Dx;olympe.dc.da.Qa.prototype.defineRelation=olympe.dc.da.Qa.prototype.jh;
717
+ olympe.dc.da.Qa.prototype.defineProperty=olympe.dc.da.Qa.prototype.defineProperty;olympe.dc.da.Qa.prototype.newRelation=olympe.dc.da.Qa.prototype.el;olympe.dc.da.Qa.prototype.newUser=olympe.dc.da.Qa.prototype.Wx;olympe.dc.da.Qa.prototype.newAbstractModel=olympe.dc.da.Qa.prototype.Ux;olympe.dc.da.Qa.prototype.newModel=olympe.dc.da.Qa.prototype.Vx;olympe.dc.da.Qa.prototype.newInstance=olympe.dc.da.Qa.prototype.Hg;olympe.dc.da.Qa.prototype.setRootInstanceTag=olympe.dc.da.Qa.prototype.By;
718
+ olympe.dc.da.Qa.prototype.disableChecks=olympe.dc.da.Qa.prototype.Xv;olympe.dc.da.Qa.prototype.setUseNewTags=olympe.dc.da.Qa.prototype.Dy;olympe.dc.da.Qa.prototype.assignTag=olympe.dc.da.Qa.prototype.Fv;olympe.dc.da.Qa.prototype.logError=olympe.dc.da.Qa.prototype.cl;olympe.dc.da.Qa.prototype.logWarn=olympe.dc.da.Qa.prototype.Fx;olympe.dc.da.Qa.prototype.logDebug=olympe.dc.da.Qa.prototype.tn;olympe.dc.da.Qa.prototype.log=olympe.dc.da.Qa.prototype.log;olympe.dc.da.Qa.prototype.setLoggingEnabled=olympe.dc.da.Qa.prototype.xy;
719
+ olympe.dc.da.Qa.prototype.getRootInstanceTag=olympe.dc.da.Qa.prototype.ex;olympe.dc.da.Qa.prototype.flushContents=olympe.dc.da.Qa.prototype.fw;olympe.dc.da.rg=class extends olympe.dc.da.dd{constructor(a,b,c){super(a,b);this.N=this.description=null;this.setProperty(olympe.dm.BrickMetadata.Ya.R(),olympe.dm.BrickMetadata.wb.yu);null!==c&&this.Br(c)}Br(a){this.ki(a);this.Im(olympe.dm.Qb.C.R(),a);return this}wy(a){this.F.set(olympe.dm.we.Sa.R(),a);return this}uy(a){Y(this);this.description=a;return this}Cy(a){Y(this);this.N=a;return this}G(a){super.G(a);if(null!==this.description||null!==this.N)this.C.push(),a=this.C.Hg(this.C.Vk(this.tag),olympe.sc.pc.O.R()),
720
+ this.description&&a.setProperty(olympe.sc.pc.C.R(),this.description),this.N&&a.setProperty(olympe.sc.pc.N.R(),this.N),a.ki(this.tag).Jm(olympe.sc.pc.F.R(),this.tag).done(),this.C.pop()}};olympe.dc.da.rg.prototype.setSummary=olympe.dc.da.rg.prototype.Cy;olympe.dc.da.rg.prototype.setDescription=olympe.dc.da.rg.prototype.uy;olympe.dc.da.rg.prototype.setIcon=olympe.dc.da.rg.prototype.wy;olympe.dc.da.rg.prototype.addToFolder=olympe.dc.da.rg.prototype.Br;olympe.dc.da.Yu=class a{constructor(b,c,d){this.F=b;this.ua=c||[];this.C=d||[]}static C(b,c,d){if(c instanceof olympe.dc.transaction.vd&&d instanceof olympe.dc.transaction.vd){c=ce(c);var e=ce(d)}else e=new olympe.dc.transaction.vd(!0),c.Qc(e),c=ce(e),d.Qc(e),e=ce(e);d=new Map;var f=new a(b,c.xg,e.xg);f.Tf()||d.set('delRel',f);f=new a(b,c.Te,e.Te);f.Tf()||d.set('detInst',f);f=new a(b,c.Ig,e.Ig);f.Tf()||d.set('newInst',f);f=new a(b,c.$f,e.$f);f.Tf()||d.set('updateInst',f);b=new a(b,c.Jg,e.Jg);b.Tf()||
721
+ d.set('newRel',b);return d}Tf(){return 0===this.ua.length+this.C.length}static wn(b){const c=Object.create(null),d=[],e=[];b.forEach(f=>{0===Object.keys(c).length&&(c.rootTag=f.rootTag);d.push(...(f.operations||[]));e.push(...(f.optionalOperations||[]))});0!==d.length&&(c.operations=d);0!==e.length&&(c.optionalOperations=e);return c}vh(){const b=(d,e)=>{var f=d.o,g=e.o;return f!==g?f<g?-1:1:1===f||2===f||3===f?(f=d.t,g=e.t,f===g?(d=Object.keys(d.p)[0],e=Object.keys(e.p)[0],void 0!==d?d.localeCompare(e):
722
+ 1):f.localeCompare(g)):4===f||5===f?(f=d.l,g=e.l,f===g?(f=d.m,g=e.m,f===g?d.r.localeCompare(e.r):f.localeCompare(g)):f.localeCompare(g)):JSON.stringify(f).localeCompare(JSON.stringify(g))},c=Object.create(null);this.ua.sort(b);this.C.sort(b);c.rootTag=this.F;c.operations=this.ua;c.optionalOperations=this.C;return c}};olympe.dc.da.yf=class extends olympe.dc.da.Zb{constructor(a,b){super(a,b);this.password=this.N=null;this.En(olympe.dc.wa(olympe.dm.User))}Ey(a){Y(this);this.N=a;return this}Fn(a){Y(this);this.password=a;return this}vy(){return this}Gv(a){Y(this);this.Im(olympe.dm.User.C.R(),a);return this}G(a){super.G(a);if(null==this.N||''===this.N)throw Error('A username must be set when calling new User');if(null==this.password||''===this.password)throw Error('A password must be set when calling new User');const b=
723
+ this.C.Qr(this.N,this.password),c=new Map;c.set(olympe.dm.User.loginProp.R(),b.login);c.set(olympe.dm.User.saltProp.R(),b.salt);c.set(olympe.dm.User.verifierProp.R(),b.verifier);ih(this.C).uc(this.R(),c,!1,a)}};olympe.dc.da.yf.prototype.awardRole=olympe.dc.da.yf.prototype.Gv;olympe.dc.da.yf.prototype.setDomain=olympe.dc.da.yf.prototype.vy;olympe.dc.da.yf.prototype.setPassword=olympe.dc.da.yf.prototype.Fn;olympe.dc.da.yf.prototype.setUsername=olympe.dc.da.yf.prototype.Ey;olympe.dc.da.P={At:'dc.io.IOService',Ch:'dc.io.IOUrlsProvider'};olympe.T.config(function(a){sa(a,olympe.dc.da.P.Ch);C(a,olympe.dc.da.P.At,[olympe.ra.P.xa,olympe.net.P.xa,olympe.auth.P.xa,olympe.dc.da.P.Ch],b=>new olympe.dc.da.zp(b.Rc('dc.io')))},'olympe.dc.io');olympe.dc.da.bD=function(a,b,c=!1){if(a.startsWith('@')||a.startsWith('v'))return!1;a.startsWith(olympe.dc.Vg.kc)&&(a=a.substring(1));const d=olympe.dc.Oa();return b?c?Gd(d,a,b):Gd(d,a,d.model(b)):d.Eb(a)};olympe.dm={};olympe.dm.Nc={NONE:0,Ts:1,Ao:2,Us:4,Qs:8,Ss:16,Rs:31,vu:32,su:64,wu:128,tu:256,hq:512,uu:992,jt:1023};olympe.dm.ed=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}ma(){return this.Gb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Wa.EMPTY}F(){return olympe.D.qa.C}};olympe.dm.ed.O=olympe.dc.ya.C('ff021000000000000002',olympe.dm.ed);olympe.dm.ed.ha=olympe.dm.ed.O.va('ff023000000000000035');olympe.dm.ed.C=olympe.dm.ed.O.Ha('ff022000000000000005');olympe.dm.ed.F=Ic('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.ed.aa=Ic('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
724
+ olympe.dm.ed.N=Ic('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.ed.prototype.ma.K=olympe.D.J.F;olympe.dm.ed.prototype.C.K=olympe.D.J.F;olympe.dm.ed.prototype.F.K=olympe.D.J.U;olympe.dm.User=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Hw(){return this.en()}ma(){return this.en()}en(){return this.Gb(olympe.dm.User.loginProp)}Ot(){return this.Gb(olympe.dm.User.F)}Nt(){return olympe.D.Wa.EMPTY}hx(){return this.Gb(olympe.dm.User.saltProp)}sx(){return this.Gb(olympe.dm.User.verifierProp)}bx(){return this.tb(olympe.dm.User.C,olympe.dm.ed)}};olympe.dm.User.O=olympe.dc.ya.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.va('ff023000000000000001');
725
+ z('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.O.va('ff023000000000000002');olympe.dm.User.ha=olympe.dm.User.O.va('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.O.va('ff023000000000000004');z('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.va('ff023000000000000005');z('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.aa=olympe.dm.User.O.va('ff023000000000000020');
726
+ olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.va('ff023000000000000036');z('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.C=P(olympe.dm.User.O,olympe.dm.ed.C);olympe.dm.User.oa=olympe.dm.User.O.Ha('ff022000000000000002');olympe.dm.User.N=Ic('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Hw.K=olympe.D.J.F;m.ma.K=olympe.D.J.F;m.en.K=olympe.D.J.F;m.Ot.K=olympe.D.J.F;m.Nt.K=olympe.D.J.F;m.hx.K=olympe.D.J.F;m.sx.K=olympe.D.J.F;
727
+ m.bx.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.we=class extends olympe.dc.CloudObject{ha(){return this.cn()}wb(){return this.Gb(olympe.dm.we.Sa)}};olympe.dm.we.O=olympe.dc.ya.C('01621fb84e3300000000',olympe.dm.we);olympe.dm.we.Sa=olympe.dm.we.O.va('01609de3f292e3c2c6ff');olympe.dm.we.prototype.ha.K=new olympe.D.J(()=>olympe.D.pd,[]);olympe.dm.we.prototype.wb.K=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.we{Ib(){return this.Gb(olympe.dm.BrickMetadata.Ya)}Rd(){return this.Gb(olympe.dm.BrickMetadata.ab)}C(){return null}};olympe.dm.BrickMetadata.O=Mc(olympe.dc.ya.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.Ya=olympe.dm.BrickMetadata.O.va('01621fb84e320000f001');olympe.dm.BrickMetadata.ab=olympe.dm.BrickMetadata.O.va('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Sf=olympe.dm.BrickMetadata.O.Ha('0161ae97622bb21f335b');
728
+ olympe.dm.BrickMetadata.wb={GA:'private',yu:'public'};olympe.dm.BrickMetadata.ad=Ic('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.hd={wz:'experimental',RA:'stable',nz:'deprecated'};olympe.dm.BrickMetadata.prototype.Ib.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.Rd.K=olympe.D.J.F;olympe.dm.BrickMetadata.prototype.C.K=new olympe.D.J(()=>String,[]);olympe.dm.Qb=class extends olympe.dm.BrickMetadata{U(){return new olympe.dc.Ca(this.R(),[new olympe.dc.X.Fc(olympe.dm.Qb.F.R(),olympe.dc.Aa.DESTINATION,olympe.dc.X.tk.vp,olympe.dc.X.tk.ut),olympe.dm.Qb.C])}C(){return null}F(){return this.tb(olympe.dm.Qb.F,olympe.dm.Qb)}Y(){return this.tb(olympe.dm.Qb.C)}};olympe.dm.Qb.O=olympe.dc.ya.C('01612df1db9749227626',olympe.dm.Qb);olympe.dm.Qb.F=olympe.dm.Qb.O.Ha('016a697ef00ce7554691');olympe.dm.Qb.Ib=P(olympe.dm.Qb.O,olympe.dm.Qb.F);olympe.dm.Qb.C=olympe.dm.Qb.O.Ha('016a697ef00ce7554692');
729
+ P(olympe.dc.CloudObject.O,olympe.dm.Qb.C);olympe.dm.Qb.prototype.U.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Qb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Qb.prototype.Y.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Zc=class extends olympe.dm.Qb{F(){return this.R()===olympe.dm.Zc.Da?this.tb(olympe.dm.Zc.aa,olympe.dm.Qb):this.tb(olympe.dm.Zc.ha,olympe.dm.Qb)}};olympe.dm.Zc.O=olympe.dc.ya.C('ff021000000000000020',olympe.dm.Zc);olympe.dm.Zc.ha=olympe.dm.Zc.O.Ha('017e9c34cf48bd6965c1');olympe.dm.Zc.aa=olympe.dm.Zc.O.Ha('017e9c2e013e06bfffd9');olympe.dm.Zc.Ye=olympe.dm.Zc.O.Ha('01811f12ad77673770d4');olympe.dm.Zc.Da=Ic('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Zc.Lc=Ic('10000000000000000001','OLYMPE_FOLDER');
730
+ olympe.dm.Zc.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Fw(){return this.Gb(olympe.dm.Module.ha)}Rw(){return this.Ie(olympe.dm.Module.oa)}Pt(){return this.Gb(olympe.dm.Module.F)}Ww(){return this.Gb(olympe.dm.Module.Da)}rw(){return this.Gb(olympe.dm.Module.N)}Sw(){return this.tb(olympe.dm.Module.aa,olympe.dm.Module)}ix(){return this.tb(olympe.dm.Module.C,olympe.dm.Fd)}};olympe.dm.Module.O=olympe.dc.ya.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.ha=olympe.dm.Module.O.va('ff023000000000000042');
731
+ olympe.dm.Module.oa=olympe.dm.Module.O.va('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.O.va('ff023000000000000044');olympe.dm.Module.Da=olympe.dm.Module.O.va('ff023000000000000045');olympe.dm.Module.N=olympe.dm.Module.O.va('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.va('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.O.Ha('ff022000000000000013');olympe.dm.Module.aa=olympe.dm.Module.O.Ha('ff022000000000000014');
732
+ olympe.dm.Module.Sa=Ic('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Fw.K=olympe.D.J.F;m.Rw.K=olympe.D.J.G;m.Pt.K=olympe.D.J.F;m.Ww.K=olympe.D.J.F;m.rw.K=olympe.D.J.F;m.Sw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.ix.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.File=class extends olympe.dc.CloudObject{constructor(a,b,c,d,e){super(a,b);this.F=c;this.G=d;this.C=e}fn(){return this.Gb(olympe.dm.File.mimeTypeProp)}Sk(a,b){const c=olympe.D.Ja().C(a),d=b&&olympe.D.Ja().C(b);(a=this.db.fb(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{this.C.G(e,c)},d):zc(this.F,this,e=>{this.C.G(e,c)},e=>{d&&d(e)})}bn(a,b){this.Sk(c=>{a(Da(c))},b)}Tk(a,b){const c=olympe.D.Ja().C(a);b=b&&olympe.D.Ja().C(b);const d=this.db.fb(this,olympe.dm.File.C),
733
+ e=this.db.fb(this,olympe.dm.File.urlProp),f=g=>{const h=this.db.fb(this,olympe.dm.File.mimeTypeProp);this.C.G(g,k=>{c(`data:${h};base64,${this.C.C(k)}`)})};d&&d.valueOf()?zc(this.F,this,f.bind(this),b):e&&e.startsWith('blob:')?this.C.F(e,f.bind(this),b):a(e)}rename(a,b){const c=b&&olympe.D.Ja().C(b);olympe.D.hs([a],d=>{const e=new olympe.dc.Transaction;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.nameProp,d);e.hb(f=>{c&&c(f)})})}ty(){this.G.N(this.db.fb(this,olympe.dm.File.mimeTypeProp))}Sl(){return this.Gb(olympe.dm.File.urlProp)}Bp(){return this.Gb(olympe.dm.File.nameProp)}uw(){return this.lj(olympe.dm.File.creationDateProp)}Qw(){return this.lj(olympe.dm.File.modificationDateProp)}bs(){return this.Cg(olympe.dm.File.C)}static Qv(a,
734
+ b,c,d,e,f){d=d||'application/data';c=olympe.W.ci().N(new Blob([c],{type:d}));return olympe.dm.File.Kr(a,b,c,d,e,f)}static Kr(a,b,c,d,e,f){const g=olympe.D.jb.now();b=(new Map).set(olympe.dm.File.nameProp,b||'file').set(olympe.dm.File.urlProp,c).set(olympe.dm.File.creationDateProp,g).set(olympe.dm.File.modificationDateProp,g).set(olympe.dm.File.mimeTypeProp,d||'application/data').set(olympe.dm.File.C,!1);return a.create(olympe.dm.File,b,e||olympe.dc.Ga.kc,f)}};olympe.dm.File.createFromURL=olympe.dm.File.Kr;
735
+ olympe.dm.File.createFromContent=olympe.dm.File.Qv;olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.ty;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Tk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.bn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Sk;olympe.dm.File.O=olympe.dc.ya.C('ff021000000000000030',olympe.dm.File,olympe.dc.P.Ai,olympe.net.P.xa,olympe.W.P.wh);olympe.dm.File.nameProp=olympe.dm.File.O.va('ff023000000000000050');
735
736
  z('olympe.dm.File.nameProp',olympe.dm.File.nameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.va('ff023000000000000051');z('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.va('ff023000000000000055');z('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.va('ff023000000000000052');z('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);
736
- olympe.dm.File.urlProp=olympe.dm.File.O.va('ff023000000000000053');z('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.O.va('ff023000000000000054');olympe.dm.File.la=[olympe.D.File];m=olympe.dm.File.prototype;m.fn.K=olympe.D.J.F;m.Rk.K=new olympe.D.J(()=>{},[]);m.bn.K=new olympe.D.J(()=>{},[]);m.Sk.K=new olympe.D.J(()=>{},[]);m.rename.K=olympe.D.J.C;m.Rl.K=olympe.D.J.F;m.Bp.K=olympe.D.J.F;m.rw.K=new olympe.D.J(()=>olympe.D.jb,[]);
737
- m.Nw.K=new olympe.D.J(()=>olympe.D.jb,[]);m.$r.K=olympe.D.J.U;olympe.dm.Fd=class extends olympe.dc.CloudObject{C(){return this.Gb(olympe.dm.Fd.F)}G(){return this.He(olympe.dm.Fd.L)}F(){return this.tb(olympe.dm.Fd.C,olympe.dm.Module)}};olympe.dm.Fd.O=olympe.dc.ya.C('ff021000000000000041',olympe.dm.Fd);olympe.dm.Fd.F=olympe.dm.Fd.O.va('ff023000000000000047');olympe.dm.Fd.L=olympe.dm.Fd.O.va('ff023000000000000048');olympe.dm.Fd.C=olympe.dm.Module.C.Gc();olympe.dm.Fd.prototype.C.K=olympe.D.J.F;olympe.dm.Fd.prototype.G.K=olympe.D.J.G;
738
- olympe.dm.Fd.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Nb=class extends olympe.dm.Zc{F(){return this.tb(olympe.dm.Qb.F,olympe.dm.Qb)}L(){return this.Gb(olympe.dm.Nb.oa)}aa(){return this.Gb(olympe.dm.Nb.wc)}G(){return this.tb(olympe.dm.Nb.L,olympe.dm.Nb)}};olympe.dm.Nb.O=olympe.dc.ya.C('0163d9594700fcf61e54',olympe.dm.Nb);olympe.dm.Nb.oa=olympe.dm.Nb.O.va('017869c7d2833c9492c1');olympe.dm.Nb.wc=olympe.dm.Nb.O.va('017869c80bb9929c76d0');olympe.dm.Nb.L=olympe.dm.Nb.O.Ha('ff02200000000000002b');olympe.dm.Nb.Ue=P(olympe.dm.Nb.O,olympe.dm.Nb.L);
739
- olympe.dm.Nb.ac=olympe.dm.Nb.O.Ha('ff02200000000000002a');olympe.dm.Nb.Ge=olympe.dm.Nb.O.Ha('017e9c412e2b944bd590');olympe.dm.Nb.gi=olympe.dm.Nb.O.Ha('017e9c416872a89d3415');olympe.dm.Nb.sh=olympe.dm.Nb.O.Ha('017ebf8fe5c506662098');P(olympe.dc.CloudObject.O,olympe.dm.Nb.ac);olympe.dm.Nb.yd=Ec('100000000000000000dd','PRIMORDIAL');olympe.dm.Nb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Nb.prototype.L.K=olympe.D.J.F;olympe.dm.Nb.prototype.aa.K=olympe.D.J.F;
740
- olympe.dm.Nb.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{F(){return this.qc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}C(){return this.qc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}Vc(){return this.F().ma().Hr(this.ma())}};olympe.dm.Property.O=olympe.dc.ya.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=P(olympe.dm.Property.O,olympe.dc.CloudObject.propertyRel);z('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);
741
- olympe.dm.Property.typeRel=P(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);z('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Kw(){return olympe.D.Wa.EMPTY}mw(){return this.He(olympe.dm.Relation.Mm)}Uw(){return this.He(olympe.dm.Relation.zn)}Qr(){return this.tb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Sc()}Vr(){return this.tb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Sc()}Vc(){return this.Vr().ma().concat(['-',this.ma(),'->',this.Qr().ma()])}};olympe.dm.Relation.O=olympe.dc.ya.C('ff021000000000000006',olympe.dm.Relation);
742
- olympe.dm.Relation.zn=olympe.dm.Relation.O.va('ff023000000000000030');olympe.dm.Relation.Mm=olympe.dm.Relation.O.va('ff023000000000000034');olympe.dm.Relation.Wm=olympe.dm.Relation.O.va('ff023000000000000037');olympe.dm.Relation.Vm=olympe.dm.Relation.O.va('ff023000000000000137');olympe.dm.Relation.Cn=olympe.dm.Relation.O.va('ff023000000000000237');olympe.dm.Relation.Gn=olympe.dm.Relation.O.va('ff023000000000000337');olympe.dm.Relation.Br=olympe.dm.Relation.O.va('ff023000000000000031');
743
- olympe.dm.Relation.originModelRel=P(olympe.dm.Relation.O,olympe.dc.CloudObject.G);z('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=P(olympe.dm.Relation.O,olympe.dc.CloudObject.U);z('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dc.Ub={NONE:null,oz:olympe.dm.Relation.Wm.R(),Hc:olympe.dm.Relation.Vm.R(),tf:olympe.dm.Relation.Cn.R(),PA:olympe.dm.Relation.Gn.R()};
744
- olympe.dc.Ub.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Ub))if(c===a)return b;return null};olympe.dm.Relation.C={Nl:0,rl:5,Bq:1,Lu:4,Ck:2,rk:8,Ho:10,Hu:6,Iu:9,jc:6,Ku:9};olympe.dm.Relation.F={ou:3,cm:4,gu:5,Yl:6};olympe.dm.Relation.L=olympe.dm.Nc.hq+olympe.dm.Nc.Ao;m=olympe.dm.Relation.prototype;m.Kw.K=olympe.D.J.F;m.mw.K=olympe.D.J.G;m.Uw.K=olympe.D.J.G;m.Qr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Vr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.rf=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.rf.O=olympe.dc.ya.C('ff021000000000000019',olympe.dm.rf);olympe.dm.String=class extends olympe.dm.rf{getValue(){return this.Gb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.O=olympe.dc.ya.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.O.va('ff023000000000000026');z('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.D.J.F;olympe.dm.String.prototype.toString.K=olympe.D.J.C;olympe.dm.Boolean=class extends olympe.dm.rf{getValue(){return this.Bg(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.ya.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.va('ff023000000000000027');z('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.D.J.U;olympe.dm.Color=class extends olympe.dm.rf{getValue(){return this.Wr()}};olympe.dm.Color.O=olympe.dc.ya.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.va('ff023000000000000032');z('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.D.J(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.rf{getValue(){return this.jj(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.ya.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.va('ff023000000000000029');z('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.D.J(()=>olympe.D.jb,[]);olympe.dm.Enum=class extends olympe.dm.String{ma(){return olympe.D.Fa([super.ma(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Wa)}fe(){return this.He(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.Oa();e=void 0!==e?e:f.Eb(b)&&f.ee(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.dm.Enum.create=olympe.dm.Enum.create;
745
- olympe.dm.Enum.O=olympe.dc.ya.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.va('017a7690c915975ea995');olympe.dm.Enum.prototype.fe.K=olympe.D.J.G;olympe.dm.hg=class extends olympe.dm.BrickMetadata{nx(){return this.sb(olympe.dc.CloudObject.instancesRel).jl(olympe.dm.Enum.rankProp,olympe.dc.ba.lk.ASC).jd()}static create(a,b){b=a.create(olympe.dm.hg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ra(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.hg.create=olympe.dm.hg.create;olympe.dm.hg.prototype.getValues=olympe.dm.hg.prototype.nx;olympe.dm.hg.O=olympe.dc.ya.C('017a768f966fc08ebb98',olympe.dm.hg);olympe.dm.Number=class extends olympe.dm.rf{getValue(){return this.He(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.ya.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.va('ff023000000000000028');z('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.D.J.G;olympe.Za={};olympe.Za.bh=class{constructor(a){this.N=a;this.Y=new olympe.D.Xb(`${this.Z()} source context`);this.U=this.C=null}Z(){}L(){}close(){this.U&&this.U(this.Z(),olympe.dc.xk.vt);this.Y.destroy()}};function gh(a){olympe.D.Ec([kc(a.oa)],b=>{if(b.valueOf()){const c=a.G.keys();hh(a,d=>{if(d)a.N.error('An error occurred while auto synchronising:\n'+d.message);else if(a.N.debug('Auto synchronise transactions successfully'),a.aa)for(const e of c)$b(a.F,f=>{a.N.error(`Could not clear transactions for ${e}: ${f}.`)})})}})}
746
- function ih(a){let b;olympe.D.Ec([kc(a.oa)],c=>{c.valueOf()?(a.aa=!1,b&&(Jb(b),b=null)):(a.aa=!0,b=Ib(()=>{if(a.ja){a.ja=!1;for(const d of a.G.keys())Yb(a.F,d,a.G.get(d),()=>{},e=>{a.N.error(`Could persist transaction for ${d}: ${e}`)})}},5E3))})}
747
- function hh(a,b){const c=olympe.async.wk.create(),d=c.G;c.add((e,f)=>{a.F.storage.L(f)});c.add((e,f,g)=>{const h=olympe.dc.Ga.rb,k=g.get('files'),l=new olympe.async.ng(d);a.G.forEach((n,p)=>{if(p!==h){const q=a.Da.U(p);null!==q?(l.add(a.Sa.bind(a,n,q,k)),a.F.storage.C()):f(`The source: ${p} is not reachable.`)}});Vb(l,(n,p)=>{n?e():f(p||void 0)});l.start()});Vb(c,(e,f)=>{b(e?null:Error(f));e&&(a.ja=!1,a.G.clear())});c.start()}
748
- function jh(a,b){const c=new olympe.async.wk(olympe.D.Ja());c.add((d,e)=>{Zb(a.F,f=>null===f?d():e(f))});c.add(d=>{const e=olympe.dc.Ad();a.G.forEach((f,g)=>{const h=Array.from(f.ee()).map(k=>k.tag());Jc(e,olympe.D.Ja(),f,h,[],g)(!0)});d()});Vb(c,(d,e)=>{b(e?Error(e):null)});c.start()}
749
- olympe.Za.Hi=class extends olympe.Za.bh{constructor(a,b,c,d,e){super(a);this.G=new Map;this.oa=c;this.F=d;this.Da=b;this.ja=this.aa=!1;e.get('syncTimeout');e.get('autoSync')&&gh(this);e.get('autoPersist')&&ih(this)}Sa(a,b,c,d,e){const f=olympe.dc.ga.ka.Bk,g=olympe.dc.ga.ka.yl,h=new olympe.dc.db.Ac,k=new olympe.async.ng(olympe.D.Ja()),l=(n,p,q)=>{const r=n.tag(),t=n.fb(olympe.dm.File.mimeTypeProp.R());bc(this.F,u=>{sc(olympe.dc.Dw(),r,u,t,v=>{n.va(olympe.dm.File.urlProp.R(),v);const w=new Map;w.set(olympe.dm.File.urlProp.R(),
750
- v);h.tc(r,w);this.F.storage.C(q)})})};for(const n of c)(c=a.Lf(n))&&c.re()&&k.add(l.bind(this,c));Vb(k,(n,p)=>{n?(n=M(new olympe.dc.ga(f,a,[b.Z()]),q=>{q?e(q.message):(this.C(b.Z(),g,h),q=Array.from(a.ee()).map(r=>r.tag()),olympe.dc.Ad().persist(q),d())}),b.L(n)):e(`Transaction synchronisation failed! ${p?p:''}`)});k.start()}Z(){return olympe.dc.Ga.rb}L(a){var b=olympe.dc.ga.ka.eh,c=olympe.dc.ga.ka.wh;const d=olympe.dc.ga.ka.Ai,e=olympe.dc.ga.ka.zi,f=olympe.dc.ga.ka.Sg,g=olympe.dc.ga.ka.Hl,h=olympe.dc.ga.ka.Qh,
751
- k=olympe.dc.ga.ka.wi,l=olympe.dc.ga.ka.xh;var n=olympe.dc.ga.ka.Sj;const p=a.type;switch(p){case f:a.validate(null);this.F.storage.F();jh(this,v=>{null!==v&&this.N.error(`Could not load transactions: ${v.message}`)});break;case b:case c:const q=a.content;a.C.forEach(v=>{let w=this.G.get(v);void 0===w&&(w=new olympe.dc.db.Ac,this.G.set(v,w));q.Qc(w);this.aa&&(this.ja=!0)});a.validate(null);a=olympe.dc.transaction.rg.C.Xp;this.C(olympe.dc.Ga.rb,n,{id:q.Z(),finalize:a});break;case e:case d:const r=a.C[0],
752
- t=a.content;a.validate(null);Xb(this.F,t.Z(),v=>{this.N.warn('No graphresult for subscription : '+t.Z(),v,'\n',t.ph.toJSON());this.N.warn();this.C(r,g,new olympe.dc.query.Ci(t.Z(),r,olympe.dc.Ga.rb,new olympe.dc.db.Ac))});break;case h:case l:case k:n=a.content;b=n.file;const u=n.Ye;c=n.se;p===h?ac(this.F,b,n.content,n.mimeType,u,c):p===l?bc(this.F,v=>{u(v)}):this.F.storage.C(c);a.validate(null)}}};olympe.Za.Hi.C='context';const kh=olympe.dc.ga.ka.om,lh=olympe.dc.ga.ka.qm,mh=olympe.dc.ga.ka.QUERY_RESULT,nh=olympe.dc.ga.ka.pm,oh=olympe.dc.ga.ka.eh,ph=olympe.dc.ga.ka.Bk,qh=olympe.dc.ga.ka.Sj,rh=olympe.dc.ga.ka.wh,sh=olympe.dc.ga.ka.Ij,th=olympe.dc.ga.ka.sl,uh=olympe.dc.ga.ka.Qh,vh=olympe.dc.ga.ka.xh,wh=olympe.dc.ga.ka.wi,xh=olympe.dc.ga.ka.lg;
753
- function yh(a,b,c,d,e){const f=c.Z();c={t:kh,q:c.ia()};olympe.H.Ba.nb.zb.get(b,c).then(g=>{g.t===mh?(d(null),a.C(b,e||mh,{i:f,r:g.r,s:b})):d(Error(g.e))}).catch(g=>d(Error(g)))}function zh(a,b,c,d,e){const f=c.Z();yh(a,b,c,g=>{if(g)e(g);else{Ah(a,b,f);g={t:lh,q:c.ia()};var h=olympe.H.Ba.nb.zb.observe(b,d,g).subscribe(k=>{const l=k.t;l===nh?(e(null),a.C(b,l,{i:f,r:k.r,s:b})):e(Error(k.e))});d.zc(()=>h.unsubscribe())}},nh)}
754
- function Bh(a,b,c,d){const e=c.Dc;c=new olympe.dc.transaction.vd;e.Qc(c);c={t:oh,i:e.Z(),p:$d(c)};olympe.H.Ba.nb.zb.send(b,c).then(()=>{d(null);a.C(b,qh,{id:e.Z(),finalize:olympe.dc.transaction.rg.C.Wp})}).catch(f=>d(Error(f)))}function Ch(a,b,c,d,e){var f=c.Dc;c=f.Z();const g=new olympe.dc.transaction.vd;f.Qc(g);f={t:rh,i:c,p:$d(g)};olympe.H.Ba.nb.zb.publish(b,f).then(()=>e(null)).catch(h=>e(Error(h)));Dh(a,c,b,d)}
755
- function Ah(a,b,c){const d=()=>{const f=setInterval(()=>{0===a.F.size?clearInterval(f):a.F.forEach((g,h)=>{olympe.H.Ba.nb.zb.send(h,{t:xh,s:Array.from(g)}).catch(k=>a.N.warn(`Error occurred while keeping alive subscription list: ${k}`))})},a.aa)},e=a.F.get(b)||new Set;e.add(c);a.F.set(b,e);1===a.F.size&&d()}
756
- function Dh(a,b,c,d){const e=new olympe.H.Ba.nb.zb(b,d);e.listen().subscribe(f=>{f=f.body();if(f.t===sh){a.N.error(`Burst Transaction ${b} failed. Local rollback is not supported yet. Refresh the application`);const g=new olympe.dc.db.Ac;a.C(c,sh,{id:b,rollback:g,error:f.r})}});d.zc(()=>e.stop())}
757
- olympe.Za.zu=class extends olympe.Za.bh{constructor(a,b,c){super(a);this.F=new Map;this.G=b;this.aa=c}Z(){return olympe.dc.Ga.lq}L(a){const b=a.C[0],c=a.type,d=a.validate.bind(a),e=a.content;a=a.F;switch(c){case kh:yh(this,b,e,d);break;case lh:zh(this,b,e,a,d);break;case oh:case ph:Bh(this,b,e,d);break;case rh:Ch(this,b,e,a,d);break;case th:e.t=c;olympe.H.Ba.nb.zb.publish(b,e).then(d).catch(f=>d(Error(f)));break;case uh:case vh:case wh:olympe.H.Ba.nb.zb.get(b,{t:c,f:e.file}).then(f=>{this.G.ja(e.file,
758
- b,f);c===uh?this.G.Y(e.file,e.content,e.mimeType,e.Ye,e.se):c===vh?this.G.U(e.file,e.url,e.mimeType,e.Ye,e.se):this.G.L(e.file,e.Ye,e.se)}).catch(e.se);break;default:this.N.info(`Messages of type ${c} is not supported by the source ${this.Z()}`)}}};olympe.Za.Buffer=class{constructor(){this.counter=0;this.Ob=new Map}buffer(a){const b=this.counter++;this.Ob.set(b,a);return this.clear.bind(this,b)}clear(a){this.Ob.delete(a)}};olympe.Za.pg=class a{constructor(b,c,d){this.N=b;this.Y=c;this.ja=new olympe.Za.Buffer(this);this.L=new Map;this.G=this.Ib(d);new olympe.D.Xb('Data Router context');this.F=new Map;this.aa=new Map;this.Ya()}Ya(){this.N.info('Initializing DR layer');olympe.D.kn(kc(this.Y),()=>{this.N.info('Router: ONLINE')},()=>{this.N.log('Router: OFFLINE (no auth layer not online)');for(const b of this.ja.Ob.values())this.Da(b)});this.N.log('DONE initializing DR layer (waiting for AUTH layer session to be established)')}send(b){M(b,
759
- this.ja.buffer(b));this.Da(b)}C(b,c){const d=olympe.W.fc();let e=this.F.get(b);void 0===e&&(e=new Map,this.F.set(b,e));e.set(d,c)}oa(b){this.aa.set(olympe.W.yg(),b)}wb(b,c,d){this.F.has(c)&&this.F.get(c).forEach(e=>{e(b,d)})}Lb(b,c){this.L.set(b,c);c.C=this.wb.bind(this);c.U=this.Sa.bind(this)}U(b){return this.L.get(b)||this.L.get(olympe.dc.Ga.lq)}Sa(b,c){this.aa.forEach(d=>{d(b,c)})}Da(b){this.N.debug('Processing message',b.toString());this.ab(b).forEach(c=>{(c=this.U(c))&&c.L(b)})}ab(b){var c=olympe.dc.ga.ka.Sg,
760
- d=olympe.dc.ga.ka.zi,e=olympe.dc.ga.ka.Ai,f=olympe.dc.ga.ka.eh,g=olympe.dc.ga.ka.wh;const h=olympe.dc.ga.ka.Qh,k=olympe.dc.ga.ka.wi,l=olympe.dc.ga.ka.xh;switch(b.type){case c:d=this.G.get(a.C.Sg)||[];break;case d:case e:d=this.G.get(a.C.nm)||[];break;case f:case g:d=this.G.get(a.C.TRANSACTION)||[];break;case h:case l:case k:d=this.G.get(a.C.dt)||[];break;default:d=[]}c=b.content;e=olympe.auth.sa.C.Ng;f=olympe.auth.sa.C.Ah;g=jc(this.Y);e=!(g===e||g===f);for(var n of d)if(d=n,f=c&&c.Z&&c.Z(),g=d.get('type'),
761
- g===a.F.bm&&e||g===a.F.op&&d.get('id')===f||g===a.F.jc)return n=n.get('destinations'),this.N.debug('Message',b.toString(),'is redirect to',n),n;this.N.debug('Message',b.toString(),'not redirect');return b.C}Ib(b){const c=Object.values(olympe.Za.pg.C),d=Object.values(olympe.Za.pg.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const l=k.type;if(d.includes(l)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',
762
- l).set('destinations',n),h.push(n),l===a.F.op&&n.set('id',k.id)):this.N.error('Routing rule',f,l,'is not valid. Destinations must be stored in an array')}else this.N.error('Routing rule',f,l,'is not valid. Valid rules are',d.toString())})}else this.N.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.N.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}};olympe.Za.pg.C={Sg:'getContext',nm:'query',TRANSACTION:'transaction',dt:'file'};
763
- olympe.Za.pg.F={jc:'default',bm:'offline',op:'id'};olympe.Za.pg.la=[olympe.dc.pg];olympe.Za.Tj=class{ja(){}Y(){}U(){}L(){}};olympe.Za.P={xa:'dr.Manager',Ea:'dr.Logger',me:'dr.sources.Router',Ip:'dr.sources.Local',um:'dr.sources.Server',nq:'dr.sources.Peer',Rg:'dr.sources.FileSource'};olympe.Za.Config={Xl:'dr.keepAliveTimeout',Rn:'dr.autoSync',Qn:'dr.autoPersist',Vq:'dr.syncTimeout',Hq:'dr.routing'};
764
- olympe.T.config(function(a){D(a,olympe.Za.Config.Hq,{});D(a,olympe.Za.Config.Xl,3E5);D(a,olympe.Za.Config.Rn,!1);D(a,olympe.Za.Config.Qn,!1);D(a,olympe.Za.Config.Vq,3E4);C(a,olympe.Za.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dr'));C(a,olympe.Za.P.Ip,[olympe.Za.P.Ea,olympe.Za.P.me,olympe.auth.P.xa,olympe.ic.P.uo,new olympe.T.fa(olympe.Za.Config.Rn),new olympe.T.fa(olympe.Za.Config.Qn),new olympe.T.fa(olympe.Za.Config.Vq)],(b,c,d,e,f,g,h)=>{f=(new Map).set('autoSync',f).set('autoPersist',g).set('syncTimeout',
765
- h);return new olympe.Za.Hi(b,c,d,e,f)});sa(a,olympe.Za.P.um);A(a,olympe.Za.P.nq,olympe.Za.zu,olympe.Za.P.Ea,olympe.Za.P.Rg,new olympe.T.fa(olympe.Za.Config.Xl));sa(a,olympe.Za.P.Rg);A(a,olympe.Za.P.me,olympe.Za.pg,olympe.Za.P.Ea,olympe.auth.P.xa,new olympe.T.fa(olympe.Za.Config.Hq));ra(a,olympe.dc.P.me,olympe.Za.P.me);C(a,olympe.dc.query.Mb.dk,[olympe.dc.query.Mb.dk],b=>new olympe.dc.mm(b))},'olympe.dr');
766
- olympe.T.run([olympe.Za.P.me,olympe.Za.P.Ip,olympe.Za.P.um,olympe.Za.P.nq],(a,...b)=>{b.forEach(c=>a.Lb(c.Z(),c))});olympe.H={};olympe.H.Yc={ui:1,dg:2,uc:3,qf:4,ez:5,Di:6,CA:7};olympe.H.ka={Di:1,jv:2,ct:3,lg:5};olympe.H.sa=class{ab(){}connect(){}disconnect(){}Ue(){}Rf(){}Y(){}ac(){}Ib(){}Da(){}yd(){}};olympe.H.sa.C={INIT:'initialize',CONNECTING:'connecting',gg:'disconnected',ti:'connected',Yg:'reconnecting',uc:'error'};olympe.H.sa.G={Hh:1,jt:-1,wt:-2,$u:-3};function Eh(a,b){const c=a.G.get(b)||a.Sa;a.G.delete(b);return`${c}/${b}`}
767
- olympe.H.Tj=class{constructor(a,b,c,d,e){this.N=a;this.F=b;this.oa=c;this.Sa=d;this.Ya=e;this.C=new Map;this.G=new Map;this.aa=new Map;this.Da=new olympe.D.Xb('File manager context')}ja(a,b,c){b&&this.G.set(a,`${this.Ya}/${b}`);c&&this.aa.set(a,c)}Y(a,b,c,d,e){const f=Nb(Eh(this,a),olympe.net.cb.$d.mk,b,olympe.net.cb.ResponseType.ql);Ob(f,{[olympe.net.cb.Headers.pi]:this.bd(a),[olympe.net.cb.Headers.Kj]:c||'application/octet-stream'});this.F.C(f,g=>{g=g.Rd();g===olympe.net.cb.hd.Hh||g===olympe.net.cb.hd.wl?
768
- (g=new URL(f.C()),d(g.pathname)):e&&(g=`Failed to create file ${a}. Response code ${g}`,this.N.error(g),e(g))})}U(a,b,c,d,e){const f=olympe.D.Ja();d={Ye:f.C(d),se:e&&f.C(e)};if(this.C.has(a))this.C.get(a).push(d);else{this.C.set(a,[d]);if(null===b){var g=Nb(Eh(this,a));Ob(g,{[olympe.net.cb.Headers.pi]:this.bd(a)})}else g=Nb(b);g.F=olympe.net.cb.ResponseType.ql;Ob(g,{[olympe.net.cb.Headers.Kj]:c||'application/octet-stream'});this.Da.run(()=>{this.F.C(g,h=>{const k=h.Rd(),l=this.C.get(a);if(200<=k&&
769
- 300>k){const n=h.getData();l&&l.forEach(p=>{if(f.Ab()){const q=f.Lb(),r=f.Z();this.N.warn(`Context ${q} ${r} is being destroyed while file tag ${a} is being downloaded`)}p.Ye(n)})}else{const n=`Failed to download file ${a}. Response code ${k}`;l&&l.forEach(p=>{p.se&&p.se(n)})}this.C.delete(a)})})}}L(a,b,c){const d=Nb(Eh(this,a),olympe.net.cb.$d.Hc);Ob(d,{[olympe.net.cb.Headers.pi]:this.bd(a)});this.F.C(d,e=>{e=e.Rd();200<=e&&300>e?b():(e=`Failed to delete file ${a}. Response code ${e}`,this.N.error(e),
770
- c&&c(e))})}bd(a){const b=this.aa.get(a);b&&this.aa.delete(a);return b||olympe.D.bb(mc(this.oa))}};olympe.H.Tj.la=[olympe.Za.Tj];const Fh=olympe.dc.ga.ka.Sg,Gh=olympe.dc.ga.ka.eh,Hh=olympe.dc.ga.ka.Bk,Ih=olympe.dc.ga.ka.wh,Jh=olympe.dc.ga.ka.zi,Kh=olympe.dc.ga.ka.Ai,Lh=olympe.dc.ga.ka.Zo,Mh=olympe.dc.ga.ka.$o,Nh=olympe.dc.ga.ka.Hl,Oh=olympe.dc.ga.ka.wi,Ph=olympe.dc.ga.ka.xh,Qh=olympe.dc.ga.ka.Qh,Rh=olympe.dc.ga.ka.Sj,Sh=olympe.dc.ga.ka.hv,Th=olympe.dc.ga.ka.Gu,Uh=olympe.dc.ga.ka.kt,Vh=olympe.dc.ga.ka.sl,Wh=olympe.dc.ga.ka.Gs;
771
- function Xh(a){a.G.Da(olympe.H.Yc.ui,a.Ya.bind(a));olympe.D.Ec([kc(a.oa)],b=>{b=b.valueOf()?olympe.dc.xk.cq:olympe.dc.xk.bm;a.U&&a.U(a.Z(),b)},'Server source is online')}function Yh(a,b,c){const d=b.Dc;b=new olympe.dc.transaction.vd(!0);d.Qc(b);Zh(a,a.wb,Gh,!0,$d(b),e=>{c&&c(e);a.C(a.Z(),Rh,{id:d.Z(),finalize:olympe.dc.transaction.rg.C.Wp})})}
772
- function $h(a,b,c,d){const e=c.Z();a.N.log('Graphdef (ID ',e,') sent: ',c);const f=c instanceof olympe.dc.query.Pl?a.ab:a.Da,g=(new olympe.H.$.Vj).ia(c);c=new olympe.async.ng(a.Y);b===Kh&&c.add((k,l)=>{a.F.set(e,{notification:null,gy:a.Y.C(n=>n?l(n):k())});ai(a,b,g,n=>n&&l(n.message))});const h=olympe.D.Ja();c.add((k,l)=>{h.run(()=>{Zh(a,f,Jh,!1,g,a.Y.C(n=>n?l(n.message):k()))})});Vb(c,(k,l)=>{const n=a.F.get(e);k&&n&&n.notification?a.C(a.Z(),Mh,n.notification):!k&&n&&bi(a,Lh,e,p=>p&&a.N.warn(p));
773
- a.F.delete(e);d(l?Error(l):null)});c.start()}function bi(a,b,c,d){a.N.log('Unsubscribe to: ',c);ai(a,b,{i:c},d)}function ai(a,b,c,d){b={c:b};Object.assign(b,c);a.G.Y(olympe.H.Yc.ui,b,d&&(e=>{d(e)}))}function Zh(a,b,c,d,e,f){if(a.G.ab()){const g=olympe.H.Yc.ui;!d&&e&&Object.assign(e,{c});c=olympe.D.bb(mc(a.oa)).valueOf();a.G.ac(b,g,c,d,e,f)}else a.N.error('Server is disconnected, data request of type',c,'on url',b,'is canceled.'),f(Error('Server is disconnected'))}
774
- olympe.H.bh=class extends olympe.Za.bh{constructor(a,b,c,d,e){super(a);this.G=b;this.oa=c;new olympe.H.$.gb;this.aa=new olympe.dc.W.Ki(this.Z());this.ja=d;if(4!==e.length)throw Error('Some HTTP end points to the orchestrator are not specified ! Please check DI of olympe.communication module; wants 4 urls but got: '+e.length);this.Sa=e[0];this.ab=e[1];this.Da=e[2];this.wb=e[3];this.F=new Map;Xh(this)}Z(){return olympe.dc.Ga.Pc}L(a){var b=a.type;const c=a.validate.bind(a);a=a.content;switch(b){case Fh:Zh(this,
775
- this.Sa,olympe.dc.ga.ka.Sg,!1,null,c);break;case Ih:b=new olympe.dc.transaction.vd;var d=a.Dc;a=a.rh;d.Qc(b);ai(this,Ih,{i:d.Z(),r:a,p:$d(b)});c(null);break;case Vh:b=new olympe.dc.transaction.vd;a=a.Dc;a.Qc(b);ai(this,Vh,{i:a.Z(),p:$d(b)},c);break;case Gh:b=new olympe.dc.transaction.vd;d=a.Dc;a=a.rh;d.Qc(b);ai(this,olympe.dc.ga.ka.eh,{i:d.Z(),r:a,p:$d(b)},c);break;case Hh:Yh(this,a,c);break;case Jh:case Kh:$h(this,b,a,c);break;case Lh:bi(this,b,a,c);break;case Sh:ai(this,Sh,{},c);break;case Th:ai(this,
776
- Th,{},c);break;case Uh:ai(this,Uh,{},c);break;case Wh:ai(this,Wh,{},c);break;case Ph:this.ja.U(a.file,a.url,a.mimeType,a.Ye,a.se);break;case Oh:this.ja.L(a.file,a.Ye,a.se);break;case Qh:this.ja.Y(a.file,a.content,a.mimeType,a.Ye,a.se);break;default:this.N.info(`Message of type ${b} not supported yet`)}}Ya(a){var b=olympe.dc.ga.ka.yl,c=olympe.dc.ga.ka.Ij;const d=olympe.dc.ga.ka.hk,e=olympe.dc.ga.ka.Su,f=olympe.dc.ga.ka.Fp;var g=olympe.dc.ga.ka.lt;const h=a.c;h===b?(a=this.aa.C(a.p),this.C(this.Z(),
777
- b,a)):h===c?(g=a.error.reason,b=this.aa.C(a.p),this.C(this.Z(),c,{id:a.i,rollback:b,error:g})):h===Nh?(g=olympe.dc.Ga.rb,c=olympe.dc.Ga.Pc,b=a.i,0<a.s?g=new olympe.dc.query.errors.Xj(b,c,g,a.info.error.reason):(g=this.aa.U(b,g,a.p),this.N.debug('< Graphdef Result (ID ',g.Z(),'):',a.p),this.N.log('< Graphdef Result (ID ',g.Z(),') with',g.Dc.G(),'operations')),this.C(this.Z(),Nh,g)):h===Mh?(g=a.i,a=this.aa.L(g,a.p),this.F.has(g)?(g=this.F.get(g),g.notification?gf(a,g.notification):g.notification=a):
778
- this.C(this.Z(),Mh,a)):h===f?(g=new olympe.dc.query.Mp(a.i),a.l.forEach(g.F.bind(g)),this.C(this.Z(),f,g)):h===d?(g=olympe.dc.transaction.rg.C.hk,c=0<a.s?a.info.error.reason:null,this.C(this.Z(),Rh,{id:a.i,finalize:g,error:c})):h===e?(g=this.F.get(a.i))&&g.gy(0<a.s?a.info.error.reason:null):h===g&&(c=a.ids,b=a.undo_stack_size,a=a.redo_stack_size,this.C(this.Z(),g,{YC:c,oD:b,jD:a}))}};olympe.H.bh.F={hA:1,iB:2};
779
- olympe.H.bh.C={100:'Insufficient Rights',200:'Constraints',300:'IOException',400:'Unexpected',500:'Non Existing Subscription'};olympe.H.Zj=class{constructor(){}};olympe.H.Zj.la=[olympe.dc.da.Zj];olympe.H.Ba={};function ci(a,b,c){Sb(a.C,b,d=>{d=new olympe.H.Ba.Ob.Request(d.dest,d.src,d.auth,d.seq,d.type,d.content);return c(d)})}function di(a,b,c){a.L.set(b,c)}function ei(a,b){return new Promise((c,d)=>{Tb(a.C,b,e=>e?d(e):c())})}function fi(a,b){return new Promise((c,d)=>{const e=b.bd(),f=a.Y.get(e);void 0!==f?c(f):a.U.oh(b.bd(),(g,h)=>{g?d(g):(a.Y.set(e,h),c(h))})})}
780
- olympe.H.Ba.sa=class{constructor(a,b,c,d){this.N=a;this.U=c;a=new olympe.W.wm(d.get('messageTimeout'));a.C=this.aa.bind(this);this.L=a;a=d.get('url');b=d.get('connectionOptions');this.C=new olympe.net.gk(a,b);this.Y=new olympe.W.wm(d.get('tokenTimeout'));this.G=1;this.F=olympe.W.fc()}connect(){return new Promise(a=>{Rb(this.C)?a():this.C.connect(()=>{Sb(this.C,this.F,b=>{b=new olympe.H.Ba.Ob.Response(b.dest,b.src,b.seq,b.type,b.content);const c=this.L.get(b.G);c&&(this.L.delete(b.G),c(b))});a()})})}disconnect(){return new Promise(a=>
781
- this.C.end(!1,()=>a()))}Le(a,b,c){return new Promise((d,e)=>{const f=a.source,g=new olympe.H.Ba.Ob.Response(f,this.F,a.G,b,c);this.C.publish(f,g.ia(),void 0,h=>h?e(h):d())})}request(a,b,c){return new Promise((d,e)=>{const f=this.G;this.G++;var g=olympe.D.bb(mc(this.U));g=new olympe.H.Ba.Ob.Request(a,this.F,g,f,b,c);this.C.publish(a,g.ia(),void 0,h=>h?e(h):d(f))})}notify(a,b,c){return new Promise((d,e)=>{var f=this.G;this.G++;f=new olympe.H.Ba.Ob.Response(b,a,f,olympe.H.Ba.Ob.Response.ka.ym,c);this.C.publish(b,
782
- f.ia(),void 0,g=>g?e(g):d())})}aa(a,b){b(new olympe.H.Ba.Ob.Response(this.F,this.F,a,olympe.H.Ba.Ob.Response.ka.uc,{reason:'Timeout'}))}};olympe.H.Ba.Ob={};olympe.H.Ba.Ob.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.destination=a;this.source=b;this.L=c;this.C=e;this.F=f||null}bd(){return this.L}ia(){return{dest:this.destination,src:this.source,seq:this.G,auth:this.L,type:this.C,content:this.F}}toString(){return JSON.stringify(this)}};olympe.H.Ba.Ob.Request.ka={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3};olympe.H.Ba.Ob.Response=class{constructor(a,b,c,d,e){this.G=c;this.destination=a;this.source=b;this.F=d;this.C=e||null}ia(){return{dest:this.destination,src:this.source,seq:this.G,type:this.F,content:this.C}}toString(){return JSON.stringify(this)}};olympe.H.Ba.Ob.Response.ka={ym:0,Ln:1,cr:2,uc:3};olympe.H.Ba.nb={};const gi=olympe.H.Ba.Ob.Response.ka.Ln,hi=olympe.H.Ba.Ob.Response.ka.uc,ii=olympe.H.Ba.Ob.Response.ka.ym,ji=olympe.H.Ba.Ob.Response.ka.cr,ki=olympe.H.Ba.Ob.Request.ka.SEND,li=olympe.H.Ba.Ob.Request.ka.GET,mi=olympe.H.Ba.Ob.Request.ka.PUBLISH,ni=olympe.H.Ba.Ob.Request.ka.SUBSCRIBE;
783
- olympe.H.Ba.nb.zb=class{constructor(a,b){this.C=olympe.H.Ba.Tc();this.F=a;this.G=new olympe.D.Xb(`Service ${a}`,'function'===typeof b.xc?b.xc():b);this.N=olympe.ra.Xa(`Service ${this.F}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();ei(this.C,this.F).catch(c=>this.N.error('Failed to unsubscribe from '+this.F+', error: '+c))};this.G.onDestroy(b);this.C.connect().then(()=>{ci(this.C,this.F,c=>a.next(new olympe.H.Ba.nb.ga(c,this.C)))}).catch(c=>this.N.error('Failed to connect to the bus: '+
784
- c));return b})}stop(){this.G.destroy()}static publish(a,b){const c=olympe.H.Ba.Tc();return c.connect().then(()=>c.request(a,mi,b)).then(()=>Promise.resolve())}static send(a,b){return new Promise((c,d)=>{const e=olympe.H.Ba.Tc();e.connect().then(()=>e.request(a,ki,b)).then(f=>{di(e,f,g=>{switch(g.F){case gi:c();break;case hi:d(g.C.reason);break;default:d('Unsupported response type for a SEND request')}})}).catch(f=>d(f))})}static get(a,b){return new Promise((c,d)=>{const e=olympe.H.Ba.Tc();e.connect().then(()=>
785
- e.request(a,li,b)).then(f=>{di(e,f,g=>{switch(g.F){case ii:(g=g.C)?c(g):d('No payload after request to service: '+a);break;case hi:d(g.C.reason);break;default:d('Unsupported response type for a GET request')}})}).catch(f=>d(f))})}static observe(a,b,c){const d='function'===typeof b.xc?b.xc():b;return new rxjs.Observable(e=>{const f=olympe.H.Ba.Tc();let g=null;const h=()=>{e.complete();g&&ei(f,g).catch(k=>olympe.ra.Xa('Service '+a).error('Failed to unsubscribe from a topic '+k))};d.zc(h);f.connect().then(()=>
786
- f.request(a,ni,c)).then(k=>{di(f,k,l=>{switch(l.F){case ji:g=l.C.topic;ci(f,g,n=>{n.C===mi?e.next(n.F):(e.error('Unsupported notification message. It should be a publish'),h())});break;case hi:e.error(l.C.reason);break;default:e.error('Unsupported response type for a SUBSCRIBE request')}})}).catch(k=>e.error(k));return h})}};olympe.H.Ba.nb.zb.observe=olympe.H.Ba.nb.zb.observe;olympe.H.Ba.nb.zb.get=olympe.H.Ba.nb.zb.get;olympe.H.Ba.nb.zb.send=olympe.H.Ba.nb.zb.send;olympe.H.Ba.nb.zb.publish=olympe.H.Ba.nb.zb.publish;
787
- olympe.H.Ba.nb.zb.prototype.stop=olympe.H.Ba.nb.zb.prototype.stop;olympe.H.Ba.nb.zb.prototype.listen=olympe.H.Ba.nb.zb.prototype.listen;const oi=olympe.H.Ba.Ob.Response.ka.Ln,pi=olympe.H.Ba.Ob.Response.ka.uc,qi=olympe.H.Ba.Ob.Response.ka.ym,ri=olympe.H.Ba.Ob.Response.ka.cr,si=olympe.H.Ba.Ob.Request.ka.SEND,ti=olympe.H.Ba.Ob.Request.ka.GET,ui=olympe.H.Ba.Ob.Request.ka.SUBSCRIBE;
788
- olympe.H.Ba.nb.ga=class{constructor(a,b){this.request=a;this.C=b;this.user=null}Bj(){return null!==this.user?Promise.resolve(this.user):fi(this.C,this.request).then(a=>this.user=a)}source(){return this.request.source}body(){return this.request.F}Lk(){return this.request.C===si?this.C.Le(this.request,oi,void 0):Promise.reject('Should only call `ack` on SEND requests')}Le(a){return this.request.C===ti?this.C.Le(this.request,qi,a):Promise.reject('Should only call `reply` on GET requests')}es(a){return this.request.C===
789
- ui?this.C.Le(this.request,ri,{topic:a}):Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests')}xg(a){return this.C.Le(this.request,pi,{reason:a.message})}};olympe.H.Ba.nb.ga.prototype.fail=olympe.H.Ba.nb.ga.prototype.xg;olympe.H.Ba.nb.ga.prototype.notifyOn=olympe.H.Ba.nb.ga.prototype.es;olympe.H.Ba.nb.ga.prototype.reply=olympe.H.Ba.nb.ga.prototype.Le;olympe.H.Ba.nb.ga.prototype.ack=olympe.H.Ba.nb.ga.prototype.Lk;olympe.H.Ba.nb.ga.prototype.body=olympe.H.Ba.nb.ga.prototype.body;
790
- olympe.H.Ba.nb.ga.prototype.source=olympe.H.Ba.nb.ga.prototype.source;olympe.H.Ba.nb.ga.prototype.userTag=olympe.H.Ba.nb.ga.prototype.Bj;olympe.H.pa={};function vi(a,b,c,d){c.c=b;a.C.Y(olympe.H.Yc.qf,c,d)}
791
- olympe.H.pa.Ua=class{constructor(a,b,c,d,e,f,g,h,k){this.N=a;this.C=b;this.F=h;this.Ya=c;this.G=g;this.storage=k;const l=this.storage.C('AUTH');l&&(l.get('redirectTo',n=>{n&&(l.remove('redirectTo'),l.close(),this.F.redirect(n,null,olympe.auth.tk.C.GET))}),l.close())}U(a){this.C.Ue(a)}L(a){this.C.Rf(a)}Sa(a){this.C.yd(olympe.H.Yc.qf,'logoutHandler');this.C.Da(olympe.H.Yc.qf,b=>{const c=b.c;c===olympe.H.pa.Ua.C.au?(this.C.Ib(),a(olympe.auth.sa.F.Cj,b)):c===olympe.H.pa.Ua.C.Mu&&a(olympe.auth.sa.F.pp,
792
- b)},'logoutHandler')}Y(a,b){vi(this,olympe.H.pa.Ua.C.qf,{token:a.Mf()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.uc:b(Error('Invalid token'));break;case olympe.H.pa.Ua.C.Ri:c=null;var e=d.payload;if(e){d=e.userName;const f=e.userTag,g=e.rndCook,h=e.payload,k=e.protocol;'SAML'===k?(e=e.samlToken,c=new olympe.auth.Jq(d,f,g,h),c.C=e):'openid'===k&&(c=new olympe.auth.hm(d,f,g,h))}b(null,c);break;default:b(Error('Unknown response from server'))}})}oa(a,b){vi(this,olympe.H.pa.Ua.C.qt,
793
- {I:a.Sd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.uc:b(Error(`Username '${a.Sd()}' invalid, or password does not match`));break;case olympe.H.pa.Ua.C.Uu:c=d.payload;b(null,c.S,c.B);break;default:b(Error('Unknown response from server'))}})}Da(a,b){vi(this,olympe.H.pa.Ua.C.vs,{A:a.get('a'),M:a.get('m1'),I:a.Sd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.uc:this.N.debug('Login failed, invalid username or password');b(Error('Invalid username or password'));
794
- break;case olympe.H.pa.Ua.C.Ri:c=d.payload;this.N.debug('Login successful, creating token');d=c.payload?JSON.parse(c.payload):void 0;b(null,new olympe.auth.vf(c.userName,c.userTag,c.rndCook,d));break;default:b(Error(`Unknown response from server (type ${d.c})`))}})}ja(a){vi(this,olympe.H.pa.Ua.C.Oe,{},(b,c)=>{null!==b?a(b):c.url&&c.request?a(null,c.url,c.request.replace(/\s/g,''),c.id):a(Error('Missing parameters from server response'))})}aa(a){const b=olympe.D.bb(olympe.auth.Tc().C.Fb())||null;if(b instanceof
795
- olympe.auth.hm){const c=e=>{const f=Object.create(null);f.url=e;f.olympe_token=b.Mf();f.access_token=b.ak().access_token||null;this.F.redirect(`${this.G}/logout`,f)};a=this.F.C();const d=new URL(a);if(0!==d.hash.length||0!==d.search.length){const e=this.storage.C('AUTH');d.hash='';d.search='';e&&e.set('redirectTo',a,()=>{e.close();c(d.toString())})}else c(a)}else this.C.Y(olympe.H.Yc.qf,{c:olympe.H.pa.Ua.C.bu},a)}hi(a){this.C.Y(olympe.H.Yc.qf,{c:olympe.H.pa.Ua.C.lg},a)}oh(a,b,c){this.C.ac(this.Ya+
796
- '/'+a,olympe.H.Yc.qf,b,!1,null,(d,e)=>{c(d,e)})}Ur(){return this.G}};olympe.H.pa.Ua.C={qf:1,bu:2,uc:3,lg:5,Ri:6,qt:10,Uu:11,vs:12,Oe:13,Mu:14,au:20};olympe.H.pa.Ua.la=[olympe.auth.Wu,olympe.auth.Jb.pa.Ii,olympe.auth.Jb.pa.Ee,olympe.auth.Jb.pa.Oe];olympe.H.$={};olympe.H.$.$c=function(){};olympe.H.$.$c.prototype.ia=function(){};olympe.H.$.Ne=function(){};olympe.H.$.Ne.prototype.ia=function(){};olympe.H.$.$a=function(){};olympe.H.$.$a.prototype.ia=function(){};olympe.H.$.yf=function(){};olympe.H.$.yf.prototype.ia=function(){};olympe.H.$.gb=function(){this.X={};this.Cb={};this.V={};this.na=Object.create(null);var a=new olympe.H.$.X.Sb;this.X[O(olympe.dc.X.Sb)]=a;a=new olympe.H.$.X.Be;this.X[O(olympe.dc.X.Be)]=a;a=new olympe.H.$.X.Fc;this.X[O(olympe.dc.X.Fc)]=a;this.X[O(olympe.dc.X.Kd)]=new olympe.H.$.X.Kd;this.X[O(olympe.dc.X.vc)]=new olympe.H.$.X.vc;this.X[O(olympe.dc.X.Zd)]=new olympe.H.$.X.Zd;this.X[O(olympe.dc.X.we)]=new olympe.H.$.X.we;a=new olympe.H.$.Cb.Number;this.Cb[O(olympe.dc.Cb.Number)]=a;a=new olympe.H.$.Cb.String;
797
- this.Cb[O(olympe.dc.Cb.String)]=a;a=new olympe.H.$.V.Ic;this.V[O(olympe.dc.V.Ic)]=a;this.V[O(olympe.dc.V.ye)]=new olympe.H.$.V.ye;this.V[O(olympe.dc.V.Fe)]=new olympe.H.$.V.Fe;a=new olympe.H.$.V.Wc;this.V[O(olympe.dc.V.Wc)]=a;a=new olympe.H.$.V.wd;this.V[O(olympe.dc.V.wd)]=a;this.V[O(olympe.dc.V.nd)]=new olympe.H.$.V.nd;a=new olympe.H.$.V.lf;this.V[O(olympe.dc.V.lf)]=a;a=new olympe.H.$.V.mf;this.V[O(olympe.dc.V.mf)]=a;this.na[O(olympe.dc.na.Dd)]=new olympe.H.$.na.Dd;a=new olympe.H.$.na.ke;this.na[O(olympe.dc.na.ke)]=
798
- a;a=new olympe.H.$.na.oe;this.na[O(olympe.dc.na.oe)]=a;a=new olympe.H.$.na.te;this.na[O(olympe.dc.na.te)]=a;a=new olympe.H.$.na.je;this.na[O(olympe.dc.na.je)]=a;this.na[O(olympe.dc.na.uf)]=new olympe.H.$.na.uf};olympe.H.$.gb.prototype.constructor=olympe.H.$.gb;function wi(a,b,c){var d=b.ma(),e=a.V[d];if(void 0===e)throw Error('No predicate registered for predicate: '+d);return e.ia(b,c,a)}
799
- function xi(a,b,c){var d=b.ma(),e=a.na[d];if(void 0===e)throw Error('No valueDef registered for valueDef: '+d);return e.ia(b,c,a)}
800
- function yi(a,b){return a&&a.zf?'"$'+b.add(a)+'"':a instanceof olympe.D.qa||a instanceof olympe.D.ea?String(a):a instanceof olympe.D.Wa?'"'+a+'"':a instanceof olympe.D.jb?(a=a.ps(),String(`{"c":4,"y":${a.getUTCFullYear()},"M":${a.getUTCMonth()+1},"d":${a.getUTCDate()},"h":${a.getUTCHours()},"m":${a.getUTCMinutes()},"s":${a.getUTCSeconds()},"S":${a.getUTCMilliseconds()},"z":0}`)):a instanceof olympe.D.Color?'{"c":7,"r":'+a.Qf().valueOf()+',"g":'+a.Kf().valueOf()+',"b":'+a.Ff().valueOf()+',"a":'+a.Ef().valueOf()+
801
- '}':a instanceof olympe.dc.Jc?'{"c":8,"t":"'+a.R()+'"}':JSON.stringify(a)};olympe.H.$.Vj=class{ia(a){const b=Object.create(null);b.i=a.Z();b.b=[a.C];b.m=!0;b.v=!0;b.f=a instanceof olympe.dc.query.Pl?Ue(a.ph):olympe.dc.Ub.NONE;b.q=lf(a).map(this.C.bind(this));return b}C(a){const b=a.Qd(),c=b.Pa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Gi:olympe.H.$.X.Sb.C.Oi,d=Object.create(null);d.t=b.R();d.d=c;d.v=a.apply;d.r=b.recursive;d.q=a.kh().map(this.C.bind(this));return d}};olympe.H.$.X={};olympe.H.$.X.we=class{ia(){return'{"y":15}'}};olympe.H.$.X.we.la=[olympe.H.$.$c];olympe.H.$.X.vc=function(){};olympe.H.$.X.vc.prototype.constructor=olympe.H.$.X.vc;olympe.H.$.X.vc.prototype.ia=function(a,b,c){return'{"y":21,"p":'+wi(c,a.C,b)+'}'};olympe.H.$.X.vc.la=[olympe.H.$.$c];olympe.H.$.X.Be=function(){};olympe.H.$.X.Be.prototype.constructor=olympe.H.$.X.Be;olympe.H.$.X.Be.prototype.ia=function(a){var b=null!==a.Pa()?a.Pa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Gi:olympe.H.$.X.Sb.C.Oi:olympe.H.$.X.Sb.C.Xn;return'{"y":12,"t":'+JSON.stringify($g(a))+',"d":'+b+'}'};olympe.H.$.X.Be.la=[olympe.H.$.$c];olympe.H.$.X.Fc=function(){};olympe.H.$.X.Fc.prototype.constructor=olympe.H.$.X.Fc;olympe.H.$.X.Fc.prototype.ia=function(a){const b=null!==a.Pa()?a.Pa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Gi:olympe.H.$.X.Sb.C.Oi:olympe.H.$.X.Sb.C.Xn;return'{"y":11,"t":"'+a.R()+'","d":'+b+',"s":'+a.F+',"e":'+a.C+'}'};olympe.H.$.X.Fc.la=[olympe.H.$.$c];olympe.H.$.X.Sb=function(){};olympe.H.$.X.Sb.C={Xn:0,Gi:1,Oi:2};olympe.H.$.X.Sb.prototype.constructor=olympe.H.$.X.Sb;olympe.H.$.X.Sb.prototype.ia=function(a){const b=a.Pa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Gi:olympe.H.$.X.Sb.C.Oi;return'{"y":10,"t":"'+a.R()+'","d":'+b+'}'};olympe.H.$.X.Sb.la=[olympe.H.$.$c];olympe.H.$.X.Kd=function(){};olympe.H.$.X.Kd.prototype.constructor=olympe.H.$.X.Kd;olympe.H.$.X.Kd.prototype.ia=function(a,b,c){var d=a.Md;const e=d.ma();var f=c.Cb[e];if(void 0===f)throw Error('No comparator registered for comparator: '+e);return'{"y":20,"o":'+f.ia(d,b,c)+(a.C?'':',"a":false')+'}'};olympe.H.$.X.Kd.la=[olympe.H.$.$c];olympe.H.$.X.Zd=function(){};olympe.H.$.X.Zd.prototype.constructor=olympe.H.$.X.Zd;olympe.H.$.X.Zd.prototype.ia=function(a,b){var c=a.start;c=c&&c.zf?'"$'+b.add(c)+'"':JSON.stringify(c);a=(a=a.C)&&a.zf?'"$'+b.add(a)+'"':JSON.stringify(a);return'{"y":22,"s":'+c+',"n":'+a+'}'};olympe.H.$.X.Zd.la=[olympe.H.$.$c];olympe.H.$.Cb={};olympe.H.$.Cb.Number=class{constructor(){}ia(a,b,c){return`{"y":11,"v":${xi(c,a.C,b)}}`}};olympe.H.$.Cb.Number.la=[olympe.H.$.Ne];olympe.H.$.Cb.String=class{constructor(){}ia(a,b,c){return`{"y":10,"v":${xi(c,a.C,b)}}`}};olympe.H.$.Cb.String.la=[olympe.H.$.Ne];olympe.H.$.V={};olympe.H.$.V.Wc=function(){};olympe.H.$.V.Wc.prototype.constructor=olympe.H.$.V.Wc;olympe.H.$.V.Wc.prototype.ia=function(a,b,c){const d=xi(c,a.source,b);c=xi(c,a.getValue(),b);a=yi(a.G,b);return'{"y":20,"s":'+d+',"v":'+c+',"a":'+a+'}'};olympe.H.$.V.Wc.la=[olympe.H.$.$a];olympe.H.$.V.Ic=function(){};olympe.H.$.V.Ic.prototype.constructor=olympe.H.$.V.Ic;olympe.H.$.V.Ic.prototype.ia=function(a,b,c){const d=xi(c,a.G,b);a=xi(c,a.L,b);return'{"y":10,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Ic.la=[olympe.H.$.$a];olympe.H.$.V.ye=function(){};olympe.H.$.V.ye.prototype.constructor=olympe.H.$.V.ye;olympe.H.$.V.ye.prototype.ia=function(a,b,c){const d=xi(c,a.G,b);a=xi(c,a.L,b);return'{"y":11,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.ye.la=[olympe.H.$.$a];olympe.H.$.V.lf=class{ia(a){const b=Ug(a).map(d=>'"'+d+'"'),c=Vg(a).map(d=>d===olympe.dc.Aa.DESTINATION?'2':'1');a=a.G;return'{"y":81,"r":['+b.toString()+'],"d":['+c.toString()+']'+(0!==a.length?',"t":"'+a.toString()+'"':'')+'}'}};olympe.H.$.V.lf.la=[olympe.H.$.$a];olympe.H.$.V.mf=class{ia(a){return'{"y":80,"m":['+Array.from(a.G).map(b=>'"'+b+'"').toString()+']}'}};olympe.H.$.V.mf.la=[olympe.H.$.$a];olympe.H.$.V.nd=class{ia(a,b,c){return'{"y":30,"p":'+wi(c,a.G,b)+'}'}};olympe.H.$.V.nd.la=[olympe.H.$.$a];olympe.H.$.V.wd=class{ia(a,b,c){c=xi(c,a.source,b);const d=a.L;a=yi(a.G,b);return'{"y":23,"s":'+c+',"r":"'+d+'","a":'+a+'}'}};olympe.H.$.V.wd.la=[olympe.H.$.$a];olympe.H.$.V.Fe=function(){};olympe.H.$.V.Fe.prototype.constructor=olympe.H.$.V.Fe;olympe.H.$.V.Fe.prototype.ia=function(a,b,c){var d=xi(c,a.G,b);a=xi(c,a.L,b);return'{"y":12,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Fe.la=[olympe.H.$.$a];olympe.H.$.na={};olympe.H.$.na.Oc=function(){};olympe.H.$.na.Oc.prototype.constructor=olympe.H.$.na.Oc;olympe.H.$.na.Oc.prototype.C=function(){};
802
- olympe.H.$.na.Oc.prototype.ia=function(a,b,c){var d=yi(a.Ze,b),e=a.Od();e=e?',"b":'+yi(e,b):'';if(a=a.Cg()){var f='[';for(let n=0,p=a.length;n<p;n++){var g=0===n?'':',';var h=c;var k=a[n],l=b;const q=k.ma(),r=h.X[q];if(void 0===r)throw Error('No serializer registered for transformer: '+q);h=r.ia(k,l,h);f+=g+h}b=',"q":'+(f+']')}else b='';return'{"y":'+this.C()+',"t":'+d+e+b+'}'};olympe.H.$.na.Oc.la=[olympe.H.$.yf];olympe.H.$.na.te=function(){olympe.H.$.na.Oc.call(this)};olympe.H.$.na.te.prototype=Object.create(olympe.H.$.na.Oc.prototype);olympe.H.$.na.te.prototype.constructor=olympe.H.$.na.te;olympe.H.$.na.te.prototype.C=function(){return 13};olympe.H.$.na.Dd=class{ia(a,b){return'{"y":10,"v":'+yi(a.value,b)+'}'}};olympe.H.$.na.Dd.la=[olympe.H.$.yf];olympe.H.$.na.je=function(){olympe.H.$.na.Oc.call(this)};olympe.H.$.na.je.prototype=Object.create(olympe.H.$.na.Oc.prototype);olympe.H.$.na.je.prototype.constructor=olympe.H.$.na.je;olympe.H.$.na.je.prototype.C=function(){return 14};olympe.H.$.na.ke=function(){olympe.H.$.na.Oc.call(this)};olympe.H.$.na.ke.prototype=Object.create(olympe.H.$.na.Oc.prototype);olympe.H.$.na.ke.prototype.constructor=olympe.H.$.na.ke;olympe.H.$.na.ke.prototype.C=function(){return 11};olympe.H.$.na.oe=function(){olympe.H.$.na.Oc.call(this)};olympe.H.$.na.oe.prototype=Object.create(olympe.H.$.na.Oc.prototype);olympe.H.$.na.oe.prototype.constructor=olympe.H.$.na.oe;olympe.H.$.na.oe.prototype.C=function(){return 12};olympe.H.$.na.uf=class{ia(){return'{"y":19}'}};olympe.H.$.na.uf.la=[olympe.H.$.yf];olympe.H.rd={};function zi(a,b){a.N.info('Initializing SERVER layer');if(a.N.G()){const c=['Server layer parameters:'];b.forEach((d,e)=>{c.push(e+'="'+d+'"')});a.N.debug(c.join('\n\t'))}a.Da(olympe.H.Yc.uc,c=>{switch(c.c){case olympe.H.ka.jv:a.N.error('Unknown message sent to the server:',olympe.H.sa.F[c.s]);break;case olympe.H.ka.ct:a.N.error('Fatal error, the last message is probably too big according to the websocket config.'),a.F.forEach((d,e)=>{null!==d.Dn&&Ai(a,e,c.i)})}});b.get('autoConnect')&&(a.N.debug('Connecting automatically'),
803
- a.connect());olympe.D.kn(a.U.Fb(),()=>{a.Xe.forEach(c=>c());Ib(a.gi.bind(a),a.Ox);Ib(a.be.bind(a),a.Ge)},()=>{a.aa=null;a.Df.forEach(c=>c(a.G[2]));a.be()});a.N.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
804
- function Bi(a,b){if(a.C!==b)switch(a.N.debug('State change '+a.C+' --\x3e '+b),a.C=b,b){case olympe.H.sa.C.CONNECTING:break;case olympe.H.sa.C.ti:a.U.update(olympe.D.qa.F);break;case olympe.H.sa.C.Yg:a.G[0]=0;a.G[1]=0;a.connect();break;case olympe.H.sa.C.uc:a.N.error('Connection to server',a.oa.C(),'aborted due to error');a.U.update(olympe.D.qa.C);break;case olympe.H.sa.C.gg:a.U.update(olympe.D.qa.C);a.wb&&(a.N.info('Disconnected, will try to auto reconnect in',a.Lb,'ms'),Hb(()=>{a.connect()},a.Lb));
737
+ olympe.dm.File.urlProp=olympe.dm.File.O.va('ff023000000000000053');z('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.O.va('ff023000000000000054');olympe.dm.File.la=[olympe.D.File];m=olympe.dm.File.prototype;m.fn.K=olympe.D.J.F;m.Sk.K=new olympe.D.J(()=>{},[]);m.bn.K=new olympe.D.J(()=>{},[]);m.Tk.K=new olympe.D.J(()=>{},[]);m.rename.K=olympe.D.J.C;m.Sl.K=olympe.D.J.F;m.Bp.K=olympe.D.J.F;m.uw.K=new olympe.D.J(()=>olympe.D.jb,[]);
738
+ m.Qw.K=new olympe.D.J(()=>olympe.D.jb,[]);m.bs.K=olympe.D.J.U;olympe.dm.Fd=class extends olympe.dc.CloudObject{C(){return this.Gb(olympe.dm.Fd.F)}G(){return this.Ie(olympe.dm.Fd.N)}F(){return this.tb(olympe.dm.Fd.C,olympe.dm.Module)}};olympe.dm.Fd.O=olympe.dc.ya.C('ff021000000000000041',olympe.dm.Fd);olympe.dm.Fd.F=olympe.dm.Fd.O.va('ff023000000000000047');olympe.dm.Fd.N=olympe.dm.Fd.O.va('ff023000000000000048');olympe.dm.Fd.C=olympe.dm.Module.C.Gc();olympe.dm.Fd.prototype.C.K=olympe.D.J.F;olympe.dm.Fd.prototype.G.K=olympe.D.J.G;
739
+ olympe.dm.Fd.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Nb=class extends olympe.dm.Zc{F(){return this.tb(olympe.dm.Qb.F,olympe.dm.Qb)}N(){return this.Gb(olympe.dm.Nb.oa)}aa(){return this.Gb(olympe.dm.Nb.wc)}G(){return this.tb(olympe.dm.Nb.N,olympe.dm.Nb)}};olympe.dm.Nb.O=olympe.dc.ya.C('0163d9594700fcf61e54',olympe.dm.Nb);olympe.dm.Nb.oa=olympe.dm.Nb.O.va('017869c7d2833c9492c1');olympe.dm.Nb.wc=olympe.dm.Nb.O.va('017869c80bb9929c76d0');olympe.dm.Nb.N=olympe.dm.Nb.O.Ha('ff02200000000000002b');olympe.dm.Nb.Ve=P(olympe.dm.Nb.O,olympe.dm.Nb.N);
740
+ olympe.dm.Nb.ac=olympe.dm.Nb.O.Ha('ff02200000000000002a');olympe.dm.Nb.He=olympe.dm.Nb.O.Ha('017e9c412e2b944bd590');olympe.dm.Nb.ii=olympe.dm.Nb.O.Ha('017e9c416872a89d3415');olympe.dm.Nb.th=olympe.dm.Nb.O.Ha('017ebf8fe5c506662098');P(olympe.dc.CloudObject.O,olympe.dm.Nb.ac);olympe.dm.Nb.yd=Ic('100000000000000000dd','PRIMORDIAL');olympe.dm.Nb.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Nb.prototype.N.K=olympe.D.J.F;olympe.dm.Nb.prototype.aa.K=olympe.D.J.F;
741
+ olympe.dm.Nb.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{F(){return this.rc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}C(){return this.rc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}Vc(){return this.F().ma().Ir(this.ma())}};olympe.dm.Property.O=olympe.dc.ya.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=P(olympe.dm.Property.O,olympe.dc.CloudObject.propertyRel);z('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);
742
+ olympe.dm.Property.typeRel=P(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);z('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Nw(){return olympe.D.Wa.EMPTY}pw(){return this.Ie(olympe.dm.Relation.Mm)}Xw(){return this.Ie(olympe.dm.Relation.zn)}Rr(){return this.tb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Sc()}Wr(){return this.tb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Sc()}Vc(){return this.Wr().ma().concat(['-',this.ma(),'->',this.Rr().ma()])}};olympe.dm.Relation.O=olympe.dc.ya.C('ff021000000000000006',olympe.dm.Relation);
743
+ olympe.dm.Relation.zn=olympe.dm.Relation.O.va('ff023000000000000030');olympe.dm.Relation.Mm=olympe.dm.Relation.O.va('ff023000000000000034');olympe.dm.Relation.Wm=olympe.dm.Relation.O.va('ff023000000000000037');olympe.dm.Relation.Vm=olympe.dm.Relation.O.va('ff023000000000000137');olympe.dm.Relation.Cn=olympe.dm.Relation.O.va('ff023000000000000237');olympe.dm.Relation.Gn=olympe.dm.Relation.O.va('ff023000000000000337');olympe.dm.Relation.Cr=olympe.dm.Relation.O.va('ff023000000000000031');
744
+ olympe.dm.Relation.originModelRel=P(olympe.dm.Relation.O,olympe.dc.CloudObject.G);z('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=P(olympe.dm.Relation.O,olympe.dc.CloudObject.U);z('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dc.Ub={NONE:null,qz:olympe.dm.Relation.Wm.R(),Hc:olympe.dm.Relation.Vm.R(),uf:olympe.dm.Relation.Cn.R(),QA:olympe.dm.Relation.Gn.R()};
745
+ olympe.dc.Ub.toString=function(a){for(const [b,c]of Object.entries(olympe.dc.Ub))if(c===a)return b;return null};olympe.dm.Relation.C={Ol:0,sl:5,Cq:1,Ou:4,Dk:2,sk:8,Ho:10,Ku:6,Lu:9,kc:6,Nu:9};olympe.dm.Relation.F={ru:3,cm:4,ju:5,Zl:6};olympe.dm.Relation.N=olympe.dm.Nc.hq+olympe.dm.Nc.Ao;m=olympe.dm.Relation.prototype;m.Nw.K=olympe.D.J.F;m.pw.K=olympe.D.J.G;m.Xw.K=olympe.D.J.G;m.Rr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Wr.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.sf=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.sf.O=olympe.dc.ya.C('ff021000000000000019',olympe.dm.sf);olympe.dm.String=class extends olympe.dm.sf{getValue(){return this.Gb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.O=olympe.dc.ya.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.O.va('ff023000000000000026');z('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.D.J.F;olympe.dm.String.prototype.toString.K=olympe.D.J.C;olympe.dm.Boolean=class extends olympe.dm.sf{getValue(){return this.Cg(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.ya.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.va('ff023000000000000027');z('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.D.J.U;olympe.dm.Color=class extends olympe.dm.sf{getValue(){return this.Xr()}};olympe.dm.Color.O=olympe.dc.ya.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.va('ff023000000000000032');z('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.D.J(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.sf{getValue(){return this.lj(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.ya.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.va('ff023000000000000029');z('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.D.J(()=>olympe.D.jb,[]);olympe.dm.Enum=class extends olympe.dm.String{ma(){return olympe.D.Fa([super.ma(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Wa)}fe(){return this.Ie(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.Oa();e=void 0!==e?e:f.Eb(b)&&f.ee(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.dm.Enum.create=olympe.dm.Enum.create;
746
+ olympe.dm.Enum.O=olympe.dc.ya.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.va('017a7690c915975ea995');olympe.dm.Enum.prototype.fe.K=olympe.D.J.G;olympe.dm.ig=class extends olympe.dm.BrickMetadata{qx(){return this.sb(olympe.dc.CloudObject.instancesRel).kl(olympe.dm.Enum.rankProp,olympe.dc.ba.mk.ASC).jd()}static create(a,b){b=a.create(olympe.dm.ig,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ra(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.ig.create=olympe.dm.ig.create;olympe.dm.ig.prototype.getValues=olympe.dm.ig.prototype.qx;olympe.dm.ig.O=olympe.dc.ya.C('017a768f966fc08ebb98',olympe.dm.ig);olympe.dm.Number=class extends olympe.dm.sf{getValue(){return this.Ie(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.ya.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.va('ff023000000000000028');z('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.D.J.G;olympe.Za={};olympe.Za.dh=class{constructor(a){this.L=a;this.Y=new olympe.D.Xb(`${this.Z()} source context`);this.U=this.C=null}Z(){}N(){}close(){this.U&&this.U(this.Z(),olympe.dc.yk.yt);this.Y.destroy()}};function kh(a){olympe.D.Ec([oc(a.oa)],b=>{if(b.valueOf()){const c=a.G.keys();lh(a,d=>{if(d)a.L.error('An error occurred while auto synchronising:\n'+d.message);else if(a.L.debug('Auto synchronise transactions successfully'),a.aa)for(const e of c)dc(a.F,f=>{a.L.error(`Could not clear transactions for ${e}: ${f}.`)})})}})}
747
+ function mh(a){let b;olympe.D.Ec([oc(a.oa)],c=>{c.valueOf()?(a.aa=!1,b&&(Jb(b),b=null)):(a.aa=!0,b=Ib(()=>{if(a.ha){a.ha=!1;for(const d of a.G.keys())bc(a.F,d,a.G.get(d),()=>{},e=>{a.L.error(`Could persist transaction for ${d}: ${e}`)})}},5E3))})}
748
+ function lh(a,b){const c=olympe.async.xk.create(),d=c.G;c.add((e,f)=>{a.F.storage.N(f)});c.add((e,f,g)=>{const h=olympe.dc.Ga.rb,k=g.get('files'),l=new olympe.async.og(d);a.G.forEach((n,p)=>{if(p!==h){const q=a.Da.U(p);null!==q?(l.add(a.Sa.bind(a,n,q,k)),a.F.storage.C()):f(`The source: ${p} is not reachable.`)}});Zb(l,(n,p)=>{n?e():f(p||void 0)});l.start()});Zb(c,(e,f)=>{b(e?null:Error(f));e&&(a.ha=!1,a.G.clear())});c.start()}
749
+ function nh(a,b){const c=new olympe.async.xk(olympe.D.Ja());c.add((d,e)=>{cc(a.F,f=>null===f?d():e(f))});c.add(d=>{const e=olympe.dc.Ad();a.G.forEach((f,g)=>{const h=Array.from(f.ee()).map(k=>k.tag());Nc(e,olympe.D.Ja(),f,h,[],g)(!0)});d()});Zb(c,(d,e)=>{b(e?Error(e):null)});c.start()}
750
+ olympe.Za.Ji=class extends olympe.Za.dh{constructor(a,b,c,d,e){super(a);this.G=new Map;this.oa=c;this.F=d;this.Da=b;this.ha=this.aa=!1;e.get('syncTimeout');e.get('autoSync')&&kh(this);e.get('autoPersist')&&mh(this)}Sa(a,b,c,d,e){const f=olympe.dc.ga.ka.Ck,g=olympe.dc.ga.ka.zl,h=new olympe.dc.db.Ac,k=new olympe.async.og(olympe.D.Ja()),l=(n,p,q)=>{const r=n.tag(),t=n.fb(olympe.dm.File.mimeTypeProp.R());fc(this.F,u=>{wc(olympe.dc.Gw(),r,u,t,v=>{n.va(olympe.dm.File.urlProp.R(),v);const w=new Map;w.set(olympe.dm.File.urlProp.R(),
751
+ v);h.uc(r,w);this.F.storage.C(q)})})};for(const n of c)(c=a.Mf(n))&&c.se()&&k.add(l.bind(this,c));Zb(k,(n,p)=>{n?(n=M(new olympe.dc.ga(f,a,[b.Z()]),q=>{q?e(q.message):(this.C(b.Z(),g,h),q=Array.from(a.ee()).map(r=>r.tag()),olympe.dc.Ad().persist(q),d())}),b.N(n)):e(`Transaction synchronisation failed! ${p?p:''}`)});k.start()}Z(){return olympe.dc.Ga.rb}N(a){var b=olympe.dc.ga.ka.fh,c=olympe.dc.ga.ka.xh;const d=olympe.dc.ga.ka.Ci,e=olympe.dc.ga.ka.Bi,f=olympe.dc.ga.ka.Tg,g=olympe.dc.ga.ka.Il,h=olympe.dc.ga.ka.Sh,
752
+ k=olympe.dc.ga.ka.yi,l=olympe.dc.ga.ka.yh;var n=olympe.dc.ga.ka.Uj;const p=a.type;switch(p){case f:a.validate(null);this.F.storage.F();nh(this,v=>{null!==v&&this.L.error(`Could not load transactions: ${v.message}`)});break;case b:case c:const q=a.content;a.C.forEach(v=>{let w=this.G.get(v);void 0===w&&(w=new olympe.dc.db.Ac,this.G.set(v,w));q.Qc(w);this.aa&&(this.ha=!0)});a.validate(null);a=olympe.dc.transaction.sg.C.Xp;this.C(olympe.dc.Ga.rb,n,{id:q.Z(),finalize:a});break;case e:case d:const r=a.C[0],
753
+ t=a.content;a.validate(null);ac(this.F,t.Z(),v=>{this.L.warn('No graphresult for subscription : '+t.Z(),v,'\n',t.qh.toJSON());this.L.warn();this.C(r,g,new olympe.dc.query.Ei(t.Z(),r,olympe.dc.Ga.rb,new olympe.dc.db.Ac))});break;case h:case l:case k:n=a.content;b=n.file;const u=n.Ze;c=n.te;p===h?ec(this.F,b,n.content,n.mimeType,u,c):p===l?fc(this.F,v=>{u(v)}):this.F.storage.C(c);a.validate(null)}}};olympe.Za.Ji.C='context';const oh=olympe.dc.ga.ka.om,ph=olympe.dc.ga.ka.qm,qh=olympe.dc.ga.ka.QUERY_RESULT,rh=olympe.dc.ga.ka.pm,sh=olympe.dc.ga.ka.fh,th=olympe.dc.ga.ka.Ck,uh=olympe.dc.ga.ka.Uj,vh=olympe.dc.ga.ka.xh,wh=olympe.dc.ga.ka.Kj,xh=olympe.dc.ga.ka.tl,yh=olympe.dc.ga.ka.Sh,zh=olympe.dc.ga.ka.yh,Ah=olympe.dc.ga.ka.yi,Bh=olympe.dc.ga.ka.mg;
754
+ function Ch(a,b,c,d,e){const f=c.Z();c={t:oh,q:c.ja()};olympe.H.Ba.nb.zb.get(b,c).then(g=>{g.t===qh?(d(null),a.C(b,e||qh,{i:f,r:g.r,s:b})):d(Error(g.e))}).catch(g=>d(Error(g)))}function Dh(a,b,c,d,e){const f=c.Z();Ch(a,b,c,g=>{if(g)e(g);else{Eh(a,b,f);g={t:ph,q:c.ja()};var h=olympe.H.Ba.nb.zb.observe(b,d,g).subscribe(k=>{const l=k.t;l===rh?(e(null),a.C(b,l,{i:f,r:k.r,s:b})):e(Error(k.e))});d.zc(()=>h.unsubscribe())}},rh)}
755
+ function Fh(a,b,c,d){const e=c.Dc;c=new olympe.dc.transaction.vd;e.Qc(c);c={t:sh,i:e.Z(),p:de(c)};olympe.H.Ba.nb.zb.send(b,c).then(()=>{d(null);a.C(b,uh,{id:e.Z(),finalize:olympe.dc.transaction.sg.C.Wp})}).catch(f=>d(Error(f)))}function Gh(a,b,c,d,e){var f=c.Dc;c=f.Z();const g=new olympe.dc.transaction.vd;f.Qc(g);f={t:vh,i:c,p:de(g)};olympe.H.Ba.nb.zb.publish(b,f).then(()=>e(null)).catch(h=>e(Error(h)));Hh(a,c,b,d)}
756
+ function Eh(a,b,c){const d=()=>{const f=setInterval(()=>{0===a.F.size?clearInterval(f):a.F.forEach((g,h)=>{olympe.H.Ba.nb.zb.send(h,{t:Bh,s:Array.from(g)}).catch(k=>a.L.warn(`Error occurred while keeping alive subscription list: ${k}`))})},a.aa)},e=a.F.get(b)||new Set;e.add(c);a.F.set(b,e);1===a.F.size&&d()}
757
+ function Hh(a,b,c,d){const e=new olympe.H.Ba.nb.zb(b,d);e.listen().subscribe(f=>{f=f.body();if(f.t===wh){a.L.error(`Burst Transaction ${b} failed. Local rollback is not supported yet. Refresh the application`);const g=new olympe.dc.db.Ac;a.C(c,wh,{id:b,rollback:g,error:f.r})}});d.zc(()=>e.stop())}
758
+ olympe.Za.Cu=class extends olympe.Za.dh{constructor(a,b,c){super(a);this.F=new Map;this.G=b;this.aa=c}Z(){return olympe.dc.Ga.lq}N(a){const b=a.C[0],c=a.type,d=a.validate.bind(a),e=a.content;a=a.F;switch(c){case oh:Ch(this,b,e,d);break;case ph:Dh(this,b,e,a,d);break;case sh:case th:Fh(this,b,e,d);break;case vh:Gh(this,b,e,a,d);break;case xh:e.t=c;olympe.H.Ba.nb.zb.publish(b,e).then(d).catch(f=>d(Error(f)));break;case yh:case zh:case Ah:olympe.H.Ba.nb.zb.get(b,{t:c,f:e.file}).then(f=>{this.G.ha(e.file,
759
+ b,f);c===yh?this.G.Y(e.file,e.content,e.mimeType,e.Ze,e.te):c===zh?this.G.U(e.file,e.url,e.mimeType,e.Ze,e.te):this.G.N(e.file,e.Ze,e.te)}).catch(e.te);break;default:this.L.info(`Messages of type ${c} is not supported by the source ${this.Z()}`)}}};olympe.Za.Buffer=class{constructor(){this.counter=0;this.Ob=new Map}buffer(a){const b=this.counter++;this.Ob.set(b,a);return this.clear.bind(this,b)}clear(a){this.Ob.delete(a)}};olympe.Za.qg=class a{constructor(b,c,d){this.L=b;this.Y=c;this.ha=new olympe.Za.Buffer(this);this.N=new Map;this.G=this.Ib(d);new olympe.D.Xb('Data Router context');this.F=new Map;this.aa=new Map;this.Ya()}Ya(){this.L.info('Initializing DR layer');olympe.D.kn(oc(this.Y),()=>{this.L.info('Router: ONLINE')},()=>{this.L.log('Router: OFFLINE (no auth layer not online)');for(const b of this.ha.Ob.values())this.Da(b)});this.L.log('DONE initializing DR layer (waiting for AUTH layer session to be established)')}send(b){M(b,
760
+ this.ha.buffer(b));this.Da(b)}C(b,c){const d=olympe.W.hc();let e=this.F.get(b);void 0===e&&(e=new Map,this.F.set(b,e));e.set(d,c)}oa(b){this.aa.set(olympe.W.zg(),b)}wb(b,c,d){this.F.has(c)&&this.F.get(c).forEach(e=>{e(b,d)})}Lb(b,c){this.N.set(b,c);c.C=this.wb.bind(this);c.U=this.Sa.bind(this)}U(b){return this.N.get(b)||this.N.get(olympe.dc.Ga.lq)}Sa(b,c){this.aa.forEach(d=>{d(b,c)})}Da(b){this.L.debug('Processing message',b.toString());this.ab(b).forEach(c=>{(c=this.U(c))&&c.N(b)})}ab(b){var c=olympe.dc.ga.ka.Tg,
761
+ d=olympe.dc.ga.ka.Bi,e=olympe.dc.ga.ka.Ci,f=olympe.dc.ga.ka.fh,g=olympe.dc.ga.ka.xh;const h=olympe.dc.ga.ka.Sh,k=olympe.dc.ga.ka.yi,l=olympe.dc.ga.ka.yh;switch(b.type){case c:d=this.G.get(a.C.Tg)||[];break;case d:case e:d=this.G.get(a.C.nm)||[];break;case f:case g:d=this.G.get(a.C.TRANSACTION)||[];break;case h:case l:case k:d=this.G.get(a.C.gt)||[];break;default:d=[]}c=b.content;e=olympe.auth.sa.C.Og;f=olympe.auth.sa.C.Bh;g=nc(this.Y);e=!(g===e||g===f);for(var n of d)if(d=n,f=c&&c.Z&&c.Z(),g=d.get('type'),
762
+ g===a.F.Ih&&e||g===a.F.op&&d.get('id')===f||g===a.F.kc)return n=n.get('destinations'),this.L.debug('Message',b.toString(),'is redirect to',n),n;this.L.debug('Message',b.toString(),'not redirect');return b.C}Ib(b){const c=Object.values(olympe.Za.qg.C),d=Object.values(olympe.Za.qg.F);b=Object.entries(b);const e=new Map;b.forEach(([f,g])=>{if(c.includes(f))if(g instanceof Array){var h=[];e.set(f,h);g.forEach(k=>{const l=k.type;if(d.includes(l)){var n=k.destinations;n instanceof Array?(n=(new Map).set('type',
763
+ l).set('destinations',n),h.push(n),l===a.F.op&&n.set('id',k.id)):this.L.error('Routing rule',f,l,'is not valid. Destinations must be stored in an array')}else this.L.error('Routing rule',f,l,'is not valid. Valid rules are',d.toString())})}else this.L.error('Routing rule',f,'is not valid. Rules must be ordered in an array');else this.L.error('Routing rule',f,'is not valid. Valid messages are',c.toString())});return e}};olympe.Za.qg.C={Tg:'getContext',nm:'query',TRANSACTION:'transaction',gt:'file'};
764
+ olympe.Za.qg.F={kc:'default',Ih:'offline',op:'id'};olympe.Za.qg.la=[olympe.dc.qg];olympe.Za.Vj=class{ha(){}Y(){}U(){}N(){}};olympe.Za.P={xa:'dr.Manager',Ea:'dr.Logger',ne:'dr.sources.Router',Ip:'dr.sources.Local',um:'dr.sources.Server',nq:'dr.sources.Peer',Sg:'dr.sources.FileSource'};olympe.Za.Config={Yl:'dr.keepAliveTimeout',Rn:'dr.autoSync',Qn:'dr.autoPersist',Wq:'dr.syncTimeout',Iq:'dr.routing'};
765
+ olympe.T.config(function(a){D(a,olympe.Za.Config.Iq,{});D(a,olympe.Za.Config.Yl,3E5);D(a,olympe.Za.Config.Rn,!1);D(a,olympe.Za.Config.Qn,!1);D(a,olympe.Za.Config.Wq,3E4);C(a,olympe.Za.P.Ea,[olympe.ra.P.xa],b=>b.Rc('dr'));C(a,olympe.Za.P.Ip,[olympe.Za.P.Ea,olympe.Za.P.ne,olympe.auth.P.xa,olympe.jc.P.uo,new olympe.T.fa(olympe.Za.Config.Rn),new olympe.T.fa(olympe.Za.Config.Qn),new olympe.T.fa(olympe.Za.Config.Wq)],(b,c,d,e,f,g,h)=>{f=(new Map).set('autoSync',f).set('autoPersist',g).set('syncTimeout',
766
+ h);return new olympe.Za.Ji(b,c,d,e,f)});sa(a,olympe.Za.P.um);A(a,olympe.Za.P.nq,olympe.Za.Cu,olympe.Za.P.Ea,olympe.Za.P.Sg,new olympe.T.fa(olympe.Za.Config.Yl));sa(a,olympe.Za.P.Sg);A(a,olympe.Za.P.ne,olympe.Za.qg,olympe.Za.P.Ea,olympe.auth.P.xa,new olympe.T.fa(olympe.Za.Config.Iq));ra(a,olympe.dc.P.ne,olympe.Za.P.ne);C(a,olympe.dc.query.Mb.fk,[olympe.dc.query.Mb.fk],b=>new olympe.dc.mm(b))},'olympe.dr');
767
+ olympe.T.run([olympe.Za.P.ne,olympe.Za.P.Ip,olympe.Za.P.um,olympe.Za.P.nq],(a,...b)=>{b.forEach(c=>a.Lb(c.Z(),c))});olympe.H={};olympe.H.Yc={wi:1,eg:2,cc:3,rf:4,gz:5,Fi:6,DA:7};olympe.H.ka={Fi:1,nv:2,ft:3,mg:5};olympe.H.sa=class{ab(){}connect(){}disconnect(){}be(){}Sf(){}Y(){}ac(){}Ib(){}Da(){}yd(){}};olympe.H.sa.C={INIT:'initialize',CONNECTING:'connecting',hg:'disconnected',vi:'connected',Zg:'reconnecting',cc:'error'};olympe.H.sa.G={Jh:1,mt:-1,zt:-2,dv:-3};function Ih(a,b){const c=a.G.get(b)||a.Sa;a.G.delete(b);return`${c}/${b}`}
768
+ olympe.H.Vj=class{constructor(a,b,c,d,e){this.L=a;this.F=b;this.oa=c;this.Sa=d;this.Ya=e;this.C=new Map;this.G=new Map;this.aa=new Map;this.Da=new olympe.D.Xb('File manager context')}ha(a,b,c){b&&this.G.set(a,`${this.Ya}/${b}`);c&&this.aa.set(a,c)}Y(a,b,c,d,e){const f=Nb(Ih(this,a),olympe.net.cb.$d.nk,b,olympe.net.cb.ResponseType.rl);Ob(f,{[olympe.net.cb.Headers.si]:this.bd(a),[olympe.net.cb.Headers.Mj]:c||'application/octet-stream'});this.F.C(f,g=>{g=g.Rd();g===olympe.net.cb.hd.Jh||g===olympe.net.cb.hd.xl?
769
+ (g=new URL(f.C()),d(g.pathname)):e&&(g=`Failed to create file ${a}. Response code ${g}`,this.L.error(g),e(g))})}U(a,b,c,d,e){const f=olympe.D.Ja();d={Ze:f.C(d),te:e&&f.C(e)};if(this.C.has(a))this.C.get(a).push(d);else{this.C.set(a,[d]);if(null===b){var g=Nb(Ih(this,a));Ob(g,{[olympe.net.cb.Headers.si]:this.bd(a)})}else g=Nb(b);g.F=olympe.net.cb.ResponseType.rl;Ob(g,{[olympe.net.cb.Headers.Mj]:c||'application/octet-stream'});this.Da.run(()=>{this.F.C(g,h=>{const k=h.Rd(),l=this.C.get(a);if(200<=k&&
770
+ 300>k){const n=h.getData();l&&l.forEach(p=>{if(f.Ab()){const q=f.Lb(),r=f.Z();this.L.warn(`Context ${q} ${r} is being destroyed while file tag ${a} is being downloaded`)}p.Ze(n)})}else{const n=`Failed to download file ${a}. Response code ${k}`;l&&l.forEach(p=>{p.te&&p.te(n)})}this.C.delete(a)})})}}N(a,b,c){const d=Nb(Ih(this,a),olympe.net.cb.$d.Hc);Ob(d,{[olympe.net.cb.Headers.si]:this.bd(a)});this.F.C(d,e=>{e=e.Rd();200<=e&&300>e?b():(e=`Failed to delete file ${a}. Response code ${e}`,this.L.error(e),
771
+ c&&c(e))})}bd(a){const b=this.aa.get(a);b&&this.aa.delete(a);return b||olympe.D.bb(qc(this.oa))}};olympe.H.Vj.la=[olympe.Za.Vj];const Jh=olympe.dc.ga.ka.Tg,Kh=olympe.dc.ga.ka.fh,Lh=olympe.dc.ga.ka.Ck,Mh=olympe.dc.ga.ka.xh,Nh=olympe.dc.ga.ka.Bi,Oh=olympe.dc.ga.ka.Ci,Ph=olympe.dc.ga.ka.Zo,Qh=olympe.dc.ga.ka.$o,Rh=olympe.dc.ga.ka.Il,Sh=olympe.dc.ga.ka.yi,Th=olympe.dc.ga.ka.yh,Uh=olympe.dc.ga.ka.Sh,Vh=olympe.dc.ga.ka.Uj,Wh=olympe.dc.ga.ka.mv,Xh=olympe.dc.ga.ka.Ju,Yh=olympe.dc.ga.ka.nt,Zh=olympe.dc.ga.ka.tl,$h=olympe.dc.ga.ka.Hs;
772
+ function ai(a){a.G.Da(olympe.H.Yc.wi,a.Ya.bind(a));olympe.D.Ec([oc(a.oa)],b=>{b=b.valueOf()?olympe.dc.yk.cq:olympe.dc.yk.Ih;a.U&&a.U(a.Z(),b)},'Server source is online')}function bi(a,b,c){const d=b.Dc;b=new olympe.dc.transaction.vd(!0);d.Qc(b);ci(a,a.wb,Kh,!0,de(b),e=>{c&&c(e);a.C(a.Z(),Vh,{id:d.Z(),finalize:olympe.dc.transaction.sg.C.Wp})})}
773
+ function di(a,b,c,d){const e=c.Z();a.L.log('Graphdef (ID ',e,') sent: ',c);const f=c instanceof olympe.dc.query.Ql?a.ab:a.Da,g=(new olympe.H.$.Xj).ja(c);c=new olympe.async.og(a.Y);b===Oh&&c.add((k,l)=>{a.F.set(e,{notification:null,jy:a.Y.C(n=>n?l(n):k())});ei(a,b,g,n=>n&&l(n.message))});const h=olympe.D.Ja();c.add((k,l)=>{h.run(()=>{ci(a,f,Nh,!1,g,a.Y.C(n=>n?l(n.message):k()))})});Zb(c,(k,l)=>{const n=a.F.get(e);k&&n&&n.notification?a.C(a.Z(),Qh,n.notification):!k&&n&&fi(a,Ph,e,p=>p&&a.L.warn(p));
774
+ a.F.delete(e);d(l?Error(l):null)});c.start()}function fi(a,b,c,d){a.L.log('Unsubscribe to: ',c);ei(a,b,{i:c},d)}function ei(a,b,c,d){b={c:b};Object.assign(b,c);a.G.Y(olympe.H.Yc.wi,b,d&&(e=>{d(e)}))}function ci(a,b,c,d,e,f){if(a.G.ab()){const g=olympe.H.Yc.wi;!d&&e&&Object.assign(e,{c});c=olympe.D.bb(qc(a.oa)).valueOf();a.G.ac(b,g,c,d,e,f)}else a.L.error('Server is disconnected, data request of type',c,'on url',b,'is canceled.'),f(Error('Server is disconnected'))}
775
+ olympe.H.dh=class extends olympe.Za.dh{constructor(a,b,c,d,e){super(a);this.G=b;this.oa=c;new olympe.H.$.gb;this.aa=new olympe.dc.W.Mi(this.Z());this.ha=d;if(4!==e.length)throw Error('Some HTTP end points to the orchestrator are not specified ! Please check DI of olympe.communication module; wants 4 urls but got: '+e.length);this.Sa=e[0];this.ab=e[1];this.Da=e[2];this.wb=e[3];this.F=new Map;ai(this)}Z(){return olympe.dc.Ga.Pc}N(a){var b=a.type;const c=a.validate.bind(a);a=a.content;switch(b){case Jh:ci(this,
776
+ this.Sa,olympe.dc.ga.ka.Tg,!1,null,c);break;case Mh:b=new olympe.dc.transaction.vd;var d=a.Dc;a=a.sh;d.Qc(b);ei(this,Mh,{i:d.Z(),r:a,p:de(b)});c(null);break;case Zh:b=new olympe.dc.transaction.vd;a=a.Dc;a.Qc(b);ei(this,Zh,{i:a.Z(),p:de(b)},c);break;case Kh:b=new olympe.dc.transaction.vd;d=a.Dc;a=a.sh;d.Qc(b);ei(this,olympe.dc.ga.ka.fh,{i:d.Z(),r:a,p:de(b)},c);break;case Lh:bi(this,a,c);break;case Nh:case Oh:di(this,b,a,c);break;case Ph:fi(this,b,a,c);break;case Wh:ei(this,Wh,{},c);break;case Xh:ei(this,
777
+ Xh,{},c);break;case Yh:ei(this,Yh,{},c);break;case $h:ei(this,$h,{},c);break;case Th:this.ha.U(a.file,a.url,a.mimeType,a.Ze,a.te);break;case Sh:this.ha.N(a.file,a.Ze,a.te);break;case Uh:this.ha.Y(a.file,a.content,a.mimeType,a.Ze,a.te);break;default:this.L.info(`Message of type ${b} not supported yet`)}}Ya(a){var b=olympe.dc.ga.ka.zl,c=olympe.dc.ga.ka.Kj;const d=olympe.dc.ga.ka.ik,e=olympe.dc.ga.ka.Vu,f=olympe.dc.ga.ka.Fp;var g=olympe.dc.ga.ka.ot;const h=a.c;h===b?(a=this.aa.C(a.p),this.C(this.Z(),
778
+ b,a)):h===c?(g=a.error.reason,b=this.aa.C(a.p),this.C(this.Z(),c,{id:a.i,rollback:b,error:g})):h===Rh?(g=olympe.dc.Ga.rb,c=olympe.dc.Ga.Pc,b=a.i,0<a.s?g=new olympe.dc.query.errors.Zj(b,c,g,a.info.error.reason):(g=this.aa.U(b,g,a.p),this.L.debug('< Graphdef Result (ID ',g.Z(),'):',a.p),this.L.log('< Graphdef Result (ID ',g.Z(),') with',g.Dc.G(),'operations')),this.C(this.Z(),Rh,g)):h===Qh?(g=a.i,a=this.aa.N(g,a.p),this.F.has(g)?(g=this.F.get(g),g.notification?lf(a,g.notification):g.notification=a):
779
+ this.C(this.Z(),Qh,a)):h===f?(g=new olympe.dc.query.Mp(a.i),a.l.forEach(g.F.bind(g)),this.C(this.Z(),f,g)):h===d?(g=olympe.dc.transaction.sg.C.ik,c=0<a.s?a.info.error.reason:null,this.C(this.Z(),Vh,{id:a.i,finalize:g,error:c})):h===e?(g=this.F.get(a.i))&&g.jy(0<a.s?a.info.error.reason:null):h===g&&(c=a.ids,b=a.undo_stack_size,a=a.redo_stack_size,this.C(this.Z(),g,{ZC:c,pD:b,kD:a}))}};olympe.H.dh.F={iA:1,jB:2};
780
+ olympe.H.dh.C={100:'Insufficient Rights',200:'Constraints',300:'IOException',400:'Unexpected',500:'Non Existing Subscription'};olympe.H.ak=class{constructor(){}};olympe.H.ak.la=[olympe.dc.da.ak];olympe.H.Ba={};function gi(a,b,c){a.L.debug(`Bus: Subscribe to ${b}`);Sb(a.C,b,d=>{d=new olympe.H.Ba.Ob.Request(d.dest,d.src,d.auth,d.seq,d.type,d.content);a.L.debug('Bus: Received',d);c(d)})}function hi(a,b,c){a.Y.set(b,c)}function ii(a,b){return new Promise((c,d)=>{Tb(a.C,b,e=>e?d(e):c())})}function ji(a,b){return new Promise((c,d)=>{const e=b.bd(),f=a.ha.get(e);void 0!==f?c(f):a.aa.ph(b.bd(),(g,h)=>{g?d(g):(a.ha.set(e,h),c(h))})})}
781
+ olympe.H.Ba.sa=class{constructor(a,b,c,d){this.L=a;this.aa=c;a=new olympe.W.wm(d.get('messageTimeout'));a.C=this.oa.bind(this);this.Y=a;a=d.get('url');b=d.get('connectionOptions');this.C=new olympe.net.ke(a,b);this.ha=new olympe.W.wm(d.get('tokenTimeout'));this.U=1;this.G=olympe.W.hc();this.F=!1;this.N=[]}connect(){return new Promise(a=>{Rb(this.C)||this.F?a():this.C.connect(()=>{this.L.debug('Connection to bus established. Listening to',this.G);Xb(this.C,b=>{this.L.error('Failed to connect/re-connect to the bus:',
782
+ b)});Sb(this.C,this.G,b=>{b=new olympe.H.Ba.Ob.Response(b.dest,b.src,b.seq,b.type,b.content);this.L.debug('Bus received message:',b);const c=this.Y.get(b.G);c&&(this.Y.delete(b.G),c(b))});Wb(this.C,()=>{this.F=!0});Vb(this.C,()=>{this.F=!0});Ub(this.C,()=>{if(this.F){this.F=!1;this.L.debug(`Reconnected to bus: Sending ${this.N.length} pending messages.`);for(const b of this.N)this.C.publish(b.N(),b.ja());this.N=[]}});a()})})}disconnect(){return new Promise(a=>this.C.end(!1,()=>a()))}publish(a){this.L.debug('Publishing on bus',
783
+ a);return this.F?(this.L.debug('Disconnected, storing message in queue'),this.N.push(a),Promise.resolve()):new Promise((b,c)=>{this.C.publish(a.N(),a.ja(),void 0,d=>d?c(d):b())})}Me(a,b,c){a=new olympe.H.Ba.Ob.Response(a.source,this.G,a.G,b,c);return this.publish(a)}request(a,b,c){const d=this.U;this.U++;const e=olympe.D.bb(qc(this.aa));a=new olympe.H.Ba.Ob.Request(a,this.G,e,d,b,c);return this.publish(a).then(()=>d)}notify(a,b,c){const d=this.U;this.U++;a=new olympe.H.Ba.Ob.Response(b,a,d,olympe.H.Ba.Ob.Response.ka.ym,
784
+ c);return this.publish(a)}oa(a,b){b(new olympe.H.Ba.Ob.Response(this.G,this.G,a,olympe.H.Ba.Ob.Response.ka.cc,{reason:'Timeout'}))}};olympe.H.Ba.Ob={};olympe.H.Ba.Ob.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.destination=a;this.source=b;this.U=c;this.C=e;this.F=f||null}N(){return this.destination}bd(){return this.U}ja(){return{dest:this.destination,src:this.source,seq:this.G,auth:this.U,type:this.C,content:this.F}}toString(){return JSON.stringify(this)}};olympe.H.Ba.Ob.Request.ka={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3};olympe.H.Ba.Ob.Response=class{constructor(a,b,c,d,e){this.G=c;this.destination=a;this.source=b;this.F=d;this.C=e||null}N(){return this.destination}ja(){return{dest:this.destination,src:this.source,seq:this.G,type:this.F,content:this.C}}toString(){return JSON.stringify(this)}};olympe.H.Ba.Ob.Response.ka={ym:0,Ln:1,dr:2,cc:3};olympe.H.Ba.nb={};const ki=olympe.H.Ba.Ob.Response.ka.Ln,li=olympe.H.Ba.Ob.Response.ka.cc,mi=olympe.H.Ba.Ob.Response.ka.ym,ni=olympe.H.Ba.Ob.Response.ka.dr,oi=olympe.H.Ba.Ob.Request.ka.SEND,pi=olympe.H.Ba.Ob.Request.ka.GET,qi=olympe.H.Ba.Ob.Request.ka.PUBLISH,ri=olympe.H.Ba.Ob.Request.ka.SUBSCRIBE;
785
+ olympe.H.Ba.nb.zb=class{constructor(a,b){this.C=olympe.H.Ba.Tc();this.F=a;this.G=new olympe.D.Xb(`Service ${a}`,'function'===typeof b.xc?b.xc():b);this.L=olympe.ra.Xa(`Service ${this.F}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();ii(this.C,this.F).catch(c=>this.L.error('Failed to unsubscribe from '+this.F+', error: '+c))};this.G.onDestroy(b);this.C.connect().then(()=>{gi(this.C,this.F,c=>a.next(new olympe.H.Ba.nb.ga(c,this.C)))}).catch(c=>this.L.error('Failed to connect to the bus: '+
786
+ c));return b})}stop(){this.G.destroy()}static publish(a,b){const c=olympe.H.Ba.Tc();return c.connect().then(()=>c.request(a,qi,b)).then(()=>Promise.resolve())}static send(a,b){return new Promise((c,d)=>{const e=olympe.H.Ba.Tc();e.connect().then(()=>e.request(a,oi,b)).then(f=>{hi(e,f,g=>{switch(g.F){case ki:c();break;case li:d(g.C.reason);break;default:d('Unsupported response type for a SEND request')}})}).catch(f=>d(f))})}static get(a,b){return new Promise((c,d)=>{const e=olympe.H.Ba.Tc();e.connect().then(()=>
787
+ e.request(a,pi,b)).then(f=>{hi(e,f,g=>{switch(g.F){case mi:(g=g.C)?c(g):d('No payload after request to service: '+a);break;case li:d(g.C.reason);break;default:d('Unsupported response type for a GET request')}})}).catch(f=>d(f))})}static observe(a,b,c){const d='function'===typeof b.xc?b.xc():b;return new rxjs.Observable(e=>{const f=olympe.H.Ba.Tc();let g=null;const h=()=>{e.complete();g&&ii(f,g).catch(k=>olympe.ra.Xa('Service '+a).error('Failed to unsubscribe from a topic '+k))};d.zc(h);f.connect().then(()=>
788
+ f.request(a,ri,c)).then(k=>{hi(f,k,l=>{switch(l.F){case ni:g=l.C.topic;gi(f,g,n=>{n.C===qi?e.next(n.F):(e.error('Unsupported notification message. It should be a publish'),h())});break;case li:e.error(l.C.reason);break;default:e.error('Unsupported response type for a SUBSCRIBE request')}})}).catch(k=>e.error(k));return h})}};olympe.H.Ba.nb.zb.observe=olympe.H.Ba.nb.zb.observe;olympe.H.Ba.nb.zb.get=olympe.H.Ba.nb.zb.get;olympe.H.Ba.nb.zb.send=olympe.H.Ba.nb.zb.send;olympe.H.Ba.nb.zb.publish=olympe.H.Ba.nb.zb.publish;
789
+ olympe.H.Ba.nb.zb.prototype.stop=olympe.H.Ba.nb.zb.prototype.stop;olympe.H.Ba.nb.zb.prototype.listen=olympe.H.Ba.nb.zb.prototype.listen;const si=olympe.H.Ba.Ob.Response.ka.Ln,ti=olympe.H.Ba.Ob.Response.ka.cc,ui=olympe.H.Ba.Ob.Response.ka.ym,vi=olympe.H.Ba.Ob.Response.ka.dr,wi=olympe.H.Ba.Ob.Request.ka.SEND,xi=olympe.H.Ba.Ob.Request.ka.GET,yi=olympe.H.Ba.Ob.Request.ka.SUBSCRIBE;
790
+ olympe.H.Ba.nb.ga=class{constructor(a,b){this.request=a;this.C=b;this.user=null}Dj(){return null!==this.user?Promise.resolve(this.user):ji(this.C,this.request).then(a=>this.user=a)}source(){return this.request.source}body(){return this.request.F}Mk(){return this.request.C===wi?this.C.Me(this.request,si,void 0):Promise.reject('Should only call `ack` on SEND requests')}Me(a){return this.request.C===xi?this.C.Me(this.request,ui,a):Promise.reject('Should only call `reply` on GET requests')}gs(a){return this.request.C===
791
+ yi?this.C.Me(this.request,vi,{topic:a}):Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests')}yg(a){return this.C.Me(this.request,ti,{reason:a.message})}};olympe.H.Ba.nb.ga.prototype.fail=olympe.H.Ba.nb.ga.prototype.yg;olympe.H.Ba.nb.ga.prototype.notifyOn=olympe.H.Ba.nb.ga.prototype.gs;olympe.H.Ba.nb.ga.prototype.reply=olympe.H.Ba.nb.ga.prototype.Me;olympe.H.Ba.nb.ga.prototype.ack=olympe.H.Ba.nb.ga.prototype.Mk;olympe.H.Ba.nb.ga.prototype.body=olympe.H.Ba.nb.ga.prototype.body;
792
+ olympe.H.Ba.nb.ga.prototype.source=olympe.H.Ba.nb.ga.prototype.source;olympe.H.Ba.nb.ga.prototype.userTag=olympe.H.Ba.nb.ga.prototype.Dj;olympe.H.pa={};function zi(a,b,c,d){c.c=b;a.C.Y(olympe.H.Yc.rf,c,d)}
793
+ olympe.H.pa.Ua=class{constructor(a,b,c,d,e,f,g,h,k){this.L=a;this.C=b;this.F=h;this.Ya=c;this.G=g;this.storage=k;const l=this.storage.C('AUTH');l&&(l.get('redirectTo',n=>{n&&(l.remove('redirectTo'),l.close(),this.F.redirect(n,null,olympe.auth.uk.C.GET))}),l.close())}U(a){this.C.be(a)}N(a){this.C.Sf(a)}Sa(a){this.C.yd(olympe.H.Yc.rf,'logoutHandler');this.C.Da(olympe.H.Yc.rf,b=>{const c=b.c;c===olympe.H.pa.Ua.C.du?(this.C.Ib(),a(olympe.auth.sa.F.Ej,b)):c===olympe.H.pa.Ua.C.Pu&&a(olympe.auth.sa.F.pp,
794
+ b)},'logoutHandler')}Y(a,b){zi(this,olympe.H.pa.Ua.C.rf,{token:a.Nf()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.cc:b(Error('Invalid token'));break;case olympe.H.pa.Ua.C.Ti:c=null;var e=d.payload;if(e){d=e.userName;const f=e.userTag,g=e.rndCook,h=e.payload,k=e.protocol;'SAML'===k?(e=e.samlToken,c=new olympe.auth.Kq(d,f,g,h),c.C=e):'openid'===k&&(c=new olympe.auth.hm(d,f,g,h))}b(null,c);break;default:b(Error('Unknown response from server'))}})}oa(a,b){zi(this,olympe.H.pa.Ua.C.tt,
795
+ {I:a.Sd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.cc:b(Error(`Username '${a.Sd()}' invalid, or password does not match`));break;case olympe.H.pa.Ua.C.Xu:c=d.payload;b(null,c.S,c.B);break;default:b(Error('Unknown response from server'))}})}Da(a,b){zi(this,olympe.H.pa.Ua.C.ws,{A:a.get('a'),M:a.get('m1'),I:a.Sd()},(c,d)=>{if(null!==c)b(c);else switch(d.c){case olympe.H.pa.Ua.C.cc:this.L.debug('Login failed, invalid username or password');b(Error('Invalid username or password'));
796
+ break;case olympe.H.pa.Ua.C.Ti:c=d.payload;this.L.debug('Login successful, creating token');d=c.payload?JSON.parse(c.payload):void 0;b(null,new olympe.auth.wf(c.userName,c.userTag,c.rndCook,d));break;default:b(Error(`Unknown response from server (type ${d.c})`))}})}ha(a){zi(this,olympe.H.pa.Ua.C.Pe,{},(b,c)=>{null!==b?a(b):c.url&&c.request?a(null,c.url,c.request.replace(/\s/g,''),c.id):a(Error('Missing parameters from server response'))})}aa(a){const b=olympe.D.bb(olympe.auth.Tc().C.Fb())||null;if(b instanceof
797
+ olympe.auth.hm){const c=e=>{const f=Object.create(null);f.url=e;f.olympe_token=b.Nf();f.access_token=b.ck().access_token||null;this.F.redirect(`${this.G}/logout`,f)};a=this.F.C();const d=new URL(a);if(0!==d.hash.length||0!==d.search.length){const e=this.storage.C('AUTH');d.hash='';d.search='';e&&e.set('redirectTo',a,()=>{e.close();c(d.toString())})}else c(a)}else this.C.Y(olympe.H.Yc.rf,{c:olympe.H.pa.Ua.C.eu},a)}ji(a){this.C.Y(olympe.H.Yc.rf,{c:olympe.H.pa.Ua.C.mg},a)}ph(a,b,c){this.C.ac(this.Ya+
798
+ '/'+a,olympe.H.Yc.rf,b,!1,null,(d,e)=>{c(d,e)})}Vr(){return this.G}};olympe.H.pa.Ua.C={rf:1,eu:2,cc:3,mg:5,Ti:6,tt:10,Xu:11,ws:12,Pe:13,Pu:14,du:20};olympe.H.pa.Ua.la=[olympe.auth.Zu,olympe.auth.Jb.pa.Ki,olympe.auth.Jb.pa.Fe,olympe.auth.Jb.pa.Pe];olympe.H.$={};olympe.H.$.$c=function(){};olympe.H.$.$c.prototype.ja=function(){};olympe.H.$.Oe=function(){};olympe.H.$.Oe.prototype.ja=function(){};olympe.H.$.$a=function(){};olympe.H.$.$a.prototype.ja=function(){};olympe.H.$.zf=function(){};olympe.H.$.zf.prototype.ja=function(){};olympe.H.$.gb=function(){this.X={};this.Cb={};this.V={};this.na=Object.create(null);var a=new olympe.H.$.X.Sb;this.X[O(olympe.dc.X.Sb)]=a;a=new olympe.H.$.X.Ce;this.X[O(olympe.dc.X.Ce)]=a;a=new olympe.H.$.X.Fc;this.X[O(olympe.dc.X.Fc)]=a;this.X[O(olympe.dc.X.Kd)]=new olympe.H.$.X.Kd;this.X[O(olympe.dc.X.vc)]=new olympe.H.$.X.vc;this.X[O(olympe.dc.X.Zd)]=new olympe.H.$.X.Zd;this.X[O(olympe.dc.X.xe)]=new olympe.H.$.X.xe;a=new olympe.H.$.Cb.Number;this.Cb[O(olympe.dc.Cb.Number)]=a;a=new olympe.H.$.Cb.String;
799
+ this.Cb[O(olympe.dc.Cb.String)]=a;a=new olympe.H.$.V.Ic;this.V[O(olympe.dc.V.Ic)]=a;this.V[O(olympe.dc.V.ze)]=new olympe.H.$.V.ze;this.V[O(olympe.dc.V.Ge)]=new olympe.H.$.V.Ge;a=new olympe.H.$.V.Wc;this.V[O(olympe.dc.V.Wc)]=a;a=new olympe.H.$.V.wd;this.V[O(olympe.dc.V.wd)]=a;this.V[O(olympe.dc.V.nd)]=new olympe.H.$.V.nd;a=new olympe.H.$.V.mf;this.V[O(olympe.dc.V.mf)]=a;a=new olympe.H.$.V.nf;this.V[O(olympe.dc.V.nf)]=a;this.na[O(olympe.dc.na.Dd)]=new olympe.H.$.na.Dd;a=new olympe.H.$.na.le;this.na[O(olympe.dc.na.le)]=
800
+ a;a=new olympe.H.$.na.pe;this.na[O(olympe.dc.na.pe)]=a;a=new olympe.H.$.na.ue;this.na[O(olympe.dc.na.ue)]=a;a=new olympe.H.$.na.je;this.na[O(olympe.dc.na.je)]=a;this.na[O(olympe.dc.na.vf)]=new olympe.H.$.na.vf};olympe.H.$.gb.prototype.constructor=olympe.H.$.gb;function Ai(a,b,c){var d=b.ma(),e=a.V[d];if(void 0===e)throw Error('No predicate registered for predicate: '+d);return e.ja(b,c,a)}
801
+ function Bi(a,b,c){var d=b.ma(),e=a.na[d];if(void 0===e)throw Error('No valueDef registered for valueDef: '+d);return e.ja(b,c,a)}
802
+ function Ci(a,b){return a&&a.Af?'"$'+b.add(a)+'"':a instanceof olympe.D.qa||a instanceof olympe.D.ea?String(a):a instanceof olympe.D.Wa?'"'+a+'"':a instanceof olympe.D.jb?(a=a.qs(),String(`{"c":4,"y":${a.getUTCFullYear()},"M":${a.getUTCMonth()+1},"d":${a.getUTCDate()},"h":${a.getUTCHours()},"m":${a.getUTCMinutes()},"s":${a.getUTCSeconds()},"S":${a.getUTCMilliseconds()},"z":0}`)):a instanceof olympe.D.Color?'{"c":7,"r":'+a.Rf().valueOf()+',"g":'+a.Lf().valueOf()+',"b":'+a.Gf().valueOf()+',"a":'+a.Ff().valueOf()+
803
+ '}':a instanceof olympe.dc.Jc?'{"c":8,"t":"'+a.R()+'"}':JSON.stringify(a)};olympe.H.$.Xj=class{ja(a){const b=Object.create(null);b.i=a.Z();b.b=[a.C];b.m=!0;b.v=!0;b.f=a instanceof olympe.dc.query.Ql?Ye(a.qh):olympe.dc.Ub.NONE;b.q=pf(a).map(this.C.bind(this));return b}C(a){const b=a.Qd(),c=b.Pa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Ii:olympe.H.$.X.Sb.C.Qi,d=Object.create(null);d.t=b.R();d.d=c;d.v=a.apply;d.r=b.recursive;d.q=a.lh().map(this.C.bind(this));return d}};olympe.H.$.X={};olympe.H.$.X.xe=class{ja(){return'{"y":15}'}};olympe.H.$.X.xe.la=[olympe.H.$.$c];olympe.H.$.X.vc=function(){};olympe.H.$.X.vc.prototype.constructor=olympe.H.$.X.vc;olympe.H.$.X.vc.prototype.ja=function(a,b,c){return'{"y":21,"p":'+Ai(c,a.C,b)+'}'};olympe.H.$.X.vc.la=[olympe.H.$.$c];olympe.H.$.X.Ce=function(){};olympe.H.$.X.Ce.prototype.constructor=olympe.H.$.X.Ce;olympe.H.$.X.Ce.prototype.ja=function(a){var b=null!==a.Pa()?a.Pa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Ii:olympe.H.$.X.Sb.C.Qi:olympe.H.$.X.Sb.C.Xn;return'{"y":12,"t":'+JSON.stringify(dh(a))+',"d":'+b+'}'};olympe.H.$.X.Ce.la=[olympe.H.$.$c];olympe.H.$.X.Fc=function(){};olympe.H.$.X.Fc.prototype.constructor=olympe.H.$.X.Fc;olympe.H.$.X.Fc.prototype.ja=function(a){const b=null!==a.Pa()?a.Pa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Ii:olympe.H.$.X.Sb.C.Qi:olympe.H.$.X.Sb.C.Xn;return'{"y":11,"t":"'+a.R()+'","d":'+b+',"s":'+a.F+',"e":'+a.C+'}'};olympe.H.$.X.Fc.la=[olympe.H.$.$c];olympe.H.$.X.Sb=function(){};olympe.H.$.X.Sb.C={Xn:0,Ii:1,Qi:2};olympe.H.$.X.Sb.prototype.constructor=olympe.H.$.X.Sb;olympe.H.$.X.Sb.prototype.ja=function(a){const b=a.Pa()===olympe.dc.Aa.ORIGIN?olympe.H.$.X.Sb.C.Ii:olympe.H.$.X.Sb.C.Qi;return'{"y":10,"t":"'+a.R()+'","d":'+b+'}'};olympe.H.$.X.Sb.la=[olympe.H.$.$c];olympe.H.$.X.Kd=function(){};olympe.H.$.X.Kd.prototype.constructor=olympe.H.$.X.Kd;olympe.H.$.X.Kd.prototype.ja=function(a,b,c){var d=a.Md;const e=d.ma();var f=c.Cb[e];if(void 0===f)throw Error('No comparator registered for comparator: '+e);return'{"y":20,"o":'+f.ja(d,b,c)+(a.C?'':',"a":false')+'}'};olympe.H.$.X.Kd.la=[olympe.H.$.$c];olympe.H.$.X.Zd=function(){};olympe.H.$.X.Zd.prototype.constructor=olympe.H.$.X.Zd;olympe.H.$.X.Zd.prototype.ja=function(a,b){var c=a.start;c=c&&c.Af?'"$'+b.add(c)+'"':JSON.stringify(c);a=(a=a.C)&&a.Af?'"$'+b.add(a)+'"':JSON.stringify(a);return'{"y":22,"s":'+c+',"n":'+a+'}'};olympe.H.$.X.Zd.la=[olympe.H.$.$c];olympe.H.$.Cb={};olympe.H.$.Cb.Number=class{constructor(){}ja(a,b,c){return`{"y":11,"v":${Bi(c,a.C,b)}}`}};olympe.H.$.Cb.Number.la=[olympe.H.$.Oe];olympe.H.$.Cb.String=class{constructor(){}ja(a,b,c){return`{"y":10,"v":${Bi(c,a.C,b)}}`}};olympe.H.$.Cb.String.la=[olympe.H.$.Oe];olympe.H.$.V={};olympe.H.$.V.Wc=function(){};olympe.H.$.V.Wc.prototype.constructor=olympe.H.$.V.Wc;olympe.H.$.V.Wc.prototype.ja=function(a,b,c){const d=Bi(c,a.source,b);c=Bi(c,a.getValue(),b);a=Ci(a.G,b);return'{"y":20,"s":'+d+',"v":'+c+',"a":'+a+'}'};olympe.H.$.V.Wc.la=[olympe.H.$.$a];olympe.H.$.V.Ic=function(){};olympe.H.$.V.Ic.prototype.constructor=olympe.H.$.V.Ic;olympe.H.$.V.Ic.prototype.ja=function(a,b,c){const d=Bi(c,a.G,b);a=Bi(c,a.N,b);return'{"y":10,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Ic.la=[olympe.H.$.$a];olympe.H.$.V.ze=function(){};olympe.H.$.V.ze.prototype.constructor=olympe.H.$.V.ze;olympe.H.$.V.ze.prototype.ja=function(a,b,c){const d=Bi(c,a.G,b);a=Bi(c,a.N,b);return'{"y":11,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.ze.la=[olympe.H.$.$a];olympe.H.$.V.mf=class{ja(a){const b=Yg(a).map(d=>'"'+d+'"'),c=Zg(a).map(d=>d===olympe.dc.Aa.DESTINATION?'2':'1');a=a.G;return'{"y":81,"r":['+b.toString()+'],"d":['+c.toString()+']'+(0!==a.length?',"t":"'+a.toString()+'"':'')+'}'}};olympe.H.$.V.mf.la=[olympe.H.$.$a];olympe.H.$.V.nf=class{ja(a){return'{"y":80,"m":['+Array.from(a.G).map(b=>'"'+b+'"').toString()+']}'}};olympe.H.$.V.nf.la=[olympe.H.$.$a];olympe.H.$.V.nd=class{ja(a,b,c){return'{"y":30,"p":'+Ai(c,a.G,b)+'}'}};olympe.H.$.V.nd.la=[olympe.H.$.$a];olympe.H.$.V.wd=class{ja(a,b,c){c=Bi(c,a.source,b);const d=a.N;a=Ci(a.G,b);return'{"y":23,"s":'+c+',"r":"'+d+'","a":'+a+'}'}};olympe.H.$.V.wd.la=[olympe.H.$.$a];olympe.H.$.V.Ge=function(){};olympe.H.$.V.Ge.prototype.constructor=olympe.H.$.V.Ge;olympe.H.$.V.Ge.prototype.ja=function(a,b,c){var d=Bi(c,a.G,b);a=Bi(c,a.N,b);return'{"y":12,"l":'+d+',"r":'+a+'}'};olympe.H.$.V.Ge.la=[olympe.H.$.$a];olympe.H.$.na={};olympe.H.$.na.Oc=function(){};olympe.H.$.na.Oc.prototype.constructor=olympe.H.$.na.Oc;olympe.H.$.na.Oc.prototype.C=function(){};
804
+ olympe.H.$.na.Oc.prototype.ja=function(a,b,c){var d=Ci(a.$e,b),e=a.Od();e=e?',"b":'+Ci(e,b):'';if(a=a.Dg()){var f='[';for(let n=0,p=a.length;n<p;n++){var g=0===n?'':',';var h=c;var k=a[n],l=b;const q=k.ma(),r=h.X[q];if(void 0===r)throw Error('No serializer registered for transformer: '+q);h=r.ja(k,l,h);f+=g+h}b=',"q":'+(f+']')}else b='';return'{"y":'+this.C()+',"t":'+d+e+b+'}'};olympe.H.$.na.Oc.la=[olympe.H.$.zf];olympe.H.$.na.ue=function(){olympe.H.$.na.Oc.call(this)};olympe.H.$.na.ue.prototype=Object.create(olympe.H.$.na.Oc.prototype);olympe.H.$.na.ue.prototype.constructor=olympe.H.$.na.ue;olympe.H.$.na.ue.prototype.C=function(){return 13};olympe.H.$.na.Dd=class{ja(a,b){return'{"y":10,"v":'+Ci(a.value,b)+'}'}};olympe.H.$.na.Dd.la=[olympe.H.$.zf];olympe.H.$.na.je=function(){olympe.H.$.na.Oc.call(this)};olympe.H.$.na.je.prototype=Object.create(olympe.H.$.na.Oc.prototype);olympe.H.$.na.je.prototype.constructor=olympe.H.$.na.je;olympe.H.$.na.je.prototype.C=function(){return 14};olympe.H.$.na.le=function(){olympe.H.$.na.Oc.call(this)};olympe.H.$.na.le.prototype=Object.create(olympe.H.$.na.Oc.prototype);olympe.H.$.na.le.prototype.constructor=olympe.H.$.na.le;olympe.H.$.na.le.prototype.C=function(){return 11};olympe.H.$.na.pe=function(){olympe.H.$.na.Oc.call(this)};olympe.H.$.na.pe.prototype=Object.create(olympe.H.$.na.Oc.prototype);olympe.H.$.na.pe.prototype.constructor=olympe.H.$.na.pe;olympe.H.$.na.pe.prototype.C=function(){return 12};olympe.H.$.na.vf=class{ja(){return'{"y":19}'}};olympe.H.$.na.vf.la=[olympe.H.$.zf];olympe.H.rd={};function Di(a,b){a.L.info('Initializing SERVER layer');if(a.L.G()){const c=['Server layer parameters:'];b.forEach((d,e)=>{c.push(e+'="'+d+'"')});a.L.debug(c.join('\n\t'))}a.Da(olympe.H.Yc.cc,c=>{switch(c.c){case olympe.H.ka.nv:a.L.error('Unknown message sent to the server:',olympe.H.sa.F[c.s]);break;case olympe.H.ka.ft:a.L.error('Fatal error, the last message is probably too big according to the websocket config.'),a.C.forEach((d,e)=>{null!==d.Dn&&Ei(a,e,c.i)})}});b.get('autoConnect')&&(a.L.debug('Connecting automatically'),
805
+ a.connect());olympe.D.kn(a.U.Fb(),()=>{a.Ye.forEach(c=>c());Ib(a.ii.bind(a),a.Rx);Ib(a.He.bind(a),a.Ef)},()=>{a.aa=null;a.Ve.forEach(c=>c(a.G[2]));a.He()});a.L.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
806
+ function Fi(a,b){if(a.F!==b)switch(a.L.debug('State change '+a.F+' --\x3e '+b),a.F=b,b){case olympe.H.sa.C.CONNECTING:break;case olympe.H.sa.C.vi:a.U.update(olympe.D.qa.F);break;case olympe.H.sa.C.Zg:a.G[0]=0;a.G[1]=0;a.connect();break;case olympe.H.sa.C.cc:a.L.error('Connection to server',a.oa.C(),'aborted due to error');a.U.update(olympe.D.qa.C);break;case olympe.H.sa.C.hg:a.U.update(olympe.D.qa.C);a.wb&&(a.L.info('Disconnected, will try to auto reconnect in',a.Lb,'ms'),Hb(()=>{a.connect()},a.Lb));
805
807
  break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
806
- function Ci(a,b){const c=olympe.H.sa.L.Ri,d=olympe.H.sa.L.ku;return e=>{if(null!==e&&void 0!==e){var f=null,g=e.s;if(g===d)a.N.debug(`Try to unsubscribe multiple times. This could be because you logged out before unsubscribe. ${e.info.error.reason}`);else if(void 0!==g&&g!==c){f=void 0!==olympe.H.sa.F[g]?`Status code = ${g} [${olympe.H.sa.F[g]}]`:`Status code = ${g}`;g=e.info;if(void 0!==g&&void 0!==g.error){var h=g.error.reason;'string'===typeof h&&0<h.length&&(f+=`\nReason:\n${g.error.reason}`);
807
- h=g.error.detailedReason;'string'===typeof h&&0<h.length&&(f+=`\nDetails:\n${g.error.detailedReason}`)}f=Error('Rejected by orchestrator:\n'+f)}b(f,e)}}}function Di(a,b,c){var d=c.message;a.N.G()&&a.N.debug('>',Ei(d));(d=a.L.send(JSON.stringify(d)))?null===c.Vh?a.F.delete(b):c.Dn=Date.now():Bi(a,olympe.H.sa.C.Yg);return d}
808
- function Ei(a){var b=JSON.parse(JSON.stringify(a));a=olympe.W.Sr;const c=b.messageFamily,d=a(olympe.H.Yc,c),e=b.payload;b='';switch(c){case olympe.H.Yc.ui:b=a(olympe.dc.ga.ka,e.c);break;case olympe.H.Yc.uc:b=a(olympe.H.ka,e.c);break;case olympe.H.Yc.qf:b=a(olympe.H.pa.Ua.C,e.c);break;case olympe.H.Yc.Di:2===e.c&&(b=a(olympe.H.sa.G,e.status))}a=`${d} message`;b&&0<b.length&&(a+=` with payload "${b}"`);return a}
809
- function Ai(a,b,c){if(a.F.has(b)){const {Vh:d}=a.F.get(b);a.F.delete(b);d&&d({s:23,info:c})}}function Fi(a,b){a.N.error(b);Bi(a,olympe.H.sa.C.uc)}function Gi(a,b,c){a.N.info('Connected to',a.oa.C(),' | ',b?'server version:'+b:'',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.F).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!Di(a,d,e))return;Bi(a,olympe.H.sa.C.ti)}
810
- olympe.H.rd.sa=class{constructor(a,b,c,d){this.N=a;this.ad=b;this.oa=c;this.L=null;this.config=d;this.Lb=this.config.get('reconnectionDelay');this.Ox=this.config.get('pingInterval');this.Wx=this.Lb/2;this.wb=d.get('autoConnect');this.jy=d.get('retryHttpOverload');this.Ge=d.get('messageTimeout');this.ja=Ja(d.get('clientVersion'));this.Ya=Ja(d.get('serverVersion'));this.C=olympe.H.sa.C.INIT;this.wc=d.get('getContextMode');this.sh=1;this.aa=null;this.G=[0,0,0];this.Sa=new Map;this.U=olympe.D.Uc(olympe.D.qa,
811
- 'Server is online');this.Xe=new Map;this.Df=new Map;this.F=new Map;this.vn=new Map;zi(this,d)}ab(){return this.C===olympe.H.sa.C.ti}connect(){const a=olympe.H.sa.C.CONNECTING,b=olympe.H.sa.C.ti,c=olympe.H.sa.C.gg,d=olympe.H.sa.C.Yg,e=olympe.H.sa.C.uc;null!==this.L&&(this.L.U(null),this.L.close());this.wb=!0;this.N.log(`Asking NET layer for a connection to ${Kb(this.oa)}:${this.oa.port}...`);this.L=this.ad.aa(this.oa);this.L.ja(this.Ib.bind(this));this.L.aa(this.Lc.bind(this));this.L.U(()=>{this.L=
812
- null;this.C===b?Bi(this,d):this.C!==e&&Bi(this,c)});this.C!==d&&Bi(this,a)}disconnect(){const a=olympe.H.sa.C.CONNECTING;if(this.C===olympe.H.sa.C.ti||this.C===a)this.wb=!1,Bi(this,olympe.H.sa.C.gg)}Ue(a){const b=olympe.W.fc();this.Xe.set(b,a);olympe.D.bb(this.U)===olympe.D.qa.F&&a()}Rf(a){var b;void 0===b&&(b=olympe.W.fc());this.Df.set(b,a);olympe.D.bb(this.U)===olympe.D.qa.C&&a(this.G[2])}Ib(){this.N.debug('Websocket connected, sending handshake. Client version:',Ka(this.ja),'subscribeEverything:',
813
- this.wc?'NO':'YES');this.Y(olympe.H.Yc.Di,{c:olympe.H.ka.Di,cv:Ka(this.ja),m:this.wc?0:1,s:this.aa},this.al.bind(this))}Y(a,b,c){const d=this.sh;this.sh++;b={message:{seqId:d,messageFamily:a,payload:b},Vh:c?Ci(this,c):null,Dn:null};this.F.set(d,b);c=[olympe.H.sa.C.CONNECTING,olympe.H.sa.C.Yg];(this.ab()||a===olympe.H.Yc.Di&&c.includes(this.C))&&Di(this,d,b)}ac(a,b,c,d,e,f){c&&''!==c||this.N.warn('Trying to send an http request with an invalid authorizationToken');const g=Nb(a);if(e){g.method=olympe.net.cb.$d.jm;
814
- e=d?e:{messageFamily:b,seqId:1,payload:e};const k=JSON.stringify(e);g.body=k;Ob(g,{'Content-Type':'application/json'});this.N.log('HTTP POST >',Ei(e))}else this.N.log('HTTP GET call to',a);g.F=olympe.net.cb.ResponseType.zk;Ob(g,{Authorization:c});const h=()=>{this.ad.C(g,k=>{switch(k.Rd()){case olympe.net.cb.hd.Hh:case olympe.net.cb.hd.wl:case olympe.net.cb.hd.Cj:k=k.getData();if(b!==olympe.H.Yc.ui||d){f&&f(null,k);break}k=this.Lc(k);f&&f(k);k&&this.N.error(k.message);break;case olympe.net.cb.hd.Ou:Hb(h,
815
- this.jy);break;case olympe.net.cb.hd.Ds:this.N.debug(`HTTP request canceled (${a}).`);f&&f(null);break;case olympe.net.cb.hd.gv:k=Error(`HTTP request authorization denied: ${a}`);f&&f(k);break;default:k=Error(`Server is currently not available, http status: ${k.Rd()}`),f&&f(k)}})};h()}Da(a,b,c){void 0===c&&(c=olympe.W.fc());let d=this.Sa.get(a);void 0===d&&(d=new Map,this.Sa.set(a,d));d.set(c,b)}yd(a,b){a=this.Sa.get(a);void 0!==a&&a.delete(b)}al(a,b){if(a)Fi(this,'Error in receiving handshake response: '+
816
- a.message);else{this.N.debug('Handshake response received');var c=olympe.H.sa.G;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.wt:Fi(this,`Framework version (${Ka(this.ja)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case c.$u:Fi(this,`Framework version (${Ka(this.ja)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.jt:Fi(this,'Handshake failed. See orchestrator logs for more info.');
817
- return}if(this.Ya.qb(olympe.W.Sh.C))this.N.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=Ja(a);if(e.zj(this.Ya)){Fi(this,`Framework v${Ka(this.ja)} is expecting Orchestrator to be at least in v${Ka(this.Ya)}`);return}this.N.log('Handshake successful. Orchestrator version: ',e,'required:',Ka(this.Ya))}catch(f){Fi(this,f);return}e=olympe.H.sa.C.gg;if(this.C===olympe.H.sa.C.Yg&&null!==this.aa&&this.aa!==b.sessionId)this.N.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),
818
- Bi(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.vn.set(f,g);this.aa=b.sessionId||null;Gi(this,a,d)}}}gi(){this.G[0]-this.G[1]>this.Wx?(this.N.debug('Ping did not get answer, try to reconnect'),Bi(this,olympe.H.sa.C.Yg)):(this.N.debug('Sending Ping'),this.G[0]=Date.now(),this.L.send('ping')||(this.N.debug('Impossible to send ping, try to reconnect'),Bi(this,olympe.H.sa.C.Yg)))}Lc(a){this.G[2]=Date.now();if(a.startsWith('pong'))return this.G[1]=this.G[2],null;try{var b=
819
- JSON.parse(a)}catch(d){return this.N.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.N.G()&&this.N.debug('<',Ei(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.F.has(a)){const {Vh:d}=this.F.get(a);this.F.delete(a);d&&d(b)}a=this.Sa.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}be(){const a=Date.now();for(const [b,{Dn:c}]of this.F)null!==c&&a-c>this.Ge&&(this.N.warn(`No response was received from the server for the seqId = ${b}`),
820
- Ai(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};olympe.H.sa.L={Ri:0,ku:18,iA:23};
808
+ function Gi(a,b){const c=olympe.H.sa.N.Ti,d=olympe.H.sa.N.nu;return e=>{if(null!==e&&void 0!==e){var f=null,g=e.s;if(g===d)a.L.debug(`Try to unsubscribe multiple times. This could be because you logged out before unsubscribe. ${e.info.error.reason}`);else if(void 0!==g&&g!==c){f=void 0!==olympe.H.sa.F[g]?`Status code = ${g} [${olympe.H.sa.F[g]}]`:`Status code = ${g}`;g=e.info;if(void 0!==g&&void 0!==g.error){var h=g.error.reason;'string'===typeof h&&0<h.length&&(f+=`\nReason:\n${g.error.reason}`);
809
+ h=g.error.detailedReason;'string'===typeof h&&0<h.length&&(f+=`\nDetails:\n${g.error.detailedReason}`)}f=Error('Rejected by orchestrator:\n'+f)}b(f,e)}}}function Hi(a,b,c){var d=c.message;a.L.G()&&a.L.debug('>',Ii(d));(d=a.N.send(JSON.stringify(d)))?null===c.Xh?a.C.delete(b):c.Dn=Date.now():Fi(a,olympe.H.sa.C.Zg);return d}
810
+ function Ii(a){var b=JSON.parse(JSON.stringify(a));a=olympe.W.Tr;const c=b.messageFamily,d=a(olympe.H.Yc,c),e=b.payload;b='';switch(c){case olympe.H.Yc.wi:b=a(olympe.dc.ga.ka,e.c);break;case olympe.H.Yc.cc:b=a(olympe.H.ka,e.c);break;case olympe.H.Yc.rf:b=a(olympe.H.pa.Ua.C,e.c);break;case olympe.H.Yc.Fi:2===e.c&&(b=a(olympe.H.sa.G,e.status))}a=`${d} message`;b&&0<b.length&&(a+=` with payload "${b}"`);return a}
811
+ function Ei(a,b,c){if(a.C.has(b)){const {Xh:d}=a.C.get(b);a.C.delete(b);d&&d({s:23,info:c})}}function Ji(a,b){a.L.error(b);Fi(a,olympe.H.sa.C.cc)}function Ki(a,b,c){a.L.info('Connected to',a.oa.C(),' | ',b?'server version:'+b:'',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.C).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!Hi(a,d,e))return;Fi(a,olympe.H.sa.C.vi)}
812
+ olympe.H.rd.sa=class{constructor(a,b,c,d){this.L=a;this.ad=b;this.oa=c;this.N=null;this.config=d;this.Lb=this.config.get('reconnectionDelay');this.Rx=this.config.get('pingInterval');this.Zx=this.Lb/2;this.wb=d.get('autoConnect');this.my=d.get('retryHttpOverload');this.Ef=d.get('messageTimeout');this.ha=Ja(d.get('clientVersion'));this.Ya=Ja(d.get('serverVersion'));this.F=olympe.H.sa.C.INIT;this.wc=d.get('getContextMode');this.th=1;this.aa=null;this.G=[0,0,0];this.Sa=new Map;this.U=olympe.D.Uc(olympe.D.qa,
813
+ 'Server is online');this.Ye=new Map;this.Ve=new Map;this.C=new Map;this.vn=new Map;Di(this,d)}ab(){return this.F===olympe.H.sa.C.vi}connect(){const a=olympe.H.sa.C.CONNECTING,b=olympe.H.sa.C.vi,c=olympe.H.sa.C.hg,d=olympe.H.sa.C.Zg,e=olympe.H.sa.C.cc;null!==this.N&&(this.N.U(null),this.N.close());this.wb=!0;this.L.log(`Asking NET layer for a connection to ${Kb(this.oa)}:${this.oa.port}...`);this.N=this.ad.aa(this.oa);this.N.ha(this.Ib.bind(this));this.N.aa(this.Lc.bind(this));this.N.U(()=>{this.N=
814
+ null;this.F===b?Fi(this,d):this.F!==e&&Fi(this,c)});this.F!==d&&Fi(this,a)}disconnect(){const a=olympe.H.sa.C.CONNECTING;if(this.F===olympe.H.sa.C.vi||this.F===a)this.wb=!1,Fi(this,olympe.H.sa.C.hg)}be(a){const b=olympe.W.hc();this.Ye.set(b,a);olympe.D.bb(this.U)===olympe.D.qa.F&&a()}Sf(a){var b;void 0===b&&(b=olympe.W.hc());this.Ve.set(b,a);olympe.D.bb(this.U)===olympe.D.qa.C&&a(this.G[2])}Ib(){this.L.debug('Websocket connected, sending handshake. Client version:',Ka(this.ha),'subscribeEverything:',
815
+ this.wc?'NO':'YES');this.Y(olympe.H.Yc.Fi,{c:olympe.H.ka.Fi,cv:Ka(this.ha),m:this.wc?0:1,s:this.aa},this.bl.bind(this))}Y(a,b,c){const d=this.th;this.th++;b={message:{seqId:d,messageFamily:a,payload:b},Xh:c?Gi(this,c):null,Dn:null};this.C.set(d,b);c=[olympe.H.sa.C.CONNECTING,olympe.H.sa.C.Zg];(this.ab()||a===olympe.H.Yc.Fi&&c.includes(this.F))&&Hi(this,d,b)}ac(a,b,c,d,e,f){c&&''!==c||this.L.warn('Trying to send an http request with an invalid authorizationToken');const g=Nb(a);if(e){g.method=olympe.net.cb.$d.jm;
816
+ e=d?e:{messageFamily:b,seqId:1,payload:e};const k=JSON.stringify(e);g.body=k;Ob(g,{'Content-Type':'application/json'});this.L.log('HTTP POST >',Ii(e))}else this.L.log('HTTP GET call to',a);g.F=olympe.net.cb.ResponseType.Ak;Ob(g,{Authorization:c});const h=()=>{this.ad.C(g,k=>{switch(k.Rd()){case olympe.net.cb.hd.Jh:case olympe.net.cb.hd.xl:case olympe.net.cb.hd.Ej:k=k.getData();if(b!==olympe.H.Yc.wi||d){f&&f(null,k);break}k=this.Lc(k);f&&f(k);k&&this.L.error(k.message);break;case olympe.net.cb.hd.Ru:Hb(h,
817
+ this.my);break;case olympe.net.cb.hd.Es:this.L.debug(`HTTP request canceled (${a}).`);f&&f(null);break;case olympe.net.cb.hd.kv:k=Error(`HTTP request authorization denied: ${a}`);f&&f(k);break;default:k=Error(`Server is currently not available, http status: ${k.Rd()}`),f&&f(k)}})};h()}Da(a,b,c){void 0===c&&(c=olympe.W.hc());let d=this.Sa.get(a);void 0===d&&(d=new Map,this.Sa.set(a,d));d.set(c,b)}yd(a,b){a=this.Sa.get(a);void 0!==a&&a.delete(b)}bl(a,b){if(a)Ji(this,'Error in receiving handshake response: '+
818
+ a.message);else{this.L.debug('Handshake response received');var c=olympe.H.sa.G;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.zt:Ji(this,`Framework version (${Ka(this.ha)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case c.dv:Ji(this,`Framework version (${Ka(this.ha)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.mt:Ji(this,'Handshake failed. See orchestrator logs for more info.');
819
+ return}if(this.Ya.qb(olympe.W.Uh.C))this.L.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=Ja(a);if(e.Bj(this.Ya)){Ji(this,`Framework v${Ka(this.ha)} is expecting Orchestrator to be at least in v${Ka(this.Ya)}`);return}this.L.log('Handshake successful. Orchestrator version: ',e,'required:',Ka(this.Ya))}catch(f){Ji(this,f);return}e=olympe.H.sa.C.hg;if(this.F===olympe.H.sa.C.Zg&&null!==this.aa&&this.aa!==b.sessionId)this.L.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),
820
+ Fi(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.vn.set(f,g);this.aa=b.sessionId||null;Ki(this,a,d)}}}ii(){this.G[0]-this.G[1]>this.Zx?(this.L.debug('Ping did not get answer, try to reconnect'),Fi(this,olympe.H.sa.C.Zg)):(this.L.trace('Sending Ping'),this.G[0]=Date.now(),this.N.send('ping')||(this.L.debug('Impossible to send ping, try to reconnect'),Fi(this,olympe.H.sa.C.Zg)))}Lc(a){this.G[2]=Date.now();if(a.startsWith('pong'))return this.G[1]=this.G[2],null;try{var b=
821
+ JSON.parse(a)}catch(d){return this.L.error('Unable to parse response from server: '+d.toString()),Error('Unable to parse response from server')}this.L.G()&&this.L.debug('<',Ii(b));a=b.seqId;const c=b.messageFamily;b=b.payload;if(this.C.has(a)){const {Xh:d}=this.C.get(a);this.C.delete(a);d&&d(b)}a=this.Sa.get(c);if(void 0!==a)for(const d of a.values())d(b);return null}He(){const a=Date.now();for(const [b,{Dn:c}]of this.C)null!==c&&a-c>this.Ef&&(this.L.warn(`No response was received from the server for the seqId = ${b}`),
822
+ Ei(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};olympe.H.sa.N={Ti:0,nu:18,jA:23};
821
823
  olympe.H.sa.F={0:'OK',1:'SRP Authentication First Step Failed',2:'SRP Authentication Last Step Failed',3:'SRP Authentication Bad Credentials',4:'AutoLogin Authentication Failed',5:'AutoLogin Authentication Token Invalid',6:'Logout Failed',7:'SAML Request Generation Failed',8:'SAML Authentication Save Failed',9:'Invalid SAML Response',10:'SAML User Not Found',11:'Transaction Failed',12:'GetContext Failed',13:'Notification Failed',15:'FileService Clean Failed',17:'Try to subscribe multiple times',18:'Try to unsubscribe multiple times',
822
- 21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.H.rd.sa.la=[olympe.H.sa];olympe.H.P={xa:'server.Manager',$n:'server.bus.Manager',Ea:'server.Logger',Jd:'server.Source',Rg:'server.FileSource',up:'server.ImportFileSvcHttpRequest',Wn:'server.BackupSvcHttpRequest',gq:'server.OpenIDSvcHttpRequest',Wo:'server.GetContextSvcPathRequest',rp:'server.ImplicitGDSvcPathRequest',Io:'server.ExplicitGDSvcPathRequest',er:'server.TransactionOverHttpPathRequest',qr:'server.UserTokenRequest',mr:'server.UserTagRequest',kr:'server.UserRolesRequest',Gq:'server.RoleMembersRequest',Bh:'server.IOUrlsProvider',
823
- Oo:'server.fileSvcUrl',mq:'communication.peerFileSvcUrl'};olympe.H.sd={mi:'server.connectors.Auth',OA:'server.connectors.Signaling'};
824
- olympe.H.Config={ud:'server.host',Id:'server.port',xd:'server.ssl',Nn:'server.autoConnect',zq:'server.reconnectionDelay',qq:'server.pingInterval',Am:'server.messageTimeout',Eq:'server.retryHttpOnOverload',io:'server.clientVersion',Mq:'server.serverVersion',Zn:'bus.host',ao:'bus.path',bo:'bus.port',co:'bus.vhost',lg:'bus.keepalive',Ju:'bus.reschedulePings',Hs:'bus.clientId',Fs:'bus.clean',Fu:'bus.reconnectPeriod',Js:'bus.connectTimeout',br:'bus.tokenTimeout',ir:'bus.username',kq:'bus.password',Bu:'bus.queueQoSZero'};
825
- olympe.H.ob={Cd:'server.basePath',ur:'server.wsPath',Mo:'server.filePath',tp:'server.importFilePath',Vn:'server.backupSvcPath',fq:'server.openIDSvcPath',Vo:'server.GetContextSvcPath',sp:'server.ImplicitGraphdefSvcPath',Jo:'server.ExplicitGraphdefSvcPath',dr:'server.TransactionOverHttpPath',nr:'server.userTokenSvcPath',lr:'server.userTagPath',jr:'server.userRolesPath',Fq:'server.roleMembersPath',im:'communication.peerFileSvcPath'};
826
- olympe.T.config(function(a){var b='object'===typeof window&&window.location&&window.location.hostname||'localhost';const c='localhost'===b;D(a,olympe.H.Config.ud,b);D(a,olympe.H.Config.Id,c?8080:443);D(a,olympe.H.Config.xd,'localhost'!==b);D(a,olympe.H.ob.Cd,'OlympeServer');D(a,olympe.H.ob.ur,'websocket');D(a,olympe.H.ob.Mo,'rest/filesvc');D(a,olympe.H.ob.tp,'rest/importsvc');D(a,olympe.H.ob.Vn,'rest/backupsvc');D(a,olympe.H.ob.fq,'rest/openid');D(a,olympe.H.ob.Vo,'rest/initialData');D(a,olympe.H.ob.sp,
827
- 'rest/querysvc/graphDefImplicit');D(a,olympe.H.ob.Jo,'rest/querysvc/graphDefExplicit');D(a,olympe.H.ob.dr,'rest/transaction');D(a,olympe.H.ob.nr,'rest/token');D(a,olympe.H.ob.lr,'rest/authorization/getUserTag');D(a,olympe.H.ob.jr,'rest/authorization/getUserRoles');D(a,olympe.H.ob.Fq,'rest/authorization/roleMembers');D(a,olympe.H.Config.Nn,!0);D(a,olympe.H.Config.zq,5E3);D(a,olympe.H.Config.qq,5E3);D(a,olympe.H.Config.Am,15E3);D(a,olympe.H.Config.Eq,5E3);D(a,olympe.H.Config.Mq,'6.3.1');D(a,olympe.H.Config.Zn,
828
- '');D(a,olympe.H.Config.ao,c?'':'/mqtt');D(a,olympe.H.Config.bo,c?15675:443);D(a,olympe.H.Config.co,c?'/':'');D(a,olympe.H.Config.ir,'guest');D(a,olympe.H.Config.kq,'guest');D(a,olympe.H.Config.lg,30);D(a,olympe.H.Config.br,3E5);D(a,olympe.H.ob.im,'nodes/files');b=a.getParameter(olympe.Fg.Config.So);if(void 0!==b)ta(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');C(a,olympe.H.P.Ea,[olympe.ra.P.xa],d=>d.Rc('communication'));C(a,'server.WebSocketRequest',
829
- [new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.ur)],(d,e,f,g,h)=>new olympe.net.Gk(d,e,(g+'/'+h).replace(/\/+/g,'/').replace(/\/$/,''),f));b=(d,e,f,g,h)=>(new olympe.net.Yj(d,e,`${g}${h?'/'+h:''}`.replace(/\/+/g,'/').replace(/\/$/,''),f)).C();C(a,olympe.H.P.up,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),
824
+ 21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.H.rd.sa.la=[olympe.H.sa];olympe.H.P={xa:'server.Manager',$n:'server.bus.Manager',Ea:'server.Logger',Jd:'server.Source',Sg:'server.FileSource',up:'server.ImportFileSvcHttpRequest',Wn:'server.BackupSvcHttpRequest',gq:'server.OpenIDSvcHttpRequest',Wo:'server.GetContextSvcPathRequest',rp:'server.ImplicitGDSvcPathRequest',Io:'server.ExplicitGDSvcPathRequest',fr:'server.TransactionOverHttpPathRequest',rr:'server.UserTokenRequest',nr:'server.UserTagRequest',lr:'server.UserRolesRequest',Hq:'server.RoleMembersRequest',Ch:'server.IOUrlsProvider',
825
+ Oo:'server.fileSvcUrl',mq:'communication.peerFileSvcUrl'};olympe.H.sd={oi:'server.connectors.Auth',PA:'server.connectors.Signaling'};
826
+ olympe.H.Config={ud:'server.host',Id:'server.port',xd:'server.ssl',Nn:'server.autoConnect',Aq:'server.reconnectionDelay',qq:'server.pingInterval',Am:'server.messageTimeout',Fq:'server.retryHttpOnOverload',io:'server.clientVersion',Nq:'server.serverVersion',Zn:'bus.host',ao:'bus.path',bo:'bus.port',co:'bus.vhost',mg:'bus.keepalive',Mu:'bus.reschedulePings',Is:'bus.clientId',Gs:'bus.clean',Iu:'bus.reconnectPeriod',Ls:'bus.connectTimeout',cr:'bus.tokenTimeout',jr:'bus.username',kq:'bus.password',Eu:'bus.queueQoSZero'};
827
+ olympe.H.ob={Cd:'server.basePath',vr:'server.wsPath',Mo:'server.filePath',tp:'server.importFilePath',Vn:'server.backupSvcPath',fq:'server.openIDSvcPath',Vo:'server.GetContextSvcPath',sp:'server.ImplicitGraphdefSvcPath',Jo:'server.ExplicitGraphdefSvcPath',er:'server.TransactionOverHttpPath',qr:'server.userTokenSvcPath',mr:'server.userTagPath',kr:'server.userRolesPath',Gq:'server.roleMembersPath',im:'communication.peerFileSvcPath'};
828
+ olympe.T.config(function(a){var b='object'===typeof window&&window.location&&window.location.hostname||'localhost';const c='localhost'===b;D(a,olympe.H.Config.ud,b);D(a,olympe.H.Config.Id,c?8080:443);D(a,olympe.H.Config.xd,'localhost'!==b);D(a,olympe.H.ob.Cd,'OlympeServer');D(a,olympe.H.ob.vr,'websocket');D(a,olympe.H.ob.Mo,'rest/filesvc');D(a,olympe.H.ob.tp,'rest/importsvc');D(a,olympe.H.ob.Vn,'rest/backupsvc');D(a,olympe.H.ob.fq,'rest/openid');D(a,olympe.H.ob.Vo,'rest/initialData');D(a,olympe.H.ob.sp,
829
+ 'rest/querysvc/graphDefImplicit');D(a,olympe.H.ob.Jo,'rest/querysvc/graphDefExplicit');D(a,olympe.H.ob.er,'rest/transaction');D(a,olympe.H.ob.qr,'rest/token');D(a,olympe.H.ob.mr,'rest/authorization/getUserTag');D(a,olympe.H.ob.kr,'rest/authorization/getUserRoles');D(a,olympe.H.ob.Gq,'rest/authorization/roleMembers');D(a,olympe.H.Config.Nn,!0);D(a,olympe.H.Config.Aq,5E3);D(a,olympe.H.Config.qq,5E3);D(a,olympe.H.Config.Am,15E3);D(a,olympe.H.Config.Fq,5E3);D(a,olympe.H.Config.Nq,'6.3.1');D(a,olympe.H.Config.Zn,
830
+ '');D(a,olympe.H.Config.ao,c?'':'/mqtt');D(a,olympe.H.Config.bo,c?15675:443);D(a,olympe.H.Config.co,c?'/':'');D(a,olympe.H.Config.jr,'guest');D(a,olympe.H.Config.kq,'guest');D(a,olympe.H.Config.mg,30);D(a,olympe.H.Config.cr,3E5);D(a,olympe.H.ob.im,'nodes/files');b=a.getParameter(olympe.Gg.Config.So);if(void 0!==b)ta(a,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');C(a,olympe.H.P.Ea,[olympe.ra.P.xa],d=>d.Rc('communication'));C(a,'server.WebSocketRequest',
831
+ [new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.vr)],(d,e,f,g,h)=>new olympe.net.Hk(d,e,(g+'/'+h).replace(/\/+/g,'/').replace(/\/$/,''),f));b=(d,e,f,g,h)=>(new olympe.net.$j(d,e,`${g}${h?'/'+h:''}`.replace(/\/+/g,'/').replace(/\/$/,''),f)).C();C(a,olympe.H.P.up,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),
830
832
  new olympe.T.fa(olympe.H.ob.tp)],b);C(a,olympe.H.P.Wn,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Vn)],b);C(a,olympe.H.P.gq,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.fq)],b);C(a,olympe.H.P.Wo,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),
831
- new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Vo)],b);C(a,olympe.H.P.rp,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.sp)],b);C(a,olympe.H.P.Io,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Jo)],b);C(a,olympe.H.P.er,
832
- [new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.dr)],b);C(a,olympe.H.P.qr,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.nr)],b);C(a,olympe.H.P.mr,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),
833
- new olympe.T.fa(olympe.H.ob.lr)],b);C(a,olympe.H.P.kr,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.jr)],b);C(a,olympe.H.P.Gq,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Fq)],b);C(a,olympe.H.P.Oo,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),
834
- new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Mo)],b);C(a,olympe.H.P.mq,[new olympe.T.fa(olympe.net.Config.Jl),new olympe.T.fa(olympe.net.Config.Kl),new olympe.T.fa(olympe.net.Config.mp),new olympe.T.fa(olympe.H.ob.im)],b);C(a,'server.ManagerConfig',[new olympe.T.fa(olympe.H.Config.Nn),new olympe.T.fa(olympe.H.Config.zq),new olympe.T.fa(olympe.H.Config.qq),new olympe.T.fa(olympe.H.Config.Am),new olympe.T.fa(olympe.H.Config.io),new olympe.T.fa(olympe.H.Config.Mq),
835
- new olympe.T.fa(olympe.dc.Config.$g),new olympe.T.fa(olympe.H.Config.Eq)],(...d)=>{const e='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),f=new Map;d.forEach((g,h)=>f.set(e[h],g));return f});C(a,'server.bus.ManagerConfig',[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Zn),new olympe.T.fa(olympe.H.Config.ao),new olympe.T.fa(olympe.H.Config.bo),new olympe.T.fa(olympe.H.Config.co),new olympe.T.fa(olympe.H.Config.ir),
836
- new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.Config.lg),new olympe.T.fa(olympe.H.Config.Ju),new olympe.T.fa(olympe.H.Config.Hs),new olympe.T.fa(olympe.H.Config.Fs),new olympe.T.fa(olympe.H.Config.Fu),new olympe.T.fa(olympe.H.Config.Js),new olympe.T.fa(olympe.H.Config.kq),new olympe.T.fa(olympe.H.Config.Bu),new olympe.T.fa(olympe.H.Config.Am),new olympe.T.fa(olympe.H.Config.br)],(d,e,f,g,h,k,l,...n)=>{e=`${l?'wss://':'ws://'}${e||d}:${g}${f}/ws`;const p='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout password queueQoSZero messageTimeout tokenTimeout'.split(' ');
837
- n=n.reduce((q,r,t)=>{q[p[t]]=r;return q},{});n.username=`${h||d.split('.')[0]}:${k}`;d=new Map;d.set('url',e);d.set('connectionOptions',n);return d});A(a,olympe.H.P.xa,olympe.H.rd.sa,olympe.H.P.Ea,olympe.net.P.xa,'server.WebSocketRequest','server.ManagerConfig');A(a,olympe.H.sd.mi,olympe.H.pa.Ua,olympe.H.P.Ea,olympe.H.P.xa,olympe.H.P.qr,olympe.H.P.mr,olympe.H.P.kr,olympe.H.P.Gq,olympe.H.P.gq,olympe.auth.P.pk,olympe.ic.P.ck);A(a,olympe.H.P.$n,olympe.H.Ba.sa,olympe.H.P.Ea,olympe.net.P.xa,olympe.auth.P.xa,
838
- 'server.bus.ManagerConfig');ra(a,olympe.auth.sd.xa,olympe.H.sd.mi);ra(a,olympe.auth.sd.Jp,olympe.H.sd.mi);ra(a,olympe.auth.sd.Ee,olympe.H.sd.mi);ra(a,olympe.auth.sd.Oe,olympe.H.sd.mi);A(a,olympe.H.P.Rg,olympe.H.Tj,olympe.H.P.Ea,olympe.net.P.xa,olympe.auth.P.xa,olympe.H.P.Oo,olympe.H.P.mq);ra(a,olympe.Za.P.Rg,olympe.H.P.Rg);C(a,olympe.H.P.Jd,[olympe.ra.P.xa,olympe.H.P.xa,olympe.auth.P.xa,olympe.Za.P.Rg,olympe.H.P.Wo,olympe.H.P.rp,olympe.H.P.Io,olympe.H.P.er],(d,e,f,g,h,k,l,n)=>new olympe.H.bh(d.Rc('server.source'),
839
- e,f,g,[h,k,l,n]));A(a,olympe.H.P.Bh,olympe.H.Zj,olympe.H.P.up,olympe.H.P.Wn);ra(a,olympe.dc.da.P.Bh,olympe.H.P.Bh);ra(a,olympe.Za.P.um,olympe.H.P.Jd)},'olympe.communication');olympe.T.run([olympe.H.P.$n],a=>{olympe.H.Ba.Tc=()=>a});olympe.sc={};olympe.sc.P={Ea:'sc.Logger',sm:'sc.RootContext'};olympe.sc.Config={ff:'sc.app',dg:'sc.debug',Ts:'sc.disableTheme',PRODUCTION:'sc.production',eq:'sc.onstartTimeout',Dq:'sc.remoteActionTimeout',bq:'sc.offlineStart',hu:'google.apikey'};
840
- olympe.T.config(a=>{D(a,olympe.sc.Config.ff,'');D(a,olympe.sc.Config.bq,!1);D(a,olympe.sc.Config.dg,!1);D(a,olympe.sc.Config.Ts,!1);D(a,olympe.sc.Config.PRODUCTION,!1);D(a,olympe.sc.Config.eq,2E4);D(a,olympe.sc.Config.hu,'AIzaSyD0rTnF3Tq-ZjgdaqyvC8Jg-RSgpZM2jBU');D(a,olympe.sc.Config.Dq,1E4);C(a,olympe.sc.P.Ea,[olympe.ra.P.xa],b=>b.Rc('sc'));C(a,olympe.sc.P.sm,[new olympe.T.fa(olympe.sc.Config.PRODUCTION),new olympe.T.fa(olympe.sc.Config.eq)],b=>{const c=new olympe.sc.Ta('root','root',null);olympe.sc.ks=
841
- c;c.set(olympe.sc.Ta.ig.PRODUCTION,b);return c})},'olympe.sc');olympe.T.run([olympe.sc.P.sm],a=>{olympe.gj().ctx=a});olympe.sc.mn=()=>null!==olympe.dc.Oa().hc(void 0,olympe.sc.Runnable.F.Gc());olympe.sc.IC=(a,b,c,d)=>{c=a.create(olympe.sc.oc).setProperty(olympe.sc.oc.C,c||null).setProperty(olympe.sc.oc.L,d||null);a.Ra(olympe.sc.oc.F,c,b);a.Ra(olympe.dc.CloudObject.containsRel,b,c);return c.R()};olympe.sc.hh=a=>{a=olympe.dc.W.Vb.hh(a);return a instanceof olympe.sc.Ce?a.C():a};olympe.sc.XC=a=>{a=olympe.dc.CloudObject.get(a.tag);return a instanceof olympe.sc.Ce?a.C():a};
842
- olympe.sc.UC=function(a){const b=olympe.dm.Qb.C.Gc(),c=olympe.dc.CloudObject.containsRel.Gc();var d=olympe.dc.wa(a);if(void 0===d)return[];a=olympe.dc.Oa();var e=a.model(d);const f=[],g=[];let h=[];if(a.Tf(e,olympe.dm.Qb))h.push(d);else{for(e=[];null===a.hc(d,b);){e.push(d);const k=a.hc(d,c);if(null===k)return olympe.ra.Xa('sc').warn(`Object ${d} has no container`),[];k===a.hc(d,olympe.dc.CloudObject.instancesRel)?(f.push(d),d=a.hc(k,c)):d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
843
- }g.push(d);h.push(a.hc(g[0],b))}h=h.concat(a.Pf(h[0],olympe.dm.Qb.Ib));h=h.concat(a.Pf(h[h.length-1],olympe.dm.Zc.ja.Gc()));h=h.concat(a.Pf(h[h.length-1],olympe.dm.Zc.aa.Gc()));return[...f,...g,...h].reverse()};olympe.sc.VC=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.$j:a.startsWith('video/')?olympe.sc.zm:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.td:olympe.dm.File};let Hi=0,Ii=0;function Ji(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.Lm&&c.nj()&&(a=Ji(c.children,b)))return a;return null}function Ki(a,b){if(a.children)for(const c of a.children.values())b(c)}function Li(a,b){b=olympe.dc.wa(b);let c,d;return(null==(c=a.pj)?void 0:c.get('O#'+b))||(null==(d=a.pj)?void 0:d.get('IO#'+b))||b}
844
- function Mi(a,b,c,d){const e='$'+b;a.Zh.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{let g,h;null==(g=a.Ld)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});Ki(a,f=>{!f.Rm&&f.Zh.has(b)||f.data.has(e)||Mi(f,b,c,d)});a.Zh.delete(b)}function Ni(a,b){b=olympe.dc.wa(b);let c,d;return(null==(c=a.pj)?void 0:c.get('I#'+b))||(null==(d=a.pj)?void 0:d.get('IO#'+b))||b}
845
- function Oi(a,b,c){a.Zh.add(b);let d;const e=null==(d=a.Ld)?void 0:d.get('&'+b);if(e)for(const f of e.values())f(c);Ki(a,f=>{f.Zh.has(b)||Oi(f,b,c)});a.Zh.delete(b)}function Pi(a,b){if(a.pe&&a.pe.has(b)){var c=a.pe.get(b);--c[0];0===c[0]&&(a.pe.delete(b),0===a.pe.size&&(a.pe=null),Oc(olympe.dc.Ad(),null,c[1]))}}function Qi(a,b){null===a.children&&(a.children=new Map);a.children.set(b.id,b)}
846
- function Ri(a,b){let c;null==(c=a.children)||c.delete(b.Z());let d;0===(null==(d=a.children)?void 0:d.size)&&(a.children=null)}
847
- olympe.sc.Ta=class{constructor(a,b,c=olympe.sc.ks){++Ii;this.id=a;this.gh=new Set;this.parent=c;this.zd=b||null;this.mc=new olympe.D.Xb('SC Context');this.data=new Map;this.pe=this.children=this.Ld=null;this.Sm=new Map;this.uid=Ii;this.Dr=null;this.Lm=!1;this.Zh=new Set;this.Rm=!1;this.N=olympe.ra.Xa('sc');this.pj=null;this.cf()}Z(){return this.id}jn(){return this.uid}getParent(){return this.parent}Qk(){return this.Dr}xc(){return this.mc}sn(a){this.Dr=olympe.dc.wa(a);this.Lm=a.Pd().mn();a.aa().forEach(b=>
848
- {this.gh.add(b)});this.pj=a.Y()}Kk(){this.Rm=!0;Ki(this,a=>{a.Kk()})}kl(){this.Rm=!1;Ki(this,a=>{a.kl()})}set(a,b){if(this.mc.G()||this.mc.Ab())return this;a=Li(this,a);const c='$'+a;var d=this.data.get(c);d&&d.valueOf&&(d=d.valueOf());if(void 0===b||null===b)void 0!==d&&(this.data.delete(c),Mi(this,a,['*',this.id,...this.gh],null));else{var e;(e=void 0===d)||(e=!('function'===typeof b.qb?b.qb(d):b.valueOf()===d.valueOf()));e&&(this.data.set(c,b),Mi(this,a,['*',this.id,...this.gh],b))}return this}li(a){return this.set(a,
849
- Date.now())}remove(a){this.mc.Ab()||this.mc.G()||(a=Li(this,a),this.data.delete('$'+a)&&Mi(this,a,['*',this.id,...this.gh],null))}Fb(a,b,c=!1){const d=olympe.dc.wa(a),e=olympe.D.Uc(b||Object,`Get context value flow source of ${d}`);e.node.onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.id:void 0));return e.Fb()}get(a,b=!1){a=this.bb(a,b);return void 0!==a?a:null}has(a,b=!1){a='$'+Ni(this,a);let c=this.data.has(a),d=this.parent;if(b)for(;!c&&d;)c=d.data.has(a),d=d.parent;return c}observe(a,
850
- b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.id,!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Ni(this,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Jg(a.unsubscribe.bind(a));return this}fl(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Xh(`Runner ${olympe.D.bb(a.ma(),'')}`);a.run(b);return b}Kn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,
851
- b,c))}hl(a){this.set(olympe.sc.Ta.ig.cg,a);return this}bb(a,b=!0){a='$'+Ni(this,a);let c=this.data.get(a),d=this.parent;if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.parent;return c}on(a,b,c,d=!0){if(this.mc.Ab()||this.mc.G())return()=>{};const e=Ni(this,a),f=c?olympe.dc.wa(c):'*';a=this.Re('@'+f+'.'+e,b);c=c?(c=this.di(f))?c.bb(e,!1):void 0:this.bb(e);void 0!==c&&b(c);d&&olympe.D.Ja().onDestroy(a);return a}Xh(a){const b='_'+olympe.W.fc();return this.mc.run(()=>new olympe.sc.Ta(b,a,this))}gn(a,
852
- b){const c=olympe.dc.wa(a);var d;a=null==(d=this.children)?void 0:d.get(c);if(!a){a=this.mc.run(()=>new olympe.sc.Ta(c,b,this));for(d=this;d&&d.Lm&&d.nj();)d=d.parent;let e;null==(e=d)||Oi(e,c,a)}return a}tj(a,b){const c=this.di(a);if(c)return b(c),()=>{};const d=this.Re('&'+a,e=>{d&&d();b(e)});return d}di(a){if(a===this.id||this.gh.has(a)||!a)return this;let b=this.parent;for(;b;){if(a===b.id||b.gh.has(a))return b;const c=Ji(b.children,a);if(c)return c;b=b.parent}return null}nj(){return!this.id.startsWith('_')}Mk(a,
853
- b){this.pe||(this.pe=new Map);const c=this.pe.get(a);c?c[0]+=1:(this.pe.set(a,[1,b]),Oc(olympe.dc.Ad(),b))}destroy(){this.mc.G()||this.mc.Ab()||this.mc.destroy()}Jg(a,b){if(this.mc.Ab())a();else return b=b||String(++Hi),this.Sm.set(b,a),b;return b||'noId'}rj(a){this.Sm.delete(a)}onDestroy(a){return this.mc.Ab()?(a(),'noId'):this.mc.onDestroy(a)}Je(a){this.Ab()||this.mc.Je(a)}clear(){this.mc.G()||this.mc.Ab()||(this.Sm.forEach(a=>a()),this.mc.aa())}cf(){this.mc.zc(()=>{Ki(this,b=>b.destroy())});this.mc.onDestroy(()=>
854
- {this.pe&&this.pe.forEach(([c],d)=>{for(let e=0;e<c;e++)Pi(this,d)});let b;null==(b=this.parent)||Ri(b,this);this.gh.clear();this.parent=null;null!==this.get(olympe.sc.Ta.ig.TRANSACTION)&&this.N.warn(`The context ${this.id} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`)});let a;null==(a=this.parent)||Qi(a,this)}Re(a,b){this.Ld||(this.Ld=new Map);let c=this.Ld.get(a);void 0===c&&(c=new Map,this.Ld.set(a,c));++Hi;const d=Hi;c.set(d,b);return()=>
855
- {const e=this.Ld.get(a);e&&(e.delete(d),0===e.size&&this.Ld.delete(a))}}Ab(){return this.mc.Ab()}pn(){const a=this.bb(olympe.sc.Ta.ig.EDITION);return a?a:!1}Zk(){const a=this.bb(olympe.sc.Ta.ig.PRODUCTION);return a?a:!1}};olympe.sc.Ta.prototype.clear=olympe.sc.Ta.prototype.clear;olympe.sc.Ta.prototype.offDestroy=olympe.sc.Ta.prototype.Je;olympe.sc.Ta.prototype.onDestroy=olympe.sc.Ta.prototype.onDestroy;olympe.sc.Ta.prototype.offClear=olympe.sc.Ta.prototype.rj;olympe.sc.Ta.prototype.onClear=olympe.sc.Ta.prototype.Jg;
856
- olympe.sc.Ta.prototype.destroy=olympe.sc.Ta.prototype.destroy;olympe.sc.Ta.prototype.getOtherContext=olympe.sc.Ta.prototype.di;olympe.sc.Ta.prototype.onContext=olympe.sc.Ta.prototype.tj;olympe.sc.Ta.prototype.createChild=olympe.sc.Ta.prototype.Xh;olympe.sc.Ta.prototype.setParentElement=olympe.sc.Ta.prototype.hl;olympe.sc.Ta.prototype.waitFor=olympe.sc.Ta.prototype.Kn;olympe.sc.Ta.prototype.runner=olympe.sc.Ta.prototype.fl;olympe.sc.Ta.prototype.repeat=olympe.sc.Ta.prototype.repeat;
857
- olympe.sc.Ta.prototype.observe=olympe.sc.Ta.prototype.observe;olympe.sc.Ta.prototype.has=olympe.sc.Ta.prototype.has;olympe.sc.Ta.prototype.get=olympe.sc.Ta.prototype.get;olympe.sc.Ta.prototype.remove=olympe.sc.Ta.prototype.remove;olympe.sc.Ta.prototype.trigger=olympe.sc.Ta.prototype.li;olympe.sc.Ta.prototype.set=olympe.sc.Ta.prototype.set;olympe.sc.Ta.prototype.getParent=olympe.sc.Ta.prototype.getParent;olympe.sc.Ta.cc={ut:'I#',uu:'O#',gA:'IO#'};
858
- olympe.sc.Ta.ig={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',cg:'__htmlContainer',nz:'__dockableElement'};olympe.sc.Metadata=class extends olympe.dc.CloudObject{};olympe.sc.Metadata.O=olympe.dc.ya.C('0161ae936c62f9fcd131',olympe.sc.Metadata);olympe.sc.oc=class extends olympe.dc.CloudObject{F(){return this.Gb(olympe.sc.oc.L)}C(){return this.Gb(olympe.sc.oc.C)}};olympe.sc.oc.O=olympe.dc.ya.C('01703376c4a81c0e9d90',olympe.sc.oc);olympe.sc.oc.L=olympe.sc.oc.O.va('01703376c4a81c0e9d91');olympe.sc.oc.C=olympe.sc.oc.O.va('01703376c4a81c0e9d92');olympe.sc.oc.F=olympe.sc.oc.O.Ha('01703376c4a81c0e9d93');P(olympe.dc.CloudObject.O,olympe.sc.oc.F);olympe.sc.oc.prototype.F.K=olympe.D.J.F;olympe.sc.oc.prototype.C.K=olympe.D.J.F;olympe.sc.W={};function Si(a,b){const c=Math.random().toString(36).substr(2)+Math.random().toString(36).substr(2);a.C.set(c,b);return c}
859
- olympe.sc.W.ht=class{constructor(a,b,c){const d=olympe.net.cb.$d.GET,e=olympe.net.cb.$d.Hc,f=olympe.net.cb.$d.mk,g=olympe.net.cb.$d.em,h=olympe.net.cb.Headers.Kj,k=olympe.net.cb.Headers.pi;this.N=a;this.G=b.aa([d,e,f,g],[h,k]);this.L=c;this.C=new olympe.W.wm(3E4);this.F=new olympe.D.Xb('FileService context')}start(a){var b=olympe.net.cb.$d.GET;const c=olympe.net.cb.$d.Hc,d=olympe.net.cb.$d.mk,e=olympe.net.cb.$d.em,f=olympe.net.cb.hd.Hh,g=olympe.net.cb.hd.ft,h=olympe.net.cb.hd.Lq,k=olympe.net.cb.Headers.pi,
860
- l=olympe.net.cb.Headers.ws,n=`fileServer_${a}`;a=`/${this.L}/${a}/:${'fileTag'}`.replace(/\/+/g,'/').replace(/\/$/,'');this.N.debug(`Started file service with path : ${a}`);b=this.G.L(n,a,[b,c,d,e],(p,q)=>{if(p.method===e)return Promise.resolve(new olympe.net.Tg('',f,'',{[l]:'*'}));const r=p.hj()[k],t=this.C.get(r);if(!t)return Promise.resolve(new olympe.net.Tg('Invalid token',g,'Access denied'));this.C.delete(r);return t(p.hj(),q.get('fileTag'),p.body).catch(u=>Promise.resolve(new olympe.net.Tg(`Internal server error: ${u}`,
861
- h,'Internal server error')))});this.F.onDestroy(()=>{this.G.Y(n).catch(p=>this.N.error(`An error occurred while stopping the file service: ${p}`))});return b}stop(){this.F.destroy()}};olympe.sc.Ie={};olympe.sc.Ie.sg={dz:null,Nu:'screenflow',fv:'ui-design',Nq:'software-intelligence',Nj:'data-management'};olympe.sc.ne=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ie.sg.Nq}F(){return this.tb(olympe.sc.ne.C,olympe.sc.logic.Mi)}G(){return this.tb(olympe.sc.ne.F,olympe.sc.logic.Lh)}};olympe.sc.ne.O=olympe.dc.ya.C('011100000000000adef0',olympe.sc.ne);olympe.sc.ne.C=olympe.sc.ne.O.Ha('016ac4f59a2917fdef01');olympe.sc.ne.F=olympe.sc.ne.O.Ha('016ac4f59a2917fdef02');olympe.sc.ne.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.sc.ne.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ca,[]);function Ti(a,b){const c=[];for(const d of b)b=a.db.fb(d,olympe.sc.logic.Kc.C,!0),c[b]=d;return c}
862
- olympe.sc.pb=class extends olympe.dm.BrickMetadata{Nt(a,b,c,d,e=!0){e||olympe.ra.Xa('sc').error('parameter own= false ignored, investigate');return olympe.D.bf(L(this.Of(a,olympe.dc.W.Vb.hh,c)),d)}cf(a){[].forEach(b=>b.call(this,a,(c,d)=>{null===d?a.remove(c):a.set(c,d)}))}ax(){return this.tb(olympe.sc.pb.aa,olympe.sc.Runnable)}pw(){return this.tb(olympe.sc.pb.ja,olympe.sc.Runnable)}rn(){return this.db.fb(this,olympe.sc.pb.Ib)}mn(){return null!==this.db.hc(this.tag,olympe.sc.Runnable.F.Gc())}Tl(){return this.tb(olympe.sc.pb.F,
863
- olympe.sc.logic.Db)}bk(){return this.tb(olympe.sc.pb.L,olympe.sc.logic.Rb)}};olympe.sc.pb.O=olympe.dc.ya.C('0112000000000000def0',olympe.sc.pb);olympe.sc.pb.Ib=olympe.sc.pb.O.va('01692aa71f3108454479');olympe.sc.pb.ac=olympe.sc.pb.O.va('0166446c1f128ebc903a');olympe.sc.pb.aa=olympe.sc.pb.O.Ha('01692a4af82e8984742c');olympe.sc.pb.ja=olympe.sc.pb.O.Ha('01692a4af82e8984742d');olympe.sc.pb.Da=olympe.sc.pb.O.Ha('01692a4af82e8984742e');olympe.sc.pb.F=olympe.sc.pb.O.Ha('01621fb84e320000f00a');
864
- olympe.sc.pb.L=olympe.sc.pb.O.Ha('01621fb84e320000f00b');olympe.sc.pb.Ge=olympe.sc.pb.O.Ha('0171838bcfed0000e00e');olympe.sc.pb.yd=olympe.sc.pb.O.Ha('0171838bcfed0000a00a');m=olympe.sc.pb.prototype;m.Nt.K=olympe.D.J.C;m.ax.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.pw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.rn.K=olympe.D.J.C;m.mn.K=olympe.D.J.C;m.Tl.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.bk.K=new olympe.D.J(()=>olympe.dc.Ca,[]);function Ui(a){const b=new olympe.dc.Transaction,c=b.create(a).persist(!1).R();b.hb();olympe.D.Ja().onDestroy(()=>{const d=new olympe.dc.Transaction;d.delete(c);d.hb()});return olympe.dc.CloudObject.get(c)}
865
- function Vi(a,b){var c=a.Tb();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.F(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>b.Ab()||(b.clear(),null===h)?!1:(b.xc().run(a.update.bind(a,new olympe.sc.eb(b),Array.isArray(h)?h:[h],g)),!0))).subscribe(rxjs.Subscriber.create(h=>h?a.N.debug(e):a.N.debug(f),a.Ya.bind(a,b),()=>a.N.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
866
- function Wi(a,b,c,d){const e=d.xc(),f=V(a.db,b,c,e.C((g,h)=>{const k=d.gn(h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.zc(a.db.C.bind(a.db,b,c,f,!0))}function Xi(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}
867
- function Yi(a,b,c){const d=olympe.D.Ja(),e=xd(a.db,a.tag,d.C((f,g,h)=>{const k=h?c:b;null!==k&&(h&&b&&b(f,null),null===g||void 0===g?k(f,null):k(f,olympe.sc.hh(g)))}));d.onDestroy(()=>{yd(a.db,a.tag,e)})}
868
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.N=c}run(a){const b=()=>{this.cf(a);this.init(a);this.Pd().rn()?Vi(this,a):a.xc().run(this.update.bind(this,new olympe.sc.eb(a),[],[]));a.li(olympe.sc.pb.ac);a.Jg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))},c=a.getParent();c?c.xc().run(b):b()}Pd(){return this.nh()}init(a){this.onInit(a)}update(a,b,c){const d=this.Pd();if(d.rn())this.onUpdate(a,b,c);else this.N.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.jn()}`),
869
- Wi(this,d,olympe.sc.pb.aa,a),this.Sa()&&Wi(this,d,olympe.sc.pb.Da,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}F(){return[]}onInit(){}onUpdate(){this.N.error(`Brick ${this.db.name(this.Tb())} (${this.Tb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.Pd();return Ti(a,a.db.tb(a.tag,olympe.sc.pb.F))}getOutputs(){var a=this.Pd();return Ti(a,a.db.tb(a.tag,olympe.sc.pb.L))}aa(){return[]}Y(){return new Map}Sa(){return!1}G(a,
870
- b,c,d){a=b.Fb(a,c,!0);void 0!==d&&olympe.D.bf(a,d);return a}Lb(a,b,c,d,e){olympe.D.An([d],f=>{b.set(a,olympe.D.bs(f)?f.valueOf():f)});return this.G(a,b,c,e)}cf(a){a.sn(this);this.Pd().cf(a);const b=this.L(),c=Xi(a,b),d=[];b.forEach((e,f)=>{e===this.Da?d[0]=f:e===this.oa&&(d[1]=f)});void 0!==d[0]&&void 0!==d[1]&&(Yi(this,c[d[0]],c[d[1]]),b[d[0]]=null,b[d[1]]=null);b.forEach((e,f)=>{e&&e.call(this,a,c[f])})}L(){return[this.Da,this.oa]}Da(a,b){Yi(this,b,null)}oa(a,b){Yi(this,null,b)}ac(a,b){const c=
871
- this.db,d=olympe.sc.logic.xb.L.Gc(),e=olympe.sc.logic.xb.F,f=olympe.sc.logic.xb.C;this.Nr(d,g=>{var h=g.R();if(h=c.hc(h,e)||c.hc(h,f))g=g.cf(a,b.bind(null,h)),olympe.D.Ja().onDestroy(g)})}Ya(a,b){const c=this.Tb();let d=this.db.name(c);try{const e=[a.Qk()];let f=a.getParent();for(;null!==f&&f!==olympe.sc.ks;)e.unshift(f.Qk()),f=f.getParent();d=e.map(g=>{if(null!==g){const h=this.db.model(g);return this.db.name(g)||h&&this.db.name(h)||g}return'?'}).join(' > ')}catch(e){this.N.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.N.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};
872
- olympe.sc.Runnable.O=Ic(olympe.dc.ya.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.L=olympe.sc.Runnable.O.Ha('01692a4af82e8984742b');olympe.sc.Runnable.F=olympe.sc.Runnable.O.Ha('01756a18d4921c103111');olympe.sc.Runnable.U=P(olympe.sc.Runnable.O,olympe.sc.pb.aa);olympe.sc.Runnable.Y=P(olympe.sc.Runnable.O,olympe.sc.pb.ja);olympe.sc.Runnable.aa=P(olympe.sc.Runnable.O,olympe.sc.pb.Da);P(olympe.sc.pb.O,olympe.sc.Runnable.L);P(olympe.sc.pb.O,olympe.sc.Runnable.F);
873
- olympe.sc.Runnable.prototype.Pd.K=new olympe.D.J(()=>olympe.sc.pb,[]);olympe.sc.Runnable.prototype.G.K=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.Lb.K=olympe.D.J.C;function Zi(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Ce)return(a=a.F())?a.valueOf():null;if('function'===typeof a.R)return a.R()}return null}olympe.sc.Ce=class extends olympe.dc.CloudObject{F(){return this.db.tb(this,olympe.sc.Ce.C)[0]}C(){return olympe.dc.CloudObject.get(Zi(this))}toString(){const a=Zi(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ce.O=olympe.dc.ya.C('0163c9ae01f2d6e9ca49',olympe.sc.Ce);olympe.sc.Ce.C=olympe.sc.Ce.O.Ha('0169b5a8a33144fb0b49');
874
- P(olympe.dc.CloudObject.O,olympe.sc.Ce.C);olympe.sc.Ce.prototype.F.K=new olympe.D.J(()=>String,[]);olympe.sc.Ce.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.Bo=class extends olympe.dm.Qb{C(){return olympe.sc.Ie.sg.Nj}};olympe.sc.Bo.O=olympe.dc.ya.C('0163a68ce44f3d1fa84c',olympe.sc.Bo);olympe.sc.si=class extends olympe.dm.BrickMetadata{};olympe.sc.si.O=olympe.dc.ya.C('016324fde11a836f76c2',olympe.sc.si);let $i=null;
875
- function aj(a,b){$i=a;(new olympe.dc.kf(a,olympe.dc.Ed.Li)).sb(olympe.sc.Ma.Me.C).sb(olympe.sc.md.F.Gc()).hb((c,d)=>{if(c)olympe.ra.Xa('sc').error('Error while loading business container:',c.message),b(olympe.sc.md.C.uc);else{c=null;for(const [e,f]of d.Dc.ld())e===olympe.sc.md.F.R()&&(c=f);null!==c?$e(Ve(new olympe.dc.kf(c),olympe.dc.Ub.tf),(e,f)=>{const g=olympe.dc.kc.Xc,h=olympe.dc.kc.xi,k=f.R();f=f.Pa();return olympe.dc.Oa().qh(e,olympe.sc.si)&&f===olympe.dc.Aa.ORIGIN&&(k===g||k===h)}).hb(()=>
876
- b(olympe.sc.md.C.Hp)):(olympe.ra.Xa('sc').error('No container found for the application',a),b(olympe.sc.md.C.am))}})}olympe.sc.md=class extends olympe.dc.CloudObject{};olympe.sc.md.C={Hp:0,am:1,uc:2};olympe.sc.md.O=olympe.dc.ya.C('017b3aa8fae1e3d044dc',olympe.sc.md);olympe.sc.md.F=olympe.sc.md.O.Ha('017b3aa8fd1659291b92');olympe.sc.md.L=olympe.sc.md.O.Ha('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.ya.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Wg=class extends olympe.sc.Map{};olympe.sc.Wg.O=olympe.dc.ya.C('01631aacd8276ea98490',olympe.sc.Wg);olympe.sc.$j=class extends olympe.dm.File{L(){const a=olympe.D.Uc(olympe.D.Wa);this.Sk(b=>{a.update(olympe.D.Bb(b))});return a.Fb()}};olympe.sc.$j.O=Dc('01644b6297305d62fca2',olympe.sc.$j);olympe.sc.$j.prototype.L.K=olympe.D.J.F;olympe.sc.td=class extends olympe.dm.File{L(){return this.Gb(olympe.sc.td.F)}U(){return this.Gb(olympe.sc.td.L)}Y(){return this.He(olympe.sc.td.aa)}};olympe.sc.td.O=Dc('01647e113043c637b541',olympe.sc.td);olympe.sc.td.F=olympe.sc.td.O.va('01647e35ecd24ef0b88d');olympe.sc.td.L=olympe.sc.td.O.va('01647e677f5d1cfbdf42');olympe.sc.td.aa=olympe.sc.td.O.va('01647e6780999bf8bd25');olympe.sc.td.prototype.L.K=olympe.D.J.F;olympe.sc.td.prototype.U.K=olympe.D.J.F;olympe.sc.td.prototype.Y.K=olympe.D.J.G;olympe.sc.zm=class extends olympe.dm.File{};olympe.sc.zm.O=Dc('0164643c432146a71d5c',olympe.sc.zm);olympe.sc.tr=class extends olympe.dc.CloudObject{};olympe.sc.tr.O=olympe.dc.ya.C('016421bb3797e22d1c4e',olympe.sc.tr);olympe.sc.logic={};olympe.sc.logic.gp=(a,b)=>a===b?0:a>b?1:-1;
877
- olympe.sc.logic.kA=(a,b,c,d,e,f,g)=>{const h=b.R();b=olympe.D.bb(b.C().R());let k,l;if(b===olympe.dc.wa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.Gb(h).toLowerCase();else if(b===olympe.dc.wa(olympe.dm.Number))k=c.valueOf(),l=p=>p.He(h);else if(b===olympe.dc.wa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.Fa([p.jj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.Oa().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
878
- return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.gp(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.gp(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.vg().filter(p=>olympe.D.Fa([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Cc(d.valueOf()?1===q:0<=q)},olympe.D.qa,'FilterList ListDefBuilder Filter TransformFlows')).pf())};
879
- olympe.sc.logic.FC=(a,b)=>{if(a instanceof olympe.D.ea)return a;if(a instanceof olympe.D.Wa)return a.qs();if(a instanceof olympe.D.qa)return a.Tr();if('string'===typeof a||'number'===typeof a)return olympe.D.za(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ea.Up};olympe.sc.logic.ta={};olympe.sc.logic.ta.To=class{constructor(a,b,c){this.O=olympe.dc.ya.C(a,b,...c)}R(){return this.O.R()}};olympe.sc.logic.ta.To.la=[olympe.dc.ze];const bj=Object.create(null),cj=new Map;function dj(a){if(void 0===bj[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Fc(a)}function ej(a,b,c=olympe.sc.logic.Function){if(cj.has(a))throw c=dj(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.ya.C(a,b,...[]);cj.set(a,{O:d,RC:b,EC:c});return d}
880
- olympe.sc.logic.ya=class{constructor(){}static C(a,b,...c){if(bj[a])throw c=dj(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.ta.To(a,b,[olympe.sc.P.Ea].concat(c));return bj[a]=b}};olympe.sc.logic.jz=class{};olympe.sc.logic.Lj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Lj.O=olympe.dc.ya.C('01621fb84e320000cf00',olympe.sc.logic.Lj);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.ds=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Mw(){return this.ds}nw(){return this.code}};z('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.nw;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Mw;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
881
- olympe.sc.logic.Qj=class extends olympe.sc.logic.Lj{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Qj.O=olympe.dc.ya.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Qj);olympe.sc.logic.le=class extends olympe.dc.CloudObject{C(){return this.qc(olympe.sc.logic.le.C,olympe.dc.CloudObject)}};olympe.sc.logic.le.O=olympe.dc.ya.C('016ac4f59ee8ea2081ba',olympe.sc.logic.le);olympe.sc.logic.le.L=olympe.sc.logic.le.O.va('017bc044aeacce7ffc8f');olympe.sc.logic.le.C=olympe.sc.logic.le.O.Ha('016ac4f5a0091c4790e2');P(olympe.dc.CloudObject.O,olympe.sc.logic.le.C);olympe.sc.logic.le.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Mi=class extends olympe.sc.logic.le{};olympe.sc.logic.Mi.O=olympe.dc.ya.C('016ac4f59c592b862457',olympe.sc.logic.Mi);olympe.sc.logic.Mi.F=olympe.sc.ne.C.Gc();olympe.sc.logic.Lh=class extends olympe.sc.logic.le{};olympe.sc.logic.Lh.O=olympe.dc.ya.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Lh);olympe.sc.logic.Lh.F=P(olympe.sc.logic.Lh.O,olympe.sc.ne.F);olympe.sc.logic.xe=class extends olympe.sc.pb{C(){return olympe.sc.Ie.sg.Nq}ja(){return this.cn().vg().qh([olympe.sc.logic.Function]).and().not().qh([olympe.sc.logic.Vd,olympe.sc.logic.Yd]).pf()}Fw(){return this.Tl().vg().kj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Mi.F]).pf()}Gw(){return this.bk().vg().kj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Lh.F]).pf()}de(a){const b=this.db.$m(this,[olympe.sc.pb.F],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}Jf(a){const b=
882
- this.db.$m(this,[olympe.sc.pb.L],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}lx(){return this.Tl().vg().kj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Db).pf()}mx(){return this.bk().vg().kj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Rb).pf()}};ej('01621fb84e320000f000',olympe.sc.logic.xe,olympe.sc.logic.Function);m=olympe.sc.logic.xe.prototype;m.Fw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Gw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);
883
- m.de.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Jf.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.lx.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.mx.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.sc.logic.ag=class extends olympe.sc.logic.xe{F(){return this.de('016ac63229782039429f')}G(){return this.Jf('016ac6322acf67eebfe7')}L(){return this.bk().vg().sb(olympe.sc.logic.Kc.typeRel).Wk(olympe.sc.logic.Qj).pf().nf().nn(olympe.D.ea.ZERO)}};olympe.sc.logic.ag.C='016ac63229782039429f';olympe.sc.logic.ag.oa='016ac6322acf67eebfe7';olympe.sc.logic.ag.O=ej('01621fb84e320000a000',olympe.sc.logic.ag,olympe.sc.logic.Action);
884
- olympe.sc.logic.ag.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.ag.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.ag.prototype.L.K=olympe.D.J.U;olympe.sc.logic.po=class extends olympe.sc.logic.xe{};olympe.sc.logic.po.O=ej('01621fb84e320000f011',olympe.sc.logic.po);olympe.sc.logic.oo=class extends olympe.sc.logic.ag{};olympe.sc.logic.oo.O=ej('01621fb84e320000f012',olympe.sc.logic.oo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{L(){return[this.ac]}Y(){const a=olympe.sc.Ta.cc.ut,b=olympe.sc.Ta.cc.uu,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}F(a){return this.getOutputs().map(b=>this.db.$k(b,olympe.sc.logic.Kc.typeRel,olympe.sc.logic.Lj)?a.li.bind(a,b):a.set.bind(a,b))}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
885
- c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.O=olympe.dc.ya.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ea);olympe.sc.logic.Kc=class extends olympe.dc.CloudObject{C(){return this.qc(olympe.sc.logic.Kc.typeRel,olympe.dc.CloudObject)}F(){return this.He(olympe.sc.logic.Kc.C)}};olympe.sc.logic.Kc.O=olympe.dc.ya.C('0168a431d25001540000',olympe.sc.logic.Kc);olympe.sc.logic.Kc.C=olympe.sc.logic.Kc.O.va('01740c5d4ae4b520dd01');olympe.sc.logic.Kc.typeRel=olympe.sc.logic.Kc.O.Ha('0168a431d3b9b7438424');P(olympe.dc.CloudObject.O,olympe.sc.logic.Kc.typeRel);
886
- olympe.sc.logic.Kc.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Kc.prototype.F.K=olympe.D.J.G;olympe.sc.logic.Db=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Db.O=olympe.dc.ya.C('0168a431d25001540001',olympe.sc.logic.Db);olympe.sc.logic.Db.oa=olympe.sc.logic.Kc.O.va('01740c5d4ae4b520dd02');olympe.sc.logic.Db.ja=P(olympe.sc.logic.Db.O,olympe.sc.pb.F);olympe.sc.logic.Db.F=olympe.sc.logic.Db.O.Ha('0168a431d91f2578000b',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Db.L=olympe.sc.logic.Db.O.Ha('01621fb84e32000000a1',olympe.dc.Aa.ORIGIN);
887
- olympe.sc.logic.Db.aa=olympe.sc.logic.Db.O.Ha('01621fb84e32000000d1',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Rb=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Rb.O=olympe.dc.ya.C('0168a431d25001540002',olympe.sc.logic.Rb);olympe.sc.logic.Rb.ja=P(olympe.sc.logic.Rb.O,olympe.sc.pb.L);olympe.sc.logic.Rb.F=olympe.sc.logic.Rb.O.Ha('0168a431d91f25780003',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Rb.aa=olympe.sc.logic.Rb.O.Ha('01621fb84e32000000a2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Rb.L=olympe.sc.logic.Rb.O.Ha('01621fb84e32000000d2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.Pd().F().R();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.O=olympe.dc.ya.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.P.Ea);olympe.sc.logic.Vd=class extends olympe.sc.logic.Function{run(a){this.cf(a);const b=a.getParent(),c=this.db.hc(this,olympe.sc.logic.Vd.C),d=this.db.hc(this,olympe.sc.logic.Vd.G);a.on(c,e=>b.set(d,e),this.tag)}U(){return this.qc(olympe.sc.logic.Vd.C,olympe.sc.logic.Db)}ab(){return this.qc(olympe.sc.logic.Vd.G,olympe.sc.logic.Rb)}};olympe.sc.logic.Vd.O=olympe.dc.ya.C('01621fb84e32000000a0',olympe.sc.logic.Vd,olympe.sc.P.Ea);olympe.sc.logic.Vd.C=P(olympe.sc.logic.Vd.O,olympe.sc.logic.Db.L);
888
- olympe.sc.logic.Vd.G=P(olympe.sc.logic.Vd.O,olympe.sc.logic.Rb.aa);olympe.sc.logic.Vd.prototype.U.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.Vd.prototype.ab.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.Yd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.hc(this,olympe.sc.logic.Yd.G),d=this.db.hc(this,olympe.sc.logic.Yd.C);b.on(c,e=>a.set(d,e),b.Z())}ab(){return this.qc(olympe.sc.logic.Yd.G,olympe.sc.logic.Db)}U(){return this.qc(olympe.sc.logic.Yd.C,olympe.sc.logic.Rb)}};olympe.sc.logic.Yd.O=olympe.dc.ya.C('01621fb84e32000000d0',olympe.sc.logic.Yd,olympe.sc.P.Ea);olympe.sc.logic.Yd.G=P(olympe.sc.logic.Yd.O,olympe.sc.logic.Db.aa);
889
- olympe.sc.logic.Yd.C=P(olympe.sc.logic.Yd.O,olympe.sc.logic.Rb.L);olympe.sc.logic.Yd.prototype.ab.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.Yd.prototype.U.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.xb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.N=c;this.C=`detachObject${this.tag}`}cf(a,b){const c=this.db.hc(this,olympe.sc.logic.xb.oa)||this.db.hc(this,olympe.sc.logic.xb.aa),d=this.db.hc(this,olympe.sc.logic.xb.ja),e=this.db.Tf((()=>{let h=null,k=this.db.hc(this,olympe.sc.logic.xb.F);k?h=this.db.hc(k,olympe.dm.Property.typeRel):(k=this.db.hc(this,olympe.sc.logic.xb.C))&&(h=this.db.hc(k,olympe.sc.logic.Kc.typeRel));return h||olympe.dc.CloudObject.O.R()})(),
890
- olympe.dm.rf)?new olympe.D.Xb('Pipe Context'):null,f=this.F.bind(this,a,b,e);if(null!==c&&null!==d){let h;const k=a.tj(d,l=>{h&&h();h=l.on(c,f,d)});return()=>{f(null);k();h&&h()}}const g=wd(this.db,this,olympe.sc.logic.xb.valueProp,f);return()=>{f(null);this.db.F(this,olympe.sc.logic.xb.valueProp,g)}}F(a,b,c,d){null!==c&&c.aa();const e=a.get(this.C);e&&(e(),a.remove(this.C));const f=olympe.sc.hh(d);if(f instanceof olympe.dc.CloudObject){if(d=f.R(),this.Mk(a,d,[d]),null!==c&&'function'===typeof f.getValue){c.run(()=>
891
- {olympe.D.Ec([f.getValue()],g=>{b(g.valueOf())})});return}}else f instanceof olympe.dc.Va&&this.Mk(a,`qr-${f.hash}`,ze(f));b(f)}Mk(a,b,c){const d=a.getParent();d.Mk(b,c);a.set(this.C,()=>Pi(d,b))}getValue(a){return this.Of(olympe.sc.logic.xb.valueProp,a||olympe.dc.W.Vb.hh,Object)}Ot(){const a=this.transform(olympe.sc.logic.xb.C,olympe.sc.logic.Kc.typeRel);a.Gd(olympe.dc.CloudObject);return a.Sc()}jx(){return this.qc(olympe.sc.logic.xb.ja,olympe.dc.CloudObject)}hx(){return this.qc(olympe.sc.logic.xb.oa,
892
- olympe.sc.logic.Rb)}ix(){return this.qc(olympe.sc.logic.xb.aa,olympe.dm.Property)}xw(){return this.qc(olympe.sc.logic.xb.L,olympe.dc.CloudObject)}vw(){return this.qc(olympe.sc.logic.xb.C,olympe.sc.logic.Db)}ww(){return this.qc(olympe.sc.logic.xb.F,olympe.dm.Property)}};olympe.sc.logic.xb.O=olympe.dc.ya.C('0168a431d91f25780000',olympe.sc.logic.xb,olympe.sc.P.Ea);olympe.sc.logic.xb.valueProp=olympe.sc.logic.xb.O.va('0168a431d91f25780001');olympe.sc.logic.xb.ja=olympe.sc.logic.xb.O.Ha('0168a431d91f25780002');
893
- olympe.sc.logic.xb.oa=P(olympe.sc.logic.xb.O,olympe.sc.logic.Rb.F);olympe.sc.logic.xb.aa=olympe.sc.logic.xb.O.Ha('0168a431d91f25780004');olympe.sc.logic.xb.L=olympe.sc.logic.xb.O.Ha('0168a431d91f2578000a');olympe.sc.logic.xb.C=P(olympe.sc.logic.xb.O,olympe.sc.logic.Db.F);olympe.sc.logic.xb.F=olympe.sc.logic.xb.O.Ha('0168a431d91f2578000c');P(olympe.dc.CloudObject.O,olympe.sc.logic.xb.ja);P(olympe.dm.Property.O,olympe.sc.logic.xb.aa);P(olympe.dc.CloudObject.O,olympe.sc.logic.xb.L);
894
- P(olympe.dm.Property.O,olympe.sc.logic.xb.F);m=olympe.sc.logic.xb.prototype;m.Ot.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.jx.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.hx.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.ix.K=new olympe.D.J(()=>olympe.dm.Property,[]);m.xw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.vw.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.ww.K=new olympe.D.J(()=>olympe.dm.Property,[]);olympe.sc.logic.Xd=class extends olympe.sc.logic.Function{};olympe.sc.logic.Xd.O=olympe.dc.ya.C('017dc8c114aa61a0e27f',olympe.sc.logic.Xd);olympe.sc.logic.Xd.C=olympe.sc.logic.Xd.O.Ha('017dc8d6d8ef9135f08a');olympe.sc.logic.Xd.G=olympe.sc.logic.Xd.O.Ha('017dc8d6d8ef9135f08b');P(olympe.dm.Nb.O,olympe.sc.logic.Xd.G);function fj(a,b){const c=a.Pd(),d=c.Ul().R(),e=c.Vl().R(),f=c.Wl().R();b.on(d,g=>{g&&(g=new Map(a.getInputs().map(h=>[h,b.get(h)])),g=olympe.sc.logic.uk.ia(g),olympe.H.Ba.nb.zb.get(a.Tb(),g).then(h=>{h=gj(h,a.U.bind(a,b));for(const [k,l]of h)k!==e&&k!==f&&b.set(k,l);b.set(e,h.get(e));b.set(f,h.get(f))}).catch(h=>{b.set(f,olympe.sc.logic.Qj.create(h.toString(),1))}))},b.Z())}
895
- function hj(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();l&&l();try{const p=new Map(a.getOutputs().map(r=>[r,b.get(r)])),q=olympe.sc.logic.uk.ia(p);f.Le(q).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Tb()}: ${p.message}`),f.xg(n).finally(()=>b.destroy())}}},h=b.Z(),k=b.on(c,g,h),l=b.on(d,g,h)}
896
- olympe.sc.logic.Mh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e){super(a,b,c);this.ab=d;this.timeout=e}run(a){a.pn()||(this.db.fb(this,olympe.sc.logic.Mh.C)?this.wc(a):(this.cf(a),fj(this,a)))}wc(a){const b=this.Tb(),c=this.Pd(),d=c.Cp().R(),e=c.Ul().R(),f=c.Vl().R(),g=c.Wl().R();(new olympe.H.Ba.nb.zb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Xh('remote call'),l=gj(h.body(),this.U.bind(this,k)),n=Hb(()=>{h.xg(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
897
- k.destroy()},this.timeout);hj(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.Bj().then(p=>{var q=k.get(d);null!==q&&olympe.dc.wa(q)!==p&&(q=this.Tb(),this.N.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))})},h=>{const k=this.Tb();this.N.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}U(a,b){const c=Array.from(b.ee()).map(d=>d.tag());
898
- Jc(this.ab,a.xc(),b,[],c)}};olympe.sc.logic.Mh.O=olympe.dc.ya.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Mh,olympe.sc.P.Ea,olympe.dc.db.P.xa,new olympe.T.fa(olympe.sc.Config.Dq));olympe.sc.logic.Mh.C=olympe.sc.logic.Mh.O.va('017a7b0c62a02a89444f');function gj(a,b){var c=(new olympe.dc.W.Ki(olympe.dc.Ga.Pc)).C(a.p||[]);b&&b(c);c=new Map;for(const [d,e]of Object.entries(a.v||{}))c.set(d,ij(olympe.sc.logic.uk,e,b));return c}function jj(a){a.Dc=new olympe.dc.db.Ac;a.values=Object.create(null)}
899
- function ij(a,b,c){if(null===b||void 0===b)return null;switch(b.t){case 1:return new Date(b.d);case 2:return olympe.D.Color.create(b.r,b.g,b.b,b.a);case 3:return olympe.sc.logic.Error.create(b.m,b.c);case 4:return olympe.dc.CloudObject.get(b.v);case 5:return te(b.v);case 6:return Ce(b.v,c);case 7:return new Map(Object.entries(b.m).map(([d,e])=>[d,ij(a,e,c)]));default:return Array.isArray(b)?b.map(d=>ij(a,d,c)):'object'===typeof b?Object.entries(b).reduce((d,[e,f])=>{d[e]=ij(a,f,c);return d},{}):b}}
900
- function kj(a,b){var c=a.db;a=a.Dc;if(c.Eb(b)){a.F(b,c.kd(b,!0),0);a.Ra(olympe.dc.kc.Xc,b,c.model(b),0);for(const [d,e,f]of Ad(c,b))(c=a.Lf(f))&&c.re()&&(e===olympe.dc.Aa.DESTINATION?a.Ra(d,b,f,0):a.Ra(d,f,b,0))}else olympe.ra.Xa('Remote Action').error(`Try to serialize an instance ${b} that does not exist in the local datacloud.`)}
901
- olympe.sc.logic.uk=class{constructor(){this.db=olympe.dc.Oa();jj(this)}static ia(a){const b=new olympe.sc.logic.uk;a.forEach((c,d)=>{null!==c&&void 0!==c&&(b.values[d]=b.C(c))});return b.flush()}flush(){const a=Object.create(null),b=new olympe.dc.transaction.vd;this.Dc.Qc(b);a.p=$d(b);a.v=this.values;jj(this);return a}C(a){switch(!0){case a instanceof olympe.D.jb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return{t:2,
902
- r:a.Qf().valueOf(),g:a.Kf().valueOf(),b:a.Ff().valueOf(),a:a.Ef().valueOf()};case a instanceof olympe.sc.logic.Error:return{t:3,c:a.code,m:a.ds};case a&&'function'===typeof a.R:return a=a.R(),kj(this,a),{t:4,v:a};case a instanceof olympe.dc.gb:return{t:5,v:a.ia()};case a instanceof olympe.dc.Va:return{t:6,v:a.ia()};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof Map:const b=Object.create(null);for(const [c,d]of a)'string'===typeof c&&(b[c]=this.C(d));return{t:7,m:b};case null===
903
- a:case void 0===a:return null;case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:return a}}};olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Ol=class{constructor(a){this.db=olympe.dc.Oa();this.typeRel=a}};olympe.sc.logic.controllers.Ol.C={kz:-1,fA:1};olympe.sc.logic.controllers.JA=class extends olympe.sc.logic.controllers.Ol{constructor(){super(olympe.sc.logic.le.C)}};olympe.sc.logic.controllers.LA=class extends olympe.sc.logic.controllers.Ol{constructor(){super(olympe.sc.logic.Kc.typeRel)}};olympe.sc.logic.Pk={};olympe.sc.logic.Pk.Xu=class extends olympe.sc.logic.Function{update(a,[b,c],[d]){const e=olympe.dc.wa(b);e?af(Ve(new olympe.dc.kf(e),olympe.dc.Ub.tf),c).hb(()=>{d(olympe.dc.CloudObject.get(e))}):this.N.warn('Cannot subscribe to an instance with no tag: '+e)}};olympe.sc.logic.ya.C('0174bf4b7e006e4b788a',olympe.sc.logic.Pk.Xu);olympe.sc.logic.actions={};olympe.sc.logic.Pk.du=class extends olympe.sc.logic.Function{run(a){this.cf(a);const [b,c,d]=this.F(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.N.warn('No list to iter upon'),this.N.info(a.Z())):f<e?(b(g.Ve(f)),f++,c((new Date).getTime())):(h.kl(),d((new Date).getTime()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.zg();f=0;h.Kk();k();break;case 2:k();break;default:this.N.error('Unhandled input')}},this.tag))}};
904
- olympe.sc.logic.ya.C('0171889b060b6cd54300',olympe.sc.logic.Pk.du);olympe.sc.logic.bc={};olympe.sc.logic.bc.to=class extends olympe.sc.logic.xe{F(){return this.de('017dc92292107fb98b21')}};ej('017dc8d6c8fd8c8bd2f0',olympe.sc.logic.bc.to);olympe.sc.logic.bc.to.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.bc.Ql=class extends olympe.sc.logic.xe{F(){return this.de('016ac63808535703691c')}};olympe.sc.logic.bc.Ql.O=ej('0169b6876a03f139d50a',olympe.sc.logic.bc.Ql);olympe.sc.logic.bc.Ql.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.bc.fm=class extends olympe.sc.logic.xe{F(){return this.de('016ac63809a9a8e6db96')}G(){return this.Jf('016ac6380ab003363b3e')}};ej('01646ad602f933b8caaf',olympe.sc.logic.bc.fm);olympe.sc.logic.bc.fm.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.bc.fm.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.bc.kk=class extends olympe.sc.logic.xe{F(){return this.de('016ac6380bd98f1d91a0')}L(){return this.Jf('016ac63c589ae38ca3ae')}G(){return this.Jf('016ac63c5a377fceabaa')}};ej('0168ec42fc01747a98b6',olympe.sc.logic.bc.kk);olympe.sc.logic.bc.kk.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.bc.kk.prototype.L.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.bc.kk.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.bc.Zg=class extends olympe.sc.logic.xe{Ul(){return this.de('017a7b07b09e3b22c8b4')}Cp(){return this.de('017a7b07ba05807a74b0')}Vl(){return this.Jf('017a7b0818c12388d731')}Wl(){return this.Jf('017a7b085146d5e69aec')}Pt(){return olympe.D.qa.F}};olympe.sc.logic.bc.Zg.oa='017a7b07b09e3b22c8b4';olympe.sc.logic.bc.Zg.Lc='017a7b07ba05807a74b0';olympe.sc.logic.bc.Zg.wc='017a7b0818c12388d731';olympe.sc.logic.bc.Zg.C='017a7b085146d5e69aec';
905
- olympe.sc.logic.bc.Zg.O=ej('017a7b07a948e30508fa',olympe.sc.logic.bc.Zg,olympe.sc.logic.Mh);m=olympe.sc.logic.bc.Zg.prototype;m.Ul.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Cp.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Vl.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.Wl.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.Pt.K=olympe.D.J.U;olympe.sc.logic.bc.Xq=class extends olympe.sc.logic.xe{F(){return this.de('016ac63c5b3ed0562740')}};ej('016a9766c230916ea5ec',olympe.sc.logic.bc.Xq);olympe.sc.logic.bc.Xq.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.query={};olympe.sc.query.Un=class extends olympe.sc.Wg{};olympe.sc.query.Un.O=olympe.dc.ya.C('01631aacd8276ea98491',olympe.sc.query.Un);olympe.sc.query.jq=class extends olympe.dm.Enum{};olympe.sc.query.jq.O=olympe.dc.ya.C('01631aacd8276ea98495',olympe.sc.query.jq);olympe.sc.query.uq=class extends olympe.dm.Enum{};olympe.sc.query.uq.O=olympe.dc.ya.C('01631aacd8276ea98494',olympe.sc.query.uq);olympe.sc.query.wq=class extends olympe.sc.Wg{};olympe.sc.query.wq.O=olympe.dc.ya.C('01631aacd8276ea98492',olympe.sc.query.wq);olympe.sc.query.xq=class extends olympe.dc.CloudObject{};olympe.sc.query.xq.O=olympe.dc.ya.C('01631aacd8276ea98493',olympe.sc.query.xq);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.ya.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe13a');
906
- olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.Ha('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.Ha('017ffdd8f0b1e31fe13f');olympe.sc.workflow.sf=class extends olympe.sc.logic.xe{Qt(){return this.de('017ffe02381f9fac5060')}Tt(){return this.de('017ffe02381f9fac5061')}Ut(){return this.de('017ffe02381f9fac5062')}tw(){return this.de('017ffe02381f9fac5065')}Rt(){return this.Jf('017ffe02381f9fac5063')}St(){return this.Jf('017ffe02381f9fac5064')}};olympe.sc.workflow.sf.O=ej('017ffde21f5fe0f704ce',olympe.sc.workflow.sf);olympe.sc.workflow.sf.C='017ffe02381f9fac5060';olympe.sc.workflow.sf.Ue='017ffe02381f9fac5061';
907
- olympe.sc.workflow.sf.Xe='017ffe02381f9fac5062';olympe.sc.workflow.sf.wc='017ffe02381f9fac5065';olympe.sc.workflow.sf.oa='017ffe02381f9fac5063';olympe.sc.workflow.sf.Lc='017ffe02381f9fac5064';m=olympe.sc.workflow.sf.prototype;m.Qt.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Tt.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Ut.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.tw.K=new olympe.D.J(()=>Map,[]);m.Rt.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);
908
- m.St.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.workflow.Qe=class extends olympe.dm.BrickMetadata{Vc(){return this.qc(olympe.sc.workflow.Workflow.statesRel.Gc(),olympe.sc.workflow.Workflow).ma().concat(['.',this.ma()])}};olympe.sc.workflow.Qe.O=olympe.dc.ya.C('017ffdc2dda51d46b430',olympe.sc.workflow.Qe);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.Xr()}C(){return this.qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Qe)}G(){return this.qc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Qe)}Vc(){const a=this.qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Qe);return a.qc(olympe.sc.workflow.Workflow.statesRel.Gc(),olympe.sc.workflow.Workflow).ma().concat(['.',a.ma(),'->',this.ma()])}};
833
+ new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Vo)],b);C(a,olympe.H.P.rp,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.sp)],b);C(a,olympe.H.P.Io,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Jo)],b);C(a,olympe.H.P.fr,
834
+ [new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.er)],b);C(a,olympe.H.P.rr,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.qr)],b);C(a,olympe.H.P.nr,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),
835
+ new olympe.T.fa(olympe.H.ob.mr)],b);C(a,olympe.H.P.lr,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.kr)],b);C(a,olympe.H.P.Hq,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Gq)],b);C(a,olympe.H.P.Oo,[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Id),
836
+ new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.ob.Cd),new olympe.T.fa(olympe.H.ob.Mo)],b);C(a,olympe.H.P.mq,[new olympe.T.fa(olympe.net.Config.Kl),new olympe.T.fa(olympe.net.Config.Ll),new olympe.T.fa(olympe.net.Config.mp),new olympe.T.fa(olympe.H.ob.im)],b);C(a,'server.ManagerConfig',[new olympe.T.fa(olympe.H.Config.Nn),new olympe.T.fa(olympe.H.Config.Aq),new olympe.T.fa(olympe.H.Config.qq),new olympe.T.fa(olympe.H.Config.Am),new olympe.T.fa(olympe.H.Config.io),new olympe.T.fa(olympe.H.Config.Nq),
837
+ new olympe.T.fa(olympe.dc.Config.ah),new olympe.T.fa(olympe.H.Config.Fq)],(...d)=>{const e='autoConnect reconnectionDelay pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),f=new Map;d.forEach((g,h)=>f.set(e[h],g));return f});C(a,'server.bus.ManagerConfig',[new olympe.T.fa(olympe.H.Config.ud),new olympe.T.fa(olympe.H.Config.Zn),new olympe.T.fa(olympe.H.Config.ao),new olympe.T.fa(olympe.H.Config.bo),new olympe.T.fa(olympe.H.Config.co),new olympe.T.fa(olympe.H.Config.jr),
838
+ new olympe.T.fa(olympe.H.Config.xd),new olympe.T.fa(olympe.H.Config.mg),new olympe.T.fa(olympe.H.Config.Mu),new olympe.T.fa(olympe.H.Config.Is),new olympe.T.fa(olympe.H.Config.Gs),new olympe.T.fa(olympe.H.Config.Iu),new olympe.T.fa(olympe.H.Config.Ls),new olympe.T.fa(olympe.H.Config.kq),new olympe.T.fa(olympe.H.Config.Eu),new olympe.T.fa(olympe.H.Config.Am),new olympe.T.fa(olympe.H.Config.cr)],(d,e,f,g,h,k,l,...n)=>{e=`${l?'wss://':'ws://'}${e||d}:${g}${f}/ws`;const p='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout password queueQoSZero messageTimeout tokenTimeout'.split(' ');
839
+ n=n.reduce((q,r,t)=>{q[p[t]]=r;return q},{});n.username=`${h||d.split('.')[0]}:${k}`;d=new Map;d.set('url',e);d.set('connectionOptions',n);return d});A(a,olympe.H.P.xa,olympe.H.rd.sa,olympe.H.P.Ea,olympe.net.P.xa,'server.WebSocketRequest','server.ManagerConfig');A(a,olympe.H.sd.oi,olympe.H.pa.Ua,olympe.H.P.Ea,olympe.H.P.xa,olympe.H.P.rr,olympe.H.P.nr,olympe.H.P.lr,olympe.H.P.Hq,olympe.H.P.gq,olympe.auth.P.qk,olympe.jc.P.ek);A(a,olympe.H.P.$n,olympe.H.Ba.sa,olympe.H.P.Ea,olympe.net.P.xa,olympe.auth.P.xa,
840
+ 'server.bus.ManagerConfig');ra(a,olympe.auth.sd.xa,olympe.H.sd.oi);ra(a,olympe.auth.sd.Jp,olympe.H.sd.oi);ra(a,olympe.auth.sd.Fe,olympe.H.sd.oi);ra(a,olympe.auth.sd.Pe,olympe.H.sd.oi);A(a,olympe.H.P.Sg,olympe.H.Vj,olympe.H.P.Ea,olympe.net.P.xa,olympe.auth.P.xa,olympe.H.P.Oo,olympe.H.P.mq);ra(a,olympe.Za.P.Sg,olympe.H.P.Sg);C(a,olympe.H.P.Jd,[olympe.ra.P.xa,olympe.H.P.xa,olympe.auth.P.xa,olympe.Za.P.Sg,olympe.H.P.Wo,olympe.H.P.rp,olympe.H.P.Io,olympe.H.P.fr],(d,e,f,g,h,k,l,n)=>new olympe.H.dh(d.Rc('server.source'),
841
+ e,f,g,[h,k,l,n]));A(a,olympe.H.P.Ch,olympe.H.ak,olympe.H.P.up,olympe.H.P.Wn);ra(a,olympe.dc.da.P.Ch,olympe.H.P.Ch);ra(a,olympe.Za.P.um,olympe.H.P.Jd)},'olympe.communication');olympe.T.run([olympe.H.P.$n],a=>{olympe.H.Ba.Tc=()=>a});olympe.sc={};olympe.sc.P={Ea:'sc.Logger',sm:'sc.RootContext'};olympe.sc.Config={gf:'sc.app',eg:'sc.debug',Vs:'sc.disableTheme',PRODUCTION:'sc.production',eq:'sc.onstartTimeout',Eq:'sc.remoteActionTimeout',bq:'sc.offlineStart',ku:'google.apikey'};
842
+ olympe.T.config(a=>{D(a,olympe.sc.Config.gf,'');D(a,olympe.sc.Config.bq,!1);D(a,olympe.sc.Config.eg,!1);D(a,olympe.sc.Config.Vs,!1);D(a,olympe.sc.Config.PRODUCTION,!1);D(a,olympe.sc.Config.eq,2E4);D(a,olympe.sc.Config.ku,'AIzaSyD0rTnF3Tq-ZjgdaqyvC8Jg-RSgpZM2jBU');D(a,olympe.sc.Config.Eq,1E4);C(a,olympe.sc.P.Ea,[olympe.ra.P.xa],b=>b.Rc('sc'));C(a,olympe.sc.P.sm,[new olympe.T.fa(olympe.sc.Config.PRODUCTION),new olympe.T.fa(olympe.sc.Config.eq)],b=>{const c=new olympe.sc.Ta('root','root',null);olympe.sc.ls=
843
+ c;c.set(olympe.sc.Ta.jg.PRODUCTION,b);return c})},'olympe.sc');olympe.T.run([olympe.sc.P.sm],a=>{olympe.ij().ctx=a});olympe.sc.mn=()=>null!==olympe.dc.Oa().ic(void 0,olympe.sc.Runnable.F.Gc());olympe.sc.JC=(a,b,c,d)=>{c=a.create(olympe.sc.pc).setProperty(olympe.sc.pc.C,c||null).setProperty(olympe.sc.pc.N,d||null);a.Ra(olympe.sc.pc.F,c,b);a.Ra(olympe.dc.CloudObject.containsRel,b,c);return c.R()};olympe.sc.ih=a=>{a=olympe.dc.W.Vb.ih(a);return a instanceof olympe.sc.De?a.C():a};olympe.sc.YC=a=>{a=olympe.dc.CloudObject.get(a.tag);return a instanceof olympe.sc.De?a.C():a};
844
+ olympe.sc.VC=function(a){const b=olympe.dm.Qb.C.Gc(),c=olympe.dc.CloudObject.containsRel.Gc();var d=olympe.dc.wa(a);if(void 0===d)return[];a=olympe.dc.Oa();var e=a.model(d);const f=[],g=[];let h=[];if(a.Uf(e,olympe.dm.Qb))h.push(d);else{for(e=[];null===a.ic(d,b);){e.push(d);const k=a.ic(d,c);if(null===k)return olympe.ra.Xa('sc').warn(`Object ${d} has no container`),[];k===a.ic(d,olympe.dc.CloudObject.instancesRel)?(f.push(d),d=a.ic(k,c)):d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
845
+ }g.push(d);h.push(a.ic(g[0],b))}h=h.concat(a.Qf(h[0],olympe.dm.Qb.Ib));h=h.concat(a.Qf(h[h.length-1],olympe.dm.Zc.ha.Gc()));h=h.concat(a.Qf(h[h.length-1],olympe.dm.Zc.aa.Gc()));return[...f,...g,...h].reverse()};olympe.sc.WC=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.bk:a.startsWith('video/')?olympe.sc.zm:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.td:olympe.dm.File};let Li=0,Mi=0;function Ni(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.Lm&&c.pj()&&(a=Ni(c.children,b)))return a;return null}function Oi(a,b){if(a.children)for(const c of a.children.values())b(c)}function Pi(a,b){b=olympe.dc.wa(b);let c,d;return(null==(c=a.rj)?void 0:c.get('O#'+b))||(null==(d=a.rj)?void 0:d.get('IO#'+b))||b}
846
+ function Qi(a,b,c,d){const e='$'+b;a.ai.add(b);c.map(f=>'@'+f+'.'+b).forEach(f=>{let g,h;null==(g=a.Ld)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});Oi(a,f=>{!f.Rm&&f.ai.has(b)||f.data.has(e)||Qi(f,b,c,d)});a.ai.delete(b)}function Ri(a,b){b=olympe.dc.wa(b);let c,d;return(null==(c=a.rj)?void 0:c.get('I#'+b))||(null==(d=a.rj)?void 0:d.get('IO#'+b))||b}
847
+ function Si(a,b,c){a.ai.add(b);let d;const e=null==(d=a.Ld)?void 0:d.get('&'+b);if(e)for(const f of e.values())f(c);Oi(a,f=>{f.ai.has(b)||Si(f,b,c)});a.ai.delete(b)}function Ti(a,b){if(a.qe&&a.qe.has(b)){var c=a.qe.get(b);--c[0];0===c[0]&&(a.qe.delete(b),0===a.qe.size&&(a.qe=null),Sc(olympe.dc.Ad(),null,c[1]))}}function Ui(a,b){null===a.children&&(a.children=new Map);a.children.set(b.id,b)}
848
+ function Vi(a,b){let c;null==(c=a.children)||c.delete(b.Z());let d;0===(null==(d=a.children)?void 0:d.size)&&(a.children=null)}
849
+ olympe.sc.Ta=class{constructor(a,b,c=olympe.sc.ls){++Mi;this.id=a;this.hh=new Set;this.parent=c;this.zd=b||null;this.nc=new olympe.D.Xb('SC Context');this.data=new Map;this.qe=this.children=this.Ld=null;this.Sm=new Map;this.uid=Mi;this.Er=null;this.Lm=!1;this.ai=new Set;this.Rm=!1;this.L=olympe.ra.Xa('sc');this.rj=null;this.df()}Z(){return this.id}jn(){return this.uid}getParent(){return this.parent}Rk(){return this.Er}xc(){return this.nc}sn(a){this.Er=olympe.dc.wa(a);this.Lm=a.Pd().mn();a.aa().forEach(b=>
850
+ {this.hh.add(b)});this.rj=a.Y()}Lk(){this.Rm=!0;Oi(this,a=>{a.Lk()})}ll(){this.Rm=!1;Oi(this,a=>{a.ll()})}set(a,b){if(this.nc.G()||this.nc.Ab())return this;a=Pi(this,a);const c='$'+a;var d=this.data.get(c);d&&d.valueOf&&(d=d.valueOf());if(void 0===b||null===b)void 0!==d&&(this.data.delete(c),Qi(this,a,['*',this.id,...this.hh],null));else{var e;(e=void 0===d)||(e=!('function'===typeof b.qb?b.qb(d):b.valueOf()===d.valueOf()));e&&(this.data.set(c,b),Qi(this,a,['*',this.id,...this.hh],b))}return this}ni(a){return this.set(a,
851
+ Date.now())}remove(a){this.nc.Ab()||this.nc.G()||(a=Pi(this,a),this.data.delete('$'+a)&&Qi(this,a,['*',this.id,...this.hh],null))}Fb(a,b,c=!1){const d=olympe.dc.wa(a),e=olympe.D.Uc(b||Object,`Get context value flow source of ${d}`);e.node.onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.id:void 0));return e.Fb()}get(a,b=!1){a=this.bb(a,b);return void 0!==a?a:null}has(a,b=!1){a='$'+Ri(this,a);let c=this.data.has(a),d=this.parent;if(b)for(;!c&&d;)c=d.data.has(a),d=d.parent;return c}observe(a,
852
+ b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.id,!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Ri(this,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Kg(a.unsubscribe.bind(a));return this}gl(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Zh(`Runner ${olympe.D.bb(a.ma(),'')}`);a.run(b);return b}Kn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,
853
+ b,c))}il(a){this.set(olympe.sc.Ta.jg.dg,a);return this}bb(a,b=!0){a='$'+Ri(this,a);let c=this.data.get(a),d=this.parent;if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.parent;return c}on(a,b,c,d=!0){if(this.nc.Ab()||this.nc.G())return()=>{};const e=Ri(this,a),f=c?olympe.dc.wa(c):'*';a=this.Se('@'+f+'.'+e,b);c=c?(c=this.fi(f))?c.bb(e,!1):void 0:this.bb(e);void 0!==c&&b(c);d&&olympe.D.Ja().onDestroy(a);return a}Zh(a){const b='_'+olympe.W.hc();return this.nc.run(()=>new olympe.sc.Ta(b,a,this))}gn(a,
854
+ b){const c=olympe.dc.wa(a);var d;a=null==(d=this.children)?void 0:d.get(c);if(!a){a=this.nc.run(()=>new olympe.sc.Ta(c,b,this));for(d=this;d&&d.Lm&&d.pj();)d=d.parent;let e;null==(e=d)||Si(e,c,a)}return a}vj(a,b){const c=this.fi(a);if(c)return b(c),()=>{};const d=this.Se('&'+a,e=>{d&&d();b(e)});return d}fi(a){if(a===this.id||this.hh.has(a)||!a)return this;let b=this.parent;for(;b;){if(a===b.id||b.hh.has(a))return b;const c=Ni(b.children,a);if(c)return c;b=b.parent}return null}pj(){return!this.id.startsWith('_')}Nk(a,
855
+ b){this.qe||(this.qe=new Map);const c=this.qe.get(a);c?c[0]+=1:(this.qe.set(a,[1,b]),Sc(olympe.dc.Ad(),b))}destroy(){this.nc.G()||this.nc.Ab()||this.nc.destroy()}Kg(a,b){if(this.nc.Ab())a();else return b=b||String(++Li),this.Sm.set(b,a),b;return b||'noId'}tj(a){this.Sm.delete(a)}onDestroy(a){return this.nc.Ab()?(a(),'noId'):this.nc.onDestroy(a)}Ke(a){this.Ab()||this.nc.Ke(a)}clear(){this.nc.G()||this.nc.Ab()||(this.Sm.forEach(a=>a()),this.nc.aa())}df(){this.nc.zc(()=>{Oi(this,b=>b.destroy())});this.nc.onDestroy(()=>
856
+ {this.qe&&this.qe.forEach(([c],d)=>{for(let e=0;e<c;e++)Ti(this,d)});let b;null==(b=this.parent)||Vi(b,this);this.hh.clear();this.parent=null;null!==this.get(olympe.sc.Ta.jg.TRANSACTION)&&this.L.warn(`The context ${this.id} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`)});let a;null==(a=this.parent)||Ui(a,this)}Se(a,b){this.Ld||(this.Ld=new Map);let c=this.Ld.get(a);void 0===c&&(c=new Map,this.Ld.set(a,c));++Li;const d=Li;c.set(d,b);return()=>
857
+ {const e=this.Ld.get(a);e&&(e.delete(d),0===e.size&&this.Ld.delete(a))}}Ab(){return this.nc.Ab()}pn(){const a=this.bb(olympe.sc.Ta.jg.EDITION);return a?a:!1}$k(){const a=this.bb(olympe.sc.Ta.jg.PRODUCTION);return a?a:!1}};olympe.sc.Ta.prototype.clear=olympe.sc.Ta.prototype.clear;olympe.sc.Ta.prototype.offDestroy=olympe.sc.Ta.prototype.Ke;olympe.sc.Ta.prototype.onDestroy=olympe.sc.Ta.prototype.onDestroy;olympe.sc.Ta.prototype.offClear=olympe.sc.Ta.prototype.tj;olympe.sc.Ta.prototype.onClear=olympe.sc.Ta.prototype.Kg;
858
+ olympe.sc.Ta.prototype.destroy=olympe.sc.Ta.prototype.destroy;olympe.sc.Ta.prototype.getOtherContext=olympe.sc.Ta.prototype.fi;olympe.sc.Ta.prototype.onContext=olympe.sc.Ta.prototype.vj;olympe.sc.Ta.prototype.createChild=olympe.sc.Ta.prototype.Zh;olympe.sc.Ta.prototype.setParentElement=olympe.sc.Ta.prototype.il;olympe.sc.Ta.prototype.waitFor=olympe.sc.Ta.prototype.Kn;olympe.sc.Ta.prototype.runner=olympe.sc.Ta.prototype.gl;olympe.sc.Ta.prototype.repeat=olympe.sc.Ta.prototype.repeat;
859
+ olympe.sc.Ta.prototype.observe=olympe.sc.Ta.prototype.observe;olympe.sc.Ta.prototype.has=olympe.sc.Ta.prototype.has;olympe.sc.Ta.prototype.get=olympe.sc.Ta.prototype.get;olympe.sc.Ta.prototype.remove=olympe.sc.Ta.prototype.remove;olympe.sc.Ta.prototype.trigger=olympe.sc.Ta.prototype.ni;olympe.sc.Ta.prototype.set=olympe.sc.Ta.prototype.set;olympe.sc.Ta.prototype.getParent=olympe.sc.Ta.prototype.getParent;olympe.sc.Ta.ec={xt:'I#',xu:'O#',hA:'IO#'};
860
+ olympe.sc.Ta.jg={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',dg:'__htmlContainer',pz:'__dockableElement'};olympe.sc.Metadata=class extends olympe.dc.CloudObject{};olympe.sc.Metadata.O=olympe.dc.ya.C('0161ae936c62f9fcd131',olympe.sc.Metadata);olympe.sc.pc=class extends olympe.dc.CloudObject{F(){return this.Gb(olympe.sc.pc.N)}C(){return this.Gb(olympe.sc.pc.C)}};olympe.sc.pc.O=olympe.dc.ya.C('01703376c4a81c0e9d90',olympe.sc.pc);olympe.sc.pc.N=olympe.sc.pc.O.va('01703376c4a81c0e9d91');olympe.sc.pc.C=olympe.sc.pc.O.va('01703376c4a81c0e9d92');olympe.sc.pc.F=olympe.sc.pc.O.Ha('01703376c4a81c0e9d93');P(olympe.dc.CloudObject.O,olympe.sc.pc.F);olympe.sc.pc.prototype.F.K=olympe.D.J.F;olympe.sc.pc.prototype.C.K=olympe.D.J.F;olympe.sc.W={};function Wi(a,b){const c=Math.random().toString(36).substr(2)+Math.random().toString(36).substr(2);a.C.set(c,b);return c}
861
+ olympe.sc.W.kt=class{constructor(a,b,c){const d=olympe.net.cb.$d.GET,e=olympe.net.cb.$d.Hc,f=olympe.net.cb.$d.nk,g=olympe.net.cb.$d.em,h=olympe.net.cb.Headers.Mj,k=olympe.net.cb.Headers.si;this.L=a;this.G=b.aa([d,e,f,g],[h,k]);this.N=c;this.C=new olympe.W.wm(3E4);this.F=new olympe.D.Xb('FileService context')}start(a){var b=olympe.net.cb.$d.GET;const c=olympe.net.cb.$d.Hc,d=olympe.net.cb.$d.nk,e=olympe.net.cb.$d.em,f=olympe.net.cb.hd.Jh,g=olympe.net.cb.hd.it,h=olympe.net.cb.hd.Mq,k=olympe.net.cb.Headers.si,
862
+ l=olympe.net.cb.Headers.xs,n=`fileServer_${a}`;a=`/${this.N}/${a}/:${'fileTag'}`.replace(/\/+/g,'/').replace(/\/$/,'');this.L.debug(`Started file service with path : ${a}`);b=this.G.N(n,a,[b,c,d,e],(p,q)=>{if(p.method===e)return Promise.resolve(new olympe.net.Ug('',f,'',{[l]:'*'}));const r=p.jj()[k],t=this.C.get(r);if(!t)return Promise.resolve(new olympe.net.Ug('Invalid token',g,'Access denied'));this.C.delete(r);return t(p.jj(),q.get('fileTag'),p.body).catch(u=>Promise.resolve(new olympe.net.Ug(`Internal server error: ${u}`,
863
+ h,'Internal server error')))});this.F.onDestroy(()=>{this.G.Y(n).catch(p=>this.L.error(`An error occurred while stopping the file service: ${p}`))});return b}stop(){this.F.destroy()}};olympe.sc.Je={};olympe.sc.Je.tg={fz:null,Qu:'screenflow',jv:'ui-design',Oq:'software-intelligence',Pj:'data-management'};olympe.sc.oe=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Je.tg.Oq}F(){return this.tb(olympe.sc.oe.C,olympe.sc.logic.Oi)}G(){return this.tb(olympe.sc.oe.F,olympe.sc.logic.Nh)}};olympe.sc.oe.O=olympe.dc.ya.C('011100000000000adef0',olympe.sc.oe);olympe.sc.oe.C=olympe.sc.oe.O.Ha('016ac4f59a2917fdef01');olympe.sc.oe.F=olympe.sc.oe.O.Ha('016ac4f59a2917fdef02');olympe.sc.oe.prototype.F.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.sc.oe.prototype.G.K=new olympe.D.J(()=>olympe.dc.Ca,[]);function Xi(a,b){const c=[];for(const d of b)b=a.db.fb(d,olympe.sc.logic.Kc.C,!0),c[b]=d;return c}
864
+ olympe.sc.pb=class extends olympe.dm.BrickMetadata{Qt(a,b,c,d,e=!0){e||olympe.ra.Xa('sc').error('parameter own= false ignored, investigate');return olympe.D.cf(L(this.Pf(a,olympe.dc.W.Vb.ih,c)),d)}df(a){[].forEach(b=>b.call(this,a,(c,d)=>{null===d?a.remove(c):a.set(c,d)}))}gx(){return this.tb(olympe.sc.pb.aa,olympe.sc.Runnable)}sw(){return this.tb(olympe.sc.pb.ha,olympe.sc.Runnable)}rn(){return this.db.fb(this,olympe.sc.pb.Ib)}mn(){return null!==this.db.ic(this.tag,olympe.sc.Runnable.F.Gc())}Ul(){return this.tb(olympe.sc.pb.F,
865
+ olympe.sc.logic.Db)}dk(){return this.tb(olympe.sc.pb.N,olympe.sc.logic.Rb)}};olympe.sc.pb.O=olympe.dc.ya.C('0112000000000000def0',olympe.sc.pb);olympe.sc.pb.Ib=olympe.sc.pb.O.va('01692aa71f3108454479');olympe.sc.pb.ac=olympe.sc.pb.O.va('0166446c1f128ebc903a');olympe.sc.pb.aa=olympe.sc.pb.O.Ha('01692a4af82e8984742c');olympe.sc.pb.ha=olympe.sc.pb.O.Ha('01692a4af82e8984742d');olympe.sc.pb.Da=olympe.sc.pb.O.Ha('01692a4af82e8984742e');olympe.sc.pb.F=olympe.sc.pb.O.Ha('01621fb84e320000f00a');
866
+ olympe.sc.pb.N=olympe.sc.pb.O.Ha('01621fb84e320000f00b');olympe.sc.pb.He=olympe.sc.pb.O.Ha('0171838bcfed0000e00e');olympe.sc.pb.yd=olympe.sc.pb.O.Ha('0171838bcfed0000a00a');m=olympe.sc.pb.prototype;m.Qt.K=olympe.D.J.C;m.gx.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.sw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.rn.K=olympe.D.J.C;m.mn.K=olympe.D.J.C;m.Ul.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.dk.K=new olympe.D.J(()=>olympe.dc.Ca,[]);function Yi(a){const b=new olympe.dc.Transaction,c=b.create(a).persist(!1).R();b.hb();olympe.D.Ja().onDestroy(()=>{const d=new olympe.dc.Transaction;d.delete(c);d.hb()});return olympe.dc.CloudObject.get(c)}
867
+ function Zi(a,b){var c=a.Tb();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.F(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>b.Ab()||(b.clear(),null===h)?!1:(b.xc().run(a.update.bind(a,new olympe.sc.eb(b),Array.isArray(h)?h:[h],g)),!0))).subscribe(rxjs.Subscriber.create(h=>h?a.L.debug(e):a.L.debug(f),a.Ya.bind(a,b),()=>a.L.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
868
+ function $i(a,b,c,d){const e=d.xc(),f=V(a.db,b,c,e.C((g,h)=>{const k=d.gn(h);g?olympe.dc.CloudObject.get(h).run(k):k.destroy()}));e.zc(a.db.C.bind(a.db,b,c,f,!0))}function aj(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}
869
+ function bj(a,b,c){const d=olympe.D.Ja(),e=Bd(a.db,a.tag,d.C((f,g,h)=>{const k=h?c:b;null!==k&&(h&&b&&b(f,null),null===g||void 0===g?k(f,null):k(f,olympe.sc.ih(g)))}));d.onDestroy(()=>{Cd(a.db,a.tag,e)})}
870
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.L=c}run(a){const b=()=>{this.df(a);this.init(a);this.Pd().rn()?Zi(this,a):a.xc().run(this.update.bind(this,new olympe.sc.eb(a),[],[]));a.ni(olympe.sc.pb.ac);a.Kg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a))},c=a.getParent();c?c.xc().run(b):b()}Pd(){return this.oh()}init(a){this.onInit(a)}update(a,b,c){const d=this.Pd();if(d.rn())this.onUpdate(a,b,c);else this.L.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.jn()}`),
871
+ $i(this,d,olympe.sc.pb.aa,a),this.Sa()&&$i(this,d,olympe.sc.pb.Da,a)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}F(){return[]}onInit(){}onUpdate(){this.L.error(`Brick ${this.db.name(this.Tb())} (${this.Tb()}) is flagged as hardcoded, but method update() has not been overridden.`)}onDestroy(){}getInputs(){var a=this.Pd();return Xi(a,a.db.tb(a.tag,olympe.sc.pb.F))}getOutputs(){var a=this.Pd();return Xi(a,a.db.tb(a.tag,olympe.sc.pb.N))}aa(){return[]}Y(){return new Map}Sa(){return!1}G(a,
872
+ b,c,d){a=b.Fb(a,c,!0);void 0!==d&&olympe.D.cf(a,d);return a}Lb(a,b,c,d,e){olympe.D.An([d],f=>{b.set(a,olympe.D.cs(f)?f.valueOf():f)});return this.G(a,b,c,e)}df(a){a.sn(this);this.Pd().df(a);const b=this.N(),c=aj(a,b),d=[];b.forEach((e,f)=>{e===this.Da?d[0]=f:e===this.oa&&(d[1]=f)});void 0!==d[0]&&void 0!==d[1]&&(bj(this,c[d[0]],c[d[1]]),b[d[0]]=null,b[d[1]]=null);b.forEach((e,f)=>{e&&e.call(this,a,c[f])})}N(){return[this.Da,this.oa]}Da(a,b){bj(this,b,null)}oa(a,b){bj(this,null,b)}ac(a,b){const c=
873
+ this.db,d=olympe.sc.logic.xb.N.Gc(),e=olympe.sc.logic.xb.F,f=olympe.sc.logic.xb.C;this.Pr(d,g=>{var h=g.R();if(h=c.ic(h,e)||c.ic(h,f))g=g.df(a,b.bind(null,h)),olympe.D.Ja().onDestroy(g)})}Ya(a,b){const c=this.Tb();let d=this.db.name(c);try{const e=[a.Rk()];let f=a.getParent();for(;null!==f&&f!==olympe.sc.ls;)e.unshift(f.Rk()),f=f.getParent();d=e.map(g=>{if(null!==g){const h=this.db.model(g);return this.db.name(g)||h&&this.db.name(h)||g}return'?'}).join(' > ')}catch(e){this.L.warn(`Impossible to retrieve the stack for brick ${this.db.name(c)}.`)}this.L.error(`An error occurred in brick ${d} (${c}): ${b}\n${b.stack}`)}};
874
+ olympe.sc.Runnable.O=Mc(olympe.dc.ya.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.N=olympe.sc.Runnable.O.Ha('01692a4af82e8984742b');olympe.sc.Runnable.F=olympe.sc.Runnable.O.Ha('01756a18d4921c103111');olympe.sc.Runnable.U=P(olympe.sc.Runnable.O,olympe.sc.pb.aa);olympe.sc.Runnable.Y=P(olympe.sc.Runnable.O,olympe.sc.pb.ha);olympe.sc.Runnable.aa=P(olympe.sc.Runnable.O,olympe.sc.pb.Da);P(olympe.sc.pb.O,olympe.sc.Runnable.N);P(olympe.sc.pb.O,olympe.sc.Runnable.F);
875
+ olympe.sc.Runnable.prototype.Pd.K=new olympe.D.J(()=>olympe.sc.pb,[]);olympe.sc.Runnable.prototype.G.K=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.Lb.K=olympe.D.J.C;function cj(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.De)return(a=a.F())?a.valueOf():null;if('function'===typeof a.R)return a.R()}return null}olympe.sc.De=class extends olympe.dc.CloudObject{F(){return this.db.tb(this,olympe.sc.De.C)[0]}C(){return olympe.dc.CloudObject.get(cj(this))}toString(){const a=cj(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.De.O=olympe.dc.ya.C('0163c9ae01f2d6e9ca49',olympe.sc.De);olympe.sc.De.C=olympe.sc.De.O.Ha('0169b5a8a33144fb0b49');
876
+ P(olympe.dc.CloudObject.O,olympe.sc.De.C);olympe.sc.De.prototype.F.K=new olympe.D.J(()=>String,[]);olympe.sc.De.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.Bo=class extends olympe.dm.Qb{C(){return olympe.sc.Je.tg.Pj}};olympe.sc.Bo.O=olympe.dc.ya.C('0163a68ce44f3d1fa84c',olympe.sc.Bo);olympe.sc.ui=class extends olympe.dm.BrickMetadata{};olympe.sc.ui.O=olympe.dc.ya.C('016324fde11a836f76c2',olympe.sc.ui);let dj=null;
877
+ function ej(a,b){dj=a;(new olympe.dc.lf(a,olympe.dc.Ed.Ni)).sb(olympe.sc.Ma.Ne.C).sb(olympe.sc.md.F.Gc()).hb((c,d)=>{if(c)olympe.ra.Xa('sc').error('Error while loading business container:',c.message),b(olympe.sc.md.C.cc);else{c=null;for(const [e,f]of d.Dc.ld())e===olympe.sc.md.F.R()&&(c=f);null!==c?df(Ze(new olympe.dc.lf(c),olympe.dc.Ub.uf),(e,f)=>{const g=olympe.dc.lc.Xc,h=olympe.dc.lc.zi,k=f.R();f=f.Pa();return olympe.dc.Oa().rh(e,olympe.sc.ui)&&f===olympe.dc.Aa.ORIGIN&&(k===g||k===h)}).hb(()=>
878
+ b(olympe.sc.md.C.Hp)):(olympe.ra.Xa('sc').error('No container found for the application',a),b(olympe.sc.md.C.bm))}})}olympe.sc.md=class extends olympe.dc.CloudObject{};olympe.sc.md.C={Hp:0,bm:1,cc:2};olympe.sc.md.O=olympe.dc.ya.C('017b3aa8fae1e3d044dc',olympe.sc.md);olympe.sc.md.F=olympe.sc.md.O.Ha('017b3aa8fd1659291b92');olympe.sc.md.N=olympe.sc.md.O.Ha('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.ya.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Xg=class extends olympe.sc.Map{};olympe.sc.Xg.O=olympe.dc.ya.C('01631aacd8276ea98490',olympe.sc.Xg);olympe.sc.bk=class extends olympe.dm.File{N(){const a=olympe.D.Uc(olympe.D.Wa);this.Tk(b=>{a.update(olympe.D.Bb(b))});return a.Fb()}};olympe.sc.bk.O=Hc('01644b6297305d62fca2',olympe.sc.bk);olympe.sc.bk.prototype.N.K=olympe.D.J.F;olympe.sc.td=class extends olympe.dm.File{N(){return this.Gb(olympe.sc.td.F)}U(){return this.Gb(olympe.sc.td.N)}Y(){return this.Ie(olympe.sc.td.aa)}};olympe.sc.td.O=Hc('01647e113043c637b541',olympe.sc.td);olympe.sc.td.F=olympe.sc.td.O.va('01647e35ecd24ef0b88d');olympe.sc.td.N=olympe.sc.td.O.va('01647e677f5d1cfbdf42');olympe.sc.td.aa=olympe.sc.td.O.va('01647e6780999bf8bd25');olympe.sc.td.prototype.N.K=olympe.D.J.F;olympe.sc.td.prototype.U.K=olympe.D.J.F;olympe.sc.td.prototype.Y.K=olympe.D.J.G;olympe.sc.zm=class extends olympe.dm.File{};olympe.sc.zm.O=Hc('0164643c432146a71d5c',olympe.sc.zm);olympe.sc.ur=class extends olympe.dc.CloudObject{};olympe.sc.ur.O=olympe.dc.ya.C('016421bb3797e22d1c4e',olympe.sc.ur);olympe.sc.logic={};olympe.sc.logic.gp=(a,b)=>a===b?0:a>b?1:-1;
879
+ olympe.sc.logic.lA=(a,b,c,d,e,f,g)=>{const h=b.R();b=olympe.D.bb(b.C().R());let k,l;if(b===olympe.dc.wa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.Gb(h).toLowerCase();else if(b===olympe.dc.wa(olympe.dm.Number))k=c.valueOf(),l=p=>p.Ie(h);else if(b===olympe.dc.wa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.Fa([p.lj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.Oa().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
880
+ return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.gp(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.gp(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.wg().filter(p=>olympe.D.Fa([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Cc(d.valueOf()?1===q:0<=q)},olympe.D.qa,'FilterList ListDefBuilder Filter TransformFlows')).qf())};
881
+ olympe.sc.logic.GC=(a,b)=>{if(a instanceof olympe.D.ea)return a;if(a instanceof olympe.D.Wa)return a.rs();if(a instanceof olympe.D.qa)return a.Ur();if('string'===typeof a||'number'===typeof a)return olympe.D.za(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ea.Up};olympe.sc.logic.ta={};olympe.sc.logic.ta.To=class{constructor(a,b,c){this.O=olympe.dc.ya.C(a,b,...c)}R(){return this.O.R()}};olympe.sc.logic.ta.To.la=[olympe.dc.Ae];const fj=Object.create(null),gj=new Map;function hj(a){if(void 0===fj[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Jc(a)}function ij(a,b,c=olympe.sc.logic.Function){if(gj.has(a))throw c=hj(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.ya.C(a,b,...[]);gj.set(a,{O:d,SC:b,FC:c});return d}
882
+ olympe.sc.logic.ya=class{constructor(){}static C(a,b,...c){if(fj[a])throw c=hj(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.ta.To(a,b,[olympe.sc.P.Ea].concat(c));return fj[a]=b}};olympe.sc.logic.lz=class{};olympe.sc.logic.Nj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Nj.O=olympe.dc.ya.C('01621fb84e320000cf00',olympe.sc.logic.Nj);olympe.sc.logic.Error=class{constructor(a,b){this.code=a;this.es=b}static create(a,b){return new olympe.sc.logic.Error(b,a)}Pw(){return this.es}qw(){return this.code}};z('olympe.sc.logic.Error',olympe.sc.logic.Error);olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.qw;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Pw;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;
883
+ olympe.sc.logic.Sj=class extends olympe.sc.logic.Nj{static create(a,b){return new olympe.sc.logic.Error(b,a)}};olympe.sc.logic.Sj.O=olympe.dc.ya.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Sj);olympe.sc.logic.me=class extends olympe.dc.CloudObject{C(){return this.rc(olympe.sc.logic.me.C,olympe.dc.CloudObject)}};olympe.sc.logic.me.O=olympe.dc.ya.C('016ac4f59ee8ea2081ba',olympe.sc.logic.me);olympe.sc.logic.me.N=olympe.sc.logic.me.O.va('017bc044aeacce7ffc8f');olympe.sc.logic.me.C=olympe.sc.logic.me.O.Ha('016ac4f5a0091c4790e2');P(olympe.dc.CloudObject.O,olympe.sc.logic.me.C);olympe.sc.logic.me.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Oi=class extends olympe.sc.logic.me{};olympe.sc.logic.Oi.O=olympe.dc.ya.C('016ac4f59c592b862457',olympe.sc.logic.Oi);olympe.sc.logic.Oi.F=olympe.sc.oe.C.Gc();olympe.sc.logic.Nh=class extends olympe.sc.logic.me{};olympe.sc.logic.Nh.O=olympe.dc.ya.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Nh);olympe.sc.logic.Nh.F=P(olympe.sc.logic.Nh.O,olympe.sc.oe.F);olympe.sc.logic.ye=class extends olympe.sc.pb{C(){return olympe.sc.Je.tg.Oq}ha(){return this.cn().wg().rh([olympe.sc.logic.Function]).and().not().rh([olympe.sc.logic.Vd,olympe.sc.logic.Yd]).qf()}Iw(){return this.Ul().wg().mj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Oi.F]).qf()}Jw(){return this.dk().wg().mj([olympe.dc.CloudObject.modelRel,olympe.sc.logic.Nh.F]).qf()}de(a){const b=this.db.$m(this,[olympe.sc.pb.F],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}Kf(a){const b=
884
+ this.db.$m(this,[olympe.sc.pb.N],c=>this.db.model(c)===olympe.dc.wa(a));return b?olympe.dc.CloudObject.get(b):null}ox(){return this.Ul().wg().mj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Db).qf()}px(){return this.dk().wg().mj([olympe.dc.CloudObject.modelRel],olympe.sc.logic.Rb).qf()}};ij('01621fb84e320000f000',olympe.sc.logic.ye,olympe.sc.logic.Function);m=olympe.sc.logic.ye.prototype;m.Iw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.Jw.K=new olympe.D.J(()=>olympe.dc.Ca,[]);
885
+ m.de.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Kf.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.ox.K=new olympe.D.J(()=>olympe.dc.Ca,[]);m.px.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.sc.logic.bg=class extends olympe.sc.logic.ye{F(){return this.de('016ac63229782039429f')}G(){return this.Kf('016ac6322acf67eebfe7')}N(){return this.dk().wg().sb(olympe.sc.logic.Kc.typeRel).Xk(olympe.sc.logic.Sj).qf().pf().nn(olympe.D.ea.ZERO)}};olympe.sc.logic.bg.C='016ac63229782039429f';olympe.sc.logic.bg.oa='016ac6322acf67eebfe7';olympe.sc.logic.bg.O=ij('01621fb84e320000a000',olympe.sc.logic.bg,olympe.sc.logic.Action);
886
+ olympe.sc.logic.bg.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.bg.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.bg.prototype.N.K=olympe.D.J.U;olympe.sc.logic.po=class extends olympe.sc.logic.ye{};olympe.sc.logic.po.O=ij('01621fb84e320000f011',olympe.sc.logic.po);olympe.sc.logic.oo=class extends olympe.sc.logic.bg{};olympe.sc.logic.oo.O=ij('01621fb84e320000f012',olympe.sc.logic.oo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.ac]}Y(){const a=olympe.sc.Ta.ec.xt,b=olympe.sc.Ta.ec.xu,c=this.db,d=new Map;this.getInputs().forEach(e=>{d.set(a+c.name(e),e)});this.getOutputs().forEach(e=>{d.set(b+c.name(e),e)});return d}F(a){return this.getOutputs().map(b=>this.db.al(b,olympe.sc.logic.Kc.typeRel,olympe.sc.logic.Nj)?a.ni.bind(a,b):a.set.bind(a,b))}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
887
+ c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.O=olympe.dc.ya.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ea);olympe.sc.logic.Kc=class extends olympe.dc.CloudObject{C(){return this.rc(olympe.sc.logic.Kc.typeRel,olympe.dc.CloudObject)}F(){return this.Ie(olympe.sc.logic.Kc.C)}};olympe.sc.logic.Kc.O=olympe.dc.ya.C('0168a431d25001540000',olympe.sc.logic.Kc);olympe.sc.logic.Kc.C=olympe.sc.logic.Kc.O.va('01740c5d4ae4b520dd01');olympe.sc.logic.Kc.typeRel=olympe.sc.logic.Kc.O.Ha('0168a431d3b9b7438424');P(olympe.dc.CloudObject.O,olympe.sc.logic.Kc.typeRel);
888
+ olympe.sc.logic.Kc.prototype.C.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Kc.prototype.F.K=olympe.D.J.G;olympe.sc.logic.Db=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Db.O=olympe.dc.ya.C('0168a431d25001540001',olympe.sc.logic.Db);olympe.sc.logic.Db.oa=olympe.sc.logic.Kc.O.va('01740c5d4ae4b520dd02');olympe.sc.logic.Db.ha=P(olympe.sc.logic.Db.O,olympe.sc.pb.F);olympe.sc.logic.Db.F=olympe.sc.logic.Db.O.Ha('0168a431d91f2578000b',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Db.N=olympe.sc.logic.Db.O.Ha('01621fb84e32000000a1',olympe.dc.Aa.ORIGIN);
889
+ olympe.sc.logic.Db.aa=olympe.sc.logic.Db.O.Ha('01621fb84e32000000d1',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Rb=class extends olympe.sc.logic.Kc{};olympe.sc.logic.Rb.O=olympe.dc.ya.C('0168a431d25001540002',olympe.sc.logic.Rb);olympe.sc.logic.Rb.ha=P(olympe.sc.logic.Rb.O,olympe.sc.pb.N);olympe.sc.logic.Rb.F=olympe.sc.logic.Rb.O.Ha('0168a431d91f25780003',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Rb.aa=olympe.sc.logic.Rb.O.Ha('01621fb84e32000000a2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Rb.N=olympe.sc.logic.Rb.O.Ha('01621fb84e32000000d2',olympe.dc.Aa.ORIGIN);olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.Pd().F().R();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.O=olympe.dc.ya.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.P.Ea);olympe.sc.logic.Vd=class extends olympe.sc.logic.Function{run(a){this.df(a);const b=a.getParent(),c=this.db.ic(this,olympe.sc.logic.Vd.C),d=this.db.ic(this,olympe.sc.logic.Vd.G);a.on(c,e=>b.set(d,e),this.tag)}U(){return this.rc(olympe.sc.logic.Vd.C,olympe.sc.logic.Db)}ab(){return this.rc(olympe.sc.logic.Vd.G,olympe.sc.logic.Rb)}};olympe.sc.logic.Vd.O=olympe.dc.ya.C('01621fb84e32000000a0',olympe.sc.logic.Vd,olympe.sc.P.Ea);olympe.sc.logic.Vd.C=P(olympe.sc.logic.Vd.O,olympe.sc.logic.Db.N);
890
+ olympe.sc.logic.Vd.G=P(olympe.sc.logic.Vd.O,olympe.sc.logic.Rb.aa);olympe.sc.logic.Vd.prototype.U.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.Vd.prototype.ab.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.Yd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.ic(this,olympe.sc.logic.Yd.G),d=this.db.ic(this,olympe.sc.logic.Yd.C);b.on(c,e=>a.set(d,e),b.Z())}ab(){return this.rc(olympe.sc.logic.Yd.G,olympe.sc.logic.Db)}U(){return this.rc(olympe.sc.logic.Yd.C,olympe.sc.logic.Rb)}};olympe.sc.logic.Yd.O=olympe.dc.ya.C('01621fb84e32000000d0',olympe.sc.logic.Yd,olympe.sc.P.Ea);olympe.sc.logic.Yd.G=P(olympe.sc.logic.Yd.O,olympe.sc.logic.Db.aa);
891
+ olympe.sc.logic.Yd.C=P(olympe.sc.logic.Yd.O,olympe.sc.logic.Rb.N);olympe.sc.logic.Yd.prototype.ab.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.Yd.prototype.U.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.xb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.L=c;this.C=`detachObject${this.tag}`}df(a,b){const c=this.db.ic(this,olympe.sc.logic.xb.oa)||this.db.ic(this,olympe.sc.logic.xb.aa),d=this.db.ic(this,olympe.sc.logic.xb.ha),e=this.db.Uf((()=>{let h=null,k=this.db.ic(this,olympe.sc.logic.xb.F);k?h=this.db.ic(k,olympe.dm.Property.typeRel):(k=this.db.ic(this,olympe.sc.logic.xb.C))&&(h=this.db.ic(k,olympe.sc.logic.Kc.typeRel));return h||olympe.dc.CloudObject.O.R()})(),
892
+ olympe.dm.sf)?new olympe.D.Xb('Pipe Context'):null,f=this.F.bind(this,a,b,e);if(null!==c&&null!==d){let h;const k=a.vj(d,l=>{h&&h();h=l.on(c,f,d)});return()=>{f(null);k();h&&h()}}const g=Ad(this.db,this,olympe.sc.logic.xb.valueProp,f);return()=>{f(null);this.db.F(this,olympe.sc.logic.xb.valueProp,g)}}F(a,b,c,d){null!==c&&c.aa();const e=a.get(this.C);e&&(e(),a.remove(this.C));const f=olympe.sc.ih(d);if(f instanceof olympe.dc.CloudObject){if(d=f.R(),this.Nk(a,d,[d]),null!==c&&'function'===typeof f.getValue){c.run(()=>
893
+ {olympe.D.Ec([f.getValue()],g=>{b(g.valueOf())})});return}}else f instanceof olympe.dc.Va&&this.Nk(a,`qr-${f.hash}`,De(f));b(f)}Nk(a,b,c){const d=a.getParent();d.Nk(b,c);a.set(this.C,()=>Ti(d,b))}getValue(a){return this.Pf(olympe.sc.logic.xb.valueProp,a||olympe.dc.W.Vb.ih,Object)}Rt(){const a=this.transform(olympe.sc.logic.xb.C,olympe.sc.logic.Kc.typeRel);a.Gd(olympe.dc.CloudObject);return a.Sc()}mx(){return this.rc(olympe.sc.logic.xb.ha,olympe.dc.CloudObject)}kx(){return this.rc(olympe.sc.logic.xb.oa,
894
+ olympe.sc.logic.Rb)}lx(){return this.rc(olympe.sc.logic.xb.aa,olympe.dm.Property)}Aw(){return this.rc(olympe.sc.logic.xb.N,olympe.dc.CloudObject)}yw(){return this.rc(olympe.sc.logic.xb.C,olympe.sc.logic.Db)}zw(){return this.rc(olympe.sc.logic.xb.F,olympe.dm.Property)}};olympe.sc.logic.xb.O=olympe.dc.ya.C('0168a431d91f25780000',olympe.sc.logic.xb,olympe.sc.P.Ea);olympe.sc.logic.xb.valueProp=olympe.sc.logic.xb.O.va('0168a431d91f25780001');olympe.sc.logic.xb.ha=olympe.sc.logic.xb.O.Ha('0168a431d91f25780002');
895
+ olympe.sc.logic.xb.oa=P(olympe.sc.logic.xb.O,olympe.sc.logic.Rb.F);olympe.sc.logic.xb.aa=olympe.sc.logic.xb.O.Ha('0168a431d91f25780004');olympe.sc.logic.xb.N=olympe.sc.logic.xb.O.Ha('0168a431d91f2578000a');olympe.sc.logic.xb.C=P(olympe.sc.logic.xb.O,olympe.sc.logic.Db.F);olympe.sc.logic.xb.F=olympe.sc.logic.xb.O.Ha('0168a431d91f2578000c');P(olympe.dc.CloudObject.O,olympe.sc.logic.xb.ha);P(olympe.dm.Property.O,olympe.sc.logic.xb.aa);P(olympe.dc.CloudObject.O,olympe.sc.logic.xb.N);
896
+ P(olympe.dm.Property.O,olympe.sc.logic.xb.F);m=olympe.sc.logic.xb.prototype;m.Rt.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.mx.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.kx.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.lx.K=new olympe.D.J(()=>olympe.dm.Property,[]);m.Aw.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.yw.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.zw.K=new olympe.D.J(()=>olympe.dm.Property,[]);olympe.sc.logic.Xd=class extends olympe.sc.logic.Function{};olympe.sc.logic.Xd.O=olympe.dc.ya.C('017dc8c114aa61a0e27f',olympe.sc.logic.Xd);olympe.sc.logic.Xd.C=olympe.sc.logic.Xd.O.Ha('017dc8d6d8ef9135f08a');olympe.sc.logic.Xd.G=olympe.sc.logic.Xd.O.Ha('017dc8d6d8ef9135f08b');P(olympe.dm.Nb.O,olympe.sc.logic.Xd.G);function jj(a,b){const c=a.Pd(),d=c.Vl().R(),e=c.Wl().R(),f=c.Xl().R();b.on(d,g=>{g&&(g=new Map(a.getInputs().map(h=>[h,b.get(h)])),g=olympe.sc.logic.vk.ja(g),olympe.H.Ba.nb.zb.get(a.Tb(),g).then(h=>{h=kj(h,a.U.bind(a,b));for(const [k,l]of h)k!==e&&k!==f&&b.set(k,l);b.set(e,h.get(e));b.set(f,h.get(f))}).catch(h=>{b.set(f,olympe.sc.logic.Sj.create(h.toString(),1))}))},b.Z())}
897
+ function lj(a,b,c,d,e,f){const g=n=>{if(null!==n){e.cancel();k&&k();l&&l();try{const p=new Map(a.getOutputs().map(r=>[r,b.get(r)])),q=olympe.sc.logic.vk.ja(p);f.Me(q).finally(()=>b.destroy())}catch(p){n=Error(`Error while serializing the response from remote action ${a.Tb()}: ${p.message}`),f.yg(n).finally(()=>b.destroy())}}},h=b.Z(),k=b.on(c,g,h),l=b.on(d,g,h)}
898
+ olympe.sc.logic.Oh=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e){super(a,b,c);this.ab=d;this.timeout=e}run(a){a.pn()||(this.db.fb(this,olympe.sc.logic.Oh.C)?this.wc(a):(this.df(a),jj(this,a)))}wc(a){const b=this.Tb(),c=this.Pd(),d=c.Cp().R(),e=c.Vl().R(),f=c.Wl().R(),g=c.Xl().R();(new olympe.H.Ba.nb.zb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Zh('remote call'),l=kj(h.body(),this.U.bind(this,k)),n=Hb(()=>{h.yg(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
899
+ k.destroy()},this.timeout);lj(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.Dj().then(p=>{var q=k.get(d);null!==q&&olympe.dc.wa(q)!==p&&(q=this.Tb(),this.L.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))})},h=>{const k=this.Tb();this.L.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}U(a,b){const c=Array.from(b.ee()).map(d=>d.tag());
900
+ Nc(this.ab,a.xc(),b,[],c)}};olympe.sc.logic.Oh.O=olympe.dc.ya.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Oh,olympe.sc.P.Ea,olympe.dc.db.P.xa,new olympe.T.fa(olympe.sc.Config.Eq));olympe.sc.logic.Oh.C=olympe.sc.logic.Oh.O.va('017a7b0c62a02a89444f');function kj(a,b){var c=(new olympe.dc.W.Mi(olympe.dc.Ga.Pc)).C(a.p||[]);b&&b(c);c=new Map;for(const [d,e]of Object.entries(a.v||{}))c.set(d,mj(olympe.sc.logic.vk,e,b));return c}function nj(a){a.Dc=new olympe.dc.db.Ac;a.values=Object.create(null)}
901
+ function mj(a,b,c){if(null===b||void 0===b)return null;switch(b.t){case 1:return new Date(b.d);case 2:return olympe.D.Color.create(b.r,b.g,b.b,b.a);case 3:return olympe.sc.logic.Error.create(b.m,b.c);case 4:return olympe.dc.CloudObject.get(b.v);case 5:return xe(b.v);case 6:return Ge(b.v,c);case 7:return new Map(Object.entries(b.m).map(([d,e])=>[d,mj(a,e,c)]));default:return Array.isArray(b)?b.map(d=>mj(a,d,c)):'object'===typeof b?Object.entries(b).reduce((d,[e,f])=>{d[e]=mj(a,f,c);return d},{}):b}}
902
+ function oj(a,b){var c=a.db;a=a.Dc;if(c.Eb(b)){a.F(b,c.kd(b,!0),0);a.Ra(olympe.dc.lc.Xc,b,c.model(b),0);for(const [d,e,f]of Ed(c,b))(c=a.Mf(f))&&c.se()&&(e===olympe.dc.Aa.DESTINATION?a.Ra(d,b,f,0):a.Ra(d,f,b,0))}else olympe.ra.Xa('Remote Action').error(`Try to serialize an instance ${b} that does not exist in the local datacloud.`)}
903
+ olympe.sc.logic.vk=class{constructor(){this.db=olympe.dc.Oa();nj(this)}static ja(a){const b=new olympe.sc.logic.vk;a.forEach((c,d)=>{null!==c&&void 0!==c&&(b.values[d]=b.C(c))});return b.flush()}flush(){const a=Object.create(null),b=new olympe.dc.transaction.vd;this.Dc.Qc(b);a.p=de(b);a.v=this.values;nj(this);return a}C(a){switch(!0){case a instanceof olympe.D.jb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return{t:2,
904
+ r:a.Rf().valueOf(),g:a.Lf().valueOf(),b:a.Gf().valueOf(),a:a.Ff().valueOf()};case a instanceof olympe.sc.logic.Error:return{t:3,c:a.code,m:a.es};case a&&'function'===typeof a.R:return a=a.R(),oj(this,a),{t:4,v:a};case a instanceof olympe.dc.gb:return{t:5,v:a.ja()};case a instanceof olympe.dc.Va:return{t:6,v:a.ja()};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof Map:const b=Object.create(null);for(const [c,d]of a)'string'===typeof c&&(b[c]=this.C(d));return{t:7,m:b};case null===
905
+ a:case void 0===a:return null;case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:return a}}};olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Pl=class{constructor(a){this.db=olympe.dc.Oa();this.typeRel=a}};olympe.sc.logic.controllers.Pl.C={mz:-1,gA:1};olympe.sc.logic.controllers.KA=class extends olympe.sc.logic.controllers.Pl{constructor(){super(olympe.sc.logic.me.C)}};olympe.sc.logic.controllers.MA=class extends olympe.sc.logic.controllers.Pl{constructor(){super(olympe.sc.logic.Kc.typeRel)}};olympe.sc.logic.Qk={};olympe.sc.logic.Qk.$u=class extends olympe.sc.logic.Function{update(a,[b,c],[d]){const e=olympe.dc.wa(b);e?ef(Ze(new olympe.dc.lf(e),olympe.dc.Ub.uf),c).hb(()=>{d(olympe.dc.CloudObject.get(e))}):this.L.warn('Cannot subscribe to an instance with no tag: '+e)}};olympe.sc.logic.ya.C('0174bf4b7e006e4b788a',olympe.sc.logic.Qk.$u);olympe.sc.logic.actions={};olympe.sc.logic.Qk.gu=class extends olympe.sc.logic.Function{run(a){this.df(a);const [b,c,d]=this.F(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.L.warn('No list to iter upon'),this.L.info(a.Z())):f<e?(b(g.We(f)),f++,c((new Date).getTime())):(h.ll(),d((new Date).getTime()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.Ag();f=0;h.Lk();k();break;case 2:k();break;default:this.L.error('Unhandled input')}},this.tag))}};
906
+ olympe.sc.logic.ya.C('0171889b060b6cd54300',olympe.sc.logic.Qk.gu);olympe.sc.logic.bc={};olympe.sc.logic.bc.to=class extends olympe.sc.logic.ye{F(){return this.de('017dc92292107fb98b21')}};ij('017dc8d6c8fd8c8bd2f0',olympe.sc.logic.bc.to);olympe.sc.logic.bc.to.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.bc.Rl=class extends olympe.sc.logic.ye{F(){return this.de('016ac63808535703691c')}};olympe.sc.logic.bc.Rl.O=ij('0169b6876a03f139d50a',olympe.sc.logic.bc.Rl);olympe.sc.logic.bc.Rl.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.bc.fm=class extends olympe.sc.logic.ye{F(){return this.de('016ac63809a9a8e6db96')}G(){return this.Kf('016ac6380ab003363b3e')}};ij('01646ad602f933b8caaf',olympe.sc.logic.bc.fm);olympe.sc.logic.bc.fm.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.bc.fm.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.bc.lk=class extends olympe.sc.logic.ye{F(){return this.de('016ac6380bd98f1d91a0')}N(){return this.Kf('016ac63c589ae38ca3ae')}G(){return this.Kf('016ac63c5a377fceabaa')}};ij('0168ec42fc01747a98b6',olympe.sc.logic.bc.lk);olympe.sc.logic.bc.lk.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.logic.bc.lk.prototype.N.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.bc.lk.prototype.G.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.logic.bc.$g=class extends olympe.sc.logic.ye{Vl(){return this.de('017a7b07b09e3b22c8b4')}Cp(){return this.de('017a7b07ba05807a74b0')}Wl(){return this.Kf('017a7b0818c12388d731')}Xl(){return this.Kf('017a7b085146d5e69aec')}St(){return olympe.D.qa.F}};olympe.sc.logic.bc.$g.oa='017a7b07b09e3b22c8b4';olympe.sc.logic.bc.$g.Lc='017a7b07ba05807a74b0';olympe.sc.logic.bc.$g.wc='017a7b0818c12388d731';olympe.sc.logic.bc.$g.C='017a7b085146d5e69aec';
907
+ olympe.sc.logic.bc.$g.O=ij('017a7b07a948e30508fa',olympe.sc.logic.bc.$g,olympe.sc.logic.Oh);m=olympe.sc.logic.bc.$g.prototype;m.Vl.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Cp.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Wl.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.Xl.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);m.St.K=olympe.D.J.U;olympe.sc.logic.bc.Yq=class extends olympe.sc.logic.ye{F(){return this.de('016ac63c5b3ed0562740')}};ij('016a9766c230916ea5ec',olympe.sc.logic.bc.Yq);olympe.sc.logic.bc.Yq.prototype.F.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);olympe.sc.query={};olympe.sc.query.Un=class extends olympe.sc.Xg{};olympe.sc.query.Un.O=olympe.dc.ya.C('01631aacd8276ea98491',olympe.sc.query.Un);olympe.sc.query.jq=class extends olympe.dm.Enum{};olympe.sc.query.jq.O=olympe.dc.ya.C('01631aacd8276ea98495',olympe.sc.query.jq);olympe.sc.query.uq=class extends olympe.dm.Enum{};olympe.sc.query.uq.O=olympe.dc.ya.C('01631aacd8276ea98494',olympe.sc.query.uq);olympe.sc.query.wq=class extends olympe.sc.Xg{};olympe.sc.query.wq.O=olympe.dc.ya.C('01631aacd8276ea98492',olympe.sc.query.wq);olympe.sc.query.xq=class extends olympe.dc.CloudObject{};olympe.sc.query.xq.O=olympe.dc.ya.C('01631aacd8276ea98493',olympe.sc.query.xq);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.ya.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe13a');
908
+ olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.va('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.Ha('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.Ha('017ffdd8f0b1e31fe13f');olympe.sc.workflow.tf=class extends olympe.sc.logic.ye{Tt(){return this.de('017ffe02381f9fac5060')}Wt(){return this.de('017ffe02381f9fac5061')}Xt(){return this.de('017ffe02381f9fac5062')}ww(){return this.de('017ffe02381f9fac5065')}Ut(){return this.Kf('017ffe02381f9fac5063')}Vt(){return this.Kf('017ffe02381f9fac5064')}};olympe.sc.workflow.tf.O=ij('017ffde21f5fe0f704ce',olympe.sc.workflow.tf);olympe.sc.workflow.tf.C='017ffe02381f9fac5060';olympe.sc.workflow.tf.Ve='017ffe02381f9fac5061';
909
+ olympe.sc.workflow.tf.Ye='017ffe02381f9fac5062';olympe.sc.workflow.tf.wc='017ffe02381f9fac5065';olympe.sc.workflow.tf.oa='017ffe02381f9fac5063';olympe.sc.workflow.tf.Lc='017ffe02381f9fac5064';m=olympe.sc.workflow.tf.prototype;m.Tt.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Wt.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.Xt.K=new olympe.D.J(()=>olympe.sc.logic.Db,[]);m.ww.K=new olympe.D.J(()=>Map,[]);m.Ut.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);
910
+ m.Vt.K=new olympe.D.J(()=>olympe.sc.logic.Rb,[]);olympe.sc.workflow.Re=class extends olympe.dm.BrickMetadata{Vc(){return this.rc(olympe.sc.workflow.Workflow.statesRel.Gc(),olympe.sc.workflow.Workflow).ma().concat(['.',this.ma()])}};olympe.sc.workflow.Re.O=olympe.dc.ya.C('017ffdc2dda51d46b430',olympe.sc.workflow.Re);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.Yr()}C(){return this.rc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Re)}G(){return this.rc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Re)}Vc(){const a=this.rc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Re);return a.rc(olympe.sc.workflow.Workflow.statesRel.Gc(),olympe.sc.workflow.Workflow).ma().concat(['.',a.ma(),'->',this.ma()])}};
909
911
  olympe.sc.workflow.Transition.O=olympe.dc.ya.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.va('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.Ha('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.Ha('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.K=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
910
- olympe.sc.workflow.Transition.prototype.C.K=new olympe.D.J(()=>olympe.sc.workflow.Qe,[]);olympe.sc.workflow.Transition.prototype.G.K=new olympe.D.J(()=>olympe.sc.workflow.Qe,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ie.sg.Nj}L(){return this.Bg(olympe.sc.workflow.Workflow.serializationEnabledProp)}F(){return this.qc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.si)}G(){return this.qc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Qe)}};olympe.sc.workflow.Workflow.O=olympe.dc.ya.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.va('017ffdc010e5bcc9c972');
911
- olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.Ha('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.Ha('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.Ha('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.L.K=olympe.D.J.U;olympe.sc.workflow.Workflow.prototype.F.K=new olympe.D.J(()=>olympe.sc.si,[]);
912
- olympe.sc.workflow.Workflow.prototype.G.K=new olympe.D.J(()=>olympe.sc.workflow.Qe,[]);olympe.sc.Ma={};olympe.sc.Ma.Me=class extends olympe.sc.pb{C(){return olympe.sc.Ie.sg.Nu}};olympe.sc.Ma.Me.O=Ic(olympe.dc.ya.C('01120300000000adef00',olympe.sc.Ma.Me));olympe.sc.Ma.Me.C=olympe.sc.Ma.Me.O.Ha('0171bc1f15da96dfdb89');P(olympe.dm.Zc.O,olympe.sc.Ma.Me.C);olympe.sc.Ma.Fj=class extends olympe.sc.Runnable{aa(){return[this.Tb()]}U(){return olympe.dc.od.from(this.Tb()).sb(olympe.sc.Ma.Me.C).jd()}};olympe.sc.Ma.Fj.O=Ic(olympe.dc.ya.C('0113030000000aca1100',olympe.sc.Ma.Fj));olympe.sc.Ma.Fj.prototype.U.K=new olympe.D.J(()=>olympe.dm.Nb,[]);olympe.sc.Ma.vb=class extends olympe.dc.CloudObject{Wt(){return this.Bg(olympe.sc.Ma.vb.F)}Px(){return this.Bg(olympe.sc.Ma.vb.wb)}Rd(){return this.He(olympe.sc.Ma.vb.C)}zw(){return this.Gb(olympe.sc.Ma.vb.ja)}Xw(){return this.Gb(olympe.sc.Ma.vb.ab)}Ww(){return this.Gb(olympe.sc.Ma.vb.Sa)}an(){this.Gb(olympe.sc.Ma.vb.Ya)}Lw(){return this.Gb(olympe.sc.Ma.vb.oa)}lw(){return this.Gb(olympe.sc.Ma.vb.L)}Vw(){return this.Gb(olympe.sc.Ma.vb.Da)}Vt(){return this.Gb(olympe.sc.Ma.vb.aa)}};
913
- olympe.sc.Ma.vb.O=olympe.dc.ya.C('011203300000000adef5',olympe.sc.Ma.vb);olympe.sc.Ma.vb.F=olympe.sc.Ma.vb.O.va('011203300000000adef6');olympe.sc.Ma.vb.wb=olympe.sc.Ma.vb.O.va('011203300000000adef7');olympe.sc.Ma.vb.C=olympe.sc.Ma.vb.O.va('011203300000000adef8');olympe.sc.Ma.vb.ja=olympe.sc.Ma.vb.O.va('011203300000000adef9');olympe.sc.Ma.vb.ab=olympe.sc.Ma.vb.O.va('011203300000000adefa');olympe.sc.Ma.vb.Sa=olympe.sc.Ma.vb.O.va('011203300000000adefb');olympe.sc.Ma.vb.L=olympe.sc.Ma.vb.O.va('011203300000000adefc');
914
- olympe.sc.Ma.vb.Ya=olympe.sc.Ma.vb.O.va('011203300000000adefd');olympe.sc.Ma.vb.oa=olympe.sc.Ma.vb.O.va('011203300000000adefe');olympe.sc.Ma.vb.Da=olympe.sc.Ma.vb.O.va('011203300000000adeff');olympe.sc.Ma.vb.aa=olympe.sc.Ma.vb.O.va('011203300000000adee0');olympe.sc.Ma.vb.Ib={INIT:0,az:1,Pi:2,vm:3,vk:4,gB:5,uc:9};m=olympe.sc.Ma.vb.prototype;m.Wt.K=olympe.D.J.U;m.Px.K=olympe.D.J.U;m.Rd.K=olympe.D.J.G;m.zw.K=olympe.D.J.F;m.Xw.K=olympe.D.J.F;m.Ww.K=olympe.D.J.F;m.an.K=olympe.D.J.F;m.Lw.K=olympe.D.J.F;
915
- m.lw.K=olympe.D.J.F;m.Vw.K=olympe.D.J.F;m.Vt.K=olympe.D.J.F;olympe.sc.Ma.np=class extends olympe.sc.Ma.Fj{Sa(){return!0}};olympe.sc.Ma.np.O=olympe.dc.ya.C('0113032000000aca1102',olympe.sc.Ma.np,olympe.sc.P.Ea);olympe.sc.Ma.ah=class extends olympe.sc.Ma.Me{F(){return(new olympe.dc.ek(this.R(),olympe.sc.Ma.vb)).sb(olympe.sc.Ma.ah.oa).pf().Sc()}};olympe.sc.Ma.ah.O=olympe.dc.ya.C('011203300000000adef3',olympe.sc.Ma.ah);olympe.sc.Ma.ah.oa=olympe.sc.Ma.ah.O.Ha('011203300000000adef4');P(olympe.sc.Ma.vb.O,olympe.sc.Ma.ah.oa);olympe.sc.Ma.ah.prototype.F.K=new olympe.D.J(()=>olympe.sc.Ma.vb,[]);olympe.sc.dh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.dh.O=olympe.dc.ya.C('011203300000000adf00',olympe.sc.dh);olympe.sc.dh.F=olympe.sc.dh.O.va('011203300000000adf01');olympe.sc.dh.C=olympe.sc.dh.O.va('011203300000000adf02');olympe.sc.dh.L='011203300000000adf0f';olympe.sc.iz=class{};olympe.sc.eb=class{constructor(a){this.ub=a}Z(){return this.ub.Z()}jn(){return this.ub.jn()}getParent(){return this.ub.getParent()}Qk(){return this.ub.Qk()}xc(){return this.ub.xc()}sn(a){this.ub.sn(a)}Kk(){this.ub.Kk()}kl(){this.ub.kl()}set(a,b){this.ub.set(a,b);return this}li(a){this.ub.li(a);return this}remove(a){this.ub.remove(a)}Fb(a,b,c=!1){return this.ub.Fb(a,b,c)}get(a,b=!1){return this.ub.get(a,b)}has(a,b=!1){return this.ub.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=
916
- this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.Z(),!1);this.Jg(()=>{f();d.complete()});return f})}repeat(a,b){this.ub.repeat(a,b);return this}fl(a){return this.ub.fl(a)}Kn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}hl(a){this.ub.hl(a);return this}bb(a,b=!0){return this.ub.bb(a,b)}on(a,b,c,d=!0){return this.ub.on(a,b,c,d)}Xh(a){return this.ub.Xh(a)}gn(a,b){return this.ub.gn(a,b)}tj(a,b){return this.ub.tj(a,b)}di(a){return this.ub.di(a)}nj(){return this.ub.nj()}Jg(a,
917
- b){const c=b||olympe.W.fc();return this.ub.Jg(()=>{this.ub.rj(c);a()},c)}rj(a){this.ub.rj(a)}onDestroy(a){return this.ub.onDestroy(a)}Je(a){this.ub.Je(a)}destroy(){this.ub.destroy()}clear(){this.ub.clear()}Ab(){return this.ub.Ab()}pn(){return this.ub.pn()}Zk(){return this.ub.Zk()}fb(a){if('function'!==typeof this.ub.getProperty)throw Error('Trying to call deprecated method $.getProperty() in a non-UI brick');return this.ub.getProperty(a)}Aw(a){if('function'!==typeof this.ub.getEvent)throw Error('Trying to call deprecated method $.getEvent() in a non-UI brick');
918
- return this.ub.getEvent(a)}Zx(...a){if('function'!==typeof this.ub.observeMany)throw Error('Trying to call deprecated method $.observeMany() in a non-UI brick');return this.ub.observeMany(a)}};olympe.sc.eb.prototype.observeMany=olympe.sc.eb.prototype.Zx;olympe.sc.eb.prototype.getEvent=olympe.sc.eb.prototype.Aw;olympe.sc.eb.prototype.getProperty=olympe.sc.eb.prototype.fb;olympe.sc.eb.prototype.clear=olympe.sc.eb.prototype.clear;olympe.sc.eb.prototype.destroy=olympe.sc.eb.prototype.destroy;
919
- olympe.sc.eb.prototype.offDestroy=olympe.sc.eb.prototype.Je;olympe.sc.eb.prototype.onDestroy=olympe.sc.eb.prototype.onDestroy;olympe.sc.eb.prototype.offClear=olympe.sc.eb.prototype.rj;olympe.sc.eb.prototype.onClear=olympe.sc.eb.prototype.Jg;olympe.sc.eb.prototype.getOtherContext=olympe.sc.eb.prototype.di;olympe.sc.eb.prototype.onContext=olympe.sc.eb.prototype.tj;olympe.sc.eb.prototype.createChild=olympe.sc.eb.prototype.Xh;olympe.sc.eb.prototype.setParentElement=olympe.sc.eb.prototype.hl;
920
- olympe.sc.eb.prototype.waitFor=olympe.sc.eb.prototype.Kn;olympe.sc.eb.prototype.runner=olympe.sc.eb.prototype.fl;olympe.sc.eb.prototype.repeat=olympe.sc.eb.prototype.repeat;olympe.sc.eb.prototype.observe=olympe.sc.eb.prototype.observe;olympe.sc.eb.prototype.has=olympe.sc.eb.prototype.has;olympe.sc.eb.prototype.get=olympe.sc.eb.prototype.get;olympe.sc.eb.prototype.remove=olympe.sc.eb.prototype.remove;olympe.sc.eb.prototype.trigger=olympe.sc.eb.prototype.li;olympe.sc.eb.prototype.set=olympe.sc.eb.prototype.set;
921
- olympe.sc.eb.prototype.getParent=olympe.sc.eb.prototype.getParent;olympe.sc.ue=class extends olympe.sc.Runnable{ab(){return this.tb(olympe.sc.ue.G,olympe.sc.Runnable)}U(){return this.tb(olympe.sc.ue.C,olympe.dm.Property)}};olympe.sc.ue.O=Ic(olympe.dc.ya.C('016c2d996d9ca27fa9d8',olympe.sc.ue));olympe.sc.ue.G=olympe.sc.ue.O.Ha('016c3cb7742ec9309e0b');olympe.sc.ue.C=olympe.sc.ue.O.Ha('016c42d3454636f90533');olympe.sc.ue.prototype.ab.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.sc.ue.prototype.U.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.sc.Ko=class extends olympe.dm.Qb{C(){return olympe.sc.Ie.sg.Nj}};olympe.sc.Ko.O=olympe.dc.ya.C('017a7a9ff057958e5678',olympe.sc.Ko);olympe.sc.Sp=class extends olympe.dm.Qb{C(){return olympe.sc.Ie.sg.fv}};olympe.sc.Sp.O=olympe.dc.ya.C('01644b6d4543b344b857',olympe.sc.Sp);olympe.sc.Tp=class extends olympe.dc.CloudObject{};olympe.sc.Tp.O=olympe.dc.ya.C('0162f672366be5ca7a86',olympe.sc.Tp);olympe.sc.Yq=class extends olympe.sc.ue{};olympe.sc.Yq.O=olympe.dc.ya.C('016d3f37610ae4fc3962',olympe.sc.Yq);olympe.sc.Oh=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Ie.sg.Nj}};olympe.sc.Oh.O=olympe.dc.ya.C('01645fe6873aeea59e64',olympe.sc.Oh);olympe.sc.Oh.C=olympe.sc.Oh.O.Ha('017ed8ac775f48d4d589');olympe.sc.Oh.F=olympe.sc.Oh.O.Ha('017ed8ac775f48d4d590');olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.ya.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Transaction=class{constructor(a=!0){this.C=(new olympe.dc.Transaction).persist(a);this.F=new Map;this.source=olympe.dc.Ga.jc}static from(a){const b=olympe.sc.Ta.ig.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Transaction}static process(a,b){return a.has(olympe.sc.Ta.ig.TRANSACTION,!0)?Promise.resolve(!1):b.hb().then(()=>!0)}Z(){return this.C.Z()}create(a,b=new Map,c=this.source,d){d=this.C.create(a,d).ki(c);this.F.set(d.R(),olympe.dc.wa(a));for(const [e,f]of b)d.setProperty(e,
922
- f);c===olympe.dc.Ga.Pc&&(b=olympe.dc.Oa(),b=null!==$i?b.ij($i,[olympe.sc.Ma.Me.C,olympe.sc.md.F.Gc()])[0]||null:null,null!==b?this.Ra(olympe.sc.md.L,b,d):olympe.ra.Xa('sc').warn('No business container for new instance of',olympe.dc.wa(a)));return d.R()}update(a,b,c){this.C.update(a,b,c);return this}Mx(a,b){a=this.C.update(a);for(const [c,d]of b)a.setProperty(c,d);return this}delete(a){this.C.delete(a);return this}Ra(a,b,c){this.C.Ra(a,b,c);return this}ec(a,b,c){this.C.ec(a,b,c);return this}Um(a,b){this.C.Um(a,
923
- b);return this}persist(a=!0){this.C.persist(a);return this}vj(a,b=!0){this.C.vj(a,b);return this}ki(a){this.source=a;return this}model(a){return this.F.get(olympe.dc.wa(a))||olympe.dc.Oa().model(a)}wn(a){be(this.C,a.C);return this}Km(a){this.C.Km(a);return this}hb(){return new Promise((a,b)=>{this.C.hb((c,d)=>{c?a():b(d)})})}Xm(){return new Promise((a,b)=>{this.C.Xm((c,d)=>{c?a():b(d)})})}};olympe.sc.Transaction.prototype.executeAsLarge=olympe.sc.Transaction.prototype.Xm;
924
- olympe.sc.Transaction.prototype.execute=olympe.sc.Transaction.prototype.hb;olympe.sc.Transaction.prototype.afterExecution=olympe.sc.Transaction.prototype.Km;olympe.sc.Transaction.prototype.merge=olympe.sc.Transaction.prototype.wn;olympe.sc.Transaction.prototype.model=olympe.sc.Transaction.prototype.model;olympe.sc.Transaction.prototype.setSource=olympe.sc.Transaction.prototype.ki;olympe.sc.Transaction.prototype.persistInstance=olympe.sc.Transaction.prototype.vj;
925
- olympe.sc.Transaction.prototype.persist=olympe.sc.Transaction.prototype.persist;olympe.sc.Transaction.prototype.deleteAllRelations=olympe.sc.Transaction.prototype.Um;olympe.sc.Transaction.prototype.deleteRelation=olympe.sc.Transaction.prototype.ec;olympe.sc.Transaction.prototype.createRelation=olympe.sc.Transaction.prototype.Ra;olympe.sc.Transaction.prototype['delete']=olympe.sc.Transaction.prototype.delete;olympe.sc.Transaction.prototype.multiUpdate=olympe.sc.Transaction.prototype.Mx;
926
- olympe.sc.Transaction.prototype.update=olympe.sc.Transaction.prototype.update;olympe.sc.Transaction.prototype.create=olympe.sc.Transaction.prototype.create;olympe.sc.Transaction.prototype.getId=olympe.sc.Transaction.prototype.Z;olympe.sc.Transaction.process=olympe.sc.Transaction.process;olympe.sc.Transaction.from=olympe.sc.Transaction.from;olympe.sc.Ie.BrickMetadata=olympe.dm.BrickMetadata;olympe.sc.Ie.ve=olympe.dm.ve;olympe.ha.node.pa={};const lj={client:'client',hostname:'host',port:'port',user:'user',password:'password',Ka:'database',schema:'schema',my:'pollingFrequency',Gv:'burstTransactionInterval',Jx:'minConnections',Ix:'maxConnections',Jv:'connectionsTimeout'},mj=olympe.dc.ga.ka.om,nj=olympe.dc.ga.ka.qm,oj=olympe.dc.ga.ka.QUERY_RESULT,pj=olympe.dc.ga.ka.pm,qj=olympe.dc.ga.ka.lg,rj=olympe.dc.ga.ka.Qh,sj=olympe.dc.ga.ka.xh,tj=olympe.dc.ga.ka.wi,uj=olympe.dc.ga.ka.wh,vj=olympe.dc.ga.ka.eh,wj=olympe.dc.ga.ka.Ij,xj=olympe.dc.ga.ka.Au;
927
- function yj(a,b,c,d,e){const f=new olympe.H.Ba.nb.zb(a.tag,b),g=new olympe.sc.W.ht(a.N,a.Lc,a.ab);g.start(a.tag).catch(h=>a.N.error(`Error occurred while starting the file service of SQLConnector ${e}: ${h}`));f.listen().subscribe(h=>{var k=h.body();a.N.debug(`Serving a new message : ${k.t}`);switch(k.t){case mj:var l=c.queryBuilder().withSchema(d);k=te(k.q);a.U(b,l,k,(t,u)=>{(u?h.xg(Error(u)):h.Le({t:oj,r:t})).then()});break;case nj:k=te(k.q);zj(a,b,()=>c.queryBuilder().withSchema(d),k,h);break;
928
- case xj:Aj(b,k.i,h.source());h.Lk().then();break;case vj:k=(new olympe.dc.W.Ki(a.Tb())).C(k.p);Bj(a,b,c,d,k,t=>(t?h.xg(Error(t)):h.Lk()).then());break;case uj:l=k.i;k=(new olympe.dc.W.Ki(a.Tb())).C(k.p);Cj(a,b,l,k,c,d);break;case qj:const n=b.get('_subscription_cache');k=k.s.reduce((t,u)=>{n.has(u)?Dj(n.get(u),h.source()):t.push(u);return t},[]);(0<k.length?h.xg(Error(`These subscriptions was not kept alive: ${k}`)):h.Lk()).then();break;case rj:const p=k.f;a.N.debug(`Uploading a file: ${p}`);k=Si(g,
929
- (t,u,v)=>{a.N.debug(`Received a file service upload request for file : ${u}`);return p!==u?Promise.reject('The file sent is not the same as the one initially requested'):v instanceof Uint8Array||'string'===typeof v?Ej(a,b,c,d,p,v).then(()=>new olympe.net.Tg('',olympe.net.cb.hd.wl)):Promise.reject(`Try to upload content for file ${p} but body is not a Uint8Array or a string`)});h.Le(k).then();break;case sj:const q=k.f;a.N.debug(`Serving a file: ${q}`);k=Si(g,(t,u)=>{a.N.debug(`File service received a download request for file : ${u}`);
930
- return q!==u?Promise.reject('The file to download is not the same as the one initially requested'):Fj(b,c.queryBuilder().withSchema(d),q).then(v=>{a.N.debug('File service download request, content is:',v);return new olympe.net.Tg(v,olympe.net.cb.hd.Hh)})});h.Le(k).then();break;case tj:const r=k.f;a.N.debug(`Deleting a file: ${r}`);k=Si(g,(t,u)=>r!==u?Promise.reject('The file to download is not the same as the one initially requested'):Promise.resolve(new olympe.net.Tg('',olympe.net.cb.hd.Hh)));h.Le(k).then();
931
- break;default:h.xg(Error(`Unsupported message type: ${k.t}`)).then()}})}function zj(a,b,c,d,e){const f=d.Z(),g=`sub${f}`;e.es(g).then(()=>{const h=b.get('_subscription_cache');let k=h.get(f);k||(k=new Gj(f,d,c,b.get('_polling_frequency'),a.U.bind(a,b),a.wc.bind(a,g,f),()=>h.delete(f)),h.set(f,k));Dj(k,e.source())}).catch(h=>e.xg(Error(h)).then())}
932
- function Aj(a,b,c){(a=a.get('_subscription_cache').get(b))&&(a.C.delete(c)||olympe.ra.Xa('Subscription Cache').warn(`Try to unsubscribe to the subscription ${a.id} which is not registered.`))}function Bj(a,b,c,d,e,f){b=b.get('_data_model_observer');a=new olympe.ha.node.pa.Ia.Qq(a.N,b);e.Qc(a);Hj(a,c,d).then(()=>f(null)).catch(g=>f(g))}
933
- function Cj(a,b,c,d,e,f){const g=`_burst.${c}`,h=b.get(g);null===h?(b.set(g,d),setTimeout(()=>{const k=b.get(g);b.remove(g);Bj(a,b,e,f,k,l=>{l&&olympe.H.Ba.nb.zb.publish(c,{t:wj,r:l})})},b.get('_burst_interval'))):d.Qc(h)}function Ej(a,b,c,d,e,f){const g=olympe.ha.node.pa.Ia.cd.Rj,h=new olympe.dc.db.Ac;h.F(e,(new Map).set(g,f),0);h.Ra(olympe.dc.kc.Xc,e,olympe.dc.wa(olympe.dm.File));return new Promise((k,l)=>{Bj(a,b,c,d,h,n=>n?l(n):k())})}
934
- function Fj(a,b,c){return x(function*(){var d=olympe.ha.node.pa.Ia.cd.Rj,e=olympe.ha.node.pa.Ia.cd.Jh;const f=yield Ij(a.get('_data_model_observer').C,olympe.dc.wa(olympe.dm.File));if((e=(yield b.from(f).select(d).where(e,c))[0])&&e[d])return d=e[d],d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength);throw Error(`File ${c} not found in the database`);}())}
935
- olympe.ha.node.pa.Pq=class extends olympe.sc.logic.Xd{constructor(a,b,c,d){super(a,b,c);this.Lc=d;this.ab=olympe.T.getParameter(olympe.H.ob.im)}update(a,[b]){var c=(k,l)=>{let n,p;return null!=(p=null!=(n=olympe.T.getParameter(`${'dbconnector'}.${b}.${k}`))?n:olympe.T.getParameter(`${'dbconnector'}.${k}`))?p:l};a.set('_burst_interval',olympe.T.getParameter(`${'dbconnector'}.${b}.${lj.Gv}`)||5E3);a.set('_polling_frequency',c(lj.my,6E5));const d=c(lj.client,'pg'),e=c(lj.hostname,''),f=c(lj.Ka),g=c(lj.schema,
936
- b),h=knex({client:d,connection:{host:e,port:c(lj.port),user:c(lj.user),password:c(lj.password),database:f},pool:{min:c(lj.Jx,0),max:c(lj.Ix,10)},acquireConnectionTimeout:c(lj.Jv,6E4)});this.N.info(`SQLConnector ${b} started with host ${e}, database ${f} on schema ${g}`);this.ad=olympe.ra.Xa('sql');a.Jg(()=>h.destroy().then());c=new olympe.ha.node.pa.Ia.Vs(h,g,this);a.set('_data_model_observer',c);a.set('_subscription_cache',new Map);yj(this,a,h,g,b)}U(a,b,c,d){a=a.get('_data_model_observer');const e=
937
- a.C,f=new olympe.ha.node.pa.Ia.xu(c,e);Jj(a).then(()=>Kj(f)).then(g=>{if(0===g.length)return[[],g];const h=Lj(new olympe.ha.node.pa.Ia.Oq(f,b,g));this.ad.debug(`Sending a sql query with the following text: ${h.toString()}`);return h.then(k=>[k,g])}).then(([g,h])=>Mj(c.Z(),g,h,e)).then(g=>d(g,null)).catch(g=>d({},g))}wc(a,b,c){olympe.H.Ba.nb.zb.publish(a,{t:pj,i:b,r:c}).then().catch(d=>this.N.error('Error occurred while publishing query result update: '+d))}};
938
- olympe.ha.node.pa.Pq.O=olympe.dc.ya.C('017dc8db8074471acb7a',olympe.ha.node.pa.Pq,olympe.sc.P.Ea,olympe.net.P.Bm);function Dj(a,b){a.C.has(b)?(a=a.C,a.values.has(b)&&a.values.set(b,Date.now())):a.C.add(b)}
939
- class Gj{constructor(a,b,c,d,e,f,g){this.id=a;this.query=b;a=new olympe.W.fr(olympe.T.getParameter(olympe.Za.Config.Xl)+6E4);a.F=g;this.C=a;this.start(c,e,f,d)}start(a,b,c,d){let e=null,f=new Set;const g=()=>{0<this.C.values.size&&(b(a(),this.query,(h,k)=>{if(k)olympe.ra.Xa('Subscription Cache').error(`Error occurred while updating subscription cache update: ${k}`);else if(k=olympe.W.mb(JSON.stringify(h)),k!==e){e=k;k=h.k;const l=[];k.forEach((n,p)=>{f.has(n)?f.delete(n):l.push(p)});h.a=l;h.r=Array.from(f);
940
- f=new Set(k);c(h)}}),setTimeout(g,d))};setTimeout(g,d)}};olympe.ha.node.pa.Ia={};olympe.ha.node.pa.Ia.Bc={EQUAL:'equal',Tq:'substring',Ro:'filter',Dp:'<=',Ep:'<',ep:'>=',fp:'>',$f:'and',Ih:'or',Xg:'not',Cq:'regex'};olympe.ha.node.pa.Ia.cd={Jh:'tagOlympe',jk:'tagOlympeOrig',Al:'tagOlympeDest',Rj:'fileContent'};const Nj=olympe.ha.node.pa.Ia.cd.jk,Oj=olympe.ha.node.pa.Ia.cd.Al,Pj=olympe.ha.node.pa.Ia.cd.Jh,Qj=olympe.ha.node.pa.Ia.cd.Rj;function Jj(a){return new Promise(b=>{0<a.F?a.U.add(()=>b()):b()})}
941
- function Rj(a){Sj(a,olympe.dc.wa(olympe.dm.File));const b=new Map;a.G.sb(olympe.sc.logic.Xd.C).observe(a.L).subscribe(c=>{xe(c).forEach(d=>{const e=d.R();Tj(a,()=>{var g=Uj;const h=[{name:Pj,Ze:Pj,Yk:!1}];e===olympe.dc.wa(olympe.dm.File)&&h.push({name:Qj,Ze:Qj,Yk:!1});return g(a,e,e,h)},`Create Table for ${e}`);const f=new olympe.D.Xb('Business model context',a.L);b.set(e,f);f.run(()=>Vj(a,f,e))});ye(c).forEach(d=>{b.get(d).destroy();Tj(a,()=>Wj(a,d),`Delete Table for ${d}`)})})}
942
- function Xj(a){a.F++;1===a.F&&a.N.debug('Data model observer is busy')}function Yj(a){a.F--;if(0===a.F){a.N.debug('Data model observer is free');for(const b of a.U)b();a.U.clear()}}function Sj(a,b){if(!a.db.$k(a.G,olympe.sc.logic.Xd.C,b)){Xj(a);const c=new olympe.dc.Transaction;c.Ra(olympe.sc.logic.Xd.C,a.G,b);c.hb((d,e)=>{d||a.N.error(`Error while linking the business model ${b} to the SQLConnector: ${e}`);Yj(a)},!0)}}function Zj(a){return a.client.schema.withSchema(a.schema)}
943
- function Tj(a,b,c){if(!a.L.G()&&!a.L.Ab()){a.N.debug(`Push operation:${c}`);Xj(a);var d=a.Y,e=()=>{d.shift();Yj(a);if(0<d.length)d[0]()},f=()=>{b().then(()=>{a.N.debug(`Operation ${c} succeed`);e()}).catch(g=>{a.N.error(`Error for operation ${c}: ${g}`);e()})};d.push(f);1===d.length&&f()}}
944
- function Uj(a,b,c,d){return x(function*(){if(yield Zj(a).hasTable(b))return a.N.debug(`Table ${c} already exist`),Promise.resolve().then(()=>{var e=a.C;e.C.set(c,b);e.G.set(b,c)});a.N.debug('Create table for : '+c);return Zj(a).createTable(b,e=>{d.forEach(({name:f,Ze:g,Gr:h,ns:k,Yk:l})=>{ak(a,e,f,g,l,k,h)})}).then(()=>{var e=a.C;e.C.set(c,b);e.G.set(b,c)})}())}
945
- function Vj(a,b,c){b.onDestroy(()=>{Tj(a,()=>Promise.all(Array.from(a.La.get(c)).map(d=>Wj(a,d))).then(()=>{a.La.delete(c)}),`Destroy relation tables of business model ${c}: relations: ${a.La.get(c)}`)});a.yn(c,b);a.La.set(c,new Set);olympe.dc.gb.from(c).sb(olympe.dc.CloudObject.G).Wi().sb(olympe.dm.Relation.destinationModelRel).Wi().filter((new olympe.dc.ba.V.De(a.G)).sb(olympe.sc.logic.Xd.C.Gc())).observe(b).subscribe(d=>{0<xe(d).length&&(a.N.debug('Handle new relations : '+xe(d)),Tj(a,()=>Promise.all(xe(d).map(([e,
946
- f])=>{a.La.get(c).add(e.R());a.La.get(f.R()).add(e.R());e=e.R();var g=Uj;f=f.R();return g(a,e,e,[{name:Nj,Ze:Nj,ns:c,Gr:Pj,Yk:!0},{name:Oj,Ze:Oj,ns:f,Gr:Pj,Yk:!0}])})).then(),`Add relation tables for business model ${c}: ${xe(d)}`));0<ye(d).length&&(a.N.debug('Handle relations to remove : '+ye(d)),Tj(a,()=>Promise.all(ye(d).map(([e,f])=>{a.La.get(c).delete(e);a.La.get(f).delete(e);return Wj(a,e)})).then(),`Delete relation tables for business model ${c}: ${ye(d)}`))})}
947
- function Wj(a,b){return x(function*(){try{var c=yield Ij(a.C,b)}catch(d){a.N.warn(`Try to delete a table not registered: ${d}`);return}if(yield Zj(a).hasTable(c)){Zj(a).dropTable(c);c=a.C;const d=c.C.get(b);c.G.delete(d)||c.C.delete(b)}}())}
948
- function bk(a,b,c,d){return x(function*(){const e=yield Ij(a.C,b),f=yield Promise.all(c.map(k=>Promise.resolve(k))),g=yield Promise.all(d.map(k=>Promise.resolve(k))),h=yield a.client.queryBuilder().withSchema(a.schema).table(e).columnInfo();return Zj(a).table(e,k=>{const l=new Set(Object.keys(h));f.forEach((n,p)=>{!l.has(n)&&ak(a,k,n,c[p])});g.forEach(n=>{l.has(n)&&k.dropColumn(n)})})}())}
949
- function ak(a,b,c,d,e=!1,f='',g=''){if(c===Pj)b.string(c,21).primary();else if(c===Nj||c===Oj){if(e)b.string(c).notNullable().references(g).inTable(`${a.schema}.${f}`).onDelete('CASCADE')}else c===Qj?b.binary(c):d&&(a=a.db,d=olympe.dc.od.from(d).sb(olympe.dm.Property.typeRel).jd(),a.Tf(d,olympe.dm.String)?b.string(c,1E3):a.Tf(d,olympe.dm.Number)?b.double(c):a.Tf(d,olympe.dm.Boolean)?b.boolean(c):a.Tf(d,olympe.dm.DateTime)?b.string(c):a.Tf(d,olympe.dm.Color)&&b.string(c,50))}
950
- olympe.ha.node.pa.Ia.Vs=class{constructor(a,b,c){this.N=olympe.ra.Xa('sql');this.client=a;this.schema=b;this.G=c;this.C=new olympe.ha.node.pa.Ia.ev;this.L=new olympe.D.Xb(`Data Model Observer of ${c.R()}`);this.Y=[];this.F=0;this.La=new Map;this.U=new Set;this.db=olympe.dc.Oa();Rj(this)}yn(a,b){this.N.debug('Observe properties for '+a);olympe.dc.gb.from(a).sb(olympe.dc.CloudObject.propertyRel).observe(b).subscribe(c=>{this.N.debug('New properties for '+a+' '+xe(c));Tj(this,()=>bk(this,a,xe(c).map(d=>
951
- d.R()),ye(c)),`Update columns of ${a}: added: ${xe(c)}, removed: ${ye(c)}`)})}};const ck=olympe.ha.node.pa.Ia.Bc.EQUAL,dk=olympe.ha.node.pa.Ia.Bc.$f,ek=olympe.ha.node.pa.Ia.Bc.Ih,fk=olympe.ha.node.pa.Ia.Bc.Xg,gk=olympe.ha.node.pa.Ia.Bc.Ro,hk=olympe.ha.node.pa.Ia.Bc.ep,ik=olympe.ha.node.pa.Ia.Bc.fp,jk=olympe.ha.node.pa.Ia.Bc.Dp,kk=olympe.ha.node.pa.Ia.Bc.Ep,lk=olympe.ha.node.pa.Ia.Bc.Cq,mk=olympe.ha.node.pa.Ia.Bc.Tq,nk=olympe.ha.node.pa.Ia.cd.Jh;
952
- function Kj(a){return x(function*(){var b=a.query.G;let c=b;var d=[];const e=a.query.C;let f=olympe.dc.Oa().mj(b);!f&&e[0]instanceof olympe.dc.ba.Hb.hf&&(f=e[0].Qd().qb(olympe.dc.CloudObject.instancesRel));if(f){try{var g=yield Ij(a.F,b)}catch(l){return[]}f=!0;e.shift()}else{try{var h=yield a.F.Tb(b,'')}catch(l){return[]}c=h;g=yield Promise.resolve([['tagOlympe',b]]);1<g.length?d.push(['',dk,g.map(([l,n])=>[l,ck,ok(n)])]):d.push([g[0][0],ck,ok(g[0][1])]);g=yield Ij(a.F,h)}h=pk(a,g);b=Array.from(a.query.F);
953
- b=b.includes(0)||b.includes(1)&&f;var k=[];if(b){const l=a.query.Z(),n=qk(a.F,l,c,nk);k=olympe.dc.gb.from(c).sb(olympe.dc.CloudObject.propertyRel).jd().map(q=>q.R());const p=yield Promise.all(k.map(q=>Promise.resolve(q)));k=k.map(q=>qk(a.F,l,c,q)).map((q,r)=>[q,p[r]]);k.unshift([n,nk])}a.G.limit=a.query.max;a.G.offset=a.query.offset;a.C.push({Kg:b,recursive:!1,filters:d,jh:'',$h:'',Wh:k,fh:h,name:g});d=0;for(const l of e)d=yield rk(a,l,d,f);return a.C}())}
954
- function pk(a,b){a.U++;return`alias-${b.charAt(0)}${a.U}`}function rk(a,b,c,d){let e=c;switch(!0){case b instanceof olympe.dc.ba.Hb.hf:case b instanceof olympe.dc.ba.Hb.jf:e+=1;a=sk(a,b,e,d);break;case b instanceof olympe.dc.ba.Hb.vc:a=tk(a,b);break;case b instanceof olympe.dc.ba.Hb.Nh:a=uk(a,b);break;default:a=Promise.reject(`Query part ${b.toString()} could not be parsed`)}return a.then(()=>e)}
955
- function sk(a,b,c,d){const e=b.Qd().R(),f=b.Qd().Pa()===olympe.dc.Aa.ORIGIN?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel;let g=b instanceof olympe.dc.ba.Hb.jf;const h=olympe.dm.Relation.F.Yl,k=olympe.dc.od.from(e).sb(f).jd();c=d?c+1:c;const l=Array.from(a.query.F).includes(c),[n,p]=['',''];return Ij(a.F,k.R()).then(q=>x(function*(){const r=pk(a,q),t=[];let u=Promise.resolve();h===olympe.dm.Relation.F.Yl&&(u=Ij(a.F,e).then(v=>{const w=pk(a,v),[y,B]=vk(b.Qd().Pa());a.C.push({Kg:!1,
956
- fh:w,name:v,Wh:[],jh:y,$h:B,filters:[],recursive:g});g=!1}));return u.then(()=>x(function*(){let v=[];var w=Promise.resolve([]);let y=[];if(l){const B=a.query.Z(),E=qk(a.F,B,k.R(),nk);w=olympe.dc.gb.from(k.R()).sb(olympe.dc.CloudObject.propertyRel).Wi().jd().map(I=>I.R());v=w.map(I=>qk(a.F,B,k.R(),I));w=Promise.all(w.map(I=>Promise.resolve(I)));y.push([qk(a.F,B,k.R(),nk),nk]);const S=yield w;y=v.map((I,Z)=>[I,S[Z]]);y.unshift([E,nk])}a.C.push({Kg:l,fh:r,name:q,Wh:y,jh:n,$h:p,filters:t,recursive:g})}()))}()))}
957
- function tk(a,b){return a.L(b.C).then(c=>{a.C[a.C.length-1].filters.push(c)})}function uk(a,b){a.G.order=b.order;a.G.aliasSorting=a.C[a.C.length-1].fh;return Promise.resolve(b.fb().R()).then(c=>{a.G.columnSorting=c})}function vk(a){const b=olympe.ha.node.pa.Ia.cd.jk,c=olympe.ha.node.pa.Ia.cd.Al;return a===olympe.dc.Aa.ORIGIN?[c,b]:[b,c]}
958
- olympe.ha.node.pa.Ia.xu=class{constructor(a,b){this.query=a;this.U=0;this.F=b;this.C=[];this.G={}}L(a){switch(!0){case a instanceof olympe.dc.ba.V.Ic:const c=a.C;return Promise.resolve(a.fb()).then(h=>[h,ck,ok(c)]);case a instanceof olympe.dc.ba.V.Wc:const d=a.substring;return Promise.resolve(a.fb()).then(h=>[h,mk,d]);case a instanceof olympe.dc.ba.V.wd:var b=a.C.source;return/^\^?([-_%\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\'|\\"|\.\+\?|\.\*|\.\+|\\\/|\\\\|\\\^|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\||\\\[|\\\]|\\\{|\\\})*\$*?$/.test(b)?
959
- Promise.resolve(a.fb()).then(h=>[h,lk,a.C]):Promise.reject(`Query not supported for regex : ${b}`);case a instanceof olympe.dc.ba.V.nd:return this.L(a.C).then(h=>['',fk,h]);case a instanceof olympe.dc.ba.V.De:const e=a.destination,f=Array.from(a.recursive);if(f.reduce((h,k)=>h||k,!1))return Promise.reject('Recursive relation in RelatedTo predicate is not supported');b=a.ld().map((h,k)=>Promise.resolve(h.R()).then(l=>{const [n,p]=vk(h.Pa());let q=[];e&&k===a.ld().length-1&&(q=[[p,ck,ok(e)]]);return{name:l,
960
- recursive:f[k],Wh:[],jh:n,$h:p,filters:q,fh:pk(this,l),Kg:!1}}),this);let g;g=e?Promise.resolve([['tagOlympe',e]]):Promise.resolve([]);return Promise.all(b).then(h=>{var k=this.C[this.C.length-1];k={name:k.name,recursive:!1,Wh:[[nk,nk]],jh:'',$h:'',filters:[],fh:pk(this,k.name),Kg:!0};h.unshift(k);return g.then(l=>['',gk,{target:l,La:h}])});case a instanceof olympe.dc.ba.V.Ch:return Promise.resolve(a.fb()).then(h=>('number'===typeof a.C?Promise.resolve(a.C):Promise.resolve(a.C.R())).then(k=>{var l=
961
- a.G;return Promise.resolve([h,a.F?l?kk:jk:l?ik:hk,k])}));case a instanceof olympe.dc.ba.V.Ud:return b=Array.from(a.V).flatMap(this.L.bind(this)),Promise.all(b).then(h=>['',dk,h]);case a instanceof olympe.dc.ba.V.ae:return b=Array.from(a.V).flatMap(this.L.bind(this)),Promise.all(b).then(h=>['',ek,h]);default:return Promise.reject('Failed to parse predicate')}}};function Mj(a,b,c,d){const e=[],f=new olympe.dc.transaction.vd;let g,h,k,l;const n=null==(g=c[0])?void 0:null==(h=g.filters)?void 0:null==(k=h[0])?void 0:null==(l=k[2])?void 0:l.v;return wk(c,d).then(p=>{for(const r of b){const [t,u,v]=xk(a,r,p,d,c,n);for(const [w,y,B]of v)f.Ra(w,y,B);var q=Array.from(t.keys()).map(w=>w).join('.');e.push(q);for(const [w,y]of t.entries())q=u.get(w),d.L.set(w,q),f.F(w,new Map(y),0),f.Ra(olympe.dc.CloudObject.modelRel.R(),w,q,0)}d.F.delete(a);return{k:e,p:$d(f)}})}
962
- function wk(a,b){const c=[],d=[],e=[],f=[];for(let g=1;g<a.length-1;g+=2)(a[g-1].Kg||1===g)&&a[g+1].Kg&&(d.push(b.nh(a[g-1].name)),e.push(b.nh(a[g+1].name)),c.push(Promise.resolve(b.G.get(a[g].name))),f.push(a[g].jh===olympe.ha.node.pa.Ia.cd.jk?olympe.dc.Aa.DESTINATION:olympe.dc.Aa.ORIGIN));return Promise.all([Promise.all(c),Promise.all(d),Promise.all(e)]).then(([g,h,k])=>g.map((l,n)=>[l,h[n],k[n],f[n]]))}
963
- function xk(a,b,c,d,e,f){const g=olympe.ha.node.pa.Ia.cd.Jh;let h=0;let k='',l='',n=0;const p=new Map,q=new Map,r=[];for(const [u,v]of Object.entries(b)){b=v;var t=u.split(';');if(t[1]===g){h=parseInt(t[0],10);t=yk(d,a,h);if(n<c.length){const w=c[n][3],y=c[n][0];if(k===c[n][1]&&t===c[n][2])r.push(w===olympe.dc.Aa.DESTINATION?[y,l,b]:[y,b,l]),n++;else{let B;!k&&t===(null==(B=e[2])?void 0:B.name)&&f&&(r.push(w===olympe.dc.Aa.DESTINATION?[y,f,b]:[y,b,f]),n++)}}p.set(b,[]);q.set(b,t);d.L.set(b,t);k=t;
964
- l=b}else h===parseInt(t[0],10)&&(t=t[1],p.get(l).push([t,b]))}return[p,q,r]}olympe.ha.node.pa.Ia.KA=class{};function Lj(a){const b=a.C,{offset:c,limit:d,HC:e,order:f,CC:g}=a.U.G;-1<d&&b.limit(d);0<c&&b.offset(c);e&&f&&b.orderBy(`${g}.${e}`,f.toLowerCase());for(const [h,{Kg:k,fh:l,name:n,filters:p,recursive:q,Wh:r,jh:t,$h:u}]of a.Y.entries())zk(a,b,k,l,n,p,q,0===h,t,u,r);return b}
965
- function zk(a,b,c,d,e,f,g,h,k,l,n){if(c){if(!n||1>n.length)throw Error('Trying to return an element without providing mappings in SQLBuilder:BuildNodes');c=n.map(([p,q])=>b.client.raw('??.?? as ??',[d,q,p])).join(',');b.select(b.client.raw(c))}0<f.length&&Ak(a,b,d,f,olympe.ha.node.pa.Ia.qd.NONE);h?(b.from(`${e} as ${d}`),a.G=d,a.F=l):(g&&(f=`cte${a.L++}`,Bk(a,b,f,d,e)),b.join(`${e} as ${d}`,p=>{var q=a.G,r=a.F;p.on(''===r?`${q}.tagOlympe`:`${q}.${r}`,''===k?`${d}.tagOlympe`:`${d}.${k}`);a.G=d;a.F=
912
+ olympe.sc.workflow.Transition.prototype.C.K=new olympe.D.J(()=>olympe.sc.workflow.Re,[]);olympe.sc.workflow.Transition.prototype.G.K=new olympe.D.J(()=>olympe.sc.workflow.Re,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Je.tg.Pj}N(){return this.Cg(olympe.sc.workflow.Workflow.serializationEnabledProp)}F(){return this.rc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.ui)}G(){return this.rc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Re)}};olympe.sc.workflow.Workflow.O=olympe.dc.ya.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.va('017ffdc010e5bcc9c972');
913
+ olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.Ha('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.Ha('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.Ha('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.N.K=olympe.D.J.U;olympe.sc.workflow.Workflow.prototype.F.K=new olympe.D.J(()=>olympe.sc.ui,[]);
914
+ olympe.sc.workflow.Workflow.prototype.G.K=new olympe.D.J(()=>olympe.sc.workflow.Re,[]);olympe.sc.Ma={};olympe.sc.Ma.Ne=class extends olympe.sc.pb{C(){return olympe.sc.Je.tg.Qu}};olympe.sc.Ma.Ne.O=Mc(olympe.dc.ya.C('01120300000000adef00',olympe.sc.Ma.Ne));olympe.sc.Ma.Ne.C=olympe.sc.Ma.Ne.O.Ha('0171bc1f15da96dfdb89');P(olympe.dm.Zc.O,olympe.sc.Ma.Ne.C);olympe.sc.Ma.Hj=class extends olympe.sc.Runnable{aa(){return[this.Tb()]}U(){return olympe.dc.od.from(this.Tb()).sb(olympe.sc.Ma.Ne.C).jd()}};olympe.sc.Ma.Hj.O=Mc(olympe.dc.ya.C('0113030000000aca1100',olympe.sc.Ma.Hj));olympe.sc.Ma.Hj.prototype.U.K=new olympe.D.J(()=>olympe.dm.Nb,[]);olympe.sc.Ma.vb=class extends olympe.dc.CloudObject{Zt(){return this.Cg(olympe.sc.Ma.vb.F)}Sx(){return this.Cg(olympe.sc.Ma.vb.wb)}Rd(){return this.Ie(olympe.sc.Ma.vb.C)}Cw(){return this.Gb(olympe.sc.Ma.vb.ha)}$w(){return this.Gb(olympe.sc.Ma.vb.ab)}Zw(){return this.Gb(olympe.sc.Ma.vb.Sa)}an(){this.Gb(olympe.sc.Ma.vb.Ya)}Ow(){return this.Gb(olympe.sc.Ma.vb.oa)}ow(){return this.Gb(olympe.sc.Ma.vb.N)}Yw(){return this.Gb(olympe.sc.Ma.vb.Da)}Yt(){return this.Gb(olympe.sc.Ma.vb.aa)}};
915
+ olympe.sc.Ma.vb.O=olympe.dc.ya.C('011203300000000adef5',olympe.sc.Ma.vb);olympe.sc.Ma.vb.F=olympe.sc.Ma.vb.O.va('011203300000000adef6');olympe.sc.Ma.vb.wb=olympe.sc.Ma.vb.O.va('011203300000000adef7');olympe.sc.Ma.vb.C=olympe.sc.Ma.vb.O.va('011203300000000adef8');olympe.sc.Ma.vb.ha=olympe.sc.Ma.vb.O.va('011203300000000adef9');olympe.sc.Ma.vb.ab=olympe.sc.Ma.vb.O.va('011203300000000adefa');olympe.sc.Ma.vb.Sa=olympe.sc.Ma.vb.O.va('011203300000000adefb');olympe.sc.Ma.vb.N=olympe.sc.Ma.vb.O.va('011203300000000adefc');
916
+ olympe.sc.Ma.vb.Ya=olympe.sc.Ma.vb.O.va('011203300000000adefd');olympe.sc.Ma.vb.oa=olympe.sc.Ma.vb.O.va('011203300000000adefe');olympe.sc.Ma.vb.Da=olympe.sc.Ma.vb.O.va('011203300000000adeff');olympe.sc.Ma.vb.aa=olympe.sc.Ma.vb.O.va('011203300000000adee0');olympe.sc.Ma.vb.Ib={INIT:0,dz:1,Ri:2,vm:3,wk:4,hB:5,cc:9};m=olympe.sc.Ma.vb.prototype;m.Zt.K=olympe.D.J.U;m.Sx.K=olympe.D.J.U;m.Rd.K=olympe.D.J.G;m.Cw.K=olympe.D.J.F;m.$w.K=olympe.D.J.F;m.Zw.K=olympe.D.J.F;m.an.K=olympe.D.J.F;m.Ow.K=olympe.D.J.F;
917
+ m.ow.K=olympe.D.J.F;m.Yw.K=olympe.D.J.F;m.Yt.K=olympe.D.J.F;olympe.sc.Ma.np=class extends olympe.sc.Ma.Hj{Sa(){return!0}};olympe.sc.Ma.np.O=olympe.dc.ya.C('0113032000000aca1102',olympe.sc.Ma.np,olympe.sc.P.Ea);olympe.sc.Ma.bh=class extends olympe.sc.Ma.Ne{F(){return(new olympe.dc.gk(this.R(),olympe.sc.Ma.vb)).sb(olympe.sc.Ma.bh.oa).qf().Sc()}};olympe.sc.Ma.bh.O=olympe.dc.ya.C('011203300000000adef3',olympe.sc.Ma.bh);olympe.sc.Ma.bh.oa=olympe.sc.Ma.bh.O.Ha('011203300000000adef4');P(olympe.sc.Ma.vb.O,olympe.sc.Ma.bh.oa);olympe.sc.Ma.bh.prototype.F.K=new olympe.D.J(()=>olympe.sc.Ma.vb,[]);olympe.sc.eh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.eh.O=olympe.dc.ya.C('011203300000000adf00',olympe.sc.eh);olympe.sc.eh.F=olympe.sc.eh.O.va('011203300000000adf01');olympe.sc.eh.C=olympe.sc.eh.O.va('011203300000000adf02');olympe.sc.eh.N='011203300000000adf0f';olympe.sc.kz=class{};olympe.sc.eb=class{constructor(a){this.ub=a}Z(){return this.ub.Z()}jn(){return this.ub.jn()}getParent(){return this.ub.getParent()}Rk(){return this.ub.Rk()}xc(){return this.ub.xc()}sn(a){this.ub.sn(a)}Lk(){this.ub.Lk()}ll(){this.ub.ll()}set(a,b){this.ub.set(a,b);return this}ni(a){this.ub.ni(a);return this}remove(a){this.ub.remove(a)}Fb(a,b,c=!1){return this.ub.Fb(a,b,c)}get(a,b=!1){return this.ub.get(a,b)}has(a,b=!1){return this.ub.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=
918
+ this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.Z(),!1);this.Kg(()=>{f();d.complete()});return f})}repeat(a,b){this.ub.repeat(a,b);return this}gl(a){return this.ub.gl(a)}Kn(a,b=!0,c=!1){return rxjs.firstValueFrom(this.observe(a,b,c))}il(a){this.ub.il(a);return this}bb(a,b=!0){return this.ub.bb(a,b)}on(a,b,c,d=!0){return this.ub.on(a,b,c,d)}Zh(a){return this.ub.Zh(a)}gn(a,b){return this.ub.gn(a,b)}vj(a,b){return this.ub.vj(a,b)}fi(a){return this.ub.fi(a)}pj(){return this.ub.pj()}Kg(a,
919
+ b){const c=b||olympe.W.hc();return this.ub.Kg(()=>{this.ub.tj(c);a()},c)}tj(a){this.ub.tj(a)}onDestroy(a){return this.ub.onDestroy(a)}Ke(a){this.ub.Ke(a)}destroy(){this.ub.destroy()}clear(){this.ub.clear()}Ab(){return this.ub.Ab()}pn(){return this.ub.pn()}$k(){return this.ub.$k()}fb(a){if('function'!==typeof this.ub.getProperty)throw Error('Trying to call deprecated method $.getProperty() in a non-UI brick');return this.ub.getProperty(a)}Dw(a){if('function'!==typeof this.ub.getEvent)throw Error('Trying to call deprecated method $.getEvent() in a non-UI brick');
920
+ return this.ub.getEvent(a)}by(...a){if('function'!==typeof this.ub.observeMany)throw Error('Trying to call deprecated method $.observeMany() in a non-UI brick');return this.ub.observeMany(a)}};olympe.sc.eb.prototype.observeMany=olympe.sc.eb.prototype.by;olympe.sc.eb.prototype.getEvent=olympe.sc.eb.prototype.Dw;olympe.sc.eb.prototype.getProperty=olympe.sc.eb.prototype.fb;olympe.sc.eb.prototype.clear=olympe.sc.eb.prototype.clear;olympe.sc.eb.prototype.destroy=olympe.sc.eb.prototype.destroy;
921
+ olympe.sc.eb.prototype.offDestroy=olympe.sc.eb.prototype.Ke;olympe.sc.eb.prototype.onDestroy=olympe.sc.eb.prototype.onDestroy;olympe.sc.eb.prototype.offClear=olympe.sc.eb.prototype.tj;olympe.sc.eb.prototype.onClear=olympe.sc.eb.prototype.Kg;olympe.sc.eb.prototype.getOtherContext=olympe.sc.eb.prototype.fi;olympe.sc.eb.prototype.onContext=olympe.sc.eb.prototype.vj;olympe.sc.eb.prototype.createChild=olympe.sc.eb.prototype.Zh;olympe.sc.eb.prototype.setParentElement=olympe.sc.eb.prototype.il;
922
+ olympe.sc.eb.prototype.waitFor=olympe.sc.eb.prototype.Kn;olympe.sc.eb.prototype.runner=olympe.sc.eb.prototype.gl;olympe.sc.eb.prototype.repeat=olympe.sc.eb.prototype.repeat;olympe.sc.eb.prototype.observe=olympe.sc.eb.prototype.observe;olympe.sc.eb.prototype.has=olympe.sc.eb.prototype.has;olympe.sc.eb.prototype.get=olympe.sc.eb.prototype.get;olympe.sc.eb.prototype.remove=olympe.sc.eb.prototype.remove;olympe.sc.eb.prototype.trigger=olympe.sc.eb.prototype.ni;olympe.sc.eb.prototype.set=olympe.sc.eb.prototype.set;
923
+ olympe.sc.eb.prototype.getParent=olympe.sc.eb.prototype.getParent;olympe.sc.ve=class extends olympe.sc.Runnable{ab(){return this.tb(olympe.sc.ve.G,olympe.sc.Runnable)}U(){return this.tb(olympe.sc.ve.C,olympe.dm.Property)}};olympe.sc.ve.O=Mc(olympe.dc.ya.C('016c2d996d9ca27fa9d8',olympe.sc.ve));olympe.sc.ve.G=olympe.sc.ve.O.Ha('016c3cb7742ec9309e0b');olympe.sc.ve.C=olympe.sc.ve.O.Ha('016c42d3454636f90533');olympe.sc.ve.prototype.ab.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.sc.ve.prototype.U.K=new olympe.D.J(()=>olympe.dc.Ca,[]);olympe.sc.Ko=class extends olympe.dm.Qb{C(){return olympe.sc.Je.tg.Pj}};olympe.sc.Ko.O=olympe.dc.ya.C('017a7a9ff057958e5678',olympe.sc.Ko);olympe.sc.Sp=class extends olympe.dm.Qb{C(){return olympe.sc.Je.tg.jv}};olympe.sc.Sp.O=olympe.dc.ya.C('01644b6d4543b344b857',olympe.sc.Sp);olympe.sc.Tp=class extends olympe.dc.CloudObject{};olympe.sc.Tp.O=olympe.dc.ya.C('0162f672366be5ca7a86',olympe.sc.Tp);olympe.sc.Zq=class extends olympe.sc.ve{};olympe.sc.Zq.O=olympe.dc.ya.C('016d3f37610ae4fc3962',olympe.sc.Zq);olympe.sc.Qh=class extends olympe.dm.BrickMetadata{C(){return olympe.sc.Je.tg.Pj}};olympe.sc.Qh.O=olympe.dc.ya.C('01645fe6873aeea59e64',olympe.sc.Qh);olympe.sc.Qh.C=olympe.sc.Qh.O.Ha('017ed8ac775f48d4d589');olympe.sc.Qh.F=olympe.sc.Qh.O.Ha('017ed8ac775f48d4d590');olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.ya.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Transaction=class{constructor(a=!0){this.C=(new olympe.dc.Transaction).persist(a);this.F=new Map;this.source=olympe.dc.Ga.kc}static from(a){const b=olympe.sc.Ta.jg.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Transaction}static process(a,b){return a.has(olympe.sc.Ta.jg.TRANSACTION,!0)?Promise.resolve(!1):b.hb().then(()=>!0)}Z(){return this.C.Z()}create(a,b=new Map,c=this.source,d){d=this.C.create(a,d).mi(c);this.F.set(d.R(),olympe.dc.wa(a));for(const [e,f]of b)d.setProperty(e,
924
+ f);c===olympe.dc.Ga.Pc&&(b=olympe.dc.Oa(),b=null!==dj?b.kj(dj,[olympe.sc.Ma.Ne.C,olympe.sc.md.F.Gc()])[0]||null:null,null!==b?this.Ra(olympe.sc.md.N,b,d):olympe.ra.Xa('sc').warn('No business container for new instance of',olympe.dc.wa(a)));return d.R()}update(a,b,c){this.C.update(a,b,c);return this}Px(a,b){a=this.C.update(a);for(const [c,d]of b)a.setProperty(c,d);return this}delete(a){this.C.delete(a);return this}Ra(a,b,c){this.C.Ra(a,b,c);return this}fc(a,b,c){this.C.fc(a,b,c);return this}Um(a,b){this.C.Um(a,
925
+ b);return this}persist(a=!0){this.C.persist(a);return this}xj(a,b=!0){this.C.xj(a,b);return this}mi(a){this.source=a;return this}model(a){return this.F.get(olympe.dc.wa(a))||olympe.dc.Oa().model(a)}wn(a){fe(this.C,a.C);return this}Km(a){this.C.Km(a);return this}hb(){return new Promise((a,b)=>{this.C.hb((c,d)=>{c?a():b(d)})})}Xm(){return new Promise((a,b)=>{this.C.Xm((c,d)=>{c?a():b(d)})})}};olympe.sc.Transaction.prototype.executeAsLarge=olympe.sc.Transaction.prototype.Xm;
926
+ olympe.sc.Transaction.prototype.execute=olympe.sc.Transaction.prototype.hb;olympe.sc.Transaction.prototype.afterExecution=olympe.sc.Transaction.prototype.Km;olympe.sc.Transaction.prototype.merge=olympe.sc.Transaction.prototype.wn;olympe.sc.Transaction.prototype.model=olympe.sc.Transaction.prototype.model;olympe.sc.Transaction.prototype.setSource=olympe.sc.Transaction.prototype.mi;olympe.sc.Transaction.prototype.persistInstance=olympe.sc.Transaction.prototype.xj;
927
+ olympe.sc.Transaction.prototype.persist=olympe.sc.Transaction.prototype.persist;olympe.sc.Transaction.prototype.deleteAllRelations=olympe.sc.Transaction.prototype.Um;olympe.sc.Transaction.prototype.deleteRelation=olympe.sc.Transaction.prototype.fc;olympe.sc.Transaction.prototype.createRelation=olympe.sc.Transaction.prototype.Ra;olympe.sc.Transaction.prototype['delete']=olympe.sc.Transaction.prototype.delete;olympe.sc.Transaction.prototype.multiUpdate=olympe.sc.Transaction.prototype.Px;
928
+ olympe.sc.Transaction.prototype.update=olympe.sc.Transaction.prototype.update;olympe.sc.Transaction.prototype.create=olympe.sc.Transaction.prototype.create;olympe.sc.Transaction.prototype.getId=olympe.sc.Transaction.prototype.Z;olympe.sc.Transaction.process=olympe.sc.Transaction.process;olympe.sc.Transaction.from=olympe.sc.Transaction.from;olympe.sc.Je.BrickMetadata=olympe.dm.BrickMetadata;olympe.sc.Je.we=olympe.dm.we;olympe.ia.node.pa={};const pj={client:'client',hostname:'host',port:'port',user:'user',password:'password',Ka:'database',schema:'schema',py:'pollingFrequency',Jv:'burstTransactionInterval',Mx:'minConnections',Lx:'maxConnections',Mv:'connectionsTimeout'},qj=olympe.dc.ga.ka.om,rj=olympe.dc.ga.ka.qm,sj=olympe.dc.ga.ka.QUERY_RESULT,tj=olympe.dc.ga.ka.pm,uj=olympe.dc.ga.ka.mg,vj=olympe.dc.ga.ka.Sh,wj=olympe.dc.ga.ka.yh,xj=olympe.dc.ga.ka.yi,yj=olympe.dc.ga.ka.xh,zj=olympe.dc.ga.ka.fh,Aj=olympe.dc.ga.ka.Kj,Bj=olympe.dc.ga.ka.Du;
929
+ function Cj(a,b,c,d,e){const f=new olympe.H.Ba.nb.zb(a.tag,b),g=new olympe.sc.W.kt(a.L,a.Lc,a.ab);g.start(a.tag).catch(h=>a.L.error(`Error occurred while starting the file service of SQLConnector ${e}: ${h}`));f.listen().subscribe(h=>{var k=h.body();a.L.debug(`Serving a new message : ${k.t}`);switch(k.t){case qj:var l=c.queryBuilder().withSchema(d);k=xe(k.q);a.U(b,l,k,(t,u)=>{(u?h.yg(Error(u)):h.Me({t:sj,r:t})).then()});break;case rj:k=xe(k.q);Dj(a,b,()=>c.queryBuilder().withSchema(d),k,h);break;
930
+ case Bj:Ej(b,k.i,h.source());h.Mk().then();break;case zj:k=(new olympe.dc.W.Mi(a.Tb())).C(k.p);Fj(a,b,c,d,k,t=>(t?h.yg(Error(t)):h.Mk()).then());break;case yj:l=k.i;k=(new olympe.dc.W.Mi(a.Tb())).C(k.p);Gj(a,b,l,k,c,d);break;case uj:const n=b.get('_subscription_cache');k=k.s.reduce((t,u)=>{n.has(u)?Hj(n.get(u),h.source()):t.push(u);return t},[]);(0<k.length?h.yg(Error(`These subscriptions was not kept alive: ${k}`)):h.Mk()).then();break;case vj:const p=k.f;a.L.debug(`Uploading a file: ${p}`);k=Wi(g,
931
+ (t,u,v)=>{a.L.debug(`Received a file service upload request for file : ${u}`);return p!==u?Promise.reject('The file sent is not the same as the one initially requested'):v instanceof Uint8Array||'string'===typeof v?Ij(a,b,c,d,p,v).then(()=>new olympe.net.Ug('',olympe.net.cb.hd.xl)):Promise.reject(`Try to upload content for file ${p} but body is not a Uint8Array or a string`)});h.Me(k).then();break;case wj:const q=k.f;a.L.debug(`Serving a file: ${q}`);k=Wi(g,(t,u)=>{a.L.debug(`File service received a download request for file : ${u}`);
932
+ return q!==u?Promise.reject('The file to download is not the same as the one initially requested'):Jj(b,c.queryBuilder().withSchema(d),q).then(v=>{a.L.debug('File service download request, content is:',v);return new olympe.net.Ug(v,olympe.net.cb.hd.Jh)})});h.Me(k).then();break;case xj:const r=k.f;a.L.debug(`Deleting a file: ${r}`);k=Wi(g,(t,u)=>r!==u?Promise.reject('The file to download is not the same as the one initially requested'):Promise.resolve(new olympe.net.Ug('',olympe.net.cb.hd.Jh)));h.Me(k).then();
933
+ break;default:h.yg(Error(`Unsupported message type: ${k.t}`)).then()}})}function Dj(a,b,c,d,e){const f=d.Z(),g=`sub${f}`;e.gs(g).then(()=>{const h=b.get('_subscription_cache');let k=h.get(f);k||(k=new Kj(f,d,c,b.get('_polling_frequency'),a.U.bind(a,b),a.wc.bind(a,g,f),()=>h.delete(f)),h.set(f,k));Hj(k,e.source())}).catch(h=>e.yg(Error(h)).then())}
934
+ function Ej(a,b,c){(a=a.get('_subscription_cache').get(b))&&(a.C.delete(c)||olympe.ra.Xa('Subscription Cache').warn(`Try to unsubscribe to the subscription ${a.id} which is not registered.`))}function Fj(a,b,c,d,e,f){b=b.get('_data_model_observer');a=new olympe.ia.node.pa.Ia.Rq(a.L,b);e.Qc(a);Lj(a,c,d).then(()=>f(null)).catch(g=>f(g))}
935
+ function Gj(a,b,c,d,e,f){const g=`_burst.${c}`,h=b.get(g);null===h?(b.set(g,d),setTimeout(()=>{const k=b.get(g);b.remove(g);Fj(a,b,e,f,k,l=>{l&&olympe.H.Ba.nb.zb.publish(c,{t:Aj,r:l})})},b.get('_burst_interval'))):d.Qc(h)}function Ij(a,b,c,d,e,f){const g=olympe.ia.node.pa.Ia.cd.Tj,h=new olympe.dc.db.Ac;h.F(e,(new Map).set(g,f),0);h.Ra(olympe.dc.lc.Xc,e,olympe.dc.wa(olympe.dm.File));return new Promise((k,l)=>{Fj(a,b,c,d,h,n=>n?l(n):k())})}
936
+ function Jj(a,b,c){return x(function*(){var d=olympe.ia.node.pa.Ia.cd.Tj,e=olympe.ia.node.pa.Ia.cd.Lh;const f=yield Mj(a.get('_data_model_observer').C,olympe.dc.wa(olympe.dm.File));if((e=(yield b.from(f).select(d).where(e,c))[0])&&e[d])return d=e[d],d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength);throw Error(`File ${c} not found in the database`);}())}
937
+ olympe.ia.node.pa.Qq=class extends olympe.sc.logic.Xd{constructor(a,b,c,d){super(a,b,c);this.Lc=d;this.ab=olympe.T.getParameter(olympe.H.ob.im)}update(a,[b]){var c=(k,l)=>{let n,p;return null!=(p=null!=(n=olympe.T.getParameter(`${'dbconnector'}.${b}.${k}`))?n:olympe.T.getParameter(`${'dbconnector'}.${k}`))?p:l};a.set('_burst_interval',olympe.T.getParameter(`${'dbconnector'}.${b}.${pj.Jv}`)||5E3);a.set('_polling_frequency',c(pj.py,6E5));const d=c(pj.client,'pg'),e=c(pj.hostname,''),f=c(pj.Ka),g=c(pj.schema,
938
+ b),h=knex({client:d,connection:{host:e,port:c(pj.port),user:c(pj.user),password:c(pj.password),database:f},pool:{min:c(pj.Mx,0),max:c(pj.Lx,10)},acquireConnectionTimeout:c(pj.Mv,6E4)});this.L.info(`SQLConnector ${b} started with host ${e}, database ${f} on schema ${g}`);this.ad=olympe.ra.Xa('sql');a.Kg(()=>h.destroy().then());c=new olympe.ia.node.pa.Ia.Xs(h,g,this);a.set('_data_model_observer',c);a.set('_subscription_cache',new Map);Cj(this,a,h,g,b)}U(a,b,c,d){a=a.get('_data_model_observer');const e=
939
+ a.C,f=new olympe.ia.node.pa.Ia.Au(c,e);Nj(a).then(()=>Oj(f)).then(g=>{if(0===g.length)return[[],g];const h=Pj(new olympe.ia.node.pa.Ia.Pq(f,b,g));this.ad.debug(`Sending a sql query with the following text: ${h.toString()}`);return h.then(k=>[k,g])}).then(([g,h])=>Qj(c.Z(),g,h,e)).then(g=>d(g,null)).catch(g=>d({},g))}wc(a,b,c){olympe.H.Ba.nb.zb.publish(a,{t:tj,i:b,r:c}).then().catch(d=>this.L.error('Error occurred while publishing query result update: '+d))}};
940
+ olympe.ia.node.pa.Qq.O=olympe.dc.ya.C('017dc8db8074471acb7a',olympe.ia.node.pa.Qq,olympe.sc.P.Ea,olympe.net.P.Bm);function Hj(a,b){a.C.has(b)?(a=a.C,a.values.has(b)&&a.values.set(b,Date.now())):a.C.add(b)}
941
+ class Kj{constructor(a,b,c,d,e,f,g){this.id=a;this.query=b;a=new olympe.W.gr(olympe.T.getParameter(olympe.Za.Config.Yl)+6E4);a.F=g;this.C=a;this.start(c,e,f,d)}start(a,b,c,d){let e=null,f=new Set;const g=()=>{0<this.C.values.size&&(b(a(),this.query,(h,k)=>{if(k)olympe.ra.Xa('Subscription Cache').error(`Error occurred while updating subscription cache update: ${k}`);else if(k=olympe.W.mb(JSON.stringify(h)),k!==e){e=k;k=h.k;const l=[];k.forEach((n,p)=>{f.has(n)?f.delete(n):l.push(p)});h.a=l;h.r=Array.from(f);
942
+ f=new Set(k);c(h)}}),setTimeout(g,d))};setTimeout(g,d)}};olympe.ia.node.pa.Ia={};olympe.ia.node.pa.Ia.Bc={EQUAL:'equal',Uq:'substring',Ro:'filter',Dp:'<=',Ep:'<',ep:'>=',fp:'>',ag:'and',Kh:'or',Yg:'not',Dq:'regex'};olympe.ia.node.pa.Ia.cd={Lh:'tagOlympe',kk:'tagOlympeOrig',Bl:'tagOlympeDest',Tj:'fileContent'};const Rj=olympe.ia.node.pa.Ia.cd.kk,Sj=olympe.ia.node.pa.Ia.cd.Bl,Tj=olympe.ia.node.pa.Ia.cd.Lh,Uj=olympe.ia.node.pa.Ia.cd.Tj;function Nj(a){return new Promise(b=>{0<a.F?a.U.add(()=>b()):b()})}
943
+ function Vj(a){Wj(a,olympe.dc.wa(olympe.dm.File));const b=new Map;a.G.sb(olympe.sc.logic.Xd.C).observe(a.N).subscribe(c=>{Be(c).forEach(d=>{const e=d.R();Xj(a,()=>{var g=Yj;const h=[{name:Tj,$e:Tj,Zk:!1}];e===olympe.dc.wa(olympe.dm.File)&&h.push({name:Uj,$e:Uj,Zk:!1});return g(a,e,e,h)},`Create Table for ${e}`);const f=new olympe.D.Xb('Business model context',a.N);b.set(e,f);f.run(()=>Zj(a,f,e))});Ce(c).forEach(d=>{b.get(d).destroy();Xj(a,()=>ak(a,d),`Delete Table for ${d}`)})})}
944
+ function bk(a){a.F++;1===a.F&&a.L.debug('Data model observer is busy')}function ck(a){a.F--;if(0===a.F){a.L.debug('Data model observer is free');for(const b of a.U)b();a.U.clear()}}function Wj(a,b){if(!a.db.al(a.G,olympe.sc.logic.Xd.C,b)){bk(a);const c=new olympe.dc.Transaction;c.Ra(olympe.sc.logic.Xd.C,a.G,b);c.hb((d,e)=>{d||a.L.error(`Error while linking the business model ${b} to the SQLConnector: ${e}`);ck(a)},!0)}}function dk(a){return a.client.schema.withSchema(a.schema)}
945
+ function Xj(a,b,c){if(!a.N.G()&&!a.N.Ab()){a.L.debug(`Push operation:${c}`);bk(a);var d=a.Y,e=()=>{d.shift();ck(a);if(0<d.length)d[0]()},f=()=>{b().then(()=>{a.L.debug(`Operation ${c} succeed`);e()}).catch(g=>{a.L.error(`Error for operation ${c}: ${g}`);e()})};d.push(f);1===d.length&&f()}}
946
+ function Yj(a,b,c,d){return x(function*(){if(yield dk(a).hasTable(b))return a.L.debug(`Table ${c} already exist`),Promise.resolve().then(()=>{var e=a.C;e.C.set(c,b);e.G.set(b,c)});a.L.debug('Create table for : '+c);return dk(a).createTable(b,e=>{d.forEach(({name:f,$e:g,Hr:h,ps:k,Zk:l})=>{ek(a,e,f,g,l,k,h)})}).then(()=>{var e=a.C;e.C.set(c,b);e.G.set(b,c)})}())}
947
+ function Zj(a,b,c){b.onDestroy(()=>{Xj(a,()=>Promise.all(Array.from(a.La.get(c)).map(d=>ak(a,d))).then(()=>{a.La.delete(c)}),`Destroy relation tables of business model ${c}: relations: ${a.La.get(c)}`)});a.yn(c,b);a.La.set(c,new Set);olympe.dc.gb.from(c).sb(olympe.dc.CloudObject.G).Yi().sb(olympe.dm.Relation.destinationModelRel).Yi().filter((new olympe.dc.ba.V.Ee(a.G)).sb(olympe.sc.logic.Xd.C.Gc())).observe(b).subscribe(d=>{0<Be(d).length&&(a.L.debug('Handle new relations : '+Be(d)),Xj(a,()=>Promise.all(Be(d).map(([e,
948
+ f])=>{a.La.get(c).add(e.R());a.La.get(f.R()).add(e.R());e=e.R();var g=Yj;f=f.R();return g(a,e,e,[{name:Rj,$e:Rj,ps:c,Hr:Tj,Zk:!0},{name:Sj,$e:Sj,ps:f,Hr:Tj,Zk:!0}])})).then(),`Add relation tables for business model ${c}: ${Be(d)}`));0<Ce(d).length&&(a.L.debug('Handle relations to remove : '+Ce(d)),Xj(a,()=>Promise.all(Ce(d).map(([e,f])=>{a.La.get(c).delete(e);a.La.get(f).delete(e);return ak(a,e)})).then(),`Delete relation tables for business model ${c}: ${Ce(d)}`))})}
949
+ function ak(a,b){return x(function*(){try{var c=yield Mj(a.C,b)}catch(d){a.L.warn(`Try to delete a table not registered: ${d}`);return}if(yield dk(a).hasTable(c)){dk(a).dropTable(c);c=a.C;const d=c.C.get(b);c.G.delete(d)||c.C.delete(b)}}())}
950
+ function fk(a,b,c,d){return x(function*(){const e=yield Mj(a.C,b),f=yield Promise.all(c.map(k=>Promise.resolve(k))),g=yield Promise.all(d.map(k=>Promise.resolve(k))),h=yield a.client.queryBuilder().withSchema(a.schema).table(e).columnInfo();return dk(a).table(e,k=>{const l=new Set(Object.keys(h));f.forEach((n,p)=>{!l.has(n)&&ek(a,k,n,c[p])});g.forEach(n=>{l.has(n)&&k.dropColumn(n)})})}())}
951
+ function ek(a,b,c,d,e=!1,f='',g=''){if(c===Tj)b.string(c,21).primary();else if(c===Rj||c===Sj){if(e)b.string(c).notNullable().references(g).inTable(`${a.schema}.${f}`).onDelete('CASCADE')}else c===Uj?b.binary(c):d&&(a=a.db,d=olympe.dc.od.from(d).sb(olympe.dm.Property.typeRel).jd(),a.Uf(d,olympe.dm.String)?b.string(c,1E3):a.Uf(d,olympe.dm.Number)?b.double(c):a.Uf(d,olympe.dm.Boolean)?b.boolean(c):a.Uf(d,olympe.dm.DateTime)?b.string(c):a.Uf(d,olympe.dm.Color)&&b.string(c,50))}
952
+ olympe.ia.node.pa.Ia.Xs=class{constructor(a,b,c){this.L=olympe.ra.Xa('sql');this.client=a;this.schema=b;this.G=c;this.C=new olympe.ia.node.pa.Ia.hv;this.N=new olympe.D.Xb(`Data Model Observer of ${c.R()}`);this.Y=[];this.F=0;this.La=new Map;this.U=new Set;this.db=olympe.dc.Oa();Vj(this)}yn(a,b){this.L.debug('Observe properties for '+a);olympe.dc.gb.from(a).sb(olympe.dc.CloudObject.propertyRel).observe(b).subscribe(c=>{this.L.debug('New properties for '+a+' '+Be(c));Xj(this,()=>fk(this,a,Be(c).map(d=>
953
+ d.R()),Ce(c)),`Update columns of ${a}: added: ${Be(c)}, removed: ${Ce(c)}`)})}};const gk=olympe.ia.node.pa.Ia.Bc.EQUAL,hk=olympe.ia.node.pa.Ia.Bc.ag,ik=olympe.ia.node.pa.Ia.Bc.Kh,jk=olympe.ia.node.pa.Ia.Bc.Yg,kk=olympe.ia.node.pa.Ia.Bc.Ro,lk=olympe.ia.node.pa.Ia.Bc.ep,mk=olympe.ia.node.pa.Ia.Bc.fp,nk=olympe.ia.node.pa.Ia.Bc.Dp,ok=olympe.ia.node.pa.Ia.Bc.Ep,pk=olympe.ia.node.pa.Ia.Bc.Dq,qk=olympe.ia.node.pa.Ia.Bc.Uq,rk=olympe.ia.node.pa.Ia.cd.Lh;
954
+ function Oj(a){return x(function*(){var b=a.query.G;let c=b;var d=[];const e=a.query.C;let f=olympe.dc.Oa().oj(b);!f&&e[0]instanceof olympe.dc.ba.Hb.jf&&(f=e[0].Qd().qb(olympe.dc.CloudObject.instancesRel));if(f){try{var g=yield Mj(a.F,b)}catch(l){return[]}f=!0;e.shift()}else{try{var h=yield a.F.Tb(b,'')}catch(l){return[]}c=h;g=yield Promise.resolve([['tagOlympe',b]]);1<g.length?d.push(['',hk,g.map(([l,n])=>[l,gk,sk(n)])]):d.push([g[0][0],gk,sk(g[0][1])]);g=yield Mj(a.F,h)}h=tk(a,g);b=Array.from(a.query.F);
955
+ b=b.includes(0)||b.includes(1)&&f;var k=[];if(b){const l=a.query.Z(),n=uk(a.F,l,c,rk);k=olympe.dc.gb.from(c).sb(olympe.dc.CloudObject.propertyRel).jd().map(q=>q.R());const p=yield Promise.all(k.map(q=>Promise.resolve(q)));k=k.map(q=>uk(a.F,l,c,q)).map((q,r)=>[q,p[r]]);k.unshift([n,rk])}a.G.limit=a.query.max;a.G.offset=a.query.offset;a.C.push({Lg:b,recursive:!1,filters:d,kh:'',bi:'',Yh:k,gh:h,name:g});d=0;for(const l of e)d=yield vk(a,l,d,f);return a.C}())}
956
+ function tk(a,b){a.U++;return`alias-${b.charAt(0)}${a.U}`}function vk(a,b,c,d){let e=c;switch(!0){case b instanceof olympe.dc.ba.Hb.jf:case b instanceof olympe.dc.ba.Hb.kf:e+=1;a=wk(a,b,e,d);break;case b instanceof olympe.dc.ba.Hb.vc:a=xk(a,b);break;case b instanceof olympe.dc.ba.Hb.Ph:a=yk(a,b);break;default:a=Promise.reject(`Query part ${b.toString()} could not be parsed`)}return a.then(()=>e)}
957
+ function wk(a,b,c,d){const e=b.Qd().R(),f=b.Qd().Pa()===olympe.dc.Aa.ORIGIN?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel;let g=b instanceof olympe.dc.ba.Hb.kf;const h=olympe.dm.Relation.F.Zl,k=olympe.dc.od.from(e).sb(f).jd();c=d?c+1:c;const l=Array.from(a.query.F).includes(c),[n,p]=['',''];return Mj(a.F,k.R()).then(q=>x(function*(){const r=tk(a,q),t=[];let u=Promise.resolve();h===olympe.dm.Relation.F.Zl&&(u=Mj(a.F,e).then(v=>{const w=tk(a,v),[y,B]=zk(b.Qd().Pa());a.C.push({Lg:!1,
958
+ gh:w,name:v,Yh:[],kh:y,bi:B,filters:[],recursive:g});g=!1}));return u.then(()=>x(function*(){let v=[];var w=Promise.resolve([]);let y=[];if(l){const B=a.query.Z(),E=uk(a.F,B,k.R(),rk);w=olympe.dc.gb.from(k.R()).sb(olympe.dc.CloudObject.propertyRel).Yi().jd().map(I=>I.R());v=w.map(I=>uk(a.F,B,k.R(),I));w=Promise.all(w.map(I=>Promise.resolve(I)));y.push([uk(a.F,B,k.R(),rk),rk]);const S=yield w;y=v.map((I,Z)=>[I,S[Z]]);y.unshift([E,rk])}a.C.push({Lg:l,gh:r,name:q,Yh:y,kh:n,bi:p,filters:t,recursive:g})}()))}()))}
959
+ function xk(a,b){return a.N(b.C).then(c=>{a.C[a.C.length-1].filters.push(c)})}function yk(a,b){a.G.order=b.order;a.G.aliasSorting=a.C[a.C.length-1].gh;return Promise.resolve(b.fb().R()).then(c=>{a.G.columnSorting=c})}function zk(a){const b=olympe.ia.node.pa.Ia.cd.kk,c=olympe.ia.node.pa.Ia.cd.Bl;return a===olympe.dc.Aa.ORIGIN?[c,b]:[b,c]}
960
+ olympe.ia.node.pa.Ia.Au=class{constructor(a,b){this.query=a;this.U=0;this.F=b;this.C=[];this.G={}}N(a){switch(!0){case a instanceof olympe.dc.ba.V.Ic:const c=a.C;return Promise.resolve(a.fb()).then(h=>[h,gk,sk(c)]);case a instanceof olympe.dc.ba.V.Wc:const d=a.substring;return Promise.resolve(a.fb()).then(h=>[h,qk,d]);case a instanceof olympe.dc.ba.V.wd:var b=a.C.source;return/^\^?([-_%\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\'|\\"|\.\+\?|\.\*|\.\+|\\\/|\\\\|\\\^|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\||\\\[|\\\]|\\\{|\\\})*\$*?$/.test(b)?
961
+ Promise.resolve(a.fb()).then(h=>[h,pk,a.C]):Promise.reject(`Query not supported for regex : ${b}`);case a instanceof olympe.dc.ba.V.nd:return this.N(a.C).then(h=>['',jk,h]);case a instanceof olympe.dc.ba.V.Ee:const e=a.destination,f=Array.from(a.recursive);if(f.reduce((h,k)=>h||k,!1))return Promise.reject('Recursive relation in RelatedTo predicate is not supported');b=a.ld().map((h,k)=>Promise.resolve(h.R()).then(l=>{const [n,p]=zk(h.Pa());let q=[];e&&k===a.ld().length-1&&(q=[[p,gk,sk(e)]]);return{name:l,
962
+ recursive:f[k],Yh:[],kh:n,bi:p,filters:q,gh:tk(this,l),Lg:!1}}),this);let g;g=e?Promise.resolve([['tagOlympe',e]]):Promise.resolve([]);return Promise.all(b).then(h=>{var k=this.C[this.C.length-1];k={name:k.name,recursive:!1,Yh:[[rk,rk]],kh:'',bi:'',filters:[],gh:tk(this,k.name),Lg:!0};h.unshift(k);return g.then(l=>['',kk,{target:l,La:h}])});case a instanceof olympe.dc.ba.V.Dh:return Promise.resolve(a.fb()).then(h=>('number'===typeof a.C?Promise.resolve(a.C):Promise.resolve(a.C.R())).then(k=>{var l=
963
+ a.G;return Promise.resolve([h,a.F?l?ok:nk:l?mk:lk,k])}));case a instanceof olympe.dc.ba.V.Ud:return b=Array.from(a.V).flatMap(this.N.bind(this)),Promise.all(b).then(h=>['',hk,h]);case a instanceof olympe.dc.ba.V.ae:return b=Array.from(a.V).flatMap(this.N.bind(this)),Promise.all(b).then(h=>['',ik,h]);default:return Promise.reject('Failed to parse predicate')}}};function Qj(a,b,c,d){const e=[],f=new olympe.dc.transaction.vd;let g,h,k,l;const n=null==(g=c[0])?void 0:null==(h=g.filters)?void 0:null==(k=h[0])?void 0:null==(l=k[2])?void 0:l.v;return Ak(c,d).then(p=>{for(const r of b){const [t,u,v]=Bk(a,r,p,d,c,n);for(const [w,y,B]of v)f.Ra(w,y,B);var q=Array.from(t.keys()).map(w=>w).join('.');e.push(q);for(const [w,y]of t.entries())q=u.get(w),d.N.set(w,q),f.F(w,new Map(y),0),f.Ra(olympe.dc.CloudObject.modelRel.R(),w,q,0)}d.F.delete(a);return{k:e,p:de(f)}})}
964
+ function Ak(a,b){const c=[],d=[],e=[],f=[];for(let g=1;g<a.length-1;g+=2)(a[g-1].Lg||1===g)&&a[g+1].Lg&&(d.push(b.oh(a[g-1].name)),e.push(b.oh(a[g+1].name)),c.push(Promise.resolve(b.G.get(a[g].name))),f.push(a[g].kh===olympe.ia.node.pa.Ia.cd.kk?olympe.dc.Aa.DESTINATION:olympe.dc.Aa.ORIGIN));return Promise.all([Promise.all(c),Promise.all(d),Promise.all(e)]).then(([g,h,k])=>g.map((l,n)=>[l,h[n],k[n],f[n]]))}
965
+ function Bk(a,b,c,d,e,f){const g=olympe.ia.node.pa.Ia.cd.Lh;let h=0;let k='',l='',n=0;const p=new Map,q=new Map,r=[];for(const [u,v]of Object.entries(b)){b=v;var t=u.split(';');if(t[1]===g){h=parseInt(t[0],10);t=Ck(d,a,h);if(n<c.length){const w=c[n][3],y=c[n][0];if(k===c[n][1]&&t===c[n][2])r.push(w===olympe.dc.Aa.DESTINATION?[y,l,b]:[y,b,l]),n++;else{let B;!k&&t===(null==(B=e[2])?void 0:B.name)&&f&&(r.push(w===olympe.dc.Aa.DESTINATION?[y,f,b]:[y,b,f]),n++)}}p.set(b,[]);q.set(b,t);d.N.set(b,t);k=t;
966
+ l=b}else h===parseInt(t[0],10)&&(t=t[1],p.get(l).push([t,b]))}return[p,q,r]}olympe.ia.node.pa.Ia.LA=class{};function Pj(a){const b=a.C,{offset:c,limit:d,IC:e,order:f,DC:g}=a.U.G;-1<d&&b.limit(d);0<c&&b.offset(c);e&&f&&b.orderBy(`${g}.${e}`,f.toLowerCase());for(const [h,{Lg:k,gh:l,name:n,filters:p,recursive:q,Yh:r,kh:t,bi:u}]of a.Y.entries())Dk(a,b,k,l,n,p,q,0===h,t,u,r);return b}
967
+ function Dk(a,b,c,d,e,f,g,h,k,l,n){if(c){if(!n||1>n.length)throw Error('Trying to return an element without providing mappings in SQLBuilder:BuildNodes');c=n.map(([p,q])=>b.client.raw('??.?? as ??',[d,q,p])).join(',');b.select(b.client.raw(c))}0<f.length&&Ek(a,b,d,f,olympe.ia.node.pa.Ia.qd.NONE);h?(b.from(`${e} as ${d}`),a.G=d,a.F=l):(g&&(f=`cte${a.N++}`,Fk(a,b,f,d,e)),b.join(`${e} as ${d}`,p=>{var q=a.G,r=a.F;p.on(''===r?`${q}.tagOlympe`:`${q}.${r}`,''===k?`${d}.tagOlympe`:`${d}.${k}`);a.G=d;a.F=
966
968
  l}))}
967
- function Ak(a,b,c,d,e){const f=olympe.ha.node.pa.Ia.Bc.EQUAL,g=olympe.ha.node.pa.Ia.Bc.$f,h=olympe.ha.node.pa.Ia.Bc.Ih,k=olympe.ha.node.pa.Ia.Bc.Xg,l=olympe.ha.node.pa.Ia.Bc.Ro,n=olympe.ha.node.pa.Ia.Bc.ep,p=olympe.ha.node.pa.Ia.Bc.fp,q=olympe.ha.node.pa.Ia.Bc.Dp,r=olympe.ha.node.pa.Ia.Bc.Ep,t=olympe.ha.node.pa.Ia.Bc.Cq,u=olympe.ha.node.pa.Ia.Bc.Tq;if(1<d.length)Ck(b,olympe.ha.node.pa.Ia.qd.$f,Dk(a,d,olympe.ha.node.pa.Ia.qd.$f,c));else{var [v,w,y]=d[0];d=`${c}.${v}`;switch(w){case f:Ek(b,e,d,'=',
968
- y.v,!1);break;case u:a=Fk('.*',b.client.dialect);Ek(b,e,d,'LIKE',`${a}${y}${a}`,!1);break;case l:const B=y.relations,E=`cte${a.L++}`,S=new olympe.ha.node.pa.Ia.Oq(a.U,a.C,B),I=olympe.ha.node.pa.Ia.cd.Jh;a.C.with(E,Z=>{for(const [Sk,{Kg:Tk,fh:Uk,name:Vk,filters:Wk,recursive:Xk,Wh:Yk,jh:Zk,$h:$k}]of B.entries())zk(S,Z,Tk,Uk,Vk,Wk,Xk,0===Sk,Zk,$k,Yk);return Z});a.C.whereIn(b.client.raw('??.??',[c,I]),function(Z){Z.select(b.client.raw('??.??',[E,I])).from(E)});break;case q:Ek(b,e,d,'<=',y,'string'===
969
- typeof y);break;case r:Ek(b,e,d,'<',y,'string'===typeof y);break;case n:Ek(b,e,d,'>=',y,'string'===typeof y);break;case p:Ek(b,e,d,'>',y,'string'===typeof y);break;case g:Ck(b,e,Dk(a,y,olympe.ha.node.pa.Ia.qd.$f,c));break;case h:Ck(b,e,Dk(a,y,olympe.ha.node.pa.Ia.qd.Ih,c));break;case k:Ck(b,olympe.ha.node.pa.Ia.qd.Xg,Dk(a,[y],olympe.ha.node.pa.Ia.qd.Xg,c));break;case t:e=Gk(y,b.client.dialect),b.whereRaw('?? LIKE ?',[d,e])}}}
970
- function Bk(a,b,c,d,e){var f=['tagOlympe'];const g=Hk(f,d),h=Hk(f,c),k=g.map((l,n)=>[l,h[n]]);b.withRecursive(c,g,l=>{l.select(g).from({[d]:e}).pD(n=>n.select(g).from({[d]:e}).join(c,()=>{a.on(Object.fromEntries(k))}))})}function Hk(a,b){return a.map(c=>`${b}.${c}`)}
971
- function Ck(a,b,c){switch(b){case olympe.ha.node.pa.Ia.qd.NONE:a.where(c);break;case olympe.ha.node.pa.Ia.qd.$f:a.andWhere(c);break;case olympe.ha.node.pa.Ia.qd.Ih:a.orWhere(c);break;case olympe.ha.node.pa.Ia.qd.Xg:a.whereNot(c);break;default:olympe.ra.Xa('storage').error(`Where operand ${b} not recognized`)}}function Dk(a,b,c,d){return e=>{for(let f=0;f<b.length;++f)Ak(a,e,d,[b[f]],0===f?olympe.ha.node.pa.Ia.qd.NONE:c)}}
972
- function Ek(a,b,c,d,e,f){e=f?a.client.raw(e):e;switch(b){case olympe.ha.node.pa.Ia.qd.NONE:a.where(c,d,e);break;case olympe.ha.node.pa.Ia.qd.$f:a.andWhere(c,d,e);break;case olympe.ha.node.pa.Ia.qd.Ih:a.orWhere(c,d,e);break;case olympe.ha.node.pa.Ia.qd.Xg:a.whereNot(c,d,e);break;default:olympe.ra.Xa('storage').error(`Where operand ${b} not recognized`)}}function Fk(a,b){const c={'.+?':'_','.*':'%','.+':'_%'},d={'.+?':'?','.*':'*','.+':'?*'};return'mssql'===b?d[a]:c[a]}
973
- function Gk(a,b){let c='',d='',e='';const f=/^([-\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\\\)/,g=/^[%_'"]/,h=/^(\\\^|\\\/|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\[|\\\]|\\\{|\\\}])/,k=/^(\.\+\?|\.\*|\.\+)/;
974
- a=a.source;a.startsWith('^')?a=a.substring(1,a.length):c='%';for(a.endsWith('$')?a=a.substring(0,a.length-1):e='%';''!==a;){{var l=a;var n=b,p=k,q=h,r=f;const v=g.exec(l);if(v)l=[`\\${v[0]}`,v[0].length];else if(p=p.exec(l))l=[Fk(p[0],n),p[0].length];else if(q=q.exec(l))l=q[0],l='mssql'!==n||'['!==l[1]&&']'!==l[1]?[l.substring(1,l.length),l.length]:[l,q[0].length];else if(n=r.exec(l))l=[n[0],n[0].length];else throw Error(`Could find a match for character ${l.charAt(0)}`);}const [t,u]=l;d+=t;a=a.substring(u,
975
- a.length)}return c+d+e}olympe.ha.node.pa.Ia.Oq=class{constructor(a,b,c){this.U=a;this.C=b;this.G=this.F='';this.L=0;this.Y=c}};olympe.ha.node.pa.Ia.qd={$f:'&',Ih:'|',Xg:'!',NONE:''};const Ik=olympe.ha.node.pa.Ia.cd.jk,Jk=olympe.ha.node.pa.Ia.cd.Al,Kk=olympe.ha.node.pa.Ia.cd.Jh,Lk=olympe.ha.node.pa.Ia.cd.Rj,Mk=olympe.dc.$b.VERSION,Nk=olympe.dc.$b.Jd;function Hj(a,b,c){return x(function*(){yield Jj(a.L);return b.transaction(d=>x(function*(){for(const e of a.ua)yield e(d.withSchema(c));a.N.debug('Transaction just before commit: ',d.toString());return d}())).finally(()=>{a.ua.length=0;a.G.clear();a.N.debug('Transaction completed')})}())}
976
- olympe.ha.node.pa.Ia.Qq=class{constructor(a,b){this.N=a;this.L=b;this.C=b.C;this.G=new Map;this.ua=[]}uh(a,b,c=!0){a=c?{[Kk]:a}:{};for(const [d,e]of b)b=ok(e),a[d]=b.v;return a}F(a,b){b.delete(Nk);b.delete(Mk);this.G.set(a,b||new Map)}tc(a,b){this.ua.push(c=>{const d=this;return x(function*(){b.delete(Mk);var e=yield d.C.Tb(a,'');e=yield Ij(d.C,e);yield c.table(e).where(Kk,a).update(d.uh(a,b,!1))}())})}Mc(a){this.ua.push(b=>{const c=this;return x(function*(){var d=yield c.C.Tb(a,'');d=yield Ij(c.C,
977
- d);var e=olympe.dc.gb.from(d).sb(olympe.dc.CloudObject.G).jd();for(var f of e.keys())e=yield Promise.resolve(f),yield b.table(e).where(Ik,a).del();f=olympe.dc.gb.from(d).sb(olympe.dc.CloudObject.U).jd();for(const g of f.keys())f=yield Promise.resolve(g),yield b.table(f).where(Jk,a).del();yield b.table(d).where(Kk,a).del()}())})}Ra(a,b,c){a===olympe.dc.kc.Xc?(Sj(this.L,c),this.ua.push(d=>{const e=this;return x(function*(){const f=e.G.get(b),g=yield Ij(e.C,c);c!==olympe.dc.wa(olympe.dm.File)||f.has(Lk)?
978
- (e.C.L.set(b,c),yield d.table(g).insert(e.uh(b,f,!0))):yield d.table(g).where(Kk,b).update(e.uh(b,f,!1))}())})):this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d.table(e).insert({[Ik]:b,[Jk]:c})}()))}ec(a,b,c){this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d.table(e).where({[Ik]:b,[Jk]:c}).del()}()))}};olympe.ha.node.pa.Ia.Qq.la=[olympe.dc.Writable];function Ij(a,b){return(a=a.C.get(b))?Promise.resolve(a):Promise.reject(`No table were found for model ${a}`)}function qk(a,b,c,d){let e=a.F.get(b);e||(e=new Map,a.F.set(b,e));a=e.get(c);a||(a=e.size+1,e.set(c,a));return`${a};${d}`}function yk(a,b,c){a=a.F.get(b)||new Map;return(a=Array.from(a).find(([,d])=>d===c))&&a[0]||null}
979
- olympe.ha.node.pa.Ia.ev=class{constructor(){this.L=new Map;this.F=new Map;this.C=new Map;this.G=new Map}static R(a,b,c){return c?b[0][1]:''}nh(a){return Promise.resolve(a)}fb(a){return Promise.resolve(a)}Tb(a){return(a=this.L.get(a))?Promise.resolve(a):Promise.reject('GET MODEL TAG OF INSTANCE NOT IMPLEMENTED')}};function ok(a){let b=1,c=a;switch(!0){case a instanceof Date:b=2;c=a.toJSON();break;case a instanceof olympe.D.Color:b=3,c=`${a.Qf().valueOf()}.${a.Kf().valueOf()}.${a.Ff().valueOf()}.${a.Ef().valueOf()}`}return{t:b,v:c}}olympe.ha.node.pa.Ia.zC=class{};olympe.ha.node.host={};olympe.ha.node.host.Hd=function(a,b){this.uid=a;this.N=b};olympe.ha.node.host.Hd.prototype.constructor=olympe.ha.node.host.Hd;olympe.ha.node.host.Hd.prototype.destroy=function(){};olympe.ha.node.host.Hd.prototype.destroy=olympe.ha.node.host.Hd.prototype.destroy;olympe.ha.node.host.Hd.prototype.Xa=function(){return this.N};olympe.ha.node.host.Hd.la=[olympe.host.ba.Hd];olympe.ha.node.host.$p=class{constructor(a){this.N=a}oj(){return!1}bl(){this.N.error('No history manager implemented in Node')}C(){this.bl();return Gb()}F(){this.bl()}};olympe.ha.node.host.$p.la=[olympe.host.Ei];olympe.ha.node.host.gd=class{constructor(){this.C={};this.L={}}destroy(){}U(a){clearTimeout(this.C[a]);delete this.C[a]}aa(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}Y(a,b,c){this.L[b]=setInterval(c,a)}F(a){clearInterval(this.L[a]);delete this.L[a]}};olympe.host.Zp.register(olympe.host.ba.Yp.rr,olympe.ha.node.host.gd);olympe.ha.node.host.gd.la=[olympe.host.ba.gd];olympe.ha.node.host.yk=class{constructor(a){this.N=a}};olympe.ha.node.host.yk.la=[olympe.host.yk];olympe.T.config(function(a){qa(a,olympe.host.P.Il,olympe.ha.node.host.$p,olympe.host.P.Ea);qa(a,olympe.host.P.Wq,olympe.ha.node.host.yk,olympe.host.P.Ea)},'olympe.native.node.host');olympe.net.rd={};olympe.net.rd.Ml=class{constructor(a){this.N=a;this.C=new Map}G(){}F(){}};olympe.net.rd.WebSocket=class{constructor(a,b){this.N=b;this.id=a;this.C=null;this.buffer=[];this.F=this.G=this.L=null}Z(){return this.id}open(a){const b=`#${this.id}`,c=this.Y(a);c.binaryType='arraybuffer';c.onopen=()=>{this.N.info('Websocket OPENED');this.L?(this.N.debug('Notifying upper layer for WebSocket',b),this.L()):this.N.warn('Nothing to notify for WebSocket',b);this.N.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
980
- 0};c.onmessage=d=>{d='string'===typeof d.data?String(d.data):Da(d.data);this.N.debug(b,'<',d);this.F&&this.F(d)};c.onclose=()=>{this.N.debug(`WebSocket ${b} CLOSED`);this.G&&this.G()};c.onerror=()=>{this.N.debug(`WebSocket ${b} ERROR`)};this.C=c}send(a){const b=`#${this.id}`;if(null!==this.C){const c=this.C.constructor;switch(this.C.readyState){case c.OPEN:this.N.debug(b,'>',a);this.C.send(a);break;case c.CONNECTING:this.N.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.N.debug(b,
981
- '- Closed','>',a),!1}}else this.N.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.C){const a=this.C.constructor,b=this.C.readyState;if(b===a.OPEN||b===a.CONNECTING){this.N.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.N.debug('Try to force close native websocket, but not open nor connecting')}ja(a){this.L=a||null}aa(a){this.F=a||null}U(a){this.G=a||null}Y(){}};olympe.net.rd.WebSocket.la=[olympe.net.WebSocket];olympe.ha.node.net={};olympe.ha.node.net.mu=class extends olympe.net.sa{constructor(a,b){super(a,b);this.Y=new olympe.ha.node.net.Ml(a)}U(){return'NodeJS'}aa(a){var b=this.G++;a=a.C();this.N.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.ha.node.net.nu(b,this.N);b.open(a);return b}C(a,b){this.N.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.G++;b=Qb(this,c,b);this.Y.G(c,{u:a.C(),s:Mb(a),h:Kb(a),p:a.port,z:Lb(a),q:Pb(a),m:a.method,v:a.hj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.F},b)}L(){this.N.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Y}};const Ok=require('fs'),Pk=require('http'),Qk=require('https');
982
- olympe.ha.node.net.Ml=class extends olympe.net.rd.Ml{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,l=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,v=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(w,y,B)=>new Promise((E,S)=>{Ok.readFile(w,(I,Z)=>{I?S(I):(B[y]=Z,E(B))})});p=w=>{const y=E=>{E.setEncoding(v===olympe.net.cb.ResponseType.zk?'utf-8':'binary');let S='';E.on('data',I=>{S+=I});E.on('end',()=>{if(v!==olympe.net.cb.ResponseType.zk){var I=
983
- (new Uint8Array(Buffer.from(S,'binary'))).buffer;I=v===olympe.net.cb.ResponseType.ql?new Blob([I]):I}else I=S;c(this.F(E.statusCode,E.statusMessage,I,E.headers))})},B=d?new Qk.request(w,y):new Pk.request(w,y);this.C.set(a,()=>{B.destroy()});B.on('error',E=>{c(this.F(0,'Conection refused','Error connecting to '+u+' with method '+f+', code = '+E.code+', message = '+E.message,''))});!e||'POST'!==f&&'PUT'!==f?B.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(E=>{B.write(E instanceof
984
- ArrayBuffer?Buffer.from(E):E);B.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(w=>{this.N.log('Error loading self signed files:',w)})):this.N.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.N.debug('Received HTTP response',a,c);return new olympe.net.Tg(c,a,b,d)}};olympe.ha.node.net.nu=class extends olympe.net.rd.WebSocket{Y(a){return new (require('ws'))(a)}};olympe.ha.node.net.Config={ZB:'native.html.net.useWorkers'};olympe.T.config(function(a){qa(a,olympe.net.P.xa,olympe.ha.node.net.mu,olympe.net.P.Ea,olympe.host.P.xa)},'olympe.native.node.net');olympe.ha.node.net.http={};const Rk=require('fastify'),al=require('fastify-cors'),bl={Pi:0,vm:1,vk:2};
985
- function cl(a,b){a.F.route({bodyLimit:1048576*a.ja,url:b.path,method:b.methods,handler:(c,d)=>{a.N.debug('< HTTP:',c);var e=c.body,f='';e instanceof Buffer?(f=new Uint8Array(e.length),e.copy(f)):'string'===typeof e&&(f=e);const [g,h]=c.hostname.split(':');e=new olympe.net.Yj(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,l]of Object.entries(c.headers))e.headers[k]=l;b.tx(e,new Map(Object.entries(c.params))).then(k=>{const l=k.getData();a.N.debug('> HTTP: reply with body:',l instanceof
986
- ArrayBuffer?'binary':l);d.code(k.Rd()).headers(k.hj()).send(l instanceof ArrayBuffer?Buffer.from(l):l)}).catch(k=>{a.N.debug('> HTTP: reply with internal server error:',k);d.code(olympe.net.cb.hd.Lq).header(olympe.net.cb.Headers.Kj,'text/plain').send({error:`Internal server error: ${k}`})})}})}
987
- olympe.ha.node.net.http.Fk=class extends olympe.net.Fk{constructor(a,b,c,d){super(a);this.ja=d;this.F=this.createServer();this.host=b;this.port=c;this.G=new Map;this.U=null;this.C=bl.Pi;this.Ke=new Set}aa(a,b){this.U={origin:'*',methods:a,allowedHeaders:b};return this}L(a,b,c,d){this.G.set(a,{path:b,methods:c,tx:d});switch(this.C){case bl.Pi:return this.start();case bl.vk:return this.stop(),this.start();case bl.vm:return new Promise((e,f)=>{this.Ke.add(g=>g?f(g):e())});default:return Promise.reject('Webservice in unknown state')}}Y(a){this.G.delete(a);
988
- this.stop();return 0===this.G.size?Promise.resolve():this.start()}stop(){this.C===bl.vk&&(this.F.close(),this.C=bl.Pi,this.F=this.createServer())}start(){return this.C===bl.Pi?new Promise((a,b)=>{this.F.register(al,this.U);for(const c of this.G.values())cl(this,c);this.C=bl.vm;this.F.listen(this.port,'0.0.0.0',(c,d)=>{this.C=bl.vk;this.Ke.forEach(e=>e(c));this.Ke.clear();c?(this.stop(),b(c)):(this.N.debug('Web server listening on '+d),a())})}):Promise.reject('Try to start a webservice already started')}createServer(){const a=
989
- Rk({logger:!0});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}};olympe.T.config(function(a){A(a,olympe.net.P.Bm,olympe.ha.node.net.http.Fk,olympe.net.P.Ea,new olympe.T.fa(olympe.net.Config.Jl),new olympe.T.fa(olympe.net.Config.Kl),new olympe.T.fa(olympe.net.Config.kp))},'olympe.native.node.net.http');olympe.ha.node.W={};const dl=new Map;olympe.ha.node.W.tl=class extends olympe.W.tl{U(a){return(new Uint8Array(Buffer.from(a,'base64'))).buffer}C(a){return Buffer.from(a).toString('base64')}G(a,b){a.arrayBuffer().then(olympe.D.Ja().C(b))}L(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;dl.set(b,a);return b}F(a,b,c){dl.has(a)?b(dl.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}Y(a){dl.delete(a)}};olympe.T.config(function(a){qa(a,olympe.W.P.vh,olympe.ha.node.W.tl)},'olympe.native.node.utils');olympe.ha.node.auth={};olympe.ha.node.auth.aq=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.ha.node.auth.aq.la=[olympe.auth.tk];olympe.T.config(a=>{A(a,olympe.auth.P.pk,olympe.ha.node.auth.aq)},'olympe.native.node.auth');olympe.ha.node.ic={};olympe.ha.node.ic.Qp=class{constructor(a){this.F={};this.N=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.ha.node.ic.Rp(a,this.N));return this.F[a].open()}};olympe.ha.node.ic.Qp.la=[olympe.ic.Xt];olympe.ha.node.ic.Rp=class{constructor(a,b){this.name=a;this.N=b;this.C=!1;this.db=null}open(){if(this.C)return this;const a=require('lowdb');this.C=!0;const b=require('lowdb/adapters/Memory');this.db=a(new b);return this}close(){}get(a,b){this.C||this.open();b(this.db.get(a).value(),a)}set(a,b,c){this.C||this.open();this.db.set(a,b).write();c&&c(!0)}forEach(a,b){this.C||this.open();const c=this.db.getState();for(const [d,e]of Object.entries(c))a(e,d);b()}remove(a,b){this.C||this.open();this.db.unset(a).write();
990
- b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.ha.node.ic.Rp.la=[olympe.ic.Yt];olympe.T.config(function(a){A(a,olympe.ic.P.ck,olympe.ha.node.ic.Qp,olympe.ic.P.Ea)},'olympe.native.node.localstorage');olympe.ha.node.storage={};olympe.ha.node.storage.Storage=class{constructor(a){this.N=a}F(a){a&&a('Not Implemented.')}U(a){a&&a('Not Implemented.')}write(a,b,c,d,e){e&&e('Not Implemented.')}G(a){a&&a('Not Implemented.')}L(a){a&&a('Not Implemented.')}C(a){a&&a('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.ha.node.storage.Storage.la=[olympe.ic.Storage];olympe.T.config(function(a){qa(a,olympe.ic.P.Qi,olympe.ha.node.storage.Storage,olympe.host.P.Ea)},'olympe.native.html.storage');olympe.Fg={};olympe.Fg.Config={VERSION:'version.version',Bs:'version.branch',bg:'version.commit',Zu:'version.tag',So:'version.olympe-framework',Cs:'version.build'};olympe.T.config(function(a){D(a,olympe.Fg.Config.VERSION,'');D(a,olympe.Fg.Config.Bs,'');D(a,olympe.Fg.Config.bg,'');D(a,olympe.Fg.Config.Zu,'');D(a,olympe.Fg.Config.So,'');D(a,olympe.Fg.Config.Cs,'')},'olympe.main');const el=require('fs');let va,ua;function fl(a,b){el.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
991
- function gl(){if(void 0!==va&&void 0!==ua){0===Object.keys(ua).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(va).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null),b=process.argv;for(var c=2;c<b.length;c++){var d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);f=g[3];void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===
992
- f.toLowerCase():e.test(f)&&(f=parseFloat(f));a[g[1]]=f}a=new olympe.T.Ms(a);d=a.Xa();d.debug('Registering configurations...');d.C++;for(let f=0,g=ja.length;f<g;f++)b=a,c=ja[f],pa(b.N,'Registering configure callback '+(c.C?'for module '+c.C:'')),b.F.push(c.F);na(d);d.debug('done registering');a=a.compile();c=a.Xa();c.debug('Running run callbacks of container...');for(let f=0,g=ka.length;f<g;f++)c.C++,d=ka[f],b=a,e=ma(b,d.ej()),b.N.debug('Calling run callback '+(d.C?'for module '+d.C:'')),d.F.apply(null,
993
- e),na(c);c.debug('done calling run callbacks. DI process completed!')}}olympe.W.an('oConfig.json',fl,function(a){ua=a;gl()});fl('version.json',function(a){va=a;gl()});olympe.yc={};olympe.yc.ys=class{run(){}};olympe.yc.sa=class{constructor(a,b){this.C=a;this.N=b;this.F=null;this.G='';this.N.info('HC Manager will execute application registered as:',this.C)}wj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.N.log('Application',c,'designated to be launched'):this.N.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.N.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.N.info('Running application:',this.G),
994
- this.F.run()):this.N.error('No app registered under name: '+this.C)}};olympe.yc.wj=function(a,b,c){const d=a.Xa();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.yc.Config.ff+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.Pd(olympe.yc.P.xa).config([b],function(e,f){f.wj(e,c,b)},'olympe.hc.registerApp')};olympe.yc.P={xa:'hc.Manager',Ea:'hc.Logger'};olympe.yc.Config={ff:'hc.app',Gl:'hc.globalToken'};olympe.T.config(function(a){D(a,olympe.yc.Config.ff,'default');D(a,olympe.yc.Config.Gl,!1);C(a,olympe.yc.P.Ea,[olympe.ra.P.xa],b=>b.Rc('hc'));C(a,olympe.auth.P.Dj,[new olympe.T.fa(olympe.yc.Config.ff),new olympe.T.fa(olympe.yc.Config.Gl)],(b,c)=>new olympe.auth.ol(c?'':b));A(a,olympe.yc.P.xa,olympe.yc.sa,new olympe.T.fa(olympe.yc.Config.ff),olympe.yc.P.Ea)},'olympe.hc');
995
- olympe.T.run([olympe.yc.P.xa],a=>a.run(),'olympe.hc');olympe.sc.Yf={};function hl(a){a.N.info('Starting application '+a.C);let b=!1;const c=olympe.dc.Oa();if(0<a.C.length){const d=tc(c,a.C,(e,f)=>{if(e){const g=Ui(f);g.run?(a.N.debug('application retrieved: running'),(new olympe.D.Xb('Application execution context',a.F.xc())).run(()=>{b=!0;g.run(new olympe.sc.Ta(g.R()))})):a.N.error('application retrieved: not an Application with a run() method')}else il(a)});olympe.D.Ja().onDestroy(()=>{uc(c,a.C,d)});Hb(()=>{b||a.N.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
969
+ function Ek(a,b,c,d,e){const f=olympe.ia.node.pa.Ia.Bc.EQUAL,g=olympe.ia.node.pa.Ia.Bc.ag,h=olympe.ia.node.pa.Ia.Bc.Kh,k=olympe.ia.node.pa.Ia.Bc.Yg,l=olympe.ia.node.pa.Ia.Bc.Ro,n=olympe.ia.node.pa.Ia.Bc.ep,p=olympe.ia.node.pa.Ia.Bc.fp,q=olympe.ia.node.pa.Ia.Bc.Dp,r=olympe.ia.node.pa.Ia.Bc.Ep,t=olympe.ia.node.pa.Ia.Bc.Dq,u=olympe.ia.node.pa.Ia.Bc.Uq;if(1<d.length)Gk(b,olympe.ia.node.pa.Ia.qd.ag,Hk(a,d,olympe.ia.node.pa.Ia.qd.ag,c));else{var [v,w,y]=d[0];d=`${c}.${v}`;switch(w){case f:Ik(b,e,d,'=',
970
+ y.v,!1);break;case u:a=Jk('.*',b.client.dialect);Ik(b,e,d,'LIKE',`${a}${y}${a}`,!1);break;case l:const B=y.relations,E=`cte${a.N++}`,S=new olympe.ia.node.pa.Ia.Pq(a.U,a.C,B),I=olympe.ia.node.pa.Ia.cd.Lh;a.C.with(E,Z=>{for(const [Wk,{Lg:Xk,gh:Yk,name:Zk,filters:$k,recursive:al,Yh:bl,kh:cl,bi:dl}]of B.entries())Dk(S,Z,Xk,Yk,Zk,$k,al,0===Wk,cl,dl,bl);return Z});a.C.whereIn(b.client.raw('??.??',[c,I]),function(Z){Z.select(b.client.raw('??.??',[E,I])).from(E)});break;case q:Ik(b,e,d,'<=',y,'string'===
971
+ typeof y);break;case r:Ik(b,e,d,'<',y,'string'===typeof y);break;case n:Ik(b,e,d,'>=',y,'string'===typeof y);break;case p:Ik(b,e,d,'>',y,'string'===typeof y);break;case g:Gk(b,e,Hk(a,y,olympe.ia.node.pa.Ia.qd.ag,c));break;case h:Gk(b,e,Hk(a,y,olympe.ia.node.pa.Ia.qd.Kh,c));break;case k:Gk(b,olympe.ia.node.pa.Ia.qd.Yg,Hk(a,[y],olympe.ia.node.pa.Ia.qd.Yg,c));break;case t:e=Kk(y,b.client.dialect),b.whereRaw('?? LIKE ?',[d,e])}}}
972
+ function Fk(a,b,c,d,e){var f=['tagOlympe'];const g=Lk(f,d),h=Lk(f,c),k=g.map((l,n)=>[l,h[n]]);b.withRecursive(c,g,l=>{l.select(g).from({[d]:e}).qD(n=>n.select(g).from({[d]:e}).join(c,()=>{a.on(Object.fromEntries(k))}))})}function Lk(a,b){return a.map(c=>`${b}.${c}`)}
973
+ function Gk(a,b,c){switch(b){case olympe.ia.node.pa.Ia.qd.NONE:a.where(c);break;case olympe.ia.node.pa.Ia.qd.ag:a.andWhere(c);break;case olympe.ia.node.pa.Ia.qd.Kh:a.orWhere(c);break;case olympe.ia.node.pa.Ia.qd.Yg:a.whereNot(c);break;default:olympe.ra.Xa('storage').error(`Where operand ${b} not recognized`)}}function Hk(a,b,c,d){return e=>{for(let f=0;f<b.length;++f)Ek(a,e,d,[b[f]],0===f?olympe.ia.node.pa.Ia.qd.NONE:c)}}
974
+ function Ik(a,b,c,d,e,f){e=f?a.client.raw(e):e;switch(b){case olympe.ia.node.pa.Ia.qd.NONE:a.where(c,d,e);break;case olympe.ia.node.pa.Ia.qd.ag:a.andWhere(c,d,e);break;case olympe.ia.node.pa.Ia.qd.Kh:a.orWhere(c,d,e);break;case olympe.ia.node.pa.Ia.qd.Yg:a.whereNot(c,d,e);break;default:olympe.ra.Xa('storage').error(`Where operand ${b} not recognized`)}}function Jk(a,b){const c={'.+?':'_','.*':'%','.+':'_%'},d={'.+?':'?','.*':'*','.+':'?*'};return'mssql'===b?d[a]:c[a]}
975
+ function Kk(a,b){let c='',d='',e='';const f=/^([-\u0153\u0152\u00e6\u00c6\u00e5\u00c5\u00f8\u00d8&/\u00df\u00a1\u00bf=\u00e0\u00c0\u00e2\u00c2\u00e4\u00c4\u00e1\u00c1\u00e9\u00c9\u00e8\u00c8\u00ea\u00ca\u00eb\u00cb\u00ec\u00cc\u00ee\u00ce\u00ef\u00cf\u00f2\u00d2\u00f4\u00d4\u00f6\u00d6\u00f9\u00d9\u00fb\u00db\u00fc\u00dc\u00e7\u00c7\u2019\u00f1\u00e3\u00f5\u00c3\u00d5\u00d1]|\w|\s|\d|\\\\)/,g=/^[%_'"]/,h=/^(\\\^|\\\/|\\\$|\\\.|\\\?|\\\*|\\\+|\\\(|\\\)|\\\[|\\\]|\\\{|\\\}])/,k=/^(\.\+\?|\.\*|\.\+)/;
976
+ a=a.source;a.startsWith('^')?a=a.substring(1,a.length):c='%';for(a.endsWith('$')?a=a.substring(0,a.length-1):e='%';''!==a;){{var l=a;var n=b,p=k,q=h,r=f;const v=g.exec(l);if(v)l=[`\\${v[0]}`,v[0].length];else if(p=p.exec(l))l=[Jk(p[0],n),p[0].length];else if(q=q.exec(l))l=q[0],l='mssql'!==n||'['!==l[1]&&']'!==l[1]?[l.substring(1,l.length),l.length]:[l,q[0].length];else if(n=r.exec(l))l=[n[0],n[0].length];else throw Error(`Could find a match for character ${l.charAt(0)}`);}const [t,u]=l;d+=t;a=a.substring(u,
977
+ a.length)}return c+d+e}olympe.ia.node.pa.Ia.Pq=class{constructor(a,b,c){this.U=a;this.C=b;this.G=this.F='';this.N=0;this.Y=c}};olympe.ia.node.pa.Ia.qd={ag:'&',Kh:'|',Yg:'!',NONE:''};const Mk=olympe.ia.node.pa.Ia.cd.kk,Nk=olympe.ia.node.pa.Ia.cd.Bl,Ok=olympe.ia.node.pa.Ia.cd.Lh,Pk=olympe.ia.node.pa.Ia.cd.Tj,Qk=olympe.dc.$b.VERSION,Rk=olympe.dc.$b.Jd;function Lj(a,b,c){return x(function*(){yield Nj(a.N);return b.transaction(d=>x(function*(){for(const e of a.ua)yield e(d.withSchema(c));a.L.debug('Transaction just before commit: ',d.toString());return d}())).finally(()=>{a.ua.length=0;a.G.clear();a.L.debug('Transaction completed')})}())}
978
+ olympe.ia.node.pa.Ia.Rq=class{constructor(a,b){this.L=a;this.N=b;this.C=b.C;this.G=new Map;this.ua=[]}vh(a,b,c=!0){a=c?{[Ok]:a}:{};for(const [d,e]of b)b=sk(e),a[d]=b.v;return a}F(a,b){b.delete(Rk);b.delete(Qk);this.G.set(a,b||new Map)}uc(a,b){this.ua.push(c=>{const d=this;return x(function*(){b.delete(Qk);var e=yield d.C.Tb(a,'');e=yield Mj(d.C,e);yield c.table(e).where(Ok,a).update(d.vh(a,b,!1))}())})}Mc(a){this.ua.push(b=>{const c=this;return x(function*(){var d=yield c.C.Tb(a,'');d=yield Mj(c.C,
979
+ d);var e=olympe.dc.gb.from(d).sb(olympe.dc.CloudObject.G).jd();for(var f of e.keys())e=yield Promise.resolve(f),yield b.table(e).where(Mk,a).del();f=olympe.dc.gb.from(d).sb(olympe.dc.CloudObject.U).jd();for(const g of f.keys())f=yield Promise.resolve(g),yield b.table(f).where(Nk,a).del();yield b.table(d).where(Ok,a).del()}())})}Ra(a,b,c){a===olympe.dc.lc.Xc?(Wj(this.N,c),this.ua.push(d=>{const e=this;return x(function*(){const f=e.G.get(b),g=yield Mj(e.C,c);c!==olympe.dc.wa(olympe.dm.File)||f.has(Pk)?
980
+ (e.C.N.set(b,c),yield d.table(g).insert(e.vh(b,f,!0))):yield d.table(g).where(Ok,b).update(e.vh(b,f,!1))}())})):this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d.table(e).insert({[Mk]:b,[Nk]:c})}()))}fc(a,b,c){this.ua.push(d=>x(function*(){const e=yield Promise.resolve(a);yield d.table(e).where({[Mk]:b,[Nk]:c}).del()}()))}};olympe.ia.node.pa.Ia.Rq.la=[olympe.dc.Writable];function Mj(a,b){return(a=a.C.get(b))?Promise.resolve(a):Promise.reject(`No table were found for model ${a}`)}function uk(a,b,c,d){let e=a.F.get(b);e||(e=new Map,a.F.set(b,e));a=e.get(c);a||(a=e.size+1,e.set(c,a));return`${a};${d}`}function Ck(a,b,c){a=a.F.get(b)||new Map;return(a=Array.from(a).find(([,d])=>d===c))&&a[0]||null}
981
+ olympe.ia.node.pa.Ia.hv=class{constructor(){this.N=new Map;this.F=new Map;this.C=new Map;this.G=new Map}static R(a,b,c){return c?b[0][1]:''}oh(a){return Promise.resolve(a)}fb(a){return Promise.resolve(a)}Tb(a){return(a=this.N.get(a))?Promise.resolve(a):Promise.reject('GET MODEL TAG OF INSTANCE NOT IMPLEMENTED')}};function sk(a){let b=1,c=a;switch(!0){case a instanceof Date:b=2;c=a.toJSON();break;case a instanceof olympe.D.Color:b=3,c=`${a.Rf().valueOf()}.${a.Lf().valueOf()}.${a.Gf().valueOf()}.${a.Ff().valueOf()}`}return{t:b,v:c}}olympe.ia.node.pa.Ia.AC=class{};olympe.ia.node.host={};olympe.ia.node.host.Hd=function(a,b){this.uid=a;this.L=b};olympe.ia.node.host.Hd.prototype.constructor=olympe.ia.node.host.Hd;olympe.ia.node.host.Hd.prototype.destroy=function(){};olympe.ia.node.host.Hd.prototype.destroy=olympe.ia.node.host.Hd.prototype.destroy;olympe.ia.node.host.Hd.prototype.Xa=function(){return this.L};olympe.ia.node.host.Hd.la=[olympe.host.ba.Hd];olympe.ia.node.host.$p=class{constructor(a){this.L=a}qj(){return!1}cl(){this.L.error('No history manager implemented in Node')}C(){this.cl();return Gb()}F(){this.cl()}};olympe.ia.node.host.$p.la=[olympe.host.Gi];olympe.ia.node.host.gd=class{constructor(){this.C={};this.N={}}destroy(){}U(a){clearTimeout(this.C[a]);delete this.C[a]}aa(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}Y(a,b,c){this.N[b]=setInterval(c,a)}F(a){clearInterval(this.N[a]);delete this.N[a]}};olympe.host.Zp.register(olympe.host.ba.Yp.sr,olympe.ia.node.host.gd);olympe.ia.node.host.gd.la=[olympe.host.ba.gd];olympe.ia.node.host.zk=class{constructor(a){this.L=a}};olympe.ia.node.host.zk.la=[olympe.host.zk];olympe.T.config(function(a){qa(a,olympe.host.P.Jl,olympe.ia.node.host.$p,olympe.host.P.Ea);qa(a,olympe.host.P.Xq,olympe.ia.node.host.zk,olympe.host.P.Ea)},'olympe.native.node.host');olympe.net.rd={};olympe.net.rd.Nl=class{constructor(a){this.L=a;this.C=new Map}G(){}F(){}};olympe.net.rd.WebSocket=class{constructor(a,b){this.L=b;this.id=a;this.C=null;this.buffer=[];this.F=this.G=this.N=null}Z(){return this.id}open(a){const b=`#${this.id}`,c=this.Y(a);c.binaryType='arraybuffer';c.onopen=()=>{this.L.info('Websocket OPENED');this.N?(this.L.debug('Notifying upper layer for WebSocket',b),this.N()):this.L.warn('Nothing to notify for WebSocket',b);this.L.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));this.buffer.length=
982
+ 0};c.onmessage=d=>{d='string'===typeof d.data?String(d.data):Da(d.data);this.L.debug(b,'<',d);this.F&&this.F(d)};c.onclose=()=>{this.L.debug(`WebSocket ${b} CLOSED`);this.G&&this.G()};c.onerror=()=>{this.L.debug(`WebSocket ${b} ERROR`)};this.C=c}send(a){const b=`#${this.id}`;if(null!==this.C){const c=this.C.constructor;switch(this.C.readyState){case c.OPEN:this.L.debug(b,'>',a);this.C.send(a);break;case c.CONNECTING:this.L.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.L.debug(b,
983
+ '- Closed','>',a),!1}}else this.L.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.C){const a=this.C.constructor,b=this.C.readyState;if(b===a.OPEN||b===a.CONNECTING){this.L.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.L.debug('Try to force close native websocket, but not open nor connecting')}ha(a){this.N=a||null}aa(a){this.F=a||null}U(a){this.G=a||null}Y(){}};olympe.net.rd.WebSocket.la=[olympe.net.WebSocket];olympe.ia.node.net={};olympe.ia.node.net.pu=class extends olympe.net.sa{constructor(a,b){super(a,b);this.Y=new olympe.ia.node.net.Nl(a)}U(){return'NodeJS'}aa(a){var b=this.G++;a=a.C();this.L.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.ia.node.net.qu(b,this.L);b.open(a);return b}C(a,b){this.L.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.G++;b=Qb(this,c,b);this.Y.G(c,{u:a.C(),s:Mb(a),h:Kb(a),p:a.port,z:Lb(a),q:Pb(a),m:a.method,v:a.jj(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,b:a.body,r:a.F},b)}N(){this.L.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Y}};const Sk=require('fs'),Tk=require('http'),Uk=require('https');
984
+ olympe.ia.node.net.Nl=class extends olympe.net.rd.Nl{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,l=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,v=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(w,y,B)=>new Promise((E,S)=>{Sk.readFile(w,(I,Z)=>{I?S(I):(B[y]=Z,E(B))})});p=w=>{const y=E=>{E.setEncoding(v===olympe.net.cb.ResponseType.Ak?'utf-8':'binary');let S='';E.on('data',I=>{S+=I});E.on('end',()=>{if(v!==olympe.net.cb.ResponseType.Ak){var I=
985
+ (new Uint8Array(Buffer.from(S,'binary'))).buffer;I=v===olympe.net.cb.ResponseType.rl?new Blob([I]):I}else I=S;c(this.F(E.statusCode,E.statusMessage,I,E.headers))})},B=d?new Uk.request(w,y):new Tk.request(w,y);this.C.set(a,()=>{B.destroy()});B.on('error',E=>{c(this.F(0,'Conection refused','Error connecting to '+u+' with method '+f+', code = '+E.code+', message = '+E.message,''))});!e||'POST'!==f&&'PUT'!==f?B.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(E=>{B.write(E instanceof
986
+ ArrayBuffer?Buffer.from(E):E);B.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(w=>{this.L.log('Error loading self signed files:',w)})):this.L.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.L.debug('Received HTTP response',a,c);return new olympe.net.Ug(c,a,b,d)}};olympe.ia.node.net.qu=class extends olympe.net.rd.WebSocket{Y(a){return new (require('ws'))(a)}};olympe.ia.node.net.Config={$B:'native.html.net.useWorkers'};olympe.T.config(function(a){qa(a,olympe.net.P.xa,olympe.ia.node.net.pu,olympe.net.P.Ea,olympe.host.P.xa)},'olympe.native.node.net');olympe.ia.node.net.http={};const Vk=require('fastify'),el=require('fastify-cors'),fl={Ri:0,vm:1,wk:2};
987
+ function gl(a,b){a.F.route({bodyLimit:1048576*a.ha,url:b.path,method:b.methods,handler:(c,d)=>{a.L.debug('< HTTP:',c);var e=c.body,f='';e instanceof Buffer?(f=new Uint8Array(e.length),e.copy(f)):'string'===typeof e&&(f=e);const [g,h]=c.hostname.split(':');e=new olympe.net.$j(g,parseInt(h,10),c.url,'https'===c.protocol,c.method,f);for(const [k,l]of Object.entries(c.headers))e.headers[k]=l;b.wx(e,new Map(Object.entries(c.params))).then(k=>{const l=k.getData();a.L.debug('> HTTP: reply with body:',l instanceof
988
+ ArrayBuffer?'binary':l);d.code(k.Rd()).headers(k.jj()).send(l instanceof ArrayBuffer?Buffer.from(l):l)}).catch(k=>{a.L.debug('> HTTP: reply with internal server error:',k);d.code(olympe.net.cb.hd.Mq).header(olympe.net.cb.Headers.Mj,'text/plain').send({error:`Internal server error: ${k}`})})}})}
989
+ olympe.ia.node.net.http.Gk=class extends olympe.net.Gk{constructor(a,b,c,d){super(a);this.ha=d;this.F=this.createServer();this.host=b;this.port=c;this.G=new Map;this.U=null;this.C=fl.Ri;this.Le=new Set}aa(a,b){this.U={origin:'*',methods:a,allowedHeaders:b};return this}N(a,b,c,d){this.G.set(a,{path:b,methods:c,wx:d});switch(this.C){case fl.Ri:return this.start();case fl.wk:return this.stop(),this.start();case fl.vm:return new Promise((e,f)=>{this.Le.add(g=>g?f(g):e())});default:return Promise.reject('Webservice in unknown state')}}Y(a){this.G.delete(a);
990
+ this.stop();return 0===this.G.size?Promise.resolve():this.start()}stop(){this.C===fl.wk&&(this.F.close(),this.C=fl.Ri,this.F=this.createServer())}start(){return this.C===fl.Ri?new Promise((a,b)=>{this.F.register(el,this.U);for(const c of this.G.values())gl(this,c);this.C=fl.vm;this.F.listen(this.port,'0.0.0.0',(c,d)=>{this.C=fl.wk;this.Le.forEach(e=>e(c));this.Le.clear();c?(this.stop(),b(c)):(this.L.debug('Web server listening on '+d),a())})}):Promise.reject('Try to start a webservice already started')}createServer(){const a=
991
+ Vk({logger:!0});a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}};olympe.T.config(function(a){A(a,olympe.net.P.Bm,olympe.ia.node.net.http.Gk,olympe.net.P.Ea,new olympe.T.fa(olympe.net.Config.Kl),new olympe.T.fa(olympe.net.Config.Ll),new olympe.T.fa(olympe.net.Config.kp))},'olympe.native.node.net.http');olympe.ia.node.W={};const hl=new Map;olympe.ia.node.W.ul=class extends olympe.W.ul{U(a){return(new Uint8Array(Buffer.from(a,'base64'))).buffer}C(a){return Buffer.from(a).toString('base64')}G(a,b){a.arrayBuffer().then(olympe.D.Ja().C(b))}N(a){var b=()=>Math.random().toString(16).slice(-4);b=`blob://${`${b()}${b()}-${b()}-${b()}-${b()}-${b()}${b()}${b()}`}`;hl.set(b,a);return b}F(a,b,c){hl.has(a)?b(hl.get(a)):c&&c('No object has been found for that url. Maybe the URL has already been revoked')}Y(a){hl.delete(a)}};olympe.T.config(function(a){qa(a,olympe.W.P.wh,olympe.ia.node.W.ul)},'olympe.native.node.utils');olympe.ia.node.auth={};olympe.ia.node.auth.aq=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.ia.node.auth.aq.la=[olympe.auth.uk];olympe.T.config(a=>{A(a,olympe.auth.P.qk,olympe.ia.node.auth.aq)},'olympe.native.node.auth');olympe.ia.node.jc={};olympe.ia.node.jc.Qp=class{constructor(a){this.F={};this.L=a}C(a){void 0===this.F[a]&&(this.F[a]=new olympe.ia.node.jc.Rp(a,this.L));return this.F[a].open()}};olympe.ia.node.jc.Qp.la=[olympe.jc.$t];olympe.ia.node.jc.Rp=class{constructor(a,b){this.name=a;this.L=b;this.C=!1;this.db=null}open(){if(this.C)return this;const a=require('lowdb');this.C=!0;const b=require('lowdb/adapters/Memory');this.db=a(new b);return this}close(){}get(a,b){this.C||this.open();b(this.db.get(a).value(),a)}set(a,b,c){this.C||this.open();this.db.set(a,b).write();c&&c(!0)}forEach(a,b){this.C||this.open();const c=this.db.getState();for(const [d,e]of Object.entries(c))a(e,d);b()}remove(a,b){this.C||this.open();this.db.unset(a).write();
992
+ b&&b(!0)}clear(){this.C||this.open();this.db.setState({})}};olympe.ia.node.jc.Rp.la=[olympe.jc.au];olympe.T.config(function(a){A(a,olympe.jc.P.ek,olympe.ia.node.jc.Qp,olympe.jc.P.Ea)},'olympe.native.node.localstorage');olympe.ia.node.storage={};olympe.ia.node.storage.Storage=class{constructor(a){this.L=a}F(a){a&&a('Not Implemented.')}U(a){a&&a('Not Implemented.')}write(a,b,c,d,e){e&&e('Not Implemented.')}G(a){a&&a('Not Implemented.')}N(a){a&&a('Not Implemented.')}C(a){a&&a('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.ia.node.storage.Storage.la=[olympe.jc.Storage];olympe.T.config(function(a){qa(a,olympe.jc.P.Si,olympe.ia.node.storage.Storage,olympe.host.P.Ea)},'olympe.native.html.storage');olympe.Gg={};olympe.Gg.Config={VERSION:'version.version',Cs:'version.branch',cg:'version.commit',bv:'version.tag',So:'version.olympe-framework',Ds:'version.build'};olympe.T.config(function(a){D(a,olympe.Gg.Config.VERSION,'');D(a,olympe.Gg.Config.Cs,'');D(a,olympe.Gg.Config.cg,'');D(a,olympe.Gg.Config.bv,'');D(a,olympe.Gg.Config.So,'');D(a,olympe.Gg.Config.Ds,'')},'olympe.main');const il=require('fs');let va,ua;function jl(a,b){il.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
993
+ function kl(){if(void 0!==va&&void 0!==ua){0===Object.keys(ua).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(va).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null),b=process.argv;for(var c=2;c<b.length;c++){var d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);f=g[3];void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===
994
+ f.toLowerCase():e.test(f)&&(f=parseFloat(f));a[g[1]]=f}a=new olympe.T.Os(a);d=a.Xa();d.debug('Registering configurations...');d.C++;for(let f=0,g=ja.length;f<g;f++)b=a,c=ja[f],pa(b.L,'Registering configure callback '+(c.C?'for module '+c.C:'')),b.F.push(c.F);na(d);d.debug('done registering');a=a.compile();c=a.Xa();c.debug('Running run callbacks of container...');for(let f=0,g=ka.length;f<g;f++)c.C++,d=ka[f],b=a,e=ma(b,d.gj()),b.L.debug('Calling run callback '+(d.C?'for module '+d.C:'')),d.F.apply(null,
995
+ e),na(c);c.debug('done calling run callbacks. DI process completed!')}}olympe.W.an('oConfig.json',jl,function(a){ua=a;kl()});jl('version.json',function(a){va=a;kl()});olympe.yc={};olympe.yc.zs=class{run(){}};olympe.yc.sa=class{constructor(a,b){this.C=a;this.L=b;this.F=null;this.G='';this.L.info('HC Manager will execute application registered as:',this.C)}yj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.L.log('Application',c,'designated to be launched'):this.L.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.L.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.L.info('Running application:',this.G),
996
+ this.F.run()):this.L.error('No app registered under name: '+this.C)}};olympe.yc.yj=function(a,b,c){const d=a.Xa();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.yc.Config.gf+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.Pd(olympe.yc.P.xa).config([b],function(e,f){f.yj(e,c,b)},'olympe.hc.registerApp')};olympe.yc.P={xa:'hc.Manager',Ea:'hc.Logger'};olympe.yc.Config={gf:'hc.app',Hl:'hc.globalToken'};olympe.T.config(function(a){D(a,olympe.yc.Config.gf,'default');D(a,olympe.yc.Config.Hl,!1);C(a,olympe.yc.P.Ea,[olympe.ra.P.xa],b=>b.Rc('hc'));C(a,olympe.auth.P.Fj,[new olympe.T.fa(olympe.yc.Config.gf),new olympe.T.fa(olympe.yc.Config.Hl)],(b,c)=>new olympe.auth.pl(c?'':b));A(a,olympe.yc.P.xa,olympe.yc.sa,new olympe.T.fa(olympe.yc.Config.gf),olympe.yc.P.Ea)},'olympe.hc');
997
+ olympe.T.run([olympe.yc.P.xa],a=>a.run(),'olympe.hc');olympe.sc.Zf={};function ll(a){a.L.info('Starting application '+a.C);let b=!1;const c=olympe.dc.Oa();if(0<a.C.length){const d=xc(c,a.C,(e,f)=>{if(e){const g=Yi(f);g.run?(a.L.debug('application retrieved: running'),(new olympe.D.Xb('Application execution context',a.F.xc())).run(()=>{b=!0;g.run(new olympe.sc.Ta(g.R()))})):a.L.error('application retrieved: not an Application with a run() method')}else ml(a)});olympe.D.Ja().onDestroy(()=>{yc(c,a.C,d)});Hb(()=>{b||a.L.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
996
998
  1E4)}}
997
- function jl(a,b){if(a.L)a.N.debug('Sending getContext request'),Qf(a.U,d=>{d?a.N.error('failed to synchronise (authenticated) with server: '+d.message):(a.N.debug('synchronisation request successful'),$i=a.C,b())});else{var c=olympe.dc.Ed.SUBSCRIBE;const d=olympe.dc.Ed.Li,e=a.F.Zk()?d:c;a.N.debug((a.F.Zk()?'PULLING':'SUBSCRIBING')+' application '+a.C);const f=olympe.D.Ja();c=new olympe.async.wk(f);c.add((g,h)=>{Ve(new olympe.dc.kf(a.C,e),olympe.dc.Ub.tf).hb(k=>{var l=olympe.dc.Ga;var n=(n=olympe.dc.od.from(a.C).sb(olympe.sc.Ma.Me.C).sb(olympe.sc.logic.Xd.G.Gc()).jd())&&n.R()||
998
- olympe.dc.Ga.Pc;l.jc=n;k?h(k.message):g()})});c.add(g=>{olympe.D.Ec([a.G.Dg()],h=>{(new olympe.dc.Ca(h)).Ke(f.C(g))})});c.add((g,h)=>{const k=olympe.sc.md.C.Hp,l=olympe.sc.md.C.am;aj(a.C,n=>{switch(n){case k:case l:g();break;default:h('Error while loading the business container')}})});Vb(c,(g,h)=>{if(h)throw Error(h);b()});c.start()}}function il(a){a.N.debug('Stop the application');a.F.xc().aa()}
999
- olympe.sc.Yf.tm=class{constructor(a,b,c,d,e,f,g){this.G=a;this.U=b;this.N=c;this.F=d;this.C=e;this.L=f;this.Y=g||!1}run(){const a=olympe.auth.sa.C.Ng,b=olympe.auth.sa.C.gg,c=olympe.auth.sa.C.Ah,d=olympe.auth.sa.C.ni;this.N.debug('runtime starting for app #'+this.C);let e=!1;const f=()=>{e||(hl(this),e=!0)};olympe.D.Ec([this.G.getState()],g=>{switch(g){case a:case c:this.N.debug('Server session opened, calling once connected callback');jl(this,f);break;case b:this.N.debug('Disconnected, working offline.');
1000
- this.Y&&!e&&jl(this,f);break;case d:this.N.debug('waiting for authentication');break;default:this.N.debug('No server session available, waiting for connection'),e=!1,il(this)}},'Runtime initial auth state listener')}};olympe.sc.Yf.tm.C='app_instance';olympe.sc.Yf.tm.la=[olympe.yc.ys];olympe.sc.Yf.Gj={tf:'sc.runtime.Main'};
1001
- olympe.T.config(function(a){C(a,olympe.auth.P.Dj,[new olympe.T.fa(olympe.yc.Config.ff),new olympe.T.fa(olympe.sc.Config.ff),new olympe.T.fa(olympe.yc.Config.Gl)],(b,c,d)=>new olympe.auth.ol(d?'':b+(c?'-'+c:'')));A(a,olympe.sc.Yf.Gj.tf,olympe.sc.Yf.tm,olympe.auth.P.xa,olympe.dc.query.P.xa,olympe.sc.P.Ea,olympe.sc.P.sm,new olympe.T.fa(olympe.sc.Config.ff),new olympe.T.fa(olympe.dc.Config.$g),new olympe.T.fa(olympe.sc.Config.bq));olympe.yc.wj(a,olympe.sc.Yf.Gj.tf,'sc.runtime');olympe.yc.wj(a,olympe.sc.Yf.Gj.tf,
1002
- 'sc.headless');olympe.yc.wj(a,olympe.sc.Yf.Gj.tf)},'olympe.sc.runtime');olympe.public={};function kl(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{ec(olympe.public.Ua.get(),c,b,()=>{d()})})}
1003
- olympe.public.Ua=class{static jw(a,b){return olympe.auth.Jb.Ee.cj(a,b)}static getState(){return jc(olympe.public.Ua.get())}static sw(){return olympe.D.bb(olympe.public.Ua.get().Dg())}static ey(a){const b=new olympe.D.Xb('Observe user tag','function'===typeof a.xc?a.xc():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.Ec([olympe.public.Ua.get().Dg()],d=>{c.next(d);olympe.D.Ja().onDestroy(()=>c.complete())}));return()=>b.destroy()})}static bd(){return olympe.D.bb(mc(olympe.public.Ua.get()))}static Hw(){return olympe.D.bb(olympe.public.Ua.get().bi())||
1004
- void 0}static hi(){olympe.public.Ua.get().hi()}static oh(a){return new Promise((b,c)=>{olympe.public.Ua.get().oh(a,d=>d?c(d):b())})}static Fx(a,b){return kl((new Map).set('username',a).set('password',b),'srp')}static Ex(){return kl(new Map,'saml')}static Gx(a,b){return kl((new Map).set('username',a).set('nonce',b),'localToken')}static Dx(){return kl(new Map,'openID')}static un(){return new Promise(a=>{lc(()=>{olympe.public.Ua.get().oa.delete('logoutCallback');a()});olympe.public.Ua.get().un()})}static get(){return olympe.auth.Tc()}};
1005
- olympe.public.Ua.logout=olympe.public.Ua.un;olympe.public.Ua.loginOpenID=olympe.public.Ua.Dx;olympe.public.Ua.loginToken=olympe.public.Ua.Gx;olympe.public.Ua.loginSAML=olympe.public.Ua.Ex;olympe.public.Ua.loginSRP=olympe.public.Ua.Fx;olympe.public.Ua.getUserFromToken=olympe.public.Ua.oh;olympe.public.Ua.sendKeepAlive=olympe.public.Ua.hi;olympe.public.Ua.getIDPToken=olympe.public.Ua.Hw;olympe.public.Ua.getToken=olympe.public.Ua.bd;olympe.public.Ua.observeUser=olympe.public.Ua.ey;
1006
- olympe.public.Ua.getCurrentUser=olympe.public.Ua.sw;olympe.public.Ua.getState=olympe.public.Ua.getState;olympe.public.Ua.generateSRPData=olympe.public.Ua.jw;olympe.public.$a=class{static create(a){return new class extends olympe.dc.V.Og{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.Uc(olympe.D.qa),e=b.subscribe(f=>d.update(olympe.D.Cc(f)));olympe.D.Ja().zc(()=>e.unsubscribe());return d.Fb()}}}};
1007
- olympe.public.Ne=class{static create(a){return new class extends olympe.dc.Cb.Og{L(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.Uc(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.za(f)));olympe.D.Ja().zc(()=>e.unsubscribe());return d.Fb()}}}};'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.ta.Relation,Direction:olympe.dc.Aa,generateTag:olympe.W.dj,tagToString:olympe.dc.wa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.ih,defineInverseRelation:olympe.dc.Rv,BrickContext:olympe.sc.Ta,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.Ta.ig,registerBrick:olympe.sc.logic.ya.C,FunctionBrick:olympe.sc.logic.Function,
1008
- Context:olympe.sc.Ta,Entry:olympe.dc.ta.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.dm.File,User:olympe.dm.User,Enum:olympe.dm.hg,EnumValue:olympe.dm.Enum,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Qe,WorkflowTransition:olympe.sc.workflow.Transition,WorkflowObjectState:olympe.sc.workflow.ObjectState,
1009
- Transaction:olympe.sc.Transaction,BurstTransaction:olympe.dc.ri,QueryResult:olympe.dc.Va,Query:olympe.dc.gb,QuerySingle:olympe.dc.od,Predicate:olympe.dc.ba.$a,RelatedTo:olympe.dc.ba.V.De,Order:olympe.dc.ba.lk,Config:class{static getParameter(a){return olympe.T.getParameter(a)}},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequest:olympe.H.Ba.nb.ga,Service:olympe.H.Ba.nb.zb,Auth:olympe.public.Ua,AuthState:{INIT:olympe.auth.sa.C.INIT,DISCONNECTED:olympe.auth.sa.C.gg,GUEST:olympe.auth.sa.C.Ah,
1010
- AUTHENTICATING:olympe.auth.sa.C.ni,ERROR:olympe.auth.sa.C.uc,AUTHENTICATED:olympe.auth.sa.C.Ng},Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.ib{static get(){return olympe.dc.Oa()}},ListDef:olympe.dc.Ca,instanceToTag:olympe.dc.wa,
1011
- registerSync:olympe.dc.ya.C,getUniqueTag:olympe.W.dj,onDestroy:a=>olympe.D.Ja().onDestroy(a),offDestroy:a=>olympe.D.Ja().Je(a),FollowRules:olympe.dc.Ub,transformers:{Related:olympe.dc.X.Sb,RecursiveRelated:olympe.dc.X.Fc,Distinct:olympe.dc.X.we,Filter:olympe.dc.X.vc,Limit:olympe.dc.X.Zd,Sort:olympe.dc.X.Kd,Union:olympe.dc.X.wf},ListDefPredicate:olympe.public.$a,predicates:{And:olympe.dc.V.Ud,Or:olympe.dc.V.ae,Not:olympe.dc.V.nd,Equals:olympe.dc.V.Ic,Contains:olympe.dc.V.Wc,Greater:olympe.dc.V.ye,
1012
- Smaller:olympe.dc.V.Fe,HasRelated:olympe.dc.V.lf,InstanceOf:olympe.dc.V.mf,Regex:olympe.dc.V.wd},Comparator:olympe.public.Ne,comparators:{Number:olympe.dc.Cb.Number,String:olympe.dc.Cb.String,DateTime:olympe.dc.Cb.DateTime},valuedefs:{BooleanProperty:olympe.dc.na.te,StringProperty:olympe.dc.na.oe,NumberProperty:olympe.dc.na.ke,DateTimeProperty:olympe.dc.na.je,Constant:olympe.dc.na.Dd,Tag:olympe.dc.na.uf}});
999
+ function nl(a,b){if(a.N)a.L.debug('Sending getContext request'),Uf(a.U,d=>{d?a.L.error('failed to synchronise (authenticated) with server: '+d.message):(a.L.debug('synchronisation request successful'),dj=a.C,b())});else{var c=olympe.dc.Ed.SUBSCRIBE;const d=olympe.dc.Ed.Ni,e=a.F.$k()?d:c;a.L.debug((a.F.$k()?'PULLING':'SUBSCRIBING')+' application '+a.C);const f=olympe.D.Ja();c=new olympe.async.xk(f);c.add((g,h)=>{Ze(new olympe.dc.lf(a.C,e),olympe.dc.Ub.uf).hb(k=>{var l=olympe.dc.Ga;var n=(n=olympe.dc.od.from(a.C).sb(olympe.sc.Ma.Ne.C).sb(olympe.sc.logic.Xd.G.Gc()).jd())&&n.R()||
1000
+ olympe.dc.Ga.Pc;l.kc=n;k?h(k.message):g()})});c.add(g=>{olympe.D.Ec([a.G.Eg()],h=>{(new olympe.dc.Ca(h)).Le(f.C(g))})});c.add((g,h)=>{const k=olympe.sc.md.C.Hp,l=olympe.sc.md.C.bm;ej(a.C,n=>{switch(n){case k:case l:g();break;default:h('Error while loading the business container')}})});Zb(c,(g,h)=>{if(h)throw Error(h);b()});c.start()}}function ml(a){a.L.debug('Stop the application');a.F.xc().aa()}
1001
+ olympe.sc.Zf.tm=class{constructor(a,b,c,d,e,f,g){this.G=a;this.U=b;this.L=c;this.F=d;this.C=e;this.N=f;this.Y=g||!1}run(){const a=olympe.auth.sa.C.Og,b=olympe.auth.sa.C.hg,c=olympe.auth.sa.C.Bh,d=olympe.auth.sa.C.pi;this.L.debug('runtime starting for app #'+this.C);let e=!1;const f=()=>{e||(ll(this),e=!0)};olympe.D.Ec([this.G.getState()],g=>{switch(g){case a:case c:this.L.debug('Server session opened, calling once connected callback');nl(this,f);break;case b:this.L.debug('Disconnected, working offline.');
1002
+ this.Y&&!e&&nl(this,f);break;case d:this.L.debug('waiting for authentication');break;default:this.L.debug('No server session available, waiting for connection'),e=!1,ml(this)}},'Runtime initial auth state listener')}};olympe.sc.Zf.tm.C='app_instance';olympe.sc.Zf.tm.la=[olympe.yc.zs];olympe.sc.Zf.Ij={uf:'sc.runtime.Main'};
1003
+ olympe.T.config(function(a){C(a,olympe.auth.P.Fj,[new olympe.T.fa(olympe.yc.Config.gf),new olympe.T.fa(olympe.sc.Config.gf),new olympe.T.fa(olympe.yc.Config.Hl)],(b,c,d)=>new olympe.auth.pl(d?'':b+(c?'-'+c:'')));A(a,olympe.sc.Zf.Ij.uf,olympe.sc.Zf.tm,olympe.auth.P.xa,olympe.dc.query.P.xa,olympe.sc.P.Ea,olympe.sc.P.sm,new olympe.T.fa(olympe.sc.Config.gf),new olympe.T.fa(olympe.dc.Config.ah),new olympe.T.fa(olympe.sc.Config.bq));olympe.yc.yj(a,olympe.sc.Zf.Ij.uf,'sc.runtime');olympe.yc.yj(a,olympe.sc.Zf.Ij.uf,
1004
+ 'sc.headless');olympe.yc.yj(a,olympe.sc.Zf.Ij.uf)},'olympe.sc.runtime');olympe.public={};function ol(a,b){const c=new olympe.auth.Request;for(const [d,e]of a)c.set(d,e);return new Promise(d=>{ic(olympe.public.Ua.get(),c,b,()=>{d()})})}
1005
+ olympe.public.Ua=class{static mw(a,b){return olympe.auth.Jb.Fe.ej(a,b)}static getState(){return nc(olympe.public.Ua.get())}static vw(){return olympe.D.bb(olympe.public.Ua.get().Eg())}static iy(a){const b=new olympe.D.Xb('Observe user tag','function'===typeof a.xc?a.xc():a);return new rxjs.Observable(c=>{b.run(()=>olympe.D.Ec([olympe.public.Ua.get().Eg()],d=>{c.next(d);olympe.D.Ja().onDestroy(()=>c.complete())}));return()=>b.destroy()})}static bd(){return olympe.D.bb(qc(olympe.public.Ua.get()))}static Kw(){return olympe.D.bb(olympe.public.Ua.get().di())||
1006
+ void 0}static ji(){olympe.public.Ua.get().ji()}static ph(a){return new Promise((b,c)=>{olympe.public.Ua.get().ph(a,d=>d?c(d):b())})}static Ix(a,b){return ol((new Map).set('username',a).set('password',b),'srp')}static Hx(){return ol(new Map,'saml')}static Jx(a,b){return ol((new Map).set('username',a).set('nonce',b),'localToken')}static Gx(){return ol(new Map,'openID')}static un(){return new Promise(a=>{pc(()=>{olympe.public.Ua.get().oa.delete('logoutCallback');a()});olympe.public.Ua.get().un()})}static get(){return olympe.auth.Tc()}};
1007
+ olympe.public.Ua.logout=olympe.public.Ua.un;olympe.public.Ua.loginOpenID=olympe.public.Ua.Gx;olympe.public.Ua.loginToken=olympe.public.Ua.Jx;olympe.public.Ua.loginSAML=olympe.public.Ua.Hx;olympe.public.Ua.loginSRP=olympe.public.Ua.Ix;olympe.public.Ua.getUserFromToken=olympe.public.Ua.ph;olympe.public.Ua.sendKeepAlive=olympe.public.Ua.ji;olympe.public.Ua.getIDPToken=olympe.public.Ua.Kw;olympe.public.Ua.getToken=olympe.public.Ua.bd;olympe.public.Ua.observeUser=olympe.public.Ua.iy;
1008
+ olympe.public.Ua.getCurrentUser=olympe.public.Ua.vw;olympe.public.Ua.getState=olympe.public.Ua.getState;olympe.public.Ua.generateSRPData=olympe.public.Ua.mw;olympe.public.$a=class{static create(a){return new class extends olympe.dc.V.Pg{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.Uc(olympe.D.qa),e=b.subscribe(f=>d.update(olympe.D.Cc(f)));olympe.D.Ja().zc(()=>e.unsubscribe());return d.Fb()}}}};
1009
+ olympe.public.Oe=class{static create(a){return new class extends olympe.dc.Cb.Pg{N(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.Uc(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.za(f)));olympe.D.Ja().zc(()=>e.unsubscribe());return d.Fb()}}}};'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.ta.Relation,Direction:olympe.dc.Aa,generateTag:olympe.W.fj,tagToString:olympe.dc.wa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.jh,defineInverseRelation:olympe.dc.Uv,BrickContext:olympe.sc.Ta,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.Ta.jg,registerBrick:olympe.sc.logic.ya.C,FunctionBrick:olympe.sc.logic.Function,
1010
+ Context:olympe.sc.Ta,Entry:olympe.dc.ta.Entry,PropertyModel:olympe.dm.Property,RelationModel:olympe.dm.Relation,StringModel:olympe.dm.String,NumberModel:olympe.dm.Number,BooleanModel:olympe.dm.Boolean,DatetimeModel:olympe.dm.DateTime,ColorModel:olympe.dm.Color,File:olympe.dm.File,User:olympe.dm.User,Enum:olympe.dm.ig,EnumValue:olympe.dm.Enum,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Re,WorkflowTransition:olympe.sc.workflow.Transition,WorkflowObjectState:olympe.sc.workflow.ObjectState,
1011
+ Transaction:olympe.sc.Transaction,BurstTransaction:olympe.dc.ti,QueryResult:olympe.dc.Va,Query:olympe.dc.gb,QuerySingle:olympe.dc.od,Predicate:olympe.dc.ba.$a,RelatedTo:olympe.dc.ba.V.Ee,Order:olympe.dc.ba.mk,Config:class{static getParameter(a){return olympe.T.getParameter(a)}},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequest:olympe.H.Ba.nb.ga,Service:olympe.H.Ba.nb.zb,Auth:olympe.public.Ua,AuthState:{INIT:olympe.auth.sa.C.INIT,DISCONNECTED:olympe.auth.sa.C.hg,GUEST:olympe.auth.sa.C.Bh,
1012
+ AUTHENTICATING:olympe.auth.sa.C.pi,ERROR:olympe.auth.sa.C.cc,AUTHENTICATED:olympe.auth.sa.C.Og},Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.ib{static get(){return olympe.dc.Oa()}},ListDef:olympe.dc.Ca,instanceToTag:olympe.dc.wa,
1013
+ registerSync:olympe.dc.ya.C,getUniqueTag:olympe.W.fj,onDestroy:a=>olympe.D.Ja().onDestroy(a),offDestroy:a=>olympe.D.Ja().Ke(a),FollowRules:olympe.dc.Ub,transformers:{Related:olympe.dc.X.Sb,RecursiveRelated:olympe.dc.X.Fc,Distinct:olympe.dc.X.xe,Filter:olympe.dc.X.vc,Limit:olympe.dc.X.Zd,Sort:olympe.dc.X.Kd,Union:olympe.dc.X.xf},ListDefPredicate:olympe.public.$a,predicates:{And:olympe.dc.V.Ud,Or:olympe.dc.V.ae,Not:olympe.dc.V.nd,Equals:olympe.dc.V.Ic,Contains:olympe.dc.V.Wc,Greater:olympe.dc.V.ze,
1014
+ Smaller:olympe.dc.V.Ge,HasRelated:olympe.dc.V.mf,InstanceOf:olympe.dc.V.nf,Regex:olympe.dc.V.wd},Comparator:olympe.public.Oe,comparators:{Number:olympe.dc.Cb.Number,String:olympe.dc.Cb.String,DateTime:olympe.dc.Cb.DateTime},valuedefs:{BooleanProperty:olympe.dc.na.ue,StringProperty:olympe.dc.na.pe,NumberProperty:olympe.dc.na.le,DateTimeProperty:olympe.dc.na.je,Constant:olympe.dc.na.Dd,Tag:olympe.dc.na.vf}});
1013
1015
 
1014
1016
 
1015
1017
  }.bind(this))();