generated from lit/lit-element-starter-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
142 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
/** | ||
* Librairie du system desing des Bibliothèques de l'Université de Montréal | ||
* @module @bibudem/ui | ||
* @version 0.13.0 | ||
* @version 0.13.1 | ||
* @author Christian Rémillard <[email protected]> | ||
* @license ISC | ||
* @see https://github.com/bibudem/ui | ||
*/ | ||
var e,t,r=e=>{throw TypeError(e)},n=(e,t,n)=>(((e,t,n)=>{t.has(e)||r("Cannot "+n)})(e,t,"access private method"),n);const a=require("./index-9izUO_DB.cjs"),o=require("./constants-BgVe0aC4.cjs"),c=require("./_Uint8Array-Dn54l80h.cjs"),s=require("./isObjectLike-DLI4XyQI.cjs");var i=c.getNative(s.root,"WeakMap"),u=c.overArg(Object.keys,Object),f=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,b=Object.getOwnPropertySymbols,h=b?function(e){return null==e?[]:(e=Object(e),function(t,r){for(var n=-1,a=null==t?0:t.length,o=0,c=[];++n<a;){var s=t[n];i=s,l.call(e,i)&&(c[o++]=s)}var i;return c}(b(e)))}:function(){return[]};function v(e){return r=h,n=t=e,a=c.isArrayLike(n)?c.arrayLikeKeys(n):function(e){if(!c.isPrototype(e))return u(e);var t=[];for(var r in Object(e))f.call(e,r)&&"constructor"!=r&&t.push(r);return t}(n),c.isArray(t)?a:function(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}(a,r(t));var t,r,n,a}var p=c.getNative(s.root,"DataView"),y=c.getNative(s.root,"Promise"),d=c.getNative(s.root,"Set"),w="[object Map]",g="[object Promise]",j="[object Set]",E="[object WeakMap]",_="[object DataView]",S=c.toSource(p),O=c.toSource(c.Map),A=c.toSource(y),m=c.toSource(d),P=c.toSource(i),k=s.baseGetTag;function N(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new c.MapCache;++t<r;)this.add(e[t])}function T(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}(p&&k(new p(new ArrayBuffer(1)))!=_||c.Map&&k(new c.Map)!=w||y&&k(y.resolve())!=g||d&&k(new d)!=j||i&&k(new i)!=E)&&(k=function(e){var t=s.baseGetTag(e),r="[object Object]"==t?e.constructor:void 0,n=r?c.toSource(r):"";if(n)switch(n){case S:return _;case O:return w;case A:return g;case m:return j;case P:return E}return t}),N.prototype.add=N.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},N.prototype.has=function(e){return this.__data__.has(e)};var D=1,M=2;function B(e,t,r,n,a,o){var c=r&D,s=e.length,i=t.length;if(s!=i&&!(c&&i>s))return!1;var u=o.get(e),f=o.get(t);if(u&&f)return u==t&&f==e;var l=-1,b=!0,h=r&M?new N:void 0;for(o.set(e,t),o.set(t,e);++l<s;){var v=e[l],p=t[l];if(n)var y=c?n(p,v,l,t,e,o):n(v,p,l,e,t,o);if(void 0!==y){if(y)continue;b=!1;break}if(h){if(!T(t,(function(e,t){if(c=t,!h.has(c)&&(v===e||a(v,e,r,n,o)))return h.push(t);var c}))){b=!1;break}}else if(v!==p&&!a(v,p,r,n,o)){b=!1;break}}return o.delete(e),o.delete(t),b}function L(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function R(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var U=s.Symbol?s.Symbol.prototype:void 0,V=U?U.valueOf:void 0,q=Object.prototype.hasOwnProperty,x="[object Arguments]",C="[object Array]",z="[object Object]",W=Object.prototype.hasOwnProperty;function F(e,t,r,n,a){return e===t||(null==e||null==t||!s.isObjectLike(e)&&!s.isObjectLike(t)?e!=e&&t!=t:function(e,t,r,n,a,o){var s=c.isArray(e),i=c.isArray(t),u=s?C:k(e),f=i?C:k(t),l=(u=u==x?z:u)==z,b=(f=f==x?z:f)==z,h=u==f;if(h&&c.isBuffer(e)){if(!c.isBuffer(t))return!1;s=!0,l=!1}if(h&&!l)return o||(o=new c.Stack),s||c.isTypedArray(e)?B(e,t,r,n,a,o):function(e,t,r,n,a,o,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new c.Uint8Array(e),new c.Uint8Array(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return c.eq(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var i=L;case"[object Set]":var u=1&n;if(i||(i=R),e.size!=t.size&&!u)return!1;var f=s.get(e);if(f)return f==t;n|=2,s.set(e,t);var l=B(i(e),i(t),n,a,o,s);return s.delete(e),l;case"[object Symbol]":if(V)return V.call(e)==V.call(t)}return!1}(e,t,u,r,n,a,o);if(!(1&r)){var p=l&&W.call(e,"__wrapped__"),y=b&&W.call(t,"__wrapped__");if(p||y){var d=p?e.value():e,w=y?t.value():t;return o||(o=new c.Stack),a(d,w,r,n,o)}}return!!h&&(o||(o=new c.Stack),function(e,t,r,n,a,o){var c=1&r,s=v(e),i=s.length;if(i!=v(t).length&&!c)return!1;for(var u=i;u--;){var f=s[u];if(!(c?f in t:q.call(t,f)))return!1}var l=o.get(e),b=o.get(t);if(l&&b)return l==t&&b==e;var h=!0;o.set(e,t),o.set(t,e);for(var p=c;++u<i;){var y=e[f=s[u]],d=t[f];if(n)var w=c?n(d,y,f,t,e,o):n(y,d,f,e,t,o);if(!(void 0===w?y===d||a(y,d,r,n,o):w)){h=!1;break}p||(p="constructor"==f)}if(h&&!p){var g=e.constructor,j=t.constructor;g==j||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j||(h=!1)}return o.delete(e),o.delete(t),h}(e,t,r,n,a,o))}(e,t,r,n,F,a))}class G extends EventTarget{constructor(){var t,n,a;super(),t=this,(n=e).has(t)?r("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,a),this.db=null}listen(e){super.addEventListener(o.EVENT_NAMES.UPDATE,e)}dispatchEvent({detail:e}){console.log(`Dispatching ${o.EVENT_NAMES.UPDATE} event with data:`,e),super.dispatchEvent(new CustomEvent(o.EVENT_NAMES.UPDATE,{detail:e}))}async init(){try{this.db=await a.openDB(o.DB_NAME,o.DB_VERSION,{upgrade(e){e.objectStoreNames.contains(o.DB_STORE_NAME)||e.createObjectStore(o.DB_STORE_NAME)}})}catch(e){throw new Error("Something went wrong with indexedDB:",e)}}async getPreferences(){const e=await this.db.get(o.DB_STORE_NAME,"preferences");return void 0===e?null:e}async setPreferences(r){if(!c.isObject(r))throw new TypeError("Preferences must be an object.");const a=Object.keys(o.DEFAULT_PREFERENCES);if(!function(e,t){if(e.length!==t.length)return!1;const r=[...e].sort(),n=[...t].sort();return r.every(((e,t)=>e===n[t]))}(a,Object.keys(r)))throw new TypeError(`Preferences requires all those fields: ${a.join(", ")}.`);if(!Object.values(r).every((e=>"boolean"==typeof e)))throw new TypeError("Preferences values must be a boolean.");return await n(this,e,t).call(this,r)}async resetPreferences(){return await n(this,e,t).call(this,null)}}let I;e=new WeakSet,t=async function(e){try{return F(await this.getPreferences(),e)?(console.log("[setPreferences] preferences not updated: ",e),!1):(await this.db.put(o.DB_STORE_NAME,e,"preferences"),console.log("[setPreferences] preferences updated: ",e),e)}catch(t){throw new Error("Something went wrong with indexedDB:",t)}},module.exports=async function(){return I||(I=new G,await I.init()),I}; | ||
var e,t,r=e=>{throw TypeError(e)},n=(e,t,n)=>(((e,t,n)=>{t.has(e)||r("Cannot "+n)})(e,t,"access private method"),n);const a=require("./index-9izUO_DB.cjs"),o=require("./constants-C4rB-CcV.cjs"),c=require("./_Uint8Array-Dn54l80h.cjs"),s=require("./isObjectLike-DLI4XyQI.cjs");var i=c.getNative(s.root,"WeakMap"),u=c.overArg(Object.keys,Object),f=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,b=Object.getOwnPropertySymbols,h=b?function(e){return null==e?[]:(e=Object(e),function(t,r){for(var n=-1,a=null==t?0:t.length,o=0,c=[];++n<a;){var s=t[n];i=s,l.call(e,i)&&(c[o++]=s)}var i;return c}(b(e)))}:function(){return[]};function v(e){return r=h,n=t=e,a=c.isArrayLike(n)?c.arrayLikeKeys(n):function(e){if(!c.isPrototype(e))return u(e);var t=[];for(var r in Object(e))f.call(e,r)&&"constructor"!=r&&t.push(r);return t}(n),c.isArray(t)?a:function(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}(a,r(t));var t,r,n,a}var p=c.getNative(s.root,"DataView"),y=c.getNative(s.root,"Promise"),d=c.getNative(s.root,"Set"),w="[object Map]",g="[object Promise]",j="[object Set]",E="[object WeakMap]",_="[object DataView]",S=c.toSource(p),O=c.toSource(c.Map),A=c.toSource(y),m=c.toSource(d),P=c.toSource(i),k=s.baseGetTag;function N(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new c.MapCache;++t<r;)this.add(e[t])}function T(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}(p&&k(new p(new ArrayBuffer(1)))!=_||c.Map&&k(new c.Map)!=w||y&&k(y.resolve())!=g||d&&k(new d)!=j||i&&k(new i)!=E)&&(k=function(e){var t=s.baseGetTag(e),r="[object Object]"==t?e.constructor:void 0,n=r?c.toSource(r):"";if(n)switch(n){case S:return _;case O:return w;case A:return g;case m:return j;case P:return E}return t}),N.prototype.add=N.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},N.prototype.has=function(e){return this.__data__.has(e)};var D=1,M=2;function B(e,t,r,n,a,o){var c=r&D,s=e.length,i=t.length;if(s!=i&&!(c&&i>s))return!1;var u=o.get(e),f=o.get(t);if(u&&f)return u==t&&f==e;var l=-1,b=!0,h=r&M?new N:void 0;for(o.set(e,t),o.set(t,e);++l<s;){var v=e[l],p=t[l];if(n)var y=c?n(p,v,l,t,e,o):n(v,p,l,e,t,o);if(void 0!==y){if(y)continue;b=!1;break}if(h){if(!T(t,(function(e,t){if(c=t,!h.has(c)&&(v===e||a(v,e,r,n,o)))return h.push(t);var c}))){b=!1;break}}else if(v!==p&&!a(v,p,r,n,o)){b=!1;break}}return o.delete(e),o.delete(t),b}function L(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function R(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var U=s.Symbol?s.Symbol.prototype:void 0,V=U?U.valueOf:void 0,q=Object.prototype.hasOwnProperty,x="[object Arguments]",C="[object Array]",z="[object Object]",W=Object.prototype.hasOwnProperty;function F(e,t,r,n,a){return e===t||(null==e||null==t||!s.isObjectLike(e)&&!s.isObjectLike(t)?e!=e&&t!=t:function(e,t,r,n,a,o){var s=c.isArray(e),i=c.isArray(t),u=s?C:k(e),f=i?C:k(t),l=(u=u==x?z:u)==z,b=(f=f==x?z:f)==z,h=u==f;if(h&&c.isBuffer(e)){if(!c.isBuffer(t))return!1;s=!0,l=!1}if(h&&!l)return o||(o=new c.Stack),s||c.isTypedArray(e)?B(e,t,r,n,a,o):function(e,t,r,n,a,o,s){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!o(new c.Uint8Array(e),new c.Uint8Array(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return c.eq(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var i=L;case"[object Set]":var u=1&n;if(i||(i=R),e.size!=t.size&&!u)return!1;var f=s.get(e);if(f)return f==t;n|=2,s.set(e,t);var l=B(i(e),i(t),n,a,o,s);return s.delete(e),l;case"[object Symbol]":if(V)return V.call(e)==V.call(t)}return!1}(e,t,u,r,n,a,o);if(!(1&r)){var p=l&&W.call(e,"__wrapped__"),y=b&&W.call(t,"__wrapped__");if(p||y){var d=p?e.value():e,w=y?t.value():t;return o||(o=new c.Stack),a(d,w,r,n,o)}}return!!h&&(o||(o=new c.Stack),function(e,t,r,n,a,o){var c=1&r,s=v(e),i=s.length;if(i!=v(t).length&&!c)return!1;for(var u=i;u--;){var f=s[u];if(!(c?f in t:q.call(t,f)))return!1}var l=o.get(e),b=o.get(t);if(l&&b)return l==t&&b==e;var h=!0;o.set(e,t),o.set(t,e);for(var p=c;++u<i;){var y=e[f=s[u]],d=t[f];if(n)var w=c?n(d,y,f,t,e,o):n(y,d,f,e,t,o);if(!(void 0===w?y===d||a(y,d,r,n,o):w)){h=!1;break}p||(p="constructor"==f)}if(h&&!p){var g=e.constructor,j=t.constructor;g==j||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j||(h=!1)}return o.delete(e),o.delete(t),h}(e,t,r,n,a,o))}(e,t,r,n,F,a))}class G extends EventTarget{constructor(){var t,n,a;super(),t=this,(n=e).has(t)?r("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,a),this.db=null}listen(e){super.addEventListener(o.EVENT_NAMES.UPDATE,e)}dispatchEvent({detail:e}){console.log(`Dispatching ${o.EVENT_NAMES.UPDATE} event with data:`,e),super.dispatchEvent(new CustomEvent(o.EVENT_NAMES.UPDATE,{detail:e}))}async init(){try{this.db=await a.openDB(o.DB_NAME,o.DB_VERSION,{upgrade(e){e.objectStoreNames.contains(o.DB_STORE_NAME)||e.createObjectStore(o.DB_STORE_NAME)}})}catch(e){throw new Error("Something went wrong with indexedDB:",e)}}async getPreferences(){const e=await this.db.get(o.DB_STORE_NAME,"preferences");return void 0===e?null:e}async setPreferences(r){if(!c.isObject(r))throw new TypeError("Preferences must be an object.");const a=Object.keys(o.DEFAULT_PREFERENCES);if(!function(e,t){if(e.length!==t.length)return!1;const r=[...e].sort(),n=[...t].sort();return r.every(((e,t)=>e===n[t]))}(a,Object.keys(r)))throw new TypeError(`Preferences requires all those fields: ${a.join(", ")}.`);if(!Object.values(r).every((e=>"boolean"==typeof e)))throw new TypeError("Preferences values must be a boolean.");return await n(this,e,t).call(this,r)}async resetPreferences(){return await n(this,e,t).call(this,null)}}let I;e=new WeakSet,t=async function(e){try{return F(await this.getPreferences(),e)?(console.log("[setPreferences] preferences not updated: ",e),!1):(await this.db.put(o.DB_STORE_NAME,e,"preferences"),console.log("[setPreferences] preferences updated: ",e),e)}catch(t){throw new Error("Something went wrong with indexedDB:",t)}},module.exports=async function(){return I||(I=new G,await I.init()),I}; | ||
//# sourceMappingURL=PreferenceStorage.cjs.map |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* Librairie du system desing des Bibliothèques de l'Université de Montréal | ||
* @module @bibudem/ui | ||
* @version 0.13.0 | ||
* @version 0.13.1 | ||
* @author Christian Rémillard <[email protected]> | ||
* @license ISC | ||
* @see https://github.com/bibudem/ui | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* Librairie du system desing des Bibliothèques de l'Université de Montréal | ||
* @module @bibudem/ui | ||
* @version 0.13.0 | ||
* @version 0.13.1 | ||
* @author Christian Rémillard <[email protected]> | ||
* @license ISC | ||
* @see https://github.com/bibudem/ui | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.