Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nx-js/observer-util

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nx-js/observer-util - npm Package Compare versions

Comparing version 4.1.1 to 4.1.2

29

dist/cjs.es5.js

@@ -287,4 +287,4 @@ 'use strict';

// simple objects are not wrapped by Proxies, neither instrumented
var dontInstrument = new Set([Date, RegExp]);
// eslint-disable-next-line
var globalObj = Function("return this")();

@@ -295,9 +295,9 @@ // built-in object can not be wrapped by Proxies

// which switch the proxy to the raw object and to add reactive wiring
var handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers]]);
var handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers], [Object, false], [Array, false], [Int8Array, false], [Uint8Array, false], [Uint8ClampedArray, false], [Int16Array, false], [Uint16Array, false], [Int32Array, false], [Uint32Array, false], [Float32Array, false], [Float64Array, false]]);
function shouldInstrument(obj) {
if (typeof Node === 'function' && obj instanceof Node) {
return false;
}
return !dontInstrument.has(obj.constructor);
function shouldInstrument(ref) {
var constructor = ref.constructor;
var isBuiltIn = typeof constructor === 'function' && constructor.name in globalObj && globalObj[constructor.name] === constructor;
return !isBuiltIn || handlers.has(constructor);
}

@@ -322,7 +322,16 @@

// this is needed to intercept property access on that object too (dynamic observable tree)
var observableResult = rawToProxy.get(result);
if (hasRunningReaction() && typeof result === 'object' && result !== null) {
return observable(result);
if (observableResult) {
return observableResult;
}
// do not violate the none-configurable none-writable prop get handler invariant
// fall back to none reactive mode in this case, instead of letting the Proxy throw a TypeError
var descriptor = Reflect.getOwnPropertyDescriptor(target, key);
if (!descriptor || !(descriptor.writable === false && descriptor.configurable === false)) {
return observable(result);
}
}
// otherwise return the observable wrapper if it is already created and cached or the raw object
return rawToProxy.get(result) || result;
return observableResult || result;
}

@@ -329,0 +338,0 @@

@@ -1,1 +0,1 @@

'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var connectionStore=new WeakMap,ITERATION_KEY=Symbol('iteration key');function storeObservable(a){connectionStore.set(a,Object.create(null))}function registerReactionForOperation(a,b){var c=b.target,d=b.key,e=b.type;'iterate'===e&&(d=ITERATION_KEY);var f=connectionStore.get(c),g=f[d];g||(f[d]=g=new Set),g.has(a)||(g.add(a),a.cleaners.push(g))}function getReactionsForOperation(a){var b=a.target,c=a.key,d=a.type,e=connectionStore.get(b),f=new Set;if('clear'===d)for(var g in e)addReactionsForKey(f,e,g);else addReactionsForKey(f,e,c);if('add'===d||'delete'===d||'clear'===d){var h=Array.isArray(b)?'length':ITERATION_KEY;addReactionsForKey(f,e,h)}return f}function addReactionsForKey(a,b,c){var d=b[c];d&&d.forEach(a.add,a)}function releaseReaction(a){a.cleaners&&a.cleaners.forEach(releaseReactionKeyConnection,a),a.cleaners=[]}function releaseReactionKeyConnection(a){a.delete(this)}var runningReaction,isDebugging=!1;function runAsReaction(a,b,c,d){if(a.unobserved)return b.apply(c,d);releaseReaction(a);try{return runningReaction=a,b.apply(c,d)}finally{runningReaction=void 0}}function registerRunningReactionForOperation(a){runningReaction&&(debugOperation(runningReaction,a),registerReactionForOperation(runningReaction,a))}function queueReactionsForOperation(a){getReactionsForOperation(a).forEach(queueReaction,a)}function queueReaction(a){debugOperation(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function debugOperation(a,b){if(a.debugger&&!isDebugging)try{isDebugging=!0,a.debugger(b)}finally{isDebugging=!1}}function hasRunningReaction(){return runningReaction!==void 0}var IS_REACTION=Symbol('is reaction');function observe(a,b){void 0===b&&(b={});var c=a[IS_REACTION]?a:function b(){return runAsReaction(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[IS_REACTION]=!0,b.lazy||c(),c}function unobserve(a){a.unobserved||(a.unobserved=!0,releaseReaction(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}var proxyToRaw=new WeakMap,rawToProxy=new WeakMap,getPrototypeOf=Object.getPrototypeOf,hasOwnProperty=Object.prototype.hasOwnProperty,instrumentations={has:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this);return registerRunningReactionForOperation({target:c,key:b,type:'has'}),d.has.apply(c,arguments)},get:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this);return registerRunningReactionForOperation({target:c,key:b,type:'get'}),d.get.apply(c,arguments)},add:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,b),f=d.add.apply(c,arguments);return e||queueReactionsForOperation({target:c,key:b,value:b,type:'add'}),f},set:function a(b,c){var d=proxyToRaw.get(this),e=getPrototypeOf(this),f=e.has.call(d,b),g=e.get.call(d,b),h=e.set.apply(d,arguments);return f?c!==g&&queueReactionsForOperation({target:d,key:b,value:c,oldValue:g,type:'set'}):queueReactionsForOperation({target:d,key:b,value:c,type:'add'}),h},delete:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,b),f=d.get?d.get.call(c,b):void 0,g=d.delete.apply(c,arguments);return e&&queueReactionsForOperation({target:c,key:b,oldValue:f,type:'delete'}),g},clear:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this),d=0!==b.size,e=b instanceof Map?new Map(b):new Set(b),f=c.clear.apply(b,arguments);return d&&queueReactionsForOperation({target:b,oldTarget:e,type:'clear'}),f},forEach:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.forEach.apply(b,arguments)},keys:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.keys.apply(b,arguments)},values:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.values.apply(b,arguments)},entries:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.entries.apply(b,arguments)},get size(){var a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};instrumentations[Symbol.iterator]=function(){var a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)};var collectionHandlers={get:function a(b,c,d){return b=hasOwnProperty.call(instrumentations,c)?instrumentations:b,Reflect.get(b,c,d)}},dontInstrument=new Set([Date,RegExp]),handlers=new Map([[Map,collectionHandlers],[Set,collectionHandlers],[WeakMap,collectionHandlers],[WeakSet,collectionHandlers]]);function shouldInstrument(a){return'function'==typeof Node&&a instanceof Node?!1:!dontInstrument.has(a.constructor)}function getHandlers(a){return handlers.get(a.constructor)}var hasOwnProperty$1=Object.prototype.hasOwnProperty;function get(a,b,c){var d=Reflect.get(a,b,c);return'symbol'==typeof b||'function'==typeof d?d:(registerRunningReactionForOperation({target:a,key:b,receiver:c,type:'get'}),hasRunningReaction()&&'object'==typeof d&&null!==d?observable(d):rawToProxy.get(d)||d)}function has(a,b){var c=Reflect.has(a,b);return'symbol'==typeof b?c:(registerRunningReactionForOperation({target:a,key:b,type:'has'}),c)}function ownKeys(a){return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.ownKeys(a)}function set(a,b,c,d){'object'==typeof c&&null!==c&&(c=proxyToRaw.get(c)||c);var e=hasOwnProperty$1.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return hasRunningReaction()?(console.error('Mutating observables in reactions is forbidden. You set '+b+' to '+c+'.'),g):'symbol'==typeof b||a!==proxyToRaw.get(d)?g:(e?c!==f&&queueReactionsForOperation({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):queueReactionsForOperation({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function deleteProperty(a,b){var c=hasOwnProperty$1.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&queueReactionsForOperation({target:a,key:b,oldValue:d,type:'delete'}),e}var baseHandlers={get:get,has:has,ownKeys:ownKeys,set:set,deleteProperty:deleteProperty};function observable(a){return void 0===a&&(a={}),proxyToRaw.has(a)||!shouldInstrument(a)?a:rawToProxy.get(a)||createObservable(a)}function createObservable(a){var b=getHandlers(a)||baseHandlers,c=new Proxy(a,b);return rawToProxy.set(a,c),proxyToRaw.set(c,a),storeObservable(a),c}function isObservable(a){return proxyToRaw.has(a)}function raw(a){return proxyToRaw.get(a)||a}exports.observe=observe,exports.unobserve=unobserve,exports.observable=observable,exports.isObservable=isObservable,exports.raw=raw;
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});var connectionStore=new WeakMap,ITERATION_KEY=Symbol('iteration key');function storeObservable(a){connectionStore.set(a,Object.create(null))}function registerReactionForOperation(a,b){var c=b.target,d=b.key,e=b.type;'iterate'===e&&(d=ITERATION_KEY);var f=connectionStore.get(c),g=f[d];g||(f[d]=g=new Set),g.has(a)||(g.add(a),a.cleaners.push(g))}function getReactionsForOperation(a){var b=a.target,c=a.key,d=a.type,e=connectionStore.get(b),f=new Set;if('clear'===d)for(var g in e)addReactionsForKey(f,e,g);else addReactionsForKey(f,e,c);if('add'===d||'delete'===d||'clear'===d){var h=Array.isArray(b)?'length':ITERATION_KEY;addReactionsForKey(f,e,h)}return f}function addReactionsForKey(a,b,c){var d=b[c];d&&d.forEach(a.add,a)}function releaseReaction(a){a.cleaners&&a.cleaners.forEach(releaseReactionKeyConnection,a),a.cleaners=[]}function releaseReactionKeyConnection(a){a.delete(this)}var runningReaction,isDebugging=!1;function runAsReaction(a,b,c,d){if(a.unobserved)return b.apply(c,d);releaseReaction(a);try{return runningReaction=a,b.apply(c,d)}finally{runningReaction=void 0}}function registerRunningReactionForOperation(a){runningReaction&&(debugOperation(runningReaction,a),registerReactionForOperation(runningReaction,a))}function queueReactionsForOperation(a){getReactionsForOperation(a).forEach(queueReaction,a)}function queueReaction(a){debugOperation(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function debugOperation(a,b){if(a.debugger&&!isDebugging)try{isDebugging=!0,a.debugger(b)}finally{isDebugging=!1}}function hasRunningReaction(){return runningReaction!==void 0}var IS_REACTION=Symbol('is reaction');function observe(a,b){void 0===b&&(b={});var c=a[IS_REACTION]?a:function b(){return runAsReaction(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[IS_REACTION]=!0,b.lazy||c(),c}function unobserve(a){a.unobserved||(a.unobserved=!0,releaseReaction(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}var proxyToRaw=new WeakMap,rawToProxy=new WeakMap,getPrototypeOf=Object.getPrototypeOf,hasOwnProperty=Object.prototype.hasOwnProperty,instrumentations={has:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this);return registerRunningReactionForOperation({target:c,key:b,type:'has'}),d.has.apply(c,arguments)},get:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this);return registerRunningReactionForOperation({target:c,key:b,type:'get'}),d.get.apply(c,arguments)},add:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,b),f=d.add.apply(c,arguments);return e||queueReactionsForOperation({target:c,key:b,value:b,type:'add'}),f},set:function a(b,c){var d=proxyToRaw.get(this),e=getPrototypeOf(this),f=e.has.call(d,b),g=e.get.call(d,b),h=e.set.apply(d,arguments);return f?c!==g&&queueReactionsForOperation({target:d,key:b,value:c,oldValue:g,type:'set'}):queueReactionsForOperation({target:d,key:b,value:c,type:'add'}),h},delete:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,b),f=d.get?d.get.call(c,b):void 0,g=d.delete.apply(c,arguments);return e&&queueReactionsForOperation({target:c,key:b,oldValue:f,type:'delete'}),g},clear:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this),d=0!==b.size,e=b instanceof Map?new Map(b):new Set(b),f=c.clear.apply(b,arguments);return d&&queueReactionsForOperation({target:b,oldTarget:e,type:'clear'}),f},forEach:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.forEach.apply(b,arguments)},keys:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.keys.apply(b,arguments)},values:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.values.apply(b,arguments)},entries:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.entries.apply(b,arguments)},get size(){var a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};instrumentations[Symbol.iterator]=function(){var a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)};var collectionHandlers={get:function a(b,c,d){return b=hasOwnProperty.call(instrumentations,c)?instrumentations:b,Reflect.get(b,c,d)}},globalObj=Function('return this')(),handlers=new Map([[Map,collectionHandlers],[Set,collectionHandlers],[WeakMap,collectionHandlers],[WeakSet,collectionHandlers],[Object,!1],[Array,!1],[Int8Array,!1],[Uint8Array,!1],[Uint8ClampedArray,!1],[Int16Array,!1],[Uint16Array,!1],[Int32Array,!1],[Uint32Array,!1],[Float32Array,!1],[Float64Array,!1]]);function shouldInstrument(a){var b=a.constructor,c='function'==typeof b&&b.name in globalObj&&globalObj[b.name]===b;return!c||handlers.has(b)}function getHandlers(a){return handlers.get(a.constructor)}var hasOwnProperty$1=Object.prototype.hasOwnProperty;function get(a,b,c){var d=Reflect.get(a,b,c);if('symbol'==typeof b||'function'==typeof d)return d;registerRunningReactionForOperation({target:a,key:b,receiver:c,type:'get'});var e=rawToProxy.get(d);if(hasRunningReaction()&&'object'==typeof d&&null!==d){if(e)return e;var f=Reflect.getOwnPropertyDescriptor(a,b);if(!f||!1!==f.writable||!1!==f.configurable)return observable(d)}return e||d}function has(a,b){var c=Reflect.has(a,b);return'symbol'==typeof b?c:(registerRunningReactionForOperation({target:a,key:b,type:'has'}),c)}function ownKeys(a){return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.ownKeys(a)}function set(a,b,c,d){'object'==typeof c&&null!==c&&(c=proxyToRaw.get(c)||c);var e=hasOwnProperty$1.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return hasRunningReaction()?(console.error('Mutating observables in reactions is forbidden. You set '+b+' to '+c+'.'),g):'symbol'==typeof b||a!==proxyToRaw.get(d)?g:(e?c!==f&&queueReactionsForOperation({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):queueReactionsForOperation({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function deleteProperty(a,b){var c=hasOwnProperty$1.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&queueReactionsForOperation({target:a,key:b,oldValue:d,type:'delete'}),e}var baseHandlers={get:get,has:has,ownKeys:ownKeys,set:set,deleteProperty:deleteProperty};function observable(a){return void 0===a&&(a={}),proxyToRaw.has(a)||!shouldInstrument(a)?a:rawToProxy.get(a)||createObservable(a)}function createObservable(a){var b=getHandlers(a)||baseHandlers,c=new Proxy(a,b);return rawToProxy.set(a,c),proxyToRaw.set(c,a),storeObservable(a),c}function isObservable(a){return proxyToRaw.has(a)}function raw(a){return proxyToRaw.get(a)||a}exports.observe=observe,exports.unobserve=unobserve,exports.observable=observable,exports.isObservable=isObservable,exports.raw=raw;

@@ -277,4 +277,4 @@ 'use strict';

// simple objects are not wrapped by Proxies, neither instrumented
const dontInstrument = new Set([Date, RegExp]);
// eslint-disable-next-line
const globalObj = Function("return this")();

@@ -285,9 +285,7 @@ // built-in object can not be wrapped by Proxies

// which switch the proxy to the raw object and to add reactive wiring
const handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers]]);
const handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers], [Object, false], [Array, false], [Int8Array, false], [Uint8Array, false], [Uint8ClampedArray, false], [Int16Array, false], [Uint16Array, false], [Int32Array, false], [Uint32Array, false], [Float32Array, false], [Float64Array, false]]);
function shouldInstrument(obj) {
if (typeof Node === 'function' && obj instanceof Node) {
return false;
}
return !dontInstrument.has(obj.constructor);
function shouldInstrument({ constructor }) {
const isBuiltIn = typeof constructor === 'function' && constructor.name in globalObj && globalObj[constructor.name] === constructor;
return !isBuiltIn || handlers.has(constructor);
}

@@ -312,7 +310,16 @@

// this is needed to intercept property access on that object too (dynamic observable tree)
const observableResult = rawToProxy.get(result);
if (hasRunningReaction() && typeof result === 'object' && result !== null) {
return observable(result);
if (observableResult) {
return observableResult;
}
// do not violate the none-configurable none-writable prop get handler invariant
// fall back to none reactive mode in this case, instead of letting the Proxy throw a TypeError
const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
if (!descriptor || !(descriptor.writable === false && descriptor.configurable === false)) {
return observable(result);
}
}
// otherwise return the observable wrapper if it is already created and cached or the raw object
return rawToProxy.get(result) || result;
return observableResult || result;
}

