text: "use strict";function noop(){}function assign(t,e){for(const n in e)t[n]=e[n];return t}function run(t){return t()}function blank_object(){return Object.create(null)}function run_all(t){t.forEach(run)}function is_function(t){return"function"==typeof t}function safe_not_equal(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function create_slot(t,e,n){if(t){const r=get_slot_context(t,e,n);return t[0](r)}}function get_slot_context(t,e,n){return t[1]?assign({},assign(e.$$scope.ctx,t[1](n?n(e):{}))):e.$$scope.ctx}function get_slot_changes(t,e,n,r){return t[1]?assign({},assign(e.$$scope.changed||{},t[1](r?r(n):{}))):e.$$scope.changed||{}}function append(t,e){t.appendChild(e)}function insert(t,e,n){t.insertBefore(e,n||null)}function detach(t){t.parentNode.removeChild(t)}function element(t){return document.createElement(t)}function text(t){return document.createTextNode(t)}function space(){return text(" ")}function listen(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function prevent_default(t){return function(e){return e.preventDefault(),t.call(this,e)}}function children(t){return Array.from(t.childNodes)}let current_component;function set_current_component(t){current_component=t}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(t){get_current_component().$$.on_mount.push(t)}Object.defineProperty(exports,"__esModule",{value:!0});const dirty_components=[],resolved_promise=Promise.resolve();let update_scheduled=!1;const binding_callbacks=[],render_callbacks=[],flush_callbacks=[];function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function add_render_callback(t){render_callbacks.push(t)}function flush(){const t=new Set;do{for(;dirty_components.length;){const t=dirty_components.shift();set_current_component(t),update(t.$$)}for(;binding_callbacks.length;)binding_callbacks.shift()();for(;render_callbacks.length;){const e=render_callbacks.pop();t.has(e)||(e(),t.add(e))}}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1}function update(t){t.fragment&&(t.update(t.dirty),run_all(t.before_render),t.fragment.p(t.dirty,t.ctx),t.dirty=null,t.after_render.forEach(add_render_callback))}function mount_component(t,e,n){const{fragment:r,on_mount:o,on_destroy:a,after_render:i}=t.$$;r.m(e,n),add_render_callback(()=>{const e=o.map(run).filter(is_function);a?a.push(...e):run_all(e),t.$$.on_mount=[]}),i.forEach(add_render_callback)}function destroy(t,e){t.$$&&(run_all(t.$$.on_destroy),t.$$.fragment.d(e),t.$$.on_destroy=t.$$.fragment=null,t.$$.ctx={})}function make_dirty(t,e){t.$$.dirty||(dirty_components.push(t),schedule_update(),t.$$.dirty=blank_object()),t.$$.dirty[e]=!0}function init(t,e,n,r,o,a){const i=current_component;set_current_component(t);const s=e.props||{},c=t.$$={fragment:null,ctx:null,props:a,update:noop,not_equal:o,bound:blank_object(),on_mount:[],on_destroy:[],before_render:[],after_render:[],context:new Map(i?i.$$.context:[]),callbacks:blank_object(),dirty:null};let u=!1;c.ctx=n?n(t,s,(e,n)=>{c.ctx&&o(c.ctx[e],c.ctx[e]=n)&&(c.bound[e]&&c.bound[e](n),u&&make_dirty(t,e))}):s,c.update(),u=!0,run_all(c.before_render),c.fragment=r(c.ctx),e.target&&(e.hydrate?c.fragment.l(children(e.target)):c.fragment.c(),e.intro&&t.$$.fragment.i&&t.$$.fragment.i(),mount_component(t,e.target,e.anchor),flush()),set_current_component(i)}class SvelteComponent{$destroy(){destroy(this,!0),this.$destroy=noop}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(){}}function unwrapExports(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t,e){return t(e={exports:{}},e.exports),e.exports}var cjs=createCommonjsModule(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){return void 0===t&&(t={}),{arrayFormat:t.arrayFormat||"none",booleanFormat:t.booleanFormat||"none",nullFormat:t.nullFormat||"default"}},r=function(t){return encodeURIComponent(t)},o=function(t){return decodeURIComponent(t)},a=function(t,e,n){return null===e?function(t,e){return"hidden"===e.nullFormat?"":"string"===e.nullFormat?t+"=null":t}(t,n):"boolean"==typeof e?function(t,e,n){return"empty-true"===n.booleanFormat&&e?t:t+"="+("unicode"===n.booleanFormat?e?"✓":"✗":e.toString())}(t,e,n):Array.isArray(e)?function(t,e,n){var o=function(t){return"index"===t.arrayFormat?function(t,e){return t+"["+e+"]"}:"brackets"===t.arrayFormat?function(t){return t+"[]"}:function(t){return t}}(n);return e.map(function(e,n){return o(t,n)+"="+r(e)}).join("&")}(t,e,n):t+"="+r(e)},i=function(t){var e=t.indexOf("?");return-1===e?t:t.slice(e+1)},s=function(t){var e=t.indexOf("["),n=-1!==e;return{hasBrackets:n,name:n?t.slice(0,e):t}},c=function(t,e){var r=n(e);return i(t).split("&").reduce(function(t,e){var n=e.split("="),a=n[0],i=n[1],c=s(a),u=c.hasBrackets,l=c.name,p=t[l],d=function(t,e){if(void 0===t)return"empty-true"===e.booleanFormat||null;if("string"===e.booleanFormat){if("true"===t)return!0;if("false"===t)return!1}else if("unicode"===e.booleanFormat){if("✓"===o(t))return!0;if("✗"===o(t))return!1}else if("string"===e.nullFormat&&"null"===t)return null;return o(t)}(i,r);return t[l]=void 0===p?u?[d]:d:[].concat(p,d),t},{})};e.parse=c,e.build=function(t,e){var r=n(e);return Object.keys(t).filter(function(e){return void 0!==t[e]}).map(function(e){return a(e,t[e],r)}).filter(Boolean).join("&")},e.omit=function(t,e,r){var o=n(r);if(""===i(t))return{querystring:"",removedParams:{}};var a=t.split("&").reduce(function(t,n){var r=t[0],o=t[1],a=n.split("=")[0],i=s(a).name;return-1===e.indexOf(i)?[r.concat(n),o]:[r,o.concat(n)]},[[],[]]),u=a[0],l=a[1];return{querystring:u.join("&"),removedParams:c(l.join("&"),o)}},e.keep=function(t,e,r){var o=n(r);if(""===i(t))return{keptParams:{},querystring:""};var a=t.split("&").reduce(function(t,n){var r=t[0],o=t[1],a=n.split("=")[0],i=s(a).name;return e.indexOf(i)>=0?[r.concat(n),o]:[r,o.concat(n)]},[[],[]]),u=a[0];a[1];return{keptParams:c(u.join("&"),o),querystring:u.join("&")}}});unwrapExports(cjs);var cjs_1=cjs.parse,cjs_2=cjs.build,cjs_3=cjs.omit,cjs_4=cjs.keep,__assign=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},defaultOrConstrained=function(t){return"("+(t?t.replace(/(^<|>$)/g,""):"[a-zA-Z0-9-_.~%':|=+\\*@]+")+")"},rules=[{name:"url-parameter",pattern:/^:([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(t){return new RegExp(defaultOrConstrained(t[2]))}},{name:"url-parameter-splat",pattern:/^\*([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/,regex:/([^?]*)/},{name:"url-parameter-matrix",pattern:/^;([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})(<(.+?)>)?/,regex:function(t){return new RegExp(";"+t[1]+"="+defaultOrConstrained(t[2]))}},{name:"query-parameter",pattern:/^(?:\?|&)(?::)?([a-zA-Z0-9-_]*[a-zA-Z0-9]{1})/},{name:"delimiter",pattern:/^(\/|\?)/,regex:function(t){return new RegExp("\\"+t[0])}},{name:"sub-delimiter",pattern:/^(!|&|-|_|\.|;)/,regex:function(t){return new RegExp(t[0])}},{name:"fragment",pattern:/^([0-9a-zA-Z]+)/,regex:function(t){return new RegExp(t[0])}}],tokenise=function(t,e){if(void 0===e&&(e=[]),!rules.some(function(n){var r=t.match(n.pattern);return!!r&&(e.push({type:n.name,match:r[0],val:r.slice(1,2),otherVal:r.slice(2),regex:n.regex instanceof Function?n.regex(r):n.regex}),r[0].length<t.length&&(e=tokenise(t.substr(r[0].length),e)),!0)}))throw new Error("Could not parse path '"+t+"'");return e},identity$1=function(t){return t},exists=function(t){return null!=t},optTrailingSlash=function(t,e){return e?t:"\\/"===t?t:t.replace(/\\\/$/,"")+"(?:\\/)?"},upToDelimiter=function(t,e){return e?/(\/)$/.test(t)?t:t+"(\\/|\\?|\\.|;|$)":t},appendQueryParam=function(t,e,n){void 0===n&&(n="");var r=t[e];return t[e]=void 0===r?n:Array.isArray(r)?r.concat(n):[r,n],t},Path=function(){function t(t){if(!t)throw new Error("Missing path in Path constructor");this.path=t,this.tokens=tokenise(t),this.hasUrlParams=this.tokens.filter(function(t){return/^url-parameter/.test(t.type)}).length>0,this.hasSpatParam=this.tokens.filter(function(t){return/splat$/.test(t.type)}).length>0,this.hasMatrixParams=this.tokens.filter(function(t){return/matrix$/.test(t.type)}).length>0,this.hasQueryParams=this.tokens.filter(function(t){return/^query-parameter/.test(t.type)}).length>0,this.spatParams=this.getParams("url-parameter-splat"),this.urlParams=this.getParams(/^url-parameter/),this.queryParams=this.getParams("query-parameter"),this.params=this.urlParams.concat(this.queryParams),this.source=this.tokens.filter(function(t){return void 0!==t.regex}).map(function(t){return t.regex.source}).join("")}return t.createPath=function(e){return new t(e)},t.prototype.isQueryParam=function(t){return-1!==this.queryParams.indexOf(t)},t.prototype.test=function(t,e){var n=this,r=__assign({strictTrailingSlash:!1,queryParams:{}},e),o=optTrailingSlash(this.source,r.strictTrailingSlash),a=this.urlTest(t,o+(this.hasQueryParams?"(\\?.*$|$)":"$"),e);if(!a||!this.hasQueryParams)return a;var i=cjs_1(t,r.queryParams);return 0===Object.keys(i).filter(function(t){return!n.isQueryParam(t)}).length?(Object.keys(i).forEach(function(t){return a[t]=i[t]}),a):null},t.prototype.partialTest=function(t,e){var n=this,r=__assign({delimited:!0,queryParams:{}},e),o=upToDelimiter(this.source,r.delimited),a=this.urlTest(t,o,r);if(!a)return a;if(!this.hasQueryParams)return a;var i=cjs_1(t,r.queryParams);return Object.keys(i).filter(function(t){return n.isQueryParam(t)}).forEach(function(t){return appendQueryParam(a,t,i[t])}),a},t.prototype.build=function(t,e){var n=this;void 0===t&&(t={});var r=__assign({ignoreConstraints:!1,ignoreSearch:!1,queryParams:{}},e),o=Object.keys(t).filter(function(t){return!n.isQueryParam(t)}).reduce(function(e,r){if(!exists(t[r]))return e;var o=t[r],a=n.isQueryParam(r)?identity$1:encodeURI;return"boolean"==typeof o?e[r]=o:Array.isArray(o)?e[r]=o.map(a):e[r]=a(o),e},{});if(this.urlParams.some(function(e){return!exists(t[e])})){var a=this.urlParams.filter(function(e){return!exists(t[e])});throw new Error("Cannot build path: '"+this.path+"' requires missing parameters { "+a.join(", ")+" }")}if(!r.ignoreConstraints&&!this.tokens.filter(function(t){return/^url-parameter/.test(t.type)&&!/-splat$/.test(t.type)}).every(function(t){return new RegExp("^"+defaultOrConstrained(t.otherVal[0])+"$").test(o[t.val])}))throw new Error("Some parameters of '"+this.path+"' are of invalid format");var i=this.tokens.filter(function(t){return!1===/^query-parameter/.test(t.type)}).map(function(t){return"url-parameter-matrix"===t.type?";"+t.val+"="+o[t.val[0]]:/^url-parameter/.test(t.type)?o[t.val[0]]:t.match}).join("");if(r.ignoreSearch)return i;var s=this.queryParams.filter(function(e){return-1!==Object.keys(t).indexOf(e)}).reduce(function(e,n){return e[n]=t[n],e},{}),c=cjs_2(s,r.queryParams);return c?i+"?"+c:i},t.prototype.getParams=function(t){var e=t instanceof RegExp?function(e){return t.test(e.type)}:function(e){return e.type===t};return this.tokens.filter(e).map(function(t){return t.val[0]})},t.prototype.urlTest=function(t,e,n){var r=this,o=(void 0===n?{}:n).caseSensitive,a=new RegExp("^"+e,void 0!==o&&o?"":"i"),i=t.match(a);return i?this.urlParams.length?i.slice(1,this.urlParams.length+1).reduce(function(t,e,n){return t[r.urlParams[n]]=decodeURIComponent(e),t},{}):{}:null},t}();function add_css(){var t=element("style");t.id="svelte-h7mijx-style",t.textContent=".ctx.svelte-h7mijx{display:none}",append(document.head,t)}function create_if_block(t){var e;return{c(){(e=element("div")).className="ctx svelte-h7mijx",e.dataset.svero="ctx"},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_fragment(t){var e,n,r,o=!t.ctxLoaded&&create_if_block(t);const a=t.$$slots.default,i=create_slot(a,t,null);return{c(){o&&o.c(),e=space(),i&&i.c(),r=listen(window,"popstate",t.handlePopState)},l(t){i&&i.l(t)},m(t,r){o&&o.m(t,r),insert(t,e,r),i&&i.m(t,r),n=!0},p(t,n){n.ctxLoaded?o&&(o.d(1),o=null):o||((o=create_if_block(n)).c(),o.m(e.parentNode,e)),i&&i.p&&t.$$scope&&i.p(get_slot_changes(a,n,t,null),get_slot_context(a,n,null))},i(t){n||(i&&i.i&&i.i(t),n=!0)},o(t){i&&i.o&&i.o(t),n=!1},d(t){o&&o.d(t),t&&detach(e),i&&i.d(t),r()}}}function gotoRoute(t){history.pushState({},"",t);const e=new Event("popstate");window.dispatchEvent(e)}function instance(t,e,n){let r,o=!1;function a(t,e={}){const n=window.__svero__;n.currentComponent&&n.currentComponent.$destroy&&n.currentComponent.$destroy(),n.currentComponent=new t.component({target:r,props:{router:{route:t,params:e}}})}function i(t){const e=window.__svero__;if(+t!==t&&(t=0),t>10)throw Error("svero expects <Route> components. None given or <Route> components with error detected.");e?e.paths.some(t=>{const n=window.location.pathname;if(t.path===n){if(!t.condition&&!t.component&&t.redirect){if(!e.paths.find(e=>e.path===t.redirect))throw Error(`svero expects <Route redirect="${t.redirect}"> to send to an existing route. ${t.redirect} does not exist.`);return gotoRoute(t.redirect),!0}return void 0===t.condition||"boolean"!=typeof t.condition&&"function"!=typeof t.condition?(a(t),!0):"boolean"==typeof t.condition&&t.condition?(a(t),!0):"function"==typeof t.condition&&t.condition()?(a(t),!0):(gotoRoute(t.redirect),!0)}if(t.path.includes(":")){const r=new Path(t.path).test(n);if(r)return!t.condition&&t.redirect&&e.paths.filter(e=>e.path===t.redirect).length>0?(gotoRoute(t.redirect),!0):!t.condition||"boolean"!=typeof t.condition&&"function"!=typeof t.condition?(a(t,r),!0):"boolean"==typeof t.condition&&t.condition?(a(t,r),!0):"function"==typeof t.condition&&t.condition()?(a(t,r),!0):(gotoRoute(t.redirect),!0)}if("*"===t.path)return!t.condition&&t.redirect&&e.paths.filter(e=>e.path===t.redirect).length>0?(gotoRoute(t.redirect),!0):!t.condition||"boolean"!=typeof t.condition&&"function"!=typeof t.condition?(a(t),!0):"boolean"==typeof t.condition&&t.condition?(a(t),!0):"function"==typeof t.condition&&t.condition()?(a(t),!0):(gotoRoute(t.redirect),!0)}):setTimeout(()=>{i(t+1)},17)}onMount(()=>{n("ctx",r=document.querySelector('[data-svero="ctx"]').parentElement),n("ctxLoaded",o=!0),i(0)});let{$$slots:s={},$$scope:c}=e;return t.$set=(t=>{"$$scope"in t&&n("$$scope",c=t.$$scope)}),{ctxLoaded:o,handlePopState:i,$$slots:s,$$scope:c}}class Router extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-h7mijx-style")||add_css(),init(this,t,instance,create_fragment,safe_not_equal,[])}}function create_fragment$1(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function instance$1(t,e,n){let{path:r="/",component:o,condition:a,redirect:i}=e;return onMount(()=>{!function(){window.__svero__||(window.__svero__={});window.__svero__.paths||(window.__svero__.paths=[]);window.__svero__.paths.push({path:r,component:o,condition:a,redirect:i})}()}),t.$set=(t=>{"path"in t&&n("path",r=t.path),"component"in t&&n("component",o=t.component),"condition"in t&&n("condition",a=t.condition),"redirect"in t&&n("redirect",i=t.redirect)}),{path:r,component:o,condition:a,redirect:i}}class Route extends SvelteComponent{constructor(t){super(),init(this,t,instance$1,create_fragment$1,safe_not_equal,["path","component","condition","redirect"])}}function navigateTo(t){if(!t||"string"!=typeof t)throw Error(`svero expects navigateTo() to have a string parameter. The parameter provided was: ${t} of type ${typeof t} instead.`);if("/"!==t[0])throw Error(`svero expects navigateTo() param to start with slash, e.g. "/${t}" instead of "${t}".`);history.pushState&&window.dispatchEvent?(history.pushState({},"",t),window.dispatchEvent(new Event("popstate"))):window.location.href=t}function create_fragment$2(t){var e,n,r;const o=t.$$slots.default,a=create_slot(o,t,null);return{c(){e=element("a"),a&&a.c(),e.href=t.href,e.className=t.className,r=listen(e,"click",prevent_default(t.click_handler))},l(t){a&&a.l(a_nodes)},m(t,r){insert(t,e,r),a&&a.m(e,null),n=!0},p(t,r){a&&a.p&&t.$$scope&&a.p(get_slot_changes(o,r,t,null),get_slot_context(o,r,null)),n&&!t.href||(e.href=r.href),n&&!t.className||(e.className=r.className)},i(t){n||(a&&a.i&&a.i(t),n=!0)},o(t){a&&a.o&&a.o(t),n=!1},d(t){t&&detach(e),a&&a.d(t),r()}}}function instance$2(t,e,n){let{class:r="",href:o="/",className:a=""}=e;onMount(()=>{n("className",a=a||r)});let{$$slots:i={},$$scope:s}=e;return t.$set=(t=>{"class"in t&&n("cssClass",r=t.class),"href"in t&&n("href",o=t.href),"className"in t&&n("className",a=t.className),"$$scope"in t&&n("$$scope",s=t.$$scope)}),{cssClass:r,href:o,className:a,click_handler:function(){return navigateTo(o)},$$slots:i,$$scope:s}}class Link extends SvelteComponent{constructor(t){super(),init(this,t,instance$2,create_fragment$2,safe_not_equal,["class","href","className"])}}exports.Router=Router,exports.Route=Route,exports.Link=Link,exports.navigateTo=navigateTo;
  