@aegis-framework/artemis 0.3.25 → 0.3.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artemis.js +1 -1
- package/dist/artemis.js.map +1 -1
- package/dist/artemis.min.js +1 -1
- package/dist/artemis.min.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/SpaceAdapter/IndexedDB.js +9 -2
package/dist/artemis.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){function e(e,t){return Object.keys(t).forEach((function(n){"default"===n||"__esModule"===n||e.hasOwnProperty(n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),e}function t(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var n={},r={};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function c(e,t){return!t||"object"!=((n=t)&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t;var n}function f(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||f(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function h(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t(r,"DebugLevel",(function(){return y})),t(r,"Debug",(function(){return d}));var y={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4,ALL:5},d=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"level",value:function(e){return"number"==typeof e&&(this._level=e),this._level}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).log.apply(r,h(t))}},{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).debug.apply(r,h(t))}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.INFO&&(r=console).info.apply(r,h(t))}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.ERROR&&(r=console).error.apply(r,h(t))}},{key:"warning",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.WARNING&&(r=console).warn.apply(r,h(t))}},{key:"table",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).table.apply(r,h(t))}},{key:"group",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).group.apply(r,h(t))}},{key:"groupCollapsed",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).groupCollapsed.apply(r,h(t))}},{key:"groupEnd",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).groupEnd.apply(r,h(t))}},{key:"time",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).time.apply(r,h(t))}},{key:"timeLog",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).timeLog.apply(r,h(t))}},{key:"timeEnd",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).timeEnd.apply(r,h(t))}},{key:"trace",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).trace.apply(r,h(t))}}]),e}();d._level=y.NONE;var p={};t(p,"DOM",(function(){return g})),t(p,"$_",(function(){return m})),t(p,"$_ready",(function(){return k}));var g=function(){"use strict";function e(t){if(o(this,e),null===t)return this.collection=[],void(this.length=0);if("string"==typeof t)this.collection=document.querySelectorAll(t),this.length=this.collection.length,this._selector=t;else if(t instanceof NodeList)this.collection=t,this.length=t.length,this._selector=t;else if(t instanceof e)this.collection=t.collection,this.length=this.collection.length,this._selector=t._selector;else if(t instanceof HTMLElement)this.collection=[t],this.length=this.collection.length,this._selector=t;else{if("object"!=typeof t)return;t.length>=1?this.collection=t:this.collection=[t],this.length=this.collection.length,this._selector=t}}return a(e,[{key:"hide",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){r.value.style.display="none"}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return this}},{key:"show",value:function(e){var t=void 0===e?"block":e,n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.style.display=t}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}},{key:"addClass",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.classList.add(e)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"removeClass",value:function(e){var t=void 0===e?null:e,n=!0,r=!1,o=void 0;if(null!==t)try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.classList.remove(t)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}else{var l=!0,u=!1,s=void 0;try{for(var c,f=this.collection[Symbol.iterator]();!(l=(c=f.next()).done);l=!0)for(var v=c.value;v.classList.length>0;)v.classList.remove(v.classList.item(0))}catch(e){u=!0,s=e}finally{try{l||null==f.return||f.return()}finally{if(u)throw s}}}return this}},{key:"toggleClass",value:function(e){e=e.split(" ");var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)for(var a=o.value,l=0;l<e.length;l++)a.classList.toggle(e[l])}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"hasClass",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){if(!o.value.classList.contains(e))return!1}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!0}},{key:"value",value:function(e){if(void 0!==e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.value=e}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}if(this.length>0)return this.collection[0].value}},{key:"focus",value:function(){return this.length>0&&this.collection[0].focus(),this}},{key:"click",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("click",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"keyup",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("keyup",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"keydown",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("keydown",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"submit",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("submit",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"change",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("change",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"scroll",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("scroll",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"on",value:function(e,t,n){e=e.split(" ");var r=!0,o=!1,i=void 0;try{for(var a,l=this,u=function(r,o){for(var i=o.value,a=0;a<e.length;a++){var u=l;"function"==typeof t?i.addEventListener(e[a],t,!1):"string"==typeof t&&"function"==typeof n&&i.addEventListener(e[a],(function(e){if(e.target){var r=m(e.target).closestParent(t,u._selector);r.exists()&&n.call(r.get(0),e)}}),!1)}},s=this.collection[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u(0,a)}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return this}},{key:"filter",value:function(t){return this.length>0?new e(this.collection[0].querySelector(t)):new e(null)}},{key:"exists",value:function(){return this.length>0}},{key:"data",value:function(e,t){if(void 0!==t){var n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.dataset[e]=t}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}if(this.length>0)return this.collection[0].dataset[e]}},{key:"removeData",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){delete o.value.dataset[e]}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"text",value:function(e){if(void 0!==e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.textContent=e}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}if(this.length>0)return this.collection[0].textContent}},{key:"html",value:function(e){if(void 0!==e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.innerHTML=e}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}if(this.length>0)return this.collection[0].innerHTML}},{key:"append",value:function(e){if(this.length>0)if("string"==typeof e){var t=document.createElement("div");t.innerHTML="string"==typeof e?e.trim():e,this.collection[0].appendChild(t.firstChild)}else this.collection[0].appendChild(e);return this}},{key:"prepend",value:function(e){if(this.length>0)if("string"==typeof e){var t=document.createElement("div");t.innerHTML="string"==typeof e?e.trim():e,this.collection[0].childNodes.length>0?this.collection[0].insertBefore(t.firstChild,this.collection[0].childNodes[0]):this.collection[0].appendChild(t.firstChild)}else this.collection[0].childNodes.length>0?this.collection[0].insertBefore(e,this.collection[0].childNodes[0]):this.collection[0].appendChild(e);return this}},{key:"each",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){e(o.value)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"get",value:function(e){return this.collection[e]}},{key:"first",value:function(){return this.length>0?new e(this.collection[0]):new e(null)}},{key:"last",value:function(){return this.length>0?new e(this.collection[this.collection.length-1]):new e(null)}},{key:"isVisible",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;if("none"!=i.display&&i.offsetWidth>0&&i.offsetHeight>0)return!0}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return!1}},{key:"parent",value:function(){return this.length>0?new e(this.collection[0].parentElement):new e(null)}},{key:"find",value:function(t){return this.length>0?new e(this.collection[0].querySelectorAll(t)):new e(null)}},{key:"offset",value:function(){if(this.length>0){var e=this.collection[0].getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}}}},{key:"closest",value:function(e){for(var t=null,n=this;n.exists()&&null===t;){if(!0===n.matches(e))return n;var r=n.find(e);r&&r.length>0&&(t=r),n=n.parent()}return null!==t?t:n}},{key:"closestParent",value:function(t,n){for(var r=this;r.exists();){if(!0===r.matches(t))return r;if("string"==typeof n&&r.matches(n))break;r=r.parent()}return new e(null)}},{key:"attribute",value:function(e,t){if(void 0!==t){var n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.setAttribute(e,t)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}if(this.length>0)return this.collection[0].getAttribute(e)}},{key:"hasAttribute",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){if(!o.value.hasAttribute(e))return!1}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!0}},{key:"after",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.insertAdjacentHTML("afterend",e)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"before",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.insertAdjacentHTML("beforebegin",e)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"style",value:function(e,t){for(var n=0;n<this.collection.length;n++){if("string"==typeof e&&"undefined"!==t)return this.collection[n].style[e]=t,this;if("string"==typeof e&&"undefined"===t)return this.collection[n].style[e];if("object"==typeof e){for(var r in e)this.collection[n].style[r]=e[r];return this}}}},{key:"animate",value:function(e,t){for(var n=this,r=function(r){var i=(new Date).getTime(),a=n.collection,l=void 0,u=void 0;void 0!==n.collection[o].style[r]?(u=n.collection[o].style[r],l=setInterval((function(){var n=Math.min(1,((new Date).getTime()-i)/t);a[o].style[r]=u+n*(e[r]-u),1==n&&clearInterval(l)}),25),n.collection[o].style[r]=u):void 0!==n.collection[o][r]&&(u=n.collection[o][r],l=setInterval((function(){var n=Math.min(1,((new Date).getTime()-i)/t);a[o][r]=u+n*(e[r]-u),1==n&&clearInterval(l)}),25),n.collection[o][r]=u)},o=0;o<this.collection.length;o++)for(var i in e)r(i);return this}},{key:"fadeIn",value:function(e,t){var n=void 0===e?400:e;if(this.length>0){var r=this.collection[0];r.style.opacity=0;var o=+new Date,i=function(){r.style.opacity=+r.style.opacity+(new Date-o)/n,o=+new Date,+r.style.opacity<1?window.requestAnimationFrame&&requestAnimationFrame(i)||setTimeout(i,16):"function"==typeof t&&t()};i()}return this}},{key:"fadeOut",value:function(e,t){var n=void 0===e?400:e;if(this.length>0){var r=+new Date,o=this.collection[0],i=function(){o.style.opacity=+o.style.opacity-(new Date-r)/n,r=+new Date,+o.style.opacity>0?window.requestAnimationFrame&&requestAnimationFrame(i)||setTimeout(i,16):"function"==typeof t&&t()};i()}return this}},{key:"matches",value:function(e){var t=Element.prototype,n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||function(){return-1!==[].indexOf.call(document.querySelectorAll(e),this)};return this.length>0&&n.call(this.collection[0],e)}},{key:"remove",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;i.parentNode.removeChild(i)}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return this}},{key:"replaceWith",value:function(e){var t=e;if("string"==typeof e){var n=document.createElement("div");n.innerHTML=e,t=n.firstChild}var r=!0,o=!1,i=void 0;try{for(var a,l=this.collection[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;u.parentElement.replaceChild(t,u)}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return this}},{key:"reset",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){r.value.reset()}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return this}},{key:"property",value:function(e,t){if(void 0!==t){var n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value[e]=t}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}if(this.length>0)return this.collection[0][e]}}]),e}();function m(e){return void 0!==e?new g(e):g}function k(e){window.addEventListener("load",e)}var w={};t(w,"FileSystem",(function(){return x}));var b={};t(b,"Request",(function(){return S}));var S=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"serialize",value:function(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}},{key:"get",value:function(t,n,r){var o=void 0===n?{}:n,i=void 0===r?{}:r,a=e.serialize(o);return""!==a&&(t="".concat(t,"?").concat(a)),fetch(t,i)}},{key:"post",value:function(t,n,r){var o,i=void 0===r?{}:r;if(void 0!==i.headers){var a=i.headers["Content-Type"];if(void 0!==a)if("multipart/form-data"==a)for(var l in o=new FormData,n)o.append(l,n[l]);else o="application/json"==a?JSON.stringify(n):e.serialize(n)}else o=e.serialize(n);var u=Object.assign({},{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o},i);return void 0!==u.headers&&"multipart/form-data"===u.headers["Content-Type"]&&delete u.headers["Content-Type"],fetch(t,u)}},{key:"put",value:function(t,n,r){var o=void 0===r?{}:r;return e.post(t,n,Object.assign({},{method:"PUT"},o))}},{key:"delete",value:function(t,n,r){var o=void 0===r?{}:r;return e.get(t,n,Object.assign({},{method:"DELETE"},o))}},{key:"json",value:function(t,n,r){var o=void 0===n?{}:n,i=void 0===r?{}:r;return e.get(t,o,i).then((function(e){return e.json()}))}},{key:"blob",value:function(t,n,r){var o=void 0===n?{}:n,i=void 0===r?{}:r;return e.get(t,o,i).then((function(e){return e.blob()}))}}]),e}(),x=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"readRemote",value:function(t,n,r){var o=void 0===n?"base64":n,i=void 0===r?{}:r;return S.blob(t,{},i).then((function(t){return e.read(t,o)}))}},{key:"read",value:function(e,t){var n=void 0===t?"text":t;return new Promise((function(t,r){var o=new FileReader;o.onload=function(e){t(e,e.target.result)},o.onerror=function(e){r(e)},"base64"===n?o.readAsDataURL(e):"buffer"===n?o.readAsArrayBuffer(e):o.readAsText(e,"UTF-8")}))}},{key:"create",value:function(e,t,n){var r=void 0===n?"text/plain":n;return Promise.resolve(new File([t],e,{type:r}))}},{key:"extension",value:function(e){return e.split(".").pop()}},{key:"isImage",value:function(t){return["jpg","jpeg","png","gif","svg","webp","bmp"].indexOf(e.extension(t).toLowerCase())>-1}}]),e}(),P={};t(P,"Form",(function(){return j}));var j=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"fill",value:function(e,t){for(var n in t){var r=m("form[data-form='".concat(e,"'] [name='").concat(n,"']")).get(0);if(void 0!==r)switch(r.type){case"file":case"file[]":break;default:r.value=t[n]}}}},{key:"values",value:function(e){var t={};return m("form[data-form='".concat(e,"'] [name]")).each((function(e){var n;switch(e.type){case"file[]":n=e.files;break;case"file":n=e.files[0];break;default:n=e.value}null!=n&&(t[e.name]=n)})),t}}]),e}(),A={};t(A,"Platform",(function(){return F}));var O,E,L,I=O={};function T(){throw new Error("setTimeout has not been defined")}function _(){throw new Error("clearTimeout has not been defined")}function D(e){if(E===setTimeout)return setTimeout(e,0);if((E===T||!E)&&setTimeout)return E=setTimeout,setTimeout(e,0);try{return E(e,0)}catch(t){try{return E.call(null,e,0)}catch(t){return E.call(this,e,0)}}}!function(){try{E="function"==typeof setTimeout?setTimeout:T}catch(e){E=T}try{L="function"==typeof clearTimeout?clearTimeout:_}catch(e){L=_}}();var B,C=[],N=!1,M=-1;function R(){N&&B&&(N=!1,B.length?C=B.concat(C):M=-1,C.length&&U())}function U(){if(!N){var e=D(R);N=!0;for(var t=C.length;t;){for(B=C,C=[];++M<t;)B&&B[M].run();M=-1,t=C.length}B=null,N=!1,function(e){if(L===clearTimeout)return clearTimeout(e);if((L===_||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(e);try{L(e)}catch(t){try{return L.call(null,e)}catch(t){return L.call(this,e)}}}(e)}}function V(e,t){this.fun=e,this.array=t}function W(){}I.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];C.push(new V(e,t)),1!==C.length||N||D(U)},V.prototype.run=function(){this.fun.apply(null,this.array)},I.title="browser",I.browser=!0,I.env={},I.argv=[],I.version="",I.versions={},I.on=W,I.addListener=W,I.once=W,I.off=W,I.removeListener=W,I.removeAllListeners=W,I.emit=W,I.prependListener=W,I.prependOnceListener=W,I.listeners=function(e){return[]},I.binding=function(e){throw new Error("process.binding is not supported")},I.cwd=function(){return"/"},I.chdir=function(e){throw new Error("process.chdir is not supported")},I.umask=function(){return 0};var F=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"retina",value:function(){return window.devicePixelRatio>=2}},{key:"portrait",value:function(){return 0===window.orientation||180===window.orientation}},{key:"landscape",value:function(){return 90===window.orientation||-90===window.orientation}},{key:"orientation",value:function(){return e.portrait()?"portrait":"landscape"}},{key:"electron",value:function(){return"undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||(!(void 0===O||"object"!=typeof O.versions||!O.versions.electron)||"object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>-1)}},{key:"cordova",value:function(){return!!window.cordova}},{key:"desktop",value:function(e){var t=!1;switch(void 0===e?"Any":e){case"Windows":t=navigator.platform.includes("Win");break;case"macOS":t=navigator.platform.includes("Mac");break;case"Linux":t=navigator.platform.includes("Linux");break;case"FreeBSD":t=navigator.platform.includes("FreeBSD");break;case"webOS":t=navigator.platform.includes("WebTV");break;default:t=navigator.platform.includes("Win")||navigator.platform.includes("Mac")||navigator.platform.includes("Linux")||navigator.platform.includes("FreeBSD")||navigator.platform.includes("WebTV")}return t}},{key:"mobile",value:function(e){var t=!1;switch(void 0===e?"Any":e){case"Android":t=/Android/i.test(navigator.userAgent);break;case"iOS":t=/iPhone|iPad|iPod/i.test(navigator.userAgent);break;case"Opera":t=/Opera Mini/i.test(navigator.userAgent);break;case"Windows":t=/Windows Phone|IEMobile|WPDesktop/i.test(navigator.userAgent);break;case"BlackBerry":t=/BlackBerry|BB10/i.test(navigator.userAgent);break;default:t=/Android|iPhone|iPad|iPod|Windows Phone|IEMobile|WPDesktop|BlackBerry|BB10/i.test(navigator.userAgent)}return t}},{key:"serviceWorkers",value:function(){return"undefined"!=typeof navigator&&"serviceWorker"in navigator&&location.protocol.indexOf("http")>-1}}]),e}(),G={};t(G,"Preload",(function(){return q}));var q=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"image",value:function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))}},{key:"file",value:function(e){return S.blob(e)}}]),e}(),H={};t(H,"SpaceAdapter",(function(){return J})),t(H,"Space",(function(){return $}));var z=function(){"use strict";function e(t){var n=t.name,r=void 0===n?"":n,i=t.version,a=void 0===i?"":i,l=t.store,u=void 0===l?"":l;o(this,e),this.name=r,this.version=a,this.store=u,this.upgrades={},""===this.version?this.numericVersion=0:this.numericVersion=parseInt(a.replace(/\./g,"")),this.id=""!==r&&""!==a&&""!==u?"".concat(this.name,"::").concat(this.store,"::").concat(this.version,"_"):""!==r&&""!==a?"".concat(this.name,"::").concat(this.version,"_"):""!==r?"".concat(this.name,"::_"):""}return a(e,[{key:"open",value:function(){if("object"!=typeof this.storage||this.storage instanceof Promise){if(this.storage instanceof Promise)return this.storage;var e=this,t=this;return this.storage=new Promise((function(t){var n=[];if(""!==e.version){var r="";""!==e.name&&""!==e.version&&""!==e.store?r="".concat(e.name,"::").concat(e.store,"::"):""!==e.name&&""!==e.version&&(r="".concat(e.name,"::"));var o=Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(r)})).map((function(e){return e.replace(r,"").split("_")[0]})).filter((function(e){return-1===e.indexOf("::")})).sort();if(o.length>0){var i=o[0],a=parseInt(i.replace(/\./g,""));if(a<e.numericVersion){var l=e,u=Object.keys(e.upgrades).sort(),s=u.findIndex((function(e){var t=v(e.split("::"))[0];return parseInt(t)===a}));s>-1&&(n=u.slice(s).filter((function(e){var t=v(e.split("::")),n=t[0],r=t[1];return parseInt(n)<l.numericVersion&&parseInt(r)<=l.numericVersion})));var c="".concat(e.name,"::").concat(i,"_");""!==e.name&&""!==e.version&&""!==e.store?c="".concat(e.name,"::").concat(e.store,"::").concat(i,"_"):""!==e.name&&""!==e.version&&(c="".concat(e.name,"::").concat(i,"_"));var f=Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(c)})).map((function(e){return e.replace(c,"")})),h=!0,y=!1,d=void 0;try{for(var p,g=f[Symbol.iterator]();!(h=(p=g.next()).done);h=!0){var m=p.value,k=window.localStorage.getItem("".concat(c).concat(m));window.localStorage.setItem(e.id+m,k),window.localStorage.removeItem("".concat(c).concat(m))}}catch(e){y=!0,d=e}finally{try{h||null==g.return||g.return()}finally{if(y)throw d}}}}}t({upgrades:n})})).then((function(e){var n=e.upgrades,r=t;return t.storage=window.localStorage,new Promise((function(e){var t=r;r._upgrade(n,(function(){return e(t)}))}))})),this.storage}return Promise.resolve(this)}},{key:"set",value:function(e,t){var n=this;return this.open().then((function(){return"object"==typeof t?n.storage.setItem(n.id+e,JSON.stringify(t)):n.storage.setItem(n.id+e,t),Promise.resolve({key:e,value:t})}))}},{key:"update",value:function(e,t){var n=this,r=this;return this.get(e).then((function(r){return"object"==typeof r?("object"==typeof t&&(t=Object.assign({},r,t)),n.storage.setItem(n.id+e,JSON.stringify(t))):n.storage.setItem(n.id+e,t),Promise.resolve({key:e,value:t})})).catch((function(){return r.set(e,t)}))}},{key:"get",value:function(e){var t=this;return this.open().then((function(){var n=t;return new Promise((function(t,r){var o=null;o=n.storage.getItem(n.id+e);try{var i=JSON.parse(o);i&&"object"==typeof i&&(o=i)}catch(e){}null!=o?t(o):r()}))}))}},{key:"getAll",value:function(){var e=this;return this.keys().then((function(t){var n={},r=[],o=!0,i=!1,a=void 0;try{for(var l,u=function(t,o){var i=o.value;r.push(e.get(i).then((function(e){n[i]=e})))},s=t[Symbol.iterator]();!(o=(l=s.next()).done);o=!0)u(0,l)}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return Promise.all(r).then((function(){return n}))}))}},{key:"contains",value:function(e){return this.keys().then((function(t){if(!t.includes(e))return Promise.reject();Promise.resolve()}))}},{key:"upgrade",value:function(e,t,n){return this.upgrades["".concat(parseInt(e.replace(/\./g,"")),"::").concat(parseInt(t.replace(/\./g,"")))]=n,Promise.resolve()}},{key:"_upgrade",value:function(e,t){var n=this;e.length>0?this.upgrades[e[0]].call(this,this).then((function(){n._upgrade(e.slice(1),t)})).catch((function(e){return console.error(e)})):t()}},{key:"rename",value:function(e){var t=this;return this.name!==e?this.keys().then((function(n){var r=t,o=t.id;t.name=e,""!==t.name&&""!==t.version&&""!==t.store?t.id="".concat(t.name,"::").concat(t.store,"::").concat(t.version,"_"):""!==t.name&&""!==t.version?t.id="".concat(t.name,"::").concat(t.version,"_"):""!==t.name?t.id="".concat(t.name,"::_"):t.id="";var i=[],a=!0,l=!1,u=void 0;try{for(var s,c=function(e,n){var a=n.value;i.push(t.set(a,t.storage.getItem("".concat(o).concat(a))).then((function(){r.storage.removeItem("".concat(o).concat(a))})))},f=n[Symbol.iterator]();!(a=(s=f.next()).done);a=!0)c(0,s)}catch(e){l=!0,u=e}finally{try{a||null==f.return||f.return()}finally{if(l)throw u}}return Promise.all(i)})):Promise.reject()}},{key:"key",value:function(e,t){var n=void 0!==t&&t,r=this;return this.open().then((function(){return!0===n?Promise.resolve(r.storage.key(e)):Promise.resolve(r.storage.key(e).replace(r.id,""))}))}},{key:"keys",value:function(e){var t=void 0!==e&&e,n=this;return this.open().then((function(){var e=n,r=n;return Promise.resolve(Object.keys(n.storage).filter((function(t){return 0===t.indexOf(e.id)})).map((function(e){return!0===t?e:e.replace(r.id,"")})))}))}},{key:"remove",value:function(e){var t=this;return this.get(e).then((function(n){return t.storage.removeItem(t.id+e),Promise.resolve(n)}))}},{key:"clear",value:function(){var e=this;return this.keys().then((function(t){var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value;e.remove(l)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return Promise.resolve()}))}}]),e}(),J={LocalStorage:z,SessionStorage:function(e){"use strict";function t(e){var n,r=e.name,i=void 0===r?"":r,a=e.version,u=void 0===a?"":a,s=e.store,f=void 0===s?"":s;return o(this,t),c(this,(n=t,l(n)).call(this,{name:i,version:u,store:f}))}return s(t,e),a(t,[{key:"open",value:function(){return void 0===this.storage&&(this.storage=window.sessionStorage),Promise.resolve(this)}}]),t}(z),IndexedDB:function(){"use strict";function e(t){var n=t.name,r=void 0===n?"":n,i=t.version,a=void 0===i?"":i,l=t.store,u=void 0===l?"":l,s=t.props,c=void 0===s?{}:s,f=t.index,v=void 0===f?{}:f;o(this,e),this.name=r,this.version=a,this.store=u,this.props=c,this.index=v,this.upgrades={},""===this.version?this.numericVersion=0:this.numericVersion=parseInt(a.replace(/\./g,""))}return a(e,[{key:"open",value:function(){if(""===this.name)return console.error("No name has been defined for IndexedDB space."),Promise.reject();if(""===this.store)return console.error("No store has been defined for IndexedDB space."),Promise.reject();if(this.storage instanceof IDBDatabase)return Promise.resolve(this);if(this.storage instanceof Promise)return this.storage;var e=this,t=this;return this.storage=new Promise((function(t,n){var r=e,o=[],i=window.indexedDB.open(e.name,e.numericVersion);i.onerror=function(e){n(e)},i.onsuccess=function(e){t({storage:e.target.result,upgrades:o})},i.onupgradeneeded=function(e){if(e.oldVersion<1){var n=e.target.result.createObjectStore(r.store,r.props),i=!0,a=!1,l=void 0;try{for(var u,s=Object.keys(r.index)[Symbol.iterator]();!(i=(u=s.next()).done);i=!0){var c=u.value;n.createIndex(r.index[c].name,r.index[c].field,r.index[c].props)}}catch(e){a=!0,l=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw l}}}else{var f=r,h=Object.keys(r.upgrades).sort(),y=h.findIndex((function(t){var n=v(t.split("::"))[0];return parseInt(n)===e.oldVersion}));y>-1&&(o=h.slice(y).filter((function(e){var t=v(e.split("::")),n=t[0],r=t[1];return parseInt(n)<f.numericVersion&&parseInt(r)<=f.numericVersion})))}e.target.transaction.addEventListener("success",(function(){t({storage:e.target.result,upgrades:o})}))}})).then((function(e){var n=e.storage,r=e.upgrades,o=t;return t.storage=n,new Promise((function(e){o._upgrade(r,(function(){return e(n)}),event)}))})),this.storage}},{key:"set",value:function(e,t){var n=void 0===e?null:e,r=this;return this.open().then((function(){var e=r;return new Promise((function(r,o){var i,a=e.storage.transaction(e.store,"readwrite").objectStore(e.store);(i=null!==n?a.put(Object.assign({},{id:n},t)):a.add(t)).addEventListener("success",(function(e){r({key:e.target.result,value:t})})),i.addEventListener("error",(function(e){o(e)}))}))}))}},{key:"update",value:function(e,t){var n=this;return this.get(e).then((function(r){var o=n;return void 0===r?n.set(e,t):new Promise((function(e,n){var i=o.storage.transaction(o.store,"readwrite").objectStore(o.store).put(Object.assign({},r,t));i.addEventListener("success",(function(n){e({key:n.target.result,value:t})})),i.addEventListener("error",(function(e){n(e)}))}))}))}},{key:"get",value:function(e){var t=this;return this.open().then((function(){var n=t;return new Promise((function(t,r){var o=n.storage.transaction(n.store).objectStore(n.store).get(e);o.addEventListener("success",(function(e){t(e.target.result)})),o.addEventListener("error",(function(e){r(e)}))}))}))}},{key:"getAll",value:function(){var e=this;return this.open().then((function(){var t=e;return new Promise((function(e,n){var r=t.storage.transaction(t.store).objectStore(t.store).getAll();r.addEventListener("success",(function(t){e(t.target.result)})),r.addEventListener("error",(function(e){n(e)}))}))}))}},{key:"contains",value:function(e){return this.get(e).then((function(t){if(!t.includes(e))return Promise.reject();Promise.resolve()}))}},{key:"upgrade",value:function(e,t,n){return this.upgrades["".concat(parseInt(e.replace(/\./g,"")),"::").concat(parseInt(t.replace(/\./g,"")))]=n,Promise.resolve()}},{key:"_upgrade",value:function(e,t,n){var r=this;e.length>0?this.upgrades[e[0]].call(this,this,n).then((function(){r._upgrade(e.slice(1),t,n)})).catch((function(e){return console.error(e)})):t()}},{key:"rename",value:function(){return Promise.reject()}},{key:"key",value:function(){return Promise.reject()}},{key:"keys",value:function(){var e=this;return this.open().then((function(){var t=e;return new Promise((function(e,n){var r=t.storage.transaction(t.store,"readwrite").objectStore(t.store).getAllKeys();r.addEventListener("success",(function(t){e(t.target.result)}),!1),r.addEventListener("error",(function(e){n(e)}),!1)}))}))}},{key:"remove",value:function(e){var t=this;return this.get(e).then((function(n){var r=t;return new Promise((function(t,o){var i=r.storage.transaction(r.store,"readwrite").objectStore(r.store).delete(e);i.addEventListener("success",(function(){t(n)}),!1),i.addEventListener("error",(function(e){o(e)}),!1)}))}))}},{key:"clear",value:function(){var e=this;return this.open().then((function(){var t=e;return new Promise((function(e,n){var r=t.storage.transaction(t.store,"readwrite").objectStore(t.store).clear();r.addEventListener("success",(function(){e()}),!1),r.addEventListener("error",(function(e){n(e)}),!1)}))}))}}]),e}(),RemoteStorage:function(){"use strict";function e(t){var n=t.name,r=void 0===n?"":n,i=t.version,a=void 0===i?"":i,l=t.store,u=void 0===l?"":l,s=t.endpoint,c=void 0===s?"":s,f=t.props,v=void 0===f?{}:f;o(this,e),this.name=r,this.version=a,this.store=u,this.endpoint="".concat(c).concat(u,"/"),this.props=v}return a(e,[{key:"open",value:function(){return void 0===this.storage&&(this.storage=S),Promise.resolve(this)}},{key:"set",value:function(e,t){var n=this;return this.open().then((function(){return n.storage.post(n.endpoint+e,t,n.props).then((function(t){return Promise.resolve({key:e,response:t.json()})}))}))}},{key:"update",value:function(e,t){var n=this;return this.get(e).then((function(r){return n.storage.put(n.endpoint+e,Object.assign({},r,t),n.props).then((function(t){return Promise.resolve({key:e,response:t.json()})}))}))}},{key:"get",value:function(e){var t=this;return this.open().then((function(){return t.storage.json(t.endpoint+e,{},t.props)}))}},{key:"getAll",value:function(){var e=this;return this.open().then((function(){return e.storage.json(e.endpoint,{},e.props)}))}},{key:"contains",value:function(e){return this.keys().then((function(t){if(!t.includes(e))return Promise.reject();Promise.resolve()}))}},{key:"upgrade",value:function(){return Promise.reject()}},{key:"rename",value:function(){return Promise.reject()}},{key:"key",value:function(){return Promise.reject()}},{key:"keys",value:function(){var e=this;return this.open().then((function(){return e.storage.json(e.endpoint,{keys:!0},e.props)}))}},{key:"remove",value:function(e){var t=this;return this.open().then((function(){return t.storage.delete(t.endpoint+e,{},t.props).then((function(t){return Promise.resolve(e,t.json())}))}))}},{key:"clear",value:function(){var e=this;return this.open().then((function(){return e.storage.delete(e.endpoint,{},e.props)}))}}]),e}()},$=function(){"use strict";function e(t,n){var r=void 0===t?J.LocalStorage:t,i=void 0===n?{}:n;o(this,e),this._configuration=Object.assign({},{name:"",version:"",store:""},i),this.adapter=new r(this._configuration),this.callbacks={create:[],update:[],delete:[]},this.transformations={}}return a(e,[{key:"configuration",value:function(e){var t=void 0===e?null:e;if(null===t)return this._configuration;this._configuration=Object.assign({},this._configuration,t),this.adapter.configuration(t)}},{key:"open",value:function(){var e=this;return this.adapter.open().then((function(){return Promise.resolve(e)}))}},{key:"set",value:function(e,t){var n=this,r=!0,o=!1,i=void 0;try{for(var a,l=Object.keys(this.transformations)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;"function"==typeof this.transformations[u].set&&(t=this.transformations[u].set.call(null,e,t))}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return this.adapter.set(e,t).then((function(e){var t=e.key,r=e.value,o=!0,i=!1,a=void 0;try{for(var l,u=n.callbacks.create[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){l.value.call(null,t,r)}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return Promise.resolve({key:t,value:r})}))}},{key:"update",value:function(e,t){var n=this,r=!0,o=!1,i=void 0;try{for(var a,l=Object.keys(this.transformations)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;"function"==typeof this.transformations[u].set&&(t=this.transformations[u].set.call(null,e,t))}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return this.adapter.update(e,t).then((function(e){var t=e.key,r=e.value,o=!0,i=!1,a=void 0;try{for(var l,u=n.callbacks.update[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){l.value.call(null,t,r)}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return Promise.resolve({key:t,value:r})}))}},{key:"get",value:function(e){var t=this;return this.adapter.get(e).then((function(n){var r=!0,o=!1,i=void 0;try{for(var a,l=Object.keys(t.transformations)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;"function"==typeof t.transformations[u].get&&(n=t.transformations[u].get.call(null,e,n))}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}))}},{key:"getAll",value:function(){var e=this;return this.adapter.getAll().then((function(t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(t)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value,u=!0,s=!1,c=void 0;try{for(var f,v=Object.keys(e.transformations)[Symbol.iterator]();!(u=(f=v.next()).done);u=!0){var h=f.value;"function"==typeof e.transformations[h].get&&(t[l]=e.transformations[h].get.call(null,l,t[l]))}}catch(e){s=!0,c=e}finally{try{u||null==v.return||v.return()}finally{if(s)throw c}}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t}))}},{key:"each",value:function(e){var t=this;return this.getAll().then((function(n){var r=[],o=!0,i=!1,a=void 0;try{for(var l,u=Object.keys(n)[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var s=l.value;r.push(e.call(t,s,n[s]))}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return Promise.all(r)}))}},{key:"contains",value:function(e){return this.adapter.contains(e)}},{key:"upgrade",value:function(e,t,n){var r=this;return this.adapter.upgrade(e,t,n).then((function(){return Promise.resolve(r)}))}},{key:"rename",value:function(e){return this.adapter.rename(e)}},{key:"onCreate",value:function(e){this.callbacks.create.push(e)}},{key:"onUpdate",value:function(e){this.callbacks.update.push(e)}},{key:"onDelete",value:function(e){this.callbacks.delete.push(e)}},{key:"addTransformation",value:function(e){var t=e.id,n=e.get,r=e.set;this.transformations[t]={id:t,get:n,set:r}}},{key:"removeTransformation",value:function(e){delete this.transformations[e]}},{key:"key",value:function(e,t){var n=void 0!==t&&t;return this.adapter.key(e,n)}},{key:"keys",value:function(e){var t=void 0!==e&&e;return this.adapter.keys(t)}},{key:"remove",value:function(e){var t=this;return this.adapter.remove(e).then((function(n){var r=!0,o=!1,i=void 0;try{for(var a,l=t.callbacks.delete[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){a.value.call(null,e,n)}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}}))}},{key:"clear",value:function(){return this.adapter.clear()}}]),e}(),K={};t(K,"Text",(function(){return Q}));var Q=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"capitalize",value:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}},{key:"suffix",value:function(e,t){var n="",r=t.indexOf(e);return-1!==r&&(r+=e.length,n=t.substr(r,t.length-r)),n}},{key:"selection",value:function(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:void 0}},{key:"prefix",value:function(e,t){var n="",r=t.indexOf(e);return-1!=r&&(n=t.substr(0,r)),n}},{key:"friendly",value:function(e){var t=[/[áàâãªä]/,/[ÁÀÂÃÄ]/,/[ÍÌÎÏ]/,/[íìîï]/,/[éèêë]/,/[ÉÈÊË]/,/[óòôõºö]/,/[ÓÒÔÕÖ]/,/[úùûü]/,/[ÚÙÛÜ]/,/ç/,/Ç/,/ñ/,/Ñ/,/_/,/[’‘‹›<>']/,/[“”«»„"]/,/[(){}[\]]/,/[?¿!¡#$%&^*´`~/°|]/,/[,.:;]/,/ /],n=["a","A","I","i","e","E","o","O","u","U","c","C","n","N","-","","","","","","-"];for(var r in t)e=e.replace(new RegExp(t[r],"g"),n[r]);return e}}]),e}(),X={};t(X,"Util",(function(){return Y}));var Y=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"callAsync",value:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];try{var i=e.apply(t,r);return i instanceof Promise?i:Promise.resolve(i)}catch(e){return Promise.reject(e)}}},{key:"uuid",value:function(){if(window.crypto)return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}));var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}}]),e}();e(n,r),e(n,p),e(n,w),e(n,P),e(n,A),e(n,G),e(n,b),e(n,H),e(n,K),e(n,X),"object"==typeof window&&(window.Artemis=n)}();
|
|
1
|
+
!function(){function e(e,t){return Object.keys(t).forEach((function(n){"default"===n||"__esModule"===n||e.hasOwnProperty(n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})),e}function t(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var n={},r={};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}function c(e,t){return!t||"object"!=((n=t)&&n.constructor===Symbol?"symbol":typeof n)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t;var n}function f(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||f(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function h(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t(r,"DebugLevel",(function(){return y})),t(r,"Debug",(function(){return d}));var y={NONE:0,ERROR:1,WARNING:2,INFO:3,DEBUG:4,ALL:5},d=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"level",value:function(e){return"number"==typeof e&&(this._level=e),this._level}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).log.apply(r,h(t))}},{key:"debug",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).debug.apply(r,h(t))}},{key:"info",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.INFO&&(r=console).info.apply(r,h(t))}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.ERROR&&(r=console).error.apply(r,h(t))}},{key:"warning",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.WARNING&&(r=console).warn.apply(r,h(t))}},{key:"table",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).table.apply(r,h(t))}},{key:"group",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).group.apply(r,h(t))}},{key:"groupCollapsed",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).groupCollapsed.apply(r,h(t))}},{key:"groupEnd",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).groupEnd.apply(r,h(t))}},{key:"time",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).time.apply(r,h(t))}},{key:"timeLog",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).timeLog.apply(r,h(t))}},{key:"timeEnd",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).timeEnd.apply(r,h(t))}},{key:"trace",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r;this.level()>=y.DEBUG&&(r=console).trace.apply(r,h(t))}}]),e}();d._level=y.NONE;var p={};t(p,"DOM",(function(){return g})),t(p,"$_",(function(){return m})),t(p,"$_ready",(function(){return k}));var g=function(){"use strict";function e(t){if(o(this,e),null===t)return this.collection=[],void(this.length=0);if("string"==typeof t)this.collection=document.querySelectorAll(t),this.length=this.collection.length,this._selector=t;else if(t instanceof NodeList)this.collection=t,this.length=t.length,this._selector=t;else if(t instanceof e)this.collection=t.collection,this.length=this.collection.length,this._selector=t._selector;else if(t instanceof HTMLElement)this.collection=[t],this.length=this.collection.length,this._selector=t;else{if("object"!=typeof t)return;t.length>=1?this.collection=t:this.collection=[t],this.length=this.collection.length,this._selector=t}}return a(e,[{key:"hide",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){r.value.style.display="none"}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return this}},{key:"show",value:function(e){var t=void 0===e?"block":e,n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.style.display=t}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}},{key:"addClass",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.classList.add(e)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"removeClass",value:function(e){var t=void 0===e?null:e,n=!0,r=!1,o=void 0;if(null!==t)try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.classList.remove(t)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}else{var l=!0,u=!1,s=void 0;try{for(var c,f=this.collection[Symbol.iterator]();!(l=(c=f.next()).done);l=!0)for(var v=c.value;v.classList.length>0;)v.classList.remove(v.classList.item(0))}catch(e){u=!0,s=e}finally{try{l||null==f.return||f.return()}finally{if(u)throw s}}}return this}},{key:"toggleClass",value:function(e){e=e.split(" ");var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0)for(var a=o.value,l=0;l<e.length;l++)a.classList.toggle(e[l])}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"hasClass",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){if(!o.value.classList.contains(e))return!1}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!0}},{key:"value",value:function(e){if(void 0!==e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.value=e}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}if(this.length>0)return this.collection[0].value}},{key:"focus",value:function(){return this.length>0&&this.collection[0].focus(),this}},{key:"click",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("click",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"keyup",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("keyup",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"keydown",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("keydown",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"submit",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("submit",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"change",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("change",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"scroll",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.addEventListener("scroll",e,!1)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"on",value:function(e,t,n){e=e.split(" ");var r=!0,o=!1,i=void 0;try{for(var a,l=this,u=function(r,o){for(var i=o.value,a=0;a<e.length;a++){var u=l;"function"==typeof t?i.addEventListener(e[a],t,!1):"string"==typeof t&&"function"==typeof n&&i.addEventListener(e[a],(function(e){if(e.target){var r=m(e.target).closestParent(t,u._selector);r.exists()&&n.call(r.get(0),e)}}),!1)}},s=this.collection[Symbol.iterator]();!(r=(a=s.next()).done);r=!0)u(0,a)}catch(e){o=!0,i=e}finally{try{r||null==s.return||s.return()}finally{if(o)throw i}}return this}},{key:"filter",value:function(t){return this.length>0?new e(this.collection[0].querySelector(t)):new e(null)}},{key:"exists",value:function(){return this.length>0}},{key:"data",value:function(e,t){if(void 0!==t){var n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.dataset[e]=t}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}if(this.length>0)return this.collection[0].dataset[e]}},{key:"removeData",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){delete o.value.dataset[e]}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"text",value:function(e){if(void 0!==e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.textContent=e}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}if(this.length>0)return this.collection[0].textContent}},{key:"html",value:function(e){if(void 0!==e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.innerHTML=e}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}if(this.length>0)return this.collection[0].innerHTML}},{key:"append",value:function(e){if(this.length>0)if("string"==typeof e){var t=document.createElement("div");t.innerHTML="string"==typeof e?e.trim():e,this.collection[0].appendChild(t.firstChild)}else this.collection[0].appendChild(e);return this}},{key:"prepend",value:function(e){if(this.length>0)if("string"==typeof e){var t=document.createElement("div");t.innerHTML="string"==typeof e?e.trim():e,this.collection[0].childNodes.length>0?this.collection[0].insertBefore(t.firstChild,this.collection[0].childNodes[0]):this.collection[0].appendChild(t.firstChild)}else this.collection[0].childNodes.length>0?this.collection[0].insertBefore(e,this.collection[0].childNodes[0]):this.collection[0].appendChild(e);return this}},{key:"each",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){e(o.value)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"get",value:function(e){return this.collection[e]}},{key:"first",value:function(){return this.length>0?new e(this.collection[0]):new e(null)}},{key:"last",value:function(){return this.length>0?new e(this.collection[this.collection.length-1]):new e(null)}},{key:"isVisible",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;if("none"!=i.display&&i.offsetWidth>0&&i.offsetHeight>0)return!0}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return!1}},{key:"parent",value:function(){return this.length>0?new e(this.collection[0].parentElement):new e(null)}},{key:"find",value:function(t){return this.length>0?new e(this.collection[0].querySelectorAll(t)):new e(null)}},{key:"offset",value:function(){if(this.length>0){var e=this.collection[0].getBoundingClientRect();return{top:e.top+document.body.scrollTop,left:e.left+document.body.scrollLeft}}}},{key:"closest",value:function(e){for(var t=null,n=this;n.exists()&&null===t;){if(!0===n.matches(e))return n;var r=n.find(e);r&&r.length>0&&(t=r),n=n.parent()}return null!==t?t:n}},{key:"closestParent",value:function(t,n){for(var r=this;r.exists();){if(!0===r.matches(t))return r;if("string"==typeof n&&r.matches(n))break;r=r.parent()}return new e(null)}},{key:"attribute",value:function(e,t){if(void 0!==t){var n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value.setAttribute(e,t)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}if(this.length>0)return this.collection[0].getAttribute(e)}},{key:"hasAttribute",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){if(!o.value.hasAttribute(e))return!1}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return!0}},{key:"after",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.insertAdjacentHTML("afterend",e)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"before",value:function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=this.collection[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.insertAdjacentHTML("beforebegin",e)}}catch(e){n=!0,r=e}finally{try{t||null==i.return||i.return()}finally{if(n)throw r}}return this}},{key:"style",value:function(e,t){for(var n=0;n<this.collection.length;n++){if("string"==typeof e&&"undefined"!==t)return this.collection[n].style[e]=t,this;if("string"==typeof e&&"undefined"===t)return this.collection[n].style[e];if("object"==typeof e){for(var r in e)this.collection[n].style[r]=e[r];return this}}}},{key:"animate",value:function(e,t){for(var n=this,r=function(r){var i=(new Date).getTime(),a=n.collection,l=void 0,u=void 0;void 0!==n.collection[o].style[r]?(u=n.collection[o].style[r],l=setInterval((function(){var n=Math.min(1,((new Date).getTime()-i)/t);a[o].style[r]=u+n*(e[r]-u),1==n&&clearInterval(l)}),25),n.collection[o].style[r]=u):void 0!==n.collection[o][r]&&(u=n.collection[o][r],l=setInterval((function(){var n=Math.min(1,((new Date).getTime()-i)/t);a[o][r]=u+n*(e[r]-u),1==n&&clearInterval(l)}),25),n.collection[o][r]=u)},o=0;o<this.collection.length;o++)for(var i in e)r(i);return this}},{key:"fadeIn",value:function(e,t){var n=void 0===e?400:e;if(this.length>0){var r=this.collection[0];r.style.opacity=0;var o=+new Date,i=function(){r.style.opacity=+r.style.opacity+(new Date-o)/n,o=+new Date,+r.style.opacity<1?window.requestAnimationFrame&&requestAnimationFrame(i)||setTimeout(i,16):"function"==typeof t&&t()};i()}return this}},{key:"fadeOut",value:function(e,t){var n=void 0===e?400:e;if(this.length>0){var r=+new Date,o=this.collection[0],i=function(){o.style.opacity=+o.style.opacity-(new Date-r)/n,r=+new Date,+o.style.opacity>0?window.requestAnimationFrame&&requestAnimationFrame(i)||setTimeout(i,16):"function"==typeof t&&t()};i()}return this}},{key:"matches",value:function(e){var t=Element.prototype,n=t.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||function(){return-1!==[].indexOf.call(document.querySelectorAll(e),this)};return this.length>0&&n.call(this.collection[0],e)}},{key:"remove",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){var i=r.value;i.parentNode.removeChild(i)}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return this}},{key:"replaceWith",value:function(e){var t=e;if("string"==typeof e){var n=document.createElement("div");n.innerHTML=e,t=n.firstChild}var r=!0,o=!1,i=void 0;try{for(var a,l=this.collection[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;u.parentElement.replaceChild(t,u)}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return this}},{key:"reset",value:function(){var e=!0,t=!1,n=void 0;try{for(var r,o=this.collection[Symbol.iterator]();!(e=(r=o.next()).done);e=!0){r.value.reset()}}catch(e){t=!0,n=e}finally{try{e||null==o.return||o.return()}finally{if(t)throw n}}return this}},{key:"property",value:function(e,t){if(void 0!==t){var n=!0,r=!1,o=void 0;try{for(var i,a=this.collection[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){i.value[e]=t}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return this}if(this.length>0)return this.collection[0][e]}}]),e}();function m(e){return void 0!==e?new g(e):g}function k(e){window.addEventListener("load",e)}var w={};t(w,"FileSystem",(function(){return x}));var b={};t(b,"Request",(function(){return S}));var S=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"serialize",value:function(e){return Object.keys(e).map((function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])})).join("&")}},{key:"get",value:function(t,n,r){var o=void 0===n?{}:n,i=void 0===r?{}:r,a=e.serialize(o);return""!==a&&(t="".concat(t,"?").concat(a)),fetch(t,i)}},{key:"post",value:function(t,n,r){var o,i=void 0===r?{}:r;if(void 0!==i.headers){var a=i.headers["Content-Type"];if(void 0!==a)if("multipart/form-data"==a)for(var l in o=new FormData,n)o.append(l,n[l]);else o="application/json"==a?JSON.stringify(n):e.serialize(n)}else o=e.serialize(n);var u=Object.assign({},{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o},i);return void 0!==u.headers&&"multipart/form-data"===u.headers["Content-Type"]&&delete u.headers["Content-Type"],fetch(t,u)}},{key:"put",value:function(t,n,r){var o=void 0===r?{}:r;return e.post(t,n,Object.assign({},{method:"PUT"},o))}},{key:"delete",value:function(t,n,r){var o=void 0===r?{}:r;return e.get(t,n,Object.assign({},{method:"DELETE"},o))}},{key:"json",value:function(t,n,r){var o=void 0===n?{}:n,i=void 0===r?{}:r;return e.get(t,o,i).then((function(e){return e.json()}))}},{key:"blob",value:function(t,n,r){var o=void 0===n?{}:n,i=void 0===r?{}:r;return e.get(t,o,i).then((function(e){return e.blob()}))}}]),e}(),x=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"readRemote",value:function(t,n,r){var o=void 0===n?"base64":n,i=void 0===r?{}:r;return S.blob(t,{},i).then((function(t){return e.read(t,o)}))}},{key:"read",value:function(e,t){var n=void 0===t?"text":t;return new Promise((function(t,r){var o=new FileReader;o.onload=function(e){t(e,e.target.result)},o.onerror=function(e){r(e)},"base64"===n?o.readAsDataURL(e):"buffer"===n?o.readAsArrayBuffer(e):o.readAsText(e,"UTF-8")}))}},{key:"create",value:function(e,t,n){var r=void 0===n?"text/plain":n;return Promise.resolve(new File([t],e,{type:r}))}},{key:"extension",value:function(e){return e.split(".").pop()}},{key:"isImage",value:function(t){return["jpg","jpeg","png","gif","svg","webp","bmp"].indexOf(e.extension(t).toLowerCase())>-1}}]),e}(),P={};t(P,"Form",(function(){return j}));var j=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"fill",value:function(e,t){for(var n in t){var r=m("form[data-form='".concat(e,"'] [name='").concat(n,"']")).get(0);if(void 0!==r)switch(r.type){case"file":case"file[]":break;default:r.value=t[n]}}}},{key:"values",value:function(e){var t={};return m("form[data-form='".concat(e,"'] [name]")).each((function(e){var n;switch(e.type){case"file[]":n=e.files;break;case"file":n=e.files[0];break;default:n=e.value}null!=n&&(t[e.name]=n)})),t}}]),e}(),A={};t(A,"Platform",(function(){return F}));var O,E,L,I=O={};function T(){throw new Error("setTimeout has not been defined")}function _(){throw new Error("clearTimeout has not been defined")}function D(e){if(E===setTimeout)return setTimeout(e,0);if((E===T||!E)&&setTimeout)return E=setTimeout,setTimeout(e,0);try{return E(e,0)}catch(t){try{return E.call(null,e,0)}catch(t){return E.call(this,e,0)}}}!function(){try{E="function"==typeof setTimeout?setTimeout:T}catch(e){E=T}try{L="function"==typeof clearTimeout?clearTimeout:_}catch(e){L=_}}();var B,C=[],N=!1,M=-1;function R(){N&&B&&(N=!1,B.length?C=B.concat(C):M=-1,C.length&&U())}function U(){if(!N){var e=D(R);N=!0;for(var t=C.length;t;){for(B=C,C=[];++M<t;)B&&B[M].run();M=-1,t=C.length}B=null,N=!1,function(e){if(L===clearTimeout)return clearTimeout(e);if((L===_||!L)&&clearTimeout)return L=clearTimeout,clearTimeout(e);try{L(e)}catch(t){try{return L.call(null,e)}catch(t){return L.call(this,e)}}}(e)}}function V(e,t){this.fun=e,this.array=t}function W(){}I.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];C.push(new V(e,t)),1!==C.length||N||D(U)},V.prototype.run=function(){this.fun.apply(null,this.array)},I.title="browser",I.browser=!0,I.env={},I.argv=[],I.version="",I.versions={},I.on=W,I.addListener=W,I.once=W,I.off=W,I.removeListener=W,I.removeAllListeners=W,I.emit=W,I.prependListener=W,I.prependOnceListener=W,I.listeners=function(e){return[]},I.binding=function(e){throw new Error("process.binding is not supported")},I.cwd=function(){return"/"},I.chdir=function(e){throw new Error("process.chdir is not supported")},I.umask=function(){return 0};var F=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"retina",value:function(){return window.devicePixelRatio>=2}},{key:"portrait",value:function(){return 0===window.orientation||180===window.orientation}},{key:"landscape",value:function(){return 90===window.orientation||-90===window.orientation}},{key:"orientation",value:function(){return e.portrait()?"portrait":"landscape"}},{key:"electron",value:function(){return"undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||(!(void 0===O||"object"!=typeof O.versions||!O.versions.electron)||"object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>-1)}},{key:"cordova",value:function(){return!!window.cordova}},{key:"desktop",value:function(e){var t=!1;switch(void 0===e?"Any":e){case"Windows":t=navigator.platform.includes("Win");break;case"macOS":t=navigator.platform.includes("Mac");break;case"Linux":t=navigator.platform.includes("Linux");break;case"FreeBSD":t=navigator.platform.includes("FreeBSD");break;case"webOS":t=navigator.platform.includes("WebTV");break;default:t=navigator.platform.includes("Win")||navigator.platform.includes("Mac")||navigator.platform.includes("Linux")||navigator.platform.includes("FreeBSD")||navigator.platform.includes("WebTV")}return t}},{key:"mobile",value:function(e){var t=!1;switch(void 0===e?"Any":e){case"Android":t=/Android/i.test(navigator.userAgent);break;case"iOS":t=/iPhone|iPad|iPod/i.test(navigator.userAgent);break;case"Opera":t=/Opera Mini/i.test(navigator.userAgent);break;case"Windows":t=/Windows Phone|IEMobile|WPDesktop/i.test(navigator.userAgent);break;case"BlackBerry":t=/BlackBerry|BB10/i.test(navigator.userAgent);break;default:t=/Android|iPhone|iPad|iPod|Windows Phone|IEMobile|WPDesktop|BlackBerry|BB10/i.test(navigator.userAgent)}return t}},{key:"serviceWorkers",value:function(){return"undefined"!=typeof navigator&&"serviceWorker"in navigator&&location.protocol.indexOf("http")>-1}}]),e}(),G={};t(G,"Preload",(function(){return q}));var q=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"image",value:function(e){return new Promise((function(t,n){var r=new Image;r.onload=function(){t(r)},r.onerror=function(e){n(e)},r.src=e}))}},{key:"file",value:function(e){return S.blob(e)}}]),e}(),H={};t(H,"SpaceAdapter",(function(){return J})),t(H,"Space",(function(){return $}));var z=function(){"use strict";function e(t){var n=t.name,r=void 0===n?"":n,i=t.version,a=void 0===i?"":i,l=t.store,u=void 0===l?"":l;o(this,e),this.name=r,this.version=a,this.store=u,this.upgrades={},""===this.version?this.numericVersion=0:this.numericVersion=parseInt(a.replace(/\./g,"")),this.id=""!==r&&""!==a&&""!==u?"".concat(this.name,"::").concat(this.store,"::").concat(this.version,"_"):""!==r&&""!==a?"".concat(this.name,"::").concat(this.version,"_"):""!==r?"".concat(this.name,"::_"):""}return a(e,[{key:"open",value:function(){if("object"!=typeof this.storage||this.storage instanceof Promise){if(this.storage instanceof Promise)return this.storage;var e=this,t=this;return this.storage=new Promise((function(t){var n=[];if(""!==e.version){var r="";""!==e.name&&""!==e.version&&""!==e.store?r="".concat(e.name,"::").concat(e.store,"::"):""!==e.name&&""!==e.version&&(r="".concat(e.name,"::"));var o=Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(r)})).map((function(e){return e.replace(r,"").split("_")[0]})).filter((function(e){return-1===e.indexOf("::")})).sort();if(o.length>0){var i=o[0],a=parseInt(i.replace(/\./g,""));if(a<e.numericVersion){var l=e,u=Object.keys(e.upgrades).sort(),s=u.findIndex((function(e){var t=v(e.split("::"))[0];return parseInt(t)===a}));s>-1&&(n=u.slice(s).filter((function(e){var t=v(e.split("::")),n=t[0],r=t[1];return parseInt(n)<l.numericVersion&&parseInt(r)<=l.numericVersion})));var c="".concat(e.name,"::").concat(i,"_");""!==e.name&&""!==e.version&&""!==e.store?c="".concat(e.name,"::").concat(e.store,"::").concat(i,"_"):""!==e.name&&""!==e.version&&(c="".concat(e.name,"::").concat(i,"_"));var f=Object.keys(window.localStorage).filter((function(e){return 0===e.indexOf(c)})).map((function(e){return e.replace(c,"")})),h=!0,y=!1,d=void 0;try{for(var p,g=f[Symbol.iterator]();!(h=(p=g.next()).done);h=!0){var m=p.value,k=window.localStorage.getItem("".concat(c).concat(m));window.localStorage.setItem(e.id+m,k),window.localStorage.removeItem("".concat(c).concat(m))}}catch(e){y=!0,d=e}finally{try{h||null==g.return||g.return()}finally{if(y)throw d}}}}}t({upgrades:n})})).then((function(e){var n=e.upgrades,r=t;return t.storage=window.localStorage,new Promise((function(e){var t=r;r._upgrade(n,(function(){return e(t)}))}))})),this.storage}return Promise.resolve(this)}},{key:"set",value:function(e,t){var n=this;return this.open().then((function(){return"object"==typeof t?n.storage.setItem(n.id+e,JSON.stringify(t)):n.storage.setItem(n.id+e,t),Promise.resolve({key:e,value:t})}))}},{key:"update",value:function(e,t){var n=this,r=this;return this.get(e).then((function(r){return"object"==typeof r?("object"==typeof t&&(t=Object.assign({},r,t)),n.storage.setItem(n.id+e,JSON.stringify(t))):n.storage.setItem(n.id+e,t),Promise.resolve({key:e,value:t})})).catch((function(){return r.set(e,t)}))}},{key:"get",value:function(e){var t=this;return this.open().then((function(){var n=t;return new Promise((function(t,r){var o=null;o=n.storage.getItem(n.id+e);try{var i=JSON.parse(o);i&&"object"==typeof i&&(o=i)}catch(e){}null!=o?t(o):r()}))}))}},{key:"getAll",value:function(){var e=this;return this.keys().then((function(t){var n={},r=[],o=!0,i=!1,a=void 0;try{for(var l,u=function(t,o){var i=o.value;r.push(e.get(i).then((function(e){n[i]=e})))},s=t[Symbol.iterator]();!(o=(l=s.next()).done);o=!0)u(0,l)}catch(e){i=!0,a=e}finally{try{o||null==s.return||s.return()}finally{if(i)throw a}}return Promise.all(r).then((function(){return n}))}))}},{key:"contains",value:function(e){return this.keys().then((function(t){if(!t.includes(e))return Promise.reject();Promise.resolve()}))}},{key:"upgrade",value:function(e,t,n){return this.upgrades["".concat(parseInt(e.replace(/\./g,"")),"::").concat(parseInt(t.replace(/\./g,"")))]=n,Promise.resolve()}},{key:"_upgrade",value:function(e,t){var n=this;e.length>0?this.upgrades[e[0]].call(this,this).then((function(){n._upgrade(e.slice(1),t)})).catch((function(e){return console.error(e)})):t()}},{key:"rename",value:function(e){var t=this;return this.name!==e?this.keys().then((function(n){var r=t,o=t.id;t.name=e,""!==t.name&&""!==t.version&&""!==t.store?t.id="".concat(t.name,"::").concat(t.store,"::").concat(t.version,"_"):""!==t.name&&""!==t.version?t.id="".concat(t.name,"::").concat(t.version,"_"):""!==t.name?t.id="".concat(t.name,"::_"):t.id="";var i=[],a=!0,l=!1,u=void 0;try{for(var s,c=function(e,n){var a=n.value;i.push(t.set(a,t.storage.getItem("".concat(o).concat(a))).then((function(){r.storage.removeItem("".concat(o).concat(a))})))},f=n[Symbol.iterator]();!(a=(s=f.next()).done);a=!0)c(0,s)}catch(e){l=!0,u=e}finally{try{a||null==f.return||f.return()}finally{if(l)throw u}}return Promise.all(i)})):Promise.reject()}},{key:"key",value:function(e,t){var n=void 0!==t&&t,r=this;return this.open().then((function(){return!0===n?Promise.resolve(r.storage.key(e)):Promise.resolve(r.storage.key(e).replace(r.id,""))}))}},{key:"keys",value:function(e){var t=void 0!==e&&e,n=this;return this.open().then((function(){var e=n,r=n;return Promise.resolve(Object.keys(n.storage).filter((function(t){return 0===t.indexOf(e.id)})).map((function(e){return!0===t?e:e.replace(r.id,"")})))}))}},{key:"remove",value:function(e){var t=this;return this.get(e).then((function(n){return t.storage.removeItem(t.id+e),Promise.resolve(n)}))}},{key:"clear",value:function(){var e=this;return this.keys().then((function(t){var n=!0,r=!1,o=void 0;try{for(var i,a=t[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value;e.remove(l)}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return Promise.resolve()}))}}]),e}(),J={LocalStorage:z,SessionStorage:function(e){"use strict";function t(e){var n,r=e.name,i=void 0===r?"":r,a=e.version,u=void 0===a?"":a,s=e.store,f=void 0===s?"":s;return o(this,t),c(this,(n=t,l(n)).call(this,{name:i,version:u,store:f}))}return s(t,e),a(t,[{key:"open",value:function(){return void 0===this.storage&&(this.storage=window.sessionStorage),Promise.resolve(this)}}]),t}(z),IndexedDB:function(){"use strict";function e(t){var n=t.name,r=void 0===n?"":n,i=t.version,a=void 0===i?"":i,l=t.store,u=void 0===l?"":l,s=t.props,c=void 0===s?{}:s,f=t.index,v=void 0===f?{}:f;o(this,e),this.name=r,this.version=a,this.store=u,this.props=c,this.index=v,this.upgrades={},""===this.version?this.numericVersion=0:this.numericVersion=parseInt(a.replace(/\./g,""))}return a(e,[{key:"open",value:function(){if(""===this.name)return console.error("No name has been defined for IndexedDB space."),Promise.reject();if(""===this.store)return console.error("No store has been defined for IndexedDB space."),Promise.reject();if(this.storage instanceof IDBDatabase)return Promise.resolve(this);if(this.storage instanceof Promise)return this.storage;var e=this,t=this;return this.storage=new Promise((function(t,n){var r=e,o=[],i=window.indexedDB.open(e.name,e.numericVersion);i.onerror=function(e){n(e)},i.onsuccess=function(e){t({storage:e.target.result,upgrades:o})},i.onupgradeneeded=function(e){if(e.oldVersion<1){var n=e.target.result.createObjectStore(r.store,r.props),i=!0,a=!1,l=void 0;try{for(var u,s=Object.keys(r.index)[Symbol.iterator]();!(i=(u=s.next()).done);i=!0){var c=u.value;n.createIndex(r.index[c].name,r.index[c].field,r.index[c].props)}}catch(e){a=!0,l=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw l}}}else{var f=r,h=Object.keys(r.upgrades).sort(),y=h.findIndex((function(t){var n=v(t.split("::"))[0];return parseInt(n)===e.oldVersion}));y>-1&&(o=h.slice(y).filter((function(e){var t=v(e.split("::")),n=t[0],r=t[1];return parseInt(n)<f.numericVersion&&parseInt(r)<=f.numericVersion})))}e.target.transaction.addEventListener("success",(function(){t({storage:e.target.result,upgrades:o})}))}})).then((function(e){var n=e.storage,r=e.upgrades,o=t;return t.storage=n,new Promise((function(e){o._upgrade(r,(function(){return e(n)}),event)}))})),this.storage}},{key:"set",value:function(e,t){var n=void 0===e?null:e,r=this;return this.open().then((function(){var e=r;return new Promise((function(r,o){var i,a=e.storage.transaction(e.store,"readwrite").objectStore(e.store);(i=null!==n?a.put(Object.assign({},{id:n},t)):a.add(t)).addEventListener("success",(function(e){r({key:e.target.result,value:t})})),i.addEventListener("error",(function(e){o(e)}))}))}))}},{key:"update",value:function(e,t){var n=this;return this.get(e).then((function(r){var o=n;return void 0===r?n.set(e,t):new Promise((function(e,n){var i=o.storage.transaction(o.store,"readwrite").objectStore(o.store).put(Object.assign({},r,t));i.addEventListener("success",(function(n){e({key:n.target.result,value:t})})),i.addEventListener("error",(function(e){n(e)}))}))}))}},{key:"get",value:function(e){var t=this;return this.open().then((function(){var n=t;return new Promise((function(t,r){var o=n.storage.transaction(n.store).objectStore(n.store).get(e);o.addEventListener("success",(function(e){var n=e.target.result;null!=n?t(n):r()})),o.addEventListener("error",(function(e){r(e)}))}))}))}},{key:"getAll",value:function(){var e=this;return this.open().then((function(){var t=e;return new Promise((function(e,n){var r=t.storage.transaction(t.store).objectStore(t.store).getAll();r.addEventListener("success",(function(t){e(t.target.result)})),r.addEventListener("error",(function(e){n(e)}))}))}))}},{key:"contains",value:function(e){return this.get(e).then((function(t){if(!t.includes(e))return Promise.reject();Promise.resolve()}))}},{key:"upgrade",value:function(e,t,n){return this.upgrades["".concat(parseInt(e.replace(/\./g,"")),"::").concat(parseInt(t.replace(/\./g,"")))]=n,Promise.resolve()}},{key:"_upgrade",value:function(e,t,n){var r=this;e.length>0?this.upgrades[e[0]].call(this,this,n).then((function(){r._upgrade(e.slice(1),t,n)})).catch((function(e){return console.error(e)})):t()}},{key:"rename",value:function(){return Promise.reject()}},{key:"key",value:function(){return Promise.reject()}},{key:"keys",value:function(){var e=this;return this.open().then((function(){var t=e;return new Promise((function(e,n){var r=t.storage.transaction(t.store,"readwrite").objectStore(t.store).getAllKeys();r.addEventListener("success",(function(t){e(t.target.result)}),!1),r.addEventListener("error",(function(e){n(e)}),!1)}))}))}},{key:"remove",value:function(e){var t=this;return this.get(e).then((function(n){var r=t;return new Promise((function(t,o){var i=r.storage.transaction(r.store,"readwrite").objectStore(r.store).delete(e);i.addEventListener("success",(function(){t(n)}),!1),i.addEventListener("error",(function(e){o(e)}),!1)}))}))}},{key:"clear",value:function(){var e=this;return this.open().then((function(){var t=e;return new Promise((function(e,n){var r=t.storage.transaction(t.store,"readwrite").objectStore(t.store).clear();r.addEventListener("success",(function(){e()}),!1),r.addEventListener("error",(function(e){n(e)}),!1)}))}))}}]),e}(),RemoteStorage:function(){"use strict";function e(t){var n=t.name,r=void 0===n?"":n,i=t.version,a=void 0===i?"":i,l=t.store,u=void 0===l?"":l,s=t.endpoint,c=void 0===s?"":s,f=t.props,v=void 0===f?{}:f;o(this,e),this.name=r,this.version=a,this.store=u,this.endpoint="".concat(c).concat(u,"/"),this.props=v}return a(e,[{key:"open",value:function(){return void 0===this.storage&&(this.storage=S),Promise.resolve(this)}},{key:"set",value:function(e,t){var n=this;return this.open().then((function(){return n.storage.post(n.endpoint+e,t,n.props).then((function(t){return Promise.resolve({key:e,response:t.json()})}))}))}},{key:"update",value:function(e,t){var n=this;return this.get(e).then((function(r){return n.storage.put(n.endpoint+e,Object.assign({},r,t),n.props).then((function(t){return Promise.resolve({key:e,response:t.json()})}))}))}},{key:"get",value:function(e){var t=this;return this.open().then((function(){return t.storage.json(t.endpoint+e,{},t.props)}))}},{key:"getAll",value:function(){var e=this;return this.open().then((function(){return e.storage.json(e.endpoint,{},e.props)}))}},{key:"contains",value:function(e){return this.keys().then((function(t){if(!t.includes(e))return Promise.reject();Promise.resolve()}))}},{key:"upgrade",value:function(){return Promise.reject()}},{key:"rename",value:function(){return Promise.reject()}},{key:"key",value:function(){return Promise.reject()}},{key:"keys",value:function(){var e=this;return this.open().then((function(){return e.storage.json(e.endpoint,{keys:!0},e.props)}))}},{key:"remove",value:function(e){var t=this;return this.open().then((function(){return t.storage.delete(t.endpoint+e,{},t.props).then((function(t){return Promise.resolve(e,t.json())}))}))}},{key:"clear",value:function(){var e=this;return this.open().then((function(){return e.storage.delete(e.endpoint,{},e.props)}))}}]),e}()},$=function(){"use strict";function e(t,n){var r=void 0===t?J.LocalStorage:t,i=void 0===n?{}:n;o(this,e),this._configuration=Object.assign({},{name:"",version:"",store:""},i),this.adapter=new r(this._configuration),this.callbacks={create:[],update:[],delete:[]},this.transformations={}}return a(e,[{key:"configuration",value:function(e){var t=void 0===e?null:e;if(null===t)return this._configuration;this._configuration=Object.assign({},this._configuration,t),this.adapter.configuration(t)}},{key:"open",value:function(){var e=this;return this.adapter.open().then((function(){return Promise.resolve(e)}))}},{key:"set",value:function(e,t){var n=this,r=!0,o=!1,i=void 0;try{for(var a,l=Object.keys(this.transformations)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;"function"==typeof this.transformations[u].set&&(t=this.transformations[u].set.call(null,e,t))}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return this.adapter.set(e,t).then((function(e){var t=e.key,r=e.value,o=!0,i=!1,a=void 0;try{for(var l,u=n.callbacks.create[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){l.value.call(null,t,r)}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return Promise.resolve({key:t,value:r})}))}},{key:"update",value:function(e,t){var n=this,r=!0,o=!1,i=void 0;try{for(var a,l=Object.keys(this.transformations)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;"function"==typeof this.transformations[u].set&&(t=this.transformations[u].set.call(null,e,t))}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return this.adapter.update(e,t).then((function(e){var t=e.key,r=e.value,o=!0,i=!1,a=void 0;try{for(var l,u=n.callbacks.update[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){l.value.call(null,t,r)}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return Promise.resolve({key:t,value:r})}))}},{key:"get",value:function(e){var t=this;return this.adapter.get(e).then((function(n){var r=!0,o=!1,i=void 0;try{for(var a,l=Object.keys(t.transformations)[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){var u=a.value;"function"==typeof t.transformations[u].get&&(n=t.transformations[u].get.call(null,e,n))}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n}))}},{key:"getAll",value:function(){var e=this;return this.adapter.getAll().then((function(t){var n=!0,r=!1,o=void 0;try{for(var i,a=Object.keys(t)[Symbol.iterator]();!(n=(i=a.next()).done);n=!0){var l=i.value,u=!0,s=!1,c=void 0;try{for(var f,v=Object.keys(e.transformations)[Symbol.iterator]();!(u=(f=v.next()).done);u=!0){var h=f.value;"function"==typeof e.transformations[h].get&&(t[l]=e.transformations[h].get.call(null,l,t[l]))}}catch(e){s=!0,c=e}finally{try{u||null==v.return||v.return()}finally{if(s)throw c}}}}catch(e){r=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(r)throw o}}return t}))}},{key:"each",value:function(e){var t=this;return this.getAll().then((function(n){var r=[],o=!0,i=!1,a=void 0;try{for(var l,u=Object.keys(n)[Symbol.iterator]();!(o=(l=u.next()).done);o=!0){var s=l.value;r.push(e.call(t,s,n[s]))}}catch(e){i=!0,a=e}finally{try{o||null==u.return||u.return()}finally{if(i)throw a}}return Promise.all(r)}))}},{key:"contains",value:function(e){return this.adapter.contains(e)}},{key:"upgrade",value:function(e,t,n){var r=this;return this.adapter.upgrade(e,t,n).then((function(){return Promise.resolve(r)}))}},{key:"rename",value:function(e){return this.adapter.rename(e)}},{key:"onCreate",value:function(e){this.callbacks.create.push(e)}},{key:"onUpdate",value:function(e){this.callbacks.update.push(e)}},{key:"onDelete",value:function(e){this.callbacks.delete.push(e)}},{key:"addTransformation",value:function(e){var t=e.id,n=e.get,r=e.set;this.transformations[t]={id:t,get:n,set:r}}},{key:"removeTransformation",value:function(e){delete this.transformations[e]}},{key:"key",value:function(e,t){var n=void 0!==t&&t;return this.adapter.key(e,n)}},{key:"keys",value:function(e){var t=void 0!==e&&e;return this.adapter.keys(t)}},{key:"remove",value:function(e){var t=this;return this.adapter.remove(e).then((function(n){var r=!0,o=!1,i=void 0;try{for(var a,l=t.callbacks.delete[Symbol.iterator]();!(r=(a=l.next()).done);r=!0){a.value.call(null,e,n)}}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}}))}},{key:"clear",value:function(){return this.adapter.clear()}}]),e}(),K={};t(K,"Text",(function(){return Q}));var Q=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"capitalize",value:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}},{key:"suffix",value:function(e,t){var n="",r=t.indexOf(e);return-1!==r&&(r+=e.length,n=t.substr(r,t.length-r)),n}},{key:"selection",value:function(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:void 0}},{key:"prefix",value:function(e,t){var n="",r=t.indexOf(e);return-1!=r&&(n=t.substr(0,r)),n}},{key:"friendly",value:function(e){var t=[/[áàâãªä]/,/[ÁÀÂÃÄ]/,/[ÍÌÎÏ]/,/[íìîï]/,/[éèêë]/,/[ÉÈÊË]/,/[óòôõºö]/,/[ÓÒÔÕÖ]/,/[úùûü]/,/[ÚÙÛÜ]/,/ç/,/Ç/,/ñ/,/Ñ/,/_/,/[’‘‹›<>']/,/[“”«»„"]/,/[(){}[\]]/,/[?¿!¡#$%&^*´`~/°|]/,/[,.:;]/,/ /],n=["a","A","I","i","e","E","o","O","u","U","c","C","n","N","-","","","","","","-"];for(var r in t)e=e.replace(new RegExp(t[r],"g"),n[r]);return e}}]),e}(),X={};t(X,"Util",(function(){return Y}));var Y=function(){"use strict";function e(){o(this,e)}return a(e,null,[{key:"callAsync",value:function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];try{var i=e.apply(t,r);return i instanceof Promise?i:Promise.resolve(i)}catch(e){return Promise.reject(e)}}},{key:"uuid",value:function(){if(window.crypto)return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}));var e=function(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}}]),e}();e(n,r),e(n,p),e(n,w),e(n,P),e(n,A),e(n,G),e(n,b),e(n,H),e(n,K),e(n,X),"object"==typeof window&&(window.Artemis=n)}();
|
|
2
2
|
//# sourceMappingURL=artemis.min.js.map
|