UNPKG

@budibase/server

Version:
4 lines • 8.68 MB
var l$=Object.defineProperty;var u$=(to,ue,eo)=>ue in to?l$(to,ue,{enumerable:!0,configurable:!0,writable:!0,value:eo}):to[ue]=eo;var c$=(to,ue)=>()=>(ue||to((ue={exports:{}}).exports,ue),ue.exports);var Al=(to,ue,eo)=>(u$(to,typeof ue!="symbol"?ue+"":ue,eo),eo),W2=(to,ue,eo)=>{if(!ue.has(to))throw TypeError("Cannot "+eo)};var _l=(to,ue,eo)=>(W2(to,ue,"read from private field"),eo?eo.call(to):ue.get(to)),cf=(to,ue,eo)=>{if(ue.has(to))throw TypeError("Cannot add the same private member more than once");ue instanceof WeakSet?ue.add(to):ue.set(to,eo)},Yf=(to,ue,eo,no)=>(W2(to,ue,"write to private field"),no?no.call(to,eo):ue.set(to,eo),eo);var H_=(to,ue,eo)=>(W2(to,ue,"access private method"),eo);var f$=c$((exports,module)=>{(function(){const ue=document.createElement("link").relList;if(ue&&ue.supports&&ue.supports("modulepreload"))return;for(const ro of document.querySelectorAll('link[rel="modulepreload"]'))no(ro);new MutationObserver(ro=>{for(const oo of ro)if(oo.type==="childList")for(const io of oo.addedNodes)io.tagName==="LINK"&&io.rel==="modulepreload"&&no(io)}).observe(document,{childList:!0,subtree:!0});function eo(ro){const oo={};return ro.integrity&&(oo.integrity=ro.integrity),ro.referrerPolicy&&(oo.referrerPolicy=ro.referrerPolicy),ro.crossOrigin==="use-credentials"?oo.credentials="include":ro.crossOrigin==="anonymous"?oo.credentials="omit":oo.credentials="same-origin",oo}function no(ro){if(ro.ep)return;ro.ep=!0;const oo=eo(ro);fetch(ro.href,oo)}})();const remixicon="",spectrumGlobal="",spectrumMedium="",spectrumDarkest="",spectrumDark="",spectrumLight="",spectrumLightest="",nord="",midnight="",indexVars$E="",global$2="",suppressWarnings=to=>{if(!(to!=null&&to.length))return;const ue=new RegExp(to.map(no=>`(${no})`).join("|"),"gi"),eo=console.warn;console.warn=(...no)=>{const ro=no[0];ro&&typeof ro=="string"&&ro.match(ue)||eo(...no)}};function noop$5(){}const identity$6=to=>to;function assign$1(to,ue){for(const eo in ue)to[eo]=ue[eo];return to}function is_promise(to){return!!to&&(typeof to=="object"||typeof to=="function")&&typeof to.then=="function"}function run$3(to){return to()}function blank_object(){return Object.create(null)}function run_all(to){to.forEach(run$3)}function is_function(to){return typeof to=="function"}function safe_not_equal(to,ue){return to!=to?ue==ue:to!==ue||to&&typeof to=="object"||typeof to=="function"}let src_url_equal_anchor;function src_url_equal(to,ue){return to===ue?!0:(src_url_equal_anchor||(src_url_equal_anchor=document.createElement("a")),src_url_equal_anchor.href=ue,to===src_url_equal_anchor.href)}function not_equal(to,ue){return to!=to?ue==ue:to!==ue}function is_empty(to){return Object.keys(to).length===0}function subscribe(to,...ue){if(to==null){for(const no of ue)no(void 0);return noop$5}const eo=to.subscribe(...ue);return eo.unsubscribe?()=>eo.unsubscribe():eo}function get_store_value(to){let ue;return subscribe(to,eo=>ue=eo)(),ue}function component_subscribe(to,ue,eo){to.$$.on_destroy.push(subscribe(ue,eo))}function create_slot(to,ue,eo,no){if(to){const ro=get_slot_context(to,ue,eo,no);return to[0](ro)}}function get_slot_context(to,ue,eo,no){return to[1]&&no?assign$1(eo.ctx.slice(),to[1](no(ue))):eo.ctx}function get_slot_changes(to,ue,eo,no){if(to[2]&&no){const ro=to[2](no(eo));if(ue.dirty===void 0)return ro;if(typeof ro=="object"){const oo=[],io=Math.max(ue.dirty.length,ro.length);for(let so=0;so<io;so+=1)oo[so]=ue.dirty[so]|ro[so];return oo}return ue.dirty|ro}return ue.dirty}function update_slot_base(to,ue,eo,no,ro,oo){if(ro){const io=get_slot_context(ue,eo,no,oo);to.p(io,ro)}}function get_all_dirty_from_scope(to){if(to.ctx.length>32){const ue=[],eo=to.ctx.length/32;for(let no=0;no<eo;no++)ue[no]=-1;return ue}return-1}function exclude_internal_props(to){const ue={};for(const eo in to)eo[0]!=="$"&&(ue[eo]=to[eo]);return ue}function compute_rest_props(to,ue){const eo={};ue=new Set(ue);for(const no in to)!ue.has(no)&&no[0]!=="$"&&(eo[no]=to[no]);return eo}function compute_slots(to){const ue={};for(const eo in to)ue[eo]=!0;return ue}function null_to_empty(to){return to??""}function set_store_value(to,ue,eo){return to.set(eo),ue}function action_destroyer(to){return to&&is_function(to.destroy)?to.destroy:noop$5}function split_css_unit(to){const ue=typeof to=="string"&&to.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return ue?[parseFloat(ue[1]),ue[2]||"px"]:[to,"px"]}const is_client=typeof window<"u";let now$2=is_client?()=>window.performance.now():()=>Date.now(),raf=is_client?to=>requestAnimationFrame(to):noop$5;const tasks=new Set;function run_tasks(to){tasks.forEach(ue=>{ue.c(to)||(tasks.delete(ue),ue.f())}),tasks.size!==0&&raf(run_tasks)}function loop$1(to){let ue;return tasks.size===0&&raf(run_tasks),{promise:new Promise(eo=>{tasks.add(ue={c:to,f:eo})}),abort(){tasks.delete(ue)}}}const globals$1=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function append$2(to,ue){to.appendChild(ue)}function get_root_for_style(to){if(!to)return document;const ue=to.getRootNode?to.getRootNode():to.ownerDocument;return ue&&ue.host?ue:to.ownerDocument}function append_empty_stylesheet(to){const ue=element("style");return ue.textContent="/* empty */",append_stylesheet(get_root_for_style(to),ue),ue.sheet}function append_stylesheet(to,ue){return append$2(to.head||to,ue),ue.sheet}function insert$1(to,ue,eo){to.insertBefore(ue,eo||null)}function detach(to){to.parentNode&&to.parentNode.removeChild(to)}function destroy_each(to,ue){for(let eo=0;eo<to.length;eo+=1)to[eo]&&to[eo].d(ue)}function element(to){return document.createElement(to)}function svg_element(to){return document.createElementNS("http://www.w3.org/2000/svg",to)}function text(to){return document.createTextNode(to)}function space$1(){return text(" ")}function empty$4(){return text("")}function listen(to,ue,eo,no){return to.addEventListener(ue,eo,no),()=>to.removeEventListener(ue,eo,no)}function prevent_default(to){return function(ue){return ue.preventDefault(),to.call(this,ue)}}function stop_propagation(to){return function(ue){return ue.stopPropagation(),to.call(this,ue)}}function self$1(to){return function(ue){ue.target===this&&to.call(this,ue)}}function attr(to,ue,eo){eo==null?to.removeAttribute(ue):to.getAttribute(ue)!==eo&&to.setAttribute(ue,eo)}const always_set_through_set_attribute=["width","height"];function set_attributes(to,ue){const eo=Object.getOwnPropertyDescriptors(to.__proto__);for(const no in ue)ue[no]==null?to.removeAttribute(no):no==="style"?to.style.cssText=ue[no]:no==="__value"?to.value=to[no]=ue[no]:eo[no]&&eo[no].set&&always_set_through_set_attribute.indexOf(no)===-1?to[no]=ue[no]:attr(to,no,ue[no])}function xlink_attr(to,ue,eo){to.setAttributeNS("http://www.w3.org/1999/xlink",ue,eo)}function init_binding_group(to){let ue;return{p(...eo){ue=eo,ue.forEach(no=>to.push(no))},r(){ue.forEach(eo=>to.splice(to.indexOf(eo),1))}}}function to_number(to){return to===""?null:+to}function children$1(to){return Array.from(to.childNodes)}function set_data(to,ue){ue=""+ue,to.data!==ue&&(to.data=ue)}function set_input_value(to,ue){to.value=ue??""}function set_style(to,ue,eo,no){eo==null?to.style.removeProperty(ue):to.style.setProperty(ue,eo,no?"important":"")}let crossorigin;function is_crossorigin(){if(crossorigin===void 0){crossorigin=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{crossorigin=!0}}return crossorigin}function add_iframe_resize_listener(to,ue){getComputedStyle(to).position==="static"&&(to.style.position="relative");const no=element("iframe");no.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),no.setAttribute("aria-hidden","true"),no.tabIndex=-1;const ro=is_crossorigin();let oo;return ro?(no.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",oo=listen(window,"message",io=>{io.source===no.contentWindow&&ue()})):(no.src="about:blank",no.onload=()=>{oo=listen(no.contentWindow,"resize",ue),ue()}),append$2(to,no),()=>{(ro||oo&&no.contentWindow)&&oo(),detach(no)}}function toggle_class(to,ue,eo){to.classList.toggle(ue,!!eo)}function custom_event(to,ue,{bubbles:eo=!1,cancelable:no=!1}={}){return new CustomEvent(to,{detail:ue,bubbles:eo,cancelable:no})}class HtmlTag{constructor(ue=!1){Al(this,"is_svg",!1);Al(this,"e");Al(this,"n");Al(this,"t");Al(this,"a");this.is_svg=ue,this.e=this.n=null}c(ue){this.h(ue)}m(ue,eo,no=null){this.e||(this.is_svg?this.e=svg_element(eo.nodeName):this.e=element(eo.nodeType===11?"TEMPLATE":eo.nodeName),this.t=eo.tagName!=="TEMPLATE"?eo:eo.content,this.c(ue)),this.i(no)}h(ue){this.e.innerHTML=ue,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(ue){for(let eo=0;eo<this.n.length;eo+=1)insert$1(this.t,this.n[eo],ue)}p(ue){this.d(),this.h(ue),this.i(this.a)}d(){this.n.forEach(detach)}}function construct_svelte_component(to,ue){return new to(ue)}const managed_styles=new Map;let active=0;function hash(to){let ue=5381,eo=to.length;for(;eo--;)ue=(ue<<5)-ue^to.charCodeAt(eo);return ue>>>0}function create_style_information(to,ue){const eo={stylesheet:append_empty_stylesheet(ue),rules:{}};return managed_styles.set(to,eo),eo}function create_rule(to,ue,eo,no,ro,oo,io,so=0){const ao=16.666/no;let lo=`{ `;for(let ho=0;ho<=1;ho+=ao){const go=ue+(eo-ue)*oo(ho);lo+=ho*100+`%{${io(go,1-go)}} `}const uo=lo+`100% {${io(eo,1-eo)}} }`,co=`__svelte_${hash(uo)}_${so}`,fo=get_root_for_style(to),{stylesheet:po,rules:mo}=managed_styles.get(fo)||create_style_information(fo,to);mo[co]||(mo[co]=!0,po.insertRule(`@keyframes ${co} ${uo}`,po.cssRules.length));const _o=to.style.animation||"";return to.style.animation=`${_o?`${_o}, `:""}${co} ${no}ms linear ${ro}ms 1 both`,active+=1,co}function delete_rule(to,ue){const eo=(to.style.animation||"").split(", "),no=eo.filter(ue?oo=>oo.indexOf(ue)<0:oo=>oo.indexOf("__svelte")===-1),ro=eo.length-no.length;ro&&(to.style.animation=no.join(", "),active-=ro,active||clear_rules())}function clear_rules(){raf(()=>{active||(managed_styles.forEach(to=>{const{ownerNode:ue}=to.stylesheet;ue&&detach(ue)}),managed_styles.clear())})}function create_animation(to,ue,eo,no){if(!ue)return noop$5;const ro=to.getBoundingClientRect();if(ue.left===ro.left&&ue.right===ro.right&&ue.top===ro.top&&ue.bottom===ro.bottom)return noop$5;const{delay:oo=0,duration:io=300,easing:so=identity$6,start:ao=now$2()+oo,end:lo=ao+io,tick:uo=noop$5,css:co}=eo(to,{from:ue,to:ro},no);let fo=!0,po=!1,mo;function _o(){co&&(mo=create_rule(to,0,1,io,oo,so,co)),oo||(po=!0)}function ho(){co&&delete_rule(to,mo),fo=!1}return loop$1(go=>{if(!po&&go>=ao&&(po=!0),po&&go>=lo&&(uo(1,0),ho()),!fo)return!1;if(po){const bo=go-ao,vo=0+1*so(bo/io);uo(vo,1-vo)}return!0}),_o(),uo(0,1),ho}function fix_position(to){const ue=getComputedStyle(to);if(ue.position!=="absolute"&&ue.position!=="fixed"){const{width:eo,height:no}=ue,ro=to.getBoundingClientRect();to.style.position="absolute",to.style.width=eo,to.style.height=no,add_transform(to,ro)}}function add_transform(to,ue){const eo=to.getBoundingClientRect();if(ue.left!==eo.left||ue.top!==eo.top){const no=getComputedStyle(to),ro=no.transform==="none"?"":no.transform;to.style.transform=`${ro} translate(${ue.left-eo.left}px, ${ue.top-eo.top}px)`}}let current_component;function set_current_component(to){current_component=to}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(to){get_current_component().$$.on_mount.push(to)}function onDestroy(to){get_current_component().$$.on_destroy.push(to)}function createEventDispatcher(){const to=get_current_component();return(ue,eo,{cancelable:no=!1}={})=>{const ro=to.$$.callbacks[ue];if(ro){const oo=custom_event(ue,eo,{cancelable:no});return ro.slice().forEach(io=>{io.call(to,oo)}),!oo.defaultPrevented}return!0}}function setContext(to,ue){return get_current_component().$$.context.set(to,ue),ue}function getContext$1(to){return get_current_component().$$.context.get(to)}function hasContext(to){return get_current_component().$$.context.has(to)}function bubble(to,ue){const eo=to.$$.callbacks[ue.type];eo&&eo.slice().forEach(no=>no.call(this,ue))}const dirty_components=[],binding_callbacks=[];let render_callbacks=[];const flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function tick(){return schedule_update(),resolved_promise}function add_render_callback(to){render_callbacks.push(to)}function add_flush_callback(to){flush_callbacks.push(to)}const seen_callbacks=new Set;let flushidx=0;function flush(){if(flushidx!==0)return;const to=current_component;do{try{for(;flushidx<dirty_components.length;){const ue=dirty_components[flushidx];flushidx++,set_current_component(ue),update(ue.$$)}}catch(ue){throw dirty_components.length=0,flushidx=0,ue}for(set_current_component(null),dirty_components.length=0,flushidx=0;binding_callbacks.length;)binding_callbacks.pop()();for(let ue=0;ue<render_callbacks.length;ue+=1){const eo=render_callbacks[ue];seen_callbacks.has(eo)||(seen_callbacks.add(eo),eo())}render_callbacks.length=0}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1,seen_callbacks.clear(),set_current_component(to)}function update(to){if(to.fragment!==null){to.update(),run_all(to.before_update);const ue=to.dirty;to.dirty=[-1],to.fragment&&to.fragment.p(to.ctx,ue),to.after_update.forEach(add_render_callback)}}function flush_render_callbacks(to){const ue=[],eo=[];render_callbacks.forEach(no=>to.indexOf(no)===-1?ue.push(no):eo.push(no)),eo.forEach(no=>no()),render_callbacks=ue}let promise;function wait(){return promise||(promise=Promise.resolve(),promise.then(()=>{promise=null})),promise}function dispatch$1(to,ue,eo){to.dispatchEvent(custom_event(`${ue?"intro":"outro"}${eo}`))}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(to,ue){to&&to.i&&(outroing.delete(to),to.i(ue))}function transition_out(to,ue,eo,no){if(to&&to.o){if(outroing.has(to))return;outroing.add(to),outros.c.push(()=>{outroing.delete(to),no&&(eo&&to.d(1),no())}),to.o(ue)}else no&&no()}const null_transition={duration:0};function create_in_transition(to,ue,eo){const no={direction:"in"};let ro=ue(to,eo,no),oo=!1,io,so,ao=0;function lo(){io&&delete_rule(to,io)}function uo(){const{delay:fo=0,duration:po=300,easing:mo=identity$6,tick:_o=noop$5,css:ho}=ro||null_transition;ho&&(io=create_rule(to,0,1,po,fo,mo,ho,ao++)),_o(0,1);const go=now$2()+fo,bo=go+po;so&&so.abort(),oo=!0,add_render_callback(()=>dispatch$1(to,!0,"start")),so=loop$1(vo=>{if(oo){if(vo>=bo)return _o(1,0),dispatch$1(to,!0,"end"),lo(),oo=!1;if(vo>=go){const $o=mo((vo-go)/po);_o($o,1-$o)}}return oo})}let co=!1;return{start(){co||(co=!0,delete_rule(to),is_function(ro)?(ro=ro(no),wait().then(uo)):uo())},invalidate(){co=!1},end(){oo&&(lo(),oo=!1)}}}function create_out_transition(to,ue,eo){const no={direction:"out"};let ro=ue(to,eo,no),oo=!0,io;const so=outros;so.r+=1;let ao;function lo(){const{delay:uo=0,duration:co=300,easing:fo=identity$6,tick:po=noop$5,css:mo}=ro||null_transition;mo&&(io=create_rule(to,1,0,co,uo,fo,mo));const _o=now$2()+uo,ho=_o+co;add_render_callback(()=>dispatch$1(to,!1,"start")),"inert"in to&&(ao=to.inert,to.inert=!0),loop$1(go=>{if(oo){if(go>=ho)return po(0,1),dispatch$1(to,!1,"end"),--so.r||run_all(so.c),!1;if(go>=_o){const bo=fo((go-_o)/co);po(1-bo,bo)}}return oo})}return is_function(ro)?wait().then(()=>{ro=ro(no),lo()}):lo(),{end(uo){uo&&"inert"in to&&(to.inert=ao),uo&&ro.tick&&ro.tick(1,0),oo&&(io&&delete_rule(to,io),oo=!1)}}}function create_bidirectional_transition(to,ue,eo,no){let oo=ue(to,eo,{direction:"both"}),io=no?0:1,so=null,ao=null,lo=null,uo;function co(){lo&&delete_rule(to,lo)}function fo(mo,_o){const ho=mo.b-io;return _o*=Math.abs(ho),{a:io,b:mo.b,d:ho,duration:_o,start:mo.start,end:mo.start+_o,group:mo.group}}function po(mo){const{delay:_o=0,duration:ho=300,easing:go=identity$6,tick:bo=noop$5,css:vo}=oo||null_transition,$o={start:now$2()+_o,b:mo};mo||($o.group=outros,outros.r+=1),"inert"in to&&(mo?uo!==void 0&&(to.inert=uo):(uo=to.inert,to.inert=!0)),so||ao?ao=$o:(vo&&(co(),lo=create_rule(to,io,mo,ho,_o,go,vo)),mo&&bo(0,1),so=fo($o,ho),add_render_callback(()=>dispatch$1(to,mo,"start")),loop$1(wo=>{if(ao&&wo>ao.start&&(so=fo(ao,ho),ao=null,dispatch$1(to,so.b,"start"),vo&&(co(),lo=create_rule(to,io,so.b,so.duration,0,go,oo.css))),so){if(wo>=so.end)bo(io=so.b,1-io),dispatch$1(to,so.b,"end"),ao||(so.b?co():--so.group.r||run_all(so.group.c)),so=null;else if(wo>=so.start){const ko=wo-so.start;io=so.a+so.d*go(ko/so.duration),bo(io,1-io)}}return!!(so||ao)}))}return{run(mo){is_function(oo)?wait().then(()=>{oo=oo({direction:mo?"in":"out"}),po(mo)}):po(mo)},end(){co(),so=ao=null}}}function handle_promise(to,ue){const eo=ue.token={};function no(ro,oo,io,so){if(ue.token!==eo)return;ue.resolved=so;let ao=ue.ctx;io!==void 0&&(ao=ao.slice(),ao[io]=so);const lo=ro&&(ue.current=ro)(ao);let uo=!1;ue.block&&(ue.blocks?ue.blocks.forEach((co,fo)=>{fo!==oo&&co&&(group_outros(),transition_out(co,1,1,()=>{ue.blocks[fo]===co&&(ue.blocks[fo]=null)}),check_outros())}):ue.block.d(1),lo.c(),transition_in(lo,1),lo.m(ue.mount(),ue.anchor),uo=!0),ue.block=lo,ue.blocks&&(ue.blocks[oo]=lo),uo&&flush()}if(is_promise(to)){const ro=get_current_component();if(to.then(oo=>{set_current_component(ro),no(ue.then,1,ue.value,oo),set_current_component(null)},oo=>{if(set_current_component(ro),no(ue.catch,2,ue.error,oo),set_current_component(null),!ue.hasCatch)throw oo}),ue.current!==ue.pending)return no(ue.pending,0),!0}else{if(ue.current!==ue.then)return no(ue.then,1,ue.value,to),!0;ue.resolved=to}}function update_await_block_branch(to,ue,eo){const no=ue.slice(),{resolved:ro}=to;to.current===to.then&&(no[to.value]=ro),to.current===to.catch&&(no[to.error]=ro),to.block.p(no,eo)}function ensure_array_like(to){return(to==null?void 0:to.length)!==void 0?to:Array.from(to)}function destroy_block(to,ue){to.d(1),ue.delete(to.key)}function outro_and_destroy_block(to,ue){transition_out(to,1,1,()=>{ue.delete(to.key)})}function fix_and_outro_and_destroy_block(to,ue){to.f(),outro_and_destroy_block(to,ue)}function update_keyed_each(to,ue,eo,no,ro,oo,io,so,ao,lo,uo,co){let fo=to.length,po=oo.length,mo=fo;const _o={};for(;mo--;)_o[to[mo].key]=mo;const ho=[],go=new Map,bo=new Map,vo=[];for(mo=po;mo--;){const So=co(ro,oo,mo),Eo=eo(So);let Io=io.get(Eo);Io?no&&vo.push(()=>Io.p(So,ue)):(Io=lo(Eo,So),Io.c()),go.set(Eo,ho[mo]=Io),Eo in _o&&bo.set(Eo,Math.abs(mo-_o[Eo]))}const $o=new Set,wo=new Set;function ko(So){transition_in(So,1),So.m(so,uo),io.set(So.key,So),uo=So.first,po--}for(;fo&&po;){const So=ho[po-1],Eo=to[fo-1],Io=So.key,Ao=Eo.key;So===Eo?(uo=So.first,fo--,po--):go.has(Ao)?!io.has(Io)||$o.has(Io)?ko(So):wo.has(Ao)?fo--:bo.get(Io)>bo.get(Ao)?(wo.add(Io),ko(So)):($o.add(Ao),fo--):(ao(Eo,io),fo--)}for(;fo--;){const So=to[fo];go.has(So.key)||ao(So,io)}for(;po;)ko(ho[po-1]);return run_all(vo),ho}function get_spread_update(to,ue){const eo={},no={},ro={$$scope:1};let oo=to.length;for(;oo--;){const io=to[oo],so=ue[oo];if(so){for(const ao in io)ao in so||(no[ao]=1);for(const ao in so)ro[ao]||(eo[ao]=so[ao],ro[ao]=1);to[oo]=so}else for(const ao in io)ro[ao]=1}for(const io in no)io in eo||(eo[io]=void 0);return eo}function get_spread_object(to){return typeof to=="object"&&to!==null?to:{}}function bind$2(to,ue,eo){const no=to.$$.props[ue];no!==void 0&&(to.$$.bound[no]=eo,eo(to.$$.ctx[no]))}function create_component(to){to&&to.c()}function mount_component(to,ue,eo){const{fragment:no,after_update:ro}=to.$$;no&&no.m(ue,eo),add_render_callback(()=>{const oo=to.$$.on_mount.map(run$3).filter(is_function);to.$$.on_destroy?to.$$.on_destroy.push(...oo):run_all(oo),to.$$.on_mount=[]}),ro.forEach(add_render_callback)}function destroy_component(to,ue){const eo=to.$$;eo.fragment!==null&&(flush_render_callbacks(eo.after_update),run_all(eo.on_destroy),eo.fragment&&eo.fragment.d(ue),eo.on_destroy=eo.fragment=null,eo.ctx=[])}function make_dirty(to,ue){to.$$.dirty[0]===-1&&(dirty_components.push(to),schedule_update(),to.$$.dirty.fill(0)),to.$$.dirty[ue/31|0]|=1<<ue%31}function init$3(to,ue,eo,no,ro,oo,io=null,so=[-1]){const ao=current_component;set_current_component(to);const lo=to.$$={fragment:null,ctx:[],props:oo,update:noop$5,not_equal:ro,bound:blank_object(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(ue.context||(ao?ao.$$.context:[])),callbacks:blank_object(),dirty:so,skip_bound:!1,root:ue.target||ao.$$.root};io&&io(lo.root);let uo=!1;if(lo.ctx=eo?eo(to,ue.props||{},(co,fo,...po)=>{const mo=po.length?po[0]:fo;return lo.ctx&&ro(lo.ctx[co],lo.ctx[co]=mo)&&(!lo.skip_bound&&lo.bound[co]&&lo.bound[co](mo),uo&&make_dirty(to,co)),fo}):[],lo.update(),uo=!0,run_all(lo.before_update),lo.fragment=no?no(lo.ctx):!1,ue.target){if(ue.hydrate){const co=children$1(ue.target);lo.fragment&&lo.fragment.l(co),co.forEach(detach)}else lo.fragment&&lo.fragment.c();ue.intro&&transition_in(to.$$.fragment),mount_component(to,ue.target,ue.anchor),flush()}set_current_component(ao)}class SvelteComponent{constructor(){Al(this,"$$");Al(this,"$$set")}$destroy(){destroy_component(this,1),this.$destroy=noop$5}$on(ue,eo){if(!is_function(eo))return noop$5;const no=this.$$.callbacks[ue]||(this.$$.callbacks[ue]=[]);return no.push(eo),()=>{const ro=no.indexOf(eo);ro!==-1&&no.splice(ro,1)}}$set(ue){this.$$set&&!is_empty(ue)&&(this.$$.skip_bound=!0,this.$$set(ue),this.$$.skip_bound=!1)}}const PUBLIC_VERSION="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(PUBLIC_VERSION);const defaultConfig$1={queryHandler:{parse:to=>fromEntries(new URLSearchParams(to)),stringify:to=>"?"+new URLSearchParams(to).toString()},urlTransform:{apply:to=>to,remove:to=>to},useHash:!1};function fromEntries(to){return[...to].reduce((ue,[eo,no])=>(ue[eo]=no,ue),{})}const MATCH_PARAM=RegExp(/\:([^/()]+)/g);function handleScroll(to,ue){if(navigator.userAgent.includes("jsdom"))return!1;ue&&scrollAncestorsToTop(to),handleHash()}function handleHash(){if(navigator.userAgent.includes("jsdom"))return!1;const{hash:to}=window.location;if(to){const ue=document.getElementById(to.substring(1));ue&&ue.scrollIntoView()}}function scrollAncestorsToTop(to){to&&to.scrollTo&&to.dataset.routify!=="scroll-lock"&&to.dataset["routify-scroll"]!=="lock"&&(to.style["scroll-behavior"]="auto",to.scrollTo({top:0,behavior:"auto"}),to.style["scroll-behavior"]="",scrollAncestorsToTop(to.parentElement))}const pathToRegex=(to,ue)=>{const eo=ue?"":"/?$";return to=to.replace(/\/_fallback?$/,"(/|$)"),to=to.replace(/\/index$/,"(/index)?"),to=to.replace(MATCH_PARAM,"([^/]+)")+eo,to=`^${to}`,to},pathToParamKeys=to=>{const ue=[];let eo;for(;eo=MATCH_PARAM.exec(to);)ue.push(eo[1]);return ue},pathToRank=({path:to})=>to.split("/").filter(Boolean).map(ue=>ue==="_fallback"?"A":ue.startsWith(":")?"B":"C").join("");function suppressComponentWarnings(to,ue){suppressComponentWarnings._console=suppressComponentWarnings._console||{log:console.log,warn:console.warn};const{_console:eo}=suppressComponentWarnings,no=to.componentFile.name.replace(/Proxy<_?(.+)>/,"$1").replace(/^Index$/,to.component.shortPath.split("/").pop()).replace(/^./,oo=>oo.toUpperCase()).replace(/\:(.+)/,"U5B$1u5D"),ro=[`<${no}> received an unexpected slot "default".`,`<${no}> was created with unknown prop 'scoped'`,`<${no}> was created with unknown prop 'scopedSync'`];for(const oo of["log","warn"])console[oo]=(...io)=>{ro.includes(io[0])||eo[oo](...io)},ue().then(()=>{console[oo]=eo[oo]})}function currentLocation(){let to=window.location.pathname+window.location.search+window.location.hash;const{url:ue,options:eo}=resolvePrefetch(to);return{...parseUrl(ue),options:eo}}function resolvePrefetch(to){const[ue,eo]=to.split("__[[routify_url_options]]__"),no=JSON.parse(decodeURIComponent(eo||"")||"{}");return window.routify=window.routify||{},window.routify.prefetched=no.prefetch,{url:ue,options:no}}function parseUrl(to){defaultConfig$1.useHash&&(to=to.replace(/.*#(.+)/,"$1"));const ue=to.startsWith("/")?window.location.origin:void 0,eo=new URL(to,ue),no=eo.pathname+eo.search+eo.hash;return{url:eo,fullpath:no}}function resolveUrl(to,ue,eo){const no=defaultConfig$1.useHash?"#":"";let ro;return ro=populateUrl(to,ue,eo),ro=defaultConfig$1.urlTransform.apply(ro),ro=no+ro,ro}function populateUrl(to,ue,eo){const no=Object.assign({},eo,ue),ro=getQueryString(to,ue);for(const[oo,io]of Object.entries(no))to=to.replace(new RegExp(`:${oo}(/|$)`),io+"$1");return`${to}${ro}`}function getQueryString(to,ue){if(!defaultConfig$1.queryHandler)return"";const eo=pathToParamKeys(to),no={};return ue&&Object.entries(ue).forEach(([ro,oo])=>{eo.includes(ro)||(no[ro]=oo)}),defaultConfig$1.queryHandler.stringify(no).replace(/\?$/,"")}function create_fragment$cN(to){let ue;const eo=to[2].default,no=create_slot(eo,to,to[1],null);return{c(){no&&no.c()},m(ro,oo){no&&no.m(ro,oo),ue=!0},p(ro,[oo]){no&&no.p&&(!ue||oo&2)&&update_slot_base(no,eo,ro,ro[1],ue?get_slot_changes(eo,ro[1],oo,null):get_all_dirty_from_scope(ro[1]),null)},i(ro){ue||(transition_in(no,ro),ue=!0)},o(ro){transition_out(no,ro),ue=!1},d(ro){no&&no.d(ro)}}}function instance$cQ(to,ue,eo){let{$$slots:no={},$$scope:ro}=ue,{scoped:oo={}}=ue;return to.$$set=io=>{"scoped"in io&&eo(0,oo=io.scoped),"$$scope"in io&&eo(1,ro=io.$$scope)},[oo,ro,no]}class Noop extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$cQ,create_fragment$cN,safe_not_equal,{scoped:0})}}const subscriber_queue=[];function readable(to,ue){return{subscribe:writable(to,ue).subscribe}}function writable(to,ue=noop$5){let eo;const no=new Set;function ro(so){if(safe_not_equal(to,so)&&(to=so,eo)){const ao=!subscriber_queue.length;for(const lo of no)lo[1](),subscriber_queue.push(lo,to);if(ao){for(let lo=0;lo<subscriber_queue.length;lo+=2)subscriber_queue[lo][0](subscriber_queue[lo+1]);subscriber_queue.length=0}}}function oo(so){ro(so(to))}function io(so,ao=noop$5){const lo=[so,ao];return no.add(lo),no.size===1&&(eo=ue(ro,oo)||noop$5),so(to),()=>{no.delete(lo),no.size===0&&eo&&(eo(),eo=null)}}return{set:ro,update:oo,subscribe:io}}function derived(to,ue,eo){const no=!Array.isArray(to),ro=no?[to]:to;if(!ro.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const oo=ue.length<2;return readable(eo,(io,so)=>{let ao=!1;const lo=[];let uo=0,co=noop$5;const fo=()=>{if(uo)return;co();const mo=ue(no?lo[0]:lo,io,so);oo?io(mo):co=is_function(mo)?mo:noop$5},po=ro.map((mo,_o)=>subscribe(mo,ho=>{lo[_o]=ho,uo&=~(1<<_o),ao&&fo()},()=>{uo|=1<<_o}));return ao=!0,fo(),function(){run_all(po),co(),ao=!1}})}window.routify=window.routify||{};const route=writable(null),routes$1=writable([]);routes$1.subscribe(to=>window.routify.routes=to);let rootContext=writable({component:{params:{}}});const urlRoute=writable(null),prefetchPath=writable(""),isChangingPage=writable(!0);async function onPageLoaded({page:to,metatags:ue,afterPageLoad:eo,parentNode:no}){const ro=to.last!==to;setTimeout(()=>handleScroll(no,ro));const{path:oo}=to,{options:io}=currentLocation(),so=io.prefetch;for(const ao of eo._hooks)ao&&await ao(to.api);ue.update(),dispatchEvent(new CustomEvent("app-loaded")),parent.postMessage({msg:"app-loaded",prefetched:window.routify.prefetched,path:oo,prefetchId:so},"*"),window.routify.appLoaded=!0,window.routify.stopAutoReady=!1}function urlToRoute(to,ue=!1){to=defaultConfig$1.urlTransform.remove(to);let{pathname:eo,search:no}=parseUrl(to).url;const ro=get_store_value(routes$1),oo=ro.find(uo=>eo===uo.meta.name)||ro.find(uo=>eo.match(uo.regex));if(!oo)throw new Error(`Route could not be found for "${eo}".`);const io=ue?Object.create(oo):oo,{route:so,redirectPath:ao,rewritePath:lo}=resolveRedirects(io,ro);return lo&&({pathname:eo,search:no}=parseUrl(resolveUrl(lo,so.params)).url,ao&&(so.redirectTo=resolveUrl(ao,so.params||{}))),defaultConfig$1.queryHandler&&(so.params=Object.assign({},defaultConfig$1.queryHandler.parse(no))),assignParamsToRouteAndLayouts(so,eo),so.leftover=to.replace(new RegExp(so.regex),""),so}function assignParamsToRouteAndLayouts(to,ue){if(to.paramKeys){const eo=layoutByPos(to.layouts),no=ue.split("/").filter(Boolean);getRouteProps(to.path).forEach((oo,io)=>{oo&&(to.params[oo]=no[io],eo[io]?eo[io].param={[oo]:no[io]}:to.param={[oo]:no[io]})})}}function resolveRedirects(to,ue,eo,no){const{redirect:ro,rewrite:oo}=to.meta;if(ro||oo){eo=ro?ro.path||ro:eo,no=oo?oo.path||oo:eo;const io=ro&&ro.params,so=oo&&oo.params,ao=ue.find(lo=>lo.path.replace(/\/index$/,"")===no);return ao===to&&console.error(`${no} is redirecting to itself`),ao||console.error(`${to.path} is redirecting to non-existent path: ${no}`),(io||so)&&(ao.params=Object.assign({},ao.params,io,so)),resolveRedirects(ao,ue,eo,no)}return{route:to,redirectPath:eo,rewritePath:no}}function layoutByPos(to){const ue=[];return to.forEach(eo=>{ue[eo.path.split("/").filter(Boolean).length-1]=eo}),ue}function getRouteProps(to){return to.split("/").filter(Boolean).map(ue=>ue.match(/\:(.+)/)).map(ue=>ue&&ue[1])}function get_each_context$2u(to,ue,eo){const no=to.slice();return no[1]=ue[eo],no}function create_each_block$2u(to,ue){let eo,no;return{key:to,first:null,c(){eo=element("iframe"),src_url_equal(eo.src,no=ue[1].url)||attr(eo,"src",no),attr(eo,"frameborder","0"),attr(eo,"title","routify prefetcher"),this.first=eo},m(ro,oo){insert$1(ro,eo,oo)},p(ro,oo){ue=ro,oo&1&&!src_url_equal(eo.src,no=ue[1].url)&&attr(eo,"src",no)},d(ro){ro&&detach(eo)}}}function create_fragment$cM(to){let ue,eo=[],no=new Map,ro=ensure_array_like(to[0]);const oo=io=>io[1].options.prefetch;for(let io=0;io<ro.length;io+=1){let so=get_each_context$2u(to,ro,io),ao=oo(so);no.set(ao,eo[io]=create_each_block$2u(ao,so))}return{c(){ue=element("div");for(let io=0;io<eo.length;io+=1)eo[io].c();attr(ue,"id","__routify_iframes"),set_style(ue,"display","none")},m(io,so){insert$1(io,ue,so);for(let ao=0;ao<eo.length;ao+=1)eo[ao]&&eo[ao].m(ue,null)},p(io,[so]){so&1&&(ro=ensure_array_like(io[0]),eo=update_keyed_each(eo,so,oo,1,io,ro,no,ue,destroy_block,create_each_block$2u,null,get_each_context$2u))},i:noop$5,o:noop$5,d(io){io&&detach(ue);for(let so=0;so<eo.length;so+=1)eo[so].d()}}}const iframeNum=2,defaults$4={validFor:60,timeout:5e3,gracePeriod:1e3},queue$1=writable([]),actives=derived(queue$1,to=>to.slice(0,iframeNum));actives.subscribe(to=>to.forEach(({options:ue})=>{setTimeout(()=>removeFromQueue(ue.prefetch),ue.timeout)}));function prefetch$1(to,ue={}){if(prefetch$1.id=prefetch$1.id||1,to=to.href||to,ue={...defaults$4,...ue},ue.prefetch=prefetch$1.id++,window.routify.prefetched||navigator.userAgent.match("jsdom"))return!1;queue$1.update(eo=>(eo.some(no=>no.options.path===to)||eo.push({url:`${to}__[[routify_url_options]]__${encodeURIComponent(JSON.stringify(ue))}`,options:ue}),eo))}function removeFromQueue(to){const ue=to.data?to.data.prefetchId:to;if(!ue)return null;const eo=get_store_value(queue$1).find(no=>no&&no.options.prefetch==ue);if(eo){const{gracePeriod:no}=eo.options,ro=new Promise(io=>setTimeout(io,no)),oo=new Promise(io=>{window.requestIdleCallback?window.requestIdleCallback(io):setTimeout(io,no+1e3)});Promise.all([ro,oo]).then(()=>{queue$1.update(io=>io.filter(so=>so.options.prefetch!=ue))})}}addEventListener("message",removeFromQueue,!1);function instance$cP(to,ue,eo){let no;return component_subscribe(to,actives,ro=>eo(0,no=ro)),[no]}class Prefetcher extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$cP,create_fragment$cM,safe_not_equal,{})}}function getRoutifyContext(){return getContext$1("routify")||rootContext}const nodes={subscribe(to){const ue=[];return derived(routes$1,eo=>{eo.forEach(ro=>{const oo=ro.layouts.map(io=>io.api).filter(io=>!ue.includes(io));ue.push(ro.api,...oo)});const no=ue.find;return ue.find=(ro,...oo)=>typeof ro=="string"?ue.find(io=>io.meta.name===ro)||ue.find(io=>io.path===ro):no.bind(ue)(ro,...oo),ue}).subscribe(to)}},components$1=nodes,page={subscribe(to){return derived(route,ue=>ue.api).subscribe(to)}},node$2={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>eo.component.api).subscribe(to)}},layout$1={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>eo.layout.api).subscribe(to)}},context={subscribe(to){return getRoutifyContext().subscribe(to)}},ready={subscribe(to){window.routify.stopAutoReady=!0;async function ue(){await tick(),await onPageLoaded({page:get_store_value(route),metatags,afterPageLoad})}return to(ue),()=>{}}},afterPageLoad={_hooks:[to=>isChangingPage.set(!1)],subscribe:hookHandler},beforeUrlChange={_hooks:[],subscribe:hookHandler};function hookHandler(to){const ue=this._hooks,eo=ue.length;return to(no=>{ue[eo]=no}),(...no)=>{delete ue[eo],to(...no)}}const params={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>eo.route.params).subscribe(to)}},leftover={subscribe(to){return derived(route,ue=>ue.leftover).subscribe(to)}};function isAncestor(to,ue,eo=!0){to=to.__file||to,ue=ue.__file||ue;const no=ue.parent===to.parent;return!to.isIndex||ue.shortPath===to.shortPath?!1:no&&!ue.isDir?!!eo:ue.shortPath.startsWith(to.shortPath)}const meta$2={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>eo.layout.meta).subscribe(to)}},url$3={subscribe(to){const ue=getRoutifyContext();return derived(ue,eo=>makeUrlHelper(eo,eo.route,eo.routes)).subscribe(to)}};function makeUrlHelper(to,ue,eo){return function(ro,oo={},io){const{component:so}=to,ao=Object.assign({},ue.params,so.params);let lo=ro&&ro.nodeType&&ro;lo&&(ro=ro.getAttribute("href")),ro=ro?po(ro):so.shortPath;const uo=eo.find(mo=>[mo.shortPath||"/",mo.path].includes(ro));if(uo&&uo.meta.preload==="proximity"&&window.requestIdleCallback){const mo=routify.appLoaded?0:1500;setTimeout(()=>{window.requestIdleCallback(()=>uo.api.preload())},mo)}io&&io.strict!==!1||(ro=ro.replace(/index$/,""));let fo=resolveUrl(ro,oo,ao);if(lo)return lo.href=fo,{update(mo){lo.href=resolveUrl(ro,mo,ao)}};return fo;function po(mo){if(mo.match(/^\.\.?\//)){let[,_o,ho]=mo.match(/^([\.\/]+)(.*)/),go=so.path.replace(/\/$/,"");const bo=_o.match(/\.\.\//g)||[];so.isPage&&bo.push(null),bo.forEach(()=>go=go.replace(/\/[^\/]+\/?$/,"")),mo=`${go}/${ho}`.replace(/\/$/,""),mo=mo||"/"}else if(!mo.match(/^\//)){const _o=eo.find(ho=>ho.meta.name===mo);_o&&(mo=_o.shortPath)}return mo}}}const goto={subscribe(to){const ue=getContext$1("routifyupdatepage");return derived(url$3,eo=>function(ro,oo,io,so){const ao=eo(ro,oo);io?ue(ao,so):history.pushState({},null,ao)}).subscribe(to)}},redirect={subscribe(to){const ue=getContext$1("routifyupdatepage");return derived(url$3,eo=>function(ro,oo,io,so){const ao=eo(ro,oo);io?ue(ao,so):history.replaceState({},null,ao)}).subscribe(to)}},isActive={subscribe(to){return derived([url$3,route],([ue,eo])=>function(ro="",oo={},{strict:io}={strict:!0}){ro=ue(ro,oo,{strict:io});const so=ue(eo.path,oo,{strict:io}),ao=new RegExp("^"+ro+"($|/)");return!!so.match(ao)}).subscribe(to)}};function precache(to,ue){(typeof to=="string"?urlToRoute(to):to).component()}function prefetch(to,ue){prefetch$1(to,ue)}function getConcestor(to,ue){const eo=to.__file,no=ue.__file,ro=[...eo.lineage,eo],oo=[...no.lineage,no];let io=ro[0],so=[ro[0].api,oo[0].api];return ro.forEach((ao,lo)=>{const uo=oo[lo];uo&&ao.parent===uo.parent&&(io=ao.parent,so=[ao.api,uo.api])}),[io.api,so[0],so[1]]}function getDirection$1(to,ue,eo){const no=to.findIndex(oo=>ue.path.startsWith(oo)),ro=to.findIndex(oo=>eo.path.startsWith(oo));return no-ro}function focus(to){focusIsSet||(focusIsSet=!0,to.setAttribute("tabindex","0"),to.focus(),setTimeout(()=>focusIsSet=!1))}let focusIsSet=!1;const _metatags={subscribe(to){return this._origin=this.getOrigin(),to(metatags)},props:{},templates:{},services:{plain:{propField:"name",valueField:"content"},twitter:{propField:"name",valueField:"content"},og:{propField:"property",valueField:"content"}},plugins:[{name:"applyTemplate",condition:()=>!0,action:(to,ue)=>{const eo=_metatags.getLongest(_metatags.templates,to)||(no=>no);return[to,eo(ue)]}},{name:"createMeta",condition:()=>!0,action(to,ue){_metatags.writeMeta(to,ue)}},{name:"createOG",condition:to=>!to.match(":"),action(to,ue){_metatags.writeMeta(`og:${to}`,ue)}},{name:"createTitle",condition:to=>to==="title",action(to,ue){document.title=ue}}],getLongest(to,ue){const eo=to[ue];if(eo){const no=get_store_value(route).path,io=Object.keys(to[ue]).filter(so=>no.includes(so)).sort((so,ao)=>ao.length-so.length)[0];return eo[io]}},writeMeta(to,ue){const eo=document.getElementsByTagName("head")[0],no=to.match(/(.+)\:/),ro=no&&no[1]||"plain",{propField:oo,valueField:io}=metatags.services[ro]||metatags.services.plain,so=document.querySelector(`meta[${oo}='${to}']`);so&&so.remove();const ao=document.createElement("meta");ao.setAttribute(oo,to),ao.setAttribute(io,ue),ao.setAttribute("data-origin","routify"),eo.appendChild(ao)},set(to,ue){typeof to=="string"&&_metatags.plugins.forEach(eo=>{eo.condition(to,ue)&&([to,ue]=eo.action(to,ue)||[to,ue])})},clear(){const to=document.querySelector("meta");to&&to.remove()},template(to,ue){const eo=_metatags.getOrigin;_metatags.templates[to]=_metatags.templates[to]||{},_metatags.templates[to][eo]=ue},update(){Object.keys(_metatags.props).forEach(to=>{let ue=_metatags.getLongest(_metatags.props,to);_metatags.plugins.forEach(eo=>{eo.condition(to,ue)&&([to,ue]=eo.action(to,ue)||[to,ue])})})},batchedUpdate(){_metatags._pendingUpdate||(_metatags._pendingUpdate=!0,setTimeout(()=>{_metatags._pendingUpdate=!1,this.update()}))},_updateQueued:!1,_origin:!1,getOrigin(){if(this._origin)return this._origin;const to=getRoutifyContext();return to&&get_store_value(to).path||"/"},_pendingUpdate:!1},metatags=new Proxy(_metatags,{set(to,ue,eo,no){const{props:ro}=to;return Reflect.has(to,ue)?Reflect.set(to,ue,eo,no):(ro[ue]=ro[ue]||{},ro[ue][to.getOrigin()]=eo),window.routify.appLoaded&&to.batchedUpdate(),!0}});function get_each_context$2t(to,ue,eo){const no=to.slice();return no[21]=ue[eo].component,no[22]=ue[eo].componentFile,no[2]=ue[eo].decorator,no[1]=ue[eo].nodes,no}function create_if_block_1$3t(to){let ue=[],eo=new Map,no,ro,oo=ensure_array_like([to[4]]);const io=so=>so[7];for(let so=0;so<1;so+=1){let ao=get_each_context$2t(to,oo,so),lo=io(ao);eo.set(lo,ue[so]=create_each_block$2t(lo,ao))}return{c(){for(let so=0;so<1;so+=1)ue[so].c();no=empty$4()},m(so,ao){for(let lo=0;lo<1;lo+=1)ue[lo]&&ue[lo].m(so,ao);insert$1(so,no,ao),ro=!0},p(so,ao){ao&33554621&&(oo=ensure_array_like([so[4]]),group_outros(),ue=update_keyed_each(ue,ao,io,1,so,oo,eo,no.parentNode,outro_and_destroy_block,create_each_block$2t,no,get_each_context$2t),check_outros())},i(so){if(!ro){for(let ao=0;ao<1;ao+=1)transition_in(ue[ao]);ro=!0}},o(so){for(let ao=0;ao<1;ao+=1)transition_out(ue[ao]);ro=!1},d(so){so&&detach(no);for(let ao=0;ao<1;ao+=1)ue[ao].d(so)}}}function create_if_block_2$27(to){let ue,eo;return ue=new Route({props:{decorator:to[2],nodes:to[1],scoped:{...to[0],...to[25]}}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&4&&(oo.decorator=no[2]),ro&16&&(oo.nodes=no[1]),ro&33554433&&(oo.scoped={...no[0],...no[25]}),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_default_slot_1$4J(to){let ue,eo,no=to[21]&&to[1].length&&create_if_block_2$27(to);return{c(){no&&no.c(),ue=empty$4()},m(ro,oo){no&&no.m(ro,oo),insert$1(ro,ue,oo),eo=!0},p(ro,oo){ro[21]&&ro[1].length?no?(no.p(ro,oo),oo&16&&transition_in(no,1)):(no=create_if_block_2$27(ro),no.c(),transition_in(no,1),no.m(ue.parentNode,ue)):no&&(group_outros(),transition_out(no,1,1,()=>{no=null}),check_outros())},i(ro){eo||(transition_in(no),eo=!0)},o(ro){transition_out(no),eo=!1},d(ro){ro&&detach(ue),no&&no.d(ro)}}}function create_default_slot$7C(to){let ue,eo,no;const ro=[{scoped:to[0]},{scopedSync:to[5]},to[3].param||{}];var oo=to[22];function io(so,ao){let lo={$$slots:{default:[create_default_slot_1$4J,({scoped:uo,decorator:co})=>({25:uo,2:co}),({scoped:uo,decorator:co})=>(uo?33554432:0)|(co?4:0)]},$$scope:{ctx:so}};for(let uo=0;uo<ro.length;uo+=1)lo=assign$1(lo,ro[uo]);return ao!==void 0&&ao&41&&(lo=assign$1(lo,get_spread_update(ro,[ao&1&&{scoped:so[0]},ao&32&&{scopedSync:so[5]},ao&8&&get_spread_object(so[3].param||{})]))),{props:lo}}return oo&&(ue=construct_svelte_component(oo,io(to))),{c(){ue&&create_component(ue.$$.fragment),eo=space$1()},m(so,ao){ue&&mount_component(ue,so,ao),insert$1(so,eo,ao),no=!0},p(so,ao){if(ao&16&&oo!==(oo=so[22])){if(ue){group_outros();const lo=ue;transition_out(lo.$$.fragment,1,0,()=>{destroy_component(lo,1)}),check_outros()}oo?(ue=construct_svelte_component(oo,io(so,ao)),create_component(ue.$$.fragment),transition_in(ue.$$.fragment,1),mount_component(ue,eo.parentNode,eo)):ue=null}else if(oo){const lo=ao&41?get_spread_update(ro,[ao&1&&{scoped:so[0]},ao&32&&{scopedSync:so[5]},ao&8&&get_spread_object(so[3].param||{})]):{};ao&100663317&&(lo.$$scope={dirty:ao,ctx:so}),ue.$set(lo)}},i(so){no||(ue&&transition_in(ue.$$.fragment,so),no=!0)},o(so){ue&&transition_out(ue.$$.fragment,so),no=!1},d(so){so&&detach(eo),ue&&destroy_component(ue,so)}}}function create_each_block$2t(to,ue){let eo,no,ro,oo;var io=ue[2];function so(ao,lo){return{props:{scoped:ao[0],$$slots:{default:[create_default_slot$7C]},$$scope:{ctx:ao}}}}return io&&(no=construct_svelte_component(io,so(ue))),{key:to,first:null,c(){eo=empty$4(),no&&create_component(no.$$.fragment),ro=empty$4(),this.first=eo},m(ao,lo){insert$1(ao,eo,lo),no&&mount_component(no,ao,lo),insert$1(ao,ro,lo),oo=!0},p(ao,lo){if(ue=ao,lo&16&&io!==(io=ue[2])){if(no){group_outros();const uo=no;transition_out(uo.$$.fragment,1,0,()=>{destroy_component(uo,1)}),check_outros()}io?(no=construct_svelte_component(io,so(ue)),create_component(no.$$.fragment),transition_in(no.$$.fragment,1),mount_component(no,ro.parentNode,ro)):no=null}else if(io){const uo={};lo&1&&(uo.scoped=ue[0]),lo&67108925&&(uo.$$scope={dirty:lo,ctx:ue}),no.$set(uo)}},i(ao){oo||(no&&transition_in(no.$$.fragment,ao),oo=!0)},o(ao){no&&transition_out(no.$$.fragment,ao),oo=!1},d(ao){ao&&(detach(eo),detach(ro)),no&&destroy_component(no,ao)}}}function create_if_block$63(to){let ue,eo,no;return{c(){ue=element("div"),set_style(ue,"display","contents")},m(ro,oo){insert$1(ro,ue,oo),eo||(no=action_destroyer(to[10].call(null,ue)),eo=!0)},d(ro){ro&&detach(ue),eo=!1,no()}}}function create_fragment$cL(to){let ue,eo,no,ro=to[4]&&create_if_block_1$3t(to),oo=!to[6]&&create_if_block$63(to);return{c(){ro&&ro.c(),ue=space$1(),oo&&oo.c(),eo=empty$4()},m(io,so){ro&&ro.m(io,so),insert$1(io,ue,so),oo&&oo.m(io,so),insert$1(io,eo,so),no=!0},p(io,[so]){io[4]?ro?(ro.p(io,so),so&16&&transition_in(ro,1)):(ro=create_if_block_1$3t(io),ro.c(),transition_in(ro,1),ro.m(ue.parentNode,ue)):ro&&(group_outros(),transition_out(ro,1,1,()=>{ro=null}),check_outros()),io[6]?oo&&(oo.d(1),oo=null):oo||(oo=create_if_block$63(io),oo.c(),oo.m(eo.parentNode,eo))},i(io){no||(transition_in(ro),no=!0)},o(io){transition_out(ro),no=!1},d(io){io&&(detach(ue),detach(eo)),ro&&ro.d(io),oo&&oo.d(io)}}}function instance$cO(to,ue,eo){let no,ro,oo,io,so;component_subscribe(to,route,Eo=>eo(14,oo=Eo)),component_subscribe(to,routes$1,Eo=>eo(16,so=Eo));let{nodes:ao=[]}=ue,{scoped:lo={}}=ue,{decorator:uo=void 0}=ue,co=null,fo=null,po={},mo,_o=1;const ho=writable(null);component_subscribe(to,ho,Eo=>eo(4,ro=Eo));const go=getContext$1("routify")||rootContext;component_subscribe(to,go,Eo=>eo(15,io=Eo));const bo=Eo=>eo(6,mo=Eo.parentNode);setContext("routify",ho);let vo=[];function $o(Eo){let Io=Eo.component();Io instanceof Promise?Io.then(wo):wo(Io)}function wo(Eo){eo(5,po={...lo});const Io={...ro,nodes:fo,decorator:uo||Noop,layout:co.isLayout?co:io.layout,component:co,route:oo,routes:so,componentFile:Eo,parentNode:mo||io.parentNode};ho.set(Io),set_store_value(go,io.child=co,io),fo.length===0&&ko()}async function ko(){await new Promise(Io=>setTimeout(Io));const Eo=ro.component.path===oo.path;!window.routify.stopAutoReady&&Eo&&onPageLoaded({page:ro.component,metatags,afterPageLoad,parentNode:mo})}function So({meta:Eo,path:Io,param:Ao,params:To}){return JSON.stringify({path:Io,invalidate:_o,param:(Eo["param-is-page"]||Eo["slug-is-page"])&&Ao,queryParams:Eo["query-params-is-page"]&&To})}return to.$$set=Eo=>{"nodes"in Eo&&eo(1,ao=Eo.nodes),"scoped"in Eo&&eo(0,lo=Eo.scoped),"decorator"in Eo&&eo(2,uo=Eo.decorator)},to.$$.update=()=>{to.$$.dirty&6146&&vo!==ao&&(eo(12,vo=ao),eo(3,[co,...fo]=[...ao],co),eo(3,co.api.reset=()=>eo(11,_o++,_o),co)),to.$$.dirty&8&&$o(co),to.$$.dirty&2064&&eo(7,no=ro&&_o&&So(ro.component)),to.$$.dirty&16&&ro&&suppressComponentWarnings(ro,tick)},[lo,ao,uo,co,ro,po,mo,no,ho,go,bo,_o,vo]}class Route extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$cO,create_fragment$cL,safe_not_equal,{nodes:1,scoped:0,decorator:2})}}function init$2(to,ue){let eo=!1;function no(oo,io){const so=oo||currentLocation().fullpath,ao=urlToRoute(so);ao.redirectTo&&(history.replaceStateNative({},null,ao.redirectTo),delete ao.redirectTo);const co=[...(io&&urlToRoute(currentLocation().fullpath,to)||ao).layouts,ao];eo&&delete eo.last,ao.last=eo,eo=ao,oo||urlRoute.set(ao),route.set(ao),ao.api.preload().then(()=>{isChangingPage.set(!0),ue(co)})}const ro=createEventListeners(no);return{updatePage:no,destroy:ro}}function createEventListeners(to){["pushState","replaceState"].forEach(ro=>{history[ro+"Native"]||(history[ro+"Native"]=history[ro]),history[ro]=async function(oo={},io,so){const ao=location.pathname+location.search+location.hash;if(so===ao)return!1;const{id:lo,path:uo,params:co}=get_store_value(route);oo={id:lo,path:uo,params:co,...oo};const fo=new Event(ro.toLowerCase());if(Object.assign(fo,{state:oo,title:io,url:so}),await runHooksBeforeUrlChange(fo,so))return history[ro+"Native"].apply(this,[oo,io,so]),dispatchEvent(fo)}});let ue=!1;const eo={click:handleClick$1,pushstate:()=>to(),replacestate:()=>to(),popstate:async ro=>{ue?ue=!1:await runHooksBeforeUrlChange(ro,currentLocation().fullpath)?to():(ue=!0,ro.preventDefault(),history.go(1))}};return Object.entries(eo).forEach(ro=>addEventListener(...ro)),()=>{Object.entries(eo).forEach(ro=>removeEventListener(...ro))}}function handleClick$1(to){const ue=to.target.closest("a")||to.composedPath().find(oo=>oo.tagName==="A"),eo=ue&&ue.href;if(to.ctrlKey||to.metaKey||to.altKey||to.shiftKey||to.button||to.defaultPrevented||!eo||ue.target||ue.host!==location.host)return;const no=new URL(eo),ro=no.pathname+no.search+no.hash;to.preventDefault(),history.pushState({},"",ro)}async function runHooksBeforeUrlChange(to,ue){const eo=urlToRoute(ue).api;for(const no of beforeUrlChange._hooks.filter(Boolean))if(!await no(to,eo,{url:ue}))return!1;return!0}function create_if_block$62(to){let ue,eo;return ue=new Route({props:{nodes:to[0]}}),{c(){create_component(ue.$$.fragment)},m(no,ro){mount_component(ue,no,ro),eo=!0},p(no,ro){const oo={};ro&1&&(oo.nodes=no[0]),ue.$set(oo)},i(no){eo||(transition_in(ue.$$.fragment,no),eo=!0)},o(no){transition_out(ue.$$.fragment,no),eo=!1},d(no){destroy_component(ue,no)}}}function create_fragment$cK(to){let ue,eo,no,ro=to[0]&&to[1]!==null&&create_if_block$62(to);return eo=new Prefetcher({}),{c(){ro&&ro.c(),ue=space$1(),create_component(eo.$$.fragment)},m(oo,io){ro&&ro.m(oo,io),insert$1(oo,ue,io),mount_component(eo,oo,io),no=!0},p(oo,[io]){oo[0]&&oo[1]!==null?ro?(ro.p(oo,io),io&3&&transition_in(ro,1)):(ro=create_if_block$62(oo),ro.c(),transition_in(ro,1),ro.m(ue.parentNode,ue)):ro&&(group_outros(),transition_out(ro,1,1,()=>{ro=null}),check_outros())},i(oo){no||(transition_in(ro),transition_in(eo.$$.fragment,oo),no=!0)},o(oo){transition_out(ro),transition_out(eo.$$.fragment,oo),no=!1},d(oo){oo&&detach(ue),ro&&ro.d(oo),destroy_component(eo,oo)}}}function instance$cN(to,ue,eo){let no;component_subscribe(to,route,po=>eo(1,no=po));let{routes:ro}=ue,{config:oo={}}=ue,io,so;window.routify=window.routify||{},window.routify.inBrowser=!window.navigator.userAgent.match("jsdom"),Object.assign(defaultConfig$1,oo),setContext("routifyupdatepage",(...po)=>so&&so.updatePage(...po));const lo=po=>eo(0,io=po),uo=()=>{so&&(so.destroy(),so=null)};let co=null;const fo=()=>{clearTimeout(co),co=setTimeout(()=>{uo(),so=init$2(ro,lo),routes$1.set(ro),so.updatePage()})};return onDestroy(uo),to.$$set=po=>{"routes"in po&&eo(2,ro=po.routes),"config"in po&&eo(3,oo=po.config)},to.$$.update=()=>{to.$$.dirty&4&&ro&&fo()},[io,no,ro,oo]}class Router extends SvelteComponent{constructor(ue){super(),init$3(this,ue,instance$cN,create_fragment$cK,safe_not_equal,{routes:2,config:3})}}function createNodeMiddleware(to){const ue=async function(no){return await nodeMiddleware(to,{file:no.tree,state:{treePayload:no},scope:{}})};return ue.sync=function(no){return nodeMiddlewareSync(to,{file:no.tree,state:{treePayload:no},scope:{}})},ue}async function nodeMiddleware(to,ue){const eo=await to(ue);if(eo===!1)return!1;const no=eo||ue.file;if(no.children){const ro=await Promise.all(no.children.map(async oo=>nodeMiddleware(to,{state:ue.state,scope:clone$4(ue.scope||{}),parent:ue.file,file:await oo})));no.children=ro.filter(Boolean)}return no}function nodeMiddlewareSync(to,ue){const eo=to(ue);if(eo===!1)return!1;const no=eo||ue.file;if(no.children){const ro=no.children.map(oo=>nodeMiddlewareSync(to,{state:ue.state,scope:clone$4(ue.scope||{}),parent:ue.file,file:oo}));no.children=ro.filter(Boolean)}return no}function clone$4(to){return JSON.parse(JSON.stringify(to))}const setRegex=createNodeMiddleware(({file:to})=>{(to.isPage||to.isFallback)&&(to.regex=pathToRegex(to.path,to.isFallback))}),setParamKeys=createNodeMiddleware(({file:to})=>{to.paramKeys=pathToParamKeys(to.path)}