@@ -319,0 +326,0 @@

@@ -1,1 +0,1 @@

'use strict';Object.defineProperty(exports,'__esModule',{value:!0});const connectionStore=new WeakMap,ITERATION_KEY=Symbol('iteration key');function storeObservable(a){connectionStore.set(a,Object.create(null))}function registerReactionForOperation(a,{target:b,key:c,type:d}){'iterate'===d&&(c=ITERATION_KEY);const e=connectionStore.get(b);let f=e[c];f||(e[c]=f=new Set),f.has(a)||(f.add(a),a.cleaners.push(f))}function getReactionsForOperation({target:a,key:b,type:c}){const d=connectionStore.get(a),e=new Set;if('clear'===c)for(let a in d)addReactionsForKey(e,d,a);else addReactionsForKey(e,d,b);if('add'===c||'delete'===c||'clear'===c){const b=Array.isArray(a)?'length':ITERATION_KEY;addReactionsForKey(e,d,b)}return e}function addReactionsForKey(a,b,c){const d=b[c];d&&d.forEach(a.add,a)}function releaseReaction(a){a.cleaners&&a.cleaners.forEach(releaseReactionKeyConnection,a),a.cleaners=[]}function releaseReactionKeyConnection(a){a.delete(this)}let runningReaction,isDebugging=!1;function runAsReaction(a,b,c,d){if(a.unobserved)return b.apply(c,d);releaseReaction(a);try{return runningReaction=a,b.apply(c,d)}finally{runningReaction=void 0}}function registerRunningReactionForOperation(a){runningReaction&&(debugOperation(runningReaction,a),registerReactionForOperation(runningReaction,a))}function queueReactionsForOperation(a){getReactionsForOperation(a).forEach(queueReaction,a)}function queueReaction(a){debugOperation(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function debugOperation(a,b){if(a.debugger&&!isDebugging)try{isDebugging=!0,a.debugger(b)}finally{isDebugging=!1}}function hasRunningReaction(){return runningReaction!==void 0}const IS_REACTION=Symbol('is reaction');function observe(a,b={}){const c=a[IS_REACTION]?a:function b(){return runAsReaction(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[IS_REACTION]=!0,b.lazy||c(),c}function unobserve(a){a.unobserved||(a.unobserved=!0,releaseReaction(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}const proxyToRaw=new WeakMap,rawToProxy=new WeakMap,getPrototypeOf=Object.getPrototypeOf,hasOwnProperty=Object.prototype.hasOwnProperty,instrumentations={has(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,key:a,type:'has'}),c.has.apply(b,arguments)},get(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,key:a,type:'get'}),c.get.apply(b,arguments)},add(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this),d=c.has.call(b,a),e=c.add.apply(b,arguments);return d||queueReactionsForOperation({target:b,key:a,value:a,type:'add'}),e},set(a,b){const c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,a),f=d.get.call(c,a),g=d.set.apply(c,arguments);return e?b!==f&&queueReactionsForOperation({target:c,key:a,value:b,oldValue:f,type:'set'}):queueReactionsForOperation({target:c,key:a,value:b,type:'add'}),g},delete(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this),d=c.has.call(b,a),e=c.get?c.get.call(b,a):void 0,f=c.delete.apply(b,arguments);return d&&queueReactionsForOperation({target:b,key:a,oldValue:e,type:'delete'}),f},clear(){const a=proxyToRaw.get(this),b=getPrototypeOf(this),c=0!==a.size,d=a instanceof Map?new Map(a):new Set(a),e=b.clear.apply(a,arguments);return c&&queueReactionsForOperation({target:a,oldTarget:d,type:'clear'}),e},forEach(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.forEach.apply(a,arguments)},keys(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.keys.apply(a,arguments)},values(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.values.apply(a,arguments)},entries(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.entries.apply(a,arguments)},[Symbol.iterator](){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)},get size(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};var collectionHandlers={get(a,b,c){return a=hasOwnProperty.call(instrumentations,b)?instrumentations:a,Reflect.get(a,b,c)}};const dontInstrument=new Set([Date,RegExp]),handlers=new Map([[Map,collectionHandlers],[Set,collectionHandlers],[WeakMap,collectionHandlers],[WeakSet,collectionHandlers]]);function shouldInstrument(a){return'function'==typeof Node&&a instanceof Node?!1:!dontInstrument.has(a.constructor)}function getHandlers(a){return handlers.get(a.constructor)}const hasOwnProperty$1=Object.prototype.hasOwnProperty;function get(a,b,c){const d=Reflect.get(a,b,c);return'symbol'==typeof b||'function'==typeof d?d:(registerRunningReactionForOperation({target:a,key:b,receiver:c,type:'get'}),hasRunningReaction()&&'object'==typeof d&&null!==d?observable(d):rawToProxy.get(d)||d)}function has(a,b){const c=Reflect.has(a,b);return'symbol'==typeof b?c:(registerRunningReactionForOperation({target:a,key:b,type:'has'}),c)}function ownKeys(a){return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.ownKeys(a)}function set(a,b,c,d){'object'==typeof c&&null!==c&&(c=proxyToRaw.get(c)||c);const e=hasOwnProperty$1.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return hasRunningReaction()?(console.error(`Mutating observables in reactions is forbidden. You set ${b} to ${c}.`),g):'symbol'==typeof b||a!==proxyToRaw.get(d)?g:(e?c!==f&&queueReactionsForOperation({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):queueReactionsForOperation({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function deleteProperty(a,b){const c=hasOwnProperty$1.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&queueReactionsForOperation({target:a,key:b,oldValue:d,type:'delete'}),e}var baseHandlers={get,has,ownKeys,set,deleteProperty};function observable(a={}){return proxyToRaw.has(a)||!shouldInstrument(a)?a:rawToProxy.get(a)||createObservable(a)}function createObservable(a){const b=getHandlers(a)||baseHandlers,c=new Proxy(a,b);return rawToProxy.set(a,c),proxyToRaw.set(c,a),storeObservable(a),c}function isObservable(a){return proxyToRaw.has(a)}function raw(a){return proxyToRaw.get(a)||a}exports.observe=observe,exports.unobserve=unobserve,exports.observable=observable,exports.isObservable=isObservable,exports.raw=raw;
'use strict';Object.defineProperty(exports,'__esModule',{value:!0});const connectionStore=new WeakMap,ITERATION_KEY=Symbol('iteration key');function storeObservable(a){connectionStore.set(a,Object.create(null))}function registerReactionForOperation(a,{target:b,key:c,type:d}){'iterate'===d&&(c=ITERATION_KEY);const e=connectionStore.get(b);let f=e[c];f||(e[c]=f=new Set),f.has(a)||(f.add(a),a.cleaners.push(f))}function getReactionsForOperation({target:a,key:b,type:c}){const d=connectionStore.get(a),e=new Set;if('clear'===c)for(let a in d)addReactionsForKey(e,d,a);else addReactionsForKey(e,d,b);if('add'===c||'delete'===c||'clear'===c){const b=Array.isArray(a)?'length':ITERATION_KEY;addReactionsForKey(e,d,b)}return e}function addReactionsForKey(a,b,c){const d=b[c];d&&d.forEach(a.add,a)}function releaseReaction(a){a.cleaners&&a.cleaners.forEach(releaseReactionKeyConnection,a),a.cleaners=[]}function releaseReactionKeyConnection(a){a.delete(this)}let runningReaction,isDebugging=!1;function runAsReaction(a,b,c,d){if(a.unobserved)return b.apply(c,d);releaseReaction(a);try{return runningReaction=a,b.apply(c,d)}finally{runningReaction=void 0}}function registerRunningReactionForOperation(a){runningReaction&&(debugOperation(runningReaction,a),registerReactionForOperation(runningReaction,a))}function queueReactionsForOperation(a){getReactionsForOperation(a).forEach(queueReaction,a)}function queueReaction(a){debugOperation(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function debugOperation(a,b){if(a.debugger&&!isDebugging)try{isDebugging=!0,a.debugger(b)}finally{isDebugging=!1}}function hasRunningReaction(){return runningReaction!==void 0}const IS_REACTION=Symbol('is reaction');function observe(a,b={}){const c=a[IS_REACTION]?a:function b(){return runAsReaction(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[IS_REACTION]=!0,b.lazy||c(),c}function unobserve(a){a.unobserved||(a.unobserved=!0,releaseReaction(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}const proxyToRaw=new WeakMap,rawToProxy=new WeakMap,getPrototypeOf=Object.getPrototypeOf,hasOwnProperty=Object.prototype.hasOwnProperty,instrumentations={has(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,key:a,type:'has'}),c.has.apply(b,arguments)},get(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,key:a,type:'get'}),c.get.apply(b,arguments)},add(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this),d=c.has.call(b,a),e=c.add.apply(b,arguments);return d||queueReactionsForOperation({target:b,key:a,value:a,type:'add'}),e},set(a,b){const c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,a),f=d.get.call(c,a),g=d.set.apply(c,arguments);return e?b!==f&&queueReactionsForOperation({target:c,key:a,value:b,oldValue:f,type:'set'}):queueReactionsForOperation({target:c,key:a,value:b,type:'add'}),g},delete(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this),d=c.has.call(b,a),e=c.get?c.get.call(b,a):void 0,f=c.delete.apply(b,arguments);return d&&queueReactionsForOperation({target:b,key:a,oldValue:e,type:'delete'}),f},clear(){const a=proxyToRaw.get(this),b=getPrototypeOf(this),c=0!==a.size,d=a instanceof Map?new Map(a):new Set(a),e=b.clear.apply(a,arguments);return c&&queueReactionsForOperation({target:a,oldTarget:d,type:'clear'}),e},forEach(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.forEach.apply(a,arguments)},keys(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.keys.apply(a,arguments)},values(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.values.apply(a,arguments)},entries(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.entries.apply(a,arguments)},[Symbol.iterator](){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)},get size(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};var collectionHandlers={get(a,b,c){return a=hasOwnProperty.call(instrumentations,b)?instrumentations:a,Reflect.get(a,b,c)}};const globalObj=Function('return this')(),handlers=new Map([[Map,collectionHandlers],[Set,collectionHandlers],[WeakMap,collectionHandlers],[WeakSet,collectionHandlers],[Object,!1],[Array,!1],[Int8Array,!1],[Uint8Array,!1],[Uint8ClampedArray,!1],[Int16Array,!1],[Uint16Array,!1],[Int32Array,!1],[Uint32Array,!1],[Float32Array,!1],[Float64Array,!1]]);function shouldInstrument({constructor:a}){const b='function'==typeof a&&a.name in globalObj&&globalObj[a.name]===a;return!b||handlers.has(a)}function getHandlers(a){return handlers.get(a.constructor)}const hasOwnProperty$1=Object.prototype.hasOwnProperty;function get(a,b,c){const d=Reflect.get(a,b,c);if('symbol'==typeof b||'function'==typeof d)return d;registerRunningReactionForOperation({target:a,key:b,receiver:c,type:'get'});const e=rawToProxy.get(d);if(hasRunningReaction()&&'object'==typeof d&&null!==d){if(e)return e;const c=Reflect.getOwnPropertyDescriptor(a,b);if(!c||!1!==c.writable||!1!==c.configurable)return observable(d)}return e||d}function has(a,b){const c=Reflect.has(a,b);return'symbol'==typeof b?c:(registerRunningReactionForOperation({target:a,key:b,type:'has'}),c)}function ownKeys(a){return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.ownKeys(a)}function set(a,b,c,d){'object'==typeof c&&null!==c&&(c=proxyToRaw.get(c)||c);const e=hasOwnProperty$1.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return hasRunningReaction()?(console.error(`Mutating observables in reactions is forbidden. You set ${b} to ${c}.`),g):'symbol'==typeof b||a!==proxyToRaw.get(d)?g:(e?c!==f&&queueReactionsForOperation({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):queueReactionsForOperation({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function deleteProperty(a,b){const c=hasOwnProperty$1.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&queueReactionsForOperation({target:a,key:b,oldValue:d,type:'delete'}),e}var baseHandlers={get,has,ownKeys,set,deleteProperty};function observable(a={}){return proxyToRaw.has(a)||!shouldInstrument(a)?a:rawToProxy.get(a)||createObservable(a)}function createObservable(a){const b=getHandlers(a)||baseHandlers,c=new Proxy(a,b);return rawToProxy.set(a,c),proxyToRaw.set(c,a),storeObservable(a),c}function isObservable(a){return proxyToRaw.has(a)}function raw(a){return proxyToRaw.get(a)||a}exports.observe=observe,exports.unobserve=unobserve,exports.observable=observable,exports.isObservable=isObservable,exports.raw=raw;

@@ -283,4 +283,4 @@ var connectionStore = new WeakMap();

// simple objects are not wrapped by Proxies, neither instrumented
var dontInstrument = new Set([Date, RegExp]);
// eslint-disable-next-line
var globalObj = Function("return this")();

@@ -291,9 +291,9 @@ // built-in object can not be wrapped by Proxies

// which switch the proxy to the raw object and to add reactive wiring
var handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers]]);
var handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers], [Object, false], [Array, false], [Int8Array, false], [Uint8Array, false], [Uint8ClampedArray, false], [Int16Array, false], [Uint16Array, false], [Int32Array, false], [Uint32Array, false], [Float32Array, false], [Float64Array, false]]);
function shouldInstrument(obj) {
if (typeof Node === 'function' && obj instanceof Node) {
return false;
}
return !dontInstrument.has(obj.constructor);
function shouldInstrument(ref) {
var constructor = ref.constructor;
var isBuiltIn = typeof constructor === 'function' && constructor.name in globalObj && globalObj[constructor.name] === constructor;
return !isBuiltIn || handlers.has(constructor);
}

@@ -318,7 +318,16 @@

// this is needed to intercept property access on that object too (dynamic observable tree)
var observableResult = rawToProxy.get(result);
if (hasRunningReaction() && typeof result === 'object' && result !== null) {
return observable(result);
if (observableResult) {
return observableResult;
}
// do not violate the none-configurable none-writable prop get handler invariant
// fall back to none reactive mode in this case, instead of letting the Proxy throw a TypeError
var descriptor = Reflect.getOwnPropertyDescriptor(target, key);
if (!descriptor || !(descriptor.writable === false && descriptor.configurable === false)) {
return observable(result);
}
}
// otherwise return the observable wrapper if it is already created and cached or the raw object
return rawToProxy.get(result) || result;
return observableResult || result;
}

@@ -325,0 +334,0 @@

@@ -1,1 +0,1 @@

var connectionStore=new WeakMap,ITERATION_KEY=Symbol('iteration key');function storeObservable(a){connectionStore.set(a,Object.create(null))}function registerReactionForOperation(a,b){var c=b.target,d=b.key,e=b.type;'iterate'===e&&(d=ITERATION_KEY);var f=connectionStore.get(c),g=f[d];g||(f[d]=g=new Set),g.has(a)||(g.add(a),a.cleaners.push(g))}function getReactionsForOperation(a){var b=a.target,c=a.key,d=a.type,e=connectionStore.get(b),f=new Set;if('clear'===d)for(var g in e)addReactionsForKey(f,e,g);else addReactionsForKey(f,e,c);if('add'===d||'delete'===d||'clear'===d){var h=Array.isArray(b)?'length':ITERATION_KEY;addReactionsForKey(f,e,h)}return f}function addReactionsForKey(a,b,c){var d=b[c];d&&d.forEach(a.add,a)}function releaseReaction(a){a.cleaners&&a.cleaners.forEach(releaseReactionKeyConnection,a),a.cleaners=[]}function releaseReactionKeyConnection(a){a.delete(this)}var runningReaction,isDebugging=!1;function runAsReaction(a,b,c,d){if(a.unobserved)return b.apply(c,d);releaseReaction(a);try{return runningReaction=a,b.apply(c,d)}finally{runningReaction=void 0}}function registerRunningReactionForOperation(a){runningReaction&&(debugOperation(runningReaction,a),registerReactionForOperation(runningReaction,a))}function queueReactionsForOperation(a){getReactionsForOperation(a).forEach(queueReaction,a)}function queueReaction(a){debugOperation(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function debugOperation(a,b){if(a.debugger&&!isDebugging)try{isDebugging=!0,a.debugger(b)}finally{isDebugging=!1}}function hasRunningReaction(){return runningReaction!==void 0}var IS_REACTION=Symbol('is reaction');function observe(a,b){void 0===b&&(b={});var c=a[IS_REACTION]?a:function b(){return runAsReaction(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[IS_REACTION]=!0,b.lazy||c(),c}function unobserve(a){a.unobserved||(a.unobserved=!0,releaseReaction(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}var proxyToRaw=new WeakMap,rawToProxy=new WeakMap,getPrototypeOf=Object.getPrototypeOf,hasOwnProperty=Object.prototype.hasOwnProperty,instrumentations={has:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this);return registerRunningReactionForOperation({target:c,key:b,type:'has'}),d.has.apply(c,arguments)},get:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this);return registerRunningReactionForOperation({target:c,key:b,type:'get'}),d.get.apply(c,arguments)},add:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,b),f=d.add.apply(c,arguments);return e||queueReactionsForOperation({target:c,key:b,value:b,type:'add'}),f},set:function a(b,c){var d=proxyToRaw.get(this),e=getPrototypeOf(this),f=e.has.call(d,b),g=e.get.call(d,b),h=e.set.apply(d,arguments);return f?c!==g&&queueReactionsForOperation({target:d,key:b,value:c,oldValue:g,type:'set'}):queueReactionsForOperation({target:d,key:b,value:c,type:'add'}),h},delete:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,b),f=d.get?d.get.call(c,b):void 0,g=d.delete.apply(c,arguments);return e&&queueReactionsForOperation({target:c,key:b,oldValue:f,type:'delete'}),g},clear:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this),d=0!==b.size,e=b instanceof Map?new Map(b):new Set(b),f=c.clear.apply(b,arguments);return d&&queueReactionsForOperation({target:b,oldTarget:e,type:'clear'}),f},forEach:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.forEach.apply(b,arguments)},keys:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.keys.apply(b,arguments)},values:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.values.apply(b,arguments)},entries:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.entries.apply(b,arguments)},get size(){var a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};instrumentations[Symbol.iterator]=function(){var a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)};var collectionHandlers={get:function a(b,c,d){return b=hasOwnProperty.call(instrumentations,c)?instrumentations:b,Reflect.get(b,c,d)}},dontInstrument=new Set([Date,RegExp]),handlers=new Map([[Map,collectionHandlers],[Set,collectionHandlers],[WeakMap,collectionHandlers],[WeakSet,collectionHandlers]]);function shouldInstrument(a){return'function'==typeof Node&&a instanceof Node?!1:!dontInstrument.has(a.constructor)}function getHandlers(a){return handlers.get(a.constructor)}var hasOwnProperty$1=Object.prototype.hasOwnProperty;function get(a,b,c){var d=Reflect.get(a,b,c);return'symbol'==typeof b||'function'==typeof d?d:(registerRunningReactionForOperation({target:a,key:b,receiver:c,type:'get'}),hasRunningReaction()&&'object'==typeof d&&null!==d?observable(d):rawToProxy.get(d)||d)}function has(a,b){var c=Reflect.has(a,b);return'symbol'==typeof b?c:(registerRunningReactionForOperation({target:a,key:b,type:'has'}),c)}function ownKeys(a){return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.ownKeys(a)}function set(a,b,c,d){'object'==typeof c&&null!==c&&(c=proxyToRaw.get(c)||c);var e=hasOwnProperty$1.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return hasRunningReaction()?(console.error('Mutating observables in reactions is forbidden. You set '+b+' to '+c+'.'),g):'symbol'==typeof b||a!==proxyToRaw.get(d)?g:(e?c!==f&&queueReactionsForOperation({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):queueReactionsForOperation({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function deleteProperty(a,b){var c=hasOwnProperty$1.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&queueReactionsForOperation({target:a,key:b,oldValue:d,type:'delete'}),e}var baseHandlers={get:get,has:has,ownKeys:ownKeys,set:set,deleteProperty:deleteProperty};function observable(a){return void 0===a&&(a={}),proxyToRaw.has(a)||!shouldInstrument(a)?a:rawToProxy.get(a)||createObservable(a)}function createObservable(a){var b=getHandlers(a)||baseHandlers,c=new Proxy(a,b);return rawToProxy.set(a,c),proxyToRaw.set(c,a),storeObservable(a),c}function isObservable(a){return proxyToRaw.has(a)}function raw(a){return proxyToRaw.get(a)||a}export{observe,unobserve,observable,isObservable,raw};
var connectionStore=new WeakMap,ITERATION_KEY=Symbol('iteration key');function storeObservable(a){connectionStore.set(a,Object.create(null))}function registerReactionForOperation(a,b){var c=b.target,d=b.key,e=b.type;'iterate'===e&&(d=ITERATION_KEY);var f=connectionStore.get(c),g=f[d];g||(f[d]=g=new Set),g.has(a)||(g.add(a),a.cleaners.push(g))}function getReactionsForOperation(a){var b=a.target,c=a.key,d=a.type,e=connectionStore.get(b),f=new Set;if('clear'===d)for(var g in e)addReactionsForKey(f,e,g);else addReactionsForKey(f,e,c);if('add'===d||'delete'===d||'clear'===d){var h=Array.isArray(b)?'length':ITERATION_KEY;addReactionsForKey(f,e,h)}return f}function addReactionsForKey(a,b,c){var d=b[c];d&&d.forEach(a.add,a)}function releaseReaction(a){a.cleaners&&a.cleaners.forEach(releaseReactionKeyConnection,a),a.cleaners=[]}function releaseReactionKeyConnection(a){a.delete(this)}var runningReaction,isDebugging=!1;function runAsReaction(a,b,c,d){if(a.unobserved)return b.apply(c,d);releaseReaction(a);try{return runningReaction=a,b.apply(c,d)}finally{runningReaction=void 0}}function registerRunningReactionForOperation(a){runningReaction&&(debugOperation(runningReaction,a),registerReactionForOperation(runningReaction,a))}function queueReactionsForOperation(a){getReactionsForOperation(a).forEach(queueReaction,a)}function queueReaction(a){debugOperation(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function debugOperation(a,b){if(a.debugger&&!isDebugging)try{isDebugging=!0,a.debugger(b)}finally{isDebugging=!1}}function hasRunningReaction(){return runningReaction!==void 0}var IS_REACTION=Symbol('is reaction');function observe(a,b){void 0===b&&(b={});var c=a[IS_REACTION]?a:function b(){return runAsReaction(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[IS_REACTION]=!0,b.lazy||c(),c}function unobserve(a){a.unobserved||(a.unobserved=!0,releaseReaction(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}var proxyToRaw=new WeakMap,rawToProxy=new WeakMap,getPrototypeOf=Object.getPrototypeOf,hasOwnProperty=Object.prototype.hasOwnProperty,instrumentations={has:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this);return registerRunningReactionForOperation({target:c,key:b,type:'has'}),d.has.apply(c,arguments)},get:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this);return registerRunningReactionForOperation({target:c,key:b,type:'get'}),d.get.apply(c,arguments)},add:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,b),f=d.add.apply(c,arguments);return e||queueReactionsForOperation({target:c,key:b,value:b,type:'add'}),f},set:function a(b,c){var d=proxyToRaw.get(this),e=getPrototypeOf(this),f=e.has.call(d,b),g=e.get.call(d,b),h=e.set.apply(d,arguments);return f?c!==g&&queueReactionsForOperation({target:d,key:b,value:c,oldValue:g,type:'set'}):queueReactionsForOperation({target:d,key:b,value:c,type:'add'}),h},delete:function a(b){var c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,b),f=d.get?d.get.call(c,b):void 0,g=d.delete.apply(c,arguments);return e&&queueReactionsForOperation({target:c,key:b,oldValue:f,type:'delete'}),g},clear:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this),d=0!==b.size,e=b instanceof Map?new Map(b):new Set(b),f=c.clear.apply(b,arguments);return d&&queueReactionsForOperation({target:b,oldTarget:e,type:'clear'}),f},forEach:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.forEach.apply(b,arguments)},keys:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.keys.apply(b,arguments)},values:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.values.apply(b,arguments)},entries:function a(){var b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,type:'iterate'}),c.entries.apply(b,arguments)},get size(){var a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};instrumentations[Symbol.iterator]=function(){var a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)};var collectionHandlers={get:function a(b,c,d){return b=hasOwnProperty.call(instrumentations,c)?instrumentations:b,Reflect.get(b,c,d)}},globalObj=Function('return this')(),handlers=new Map([[Map,collectionHandlers],[Set,collectionHandlers],[WeakMap,collectionHandlers],[WeakSet,collectionHandlers],[Object,!1],[Array,!1],[Int8Array,!1],[Uint8Array,!1],[Uint8ClampedArray,!1],[Int16Array,!1],[Uint16Array,!1],[Int32Array,!1],[Uint32Array,!1],[Float32Array,!1],[Float64Array,!1]]);function shouldInstrument(a){var b=a.constructor,c='function'==typeof b&&b.name in globalObj&&globalObj[b.name]===b;return!c||handlers.has(b)}function getHandlers(a){return handlers.get(a.constructor)}var hasOwnProperty$1=Object.prototype.hasOwnProperty;function get(a,b,c){var d=Reflect.get(a,b,c);if('symbol'==typeof b||'function'==typeof d)return d;registerRunningReactionForOperation({target:a,key:b,receiver:c,type:'get'});var e=rawToProxy.get(d);if(hasRunningReaction()&&'object'==typeof d&&null!==d){if(e)return e;var f=Reflect.getOwnPropertyDescriptor(a,b);if(!f||!1!==f.writable||!1!==f.configurable)return observable(d)}return e||d}function has(a,b){var c=Reflect.has(a,b);return'symbol'==typeof b?c:(registerRunningReactionForOperation({target:a,key:b,type:'has'}),c)}function ownKeys(a){return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.ownKeys(a)}function set(a,b,c,d){'object'==typeof c&&null!==c&&(c=proxyToRaw.get(c)||c);var e=hasOwnProperty$1.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return hasRunningReaction()?(console.error('Mutating observables in reactions is forbidden. You set '+b+' to '+c+'.'),g):'symbol'==typeof b||a!==proxyToRaw.get(d)?g:(e?c!==f&&queueReactionsForOperation({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):queueReactionsForOperation({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function deleteProperty(a,b){var c=hasOwnProperty$1.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&queueReactionsForOperation({target:a,key:b,oldValue:d,type:'delete'}),e}var baseHandlers={get:get,has:has,ownKeys:ownKeys,set:set,deleteProperty:deleteProperty};function observable(a){return void 0===a&&(a={}),proxyToRaw.has(a)||!shouldInstrument(a)?a:rawToProxy.get(a)||createObservable(a)}function createObservable(a){var b=getHandlers(a)||baseHandlers,c=new Proxy(a,b);return rawToProxy.set(a,c),proxyToRaw.set(c,a),storeObservable(a),c}function isObservable(a){return proxyToRaw.has(a)}function raw(a){return proxyToRaw.get(a)||a}export{observe,unobserve,observable,isObservable,raw};

@@ -273,4 +273,4 @@ const connectionStore = new WeakMap();

// simple objects are not wrapped by Proxies, neither instrumented
const dontInstrument = new Set([Date, RegExp]);
// eslint-disable-next-line
const globalObj = Function("return this")();

@@ -281,9 +281,7 @@ // built-in object can not be wrapped by Proxies

// which switch the proxy to the raw object and to add reactive wiring
const handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers]]);
const handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers], [Object, false], [Array, false], [Int8Array, false], [Uint8Array, false], [Uint8ClampedArray, false], [Int16Array, false], [Uint16Array, false], [Int32Array, false], [Uint32Array, false], [Float32Array, false], [Float64Array, false]]);
function shouldInstrument(obj) {
if (typeof Node === 'function' && obj instanceof Node) {
return false;
}
return !dontInstrument.has(obj.constructor);
function shouldInstrument({ constructor }) {
const isBuiltIn = typeof constructor === 'function' && constructor.name in globalObj && globalObj[constructor.name] === constructor;
return !isBuiltIn || handlers.has(constructor);
}

@@ -308,7 +306,16 @@

// this is needed to intercept property access on that object too (dynamic observable tree)
const observableResult = rawToProxy.get(result);
if (hasRunningReaction() && typeof result === 'object' && result !== null) {
return observable(result);
if (observableResult) {
return observableResult;
}
// do not violate the none-configurable none-writable prop get handler invariant
// fall back to none reactive mode in this case, instead of letting the Proxy throw a TypeError
const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
if (!descriptor || !(descriptor.writable === false && descriptor.configurable === false)) {
return observable(result);
}
}
// otherwise return the observable wrapper if it is already created and cached or the raw object
return rawToProxy.get(result) || result;
return observableResult || result;
}

