@olympeio/runtime-node 9.11.13 → 9.11.14
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
|
@@ -255,7 +255,7 @@ function w(a,b){a=a.split('.');let c=xa;a[0]in c||'undefined'==typeof c.execScri
|
|
|
255
255
|
const Ca=console.trace,Da=console.debug,Ea=console.log,Fa=console.info,Ga=console.warn,Ha=console.error;console.trace=(...a)=>Ca.call(console,Ba('TRACE',a));console.debug=(...a)=>Da.call(console,Ba('DEBUG',a));console.log=(...a)=>Ea.call(console,Ba('LOG',a));console.info=(...a)=>Fa.call(console,Ba('INFO',a));console.warn=(...a)=>Ga.call(console,Ba('WARN',a));console.error=(...a)=>Ha.call(console,Ba('ERROR',a));olympe.Xa={};olympe.Xa.node={};olympe.V={};olympe.V.Pf={};olympe.V.Pf.Zo=class{process(a){for(const b of Object.keys(a.Fe))if(a.yd(b).Yn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.V.Pf.Zo.ya=[olympe.V.Pf.wr];olympe.V.Pf.$o=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.yd(e);c(e.Aj(),f);for(const g of Ia(e))c(g.Aj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.V.rb&&b(g.T(),f)}const d=new Set(Object.keys(a.Fe));for(const e of d)b(e,[])}};olympe.V.Pf.$o.ya=[olympe.V.Pf.wr];olympe.V.Pf.wr=class{process(){}};const Ja=[],Ka=[];function La(a){const b=a.Wa();b.debug('Registering configurations...');b.j++;Ja.forEach(c=>{B(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});Ma(b);b.debug('done registering')}function Na(a){const b=a.Wa();b.debug('Running run callbacks of container...');b.j++;Ka.forEach(c=>{const d=Oa(a,c.Aj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});Ma(b);b.debug('done calling run callbacks. DI process completed!')}
|
|
256
256
|
olympe.V.fp=class{constructor(){}static j(a,b){Ja.push(new olympe.V.em(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');});Ka.push(new olympe.V.em(b,c,a))}};olympe.V.config=olympe.V.fp.j;olympe.V.run=olympe.V.fp.D;olympe.V.dt=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.V.Vj=class{constructor(){}getValue(){}};function Pa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.V.em=class{constructor(a,b,c){this.D=a;this.Wd=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.V.rb(d):d);this.j=null!=b?b:'no name di callback';this.F=null}Aj(){return this.Wd}};function Ra(a,b){var c=olympe.V.P.Fg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Sa(a,b,c){let d=a.j[b];if(void 0===d){const e=a.H[b];if(void 0===e){if(c===olympe.V.Dh.j.Mm)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.F&&(a.j[b]=d)}return d}
|
|
257
257
|
function Ta(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 Oa(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.V.Vj?f.getValue(a):f,Ma(a.G);return d}
|
|
258
|
-
olympe.V.Dh=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.V.Jq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.
|
|
258
|
+
olympe.V.Dh=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.V.Jq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.Di.bind(this,f)))}Wa(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Di(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
|
|
259
259
|
(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.V.Dh.j={wu:'exception',Mm:'null'};function Ua(a,b){b=olympe.V.dt(b);for(const [c,d]of b)a.setParameter(c,d)}function C(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Va(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function D(a,b,c,d,e=!1){B(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Wa(a,b,c,d=!1){B(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Xa(a,b){B(a.G,'Defining abstract service '+b);a.j(b).D=!0}
|
|
260
260
|
function Ya(a,b,c,d){a.F.push(b);a.setParameter(b,d(...c.map(e=>a.getParameter(e))));D(a,b,c.map(e=>new olympe.V.Hh(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function E(a,b,c){a.D[b.toLowerCase()]=c}
|
|
261
261
|
olympe.V.mu=class{constructor(a,b){this.Fe=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ua(this,a);Ua(this,b);this.R=[new olympe.V.Pf.Zo,new olympe.V.Pf.$o];this.H=[];a=this.getParameter(olympe.V.Config.Fv);this.N=void 0!==a?a:3;this.G=new olympe.V.Jq(this.N)}Wa(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.V.rb?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.Fe[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
|
|
@@ -263,11 +263,11 @@ var g=this.Fe[f];g.id=g.id+'!!'+ ++olympe.V.pm.j;g.F=!0;g=g.id;c[h]=g;this.Fe[g]
|
|
|
263
263
|
{B(this.G,'Calling callback');this.G.j++;b(this);Ma(this.G)});Ma(this.G);this.G.debug('Configuration summary: '+Object.keys(this.Fe).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)});Ma(this.G);this.G.debug('Compilation done, returning container');return new olympe.V.Dh(this.Fe,this.D,this.parameters,this.F,this.N)}};function Ia(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
|
|
264
264
|
olympe.V.pm=class{constructor(a,b,c,d){this.H=a||null;this.N=!!c;this.Wd=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.V.rb(e):e);this.D=!1;this.j=null;this.id=null!=d?d:'';this.F=!1}T(){return this.id}instantiate(a){const b=a.Wa();b.debug('Resolving arguments for '+this.id);const c=this.H;let d=Oa(a,this.Wd);const e=()=>{if(this.N)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.nh().run(()=>e()):e();let g;if(0<
|
|
265
265
|
(null==(g=this.j)?void 0:g.size)){b.j++;B(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,B(b,'Check if need to call additional configuration callback '+h.j),Pa(h,f)?(B(b,'Calling additional configuration callback '+h.j),d=Oa(a,h.Aj()),d.push(f),h.D.apply(null,d)):B(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),Ma(b);Ma(b)}B(b,'Done instantiating '+this.id);return f}Aj(){return this.Wd}Yn(){return this.D}config(a,b,c,d,e){null===
|
|
266
|
-
this.j&&(this.j=new Map);var f=this.j,g=f.set;b=new olympe.V.em(c,e,b);b.F=d;g.call(f,a,b)}};olympe.V.pm.j=0;olympe.V.Hh=class extends olympe.V.Vj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Ta(a,this.id,c=>b.next(c))})}};function Ma(a){0<a.j&&a.j--}function B(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.V.Jq=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.V.ma=class extends olympe.V.Vj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.V.rb=class extends olympe.V.Vj{constructor(a,b){super();this.id=a;this.j=b||olympe.V.Dh.j.wu}T(){return this.id}getValue(a){return Sa(a,this.id,this.j)}};olympe.V.P={Fg:'di.Container',SC:'di.PublicContainer'};olympe.V.Config={Fv:'logging.di'};olympe.V.run([olympe.V.P.Fg],a=>{olympe.V.getParameter=b=>a.getParameter(b);olympe.V.
|
|
266
|
+
this.j&&(this.j=new Map);var f=this.j,g=f.set;b=new olympe.V.em(c,e,b);b.F=d;g.call(f,a,b)}};olympe.V.pm.j=0;olympe.V.Hh=class extends olympe.V.Vj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Ta(a,this.id,c=>b.next(c))})}};function Ma(a){0<a.j&&a.j--}function B(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.V.Jq=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.V.ma=class extends olympe.V.Vj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.V.rb=class extends olympe.V.Vj{constructor(a,b){super();this.id=a;this.j=b||olympe.V.Dh.j.wu}T(){return this.id}getValue(a){return Sa(a,this.id,this.j)}};olympe.V.P={Fg:'di.Container',SC:'di.PublicContainer'};olympe.V.Config={Fv:'logging.di'};olympe.V.run([olympe.V.P.Fg],a=>{olympe.V.getParameter=b=>a.getParameter(b);olympe.V.Di=(b,c)=>a.Di(b,c);olympe.ee().getConfig=b=>a.getParameter(b);olympe.ee().getConfigNames=()=>Array.from(new Set([...Object.keys(a.parameters),...Object.keys(a.F)]));olympe.ee().updateConfig=(b,c)=>a.Di(b,c)});olympe.U={};olympe.U.xq=class{constructor(a){this.id=a||olympe.U.xq.j++}Fa(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.U.xq.j=0;olympe.U.vC=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.U.Rh=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.U.Rh.D=function(a){return new olympe.U.Rh(.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.U.Rh.j=function(){return new olympe.U.Rh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.U.Rh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.U.Rh.prototype.get=function(a,b){return this.values[5*a+b]};function $a(a){return(new TextEncoder).encode(a)}function ab(a,b){return a.j($a(b))}function bb(a){return(new TextDecoder('utf8')).decode(a)}function cb(a){const b=new olympe.U.stream.og;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}
|
|
267
267
|
olympe.U.Vl=class{D(){}j(){}H(a){return u(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.U.stream.og){const b=[];for(const c=ha(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(){}};
|
|
268
268
|
olympe.U.Ks=a=>a.replace('+','-').replace('/','_');olympe.U.Dx=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}
|
|
269
269
|
olympe.U.pn=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}
|
|
270
|
-
olympe.U.
|
|
270
|
+
olympe.U.ci=class{constructor(a){this.j=gb(new olympe.U.pn(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 F(a,b,...c){if(!a.N)throw Error('Cannot update state before starting the state machine');if(!a.R.has(b))throw Error(`State ${b} not found`);var d;let e;var f=null!=(e=null==(d=a.D[a.D.length-1])?void 0:d.state)?e:a.F.getValue();if(null!==f){if(f===b){a.G.debug(`Move request is a no-op, state ${b} is already active or queued`);return}d=a.X.get(b);if(null!==d&&!d.has(f)){F(a,a.j,Error(`Cannot move to state ${b} from state ${f}`));return}}a.G.debug(`Plan moving to state ${b}, from state ${f}`);
|
|
271
271
|
b===a.j&&(a.G.debug("Clear transition's queue to move to error state"),a.D=[]);a.D.push({state:b,Wd:c});1===a.D.length&&jb(a).then()}function kb(a,b,c){a.H.has(b)||a.H.set(b,new Set);a.H.get(b).add(c)}
|
|
272
272
|
function lb(a,b){let c=null;return(new Promise((d,e)=>{if(a.F.getValue()===b)d();else if(a.F.getValue()===a.j)e(Error(`Error state reached: ${a.j}`));else{c=()=>{let h;null==(h=a.H.get(b))||h.delete(f);let k;null==(k=a.H.get(a.j))||k.delete(g)};const f=()=>d(),g=()=>e(Error('Reached error state'));kb(a,b,f);kb(a,a.j,g)}})).finally(()=>{let d;return null==(d=c)?void 0:d()})}
|
|
273
273
|
function mb(a,b,c=()=>{},d=null){if(a.N)throw Error('Cannot add state after starting the state machine');if(a.R.has(b))throw Error(`State ${b} already exists`);a.R.set(b,c);a.X.set(b,d?new Set(d):null)}function nb(a,b,c){mb(a,b,(d,e)=>u(function*(){try{yield c(d,e)}catch(f){a.G.error(`Error while processing error state ${b}: ${f}`)}}),null);a.j=b}
|
|
@@ -302,7 +302,7 @@ b[4],6,-145523070);f=J(f,c,d,e,b[11],10,-1120210379);e=J(e,f,c,d,b[2],15,7187872
|
|
|
302
302
|
function zb(a,b=32){const c='0123456789abcdef'.split('');var d=a,e=d.length;a=[1732584193,-271733879,-1732584194,271733878];var f;for(f=64;f<=d.length;f+=64){var g=d.substring(f-64,f),h=[];for(let k=0;64>k;k+=4)h[k>>2]=g.charCodeAt(k)+(g.charCodeAt(k+1)<<8)+(g.charCodeAt(k+2)<<16)+(g.charCodeAt(k+3)<<24);yb(a,h)}d=d.substring(f-64);g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<d.length;f++)g[f>>2]|=d.charCodeAt(f)<<(f%4<<3);g[f>>2]|=128<<(f%4<<3);if(55<f)for(yb(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
|
|
303
303
|
yb(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==zb('hello')&&(xb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.U.sb=zb;function Ab(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Bb(){var a=Math.random();return Ab((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const Cb=Math.pow(2,32)-1;olympe.U.Mc=function(){return Bb()};olympe.U.jf=function(){return Bb()};olympe.U.vF=function(a,b=1){const c=a.substr(12,a.length-12);return Ab(parseInt(a.substr(0,12),16)+b)+c};
|
|
304
304
|
olympe.U.uF=function(a){return Ab(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Db=0,Eb=0;olympe.U.ky=function(){var a=(new Date).getTime();a<=Db?4294967295===Eb?(Eb=Math.floor(Math.random()/4*Cb),Db+=1):Eb=Math.floor(Eb+(4294967295-Eb)/2):(Eb=Math.floor(Math.random()/4*Cb),Db=a);a='00000000'+Eb.toString(16);return Ab(Db)+a.substr(a.length-8,8)};olympe.U.KF=function(){for(let a=0;1E4>a;a++)console.log(olympe.U.ky())};
|
|
305
|
-
olympe.U.
|
|
305
|
+
olympe.U.si=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.U.pF=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.U.lF=function(a,b){return(b?b:'UI')+'-'+a};
|
|
306
306
|
olympe.U.$z=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
|
|
307
307
|
r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,TE:g||null,Mt:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,mF:f||null,parameters:b}};olympe.U.EF=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
|
|
308
308
|
olympe.U.HF=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.U.tF=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};
|
|
@@ -318,15 +318,15 @@ olympe.C.J.D=new olympe.C.J(()=>olympe.C.Sa);olympe.C.J.N=new olympe.C.J(()=>oly
|
|
|
318
318
|
olympe.C.Zb=class{constructor(a='SimpleContext',b){++Mb;this.ba=new Map;this.Z=new Map;this.X=new Map;this.Ha=0;this.name=a;this.id=String(Mb);this.F=this.ia=!1;(this.N=void 0===b?olympe.C.Za():b)&&this.N.pe(this);this.debug=!1}T(){return this.id}Pn(){return this.name}run(a,...b){if(!this.ia){var c=olympe.C.Gt(this);a=a(...b);c&&olympe.C.Gt(c);return a}}tc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ia&&!this.F){this.F=!0;this.ug();for(const a of this.Z.keys())this.Z.has(a)&&this.Z.get(a)();
|
|
319
319
|
this.Z.clear();this.X.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ia=!0;this.F=!1;this.ug()}}fb(){return this.ia}kd(){return this.F}pe(a){if(!this.ia){var b;olympe.C.gb(a)?b=a.Ba:olympe.C.ao(a)&&(b=a);b&&this.ba.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.ao(a)&&(c=a);c&&this.ba.has(c.T())&&(b&&c.jl(this),this.ba.delete(c.T()))}jl(){this.N=null;this.destroy()}ug(){const a=this.ba;for(const b of a.keys())a.has(b)&&a.get(b).jl(this);this.ba.clear();for(const b of this.X.keys())this.X.has(b)&&
|
|
320
320
|
this.X.get(b)();this.X.clear()}onDestroy(a,b){void 0===b&&(++this.Ha,b=String(this.Ha));this.Z.set(b,a);return b}Zf(a){this.Z.delete(a)}Yd(a){if(void 0===b){++this.Ha;var b=String(this.Ha)}this.X.set(b,a);return b}wt(a){this.X.delete(a)}Ht(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.pe(this)}getParent(){return this.N}};olympe.C.Ur=class extends olympe.C.Zb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Zf(){}};olympe.C.Jh.ya=[olympe.C.Jh];let Nb=0;
|
|
321
|
-
function Ob(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Lc()){case olympe.C.Node.j.Sh:break;case olympe.C.Node.j.
|
|
321
|
+
function Ob(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Lc()){case olympe.C.Node.j.Sh:break;case olympe.C.Node.j.ei:break;case olympe.C.Node.j.zk:case olympe.C.Node.j.fg:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.Kh:Pb(a,olympe.C.Node.j.Kh);break;case olympe.C.Node.j.OBSOLETE:a.lb=!0;a.j!==olympe.C.Node.j.Kh&&Pb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.$d:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
|
|
322
322
|
default:olympe.C.G.warn('Unknown state, investigate: ',b.Lc())}Qb(b,a)}
|
|
323
323
|
function Rb(a){if(a.Nc){var b=[],c=[];if(a.$f)if(a.$f instanceof olympe.C.Node)if(Sb(a.$f))b=a.$f.Fb;else return;else b=a.$f;else b=null;if(null!==a.Wd){const e=a.tg;for(let f=0,g=a.Wd.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.Wd[f];if(Sb(h))c.push(h.Fb);else return}else c.push(a.Wd[f])}if(a.Nc instanceof Function)var d=a.Nc;else b&&(b[a.Nc]||olympe.C.G.warn('looks like you forget a cast somewhere around '+a.Nc),d=b[a.Nc]);a.run(()=>{a.ug();if(void 0!==d){const e=d.apply(b,c);e&&e.Gs?
|
|
324
|
-
Tb(a,e.Ba):e instanceof olympe.C.Node?Tb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Pb(a,olympe.C.Node.j.
|
|
324
|
+
Tb(a,e.Ba):e instanceof olympe.C.Node?Tb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&Pb(a,olympe.C.Node.j.ei))}else Ub(a)})}}function M(a){void 0===a.Ua&&(a.Ua=a.valueType===olympe.C.Proxy?Vb(void 0,a.wb):Vb(a.valueType,a.wb),a.Ua.Ba=a);return a.Ua}function Wb(a){void 0!==a.D&&(Xb(a.D,a),a.D=void 0)}function Yb(a){if(a.j===olympe.C.Node.j.OBSOLETE&&(a.j=olympe.C.Node.j.ei,null!==a.H))for(const b of a.H.values())Zb(b)}function Pb(a,b){b!==a.j&&(a.j=b)}
|
|
325
325
|
function $b(a){if(a.j!==olympe.C.Node.j.OBSOLETE&&a.j!==olympe.C.Node.j.zk&&a.j!==olympe.C.Node.j.Sh&&a.j!==olympe.C.Node.j.Kh){Pb(a,olympe.C.Node.j.zk);var b=a.H;if(b)for(const c of b.values())b.has(c.T())&&$b(c);Pb(a,olympe.C.Node.j.OBSOLETE)}}function ac(a,b,c){if(a.j!==olympe.C.Node.j.fg)if(b===a.D)L(a,c,!0);else{if(a.j===olympe.C.Node.j.OBSOLETE||a.j===olympe.C.Node.j.zk)a.lb=!0;Rb(a)}}
|
|
326
|
-
function L(a,b,c){b instanceof olympe.C.Node&&(olympe.C.G.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Fb);a.wa||c||void 0===a.D||Wb(a);if(void 0!==b){if((a.wa||a.j===olympe.C.Node.j.
|
|
326
|
+
function L(a,b,c){b instanceof olympe.C.Node&&(olympe.C.G.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Fb);a.wa||c||void 0===a.D||Wb(a);if(void 0!==b){if((a.wa||a.j===olympe.C.Node.j.ei||a.j===olympe.C.Node.j.OBSOLETE)&&!olympe.C.gb(b)&&void 0!==a.Fb){if(null===b&&null===a.Fb){Yb(a);return}if(null!==b&&null!==a.Fb&&(b.valueOf()===a.Fb.valueOf()||a.Fb.Fa&&a.Fb.Fa(b))){Yb(a);return}}if(!0===a.wa)olympe.C.G.error("Circular dependency detected: updating a downstream node caused this node's (#"+
|
|
327
327
|
a.T()+') value to get updated !');else{a.j===olympe.C.Node.j.$d&&olympe.C.G.warn(`trying to set a value on a destroyed node (#${a.T()} ${a.cd?', '+a.cd:''})`);a.j===olympe.C.Node.j.fg&&olympe.C.G.warn(`trying to set a value on a node being destroyed (#${a.T()} ${a.cd?', '+a.cd:''})`);a.wa=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
|
|
328
|
-
Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.C.Sa?(c=olympe.C.yb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.C.$?(c=olympe.C.sa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.C.da&&(c=olympe.C.Sb(c),d=!1)));a.Fb=c;Pb(a,olympe.C.Node.j.
|
|
329
|
-
function bc(a,b){if(a.j!==olympe.C.Node.j.fg&&a.j!==olympe.C.Node.j.$d&&(a.j!==olympe.C.Node.j.Sh||a.Nc)){var c=void 0!==a.defaultValue;a.Nc&&b!==a.D&&a.ug();if(c)L(a,a.defaultValue,!0);else if(a.Fb=void 0,Pb(a,olympe.C.Node.j.Sh),b=a.H)for(const d of b.values())bc(d,a)}}function Ub(a){if(a.j!==olympe.C.Node.j.Kh){Pb(a,olympe.C.Node.j.Kh);var b=a.H;if(b)for(const c of b.values())Ub(c);a.ug();void 0!==a.D&&Wb(a);a.Fb=a.defaultValue}}function Sb(a){return a.j===olympe.C.Node.j.
|
|
328
|
+
Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.C.Sa?(c=olympe.C.yb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.C.$?(c=olympe.C.sa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.C.da&&(c=olympe.C.Sb(c),d=!1)));a.Fb=c;Pb(a,olympe.C.Node.j.ei);if(b=a.H){d=0;for(const f of b.values())0<d&&$b(f),d++;for(const f of b.values())ac(f,a,c)}a.wa=!1}}}
|
|
329
|
+
function bc(a,b){if(a.j!==olympe.C.Node.j.fg&&a.j!==olympe.C.Node.j.$d&&(a.j!==olympe.C.Node.j.Sh||a.Nc)){var c=void 0!==a.defaultValue;a.Nc&&b!==a.D&&a.ug();if(c)L(a,a.defaultValue,!0);else if(a.Fb=void 0,Pb(a,olympe.C.Node.j.Sh),b=a.H)for(const d of b.values())bc(d,a)}}function Ub(a){if(a.j!==olympe.C.Node.j.Kh){Pb(a,olympe.C.Node.j.Kh);var b=a.H;if(b)for(const c of b.values())Ub(c);a.ug();void 0!==a.D&&Wb(a);a.Fb=a.defaultValue}}function Sb(a){return a.j===olympe.C.Node.j.ei}
|
|
330
330
|
function Tb(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Wb(a),Qb(b,a),Sb(b)?L(a,b.Fb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):bc(a),a.D=b)}function cc(a,b){a.Nc&&(a.Nc=void 0);a.cd='Repeater';Tb(a,b)}function Zb(a){a.D?Yb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Sb(b)).length&&(a.lb&&(a.lb=!1,Rb(a)),Yb(a))}
|
|
331
331
|
function Qb(a,b){a.H||(a.H=new Map);a.H.set(b.T(),b);a.j===olympe.C.Node.j.$d&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Xb(a,b){a.H&&(b=b.T(),a.H.has(b)&&(a.H.delete(b),dc(a)))}function dc(a){if(null===a.getParent()){var b=a.H;b&&0<b.size||a.destroy()}}
|
|
332
332
|
olympe.C.Node=class extends olympe.C.Zb{constructor({valueType:a,Nc:b,eA:c=!0,$f:d,Xn:e,debug:f=!1,tg:g=null,cd:h='Node',rj:k}={}){++Nb;super(String(Nb));this.debug=!!f;this.cd=h;h&&'string'===typeof h||(b?this.cd=b.name?b.name:'anon()':this.cd='Node');this.Wd=e&&0<e.length?e:null;this.tg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.wa=!1;this.j=olympe.C.Node.j.Sh;this.lb=!1;this.H=this.R=null;this.Nc=b;this.$f=d||null;this.defaultValue=this.Ua=this.D=void 0;this.rj=k;d&&d instanceof
|
|
@@ -334,11 +334,11 @@ olympe.C.Node&&Ob(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Ob(this,a);c&&Rb
|
|
|
334
334
|
olympe.C.Node.j.fg}wb(...a){if(this.rj instanceof Function)return this.rj(...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.Lc();a!==olympe.C.Node.j.fg&&a!==olympe.C.Node.j.$d||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.gb(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.hh&&(e[g]=f.Ba,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
|
|
335
335
|
Nc:c,$f:this,Xn:e,debug:!1,tg:b,cd:'Proxy.'+c+'()'}))}jl(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.Ht(null);dc(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.fg&&a!==olympe.C.Node.j.$d){Pb(this,olympe.C.Node.j.fg);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());
|
|
336
336
|
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())&&Xb(c,this);this.R.clear()}this.R=null;this.D&&(Xb(this.D,this),this.D=void 0);this.Fb=void 0;this.Wd&&(this.Wd.length=0,this.Wd=null);this.tg&&(this.tg.length=0,this.tg=null);this.rj=this.Nc=void 0;this.defaultValue=this.$f=null;this.cd=`** Destroyed ** ${this.cd}`;Pb(this,olympe.C.Node.j.$d)}}Pn(){return this.cd}print(){const a=this.Nc?this.Nc instanceof
|
|
337
|
-
Function?this.Nc.name?this.Nc.name:'()':this.Nc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.cd?' '+this.cd:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Sh:0,
|
|
338
|
-
function gc(a,b){if(a.
|
|
337
|
+
Function?this.Nc.name?this.Nc.name:'()':this.Nc:'{ }';return'#'+('000000'+this.T()).substr(-6)+(this.cd?' '+this.cd:'')+'>'+(a?' '+a+'()':'')}};olympe.C.Node.D='rootNode';olympe.C.Node.j={Sh:0,ei:1,Kh:3,zk:4,OBSOLETE:5,fg:6,$d:7};function Vb(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(ec(c,a.prototype));c.hi=a;c.Hs=b;return c}function ec(a,b){Object.prototype.hasOwnProperty.call(b,olympe.C.Proxy.Ym)||Object.defineProperty(b,olympe.C.Proxy.Ym,{enumerable:!1,configurable:!1,writable:!1,value:fc(a,b)});return b[olympe.C.Proxy.Ym]}
|
|
338
|
+
function gc(a,b){if(a.hi!==b){a.hi=b;b.prototype||olympe.C.G.error('Cast not possible, provided type is not a valid type!');var c=ec(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Ba&&a.Ba.tj(b)}}
|
|
339
339
|
function fc(a,b){let c={};if(b.prototype)olympe.C.G.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(ec(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&&Sb(g)&&(g=g.Fb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.C.J.X,c[d]=function(...f){f=this.Hs.call(this.Ba,
|
|
340
340
|
...f,e,d);const g=e.X;if(g){const h=this.Ba.Fb;h&&h[g]&&gc(f,h[g])}return e.R()?this:f})}});return c}function hc(a,b){L(a.Ba,b)}function ic(a){bc(a.Ba)}function jc(a,b){cc(a.Ba,olympe.C.Yf(b)?b:b.Ba)}function kc(a,b){olympe.C.gb(b)||olympe.C.Yf(b)?jc(a,b):hc(a,b)}
|
|
341
|
-
olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.
|
|
341
|
+
olympe.C.Proxy=class{constructor(a,b){this.Ba=null;this.hi=a;this.Hs=b}static gb(a){return!(!a||!a.hh)}Fa(a){return olympe.C.ua([this,a],(b,c)=>b===c,Boolean)}Md(a){return olympe.C.ua([this,a],(b,c)=>null===b||null===c?b===c?olympe.C.da.D:olympe.C.da.j:b.valueOf()===c.valueOf()?olympe.C.da.D:olympe.C.da.j,olympe.C.da)}asObservable(a){return this.Ba.asObservable(a)}Gs(){return this.Ba}};olympe.C.Proxy.Ym='__opp__';olympe.C.Proxy.prototype.hh=!0;function lc(a,b){a.node.zh(b);return a}olympe.C.nk=class{constructor(a,b='FlowSource'){this.node=olympe.C.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.C.gb(a)?L(this.node,olympe.C.Qa(a)):L(this.node,a);return this}repeat(a){cc(this.node,olympe.C.gb(a)?a.Ba:a);return this}clear(){bc(this.node);return this}ub(){return M(this.node)}getContext(){return this.node}};function mc(a,b,c=1E3,d,e){const f=olympe.C.bc(olympe.C.$),g=d||olympe.C.$.vp.Hq;let h,k,l,n;f.update(olympe.C.sa(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().fb()||(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.sa(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.ub()}
|
|
342
342
|
olympe.C.$=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.sa(b.value)}po(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.C.Sb(!this.po())}Zc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.C.yb(''):olympe.C.yb(this.value.toString())}toString(a,b){return void 0!==
|
|
343
343
|
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.po()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.C.bc(olympe.C.$,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.C.sa(c))};a.forEach((f,g)=>{olympe.C.Yc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().fb()){var g=b.get(f);b.delete(f);
|
|
344
344
|
g===c&&e()}});return d.ub()}he(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.sa(b.valueOf()+c.valueOf()),olympe.C.$,'ONumber.plus')}xh(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.sa(b.valueOf()-c.valueOf()),olympe.C.$,'ONumber.minus')}round(){return olympe.C.sa(Math.round(this.valueOf()))}Rj(){return olympe.C.sa(-this.valueOf())}Al(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.sa(b.valueOf()*c.valueOf()),olympe.C.$,'ONumber.mul')}wj(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.sa(b.valueOf()/
|
|
@@ -388,38 +388,38 @@ m.ey.K=new olympe.C.J(()=>olympe.C.Color,[]);m.Kt.K=new olympe.C.J(()=>String,[]
|
|
|
388
388
|
olympe.C.$b,'Vector2.plus')}xh(a){return olympe.C.ua([this,a],(b,c)=>new olympe.C.$b(b.x.xh(c.x),b.y.xh(c.y)),olympe.C.$b,'Vector2.minus')}Jz(a){return new olympe.C.$b(this.x.Al(a),this.y.Al(a))}Yx(a){return new olympe.C.$b(this.x.wj(a),this.y.wj(a))}Lz(){return new olympe.C.$b(this.x.Rj(),this.y.Rj())}Zx(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ua([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.C.sa(d*f+e*g),olympe.C.$),olympe.C.$)}length(){return olympe.C.ua([this.x,this.y],(a,b)=>olympe.C.sa(Math.sqrt(a*
|
|
389
389
|
a+b*b)),olympe.C.$)}normalize(){return olympe.C.ua([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.C.$b(a/c,b/c)},olympe.C.$b)}floor(){return olympe.C.ua([this.x,this.y],(a,b)=>new olympe.C.$b(Math.floor(a),Math.floor(b)),olympe.C.$b)}ceil(){return olympe.C.ua([this.x,this.y],(a,b)=>new olympe.C.$b(Math.ceil(a),Math.ceil(b)),olympe.C.$b)}round(){return olympe.C.ua([this.x,this.y],(a,b)=>new olympe.C.$b(Math.round(a),Math.round(b)),olympe.C.$b)}vx(a){return new olympe.C.$b(this.x.he(a),
|
|
390
390
|
this.y.he(a))}wx(a,b){return new olympe.C.$b(this.x.he(a),this.y.he(b))}Zc(){return olympe.C.ua([this.x,this.y],(a,b)=>olympe.C.yb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Sa)}toString(){return`Vector2[${this.x.Ba.Fb}, ${this.y.Ba.Fb}]`}Fa(a){return this===a?!0:!1}};m=olympe.C.$b.prototype;m.toJSON.K=olympe.C.J.j;m.bv.K=olympe.C.J.F;m.pA.K=olympe.C.J.j;m.dv.K=olympe.C.J.F;m.qA.K=olympe.C.J.j;m.ez.K=olympe.C.J.F;m.he.K=new olympe.C.J(()=>olympe.C.$b,[0]);
|
|
391
|
-
m.xh.K=new olympe.C.J(()=>olympe.C.$b,[0]);m.Jz.K=olympe.C.J.R;m.Yx.K=olympe.C.J.R;m.Lz.K=olympe.C.J.R;m.Zx.K=new olympe.C.J(()=>olympe.C.$,[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.vx.K=olympe.C.J.R;m.wx.K=olympe.C.J.R;m.Zc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;olympe.C.Jg=class{constructor(){}Mb(){}Sd(){}get(){}
|
|
392
|
-
m.nf.K=new olympe.C.J(()=>String,[]);m.Tf.K=olympe.C.J.j;m.se.K=new olympe.C.J(()=>Object,[]);m.mf.K=olympe.C.J.j;m.xj.K=olympe.C.J.j;m.
|
|
393
|
-
c)&&gc(b[c],a)}get(a){const b=c=>{null===this.ia&&(this.ia={});return this.Cj(this.ia,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ua([a],c=>b(c),this.valueType)}
|
|
391
|
+
m.xh.K=new olympe.C.J(()=>olympe.C.$b,[0]);m.Jz.K=olympe.C.J.R;m.Yx.K=olympe.C.J.R;m.Lz.K=olympe.C.J.R;m.Zx.K=new olympe.C.J(()=>olympe.C.$,[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.vx.K=olympe.C.J.R;m.wx.K=olympe.C.J.R;m.Zc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;olympe.C.Jg=class{constructor(){}Mb(){}Sd(){}get(){}ti(){}has(){}uh(){}Kc(){}Vf(){}Df(){}xg(){}forEach(){}qe(){}};olympe.C.Jg.prototype.forEachCurrentValue=olympe.C.Jg.prototype.qe;olympe.C.Jg.prototype.forEach=olympe.C.Jg.prototype.forEach;m=olympe.C.Jg.prototype;m.has.K=olympe.C.J.N;m.uh.K=olympe.C.J.j;m.Kc.K=new olympe.C.J(()=>Object,[]);m.Vf.K=new olympe.C.J(()=>String,[]);m.Df.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.qe.K=olympe.C.J.j;olympe.C.wd=class extends olympe.C.Jg{Kd(){}Uf(){}nf(){}Tf(){}se(){}mf(){}xj(){}wi(){}};olympe.C.wd.prototype.getCurrentAt=olympe.C.wd.prototype.mf;olympe.C.wd.prototype.getAt=olympe.C.wd.prototype.se;olympe.C.wd.prototype.getCurrentKeyAt=olympe.C.wd.prototype.Tf;olympe.C.wd.prototype.getKeyAt=olympe.C.wd.prototype.nf;olympe.C.wd.prototype.getCurrentRank=olympe.C.wd.prototype.Uf;olympe.C.wd.prototype.getRank=olympe.C.wd.prototype.Kd;m=olympe.C.wd.prototype;m.Kd.K=olympe.C.J.F;m.Uf.K=olympe.C.J.j;
|
|
392
|
+
m.nf.K=new olympe.C.J(()=>String,[]);m.Tf.K=olympe.C.J.j;m.se.K=new olympe.C.J(()=>Object,[]);m.mf.K=olympe.C.J.j;m.xj.K=olympe.C.J.j;m.wi.K=new olympe.C.J(()=>Array,[]);olympe.C.Fi=class{constructor(a,b){this.H=b||olympe.C.Za();this.valueType=a||Object;this.values={};this.Ua=this.ia=null;this.Re=0;this.R=Object.create(null);this.lb=Object.create(null);this.size=0;this.F=null;this.H.onDestroy(()=>{const c=this.R;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.H}Mb(){return this.valueType}Sd(a){this.valueType=a;const b=this.ia;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
|
|
393
|
+
c)&&gc(b[c],a)}get(a){const b=c=>{null===this.ia&&(this.ia={});return this.Cj(this.ia,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ua([a],c=>b(c),this.valueType)}ti(a){a=this.values[a];return olympe.C.gb(a)?Sb(a.Ba)?a.Ba.Fb:void 0:a}has(a){const b=c=>{null===this.Ua&&(this.Ua={});return this.Cj(this.Ua,c,c in this.values?olympe.C.da.D:olympe.C.da.j,olympe.C.da,'Map.has('+c+')')};return olympe.C.ua([a],c=>b(c),olympe.C.da)}uh(a){return a in this.values}Cj(a,b,c,d,e){let f=a[b];
|
|
394
394
|
f||this.H.run(()=>{f=olympe.C.Xd(d,void 0,e);a[b]=f;f.Ba.onDestroy(()=>delete a[b]);olympe.C.gb(c)?jc(f,c):hc(f,c)});return f}Kc(){throw Error('Abstract method getFirstKey needs to be overridden');}Vf(){throw Error('Abstract method getFirstKey needs to be overridden');}Df(){null===this.F&&this.H.run(()=>{this.F=olympe.C.Xd(olympe.C.$,olympe.C.sa(this.size));this.F.Ba.onDestroy(()=>{this.F=null})});return this.F}xg(){return this.size}forEach(a,b){const c=this.tn();a=this.Is(c,a,b);this.sn(c,a)}tn(){return String(++this.Re)}sn(a,
|
|
395
395
|
b){this.lb[a]=b;olympe.C.Za().Yd(()=>{const c=this.R;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.lb[a]});this.qe(b)}Is(a,b,c){const d=olympe.C.Za();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.wn(a,f,g)})}}wn(a,b,c){void 0===this.R[b]&&(this.R[b]={});this.R[b][a]=c}qe(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
|
|
396
396
|
a(b[c],c,this))break}fl(a,b){void 0!==this.values[a]&&this.qj(a,!0);this.values[a]=b;var c=this.ia;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?jc(c[a],b):hc(c[a],b));c=this.Ua;null!==c&&void 0!==c[a]&&kc(c[a],!0);this.size++;c=this.lb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}qj(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.hh?d.Ba.Fb:d;var e=this.ia;null!==e&&void 0!==e[a]&&ic(e[a]);e=this.Ua;null!==e&&void 0!==
|
|
397
|
-
e[a]&&kc(e[a],!1);delete c[a];this.size--;b||this.Of()}a=this.R[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Of(){null!==this.F&&kc(this.F,this.size)}
|
|
398
|
-
c)){b=this.R[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.F&&kc(this.F,this.size)}Mg(){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.
|
|
399
|
-
m.Df.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.tn.K=olympe.C.J.j;m.sn.K=olympe.C.J.j;m.Is.K=olympe.C.J.j;m.wn.K=olympe.C.J.j;m.qe.K=olympe.C.J.j;m.fl.K=olympe.C.J.j;m.qj.K=olympe.C.J.j;m.Of.K=olympe.C.J.j;m.
|
|
397
|
+
e[a]&&kc(e[a],!1);delete c[a];this.size--;b||this.Of()}a=this.R[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Of(){null!==this.F&&kc(this.F,this.size)}ji(){var a=this.ia;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&ic(a[c]);a=this.Ua;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&kc(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.R)if(Object.prototype.hasOwnProperty.call(this.R,
|
|
398
|
+
c)){b=this.R[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.F&&kc(this.F,this.size)}Mg(){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.Fi.ya=[olympe.C.Jg];m=olympe.C.Fi.prototype;m.getContext.K=olympe.C.J.j;m.Mb.K=olympe.C.J.j;m.Sd.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>Object,[],'valueType');m.ti.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.uh.K=olympe.C.J.j;m.Cj.K=olympe.C.J.j;
|
|
399
|
+
m.Df.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.tn.K=olympe.C.J.j;m.sn.K=olympe.C.J.j;m.Is.K=olympe.C.J.j;m.wn.K=olympe.C.J.j;m.qe.K=olympe.C.J.j;m.fl.K=olympe.C.J.j;m.qj.K=olympe.C.J.j;m.Of.K=olympe.C.J.j;m.ji.K=olympe.C.J.j;m.Mg.K=olympe.C.J.j;olympe.C.Uj=class extends olympe.C.Fi{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.ba=this.wa=this.Ha=this.Z=null}Sd(a){super.Sd(a);if(null!==this.ba)for(let b of this.ba.values())gc(b,a)}Kc(){return this.se(0)}Vf(){return this.nf(0)}Kd(a){const b=c=>{null===this.Ha&&(this.Ha=Object.create(null));let d=this.Uf(a);d=void 0!==d?olympe.C.sa(d):void 0;return this.Cj(this.Ha,c,d,olympe.C.$,`List.getRank(${c})`)};return olympe.C.gb(a)?M(olympe.C.createNode(olympe.C.$,b,null,[a.Ba],
|
|
400
400
|
[0],'onResolved('+(b.name||'')+')')):b(a)}Uf(a){return this.D[a]}nf(a){const b=c=>{const d=c.valueOf(),e=this.Tf(d);null===this.wa&&(this.wa=Object.create(null));return this.Cj(this.wa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ua([a],c=>b(c),String)}Tf(a){return this.j[a.valueOf()]}se(a){if(olympe.C.gb(a))return this.get(olympe.C.ua([a],c=>{c=this.nf(c);if(!Sb(c.Ba)){const d=olympe.C.Za();olympe.C.Yf(d)&&bc(d)}return c},String));null===this.ba&&(this.ba=new Map);let b=this.ba.get(a);
|
|
401
|
-
b||this.H.run(()=>{b=this.get(this.nf(a));this.ba.set(a,b);b.Ba.onDestroy(()=>this.ba.delete(a))});return b}mf(a){return this.
|
|
401
|
+
b||this.H.run(()=>{b=this.get(this.nf(a));this.ba.set(a,b);b.Ba.onDestroy(()=>this.ba.delete(a))});return b}mf(a){return this.ti(this.Tf(a))}xj(a,b,c,d){let e=this.tn();a=this.tt(e,a,b,c,d);this.sn(e,a)}tt(a,b,c,d,e){return olympe.C.Za().tc((f,g)=>{let h=!1,k=olympe.C.Ci([b,c,this.Kd(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.wn(a,g,k)})}wi(){null===this.Z&&this.H.run(()=>{this.Z=olympe.C.Xd(Array,this.j.filter(a=>void 0!==a));this.Z.Ba.onDestroy(()=>
|
|
402
402
|
{this.F=null})});return this.Z}qe(a){if(this.j.length!==this.size)super.qe(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}}vn(a,b){const c=this.Ha,d=this.wa,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]&&ic(c[g]),void 0!==c[a]&&hc(c[a],olympe.C.sa(f)));
|
|
403
|
-
null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&ic(d[e]),void 0!==d[b]&&hc(d[b],a))}}un(a){var b=this.wa,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Fb===a&&ic(b));delete this.D[a];this.j.splice(c,1);c=this.Ha;null!==c&&void 0!==c[a]&&ic(c[a])}Js(){if(null!==this.Z){const a=this.j,b=this.Z.Ba.Fb;b&&a.join(',')!==b.join(',')&&hc(this.Z,a)}}Of(){this.Js();super.Of()}
|
|
404
|
-
if(null!==a)for(b in a)ic(a[parseInt(b,10)]);var b=this.Z;null!==b&&($b(b.Ba),hc(b,this.j));return olympe.C.
|
|
405
|
-
m.Tf.K=olympe.C.J.j;m.se.K=new olympe.C.J(()=>Object,[]);m.mf.K=olympe.C.J.j;m.xj.K=new olympe.C.J(()=>{},[]);m.tt.K=olympe.C.J.j;m.
|
|
406
|
-
a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?jc(this.D,b):hc(this.D,b);hc(this.j,a)}else void 0!==this.D.Ba.Fb&&(ic(this.D),ic(this.j))}set(a,b){this.fl(a,b);1===this.size&&null!==this.j&&this.Pj(a);this.Of()}remove(a){const b=this.qj(a);null!==this.j&&this.j.Ba.Fb===a&&this.Pj(this.Kn());return b}clear(){this.
|
|
407
|
-
m.Kn.K=olympe.C.J.j;m.Pj.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.Pg=class extends olympe.C.Uj{constructor(a){super(a)}set(a,b,c){this.fl(a,b);void 0!==c&&olympe.C.Yc([c],d=>{this.vn(a,d)});this.Of()}remove(a){this.un(a);return this.qj(a)}clear(){this.
|
|
403
|
+
null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&ic(d[e]),void 0!==d[b]&&hc(d[b],a))}}un(a){var b=this.wa,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ba.Fb===a&&ic(b));delete this.D[a];this.j.splice(c,1);c=this.Ha;null!==c&&void 0!==c[a]&&ic(c[a])}Js(){if(null!==this.Z){const a=this.j,b=this.Z.Ba.Fb;b&&a.join(',')!==b.join(',')&&hc(this.Z,a)}}Of(){this.Js();super.Of()}ji(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.Ha;if(null!==a)for(b in a)ic(a[b]);a=this.wa;
|
|
404
|
+
if(null!==a)for(b in a)ic(a[parseInt(b,10)]);var b=this.Z;null!==b&&($b(b.Ba),hc(b,this.j));return olympe.C.Fi.prototype.ji.call(this)}Mg(){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.Uj.ya=[olympe.C.wd];m=olympe.C.Uj.prototype;m.Sd.K=olympe.C.J.j;m.Kc.K=new olympe.C.J(()=>Object,[]);m.Vf.K=new olympe.C.J(()=>String,[]);m.Kd.K=olympe.C.J.F;m.Uf.K=olympe.C.J.j;m.nf.K=new olympe.C.J(()=>String,[]);
|
|
405
|
+
m.Tf.K=olympe.C.J.j;m.se.K=new olympe.C.J(()=>Object,[]);m.mf.K=olympe.C.J.j;m.xj.K=new olympe.C.J(()=>{},[]);m.tt.K=olympe.C.J.j;m.wi.K=new olympe.C.J(()=>Array,[]);m.qe.K=olympe.C.J.j;m.vn.K=olympe.C.J.j;m.un.K=olympe.C.J.j;m.Js.K=olympe.C.J.j;m.Of.K=olympe.C.J.j;m.ji.K=olympe.C.J.j;m.Mg.K=olympe.C.J.j;olympe.C.Map=class extends olympe.C.Fi{constructor(a){a===olympe.C.Proxy&&(a=Object);super(a);this.j=this.D=null}Sd(a){a===olympe.C.Proxy&&(a=Object);null!==this.D&&gc(this.D,a);super.Sd(a)}Kc(){null===this.D&&this.Hn();return this.D}Vf(){null===this.j&&this.Hn();return this.j}Hn(){this.getContext().run(()=>{this.D=olympe.C.Xd(this.Mb());this.j=olympe.C.Xd(String);this.Pj(this.Kn())})}Kn(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Pj(a){if(void 0!==
|
|
406
|
+
a){const b=this.values[a];b&&b instanceof olympe.C.Proxy?jc(this.D,b):hc(this.D,b);hc(this.j,a)}else void 0!==this.D.Ba.Fb&&(ic(this.D),ic(this.j))}set(a,b){this.fl(a,b);1===this.size&&null!==this.j&&this.Pj(a);this.Of()}remove(a){const b=this.qj(a);null!==this.j&&this.j.Ba.Fb===a&&this.Pj(this.Kn());return b}clear(){this.ji();null!==this.j&&this.Pj()}};m=olympe.C.Map.prototype;m.Sd.K=olympe.C.J.j;m.Kc.K=new olympe.C.J(()=>Object,[]);m.Vf.K=new olympe.C.J(()=>String,[]);m.Hn.K=olympe.C.J.j;
|
|
407
|
+
m.Kn.K=olympe.C.J.j;m.Pj.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.Pg=class extends olympe.C.Uj{constructor(a){super(a)}set(a,b,c){this.fl(a,b);void 0!==c&&olympe.C.Yc([c],d=>{this.vn(a,d)});this.Of()}remove(a){this.un(a);return this.qj(a)}clear(){this.ji()}};olympe.C.Pg.prototype.remove.K=olympe.C.J.j;olympe.C.Pg.prototype.clear.K=olympe.C.J.j;olympe.C.Ut=class extends olympe.C.nk{constructor(a,b){super(olympe.C.$,'animatedFlowSource');this.duration=a;this.j=b||olympe.C.$.vp.Hq}ub(){return olympe.C.Nz(this.node,this.duration,this.j,void 0)}};let sc=null;olympe.C.G=void 0;olympe.C.ho=void 0;olympe.C.oi=void 0;olympe.C.ii=new Map;olympe.C.ii.set(0,olympe.C.$.ZERO);olympe.C.ii.set(1,olympe.C.$.ONE);olympe.C.ii.set(2,olympe.C.$.Xw);olympe.C.el=new Map;olympe.C.el.set('',olympe.C.Sa.EMPTY);olympe.C.el.set(' ',olympe.C.Sa.Iw);olympe.C.createNode=function(a,b,c,d,e,f,g,h){return new olympe.C.Node({valueType:a,Nc:b,$f:c,Xn:d,debug:g,tg:e,cd:f,rj:h})};olympe.C.Yf=function(a){return a instanceof olympe.C.Node};
|
|
408
408
|
olympe.C.Xd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,c);olympe.C.Yf(b)?cc(a,b):olympe.C.gb(b)?cc(a,b.Ba):L(a,b);return M(a)};olympe.C.gb=function(a){return!(!a||!a.hh)};olympe.C.qf=function(a){return!(!a||!(a instanceof olympe.C.Node||a.hh))};olympe.C.ao=function(a){return a instanceof olympe.C.Zb||a instanceof olympe.C.Ur||a instanceof olympe.C.Node};olympe.C.vh=function(a){return a instanceof olympe.C.nk};
|
|
409
409
|
olympe.C.co=function(a,b){if(void 0!==a){olympe.C.vh(a)&&(a=a.ub().Ba);if(!olympe.C.qf(a))return b(a);var c=[];olympe.C.gb(a)?c.push(a.Ba):c.push(a);return olympe.C.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.C.Qa=function(a,b){let c=a;olympe.C.gb(a)?c=a.Ba.Fb:olympe.C.Yf(a)?c=a.Fb:olympe.C.vh(a)&&(c=a.ub().Ba.Fb);return void 0===c?b:c};
|
|
410
|
-
olympe.C.zh=function(a,b){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Yf(a)?c=a:olympe.C.vh(a)&&(c=a.ub().Ba);c&&olympe.C.Yc([b],d=>{c.zh(d)},'setDefaultValue');return a};olympe.C.
|
|
411
|
-
olympe.C.Ae=function(a,b,c,d){return M(olympe.C.
|
|
412
|
-
olympe.C.cF=function(a,b,c){const d=olympe.C.Yf(a)?a.Mb():olympe.C.vh(a)?a.ub().
|
|
410
|
+
olympe.C.zh=function(a,b){let c;olympe.C.gb(a)?c=a.Ba:olympe.C.Yf(a)?c=a:olympe.C.vh(a)&&(c=a.ub().Ba);c&&olympe.C.Yc([b],d=>{c.zh(d)},'setDefaultValue');return a};olympe.C.Ci=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.Gs?(h=h.Ba,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.vh(h)&&(h=h.ub().Ba,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
|
|
411
|
+
olympe.C.Ae=function(a,b,c,d){return M(olympe.C.Ci(a,b,c,d||'syncProxies'))};const tc=a=>{for(const b of a)if(olympe.C.qf(b)||olympe.C.vh(b))return!1;return!0};olympe.C.ua=function(a,b,c,d,e){if(tc(a))return b(...a);const f=olympe.C.Ci(a,b,c,d||'TransformFlows');e&&olympe.C.Yc([e],g=>{f.zh(g)},'setDefaultValue');return M(f)};olympe.C.Yc=function(a,b,c){tc(a)?b(...a):olympe.C.Ci(a,b,void 0,c||'processFlows')};
|
|
412
|
+
olympe.C.cF=function(a,b,c){const d=olympe.C.Yf(a)?a.Mb():olympe.C.vh(a)?a.ub().hi:a.hi,e=olympe.C.bc(d,c),f=olympe.U.Promise.vj(g=>{e.getContext().fb()||e.update(g)},b);olympe.C.Yc([a],g=>f(g).then());return e.ub()};olympe.C.xt=function(a,b){if(tc(a))b(...a);else{const c=olympe.C.Za();olympe.C.Ci(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
|
|
413
413
|
olympe.C.eo=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.gb(g)?(g=g.Ba,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.vh(g)&&(g=g.ub().Ba,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Nc:b,Xn:e,tg:f,eA:!1,cd:c})};olympe.C.yt=function(a,b){const c=olympe.C.Za();olympe.C.eo(a,(...d)=>{olympe.C.Za().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.aF=function(a,b,c){a=new olympe.C.nk(a,c);b(a);return a.ub()};
|
|
414
|
-
olympe.C.bc=function(a,b='flowSource'){return new olympe.C.nk(a,b)};olympe.C.IF=function(a,b,c,d){const e=olympe.C.Za();olympe.C.
|
|
414
|
+
olympe.C.bc=function(a,b='flowSource'){return new olympe.C.nk(a,b)};olympe.C.IF=function(a,b,c,d){const e=olympe.C.Za();olympe.C.Ci(a,(...f)=>{olympe.C.Za().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.Hj=function(a,b,c){olympe.C.ua([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.nF=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.ub()};
|
|
415
415
|
olympe.C.kF=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.MF=function(a){return olympe.C.Za().tc(a)};olympe.C.hF=function(a,b,c){olympe.C.$x(a?a.Ba:a,b,c)};
|
|
416
416
|
olympe.C.$x=function(a,b,c){if(a){var d=a.T();null===sc&&(sc={});if(sc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{sc[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}`:
|
|
417
417
|
''))});c.onDestroy(()=>{delete sc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.gF=function(){let a='',b=olympe.C.Za();for(;null!==b;)a+=b.Pn()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
|
|
418
|
-
olympe.C.sa=function(a){if(void 0===a)return olympe.C.$.ZERO;if(a instanceof olympe.C.$)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.$.Oq;if(a===Math.PI)return olympe.C.$.PI;if(Infinity===a)return olympe.C.$.Ru;if(-Infinity===a)return olympe.C.$.Ov;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.
|
|
418
|
+
olympe.C.sa=function(a){if(void 0===a)return olympe.C.$.ZERO;if(a instanceof olympe.C.$)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.$.Oq;if(a===Math.PI)return olympe.C.$.PI;if(Infinity===a)return olympe.C.$.Ru;if(-Infinity===a)return olympe.C.$.Ov;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.ii.has(a)||olympe.C.ii.set(a,new olympe.C.$(a)),olympe.C.ii.get(a)):new olympe.C.$(a)}return null};
|
|
419
419
|
olympe.C.ge=function(a){return void 0===a?olympe.C.Xd(olympe.C.$):olympe.C.Xd(olympe.C.$,olympe.C.qf(a)?a:olympe.C.sa(a))};olympe.C.Nz=olympe.C.$.animate;olympe.C.xF=function(a,b){return new olympe.C.Ut(a,b)};olympe.C.yb=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.el.has(a)?olympe.C.el.get(a):new olympe.C.Sa(a)};
|
|
420
420
|
olympe.C.CF=function(a){return void 0===a?olympe.C.Xd(olympe.C.Sa):olympe.C.Xd(olympe.C.Sa,olympe.C.qf(a)?a:olympe.C.yb(a))};olympe.C.Sb=function(a){return a instanceof olympe.C.da?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.da.D:olympe.C.da.j};olympe.C.zF=function(a){return void 0===a?olympe.C.Xd(olympe.C.da):olympe.C.Xd(olympe.C.da,olympe.C.qf(a)?a:olympe.C.Sb(a))};olympe.C.yF=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
|
|
421
421
|
olympe.C.BF=function(a){return olympe.C.Xd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.pt=a=>a instanceof olympe.C.da||a instanceof olympe.C.$||a instanceof olympe.C.Sa||a instanceof olympe.C.eb;olympe.C.DF=function(a,b){return olympe.C.Xd(olympe.C.$b,void 0===a&&void 0===b?void 0:new olympe.C.$b(a,b))};olympe.C.Zz=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.Xd(olympe.C.Color,e)};olympe.C.AF=olympe.C.Zz;
|
|
422
|
-
olympe.C.Rx=function(a){olympe.C.G=a;olympe.C.
|
|
422
|
+
olympe.C.Rx=function(a){olympe.C.G=a;olympe.C.oi=olympe.C.nh()};olympe.C.nh=function(){olympe.C.ho||(olympe.C.ho=new olympe.C.Ur);return olympe.C.ho};olympe.C.Za=function(){olympe.C.oi||(olympe.C.oi=olympe.C.nh());return olympe.C.oi};olympe.C.Gt=function(a){const b=olympe.C.oi;olympe.C.ao(a)&&(olympe.C.oi=a);return null!=b?b:null};
|
|
423
423
|
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.$.Qb(a);break;case 'string':b=olympe.C.Sa.Qb(a);break;case 'vector2':b=olympe.C.$b.Qb(a);break;case 'color':b=olympe.C.Color.Qb(a);break;case 'boolean':b=olympe.C.da.Qb(a)}return b}return null};function uc(a){a.j.fb()||(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)}
|
|
424
424
|
olympe.C.yD=class{constructor(){this.j=new olympe.C.Zb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.bc(vc,'Last slot manager entry');this.size=lc(olympe.C.bc(olympe.C.$,'SlotManager size').repeat(this.D.ub().Qn()),olympe.C.$.ZERO);this.N=lc(olympe.C.bc(olympe.C.$,'last valid slots'),olympe.C.sa(-1))});this.R=[];this.H=[];this.j.onDestroy(()=>{uc(this)})}};
|
|
425
425
|
class vc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Zb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=lc(olympe.C.bc(olympe.C.$),olympe.C.$.ZERO);olympe.C.gb(b)?e.repeat(b):e.update(b);this.j=olympe.C.bc(olympe.C.$);this.F=this.j.ub().he(e.ub())});this.next=null}T(){return this.id}iz(){return this.j.ub()}Qn(){return this.F}Kd(){return this.H}rz(){return this.N}BA(a){this.H=a}oA(a){null===a?this.j.update(olympe.C.$.ZERO):(this.j.repeat(a.Qn()),a.next=this)}ev(){this.j.clear();
|
|
@@ -427,16 +427,16 @@ this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=vc.pro
|
|
|
427
427
|
function Ac(a){var b=olympe.host.Qe.Jd,c=olympe.host.Qe.Vq.As;++a.F;const d=a.F;yc(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.gb(p)?(h.push(n),p=p.Ba):olympe.C.Yf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{zc(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
|
|
428
428
|
{zc(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.Yd(a.N.bind(a,d));a=M(e);a.ox=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')}Wa(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Td=class{constructor(a){this.j=a;this.D=olympe.C.Za()}F(){return this.j}kd(){return this.j.Ba.kd()||this.D.kd()}fb(){return this.j.Ba.fb()}};olympe.host.Td.prototype.F.K=new olympe.C.J(()=>olympe.host.Qe.Td,[]);olympe.host.Yk=class{j(){}D(){}};olympe.host.Lu=class{};function Bc(a,b){var c=olympe.host.ag;const d=olympe.U.Mc(),e=new olympe.C.Zb('onTimeout context');c.j.X(b,d,()=>{e.fb()||e.kd()||e.run(a);c.j.F(d)});return new olympe.host.Jd.D(c.j,d,e)}function Cc(a,b){var c=olympe.host.ag;const d=olympe.U.Mc(),e=new olympe.C.Zb('onInterval context');c.j.R(b,d,()=>{e.fb()||e.kd()?c.j.D(d):e.run(a)})}olympe.host.Jd=class{constructor(a){this.j=Ac(a)}};olympe.host.Jd.j=class{constructor(a,b,c){this.ag=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
|
|
429
429
|
olympe.host.Jd.H=class extends olympe.host.Jd.j{cancel(){this.ag.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Jd.D=class extends olympe.host.Jd.j{cancel(){this.ag.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Jd.F=class extends olympe.host.Jd.j{cancel(){this.ag.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Le=class{H(a,b){return null!=b?b:''}ia(a,b){return null!=b?b:''}Ha(a,b){return null!=b?b:''}F(){}j(a,b){return null!=b?b:''}D(){}};olympe.host.Le.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Qe={};olympe.host.Qe.Td=class{destroy(){}};olympe.host.Qe.Td.prototype.destroy=olympe.host.Qe.Td.prototype.destroy;olympe.host.Qe.Vq={JA:100,LA:101,KA:102,NA:103,MA:104,IA:105,pD:201,nD:202,kD:204,sD:205,jD:206,mD:207,qD:208,tD:209,uD:210,vD:211,lD:212,rD:218,oD:219,wD:220,iD:221,hD:222,DD:300,ED:301,FD:302,JD:303,KD:304,LD:305,GD:310,HD:311,ID:312,JC:400,KC:401,LC:402,xC:450,qC:500,oC:501,tC:502,sC:503,pC:504,rC:505,dE:600,VD:601,ZD:602,RD:603,SD:604,PD:605,UD:606,jE:607,bE:608,MD:609,QD:610,TD:611,aE:612,fE:613,ND:614,eE:615,$D:616,iE:617,WD:618,XD:619,YD:620,cE:630,OD:631,gE:632,hE:633,PE:700,sE:701,tE:702,
|
|
430
|
-
uE:703,wE:704,xE:705,yE:706,vE:707,AE:708,zE:709,BE:710,FE:711,NE:712,CE:713,DE:714,GE:715,HE:716,JE:717,KE:718,ME:719,IE:720,LE:721,OE:722,EE:723,QE:724,RE:725,As:800};olympe.host.Qe.Jd=class{N(){}X(){}F(){}R(){}D(){}};olympe.host.P={Uk:'host.System',bq:'host.HistoryManager',Wr:'host.Scheduler',Ca:'host.platform.Logger',Ea:'host.Manager',Ie:'host.ProcessManager'};olympe.host.Config={Nk:'host.role',cq:'host.currentHost',tr:'host.processProbe',cs:'host.gracefulShutdownTimeout'};olympe.host.Yg={Ll:'active',
|
|
431
|
-
olympe.V.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';a.setParameter(olympe.host.Config.cq,d);b=olympe.host.Yg.Ll;c=olympe.host.Yg.
|
|
432
|
-
[olympe.host.P.Ea],e=>{null===olympe.host.ag&&(olympe.host.ag=new olympe.host.Jd(e));return olympe.host.ag},!0)},'olympe.host');olympe.V.run([olympe.host.P.Wr],a=>a,'olympe.host.scheduler');olympe.V.run([olympe.host.P.Ea],a=>a,'olympe.host');olympe.V.run([olympe.host.P.Ie],a=>{olympe.host.rl=()=>a});olympe.error={};olympe.error.qd=class extends Error{constructor(a,b=olympe.error.mc.$k){super(a);this.code=b}Bj(){return this.code}};olympe.error.mc={$k:0,
|
|
433
|
-
olympe.error.br=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.
|
|
434
|
-
olympe.error.lr=class extends olympe.error.qd{constructor(){super('Working offline',olympe.error.mc.
|
|
435
|
-
olympe.error.aq=class extends olympe.error.kn{};olympe.net={};olympe.net.ra={};olympe.net.ra.Gd={Rg:'POST',GET:'GET',Iu:'HEAD',ur:'PUT',Ec:'DELETE',gr:'OPTIONS',MC:'PATCH'};olympe.net.ra.ResponseType={mn:'text',JSON:'json',Tl:'blob',
|
|
436
|
-
olympe.net.ra.bk={$B:'text/html',JSON:'application/json',nx:'application/zip',le:'application/octet-stream'};olympe.net.ra.Ub={Vo:0,
|
|
437
|
-
olympe.net.pj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ba(){}Z(){}X(){}D(){}};function N(a,b,c,d){a=olympe.U.$z(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.
|
|
438
|
-
olympe.net.
|
|
439
|
-
olympe.net.
|
|
430
|
+
uE:703,wE:704,xE:705,yE:706,vE:707,AE:708,zE:709,BE:710,FE:711,NE:712,CE:713,DE:714,GE:715,HE:716,JE:717,KE:718,ME:719,IE:720,LE:721,OE:722,EE:723,QE:724,RE:725,As:800};olympe.host.Qe.Jd=class{N(){}X(){}F(){}R(){}D(){}};olympe.host.P={Uk:'host.System',bq:'host.HistoryManager',Wr:'host.Scheduler',Ca:'host.platform.Logger',Ea:'host.Manager',Ie:'host.ProcessManager'};olympe.host.Config={Nk:'host.role',cq:'host.currentHost',tr:'host.processProbe',cs:'host.gracefulShutdownTimeout'};olympe.host.Yg={Ll:'active',Xh:'preview'};olympe.host.ag=null;
|
|
431
|
+
olympe.V.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';a.setParameter(olympe.host.Config.cq,d);b=olympe.host.Yg.Ll;c=olympe.host.Yg.Xh;E(a,olympe.host.Config.Nk,d.startsWith(`${c}.`)?c:b);Xa(a,olympe.host.P.Uk);Xa(a,olympe.host.P.bq);C(a,olympe.host.P.Ie,olympe.host.Le);D(a,olympe.host.P.Ca,[olympe.ha.P.Ea],e=>e.dd('host'));C(a,olympe.host.P.Ea,olympe.host.Ta,olympe.host.P.Ca,olympe.V.P.Fg);D(a,olympe.host.P.Wr,
|
|
432
|
+
[olympe.host.P.Ea],e=>{null===olympe.host.ag&&(olympe.host.ag=new olympe.host.Jd(e));return olympe.host.ag},!0)},'olympe.host');olympe.V.run([olympe.host.P.Wr],a=>a,'olympe.host.scheduler');olympe.V.run([olympe.host.P.Ea],a=>a,'olympe.host');olympe.V.run([olympe.host.P.Ie],a=>{olympe.host.rl=()=>a});olympe.error={};olympe.error.qd=class extends Error{constructor(a,b=olympe.error.mc.$k){super(a);this.code=b}Bj(){return this.code}};olympe.error.mc={$k:0,Qi:1,Tq:401,mk:403,$i:404,Sv:406,TIMEOUT:408,Dw:503,Sq:530,bm:600,Uq:1006};olympe.error.Zk=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.TIMEOUT)}};olympe.error.qr=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.Dw)}};olympe.error.yk=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.Tq)}};olympe.error.Nm=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.$i)}};
|
|
433
|
+
olympe.error.br=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.Qi)}};olympe.error.ar=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.Sv)}};olympe.error.AC=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.Sq)}};olympe.error.fm=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.bm)}};olympe.error.up=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.Qi)}};
|
|
434
|
+
olympe.error.lr=class extends olympe.error.qd{constructor(){super('Working offline',olympe.error.mc.Qi)}};olympe.error.ep=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.Qi)}};olympe.error.Sr=class extends olympe.error.qd{constructor(a){super(a,olympe.error.mc.Qi)}};olympe.error.kn=class extends olympe.error.qd{constructor(a,b){super(a);this.id=b}T(){return this.id}};olympe.error.Th=class extends olympe.error.kn{};olympe.error.Qo=class extends olympe.error.kn{};
|
|
435
|
+
olympe.error.aq=class extends olympe.error.kn{};olympe.net={};olympe.net.ra={};olympe.net.ra.Gd={Rg:'POST',GET:'GET',Iu:'HEAD',ur:'PUT',Ec:'DELETE',gr:'OPTIONS',MC:'PATCH'};olympe.net.ra.ResponseType={mn:'text',JSON:'json',Tl:'blob',di:'uint8array',le:'stream'};olympe.net.ra.Headers={Eh:'content-type',YA:'content-length',Ql:'authorization',Tt:'access-control-allow-origin',Rt:'access-control-allow-headers',St:'access-control-allow-methods',Mp:'x-forwarded-host',Np:'x-forwarded-proto'};
|
|
436
|
+
olympe.net.ra.bk={$B:'text/html',JSON:'application/json',nx:'application/zip',le:'application/octet-stream'};olympe.net.ra.Ub={Vo:0,Vh:200,Yo:201,Sj:202,Rl:400,$w:401,mk:403,$i:404,uC:405,hj:500,zw:503};function Dc(a){return a.host&&encodeURI(a.host)}function Ec(a){return encodeURI(a.path).replace(olympe.net.pj.j,(b,c)=>'%'+c)}olympe.net.pj=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.Ah=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.Ah=d)}j(){return`${(void 0===this.Ah?443===this.port:this.Ah)?'wss':'ws'}://${Dc(this)}:${this.port}/${Ec(this)}`}toString(){return`${Dc(this)}:${this.port}/${Ec(this)}`}};
|
|
437
|
+
olympe.net.pj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ba(){}Z(){}X(){}D(){}};function N(a,b,c,d){a=olympe.U.$z(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Ui(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Mt&&(c=a.Mt.split(':'),2===c.length&&(c=ab(olympe.U.kf(),`${c[0]}:${c[1]}`),O(b,{Authorization:`Basic ${c}`})));return b}function Fc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Gc(a,b){a.D=b;return a}function O(a,b){Object.assign(a.headers,b)}
|
|
438
|
+
olympe.net.Ui=class extends olympe.net.pj{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.ra.Gd.GET;this.query=h;this.headers={};this.body=f;this.D=null!=g?g:olympe.net.ra.ResponseType.mn}Dj(){return this.headers}j(){let a=Fc(this);a=a?`?${a}`:'';if(!Dc(this))return`${Ec(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.Ah?443===this.port:this.Ah)?'https':'http'}://${Dc(this)}${b}/${Ec(this)}${a}`}toString(){return this.j()}};
|
|
439
|
+
olympe.net.Ui.Gd={Rg:'POST',GET:'GET',Iu:'HEAD',ur:'PUT',Ec:'DELETE',gr:'OPTIONS'};olympe.net.rd=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}Lc(){return this.status}Dj(){return this.headers}};function Hc(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.Za(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Ic(a.j,c,b).finally(()=>{d.Zf(e);a.j.j.delete(c)})}olympe.net.Ta=class{constructor(a){this.G=a;this.j=new olympe.net.ye.Mu(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.R()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}N(){}H(){}rf(){}R(){}};function Jc(a){const b=olympe.net.AMQPClient.j.Be,c=olympe.net.AMQPClient.j.CONNECTING,d=olympe.net.AMQPClient.j.Ac,e=olympe.net.AMQPClient.j.Bb;mb(a.state,b,a.ia.bind(a),[c]);mb(a.state,c,()=>{a.G.debug('Connecting to the AMQP Client..');a.F=!0;F(a.state,b)},[d]);mb(a.state,d,(f,g)=>u(function*(){a.F=null!=g?g:a.F;a.F||a.D.clear();yield Kc(a);if(a.F&&!a.X&&null!==a.N){let h,k;setTimeout(()=>{a.G.debug('Reconnecting to the AMQPClient..');F(a.state,c)},null!=(k=null==(h=a.N)?void 0:h.zt)?k:5E3)}}),
|
|
440
440
|
[b,c,e]);nb(a.state,e,(f,g)=>{a.G.warn(`Error occurred with the AMQP Client, (was in state ${f}): ${g}`);F(a.state,d,a.F)});a.state.start(d,!1)}function Lc(a,b){kb(a.state,olympe.net.AMQPClient.j.Be,b)}function Mc(a,b){kb(a.state,olympe.net.AMQPClient.j.CONNECTING,b)}function Nc(a,b){kb(a.state,olympe.net.AMQPClient.j.Ac,b)}
|
|
441
441
|
function Kc(a){return u(function*(){const b=a.j,c=a.H;a.j=a.H=null;!1===(null==b?void 0:b.closed)&&b.close().catch(d=>a.G.debug(`Issue while closing channel: ${d}`));!1===(null==c?void 0:c.closed)&&(yield olympe.U.Promise.bg(c.close(),500,'AMQPClient close timeout').catch(d=>{a.G.debug(`Error while closing client: ${d}`)}))})}function Oc(a){return null!==a.H&&!a.H.closed&&null!==a.j&&!a.j.closed&&a.F}function Pc(a,b){if(!Oc(a))throw new olympe.error.fm(null!=b?b:'Not connected to the bus');}
|
|
442
442
|
function Qc(a){let b,c;return Number.parseInt(null!=(c=null==(b=/^.*\((\d+)\)$/.exec(a instanceof Error?a.message:a))?void 0:b[1])?c:'0',10)}
|
|
@@ -457,28 +457,28 @@ this;return u(function*(){if(null===a.N)throw Error('Cannot connect to the bus w
|
|
|
457
457
|
olympe.error.mc.bm;const f=olympe.error.mc.Uq,g=Qc(d);if(g===e||g===f){b.G.debug(`Connection closed by network: ${d}`);F(b.state,olympe.net.AMQPClient.j.Ac,b.F);return}}else b.F=!1;e=b.state;F(e,e.j,d)};try{yield b.H.connect(),b.ba(b.H,d=>{b.G.debug(`AMQP connection closed ${d?'with error':'without error'}`);d||F(b.state,olympe.net.AMQPClient.j.Ac,b.F)})}catch(d){if(d instanceof Error)switch(Qc(d)){case olympe.error.mc.bm:case olympe.error.mc.Uq:throw new olympe.error.fm(d);case olympe.error.mc.Sq:case olympe.error.mc.Tq:case olympe.error.mc.mk:throw b.X=
|
|
458
458
|
!0,new olympe.error.yk('Connection to the bus is not allowed: check your credentials');}throw new olympe.error.qd(`Connection to the bus failed: check your config and the availability of the bus: ${d}`);}const c=()=>u(function*(){b.j=yield Xc(b,{id:1,Wz:e=>{b.G.debug(`Error with channel 0: ${e}`);b.j=null;e=Qc(e);e!==olympe.net.AMQPClient.D.an&&e!==olympe.net.AMQPClient.D.sr||olympe.U.Promise.Bt(f=>{b.G.warn(`Trying to recreate channel after being closed, tentative ${f+1}..`);return c()},500).catch(f=>
|
|
459
459
|
{var g=b.state;F(g,g.j,f)})}});yield b.j.confirmSelect();let d;yield b.j.prefetch(null!=(d=b.N.hA)?d:20);b.j.onReturn=e=>{const f=`Message returned by the server: ${e.bodyToString()}`;let g;null==(g=b.R.get(parseInt(e.properties.messageId,10)))||g(f)};b.D.forEach(({Wn:e,exclusive:f},g)=>{Rc(b,g,f,e)})});yield c()})}push(a){return vb(this.wa,a)}Z(){}ba(){}};olympe.net.AMQPClient.j={CONNECTING:'CONNECTING',Be:'CONNECTED',Ac:'DISCONNECTED',Bb:'ERROR'};
|
|
460
|
-
olympe.net.AMQPClient.D={$k:0,an:404,XC:405,sr:406,RA:504,sq:541};olympe.net.AMQPMessage=class{constructor(a,b,c){this.H=a.redelivered;this.D=a.deliveryTag;this.N=a.routingKey;this.j=c;this.F=null;try{const d=a.bodyToString();this.F=JSON.parse(null!=d?d:'null')}catch(d){console.warn(`AMQPMessage: Failed to parse message payload: ${d}`)}}jc(){let a;return null!=(a=this.F)?a:{}}
|
|
461
|
-
this.j.closed?this.j.basicNack(this.D,!1,a).catch(b=>{olympe.ha.Wa('amqp').error(`Failed to reject message ${this.D}: ${b}`)}):Promise.resolve()}};olympe.net.
|
|
462
|
-
olympe.net.
|
|
463
|
-
olympe.V.config(function(a){E(a,olympe.net.Config.Cf,3141);E(a,olympe.net.Config.gq,100);E(a,olympe.net.Config.zs,!1);E(a,olympe.net.Config.fq,null);E(a,olympe.net.Config.Hm,'frontend');E(a,olympe.net.Config.
|
|
460
|
+
olympe.net.AMQPClient.D={$k:0,an:404,XC:405,sr:406,RA:504,sq:541};olympe.net.AMQPMessage=class{constructor(a,b,c){this.H=a.redelivered;this.D=a.deliveryTag;this.N=a.routingKey;this.j=c;this.F=null;try{const d=a.bodyToString();this.F=JSON.parse(null!=d?d:'null')}catch(d){console.warn(`AMQPMessage: Failed to parse message payload: ${d}`)}}jc(){let a;return null!=(a=this.F)?a:{}}zi(){return this.H}ack(){return!1===this.j.closed?this.j.basicAck(this.D,!1).catch(a=>{olympe.ha.Wa('amqp').error(`Failed to ack message ${this.D}: ${a}`)}):Promise.resolve()}reject(a){return!1===
|
|
461
|
+
this.j.closed?this.j.basicNack(this.D,!1,a).catch(b=>{olympe.ha.Wa('amqp').error(`Failed to reject message ${this.D}: ${b}`)}):Promise.resolve()}};olympe.net.gi=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}F(){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.')}D(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}R(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
|
|
462
|
+
olympe.net.gi.ALL='*';olympe.net.Mw=class{register(){return u(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Ea:'net.Manager',Ca:'net.Logger',oj:'net.WebServer',Ew:'net.ServiceWorkerManager',Pm:'net.OfflineConfig'};olympe.net.Config={Cf:'net.httpPort',gq:'net.httpBodyLimit',zs:'net.http2',fq:'net.httpsCertificatesPath',Hm:'net.localNetworkSuffix',Uh:'offline.enabled',Om:'offline.autoBackOnline',fr:'offline.downloadBatchSize'};
|
|
463
|
+
olympe.V.config(function(a){E(a,olympe.net.Config.Cf,3141);E(a,olympe.net.Config.gq,100);E(a,olympe.net.Config.zs,!1);E(a,olympe.net.Config.fq,null);E(a,olympe.net.Config.Hm,'frontend');E(a,olympe.net.Config.Uh,!1);E(a,olympe.net.Config.Om,!1);E(a,olympe.net.Config.fr,20);Xa(a,olympe.net.P.Ea);D(a,olympe.net.P.Ca,[olympe.ha.P.Ea],b=>b.dd('net'));C(a,olympe.net.P.oj,olympe.net.gi,olympe.net.P.Ca);C(a,olympe.net.P.Ew,olympe.net.Mw);D(a,olympe.net.P.Pm,[new olympe.V.ma(olympe.net.Config.Uh),new olympe.V.ma(olympe.net.Config.Om)],
|
|
464
464
|
(b,c)=>new Map([['offlineEnabled',b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Xa.node.host={};olympe.Xa.node.host.Td=function(a,b){this.G=b};olympe.Xa.node.host.Td.prototype.constructor=olympe.Xa.node.host.Td;olympe.Xa.node.host.Td.prototype.destroy=function(){};olympe.Xa.node.host.Td.prototype.destroy=olympe.Xa.node.host.Td.prototype.destroy;olympe.Xa.node.host.Td.prototype.Wa=function(){return this.G};olympe.Xa.node.host.Td.ya=[olympe.host.Qe.Td];olympe.Xa.node.host.Xq=class{constructor(a){this.G=a}};olympe.Xa.node.host.Xq.ya=[olympe.host.Lu];olympe.Xa.node.host.Jd=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}X(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.Wq.register(olympe.host.Qe.Vq.As,olympe.Xa.node.host.Jd);olympe.Xa.node.host.Jd.ya=[olympe.host.Qe.Jd];olympe.Xa.node.host.Yk=class{constructor(a){this.G=a}j(){return olympe.C.da.D}D(){return!0}};olympe.Xa.node.host.Yk.ya=[olympe.host.Yk];function $c(a){a.wa.D('readinessProbe','/readiness',[olympe.net.ra.Gd.GET],()=>ad(a,a.ba)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.wa.D('livenessProbe','/liveness',[olympe.net.ra.Gd.GET],()=>ad(a,a.Z)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.H(()=>a.wa.stop())}
|
|
465
465
|
function bd(a,b){b=Array.from(b.values()).map(c=>c());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 cd(a){return u(function*(){try{const b=yield bd(a,a.N),c=yield bd(a,a.R),d=yield bd(a,a.X);if(b||c||d)throw Error('Failed to gracefully close the backend');}finally{a.N.clear(),a.R.clear(),a.X.clear()}})}
|
|
466
|
-
function ad(a,b){const c=olympe.net.ra.Ub.
|
|
466
|
+
function ad(a,b){const c=olympe.net.ra.Ub.Vh,d=olympe.net.ra.Ub.hj;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.rd('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.rd(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
|
|
467
467
|
olympe.Xa.node.host.Le=class extends olympe.host.Le{constructor(a,b,c,d=!0){super();this.G=a;this.wa=b;this.Ua=c;this.Z=new Map;this.ba=new Map;this.R=new Map;this.N=new Map;this.X=new Map;d&&$c(this)}j(a,b=olympe.U.jf(),c=olympe.host.Le.j.ALL){switch(c){case olympe.host.Le.j.LIVENESS:this.Z.set(b,a);break;case olympe.host.Le.j.READINESS:this.ba.set(b,a);break;default:this.Z.set(b,a),this.ba.set(b,a)}return b}D(a){this.ba.delete(a);this.Z.delete(a)}H(a,b=olympe.U.jf()){this.R.set(b,this.bg(b,a,this.Ua));
|
|
468
468
|
return b}ia(a,b=olympe.U.jf(),c){this.N.set(b,this.bg(b,a,null!=c?c:this.Ua));return b}Ha(a,b=olympe.U.jf()){this.X.set(b,this.bg(b,a,this.Ua));return b}F(a){this.R.has(a)?this.R.delete(a):this.N.has(a)?this.N.delete(a):this.X.delete(a)}bg(a,b,c){return()=>olympe.U.Promise.bg(b(),c,`Shutdown hook ${a} has timeout`)}};olympe.V.config(function(a){E(a,olympe.host.Config.tr,!0);E(a,olympe.host.Config.cs,1E4);Va(a,olympe.host.P.bq,olympe.Xa.node.host.Xq,olympe.host.P.Ca);Va(a,olympe.host.P.Uk,olympe.Xa.node.host.Yk,olympe.host.P.Ca);C(a,olympe.host.P.Ie,olympe.Xa.node.host.Le,olympe.host.P.Ca,olympe.net.P.oj,new olympe.V.ma(olympe.host.Config.cs),new olympe.V.ma(olympe.host.Config.tr))},'olympe.native.node.host');olympe.V.run([olympe.host.P.Ie],a=>{olympe.Xa.node.host.rl=()=>a});olympe.net.ye={};function Ic(a,b,c){const d=olympe.net.ra.Ub.Vo,e=olympe.net.ra.Ub.hj,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.Dj(),body:null!=(k=c.body)?k:void 0,signal:f.signal}).then(l=>l.ok?ed(l,c.D).catch(n=>new olympe.net.rd(`Error parsing response from ${g} with method ${h}: ${n.message}`,e,'Error handling response')):new olympe.net.rd(`Error fetching data from ${g} with method ${h}`,l.status,l.statusText,l.headers)).catch(l=>'AbortError'===
|
|
469
469
|
l.name?new olympe.net.rd('',d,'Request canceled'):new olympe.net.rd(`Error connecting to ${g} with method ${h}`,e,'Failed to fetch:'+l.message))}
|
|
470
|
-
function ed(a,b){return u(function*(){switch(b){case olympe.net.ra.ResponseType.Tl:var c=yield a.blob();break;case olympe.net.ra.ResponseType.
|
|
470
|
+
function ed(a,b){return u(function*(){switch(b){case olympe.net.ra.ResponseType.Tl:var c=yield a.blob();break;case olympe.net.ra.ResponseType.di:c=yield a.arrayBuffer();c=new Uint8Array(c,0,c.byteLength);break;case olympe.net.ra.ResponseType.JSON:c=yield a.json();break;case olympe.net.ra.ResponseType.le:c=a.body;break;default:c=yield a.text()}return new olympe.net.rd(c,a.status,a.statusText,a.headers)})}olympe.net.ye.Mu=class{constructor(a){this.G=a;this.j=new Map}};olympe.net.ye.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.ia(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));
|
|
471
471
|
this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):bb(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()||
|
|
472
472
|
this.G.j()&&!a.startsWith('ping'))&&this.G.debug(b,'>',a);try{this.j.send(a)}catch(d){this.G.error(`Error while sending message to websocket: ${d}`)}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}`}`);
|
|
473
473
|
this.j.close(1E3);return}}this.G.debug('Try to force close native websocket, but not open nor connecting')}ba(a){this.R=a||null}Z(a){this.F=a||null}D(a){this.N=a||null}X(a){this.H=a||null}ia(){}};olympe.net.ye.WebSocket.ya=[olympe.net.WebSocket];olympe.Xa.node.net={};olympe.Xa.node.net.Uv=class extends olympe.net.Ta{R(){return'NodeJS'}rf(){return olympe.C.da.D}D(a){var b=this.F++;a=a.j();this.G.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Xa.node.net.Wv(b,this.G);b.open(a);return b}H(){this.G.warn('DOWNLOAD FILE not available with node native implementation. URL:')}N(a,b){return new olympe.Xa.node.net.Vv(a,b)}};olympe.Xa.node.net.Vv=class extends olympe.net.AMQPClient{Z(a,b='olympe-node'){var c=a.host;const d=a.port,e=a.path,f=a.CA,g=a.oz;var h=URL,k=a.Ah?'amqps':'amqp';var l=a.user;a=a.ed;l=`${encodeURIComponent(f||'/')}|${encodeURIComponent(l)}|${encodeURIComponent(a)}`;c=new h(`${k}://${l}:_@${c}:${d}${e}/${f}`);0<g&&c.searchParams.append('heartbeat',`${g}`);c.searchParams.append('name',b);this.G.debug(`Open AMQP Socket to: ${c.toString()}`);return new amqp.AMQPClient(c.toString())}ba(a,b){a.socket.on('close',
|
|
474
|
-
b)}};olympe.Xa.node.net.Wv=class extends olympe.net.ye.WebSocket{ia(a){return new (require('ws'))(a)}};olympe.Xa.node.net.Config={rE:'native.html.net.useWorkers'};olympe.V.config(function(a){a.getParameter(olympe.net.Config.
|
|
474
|
+
b)}};olympe.Xa.node.net.Wv=class extends olympe.net.ye.WebSocket{ia(a){return new (require('ws'))(a)}};olympe.Xa.node.net.Config={rE:'native.html.net.useWorkers'};olympe.V.config(function(a){a.getParameter(olympe.net.Config.Uh)&&a.setParameter(olympe.net.Config.Uh,!1);Va(a,olympe.net.P.Ea,olympe.Xa.node.net.Uv,olympe.net.P.Ca,olympe.host.P.Ea)},'olympe.native.node.net');olympe.Xa.node.net.http={};const fd=require('fastify'),{Readable:gd}=require('stream'),hd={Tk:0,Sk:1,gn:2},id=olympe.net.ra.Gd.gr,jd=olympe.net.ra.Headers.Tt,kd=olympe.net.ra.Headers.Rt,ld=olympe.net.ra.Headers.St,md=olympe.net.ra.Ub.Vh;
|
|
475
475
|
function nd(a,b){const c=b.methods,d=b.Wn,e=b.headers,f=b.origin;a.j.route({bodyLimit:a.X<<20,url:b.path,method:[...c,id],handler:(g,h)=>{a.G.debug('Incoming request:','hostname:',g.hostname,'headers:',g.headers);var k=g.method;const l={[jd]:f,[ld]:c,[kd]:e};if(k===id)return a.G.debug('< HTTP: OPTIONS'),h.code(md).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=
|
|
476
|
-
new olympe.net.
|
|
476
|
+
new olympe.net.Ui(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,v]of Object.entries(g.headers))k.headers[t]=v;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 v=t.Lc(),x=t.getData();(x instanceof Uint8Array||x instanceof ArrayBuffer||x instanceof gd)&&h.type(olympe.net.ra.bk.le);if(v>=olympe.net.ra.Ub.hj)throw Error(x);v>=olympe.net.ra.Ub.Rl?a.G.warn('> HTTP: client bad request: reply with error:',
|
|
477
477
|
x):a.G.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(v).headers(Object.assign(l,t.Dj())).send(x)}).catch(t=>{a.G.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.ra.Ub.hj).headers(Object.assign(l,{[olympe.net.ra.Headers.Eh]:'text/plain'})).send('Internal server error')})}})}
|
|
478
|
-
olympe.Xa.node.net.http.
|
|
478
|
+
olympe.Xa.node.net.http.gi=class extends olympe.net.gi{constructor(a,b,c,d,e){super(a);this.X=c;this.port=b;this.Z=d;this.N=e;this.j=this.createServer();this.H=new Map;this.state=hd.Tk;this.ld=new Set;this.timer=null}D(a,b,c,d){const e=olympe.net.gi.ALL;this.H.set(a,{path:b,methods:c,Wn:d,headers:e,origin:e});return this.F()}R(a){const b=this;return u(function*(){b.H.delete(a);return 0<b.H.size?b.F():b.stop()})}start(){if(this.state===hd.Tk)return this.F();if(this.state===hd.Sk){for(const a of this.H.values())nd(this,
|
|
479
479
|
a);return this.j.listen({port:this.port,host:'0.0.0.0'}).then(a=>{this.state=hd.gn;this.G.debug('Web server listening on '+a);this.ld.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.ld.forEach(b=>b(a))}).finally(()=>this.ld.clear())}return Promise.reject('Try to start a webservice already started')}F(){return this.state===hd.Sk?(new Promise((a,b)=>{this.ld.add(c=>c?b(c):a())})).then(()=>this.F()):new Promise((a,b)=>{this.ld.add(c=>c?b(c):a());this.vj(()=>{const c=this;return u(function*(){c.state=
|
|
480
480
|
hd.Sk;yield c.j.close();c.j=c.createServer();yield c.start()})})})}stop(){return this.state===hd.gn?this.j.close().then(()=>{this.state=hd.Tk}):Promise.resolve()}createServer(){var a=olympe.ha.zb.j.Cs,b=this.G.H();a={logger:{level:olympe.ha.zb.D[b===olympe.ha.zb.j.tk?a:b].toLowerCase()},http2:this.Z};if('string'===typeof this.N){b=require('fs');const c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.N,'key.pem')),cert:b.readFileSync(c.join(this.N,'cert.pem'))}})}a=
|
|
481
|
-
fd(a);a.addContentTypeParser('*',{parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}vj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.V.config(function(a){C(a,olympe.net.P.oj,olympe.Xa.node.net.http.
|
|
481
|
+
fd(a);a.addContentTypeParser('*',{parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}vj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.V.config(function(a){C(a,olympe.net.P.oj,olympe.Xa.node.net.http.gi,olympe.net.P.Ca,new olympe.V.ma(olympe.net.Config.Cf),new olympe.V.ma(olympe.net.Config.gq),new olympe.V.ma(olympe.net.Config.zs),new olympe.V.ma(olympe.net.Config.fq))},'olympe.native.node.net.http');olympe.Xa.node.U={};const od=require('stream').Readable,pd=require('buffer');
|
|
482
482
|
olympe.Xa.node.U.Vl=class extends olympe.U.Vl{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 u(function*(){if(a instanceof od){const d=[];for(const e=ha(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(()=>pd.resolveObjectURL(a)).catch(b=>
|
|
483
483
|
{throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.V.config(function(a){Va(a,olympe.U.P.Eg,olympe.Xa.node.U.Vl)},'olympe.native.node.utils');olympe.async={};function qd(a,b){a.H||a.X.push(a.F.tc(b))}
|
|
484
484
|
olympe.async.Gp=class{constructor(a,b=void 0===a){this.D=[];this.X=[];this.F=a||new olympe.C.Zb('Async executor context');this.ia=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.Z=olympe.U.Mc()}bg(a){0<=a&&(this.timeout=a);return this}Wa(){return this.G}add(a){this.H||this.D.push(this.F.tc(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)},
|
|
@@ -487,14 +487,14 @@ function rd(a){if(0<a.D.length){const b=a.D.shift();a.G&&a.G.log(`Executing next
|
|
|
487
487
|
olympe.async.Hk=class extends olympe.async.Gp{constructor(a,b){super(a,b);this.R=0;this.ba=!0}static create(){return new olympe.async.Hk(new olympe.C.Zb('ParallelExecutor'),!0)}run(a){this.G&&this.G.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ba=!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.ba)}start(){if(!this.N)if(super.start(),
|
|
488
488
|
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.Bv=class{D(){return u(function*(){})}X(){}N(){}F(){}R(){}forEach(){}has(){}get(){}set(){}remove(){}ba(){}Z(){}clear(){}H(){}};olympe.Eb.Cv=class{D(){}};olympe.Eb.Storage=class{open(){}write(){}close(){}};olympe.Eb.Lv=class{get(){return null}set(){return this}delete(){}};olympe.Eb.P={uk:'localStorage.KeyValueDatabaseManager',ij:'localStorage.Storage',bB:'localStorage.DatacloudStorage',Im:'localStorage.LocalStorage',Ca:'localStorage.Logger',bh:'localStorage.prefix'};olympe.V.config(function(a){Xa(a,olympe.Eb.P.uk);D(a,olympe.Eb.P.bh,[],()=>'olympe');D(a,olympe.Eb.P.Ca,[olympe.ha.P.Ea],b=>b.dd('localstorage'));C(a,olympe.Eb.P.Im,olympe.Eb.Lv)},'olympe.localstorage');olympe.L={};olympe.L.Ob={kk:'urls.FileSvc',Do:'urls.BackupSvc',Ir:'urls.RestoreBackupSvc',Kg:'urls.GetContext',Xp:'urls.GraphDef',Ro:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',ys:'urls.UserTagFromToken',ix:'urls.UserNameFromTag',hx:'urls.UserRoles',sw:'urls.RoleMembers',Ak:'urls.OpenIDSvc',Bp:'urls.EventMonitor'};
|
|
489
489
|
olympe.V.config(a=>{E(a,olympe.L.Ob.kk,'rest/filesvc');E(a,olympe.L.Ob.Do,'rest/backupsvc');E(a,olympe.L.Ob.Ir,'rest/backupsvc/restore');E(a,olympe.L.Ob.Ak,'rest/openid');E(a,olympe.L.Ob.Kg,'rest/initialData');E(a,olympe.L.Ob.Xp,'rest/querysvc/graphDef');E(a,olympe.L.Ob.Ro,'rest/querysvc/graphDef/static');E(a,olympe.L.Ob.TRANSACTION,'rest/transaction');E(a,olympe.L.Ob.ys,'rest/token');E(a,olympe.L.Ob.ix,'rest/authorization/getUserTag');E(a,olympe.L.Ob.hx,'rest/authorization/getUserRoles');E(a,olympe.L.Ob.sw,
|
|
490
|
-
'rest/authorization/roleMembers');E(a,olympe.L.Ob.Bp,'rest/backend/event')});function sd(a,b){a.validate=b.ack.bind(b);a.N=b.reject.bind(b);a.H=b.
|
|
491
|
-
olympe.L.pa=class{constructor(a,b,c,d,e,f){this.be=c;this.D=a;this.source=b;this.j=d;this.messageType=e;this.F=null!=f?f:null;this.H=!1;this.validate=()=>u(function*(){});this.N=()=>u(function*(){})}static H(a,b,c){const d=olympe.L.pa.D.Um,e=a.jc();let f;var g=olympe.L.pa,h=e[olympe.L.pa.D.DESTINATION],k=e[olympe.L.pa.D.ah],l=e[olympe.L.pa.D.Qk],n=e[olympe.L.pa.D.pg],p=e[olympe.L.pa.D.TYPE];b.R=c;return sd(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}
|
|
490
|
+
'rest/authorization/roleMembers');E(a,olympe.L.Ob.Bp,'rest/backend/event')});function sd(a,b){a.validate=b.ack.bind(b);a.N=b.reject.bind(b);a.H=b.zi();return a}
|
|
491
|
+
olympe.L.pa=class{constructor(a,b,c,d,e,f){this.be=c;this.D=a;this.source=b;this.j=d;this.messageType=e;this.F=null!=f?f:null;this.H=!1;this.validate=()=>u(function*(){});this.N=()=>u(function*(){})}static H(a,b,c){const d=olympe.L.pa.D.Um,e=a.jc();let f;var g=olympe.L.pa,h=e[olympe.L.pa.D.DESTINATION],k=e[olympe.L.pa.D.ah],l=e[olympe.L.pa.D.Qk],n=e[olympe.L.pa.D.pg],p=e[olympe.L.pa.D.TYPE];b.R=c;return sd(new g(h,k,l,n,p,b.N(null!=(f=e[d])?f:null)),a)}zi(){return this.H}ic(){return this.D}jb(){return this.source}getType(){return this.messageType}jc(){return this.F}ack(){return this.validate()}reject(){return this.N()}fa(a,
|
|
492
492
|
b){const c=olympe.L.pa.D.Um,d={[olympe.L.pa.D.DESTINATION]:this.D,[olympe.L.pa.D.ah]:this.source,[olympe.L.pa.D.Qk]:this.be,[olympe.L.pa.D.pg]:this.j,[olympe.L.pa.D.TYPE]:this.messageType};null!==this.F&&(a.X=b,d[c]=a.fa(this.F));return d}toString(){return`Message(dest: ${this.D}, src: ${this.source}, seqId: ${this.be}, topic: ${this.j}, type: ${this.messageType}, payload: ${this.F})`}};olympe.L.pa.D={DESTINATION:'d',ah:'s',Qk:'i',pg:'tp',TYPE:'t',Um:'p',Jf:'tk'};
|
|
493
493
|
olympe.L.pa.j={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,bl:4,le:5,pg:6,Bb:7,Xr:10,rs:11,kg:12,vs:13,fn:14,Sp:15};olympe.L.pa.F={ej:'__hc_i',Xm:'__hc_o'};olympe.L.hn=class extends olympe.L.pa{constructor(a,b,c,d,e,f,g){super(a,b,d,e,f,g);this.ed=c}static H(a,b,c){const d=olympe.L.pa.D.Um,e=a.jc();let f;var g=olympe.L.hn,h=e[olympe.L.pa.D.DESTINATION],k=e[olympe.L.pa.D.ah],l=e[olympe.L.pa.D.Jf],n=e[olympe.L.pa.D.Qk],p=e[olympe.L.pa.D.pg],q=e[olympe.L.pa.D.TYPE];b.R=c;b=new g(h,k,l,n,p,q,b.N(null!=(f=e[d])?f:null));sd(b,a);return b}ve(){return this.ed}fa(a,b){return Object.assign(super.fa(a,b),{[olympe.L.pa.D.Jf]:this.ed})}toString(){return`SignedMessage{dest: ${this.D}, src: ${this.source}, seqId: ${this.be}, topic: ${this.j}, type: ${this.messageType}, token: ${this.ed}, payload: ${this.F}}`}};const td=olympe.L.pa.j.SEND,ud=olympe.L.pa.j.GET,vd=olympe.L.pa.j.SUBSCRIBE,wd=olympe.L.pa.j.kg,xd=olympe.L.pa.j.Xr,yd=olympe.L.pa.j.Bb,zd=olympe.L.pa.j.bl,Ad=olympe.L.pa.j.pg,Bd=olympe.L.pa.j.rs;
|
|
494
|
-
olympe.L.Gc=class{constructor(a,b,c){this.j=a;this.D=b;this.F=c;this.user=null;Object.defineProperties(this,{D:{enumerable:!1},F:{enumerable:!1}})}
|
|
494
|
+
olympe.L.Gc=class{constructor(a,b,c){this.j=a;this.D=b;this.F=c;this.user=null;Object.defineProperties(this,{D:{enumerable:!1},F:{enumerable:!1}})}Ei(){return null!==this.user?Promise.resolve(this.user):Cd(this.D,this.j).then(a=>this.user=a)}zi(){return this.j.zi()}At(){return this.j.getType()}source(){return this.j.jb()}body(){return this.j.jc()}ack(){const a=this;return u(function*(){if(a.j.getType()!==td)throw Error('Should only call `ack` on SEND requests');yield a.j.ack();yield a.D.Oc(a.j,xd)})}Oc(a){const b=
|
|
495
495
|
this;return u(function*(){const c=b.j.getType();if(c===ud||c===wd)yield b.j.ack(),yield b.D.Oc(b.j,zd,a);else throw Error('Should only call `reply` on GET requests');})}bo(a){return this.j.getType()!==vd?Promise.reject(Error('Should only call `notifyOn` on SUBSCRIBE requests')):new Promise((b,c)=>{const d=`sub_${olympe.U.Mc()}`,e={seq:Dd(this.D,f=>{switch(f.getType()){case Bd:Ed(this.F,d);b(d);break;case yd:c(f.jc().reason);break;default:c('Unsupported response type for a SUBSCRIBE request')}}),topic:a,
|
|
496
|
-
id:d,refresh:this.D.ih};this.j.ack().then(()=>this.D.Oc(this.j,Ad,e)).catch(c)})}
|
|
497
|
-
olympe.L.Gc.prototype.requestType=olympe.L.Gc.prototype.At;olympe.L.Gc.prototype.isRedelivered=olympe.L.Gc.prototype.
|
|
496
|
+
id:d,refresh:this.D.ih};this.j.ack().then(()=>this.D.Oc(this.j,Ad,e)).catch(c)})}ri(a){const b=this;return u(function*(){yield b.D.Oc(b.j,yd,{reason:a.message})})}};olympe.L.Gc.prototype.fail=olympe.L.Gc.prototype.ri;olympe.L.Gc.prototype.notifyOn=olympe.L.Gc.prototype.bo;olympe.L.Gc.prototype.reply=olympe.L.Gc.prototype.Oc;olympe.L.Gc.prototype.ack=olympe.L.Gc.prototype.ack;olympe.L.Gc.prototype.body=olympe.L.Gc.prototype.body;olympe.L.Gc.prototype.source=olympe.L.Gc.prototype.source;
|
|
497
|
+
olympe.L.Gc.prototype.requestType=olympe.L.Gc.prototype.At;olympe.L.Gc.prototype.isRedelivered=olympe.L.Gc.prototype.zi;olympe.L.Gc.prototype.userTag=olympe.L.Gc.prototype.Ei;function Fd(a,b){b&&a.sf();null===a.D&&(a.D=setInterval(a.sf.bind(a),a.F))}function Gd(a){if(null!==a.D){var b=a.D;a.D=null;clearInterval(b)}}function Hd(a){return Array.from(a.j.values()).reduce((b,c)=>b+c.size,0)}function Id(a,b,c){const d=a.j.get(b);c=!(null==d||!d.delete(c));0===(null==d?void 0:d.size)&&a.j.delete(b)&&0===a.j.size&&Gd(a);return c}function Jd(a){a.j.forEach((b,c)=>{b.forEach((d,e)=>{Id(a,c,e);null==d||d(new olympe.error.Th(`Subscription ${e} to be refreshed`,e))})})}
|
|
498
498
|
function Kd(a,b,c){let d;null==(d=a.j.get(b))||d.forEach((e,f)=>{Id(a,b,f);e(c)})}
|
|
499
499
|
olympe.L.Rw=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}sf(){if(Ld(this.H)){var a=olympe.L.pa.j.kg;this.j.forEach((b,c)=>{this.H.request(c,this.N,a,Array.from(b.keys()),!0).then(d=>{d=d.jc();0<d.length&&d.forEach(e=>{let f;const g=null==(f=this.j.get(c))?void 0:f.get(e);Id(this,c,e);null==g||g(new olympe.error.Th('Subscription does not exist in the service.',e))})}).catch(d=>{const e=`Impossible to keep alive subscriptions of provider ${c}: ${d}`;d instanceof
|
|
500
500
|
olympe.error.br?d=new olympe.error.Th('Subscriptions must be re-subscribed.'):(this.G.error(e),d=Error(e));Kd(this,c,d)})})}else Gd(this)}};const Md=new Set([olympe.L.pa.j.SUBSCRIBE,olympe.L.pa.j.GET,olympe.L.pa.j.SEND,olympe.L.pa.j.pg,olympe.L.pa.j.le,olympe.L.pa.j.kg]);function Cd(a,b){return new Promise((c,d)=>{a.R.th(b.ve(),(e,f)=>{e?d(e):c(f)})})}function Dd(a,b){a.wb++;const c=a.wb;a.wa.set(c,d=>{a.wa.delete(c);b(d)});return c}function Ld(a){return Nd(a.Ha)&&Oc(a.D)}
|
|
@@ -514,14 +514,14 @@ function ge(a,b,c,d){var e;const f=null==(e=a.F)?void 0:e.get(b);if(null==f?0:Id
|
|
|
514
514
|
function Xd(a){return u(function*(){try{const b=olympe.L.pa.j.GET,c=olympe.L.pa.j.bl,d=olympe.L.pa.F.ej,e=olympe.L.pa.F.Xm,f=[...a.N.keys()],g=a.jd*a.Ic,h=Math.min(g+a.Ic,f.length),k=f.slice(g,h).flatMap(q=>[[a.j,q,!0],[q,q,!1]]).concat([[a.j,a.j,!0]]);a.G.debug(`Sending ${k.length} PING-PONG requests (slice ${g}..${h} out of ${f.length})`);const l=yield Promise.all(k.map(([q,r,t])=>a.request(q,r,b,d,t))),n=l.findIndex(q=>q.getType()!==c||q.jc()!==e);if(-1!==n){const q=`[${k[n]}]`,r=JSON.stringify(l[n].jc());
|
|
515
515
|
a.G.error(`Received ${k.length} PING-PONG responses -> error for ${q} -> ${r}`);return!1}let p;a.jd=(a.jd+1)%(Math.ceil(f.length/(null!=(p=a.Ic)?p:Number.MAX_SAFE_INTEGER))||1);a.G.debug(`Received ${k.length} PING-PONG responses -> success`);return!0}catch(b){return a.G.error(`Failed PING-PONG requests -> ${b}`),!1}})}function Zd(a,b,c=null){const d=b.substring(a.H.length);return a.N.has(d)&&!1!==c?d:b}
|
|
516
516
|
olympe.L.Xl=class{constructor(a,b,c,d,e,f,g,h){this.G=olympe.ha.Wa('bus');this.X=olympe.ha.Wa('communication');this.Ha=b;this.R=c;this.lb=d;this.Qf=e;this.ff=f;this.wa=new Map;this.j=`${'olympe-runtime'}-${olympe.U.Mc()}`;this.xd=g.get('requestTimeout');this.ih=g.get('subscriptionsRefreshRate');this.me=g.get('allowGuest');b=rxjs.combineLatest([g.get('connection'),this.R.ed.ub().asObservable(),this.Ha.rf().asObservable()]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{user:l.yc(),
|
|
517
|
-
ed:l.zd()}):null)).pipe(rxjs.operators.distinctUntilChanged((k,l)=>[...Object.keys(null!=l?l:{})].every(n=>(null!=k?k:{})[n]===(null!=l?l:{})[n])));this.D=a.N(b,this.j);Od(this);this.H='';Sd(this,g.get('topicPrefix'));this.zl=this.wb=0;this.F=null;this.Z=!1;this.ba=[];this.ia=new Map;this.N=new Set;this.Hc=new Map;this.Ua=new olympe.U.
|
|
517
|
+
ed:l.zd()}):null)).pipe(rxjs.operators.distinctUntilChanged((k,l)=>[...Object.keys(null!=l?l:{})].every(n=>(null!=k?k:{})[n]===(null!=l?l:{})[n])));this.D=a.N(b,this.j);Od(this);this.H='';Sd(this,g.get('topicPrefix'));this.zl=this.wb=0;this.F=null;this.Z=!1;this.ba=[];this.ia=new Map;this.N=new Set;this.Hc=new Map;this.Ua=new olympe.U.ci(this.xd);this.Re='';this.jd=0;this.Ic=h;this.Rf='';this.Vb=this.Dd=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.ba.forEach(e=>e(d));this.ba=[]};
|
|
518
518
|
Ld(this)?a():this.Z||this.Dd?this.ba.push(d=>d?b(d):a()):Nd(this.Ha)?(this.Dd=!0,olympe.C.xt([this.R.yl()],d=>{Wd(this);this.Dd=!1;d.valueOf()||this.me?(this.me||he(this.R,()=>this.disconnect().then()),this.Z=!0,this.ba.push(e=>e?b(e):a()),this.D.connect().catch(e=>{this.Z=!1;c(e)}),this.Rf=this.lb.Ha(()=>this.disconnect(),'Bus websocket')):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(){const a=
|
|
519
519
|
this;return u(function*(){a.G.debug('Disconnecting from bus');a.R.R.delete('busLogoutCallback');a.lb.D(a.Re);a.lb.F(a.Rf);yield a.D.disconnect()})}md(a,b=!1){const c=this;return u(function*(){if(!c.Z||a.getType()!==olympe.L.pa.j.kg){Ld(c)||(yield c.connect());var d=a.D.startsWith('olympe-runtime'),e=d?a.ic():Vd(c,a.ic(),!0);try{Yd(c,a.be.toString(),'serialize');var f=a.fa(c.Qf,c.wl.bind(c,a.j,a.be));c.X.j()&&c.X.j()&&c.X.debug(`BUS > #${e}:`,JSON.stringify(f))}catch(h){throw Error(`An error occurred while serializing the message (seqId=${a.be}): ${h}`);
|
|
520
520
|
}var g=Md.has(a.getType());yield c.D.md(a.be,e,f,{mandatory:g,Lt:!(d||b)});Yd(c,a.be.toString(),'publish',(new Map).set('destination',a.ic()).set('messageType',a.getType().toString()))}})}wl(a,b,c){const d=this.zl++;(()=>{const e=this;return u(function*(){let f;try{f=yield be(e,a,b)}catch(p){e.G.error(`Error to get the destSessionId for the stream ${d}: ${p}`);return}const g=p=>e.md(new olympe.L.pa(f,e.j,b,a,olympe.L.pa.j.le,p)),h=olympe.L.Oe.Hg,k=olympe.L.Oe.Ih,l=olympe.L.Oe.Bb;let n=0;try{for(const p=
|
|
521
521
|
ha(c);;){const q=yield p.next();if(q.done)break;const r=q.value;yield g({id:d,i:n++,e:h,c:r})}yield g({id:d,s:n,e:k})}catch(p){yield g({id:d,e:l,reason:`Error to complete the stream: ${p}`})}})})();return d}Oc(a,b,c){return this.send(a.be,a.jb(),a.jb(),b,c)}send(a,b,c,d,e){return this.md(new olympe.L.pa(c,this.j,a,b,d,e))}request(a,b,c,d,e,f){const g=ce(this,a,b,c,d);return c===olympe.L.pa.j.PUBLISH?this.md(g,e):new Promise((h,k)=>{ee(this,g,h,null!=f?f:this.xd);this.md(g,e).catch(k)})}ul(a,b){const c=
|
|
522
522
|
olympe.L.pa.D.ah;a=olympe.L.pa.D.Qk;var d=olympe.L.pa.D.Jf;const e=b.jc();this.X.j()&&this.X.debug(`BUS < #${b.N}:`,JSON.stringify(e));Yd(this,e[a],'consumed');a=void 0===e[d]?olympe.L.pa.H:olympe.L.hn.H;d=null;let f=!1;try{d=a.call(null,b,this.Qf,h=>{f=!0;return $d(this,e[c],h).stream}),Md.has(d.getType())||b.ack().catch(h=>this.G.error(`Failed to ack message: ${h}`))}catch(h){this.G.error(`An error occurred while trying to deserialize the message: ${JSON.stringify(e)} with error ${h}`);b.reject().catch(k=>
|
|
523
523
|
this.G.error(`Failed to reject message: ${k}`));return}const g=d;b=g.be;Yd(this,b.toString(),'deserialized',(new Map).set('source',g.jb()).set('messageType',g.getType().toString()));switch(g.getType()){case olympe.L.pa.j.le:ae(this,g);break;case olympe.L.pa.j.Sp:this.Oc(g,olympe.L.pa.j.fn).catch(k=>this.G.error(`Failed to reply to get session message: ${k}`));break;case olympe.L.pa.j.fn:let h;null==(h=this.Hc.get(b))||h.forEach(k=>k(g.jb()));break;default:f&&this.Oc(g,olympe.L.pa.j.fn).catch(k=>this.G.error(`Failed to send session id for stream publishing: ${k}`));
|
|
524
|
-
try{let k;null==(k=this.ia.get(g.j))||k(g)}catch(k){this.G.error(`An error occurred while trying to handle the message: ${k}`)}}}};olympe.L.Xl.D='Timeout';olympe.L.Xl.j='olympe-runtime';const ie=olympe.net.ra.Headers.Ql,je=olympe.net.ra.Ub.
|
|
524
|
+
try{let k;null==(k=this.ia.get(g.j))||k(g)}catch(k){this.G.error(`An error occurred while trying to handle the message: ${k}`)}}}};olympe.L.Xl.D='Timeout';olympe.L.Xl.j='olympe-runtime';const ie=olympe.net.ra.Headers.Ql,je=olympe.net.ra.Ub.Vh,ke=olympe.net.ra.Ub.Yo,le=olympe.net.ra.Ub.Sj,me=olympe.net.ra.Ub.zw,ne=olympe.net.ra.Ub.Vo,oe=olympe.net.ra.Ub.mk,pe=olympe.net.ra.Ub.$w,qe=olympe.net.ra.Ub.$i;function re(a,b){let c;return null!=(c=a.F.get(b))?c:''}function se(a,b,c,d=new Map){a.j.isEnabled()&&rb(a.j,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
|
|
525
525
|
function te(a,b,c){if(null===b)return Promise.reject('No http request to send');O(b,{[ie]: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}`)}se(a,e,'request',(new Map).set('destination',b.j()).set('messageType',b.method.toString()));return Hc(a.H,b).then(f=>{se(a,e,'reply');switch(f.Lc()){case je:case ke:case le:var g=f.getData();a.G.j()&&a.G.debug('HTTP <',f.Lc(),`content: ${'string'===
|
|
526
526
|
typeof g?g:typeof g}`);return f;case me:throw f=`HTTP < Service provider for http request to ${b.j()} is overloaded, retry later`,a.G.warn(f),new olympe.error.qr(f);case ne:return a.G.debug(`HTTP < request canceled (${b.j()}).`),f;case oe:case pe:throw f=`HTTP < request authorization denied: ${b.j()}, ${f.statusText}`,a.G.error(f),new olympe.error.yk(f);case qe:throw f=`HTTP < requested resource not found: ${b.j()}`,a.G.error(f),new olympe.error.Nm(f);default:g=`HTTP < Error: ${f.Lc()}, ${f.statusText}`;
|
|
527
527
|
a.G.error(g);if(500===f.Lc()&&'Connection refused'===f.statusText)throw new olympe.error.ep(g);throw new olympe.error.qd(g);}})}).pipe(sb(olympe.error.qr,(e,f)=>{a.G.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.N)))}olympe.L.Ju=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 P(a,b){if(a.state!==b)switch(a.G.debug('State change '+a.state+' --\x3e '+b),a.state=b,a.wb.forEach(c=>c(b)),b){case olympe.L.Na.j.dl:case olympe.L.Na.j.CONNECTING:case olympe.L.Na.j.pp:break;case olympe.L.Na.j.Be:a.connected.update(olympe.C.da.D);break;case olympe.L.Na.j.Vg:a.F=[0,0,a.F[2]];ue(a);break;case olympe.L.Na.j.Bb:let c;a.G.error('Connection to server',null==(c=a.N)?void 0:c.j(),'aborted due to error');a.connected.update(olympe.C.da.j);break;case olympe.L.Na.j.yo:ue(a);break;case olympe.L.Na.j.Ac:a.connected.update(olympe.C.da.j);
|
|
@@ -538,7 +538,7 @@ function Ee(a,b,c){var d=c.message;a.G.j()&&a.G.debug('WS >',JSON.stringify(d.pa
|
|
|
538
538
|
function ye(a,b,c){if(a.D.has(b)){const {Bn:d}=a.D.get(b);a.D.delete(b);null==d||d({s:olympe.L.Na.D.sq,error:c})}}function Ge(a,b){a.G.error(b);P(a,olympe.L.Na.j.Bb)}function He(a,b,c){a.jd=c?1E3*c:-1;let d;a.G.info(`Connected to ${null==(d=a.N)?void 0:d.j()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.D).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!Ee(a,e,f))return;P(a,olympe.L.Na.j.Be)}
|
|
539
539
|
function Ie(a,b){const c=olympe.L.Oe.Hg,d=olympe.L.Oe.Ih,e=olympe.L.Oe.Bb,{id:f,e:g}=b;let h=a.H.get(f);h||(h=new olympe.L.nr(()=>a.H.delete(f)),a.H.set(f,h));if(g===c){fb(a.H.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}`))}
|
|
540
540
|
olympe.L.Na=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.Hc=b;this.N=null;e.subscribe(k=>{this.N=k;k=olympe.L.Na.j.CONNECTING;if(this.state===olympe.L.Na.j.Be||this.state===k){let l;null==(l=this.j)||l.close()}});this.Z=this.j=null;e.subscribe(k=>{this.Z=k;k=olympe.L.Na.j.Ac;this.state===olympe.L.Na.j.dl&&(P(this,k),ve(this))});this.ba=g;this.Dd=h.get('pingInterval');this.wa=h.get('messageTimeout');this.X=olympe.U.Nf.parse(h.get('clientVersion'));this.Ha=olympe.U.Nf.parse(h.get('serverVersion'));
|
|
541
|
-
this.state=olympe.L.Na.j.INIT;this.Ua=d;this.Vb=h.get('getContextMode');this.Re=1;this.R=null;this.F=[0,0,0];this.ia=new Map;this.connected=olympe.C.bc(olympe.C.da,'Server is connected');this.Rf=lc(olympe.C.bc(olympe.C.da,'Server is readonly'),olympe.C.da.j);this.wb=new Set;this.D=new Map;this.H=new olympe.U.
|
|
541
|
+
this.state=olympe.L.Na.j.INIT;this.Ua=d;this.Vb=h.get('getContextMode');this.Re=1;this.R=null;this.F=[0,0,0];this.ia=new Map;this.connected=olympe.C.bc(olympe.C.da,'Server is connected');this.Rf=lc(olympe.C.bc(olympe.C.da,'Server is readonly'),olympe.C.da.j);this.wb=new Set;this.D=new Map;this.H=new olympe.U.ci(this.wa);this.xd=new Map;this.jd=-1;we(this,h,c)}connect(){const a=olympe.L.Na.j.Be,b=olympe.L.Na.j.Ac,c=olympe.L.Na.j.Bb,d=olympe.L.Na.j.INIT;return new Promise((e,f)=>{this.state!==d&&this.state!==
|
|
542
542
|
b||ue(this);Ae(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.pp,d=olympe.L.Na.j.Ac,e=olympe.L.Na.j.CONNECTING,f=olympe.L.Na.j.Bb;this.state===olympe.L.Na.j.Be||this.state===e||this.state===c?(Ae(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.state!==c&&(P(this,c),this.j.close())):(P(this,d),a())})}me(){this.G.debug('Websocket connected, sending handshake. Client version:',
|
|
543
543
|
Hb(this.X),'subscribeEverything:',this.Vb?'NO':'YES');Ce(this,olympe.L.Ge.qk,{c:olympe.L.wk.qk,cv:Hb(this.X),m:this.Vb?0:1,s:this.R,b:this.Ua.D()},this.Qf.bind(this))}Qf(a,b){if(a)Ge(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.Uu:Ge(this,`Framework version (${Hb(this.X)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
|
|
544
544
|
return;case c.Tw:Ge(this,`Framework version (${Hb(this.X)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Eu:Ge(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Ha.Fa(olympe.U.Nf.j))this.G.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.U.Nf.parse(a);if(e.Qj(this.Ha)){Ge(this,`Framework v${Hb(this.X)} is expecting Orchestrator to be at least in v${Hb(this.Ha)}`);
|
|
@@ -551,30 +551,30 @@ a.j?a.G.log(l):a.G.error(l);setTimeout(k,g)}else a.G.info('Disconnected, stay of
|
|
|
551
551
|
olympe.L.vc=class{constructor(a,b,c,d,e,f){this.G=a;this.D=b;this.H=d;this.storage=e;this.state=olympe.C.bc(Number).update(olympe.L.vc.j.INIT);this.j=f.get('offlineEnabled');this.N=f.get('offlineAutoBackOnline');this.F=f.get('storagePrefix');Je(this,f)}rf(){const a=olympe.L.vc.j.cj,b=olympe.L.vc.j.Ff,c=olympe.L.vc.j.Ac;let d=olympe.C.da.j;return olympe.C.ua([this.state],e=>{if(e===a)d=olympe.C.da.D;else if(e===b||e===c)d=olympe.C.da.j;return d},olympe.C.da)}getState(){return this.state.ub()}connect(){const a=
|
|
552
552
|
this;return u(function*(){const b=olympe.L.vc.j.cj,c=olympe.L.vc.j.Vm;olympe.C.Qa(a.state)!==b&&(a.state.update(c),a.storage.delete(a.F+'olympe_manual_offline'),yield a.D.connect(),yield Le(),a.state.update(b))})}disconnect(){const a=this;return u(function*(){const b=olympe.L.vc.j.Ff,c=olympe.L.vc.j.Vm;if(!a.j)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.F+'olympe_manual_offline','true');olympe.C.Qa(a.state)!==
|
|
553
553
|
b&&(a.state.update(c),yield olympe.L.lh().disconnect(),yield a.D.disconnect())})}};olympe.L.vc.j={INIT:0,Vm:1,cj:2,Ff:3,Ac:4,Gw:5};olympe.L.vc.D='olympe_manual_offline';olympe.L.cc=class{constructor(){this.R=this.X=null}fa(a){a=this.D(a);this.X=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.hm,a.valueOf().toISOString());case a instanceof Date:return this.format(olympe.L.cc.j.hm,a.toISOString());case a instanceof olympe.C.Color:return this.format(olympe.L.cc.j.COLOR,
|
|
554
|
-
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.Lq,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.cc.j.$g,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.U.kf().j(new Uint8Array(a)),this.format(olympe.L.cc.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.U.kf().j(a),this.format(olympe.L.cc.j.
|
|
554
|
+
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.Lq,a);case a instanceof Set:return a=Array.from(a).map(this.D.bind(this)),this.format(olympe.L.cc.j.$g,a);case Array.isArray(a):return a.map(this.D.bind(this));case a instanceof ArrayBuffer:return a=olympe.U.kf().j(new Uint8Array(a)),this.format(olympe.L.cc.j.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.U.kf().j(a),this.format(olympe.L.cc.j.di,a);case Symbol.asyncIterator in
|
|
555
555
|
a:if(!this.X)throw Error('No stream handler has been set, so cannot serialize the asyncIterable.');let b;return this.format(olympe.L.cc.j.le,null==(b=this.X)?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.dr,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'===
|
|
556
|
-
typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.error.up(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.cc.j.hm:return new Date(c);case olympe.L.cc.j.COLOR:return olympe.C.Color.Qb(c);case olympe.L.cc.j.Lq:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.cc.j.$g:return new Set(c.map(e=>this.j(e)));case olympe.L.cc.j.ARRAY_BUFFER:return olympe.U.kf().D(c).buffer;case olympe.L.cc.j.
|
|
557
|
-
case olympe.L.cc.j.le: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.dr:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.error.up(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.cc.j={hm:1,COLOR:2,Lq:3,$g:4,ARRAY_BUFFER:5,
|
|
556
|
+
typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.error.up(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.cc.j.hm:return new Date(c);case olympe.L.cc.j.COLOR:return olympe.C.Color.Qb(c);case olympe.L.cc.j.Lq:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.cc.j.$g:return new Set(c.map(e=>this.j(e)));case olympe.L.cc.j.ARRAY_BUFFER:return olympe.U.kf().D(c).buffer;case olympe.L.cc.j.di:return olympe.U.kf().D(c);
|
|
557
|
+
case olympe.L.cc.j.le: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.dr:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.error.up(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.cc.j={hm:1,COLOR:2,Lq:3,$g:4,ARRAY_BUFFER:5,di:6,le:7,dr:8};const Me=olympe.L.pa.j.SEND,Ne=olympe.L.pa.j.GET,Oe=olympe.L.pa.j.PUBLISH,Pe=olympe.L.pa.j.SUBSCRIBE,Qe=olympe.L.pa.j.kg,Re=olympe.L.pa.j.vs,Se=olympe.L.pa.j.Xr,Te=olympe.L.pa.j.Bb,Ue=olympe.L.pa.j.bl,Ve=olympe.L.pa.j.pg,We=olympe.L.pa.F.ej,Xe=olympe.L.pa.F.Xm;function Ed(a,b){a.j||(a.j=gb(new olympe.U.pn(a.D.ih+3E4),c=>{let d;null==(d=a.H)||d.call(a,c)}));a.j.add(b)}
|
|
558
558
|
function Ye(a){let b,c;const d=null!=(c=null==(b=a.jc())?void 0:b.code)?c:olympe.error.mc.$k;let e,f;a=null!=(f=null==(e=a.jc())?void 0:e.reason)?f:'Unknown Error';return d===olympe.error.mc.TIMEOUT?new olympe.error.Zk(a):new olympe.error.qd(a,d)}function Ze(a,b){const c=olympe.L.pa.j.pg,d=olympe.L.pa.j.rs;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.jc().seq,b.jb(),b.jb(),d)}
|
|
559
559
|
olympe.L.rb=class{constructor(a,b){this.D=olympe.L.lh();this.F=a;this.H=this.j=null;this.N=new olympe.C.Zb(`Service ${a}`,'function'===typeof b.Db?b.Db():b);this.G=olympe.ha.Wa(`Service ${this.F}`)}It(a){this.H=a;return this}stop(){this.N.destroy()}clear(){Td(this.D,this.F).catch(b=>this.G.error('Failed to unsubscribe from '+this.F+', error: '+b));if(this.H){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.H)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static md(a,b){return u(function*(){yield olympe.L.lh().request(a,
|
|
560
560
|
a,Oe,b,!1)})}static mt(a){const b=olympe.L.lh(),c=new olympe.L.Ik(a,b);be(b,a).then(d=>$e(c,d)).catch(d=>olympe.ha.Wa('Publisher for service '+a).error('Failed to get session id for publisher',d));return c}static send(a,b,c={}){return olympe.L.lh().request(a,a,Me,b,!0,c.timeout).then(d=>{switch(d.getType()){case Se:break;case Te:throw Ye(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.lh().request(a,a,Ne,b,!0,c.timeout).then(d=>{switch(d.getType()){case Ue:d=
|
|
561
561
|
d.jc();if(null!==d)return d;throw Error('No payload after request to service: '+a);case Te:throw Ye(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.Db?b.Db():b,f=olympe.L.lh(),g=new olympe.L.Ik(a,f);return{observable:(new rxjs.Observable(h=>{let k=null,l=null,n=null;const p=()=>{h.complete();l&&n&&(ge(f,a,n,l),l=n=null);k&&(Td(f,k).catch(q=>olympe.ha.Wa('Service '+a).error('Failed to unsubscribe from a topic '+q)),
|
|
562
562
|
k=null)};e.Yd(p);f.request(a,a,Pe,c,!0,d.timeout).then(q=>{switch(q.getType()){case Ve:$e(g,q.jb());const r=q.jc();k=r.topic;q.ack().catch(()=>olympe.ha.Wa('Service '+a).error('Failed to ack the msg'));Ud(f,k,t=>{t.getType()===Oe?h.next(t.jc()):(h.error('Unsupported notification message. It should be a publish'),p())}).then(()=>{l=r.id;n=q.jb();fe(f,a,n,l,r.refresh,t=>h.error(t));Ze(f,q).catch(t=>{h.error(`Was unable to ack the subscription: ${t}`);p()})}).catch(t=>{h.error(`Was not able to subscribe to notification topic ${k}: ${t}`);
|
|
563
563
|
p()});break;case Te:h.error(Ye(q));break;default:h.error('Unsupported response type for a SUBSCRIBE request')}}).catch(q=>h.error(q));return p})).pipe(sb(olympe.error.Th,(h,k)=>{olympe.ha.Wa(`Service ${a}`).debug(`Subscribed to topic ${h.T()} now that we are back online, after waiting for ${k}ms`);let l;null==(l=d.onRetry)||l.call(d)})),publisher:g}}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);Ud(this.D,this.F,this.R.bind(this,a),!1).catch(c=>
|
|
564
|
-
{c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}
|
|
565
|
-
We){c.Oc(Xe).catch(f=>this.G.error(`Failed PING-PONG reply: ${f}`));break}default:a.next(c)}}};olympe.L.rb.prototype.multicast=olympe.L.rb.prototype.
|
|
566
|
-
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)}};function $e(a,b){a.j=b;a.D.forEach(c=>c());a.D=[];return a}olympe.L.Ik=class{constructor(a,b){this.F=b;this.D=[];this.H=a;this.j=null}md(a){const b=this;return u(function*(){b.j||(yield new Promise(c=>{b.D.push(()=>c())}));yield b.F.request(b.j,b.H,olympe.L.pa.j.PUBLISH,a,!0)})}};olympe.L.Ik.prototype.publish=olympe.L.Ik.prototype.md;olympe.L.Ge={Hg:1,dg:2,Bb:3,Og:4,SA:5,qk:6,pc:7};olympe.L.wk={qk:1,bx:2,Bu:3,kg:5,ow:1,pE:2};olympe.L.Oe={Hg:0,Ih:1,Bb:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',Ac:'disconnected',pp:'disconnecting',Be:'connected',Vg:'reconnecting',dl:'waking',yo:'awake',Bb:'error'};olympe.L.Na.F={
|
|
564
|
+
{c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}Ai(a){const b=this;return u(function*(){yield b.D.request(b.F,b.F,Oe,a,!1,b.D.xd)})}R(a,b){var c=new olympe.L.Gc(b,this.D,this);switch(b.getType()){case Qe:var d=c.body().filter(f=>{let g;return!(null==(g=this.j)?0:fb(g,f))});c.Oc(d).catch(f=>this.G.error('Not able to validate subscription keep alive',f));break;case Re:c=c.body();null==(d=this.j)||d.delete(c);let e;null==(e=this.H)||e.call(this,c);break;case Ne:if(b.jc()===
|
|
565
|
+
We){c.Oc(Xe).catch(f=>this.G.error(`Failed PING-PONG reply: ${f}`));break}default:a.next(c)}}};olympe.L.rb.prototype.multicast=olympe.L.rb.prototype.Ai;olympe.L.rb.prototype.listen=olympe.L.rb.prototype.listen;olympe.L.rb.observe=olympe.L.rb.observe;olympe.L.rb.get=olympe.L.rb.get;olympe.L.rb.send=olympe.L.rb.send;olympe.L.rb.getPublisher=olympe.L.rb.mt;olympe.L.rb.publish=olympe.L.rb.md;olympe.L.rb.prototype.stop=olympe.L.rb.prototype.stop;olympe.L.rb.prototype.setUnsubscriptionHandler=olympe.L.rb.prototype.It;olympe.L.nr=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.U.stream.og;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return u(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!==
|
|
566
|
+
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)}};function $e(a,b){a.j=b;a.D.forEach(c=>c());a.D=[];return a}olympe.L.Ik=class{constructor(a,b){this.F=b;this.D=[];this.H=a;this.j=null}md(a){const b=this;return u(function*(){b.j||(yield new Promise(c=>{b.D.push(()=>c())}));yield b.F.request(b.j,b.H,olympe.L.pa.j.PUBLISH,a,!0)})}};olympe.L.Ik.prototype.publish=olympe.L.Ik.prototype.md;olympe.L.Ge={Hg:1,dg:2,Bb:3,Og:4,SA:5,qk:6,pc:7};olympe.L.wk={qk:1,bx:2,Bu:3,kg:5,ow:1,pE:2};olympe.L.Oe={Hg:0,Ih:1,Bb:2};olympe.L.Na.j={INIT:'initialize',CONNECTING:'connecting',Ac:'disconnected',pp:'disconnecting',Be:'connected',Vg:'reconnecting',dl:'waking',yo:'awake',Bb:'error'};olympe.L.Na.F={Vh:1,Eu:-1,Uu:-2,Tw:-3};olympe.L.Na.D={jj:0,sq:23};
|
|
567
567
|
olympe.L.Na.pc={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',
|
|
568
568
|
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={wf:'com.ConnectivityManager',Rk:'com.ServerManager',Jo:'com.BusManager',rk:'com.HttpManager',Ne:'com.Serializer',Ca:'com.Logger',ah:'com.Source',ws:'com.Urls',NC:'com.peerFileSvcUrl'};
|
|
569
569
|
olympe.L.Config={jm:'defaultHost',Xo:'com.computedHost',yw:'server.host',Aw:'server.port',Bw:'server.ssl',Yr:'server.basePath',Es:'server.wsPath',bn:'server.reconnectionDelay',rr:'server.pingInterval',Ds:'server.messageTimeout',Kr:'server.retryHttpOnOverload',$l:'server.clientVersion',bs:'server.serverVersion',Cw:'server.wakeUpService',au:'bus.host',bu:'bus.path',cu:'bus.port',eu:'bus.vhost',du:'bus.ssl',Oo:'bus.requestTimeout',Po:'bus.subscriptionRefreshRate',No:'bus.reconnectionDelay',Io:'bus.heartbeat',
|
|
570
570
|
Lo:'bus.queueExpiration',Mo:'bus.queuePrefetch',Ul:'bus.allowGuest',ss:'bus.topicPrefix',Ko:'bus.pingPongChunk'};
|
|
571
|
-
olympe.V.config(function(a){const b=olympe.host.Yg.
|
|
571
|
+
olympe.V.config(function(a){const b=olympe.host.Yg.Xh;E(a,olympe.L.Config.jm,a.getParameter(olympe.host.Config.cq));E(a,olympe.L.Config.Yr,'OlympeServer');E(a,olympe.L.Config.ss,'');Ya(a,'com.hostConfig',[olympe.host.Config.Nk,olympe.L.Config.jm,olympe.L.Config.yw,olympe.L.Config.Aw,olympe.L.Config.Bw,olympe.L.Config.Yr,olympe.L.Config.au,olympe.L.Config.eu,olympe.L.Config.cu,olympe.L.Config.bu,olympe.L.Config.du],(e,f,g,h,k,l,n,p,q,r,t)=>{var v=a.getParameter(olympe.net.Config.Hm);e=e===olympe.host.Yg.Xh;
|
|
572
572
|
var x=['localhost','127.0.0.1'],y=f.endsWith(v),z=y&&e?`${f}-${b}`:f;const A='object'===typeof window;g=null!=g?g:z;n=null!=n?n:!A&&y?z.replace(new RegExp(`${v}.*`),'rabbitmq'):z;z=(v=x.includes(g))||y;y=(x=x.includes(n))||y;f=x?'/':f.split('.')[0];return{Gl:g,jo:null!=h?h:v?8080:z?e?85:80:443,Hl:null!=k?k:!z,Et:l,Fx:n,Jx:null!=p?p:f,Hx:null!=q?q:A?x?15670:y?e?85:80:443:y?5672:5671,Gx:null!=r?r:!x&&A?'/amqp/ws':'',Ix:null!=t?t:!y}});E(a,olympe.L.Config.Es,'websocket');E(a,olympe.L.Config.bn,5E3);
|
|
573
573
|
E(a,olympe.L.Config.rr,5E3);E(a,olympe.L.Config.Ds,3E4);E(a,olympe.L.Config.Kr,4E3);E(a,olympe.L.Config.bs,'7.5.3');E(a,olympe.L.Config.Oo,6E4);E(a,olympe.L.Config.Po,3E4);E(a,olympe.L.Config.Ul,!1);E(a,olympe.L.Config.No,a.getParameter(olympe.L.Config.bn));E(a,olympe.L.Config.Io,15);E(a,olympe.L.Config.Lo,3E5);E(a,olympe.L.Config.Mo,20);E(a,olympe.L.Config.Ko,2);const c=a.getParameter(olympe.yg.Config.Lp);if(void 0!==c)a.setParameter(olympe.L.Config.$l,c);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
|
|
574
574
|
D(a,olympe.L.P.Ca,[olympe.ha.P.Ea],e=>e.dd('communication'));D(a,'server.WebSocketRequest',[new olympe.V.Hh('com.hostConfig'),new olympe.V.ma(olympe.L.Config.Es)],(e,f)=>e.pipe(rxjs.operators.map(({Gl:g,jo:h,Hl:k,Et:l})=>new olympe.net.pj(g,h,(l+'/'+f).replace(/\/+/g,'/').replace(/\/$/,''),k))).pipe(rxjs.operators.shareReplay(1)));D(a,'server.wakeUpRequest',[new olympe.V.Hh('com.hostConfig'),new olympe.V.ma(olympe.L.Config.Cw)],(e,f)=>e.pipe(rxjs.operators.map(({Gl:g,jo:h,Hl:k})=>{if(null===f||void 0===
|
|
575
|
-
f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.pj(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Ob));D(a,olympe.L.P.ws,[new olympe.V.Hh('com.hostConfig'),...d.map(e=>new olympe.V.ma(e))],(e,...f)=>e.pipe(rxjs.operators.map(({Gl:g,jo:h,Hl:k,Et:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.
|
|
576
|
-
C(a,olympe.L.P.Ne,olympe.L.cc);C(a,olympe.L.P.rk,olympe.L.Ju,olympe.L.P.Ca,olympe.net.P.Ea,olympe.U.P.lg,olympe.L.P.ws,new olympe.V.ma(olympe.L.Config.Kr));D(a,'com.server.ManagerConfig',[new olympe.V.ma(olympe.L.Config.rr),new olympe.V.ma(olympe.L.Config.Ds),new olympe.V.ma(olympe.L.Config.$l),new olympe.V.ma(olympe.L.Config.bs),new olympe.V.ma(olympe.dc.Config.
|
|
577
|
-
h));return g});C(a,olympe.L.P.Rk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Ea,olympe.host.P.Ie,olympe.host.P.Uk,'server.WebSocketRequest','server.wakeUpRequest',olympe.U.P.lg,'com.server.ManagerConfig');Ya(a,olympe.L.Config.Xo,['com.hostConfig'],e=>`${e.Hl?'https':'http'}://${e.Gl}`);Ya(a,'com.bus.TopicPrefix',[olympe.host.Config.Nk,olympe.L.Config.ss],(e,f)=>{const g=0<f.length;return e===olympe.host.Yg.
|
|
575
|
+
f)return null;const l=f.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.pj(g,h,l,k)})).pipe(rxjs.operators.shareReplay(1)));const d=Array.from(Object.values(olympe.L.Ob));D(a,olympe.L.P.ws,[new olympe.V.Hh('com.hostConfig'),...d.map(e=>new olympe.V.ma(e))],(e,...f)=>e.pipe(rxjs.operators.map(({Gl:g,jo:h,Hl:k,Et:l})=>{const n=d.map((p,q)=>{q=f[q];q=(new olympe.net.Ui(g,h,`${l}${q?'/'+q:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).j();return[p,q]});return new Map(n)})).pipe(rxjs.operators.shareReplay(1)));
|
|
576
|
+
C(a,olympe.L.P.Ne,olympe.L.cc);C(a,olympe.L.P.rk,olympe.L.Ju,olympe.L.P.Ca,olympe.net.P.Ea,olympe.U.P.lg,olympe.L.P.ws,new olympe.V.ma(olympe.L.Config.Kr));D(a,'com.server.ManagerConfig',[new olympe.V.ma(olympe.L.Config.rr),new olympe.V.ma(olympe.L.Config.Ds),new olympe.V.ma(olympe.L.Config.$l),new olympe.V.ma(olympe.L.Config.bs),new olympe.V.ma(olympe.dc.Config.bi)],(...e)=>{const f=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],g=new Map;e.forEach((h,k)=>g.set(f[k],
|
|
577
|
+
h));return g});C(a,olympe.L.P.Rk,olympe.L.Na,olympe.L.P.Ca,olympe.net.P.Ea,olympe.host.P.Ie,olympe.host.P.Uk,'server.WebSocketRequest','server.wakeUpRequest',olympe.U.P.lg,'com.server.ManagerConfig');Ya(a,olympe.L.Config.Xo,['com.hostConfig'],e=>`${e.Hl?'https':'http'}://${e.Gl}`);Ya(a,'com.bus.TopicPrefix',[olympe.host.Config.Nk,olympe.L.Config.ss],(e,f)=>{const g=0<f.length;return e===olympe.host.Yg.Xh?g?`${b}-${f}`:b:g?f:''});D(a,'com.bus.ManagerConfig',[new olympe.V.Hh('com.hostConfig'),new olympe.V.Hh('com.bus.TopicPrefix'),
|
|
578
578
|
new olympe.V.ma(olympe.L.Config.Ul),new olympe.V.ma(olympe.L.Config.Oo),new olympe.V.ma(olympe.L.Config.Po),new olympe.V.ma(olympe.L.Config.No),new olympe.V.ma(olympe.L.Config.Lo),new olympe.V.ma(olympe.L.Config.Mo),new olympe.V.ma(olympe.L.Config.Io)],(e,f,g,h,k,l,n,p,q)=>{e=e.pipe(rxjs.operators.map(({Fx:r,Gx:t,Hx:v,Jx:x,Ix:y})=>({host:r,Ah:y,port:v,path:t,CA:x,zt:l,gA:n,hA:p,Gz:h+3E4,oz:q})),rxjs.operators.shareReplay(1));return new Map([['connection',e],['topicPrefix',f],['allowGuest',g],['requestTimeout',
|
|
579
579
|
h],['subscriptionsRefreshRate',k]])});C(a,olympe.L.P.Jo,olympe.L.Xl,olympe.net.P.Ea,olympe.L.P.wf,olympe.auth.P.Ea,olympe.host.P.Ie,olympe.L.P.Ne,olympe.U.P.lg,'com.bus.ManagerConfig',new olympe.V.ma(olympe.L.Config.Ko));D(a,'com.connectivity.ManagerConfig',[olympe.net.P.Pm,olympe.Eb.P.bh,new olympe.V.ma(olympe.L.Config.bn)],(e,...f)=>['storagePrefix','reconnectionDelay'].reduce((g,h,k)=>g.set(h,f[k]),e));C(a,olympe.L.P.wf,olympe.L.vc,olympe.L.P.Ca,olympe.L.P.Rk,olympe.net.P.Ea,olympe.host.P.Ie,olympe.Eb.P.Im,
|
|
580
580
|
'com.connectivity.ManagerConfig')},'olympe.communication');olympe.V.run([olympe.L.P.Jo,olympe.L.P.wf],(a,b)=>{olympe.L.lh=()=>a;olympe.L.Mn=()=>b});olympe.auth={};function af(a,b){Fe(a.j);xe(a.j,olympe.L.Ge.Og,c=>{const d=c.c;d===olympe.auth.vd.j.Gv?(a.j.me(),b(olympe.auth.Ta.D.Sj,c)):d===olympe.auth.vd.j.ww&&b(olympe.auth.Ta.D.jq,c)},'logoutHandler')}
|
|
@@ -582,24 +582,24 @@ function bf(a,b,c){const d=null==b?void 0:b.Ef();if(b instanceof olympe.auth.Dk)
|
|
|
582
582
|
olympe.L.Ge.Og,Object.assign({},{c:olympe.auth.vd.j.Hv},d&&{idpName:d}),c)}function df(a,b,c,d){olympe.C.Qa(a.H.getState())===olympe.L.vc.j.Ff?d(new olympe.error.lr,'Working offline'):(c.c=b,Ce(a.j,olympe.L.Ge.Og,c,d))}
|
|
583
583
|
function ef(a,b,c){if(b.Ng()!==olympe.auth.Fc.j.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.Ef()}&access_token=${cf(b)}`;d=`${re(a.Ph,olympe.L.Ob.Ak)}/refresh${d}`;d=Gc(N(d),olympe.net.ra.ResponseType.JSON);te(a.Ph,d,b.zd()).then(e=>{(e=e.getData())?(e=new olympe.auth.Dk(b.yc(),b.we(),b.zd(),e,b.Ef()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
|
|
584
584
|
olympe.auth.vd=class{constructor(a,b,c,d,e,f){this.G=a;this.j=b;this.Ph=c;this.H=d;this.D=e;this.F=f;ff(this.F).then(g=>{g&&this.F.db.remove('main','redirectTo').then(()=>{this.D.redirect(g,null,olympe.auth.Pk.j.GET)}).catch(h=>{this.G.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.G.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}sf(a){Ce(this.j,olympe.L.Ge.Og,{c:olympe.auth.vd.j.kg},b=>a(b))}th(a,b,c){const d=re(this.Ph,olympe.L.Ob.ys);
|
|
585
|
-
a=N(`${d}/${a}`);te(this.Ph,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.vd.j={Og:1,Hv:2,Bb:3,kg:5,jj:6,Nu:10,Kw:11,Qt:12,SAML:13,ww:14,Gv:20};function he(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.U.
|
|
585
|
+
a=N(`${d}/${a}`);te(this.Ph,a,b).then(e=>c(null,e.getData())).catch(e=>c(Error(e)))}};olympe.auth.vd.j={Og:1,Hv:2,Bb:3,kg:5,jj:6,Nu:10,Kw:11,Qt:12,SAML:13,ww:14,Gv:20};function he(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.U.si());a.R.set(c,b)}function de(a){return olympe.C.Qa(a.ed.ub())}
|
|
586
586
|
function Le(){var a=olympe.auth.te();const b=olympe.auth.Ta.j.Tj,c=olympe.auth.Ta.j.INIT;gf(a,b);a.ia?(a.j=olympe.auth.Ta.F.Pt,a.G.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),hf(a)):(a.j=olympe.auth.Ta.F.Jf,a.G.log('Connector online, attempting to log with token'),jf(a));return rxjs.firstValueFrom(a.state.ub().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
|
|
587
587
|
function kf(a){a.G.log('Initializing AUTH layer');let b=a.Vb;if('object'===typeof location){const c=location.hash;let d=c.indexOf('authToken=');-1<d&&(b=c.substring(d+10),'&'===c[d-1]&&d--,location.hash=c.substring(0,d))}b&&a.storage&&lf(a.storage,b).catch(c=>a.G.error(c));a.G.debug('Asking to be notified when auth connector gets online');olympe.C.Yc([a.wa.getState()],c=>{switch(c){case olympe.L.vc.j.Ff:a.j=olympe.auth.Ta.F.Jf;a.G.log('Connector offline, attempting to recover sessions from current token');
|
|
588
|
-
jf(a);break;case olympe.L.vc.j.Ac:switch(olympe.C.Qa(a.state)){case olympe.auth.Ta.j.tf:c=olympe.C.Qa(a.ed).yc();mf(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.
|
|
588
|
+
jf(a);break;case olympe.L.vc.j.Ac:switch(olympe.C.Qa(a.state)){case olympe.auth.Ta.j.tf:c=olympe.C.Qa(a.ed).yc();mf(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.j.Ri:a.G.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.j.Tj:mf(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.j.INIT:mf(a,'Cannot open auth session - no server connection');break;default:mf(a,'Should not get there, investigate',!0)}}});
|
|
589
589
|
af(a.D,(c,d)=>{if(c===olympe.auth.Ta.D.Sj){mf(a,'authentication revoked');let e;null==(e=a.storage)||nf(e).catch(f=>a.G.error('Failed to clear token',f));a.R.forEach(f=>{f(c,d)})}else if(c===olympe.auth.Ta.D.jq){a.G.info('Redirection to IDP to invalidate token (SAML)');de(a);let e;null==(e=a.storage)||nf(e).catch(f=>a.G.error('Failed to clear token',f));a.Ha.D()}else throw Error(`Unknown logout step coming from server : ${c}`);});a.Z=of(a);a.G.log('DONE initializing AUTH layer (waiting for connector to be online)')}
|
|
590
590
|
function pf(a,b){let c=null;olympe.C.Hj(a.state.ub().Md(olympe.auth.Ta.j.tf).and(b),()=>{const d=de(a);!qf(a)&&d&&(c=a.Zd.get(d.Ng()).H(d,(e,f)=>{e?(a.G.error('Failed to refresh token, error message: ',e.message),a.Kj().catch(g=>a.G.error(`Failed to logout after wrong refresh ${g}`))):f&&rf(a,f)}))},()=>{let d;null==(d=c)||d()})}
|
|
591
591
|
function jf(a){null!==a.storage?(a.G.debug('Retrieving token from local storage'),a.storage.ve().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.yc();e.set('username',c);c=e;var d=b.zd();c.set('nonce',d);'string'===typeof b.Ef()&&e.set('idpName',b.Ef());a.G.debug('Token found, trying login with',e);sf(a,e,olympe.auth.Fc.j.Qm)}else mf(a,'No token found, cannot perform auto login')}).catch(b=>{mf(a,b.message,!0)})):mf(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
|
|
592
|
-
!0)}function mf(a,b,c=!1){a.ed.update(a.N);gf(a,olympe.auth.Ta.j.
|
|
592
|
+
!0)}function mf(a,b,c=!1){a.ed.update(a.N);gf(a,olympe.auth.Ta.j.Ri);b=`Authenticated as guest (${b})`;c?a.G.error(b):a.G.info(b)}function of(a){const b=[olympe.auth.Ta.j.tf];a.ia||b.push(olympe.auth.Ta.j.Ri);return a.ba.j(()=>{const c=tf(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 gf(a,b){a.G.log('State change: ',tf(a),'--\x3e',b);a.state.update(b)}
|
|
593
593
|
function hf(a){if(a.H){const b=new olympe.auth.Request;b.set('username',a.H);b.set('password',a.Ua);a.G.log('Autologin with user "'+a.H+'"');sf(a,b)}else mf(a,'No user specified for auto login',!0)}function qf(a){return olympe.C.Qa(a.ed)===a.N}function rf(a,b){if(b){a.ed.update(b);let c;null==(c=a.storage)||lf(c,b).catch(d=>a.G.error(d));a.G.debug('Token updated')}}function tf(a){return olympe.C.Qa(a.state.ub())}function uf(){var a=olympe.public.Ma.get();return new Map(a.D.j.xd)}
|
|
594
594
|
function vf(a,b,c,d=!1){b=b+c?':'+c.message:'';a.G.error(b);a.error.update(olympe.C.yb(b));gf(a,olympe.auth.Ta.j.Bb);if(d)throw Error(b);}function sf(a,b,c,d){void 0===c&&(c=a.lb);void 0===c&&vf(a,'No authentication provider specified',null,!0);const e=a.Zd.get(c);e||vf(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.F.set('login',d);a.G.log('Sending authentication request using "'+c+'" for '+b);e.ve(b,a.wb.bind(a));gf(a,olympe.auth.Ta.j.Tj)}
|
|
595
595
|
function wf(a,b,c){a.F.forEach(d=>{d(b,c)})}
|
|
596
596
|
olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k){this.G=a;this.wa=b;this.D=c;this.storage=d;this.Ha=e;this.lb=k.get('defaultProvider');this.ia=!!k.get('autoLogin');this.H=k.get('autoUser');this.Ua=k.get('autoPassword');this.Vb=k.get('autoToken');this.Zd=new Map;this.ba=f;this.Z='';this.state=olympe.C.bc(String).update(olympe.auth.Ta.j.INIT);this.error=olympe.C.bc(olympe.C.Sa);this.j=null;this.N=new olympe.auth.gh('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.ed=olympe.C.bc(olympe.auth.gh).update(this.N);
|
|
597
|
-
this.F=new Map;this.R=new Map;this.X=new olympe.U.
|
|
598
|
-
return d.ub()}zg(a){if(olympe.C.Qa(this.state)===olympe.auth.Ta.j.tf){var b=de(this);!qf(this)&&b&&this.Zd.get(b.Ng()).zg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.Kj().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&rf(this,d);a(c)})}}getState(){return this.state.ub()}yc(){return this.ed.ub().yc()}we(){return this.ed.ub().we()}
|
|
597
|
+
this.F=new Map;this.R=new Map;this.X=new olympe.U.ci(k.get('cacheTokenTimeout'));h.forEach(l=>{const n=l.F();if(this.Zd.has(n))throw Error('Provider "'+n+'" has already been registered !');this.Zd.set(n,l)});kf(this);pf(this,g.j())}yl(){const a=olympe.auth.Ta.j.tf,b=olympe.auth.Ta.j.Ri,c=olympe.auth.Ta.j.Bb,d=olympe.C.bc(olympe.C.da);olympe.C.Yc([this.state],e=>{e===a?d.update(olympe.C.da.D):e===b?d.update(olympe.C.da.j):e===c?(this.G.error('Authentication failed.'),d.update(olympe.C.da.j)):d.clear()});
|
|
598
|
+
return d.ub()}zg(a){if(olympe.C.Qa(this.state)===olympe.auth.Ta.j.tf){var b=de(this);!qf(this)&&b&&this.Zd.get(b.Ng()).zg(b,(c,d)=>{c?(this.G.error('Failed to refresh token, error message: ',c.message),this.Kj().catch(e=>this.G.error(`Failed to logout after wrong refresh ${e}`))):d&&rf(this,d);a(c)})}}getState(){return this.state.ub()}yc(){return this.ed.ub().yc()}we(){return this.ed.ub().we()}vi(){return this.ed.ub().vi()}th(a,b){if(fb(this.X.j,a))b(null,this.X.get(a));else{var c,d=null==(c=olympe.C.Qa(this.ed.ub()))?
|
|
599
599
|
void 0:c.zd();this.D.th(a,d,(e,f)=>{'string'===typeof f&&this.X.set(a,f);b(e,f)})}}Kj(){return qf(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)||nf(c).catch(d=>this.G.error('Failed to clear token',d));bf(this.D,de(this),d=>{d?(vf(this,'Logout request rejected:',d),b(d)):(this.G.debug('Logout request acknowledged'),a())});this.ba.D(this.Z)})}sf(a){tf(this)===olympe.auth.Ta.j.tf&&
|
|
600
600
|
this.D.sf(b=>{b&&this.G.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}wb(a,b){const c=null===this.j?olympe.auth.Ta.F.Nv:this.j;this.j=null;if(!a||a instanceof olympe.error.lr){null===a?this.G.info(`User ${b.yc()} (#${b.we()}) successfully authenticated`):this.G.info(`User ${b.yc()} (#${b.we()}) recovered from token, while offline`);this.ed.update(b);gf(this,olympe.auth.Ta.j.tf);wf(this,a,c);let d;null==(d=this.storage)||lf(d,b).catch(e=>this.G.error(e))}else{let d;
|
|
601
|
-
null==(d=this.storage)||nf(d).catch(e=>this.G.error(e));this.error.update(olympe.C.yb(a.message));mf(this,'authentication rejected: '+a.message);wf(this,a,c)}this.F.has('login')&&this.F.delete('login')}};olympe.auth.Ta.j={INIT:'init',Tj:'authenticating',
|
|
602
|
-
m.we.K=new olympe.C.J(()=>String,[]);m.zd.K=new olympe.C.J(()=>String,[]);m.jc.K=new olympe.C.J(()=>Object,[]);m.
|
|
601
|
+
null==(d=this.storage)||nf(d).catch(e=>this.G.error(e));this.error.update(olympe.C.yb(a.message));mf(this,'authentication rejected: '+a.message);wf(this,a,c)}this.F.has('login')&&this.F.delete('login')}};olympe.auth.Ta.j={INIT:'init',Tj:'authenticating',Ri:'guest',tf:'authenticated',Bb:'error'};olympe.auth.Ta.F={Nv:'manual',Pt:'auto',Jf:'tokenOnFirstConnection'};olympe.auth.Ta.D={Sj:'accepted',jq:'redirect'};olympe.auth.Fc=class{constructor(a,b){this.G=a;this.D=b;this.j=null}F(){}ve(){}H(a,b){const c=()=>{this.j=setTimeout(()=>this.D.sf(d=>{d?b(d,null):(b(null,null),c())}),this.D.j.jd)};c();return()=>{this.j&&clearTimeout(this.j);this.j=null}}zg(a,b){this.D.sf(c=>{b(c,null)})}};olympe.auth.Fc.j={SAML:'saml',OAUTH2:'openID',SRP:'srp',Qm:'olympeToken'};function xf(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.j=new Map}set(a,b){olympe.C.Yc([b],c=>{this.j.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.j.get(a.toLowerCase()))&&a.hh&&(a=a.Ba.Fb);return a?a.valueOf():a}yc(){return this.get('username')}zd(){return this.get('nonce')}toString(){return this.yc()+(this.zd()?' with nonce':'')+(this.get('password')?' with password':'')+(xf(this)?` with idp name ${xf(this)}`:'')}};olympe.auth.gh=class{constructor(a,b,c,d={},e=null){this.user=a;this.Ei=b;this.D=c;this.j=e;this.F=d}yc(){return this.user}we(){return this.Ei}zd(){return this.D}jc(){return this.F}vi(){return null}Ef(){return this.j}fa(){const a=olympe.U.kf(),b=Object.assign({},{user:this.user,userTag:this.Ei,nonce:this.D},this.j&&{idpName:this.j},{payload:this.F});return olympe.U.Ks(ab(a,JSON.stringify(b)))}Ng(){return olympe.auth.Fc.j.SRP}};m=olympe.auth.gh.prototype;m.yc.K=new olympe.C.J(()=>String,[]);
|
|
602
|
+
m.we.K=new olympe.C.J(()=>String,[]);m.zd.K=new olympe.C.J(()=>String,[]);m.jc.K=new olympe.C.J(()=>Object,[]);m.vi.K=new olympe.C.J(()=>String,[]);m.Ef.K=new olympe.C.J(()=>String,[]);m.fa.K=new olympe.C.J(()=>String,[]);m.Ng.K=new olympe.C.J(()=>String,[]);function cf(a){return a.jc().access_token||null}function yf(a){return 1E3*parseInt(a.jc().access_token_exp||'0',10)}olympe.auth.Dk=class extends olympe.auth.gh{constructor(a,b,c,d,e){super(a,b,c,d,e);this.H=Date.now()}vi(){return cf(this)}Ng(){return olympe.auth.Fc.j.OAUTH2}};olympe.auth.Vr=class extends olympe.auth.gh{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.H=d}vi(){return this.H}Ng(){return olympe.auth.Fc.j.SAML}fa(){const a=olympe.U.kf(),b=Object.assign({},{user:this.yc(),userTag:this.we(),nonce:this.zd()},this.Ef()&&{idpName:this.Ef()},{payload:this.jc(),fullToken:this.H});return olympe.U.Ks(ab(a,JSON.stringify(b)))}};function ff(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function lf(a,b){return vb(a.D,()=>a.db.set('main','string'===typeof b?b:b.fa(),a.j).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function nf(a){return vb(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}`)}))}
|
|
603
603
|
olympe.auth.Wt=class{constructor(a,b,c){this.F=a;this.G=b;this.j='OlympeToken-'+c.j;this.D=new olympe.U.promise.Xk;this.db=this.F.D('AUTH')}ve(){this.G.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.j}`);return vb(this.D,()=>{const a=this;return u(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=
|
|
604
604
|
d.parse;var f=bb(olympe.U.kf().D(olympe.U.Dx(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Vr(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.Dk(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.gh(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.Pk=class{redirect(){}D(){}j(){}};olympe.auth.Pk.j={GET:'GET',Rg:'POST'};olympe.auth.Bo=class{constructor(a){this.j=a||'default'}};olympe.auth.Zd={};function zf(a,b,c){df(a.D,olympe.auth.vd.j.Og,{token:b.zd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.vd.j.Bb:c(Error('Invalid token'),null);break;case olympe.auth.vd.j.jj: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.Vr(f,g,h,e.samlToken,k,xf(b)):'openid'===l&&(d=new olympe.auth.Dk(f,g,h,k,xf(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
|
|
605
605
|
olympe.auth.Zd.Mv=class extends olympe.auth.Fc{constructor(a,b,c){super(a,b);this.storage=c}F(){return olympe.auth.Fc.j.Qm}ve(a,b){this.storage.ve().then(c=>{zf(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function Af(a,b,c){var d=yf(b);const e=Math.max(d-b.H,0),f=olympe.V.getParameter(olympe.auth.Config.qs);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.zg(b,c)},d);a.zg(b,c);return null}
|
|
@@ -613,21 +613,21 @@ r]]))},!0)},'olympe.auth');olympe.V.run([olympe.auth.P.Ea],a=>{olympe.auth.te=()
|
|
|
613
613
|
olympe.Xa.node.Eb.Yq=class{constructor(a){this.G=a;this.j=new Map}X(){return 0}N(a){const b=this;return u(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 u(function*(){const c=b.j.get(a);return c?Array.from(c.values()):[]})}R(a){const b=this;return u(function*(){const c=b.j.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return u(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;
|
|
614
614
|
return u(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 u(function*(){let d;return null==(d=c.j.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return u(function*(){let e;return null==(e=d.j.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return u(function*(){let d;yield null==(d=c.j.get(a))?void 0:d.delete(b)})}ba(){Ef();return Promise.resolve()}Z(){Ef();return Promise.resolve()}clear(a){const b=this;return u(function*(){let c;
|
|
615
615
|
null==(c=b.j.get(a))||c.clear()})}H(){Ef();return Promise.resolve([])}D(){return u(function*(){Ef()})}};olympe.Xa.node.Eb.Yq.ya=[olympe.Eb.Bv];olympe.Xa.node.Eb.Zq=class{constructor(a){this.j=new Map;this.G=a}D(a){this.j.has(a)||this.j.set(a,new olympe.Xa.node.Eb.Yq(this.G));return this.j.get(a)}};olympe.Xa.node.Eb.Zq.ya=[olympe.Eb.Cv];olympe.V.config(function(a){C(a,olympe.Eb.P.uk,olympe.Xa.node.Eb.Zq,olympe.Eb.P.Ca)},'olympe.native.node.localstorage');olympe.Xa.node.storage={};olympe.Xa.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.Xa.node.storage.Storage.ya=[olympe.Eb.Storage];olympe.V.config(function(a){Va(a,olympe.Eb.P.ij,olympe.Xa.node.storage.Storage,olympe.host.P.Ca)},'olympe.native.html.storage');olympe.yg={};olympe.yg.Config={VERSION:'version.version',Zt:'version.branch',vf:'version.commit',Sw:'version.tag',Lp:'version.olympe-framework',$t:'version.build'};olympe.V.config(function(a){E(a,olympe.yg.Config.VERSION,'');E(a,olympe.yg.Config.Zt,'');E(a,olympe.yg.Config.vf,'');E(a,olympe.yg.Config.Sw,'');E(a,olympe.yg.Config.Lp,'');E(a,olympe.yg.Config.$t,'')},'olympe.main');const Ff=require('fs'),Gf=require('fs/promises');let Hf;const If=null!=(Hf=process.env.EXTRA_CONFIG_PATH)?Hf:null;let Jf;const Gb=null!=(Jf=process.env.EXTRA_CONFIG_KEY_PREFIX)?Jf:'';function Fb(a){return Gf.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
|
|
616
|
-
function Kf(a){var b=Lf;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{Gf.access(c,Ff.constants.F_OK).then(()=>{Ff.watch(c,d=>u(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.U.st([c]),f=olympe.V.dt(e);for(const [g,h]of f)a.
|
|
616
|
+
function Kf(a){var b=Lf;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{Gf.access(c,Ff.constants.F_OK).then(()=>{Ff.watch(c,d=>u(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.U.st([c]),f=olympe.V.dt(e);for(const [g,h]of f)a.Di(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
|
|
617
617
|
function Mf(){console.log('The node process received a signal for graceful shutdown');let a,b,c,d;(null!=(d=null==(b=(a=olympe.Xa.node.host).rl)?void 0:null==(c=b.call(a))?void 0:cd(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',Mf);process.on('SIGINT',Mf);process.on('SIGBREAK',Mf);process.on('SIGHUP',Mf);
|
|
618
618
|
process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);Mf()});const Lf=['oConfig.json','conf.d/oConfig.json','version.json'];If&&Lf.push(If);
|
|
619
619
|
olympe.U.st(Lf).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.U.Ls(g[3])}const d=new olympe.V.mu(a,b);La(d);const e=d.compile();Na(e);Kf(e)}catch(b){console.error(`Failed to start Olympe: ${b}`),process.exit(1)}}).catch(a=>{console.error(`Failed to load config files: ${a.message}.`);
|
|
620
|
-
setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.va={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.va);olympe.dc.fc={ad:'ff022000000000000000',
|
|
621
|
-
olympe.dc.Lb={NONE:null,qp:'ff023000000000000037',Ec:'ff023000000000000137',mg:'ff023000000000000237',Hw:'ff023000000000000337',tu:'ff023000000000000437',gx:'ff023000000000000537',gC:olympe.dc.je.jg+'ff023000000000000037',hC:olympe.dc.je.jg+'ff023000000000000237',fC:olympe.dc.je.jg+'ff023000000000000437',qE:olympe.dc.je.jg+'ff023000000000000537'};olympe.dc.jr=class extends Error{constructor(a){var b=olympe.dc.ga(),c=olympe.dc.fe(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.jb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.cr=class extends Error{constructor(){var a=Nf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Uc(){}$c(){}D(){}Oa(){}hc(){}};olympe.dc.xr=class{rc(){}T(){}H(){}};olympe.dc.wc=class{constructor(a){this.tag='string'===typeof a?a:a.W()}W(){return this.tag}Fa(a){return a instanceof olympe.dc.wc&&this.tag===a.tag}};olympe.dc.wc.ya=[olympe.dc.Ze];olympe.dc.wc.prototype.Fa.K=olympe.C.J.j;olympe.dc.Du=class a{constructor(b,c,d,e,f,g){this.G=b;this.Z=c;this.db=c.view;this.ba=d;this.Jb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.U.
|
|
620
|
+
setInterval(()=>{},1073741824)});olympe.dc={};olympe.dc.va={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.va);olympe.dc.fc={ad:'ff022000000000000000',Ni:'ff02200000000000000e',$j:'ff02200000000000000f'};olympe.dc.yq={VERSION:'@v',ah:'@s'};olympe.dc.je={Ye:'?',jg:'~'};olympe.dc.AD={cj:'online',Ff:'offline',eC:'invalidate'};olympe.dc.Ia={SELF:'self',SERVER:'server',$e:'remote'};
|
|
621
|
+
olympe.dc.Lb={NONE:null,qp:'ff023000000000000037',Ec:'ff023000000000000137',mg:'ff023000000000000237',Hw:'ff023000000000000337',tu:'ff023000000000000437',gx:'ff023000000000000537',gC:olympe.dc.je.jg+'ff023000000000000037',hC:olympe.dc.je.jg+'ff023000000000000237',fC:olympe.dc.je.jg+'ff023000000000000437',qE:olympe.dc.je.jg+'ff023000000000000537'};olympe.dc.jr=class extends Error{constructor(a){var b=olympe.dc.ga(),c=olympe.dc.fe(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.jb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.cr=class extends Error{constructor(){var a=Nf();super('Try to access a resource not available yet: BusinessContainer, wait for it to be ready');this.j=a}};olympe.dc.Writable=class{Uc(){}$c(){}D(){}Oa(){}hc(){}};olympe.dc.xr=class{rc(){}T(){}H(){}};olympe.dc.wc=class{constructor(a){this.tag='string'===typeof a?a:a.W()}W(){return this.tag}Fa(a){return a instanceof olympe.dc.wc&&this.tag===a.tag}};olympe.dc.wc.ya=[olympe.dc.Ze];olympe.dc.wc.prototype.Fa.K=olympe.C.J.j;olympe.dc.Du=class a{constructor(b,c,d,e,f,g){this.G=b;this.Z=c;this.db=c.view;this.ba=d;this.Jb=e;this.D=f;this.N=g;this.j=new Map;this.F=hb(new olympe.U.ci(6E5),(h,k)=>{URL.revokeObjectURL(k);Of(this.db,h,a.j(h))})}ia(b,c,d,e,f){this.Ua(c).then(g=>{this.lb(b,g,d,!!this.N,e,f)}).catch(g=>this.G.error(g))}H(b){const c=this;return u(function*(){const d=f=>{f=`Failed to download file ${b.W()}: ${f}`;c.G.error(f);throw Error(f);},e=b.W();if(fb(c.F.j,e)){const f=c.F.get(e);return c.D.F(f).then(g=>g.arrayBuffer()).then(g=>
|
|
622
622
|
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.W(),d=b.get(olympe.dm.File.j);const e=b.get(olympe.dm.File.urlProp);if(e.startsWith('stream:'))return this.X(c).then(()=>this.downloadFileContent(b));if(e.startsWith('blob:'))return this.D.F(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f,
|
|
623
623
|
0,f.byteLength));if(d)return d=this.db.model(b),c=new olympe.dc.Request(olympe.dc.Request.j.gg,olympe.dc.fe().re(b),{tag:c,model:d,url:e.valueOf()}),this.Jb.request(c);c=N(e);Gc(c,olympe.net.ra.ResponseType.Tl);return Hc(this.ba,c).then(f=>{const g=f.Lc();if(200<=g&&300>g)return f.getData();throw Error(`Failed to download file ${b}. Response code ${g}`);})}wa(b,c,d){c=new olympe.dc.Request(olympe.dc.Request.j.eg,d,{tag:b,model:c});return this.Jb.request(c).then(()=>this.G.debug(`Successfully deleted file: ${b}`)).catch(e=>
|
|
624
624
|
{throw Error(`Failed to delete file ${b}: ${e.message}`);})}Ha(b){const c=new olympe.U.stream.og;this.H(b).then(d=>{cb(d).pipeTo(c).catch(()=>{})});return c}wb(b,c){this.D.H(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.ec;e.$c(b,(new Map).set(olympe.dm.File.urlProp.W(),d));this.Z.od(Pf(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)})}X(b){return new Promise((c,d)=>{let e;
|
|
625
625
|
const f=null!=(e=this.j.get(b))?e:[];f.push(g=>g?d(g):c());this.j.set(b,f)})}lb(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.qg,olympe.dc.fe().re(b),{tag:b,model:e,content:c,mimeType:d});this.Jb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.G.error.bind(this.G))}Ua(b){return u(function*(){var c=b instanceof olympe.C.Sa?b.valueOf():b;return'string'===typeof c?$a(c):c instanceof ArrayBuffer?new Uint8Array(c,
|
|
626
626
|
0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}R(b,c){const d=olympe.dc.ea(b);b=URL.createObjectURL(c);this.F.set(d,b);const e=a.j(d);Qf(this.db,d,f=>{f||(this.F.delete(d),Of(this.db,d,e))},e)}static j(b){return`cacheBinary${b}`}};function Rf(a,b){let c=Sf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.gf(b);if(null===b)break;c=Sf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Wu=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.oq)})}};function Tf(a,b){a.origin=b;return a}function Uf(a,b,c){a.D.set(b,c);return a}function Vf(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.Ia.SELF;this.j=b;this.content=null!=c?c:null;this.user=null!=d?d:de(olympe.auth.te()).we();this.D=new Map}getType(){return this.type}yc(){return this.user}ic(){return this.j}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.j}; content: ${this.content}`}};
|
|
627
|
-
olympe.dc.Request.j={pc:1,Kg:10,Fu:24,Yp:25,Gu:28,Ug:30,Kk:31,WC:32,ef:40,fh:41,Eo:42,Jr:43,lE:44,
|
|
627
|
+
olympe.dc.Request.j={pc:1,Kg:10,Fu:24,Yp:25,Gu:28,Ug:30,Kk:31,WC:32,ef:40,fh:41,Eo:42,Jr:43,lE:44,Ii:45,Go:46,lk:47,qg:50,gg:51,eg:52,ax:60,pw:61,Tp:62,YB:63,gu:64,Bh:65,ek:91,Hu:93,Lm:95,QUERY_RESULT:97};function Wf(a,b,c,d,e){const f=olympe.C.nh();a.sources.set(olympe.dc.Ia.SERVER,e.init(a));a.F?a.sources.set(olympe.dc.Ia.$e,d.init(a)):Qf(b,a.j,()=>{a.sources.set(olympe.dc.Ia.$e,d.init(a));const g=new Map;olympe.dc.la.from(a.j,a.j).bb(olympe.dm.DataSource.Nj).filter(olympe.dc.query.za.Fa(olympe.dm.DataSource.ki,!0)).observe(f).subscribe(h=>{var k=h.Fj();for(var l of k){const [p,q]=g.get(l);c.D(p);c.F(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=h.zj();for(const p of h)if(h=
|
|
628
628
|
p.W(),!a.sources.has(h)){const q=new olympe.dc.sources.Iq(a.G,p);a.sources.set(h,q);l=c.j(()=>q.healthCheck(),h,olympe.host.Le.j.READINESS);n=c.H(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Of(b,a.j,'router',!0)},'router')}function Xf(a,b,c){let d=a.D.get(b);void 0===d&&(d=[],a.D.set(b,d));d.push(c)}
|
|
629
|
-
olympe.dc.uw=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;Wf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.jb(a.ic()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.jb(a.ic()).subscribe(a,b)}Oc(a){if(a.ic()!==this.j)this.G.error(`Router: try to reply to a request that is not for this data cloud, ignore it: ${a}`);else{var b;null==(b=this.D.get(a.getType()))||b.forEach(c=>c(a))}}
|
|
630
|
-
(b=this.D.get(a.getType()))||b.forEach(c=>c(a));return this.jb(olympe.dc.Ia.$e).
|
|
629
|
+
olympe.dc.uw=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;Wf(this,d,e,b,c)}request(a){this.G.debug('Router: sends',a);return this.jb(a.ic()).request(a)}subscribe(a,b){this.G.debug('Router: subscribes',a);return this.jb(a.ic()).subscribe(a,b)}Oc(a){if(a.ic()!==this.j)this.G.error(`Router: try to reply to a request that is not for this data cloud, ignore it: ${a}`);else{var b;null==(b=this.D.get(a.getType()))||b.forEach(c=>c(a))}}Ai(a){let b;null==
|
|
630
|
+
(b=this.D.get(a.getType()))||b.forEach(c=>c(a));return this.jb(olympe.dc.Ia.$e).Ai(a)}jb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ia.$e)}};function Pf(a,b){b=new olympe.dc.Ig(a.T(),null!=b?b:null);b.j=a;return b}function Yf(a,b,c,d){c=new olympe.dc.Ig(null!=d?d:olympe.U.Mc(),null!=c?c:null);c.D=b;c.Ga=a;return c}
|
|
631
631
|
olympe.dc.Ig=class{constructor(a,b){this.id=a;this.Ga=this.j=this.D=null;this.il=b}static j(a){return Yf(a.p,a.s,a.t,a.i)}T(){return this.id}rc(a){return this.j instanceof olympe.dc.db.ec?this.j.rc(a):Array.isArray(this.Ga)?(new olympe.dc.transaction.dj(this.D)).D(this.Ga,a):a}H(){let a,b,c,d;return null!=(d=null!=(c=null==(a=this.Ga)?void 0:a.length)?c:null==(b=this.j)?void 0:b.H())?d:0}Yb(){return this.j instanceof olympe.dc.db.ec?this.j:Array.isArray(this.Ga)?(this.j=(new olympe.dc.transaction.dj(this.D)).j(this.Ga,
|
|
632
632
|
this.id),this.Ga=null,this.j):new olympe.dc.db.ec(this.id)}pl(){if(Array.isArray(this.Ga))return this.Ga;if(this.j instanceof olympe.dc.db.ec){const a=new olympe.dc.transaction.Je;this.j.rc(a);return Zf(a)}return[]}fa(){return{p:this.pl(),t:this.il,s:this.D,i:this.id}}};olympe.dc.Ig.ya=[olympe.dc.xr];olympe.dc.Ra={};const $f=olympe.dc.va.ORIGIN,ag=olympe.dc.va.DESTINATION,bg=new Map,cg=new Map,dg=new Map,eg=new Map;function Sf(a){let b;return null!=(b=bg.get(a))?b:null}function fg(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.mo||[])];return olympe.dc.oa.j(b,c,...a)}function gg(a,b){eg.set(a,b);return a}function hg(a){let b,c;return null!=(c=null==(b=bg.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
|
|
633
633
|
function ig(a,b,c){const d=a+'@'+(b===ag?$f:ag);if(cg.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);cg.set(d,c)}function jg(a){a=a.W()+'@'+a.La();return cg.get(a)||olympe.dc.CloudObject}function Q(a,b){b.NAME=a;dg.set(a,b)}function R(a){let b;return null!=(b=a.NAME)?b:null}
|
|
@@ -644,15 +644,15 @@ olympe.dc.db.ku=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ga=c;let e;thi
|
|
|
644
644
|
1);rg(this,tg(this,d.D,c),b);this.F.delete(a)}}write(a,b,c=!1){b=new olympe.dc.db.rn(this.G,this.H,this.ga,b);b.open(c);b.write(a,this.R);b.close()}};class wg{T(){}od(){}}function xg(a,b,c,d){const e=olympe.dc.va.DESTINATION;c=c.tag();const f=a.j.Wc(c);b.Ab().forEach((g,h)=>{f.ja(h,g);b.Z(h)});for(const [g,h,k,l]of b.ba()){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)}}
|
|
645
645
|
function yg(a,b,c,d){const e=olympe.dc.va.DESTINATION,f=c.tag(),g=a.j.Wc(f);b.Ab().forEach((h,k)=>{void 0!==c.Pa(k)&&(g.ja(k,h),b.Z(k))});for(const [h,k,l]of b.Ld()){const n=c.lb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
|
|
646
646
|
class qg extends wg{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ga()}T(){return this.D.T()}od(a){for(const [b,c]of this.D.ba(a)){const d=b.tag();c.Bd()?b.D()?a.j(d,b.F()):(this.D.j(d,c.F()),this.j.j(d,c.F())):b.Bd()?(xg(this,c,b,a),a.j(d,b.F())):yg(this,c,b,a)}return a}}function zg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
|
|
647
|
-
class sg extends wg{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;zg(this)}T(){return this.j.T()}od(a){return a.R(this.j)}update(a,b){this.D=b;a.rc(this.j);zg(this);return this}};const Ag=olympe.dc.fc.ad,Bg=olympe.dc.fc.
|
|
647
|
+
class sg extends wg{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;zg(this)}T(){return this.j.T()}od(a){return a.R(this.j)}update(a,b){this.D=b;a.rc(this.j);zg(this);return this}};const Ag=olympe.dc.fc.ad,Bg=olympe.dc.fc.Ni,Cg=olympe.dc.va.ORIGIN,Dg=olympe.dc.va.DESTINATION;let Eg=0;
|
|
648
648
|
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.Ia.SELF;this.G=b;this.jd=olympe.C.Za();this.state=olympe.dc.db.Database.F.IDLE;this.ia=new Map;this.Vb=[];this.X=new Map;this.H=null;this.ba=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Bf.j.nm;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.xd=new olympe.dc.db.Bf(c,this,b,f);d.get('debug')&&this.ul()}T(){return this.id}getState(){return this.state}Wa(){return this.G}create(b,
|
|
649
649
|
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.Z(f,!0)}e&&f.persist();this.state===a.F.Sl&&Fg(f,!0);d&&this.Ic(f,d);this.D(a.j.pq,b)}update(b,c){c&&(b=this.N(b,!0),this.Ic(b,c))}wa(b){const c=this.get(b);void 0!==c&&(this.Z(c,!1),this.D(a.j.qq,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case Ag:Gg(c,d);break;case Bg:Hg(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!==
|
|
650
650
|
d)switch(b){case Ag:Ig(c,d);break;case Bg:Jg(c,d);break;default:c.unlink(b,d)}}Qf(b,c){for(const d of b)this.N(d).pe(c)}ih(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Lj(...b){for(const c of b)null!=(b=this.get(c))&&(b.e=!1)}wl(b){b.forEach(c=>{this.N(c).persist()})}Dd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.xp,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Uc(b,c)}Uc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.wp,b);c&&
|
|
651
|
-
this.state!==a.F.Sl&&this.D(a.j.qn,b);return d}wb(b){var c=olympe.U.
|
|
651
|
+
this.state!==a.F.Sl&&this.D(a.j.qn,b);return d}wb(b){var c=olympe.U.si();this.H?Kg(this.H,c,b):b()}R(b){let c;null!=(c=this.H)&&c.j.delete(b)}Ha(b,...c){this.ia.has(b)&&this.ia.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.Ha(b,c,...d)}Z(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}Re(b,c,d,e){let f;null!=(f=this.H)&&Lg(f,b).ja(e?Mg+c:c,d)}ff(b,c,d,e,f){let g;null!=(g=this.H)&&(d===Ng?f?Lg(g,b).link(c,e):Lg(g,b).unlink(c,e):f?Lg(g,b).wb(c,e):Lg(g,b).Hc(c,e))}Ua(b,c,d){let e;null!=(e=this.H)&&Lg(e,b).Dd(c,
|
|
652
652
|
d)}addEventListener(b,c){let d=this.ia.get(b);void 0===d&&(d=[],this.ia.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,c)}lb(b){this.Vb.push(b)}F(b){for(const c of this.X.values())if(c.R.has(b))return!0;return!1}Rf(b=!1){const c=Eg++;this.state=a.F.Ll;this.ba.add(c);b||this.X.set(c,new olympe.dc.db.yu(c,this,this.jd));return c}zl(b,c){if(!this.ba.has(b))throw Error('Database: cannot use a transaction that has not been started');let d;this.H=null!=(d=this.X.get(b))?d:null;b=this.state;this.state=
|
|
653
653
|
null===this.H?a.F.Sl:a.F.gw;c();this.state=b;this.H=null}me(b){this.state=a.F.vf;const c=this.X.get(b);c&&(this.H=c,Og(this.H),Pg(this.H),this.X.delete(b),this.H=null);this.ba.delete(b);0===this.ba.size&&(this.state=a.F.IDLE,this.Vb.forEach(d=>{d()}),Qg(this.xd))}Ic(b,c){const d=a.D.Ye;for(const [e,f]of c)void 0!==f&&(e[0]===d?Rg(b,e.substring(1),f):b.update(e,f))}Hc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Cg+Ag)))for(const f of c.values())null!==f.source()&&this.Hc(b,
|
|
654
654
|
f,d);return d}ul(){const b=a.j.qm,c=a.j.Mk,d=new Set,e=new Map;this.j(a.j.pq,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===Bg&&g[1]===Dg){const h=g[2];this.get(h).Ja()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.lb(()=>{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 !`+
|
|
655
|
-
`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={fj:'$',Su:'~',Ye:'?',Ml:'=',lq:'|',
|
|
655
|
+
`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={fj:'$',Su:'~',Ye:'?',Ml:'=',lq:'|',Ki:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.j={wp:0,xp:1,xs:2,qn:3,To:4,Uo:5,qm:6,Ec:7,Mk:8,cn:9,pq:10,qq:11,Er:12,UA:13,TA:14,Ww:15,Pp:16};olympe.dc.db.Database.F={IDLE:0,Ll:1,gw:2,Sl:3,vf:4};function Sg(a,b,c=[]){const d=b.T();pg(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=tg(e,f.j,e.D.length);e.write(rg(e,f,Date.now()),!1);e.F.delete(d)}}}}function Tg(a,b,c={}){let d,e;return vg(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.An)?e:!1)}function Ug(a,b){a.D.lb(b)}
|
|
656
656
|
olympe.dc.db.uu=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.ku(a,b,c,d);this.Iz=new olympe.dc.db.Rv(a,c,b,e)}Wa(){return this.G}od(a,b={}){let c,d;this.j.od(a,null!=(c=b.persist)?c:!0,null!=(d=b.An)?d:!1)}pe(a,b){this.D.Qf(a,b)}detach(a,b){this.D.ih(a,b);return this}Lj(...a){this.D.Lj(...a.map(olympe.dc.ea))}};const Vg=olympe.dc.db.Database.D.ORIGIN,Wg=olympe.dc.db.Database.D.DESTINATION,Xg=olympe.dc.db.Database.D.fj,Yg=olympe.dc.db.Database.D.Ye,Zg=olympe.dc.db.Database.D.Ml,$g=olympe.dc.db.Database.D.lq,ah=Vg+Wg,bh=Xg+Xg,ch=olympe.dc.db.Database.F;let dh=0;function Of(a,b,c,d=!1){const e=T(a,b);if(null!==e){const f=eh(e,'',c);void 0!==f&&(a.j.getState()!==ch.vf||e.F()&&!d||a.j.R(c),d||!e.Ja()&&!e.F()||f(!1,b))}}
|
|
657
657
|
function Qf(a,b,c,d){a=a.j.N(fh(b));d=null!=d?d:gh();hh(a,'',d,c)&&a.Ja()&&c(!0,b);return d}function ng(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ea(e));for(const h of g)yield h,d.ol(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function gh(){++dh;return String(dh)}function fh(a){if(a)return olympe.dc.ea(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
|
|
658
658
|
function ih(a,b,c,d,e){a=a.j.N(fh(b));c=fh(c);b=Xg+c;e=null!=e?e:gh();if(hh(a,b,e,d)&&a.Ja()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Zg+c));void 0!==b&&d(b,f)}return e}function T(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.ea(b)),!a||c&&!a.Ja()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function jh(a,b,c,d){b=T(a,b);null!==b&&(c=olympe.dc.ea(c),eh(b,Xg+c,d),a.j.getState()===ch.vf&&a.j.R(d))}
|
|
@@ -663,14 +663,14 @@ function sh(a,b,c,d,e){const f=a.j.N(fh(b));e=null!=e?e:gh();const g=nh(f,$g+c,e
|
|
|
663
663
|
function rh(a,b,c){if(c===olympe.dc.Lb.NONE)return 0;const d=c[0]===olympe.dc.je.jg;c=d?c.substring(1):c;a=a.Pa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function vh(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===Vg||c===Wg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(T(a,b,!0))}
|
|
664
664
|
function wh(a,b,c){if(!a.Ja(b))return a.G.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ea(b)];for(const f of e){const g=a.cb(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.ea(b)}`);return d}function xh(a,b,c,d){return(c=(a=T(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ja()).length:0}
|
|
665
665
|
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=T(this,a);if(null!==a){b=b.La()+b.W();const e=eh(a,b,c);void 0!==e&&(this.j.getState()!==ch.vf||a.F()&&!d||this.j.R(c),d||!a.Ja()&&!a.F()||mh(a,b,!1,e,!1))}}Ja(a){a=this.j.get(olympe.dc.ea(a));return!(null==a||!a.Ja())}name(a){let b,c;return null!=(c=null==(b=T(this,a))?void 0:b.Pa(olympe.dc.CloudObject.nameProp.W()))?c:''}model(a){return(a=(a=T(this,a,!0))?a.model():null)?a.tag():null}gf(a){return(a=(a=T(this,
|
|
666
|
-
a,!0))&&a.gf())?a.tag():null}
|
|
666
|
+
a,!0))&&a.gf())?a.tag():null}yi(a){a=T(this,a,!0);return!(!a||!a.gf())}Nb(a,b){a=(a=T(this,a,!0))&&a.model();return!(!a||!this.Xf(a.tag(),b))}source(a){return(a=T(this,a,!0))&&a.source()}Se(a){a=T(this,a,!1);return!a||a.N}Pa(a,b,c){a=T(this,a,!0);b=olympe.dc.ea(b);let d;return null!=(d=null==a?void 0:a.Pa(b,c))?d:null}Ab(a,b=!1){var c=T(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===Xg||!b&&c===Zg)&&a.set(d.substring(1),e);return a}ol(a,b){return qh(this,a,b).filter(([c])=>c.Ja()).map(([c,
|
|
667
667
|
...d])=>[c.tag(),...d])}cb(a,b){a=T(this,a,!0);b=b.La()+b.W();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ja()&&a.push(c.tag());return a}rt(a,b,c){let d,e;a=null==(d=T(this,a,!0))?void 0:null==(e=d.get(b.La()+b.W()))?void 0:e.get(olympe.dc.ea(c));return!(null==a||!a.Ja())}Tn(a,b){a=T(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=T(this,d,!0).get(c.La()+c.W()),void 0!==a)for(const e of a.values())e.Ja()&&b.push(e.tag());a=b}return a}Ib(a,b){var c=
|
|
668
668
|
T(this,a,!0);const d=b.La()+b.W();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.G.warn(`Relation ${b.W()} 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.Ja())?a.tag():null}qh(a,b,c){a=olympe.dc.ea(a);const d=wh(this,a,b);d.delete(a);return c?(c=olympe.dc.ea(c),d.has(c)?Array.from(wh(this,c,b.ac()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Vs(a,b,c){if(!this.Ja(a))return null;b=wh(this,
|
|
669
669
|
a,b);const d=[olympe.dc.ea(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}Ln(a,b,c){return this.Tn(a,b).find(c)||null}gy(a,b,c){return this.Tn(a,b).filter(c)}at(a,b=olympe.dc.CloudObject){var c=T(this,a,!0);const d=b&&T(this,b,!0),e=[c];for(;c&&c!==d;){c=c.gf();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ja())throw a=`Try to get all extensions of the model ${olympe.dc.ea(a)} but one of them does not exists (${c.tag()})`,
|
|
670
670
|
Error(a);null!==c&&e.push(c)}c=T(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())}Xf(a,b){const c=olympe.dc.ea(b);return!!this.Vs(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Xc(a){return this.cb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.kb.prototype.getInstances=olympe.dc.kb.prototype.Xc;olympe.dc.kb.prototype.isExtending=olympe.dc.kb.prototype.Xf;
|
|
671
671
|
olympe.dc.kb.prototype.getExtendedModels=olympe.dc.kb.prototype.at;olympe.dc.kb.prototype.findAllRelated=olympe.dc.kb.prototype.gy;olympe.dc.kb.prototype.findRelated=olympe.dc.kb.prototype.Ln;olympe.dc.kb.prototype.findRecursive=olympe.dc.kb.prototype.Vs;olympe.dc.kb.prototype.getRecursiveRelated=olympe.dc.kb.prototype.qh;olympe.dc.kb.prototype.getUniqueRelated=olympe.dc.kb.prototype.Ib;olympe.dc.kb.prototype.getMultiRelated=olympe.dc.kb.prototype.Tn;olympe.dc.kb.prototype.isRelated=olympe.dc.kb.prototype.rt;
|
|
672
|
-
olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.cb;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Ab;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Pa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.Se;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Nb;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.
|
|
673
|
-
olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ja;const yh=olympe.dc.db.Database.D.ORIGIN,Ng=olympe.dc.db.Database.D.DESTINATION,Mg=olympe.dc.db.Database.D.Ml,zh=olympe.dc.db.Database.D.fj,Ah=olympe.dc.db.Database.D.lq,Bh=olympe.dc.db.Database.D.
|
|
672
|
+
olympe.dc.kb.prototype.getRelated=olympe.dc.kb.prototype.cb;olympe.dc.kb.prototype.getProperties=olympe.dc.kb.prototype.Ab;olympe.dc.kb.prototype.getProperty=olympe.dc.kb.prototype.Pa;olympe.dc.kb.prototype.isPersisted=olympe.dc.kb.prototype.Se;olympe.dc.kb.prototype.instanceOf=olympe.dc.kb.prototype.Nb;olympe.dc.kb.prototype.isModel=olympe.dc.kb.prototype.yi;olympe.dc.kb.prototype.extension=olympe.dc.kb.prototype.gf;olympe.dc.kb.prototype.model=olympe.dc.kb.prototype.model;
|
|
673
|
+
olympe.dc.kb.prototype.name=olympe.dc.kb.prototype.name;olympe.dc.kb.prototype.exist=olympe.dc.kb.prototype.Ja;const yh=olympe.dc.db.Database.D.ORIGIN,Ng=olympe.dc.db.Database.D.DESTINATION,Mg=olympe.dc.db.Database.D.Ml,zh=olympe.dc.db.Database.D.fj,Ah=olympe.dc.db.Database.D.lq,Bh=olympe.dc.db.Database.D.Ki,Ch=yh+Ng,Dh=zh+zh,Eh=Array.from(Object.values(olympe.dc.Lb)).filter(a=>null!==a);function Kg(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)}
|
|
674
674
|
function Og(a){for(const [b,c]of a.H)a.D.Hc(new Set,b).filter(d=>Fg(d,c)).forEach(d=>{d=d.tag();c?Lg(a,d).create():Lg(a,d).delete()})}
|
|
675
675
|
function Pg(a){const b=a.D;a.F.forEach((c,d)=>{var e=b.get(d);if(c.D()||c.Bd()){var f=e.get(Bh);f&&Fh(a,f,c.D(),d);c.Bd()&&a.R.add(d)}for(const [n,p]of c.Ab()){var g=n[0]===Mg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(Bh+zh+h);q&&Fh(f,q,l,g);(k=k.get(Bh+Dh))&&Fh(f,k,h,l,g)}for(const n of c.ba())Gh(a,e,...n);(e=c.X)&&Hh(a,e,d,c.Vb,!c.Bd())});a.H.clear();a.F.clear();a.N.clear();Ih(a)}function Lg(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Nh(b),a.F.set(b,c));return c}
|
|
676
676
|
function Fh(a,b,...c){b.forEach((d,e)=>{Kg(a,e,d.bind(null,...c))})}function Gh(a,b,c,d,e,f){var g=b.get(Bh+d+c);g&&Fh(a,g,f,e);(g=b.get(Bh+Ch))&&Fh(a,g,c,d,f,e);Jh(a,c,d).forEach((h,k)=>{(k=b.get(Bh+Ah+k))&&Fh(a,k,c,d,h,f,e)})}function Hh(a,b,c,d,e){Eh.forEach(f=>{const g=f[0]===olympe.dc.je.jg;(f=a.D.get(g?c:b).get(Bh+Ah+f))&&Fh(a,f,d,null,!0,e,g?b:c)})}
|
|
@@ -679,15 +679,15 @@ olympe.dc.db.yu=class{constructor(a,b,c){this.id=a;this.D=b;this.X=c;this.H=new
|
|
|
679
679
|
olympe.dc.db.Bf=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.Bf.j.nm&&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.Dd(c),b.push(c))}this.D.clear();this.j.Ha(olympe.dc.db.Database.j.Pp,b);this.F=!1}init(){const a=olympe.dc.db.Database.j.xs,b=olympe.dc.db.Database.j.qq,
|
|
680
680
|
c=olympe.dc.db.Database.j.Er,d=olympe.dc.db.Database.F.IDLE,e=f=>{this.D.add(f);this.j.getState()===d&&Qg(this)};this.j.j(olympe.dc.db.Database.j.qn,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.Ww,()=>{this.run()});this.j.j(c,(f,...g)=>{this.G.error(g[0])})}};olympe.dc.db.Bf.j={nm:0,Jw:1,so:2};olympe.dc.db.Bf.D=5E3;olympe.dc.db.ec=class{constructor(a){this.id=null!=a?a:olympe.U.jf();this.Cb=new Map}T(){return this.id}rc(a){const b=olympe.dc.db.Nh.j.Km,c=olympe.dc.db.Nh.j.Ec,d=olympe.dc.db.Nh.j.al;this.Cb.forEach((e,f)=>{const g=e.Wb();switch(e.getState()){case b:const h=e.jb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.N()?e.Ab():void 0;a.Uc(f,h,k,g);break;case d:e.N()&&a.$c(f,e.Ab(),g);break;case c:a.D(f,e.F(),g)}for(const [h,k,l]of e.Ld())e=this.Cb.get(k),
|
|
681
681
|
l?a.Oa(h,f,k,g,e.Wb()):a.hc(h,f,k,g,e.Wb())});return a}pf(){return 0===this.Cb.size}H(){let a=0;this.Cb.forEach(b=>{a+=b.jd()});return a}Uc(a,b,c,d=null){b=this.F(a).create(b);'string'===typeof d&&this.Oa(olympe.dc.fc.ad,a,d,d,null);c&&b.yn(c)}$c(a,b,c=null){b&&this.F(a,c).yn(b)}D(a,b=olympe.dc.Lb.NONE,c=null){const d=this.Cb.get(a);if(d&&d.D())this.j(a,b);else{this.F(a,c).delete(b);for(const e of this.ol(a,b,!1))this.Cb.get(e).Ab().clear(),this.X(e,!0)}}Oa(a,b,c,d=null,e=null){this.F(b,d).link(a,
|
|
682
|
-
c);this.F(c,e).wb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Hc(a,b)}Z(a){var b=olympe.dc.ga();if(b.Ja(a)){const c=b.model(a),d=b.source(a),e=b.Ab(a,!0);uh(b,a).forEach((f,g)=>{e.set(`${olympe.dc.je.Ye}${g}`,f)});this.Uc(a,d,e,c);(b=b.gf(a))&&this.Oa(olympe.dc.fc.
|
|
682
|
+
c);this.F(c,e).wb(a,b)}hc(a,b,c,d=null,e=null){this.F(b,d).unlink(a,c);this.F(c,e).Hc(a,b)}Z(a){var b=olympe.dc.ga();if(b.Ja(a)){const c=b.model(a),d=b.source(a),e=b.Ab(a,!0);uh(b,a).forEach((f,g)=>{e.set(`${olympe.dc.je.Ye}${g}`,f)});this.Uc(a,d,e,c);(b=b.gf(a))&&this.Oa(olympe.dc.fc.Ni,a,b);e.forEach(f=>{f instanceof olympe.dc.wc&&this.Z(f.W())})}}Xc(){return function*(a){for(const b of a.values())if(b.D()||b.Bd()||b.N())yield b}(this.Cb)}Wc(a){let b;return null!=(b=this.Cb.get(olympe.dc.ea(a)))?
|
|
683
683
|
b:null}j(a,b=olympe.dc.Lb.NONE){a=this.ol(a,b);for(const c of a)this.X(c,!1),this.Cb.delete(c)}Ld(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.Ld((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.Cb.values())}qh(a,b,c=(d,e)=>[d,e]){return this.ia(a,b,c)}*ia(a,b,c,d=[]){d.push(a);a=this.Wc(a);for(const [e,f]of a.cb(b))d.includes(e)||(yield*this.ia(e,b,c,d),yield c(e,f))}N(a,b,c){const d=this.Cb.get(b),e=this.Cb.get(c);d&&d.H(a,olympe.dc.va.DESTINATION,c);e&&e.H(a,olympe.dc.va.ORIGIN,
|
|
684
684
|
b)}X(a,b){const c=olympe.dc.va.ORIGIN,d=olympe.dc.va.DESTINATION,e=this.Cb.get(a);for(const [g,h,k]of e.Ld())if(k||!b){e.H(g,d,h);var f=this.Cb.get(h);f&&f.H(g,c,a)}for(const [g,h,k]of e.Ua())if(k||!b)e.H(g,c,h),(f=this.Cb.get(h))&&f.H(g,d,a)}*ft(a){let b;for(const [c,d]of(null==(b=this.Wc(a))?void 0:b.cb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.Cb.get(c),a.Bd()||(yield a))}ol(a,b,c=!0){const d=olympe.dm.Relation.j.Lr,e=olympe.dm.Relation.j.us,f=olympe.dc.va.ORIGIN,g=olympe.dc.ga();a=new Set([a]);
|
|
685
685
|
const h=new Set;for(const l of a){var k=this.Cb.get(l);if(void 0!==k){for(const [n,p,q]of k.Ld())q&&rh(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.Ua())q&&rh(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of vh(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&rh(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.Cb.has(l))}F(a,b){let c=this.Cb.get(a);void 0===c&&(c=new olympe.dc.db.Nh(a),this.Cb.set(a,c));return b?c.wa(b):c}R(a){const b=
|
|
686
|
-
olympe.dc.va.DESTINATION;for(const [c,d]of this.ba(a))if(a=c.tag(),d.Bd())this.j(a,d.F());else if(c.Bd())d.D()&&this.j(a,c.F());else{c.Ab().forEach((e,f)=>{void 0!==d.Pa(f)&&c.Z(f)});for(const [e,f,g]of c.Ld()){const h=d.lb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*ba(a){var b=this.Cb;const c=a.Cb,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.ya=[olympe.dc.Writable,olympe.dc.xr];const Kh=olympe.dc.db.Database.j,Lh=olympe.dc.db.Database.D.fj,Mh=olympe.dc.db.Database.D.Su,Nh=olympe.dc.db.Database.D.Ye,Oh=olympe.dc.db.Database.D.Ml,Ph=olympe.dc.db.Database.D.
|
|
686
|
+
olympe.dc.va.DESTINATION;for(const [c,d]of this.ba(a))if(a=c.tag(),d.Bd())this.j(a,d.F());else if(c.Bd())d.D()&&this.j(a,c.F());else{c.Ab().forEach((e,f)=>{void 0!==d.Pa(f)&&c.Z(f)});for(const [e,f,g]of c.Ld()){const h=d.lb(e,b,f);void 0!==h&&g!==h&&this.N(e,a,f)}}return this}*ba(a){var b=this.Cb;const c=a.Cb,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.ya=[olympe.dc.Writable,olympe.dc.xr];const Kh=olympe.dc.db.Database.j,Lh=olympe.dc.db.Database.D.fj,Mh=olympe.dc.db.Database.D.Su,Nh=olympe.dc.db.Database.D.Ye,Oh=olympe.dc.db.Database.D.Ml,Ph=olympe.dc.db.Database.D.Ki,V=olympe.dc.va.ORIGIN,W=olympe.dc.va.DESTINATION,Qh=olympe.dc.fc.ad,Rh=olympe.dc.fc.Ni;function og(a,b,c=!1){const d=a.get(Nh+b);return c||void 0!==d?d:a.get(Mh+b)}function Fg(a,b){const c=a.e!==b;c&&(b?(a.e=b,Sh(a)):(Th(a),a.e=b),a.db.D(b?Kh.qm:Kh.Ec,a.j));return c}
|
|
687
687
|
function Gg(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(Qh,c)}a.link(Qh,b);b.forEach((d,e)=>{if(e[0]===Nh||e[0]===Mh)e=e.substring(1),Uh(a,e,d)});null===a.H||!b.e&&b!==a||a.db.Z(a,!0)}function Hg(a,b){const c=a.gf();if(null!==c){if(c===b)return;a.unlink(Rh,c)}a.link(Rh,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===Nh||f[0]===Mh)f=f.substring(1),a.has(Nh+f)||(a.set(Mh+f,e),d.set(f,e))});Vh(a,d)}
|
|
688
688
|
function Ig(a,b){a.unlink(Qh,b);a.forEach((c,d)=>{c=d.substring(1);Uh(a,c,null)});a.db.Z(a,!1)}function Jg(a,b){a.unlink(Rh,b);const c=new Map;a.forEach((d,e)=>{e[0]===Mh&&(a.delete(e),d=e.substring(1),c.set(d,null))});Vh(a,c)}
|
|
689
|
-
function Rg(a,b,c){const d=Nh+b;var e=a.get(d);e=void 0===e?null:e;if(!Wh(e,c))if(Xh(a,b,e,c,!0),e=Mh+b,null===c){a.delete(d);let f;c=null==(f=a.gf())?void 0:og(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Vh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Vh(a,(new Map).set(b,c))}function hh(a,b,c,d){const e=Yh(a,Ph+b);return e.has(c)?!1:(e.set(c,d),a.pe(olympe.dc.db.Instance.j.
|
|
690
|
-
function eh(a,b,c){const d=Zh(a,Ph+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.
|
|
689
|
+
function Rg(a,b,c){const d=Nh+b;var e=a.get(d);e=void 0===e?null:e;if(!Wh(e,c))if(Xh(a,b,e,c,!0),e=Mh+b,null===c){a.delete(d);let f;c=null==(f=a.gf())?void 0:og(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Vh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Vh(a,(new Map).set(b,c))}function hh(a,b,c,d){const e=Yh(a,Ph+b);return e.has(c)?!1:(e.set(c,d),a.pe(olympe.dc.db.Instance.j.Ki+b),a.db.D(Kh.To,a.j,b,c),!0)}
|
|
690
|
+
function eh(a,b,c){const d=Zh(a,Ph+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.Ki+b),a.db.D(Kh.Uo,a.j,b,c));return d}function nh(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.rw+b;h?g.pe(k):g.detach(k)}d(...f)};return hh(a,b,c,e)?e:null}function Wh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Fa?a.Fa(b):a===b}
|
|
691
691
|
function Xh(a,b,c,d,e){c instanceof olympe.dc.wc&&($h(a.db.get(c.W())),a.db.wa(c.W()));d instanceof olympe.dc.wc&&(c=a.db.N(d.W(),!0),c.D&&c.D.tag!==a.j&&a.db.Wa().fatal('Instance',d.W(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.Da+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.pe(olympe.dc.db.Instance.j.gj+a+':'+b),d.db.Ua(d.j,a,b)),d.D={tag:a,Da:b,vz:e})}
|
|
692
692
|
function ai(a,b,c,d){a.e&&a.db.Re(a.j,b,c,d)}function Vh(a,b,c=[]){const d=a.get(V+Qh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>Uh(e,g,f))});a=a.get(V+Rh);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(Nh+k)||(g.set(k,h),null!==h?e.set(Mh+k,h):e.delete(Mh+k))});Vh(e,g,[...c,f])}})}function Yh(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function bi(a,b,c,d,e){a.db.ff(a.j,b,c,d.j,e)}
|
|
693
693
|
function Zh(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 Uh(a,b,c){if(!a.has(Lh+b)){const d=Oh+b,e=a.get(d);Wh(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),ai(a,b,c,null!==c))}}function Sh(a){a.forEach((b,c)=>{const d=c[0];if(d===V||d===W){const e=c.substring(1),f=d===V?W:V;b.forEach(g=>{g.e&&(bi(a,e,d,g,!0),bi(g,e,f,a,!0))})}else if(d===Lh||d===Oh)c=c.substring(1),ai(a,c,b,d===Oh)})}
|
|
@@ -697,7 +697,7 @@ olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.j=a;this.H
|
|
|
697
697
|
var b=this.model();if(b){var c=b.Pa(olympe.dc.CloudObject.nameProp.W())||'No model name';a+=`\nModel: ${b.j}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.gf())?(c=b.Pa(olympe.dc.CloudObject.nameProp.W())||'No extension name',a+=`\nExtension: ${b.j}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Pa(a,b=!1){const c=this.get(Lh+a);return b||void 0!==c?c:this.get(Oh+a)}update(a,b){const c=Lh+a;var d=this.get(c);d=void 0===d?null:d;if(!Wh(d,b))if(Xh(this,
|
|
698
698
|
a,d,b,!1),d=Oh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:og(e,a);void 0!==b?(this.set(d,b),ai(this,a,b,!0)):ai(this,a,null,!1)}else this.set(c,b),this.delete(d),ai(this,a,b,!1)}link(a,b){var c=V+a;const d=Yh(this,W+a);c=Yh(b,c);d.has(b.j)||(d.set(b.j,b),c.set(this.j,this),this.db.D(Kh.Mk,this.j,a,W,b.j),this.db.D(Kh.Mk,b.j,a,V,this.j),this.e&&b.e&&(bi(this,a,W,b,!0),bi(b,a,V,this,!0)))}unlink(a,b){const c=V+a;void 0!==Zh(this,W+a,b.j)&&(Zh(b,c,this.j),this.db.D(Kh.cn,this.j,
|
|
699
699
|
a,W,b.j),this.db.D(Kh.cn,b.j,a,V,this.j),this.e&&b.e&&(bi(this,a,W,b,!1),bi(b,a,V,this,!1)))}persist(){this.N=!0;return this}pe(){this.c++;1===this.c&&this.db.D(Kh.xs,this.j)}detach(){0<this.c?--this.c:this.db.D(Kh.Er,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(Kh.qn,
|
|
700
|
-
this.j)}clear(){this.forEach((a,b)=>{const c=b[0];if(c===V||c===W){const d=b.substring(1),e=c===V?W:V;a.forEach(f=>{const g=f.get(e+d);g.delete(this.j);0===g.size&&f.delete(e+d)})}c===Lh&&a instanceof olympe.dc.wc&&$h(this.db.get(a.W()))});void 0!==this.D&&this.db.get(this.D.tag).delete(Lh+this.D.Da)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={oq:'instance',rw:'rel',
|
|
700
|
+
this.j)}clear(){this.forEach((a,b)=>{const c=b[0];if(c===V||c===W){const d=b.substring(1),e=c===V?W:V;a.forEach(f=>{const g=f.get(e+d);g.delete(this.j);0===g.size&&f.delete(e+d)})}c===Lh&&a instanceof olympe.dc.wc&&$h(this.db.get(a.W()))});void 0!==this.D&&this.db.get(this.D.tag).delete(Lh+this.D.Da)}create(a){const b=new Map;this.set(a,b);return b}};olympe.dc.db.Instance.j={oq:'instance',rw:'rel',Ki:'cb',gj:'ref',TRANSACTION:'tx'};olympe.dc.db.Nh=class a{constructor(b){this.Ic=b;this.R=this.Ha=null;this.Pb=olympe.dc.Lb.NONE;this.state=a.j.al;this.j=this.pb=this.Vb=this.X=this.properties=null}tag(){return this.Ic}Wb(){return this.R}jb(){return this.Ha}getState(){return this.state}wa(b){if(null===this.R)this.R=b;else if(this.R!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.R}`);return this}F(){return this.state===a.j.Ec?this.Pb:olympe.dc.Lb.NONE}create(b){this.state=a.j.Km;
|
|
701
701
|
this.Ha=null!=b?b:null;return this}delete(b=olympe.dc.Lb.NONE){this.state=a.j.Ec;this.Pb=b;this.properties=null;return this}ja(b,c){if(this.state===a.j.Ec)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}yn(b){this.state!==a.j.Ec&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Dd(b,c){if(null!==this.X&&this.X!==b)throw Error('An instance should never be set as complex property of multiple instances');this.X=b;this.Vb=
|
|
702
702
|
c}Z(b){let c;null==(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.fc.ad&&this.wa(c);this.ta(this.pb,b,c,!0);return this}unlink(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.fc.ad&&this.wa(c);this.ta(this.pb,b,c,!1);return this}wb(b,c){null===this.j&&(this.j=new Map);this.ta(this.j,b,c,!0)}Hc(b,c){null===this.j&&(this.j=new Map);this.ta(this.j,b,c,!1)}lb(b,c,d){if(c=c===olympe.dc.va.ORIGIN?this.j:this.pb)return(b=
|
|
703
703
|
c.get(b))&&b.get(d)}H(b,c,d){const e=(c=c===olympe.dc.va.ORIGIN?this.j:this.pb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}D(){return this.state===a.j.Km}Bd(){return this.state===a.j.Ec}jd(){let b=this.properties?this.properties.size:0,c;null==(c=this.pb)||c.forEach(d=>{b+=d.size});return b}N(){return null!==this.properties}xd(){return null!==this.pb||null!==this.j}Ab(){let b;return null!=(b=this.properties)?b:new Map}Pa(b){if(this.properties)return this.properties.get(b)}cb(b,c=(d,e)=>[d,
|
|
@@ -709,11 +709,11 @@ this.transactionId);this.j.zl(this.transactionId,()=>a.rc(this))}close(){if(null
|
|
|
709
709
|
function di(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.wc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.W()+'")';else if(f instanceof olympe.C.Color)d+='Color("'+f.rh()+','+f.oh()+','+f.kh()+','+f.jh()+'")';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+=di(a,f,
|
|
710
710
|
(null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function ei(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function fi(a,b){let c;return b===olympe.dc.fc.ad?'Model':null!=(c=a.db.name(b))?c:b}
|
|
711
711
|
class ci{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}`:''}`}Uc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${di(this,c)})`,ei(this,d))}$c(a,b,c){this.log(`updateInstance(tag: ${a}, ${di(this,b)})`,ei(this,c))}D(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,ei(this,c))}Oa(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,fi(this,a))}hc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
|
|
712
|
-
fi(this,a))}}olympe.dc.db.rn.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Ca:'dc.db.Logger',wm:'dc.db.gc.Logger',Ea:'dc.db.DatabaseManager',dk:'dc.db.Database',im:'dc.db.DBView',ZB:'dc.db.Graph',aB:'dc.db.DatabaseWriter',OC:'dc.db.PermissionProcessor',
|
|
713
|
-
olympe.V.config(function(a){E(a,olympe.dc.db.Config.Qp,olympe.dc.db.Bf.j.so);E(a,olympe.dc.db.Config.Rp,5E3);E(a,olympe.dc.db.Config.am,3E4);E(a,olympe.dc.db.Config.
|
|
714
|
-
new olympe.V.ma(olympe.dc.db.Config.op)],(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.Bf.j.nm: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)});C(a,olympe.dc.db.P.im,olympe.dc.kb,olympe.dc.db.P.Ca,olympe.dc.db.P.dk);D(a,olympe.dc.db.P.
|
|
715
|
-
new olympe.V.ma(olympe.dc.db.Config.
|
|
716
|
-
olympe.dc.query.yf=class{constructor(a,b,c){this.db=olympe.dc.ga();this.j=a;this.Da=b;this.
|
|
712
|
+
fi(this,a))}}olympe.dc.db.rn.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.P={Ca:'dc.db.Logger',wm:'dc.db.gc.Logger',Ea:'dc.db.DatabaseManager',dk:'dc.db.Database',im:'dc.db.DBView',ZB:'dc.db.Graph',aB:'dc.db.DatabaseWriter',OC:'dc.db.PermissionProcessor',Zi:'dc.db.GraphMonitor'};olympe.dc.db.Config={Qp:'db.garbageCollector',Rp:'db.garbageCollectorDelay',am:'db.commitBufferTimeout',Zi:'db.monitor',Qv:'db.monitorCounters',Pv:'db.monitorCallbacks',op:'db.debug'};
|
|
713
|
+
olympe.V.config(function(a){E(a,olympe.dc.db.Config.Qp,olympe.dc.db.Bf.j.so);E(a,olympe.dc.db.Config.Rp,5E3);E(a,olympe.dc.db.Config.am,3E4);E(a,olympe.dc.db.Config.Zi,!1);E(a,olympe.dc.db.Config.op,!1);D(a,olympe.dc.db.P.Ca,[olympe.ha.P.Ea],b=>b.dd('db'));D(a,olympe.dc.db.P.wm,[olympe.ha.P.Ea],b=>b.dd('gc'));D(a,olympe.dc.db.P.dk,[olympe.dc.db.P.Ca,olympe.dc.db.P.wm,new olympe.V.ma(olympe.dc.Config.Zg),new olympe.V.ma(olympe.dc.db.Config.Qp),new olympe.V.ma(olympe.dc.db.Config.Rp),new olympe.V.ma(olympe.dc.Config.bi),
|
|
714
|
+
new olympe.V.ma(olympe.dc.db.Config.op)],(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.Bf.j.nm: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)});C(a,olympe.dc.db.P.im,olympe.dc.kb,olympe.dc.db.P.Ca,olympe.dc.db.P.dk);D(a,olympe.dc.db.P.Zi,[olympe.dc.db.P.Ea],b=>b.Iz);D(a,olympe.dc.db.P.Ea,[olympe.dc.db.P.Ca,olympe.dc.db.P.dk,olympe.dc.db.P.im,new olympe.V.ma(olympe.dc.Config.dg),new olympe.V.ma(olympe.dc.db.Config.am),
|
|
715
|
+
new olympe.V.ma(olympe.dc.db.Config.Zi),new olympe.V.ma(olympe.dc.db.Config.Qv),new olympe.V.ma(olympe.dc.db.Config.Pv)],(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.uu(b,c,d,e,g)})},'olympe.dc.db');olympe.V.run([olympe.dc.db.P.dk,olympe.dc.db.P.Zi],(a,b)=>{olympe.ee().db=a;olympe.ee().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function gi(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
|
|
716
|
+
olympe.dc.query.yf=class{constructor(a,b,c){this.db=olympe.dc.ga();this.j=a;this.Da=b;this.Xi=c}fa(){return{p:this.Da.W(),o:this.Xi}}toString(){return'sortByQueryPart-'+this.Xi+this.Da.W()}mh(){const a=this.db.Ib(this.Da,olympe.dm.Property.typeRel),b=olympe.dc.ea;if(this.db.Xf(a,olympe.dm.String))return gi((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return gi((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return gi((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return gi((c,
|
|
717
717
|
d)=>c.compare(d));olympe.ha.Wa('dc.query').warn(`No comparator found for type with tag ${a}`);return gi(()=>-1)}Pa(){return this.Da}};olympe.dc.Ze=class{W(){}};olympe.dc.Ze.prototype.getTag=olympe.dc.Ze.prototype.W;olympe.dc.bC=olympe.dc.Ze;function hi(a){let b;if(null==(b=a.j)?0:b.pf())if(a=a.N,!a.N){let c;null==(c=a.R)||c.call(a)}}function ii(a,b,c,d,e){hi(a);let f,g;b?null==(f=a.j)||f.Oa(c,d,e):null==(g=a.j)||g.hc(c,d,e)}function ji(a){let b;const c=!(null==(b=a.j)?0:b.pf());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}`))}
|
|
718
718
|
olympe.dc.query.Xv=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.ga();this.H=[]}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;Qf(this.db,a,(d,e)=>{if(d){hi(this);let f;null==(f=this.j)||f.Z(e)}else if(b&&lh(this.db,e,c),!this.db.Ja(e)){hi(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Lb.NONE)}},c);b&&kh(this.db,a,(d,e,f)=>{hi(this);let g;f||null!=(g=this.j)&&g.$c(a,new Map([[d,e]]))},c)}}stop(a){this.H.push(()=>
|
|
719
719
|
Of(this.db,a,`${this.D}:${a}:notif`))}};olympe.dc.query.Fk={ASC:'ASC',DESC:'DESC'};function ki(a){const b=li(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.Xc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,v]=c.get(f);c.delete(f);q+=v;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,Z)=>K.add(Z),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${v}`:v;for(const z of k.j(x)){let A;n.set(z,
|
|
@@ -724,10 +724,10 @@ function ti(a){a.G.j()&&a.G.debug(`Start sending notifications for query ${a.que
|
|
|
724
724
|
olympe.dc.query.vr=class{constructor(a,b){this.G=a;this.query=b;this.F=olympe.U.sb(b.D);this.na=new Map;this.j=(new Map).set(this.F,new olympe.dc.query.na.jn);this.H=new Set(b.F);this.Od=-1;this.N=!1;this.R=null;this.X=olympe.dc.Ka.empty();this.Te=this.D=null;a=li(b);a.forEach(c=>{const d=c.T();this.na.set(d,c.N());this.j.set(d,c.ia())});b=b.mh();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.Od=c;break}}}remove(a,b=this.F,c='root'){b=
|
|
725
725
|
this.j.get(b);if(null==b?0:b.remove(a,c))if(oi(this),!b.has(a)){let d;null==(d=this.Te)||d.stop(a);return!0}return!1}Jc(a){const b=a.D,c=olympe.U.sb(b);a=li(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.Z(k,this.na.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.na.get(k))?void 0:l.Jc(f))?n:!1});e.set(f.T(),h);return 0<h.length})}};function wi(a){if(!olympe.dc.ga().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Hd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
|
|
726
726
|
function xi(a){var b=olympe.dc.query.za.j.ps;const c=olympe.dc.query.za.j.yp,d=olympe.dc.query.za.j.$j,e=olympe.dc.query.za.j.nq,f=olympe.dc.query.za.j.Qq,g=olympe.dc.query.za.j.Fr,h=olympe.dc.query.za.j.qo,k=olympe.dc.query.za.j.hr,l=olympe.dc.query.za.j.mq;switch(a.pr){case b:return new olympe.dc.query.Y.nn(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.Y.De(a.p,b,olympe.dc.ga());
|
|
727
|
-
case d:return new olympe.dc.query.Y.zf(a.p,a.s,olympe.dc.ga(),a.c);case e:return new olympe.dc.query.Y.
|
|
727
|
+
case d:return new olympe.dc.query.Y.zf(a.p,a.s,olympe.dc.ga(),a.c);case e:return new olympe.dc.query.Y.Vi(olympe.dc.ga(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.Y.ke(xi(a.v));case g:return new olympe.dc.query.Y.If(a.p,new RegExp(a.r),olympe.dc.ga(),a.c);case k:return new olympe.dc.query.Y.He(...a.p.map(n=>xi(n)));case h:return new olympe.dc.query.Y.Pd(...a.p.map(n=>xi(n)));case l:return b=4===a.t?a.v.map(n=>olympe.C.Color.create(n.r,n.g,n.b,n.a)):3===a.t?a.v.map(n=>olympe.dc.CloudObject.get(n)):
|
|
728
728
|
2===a.t?a.v.map(n=>new Date(n)):a.v,new olympe.dc.query.Y.wq(a.p,b);default:return null}}
|
|
729
729
|
olympe.dc.query.za=class{observe(){}mb(){}compile(){return[[this]]}Cd(){return new olympe.dc.query.Y.ke(this)}Ab(){}Jc(){}clear(){}fa(){}Pc(){}toString(){}Fa(a){return this===a}static ot(...a){return new olympe.dc.query.Y.nn(a)}static fA(a,b){wi(a);return new olympe.dc.query.Y.wq(a,b)}static Fa(a,b){wi(a);return new olympe.dc.query.Y.De(a,b,olympe.dc.ga())}static contains(a,b,c=!0){wi(a);return new olympe.dc.query.Y.zf(a,b,olympe.dc.ga(),c)}static jA(a,b,c=!0){wi(a);return new olympe.dc.query.Y.If(a,
|
|
730
|
-
b,olympe.dc.ga(),c)}static tl(a,b,c=!0){wi(a);return new olympe.dc.query.Y.
|
|
730
|
+
b,olympe.dc.ga(),c)}static tl(a,b,c=!0){wi(a);return new olympe.dc.query.Y.Vi(olympe.dc.ga(),a,b,!1,c)}static Qj(a,b,c=!0){wi(a);return new olympe.dc.query.Y.Vi(olympe.dc.ga(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.za))throw new olympe.dc.query.Hd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.Y.Pd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.za))throw new olympe.dc.query.Hd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
|
|
731
731
|
return new olympe.dc.query.Y.He(...a)}static Cd(a){if(!(a instanceof olympe.dc.query.za))throw new olympe.dc.query.Hd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.Y.ke(a)}};olympe.dc.query.za.not=olympe.dc.query.za.Cd;olympe.dc.query.za.or=olympe.dc.query.za.or;olympe.dc.query.za.and=olympe.dc.query.za.and;olympe.dc.query.za.smallerThan=olympe.dc.query.za.Qj;olympe.dc.query.za.greaterThan=olympe.dc.query.za.tl;
|
|
732
732
|
olympe.dc.query.za.regex=olympe.dc.query.za.jA;olympe.dc.query.za.contains=olympe.dc.query.za.contains;olympe.dc.query.za.equals=olympe.dc.query.za.Fa;olympe.dc.query.za.propertyIn=olympe.dc.query.za.fA;olympe.dc.query.za['in']=olympe.dc.query.za.ot;olympe.dc.query.za.j={ps:0,yp:1,$j:2,nq:3,Qq:4,Fr:5,hr:6,qo:7,mq:8};function li(a){return Array.from(a.na)}
|
|
733
733
|
function yi(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Ib(c,c.La()===olympe.dc.va.ORIGIN?e:d);if(0>a.cursor)e=a.j.Ue;else if(e=a.na[a.cursor],null!==e.wa)e=e.wa;else{var f=olympe.dc.va.ORIGIN;e=olympe.dc.ga().Ib(e.relation,e.relation.La()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(a.db.Ja(olympe.dc.CloudObject)&&(null===d||!a.db.Xf(d,e)&&!a.db.Xf(e,d)))throw new olympe.dc.query.Hd(`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=
|
|
@@ -735,33 +735,33 @@ b.T();for(c=a.cursor+1;c<a.na.length&&a.na[c].T()!==d;)c++;b=c<a.na.length?a.na:
|
|
|
735
735
|
function Ai(a,b,c,d={}){var e=olympe.dc.Lb.mg;const f=(null==d?0:d.nd)?d.nd:olympe.dc.la.oc.xf,g=(null==d?0:d.lo)?'__code-as-data__':void 0;b=olympe.dc.ea(b);const h=olympe.dc.fe().re(b);b=(new olympe.dc.la(b,h)).oe();b.na=[f===olympe.dc.la.oc.Sg?new olympe.dc.query.na.vm(zi(b),e,c):new olympe.dc.query.na.Qd(zi(b),e,c)];let k;b.H=null!=(k=null==d?void 0:d.qt)?k:!1;return b.observe(a,{nd:f,hl:g})}
|
|
736
736
|
function Bi(a){const b=0===a.F.size?a.oe():a;if(null!==b.j.Od&&!b.F.has(zi(a,b.j.Od)))throw new olympe.dc.query.Hd('AndReturn was not called for the current level before sortBy operator');return b}function Ci(a,b){let c,d;return b.H||(null!=(d=null==(c=a.N)?void 0:c.has(b.T()))?d:!1)}
|
|
737
737
|
olympe.dc.la=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Od:null,Ue:null}){this.db=olympe.dc.ga();if('string'!==typeof a||''===a)throw new olympe.dc.query.Hd('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.ea(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Hd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);
|
|
738
|
-
b=null!=b?b:olympe.dc.fe().re(a);b=new olympe.dc.la(a,b);b.j.Ue=olympe.dc.ga().model(a);return b}static re(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.Hd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ea(a);c=null!=c?c:olympe.dc.fe().fromModel(b);c=new olympe.dc.la(a,c);c.j.Ue=olympe.dc.ea(b);return c}static xl(a,b=!0,c){const d=olympe.dc.ea(a);var e=olympe.dc.ga();if(!e.
|
|
738
|
+
b=null!=b?b:olympe.dc.fe().re(a);b=new olympe.dc.la(a,b);b.j.Ue=olympe.dc.ga().model(a);return b}static re(a,b,c){if(!olympe.dc.CloudObject.exists(b)&&!c)throw new olympe.dc.query.Hd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ea(a);c=null!=c?c:olympe.dc.fe().fromModel(b);c=new olympe.dc.la(a,c);c.j.Ue=olympe.dc.ea(b);return c}static xl(a,b=!0,c){const d=olympe.dc.ea(a);var e=olympe.dc.ga();if(!e.yi(d))throw new olympe.dc.query.Hd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);
|
|
739
739
|
a=null!=c?c:olympe.dc.fe().fromModel(d);a=new olympe.dc.la(d,a);a.j.Ue=e.model(d);b&&(a=yi(a,new olympe.dc.query.na.Ee(zi(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.na.Lh(zi(a),olympe.dc.CloudObject.instancesRel,!1);e.wa=d;return yi(b,e)}static Pb(a,b,c,d,e){var f;const g=null!=(f=null==e?void 0:e.nd)?f:olympe.dc.la.oc.xf;f=(null==e?0:e.lo)?'__code-as-data__':void 0;b=olympe.dc.ea(b);d=null!=d?d:olympe.dc.fe().re(b);d=(new olympe.dc.la(b,d)).oe();b=g===olympe.dc.la.oc.Sg;
|
|
740
740
|
d.na=[b?new olympe.dc.query.na.vm(zi(d),c):new olympe.dc.query.na.Qd(zi(d),c)];let h;d.H=null!=(h=null==e?void 0:e.qt)?h:!1;let k;return d.observe(a,{nd:g,hl:f,sj:null!=(k=null==e?void 0:e.sj)?k:b})}bb(a,b=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Hd(`The relation given to follow() is invalid: ${a}`);return yi(this,new olympe.dc.query.na.Lh(zi(this),a,b))}vg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ra.Relation))throw new olympe.dc.query.Hd(`The relation given to followRecursively() is invalid: ${a}`);
|
|
741
741
|
return yi(this,new olympe.dc.query.na.Ee(zi(this),a,b,c))}oe(){const a=(new Set(this.F)).add(zi(this));return new olympe.dc.la(this.D,this.source,this.na,this.cursor,a,this.j)}filter(a){if(!(a instanceof olympe.dc.query.za))throw new olympe.dc.query.Hd(`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.la(this.D,this.source,b,this.cursor,this.F,this.j)}tj(){return this}Ij(a,b=0){return new olympe.dc.la(this.D,
|
|
742
742
|
this.source,this.na,this.cursor,this.F,{Od:this.j.Od,max:a,offset:b,Ue:this.j.Ue})}Il(a,b=olympe.dc.query.Fk.ASC){if(0>this.cursor)throw new olympe.dc.query.Hd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');if(!olympe.dc.ga().Nb(a,olympe.dm.Property))throw new olympe.dc.query.Hd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.na[this.cursor],d={Od:this.cursor,max:this.j.max,offset:this.j.offset,Ue:this.j.Ue},
|
|
743
743
|
e=Array.from(this.na);e[this.cursor]=c.sort(a,b);return new olympe.dc.la(this.D,this.source,e,this.cursor,this.F,d)}mh(){const a=this.j.Od;let b;return null!==a?null==(b=this.na[a])?void 0:b.mh():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&&zi(this,b)!==d;)b--}return new olympe.dc.la(this.D,this.source,Array.from(this.na),b,this.F,this.j)}parse(){const a=new Map,b=zi(this,-1),c={limit:this.j.max,offset:this.j.offset,returned:this.F.has(b),
|
|
744
|
-
filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.
|
|
745
|
-
g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}mb(a){const b=(null==a?0:a.nd)?a.nd:olympe.dc.la.oc.Gk;let c;return olympe.dc.query.sl().executeQuery(Bi(this),b,{
|
|
746
|
-
a;let d;return Ei(olympe.dc.query.sl(),Bi(this),a,olympe.dc.Ia.SELF,c,{
|
|
744
|
+
filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.yi(this.D)?c.dataType=olympe.dc.ea(this.D):(c.root=olympe.dc.ea(this.D),c.dataType=this.j.Ue);this.na.forEach((d,e)=>{const f=d.T(),g=d.Pc();Object.assign(g,{returned:this.F.has(f),next:[]});a.set(f,g);g.sort&&this.j.Od!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.na.Lh&&d.relation.Fa(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.na.Ee&&d.relation.Fa(olympe.dc.CloudObject.extendedByRel))Object.assign(c,
|
|
745
|
+
g),c.inheritance=!0;else{let h;null==(h=a.get(d.j))||h.next.push(g)}});return c}mb(a){const b=(null==a?0:a.nd)?a.nd:olympe.dc.la.oc.Gk;let c;return olympe.dc.query.sl().executeQuery(Bi(this),b,{mi:null!=(c=null==a?void 0:a.hl)?c:null==a?void 0:a.cacheId,Cc:null==a?void 0:a.Cc}).then(d=>{let e;return null!=(e=null==d?void 0:mi(d))?e:olympe.dc.Ka.empty()})}Dc(){return mi(Di(olympe.dc.query.sl(),Bi(this)))}observe(a,b){const c=(null==b?0:b.nd)?b.nd:olympe.dc.la.oc.xf;a='function'===typeof a.Db?a.Db():
|
|
746
|
+
a;let d;return Ei(olympe.dc.query.sl(),Bi(this),a,olympe.dc.Ia.SELF,c,{mi:null!=(d=null==b?void 0:b.hl)?d:null==b?void 0:b.cacheId,Cc:null==b?void 0:b.Cc,sj:null==b?void 0:b.sj}).pipe(rxjs.operators.map(e=>mi(e)),rxjs.operators.distinctUntilChanged())}T(){null===this.id&&(this.id=olympe.U.sb(this.D+li(this).map(a=>a.H()).join()+Array.from(new Set(this.F)).sort().toString()+this.j.Od+this.j.max+this.j.offset));return this.id}jb(){return this.source}fa(){let a;return{b:this.D,p:this.na.map(b=>b.fa()),
|
|
747
747
|
r:Array.from(this.F),s:this.source,e:{m:this.j.max,o:this.j.offset,s:this.j.Od,rm:null!=(a=this.j.Ue)?a:this.db.model(this.D)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ja(this.D)?olympe.dc.CloudObject.get(this.D):this.D,relations:this.na.map(a=>a.toJSON())}}};olympe.dc.la.prototype.observe=olympe.dc.la.prototype.observe;olympe.dc.la.prototype.executeFromCache=olympe.dc.la.prototype.Dc;olympe.dc.la.prototype.execute=olympe.dc.la.prototype.mb;
|
|
748
748
|
olympe.dc.la.prototype.parse=olympe.dc.la.prototype.parse;olympe.dc.la.prototype.back=olympe.dc.la.prototype.back;olympe.dc.la.prototype.sortBy=olympe.dc.la.prototype.Il;olympe.dc.la.prototype.limit=olympe.dc.la.prototype.Ij;olympe.dc.la.prototype.cast=olympe.dc.la.prototype.tj;olympe.dc.la.prototype.filter=olympe.dc.la.prototype.filter;olympe.dc.la.prototype.andReturn=olympe.dc.la.prototype.oe;olympe.dc.la.prototype.followRecursively=olympe.dc.la.prototype.vg;olympe.dc.la.prototype.follow=olympe.dc.la.prototype.bb;
|
|
749
749
|
olympe.dc.la.followRule=olympe.dc.la.Pb;olympe.dc.la.instancesOf=olympe.dc.la.xl;olympe.dc.la.fromTag=olympe.dc.la.re;olympe.dc.la.from=olympe.dc.la.from;olympe.dc.la.oc={xf:1,Gk:2,Sg:3};olympe.dc.la.j={Yl:'cacheBucketName',uq:'isCacheable'};function Fi(a){null===a.Ga&&null===a.j&&(a.Ga=Zf(a.F))}
|
|
750
750
|
olympe.dc.query.Id=class extends olympe.dc.Ig{constructor(a){super(a,null);this.F=new olympe.dc.transaction.Je}static yj(a){const b=new olympe.dc.query.Id(`DataResult_${a.T()}`);b.D=a.jb();return b}static j(a){const b=new olympe.dc.query.Id(a.i);let c;b.D=null!=(c=a.s)?c:null;let d;b.il=null!=(d=a.t)?d:null;let e;b.Ga=null!=(e=a.p)?e:[];return b}rc(a){Fi(this);return super.rc(a)}Yb(){Fi(this);return super.Yb()}pl(){Fi(this);return super.pl()}create(a,b,c){this.F.Uc(a,this.D,c,b);return this}Oa(a,
|
|
751
751
|
b,c){this.F.Oa(a,b,c,null,null);return this}fa(){return super.fa()}};olympe.dc.query.Id.prototype.createRelation=olympe.dc.query.Id.prototype.Oa;olympe.dc.query.Id.prototype.create=olympe.dc.query.Id.prototype.create;olympe.dc.query.Id.fromQuery=olympe.dc.query.Id.yj;function Di(a,b){const c=new olympe.dc.query.vr(a.G,b);if(a.D.view.Ja(b.D)){ri(c,b.D);for(const d of li(b))d.mb(c)}return c}
|
|
752
|
-
function Ei(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.jb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Cc||a.H&&k===olympe.dc.Ia.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.Dr(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);Gi(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.
|
|
752
|
+
function Ei(a,b,c,d,e,f){const g=b.T();let h=a.j.get(g);if(!h){var k=b.jb();a.G.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.Cc||a.H&&k===olympe.dc.Ia.SERVER?[]:Array.from(a.j.values());h=new olympe.dc.query.Dr(a.G,a.D,b,e,a.R.bind(a,e,f));a.j.set(g,h);Gi(h,l=>a.F.add(l));h.start(k)&&(null==f?0:f.mi)&&Hi(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=>
|
|
753
753
|
{const n=()=>{p&&c.wt(p);l.complete();if(q){var r=q;const v=a.j.get(g);a.G.debug(`${d} unsubscribed from ${g}`);if(null==v)r=0;else{var t=v;t.H.delete(r)&&t.G.debug(`Remove subscriber ${d} for query ${t.query.T()}, now have ${t.H.size} subscribers`);d!==olympe.dc.Ia.SELF&&(t.Z--,0===t.Z&&ui(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),v.destroy())}},p=c.Yd(n),q=Ii(h,d,l);return n})}
|
|
754
754
|
function Ji(a){a.F.forEach(b=>{let c;null==(c=a.j.get(b))||Ki(c)});a.F.clear()}function Li(a,b,c,d){return u(function*(){const e=null!=d?d:c===olympe.dc.la.oc.Sg;if(b instanceof ReadableStream)yield Tg(a.D,b,{An:e});else{var f;if(f=b instanceof olympe.dc.Ig)f=b.T(),f=!a.N.H.has(f);f&&a.D.od(b,{An:e})}})}function Mi(a){a.G.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.j.Kg,olympe.dc.Ia.SERVER);return a.Jb.request(b).then(c=>{a.D.od(c)})}
|
|
755
|
-
function Ni(a,b){const c=b.jb();if(c===olympe.dc.Ia.SELF||a.H&&c===olympe.dc.Ia.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Jc(b)).map(d=>new Promise(e=>d.ld(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Hi(a,b,c,d){return u(function*(){var e=b.jb();e=Uf(Uf(new olympe.dc.Request(olympe.dc.Request.j.Ug,e,b),olympe.dc.la.j.uq,c===olympe.dc.la.oc.Sg),olympe.dc.la.j.Yl,null==d?void 0:d.
|
|
755
|
+
function Ni(a,b){const c=b.jb();if(c===olympe.dc.Ia.SELF||a.H&&c===olympe.dc.Ia.SERVER)return Promise.resolve(!0);a=Array.from(a.j.values()).filter(d=>d.Jc(b)).map(d=>new Promise(e=>d.ld(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Hi(a,b,c,d){return u(function*(){var e=b.jb();e=Uf(Uf(new olympe.dc.Request(olympe.dc.Request.j.Ug,e,b),olympe.dc.la.j.uq,c===olympe.dc.la.oc.Sg),olympe.dc.la.j.Yl,null==d?void 0:d.mi);return a.Jb.request(e)})}
|
|
756
756
|
function Oi(a,b,c){const d=[];for(const e of a.j.values())Pi(e,b,c)&&d.push(Hi(a,e.query,olympe.dc.la.oc.Gk,{}).then(f=>Li(a,f,olympe.dc.la.oc.Gk)));return Promise.all(d).then(()=>{})}
|
|
757
|
-
olympe.dc.query.nw=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Jb=d;this.H=e;this.j=new Map;this.F=new Set;Ug(b,()=>Ji(this));Xf(d,olympe.dc.Request.j.ek,f=>{Li(this,f.content,olympe.dc.la.oc.xf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return u(function*(){const e='boolean'===typeof c.Cc?c.Cc:yield Ni(d,a);if(!e||(null==c?0:c.
|
|
757
|
+
olympe.dc.query.nw=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Jb=d;this.H=e;this.j=new Map;this.F=new Set;Ug(b,()=>Ji(this));Xf(d,olympe.dc.Request.j.ek,f=>{Li(this,f.content,olympe.dc.la.oc.xf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return u(function*(){const e='boolean'===typeof c.Cc?c.Cc:yield Ni(d,a);if(!e||(null==c?0:c.mi))try{const f=yield Hi(d,a,b,c);e||(yield Li(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.jb()}: ${f}`),
|
|
758
758
|
null}return Di(d,a)})}R(a,b,c,d,e,f){const g=c.jb();if(g===olympe.dc.Ia.SELF||b.Cc||this.H&&g===olympe.dc.Ia.SERVER)return e(),null;if(a!==olympe.dc.la.oc.xf)return Hi(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return Li(this,t,a,b.sj)}).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`);Hi(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.`),
|
|
759
|
-
Promise.resolve();var v=t;t instanceof ReadableStream&&(v=(v=d())?t.pipeThrough(v):t);return Li(this,v,a,b.sj).then(()=>{h.forEach(x=>Li(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=Uf(new olympe.dc.Request(olympe.dc.Request.j.Kk,g,c),olympe.dc.la.j.Yl,null==b?void 0:b.
|
|
759
|
+
Promise.resolve();var v=t;t instanceof ReadableStream&&(v=(v=d())?t.pipeThrough(v):t);return Li(this,v,a,b.sj).then(()=>{h.forEach(x=>Li(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=Uf(new olympe.dc.Request(olympe.dc.Request.j.Kk,g,c),olympe.dc.la.j.Yl,null==b?void 0:b.mi),q=this.Jb.subscribe(p,l.bind(this,!0)).pipe(sb(olympe.error.aq,()=>{},0)).pipe(sb(olympe.error.Qo,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
|
|
760
760
|
l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):Li(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 Qi(a){const b=olympe.dc.ga();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ja(g)?olympe.dc.CloudObject.get(g):(olympe.ha.Wa('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.Ka.create(d,a.a,a.r)}
|
|
761
761
|
olympe.dc.Ka=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.H=[];this.hash=''}static empty(){return new olympe.dc.Ka}[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()}Ve(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Ve().includes(a)}indexOf(a){return null===
|
|
762
762
|
a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Ve().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Kc(){return this.se(0)}se(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Ve();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Ve();a.pop();return a}shift(){if(0<this.j.length){const a=this.Ve();a.shift();return a}return[]}filter(a){return this.Ve().filter(a)}find(a){return(a=this.Ve().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
|
|
763
763
|
a(this.D.get(b),c))}map(a){return this.Ve().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ka.create(b,Array.from(this.F),Array.from(this.H))}reduce(a,b){return this.Ve().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.Ka.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ve()}zj(){return this.F.map(a=>
|
|
764
|
-
this.D.get(this.j[a]))}Fj(){return this.H.map(a=>{a=a.split('.');return 1===a.length?a[0]:a})}static from(a,b,{Hb:c,Od:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ga(),q=c.
|
|
764
|
+
this.D.get(this.j[a]))}Fj(){return this.H.map(a=>{a=a.split('.');return 1===a.length?a[0]:a})}static from(a,b,{Hb:c,Od:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ga(),q=c.Xi===olympe.dc.query.Fk.ASC?1:-1,r=c.mh(),t=c.Pa();b.sort((v,x)=>{x=x[d];v=p.Pa(v[d],t);x=p.Pa(x,t);return null===v?-q:null===x?q:q*r(olympe.dc.ib.uc(v),olympe.dc.ib.uc(x))})}else b.sort((p,q)=>p.reduce((r,t,v)=>r||t.localeCompare(q[v]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.U.sb(b.flat().join(''));
|
|
765
765
|
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.Ka.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ka;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.U.sb(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.H=c||[];return e}fa(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
|
|
766
766
|
return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ka.prototype.getRemoved=olympe.dc.Ka.prototype.Fj;olympe.dc.Ka.prototype.getAdded=olympe.dc.Ka.prototype.zj;olympe.dc.Ka.prototype.concat=olympe.dc.Ka.prototype.concat;olympe.dc.Ka.prototype.reduce=olympe.dc.Ka.prototype.reduce;olympe.dc.Ka.prototype.sort=olympe.dc.Ka.prototype.sort;olympe.dc.Ka.prototype.map=olympe.dc.Ka.prototype.map;olympe.dc.Ka.prototype.forEach=olympe.dc.Ka.prototype.forEach;olympe.dc.Ka.prototype.find=olympe.dc.Ka.prototype.find;
|
|
767
767
|
olympe.dc.Ka.prototype.filter=olympe.dc.Ka.prototype.filter;olympe.dc.Ka.prototype.shift=olympe.dc.Ka.prototype.shift;olympe.dc.Ka.prototype.pop=olympe.dc.Ka.prototype.pop;olympe.dc.Ka.prototype.push=olympe.dc.Ka.prototype.push;olympe.dc.Ka.prototype.getAt=olympe.dc.Ka.prototype.se;olympe.dc.Ka.prototype.getFirst=olympe.dc.Ka.prototype.Kc;olympe.dc.Ka.prototype.get=olympe.dc.Ka.prototype.get;olympe.dc.Ka.prototype.indexOf=olympe.dc.Ka.prototype.indexOf;olympe.dc.Ka.prototype.has=olympe.dc.Ka.prototype.has;
|
|
@@ -775,11 +775,11 @@ olympe.dc.query.Dr=class{constructor(a,b,c,d,e){this.G=a;this.wa=b;this.db=b.vie
|
|
|
775
775
|
(null===this.D||this.query.D===a.D)&&this.j.Jc(a))}ld(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.X;this.X=null;this.H.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Yi(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())}fb(){return null===this.X}Ua(){const a=
|
|
776
776
|
olympe.dc.la.oc.Sg;if(this.nd===a)return olympe.U.stream.tap(c=>{c=c.pl().filter(e=>e.o===olympe.dc.Sc.j).map(e=>e.t);this.wa.pe(c,'Batch mode');const d=li(this.query)[0];d instanceof olympe.dc.query.na.vm&&c.forEach(e=>ri(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.nd===a).map(e=>new Promise(f=>e.ld(f))),d=this.R.filter(e=>e.nd!==a).map(e=>new Promise(f=>e.ld(f)));this.R=void 0;return new TransformStream({start:()=>Promise.all(c),flush:()=>Promise.all(d)})}return null}};
|
|
777
777
|
function $i(a,b){return a.F.has(Ti+b)||a.F.has(Si+b)}
|
|
778
|
-
class Zi{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 li(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.na
|
|
778
|
+
class Zi{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 li(c)){a=f.T();this.R.push(a);if(f instanceof olympe.dc.query.na.$h){a=f.relation;a=`${a.La()}${a.W()}`;let g;b=null!=(g=this.F.get(a))?g:[];b.push(f);this.F.set(a,b)}aj(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}Uc(){}$c(a,b){if(!(this.j||
|
|
779
779
|
!this.N&&this.db.Ja(a))){var c;this.j||(this.j=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&qi(this.H,a,e)))}}D(a){this.j||this.db.Ja(a)&&!this.N||this.j||(this.j=this.R.some(b=>qi(this.H,a,b)))}Oa(a,b,c){if(!this.j&&$i(this,a)){var d=this.db.Ja(b),e=this.db.Ja(c);if(d&&!e||!d&&e){const f=this.F.get(Ti+a);a=this.F.get(Si+a);this.j||(this.j=d&&(null==f?void 0:f.some(g=>qi(this.H,b,g.j)))||e&&(null==a?void 0:a.some(g=>qi(this.H,c,g.j))))}}}hc(a,b,c){if(!this.j&&this.N&&$i(this,a)&&this.db.rt(b,
|
|
780
780
|
new olympe.dc.Ra.Relation(a),c)){const d=this.F.get(Ti+a);a=this.F.get(Si+a);const e=this.H;this.j||(this.j=(null==d?void 0:d.some(f=>qi(e,b,f.j)&&qi(e,c,f.T())))||(null==a?void 0:a.some(f=>qi(e,c,f.j)&&qi(e,b,f.T()))))}}}olympe.dc.query.Dr.ya=[olympe.dc.Writable];function bj(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
|
|
781
781
|
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.W())+', ';a+='"direction": '+JSON.stringify(this.La())+', ';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.W(),a.La(),null!=b?b:a instanceof olympe.dc.aa.Me)}ac(){const a=
|
|
782
|
-
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',Jk:'dc.query.QueryProcessor'};olympe.V.config(function(a){D(a,olympe.dc.query.P.Ca,[olympe.ha.P.Ea],b=>b.dd('query'));C(a,olympe.dc.query.P.Jk,olympe.dc.query.nw,olympe.dc.query.P.Ca,olympe.dc.db.P.Ea,olympe.dc.transaction.P.Ea,olympe.dc.P.Wg,new olympe.V.ma(olympe.dc.Config.
|
|
782
|
+
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',Jk:'dc.query.QueryProcessor'};olympe.V.config(function(a){D(a,olympe.dc.query.P.Ca,[olympe.ha.P.Ea],b=>b.dd('query'));C(a,olympe.dc.query.P.Jk,olympe.dc.query.nw,olympe.dc.query.P.Ca,olympe.dc.db.P.Ea,olympe.dc.transaction.P.Ea,olympe.dc.P.Wg,new olympe.V.ma(olympe.dc.Config.bi))});olympe.V.run([olympe.dc.query.P.Jk],a=>{olympe.dc.query.sl=()=>a});olympe.dc.query.Hd=class extends Error{};olympe.dc.query.Y={};olympe.dc.query.Y.Pd=class extends olympe.dc.query.za{constructor(...a){super();this.Y=a}compile(){return this.Y.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}Cd(){return new olympe.dc.query.Y.He(...this.Y.map(a=>a.Cd()))}Ab(){return this.Y.flatMap(a=>a.Ab())}Jc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}mb(a){return this.Y.reduce((b,c)=>b&&c.mb(a),!0)}observe(a,b,c){const d=
|
|
783
783
|
Array(this.Y.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.Y.forEach((g,h)=>{g.observe(a,olympe.U.sb('AND-'+b+a+h),f.bind(null,h))})}fa(){return{pr:olympe.dc.query.za.j.qo,p:this.Y.map(a=>a.fa())}}Pc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.Y.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.Y.forEach((c,d)=>{c.clear(a,olympe.U.sb('AND-'+b+a+d))})}};olympe.dc.query.Y.zf=class extends olympe.dc.query.za{constructor(a,b,c,d=!1){super();this.Da=olympe.dc.ea(a);this.substring=b;this.db=c;this.j=d}Ab(){return[this.Da]}Jc(a,b){return a instanceof olympe.dc.query.Y.zf&&a.Da===this.Da?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}Pa(){return this.Da}mb(a){return this.apply(this.db.Pa(a,
|
|
784
784
|
this.Da))}observe(a,b,c){ih(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.sb(b+a+this.toString()))}apply(a){a=olympe.dc.ib.uc(a);return'string'===typeof a?this.j?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Da+'-'+this.substring+'-'+this.j}clear(a,b){jh(this.db,a,this.Da,olympe.U.sb(b+a+this.toString()))}Pc(){return{name:'CONTAINS',property:this.Pa(),value:this.substring,caseSensitive:this.j}}fa(){return{pr:olympe.dc.query.za.j.$j,
|
|
785
785
|
p:this.Da,s:this.substring,c:this.j}}};olympe.dc.query.Y.De=class extends olympe.dc.query.za{constructor(a,b,c){super();this.Da=olympe.dc.ea(a);this.j=olympe.dc.ib.uc(null!=b?b:null);this.db=c}Ab(){return[this.Da]}Jc(a){if(a instanceof olympe.dc.query.Y.De&&this.Da===a.Da)if('object'===typeof this.j&&null!==this.j){if(this.j instanceof olympe.dc.CloudObject)return this.j.Fa(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.Fa(a.j)}else return this.j===
|
|
@@ -787,7 +787,7 @@ a.j;return!1}mb(a){return this.apply(this.db.Pa(a,this.Da))}observe(a,b,c){ih(th
|
|
|
787
787
|
this.j}toString(){let a,b;const c=null!=(b=null==(a=this.j)?void 0:a.toString())?b:'null';return'Equals-'+this.Da+'-'+c}Pc(){return{name:'EQUALS',property:this.Da,value:this.j}}fa(){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.W();break;case this.j instanceof olympe.C.Color:a=4,b=this.j.toJSON()}return{pr:olympe.dc.query.za.j.yp,p:this.Da,t:a,v:b}}};olympe.dc.query.Y.wq=class extends olympe.dc.query.za{constructor(a,b){var c=olympe.dc.ga();super();this.Da=olympe.dc.ea(a);this.values=b.map(d=>olympe.dc.ib.uc(null!=d?d:null));this.db=c}Ab(){return[this.Da]}Jc(){return!1}mb(a){return this.apply(this.db.Pa(a,this.Da))}observe(a,b,c){ih(this.db,a,this.Da,d=>{c(this.apply(d))},olympe.U.sb(b+a+this.toString()))}clear(a,b){jh(this.db,a,this.Da,olympe.U.sb(b+a+this.toString()))}apply(a){const b=olympe.dc.ib.uc(a);return'object'===typeof b&&null!==b?b instanceof
|
|
788
788
|
olympe.dc.CloudObject||b instanceof olympe.C.Color?this.values.some(c=>b.Fa(c)):b instanceof Date?this.values.some(c=>c instanceof Date&&c.getTime()===b.getTime()):!1:this.values.includes(b)}toString(){const a=this.values.map(b=>{let c;return null!=(c=null==b?void 0:b.toString())?c:'null'}).join('');return'In-'+this.Da+'-'+a}Pc(){return{name:'IN',property:this.Da,values:this.values}}fa(){var a,b=null!=(a=this.values[0])?a:null;a=b instanceof olympe.C.Color?4:b instanceof olympe.dc.CloudObject?3:b instanceof
|
|
789
789
|
Date?2:1;b=4===a||2===a?this.values.map(c=>c.toJSON()):3===a?this.values.map(c=>c.W()):this.values;return{pr:olympe.dc.query.za.j.mq,p:this.Da,t:a,v:b}}};function cj(a,b,c){return olympe.U.sb(c+b+a.j+a.Da)}
|
|
790
|
-
olympe.dc.query.Y.
|
|
790
|
+
olympe.dc.query.Y.Vi=class extends olympe.dc.query.za{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Da=olympe.dc.ea(b);this.j=(this.F=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ea(c):c;this.D=d;this.H=e}Cd(){return new olympe.dc.query.Y.Vi(this.db,this.Da,this.j,!this.D,!this.H)}Ab(){return[this.Da]}Jc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.Y.Vi&&this.Da===a.Da?
|
|
791
791
|
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}Pa(){return this.Da}mb(a){return this.compare(this.db.Pa(a,this.Da),this.F?this.db.Pa(a,this.j):this.j)}observe(a,b,c){this.F&&ih(this.db,a,this.j,d=>{const e=this.db.Pa(a,this.Da);null!==e&&c(this.compare(e,d))},cj(this,a,b));ih(this.db,a,this.Da,d=>{const e=this.F?this.db.Pa(a,this.j):this.j;c(null!==e?this.compare(d,e):!0)},cj(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.H?
|
|
792
792
|
this.D?a<b:a>b:this.D?a<=b:a>=b}clear(a,b){jh(this.db,a,this.Da,cj(this,a,b));this.F&&jh(this.db,a,this.j,cj(this,a,b))}Pc(){return{name:'INEQUALITY_OPERATOR',property:this.Pa(),operator:this.D?'<':'>',strict:this.H,value:this.j}}fa(){return{pr:olympe.dc.query.za.j.nq,p:this.Da,b:this.j,l:this.D,s:this.H}}toString(){return(this.D?'LowerThan-':'GreaterThan-')+this.Da+'-'+this.H+'-'+this.j}};olympe.dc.query.Y.ke=class extends olympe.dc.query.za{constructor(a){super();this.j=a}compile(){const a=this.j.Cd();return this.Fa(a)?super.compile():a.compile()}Cd(){return this.j}Ab(){return this.j.Ab()}Jc(a,b){return a instanceof olympe.dc.query.Y.ke?this.j.Jc(a.j,b):this.j.Jc(a,!b)}mb(a){return!this.j.mb(a)}observe(a,b,c){let d=null;this.j.observe(a,olympe.U.sb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Pc(){return{name:'NOT',predicate:this.j.Pc()}}fa(){return{pr:olympe.dc.query.za.j.Qq,v:this.j.fa()}}toString(){return`NOT-${this.j.toString()}`}clear(a,
|
|
793
793
|
b){this.j.clear(a,olympe.U.sb('NOT'+b+a))}Fa(a){return a instanceof olympe.dc.query.Y.ke?this.j.Fa(a.j):!1}};olympe.dc.query.Y.He=class extends olympe.dc.query.za{constructor(...a){super();this.Y=a}compile(){return this.Y.map(a=>a.compile()).flat()}Cd(){return new olympe.dc.query.Y.Pd(...this.Y.map(a=>a.Cd()))}Ab(){return this.Y.flatMap(a=>a.Ab())}Jc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}mb(a){return this.Y.reduce((b,c)=>b||c.mb(a),!1)}observe(a,b,c){const d=Array(this.Y.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
|
|
@@ -797,57 +797,57 @@ function fj(a,b){if(null===a.D)return b;let c=!1;const d=a.toString();return(e,f
|
|
|
797
797
|
olympe.dc.query.na.Zm=class{constructor(a,b){this.db=olympe.dc.ga();this.j=a;this.optional=b;this.ba=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.Qd(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.Ee(b,d,a.s,c):new olympe.dc.query.na.Lh(b,d,c);void 0!==a.p&&(b.D=xi(a.p));void 0!==a.c&&(c=b.T(),a=a.c,a=new olympe.dc.query.yf(c,new olympe.dc.Ra.Property(a.p),a.o),b.Hb=a);return b}N(){}H(){let a,
|
|
798
798
|
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:''}`}Pc(){}toJSON(){}fa(){const a={i:this.j,o:this.optional};null!==this.D&&(a.p=this.D.fa());null!==this.Hb&&(a.c=this.Hb.fa());return a}X(){}ia(){return new olympe.dc.query.na.jn}Z(){}T(){this.id||(this.id=this.X());return this.id}R(){return this.optional}Jc(a){const b=dj(this);if(0===b.length)return!0;a=dj(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
|
|
799
799
|
ej(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.Y.Pd?new olympe.dc.query.Y.Pd(...Array.from(c.Y),a):new olympe.dc.query.Y.Pd(b.D,a);return b}sort(a,b){const c=this.N();c.Hb=new olympe.dc.query.yf(this.T(),a,b);return c}mh(){return this.Hb}mb(a){if(null!==this.D){var b=this.T();for(const c of pi(a,b))this.D.mb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.T();return fj(this,gj(this,a,(d,e,f,g)=>{(d?ri(a,e,c,f):a.remove(e,c,f))&&b(d,e,
|
|
800
|
-
f,g)}))}Fa(){}};olympe.dc.query.na
|
|
800
|
+
f,g)}))}Fa(){}};olympe.dc.query.na.$h=class extends olympe.dc.query.na.Zm{constructor(a,b,c){super(a,c);this.relation=b;this.wa=null}};olympe.dc.query.na.$m=class{has(){}H(){}j(){}Xc(){}D(){}remove(){}};olympe.dc.query.na.Qd=class extends olympe.dc.query.na.Zm{constructor(a,b,c){super(a,!1);this.Pb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.na.Qd(this.j,this.Pb,this.F)}X(){return olympe.U.sb(this.j+'followRules')}ia(){return new olympe.dc.query.na.vq(this.db,this.F)}Z(a,b){return b instanceof olympe.dc.query.na.Qd?[a]:[olympe.U.sb(a+'followRules')]}Jc(a){if(a instanceof olympe.dc.query.na.$h){const b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION,d=olympe.dc.fc.ad,e=olympe.dc.fc.Ni,f=
|
|
801
801
|
olympe.dm.Relation.j.Lr,g=olympe.dm.Relation.j.us;a=a.relation;const h=a.La(),k=a.W();return h!==c||k!==d&&k!==e?!!(rh(this.db,a,this.Pb)&(a.La()===b?f:g)):!0}return a instanceof olympe.dc.query.na.Qd?this.Pb===a.Pb:!1}mb(a){const b=this.T();for(const c of pi(a,this.j))for(const d of ng(this.db,c,this.Pb))ri(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?sh(this.db,g,this.Pb,(l,n,p,q,r)=>{p&&(p=q?ri(a,r,c,g):a.remove(r,c,g),null!==n&&si(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
|
|
802
802
|
th(this.db,g,this.Pb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?ri(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.U.sb(h+f+this.toString()))}}fa(){return Object.assign(super.fa(),{f:this.Pb})}H(){return`followRulePart-${this.Pb}-${super.H()}`}Pc(){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})`}Fa(a){return a instanceof olympe.dc.query.na.Qd&&this.Pb===a.Pb}toJSON(){return{type:'follow rule',
|
|
803
|
-
rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ha.Wa('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ha.Wa('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.na.Qd.D='followRules';olympe.dc.query.na.Lh=class extends olympe.dc.query.na
|
|
803
|
+
rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ha.Wa('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ha.Wa('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.na.Qd.D='followRules';olympe.dc.query.na.Lh=class extends olympe.dc.query.na.$h{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.na.Lh(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}X(){return olympe.U.sb(this.j+this.relation.T())}Z(a,b){if(b instanceof olympe.dc.query.na.Qd)return[a];const c=[a+this.relation.T(),a+bj(this.relation).T()+!1,a+bj(this.relation).T()+!0,a+'followRules'].map(d=>olympe.U.sb(d));b instanceof olympe.dc.query.na.Ee&&b.relation.Fa(this.relation)&&
|
|
804
804
|
c.push(a);return c}mb(a){const b=this.T();for(const c of pi(a,this.j))this.db.cb(c,this.relation).forEach(d=>{ri(a,d,b,c)});super.mb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.W(),e=this.relation.La(),f=this.toString();return(g,h,k,l)=>{const n=olympe.U.sb(l+h+f);g?U(this.db,h,this.relation,(p,q)=>{si(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}fa(){return Object.assign(super.fa(),{t:this.relation.W(),d:this.relation.La()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Pc(){const a=
|
|
805
|
-
{recursive:!1,relation:this.relation,filter:dj(this).map(b=>b.map(c=>c.Pc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Pa(),order:this.Hb.
|
|
805
|
+
{recursive:!1,relation:this.relation,filter:dj(this).map(b=>b.map(c=>c.Pc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Pa(),order:this.Hb.Xi});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.La()}}Fa(a){return a instanceof olympe.dc.query.na.Lh&&this.relation.Fa(a.relation)}};olympe.dc.query.na.Ee=class extends olympe.dc.query.na.$h{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ia(){return new olympe.dc.query.na.Qr}N(){const a=new olympe.dc.query.na.Ee(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}X(){return olympe.U.sb(this.j+this.relation.T()+this.F)}Z(a,b){if(b instanceof olympe.dc.query.na.Qd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.U.sb(d));b instanceof olympe.dc.query.na.Ee&&
|
|
806
806
|
b.relation.Fa(this.relation)&&c.push(a);return c}mb(a){const b=this.T();for(const c of pi(a,this.j))this.F&&ri(a,c,b,c),this.db.qh(c,this.relation).forEach(d=>{ri(a,d,b,c)});super.mb(a)}observe(a,b){const c=this.relation.W(),d=this.relation.La(),e=(f,g,h,k)=>{const l=olympe.U.sb(k+g);f?U(this.db,g,this.relation,(n,p)=>{si(a,n,c,d,g,p);super.observe(a,(q,r,t,v)=>{b(q,r,t,v);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,
|
|
807
|
-
g,olympe.U.sb(h+g));e(f,g,g,h)}}fa(){return Object.assign(super.fa(),{s:this.F,t:this.relation.W(),d:this.relation.La()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Pc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:dj(this).map(b=>b.map(c=>c.Pc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Pa(),order:this.Hb.
|
|
807
|
+
g,olympe.U.sb(h+g));e(f,g,g,h)}}fa(){return Object.assign(super.fa(),{s:this.F,t:this.relation.W(),d:this.relation.La()})}H(){return`followRecursivelyPart-${this.relation.T()}-${this.F}-${super.H()}`}Pc(){const a={recursive:this.F?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:dj(this).map(b=>b.map(c=>c.Pc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Pa(),order:this.Hb.Xi});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',
|
|
808
808
|
relation:`${this.db.name(this.relation)} (${this.relation.W()})`,direction:this.relation.La()}}Fa(a){return a instanceof olympe.dc.query.na.Ee&&this.relation.Fa(a.relation)&&this.F===a.F}};olympe.dc.query.na.vm=class extends olympe.dc.query.na.Qd{observe(a,b){const c=this.T();return(d,e,f,g)=>{d?ri(a,e,c,e):a.remove(e,c,e);b(d,e,e,g)}}};olympe.dc.query.na.vq=class{constructor(a,b){this.db=a;this.origin=null;this.content=new Map;this.F=null!=b?b:null}Xc(){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,
|
|
809
809
|
b){a===this.origin&&(this.origin=null);if(null===this.origin||!this.db.Ja(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.vq.ya=[olympe.dc.query.na.$m];olympe.dc.query.na.Qr=class{constructor(){this.content=new Map}Xc(){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!=
|
|
810
810
|
(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.Qr.ya=[olympe.dc.query.na.$m];olympe.dc.query.na.jn=class{constructor(){this.content=new Map}Xc(){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);
|
|
811
|
-
return b}};olympe.dc.query.na.jn.ya=[olympe.dc.query.na.$m];olympe.dc.sources={};olympe.dc.sources.hk=class{T(){}init(){}destroy(){}request(){return u(function*(){})}subscribe(){}};const hj=olympe.net.ra.Gd.GET,ij=olympe.net.ra.Gd.Rg,jj=olympe.net.ra.Gd.Ec,kj=olympe.net.ra.Gd.ur,lj=olympe.net.ra.Headers.Eh,mj=olympe.net.ra.Headers.Ql,nj=olympe.net.ra.Ub.
|
|
811
|
+
return b}};olympe.dc.query.na.jn.ya=[olympe.dc.query.na.$m];olympe.dc.sources={};olympe.dc.sources.hk=class{T(){}init(){}destroy(){}request(){return u(function*(){})}subscribe(){}};const hj=olympe.net.ra.Gd.GET,ij=olympe.net.ra.Gd.Rg,jj=olympe.net.ra.Gd.Ec,kj=olympe.net.ra.Gd.ur,lj=olympe.net.ra.Headers.Eh,mj=olympe.net.ra.Headers.Ql,nj=olympe.net.ra.Ub.Vh,oj=olympe.net.ra.Ub.Yo,pj=olympe.net.ra.Ub.mk,qj=olympe.net.ra.Ub.hj,rj=olympe.net.ra.Ub.$i;
|
|
812
812
|
function sj(a){const b=`/${olympe.V.getParameter(olympe.dc.sources.Config.xm)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.R.D('_DataSourcesHTTPService',b,[hj,ij,jj,kj],(c,d,e)=>u(function*(){const f=d.get('sourceId');var g=a.F.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ga().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.rd(`No handler found for datasource ${f} called '${g}'`,rj,'Invalid source id'))}h=c.method;const k=c.Dj();try{var l=
|
|
813
813
|
yield tj(a,k[mj])}catch(r){return new olympe.net.rd(`Invalid token ${r}`,pj,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.j.pc,t=olympe.dc.Request.j.Ug,v=olympe.dc.Request.j.ef,x=olympe.dc.Request.j.fh,y=olympe.dc.Request.j.Bh,z=olympe.dc.Request.j.eg,A=olympe.dc.Request.j.gg,K=olympe.dc.Request.j.qg;let Z;switch(n){case r:break;case t:case v:case y:case x:Z=a.D.N(p);break;case K:case z:case A:Z={tag:e.get('tag'),model:e.get('model'),mimeType:k[lj]};p instanceof
|
|
814
814
|
Uint8Array&&(Z.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let Aa;const db=null!=(Aa=k['X-Source-Origin'])?Aa:olympe.dc.Ia.$e;var q=Tf(new olympe.dc.Request(n,f,Z,l),db);const Qa=yield g(q);let dd;void 0===Qa?dd='':Qa instanceof Blob||Qa instanceof Uint8Array||Qa instanceof ArrayBuffer||'function'===typeof(null==Qa?void 0:Qa.pipe)?dd=Qa:dd=JSON.stringify(a.D.fa(Qa));return new olympe.net.rd(dd,h===kj?oj:nj)}catch(r){return r instanceof olympe.error.yk?new olympe.net.rd(`Authorization error: ${r}`,
|
|
815
815
|
pj,'Forbidden'):new olympe.net.rd(`Internal server error: ${r}`,qj,'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 uj(a){a.R.R('_DataSourcesHTTPService').catch(b=>{a.G.error(`An error occurred while stopping the data sources http service: ${b}`)})}function vj(a,b,c){0===a.F.size&&sj(a);a.F.set(b,c);return()=>{a.F.delete(b);0===a.F.size&&uj(a)}}
|
|
816
816
|
function wj(a,b,c){c=b instanceof olympe.dm.DataSource?b.Sf(c):xj(b,c);null===c&&a.G.error(`Impossible to build URL for data source ${b}`);return c}
|
|
817
|
-
function yj(a,b,c){if(b===olympe.dc.Ia.SERVER){var d;return null!=(d=re(a.H,a.ba.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.Z.jb(b);e=olympe.dc.sources.Config.Mh;const f=olympe.dc.sources.Config.Cf,g=olympe.dc.sources.Config.
|
|
818
|
-
function zj(a,b){return b instanceof olympe.net.
|
|
817
|
+
function yj(a,b,c){if(b===olympe.dc.Ia.SERVER){var d;return null!=(d=re(a.H,a.ba.get(c)))?d:null}var e=a.N.get(b);if(!e){d=a.Z.jb(b);e=olympe.dc.sources.Config.Mh;const f=olympe.dc.sources.Config.Cf,g=olympe.dc.sources.Config.Si,h=olympe.dc.sources.Config.xm;let k;e=`${wj(a,null!=d?d:b,g)?'https':'http'}://${wj(a,null!=d?d:b,e)}:${null!=(k=wj(a,null!=d?d:b,f))?k:wj(a,null!=d?d:b,g)?443:80}`+`/${wj(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.N.set(b,e)}return`${e}/${c}`}
|
|
818
|
+
function zj(a,b){return b instanceof olympe.net.Ui?te(a.H,b,de(a.X).zd()):Promise.reject('No http request to send')}function Aj(a,b){var c=yj(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.fa(d));c=N(c,ij,e,olympe.net.ra.ResponseType.JSON);O(c,{['X-Source-Origin']:b.origin,[lj]:'application/json'});return zj(a,c).then(f=>(f=f.getData())?a.D.N(f):olympe.dc.query.Id.yj(d))}
|
|
819
819
|
function Bj(a,b){var c=yj(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.fa(b.content));c=N(c,ij,d);O(c,{['X-Source-Origin']:b.origin,[lj]:'application/json'});return zj(a,c).then(e=>Number.parseInt(e.getData(),10))}function tj(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.X.th(b,(e,f)=>{e?d(e):c(f)})})}
|
|
820
820
|
olympe.dc.sources.Ku=class{constructor(a,b,c,d,e,f){this.G=a;this.R=b;this.H=c;this.X=d;this.Z=e;this.D=f;this.F=new Map;new olympe.C.Zb('Http service of remote data provider');this.N=new Map;this.j=new Map;this.ba=new Map([[olympe.dc.Request.j.Kg,olympe.L.Ob.Kg],[olympe.dc.Request.j.gg,olympe.L.Ob.kk],[olympe.dc.Request.j.qg,olympe.L.Ob.kk],[olympe.dc.Request.j.eg,olympe.L.Ob.kk],[olympe.dc.Request.j.Eo,olympe.L.Ob.Do],[olympe.dc.Request.j.Jr,olympe.L.Ob.Ir],[olympe.dc.Request.j.Yp,olympe.L.Ob.Xp],
|
|
821
821
|
[olympe.dc.Request.j.Ug,olympe.L.Ob.Ro],[olympe.dc.Request.j.fh,olympe.L.Ob.TRANSACTION]])}Lc(a){var b=yj(this,a.ic(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.ic()}`);b=Gc(N(b,hj),olympe.net.ra.ResponseType.JSON);O(b,{['X-Source-Origin']:a.origin});return zj(this,b).then(c=>c.getData())}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.ic(),f=yj(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);
|
|
822
822
|
const g=N(e===olympe.dc.Ia.SERVER?`${f}/${b}`:`${f}?tag=${b}&model=${c}`,kj,d);O(g,{[lj]:'application/octet-stream'});e!==olympe.dc.Ia.SERVER&&O(g,{['X-Source-Origin']:a.origin});return zj(this,g).then(()=>(new URL(g.j())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=yj(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,jj,b);d!==olympe.dc.Ia.SERVER&&O(e,
|
|
823
|
-
{['X-Source-Origin']:a.origin});return zj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=yj(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,
|
|
824
|
-
O(e,{['X-Source-Origin']:a.origin});zj(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.
|
|
825
|
-
function Nj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.U.
|
|
823
|
+
{['X-Source-Origin']:a.origin});return zj(this,e).then(()=>{})}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.ic();var e=yj(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,ri:k})});if(this.j.has(b))return f;this.j.set(b,g);e=N(d===olympe.dc.Ia.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,hj,void 0,olympe.net.ra.ResponseType.di);d!==olympe.dc.Ia.SERVER&&
|
|
824
|
+
O(e,{['X-Source-Origin']:a.origin});zj(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.ri(`${h}`))}).finally(()=>{this.j.delete(b)});return f}};olympe.dc.sources.tq=class{constructor(a,b){this.G=a;this.Jb=b}};olympe.dc.sources.tq.Ub={jj:0,eD:1,fD:3,zC:4};const Cj=olympe.dc.Request.j.pc,Dj=olympe.dc.Request.j.Ug,Ej=olympe.dc.Request.j.Kk,Fj=olympe.dc.Request.j.qg,Gj=olympe.dc.Request.j.gg,Hj=olympe.dc.Request.j.eg,Ij=olympe.dc.Request.j.Ii,Jj=olympe.dc.Request.j.Bh,Kj=olympe.dc.Request.j.ef,Lj=olympe.dc.Request.j.fh,Mj=olympe.dc.Request.j.ek;
|
|
825
|
+
function Nj(a,b){const c=b.T();null===a.D&&(a.D=new olympe.U.ci(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.rc(e);fb(a.D.j,c)||a.D.set(c,e)}function Oj(a,b){return u(function*(){const c=Tf(new olympe.dc.Request(olympe.dc.Request.j.ek,a.T(),b),olympe.dc.Ia.SELF);let d;yield null==(d=a.Jb)?void 0:d.Ai(c)})}
|
|
826
826
|
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.rc(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.N?rxjs.interval(a.N).pipe(rxjs.operators.switchMap(()=>c)):c}
|
|
827
827
|
olympe.dc.sources.Iq=class{constructor(a,b){this.G=a;this.j=b;this.Jb=null;this.H=olympe.dc.query.sl();this.F=new olympe.C.Zb('Context of source '+this.T());let c;this.N=null!=(c=b.Sf(olympe.dc.sources.Config.Wm))?c:-1;this.D=null}T(){return this.j.T()}init(a){this.Jb=a;if(this.T()===olympe.dc.Ia.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:`);
|
|
828
|
-
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 Cj:const d=olympe.dm.DataSource.pc.Bb,e=olympe.dm.DataSource.pc.
|
|
829
|
-
return this.j.healthCheck().then(()=>({s:e})).catch(h=>({s:d,r:String(h)}));case Dj:return this.j.executeQuery(b);case Ij:const f=b.Yb();Nj(this,f);Oj(this,Pf(f)).catch(h=>{this.G.warn(`Error occurred when applying burst transaction ${f.T()} to the data source: ${h}`)});return Promise.resolve();case Kj:case Lj:const g=b.Yb();return this.applyTransaction(g,c===Lj).finally(()=>{if(a.origin===olympe.dc.Ia.SELF){var h=g.T();h=Tf(new olympe.dc.Request(olympe.dc.Request.j.lk,olympe.dc.Ia.SELF,{id:h,finalize:olympe.dc.transaction.Kf.j
|
|
828
|
+
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 Cj:const d=olympe.dm.DataSource.pc.Bb,e=olympe.dm.DataSource.pc.Zh;
|
|
829
|
+
return this.j.healthCheck().then(()=>({s:e})).catch(h=>({s:d,r:String(h)}));case Dj:return this.j.executeQuery(b);case Ij:const f=b.Yb();Nj(this,f);Oj(this,Pf(f)).catch(h=>{this.G.warn(`Error occurred when applying burst transaction ${f.T()} to the data source: ${h}`)});return Promise.resolve();case Kj:case Lj:const g=b.Yb();return this.applyTransaction(g,c===Lj).finally(()=>{if(a.origin===olympe.dc.Ia.SELF){var h=g.T();h=Tf(new olympe.dc.Request(olympe.dc.Request.j.lk,olympe.dc.Ia.SELF,{id:h,finalize:olympe.dc.transaction.Kf.j.aj,
|
|
830
830
|
error:null}),this.T());let k;null==(k=this.Jb)||k.Oc(h)}});case Jj:return Pj(this,b.Yb());case Fj: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 Gj:return this.j.downloadFileContent(b.tag,b.model);case Hj:return this.j.deleteFileContent(b.tag,b.model);case Mj:return c=Tf(new olympe.dc.Request(Mj,olympe.dc.Ia.SELF,b,a.yc()),this.T()),this.Jb.Oc(c);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===
|
|
831
831
|
Ej){const b=a.content;a=a.origin;return a===olympe.dc.Ia.SELF?Qj(this,b):Ei(this.H,b,this.F,a,olympe.dc.la.oc.xf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Te)?void 0:d.F)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>Pf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return u(function*(){var d=Sj(a);yield c.j.applyTransaction(d,{batch:b});d=Date.now();yield Oi(c.H,c.T(),a);const e=
|
|
832
832
|
Pf(a,d);yield Oj(c,e);return d})}};olympe.dc.sources.Iq.ya=[olympe.dc.sources.hk];function Sj(a){const b=olympe.dc.sources.ng.j.hu,c=olympe.dc.sources.ng.j.ex,d=olympe.dc.sources.ng.j.nu,e=olympe.dc.sources.ng.j.iu,f=olympe.dc.sources.ng.j.ou,g=[],h=[],k=[],l=[],n=[];a.Cb.forEach((p,q)=>{const r=p.Wb();p.D()?g.push(Tj(b,q,r,p.N()?p.Ab():null)):p.Bd()?k.push(Tj(d,q,r,null,p.F())):p.N()&&h.push(Tj(c,q,r,p.Ab()));for(const [t,v,x]of p.Ld())p=a.Wc(v),x?l.push(new Uj(e,t,q,v,r,p.Wb())):n.push(new Uj(f,t,q,v,r,p.Wb()))});return n.concat(k,g,h,l)}
|
|
833
833
|
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.ng=class{constructor(a){this.type=a}};class Vj extends olympe.dc.sources.ng{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}}
|
|
834
|
-
class Uj extends olympe.dc.sources.ng{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.ng.j={hu:'CREATE',ex:'UPDATE',nu:'DELETE',iu:'CREATE_RELATION',ou:'DELETE_RELATION'};function Wj(a,b){b=Tf(new olympe.dc.Request(olympe.dc.Request.j.lk,olympe.dc.Ia.SELF,{id:b,finalize:olympe.dc.transaction.Kf.j
|
|
835
|
-
olympe.dc.sources.cm=class{constructor(a,b){this.G=a;this.D=b;this.Jb=null}T(){}X(){}Z(){}init(a){this.Jb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return u(function*(){if(!b.D.j)return b.X(a);var c=olympe.dc.Request.j.pc,d=olympe.dc.Request.j.Ug;const e=olympe.dc.Request.j.ef,f=olympe.dc.Request.j.fh;var g=olympe.dc.Request.j.
|
|
834
|
+
class Uj extends olympe.dc.sources.ng{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.ng.j={hu:'CREATE',ex:'UPDATE',nu:'DELETE',iu:'CREATE_RELATION',ou:'DELETE_RELATION'};function Wj(a,b){b=Tf(new olympe.dc.Request(olympe.dc.Request.j.lk,olympe.dc.Ia.SELF,{id:b,finalize:olympe.dc.transaction.Kf.j.aj,error:null}),a.T());let c;null==(c=a.Jb)||c.Oc(b)}
|
|
835
|
+
olympe.dc.sources.cm=class{constructor(a,b){this.G=a;this.D=b;this.Jb=null}T(){}X(){}Z(){}init(a){this.Jb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return u(function*(){if(!b.D.j)return b.X(a);var c=olympe.dc.Request.j.pc,d=olympe.dc.Request.j.Ug;const e=olympe.dc.Request.j.ef,f=olympe.dc.Request.j.fh;var g=olympe.dc.Request.j.Ii;const h=olympe.dc.Request.j.Bh,k=olympe.dc.Request.j.qg;var l=olympe.dc.Request.j.gg;const n=olympe.dc.Request.j.eg,p=olympe.dc.sources.de(),
|
|
836
836
|
q=a.getType(),r=a.ic();if(Nd(b.D)){q===d&&(c=a.content,(g=Vf(a).get(olympe.dc.la.j.Yl))&&(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.X(a);if(q===d){const t=a.content;if(l instanceof ReadableStream){const v=new olympe.dc.db.ec(`fullResult_${t.T()}`);l=l.pipeThrough(new TransformStream({transform:(x,
|
|
837
837
|
y)=>u(function*(){const z=x.Yb();yield Yj(p,z);z.rc(v);b.G.j()&&b.G.debug(`Data Provider: Data result for query ${t.T()}`,z.Cb.size,'instances',Array.from(z.Ld()).length,'relations');y.enqueue(x)}),flush:()=>u(function*(){yield Zj(p,t.T(),r,v,!0)})}))}else d=l.Yb(),yield Yj(p,d),yield Zj(p,t.T(),r,d,!0)}else if(q===e||q===f||q===h)b.G.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield ak(p,null,r,a.content.Yb(),!1);return l}b.G.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);
|
|
838
838
|
switch(q){case c:return{s:olympe.dm.DataSource.pc.Ff};case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.Yb().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,
|
|
839
839
|
b){if(!this.D.j)return this.Z(a,b);const c=olympe.dc.sources.de(),d=a.content,e=a.ic();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(Nd(this.D)){const f=new rxjs.Observable(h=>{olympe.C.yt([this.D.rf()],()=>{h.error(new olympe.error.aq('Go Offline',d.T()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.C.yt([this.D.rf()],()=>{f.error(new olympe.error.Qo('Back Online',d.T()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(ak(c,d.T(),e,f.Yb()).then(()=>
|
|
840
|
-
f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);throw g;}))))}};olympe.dc.sources.cm.ya=[olympe.dc.sources.hk];const bk=olympe.dc.Request.j.pc,ck=olympe.dc.Request.j.Ug,dk=olympe.dc.Request.j.Kk,ek=olympe.dc.Request.j.ef,fk=olympe.dc.Request.j.fh,gk=olympe.dc.Request.j.
|
|
840
|
+
f).catch(g=>{this.G.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);throw g;}))))}};olympe.dc.sources.cm.ya=[olympe.dc.sources.hk];const bk=olympe.dc.Request.j.pc,ck=olympe.dc.Request.j.Ug,dk=olympe.dc.Request.j.Kk,ek=olympe.dc.Request.j.ef,fk=olympe.dc.Request.j.fh,gk=olympe.dc.Request.j.Ii,hk=olympe.dc.Request.j.Bh,ik=olympe.dc.Request.j.qg,jk=olympe.dc.Request.j.gg,kk=olympe.dc.Request.j.eg;function lk(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Sf(olympe.dc.sources.Config.We))!==olympe.dm.DataSource.We.eq}
|
|
841
841
|
function mk(a,b){let c;return(null==(c=a.Ha.jb(b))?void 0:c.Sf(olympe.dc.sources.Config.We))!==olympe.dm.DataSource.We.Ho}function nk(a,b,c){const d=c.content.Yb().T();let e=a.ba.get(d);e||(e=olympe.L.rb.mt(b),a.ba.set(d,e));return e.md(c)}function ok(a,b){b=b.yc();if(b!==olympe.dm.User.j&&a.Sf(olympe.dc.sources.Config.dn))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.error.yk(a);}
|
|
842
842
|
function pk(a,b,c,d,e){return u(function*(){var f=olympe.L.pa.j.SEND,g=olympe.L.pa.j.GET;const h=olympe.L.pa.j.PUBLISH,k=olympe.L.pa.j.SUBSCRIBE,l=d.At();var n=d.body();if(e!==n.yc())throw Error('Access denied: try to impersonate a user');ok(c,n);let p;if(null==(p=a.Jb)||!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()===dk)f=n.content.T();else throw Error('Not supported type of subscription');
|
|
843
843
|
g=yield d.bo(f);a.ia.set(g,f);g=a.N.get(f);g||(g=new qk(a.G,f,b,Tf(n,olympe.dc.Ia.$e)),a.N.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.Oc(n):a.G.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ack()):l===h&&(yield b.request(n))})}
|
|
844
844
|
olympe.dc.sources.Tr=class extends olympe.dc.sources.cm{constructor(a,b,c,d,e,f){super(a,d);this.H=b;this.j=c;this.db=e;this.F=new olympe.C.Zb('Remote Provider Context');this.wa=new Map;this.R=new Map;this.N=new Map;this.ia=new Map;this.Ha=f;this.ba=new Map}T(){return olympe.dc.Ia.$e}X(a){var b=olympe.L.rb;const c=a.ic();var 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 bk:const e=olympe.dm.DataSource.pc.Bb,f=
|
|
845
|
-
olympe.dm.DataSource.pc.
|
|
845
|
+
olympe.dm.DataSource.pc.Zh;b=lk(this,c)?b.get(c,a):Promise.resolve({s:f});a=mk(this,c)?this.j.Lc(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 ck:return mk(this,c)?Aj(this.j,a):b.get(c,a);case ek:const g=a.content.Yb().T();return(lk(this,c)?b.get(c,a):Bj(this.j,a)).finally(()=>Wj(this,g));case fk:const h=a.content.Yb().T();
|
|
846
846
|
return(mk(this,c)?Bj(this.j,a):b.get(c,a)).finally(()=>Wj(this,h));case gk:return lk(this,c)?nk(this,c,a).catch(k=>{this.G.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case hk:return d=a.content.Yb().T(),this.ba.delete(d),lk(this,c)?b.get(c,a):Bj(this.j,a);case ik:return mk(this,c)?this.j.uploadFileContent(a):b.get(c,a);case jk:return mk(this,c)?this.j.downloadFileContent(a):b.get(c,a);case kk:return mk(this,c)?this.j.deleteFileContent(a):
|
|
847
847
|
b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.T()}`)}}Z(a,b){const c=a.ic(),d=a.getType();if(!lk(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===dk?olympe.L.rb.observe(c,this.F,a,{onRetry:b}).observable:rxjs.throwError(()=>
|
|
848
|
-
Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.la.from(this.H,this.H).bb(olympe.dm.DataSource.Nj).filter(olympe.dc.query.za.Fa(olympe.dm.DataSource.
|
|
848
|
+
Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.F)return this;olympe.dc.la.from(this.H,this.H).bb(olympe.dm.DataSource.Nj).filter(olympe.dc.query.za.Fa(olympe.dm.DataSource.ki,!0)).filter(olympe.dc.query.za.Fa(olympe.dm.DataSource.Us,!0)).observe(this.F).subscribe(b=>{b.zj().forEach(this.lb.bind(this,a));b.Fj().forEach(c=>{let d;null==(d=this.wa.get(c))||d.destroy();this.wa.delete(c)})});this.db.Pa(this.H,olympe.dm.DataSource.Us)&&(new olympe.L.rb(this.H,this.F)).listen().subscribe(b=>
|
|
849
849
|
{b=b.body();b instanceof olympe.dc.Request?a.Oc(b):this.G.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return u(function*(){})}lb(a,b){const c=b.W(),d=new olympe.C.Zb(`Published data provider context ${c}`,this.F);this.wa.set(c,d);let e;rk(b,d).subscribe(f=>{let g;null==(g=e)||g();let h;null==(h=this.R.get(c))||h.stop();this.R.delete(c);f!==olympe.dm.DataSource.We.Ho&&(e=vj(this.j,c,k=>{ok(b,k);return a.request(k)}),d.onDestroy(()=>{let k;return null==
|
|
850
|
-
(k=e)?void 0:k()}));f!==olympe.dm.DataSource.We.eq&&(f=new olympe.C.Zb(`Bus Service of data source ${c}`,d),f=(new olympe.L.rb(c,f)).It(this.Ua.bind(this)),this.R.set(c,f),f.listen().subscribe(k=>{k.
|
|
850
|
+
(k=e)?void 0:k()}));f!==olympe.dm.DataSource.We.eq&&(f=new olympe.C.Zb(`Bus Service of data source ${c}`,d),f=(new olympe.L.rb(c,f)).It(this.Ua.bind(this)),this.R.set(c,f),f.listen().subscribe(k=>{k.Ei().then(l=>pk(this,a,b,k,l)).catch(l=>{this.G.warn(`Error occurred while processing request from ${k.source()}: ${l}`);return k.ri(l instanceof Error?l:Error(l))})}))})}Ai(a){const b=this;return u(function*(){let c;yield null==(c=b.R.get(a.ic()))?void 0:c.Ai(a)})}Ua(a){const b=this.ia.get(a);this.ia.delete(a);
|
|
851
851
|
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)}};
|
|
852
852
|
class qk{constructor(a,b,c,d){this.G=a;this.D=b;this.j=0;this.F=c.subscribe(d).subscribe({next:e=>{olympe.L.rb.md(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.Tr.ya=[olympe.dc.sources.hk];const X={Fs:10,Wo:11,Hp:12,Ar:13,QUERY_RESULT:14,Zp:15,mp:16,ef:17,Br:18,lp:19,gj:20};function sk(a,b){const c=new olympe.dc.transaction.Je,d=new olympe.dc.transaction.Je;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.Uc(e.t,e.s,f,e.m);e.r.forEach(h=>g.Oa(h.r,h.o,h.d))});a.Z.od(Yf(Zf(d),olympe.dc.Ia.SELF),{persist:!1});a.Z.od(Yf(Zf(c),olympe.dc.Ia.SELF))}
|
|
853
853
|
olympe.dc.sources.cc=class extends olympe.L.cc{constructor(a){super();this.Z=a;this.db=a.view;this.F=new Map}fa(a){a=super.fa(a);if(0<this.F.size){const b=Array.from(this.F.values());this.F.clear();return Object.assign(this.format(X.Fs,a),{i:b})}return a}N(a){return(null==a?void 0:a.t)===X.Fs&&Array.isArray(null==a?void 0:a.i)?(sk(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=X.Hp;{const d=a.W(),e={t:d};if(!this.F.has(d)&&(this.H(d),!this.db.Se(d))){const f=
|
|
@@ -855,12 +855,12 @@ a.get(olympe.dm.File.urlProp);if(f.startsWith('blob:')||f.startsWith('stream:'))
|
|
|
855
855
|
a.rc(b),this.format(X.Zp,{i:a.T(),p:Zf(b)});case a instanceof olympe.dc.Request:return this.format(X.mp,{r:a.getType(),o:a.origin,d:a.ic(),u:a.yc(),c:this.D(a.content)});case a instanceof olympe.dc.transaction.mj:return this.format(X.ef,{r:a.wh(),p:this.D(a.Yb())});case a instanceof olympe.dc.query.Id:return this.format(X.Br,a.fa());case a instanceof olympe.dc.Ig:return this.format(X.lp,a.fa());case a instanceof olympe.dc.wc:return this.format(X.gj,this.H(a.W()));default:return super.D(a)}}j(a){if(null===
|
|
856
856
|
a||'object'!==typeof a)return super.j(a);const {t:b,v:c}=a;switch(b){case X.Hp:var d=c.t;c.s&&(a=this.j(c.s),olympe.dc.bt().wb(d,a));return olympe.dc.CloudObject.get(d);case X.Wo:return olympe.dc.CloudObject.get(c);case X.Ar:return d=c.p.map(olympe.dc.query.na.Zm.j),a=c.e,new olympe.dc.la(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Od:a.s,Ue:a.rm});case X.QUERY_RESULT:return Qi(c);case X.Zp:return(new olympe.dc.transaction.dj).j(c.p,c.i);case X.mp:return a=null!=(d=this.j(c.c))?d:void 0,
|
|
857
857
|
Tf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case X.ef:return d=this.j(c.p),new olympe.dc.transaction.mj(d,c.r);case X.Br:return olympe.dc.query.Id.j(c);case X.lp:return olympe.dc.Ig.j(c);case X.gj:return new olympe.dc.wc(c);default:return super.j(a)}}H(a){if(this.F.has(a))return a;if(!this.db.Ja(a))throw new olympe.dc.jr(a);const b={};this.db.Ab(a).forEach((d,e)=>{b[e]=this.D(d)});var c=[];for(const [d,e,f]of vh(this.db,a))this.F.has(f)&&c.push(e===olympe.dc.va.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,
|
|
858
|
-
d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Se(a)||(c.v=!0);this.F.set(a,c);return a}};const tk=olympe.dc.Request.j.Kg,uk=olympe.dc.Request.j.ef,vk=olympe.dc.Request.j.fh,wk=olympe.dc.Request.j.
|
|
859
|
-
olympe.dc.Request.j.Bh,Nk=olympe.dc.Request.j.gu,Ok=olympe.dc.Request.j.pc;function Pk(a){return Qk(a,olympe.dc.Request.j.Kg).then(b=>{b=b.getData().p;const c=Yf(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 Rk(a,b){const c=new olympe.dc.transaction.Je({ne:!1,
|
|
860
|
-
function Tk(a,b){const c=b.Yb(),d=new olympe.dc.transaction.Je({Fl:!0,ne:!1,
|
|
861
|
-
function Vk(a,b){const c=new olympe.dc.transaction.Je({ne:!1,
|
|
858
|
+
d:a});c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c};this.db.Se(a)||(c.v=!0);this.F.set(a,c);return a}};const tk=olympe.dc.Request.j.Kg,uk=olympe.dc.Request.j.ef,vk=olympe.dc.Request.j.fh,wk=olympe.dc.Request.j.Ii,xk=olympe.dc.Request.j.Eo,yk=olympe.dc.Request.j.Jr,zk=olympe.dc.Request.j.Ug,Ak=olympe.dc.Request.j.Kk,Bk=olympe.dc.Request.j.Yp,Ck=olympe.dc.Request.j.Fu,Dk=olympe.dc.Request.j.Gu,Ek=olympe.dc.Request.j.Hu,Fk=olympe.dc.Request.j.eg,Gk=olympe.dc.Request.j.gg,Hk=olympe.dc.Request.j.qg,Ik=olympe.dc.Request.j.lk,Jk=olympe.dc.Request.j.ax,Kk=olympe.dc.Request.j.pw,Lk=olympe.dc.Request.j.Tp,Mk=
|
|
859
|
+
olympe.dc.Request.j.Bh,Nk=olympe.dc.Request.j.gu,Ok=olympe.dc.Request.j.pc;function Pk(a){return Qk(a,olympe.dc.Request.j.Kg).then(b=>{b=b.getData().p;const c=Yf(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 Rk(a,b){const c=new olympe.dc.transaction.Je({ne:!1,li:!1}),d=b.Yb(),e=b.j;d.rc(c);return Sk(a,uk,{i:d.T(),r:b.wh(),p:Zf(c),bd:e?!0:void 0}).then(f=>f.ct)}
|
|
860
|
+
function Tk(a,b){const c=b.Yb(),d=new olympe.dc.transaction.Je({Fl:!0,ne:!1,li:!1});c.rc(d);b=b.j?'bd=true':'';return Qk(a,vk,Zf(d),b,olympe.net.ra.ResponseType.mn).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(()=>{Uk(a,Ik,{id:c.T(),finalize:olympe.dc.transaction.Kf.j.aj})})}
|
|
861
|
+
function Vk(a,b){const c=new olympe.dc.transaction.Je({ne:!1,li:!1}),d=b.Yb();d.rc(c);return Sk(a,wk,{i:d.T(),r:b.wh(),p:Zf(c)},!1).catch(e=>a.G.error(`Error while publishing burst transaction: ${e}`))}function Wk(a,b){const c=new olympe.dc.transaction.Je({ne:!1,li:!1});b=b.Yb();b.rc(c);return Sk(a,Mk,{i:b.T(),p:Zf(c)}).then(d=>d.ct)}
|
|
862
862
|
function Xk(a,b){const c=encodeURI(ab(olympe.U.kf(),JSON.stringify(Yk(a,b))));a.G.j()&&a.G.debug(`Static GraphDef query ${b} sent to orchestrator`);return Qk(a,zk,void 0,`query=${c}&v=${a.version}`,olympe.net.ra.ResponseType.le).then(d=>Zk(a,d))}function $k(a,b){const c=b.T();a.G.j()&&a.G.debug(`Query (${c}) sent to orchestrator: ${b}`);const d=Yk(a,b);return vb(a.wa,()=>Qk(a,Bk,d,void 0,olympe.net.ra.ResponseType.le)).then(e=>Zk(a,e))}
|
|
863
|
-
function al(a,b){if(!ze(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=Yk(a,olympe.dc.la.from(b));b.f=olympe.dc.Lb.qp;b=N(yj(a.j,olympe.dc.Ia.SERVER,xk),olympe.net.ra.Gd.Rg,JSON.stringify(b),olympe.net.ra.ResponseType.
|
|
863
|
+
function al(a,b){if(!ze(a.F))return a.G.error(`Server is disconnected, backup of instance ${b} is canceled.`),Promise.reject('Server is disconnected');b=Yk(a,olympe.dc.la.from(b));b.f=olympe.dc.Lb.qp;b=N(yj(a.j,olympe.dc.Ia.SERVER,xk),olympe.net.ra.Gd.Rg,JSON.stringify(b),olympe.net.ra.ResponseType.di);O(b,{[olympe.net.ra.Headers.Eh]:olympe.net.ra.bk.JSON});return zj(a.j,b).then(c=>c.getData())}
|
|
864
864
|
function bl(a,b,c,d){if(!ze(a.F))return a.G.error('Server is disconnected, restore of instance is canceled.'),Promise.reject('Server is disconnected');const e=yj(a.j,olympe.dc.Ia.SERVER,yk);b=N(e+`?debug=${c}&optional=${d}`,olympe.net.ra.Gd.Rg,b);O(b,{[olympe.net.ra.Headers.Eh]:olympe.net.ra.bk.nx});return zj(a.j,b).then(f=>f.getData())}
|
|
865
865
|
function Sk(a,b,c,d=!0){const e=olympe.L.Ge.Hg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Ce(a.F,e,f,(k,l)=>{k?h(k):g(l)})});Ce(a.F,e,f);return Promise.resolve()}
|
|
866
866
|
function Yk(a,b){var c=li(b);b={i:b.T(),b:[b.D],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.na.Qd)Object.assign(b,{f:c[0].Pb,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Fa(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.Ee&&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.ba.bind(a,
|
|
@@ -869,15 +869,15 @@ function Qk(a,b,c,d,e){const f=yj(a.j,a.T(),b);if('string'!==typeof f)return Pro
|
|
|
869
869
|
function Zk(a,b){return u(function*(){const c=b.headers.graphId,d=b.getData();let e,f;return(null!=(f=null==(e=a.Ha)?void 0:wb(e,d))?f:olympe.U.stream.Ek.transform(b.getData())).pipeThrough(new TransformStream({transform:(g,h)=>{a.G.debug(`Received ${g.length} operations for patch ${c}`);h.enqueue(Yf(g,a.T(),null,c))}}))})}
|
|
870
870
|
function cl(a,b,c){return u(function*(){const d=b.pi;let e;if(c instanceof olympe.U.stream.og){e=new olympe.dc.db.ec(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.R.j(g.value.p,d).rc(e)}}catch(f){a.G.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.ec(d)}}else e=a.R.j(b.p,d);return Pf(e,b.ct)})}
|
|
871
871
|
olympe.dc.sources.hs=class extends olympe.dc.sources.cm{constructor(a,b,c,d,e,f,g){super(a,c);this.F=b;this.j=d;this.R=new olympe.dc.transaction.dj(this.T());this.H=new Map;this.N=new Set;this.version=e||'unknown';this.Ha=g?new olympe.U.stream.mx:null;this.wa=new olympe.U.promise.ms(f);olympe.C.Hj(this.D.rf(),()=>{this.H.forEach((h,k)=>{h.error(new olympe.error.Th('Connection to server has been recovered',k))})})}T(){return olympe.dc.Ia.SERVER}X(a){var b=a.getType();const c=a.content,d=Vf(a);switch(b){case Ok:return a=
|
|
872
|
-
olympe.dm.DataSource.pc.Bb,b=olympe.dm.DataSource.pc.
|
|
872
|
+
olympe.dm.DataSource.pc.Bb,b=olympe.dm.DataSource.pc.Zh,Promise.resolve(ze(this.F)?{s:b}:{s:a,r:'Disconnected'});case tk:return Pk(this);case uk:return Rk(this,c);case vk:return Tk(this,c);case wk:return Vk(this,c);case Mk:return Wk(this,c);case zk:return d.get(olympe.dc.la.j.uq)?Xk(this,c):$k(this,c);case xk:return al(this,c);case yk:return bl(this,c.NF,c.debug,c.optional);case Jk:case Kk:case Lk:case Nk:return Sk(this,b,{});case Gk:return this.j.downloadFileContent(a);case Fk:return this.j.deleteFileContent(a);
|
|
873
873
|
case Hk:return this.j.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===Ak){const c=a.content,d=c.T();return(new rxjs.Observable(e=>{const f=Yk(this,c);this.N.delete(d);this.H.set(d,e);Sk(this,Ck,f).catch(g=>e.error(g))})).pipe(sb(olympe.error.Th,(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);Sk(this,Dk,{i:d}).catch(e=>
|
|
874
874
|
{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);xe(this.F,olympe.L.Ge.Hg,this.ia.bind(this));return this}destroy(){return u(function*(){})}ia(a,b){const c=olympe.dc.Request.j.Go,d=olympe.dc.Request.j.Lm,e=a.c;if(e===olympe.dc.Request.j.ek)cl(this,a,b).then(f=>{Uk(this,e,f)});else if(e===c)b=this.R.j(a.p,a.i),
|
|
875
|
-
b=Pf(b,a.ct),Uk(this,e,{rollback:b,error:a.error});else if(e===Ek){const f=a.i;cl(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&Uk(this,Ik,{id:a.i,finalize:olympe.dc.transaction.Kf.j.Lm,error:0<a.s?a.error:null})}ba(a,b){if(b instanceof olympe.dc.query.na
|
|
875
|
+
b=Pf(b,a.ct),Uk(this,e,{rollback:b,error:a.error});else if(e===Ek){const f=a.i;cl(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&Uk(this,Ik,{id:a.i,finalize:olympe.dc.transaction.Kf.j.Lm,error:0<a.s?a.error:null})}ba(a,b){if(b instanceof olympe.dc.query.na.$h){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.W(),d:c.La()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ba.bind(this,a))}}return{}}};olympe.dc.sources.hs.ya=[olympe.dc.sources.hk];function dl(a,b,c){const d=new olympe.C.Zb(`Source solver ${b.W()}`);b.bb(olympe.dm.Ed.F.ac()).bb(olympe.dm.Ed.D).oe().back().bb(olympe.dm.Ed.j).oe().observe(d,{nd:c,Cc:!0}).subscribe(e=>{e.zj().forEach(([f,g])=>{a.D.set(f.W(),g.T())});e.Fj().forEach(([f])=>{a.D.delete(f)})});b.bb(olympe.dm.hb.D).observe(d,{nd:c,Cc:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Kc())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
|
|
876
876
|
olympe.dc.sources.Wk=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.ea(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}re(a){let b;return null!=(b=this.db.source(a))?b:this.N}jb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ia.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ja(a)&&this.db.Nb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
|
|
877
|
-
!0;var a=new olympe.dc.Ya;Y(a.create(olympe.dm.DataSource,this.j).
|
|
878
|
-
olympe.dc.sources.Config={Mh:'data.httpHost',Cf:'data.httpPort',
|
|
879
|
-
olympe.V.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.Config.Hm),d=`-${olympe.host.Yg.
|
|
880
|
-
return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.Oh.Cf,[olympe.dc.sources.Oh.Mh,olympe.dc.sources.Config.Cf],(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.Oh.
|
|
877
|
+
!0;var a=new olympe.dc.Ya;Y(a.create(olympe.dm.DataSource,this.j).Bi(this.j),olympe.dm.DataSource.ki,!0);a.Oa(olympe.dm.DataSource.Nj,this.j,this.j);a.mb(()=>{olympe.dc.la.from(this.j).observe(olympe.C.nh()).subscribe(()=>{})})}}};olympe.dc.sources.P={Ca:'dc.sources.Logger',sk:'dc.sources.HTTPService',Vu:'dc.sources.IOService',Hr:'dc.sources.RemoteProvider',$r:'dc.sources.ServerProvider',BC:'dc.sources.OfflineProvider',bf:'dc.sources.SourceSolver',Ne:'dc.sources.Serializer',jp:'dc.sources.cache.Cache',kp:'dc.sources.cache.DATABASE',Zl:'dc.sources.cache.Logger'};
|
|
878
|
+
olympe.dc.sources.Config={Mh:'data.httpHost',Cf:'data.httpPort',Si:'data.httpSSL',xm:'data.httpBasePath',Wm:'data.pollingFrequency',We:'data.communicationMode',dn:'data.restrictedUse',VERSION:'version.version',es:'data.streamWorker',ir:'data.queryConcurrencyLimit'};olympe.dc.sources.Oh={fw:'olympe.internal.data.',Mh:'olympe.internal.data.httpHost',Cf:'olympe.internal.data.httpPort',Si:'olympe.internal.data.httpSSL'};
|
|
879
|
+
olympe.V.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.Config.Hm),d=`-${olympe.host.Yg.Xh}`;E(a,olympe.dc.sources.Config.Mh,null);E(a,olympe.dc.sources.Config.Cf,null);E(a,olympe.dc.sources.Config.Si,null);E(a,olympe.dc.sources.Config.xm,'runtime/data');E(a,olympe.dc.sources.Config.es,!1);E(a,olympe.dc.sources.Config.ir,10);Ya(a,olympe.dc.sources.Oh.Mh,[olympe.host.Config.Nk,olympe.L.Config.jm,olympe.dc.sources.Config.Mh],(e,f,g)=>{if(g)return g;e=e===olympe.host.Yg.Xh;
|
|
880
|
+
return f.endsWith(c)&&e?f+d:f});Ya(a,olympe.dc.sources.Oh.Cf,[olympe.dc.sources.Oh.Mh,olympe.dc.sources.Config.Cf],(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.Oh.Si,[olympe.dc.sources.Oh.Cf,olympe.dc.sources.Config.Si],(e,f)=>null!==f?f:443===e);E(a,olympe.dc.sources.Config.Wm,null);E(a,olympe.dc.sources.Config.We,null);E(a,olympe.dc.sources.Config.dn,null);D(a,olympe.dc.sources.P.Ca,[olympe.ha.P.Ea],e=>e.dd('data'));
|
|
881
881
|
C(a,olympe.dc.sources.P.Ne,olympe.dc.sources.cc,olympe.dc.db.P.Ea);Wa(a,olympe.L.P.Ne,olympe.dc.sources.P.Ne);C(a,olympe.dc.sources.P.sk,olympe.dc.sources.Ku,olympe.dc.sources.P.Ca,olympe.net.P.oj,olympe.L.P.rk,olympe.auth.P.Ea,olympe.dc.sources.P.bf,olympe.L.P.Ne,new olympe.V.ma(olympe.L.Config.Ul));C(a,olympe.dc.sources.P.Vu,olympe.dc.sources.tq,olympe.dc.sources.P.Ca,olympe.dc.P.Wg,olympe.net.P.Ea,olympe.auth.P.Ea);C(a,olympe.dc.sources.P.Hr,olympe.dc.sources.Tr,olympe.dc.sources.P.Ca,new olympe.V.ma(olympe.dc.Config.Zg),
|
|
882
882
|
olympe.dc.sources.P.sk,olympe.L.P.wf,olympe.dc.P.Gh,olympe.dc.sources.P.bf);C(a,olympe.dc.sources.P.$r,olympe.dc.sources.hs,olympe.dc.sources.P.Ca,olympe.L.P.Rk,olympe.L.P.wf,olympe.dc.sources.P.sk,new olympe.V.ma(olympe.dc.sources.Config.VERSION),new olympe.V.ma(olympe.dc.sources.Config.ir),new olympe.V.ma(olympe.dc.sources.Config.es));C(a,olympe.dc.sources.P.bf,olympe.dc.sources.Wk,olympe.dc.P.Gh,new olympe.V.ma(olympe.dc.Config.Zg),new olympe.V.ma(olympe.dc.Config.mm));D(a,olympe.dc.sources.P.Zl,
|
|
883
883
|
[olympe.ha.P.Ea],e=>e.dd('datacache'));C(a,olympe.dc.sources.P.jp,olympe.dc.sources.cache.Cache,olympe.dc.sources.P.Zl,olympe.dc.P.Wg,olympe.dc.sources.P.kp,olympe.dc.db.P.Ea,olympe.net.P.Ea,olympe.L.P.wf,olympe.Eb.P.Im,olympe.U.P.Eg,new olympe.V.ma(olympe.net.Config.fr),new olympe.V.ma(olympe.dc.sources.Config.VERSION));C(a,olympe.dc.sources.P.kp,olympe.dc.sources.cache.Ck,olympe.Eb.P.bh,olympe.dc.sources.P.Zl,olympe.Eb.P.uk)},'olympe.dc.sources');
|
|
@@ -904,31 +904,31 @@ function Gl(){const a=olympe.dc.sources.de();return u(function*(){yield Hl(a.j);
|
|
|
904
904
|
olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.Jb=b;this.j=c;this.Ha=d;this.xd=e;this.lb=f;this.Ua=g;this.wa=h;this.version=l;this.Z=this.version!==this.Ua.get('__code-as-data-version__');this.Vb=this.wb=!1;this.D=new Map;this.N=new rxjs.BehaviorSubject([]);this.H=null;this.ba=new rxjs.BehaviorSubject(!1);this.F=new olympe.dc.db.ec;this.Ic=this.Hc=!1;this.ia=[];this.X=0;this.me=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});this.R=
|
|
905
905
|
!1;this.jd=new rxjs.Subject;this.Dd=new olympe.U.promise.ms(k)}Lc(){return this.status.asObservable()}init(){const a=this;return u(function*(){if(!a.Hc)if(a.Ic)yield new Promise(b=>{a.ia.push(b)});else{a.Ic=!0;(yield Il(a.j)).forEach(b=>{a.D.set(b.name,new Set(b.j))});a.N.next(gl(a));yield nl(a);a.Ha.od(Pf(a.F));for(const b of a.ia)b();a.Hc=!0;a.ia=[]}})}executeQuery(a){const b=this;return u(function*(){yield b.init();return sl(b,a.T())&&li(a).some(c=>c instanceof olympe.dc.query.na.Qd)?Jl(b.j,a).then(olympe.U.stream.Xs):
|
|
906
906
|
b.j.executeQuery(a).then(olympe.U.stream.Xs)})}applyTransaction(a,b){const c=this;return u(function*(){c.G.debug('Cache: apply transaction',a,b);yield c.init();const d=a.Yb(),e=Array.from(d.Cb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.H)?void 0:f.j.Cb.keys())?g:[]);let k;b!==(null==(k=c.H)?void 0:k.D)||e.some(l=>!h.includes(l))?(yield Kl(c.j,d,b),c.H=new olympe.dc.sources.cache.ju(d,b),c.ba.next(!0)):(d.rc(c.H.j),yield Kl(c.j,c.H.j,b));d.rc(c.F);yield jl(c.j,d,'local-transaction')})}uploadFileContent(a,
|
|
907
|
-
b,c){const d=this;return u(function*(){yield d.init();yield rl(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return u(function*(){yield b.init();return xl(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return u(function*(){yield b.init();yield Ll(b.j,[a])})}};olympe.dc.sources.cache.ju=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 Il(a){return u(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.kr.Qb(b))})}function ol(a){return u(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.
|
|
907
|
+
b,c){const d=this;return u(function*(){yield d.init();yield rl(d.j,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return u(function*(){yield b.init();return xl(b.j,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return u(function*(){yield b.init();yield Ll(b.j,[a])})}};olympe.dc.sources.cache.ju=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 Il(a){return u(function*(){return(yield a.db.F('buckets')).map(b=>olympe.dc.sources.cache.kr.Qb(b))})}function ol(a){return u(function*(){return(yield a.db.F('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.Wh.Qb(b);return el(b.j)})})}function hl(a,b,c){return u(function*(){a.G.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.D()})}function il(a){return u(function*(){return a.db.D()})}
|
|
908
908
|
function jl(a,b,c){a.G.debug(`Offline DB: Apply patch ${b.T()} on local offline db`);Array.from(b.Cb.keys());return a.db.D().then(()=>{null===c&&(b.Cb.forEach((d,e)=>a.D.add(e)),a.F().then(()=>{}))})}function ql(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)))})})}
|
|
909
|
-
function rl(a,b,c,d){c=new olympe.dc.sources.cache.Tm(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function ul(a,b){return u(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Al(a){return u(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.
|
|
909
|
+
function rl(a,b,c,d){c=new olympe.dc.sources.cache.Tm(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function ul(a,b){return u(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Al(a){return u(function*(){return(yield a.db.F('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.Wh.Qb(c);const d=c.D;let e;const f=null!=(e=b.get(d))?e:[];f.push(el(c.j));b.set(d,f);return b},new Map)})}
|
|
910
910
|
function Bl(a,b){return u(function*(){return a.db.remove('pending-transactions',b.T()).then(()=>{})})}function xl(a,b){return u(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.Tm.Qb(c)})}function Dl(a){return u(function*(){return a.db.F('pending-transactions')})}
|
|
911
|
-
function Fl(a,b){return u(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.
|
|
911
|
+
function Fl(a,b){return u(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.Wh.Qb(d);e&&c.set(e.j.i,d)}yield a.db.ba()})}function Hl(a){return u(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
|
|
912
912
|
function Jl(a,b){return u(function*(){const c=b.jb();a.G.debug(`Offline DB: Executing query ${b.T()} by ID with source ${c}`);const d=olympe.dc.query.Id.yj(b);var e=(yield a.db.H(b.T())).map(f=>olympe.dc.sources.cache.Qg.Qb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.Ck.Xb(f);const g=Ml(f.Nd);d.create(f.tag,e,g);for(const h of f.pb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.fc.ad&&!0===e||d.Oa(k,e?n:f.tag,e?f.tag:n)}}a.G.j()&&
|
|
913
|
-
a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.Yb().Cb.size,'instances',Array.from(d.Yb().Ld()).length,'relations');return d})}function Kl(a,b,c){b=a.N.fa(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.
|
|
913
|
+
a.G.debug(`Offline DB: Data result for query ${b.T()}`,d.Yb().Cb.size,'instances',Array.from(d.Yb().Ld()).length,'relations');return d})}function Kl(a,b,c){b=a.N.fa(b);a.G.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.Wh(c,b,Date.now())).toJSON())}function Nl(a){return u(function*(){return a.db.N('pending-transactions')})}function Ll(a,b){return u(function*(){b.forEach(c=>a.files.delete(c));yield a.db.Z()})}
|
|
914
914
|
function Ml(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,el(d)),new Map)}
|
|
915
915
|
olympe.dc.sources.cache.Ck=class{constructor(a,b,c){this.H=`Olympe_Cache_${a}`;this.G=b;this.N=new olympe.dc.sources.cache.iq;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.U.Promise.vj(()=>{const d=this;return u(function*(){if(!(0===d.D.size||0<(yield Nl(d))))if(0<d.db.X())d.F().then(()=>{}),d.G.debug('Offline DB GC: Postponing round while the stack is busy');
|
|
916
916
|
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 Xb(a){const b=new RegExp(`^(${olympe.dc.fc.ad})>([a-z0-9]*)$`);for(const c of a.pb)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return u(function*(){const c=Date.now();b.G.debug(`Offline DB: Executing query ${a.T()} with source ${a.jb()}`);const d=olympe.dc.query.Id.yj(a),e=a.jb();var f=
|
|
917
|
-
yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Qg.Qb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.Ck.Xb(g),Ml(g.Nd));for(const p of li(a))if(p instanceof olympe.dc.query.na
|
|
917
|
+
yield b.db.get('instances',a.D),g=olympe.dc.sources.cache.Qg.Qb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.Ck.Xb(g),Ml(g.Nd));for(const p of li(a))if(p instanceof olympe.dc.query.na.$h){var k=p.relation;g=k.La()===olympe.dc.va.ORIGIN;const q=k.W(),r=k.ac();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 v of t){const x=new Map;var l=yield Promise.all(Array.from(v).map(y=>{if(!h.has(y))return b.G.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
|
|
918
918
|
Promise.resolve([]);r.W();return b.db.H().then(z=>z.map(A=>olympe.dc.sources.cache.Qg.Qb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.na.Ee&&p.F&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.na.Ee&&!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.Ck.Xb(A),d.create(l,n,Ml(A.Nd)));q===olympe.dc.fc.ad&&!0===g||d.Oa(q,g?l:y,g?y:l)}}}}else p instanceof
|
|
919
919
|
olympe.dc.query.na.Qd&&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.Yb().Cb.size,'instances',Array.from(d.Yb().Ld()).length,'relations'),b.G.debug(`Offline DB: Data result for query ${a.T()} took ${Date.now()-c}ms to be executed`));return d})}};
|
|
920
920
|
olympe.dc.sources.cache.kr=class{constructor(a,b){this.name=a;this.j=b}static Qb(a){return a?new olympe.dc.sources.cache.kr(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.j}}};
|
|
921
921
|
olympe.dc.sources.cache.Qg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Nd=null!=c?c:{};this.pb=null!=d?d:[];this.j=null!=e?e:[]}static Qb(a){return a?new olympe.dc.sources.cache.Qg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Nd,relations:this.pb,queryIds:this.j}}};
|
|
922
|
-
olympe.dc.sources.cache.
|
|
923
|
-
olympe.dc.sources.cache.bw=class extends olympe.dc.sources.cache.
|
|
922
|
+
olympe.dc.sources.cache.Wh=class{constructor(a,b,c){this.D=a;this.j=b;this.timestamp=c}static Qb(a){return a?new olympe.dc.sources.cache.Wh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp}}};
|
|
923
|
+
olympe.dc.sources.cache.bw=class extends olympe.dc.sources.cache.Wh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Qb(a){return a?new olympe.dc.sources.cache.bw(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.D,patch:this.j,timestamp:this.timestamp,error:this.error}}};
|
|
924
924
|
olympe.dc.sources.cache.Tm=class{constructor(a,b,c){this.tag=a;this.content=b;this.j=c}static Qb(a){return a?new olympe.dc.sources.cache.Tm(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.j}}};function Ol(a,b){let c=a.N.get(b);c||(c=new Set(a.j.get(b).pb),a.N.set(b,c));return c}
|
|
925
925
|
olympe.dc.sources.cache.Ou=class{constructor(a,b){this.G=a;this.F=b;this.j=new Map;this.R=new Set;this.X=new Set;this.H=new olympe.dc.sources.cache.iq;this.N=new Map}Xc(){this.R.forEach(a=>this.j.delete(a));Array.from(this.j.entries()).forEach(([a,b])=>{b||this.j.delete(a)});return this.j}Uc(a,b,c){const d=this.j.get(a);d||this.X.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.H.fa(k[1]);return h},null!=(e=null==d?void 0:d.Nd)?e:{});let f;e=null!=(f=null==d?void 0:d.j)?f:[];null===
|
|
926
926
|
this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Qg(a,b,c,null!=(g=null==d?void 0:d.pb)?g:[],e);this.j.set(a,b)}$c(a,b){const c=this.j.get(a);if(c){var d;c.Nd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.H.fa(g);return e},null!=(d=c.Nd)?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.Qg(b,
|
|
927
927
|
'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Qg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=Ol(this,g.tag);k.has(h)||(g.pb.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=Ol(this,f.tag);if(h.has(g)){const k=
|
|
928
|
-
f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Ou.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.
|
|
928
|
+
f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Ou.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Ji=class a{constructor(b,c){this.id=null!=b?b:olympe.U.Mc();this.D=new olympe.C.Zb('BurstTransaction#'+this.id,c);this.wb=Pl(this);this.R=!1;this.D.onDestroy(()=>this.N());this.X=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.Ua=null!=(d=olympe.V.getParameter(olympe.dc.transaction.Config.Fo))?d:30;this.ia=[]}static j(b,c){return`${b},${c}`}Vb(b){for(const c of this.ia)c(b);this.stop()}Ha(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.ba(this.H);0<b.size&&
|
|
929
929
|
Ql(this,b,!1);this.H.clear()}ba(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}Z(b,c,d){this.wa(b,c,d);this.wb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ha.bind(this),this.Ua))}wa(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}lb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.ea(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ea(f),this.lb(d,e)!==g&&this.Z(d,e,g.valueOf())});
|
|
930
930
|
this.X.add(b)}complete(){return new Promise((b,c)=>{this.N((d,e)=>{for(const f of this.X)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ea(b),f=olympe.dc.ea(c);void 0===e||void 0===f?olympe.ha.Wa('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.eo([d],g=>{this.R=!0;if(g instanceof olympe.dc.wc)olympe.ha.Wa('dc').error('Cannot send complex property values in burst transactions');else{var h;this.Z(e,f,null!=(h=null==g?void 0:g.valueOf())?
|
|
931
|
-
h:null)}})}),this.D.Yd(()=>{this.N()}))}stop(){this.D.destroy();this.ia.length=0}getContext(){return this.D}T(){return this.id}wh(){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.ba(new Set(this.F.keys()));Ql(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.
|
|
931
|
+
h:null)}})}),this.D.Yd(()=>{this.N()}))}stop(){this.D.destroy();this.ia.length=0}getContext(){return this.D}T(){return this.id}wh(){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.ba(new Set(this.F.keys()));Ql(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Ji.prototype.complete=olympe.dc.Ji.prototype.complete;olympe.dc.Ji.prototype.push=olympe.dc.Ji.prototype.push;olympe.dc.Sc=class{j(){}toString(){}};olympe.dc.Sc.j=1;olympe.dc.Sc.D=2;olympe.dc.Sc.H=3;olympe.dc.Sc.F=4;olympe.dc.Sc.N=5;olympe.dc.transaction.dj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ia.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.je.Ye+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,
|
|
932
932
|
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.wc(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.Sc.j:b=a.j(d.p||{});let e;c.Uc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Sc.D:c.$c(d.t,
|
|
933
933
|
a.j(d.p),d.m);break;case olympe.dc.Sc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Sc.F:c.Oa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Sc.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 Rl(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.re(b)}function Sl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Wc(b))?void 0:c.Wb())?d:a.db.model(b))?e:null}function Tl(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Se(b)||!a.db.Ja(b)}function Ul(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function Vl(a){return Array.from(a.j.Xc()).filter(b=>!b.Bd()).map(b=>b.tag())}function Wl(a){return Array.from(a.j.Xc()).filter(b=>b.Bd()).map(b=>b.tag())}
|
|
934
934
|
function Xl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ia.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.ec(a.id),a.D.set(b,c)),d(c))}function Yl(a,b,c){const d=Rl(a,b),e=Tl(a,b),f=Sl(a,b);Xl(a,d,e,g=>{g.D(b,c,f)})}
|
|
@@ -937,7 +937,7 @@ e=Rl(this,c);var f=Tl(this,b)&&Tl(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.
|
|
|
937
937
|
b)&&Tl(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.fc.ad&&(olympe.ha.Wa('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);Xl(this,d,f,g=>{g.hc(a,b,c,Sl(this,b),Sl(this,c))})}};function Zl(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.yq.ah)if(e===olympe.dc.Ia.SELF)d[g]=olympe.dc.ga().T();else{if(e===olympe.dc.Ia.SERVER)continue}else g.startsWith(olympe.dc.je.Ye)&&(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 $l(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}
|
|
938
938
|
class am{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Sa||a instanceof olympe.C.da||a instanceof olympe.C.$?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.rh().valueOf(),g:a.oh().valueOf(),b:a.kh().valueOf(),a:a.jh().valueOf()}:a&&'function'===
|
|
939
939
|
typeof a.W?{c:8,t:a.W()}:a}}function Zf(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}
|
|
940
|
-
olympe.dc.transaction.Je=class{constructor({Fl:a=!1,
|
|
940
|
+
olympe.dc.transaction.Je=class{constructor({Fl:a=!1,li:b=!0,ne:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.Fl=null!=a?a:!1;this.ne=null!=c?c:!0;this.li=null!=b?b:!0;this.X=olympe.C?new am:new class extends am{R(d){return d&&'function'===typeof d.W?{c:8,t:d.W()}:d}}}flush(){return JSON.stringify(Zf(this))}Uc(a,b,c,d=null){c=Zl(this.X,null!=c?c:null,this.Fl);c={o:olympe.dc.Sc.j,t:a,p:c};this.li&&(c.s=b);this.ne&&d&&(c.m=d);this.N.push(c);this.Fl&&(b=$l(this.X))&&this.j.push({o:olympe.dc.Sc.D,
|
|
941
941
|
t:a,p:b})}$c(a,b,c=null){b=Zl(this.X,b||null,!1);a={o:olympe.dc.Sc.D,t:a,p:b};this.ne&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Sc.H,t:a,f:b};this.ne&&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.Sc.F,m:a,l:b,r:c};this.ne&&d&&(a.lm=d);this.ne&&
|
|
942
942
|
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.Sc.N,m:a,l:b,r:c};this.ne&&d&&(a.lm=d);this.ne&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.Je.ya=[olympe.dc.Writable];function bm(a){var b=new olympe.dc.Ya;b.X=a;return b}function cm(a,b){b instanceof olympe.dc.Ya&&b.D.forEach((c,d)=>a.D.set(d,c));a.Ga.push(b);return b}
|
|
943
943
|
function dm(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.W(),b);else for(const [f,g]of Object.entries(b))Y(c,f,g);b=c.W();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.W();cm(a,new olympe.dc.transaction.Ga.sp(e,b));cm(a,new olympe.dc.transaction.Ga.gm(e,b,d));return c}
|
|
@@ -948,20 +948,20 @@ if(!e&&!this.F.has(c))throw Error(`Try to remove persistence of an instance that
|
|
|
948
948
|
f);Y(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.je.Ye+d.W(),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}Rs(a,b,c='',{XE:d=olympe.dm.Relation.H.Yv,iF:e=olympe.dm.Relation.j.qw,dF:f=olympe.dm.Relation.j.Yt,GF:g=olympe.dm.Relation.j.kq,UE:h=olympe.dm.Ol.NONE,FF:k=olympe.dm.Relation.N|h}={},l=olympe.U.Mc()){c=Y(Y(Y(Y(Y(Y(Y(Y(Y(Y(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
|
|
949
949
|
c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ba,e),olympe.dm.Relation.wa,e),olympe.dm.Relation.Z,e),olympe.dm.Relation.X,f),olympe.dm.Relation.ia,g),olympe.dm.Relation.Ha,olympe.dm.Relation.j.kq),olympe.dm.Relation.R,h);this.Oa(olympe.dc.CloudObject.Mj,a,c);this.Oa(olympe.dm.Relation.destinationModelRel,c,b);this.Oa(olympe.dc.CloudObject.containsRel,a,c);return c}wh(){return!1}zn(a){this.Z.push(olympe.C.Za().tc(a))}mb(a,b){fm(olympe.dc.Gj(),this,em(this,a),b)}Jn(a){a=
|
|
950
950
|
em(this,a);gm(olympe.dc.Gj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Ya.ya=[olympe.dc.Sc];function Pl(a){var b=olympe.dc.Gj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.ec(c);g.$c(d,(new Map).set(e,f),b.db.model(d));b.j.od(Pf(g,Infinity))}}
|
|
951
|
-
function Ql(a,b,c,d){var e=olympe.dc.Gj();const f=olympe.dc.Request.j.
|
|
951
|
+
function Ql(a,b,c,d){var e=olympe.dc.Gj();const f=olympe.dc.Request.j.Ii,g=olympe.dc.Request.j.Bh,h=a.T();a=a.wh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ia.SELF||!e.db.Se(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.ec(h),k.set(n,p));p.$c(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.mj(n,a)),b=e.Jb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.od(Pf(n,p));null==d||d(!0)})}
|
|
952
952
|
function fm(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);gm(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else gm(a,b,c,!1)}function hm(a){const b=olympe.dc.Request.j.lk;Xf(a.Jb,olympe.dc.Request.j.Go,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.Vb(d));a.j.od(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});Xf(a.Jb,b,c=>{c=c.content;im(a,c.id,c.finalize,c.error)})}
|
|
953
953
|
function jm(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.wa.has(c)||a.Z.push(b);return a}
|
|
954
954
|
function gm(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.jw(a.db,a.ia,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.cr){q.j.then(()=>gm(a,b,c,d));return}c(!1,q.message);return}if(f.pf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=Vl(f);a.j.pe(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Tl(f,q));var k=Wl(f).filter(q=>a.db.Se(q)&&a.db.Nb(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ia.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=Sg(a.j,
|
|
955
|
-
f.j,g),n=olympe.C.Za().tc((q,r)=>c(null!==q,r)),p=[l,n];km(a,f,g).then(q=>{p.splice(1,0,q);lm(a,e,h,f.D.size+1);return mm(a,f.D,d,b.wh(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,v])=>a.N.wa(r,t,v))).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));im(a,e,olympe.dc.transaction.Kf.j
|
|
955
|
+
f.j,g),n=olympe.C.Za().tc((q,r)=>c(null!==q,r)),p=[l,n];km(a,f,g).then(q=>{p.splice(1,0,q);lm(a,e,h,f.D.size+1);return mm(a,f.D,d,b.wh(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,v])=>a.N.wa(r,t,v))).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));im(a,e,olympe.dc.transaction.Kf.j.aj)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));nm(a,e)})}}
|
|
956
956
|
function km(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.W();c=c.filter(n=>{let p;return a.db.Nb(n,olympe.dm.File)&&void 0!==(null==(p=d.Wc(n))?void 0:p.Pa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.W(),g=olympe.dm.File.modificationDateProp.W(),h=Array.from(b.D.values()),k=[],l=olympe.U.kf();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),
|
|
957
957
|
r();else{var v=n.W(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ia(v,q,y,z=>{const A=h.reduce((K,Z)=>K||Z.Wc(v),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.yn(z),k.push([v,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.W());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.$c(q,r);return p},
|
|
958
958
|
new olympe.dc.db.ec);return Sg(a.j,n)})}function lm(a,b,c,d){const e=olympe.C.nh(),f=new olympe.async.Hk(e);0<a.R&&f.bg(a.R);const g=olympe.dc.transaction.Kf.j.Tv;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.tc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});qd(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);nm(a,b)});f.start()}
|
|
959
959
|
function mm(a,b,c,d,e){if(c&&olympe.C.Qa(a.ba.state)!==olympe.auth.Ta.j.tf)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.j.fh:olympe.dc.Request.j.ef;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.mj(h,d,e));return a.Jb.request(g)})).then(g=>g[0])}
|
|
960
|
-
function im(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 nm(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Kf.j
|
|
961
|
-
olympe.dc.transaction.Kf=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Jb=c;this.ia=d;this.N=e;this.ba=f;this.R=g.get('notificationTimeout');this.Z=[];let h;this.wa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.U.
|
|
962
|
-
b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Kf.j={Lm:0
|
|
960
|
+
function im(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 nm(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.Kf.j.aj,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.X)d();a.X=[]}a.D.has(b)&&(c=a.D.get(b),a.D.delete(b),c(!0))}
|
|
961
|
+
olympe.dc.transaction.Kf=class{constructor(a,b,c,d,e,f,g){this.G=a;this.j=b;this.db=b.view;this.Jb=c;this.ia=d;this.N=e;this.ba=f;this.R=g.get('notificationTimeout');this.Z=[];let h;this.wa=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.H=new olympe.U.ci(g.get('burstHoldTime'));this.F=new Map;this.X=[];this.D=new Map;this.Ha=new olympe.U.promise.Xk;hm(this)}ue(a){vb(this.Ha,()=>this.Jb.request(new olympe.dc.Request(olympe.dc.Request.j.Tp,olympe.dc.Ia.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
|
|
962
|
+
b.redo_stack_size)}).catch(b=>this.G.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.Kf.j={Lm:0,aj:1,Tv:2};olympe.dc.transaction.mj=class{constructor(a,b=!1,c=!1){this.D=a;this.F=b;this.j=c}wh(){return this.F}Yb(){return this.D}};olympe.dc.transaction.P={Ca:'dc.transaction.Logger',Ea:'dc.transaction.Manager'};olympe.dc.transaction.Config={Rq:'dc.transaction.timeout',Fo:'dc.transaction.burstInterval',om:'dc.transaction.disabledCompilers'};
|
|
963
963
|
olympe.V.config(function(a){E(a,olympe.dc.transaction.Config.Rq,9E4);E(a,olympe.dc.transaction.Config.Fo,30);E(a,olympe.dc.transaction.Config.om,[]);D(a,olympe.dc.transaction.P.Ca,[olympe.ha.P.Ea],b=>b.dd('dc'));D(a,'olympe.dc.transaction.Config',[new olympe.V.ma(olympe.dc.transaction.Config.Rq),new olympe.V.ma(olympe.dc.transaction.Config.om),new olympe.V.ma(olympe.dc.db.Config.am)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.P.Ea,
|
|
964
|
-
olympe.dc.transaction.Kf,olympe.dc.transaction.P.Ca,olympe.dc.db.P.Ea,olympe.dc.P.Wg,olympe.dc.sources.P.bf,olympe.dc.P.jk,olympe.auth.P.Ea,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Ga={};function om(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Qa(e));return c}olympe.dc.transaction.Ga.Dg=class{constructor(){this.ga=olympe.dc.ga()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Qa(a){a=olympe.C.Qa(a);return void 0===a||null===a?null:olympe.C.pt(a)?a.valueOf():a}};olympe.dc.transaction.Ga.Dg.ya=[olympe.dc.Sc];olympe.dc.transaction.Ga.zo=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.ea(a));this.origin=this.ga.Ja(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.W()}La(){return this.relation.La()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Y(a,b,c){a.Nd.set(olympe.dc.ea(b),c);return a}olympe.dc.transaction.Ga.hp=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ea(b))?c:olympe.U.jf();this.model=olympe.dc.ea(a);this.source=null;this.Nd=new Map}W(){return this.tag}Xb(){return this.model}
|
|
964
|
+
olympe.dc.transaction.Kf,olympe.dc.transaction.P.Ca,olympe.dc.db.P.Ea,olympe.dc.P.Wg,olympe.dc.sources.P.bf,olympe.dc.P.jk,olympe.auth.P.Ea,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Ga={};function om(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Qa(e));return c}olympe.dc.transaction.Ga.Dg=class{constructor(){this.ga=olympe.dc.ga()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Qa(a){a=olympe.C.Qa(a);return void 0===a||null===a?null:olympe.C.pt(a)?a.valueOf():a}};olympe.dc.transaction.Ga.Dg.ya=[olympe.dc.Sc];olympe.dc.transaction.Ga.zo=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ra.Relation?a:new olympe.dc.Ra.Relation(olympe.dc.ea(a));this.origin=this.ga.Ja(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.W()}La(){return this.relation.La()}j(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Y(a,b,c){a.Nd.set(olympe.dc.ea(b),c);return a}olympe.dc.transaction.Ga.hp=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ea(b))?c:olympe.U.jf();this.model=olympe.dc.ea(a);this.source=null;this.Nd=new Map}W(){return this.tag}Xb(){return this.model}Bi(a){this.source=a;return this}j(a){const b=this.Xb(),c=this.W();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Uc(c,b,this.source,om(this,this.Nd))}toString(){return`CreateInstance(${this.Xb()}, ${this.W()})`}};
|
|
965
965
|
olympe.dc.transaction.Ga.hp.ya=[olympe.dc.Ze];olympe.dc.transaction.Ga.gm=class extends olympe.dc.transaction.Ga.zo{constructor(a,b,c){super(a,b);this.D=this.ga.Ja(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.ad)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');
|
|
966
966
|
if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.La()===olympe.dc.va.DESTINATION?a.Oa(b,olympe.dc.ea(this.origin),olympe.dc.ea(this.D)):a.Oa(b,olympe.dc.ea(this.D),olympe.dc.ea(this.origin))}toString(){return`CreateRelation('${this.relation.La()}${this.relation.W()}, ${olympe.dc.ea(this.origin)}, ${olympe.dc.ea(this.D)})`}};olympe.dc.transaction.Ga.lB=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b=olympe.dc.Lb.Ec){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Pb=b}j(a){for(const b of this.ga.Xc(this.model))b!==olympe.dc.ea(this.model)&&(new olympe.dc.transaction.Ga.tp(b,this.Pb)).j(a)}toString(){return`DeleteAllInstances(${this.model.W()}, ${this.Pb})`}};olympe.dc.transaction.Ga.sp=class extends olympe.dc.transaction.Ga.zo{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.ad)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.La(),e=this.ga.cb(c,this.relation);for(const f of e)d===olympe.dc.va.DESTINATION?
|
|
967
967
|
a.hc(b,c,f):a.hc(b,f,c)}toString(){return`DeleteAllRelations(${this.La()}${this.getType()})`}};olympe.dc.transaction.Ga.tp=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b=olympe.dc.Lb.Ec){super();this.tag=this.ga.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}W(){return olympe.dc.ea(this.tag)}j(a){const b=this.W();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ga.Ja(b)&&Yl(a,b,this.Pb)}toString(){return'DeleteInstance('+this.W()+', '+this.Pb+')'}};olympe.dc.transaction.Ga.vu=class extends olympe.dc.transaction.Ga.gm{j(a){const b=this.relation.W();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.fc.ad)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ea(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ea(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
|
|
@@ -973,24 +973,24 @@ olympe.dc.ib.Dn=a=>'number'===typeof a||a instanceof Number?nc(a.valueOf()):'str
|
|
|
973
973
|
olympe.dc.ib.uj=a=>a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.ib.uc=a=>{a=a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.uc():a)?b:null};
|
|
974
974
|
olympe.dc.ib.py=a=>{switch(a){case olympe.C.da:return olympe.dc.ib.Cn;case olympe.C.Sa:return olympe.dc.ib.Fn;case olympe.C.$:return olympe.dc.ib.En;case olympe.C.eb:return olympe.dc.ib.Dn;case olympe.C.Color:return olympe.dc.ib.Ms;case olympe.dc.CloudObject:return olympe.dc.ib.Ns;default:return olympe.dc.ib.uj}};olympe.dc.kc={};olympe.dc.yf=class{ka(){}F(){}compare(){}H(){}fa(){}toString(){}};function pm(a){let b=null;for(a=[...a.aa];null===b&&0<a.length;)b=a.pop().Mb();return b}function qm(a,b){a.N()||(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.ha.Wa('dc').warn(a))}
|
|
975
975
|
olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.ha.Wa('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ua([a],olympe.dc.ea,String),this.aa=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||pm(this),this.j=null,this.Cc=void 0)}te(){return olympe.dc.te()}mb(){if(null===this.j){const a=olympe.dc.kc.Oy();this.j=rm(a,this,this.Cc);null!==this.valueType&&this.j.Sd(this.valueType);olympe.C.Za().Yd(()=>
|
|
976
|
-
{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}nc(){null===this.j&&this.mb();return this.j}Sd(a){this.valueType=a;null!==this.j&&this.j.Sd(this.valueType)}Mb(){return null!==this.j?this.j.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}ce(){return this.D}Dm(){return this.aa}ld(a,b){return this.nc().ld(a,b)}Cl(a){this.nc().Cl(a)}hv(){return this.nc().xd()}gv(){return this.nc().N()}get(a){return this.nc().get(a)}
|
|
977
|
-
this.nc();qm(b,'getCurrent');return b.
|
|
976
|
+
{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}nc(){null===this.j&&this.mb();return this.j}Sd(a){this.valueType=a;null!==this.j&&this.j.Sd(this.valueType)}Mb(){return null!==this.j?this.j.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}ce(){return this.D}Dm(){return this.aa}ld(a,b){return this.nc().ld(a,b)}Cl(a){this.nc().Cl(a)}hv(){return this.nc().xd()}gv(){return this.nc().N()}get(a){return this.nc().get(a)}wi(){return this.nc().wi()}ti(a){const b=
|
|
977
|
+
this.nc();qm(b,'getCurrent');return b.ti(a)}has(a){return this.nc().has(a)}uh(a){const b=this.nc();qm(b,'hasCurrent');return b.uh(a)}se(a){return this.nc().se(a)}Oz(a){return this.se(a).asObservable()}mf(a){const b=this.nc();qm(b,'getCurrentAt');return b.mf(a)}nf(a){return this.nc().nf(a)}Tf(a){const b=this.nc();qm(b,'getCurrentKeyAt');return b.Tf(a)}Kd(a){return this.nc().Kd(a)}Tz(a){return this.Kd(a).asObservable()}Uf(a){const b=this.nc();qm(b,'getCurrentRank');return b.Uf(a)}Kc(){return this.nc().Kc()}Pz(){return this.Kc().asObservable()}Vf(){return this.nc().Vf()}Df(){return this.nc().Df()}Uz(){return this.Df().asObservable()}xg(){const a=
|
|
978
978
|
this.nc();qm(a,'getCurrentSize');return a.xg()}forEach(a,b){this.nc().forEach(a,b)}qe(a){const b=this.nc();qm(b,'forEachCurrentValue');return b.qe(a)}xj(a,b,c,d){a=new olympe.dc.aa.Qh(a,b);(new olympe.dc.Aa(this.D,[...this.aa,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.aa];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
|
|
979
979
|
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.Aa(this.D,a);b.Cc=this.Cc;b.Sd(pm(b)||this.valueType||Object);return b}Kl(a){return this.transform(new olympe.dc.aa.Mf(a))}filter(a){return this.transform(new olympe.dc.aa.Af(a))}gl(){const a=new olympe.dc.vk(this.D,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.Cc&&(a.Cc=this.Cc);
|
|
980
980
|
let b=this.aa;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.aa;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.C.Qa(this.D)+a+')'}fv(){return this.nc().Mg()}Zc(){return olympe.C.ua([this.Df()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.mf(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.C.yb(b+']')},olympe.C.Sa)}};olympe.dc.Aa.prototype.filter=olympe.dc.Aa.prototype.filter;olympe.dc.Aa.prototype.union=olympe.dc.Aa.prototype.Kl;
|
|
981
981
|
olympe.dc.Aa.prototype.transform=olympe.dc.Aa.prototype.transform;olympe.dc.Aa.prototype.forEachCurrentValue=olympe.dc.Aa.prototype.qe;olympe.dc.Aa.prototype.forEach=olympe.dc.Aa.prototype.forEach;olympe.dc.Aa.prototype.getCurrentSize=olympe.dc.Aa.prototype.xg;olympe.dc.Aa.prototype.observeSize=olympe.dc.Aa.prototype.Uz;olympe.dc.Aa.prototype.observeFirst=olympe.dc.Aa.prototype.Pz;olympe.dc.Aa.prototype.getCurrentRank=olympe.dc.Aa.prototype.Uf;olympe.dc.Aa.prototype.observeRank=olympe.dc.Aa.prototype.Tz;
|
|
982
982
|
olympe.dc.Aa.prototype.getCurrentAt=olympe.dc.Aa.prototype.mf;olympe.dc.Aa.prototype.observeAt=olympe.dc.Aa.prototype.Oz;olympe.dc.Aa.prototype.offReady=olympe.dc.Aa.prototype.Cl;olympe.dc.Aa.prototype.onReady=olympe.dc.Aa.prototype.ld;olympe.dc.Aa.prototype.getBaseTag=olympe.dc.Aa.prototype.ce;olympe.dc.Aa.ya=[olympe.C.wd];m=olympe.dc.Aa.prototype;m.te.K=olympe.C.J.j;m.mb.K=olympe.C.J.H();m.nc.K=new olympe.C.J(()=>olympe.dc.kc.Subscription,[]);m.Sd.K=new olympe.C.J(()=>{},[]);
|
|
983
|
-
m.ce.K=new olympe.C.J(()=>String,[]);m.Dm.K=new olympe.C.J(()=>Array,[]);m.ld.K=new olympe.C.J(()=>String,[]);m.Cl.K=new olympe.C.J(()=>{},[]);m.hv.K=olympe.C.J.N;m.gv.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.
|
|
983
|
+
m.ce.K=new olympe.C.J(()=>String,[]);m.Dm.K=new olympe.C.J(()=>Array,[]);m.ld.K=new olympe.C.J(()=>String,[]);m.Cl.K=new olympe.C.J(()=>{},[]);m.hv.K=olympe.C.J.N;m.gv.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.wi.K=new olympe.C.J(()=>Array,[]);m.ti.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.uh.K=olympe.C.J.j;m.se.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.mf.K=olympe.C.J.j;m.nf.K=new olympe.C.J(()=>String,[]);m.Tf.K=olympe.C.J.j;m.Kd.K=olympe.C.J.F;
|
|
984
984
|
m.Uf.K=olympe.C.J.j;m.Kc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Vf.K=new olympe.C.J(()=>String,[]);m.Df.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.qe.K=olympe.C.J.j;m.xj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Kl.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.gl.K=new olympe.C.J(()=>olympe.dc.vk,[]);m.toString.K=olympe.C.J.j;m.fv.K=olympe.C.J.j;m.Zc.K=olympe.C.J.D;const sm={DA:'append',tm:'filter_not',Jp:'filter_and',Kp:'filter_or'};function tm(a,b){a=um(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.ab.Ao(a,b)).D}
|
|
985
|
-
olympe.dc.vk=class{constructor(a,b){this.j=um(a);this.G=olympe.ha.Wa('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.aa=[];this.Ga=[];this.Cc=void 0}
|
|
985
|
+
olympe.dc.vk=class{constructor(a,b){this.j=um(a);this.G=olympe.ha.Wa('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.aa=[];this.Ga=[];this.Cc=void 0}Yi(){const a=new olympe.dc.Aa(this.j,this.aa,this.valueType);'boolean'===typeof this.Cc&&(a.Cc=this.Cc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new vm('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ra.Property)throw new vm('transform','Properties cannot be used as transformer, unlike relations '+
|
|
986
986
|
d);if(!d||'function'!==typeof d.j)throw new vm('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.aa.push(d)}return this}Kl(a){this.aa.push(new olympe.dc.aa.Mf(a));return this}AA(a){this.aa.push(new olympe.dc.aa.Mf(um(a)));return this}kv(a){this.valueType=a;return this}bb(a){this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}jy(a){for(const b of a)this.aa.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}iy(a,
|
|
987
987
|
b,c){a=new olympe.dc.aa.Me(a,a.La(),b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}hy(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.W());void 0===c&&(c=e.La())}a=new olympe.dc.aa.xk(b,c);this.aa.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}jv(){this.bb(olympe.dc.CloudObject.instancesRel);return this}hf(a){var b=this.Ga.pop();b===sm.tm&&(a=new olympe.dc.Y.ke(a),b=this.Ga.pop());switch(b){case sm.Jp:b=this.aa.pop().D;b instanceof
|
|
988
988
|
olympe.dc.Y.Pd?(b=b.Y,b.push(a),a=new olympe.dc.Y.Pd(...b)):a=new olympe.dc.Y.Pd(b,a);b=this.Ga.pop();break;case sm.Kp:b=this.aa.pop().D,b instanceof olympe.dc.Y.He?(b=b.Y,b.push(a),a=new olympe.dc.Y.He(...b)):a=new olympe.dc.Y.He(b,a),b=this.Ga.pop()}b===sm.tm&&(a=new olympe.dc.Y.ke(a),this.Ga.pop());this.aa.push(new olympe.dc.aa.Af(a));return this}ay(a,b,c){return this.hf(new olympe.dc.Y.De(tm(a,c),new olympe.dc.ab.Xe(b)))}contains(a,b,c=!1,d){return this.hf(new olympe.dc.Y.zf(tm(a,d),new olympe.dc.ab.Xe(b),
|
|
989
|
-
c))}Nb(a){if(!(a instanceof Array))throw new vm('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(um(a[c]));return this.hf(new olympe.dc.Y.
|
|
990
|
-
Array))throw new vm('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.La())});return this.hf(new olympe.dc.Y.
|
|
991
|
-
return this.hf(b)}Cd(){this.Ga.push(sm.tm);return this}and(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.Af&&this.Ga.push(sm.Jp);return this}or(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.Af&&this.Ga.push(sm.Kp);return this}Il(a,b,c){a=um(a);let d=null;switch(olympe.dc.ga().Ib(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.W():d=new olympe.dc.xc.String(new olympe.dc.ab.kj(a,c));break;case olympe.dm.Number.O.W():d=new olympe.dc.xc.Number(new olympe.dc.ab.
|
|
992
|
-
new olympe.dc.xc.DateTime(new olympe.dc.ab.
|
|
993
|
-
function um(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.oa.Xb(a):olympe.C.gb(a)?a.
|
|
989
|
+
c))}Nb(a){if(!(a instanceof Array))throw new vm('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(um(a[c]));return this.hf(new olympe.dc.Y.Wi(b))}vl(a){return this.hf(new olympe.dc.Y.De(new olympe.dc.ab.lj,new olympe.dc.ab.Xe(um(a))))}by(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.Cd().vl(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().Cd().vl(a[b])}return this}nz(a,b){if(!(a instanceof
|
|
990
|
+
Array))throw new vm('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.La())});return this.hf(new olympe.dc.Y.Ti(c,d,b))}tl(a,b,c){a=tm(a,c);return this.hf(new olympe.dc.Y.pk(a,new olympe.dc.ab.Xe(b)))}Qj(a,b,c){a=tm(a,c);return this.hf(new olympe.dc.Y.Vk(a,new olympe.dc.ab.Xe(b)))}Fz(a,b,c,d){a=tm(a,d);return this.hf(new olympe.dc.Y.If(a,b,c))}filter(a){const b=new class extends olympe.dc.Y.Cg{j(c,d){return a(olympe.dc.CloudObject.get(d))}};
|
|
991
|
+
return this.hf(b)}Cd(){this.Ga.push(sm.tm);return this}and(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.Af&&this.Ga.push(sm.Jp);return this}or(){this.aa[this.aa.length-1]instanceof olympe.dc.aa.Af&&this.Ga.push(sm.Kp);return this}Il(a,b,c){a=um(a);let d=null;switch(olympe.dc.ga().Ib(a,olympe.dm.Property.typeRel)){case olympe.dm.String.O.W():d=new olympe.dc.xc.String(new olympe.dc.ab.kj(a,c));break;case olympe.dm.Number.O.W():d=new olympe.dc.xc.Number(new olympe.dc.ab.bj(a,c));break;case olympe.dm.DateTime.O.W():d=
|
|
992
|
+
new olympe.dc.xc.DateTime(new olympe.dc.ab.Li(a,c))}c=d;null!==c&&this.aa.push(new olympe.dc.aa.dh(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.xc.Cg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.aa.push(new olympe.dc.aa.dh(d,c));return this}Xx(){this.aa.push(new olympe.dc.aa.Mi);return this}Ij(a,b){this.aa.push(new olympe.dc.aa.Qh(a,b));return this}};class vm extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
|
|
993
|
+
function um(a){return'string'===typeof a||a instanceof olympe.C.Sa?a:'function'===typeof a?olympe.dc.oa.Xb(a):olympe.C.gb(a)?a.hi===olympe.C.Sa?a:olympe.C.ua([a],b=>olympe.C.yb(olympe.dc.ea(b)),olympe.C.Sa):a.W()}m=olympe.dc.vk.prototype;m.Yi.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=olympe.C.J.H();m.Kl.K=olympe.C.J.H();m.AA.K=olympe.C.J.H();m.kv.K=olympe.C.J.H();m.bb.K=olympe.C.J.H();m.jy.K=olympe.C.J.H();m.iy.K=olympe.C.J.H();m.hy.K=olympe.C.J.H();m.jv.K=olympe.C.J.H();m.hf.K=olympe.C.J.H();
|
|
994
994
|
m.ay.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Nb.K=olympe.C.J.H();m.vl.K=olympe.C.J.H();m.by.K=olympe.C.J.H();m.nz.K=olympe.C.J.H();m.tl.K=olympe.C.J.H();m.Qj.K=olympe.C.J.H();m.Fz.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.Cd.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.Il.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.Xx.K=olympe.C.J.H();m.Ij.K=olympe.C.J.H();function rm(a,b,c){const d=b.ce();var e=new olympe.dc.query.iw;let f;f=d;olympe.C.gb(f)&&(f=e.add(d));b=(b=b.Dm())?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}
|
|
995
995
|
function wm(a,b){if(b.N())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.ns(a.db,a.G),d=b.T();olympe.C.Yc([b.ce()],e=>{const f=olympe.dc.ea(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.Qf()||b.ih();Qf(a.db,f,xm(a,b,c),d);olympe.C.Za().Yd(()=>Of(a.db,f,d));a.db.Ja(f.valueOf())||ym(c);b.N()||(ym(c),b.Ic([]))})}}
|
|
996
996
|
function zm(a,b,c,d,e){const f=[b.ce()],g=l=>l instanceof olympe.dc.aa.Mf;let h;const k=(null!=(h=b.sh())?h:[]).filter(g);for(const l of k){f.push(l.ce());let n;k.push(...(null!=(n=l.sh())?n:[]).filter(g))}olympe.C.Yc(f,()=>{const l=b.me(c);Am(a,l,b.T(),d,e)})}
|
|
@@ -1001,22 +1001,22 @@ olympe.dc.kc.Jv=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;th
|
|
|
1001
1001
|
wm(this,a)):zm(this,a,d,e=>{e?this.G.error(e):wm(this,a)},b))}};function Fm(a){return olympe.C.gb(a)?'Node#'+a.Ba.T():String(a)}function Gm(a,b){return olympe.C.gb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
|
|
1002
1002
|
olympe.dc.query.iw=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.gb(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.za=class{ka(){}j(){}D(){}fa(){}toString(){}};olympe.dc.kc.Subscription=class a extends olympe.C.Uj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Zb('context subscription '+b,e));this.id=b;this.jd=c;this.aa=d||null;this.state=this.H.run(()=>olympe.C.ge(olympe.dc.kc.Subscription.j.INIT));this.Hc=!1;this.X=this.Vb=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].fa(d);else e+='|null';e=olympe.U.sb(e)}catch(f){e=olympe.U.Mc()}return e}T(){return this.id}ce(){return this.jd}sh(){return this.aa}ff(){const b=
|
|
1003
1003
|
olympe.dc.fe(),c=olympe.C.Qa(this.ce());let d;return olympe.dc.CloudObject.instancesRel.Fa(null==(d=this.aa)?void 0:d[0])?b.fromModel(c):b.re(c)}Qf(){const b=olympe.C.Qa(this.state);return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.gs}ih(){if(this.state.Ba.fb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Vb;this.Vb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);kc(this.state,olympe.C.ge(olympe.dc.kc.Subscription.j.gs))}xd(){return olympe.C.ua([this.state],
|
|
1004
|
-
()=>{},olympe.C.da)}N(){const b=this.state.Ba.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.
|
|
1004
|
+
()=>{},olympe.C.da)}N(){const b=this.state.Ba.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Zh}ld(b,c){this.N()?b(this):(null===this.X&&(this.X=new Map),void 0===c&&(c=olympe.U.Mc()),this.X.set(c,olympe.C.Za().tc(b)));return c||''}Cl(b){null!==this.X&&b&&this.X.delete(b)}wb(){const b=olympe.dc.kc.Subscription.j.Zh;if(!this.state.Ba.fb()&&olympe.C.Qa(this.state)!==b&&(this.Of(),kc(this.state,b),null!==this.X)){for(const c of this.X.values())c(this);this.X=null}}onDestroy(b){this.H.onDestroy(b)}release(){this.H.destroy()}Ic(b){if(!this.state.Ba.fb()){for(let c=
|
|
1005
1005
|
0,d=b.length;c<d;c++)this.vn(b[c],c);if(this.N())this.Of();else{this.Hc=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.wb()}}}Dd(b,c){if(!this.state.Ba.fb()&&(this.fl(b,olympe.dc.CloudObject.get(c)),b=this.N(),this.Hc&&!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.wb()}}Rf(b){this.state.Ba.fb()||
|
|
1006
1006
|
(this.un(b),this.qj(b,!this.N()))}Mg(){return this.N()?super.Mg():'Subscription is not ready!'}me(b){const c=olympe.C.Qa(this.ce());return olympe.dc.kc.Subscription.D(c,b,this.sh())}static D(b,c,d){var e=olympe.dc.la.from(b,c).oe();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.aa.af){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.bb(h,!0))}else if(e instanceof olympe.dc.aa.Me){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.vg(h,
|
|
1007
|
-
!0,!0))}else if(e instanceof olympe.dc.aa.Mf)e=a.D(olympe.C.Qa(e.ce()),c,e.sh()),b.push(...e);else if(e instanceof olympe.dc.aa.Af||e instanceof olympe.dc.aa.dh){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.vg(n,!0,!0):k.bb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,gs:1,
|
|
1007
|
+
!0,!0))}else if(e instanceof olympe.dc.aa.Mf)e=a.D(olympe.C.Qa(e.ce()),c,e.sh()),b.push(...e);else if(e instanceof olympe.dc.aa.Af||e instanceof olympe.dc.aa.dh){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.vg(n,!0,!0):k.bb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,gs:1,Zh:2};olympe.dc.kc.Subscription.prototype.Mg.K=olympe.C.J.j;function Em(a){const b=a.D;a.D=!0;return b}olympe.dc.kc.Qw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Lf=class{ka(){}Mb(){}j(){}fa(){}toString(){}};olympe.dc.yr=class{F(){}};olympe.dc.cl=class{ka(){}getValue(){}j(){}fa(){}toString(){}};olympe.dc.xc={};let Hm=0;olympe.dc.xc.Cg=class{constructor(){this.id=Hm++}ka(){return'CustomLocalComparator#'+Hm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.xc.Cg.ya=[olympe.dc.yf];olympe.dc.xc.DateTime=class{constructor(a){this.j=a}ka(){return R(olympe.dc.xc.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}fa(a){return'{"c":"'+this.ka()+'",a:['+this.j.fa(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};Q('olympe.dc.comparators.DateTime',olympe.dc.xc.DateTime);olympe.dc.xc.DateTime.ya=[olympe.dc.yf];olympe.dc.xc.Number=class{constructor(a){this.j=a}ka(){return R(olympe.dc.xc.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}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`Number(${this.j.toString()})`}};Q('olympe.dc.comparators.Number',olympe.dc.xc.Number);olympe.dc.xc.Number.ya=[olympe.dc.yf];olympe.dc.xc.String=class{constructor(a){this.j=a}ka(){return R(olympe.dc.xc.String)}H(){return this.j.j()}F(a,b){return olympe.C.ua([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}fa(a){return`{"c":"${this.ka()}",a:[${this.j.fa(a)}]}`}toString(){return`String(${this.j.toString()})`}};Q('olympe.dc.comparators.String',olympe.dc.xc.String);olympe.dc.xc.String.ya=[olympe.dc.yf];olympe.dc.Y={};let Im=0;olympe.dc.Y.Cg=class{constructor(){this.id=Im++}ka(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}fa(){return`{"c":"${this.ka()}"}`}toString(){return this.ka()+'()'}};olympe.dc.Y.Cg.ya=[olympe.dc.za];olympe.dc.Y.Pl=class{constructor(a,b){this.F=a;this.H=b}ka(){}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ua([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.da))}N(){}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return this.ka().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
|
|
1008
1008
|
olympe.dc.Y.Pl.ya=[olympe.dc.za];olympe.dc.Y.Pd=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return R(olympe.dc.Y.Pd)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ua(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.every(d=>d.valueOf())),olympe.C.da))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.Y.map(a=>
|
|
1009
1009
|
a.toString()).join(',')+')'}};Q('olympe.dc.predicates.And',olympe.dc.Y.Pd);olympe.dc.Y.Pd.ya=[olympe.dc.za];olympe.dc.Y.Wl=class{constructor(a,b){this.F=a;this.value=b}j(a,b){return a.run(()=>olympe.C.ua([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.da))}ka(){return R(olympe.dc.Y.Wl)}D(){return[this.value.j()]}fa(a){const b=olympe.C.gb(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();return'{"c":"'+this.ka()+'","a":['+b+','+this.value.fa(a)+']}'}toString(){const a=olympe.C.gb(this.F)?this.F.Ba.Fb.valueOf():this.F.valueOf();
|
|
1010
1010
|
return this.ka().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};Q('olympe.dc.predicates.BitMask',olympe.dc.Y.Wl);olympe.dc.Y.Wl.ya=[olympe.dc.za];olympe.dc.Y.zf=class{constructor(a,b,c){this.source=a;this.value=b;this.F=c?c:!1}ka(){return R(olympe.dc.Y.zf)}D(){return[this.source.j(),this.value.j()]}jb(){return this.source}getValue(){return this.value}j(a,b){return a.run(()=>olympe.C.ua([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.da))}fa(a){const b=this.source.fa(a),c=this.value.fa(a);a=Gm(a,this.F);
|
|
1011
1011
|
return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Fm(this.F);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};Q('olympe.dc.predicates.Contains',olympe.dc.Y.zf);olympe.dc.Y.zf.ya=[olympe.dc.za];olympe.dc.Y.De=class{constructor(a,b){this.F=a;this.H=b}ka(){return R(olympe.dc.Y.De)}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ua([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Md?c.Md(d):'object'===typeof d&&void 0!==d.Md?d.Md(c):olympe.C.Sb(c.valueOf()===d.valueOf()),olympe.C.da,'Test equal predicate'))}fa(a){return'{"c":"'+this.ka()+'","a":['+this.F.fa(a)+','+this.H.fa(a)+']}'}toString(){return'Equals('+this.F.toString()+','+this.H.toString()+
|
|
1012
|
-
')'}};Q('olympe.dc.predicates.Equals',olympe.dc.Y.De);olympe.dc.Y.De.ya=[olympe.dc.za];olympe.dc.Y.xu=class extends olympe.dc.Y.De{constructor(a,b){super(a,new olympe.dc.ab.Xe(b))}};olympe.dc.Y.xu.ya=[olympe.dc.za];olympe.dc.Y.pk=class extends olympe.dc.Y.Pl{constructor(a,b){super(a,b)}ka(){return R(olympe.dc.Y.pk)}N(a,b){return a>b}};Q('olympe.dc.predicates.Greater',olympe.dc.Y.pk);olympe.dc.Y.
|
|
1013
|
-
c.getContext().fb()||c.getContext().kd()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=Km(g[h],e,a,d+h);Qf(e,b,a,d);c.getContext().onDestroy(()=>{Of(e,b,d)});return c.ub()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.pb.map(a=>a.fa()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.pb.map(a=>a.fa())+')'}};Q('olympe.dc.predicates.HasRelated',olympe.dc.Y.
|
|
1014
|
-
function Km(a,b,c,d){const e=Object.create(null);d+=olympe.U.
|
|
1012
|
+
')'}};Q('olympe.dc.predicates.Equals',olympe.dc.Y.De);olympe.dc.Y.De.ya=[olympe.dc.za];olympe.dc.Y.xu=class extends olympe.dc.Y.De{constructor(a,b){super(a,new olympe.dc.ab.Xe(b))}};olympe.dc.Y.xu.ya=[olympe.dc.za];olympe.dc.Y.pk=class extends olympe.dc.Y.Pl{constructor(a,b){super(a,b)}ka(){return R(olympe.dc.Y.pk)}N(a,b){return a>b}};Q('olympe.dc.predicates.Greater',olympe.dc.Y.pk);olympe.dc.Y.Ti=class{constructor(a,b,c){this.pb=[];this.F=c instanceof Array?c:void 0!==c?[olympe.dc.ea(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Me?this.pb.push(new Jm(c.W(),c.La(),c.F,c.D)):this.pb.push(new Jm(olympe.dc.ea(c),b[d],1,1))}ka(){return R(olympe.dc.Y.Ti)}D(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.U.Mc(),e=olympe.dc.ga();let f=0;a=(h,k)=>{0!==this.F.length&&!this.F.includes(k)||
|
|
1013
|
+
c.getContext().fb()||c.getContext().kd()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=Km(g[h],e,a,d+h);Qf(e,b,a,d);c.getContext().onDestroy(()=>{Of(e,b,d)});return c.ub()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.pb.map(a=>a.fa()))+(0!==this.F.length?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.F.length?'#'+this.F.toString()+', ':'')+this.pb.map(a=>a.fa())+')'}};Q('olympe.dc.predicates.HasRelated',olympe.dc.Y.Ti);
|
|
1014
|
+
function Km(a,b,c,d){const e=Object.create(null);d+=olympe.U.si();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,U(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 Jm extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.D=c;this.j=d}fa(){return`${this.W()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Y.Ti.ya=[olympe.dc.za];olympe.dc.Y.ym=class{constructor(a,b,c){this.pb=[];this.F=void 0!==c?c.map(olympe.dc.ea):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.aa.Me?this.pb.push(new Lm(c.W(),c.La(),c.F,c.D)):this.pb.push(new Lm(olympe.dc.ea(c),b[d],1,1))}ka(){return R(olympe.dc.Y.ym)}D(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(Boolean),!1)),d=olympe.dc.ga(),e=olympe.U.si();let f=(k,l,n)=>{l&&(null===this.F||this.F.includes(n))&&k(1)};
|
|
1015
1015
|
const g=this.pb;for(let k=g.length-1;0<=k;k--)f=Mm(g[k],d,f,e+k);let h=0;Qf(d,b,f.bind(null,k=>{c.getContext().kd()||c.getContext().fb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>Of(d,b,e));return c.ub()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(this.pb.map(a=>a.fa()))+(null!==this.F?',"'+this.F.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.F?'#['+this.F.toString()+'], ':'')+this.pb.map(a=>a.fa())+')'}};Q('olympe.dc.predicates.HasRelatedTree',olympe.dc.Y.ym);
|
|
1016
|
-
function Mm(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.U.
|
|
1017
|
-
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&U(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 Lm 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}fa(){return`${this.W()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Y.ym.ya=[olympe.dc.za];olympe.dc.Y.
|
|
1018
|
-
this.F.has(k)?(c.update(olympe.C.da.D),f()):(h=new Nm(k,olympe.dc.CloudObject.extendRel),e.push(h),U(d,h.tag,h.relation,g,h.id))}};a=new Nm(b,olympe.dc.CloudObject.modelRel);e.push(a);U(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.ub()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class Nm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.U.
|
|
1019
|
-
Q('olympe.dc.predicates.InstanceOf',olympe.dc.Y.
|
|
1016
|
+
function Mm(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.U.si();if(q){const v=p+r,x=y=>{const z=f.get(r);if(g.has(v))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(v),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(v)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.D&&c(y=>
|
|
1017
|
+
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.j||n<=a.j)&&r!==p&&U(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 Lm 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}fa(){return`${this.W()}, ${this.La()}, ${this.D}, ${this.j}`}}olympe.dc.Y.ym.ya=[olympe.dc.za];olympe.dc.Y.Wi=class{constructor(a){this.F=new Set;a instanceof Array?a.forEach(b=>{this.F.add(olympe.dc.ea(b))}):this.F.add(olympe.dc.ea(a))}ka(){return R(olympe.dc.Y.Wi)}D(){return[]}j(a,b){const c=a.run(()=>lc(olympe.C.bc(olympe.C.da),olympe.C.da.j)),d=olympe.dc.ga();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.ea(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})`);
|
|
1018
|
+
this.F.has(k)?(c.update(olympe.C.da.D),f()):(h=new Nm(k,olympe.dc.CloudObject.extendRel),e.push(h),U(d,h.tag,h.relation,g,h.id))}};a=new Nm(b,olympe.dc.CloudObject.modelRel);e.push(a);U(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.ub()}fa(){return'{"c":"'+this.ka()+'","a":['+JSON.stringify(Array.from(this.F))+']}'}toString(){return'InstanceOf('+Array.from(this.F).join(', ')+')'}};class Nm{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.U.si()}}
|
|
1019
|
+
Q('olympe.dc.predicates.InstanceOf',olympe.dc.Y.Wi);olympe.dc.Y.Wi.ya=[olympe.dc.za];olympe.dc.Y.ke=class{constructor(a){this.F=a}ka(){return R(olympe.dc.Y.ke)}D(){return this.F.D()}j(a,b){return a.run(()=>olympe.C.ua([this.F.j(a,b)],c=>olympe.C.Sb(!c.valueOf()),olympe.C.da))}fa(a){return`{"c":"${this.ka()}","a":[${this.F.fa(a)}]}`}toString(){return'Not('+this.F.toString()+')'}};Q('olympe.dc.predicates.Not',olympe.dc.Y.ke);olympe.dc.Y.ke.ya=[olympe.dc.za];olympe.dc.Y.He=class{constructor(a){this.Y=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.Y=this.Y.concat(arguments[c]):this.Y.push(arguments[c])}ka(){return R(olympe.dc.Y.He)}D(){return this.Y.reduce((a,b)=>a.concat(b.D()),[])}j(a,b){return a.run(()=>olympe.C.ua(this.Y.map(c=>c.j(a,b)),(...c)=>olympe.C.Sb(c.some(d=>d.valueOf())),olympe.C.da))}fa(a){const b=this.Y.map(c=>c.fa(a));return'{"c":"'+this.ka()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.Y.map(a=>a.toString()).join(',')+
|
|
1020
1020
|
')'}};Q('olympe.dc.predicates.Or',olympe.dc.Y.He);olympe.dc.Y.He.ya=[olympe.dc.za];olympe.dc.Y.If=class{constructor(a,b,c){this.source=a;this.H=b;this.F=void 0===c?!0:c}ka(){return R(olympe.dc.Y.If)}D(){return[this.source.j()]}jb(){return this.source}j(a,b){return a.run(()=>olympe.C.ua([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.da))}fa(a){const b=this.source.fa(a),c=Gm(a,this.H);a=Gm(a,this.F);return'{"c":"'+this.ka()+'","a":['+b+','+c+','+a+
|
|
1021
1021
|
']}'}toString(){const a=Fm(this.F);return'Regex('+this.source.toString()+','+this.H+','+a+')'}};Q('olympe.dc.predicates.Regex',olympe.dc.Y.If);olympe.dc.Y.If.ya=[olympe.dc.za];olympe.dc.Y.Vk=class extends olympe.dc.Y.Pl{constructor(a,b){super(a,b)}ka(){return R(olympe.dc.Y.Vk)}N(a,b){return a<b}};Q('olympe.dc.predicates.Smaller',olympe.dc.Y.Vk);olympe.dc.lc={};olympe.dc.lc.Wj=class{constructor(){this.Z=this.H=this.R=this.D=null}N(){return null!==this.D}X(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.ik(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.Z){const a=[];null!==this.H&&
|
|
1022
1022
|
(0<=this.D?Om(Pm(this.H,this.D),a):a.push(this.R));this.Z(a)}}Ag(a){this.Z=a}};olympe.dc.lc.Wj.ya=[olympe.dc.lc.Ta];function Dm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.lc.ik(a.j,a));return a.D}function Pm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function Om(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.ik=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}te(){return this.j}rg(){this.j.N()?this.j.F():this.j.X(this.depth-1)}};class Qm extends olympe.dc.lc.ik{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.Z=this.X=this.H=!1;this.F=null}}
|
|
@@ -1033,9 +1033,9 @@ function an(a,b){const c=a.F[b];void 0!==c?(a.G&&a.G.debug('Set current block to
|
|
|
1033
1033
|
olympe.dc.lc.ns=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 cn('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=Ym(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 dn(a,b){null===a.D&&(a.D=Object.create(null));a.D[b]=!1}function Xm(a){a.N=!0;null!==a.F&&a.F.notify(a.id)}
|
|
1034
1034
|
class cn{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}rg(a){const b=this.R;if(this.N||this.j===a||null===a)b&&b(),!b&&Xm(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.ab={};function gn(a,b,c,d){const e=olympe.dc.ga(),f=new olympe.dc.lc.Wj,g=new olympe.dc.lc.ns(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,v)=>{a.kd()||a.fb()||(h||(Bm(g,()=>{v.rg();ym(g)}),v.te().Ag(l),h=!0),q?k[t]=r:delete k[t],Cm(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].j(a,g,n);const p=olympe.U.Mc();Qf(e,b,(q,r)=>{g.register(p,null);const t=f.j(q,b,p,null);n(q,r,p,Dm(t,q,b,p))},p);a.onDestroy(()=>{Of(e,b,p)});e.Ja(b)||ym(g)}
|
|
1035
1035
|
function hn(a,b,c){const d=c.getContext(),e=olympe.dc.ga(),f=a.F(),g=ih(e,b,a.H,d.tc(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>jh(e,b,a.H,g))}
|
|
1036
|
-
olympe.dc.ab.
|
|
1037
|
-
b=this.D||b;null!==this.aa?gn(a,b,this.aa,d=>{hn(this,d,c)}):hn(this,b,c);return c.ub()}fa(a){const b=Gm(a,this.H),c=Gm(a,this.D);let d='null';this.aa&&(d=this.aa.map(function(e){return e.fa(a)}).join(','));return`{"c":"${this.ka()}","a":["${b}",${d},${c}]}`}toString(){const a=Fm(this.H),b=this.D?','+Fm(this.D):'';let c='';this.aa&&(c=','+this.aa.join(','));return this.ka().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.ab.
|
|
1038
|
-
b);break;case olympe.dm.Boolean.O.W():d=new olympe.dc.ab.Xj(c,b);break;case olympe.dm.DateTime.O.W():d=new olympe.dc.ab.
|
|
1036
|
+
olympe.dc.ab.Gi=class{constructor(a,b,c){this.H=a&&a.W?a.W():a;this.aa=b&&b.filter(d=>d instanceof olympe.dc.aa.af||d instanceof olympe.dc.aa.Me)||null;this.D=c||null;this.defaultValue=null}ka(){}Mb(){}F(){}j(){return(this.aa||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}zh(a){this.defaultValue=a;return this}sh(){return this.aa}ce(){return this.D}getValue(a,b){const c=a.run(()=>olympe.C.bc(this.Mb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&lc(c,this.defaultValue);
|
|
1037
|
+
b=this.D||b;null!==this.aa?gn(a,b,this.aa,d=>{hn(this,d,c)}):hn(this,b,c);return c.ub()}fa(a){const b=Gm(a,this.H),c=Gm(a,this.D);let d='null';this.aa&&(d=this.aa.map(function(e){return e.fa(a)}).join(','));return`{"c":"${this.ka()}","a":["${b}",${d},${c}]}`}toString(){const a=Fm(this.H),b=this.D?','+Fm(this.D):'';let c='';this.aa&&(c=','+this.aa.join(','));return this.ka().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.ab.Gi.ya=[olympe.dc.cl];olympe.dc.ab.Ao=class{constructor(a,b){if(olympe.C.qf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.W();var d=olympe.dc.ga();const e=d.Ib(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.qh(e,olympe.dc.CloudObject.extendRel,olympe.dm.Ke);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.O.W():d=new olympe.dc.ab.kj(c,b);break;case olympe.dm.Number.O.W():d=new olympe.dc.ab.bj(c,
|
|
1038
|
+
b);break;case olympe.dm.Boolean.O.W():d=new olympe.dc.ab.Xj(c,b);break;case olympe.dm.DateTime.O.W():d=new olympe.dc.ab.Li(c,b)}this.D=d}ka(){return this.D.ka()}j(){return this.D.j()}getValue(a,b){return this.D.getValue(a,b)}fa(a){return this.D.fa(a)}toString(){return this.D.toString()}};olympe.dc.ab.Ao.ya=[olympe.dc.cl];olympe.dc.ab.Xj=class extends olympe.dc.ab.Gi{constructor(a,b,c){super(a,b,c)}ka(){return R(olympe.dc.ab.Xj)}F(){return olympe.dc.ib.Cn}Mb(){return olympe.C.da}};Q('olympe.dc.valuedefs.BooleanProperty',olympe.dc.ab.Xj);olympe.dc.ab.Xe=class{constructor(a){this.value=a}ka(){return R(olympe.dc.ab.Xe)}j(){return[]}getValue(){return this.value}fa(a){a=Gm(a,this.value);return`{"c":"${this.ka()}","a":[${a}]}`}toString(){return`Constant(${Fm(this.value)})`}};Q('olympe.dc.valuedefs.Constant',olympe.dc.ab.Xe);olympe.dc.ab.Xe.ya=[olympe.dc.cl];olympe.dc.ab.Li=class extends olympe.dc.ab.Gi{constructor(a,b,c){super(a,b,c)}ka(){return R(olympe.dc.ab.Li)}F(){return olympe.dc.ib.Dn}Mb(){return olympe.C.eb}};Q('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.ab.Li);olympe.dc.ab.bj=class extends olympe.dc.ab.Gi{constructor(a,b,c){super(a,b,c)}ka(){return R(olympe.dc.ab.bj)}F(){return olympe.dc.ib.En}Mb(){return olympe.C.$}};Q('olympe.dc.valuedefs.NumberProperty',olympe.dc.ab.bj);olympe.dc.ab.kj=class extends olympe.dc.ab.Gi{constructor(a,b,c){super(a,b,c)}ka(){return R(olympe.dc.ab.kj)}F(){return olympe.dc.ib.Fn}Mb(){return olympe.C.Sa}};Q('olympe.dc.valuedefs.StringProperty',olympe.dc.ab.kj);olympe.dc.ab.lj=class{ka(){return R(olympe.dc.ab.lj)}j(){return[]}getValue(a,b){return b}fa(){return'{"c":"'+this.ka()+'","a":[]}'}toString(){return'Tag()'}};Q('olympe.dc.valuedefs.Tag',olympe.dc.ab.lj);olympe.dc.ab.lj.ya=[olympe.dc.cl];olympe.dc.aa={};olympe.dc.aa.Mi=class{Mb(){return null}ka(){return R(olympe.dc.aa.Mi)}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,Dm(h,!0,f,f))):(d[f]++,Zm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Dm(h,!1,f,f)))}}fa(){return'{"c":"'+this.ka()+'"}'}toString(){return'Distinct()'}};Q('olympe.dc.transformers.Distinct',olympe.dc.aa.Mi);olympe.dc.aa.Mi.ya=[olympe.dc.Lf];olympe.dc.aa.Af=class{constructor(a){this.D=a}Mb(){return null}ka(){return R(olympe.dc.aa.Af)}F(){return this.D.D()}j(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&Zm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Dm(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.gb(n)&&(n=n.Ba);olympe.C.Yf(n)?(b.D||void 0!==olympe.C.Qa(n)||Zm(b,h),e[l]=n,a.run(()=>{olympe.C.Yc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
|
|
1039
1039
|
d(g,h,k,!1),delete e[h]}}fa(a){return'{"c":"'+this.ka()+'","a":['+this.D.fa(a)+']}'}toString(){return'Filter('+this.D.toString()+')'}};Q('olympe.dc.transformers.Filter',olympe.dc.aa.Af);olympe.dc.aa.Af.ya=[olympe.dc.Lf,olympe.dc.yr];olympe.dc.aa.um=class{constructor(a,b,c,d){this.D=new olympe.dc.Ra.Relation(olympe.dc.ea(a),c||olympe.dc.va.DESTINATION);this.F=new olympe.dc.Ra.Relation(olympe.dc.ea(b),d||olympe.dc.va.DESTINATION)}Mb(){return jg(this.D)}ka(){return R(olympe.dc.aa.um)}j(a,b,c){const d=olympe.dc.ga(),e={},f=this.D.W(),g=this.D.La(),h=this.F.W(),k=this.F.La();let l=null,n=null;const p=(r,t,v,x,y,z)=>{if(y){if(y=()=>{const A=olympe.U.sb(v+g+(f+'_'+r)+z,20),K=Dm(t,!0,z,A);l=r;n=()=>{c(!1,z,A,Dm(t,!1,z,A))};b.register(A,
|
|
1040
1040
|
v,x,f,g);c(!0,z,A,K)},y.nt=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),Z=K.length,Aa=0;Aa<Z;Aa++){let db=e[K[Aa]];db.nt<y&&(y=db.nt,A=db)}A&&A()}},q=(r,t,v,x,y)=>{x?e[y]||(e[y]=!0,$m(b,v,y,f,g),$m(b,v,y,h,k),U(d,y,this.D,p.bind(this,r,t,v,y),v+'_val'),U(d,y,this.F,q.bind(this,r+1,t,v),v+'_follow')):(d.D(y,this.F,v+'_follow'),d.D(y,this.D,v+'_val'),delete e[y])};return(r,t,v,x)=>q(0,x,v,r,t)}fa(){return'{"c":"'+this.ka()+'","a":["'+this.D.toString()+
|
|
1041
1041
|
'","'+this.F.toString()+'"]}'}toString(){return'FirstRelated('+this.D.toString()+', '+this.F.toString()+')'}};Q('olympe.dc.transformers.FirstRelated',olympe.dc.aa.um);olympe.dc.aa.um.ya=[olympe.dc.Lf];olympe.dc.aa.Qh=class{constructor(a,b){this.start=a;this.D=b}Mb(){return null}ka(){return R(olympe.dc.aa.Qh)}j(a,b,c){const d=new olympe.dc.lc.Jm;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]);Rm(d,e,f,n,c)}};a.run(()=>olympe.C.Yc([this.start,this.D],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));en(b,k);const l=bn(b);an(b,l);return(n,p,q,r)=>{h||(r.te().Ag(t=>{e=t;fn(b,l)}),Bm(b,()=>r.rg(),l),h=!0);d.j(n,p,q,null);Cm(b,q,l)}}fa(a){return'{"c":"'+
|
|
@@ -1048,11 +1048,11 @@ this.ka()+'","a":["'+this.W()+'","'+this.La()+'"]}'}toString(){return'Related('+
|
|
|
1048
1048
|
')'}};Q('olympe.dc.transformers.Sort',olympe.dc.aa.dh);olympe.dc.aa.dh.ya=[olympe.dc.Lf,olympe.dc.yr];function kn(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,Dm(q,n,p,h))}const h=olympe.U.Mc(),k=olympe.dc.ga(),l=a.aa;b.run(()=>olympe.C.Yc([a.D],n=>{ln(k,n,g,h);void 0===k.model(n)&&ym(e)}))}function ln(a,b,c,d){const e=b&&b.valueOf();e&&(Qf(a,e,c,d),olympe.C.Za().Yd(()=>Of(a,e,d)))}
|
|
1049
1049
|
olympe.dc.aa.Mf=class{constructor(a,b){this.aa=this.D=null;a instanceof olympe.dc.Aa?(this.D=a.ce(),this.aa=a.Dm()):(this.D=a,b&&(this.aa=b))}Mb(){return null}ka(){return R(olympe.dc.aa.Mf)||''}sh(){return this.aa}ce(){return this.D}j(a,b,c){const d=new olympe.dc.lc.Jm,e=new olympe.dc.lc.Wj;let f=[],g=[],h=!1,k=!1;const l=bn(b),n=bn(b);en(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):fn(b);Rm(d,p,0,p.length,c)});an(b,n);kn(this,a,this.D,e,b,(p,q,r,t)=>{const v=olympe.C.Za();v.kd()||
|
|
1050
1050
|
v.fb()||(k||(t.te().Ag(x=>{g=x;fn(b,n)}),Bm(b,()=>t.rg(),n),k=!0),d.j(p,q,r),Cm(b,r,n))});an(b,l);return(p,q,r,t)=>{h||(t.te().Ag(v=>{f=v;fn(b,l)}),Bm(b,()=>t.rg(),l),h=!0);d.j(p,q,r,l);Cm(b,r,l)}}fa(a){const b=this.aa?'['+this.aa.map(c=>c.fa(a)).join(',')+']':'null';return'{"c":"'+this.ka()+'","a":['+Gm(a,this.D)+','+b+']}'}toString(){const a=olympe.C.gb(this.D)?'N:'+this.D.Ba.T():this.D.valueOf(),b=this.aa?','+this.aa.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
|
|
1051
|
-
Q('olympe.dc.transformers.Union',olympe.dc.aa.Mf);olympe.dc.aa.Mf.ya=[olympe.dc.Lf];olympe.dc.aa.Rr={WB:1,Qu:-1,Pu:0};olympe.dc.aa.zD={EA:!0,eB:!1};olympe.dc.kc.P={Fq:'dc.legacy.listdefProcessor'};olympe.dc.kc.Config={Eq:'dc.legacy.listdefsCovered'};olympe.V.config(a=>{E(a,olympe.dc.kc.Config.Eq,!1);C(a,olympe.dc.kc.P.Fq,olympe.dc.kc.Jv,olympe.dc.query.P.Ca,olympe.dc.P.Gh,olympe.dc.transaction.P.Ea,olympe.dc.query.P.Jk,new olympe.V.ma(olympe.dc.Config.
|
|
1051
|
+
Q('olympe.dc.transformers.Union',olympe.dc.aa.Mf);olympe.dc.aa.Mf.ya=[olympe.dc.Lf];olympe.dc.aa.Rr={WB:1,Qu:-1,Pu:0};olympe.dc.aa.zD={EA:!0,eB:!1};olympe.dc.kc.P={Fq:'dc.legacy.listdefProcessor'};olympe.dc.kc.Config={Eq:'dc.legacy.listdefsCovered'};olympe.V.config(a=>{E(a,olympe.dc.kc.Config.Eq,!1);C(a,olympe.dc.kc.P.Fq,olympe.dc.kc.Jv,olympe.dc.query.P.Ca,olympe.dc.P.Gh,olympe.dc.transaction.P.Ea,olympe.dc.query.P.Jk,new olympe.V.ma(olympe.dc.Config.bi),new olympe.V.ma(olympe.dc.kc.Config.Eq))});olympe.V.run([olympe.dc.kc.P.Fq],a=>{olympe.dc.kc.Oy=()=>a});function mn(a){const b=olympe.dc.ga(),c=new Map;b.at(a).forEach(d=>{b.cb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
|
|
1052
1052
|
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ga();Object.defineProperty(this,'db',{enumerable:!1});this.model=null;Object.defineProperties(this,{db:{enumerable:!1}})}static Uc(a,b,c,...d){b=olympe.dc.ea(b);var e=Sf(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.W()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.et();a=olympe.dc.ea(a);var c=b.db.model(a);c=Rf(b,c);if(null===
|
|
1053
|
-
c)throw new olympe.dc.jr(a);c=c.instantiate(a,b.D);b.j.pe([a],olympe.dc.db.Instance.j.oq);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ga().Ja(olympe.dc.ea(a))}static Lj(...a){olympe.dc.Ys().Lj(...a)}static Sx(a,b,c){const d=olympe.dc.ga();let e=null;const f=k=>{null===e&&(e=mn(b||this));return e.has(k)?e.get(k):null},g=bm(!1),h=g.create(null!=b?b:this);void 0!==c&&h.
|
|
1053
|
+
c)throw new olympe.dc.jr(a);c=c.instantiate(a,b.D);b.j.pe([a],olympe.dc.db.Instance.j.oq);b.Ra.register(c,a);b=c}return b}static exists(a){return olympe.dc.ga().Ja(olympe.dc.ea(a))}static Lj(...a){olympe.dc.Ys().Lj(...a)}static Sx(a,b,c){const d=olympe.dc.ga();let e=null;const f=k=>{null===e&&(e=mn(b||this));return e.has(k)?e.get(k):null},g=bm(!1),h=g.create(null!=b?b:this);void 0!==c&&h.Bi(c);a.forEach((k,l)=>{d.Ja(olympe.dc.ea(l))?Y(h,l,k):(l=f(l))&&Y(h,l,k)});g.mb((k,l)=>{k||olympe.ha.Wa('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});
|
|
1054
1054
|
return this.get(h)}static Cx(){return this.get(this)}static xl(a){return olympe.dc.la.xl(a)}static Ab(){return olympe.dc.ga().cb(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ra.Property(a))}static Ld(){const a=olympe.dc.ga();return a.cb(this,olympe.dc.CloudObject.Mj).map(b=>new olympe.dc.Ra.Relation(b)).concat(a.cb(this,olympe.dc.CloudObject.Ts).map(b=>new olympe.dc.Ra.Relation(b,olympe.dc.va.ORIGIN)))}static Wc(a){return olympe.dc.CloudObject.get(a)}static ft(a){var b=Rf(olympe.dc.et(),
|
|
1055
|
-
olympe.dc.ea(a));b=b&&b.D;return new olympe.dc.Aa(olympe.dc.ea(a),olympe.dc.CloudObject.instancesRel,b)}W(){return this.tag}name(){return this.db.name(this)}ka(){return this.xb(olympe.dc.CloudObject.nameProp)}Wb(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.la.from(this)}Se(){return this.db.Se(this)}jb(){return this.db.source(this)}Ly(){return this.db.
|
|
1055
|
+
olympe.dc.ea(a));b=b&&b.D;return new olympe.dc.Aa(olympe.dc.ea(a),olympe.dc.CloudObject.instancesRel,b)}W(){return this.tag}name(){return this.db.name(this)}ka(){return this.xb(olympe.dc.CloudObject.nameProp)}Wb(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.la.from(this)}Se(){return this.db.Se(this)}jb(){return this.db.source(this)}Ly(){return this.db.yi(this)?olympe.dc.fe().fromModel(this):null}$s(){return olympe.C.ua([this.ka()],
|
|
1056
1056
|
a=>olympe.C.yb(a),olympe.C.Sa,'getDisplayName',olympe.C.yb('('+this.toString()+')'))}Xb(){return this.model?this.model.W():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Db?a.Db():a;return new rxjs.Observable(e=>{const f=olympe.dc.ib.uc(this.db.Pa(this.tag,b));c||null!==f||e.next(f);const g=ih(this.db,this.tag,b,h=>{e.next(olympe.dc.ib.uc(h))});d.Yd(()=>{e.complete();jh(this.db,this.tag,b,g)});return()=>jh(this.db,this.tag,b,g)})}Rz(a){const b='function'===typeof a.Db?a.Db():
|
|
1057
1057
|
a;return new rxjs.Observable(c=>{const d=kh(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.Yd(()=>{c.complete();lh(this.db,this.tag,d)});return()=>lh(this.db,this.tag,d)})}Sz(a){return this.observe(olympe.C.Za(),a)}get(a){return olympe.dc.ib.uc(this.db.Pa(this.tag,a))}Pa(a){return this.get(a)}bb(a){return olympe.dc.la.from(this).bb(a)}wg(a){return olympe.dc.td.from(this).bb(a)}uc(){return this}vy(){return this.Vc(olympe.dc.CloudObject.Ox,
|
|
1058
1058
|
olympe.dc.CloudObject)}On(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Wf(a,b,c){const d=olympe.C.bc(c,'Sync valueType'),e=ih(this.db,this.tag,a,olympe.C.Za().tc(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>jh(this.db,this.tag,a,e));return d.getContext()}xb(a){return M(this.Wf(a,olympe.dc.ib.Fn,olympe.C.Sa))}Ad(a){return M(this.Wf(a,olympe.dc.ib.En,olympe.C.$))}ph(a){return M(this.Wf(a,olympe.dc.ib.Cn,
|
|
@@ -1065,11 +1065,11 @@ olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olym
|
|
|
1065
1065
|
olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Ab;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.xl;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Cx;olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Sx;olympe.dc.CloudObject.markObsolete=olympe.dc.CloudObject.Lj;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);
|
|
1066
1066
|
olympe.dc.CloudObject.LF=olympe.dc.CloudObject.O.ja(olympe.dc.yq.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.O.ja('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);olympe.dc.CloudObject.wF=olympe.dc.CloudObject.O.ja('ff023000000000000012');olympe.dc.CloudObject.Mj=olympe.dc.CloudObject.O.ta('ff02200000000000000a');olympe.dc.CloudObject.Ts=olympe.dc.CloudObject.O.ta('ff02200000000000000b',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.fF=olympe.dc.CloudObject.O.ta('017e9c4ba4c847d71cbf');
|
|
1067
1067
|
olympe.dc.CloudObject.WE=olympe.dc.CloudObject.O.ta('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.O.ta('ff02200000000000000c');w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.O.ta('ff02200000000000000d',olympe.dc.va.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.O.ta(olympe.dc.fc.ad);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);
|
|
1068
|
-
olympe.dc.CloudObject.instancesRel=S(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.ta(olympe.dc.fc.
|
|
1068
|
+
olympe.dc.CloudObject.instancesRel=S(olympe.dc.CloudObject.O,olympe.dc.CloudObject.modelRel);w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.O.ta(olympe.dc.fc.Ni);w('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=S(olympe.dc.CloudObject.O,olympe.dc.CloudObject.extendRel);w('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);
|
|
1069
1069
|
olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.O.ta(olympe.dc.fc.$j);w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Ox=S(olympe.dc.CloudObject.O,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Ux=olympe.dc.CloudObject.O.ta('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Ux);olympe.dc.BD=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.Ze];m=olympe.dc.CloudObject.prototype;
|
|
1070
1070
|
m.W.K=new olympe.C.J(()=>String,[]);m.name.K=new olympe.C.J(()=>String,[]);m.ka.K=olympe.C.J.D;m.Wb.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.jb.K=new olympe.C.J(()=>String,[]);m.Ly.K=new olympe.C.J(()=>String,[]);m.$s.K=olympe.C.J.D;m.Xb.K=new olympe.C.J(()=>String,[]);m.vy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.On.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Wf.K=new olympe.C.J(()=>olympe.C.Node,[]);m.xb.K=olympe.C.J.D;m.Ad.K=olympe.C.J.F;m.ph.K=olympe.C.J.N;
|
|
1071
|
-
m.Ej.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kt.K=new olympe.C.J(()=>olympe.C.Color,[]);m.lt.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cb.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Vc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ws.K=new olympe.C.J(()=>Function,[]);m.wA.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Zc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;m.Md.K=olympe.C.J.N;m.Vx.K=new olympe.C.J(()=>{},[]);olympe.dc.P={Gh:'dc.DBView',rq:'dc.InstanceManager',Ca:'dc.Logger',Vw:'dc.TransactionLogger',jk:'dc.FileServiceManager',Wg:'dc.Router'};olympe.dc.Config={Zg:'dc.tag',dg:'dc.debug',
|
|
1072
|
-
olympe.V.config(function(a){const b='object'===typeof window;E(a,olympe.dc.Config.dg,!1);E(a,olympe.dc.Config.
|
|
1071
|
+
m.Ej.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kt.K=new olympe.C.J(()=>olympe.C.Color,[]);m.lt.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.cb.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Vc.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.Ws.K=new olympe.C.J(()=>Function,[]);m.wA.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Zc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;m.Md.K=olympe.C.J.N;m.Vx.K=new olympe.C.J(()=>{},[]);olympe.dc.P={Gh:'dc.DBView',rq:'dc.InstanceManager',Ca:'dc.Logger',Vw:'dc.TransactionLogger',jk:'dc.FileServiceManager',Wg:'dc.Router'};olympe.dc.Config={Zg:'dc.tag',dg:'dc.debug',bi:'dc.subscribeAll',mm:'dc.defaultSource',Ip:'dc.fileCache',ip:'dc.dataConsumerOnly',zp:'dc.errorOnAbstractInstantiation'};
|
|
1072
|
+
olympe.V.config(function(a){const b='object'===typeof window;E(a,olympe.dc.Config.dg,!1);E(a,olympe.dc.Config.bi,!1);E(a,olympe.dc.Config.mm,olympe.dc.Ia.SERVER);E(a,olympe.dc.Config.ip,b);E(a,olympe.dc.Config.Ip,b);E(a,olympe.dc.Config.zp,!0);E(a,olympe.dc.Config.Zg,olympe.U.Mc());D(a,olympe.dc.P.Ca,[olympe.ha.P.Ea],c=>c.dd('dc'));Wa(a,olympe.dc.P.Vw,olympe.dc.transaction.P.Ca);Wa(a,olympe.dc.P.Gh,olympe.dc.db.P.im);C(a,olympe.dc.P.jk,olympe.dc.Du,olympe.dc.P.Ca,olympe.dc.db.P.Ea,olympe.net.P.Ea,
|
|
1073
1073
|
olympe.dc.P.Wg,olympe.U.P.Eg,new olympe.V.ma(olympe.dc.Config.Ip));C(a,olympe.dc.P.Wg,olympe.dc.uw,olympe.dc.P.Ca,olympe.dc.sources.P.Hr,olympe.dc.sources.P.$r,olympe.dc.P.Gh,olympe.host.P.Ie,new olympe.V.ma(olympe.dc.Config.Zg),new olympe.V.ma(olympe.dc.Config.ip));C(a,olympe.dc.P.rq,olympe.dc.Wu,olympe.dc.db.P.wm,olympe.dc.db.P.Ea,olympe.V.P.Fg)},'olympe.dc');
|
|
1074
1074
|
olympe.V.run([olympe.dc.db.P.Ea,olympe.dc.transaction.P.Ea,olympe.dc.P.rq,olympe.dc.P.jk,new olympe.V.ma(olympe.dc.Config.Zg)],(a,b,c,d,e)=>{olympe.dc.Ys=()=>a;olympe.dc.Gj=()=>b;olympe.dc.et=()=>c;olympe.dc.bt=()=>d;olympe.dc.Ia.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Vd=class extends olympe.dc.CloudObject{ka(){return this.xb(olympe.dc.CloudObject.nameProp)}j(){return olympe.C.Sa.EMPTY}D(){return olympe.C.da.j}};olympe.dm.Vd.O=olympe.dc.oa.j('ff021000000000000002',olympe.dm.Vd);olympe.dm.Vd.N=olympe.dm.Vd.O.ja('ff023000000000000035');olympe.dm.Vd.j=olympe.dm.Vd.O.ta('ff022000000000000005');olympe.dm.Vd.F=gg('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Vd.H=gg('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
|
|
1075
1075
|
olympe.dm.Vd.D=gg('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Vd.prototype.ka.K=olympe.C.J.D;olympe.dm.Vd.prototype.j.K=olympe.C.J.D;olympe.dm.Vd.prototype.D.K=olympe.C.J.N;olympe.dm.Ol={NONE:0,iB:1,pu:2,jB:4,fB:8,hB:16,gB:31,GC:32,DC:64,HC:128,EC:256,$v:512,FC:992,XB:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Iy(){return this.Sn()}ka(){return this.Sn()}Sn(){return this.xb(olympe.dm.User.loginProp)}mv(){return this.xb(olympe.dm.User.D)}lv(){return olympe.C.Sa.EMPTY}cz(){return this.xb(olympe.dm.User.saltProp)}lz(){return this.xb(olympe.dm.User.verifierProp)}az(){return this.cb(olympe.dm.User.F,olympe.dm.Vd)}};olympe.dm.User.O=olympe.dc.oa.j('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.O.ja('ff023000000000000001');
|
|
@@ -1085,12 +1085,12 @@ olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){supe
|
|
|
1085
1085
|
olympe.error.Zk||e instanceof olympe.error.Nm?b:c)})}init(){const a=this;return u(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return u(function*(){})}healthCheck(){return u(function*(){})}executeQuery(a){return u(function*(){return olympe.dc.query.Id.yj(a)})}applyTransaction(){return u(function*(){})}uploadFileContent(){return u(function*(){throw Error('Should not try to upload files with SELF source');
|
|
1086
1086
|
})}downloadFileContent(){return u(function*(){throw Error('Should not try to download files with SELF source');})}deleteFileContent(){return u(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;
|
|
1087
1087
|
olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;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.Sf;
|
|
1088
|
-
olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.T;olympe.dm.DataSource.prototype.getLowerName=olympe.dm.DataSource.prototype.gt;olympe.dm.DataSource.O=olympe.dc.oa.j('ff021000000000000060',olympe.dm.DataSource,olympe.dc.P.Wg);olympe.dm.DataSource.
|
|
1089
|
-
olympe.dm.DataSource.Os=olympe.dm.DataSource.O.ja('ff023000000000000063');olympe.dm.DataSource.Us=olympe.dm.DataSource.O.ja('ff023000000000000064');olympe.dm.DataSource.kA=olympe.dm.DataSource.O.ja('ff023000000000000065');olympe.dm.DataSource.Nj=olympe.dm.DataSource.O.ta('ff022000000000000060');olympe.dm.DataSource.SERVER=gg('00000000000000000060','Server source');olympe.dm.DataSource.We={aC:'hybrid',Ho:'bus',eq:'http'};olympe.dm.DataSource.pc={
|
|
1088
|
+
olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.T;olympe.dm.DataSource.prototype.getLowerName=olympe.dm.DataSource.prototype.gt;olympe.dm.DataSource.O=olympe.dc.oa.j('ff021000000000000060',olympe.dm.DataSource,olympe.dc.P.Wg);olympe.dm.DataSource.ki=olympe.dm.DataSource.O.ja('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.ki);olympe.dm.DataSource.bF=olympe.dm.DataSource.O.ja('ff023000000000000061');olympe.dm.DataSource.dA=olympe.dm.DataSource.O.ja('ff023000000000000062');
|
|
1089
|
+
olympe.dm.DataSource.Os=olympe.dm.DataSource.O.ja('ff023000000000000063');olympe.dm.DataSource.Us=olympe.dm.DataSource.O.ja('ff023000000000000064');olympe.dm.DataSource.kA=olympe.dm.DataSource.O.ja('ff023000000000000065');olympe.dm.DataSource.Nj=olympe.dm.DataSource.O.ta('ff022000000000000060');olympe.dm.DataSource.SERVER=gg('00000000000000000060','Server source');olympe.dm.DataSource.We={aC:'hybrid',Ho:'bus',eq:'http'};olympe.dm.DataSource.pc={Zh:'ready',Bb:'error',su:'down',Ff:'offline'};olympe.dm.Ed=class extends olympe.dc.CloudObject{};olympe.dm.Ed.O=olympe.dc.oa.j('ff021000000000000070',olympe.dm.Ed);olympe.dm.Ed.j=olympe.dm.Ed.O.ta('ff023000000000000071');olympe.dm.Ed.D=olympe.dm.Ed.O.ta('ff023000000000000072');olympe.dm.Ed.F=olympe.dm.Ed.O.ta('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{H(){return new olympe.dc.Aa(this.W(),[new olympe.dc.aa.Me(olympe.dm.Kb.j.W(),olympe.dc.va.DESTINATION,olympe.dc.aa.Rr.Pu,olympe.dc.aa.Rr.Qu),olympe.dm.Kb.H])}xe(){return olympe.sc.ze.Pe.Cu}j(){return this.cb(olympe.dm.Kb.j,olympe.dm.Kb)}N(){return this.cb(olympe.dm.Kb.H)}};olympe.dm.Kb.O=olympe.dc.oa.j('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.j=olympe.dm.Kb.O.ta('016a697ef00ce7554691');olympe.dm.Kb.ia=S(olympe.dm.Kb.O,olympe.dm.Kb.j);
|
|
1090
1090
|
olympe.dm.Kb.H=olympe.dm.Kb.O.ta('016a697ef00ce7554692');S(olympe.dc.CloudObject.O,olympe.dm.Kb.H);olympe.dm.Kb.prototype.H.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Kb.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Kb.prototype.N.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Tc=class extends olympe.dm.Kb{j(){return this.W()===olympe.dm.Tc.Z?this.cb(olympe.dm.Tc.N,olympe.dm.Kb):this.cb(olympe.dm.Tc.R,olympe.dm.Kb)}};olympe.dm.Tc.O=olympe.dc.oa.j('ff021000000000000020',olympe.dm.Tc);olympe.dm.Tc.R=olympe.dm.Tc.O.ta('017e9c34cf48bd6965c1');olympe.dm.Tc.N=olympe.dm.Tc.O.ta('017e9c2e013e06bfffd9');olympe.dm.Tc.ih=olympe.dm.Tc.O.ta('01811f12ad77673770d4');olympe.dm.Tc.Z=gg('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Tc.jd=gg('10000000000000000001','OLYMPE_FOLDER');
|
|
1091
1091
|
olympe.dm.Tc.Ic=gg('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Tc.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Hy(){return this.xb(olympe.dm.Module.N)}Sy(){return this.Ad(olympe.dm.Module.R)}nv(){return this.xb(olympe.dm.Module.D)}Wy(){return this.xb(olympe.dm.Module.X)}ty(){return this.xb(olympe.dm.Module.F)}Ty(){return this.cb(olympe.dm.Module.H,olympe.dm.Module)}dz(){return this.cb(olympe.dm.Module.j,olympe.dm.Rd)}};olympe.dm.Module.O=olympe.dc.oa.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ja('ff023000000000000042');
|
|
1092
1092
|
olympe.dm.Module.R=olympe.dm.Module.O.ja('ff023000000000000043');olympe.dm.Module.D=olympe.dm.Module.O.ja('ff023000000000000044');olympe.dm.Module.X=olympe.dm.Module.O.ja('ff023000000000000045');olympe.dm.Module.F=olympe.dm.Module.O.ja('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.ja('ff023000000000000049');olympe.dm.Module.j=olympe.dm.Module.O.ta('ff022000000000000013');olympe.dm.Module.H=olympe.dm.Module.O.ta('ff022000000000000014');
|
|
1093
|
-
olympe.dm.Module.Z=gg('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Hy.K=olympe.C.J.D;m.Sy.K=olympe.C.J.F;m.nv.K=olympe.C.J.D;m.Wy.K=olympe.C.J.D;m.ty.K=olympe.C.J.D;m.Ty.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.dz.K=new olympe.C.J(()=>olympe.dc.Aa,[]);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.fe().fromModel(a);a=b.create(a,f).
|
|
1093
|
+
olympe.dm.Module.Z=gg('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Hy.K=olympe.C.J.D;m.Sy.K=olympe.C.J.F;m.nv.K=olympe.C.J.D;m.Wy.K=olympe.C.J.D;m.ty.K=olympe.C.J.D;m.Ty.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.dz.K=new olympe.C.J(()=>olympe.dc.Aa,[]);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.fe().fromModel(a);a=b.create(a,f).Bi(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.W()}constructor(a,b,c,d,e){super(a,
|
|
1094
1094
|
b);this.j=c;this.F=d;this.D=e}ht(){return this.xb(olympe.dm.File.mimeTypeProp)}ll(a,b){void 0===a&&void 0===b||olympe.ha.Wa('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().tc(a),d=b&&olympe.C.Za().tc(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;})}Nn(a,b){void 0===a&&
|
|
1095
1095
|
void 0===b||olympe.ha.Wa('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.Za().tc(a),d=b&&olympe.C.Za().tc(e=>null==b?void 0:b(`${e}`));return this.ll().then(e=>{e=bb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}ml(a,b){void 0===a&&void 0===b||olympe.ha.Wa('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
|
|
1096
1096
|
olympe.C.Za().tc(a),d=b&&olympe.C.Za().tc(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.W()}`;
|
|
@@ -1108,20 +1108,20 @@ olympe.dm.Relation.R=olympe.dm.Relation.O.ja('ff023000000000000031');olympe.dm.R
|
|
|
1108
1108
|
olympe.dm.Relation.H={CC:3,Yv:4,nC:5,mC:6};olympe.dm.Relation.N=olympe.dm.Ol.$v+olympe.dm.Ol.pu;m=olympe.dm.Relation.prototype;m.Ny.K=olympe.C.J.D;m.oy.K=olympe.C.J.F;m.Xy.K=olympe.C.J.F;m.Zs.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.jt.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);function nn(a){a=olympe.dc.ea(a);if(olympe.dc.ga().Xf(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.O.W():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.O.W():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.O.W():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.O.W():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.Ke=class extends olympe.dc.CloudObject{getValue(){}};
|
|
1109
1109
|
olympe.dm.Ke.O=olympe.dc.oa.j('ff021000000000000019',olympe.dm.Ke);olympe.dm.String=class extends olympe.dm.Ke{getValue(){return this.xb(olympe.dm.String.valueProp)}uc(){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.ja('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.K=olympe.C.J.D;
|
|
1110
1110
|
olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.Ke{getValue(){return this.ph(olympe.dm.Boolean.valueProp)}uc(){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.ja('ff023000000000000027');w('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.Ke{getValue(){return this.kt()}uc(){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.ja('ff023000000000000032');w('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.Ke{getValue(){return this.Ej(olympe.dm.DateTime.valueProp)}uc(){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.ja('ff023000000000000029');w('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{ka(){return olympe.C.ua([super.ka(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Sa)}Kd(){return this.Ad(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.oa.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ja('017a7690c915975ea995');olympe.dm.Enum.prototype.Kd.K=olympe.C.J.F;olympe.dm.ig=class extends olympe.dm.BrickMetadata{kz(){return this.bb(olympe.dc.CloudObject.instancesRel).Il(olympe.dm.Enum.rankProp,olympe.dc.query.Fk.ASC).Dc()}static create(a,b){b=a.create(olympe.dm.ig,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Oa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.ig.create=olympe.dm.ig.create;olympe.dm.ig.prototype.getValues=olympe.dm.ig.prototype.kz;olympe.dm.ig.O=olympe.dc.oa.j('017a768f966fc08ebb98',olympe.dm.ig);olympe.dm.Number=class extends olympe.dm.Ke{getValue(){return this.Ad(olympe.dm.Number.valueProp)}uc(){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.ja('ff023000000000000028');w('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',Ok:'sc.RootContext',Ne:'sc.Serializer'};olympe.sc.Config={ie:'sc.app',dg:'sc.debug',uo:'sc.autostartProfiler',np:'sc.debugger',qu:'sc.disableTheme',PRODUCTION:'sc.production',Zv:'sc.onstartTimeout',Gr:'sc.remoteActionTimeout'};
|
|
1111
|
-
olympe.V.config(a=>{E(a,olympe.sc.Config.ie,'');E(a,olympe.sc.Config.dg,!1);E(a,olympe.sc.Config.qu,!0);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.Zv,2E4);E(a,olympe.sc.Config.Gr,3E4);E(a,olympe.sc.Config.uo,!1);D(a,olympe.sc.P.Ca,[olympe.ha.P.Ea],b=>b.dd('sc'));C(a,olympe.sc.P.Ne,olympe.sc.cc,olympe.dc.db.P.Ea);Wa(a,olympe.dc.sources.P.Ne,olympe.sc.P.Ne);D(a,olympe.sc.P.Ok,[new olympe.V.ma(olympe.sc.Config.PRODUCTION)],b=>{const
|
|
1112
|
-
|
|
1111
|
+
olympe.V.config(a=>{E(a,olympe.sc.Config.ie,'');E(a,olympe.sc.Config.dg,!1);E(a,olympe.sc.Config.qu,!0);E(a,olympe.sc.Config.PRODUCTION,!1);E(a,olympe.sc.Config.Zv,2E4);E(a,olympe.sc.Config.Gr,3E4);E(a,olympe.sc.Config.uo,!1);D(a,olympe.sc.P.Ca,[olympe.ha.P.Ea],b=>b.dd('sc'));C(a,olympe.sc.P.Ne,olympe.sc.cc,olympe.dc.db.P.Ea);Wa(a,olympe.dc.sources.P.Ne,olympe.sc.P.Ne);D(a,olympe.sc.P.Ok,[new olympe.V.ma(olympe.sc.Config.PRODUCTION),new olympe.V.ma(olympe.net.Config.Uh)],(b,c)=>{const d=new olympe.sc.Gg('root',
|
|
1112
|
+
'root',null);olympe.sc.fo=d;d.set(olympe.sc.xa.j.PRODUCTION,b&&!c);return new olympe.sc.xa(d)})},'olympe.sc');olympe.V.run([olympe.sc.P.Ok,new olympe.V.ma(olympe.L.Config.$l)],(a,b)=>{olympe.ee().ctx=a;olympe.ee().oVersion=()=>b});olympe.sc.Zn=()=>null!==olympe.dc.ga().Ib(void 0,olympe.sc.Runnable.j.ac());olympe.sc.$E=(a,b,c,d)=>{c=Y(Y(a.create(olympe.sc.hd),olympe.sc.hd.j,c||null),olympe.sc.hd.F,d||null);a.Oa(olympe.sc.hd.D,c,b);a.Oa(olympe.dc.CloudObject.containsRel,b,c);return c.W()};olympe.sc.uj=(a,b)=>{a=olympe.dc.ib.py(b)(a);return a instanceof olympe.sc.Ud?a.j():a};
|
|
1113
1113
|
olympe.sc.rF=function(a){const b=olympe.dc.CloudObject.containsRel.ac();var c=olympe.dc.ea(a);if(void 0===c)return[];a=olympe.dc.ga();const d=[];let e=[];const f=new Set;for(;!a.Nb(c,olympe.dm.Kb);){f.add(c);const g=a.Ib(c,b);if(null===g)return olympe.ha.Wa('sc').warn(`Object ${c} has no container`),[];a.Nb(c,olympe.sc.logic.qb)||g===a.Ib(c,olympe.sc.Runnable.j.ac())||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.qh(e[0],
|
|
1114
|
-
olympe.dm.Kb.ia));e=e.concat(a.qh(e[e.length-1],olympe.dm.Tc.R.ac()));e=e.concat(a.qh(e[e.length-1],olympe.dm.Tc.N.ac()));return[...d,...e].reverse()};olympe.sc.sF=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Lg:a.startsWith('video/')?olympe.sc.
|
|
1115
|
-
olympe.sc.qF=a=>a instanceof olympe.sc.Lg?'image/*':a instanceof olympe.sc.
|
|
1114
|
+
olympe.dm.Kb.ia));e=e.concat(a.qh(e[e.length-1],olympe.dm.Tc.R.ac()));e=e.concat(a.qh(e[e.length-1],olympe.dm.Tc.N.ac()));return[...d,...e].reverse()};olympe.sc.sF=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Lg:a.startsWith('video/')?olympe.sc.fi:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Rc:olympe.dm.File};
|
|
1115
|
+
olympe.sc.qF=a=>a instanceof olympe.sc.Lg?'image/*':a instanceof olympe.sc.fi?'video/*':a instanceof olympe.sc.Rc?'font/*,application/font-woff':null;olympe.sc.$a={};function on(a,b){var c=olympe.sc.xa,d=a.state;a=a.Db();b=olympe.dc.ea(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.ni(a,void 0,b);for(d=f.getParent();d&&d.ia&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||pn(g,b,f)}return new c(f)}function qn(a,b){let c,d;return(a=null!=(d=null==(c=a.state.j)?void 0:c.get(olympe.dc.ea(b)))?d:null)?new olympe.sc.xa(a):null}function rn(a){let b;return null!=(b=a.Qa(olympe.sc.xa.j.PRODUCTION))?b:!1}
|
|
1116
1116
|
olympe.sc.xa=class{constructor(a=olympe.sc.fo){this.state=a;this.G=olympe.ha.Wa('sc');this.j=null}T(){return this.state.T()}getParent(){if(null===this.j){const a=this.state.getParent();this.j=null===a?null:new olympe.sc.xa(a)}return this.j}qy(a){const b=olympe.dc.ga();let c=this.getParent();if(!c)return this;const d=e=>{e=e.lf();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Pa(f,olympe.sc.Va.Z)||a.modelTag&&!b.Nb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;
|
|
1117
1117
|
c=e}return c}lf(){return this.state.lf()}Db(){return this.state.Db()}set(a,b){this.state.set(a,b);return this}oo(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}ub(a,b,c=!1){const d=olympe.dc.ea(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.state.T():void 0));return e.ub()}get(a,b=!1){a=this.Qa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.state.has(a,b)}observe(a,b=!0,c=
|
|
1118
|
-
!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.state.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=sn(this.state,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.yh(a.unsubscribe.bind(a));return this}mA(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.
|
|
1118
|
+
!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.state.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=sn(this.state,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.yh(a.unsubscribe.bind(a));return this}mA(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.ni(`Runner ${a.name()}`);a.run(b);return b}Nt(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,
|
|
1119
1119
|
b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ea(a)})\``+`on the context ${this.T()}:\nStack: ${this.ue()}\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.ea(a)})\` `+`has never received any value:\nStack: ${this.ue()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;
|
|
1120
|
-
const d=(null==(c=a.ue)?void 0:c.call(a))||this.ue();let e,f;c=null!=(f=null==(e=a.Bj)?void 0:e.call(a))?f:0;b=tn(b,c,d);b.stack=a.stack}else b=tn(b,0,this.ue());un(this.state,b);return this}nA(a){this.set(olympe.sc.xa.j.Fg,a);return this}Qa(a,b=!0){return this.state.Qa(a,b)}on(a,b,c,d=!0){return this.state.on(a,b,c,d)}
|
|
1120
|
+
const d=(null==(c=a.ue)?void 0:c.call(a))||this.ue();let e,f;c=null!=(f=null==(e=a.Bj)?void 0:e.call(a))?f:0;b=tn(b,c,d);b.stack=a.stack}else b=tn(b,0,this.ue());un(this.state,b);return this}nA(a){this.set(olympe.sc.xa.j.Fg,a);return this}Qa(a,b=!0){return this.state.Qa(a,b)}on(a,b,c,d=!0){return this.state.on(a,b,c,d)}ni(a){return new olympe.sc.xa(this.state.ni(this.Db(),a))}Dl(a,b){return this.state.Dl(a,c=>{b(new olympe.sc.xa(c))})}Vy(a){a=vn(this.state,a);return a===this.state?this:a&&new olympe.sc.xa(a)}destroy(){this.state.destroy()}yh(a,
|
|
1121
1121
|
b){return this.state.yh(a,b)}Bl(a){this.state.Bl(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.Db().onDestroy(a)}Zf(a){this.fb()||this.Db().Zf(a)}clear(){this.state.clear()}fb(){return this.Db().fb()||this.Db().kd()}Pa(a){a=wn(this.state,a);return null!==a?new olympe.sc.ui.XA(a,this):null}Gy(a){a=wn(this.state,a);return null!==a?new olympe.sc.ui.WA(a,this):null}Qz(...a){return rxjs.combineLatest(a.map(b=>{b=wn(this.state,b);return null!==b?this.observe(b):rxjs.of(null)}))}Fa(a){return(null==
|
|
1122
1122
|
a?void 0:a.constructor)!==this.constructor?!1:this.state===a.state}ue(){const a=olympe.dc.ga();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.state!==olympe.sc.fo;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.lf();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.xa.prototype.observeMany=olympe.sc.xa.prototype.Qz;
|
|
1123
1123
|
olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.Gy;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Pa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.fb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.Zf;olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.Bl;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.yh;
|
|
1124
|
-
olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.Vy;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.Dl;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.
|
|
1124
|
+
olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.Vy;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.Dl;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.ni;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.nA;olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.Nt;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.mA;
|
|
1125
1125
|
olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.oo;olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.qy;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;
|
|
1126
1126
|
olympe.sc.xa.j={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',REDELIVERED:'__redelivered',Fg:'__htmlContainer',kB:'__dockableElement',ro:'__appHasStarted'};olympe.sc.kx=class extends olympe.sc.xa{constructor(a){super(a);this.D=new olympe.C.Zb('SC Update Context',super.Db());const b=a.yh(()=>{b&&a.Bl(b);this.D.destroy()})}Db(){return this.D}yh(a,b){return this.Db().onDestroy(a,null!=b?b:olympe.U.Mc())}};let xn=0;function sn(a,b){b=olympe.dc.ea(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.Z)?void 0:c.get('I#'+b))?e:null==(d=a.Z)?void 0:d.get('IO#'+b))?f:b}function un(a,b){if(null===a.H)a.G.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ba&&olympe.dc.ga().Ja(a.ba)){var c=yn(olympe.dc.CloudObject.get(a.ba));null!==c&&zn(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):un(a.H,b)}else un(a.H,b)}
|
|
1127
1127
|
function vn(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=An(a.j,b);if(c)return c;a=a.getParent()}return null}function Bn(a,b,c=0){null===a.$a&&(a.$a=new Map);a.$a.has(b.T())||(a.$a.set(b.T(),{El:b,depth:c}),Cn(a,d=>{(-1===b.F||c<b.F)&&Bn(d,b,c+1)}),a.onDestroy(()=>{Dn(a,b.T())}));return b.T()}
|
|
@@ -1132,7 +1132,7 @@ function Jn(a){a.wa=!1;let b;null==(b=a.j)||b.forEach(c=>{Jn(c)})}function zn(a,
|
|
|
1132
1132
|
function pn(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Cn(a,f=>{f.N.has(b)||pn(f,b,c)});a.N.delete(b)}function Cn(a,b){let c;null==(c=a.j)||c.forEach(b)}function Mn(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Nn(a){var b=olympe.sc.$a.qc.D.$e;const c=[];if(null!==a.$a)for(const {El:d}of a.$a.values())d.getType()===b&&(c.push(d.T()),d.D(),Dn(a,d.T()))}function Fn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
|
|
1133
1133
|
olympe.sc.Gg=class{constructor(a,b='no name',c=olympe.sc.fo){this.id=a;this.cd=b;this.R=new Set;this.H=c;this.D=new olympe.C.Zb('SC Context');this.data=new Map;this.ba=this.X=this.j=this.F=null;this.ia=!1;this.N=new Set;this.wa=!1;this.Z=null;this.G=olympe.ha.Wa('sc');this.$a=null;En(this)}T(){return this.id}getParent(){return this.H}lf(){return this.ba}set(a,b){if(!this.D.kd()&&!this.D.fb()){const g=olympe.dc.ea(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.Z)?void 0:c.get('O#'+g))?h:null==
|
|
1134
1134
|
(d=this.Z)?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.Fa))try{var f=b.Fa(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.$a&&0<this.$a.size&&Gn(this,olympe.sc.$a.qc.j.$g,a,b),f=zn(this,a),this.N.add(c),Kn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.D.fb()||this.D.kd())return()=>{};const e=sn(this,a),f=c?olympe.dc.ea(c):
|
|
1135
|
-
'*';a=Ln(this,'@'+f+'.'+e,b);c=c?(c=vn(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.C.Za().onDestroy(a);return a}has(a,b=!1){a='$'+sn(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}
|
|
1135
|
+
'*';a=Ln(this,'@'+f+'.'+e,b);c=c?(c=vn(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.C.Za().onDestroy(a);return a}has(a,b=!1){a='$'+sn(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}ni(a,b,c){const d=null!=c?c:'_'+olympe.U.Mc();if(a.fb()||a.kd())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.Gg(d,
|
|
1136
1136
|
b,this));null!==this.$a&&0<this.$a.size&&this.$a.forEach(({El:f,depth:g})=>{(-1===f.F||g<f.F)&&Bn(e,f,g+1)});return e}Dl(a,b){const c=vn(this,a);if(c)return b(c),()=>{};const d=Ln(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Qa(a,b=!0){a='$'+sn(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.kd()||this.D.fb()||(Gn(this,olympe.sc.$a.qc.j.fk),this.D.destroy(),Gn(this,olympe.sc.$a.qc.j.$d))}yh(a,b){if(this.D.fb())a();
|
|
1137
1137
|
else return xn++,b=null!=b?b:String(xn),null===this.X&&(this.X=new Map),this.X.set(b,a),b;return b||'noId'}Bl(a){null!==this.X&&this.X.delete(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.fb()){Gn(this,olympe.sc.$a.qc.j.Yj);let a;null==(a=this.X)||a.forEach(b=>b());Gn(this,olympe.sc.$a.qc.j.Zj)}}fb(){return this.D.fb()}Db(){return this.D}};olympe.sc.Gg.prototype.getParent=olympe.sc.Gg.prototype.getParent;olympe.sc.Gg.j={Am:'I#',Rm:'O#',dC:'IO#'};function On(a,b,c){return(c=c.lf())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.$a.qc=class{constructor(a=-1){this.id=olympe.U.jf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.$a.qc.j={INIT:'INIT',$g:'SET',Yj:'CLEAR',Zj:'CLEARED',fk:'DESTROY',$d:'DESTROYED'};olympe.sc.$a.qc.D={$e:'REMOTE',Dv:'LOCAL',lg:'PROFILER'};olympe.sc.ae=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.U.pn(1E4);gb(this.j,b=>{Nn(b)})}Z(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.ae.j.dw:c=this.F.get(e.f);b.Oc(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.ae.j.ew:const h=f+c,k=(l,n,p=0)=>{Mn(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let v;q=null!=(v=l.lf())?v:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
|
|
1138
1138
|
t])})};b.bo(h).then(()=>{const l=[];k(g,l,0);Cn(g,p=>{k(p,l,1)});olympe.L.rb.md(h,{t:olympe.sc.ae.j.Tu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.$a.tw(h);Bn(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.ae.j.ej:void 0!==g&&this.j.has(g)&&fb(this.j,g);break;case olympe.sc.ae.j.Ih:void 0!==g&&(this.j.delete(g),Nn(g))}}ba(b,c,d){this.N=new olympe.L.rb('discovery_debug_id',
|
|
@@ -1144,36 +1144,36 @@ q)}}
|
|
|
1144
1144
|
olympe.sc.$a.mw=class extends olympe.sc.$a.qc{constructor(a){super();this.j=a;this.ga=olympe.dc.ga();this.H=new Set}getType(){return olympe.sc.$a.qc.D.lg}process(a,b,c,...d){var e=Qn.Am,f=Qn.Rm,g=Qn.hw;const h=Qn.INIT,k=Qn.Yj,l=Qn.Zj,n=Qn.fk,p=Qn.$d;c=Qn.aw;if(b===olympe.sc.$a.qc.j.$g){const [q,r]=d;b=(d=a.lf())?olympe.dc.ga().Nb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ga().Nb(d,olympe.sc.ui.cD):!1;b?(g=this.ga.Ib(q,olympe.dm.Property.typeRel),b=this.ga.Nb(q,olympe.sc.logic.vb),d=this.ga.Nb(q,olympe.sc.logic.Gb),
|
|
1145
1145
|
Pn(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ga.Nb(q,olympe.dm.Property),f=this.ga.Ib(q,olympe.dm.Property.typeRel),Pn(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.$a.qc.j.INIT?Pn(this,a,h):b===olympe.sc.$a.qc.j.Yj?Pn(this,a,k):b===olympe.sc.$a.qc.j.Zj?Pn(this,a,l):b===olympe.sc.$a.qc.j.fk?Pn(this,a,n):b===olympe.sc.$a.qc.j.$d&&Pn(this,a,p)}};
|
|
1146
1146
|
const Qn={Am:'input',Rm:'output',hw:'prop',INIT:'init',Yj:'clear',Zj:'cleared',fk:'destroy',$d:'destroyed',aw:'other'};olympe.sc.$a.tw=class extends olympe.sc.$a.qc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ga()}getType(){return olympe.sc.$a.qc.D.$e}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.$a.qc.j.$g&&void 0!==d[0]&&null!==d[0]){const e=On(c,sn(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.Bc){const h=kh(this.db,f,()=>{olympe.sc.ae.D(this.H,
|
|
1147
|
-
e,f)});this.j.set(e,()=>{lh(this.db,f,h)})}olympe.sc.ae.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{ov(){return this.Ad(this.Un())}pv(){return this.Ad(this.Vn())}ql(){return new olympe.C.$b(this.Ad(this.Un()),this.Ad(this.Vn()))}Un(){}Vn(){}};olympe.sc.Metadata.O=olympe.dc.oa.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.ov.K=olympe.C.J.F;m.pv.K=olympe.C.J.F;m.ql.K=olympe.C.J.R;m.Un.K=olympe.C.J.j;m.Vn.K=olympe.C.J.j;olympe.sc.hd=class extends olympe.dc.CloudObject{D(){return this.xb(olympe.sc.hd.F)}j(){return this.xb(olympe.sc.hd.j)}};olympe.sc.hd.O=olympe.dc.oa.j('01703376c4a81c0e9d90',olympe.sc.hd);olympe.sc.hd.F=olympe.sc.hd.O.ja('01703376c4a81c0e9d91');olympe.sc.hd.j=olympe.sc.hd.O.ja('01703376c4a81c0e9d92');olympe.sc.hd.D=olympe.sc.hd.O.ta('01703376c4a81c0e9d93');S(olympe.dc.CloudObject.O,olympe.sc.hd.D);olympe.sc.hd.prototype.D.K=olympe.C.J.D;olympe.sc.hd.prototype.j.K=olympe.C.J.D;olympe.sc.ze={};olympe.sc.ze.Pe={Cu:'folders',xw:'screenflow',Zw:'ui-design',ds:'software-intelligence',Fh:'data-management',QC:'projects'};olympe.sc.Hf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Kd(){return this.Ad(olympe.sc.Hf.D)}};olympe.sc.Hf.O=olympe.dc.oa.j('019131fb930466a1ad79',olympe.sc.Hf);olympe.sc.Hf.D=olympe.sc.Hf.O.ja('016d1bb681929c2cc3f1');olympe.sc.Hf.j=olympe.sc.Hf.O.ta('019131fb930466a1ad7a');S(olympe.dc.CloudObject.O,olympe.sc.Hf.j);olympe.sc.Hf.prototype.Kd.K=olympe.C.J.F;olympe.sc.ud=class extends olympe.dm.BrickMetadata{xe(){return olympe.sc.ze.Pe.ds}j(){return this.cb(olympe.sc.ud.j,olympe.sc.logic.
|
|
1147
|
+
e,f)});this.j.set(e,()=>{lh(this.db,f,h)})}olympe.sc.ae.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{ov(){return this.Ad(this.Un())}pv(){return this.Ad(this.Vn())}ql(){return new olympe.C.$b(this.Ad(this.Un()),this.Ad(this.Vn()))}Un(){}Vn(){}};olympe.sc.Metadata.O=olympe.dc.oa.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.ov.K=olympe.C.J.F;m.pv.K=olympe.C.J.F;m.ql.K=olympe.C.J.R;m.Un.K=olympe.C.J.j;m.Vn.K=olympe.C.J.j;olympe.sc.hd=class extends olympe.dc.CloudObject{D(){return this.xb(olympe.sc.hd.F)}j(){return this.xb(olympe.sc.hd.j)}};olympe.sc.hd.O=olympe.dc.oa.j('01703376c4a81c0e9d90',olympe.sc.hd);olympe.sc.hd.F=olympe.sc.hd.O.ja('01703376c4a81c0e9d91');olympe.sc.hd.j=olympe.sc.hd.O.ja('01703376c4a81c0e9d92');olympe.sc.hd.D=olympe.sc.hd.O.ta('01703376c4a81c0e9d93');S(olympe.dc.CloudObject.O,olympe.sc.hd.D);olympe.sc.hd.prototype.D.K=olympe.C.J.D;olympe.sc.hd.prototype.j.K=olympe.C.J.D;olympe.sc.ze={};olympe.sc.ze.Pe={Cu:'folders',xw:'screenflow',Zw:'ui-design',ds:'software-intelligence',Fh:'data-management',QC:'projects'};olympe.sc.Hf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Kd(){return this.Ad(olympe.sc.Hf.D)}};olympe.sc.Hf.O=olympe.dc.oa.j('019131fb930466a1ad79',olympe.sc.Hf);olympe.sc.Hf.D=olympe.sc.Hf.O.ja('016d1bb681929c2cc3f1');olympe.sc.Hf.j=olympe.sc.Hf.O.ta('019131fb930466a1ad7a');S(olympe.dc.CloudObject.O,olympe.sc.Hf.j);olympe.sc.Hf.prototype.Kd.K=olympe.C.J.F;olympe.sc.ud=class extends olympe.dm.BrickMetadata{xe(){return olympe.sc.ze.Pe.ds}j(){return this.cb(olympe.sc.ud.j,olympe.sc.logic.Yh)}D(){return this.cb(olympe.sc.ud.D,olympe.sc.logic.Tg)}};olympe.sc.ud.O=olympe.dc.oa.j('011100000000000adef0',olympe.sc.ud);olympe.sc.ud.j=olympe.sc.ud.O.ta('016ac4f59a2917fdef01');olympe.sc.ud.D=olympe.sc.ud.O.ta('016ac4f59a2917fdef02');olympe.sc.ud.O.j=(a,b)=>dm(a,b||'New function signature',olympe.sc.ud,olympe.sc.logic.Fd).W();
|
|
1148
1148
|
olympe.sc.ud.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.ud.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function Rn(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Sn(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Nb(c,olympe.sc.logic.Tb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Pa(c,olympe.sc.logic.Tb.j,!0))?e:0;let f;d=null!=(f=a.db.Pa(d,olympe.sc.logic.Tb.j,!0))?f:0;return c-d});return b}function Tn(a){return Sn(a,a.db.cb(a.tag,olympe.sc.Va.F))}function Un(a){return Sn(a,a.db.cb(a.tag,olympe.sc.Va.D))}
|
|
1149
|
-
olympe.sc.Va=class extends olympe.dm.BrickMetadata{rv(a,b,c,d,e=!0){e||olympe.ha.Wa('sc').error('parameter own= false ignored, investigate');return olympe.C.zh(M(this.Wf(a,olympe.dc.ib.uj,c)),d)}H(){return[]}F(){return rxjs.of([])}bz(){return this.cb(olympe.sc.Va.H,olympe.sc.Runnable)}uy(){return this.cb(olympe.sc.Va.R,olympe.sc.Runnable)}
|
|
1149
|
+
olympe.sc.Va=class extends olympe.dm.BrickMetadata{rv(a,b,c,d,e=!0){e||olympe.ha.Wa('sc').error('parameter own= false ignored, investigate');return olympe.C.zh(M(this.Wf(a,olympe.dc.ib.uj,c)),d)}H(){return[]}F(){return rxjs.of([])}bz(){return this.cb(olympe.sc.Va.H,olympe.sc.Runnable)}uy(){return this.cb(olympe.sc.Va.R,olympe.sc.Runnable)}xi(){return this.db.Pa(this,olympe.sc.Va.Z)}Zn(){return null!==this.db.Ib(this.tag,olympe.sc.Runnable.j.ac())}qv(){return this.cb(olympe.sc.Va.F,olympe.sc.logic.vb)}Cq(){return this.cb(olympe.sc.Va.D,
|
|
1150
1150
|
olympe.sc.logic.Gb)}N(){return[olympe.sc.Va.Ua]}};olympe.sc.Va.O=olympe.dc.oa.j('0112000000000000def0',olympe.sc.Va);olympe.sc.Va.Z=olympe.sc.Va.O.ja('01692aa71f3108454479');olympe.sc.Va.lb=olympe.sc.Va.O.ja('0166446c1f128ebc903a');olympe.sc.Va.Ua=olympe.sc.Va.O.ja('0166446c1f128ebc904e');olympe.sc.Va.H=olympe.sc.Va.O.ta('01692a4af82e8984742c');olympe.sc.Va.R=olympe.sc.Va.O.ta('01692a4af82e8984742d');olympe.sc.Va.X=olympe.sc.Va.O.ta('01692a4af82e8984742e');olympe.sc.Va.F=olympe.sc.Va.O.ta('01621fb84e320000f00a');
|
|
1151
|
-
olympe.sc.Va.D=olympe.sc.Va.O.ta('01621fb84e320000f00b');olympe.sc.Va.xd=olympe.sc.Va.O.ta('0171838bcfed0000e00e');olympe.sc.Va.jd=olympe.sc.Va.O.ta('0171838bcfed0000a00a');m=olympe.sc.Va.prototype;m.rv.K=olympe.C.J.j;m.bz.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.uy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.
|
|
1151
|
+
olympe.sc.Va.D=olympe.sc.Va.O.ta('01621fb84e320000f00b');olympe.sc.Va.xd=olympe.sc.Va.O.ta('0171838bcfed0000e00e');olympe.sc.Va.jd=olympe.sc.Va.O.ta('0171838bcfed0000a00a');m=olympe.sc.Va.prototype;m.rv.K=olympe.C.J.j;m.bz.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.uy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.xi.K=olympe.C.J.j;m.Zn.K=olympe.C.J.j;m.qv.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Cq.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function yn(a){let b;return null!=(b=a.yd().N().map(olympe.dc.ea)[0])?b:null}function Vn(a){const b=new olympe.dc.Ya;a=b.create(a);b.persist(a,!1);b.mb((d,e)=>{d||olympe.ha.Wa('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.Za().onDestroy(()=>{const d=new olympe.dc.Ya;d.delete(c);d.mb()});return c}
|
|
1152
1152
|
function Wn(a,b){Hn(b.state,a);Rn(a.yd(),b);const c=a.R(),d=Xn(b,c),e=[];c.forEach((f,g)=>{f===a.ia?e[0]=g:f===a.ba&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Yn(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])})}
|
|
1153
1153
|
function Zn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.Xb()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=$n(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.fb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.kx(b.state);l.Db().run(()=>u(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`)));
|
|
1154
1154
|
b.onDestroy(g.unsubscribe.bind(g))}function ao(a,b,c,d){let e=[];const f=U(a.db,b,c,(g,h)=>{if(g){const k=on(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.gd&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=qn(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Db().onDestroy(a.db.D.bind(a.db,b,c,f))}function $n(a,b){return a.yd().H(b)}
|
|
1155
1155
|
function Xn(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 Yn(a,b,c,d){b=b.Db();const e=kh(a.db,a.tag,b.tc((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.ib.uc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{lh(a.db,a.tag,e)})}
|
|
1156
|
-
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Db().run(()=>{Wn(this,a);this.init(a);a.yh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));Zn(this,a);this.F(a)})}yd(){return this.Wb()}init(a){this.onInit(a)}update(a,b,c){const d=this.yd();if(d.
|
|
1156
|
+
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.G=c}run(a){a.Db().run(()=>{Wn(this,a);this.init(a);a.yh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));Zn(this,a);this.F(a)})}yd(){return this.Wb()}init(a){this.onInit(a)}update(a,b,c){const d=this.yd();if(d.xi())this.onUpdate(a,b,c);else this.G.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.T()}`),ao(this,d,olympe.sc.Va.H,a),this.wa()&&ao(this,
|
|
1157
1157
|
d,olympe.sc.Va.X,a)}F(a){a.oo(olympe.sc.Va.lb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(a){return this.yd().F(a)}onInit(){}onUpdate(){const a=this.Xb(),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 Tn(this.yd())}getOutputs(){return Un(this.yd())}H(){return[]}D(){return null}wa(){return!1}N(a,
|
|
1158
1158
|
b,c,d){a=b.ub(a,c,!0);void 0!==d&&olympe.C.zh(a,d);return a}Ua(a,b,c,d,e){olympe.C.eo([d],f=>{b.set(a,olympe.C.pt(f)?f.valueOf():f)});return this.N(a,b,c,e)}R(){return[this.ia,this.ba]}ia(a,b){Yn(this,a,b,null)}ba(a,b){Yn(this,a,null,b)}lb(a,b){const c=this.db,d=olympe.sc.logic.qb.F.ac(),e=olympe.sc.logic.qb.D,f=olympe.sc.logic.qb.j;this.Ws(d,g=>{var h=g.W();if(h=c.Ib(h,e)||c.Ib(h,f))return bo(g,a,b.bind(null,h))})}};olympe.sc.Runnable.O=lg(olympe.dc.oa.j('01130000000000ca1100',olympe.sc.Runnable));
|
|
1159
1159
|
olympe.sc.Runnable.D=olympe.sc.Runnable.O.ta('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.ta('01756a18d4921c103111');olympe.sc.Runnable.N=S(olympe.sc.Runnable.O,olympe.sc.Va.H);olympe.sc.Runnable.R=S(olympe.sc.Runnable.O,olympe.sc.Va.R);olympe.sc.Runnable.X=S(olympe.sc.Runnable.O,olympe.sc.Va.X);S(olympe.sc.Va.O,olympe.sc.Runnable.D);S(olympe.sc.Va.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.yd.K=new olympe.C.J(()=>olympe.sc.Va,[]);
|
|
1160
1160
|
olympe.sc.Runnable.prototype.N.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.Ua.K=olympe.C.J.j;function co(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Ud)return(a=a.D())?a.valueOf():null;if('function'===typeof a.W)return a.W()}return null}olympe.sc.Ud=class extends olympe.dc.CloudObject{D(){return this.db.cb(this,olympe.sc.Ud.j)[0]}j(){const a=co(this);return olympe.dc.CloudObject.get(a)}uc(){return this.j().uc()}toString(){const a=co(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ud.O=olympe.dc.oa.j('0163c9ae01f2d6e9ca49',olympe.sc.Ud);
|
|
1161
1161
|
olympe.sc.Ud.j=olympe.sc.Ud.O.ta('0169b5a8a33144fb0b49');S(olympe.dc.CloudObject.O,olympe.sc.Ud.j);olympe.sc.Ud.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Ud.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.rp=class extends olympe.dm.Kb{xe(){return olympe.sc.ze.Pe.Fh}};olympe.sc.rp.O=olympe.dc.oa.j('0163a68ce44f3d1fa84c',olympe.sc.rp);olympe.sc.Bc=class extends olympe.dm.BrickMetadata{};olympe.sc.Bc.O=olympe.dc.oa.j('016324fde11a836f76c2',olympe.sc.Bc);olympe.sc.Bc.j=olympe.sc.Bc.O.ta('016324fde11a836087c2');olympe.sc.Bc.O.j=function(a,b){return dm(a,null!=b?b:'New type',olympe.sc.Bc).W()};let eo=null,fo=null,go=[];
|
|
1162
|
-
function ho(a,b){eo=a;const c=olympe.C.Za();return olympe.dc.td.from(a).bb(olympe.sc.qa.Qc.j).bb(olympe.sc.uf.j.ac()).mb({
|
|
1162
|
+
function ho(a,b){eo=a;const c=olympe.C.Za();return olympe.dc.td.from(a).bb(olympe.sc.qa.Qc.j).bb(olympe.sc.uf.j.ac()).mb({mi:'__code-as-data__'}).then(d=>{let e;null==(e=go)||e.forEach(f=>f());go=null;fo=d;if(null!==d){if(b){const f=olympe.dc.ga();return new Promise(g=>{Ai(c,d,h=>{h=f.yi(h)?h:f.model(h);return null!==h&&f.Nb(h,olympe.sc.Bc)},{lo:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ha.Wa('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
|
|
1163
1163
|
g()}))})}olympe.ha.Wa('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ha.Wa('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{go=null;throw d;})}function Nf(){return null===go?Promise.resolve():new Promise(a=>{go.push(()=>a())})}olympe.sc.uf=class extends olympe.dc.CloudObject{};olympe.sc.uf.O=olympe.dc.oa.j('017b3aa8fae1e3d044dc',olympe.sc.uf);olympe.sc.uf.j=olympe.sc.uf.O.ta('017b3aa8fd1659291b92');
|
|
1164
1164
|
olympe.sc.uf.D=olympe.sc.uf.O.ta('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.oa.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Pg=class extends olympe.sc.Map{};olympe.sc.Pg.O=olympe.dc.oa.j('01631aacd8276ea98490',olympe.sc.Pg);olympe.sc.File=class extends olympe.dm.File{static Px(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Ft(a,e,b,c,d);return e}static Qx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.ko(a,e,b,c,d);return e}static Ft(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.ko(a,b,c,d,e)}static ko(a,b,c,d,e){const f=olympe.dc.ga(),g=f.Ja(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Xf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
|
|
1165
1165
|
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.Pa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.vt(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.ko;olympe.sc.File.setContent=olympe.sc.File.Ft;olympe.sc.File.createFromURL=olympe.sc.File.Qx;olympe.sc.File.createFromContent=olympe.sc.File.Px;
|
|
1166
1166
|
olympe.sc.File.O=fg(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Lg=class extends olympe.sc.File{H(){const a=olympe.C.bc(olympe.C.Sa);this.ml(b=>{a.update(olympe.C.yb(b))});return a.ub()}};olympe.sc.Lg.O=fg(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Lg);olympe.sc.Lg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Lg);olympe.sc.Lg.prototype.H.K=olympe.C.J.D;olympe.sc.Rc=class extends olympe.sc.File{H(){return this.xb(olympe.sc.Rc.fontFamilyProp)}N(){return this.xb(olympe.sc.Rc.F)}R(){return this.Ad(olympe.sc.Rc.H)}};olympe.sc.Rc.O=fg(olympe.sc.File,'01647e113043c637b541',olympe.sc.Rc);olympe.sc.Rc.fontFamilyProp=olympe.sc.Rc.O.ja('01647e35ecd24ef0b88d');olympe.sc.Rc.F=olympe.sc.Rc.O.ja('01647e677f5d1cfbdf42');olympe.sc.Rc.H=olympe.sc.Rc.O.ja('01647e6780999bf8bd25');
|
|
1167
|
-
olympe.sc.Rc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Rc,a,b,c,d);a.update(c,olympe.sc.Rc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Rc.prototype.H.K=olympe.C.J.D;olympe.sc.Rc.prototype.N.K=olympe.C.J.D;olympe.sc.Rc.prototype.R.K=olympe.C.J.F;olympe.sc.
|
|
1167
|
+
olympe.sc.Rc.O.j=(a,b,c,d)=>{c=olympe.sc.File.D(olympe.sc.Rc,a,b,c,d);a.update(c,olympe.sc.Rc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Rc.prototype.H.K=olympe.C.J.D;olympe.sc.Rc.prototype.N.K=olympe.C.J.D;olympe.sc.Rc.prototype.R.K=olympe.C.J.F;olympe.sc.fi=class extends olympe.sc.File{};olympe.sc.fi.O=fg(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.fi);olympe.sc.fi.O.j=olympe.sc.File.D.bind(null,olympe.sc.fi);olympe.sc.Bs=class extends olympe.dc.CloudObject{};olympe.sc.Bs.O=olympe.dc.oa.j('016421bb3797e22d1c4e',olympe.sc.Bs);olympe.sc.logic={};olympe.sc.logic.$p=(a,b)=>a===b?0:a>b?1:-1;
|
|
1168
1168
|
olympe.sc.logic.kC=(a,b,c,d,e,f,g)=>{const h=b.W();b=olympe.C.Qa(b.getType().W());let k,l;if(b===olympe.dc.ea(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.xb(h).toLowerCase();else if(b===olympe.dc.ea(olympe.dm.Number))k=c.valueOf(),l=p=>p.Ad(h);else if(b===olympe.dc.ea(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.C.ua([p.Ej(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ga().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
|
|
1169
|
-
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.$p(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.$p(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.gl().filter(p=>olympe.C.ua([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Sb(d.valueOf()?1===q:0<=q)},olympe.C.da,'FilterList ListDefBuilder Filter TransformFlows')).
|
|
1169
|
+
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.$p(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.$p(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.gl().filter(p=>olympe.C.ua([l(p)],q=>{q=n(q.valueOf(),k);return olympe.C.Sb(d.valueOf()?1===q:0<=q)},olympe.C.da,'FilterList ListDefBuilder Filter TransformFlows')).Yi())};
|
|
1170
1170
|
olympe.sc.logic.YE=(a,b)=>{if(a instanceof olympe.C.$)return a;if(a instanceof olympe.C.Sa)return a.Jt();if(a instanceof olympe.C.da)return a.it();if('string'===typeof a||'number'===typeof a)return olympe.C.sa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.C.$.Oq};olympe.sc.logic.Ra={};function io(a){kg(a.O,(b,c)=>{b=b.create(a.O.D);Y(b,olympe.dc.CloudObject.nameProp,c);return b.W()})}olympe.sc.logic.Ra.Op=class{constructor(a,b,c){this.O=olympe.dc.oa.j(a,b,...c);io(this)}W(){return this.O.W()}};olympe.sc.logic.Ra.Op.ya=[olympe.dc.Ze];const jo=Object.create(null),ko=new Map;function lo(a){if(void 0===jo[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return hg(a)}function mo(a,b,c=olympe.sc.logic.Function){if(ko.has(a))throw c=lo(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.oa.j(a,b,...[]);ko.set(a,{O:d,oF:b,VE:c});return d}
|
|
1171
1171
|
olympe.sc.logic.oa=class{constructor(){}static j(a,b,...c){if(jo[a])throw c=lo(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ra.Op(a,b,[olympe.sc.P.Ca].concat(c));return jo[a]=b}};olympe.sc.logic.$A=class{};olympe.sc.logic.ck=class extends olympe.dc.CloudObject{};olympe.sc.logic.ck.O=olympe.dc.oa.j('01621fb84e320000cf00',olympe.sc.logic.ck);function tn(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)}Qy(){return this.message}Bj(){return this.code}ue(){let a;return null!=(a=this.j)?a:''}toString(){return`${this.message}\nError found in:\n${this.ue()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.ue;
|
|
1172
|
-
olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Bj;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Qy;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.
|
|
1173
|
-
c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.
|
|
1172
|
+
olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Bj;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Qy;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Pi=class extends olympe.sc.logic.ck{};olympe.sc.logic.Pi.O=olympe.dc.oa.j('016eeb5ede9f3094d8f0',olympe.sc.logic.Pi);olympe.sc.logic.sd=class extends olympe.dc.CloudObject{j(){return this.Vc(olympe.sc.logic.sd.j,olympe.dc.CloudObject)}};olympe.sc.logic.sd.O=olympe.dc.oa.j('016ac4f59ee8ea2081ba',olympe.sc.logic.sd);olympe.sc.logic.sd.D=olympe.sc.logic.sd.O.ja('017bc044aeacce7ffc8f');olympe.sc.logic.sd.j=olympe.sc.logic.sd.O.ta('016ac4f5a0091c4790e2');S(olympe.dc.CloudObject.O,olympe.sc.logic.sd.j);olympe.sc.logic.sd.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Yh=class extends olympe.sc.logic.sd{};olympe.sc.logic.Yh.O=olympe.dc.oa.j('016ac4f59c592b862457',olympe.sc.logic.Yh);olympe.sc.logic.Yh.F=olympe.sc.ud.j.ac();olympe.sc.logic.Yh.O.j=(a,b,c,d,e)=>{b=dm(a,b||'New Predefined Input',olympe.sc.logic.Yh,olympe.sc.logic.vb);Y(b,olympe.sc.logic.sd.D,e);a.Oa(olympe.sc.logic.sd.j,b,c);a.Oa(olympe.sc.ud.j,d,b);return b.W()};olympe.sc.logic.Tg=class extends olympe.sc.logic.sd{};olympe.sc.logic.Tg.O=olympe.dc.oa.j('016ac4f59dd99f5df3e1',olympe.sc.logic.Tg);olympe.sc.logic.Tg.F=S(olympe.sc.logic.Tg.O,olympe.sc.ud.D);olympe.sc.logic.Tg.O.j=(a,b,c,d,e)=>{b=dm(a,b||'New Predefined Output',olympe.sc.logic.Tg,olympe.sc.logic.Gb);Y(b,olympe.sc.logic.sd.D,e);a.Oa(olympe.sc.logic.sd.j,b,c);a.Oa(olympe.sc.ud.D,d,b);return b.W()};olympe.sc.logic.Fd=class extends olympe.sc.Va{xe(){return olympe.sc.ze.Pe.ds}Z(){return this.On().gl().Nb([olympe.sc.logic.Function]).and().Cd().Nb([olympe.sc.logic.pd,olympe.sc.logic.gd]).Yi()}N(){const a=olympe.dc.ea(olympe.sc.logic.Pi);return this.db.cb(this,olympe.sc.logic.Fd.D).filter(b=>this.db.Ib(b,olympe.sc.logic.Tb.typeRel)===a)}j(a){const b=this.db.Ln(this,[olympe.sc.Va.F],c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}D(a){const b=this.db.Ln(this,[olympe.sc.Va.D],
|
|
1173
|
+
c=>this.db.model(c)===olympe.dc.ea(a));return b?olympe.dc.CloudObject.get(b):null}H(a){if(!this.xi())return super.H(a);const b=olympe.dc.ea(olympe.sc.logic.ck),c=olympe.dc.ea(olympe.sc.logic.Pi);return Un(this).map(d=>{switch(this.db.Ib(d,olympe.sc.logic.Tb.typeRel)){case b:return a.oo.bind(a,d);case c:return a.throw.bind(a);default:return a.set.bind(a,d)}})}F(a){if(!this.xi())return super.F(a);const b=Tn(this);return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>
|
|
1174
1174
|
c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Fd.O=mo('01621fb84e320000f000',olympe.sc.logic.Fd,olympe.sc.logic.Function);olympe.sc.logic.Fd.prototype.j.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Fd.prototype.D.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);let no=null;function oo(){if(null===no){let a;no=null!=(a=olympe.V.getParameter('sc.action.experimental'))?a:!1}return no}
|
|
1175
|
-
olympe.sc.logic.cg=class extends olympe.sc.logic.Fd{R(){return this.j('016ac63229782039429f')}X(){return this.D('016ac6322acf67eebfe7')}ba(){return this.Cq().gl().bb(olympe.sc.logic.Tb.typeRel).vl(olympe.sc.logic.
|
|
1176
|
-
olympe.sc.logic.cg.O=mo('01621fb84e320000a000',olympe.sc.logic.cg,olympe.sc.logic.Action);olympe.sc.logic.cg.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.cg.prototype.X.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.cg.prototype.ba.K=olympe.C.J.N;olympe.sc.logic.bp=class extends olympe.sc.logic.Fd{};olympe.sc.logic.bp.O=mo('01621fb84e320000f011',olympe.sc.logic.bp);olympe.sc.logic.ap=class extends olympe.sc.logic.cg{};olympe.sc.logic.ap.O=mo('01621fb84e320000f012',olympe.sc.logic.ap);olympe.sc.logic.Function=class extends olympe.sc.Runnable{R(){return[this.lb]}D(){if(!this.yd().
|
|
1175
|
+
olympe.sc.logic.cg=class extends olympe.sc.logic.Fd{R(){return this.j('016ac63229782039429f')}X(){return this.D('016ac6322acf67eebfe7')}ba(){return this.Cq().gl().bb(olympe.sc.logic.Tb.typeRel).vl(olympe.sc.logic.Pi).Yi().Df().$n(olympe.C.$.ZERO)}F(a){if(this.xi()||oo()){const b=this.R().W();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:Tn(this).filter(d=>d!==b).map(d=>a.get(d))))}return super.F(a)}};olympe.sc.logic.cg.j='016ac63229782039429f';olympe.sc.logic.cg.N='016ac6322acf67eebfe7';
|
|
1176
|
+
olympe.sc.logic.cg.O=mo('01621fb84e320000a000',olympe.sc.logic.cg,olympe.sc.logic.Action);olympe.sc.logic.cg.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.cg.prototype.X.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.cg.prototype.ba.K=olympe.C.J.N;olympe.sc.logic.bp=class extends olympe.sc.logic.Fd{};olympe.sc.logic.bp.O=mo('01621fb84e320000f011',olympe.sc.logic.bp);olympe.sc.logic.ap=class extends olympe.sc.logic.cg{};olympe.sc.logic.ap.O=mo('01621fb84e320000f012',olympe.sc.logic.ap);olympe.sc.logic.Function=class extends olympe.sc.Runnable{R(){return[this.lb]}D(){if(!this.yd().xi())return super.D();const a=olympe.sc.Gg.j.Am,b=olympe.sc.Gg.j.Rm,c=this.db,d=new Map,e=this.Xb();c.cb(e,olympe.sc.Va.F).forEach(f=>{d.set(a+c.name(f),f)});c.cb(e,olympe.sc.Va.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.Tb=class extends olympe.dc.CloudObject{getType(){return this.Vc(olympe.sc.logic.Tb.typeRel,olympe.dc.CloudObject)}j(){return this.Ad(olympe.sc.logic.Tb.j)}};olympe.sc.logic.Tb.O=olympe.dc.oa.j('0168a431d25001540000',olympe.sc.logic.Tb);olympe.sc.logic.Tb.j=olympe.sc.logic.Tb.O.ja('01740c5d4ae4b520dd01');olympe.sc.logic.Tb.typeRel=olympe.sc.logic.Tb.O.ta('0168a431d3b9b7438424');S(olympe.dc.CloudObject.O,olympe.sc.logic.Tb.typeRel);
|
|
1177
1177
|
olympe.sc.logic.Tb.prototype.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Tb.prototype.j.K=olympe.C.J.F;olympe.sc.logic.vb=class extends olympe.sc.logic.Tb{};olympe.sc.logic.vb.O=olympe.dc.oa.j('0168a431d25001540001',olympe.sc.logic.vb);olympe.sc.logic.vb.R=olympe.sc.logic.Tb.O.ja('01740c5d4ae4b520dd02');olympe.sc.logic.vb.N=S(olympe.sc.logic.vb.O,olympe.sc.Va.F);olympe.sc.logic.vb.D=olympe.sc.logic.vb.O.ta('0168a431d91f2578000b',olympe.dc.va.ORIGIN);olympe.sc.logic.vb.F=olympe.sc.logic.vb.O.ta('01621fb84e32000000a1',olympe.dc.va.ORIGIN);
|
|
1178
1178
|
olympe.sc.logic.vb.H=olympe.sc.logic.vb.O.ta('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.Tb.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Tb.j,e);d&&a.Oa(olympe.sc.Va.F,d,f);return f.W()};olympe.sc.logic.Gb=class extends olympe.sc.logic.Tb{};olympe.sc.logic.Gb.O=olympe.dc.oa.j('0168a431d25001540002',olympe.sc.logic.Gb);olympe.sc.logic.Gb.N=S(olympe.sc.logic.Gb.O,olympe.sc.Va.D);olympe.sc.logic.Gb.D=olympe.sc.logic.Gb.O.ta('0168a431d91f25780003',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.H=olympe.sc.logic.Gb.O.ta('01621fb84e32000000a2',olympe.dc.va.ORIGIN);olympe.sc.logic.Gb.F=olympe.sc.logic.Gb.O.ta('01621fb84e32000000d2',olympe.dc.va.ORIGIN);
|
|
1179
1179
|
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.Tb.typeRel,f,c);void 0!==e&&Y(f,olympe.sc.logic.Tb.j,e);d&&a.Oa(olympe.sc.Va.D,d,f);return f.W()};olympe.sc.logic.pd=class extends olympe.sc.logic.Function{run(a){Wn(this,a);const b=a.getParent(),c=this.db.Ib(this,olympe.sc.logic.pd.H),d=this.db.Ib(this,olympe.sc.logic.pd.F);a.on(c,e=>b.set(d,e),this.tag)}j(){return this.wg(olympe.sc.logic.pd.H).Dc()}X(){return this.wg(olympe.sc.logic.pd.F).Dc()}};olympe.sc.logic.pd.O=olympe.dc.oa.j('01621fb84e32000000a0',olympe.sc.logic.pd,olympe.sc.P.Ca);olympe.sc.logic.pd.H=S(olympe.sc.logic.pd.O,olympe.sc.logic.vb.F);
|
|
@@ -1185,69 +1185,69 @@ olympe.sc.logic.Gb)}gz(){return this.Vc(olympe.sc.logic.qb.H,olympe.dm.Property)
|
|
|
1185
1185
|
olympe.sc.logic.qb.R=S(olympe.sc.logic.qb.O,olympe.sc.logic.Gb.D);olympe.sc.logic.qb.H=olympe.sc.logic.qb.O.ta('0168a431d91f25780004');olympe.sc.logic.qb.F=olympe.sc.logic.qb.O.ta('0168a431d91f2578000a');olympe.sc.logic.qb.j=S(olympe.sc.logic.qb.O,olympe.sc.logic.vb.D);olympe.sc.logic.qb.D=olympe.sc.logic.qb.O.ta('0168a431d91f2578000c');S(olympe.dc.CloudObject.O,olympe.sc.logic.qb.N);S(olympe.dm.Property.O,olympe.sc.logic.qb.H);S(olympe.dc.CloudObject.O,olympe.sc.logic.qb.F);
|
|
1186
1186
|
S(olympe.dm.Property.O,olympe.sc.logic.qb.D);m=olympe.sc.logic.qb.prototype;m.getType.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.hz.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.fz.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.gz.K=new olympe.C.J(()=>olympe.dm.Property,[]);m.Dy.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);m.By.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Cy.K=new olympe.C.J(()=>olympe.dm.Property,[]);function qo(a,b){const c=a.yd(),d=c.Em().W(),e=c.Fm().W(),f=c.Gm().W();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.L.rb.get(a.Xb(),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=tn(k.message,k.Bj(),k.ue()+'\n===== Remote Call =====\n'+b.ue()),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,
|
|
1187
1187
|
400))})}},b.T())}function ro(a,b){const c=a.j.ia(()=>new Promise(d=>{b.onDestroy(()=>d())}),void 0,a.timeout);b.onDestroy(()=>a.j.F(c))}
|
|
1188
|
-
function so(a,b,c,d,e,f){const g=n=>u(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.Oc(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Wb().name()} (${a.Xb()}): ${r}`);f.
|
|
1189
|
-
olympe.sc.logic
|
|
1190
|
-
super.run(a):(Wn(this,a),qo(this,a)))}wb(a){const b=this.Xb(),c=this.yd(),d=c.Dq().W(),e=c.Em().W(),f=c.Fm().W(),g=c.Gm().W(),h=new olympe.L.rb(b,a);this.j.ia(()=>u(function*(){return h.stop()}),`RemoteAction_${this.tag}`);h.listen().subscribe(rxjs.Subscriber.create(k=>{const l=a.
|
|
1191
|
-
l,f,g,p,k);super.run(l);for(const [q,r]of n)q!==e&&l.set(q,r);k.
|
|
1192
|
-
this.G.error(`Error while listening on remote action ${this.db.name(l)} (${l}): ${k.message}`)}))}};olympe.sc.logic
|
|
1188
|
+
function so(a,b,c,d,e,f){const g=n=>u(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.Oc(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Wb().name()} (${a.Xb()}): ${r}`);f.ri(t).catch(v=>{a.G.error(`Cannot reply with an error to a remote action call ${a.Wb().name()} (${a.Xb()}): ${v}`)})}finally{b.destroy()}}}),h=b.T(),k=b.on(c,g,h),l=b.on(d,g,h)}
|
|
1189
|
+
olympe.sc.logic.ai=class extends olympe.sc.logic.Function{constructor(a,b,c,d,e,f){super(a,b,c);this.timeout=e;this.j=d;this.X=f}update(a,b,c){olympe.sc.nb.nl().isEnabled()&&olympe.sc.nb.nl().track('Remote Action',this.name());return super.update(a,b,c)}run(a){let b;null!=(b=a.Qa(olympe.sc.xa.j.EDITION))&&b||(this.db.Pa(this,olympe.sc.logic.ai.F)?(Hn(a.state,this),this.wb(a)):this.X&&0<olympe.dc.la.re(this.X,olympe.sc.qa.Qc).bb(olympe.sc.Va.H).bb(olympe.sc.Runnable.D).filter(olympe.dc.query.za.ot(this.Xb())).Dc().size()?
|
|
1190
|
+
super.run(a):(Wn(this,a),qo(this,a)))}wb(a){const b=this.Xb(),c=this.yd(),d=c.Dq().W(),e=c.Em().W(),f=c.Fm().W(),g=c.Gm().W(),h=new olympe.L.rb(b,a);this.j.ia(()=>u(function*(){return h.stop()}),`RemoteAction_${this.tag}`);h.listen().subscribe(rxjs.Subscriber.create(k=>{const l=a.ni('remote call'),n=k.body();l.set(olympe.sc.xa.j.REDELIVERED,k.zi());ro(this,l);const p=Bc(()=>{k.ri(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`)).catch();l.destroy()},this.timeout);so(this,
|
|
1191
|
+
l,f,g,p,k);super.run(l);for(const [q,r]of n)q!==e&&l.set(q,r);k.Ei().then(q=>{var r=l.get(d);null!==r&&olympe.dc.ea(r)!==q&&(r=this.Xb(),this.G.warn(`Remote action ${this.db.name(r)} ${r}: try to run it with an input user that is not the real authenticated user.`));l.set(d,q);l.set(e,n.get(e))}).catch(q=>{const r=this.Xb();this.G.warn(`Remote action ${this.db.name(r)} ${r} Triggered by unrecognized user: ${q}.`);l.set(g,olympe.sc.logic.Error.create('Unrecognized User',1))})},k=>{const l=this.Xb();
|
|
1192
|
+
this.G.error(`Error while listening on remote action ${this.db.name(l)} (${l}): ${k.message}`)}))}};olympe.sc.logic.ai.O=olympe.dc.oa.j('017a7b0c5dcbd8964c5d',olympe.sc.logic.ai,olympe.sc.P.Ca,olympe.host.P.Ie,new olympe.V.ma(olympe.sc.Config.Gr),new olympe.V.ma(olympe.sc.Config.ie));olympe.sc.logic.ai.F=olympe.sc.logic.ai.O.ja('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Bm=class{constructor(a){this.db=olympe.dc.ga();this.typeRel=a}};olympe.sc.logic.controllers.Bm.j={cB:-1,cC:1};olympe.sc.logic.controllers.VC=class extends olympe.sc.logic.controllers.Bm{constructor(){super(olympe.sc.logic.sd.j)}};olympe.sc.logic.controllers.dD=class extends olympe.sc.logic.controllers.Bm{constructor(){super(olympe.sc.logic.Tb.typeRel)}};olympe.sc.logic.kl={};olympe.sc.logic.kl.Pw=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ea(b);d?olympe.dc.la.Pb(a,d,olympe.dc.Lb.mg).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.kl.Pw);olympe.sc.logic.actions={};olympe.sc.logic.kl.Kv=class extends olympe.sc.logic.Function{run(a){Wn(this,a);const [b,c,d]=$n(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.mf(f)),f++,c(Date.now())):(Jn(h.state),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.xg();f=0;In(h.state);k();break;case 2:k();break;default:this.G.error('Unhandled input')}},this.tag))}};
|
|
1193
1193
|
olympe.sc.logic.oa.j('0171889b060b6cd54300',olympe.sc.logic.kl.Kv);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.sm=class extends olympe.sc.logic.Fd{R(){return this.j('016ac638085357047a2d')}};olympe.sc.logic.Rb.sm.O=mo('0169b6876a03f14ae61b',olympe.sc.logic.Rb.sm);olympe.sc.logic.Rb.sm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);let to=null;olympe.sc.logic.Rb.Cm=class extends olympe.sc.logic.Fd{R(){return this.j('016ac63808535703691c')}F(a){if(null===to){let b;to=null!=(b=olympe.V.getParameter('sc.event.experimental'))?b:!1}return to?a.observe(Tn(this)[0]):super.F(a)}};olympe.sc.logic.Rb.Cm.O=mo('0169b6876a03f139d50a',olympe.sc.logic.Rb.Cm);olympe.sc.logic.Rb.Cm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.Sm=class extends olympe.sc.logic.Fd{R(){return this.j('016ac63809a9a8e6db96')}X(){return this.D('016ac6380ab003363b3e')}};mo('01646ad602f933b8caaf',olympe.sc.logic.Rb.Sm);olympe.sc.logic.Rb.Sm.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.Sm.prototype.X.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.Bk=class extends olympe.sc.logic.Fd{R(){return this.j('016ac6380bd98f1d91a0')}ba(){return this.D('016ac63c589ae38ca3ae')}X(){return this.D('016ac63c5a377fceabaa')}};mo('0168ec42fc01747a98b6',olympe.sc.logic.Rb.Bk);olympe.sc.logic.Rb.Bk.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.logic.Rb.Bk.prototype.ba.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.Bk.prototype.X.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.logic.Rb.Xg=class extends olympe.sc.logic.Fd{Em(){return this.j('017a7b07b09e3b22c8b4')}Dq(){return this.j('017a7b07ba05807a74b0')}Fm(){return this.D('017a7b0818c12388d731')}Gm(){return this.D('017a7b085146d5e69aec')}tv(){return olympe.C.da.D}};olympe.sc.logic.Rb.Xg.N='017a7b07b09e3b22c8b4';olympe.sc.logic.Rb.Xg.Ic='017a7b07ba05807a74b0';olympe.sc.logic.Rb.Xg.ia='017a7b0818c12388d731';olympe.sc.logic.Rb.Xg.j='017a7b085146d5e69aec';
|
|
1194
|
-
olympe.sc.logic.Rb.Xg.O=mo('017a7b07a948e30508fa',olympe.sc.logic.Rb.Xg,olympe.sc.logic
|
|
1194
|
+
olympe.sc.logic.Rb.Xg.O=mo('017a7b07a948e30508fa',olympe.sc.logic.Rb.Xg,olympe.sc.logic.ai);m=olympe.sc.logic.Rb.Xg.prototype;m.Em.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Dq.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.Fm.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.Gm.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.tv.K=olympe.C.J.N;olympe.sc.logic.Rb.js=class extends olympe.sc.logic.Fd{R(){return this.j('016ac63c5b3ed0562740')}};mo('016a9766c230916ea5ec',olympe.sc.logic.Rb.js);olympe.sc.logic.Rb.js.prototype.R.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);olympe.sc.query={};olympe.sc.query.Co=class extends olympe.sc.Pg{};olympe.sc.query.Co.O=olympe.dc.oa.j('01631aacd8276ea98491',olympe.sc.query.Co);olympe.sc.query.mr=class extends olympe.dm.Enum{};olympe.sc.query.mr.O=olympe.dc.oa.j('01631aacd8276ea98495',olympe.sc.query.mr);olympe.sc.query.zr=class extends olympe.dm.Enum{};olympe.sc.query.zr.O=olympe.dc.oa.j('01631aacd8276ea98494',olympe.sc.query.zr);olympe.sc.query.Cr=class extends olympe.sc.Pg{};olympe.sc.query.Cr.O=olympe.dc.oa.j('01631aacd8276ea98492',olympe.sc.query.Cr);olympe.sc.query.oc=class extends olympe.dc.CloudObject{};olympe.sc.query.oc.O=olympe.dc.oa.j('01631aacd8276ea98493',olympe.sc.query.oc);olympe.sc.gp=class extends olympe.dc.CloudObject{};olympe.sc.gp.O=olympe.dc.oa.j('018312ceeb3e93618a85',olympe.sc.gp);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.ja('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13a');
|
|
1195
1195
|
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.O.ja('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.O.ta('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.O.ta('017ffdd8f0b1e31fe13f');olympe.sc.workflow.Gf=class extends olympe.sc.logic.Fd{uv(){return this.j('017ffe02381f9fac5060')}xv(){return this.j('017ffe02381f9fac5061')}yv(){return this.j('017ffe02381f9fac5062')}zy(){return this.j('017ffe02381f9fac5065')}vv(){return this.D('017ffe02381f9fac5063')}wv(){return this.D('017ffe02381f9fac5064')}};olympe.sc.workflow.Gf.O=mo('017ffde21f5fe0f704ce',olympe.sc.workflow.Gf);olympe.sc.workflow.Gf.j='017ffe02381f9fac5060';olympe.sc.workflow.Gf.Re='017ffe02381f9fac5061';
|
|
1196
1196
|
olympe.sc.workflow.Gf.ff='017ffe02381f9fac5062';olympe.sc.workflow.Gf.ia='017ffe02381f9fac5065';olympe.sc.workflow.Gf.N='017ffe02381f9fac5063';olympe.sc.workflow.Gf.Ic='017ffe02381f9fac5064';m=olympe.sc.workflow.Gf.prototype;m.uv.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.xv.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.yv.K=new olympe.C.J(()=>olympe.sc.logic.vb,[]);m.zy.K=new olympe.C.J(()=>Map,[]);m.vv.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);m.wv.K=new olympe.C.J(()=>olympe.sc.logic.Gb,[]);olympe.sc.workflow.df=class extends olympe.dm.BrickMetadata{Zc(){return this.Vc(olympe.sc.workflow.Workflow.statesRel.ac(),olympe.sc.workflow.Workflow).ka().concat(['.',this.ka()])}};olympe.sc.workflow.df.O=olympe.dc.oa.j('017ffdc2dda51d46b430',olympe.sc.workflow.df);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{D(){return this.lt()}j(){return this.Vc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.df)}F(){return this.Vc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.df)}Zc(){const a=this.Vc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.df);return a.Vc(olympe.sc.workflow.Workflow.statesRel.ac(),olympe.sc.workflow.Workflow).ka().concat(['.',a.ka(),'->',this.ka()])}};
|
|
1197
1197
|
olympe.sc.workflow.Transition.O=olympe.dc.oa.j('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.O.ja('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.O.ta('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.O.ta('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.D.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);
|
|
1198
1198
|
olympe.sc.workflow.Transition.prototype.j.K=new olympe.C.J(()=>olympe.sc.workflow.df,[]);olympe.sc.workflow.Transition.prototype.F.K=new olympe.C.J(()=>olympe.sc.workflow.df,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{xe(){return olympe.sc.ze.Pe.Fh}F(){return this.ph(olympe.sc.workflow.Workflow.serializationEnabledProp)}j(){return this.Vc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Bc)}D(){return this.Vc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.df)}};olympe.sc.workflow.Workflow.O=olympe.dc.oa.j('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.O.ja('017ffdc010e5bcc9c972');
|
|
1199
1199
|
olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.O.ta('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.O.ta('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.O.ta('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.Bc,[]);
|
|
1200
|
-
olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.df,[]);olympe.sc.qa={};olympe.sc.qa.Qc=class extends olympe.sc.Va{xe(){return olympe.sc.ze.Pe.xw}};olympe.sc.qa.Qc.O=olympe.dc.oa.j('01120300000000adef00',olympe.sc.qa.Qc);olympe.sc.qa.Qc.j=olympe.sc.qa.Qc.O.ta('0171bc1f15da96dfdb89');olympe.sc.qa.Qc.ia=olympe.sc.qa.Qc.O.ta('0171bc1f15da96dfdb90');S(olympe.dm.Tc.O,olympe.sc.qa.Qc.j);olympe.sc.qa.
|
|
1201
|
-
olympe.sc.qa.ob.O=olympe.dc.oa.j('011203300000000adef5',olympe.sc.qa.ob);olympe.sc.qa.ob.
|
|
1200
|
+
olympe.sc.workflow.Workflow.prototype.D.K=new olympe.C.J(()=>olympe.sc.workflow.df,[]);olympe.sc.qa={};olympe.sc.qa.Qc=class extends olympe.sc.Va{xe(){return olympe.sc.ze.Pe.xw}};olympe.sc.qa.Qc.O=olympe.dc.oa.j('01120300000000adef00',olympe.sc.qa.Qc);olympe.sc.qa.Qc.j=olympe.sc.qa.Qc.O.ta('0171bc1f15da96dfdb89');olympe.sc.qa.Qc.ia=olympe.sc.qa.Qc.O.ta('0171bc1f15da96dfdb90');S(olympe.dm.Tc.O,olympe.sc.qa.Qc.j);olympe.sc.qa.Hi=class extends olympe.sc.Runnable{H(){return[this.Xb()]}j(){return olympe.dc.td.from(this.Xb()).bb(olympe.sc.qa.Qc.j).Dc()}};olympe.sc.qa.Hi.O=lg(olympe.dc.oa.j('0113030000000aca1100',olympe.sc.qa.Hi));olympe.sc.qa.Hi.prototype.j.K=new olympe.C.J(()=>olympe.dm.hb,[]);olympe.sc.qa.ob=class extends olympe.dc.CloudObject{Av(){return this.ph(olympe.sc.qa.ob.ki)}Kz(){return this.ph(olympe.sc.qa.ob.ia)}Lc(){return this.Ad(olympe.sc.qa.ob.j)}Fy(){return this.xb(olympe.sc.qa.ob.H)}$y(){return this.xb(olympe.sc.qa.ob.ba)}Zy(){return this.xb(olympe.sc.qa.ob.X)}Sf(){return this.xb(olympe.sc.qa.ob.Z)}Py(){return this.xb(olympe.sc.qa.ob.N)}ny(){return this.xb(olympe.sc.qa.ob.D)}Yy(){return this.xb(olympe.sc.qa.ob.R)}zv(){return this.xb(olympe.sc.qa.ob.F)}};
|
|
1201
|
+
olympe.sc.qa.ob.O=olympe.dc.oa.j('011203300000000adef5',olympe.sc.qa.ob);olympe.sc.qa.ob.ki=olympe.sc.qa.ob.O.ja('011203300000000adef6');olympe.sc.qa.ob.ia=olympe.sc.qa.ob.O.ja('011203300000000adef7');olympe.sc.qa.ob.j=olympe.sc.qa.ob.O.ja('011203300000000adef8');olympe.sc.qa.ob.H=olympe.sc.qa.ob.O.ja('011203300000000adef9');olympe.sc.qa.ob.ba=olympe.sc.qa.ob.O.ja('011203300000000adefa');olympe.sc.qa.ob.X=olympe.sc.qa.ob.O.ja('011203300000000adefb');olympe.sc.qa.ob.D=olympe.sc.qa.ob.O.ja('011203300000000adefc');
|
|
1202
1202
|
olympe.sc.qa.ob.Z=olympe.sc.qa.ob.O.ja('011203300000000adefd');olympe.sc.qa.ob.N=olympe.sc.qa.ob.O.ja('011203300000000adefe');olympe.sc.qa.ob.R=olympe.sc.qa.ob.O.ja('011203300000000adeff');olympe.sc.qa.ob.F=olympe.sc.qa.ob.O.ja('011203300000000adee0');olympe.sc.qa.ob.pc={INIT:0,PA:1,Tk:2,Sk:3,gn:4,xD:5,Bb:9};m=olympe.sc.qa.ob.prototype;m.Av.K=olympe.C.J.N;m.Kz.K=olympe.C.J.N;m.Lc.K=olympe.C.J.F;m.Fy.K=olympe.C.J.D;m.$y.K=olympe.C.J.D;m.Zy.K=olympe.C.J.D;m.Sf.K=olympe.C.J.D;m.Py.K=olympe.C.J.D;
|
|
1203
|
-
m.ny.K=olympe.C.J.D;m.Yy.K=olympe.C.J.D;m.zv.K=olympe.C.J.D;olympe.sc.qa.zm=class extends olympe.sc.qa.
|
|
1203
|
+
m.ny.K=olympe.C.J.D;m.Yy.K=olympe.C.J.D;m.zv.K=olympe.C.J.D;olympe.sc.qa.zm=class extends olympe.sc.qa.Hi{F(a){a.set(olympe.sc.xa.j.ro,!0);super.F(a)}wa(){return!0}};olympe.sc.qa.zm.O=olympe.dc.oa.j('0113032000000aca1102',olympe.sc.qa.zm,olympe.sc.P.Ca);olympe.sc.qa.cf=class extends olympe.sc.qa.Qc{j(){return(new olympe.dc.vk(this.W(),olympe.sc.qa.ob)).bb(olympe.sc.qa.cf.N).Yi().Kc()}};olympe.sc.qa.cf.O=olympe.dc.oa.j('011203300000000adef3',olympe.sc.qa.cf);olympe.sc.qa.cf.N=olympe.sc.qa.cf.O.ta('011203300000000adef4');S(olympe.sc.qa.ob.O,olympe.sc.qa.cf.N);
|
|
1204
1204
|
olympe.sc.qa.cf.O.j=(a,b,c)=>{b=dm(a,b||'New Service Application model',olympe.sc.qa.cf,olympe.sc.qa.zm);a.Oa(olympe.sc.qa.Qc.j,b,c);c=a.create(olympe.sc.qa.ob).W();a.Oa(olympe.sc.qa.cf.N,b,c);return b.W()};olympe.sc.qa.cf.prototype.j.K=new olympe.C.J(()=>olympe.sc.qa.ob,[]);olympe.sc.eh=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.eh.O=olympe.dc.oa.j('011203300000000adf00',olympe.sc.eh);olympe.sc.eh.D=olympe.sc.eh.O.ja('011203300000000adf01');olympe.sc.eh.j=olympe.sc.eh.O.ja('011203300000000adf02');olympe.sc.eh.F='011203300000000adf0f';olympe.sc.Bg={};olympe.sc.Bg.zz=a=>{var b=a.j;const c=olympe.dc.ga();var d=null;var e=null===go;for(const f of b.Xc())if((b=f.Wb())&&f.D()&&f.jb()===olympe.dc.Ia.SERVER&&Tl(a,f.tag())&&c.Nb(b,olympe.sc.Bc)){if(!e)throw new olympe.dc.cr;let g,h;null==d&&(d=null,null!==fo?d=fo:'string'===typeof eo&&(d=olympe.dc.td.from(eo).bb(olympe.sc.qa.Qc.j).bb(olympe.sc.uf.j.ac()).Dc()),d=null==(g=d)?void 0:g.W());d=null!=(h=d)?h:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ea(b)}`);a.Oa(olympe.sc.uf.D.W(),
|
|
1205
1205
|
d,f.tag())}};
|
|
1206
1206
|
olympe.sc.Bg.Mz=a=>{const b=a.j,c=olympe.dc.ga();for(const d of b.Xc()){const e=d.Wb();e&&!d.Bd()&&c.Nb(e,olympe.sc.Bc)&&d.Ab().forEach((f,g)=>{if(f instanceof olympe.dc.wc){const l=b.Wc(f.W());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.W()}`);var h;f=null!=(h=null==l?void 0:l.Wb())?h:null;h=l.tag();let n;if(f===olympe.dc.ea(olympe.sc.Ud)){h=l.Ib(olympe.sc.Ud.j);if(!h)throw Error('No object reference found for new ObjectRef');var k;
|
|
1207
1207
|
let p;f=null!=(p=null==(k=b.Wc(h))?void 0:k.Wb())?p:c.model(h)}if(c.Xf(f,olympe.dm.Ke)){k=nn(f);let p;n=null!=(p=l.Pa(k.W()))?p:c.Pa(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.$c(d.tag(),new Map([[g,n]]));Yl(a,l.tag(),olympe.dc.Lb.Ec)}})}};
|
|
1208
1208
|
olympe.sc.Bg.Kx=a=>{const b=a.j,c=olympe.dc.ga(),d=new Set;for(var e of b.Cb.values()){a=e.tag();let f;const g=null!=(f=e.Wb())?f:c.model(a);if(null!==g&&e.xd()&&(d.has(g)||c.Nb(g,olympe.sc.Bc))){d.add(g);const h=Array.from(e.ba()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.fc.ad?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Wc(k))?void 0:l.Wb())?n:c.model(k);return!p||!(d.has(p)||c.Nb(p,olympe.sc.Bc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Wc(h))?void 0:k.Wb())?l:c.model(h))?
|
|
1209
1209
|
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.Bg.bA=a=>{var b=a.j;const c=olympe.dc.ga();for(const d of b.Xc()){b=d.tag();const e=d.Wb();if(e&&!c.Nb(e,olympe.sc.Bc)&&Tl(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
|
|
1210
|
-
olympe.V.run([olympe.dc.transaction.P.Ea],a=>{jm(jm(jm(a,olympe.sc.Bg.Kx,'businessDataRelations'),olympe.sc.Bg.zz,'linkBusinessContainer'),olympe.sc.Bg.Mz,'noBusinessComplexProperty')});olympe.sc.ak=class extends olympe.dm.BrickMetadata{xe(){return olympe.sc.ze.Pe.Fh}};olympe.sc.ak.O=olympe.dc.oa.j('01645fe6873aeea59e64',olympe.sc.ak);olympe.sc.ak.j=olympe.sc.ak.O.ta('017ed8ac775f48d4d589');olympe.sc.cp=class extends olympe.dm.Kb{xe(){return olympe.sc.ze.Pe.Fh}};olympe.sc.cp.O=olympe.dc.oa.j('0163a68ce44f3d1fa95d',olympe.sc.cp);olympe.sc.Ch=class extends olympe.dm.BrickMetadata{};olympe.sc.Ch.O=olympe.dc.oa.j('016324fde11a836f77d3',olympe.sc.Ch);olympe.sc.Ch.j=olympe.sc.Bc.O.ta('016324fde11a836088d3');olympe.sc.Ch.O.j=(a,b)=>dm(a,null!=b?b:'New config type',olympe.sc.Ch).W();olympe.sc.ZA=class{};olympe.sc.gk=class extends olympe.dm.BrickMetadata{xe(){return olympe.sc.ze.Pe.Fh}};olympe.sc.gk.O=olympe.dc.oa.j('017dc8d6c8fd8c8bd2ff',olympe.sc.gk);olympe.sc.gk.O.j=(a,b)=>dm(a,null!=b?b:'New data connector',olympe.sc.gk,olympe.dm.DataSource).W();olympe.sc.Ce=class extends olympe.sc.Runnable{X(){return this.cb(olympe.sc.Ce.H,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Ce.F,olympe.dm.Property)}};olympe.sc.Ce.O=lg(olympe.dc.oa.j('016c2d996d9ca27fa9d8',olympe.sc.Ce));olympe.sc.Ce.H=olympe.sc.Ce.O.ta('016c3cb7742ec9309e0b');olympe.sc.Ce.F=olympe.sc.Ce.O.ta('016c42d3454636f90533');olympe.sc.Ce.prototype.X.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Ce.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Fp=class extends olympe.dm.Kb{xe(){return olympe.sc.ze.Pe.Fh}};olympe.sc.Fp.O=olympe.dc.oa.j('017a7a9ff057958e5678',olympe.sc.Fp);olympe.sc.
|
|
1211
|
-
'string'===typeof c?c:olympe.dc.fe().fromModel(a);a=this.j.create(a,d).
|
|
1212
|
-
return this.persist(a,b)}
|
|
1213
|
-
olympe.sc.Ya.prototype.merge=olympe.sc.Ya.prototype.merge;olympe.sc.Ya.prototype.model=olympe.sc.Ya.prototype.model;olympe.sc.Ya.prototype.setSource=olympe.sc.Ya.prototype.
|
|
1210
|
+
olympe.V.run([olympe.dc.transaction.P.Ea],a=>{jm(jm(jm(a,olympe.sc.Bg.Kx,'businessDataRelations'),olympe.sc.Bg.zz,'linkBusinessContainer'),olympe.sc.Bg.Mz,'noBusinessComplexProperty')});olympe.sc.ak=class extends olympe.dm.BrickMetadata{xe(){return olympe.sc.ze.Pe.Fh}};olympe.sc.ak.O=olympe.dc.oa.j('01645fe6873aeea59e64',olympe.sc.ak);olympe.sc.ak.j=olympe.sc.ak.O.ta('017ed8ac775f48d4d589');olympe.sc.cp=class extends olympe.dm.Kb{xe(){return olympe.sc.ze.Pe.Fh}};olympe.sc.cp.O=olympe.dc.oa.j('0163a68ce44f3d1fa95d',olympe.sc.cp);olympe.sc.Ch=class extends olympe.dm.BrickMetadata{};olympe.sc.Ch.O=olympe.dc.oa.j('016324fde11a836f77d3',olympe.sc.Ch);olympe.sc.Ch.j=olympe.sc.Bc.O.ta('016324fde11a836088d3');olympe.sc.Ch.O.j=(a,b)=>dm(a,null!=b?b:'New config type',olympe.sc.Ch).W();olympe.sc.ZA=class{};olympe.sc.gk=class extends olympe.dm.BrickMetadata{xe(){return olympe.sc.ze.Pe.Fh}};olympe.sc.gk.O=olympe.dc.oa.j('017dc8d6c8fd8c8bd2ff',olympe.sc.gk);olympe.sc.gk.O.j=(a,b)=>dm(a,null!=b?b:'New data connector',olympe.sc.gk,olympe.dm.DataSource).W();olympe.sc.Ce=class extends olympe.sc.Runnable{X(){return this.cb(olympe.sc.Ce.H,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Ce.F,olympe.dm.Property)}};olympe.sc.Ce.O=lg(olympe.dc.oa.j('016c2d996d9ca27fa9d8',olympe.sc.Ce));olympe.sc.Ce.H=olympe.sc.Ce.O.ta('016c3cb7742ec9309e0b');olympe.sc.Ce.F=olympe.sc.Ce.O.ta('016c42d3454636f90533');olympe.sc.Ce.prototype.X.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Ce.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Fp=class extends olympe.dm.Kb{xe(){return olympe.sc.ze.Pe.Fh}};olympe.sc.Fp.O=olympe.dc.oa.j('017a7a9ff057958e5678',olympe.sc.Fp);olympe.sc.Oi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ga();e=void 0!==e?e:f.Ja(b)&&f.Xc(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.Oi.create=olympe.sc.Oi.create;olympe.sc.Oi.O=olympe.dc.oa.j('016cdd861b32d56c8208',olympe.sc.Oi);olympe.sc.Mq=class extends olympe.dm.Kb{xe(){return olympe.sc.ze.Pe.Zw}};olympe.sc.Mq.O=olympe.dc.oa.j('01644b6d4543b344b857',olympe.sc.Mq);olympe.sc.Nq=class extends olympe.dc.CloudObject{};olympe.sc.Nq.O=olympe.dc.oa.j('0162f672366be5ca7a86',olympe.sc.Nq);const uo={Ap:30};olympe.sc.cc=class extends olympe.dc.sources.cc{D(a){return a instanceof olympe.sc.logic.Error?this.format(uo.Ap,{c:a.Bj(),m:a.message,s:a.ue()}):super.D(a)}j(a){return(null==a?void 0:a.t)===uo.Ap?(a=a.v,tn(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Ud.O.W()){const b=olympe.sc.Ud.j;this.F.get(a).r.push({r:b.W(),o:a,d:this.db.Ib(a,b)})}return a}};olympe.sc.ks=class extends olympe.sc.Ce{};olympe.sc.ks.O=olympe.dc.oa.j('016d3f37610ae4fc3962',olympe.sc.ks);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.oa.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Ya=class{constructor(a=!0){a=bm(a);a.N=!0;var b=olympe.sc.Bg.bA;let c;(null==(c=olympe.V.getParameter(olympe.dc.transaction.Config.om))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.xa.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Ya}static process(a,b){return a.has(olympe.sc.xa.j.TRANSACTION,!0)?Promise.resolve(!1):b.mb().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c=
|
|
1211
|
+
'string'===typeof c?c:olympe.dc.fe().fromModel(a);a=this.j.create(a,d).Bi(c);for(const [e,f]of b)Y(a,e,f);b=a.W();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}vt(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Nd.set(olympe.dc.ea(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}In(a,b){this.j.In(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}aA(a,b=!0){olympe.ha.Wa('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
|
|
1212
|
+
return this.persist(a,b)}Bi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){cm(this.j,a.j);return this}zn(a){this.j.zn(a);return this}mb(){return new Promise((a,b)=>{this.j.mb((c,d)=>{c?a(new olympe.sc.nj(this.D)):b(d)})})}Jn(){return new Promise((a,b)=>{this.j.Jn((c,d)=>{c?a(new olympe.sc.nj(this.D)):b(d)})})}};olympe.sc.Ya.prototype.executeAsLarge=olympe.sc.Ya.prototype.Jn;olympe.sc.Ya.prototype.execute=olympe.sc.Ya.prototype.mb;olympe.sc.Ya.prototype.afterExecution=olympe.sc.Ya.prototype.zn;
|
|
1213
|
+
olympe.sc.Ya.prototype.merge=olympe.sc.Ya.prototype.merge;olympe.sc.Ya.prototype.model=olympe.sc.Ya.prototype.model;olympe.sc.Ya.prototype.setSource=olympe.sc.Ya.prototype.Bi;olympe.sc.Ya.prototype.persistInstance=olympe.sc.Ya.prototype.aA;olympe.sc.Ya.prototype.persist=olympe.sc.Ya.prototype.persist;olympe.sc.Ya.prototype.deleteAllRelations=olympe.sc.Ya.prototype.In;olympe.sc.Ya.prototype.deleteRelation=olympe.sc.Ya.prototype.hc;olympe.sc.Ya.prototype.createRelation=olympe.sc.Ya.prototype.Oa;
|
|
1214
1214
|
olympe.sc.Ya.prototype['delete']=olympe.sc.Ya.prototype.delete;olympe.sc.Ya.prototype.multiUpdate=olympe.sc.Ya.prototype.vt;olympe.sc.Ya.prototype.update=olympe.sc.Ya.prototype.update;olympe.sc.Ya.prototype.create=olympe.sc.Ya.prototype.create;olympe.sc.Ya.prototype.getId=olympe.sc.Ya.prototype.T;olympe.sc.Ya.process=olympe.sc.Ya.process;olympe.sc.Ya.from=olympe.sc.Ya.from;olympe.sc.nj=class{constructor(a){this.j=a}wy(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.nj.prototype.getCreatedObjects=olympe.sc.nj.prototype.wy;olympe.zc={};olympe.zc.Vt=class{run(){}};function vo(a,b='default'){return a.j===b}
|
|
1215
1215
|
olympe.zc.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)}Oj(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),
|
|
1216
1216
|
this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.zc.Oj=function(a,b,c='default'){const d=a.Wa();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.zc.Config.ie+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.yd(olympe.zc.P.Ea).config(c,[b],(e,f)=>f.Oj(e,c,b),e=>vo(e,c),'olympe.hc.registerApp')};olympe.zc.P={Ea:'hc.Manager',Ca:'hc.Logger'};olympe.zc.Config={ie:'hc.app',Wp:'hc.globalToken'};olympe.V.config(function(a){E(a,olympe.zc.Config.ie,'default');E(a,olympe.zc.Config.Wp,!1);D(a,olympe.zc.P.Ca,[olympe.ha.P.Ea],b=>b.dd('hc'));D(a,olympe.Eb.P.bh,[new olympe.V.ma(olympe.zc.Config.ie)],b=>b);D(a,olympe.auth.P.Nl,[olympe.Eb.P.bh,new olympe.V.ma(olympe.zc.Config.Wp)],(b,c)=>new olympe.auth.Bo(c?'':b));C(a,olympe.zc.P.Ea,olympe.zc.Ta,new olympe.V.ma(olympe.zc.Config.ie),olympe.zc.P.Ca)},'olympe.hc');
|
|
1217
1217
|
olympe.V.run([olympe.zc.P.Ea],a=>a.run(),'olympe.hc');olympe.sc.nb={};function wo(a){a.X=a.F.H(()=>u(function*(){return xo(a)}),'Stop application')}function yo(a){a.R=a.F.j(()=>olympe.C.Qa(a.Z)===olympe.C.da.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Le.j.READINESS)}
|
|
1218
|
-
function zo(a){if(a.wa)return a.G.debug('Sending getContext request'),Mi(a.Ha).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;go=null;eo=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=rn(a.D);!b&&ml();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Db(),d=new Promise((f,g)=>{const h=olympe.dc.ga(),k=new olympe.C.Zb('Primordial Subscription Context',c);Ai(k,a.j,l=>{l=h.
|
|
1218
|
+
function zo(a){if(a.wa)return a.G.debug('Sending getContext request'),Mi(a.Ha).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;go=null;eo=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=rn(a.D);!b&&ml();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Db(),d=new Promise((f,g)=>{const h=olympe.dc.ga(),k=new olympe.C.Zb('Primordial Subscription Context',c);Ai(k,a.j,l=>{l=h.yi(l)?l:h.model(l);return null!==l&&
|
|
1219
1219
|
h.Nb(l,olympe.sc.Ch)},{nd:b?olympe.dc.la.oc.Sg:olympe.dc.la.oc.xf,lo:!0,qt:!0}).subscribe(rxjs.Subscriber.create(c.tc(()=>{h.Nb(a.j,olympe.sc.qa.Qc)?(a.Ua.X(a.j,b),f()):Nd(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.Yc([a.ia.we()],g=>{olympe.dc.la.re(g,olympe.dm.User,olympe.dc.Ia.SERVER).observe(c,
|
|
1220
1220
|
{nd:olympe.dc.la.oc.Gk,hl:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.ba)return Ao(a);Ao(a).then(()=>{})})}
|
|
1221
|
-
function Bo(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ga();if(0<a.j.length){const c=Qf(b,a.j,a.D.Db().tc((f,g)=>{if(f)if(f=Vn(g),f instanceof olympe.sc.qa.
|
|
1221
|
+
function Bo(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ga();if(0<a.j.length){const c=Qf(b,a.j,a.D.Db().tc((f,g)=>{if(f)if(f=Vn(g),f instanceof olympe.sc.qa.Hi){a.G.debug('application retrieved: running');g=on(a.D,f);const h=new olympe.sc.$a.mw(a.H);ob(a.H,()=>Bn(a.D.state,h));pb(a.H,()=>{var k=h.T();return Dn(a.D.state,k)});a.lb&&a.H.start();f.run(g);'string'===typeof a.wb&&(new olympe.sc.ae).ba(f.W(),g,a.G);g.Nt(olympe.sc.xa.j.ro).then(()=>{var k;null==(k=d)||k.cancel();a.Z.update(olympe.C.da.D);
|
|
1222
1222
|
a.G.info(`Application ${olympe.dc.ga().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.de();k.Vb=!0;k.X+=0;k.me.next(0<k.X);0===k.X&&k.Z&&k.Vb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.Ua.set('__code-as-data-version__',k.version),k.wb||(k.Z=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else xo(a)}));olympe.C.Za().onDestroy(()=>{Of(b,a.j,c)});const d=Bc(()=>{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)`)},
|
|
1223
1223
|
3E4);let e;null==(e=a.Vb)||e.start()}}function Ao(a){return u(function*(){Co(a.j)&&(yield ho(a.j,a.ba).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function xo(a){a.G.info('Stop the application');a.D.Db().ug();a.F.D(a.R);a.F.F(a.X)}
|
|
1224
1224
|
olympe.sc.nb.en=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ia=b;this.N=c;this.Ha=d;this.F=e;this.X=this.R='';this.D=f;this.Ua=g;this.H=h;this.Vb=l;this.j=k.get('appTag');this.wa=k.get('getContextMode');let n;this.wb=null!=(n=k.get('debuggerName'))?n:null;this.lb=k.get('autostartProfiler');this.ba=k.get('requireBusinessContainer');this.Z=olympe.C.bc(olympe.C.da).update(olympe.C.da.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;wo(this);yo(this);const b=olympe.L.vc.j.cj,
|
|
1225
1225
|
c=olympe.L.vc.j.Ff,d=olympe.L.vc.j.Ac;olympe.C.Yc([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,zo(this).then(olympe.C.Za().tc(()=>Bo(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.nb.en.j='app_instance';olympe.sc.nb.en.ya=[olympe.zc.Vt];olympe.sc.nb.vw=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.Dj();this.G.debug('Request headers',b);return b.origin?b.origin:b.iA?(new URL(b.iA)).origin:b[olympe.net.ra.Headers.Mp]&&
|
|
1226
1226
|
b[olympe.net.ra.Headers.Np]?b[olympe.net.ra.Headers.Np]+'://'+b[olympe.net.ra.Headers.Mp]:null};this.D.D('manifest',`${this.F}/:${'appTag'}`,[olympe.net.ra.Gd.GET],(b,c)=>{const d=this;return u(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.rd('Invalid appTag',olympe.net.ra.Ub.Rl);try{var f=yield olympe.dc.la.re(e,olympe.sc.qa.Qc).mb()}catch(h){return new olympe.net.rd(`Something went wrong: ${'string'===typeof h?
|
|
1227
|
-
h:h.message}`,olympe.net.ra.Ub.Rl)}if(0===f.size())return new olympe.net.rd('App not found',olympe.net.ra.Ub
|
|
1228
|
-
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.rd(JSON.stringify(e),olympe.net.ra.Ub.
|
|
1227
|
+
h:h.message}`,olympe.net.ra.Ub.Rl)}if(0===f.size())return new olympe.net.rd('App not found',olympe.net.ra.Ub.$i);var g=a(b);f=f.Kc();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.V.getParameter(`app.manifest.${e}`);if(!f)f={};else if('string'===
|
|
1228
|
+
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.rd(JSON.stringify(e),olympe.net.ra.Ub.Vh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function Co(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.la.from(a).bb(olympe.sc.qa.Qc.j).bb(olympe.dm.Ed.F.ac()).bb(olympe.dm.Ed.j).Dc();a=olympe.dc.la.from(a).bb(olympe.sc.qa.Qc.j).bb(olympe.dm.hb.D).Dc();return c.concat(a).has(b)}
|
|
1229
1229
|
olympe.sc.nb.Wk=class extends olympe.dc.sources.Wk{R(a){return this.db.Nb(a,olympe.sc.Bc)}X(a,b){if(!this.H){super.init();var c=olympe.dc.td.from(a).bb(olympe.sc.qa.Qc.j).Dc();if(!(c instanceof olympe.dm.hb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.la.oc.Sg:olympe.dc.la.oc.xf;dl(this,c,b);c=new olympe.C.Zb('deployed data sources');olympe.dc.la.from(a).bb(olympe.sc.qa.Qc.ia).observe(c,{nd:b}).subscribe(d=>{const e=
|
|
1230
1230
|
new olympe.dc.Ya;d.zj().forEach(f=>{e.Oa(olympe.dm.DataSource.Nj,this.j,f)});d.Fj().forEach(f=>{e.hc(olympe.dm.DataSource.Nj,this.j,f)});e.mb()})}}};function Do(a){a.j||(a.j=setInterval(()=>{a.flush().catch(()=>{})},a.Z),'function'===typeof a.j.unref&&a.j.unref())}function Eo(a,b){return u(function*(){var c=N(re(a.R,olympe.L.Ob.Bp),olympe.net.ra.Gd.Rg,JSON.stringify(b),olympe.net.ra.ResponseType.mn);const d=de(a.N);O(c,{[olympe.net.ra.Headers.Eh]:olympe.net.ra.bk.JSON,[olympe.net.ra.Headers.Ql]:d.zd()});c=yield zj(a.X,c);a.G.trace('[Event Monitor] Response:',c)})}
|
|
1231
1231
|
olympe.sc.zu=class{constructor(a,b,c,d,e,f,g,h){this.G=a;this.X=b;this.N=c;this.R=d;this.H=e;this.F=f;this.Z='number'===typeof g?Math.max(1E3,g):36E5;this.host=h;this.D=new Map;this.j=null;this.F&&Do(this)}isEnabled(){return this.F}track(a,b){this.G.trace('[Event Monitor] tracking',a,b,this.F);this.F&&(a=`${a}||${b}`,b=this.D.get(a)||0,this.D.set(a,b+1))}flush(){const a=this;return u(function*(){if(0!==a.D.size){a.G.debug('[Event Monitor] flushing');var b=(new Date).toISOString(),c=[],d=olympe.dc.ga().name(a.H);
|
|
1232
1232
|
for(const [e,f]of a.D.entries()){const [g,h]=e.split('||');c.push({host:a.host,serviceAppName:d,eventType:g,eventName:h,count:f,timestamp:b})}try{yield Eo(a,c),a.G.debug('[Event Monitor] flush done'),a.D.clear()}catch(e){a.G.warn('[EventMonitor] flush failed:',(null==e?void 0:e.message)||e)}}})}destroy(){this.j&&(clearInterval(this.j),this.j=null);this.D.clear()}};olympe.sc.nb.P={mg:'sc.runtime.Main',bf:'sc.runtime.SourceSolver',Mr:'sc.runtime.appConfig',Pr:'sc.runtime.runtimeHTTPServiceConfig',Nr:'sc.runtime.RuntimeHTTPService',er:'sc.runtime.OfflineAppConfig',Cp:'sc.runtime.EventMonitor'};olympe.sc.nb.Config={hq:'app.httpManifestPath',Kq:'app.manifest.common',Gq:'sc.loadBusinessContainer',Dp:'eventMonitor.enabled',Ep:'eventMonitor.flushFrequency'};
|
|
1233
|
-
olympe.V.config(function(a){E(a,olympe.sc.nb.Config.hq,'/runtime/manifest');E(a,olympe.sc.nb.Config.Kq,null);E(a,olympe.sc.nb.Config.Gq,!1);E(a,olympe.sc.nb.Config.Dp,!0);E(a,olympe.sc.nb.Config.Ep,36E5);D(a,olympe.Eb.P.bh,[new olympe.V.ma(olympe.zc.Config.ie),new olympe.V.ma(olympe.sc.Config.ie)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.nb.P.er,[new olympe.V.ma(olympe.sc.Config.ie),new olympe.V.ma(olympe.net.Config.
|
|
1234
|
-
e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.Pm,olympe.sc.nb.P.er);C(a,olympe.sc.nb.P.bf,olympe.sc.nb.Wk,olympe.dc.P.Gh,new olympe.V.ma(olympe.dc.Config.Zg),new olympe.V.ma(olympe.dc.Config.mm));Wa(a,olympe.dc.sources.P.bf,olympe.sc.nb.P.bf);D(a,olympe.sc.nb.P.Mr,[new olympe.V.ma(olympe.sc.Config.ie),new olympe.V.ma(olympe.dc.Config.
|
|
1233
|
+
olympe.V.config(function(a){E(a,olympe.sc.nb.Config.hq,'/runtime/manifest');E(a,olympe.sc.nb.Config.Kq,null);E(a,olympe.sc.nb.Config.Gq,!1);E(a,olympe.sc.nb.Config.Dp,!0);E(a,olympe.sc.nb.Config.Ep,36E5);D(a,olympe.Eb.P.bh,[new olympe.V.ma(olympe.zc.Config.ie),new olympe.V.ma(olympe.sc.Config.ie)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.nb.P.er,[new olympe.V.ma(olympe.sc.Config.ie),new olympe.V.ma(olympe.net.Config.Uh),new olympe.V.ma(olympe.net.Config.Om)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?
|
|
1234
|
+
e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Wa(a,olympe.net.P.Pm,olympe.sc.nb.P.er);C(a,olympe.sc.nb.P.bf,olympe.sc.nb.Wk,olympe.dc.P.Gh,new olympe.V.ma(olympe.dc.Config.Zg),new olympe.V.ma(olympe.dc.Config.mm));Wa(a,olympe.dc.sources.P.bf,olympe.sc.nb.P.bf);D(a,olympe.sc.nb.P.Mr,[new olympe.V.ma(olympe.sc.Config.ie),new olympe.V.ma(olympe.dc.Config.bi),new olympe.V.ma(olympe.sc.Config.np),new olympe.V.ma(olympe.sc.Config.uo),
|
|
1235
1235
|
new olympe.V.ma(olympe.sc.nb.Config.Gq)],(b,c,d,e,f)=>new Map([['appTag',b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));C(a,olympe.sc.nb.P.mg,olympe.sc.nb.en,olympe.sc.P.Ca,olympe.auth.P.Ea,olympe.L.P.wf,olympe.dc.query.P.Jk,olympe.host.P.Ie,olympe.sc.P.Ok,olympe.sc.nb.P.bf,olympe.U.P.lg,olympe.sc.nb.P.Mr,olympe.sc.nb.P.Nr);D(a,olympe.sc.nb.P.Pr,[new olympe.V.ma(olympe.sc.nb.Config.hq),new olympe.V.ma(olympe.sc.nb.Config.Kq)],(b,c)=>new Map([['httpManifestPath',
|
|
1236
1236
|
b],['manifestCommon',c]]));C(a,olympe.sc.nb.P.Cp,olympe.sc.zu,olympe.sc.P.Ca,olympe.dc.sources.P.sk,olympe.auth.P.Ea,olympe.L.P.rk,new olympe.V.ma(olympe.sc.Config.ie),new olympe.V.ma(olympe.sc.nb.Config.Dp),new olympe.V.ma(olympe.sc.nb.Config.Ep),new olympe.V.ma(olympe.L.Config.Xo));C(a,olympe.sc.nb.P.Nr,olympe.sc.nb.vw,olympe.sc.P.Ca,olympe.net.P.oj,olympe.sc.P.Ok,olympe.sc.nb.P.Pr);olympe.zc.Oj(a,olympe.sc.nb.P.mg,'sc.runtime');olympe.zc.Oj(a,olympe.sc.nb.P.mg,'sc.headless');olympe.zc.Oj(a,olympe.sc.nb.P.mg)},
|
|
1237
1237
|
'olympe.sc.runtime');olympe.V.run([olympe.sc.nb.P.Cp],a=>{olympe.sc.nb.nl=()=>a});olympe.public={};olympe.public.Ma=class a{static ly(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 tf(olympe.public.Ma.get())}static yl(b){return a.D(olympe.public.Ma.get().yl(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static yy(){return olympe.C.Qa(olympe.public.Ma.get().we())}static Vz(b){return a.D(olympe.public.Ma.get().we(),b)}static ve(){var b=olympe.C,c=b.Qa;var d=olympe.public.Ma.get().ed.ub().zd();return c.call(b,
|
|
1238
|
-
d)}static zg(){return new Promise((b,c)=>{olympe.public.Ma.get().zg(d=>d?c(d):b())})}static Ky(){return olympe.C.Qa(olympe.public.Ma.get().
|
|
1238
|
+
d)}static zg(){return new Promise((b,c)=>{olympe.public.Ma.get().zg(d=>d?c(d):b())})}static Ky(){return olympe.C.Qa(olympe.public.Ma.get().vi())||void 0}static jz(){const b=de(olympe.public.Ma.get());return{user:b.yc(),userTag:b.we(),nonce:b.zd(),payload:b.jc(),idpName:b.Ef(),protocol:b.Ng()}}static Jy(){return Array.from(uf().keys())}static sf(){olympe.public.Ma.get().sf()}static th(b){return new Promise((c,d)=>{olympe.public.Ma.get().th(b,e=>e?d(e):c())})}static Cz(b,c){return olympe.public.Ma.j((new Map).set('username',
|
|
1239
1239
|
b).set('password',c),olympe.auth.Fc.j.SRP)}static Dz(b){const c=uf();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 Bz(){return olympe.public.Ma.j(new Map,olympe.auth.Fc.j.SAML)}static Ez(b,c){return olympe.public.Ma.j((new Map).set('username',b).set('nonce',
|
|
1240
1240
|
c),olympe.auth.Fc.j.Qm)}static Az(){return olympe.public.Ma.j(new Map,olympe.auth.Fc.j.OAUTH2)}static Kj(){return olympe.public.Ma.get().Kj()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{sf(olympe.public.Ma.get(),d,c,()=>{e()})})}static get(){return olympe.auth.te()}static D(b,c){return b.asObservable('function'===typeof c.Db?c.Db():c)}};olympe.public.Ma.logout=olympe.public.Ma.Kj;olympe.public.Ma.loginOpenID=olympe.public.Ma.Az;
|
|
1241
1241
|
olympe.public.Ma.loginToken=olympe.public.Ma.Ez;olympe.public.Ma.loginSAML=olympe.public.Ma.Bz;olympe.public.Ma.loginSSO=olympe.public.Ma.Dz;olympe.public.Ma.loginSRP=olympe.public.Ma.Cz;olympe.public.Ma.getUserFromToken=olympe.public.Ma.th;olympe.public.Ma.sendKeepAlive=olympe.public.Ma.sf;olympe.public.Ma.getIDPNames=olympe.public.Ma.Jy;olympe.public.Ma.getUserToken=olympe.public.Ma.jz;olympe.public.Ma.getIDPToken=olympe.public.Ma.Ky;olympe.public.Ma.refreshToken=olympe.public.Ma.zg;
|
|
1242
|
-
olympe.public.Ma.getToken=olympe.public.Ma.ve;olympe.public.Ma.observeUser=olympe.public.Ma.Vz;olympe.public.Ma.getCurrentUser=olympe.public.Ma.yy;olympe.public.Ma.isAuthenticated=olympe.public.Ma.yl;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.ly;olympe.public.Config=class{static getParameter(a){return olympe.V.getParameter(a)}static setParameter(a,b){return olympe.V.
|
|
1242
|
+
olympe.public.Ma.getToken=olympe.public.Ma.ve;olympe.public.Ma.observeUser=olympe.public.Ma.Vz;olympe.public.Ma.getCurrentUser=olympe.public.Ma.yy;olympe.public.Ma.isAuthenticated=olympe.public.Ma.yl;olympe.public.Ma.getState=olympe.public.Ma.getState;olympe.public.Ma.generateSRPData=olympe.public.Ma.ly;olympe.public.Config=class{static getParameter(a){return olympe.V.getParameter(a)}static setParameter(a,b){return olympe.V.Di(a,b)}};olympe.public.Config.setParameter=olympe.public.Config.setParameter;olympe.public.Config.getParameter=olympe.public.Config.getParameter;olympe.public.za=class{static create(a){return new class extends olympe.dc.Y.Cg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.bc(olympe.C.da),e=b.subscribe(f=>d.update(olympe.C.Sb(f)));olympe.C.Za().Yd(()=>e.unsubscribe());return d.ub()}}}};
|
|
1243
1243
|
olympe.public.yf=class{static create(a){return new class extends olympe.dc.xc.Cg{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.$),e=b.subscribe(f=>d.update(olympe.C.sa(f)));olympe.C.Za().Yd(()=>e.unsubscribe());return d.ub()}}}};olympe.public.Process=class{static Xz(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.rl(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.D(d)}static Yz(a,b,c){const d=olympe.host.rl(),e=d.ia(a,b,c);return()=>d.F(e)}static connect(){return olympe.L.Mn().connect()}static disconnect(){return olympe.L.Mn().disconnect()}static rf(a){a='function'===typeof a.Db?a.Db():a;return olympe.L.Mn().rf().asObservable(a).pipe(rxjs.operators.map(b=>
|
|
1244
1244
|
b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.rf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Yz;olympe.public.Process.onHealthCheck=olympe.public.Process.Xz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ra.Relation,Direction:olympe.dc.va,generateTag:olympe.U.jf,tagToString:olympe.dc.ea,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Rs,defineInverseRelation:olympe.dc.Tx,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.xa.j,registerBrick:olympe.sc.logic.oa.j,FunctionBrick:olympe.sc.logic.Function,
|
|
1245
|
-
Context:olympe.sc.xa,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.ig,EnumValue:olympe.sc.
|
|
1246
|
-
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Ya,BurstTransaction:olympe.dc.
|
|
1245
|
+
Context:olympe.sc.xa,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.ig,EnumValue:olympe.sc.Oi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.Id,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.df,WorkflowTransition:olympe.sc.workflow.Transition,
|
|
1246
|
+
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Ya,BurstTransaction:olympe.dc.Ji,TransactionResult:olympe.sc.nj,PredefinedDataSource:olympe.dc.Ia,QueryResult:olympe.dc.Ka,Query:olympe.dc.la,QuerySingle:olympe.dc.td,Predicate:olympe.dc.query.za,Order:olympe.dc.query.Fk,Config:olympe.public.Config,Process:olympe.public.Process,ProbeType:olympe.host.Le.j,EventMonitor:class{static track(a,b){olympe.sc.nb.nl().track(a,b)}static isEnabled(){return olympe.sc.nb.nl().isEnabled()}},
|
|
1247
1247
|
Cache:{getCacheEntries:()=>olympe.dc.sources.de().N,clearCache:a=>tl(olympe.dc.sources.de(),a),getProcessingStatus:()=>olympe.dc.sources.de().Lc(),getProcessingErrors:()=>olympe.dc.sources.de().jd.asObservable(),hasPendingChanges:()=>olympe.dc.sources.de().ba.asObservable(),synchroniseChanges:()=>zl(),getPendingChanges:()=>Cl(),clearPendingChanges:()=>Gl(),loadPendingChanges:a=>El(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.pa.j,ServiceRequest:olympe.L.Gc,
|
|
1248
|
-
Service:olympe.L.rb,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Tj,GUEST:olympe.auth.Ta.j.
|
|
1249
|
-
RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.kb{static get(){return olympe.dc.ga()}},ListDef:olympe.dc.Aa,instanceToTag:olympe.dc.ea,registerSync:olympe.dc.oa.j,getUniqueTag:olympe.U.jf,onDestroy:a=>olympe.C.Za().onDestroy(a),offDestroy:a=>olympe.C.Za().Zf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.aa.af,RecursiveRelated:olympe.dc.aa.Me,Distinct:olympe.dc.aa.
|
|
1250
|
-
predicates:{And:olympe.dc.Y.Pd,Or:olympe.dc.Y.He,Not:olympe.dc.Y.ke,Equals:olympe.dc.Y.De,Contains:olympe.dc.Y.zf,Greater:olympe.dc.Y.pk,Smaller:olympe.dc.Y.Vk,HasRelated:olympe.dc.Y.
|
|
1248
|
+
Service:olympe.L.rb,Auth:olympe.public.Ma,AuthState:{INIT:olympe.auth.Ta.j.INIT,AUTHENTICATING:olympe.auth.Ta.j.Tj,GUEST:olympe.auth.Ta.j.Ri,AUTHENTICATED:olympe.auth.Ta.j.tf,ERROR:olympe.auth.Ta.j.Bb},AuthProtocol:olympe.auth.Fc.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,
|
|
1249
|
+
RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.kb{static get(){return olympe.dc.ga()}},ListDef:olympe.dc.Aa,instanceToTag:olympe.dc.ea,registerSync:olympe.dc.oa.j,getUniqueTag:olympe.U.jf,onDestroy:a=>olympe.C.Za().onDestroy(a),offDestroy:a=>olympe.C.Za().Zf(a),FollowRules:olympe.dc.Lb,transformers:{Related:olympe.dc.aa.af,RecursiveRelated:olympe.dc.aa.Me,Distinct:olympe.dc.aa.Mi,Filter:olympe.dc.aa.Af,Limit:olympe.dc.aa.Qh,Sort:olympe.dc.aa.dh,Union:olympe.dc.aa.Mf},ListDefPredicate:olympe.public.za,
|
|
1250
|
+
predicates:{And:olympe.dc.Y.Pd,Or:olympe.dc.Y.He,Not:olympe.dc.Y.ke,Equals:olympe.dc.Y.De,Contains:olympe.dc.Y.zf,Greater:olympe.dc.Y.pk,Smaller:olympe.dc.Y.Vk,HasRelated:olympe.dc.Y.Ti,InstanceOf:olympe.dc.Y.Wi,Regex:olympe.dc.Y.If},Comparator:olympe.public.yf,comparators:{Number:olympe.dc.xc.Number,String:olympe.dc.xc.String,DateTime:olympe.dc.xc.DateTime},valuedefs:{BooleanProperty:olympe.dc.ab.Xj,StringProperty:olympe.dc.ab.kj,NumberProperty:olympe.dc.ab.bj,DateTimeProperty:olympe.dc.ab.Li,Constant:olympe.dc.ab.Xe,
|
|
1251
1251
|
Tag:olympe.dc.ab.lj}});
|
|
1252
1252
|
|
|
1253
1253
|
|