var __extends=this&&this.__extends||function(){var e=function(t,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};return e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();var __spreadArrays=this&&this.__spreadArrays||function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),o=0,t=0;t<n;t++)for(var s=arguments[t],a=0,i=s.length;a<i;a++,o++)r[o]=s[a];return r};import{g as getElement,a as getRenderingRef,f as forceUpdate}from"./index-38ad4957.js";var commonjsGlobal=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}function createCommonjsModule(e,t,n){return n={path:t,exports:{},require:function(e,t){return commonjsRequire()}},e(n,n.exports),n.exports}function getAugmentedNamespace(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:true});Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:true,get:function(){return e[n]}})}));return t}function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}function t(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 n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}var s=function(){function e(e){var t=this,n=this;this._status="Initial",this.onChange=function(e,t){n.options.onChange&&n.options.onChange(e,t)},this.onConnect=function(e){try{return t.status="Connected",t.options.onChange&&t.options.onChange(e,e),Promise.resolve(new Promise((function(e){t.resolvePromise=e})))}catch(e){return Promise.reject(e)}},this.onDisconnect=function(){n.status="Connecting",n.start()},this.options=e}var t=e.prototype;return t.start=function(){var e=this,t=0;this.status="Connecting";var n=function(){return e.status},r=a(this.options.attempts)||10,o=function(){if("Connected"!==n()){var o=new CustomEvent(e.options.contextName,{bubbles:!0,cancelable:!0,composed:!0,detail:{onConnect:e.onConnect,onChange:e.onChange,onDisconnect:e.onDisconnect}});a(e.options.element).dispatchEvent(o),"Connected"!==n()?++t>=r&&(e._interval&&clearInterval(e._interval),e.status="Timeout"):"Connected"===n()&&e._interval&&clearInterval(e._interval)}};return(a(this.options.pollingMs)||100)>0&&r>1&&(this._interval=setInterval(o,a(this.options.pollingMs)||100)),o(),this},t.stop=function(){return this._interval&&clearInterval(this._interval),this.resolvePromise&&this.resolvePromise(),this.status="Initial",this},n(e,[{key:"status",set:function(e){this._status=e,this.options.onStatus&&this.options.onStatus(e)},get:function(){return this._status}}]),e}(),c=function(){function e(e){var t=this;this.__listeners=[],this.connectListener=function(e){try{e.stopPropagation(),t.__listeners=[].concat(t.__listeners,[e.detail]);var n=function(n,r){try{var o=Promise.resolve(e.detail.onConnect(t.__current)).then((function(){}))}catch(e){return r(!0,e)}return o&&o.then?o.then(r.bind(null,!1),r.bind(null,!0)):r(!1,o)}(0,(function(n,r){var o,s;if(t.__listeners=(s=(o=t.__listeners).indexOf(e.detail),o.slice(0,s).concat(o.slice(s+1,o.length))),n)throw r;return r}));return Promise.resolve(n&&n.then?n.then((function(){})):void 0)}catch(e){return Promise.reject(e)}},this.options=e,this.__current=a(e.initialState)}var t=e.prototype;return t.start=function(){return a(this.options.element).addEventListener(this.options.contextName,this.connectListener),this},t.stop=function(){return a(this.options.element).removeEventListener(this.options.contextName,this.connectListener),this.__listeners.map((function(e){e.onDisconnect()})),this.__listeners=[],this},n(e,[{key:"context",set:function(e){var t=this.__current;this.__current=e,this.__listeners.forEach((function(n){return n.onChange(e,t)}))},get:function(){return a(this.__current)}},{key:"listeners",get:function(){return Object.freeze([].concat(this.__listeners))}}]),e}();function a(e){return"function"==typeof typeof e?e():e}
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */var marker="{{lit-"+String(Math.random()).slice(2)+"}}";
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */var policy=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:function(e){return e}});
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */(function(){try{var e={get capture(){return false}};window.addEventListener("test",e,e);window.removeEventListener("test",e,e)}catch(e){}})();
/**
 * @license
 * Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
 * This code may only be used under the BSD style license found at
 * http://polymer.github.io/LICENSE.txt
 * The complete set of authors may be found at
 * http://polymer.github.io/AUTHORS.txt
 * The complete set of contributors may be found at
 * http://polymer.github.io/CONTRIBUTORS.txt
 * Code distributed by Google as part of the polymer project is also
 * subject to an additional IP rights grant found at
 * http://polymer.github.io/PATENTS.txt
 */if(typeof window!=="undefined"){(window["litHtmlVersions"]||(window["litHtmlVersions"]=[])).push("1.4.1")}var current;var currentId=0;function setCurrent(e){current=e}function clear(){current=null;currentId=0}function notify(){return currentId++}var hookSymbol=Symbol("haunted.hook");var effectsSymbol=Symbol("haunted.effects");var layoutEffectsSymbol=Symbol("haunted.layoutEffects");var contextEvent="haunted.context";var State=function(){function e(e,t){this.update=e;this.host=t;this[hookSymbol]=new Map;this[effectsSymbol]=[];this[layoutEffectsSymbol]=[]}e.prototype.run=function(e){setCurrent(this);var t=e();clear();return t};e.prototype._runEffects=function(e){var t=this[e];setCurrent(this);for(var n=0,r=t;n<r.length;n++){var o=r[n];o.call(this)}clear()};e.prototype.runEffects=function(){this._runEffects(effectsSymbol)};e.prototype.runLayoutEffects=function(){this._runEffects(layoutEffectsSymbol)};e.prototype.teardown=function(){var e=this[hookSymbol];e.forEach((function(e){if(typeof e.teardown==="function"){e.teardown()}}))};return e}();var defer=Promise.resolve().then.bind(Promise.resolve());var Hook=function(){function e(e,t){this.id=e;this.state=t}return e}();function use(e){var t=[];for(var n=1;n<arguments.length;n++){t[n-1]=arguments[n]}var r=notify();var o=current[hookSymbol];var s=o.get(r);if(!s){s=new(e.bind.apply(e,__spreadArrays([void 0,r,current],t)));o.set(r,s)}return s.update.apply(s,t)}function hook(e){return use.bind(null,e)}function createEffect(e){return hook(function(t){__extends(n,t);function n(n,r,o,s){var a=t.call(this,n,r)||this;e(r,a);return a}n.prototype.update=function(e,t){this.callback=e;this.values=t};n.prototype.call=function(){if(!this.values||this.hasChanged()){this.run()}this.lastValues=this.values};n.prototype.run=function(){this.teardown();this._teardown=this.callback.call(this.state)};n.prototype.teardown=function(){if(typeof this._teardown==="function"){this._teardown()}};n.prototype.hasChanged=function(){var e=this;return!this.lastValues||this.values.some((function(t,n){return e.lastValues[n]!==t}))};return n}(Hook))}function setEffects(e,t){e[effectsSymbol].push(t)}var useEffect=createEffect(setEffects);var useContext=hook(function(e){__extends(t,e);function t(t,n,r){var o=e.call(this,t,n)||this;o._updater=o._updater.bind(o);o._ranEffect=false;o._unsubscribe=null;setEffects(n,o);return o}t.prototype.update=function(e){if(this.state.virtual){throw new Error("can't be used with virtual components")}if(this.Context!==e){this._subscribe(e);this.Context=e}return this.value};t.prototype.call=function(){if(!this._ranEffect){this._ranEffect=true;if(this._unsubscribe)this._unsubscribe();this._subscribe(this.Context);this.state.update()}};t.prototype._updater=function(e){this.value=e;this.state.update()};t.prototype._subscribe=function(e){var t={Context:e,callback:this._updater};this.state.host.dispatchEvent(new CustomEvent(contextEvent,{detail:t,bubbles:true,cancelable:true,composed:true}));var n=t.unsubscribe,r=n===void 0?null:n,o=t.value;this.value=r?o:e.defaultValue;this._unsubscribe=r};t.prototype.teardown=function(){if(this._unsubscribe){this._unsubscribe()}};return t}(Hook));var useMemo=hook(function(e){__extends(t,e);function t(t,n,r,o){var s=e.call(this,t,n)||this;s.value=r();s.values=o;return s}t.prototype.update=function(e,t){if(this.hasChanged(t)){this.values=t;this.value=e()}return this.value};t.prototype.hasChanged=function(e){var t=this;if(e===void 0){e=[]}return e.some((function(e,n){return t.values[n]!==e}))};return t}(Hook));function setLayoutEffects(e,t){e[layoutEffectsSymbol].push(t)}var useLayoutEffect=createEffect(setLayoutEffects);var useState=hook(function(e){__extends(t,e);function t(t,n,r){var o=e.call(this,t,n)||this;o.updater=o.updater.bind(o);if(typeof r==="function"){r=r()}o.makeArgs(r);return o}t.prototype.update=function(){return this.args};t.prototype.updater=function(e){if(typeof e==="function"){var t=e;var n=this.args[0];e=t(n)}this.makeArgs(e);this.state.update()};t.prototype.makeArgs=function(e){this.args=Object.freeze([e,this.updater])};return t}(Hook));var useReducer=hook(function(e){__extends(t,e);function t(t,n,r,o,s){var a=e.call(this,t,n)||this;a.dispatch=a.dispatch.bind(a);a.currentState=s!==undefined?s(o):o;return a}t.prototype.update=function(e){this.reducer=e;return[this.currentState,this.dispatch]};t.prototype.dispatch=function(e){this.currentState=this.reducer(this.currentState,e);this.state.update()};return t}(Hook));var useRef=function(e){return useMemo((function(){return{current:e}}),[])};var s$1=1e3;var m=s$1*60;var h=m*60;var d=h*24;var w=d*7;var y=d*365.25;var ms=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0){return parse(e)}else if(n==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t){return}var n=parseFloat(t[1]);var r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*y;case"weeks":case"week":case"w":return n*w;case"days":case"day":case"d":return n*d;case"hours":case"hour":case"hrs":case"hr":case"h":return n*h;case"minutes":case"minute":case"mins":case"min":case"m":return n*m;case"seconds":case"second":case"secs":case"sec":case"s":return n*s$1;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return undefined}}function fmtShort(e){var t=Math.abs(e);if(t>=d){return Math.round(e/d)+"d"}if(t>=h){return Math.round(e/h)+"h"}if(t>=m){return Math.round(e/m)+"m"}if(t>=s$1){return Math.round(e/s$1)+"s"}return e+"ms"}function fmtLong(e){var t=Math.abs(e);if(t>=d){return plural(e,t,d,"day")}if(t>=h){return plural(e,t,h,"hour")}if(t>=m){return plural(e,t,m,"minute")}if(t>=s$1){return plural(e,t,s$1,"second")}return e+" ms"}function plural(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}function setup(e){n.debug=n;n.default=n;n.coerce=u;n.disable=s;n.enable=o;n.enabled=a;n.humanize=ms;n.destroy=c;Object.keys(e).forEach((function(t){n[t]=e[t]}));n.names=[];n.skips=[];n.formatters={};function t(e){var t=0;for(var r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r);t|=0}return n.colors[Math.abs(t)%n.colors.length]}n.selectColor=t;function n(e){var t;var o=null;var s;var a;function i(){var e=[];for(var r=0;r<arguments.length;r++){e[r]=arguments[r]}if(!i.enabled){return}var o=i;var s=Number(new Date);var a=s-(t||s);o.diff=a;o.prev=t;o.curr=s;t=s;e[0]=n.coerce(e[0]);if(typeof e[0]!=="string"){e.unshift("%O")}var u=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(function(t,r){if(t==="%%"){return"%"}u++;var s=n.formatters[r];if(typeof s==="function"){var a=e[u];t=s.call(o,a);e.splice(u,1);u--}return t}));n.formatArgs.call(o,e);var c=o.log||n.log;c.apply(o,e)}i.namespace=e;i.useColors=n.useColors();i.color=n.selectColor(e);i.extend=r;i.destroy=n.destroy;Object.defineProperty(i,"enabled",{enumerable:true,configurable:false,get:function(){if(o!==null){return o}if(s!==n.namespaces){s=n.namespaces;a=n.enabled(e)}return a},set:function(e){o=e}});if(typeof n.init==="function"){n.init(i)}return i}function r(e,t){var r=n(this.namespace+(typeof t==="undefined"?":":t)+e);r.log=this.log;return r}function o(e){n.save(e);n.namespaces=e;n.names=[];n.skips=[];var t;var r=(typeof e==="string"?e:"").split(/[\s,]+/);var o=r.length;for(t=0;t<o;t++){if(!r[t]){continue}e=r[t].replace(/\*/g,".*?");if(e[0]==="-"){n.skips.push(new RegExp("^"+e.slice(1)+"$"))}else{n.names.push(new RegExp("^"+e+"$"))}}}function s(){var e=__spreadArrays(n.names.map(i),n.skips.map(i).map((function(e){return"-"+e}))).join(",");n.enable("");return e}function a(e){if(e[e.length-1]==="*"){return true}var t;var r;for(t=0,r=n.skips.length;t<r;t++){if(n.skips[t].test(e)){return false}}for(t=0,r=n.names.length;t<r;t++){if(n.names[t].test(e)){return true}}return false}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}function u(e){if(e instanceof Error){return e.stack||e.message}return e}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}n.enable(n.load());return n}var common=setup;var browser=createCommonjsModule((function(e,t){t.formatArgs=r;t.save=o;t.load=s;t.useColors=n;t.storage=a();t.destroy=function(){var e=false;return function(){if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}}();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0;var o=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){if(e==="%%"){return}r++;if(e==="%c"){o=r}}));t.splice(o,0,n)}t.log=console.debug||console.log||function(){};function o(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function s(){var e;try{e=t.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function a(){try{return localStorage}catch(e){}}e.exports=common(t);var i=e.exports.formatters;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}));function s$2(){return getRenderingRef()}function l(){var e=s$2();return getElement(e)}function d$1(e,t){void 0===t&&(t={});var n=l();return h$2(n,e,t)}function m$1(e,t){var n=l();return y$1(n,e,t)}var p=browser("stencil-hook");function h$1(e){var t,n=getElement(e),r=(t=!1,new State((function(){p("Queue update on element",n),t||(t=!0,Promise.resolve().then((function(){p("Forced update on element",n),t=!1,forceUpdate(n)})))}),n)),o=e.disconnectedCallback;if(!o)throw new Error("Stencil hooks requires `disconnectedCallback` to be defined (even if it's empty). This is because of how the Stencil compiler works internally");e.disconnectedCallback=function(){r.teardown(),v(o)};var s=e.connectedCallback;e.connectedCallback=function(){r.update(),v(s)};var a=e.render.bind(e);e.render=function(){var e=r.run(a);return r.runEffects(),e}}function v(e){"function"==typeof e&&e()}function c$1(){return(c$1=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var u=1e3,C=60*u,l$1=60*C,d$2=24*l$1,f=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"weeks":case"week":case"w":return 6048e5*n;case"days":case"day":case"d":return n*d$2;case"hours":case"hour":case"hrs":case"hr":case"h":return n*l$1;case"minutes":case"minute":case"mins":case"min":case"m":return n*C;case"seconds":case"second":case"secs":case"sec":case"s":return n*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=d$2?g(e,t,d$2,"day"):t>=l$1?g(e,t,l$1,"hour"):t>=C?g(e,t,C,"minute"):t>=u?g(e,t,u,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=d$2?Math.round(e/d$2)+"d":t>=l$1?Math.round(e/l$1)+"h":t>=C?Math.round(e/C)+"m":t>=u?Math.round(e/u)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function g(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}var p$1,m$2=(function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=function(){var e=!1;return function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=function(e){function t(e){var r,o=null;function s(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}if(!s.enabled)return;var o=s,a=Number(new Date);o.diff=a-(r||a),o.prev=r,o.curr=a,r=a,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");var i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(function(n,r){if("%%"===n)return"%";i++;var s=t.formatters[r];return"function"==typeof s&&(n=s.call(o,e[i]),e.splice(i,1),i--),n})),t.formatArgs.call(o,e),(o.log||t.log).apply(o,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:function(){return null===o?t.enabled(e):o},set:function(e){o=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){var r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){var e=__spreadArrays(t.names.map(r),t.skips.map(r).map((function(e){return"-"+e}))).join(",");return t.enable(""),e},t.enable=function(e){var n;t.save(e),t.names=[],t.skips=[];var r=("string"==typeof e?e:"").split(/[\s,]+/),o=r.length;for(n=0;n<o;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=f,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((function(n){t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){var n=0;for(var r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}(t);var n=e.exports.formatters;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(p$1={exports:{}},p$1.exports),p$1.exports)("useDomContext");function h$2(e,t,n){void 0===n&&(n={});var r=useRef(void 0),o=useState(void 0),a=o[0],i=o[1],u=useMemo((function(){var o;try{(o=new s(c$1({contextName:t,element:e,onChange:function(e){r&&(r.current=e),i(e)}},n))).start()}catch(e){m$2("Listener failed to start",e)}return m$2("Listener initialized",o),{listener:o}}),[t,r]).listener;return useEffect((function(){return m$2("Listener starting (or restarting)",u),u.start(),function(){m$2("Listener stopping (or restopping)",u),u.stop()}}),[u,e.isConnected]),a||(null==r?void 0:r.current)}function y$1(e,t,n){var r=useMemo((function(){var r=new c({contextName:t,element:e,initialState:n});return r.start(),m$2("Provider initialized",r),r}),[t,e]);useEffect((function(){return m$2("Provider starting (or restarting)",r),r.start(),function(){m$2("Provider stopping (or re-stopping)",r),r.stop()}}),[r,e.isConnected]);var o=useReducer((function(e,t){var n;return m$2("New context value",t),n="function"==typeof t?t(r.context):t,r.context=n,r.context}),r.context);return[o[0],o[1],r]}export{commonjsGlobal as a,browser as b,createCommonjsModule as c,c as d,getDefaultExportFromCjs as e,useEffect as f,getAugmentedNamespace as g,h$2 as h,d$1 as i,useReducer as j,useState as k,l,useRef as m,h$1 as n,m$1 as o,s,useMemo as u,y$1 as y};