@olympeio/runtime-node 9.10.5 → 9.10.7
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
|
@@ -241,24 +241,24 @@ v('Promise.prototype.finally',function(a){return a?a:function(b){return this.the
|
|
|
241
241
|
v('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ua(this);return va(c,b-d.length)+d}});v('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=ua(this);return d+va(c,b-d.length)}});v('Promise.allSettled',function(a){function b(d){return{status:'fulfilled',value:d}}function c(d){return{status:'rejected',reason:d}}return a?a:function(d){var e=this;d=Array.from(d,function(f){return e.resolve(f).then(b,c)});return e.all(d)}});
|
|
242
242
|
v('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}});v('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}});
|
|
243
243
|
v('Array.prototype.flat',function(a){return a?a:function(b){b=void 0===b?1:b;for(var c=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<b?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}return c}});var wa=this||self;function B(a,b){a=a.split('.');let c=wa;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={$d:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.$d())throw Error('The olympe runtime is loaded more than once. Make sure not to import `@olympeio/runtime-web` or `@olympeio/runtime-node` explicitly, and to always use the `olympe` alias.');olympe.$d().olympe=olympe;olympe.rE=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const ya=require('util');function za(a){if('string'===typeof a)return a;let b=a;'function'===typeof(null==a?void 0:a.toJSON)&&(b=a.toJSON());let c,d;return'function'===typeof(null==(c=b)?void 0:c.toString)&&(null==(d=b)?void 0:d.toString)!==Object.prototype.toString?b.toString():ya.inspect(b,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Aa(a,b){return JSON.stringify({level:a,message:b.map(za).join(' ')})}
|
|
244
|
-
const Ba=console.trace,Ca=console.debug,Da=console.log,Ea=console.info,Fa=console.warn,Ga=console.error;console.trace=(...a)=>Ba.call(console,Aa('TRACE',a));console.debug=(...a)=>Ca.call(console,Aa('DEBUG',a));console.log=(...a)=>Da.call(console,Aa('LOG',a));console.info=(...a)=>Ea.call(console,Aa('INFO',a));console.warn=(...a)=>Fa.call(console,Aa('WARN',a));console.error=(...a)=>Ga.call(console,Aa('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.W={};olympe.W.Kf={};olympe.W.Kf.
|
|
245
|
-
olympe.W.
|
|
244
|
+
const Ba=console.trace,Ca=console.debug,Da=console.log,Ea=console.info,Fa=console.warn,Ga=console.error;console.trace=(...a)=>Ba.call(console,Aa('TRACE',a));console.debug=(...a)=>Ca.call(console,Aa('DEBUG',a));console.log=(...a)=>Da.call(console,Aa('LOG',a));console.info=(...a)=>Ea.call(console,Aa('INFO',a));console.warn=(...a)=>Fa.call(console,Aa('WARN',a));console.error=(...a)=>Ga.call(console,Aa('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.W={};olympe.W.Kf={};olympe.W.Kf.po=class{process(a){for(const b of Object.keys(a.xe))if(a.rd(b).qn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Kf.po.xa=[olympe.W.Kf.Bq];olympe.W.Kf.qo=class{process(a){function b(e,f){if(f.includes(e))throw Error('Circular dependency detected: '+f.join(' > ')+' > '+e);if(d.has(e)){f=f.concat(e);d.delete(e);e=a.rd(e);c(e.oj(),f);for(const g of Ha(e))c(g.oj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.ub&&b(g.T(),f)}const d=new Set(Object.keys(a.xe));for(const e of d)b(e,[])}};olympe.W.Kf.qo.xa=[olympe.W.Kf.Bq];olympe.W.Kf.Bq=class{process(){}};const Ia=[],Ja=[];function Ka(a){const b=a.ab();b.debug('Registering configurations...');b.j++;Ia.forEach(c=>{C(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});La(b);b.debug('done registering')}function Ma(a){const b=a.ab();b.debug('Running run callbacks of container...');b.j++;Ja.forEach(c=>{const d=Na(a,c.oj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});La(b);b.debug('done calling run callbacks. DI process completed!')}
|
|
245
|
+
olympe.W.wo=class{constructor(){}static j(a,b){Ia.push(new olympe.W.zl(a,b))}static D(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');});Ja.push(new olympe.W.zl(b,c,a))}};olympe.W.config=olympe.W.wo.j;olympe.W.run=olympe.W.wo.D;olympe.W.ms=a=>{const b=new Map,c=(d,e)=>{for(const [f,g]of Object.entries(d))d=e.concat((f.startsWith('#')?f.substring(1):f).toLowerCase()),'object'!==typeof g||null===g||f.startsWith('#')?b.set(d.join('.'),g):c(g,d)};c(a,[]);return b};olympe.W.Ij=class{constructor(){}getValue(){}};function Oa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.W.zl=class{constructor(a,b,c){this.D=a;this.H=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.ub(d):d);this.j=null!=b?b:'no name di callback';this.F=null}oj(){return this.H}};function Qa(a,b){var c=olympe.W.P.xg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Ra(a,b,c){let d=a.j[b];if(void 0===d){const e=a.H[b];if(void 0===e){if(c===olympe.W.qh.j.im)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.G.error('Error during instantiation of service '+b),f;}!e.H&&(a.j[b]=d)}return d}
|
|
246
246
|
function Sa(a,b,c){b=b.toLowerCase();let d;const e=null!=(d=a.D.get(b))?d:[];e.push(c);a.D.set(b,e)}function Na(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.G.j++,f=b[e],d[e]=f instanceof olympe.W.Ij?f.getValue(a):f,La(a.G);return d}
|
|
247
247
|
olympe.W.qh=class{constructor(a,b,c,d,e=2){this.H=a;this.F=b;this.parameters=c;this.j=Object.create(null);this.G=new olympe.W.Up(e);this.D=new Map;Qa(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Ra(this,f).subscribe(this.Ej.bind(this,f)))}ab(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Ej(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
|
|
248
|
-
(d=null==(c=this.D.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.D.get(a))?e:[])f(b)}}};olympe.W.qh.j={Jt:'exception',
|
|
248
|
+
(d=null==(c=this.D.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.D.get(a))?e:[])f(b)}}};olympe.W.qh.j={Jt:'exception',im:'null'};function Ta(a,b){b=olympe.W.ms(b);for(const [c,d]of b)Ua(a,c,d)}function D(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){C(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function E(a,b,c,d,e=!1){C(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){C(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){C(a.G,'Defining abstract service '+b);a.j(b).F=!0}function Ua(a,b,c){a.parameters[b.toLowerCase()]=c}
|
|
249
249
|
function Ya(a,b,c,d){a.F.push(b);Ua(a,b,d(...c.map(e=>a.getParameter(e))));E(a,b,c.map(e=>new olympe.W.th(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function F(a,b,c){a.D[b.toLowerCase()]=c}
|
|
250
|
-
olympe.W.zt=class{constructor(a,b){this.xe=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ta(this,a);Ta(this,b);this.R=[new olympe.W.Kf.
|
|
250
|
+
olympe.W.zt=class{constructor(a,b){this.xe=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ta(this,a);Ta(this,b);this.R=[new olympe.W.Kf.po,new olympe.W.Kf.qo];this.H=[];a=this.getParameter(olympe.W.U.Pu);this.N=void 0!==a?a:3;this.G=new olympe.W.Up(this.N)}ab(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.W.ub?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.xe[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
|
|
251
251
|
var g=this.xe[f];g.id=g.id+'!!'+ ++olympe.W.Jl.j;g.H=!0;g=g.id;c[h]=g;this.xe[g]=this.xe[f]}}this.xe[f]=new olympe.W.Jl(b,c,d||!1,f);return this.xe[f]}rd(a){const b=this.xe[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.D[a]}compile(){const a=this.H;this.G.debug('Calling '+a.length+' configure callbacks');this.G.j++;a.forEach(b=>{C(this.G,'Calling callback');this.G.j++;b(this);La(this.G)});
|
|
252
252
|
La(this.G);this.G.debug('Configuration summary: '+Object.keys(this.xe).length+' definitions');this.G.debug('Compiling...');this.G.j++;this.R.forEach((b,c)=>{this.G.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});La(this.G);this.G.debug('Compilation done, returning container');return new olympe.W.qh(this.xe,this.D,this.parameters,this.F,this.N)}};function Ha(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
|
|
253
253
|
olympe.W.Jl=class{constructor(a,b,c,d){this.N=a||null;this.R=!!c;this.D=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.ub(e):e);this.F=!1;this.j=null;this.id=null!=d?d:'';this.H=!1}T(){return this.id}instantiate(a){const b=a.ab();b.debug('Resolving arguments for '+this.id);const c=this.N;let d=Na(a,this.D);const e=()=>{if(this.R)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.ah().run(()=>e()):e();let g;if(0<(null==
|
|
254
|
-
(g=this.j)?void 0:g.size)){b.j++;C(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,C(b,'Check if need to call additional configuration callback '+h.j),Oa(h,f)?(C(b,'Calling additional configuration callback '+h.j),d=Na(a,h.oj()),d.push(f),h.D.apply(null,d)):C(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),La(b);La(b)}C(b,'Done instantiating '+this.id);return f}oj(){return this.D}
|
|
254
|
+
(g=this.j)?void 0:g.size)){b.j++;C(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,C(b,'Check if need to call additional configuration callback '+h.j),Oa(h,f)?(C(b,'Calling additional configuration callback '+h.j),d=Na(a,h.oj()),d.push(f),h.D.apply(null,d)):C(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),La(b);La(b)}C(b,'Done instantiating '+this.id);return f}oj(){return this.D}qn(){return this.F}config(a,b,c,d,e){null===this.j&&
|
|
255
255
|
(this.j=new Map);var f=this.j,g=f.set;b=new olympe.W.zl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.W.Jl.j=0;olympe.W.th=class extends olympe.W.Ij{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Sa(a,this.id,c=>b.next(c))})}};function La(a){0<a.j&&a.j--}function C(a,b){1>=a.D&&Za(a,'log','DI: '+b)}function Za(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.W.Up=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&Za(this,'log','DI: '+a)}info(a){3>=this.D&&Za(this,'info','DI: '+a)}warn(a){4>=this.D&&Za(this,'warn','DI: '+a)}error(a){5>=this.D&&Za(this,'error','DI: '+a)}};olympe.W.pa=class extends olympe.W.Ij{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.ub=class extends olympe.W.Ij{constructor(a,b){super();this.id=a;this.j=b||olympe.W.qh.j.Jt}T(){return this.id}getValue(a){return Ra(a,this.id,this.j)}};olympe.W.P={xg:'di.Container',aC:'di.PublicContainer'};olympe.W.U={Pu:'logging.di'};olympe.W.run([olympe.W.P.xg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.Ej=(b,c)=>a.Ej(b,c);olympe.$d().getConfig=b=>a.getParameter(b);olympe.$d().getConfigNames=()=>Object.keys(a.parameters);olympe.$d().updateConfig=(b,c)=>a.Ej(b,c)});olympe.V={};olympe.V.Ip=class{constructor(a){this.id=a||olympe.V.Ip.j++}Ea(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}print(){return('000000'+this.id).substr(-6)}};olympe.V.Ip.j=0;olympe.V.FB=class{constructor(a,b,c,d,e,f){this.j=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.j[3*a+b]=c}get(a,b){return this.j[3*a+b]}};olympe.V.Ch=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.V.Ch.D=function(a){return new olympe.V.Ch(.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.V.Ch.j=function(){return new olympe.V.Ch(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.V.Ch.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.V.Ch.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function bb(a,b){return a.j($a(b))}function cb(a){return(new TextDecoder('utf8')).decode(a)}function db(a){const b=new olympe.V.stream.Df;for(let c=0;c<a.length;c+=65536){const d=c+65536;b.write(a.subarray(c,d>a.length?a.length:d))}b.complete();return b}
|
|
256
256
|
olympe.V.sl=class{D(){}j(){}H(a){return w(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return $a(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.V.stream.Df){const b=[];for(const c=fa(a);;){const d=yield c.next();if(d.done)break;b.push(...d.value)}return new Uint8Array(b)}throw Error('Unsupported value type for binary conversion.');})}F(){}};
|
|
257
257
|
olympe.V.Qr=a=>a.replace('+','-').replace('/','_');olympe.V.Ow=a=>a.replace('-','+').replace('_','/');function eb(a){a.j=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.D&&a.D(d));if(0<a.values.size)eb(a);else{let d;null==(d=a.F)||d.call(a)}},a.H)}function fb(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function gb(a,b){a.D=b;return a}
|
|
258
|
-
olympe.V.
|
|
259
|
-
olympe.V.Nh=class{constructor(a){this.j=gb(new olympe.V.
|
|
260
|
-
olympe.V.yv=class{constructor(){this.F=[];this.R=[];this.Y=[];this.N=new Map;this.H=new Map;this.j=!1;this.D=null}start(){this.j||(this.D||(this.D=performance.now()),this.j=!0,this.R.forEach(a=>a()))}stop(){this.j&&(this.Y.forEach(a=>a()),this.j=!1)}};function nb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.V.operators={RE(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.V.Promise={};olympe.V.Promise.jj=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>w(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.V.Promise.
|
|
261
|
-
olympe.V.promise.
|
|
258
|
+
olympe.V.Hm=class{constructor(a,b=a/2){this.timeout=a;this.H=b;this.values=new Map;this.F=this.D=this.j=null}add(a){this.values.set(a,Date.now());null===this.j&&eb(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.j&&clearTimeout(this.j);this.j=null;let b;null==(b=this.F)||b.call(this)}return a}clear(){this.j&&clearTimeout(this.j);this.j=null;this.values.clear();return this}};function hb(a,b){a.D=b;return a}function ib(a,b){a.j.F=b}
|
|
259
|
+
olympe.V.Nh=class{constructor(a){this.j=gb(new olympe.V.Hm(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.D)||d.call(this,b,c)});this.values=new Map;this.D=null}set(a,b){this.values.set(a,b);this.j.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.j.delete(a)}clear(){this.j.clear();this.values.clear();return this}};function jb(a,b){a.R.push(b)}function kb(a,b){a.Y.push(b)}function lb(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>lb(a,d)):c='N/A';return c}function mb(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.D};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=lb(a,g);a.F.push(b)}
|
|
260
|
+
olympe.V.yv=class{constructor(){this.F=[];this.R=[];this.Y=[];this.N=new Map;this.H=new Map;this.j=!1;this.D=null}start(){this.j||(this.D||(this.D=performance.now()),this.j=!0,this.R.forEach(a=>a()))}stop(){this.j&&(this.Y.forEach(a=>a()),this.j=!1)}};function nb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.V.operators={RE(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.V.Promise={};olympe.V.Promise.jj=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>w(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.V.Promise.Jn=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};olympe.V.promise={};function ob(a){if(0===a.size())a.D.next(!1);else if(a.F()){a.j++;var b=pb(a);b&&b.D.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.j(c)}).finally(()=>{a.j--;0===a.size()&&a.D.next(!1);ob(a)})}}function qb(a,b){return new Promise((c,d)=>{a.Fa.push(new olympe.V.promise.bw(c,d,b));ob(a)})}function pb(a){a.D.next(!0);let b;return null!=(b=a.Fa.shift())?b:null}
|
|
261
|
+
olympe.V.promise.Cm=class{constructor(){this.Fa=[];this.D=new rxjs.BehaviorSubject(!1);this.j=0}F(){return 0===this.j}clear(){for(;0<this.Fa.length;)this.Fa.shift().j(Error('Canceled by a clearStack'));ob(this)}size(){return this.Fa.length}};olympe.V.promise.bw=class{constructor(a,b,c){this.resolve=a;this.j=b;this.D=c}};olympe.V.promise.rr=class extends olympe.V.promise.Cm{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.vj=a}F(){return this.j<this.vj}};olympe.V.promise.uD=class{constructor(a,...b){this.F=a;this.parameters=b;this.j=this.D=null;this.promise=new Promise((c,d)=>{this.D=c;this.j=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
|
|
262
262
|
function onFullfilledCallback(data) {
|
|
263
263
|
self.postMessage({ type: "done", data, });
|
|
264
264
|
self.close();
|
|
@@ -290,16 +290,16 @@ olympe.V.nz=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^
|
|
|
290
290
|
r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,aE:g||null,Ts:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,uE:f||null,parameters:b}};olympe.V.ME=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
|
|
291
291
|
olympe.V.PE=function(a){a=Array.from(a.entries()).filter(([,b])=>null!==b&&void 0!==b).map(([b,c])=>`${encodeURIComponent(b)}=${encodeURIComponent(c)}`).join('&');return 0<a.length?`#${a}`:''};olympe.V.BE=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
|
|
292
292
|
olympe.V.Cs=a=>{var b=Ab,c=Bb;return w(function*(){return(yield Promise.all(a.map(b))).map((d,e)=>{if('string'!==typeof d)return Object.create(null);try{return JSON.parse(d)}catch(f){if(a[e].endsWith('.json'))throw Error(`Failed to parse JSON Config file: ${a[e]}: ${f}`);const g=null!=c?c:'';return d.split('\n').filter(h=>h.startsWith(g)).reduce((h,k)=>{const [l,n]=k.split('=');h[l.slice(g.length)]=olympe.V.Rr(n);return h},{})}}).reduce((d,e,f)=>{olympe.V.Es(d,e,'version.json'===a[f]?'version.':'');
|
|
293
|
-
return d},Object.create(null))})};olympe.V.Rr=a=>{const b=/^true|false$/i,c=/^\d+(\.\d+)?$/;void 0===a?a=!0:a.startsWith('"')&&a.endsWith('"')?a=a.substring(1,a.length-1):b.test(a)?a='true'===a.toLowerCase():c.test(a)&&(a=parseFloat(a));return a};olympe.V.Es=(a,b,c)=>{if(b instanceof Object)for(const d of Object.keys(b)){const e=c+d,f=b[d];f instanceof Object&&void 0!==a[e]?olympe.V.Es(a[e],f,''):a[e]=f}};olympe.V.$D=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}
|
|
293
|
+
return d},Object.create(null))})};olympe.V.Rr=a=>{const b=/^true|false$/i,c=/^\d+(\.\d+)?$/;void 0===a?a=!0:a.startsWith('"')&&a.endsWith('"')?a=a.substring(1,a.length-1):b.test(a)?a='true'===a.toLowerCase():c.test(a)&&(a=parseFloat(a));return a};olympe.V.Es=(a,b,c)=>{if(b instanceof Object)for(const d of Object.keys(b)){const e=c+d,f=b[d];f instanceof Object&&void 0!==a[e]?olympe.V.Es(a[e],f,''):a[e]=f}};olympe.V.$D=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}jn(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.V.Su=class{constructor(a,b){this.start=a;this.end=b}};olympe.V.Su.j={tB:'left',jC:'right',Zz:'bottom',sD:'top'};function Cb(a){return`${a.j}.${a.D}.${a.F}`}
|
|
294
294
|
olympe.V.If=class{constructor(a,b,c,d){this.j=a;this.D=b;this.F=c;this.H=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.V.If.j;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.V.If.j:new olympe.V.If(b,c,d,a[4])}Vk(a){return this.j!==a.j?this.j>a.j:this.D!==a.D?this.D>a.D:this.F>a.F}Cj(a){return this.j!==a.j?this.j<a.j:this.D!==a.D?this.D<a.D:this.F<
|
|
295
295
|
a.F}Ea(a){return this.j===a.j&&this.D===a.D&&this.F===a.F}toString(){return`${this.j}.${this.D}.${this.F}`+(null!==this.H?`-${this.H}`:'')}};olympe.V.If.j=new olympe.V.If(Number.NaN,Number.NaN,Number.NaN);olympe.V.P={vg:'utils.binaryConverter',et:'utils.base64Converter',eg:'utils.Profiler'};olympe.W.config(a=>{Xa(a,olympe.V.P.vg);Wa(a,olympe.V.P.et,olympe.V.P.vg,!0);D(a,olympe.V.P.eg,olympe.V.yv)},'Utils services');olympe.W.run([olympe.V.P.vg,olympe.V.P.eg],(a,b)=>{olympe.V.ef=()=>a;olympe.$d().isProfilerEnabled=()=>b.j;olympe.$d().startProfiler=()=>b.start();olympe.$d().stopProfiler=()=>b.stop();olympe.$d().getProfilerEvents=()=>({events:b.F,names:Object.fromEntries(b.N.entries()),models:Object.fromEntries(b.H.entries())})});olympe.ja={};olympe.ja.yb=class{la(){}H(){}F(){}j(){}ha(){}N(){}ua(){}$(){}da(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ja.yb.prototype.fatal=olympe.ja.yb.prototype.fatal;olympe.ja.yb.prototype.error=olympe.ja.yb.prototype.error;olympe.ja.yb.prototype.warn=olympe.ja.yb.prototype.warn;olympe.ja.yb.prototype.info=olympe.ja.yb.prototype.info;olympe.ja.yb.prototype.log=olympe.ja.yb.prototype.log;olympe.ja.yb.prototype.debug=olympe.ja.yb.prototype.debug;olympe.ja.yb.prototype.trace=olympe.ja.yb.prototype.trace;
|
|
296
296
|
olympe.ja.yb.j={hw:0,Xf:1,Ou:2,ak:3,Gr:4,Ab:5,Mt:6,IB:7};olympe.ja.yb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ja.Ta=class{cd(){}};olympe.ja.re={};function Db(a,b,c){a.Ga[b](`[OLYMPE.${a.Y}]:`,...c);if(0<a.R.size){var d=new Date;d=('00'+d.getHours()).substring(-2)+':'+('00'+d.getMinutes()).substring(-2)+':'+('00'+d.getSeconds()).substring(-2)+'.'+('00'+d.getMilliseconds()).substring(-3);for(const e of a.R.values())e(d,a.Y,b,...c)}}
|
|
297
297
|
olympe.ja.re.yb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ja.yb.j.ak:b;c&&b.subscribe(d=>{this.D=d});this.Y=a.toUpperCase();this.R=new Map;this.Ga=console}la(){return this.name}H(){return this.D}F(){return this.D<=olympe.ja.yb.j.hw}j(){return this.D<=olympe.ja.yb.j.Xf}N(){return this.D<=olympe.ja.yb.j.Ou}ha(){return this.D<=olympe.ja.yb.j.ak}ua(){return this.D<=olympe.ja.yb.j.Gr}$(){return this.D<=olympe.ja.yb.j.Ab}da(){return this.D<=olympe.ja.yb.j.Mt}trace(...a){this.F()&&
|
|
298
298
|
Db(this,'trace',a)}debug(...a){this.j()&&Db(this,'debug',a)}log(...a){this.N()&&Db(this,'log',a)}info(...a){this.ha()&&Db(this,'info',a)}warn(...a){this.ua()&&Db(this,'warn',a)}error(...a){this.$()&&Db(this,'error',a)}fatal(...a){this.da()&&Db(this,'error',a)}};olympe.ja.re.yb.xa=[olympe.ja.yb];olympe.ja.re.Ta=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.cd('logging');this.G.log('Logging initialized, global log level is '+olympe.ja.yb.D[b])}cd(a){var b=this.channels.get(a);if(!b){b=`${olympe.ja.U.nt}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Sa(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ja.U.Uv}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=!0===this.j.getParameter(b));
|
|
299
299
|
b=new olympe.ja.re.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ja.re.Ta.xa=[olympe.ja.Ta];olympe.ja.P={Da:'logging.Manager'};olympe.ja.U={ip:'logging',jp:'logging.showLogLevel',nt:'logging',Uv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ja.U.ip,olympe.ja.yb.j.ak);F(a,olympe.ja.U.jp,!0);Va(a,olympe.ja.P.Da,olympe.ja.re.Ta,olympe.W.P.xg,new olympe.W.pa(olympe.ja.U.ip),new olympe.W.pa(olympe.ja.U.jp))},'olympe.logging');olympe.W.run([olympe.ja.P.Da],a=>{olympe.ja.ab=b=>a.cd(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.U={$p:'df.nodeCreationThreshold'};const Eb=[];function Fb(){}function Gb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Fb:b;this.D=void 0===c?Eb:c;this.Y=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.$:new a(Gb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Eb}N(){return null===this.j&&null===this.D}R(){return this.j===Gb}};olympe.C.J.Y=new olympe.C.J;olympe.C.J.j=new olympe.C.J(null,null);olympe.C.J.$=new olympe.C.J(Gb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.aa);
|
|
300
|
-
olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>olympe.C.ea);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.uh=class{T(){return''}
|
|
301
|
-
olympe.C.Xb=class{constructor(a='SimpleContext',b){++Hb;this.ha=new Map;this.da=new Map;this.$=new Map;this.$a=0;this.name=a;this.id=String(Hb);this.F=this.ua=!1;(this.N=void 0===b?olympe.C.Xa():b)&&this.N.je(this);this.debug=!1}T(){return this.id}
|
|
302
|
-
this.da.clear();this.$.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ua=!0;this.F=!1;this.lg()}}gb(){return this.ua}gd(){return this.F}je(a){if(!this.ua){var b;olympe.C.hb(a)?b=a.Ba:olympe.C.
|
|
300
|
+
olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>olympe.C.ea);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.uh=class{T(){return''}gn(){return''}destroy(){}gb(){return!1}gd(){return!1}run(a,...b){return a(...b)}rc(a){return a}getParent(){return null}Ps(){}je(){}detach(){}Mk(){}lg(){}onDestroy(){return''}Tf(){}Td(){return''}Gs(){}};olympe.C.uh.prototype.offDestroy=olympe.C.uh.prototype.Tf;olympe.C.uh.prototype.onDestroy=olympe.C.uh.prototype.onDestroy;let Hb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.$p)],()=>{});
|
|
301
|
+
olympe.C.Xb=class{constructor(a='SimpleContext',b){++Hb;this.ha=new Map;this.da=new Map;this.$=new Map;this.$a=0;this.name=a;this.id=String(Hb);this.F=this.ua=!1;(this.N=void 0===b?olympe.C.Xa():b)&&this.N.je(this);this.debug=!1}T(){return this.id}gn(){return this.name}run(a,...b){if(!this.ua){var c=olympe.C.Os(this);a=a(...b);c&&olympe.C.Os(c);return a}}rc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ua&&!this.F){this.F=!0;this.lg();for(const a of this.da.keys())this.da.has(a)&&this.da.get(a)();
|
|
302
|
+
this.da.clear();this.$.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ua=!0;this.F=!1;this.lg()}}gb(){return this.ua}gd(){return this.F}je(a){if(!this.ua){var b;olympe.C.hb(a)?b=a.Ba:olympe.C.tn(a)&&(b=a);b&&this.ha.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.hb(a)?c=a.Ba:olympe.C.tn(a)&&(c=a);c&&this.ha.has(c.T())&&(b&&c.Mk(this),this.ha.delete(c.T()))}Mk(){this.N=null;this.destroy()}lg(){const a=this.ha;for(const b of a.keys())a.has(b)&&a.get(b).Mk(this);this.ha.clear();for(const b of this.$.keys())this.$.has(b)&&
|
|
303
303
|
this.$.get(b)();this.$.clear()}onDestroy(a,b){void 0===b&&(++this.$a,b=String(this.$a));this.da.set(b,a);return b}Tf(a){this.da.delete(a)}Td(a){if(void 0===b){++this.$a;var b=String(this.$a)}this.$.set(b,a);return b}Gs(a){this.$.delete(a)}Ps(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.je(this)}getParent(){return this.N}};olympe.C.Zq=class extends olympe.C.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Tf(){}};olympe.C.uh.xa=[olympe.C.uh];let Ib=0;
|
|
304
304
|
function Jb(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Hc()){case olympe.C.Node.j.Dh:break;case olympe.C.Node.j.Ph:break;case olympe.C.Node.j.ek:case olympe.C.Node.j.Zf:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.vh:Kb(a,olympe.C.Node.j.vh);break;case olympe.C.Node.j.OBSOLETE:a.zb=!0;a.j!==olympe.C.Node.j.vh&&Kb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.Vd:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
|
|
305
305
|
default:olympe.C.G.warn('Unknown state, investigate: ',b.Hc())}Lb(b,a)}
|
|
@@ -312,24 +312,24 @@ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&(
|
|
|
312
312
|
function Xb(a,b){if(a.j!==olympe.C.Node.j.Zf&&a.j!==olympe.C.Node.j.Vd&&(a.j!==olympe.C.Node.j.Dh||a.Jc)){var c=void 0!==a.defaultValue;a.Jc&&b!==a.D&&a.lg();if(c)L(a,a.defaultValue,!0);else if(a.Fb=void 0,Kb(a,olympe.C.Node.j.Dh),b=a.H)for(const d of b.values())Xb(d,a)}}function Pb(a){if(a.j!==olympe.C.Node.j.vh){Kb(a,olympe.C.Node.j.vh);var b=a.H;if(b)for(const c of b.values())Pb(c);a.lg();void 0!==a.D&&Rb(a);a.Fb=a.defaultValue}}function Nb(a){return a.j===olympe.C.Node.j.Ph}
|
|
313
313
|
function Ob(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Rb(a),Lb(b,a),Nb(b)?L(a,b.Fb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):Xb(a),a.D=b)}function Yb(a,b){a.Jc&&(a.Jc=void 0);a.ad='Repeater';Ob(a,b)}function Ub(a){a.D?Tb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Nb(b)).length&&(a.zb&&(a.zb=!1,Mb(a)),Tb(a))}
|
|
314
314
|
function Lb(a,b){a.H||(a.H=new Map);a.H.set(b.T(),b);a.j===olympe.C.Node.j.Vd&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Sb(a,b){a.H&&(b=b.T(),a.H.has(b)&&(a.H.delete(b),Zb(a)))}function Zb(a){if(null===a.getParent()){var b=a.H;b&&0<b.size||a.destroy()}}
|
|
315
|
-
olympe.C.Node=class extends olympe.C.Xb{constructor({valueType:a,Jc:b,sz:c=!0,Uf:d,
|
|
315
|
+
olympe.C.Node=class extends olympe.C.Xb{constructor({valueType:a,Jc:b,sz:c=!0,Uf:d,pn:e,debug:f=!1,kg:g=null,ad:h='Node',fj:k}={}){++Ib;super(String(Ib));this.debug=!!f;this.ad=h;h&&'string'===typeof h||(b?this.ad=b.name?b.name:'anon()':this.ad='Node');this.Y=e&&0<e.length?e:null;this.kg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.Ga=!1;this.j=olympe.C.Node.j.Dh;this.zb=!1;this.H=this.R=null;this.Jc=b;this.Uf=d||null;this.defaultValue=this.jb=this.D=void 0;this.fj=k;d&&d instanceof olympe.C.Node&&
|
|
316
316
|
Jb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Jb(this,a);c&&Mb(this)}nh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Dh&&L(this,a,!0);return this}hj(a){this.valueType=a}Nb(){return this.valueType||Object}asObservable(a=olympe.C.Xa()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ad}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Hc(){return this.j}gb(){return this.j===olympe.C.Node.j.Vd}gd(){return this.j===
|
|
317
317
|
olympe.C.Node.j.Zf}Mb(...a){if(this.fj instanceof Function)return this.fj(...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.Hc();a!==olympe.C.Node.j.Zf&&a!==olympe.C.Node.j.Vd||olympe.C.G.warn('Calling a function on a destroyed node!!!',this);a=d.F();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.C.hb(g)&&b.push(g.Ba);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Xg&&(e[g]=f.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
|
|
318
|
-
Jc:c,Uf:this,
|
|
319
|
-
b.D&&b.D.T()===this.T()?b.D=void 0:b.destroy()}a.clear()}this.H=null;super.destroy();if(this.R){for(const c of this.R.values())this.R.has(c.T())&&Sb(c,this);this.R.clear()}this.R=null;this.D&&(Sb(this.D,this),this.D=void 0);this.Fb=void 0;this.Y&&(this.Y.length=0,this.Y=null);this.kg&&(this.kg.length=0,this.kg=null);this.fj=this.Jc=void 0;this.defaultValue=this.Uf=null;this.ad=`** Destroyed ** ${this.ad}`;Kb(this,olympe.C.Node.j.Vd)}}
|
|
320
|
-
this.Jc.name?this.Jc.name:'()':this.Jc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.ad?' '+this.ad:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Dh:0,Ph:1,vh:3,ek:4,OBSOLETE:5,Zf:6,Vd:7};function Qb(a,b){if('function'!==typeof a)return new olympe.C.Proxy(a,b);var c=olympe.C.Proxy.prototype;void 0===a.prototype&&olympe.C.G.error('investigate');c=Object.create($b(c,a.prototype));c.Sh=a;c.Lr=b;return c}function $b(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.
|
|
318
|
+
Jc:c,Uf:this,pn:e,debug:!1,kg:b,ad:'Proxy.'+c+'()'}))}Mk(a){if(null===this.getParent())olympe.C.G.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.C.G.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.Ps(null);Zb(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.Zf&&a!==olympe.C.Node.j.Vd){Kb(this,olympe.C.Node.j.Zf);if(a=this.H){for(const c of a.values())if(a.has(c.T())){var b=c;b.R&&b.R.delete(this.T());
|
|
319
|
+
b.D&&b.D.T()===this.T()?b.D=void 0:b.destroy()}a.clear()}this.H=null;super.destroy();if(this.R){for(const c of this.R.values())this.R.has(c.T())&&Sb(c,this);this.R.clear()}this.R=null;this.D&&(Sb(this.D,this),this.D=void 0);this.Fb=void 0;this.Y&&(this.Y.length=0,this.Y=null);this.kg&&(this.kg.length=0,this.kg=null);this.fj=this.Jc=void 0;this.defaultValue=this.Uf=null;this.ad=`** Destroyed ** ${this.ad}`;Kb(this,olympe.C.Node.j.Vd)}}gn(){return this.ad}print(){const a=this.Jc?this.Jc instanceof Function?
|
|
320
|
+
this.Jc.name?this.Jc.name:'()':this.Jc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.ad?' '+this.ad:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Dh:0,Ph:1,vh:3,ek:4,OBSOLETE:5,Zf:6,Vd:7};function Qb(a,b){if('function'!==typeof a)return new olympe.C.Proxy(a,b);var c=olympe.C.Proxy.prototype;void 0===a.prototype&&olympe.C.G.error('investigate');c=Object.create($b(c,a.prototype));c.Sh=a;c.Lr=b;return c}function $b(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.tm)||Object.defineProperty(b,olympe.C.Proxy.tm,{enumerable:!1,configurable:!1,writable:!1,value:ac(a,b)});return b[olympe.C.Proxy.tm]}
|
|
321
321
|
function bc(a,b){if(a.Sh!==b){a.Sh=b;b.prototype||olympe.C.G.error('Cast not possible, provided type is not a valid type!');var c=$b(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ba&&a.Ba.hj(b)}}
|
|
322
322
|
function ac(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create($b(a,b.__proto__));else return olympe.C.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].K;null===e||e&&e.N()?c[d]=function(...f){var g=this.Ba;if(g&&Nb(g)&&(g=g.Fb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.C.J.Y,c[d]=function(...f){f=this.Lr.call(this.Ba,
|
|
323
323
|
...f,e,d);const g=e.Y;if(g){const h=this.Ba.Fb;h&&h[g]&&bc(f,h[g])}return e.R()?this:f})}});return c}function cc(a,b){L(a.Ba,b)}function dc(a){Xb(a.Ba)}function ec(a,b){Yb(a.Ba,olympe.C.Rf(b)?b:b.Ba)}function fc(a,b){olympe.C.hb(b)||olympe.C.Rf(b)?ec(a,b):cc(a,b)}
|
|
324
|
-
olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.Sh=a;this.Lr=b}static hb(a){return!(!a||!a.Xg)}Ea(a){return olympe.C.ta([this,a],(b,c)=>b===c,Boolean)}Fd(a){return olympe.C.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.ea.D:olympe.C.ea.j:b.valueOf()===c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea)}asObservable(a){return this.Ba.asObservable(a)}Kr(){return this.Ba}};olympe.C.Proxy.
|
|
325
|
-
olympe.C.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.ra(b.value)}
|
|
326
|
-
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.
|
|
324
|
+
olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.Sh=a;this.Lr=b}static hb(a){return!(!a||!a.Xg)}Ea(a){return olympe.C.ta([this,a],(b,c)=>b===c,Boolean)}Fd(a){return olympe.C.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.ea.D:olympe.C.ea.j:b.valueOf()===c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea)}asObservable(a){return this.Ba.asObservable(a)}Kr(){return this.Ba}};olympe.C.Proxy.tm='__opp__';olympe.C.Proxy.prototype.Xg=!0;function gc(a,b){a.node.nh(b);return a}olympe.C.Yj=class{constructor(a,b='FlowSource'){this.node=olympe.C.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.C.hb(a)?L(this.node,olympe.C.Pa(a)):L(this.node,a);return this}repeat(a){Yb(this.node,olympe.C.hb(a)?a.Ba:a);return this}clear(){Xb(this.node);return this}rb(){return M(this.node)}getContext(){return this.node}};function hc(a,b,c=1E3,d,e){const f=olympe.C.bc(olympe.C.aa),g=d||olympe.C.aa.No.Sp;let h,k,l,n;f.update(olympe.C.ra(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().gb()||(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.C.ra(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.rb()}
|
|
325
|
+
olympe.C.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.ra(b.value)}In(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Sb(!this.In())}Uc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.C.xb(''):olympe.C.xb(this.value.toString())}toString(a,b){return void 0!==
|
|
326
|
+
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.In()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.bc(olympe.C.aa,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.C.ra(c))};a.forEach((f,g)=>{olympe.C.Sc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().gb()){var g=b.get(f);b.delete(f);
|
|
327
327
|
g===c&&e()}});return d.rb()}ce(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()+c.valueOf()),olympe.C.aa,'ONumber.plus')}lh(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()-c.valueOf()),olympe.C.aa,'ONumber.minus')}round(){return olympe.C.ra(Math.round(this.valueOf()))}Dj(){return olympe.C.ra(-this.valueOf())}$k(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()*c.valueOf()),olympe.C.aa,'ONumber.mul')}kj(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()/
|
|
328
328
|
c.valueOf()),olympe.C.aa,'ONumber.div')}Wy(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(b.valueOf()%c.valueOf()),olympe.C.aa,'ONumber.div')}floor(){return olympe.C.ra(Math.floor(this.valueOf()))}ceil(){return olympe.C.ra(Math.ceil(this.valueOf()))}trunc(){return olympe.C.ra(Math.trunc(this.valueOf()))}log(){return olympe.C.ra(Math.log(this.valueOf()))}pow(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ra(Math.pow(b.valueOf(),c.valueOf())),olympe.C.aa,'ONumber.pow')}exp(){return olympe.C.ra(Math.exp(this.valueOf()))}Fd(a){return olympe.C.ta([this,
|
|
329
|
-
a],(b,c)=>olympe.C.Sb(b.Ea(c)),olympe.C.ea,'ONumber.oEquals')}Ea(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}hy(){return this.valueOf()}
|
|
329
|
+
a],(b,c)=>olympe.C.Sb(b.Ea(c)),olympe.C.ea,'ONumber.oEquals')}Ea(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}hy(){return this.valueOf()}sn(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'ONumber.isBiggerThan')}xz(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsBiggest')}Ks(a){return olympe.C.ta([this,
|
|
330
330
|
a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsSmallest')}Ny(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'ONumber.isSmallerThan')}sin(){return olympe.C.ra(Math.sin(this.valueOf()))}cos(){return olympe.C.ra(Math.cos(this.valueOf()))}atan2(a){return olympe.C.hb(a)?olympe.C.te([a],b=>olympe.C.ra(Math.atan2(this.valueOf(),b.valueOf())),olympe.C.aa):olympe.C.ra(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.C.ra(Math.abs(this.valueOf()))}wj(a,
|
|
331
|
-
b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.te([a,b],(c,d)=>olympe.C.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.aa):olympe.C.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Bw(a,b,c,d){'number'===typeof a&&(a=olympe.C.be(a));'number'===typeof b&&(b=olympe.C.be(b));'number'===typeof c&&(c=olympe.C.be(c));let e=0;const f=olympe.C.be(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.uj(b.
|
|
332
|
-
const k=(l,n)=>{n=olympe.C.be(n);const p=olympe.C.aa.animate(n,500);ec(f,p);cc(n,olympe.C.ra(l));e=l};olympe.C.te([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ec(f,olympe.C.be(e))},olympe.C.aa);void 0!==b&&olympe.C.
|
|
331
|
+
b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.te([a,b],(c,d)=>olympe.C.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.aa):olympe.C.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Bw(a,b,c,d){'number'===typeof a&&(a=olympe.C.be(a));'number'===typeof b&&(b=olympe.C.be(b));'number'===typeof c&&(c=olympe.C.be(c));let e=0;const f=olympe.C.be(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.uj(b.sn(c),()=>{olympe.ja.ab('df').warn('You have a min bigger than max, cap your inputs')});
|
|
332
|
+
const k=(l,n)=>{n=olympe.C.be(n);const p=olympe.C.aa.animate(n,500);ec(f,p);cc(n,olympe.C.ra(l));e=l};olympe.C.te([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):ec(f,olympe.C.be(e))},olympe.C.aa);void 0!==b&&olympe.C.vn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.be(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(g);L(n.Ba,l);e=g;ec(f,p)}});void 0!==c&&olympe.C.vn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.be(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(h);L(n.Ba,l);e=h;ec(f,
|
|
333
333
|
p)}});return f}static offset(a){let b;return olympe.C.te([a],c=>{void 0===b&&(b=c);return olympe.C.ra(c-b)},olympe.C.aa,'offset')}static Yr(a){let b,c,d;return olympe.C.ta([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.C.ra(0);d=window.performance.now();const f=olympe.C.ra((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.C.aa,'derivative')}static Fy(a){let b=olympe.C.ra(0),c,d,e;return olympe.C.ta([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.ra(0);
|
|
334
334
|
e=window.performance.now();b=b.ce((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.aa,'integrate')}static jx(a){let b;return olympe.C.ta([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.C.ra(c.valueOf()-b.valueOf());b=c;return d},olympe.C.aa,'diff')}static Ww(a,b,c){return olympe.C.te([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.C.ra(d>=e?d<=f?d:f:e)},olympe.C.aa)}static animate(a,b,c,d){let e;
|
|
335
335
|
return e=olympe.C.ta([a],f=>{const g=olympe.C.Pa(b,1E3),h=olympe.C.Pa(e);return void 0===h?olympe.C.ra(f):hc(h,f,g,c,k=>{d&&d(k)})},olympe.C.aa)}static Mw(a,b,c){let d,e,f,g,h,k,l=olympe.C.be(),n;olympe.C.Sc([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);cc(l,olympe.C.ra(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Uc(a){return olympe.C.hb(a)?
|
|
@@ -337,19 +337,19 @@ olympe.C.ta([a],b=>olympe.C.xb(b.valueOf().toString()),olympe.C.Sa):olympe.C.xb(
|
|
|
337
337
|
'minus'):olympe.C.ra(a.valueOf()-b.valueOf())}static kj(a,b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.te([a,b],(c,d)=>olympe.C.ra(c.valueOf()/d.valueOf()),olympe.C.aa,'div'):olympe.C.ra(a.valueOf()/b.valueOf())}static qz(a,b){if(void 0===b)return a;olympe.C.Sc([b],c=>{c=olympe.C.ra(a.Ba.Fb.valueOf()+c.valueOf());L(a.Ba,c)},'plusEqual');return a}};olympe.C.aa.ZERO=new olympe.C.aa(0);olympe.C.aa.ONE=new olympe.C.aa(1);olympe.C.aa.kw=new olympe.C.aa(2);olympe.C.aa.PI=new olympe.C.aa(Math.PI);
|
|
338
338
|
olympe.C.aa.cu=new olympe.C.aa(Infinity);olympe.C.aa.Zu=new olympe.C.aa(-Infinity);olympe.C.aa.Zp=new olympe.C.aa(NaN);olympe.C.aa.cC=olympe.C.aa.qz;olympe.C.aa.Qz=olympe.C.aa.Bw;olympe.C.aa.RB=olympe.C.aa.offset;olympe.C.aa.wA=olympe.C.aa.Yr;olympe.C.aa.mE=olympe.C.aa.Yr;olympe.C.aa.sB=olympe.C.aa.Fy;olympe.C.aa.xA=olympe.C.aa.jx;olympe.C.aa.eA=olympe.C.aa.Ww;olympe.C.aa.Rz=olympe.C.aa.animate;olympe.C.aa.Sz=olympe.C.aa.Mw;olympe.C.aa.vD=olympe.C.aa.Uc;olympe.C.aa.wD=olympe.C.aa.Dj;
|
|
339
339
|
olympe.C.aa.bC=olympe.C.aa.ce;olympe.C.aa.GB=olympe.C.aa.lh;olympe.C.aa.yA=olympe.C.aa.kj;
|
|
340
|
-
olympe.C.aa.
|
|
340
|
+
olympe.C.aa.No={Sp:function(a,b,c,d){return c*a/d+b},SA:function(a,b,c,d){a/=d;return c*a*a+b},bB:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},OA: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},HA:function(a,b,c,d){a/=d;return c*a*a*a+b},YA:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},MA: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},TA:function(a,b,c,d){a/=d;return c*a*a*a*a+b},cB:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
|
|
341
341
|
PA: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},UA:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},dB:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},QA: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},VA:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},eB:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},RA:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},KA:function(a,b,c,d){return c*Math.pow(2,
|
|
342
342
|
10*(a/d-1))+b},aB:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},NA: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},GA:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},XA:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},LA: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},BA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},CA:function(a,b,c,d){d=(a/=d)*a;return b+
|
|
343
343
|
c*(2*d*d+2*d*a+-3*d)},DA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},EA:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},$A: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)},ZA: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)},JA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},IA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},WA:function(a,
|
|
344
|
-
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},FA: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.C.aa.prototype;m.toJSON.K=olympe.C.J.j;m.
|
|
344
|
+
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},FA: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.C.aa.prototype;m.toJSON.K=olympe.C.J.j;m.In.K=olympe.C.J.j;m.isNaN.K=olympe.C.J.N;m.Uc.K=olympe.C.J.D;
|
|
345
345
|
m.toString.K=new olympe.C.J(()=>String,[]);m.toFixed.K=new olympe.C.J(()=>String,[]);m.ce.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.lh.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.round.K=olympe.C.J.F;m.Dj.K=olympe.C.J.F;m.$k.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.kj.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.Wy.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.floor.K=olympe.C.J.F;m.ceil.K=olympe.C.J.F;m.trunc.K=olympe.C.J.F;m.log.K=olympe.C.J.F;m.pow.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.exp.K=olympe.C.J.F;
|
|
346
|
-
m.Fd.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.hy.K=olympe.C.J.j;m.
|
|
346
|
+
m.Fd.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.hy.K=olympe.C.J.j;m.sn.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.xz.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.Ks.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.Ny.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.sin.K=olympe.C.J.F;m.cos.K=olympe.C.J.F;m.atan2.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.abs.K=olympe.C.J.F;m.wj.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);olympe.C.Sa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.xb(b.value)}Vr(a){return olympe.C.Sa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.C.ta([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.C.xb(d)},olympe.C.Sa,'OString.concat')}Uc(){return this}Kz(a){return olympe.C.ra(parseInt(this.value,
|
|
347
347
|
a))}Rs(){return olympe.C.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ea(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Fd(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Sb(c&&b.valueOf()===c.valueOf()),olympe.C.ea,'OString.oEquals')}jf(){return olympe.C.Sb(!this.value||0===this.value.length)}contains(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.Sb((c instanceof olympe.C.Sa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
|
|
348
|
-
olympe.C.ea,'OString.contains')}startsWith(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.Sb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.C.ea,'OString.startsWith')}endsWith(a,b){return olympe.C.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.
|
|
349
|
-
olympe.C.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.ta([this,a,b||Infinity],(c,d,e)=>olympe.C.ra(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.C.aa,'OString.lastIndexOf')}slice(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Sa,'OString.slice')}
|
|
348
|
+
olympe.C.ea,'OString.contains')}startsWith(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.Sb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.C.ea,'OString.startsWith')}endsWith(a,b){return olympe.C.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.jn().valueOf()+e.valueOf()+1;return olympe.C.Sb(c.valueOf().endsWith(d.valueOf(),e))},olympe.C.ea,'OString.endsWith')}indexOf(a,b){return olympe.C.ta([this,a,b||0],(c,d,e)=>olympe.C.ra(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
|
|
349
|
+
olympe.C.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.C.ta([this,a,b||Infinity],(c,d,e)=>olympe.C.ra(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.C.aa,'OString.lastIndexOf')}slice(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.C.Sa,'OString.slice')}jn(){return olympe.C.ra(this.value.length)}threshold(a){return olympe.C.ta([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.C.Sa.EMPTY,olympe.C.Sa,'OString.threshold')}toLowerCase(){return olympe.C.xb(this.value.toLowerCase())}toUpperCase(){return olympe.C.xb(this.value.toUpperCase())}trim(){return olympe.C.xb(this.value.trim())}padStart(a,
|
|
350
350
|
b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padStart')}padEnd(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.padEnd')}replace(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.C.Sa,'OString.replace')}Gz(a,b){return olympe.C.ta([this,a,b],(c,d,e)=>olympe.C.xb(c.valueOf().substr(d.valueOf(),
|
|
351
351
|
e.valueOf())),olympe.C.Sa,'OString.subOStr')}static concat(...a){return olympe.C.xb('').concat(...a)}};olympe.C.Sa.EMPTY=new olympe.C.Sa('');olympe.C.Sa.Xv=new olympe.C.Sa(' ');m=olympe.C.Sa.prototype;m.toJSON.K=olympe.C.J.j;m.Vr.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.concat.K=olympe.C.J.D;m.Uc.K=olympe.C.J.D;m.Kz.K=olympe.C.J.F;m.Rs.K=olympe.C.J.F;m.toString.K=olympe.C.J.j;m.valueOf.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Fd.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.jf.K=olympe.C.J.N;
|
|
352
|
-
m.contains.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.startsWith.K=new olympe.C.J(()=>olympe.C.ea,[0,1]);m.endsWith.K=new olympe.C.J(()=>olympe.C.ea,[0,1]);m.indexOf.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.lastIndexOf.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.slice.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.
|
|
352
|
+
m.contains.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.startsWith.K=new olympe.C.J(()=>olympe.C.ea,[0,1]);m.endsWith.K=new olympe.C.J(()=>olympe.C.ea,[0,1]);m.indexOf.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.lastIndexOf.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.slice.K=new olympe.C.J(()=>olympe.C.Sa,[0,1]);m.jn.K=olympe.C.J.F;m.threshold.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLowerCase.K=olympe.C.J.D;m.toUpperCase.K=olympe.C.J.D;m.trim.K=olympe.C.J.D;m.padStart.K=olympe.C.J.D;m.padEnd.K=olympe.C.J.D;
|
|
353
353
|
m.replace.K=olympe.C.J.D;m.Gz.K=olympe.C.J.D;olympe.C.ea=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.C.ea.D:olympe.C.ea.j}and(a){if(void 0!==a)return olympe.C.hb(a)?olympe.C.te([a],b=>new olympe.C.ea(this.valueOf()&&b.valueOf()),olympe.C.ea,'and'):this.value&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}Ea(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Fd(a){if(void 0!==a)return olympe.C.hb(a)?
|
|
354
354
|
olympe.C.te([a],b=>new olympe.C.ea(this.valueOf()===b.valueOf()),olympe.C.ea,'oEquals'):this.Ea(a)?olympe.C.ea.D:olympe.C.ea.j}ud(){return this.value?olympe.C.ea.j:olympe.C.ea.D}Lw(a){if(void 0!==a)return olympe.C.hb(a)?olympe.C.te([a],b=>new olympe.C.ea(!(this.valueOf()&&b.valueOf())),olympe.C.ea,'andNot'):this.value&&!a.valueOf()?olympe.C.ea.D:olympe.C.ea.j}or(a){if(void 0!==a)return olympe.C.hb(a)?olympe.C.te([a],b=>new olympe.C.ea(this.valueOf()||b.valueOf()),olympe.C.ea,'or'):this.value||a.valueOf()?
|
|
355
355
|
olympe.C.ea.D:olympe.C.ea.j}xor(a){return olympe.C.ta([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.C.Sb(b&&!c||!b&&c)},olympe.C.ea,'OBoolean.xor')}yx(){return this.value}rs(){return!0===this.value?olympe.C.aa.ONE:olympe.C.aa.ZERO}Uc(){return olympe.C.xb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.C.ea.D=new olympe.C.ea(!0);olympe.C.ea.j=new olympe.C.ea(!1);m=olympe.C.ea.prototype;m.toJSON.K=olympe.C.J.j;
|
|
@@ -357,64 +357,64 @@ m.and.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.Ea.K=olympe.C.J.j;m.Fd.K=new olymp
|
|
|
357
357
|
olympe.C.eb=class{constructor(a){this.qb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.qb.toJSON()+'" }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.eb(new Date(b.value.valueOf()))}static now(){return new olympe.C.eb(new Date)}Kp(){return this.qb&&!isNaN(this.qb.getTime())?olympe.C.ea.D:olympe.C.ea.j}ku(){return olympe.C.ra(this.qb.getMilliseconds())}mu(){return olympe.C.ra(this.qb.getSeconds())}lu(){return olympe.C.ra(this.qb.getMinutes())}ju(){return olympe.C.ra(this.qb.getHours())}Lx(){return olympe.C.ra(this.qb.getDate())}getMonth(){return olympe.C.ra(this.qb.getMonth()+1)}nu(){return olympe.C.ra(this.qb.getFullYear())}getTime(){return this.qb.getTime()}Dz(){var a=
|
|
358
358
|
olympe.C,b=a.xb;var c=this.qb.getDate();c=10>c?'0'+c:c;var d=this.qb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.qb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleString(c.valueOf())),olympe.C.Sa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleDateString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleDateString(c.valueOf())),
|
|
359
359
|
olympe.C.Sa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.qb.toLocaleTimeString(a)):olympe.C.ta([this,a],(b,c)=>olympe.C.xb(b.qb.toLocaleTimeString(c.valueOf())),olympe.C.Sa)}Uc(){return olympe.C.xb(this.qb.toISOString())}Hz(){return new Date(this.getTime())}Jz(){return this}Lz(){return this}jg(a,b){return olympe.C.ta([b],c=>{const d=new olympe.C.eb(new Date(this.qb.getTime()));d.qb['set'+a](this.qb['get'+a]()+c.valueOf());return d},olympe.C.eb)}Dw(a){return this.jg('Milliseconds',
|
|
360
|
-
a)}Iw(a){return this.jg('Seconds',a)}Ew(a){return this.jg('Minutes',a)}Cw(a){return this.jg('Hours',a)}
|
|
360
|
+
a)}Iw(a){return this.jg('Seconds',a)}Ew(a){return this.jg('Minutes',a)}Cw(a){return this.jg('Hours',a)}Qm(a){return this.jg('Date',a)}Jw(a){return'number'===typeof a?this.Qm(7*a):this.Qm(a.$k(7))}Fw(a){return this.jg('Month',a)}Kw(a){return this.jg('FullYear',a)}Ez(){let a=this.qb.getDay();a=0===a?6:a-1;return new olympe.C.eb(new Date(this.qb.getFullYear(),this.qb.getMonth(),this.qb.getDate()-a))}Fz(){return new olympe.C.eb(new Date(this.qb.getFullYear(),this.qb.getMonth()))}Fd(a){return olympe.C.ta([a],
|
|
361
361
|
b=>olympe.C.Sb(this.Ea(b)),olympe.C.ea)}Ea(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Xx(){let a=this.qb.getDay();0===a&&(a=7);return olympe.C.ra(a)}Px(a,b){return olympe.C.ta([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.qb.getFullYear()-c.qb.getFullYear():'months'===d?c=12*(this.qb.getFullYear()-c.qb.getFullYear())+(this.qb.getMonth()-c.qb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
|
|
362
362
|
void 0===d&&(olympe.ja.ab('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.qb.getTime()-c.qb.getTime())/d));return olympe.C.ra(c)},olympe.C.aa)}Iy(a){return olympe.C.ta([a],b=>olympe.C.Sb(this.getTime()<b.getTime()),olympe.C.ea)}Gy(a){return olympe.C.ta([a],b=>olympe.C.Sb(this.getTime()>b.getTime()),olympe.C.ea)}Jy(a,b){return olympe.C.ta([a,b],(c,d)=>olympe.C.Sb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.ea)}valueOf(){return this.Kp().valueOf()?
|
|
363
363
|
new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=ic(0);olympe.C.eb.D=ic(Number.NaN);m=olympe.C.eb.prototype;m.Kp.K=olympe.C.J.N;m.ku.K=olympe.C.J.F;m.mu.K=olympe.C.J.F;m.lu.K=olympe.C.J.F;m.ju.K=olympe.C.J.F;m.Lx.K=olympe.C.J.F;m.getMonth.K=olympe.C.J.F;m.nu.K=olympe.C.J.F;m.getTime.K=olympe.C.J.j;m.Dz.K=new olympe.C.J(()=>olympe.C.Sa,[0]);m.toLocaleString.K=olympe.C.J.D;m.toLocaleDateString.K=olympe.C.J.D;m.toLocaleTimeString.K=olympe.C.J.D;m.Uc.K=olympe.C.J.D;m.Hz.K=olympe.C.J.j;
|
|
364
|
-
m.Jz.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Lz.K=new olympe.C.J(()=>olympe.C.eb,[]);m.jg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Dw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Iw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ew.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Cw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.
|
|
364
|
+
m.Jz.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Lz.K=new olympe.C.J(()=>olympe.C.eb,[]);m.jg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Dw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Iw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ew.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Cw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Qm.K=new olympe.C.J(()=>olympe.C.eb,[0]);m.Jw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Fw.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Kw.K=new olympe.C.J(()=>olympe.C.eb,[0]);
|
|
365
365
|
m.Ez.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Fz.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Fd.K=olympe.C.J.N;m.Ea.K=olympe.C.J.j;m.Xx.K=olympe.C.J.F;m.Px.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.Iy.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.Gy.K=new olympe.C.J(()=>olympe.C.ea,[0]);m.Jy.K=new olympe.C.J(()=>olympe.C.ea,[0,1]);m.valueOf.K=olympe.C.J.j;const jc=new Map,kc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,lc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function mc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=lc.exec(c)):(d=1,c=kc.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.C.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.C.kf(a)?olympe.C.te([a],b,olympe.C.Color):b(a)}
|
|
366
366
|
olympe.C.Color=class{constructor(a,b,c,d){this.j=olympe.C.ra(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.D=olympe.C.ra(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.C.ra(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.C.ra(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return{r:this.j.valueOf(),g:this.D.valueOf(),b:this.b.valueOf(),a:this.a.valueOf()}}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.C.Color.create(b.r,
|
|
367
367
|
b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.C.ta([a,b,c,d],(e,f,g,h)=>{e=olympe.C.ra(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.C.ra(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.C.ra(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.C.ra(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of jc.values())if(k&&k.j.Ea(e)&&k.D.Ea(f)&&k.b.Ea(g)&&k.a.Ea(h))return k;return new olympe.C.Color(e,f,g,h)},olympe.C.Color)}fh(){return this.j}Zg(){return this.b}bh(){return this.D}Yg(){return this.a}Pw(a,
|
|
368
|
-
b){return olympe.C.Color.create(this.j.wj(a.fh(),b),this.D.wj(a.bh(),b),this.b.wj(a.Zg(),b),this.a.wj(a.Yg(),b))}qx(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}Ss(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}
|
|
369
|
-
this.D.valueOf()===a.D.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.fh().valueOf()<<16|this.bh().valueOf()<<8|this.Zg().valueOf())-(a.fh().valueOf()<<16|a.bh().valueOf()<<8|a.Zg().valueOf());return 0===b?this.Yg().valueOf()-a.Yg().valueOf():b}};olympe.C.Color.prototype.equals=olympe.C.Color.prototype.Ea;olympe.C.Color.prototype.toHexString=olympe.C.Color.prototype.
|
|
368
|
+
b){return olympe.C.Color.create(this.j.wj(a.fh(),b),this.D.wj(a.bh(),b),this.b.wj(a.Zg(),b),this.a.wj(a.Yg(),b))}qx(a){return olympe.C.Color.create(this.j,this.D,this.b,a)}Ss(){return`rgba(${this.j},${this.D},${this.b},${this.a})`}Gn(){const a=(16777216|this.b|this.D<<8|this.j<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);return'#'+(a+b).toUpperCase()}toString(){return this.Gn()}Ea(a){return a instanceof olympe.C.Color?this.j.valueOf()===a.j.valueOf()&&
|
|
369
|
+
this.D.valueOf()===a.D.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.fh().valueOf()<<16|this.bh().valueOf()<<8|this.Zg().valueOf())-(a.fh().valueOf()<<16|a.bh().valueOf()<<8|a.Zg().valueOf());return 0===b?this.Yg().valueOf()-a.Yg().valueOf():b}};olympe.C.Color.prototype.equals=olympe.C.Color.prototype.Ea;olympe.C.Color.prototype.toHexString=olympe.C.Color.prototype.Gn;olympe.C.Color.prototype.toRGBString=olympe.C.Color.prototype.Ss;
|
|
370
370
|
olympe.C.Color.prototype.getAlpha=olympe.C.Color.prototype.Yg;olympe.C.Color.prototype.getGreen=olympe.C.Color.prototype.bh;olympe.C.Color.prototype.getBlue=olympe.C.Color.prototype.Zg;olympe.C.Color.prototype.getRed=olympe.C.Color.prototype.fh;olympe.C.Color.create=olympe.C.Color.create;m=olympe.C.Color.prototype;m.toJSON.K=olympe.C.J.j;m.fh.K=olympe.C.J.F;m.Zg.K=olympe.C.J.F;m.bh.K=olympe.C.J.F;m.Yg.K=olympe.C.J.F;m.Pw.K=new olympe.C.J(()=>olympe.C.Color,[]);
|
|
371
|
-
m.qx.K=new olympe.C.J(()=>olympe.C.Color,[]);m.Ss.K=new olympe.C.J(()=>String,[]);m.
|
|
371
|
+
m.qx.K=new olympe.C.J(()=>olympe.C.Color,[]);m.Ss.K=new olympe.C.J(()=>String,[]);m.Gn.K=new olympe.C.J(()=>String,[]);m.Ea.K=olympe.C.J.j;m.compare.K=olympe.C.J.j;olympe.C.File=class{la(){}Lp(){}Mp(){}qs(){}Ok(){}en(){}Pk(){}rename(){}};olympe.C.Zb=class{constructor(a,b){this.x=olympe.C.be(a);this.y=olympe.C.be(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.C.Pa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.C.Pa(this.y).valueOf())+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.C.Zb(b.x,b.y)}ou(){return this.x}Bz(a){fc(this.x,a)}pu(){return this.y}Cz(a){fc(this.y,a)}ty(){return this.x.Ks(this.y)}ce(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.ce(c.x),b.y.ce(c.y)),
|
|
372
372
|
olympe.C.Zb,'Vector2.plus')}lh(a){return olympe.C.ta([this,a],(b,c)=>new olympe.C.Zb(b.x.lh(c.x),b.y.lh(c.y)),olympe.C.Zb,'Vector2.minus')}Yy(a){return new olympe.C.Zb(this.x.$k(a),this.y.$k(a))}lx(a){return new olympe.C.Zb(this.x.kj(a),this.y.kj(a))}$y(){return new olympe.C.Zb(this.x.Dj(),this.y.Dj())}mx(a){return olympe.C.ta([this,a],(b,c)=>olympe.C.ta([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.ra(d*f+e*g),olympe.C.aa),olympe.C.aa)}length(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.ra(Math.sqrt(a*
|
|
373
373
|
a+b*b)),olympe.C.aa)}normalize(){return olympe.C.ta([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.C.Zb(a/c,b/c)},olympe.C.Zb)}floor(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.floor(a),Math.floor(b)),olympe.C.Zb)}ceil(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.ceil(a),Math.ceil(b)),olympe.C.Zb)}round(){return olympe.C.ta([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.round(a),Math.round(b)),olympe.C.Zb)}Gw(a){return new olympe.C.Zb(this.x.ce(a),
|
|
374
374
|
this.y.ce(a))}Hw(a,b){return new olympe.C.Zb(this.x.ce(a),this.y.ce(b))}Uc(){return olympe.C.ta([this.x,this.y],(a,b)=>olympe.C.xb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Fb}, ${this.y.Ba.Fb}]`}Ea(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.J.j;m.ou.K=olympe.C.J.F;m.Bz.K=olympe.C.J.j;m.pu.K=olympe.C.J.F;m.Cz.K=olympe.C.J.j;m.ty.K=olympe.C.J.F;m.ce.K=new olympe.C.J(()=>olympe.C.Zb,[0]);
|
|
375
375
|
m.lh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.Yy.K=olympe.C.J.R;m.lx.K=olympe.C.J.R;m.$y.K=olympe.C.J.R;m.mx.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.length.K=olympe.C.J.F;m.normalize.K=olympe.C.J.R;m.floor.K=olympe.C.J.R;m.ceil.K=olympe.C.J.R;m.round.K=olympe.C.J.R;m.Gw.K=olympe.C.J.R;m.Hw.K=olympe.C.J.R;m.Uc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;olympe.C.Bg=class{constructor(){}Nb(){}Md(){}get(){}fi(){}has(){}ih(){}Gc(){}Of(){}xf(){}og(){}forEach(){}ke(){}};olympe.C.Bg.prototype.forEachCurrentValue=olympe.C.Bg.prototype.ke;olympe.C.Bg.prototype.forEach=olympe.C.Bg.prototype.forEach;m=olympe.C.Bg.prototype;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.xf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;olympe.C.qd=class extends olympe.C.Bg{Dd(){}Nf(){}hf(){}Mf(){}le(){}gf(){}lj(){}hi(){}};olympe.C.qd.prototype.getCurrentAt=olympe.C.qd.prototype.gf;olympe.C.qd.prototype.getAt=olympe.C.qd.prototype.le;olympe.C.qd.prototype.getCurrentKeyAt=olympe.C.qd.prototype.Mf;olympe.C.qd.prototype.getKeyAt=olympe.C.qd.prototype.hf;olympe.C.qd.prototype.getCurrentRank=olympe.C.qd.prototype.Nf;olympe.C.qd.prototype.getRank=olympe.C.qd.prototype.Dd;m=olympe.C.qd.prototype;m.Dd.K=olympe.C.J.F;m.Nf.K=olympe.C.J.j;
|
|
376
376
|
m.hf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>Object,[]);m.gf.K=olympe.C.J.j;m.lj.K=olympe.C.J.j;m.hi.K=new olympe.C.J(()=>Array,[]);olympe.C.ni=class{constructor(a,b){this.N=b||olympe.C.Xa();this.valueType=a||Object;this.values={};this.jb=this.ua=null;this.af=0;this.Y=Object.create(null);this.zb=Object.create(null);this.size=0;this.H=null;this.N.onDestroy(()=>{const c=this.Y;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()}}})}getContext(){return this.N}Nb(){return this.valueType}Md(a){this.valueType=a;const b=this.ua;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
|
|
377
377
|
c)&&bc(b[c],a)}get(a){const b=c=>{null===this.ua&&(this.ua={});return this.pj(this.ua,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ta([a],c=>b(c),this.valueType)}fi(a){a=this.values[a];return olympe.C.hb(a)?Nb(a.Ba)?a.Ba.Fb:void 0:a}has(a){const b=c=>{null===this.jb&&(this.jb={});return this.pj(this.jb,c,c in this.values?olympe.C.ea.D:olympe.C.ea.j,olympe.C.ea,'Map.has('+c+')')};return olympe.C.ta([a],c=>b(c),olympe.C.ea)}ih(a){return a in this.values}pj(a,b,c,d,e){let f=a[b];
|
|
378
|
-
f||this.N.run(()=>{f=olympe.C.Sd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.hb(c)?ec(f,c):cc(f,c)});return f}Gc(){throw Error('Abstract method getFirstKey needs to be overridden');}Of(){throw Error('Abstract method getFirstKey needs to be overridden');}xf(){null===this.H&&this.N.run(()=>{this.H=olympe.C.Sd(olympe.C.aa,olympe.C.ra(this.size));this.H.Ba.onDestroy(()=>{this.H=null})});return this.H}og(){return this.size}forEach(a,b){const c=this.
|
|
379
|
-
b){this.zb[a]=b;olympe.C.Xa().Td(()=>{const c=this.Y;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.zb[a]});this.ke(b)}Mr(a,b,c){const d=olympe.C.Xa();return(e,f)=>{d.run(()=>{const g=olympe.C.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.
|
|
378
|
+
f||this.N.run(()=>{f=olympe.C.Sd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.hb(c)?ec(f,c):cc(f,c)});return f}Gc(){throw Error('Abstract method getFirstKey needs to be overridden');}Of(){throw Error('Abstract method getFirstKey needs to be overridden');}xf(){null===this.H&&this.N.run(()=>{this.H=olympe.C.Sd(olympe.C.aa,olympe.C.ra(this.size));this.H.Ba.onDestroy(()=>{this.H=null})});return this.H}og(){return this.size}forEach(a,b){const c=this.Mm();a=this.Mr(c,a,b);this.Lm(c,a)}Mm(){return String(++this.af)}Lm(a,
|
|
379
|
+
b){this.zb[a]=b;olympe.C.Xa().Td(()=>{const c=this.Y;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.zb[a]});this.ke(b)}Mr(a,b,c){const d=olympe.C.Xa();return(e,f)=>{d.run(()=>{const g=olympe.C.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.Pm(a,f,g)})}}Pm(a,b,c){void 0===this.Y[b]&&(this.Y[b]={});this.Y[b][a]=c}ke(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
|
|
380
380
|
a(b[c],c,this))break}Ik(a,b){void 0!==this.values[a]&&this.ej(a,!0);this.values[a]=b;var c=this.ua;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?ec(c[a],b):cc(c[a],b));c=this.jb;null!==c&&void 0!==c[a]&&fc(c[a],!0);this.size++;c=this.zb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}ej(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Xg?d.Ba.Fb:d;var e=this.ua;null!==e&&void 0!==e[a]&&dc(e[a]);e=this.jb;null!==e&&void 0!==
|
|
381
381
|
e[a]&&fc(e[a],!1);delete c[a];this.size--;b||this.Jf()}a=this.Y[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Jf(){null!==this.H&&fc(this.H,this.size)}Uh(){var a=this.ua;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&dc(a[c]);a=this.jb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&fc(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.Y)if(Object.prototype.hasOwnProperty.call(this.Y,
|
|
382
382
|
c)){b=this.Y[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.H&&fc(this.H,this.size)}Eg(){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.C.ni.xa=[olympe.C.Bg];m=olympe.C.ni.prototype;m.getContext.K=olympe.C.J.j;m.Nb.K=olympe.C.J.j;m.Md.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>Object,[],'valueType');m.fi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.pj.K=olympe.C.J.j;
|
|
383
|
-
m.xf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.
|
|
383
|
+
m.xf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.Mm.K=olympe.C.J.j;m.Lm.K=olympe.C.J.j;m.Mr.K=olympe.C.J.j;m.Pm.K=olympe.C.J.j;m.ke.K=olympe.C.J.j;m.Ik.K=olympe.C.J.j;m.ej.K=olympe.C.J.j;m.Jf.K=olympe.C.J.j;m.Uh.K=olympe.C.J.j;m.Eg.K=olympe.C.J.j;olympe.C.Hj=class extends olympe.C.ni{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.ha=this.Ga=this.$a=this.da=null}Md(a){super.Md(a);if(null!==this.ha)for(let b of this.ha.values())bc(b,a)}Gc(){return this.le(0)}Of(){return this.hf(0)}Dd(a){const b=c=>{null===this.$a&&(this.$a=Object.create(null));let d=this.Nf(a);d=void 0!==d?olympe.C.ra(d):void 0;return this.pj(this.$a,c,d,olympe.C.aa,`List.getRank(${c})`)};return olympe.C.hb(a)?M(olympe.C.createNode(olympe.C.aa,b,null,
|
|
384
384
|
[a.Ba],[0],'onResolved('+(b.name||'')+')')):b(a)}Nf(a){return this.D[a]}hf(a){const b=c=>{const d=c.valueOf(),e=this.Mf(d);null===this.Ga&&(this.Ga=Object.create(null));return this.pj(this.Ga,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ta([a],c=>b(c),String)}Mf(a){return this.j[a.valueOf()]}le(a){if(olympe.C.hb(a))return this.get(olympe.C.ta([a],c=>{c=this.hf(c);if(!Nb(c.Ba)){const d=olympe.C.Xa();olympe.C.Rf(d)&&Xb(d)}return c},String));null===this.ha&&(this.ha=new Map);let b=this.ha.get(a);
|
|
385
|
-
b||this.N.run(()=>{b=this.get(this.hf(a));this.ha.set(a,b);b.Ba.onDestroy(()=>this.ha.delete(a))});return b}gf(a){return this.fi(this.Mf(a))}lj(a,b,c,d){let e=this.
|
|
386
|
-
this.da.Ba.onDestroy(()=>{this.H=null})});return this.da}ke(a){if(this.j.length!==this.size)super.ke(a);else{var b=this.values;for(let c of this.j.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}
|
|
387
|
-
c[a]&&cc(c[a],olympe.C.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&dc(d[e]),void 0!==d[b]&&cc(d[b],a))}}
|
|
385
|
+
b||this.N.run(()=>{b=this.get(this.hf(a));this.ha.set(a,b);b.Ba.onDestroy(()=>this.ha.delete(a))});return b}gf(a){return this.fi(this.Mf(a))}lj(a,b,c,d){let e=this.Mm();a=this.Ds(e,a,b,c,d);this.Lm(e,a)}Ds(a,b,c,d,e){return olympe.C.Xa().rc((f,g)=>{let h=!1,k=olympe.C.li([b,c,this.Dd(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.Pm(a,g,k)})}hi(){null===this.da&&this.N.run(()=>{this.da=olympe.C.Sd(Array,this.j.filter(a=>void 0!==a));
|
|
386
|
+
this.da.Ba.onDestroy(()=>{this.H=null})});return this.da}ke(a){if(this.j.length!==this.size)super.ke(a);else{var b=this.values;for(let c of this.j.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}Om(a,b){const c=this.$a,d=this.Ga,e=this.D[a],f=b.valueOf();if(e!==f||this.j[e]!==a){var g=this.j[f];void 0!==g&&delete this.D[g];void 0!==e&&null!==e&&this.j[e]===a&&(this.j[e]=void 0);this.D[a]=f;this.j[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&dc(c[g]),void 0!==
|
|
387
|
+
c[a]&&cc(c[a],olympe.C.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&dc(d[e]),void 0!==d[b]&&cc(d[b],a))}}Nm(a){var b=this.Ga,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Fb===a&&dc(b));delete this.D[a];this.j.splice(c,1);c=this.$a;null!==c&&void 0!==c[a]&&dc(c[a])}Nr(){if(null!==this.da){const a=this.j,b=this.da.Ba.Fb;b&&a.join(',')!==b.join(',')&&cc(this.da,a)}}Jf(){this.Nr();super.Jf()}Uh(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.$a;if(null!==
|
|
388
388
|
a)for(b in a)dc(a[b]);a=this.Ga;if(null!==a)for(b in a)dc(a[parseInt(b,10)]);var b=this.da;null!==b&&(Vb(b.Ba),cc(b,this.j));return olympe.C.ni.prototype.Uh.call(this)}Eg(){const a=this.values,b=this.D;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.C.Hj.xa=[olympe.C.qd];m=olympe.C.Hj.prototype;m.Md.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.Dd.K=olympe.C.J.F;m.Nf.K=olympe.C.J.j;
|
|
389
|
-
m.hf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>Object,[]);m.gf.K=olympe.C.J.j;m.lj.K=new olympe.C.J(()=>{},[]);m.Ds.K=olympe.C.J.j;m.hi.K=new olympe.C.J(()=>Array,[]);m.ke.K=olympe.C.J.j;m.
|
|
390
|
-
a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?ec(this.D,b):cc(this.D,b);cc(this.j,a)}else void 0!==this.D.Ba.Fb&&(dc(this.D),dc(this.j))}set(a,b){this.Ik(a,b);1===this.size&&null!==this.j&&this.Bj(a);this.Jf()}remove(a){const b=this.ej(a);null!==this.j&&this.j.Ba.Fb===a&&this.Bj(this.
|
|
391
|
-
m.
|
|
392
|
-
olympe.C.Sd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Rf(b)?Yb(a,b):olympe.C.hb(b)?Yb(a,b.Ba):L(a,b);return M(a)};olympe.C.hb=function(a){return!(!a||!a.Xg)};olympe.C.kf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.Xg))};olympe.C.
|
|
393
|
-
olympe.C.
|
|
389
|
+
m.hf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>Object,[]);m.gf.K=olympe.C.J.j;m.lj.K=new olympe.C.J(()=>{},[]);m.Ds.K=olympe.C.J.j;m.hi.K=new olympe.C.J(()=>Array,[]);m.ke.K=olympe.C.J.j;m.Om.K=olympe.C.J.j;m.Nm.K=olympe.C.J.j;m.Nr.K=olympe.C.J.j;m.Jf.K=olympe.C.J.j;m.Uh.K=olympe.C.J.j;m.Eg.K=olympe.C.J.j;olympe.C.Map=class extends olympe.C.ni{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Md(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&bc(this.D,a);super.Md(a)}Gc(){null===this.D&&this.Zm();return this.D}Of(){null===this.j&&this.Zm();return this.j}Zm(){this.getContext().run(()=>{this.D=olympe.C.Sd(this.Nb());this.j=olympe.C.Sd(String);this.Bj(this.bn())})}bn(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Bj(a){if(void 0!==
|
|
390
|
+
a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?ec(this.D,b):cc(this.D,b);cc(this.j,a)}else void 0!==this.D.Ba.Fb&&(dc(this.D),dc(this.j))}set(a,b){this.Ik(a,b);1===this.size&&null!==this.j&&this.Bj(a);this.Jf()}remove(a){const b=this.ej(a);null!==this.j&&this.j.Ba.Fb===a&&this.Bj(this.bn());return b}clear(){this.Uh();null!==this.j&&this.Bj()}};m=olympe.C.Map.prototype;m.Md.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>Object,[]);m.Of.K=new olympe.C.J(()=>String,[]);m.Zm.K=olympe.C.J.j;
|
|
391
|
+
m.bn.K=olympe.C.J.j;m.Bj.K=olympe.C.J.j;m.set.K=olympe.C.J.j;m.remove.K=new olympe.C.J(()=>Object,[]);m.clear.K=olympe.C.J.j;olympe.C.Hg=class extends olympe.C.Hj{constructor(a){super(a)}set(a,b,c){this.Ik(a,b);void 0!==c&&olympe.C.Sc([c],d=>{this.Om(a,d)});this.Jf()}remove(a){this.Nm(a);return this.ej(a)}clear(){this.Uh()}};olympe.C.Hg.prototype.remove.K=olympe.C.J.j;olympe.C.Hg.prototype.clear.K=olympe.C.J.j;olympe.C.at=class extends olympe.C.Yj{constructor(a,b){super(olympe.C.aa,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.aa.No.Sp}rb(){return olympe.C.bz(this.node,this.duration,this.j,void 0)}};let nc=null;olympe.C.G=void 0;olympe.C.yn=void 0;olympe.C.Zh=void 0;olympe.C.Th=new Map;olympe.C.Th.set(0,olympe.C.aa.ZERO);olympe.C.Th.set(1,olympe.C.aa.ONE);olympe.C.Th.set(2,olympe.C.aa.kw);olympe.C.Hk=new Map;olympe.C.Hk.set('',olympe.C.Sa.EMPTY);olympe.C.Hk.set(' ',olympe.C.Sa.Xv);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Jc:b,Uf:c,pn:d,debug:g,kg:e,ad:f,fj:h})};olympe.C.Rf=function(a){return a instanceof olympe.C.Node};
|
|
392
|
+
olympe.C.Sd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Rf(b)?Yb(a,b):olympe.C.hb(b)?Yb(a,b.Ba):L(a,b);return M(a)};olympe.C.hb=function(a){return!(!a||!a.Xg)};olympe.C.kf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.Xg))};olympe.C.tn=function(a){return a instanceof olympe.C.Xb||a instanceof olympe.C.Zq||a instanceof olympe.C.Node};olympe.C.jh=function(a){return a instanceof olympe.C.Yj};
|
|
393
|
+
olympe.C.vn=function(a,b){if(void 0!==a){olympe.C.jh(a)&&(a=a.rb().Ba);if(!olympe.C.kf(a))return b(a);var c=[];olympe.C.hb(a)?c.push(a.Ba):c.push(a);return olympe.C.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.C.Pa=function(a,b){let c=a;olympe.C.hb(a)?c=a.Ba.Fb:olympe.C.Rf(a)?c=a.Fb:olympe.C.jh(a)&&(c=a.rb().Ba.Fb);return void 0===c?b:c};
|
|
394
394
|
olympe.C.nh=function(a,b){let c;olympe.C.hb(a)?c=a.Ba:olympe.C.Rf(a)?c=a:olympe.C.jh(a)&&(c=a.rb().Ba);c&&olympe.C.Sc([b],d=>{c.nh(d)},'setDefaultValue');return a};olympe.C.li=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.Kr?(h=h.Ba,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.jh(h)&&(h=h.rb().Ba,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
|
|
395
395
|
olympe.C.te=function(a,b,c,d){return M(olympe.C.li(a,b,c,d||'syncProxies'))};const oc=a=>{for(const b of a)if(olympe.C.kf(b)||olympe.C.jh(b))return!1;return!0};olympe.C.ta=function(a,b,c,d,e){if(oc(a))return b(...a);const f=olympe.C.li(a,b,c,d||'TransformFlows');e&&olympe.C.Sc([e],g=>{f.nh(g)},'setDefaultValue');return M(f)};olympe.C.Sc=function(a,b,c){oc(a)?b(...a):olympe.C.li(a,b,void 0,c||'processFlows')};
|
|
396
396
|
olympe.C.kE=function(a,b,c){const d=olympe.C.Rf(a)?a.Nb():olympe.C.jh(a)?a.rb().Sh:a.Sh,e=olympe.C.bc(d,c),f=olympe.V.Promise.jj(g=>{e.getContext().gb()||e.update(g)},b);olympe.C.Sc([a],g=>f(g).then());return e.rb()};olympe.C.Hs=function(a,b){if(oc(a))b(...a);else{const c=olympe.C.Xa();olympe.C.li(a,(...d)=>{olympe.C.Xa().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
|
|
397
|
-
olympe.C.
|
|
397
|
+
olympe.C.wn=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.C.hb(g)?(g=g.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.jh(g)&&(g=g.rb().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Jc:b,pn:e,kg:f,sz:!1,ad:c})};olympe.C.Is=function(a,b){const c=olympe.C.Xa();olympe.C.wn(a,(...d)=>{olympe.C.Xa().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.iE=function(a,b,c){a=new olympe.C.Yj(a,c);b(a);return a.rb()};
|
|
398
398
|
olympe.C.bc=function(a,b='flowSource'){return new olympe.C.Yj(a,b)};olympe.C.QE=function(a,b,c,d){const e=olympe.C.Xa();olympe.C.li(a,(...f)=>{olympe.C.Xa().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.uj=function(a,b,c){olympe.C.ta([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.vE=function(a,b,c='from observable'){const d=olympe.C.bc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.rb()};
|
|
399
399
|
olympe.C.sE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.UE=function(a){return olympe.C.Xa().rc(a)};olympe.C.pE=function(a,b,c){olympe.C.nx(a?a.Ba:a,b,c)};
|
|
400
400
|
olympe.C.nx=function(a,b,c){if(a){var d=a.T();null===nc&&(nc={});if(nc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{nc[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.C.G.warn(e):olympe.C.G.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.C.createNode(null,g=>{void 0===g?olympe.C.G.log(f,'undefined'):null===g?olympe.C.G.log(f,'null'):olympe.C.G.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.C.G.log(`Node #${d} destroyed`+(b?`: ${b}`:
|
|
401
|
-
''))});c.onDestroy(()=>{delete nc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.oE=function(){let a='',b=olympe.C.Xa();for(;null!==b;)a+=b.
|
|
401
|
+
''))});c.onDestroy(()=>{delete nc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.oE=function(){let a='',b=olympe.C.Xa();for(;null!==b;)a+=b.gn()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
|
|
402
402
|
olympe.C.ra=function(a){if(void 0===a)return olympe.C.aa.ZERO;if(a instanceof olympe.C.aa)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.aa.Zp;if(a===Math.PI)return olympe.C.aa.PI;if(Infinity===a)return olympe.C.aa.cu;if(-Infinity===a)return olympe.C.aa.Zu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.Th.has(a)||olympe.C.Th.set(a,new olympe.C.aa(a)),olympe.C.Th.get(a)):new olympe.C.aa(a)}return null};
|
|
403
403
|
olympe.C.be=function(a){return void 0===a?olympe.C.Sd(olympe.C.aa):olympe.C.Sd(olympe.C.aa,olympe.C.kf(a)?a:olympe.C.ra(a))};olympe.C.bz=olympe.C.aa.animate;olympe.C.FE=function(a,b){return new olympe.C.at(a,b)};olympe.C.xb=function(a){if(a instanceof olympe.C.Sa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.C.Hk.has(a)?olympe.C.Hk.get(a):new olympe.C.Sa(a)};
|
|
404
404
|
olympe.C.KE=function(a){return void 0===a?olympe.C.Sd(olympe.C.Sa):olympe.C.Sd(olympe.C.Sa,olympe.C.kf(a)?a:olympe.C.xb(a))};olympe.C.Sb=function(a){return a instanceof olympe.C.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.ea.D:olympe.C.ea.j};olympe.C.HE=function(a){return void 0===a?olympe.C.Sd(olympe.C.ea):olympe.C.Sd(olympe.C.ea,olympe.C.kf(a)?a:olympe.C.Sb(a))};olympe.C.GE=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
|
|
405
405
|
olympe.C.JE=function(a){return olympe.C.Sd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.ys=a=>a instanceof olympe.C.ea||a instanceof olympe.C.aa||a instanceof olympe.C.Sa||a instanceof olympe.C.eb;olympe.C.LE=function(a,b){return olympe.C.Sd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.mz=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.C.Color?e=a:e=olympe.C.Color.create(a,b,c,d));return olympe.C.Sd(olympe.C.Color,e)};olympe.C.IE=olympe.C.mz;
|
|
406
|
-
olympe.C.bx=function(a){olympe.C.G=a;olympe.C.Zh=olympe.C.ah()};olympe.C.ah=function(){olympe.C.
|
|
406
|
+
olympe.C.bx=function(a){olympe.C.G=a;olympe.C.Zh=olympe.C.ah()};olympe.C.ah=function(){olympe.C.yn||(olympe.C.yn=new olympe.C.Zq);return olympe.C.yn};olympe.C.Xa=function(){olympe.C.Zh||(olympe.C.Zh=olympe.C.ah());return olympe.C.Zh};olympe.C.Os=function(a){const b=olympe.C.Zh;olympe.C.tn(a)&&(olympe.C.Zh=a);return null!=b?b:null};
|
|
407
407
|
olympe.C.Qb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.C.eb.Qb(a);break;case 'number':b=olympe.C.aa.Qb(a);break;case 'string':b=olympe.C.Sa.Qb(a);break;case 'vector2':b=olympe.C.Zb.Qb(a);break;case 'color':b=olympe.C.Color.Qb(a);break;case 'boolean':b=olympe.C.ea.Qb(a)}return b}return null};function pc(a){a.j.gb()||(a.F.forEach(b=>{b.destroy()}),a.F.clear(),a.D.clear(),a.size.clear(),a.N.clear(),a.R.length=0,a.H.length=0)}
|
|
408
|
-
olympe.C.GC=class{constructor(){this.j=new olympe.C.Xb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.bc(qc,'Last slot manager entry');this.size=gc(olympe.C.bc(olympe.C.aa,'SlotManager size').repeat(this.D.rb().
|
|
409
|
-
class qc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Xb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=gc(olympe.C.bc(olympe.C.aa),olympe.C.aa.ZERO);olympe.C.hb(b)?e.repeat(b):e.update(b);this.j=olympe.C.bc(olympe.C.aa);this.F=this.j.rb().ce(e.rb())});this.next=null}T(){return this.id}xy(){return this.j.rb()}
|
|
410
|
-
this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=qc.prototype;m.T.K=olympe.C.J.j;m.xy.K=new olympe.C.J(()=>olympe.C.aa);m.
|
|
408
|
+
olympe.C.GC=class{constructor(){this.j=new olympe.C.Xb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.bc(qc,'Last slot manager entry');this.size=gc(olympe.C.bc(olympe.C.aa,'SlotManager size').repeat(this.D.rb().hn()),olympe.C.aa.ZERO);this.N=gc(olympe.C.bc(olympe.C.aa,'last valid slots'),olympe.C.ra(-1))});this.R=[];this.H=[];this.j.onDestroy(()=>{pc(this)})}};
|
|
409
|
+
class qc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Xb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=gc(olympe.C.bc(olympe.C.aa),olympe.C.aa.ZERO);olympe.C.hb(b)?e.repeat(b):e.update(b);this.j=olympe.C.bc(olympe.C.aa);this.F=this.j.rb().ce(e.rb())});this.next=null}T(){return this.id}xy(){return this.j.rb()}hn(){return this.F}Dd(){return this.H}Hy(){return this.N}Nz(a){this.H=a}Az(a){null===a?this.j.update(olympe.C.aa.ZERO):(this.j.repeat(a.hn()),a.next=this)}qu(){this.j.clear();
|
|
410
|
+
this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=qc.prototype;m.T.K=olympe.C.J.j;m.xy.K=new olympe.C.J(()=>olympe.C.aa);m.hn.K=new olympe.C.J(()=>olympe.C.aa);m.Dd.K=olympe.C.J.j;m.Hy.K=olympe.C.J.j;m.Nz.K=olympe.C.J.j;m.Az.K=olympe.C.J.j;m.qu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.C.U.$p,Number.POSITIVE_INFINITY);E(a,olympe.C.P.Ca,[olympe.ja.P.Da],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Ca],a=>{olympe.C.bx(a)},'olympe.df');olympe.host={};const rc=new Map,sc=new Map;olympe.host.eq=class{static register(a,b,...c){rc.set(a,b);0<c.length&&sc.set(a,c)}static create(a,b,c,d){const e=rc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=sc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ra(d,f))):new e(b,c)}};function tc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.eq.create(c,b,a.G,a.H))}function uc(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ja.yb.j.Xf&&a.G.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.C.hb(f))b.push(a.j.get(f.Aw)||null);else if('function'===typeof f){const g=f,h=olympe.C.Xa();b.push((...k)=>{h.gb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
|
|
411
411
|
function vc(a){var b=olympe.host.Je.Ad,c=olympe.host.Je.cq.Dr;++a.F;const d=a.F;tc(a,d,c);const e=olympe.C.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.D.has(l)&&this.D.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.C.hb(p)?(h.push(n),p=p.Ba):olympe.C.Rf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{uc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
|
|
412
412
|
{uc(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.D.set(l,f),f.onDestroy(()=>this.D.delete(l)));return null}.bind(a));e.Td(a.N.bind(a,d));a=M(e);a.Aw=d;L(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.G=a;this.H=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}ab(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Od=class{constructor(a){this.j=a;this.D=olympe.C.Xa()}F(){return this.j}gd(){return this.j.Ba.gd()||this.D.gd()}gb(){return this.j.Ba.gb()}};olympe.host.Od.prototype.F.K=new olympe.C.J(()=>olympe.host.Je.Od,[]);olympe.host.Ck=class{j(){}D(){}};olympe.host.Xt=class{};function wc(a,b){var c=olympe.host.Vf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onTimeout context');c.j.Y(b,d,()=>{e.gb()||e.gd()||e.run(a);c.j.F(d)});return new olympe.host.Ad.D(c.j,d,e)}function xc(a,b){var c=olympe.host.Vf;const d=olympe.V.Ic(),e=new olympe.C.Xb('onInterval context');c.j.R(b,d,()=>{e.gb()||e.gd()?c.j.D(d):e.run(a)})}olympe.host.Ad=class{constructor(a){this.j=vc(a)}};olympe.host.Ad.j=class{constructor(a,b,c){this.Vf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
|
|
413
413
|
olympe.host.Ad.H=class extends olympe.host.Ad.j{cancel(){this.Vf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.D=class extends olympe.host.Ad.j{cancel(){this.Vf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ad.F=class extends olympe.host.Ad.j{cancel(){this.Vf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Ee=class{F(a,b){return null!=b?b:''}Ga(a,b){return null!=b?b:''}ua(a,b){return null!=b?b:''}R(){}j(a,b){return null!=b?b:''}D(){}};olympe.host.Ee.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Je={};olympe.host.Je.Od=class{destroy(){}};olympe.host.Je.Od.prototype.destroy=olympe.host.Je.Od.prototype.destroy;olympe.host.Je.cq={Uz:100,Wz:101,Vz:102,Yz:103,Xz:104,Tz:105,xC:201,vC:202,sC:204,AC:205,rC:206,uC:207,yC:208,BC:209,CC:210,DC:211,tC:212,zC:218,wC:219,EC:220,qC:221,pC:222,LC:300,MC:301,NC:302,RC:303,SC:304,TC:305,OC:310,PC:311,QC:312,SB:400,TB:401,UB:402,HB:450,AB:500,yB:501,DB:502,CB:503,zB:504,BB:505,lD:600,cD:601,gD:602,ZC:603,$C:604,XC:605,bD:606,rD:607,jD:608,UC:609,YC:610,aD:611,iD:612,nD:613,VC:614,mD:615,hD:616,qD:617,dD:618,eD:619,fD:620,kD:630,WC:631,oD:632,pD:633,XD:700,AD:701,BD:702,
|
|
414
414
|
CD:703,ED:704,FD:705,GD:706,DD:707,ID:708,HD:709,JD:710,ND:711,VD:712,KD:713,LD:714,OD:715,PD:716,RD:717,SD:718,UD:719,QD:720,TD:721,WD:722,MD:723,YD:724,ZD:725,Dr:800};olympe.host.Je.Ad=class{N(){}Y(){}F(){}R(){}D(){}};olympe.host.P={yk:'host.System',qp:'host.HistoryManager',ar:'host.Scheduler',Ca:'host.platform.Logger',Da:'host.Manager',Ue:'host.ProcessManager'};olympe.host.U={sk:'role',rp:'host.currentHost',yq:'host.processProbe',gr:'host.gracefulShutdownTimeout'};olympe.host.Pg={il:'active',Hh:'preview'};olympe.host.Vf=null;
|
|
415
415
|
olympe.W.config(function(a){var b,c;const d='object'===typeof window&&(null==(b=window)?void 0:null==(c=b.location)?void 0:c.hostname)||'127.0.0.1';Ua(a,olympe.host.U.rp,d);b=olympe.host.Pg.il;c=olympe.host.Pg.Hh;F(a,olympe.host.U.sk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.yk);Xa(a,olympe.host.P.qp);D(a,olympe.host.P.Ue,olympe.host.Ee);E(a,olympe.host.P.Ca,[olympe.ja.P.Da],e=>e.cd('host'));D(a,olympe.host.P.Da,olympe.host.Ta,olympe.host.P.Ca,olympe.W.P.xg);E(a,olympe.host.P.ar,[olympe.host.P.Da],
|
|
416
|
-
e=>{null===olympe.host.Vf&&(olympe.host.Vf=new olympe.host.Ad(e));return olympe.host.Vf},!0)},'olympe.host');olympe.W.run([olympe.host.P.ar],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.P.Da],a=>a,'olympe.host');olympe.W.run([olympe.host.P.Ue],a=>{olympe.host.Tk=()=>a});olympe.net={};olympe.net.wa={};olympe.net.wa.Nd={Gh:'POST',GET:'GET',Ut:'HEAD',zq:'PUT',Dc:'DELETE',oq:'OPTIONS',VB:'PATCH'};olympe.net.wa.ResponseType={ur:'text',JSON:'json',pl:'blob',Oh:'uint8array',ge:'stream'};olympe.net.wa.Headers={wi:'content-type',hA:'content-length',
|
|
417
|
-
olympe.net.wa.Al={jB:'text/html',JSON:'application/json',zw:'application/zip',ge:'application/octet-stream'};olympe.net.wa.Vb={
|
|
416
|
+
e=>{null===olympe.host.Vf&&(olympe.host.Vf=new olympe.host.Ad(e));return olympe.host.Vf},!0)},'olympe.host');olympe.W.run([olympe.host.P.ar],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.P.Da],a=>a,'olympe.host');olympe.W.run([olympe.host.P.Ue],a=>{olympe.host.Tk=()=>a});olympe.net={};olympe.net.wa={};olympe.net.wa.Nd={Gh:'POST',GET:'GET',Ut:'HEAD',zq:'PUT',Dc:'DELETE',oq:'OPTIONS',VB:'PATCH'};olympe.net.wa.ResponseType={ur:'text',JSON:'json',pl:'blob',Oh:'uint8array',ge:'stream'};olympe.net.wa.Headers={wi:'content-type',hA:'content-length',Wn:'authorization',$s:'access-control-allow-origin',Ys:'access-control-allow-headers',Zs:'access-control-allow-methods',ap:'x-forwarded-host',bp:'x-forwarded-proto'};
|
|
417
|
+
olympe.net.wa.Al={jB:'text/html',JSON:'application/json',zw:'application/zip',ge:'application/octet-stream'};olympe.net.wa.Vb={mo:0,Eh:200,oo:201,Fj:202,nl:400,nw:401,Zo:403,hm:404,EB:405,Vi:500,Pv:503};function yc(a){return a.host&&encodeURI(a.host)}function zc(a){return encodeURI(a.path).replace(olympe.net.dj.j,(b,c)=>'%'+c)}olympe.net.dj=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.D=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.D=d)}j(){return`${(void 0===this.D?443===this.port:this.D)?'wss':'ws'}://${yc(this)}:${this.port}/${zc(this)}`}toString(){return`${yc(this)}:${this.port}/${zc(this)}`}};
|
|
418
418
|
olympe.net.dj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}da(){}$(){}Y(){}D(){}};function N(a,b,c,d){a=olympe.V.nz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Fi(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=bb(olympe.V.ef(),`${c[0]}:${c[1]}`),Ac(b,{Authorization:`Basic ${c}`})));return b}function Bc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Cc(a,b){a.F=b;return a}function Ac(a,b){Object.assign(a.headers,b)}
|
|
419
419
|
olympe.net.Fi=class extends olympe.net.dj{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.wa.Nd.GET;this.query=h;this.headers={};this.body=f;this.F=null!=g?g:olympe.net.wa.ResponseType.ur}qj(){return this.headers}j(){let a=Bc(this);a=a?`?${a}`:'';if(!yc(this))return`${zc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.D?443===this.port:this.D)?'https':'http'}://${yc(this)}${b}/${zc(this)}${a}`}toString(){return this.j()}};
|
|
420
420
|
olympe.net.Fi.Nd={Gh:'POST',GET:'GET',Ut:'HEAD',zq:'PUT',Dc:'DELETE',oq:'OPTIONS'};olympe.net.ld=class{constructor(a,b,c,d){this.data=a;this.status=null!=b?b:200;this.statusText=null!=c?c:'';this.headers=null!=d?d:{}}getData(){return this.data}Hc(){return this.status}qj(){return this.headers}};function Dc(a,b){if(!b)throw Error('Try to send an invalid HTTP request: '+b);a.G.debug('SEND HTTP '+b.method+' to '+b.j());const c=a.F++,d=olympe.C.Xa(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Ec(a.j,c,b).finally(()=>{d.Tf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.re.Yt(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.N()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}H(){}Sf(){}N(){}};function Fc(a){let b;return!(null==(b=a.j)||!b.connected)&&a.H}function Gc(a){if(!a.D)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.D.vhost}:${a.D.username}`,password:a.D.password});return Object.assign({},a.D,b(),{transformWsUrl:(c,d)=>{null!==a.D&&Object.assign(d,b());return c}})}
|
|
@@ -424,34 +424,34 @@ Gc(this)),this.j.on(olympe.net.zf.j.Yu,(b,c)=>{this.G.j()&&this.G.debug(`MQTT <
|
|
|
424
424
|
b);this.$.forEach(c=>c(b))}),this.j.on(olympe.net.zf.j.Ae,()=>{this.G.info('Mqtt client is offline');this.da.forEach(b=>b())}),this.j.on(olympe.net.zf.j.rt,()=>{this.G.info('Mqtt client is closed');this.R.forEach(b=>b())}),this.j.on(olympe.net.zf.j.bg,()=>{this.G.info('Mqtt client has ended')}));return this}publish(a,b,c){if(!Fc(this))return Promise.reject(Error('Cannot publish message because the MQTT client is disconnected'));const d=JSON.stringify(b);this.G.j()&&this.G.debug(`MQTT > ${d}`);return new Promise((e,
|
|
425
425
|
f)=>{this.j.publish(a,d,c,g=>{g?f(Error('Failed to publish a message '+d)):e()})})}subscribe(a,b){if(!Fc(this))return Promise.reject(Error('Cannot subscribe because the MQTT client is disconnected'));this.G.debug(`MQTT subscribe to topic ${a}`);return new Promise((c,d)=>{this.j.subscribe(a,void 0,e=>{e?d(Error(`Failed to subscribe to topic ${a}: ${e}`)):(this.F.set(a,b),c())})})}end(a,b){this.H=!1;this.F.clear();this.j?this.j.end(a,{},()=>{this.j=null;null==b||b()}):null==b||b();return this}};
|
|
426
426
|
olympe.net.zf.j={st:'connect',Dv:'reconnect',Yu:'message',rt:'close',bg:'end',Ab:'error',Ae:'offline'};olympe.net.Rh=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}H(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}F(){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.')}};
|
|
427
|
-
olympe.net.Rh.ALL='*';olympe.net.aw=class{register(){return w(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Da:'net.Manager',Ca:'net.Logger',cj:'net.WebServer',Tv:'net.ServiceWorkerManager',
|
|
428
|
-
olympe.W.config(function(a){F(a,olympe.net.U.wf,3141);F(a,olympe.net.U.up,100);F(a,olympe.net.U.Cr,!1);F(a,olympe.net.U.tp,null);F(a,olympe.net.U.
|
|
427
|
+
olympe.net.Rh.ALL='*';olympe.net.aw=class{register(){return w(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Da:'net.Manager',Ca:'net.Logger',cj:'net.WebServer',Tv:'net.ServiceWorkerManager',km:'net.OfflineConfig'};olympe.net.U={wf:'net.httpPort',up:'net.httpBodyLimit',Cr:'net.http2',tp:'net.httpsCertificatesPath',bm:'net.localNetworkSuffix',Qi:'offline.enabled',jm:'offline.autoBackOnline',nq:'offline.downloadBatchSize'};
|
|
428
|
+
olympe.W.config(function(a){F(a,olympe.net.U.wf,3141);F(a,olympe.net.U.up,100);F(a,olympe.net.U.Cr,!1);F(a,olympe.net.U.tp,null);F(a,olympe.net.U.bm,'frontend');F(a,olympe.net.U.Qi,!1);F(a,olympe.net.U.jm,!1);F(a,olympe.net.U.nq,20);Xa(a,olympe.net.P.Da);E(a,olympe.net.P.Ca,[olympe.ja.P.Da],b=>b.cd('net'));D(a,olympe.net.P.cj,olympe.net.Rh,olympe.net.P.Ca);D(a,olympe.net.P.Tv,olympe.net.aw);E(a,olympe.net.P.km,[new olympe.W.pa(olympe.net.U.Qi),new olympe.W.pa(olympe.net.U.jm)],(b,c)=>new Map([['offlineEnabled',
|
|
429
429
|
b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Od=function(a,b){this.G=b};olympe.Va.node.host.Od.prototype.constructor=olympe.Va.node.host.Od;olympe.Va.node.host.Od.prototype.destroy=function(){};olympe.Va.node.host.Od.prototype.destroy=olympe.Va.node.host.Od.prototype.destroy;olympe.Va.node.host.Od.prototype.ab=function(){return this.G};olympe.Va.node.host.Od.xa=[olympe.host.Je.Od];olympe.Va.node.host.fq=class{constructor(a){this.G=a}};olympe.Va.node.host.fq.xa=[olympe.host.Xt];olympe.Va.node.host.Ad=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}Y(a,b,c){this.j[b]=setTimeout(c,a)}F(a){clearTimeout(this.j[a]);delete this.j[a]}R(a,b,c){this.H[b]=setInterval(c,a)}D(a){clearInterval(this.H[a]);delete this.H[a]}};olympe.host.eq.register(olympe.host.Je.cq.Dr,olympe.Va.node.host.Ad);olympe.Va.node.host.Ad.xa=[olympe.host.Je.Ad];olympe.Va.node.host.Ck=class{constructor(a){this.G=a}j(){return olympe.C.ea.D}D(){return!0}};olympe.Va.node.host.Ck.xa=[olympe.host.Ck];function Lc(a){a.ha.F('readinessProbe','/readiness',[olympe.net.wa.Nd.GET],()=>Mc(a,a.da)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.ha.F('livenessProbe','/liveness',[olympe.net.wa.Nd.GET],()=>Mc(a,a.$)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.F(()=>a.ha.stop())}
|
|
430
|
-
function Nc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.V.Promise.
|
|
430
|
+
function Nc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.V.Promise.Jn(d(),a.$a,`Shutdown hook ${c} has timeout`));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.G.warn(`Failed to close some resource: ${e.reason}`));return d})}function Oc(a){return w(function*(){try{const b=yield Nc(a,a.H),c=yield Nc(a,a.N),d=yield Nc(a,a.Y);if(b||c||d)throw Error('Failed to gracefully close the backend');}finally{a.H.clear(),a.N.clear(),a.Y.clear()}})}
|
|
431
431
|
function Mc(a,b){const c=olympe.net.wa.Vb.Eh,d=olympe.net.wa.Vb.Vi;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.ld('No healthCheck is set',c,'Nothing to check')):Promise.allSettled(b).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.G.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.ld(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
|
|
432
432
|
olympe.Va.node.host.Ee=class extends olympe.host.Ee{constructor(a,b,c,d=!0){super();this.G=a;this.ha=b;this.$a=c;this.$=new Map;this.da=new Map;this.N=new Map;this.H=new Map;this.Y=new Map;d&&Lc(this)}j(a,b=olympe.V.df(),c=olympe.host.Ee.j.ALL){switch(c){case olympe.host.Ee.j.LIVENESS:this.$.set(b,a);break;case olympe.host.Ee.j.READINESS:this.da.set(b,a);break;default:this.$.set(b,a),this.da.set(b,a)}return b}D(a){this.da.delete(a);this.$.delete(a)}F(a,b=olympe.V.df()){this.N.set(b,a);return b}Ga(a,
|
|
433
|
-
b=olympe.V.df()){this.H.set(b,a);return b}ua(a,b=olympe.V.df()){this.Y.set(b,a);return b}R(a){this.N.has(a)?this.N.delete(a):this.H.has(a)?this.H.delete(a):this.Y.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.yq,!0);F(a,olympe.host.U.gr,1E4);Va(a,olympe.host.P.qp,olympe.Va.node.host.fq,olympe.host.P.Ca);Va(a,olympe.host.P.yk,olympe.Va.node.host.Ck,olympe.host.P.Ca);D(a,olympe.host.P.Ue,olympe.Va.node.host.Ee,olympe.host.P.Ca,olympe.net.P.cj,new olympe.W.pa(olympe.host.U.gr),new olympe.W.pa(olympe.host.U.yq))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Ue],a=>{olympe.Va.node.host.Tk=()=>a});olympe.net.re={};function Ec(a,b,c){const d=olympe.net.wa.Vb.
|
|
433
|
+
b=olympe.V.df()){this.H.set(b,a);return b}ua(a,b=olympe.V.df()){this.Y.set(b,a);return b}R(a){this.N.has(a)?this.N.delete(a):this.H.has(a)?this.H.delete(a):this.Y.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.yq,!0);F(a,olympe.host.U.gr,1E4);Va(a,olympe.host.P.qp,olympe.Va.node.host.fq,olympe.host.P.Ca);Va(a,olympe.host.P.yk,olympe.Va.node.host.Ck,olympe.host.P.Ca);D(a,olympe.host.P.Ue,olympe.Va.node.host.Ee,olympe.host.P.Ca,olympe.net.P.cj,new olympe.W.pa(olympe.host.U.gr),new olympe.W.pa(olympe.host.U.yq))},'olympe.native.node.host');olympe.W.run([olympe.host.P.Ue],a=>{olympe.Va.node.host.Tk=()=>a});olympe.net.re={};function Ec(a,b,c){const d=olympe.net.wa.Vb.mo,e=olympe.net.wa.Vb.Vi,f=new AbortController;a.j.set(b,()=>f.abort());const g=c.j(),h=c.method;let k;return fetch(g,{method:h,headers:c.qj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?Pc(l,c.F).catch(n=>new olympe.net.ld(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.ld(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
|
|
434
434
|
l.name?new olympe.net.ld('',d,'Request canceled'):new olympe.net.ld(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
|
|
435
435
|
function Pc(a,b){return w(function*(){switch(b){case olympe.net.wa.ResponseType.pl:var c=yield a.blob();break;case olympe.net.wa.ResponseType.Oh:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.wa.ResponseType.JSON:c=yield a.json();break;case olympe.net.wa.ResponseType.ge:c=a.body;break;default:c=yield a.text()}return new olympe.net.ld(c,a.status,a.statusText,a.headers)})}olympe.net.re.Yt=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.re.WebSocket=class{constructor(a,b){this.G=b;this.id=a;this.j=null;this.buffer=[];this.N=this.F=this.H=this.R=null}T(){return this.id}open(a){const b=`#${this.id}`,c=this.ha(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.G.info(`Websocket ${b} OPENED`);this.R?(this.G.debug('Notifying upper layer for WebSocket',b),this.R()):this.G.warn('Nothing to notify for WebSocket',b);this.G.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
|
|
436
436
|
this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):cb(d.data);(this.G.F()||this.G.j()&&!d.startsWith('pong'))&&this.G.debug(b,'<',d);this.F&&this.F(d)});c.addEventListener('close',()=>{this.G.info(`WebSocket ${b} CLOSED`);this.H&&this.H()});c.addEventListener('error',()=>{this.G.debug(`WebSocket ${b} ERROR`);this.N&&this.N()});this.j=c}send(a){const b=`#${this.id}`;if(null!==this.j){const c=this.j.constructor;switch(this.j.readyState){case c.OPEN:(this.G.F()||
|
|
437
437
|
this.G.j()&&!a.startsWith('ping'))&&this.G.debug(b,'>',a);this.j.send(a);break;case c.CONNECTING:this.G.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.G.debug(b,'- Closed','>',a),!1}}else this.G.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.j){const a=this.j.constructor,b=this.j.readyState;if(b===a.OPEN||b===a.CONNECTING){this.G.debug(`Force closing native websocket ${`#${this.id}`}`);this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}da(a){this.R=
|
|
438
|
-
a||null}$(a){this.F=a||null}D(a){this.N=a||null}Y(a){this.H=a||null}ha(){}};olympe.net.re.WebSocket.xa=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.ev=class extends olympe.net.Ta{N(){return'NodeJS'}Sf(){return olympe.C.ea.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Va.node.net.fv(b,this.G);b.open(a);return b}H(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}};olympe.Va.node.net.fv=class extends olympe.net.re.WebSocket{ha(a){return new (require('ws'))(a)}};olympe.Va.node.net.U={zD:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.Qi)&&Ua(a,olympe.net.U.Qi,!1);Va(a,olympe.net.P.Da,olympe.Va.node.net.ev,olympe.net.P.Ca,olympe.host.P.Da)},'olympe.native.node.net');olympe.Va.node.net.http={};const Qc=require('fastify'),{Readable:Rc}=require('stream'),Sc={xk:0,wk:1,
|
|
438
|
+
a||null}$(a){this.F=a||null}D(a){this.N=a||null}Y(a){this.H=a||null}ha(){}};olympe.net.re.WebSocket.xa=[olympe.net.WebSocket];olympe.Va.node.net={};olympe.Va.node.net.ev=class extends olympe.net.Ta{N(){return'NodeJS'}Sf(){return olympe.C.ea.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Va.node.net.fv(b,this.G);b.open(a);return b}H(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}};olympe.Va.node.net.fv=class extends olympe.net.re.WebSocket{ha(a){return new (require('ws'))(a)}};olympe.Va.node.net.U={zD:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.Qi)&&Ua(a,olympe.net.U.Qi,!1);Va(a,olympe.net.P.Da,olympe.Va.node.net.ev,olympe.net.P.Ca,olympe.host.P.Da)},'olympe.native.node.net');olympe.Va.node.net.http={};const Qc=require('fastify'),{Readable:Rc}=require('stream'),Sc={xk:0,wk:1,Am:2},Tc=olympe.net.wa.Nd.oq,Uc=olympe.net.wa.Headers.$s,Vc=olympe.net.wa.Headers.Ys,Wc=olympe.net.wa.Headers.Zs,Xc=olympe.net.wa.Vb.Eh;
|
|
439
439
|
function Yc(a,b){const c=b.methods,d=b.Cy,e=b.headers,f=b.origin;a.D.route({bodyLimit:a.$<<20,url:b.path,method:[...c,Tc],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[Uc]:f,[Wc]:c,[Vc]:e};if(k===Tc)return a.G.debug('< HTTP: OPTIONS'),h.code(Xc).headers(l).send();var n=g.body;if(n instanceof Buffer){var p=new Uint8Array(n.length);n.copy(p)}else if('string'===typeof n||n instanceof Object)p=n;const [q,r]=g.hostname.split(':');k=
|
|
440
440
|
new olympe.net.Fi(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,u]of Object.entries(g.headers))k.headers[t]=u;a.G.debug('< HTTP:',k.toString());n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));return d(k,n,g).then(t=>{const u=t.Hc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof Rc)&&h.type(olympe.net.wa.Al.ge);if(u>=olympe.net.wa.Vb.Vi)throw Error(x);u>=olympe.net.wa.Vb.nl?a.G.warn('> HTTP: client bad request: reply with error:',
|
|
441
441
|
x):a.G.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(u).headers(Object.assign(l,t.qj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.wa.Vb.Vi).headers(Object.assign(l,{[olympe.net.wa.Headers.wi]:'text/plain'})).send('Internal server error')})}})}
|
|
442
442
|
olympe.Va.node.net.http.Rh=class extends olympe.net.Rh{constructor(a,b,c,d,e){super(a);this.$=c;this.port=b;this.da=d;this.R=e;this.D=this.createServer();this.N=new Map;this.j=Sc.xk;this.hd=new Set;this.timer=null}F(a,b,c,d){const e=olympe.net.Rh.ALL;this.N.set(a,{path:b,methods:c,Cy:d,headers:e,origin:e});return this.H()}Y(a){const b=this;return w(function*(){b.N.delete(a);return 0<b.N.size?b.H():b.stop()})}start(){if(this.j===Sc.xk)return this.H();if(this.j===Sc.wk){for(const a of this.N.values())Yc(this,
|
|
443
|
-
a);return this.D.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.j=Sc.
|
|
444
|
-
yield c.D.close();c.D=c.createServer();yield c.start()})})})}stop(){return this.j===Sc.
|
|
443
|
+
a);return this.D.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.j=Sc.Am;this.G.debug('Web server listening on '+a);this.hd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.hd.forEach(b=>b(a))}).finally(()=>this.hd.clear())}return Promise.reject('Try to start a webservice already started')}H(){return this.j===Sc.wk?(new Promise((a,b)=>{this.hd.add(c=>c?b(c):a())})).then(()=>this.H()):new Promise((a,b)=>{this.hd.add(c=>c?b(c):a());this.jj(()=>{const c=this;return w(function*(){c.j=Sc.wk;
|
|
444
|
+
yield c.D.close();c.D=c.createServer();yield c.start()})})})}stop(){return this.j===Sc.Am?this.D.close().then(()=>{this.j=Sc.xk}):Promise.resolve()}createServer(){var a=olympe.ja.yb.j.Gr,b=this.G.H();a={logger:{level:olympe.ja.yb.D[b===olympe.ja.yb.j.ak?a:b].toLowerCase()},http2:this.da};if('string'===typeof this.R){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.R,'key.pem')),cert:b.readFileSync(c.join(this.R,'cert.pem'))}})}a=Qc(a);a.addContentTypeParser('*',
|
|
445
445
|
{parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}jj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.P.cj,olympe.Va.node.net.http.Rh,olympe.net.P.Ca,new olympe.W.pa(olympe.net.U.wf),new olympe.W.pa(olympe.net.U.up),new olympe.W.pa(olympe.net.U.Cr),new olympe.W.pa(olympe.net.U.tp))},'olympe.native.node.net.http');olympe.Va.node.V={};const $c=require('stream').Readable,ad=require('buffer');
|
|
446
446
|
olympe.Va.node.V.sl=class extends olympe.V.sl{D(a){return new Uint8Array(Buffer.from(a,'base64'))}j(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}H(a){const b=this,c=()=>super.H;return w(function*(){if(a instanceof $c){const d=[];for(const e=fa(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}F(a){return Promise.resolve().then(()=>ad.resolveObjectURL(a)).catch(b=>
|
|
447
447
|
{throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Va(a,olympe.V.P.vg,olympe.Va.node.V.sl)},'olympe.native.node.utils');olympe.async={};function bd(a,b){a.H||a.Y.push(a.F.rc(b))}
|
|
448
|
-
olympe.async.
|
|
448
|
+
olympe.async.Uo=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||new olympe.C.Xb('Async executor context');this.ha=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.H=this.N=!1;this.G=null;this.timer=this.timeout=0;this.$=olympe.V.Ic()}Jn(a){0<=a&&(this.timeout=a);return this}ab(){return this.G}add(a){this.H||this.D.push(this.F.rc(a));return this}start(){this.N||(this.G&&this.G.log('Executor started.'),this.N=!0,this.F.onDestroy(()=>{this.j='Context destroyed.';this.complete(!1)},
|
|
449
449
|
this.$),0<this.timeout&&(this.timer=setTimeout(()=>{this.j='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.D=[];this.Y=[];this.env.clear();this.ha&&this.F.destroy()}complete(a){this.F.Tf(this.$);if(!this.H){this.H=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.G&&this.G.log(a?'Executor completed successfully':`Executor completed with error: ${this.j}`);for(const b of this.Y)b(a,a?null:this.j,this.env);this.clear()}}getContext(){return this.F}};
|
|
450
|
-
function cd(a){if(0<a.D.length){const b=a.D.shift();a.G&&a.G.log(`Executing next task. ${a.D.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{cd(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.$v=class extends olympe.async.
|
|
451
|
-
olympe.async.mk=class extends olympe.async.
|
|
452
|
-
0<this.D.length){this.R=this.D.length;for(const a of this.D)this.run(a)}else this.complete(!0)}};olympe.Eb={};olympe.Eb.Lu=class{D(){return w(function*(){})}Y(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}da(){}$(){}clear(){}H(){}};olympe.Eb.Mu=class{D(){}};olympe.Eb.Storage=class{open(){}write(){}close(){}};olympe.Eb.Vu=class{get(){return null}set(){return this}delete(){}};olympe.Eb.P={bk:'localStorage.KeyValueDatabaseManager',Wi:'localStorage.Storage',lA:'localStorage.DatacloudStorage',
|
|
453
|
-
olympe.L.errors.
|
|
454
|
-
olympe.W.config(a=>{F(a,olympe.L.Yb.Wj,'rest/filesvc');F(a,olympe.L.Yb.
|
|
450
|
+
function cd(a){if(0<a.D.length){const b=a.D.shift();a.G&&a.G.log(`Executing next task. ${a.D.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{cd(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.$v=class extends olympe.async.Uo{static create(){return new olympe.async.$v(new olympe.C.Xb('SequencedExecutor'),!0)}start(){this.N||(super.start(),cd(this))}};
|
|
451
|
+
olympe.async.mk=class extends olympe.async.Uo{constructor(a,b){super(a,b);this.R=0;this.da=!0}static create(){return new olympe.async.mk(new olympe.C.Xb('ParallelExecutor'),!0)}run(a){this.G&&this.G.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.da=!1;b&&(this.j=this.j?`${this.j}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.N&&!this.H&&(this.R++,this.run(a));return this}done(){this.R--;0>=this.R&&this.complete(this.da)}start(){if(!this.N)if(super.start(),
|
|
452
|
+
0<this.D.length){this.R=this.D.length;for(const a of this.D)this.run(a)}else this.complete(!0)}};olympe.Eb={};olympe.Eb.Lu=class{D(){return w(function*(){})}Y(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}da(){}$(){}clear(){}H(){}};olympe.Eb.Mu=class{D(){}};olympe.Eb.Storage=class{open(){}write(){}close(){}};olympe.Eb.Vu=class{get(){return null}set(){return this}delete(){}};olympe.Eb.P={bk:'localStorage.KeyValueDatabaseManager',Wi:'localStorage.Storage',lA:'localStorage.DatacloudStorage',cm:'localStorage.LocalStorage',Ca:'localStorage.Logger',Sg:'localStorage.prefix'};olympe.W.config(function(a){Xa(a,olympe.Eb.P.bk);E(a,olympe.Eb.P.Sg,[],()=>'olympe');E(a,olympe.Eb.P.Ca,[olympe.ja.P.Da],b=>b.cd('localstorage'));D(a,olympe.Eb.P.cm,olympe.Eb.Vu)},'olympe.localstorage');olympe.L={};olympe.L.errors={};olympe.L.errors.Mo=class extends Error{};olympe.L.errors.tq=class extends Error{};olympe.L.errors.jq=class extends Error{};olympe.L.errors.Dk=class extends Error{};olympe.L.errors.vo=class extends Error{};olympe.L.errors.Wq=class extends Error{};olympe.L.errors.wq=class extends Error{};olympe.L.errors.uw=class extends Error{};olympe.L.errors.Dm=class extends Error{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.L.errors.Oi=class extends olympe.L.errors.Dm{};
|
|
453
|
+
olympe.L.errors.fo=class extends olympe.L.errors.Dm{};olympe.L.errors.pp=class extends olympe.L.errors.Dm{};olympe.L.Yb={Wj:'urls.FileSvc',Xn:'urls.BackupSvc',Nq:'urls.RestoreBackupSvc',Cg:'urls.GetContext',lp:'urls.GraphDef',io:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',Br:'urls.UserTagFromToken',tw:'urls.UserNameFromTag',sw:'urls.UserRoles',Iv:'urls.RoleMembers',fk:'urls.OpenIDSvc'};
|
|
454
|
+
olympe.W.config(a=>{F(a,olympe.L.Yb.Wj,'rest/filesvc');F(a,olympe.L.Yb.Xn,'rest/backupsvc');F(a,olympe.L.Yb.Nq,'rest/backupsvc/restore');F(a,olympe.L.Yb.fk,'rest/openid');F(a,olympe.L.Yb.Cg,'rest/initialData');F(a,olympe.L.Yb.lp,'rest/querysvc/graphDef');F(a,olympe.L.Yb.io,'rest/querysvc/graphDef/static');F(a,olympe.L.Yb.TRANSACTION,'rest/transaction');F(a,olympe.L.Yb.Br,'rest/token');F(a,olympe.L.Yb.tw,'rest/authorization/getUserTag');F(a,olympe.L.Yb.sw,'rest/authorization/getUserRoles');F(a,olympe.L.Yb.Iv,
|
|
455
455
|
'rest/authorization/roleMembers')});function dd(a){Ic(a.D,()=>{ed(a)});Kc(a.D,()=>{a.$=!0});Jc(a.D,()=>{fd(a).then(()=>{a.$=!1;gd(a)}).catch(b=>{a.G.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${b}`);a.D.end()})})}function hd(a){return id(a.Mb)&&Fc(a.D)}
|
|
456
456
|
function jd(a,b,c){return w(function*(){hd(a)||(yield a.connect());a.G.debug(`Bus: Subscribe to ${b}`);a.da.set(b,c);yield a.D.subscribe(a.ha+b,d=>{a.G.j()&&a.G.debug(`BUS < #${b}:`,JSON.stringify(d));let e=null;try{if(kd(a,d.seq,'consumed'),e=olympe.L.zk.D(d,a.$a,f=>ld(a,d.src,f).stream),kd(a,e.ee.toString(),'deserialized',(new Map).set('source',e.sb()).set('messageType',e.getType().toString())),e.getType()===olympe.L.cb.j.ge){md(a,e);return}}catch(f){a.G.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)} with error ${f}`)}null!==
|
|
457
457
|
e&&c(e)})})}function ed(a){a.G.info('Disconnected from bus');let b;null==(b=a.j)||b.forEach((c,d)=>{null!==c.D&&(a.G.info(`Disconnected from bus: pause keep alive of ${c.j.size} subscriptions for ${d} service.`),nd(c))})}
|
|
@@ -461,74 +461,74 @@ function pd(a){a.zc=a.Ga.j(()=>hd(a)?Promise.resolve('Bus connection OK'):Promis
|
|
|
461
461
|
function md(a,b){const c=olympe.L.He.zg,d=olympe.L.He.bg,e=olympe.L.He.Ab,f=b.j,{id:g,e:h}=f,k=`${b.sb()}:${g}`,l=ld(a,b.sb(),g);if(h===c){fb(a.ua.j,k);const {i:n,c:p}=f;l.write(p,n).catch(q=>{l.throw(q)})}else h===d?l.complete(f.s):h===e&&l.throw(Error(`Received stream error: ${f.reason}`))}function qd(a,b,c,d){const e=rd(a.N).Cd();a.Y++;return new olympe.L.zk(b,a.H,e,a.Y,c,d)}
|
|
462
462
|
function sd(a,b,c,d){const e=b.ee;let f=null;f=setTimeout(()=>td(a,e),a.Id);a.F.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.L.cb.j.hl?f=setTimeout(()=>td(a,e),d):(a.F.delete(e),c(g))})}function td(a,b){const c=a.F.get(b);a.F.delete(b);null==c||c(new olympe.L.cb(a.H,a.H,b,olympe.L.cb.j.Ab,{reason:'Timeout'}))}function ud(a,b){a.Y++;const c=a.Y,d=setTimeout(()=>td(a,c),a.Id);a.F.set(c,e=>{a.F.delete(c);clearTimeout(d);b(e)});return a.Y}
|
|
463
463
|
function vd(a,b){return w(function*(){let c;const d=null==(c=a.j)?void 0:c.get(b);d&&(nd(d),a.j.delete(b));a.da.delete(b);a.G.debug(`Bus: Unsubscribe to ${b}`);hd(a)&&(yield Hc(a.D,a.ha+b))})}function wd(a,b,c,d,e){null===a.j&&(a.j=new Map);let f=a.j.get(b);f?(a=f,a.F!==d&&(a.F=d,null!==a.D&&(nd(a),od(a,!1)))):(f=new olympe.L.ew(a.G,a,b,d),a.j.set(b,f));d=f;d.j.set(c,e);1===d.j.size&&od(d,!1)}
|
|
464
|
-
function xd(a,b,c){var d;const e=null==(d=a.j)?void 0:d.get(b);if(null==e?0:yd(e,c))d=olympe.L.cb.j.
|
|
465
|
-
olympe.L.
|
|
464
|
+
function xd(a,b,c){var d;const e=null==(d=a.j)?void 0:d.get(b);if(null==e?0:yd(e,c))d=olympe.L.cb.j.Im,hd(a)&&a.publish(qd(a,b,d,c)).catch(f=>a.G.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.j.size&&(a.j.delete(b),0===a.j.size&&(a.j=null))}function zd(a,b){return new Promise((c,d)=>{a.N.hh(b.oe(),(e,f)=>{e?d(e):c(f)})})}
|
|
465
|
+
olympe.L.ho=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Mb=c;this.N=d;this.Ga=e;this.$a=f;this.vc=g;this.F=new Map;this.Id=h.get('shortTimeout');this.Bd=h.get('requestTimeout');this.Rd=h.get('subscriptionsRefreshRate');this.zb=h.get('allowGuest');a=h.get('connection');b=this.N.j.rb().asObservable();c=c.Sf().asObservable();c=rxjs.combineLatest([a,b,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{username:l.Cc(),password:l.Cd()}):null));this.D=new olympe.net.zf(c);dd(this);
|
|
466
466
|
this.ha='';h.get('topicPrefix').subscribe(k=>{this.G.debug(`Bus: new topic prefix: ${k}`);const l=this.ha;this.ha=k;if(hd(this)){this.G.debug(`Resubscribe to queues with new topic prefix: ${k}`);Promise.all(Array.from(this.da).map(([p,q])=>{const r=this;return w(function*(){yield jd(r,p,q);yield Hc(r.D,l+p)})})).catch(p=>this.G.error(`Failed to subscribe topics after changing the topic prefix: ${p}`));let n;null==(n=this.j)||n.forEach(p=>{Ad(p)})}});this.af=this.Y=0;this.H=olympe.V.Ic();this.j=null;
|
|
467
467
|
this.$=!1;this.R=[];this.da=new Map;this.ua=new olympe.V.Nh(this.Bd);this.$c=this.zc='';this.jb=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.R.forEach(e=>e(d));this.R=[]};hd(this)?a():this.$||this.jb?this.R.push(d=>d?b(d):a()):id(this.Mb)?(this.jb=!0,olympe.C.Hs([this.N.Zk()],d=>{pd(this);this.jb=!1;d.valueOf()||this.zb?(this.zb||Bd(this.N,()=>this.disconnect().then()),this.$=!0,this.R.push(e=>e?b(e):a()),this.D.connect(),this.$c=this.Ga.ua(()=>this.disconnect(),'Bus websocket')):
|
|
468
468
|
c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){return new Promise(a=>{this.G.debug('Disconnecting from bus');this.N.$.delete('busLogoutCallback');this.Ga.D(this.zc);this.Ga.R(this.$c);this.D.end(!1,()=>a())})}publish(a,b=!1){const c=this;return w(function*(){if(!c.$||a.getType()!==olympe.L.cb.j.ye){hd(c)||(yield c.connect());var d=b?a.ic():c.ha+a.ic();
|
|
469
469
|
try{kd(c,a.ee.toString(),'serialize');var e=a.ga(c.$a,c.$e.bind(c,a));c.G.j()&&c.G.debug(`BUS > #${d}:`,JSON.stringify(e))}catch(f){throw Error(`An error occurred while serializing the message (seqId=${a.ee}): ${f}`);}yield c.D.publish(d,e);kd(c,a.ee.toString(),'publish',(new Map).set('destination',a.ic()).set('messageType',a.getType().toString()))}})}$e(a,b){const c=this.af++;(()=>{const d=this;return w(function*(){const e=l=>d.publish(new olympe.L.cb(a.ic(),a.sb(),a.ee,olympe.L.cb.j.ge,l)),f=olympe.L.He.zg,
|
|
470
470
|
g=olympe.L.He.bg,h=olympe.L.He.Ab;let k=0;try{for(const l=fa(b);;){const n=yield l.next();if(n.done)break;const p=n.value;yield e({id:c,i:k++,e:f,c:p})}yield e({id:c,s:k,e:g})}catch(l){yield e({id:c,e:h,reason:`Error to complete the stream: ${l}`})}})})();return c}vd(a,b,c){return this.send(a.ee,a.sb(),b,c,!0)}send(a,b,c,d,e){return this.publish(new olympe.L.cb(b,this.H,a,c,d),e)}request(a,b,c,d){const e=qd(this,a,b,c);c=olympe.L.cb.j.hl;if(b===olympe.L.cb.j.PUBLISH){const f=new olympe.L.cb(a,this.H,
|
|
471
|
-
e.ee,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{sd(this,e,f,null!=d?d:this.Bd);this.publish(e).catch(g)})}};olympe.L.
|
|
471
|
+
e.ee,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{sd(this,e,f,null!=d?d:this.Bd);this.publish(e).catch(g)})}};olympe.L.ho.j='Timeout';const Cd=olympe.net.wa.Headers.Wn,Dd=olympe.net.wa.Vb.Eh,Ed=olympe.net.wa.Vb.oo,Fd=olympe.net.wa.Vb.Fj,Gd=olympe.net.wa.Vb.Pv,Hd=olympe.net.wa.Vb.mo,Id=olympe.net.wa.Vb.Zo,Jd=olympe.net.wa.Vb.nw,Kd=olympe.net.wa.Vb.hm;function Ld(a,b){let c;return null!=(c=a.F.get(b))?c:''}function Md(a,b,c,d=new Map){a.j.j&&mb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
|
|
472
472
|
function Nd(a,b,c){if(null===b)return Promise.reject('No http request to send');Ac(b,{[Cd]:c});const d=b.j();return rxjs.firstValueFrom(rxjs.defer(()=>{a.D++;const e=a.D;if(a.G.j()){const f=b.body;a.G.debug('HTTP >',d,`body: ${'string'===typeof f?f:typeof f}`)}Md(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Dc(a.H,b).then(f=>{Md(a,e,'reply');switch(f.Hc()){case Dd:case Ed:case Fd:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Hc(),`content: ${'string'===
|
|
473
473
|
typeof g?g:typeof g}`);return f;case Gd:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.L.errors.wq(f);case Hd:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case Id:case Jd:throw f=`HTTP < request authorization denied: ${b.j()}`,a.G.error(f),new olympe.L.errors.uw(f);case Kd:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.L.errors.jq(f);default:g=`HTTP < Error: ${f.Hc()}, ${f.statusText}`;
|
|
474
|
-
a.G.error(g);if(500===f.Hc()&&'Connection refused'===f.statusText)throw new olympe.L.errors.
|
|
474
|
+
a.G.error(g);if(500===f.Hc()&&'Connection refused'===f.statusText)throw new olympe.L.errors.vo(g);throw Error(g);}})}).pipe(nb(olympe.L.errors.wq,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.Vt=class{constructor(a,b,c,d,e){this.G=a;this.H=b;this.j=c;this.F=null;d.subscribe(f=>{this.F=f});this.N=e;this.D=0}};function O(a,b){if(a.j!==b)switch(a.G.debug('State change '+a.j+' --\x3e '+b),a.j=b,a.Mb.forEach(c=>c(b)),b){case olympe.L.Na.j.Gk:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.Ho:break;case olympe.L.Na.j.wg:a.connected.update(olympe.C.ea.D);break;case olympe.L.Na.j.Mg:a.H=[0,0,a.H[2]];Od(a);break;case olympe.L.Na.j.Ab:let c;a.G.error('Connection to server',null==(c=a.R)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.ea.j);break;case olympe.L.Na.j.Rn:Od(a);break;case olympe.L.Na.j.Wd:a.connected.update(olympe.C.ea.j);
|
|
475
475
|
break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
|
|
476
|
-
function Pd(a){const b=olympe.L.Na.j.
|
|
476
|
+
function Pd(a){const b=olympe.L.Na.j.Rn,c=olympe.L.Na.j.Gk,d=olympe.L.Na.j.Wd,e=zc(a.da);a.G.info(`Trying to wakeup orchestrator with ${e}`);O(a,c);const f=a.vc.D(a.da);f.$(g=>{const h=JSON.parse(g);a.G.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':O(a,b);f.close();break;case 'asleep':a.G.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');O(a,c);break;case 'waking-up':break;default:a.G.warn(`Invalid message from ${e}: ${g}`),f.close(),
|
|
477
477
|
O(a,d)}});f.D(()=>{a.G.warn(`Communication with ${e} failed.`);f.close();O(a,d)});f.da(()=>{a.G.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
|
|
478
|
-
function Qd(a,b,c){a.G.log('Initializing COMMUNICATION layer');if(a.G.j()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.G.debug(d.join('\n\t'))}Rd(a,olympe.L.ze.Ab,d=>{switch(d.c){case olympe.L.Mi.pw:a.G.error('Unknown message sent to the server:',olympe.L.Na.oc[d.s]);break;case olympe.L.Mi.Nt:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.F.forEach((e,f)=>{null!==e.
|
|
478
|
+
function Qd(a,b,c){a.G.log('Initializing COMMUNICATION layer');if(a.G.j()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.G.debug(d.join('\n\t'))}Rd(a,olympe.L.ze.Ab,d=>{switch(d.c){case olympe.L.Mi.pw:a.G.error('Unknown message sent to the server:',olympe.L.Na.oc[d.s]);break;case olympe.L.Mi.Nt:a.G.error('Fatal error, the last message is probably too big according to the websocket config.'),a.F.forEach((e,f)=>{null!==e.zn&&Sd(a,f,d.i)})}});Rd(a,olympe.L.ze.oc,d=>
|
|
479
479
|
{d.c===olympe.L.Mi.Cv&&'boolean'===typeof d.a&&a.ci.update(olympe.C.Sb(d.a))});olympe.C.uj(a.connected,()=>{let d=!1;olympe.C.uj(a.jb.j(),()=>{d&&(a.$c(),a.zb(),d=!1);xc(a.$c.bind(a),a.Rd);xc(a.zb.bind(a),a.Ga)},()=>{a.H=[0,0,a.H[2]];d=!0})},()=>{a.Y=null;wc(a.zb.bind(a),a.Ga)});c.j(()=>Td(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.j}`));c.ua(()=>a.disconnect(),'Orchestrator websocket');hb(a.N,(d,e)=>{e.throw(Error('Stream timeout'))});
|
|
480
480
|
a.G.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function Td(a){return a.j===olympe.L.Na.j.wg}function Ud(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Mb.delete(e),c(f)};a.Mb.add(e);e(a.j)}function Vd(a,b,c,d,e){a.ha.j&&mb(a.ha,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
|
|
481
481
|
function Od(a){const b=olympe.L.Na.j.INIT,c=olympe.L.Na.j.CONNECTING,d=olympe.L.Na.j.wg,e=olympe.L.Na.j.Wd,f=olympe.L.Na.j.Mg,g=olympe.L.Na.j.Gk,h=olympe.L.Na.j.Ab;if(null===a.R)a.G.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),O(a,e);else{null!==a.D&&(a.D.Y(null),a.D.close());var k,l;a.G.log(`Asking NET layer for a connection to ${null==(k=a.R)?void 0:yc(k)}:${null==(l=a.R)?void 0:l.port}...`);a.D=a.vc.D(a.R);a.D.da(a.$e.bind(a));a.D.$(a.$h.bind(a));
|
|
482
|
-
a.D.Y(()=>{a.D=null;a.j===d?O(a,f):a.j!==h&&a.j!==g&&O(a,e)});a.da&&a.j===b&&a.D.D(()=>{a.D.D(null);a.j===c&&Pd(a);a.da=null});a.j!==f&&O(a,c)}}function Wd(a,b,c,d){const e=a.af;a.af++;c={message:{seqId:e,messageFamily:b,payload:c},
|
|
482
|
+
a.D.Y(()=>{a.D=null;a.j===d?O(a,f):a.j!==h&&a.j!==g&&O(a,e)});a.da&&a.j===b&&a.D.D(()=>{a.D.D(null);a.j===c&&Pd(a);a.da=null});a.j!==f&&O(a,c)}}function Wd(a,b,c,d){const e=a.af;a.af++;c={message:{seqId:e,messageFamily:b,payload:c},Um:d?Xd(d):null,zn:null};a.F.set(e,c);Vd(a,e,'publish',(new Map).set('family',b));d=[olympe.L.Na.j.CONNECTING,olympe.L.Na.j.Mg];(Td(a)||b===olympe.L.ze.$j&&d.includes(a.j))&&Yd(a,e,c)}
|
|
483
483
|
function Xd(a){const b=olympe.L.Na.D.Xi;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.L.Na.oc[e]?`Status code = ${e} [${olympe.L.Na.oc[e]}]`:`Status code = ${e}`;e=olympe.L.errors.Wq;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.L.errors.Dk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
|
|
484
|
-
function Yd(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.D.send(JSON.stringify(d)))?null===c.
|
|
485
|
-
function Sd(a,b,c){if(a.F.has(b)){const {
|
|
484
|
+
function Yd(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.payload));(d=a.D.send(JSON.stringify(d)))?null===c.Um?a.F.delete(b):c.zn=Date.now():olympe.C.Pa(a.jb.j()).valueOf()&&O(a,olympe.L.Na.j.Mg);return d}function Rd(a,b,c,d){void 0===d&&(d=olympe.V.Ic());let e=a.ua.get(b);void 0===e&&(e=new Map,a.ua.set(b,e));e.set(d,c)}function Zd(a){a=a.ua.get(olympe.L.ze.Gg);void 0!==a&&a.delete('logoutHandler')}
|
|
485
|
+
function Sd(a,b,c){if(a.F.has(b)){const {Um:d}=a.F.get(b);a.F.delete(b);null==d||d({s:olympe.L.Na.D.fu,error:c})}}function $d(a,b){a.G.error(b);O(a,olympe.L.Na.j.Ab)}function ae(a,b,c){a.Bd=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.R)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.F).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!Yd(a,e,f))return;O(a,olympe.L.Na.j.wg)}
|
|
486
486
|
function be(a,b){const c=olympe.L.He.zg,d=olympe.L.He.bg,e=olympe.L.He.Ab,{id:f,e:g}=b;let h=a.N.get(f);h||(h=new olympe.L.vq(()=>a.N.delete(f)),a.N.set(f,h));if(g===c){fb(a.N.j,f);const {i:k,c:l}=b;h.write(l,k).catch(n=>{h.throw(n)})}else g===d?h.complete(b.s):g===e&&h.throw(Error(`Received stream error: ${b.reason}`))}
|
|
487
487
|
olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.vc=b;this.R=null;e.subscribe(k=>{this.R=k;k=olympe.L.Na.j.CONNECTING;if(this.j===olympe.L.Na.j.wg||this.j===k){let l;null==(l=this.D)||l.close()}});this.da=this.D=null;e.subscribe(k=>{this.da=k;k=olympe.L.Na.j.Wd;this.j===olympe.L.Na.j.Gk&&(O(this,k),Pd(this))});this.ha=g;this.Rd=h.get('pingInterval');this.Ga=h.get('messageTimeout');this.$=olympe.V.If.parse(h.get('clientVersion'));this.$a=olympe.V.If.parse(h.get('serverVersion'));this.j=
|
|
488
488
|
olympe.L.Na.j.INIT;this.jb=d;this.zc=h.get('getContextMode');this.af=1;this.Y=null;this.H=[0,0,0];this.ua=new Map;this.connected=olympe.C.bc(olympe.C.ea,'Server is connected');this.ci=gc(olympe.C.bc(olympe.C.ea,'Server is readonly'),olympe.C.ea.j);this.Mb=new Set;this.F=new Map;this.N=new olympe.V.Nh(this.Ga);this.Id=new Map;this.Bd=-1;Qd(this,h,c)}connect(){const a=olympe.L.Na.j.wg,b=olympe.L.Na.j.Wd,c=olympe.L.Na.j.Ab,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.j!==d&&this.j!==b||Od(this);
|
|
489
|
-
Ud(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.L.Na.j.
|
|
489
|
+
Ud(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.L.Na.j.Ho,d=olympe.L.Na.j.Wd,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.Ab;this.j===olympe.L.Na.j.wg||this.j===e||this.j===c?(Ud(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.j!==c&&(O(this,c),this.D.close())):(O(this,d),a())})}$e(){this.G.debug('Websocket connected, sending handshake. Client version:',Cb(this.$),
|
|
490
490
|
'subscribeEverything:',this.zc?'NO':'YES');Wd(this,olympe.L.ze.$j,{c:olympe.L.Mi.$j,cv:Cb(this.$),m:this.zc?0:1,s:this.Y,b:this.jb.D()},this.ai.bind(this))}ai(a,b){if(a)$d(this,'Error in receiving handshake response: '+a.message);else{this.G.debug('Handshake response received');var c=olympe.L.Na.F;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.gu:$d(this,`Framework version (${Cb(this.$)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
|
|
491
491
|
return;case c.gw:$d(this,`Framework version (${Cb(this.$)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Qt:$d(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.$a.Ea(olympe.V.If.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.V.If.parse(a);if(e.Cj(this.$a)){$d(this,`Framework v${Cb(this.$)} is expecting Orchestrator to be at least in v${Cb(this.$a)}`);
|
|
492
492
|
return}this.G.log('Handshake successful. Orchestrator version: ',JSON.stringify(e),'required:',Cb(this.$a))}catch(f){$d(this,f);return}e=olympe.L.Na.j.Wd;if(this.j===olympe.L.Na.j.Mg&&null!==this.Y&&this.Y!==b.sessionId)this.G.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),O(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Id.set(f,g);this.Y=b.sessionId||null;ae(this,a,d)}}}$c(){this.H[0]-this.H[1]>this.Rd/2?(this.G.debug('Ping did not get answer, try to reconnect'),
|
|
493
493
|
O(this,olympe.L.Na.j.Mg)):(this.H[0]=Date.now(),this.D.send('ping')||(this.G.debug('Impossible to send ping, try to reconnect'),O(this,olympe.L.Na.j.Mg)))}$h(a){this.H[2]=Date.now();if(a.startsWith('pong'))return olympe.C.Pa(this.jb.j()).valueOf()&&(this.H[1]=this.H[2]),null;var b=0;this.ha.j&&(b=performance.now()-this.ha.D);try{var c=JSON.parse(a)}catch(g){return this.G.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=c.seqId;var d=c.stream;
|
|
494
494
|
const e=c.messageFamily;c=c.payload;if(this.G.j()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.L.He.zg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.L.He.bg?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.G.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Vd(this,a,'consumed',new Map,b);Vd(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.N.has(f);be(this,d);if(b)return null;d=this.N.get(f);if(!d)return this.G.error(`Received a stream chunk for an unknown stream id: ${f}`),
|
|
495
|
-
null;f=d.stream}this.F.has(a)&&({
|
|
496
|
-
function ce(a,b){const c=olympe.L.tc.j.
|
|
495
|
+
null;f=d.stream}this.F.has(a)&&({Um:d}=this.F.get(a),this.F.delete(a),null==d||d(c,f));a=this.ua.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}zb(){const a=Date.now();for(const [b,{zn:c}]of this.F)null!==c&&a-c>this.Ga&&(this.G.warn(`No response was received from the server for the seqId = ${b}`),Sd(this,b,'Message timeout: never receive acknowledge'))}};function id(a){return olympe.C.Pa(a.j)===olympe.L.tc.j.Ri}
|
|
496
|
+
function ce(a,b){const c=olympe.L.tc.j.qm,d=olympe.L.tc.j.Ae,e=olympe.L.tc.j.Wd,f=olympe.L.tc.j.Vv,g=b.get('reconnectionDelay');Ud(a.F,[olympe.L.Na.j.INIT],()=>{de(a)?(a.j.update(c),a.connect().catch(h=>a.G.error(h))):a.F.disconnect().catch(h=>a.G.error(h))},!0);Ud(a.F,[olympe.L.Na.j.Wd],()=>{if(olympe.C.Pa(a.j)===f)a.G.info('Disconnected, from orchestrator for shutdown');else if(a.j.update(a.D?d:e),de(a)&&a.N){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.D?a.G.log(h):a.G.error(h);
|
|
497
497
|
setTimeout(()=>a.connect().catch(k=>a.G.error(k)),g)}else a.G.info('Disconnected, stay offline.')});a.R.F(()=>{a.j.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function de(a){return null===a.storage.get(a.H+'olympe_manual_offline')}
|
|
498
498
|
olympe.L.tc=class{constructor(a,b,c,d,e,f){this.G=a;this.F=b;this.R=d;this.storage=e;this.j=olympe.C.bc(Number).update(olympe.L.tc.j.INIT);this.D=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.H=f.get('storagePrefix');ce(this,f)}Sf(){const a=olympe.L.tc.j.Ri,b=olympe.L.tc.j.Ae,c=olympe.L.tc.j.Wd;let d=olympe.C.ea.j;return olympe.C.ta([this.j],e=>{if(e===a)d=olympe.C.ea.D;else if(e===b||e===c)d=olympe.C.ea.j;return d},olympe.C.ea)}getState(){return this.j.rb()}connect(){const a=
|
|
499
|
-
this;return w(function*(){const b=olympe.L.tc.j.Ri,c=olympe.L.tc.j.
|
|
500
|
-
(a.j.update(c),yield olympe.L.ei().disconnect(),yield a.F.disconnect())})}};olympe.L.tc.j={INIT:0,
|
|
501
|
-
olympe.L.cb.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,Er:4,ge:5,
|
|
502
|
-
olympe.L.Zc=class{constructor(a,b,c){this.j=a;this.D=b;this.H=c;this.F=null}mi(){return null!==this.F?Promise.resolve(this.F):zd(this.D,this.j).then(a=>this.F=a)}Js(){return this.j.getType()}source(){return this.j.sb()}body(){return this.j.j}Pr(){return this.j.getType()===fe?this.D.vd(this.j,je):Promise.reject('Should only call `ack` on SEND requests')}vd(a){const b=this.j.getType();return b===ge||b===ie?this.D.vd(this.j,le,a):Promise.reject('Should only call `reply` on GET requests')}
|
|
499
|
+
this;return w(function*(){const b=olympe.L.tc.j.Ri,c=olympe.L.tc.j.qm;olympe.C.Pa(a.j)!==b&&(a.j.update(c),a.storage.delete(a.H+'olympe_manual_offline'),yield a.F.connect(),yield ee(),a.j.update(b))})}disconnect(){const a=this;return w(function*(){const b=olympe.L.tc.j.Ae,c=olympe.L.tc.j.qm;if(!a.D)throw Error('Try to go offline manually while the process does not support it. Please add `offline.enabled=true` in the config');a.storage.set(a.H+'olympe_manual_offline','true');olympe.C.Pa(a.j)!==b&&
|
|
500
|
+
(a.j.update(c),yield olympe.L.ei().disconnect(),yield a.F.disconnect())})}};olympe.L.tc.j={INIT:0,qm:1,Ri:2,Ae:3,Wd:4,Vv:5};olympe.L.tc.D='olympe_manual_offline';olympe.L.cb=class{constructor(a,b,c,d,e){this.ee=c;this.D=a;this.source=b;this.messageType=d;this.j=null!=e?e:null}static D(a,b,c){let d;var e=olympe.L.cb,f=a.dest,g=a.src,h=a.seq,k=a.type;b.R=c;return new e(f,g,h,k,b.N(null!=(d=a.content)?d:null))}ic(){return this.D}sb(){return this.source}getType(){return this.messageType}ga(a,b){const c={dest:this.D,src:this.source,seq:this.ee,type:this.messageType};null!==this.j&&(a.Y=b,c.content=a.ga(this.j));return c}toString(){return`Message(dest: ${this.D}, src: ${this.source}, seqId: ${this.ee}, type: ${this.messageType})`}};
|
|
501
|
+
olympe.L.cb.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,Er:4,ge:5,Fm:6,Ab:7,hl:10,br:11,wr:12,ye:13,Im:14};olympe.L.zk=class extends olympe.L.cb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.F=c}static D(a,b,c){let d;var e=olympe.L.zk,f=a.dest,g=a.src,h=a.auth,k=a.seq,l=a.type;b.R=c;return new e(f,g,h,k,l,b.N(null!=(d=a.content)?d:null))}oe(){return this.F}ga(a,b){return Object.assign(super.ga(a,b),{auth:this.F})}};olympe.L.zk.Mi={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,ye:4,Im:5};const fe=olympe.L.cb.j.SEND,ge=olympe.L.cb.j.GET,he=olympe.L.cb.j.SUBSCRIBE,ie=olympe.L.cb.j.ye,je=olympe.L.cb.j.br,ke=olympe.L.cb.j.Ab,le=olympe.L.cb.j.Er,me=olympe.L.cb.j.Fm,ne=olympe.L.cb.j.wr;
|
|
502
|
+
olympe.L.Zc=class{constructor(a,b,c){this.j=a;this.D=b;this.H=c;this.F=null}mi(){return null!==this.F?Promise.resolve(this.F):zd(this.D,this.j).then(a=>this.F=a)}Js(){return this.j.getType()}source(){return this.j.sb()}body(){return this.j.j}Pr(){return this.j.getType()===fe?this.D.vd(this.j,je):Promise.reject('Should only call `ack` on SEND requests')}vd(a){const b=this.j.getType();return b===ge||b===ie?this.D.vd(this.j,le,a):Promise.reject('Should only call `reply` on GET requests')}un(a){if(this.j.getType()!==
|
|
503
503
|
he)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.V.Ic();return new Promise((c,d)=>{const e={seq:ud(this.D,f=>{switch(f.getType()){case ne:oe(this.H,b);c(b);break;case ke:d(f.j.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.D.Rd};this.D.vd(this.j,me,e).catch(d)})}bi(a){return this.D.vd(this.j,ke,{reason:a.message})}};olympe.L.Zc.prototype.fail=olympe.L.Zc.prototype.bi;
|
|
504
|
-
olympe.L.Zc.prototype.notifyOn=olympe.L.Zc.prototype.
|
|
504
|
+
olympe.L.Zc.prototype.notifyOn=olympe.L.Zc.prototype.un;olympe.L.Zc.prototype.reply=olympe.L.Zc.prototype.vd;olympe.L.Zc.prototype.ack=olympe.L.Zc.prototype.Pr;olympe.L.Zc.prototype.body=olympe.L.Zc.prototype.body;olympe.L.Zc.prototype.source=olympe.L.Zc.prototype.source;olympe.L.Zc.prototype.requestType=olympe.L.Zc.prototype.Js;olympe.L.Zc.prototype.userTag=olympe.L.Zc.prototype.mi;function Ad(a){const b=olympe.L.errors.Oi;a.j.forEach((c,d)=>{yd(a,d);null==c||c(new b(`Subscription ${d} to be refreshed`,d))})}function nd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function od(a,b){b&&a.lf();null===a.D&&(a.D=setInterval(a.lf.bind(a),a.F))}function yd(a,b){b=a.j.delete(b);0===a.j.size&&nd(a);return b}function pe(a,b){a.j.forEach((c,d)=>{yd(a,d);c(b)})}
|
|
505
505
|
olympe.L.ew=class{constructor(a,b,c,d){this.G=a;this.H=b;this.N=c;this.F=d;this.j=new Map;this.D=null}lf(){const a=olympe.L.errors.Oi;hd(this.H)?this.H.request(this.N,olympe.L.cb.j.ye,Array.from(this.j.keys())).then(b=>{b=b.j;0<b.length&&b.forEach(c=>{const d=this.j.get(c);yd(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.G.error(b);pe(this,Error(b))}):nd(this)}};olympe.L.cc=class{constructor(){this.R=this.Y=null}ga(a){a=this.D(a);this.Y=null;return a}N(a){a=this.j(a);this.R=null;return a}D(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return this.format(olympe.L.cc.j.Cl,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.cc.j.Cl,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.cc.j.COLOR,
|
|
506
506
|
a.toJSON());case a instanceof Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.D(d)])),this.format(olympe.L.cc.j.Wp,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.cc.j.Rg,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.V.ef().j(new Uint8Array(a)),this.format(olympe.L.cc.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.V.ef().j(a),this.format(olympe.L.cc.j.Oh,a);case a instanceof
|
|
507
507
|
olympe.V.stream.Df:if(!this.Y)throw Error('No stream handler has been set, so cannot serialize the stream.');let b;return this.format(olympe.L.cc.j.ge,null==(b=this.Y)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.D(e);return c},{}),this.format(olympe.L.cc.j.lq,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}j(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===
|
|
508
|
-
typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.L.errors.
|
|
509
|
-
case olympe.L.cc.j.Oh:return olympe.V.ef().D(c);case olympe.L.cc.j.ge:if(!this.R)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==(d=this.R)?void 0:d.call(this,c);case olympe.L.cc.j.lq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.L.errors.
|
|
510
|
-
function Be(a,b){const c=olympe.L.cb.j.
|
|
508
|
+
typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.L.errors.Mo(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.cc.j.Cl:return new Date(c);case olympe.L.cc.j.COLOR:return olympe.C.Color.Qb(c);case olympe.L.cc.j.Wp:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.cc.j.Rg:return new Set(c.map(e=>this.j(e)));case olympe.L.cc.j.ARRAY_BUFFER:return olympe.V.ef().D(c).buffer;
|
|
509
|
+
case olympe.L.cc.j.Oh:return olympe.V.ef().D(c);case olympe.L.cc.j.ge:if(!this.R)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==(d=this.R)?void 0:d.call(this,c);case olympe.L.cc.j.lq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.L.errors.Mo(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.cc.j={Cl:1,COLOR:2,Wp:3,Rg:4,ARRAY_BUFFER:5,Oh:6,ge:7,lq:8};const qe=olympe.L.cb.j.SEND,re=olympe.L.cb.j.GET,se=olympe.L.cb.j.PUBLISH,te=olympe.L.cb.j.SUBSCRIBE,ue=olympe.L.cb.j.ye,ve=olympe.L.cb.j.Im,we=olympe.L.cb.j.br,xe=olympe.L.cb.j.hl,ye=olympe.L.cb.j.Ab,ze=olympe.L.cb.j.Er,Ae=olympe.L.cb.j.Fm;function oe(a,b){a.j||(a.j=gb(new olympe.V.Hm(a.D.Rd+3E4),c=>{let d;null==(d=a.F)||d.call(a,c)}));a.j.add(b)}
|
|
510
|
+
function Be(a,b){const c=olympe.L.cb.j.Fm,d=olympe.L.cb.j.wr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.sb(),d,null,!0)}function Ce(a){let b,c;a=null!=(c=null==(b=a.j)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.L.errors.Dk(a):Error(a)}
|
|
511
511
|
olympe.L.ub=class{constructor(a,b){this.D=olympe.L.ei();this.H=a;this.F=this.j=null;this.N=new olympe.C.Xb(`Service ${a}`,'function'===typeof b.Cb?b.Cb():b);this.G=olympe.ja.ab(`Service ${this.H}`)}static observe(a,b,c,d={}){const e='function'===typeof b.Cb?b.Cb():b,f=olympe.L.ei();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&xd(f,a,k);h&&vd(f,h).catch(n=>olympe.ja.ab('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Td(l);f.request(a,te,c,d.timeout).then(n=>
|
|
512
512
|
{switch(n.getType()){case Ae:const p=n.j;h=p.topic;jd(f,h,q=>{q.getType()===se?g.next(q.j):(g.error('Unsupported notification message. It should be a publish'),l())}).then(()=>{k=p.id;wd(f,a,k,p.refresh,q=>g.error(q));Be(f,n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);l()})}).catch(q=>{g.error(`Was not able to subscribe to notification topic ${h}: ${q}`);l()});break;case ye:g.error(Ce(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));
|
|
513
513
|
return l})).pipe(nb(olympe.L.errors.Oi,(g,h)=>{olympe.ja.ab(`Service ${a}`).debug(`Subscribed to topic ${g.T()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}Qs(a){this.F=a;return this}stop(){this.N.destroy()}clear(){vd(this.D,this.H).catch(b=>this.G.error('Failed to unsubscribe from '+this.H+', error: '+b));if(this.F){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.F)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static publish(a,
|
|
514
514
|
b){return w(function*(){yield olympe.L.ei().request(a,se,b)})}static send(a,b,c={}){return olympe.L.ei().request(a,qe,b,c.timeout).then(d=>{switch(d.getType()){case we:break;case ye:throw Ce(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.ei().request(a,re,b,c.timeout).then(d=>{switch(d.getType()){case ze:d=d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case ye:throw Ce(d);default:throw Error('Unsupported response type for a GET request');
|
|
515
515
|
}})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);jd(this.D,this.H,c=>{const d=new olympe.L.Zc(c,this.D,this);switch(c.getType()){case ue:var e=d.body().filter(g=>{let h;return!(null==(h=this.j)?0:fb(h,g))});d.vd(e).catch(g=>this.G.error('Not able to validate subscription keep alive',g));break;case ve:c=d.body();null==(e=this.j)||e.delete(c);let f;null==(f=this.F)||f.call(this,c);break;case se:a.next(d);break;default:this.D.vd(c,xe).then(()=>a.next(d))}}).catch(c=>
|
|
516
516
|
{c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}};olympe.L.ub.prototype.listen=olympe.L.ub.prototype.listen;olympe.L.ub.get=olympe.L.ub.get;olympe.L.ub.send=olympe.L.ub.send;olympe.L.ub.publish=olympe.L.ub.publish;olympe.L.ub.prototype.stop=olympe.L.ub.prototype.stop;olympe.L.ub.prototype.setUnsubscriptionHandler=olympe.L.ub.prototype.Qs;olympe.L.ub.observe=olympe.L.ub.observe;olympe.L.vq=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.V.stream.Df;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return w(function*(){if(b<c.j||null!==c.size&&b>=c.size)throw Error(`Received stream chunk with unexpected index = ${b}. That index has already been processed. Next expected once is ${c.j}`);for(c.buffer[b-c.j]=a;void 0!==c.buffer[0];){c.j++;const d=c.buffer.shift();yield c.stream.write(d)}c.j===c.size&&(c.D(),c.stream.complete())})}complete(a){if(null!==
|
|
517
|
-
this.size)throw Error('The stream has already been completed');if(a<this.j+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.j+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.j===this.size&&(this.D(),this.stream.complete())}throw(a){this.D();this.stream.throw(a)}};olympe.L.ze={zg:1,Xf:2,Ab:3,Gg:4,bA:5,$j:6,oc:7};olympe.L.Mi={$j:1,pw:2,Nt:3,ye:5,Cv:1,xD:2};olympe.L.He={zg:0,bg:1,Ab:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',Wd:'disconnected',
|
|
517
|
+
this.size)throw Error('The stream has already been completed');if(a<this.j+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.j+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.j===this.size&&(this.D(),this.stream.complete())}throw(a){this.D();this.stream.throw(a)}};olympe.L.ze={zg:1,Xf:2,Ab:3,Gg:4,bA:5,$j:6,oc:7};olympe.L.Mi={$j:1,pw:2,Nt:3,ye:5,Cv:1,xD:2};olympe.L.He={zg:0,bg:1,Ab:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',Wd:'disconnected',Ho:'disconnecting',wg:'connected',Mg:'reconnecting',Gk:'waking',Rn:'awake',Ab:'error'};olympe.L.Na.F={Eh:1,Qt:-1,gu:-2,gw:-3};olympe.L.Na.D={Xi:0,fu:23};
|
|
518
518
|
olympe.L.Na.oc={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',
|
|
519
|
-
18:'Try to unsubscribe multiple times',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.L.P={qf:'com.ConnectivityManager',vk:'com.ServerManager',
|
|
520
|
-
olympe.L.U={El:'defaultHost',Ov:'server.host',Qv:'server.port',Rv:'server.ssl',cr:'server.basePath',Ir:'server.wsPath',
|
|
521
|
-
rl:'bus.requestTimeout',
|
|
522
|
-
olympe.W.config(function(a){const b=olympe.host.Pg.Hh;F(a,olympe.L.U.El,a.getParameter(olympe.host.U.rp));F(a,olympe.L.U.cr,'OlympeServer');F(a,olympe.L.U.xr,'');Ya(a,'com.hostConfig',[olympe.host.U.sk,olympe.L.U.El,olympe.L.U.Ov,olympe.L.U.Qv,olympe.L.U.Rv,olympe.L.U.cr,olympe.L.U.it,olympe.L.U.mt,olympe.L.U.kt,olympe.L.U.jt,olympe.L.U.lt],(e,f,g,h,k,l,n,p,q,r,t)=>{var u=a.getParameter(olympe.net.U.
|
|
523
|
-
null!=g?g:y;n=null!=n?n:y;const z=(y=x.includes(g))||u;u=(x=x.includes(n))||u;f=x?'/':f.split('.')[0];return{
|
|
524
|
-
F(a,olympe.L.U.
|
|
525
|
-
''),k))).pipe(rxjs.operators.shareReplay(1)));E(a,'server.wakeUpRequest',[new olympe.W.th('com.hostConfig'),new olympe.W.pa(olympe.L.U.Sv)],(e,f)=>e.pipe(rxjs.operators.map(({
|
|
526
|
-
|
|
519
|
+
18:'Try to unsubscribe multiple times',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.L.P={qf:'com.ConnectivityManager',vk:'com.ServerManager',bo:'com.BusManager',Rl:'com.HttpManager',Ge:'com.Serializer',Ca:'com.Logger',ir:'com.Source',zr:'com.Urls',WB:'com.peerFileSvcUrl'};
|
|
520
|
+
olympe.L.U={El:'defaultHost',Ov:'server.host',Qv:'server.port',Rv:'server.ssl',cr:'server.basePath',Ir:'server.wsPath',wm:'server.reconnectionDelay',xq:'server.pingInterval',Hr:'server.messageTimeout',Pq:'server.retryHttpOnOverload',wl:'server.clientVersion',fr:'server.serverVersion',Sv:'server.wakeUpService',it:'bus.host',jt:'bus.path',kt:'bus.port',mt:'bus.vhost',lt:'bus.ssl',ye:'bus.keepalive',Hv:'bus.reschedulePings',qt:'bus.clientId',ot:'bus.clean',tt:'bus.connectTimeout',co:'bus.shortTimeout',
|
|
521
|
+
rl:'bus.requestTimeout',eo:'bus.subscriptionRefreshRate',Av:'bus.queueQoSZero',ql:'bus.allowGuest',xr:'bus.topicPrefix'};
|
|
522
|
+
olympe.W.config(function(a){const b=olympe.host.Pg.Hh;F(a,olympe.L.U.El,a.getParameter(olympe.host.U.rp));F(a,olympe.L.U.cr,'OlympeServer');F(a,olympe.L.U.xr,'');Ya(a,'com.hostConfig',[olympe.host.U.sk,olympe.L.U.El,olympe.L.U.Ov,olympe.L.U.Qv,olympe.L.U.Rv,olympe.L.U.cr,olympe.L.U.it,olympe.L.U.mt,olympe.L.U.kt,olympe.L.U.jt,olympe.L.U.lt],(e,f,g,h,k,l,n,p,q,r,t)=>{var u=a.getParameter(olympe.net.U.bm);e=e===olympe.host.Pg.Hh;var x=['localhost','127.0.0.1'],y=(u=f.endsWith(u))&&e?`${f}-${b}`:f;g=
|
|
523
|
+
null!=g?g:y;n=null!=n?n:y;const z=(y=x.includes(g))||u;u=(x=x.includes(n))||u;f=x?'/':f.split('.')[0];return{An:g,Bn:null!=h?h:y?8080:z?e?85:80:443,Cn:null!=k?k:!z,Ms:l,Qw:n,Uw:null!=p?p:f,Sw:null!=q?q:x?15675:u?e?85:80:443,Rw:null!=r?r:x?'':'/mqtt',Tw:null!=t?t:!u}});F(a,olympe.L.U.Ir,'websocket');F(a,olympe.L.U.wm,5E3);F(a,olympe.L.U.xq,5E3);F(a,olympe.L.U.Hr,3E4);F(a,olympe.L.U.Pq,4E3);F(a,olympe.L.U.fr,'7.5.0');F(a,olympe.L.U.ye,30);F(a,olympe.L.U.rl,3E4);F(a,olympe.L.U.co,a.getParameter(olympe.L.U.rl));
|
|
524
|
+
F(a,olympe.L.U.eo,6E4);F(a,olympe.L.U.ql,!1);const c=a.getParameter(olympe.pg.U.$o);if(void 0!==c)Ua(a,olympe.L.U.wl,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');E(a,olympe.L.P.Ca,[olympe.ja.P.Da],e=>e.cd('communication'));E(a,'server.WebSocketRequest',[new olympe.W.th('com.hostConfig'),new olympe.W.pa(olympe.L.U.Ir)],(e,f)=>e.pipe(rxjs.operators.map(({An:g,Bn:h,Cn:k,Ms:l})=>new olympe.net.dj(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,
|
|
525
|
+
''),k))).pipe(rxjs.operators.shareReplay(1)));E(a,'server.wakeUpRequest',[new olympe.W.th('com.hostConfig'),new olympe.W.pa(olympe.L.U.Sv)],(e,f)=>e.pipe(rxjs.operators.map(({An:g,Bn:h,Cn:k})=>{if(null===f||void 0===f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.dj(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Yb));E(a,olympe.L.P.zr,[new olympe.W.th('com.hostConfig'),...d.map(e=>new olympe.W.pa(e))],(e,...f)=>e.pipe(rxjs.operators.map(({An:g,
|
|
526
|
+
Bn:h,Cn:k,Ms:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Fi(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));D(a,olympe.L.P.Ge,olympe.L.cc);D(a,olympe.L.P.Rl,olympe.L.Vt,olympe.L.P.Ca,olympe.net.P.Da,olympe.V.P.eg,olympe.L.P.zr,new olympe.W.pa(olympe.L.U.Pq));E(a,'com.server.ManagerConfig',[new olympe.W.pa(olympe.L.U.xq),new olympe.W.pa(olympe.L.U.Hr),new olympe.W.pa(olympe.L.U.wl),new olympe.W.pa(olympe.L.U.fr),
|
|
527
527
|
new olympe.W.pa(olympe.dc.U.Mh)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],h));return g});D(a,olympe.L.P.vk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Da,olympe.host.P.Ue,olympe.host.P.yk,'server.WebSocketRequest','server.wakeUpRequest',olympe.V.P.eg,'com.server.ManagerConfig');Ya(a,'com.bus.TopicPrefix',[olympe.host.U.sk,olympe.L.U.xr],(e,f)=>e===olympe.host.Pg.Hh?`${b}-${f}`:f);E(a,'com.bus.ManagerConfig',
|
|
528
|
-
[new olympe.W.th('com.hostConfig'),new olympe.W.th('com.bus.TopicPrefix'),new olympe.W.pa(olympe.L.U.ql),new olympe.W.pa(olympe.L.U.
|
|
529
|
-
'wss://':'ws://'}${p}:${r}${q}/ws`;const x='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');q=n.reduce((y,z,A)=>{y[x[A]]=z;return y},{});q.url=p;q.vhost=t;return q})).pipe(rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['shortTimeout',h],['requestTimeout',k],['subscriptionsRefreshRate',l]])});D(a,olympe.L.P.
|
|
530
|
-
olympe.host.P.Ue,olympe.L.P.Ge,olympe.V.P.eg,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.P.
|
|
531
|
-
olympe.W.run([olympe.L.P.
|
|
528
|
+
[new olympe.W.th('com.hostConfig'),new olympe.W.th('com.bus.TopicPrefix'),new olympe.W.pa(olympe.L.U.ql),new olympe.W.pa(olympe.L.U.co),new olympe.W.pa(olympe.L.U.rl),new olympe.W.pa(olympe.L.U.eo),new olympe.W.pa(olympe.L.U.ye),new olympe.W.pa(olympe.L.U.Hv),new olympe.W.pa(olympe.L.U.qt),new olympe.W.pa(olympe.L.U.ot),new olympe.W.pa(olympe.L.U.wm),new olympe.W.pa(olympe.L.U.tt),new olympe.W.pa(olympe.L.U.Av)],(e,f,g,h,k,l,...n)=>{e=e.pipe(rxjs.operators.map(({Qw:p,Rw:q,Sw:r,Uw:t,Tw:u})=>{p=`${u?
|
|
529
|
+
'wss://':'ws://'}${p}:${r}${q}/ws`;const x='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');q=n.reduce((y,z,A)=>{y[x[A]]=z;return y},{});q.url=p;q.vhost=t;return q})).pipe(rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['shortTimeout',h],['requestTimeout',k],['subscriptionsRefreshRate',l]])});D(a,olympe.L.P.bo,olympe.L.ho,olympe.L.P.Ca,olympe.net.P.Da,olympe.L.P.qf,olympe.auth.P.Da,
|
|
530
|
+
olympe.host.P.Ue,olympe.L.P.Ge,olympe.V.P.eg,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.P.km,olympe.Eb.P.Sg,new olympe.W.pa(olympe.L.U.wm)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));D(a,olympe.L.P.qf,olympe.L.tc,olympe.L.P.Ca,olympe.L.P.vk,olympe.net.P.Da,olympe.host.P.Ue,olympe.Eb.P.cm,'com.connectivity.ManagerConfig')},'olympe.communication');
|
|
531
|
+
olympe.W.run([olympe.L.P.bo,olympe.L.P.qf],(a,b)=>{olympe.L.ei=()=>a;olympe.L.dn=()=>b});olympe.auth={};function De(a,b){Zd(a.j);Rd(a.j,olympe.L.ze.Gg,c=>{const d=c.c;d===olympe.auth.pd.j.Qu?(a.j.$e(),b(olympe.auth.Ta.D.Fj,c)):d===olympe.auth.pd.j.Mv&&b(olympe.auth.Ta.D.xp,c)},'logoutHandler')}
|
|
532
532
|
function Ee(a,b,c){const d=null==b?void 0:b.yf();if(b instanceof olympe.auth.ik){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.Cd();h.access_token=Fe(b);g=`${Ld(a.Ah,olympe.L.Yb.fk)}/logout${d?`?idpName=${d}`:''}`;a.D.redirect(g,h)};c=a.D.j();const f=new URL(c);0!==f.hash.length||0!==f.search.length?(f.hash='',f.search='',a.F.db.set('main',c,'redirectTo').then(()=>{e(f.toString())}).catch(g=>{a.G.error(`Error when trying to set the redirectKey in Auth store: ${g}`)})):e(c)}else Wd(a.j,
|
|
533
533
|
olympe.L.ze.Gg,Object.assign({},{c:olympe.auth.pd.j.Ru},d&&{idpName:d}),c)}function Ge(a,b,c,d){olympe.C.Pa(a.H.getState())===olympe.L.tc.j.Ae?d(new olympe.L.errors.tq('Working offline'),'Working offline'):(c.c=b,Wd(a.j,olympe.L.ze.Gg,c,d))}
|
|
534
534
|
function He(a,b,c){if(b.Fg()!==olympe.auth.Ec.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.yf()}&access_token=${Fe(b)}`;d=`${Ld(a.Ah,olympe.L.Yb.fk)}/refresh${d}`;d=Cc(N(d),olympe.net.wa.ResponseType.JSON);Nd(a.Ah,d,b.Cd()).then(e=>{(e=e.getData())?(e=new olympe.auth.ik(b.Cc(),b.pe(),b.Cd(),e,b.yf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
|
|
@@ -539,7 +539,7 @@ function Me(a){a.G.log('Initializing AUTH layer');let b=a.vc;if('object'===typeo
|
|
|
539
539
|
Le(a);break;case olympe.L.tc.j.Wd:switch(olympe.C.Pa(a.D)){case olympe.auth.Ta.j.mf:c=olympe.C.Pa(a.j).Cc();Oe(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.Ci:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.Gj:Oe(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:Oe(a,'Cannot open auth session - no server connection');break;default:Oe(a,'Should not get there, investigate',!0)}}});De(a.H,
|
|
540
540
|
(c,d)=>{if(c===olympe.auth.Ta.D.Fj){Oe(a,'authentication revoked');let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.$.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.xp){a.G.info('Redirection to IDP to invalidate token (SAML)');rd(a);let e;null==(e=a.storage)||Pe(e).catch(f=>a.G.error('Failed to clear token',f));a.jb.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.ha=Qe(a);a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}
|
|
541
541
|
function Re(a,b){let c=null;olympe.C.uj(a.D.rb().Fd(olympe.auth.Ta.j.mf).and(b),()=>{const d=rd(a);!Se(a)&&d&&(c=a.Ud.get(d.Fg()).H(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.xj().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&Te(a,f)}))},()=>{let d;null==(d=c)||d()})}
|
|
542
|
-
function Le(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.oe().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.Cc();e.set('username',c);c=e;var d=b.Cd();c.set('nonce',d);'string'===typeof b.yf()&&e.set('idpName',b.yf());a.G.debug('Token found, trying login with',e);Ue(a,e,olympe.auth.Ec.j.
|
|
542
|
+
function Le(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.oe().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.Cc();e.set('username',c);c=e;var d=b.Cd();c.set('nonce',d);'string'===typeof b.yf()&&e.set('idpName',b.yf());a.G.debug('Token found, trying login with',e);Ue(a,e,olympe.auth.Ec.j.mm)}else Oe(a,'No token found, cannot perform auto login')}).catch(b=>{Oe(a,b.message,!0)})):Oe(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
|
|
543
543
|
!0)}function Oe(a,b,c=!1){a.j.update(a.Y);Je(a,olympe.auth.Ta.j.Ci);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function Qe(a){const b=[olympe.auth.Ta.j.mf];a.Ga||b.push(olympe.auth.Ta.j.Ci);return a.ua.j(()=>{const c=Ve(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}function Je(a,b){a.G.log('State change: ',Ve(a),'--\x3e',b);a.D.update(b)}
|
|
544
544
|
function Ke(a){if(a.R){const b=new olympe.auth.Request;b.set('username',a.R);b.set('password',a.zb);a.G.log('Autologin with user "'+a.R+'"');Ue(a,b)}else Oe(a,'No user specified for auto login',!0)}function Se(a){return olympe.C.Pa(a.j)===a.Y}function Te(a,b){if(b){a.j.update(b);let c;null==(c=a.storage)||Ne(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function Ve(a){return olympe.C.Pa(a.D.rb())}function We(){var a=olympe.public.Ma.get();return new Map(a.H.j.Id)}
|
|
545
545
|
function Xe(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.xb(b));Je(a,olympe.auth.Ta.j.Ab);if(d)throw Error(b);}function Ue(a,b,c,d){void 0===c&&(c=a.Mb);void 0===c&&Xe(a,'No authentication provider specified',null,!0);const e=a.Ud.get(c);e||Xe(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.N.set('login',d);a.G.log('Sending authentication request using "'+c+'" for '+b);e.oe(b,a.zc.bind(a));Je(a,olympe.auth.Ta.j.Gj)}
|
|
@@ -549,62 +549,62 @@ this.N=new Map;this.$=new Map;this.da=new olympe.V.Nh(k.get('cacheTokenTimeout')
|
|
|
549
549
|
return d.rb()}qg(a){if(olympe.C.Pa(this.D)===olympe.auth.Ta.j.mf){var b=rd(this);!Se(this)&&b&&this.Ud.get(b.Fg()).qg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.xj().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&Te(this,d);a(c)})}}getState(){return this.D.rb()}Cc(){return this.j.rb().Cc()}pe(){return this.j.rb().pe()}gi(){return this.j.rb().gi()}hh(a,b){if(fb(this.da.j,a))b(null,this.da.get(a));else{var c,d=null==(c=olympe.C.Pa(this.j.rb()))?
|
|
550
550
|
void 0:c.Cd();this.H.hh(a,d,(e,f)=>{'string'===typeof f&&this.da.set(a,f);b(e,f)})}}xj(){return Se(this)?(this.G.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.G.debug('Sending logout');let c;null==(c=this.storage)||Pe(c).catch(d=>this.G.error('Failed to clear token',d));Ee(this.H,rd(this),d=>{d?(Xe(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.ua.D(this.ha)})}lf(a){Ve(this)===olympe.auth.Ta.j.mf&&
|
|
551
551
|
this.H.lf(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}zc(a,b){const c=null===this.F?olympe.auth.Ta.F.Xu:this.F;this.F=null;if(!a||a instanceof olympe.L.errors.tq){null===a?this.G.info(`User ${b.Cc()} (#${b.pe()}) successfully authenticated`):this.G.info(`User ${b.Cc()} (#${b.pe()}) recovered from token, while offline`);this.j.update(b);Je(this,olympe.auth.Ta.j.mf);Ye(this,a,c);let d;null==(d=this.storage)||Ne(d,b).catch(e=>this.G.error(e))}else{let d;
|
|
552
|
-
null==(d=this.storage)||Pe(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));Oe(this,'authentication rejected: '+a.message);Ye(this,a,c)}this.N.has('login')&&this.N.delete('login')}};olympe.auth.Ta.j={INIT:'init',Gj:'authenticating',Ci:'guest',mf:'authenticated',Ab:'error'};olympe.auth.Ta.F={Xu:'manual',Ws:'auto',Zi:'tokenOnFirstConnection'};olympe.auth.Ta.D={Fj:'accepted',xp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}oe(){}H(a,b){const c=()=>{this.j=setTimeout(()=>this.D.lf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.Bd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}qg(a,b){this.D.lf(c=>{b(c,null)})}};olympe.auth.Ec.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',
|
|
552
|
+
null==(d=this.storage)||Pe(d).catch(e=>this.G.error(e));this.error.update(olympe.C.xb(a.message));Oe(this,'authentication rejected: '+a.message);Ye(this,a,c)}this.N.has('login')&&this.N.delete('login')}};olympe.auth.Ta.j={INIT:'init',Gj:'authenticating',Ci:'guest',mf:'authenticated',Ab:'error'};olympe.auth.Ta.F={Xu:'manual',Ws:'auto',Zi:'tokenOnFirstConnection'};olympe.auth.Ta.D={Fj:'accepted',xp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}oe(){}H(a,b){const c=()=>{this.j=setTimeout(()=>this.D.lf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.Bd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}qg(a,b){this.D.lf(c=>{b(c,null)})}};olympe.auth.Ec.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',mm:'olympeToken'};function Ze(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Sc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.Xg&&(a=a.Ba.Fb);return a?a.valueOf():a}Cc(){return this.get('username')}Cd(){return this.get('nonce')}toString(){return this.Cc()+(this.Cd()?' with nonce':'')+(this.get('password')?' with password':'')+(Ze(this)?` with idp name ${Ze(this)}`:'')}};olympe.auth.Wg=class{constructor(a,b,c,d={},e=null){this.H=a;this.mi=b;this.D=c;this.j=e;this.F=d}Cc(){return this.H}pe(){return this.mi}Cd(){return this.D}Ii(){return this.F}gi(){return null}yf(){return this.j}ga(){const a=olympe.V.ef(),b=Object.assign({},{user:this.H,userTag:this.mi,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.V.Qr(bb(a,JSON.stringify(b)))}Fg(){return olympe.auth.Ec.j.SRP}};m=olympe.auth.Wg.prototype;m.Cc.K=new olympe.C.J(()=>String,[]);
|
|
553
553
|
m.pe.K=new olympe.C.J(()=>String,[]);m.Cd.K=new olympe.C.J(()=>String,[]);m.Ii.K=new olympe.C.J(()=>Object,[]);m.gi.K=new olympe.C.J(()=>String,[]);m.yf.K=new olympe.C.J(()=>String,[]);m.ga.K=new olympe.C.J(()=>String,[]);m.Fg.K=new olympe.C.J(()=>String,[]);function Fe(a){return a.Ii().access_token||null}function $e(a){return 1E3*parseInt(a.Ii().access_token_exp||'0',10)}olympe.auth.ik=class extends olympe.auth.Wg{constructor(a,b,c,d,e){super(a,b,c,d,e);this.N=Date.now()}gi(){return Fe(this)}Fg(){return olympe.auth.Ec.j.OAUTH2}};olympe.auth.$q=class extends olympe.auth.Wg{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.N=d}gi(){return this.N}Fg(){return olympe.auth.Ec.j.SAML}ga(){const a=olympe.V.ef(),b=Object.assign({},{user:this.Cc(),userTag:this.pe(),nonce:this.Cd()},this.yf()&&{idpName:this.yf()},{payload:this.Ii(),fullToken:this.N});return olympe.V.Qr(bb(a,JSON.stringify(b)))}};function Ie(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Ne(a,b){return qb(a.D,()=>a.db.set('main','string'===typeof b?b:b.ga(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function Pe(a){return qb(a.D,()=>a.db.remove('main',a.j).catch(b=>{a.G.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
|
|
554
|
-
olympe.auth.dt=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.V.promise.
|
|
555
|
-
d.parse;var f=cb(olympe.V.ef().D(olympe.V.Ow(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.$q(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.ik(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Wg(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.G.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.uk=class{redirect(){}D(){}j(){}};olympe.auth.uk.j={GET:'GET',Gh:'POST'};olympe.auth.
|
|
556
|
-
olympe.auth.Ud.Wu=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.
|
|
554
|
+
olympe.auth.dt=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.V.promise.Cm;this.db=this.F.D('AUTH')}oe(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return qb(this.D,()=>{const a=this;return w(function*(){let b;try{b=yield a.db.get('main',a.j)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.G.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
|
|
555
|
+
d.parse;var f=cb(olympe.V.ef().D(olympe.V.Ow(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.$q(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.ik(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Wg(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.G.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.uk=class{redirect(){}D(){}j(){}};olympe.auth.uk.j={GET:'GET',Gh:'POST'};olympe.auth.Un=class{constructor(a){this.j=a||'default'}};olympe.auth.Ud={};function af(a,b,c){Ge(a.D,olympe.auth.pd.j.Gg,{token:b.Cd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.pd.j.Ab:c(Error('Invalid token'),null);break;case olympe.auth.pd.j.Xi:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,l=e.protocol;'SAML'===l?d=new olympe.auth.$q(f,g,h,e.samlToken,k,Ze(b)):'openid'===l&&(d=new olympe.auth.ik(f,g,h,k,Ze(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
|
|
556
|
+
olympe.auth.Ud.Wu=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Ec.j.mm}oe(a,b){this.storage.oe().then(c=>{af(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function bf(a,b,c){var d=$e(b);const e=Math.max(d-b.N,0),f=olympe.W.getParameter(olympe.auth.U.vr);d=Math.max(Math.round(d-e*(1-Math.max(Math.min((f||50)/100,.95),0))-Date.now()),0);if(0<d)return setTimeout(()=>{a.qg(b,c)},d);a.qg(b,c);return null}
|
|
557
557
|
olympe.auth.Ud.nv=class extends olympe.auth.Ec{constructor(a,b,c,d){super(a,b);this.N=c;this.R=d}F(){return olympe.auth.Ec.j.OAUTH2}oe(a){const b=encodeURIComponent(this.N.j());a=Ze(a)?`idpName=${Ze(a)}&`:'';this.N.redirect(`${this.R}/auth?${a}url=${b}`,null,olympe.auth.uk.j.GET)}H(a,b){0<$e(a)?this.j=bf(this,a,b):b(null,a);return this.Y.bind(this)}qg(a,b){He(this.D,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.j&&(this.j=bf(this,d,b)))})}Y(){this.j&&clearTimeout(this.j);this.j=null}};function cf(a,b){Ge(a.D,olympe.auth.pd.j.SAML,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.Ud.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.N=c}F(){return olympe.auth.Ec.j.SAML}oe(a,b){cf(this,c=>{c?b(c,null):this.N.D(Ze(a))})}};function df(a,b,c){const d=olympe.auth.pd.j.Zt,e=olympe.auth.pd.j.Ab,f=olympe.auth.pd.j.Zv,g={I:b.Cc()};Ge(a.D,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.Cc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
|
|
558
558
|
function ef(a,b,c){const d=olympe.auth.pd.j.Xs,e=olympe.auth.pd.j.Ab,f=olympe.auth.pd.j.Xi;b={A:b.get('a'),M:b.get('m1'),I:b.Cc()};Ge(a.D,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.G.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.G.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.Wg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
|
|
559
|
-
null)}})}olympe.auth.Ud.SRP=class extends olympe.auth.Ec{F(){return olympe.auth.Ec.j.SRP}oe(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');df(this,a,(d,e,f)=>{this.G.debug('Received Salt+B message');if(d)b(d,null);else{try{const g=new SRPClient;g.step1(a.Cc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g,null);return}this.G.debug('Sending SRP A+M (proof) message');ef(this,a,b)}})}};olympe.auth.P={Da:'auth.Manager',Ca:'auth.Logger',Wi:'auth.Storage',kl:'auth.appNameToken',qk:'auth.Redirector',dr:'auth.ServerConnector'};olympe.auth.U={Fl:'auth.defaultProvider',
|
|
560
|
-
olympe.W.config(function(a){F(a,olympe.auth.U.Fl,olympe.auth.Ec.j.SRP);F(a,olympe.auth.U.
|
|
561
|
-
olympe.auth.P.qk,olympe.auth.P.Wi);Xa(a,olympe.auth.P.qk);E(a,olympe.auth.P.Da,[olympe.auth.P.Ca,olympe.L.P.qf,olympe.auth.P.dr,olympe.host.P.Ue,olympe.host.P.yk,new olympe.W.ub(olympe.auth.P.Wi,olympe.W.qh.j.
|
|
559
|
+
null)}})}olympe.auth.Ud.SRP=class extends olympe.auth.Ec{F(){return olympe.auth.Ec.j.SRP}oe(a,b){const c=a.get('password');a.j.delete('password');this.G.debug('Sending SRP request');df(this,a,(d,e,f)=>{this.G.debug('Received Salt+B message');if(d)b(d,null);else{try{const g=new SRPClient;g.step1(a.Cc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g,null);return}this.G.debug('Sending SRP A+M (proof) message');ef(this,a,b)}})}};olympe.auth.P={Da:'auth.Manager',Ca:'auth.Logger',Wi:'auth.Storage',kl:'auth.appNameToken',qk:'auth.Redirector',dr:'auth.ServerConnector'};olympe.auth.U={Fl:'auth.defaultProvider',On:'auth.autoLogin',Qn:'auth.autoUser',Pn:'auth.autoPassword',Zi:'auth.token',jo:'auth.cacheTokenTimeout',vr:'auth.tokenDurationPercentage'};
|
|
560
|
+
olympe.W.config(function(a){F(a,olympe.auth.U.Fl,olympe.auth.Ec.j.SRP);F(a,olympe.auth.U.On,!1);F(a,olympe.auth.U.Qn,'');F(a,olympe.auth.U.Pn,'');F(a,olympe.auth.U.Zi,'');F(a,olympe.auth.U.vr,50);F(a,olympe.auth.U.jo,3E5);E(a,olympe.auth.P.Ca,[olympe.ja.P.Da],b=>b.cd('auth'));D(a,olympe.auth.P.kl,olympe.auth.Un,olympe.Eb.P.Sg);D(a,olympe.auth.P.Wi,olympe.auth.dt,olympe.Eb.P.bk,olympe.auth.P.Ca,olympe.auth.P.kl);D(a,olympe.auth.P.dr,olympe.auth.pd,olympe.auth.P.Ca,olympe.L.P.vk,olympe.L.P.Rl,olympe.L.P.qf,
|
|
561
|
+
olympe.auth.P.qk,olympe.auth.P.Wi);Xa(a,olympe.auth.P.qk);E(a,olympe.auth.P.Da,[olympe.auth.P.Ca,olympe.L.P.qf,olympe.auth.P.dr,olympe.host.P.Ue,olympe.host.P.yk,new olympe.W.ub(olympe.auth.P.Wi,olympe.W.qh.j.im),new olympe.W.ub(olympe.auth.P.qk,olympe.W.qh.j.im),new olympe.W.pa(olympe.auth.U.Fl),new olympe.W.pa(olympe.auth.U.On),new olympe.W.pa(olympe.auth.U.Qn),new olympe.W.pa(olympe.auth.U.Pn),new olympe.W.pa(olympe.auth.U.Zi),new olympe.W.pa(olympe.auth.U.jo)],(b,c,d,e,f,g,h,k,l,n,p,q,r)=>{const t=
|
|
562
562
|
[new olympe.auth.Ud.Wu(b,d,g),new olympe.auth.Ud.SRP(b,d),new olympe.auth.Ud.SAML(b,d,h),new olympe.auth.Ud.nv(b,d,h,Ld(d.Ah,olympe.L.Yb.fk))];if(!t.map(u=>u.F()).includes(k))throw Error(`Default provider name ${k} given by parameter ${olympe.auth.U.Fl} cannot be found`);return new olympe.auth.Ta(b,c,d,g,h,e,f,t,new Map([['defaultProvider',k],['autoLogin',l],['autoUser',n],['autoPassword',p],['autoToken',q],['cacheTokenTimeout',r]]))},!0)},'olympe.auth');
|
|
563
563
|
olympe.W.run([olympe.auth.P.Da],a=>{olympe.auth.me=()=>a});olympe.Va.node.auth={};olympe.Va.node.auth.iq=class{redirect(){console.warn('Redirection n/a in Node.JS')}D(){console.warn('Redirection n/a in Node.JS')}j(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Va.node.auth.iq.xa=[olympe.auth.uk];olympe.W.config(a=>{D(a,olympe.auth.P.qk,olympe.Va.node.auth.iq)},'olympe.native.node.auth');olympe.Va.node.Eb={};function ff(){throw Error('Key-Value Database does not implement this in NodeJS');}
|
|
564
564
|
olympe.Va.node.Eb.gq=class{constructor(a){this.G=a;this.j=new Map}Y(){return 0}N(a){const b=this;return w(function*(){let c,d;return null!=(d=null==(c=b.j.get(a))?void 0:c.size)?d:0})}F(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return w(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return w(function*(){let d;for(const [e,f]of null!=(d=c.j.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
|
|
565
565
|
return w(function*(){let d,e;return null!=(e=null==(d=c.j.get(a))?void 0:d.has(b))?e:!1})}get(a,b){const c=this;return w(function*(){let d;return null==(d=c.j.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return w(function*(){let e;return null==(e=d.j.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return w(function*(){let d;yield null==(d=c.j.get(a))?void 0:d.delete(b)})}da(){ff();return Promise.resolve()}$(){ff();return Promise.resolve()}clear(a){const b=this;return w(function*(){let c;
|
|
566
|
-
null==(c=b.j.get(a))||c.clear()})}H(){ff();return Promise.resolve([])}D(){return w(function*(){ff()})}};olympe.Va.node.Eb.gq.xa=[olympe.Eb.Lu];olympe.Va.node.Eb.hq=class{constructor(a){this.j=new Map;this.G=a}D(a){this.j.has(a)||this.j.set(a,new olympe.Va.node.Eb.gq(this.G));return this.j.get(a)}};olympe.Va.node.Eb.hq.xa=[olympe.Eb.Mu];olympe.W.config(function(a){D(a,olympe.Eb.P.bk,olympe.Va.node.Eb.hq,olympe.Eb.P.Ca)},'olympe.native.node.localstorage');olympe.Va.node.storage={};olympe.Va.node.storage.Storage=class{constructor(a){this.G=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Va.node.storage.Storage.xa=[olympe.Eb.Storage];olympe.W.config(function(a){Va(a,olympe.Eb.P.Wi,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.pg={};olympe.pg.U={VERSION:'version.version',gt:'version.branch',pf:'version.commit',fw:'version.tag'
|
|
566
|
+
null==(c=b.j.get(a))||c.clear()})}H(){ff();return Promise.resolve([])}D(){return w(function*(){ff()})}};olympe.Va.node.Eb.gq.xa=[olympe.Eb.Lu];olympe.Va.node.Eb.hq=class{constructor(a){this.j=new Map;this.G=a}D(a){this.j.has(a)||this.j.set(a,new olympe.Va.node.Eb.gq(this.G));return this.j.get(a)}};olympe.Va.node.Eb.hq.xa=[olympe.Eb.Mu];olympe.W.config(function(a){D(a,olympe.Eb.P.bk,olympe.Va.node.Eb.hq,olympe.Eb.P.Ca)},'olympe.native.node.localstorage');olympe.Va.node.storage={};olympe.Va.node.storage.Storage=class{constructor(a){this.G=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Va.node.storage.Storage.xa=[olympe.Eb.Storage];olympe.W.config(function(a){Va(a,olympe.Eb.P.Wi,olympe.Va.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.pg={};olympe.pg.U={VERSION:'version.version',gt:'version.branch',pf:'version.commit',fw:'version.tag',$o:'version.olympe-framework',ht:'version.build'};olympe.W.config(function(a){F(a,olympe.pg.U.VERSION,'');F(a,olympe.pg.U.gt,'');F(a,olympe.pg.U.pf,'');F(a,olympe.pg.U.fw,'');F(a,olympe.pg.U.$o,'');F(a,olympe.pg.U.ht,'')},'olympe.main');const gf=require('fs'),hf=require('fs/promises');let jf;const kf=null!=(jf=process.env.EXTRA_CONFIG_PATH)?jf:null;let lf;const Bb=null!=(lf=process.env.EXTRA_CONFIG_KEY_PREFIX)?lf:'';function Ab(a){return hf.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
|
|
567
567
|
function mf(a){var b=nf;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{hf.access(c,gf.constants.F_OK).then(()=>{gf.watch(c,d=>w(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.V.Cs([c]),f=olympe.W.ms(e);for(const [g,h]of f)a.Ej(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
|
|
568
568
|
function of(){console.log('The node process received a signal for graceful shutdown');let a,b,c,d;(null!=(d=null==(b=(a=olympe.Va.node.host).Tk)?void 0:null==(c=b.call(a))?void 0:Oc(c))?d:Promise.resolve()).then(()=>console.log('The node backend has stopped successfully')).catch(e=>console.warn(e)).finally(()=>process.exit(0))}process.on('SIGTERM',of);process.on('SIGINT',of);process.on('SIGBREAK',of);process.on('SIGHUP',of);
|
|
569
569
|
process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);of()});const nf=['oConfig.json','conf.d/oConfig.json','version.json'];kf&&nf.push(kf);
|
|
570
570
|
olympe.V.Cs(nf).then(a=>{try{const b=Object.create(null),c=process.argv;for(let f=2;f<c.length;f++){const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(c[f]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${c[f]}" ignored. It should of the form 'a=b'`):b[g[1]]=olympe.V.Rr(g[3])}const d=new olympe.W.zt(a,b);Ka(d);const e=d.compile();Ma(e);mf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
|
|
571
571
|
setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.va={ORIGIN:'<',DESTINATION:'>'};B('olympe.dc.Direction',olympe.dc.va);olympe.dc.fc={Yc:'ff022000000000000000',zi:'ff02200000000000000e',Nj:'ff02200000000000000f'};olympe.dc.Jp={VERSION:'@v',ir:'@s'};olympe.dc.de={Se:'?',dg:'~'};olympe.dc.IC={Ri:'online',Ae:'offline',oB:'invalidate'};olympe.dc.Ja={SELF:'self',SERVER:'server',Bf:'remote'};
|
|
572
|
-
olympe.dc.Lb={NONE:null,
|
|
572
|
+
olympe.dc.Lb={NONE:null,Io:'ff023000000000000037',Dc:'ff023000000000000137',fg:'ff023000000000000237',Wv:'ff023000000000000337',Gt:'ff023000000000000437',rw:'ff023000000000000537',qB:olympe.dc.de.dg+'ff023000000000000037',rB:olympe.dc.de.dg+'ff023000000000000237',pB:olympe.dc.de.dg+'ff023000000000000437',yD:olympe.dc.de.dg+'ff023000000000000537'};olympe.dc.rq=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.ae(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.sb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.kq=class extends Error{constructor(){var a=pf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Oc(){}Wc(){}D(){}Oa(){}hc(){}};olympe.dc.Cq=class{qc(){}T(){}H(){}};olympe.dc.uc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Ea(a){return a instanceof olympe.dc.uc&&this.tag===a.tag}};olympe.dc.uc.xa=[olympe.dc.Te];olympe.dc.uc.prototype.Ea.K=olympe.C.J.j;olympe.dc.Pt=class a{constructor(b,c,d,e,f,g){this.G=b;this.$=c;this.db=c.view;this.da=d;this.Tb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.V.Nh(6E5),(h,k)=>{URL.revokeObjectURL(k);qf(this.db,h,a.j(h))})}ha(b,c,d,e,f){this.$a(c).then(g=>{this.jb(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}H(b){const c=this;return w(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.G.error(f);throw Error(f);},e=b.X();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
|
|
573
573
|
new Uint8Array(g,0,g.byteLength)).catch(d)}return c.downloadFileContent(b).then(f=>c.D.H(f)).then(f=>{if(c.N){let g;const h=null!=(g=b.get(olympe.dm.File.mimeTypeProp))?g:'application/data';c.R(e,new Blob([f],{type:h}))}return f}).catch(d)})}downloadFileContent(b){var c=b.X(),d=b.get(olympe.dm.File.j);const e=b.get(olympe.dm.File.urlProp);if(e.startsWith('stream:'))return this.Y(c).then(()=>this.downloadFileContent(b));if(e.startsWith('blob:'))return this.D.F(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f,
|
|
574
574
|
0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.$f,olympe.dc.ae().Ke(b),{tag:c,model:d,url:e.valueOf()}),this.Tb.request(c);c=N(e);Cc(c,olympe.net.wa.ResponseType.pl);return Dc(this.da,c).then(f=>{const g=f.Hc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}ua(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.Yf,d,{tag:b,model:c});return this.Tb.request(c).then(()=>this.G.debug(`Successfully deleted file: ${b}`)).catch(e=>
|
|
575
575
|
{throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ga(b){const c=new olympe.V.stream.Df;this.H(b).then(d=>{db(d).pipeTo(c).catch(()=>{})});return c}zb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.ec;e.Wc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.$.Tc(rf(e));let f;null==(f=this.j.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.j.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.j.delete(b)})}Y(b){return new Promise((c,d)=>{let e;
|
|
576
576
|
const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}jb(b,c,d,e,f,g){const h=e?k=>{this.R(b,new Blob([c],{type:d}));f(k)}:f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.j.hg,olympe.dc.ae().Ke(b),{tag:b,model:e,content:c,mimeType:d});this.Tb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}$a(b){return w(function*(){var c=b instanceof olympe.C.Sa?b.valueOf():b;return'string'===typeof c?$a(c):c instanceof ArrayBuffer?new Uint8Array(c,
|
|
577
577
|
0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.fa(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);sf(this.db,d,f=>{f||(this.F.delete(d),qf(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function tf(a,b){let c=uf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.bf(b);if(null===b)break;c=uf(b)}let e;return null!=(e=c)?e:null}olympe.dc.iu=class{constructor(a,b,c){this.G=a;this.j=b;this.db=b.view;this.D=c;this.Ra=new FinalizationRegistry(d=>{this.G.F()&&this.G.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.j.detach([d],olympe.dc.db.Instance.j.Bp)})}};function vf(a,b){a.origin=b;return a}function wf(a,b,c){a.D.set(b,c);return a}function xf(a){let b;return null!=(b=a.D)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ja.SELF;this.j=b;this.content=null!=c?c:null;this.F=null!=d?d:rd(olympe.auth.me()).pe();this.D=new Map}getType(){return this.type}Cc(){return this.F}ic(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
|
|
578
|
-
olympe.dc.Request.j={oc:1,Cg:10,Rt:24,mp:25,St:28,Lg:30,pk:31,eC:32,Ze:40,Vg:41,
|
|
578
|
+
olympe.dc.Request.j={oc:1,Cg:10,Rt:24,mp:25,St:28,Lg:30,pk:31,eC:32,Ze:40,Vg:41,Yn:42,Oq:43,tD:44,si:45,$n:46,Xj:47,hg:50,$f:51,Yf:52,ow:60,Ev:61,hp:62,hB:63,pt:64,oh:65,Ao:91,Tt:93,gm:95,QUERY_RESULT:97};function yf(a,b,c,d,e){const f=olympe.C.ah();a.sources.set(olympe.dc.Ja.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ja.Bf,d.init(a)):sf(b,a.j,()=>{a.sources.set(olympe.dc.Ja.Bf,d.init(a));const g=new Map;olympe.dc.ma.from(a.j,a.j).fb(olympe.dm.DataSource.zj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Vh,!0)).observe(f).subscribe(h=>{var k=h.sj();for(var l of k){const [p,q]=g.get(l);c.D(p);c.R(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.nj();for(const p of h)if(h=
|
|
579
579
|
p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.Tp(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Ee.j.READINESS);n=c.F(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});qf(b,a.j,'router',!0)},'router')}function zf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
|
|
580
580
|
olympe.dc.Kv=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=f;this.F=g;this.sources=new Map;this.D=new Map;yf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.sb(a.ic()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.sb(a.ic()).subscribe(a,b)}vd(a){const b=a.ic();if(b===this.j){let c;null==(c=this.D.get(a.getType()))||c.forEach(d=>d(a))}else olympe.L.ub.publish(b,a).catch(c=>{this.G.error(`Error while publishing the message ${a} to remote router: ${c}`)})}sb(a){let b;
|
|
581
581
|
return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ja.Bf)}};function rf(a,b){b=new olympe.dc.Ag(a.T(),null!=b?b:null);b.j=a;return b}function Af(a,b,c,d){c=new olympe.dc.Ag(null!=d?d:olympe.V.Ic(),null!=c?c:null);c.D=b;c.Fa=a;return c}
|
|
582
582
|
olympe.dc.Ag=class{constructor(a,b){this.id=a;this.Fa=this.j=this.D=null;this.Lk=b}static j(a){return Af(a.p,a.s,a.t,a.i)}T(){return this.id}qc(a){return this.j instanceof olympe.dc.db.ec?this.j.qc(a):Array.isArray(this.Fa)?(new olympe.dc.transaction.Si(this.D)).D(this.Fa,a):a}H(){let a,b,c,d;return null!=(d=null!=(c=null==(a=this.Fa)?void 0:a.length)?c:null==(b=this.j)?void 0:b.H())?d:0}jc(){return this.j instanceof olympe.dc.db.ec?this.j:Array.isArray(this.Fa)?(this.j=(new olympe.dc.transaction.Si(this.D)).j(this.Fa,
|
|
583
|
-
this.id),this.Fa=null,this.j):new olympe.dc.db.ec(this.id)}Rk(){if(Array.isArray(this.Fa))return this.Fa;if(this.j instanceof olympe.dc.db.ec){const a=new olympe.dc.transaction.Ce;this.j.qc(a);return Bf(a)}return[]}ga(){return{p:this.Rk(),t:this.Lk,s:this.D,i:this.id}}};olympe.dc.Ag.xa=[olympe.dc.Cq];olympe.dc.Ra={};const Cf=olympe.dc.va.ORIGIN,Df=olympe.dc.va.DESTINATION,Ef=new Map,Ff=new Map,Gf=new Map,Hf=new Map;function uf(a){let b;return null!=(b=Ef.get(a))?b:null}function If(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.
|
|
583
|
+
this.id),this.Fa=null,this.j):new olympe.dc.db.ec(this.id)}Rk(){if(Array.isArray(this.Fa))return this.Fa;if(this.j instanceof olympe.dc.db.ec){const a=new olympe.dc.transaction.Ce;this.j.qc(a);return Bf(a)}return[]}ga(){return{p:this.Rk(),t:this.Lk,s:this.D,i:this.id}}};olympe.dc.Ag.xa=[olympe.dc.Cq];olympe.dc.Ra={};const Cf=olympe.dc.va.ORIGIN,Df=olympe.dc.va.DESTINATION,Ef=new Map,Ff=new Map,Gf=new Map,Hf=new Map;function uf(a){let b;return null!=(b=Ef.get(a))?b:null}function If(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.Fn||[])];return olympe.dc.oa.j(b,c,...a)}function Jf(a,b){Hf.set(a,b);return a}function Kf(a){let b,c;return null!=(c=null==(b=Ef.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
|
|
584
584
|
function Lf(a,b,c){const d=a+'@'+(b===Df?Cf:Df);if(Ff.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Ff.set(d,c)}function Mf(a){a=a.X()+'@'+a.Ka();return Ff.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;Gf.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
|
|
585
|
-
olympe.dc.
|
|
586
|
-
olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.
|
|
587
|
-
a)}ka(a){return new olympe.dc.Ra.Property(a)}sa(a,b=olympe.dc.va.DESTINATION){Lf(a,b,this.D);return new olympe.dc.ba.Ve(a,b)}
|
|
585
|
+
olympe.dc.oa=class{constructor(){}static j(a,b,...c){if(Ef.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${Ef.get(a).D.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.W.ub(g):g}}b=new olympe.dc.Ra.Entry(a,b,d);Ef.set(a,b);return b.D.entry=b}static ac(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function Nf(a,b){a.j=b}function R(a,b){b=b.$b();Lf(b.X(),b.Ka(),a.D);return b}function Of(a){a.F=!0;return a}
|
|
586
|
+
olympe.dc.Ra.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.Fn=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.qn()&&b.getParameter(olympe.dc.U.Ro)){var d=olympe.dc.ia();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ja.ab('dc').error(d)}return this.Fn?(a=[void 0,a].concat(Na(b,this.Fn)),new c(...a)):new c(void 0,
|
|
587
|
+
a)}ka(a){return new olympe.dc.Ra.Property(a)}sa(a,b=olympe.dc.va.DESTINATION){Lf(a,b,this.D);return new olympe.dc.ba.Ve(a,b)}qn(){return this.F}};B('olympe.dc.registry.Entry',olympe.dc.Ra.Entry);olympe.dc.Ra.Entry.prototype.addRelation=olympe.dc.Ra.Entry.prototype.sa;olympe.dc.Ra.Entry.prototype.addProperty=olympe.dc.Ra.Entry.prototype.ka;olympe.dc.Ra.Entry.xa=[olympe.dc.Te];olympe.dc.Ra.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ra.Property.prototype.getTag=olympe.dc.Ra.Property.prototype.X;olympe.dc.Ra.Property.xa=[olympe.dc.Te];olympe.dc.Ra.Relation=class{constructor(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.fa(a);this.direction=b;this.origin=c;this.H=d}X(){return this.tag}Ka(){return this.direction}type(){return this.H}$b(){return new olympe.dc.Ra.Relation(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION,this.H,this.origin)}Ea(a){return a instanceof olympe.dc.Ra.Relation?a.X()===this.X()&&a.Ka()===this.Ka():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
|
|
588
588
|
olympe.dc.Ra.Relation.prototype.getInverse=olympe.dc.Ra.Relation.prototype.$b;olympe.dc.Ra.Relation.prototype.getDirection=olympe.dc.Ra.Relation.prototype.Ka;olympe.dc.Ra.Relation.prototype.getTag=olympe.dc.Ra.Relation.prototype.X;olympe.dc.Ra.Relation.xa=[olympe.dc.Te];olympe.dc.db={};function Pf(a,b){const c=a.H,d=olympe.dc.ia(),e=olympe.dc.db.Database.D.Ti,f=olympe.dc.db.Database.D.Se,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.ec('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Bb.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Lb.NONE);for(const [r,t]of l.Ed())k.hc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.td())for(const r of Qf(d,n,l.H())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
|
|
589
589
|
y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,K)=>{k.Oa(z,K,r)}):y===h&&u.forEach((A,K)=>{k.Oa(z,r,K)})});l=l.source();k.Oc(r,l,t)}else{const r=new Map;for(const t of l.Db().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Rf(p,u,!0):p.Qa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Wc(n,r);for(const [t,u,x]of l.Ed())x?k.hc(t,n,u):k.Oa(t,n,u)}}});return k}
|
|
590
590
|
function Sf(a,b,c){const d=b.T();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new Tf(b,Pf(a,b));a.D.unshift(d);a.F.set(d,e);a.H.Bs(c);a.write(b,!1,!1)}
|
|
591
591
|
function Uf(a,b,c){if(0>=a.N||null===c)return b;var d=a.j.findIndex(h=>h.T()===b.T()),e=a.j[d];-1<d&&a.j.splice(d,1);d=0<a.j.length?a.j.findIndex(h=>c>=h.D):0;d=-1<d?d:a.j.length;const f=a.j.slice(0,d).reduce((h,k)=>k.Tc(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new Vf(f,c,a.j,a.N);a.j.splice(d,0,e);a.G.F()&&a.G.debug('CommitController buffer:\n',a.j.map(h=>`${h.T()} at ${h.D}`).join('\n'));return f}
|
|
592
|
-
function Wf(a,b,c){return a.D.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.Tc(d))?f:d},b)}function Xf(a,b,c,d=!1){return w(function*(){const e=new olympe.dc.db.
|
|
592
|
+
function Wf(a,b,c){return a.D.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.Tc(d))?f:d},b)}function Xf(a,b,c,d=!1){return w(function*(){const e=new olympe.dc.db.Km(a.G,a.H,a.ia,c);e.open(d);for(const f=fa(b);;){const g=yield f.next();if(g.done)break;e.write(g.value,a.R)}e.close()})}
|
|
593
593
|
function Yf(a,b,c,d){b=b.pipeThrough(olympe.V.stream.tap(e=>{0<a.D.length&&Uf(a,Wf(a,e.jc(),a.D.length),e.Lk)}));return Xf(a,b,c,d).then(()=>a.G.debug('Rebase stream completed')).catch(e=>a.G.error('Rebase stream failed:',e))}
|
|
594
594
|
olympe.dc.db.xt=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ia=c;let e;this.R=null!=(e=d.get('debug'))?e:!1;let f;this.N=null!=(f=d.get('bufferTimeout'))?f:0;this.D=[];this.F=new Map;this.j=[];b.addEventListener(olympe.dc.db.Database.j.ep,g=>{this.j.forEach(h=>{for(const k of g)h.j.j(k)})})}Tc(a,b,c){const d=a.T(),e=a.Lk;this.F.has(d)?this.push(d,e):(a=Uf(this,Wf(this,a.jc(),this.D.length),e),this.write(a,b,c))}push(a,b){const c=this.D.indexOf(a);if(-1<c){const d=this.F.get(a);this.D.splice(c,
|
|
595
|
-
1);Uf(this,Wf(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.
|
|
595
|
+
1);Uf(this,Wf(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.Km(this.G,this.H,this.ia,b);b.open(c);b.write(a,this.R);b.close()}};class Zf{T(){}Tc(){}}function $f(a,b,c,d){const e=olympe.dc.va.DESTINATION;c=c.tag();const f=a.j.Qc(c);b.Db().forEach((g,h)=>{f.ka(h,g);b.da(h)});for(const [g,h,k,l]of b.ha()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.j.Oa(g,n,p);d.N(g,n,p)}}
|
|
596
596
|
function ag(a,b,c,d){const e=olympe.dc.va.DESTINATION,f=c.tag(),g=a.j.Qc(f);b.Db().forEach((h,k)=>{void 0!==c.Qa(k)&&(g.ka(k,h),b.da(k))});for(const [h,k,l]of b.Ed()){const n=c.zb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
|
|
597
597
|
class Tf extends Zf{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ia()}T(){return this.D.T()}Tc(a){for(const [b,c]of this.D.da(a)){const d=b.tag();c.td()?b.D()?a.j(d,b.H()):(this.D.j(d,c.H()),this.j.j(d,c.H())):b.td()?($f(this,c,b,a),a.j(d,b.H())):ag(this,c,b,a)}return a}}function bg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
|
|
598
598
|
class Vf extends Zf{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;bg(this)}T(){return this.j.T()}Tc(a){return a.R(this.j)}update(a,b){this.D=b;a.qc(this.j);bg(this);return this}};const cg=olympe.dc.fc.Yc,dg=olympe.dc.fc.zi,eg=olympe.dc.va.ORIGIN,fg=olympe.dc.va.DESTINATION;let gg=0;
|
|
599
599
|
olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ja.SELF;this.G=b;this.Bd=olympe.C.Xa();this.R=olympe.dc.db.Database.F.IDLE;this.ua=new Map;this.zc=[];this.$=new Map;this.H=null;this.ha=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.vf.j.Hl;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Id=new olympe.dc.db.vf(c,this,b,f);d.get('debug')&&this.xs()}T(){return this.id}getState(){return this.R}ab(){return this.G}create(b,
|
|
600
600
|
c,d,e=!1){var f=this.N(b,!0);if(!f.e&&null!==c&&(null===f.H||f.H===c)){f.H=c;let g;(null==(g=f.model())?0:g.e)&&f.db.da(f,!0)}e&&f.persist();this.R===a.F.ol&&hg(f,!0);d&&this.$c(f,d);this.D(a.j.Cp,b)}update(b,c){c&&(b=this.N(b,!0),this.$c(b,c))}Ga(b){const c=this.get(b);void 0!==c&&(this.da(c,!1),this.D(a.j.Dp,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case cg:ig(c,d);break;case dg:jg(c,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!==d)switch(b){case cg:kg(c,
|
|
601
|
-
d);break;case dg:lg(c,d);break;default:c.unlink(b,d)}}ai(b,c){for(const d of b)this.N(d).je(c)}Wk(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Bs(b){b.forEach(c=>{this.N(c).persist()})}Rd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.
|
|
601
|
+
d);break;case dg:lg(c,d);break;default:c.unlink(b,d)}}ai(b,c){for(const d of b)this.N(d).je(c)}Wk(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Bs(b){b.forEach(c=>{this.N(c).persist()})}Rd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.Po,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Oc(b,c)}Oc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.Oo,b);c&&this.R!==a.F.ol&&this.D(a.j.Jm,b);return d}Mb(b){var c=olympe.V.di();this.H?mg(this.H,
|
|
602
602
|
c,b):b()}Y(b){let c;null!=(c=this.H)&&c.j.delete(b)}$a(b,...c){this.ua.has(b)&&this.ua.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.$a(b,c,...d)}da(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}af(b,c,d,e){let f;null!=(f=this.H)&&ng(f,b).ka(e?og+c:c,d)}$h(b,c,d,e,f){let g;null!=(g=this.H)&&(d===pg?f?ng(g,b).link(c,e):ng(g,b).unlink(c,e):f?ng(g,b).Mb(c,e):ng(g,b).vc(c,e))}jb(b,c,d){let e;null!=(e=this.H)&&ng(e,b).Rd(c,d)}addEventListener(b,c){let d=this.ua.get(b);void 0===d&&(d=[],this.ua.set(b,d));d.push(c)}j(b,
|
|
603
603
|
c){this.addEventListener(b,c)}zb(b){this.zc.push(b)}F(b){for(const c of this.$.values())if(c.R.has(b))return!0;return!1}ci(b=!1){const c=gg++;this.R=a.F.il;this.ha.add(c);b||this.$.set(c,new olympe.dc.db.Lt(c,this,this.Bd));return c}Oy(b,c){if(!this.ha.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.H=null!=(d=this.$.get(b))?d:null;b=this.R;this.R=null===this.H?a.F.ol:a.F.tv;c();this.R=b;this.H=null}$e(b){this.R=a.F.pf;const c=this.$.get(b);c&&(this.H=
|
|
604
604
|
c,qg(this.H),rg(this.H),this.$.delete(b),this.H=null);this.ha.delete(b);0===this.ha.size&&(this.R=a.F.IDLE,this.zc.forEach(d=>{d()}),sg(this.Id))}$c(b,c){const d=a.D.Se;for(const [e,f]of c)void 0!==f&&(e[0]===d?tg(b,e.substring(1),f):b.update(e,f))}vc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(eg+cg)))for(const f of c.values())null!==f.source()&&this.vc(b,f,d);return d}xs(){const b=a.j.Kl,c=a.j.rk,d=new Set,e=new Map;this.j(a.j.Cp,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});
|
|
605
605
|
this.j(c,(f,...g)=>{if(g[0]===dg&&g[1]===fg){const h=g[2];this.get(h).Ha()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.zb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.G.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.G.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+
|
|
606
|
-
`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={Ti:'$',du:'~',Se:'?',jl:'=',zp:'|',vi:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.j={
|
|
607
|
-
olympe.dc.db.Ht=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.xt(a,b,c,d);this.Xy=new olympe.dc.db.bv(a,c,b,e)}ab(){return this.G}Tc(a,b={}){let c,d;this.j.Tc(a,null!=(c=b.persist)?c:!0,null!=(d=b.
|
|
606
|
+
`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={Ti:'$',du:'~',Se:'?',jl:'=',zp:'|',vi:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.j={Oo:0,Po:1,Ar:2,Jm:3,ko:4,lo:5,Kl:6,Dc:7,rk:8,xm:9,Cp:10,Dp:11,Jq:12,dA:13,cA:14,jw:15,ep:16};olympe.dc.db.Database.F={IDLE:0,il:1,tv:2,ol:3,pf:4};function ug(a,b,c=[]){const d=b.T();Sf(a.j,b,c);return e=>{if(null!==e)a.j.push(d,e);else{e=a.j;var f=e.F.get(d);if(void 0!==f){const g=e.D.indexOf(d);e.D.splice(g,1);f=Wf(e,f.j,e.D.length);e.write(Uf(e,f,Date.now()),!1);e.F.delete(d)}}}}function vg(a,b,c={}){let d,e;return Yf(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.Tm)?e:!1)}function wg(a,b){a.D.zb(b)}
|
|
607
|
+
olympe.dc.db.Ht=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.xt(a,b,c,d);this.Xy=new olympe.dc.db.bv(a,c,b,e)}ab(){return this.G}Tc(a,b={}){let c,d;this.j.Tc(a,null!=(c=b.persist)?c:!0,null!=(d=b.Tm)?d:!1)}je(a,b){this.D.ai(a,b)}detach(a,b){this.D.Wk(a,b);return this}};const xg=olympe.dc.db.Database.D.ORIGIN,yg=olympe.dc.db.Database.D.DESTINATION,zg=olympe.dc.db.Database.D.Ti,Ag=olympe.dc.db.Database.D.Se,Bg=olympe.dc.db.Database.D.jl,Cg=olympe.dc.db.Database.D.zp,Dg=xg+yg,Eg=zg+zg,Fg=olympe.dc.db.Database.F;let Gg=0;function qf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=Hg(e,'',c);void 0!==f&&(a.j.getState()!==Fg.pf||e.F()&&!d||a.j.Y(c),d||!e.Ha()&&!e.F()||f(!1,b))}}
|
|
608
608
|
function sf(a,b,c,d){a=a.j.N(Ig(b));d=null!=d?d:Jg();Kg(a,'',d,c)&&a.Ha()&&c(!0,b);return d}function Qf(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.fa(e));for(const h of g)yield h,d.Qk(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function Jg(){++Gg;return String(Gg)}function Ig(a){if(a)return olympe.dc.fa(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
|
|
609
609
|
function Lg(a,b,c,d,e){a=a.j.N(Ig(b));c=Ig(c);b=zg+c;e=null!=e?e:Jg();if(Kg(a,b,e,d)&&a.Ha()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Bg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.fa(b)),!a||c&&!a.Ha()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function Mg(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.fa(c),Hg(b,zg+c,d),a.j.getState()===Fg.pf&&a.j.Y(d))}
|
|
610
610
|
function Ng(a,b,c,d){a=a.j.N(Ig(b));d=null!=d?d:Jg();Kg(a,Eg,d,c)&&a.Ha()&&a.forEach((e,f)=>{const g=f[0];g!==zg&&g!==Bg||c(f.substring(1),e,g===Bg)});return d}function Og(a,b,c){b=S(a,b);null!==b&&(Hg(b,Eg,c),a.j.getState()===Fg.pf&&a.j.Y(c))}function Pg(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ha()||!c&&g.F())e?d(b.substring(1),b[0],c,h):d(c,h)})}function T(a,b,c,d,e){a=a.j.N(Ig(b));c=c.Ka()+c.X();e=null!=e?e:Jg();(d=Qg(a,c,e,d))&&a.Ha()&&Pg(a,c,!0,d,!1);return e}
|
|
@@ -615,21 +615,21 @@ function Ug(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.de
|
|
|
615
615
|
function Zg(a,b,c){if(!a.Ha(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.fa(b)];for(const f of e){const g=a.bb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.G.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.fa(b)}`);return d}function $g(a,b,c,d){return(c=(a=S(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ha()).length:0}
|
|
616
616
|
olympe.dc.kb=class{constructor(a,b){this.G=a;this.j=b}T(){return this.j.T()}D(a,b,c,d=!1){a=S(this,a);if(null!==a){b=b.Ka()+b.X();const e=Hg(a,b,c);void 0!==e&&(this.j.getState()!==Fg.pf||a.F()&&!d||this.j.Y(c),d||!a.Ha()&&!a.F()||Pg(a,b,!1,e,!1))}}Ha(a){a=this.j.get(olympe.dc.fa(a));return!(null==a||!a.Ha())}name(a){let b,c;return null!=(c=null==(b=S(this,a))?void 0:b.Qa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=S(this,a,!0))?a.model():null)?a.tag():null}bf(a){return(a=(a=S(this,
|
|
617
617
|
a,!0))&&a.bf())?a.tag():null}ji(a){a=S(this,a,!0);return!(!a||!a.bf())}Ob(a,b){a=(a=S(this,a,!0))&&a.model();return!(!a||!this.Qf(a.tag(),b))}source(a){return(a=S(this,a,!0))&&a.source()}Le(a){a=S(this,a,!1);return!a||a.N}Qa(a,b,c){a=S(this,a,!0);b=olympe.dc.fa(b);let d;return null!=(d=null==a?void 0:a.Qa(b,c))?d:null}Db(a,b=!1){var c=S(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===zg||!b&&c===Bg)&&a.set(d.substring(1),e);return a}Qk(a,b){return Tg(this,a,b).filter(([c])=>c.Ha()).map(([c,
|
|
618
|
-
...d])=>[c.tag(),...d])}bb(a,b){a=S(this,a,!0);b=b.Ka()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ha()&&a.push(c.tag());return a}As(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.Ka()+b.X()))?void 0:e.get(olympe.dc.fa(c));return!(null==a||!a.Ha())}
|
|
618
|
+
...d])=>[c.tag(),...d])}bb(a,b){a=S(this,a,!0);b=b.Ka()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ha()&&a.push(c.tag());return a}As(a,b,c){let d,e;a=null==(d=S(this,a,!0))?void 0:null==(e=d.get(b.Ka()+b.X()))?void 0:e.get(olympe.dc.fa(c));return!(null==a||!a.Ha())}ln(a,b){a=S(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=S(this,d,!0).get(c.Ka()+c.X()),void 0!==a)for(const e of a.values())e.Ha()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
|
|
619
619
|
S(this,a,!0);const d=b.Ka()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Ha())?a.tag():null}eh(a,b,c){a=olympe.dc.fa(a);const d=Zg(this,a,b);d.delete(a);return c?(c=olympe.dc.fa(c),d.has(c)?Array.from(Zg(this,c,b.$b()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}bs(a,b,c){if(!this.Ha(a))return null;b=Zg(this,
|
|
620
|
-
a,b);const d=[olympe.dc.fa(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}
|
|
620
|
+
a,b);const d=[olympe.dc.fa(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}cn(a,b,c){return this.ln(a,b).find(c)||null}sx(a,b,c){return this.ln(a,b).filter(c)}ks(a,b=olympe.dc.CloudObject){var c=S(this,a,!0);const d=b&&S(this,b,!0),e=[c];for(;c&&c!==d;){c=c.bf();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ha())throw a=`Try to get all extensions of the model ${olympe.dc.fa(a)} but one of them does not exists (${c.tag()})`,
|
|
621
621
|
Error(a);null!==c&&e.push(c)}c=S(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}).`);return e.map(f=>f.tag())}Qf(a,b){const c=olympe.dc.fa(b);return!!this.bs(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Rc(a){return this.bb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.Rc;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Qf;
|
|
622
|
-
olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.ks;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.sx;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.
|
|
622
|
+
olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.ks;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.sx;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.cn;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.bs;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.eh;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Jb;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.ln;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.As;
|
|
623
623
|
olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.bb;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Db;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Qa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.Le;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Ob;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.ji;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.bf;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
|
|
624
624
|
olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ha;const ah=olympe.dc.db.Database.D.ORIGIN,pg=olympe.dc.db.Database.D.DESTINATION,og=olympe.dc.db.Database.D.jl,bh=olympe.dc.db.Database.D.Ti,ch=olympe.dc.db.Database.D.zp,dh=olympe.dc.db.Database.D.vi,eh=ah+pg,fh=bh+bh,gh=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function mg(a,b,c){let d=a.j.get(b);void 0===d&&(d=[],a.j.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
|
|
625
625
|
function qg(a){for(const [b,c]of a.H)a.D.vc(new Set,b).filter(d=>hg(d,c)).forEach(d=>{d=d.tag();c?ng(a,d).create():ng(a,d).delete()})}
|
|
626
626
|
function rg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.td()){var f=e.get(dh);f&&hh(a,f,c.D(),d);c.td()&&a.R.add(d)}for(const [n,p]of c.Db()){var g=n[0]===og,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(dh+bh+h);q&&hh(f,q,l,g);(k=k.get(dh+fh))&&hh(f,k,h,l,g)}for(const n of c.ha())ih(a,e,...n);(e=c.$)&&jh(a,e,d,c.zc,!c.td())});a.H.clear();a.F.clear();a.N.clear();kh(a)}function ng(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.yh(b),a.F.set(b,c));return c}
|
|
627
627
|
function hh(a,b,...c){b.forEach((d,e)=>{mg(a,e,d.bind(null,...c))})}function ih(a,b,c,d,e,f){var g=b.get(dh+d+c);g&&hh(a,g,f,e);(g=b.get(dh+eh))&&hh(a,g,c,d,f,e);lh(a,c,d).forEach((h,k)=>{(k=b.get(dh+ch+k))&&hh(a,k,c,d,h,f,e)})}function jh(a,b,c,d,e){gh.forEach(f=>{const g=f[0]===olympe.dc.de.dg;(f=a.D.get(g?c:b).get(dh+ch+f))&&hh(a,f,d,null,!0,e,g?b:c)})}
|
|
628
628
|
function kh(a){a.Y.run(()=>{const b=a.j;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.j.clear();a.buffer.length=0}function lh(a,b,c){const d=b+c;let e=a.N.get(d);if(!e){const f=a.D.get(b);e=new Map;gh.forEach(g=>{const h=g[0]===olympe.dc.de.dg;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(bh+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===ah?12:3)&k&&e.set(g,!!((c===ah?8:2)&k))});a.N.set(d,e)}return e}
|
|
629
|
-
olympe.dc.db.Lt=class{constructor(a,b,c){this.id=a;this.D=b;this.Y=c;this.H=new Map;this.F=new Map;this.R=new Set;this.j=new Map;this.N=new Map;this.buffer=[]}T(){return this.id}};function sg(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.vf.j.
|
|
629
|
+
olympe.dc.db.Lt=class{constructor(a,b,c){this.id=a;this.D=b;this.Y=c;this.H=new Map;this.F=new Map;this.R=new Set;this.j=new Map;this.N=new Map;this.buffer=[]}T(){return this.id}};function sg(a){if(!a.F&&0<a.D.size)switch(a.mode){case olympe.dc.db.vf.j.Mn:a.F=!0;setTimeout(()=>{a.j.getState()===olympe.dc.db.Database.F.IDLE&&a.run()},a.delay);break;case olympe.dc.db.vf.j.Yv:a.F=!0,a.run()}}
|
|
630
630
|
olympe.dc.db.vf=class{constructor(a,b,c,d){this.G=a;this.j=b;this.D=new Set;this.mode=c;this.delay=d;this.F=!1;c!==olympe.dc.db.vf.j.Hl&&this.init()}run(){const a=this.j;this.G.debug('Start garbage collector with',this.D.size,'instances to check');const b=[];for(const c of this.D){const d=a.get(c);!d||0<d.c||(this.G.debug('Remove unused instance',c,'from database'),a.Rd(c),b.push(c))}this.D.clear();this.j.$a(olympe.dc.db.Database.j.ep,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.Ar,b=olympe.dc.db.Database.j.Dp,
|
|
631
|
-
c=olympe.dc.db.Database.j.Jq,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&sg(this)};this.j.j(olympe.dc.db.Database.j.
|
|
632
|
-
l?a.Oa(h,f,k,g,e.Wb()):a.hc(h,f,k,g,e.Wb())});return a}jf(){return 0===this.Bb.size}H(){let a=0;this.Bb.forEach(b=>{a+=b.Bd()});return a}Oc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.Yc,a,d,d,null);c&&b.
|
|
631
|
+
c=olympe.dc.db.Database.j.Jq,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&sg(this)};this.j.j(olympe.dc.db.Database.j.Jm,e.bind(this));this.j.j(b,e.bind(this));this.j.j(a,f=>{this.D.delete(f)});this.j.addEventListener(olympe.dc.db.Database.j.jw,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.vf.j={Hl:0,Yv:1,Mn:2};olympe.dc.db.vf.D=5E3;olympe.dc.db.ec=class{constructor(a){this.id=null!=a?a:olympe.V.df();this.Bb=new Map}T(){return this.id}qc(a){const b=olympe.dc.db.yh.j.fm,c=olympe.dc.db.yh.j.Dc,d=olympe.dc.db.yh.j.Ek;this.Bb.forEach((e,f)=>{const g=e.Wb();switch(e.getState()){case b:const h=e.sb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.R()?e.Db():void 0;a.Oc(f,h,k,g);break;case d:e.R()&&a.Wc(f,e.Db(),g);break;case c:a.D(f,e.H(),g)}for(const [h,k,l]of e.Ed())e=this.Bb.get(k),
|
|
632
|
+
l?a.Oa(h,f,k,g,e.Wb()):a.hc(h,f,k,g,e.Wb())});return a}jf(){return 0===this.Bb.size}H(){let a=0;this.Bb.forEach(b=>{a+=b.Bd()});return a}Oc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.Yc,a,d,d,null);c&&b.Rm(c)}Wc(a,b,c=null){b&&this.F(a,c).Rm(b)}D(a,b=olympe.dc.Lb.NONE,c=null){const d=this.Bb.get(a);if(d&&d.D())this.j(a,b);else{this.F(a,c).delete(b);for(const e of this.Qk(a,b,!1))this.Bb.get(e).Db().clear(),this.Y(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
|
|
633
633
|
c);this.F(c,e).Mb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).vc(a,b)}$(a){var b=olympe.dc.ia();if(b.Ha(a)){const c=b.model(a),d=b.source(a),e=b.Db(a,!0);Xg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.de.Se}${g}`,f)});this.Oc(a,d,e,c);(b=b.bf(a))&&this.Oa(olympe.dc.fc.zi,a,b);e.forEach(f=>{f instanceof olympe.dc.uc&&this.$(f.X())})}}Rc(){return function*(a){for(const b of a.values())if(b.D()||b.td()||b.R())yield b}(this.Bb)}Qc(a){let b;return null!=(b=this.Bb.get(olympe.dc.fa(a)))?
|
|
634
634
|
b:null}j(a,b=olympe.dc.Lb.NONE){a=this.Qk(a,b);for(const c of a)this.Y(c,!1),this.Bb.delete(c)}Ed(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Ed((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Bb.values())}eh(a,b,c=(d,e)=>[d,e]){return this.ha(a,b,c)}*ha(a,b,c,d=[]){d.push(a);a=this.Qc(a);for(const [e,f]of a.bb(b))d.includes(e)||(yield*this.ha(e,b,c,d),yield c(e,f))}N(a,b,c){const d=this.Bb.get(b),e=this.Bb.get(c);d&&d.N(a,olympe.dc.va.DESTINATION,c);e&&e.N(a,olympe.dc.va.ORIGIN,
|
|
635
635
|
b)}Y(a,b){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION,e=this.Bb.get(a);for(const [g,h,k]of e.Ed())if(k||!b){e.N(g,d,h);var f=this.Bb.get(h);f&&f.N(g,c,a)}for(const [g,h,k]of e.jb())if(k||!b)e.N(g,c,h),(f=this.Bb.get(h))&&f.N(g,d,a)}*ps(a){let b;for(const [c,d]of(null==(b=this.Qc(a))?void 0:b.bb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Bb.get(c),a.td()||(yield a))}Qk(a,b,c=!0){const d=olympe.dm.Relation.j.Qq,e=olympe.dm.Relation.j.yr,f=olympe.dc.va.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
|
|
@@ -637,8 +637,8 @@ const h=new Set;for(const l of a){var k=this.Bb.get(l);if(void 0!==k){for(const
|
|
|
637
637
|
olympe.dc.va.DESTINATION;for(const [c,d]of this.da(a))if(a=c.tag(),d.td())this.j(a,d.H());else if(c.td())d.D()&&this.j(a,c.H());else{c.Db().forEach((e,f)=>{void 0!==d.Qa(f)&&c.da(f)});for(const [e,f,g]of c.Ed()){const h=d.zb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*da(a){var b=this.Bb;const c=a.Bb,d=(a=a.H()>this.H())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.ec.xa=[olympe.dc.Writable,olympe.dc.Cq];const mh=olympe.dc.db.Database.j,nh=olympe.dc.db.Database.D.Ti,oh=olympe.dc.db.Database.D.du,ph=olympe.dc.db.Database.D.Se,qh=olympe.dc.db.Database.D.jl,rh=olympe.dc.db.Database.D.vi,U=olympe.dc.va.ORIGIN,V=olympe.dc.va.DESTINATION,sh=olympe.dc.fc.Yc,th=olympe.dc.fc.zi;function Rf(a,b,c=!1){const d=a.get(ph+b);return c||void 0!==d?d:a.get(oh+b)}function hg(a,b){const c=a.e!==b;c&&(b?(a.e=b,uh(a)):(vh(a),a.e=b),a.db.D(b?mh.Kl:mh.Dc,a.j));return c}
|
|
638
638
|
function ig(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(sh,c)}a.link(sh,b);b.forEach((d,e)=>{if(e[0]===ph||e[0]===oh)e=e.substring(1),wh(a,e,d)});null===a.H||!b.e&&b!==a||a.db.da(a,!0)}function jg(a,b){const c=a.bf();if(null!==c){if(c===b)return;a.unlink(th,c)}a.link(th,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===ph||f[0]===oh)f=f.substring(1),a.has(ph+f)||(a.set(oh+f,e),d.set(f,e))});xh(a,d)}
|
|
639
639
|
function kg(a,b){a.unlink(sh,b);a.forEach((c,d)=>{c=d.substring(1);wh(a,c,null)});a.db.da(a,!1)}function lg(a,b){a.unlink(th,b);const c=new Map;a.forEach((d,e)=>{e[0]===oh&&(a.delete(e),d=e.substring(1),c.set(d,null))});xh(a,c)}
|
|
640
|
-
function tg(a,b,c){const d=ph+b;var e=a.get(d);e=void 0===e?null:e;if(!yh(e,c))if(zh(a,b,e,c,!0),e=oh+b,null===c){a.delete(d);let f;c=null==(f=a.bf())?void 0:Rf(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);xh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),xh(a,(new Map).set(b,c))}function Kg(a,b,c,d){const e=Ah(a,rh+b);return e.has(c)?!1:(e.set(c,d),a.je(olympe.dc.db.Instance.j.vi+b),a.db.D(mh.
|
|
641
|
-
function Hg(a,b,c){const d=Bh(a,rh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.vi+b),a.db.D(mh.
|
|
640
|
+
function tg(a,b,c){const d=ph+b;var e=a.get(d);e=void 0===e?null:e;if(!yh(e,c))if(zh(a,b,e,c,!0),e=oh+b,null===c){a.delete(d);let f;c=null==(f=a.bf())?void 0:Rf(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);xh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),xh(a,(new Map).set(b,c))}function Kg(a,b,c,d){const e=Ah(a,rh+b);return e.has(c)?!1:(e.set(c,d),a.je(olympe.dc.db.Instance.j.vi+b),a.db.D(mh.ko,a.j,b,c),!0)}
|
|
641
|
+
function Hg(a,b,c){const d=Bh(a,rh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.vi+b),a.db.D(mh.lo,a.j,b,c));return d}function Qg(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];if(g=a.db.get(f[g-1])){const k=olympe.dc.db.Instance.j.Gv+b;h?g.je(k):g.detach(k)}d(...f)};return Kg(a,b,c,e)?e:null}function yh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Ea?a.Ea(b):a===b}
|
|
642
642
|
function zh(a,b,c,d,e){c instanceof olympe.dc.uc&&(Ch(a.db.get(c.X())),a.db.Ga(c.X()));d instanceof olympe.dc.uc&&(c=a.db.N(d.X(),!0),c.D&&c.D.tag!==a.j&&a.db.ab().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.La+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.je(olympe.dc.db.Instance.j.Ui+a+':'+b),d.db.jb(d.j,a,b)),d.D={tag:a,La:b,Ky:e})}
|
|
643
643
|
function Dh(a,b,c,d){a.e&&a.db.af(a.j,b,c,d)}function xh(a,b,c=[]){const d=a.get(U+sh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>wh(e,g,f))});a=a.get(U+th);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(ph+k)||(g.set(k,h),null!==h?e.set(oh+k,h):e.delete(oh+k))});xh(e,g,[...c,f])}})}function Ah(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function Eh(a,b,c,d,e){a.db.$h(a.j,b,c,d.j,e)}
|
|
644
644
|
function Bh(a,b,c){const d=a.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&a.delete(b);return e}}function wh(a,b,c){if(!a.has(nh+b)){const d=qh+b,e=a.get(d);yh(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),Dh(a,b,c,null!==c))}}function uh(a){a.forEach((b,c)=>{const d=c[0];if(d===U||d===V){const e=c.substring(1),f=d===U?V:U;b.forEach(g=>{g.e&&(Eh(a,e,d,g,!0),Eh(g,e,f,a,!0))})}else if(d===nh||d===qh)c=c.substring(1),Dh(a,c,b,d===qh)})}
|
|
@@ -646,68 +646,68 @@ function vh(a){a.forEach((b,c)=>{const d=c[0];if(d!==rh){var e=c.substring(1);d=
|
|
|
646
646
|
function Ch(a){void 0!==a.D&&(a.detach(olympe.dc.db.Instance.j.Ui+a.D.tag+':'+a.D.La),a.db.jb(a.j,a.D.tag,a.D.La),a.D=void 0)}
|
|
647
647
|
olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.j=a;this.H=null;this.e=!1;this.D=void 0;this.c=0;this.N=!1;this.db=b}tag(){return this.j}Ha(){return this.e}F(){return this.db.F(this.j)}source(){return this.H}model(){const a=this.get(V+sh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}bf(){const a=this.get(V+th);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Qa(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.j}, Exist: ${this.e}, Name: ${a}`;
|
|
648
648
|
var b=this.model();if(b){var c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.j}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.bf())?(c=b.Qa(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.j}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Qa(a,b=!1){const c=this.get(nh+a);return b||void 0!==c?c:this.get(qh+a)}update(a,b){const c=nh+a;var d=this.get(c);d=void 0===d?null:d;if(!yh(d,b))if(zh(this,
|
|
649
|
-
a,d,b,!1),d=qh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:Rf(e,a);void 0!==b?(this.set(d,b),Dh(this,a,b,!0)):Dh(this,a,null,!1)}else this.set(c,b),this.delete(d),Dh(this,a,b,!1)}link(a,b){var c=U+a;const d=Ah(this,V+a);c=Ah(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(mh.rk,this.j,a,V,b.j),this.db.D(mh.rk,b.j,a,U,this.j),this.e&&b.e&&(Eh(this,a,V,b,!0),Eh(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Bh(this,V+a,b.j)&&(Bh(b,c,this.j),this.db.D(mh.
|
|
650
|
-
a,V,b.j),this.db.D(mh.
|
|
651
|
-
this.j)}clear(){this.forEach((a,b)=>{const c=b[0];if(c===U||c===V){const d=b.substring(1),e=c===U?V:U;a.forEach(f=>{const g=f.get(e+d);g.delete(this.j);0===g.size&&f.delete(e+d)})}c===nh&&a instanceof olympe.dc.uc&&Ch(this.db.get(a.X()))});void 0!==this.D&&this.db.get(this.D.tag).delete(nh+this.D.La)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={Bp:'instance',Gv:'rel',vi:'cb',Ui:'ref',TRANSACTION:'tx'};olympe.dc.db.yh=class a{constructor(b){this.$c=b;this.Y=this.$a=null;this.Pb=olympe.dc.Lb.NONE;this.F=a.j.Ek;this.j=this.ob=this.zc=this.$=this.properties=null}tag(){return this.$c}Wb(){return this.Y}sb(){return this.$a}getState(){return this.F}Ga(b){if(null===this.Y)this.Y=b;else if(this.Y!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Y}`);return this}H(){return this.F===a.j.Dc?this.Pb:olympe.dc.Lb.NONE}create(b){this.F=a.j.
|
|
652
|
-
b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.F=a.j.Dc;this.Pb=b;this.properties=null;return this}ka(b,c){if(this.F===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}
|
|
649
|
+
a,d,b,!1),d=qh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:Rf(e,a);void 0!==b?(this.set(d,b),Dh(this,a,b,!0)):Dh(this,a,null,!1)}else this.set(c,b),this.delete(d),Dh(this,a,b,!1)}link(a,b){var c=U+a;const d=Ah(this,V+a);c=Ah(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(mh.rk,this.j,a,V,b.j),this.db.D(mh.rk,b.j,a,U,this.j),this.e&&b.e&&(Eh(this,a,V,b,!0),Eh(b,a,U,this,!0)))}unlink(a,b){const c=U+a;void 0!==Bh(this,V+a,b.j)&&(Bh(b,c,this.j),this.db.D(mh.xm,this.j,
|
|
650
|
+
a,V,b.j),this.db.D(mh.xm,b.j,a,U,this.j),this.e&&b.e&&(Eh(this,a,V,b,!1),Eh(b,a,U,this,!1)))}persist(){this.N=!0;return this}je(){this.c++;1===this.c&&this.db.D(mh.Ar,this.j)}detach(){0<this.c?--this.c:this.db.D(mh.Jq,this.j,`Try to decrease references on instance ${this.j} 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.D(mh.Jm,
|
|
651
|
+
this.j)}clear(){this.forEach((a,b)=>{const c=b[0];if(c===U||c===V){const d=b.substring(1),e=c===U?V:U;a.forEach(f=>{const g=f.get(e+d);g.delete(this.j);0===g.size&&f.delete(e+d)})}c===nh&&a instanceof olympe.dc.uc&&Ch(this.db.get(a.X()))});void 0!==this.D&&this.db.get(this.D.tag).delete(nh+this.D.La)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={Bp:'instance',Gv:'rel',vi:'cb',Ui:'ref',TRANSACTION:'tx'};olympe.dc.db.yh=class a{constructor(b){this.$c=b;this.Y=this.$a=null;this.Pb=olympe.dc.Lb.NONE;this.F=a.j.Ek;this.j=this.ob=this.zc=this.$=this.properties=null}tag(){return this.$c}Wb(){return this.Y}sb(){return this.$a}getState(){return this.F}Ga(b){if(null===this.Y)this.Y=b;else if(this.Y!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Y}`);return this}H(){return this.F===a.j.Dc?this.Pb:olympe.dc.Lb.NONE}create(b){this.F=a.j.fm;this.$a=null!=
|
|
652
|
+
b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.F=a.j.Dc;this.Pb=b;this.properties=null;return this}ka(b,c){if(this.F===a.j.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Rm(b){this.F!==a.j.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Rd(b,c){if(null!==this.$&&this.$!==b)throw Error('An instance should never be set as complex property of multiple instances');this.$=b;this.zc=c}da(b){let c;null==
|
|
653
653
|
(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Yc&&this.Ga(c);this.sa(this.ob,b,c,!0);return this}unlink(b,c){null===this.ob&&(this.ob=new Map);b===olympe.dc.fc.Yc&&this.Ga(c);this.sa(this.ob,b,c,!1);return this}Mb(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!0)}vc(b,c){null===this.j&&(this.j=new Map);this.sa(this.j,b,c,!1)}zb(b,c,d){if(c=c===olympe.dc.va.ORIGIN?this.j:this.ob)return(b=c.get(b))&&
|
|
654
|
-
b.get(d)}N(b,c,d){const e=(c=c===olympe.dc.va.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.F===a.j.
|
|
654
|
+
b.get(d)}N(b,c,d){const e=(c=c===olympe.dc.va.ORIGIN?this.j:this.ob)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.F===a.j.fm}td(){return this.F===a.j.Dc}Bd(){let b=this.properties?this.properties.size:0,c;null==(c=this.ob)||c.forEach(d=>{b+=d.size});return b}R(){return null!==this.properties}Id(){return null!==this.ob||null!==this.j}Db(){let b;return null!=(b=this.properties)?b:new Map}Qa(b){if(this.properties)return this.properties.get(b)}bb(b,c=(d,e)=>[d,e]){return function*(d){if(d=
|
|
655
655
|
d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ka()===olympe.dc.va.ORIGIN?this.j:this.ob)}Jb(b){const c=b.Ka()===olympe.dc.va.ORIGIN?this.j:this.ob;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}Ed(b=(c,d,e)=>[c,d,e]){return this.ua(this.ob,b)}jb(b=(c,d,e)=>[c,d,e]){return this.ua(this.j,b)}ha(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.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.ua.bind(this),
|
|
656
|
-
this.ob,this.j)}sa(b,c,d,e){if(this.F!==a.j.Dc||!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)}}*ua(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.yh.j={
|
|
657
|
-
' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.G.info(a)}else this.G.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.j.
|
|
658
|
-
k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.Mb(()=>{Sg(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.
|
|
656
|
+
this.ob,this.j)}sa(b,c,d,e){if(this.F!==a.j.Dc||!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)}}*ua(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.yh.j={fm:0,Ek:1,Dc:2};olympe.dc.db.bv=class{constructor(a,b,c,d){this.G=a;this.view=b;this.j=c;(this.active=d.get('active'))&&this.init()}debug(a){const b=olympe.dc.fa(a);if(this.j.has(b)){var c=this.j.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ha()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.j.get(d[d.length-1]);const e=olympe.dc.db.Database.D.Ti+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
|
|
657
|
+
' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.G.info(a)}else this.G.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.j.Po,b=olympe.dc.db.Database.j.Kl,c=olympe.dc.db.Database.j.Dc,d=olympe.dc.db.Database.j.rk,e=olympe.dc.db.Database.j.xm,f=olympe.dc.db.Database.j.ko,g=olympe.dc.db.Database.j.lo,h=()=>{};this.j.j(olympe.dc.db.Database.j.Oo,()=>{});this.j.j(a,()=>{});this.j.j(b,k=>{this.j.Mb(()=>{Rg(this.view,
|
|
658
|
+
k,h,`monitorRelations${k}`)})});this.j.j(c,k=>{this.j.Mb(()=>{Sg(this.view,k,`monitorRelations${k}`)})});this.j.j(d,()=>{});this.j.j(e,()=>{});this.j.j(f,()=>{});this.j.j(g,()=>{})}};olympe.dc.db.Km=class{constructor(a,b,c,d){this.G=a;this.j=b;this.ia=c;this.F=d;this.transactionId=null}open(a){if(null!==this.transactionId)throw Error('A transaction is already open');this.transactionId=this.j.ci(a);this.G.debug(`DB Writer: transaction ${this.transactionId} opened`)}write(a,b){b&&(b=new Fh(this.ia),a.qc(b),this.G.info(b.flush()));if(null===this.transactionId)throw Error('You must first open a transaction before to write');this.G.debug('DB Writer: writing patch',a.T(),'for transaction',
|
|
659
659
|
this.transactionId);this.j.Oy(this.transactionId,()=>a.qc(this))}close(){if(null===this.transactionId)throw Error('No transaction is open');this.j.$e(this.transactionId);this.G.debug(`DB Writer: transaction ${this.transactionId} committed`);this.transactionId=null}Oc(a,b,c,d){this.j.create(a,b,c,this.F);d&&this.j.link(olympe.dc.fc.Yc,a,d)}Wc(a,b){this.j.update(a,b)}D(a,b=olympe.dc.Lb.NONE){for(const c of Qf(this.ia,a,b))this.j.Ga(c)}Oa(a,b,c){this.j.link(a,b,c)}hc(a,b,c){this.j.unlink(a,b,c)}};
|
|
660
660
|
function Gh(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.uc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.fh()+','+f.bh()+','+f.Zg()+','+f.Yg()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=Gh(a,f,
|
|
661
661
|
(null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function Hh(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function Ih(a,b){let c;return b===olympe.dc.fc.Yc?'Model':null!=(c=a.db.name(b))?c:b}
|
|
662
662
|
class Fh{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Oc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${Gh(this,c)})`,Hh(this,d))}Wc(a,b,c){this.log(`updateInstance(tag: ${a}, ${Gh(this,b)})`,Hh(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,Hh(this,c))}Oa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,Ih(this,a))}hc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
|
|
663
|
-
Ih(this,a))}}olympe.dc.db.
|
|
664
|
-
olympe.W.config(function(a){F(a,olympe.dc.db.U.fp,olympe.dc.db.vf.j.
|
|
663
|
+
Ih(this,a))}}olympe.dc.db.Km.xa=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Ca:'dc.db.Logger',Pl:'dc.db.gc.Logger',Da:'dc.db.DatabaseManager',Qj:'dc.db.Database',Dl:'dc.db.DBView',iB:'dc.db.Graph',kA:'dc.db.DatabaseWriter',XB:'dc.db.PermissionProcessor',Li:'dc.db.GraphMonitor'};olympe.dc.db.U={fp:'db.garbageCollector',gp:'db.garbageCollectorDelay',xl:'db.commitBufferTimeout',Li:'db.monitor',av:'db.monitorCounters',$u:'db.monitorCallbacks',Go:'db.debug'};
|
|
664
|
+
olympe.W.config(function(a){F(a,olympe.dc.db.U.fp,olympe.dc.db.vf.j.Mn);F(a,olympe.dc.db.U.gp,5E3);F(a,olympe.dc.db.U.xl,3E4);F(a,olympe.dc.db.U.Li,!1);F(a,olympe.dc.db.U.Go,!1);E(a,olympe.dc.db.P.Ca,[olympe.ja.P.Da],b=>b.cd('db'));E(a,olympe.dc.db.P.Pl,[olympe.ja.P.Da],b=>b.cd('gc'));E(a,olympe.dc.db.P.Qj,[olympe.dc.db.P.Ca,olympe.dc.db.P.Pl,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.db.U.fp),new olympe.W.pa(olympe.dc.db.U.gp),new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.dc.db.U.Go)],
|
|
665
665
|
(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.vf.j.Hl:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});D(a,olympe.dc.db.P.Dl,olympe.dc.kb,olympe.dc.db.P.Ca,olympe.dc.db.P.Qj);E(a,olympe.dc.db.P.Li,[olympe.dc.db.P.Da],b=>b.Xy);E(a,olympe.dc.db.P.Da,[olympe.dc.db.P.Ca,olympe.dc.db.P.Qj,olympe.dc.db.P.Dl,new olympe.W.pa(olympe.dc.U.Xf),new olympe.W.pa(olympe.dc.db.U.xl),new olympe.W.pa(olympe.dc.db.U.Li),new olympe.W.pa(olympe.dc.db.U.av),
|
|
666
666
|
new olympe.W.pa(olympe.dc.db.U.$u)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.Ht(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.P.Qj,olympe.dc.db.P.Li],(a,b)=>{olympe.$d().db=a;olympe.$d().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function Jh(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
|
|
667
667
|
olympe.dc.query.sf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.j=a;this.La=b;this.Ji=c}ga(){return{p:this.La.X(),o:this.Ji}}toString(){return'sortByQueryPart-'+this.Ji+this.La.X()}$g(){const a=this.db.Jb(this.La,olympe.dm.Property.typeRel),b=olympe.dc.fa;if(this.db.Qf(a,olympe.dm.String))return Jh((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Jh((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Jh((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return Jh((c,
|
|
668
|
-
d)=>c.compare(d));olympe.ja.ab('dc.query').warn(`No comparator found for type with tag ${a}`);return Jh(()=>-1)}Qa(){return this.La}};olympe.dc.Te=class{X(){}};olympe.dc.Te.prototype.getTag=olympe.dc.Te.prototype.X;olympe.dc.lB=olympe.dc.Te;function Kh(a){let b;if(null==(b=a.j)?0:b.jf())if(a=a.
|
|
669
|
-
olympe.dc.query.gv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.
|
|
668
|
+
d)=>c.compare(d));olympe.ja.ab('dc.query').warn(`No comparator found for type with tag ${a}`);return Jh(()=>-1)}Qa(){return this.La}};olympe.dc.Te=class{X(){}};olympe.dc.Te.prototype.getTag=olympe.dc.Te.prototype.X;olympe.dc.lB=olympe.dc.Te;function Kh(a){let b;if(null==(b=a.j)?0:b.jf())if(a=a.N,!a.N){let c;null==(c=a.R)||c.call(a)}}function Lh(a,b,c,d,e){Kh(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.hc(c,d,e)}function Mh(a){let b;const c=!(null==(b=a.j)?0:b.jf());a.F=c?a.j:null;a.H.forEach(d=>d());a.H=[];c&&(a.j=new olympe.dc.db.ec,a.G.j()&&a.G.debug(`Commit notification with ${a.F.H()} operations for query ${a.D}`))}
|
|
669
|
+
olympe.dc.query.gv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.N=d;this.j=this.F=null;this.db=olympe.dc.ia();this.H=[]}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;sf(this.db,a,(d,e)=>{if(d){Kh(this);let f;null==(f=this.j)||f.$(e)}else if(b&&Og(this.db,e,c),!this.db.Ha(e)){Kh(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&Ng(this.db,a,(d,e,f)=>{Kh(this);let g;f||null!=(g=this.j)&&g.Wc(a,new Map([[d,e]]))},c)}}stop(a){this.H.push(()=>
|
|
670
|
+
qf(this.db,a,`${this.D}:${a}:notif`))}};olympe.dc.query.kk={ASC:'ASC',DESC:'DESC'};function Nh(a){const b=Oh(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].T():a.F,g=0<e?b[e-1].j:'root',h=0<e&&b[e-1].R(),k=a.j.get(f),l=new Set(k.Rc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((x,y)=>{for(const z of k.j(y)){let A;n.set(z,Array.from(x).map(K=>p?`${y};${K}`:K).reduce((K,X)=>K.add(X),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${u}`:u;for(const z of k.j(x)){let A;n.set(z,
|
|
670
671
|
(null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const u of k.j(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(K=>{let X;const xa=null!=(X=x.get(z))?X:new Set;y.forEach(ab=>xa.add(ab+K));x.set(z,xa)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+u)))});b[e-1].R()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
|
|
671
|
-
q+A)))});c.set(g,[x,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function
|
|
672
|
-
function
|
|
673
|
-
function
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
a,b,!1,c)}static Cj(a,b,c=!0){Yh(a);return new olympe.dc.query.Z.Gi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Jd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
|
|
672
|
+
q+A)))});c.set(g,[x,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function Ph(a){if(null===a.D){const b={Hb:a.query.$g(),Hd:a.Hd,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ia.from(a.Y,Nh(a),b)}return a.D}function Qh(a,b){a.R=b}function Rh(a){if(!a.N){null!==a.D&&(a.Y=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
|
|
673
|
+
function Sh(a,b){let c;return null!=(c=a.j.get(b).Rc())?c:[]}function Th(a,b,c){let d,e;return null!=(e=null==(d=a.j.get(c))?void 0:d.has(b))?e:!1}function Uh(a,b,c=a.F,d='root'){const e=a.j.get(c);if(!e)return a.G.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.D(b,d)&&Rh(a);let g;f&&(null==(g=a.Me)||g.watch(b,a.H.has(c)));return f}function Vh(a,b,c,d,e,f){null!==a.Me&&(d===olympe.dc.va.ORIGIN?Lh(a.Me,b,c,f,e):Lh(a.Me,b,c,e,f))}
|
|
674
|
+
function Wh(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.query.T()}`);const b=new olympe.dc.query.gv(a.G,a.query.sb(),a.query.T(),a);a.j.forEach((c,d)=>{for(const e of c.Rc())b.watch(e,a.H.has(d))});null!=b.j||(b.j=new olympe.dc.db.ec);a.Me=b}function Xh(a){null!==a.Me&&(a.G.j()&&a.G.debug(`Stop sending notifications for query ${a.query.T()}`),a.j.forEach(b=>{for(const c of b.Rc())a.Me.stop(c)}),a.Me=null)}function Yh(a){a.N=!1;let b;null==(b=a.Me)||Mh(b)}
|
|
675
|
+
olympe.dc.query.Aq=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.V.tb(b.D);this.na=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.na.Bm);this.H=new Set(b.F);this.Hd=-1;this.N=!1;this.R=null;this.Y=olympe.dc.Ia.empty();this.Me=this.D=null;a=Oh(b);a.forEach(c=>{const d=c.T();this.na.set(d,c.N());this.j.set(d,c.ha())});b=b.$g();if(null!==b){b=b.j;let c=-1;for(const d of[this.F].concat(a.map(e=>e.T())))if(c+=this.H.has(d)?1:0,b===d){this.Hd=c;break}}}remove(a,b=this.F,c='root'){b=
|
|
676
|
+
this.j.get(b);if(null==b?0:b.remove(a,c))if(Rh(this),!b.has(a)){let d;null==(d=this.Me)||d.stop(a);return!0}return!1}Nc(a){const b=a.D,c=olympe.V.tb(b);a=Oh(a);const d=[];for(const [f,g]of this.j){if(g.H(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.j))?g:[]).flatMap(k=>f.$(k,this.na.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.na.get(k))?void 0:l.Nc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function Zh(a){if(!olympe.dc.ia().Ob(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
|
|
677
|
+
function $h(a){var b=olympe.dc.query.Aa.j.tr;const c=olympe.dc.query.Aa.j.Qo,d=olympe.dc.query.Aa.j.Nj,e=olympe.dc.query.Aa.j.Ap,f=olympe.dc.query.Aa.j.aq,g=olympe.dc.query.Aa.j.Kq,h=olympe.dc.query.Aa.j.Kn,k=olympe.dc.query.Aa.j.pq;switch(a.pr){case b:return new olympe.dc.query.Z.Gm(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.C.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.Z.ve(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.Z.tf(a.p,
|
|
678
|
+
a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.Z.Gi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Z.fe($h(a.v));case g:return new olympe.dc.query.Z.Ef(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.Z.Be(...a.p.map(l=>$h(l)));case h:return new olympe.dc.query.Z.Jd(...a.p.map(l=>$h(l)));default:return null}}
|
|
679
|
+
olympe.dc.query.Aa=class{observe(){}nb(){}compile(){return[[this]]}ud(){return new olympe.dc.query.Z.fe(this)}Db(){}Nc(){}clear(){}ga(){}Vc(){}toString(){}Ea(a){return this===a}static Ey(...a){return new olympe.dc.query.Z.Gm(a)}static Ea(a,b){Zh(a);return new olympe.dc.query.Z.ve(a,b,olympe.dc.ia())}static contains(a,b,c=!0){Zh(a);return new olympe.dc.query.Z.tf(a,b,olympe.dc.ia(),c)}static vz(a,b,c=!0){Zh(a);return new olympe.dc.query.Z.Ef(a,b,olympe.dc.ia(),c)}static Vk(a,b,c=!0){Zh(a);return new olympe.dc.query.Z.Gi(olympe.dc.ia(),
|
|
680
|
+
a,b,!1,c)}static Cj(a,b,c=!0){Zh(a);return new olympe.dc.query.Z.Gi(olympe.dc.ia(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Z.Jd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
|
|
681
681
|
return new olympe.dc.query.Z.Be(...a)}static ud(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Z.fe(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.ud;olympe.dc.query.Aa.or=olympe.dc.query.Aa.or;olympe.dc.query.Aa.and=olympe.dc.query.Aa.and;olympe.dc.query.Aa.smallerThan=olympe.dc.query.Aa.Cj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.Vk;
|
|
682
|
-
olympe.dc.query.Aa.regex=olympe.dc.query.Aa.vz;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ea;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.Ey;olympe.dc.query.Aa.j={tr:0,
|
|
683
|
-
function
|
|
684
|
-
b.T();for(c=a.cursor+1;c<a.
|
|
685
|
-
function
|
|
686
|
-
function
|
|
687
|
-
olympe.dc.ma=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Hd:null,Ne:null}){this.db=olympe.dc.ia();if('string'!==typeof a||''===a)throw new olympe.dc.query.yd('The root of the query cannot be empty.');this.D=a;this.source=b;this.
|
|
682
|
+
olympe.dc.query.Aa.regex=olympe.dc.query.Aa.vz;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ea;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.Ey;olympe.dc.query.Aa.j={tr:0,Qo:1,Nj:2,Ap:3,aq:4,Kq:5,pq:6,Kn:7};function Oh(a){return Array.from(a.na)}
|
|
683
|
+
function ai(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Jb(c,c.Ka()===olympe.dc.va.ORIGIN?e:d);if(0>a.cursor)e=a.j.Ne;else if(e=a.na[a.cursor],null!==e.ua)e=e.ua;else{var f=olympe.dc.va.ORIGIN;e=olympe.dc.ia().Jb(e.relation,e.relation.Ka()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ha(olympe.dc.CloudObject)&&(null===d||!a.db.Qf(d,e)&&!a.db.Qf(e,d)))throw new olympe.dc.query.yd(`The specified relation "${c}" is invalid at the current level "${a.db.name(e)} (${e})" of the Query you are building. Please make sure you did not forget a .back() or another relation.`);d=
|
|
684
|
+
b.T();for(c=a.cursor+1;c<a.na.length&&a.na[c].T()!==d;)c++;b=c<a.na.length?a.na:a.na.concat(b);return new olympe.dc.ma(a.D,a.source,b,c,a.F,a.j)}function bi(a,b=a.cursor){return 0<=b?a.na[b].T():olympe.V.tb(a.D)}
|
|
685
|
+
function ci(a,b,c,d={}){var e=olympe.dc.Lb.fg;const f=(null==d?0:d.jd)?d.jd:olympe.dc.ma.nc.rf,g=(null==d?0:d.En)?'__code-as-data__':void 0;b=olympe.dc.fa(b);const h=olympe.dc.ae().Ke(b);b=(new olympe.dc.ma(b,h)).ie();b.na=[f===olympe.dc.ma.nc.Jg?new olympe.dc.query.na.Ol(bi(b),e,c):new olympe.dc.query.na.Kd(bi(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.zs)?k:!1;return b.observe(a,{jd:f,Kk:g})}
|
|
686
|
+
function di(a){const b=0===a.F.size?a.ie():a;if(null!==b.j.Hd&&!b.F.has(bi(a,b.j.Hd)))throw new olympe.dc.query.yd('AndReturn was not called for the current level before sortBy operator');return b}function ei(a,b){let c,d;return b.H||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
|
|
687
|
+
olympe.dc.ma=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Hd:null,Ne:null}){this.db=olympe.dc.ia();if('string'!==typeof a||''===a)throw new olympe.dc.query.yd('The root of the query cannot be empty.');this.D=a;this.source=b;this.na=c;this.cursor=d;this.F=e;this.j=f;this.N=this.id=null;this.H=!1}static from(a,b){a=olympe.dc.fa(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.yd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
|
|
688
688
|
b=null!=b?b:olympe.dc.ae().Ke(a);b=new olympe.dc.ma(a,b);b.j.Ne=olympe.dc.ia().model(a);return b}static Ke(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.yd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.fa(a);c=null!=c?c:olympe.dc.ae().fromModel(b);c=new olympe.dc.ma(a,c);c.j.Ne=olympe.dc.fa(b);return c}static Yk(a,b=!0,c){const d=olympe.dc.fa(a);var e=olympe.dc.ia();if(!e.ji(d))throw new olympe.dc.query.yd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
|
|
689
|
-
a=null!=c?c:olympe.dc.ae().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ne=e.model(d);b&&(a
|
|
690
|
-
d.
|
|
691
|
-
return
|
|
692
|
-
this.source,this.
|
|
693
|
-
e=Array.from(this.
|
|
694
|
-
filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.ji(this.D)?c.dataType=olympe.dc.fa(this.D):(c.root=olympe.dc.fa(this.D),c.dataType=this.j.Ne);this.
|
|
695
|
-
g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}nb(a){const b=(null==a?0:a.jd)?a.jd:olympe.dc.ma.nc.lk;let c;return olympe.dc.query.Uk().executeQuery(
|
|
696
|
-
a;let d;return
|
|
697
|
-
r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Hd,rm:null!=(a=this.j.Ne)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ha(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.
|
|
689
|
+
a=null!=c?c:olympe.dc.ae().fromModel(d);a=new olympe.dc.ma(d,a);a.j.Ne=e.model(d);b&&(a=ai(a,new olympe.dc.query.na.we(bi(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.na.wh(bi(a),olympe.dc.CloudObject.instancesRel,!1);e.ua=d;return ai(b,e)}static Pb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.jd)?f:olympe.dc.ma.nc.rf;f=(null==e?0:e.En)?'__code-as-data__':void 0;b=olympe.dc.fa(b);d=null!=d?d:olympe.dc.ae().Ke(b);d=(new olympe.dc.ma(b,d)).ie();b=g===olympe.dc.ma.nc.Jg;
|
|
690
|
+
d.na=[b?new olympe.dc.query.na.Ol(bi(d),c):new olympe.dc.query.na.Kd(bi(d),c)];let h;d.H=null!=(h=null==e?void 0:e.zs)?h:!1;let k;return d.observe(a,{jd:g,Kk:f,gj:null!=(k=null==e?void 0:e.gj)?k:b})}fb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to follow() is invalid: ${a}`);return ai(this,new olympe.dc.query.na.wh(bi(this),a,b))}mg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.yd(`The relation given to followRecursively() is invalid: ${a}`);
|
|
691
|
+
return ai(this,new olympe.dc.query.na.we(bi(this),a,b,c))}ie(){const a=(new Set(this.F)).add(bi(this));return new olympe.dc.ma(this.D,this.source,this.na,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.yd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.na);b[this.cursor]=b[this.cursor].filter(a);return new olympe.dc.ma(this.D,this.source,b,this.cursor,this.F,this.j)}hj(){return this}vj(a,b=0){return new olympe.dc.ma(this.D,
|
|
692
|
+
this.source,this.na,this.cursor,this.F,{Hd:this.j.Hd,max:a,offset:b,Ne:this.j.Ne})}fl(a,b=olympe.dc.query.kk.ASC){if(0>this.cursor)throw new olympe.dc.query.yd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ia().Ob(a,olympe.dm.Property))throw new olympe.dc.query.yd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.na[this.cursor],d={Hd:this.cursor,max:this.j.max,offset:this.j.offset,Ne:this.j.Ne},
|
|
693
|
+
e=Array.from(this.na);e[this.cursor]=c.sort(a,b);return new olympe.dc.ma(this.D,this.source,e,this.cursor,this.F,d)}$g(){const a=this.j.Hd;let b;return null!==a?null==(b=this.na[a])?void 0:b.$g():null}back(a=1){if(0>this.cursor||1>a)return this;let b=this.cursor;for(let c=0;c<a;c++){const d=this.na[b].j;for(b--;-1<b&&bi(this,b)!==d;)b--}return new olympe.dc.ma(this.D,this.source,Array.from(this.na),b,this.F,this.j)}parse(){const a=new Map,b=bi(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
|
|
694
|
+
filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.ji(this.D)?c.dataType=olympe.dc.fa(this.D):(c.root=olympe.dc.fa(this.D),c.dataType=this.j.Ne);this.na.forEach((d,e)=>{const f=d.T(),g=d.Vc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Hd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.na.wh&&d.relation.Ea(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.na.we&&d.relation.Ea(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
|
|
695
|
+
g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}nb(a){const b=(null==a?0:a.jd)?a.jd:olympe.dc.ma.nc.lk;let c;return olympe.dc.query.Uk().executeQuery(di(this),b,{Xh:null!=(c=null==a?void 0:a.Kk)?c:null==a?void 0:a.cacheId,Ac:null==a?void 0:a.Ac}).then(d=>{let e;return null!=(e=null==d?void 0:Ph(d))?e:olympe.dc.Ia.empty()})}Fc(){return Ph(fi(olympe.dc.query.Uk(),di(this)))}observe(a,b){const c=(null==b?0:b.jd)?b.jd:olympe.dc.ma.nc.rf;a='function'===typeof a.Cb?a.Cb():
|
|
696
|
+
a;let d;return gi(olympe.dc.query.Uk(),di(this),a,olympe.dc.Ja.SELF,c,{Xh:null!=(d=null==b?void 0:b.Kk)?d:null==b?void 0:b.cacheId,Ac:null==b?void 0:b.Ac,gj:null==b?void 0:b.gj}).pipe(rxjs.operators.map(e=>Ph(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.V.tb(this.D+Oh(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Hd+this.j.max+this.j.offset));return this.id}sb(){return this.source}ga(){let a;return{b:this.D,p:this.na.map(b=>b.ga()),
|
|
697
|
+
r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Hd,rm:null!=(a=this.j.Ne)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ha(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.na.map(a=>a.toJSON())}}};olympe.dc.ma.prototype.observe=olympe.dc.ma.prototype.observe;olympe.dc.ma.prototype.executeFromCache=olympe.dc.ma.prototype.Fc;olympe.dc.ma.prototype.execute=olympe.dc.ma.prototype.nb;
|
|
698
698
|
olympe.dc.ma.prototype.parse=olympe.dc.ma.prototype.parse;olympe.dc.ma.prototype.back=olympe.dc.ma.prototype.back;olympe.dc.ma.prototype.sortBy=olympe.dc.ma.prototype.fl;olympe.dc.ma.prototype.limit=olympe.dc.ma.prototype.vj;olympe.dc.ma.prototype.cast=olympe.dc.ma.prototype.hj;olympe.dc.ma.prototype.filter=olympe.dc.ma.prototype.filter;olympe.dc.ma.prototype.andReturn=olympe.dc.ma.prototype.ie;olympe.dc.ma.prototype.followRecursively=olympe.dc.ma.prototype.mg;olympe.dc.ma.prototype.follow=olympe.dc.ma.prototype.fb;
|
|
699
|
-
olympe.dc.ma.followRule=olympe.dc.ma.Pb;olympe.dc.ma.instancesOf=olympe.dc.ma.Yk;olympe.dc.ma.fromTag=olympe.dc.ma.Ke;olympe.dc.ma.from=olympe.dc.ma.from;olympe.dc.ma.nc={rf:1,lk:2,Jg:3};olympe.dc.ma.j={ul:'cacheBucketName',Gp:'isCacheable'};function
|
|
700
|
-
olympe.dc.query.zd=class extends olympe.dc.Ag{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Ce}static mj(a){const b=new olympe.dc.query.zd(`DataResult_${a.T()}`);b.D=a.sb();return b}static j(a){const b=new olympe.dc.query.zd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.Lk=null!=(d=a.t)?d:null;let e;b.Fa=null!=(e=a.p)?e:[];return b}qc(a){
|
|
701
|
-
b,c){this.F.Oa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.zd.prototype.createRelation=olympe.dc.query.zd.prototype.Oa;olympe.dc.query.zd.prototype.create=olympe.dc.query.zd.prototype.create;olympe.dc.query.zd.fromQuery=olympe.dc.query.zd.mj;function
|
|
702
|
-
function
|
|
703
|
-
{const n=()=>{p&&c.Gs(p);l.complete();if(q){var r=q;const u=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ja.SELF&&(t.$--,0===t.$&&
|
|
704
|
-
function
|
|
705
|
-
function
|
|
706
|
-
function
|
|
707
|
-
olympe.dc.query.Bv=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Tb=d;this.H=e;this.j=new Map;this.F=new Set;wg(b,()=>
|
|
708
|
-
null}return
|
|
709
|
-
Promise.resolve();var u=t;t instanceof ReadableStream&&(u=(u=d())?t.pipeThrough(u):t);return
|
|
710
|
-
l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):
|
|
699
|
+
olympe.dc.ma.followRule=olympe.dc.ma.Pb;olympe.dc.ma.instancesOf=olympe.dc.ma.Yk;olympe.dc.ma.fromTag=olympe.dc.ma.Ke;olympe.dc.ma.from=olympe.dc.ma.from;olympe.dc.ma.nc={rf:1,lk:2,Jg:3};olympe.dc.ma.j={ul:'cacheBucketName',Gp:'isCacheable'};function hi(a){null===a.Fa&&null===a.j&&(a.Fa=Bf(a.F))}
|
|
700
|
+
olympe.dc.query.zd=class extends olympe.dc.Ag{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Ce}static mj(a){const b=new olympe.dc.query.zd(`DataResult_${a.T()}`);b.D=a.sb();return b}static j(a){const b=new olympe.dc.query.zd(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.Lk=null!=(d=a.t)?d:null;let e;b.Fa=null!=(e=a.p)?e:[];return b}qc(a){hi(this);return super.qc(a)}jc(){hi(this);return super.jc()}Rk(){hi(this);return super.Rk()}create(a,b,c){this.F.Oc(a,this.D,c,b);return this}Oa(a,
|
|
701
|
+
b,c){this.F.Oa(a,b,c,null,null);return this}ga(){return super.ga()}};olympe.dc.query.zd.prototype.createRelation=olympe.dc.query.zd.prototype.Oa;olympe.dc.query.zd.prototype.create=olympe.dc.query.zd.prototype.create;olympe.dc.query.zd.fromQuery=olympe.dc.query.zd.mj;function fi(a,b){const c=new olympe.dc.query.Aq(a.G,b);if(a.D.view.Ha(b.D)){Uh(c,b.D);for(const d of Oh(b))d.nb(c)}return c}
|
|
702
|
+
function gi(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.sb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Ac||a.H&&k===olympe.dc.Ja.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.Iq(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);ii(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.Xh)&&ji(a,b,e,f).catch(l=>{a.G.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
|
|
703
|
+
{const n=()=>{p&&c.Gs(p);l.complete();if(q){var r=q;const u=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ja.SELF&&(t.$--,0===t.$&&Xh(t.j));r=0===t.H.size}r&&(a.G.debug(`No more subscriber to ${g}, remove the subscription`),a.F.delete(g),a.j.delete(g),u.destroy())}},p=c.Td(n),q=ki(h,d,l);return n})}
|
|
704
|
+
function li(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||mi(c)});a.F.clear()}function ni(a,b,c,d){return w(function*(){const e=null!=d?d:c===olympe.dc.ma.nc.Jg;if(b instanceof ReadableStream)yield vg(a.D,b,{Tm:e});else{var f;if(f=b instanceof olympe.dc.Ag)f=b.T(),f=!a.N.H.has(f);f&&a.D.Tc(b,{Tm:e})}})}function oi(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Cg,olympe.dc.Ja.SERVER);return a.Tb.request(b).then(c=>{a.D.Tc(c)})}
|
|
705
|
+
function pi(a,b){const c=b.sb();if(c===olympe.dc.Ja.SELF||a.H&&c===olympe.dc.Ja.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Nc(b)).map(d=>new Promise(e=>d.hd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function ji(a,b,c,d){return w(function*(){var e=b.sb();e=wf(wf(new olympe.dc.Request(olympe.dc.Request.j.Lg,e,b),olympe.dc.ma.j.Gp,c===olympe.dc.ma.nc.Jg),olympe.dc.ma.j.ul,null==d?void 0:d.Xh);return a.Tb.request(e)})}
|
|
706
|
+
function qi(a,b,c){const d=[];for(const e of a.j.values())ri(e,b,c)&&d.push(ji(a,e.query,olympe.dc.ma.nc.lk,{}).then(f=>ni(a,f,olympe.dc.ma.nc.lk)));return Promise.all(d).then(()=>{})}
|
|
707
|
+
olympe.dc.query.Bv=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Tb=d;this.H=e;this.j=new Map;this.F=new Set;wg(b,()=>li(this));zf(d,olympe.dc.Request.j.Ao,f=>{ni(this,f.content,olympe.dc.ma.nc.rf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return w(function*(){const e='boolean'===typeof c.Ac?c.Ac:yield pi(d,a);if(!e||(null==c?0:c.Xh))try{const f=yield ji(d,a,b,c);e||(yield ni(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.sb()}: ${f}`),
|
|
708
|
+
null}return fi(d,a)})}R(a,b,c,d,e,f){const g=c.sb();if(g===olympe.dc.Ja.SELF||b.Ac||this.H&&g===olympe.dc.Ja.SERVER)return e(),null;if(a!==olympe.dc.ma.nc.rf)return ji(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return ni(this,t,a,b.gj)}).then(e).catch(f),null;let h,k=!1;const l=r=>{h=[];r&&this.G.debug(`Resend subscription ${c.T()} after detection of dead subscription in the remote service`);ji(this,c,a,b).then(t=>{if(k)return this.G.warn(`Received data result after query subscription ${c.T()} has been destroyed. Could happen with queries observed multiple times successively quickly.`),
|
|
709
|
+
Promise.resolve();var u=t;t instanceof ReadableStream&&(u=(u=d())?t.pipeThrough(u):t);return ni(this,u,a,b.gj).then(()=>{h.forEach(x=>ni(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=wf(new olympe.dc.Request(olympe.dc.Request.j.pk,g,c),olympe.dc.ma.j.ul,null==b?void 0:b.Xh),q=this.Tb.subscribe(p,l.bind(this,!0)).pipe(nb(olympe.L.errors.pp,()=>{},0)).pipe(nb(olympe.L.errors.fo,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
|
|
710
|
+
l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):ni(this,r,a)},r=>{this.G.error(`An error occurred with the subscription ${n}: ${r}`);f(String(r))}));return()=>{k=!0;this.G.debug(`Unsubscribe to query ${n} from data source ${g}`);q.unsubscribe()}}};function si(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ha(g)?olympe.dc.CloudObject.get(g):(olympe.ja.ab('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ia.create(d,a.a,a.r)}
|
|
711
711
|
olympe.dc.Ia=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.H=[];this.hash=''}static empty(){return new olympe.dc.Ia}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.j.length&&(b=this.j[a],b={value:[b,this.D.get(b)],done:!1},a++);return b}}}entries(){return this.j.map(a=>[a,this.D.get(a)])}values(){return this.D.values()}keys(){return this.j.values()}Oe(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Oe().includes(a)}indexOf(a){return null===
|
|
712
712
|
a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Oe().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Gc(){return this.le(0)}le(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Oe();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Oe();a.pop();return a}shift(){if(0<this.j.length){const a=this.Oe();a.shift();return a}return[]}filter(a){return this.Oe().filter(a)}find(a){return(a=this.Oe().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
|
|
713
713
|
a(this.D.get(b),c))}map(a){return this.Oe().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ia.create(b,Array.from(this.F),Array.from(this.H))}reduce(a,b){return this.Oe().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.F);for(const d of a)c=c.concat(d.F.map(e=>e+c.length));a=this.H.concat(...a.map(d=>d.H));return olympe.dc.Ia.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Oe()}nj(){return this.F.map(a=>
|
|
@@ -715,477 +715,478 @@ this.D.get(this.j[a]))}sj(){return this.H.map(a=>{a=a.split('.');return 1===a.le
|
|
|
715
715
|
if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?g(p[0]):p.map(g)]);const h=new Set(e.map(p=>p[0])),k=new Set(a.keys()),l=[],n=[];e.forEach(([p],q)=>{!k.has(p)&&l.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Ia.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ia;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.V.tb(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.H=c||[];return e}ga(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
|
|
716
716
|
return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ia.prototype.getRemoved=olympe.dc.Ia.prototype.sj;olympe.dc.Ia.prototype.getAdded=olympe.dc.Ia.prototype.nj;olympe.dc.Ia.prototype.concat=olympe.dc.Ia.prototype.concat;olympe.dc.Ia.prototype.reduce=olympe.dc.Ia.prototype.reduce;olympe.dc.Ia.prototype.sort=olympe.dc.Ia.prototype.sort;olympe.dc.Ia.prototype.map=olympe.dc.Ia.prototype.map;olympe.dc.Ia.prototype.forEach=olympe.dc.Ia.prototype.forEach;olympe.dc.Ia.prototype.find=olympe.dc.Ia.prototype.find;
|
|
717
717
|
olympe.dc.Ia.prototype.filter=olympe.dc.Ia.prototype.filter;olympe.dc.Ia.prototype.shift=olympe.dc.Ia.prototype.shift;olympe.dc.Ia.prototype.pop=olympe.dc.Ia.prototype.pop;olympe.dc.Ia.prototype.push=olympe.dc.Ia.prototype.push;olympe.dc.Ia.prototype.getAt=olympe.dc.Ia.prototype.le;olympe.dc.Ia.prototype.getFirst=olympe.dc.Ia.prototype.Gc;olympe.dc.Ia.prototype.get=olympe.dc.Ia.prototype.get;olympe.dc.Ia.prototype.indexOf=olympe.dc.Ia.prototype.indexOf;olympe.dc.Ia.prototype.has=olympe.dc.Ia.prototype.has;
|
|
718
|
-
olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Oe;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function
|
|
719
|
-
olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.nb;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.hj;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.fb;const
|
|
720
|
-
function
|
|
721
|
-
function
|
|
722
|
-
function
|
|
723
|
-
function
|
|
724
|
-
olympe.dc.query.Iq=class{constructor(a,b,c,d,e){this.G=a;this.ua=b;this.db=b.view;this.query=c;this.jd=d;this.j=new olympe.dc.query.Aq(this.G,c);this.$=0;this.da=1;this.Y=[];this.H=new Map;this.D=[()=>
|
|
725
|
-
(null===this.D||this.query.D===a.D)&&this.j.Nc(a))}hd(a){null!==this.D?this.D.push(a):a();return this}destroy(a){a?this.G.error(`Destroy subscription ${this.query.T()} after error: ${a}`):this.G.debug(`Destroy subscription ${this.query.T()}`);const b=this.Y;this.Y=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>
|
|
726
|
-
olympe.dc.ma.nc.Jg;if(this.jd===a)return olympe.V.stream.tap(c=>{c=c.Rk().filter(
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
718
|
+
olympe.dc.Ia.prototype.size=olympe.dc.Ia.prototype.size;olympe.dc.Ia.prototype.toArray=olympe.dc.Ia.prototype.Oe;olympe.dc.Ia.prototype.keys=olympe.dc.Ia.prototype.keys;olympe.dc.Ia.prototype.values=olympe.dc.Ia.prototype.values;olympe.dc.Ia.prototype.entries=olympe.dc.Ia.prototype.entries;olympe.dc.Ia.empty=olympe.dc.Ia.empty;function ti(a){return 1<a.size()?(olympe.ja.ab('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.nd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.nd(olympe.dc.ma.from(a))}fb(a){return new olympe.dc.nd(this.query.fb(a))}hj(){return this}nb(a){return this.query.nb(a).then(b=>ti(b))}Fc(){return ti(this.query.Fc())}};olympe.dc.nd.prototype.executeFromCache=olympe.dc.nd.prototype.Fc;
|
|
719
|
+
olympe.dc.nd.prototype.execute=olympe.dc.nd.prototype.nb;olympe.dc.nd.prototype.cast=olympe.dc.nd.prototype.hj;olympe.dc.nd.prototype.follow=olympe.dc.nd.prototype.fb;const ui=olympe.dc.va.ORIGIN,vi=olympe.dc.va.DESTINATION;function ii(a,b){Qh(a.j,()=>{a.gb()||null!==a.D||b(a.query.T())})}function ki(a,b,c){const d=a.da;a.da++;a.H.set(d,c);b===olympe.dc.Ja.SELF?a.hd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.hd(()=>Wh(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
|
|
720
|
+
function ri(a,b,c){if(a.query.sb()!==b)return!1;c.qc(a.ha);(b=a.ha.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function mi(a){Yh(a.j);a.H.forEach(b=>{b.next(a.j)})}
|
|
721
|
+
function wi(a,b,c){const d=[];let e=!1;const f=new olympe.async.mk(olympe.C.ah());for(const g of b)if(g.Nc(a.query)&&(e||(e=!0),f.add(h=>g.hd(k=>{!k&&d.push(g);h()}))),null!==g.D&&ei(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}bd(f,g=>c(g?d:[]));f.start();return e}
|
|
722
|
+
function xi(a){const b=a.query.T(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,x,y)=>r.forEach(z=>z(t,u,x,y)):()=>{}},e=Oh(a.query),f=a.j;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.T(),t=g.j;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.D,l=olympe.V.tb(k),n=sf(h,k,(q,r)=>{q?Uh(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.Y)||p.push(()=>{qf(h,k,n)});yi(a)}
|
|
723
|
+
function zi(a){const b=a.Ga(a.query,a.$a.bind(a),()=>{null===a.D||a.gb()||xi(a)},d=>{a.gb()||(a.G.error(`Error while getting data from data source (${a.query.sb()}) to ensure coverage of the query ${a.query.T()}: ${d}`),yi(a))});let c;b&&(null==(c=a.Y)||c.push(b))}function Ai(a,b){a.N.delete(b);0===a.N.size&&(a.N=null,Promise.resolve().then(()=>{!a.gb()&&zi(a)}))}function yi(a){const b=a.D;a.D=null;null==b||b.forEach(c=>c())}
|
|
724
|
+
olympe.dc.query.Iq=class{constructor(a,b,c,d,e){this.G=a;this.ua=b;this.db=b.view;this.query=c;this.jd=d;this.j=new olympe.dc.query.Aq(this.G,c);this.$=0;this.da=1;this.Y=[];this.H=new Map;this.D=[()=>Yh(this.j)];this.Ga=e;this.ha=new Bi(a,this.db,c,this.j);this.F=this.N=null;this.R=[]}start(a){return wi(this,a,b=>{0<b.length?(this.N=new Set(b),this.N.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),xi(this)):zi(this)})}Nc(a){return!this.gb()&&this.query.sb()===a.sb()&&(this.query.T()===a.T()||
|
|
725
|
+
(null===this.D||this.query.D===a.D)&&this.j.Nc(a))}hd(a){null!==this.D?this.D.push(a):a();return this}destroy(a){a?this.G.error(`Destroy subscription ${this.query.T()} after error: ${a}`):this.G.debug(`Destroy subscription ${this.query.T()}`);const b=this.Y;this.Y=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Ai(e,this));let d;null==(d=this.N)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}gb(){return null===this.Y}$a(){const a=
|
|
726
|
+
olympe.dc.ma.nc.Jg;if(this.jd===a)return olympe.V.stream.tap(c=>{c=c.Rk().filter(e=>e.o===olympe.dc.Lc.j).map(e=>e.t);this.ua.je(c,'Batch mode');const d=Oh(this.query)[0];d instanceof olympe.dc.query.na.Ol&&c.forEach(e=>Uh(this.j,e,d.T(),d.j))});let b;if(0<(null==(b=this.R)?void 0:b.length)){const c=this.R.filter(e=>e.jd===a).map(e=>new Promise(f=>e.hd(f))),d=this.R.filter(e=>e.jd!==a).map(e=>new Promise(f=>e.hd(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};
|
|
727
|
+
function Ci(a,b){return a.F.has(vi+b)||a.F.has(ui+b)}
|
|
728
|
+
class Bi{constructor(a,b,c,d){this.G=a;this.db=b;this.H=d;this.R=[];this.N=-1<c.j.max||0<c.j.offset;this.F=new Map;this.j=!1;const e=new Map;for(const f of Oh(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.na.Kh){a=f.relation;a=`${a.Ka()}${a.X()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}Di(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.T());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.j;this.j=!1;return a}Oc(){}Wc(a,b){if(!(this.j||
|
|
729
|
+
!this.N&&this.db.Ha(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Th(this.H,a,e)))}}D(a){this.j||this.db.Ha(a)&&!this.N||this.j||(this.j=this.R.some(b=>Th(this.H,a,b)))}Oa(a,b,c){if(!this.j&&Ci(this,a)){var d=this.db.Ha(b),e=this.db.Ha(c);if(d&&!e||!d&&e){const f=this.F.get(vi+a);a=this.F.get(ui+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>Th(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>Th(this.H,c,g.j))))}}}hc(a,b,c){if(!this.j&&this.N&&Ci(this,a)&&this.db.As(b,
|
|
730
|
+
new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(vi+a);a=this.F.get(ui+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>Th(e,b,f.j)&&Th(e,c,f.T())))||(null==a?void 0:a.some(f=>Th(e,c,f.j)&&Th(e,b,f.T()))))}}}olympe.dc.query.Iq.xa=[olympe.dc.Writable];function Ei(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
|
|
730
731
|
olympe.dc.query.Relation=class extends olympe.dc.Ra.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ka())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Qb(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,b){return new olympe.dc.query.Relation(a.X(),a.Ka(),null!=b?b:a instanceof olympe.dc.ba.Fe)}$b(){const a=
|
|
731
|
-
olympe.dc.va.DESTINATION,b=olympe.dc.va.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Ca:'dc.query.Logger',nk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.nk,olympe.dc.query.Bv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ng,new olympe.W.pa(olympe.dc.U.Mh))});olympe.W.run([olympe.dc.query.P.nk],a=>{olympe.dc.query.Uk=()=>a});olympe.dc.query.yd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Jd=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){
|
|
732
|
-
Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Aa.j.
|
|
732
|
+
olympe.dc.va.DESTINATION,b=olympe.dc.va.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}T(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.P={Ca:'dc.query.Logger',nk:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.P.Ca,[olympe.ja.P.Da],b=>b.cd('query'));D(a,olympe.dc.query.P.nk,olympe.dc.query.Bv,olympe.dc.query.P.Ca,olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ng,new olympe.W.pa(olympe.dc.U.Mh))});olympe.W.run([olympe.dc.query.P.nk],a=>{olympe.dc.query.Uk=()=>a});olympe.dc.query.yd=class extends Error{};olympe.dc.query.Z={};olympe.dc.query.Z.Jd=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){const a=b=>0<b.length?b[0].reduce((c,d)=>[...c,...a(b.slice(1)).map(e=>[...d,...e])],[]):[[]];return a(this.Z.map(b=>b.compile()))}ud(){return new olympe.dc.query.Z.Be(...this.Z.map(a=>a.ud()))}Db(){return this.Z.flatMap(a=>a.Db())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b&&c.nb(a),!0)}observe(a,
|
|
733
|
+
b,c){const d=Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('AND-'+b+a+h),f.bind(null,h))})}ga(){return{pr:olympe.dc.query.Aa.j.Kn,p:this.Z.map(a=>a.ga())}}Vc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Z.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('AND-'+b+a+d))})}};olympe.dc.query.Z.tf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.fa(a);this.substring=b;this.db=c;this.j=d}Db(){return[this.La]}Nc(a,b){return a instanceof olympe.dc.query.Z.tf&&a.La===this.La?b?a.j?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.j?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Qa(){return this.La}nb(a){return this.apply(this.db.Qa(a,
|
|
733
734
|
this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.La+'-'+this.substring+'-'+this.j}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}Vc(){return{name:'CONTAINS',property:this.Qa(),value:this.substring,caseSensitive:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Nj,
|
|
734
735
|
p:this.La,s:this.substring,c:this.j}}};olympe.dc.query.Z.ve=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.La=olympe.dc.fa(a);this.j=olympe.dc.mb.Bc(null!=b?b:null);this.db=c}Db(){return[this.La]}Nc(a){if(a instanceof olympe.dc.query.Z.ve&&this.La===a.La)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Ea(a.j);if(this.j instanceof Date)return a.j instanceof Date&&this.j.getTime()===a.j.getTime();if(this.j instanceof olympe.C.Color)return this.j.Ea(a.j)}else return this.j===
|
|
735
736
|
a.j;return!1}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()));null===this.j&&null===this.db.Qa(a,this.La)&&c(!0)}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ea(this.j):a instanceof Date?this.j instanceof Date&&this.j.getTime()===a.getTime():a instanceof olympe.C.Color?a.Ea(this.j):!1:a===
|
|
736
|
-
this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.La+'-'+c}Vc(){return{name:'EQUALS',property:this.La,value:this.j}}ga(){let a=1,b=this.j;switch(!0){case this.j instanceof Date:a=2;b=this.j.toJSON();break;case this.j instanceof olympe.dc.CloudObject:a=3;b=this.j.X();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.Aa.j.
|
|
737
|
+
this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.La+'-'+c}Vc(){return{name:'EQUALS',property:this.La,value:this.j}}ga(){let a=1,b=this.j;switch(!0){case this.j instanceof Date:a=2;b=this.j.toJSON();break;case this.j instanceof olympe.dc.CloudObject:a=3;b=this.j.X();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.Aa.j.Qo,p:this.La,t:a,v:b}}};function Fi(a,b,c){return olympe.V.tb(c+b+a.j+a.La)}
|
|
737
738
|
olympe.dc.query.Z.Gi=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.fa(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.fa(c):c;this.D=d;this.H=e}ud(){return new olympe.dc.query.Z.Gi(this.db,this.La,this.j,!this.D,!this.H)}Db(){return[this.La]}Nc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Z.Gi&&this.La===a.La?
|
|
738
|
-
typeof this.j!==typeof a.j||this.D!==a.D?!1:this.F?this.j===a.j:this.D&&this.j>=a.j||!this.D&&this.j<=a.j:!1}Qa(){return this.La}nb(a){return this.compare(this.db.Qa(a,this.La),this.F?this.db.Qa(a,this.j):this.j)}observe(a,b,c){this.F&&Lg(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},
|
|
739
|
-
this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Mg(this.db,a,this.La,
|
|
739
|
+
typeof this.j!==typeof a.j||this.D!==a.D?!1:this.F?this.j===a.j:this.D&&this.j>=a.j||!this.D&&this.j<=a.j:!1}Qa(){return this.La}nb(a){return this.compare(this.db.Qa(a,this.La),this.F?this.db.Qa(a,this.j):this.j)}observe(a,b,c){this.F&&Lg(this.db,a,this.j,d=>{const e=this.db.Qa(a,this.La);null!==e&&c(this.compare(e,d))},Fi(this,a,b));Lg(this.db,a,this.La,d=>{const e=this.F?this.db.Qa(a,this.j):this.j;c(null!==e?this.compare(d,e):!0)},Fi(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.H?
|
|
740
|
+
this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){Mg(this.db,a,this.La,Fi(this,a,b));this.F&&Mg(this.db,a,this.j,Fi(this,a,b))}Vc(){return{name:'INEQUALITY_OPERATOR',property:this.Qa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}ga(){return{pr:olympe.dc.query.Aa.j.Ap,p:this.La,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.La+'-'+this.H+'-'+this.j}};olympe.dc.query.Z.fe=class extends olympe.dc.query.Aa{constructor(a){super();this.j=a}compile(){const a=this.j.ud();return this.Ea(a)?super.compile():a.compile()}ud(){return this.j}Db(){return this.j.Db()}Nc(a,b){return a instanceof olympe.dc.query.Z.fe?this.j.Nc(a.j,b):this.j.Nc(a,!b)}nb(a){return!this.j.nb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.V.tb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Vc(){return{name:'NOT',predicate:this.j.Vc()}}ga(){return{pr:olympe.dc.query.Aa.j.aq,v:this.j.ga()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
|
|
740
741
|
b){this.j.clear(a,olympe.V.tb('NOT'+b+a))}Ea(a){return a instanceof olympe.dc.query.Z.fe?this.j.Ea(a.j):!1}};olympe.dc.query.Z.Be=class extends olympe.dc.query.Aa{constructor(...a){super();this.Z=a}compile(){return this.Z.map(a=>a.compile()).flat()}ud(){return new olympe.dc.query.Z.Jd(...this.Z.map(a=>a.ud()))}Db(){return this.Z.flatMap(a=>a.Db())}Nc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}nb(a){return this.Z.reduce((b,c)=>b||c.nb(a),!1)}observe(a,b,c){const d=Array(this.Z.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
|
|
741
|
-
k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('OR-'+b+a+h),f.bind(null,h))})}Vc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Aa.j.pq,p:this.Z.map(a=>a.ga())}}toString(){return'
|
|
742
|
-
return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Kq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.
|
|
743
|
-
function
|
|
744
|
-
olympe.dc.query.
|
|
745
|
-
b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Hb)?void 0:b.toString())?d:''}`}Vc(){}toJSON(){}ga(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.ga());null!==this.Hb&&(a.c=this.Hb.ga());return a}Y(){}ha(){return new olympe.dc.query.
|
|
746
|
-
|
|
747
|
-
f,g)}))}Ea(){}};olympe.dc.query.
|
|
748
|
-
olympe.dm.Relation.j.Qq,g=olympe.dm.Relation.j.yr;a=a.relation;const h=a.Ka(),k=a.X();return h!==c||k!==d&&k!==e?!!(Ug(this.db,a,this.Pb)&(a.Ka()===b?f:g)):!0}return a instanceof olympe.dc.query.
|
|
749
|
-
Wg(this.db,g,this.Pb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?
|
|
750
|
-
rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ja.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ja.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.
|
|
751
|
-
c.push(a);return c}nb(a){const b=this.T();for(const c of
|
|
752
|
-
{recursive:!1,relation:this.relation,filter:
|
|
753
|
-
b.relation.Ea(this.relation)&&c.push(a);return c}nb(a){const b=this.T();for(const c of
|
|
754
|
-
g,olympe.V.tb(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.Ka()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Vc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:
|
|
755
|
-
relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.
|
|
756
|
-
b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ha(a)||!b)return this.content.delete(a);var c=this.content.get(a);if(!c)return!1;const d=c.get(b);if(1<d)return c.set(b,d-1),!0;b=c.delete(b);if(0===c.size)return this.content.delete(a);if(b){c=new Set(c.keys());for(const e of c){if(this.origin===e)return!0;let f,g;for(const h of null!=(g=null==(f=this.content.get(e))?void 0:f.keys())?g:[])c.add(h)}return this.content.delete(a)}return!1}};olympe.dc.query.
|
|
757
|
-
(e=null==c?void 0:c.delete(b))?e:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);return b}};olympe.dc.query.
|
|
758
|
-
return b}};olympe.dc.query.
|
|
759
|
-
function
|
|
760
|
-
k[
|
|
761
|
-
(X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ja.Bf;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let Zc;void 0===Pa?Zc='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?Zc=Pa:Zc=JSON.stringify(a.D.ga(Pa));return new olympe.net.ld(Zc,h===
|
|
762
|
-
|
|
763
|
-
function
|
|
764
|
-
function
|
|
765
|
-
function
|
|
766
|
-
function
|
|
767
|
-
olympe.dc.sources.Wt=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.Y=d;this.$=e;this.D=f;this.F=new Map;new olympe.C.Xb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.da=new Map([[olympe.dc.Request.j.Cg,olympe.L.Yb.Cg],[olympe.dc.Request.j.$f,olympe.L.Yb.Wj],[olympe.dc.Request.j.hg,olympe.L.Yb.Wj],[olympe.dc.Request.j.Yf,olympe.L.Yb.Wj],[olympe.dc.Request.j.
|
|
768
|
-
[olympe.dc.Request.j.Lg,olympe.L.Yb.
|
|
769
|
-
const g=N(e===olympe.dc.Ja.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,
|
|
770
|
-
{['X-Source-Origin']:a.origin});return
|
|
771
|
-
Ac(e,{['X-Source-Origin']:a.origin});
|
|
772
|
-
function
|
|
773
|
-
function
|
|
774
|
-
olympe.dc.sources.Tp=class{constructor(a,b){this.G=a;this.j=b;this.Tb=null;this.N=olympe.dc.query.Uk();this.H=olympe.dc.gs();this.F=new olympe.C.Xb('Context of source '+this.T());let c;this.R=null!=(c=b.Lf(olympe.dc.sources.U.
|
|
775
|
-
for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case
|
|
776
|
-
return this.j.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case
|
|
777
|
-
b.jc());case
|
|
778
|
-
b,this.F,a,olympe.dc.ma.nc.rf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Me)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=
|
|
779
|
-
function
|
|
780
|
-
class
|
|
742
|
+
k);e!==g&&(e=g,c(g))};this.Z.forEach((g,h)=>{g.observe(a,olympe.V.tb('OR-'+b+a+h),f.bind(null,h))})}Vc(){throw Error('toObject for OR predicate should not be called');}ga(){return{pr:olympe.dc.query.Aa.j.pq,p:this.Z.map(a=>a.ga())}}toString(){return'Or-'+this.Z.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.Z.forEach((c,d)=>{c.clear(a,olympe.V.tb('OR-'+b+a+d))})}};olympe.dc.query.Z.Ef=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.La=olympe.dc.fa(a);this.j='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.D=d}Db(){return[this.La]}Nc(a){return a instanceof olympe.dc.query.Z.Ef&&this.La===a.La&&this.j.toString()===a.j.toString()}nb(a){return this.apply(this.db.Qa(a,this.La))}observe(a,b,c){Lg(this.db,a,this.La,d=>{c(this.apply(d))},olympe.V.tb(b+a+this.toString()))}apply(a){a=olympe.dc.mb.Bc(a);
|
|
743
|
+
return'string'===typeof a?(a=this.j.test(this.D?a:a.toLowerCase()),this.j.lastIndex=0,a):!1}toString(){return'Regex'+this.La+'-'+this.j.toString()+'-'+this.D}Vc(){return{name:'REGEX',property:this.La,pattern:this.j,caseSensitive:this.D}}ga(){return{pr:olympe.dc.query.Aa.j.Kq,p:this.La,r:this.j.source,c:this.D}}clear(a,b){Mg(this.db,a,this.La,olympe.V.tb(b+a+this.toString()))}};olympe.dc.query.Z.Gm=class extends olympe.dc.query.Aa{constructor(a){super();this.j=new Set(a.map(olympe.dc.fa))}Db(){return[]}Nc(a){return a instanceof olympe.dc.query.Z.Gm&&Array.from(a.j).every(b=>this.j.has(b))}nb(a){return this.j.has(a)}observe(a,b,c){c(this.j.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.j)}Vc(){return{name:'IS',tags:Array.from(this.j)}}ga(){return{pr:olympe.dc.query.Aa.j.tr,t:Array.from(this.j)}}};olympe.dc.query.na={};function Di(a){let b,c;const d=new Set(null!=(c=null==(b=a.D)?void 0:b.Db())?c:[]);let e;a.Hb&&d.add(null==(e=a.Hb)?void 0:e.Qa().X());return d}function Gi(a){if(!a.da){let b,c;a.da=null!=(c=null==(b=a.D)?void 0:b.compile())?c:[]}return a.da}function Hi(a,b){for(const c of b)if(a.some(d=>d.Nc(c,!1)))return!0;return!1}
|
|
744
|
+
function Ii(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.V.tb(h+f+d);e?a.D.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.D.clear(f,k),c=!1,b(!1,f,g,k))}}function Ji(a,b,c){if(null===a.Hb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Hb.Qa();h=olympe.V.tb(h+d);e?Lg(a.db,f,k,()=>{Rh(b)},h):Mg(a.db,f,k,h);c(e,f,g,h)}}
|
|
745
|
+
olympe.dc.query.na.um=class{constructor(a,b){this.db=olympe.dc.ia();this.j=a;this.optional=b;this.da=this.Hb=this.D=this.id=null}static j(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.na.Kd(b,a.f);var c=a.o;const d=new olympe.dc.Ra.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.na.we(b,d,a.s,c):new olympe.dc.query.na.wh(b,d,c);void 0!==a.p&&(b.D=$h(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.sf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Hb=a);return b}N(){}H(){let a,
|
|
746
|
+
b,c,d;return`${this.j}-${this.optional}${null!=(c=null==(a=this.D)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Hb)?void 0:b.toString())?d:''}`}Vc(){}toJSON(){}ga(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.ga());null!==this.Hb&&(a.c=this.Hb.ga());return a}Y(){}ha(){return new olympe.dc.query.na.Bm}$(){}T(){this.id||(this.id=this.Y());return this.id}R(){return this.optional}Nc(a){const b=Gi(this);if(0===b.length)return!0;a=Gi(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
|
|
747
|
+
Hi(d,c)))return!1;return!0}filter(a){const b=this.N(),c=b.D;null===c?b.D=a:b.D=c instanceof olympe.dc.query.Z.Jd?new olympe.dc.query.Z.Jd(...Array.from(c.Z),a):new olympe.dc.query.Z.Jd(b.D,a);return b}sort(a,b){const c=this.N();c.Hb=new olympe.dc.query.sf(this.T(),a,b);return c}$g(){return this.Hb}nb(a){if(null!==this.D){var b=this.T();for(const c of Sh(a,b))this.D.nb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return Ii(this,Ji(this,a,(d,e,f,g)=>{(d?Uh(a,e,c,f):a.remove(e,c,f))&&b(d,e,
|
|
748
|
+
f,g)}))}Ea(){}};olympe.dc.query.na.Kh=class extends olympe.dc.query.na.um{constructor(a,b,c){super(a,c);this.relation=b;this.ua=null}};olympe.dc.query.na.vm=class{has(){}H(){}j(){}Rc(){}D(){}remove(){}};olympe.dc.query.na.Kd=class extends olympe.dc.query.na.um{constructor(a,b,c){super(a,!1);this.Pb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.na.Kd(this.j,this.Pb,this.F)}Y(){return olympe.V.tb(this.j+'followRules')}ha(){return new olympe.dc.query.na.Hp(this.db,this.F)}$(a,b){return b instanceof olympe.dc.query.na.Kd?[a]:[olympe.V.tb(a+'followRules')]}Nc(a){if(a instanceof olympe.dc.query.na.Kh){const b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION,d=olympe.dc.fc.Yc,e=olympe.dc.fc.zi,f=
|
|
749
|
+
olympe.dm.Relation.j.Qq,g=olympe.dm.Relation.j.yr;a=a.relation;const h=a.Ka(),k=a.X();return h!==c||k!==d&&k!==e?!!(Ug(this.db,a,this.Pb)&(a.Ka()===b?f:g)):!0}return a instanceof olympe.dc.query.na.Kd?this.Pb===a.Pb:!1}nb(a){const b=this.T();for(const c of Sh(a,this.j))for(const d of Qf(this.db,c,this.Pb))Uh(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?Vg(this.db,g,this.Pb,(l,n,p,q,r)=>{p&&(p=q?Uh(a,r,c,g):a.remove(r,c,g),null!==n&&Vh(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
|
|
750
|
+
Wg(this.db,g,this.Pb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?Uh(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.V.tb(h+f+this.toString()))}}ga(){return Object.assign(super.ga(),{f:this.Pb})}H(){return`followRulePart-${this.Pb}-${super.H()}`}Vc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Pb)} (${this.Pb})`}Ea(a){return a instanceof olympe.dc.query.na.Kd&&this.Pb===a.Pb}toJSON(){return{type:'follow rule',
|
|
751
|
+
rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ja.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ja.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.na.Kd.D='followRules';olympe.dc.query.na.wh=class extends olympe.dc.query.na.Kh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.na.wh(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.na.Kd)return[a];const c=[a+this.relation.T(),a+Ei(this.relation).T()+!1,a+Ei(this.relation).T()+!0,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.na.we&&b.relation.Ea(this.relation)&&
|
|
752
|
+
c.push(a);return c}nb(a){const b=this.T();for(const c of Sh(a,this.j))this.db.bb(c,this.relation).forEach(d=>{Uh(a,d,b,c)});super.nb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ka(),f=this.toString();return(g,h,k,l)=>{const n=olympe.V.tb(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{Vh(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}ga(){return Object.assign(super.ga(),{t:this.relation.X(),d:this.relation.Ka()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Vc(){const a=
|
|
753
|
+
{recursive:!1,relation:this.relation,filter:Gi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ji});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.na.wh&&this.relation.Ea(a.relation)}};olympe.dc.query.na.we=class extends olympe.dc.query.na.Kh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ha(){return new olympe.dc.query.na.Uq}N(){const a=new olympe.dc.query.na.we(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.tb(this.j+this.relation.T()+this.F)}$(a,b){if(b instanceof olympe.dc.query.na.Kd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.V.tb(d));b instanceof olympe.dc.query.na.we&&
|
|
754
|
+
b.relation.Ea(this.relation)&&c.push(a);return c}nb(a){const b=this.T();for(const c of Sh(a,this.j))this.F&&Uh(a,c,b,c),this.db.eh(c,this.relation).forEach(d=>{Uh(a,d,b,c)});super.nb(a)}observe(a,b){const c=this.relation.X(),d=this.relation.Ka(),e=(f,g,h,k)=>{const l=olympe.V.tb(k+g);f?T(this.db,g,this.relation,(n,p)=>{Vh(a,n,c,d,g,p);super.observe(a,(q,r,t,u)=>{b(q,r,t,u);e(q,r,t,k)})(n,p,h,l)},l):this.db.D(g,this.relation,l)};return(f,g,h,k)=>{h=k+this.toString();this.F&&super.observe(a,b)(f,g,
|
|
755
|
+
g,olympe.V.tb(h+g));e(f,g,g,h)}}ga(){return Object.assign(super.ga(),{s:this.F,t:this.relation.X(),d:this.relation.Ka()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Vc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:Gi(this).map(b=>b.map(c=>c.Vc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Qa(),order:this.Hb.Ji});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
|
|
756
|
+
relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ka()}}Ea(a){return a instanceof olympe.dc.query.na.we&&this.relation.Ea(a.relation)&&this.F===a.F}};olympe.dc.query.na.Ol=class extends olympe.dc.query.na.Kd{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?Uh(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.na.Hp=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.F=null!=b?b:null}Rc(){return this.content.keys()}j(a){return this.content.has(a)&&null!==this.origin?[this.origin].values():[].values()}has(a){return this.content.has(a)}H(a){let b;return(null==(b=this.F)?void 0:b.call(this,a))||!1}D(a,b){null===this.origin&&(this.origin=b);const c=this.content.get(a);if(!c)return this.content.set(a,(new Map).set(b,1)),!0;let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return!1}remove(a,
|
|
757
|
+
b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ha(a)||!b)return this.content.delete(a);var c=this.content.get(a);if(!c)return!1;const d=c.get(b);if(1<d)return c.set(b,d-1),!0;b=c.delete(b);if(0===c.size)return this.content.delete(a);if(b){c=new Set(c.keys());for(const e of c){if(this.origin===e)return!0;let f,g;for(const h of null!=(g=null==(f=this.content.get(e))?void 0:f.keys())?g:[])c.add(h)}return this.content.delete(a)}return!1}};olympe.dc.query.na.Hp.xa=[olympe.dc.query.na.vm];olympe.dc.query.na.Uq=class{constructor(){this.content=new Map}Rc(){return this.content.keys()}j(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.keys())?c:[]}has(a){return this.content.has(a)}H(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Map,this.content.set(a,c));let d;a=null!=(d=c.get(b))?d:0;c.set(b,a+1);return 0===a}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a),d=null==c?void 0:c.get(b);if(1<d)return c.set(b,d-1),!1;let e;b=null!=
|
|
758
|
+
(e=null==c?void 0:c.delete(b))?e:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);return b}};olympe.dc.query.na.Uq.xa=[olympe.dc.query.na.vm];olympe.dc.query.na.Bm=class{constructor(){this.content=new Map}Rc(){return this.content.keys()}j(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}H(){return!1}D(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);let d;b=null!=(d=null==c?void 0:c.delete(b))?d:!1;0===(null==c?void 0:c.size)&&this.content.delete(a);
|
|
759
|
+
return b}};olympe.dc.query.na.Bm.xa=[olympe.dc.query.na.vm];olympe.dc.sources={};olympe.dc.sources.Yq=class extends Error{};olympe.dc.sources.Tj=class{T(){}init(){}destroy(){}request(){return w(function*(){})}subscribe(){}};const Ki=olympe.net.wa.Nd.GET,Li=olympe.net.wa.Nd.Gh,Mi=olympe.net.wa.Nd.Dc,Ni=olympe.net.wa.Nd.zq,Oi=olympe.net.wa.Headers.wi,Pi=olympe.net.wa.Headers.Wn,Qi=olympe.net.wa.Vb.Eh,Ri=olympe.net.wa.Vb.oo,Si=olympe.net.wa.Vb.Zo,Ti=olympe.net.wa.Vb.Vi,Ui=olympe.net.wa.Vb.hm;
|
|
760
|
+
function Vi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.Ql)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.F('_DataSourcesHTTPService',b,[Ki,Li,Mi,Ni],(c,d,e)=>w(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.ld(`No handler found for datasource ${f} called '${g}'`,Ui,'Invalid source id'))}h=c.method;const k=c.qj();try{var l=yield Wi(a,
|
|
761
|
+
k[Pi])}catch(r){return new olympe.net.ld(`Invalid token ${r}`,Si,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.oc,t=olympe.dc.Request.j.Lg,u=olympe.dc.Request.j.Ze,x=olympe.dc.Request.j.Vg,y=olympe.dc.Request.j.oh,z=olympe.dc.Request.j.Yf,A=olympe.dc.Request.j.$f,K=olympe.dc.Request.j.hg;let X;switch(n){case r:break;case t:case u:case y:case x:X=a.D.N(p);break;case K:case z:case A:X={tag:e.get('tag'),model:e.get('model'),mimeType:k[Oi]};p instanceof Uint8Array&&
|
|
762
|
+
(X.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let xa;const ab=null!=(xa=k['X-Source-Origin'])?xa:olympe.dc.Ja.Bf;var q=vf(new olympe.dc.Request(n,f,X,l),ab);const Pa=yield g(q);let Zc;void 0===Pa?Zc='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?Zc=Pa:Zc=JSON.stringify(a.D.ga(Pa));return new olympe.net.ld(Zc,h===Ni?Ri:Qi)}catch(r){return r instanceof olympe.dc.sources.Yq?new olympe.net.ld(`Authorization error: ${r}`,
|
|
763
|
+
Si,'Forbidden'):new olympe.net.ld(`Internal server error: ${r}`,Ti,'Internal server error')}})).catch(c=>a.G.error(`Error while starting the HTTP Service: ${c}`));a.G.debug(`Started HTTP service with path: ${b}`)}function Xi(a){a.R.Y('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Yi(a,b,c){0===a.F.size&&Vi(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&Xi(a)}}
|
|
764
|
+
function Zi(a,b,c){c=b instanceof olympe.dm.DataSource?b.Lf(c):$i(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
|
|
765
|
+
function aj(a,b,c){if(b===olympe.dc.Ja.SERVER){var d;return null!=(d=Ld(a.H,a.da.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.$.sb(b);e=olympe.dc.sources.U.xh;const f=olympe.dc.sources.U.wf,g=olympe.dc.sources.U.Di,h=olympe.dc.sources.U.Ql;let k;e=`${Zi(a,null!=d?d:b,g)?'https':'http'}://${Zi(a,null!=d?d:b,e)}:${null!=(k=Zi(a,null!=d?d:b,f))?k:Zi(a,null!=d?d:b,g)?443:80}`+`/${Zi(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
|
|
766
|
+
function bj(a,b){return b instanceof olympe.net.Fi?Nd(a.H,b,rd(a.Y).Cd()):Promise.reject('No http request to send')}function cj(a,b){var c=aj(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.ic()}`);const d=b.content,e=JSON.stringify(a.D.ga(d));c=N(c,Li,e,olympe.net.wa.ResponseType.JSON);Ac(c,{['X-Source-Origin']:b.origin,[Oi]:'application/json'});return bj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.zd.mj(d))}
|
|
767
|
+
function dj(a,b){var c=aj(a,b.ic(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.ic()}`);const d=JSON.stringify(a.D.ga(b.content));c=N(c,Li,d);Ac(c,{['X-Source-Origin']:b.origin,[Oi]:'application/json'});return bj(a,c).then(e=>Number.parseInt(e.getData(),10))}function Wi(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Y.hh(b,(e,f)=>{e?d(e):c(f)})})}
|
|
768
|
+
olympe.dc.sources.Wt=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.Y=d;this.$=e;this.D=f;this.F=new Map;new olympe.C.Xb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.da=new Map([[olympe.dc.Request.j.Cg,olympe.L.Yb.Cg],[olympe.dc.Request.j.$f,olympe.L.Yb.Wj],[olympe.dc.Request.j.hg,olympe.L.Yb.Wj],[olympe.dc.Request.j.Yf,olympe.L.Yb.Wj],[olympe.dc.Request.j.Yn,olympe.L.Yb.Xn],[olympe.dc.Request.j.Oq,olympe.L.Yb.Nq],[olympe.dc.Request.j.mp,olympe.L.Yb.lp],
|
|
769
|
+
[olympe.dc.Request.j.Lg,olympe.L.Yb.io],[olympe.dc.Request.j.Vg,olympe.L.Yb.TRANSACTION]])}Hc(a){var b=aj(this,a.ic(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.ic()}`);b=Cc(N(b,Ki),olympe.net.wa.ResponseType.JSON);Ac(b,{['X-Source-Origin']:a.origin});return bj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.ic(),f=aj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
|
|
770
|
+
const g=N(e===olympe.dc.Ja.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,Ni,d);Ac(g,{[Oi]:'application/octet-stream'});e!==olympe.dc.Ja.SERVER&&Ac(g,{['X-Source-Origin']:a.origin});return bj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=aj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ja.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Mi,b);d!==olympe.dc.Ja.SERVER&&Ac(e,
|
|
771
|
+
{['X-Source-Origin']:a.origin});return bj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=aj(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.j.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,bi:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ja.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Ki,void 0,olympe.net.wa.ResponseType.Oh);d!==olympe.dc.Ja.SERVER&&
|
|
772
|
+
Ac(e,{['X-Source-Origin']:a.origin});bj(this,e).then(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.done(h.getData()))}).catch(h=>{let k;null==(k=this.j.get(b))||k.forEach(l=>l.bi(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.Fp=class{constructor(a,b){this.G=a;this.Tb=b}};olympe.dc.sources.Fp.Vb={Xi:0,mC:1,nC:3,JB:4};const ej=olympe.dc.Request.j.oc,fj=olympe.dc.Request.j.Lg,gj=olympe.dc.Request.j.pk,hj=olympe.dc.Request.j.hg,ij=olympe.dc.Request.j.$f,jj=olympe.dc.Request.j.Yf,kj=olympe.dc.Request.j.si,lj=olympe.dc.Request.j.oh,mj=olympe.dc.Request.j.Ze,nj=olympe.dc.Request.j.Vg;
|
|
773
|
+
function oj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.V.Nh(6E4),hb(a.D,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),ib(a.D,()=>{a.D=null}));let d;const e=null!=(d=a.D.get(c))?d:new olympe.dc.db.ec(c);b.qc(e);fb(a.D.j,c)||a.D.set(c,e)}
|
|
774
|
+
function pj(a,b){const c=b.T();let d,e;const f=null!=(e=null==(d=a.D)?void 0:d.get(c))?e:new olympe.dc.db.ec(c);let g;null==(g=a.D)||g.delete(c);b.qc(f);return a.applyTransaction(f,!1).catch(h=>{a.G.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function qj(a,b){const c=rxjs.defer(()=>a.j.executeQuery(b));return 0<a.R?rxjs.interval(a.R).pipe(rxjs.operators.switchMap(()=>c)):c}
|
|
775
|
+
olympe.dc.sources.Tp=class{constructor(a,b){this.G=a;this.j=b;this.Tb=null;this.N=olympe.dc.query.Uk();this.H=olympe.dc.gs();this.F=new olympe.C.Xb('Context of source '+this.T());let c;this.R=null!=(c=b.Lf(olympe.dc.sources.U.sm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Tb=a;if(this.T()===olympe.dc.Ja.SELF)return this;(new Promise((b,c)=>{let d=!0;rj(this.j,this.F).subscribe(rxjs.Subscriber.create(e=>{if(this.G.j()){this.G.debug(`Data source ${this.j.name()} has loaded ${e.size()} data types in its cache:`);
|
|
776
|
+
for(const [f,g]of e)this.G.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.j.init(this.F)).catch(b=>{this.G.error(`Error while initialization of DataSource ${this.j.name()} (${this.T()}): ${b}`)});return this}healthCheck(){return this.j.healthCheck().then(()=>`Data source ${this.j.name()} (${this.j.T()}) OK`)}destroy(){this.F.destroy();return this.j.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case ej:const d=olympe.dm.DataSource.oc.Ab,e=olympe.dm.DataSource.oc.Jh;
|
|
777
|
+
return this.j.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case fj:return this.j.executeQuery(b);case kj:return c=b.jc(),oj(this,c),this.H.Tc(rf(c)),Promise.resolve();case mj:case nj:const f=b.jc();return this.applyTransaction(f,c===nj).finally(()=>{if(a.origin===olympe.dc.Ja.SELF){var g=f.T();g=vf(new olympe.dc.Request(olympe.dc.Request.j.Xj,olympe.dc.Ja.SELF,{id:g,finalize:olympe.dc.transaction.Ff.j.Ni,error:null}),this.T());let h;null==(h=this.Tb)||h.vd(g)}});case lj:return pj(this,
|
|
778
|
+
b.jc());case hj:return b.content instanceof Uint8Array?this.j.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case ij:return this.j.downloadFileContent(b.tag,b.model);case jj:return this.j.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===gj){const b=a.content;a=a.origin;return a===olympe.dc.Ja.SELF?qj(this,b):gi(this.N,
|
|
779
|
+
b,this.F,a,olympe.dc.ma.nc.rf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Me)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>rf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return w(function*(){var d=sj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield qi(c.N,c.T(),a);c.H.Tc(rf(a,d));return d})}};olympe.dc.sources.Tp.xa=[olympe.dc.sources.Tj];function sj(a){const b=olympe.dc.sources.gg.j.ut,c=olympe.dc.sources.gg.j.qw,d=olympe.dc.sources.gg.j.At,e=olympe.dc.sources.gg.j.vt,f=olympe.dc.sources.gg.j.Bt,g=[],h=[],k=[],l=[],n=[];a.Bb.forEach((p,q)=>{const r=p.Wb();p.D()?g.push(tj(b,q,r,p.R()?p.Db():null)):p.td()?k.push(tj(d,q,r,null,p.H())):p.R()&&h.push(tj(c,q,r,p.Db()));for(const [t,u,x]of p.Ed())p=a.Qc(u),x?l.push(new uj(e,t,q,u,r,p.Wb())):n.push(new uj(f,t,q,u,r,p.Wb()))});return n.concat(k,g,h,l)}
|
|
780
|
+
function tj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new vj(a,b,c,d,e)}olympe.dc.sources.gg=class{constructor(a){this.type=a}};class vj extends olympe.dc.sources.gg{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Lb.NONE}}
|
|
781
|
+
class uj extends olympe.dc.sources.gg{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.gg.j={ut:'CREATE',qw:'UPDATE',At:'DELETE',vt:'CREATE_RELATION',Bt:'DELETE_RELATION'};function wj(a,b){b=vf(new olympe.dc.Request(olympe.dc.Request.j.Xj,olympe.dc.Ja.SELF,{id:b,finalize:olympe.dc.transaction.Ff.j.Ni,error:null}),a.T());let c;null==(c=a.Tb)||c.vd(b)}
|
|
781
782
|
olympe.dc.sources.yl=class{constructor(a,b){this.G=a;this.D=b;this.Tb=null}T(){}R(){}Y(){}init(a){this.Tb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return w(function*(){if(!b.D.D)return b.R(a);var c=olympe.dc.Request.j.oc,d=olympe.dc.Request.j.Lg;const e=olympe.dc.Request.j.Ze,f=olympe.dc.Request.j.Vg;var g=olympe.dc.Request.j.si;const h=olympe.dc.Request.j.oh,k=olympe.dc.Request.j.hg;var l=olympe.dc.Request.j.$f;const n=olympe.dc.Request.j.Yf,p=olympe.dc.sources.Zd(),
|
|
782
|
-
q=a.getType(),r=a.ic();if(id(b.D)){q===d&&(c=a.content,(g=xf(a).get(olympe.dc.ma.j.ul))&&(yield
|
|
783
|
-
x.jc();yield
|
|
784
|
-
case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.jc().T();return p.applyTransaction(d,r).finally(()=>
|
|
785
|
-
b);const c=olympe.dc.sources.Zd(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(id(this.D)){const f=new rxjs.Observable(h=>{olympe.C.Is([this.D.Sf()],()=>{h.error(new olympe.L.errors.pp('Go Offline',d.T()))})}),g=this.Y(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.Is([this.D.Sf()],()=>{f.error(new olympe.L.errors.
|
|
786
|
-
throw g;}))))}};olympe.dc.sources.yl.xa=[olympe.dc.sources.Tj];const
|
|
787
|
-
function
|
|
788
|
-
function
|
|
789
|
-
g=yield d.
|
|
790
|
-
olympe.dc.sources.Xq=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Xb('Remote Provider Context');this.da=new Map;this.N=new Map;this.$=new Map;this.ha=f}T(){return olympe.dc.Ja.Bf}R(a){var b=olympe.L.ub;const c=a.ic(),d=a.getType();this.G.j()&&this.G.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case
|
|
791
|
-
c)?b.get(c,a):Promise.resolve({s:f});a=
|
|
792
|
-
a):b.get(c,a)).finally(()=>
|
|
793
|
-
b){const c=a.ic(),d=a.getType();if(!
|
|
783
|
+
q=a.getType(),r=a.ic();if(id(b.D)){q===d&&(c=a.content,(g=xf(a).get(olympe.dc.ma.j.ul))&&(yield xj(p,c.T(),g)),b.G.debug(`Data Provider: Query ${c.T()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.R(a);if(q===d){const t=a.content;d=l;const u=new olympe.dc.db.ec(`fullResult_${t.T()}`);l=d.pipeThrough(new TransformStream({transform:(x,y)=>w(function*(){const z=
|
|
784
|
+
x.jc();yield yj(p,z);z.qc(u);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Bb.size,'instances',Array.from(z.Ed()).length,'relations');y.enqueue(x)}),flush:()=>w(function*(){yield zj(p,t.T(),r,u,!0)})}))}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Aj(p,null,r,a.content.jc(),!1);return l}b.G.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.oc.Ae};
|
|
785
|
+
case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.jc().T();return p.applyTransaction(d,r).finally(()=>wj(b,t));case g:return Promise.resolve();case k:return d=a.content,p.uploadFileContent(d.tag,d.content,d.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.T()}`)}})}subscribe(a,b){if(!this.D.D)return this.Y(a,
|
|
786
|
+
b);const c=olympe.dc.sources.Zd(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(id(this.D)){const f=new rxjs.Observable(h=>{olympe.C.Is([this.D.Sf()],()=>{h.error(new olympe.L.errors.pp('Go Offline',d.T()))})}),g=this.Y(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.Is([this.D.Sf()],()=>{f.error(new olympe.L.errors.fo('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Aj(c,d.T(),e,f.jc()).then(()=>f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);
|
|
787
|
+
throw g;}))))}};olympe.dc.sources.yl.xa=[olympe.dc.sources.Tj];const Bj=olympe.dc.Request.j.oc,Cj=olympe.dc.Request.j.Lg,Dj=olympe.dc.Request.j.pk,Ej=olympe.dc.Request.j.Ze,Fj=olympe.dc.Request.j.Vg,Gj=olympe.dc.Request.j.si,Hj=olympe.dc.Request.j.oh,Ij=olympe.dc.Request.j.hg,Jj=olympe.dc.Request.j.$f,Kj=olympe.dc.Request.j.Yf;function Lj(a,b){let c;return(null==(c=a.ha.sb(b))?void 0:c.Lf(olympe.dc.sources.U.Qe))!==olympe.dm.DataSource.Qe.sp}function Mj(a,b){let c;return(null==(c=a.ha.sb(b))?void 0:c.Lf(olympe.dc.sources.U.Qe))!==olympe.dm.DataSource.Qe.ao}
|
|
788
|
+
function Nj(a,b){b=b.Cc();if(b!==olympe.dm.User.j&&a.Lf(olympe.dc.sources.U.ym))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.T()}). Please use an admin account instead.`,new olympe.dc.sources.Yq(a);}
|
|
789
|
+
function Oj(a,b,c,d,e){return w(function*(){var f=olympe.L.cb.j.SEND,g=olympe.L.cb.j.GET;const h=olympe.L.cb.j.PUBLISH,k=olympe.L.cb.j.SUBSCRIBE,l=d.Js();var n=d.body();if(e!==n.Cc())throw Error('Access denied: try to impersonate a user');Nj(c,n);let p;if(null==(p=a.Tb)||!p.sources.has(n.ic()))throw Error(`Try to process a message with destination data source ${n.ic()} coming from remote but not started here`);if(l===k){if(n.getType()===Dj)f=n.content.T();else throw Error('Not supported type of subscription');
|
|
790
|
+
g=yield d.un(f);a.$.set(g,f);g=a.N.get(f);g||(g=new Pj(a.G,f,b,vf(n,olympe.dc.Ja.Bf)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.vd(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.Pr()):l===h&&(yield b.request(n))})}
|
|
791
|
+
olympe.dc.sources.Xq=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Xb('Remote Provider Context');this.da=new Map;this.N=new Map;this.$=new Map;this.ha=f}T(){return olympe.dc.Ja.Bf}R(a){var b=olympe.L.ub;const c=a.ic(),d=a.getType();this.G.j()&&this.G.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case Bj:const e=olympe.dm.DataSource.oc.Ab,f=olympe.dm.DataSource.oc.Jh;b=Lj(this,
|
|
792
|
+
c)?b.get(c,a):Promise.resolve({s:f});a=Mj(this,c)?this.j.Hc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case Cj:return Mj(this,c)?cj(this.j,a):b.get(c,a);case Ej:const g=a.content.jc().T();return(Lj(this,c)?b.get(c,a):dj(this.j,a)).finally(()=>wj(this,g));case Fj:const h=a.content.jc().T();return(Mj(this,c)?dj(this.j,
|
|
793
|
+
a):b.get(c,a)).finally(()=>wj(this,h));case Gj:return Lj(this,c)?b.publish(c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case Hj:return Lj(this,c)?b.get(c,a):dj(this.j,a);case Ij:return Mj(this,c)?this.j.uploadFileContent(a):b.get(c,a);case Jj:return Mj(this,c)?this.j.downloadFileContent(a):b.get(c,a);case Kj:return Mj(this,c)?this.j.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Y(a,
|
|
794
|
+
b){const c=a.ic(),d=a.getType();if(!Lj(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.G.j()&&this.G.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===Dj?olympe.L.ub.observe(c,this.F,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.ma.from(this.H,this.H).fb(olympe.dm.DataSource.zj).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.Vh,
|
|
794
795
|
!0)).filter(olympe.dc.query.Aa.Ea(olympe.dm.DataSource.$r,!0)).observe(this.F).subscribe(b=>{b.nj().forEach(this.Ga.bind(this,a));b.sj().forEach(c=>{let d;null==(d=this.da.get(c))||d.destroy();this.da.delete(c)})});this.db.Qa(this.H,olympe.dm.DataSource.$r)&&(new olympe.L.ub(this.H,this.F)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.vd(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return w(function*(){})}Ga(a,
|
|
795
|
-
b){const c=b.X(),d=new olympe.C.Xb(`Published data provider context ${c}`,this.F);this.da.set(c,d);let e,f;
|
|
796
|
+
b){const c=b.X(),d=new olympe.C.Xb(`Published data provider context ${c}`,this.F);this.da.set(c,d);let e,f;Qj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Qe.ao&&(e=Yi(this.j,c,l=>{Nj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Qe.sp&&(g=new olympe.C.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.L.ub(c,g)).Qs(this.ua.bind(this)),f.listen().subscribe(l=>{l.mi().then(n=>Oj(this,
|
|
796
797
|
a,b,l,n)).catch(n=>{this.G.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.bi(n instanceof Error?n:Error(n))})}))})}ua(a){const b=this.$.get(a);this.$.delete(a);if(a=b)null==(a=this.N.get(b))?a=0:(0<a.j&&--a.j,0===a.j?(a.G.debug(`Data subscription ${a.D} has more subscriber: unsubscribe`),a.F.unsubscribe(),a=!0):(a.G.debug(`Data subscription ${a.D} has ${a.j} subscribers`),a=!1));a&&this.N.delete(b)}};
|
|
797
|
-
class
|
|
798
|
-
olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.$=a;this.db=a.view;this.F=new Map}ga(a){a=super.ga(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.Jr,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.Jr&&Array.isArray(null==a?void 0:a.i)?(
|
|
799
|
-
a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.ls().Ga(a),this.F.get(d).p[olympe.dm.File.urlProp.X()]='stream://'+d,e.s=this.D(a)}a=e}return b.call(this,c,a);case a instanceof olympe.dc.CloudObject:return this.format(W.
|
|
800
|
-
a.qc(b),this.format(W.np,{i:a.T(),p:Bf(b)});case a instanceof olympe.dc.Request:return this.format(W.
|
|
801
|
-
a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.
|
|
802
|
-
vf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.Ze:return d=this.j(c.p),new olympe.dc.transaction.aj(d,c.r);case W.Gq:return olympe.dc.query.zd.j(c);case W.
|
|
803
|
-
d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Le(a)||(c.v=!0);this.F.set(a,c);return a}};const
|
|
804
|
-
olympe.dc.Request.j.oh,
|
|
805
|
-
function
|
|
806
|
-
function
|
|
807
|
-
function
|
|
808
|
-
function
|
|
809
|
-
function
|
|
810
|
-
function
|
|
811
|
-
function
|
|
812
|
-
e))})}return b}function
|
|
813
|
-
function
|
|
814
|
-
function
|
|
815
|
-
function
|
|
816
|
-
olympe.dc.sources.lr=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.$=new olympe.dc.transaction.Si(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ga=g?new olympe.V.stream.yw:null;this.ua=new olympe.V.promise.rr(f);olympe.C.uj(this.D.Sf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.L.errors.Oi('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ja.SERVER}R(a){var b=a.getType();const c=a.content,d=xf(a);switch(b){case
|
|
817
|
-
olympe.dm.DataSource.oc.Ab,b=olympe.dm.DataSource.oc.Jh,Promise.resolve(Td(this.F)?{s:b}:{s:a,r:'Disconnected'});case
|
|
818
|
-
case
|
|
819
|
-
{this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.H.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Rd(this.F,olympe.L.ze.zg,this.ha.bind(this));return this}destroy(){return w(function*(){})}ha(a,b){const c=olympe.dc.Request.j
|
|
820
|
-
b=rf(b,a.ct),
|
|
798
|
+
class Pj{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.ub.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.j++;this.G.debug(`Data subscription ${this.D} has ${this.j} subscribers`);return this}}olympe.dc.sources.Xq.xa=[olympe.dc.sources.Tj];const W={Jr:10,no:11,Vo:12,Fq:13,QUERY_RESULT:14,np:15,Eo:16,Ze:17,Gq:18,Do:19,Ui:20};function Rj(a,b){const c=new olympe.dc.transaction.Ce,d=new olympe.dc.transaction.Ce;b.forEach(e=>{const f=new Map(Array.from(Object.entries(e.p).map(([h,k])=>[h,a.j(k)]))),g=e.v?d:c;g.Oc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.$.Tc(Af(Bf(d),olympe.dc.Ja.SELF),{persist:!1});a.$.Tc(Af(Bf(c),olympe.dc.Ja.SELF))}
|
|
799
|
+
olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.$=a;this.db=a.view;this.F=new Map}ga(a){a=super.ga(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(W.Jr,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===W.Jr&&Array.isArray(null==a?void 0:a.i)?(Rj(this,a.i),this.j(a.v)):this.j(a)}D(a){switch(!0){case a instanceof olympe.dm.File:var b=this.format,c=W.Vo;{const d=a.X(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Le(d))){const f=
|
|
800
|
+
a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))a=olympe.dc.ls().Ga(a),this.F.get(d).p[olympe.dm.File.urlProp.X()]='stream://'+d,e.s=this.D(a)}a=e}return b.call(this,c,a);case a instanceof olympe.dc.CloudObject:return this.format(W.no,this.H(a.X()));case a instanceof olympe.dc.ma:return this.format(W.Fq,a.ga());case a instanceof olympe.dc.Ia:return this.format(W.QUERY_RESULT,a.ga(this.H.bind(this)));case a instanceof olympe.dc.db.ec:return b=new olympe.dc.transaction.Ce,
|
|
801
|
+
a.qc(b),this.format(W.np,{i:a.T(),p:Bf(b)});case a instanceof olympe.dc.Request:return this.format(W.Eo,{r:a.getType(),o:a.origin,d:a.ic(),u:a.Cc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.aj:return this.format(W.Ze,{r:a.kh(),p:this.D(a.jc())});case a instanceof olympe.dc.query.zd:return this.format(W.Gq,a.ga());case a instanceof olympe.dc.Ag:return this.format(W.Do,a.ga());case a instanceof olympe.dc.uc:return this.format(W.Ui,this.H(a.X()));default:return super.D(a)}}j(a){if(null===
|
|
802
|
+
a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case W.Vo:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.ls().zb(d,a));return olympe.dc.CloudObject.get(d);case W.no:return olympe.dc.CloudObject.get(c);case W.Fq:return d=c.p.map(olympe.dc.query.na.um.j),a=c.e,new olympe.dc.ma(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Hd:a.s,Ne:a.rm});case W.QUERY_RESULT:return si(c);case W.np:return(new olympe.dc.transaction.Si).j(c.p,c.i);case W.Eo:return a=null!=(d=this.j(c.c))?d:void 0,
|
|
803
|
+
vf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case W.Ze:return d=this.j(c.p),new olympe.dc.transaction.aj(d,c.r);case W.Gq:return olympe.dc.query.zd.j(c);case W.Do:return olympe.dc.Ag.j(c);case W.Ui:return new olympe.dc.uc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ha(a))throw new olympe.dc.rq(a);const b={};this.db.Db(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of Yg(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.va.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
|
|
804
|
+
d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Le(a)||(c.v=!0);this.F.set(a,c);return a}};const Sj=olympe.dc.Request.j.Cg,Tj=olympe.dc.Request.j.Ze,Uj=olympe.dc.Request.j.Vg,Vj=olympe.dc.Request.j.si,Wj=olympe.dc.Request.j.Yn,Xj=olympe.dc.Request.j.Oq,Yj=olympe.dc.Request.j.Lg,Zj=olympe.dc.Request.j.pk,ak=olympe.dc.Request.j.mp,bk=olympe.dc.Request.j.Rt,ck=olympe.dc.Request.j.St,dk=olympe.dc.Request.j.Tt,ek=olympe.dc.Request.j.Yf,fk=olympe.dc.Request.j.$f,gk=olympe.dc.Request.j.hg,hk=olympe.dc.Request.j.Xj,ik=olympe.dc.Request.j.ow,jk=olympe.dc.Request.j.Ev,kk=olympe.dc.Request.j.hp,lk=
|
|
805
|
+
olympe.dc.Request.j.oh,mk=olympe.dc.Request.j.pt,nk=olympe.dc.Request.j.oc;function ok(a){return pk(a,olympe.dc.Request.j.Cg).then(b=>{b=b.getData().p;const c=Af(b,a.T());a.G.j()&&a.G.debug('< Get Context result',b);a.G.N()&&a.G.log('< Get Context result has',b.length,'operations');return c})}function qk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1}),d=b.jc(),e=b.j;d.qc(c);return rk(a,Tj,{i:d.T(),r:b.kh(),p:Bf(c),bd:e?!0:void 0}).then(f=>f.ct)}
|
|
806
|
+
function sk(a,b){const c=b.jc(),d=new olympe.dc.transaction.Ce({el:!0,he:!1,Wh:!1});c.qc(d);b=b.j?'bd=true':'';return pk(a,Uj,Bf(d),b,olympe.net.wa.ResponseType.ur).then(e=>{try{const f=e.getData();let g;return null!=(g=JSON.parse(f).ct)?g:Date.now()}catch(f){return Date.now()}}).finally(()=>{tk(a,hk,{id:c.T(),finalize:olympe.dc.transaction.Ff.j.Ni})})}
|
|
807
|
+
function uk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1}),d=b.jc();d.qc(c);return rk(a,Vj,{i:d.T(),r:b.kh(),p:Bf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function vk(a,b){const c=new olympe.dc.transaction.Ce({he:!1,Wh:!1});b=b.jc();b.qc(c);return rk(a,lk,{i:b.T(),p:Bf(c)}).then(d=>d.ct)}
|
|
808
|
+
function wk(a,b){const c=encodeURI(bb(olympe.V.ef(),JSON.stringify(xk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return pk(a,Yj,void 0,`query=${c}&v=${a.version}`,olympe.net.wa.ResponseType.ge).then(d=>yk(a,d))}function zk(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=xk(a,b);return qb(a.ua,()=>pk(a,ak,d,void 0,olympe.net.wa.ResponseType.ge)).then(e=>yk(a,e))}
|
|
809
|
+
function Ak(a,b){if(!Td(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=xk(a,olympe.dc.ma.from(b));b.f=olympe.dc.Lb.Io;b=N(aj(a.j,olympe.dc.Ja.SERVER,Wj),olympe.net.wa.Nd.Gh,JSON.stringify(b),olympe.net.wa.ResponseType.Oh);Ac(b,{[olympe.net.wa.Headers.wi]:olympe.net.wa.Al.JSON});return bj(a.j,b).then(c=>c.getData())}
|
|
810
|
+
function Bk(a,b,c,d){if(!Td(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=aj(a.j,olympe.dc.Ja.SERVER,Xj);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.wa.Nd.Gh,b);Ac(b,{[olympe.net.wa.Headers.wi]:olympe.net.wa.Al.zw});return bj(a.j,b).then(f=>f.getData())}
|
|
811
|
+
function rk(a,b,c,d=!0){const e=olympe.L.ze.zg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Wd(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Wd(a.F,e,f);return Promise.resolve()}
|
|
812
|
+
function xk(a,b){var c=Oh(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.na.Kd)Object.assign(b,{f:c[0].Pb,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Ea(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.j;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.na.we&&k.F){let q;null==(q=e.get(k.T()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.j))?g:[];Object.assign(b,{f:olympe.dc.Lb.NONE,q:c.map(a.da.bind(a,
|
|
813
|
+
e))})}return b}function tk(a,b,c){b=vf(new olympe.dc.Request(b,olympe.dc.Ja.SELF,c),a.T());let d;null==(d=a.Tb)||d.vd(b)}
|
|
814
|
+
function pk(a,b,c,d,e){const f=aj(a.j,a.T(),b);if('string'!==typeof f)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${f}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.wa.Nd.Gh:olympe.net.wa.Nd.GET,c&&JSON.stringify(c));Ac(b,{[olympe.net.wa.Headers.wi]:'application/json'});Cc(b,null!=e?e:olympe.net.wa.ResponseType.JSON);return bj(a.j,b)}
|
|
815
|
+
function yk(a,b){return w(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ga)?void 0:rb(e,d))?f:olympe.V.stream.jk.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Af(g,a.T(),null,c))}}))})}
|
|
816
|
+
function Ck(a,b,c){return w(function*(){const d=b.pi;let e;if(c instanceof olympe.V.stream.Df){e=new olympe.dc.db.ec(d);try{for(const f=fa(c);;){const g=yield f.next();if(g.done)break;a.$.j(g.value.p,d).qc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.ec(d)}}else e=a.$.j(b.p,d);return rf(e,b.ct)})}
|
|
817
|
+
olympe.dc.sources.lr=class extends olympe.dc.sources.yl{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.$=new olympe.dc.transaction.Si(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ga=g?new olympe.V.stream.yw:null;this.ua=new olympe.V.promise.rr(f);olympe.C.uj(this.D.Sf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.L.errors.Oi('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ja.SERVER}R(a){var b=a.getType();const c=a.content,d=xf(a);switch(b){case nk:return a=
|
|
818
|
+
olympe.dm.DataSource.oc.Ab,b=olympe.dm.DataSource.oc.Jh,Promise.resolve(Td(this.F)?{s:b}:{s:a,r:'Disconnected'});case Sj:return ok(this);case Tj:return qk(this,c);case Uj:return sk(this,c);case Vj:return uk(this,c);case lk:return vk(this,c);case Yj:return d.get(olympe.dc.ma.j.Gp)?wk(this,c):zk(this,c);case Wj:return Ak(this,c);case Xj:return Bk(this,c.VE,c.debug,c.optional);case ik:case jk:case kk:case mk:return rk(this,b,{});case fk:return this.j.downloadFileContent(a);case ek:return this.j.deleteFileContent(a);
|
|
819
|
+
case gk:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Y(a,b){if(a.getType()===Zj){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=xk(this,c);this.N.delete(d);this.H.set(d,e);rk(this,bk,f).catch(g=>e.error(g))})).pipe(nb(olympe.L.errors.Oi,(e,f)=>{this.G.debug(`Subscribe to topic ${e.T()} now that we are back online, after waiting for ${f}ms`);b()}),rxjs.operators.finalize(()=>{this.N.add(d);rk(this,ck,{i:d}).catch(e=>
|
|
820
|
+
{this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.H.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Rd(this.F,olympe.L.ze.zg,this.ha.bind(this));return this}destroy(){return w(function*(){})}ha(a,b){const c=olympe.dc.Request.j.$n,d=olympe.dc.Request.j.gm,e=a.c;if(e===olympe.dc.Request.j.Ao)Ck(this,a,b).then(f=>{tk(this,e,f)});else if(e===c)b=this.$.j(a.p,a.i),
|
|
821
|
+
b=rf(b,a.ct),tk(this,e,{rollback:b,error:a.error});else if(e===dk){const f=a.i;Ck(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&tk(this,hk,{id:a.i,finalize:olympe.dc.transaction.Ff.j.gm,error:0<a.s?a.error:null})}da(a,b){if(b instanceof olympe.dc.query.na.Kh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.Ka()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.da.bind(this,a))}}return{}}};olympe.dc.sources.lr.xa=[olympe.dc.sources.Tj];function Dk(a,b,c){const d=new olympe.C.Xb(`Source solver ${b.X()}`);b.fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.D).ie().back().fb(olympe.dm.wd.j).ie().observe(d,{jd:c,Ac:!0}).subscribe(e=>{e.nj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.sj().forEach(([f])=>{a.D.delete(f)})});b.fb(olympe.dm.ib.D).observe(d,{jd:c,Ac:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Gc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
|
|
821
822
|
olympe.dc.sources.Bk=class{constructor(a,b,c){this.db=a;this.j=b;this.N=c;this.D=new Map;this.F=null;this.H=!1}fromModel(a){a=olympe.dc.fa(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}Ke(a){let b;return null!=(b=this.db.source(a))?b:this.N}sb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ja.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ha(a)&&this.db.Ob(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
|
|
822
|
-
!0;var a=new olympe.dc.Wa;Y(a.create(olympe.dm.DataSource,this.j).ki(this.j),olympe.dm.DataSource.Vh,!0);a.Oa(olympe.dm.DataSource.zj,this.j,this.j);a.nb(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.ah()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',
|
|
823
|
-
olympe.dc.sources.U={xh:'data.httpHost',wf:'data.httpPort',Di:'data.httpSSL',
|
|
824
|
-
olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.U.
|
|
825
|
-
[olympe.dc.sources.zh.xh,olympe.dc.sources.U.wf],(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Ya(a,olympe.dc.sources.zh.Di,[olympe.dc.sources.zh.wf,olympe.dc.sources.U.Di],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.U.
|
|
826
|
-
olympe.dc.sources.P.Ge);D(a,olympe.dc.sources.P.
|
|
827
|
-
D(a,olympe.dc.sources.P.er,olympe.dc.sources.lr,olympe.dc.sources.P.Ca,olympe.L.P.vk,olympe.L.P.qf,olympe.dc.sources.P.
|
|
828
|
-
olympe.dc.P.Ng,olympe.dc.sources.P.
|
|
823
|
+
!0;var a=new olympe.dc.Wa;Y(a.create(olympe.dm.DataSource,this.j).ki(this.j),olympe.dm.DataSource.Vh,!0);a.Oa(olympe.dm.DataSource.zj,this.j,this.j);a.nb(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.ah()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',Sl:'dc.sources.HTTPService',hu:'dc.sources.IOService',Mq:'dc.sources.RemoteProvider',er:'dc.sources.ServerProvider',KB:'dc.sources.OfflineProvider',We:'dc.sources.SourceSolver',Ge:'dc.sources.Serializer',Bo:'dc.sources.cache.Cache',Co:'dc.sources.cache.DATABASE',vl:'dc.sources.cache.Logger'};
|
|
824
|
+
olympe.dc.sources.U={xh:'data.httpHost',wf:'data.httpPort',Di:'data.httpSSL',Ql:'data.httpBasePath',sm:'data.pollingFrequency',Qe:'data.communicationMode',ym:'data.restrictedUse',VERSION:'version.version',jr:'data.streamWorker',qq:'data.queryConcurrencyLimit'};olympe.dc.sources.zh={rv:'olympe.internal.data.',xh:'olympe.internal.data.httpHost',wf:'olympe.internal.data.httpPort',Di:'olympe.internal.data.httpSSL'};
|
|
825
|
+
olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.U.bm),d=`-${olympe.host.Pg.Hh}`;F(a,olympe.dc.sources.U.xh,null);F(a,olympe.dc.sources.U.wf,null);F(a,olympe.dc.sources.U.Di,null);F(a,olympe.dc.sources.U.Ql,'runtime/data');F(a,olympe.dc.sources.U.jr,!1);F(a,olympe.dc.sources.U.qq,10);Ya(a,olympe.dc.sources.zh.xh,[olympe.host.U.sk,olympe.L.U.El,olympe.dc.sources.U.xh],(e,f,g)=>{if(g)return g;e=e===olympe.host.Pg.Hh;return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.zh.wf,
|
|
826
|
+
[olympe.dc.sources.zh.xh,olympe.dc.sources.U.wf],(e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Ya(a,olympe.dc.sources.zh.Di,[olympe.dc.sources.zh.wf,olympe.dc.sources.U.Di],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.U.sm,null);F(a,olympe.dc.sources.U.Qe,null);F(a,olympe.dc.sources.U.ym,null);E(a,olympe.dc.sources.P.Ca,[olympe.ja.P.Da],e=>e.cd('data'));D(a,olympe.dc.sources.P.Ge,olympe.dc.sources.cc,olympe.dc.db.P.Da);Wa(a,olympe.L.P.Ge,
|
|
827
|
+
olympe.dc.sources.P.Ge);D(a,olympe.dc.sources.P.Sl,olympe.dc.sources.Wt,olympe.dc.sources.P.Ca,olympe.net.P.cj,olympe.L.P.Rl,olympe.auth.P.Da,olympe.dc.sources.P.We,olympe.L.P.Ge,new olympe.W.pa(olympe.L.U.ql));D(a,olympe.dc.sources.P.hu,olympe.dc.sources.Fp,olympe.dc.sources.P.Ca,olympe.dc.P.Ng,olympe.net.P.Da,olympe.auth.P.Da);D(a,olympe.dc.sources.P.Mq,olympe.dc.sources.Xq,olympe.dc.sources.P.Ca,new olympe.W.pa(olympe.dc.U.Qg),olympe.dc.sources.P.Sl,olympe.L.P.qf,olympe.dc.P.sh,olympe.dc.sources.P.We);
|
|
828
|
+
D(a,olympe.dc.sources.P.er,olympe.dc.sources.lr,olympe.dc.sources.P.Ca,olympe.L.P.vk,olympe.L.P.qf,olympe.dc.sources.P.Sl,new olympe.W.pa(olympe.dc.sources.U.VERSION),new olympe.W.pa(olympe.dc.sources.U.qq),new olympe.W.pa(olympe.dc.sources.U.jr));D(a,olympe.dc.sources.P.We,olympe.dc.sources.Bk,olympe.dc.P.sh,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.Gl));E(a,olympe.dc.sources.P.vl,[olympe.ja.P.Da],e=>e.cd('datacache'));D(a,olympe.dc.sources.P.Bo,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.vl,
|
|
829
|
+
olympe.dc.P.Ng,olympe.dc.sources.P.Co,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.L.P.qf,olympe.Eb.P.cm,olympe.V.P.vg,new olympe.W.pa(olympe.net.U.nq),new olympe.W.pa(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.P.Co,olympe.dc.sources.cache.hk,olympe.Eb.P.Sg,olympe.dc.sources.P.vl,olympe.Eb.P.bk)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.P.We,olympe.dc.sources.P.Bo],(a,b)=>{olympe.dc.ae=()=>a;olympe.dc.sources.Zd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.Em=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.yt=class extends olympe.dc.sources.cache.errors.Em{};olympe.dc.sources.cache.errors.lw=class extends olympe.dc.sources.cache.errors.Em{};olympe.dc.sources.cache.errors.vw=class extends olympe.dc.sources.cache.errors.Em{};function Ek(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.C.Color.Qb(a);case 17:return new olympe.dc.uc(a.v);case 13:return(new olympe.dc.transaction.Si).j(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
|
|
829
830
|
olympe.dc.sources.cache.wp=class{ga(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.C.eb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.C.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.uc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.ec:const b=new olympe.dc.transaction.Ce;a.qc(b);
|
|
830
|
-
return{t:13,i:a.T(),v:Bf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function
|
|
831
|
-
function
|
|
832
|
-
a.$c.next(f)}finally{b&&
|
|
833
|
-
function
|
|
834
|
-
function
|
|
835
|
-
'application/octet-stream';f={tag:h,model:g.Wb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.$f,c,f);f=qb(a.Id,()=>a.Tb.request(n).then(p=>
|
|
836
|
-
function
|
|
837
|
-
function
|
|
838
|
-
function
|
|
839
|
-
function
|
|
831
|
+
return{t:13,i:a.T(),v:Bf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function xj(a,b,c){return w(function*(){Fk(a,'queries',b);yield a.init();const d=a.D.has(c)?a.D.get(c):new Set;d.has(b)||(d.add(b),a.D.set(c,d),a.N.next(Gk(a)));return Hk(a.j,b,c)})}function yj(a,b){return w(function*(){yield a.init();a.G.debug(`Cache: subtract pending transaction operations from ${b.T()}`);b.R(a.F)})}
|
|
832
|
+
function zj(a,b,c,d,e=!1){(()=>w(function*(){a.G.debug(`Cache: handle query ${b} graph patch: ${d.T()}`);try{const f=null===b?[]:Array.from(a.D.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.$)a.G.debug('Cache: persist graph patch',d.T()),e&&b&&(Array.from(d.Rc()).filter(h=>!h.td()).map(h=>h.tag()),yield Ik(a.j)),yield Jk(a.j,d,0<f.length?b:null),Kk(a,d,c).catch(h=>{a.G.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.G.error(`Cache: Failed to handle graph patch ${d.T()} with message: ${f}`),
|
|
833
|
+
a.$c.next(f)}finally{b&&Lk(a,'queries',b)}}))().then(()=>{})}function Aj(a,b,c,d,e=!1){return w(function*(){yield yj(a,d);zj(a,b,c,d,e)})}function Mk(){var a=olympe.dc.sources.Zd();a.$=!0;a.zb=!0}function Fk(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
|
|
834
|
+
function Lk(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function Nk(a){return w(function*(){a.F=new olympe.dc.db.ec;const b=yield Ok(a.j);for(const c of b)c.qc(a.F);a.da.next(0<b.length)})}
|
|
835
|
+
function Kk(a,b,c){return w(function*(){const d=Pk(b),e=[];for(const g of d){const h=g.tag();if(!(yield Qk(a.j,h)))if(Fk(a,'files',h),!1===g.Qa(olympe.dm.File.j.X())&&g.Qa(olympe.dm.File.urlProp.X())){var f=g.Qa(olympe.dm.File.urlProp.X());f=N(f);Cc(f,olympe.net.wa.ResponseType.pl);e.push(Dc(a.Bd,f).then(k=>{k=k.Hc();if(200>k||300<=k)throw Error(`Failed to download file ${g}. Response code ${k}`);}).finally(()=>Lk(a,'files',h)))}else{let k;const l=null!=(k=g.Qa(olympe.dm.File.mimeTypeProp.X()))?k:
|
|
836
|
+
'application/octet-stream';f={tag:h,model:g.Wb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.j.$f,c,f);f=qb(a.Id,()=>a.Tb.request(n).then(p=>Rk(a.j,h,p,l))).finally(()=>Lk(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.G.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
|
|
837
|
+
function Pk(a){const b=[olympe.dc.fa(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.ma.from(olympe.dm.File).mg(olympe.dc.CloudObject.extendedByRel).Fc().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Qc(c))?void 0:d.bb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Qc(d))?void 0:e.bb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Qc(g));return c.concat(d)},[])}
|
|
838
|
+
function Sk(a,b){return Array.from(a.D.values()).some(c=>c.has(b))}function Gk(a){return Array.from(a.D.keys()).filter(b=>'__code-as-data__'!==b)}function Tk(a,b){return w(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.D.get(b))?c:[]);a.D.delete(b);var e=Array.from(a.D.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield Uk(a.j,b);a.N.next(Gk(a));d.filter(f=>!e.has(f));yield Ik(a.j)}else yield Promise.all(Gk(a).map(f=>Tk(a,f)))})}
|
|
839
|
+
function Vk(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].R(a[b])}
|
|
840
|
+
function Wk(a,b,c){return w(function*(){var d=olympe.dc.Request.j.Ze;const e=olympe.dc.Request.j.Yf,f=olympe.dc.Request.j.hg;a.G.debug('Sync Cache: Applying transaction patch to destination',c,b.T());const g=Pk(b);a.G.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>w(function*(){const k=h.tag();var l=h.Wb();if(h.td())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Xk(a.j,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.j})}if(!id(a.jb))throw Error('Lost connection, stop syncing');
|
|
840
841
|
l=yield a.Tb.request(l);b.Wc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.aj(b,!1));if(!id(a.jb))throw Error('Lost connection, stop syncing');yield a.Tb.request(d)})}
|
|
841
|
-
function
|
|
842
|
+
function Yk(a,b,c){return c instanceof olympe.L.errors.Dk||c instanceof olympe.L.errors.vo?(a.G.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.yt('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.L.errors.Wq?(a.G.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.lw('The transaction has been rejected by the datasource',
|
|
842
843
|
c.message)):new olympe.dc.sources.cache.errors.vw('Synchronisation error',c.message)}
|
|
843
|
-
function
|
|
844
|
-
h,f),yield
|
|
845
|
-
function
|
|
846
|
-
function
|
|
847
|
-
function
|
|
844
|
+
function Zk(){var a=olympe.dc.sources.Zd();if(a.R)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.R=!0;a.G.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>w(function*(){yield a.init();const c=yield $k(a.j);let d=0;const e=Array.from(c.values()).reduce((f,g)=>f+g.length,0);0<e&&b.next([e,d]);for(const [f,g]of c){Vk(g);for(const h of g){a.G.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.T()})`);try{yield Wk(a,
|
|
845
|
+
h,f),yield al(a.j,h)}catch(k){throw Yk(a,f,k);}d+=1;b.next([e,d])}}a.H=null}))().then(()=>{a.R=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{Nk(a).finally(()=>{a.R=!1})});return b.asObservable()}
|
|
846
|
+
function bl(){const a=olympe.dc.sources.Zd();return w(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=Pk(a.F);for(const e of d)b.has(e.tag())||(d=yield Xk(a.j,e.tag()),c.files.push({t:e.tag(),m:d.j,c:a.ua.j(d.content)}),b.add(e.tag()));b=yield cl(a.j);c.patches.push(...b);return JSON.stringify(c)})}
|
|
847
|
+
function dl(a){const b=olympe.dc.sources.Zd();return w(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.ua.D(e.c),yield Rk(b.j,e.t,d,e.m);yield el(b.j,c.patches);yield Nk(b);b.Ga.Tc(rf(b.F))})}
|
|
848
|
+
function fl(){const a=olympe.dc.sources.Zd();return w(function*(){yield gl(a.j);yield Nk(a)})}
|
|
848
849
|
olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Tb=b;this.j=c;this.Ga=d;this.Bd=e;this.jb=f;this.$a=g;this.ua=h;this.version=l;this.$=this.version!==this.$a.get('__code-as-data-version__');this.Mb=this.zb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.da=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.ec;this.vc=this.zc=!1;this.ha=[];this.Y=0;this.Rd=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
|
|
849
|
-
!1;this.$c=new rxjs.Subject;this.Id=new olympe.V.promise.rr(k)}Hc(){return this.status.asObservable()}init(){const a=this;return w(function*(){if(!a.zc)if(a.vc)yield new Promise(b=>{a.ha.push(b)});else{a.vc=!0;(yield
|
|
850
|
-
b.j.executeQuery(a).then(olympe.V.stream.ds)})}applyTransaction(a,b){const c=this;return w(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.jc(),e=Array.from(d.Bb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Bb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield
|
|
851
|
-
b,c){const d=this;return w(function*(){yield d.init();yield
|
|
852
|
-
function
|
|
853
|
-
function
|
|
854
|
-
function
|
|
855
|
-
function
|
|
856
|
-
function
|
|
857
|
-
a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.jc().Bb.size,'instances',Array.from(d.jc().Ed()).length,'relations');return d})}function
|
|
858
|
-
function
|
|
859
|
-
olympe.dc.sources.cache.hk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.wp;this.db=c.D(this.H);this.D=new Set;this.j=[];this.files=null;this.db.R('files').then(d=>{this.files=new Set(d);this.j.forEach(e=>e(null))}).catch(d=>{this.j.forEach(e=>e(d))});this.F=olympe.V.Promise.jj(()=>{const d=this;return w(function*(){if(!(0===d.D.size||0<(yield
|
|
850
|
+
!1;this.$c=new rxjs.Subject;this.Id=new olympe.V.promise.rr(k)}Hc(){return this.status.asObservable()}init(){const a=this;return w(function*(){if(!a.zc)if(a.vc)yield new Promise(b=>{a.ha.push(b)});else{a.vc=!0;(yield hl(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(Gk(a));yield Nk(a);a.Ga.Tc(rf(a.F));for(const b of a.ha)b();a.zc=!0;a.ha=[]}})}executeQuery(a){const b=this;return w(function*(){yield b.init();return Sk(b,a.T())&&Oh(a).some(c=>c instanceof olympe.dc.query.na.Kd)?il(b.j,a).then(olympe.V.stream.ds):
|
|
851
|
+
b.j.executeQuery(a).then(olympe.V.stream.ds)})}applyTransaction(a,b){const c=this;return w(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.jc(),e=Array.from(d.Bb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Bb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield jl(c.j,d,b),c.H=new olympe.dc.sources.cache.wt(d,b),c.da.next(!0)):(d.qc(c.H.j),yield jl(c.j,c.H.j,b));d.qc(c.F);yield Jk(c.j,d,'local-transaction')})}uploadFileContent(a,
|
|
852
|
+
b,c){const d=this;return w(function*(){yield d.init();yield Rk(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return w(function*(){yield b.init();return Xk(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return w(function*(){yield b.init();yield kl(b.j,[a])})}};olympe.dc.sources.cache.wt=class{constructor(a,b){this.j=a;this.D=b}};olympe.dc.sources.cache.Cache.D='__code-as-data-version__';olympe.dc.sources.cache.Cache.j='__code-as-data__';function hl(a){return w(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.sq.Qb(b))})}function Ok(a){return w(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Fh.Qb(b);return Ek(b.j)})})}function Hk(a,b,c){return w(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function Ik(a){return w(function*(){return a.db.D()})}
|
|
853
|
+
function Jk(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Bb.keys());return a.db.D().then(()=>{null===c&&(b.Bb.forEach((d,e)=>a.D.add(e)),a.F().then(()=>{}))})}function Qk(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.j.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
|
|
854
|
+
function Rk(a,b,c,d){c=new olympe.dc.sources.cache.pm(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Uk(a,b){return w(function*(){return a.db.remove('buckets',b).then(()=>{})})}function $k(a){return w(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Fh.Qb(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(Ek(c.j));b.set(d,f);return b},new Map)})}
|
|
855
|
+
function al(a,b){return w(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function Xk(a,b){return w(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.pm.Qb(c)})}function cl(a){return w(function*(){return a.db.F('pending-transactions')})}
|
|
856
|
+
function el(a,b){return w(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Fh.Qb(d);e&&c.set(e.j.i,d)}yield a.db.da()})}function gl(a){return w(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
|
|
857
|
+
function il(a,b){return w(function*(){const c=b.sb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.zd.mj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Ig.Qb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.hk.ac(f);const g=ll(f.Gd);d.create(f.tag,e,g);for(const h of f.ob)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.fc.Yc&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
|
|
858
|
+
a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.jc().Bb.size,'instances',Array.from(d.jc().Ed()).length,'relations');return d})}function jl(a,b,c){b=a.N.ga(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Fh(c,b,Date.now())).toJSON())}function ml(a){return w(function*(){return a.db.N('pending-transactions')})}function kl(a,b){return w(function*(){b.forEach(c=>a.files.delete(c));yield a.db.$()})}
|
|
859
|
+
function ll(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,Ek(d)),new Map)}
|
|
860
|
+
olympe.dc.sources.cache.hk=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.wp;this.db=c.D(this.H);this.D=new Set;this.j=[];this.files=null;this.db.R('files').then(d=>{this.files=new Set(d);this.j.forEach(e=>e(null))}).catch(d=>{this.j.forEach(e=>e(d))});this.F=olympe.V.Promise.jj(()=>{const d=this;return w(function*(){if(!(0===d.D.size||0<(yield ml(d))))if(0<d.db.Y())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
|
|
860
861
|
else{d.G.debug(`Offline DB GC: Round with ${d.D.size} candidates`);var e=Date.now();yield d.db.D().then(()=>{});d.G.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static ac(a){const b=new RegExp(`^(${olympe.dc.fc.Yc})>([a-z0-9]*)$`);for(const c of a.ob)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return w(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.sb()}`);const d=olympe.dc.query.zd.mj(a),e=a.sb();var f=
|
|
861
|
-
yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Ig.Qb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.hk.ac(g),
|
|
862
|
-
Promise.resolve([]);r.X();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Ig.Qb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.
|
|
863
|
-
olympe.dc.query.
|
|
862
|
+
yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Ig.Qb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.hk.ac(g),ll(g.Gd));for(const p of Oh(a))if(p instanceof olympe.dc.query.na.Kh){var k=p.relation;g=k.Ka()===olympe.dc.va.ORIGIN;const q=k.X(),r=k.$b();k=new Set;f.set(p.T(),k);const t=[f.has(p.j)?new Set(f.get(p.j)):new Set([a.D])];for(const u of t){const x=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
|
|
863
|
+
Promise.resolve([]);r.X();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Ig.Qb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.na.we&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.na.we&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.hk.ac(A),d.create(l,n,ll(A.Gd)));q===olympe.dc.fc.Yc&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
|
|
864
|
+
olympe.dc.query.na.Kd&&b.G.warn(`Offline DB: Trying to execute a query ${a.T()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.G.j()&&(b.G.debug(`Offline DB: Data result for query ${a.T()}`,d.jc().Bb.size,'instances',Array.from(d.jc().Ed()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
|
|
864
865
|
olympe.dc.sources.cache.sq=class{constructor(a,b){this.name=a;this.j=b}static Qb(a){return a?new olympe.dc.sources.cache.sq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
|
|
865
866
|
olympe.dc.sources.cache.Ig=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Gd=null!=c?c:{};this.ob=null!=d?d:[];this.j=null!=e?e:[]}static Qb(a){return a?new olympe.dc.sources.cache.Ig(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Gd,relations:this.ob,queryIds:this.j}}};
|
|
866
867
|
olympe.dc.sources.cache.Fh=class{constructor(a,b,c){this.D=a;this.j=b;this.timestamp=c}static Qb(a){return a?new olympe.dc.sources.cache.Fh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp}}};
|
|
867
868
|
olympe.dc.sources.cache.mv=class extends olympe.dc.sources.cache.Fh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Qb(a){return a?new olympe.dc.sources.cache.mv(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
|
|
868
|
-
olympe.dc.sources.cache.
|
|
869
|
+
olympe.dc.sources.cache.pm=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Qb(a){return a?new olympe.dc.sources.cache.pm(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function nl(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).ob),a.N.set(b,c));return c}
|
|
869
870
|
olympe.dc.sources.cache.$t=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.Y=new Set;this.H=new olympe.dc.sources.cache.wp;this.N=new Map}Rc(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Oc(a,b,c){const d=this.j.get(a);d||this.Y.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.H.ga(k[1]);return h},null!=(e=null==d?void 0:d.Gd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
|
|
870
871
|
this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Ig(a,b,c,null!=(g=null==d?void 0:d.ob)?g:[],e);this.j.set(a,b)}Wc(a,b){const c=this.j.get(a);if(c){var d;c.Gd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.H.ga(g);return e},null!=(d=c.Gd)?d:{})}else this.G.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}D(a){this.R.add(a)}Oa(a,b,c){var d;const e=null!=(d=this.j.get(b))?d:new olympe.dc.sources.cache.Ig(b,
|
|
871
|
-
'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Ig(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=
|
|
872
|
-
f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.$t.xa=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ti=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Ic();this.D=new olympe.C.Xb('BurstTransaction#'+this.id,c);this.zb=
|
|
872
|
+
'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Ig(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=nl(this,g.tag);k.has(h)||(g.ob.push(h),k.add(h));null===this.F||g.j.includes(this.F)||g.j.push(this.F)};f(e,`${a}${olympe.dc.va.DESTINATION}${c}`);f(d,b)}hc(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.va.DESTINATION}${c}`;a=`${a}${olympe.dc.va.ORIGIN}${b}`;b=(f,g)=>{const h=nl(this,f.tag);if(h.has(g)){const k=
|
|
873
|
+
f.ob.indexOf(g);f.ob.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.$t.xa=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ti=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Ic();this.D=new olympe.C.Xb('BurstTransaction#'+this.id,c);this.zb=ol(this);this.R=!1;this.D.onDestroy(()=>this.N());this.Y=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.$a=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.Zn))?d:30;this.ha=[]}static j(b,c){return`${b},${c}`}Mb(b){for(const c of this.ha)c(b);this.stop()}Ga(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.da(this.H);0<b.size&&pl(this,
|
|
873
874
|
b,!1);this.H.clear()}da(b){const c=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.F.get(d))});return c}$(b,c,d){this.ua(b,c,d);this.zb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ga.bind(this),this.$a))}ua(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}jb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.fa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.fa(f),this.jb(d,e)!==g&&this.$(d,e,g.valueOf())});this.Y.add(b)}complete(){return new Promise((b,
|
|
874
|
-
c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.fa(b),f=olympe.dc.fa(c);void 0===e||void 0===f?olympe.ja.ab('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.
|
|
875
|
-
this.ha.length=0}getContext(){return this.D}T(){return this.id}kh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.da(new Set(this.F.keys()));
|
|
875
|
+
c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.fa(b),f=olympe.dc.fa(c);void 0===e||void 0===f?olympe.ja.ab('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.wn([d],g=>{this.R=!0;if(g instanceof olympe.dc.uc)olympe.ja.ab('dc').error('Cannot send complex property values in burst transactions');else{var h;this.$(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.D.Td(()=>{this.N()}))}stop(){this.D.destroy();
|
|
876
|
+
this.ha.length=0}getContext(){return this.D}T(){return this.id}kh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.da(new Set(this.F.keys()));pl(this,c,!0,b)}else null==b||b(!0)}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.Lc=class{j(){}toString(){}};olympe.dc.Lc.j=1;olympe.dc.Lc.D=2;olympe.dc.Lc.H=3;olympe.dc.Lc.F=4;olympe.dc.Lc.N=5;olympe.dc.transaction.Si=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ja.SERVER}static j(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.de.Se+b.substring(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':case 'boolean':case 'number':c.set(b,e);break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,
|
|
876
877
|
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&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.uc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.ec(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Lc.j:b=a.j(d.p||{});let e;c.Oc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Lc.D:c.Wc(d.t,
|
|
877
|
-
a.j(d.p),d.m);break;case olympe.dc.Lc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Lc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Lc.N:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function
|
|
878
|
-
function
|
|
879
|
-
olympe.dc.transaction.wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Ic();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.ec(this.id);this.sources=new Map;this.F=new Map}jf(){return 0===this.j.Bb.size}Oc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.H.fromModel(b);c=Z(this,a);this.sources.set(a,f);
|
|
880
|
-
|
|
881
|
-
Z(this,c)&&d!==olympe.dc.Ja.SELF&&e!==olympe.dc.Ja.SELF;f&&d!==e&&a!==olympe.dc.fc.Yc&&(olympe.ja.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);
|
|
882
|
-
class
|
|
878
|
+
a.j(d.p),d.m);break;case olympe.dc.Lc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Lc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Lc.N:c.hc(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function ql(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.Ke(b)}function rl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Qc(b))?void 0:c.Wb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Le(b)||!a.db.Ha(b)}function sl(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function tl(a){return Array.from(a.j.Rc()).filter(b=>!b.td()).map(b=>b.tag())}function ul(a){return Array.from(a.j.Rc()).filter(b=>b.td()).map(b=>b.tag())}
|
|
879
|
+
function vl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ja.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.ec(a.id),a.D.set(b,c)),d(c))}function wl(a,b,c){const d=ql(a,b),e=Z(a,b),f=rl(a,b);vl(a,d,e,g=>{g.D(b,c,f)})}
|
|
880
|
+
olympe.dc.transaction.wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Ic();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.ec(this.id);this.sources=new Map;this.F=new Map}jf(){return 0===this.j.Bb.size}Oc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.H.fromModel(b);c=Z(this,a);this.sources.set(a,f);vl(this,f,c,g=>{g.Oc(a,f,d,b)})}Wc(a,b){const c=ql(this,a),d=Z(this,a),e=rl(this,a);vl(this,c,d,f=>{f.Wc(a,null!=b?b:new Map,e)})}Oa(a,b,c){const d=ql(this,b),e=
|
|
881
|
+
ql(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ja.SELF&&e!==olympe.dc.Ja.SELF;f&&d!==e&&a!==olympe.dc.fc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ja.ab('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);vl(this,d,f,g=>{g.Oa(a,b,c,rl(this,b),rl(this,c))})}hc(a,b,c){const d=ql(this,b),e=ql(this,c);let f=Z(this,b)&&
|
|
882
|
+
Z(this,c)&&d!==olympe.dc.Ja.SELF&&e!==olympe.dc.Ja.SELF;f&&d!==e&&a!==olympe.dc.fc.Yc&&(olympe.ja.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);vl(this,d,f,g=>{g.hc(a,b,c,rl(this,b),rl(this,c))})}};function xl(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.Jp.ir)if(e===olympe.dc.Ja.SELF)d[g]=olympe.dc.ia().T();else{if(e===olympe.dc.Ja.SERVER)continue}else g.startsWith(olympe.dc.de.Se)&&(g='fd'+g.substring(1));e=a.R(e);c&&e instanceof Object&&8===e.c?a.N.set(g,e):d[g]=e}return d}function yl(a){if(0===a.N.size)return null;const b=Object.create(null);a.N.forEach((c,d)=>{b[d]=c});a.N.clear();return b}
|
|
883
|
+
class zl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.ea||a instanceof olympe.C.aa?a.valueOf():a instanceof Date||a instanceof olympe.C.eb?(a=a instanceof olympe.C.eb?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.C.Color?{c:7,r:a.fh().valueOf(),g:a.bh().valueOf(),b:a.Zg().valueOf(),a:a.Yg().valueOf()}:a&&'function'===
|
|
883
884
|
typeof a.X?{c:8,t:a.X()}:a}}function Bf(a){const b=a.H.concat(a.F).concat(a.N).concat(a.j).concat(a.R);a.N=[];a.F=[];a.j=[];a.R=[];a.H=[];return b}
|
|
884
|
-
olympe.dc.transaction.Ce=class{constructor({el:a=!1,Wh:b=!0,he:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.el=null!=a?a:!1;this.he=null!=c?c:!0;this.Wh=null!=b?b:!0;this.Y=olympe.C?new
|
|
885
|
-
t:a,p:b})}Wc(a,b,c=null){b=
|
|
886
|
-
e&&(a.rm=e);this.R.push(a)}hc(a,b,c,d=null,e=null){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');a={o:olympe.dc.Lc.N,m:a,l:b,r:c};this.he&&d&&(a.lm=d);this.he&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.Ce.xa=[olympe.dc.Writable];function
|
|
887
|
-
function
|
|
888
|
-
function
|
|
889
|
-
olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.V.Ic();this.Fa=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.H=this.N=!1;this.R=[...olympe.dc.tj().$]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.fa(a)))?b:olympe.dc.ia().model(a)}j(a){
|
|
890
|
-
olympe.dc.fa(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.Y);return b}persist(a,b=!0){const c=olympe.dc.fa(a);var d=olympe.dc.ia();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.ae().fromModel(b);
|
|
891
|
-
if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Dc){
|
|
885
|
+
olympe.dc.transaction.Ce=class{constructor({el:a=!1,Wh:b=!0,he:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.el=null!=a?a:!1;this.he=null!=c?c:!0;this.Wh=null!=b?b:!0;this.Y=olympe.C?new zl:new class extends zl{R(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(Bf(this))}Oc(a,b,c,d=null){c=xl(this.Y,null!=c?c:null,this.el);c={o:olympe.dc.Lc.j,t:a,p:c};this.Wh&&(c.s=b);this.he&&d&&(c.m=d);this.N.push(c);this.el&&(b=yl(this.Y))&&this.j.push({o:olympe.dc.Lc.D,
|
|
886
|
+
t:a,p:b})}Wc(a,b,c=null){b=xl(this.Y,b||null,!1);a={o:olympe.dc.Lc.D,t:a,p:b};this.he&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Lc.H,t:a,f:b};this.he&&c&&(a.m=c);this.F.push(a)}Oa(a,b,c,d=null,e=null){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`);a={o:olympe.dc.Lc.F,m:a,l:b,r:c};this.he&&d&&(a.lm=d);this.he&&
|
|
887
|
+
e&&(a.rm=e);this.R.push(a)}hc(a,b,c,d=null,e=null){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');a={o:olympe.dc.Lc.N,m:a,l:b,r:c};this.he&&d&&(a.lm=d);this.he&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.Ce.xa=[olympe.dc.Writable];function Al(a){var b=new olympe.dc.Wa;b.Y=a;return b}function Bl(a,b){b instanceof olympe.dc.Wa&&b.D.forEach((c,d)=>a.D.set(d,c));a.Fa.push(b);return b}
|
|
888
|
+
function Cl(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Y(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Y(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();Bl(a,new olympe.dc.transaction.Fa.Ko(e,b));Bl(a,new olympe.dc.transaction.Fa.Bl(e,b,d));return c}
|
|
889
|
+
function Dl(a,b){if(a.H)throw Error('Operation not permitted: this transaction has already been executed');a.H=!0;const c=[d=>{a.H=d},...a.$,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
|
|
890
|
+
olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.V.Ic();this.Fa=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.H=this.N=!1;this.R=[...olympe.dc.tj().$]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.fa(a)))?b:olympe.dc.ia().model(a)}j(a){sl(a,this.D);for(const b of this.Fa)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=Bl(this,new olympe.dc.transaction.Fa.yo(a,b));const c=b.X();this.F.set(c,
|
|
891
|
+
olympe.dc.fa(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.Y);return b}persist(a,b=!0){const c=olympe.dc.fa(a);var d=olympe.dc.ia();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.ae().fromModel(b);Bl(this,new olympe.dc.transaction.Fa.xv(c,d))}else{if((e=d.Ha(c))&&d.Le(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
|
|
892
|
+
if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Lb.Dc){Bl(this,new olympe.dc.transaction.Fa.Lo(a,b))}update(a,b,c){return Bl(this,new olympe.dc.transaction.Fa.xw(a,b,c))}Oa(a,b,c){Bl(this,new olympe.dc.transaction.Fa.Bl(a,b,c))}hc(a,b,c){Bl(this,new olympe.dc.transaction.Fa.It(a,b,c))}$m(a,b){Bl(this,new olympe.dc.transaction.Fa.Ko(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
|
|
892
893
|
f);Y(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.de.Se+d.X(),e);this.Oa(olympe.dc.CloudObject.propertyRel,a,d);this.Oa(olympe.dm.Property.typeRel,d,b);this.Oa(olympe.dc.CloudObject.containsRel,a,d);return d}Xr(a,b,c='',{eE:d=olympe.dm.Relation.H.hv,qE:e=olympe.dm.Relation.j.Fv,lE:f=olympe.dm.Relation.j.ft,OE:g=olympe.dm.Relation.j.yp,bE:h=olympe.dm.ll.NONE,NE:k=olympe.dm.Relation.N|h}={},l=olympe.V.Ic()){c=Y(Y(Y(Y(Y(Y(Y(Y(Y(Y(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
|
|
893
|
-
c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.da,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.ha,g),olympe.dm.Relation.Ga,olympe.dm.Relation.j.yp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.yj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}kh(){return!1}
|
|
894
|
-
|
|
895
|
-
function
|
|
896
|
-
function
|
|
897
|
-
function
|
|
898
|
-
function
|
|
899
|
-
f.j,g),n=olympe.C.Xa().rc((q,r)=>c(null!==q,r)),p=[l,n];
|
|
900
|
-
function
|
|
901
|
-
r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ha(u,q,y,z=>{const A=h.reduce((K,X)=>K||X.Qc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.
|
|
902
|
-
new olympe.dc.db.ec);return ug(a.j,n)})}function
|
|
903
|
-
function
|
|
904
|
-
function
|
|
905
|
-
olympe.dc.transaction.Ff=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Tb=c;this.ha=d;this.N=e;this.da=f;this.R=g.get('notificationTimeout');this.$=[];let h;this.ua=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.V.Nh(g.get('burstHoldTime'));this.F=new Map;this.Y=[];this.D=new Map;this.Ga=new olympe.V.promise.
|
|
906
|
-
b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Ff.j={
|
|
907
|
-
olympe.W.config(function(a){F(a,olympe.dc.transaction.U.bq,9E4);F(a,olympe.dc.transaction.U.
|
|
908
|
-
olympe.dc.transaction.P.Ca,olympe.dc.db.P.Da,olympe.dc.P.Ng,olympe.dc.sources.P.We,olympe.dc.P.Vj,olympe.auth.P.Da,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Fa={};function
|
|
909
|
-
olympe.dc.transaction.Fa.
|
|
910
|
-
if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ka()===olympe.dc.va.DESTINATION?a.Oa(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.D)):a.Oa(b,olympe.dc.fa(this.D),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.Ka()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.D)})`}};olympe.dc.transaction.Fa.vA=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Pb=b}j(a){for(const b of this.ia.Rc(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.Fa.
|
|
911
|
-
a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ka()}${this.getType()})`}};olympe.dc.transaction.Fa.
|
|
912
|
-
this.relation.Ka()===olympe.dc.va.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ka()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.D)+')'}};olympe.dc.transaction.Fa.xw=class extends olympe.dc.transaction.Fa.ug{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Gd=new Map;void 0!==b&&this.Gd.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Qc(b))&&c.D()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=
|
|
913
|
-
for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.uc&&
|
|
914
|
-
k)&&(h===olympe.dc.va.ORIGIN?b.Oa(g,k,this.tag):b.Oa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.fa=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Xg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.
|
|
915
|
-
olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Xr=function(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.va.DESTINATION){const e=olympe.dc.va.DESTINATION;return b===olympe.dc.va.ORIGIN||b===e?new olympe.dc.Ra.Relation(a,b):new olympe.dc.Ra.Relation(a,d,b,c)};olympe.dc.gx=function(a){return a.$b()};olympe.dc.mb={};olympe.dc.mb.
|
|
916
|
-
olympe.dc.mb.
|
|
894
|
+
c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.da,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.ha,g),olympe.dm.Relation.Ga,olympe.dm.Relation.j.yp),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.yj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}kh(){return!1}Sm(a){this.$.push(olympe.C.Xa().rc(a))}nb(a,b){El(olympe.dc.tj(),this,Dl(this,a),b)}an(a){a=
|
|
895
|
+
Dl(this,a);Fl(olympe.dc.tj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Wa.xa=[olympe.dc.Lc];function ol(a){var b=olympe.dc.tj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.ec(c);g.Wc(d,(new Map).set(e,f),b.db.model(d));b.j.Tc(rf(g,Infinity))}}
|
|
896
|
+
function pl(a,b,c,d){var e=olympe.dc.tj();const f=olympe.dc.Request.j.si,g=olympe.dc.Request.j.oh,h=a.T();a=a.kh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ja.SELF||!e.db.Le(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.ec(h),k.set(n,p));p.Wc(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.aj(n,a)),b=e.Tb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.Tc(rf(n,p));null==d||d(!0)})}
|
|
897
|
+
function El(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);Fl(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else Fl(a,b,c,!1)}function Gl(a){const b=olympe.dc.Request.j.Xj;zf(a.Tb,olympe.dc.Request.j.$n,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.H.get(e);void 0!==f&&(a.H.delete(e),f.Mb(d));a.j.Tc(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});zf(a.Tb,b,c=>{c=c.content;Hl(a,c.id,c.finalize,c.error)})}
|
|
898
|
+
function Il(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.ua.has(c)||a.$.push(b);return a}
|
|
899
|
+
function Fl(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.wv(a.db,a.ha,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.kq){q.j.then(()=>Fl(a,b,c,d));return}c(!1,q.message);return}if(f.jf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=tl(f);a.j.je(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Z(f,q));var k=ul(f).filter(q=>a.db.Le(q)&&a.db.Ob(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ja.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=ug(a.j,
|
|
900
|
+
f.j,g),n=olympe.C.Xa().rc((q,r)=>c(null!==q,r)),p=[l,n];Jl(a,f,g).then(q=>{p.splice(1,0,q);Kl(a,e,h,f.D.size+1);return Ll(a,f.D,d,b.kh(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,u])=>a.N.ua(r,t,u))).then(r=>{r.forEach(t=>{'rejected'===t.status&&a.G.warn('Some binary files have not been deleted after the transaction:',t.reason)});return q})).then(q=>{p.forEach(r=>r(q));Hl(a,e,olympe.dc.transaction.Ff.j.Ni)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));Ml(a,e)})}}
|
|
901
|
+
function Jl(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Ob(n,olympe.dm.File)&&void 0!==(null==(p=d.Qc(n))?void 0:p.Qa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.D.values()),k=[],l=olympe.V.ef();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.F(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
|
|
902
|
+
r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ha(u,q,y,z=>{const A=h.reduce((K,X)=>K||X.Qc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Rm(z),k.push([u,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.G.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:',n.X());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Wc(q,r);return p},
|
|
903
|
+
new olympe.dc.db.ec);return ug(a.j,n)})}function Kl(a,b,c,d){const e=olympe.C.ah(),f=new olympe.async.mk(e);0<a.R&&f.Jn(a.R);const g=olympe.dc.transaction.Ff.j.dv;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.rc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});bd(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.detach(c,olympe.dc.db.Instance.j.TRANSACTION);Ml(a,b)});f.start()}
|
|
904
|
+
function Ll(a,b,c,d,e){if(c&&olympe.C.Pa(a.da.D)!==olympe.auth.Ta.j.mf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.Vg:olympe.dc.Request.j.Ze;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.aj(h,d,e));return a.Tb.request(g)})).then(g=>g[0])}
|
|
905
|
+
function Hl(a,b,c,d){let e,f;null==(f=null==(e=a.F.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}function Ml(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Ff.j.Ni,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.Y)d();a.Y=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
|
|
906
|
+
olympe.dc.transaction.Ff=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Tb=c;this.ha=d;this.N=e;this.da=f;this.R=g.get('notificationTimeout');this.$=[];let h;this.ua=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.V.Nh(g.get('burstHoldTime'));this.F=new Map;this.Y=[];this.D=new Map;this.Ga=new olympe.V.promise.Cm;Gl(this)}ne(a){qb(this.Ga,()=>this.Tb.request(new olympe.dc.Request(olympe.dc.Request.j.hp,olympe.dc.Ja.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
|
|
907
|
+
b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Ff.j={gm:0,Ni:1,dv:2};olympe.dc.transaction.aj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}kh(){return this.F}jc(){return this.D}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Da:'dc.transaction.Manager'};olympe.dc.transaction.U={bq:'dc.transaction.timeout',Zn:'dc.transaction.burstInterval',Il:'dc.transaction.disabledCompilers'};
|
|
908
|
+
olympe.W.config(function(a){F(a,olympe.dc.transaction.U.bq,9E4);F(a,olympe.dc.transaction.U.Zn,30);F(a,olympe.dc.transaction.U.Il,[]);E(a,olympe.dc.transaction.P.Ca,[olympe.ja.P.Da],b=>b.cd('dc'));E(a,'olympe.dc.transaction.Config',[new olympe.W.pa(olympe.dc.transaction.U.bq),new olympe.W.pa(olympe.dc.transaction.U.Il),new olympe.W.pa(olympe.dc.db.U.xl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));D(a,olympe.dc.transaction.P.Da,olympe.dc.transaction.Ff,
|
|
909
|
+
olympe.dc.transaction.P.Ca,olympe.dc.db.P.Da,olympe.dc.P.Ng,olympe.dc.sources.P.We,olympe.dc.P.Vj,olympe.auth.P.Da,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Fa={};function Nl(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Pa(e));return c}olympe.dc.transaction.Fa.ug=class{constructor(){this.ia=olympe.dc.ia()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Pa(a){a=olympe.C.Pa(a);return void 0===a||null===a?null:olympe.C.ys(a)?a.valueOf():a}};olympe.dc.transaction.Fa.ug.xa=[olympe.dc.Lc];olympe.dc.transaction.Fa.Sn=class extends olympe.dc.transaction.Fa.ug{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.fa(a));this.origin=this.ia.Ha(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ka(){return this.relation.Ka()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Y(a,b,c){a.Gd.set(olympe.dc.fa(b),c);return a}olympe.dc.transaction.Fa.yo=class extends olympe.dc.transaction.Fa.ug{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.fa(b))?c:olympe.V.df();this.model=olympe.dc.fa(a);this.source=null;this.Gd=new Map}X(){return this.tag}ac(){return this.model}ki(a){this.source=a;return this}j(a){const b=this.ac(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Oc(c,b,this.source,Nl(this,this.Gd))}toString(){return`CreateInstance(${this.ac()}, ${this.X()})`}};
|
|
910
|
+
olympe.dc.transaction.Fa.yo.xa=[olympe.dc.Te];olympe.dc.transaction.Fa.Bl=class extends olympe.dc.transaction.Fa.Sn{constructor(a,b,c){super(a,b);this.D=this.ia.Ha(c)?olympe.dc.CloudObject.get(c):c}j(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.fc.Yc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
|
|
911
|
+
if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ka()===olympe.dc.va.DESTINATION?a.Oa(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.D)):a.Oa(b,olympe.dc.fa(this.D),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.Ka()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.D)})`}};olympe.dc.transaction.Fa.vA=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Pb=b}j(a){for(const b of this.ia.Rc(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.Fa.Lo(b,this.Pb)).j(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Pb})`}};olympe.dc.transaction.Fa.Ko=class extends olympe.dc.transaction.Fa.Sn{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ka(),e=this.ia.bb(c,this.relation);for(const f of e)d===olympe.dc.va.DESTINATION?
|
|
912
|
+
a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ka()}${this.getType()})`}};olympe.dc.transaction.Fa.Lo=class extends olympe.dc.transaction.Fa.ug{constructor(a,b=olympe.dc.Lb.Dc){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ha(b)&&wl(a,b,this.Pb)}toString(){return'DeleteInstance('+this.X()+', '+this.Pb+')'}};olympe.dc.transaction.Fa.It=class extends olympe.dc.transaction.Fa.Bl{j(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.fa(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
|
|
913
|
+
this.relation.Ka()===olympe.dc.va.DESTINATION?a.hc(b,c,d):a.hc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ka()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.D)+')'}};olympe.dc.transaction.Fa.xw=class extends olympe.dc.transaction.Fa.ug{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Gd=new Map;void 0!==b&&this.Gd.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Qc(b))&&c.D()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Nl(this,this.Gd);
|
|
914
|
+
for(const [e,f]of c){var d=this.ia.Qa(b,e,!0);d instanceof olympe.dc.uc&&wl(a,d.X(),olympe.dc.Lb.Dc);f instanceof olympe.dc.uc&&!Z(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.j(a))}a.Wc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Nl(this,this.Gd)+')'}};olympe.dc.transaction.Fa.xv=class a extends olympe.dc.transaction.Fa.ug{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ia();if(Z(b,this.tag)&&c.Ha(this.tag)&&!c.Le(this.tag)){const e=c.Db(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Qc(this.tag))?void 0:d.Db())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.uc&&c.Ha(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Oc(this.tag,d,this.source,e);for(const [g,h,k]of Yg(c,this.tag))Z(b,
|
|
915
|
+
k)&&(h===olympe.dc.va.ORIGIN?b.Oa(g,k,this.tag):b.Oa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.fa=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Xg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.oa.ac(a))?d:''}else if(olympe.C.kf(a)){let d;b=olympe.dc.fa(null==(d=olympe.C.Pa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};B('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ia=function(){return olympe.dc.gs().view};olympe.dc.register=function(a,b){olympe.dc.oa.j(a,b)};
|
|
916
|
+
olympe.dc.defineProperty=function(a){return new olympe.dc.Ra.Property(a)};olympe.dc.Xr=function(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.va.DESTINATION){const e=olympe.dc.va.DESTINATION;return b===olympe.dc.va.ORIGIN||b===e?new olympe.dc.Ra.Relation(a,b):new olympe.dc.Ra.Relation(a,d,b,c)};olympe.dc.gx=function(a){return a.$b()};olympe.dc.mb={};olympe.dc.mb.Ym=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.xb(a):a instanceof olympe.C.Sa?a:null;olympe.dc.mb.Vm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Sb(a):a instanceof olympe.C.ea?a:null;olympe.dc.mb.Xm=a=>'number'===typeof a||a instanceof Number?olympe.C.ra(a):'string'===typeof a||a instanceof String?olympe.C.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.C.aa?a:null;
|
|
917
|
+
olympe.dc.mb.Wm=a=>'number'===typeof a||a instanceof Number?ic(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.C.eb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.C.eb(a):a instanceof olympe.C.eb?a:null;olympe.dc.mb.Sr=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?mc(a.valueOf()):null};olympe.dc.mb.Tr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):null;
|
|
917
918
|
olympe.dc.mb.ij=a=>a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.mb.Bc=a=>{a=a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Bc():a)?b:null};
|
|
918
|
-
olympe.dc.mb.Bx=a=>{switch(a){case olympe.C.ea:return olympe.dc.mb.
|
|
919
|
-
olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ja.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ta([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||
|
|
920
|
-
{var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}mc(){null===this.j&&this.nb();return this.j}Md(a){this.valueType=a;null!==this.j&&this.j.Md(this.valueType)}Nb(){return null!==this.j?this.j.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Yd(){return this.D}
|
|
921
|
-
this.mc();
|
|
922
|
-
this.mc();
|
|
923
|
-
if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.za(this.D,a);b.Ac=this.Ac;b.Md(
|
|
919
|
+
olympe.dc.mb.Bx=a=>{switch(a){case olympe.C.ea:return olympe.dc.mb.Vm;case olympe.C.Sa:return olympe.dc.mb.Ym;case olympe.C.aa:return olympe.dc.mb.Xm;case olympe.C.eb:return olympe.dc.mb.Wm;case olympe.C.Color:return olympe.dc.mb.Sr;case olympe.dc.CloudObject:return olympe.dc.mb.Tr;default:return olympe.dc.mb.ij}};olympe.dc.kc={};olympe.dc.sf=class{la(){}F(){}compare(){}H(){}ga(){}toString(){}};function Ol(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Nb();return b}function Pl(a,b){a.R()||(a=`Calling "${b}" on subscription with id ${a.T()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ja.ab('dc').warn(a))}
|
|
920
|
+
olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ja.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ta([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Ol(this),this.j=null,this.Ac=void 0)}me(){return olympe.dc.me()}nb(){if(null===this.j){const a=olympe.dc.kc.Zx();this.j=Ql(a,this,this.Ac);null!==this.valueType&&this.j.Md(this.valueType);olympe.C.Xa().Td(()=>
|
|
921
|
+
{var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}mc(){null===this.j&&this.nb();return this.j}Md(a){this.valueType=a;null!==this.j&&this.j.Md(this.valueType)}Nb(){return null!==this.j?this.j.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Yd(){return this.D}Yl(){return this.ba}hd(a,b){return this.mc().hd(a,b)}bl(a){this.mc().bl(a)}tu(){return this.mc().Id()}su(){return this.mc().R()}get(a){return this.mc().get(a)}hi(){return this.mc().hi()}fi(a){const b=
|
|
922
|
+
this.mc();Pl(b,'getCurrent');return b.fi(a)}has(a){return this.mc().has(a)}ih(a){const b=this.mc();Pl(b,'hasCurrent');return b.ih(a)}le(a){return this.mc().le(a)}cz(a){return this.le(a).asObservable()}gf(a){const b=this.mc();Pl(b,'getCurrentAt');return b.gf(a)}hf(a){return this.mc().hf(a)}Mf(a){const b=this.mc();Pl(b,'getCurrentKeyAt');return b.Mf(a)}Dd(a){return this.mc().Dd(a)}hz(a){return this.Dd(a).asObservable()}Nf(a){const b=this.mc();Pl(b,'getCurrentRank');return b.Nf(a)}Gc(){return this.mc().Gc()}dz(){return this.Gc().asObservable()}Of(){return this.mc().Of()}xf(){return this.mc().xf()}iz(){return this.xf().asObservable()}og(){const a=
|
|
923
|
+
this.mc();Pl(a,'getCurrentSize');return a.og()}forEach(a,b){this.mc().forEach(a,b)}ke(a){const b=this.mc();Pl(b,'forEachCurrentValue');return b.ke(a)}lj(a,b,c,d){a=new olympe.dc.ba.Bh(a,b);(new olympe.dc.za(this.D,[...this.ba,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.ba];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
|
|
924
|
+
if(c instanceof olympe.dc.Ra.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.j)break;a.push(c)}b=new olympe.dc.za(this.D,a);b.Ac=this.Ac;b.Md(Ol(b)||this.valueType||Object);return b}gl(a){return this.transform(new olympe.dc.ba.Hf(a))}filter(a){return this.transform(new olympe.dc.ba.uf(a))}Jk(){const a=new olympe.dc.ck(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.Ac&&(a.Ac=this.Ac);
|
|
924
925
|
let b=this.ba;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.ba;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Pa(this.D)+a+')'}ru(){return this.mc().Eg()}Uc(){return olympe.C.ta([this.xf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.gf(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.xb(b+']')},olympe.C.Sa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.gl;
|
|
925
926
|
olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.ke;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.og;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.iz;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.dz;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Nf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.hz;
|
|
926
927
|
olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.gf;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.cz;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.bl;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.hd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Yd;olympe.dc.za.xa=[olympe.C.qd];m=olympe.dc.za.prototype;m.me.K=olympe.C.J.j;m.nb.K=olympe.C.J.H();m.mc.K=new olympe.C.J(()=>olympe.dc.kc.Subscription,[]);m.Md.K=new olympe.C.J(()=>{},[]);
|
|
927
|
-
m.Yd.K=new olympe.C.J(()=>String,[]);m.
|
|
928
|
-
m.Nf.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Of.K=new olympe.C.J(()=>String,[]);m.xf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;m.lj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.gl.K=new olympe.C.J(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Jk.K=new olympe.C.J(()=>olympe.dc.ck,[]);m.toString.K=olympe.C.J.j;m.ru.K=olympe.C.J.j;m.Uc.K=olympe.C.J.D;const
|
|
929
|
-
olympe.dc.ck=class{constructor(a,b){this.j=
|
|
930
|
-
d);if(!d||'function'!==typeof d.j)throw new
|
|
931
|
-
b,c){a=new olympe.dc.ba.Fe(a,a.Ka(),b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}tx(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ka())}a=new olympe.dc.ba.dk(b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}uu(){this.fb(olympe.dc.CloudObject.instancesRel);return this}cf(a){var b=this.Fa.pop();b===
|
|
932
|
-
olympe.dc.Z.Jd?(b=b.Z,b.push(a),a=new olympe.dc.Z.Jd(...b)):a=new olympe.dc.Z.Jd(b,a);b=this.Fa.pop();break;case
|
|
933
|
-
c))}Ob(a){if(!(a instanceof Array))throw new
|
|
934
|
-
Array))throw new
|
|
935
|
-
return this.cf(b)}ud(){this.Fa.push(
|
|
936
|
-
new olympe.dc.wc.DateTime(new olympe.dc.Za.xi(a,c))}c=d;null!==c&&this.ba.push(new olympe.dc.ba.Tg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.tg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.Tg(d,c));return this}kx(){this.ba.push(new olympe.dc.ba.yi);return this}vj(a,b){this.ba.push(new olympe.dc.ba.Bh(a,b));return this}};class
|
|
937
|
-
function
|
|
938
|
-
m.ox.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Ob.K=olympe.C.J.H();m.Xk.K=olympe.C.J.H();m.px.K=olympe.C.J.H();m.Dy.K=olympe.C.J.H();m.Vk.K=olympe.C.J.H();m.Cj.K=olympe.C.J.H();m.Vy.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.ud.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.fl.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.kx.K=olympe.C.J.H();m.vj.K=olympe.C.J.H();function
|
|
939
|
-
function
|
|
940
|
-
function
|
|
941
|
-
function
|
|
942
|
-
function
|
|
943
|
-
e=!0)
|
|
944
|
-
olympe.dc.kc.Tu=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.H=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.kc.dw(a),this.j.set(c,d));d.counter++;
|
|
945
|
-
|
|
928
|
+
m.Yd.K=new olympe.C.J(()=>String,[]);m.Yl.K=new olympe.C.J(()=>Array,[]);m.hd.K=new olympe.C.J(()=>String,[]);m.bl.K=new olympe.C.J(()=>{},[]);m.tu.K=olympe.C.J.N;m.su.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.hi.K=new olympe.C.J(()=>Array,[]);m.fi.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.ih.K=olympe.C.J.j;m.le.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.gf.K=olympe.C.J.j;m.hf.K=new olympe.C.J(()=>String,[]);m.Mf.K=olympe.C.J.j;m.Dd.K=olympe.C.J.F;
|
|
929
|
+
m.Nf.K=olympe.C.J.j;m.Gc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Of.K=new olympe.C.J(()=>String,[]);m.xf.K=olympe.C.J.F;m.og.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.ke.K=olympe.C.J.j;m.lj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.gl.K=new olympe.C.J(()=>olympe.dc.za,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Jk.K=new olympe.C.J(()=>olympe.dc.ck,[]);m.toString.K=olympe.C.J.j;m.ru.K=olympe.C.J.j;m.Uc.K=olympe.C.J.D;const Rl={Oz:'append',Ml:'filter_not',Xo:'filter_and',Yo:'filter_or'};function Sl(a,b){a=Tl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.Tn(a,b)).D}
|
|
930
|
+
olympe.dc.ck=class{constructor(a,b){this.j=Tl(a);this.G=olympe.ja.ab('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.ba=[];this.Fa=[];this.Ac=void 0}Ki(){const a=new olympe.dc.za(this.j,this.ba,this.valueType);'boolean'===typeof this.Ac&&(a.Ac=this.Ac);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Ul('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new Ul('transform','Properties cannot be used as transformer, unlike relations '+
|
|
931
|
+
d);if(!d||'function'!==typeof d.j)throw new Ul('transform','one of the argument is not a Transformer '+d);const e=d.Nb();null!==e&&(this.valueType=e);this.ba.push(d)}return this}gl(a){this.ba.push(new olympe.dc.ba.Hf(a));return this}Mz(a){this.ba.push(new olympe.dc.ba.Hf(Tl(a)));return this}vu(a){this.valueType=a;return this}fb(a){this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}vx(a){for(const b of a)this.ba.push(b),this.valueType=b.Nb()||olympe.dc.CloudObject;return this}ux(a,
|
|
932
|
+
b,c){a=new olympe.dc.ba.Fe(a,a.Ka(),b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}tx(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ka())}a=new olympe.dc.ba.dk(b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}uu(){this.fb(olympe.dc.CloudObject.instancesRel);return this}cf(a){var b=this.Fa.pop();b===Rl.Ml&&(a=new olympe.dc.Z.fe(a),b=this.Fa.pop());switch(b){case Rl.Xo:b=this.ba.pop().D;b instanceof
|
|
933
|
+
olympe.dc.Z.Jd?(b=b.Z,b.push(a),a=new olympe.dc.Z.Jd(...b)):a=new olympe.dc.Z.Jd(b,a);b=this.Fa.pop();break;case Rl.Yo:b=this.ba.pop().D,b instanceof olympe.dc.Z.Be?(b=b.Z,b.push(a),a=new olympe.dc.Z.Be(...b)):a=new olympe.dc.Z.Be(b,a),b=this.Fa.pop()}b===Rl.Ml&&(a=new olympe.dc.Z.fe(a),this.Fa.pop());this.ba.push(new olympe.dc.ba.uf(a));return this}ox(a,b,c){return this.cf(new olympe.dc.Z.ve(Sl(a,c),new olympe.dc.Za.Re(b)))}contains(a,b,c=!1,d){return this.cf(new olympe.dc.Z.tf(Sl(a,d),new olympe.dc.Za.Re(b),
|
|
934
|
+
c))}Ob(a){if(!(a instanceof Array))throw new Ul('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Tl(a[c]));return this.cf(new olympe.dc.Z.Hi(b))}Xk(a){return this.cf(new olympe.dc.Z.ve(new olympe.dc.Za.$i,new olympe.dc.Za.Re(Tl(a))))}px(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.ud().Xk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().ud().Xk(a[b])}return this}Dy(a,b){if(!(a instanceof
|
|
935
|
+
Array))throw new Ul('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ka())});return this.cf(new olympe.dc.Z.Ei(c,d,b))}Vk(a,b,c){a=Sl(a,c);return this.cf(new olympe.dc.Z.Zj(a,new olympe.dc.Za.Re(b)))}Cj(a,b,c){a=Sl(a,c);return this.cf(new olympe.dc.Z.Ak(a,new olympe.dc.Za.Re(b)))}Vy(a,b,c,d){a=Sl(a,d);return this.cf(new olympe.dc.Z.Ef(a,b,c))}filter(a){const b=new class extends olympe.dc.Z.tg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
|
|
936
|
+
return this.cf(b)}ud(){this.Fa.push(Rl.Ml);return this}and(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.uf&&this.Fa.push(Rl.Xo);return this}or(){this.ba[this.ba.length-1]instanceof olympe.dc.ba.uf&&this.Fa.push(Rl.Yo);return this}fl(a,b,c){a=Tl(a);let d=null;switch(olympe.dc.ia().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.X():d=new olympe.dc.wc.String(new olympe.dc.Za.Yi(a,c));break;case olympe.dm.Number.O.X():d=new olympe.dc.wc.Number(new olympe.dc.Za.Pi(a,c));break;case olympe.dm.DateTime.O.X():d=
|
|
937
|
+
new olympe.dc.wc.DateTime(new olympe.dc.Za.xi(a,c))}c=d;null!==c&&this.ba.push(new olympe.dc.ba.Tg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.tg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.Tg(d,c));return this}kx(){this.ba.push(new olympe.dc.ba.yi);return this}vj(a,b){this.ba.push(new olympe.dc.ba.Bh(a,b));return this}};class Ul extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
|
|
938
|
+
function Tl(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.oa.ac(a):olympe.C.hb(a)?a.Sh===olympe.C.Sa?a:olympe.C.ta([a],b=>olympe.C.xb(olympe.dc.fa(b)),olympe.C.Sa):a.X()}m=olympe.dc.ck.prototype;m.Ki.K=new olympe.C.J(()=>olympe.dc.za,[]);m.transform.K=olympe.C.J.H();m.gl.K=olympe.C.J.H();m.Mz.K=olympe.C.J.H();m.vu.K=olympe.C.J.H();m.fb.K=olympe.C.J.H();m.vx.K=olympe.C.J.H();m.ux.K=olympe.C.J.H();m.tx.K=olympe.C.J.H();m.uu.K=olympe.C.J.H();m.cf.K=olympe.C.J.H();
|
|
939
|
+
m.ox.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Ob.K=olympe.C.J.H();m.Xk.K=olympe.C.J.H();m.px.K=olympe.C.J.H();m.Dy.K=olympe.C.J.H();m.Vk.K=olympe.C.J.H();m.Cj.K=olympe.C.J.H();m.Vy.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.ud.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.fl.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.kx.K=olympe.C.J.H();m.vj.K=olympe.C.J.H();function Ql(a,b,c){const d=b.Yd();var e=new olympe.dc.query.vv;let f;f=d;olympe.C.hb(f)&&(f=e.add(d));b=(b=b.Yl())?Array.isArray(b)?b:[b]:null;e=olympe.dc.kc.Subscription.F(f,b,e);let g,h,k=null!=(h=null==(g=a.j.get(e))?void 0:g.j)?h:null;null===k&&(a.G.debug('QueryMGR: new',a.D?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.kc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
|
|
940
|
+
function Vl(a,b){if(b.R())a.G.debug('ListProcessor: [ID:',b.T(),'] - Subscription already booted, ignoring');else{a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting subscription');var c=new olympe.dc.lc.sr(a.db,a.G),d=b.T();olympe.C.Sc([b.Yd()],e=>{const f=olympe.dc.fa(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.ai()||b.Wk();sf(a.db,f,Wl(a,b,c),d);olympe.C.Xa().Td(()=>qf(a.db,f,d));a.db.Ha(f.valueOf())||Xl(c);b.R()||(Xl(c),b.$c([]))})}}
|
|
941
|
+
function Yl(a,b,c,d,e){const f=[b.Yd()],g=l=>l instanceof olympe.dc.ba.Hf;let h;const k=(null!=(h=b.gh())?h:[]).filter(g);for(const l of k){f.push(l.Yd());let n;k.push(...(null!=(n=l.gh())?n:[]).filter(g))}olympe.C.Sc(f,()=>{const l=b.$e(c);Zl(a,l,b.T(),d,e)})}
|
|
942
|
+
function Zl(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.Xa(),g=new olympe.async.mk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;gi(a.H,h,f,olympe.dc.Ja.SELF,olympe.dc.ma.nc.rf,{Ac:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.T()} has encountered an error: ${p}`))))})});bd(g,(h,k)=>d(k));g.start()}
|
|
943
|
+
function Wl(a,b,c){const d=new olympe.dc.lc.Jj;let e=!1;const f=olympe.C.Xa(),g=b.gh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.gd()||f.gb()||(k?b.ih(n)?a.G.warn('Adding the same index twice (should never happen) for sub #',b.T(),', index #',n,', tag #',l):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Adding Instance',l,'to the subscription'),b.Rd(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.ci(n)),e||($l(c,()=>{p.ig();Xl(c)}),f.run(()=>p.me().rg(b.$c.bind(b))),
|
|
944
|
+
e=!0),am(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].j(f,c,h[k+1]);return(k,l)=>{const n=b.T();c.register(n,null);const p=d.j(k,l,n,null);if(null!==p)h[0](k,l,n,bm(p,k,l,n))}}
|
|
945
|
+
olympe.dc.kc.Tu=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.H=d;this.j=new Map;this.F=new olympe.C.Xb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.kc.dw(a),this.j.set(c,d));d.counter++;cm(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.$h(),b||this.D&&d===olympe.dc.Ja.SERVER||d===olympe.dc.Ja.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
|
|
946
|
+
Vl(this,a)):Yl(this,a,d,e=>{e?this.G.error(e):Vl(this,a)},b))}};function dm(a){return olympe.C.hb(a)?'Node#'+a.Ba.T():String(a)}function em(a,b){return olympe.C.hb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
|
|
946
947
|
olympe.dc.query.vv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.hb(a)?'n'+a.Ba.T():'p'+ ++this.j;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.Aa=class{la(){}j(){}D(){}ga(){}toString(){}};olympe.dc.kc.Subscription=class a extends olympe.C.Hj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Xb('context subscription '+b,e));this.id=b;this.Bd=c;this.ba=d||null;this.F=this.N.run(()=>olympe.C.be(olympe.dc.kc.Subscription.j.INIT));this.vc=!1;this.$=this.zc=null}static F(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ga(d);else e+='|null';e=olympe.V.tb(e)}catch(f){e=olympe.V.Ic()}return e}T(){return this.id}Yd(){return this.Bd}gh(){return this.ba}$h(){const b=
|
|
947
948
|
olympe.dc.ae(),c=olympe.C.Pa(this.Yd());let d;return olympe.dc.CloudObject.instancesRel.Ea(null==(d=this.ba)?void 0:d[0])?b.fromModel(c):b.Ke(c)}ai(){const b=olympe.C.Pa(this.F);return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.kr}Wk(){if(this.F.Ba.gb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.zc;this.zc=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);fc(this.F,olympe.C.be(olympe.dc.kc.Subscription.j.kr))}Id(){return olympe.C.ta([this.F],
|
|
948
949
|
()=>{},olympe.C.ea)}R(){const b=this.F.Ba.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Jh}hd(b,c){this.R()?b(this):(null===this.$&&(this.$=new Map),void 0===c&&(c=olympe.V.Ic()),this.$.set(c,olympe.C.Xa().rc(b)));return c||''}bl(b){null!==this.$&&b&&this.$.delete(b)}Mb(){const b=olympe.dc.kc.Subscription.j.Jh;if(!this.F.Ba.gb()&&olympe.C.Pa(this.F)!==b&&(this.Jf(),fc(this.F,b),null!==this.$)){for(const c of this.$.values())c(this);this.$=null}}onDestroy(b){this.N.onDestroy(b)}release(){this.N.destroy()}$c(b){if(!this.F.Ba.gb()){for(let c=
|
|
949
|
-
0,d=b.length;c<d;c++)this.
|
|
950
|
+
0,d=b.length;c<d;c++)this.Om(b[c],c);if(this.R())this.Jf();else{this.vc=b=!0;for(let c in this.D)if(Object.prototype.hasOwnProperty.call(this.D,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Mb()}}}Rd(b,c){if(!this.F.Ba.gb()&&(this.Ik(b,olympe.dc.CloudObject.get(c)),b=this.R(),this.vc&&!b)){b=!0;for(let d in this.D)if(Object.prototype.hasOwnProperty.call(this.D,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Mb()}}ci(b){this.F.Ba.gb()||(this.Nm(b),
|
|
950
951
|
this.ej(b,!this.R()))}Eg(){return this.R()?super.Eg():'Subscription is not ready!'}$e(b){const c=olympe.C.Pa(this.Yd());return olympe.dc.kc.Subscription.D(c,b,this.gh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).ie();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.ba.Ve){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.fb(h,!0))}else if(e instanceof olympe.dc.ba.Fe){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.mg(h,!0,!0))}else if(e instanceof
|
|
951
|
-
olympe.dc.ba.Hf)e=a.D(olympe.C.Pa(e.Yd()),c,e.gh()),b.push(...e);else if(e instanceof olympe.dc.ba.uf||e instanceof olympe.dc.ba.Tg){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.mg(n,!0,!0):k.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,kr:1,Jh:2};olympe.dc.kc.Subscription.prototype.Eg.K=olympe.C.J.j;function
|
|
952
|
+
olympe.dc.ba.Hf)e=a.D(olympe.C.Pa(e.Yd()),c,e.gh()),b.push(...e);else if(e instanceof olympe.dc.ba.uf||e instanceof olympe.dc.ba.Tg){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.mg(n,!0,!0):k.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,kr:1,Jh:2};olympe.dc.kc.Subscription.prototype.Eg.K=olympe.C.J.j;function cm(a){const b=a.D;a.D=!0;return b}olympe.dc.kc.dw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Gf=class{la(){}Nb(){}j(){}ga(){}toString(){}};olympe.dc.Dq=class{F(){}};olympe.dc.Fk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.wc={};let fm=0;olympe.dc.wc.tg=class{constructor(){this.id=fm++}la(){return'CustomLocalComparator#'+fm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.wc.tg.xa=[olympe.dc.sf];olympe.dc.wc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.DateTime)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(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}ga(a){return'{"c":"'+this.la()+'",a:['+this.j.ga(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.xa=[olympe.dc.sf];olympe.dc.wc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.Number)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.xa=[olympe.dc.sf];olympe.dc.wc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.wc.String)}H(){return this.j.j()}F(a,b){return olympe.C.ta([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Sa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.xa=[olympe.dc.sf];olympe.dc.Z={};let gm=0;olympe.dc.Z.tg=class{constructor(){this.id=gm++}la(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.Z.tg.xa=[olympe.dc.Aa];olympe.dc.Z.ml=class{constructor(a,b){this.F=a;this.H=b}la(){}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.C.Sb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.ea))}N(){}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return this.la().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
|
|
952
953
|
olympe.dc.Z.ml.xa=[olympe.dc.Aa];olympe.dc.Z.Jd=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.Jd)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.every(d=>d.valueOf())),olympe.C.ea))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Z.map(a=>
|
|
953
954
|
a.toString()).join(',')+')'}};P('olympe.dc.predicates.And',olympe.dc.Z.Jd);olympe.dc.Z.Jd.xa=[olympe.dc.Aa];olympe.dc.Z.tl=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.ta([this.F,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.C.Sb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.C.ea))}la(){return Q(olympe.dc.Z.tl)}D(){return[this.value.j()]}ga(a){const b=olympe.C.hb(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();return'{"c":"'+this.la()+'","a":['+b+','+this.value.ga(a)+']}'}toString(){const a=olympe.C.hb(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();
|
|
954
|
-
return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.tl);olympe.dc.Z.tl.xa=[olympe.dc.Aa];olympe.dc.Z.tf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.tf)}D(){return[this.source.j(),this.value.j()]}sb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb(c.includes(d))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=
|
|
955
|
-
return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+']}'}toString(){const a=
|
|
956
|
-
')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.ve);olympe.dc.Z.ve.xa=[olympe.dc.Aa];olympe.dc.Z.Kt=class extends olympe.dc.Z.ve{constructor(a,b){super(a,new olympe.dc.Za.Re(b))}};olympe.dc.Z.Kt.xa=[olympe.dc.Aa];olympe.dc.Z.Zj=class extends olympe.dc.Z.ml{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Zj)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.Zj);olympe.dc.Z.Ei=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.fa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Fe?this.ob.push(new
|
|
957
|
-
c.getContext().gb()||c.getContext().gd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=
|
|
958
|
-
function
|
|
959
|
-
const g=this.ob;for(let k=g.length-1;0<=k;k--)f=
|
|
960
|
-
function
|
|
961
|
-
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&T(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.D(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class
|
|
962
|
-
this.F.has(k)?(c.update(olympe.C.ea.D),f()):(h=new
|
|
955
|
+
return this.la().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};P('olympe.dc.predicates.BitMask',olympe.dc.Z.tl);olympe.dc.Z.tl.xa=[olympe.dc.Aa];olympe.dc.Z.tf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}la(){return Q(olympe.dc.Z.tf)}D(){return[this.source.j(),this.value.j()]}sb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb(c.includes(d))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=this.value.ga(a);a=em(a,this.F);
|
|
956
|
+
return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+']}'}toString(){const a=dm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};P('olympe.dc.predicates.Contains',olympe.dc.Z.tf);olympe.dc.Z.tf.xa=[olympe.dc.Aa];olympe.dc.Z.ve=class{constructor(a,b){this.F=a;this.H=b}la(){return Q(olympe.dc.Z.ve)}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ta([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Fd?c.Fd(d):'object'===typeof d&&void 0!==d.Fd?d.Fd(c):olympe.C.Sb(c.valueOf()===d.valueOf()),olympe.C.ea,'Test equal predicate'))}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
|
|
957
|
+
')'}};P('olympe.dc.predicates.Equals',olympe.dc.Z.ve);olympe.dc.Z.ve.xa=[olympe.dc.Aa];olympe.dc.Z.Kt=class extends olympe.dc.Z.ve{constructor(a,b){super(a,new olympe.dc.Za.Re(b))}};olympe.dc.Z.Kt.xa=[olympe.dc.Aa];olympe.dc.Z.Zj=class extends olympe.dc.Z.ml{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Zj)}N(a,b){return a>b}};P('olympe.dc.predicates.Greater',olympe.dc.Z.Zj);olympe.dc.Z.Ei=class{constructor(a,b,c){this.ob=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.fa(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Fe?this.ob.push(new hm(c.X(),c.Ka(),c.F,c.D)):this.ob.push(new hm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Ei)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(Boolean),!1)),d=olympe.V.Ic(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
|
|
958
|
+
c.getContext().gb()||c.getContext().gd()||(f+=h?1:-1,c.update(0<f))};const g=this.ob;for(let h=g.length-1;0<=h;h--)a=im(g[h],e,a,d+h);sf(e,b,a,d);c.getContext().onDestroy(()=>{qf(e,b,d)});return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelated',olympe.dc.Z.Ei);
|
|
959
|
+
function im(a,b,c,d){const e=Object.create(null);d+=olympe.V.di();const f=(g,h,k)=>{k>=a.D&&c(g,h);if(!(0<=a.j&&k>=a.j)){var l=d+k;g?e[h]||(e[h]=!0,T(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.D(h,a,l))}};return(g,h)=>f(g,h,0)}class hm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}ga(){return`${this.X()}, ${this.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Ei.xa=[olympe.dc.Aa];olympe.dc.Z.Tl=class{constructor(a,b,c){this.ob=[];this.F=void 0!==c?c.map(olympe.dc.fa):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.ba.Fe?this.ob.push(new jm(c.X(),c.Ka(),c.F,c.D)):this.ob.push(new jm(olympe.dc.fa(c),b[d],1,1))}la(){return Q(olympe.dc.Z.Tl)}D(){return[this.ob.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(Boolean),!1)),d=olympe.dc.ia(),e=olympe.V.di();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
|
|
960
|
+
const g=this.ob;for(let k=g.length-1;0<=k;k--)f=km(g[k],d,f,e+k);let h=0;sf(d,b,f.bind(null,k=>{c.getContext().gd()||c.getContext().gb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>qf(d,b,e));return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(this.ob.map(a=>a.ga()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.ob.map(a=>a.ga())+')'}};P('olympe.dc.predicates.HasRelatedTree',olympe.dc.Z.Tl);
|
|
961
|
+
function km(a,b,c,d){const e=a.F,f=a.N,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.V.di();if(q){const u=p+r,x=y=>{const z=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
|
|
962
|
+
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&T(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.D(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class jm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d;this.N=new Map;this.F=new Map}ga(){return`${this.X()}, ${this.Ka()}, ${this.D}, ${this.j}`}}olympe.dc.Z.Tl.xa=[olympe.dc.Aa];olympe.dc.Z.Hi=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.fa(b))}):this.F.add(olympe.dc.fa(a))}la(){return Q(olympe.dc.Z.Hi)}D(){return[]}j(a,b){const c=a.run(()=>gc(olympe.C.bc(olympe.C.ea),olympe.C.ea.j)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.D(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.fa(olympe.dc.CloudObject))c.update(olympe.C.Sb(this.F.has(k))),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);
|
|
963
|
+
this.F.has(k)?(c.update(olympe.C.ea.D),f()):(h=new lm(k,olympe.dc.CloudObject.extendRel),e.push(h),T(d,h.tag,h.relation,g,h.id))}};a=new lm(b,olympe.dc.CloudObject.modelRel);e.push(a);T(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.rb()}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class lm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.V.di()}}
|
|
963
964
|
P('olympe.dc.predicates.InstanceOf',olympe.dc.Z.Hi);olympe.dc.Z.Hi.xa=[olympe.dc.Aa];olympe.dc.Z.fe=class{constructor(a){this.F=a}la(){return Q(olympe.dc.Z.fe)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ta([this.F.j(a,b)],c=>olympe.C.Sb(!c.valueOf()),olympe.C.ea))}ga(a){return`{"c":"${this.la()}","a":[${this.F.ga(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};P('olympe.dc.predicates.Not',olympe.dc.Z.fe);olympe.dc.Z.fe.xa=[olympe.dc.Aa];olympe.dc.Z.Be=class{constructor(a){this.Z=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Z=this.Z.concat(arguments[c]):this.Z.push(arguments[c])}la(){return Q(olympe.dc.Z.Be)}D(){return this.Z.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ta(this.Z.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.some(d=>d.valueOf())),olympe.C.ea))}ga(a){const b=this.Z.map(c=>c.ga(a));return'{"c":"'+this.la()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Z.map(a=>a.toString()).join(',')+
|
|
964
|
-
')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.Be);olympe.dc.Z.Be.xa=[olympe.dc.Aa];olympe.dc.Z.Ef=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.Ef)}D(){return[this.source.j()]}sb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.H,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb((new RegExp(d)).test(c))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=
|
|
965
|
-
']}'}toString(){const a=
|
|
966
|
-
(0<=this.D?
|
|
967
|
-
function
|
|
968
|
-
olympe.dc.lc.
|
|
969
|
-
e.F&&
|
|
970
|
-
class
|
|
971
|
-
function
|
|
972
|
-
function
|
|
973
|
-
olympe.dc.lc.qr=class{constructor(a){this.ha=a;this.H=null;this.D=[];this.R=[];this.$=null;this.da=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new
|
|
974
|
-
this.H+')');this.H=a;
|
|
975
|
-
c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.qr.xa=[olympe.dc.lc.Ta];function
|
|
976
|
-
function
|
|
977
|
-
olympe.dc.lc.sr=class{constructor(a,b){this.db=a;this.G=b||null;this.H=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new
|
|
978
|
-
class
|
|
979
|
-
function
|
|
965
|
+
')'}};P('olympe.dc.predicates.Or',olympe.dc.Z.Be);olympe.dc.Z.Be.xa=[olympe.dc.Aa];olympe.dc.Z.Ef=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}la(){return Q(olympe.dc.Z.Ef)}D(){return[this.source.j()]}sb(){return this.source}j(a,b){return a.run(()=>olympe.C.ta([this.source.getValue(a,b),this.H,this.F],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.C.Sb((new RegExp(d)).test(c))},olympe.C.ea))}ga(a){const b=this.source.ga(a),c=em(a,this.H);a=em(a,this.F);return'{"c":"'+this.la()+'","a":['+b+','+c+','+a+
|
|
966
|
+
']}'}toString(){const a=dm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};P('olympe.dc.predicates.Regex',olympe.dc.Z.Ef);olympe.dc.Z.Ef.xa=[olympe.dc.Aa];olympe.dc.Z.Ak=class extends olympe.dc.Z.ml{constructor(a,b){super(a,b)}la(){return Q(olympe.dc.Z.Ak)}N(a,b){return a<b}};P('olympe.dc.predicates.Smaller',olympe.dc.Z.Ak);olympe.dc.lc={};olympe.dc.lc.Jj=class{constructor(){this.$=this.H=this.R=this.D=null}N(){return null!==this.D}Y(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}j(a,b,c){b=this.H;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.lc.Uj(this),this.R=c,this.H=b):this.H=this.R=null;return b}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.$){const a=[];null!==this.H&&
|
|
967
|
+
(0<=this.D?mm(nm(this.H,this.D),a):a.push(this.R));this.$(a)}}rg(a){this.$=a}};olympe.dc.lc.Jj.xa=[olympe.dc.lc.Ta];function bm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.lc.Uj(a.j,a));return a.D}function nm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function mm(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.lc.Uj=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}me(){return this.j}ig(){this.j.N()?this.j.F():this.j.Y(this.depth-1)}};class om extends olympe.dc.lc.Uj{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.$=this.Y=this.H=!1;this.F=null}}
|
|
968
|
+
function pm(a,b,c,d,e){const f=Object.create(null),g=a.ha,h=a.H;let k,l,n;a.da=!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.H||(c.H=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.H&&(c.H=!1,e(!1,c.tag,c.R,c)),c.Y&&(c.F=null,delete h[k]),delete f[k]);a.da=!1;null!==a.D&&a.F()}
|
|
969
|
+
olympe.dc.lc.em=class{constructor(){this.H={};this.ha=[];this.D=null;this.da=!1;this.R=[];this.$=null}N(){return null!==this.D}Y(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}F(){if(null===this.D)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.da){var a=this.ha,b=a.length,c=this.H,d;for(d=this.R.length=0;d<b;d++){var e=c[a[d]];if(0>this.D)this.R.push(e.R);else{if(!e.$){var f=e,g=this.D;f.$=!0;f.F=nm(f,g)}null!==
|
|
970
|
+
e.F&&mm(e.F,this.R)}}this.$&&this.$(this.R)}}rg(a){this.$=a}j(a,b,c){let d=this.H[c];a?void 0===d?(d=new om(this,c,b),this.H[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.lc.em.xa=[olympe.dc.lc.Ta];olympe.dc.lc.Ta=class{constructor(){}j(){}N(){}Y(){}F(){}rg(){}};function qm(a,b){olympe.C.kf(a.value)?(a.node=olympe.C.vn(a.value,b),Nb(a.node)||b()):b()}function rm(a,b){if(olympe.C.kf(a.value)){const c=olympe.C.Xa(),d=a.H;olympe.C.Sc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>qm(a,b)),olympe.C.Xa().destroy())})}}
|
|
971
|
+
class sm extends olympe.dc.lc.Uj{constructor(a,b,c){super(a);this.Y=b;this.value=c;this.H=this.Pa();this.position=this.node=null;this.R=!1;this.F=null}Pa(){const a=olympe.C.Pa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.F=this.value=null}gb(){return null===this.value}}
|
|
972
|
+
function tm(a,b){if(!b.gb()){var c=a.D;var d=a.ha,e=b.Pa(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].H,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].H,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.H=b.Pa();if(c!==b.position){d=a.D;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.R&&a.F()}}}
|
|
973
|
+
function um(a){const b=a.ha;a.D.sort((c,d)=>b(c.Pa(),d.Pa()))}
|
|
974
|
+
olympe.dc.lc.qr=class{constructor(a){this.ha=a;this.H=null;this.D=[];this.R=[];this.$=null;this.da=new Map}j(a,b,c,d){b='$'+c;const e=this.D;let f;if(a)f=new sm(this,c,d),this.da.set(b,f),this.N()?qm(f,()=>tm(this,f)):(f.position=e.length,e.push(f));else{f=this.da.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.da.delete(b);null!==f.position&&(this.N()?this.remove(f):delete e[f.position]);f.destroy()}return f}N(){return null!==this.H}Y(a){if(null!==this.H)throw Error('Manager already activated (depth='+
|
|
975
|
+
this.H+')');this.H=a;um(this);for(let b=0,c=this.D.length;b<c;b++){const d=this.D[b];d.position=b;rm(d,()=>tm(this,d))}this.F()}F(){if(null===this.H)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.D.length;this.R.length=0;for(let d=0;d<a;d++){let e=this.D[d];if(!e.R){var b=e,c=this.H;b.R=!0;b.F=nm(b,c)}0>this.H?this.R.push(e.Y):e.F&&mm(e.F,this.R)}this.$&&this.$(this.R)}rg(a){this.$=a}remove(a){const b=this.D,c=b.length-1;if(null!==a.position){for(a=a.position;a<
|
|
976
|
+
c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.qr.xa=[olympe.dc.lc.Ta];function Xl(a){if(!a.D){for(let b in a.F)vm(a.F[b]);a.D=!0}a.H=null;a.N=null}function $l(a,b,c){a.F[c||'root'].R=b}function am(a,b,c){a.F[c||'root'].ig(b)}function wm(a,b,c,d){const e=a.N,f=b+d+c;let g=e[f];void 0===g&&(g=$g(a.db,b,c,d),e[f]=g);return g}function xm(a,b){a.D||a.j.ig(b)}function ym(a,b,c,d,e){if(!a.D){let f=wm(a,c,d,e||olympe.dc.va.DESTINATION);e||(f+=wm(a,c,d,olympe.dc.va.ORIGIN));0===f&&xm(a,b)}}
|
|
977
|
+
function zm(a,b){const c=a.F[b];void 0!==c?(a.G&&a.G.debug('Set current block to',b,null!==c.F?'parent = '+c.F.T():''),a.j=c):a.G&&a.G.error('Try to set a block that does not exists:',b)}function Am(a){const b=String(++a.R),c=a.j;a.F[b]=new Bm(b,c);Cm(c,b);c.H||(c.H=()=>zm(a,c.T()));return b}function Dm(a,b){const c=a.j;a.j.H=()=>{zm(a,c.T());b()}}function Em(a,b){vm(b?a.F[b]:a.j)}
|
|
978
|
+
olympe.dc.lc.sr=class{constructor(a,b){this.db=a;this.G=b||null;this.H=Object.create(null);this.N=Object.create(null);this.D=!1;this.R=0;this.j=new Bm('root');this.F=Object.create(null);this.F.root=this.j}register(a,b,c,d,e){this.D||(null!==b&&c&&d&&e?(c=wm(this,c,d,e),d=this.H[b]||0,this.H[b]=++d,this.j.j===b&&c<=d&&(this.j.j=a)):this.j.j=a)}};function Cm(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function vm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
|
|
979
|
+
class Bm{constructor(a,b){this.id=a;this.F=b||null;this.j=this.R=this.H=this.D=null;this.N=!1}T(){return this.id}ig(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&vm(this)}notify(a){const b=this.H,c=this.D;if(this.N)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.Za={};function Fm(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.lc.Jj,g=new olympe.dc.lc.sr(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.gd()||a.gb()||(h||($l(g,()=>{u.ig();Xl(g)}),u.me().rg(l),h=!0),q?k[t]=r:delete k[t],am(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.V.Ic();sf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,bm(t,q,b,p))},p);a.onDestroy(()=>{qf(e,b,p)});e.Ha(b)||Xl(g)}
|
|
980
|
+
function Gm(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.F(),g=Lg(e,b,a.H,d.rc(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Mg(e,b,a.H,g))}
|
|
980
981
|
olympe.dc.Za.oi=class{constructor(a,b,c){this.H=a&&a.X?a.X():a;this.ba=b&&b.filter(d=>d instanceof olympe.dc.ba.Ve||d instanceof olympe.dc.ba.Fe)||null;this.D=c||null;this.defaultValue=null}la(){}Nb(){}F(){}j(){return(this.ba||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}nh(a){this.defaultValue=a;return this}gh(){return this.ba}Yd(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.bc(this.Nb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&gc(c,this.defaultValue);
|
|
981
|
-
b=this.D||b;null!==this.ba?
|
|
982
|
-
b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.Za.Kj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.Za.xi(c,b)}this.D=d}la(){return this.D.la()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}ga(a){return this.D.ga(a)}toString(){return this.D.toString()}};olympe.dc.Za.
|
|
983
|
-
d(g,h,k,!1),delete e[h]}}ga(a){return'{"c":"'+this.la()+'","a":['+this.D.ga(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.ba.uf);olympe.dc.ba.uf.xa=[olympe.dc.Gf,olympe.dc.Dq];olympe.dc.ba.Nl=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.fa(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.fa(b),d||olympe.dc.va.DESTINATION)}Nb(){return Mf(this.D)}la(){return Q(olympe.dc.ba.Nl)}j(a,b,c){const d=olympe.dc.ia(),e={},f=this.D.X(),g=this.D.Ka(),h=this.F.X(),k=this.F.Ka();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.tb(u+g+(f+'_'+r)+z,20),K=
|
|
984
|
-
u,x,f,g);c(!0,z,A,K)},y.ws=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let K=Object.keys(e),X=K.length,xa=0;xa<X;xa++){let ab=e[K[xa]];ab.ws<y&&(y=ab.ws,A=ab)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,
|
|
985
|
-
'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.ba.Nl);olympe.dc.ba.Nl.xa=[olympe.dc.Gf];olympe.dc.ba.Bh=class{constructor(a,b){this.start=a;this.D=b}Nb(){return null}la(){return Q(olympe.dc.ba.Bh)}j(a,b,c){const d=new olympe.dc.lc.
|
|
986
|
-
this.la()+'","a":['+
|
|
987
|
-
olympe.dc.ba.dk=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Nb(){return olympe.dc.CloudObject}la(){return Q(olympe.dc.ba.dk)}Ka(){return this.direction}j(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.X();p=olympe.V.tb(g+k.Ka()+p+n,20);const q=
|
|
988
|
-
{d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(
|
|
989
|
-
q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.D&&l(p,t,x);p>=this.F?c(u,x,t,
|
|
990
|
-
P('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.Fe);olympe.dc.ba.Fe.xa=[olympe.dc.Gf];olympe.dc.ba.Ve=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Nb(){return Mf(this)}la(){return Q(olympe.dc.ba.Ve)}$b(){return new olympe.dc.ba.Ve(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ka();return(g,h,k,l)=>{
|
|
982
|
+
b=this.D||b;null!==this.ba?Fm(a,b,this.ba,d=>{Gm(this,d,c)}):Gm(this,b,c);return c.rb()}ga(a){const b=em(a,this.H),c=em(a,this.D);let d='null';this.ba&&(d=this.ba.map(function(e){return e.ga(a)}).join(','));return`{"c":"${this.la()}","a":["${b}",${d},${c}]}`}toString(){const a=dm(this.H),b=this.D?','+dm(this.D):'';let c='';this.ba&&(c=','+this.ba.join(','));return this.la().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.oi.xa=[olympe.dc.Fk];olympe.dc.Za.Tn=class{constructor(a,b){if(olympe.C.kf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();const e=d.Jb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.eh(e,olympe.dc.CloudObject.extendRel,olympe.dm.De);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.X():d=new olympe.dc.Za.Yi(c,b);break;case olympe.dm.Number.O.X():d=new olympe.dc.Za.Pi(c,
|
|
983
|
+
b);break;case olympe.dm.Boolean.O.X():d=new olympe.dc.Za.Kj(c,b);break;case olympe.dm.DateTime.O.X():d=new olympe.dc.Za.xi(c,b)}this.D=d}la(){return this.D.la()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}ga(a){return this.D.ga(a)}toString(){return this.D.toString()}};olympe.dc.Za.Tn.xa=[olympe.dc.Fk];olympe.dc.Za.Kj=class extends olympe.dc.Za.oi{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Kj)}F(){return olympe.dc.mb.Vm}Nb(){return olympe.C.ea}};P('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.Kj);olympe.dc.Za.Re=class{constructor(a){this.value=a}la(){return Q(olympe.dc.Za.Re)}j(){return[]}getValue(){return this.value}ga(a){a=em(a,this.value);return`{"c":"${this.la()}","a":[${a}]}`}toString(){return`Constant(${dm(this.value)})`}};P('olympe.dc.valuedefs.Constant',olympe.dc.Za.Re);olympe.dc.Za.Re.xa=[olympe.dc.Fk];olympe.dc.Za.xi=class extends olympe.dc.Za.oi{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.xi)}F(){return olympe.dc.mb.Wm}Nb(){return olympe.C.eb}};P('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Za.xi);olympe.dc.Za.Pi=class extends olympe.dc.Za.oi{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Pi)}F(){return olympe.dc.mb.Xm}Nb(){return olympe.C.aa}};P('olympe.dc.valuedefs.NumberProperty',olympe.dc.Za.Pi);olympe.dc.Za.Yi=class extends olympe.dc.Za.oi{constructor(a,b,c){super(a,b,c)}la(){return Q(olympe.dc.Za.Yi)}F(){return olympe.dc.mb.Ym}Nb(){return olympe.C.Sa}};P('olympe.dc.valuedefs.StringProperty',olympe.dc.Za.Yi);olympe.dc.Za.$i=class{la(){return Q(olympe.dc.Za.$i)}j(){return[]}getValue(a,b){return b}ga(){return'{"c":"'+this.la()+'","a":[]}'}toString(){return'Tag()'}};P('olympe.dc.valuedefs.Tag',olympe.dc.Za.$i);olympe.dc.Za.$i.xa=[olympe.dc.Fk];olympe.dc.ba={};olympe.dc.ba.yi=class{Nb(){return null}la(){return Q(olympe.dc.ba.yi)}j(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.j.j!==g||b.D||(b.j.j=f),c(!0,f,f,bm(h,!0,f,f))):(d[f]++,xm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,bm(h,!1,f,f)))}}ga(){return'{"c":"'+this.la()+'"}'}toString(){return'Distinct()'}};P('olympe.dc.transformers.Distinct',olympe.dc.ba.yi);olympe.dc.ba.yi.xa=[olympe.dc.Gf];olympe.dc.ba.uf=class{constructor(a){this.D=a}Nb(){return null}la(){return Q(olympe.dc.ba.uf)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&xm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,bm(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.D.j(a,g);olympe.C.hb(n)&&(n=n.Ba);olympe.C.Rf(n)?(b.D||void 0!==olympe.C.Pa(n)||xm(b,h),e[l]=n,a.run(()=>{olympe.C.Sc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
|
|
984
|
+
d(g,h,k,!1),delete e[h]}}ga(a){return'{"c":"'+this.la()+'","a":['+this.D.ga(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};P('olympe.dc.transformers.Filter',olympe.dc.ba.uf);olympe.dc.ba.uf.xa=[olympe.dc.Gf,olympe.dc.Dq];olympe.dc.ba.Nl=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.fa(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.fa(b),d||olympe.dc.va.DESTINATION)}Nb(){return Mf(this.D)}la(){return Q(olympe.dc.ba.Nl)}j(a,b,c){const d=olympe.dc.ia(),e={},f=this.D.X(),g=this.D.Ka(),h=this.F.X(),k=this.F.Ka();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.V.tb(u+g+(f+'_'+r)+z,20),K=bm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,bm(t,!1,z,A))};b.register(A,
|
|
985
|
+
u,x,f,g);c(!0,z,A,K)},y.ws=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let K=Object.keys(e),X=K.length,xa=0;xa<X;xa++){let ab=e[K[xa]];ab.ws<y&&(y=ab.ws,A=ab)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,ym(b,u,y,f,g),ym(b,u,y,h,k),T(d,y,this.D,p.bind(this,r,t,u,y),u+'_val'),T(d,y,this.F,q.bind(this,r+1,t,u),u+'_follow')):(d.D(y,this.F,u+'_follow'),d.D(y,this.D,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ga(){return'{"c":"'+this.la()+'","a":["'+this.D.toString()+
|
|
986
|
+
'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};P('olympe.dc.transformers.FirstRelated',olympe.dc.ba.Nl);olympe.dc.ba.Nl.xa=[olympe.dc.Gf];olympe.dc.ba.Bh=class{constructor(a,b){this.start=a;this.D=b}Nb(){return null}la(){return Q(olympe.dc.ba.Bh)}j(a,b,c){const d=new olympe.dc.lc.em;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.D||(b.j.j=e[0>n-1?0:Math.min(e.length,n)-1]);pm(d,e,f,n,c)}};a.run(()=>olympe.C.Sc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));Dm(b,k);const l=Am(b);zm(b,l);return(n,p,q,r)=>{h||(r.me().rg(t=>{e=t;Em(b,l)}),$l(b,()=>r.ig(),l),h=!0);d.j(n,p,q,null);am(b,q,l)}}ga(a){return'{"c":"'+
|
|
987
|
+
this.la()+'","a":['+em(a,this.start)+','+em(a,this.D)+']}'}toString(){return`Limit(${olympe.C.Pa(this.start)},${olympe.C.Pa(this.D)})`}};P('olympe.dc.transformers.Limit',olympe.dc.ba.Bh);olympe.dc.ba.Bh.xa=[olympe.dc.Gf];function Hm(a){return a.ob.map(b=>b.X())}
|
|
988
|
+
olympe.dc.ba.dk=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATION;this.ob=a.map(c=>new olympe.dc.Ra.Relation(c,this.direction))}Nb(){return olympe.dc.CloudObject}la(){return Q(olympe.dc.ba.dk)}Ka(){return this.direction}j(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>T(d,f,k,(l,n)=>{var p=k.X();p=olympe.V.tb(g+k.Ka()+p+n,20);const q=bm(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ka());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.ob.forEach(l=>{ym(b,h,g,l.X(),l.Ka());e(g,h,k,l)}):this.ob.forEach(l=>
|
|
989
|
+
{d.D(g,l,h)})}}ga(){return'{"c":"'+this.la()+'","a":['+JSON.stringify(Hm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ka()+'['+Hm(this).join(',')+'])'}};P('olympe.dc.transformers.MultiRelated',olympe.dc.ba.dk);olympe.dc.ba.dk.xa=[olympe.dc.Gf];olympe.dc.ba.Fe=class extends olympe.dc.Ra.Relation{constructor(a,b=olympe.dc.va.DESTINATION,c=1,d=-1){super(a,b);this.F=c;this.D=d}Nb(){return Mf(this)}la(){return Q(olympe.dc.ba.Fe)}j(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.va.ORIGIN,g=olympe.dc.va.DESTINATION,h=this.X(),k=this.Ka(),l=(p,q,r)=>{if(!(0<=this.D&&p>=this.D)){var t=d.bb(r,this);p+=1;for(let u=0,x=t.length;u<x;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.V.tb(q+k+(h+'_'+p)+t[u],20);b.register(y,
|
|
990
|
+
q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.D&&l(p,t,x);p>=this.F?c(u,x,t,bm(r,u,x,t)):ym(b,t,x,h,k);0<=this.D&&p>=this.D||(u?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.V.tb(t+k+(h+'_'+A)+z,20);n(A,x,r,K,y,z)},t)):(d.D(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ga(){return'{"c":"'+this.la()+'","a":["'+this.X()+'","'+this.Ka()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.Ka()+this.X()+'['+this.F+'..'+this.D+'])'}};
|
|
991
|
+
P('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.Fe);olympe.dc.ba.Fe.xa=[olympe.dc.Gf];olympe.dc.ba.Ve=class extends olympe.dc.Ra.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Nb(){return Mf(this)}la(){return Q(olympe.dc.ba.Ve)}$b(){return new olympe.dc.ba.Ve(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ka();return(g,h,k,l)=>{ym(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.tb(k+f+e+p,20),r=bm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}ga(){return'{"c":"'+
|
|
991
992
|
this.la()+'","a":["'+this.X()+'","'+this.Ka()+'"]}'}toString(){return'Related('+this.Ka()+this.X()+')'}};P('olympe.dc.transformers.Related',olympe.dc.ba.Ve);olympe.dc.ba.Ve.xa=[olympe.dc.Gf];olympe.dc.ba.Tg=class{constructor(a,b){this.Hb=a;this.D=void 0===b?!0:!!b}Nb(){return null}la(){return Q(olympe.dc.ba.Tg)}$g(){return this.Hb}F(){return[this.Hb.H()]}j(a,b,c){const d=new olympe.dc.lc.qr(a.rc(this.D?this.Hb.compare.bind(this.Hb):(e,f)=>this.Hb.compare(f,e)));return(e,f,g)=>{var h=e?this.Hb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}ga(a){return'{"c":"'+this.la()+'","a":['+this.Hb.ga(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Hb.toString()+','+JSON.stringify(this.D)+
|
|
992
|
-
')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.Tg);olympe.dc.ba.Tg.xa=[olympe.dc.Gf,olympe.dc.Dq];function
|
|
993
|
-
olympe.dc.ba.Hf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.za?(this.D=a.Yd(),this.ba=a.
|
|
994
|
-
u.gb()||(k||(t.me().rg(x=>{g=x;
|
|
995
|
-
P('olympe.dc.transformers.Union',olympe.dc.ba.Hf);olympe.dc.ba.Hf.xa=[olympe.dc.Gf];olympe.dc.ba.Vq={fB:1,bu:-1,au:0};olympe.dc.ba.HC={Pz:!0,oA:!1};olympe.dc.kc.P={Qp:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={Pp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.U.Pp,!1);D(a,olympe.dc.kc.P.Qp,olympe.dc.kc.Tu,olympe.dc.query.P.Ca,olympe.dc.P.sh,olympe.dc.transaction.P.Da,olympe.dc.query.P.nk,new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.dc.kc.U.Pp))});olympe.W.run([olympe.dc.kc.P.Qp],a=>{olympe.dc.kc.Zx=()=>a});function
|
|
993
|
+
')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.Tg);olympe.dc.ba.Tg.xa=[olympe.dc.Gf,olympe.dc.Dq];function Im(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].j(b,e,f);e.register(h,null);q=d.j(n,p,c,null);f(n,p,h,bm(q,n,p,h))}const h=olympe.V.Ic(),k=olympe.dc.ia(),l=a.ba;b.run(()=>olympe.C.Sc([a.D],n=>{Jm(k,n,g,h);void 0===k.model(n)&&Xl(e)}))}function Jm(a,b,c,d){const e=b&&b.valueOf();e&&(sf(a,e,c,d),olympe.C.Xa().Td(()=>qf(a,e,d)))}
|
|
994
|
+
olympe.dc.ba.Hf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.za?(this.D=a.Yd(),this.ba=a.Yl()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Hf)||''}gh(){return this.ba}Yd(){return this.D}j(a,b,c){const d=new olympe.dc.lc.em,e=new olympe.dc.lc.Jj;let f=[],g=[],h=!1,k=!1;const l=Am(b),n=Am(b);Dm(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):Em(b);pm(d,p,0,p.length,c)});zm(b,n);Im(this,a,this.D,e,b,(p,q,r,t)=>{const u=olympe.C.Xa();u.gd()||
|
|
995
|
+
u.gb()||(k||(t.me().rg(x=>{g=x;Em(b,n)}),$l(b,()=>t.ig(),n),k=!0),d.j(p,q,r),am(b,r,n))});zm(b,l);return(p,q,r,t)=>{h||(t.me().rg(u=>{f=u;Em(b,l)}),$l(b,()=>t.ig(),l),h=!0);d.j(p,q,r,l);am(b,r,l)}}ga(a){const b=this.ba?'['+this.ba.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+em(a,this.D)+','+b+']}'}toString(){const a=olympe.C.hb(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
|
|
996
|
+
P('olympe.dc.transformers.Union',olympe.dc.ba.Hf);olympe.dc.ba.Hf.xa=[olympe.dc.Gf];olympe.dc.ba.Vq={fB:1,bu:-1,au:0};olympe.dc.ba.HC={Pz:!0,oA:!1};olympe.dc.kc.P={Qp:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={Pp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.U.Pp,!1);D(a,olympe.dc.kc.P.Qp,olympe.dc.kc.Tu,olympe.dc.query.P.Ca,olympe.dc.P.sh,olympe.dc.transaction.P.Da,olympe.dc.query.P.nk,new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.dc.kc.U.Pp))});olympe.W.run([olympe.dc.kc.P.Qp],a=>{olympe.dc.kc.Zx=()=>a});function Km(a){const b=olympe.dc.ia(),c=new Map;b.ks(a).forEach(d=>{b.bb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
|
|
996
997
|
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();Object.defineProperty(this,'db',{enumerable:!1});this.model=null}static Oc(a,b,c,...d){b=olympe.dc.fa(b);var e=uf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&Y(a,olympe.dc.CloudObject.nameProp,c);return a.X()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.ns();a=olympe.dc.fa(a);var c=b.db.model(a);c=tf(b,c);if(null===c)throw new olympe.dc.rq(a);c=c.instantiate(a,b.D);
|
|
997
|
-
b.j.je([a],olympe.dc.db.Instance.j.Bp);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ha(olympe.dc.fa(a))}static ex(a,b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=
|
|
998
|
+
b.j.je([a],olympe.dc.db.Instance.j.Bp);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ha(olympe.dc.fa(a))}static ex(a,b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=Km(b||this));return e.has(k)?e.get(k):null},g=Al(!1),h=g.create(null!=b?b:this);void 0!==c&&h.ki(c);a.forEach((k,l)=>{d.Ha(olympe.dc.fa(l))?Y(h,l,k):(l=f(l))&&Y(h,l,k)});g.nb((k,l)=>{k||olympe.ja.ab('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Nw(){return this.get(this)}static Yk(a){return olympe.dc.ma.Yk(a)}static Db(){return olympe.dc.ia().bb(this,
|
|
998
999
|
olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ra.Property(a))}static Ed(){const a=olympe.dc.ia();return a.bb(this,olympe.dc.CloudObject.yj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.bb(this,olympe.dc.CloudObject.Zr).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.va.ORIGIN)))}static Qc(a){return olympe.dc.CloudObject.get(a)}static ps(a){var b=tf(olympe.dc.ns(),olympe.dc.fa(a));b=b&&b.D;return new olympe.dc.za(olympe.dc.fa(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}la(){return this.wb(olympe.dc.CloudObject.nameProp)}Wb(){this.model||
|
|
999
1000
|
(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ma.from(this)}Le(){return this.db.Le(this)}sb(){return this.db.source(this)}Wx(){return this.db.ji(this)?olympe.dc.ae().fromModel(this):null}js(){return olympe.C.ta([this.la()],a=>olympe.C.xb(a),olympe.C.Sa,'getDisplayName',olympe.C.xb('('+this.toString()+')'))}ac(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(e=>
|
|
1000
1001
|
{const f=olympe.dc.mb.Bc(this.db.Qa(this.tag,b));c||null!==f||e.next(f);const g=Lg(this.db,this.tag,b,h=>{e.next(olympe.dc.mb.Bc(h))});d.Td(()=>{e.complete();Mg(this.db,this.tag,b,g)});return()=>Mg(this.db,this.tag,b,g)})}fz(a){const b='function'===typeof a.Cb?a.Cb():a;return new rxjs.Observable(c=>{const d=Ng(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ra.Property(e),null]):c.next([new olympe.dc.Ra.Property(e),f])});b.Td(()=>{c.complete();Og(this.db,this.tag,d)});return()=>
|
|
1001
|
-
Og(this.db,this.tag,d)})}gz(a){return this.observe(olympe.C.Xa(),a)}get(a){return olympe.dc.mb.Bc(this.db.Qa(this.tag,a))}Qa(a){return this.get(a)}fb(a){return olympe.dc.ma.from(this).fb(a)}ng(a){return olympe.dc.nd.from(this).fb(a)}Bc(){return this}Gx(){return this.Pc(olympe.dc.CloudObject.Zw,olympe.dc.CloudObject)}
|
|
1002
|
-
void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Mg(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Pf(a,olympe.dc.mb.
|
|
1002
|
+
Og(this.db,this.tag,d)})}gz(a){return this.observe(olympe.C.Xa(),a)}get(a){return olympe.dc.mb.Bc(this.db.Qa(this.tag,a))}Qa(a){return this.get(a)}fb(a){return olympe.dc.ma.from(this).fb(a)}ng(a){return olympe.dc.nd.from(this).fb(a)}Bc(){return this}Gx(){return this.Pc(olympe.dc.CloudObject.Zw,olympe.dc.CloudObject)}fn(){return this.bb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Pf(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=Lg(this.db,this.tag,a,olympe.C.Xa().rc(f=>{b&&null!==f&&
|
|
1003
|
+
void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Mg(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Pf(a,olympe.dc.mb.Ym,olympe.C.Sa))}sd(a){return M(this.Pf(a,olympe.dc.mb.Xm,olympe.C.aa))}dh(a){return M(this.Pf(a,olympe.dc.mb.Vm,olympe.C.ea))}rj(a){return M(this.Pf(a,olympe.dc.mb.Wm,olympe.C.eb))}us(){return M(this.Pf(olympe.dm.Color.valueProp,olympe.dc.mb.Sr,olympe.C.Color))}vs(){return M(this.Pf(olympe.sc.workflow.Transition.processRefProp,
|
|
1003
1004
|
olympe.dc.mb.Tr,olympe.dc.CloudObject))}bb(a,b){a=a instanceof olympe.dc.ba.Ve?a:new olympe.dc.ba.Ve(a.X(),a.Ka());return new olympe.dc.za(this.X(),a,b)}Pc(a,b){return this.bb(a,b).Gc()}cs(a,b){const c=this.db,d=olympe.V.Ic(),e=olympe.C.Xa(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.D(this.tag,a,d)})}Iz(){return new olympe.dc.za(this.X(),[],Kf(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
|
|
1004
1005
|
[],this.constructor)).transform(...a)}Uc(){return this.js()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ha(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Wb().name()},this.Vc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Vc(a=!1,b=!0){const c={};this.db.Db(this,b).forEach((d,e)=>{this.db.Ha(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.mb.Bc(d))});return c}Ea(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
|
|
1005
|
-
'function'===typeof a?olympe.dc.
|
|
1006
|
+
'function'===typeof a?olympe.dc.oa.ac(a)===this.X():!1}Fd(a){return olympe.C.ta([a],b=>olympe.C.Sb(this.Ea(b)),olympe.C.ea)}ix(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Wa,c=!0;const d=olympe.dc.va.ORIGIN;for(const [e,f,g]of Yg(b,this))f===d?a.hc(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.hc(e,this,g);a.delete(this,olympe.dc.Lb.NONE);c&&a.nb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ea;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Vc;
|
|
1006
1007
|
olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.ng;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.fb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Qa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.gz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.fz;
|
|
1007
1008
|
olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.ac;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Le;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Wb;
|
|
1008
1009
|
olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.X;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.ps;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Qc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Ed;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Db;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Yk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Nw;
|
|
1009
|
-
olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.ex;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.O=olympe.dc.
|
|
1010
|
+
olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.ex;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.O=olympe.dc.oa.j('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.TE=olympe.dc.CloudObject.O.ka(olympe.dc.Jp.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ka('ff023000000000000011');B('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
|
|
1010
1011
|
olympe.dc.CloudObject.EE=olympe.dc.CloudObject.O.ka('ff023000000000000012');olympe.dc.CloudObject.yj=olympe.dc.CloudObject.O.sa('ff02200000000000000a');olympe.dc.CloudObject.Zr=olympe.dc.CloudObject.O.sa('ff02200000000000000b',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.nE=olympe.dc.CloudObject.O.sa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.dE=olympe.dc.CloudObject.O.sa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.sa('ff02200000000000000c');
|
|
1011
1012
|
B('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.sa('ff02200000000000000d',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.sa(olympe.dc.fc.Yc);B('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);B('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
|
|
1012
1013
|
olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.sa(olympe.dc.fc.zi);B('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);B('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.sa(olympe.dc.fc.Nj);B('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
|
|
1013
1014
|
olympe.dc.CloudObject.Zw=R(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.hx=olympe.dc.CloudObject.O.sa('018282d3ac0a474a0bf4');B('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.hx);olympe.dc.JC=olympe.dc.CloudObject;olympe.dc.CloudObject.xa=[olympe.dc.Te];m=olympe.dc.CloudObject.prototype;m.X.K=new olympe.C.J(()=>String,[]);m.name.K=new olympe.C.J(()=>String,[]);m.la.K=olympe.C.J.D;m.Wb.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
|
|
1014
|
-
m.sb.K=new olympe.C.J(()=>String,[]);m.Wx.K=new olympe.C.J(()=>String,[]);m.js.K=olympe.C.J.D;m.ac.K=new olympe.C.J(()=>String,[]);m.Gx.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.
|
|
1015
|
-
m.bb.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Pc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cs.K=new olympe.C.J(()=>Function,[]);m.Iz.K=new olympe.C.J(()=>olympe.dc.za,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Uc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Fd.K=olympe.C.J.N;m.ix.K=new olympe.C.J(()=>{},[]);olympe.dc.P={sh:'dc.DBView',Ep:'dc.InstanceManager',Ca:'dc.Logger',iw:'dc.TransactionLogger',Vj:'dc.FileServiceManager',Ng:'dc.Router'};olympe.dc.U={Qg:'dc.tag',Xf:'dc.debug',Mh:'dc.subscribeAll',Gl:'dc.defaultSource',
|
|
1016
|
-
olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Xf,!1);F(a,olympe.dc.U.Mh,!1);F(a,olympe.dc.U.Gl,olympe.dc.Ja.SERVER);F(a,olympe.dc.U.
|
|
1017
|
-
D(a,olympe.dc.P.Ng,olympe.dc.Kv,olympe.dc.P.Ca,olympe.dc.sources.P.Mq,olympe.dc.sources.P.er,olympe.dc.P.sh,olympe.host.P.Ue,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.
|
|
1018
|
-
olympe.W.run([olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ep,olympe.dc.P.Vj,new olympe.W.pa(olympe.dc.U.Qg)],(a,b,c,d,e)=>{olympe.dc.gs=()=>a;olympe.dc.tj=()=>b;olympe.dc.ns=()=>c;olympe.dc.ls=()=>d;olympe.dc.Ja.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Qd=class extends olympe.dc.CloudObject{la(){return this.wb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.ea.j}};olympe.dm.Qd.O=olympe.dc.
|
|
1019
|
-
olympe.dm.Qd.D=Jf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Qd.prototype.la.K=olympe.C.J.D;olympe.dm.Qd.prototype.j.K=olympe.C.J.D;olympe.dm.Qd.prototype.D.K=olympe.C.J.N;olympe.dm.ll={NONE:0,sA:1,Ct:2,tA:4,pA:8,rA:16,qA:31,PB:32,MB:64,QB:128,NB:256,kv:512,OB:992,gB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Tx(){return this.
|
|
1015
|
+
m.sb.K=new olympe.C.J(()=>String,[]);m.Wx.K=new olympe.C.J(()=>String,[]);m.js.K=olympe.C.J.D;m.ac.K=new olympe.C.J(()=>String,[]);m.Gx.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.fn.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Pf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.wb.K=olympe.C.J.D;m.sd.K=olympe.C.J.F;m.dh.K=olympe.C.J.N;m.rj.K=new olympe.C.J(()=>olympe.C.eb,[]);m.us.K=new olympe.C.J(()=>olympe.C.Color,[]);m.vs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
|
|
1016
|
+
m.bb.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Pc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cs.K=new olympe.C.J(()=>Function,[]);m.Iz.K=new olympe.C.J(()=>olympe.dc.za,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Uc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Ea.K=olympe.C.J.j;m.Fd.K=olympe.C.J.N;m.ix.K=new olympe.C.J(()=>{},[]);olympe.dc.P={sh:'dc.DBView',Ep:'dc.InstanceManager',Ca:'dc.Logger',iw:'dc.TransactionLogger',Vj:'dc.FileServiceManager',Ng:'dc.Router'};olympe.dc.U={Qg:'dc.tag',Xf:'dc.debug',Mh:'dc.subscribeAll',Gl:'dc.defaultSource',Wo:'dc.fileCache',zo:'dc.dataConsumerOnly',Ro:'dc.errorOnAbstractInstantiation'};
|
|
1017
|
+
olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Xf,!1);F(a,olympe.dc.U.Mh,!1);F(a,olympe.dc.U.Gl,olympe.dc.Ja.SERVER);F(a,olympe.dc.U.zo,b);F(a,olympe.dc.U.Wo,b);F(a,olympe.dc.U.Ro,!0);F(a,olympe.dc.U.Qg,olympe.V.Ic());E(a,olympe.dc.P.Ca,[olympe.ja.P.Da],c=>c.cd('dc'));Wa(a,olympe.dc.P.iw,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.sh,olympe.dc.db.P.Dl);D(a,olympe.dc.P.Vj,olympe.dc.Pt,olympe.dc.P.Ca,olympe.dc.db.P.Da,olympe.net.P.Da,olympe.dc.P.Ng,olympe.V.P.vg,new olympe.W.pa(olympe.dc.U.Wo));
|
|
1018
|
+
D(a,olympe.dc.P.Ng,olympe.dc.Kv,olympe.dc.P.Ca,olympe.dc.sources.P.Mq,olympe.dc.sources.P.er,olympe.dc.P.sh,olympe.host.P.Ue,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.zo));D(a,olympe.dc.P.Ep,olympe.dc.iu,olympe.dc.db.P.Pl,olympe.dc.db.P.Da,olympe.W.P.xg)},'olympe.dc');
|
|
1019
|
+
olympe.W.run([olympe.dc.db.P.Da,olympe.dc.transaction.P.Da,olympe.dc.P.Ep,olympe.dc.P.Vj,new olympe.W.pa(olympe.dc.U.Qg)],(a,b,c,d,e)=>{olympe.dc.gs=()=>a;olympe.dc.tj=()=>b;olympe.dc.ns=()=>c;olympe.dc.ls=()=>d;olympe.dc.Ja.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Qd=class extends olympe.dc.CloudObject{la(){return this.wb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.ea.j}};olympe.dm.Qd.O=olympe.dc.oa.j('ff021000000000000002',olympe.dm.Qd);olympe.dm.Qd.N=olympe.dm.Qd.O.ka('ff023000000000000035');olympe.dm.Qd.j=olympe.dm.Qd.O.sa('ff022000000000000005');olympe.dm.Qd.F=Jf('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Qd.H=Jf('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
|
|
1020
|
+
olympe.dm.Qd.D=Jf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Qd.prototype.la.K=olympe.C.J.D;olympe.dm.Qd.prototype.j.K=olympe.C.J.D;olympe.dm.Qd.prototype.D.K=olympe.C.J.N;olympe.dm.ll={NONE:0,sA:1,Ct:2,tA:4,pA:8,rA:16,qA:31,PB:32,MB:64,QB:128,NB:256,kv:512,OB:992,gB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Tx(){return this.kn()}la(){return this.kn()}kn(){return this.wb(olympe.dm.User.loginProp)}xu(){return this.wb(olympe.dm.User.D)}wu(){return olympe.C.Sa.EMPTY}qy(){return this.wb(olympe.dm.User.saltProp)}Ay(){return this.wb(olympe.dm.User.verifierProp)}oy(){return this.bb(olympe.dm.User.F,olympe.dm.Qd)}};olympe.dm.User.O=olympe.dc.oa.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ka('ff023000000000000001');
|
|
1020
1021
|
B('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.D=olympe.dm.User.O.ka('ff023000000000000002');olympe.dm.User.R=olympe.dm.User.O.ka('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.O.ka('ff023000000000000004');B('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.O.ka('ff023000000000000005');B('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.N=olympe.dm.User.O.ka('ff023000000000000020');
|
|
1021
|
-
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ka('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Qd.j);olympe.dm.User.Y=olympe.dm.User.O.sa('ff022000000000000002');olympe.dm.User.j=Jf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=Jf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Tx.K=olympe.C.J.D;m.la.K=olympe.C.J.D;m.
|
|
1022
|
-
m.Ay.K=olympe.C.J.D;m.oy.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ag=class extends olympe.dc.CloudObject{Y(){return this.
|
|
1022
|
+
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.O.ka('ff023000000000000036');B('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.F=R(olympe.dm.User.O,olympe.dm.Qd.j);olympe.dm.User.Y=olympe.dm.User.O.sa('ff022000000000000002');olympe.dm.User.j=Jf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.H=Jf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Tx.K=olympe.C.J.D;m.la.K=olympe.C.J.D;m.kn.K=olympe.C.J.D;m.xu.K=olympe.C.J.D;m.wu.K=olympe.C.J.D;m.qy.K=olympe.C.J.D;
|
|
1023
|
+
m.Ay.K=olympe.C.J.D;m.oy.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ag=class extends olympe.dc.CloudObject{Y(){return this.fn()}Ga(){return this.wb(olympe.dm.ag.ua)}};olympe.dm.ag.O=olympe.dc.oa.j('01621fb84e3300000000',olympe.dm.ag);olympe.dm.ag.ua=olympe.dm.ag.O.ka('01609de3f292e3c2c6ff');olympe.dm.ag.prototype.Y.K=new olympe.C.J(()=>olympe.C.qd,[]);olympe.dm.ag.prototype.Ga.K=olympe.C.J.D;olympe.dm.BrickMetadata=class extends olympe.dm.ag{By(){return this.wb(olympe.dm.BrickMetadata.zc)}Hc(){return this.wb(olympe.dm.BrickMetadata.da)}getType(){return this.wb(olympe.dm.BrickMetadata.Mb)}My(){return this.dh(olympe.dm.BrickMetadata.zb)}qe(){return null}Dx(){return this.bb(olympe.sc.ui.Yw.Comment.gE.$b(),olympe.sc.ui.Yw.Comment)}Sk(){return this.ng(olympe.dm.BrickMetadata.Ga).Fc().Sk()}};olympe.dm.BrickMetadata.O=Of(olympe.dc.oa.j('01621fb84e3500000000',olympe.dm.BrickMetadata));
|
|
1023
1024
|
olympe.dm.BrickMetadata.zc=olympe.dm.BrickMetadata.O.ka('01621fb84e320000f001');olympe.dm.BrickMetadata.da=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Mb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.zb=olympe.dm.BrickMetadata.O.ka('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ga=olympe.dm.BrickMetadata.O.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.Rd={YB:'private',$B:'public'};
|
|
1024
|
-
olympe.dm.BrickMetadata.Vb={AA:'experimental',oC:'stable',nA:'deprecated'};olympe.dm.BrickMetadata.Id={aA:'business',KC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.By.K=olympe.C.J.D;m.Hc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.My.K=olympe.C.J.N;m.qe.K=new olympe.C.J(()=>String,[]);m.Dx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Sk.K=olympe.C.J.R;function
|
|
1025
|
-
function
|
|
1026
|
-
function
|
|
1027
|
-
olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Tb=c;this.Wr=new Map([[olympe.dc.sources.U.
|
|
1028
|
-
'_')}.${b}`))?d
|
|
1025
|
+
olympe.dm.BrickMetadata.Vb={AA:'experimental',oC:'stable',nA:'deprecated'};olympe.dm.BrickMetadata.Id={aA:'business',KC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.By.K=olympe.C.J.D;m.Hc.K=olympe.C.J.D;m.getType.K=olympe.C.J.D;m.My.K=olympe.C.J.N;m.qe.K=new olympe.C.J(()=>String,[]);m.Dx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Sk.K=olympe.C.J.R;function $i(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`))?d:olympe.W.getParameter(`${olympe.dc.sources.zh.rv}${b}`)}
|
|
1026
|
+
function rj(a,b){const c=a.query().fb(olympe.dm.wd.j.$b()).fb(olympe.dm.wd.D);a=a.query().fb(olympe.dm.ib.D.$b()).mg(olympe.dm.ib.F,!0).fb(olympe.sc.yc.j.$b());const d=e=>e.ie().mg(olympe.dc.CloudObject.extendRel,!0).fb(olympe.dc.CloudObject.yj,!0).fb(olympe.dm.Relation.destinationModelRel).back(2).fb(olympe.dc.CloudObject.propertyRel,!0).fb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
|
|
1027
|
+
function Qj(a,b){return a.observe(b,olympe.dm.DataSource.Ur).pipe(rxjs.operators.map(()=>a.Lf(olympe.dc.sources.U.Qe)),rxjs.operators.distinctUntilChanged())}
|
|
1028
|
+
olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Tb=c;this.Wr=new Map([[olympe.dc.sources.U.sm,olympe.dm.DataSource.rz],[olympe.dc.sources.U.Qe,olympe.dm.DataSource.Ur],[olympe.dc.sources.U.ym,olympe.dm.DataSource.wz]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ja.SERVER:this.tag}Lf(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.W.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
|
|
1029
|
+
'_')}.${b}`))?d:$i(this.X(),a))?e:this.Wr.has(c)?this.get(this.Wr.get(c)):null}Hc(){const a=this;return w(function*(){const b=olympe.dm.DataSource.oc.Ft,c=olympe.dm.DataSource.oc.Ab,d=new olympe.dc.Request(olympe.dc.Request.j.oc,a.T());return a.Tb.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ja.ab('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.L.errors.jq;return e instanceof olympe.L.errors.Dk||
|
|
1029
1030
|
e instanceof f?b:c})})}init(){const a=this;return w(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return w(function*(){})}healthCheck(){return w(function*(){})}executeQuery(a){return w(function*(){return olympe.dc.query.zd.mj(a)})}applyTransaction(){return w(function*(){})}uploadFileContent(){return w(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return w(function*(){throw Error('Should not try to download files with SELF source');
|
|
1030
1031
|
})}deleteFileContent(){return w(function*(){})}};olympe.dm.DataSource.prototype.deleteFileContent=olympe.dm.DataSource.prototype.deleteFileContent;olympe.dm.DataSource.prototype.downloadFileContent=olympe.dm.DataSource.prototype.downloadFileContent;olympe.dm.DataSource.prototype.uploadFileContent=olympe.dm.DataSource.prototype.uploadFileContent;olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;
|
|
1031
|
-
olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.healthCheck;olympe.dm.DataSource.prototype.destroy=olympe.dm.DataSource.prototype.destroy;olympe.dm.DataSource.prototype.init=olympe.dm.DataSource.prototype.init;olympe.dm.DataSource.prototype.getConfig=olympe.dm.DataSource.prototype.Lf;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.T;olympe.dm.DataSource.O=olympe.dc.
|
|
1032
|
+
olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.healthCheck;olympe.dm.DataSource.prototype.destroy=olympe.dm.DataSource.prototype.destroy;olympe.dm.DataSource.prototype.init=olympe.dm.DataSource.prototype.init;olympe.dm.DataSource.prototype.getConfig=olympe.dm.DataSource.prototype.Lf;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.T;olympe.dm.DataSource.O=olympe.dc.oa.j('ff021000000000000060',olympe.dm.DataSource,olympe.dc.P.Ng);
|
|
1032
1033
|
olympe.dm.DataSource.Vh=olympe.dm.DataSource.O.ka('ff023000000000000060');B('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Vh);olympe.dm.DataSource.jE=olympe.dm.DataSource.O.ka('ff023000000000000061');olympe.dm.DataSource.rz=olympe.dm.DataSource.O.ka('ff023000000000000062');olympe.dm.DataSource.Ur=olympe.dm.DataSource.O.ka('ff023000000000000063');olympe.dm.DataSource.$r=olympe.dm.DataSource.O.ka('ff023000000000000064');olympe.dm.DataSource.wz=olympe.dm.DataSource.O.ka('ff023000000000000065');
|
|
1033
|
-
olympe.dm.DataSource.zj=olympe.dm.DataSource.O.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Jf('00000000000000000060','Server source');olympe.dm.DataSource.Qe={kB:'hybrid'
|
|
1034
|
-
olympe.dm.Kb.H=olympe.dm.Kb.O.sa('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.H);olympe.dm.Kb.prototype.H.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Mc=class extends olympe.dm.Kb{j(){return this.X()===olympe.dm.Mc.$?this.bb(olympe.dm.Mc.N,olympe.dm.Kb):this.bb(olympe.dm.Mc.R,olympe.dm.Kb)}};olympe.dm.Mc.O=olympe.dc.
|
|
1035
|
-
olympe.dm.Mc.vc=Jf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Mc.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Sx(){return this.wb(olympe.dm.Module.N)}ey(){return this.sd(olympe.dm.Module.R)}yu(){return this.wb(olympe.dm.Module.D)}jy(){return this.wb(olympe.dm.Module.Y)}Ex(){return this.wb(olympe.dm.Module.F)}gy(){return this.bb(olympe.dm.Module.H,olympe.dm.Module)}sy(){return this.bb(olympe.dm.Module.j,olympe.dm.Ld)}};olympe.dm.Module.O=olympe.dc.
|
|
1034
|
+
olympe.dm.DataSource.zj=olympe.dm.DataSource.O.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Jf('00000000000000000060','Server source');olympe.dm.DataSource.Qe={kB:'hybrid',ao:'bus',sp:'http'};olympe.dm.DataSource.oc={Jh:'ready',Ab:'error',Ft:'down',Ae:'offline'};olympe.dm.wd=class extends olympe.dc.CloudObject{};olympe.dm.wd.O=olympe.dc.oa.j('ff021000000000000070',olympe.dm.wd);olympe.dm.wd.j=olympe.dm.wd.O.sa('ff023000000000000071');olympe.dm.wd.D=olympe.dm.wd.O.sa('ff023000000000000072');olympe.dm.wd.F=olympe.dm.wd.O.sa('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.za(this.X(),[new olympe.dc.ba.Fe(olympe.dm.Kb.j.X(),olympe.dc.va.DESTINATION,olympe.dc.ba.Vq.au,olympe.dc.ba.Vq.bu),olympe.dm.Kb.H])}qe(){return olympe.sc.se.Ie.Ot}j(){return this.bb(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.bb(olympe.dm.Kb.H)}};olympe.dm.Kb.O=olympe.dc.oa.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.sa('016a697ef00ce7554691');olympe.dm.Kb.ha=R(olympe.dm.Kb.O,olympe.dm.Kb.j);
|
|
1035
|
+
olympe.dm.Kb.H=olympe.dm.Kb.O.sa('016a697ef00ce7554692');R(olympe.dc.CloudObject.O,olympe.dm.Kb.H);olympe.dm.Kb.prototype.H.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Mc=class extends olympe.dm.Kb{j(){return this.X()===olympe.dm.Mc.$?this.bb(olympe.dm.Mc.N,olympe.dm.Kb):this.bb(olympe.dm.Mc.R,olympe.dm.Kb)}};olympe.dm.Mc.O=olympe.dc.oa.j('ff021000000000000020',olympe.dm.Mc);olympe.dm.Mc.R=olympe.dm.Mc.O.sa('017e9c34cf48bd6965c1');olympe.dm.Mc.N=olympe.dm.Mc.O.sa('017e9c2e013e06bfffd9');olympe.dm.Mc.ci=olympe.dm.Mc.O.sa('01811f12ad77673770d4');olympe.dm.Mc.$=Jf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Mc.$c=Jf('10000000000000000001','OLYMPE_FOLDER');
|
|
1036
|
+
olympe.dm.Mc.vc=Jf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Mc.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Sx(){return this.wb(olympe.dm.Module.N)}ey(){return this.sd(olympe.dm.Module.R)}yu(){return this.wb(olympe.dm.Module.D)}jy(){return this.wb(olympe.dm.Module.Y)}Ex(){return this.wb(olympe.dm.Module.F)}gy(){return this.bb(olympe.dm.Module.H,olympe.dm.Module)}sy(){return this.bb(olympe.dm.Module.j,olympe.dm.Ld)}};olympe.dm.Module.O=olympe.dc.oa.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ka('ff023000000000000042');
|
|
1036
1037
|
olympe.dm.Module.R=olympe.dm.Module.O.ka('ff023000000000000043');olympe.dm.Module.D=olympe.dm.Module.O.ka('ff023000000000000044');olympe.dm.Module.Y=olympe.dm.Module.O.ka('ff023000000000000045');olympe.dm.Module.F=olympe.dm.Module.O.ka('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.ka('ff023000000000000049');olympe.dm.Module.j=olympe.dm.Module.O.sa('ff022000000000000013');olympe.dm.Module.H=olympe.dm.Module.O.sa('ff022000000000000014');
|
|
1037
1038
|
olympe.dm.Module.$=Jf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Sx.K=olympe.C.J.D;m.ey.K=olympe.C.J.F;m.yu.K=olympe.C.J.D;m.jy.K=olympe.C.J.D;m.Ex.K=olympe.C.J.D;m.gy.K=new olympe.C.J(()=>olympe.dc.za,[]);m.sy.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static D(a,b,c,d,e,f,g){e=e||'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.ae().fromModel(a);a=b.create(a,f).ki(g);b=olympe.C.eb.now();Y(Y(Y(Y(Y(Y(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.j,!1);return a.X()}constructor(a,b,c,d,e){super(a,
|
|
1038
|
-
b);this.j=c;this.F=d;this.D=e}qs(){return this.wb(olympe.dm.File.mimeTypeProp)}Ok(a,b){void 0===a&&void 0===b||olympe.ja.ab('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().rc(a),d=b&&olympe.C.Xa().rc(e=>null==b?void 0:b(`${e}`));return this.j.H(this).then(e=>{e=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}
|
|
1039
|
+
b);this.j=c;this.F=d;this.D=e}qs(){return this.wb(olympe.dm.File.mimeTypeProp)}Ok(a,b){void 0===a&&void 0===b||olympe.ja.ab('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().rc(a),d=b&&olympe.C.Xa().rc(e=>null==b?void 0:b(`${e}`));return this.j.H(this).then(e=>{e=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}en(a,b){void 0===a&&
|
|
1039
1040
|
void 0===b||olympe.ja.ab('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Xa().rc(a),d=b&&olympe.C.Xa().rc(e=>null==b?void 0:b(`${e}`));return this.Ok().then(e=>{e=cb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Pk(a,b){void 0===a&&void 0===b||olympe.ja.ab('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
|
|
1040
1041
|
olympe.C.Xa().rc(a),d=b&&olympe.C.Xa().rc(g=>null==b?void 0:b(`${g}`));a=this.get(olympe.dm.File.j);const e=this.get(olympe.dm.File.urlProp),f=this.get(olympe.dm.File.mimeTypeProp);if(a||(null==e?0:e.startsWith('blob:'))||(null==e?0:e.startsWith('stream:')))return this.j.H(this).then(g=>{g=`data:${f};base64,${this.D.j(g)}`;null==c||c(g);return g}).catch(g=>{null==d||d(g.message);throw g;});if('string'===typeof e)return null==c||c(e),Promise.resolve(e);a=`No content nor URL associated to the file ${this.X()}`;
|
|
1041
1042
|
null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.Xa().rc(b);olympe.C.Hs([a],d=>{const e=new olympe.dc.Wa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.nb(f=>{c&&c(f)})})}Ls(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.Y(this.tag).then(()=>this.Ls(a)).catch(b=>this.G.error(`Error while getting the content of a streamed file: ${b}`)):this.F.H(this.get(olympe.dm.File.mimeTypeProp))}Mp(){return this.wb(olympe.dm.File.urlProp)}Lp(){return this.wb(olympe.dm.File.fileNameProp)}Ix(){return this.rj(olympe.dm.File.creationDateProp)}by(){return this.rj(olympe.dm.File.modificationDateProp)}Ly(){return this.dh(olympe.dm.File.j)}};
|
|
1042
|
-
olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Ls;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Pk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.
|
|
1043
|
+
olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Ls;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Pk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.en;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.Ok;olympe.dm.File.O=olympe.dc.oa.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.Vj,olympe.net.P.Da,olympe.V.P.vg);olympe.dm.File.nameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
|
|
1043
1044
|
olympe.dm.File.fileNameProp=olympe.dm.File.O.ka('ff023000000000000050');B('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.ka('ff023000000000000051');B('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.ka('ff023000000000000055');B('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.ka('ff023000000000000052');
|
|
1044
|
-
B('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ka('ff023000000000000053');B('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ka('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.xa=[olympe.C.File];m=olympe.dm.File.prototype;m.qs.K=olympe.C.J.D;m.Ok.K=olympe.C.J.j;m.
|
|
1045
|
-
m.Mp.K=olympe.C.J.D;m.Lp.K=olympe.C.J.D;m.Ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.by.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ly.K=olympe.C.J.N;olympe.dm.Ld=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Ld.D)}F(){return this.sd(olympe.dm.Ld.F)}D(){return this.bb(olympe.dm.Ld.j,olympe.dm.Module)}};olympe.dm.Ld.O=olympe.dc.
|
|
1046
|
-
olympe.dm.Ld.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ib=class extends olympe.dm.Mc{j(){return this.bb(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.wb(olympe.dm.ib.Y)}R(){return this.wb(olympe.dm.ib.jb)}D(){return this.bb(olympe.dm.ib.F,olympe.dm.ib)}};olympe.dm.ib.O=olympe.dc.
|
|
1045
|
+
B('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ka('ff023000000000000053');B('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ka('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.xa=[olympe.C.File];m=olympe.dm.File.prototype;m.qs.K=olympe.C.J.D;m.Ok.K=olympe.C.J.j;m.en.K=olympe.C.J.j;m.Pk.K=olympe.C.J.j;m.rename.K=olympe.C.J.j;
|
|
1046
|
+
m.Mp.K=olympe.C.J.D;m.Lp.K=olympe.C.J.D;m.Ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.by.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Ly.K=olympe.C.J.N;olympe.dm.Ld=class extends olympe.dc.CloudObject{j(){return this.wb(olympe.dm.Ld.D)}F(){return this.sd(olympe.dm.Ld.F)}D(){return this.bb(olympe.dm.Ld.j,olympe.dm.Module)}};olympe.dm.Ld.O=olympe.dc.oa.j('ff021000000000000041',olympe.dm.Ld);olympe.dm.Ld.D=olympe.dm.Ld.O.ka('ff023000000000000047');olympe.dm.Ld.F=olympe.dm.Ld.O.ka('ff023000000000000048');olympe.dm.Ld.j=olympe.dm.Module.j.$b();olympe.dm.Ld.prototype.j.K=olympe.C.J.D;olympe.dm.Ld.prototype.F.K=olympe.C.J.F;
|
|
1047
|
+
olympe.dm.Ld.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ib=class extends olympe.dm.Mc{j(){return this.bb(olympe.dm.Kb.j,olympe.dm.Kb)}F(){return this.wb(olympe.dm.ib.Y)}R(){return this.wb(olympe.dm.ib.jb)}D(){return this.bb(olympe.dm.ib.F,olympe.dm.ib)}};olympe.dm.ib.O=olympe.dc.oa.j('0163d9594700fcf61e54',olympe.dm.ib);olympe.dm.ib.Y=olympe.dm.ib.O.ka('017869c7d2833c9492c1');olympe.dm.ib.Bs=olympe.dm.ib.O.ka('017869c7d2833c9492c2');olympe.dm.ib.$e=olympe.dm.ib.O.ka('017869c7d2833c9492c3');olympe.dm.ib.jb=olympe.dm.ib.O.ka('017869c80bb9929c76d0');
|
|
1047
1048
|
olympe.dm.ib.$a=olympe.dm.ib.O.sa('ff02200000000000002a');olympe.dm.ib.F=olympe.dm.ib.O.sa('ff02200000000000002b');olympe.dm.ib.$h=R(olympe.dm.ib.O,olympe.dm.ib.F);olympe.dm.ib.D=olympe.dm.ib.O.sa('ff02200000000000002c');olympe.dm.ib.ai=olympe.dm.ib.O.sa('017e9c412e2b944bc48f');olympe.dm.ib.af=olympe.dm.ib.O.sa('017e9c412e2b944bd590');olympe.dm.ib.xs=olympe.dm.ib.O.sa('017e9c416872a89d3415');olympe.dm.ib.Wk=olympe.dm.ib.O.sa('017ebf8fe5c506662098');R(olympe.dc.CloudObject.O,olympe.dm.ib.$a);
|
|
1048
|
-
olympe.dm.ib.Bd=Jf('100000000000000000dd','PRIMORDIAL');olympe.dm.ib.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ib.prototype.F.K=olympe.C.J.D;olympe.dm.ib.prototype.R.K=olympe.C.J.D;olympe.dm.ib.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Pc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.ng(olympe.dm.Property.typeRel).Fc()}Uc(){return this.j().la().Vr(this.la())}};olympe.dm.Property.O=olympe.dc.
|
|
1049
|
-
B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.J.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Yx(){return olympe.C.Sa.EMPTY}Ax(){return this.sd(olympe.dm.Relation.D)}ky(){return this.sd(olympe.dm.Relation.F)}hs(){return this.bb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}ss(){return this.bb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Uc(){return this.ss().la().concat(['-',this.la(),'->',this.hs().la()])}};olympe.dm.Relation.O=olympe.dc.
|
|
1050
|
-
olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.O.ka(olympe.dc.Lb.
|
|
1049
|
+
olympe.dm.ib.Bd=Jf('100000000000000000dd','PRIMORDIAL');olympe.dm.ib.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.ib.prototype.F.K=olympe.C.J.D;olympe.dm.ib.prototype.R.K=olympe.C.J.D;olympe.dm.ib.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.Pc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}D(){return this.ng(olympe.dm.Property.typeRel).Fc()}Uc(){return this.j().la().Vr(this.la())}};olympe.dm.Property.O=olympe.dc.oa.j('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.propertyRel);
|
|
1050
|
+
B('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=R(olympe.dm.Property.O,olympe.dc.CloudObject.typeRel);B('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.D.K=olympe.C.J.j;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Yx(){return olympe.C.Sa.EMPTY}Ax(){return this.sd(olympe.dm.Relation.D)}ky(){return this.sd(olympe.dm.Relation.F)}hs(){return this.bb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}ss(){return this.bb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Uc(){return this.ss().la().concat(['-',this.la(),'->',this.hs().la()])}};olympe.dm.Relation.O=olympe.dc.oa.j('ff021000000000000006',olympe.dm.Relation);
|
|
1051
|
+
olympe.dm.Relation.F=olympe.dm.Relation.O.ka('ff023000000000000030');olympe.dm.Relation.D=olympe.dm.Relation.O.ka('ff023000000000000034');olympe.dm.Relation.da=olympe.dm.Relation.O.ka(olympe.dc.Lb.Io);olympe.dm.Relation.Y=olympe.dm.Relation.O.ka(olympe.dc.Lb.Dc);olympe.dm.Relation.ha=olympe.dm.Relation.O.ka(olympe.dc.Lb.fg);olympe.dm.Relation.ua=olympe.dm.Relation.O.ka(olympe.dc.Lb.Wv);olympe.dm.Relation.$=olympe.dm.Relation.O.ka(olympe.dc.Lb.Gt);olympe.dm.Relation.Ga=olympe.dm.Relation.O.ka(olympe.dc.Lb.rw);
|
|
1051
1052
|
olympe.dm.Relation.R=olympe.dm.Relation.O.ka('ff023000000000000031');olympe.dm.Relation.originModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.yj);B('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=R(olympe.dm.Relation.O,olympe.dc.CloudObject.Zr);B('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.j={yp:0,ft:5,Fv:1,iC:4,yr:2,Qq:8,zA:10,fC:6,gC:9,Se:6,hC:9};
|
|
1052
|
-
olympe.dm.Relation.H={LB:3,hv:4,xB:5,wB:6};olympe.dm.Relation.N=olympe.dm.ll.kv+olympe.dm.ll.Ct;m=olympe.dm.Relation.prototype;m.Yx.K=olympe.C.J.D;m.Ax.K=olympe.C.J.F;m.ky.K=olympe.C.J.F;m.hs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ss.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function
|
|
1053
|
-
olympe.dm.De.O=olympe.dc.
|
|
1054
|
-
olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.De{getValue(){return this.dh(olympe.dm.Boolean.valueProp)}Bc(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.
|
|
1055
|
-
olympe.W.config(a=>{F(a,olympe.sc.U.Pe,'');F(a,olympe.sc.U.Xf,!1);F(a,olympe.sc.U.Dt,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.jv,2E4);F(a,olympe.sc.U.Lq,3E4);F(a,olympe.sc.U.
|
|
1056
|
-
'olympe.sc');olympe.W.run([olympe.sc.P.tk,new olympe.W.pa(olympe.L.U.wl)],(a,b)=>{olympe.$d().ctx=a;olympe.$d().oVersion=()=>b});olympe.sc.
|
|
1053
|
+
olympe.dm.Relation.H={LB:3,hv:4,xB:5,wB:6};olympe.dm.Relation.N=olympe.dm.ll.kv+olympe.dm.ll.Ct;m=olympe.dm.Relation.prototype;m.Yx.K=olympe.C.J.D;m.Ax.K=olympe.C.J.F;m.ky.K=olympe.C.J.F;m.hs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.ss.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function Lm(a){a=olympe.dc.fa(a);if(olympe.dc.ia().Qf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.De=class extends olympe.dc.CloudObject{getValue(){}};
|
|
1054
|
+
olympe.dm.De.O=olympe.dc.oa.j('ff021000000000000019',olympe.dm.De);olympe.dm.String=class extends olympe.dm.De{getValue(){return this.wb(olympe.dm.String.valueProp)}Bc(){return this.get(olympe.dm.String.valueProp)}toString(){let a;return null!=(a=this.get(olympe.dm.String.valueProp))?a:''}};olympe.dm.String.O=olympe.dc.oa.j('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.O.ka('ff023000000000000026');B('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
|
|
1055
|
+
olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.De{getValue(){return this.dh(olympe.dm.Boolean.valueProp)}Bc(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.oa.j('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.ka('ff023000000000000027');B('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.J.N;olympe.dm.Color=class extends olympe.dm.De{getValue(){return this.us()}Bc(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.O=olympe.dc.oa.j('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.ka('ff023000000000000032');B('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.J(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.De{getValue(){return this.rj(olympe.dm.DateTime.valueProp)}Bc(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.oa.j('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.ka('ff023000000000000029');B('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.J(()=>olympe.C.eb,[]);olympe.dm.Enum=class extends olympe.dm.String{la(){return olympe.C.ta([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Dd(){return this.sd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.oa.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ka('017a7690c915975ea995');olympe.dm.Enum.prototype.Dd.K=olympe.C.J.F;olympe.dm.cg=class extends olympe.dm.BrickMetadata{zy(){return this.fb(olympe.dc.CloudObject.instancesRel).fl(olympe.dm.Enum.rankProp,olympe.dc.query.kk.ASC).Fc()}static create(a,b){b=a.create(olympe.dm.cg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.cg.create=olympe.dm.cg.create;olympe.dm.cg.prototype.getValues=olympe.dm.cg.prototype.zy;olympe.dm.cg.O=olympe.dc.oa.j('017a768f966fc08ebb98',olympe.dm.cg);olympe.dm.Number=class extends olympe.dm.De{getValue(){return this.sd(olympe.dm.Number.valueProp)}Bc(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.oa.j('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.ka('ff023000000000000028');B('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.J.F;olympe.sc={};olympe.sc.P={Ca:'sc.Logger',tk:'sc.RootContext',Ge:'sc.Serializer'};olympe.sc.U={Pe:'sc.app',Xf:'sc.debug',Nn:'sc.autostartProfiler',Fo:'sc.debugger',Dt:'sc.disableTheme',PRODUCTION:'sc.production',jv:'sc.onstartTimeout',Lq:'sc.remoteActionTimeout'};
|
|
1056
|
+
olympe.W.config(a=>{F(a,olympe.sc.U.Pe,'');F(a,olympe.sc.U.Xf,!1);F(a,olympe.sc.U.Dt,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.jv,2E4);F(a,olympe.sc.U.Lq,3E4);F(a,olympe.sc.U.Nn,!1);E(a,olympe.sc.P.Ca,[olympe.ja.P.Da],b=>b.cd('sc'));D(a,olympe.sc.P.Ge,olympe.sc.cc,olympe.dc.db.P.Da);Wa(a,olympe.dc.sources.P.Ge,olympe.sc.P.Ge);E(a,olympe.sc.P.tk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.yg('root','root',null);olympe.sc.xn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
|
|
1057
|
+
'olympe.sc');olympe.W.run([olympe.sc.P.tk,new olympe.W.pa(olympe.L.U.wl)],(a,b)=>{olympe.$d().ctx=a;olympe.$d().oVersion=()=>b});olympe.sc.rn=()=>null!==olympe.dc.ia().Jb(void 0,olympe.sc.Runnable.j.$b());olympe.sc.hE=(a,b,c,d)=>{c=Y(Y(a.create(olympe.sc.ed),olympe.sc.ed.j,c||null),olympe.sc.ed.F,d||null);a.Oa(olympe.sc.ed.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.ij=(a,b)=>{a=olympe.dc.mb.Bx(b)(a);return a instanceof olympe.sc.Pd?a.j():a};
|
|
1057
1058
|
olympe.sc.zE=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.fa(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Ob(c,olympe.dm.Kb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ja.ab('sc').warn(`Object ${c} has no container`),[];a.Ob(c,olympe.sc.logic.pb)||g===a.Jb(c,olympe.sc.Runnable.j.$b())||d.push(c);c=g;if(f.has(c))throw Error(`Instance ${c} (${a.name(c)}) is part of a cyclic contain pattern`);}e.push(c);e=e.concat(a.eh(e[0],
|
|
1058
1059
|
olympe.dm.Kb.ha));e=e.concat(a.eh(e[e.length-1],olympe.dm.Mc.R.$b()));e=e.concat(a.eh(e[e.length-1],olympe.dm.Mc.N.$b()));return[...d,...e].reverse()};olympe.sc.AE=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Dg:a.startsWith('video/')?olympe.sc.Qh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Kc:olympe.dm.File};
|
|
1059
|
-
olympe.sc.yE=a=>a instanceof olympe.sc.Dg?'image/*':a instanceof olympe.sc.Qh?'video/*':a instanceof olympe.sc.Kc?'font/*,application/font-woff':null;olympe.sc.Ya={};function
|
|
1060
|
-
olympe.sc.ya=class{constructor(a=olympe.sc.
|
|
1061
|
-
b){this.j.set(a,b);return this}
|
|
1062
|
-
d.next.bind(d),c?void 0:this.j.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=
|
|
1063
|
-
`on the context ${this.T()}:\nStack: ${this.ne()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.T()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.fa(a)})\` `+`has never received any value:\nStack: ${this.ne()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ne)?void 0:c.call(a))||this.ne();let e,f;c=null!=(f=null==(e=a.es)?void 0:e.call(a))?f:0;b=
|
|
1064
|
-
|
|
1065
|
-
this.Cb().Tf(a)}clear(){this.j.clear()}gb(){return this.Cb().gb()||this.Cb().gd()}Qa(a){a=
|
|
1066
|
-
olympe.sc.
|
|
1060
|
+
olympe.sc.yE=a=>a instanceof olympe.sc.Dg?'image/*':a instanceof olympe.sc.Qh?'video/*':a instanceof olympe.sc.Kc?'font/*,application/font-woff':null;olympe.sc.Ya={};function Mm(a,b){var c=olympe.sc.ya,d=a.j;a=a.Cb();b=olympe.dc.fa(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.Yh(a,void 0,b);for(d=f.getParent();d&&d.ha&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Nm(g,b,f)}return new c(f)}function Om(a,b){let c,d;return(a=null!=(d=null==(c=a.j.j)?void 0:c.get(olympe.dc.fa(b)))?d:null)?new olympe.sc.ya(a):null}function Pm(a){let b;return null!=(b=a.Pa(olympe.sc.ya.j.PRODUCTION))?b:!1}
|
|
1061
|
+
olympe.sc.ya=class{constructor(a=olympe.sc.xn){this.j=a;this.G=olympe.ja.ab('sc');this.D=null}T(){return this.j.T()}getParent(){if(null===this.D){const a=this.j.getParent();this.D=null===a?null:new olympe.sc.ya(a)}return this.D}Cx(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.ff();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Qa(f,olympe.sc.Ua.$)||a.modelTag&&!b.Ob(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}ff(){return this.j.ff()}Cb(){return this.j.Cb()}set(a,
|
|
1062
|
+
b){this.j.set(a,b);return this}Hn(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}rb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.C.bc(null!=b?b:Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.j.T():void 0));return e.rb()}get(a,b=!1){a=this.Pa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.j.has(a,b)}observe(a,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,
|
|
1063
|
+
d.next.bind(d),c?void 0:this.j.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Qm(this.j,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.mh(a.unsubscribe.bind(a));return this}yz(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Yh(`Runner ${a.name()}`);a.run(b);return b}Us(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.fa(a)})\``+
|
|
1064
|
+
`on the context ${this.T()}:\nStack: ${this.ne()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.T()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.fa(a)})\` `+`has never received any value:\nStack: ${this.ne()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ne)?void 0:c.call(a))||this.ne();let e,f;c=null!=(f=null==(e=a.es)?void 0:e.call(a))?f:0;b=Rm(b,c,d);b.stack=a.stack}else b=
|
|
1065
|
+
Rm(b,0,this.ne());Sm(this.j,b);return this}zz(a){this.set(olympe.sc.ya.j.xg,a);return this}Pa(a,b=!0){return this.j.Pa(a,b)}on(a,b,c,d=!0){return this.j.on(a,b,c,d)}Yh(a){return new olympe.sc.ya(this.j.Yh(this.Cb(),a))}cl(a,b){return this.j.cl(a,c=>{b(new olympe.sc.ya(c))})}iy(a){a=Tm(this.j,a);return a===this.j?this:a&&new olympe.sc.ya(a)}destroy(){this.j.destroy()}mh(a,b){return this.j.mh(a,b)}al(a){this.j.al(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.Cb().onDestroy(a)}Tf(a){this.gb()||
|
|
1066
|
+
this.Cb().Tf(a)}clear(){this.j.clear()}gb(){return this.Cb().gb()||this.Cb().gd()}Qa(a){a=Um(this.j,a);return null!==a?new olympe.sc.ui.gA(a,this):null}Rx(a){a=Um(this.j,a);return null!==a?new olympe.sc.ui.fA(a,this):null}ez(...a){return rxjs.combineLatest(a.map(b=>{b=Um(this.j,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ea(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.j===a.j}ne(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.j!==
|
|
1067
|
+
olympe.sc.xn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.ff();return null!==f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.T()}).join('\n> ')}catch(c){b=`No stack available for context ${this.T()}: ${c}`,this.G.warn(b)}return b}};olympe.sc.ya.prototype.observeMany=olympe.sc.ya.prototype.ez;olympe.sc.ya.prototype.getEvent=olympe.sc.ya.prototype.Rx;olympe.sc.ya.prototype.getProperty=olympe.sc.ya.prototype.Qa;olympe.sc.ya.prototype.isDestroyed=olympe.sc.ya.prototype.gb;
|
|
1067
1068
|
olympe.sc.ya.prototype.clear=olympe.sc.ya.prototype.clear;olympe.sc.ya.prototype.offDestroy=olympe.sc.ya.prototype.Tf;olympe.sc.ya.prototype.onDestroy=olympe.sc.ya.prototype.onDestroy;olympe.sc.ya.prototype.offClear=olympe.sc.ya.prototype.al;olympe.sc.ya.prototype.onClear=olympe.sc.ya.prototype.mh;olympe.sc.ya.prototype.destroy=olympe.sc.ya.prototype.destroy;olympe.sc.ya.prototype.getOtherContext=olympe.sc.ya.prototype.iy;olympe.sc.ya.prototype.onContext=olympe.sc.ya.prototype.cl;
|
|
1068
1069
|
olympe.sc.ya.prototype.createChild=olympe.sc.ya.prototype.Yh;olympe.sc.ya.prototype.setParentElement=olympe.sc.ya.prototype.zz;olympe.sc.ya.prototype['throw']=olympe.sc.ya.prototype.throw;olympe.sc.ya.prototype.waitFor=olympe.sc.ya.prototype.Us;olympe.sc.ya.prototype.runner=olympe.sc.ya.prototype.yz;olympe.sc.ya.prototype.repeat=olympe.sc.ya.prototype.repeat;olympe.sc.ya.prototype.observe=olympe.sc.ya.prototype.observe;olympe.sc.ya.prototype.has=olympe.sc.ya.prototype.has;
|
|
1069
|
-
olympe.sc.ya.prototype.get=olympe.sc.ya.prototype.get;olympe.sc.ya.prototype.remove=olympe.sc.ya.prototype.remove;olympe.sc.ya.prototype.trigger=olympe.sc.ya.prototype.
|
|
1070
|
-
function
|
|
1071
|
-
function
|
|
1072
|
-
function
|
|
1073
|
-
function
|
|
1074
|
-
function
|
|
1075
|
-
function
|
|
1076
|
-
olympe.sc.yg=class{constructor(a,b='no name',c=olympe.sc.
|
|
1077
|
-
(d=this.$)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&
|
|
1078
|
-
'*';a=
|
|
1079
|
-
b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({dl:f,depth:g})=>{(-1===f.F||g<f.F)&&
|
|
1080
|
-
else return
|
|
1081
|
-
t])})};b.
|
|
1082
|
-
c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Xd.j.Et){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.Y(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.V.df(),f=new olympe.C.Xb(this.D,c.Cb()),this.H=new olympe.L.ub(this.D,f),this.H.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.ub.publish(e,{t:olympe.sc.Xd.j.Vs,n:olympe.W.getParameter(olympe.sc.U.
|
|
1083
|
-
d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{
|
|
1070
|
+
olympe.sc.ya.prototype.get=olympe.sc.ya.prototype.get;olympe.sc.ya.prototype.remove=olympe.sc.ya.prototype.remove;olympe.sc.ya.prototype.trigger=olympe.sc.ya.prototype.Hn;olympe.sc.ya.prototype.set=olympe.sc.ya.prototype.set;olympe.sc.ya.prototype.getClosest=olympe.sc.ya.prototype.Cx;olympe.sc.ya.prototype.getParent=olympe.sc.ya.prototype.getParent;olympe.sc.ya.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',xg:'__htmlContainer',uA:'__dockableElement',Ln:'__appHasStarted'};olympe.sc.ww=class extends olympe.sc.ya{constructor(a){super(a);this.F=new olympe.C.Xb('SC Update Context',super.Cb());const b=a.mh(()=>{b&&a.al(b);this.F.destroy()})}Cb(){return this.F}mh(a,b){return this.Cb().onDestroy(a,null!=b?b:olympe.V.Ic())}};let Vm=0;function Qm(a,b){b=olympe.dc.fa(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.$)?void 0:c.get('I#'+b))?e:null==(d=a.$)?void 0:d.get('IO#'+b))?f:b}function Sm(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.da){var c=Wm(olympe.dc.CloudObject.get(a.da));null!==c&&Xm(a,c).some(d=>{let e,f;return 0<(null==(e=a.F)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.N.has('$'+c)?a.set(c,b):Sm(a.H,b)}else Sm(a.H,b)}
|
|
1071
|
+
function Tm(a,b){if(b===a.id||a.R.has(b)||!b)return a;for(a=a.H;a;){if(b===a.T()||a.R.has(b))return a;const c=Ym(a.j,b);if(c)return c;a=a.getParent()}return null}function Zm(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.T())||(a.Ya.set(b.T(),{dl:b,depth:c}),$m(a,d=>{(-1===b.F||c<b.F)&&Zm(d,b,c+1)}),a.onDestroy(()=>{an(a,b.T())}));return b.T()}
|
|
1072
|
+
function an(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {dl:c,depth:d}=a.Ya.get(b);$m(a,f=>{an(f,b)});0===d&&c.D();const e=a.Ya.delete(b);0===a.Ya.size&&(a.Ya=null);return e}function Um(a,b){let c;return(null==(c=a.$)?void 0:c.get('IO#'+b))||null}
|
|
1073
|
+
function bn(a){a.D.Td(()=>{$m(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.Pa(olympe.sc.ya.j.TRANSACTION,!1)&&a.G.warn(`The context ${a.T()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.H)){let d;null==(d=c.j)||d.delete(a.T());let e;0===(null==(e=c.j)?void 0:e.size)&&(c.j=null)}a.R.clear()});let b;null==(b=a.H)||cn(b,a)}
|
|
1074
|
+
function Ym(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ha&&!c.id.startsWith('_')&&(a=Ym(c.j,b)))return a;return null}function dn(a,b,...c){if(null!==a.Ya)for(const {dl:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function en(a,b){a.da=olympe.dc.fa(b);a.ha=b.rd().rn();b.F().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),Nm(a,c,a))});a.$=b.j();dn(a,olympe.sc.Ya.pc.j.INIT)}function fn(a){a.ua=!0;let b;null==(b=a.j)||b.forEach(c=>{fn(c)})}
|
|
1075
|
+
function gn(a){a.ua=!1;let b;null==(b=a.j)||b.forEach(c=>{gn(c)})}function Xm(a,b){return['*',a.id,...a.R].map(c=>`${'@'}${c}.${b}`)}function hn(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.F)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.j)||e.forEach(f=>{!f.ua&&f.data.has(b)||hn(f,b,c,d)})}function jn(a,b,c){a.F||(a.F=new Map);let d=a.F.get(b);void 0===d&&(d=new Map,a.F.set(b,d));Vm++;const e=Vm;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
|
|
1076
|
+
function Nm(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});$m(a,f=>{f.N.has(b)||Nm(f,b,c)});a.N.delete(b)}function $m(a,b){let c;null==(c=a.j)||c.forEach(b)}function kn(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function ln(a){var b=olympe.sc.Ya.pc.D.Bf;const c=[];if(null!==a.Ya)for(const {dl:d}of a.Ya.values())d.getType()===b&&(c.push(d.T()),d.D(),an(a,d.T()))}function cn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
|
|
1077
|
+
olympe.sc.yg=class{constructor(a,b='no name',c=olympe.sc.xn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Xb('SC Context');this.data=new Map;this.da=this.Y=this.j=this.F=null;this.ha=!1;this.N=new Set;this.ua=!1;this.$=null;this.G=olympe.ja.ab('sc');this.Ya=null;bn(this)}T(){return this.id}getParent(){return this.H}ff(){return this.da}set(a,b){if(!this.D.gd()&&!this.D.gb()){const g=olympe.dc.fa(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
|
|
1078
|
+
(d=this.$)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.N.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ea))try{var f=b.Ea(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&dn(this,olympe.sc.Ya.pc.j.Rg,a,b),f=Xm(this,a),this.N.add(c),hn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.D.gb()||this.D.gd())return()=>{};const e=Qm(this,a),f=c?olympe.dc.fa(c):
|
|
1079
|
+
'*';a=jn(this,'@'+f+'.'+e,b);c=c?(c=Tm(this,f))?c.Pa(e,!1):void 0:this.Pa(e);void 0!==c&&b(c);if(d)olympe.C.Xa().onDestroy(a);return a}has(a,b=!1){a='$'+Qm(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}Yh(a,b,c){const d=null!=c?c:'_'+olympe.V.Ic();if(a.gb()||a.gd())throw Error(`Try to create new child context in a destroyed context ${a.T()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.yg(d,
|
|
1080
|
+
b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({dl:f,depth:g})=>{(-1===f.F||g<f.F)&&Zm(e,f,g+1)});return e}cl(a,b){const c=Tm(this,a);if(c)return b(c),()=>{};const d=jn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Pa(a,b=!0){a='$'+Qm(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.D.gd()||this.D.gb()||(dn(this,olympe.sc.Ya.pc.j.Rj),this.D.destroy(),dn(this,olympe.sc.Ya.pc.j.Vd))}mh(a,b){if(this.D.gb())a();
|
|
1081
|
+
else return Vm++,b=null!=b?b:String(Vm),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}al(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.gb()){dn(this,olympe.sc.Ya.pc.j.Lj);let a;null==(a=this.Y)||a.forEach(b=>b());dn(this,olympe.sc.Ya.pc.j.Mj)}}gb(){return this.D.gb()}Cb(){return this.D}};olympe.sc.yg.prototype.getParent=olympe.sc.yg.prototype.getParent;olympe.sc.yg.j={Vl:'I#',nm:'O#',nB:'IO#'};function mn(a,b,c){return(c=c.ff())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.pc=class{constructor(a=-1){this.id=olympe.V.df();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.Ya.pc.j={INIT:'INIT',Rg:'SET',Lj:'CLEAR',Mj:'CLEARED',Rj:'DESTROY',Vd:'DESTROYED'};olympe.sc.Ya.pc.D={Bf:'REMOTE',Nu:'LOCAL',eg:'PROFILER'};olympe.sc.Xd=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.Hm(1E4);gb(this.j,b=>{ln(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.Xd.j.ov:c=this.F.get(e.f);b.vd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Xd.j.pv:const h=f+c,k=(l,n,p=0)=>{kn(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let u;q=null!=(u=l.ff())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
|
|
1082
|
+
t])})};b.un(h).then(()=>{const l=[];k(g,l,0);$m(g,p=>{k(p,l,1)});olympe.L.ub.publish(h,{t:olympe.sc.Xd.j.eu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.Jv(h);Zm(g,n);this.j.has(g)?fb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Xd.j.qv:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.Xd.j.bg:void 0!==g&&(this.j.delete(g),ln(g))}}da(b,c,d){this.N=new olympe.L.ub('discovery_debug_id',
|
|
1083
|
+
c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Xd.j.Et){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.Y(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.V.df(),f=new olympe.C.Xb(this.D,c.Cb()),this.H=new olympe.L.ub(this.D,f),this.H.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.ub.publish(e,{t:olympe.sc.Xd.j.Vs,n:olympe.W.getParameter(olympe.sc.U.Fo)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,
|
|
1084
|
+
d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{$m(h,l=>{if(null!==l.ff()){const n=olympe.dc.CloudObject.get(l.ff()).ng(olympe.sc.Runnable.H).Fc();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.j,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.ub.publish(b,{t:olympe.sc.Xd.j.Ek,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ja.ab('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===
|
|
1084
1085
|
b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.ac();if(!c.Ob(d,olympe.sc.yc))return b.toString();let f=`${b.Wb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).mg(olympe.dc.CloudObject.extendRel,!0).ie().fb(olympe.dc.CloudObject.propertyRel).ie().Fc();e=olympe.dc.ma.from(e).mg(olympe.dc.CloudObject.extendRel,!0).ie().fb(olympe.dc.CloudObject.yj).ie().Fc();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
|
|
1085
|
-
'<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Xd.H='discovery_debug_id';olympe.sc.Xd.j={Et:0,Vs:1,ov:2,pv:3,eu:4,Ek:5,qv:6,bg:7};olympe.sc.Ya.vB=class extends olympe.sc.Ya.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.Ya.pc.D.Nu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.pc.j.Rg){a=
|
|
1086
|
+
'<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Qa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Xd.H='discovery_debug_id';olympe.sc.Xd.j={Et:0,Vs:1,ov:2,pv:3,eu:4,Ek:5,qv:6,bg:7};olympe.sc.Ya.vB=class extends olympe.sc.Ya.pc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.Ya.pc.D.Nu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.pc.j.Rg){a=mn(c,Qm(a,d[0]),a);d=d[1];let e;null==(e=this.j.get(a))||e(d)}}on(a,b){this.j.set(a,b)}};function nn(a,b,c,d=new Map){for(var e=[];b;){const n=b.ff();if(!n)break;e.push(n);b=b.getParent()}mb(a.j,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.H.has(c)){e=a;f=c;e.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.name(f):'';var [h,k,l]=[d,f,e];d=a.j;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.N.set(p,q);for(const [p,q]of c.entries())d.H.set(p,
|
|
1086
1087
|
q)}}
|
|
1087
|
-
olympe.sc.Ya.zv=class extends olympe.sc.Ya.pc{constructor(a){super();this.j=a;this.ia=olympe.dc.ia();this.H=new Set}getType(){return olympe.sc.Ya.pc.D.eg}process(a,b,c,...d){var e=
|
|
1088
|
-
|
|
1089
|
-
const
|
|
1090
|
-
e,f)});this.j.set(e,()=>{Og(this.db,f,h)})}olympe.sc.Xd.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{zu(){return this.sd(this.
|
|
1091
|
-
olympe.sc.od.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.od.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);function
|
|
1092
|
-
olympe.sc.Ua=class extends olympe.dm.BrickMetadata{Cu(a,b,c,d,e=!0){e||olympe.ja.ab('sc').error('parameter own= false ignored, investigate');return olympe.C.nh(M(this.Pf(a,olympe.dc.mb.ij,c)),d)}H(){return[]}F(){return rxjs.of([])}py(){return this.bb(olympe.sc.Ua.N,olympe.sc.Runnable)}Fx(){return this.bb(olympe.sc.Ua.R,olympe.sc.Runnable)}ii(){return this.db.Qa(this,olympe.sc.Ua.$)}
|
|
1093
|
-
olympe.sc.logic.Gb)}N(){return[olympe.sc.Ua.$a]}};olympe.sc.Ua.O=olympe.dc.
|
|
1094
|
-
olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Bd=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.$c=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.Cu.K=olympe.C.J.j;m.py.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Fx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.ii.K=olympe.C.J.j;m.
|
|
1095
|
-
function
|
|
1096
|
-
function
|
|
1097
|
-
function
|
|
1098
|
-
function
|
|
1099
|
-
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Cb().run(()=>{
|
|
1100
|
-
d,olympe.sc.Ua.Y,a)}D(a){a.
|
|
1101
|
-
b,c,d){a=b.rb(a,c,!0);void 0!==d&&olympe.C.nh(a,d);return a}$a(a,b,c,d,e){olympe.C.
|
|
1088
|
+
olympe.sc.Ya.zv=class extends olympe.sc.Ya.pc{constructor(a){super();this.j=a;this.ia=olympe.dc.ia();this.H=new Set}getType(){return olympe.sc.Ya.pc.D.eg}process(a,b,c,...d){var e=on.Vl,f=on.nm,g=on.uv;const h=on.INIT,k=on.Lj,l=on.Mj,n=on.Rj,p=on.Vd;c=on.lv;if(b===olympe.sc.Ya.pc.j.Rg){const [q,r]=d;b=(d=a.ff())?olympe.dc.ia().Ob(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Ob(d,olympe.sc.ui.kC):!1;b?(g=this.ia.Jb(q,olympe.dm.Property.typeRel),b=this.ia.Ob(q,olympe.sc.logic.vb),d=this.ia.Ob(q,olympe.sc.logic.Gb),
|
|
1089
|
+
nn(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Ob(q,olympe.dm.Property),f=this.ia.Jb(q,olympe.dm.Property.typeRel),nn(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.pc.j.INIT?nn(this,a,h):b===olympe.sc.Ya.pc.j.Lj?nn(this,a,k):b===olympe.sc.Ya.pc.j.Mj?nn(this,a,l):b===olympe.sc.Ya.pc.j.Rj?nn(this,a,n):b===olympe.sc.Ya.pc.j.Vd&&nn(this,a,p)}};
|
|
1090
|
+
const on={Vl:'input',nm:'output',uv:'prop',INIT:'init',Lj:'clear',Mj:'cleared',Rj:'destroy',Vd:'destroyed',lv:'other'};olympe.sc.Ya.Jv=class extends olympe.sc.Ya.pc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.pc.D.Bf}D(){super.D();for(const a of this.j.values())a();this.j.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.pc.j.Rg&&void 0!==d[0]&&null!==d[0]){const e=mn(c,Qm(a,d[0]),a),f=d[1];let g;null==(g=this.j.get(e))||g();this.j.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Wb()instanceof olympe.sc.yc){const h=Ng(this.db,f,()=>{olympe.sc.Xd.D(this.H,
|
|
1091
|
+
e,f)});this.j.set(e,()=>{Og(this.db,f,h)})}olympe.sc.Xd.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{zu(){return this.sd(this.mn())}Au(){return this.sd(this.nn())}Sk(){return new olympe.C.Zb(this.sd(this.mn()),this.sd(this.nn()))}mn(){}nn(){}};olympe.sc.Metadata.O=olympe.dc.oa.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.zu.K=olympe.C.J.F;m.Au.K=olympe.C.J.F;m.Sk.K=olympe.C.J.R;m.mn.K=olympe.C.J.j;m.nn.K=olympe.C.J.j;olympe.sc.ed=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.ed.F)}j(){return this.wb(olympe.sc.ed.j)}};olympe.sc.ed.O=olympe.dc.oa.j('01703376c4a81c0e9d90',olympe.sc.ed);olympe.sc.ed.F=olympe.sc.ed.O.ka('01703376c4a81c0e9d91');olympe.sc.ed.j=olympe.sc.ed.O.ka('01703376c4a81c0e9d92');olympe.sc.ed.D=olympe.sc.ed.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.ed.D);olympe.sc.ed.prototype.D.K=olympe.C.J.D;olympe.sc.ed.prototype.j.K=olympe.C.J.D;olympe.sc.se={};olympe.sc.se.Ie={Ot:'folders',Nv:'screenflow',mw:'ui-design',hr:'software-intelligence',rh:'data-management',ZB:'projects'};olympe.sc.Cf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Dd(){return this.sd(olympe.sc.Cf.D)}};olympe.sc.Cf.O=olympe.dc.oa.j('019131fb930466a1ad79',olympe.sc.Cf);olympe.sc.Cf.D=olympe.sc.Cf.O.ka('016d1bb681929c2cc3f1');olympe.sc.Cf.j=olympe.sc.Cf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Cf.j);olympe.sc.Cf.prototype.Dd.K=olympe.C.J.F;olympe.sc.od=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.hr}j(){return this.bb(olympe.sc.od.j,olympe.sc.logic.Ih)}D(){return this.bb(olympe.sc.od.D,olympe.sc.logic.Kg)}};olympe.sc.od.O=olympe.dc.oa.j('011100000000000adef0',olympe.sc.od);olympe.sc.od.j=olympe.sc.od.O.sa('016ac4f59a2917fdef01');olympe.sc.od.D=olympe.sc.od.O.sa('016ac4f59a2917fdef02');olympe.sc.od.O.j=(a,b)=>Cl(a,b||'New function signature',olympe.sc.od,olympe.sc.logic.xd).X();
|
|
1092
|
+
olympe.sc.od.prototype.j.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.od.prototype.D.K=new olympe.C.J(()=>olympe.dc.za,[]);function pn(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function qn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Ob(c,olympe.sc.logic.Ub));b.sort((c,d)=>{let e;c=null!=(e=a.db.Qa(c,olympe.sc.logic.Ub.j,!0))?e:0;let f;d=null!=(f=a.db.Qa(d,olympe.sc.logic.Ub.j,!0))?f:0;return c-d});return b}function rn(a){return qn(a,a.db.bb(a.tag,olympe.sc.Ua.F))}function sn(a){return qn(a,a.db.bb(a.tag,olympe.sc.Ua.D))}
|
|
1093
|
+
olympe.sc.Ua=class extends olympe.dm.BrickMetadata{Cu(a,b,c,d,e=!0){e||olympe.ja.ab('sc').error('parameter own= false ignored, investigate');return olympe.C.nh(M(this.Pf(a,olympe.dc.mb.ij,c)),d)}H(){return[]}F(){return rxjs.of([])}py(){return this.bb(olympe.sc.Ua.N,olympe.sc.Runnable)}Fx(){return this.bb(olympe.sc.Ua.R,olympe.sc.Runnable)}ii(){return this.db.Qa(this,olympe.sc.Ua.$)}rn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.$b())}Bu(){return this.bb(olympe.sc.Ua.F,olympe.sc.logic.vb)}Np(){return this.bb(olympe.sc.Ua.D,
|
|
1094
|
+
olympe.sc.logic.Gb)}N(){return[olympe.sc.Ua.$a]}};olympe.sc.Ua.O=olympe.dc.oa.j('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.$=olympe.sc.Ua.O.ka('01692aa71f3108454479');olympe.sc.Ua.jb=olympe.sc.Ua.O.ka('0166446c1f128ebc903a');olympe.sc.Ua.$a=olympe.sc.Ua.O.ka('0166446c1f128ebc904e');olympe.sc.Ua.N=olympe.sc.Ua.O.sa('01692a4af82e8984742c');olympe.sc.Ua.R=olympe.sc.Ua.O.sa('01692a4af82e8984742d');olympe.sc.Ua.Y=olympe.sc.Ua.O.sa('01692a4af82e8984742e');olympe.sc.Ua.F=olympe.sc.Ua.O.sa('01621fb84e320000f00a');
|
|
1095
|
+
olympe.sc.Ua.D=olympe.sc.Ua.O.sa('01621fb84e320000f00b');olympe.sc.Ua.Bd=olympe.sc.Ua.O.sa('0171838bcfed0000e00e');olympe.sc.Ua.$c=olympe.sc.Ua.O.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.Cu.K=olympe.C.J.j;m.py.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Fx.K=new olympe.C.J(()=>olympe.dc.za,[]);m.ii.K=olympe.C.J.j;m.rn.K=olympe.C.J.j;m.Bu.K=new olympe.C.J(()=>olympe.dc.za,[]);m.Np.K=new olympe.C.J(()=>olympe.dc.za,[]);function Wm(a){let b;return null!=(b=a.rd().N().map(olympe.dc.fa)[0])?b:null}function tn(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.nb((d,e)=>{d||olympe.ja.ab('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Xa().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.nb()});return c}
|
|
1096
|
+
function un(a,b){en(b.j,a);pn(a.rd(),b);const c=a.N(),d=vn(b,c),e=[];c.forEach((f,g)=>{f===a.$?e[0]=g:f===a.R&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(wn(a,b,d[e[0]],d[e[1]]),c[e[0]]=null,c[e[1]]=null);c.forEach((f,g)=>{f&&f.call(a,b,d[g])})}
|
|
1097
|
+
function xn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.ac()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=yn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.gb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.ww(b.j);l.Cb().run(()=>w(function*(){try{yield a.update(l,k,f)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.G.debug(c):a.G.debug(d),h=>b.throw(h),()=>a.G.debug(`Brick ${e} completed`)));b.onDestroy(g.unsubscribe.bind(g))}
|
|
1098
|
+
function zn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=Mm(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.dd&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=Om(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Cb().onDestroy(a.db.D.bind(a.db,b,c,f))}function yn(a,b){return a.rd().H(b)}
|
|
1099
|
+
function vn(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)}})}function wn(a,b,c,d){b=b.Cb();const e=Ng(a.db,a.tag,b.rc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.mb.Bc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Og(a.db,a.tag,e)})}
|
|
1100
|
+
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Cb().run(()=>{un(this,a);this.init(a);a.mh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));xn(this,a);this.D(a)})}rd(){return this.Wb()}init(a){this.onInit(a)}update(a,b,c){const d=this.rd();if(d.ii())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),zn(this,d,olympe.sc.Ua.N,a),this.da()&&zn(this,
|
|
1101
|
+
d,olympe.sc.Ua.Y,a)}D(a){a.Hn(olympe.sc.Ua.jb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.rd().F(a)}onInit(){}onUpdate(){const a=this.ac(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.G.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){return rn(this.rd())}getOutputs(){return sn(this.rd())}F(){return[]}j(){return null}da(){return!1}H(a,
|
|
1102
|
+
b,c,d){a=b.rb(a,c,!0);void 0!==d&&olympe.C.nh(a,d);return a}$a(a,b,c,d,e){olympe.C.wn([d],f=>{b.set(a,olympe.C.ys(f)?f.valueOf():f)});return this.H(a,b,c,e)}N(){return[this.$,this.R]}$(a,b){wn(this,a,b,null)}R(a,b){wn(this,a,null,b)}jb(a,b){const c=this.db,d=olympe.sc.logic.pb.F.$b(),e=olympe.sc.logic.pb.D,f=olympe.sc.logic.pb.j;this.cs(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return An(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=Of(olympe.dc.oa.j('01130000000000ca1100',olympe.sc.Runnable));
|
|
1102
1103
|
olympe.sc.Runnable.H=olympe.sc.Runnable.O.sa('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.sa('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Ua.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Ua.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Ua.Y);R(olympe.sc.Ua.O,olympe.sc.Runnable.H);R(olympe.sc.Ua.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.rd.K=new olympe.C.J(()=>olympe.sc.Ua,[]);
|
|
1103
|
-
olympe.sc.Runnable.prototype.H.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.$a.K=olympe.C.J.j;function
|
|
1104
|
-
olympe.sc.Pd.j=olympe.sc.Pd.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Pd.j);olympe.sc.Pd.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Pd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.
|
|
1105
|
-
function
|
|
1106
|
-
g()}))})}olympe.ja.ab('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ja.ab('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{
|
|
1107
|
-
olympe.sc.nf.D=olympe.sc.nf.O.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.
|
|
1108
|
-
h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Qa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.Fs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.
|
|
1104
|
+
olympe.sc.Runnable.prototype.H.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.$a.K=olympe.C.J.j;function Bn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Pd)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Pd=class extends olympe.dc.CloudObject{D(){return this.db.bb(this,olympe.sc.Pd.j)[0]}j(){const a=Bn(this);return olympe.dc.CloudObject.get(a)}Bc(){return this.j().Bc()}toString(){const a=Bn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Pd.O=olympe.dc.oa.j('0163c9ae01f2d6e9ca49',olympe.sc.Pd);
|
|
1105
|
+
olympe.sc.Pd.j=olympe.sc.Pd.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Pd.j);olympe.sc.Pd.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Pd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.Jo=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Jo.O=olympe.dc.oa.j('0163a68ce44f3d1fa84c',olympe.sc.Jo);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.O=olympe.dc.oa.j('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.j=olympe.sc.yc.O.sa('016324fde11a836087c2');olympe.sc.yc.O.j=function(a,b){return Cl(a,null!=b?b:'New type',olympe.sc.yc).X()};let Cn=null,Dn=null,En=[];
|
|
1106
|
+
function Fn(a,b){Cn=a;const c=olympe.C.Xa();return olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.nf.j.$b()).nb({Xh:'__code-as-data__'}).then(d=>{let e;null==(e=En)||e.forEach(f=>f());En=null;Dn=d;if(null!==d){if(b){const f=olympe.dc.ia();return new Promise(g=>{ci(c,d,h=>{h=f.ji(h)?h:f.model(h);return null!==h&&f.Ob(h,olympe.sc.yc)},{En:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ja.ab('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
|
|
1107
|
+
g()}))})}olympe.ja.ab('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ja.ab('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{En=null;throw d;})}function pf(){return null===En?Promise.resolve():new Promise(a=>{En.push(()=>a())})}olympe.sc.nf=class extends olympe.dc.CloudObject{};olympe.sc.nf.O=olympe.dc.oa.j('017b3aa8fae1e3d044dc',olympe.sc.nf);olympe.sc.nf.j=olympe.sc.nf.O.sa('017b3aa8fd1659291b92');
|
|
1108
|
+
olympe.sc.nf.D=olympe.sc.nf.O.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.oa.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Hg=class extends olympe.sc.Map{};olympe.sc.Hg.O=olympe.dc.oa.j('01631aacd8276ea98490',olympe.sc.Hg);olympe.sc.File=class extends olympe.dm.File{static $w(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Ns(a,e,b,c,d);return e}static ax(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Dn(a,e,b,c,d);return e}static Ns(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.Dn(a,b,c,d,e)}static Dn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ha(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Qf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
|
|
1109
|
+
h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Qa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.Fs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.Dn;olympe.sc.File.setContent=olympe.sc.File.Ns;olympe.sc.File.createFromURL=olympe.sc.File.ax;olympe.sc.File.createFromContent=olympe.sc.File.$w;
|
|
1109
1110
|
olympe.sc.File.O=If(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Dg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.Pk(b=>{a.update(olympe.C.xb(b))});return a.rb()}};olympe.sc.Dg.O=If(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Dg);olympe.sc.Dg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Dg);olympe.sc.Dg.prototype.H.K=olympe.C.J.D;olympe.sc.Kc=class extends olympe.sc.File{H(){return this.wb(olympe.sc.Kc.fontFamilyProp)}N(){return this.wb(olympe.sc.Kc.F)}R(){return this.sd(olympe.sc.Kc.H)}};olympe.sc.Kc.O=If(olympe.sc.File,'01647e113043c637b541',olympe.sc.Kc);olympe.sc.Kc.fontFamilyProp=olympe.sc.Kc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Kc.F=olympe.sc.Kc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Kc.H=olympe.sc.Kc.O.ka('01647e6780999bf8bd25');
|
|
1110
|
-
olympe.sc.Kc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Kc,a,b,c,d);a.update(c,olympe.sc.Kc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Kc.prototype.H.K=olympe.C.J.D;olympe.sc.Kc.prototype.N.K=olympe.C.J.D;olympe.sc.Kc.prototype.R.K=olympe.C.J.F;olympe.sc.Qh=class extends olympe.sc.File{};olympe.sc.Qh.O=If(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Qh);olympe.sc.Qh.O.j=olympe.sc.File.D.bind(null,olympe.sc.Qh);olympe.sc.Fr=class extends olympe.dc.CloudObject{};olympe.sc.Fr.O=olympe.dc.
|
|
1111
|
+
olympe.sc.Kc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Kc,a,b,c,d);a.update(c,olympe.sc.Kc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Kc.prototype.H.K=olympe.C.J.D;olympe.sc.Kc.prototype.N.K=olympe.C.J.D;olympe.sc.Kc.prototype.R.K=olympe.C.J.F;olympe.sc.Qh=class extends olympe.sc.File{};olympe.sc.Qh.O=If(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Qh);olympe.sc.Qh.O.j=olympe.sc.File.D.bind(null,olympe.sc.Qh);olympe.sc.Fr=class extends olympe.dc.CloudObject{};olympe.sc.Fr.O=olympe.dc.oa.j('016421bb3797e22d1c4e',olympe.sc.Fr);olympe.sc.logic={};olympe.sc.logic.op=(a,b)=>a===b?0:a>b?1:-1;
|
|
1111
1112
|
olympe.sc.logic.uB=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.C.Pa(b.getType().X());let k,l;if(b===olympe.dc.fa(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.fa(olympe.dm.Number))k=c.valueOf(),l=p=>p.sd(h);else if(b===olympe.dc.fa(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ta([p.rj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
|
|
1112
1113
|
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.op(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.op(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Jk().filter(p=>olympe.C.ta([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Sb(d.valueOf()?1===q:0<=q)},olympe.C.ea,'FilterList ListDefBuilder Filter TransformFlows')).Ki())};
|
|
1113
|
-
olympe.sc.logic.fE=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Sa)return a.Rs();if(a instanceof olympe.C.ea)return a.rs();if('string'===typeof a||'number'===typeof a)return olympe.C.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.aa.Zp};olympe.sc.logic.Ra={};function
|
|
1114
|
-
olympe.sc.logic.
|
|
1115
|
-
olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.es;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.ay;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Bi=class extends olympe.sc.logic.Pj{};olympe.sc.logic.Bi.O=olympe.dc.
|
|
1116
|
-
c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ii())return super.H(a);const b=olympe.dc.fa(olympe.sc.logic.Pj),c=olympe.dc.fa(olympe.sc.logic.Bi);return
|
|
1117
|
-
c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.xd.O=
|
|
1118
|
-
olympe.sc.logic.Wf=class extends olympe.sc.logic.xd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}da(){return this.Np().Jk().fb(olympe.sc.logic.Ub.typeRel).Xk(olympe.sc.logic.Bi).Ki().xf().
|
|
1119
|
-
olympe.sc.logic.Wf.O=
|
|
1120
|
-
olympe.sc.logic.Ub.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ub.prototype.j.K=olympe.C.J.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Ub{};olympe.sc.logic.vb.O=olympe.dc.
|
|
1121
|
-
olympe.sc.logic.vb.H=olympe.sc.logic.vb.O.sa('01621fb84e32000000d1',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.vb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Ub{};olympe.sc.logic.Gb.O=olympe.dc.
|
|
1122
|
-
olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.kd=class extends olympe.sc.logic.Function{run(a){
|
|
1123
|
-
olympe.sc.logic.kd.D=R(olympe.sc.logic.kd.O,olympe.sc.logic.Gb.H);olympe.sc.logic.kd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.kd);a.Oa(olympe.sc.logic.kd.D,b,c);return b.X()};olympe.sc.logic.kd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.kd.prototype.ua.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.dd.D),d=this.db.Jb(this,olympe.sc.logic.dd.F);b.on(c,e=>a.set(d,e),b.T())}ua(){return this.ng(olympe.sc.logic.dd.D).Fc()}ha(){return this.ng(olympe.sc.logic.dd.F).Fc()}};olympe.sc.logic.dd.O=olympe.dc.
|
|
1124
|
-
olympe.sc.logic.dd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Oa(olympe.sc.logic.dd.D,b,c);return b.X()};olympe.sc.logic.dd.prototype.ua.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.dd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);function
|
|
1125
|
-
h)}}function
|
|
1114
|
+
olympe.sc.logic.fE=(a,b)=>{if(a instanceof olympe.C.aa)return a;if(a instanceof olympe.C.Sa)return a.Rs();if(a instanceof olympe.C.ea)return a.rs();if('string'===typeof a||'number'===typeof a)return olympe.C.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.aa.Zp};olympe.sc.logic.Ra={};function Gn(a){Nf(a.O,(b,c)=>{b=b.create(a.O.D);Y(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ra.cp=class{constructor(a,b,c){this.O=olympe.dc.oa.j(a,b,...c);Gn(this)}X(){return this.O.X()}};olympe.sc.logic.Ra.cp.xa=[olympe.dc.Te];const Hn=Object.create(null),In=new Map;function Jn(a){if(void 0===Hn[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Kf(a)}function Kn(a,b,c=olympe.sc.logic.Function){if(In.has(a))throw c=Jn(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.oa.j(a,b,...[]);In.set(a,{O:d,wE:b,cE:c});return d}
|
|
1115
|
+
olympe.sc.logic.oa=class{constructor(){}static j(a,b,...c){if(Hn[a])throw c=Jn(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.cp(a,b,[olympe.sc.P.Ca].concat(c));return Hn[a]=b}};olympe.sc.logic.jA=class{};olympe.sc.logic.Pj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Pj.O=olympe.dc.oa.j('01621fb84e320000cf00',olympe.sc.logic.Pj);function Rm(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.j=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}ay(){return this.message}es(){return this.code}ne(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.ne()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.ne;
|
|
1116
|
+
olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.es;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.ay;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Bi=class extends olympe.sc.logic.Pj{};olympe.sc.logic.Bi.O=olympe.dc.oa.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Bi);olympe.sc.logic.md=class extends olympe.dc.CloudObject{j(){return this.Pc(olympe.sc.logic.md.j,olympe.dc.CloudObject)}};olympe.sc.logic.md.O=olympe.dc.oa.j('016ac4f59ee8ea2081ba',olympe.sc.logic.md);olympe.sc.logic.md.D=olympe.sc.logic.md.O.ka('017bc044aeacce7ffc8f');olympe.sc.logic.md.j=olympe.sc.logic.md.O.sa('016ac4f5a0091c4790e2');R(olympe.dc.CloudObject.O,olympe.sc.logic.md.j);olympe.sc.logic.md.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ih=class extends olympe.sc.logic.md{};olympe.sc.logic.Ih.O=olympe.dc.oa.j('016ac4f59c592b862457',olympe.sc.logic.Ih);olympe.sc.logic.Ih.F=olympe.sc.od.j.$b();olympe.sc.logic.Ih.O.j=(a,b,c,d,e)=>{b=Cl(a,b||'New Predefined Input',olympe.sc.logic.Ih,olympe.sc.logic.vb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.j,d,b);return b.X()};olympe.sc.logic.Kg=class extends olympe.sc.logic.md{};olympe.sc.logic.Kg.O=olympe.dc.oa.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Kg);olympe.sc.logic.Kg.F=R(olympe.sc.logic.Kg.O,olympe.sc.od.D);olympe.sc.logic.Kg.O.j=(a,b,c,d,e)=>{b=Cl(a,b||'New Predefined Output',olympe.sc.logic.Kg,olympe.sc.logic.Gb);Y(b,olympe.sc.logic.md.D,e);a.Oa(olympe.sc.logic.md.j,b,c);a.Oa(olympe.sc.od.D,d,b);return b.X()};olympe.sc.logic.xd=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.hr}Y(){return this.fn().Jk().Ob([olympe.sc.logic.Function]).and().ud().Ob([olympe.sc.logic.kd,olympe.sc.logic.dd]).Ki()}N(){const a=olympe.dc.fa(olympe.sc.logic.Bi);return this.db.bb(this,olympe.sc.logic.xd.D).filter(b=>this.db.Jb(b,olympe.sc.logic.Ub.typeRel)===a)}j(a){const b=this.db.cn(this,[olympe.sc.Ua.F],c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.cn(this,[olympe.sc.Ua.D],
|
|
1117
|
+
c=>this.db.model(c)===olympe.dc.fa(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.ii())return super.H(a);const b=olympe.dc.fa(olympe.sc.logic.Pj),c=olympe.dc.fa(olympe.sc.logic.Bi);return sn(this).map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Ub.typeRel)){case b:return a.Hn.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.ii())return super.F(a);const b=rn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
|
|
1118
|
+
c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.xd.O=Kn('01621fb84e320000f000',olympe.sc.logic.xd,olympe.sc.logic.Function);olympe.sc.logic.xd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.xd.prototype.D.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);let Ln=null;function Mn(){if(null===Ln){let a;Ln=null!=(a=olympe.W.getParameter('sc.action.experimental'))?a:!1}return Ln}
|
|
1119
|
+
olympe.sc.logic.Wf=class extends olympe.sc.logic.xd{R(){return this.j('016ac63229782039429f')}$(){return this.D('016ac6322acf67eebfe7')}da(){return this.Np().Jk().fb(olympe.sc.logic.Ub.typeRel).Xk(olympe.sc.logic.Bi).Ki().xf().sn(olympe.C.aa.ZERO)}F(a){if(this.ii()||Mn()){const b=this.R().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:rn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.Wf.j='016ac63229782039429f';olympe.sc.logic.Wf.H='016ac6322acf67eebfe7';
|
|
1120
|
+
olympe.sc.logic.Wf.O=Kn('01621fb84e320000a000',olympe.sc.logic.Wf,olympe.sc.logic.Action);olympe.sc.logic.Wf.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Wf.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Wf.prototype.da.K=olympe.C.J.N;olympe.sc.logic.so=class extends olympe.sc.logic.xd{};olympe.sc.logic.so.O=Kn('01621fb84e320000f011',olympe.sc.logic.so);olympe.sc.logic.ro=class extends olympe.sc.logic.Wf{};olympe.sc.logic.ro.O=Kn('01621fb84e320000f012',olympe.sc.logic.ro);olympe.sc.logic.Function=class extends olympe.sc.Runnable{N(){return[this.jb]}j(){if(!this.rd().ii())return super.j();const a=olympe.sc.yg.j.Vl,b=olympe.sc.yg.j.nm,c=this.db,d=new Map,e=this.ac();c.bb(e,olympe.sc.Ua.F).forEach(f=>{d.set(a+c.name(f),f)});c.bb(e,olympe.sc.Ua.D).forEach(f=>{d.set(b+c.name(f),f)});return d}};olympe.sc.logic.Function.O=olympe.dc.oa.j('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.P.Ca);olympe.sc.logic.Ub=class extends olympe.dc.CloudObject{getType(){return this.Pc(olympe.sc.logic.Ub.typeRel,olympe.dc.CloudObject)}j(){return this.sd(olympe.sc.logic.Ub.j)}};olympe.sc.logic.Ub.O=olympe.dc.oa.j('0168a431d25001540000',olympe.sc.logic.Ub);olympe.sc.logic.Ub.j=olympe.sc.logic.Ub.O.ka('01740c5d4ae4b520dd01');olympe.sc.logic.Ub.typeRel=olympe.sc.logic.Ub.O.sa('0168a431d3b9b7438424');R(olympe.dc.CloudObject.O,olympe.sc.logic.Ub.typeRel);
|
|
1121
|
+
olympe.sc.logic.Ub.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ub.prototype.j.K=olympe.C.J.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Ub{};olympe.sc.logic.vb.O=olympe.dc.oa.j('0168a431d25001540001',olympe.sc.logic.vb);olympe.sc.logic.vb.R=olympe.sc.logic.Ub.O.ka('01740c5d4ae4b520dd02');olympe.sc.logic.vb.N=R(olympe.sc.logic.vb.O,olympe.sc.Ua.F);olympe.sc.logic.vb.D=olympe.sc.logic.vb.O.sa('0168a431d91f2578000b',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.F=olympe.sc.logic.vb.O.sa('01621fb84e32000000a1',olympe.dc.va.ORIGIN);
|
|
1122
|
+
olympe.sc.logic.vb.H=olympe.sc.logic.vb.O.sa('01621fb84e32000000d1',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.vb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Ub{};olympe.sc.logic.Gb.O=olympe.dc.oa.j('0168a431d25001540002',olympe.sc.logic.Gb);olympe.sc.logic.Gb.N=R(olympe.sc.logic.Gb.O,olympe.sc.Ua.D);olympe.sc.logic.Gb.D=olympe.sc.logic.Gb.O.sa('0168a431d91f25780003',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.H=olympe.sc.logic.Gb.O.sa('01621fb84e32000000a2',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.F=olympe.sc.logic.Gb.O.sa('01621fb84e32000000d2',olympe.dc.va.ORIGIN);
|
|
1123
|
+
olympe.sc.logic.Gb.O.j=function(a,b,c,d,e,f=olympe.sc.logic.Gb){f=a.create(f);Y(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Oa(olympe.sc.logic.Ub.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Ub.j,e);d&&a.Oa(olympe.sc.Ua.D,d,f);return f.X()};olympe.sc.logic.kd=class extends olympe.sc.logic.Function{run(a){un(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.kd.F),d=this.db.Jb(this,olympe.sc.logic.kd.D);a.on(c,e=>b.set(d,e),this.tag)}ha(){return this.ng(olympe.sc.logic.kd.F).Fc()}ua(){return this.ng(olympe.sc.logic.kd.D).Fc()}};olympe.sc.logic.kd.O=olympe.dc.oa.j('01621fb84e32000000a0',olympe.sc.logic.kd,olympe.sc.P.Ca);olympe.sc.logic.kd.F=R(olympe.sc.logic.kd.O,olympe.sc.logic.vb.F);
|
|
1124
|
+
olympe.sc.logic.kd.D=R(olympe.sc.logic.kd.O,olympe.sc.logic.Gb.H);olympe.sc.logic.kd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.kd);a.Oa(olympe.sc.logic.kd.D,b,c);return b.X()};olympe.sc.logic.kd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.kd.prototype.ua.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.dd.D),d=this.db.Jb(this,olympe.sc.logic.dd.F);b.on(c,e=>a.set(d,e),b.T())}ua(){return this.ng(olympe.sc.logic.dd.D).Fc()}ha(){return this.ng(olympe.sc.logic.dd.F).Fc()}};olympe.sc.logic.dd.O=olympe.dc.oa.j('01621fb84e32000000d0',olympe.sc.logic.dd,olympe.sc.P.Ca);olympe.sc.logic.dd.D=R(olympe.sc.logic.dd.O,olympe.sc.logic.vb.H);olympe.sc.logic.dd.F=R(olympe.sc.logic.dd.O,olympe.sc.logic.Gb.F);
|
|
1125
|
+
olympe.sc.logic.dd.O.j=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Oa(olympe.sc.logic.dd.D,b,c);return b.X()};olympe.sc.logic.dd.prototype.ua.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.dd.prototype.ha.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);function An(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.pb.R))?d:a.db.Jb(a,olympe.sc.logic.pb.H),f=a.db.Jb(a,olympe.sc.logic.pb.N);if(null!==e&&null!==f){d=a.db.Qf(Nn(a),olympe.dm.De)?new olympe.C.Xb('Pipe Context'):null;const k=a.j.bind(a,c,d);let l;const n=b.cl(f,p=>{let q;null==(q=l)||q();l=p.on(e,k,f)});return()=>{k(null);n();let p;null==(p=l)||p()}}const g=k=>c(olympe.dc.mb.Bc(k)),h=Lg(a.db,a,olympe.sc.logic.pb.valueProp,g);return()=>{g(null);Mg(a.db,a,olympe.sc.logic.pb.valueProp,
|
|
1126
|
+
h)}}function Nn(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.pb.D);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.pb.j))&&(b=a.db.Jb(c,olympe.sc.logic.Ub.typeRel));return b||olympe.dc.fa(olympe.dc.CloudObject)}
|
|
1126
1127
|
olympe.sc.logic.pb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.G=c}j(a,b,c){const d=olympe.sc.ij(c);null==b||b.lg();b&&d instanceof olympe.dm.De?null==b||b.run(()=>{olympe.C.Sc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Pf(olympe.sc.logic.pb.valueProp,a||olympe.dc.mb.ij,Object)}getType(){const a=this.transform(olympe.sc.logic.pb.j,olympe.sc.logic.Ub.typeRel);a.Md(olympe.dc.CloudObject);return a.Gc()}wy(){return this.Pc(olympe.sc.logic.pb.N,olympe.dc.CloudObject)}uy(){return this.Pc(olympe.sc.logic.pb.R,
|
|
1127
|
-
olympe.sc.logic.Gb)}vy(){return this.Pc(olympe.sc.logic.pb.H,olympe.dm.Property)}Ox(){return this.Pc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}Mx(){return this.Pc(olympe.sc.logic.pb.j,olympe.sc.logic.vb)}Nx(){return this.Pc(olympe.sc.logic.pb.D,olympe.dm.Property)}};olympe.sc.logic.pb.O=olympe.dc.
|
|
1128
|
+
olympe.sc.logic.Gb)}vy(){return this.Pc(olympe.sc.logic.pb.H,olympe.dm.Property)}Ox(){return this.Pc(olympe.sc.logic.pb.F,olympe.dc.CloudObject)}Mx(){return this.Pc(olympe.sc.logic.pb.j,olympe.sc.logic.vb)}Nx(){return this.Pc(olympe.sc.logic.pb.D,olympe.dm.Property)}};olympe.sc.logic.pb.O=olympe.dc.oa.j('0168a431d91f25780000',olympe.sc.logic.pb,olympe.sc.P.Ca);olympe.sc.logic.pb.valueProp=olympe.sc.logic.pb.O.ka('0168a431d91f25780001');olympe.sc.logic.pb.N=olympe.sc.logic.pb.O.sa('0168a431d91f25780002');
|
|
1128
1129
|
olympe.sc.logic.pb.R=R(olympe.sc.logic.pb.O,olympe.sc.logic.Gb.D);olympe.sc.logic.pb.H=olympe.sc.logic.pb.O.sa('0168a431d91f25780004');olympe.sc.logic.pb.F=olympe.sc.logic.pb.O.sa('0168a431d91f2578000a');olympe.sc.logic.pb.j=R(olympe.sc.logic.pb.O,olympe.sc.logic.vb.D);olympe.sc.logic.pb.D=olympe.sc.logic.pb.O.sa('0168a431d91f2578000c');R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.N);R(olympe.dm.Property.O,olympe.sc.logic.pb.H);R(olympe.dc.CloudObject.O,olympe.sc.logic.pb.F);
|
|
1129
|
-
R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.wy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.uy.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.vy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.Ox.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Mx.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Nx.K=new olympe.C.J(()=>olympe.dm.Property,[]);function
|
|
1130
|
+
R(olympe.dm.Property.O,olympe.sc.logic.pb.D);m=olympe.sc.logic.pb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.wy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.uy.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.vy.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.Ox.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Mx.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Nx.K=new olympe.C.J(()=>olympe.dm.Property,[]);function On(a,b){const c=a.rd(),d=c.Zl().X(),e=c.$l().X(),f=c.am().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.ub.get(a.ac(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=Rm(k.message,k.code,k.ne()+'\n===== Remote Call =====\n'+b.ne()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Wb().name()}" (${a.tag}) encountered an error:\n${k}`;a.G.error(k);b.throw(olympe.sc.logic.Error.create(k,
|
|
1130
1131
|
400))})}},b.T())}
|
|
1131
|
-
function
|
|
1132
|
-
olympe.sc.logic.Lh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Lh.D)?(
|
|
1133
|
-
k.destroy()},this.timeout);
|
|
1134
|
-
1))})},h=>{const k=this.ac();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Lh.O=olympe.dc.
|
|
1135
|
-
olympe.sc.logic.
|
|
1136
|
-
olympe.sc.logic.Rb.Og.O=
|
|
1137
|
-
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Af=class extends olympe.sc.logic.xd{Eu(){return this.j('017ffe02381f9fac5060')}Hu(){return this.j('017ffe02381f9fac5061')}Iu(){return this.j('017ffe02381f9fac5062')}Kx(){return this.j('017ffe02381f9fac5065')}Fu(){return this.D('017ffe02381f9fac5063')}Gu(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Af.O=
|
|
1138
|
-
olympe.sc.workflow.Af.af='017ffe02381f9fac5062';olympe.sc.workflow.Af.ha='017ffe02381f9fac5065';olympe.sc.workflow.Af.H='017ffe02381f9fac5063';olympe.sc.workflow.Af.vc='017ffe02381f9fac5064';m=olympe.sc.workflow.Af.prototype;m.Eu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Hu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Iu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Kx.K=new olympe.C.J(()=>Map,[]);m.Fu.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Gu.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.workflow.Ye=class extends olympe.dm.BrickMetadata{Uc(){return this.Pc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',this.la()])}};olympe.sc.workflow.Ye.O=olympe.dc.
|
|
1139
|
-
olympe.sc.workflow.Transition.O=olympe.dc.
|
|
1140
|
-
olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}F(){return this.dh(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Pc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.yc)}D(){return this.Pc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Ye)}};olympe.sc.workflow.Workflow.O=olympe.dc.
|
|
1132
|
+
function Pn(a,b,c,d,e,f){const g=n=>w(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.vd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Wb().name()} (${a.ac()}): ${r}`);f.bi(t).catch(u=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Wb().name()} (${a.ac()}): ${u}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
|
|
1133
|
+
olympe.sc.logic.Lh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Pa(olympe.sc.ya.j.EDITION))&&b||(this.db.Qa(this,olympe.sc.logic.Lh.D)?(en(a.j,this),this.ha(a)):(un(this,a),On(this,a)))}ha(a){const b=this.ac(),c=this.rd(),d=c.Op().X(),e=c.Zl().X(),f=c.$l().X(),g=c.am().X();(new olympe.L.ub(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Yh('remote call'),l=h.body(),n=wc(()=>{h.bi(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
|
|
1134
|
+
k.destroy()},this.timeout);Pn(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.mi().then(p=>{var q=k.get(d);null!==q&&olympe.dc.fa(q)!==p&&(q=this.ac(),this.G.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))}).catch(p=>{const q=this.ac();this.G.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
|
|
1135
|
+
1))})},h=>{const k=this.ac();this.G.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Lh.O=olympe.dc.oa.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.Lh,olympe.sc.P.Ca,new olympe.W.pa(olympe.sc.U.Lq));olympe.sc.logic.Lh.D=olympe.sc.logic.Lh.O.ka('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Wl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Wl.j={mA:-1,mB:1};olympe.sc.logic.controllers.dC=class extends olympe.sc.logic.controllers.Wl{constructor(){super(olympe.sc.logic.md.j)}};olympe.sc.logic.controllers.lC=class extends olympe.sc.logic.controllers.Wl{constructor(){super(olympe.sc.logic.Ub.typeRel)}};olympe.sc.logic.Nk={};olympe.sc.logic.Nk.cw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.fa(b);d?olympe.dc.ma.Pb(a,d,olympe.dc.Lb.fg).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.G.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.oa.j('0174bf4b7e006e4b788a',olympe.sc.logic.Nk.cw);olympe.sc.logic.actions={};olympe.sc.logic.Nk.Uu=class extends olympe.sc.logic.Function{run(a){un(this,a);const [b,c,d]=yn(this,a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.G.warn('No list to iter upon'),this.G.info(a.T())):f<e?(b(g.gf(f)),f++,c(Date.now())):(gn(h.j),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.og();f=0;fn(h.j);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
|
|
1136
|
+
olympe.sc.logic.oa.j('0171889b060b6cd54300',olympe.sc.logic.Nk.Uu);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.Ll=class extends olympe.sc.logic.xd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Rb.Ll.O=Kn('0169b6876a03f14ae61b',olympe.sc.logic.Rb.Ll);olympe.sc.logic.Rb.Ll.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);let Qn=null;olympe.sc.logic.Rb.Xl=class extends olympe.sc.logic.xd{R(){return this.j('016ac63808535703691c')}F(a){if(null===Qn){let b;Qn=null!=(b=olympe.W.getParameter('sc.event.experimental'))?b:!1}return Qn?a.observe(rn(this)[0]):super.F(a)}};olympe.sc.logic.Rb.Xl.O=Kn('0169b6876a03f139d50a',olympe.sc.logic.Rb.Xl);olympe.sc.logic.Rb.Xl.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.om=class extends olympe.sc.logic.xd{R(){return this.j('016ac63809a9a8e6db96')}$(){return this.D('016ac6380ab003363b3e')}};Kn('01646ad602f933b8caaf',olympe.sc.logic.Rb.om);olympe.sc.logic.Rb.om.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.om.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.gk=class extends olympe.sc.logic.xd{R(){return this.j('016ac6380bd98f1d91a0')}da(){return this.D('016ac63c589ae38ca3ae')}$(){return this.D('016ac63c5a377fceabaa')}};Kn('0168ec42fc01747a98b6',olympe.sc.logic.Rb.gk);olympe.sc.logic.Rb.gk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.gk.prototype.da.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.gk.prototype.$.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.Og=class extends olympe.sc.logic.xd{Zl(){return this.j('017a7b07b09e3b22c8b4')}Op(){return this.j('017a7b07ba05807a74b0')}$l(){return this.D('017a7b0818c12388d731')}am(){return this.D('017a7b085146d5e69aec')}Du(){return olympe.C.ea.D}};olympe.sc.logic.Rb.Og.H='017a7b07b09e3b22c8b4';olympe.sc.logic.Rb.Og.vc='017a7b07ba05807a74b0';olympe.sc.logic.Rb.Og.ha='017a7b0818c12388d731';olympe.sc.logic.Rb.Og.j='017a7b085146d5e69aec';
|
|
1137
|
+
olympe.sc.logic.Rb.Og.O=Kn('017a7b07a948e30508fa',olympe.sc.logic.Rb.Og,olympe.sc.logic.Lh);m=olympe.sc.logic.Rb.Og.prototype;m.Zl.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Op.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.$l.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.am.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Du.K=olympe.C.J.N;olympe.sc.logic.Rb.mr=class extends olympe.sc.logic.xd{R(){return this.j('016ac63c5b3ed0562740')}};Kn('016a9766c230916ea5ec',olympe.sc.logic.Rb.mr);olympe.sc.logic.Rb.mr.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.query={};olympe.sc.query.Vn=class extends olympe.sc.Hg{};olympe.sc.query.Vn.O=olympe.dc.oa.j('01631aacd8276ea98491',olympe.sc.query.Vn);olympe.sc.query.uq=class extends olympe.dm.Enum{};olympe.sc.query.uq.O=olympe.dc.oa.j('01631aacd8276ea98495',olympe.sc.query.uq);olympe.sc.query.Eq=class extends olympe.dm.Enum{};olympe.sc.query.Eq.O=olympe.dc.oa.j('01631aacd8276ea98494',olympe.sc.query.Eq);olympe.sc.query.Hq=class extends olympe.sc.Hg{};olympe.sc.query.Hq.O=olympe.dc.oa.j('01631aacd8276ea98492',olympe.sc.query.Hq);olympe.sc.query.nc=class extends olympe.dc.CloudObject{};olympe.sc.query.nc.O=olympe.dc.oa.j('01631aacd8276ea98493',olympe.sc.query.nc);olympe.sc.xo=class extends olympe.dc.CloudObject{};olympe.sc.xo.O=olympe.dc.oa.j('018312ceeb3e93618a85',olympe.sc.xo);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.O=olympe.dc.oa.j('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13a');
|
|
1138
|
+
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ka('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Af=class extends olympe.sc.logic.xd{Eu(){return this.j('017ffe02381f9fac5060')}Hu(){return this.j('017ffe02381f9fac5061')}Iu(){return this.j('017ffe02381f9fac5062')}Kx(){return this.j('017ffe02381f9fac5065')}Fu(){return this.D('017ffe02381f9fac5063')}Gu(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Af.O=Kn('017ffde21f5fe0f704ce',olympe.sc.workflow.Af);olympe.sc.workflow.Af.j='017ffe02381f9fac5060';olympe.sc.workflow.Af.$e='017ffe02381f9fac5061';
|
|
1139
|
+
olympe.sc.workflow.Af.af='017ffe02381f9fac5062';olympe.sc.workflow.Af.ha='017ffe02381f9fac5065';olympe.sc.workflow.Af.H='017ffe02381f9fac5063';olympe.sc.workflow.Af.vc='017ffe02381f9fac5064';m=olympe.sc.workflow.Af.prototype;m.Eu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Hu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Iu.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Kx.K=new olympe.C.J(()=>Map,[]);m.Fu.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Gu.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.workflow.Ye=class extends olympe.dm.BrickMetadata{Uc(){return this.Pc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',this.la()])}};olympe.sc.workflow.Ye.O=olympe.dc.oa.j('017ffdc2dda51d46b430',olympe.sc.workflow.Ye);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.vs()}j(){return this.Pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ye)}F(){return this.Pc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Ye)}Uc(){const a=this.Pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ye);return a.Pc(olympe.sc.workflow.Workflow.statesRel.$b(),olympe.sc.workflow.Workflow).la().concat(['.',a.la(),'->',this.la()])}};
|
|
1140
|
+
olympe.sc.workflow.Transition.O=olympe.dc.oa.j('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.ka('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.sa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.D.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
|
|
1141
|
+
olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}F(){return this.dh(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Pc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.yc)}D(){return this.Pc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Ye)}};olympe.sc.workflow.Workflow.O=olympe.dc.oa.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ka('017ffdc010e5bcc9c972');
|
|
1141
1142
|
olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.sa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.F.K=olympe.C.J.N;olympe.sc.workflow.Workflow.prototype.j.K=new olympe.C.J(()=>olympe.sc.yc,[]);
|
|
1142
|
-
olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.qa={};olympe.sc.qa.Xc=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.Nv}};olympe.sc.qa.Xc.O=olympe.dc.
|
|
1143
|
-
olympe.sc.qa.lb.O=olympe.dc.
|
|
1144
|
-
olympe.sc.qa.lb.$=olympe.sc.qa.lb.O.ka('011203300000000adefd');olympe.sc.qa.lb.N=olympe.sc.qa.lb.O.ka('011203300000000adefe');olympe.sc.qa.lb.R=olympe.sc.qa.lb.O.ka('011203300000000adeff');olympe.sc.qa.lb.F=olympe.sc.qa.lb.O.ka('011203300000000adee0');olympe.sc.qa.lb.oc={INIT:0,$z:1,xk:2,wk:3,
|
|
1145
|
-
m.zx.K=olympe.C.J.D;m.ly.K=olympe.C.J.D;m.Ju.K=olympe.C.J.D;olympe.sc.qa.
|
|
1146
|
-
olympe.sc.qa.Xe.O.j=(a,b,c)=>{b=
|
|
1143
|
+
olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.Ye,[]);olympe.sc.qa={};olympe.sc.qa.Xc=class extends olympe.sc.Ua{qe(){return olympe.sc.se.Ie.Nv}};olympe.sc.qa.Xc.O=olympe.dc.oa.j('01120300000000adef00',olympe.sc.qa.Xc);olympe.sc.qa.Xc.j=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Xc.ha=olympe.sc.qa.Xc.O.sa('0171bc1f15da96dfdb90');R(olympe.dm.Mc.O,olympe.sc.qa.Xc.j);olympe.sc.qa.ri=class extends olympe.sc.Runnable{F(){return[this.ac()]}ha(){return olympe.dc.nd.from(this.ac()).fb(olympe.sc.qa.Xc.j).Fc()}};olympe.sc.qa.ri.O=Of(olympe.dc.oa.j('0113030000000aca1100',olympe.sc.qa.ri));olympe.sc.qa.ri.prototype.ha.K=new olympe.C.J(()=>olympe.dm.ib,[]);olympe.sc.qa.lb=class extends olympe.dc.CloudObject{Ku(){return this.dh(olympe.sc.qa.lb.Vh)}Zy(){return this.dh(olympe.sc.qa.lb.ha)}Hc(){return this.sd(olympe.sc.qa.lb.j)}Qx(){return this.wb(olympe.sc.qa.lb.H)}ny(){return this.wb(olympe.sc.qa.lb.da)}my(){return this.wb(olympe.sc.qa.lb.Y)}Lf(){return this.wb(olympe.sc.qa.lb.$)}$x(){return this.wb(olympe.sc.qa.lb.N)}zx(){return this.wb(olympe.sc.qa.lb.D)}ly(){return this.wb(olympe.sc.qa.lb.R)}Ju(){return this.wb(olympe.sc.qa.lb.F)}};
|
|
1144
|
+
olympe.sc.qa.lb.O=olympe.dc.oa.j('011203300000000adef5',olympe.sc.qa.lb);olympe.sc.qa.lb.Vh=olympe.sc.qa.lb.O.ka('011203300000000adef6');olympe.sc.qa.lb.ha=olympe.sc.qa.lb.O.ka('011203300000000adef7');olympe.sc.qa.lb.j=olympe.sc.qa.lb.O.ka('011203300000000adef8');olympe.sc.qa.lb.H=olympe.sc.qa.lb.O.ka('011203300000000adef9');olympe.sc.qa.lb.da=olympe.sc.qa.lb.O.ka('011203300000000adefa');olympe.sc.qa.lb.Y=olympe.sc.qa.lb.O.ka('011203300000000adefb');olympe.sc.qa.lb.D=olympe.sc.qa.lb.O.ka('011203300000000adefc');
|
|
1145
|
+
olympe.sc.qa.lb.$=olympe.sc.qa.lb.O.ka('011203300000000adefd');olympe.sc.qa.lb.N=olympe.sc.qa.lb.O.ka('011203300000000adefe');olympe.sc.qa.lb.R=olympe.sc.qa.lb.O.ka('011203300000000adeff');olympe.sc.qa.lb.F=olympe.sc.qa.lb.O.ka('011203300000000adee0');olympe.sc.qa.lb.oc={INIT:0,$z:1,xk:2,wk:3,Am:4,FC:5,Ab:9};m=olympe.sc.qa.lb.prototype;m.Ku.K=olympe.C.J.N;m.Zy.K=olympe.C.J.N;m.Hc.K=olympe.C.J.F;m.Qx.K=olympe.C.J.D;m.ny.K=olympe.C.J.D;m.my.K=olympe.C.J.D;m.Lf.K=olympe.C.J.D;m.$x.K=olympe.C.J.D;
|
|
1146
|
+
m.zx.K=olympe.C.J.D;m.ly.K=olympe.C.J.D;m.Ju.K=olympe.C.J.D;olympe.sc.qa.Ul=class extends olympe.sc.qa.ri{D(a){a.set(olympe.sc.ya.j.Ln,!0);super.D(a)}da(){return!0}};olympe.sc.qa.Ul.O=olympe.dc.oa.j('0113032000000aca1102',olympe.sc.qa.Ul,olympe.sc.P.Ca);olympe.sc.qa.Xe=class extends olympe.sc.qa.Xc{j(){return(new olympe.dc.ck(this.X(),olympe.sc.qa.lb)).fb(olympe.sc.qa.Xe.H).Ki().Gc()}};olympe.sc.qa.Xe.O=olympe.dc.oa.j('011203300000000adef3',olympe.sc.qa.Xe);olympe.sc.qa.Xe.H=olympe.sc.qa.Xe.O.sa('011203300000000adef4');R(olympe.sc.qa.lb.O,olympe.sc.qa.Xe.H);
|
|
1147
|
+
olympe.sc.qa.Xe.O.j=(a,b,c)=>{b=Cl(a,b||'New Service Application model',olympe.sc.qa.Xe,olympe.sc.qa.Ul);a.Oa(olympe.sc.qa.Xc.j,b,c);c=a.create(olympe.sc.qa.lb).X();a.Oa(olympe.sc.qa.Xe.H,b,c);return b.X()};olympe.sc.qa.Xe.prototype.j.K=new olympe.C.J(()=>olympe.sc.qa.lb,[]);olympe.sc.Ug=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Ug.O=olympe.dc.oa.j('011203300000000adf00',olympe.sc.Ug);olympe.sc.Ug.D=olympe.sc.Ug.O.ka('011203300000000adf01');olympe.sc.Ug.j=olympe.sc.Ug.O.ka('011203300000000adf02');olympe.sc.Ug.F='011203300000000adf0f';olympe.sc.sg={};olympe.sc.sg.Py=a=>{var b=a.j;const c=olympe.dc.ia();var d=null;var e=null===En;for(const f of b.Rc())if((b=f.Wb())&&f.D()&&f.sb()===olympe.dc.Ja.SERVER&&Z(a,f.tag())&&c.Ob(b,olympe.sc.yc)){if(!e)throw new olympe.dc.kq;let g,h;null==d&&(d=null,null!==Dn?d=Dn:'string'===typeof Cn&&(d=olympe.dc.nd.from(Cn).fb(olympe.sc.qa.Xc.j).fb(olympe.sc.nf.j.$b()).Fc()),d=null==(g=d)?void 0:g.X());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.fa(b)}`);a.Oa(olympe.sc.nf.D.X(),
|
|
1147
1148
|
d,f.tag())}};
|
|
1148
1149
|
olympe.sc.sg.az=a=>{const b=a.j,c=olympe.dc.ia();for(const d of b.Rc()){const e=d.Wb();e&&!d.td()&&c.Ob(e,olympe.sc.yc)&&d.Db().forEach((f,g)=>{if(f instanceof olympe.dc.uc){const l=b.Qc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Wb())?h:null;h=l.tag();let n;if(f===olympe.dc.fa(olympe.sc.Pd)){h=l.Jb(olympe.sc.Pd.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
|
|
1149
|
-
let p;f=null!=(p=null==(k=b.Qc(h))?void 0:k.Wb())?p:c.model(h)}if(c.Qf(f,olympe.dm.De)){k=
|
|
1150
|
+
let p;f=null!=(p=null==(k=b.Qc(h))?void 0:k.Wb())?p:c.model(h)}if(c.Qf(f,olympe.dm.De)){k=Lm(f);let p;n=null!=(p=l.Qa(k.X()))?p:c.Qa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Wc(d.tag(),new Map([[g,n]]));wl(a,l.tag(),olympe.dc.Lb.Dc)}})}};
|
|
1150
1151
|
olympe.sc.sg.Vw=a=>{const b=a.j,c=olympe.dc.ia(),d=new Set;for(var e of b.Bb.values()){a=e.tag();let f;const g=null!=(f=e.Wb())?f:c.model(a);if(null!==g&&e.Id()&&(d.has(g)||c.Ob(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.ha()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.fc.Yc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Qc(k))?void 0:l.Wb())?n:c.model(k);return!p||!(d.has(p)||c.Ob(p,olympe.sc.yc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Qc(h))?void 0:k.Wb())?l:c.model(h))?
|
|
1151
1152
|
n:'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.sg.pz=a=>{var b=a.j;const c=olympe.dc.ia();for(const d of b.Rc()){b=d.tag();const e=d.Wb();if(e&&!c.Ob(e,olympe.sc.yc)&&Z(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
|
|
1152
|
-
olympe.W.run([olympe.dc.transaction.P.Da],a=>{
|
|
1153
|
-
typeof c?c:olympe.dc.ae().fromModel(a);a=this.j.create(a,d).ki(c);for(const [e,f]of b)Y(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}Fs(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Gd.set(olympe.dc.fa(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}hc(a,b,c){this.j.hc(a,b,c);return this}
|
|
1154
|
-
return this.persist(a,b)}ki(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){
|
|
1155
|
-
olympe.sc.Wa.prototype.merge=olympe.sc.Wa.prototype.merge;olympe.sc.Wa.prototype.model=olympe.sc.Wa.prototype.model;olympe.sc.Wa.prototype.setSource=olympe.sc.Wa.prototype.ki;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.oz;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype
|
|
1156
|
-
olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.Fs;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.T;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.bj=class{constructor(a){this.j=a}Hx(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.bj.prototype.getCreatedObjects=olympe.sc.bj.prototype.Hx;olympe.xc={};olympe.xc.bt=class{run(){}};function
|
|
1153
|
+
olympe.W.run([olympe.dc.transaction.P.Da],a=>{Il(Il(Il(a,olympe.sc.sg.Vw,'businessDataRelations'),olympe.sc.sg.Py,'linkBusinessContainer'),olympe.sc.sg.az,'noBusinessComplexProperty')});olympe.sc.Oj=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Oj.O=olympe.dc.oa.j('01645fe6873aeea59e64',olympe.sc.Oj);olympe.sc.Oj.j=olympe.sc.Oj.O.sa('017ed8ac775f48d4d589');olympe.sc.uo=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.uo.O=olympe.dc.oa.j('0163a68ce44f3d1fa95d',olympe.sc.uo);olympe.sc.ph=class extends olympe.dm.BrickMetadata{};olympe.sc.ph.O=olympe.dc.oa.j('016324fde11a836f77d3',olympe.sc.ph);olympe.sc.ph.j=olympe.sc.yc.O.sa('016324fde11a836088d3');olympe.sc.ph.O.j=(a,b)=>Cl(a,null!=b?b:'New config type',olympe.sc.ph).X();olympe.sc.iA=class{};olympe.sc.Sj=class extends olympe.dm.BrickMetadata{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.Sj.O=olympe.dc.oa.j('017dc8d6c8fd8c8bd2ff',olympe.sc.Sj);olympe.sc.Sj.O.j=(a,b)=>Cl(a,null!=b?b:'New data connector',olympe.sc.Sj,olympe.dm.DataSource).X();olympe.sc.ue=class extends olympe.sc.Runnable{ua(){return this.bb(olympe.sc.ue.F,olympe.sc.Runnable)}ha(){return this.bb(olympe.sc.ue.D,olympe.dm.Property)}};olympe.sc.ue.O=Of(olympe.dc.oa.j('016c2d996d9ca27fa9d8',olympe.sc.ue));olympe.sc.ue.F=olympe.sc.ue.O.sa('016c3cb7742ec9309e0b');olympe.sc.ue.D=olympe.sc.ue.O.sa('016c42d3454636f90533');olympe.sc.ue.prototype.ua.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.ue.prototype.ha.K=new olympe.C.J(()=>olympe.dc.za,[]);olympe.sc.To=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.rh}};olympe.sc.To.O=olympe.dc.oa.j('017a7a9ff057958e5678',olympe.sc.To);olympe.sc.Ai=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ha(b)&&f.Rc(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.sc.Ai.create=olympe.sc.Ai.create;olympe.sc.Ai.O=olympe.dc.oa.j('016cdd861b32d56c8208',olympe.sc.Ai);olympe.sc.Xp=class extends olympe.dm.Kb{qe(){return olympe.sc.se.Ie.mw}};olympe.sc.Xp.O=olympe.dc.oa.j('01644b6d4543b344b857',olympe.sc.Xp);olympe.sc.Yp=class extends olympe.dc.CloudObject{};olympe.sc.Yp.O=olympe.dc.oa.j('0162f672366be5ca7a86',olympe.sc.Yp);const Rn={So:30};olympe.sc.cc=class extends olympe.dc.sources.cc{D(a){return a instanceof olympe.sc.logic.Error?this.format(Rn.So,{c:a.code,m:a.message,s:a.ne()}):super.D(a)}j(a){return(null==a?void 0:a.t)===Rn.So?(a=a.v,Rm(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Pd.O.X()){const b=olympe.sc.Pd.j;this.F.get(a).r.push({r:b.X(),o:a,d:this.db.Jb(a,b)})}return a}};olympe.sc.nr=class extends olympe.sc.ue{};olympe.sc.nr.O=olympe.dc.oa.j('016d3f37610ae4fc3962',olympe.sc.nr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.oa.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Wa=class{constructor(a=!0){a=Al(a);a.N=!0;var b=olympe.sc.sg.pz;let c;(null==(c=olympe.W.getParameter(olympe.dc.transaction.U.Il))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.ya.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Wa}static process(a,b){return a.has(olympe.sc.ya.j.TRANSACTION,!0)?Promise.resolve(!1):b.nb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c='string'===
|
|
1154
|
+
typeof c?c:olympe.dc.ae().fromModel(a);a=this.j.create(a,d).ki(c);for(const [e,f]of b)Y(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}Fs(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Gd.set(olympe.dc.fa(c),b);return this}delete(a){this.j.delete(a);return this}Oa(a,b,c){this.j.Oa(a,b,c);return this}hc(a,b,c){this.j.hc(a,b,c);return this}$m(a,b){this.j.$m(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}oz(a,b=!0){olympe.ja.ab('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
|
|
1155
|
+
return this.persist(a,b)}ki(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Bl(this.j,a.j);return this}Sm(a){this.j.Sm(a);return this}nb(){return new Promise((a,b)=>{this.j.nb((c,d)=>{c?a(new olympe.sc.bj(this.D)):b(d)})})}an(){return new Promise((a,b)=>{this.j.an((c,d)=>{c?a(new olympe.sc.bj(this.D)):b(d)})})}};olympe.sc.Wa.prototype.executeAsLarge=olympe.sc.Wa.prototype.an;olympe.sc.Wa.prototype.execute=olympe.sc.Wa.prototype.nb;olympe.sc.Wa.prototype.afterExecution=olympe.sc.Wa.prototype.Sm;
|
|
1156
|
+
olympe.sc.Wa.prototype.merge=olympe.sc.Wa.prototype.merge;olympe.sc.Wa.prototype.model=olympe.sc.Wa.prototype.model;olympe.sc.Wa.prototype.setSource=olympe.sc.Wa.prototype.ki;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.oz;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.$m;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.hc;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Oa;
|
|
1157
|
+
olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.Fs;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.T;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.bj=class{constructor(a){this.j=a}Hx(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.bj.prototype.getCreatedObjects=olympe.sc.bj.prototype.Hx;olympe.xc={};olympe.xc.bt=class{run(){}};function Sn(a,b='default'){return a.j===b}
|
|
1157
1158
|
olympe.xc.Ta=class{constructor(a,b){this.j=a;this.G=b;this.D=null;this.F='';this.G.info('HC Manager will execute application registered as:',this.j)}Aj(a,b,c=''){b||(b='default');b===this.j?(null===this.D?this.G.log('Application',c,'designated to be launched'):this.G.log('OVERRIDE: Application',c,'designated to be launched'),this.D=a,this.F=c):this.G.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.j)}run(){null!==this.D?(this.G.info('Running application:',this.F),
|
|
1158
|
-
this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.Aj=function(a,b,c='default'){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Pe+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.rd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.Aj(e,c,b),e=>
|
|
1159
|
-
olympe.W.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function
|
|
1160
|
-
function
|
|
1161
|
-
h.Ob(l,olympe.sc.ph)},{jd:
|
|
1162
|
-
{jd:h,Kk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return
|
|
1163
|
-
function
|
|
1164
|
-
a.G.info(`Application ${olympe.dc.ia().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.Zd();k.Mb=!0;k.Y+=0;k.Rd.next(0<k.Y);0===k.Y&&k.$&&k.Mb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.$a.set('__code-as-data-version__',k.version),k.zb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else
|
|
1165
|
-
3E4);let e;null==(e=a.Mb)||e.start()}}function
|
|
1166
|
-
olympe.sc.Ib.
|
|
1167
|
-
c=olympe.L.tc.j.Ae,d=olympe.L.tc.j.Wd;olympe.C.Sc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,
|
|
1159
|
+
this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.xc.Aj=function(a,b,c='default'){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Pe+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.rd(olympe.xc.P.Da).config(c,[b],(e,f)=>f.Aj(e,c,b),e=>Sn(e,c),'olympe.hc.registerApp')};olympe.xc.P={Da:'hc.Manager',Ca:'hc.Logger'};olympe.xc.U={Pe:'hc.app',kp:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.xc.U.Pe,'default');F(a,olympe.xc.U.kp,!1);E(a,olympe.xc.P.Ca,[olympe.ja.P.Da],b=>b.cd('hc'));E(a,olympe.Eb.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe)],b=>b);E(a,olympe.auth.P.kl,[olympe.Eb.P.Sg,new olympe.W.pa(olympe.xc.U.kp)],(b,c)=>new olympe.auth.Un(c?'':b));D(a,olympe.xc.P.Da,olympe.xc.Ta,new olympe.W.pa(olympe.xc.U.Pe),olympe.xc.P.Ca)},'olympe.hc');
|
|
1160
|
+
olympe.W.run([olympe.xc.P.Da],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function Tn(a){a.Y=a.F.F(()=>w(function*(){return Un(a)}),'Stop application')}function Vn(a){a.R=a.F.j(()=>olympe.C.Pa(a.$)===olympe.C.ea.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Ee.j.READINESS)}
|
|
1161
|
+
function Wn(a){if(a.ua)return a.G.debug('Sending getContext request'),oi(a.Ga).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;En=null;Cn=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=Pm(a.D);!b&&Mk();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Cb(),d=new Promise((f,g)=>{const h=olympe.dc.ia(),k=new olympe.C.Xb('Primordial Subscription Context',c);ci(k,a.j,l=>{l=h.ji(l)?l:h.model(l);return null!==l&&
|
|
1162
|
+
h.Ob(l,olympe.sc.ph)},{jd:Xn(b),En:!0,zs:!0}).subscribe(rxjs.Subscriber.create(c.rc(()=>{h.Ob(a.j,olympe.sc.qa.Xc)?(a.$a.Y(a.j,b),f()):id(a.N)?g(Error(`The specified application tag (${a.j}) is not an application or does not exist`)):(k.destroy(),a.N.connect().catch(l=>{g(Error(`Failed to load the app while offline, you might want to try again when online: ${l}`))}))}),l=>g(l)))}),e=new Promise(f=>{olympe.C.Sc([a.ha.pe()],g=>{const h=Xn(b,!1);olympe.dc.ma.Ke(g,olympe.dm.User,olympe.dc.Ja.SERVER).observe(c,
|
|
1163
|
+
{jd:h,Kk:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.da)return Yn(a);Yn(a).then(()=>{})})}
|
|
1164
|
+
function Zn(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ia();if(0<a.j.length){const c=sf(b,a.j,a.D.Cb().rc((f,g)=>{if(f)if(f=tn(g),f instanceof olympe.sc.qa.ri){a.G.debug('application retrieved: running');g=Mm(a.D,f);const h=new olympe.sc.Ya.zv(a.H);jb(a.H,()=>Zm(a.D.j,h));kb(a.H,()=>{var k=h.T();return an(a.D.j,k)});a.jb&&a.H.start();f.run(g);'string'===typeof a.zb&&(new olympe.sc.Xd).da(f.X(),g,a.G);g.Us(olympe.sc.ya.j.Ln).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.ea.D);
|
|
1165
|
+
a.G.info(`Application ${olympe.dc.ia().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.Zd();k.Mb=!0;k.Y+=0;k.Rd.next(0<k.Y);0===k.Y&&k.$&&k.Mb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.$a.set('__code-as-data-version__',k.version),k.zb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else Un(a)}));olympe.C.Xa().onDestroy(()=>{qf(b,a.j,c)});const d=wc(()=>{a.G.warn(`requested application ${a.j} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
|
|
1166
|
+
3E4);let e;null==(e=a.Mb)||e.start()}}function Xn(a,b=!0){return a?olympe.dc.ma.nc.Jg:b?olympe.dc.ma.nc.rf:olympe.dc.ma.nc.lk}function Yn(a){return w(function*(){$n(a.j)&&(yield Fn(a.j,a.da).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function Un(a){a.G.info('Stop the application');a.D.Cb().lg();a.F.D(a.R);a.F.R(a.Y)}
|
|
1167
|
+
olympe.sc.Ib.zm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ha=b;this.N=c;this.Ga=d;this.F=e;this.Y=this.R='';this.D=f;this.$a=g;this.H=h;this.Mb=l;this.j=k.get('appTag');this.ua=k.get('getContextMode');let n;this.zb=null!=(n=k.get('debuggerName'))?n:null;this.jb=k.get('autostartProfiler');this.da=k.get('requireBusinessContainer');this.$=olympe.C.bc(olympe.C.ea).update(olympe.C.ea.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;Tn(this);Vn(this);const b=olympe.L.tc.j.Ri,
|
|
1168
|
+
c=olympe.L.tc.j.Ae,d=olympe.L.tc.j.Wd;olympe.C.Sc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,Wn(this).then(olympe.C.Xa().rc(()=>Zn(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.zm.j='app_instance';olympe.sc.Ib.zm.xa=[olympe.xc.bt];olympe.sc.Ib.Lv=class{constructor(a,b,c,d){this.G=a;this.D=b;this.F=d.get('httpManifestPath');this.j=d.get('manifestCommon');if(!this.j)this.j={};else if('string'===typeof this.j)try{this.j=JSON.parse(this.j)}catch(e){this.G.warn('Invalid manifest common config'),this.j={}}}start(){const a=b=>{this.G.debug('Request URL',b.j());const c=(new URL(b.j())).searchParams.get('origin');if(c)return c;b=b.qj();this.G.debug('Request headers',b);return b.origin?b.origin:b.uz?(new URL(b.uz)).origin:b[olympe.net.wa.Headers.ap]&&
|
|
1168
1169
|
b[olympe.net.wa.Headers.bp]?b[olympe.net.wa.Headers.bp]+'://'+b[olympe.net.wa.Headers.ap]:null};this.D.F('manifest',`${this.F}/:${'appTag'}`,[olympe.net.wa.Nd.GET],(b,c)=>{const d=this;return w(function*(){var e=c.get('appTag');d.G.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.ld('Invalid appTag',olympe.net.wa.Vb.nl);try{var f=yield olympe.dc.ma.Ke(e,olympe.sc.qa.Xc).nb()}catch(h){return new olympe.net.ld(`Something went wrong: ${'string'===typeof h?
|
|
1169
|
-
h:h.message}`,olympe.net.wa.Vb.nl)}if(0===f.size())return new olympe.net.ld('App not found',olympe.net.wa.Vb.
|
|
1170
|
-
typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.ld(JSON.stringify(e),olympe.net.wa.Vb.Eh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function
|
|
1171
|
-
olympe.sc.Ib.Bk=class extends olympe.dc.sources.Bk{R(a){return this.db.Ob(a,olympe.sc.yc)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).Fc();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.nc.Jg:olympe.dc.ma.nc.rf;
|
|
1170
|
+
h:h.message}`,olympe.net.wa.Vb.nl)}if(0===f.size())return new olympe.net.ld('App not found',olympe.net.wa.Vb.hm);var g=a(b);f=f.Gc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.W.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
|
|
1171
|
+
typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.ld(JSON.stringify(e),olympe.net.wa.Vb.Eh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function $n(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.wd.F.$b()).fb(olympe.dm.wd.j).Fc();a=olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.j).fb(olympe.dm.ib.D).Fc();return c.concat(a).has(b)}
|
|
1172
|
+
olympe.sc.Ib.Bk=class extends olympe.dc.sources.Bk{R(a){return this.db.Ob(a,olympe.sc.yc)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.nd.from(a).fb(olympe.sc.qa.Xc.j).Fc();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.nc.Jg:olympe.dc.ma.nc.rf;Dk(this,c,b);c=new olympe.C.Xb('deployed data sources');olympe.dc.ma.from(a).fb(olympe.sc.qa.Xc.ha).observe(c,{jd:b}).subscribe(d=>{const e=
|
|
1172
1173
|
new olympe.dc.Wa;d.nj().forEach(f=>{e.Oa(olympe.dm.DataSource.zj,this.j,f)});d.sj().forEach(f=>{e.hc(olympe.dm.DataSource.zj,this.j,f)});e.nb()})}}};olympe.sc.Ib.P={fg:'sc.runtime.Main',We:'sc.runtime.SourceSolver',Rq:'sc.runtime.appConfig',Tq:'sc.runtime.runtimeHTTPServiceConfig',Sq:'sc.runtime.RuntimeHTTPService',mq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={vp:'app.httpManifestPath',Vp:'app.manifest.common',Rp:'sc.loadBusinessContainer'};
|
|
1173
|
-
olympe.W.config(function(a){F(a,olympe.sc.Ib.U.vp,'/runtime/manifest');F(a,olympe.sc.Ib.U.Vp,null);F(a,olympe.sc.Ib.U.Rp,!1);E(a,olympe.Eb.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe),new olympe.W.pa(olympe.sc.U.Pe)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Ib.P.mq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.net.U.Qi),new olympe.W.pa(olympe.net.U.
|
|
1174
|
-
g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.
|
|
1175
|
-
b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));D(a,olympe.sc.Ib.P.fg,olympe.sc.Ib.
|
|
1174
|
+
olympe.W.config(function(a){F(a,olympe.sc.Ib.U.vp,'/runtime/manifest');F(a,olympe.sc.Ib.U.Vp,null);F(a,olympe.sc.Ib.U.Rp,!1);E(a,olympe.Eb.P.Sg,[new olympe.W.pa(olympe.xc.U.Pe),new olympe.W.pa(olympe.sc.U.Pe)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Ib.P.mq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.net.U.Qi),new olympe.W.pa(olympe.net.U.jm)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
|
|
1175
|
+
g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.km,olympe.sc.Ib.P.mq);D(a,olympe.sc.Ib.P.We,olympe.sc.Ib.Bk,olympe.dc.P.sh,new olympe.W.pa(olympe.dc.U.Qg),new olympe.W.pa(olympe.dc.U.Gl));Wa(a,olympe.dc.sources.P.We,olympe.sc.Ib.P.We);E(a,olympe.sc.Ib.P.Rq,[new olympe.W.pa(olympe.sc.U.Pe),new olympe.W.pa(olympe.dc.U.Mh),new olympe.W.pa(olympe.sc.U.Fo),new olympe.W.pa(olympe.sc.U.Nn),new olympe.W.pa(olympe.sc.Ib.U.Rp)],(b,c,d,e,f)=>new Map([['appTag',
|
|
1176
|
+
b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));D(a,olympe.sc.Ib.P.fg,olympe.sc.Ib.zm,olympe.sc.P.Ca,olympe.auth.P.Da,olympe.L.P.qf,olympe.dc.query.P.nk,olympe.host.P.Ue,olympe.sc.P.tk,olympe.sc.Ib.P.We,olympe.V.P.eg,olympe.sc.Ib.P.Rq,olympe.sc.Ib.P.Sq);E(a,olympe.sc.Ib.P.Tq,[new olympe.W.pa(olympe.sc.Ib.U.vp),new olympe.W.pa(olympe.sc.Ib.U.Vp)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));D(a,olympe.sc.Ib.P.Sq,olympe.sc.Ib.Lv,
|
|
1176
1177
|
olympe.sc.P.Ca,olympe.net.P.cj,olympe.sc.P.tk,olympe.sc.Ib.P.Tq);olympe.xc.Aj(a,olympe.sc.Ib.P.fg,'sc.runtime');olympe.xc.Aj(a,olympe.sc.Ib.P.fg,'sc.headless');olympe.xc.Aj(a,olympe.sc.Ib.P.fg)},'olympe.sc.runtime');olympe.public={};olympe.public.Ma=class a{static xx(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return Ve(olympe.public.Ma.get())}static Zk(b){return a.D(olympe.public.Ma.get().Zk(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static Jx(){return olympe.C.Pa(olympe.public.Ma.get().pe())}static jz(b){return a.D(olympe.public.Ma.get().pe(),b)}static oe(){var b=olympe.C,c=b.Pa;var d=olympe.public.Ma.get().j.rb().Cd();return c.call(b,
|
|
1177
1178
|
d)}static qg(){return new Promise((b,c)=>{olympe.public.Ma.get().qg(d=>d?c(d):b())})}static Vx(){return olympe.C.Pa(olympe.public.Ma.get().gi())||void 0}static yy(){const b=rd(olympe.public.Ma.get());return{user:b.Cc(),userTag:b.pe(),nonce:b.Cd(),payload:b.Ii(),idpName:b.yf(),protocol:b.Fg()}}static Ux(){return Array.from(We().keys())}static lf(){olympe.public.Ma.get().lf()}static hh(b){return new Promise((c,d)=>{olympe.public.Ma.get().hh(b,e=>e?d(e):c())})}static Sy(b,c){return olympe.public.Ma.j((new Map).set('username',
|
|
1178
1179
|
b).set('password',c),olympe.auth.Ec.j.SRP)}static Ty(b){const c=We();if(0===c.size||b&&!c.has(b)){var d=0===c.size?'There are no available IDPs':`The IDP name ${b} is not valid, the valid names are ${Array.from(c.keys())}`;return Promise.reject(d)}b?(d=b,b=c.get(b)):(b=Array.from(c)[0],d=b[0],b=b[1]);return olympe.public.Ma.j((new Map).set('idpName',d),b)}static Ry(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.SAML)}static Uy(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
|
|
1179
|
-
c),olympe.auth.Ec.j.
|
|
1180
|
+
c),olympe.auth.Ec.j.mm)}static Qy(){return olympe.public.Ma.j(new Map,olympe.auth.Ec.j.OAUTH2)}static xj(){return olympe.public.Ma.get().xj()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Ue(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.me()}static D(b,c){return b.asObservable('function'===typeof c.Cb?c.Cb():c)}};olympe.public.Ma.logout=olympe.public.Ma.xj;olympe.public.Ma.loginOpenID=olympe.public.Ma.Qy;
|
|
1180
1181
|
olympe.public.Ma.loginToken=olympe.public.Ma.Uy;olympe.public.Ma.loginSAML=olympe.public.Ma.Ry;olympe.public.Ma.loginSSO=olympe.public.Ma.Ty;olympe.public.Ma.loginSRP=olympe.public.Ma.Sy;olympe.public.Ma.getUserFromToken=olympe.public.Ma.hh;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.lf;olympe.public.Ma.getIDPNames=olympe.public.Ma.Ux;olympe.public.Ma.getUserToken=olympe.public.Ma.yy;olympe.public.Ma.getIDPToken=olympe.public.Ma.Vx;olympe.public.Ma.refreshToken=olympe.public.Ma.qg;
|
|
1181
1182
|
olympe.public.Ma.getToken=olympe.public.Ma.oe;olympe.public.Ma.observeUser=olympe.public.Ma.jz;olympe.public.Ma.getCurrentUser=olympe.public.Ma.Jx;olympe.public.Ma.isAuthenticated=olympe.public.Ma.Zk;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.xx;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.Z.tg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.bc(olympe.C.ea),e=b.subscribe(f=>d.update(olympe.C.Sb(f)));olympe.C.Xa().Td(()=>e.unsubscribe());return d.rb()}}}};
|
|
1182
|
-
olympe.public.sf=class{static create(a){return new class extends olympe.dc.wc.tg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.bc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.Xa().Td(()=>e.unsubscribe());return d.rb()}}}};olympe.public.Process=class{static kz(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.Tk(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.D(d)}static lz(a,b){const c=olympe.host.Tk(),d=c.Ga(a,b);return()=>c.R(d)}static connect(){return olympe.L.
|
|
1183
|
-
b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Sf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.lz;olympe.public.Process.onHealthCheck=olympe.public.Process.kz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.va,generateTag:olympe.V.df,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Xr,defineInverseRelation:olympe.dc.gx,BrickContext:olympe.sc.ya,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.ya.j,registerBrick:olympe.sc.logic.
|
|
1183
|
+
olympe.public.sf=class{static create(a){return new class extends olympe.dc.wc.tg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.bc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.Xa().Td(()=>e.unsubscribe());return d.rb()}}}};olympe.public.Process=class{static kz(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.Tk(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.D(d)}static lz(a,b){const c=olympe.host.Tk(),d=c.Ga(a,b);return()=>c.R(d)}static connect(){return olympe.L.dn().connect()}static disconnect(){return olympe.L.dn().disconnect()}static Sf(a){a='function'===typeof a.Cb?a.Cb():a;return olympe.L.dn().Sf().asObservable(a).pipe(rxjs.operators.map(b=>
|
|
1184
|
+
b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Sf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.lz;olympe.public.Process.onHealthCheck=olympe.public.Process.kz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.va,generateTag:olympe.V.df,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Xr,defineInverseRelation:olympe.dc.gx,BrickContext:olympe.sc.ya,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.ya.j,registerBrick:olympe.sc.logic.oa.j,FunctionBrick:olympe.sc.logic.Function,
|
|
1184
1185
|
Context:olympe.sc.ya,Entry:olympe.dc.Ra.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.sc.File,User:olympe.dm.User,Enum:olympe.dm.cg,EnumValue:olympe.sc.Ai,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.zd,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Ye,WorkflowTransition:olympe.sc.workflow.Transition,
|
|
1185
|
-
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.ti,TransactionResult:olympe.sc.bj,PredefinedDataSource:olympe.dc.Ja,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.kk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ee.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Zd().N,clearCache:a=>
|
|
1186
|
-
a),getProcessingStatus:()=>olympe.dc.sources.Zd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Zd().$c.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Zd().da.asObservable(),synchroniseChanges:()=>
|
|
1186
|
+
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.ti,TransactionResult:olympe.sc.bj,PredefinedDataSource:olympe.dc.Ja,QueryResult:olympe.dc.Ia,Query:olympe.dc.ma,QuerySingle:olympe.dc.nd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.kk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Ee.j,Cache:{getCacheEntries:()=>olympe.dc.sources.Zd().N,clearCache:a=>Tk(olympe.dc.sources.Zd(),
|
|
1187
|
+
a),getProcessingStatus:()=>olympe.dc.sources.Zd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Zd().$c.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Zd().da.asObservable(),synchroniseChanges:()=>Zk(),getPendingChanges:()=>bl(),clearPendingChanges:()=>fl(),loadPendingChanges:a=>dl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.cb.j,ServiceRequest:olympe.L.Zc,Service:olympe.L.ub,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Gj,
|
|
1187
1188
|
GUEST:olympe.auth.Ta.j.Ci,AUTHENTICATED:olympe.auth.Ta.j.mf,ERROR:olympe.auth.Ta.j.Ab},AuthProtocol:olympe.auth.Ec.j,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.kb{static get(){return olympe.dc.ia()}},ListDef:olympe.dc.za,
|
|
1188
|
-
instanceToTag:olympe.dc.fa,registerSync:olympe.dc.
|
|
1189
|
+
instanceToTag:olympe.dc.fa,registerSync:olympe.dc.oa.j,getUniqueTag:olympe.V.df,onDestroy:a=>olympe.C.Xa().onDestroy(a),offDestroy:a=>olympe.C.Xa().Tf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.ba.Ve,RecursiveRelated:olympe.dc.ba.Fe,Distinct:olympe.dc.ba.yi,Filter:olympe.dc.ba.uf,Limit:olympe.dc.ba.Bh,Sort:olympe.dc.ba.Tg,Union:olympe.dc.ba.Hf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.Z.Jd,Or:olympe.dc.Z.Be,Not:olympe.dc.Z.fe,Equals:olympe.dc.Z.ve,Contains:olympe.dc.Z.tf,
|
|
1189
1190
|
Greater:olympe.dc.Z.Zj,Smaller:olympe.dc.Z.Ak,HasRelated:olympe.dc.Z.Ei,InstanceOf:olympe.dc.Z.Hi,Regex:olympe.dc.Z.Ef},Comparator:olympe.public.sf,comparators:{Number:olympe.dc.wc.Number,String:olympe.dc.wc.String,DateTime:olympe.dc.wc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Za.Kj,StringProperty:olympe.dc.Za.Yi,NumberProperty:olympe.dc.Za.Pi,DateTimeProperty:olympe.dc.Za.xi,Constant:olympe.dc.Za.Re,Tag:olympe.dc.Za.$i}});
|
|
1190
1191
|
|
|
1191
1192
|
|