// Version 1.14.5 kapsule - https://github.com/vasturiano/kapsule !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).Kapsule=n()}(this,(function(){"use strict";function t(t,n){for(var e=0;et.length)&&(n=t.length);for(var e=0,r=new Array(n);e=n||e<0||d&&t-v>=u}function g(){var t=f();if(b(t))return h(t);c=setTimeout(g,function(t){var e=n-(t-l);return d?U(e,u-(t-v)):e}(t))}function h(t){return c=void 0,p&&r?y(t):(r=o=void 0,a)}function m(){var t=f(),e=b(t);if(r=arguments,o=this,l=t,e){if(void 0===c)return function(t){return v=t,c=setTimeout(g,n),s?y(t):a}(l);if(d)return clearTimeout(c),c=setTimeout(g,n),y(l)}return void 0===c&&(c=setTimeout(g,n)),a}return n=P(n)||0,i(e)&&(s=!!e.leading,u=(d="maxWait"in e)?I(P(e.maxWait)||0,n):u,p="trailing"in e?!!e.trailing:p),m.cancel=function(){void 0!==c&&clearTimeout(c),v=0,r=l=o=c=void 0},m.flush=function(){return void 0===c?a:h(f())},m}var $=n((function t(n,e){var r=e.default,i=void 0===r?null:r,o=e.triggerUpdate,u=void 0===o||o,a=e.onChange,f=void 0===a?function(t,n){}:a;!function(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=n,this.defaultVal=i,this.triggerUpdate=u,this.onChange=f}));return function(t){var n=t.stateInit,r=void 0===n?function(){return{}}:n,i=t.props,o=void 0===i?{}:i,u=t.methods,a=void 0===u?{}:u,f=t.aliases,c=void 0===f?{}:f,l=t.init,v=void 0===l?function(){}:l,s=t.update,d=void 0===s?function(){}:s,p=Object.keys(o).map((function(t){return new $(t,o[t])}));return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=Object.assign({},r instanceof Function?r(t):r,{initialised:!1}),i={};function o(n){return u(n,t),f(),o}var u=function(t,e){v.call(o,t,n,e),n.initialised=!0},f=N((function(){n.initialised&&(d.call(o,n,i),i={})}),1);return p.forEach((function(t){o[t.name]=function(t){var e=t.name,r=t.triggerUpdate,u=void 0!==r&&r,a=t.onChange,c=void 0===a?function(t,n){}:a,l=t.defaultVal,v=void 0===l?null:l;return function(t){var r=n[e];if(!arguments.length)return r;var a=void 0===t?v:t;return n[e]=a,c.call(o,a,n,r),!i.hasOwnProperty(e)&&(i[e]=r),u&&f(),o}}(t)})),Object.keys(a).forEach((function(t){o[t]=function(){for(var e,r=arguments.length,i=new Array(r),u=0;u