@@ -315,0 +322,0 @@

@@ -1,1 +0,1 @@

const connectionStore=new WeakMap,ITERATION_KEY=Symbol('iteration key');function storeObservable(a){connectionStore.set(a,Object.create(null))}function registerReactionForOperation(a,{target:b,key:c,type:d}){'iterate'===d&&(c=ITERATION_KEY);const e=connectionStore.get(b);let f=e[c];f||(e[c]=f=new Set),f.has(a)||(f.add(a),a.cleaners.push(f))}function getReactionsForOperation({target:a,key:b,type:c}){const d=connectionStore.get(a),e=new Set;if('clear'===c)for(let a in d)addReactionsForKey(e,d,a);else addReactionsForKey(e,d,b);if('add'===c||'delete'===c||'clear'===c){const b=Array.isArray(a)?'length':ITERATION_KEY;addReactionsForKey(e,d,b)}return e}function addReactionsForKey(a,b,c){const d=b[c];d&&d.forEach(a.add,a)}function releaseReaction(a){a.cleaners&&a.cleaners.forEach(releaseReactionKeyConnection,a),a.cleaners=[]}function releaseReactionKeyConnection(a){a.delete(this)}let runningReaction,isDebugging=!1;function runAsReaction(a,b,c,d){if(a.unobserved)return b.apply(c,d);releaseReaction(a);try{return runningReaction=a,b.apply(c,d)}finally{runningReaction=void 0}}function registerRunningReactionForOperation(a){runningReaction&&(debugOperation(runningReaction,a),registerReactionForOperation(runningReaction,a))}function queueReactionsForOperation(a){getReactionsForOperation(a).forEach(queueReaction,a)}function queueReaction(a){debugOperation(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function debugOperation(a,b){if(a.debugger&&!isDebugging)try{isDebugging=!0,a.debugger(b)}finally{isDebugging=!1}}function hasRunningReaction(){return runningReaction!==void 0}const IS_REACTION=Symbol('is reaction');function observe(a,b={}){const c=a[IS_REACTION]?a:function b(){return runAsReaction(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[IS_REACTION]=!0,b.lazy||c(),c}function unobserve(a){a.unobserved||(a.unobserved=!0,releaseReaction(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}const proxyToRaw=new WeakMap,rawToProxy=new WeakMap,getPrototypeOf=Object.getPrototypeOf,hasOwnProperty=Object.prototype.hasOwnProperty,instrumentations={has(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,key:a,type:'has'}),c.has.apply(b,arguments)},get(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,key:a,type:'get'}),c.get.apply(b,arguments)},add(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this),d=c.has.call(b,a),e=c.add.apply(b,arguments);return d||queueReactionsForOperation({target:b,key:a,value:a,type:'add'}),e},set(a,b){const c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,a),f=d.get.call(c,a),g=d.set.apply(c,arguments);return e?b!==f&&queueReactionsForOperation({target:c,key:a,value:b,oldValue:f,type:'set'}):queueReactionsForOperation({target:c,key:a,value:b,type:'add'}),g},delete(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this),d=c.has.call(b,a),e=c.get?c.get.call(b,a):void 0,f=c.delete.apply(b,arguments);return d&&queueReactionsForOperation({target:b,key:a,oldValue:e,type:'delete'}),f},clear(){const a=proxyToRaw.get(this),b=getPrototypeOf(this),c=0!==a.size,d=a instanceof Map?new Map(a):new Set(a),e=b.clear.apply(a,arguments);return c&&queueReactionsForOperation({target:a,oldTarget:d,type:'clear'}),e},forEach(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.forEach.apply(a,arguments)},keys(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.keys.apply(a,arguments)},values(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.values.apply(a,arguments)},entries(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.entries.apply(a,arguments)},[Symbol.iterator](){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)},get size(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};var collectionHandlers={get(a,b,c){return a=hasOwnProperty.call(instrumentations,b)?instrumentations:a,Reflect.get(a,b,c)}};const dontInstrument=new Set([Date,RegExp]),handlers=new Map([[Map,collectionHandlers],[Set,collectionHandlers],[WeakMap,collectionHandlers],[WeakSet,collectionHandlers]]);function shouldInstrument(a){return'function'==typeof Node&&a instanceof Node?!1:!dontInstrument.has(a.constructor)}function getHandlers(a){return handlers.get(a.constructor)}const hasOwnProperty$1=Object.prototype.hasOwnProperty;function get(a,b,c){const d=Reflect.get(a,b,c);return'symbol'==typeof b||'function'==typeof d?d:(registerRunningReactionForOperation({target:a,key:b,receiver:c,type:'get'}),hasRunningReaction()&&'object'==typeof d&&null!==d?observable(d):rawToProxy.get(d)||d)}function has(a,b){const c=Reflect.has(a,b);return'symbol'==typeof b?c:(registerRunningReactionForOperation({target:a,key:b,type:'has'}),c)}function ownKeys(a){return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.ownKeys(a)}function set(a,b,c,d){'object'==typeof c&&null!==c&&(c=proxyToRaw.get(c)||c);const e=hasOwnProperty$1.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return hasRunningReaction()?(console.error(`Mutating observables in reactions is forbidden. You set ${b} to ${c}.`),g):'symbol'==typeof b||a!==proxyToRaw.get(d)?g:(e?c!==f&&queueReactionsForOperation({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):queueReactionsForOperation({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function deleteProperty(a,b){const c=hasOwnProperty$1.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&queueReactionsForOperation({target:a,key:b,oldValue:d,type:'delete'}),e}var baseHandlers={get,has,ownKeys,set,deleteProperty};function observable(a={}){return proxyToRaw.has(a)||!shouldInstrument(a)?a:rawToProxy.get(a)||createObservable(a)}function createObservable(a){const b=getHandlers(a)||baseHandlers,c=new Proxy(a,b);return rawToProxy.set(a,c),proxyToRaw.set(c,a),storeObservable(a),c}function isObservable(a){return proxyToRaw.has(a)}function raw(a){return proxyToRaw.get(a)||a}export{observe,unobserve,observable,isObservable,raw};
const connectionStore=new WeakMap,ITERATION_KEY=Symbol('iteration key');function storeObservable(a){connectionStore.set(a,Object.create(null))}function registerReactionForOperation(a,{target:b,key:c,type:d}){'iterate'===d&&(c=ITERATION_KEY);const e=connectionStore.get(b);let f=e[c];f||(e[c]=f=new Set),f.has(a)||(f.add(a),a.cleaners.push(f))}function getReactionsForOperation({target:a,key:b,type:c}){const d=connectionStore.get(a),e=new Set;if('clear'===c)for(let a in d)addReactionsForKey(e,d,a);else addReactionsForKey(e,d,b);if('add'===c||'delete'===c||'clear'===c){const b=Array.isArray(a)?'length':ITERATION_KEY;addReactionsForKey(e,d,b)}return e}function addReactionsForKey(a,b,c){const d=b[c];d&&d.forEach(a.add,a)}function releaseReaction(a){a.cleaners&&a.cleaners.forEach(releaseReactionKeyConnection,a),a.cleaners=[]}function releaseReactionKeyConnection(a){a.delete(this)}let runningReaction,isDebugging=!1;function runAsReaction(a,b,c,d){if(a.unobserved)return b.apply(c,d);releaseReaction(a);try{return runningReaction=a,b.apply(c,d)}finally{runningReaction=void 0}}function registerRunningReactionForOperation(a){runningReaction&&(debugOperation(runningReaction,a),registerReactionForOperation(runningReaction,a))}function queueReactionsForOperation(a){getReactionsForOperation(a).forEach(queueReaction,a)}function queueReaction(a){debugOperation(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function debugOperation(a,b){if(a.debugger&&!isDebugging)try{isDebugging=!0,a.debugger(b)}finally{isDebugging=!1}}function hasRunningReaction(){return runningReaction!==void 0}const IS_REACTION=Symbol('is reaction');function observe(a,b={}){const c=a[IS_REACTION]?a:function b(){return runAsReaction(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[IS_REACTION]=!0,b.lazy||c(),c}function unobserve(a){a.unobserved||(a.unobserved=!0,releaseReaction(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}const proxyToRaw=new WeakMap,rawToProxy=new WeakMap,getPrototypeOf=Object.getPrototypeOf,hasOwnProperty=Object.prototype.hasOwnProperty,instrumentations={has(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,key:a,type:'has'}),c.has.apply(b,arguments)},get(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this);return registerRunningReactionForOperation({target:b,key:a,type:'get'}),c.get.apply(b,arguments)},add(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this),d=c.has.call(b,a),e=c.add.apply(b,arguments);return d||queueReactionsForOperation({target:b,key:a,value:a,type:'add'}),e},set(a,b){const c=proxyToRaw.get(this),d=getPrototypeOf(this),e=d.has.call(c,a),f=d.get.call(c,a),g=d.set.apply(c,arguments);return e?b!==f&&queueReactionsForOperation({target:c,key:a,value:b,oldValue:f,type:'set'}):queueReactionsForOperation({target:c,key:a,value:b,type:'add'}),g},delete(a){const b=proxyToRaw.get(this),c=getPrototypeOf(this),d=c.has.call(b,a),e=c.get?c.get.call(b,a):void 0,f=c.delete.apply(b,arguments);return d&&queueReactionsForOperation({target:b,key:a,oldValue:e,type:'delete'}),f},clear(){const a=proxyToRaw.get(this),b=getPrototypeOf(this),c=0!==a.size,d=a instanceof Map?new Map(a):new Set(a),e=b.clear.apply(a,arguments);return c&&queueReactionsForOperation({target:a,oldTarget:d,type:'clear'}),e},forEach(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.forEach.apply(a,arguments)},keys(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.keys.apply(a,arguments)},values(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.values.apply(a,arguments)},entries(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b.entries.apply(a,arguments)},[Symbol.iterator](){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)},get size(){const a=proxyToRaw.get(this),b=getPrototypeOf(this);return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};var collectionHandlers={get(a,b,c){return a=hasOwnProperty.call(instrumentations,b)?instrumentations:a,Reflect.get(a,b,c)}};const globalObj=Function('return this')(),handlers=new Map([[Map,collectionHandlers],[Set,collectionHandlers],[WeakMap,collectionHandlers],[WeakSet,collectionHandlers],[Object,!1],[Array,!1],[Int8Array,!1],[Uint8Array,!1],[Uint8ClampedArray,!1],[Int16Array,!1],[Uint16Array,!1],[Int32Array,!1],[Uint32Array,!1],[Float32Array,!1],[Float64Array,!1]]);function shouldInstrument({constructor:a}){const b='function'==typeof a&&a.name in globalObj&&globalObj[a.name]===a;return!b||handlers.has(a)}function getHandlers(a){return handlers.get(a.constructor)}const hasOwnProperty$1=Object.prototype.hasOwnProperty;function get(a,b,c){const d=Reflect.get(a,b,c);if('symbol'==typeof b||'function'==typeof d)return d;registerRunningReactionForOperation({target:a,key:b,receiver:c,type:'get'});const e=rawToProxy.get(d);if(hasRunningReaction()&&'object'==typeof d&&null!==d){if(e)return e;const c=Reflect.getOwnPropertyDescriptor(a,b);if(!c||!1!==c.writable||!1!==c.configurable)return observable(d)}return e||d}function has(a,b){const c=Reflect.has(a,b);return'symbol'==typeof b?c:(registerRunningReactionForOperation({target:a,key:b,type:'has'}),c)}function ownKeys(a){return registerRunningReactionForOperation({target:a,type:'iterate'}),Reflect.ownKeys(a)}function set(a,b,c,d){'object'==typeof c&&null!==c&&(c=proxyToRaw.get(c)||c);const e=hasOwnProperty$1.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return hasRunningReaction()?(console.error(`Mutating observables in reactions is forbidden. You set ${b} to ${c}.`),g):'symbol'==typeof b||a!==proxyToRaw.get(d)?g:(e?c!==f&&queueReactionsForOperation({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):queueReactionsForOperation({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function deleteProperty(a,b){const c=hasOwnProperty$1.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&queueReactionsForOperation({target:a,key:b,oldValue:d,type:'delete'}),e}var baseHandlers={get,has,ownKeys,set,deleteProperty};function observable(a={}){return proxyToRaw.has(a)||!shouldInstrument(a)?a:rawToProxy.get(a)||createObservable(a)}function createObservable(a){const b=getHandlers(a)||baseHandlers,c=new Proxy(a,b);return rawToProxy.set(a,c),proxyToRaw.set(c,a),storeObservable(a),c}function isObservable(a){return proxyToRaw.has(a)}function raw(a){return proxyToRaw.get(a)||a}export{observe,unobserve,observable,isObservable,raw};

@@ -289,4 +289,4 @@ (function (global, factory) {

// simple objects are not wrapped by Proxies, neither instrumented
var dontInstrument = new Set([Date, RegExp]);
// eslint-disable-next-line
var globalObj = Function("return this")();

@@ -297,9 +297,9 @@ // built-in object can not be wrapped by Proxies

// which switch the proxy to the raw object and to add reactive wiring
var handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers]]);
var handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers], [Object, false], [Array, false], [Int8Array, false], [Uint8Array, false], [Uint8ClampedArray, false], [Int16Array, false], [Uint16Array, false], [Int32Array, false], [Uint32Array, false], [Float32Array, false], [Float64Array, false]]);
function shouldInstrument(obj) {
if (typeof Node === 'function' && obj instanceof Node) {
return false;
}
return !dontInstrument.has(obj.constructor);
function shouldInstrument(ref) {
var constructor = ref.constructor;
var isBuiltIn = typeof constructor === 'function' && constructor.name in globalObj && globalObj[constructor.name] === constructor;
return !isBuiltIn || handlers.has(constructor);
}

@@ -324,7 +324,16 @@

// this is needed to intercept property access on that object too (dynamic observable tree)
var observableResult = rawToProxy.get(result);
if (hasRunningReaction() && typeof result === 'object' && result !== null) {
return observable(result);
if (observableResult) {
return observableResult;
}
// do not violate the none-configurable none-writable prop get handler invariant
// fall back to none reactive mode in this case, instead of letting the Proxy throw a TypeError
var descriptor = Reflect.getOwnPropertyDescriptor(target, key);
if (!descriptor || !(descriptor.writable === false && descriptor.configurable === false)) {
return observable(result);
}
}
// otherwise return the observable wrapper if it is already created and cached or the raw object
return rawToProxy.get(result) || result;
return observableResult || result;
}

@@ -331,0 +340,0 @@

@@ -1,1 +0,1 @@

(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?b(exports):'function'==typeof define&&define.amd?define(['exports'],b):b(a.observer={})})(this,function(a){'use strict';function b(a){B.set(a,Object.create(null))}function c(a,b){var c=b.target,d=b.key,e=b.type;'iterate'===e&&(d=C);var f=B.get(c),g=f[d];g||(f[d]=g=new Set),g.has(a)||(g.add(a),a.cleaners.push(g))}function d(a){var b=a.target,c=a.key,d=a.type,f=B.get(b),g=new Set;if('clear'===d)for(var h in f)e(g,f,h);else e(g,f,c);if('add'===d||'delete'===d||'clear'===d){var i=Array.isArray(b)?'length':C;e(g,f,i)}return g}function e(a,b,c){var d=b[c];d&&d.forEach(a.add,a)}function f(a){a.cleaners&&a.cleaners.forEach(g,a),a.cleaners=[]}function g(a){a.delete(this)}function h(a,b,c,d){if(a.unobserved)return b.apply(c,d);f(a);try{return A=a,b.apply(c,d)}finally{A=void 0}}function i(a){A&&(l(A,a),c(A,a))}function j(a){d(a).forEach(k,a)}function k(a){l(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function l(a,b){if(a.debugger&&!D)try{D=!0,a.debugger(b)}finally{D=!1}}function m(){return A!==void 0}function n(a,b){void 0===b&&(b={});var c=a[E]?a:function b(){return h(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[E]=!0,b.lazy||c(),c}function o(a){a.unobserved||(a.unobserved=!0,f(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}function p(a){return'function'==typeof Node&&a instanceof Node?!1:!L.has(a.constructor)}function q(a){return M.get(a.constructor)}function r(a,b,c){var d=Reflect.get(a,b,c);return'symbol'==typeof b||'function'==typeof d?d:(i({target:a,key:b,receiver:c,type:'get'}),m()&&'object'==typeof d&&null!==d?w(d):G.get(d)||d)}function s(a,b){var c=Reflect.has(a,b);return'symbol'==typeof b?c:(i({target:a,key:b,type:'has'}),c)}function t(a){return i({target:a,type:'iterate'}),Reflect.ownKeys(a)}function u(a,b,c,d){'object'==typeof c&&null!==c&&(c=F.get(c)||c);var e=N.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return m()?(console.error('Mutating observables in reactions is forbidden. You set '+b+' to '+c+'.'),g):'symbol'==typeof b||a!==F.get(d)?g:(e?c!==f&&j({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):j({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function v(a,b){var c=N.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&j({target:a,key:b,oldValue:d,type:'delete'}),e}function w(a){return void 0===a&&(a={}),F.has(a)||!p(a)?a:G.get(a)||x(a)}function x(a){var c=q(a)||O,d=new Proxy(a,c);return G.set(a,d),F.set(d,a),b(a),d}function y(a){return F.has(a)}function z(a){return F.get(a)||a}var A,B=new WeakMap,C=Symbol('iteration key'),D=!1,E=Symbol('is reaction'),F=new WeakMap,G=new WeakMap,H=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,J={has:function a(b){var c=F.get(this),d=H(this);return i({target:c,key:b,type:'has'}),d.has.apply(c,arguments)},get:function a(b){var c=F.get(this),d=H(this);return i({target:c,key:b,type:'get'}),d.get.apply(c,arguments)},add:function a(b){var c=F.get(this),d=H(this),e=d.has.call(c,b),f=d.add.apply(c,arguments);return e||j({target:c,key:b,value:b,type:'add'}),f},set:function a(b,c){var d=F.get(this),e=H(this),f=e.has.call(d,b),g=e.get.call(d,b),h=e.set.apply(d,arguments);return f?c!==g&&j({target:d,key:b,value:c,oldValue:g,type:'set'}):j({target:d,key:b,value:c,type:'add'}),h},delete:function a(b){var c=F.get(this),d=H(this),e=d.has.call(c,b),f=d.get?d.get.call(c,b):void 0,g=d.delete.apply(c,arguments);return e&&j({target:c,key:b,oldValue:f,type:'delete'}),g},clear:function a(){var b=F.get(this),c=H(this),d=0!==b.size,e=b instanceof Map?new Map(b):new Set(b),f=c.clear.apply(b,arguments);return d&&j({target:b,oldTarget:e,type:'clear'}),f},forEach:function a(){var b=F.get(this),c=H(this);return i({target:b,type:'iterate'}),c.forEach.apply(b,arguments)},keys:function a(){var b=F.get(this),c=H(this);return i({target:b,type:'iterate'}),c.keys.apply(b,arguments)},values:function a(){var b=F.get(this),c=H(this);return i({target:b,type:'iterate'}),c.values.apply(b,arguments)},entries:function a(){var b=F.get(this),c=H(this);return i({target:b,type:'iterate'}),c.entries.apply(b,arguments)},get size(){var a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};J[Symbol.iterator]=function(){var a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)};var K={get:function a(b,c,d){return b=I.call(J,c)?J:b,Reflect.get(b,c,d)}},L=new Set([Date,RegExp]),M=new Map([[Map,K],[Set,K],[WeakMap,K],[WeakSet,K]]),N=Object.prototype.hasOwnProperty,O={get:r,has:s,ownKeys:t,set:u,deleteProperty:v};a.observe=n,a.unobserve=o,a.observable=w,a.isObservable=y,a.raw=z,Object.defineProperty(a,'__esModule',{value:!0})});
(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?b(exports):'function'==typeof define&&define.amd?define(['exports'],b):b(a.observer={})})(this,function(a){'use strict';function b(a){B.set(a,Object.create(null))}function c(a,b){var c=b.target,d=b.key,e=b.type;'iterate'===e&&(d=C);var f=B.get(c),g=f[d];g||(f[d]=g=new Set),g.has(a)||(g.add(a),a.cleaners.push(g))}function d(a){var b=a.target,c=a.key,d=a.type,f=B.get(b),g=new Set;if('clear'===d)for(var h in f)e(g,f,h);else e(g,f,c);if('add'===d||'delete'===d||'clear'===d){var i=Array.isArray(b)?'length':C;e(g,f,i)}return g}function e(a,b,c){var d=b[c];d&&d.forEach(a.add,a)}function f(a){a.cleaners&&a.cleaners.forEach(g,a),a.cleaners=[]}function g(a){a.delete(this)}function h(a,b,c,d){if(a.unobserved)return b.apply(c,d);f(a);try{return A=a,b.apply(c,d)}finally{A=void 0}}function i(a){A&&(l(A,a),c(A,a))}function j(a){d(a).forEach(k,a)}function k(a){l(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function l(a,b){if(a.debugger&&!D)try{D=!0,a.debugger(b)}finally{D=!1}}function m(){return A!==void 0}function n(a,b){void 0===b&&(b={});var c=a[E]?a:function b(){return h(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[E]=!0,b.lazy||c(),c}function o(a){a.unobserved||(a.unobserved=!0,f(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}function p(a){var b=a.constructor,c='function'==typeof b&&b.name in L&&L[b.name]===b;return!c||M.has(b)}function q(a){return M.get(a.constructor)}function r(a,b,c){var d=Reflect.get(a,b,c);if('symbol'==typeof b||'function'==typeof d)return d;i({target:a,key:b,receiver:c,type:'get'});var e=G.get(d);if(m()&&'object'==typeof d&&null!==d){if(e)return e;var f=Reflect.getOwnPropertyDescriptor(a,b);if(!f||!1!==f.writable||!1!==f.configurable)return w(d)}return e||d}function s(a,b){var c=Reflect.has(a,b);return'symbol'==typeof b?c:(i({target:a,key:b,type:'has'}),c)}function t(a){return i({target:a,type:'iterate'}),Reflect.ownKeys(a)}function u(a,b,c,d){'object'==typeof c&&null!==c&&(c=F.get(c)||c);var e=N.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return m()?(console.error('Mutating observables in reactions is forbidden. You set '+b+' to '+c+'.'),g):'symbol'==typeof b||a!==F.get(d)?g:(e?c!==f&&j({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):j({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function v(a,b){var c=N.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&j({target:a,key:b,oldValue:d,type:'delete'}),e}function w(a){return void 0===a&&(a={}),F.has(a)||!p(a)?a:G.get(a)||x(a)}function x(a){var c=q(a)||O,d=new Proxy(a,c);return G.set(a,d),F.set(d,a),b(a),d}function y(a){return F.has(a)}function z(a){return F.get(a)||a}var A,B=new WeakMap,C=Symbol('iteration key'),D=!1,E=Symbol('is reaction'),F=new WeakMap,G=new WeakMap,H=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,J={has:function a(b){var c=F.get(this),d=H(this);return i({target:c,key:b,type:'has'}),d.has.apply(c,arguments)},get:function a(b){var c=F.get(this),d=H(this);return i({target:c,key:b,type:'get'}),d.get.apply(c,arguments)},add:function a(b){var c=F.get(this),d=H(this),e=d.has.call(c,b),f=d.add.apply(c,arguments);return e||j({target:c,key:b,value:b,type:'add'}),f},set:function a(b,c){var d=F.get(this),e=H(this),f=e.has.call(d,b),g=e.get.call(d,b),h=e.set.apply(d,arguments);return f?c!==g&&j({target:d,key:b,value:c,oldValue:g,type:'set'}):j({target:d,key:b,value:c,type:'add'}),h},delete:function a(b){var c=F.get(this),d=H(this),e=d.has.call(c,b),f=d.get?d.get.call(c,b):void 0,g=d.delete.apply(c,arguments);return e&&j({target:c,key:b,oldValue:f,type:'delete'}),g},clear:function a(){var b=F.get(this),c=H(this),d=0!==b.size,e=b instanceof Map?new Map(b):new Set(b),f=c.clear.apply(b,arguments);return d&&j({target:b,oldTarget:e,type:'clear'}),f},forEach:function a(){var b=F.get(this),c=H(this);return i({target:b,type:'iterate'}),c.forEach.apply(b,arguments)},keys:function a(){var b=F.get(this),c=H(this);return i({target:b,type:'iterate'}),c.keys.apply(b,arguments)},values:function a(){var b=F.get(this),c=H(this);return i({target:b,type:'iterate'}),c.values.apply(b,arguments)},entries:function a(){var b=F.get(this),c=H(this);return i({target:b,type:'iterate'}),c.entries.apply(b,arguments)},get size(){var a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};J[Symbol.iterator]=function(){var a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)};var K={get:function a(b,c,d){return b=I.call(J,c)?J:b,Reflect.get(b,c,d)}},L=Function('return this')(),M=new Map([[Map,K],[Set,K],[WeakMap,K],[WeakSet,K],[Object,!1],[Array,!1],[Int8Array,!1],[Uint8Array,!1],[Uint8ClampedArray,!1],[Int16Array,!1],[Uint16Array,!1],[Int32Array,!1],[Uint32Array,!1],[Float32Array,!1],[Float64Array,!1]]),N=Object.prototype.hasOwnProperty,O={get:r,has:s,ownKeys:t,set:u,deleteProperty:v};a.observe=n,a.unobserve=o,a.observable=w,a.isObservable=y,a.raw=z,Object.defineProperty(a,'__esModule',{value:!0})});

@@ -279,4 +279,4 @@ (function (global, factory) {

// simple objects are not wrapped by Proxies, neither instrumented
const dontInstrument = new Set([Date, RegExp]);
// eslint-disable-next-line
const globalObj = Function("return this")();

@@ -287,9 +287,7 @@ // built-in object can not be wrapped by Proxies

// which switch the proxy to the raw object and to add reactive wiring
const handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers]]);
const handlers = new Map([[Map, collectionHandlers], [Set, collectionHandlers], [WeakMap, collectionHandlers], [WeakSet, collectionHandlers], [Object, false], [Array, false], [Int8Array, false], [Uint8Array, false], [Uint8ClampedArray, false], [Int16Array, false], [Uint16Array, false], [Int32Array, false], [Uint32Array, false], [Float32Array, false], [Float64Array, false]]);
function shouldInstrument(obj) {
if (typeof Node === 'function' && obj instanceof Node) {
return false;
}
return !dontInstrument.has(obj.constructor);
function shouldInstrument({ constructor }) {
const isBuiltIn = typeof constructor === 'function' && constructor.name in globalObj && globalObj[constructor.name] === constructor;
return !isBuiltIn || handlers.has(constructor);
}

@@ -314,7 +312,16 @@

// this is needed to intercept property access on that object too (dynamic observable tree)
const observableResult = rawToProxy.get(result);
if (hasRunningReaction() && typeof result === 'object' && result !== null) {
return observable(result);
if (observableResult) {
return observableResult;
}
// do not violate the none-configurable none-writable prop get handler invariant
// fall back to none reactive mode in this case, instead of letting the Proxy throw a TypeError
const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
if (!descriptor || !(descriptor.writable === false && descriptor.configurable === false)) {
return observable(result);
}
}
// otherwise return the observable wrapper if it is already created and cached or the raw object
return rawToProxy.get(result) || result;
return observableResult || result;
}

@@ -321,0 +328,0 @@

@@ -1,1 +0,1 @@

(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?b(exports):'function'==typeof define&&define.amd?define(['exports'],b):b(a.observer={})})(this,function(a){'use strict';function b(a){A.set(a,Object.create(null))}function c(a,{target:b,key:c,type:d}){'iterate'===d&&(c=B);const e=A.get(b);let f=e[c];f||(e[c]=f=new Set),f.has(a)||(f.add(a),a.cleaners.push(f))}function d({target:a,key:b,type:c}){const d=A.get(a),f=new Set;if('clear'===c)for(let a in d)e(f,d,a);else e(f,d,b);if('add'===c||'delete'===c||'clear'===c){const b=Array.isArray(a)?'length':B;e(f,d,b)}return f}function e(a,b,c){const d=b[c];d&&d.forEach(a.add,a)}function f(a){a.cleaners&&a.cleaners.forEach(g,a),a.cleaners=[]}function g(a){a.delete(this)}function h(a,b,c,d){if(a.unobserved)return b.apply(c,d);f(a);try{return C=a,b.apply(c,d)}finally{C=void 0}}function i(a){C&&(l(C,a),c(C,a))}function j(a){d(a).forEach(k,a)}function k(a){l(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function l(a,b){if(a.debugger&&!D)try{D=!0,a.debugger(b)}finally{D=!1}}function m(){return C!==void 0}function n(a,b={}){const c=a[E]?a:function b(){return h(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[E]=!0,b.lazy||c(),c}function o(a){a.unobserved||(a.unobserved=!0,f(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}function p(a){return'function'==typeof Node&&a instanceof Node?!1:!L.has(a.constructor)}function q(a){return M.get(a.constructor)}function r(a,b,c){const d=Reflect.get(a,b,c);return'symbol'==typeof b||'function'==typeof d?d:(i({target:a,key:b,receiver:c,type:'get'}),m()&&'object'==typeof d&&null!==d?w(d):G.get(d)||d)}function s(a,b){const c=Reflect.has(a,b);return'symbol'==typeof b?c:(i({target:a,key:b,type:'has'}),c)}function t(a){return i({target:a,type:'iterate'}),Reflect.ownKeys(a)}function u(a,b,c,d){'object'==typeof c&&null!==c&&(c=F.get(c)||c);const e=N.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return m()?(console.error(`Mutating observables in reactions is forbidden. You set ${b} to ${c}.`),g):'symbol'==typeof b||a!==F.get(d)?g:(e?c!==f&&j({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):j({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function v(a,b){const c=N.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&j({target:a,key:b,oldValue:d,type:'delete'}),e}function w(a={}){return F.has(a)||!p(a)?a:G.get(a)||x(a)}function x(a){const c=q(a)||O,d=new Proxy(a,c);return G.set(a,d),F.set(d,a),b(a),d}function y(a){return F.has(a)}function z(a){return F.get(a)||a}const A=new WeakMap,B=Symbol('iteration key');let C,D=!1;const E=Symbol('is reaction'),F=new WeakMap,G=new WeakMap,H=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,J={has(a){const b=F.get(this),c=H(this);return i({target:b,key:a,type:'has'}),c.has.apply(b,arguments)},get(a){const b=F.get(this),c=H(this);return i({target:b,key:a,type:'get'}),c.get.apply(b,arguments)},add(a){const b=F.get(this),c=H(this),d=c.has.call(b,a),e=c.add.apply(b,arguments);return d||j({target:b,key:a,value:a,type:'add'}),e},set(a,b){const c=F.get(this),d=H(this),e=d.has.call(c,a),f=d.get.call(c,a),g=d.set.apply(c,arguments);return e?b!==f&&j({target:c,key:a,value:b,oldValue:f,type:'set'}):j({target:c,key:a,value:b,type:'add'}),g},delete(a){const b=F.get(this),c=H(this),d=c.has.call(b,a),e=c.get?c.get.call(b,a):void 0,f=c.delete.apply(b,arguments);return d&&j({target:b,key:a,oldValue:e,type:'delete'}),f},clear(){const a=F.get(this),b=H(this),c=0!==a.size,d=a instanceof Map?new Map(a):new Set(a),e=b.clear.apply(a,arguments);return c&&j({target:a,oldTarget:d,type:'clear'}),e},forEach(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b.forEach.apply(a,arguments)},keys(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b.keys.apply(a,arguments)},values(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b.values.apply(a,arguments)},entries(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b.entries.apply(a,arguments)},[Symbol.iterator](){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)},get size(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};var K={get(a,b,c){return a=I.call(J,b)?J:a,Reflect.get(a,b,c)}};const L=new Set([Date,RegExp]),M=new Map([[Map,K],[Set,K],[WeakMap,K],[WeakSet,K]]),N=Object.prototype.hasOwnProperty;var O={get:r,has:s,ownKeys:t,set:u,deleteProperty:v};a.observe=n,a.unobserve=o,a.observable=w,a.isObservable=y,a.raw=z,Object.defineProperty(a,'__esModule',{value:!0})});
(function(a,b){'object'==typeof exports&&'undefined'!=typeof module?b(exports):'function'==typeof define&&define.amd?define(['exports'],b):b(a.observer={})})(this,function(a){'use strict';function b(a){A.set(a,Object.create(null))}function c(a,{target:b,key:c,type:d}){'iterate'===d&&(c=B);const e=A.get(b);let f=e[c];f||(e[c]=f=new Set),f.has(a)||(f.add(a),a.cleaners.push(f))}function d({target:a,key:b,type:c}){const d=A.get(a),f=new Set;if('clear'===c)for(let a in d)e(f,d,a);else e(f,d,b);if('add'===c||'delete'===c||'clear'===c){const b=Array.isArray(a)?'length':B;e(f,d,b)}return f}function e(a,b,c){const d=b[c];d&&d.forEach(a.add,a)}function f(a){a.cleaners&&a.cleaners.forEach(g,a),a.cleaners=[]}function g(a){a.delete(this)}function h(a,b,c,d){if(a.unobserved)return b.apply(c,d);f(a);try{return C=a,b.apply(c,d)}finally{C=void 0}}function i(a){C&&(l(C,a),c(C,a))}function j(a){d(a).forEach(k,a)}function k(a){l(a,this),'function'==typeof a.scheduler?a.scheduler(a):'object'==typeof a.scheduler?a.scheduler.add(a):a()}function l(a,b){if(a.debugger&&!D)try{D=!0,a.debugger(b)}finally{D=!1}}function m(){return C!==void 0}function n(a,b={}){const c=a[E]?a:function b(){return h(b,a,this,arguments)};return c.scheduler=b.scheduler,c.debugger=b.debugger,c[E]=!0,b.lazy||c(),c}function o(a){a.unobserved||(a.unobserved=!0,f(a)),'object'==typeof a.scheduler&&a.scheduler.delete(a)}function p({constructor:a}){const b='function'==typeof a&&a.name in L&&L[a.name]===a;return!b||M.has(a)}function q(a){return M.get(a.constructor)}function r(a,b,c){const d=Reflect.get(a,b,c);if('symbol'==typeof b||'function'==typeof d)return d;i({target:a,key:b,receiver:c,type:'get'});const e=G.get(d);if(m()&&'object'==typeof d&&null!==d){if(e)return e;const c=Reflect.getOwnPropertyDescriptor(a,b);if(!c||!1!==c.writable||!1!==c.configurable)return w(d)}return e||d}function s(a,b){const c=Reflect.has(a,b);return'symbol'==typeof b?c:(i({target:a,key:b,type:'has'}),c)}function t(a){return i({target:a,type:'iterate'}),Reflect.ownKeys(a)}function u(a,b,c,d){'object'==typeof c&&null!==c&&(c=F.get(c)||c);const e=N.call(a,b),f=a[b],g=Reflect.set(a,b,c,d);return m()?(console.error(`Mutating observables in reactions is forbidden. You set ${b} to ${c}.`),g):'symbol'==typeof b||a!==F.get(d)?g:(e?c!==f&&j({target:a,key:b,value:c,oldValue:f,receiver:d,type:'set'}):j({target:a,key:b,value:c,receiver:d,type:'add'}),g)}function v(a,b){const c=N.call(a,b),d=a[b],e=Reflect.deleteProperty(a,b);return'symbol'!=typeof b&&c&&j({target:a,key:b,oldValue:d,type:'delete'}),e}function w(a={}){return F.has(a)||!p(a)?a:G.get(a)||x(a)}function x(a){const c=q(a)||O,d=new Proxy(a,c);return G.set(a,d),F.set(d,a),b(a),d}function y(a){return F.has(a)}function z(a){return F.get(a)||a}const A=new WeakMap,B=Symbol('iteration key');let C,D=!1;const E=Symbol('is reaction'),F=new WeakMap,G=new WeakMap,H=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,J={has(a){const b=F.get(this),c=H(this);return i({target:b,key:a,type:'has'}),c.has.apply(b,arguments)},get(a){const b=F.get(this),c=H(this);return i({target:b,key:a,type:'get'}),c.get.apply(b,arguments)},add(a){const b=F.get(this),c=H(this),d=c.has.call(b,a),e=c.add.apply(b,arguments);return d||j({target:b,key:a,value:a,type:'add'}),e},set(a,b){const c=F.get(this),d=H(this),e=d.has.call(c,a),f=d.get.call(c,a),g=d.set.apply(c,arguments);return e?b!==f&&j({target:c,key:a,value:b,oldValue:f,type:'set'}):j({target:c,key:a,value:b,type:'add'}),g},delete(a){const b=F.get(this),c=H(this),d=c.has.call(b,a),e=c.get?c.get.call(b,a):void 0,f=c.delete.apply(b,arguments);return d&&j({target:b,key:a,oldValue:e,type:'delete'}),f},clear(){const a=F.get(this),b=H(this),c=0!==a.size,d=a instanceof Map?new Map(a):new Set(a),e=b.clear.apply(a,arguments);return c&&j({target:a,oldTarget:d,type:'clear'}),e},forEach(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b.forEach.apply(a,arguments)},keys(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b.keys.apply(a,arguments)},values(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b.values.apply(a,arguments)},entries(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b.entries.apply(a,arguments)},[Symbol.iterator](){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),b[Symbol.iterator].apply(a,arguments)},get size(){const a=F.get(this),b=H(this);return i({target:a,type:'iterate'}),Reflect.get(b,'size',a)}};var K={get(a,b,c){return a=I.call(J,b)?J:a,Reflect.get(a,b,c)}};const L=Function('return this')(),M=new Map([[Map,K],[Set,K],[WeakMap,K],[WeakSet,K],[Object,!1],[Array,!1],[Int8Array,!1],[Uint8Array,!1],[Uint8ClampedArray,!1],[Int16Array,!1],[Uint16Array,!1],[Int32Array,!1],[Uint32Array,!1],[Float32Array,!1],[Float64Array,!1]]),N=Object.prototype.hasOwnProperty;var O={get:r,has:s,ownKeys:t,set:u,deleteProperty:v};a.observe=n,a.unobserve=o,a.observable=w,a.isObservable=y,a.raw=z,Object.defineProperty(a,'__esModule',{value:!0})});
{
"name": "@nx-js/observer-util",
"version": "4.1.1",
"version": "4.1.2",
"description": "Simple transparent reactivity with 100% language coverage. Made with ES6 Proxies.",

@@ -5,0 +5,0 @@ "main": "dist/cjs.es5.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc