Files
mermaid-live-editor/_app/immutable/components/pages/_layout.svelte-02aad86d.js
T
2022-09-02 18:21:26 +00:00

2 lines
2.9 KiB
JavaScript

import{A as I,B as j,S as A,i as V,s as C,C as H,k as u,a as $,e as b,l as d,m as g,h as f,c as M,n as p,b as h,D as N,E as T,F as q,f as B,t as L,G as y,o as W,q as z,r as F,H as m,u as G}from"../../chunks/index-9ccab77c.js";import{b as k}from"../../chunks/paths-6cd3a76e.js";import{p as O,l as R,a as S,i as x,b as J,t as K,c as P}from"../../chunks/state-5021f75d.js";import{s as Q,t as w}from"../../chunks/theme-59471227.js";import"../../chunks/preload-helper-aa6bc0ce.js";const U={injectHistoryIDs:x},E=O(I({version:-1}),R(),"migrations"),X=()=>{const{version:r}=j(E),s=Object.entries(U);if(r!==s.length-1){console.log(`Current migration version: v${r}. Migrating to v${s.length-1}.`);for(let a=r+1;a<s.length;a++){const[n,l]=s[a];console.log(`Applying migration ${a}: ${n}.`),l(),S("migration",{key:n}),E.set({version:a})}S("migration",{status:"complete",from:r,to:s.length-1})}};function D(r){let s,a,n,l,c,o=r[0].message+"",t;return{c(){s=u("div"),a=u("div"),n=u("div"),l=$(),c=u("div"),t=z(o),this.h()},l(e){s=d(e,"DIV",{class:!0});var i=g(s);a=d(i,"DIV",{class:!0});var _=g(a);n=d(_,"DIV",{class:!0}),g(n).forEach(f),l=M(_),c=d(_,"DIV",{});var v=g(c);t=F(v,o),v.forEach(f),_.forEach(f),i.forEach(f),this.h()},h(){p(n,"class","loader mx-auto svelte-1ub1m40"),p(a,"class","text-indigo-100 text-4xl font-bold my-auto"),p(s,"class","w-screen h-screen z-50 absolute left-0 top-0 bg-gray-600 opacity-50 flex align-middle justify-center")},m(e,i){h(e,s,i),m(s,a),m(a,n),m(a,l),m(a,c),m(c,t)},p(e,i){i&1&&o!==(o=e[0].message+"")&&G(t,o)},d(e){e&&f(s)}}}function Y(r){let s,a,n,l;const c=r[2].default,o=H(c,r,r[1],null);let t=r[0].loading&&D(r);return{c(){s=u("main"),o&&o.c(),a=$(),t&&t.c(),n=b(),this.h()},l(e){s=d(e,"MAIN",{class:!0});var i=g(s);o&&o.l(i),i.forEach(f),a=M(e),t&&t.l(e),n=b(),this.h()},h(){p(s,"class","h-screen text-primary-content")},m(e,i){h(e,s,i),o&&o.m(s,null),h(e,a,i),t&&t.m(e,i),h(e,n,i),l=!0},p(e,[i]){o&&o.p&&(!l||i&2)&&N(o,c,e,e[1],l?q(c,e[1],i,null):T(e[1]),null),e[0].loading?t?t.p(e,i):(t=D(e),t.c(),t.m(n.parentNode,n)):t&&(t.d(1),t=null)},i(e){l||(B(o,e),l=!0)},o(e){L(o,e),l=!1},d(e){e&&f(s),o&&o.d(e),e&&f(a),t&&t.d(e),e&&f(n)}}}function Z(r,s,a){let n,l;y(r,w,t=>a(3,n=t)),y(r,P,t=>a(0,l=t));let{$$slots:c={},$$scope:o}=s;return W(()=>{X(),window.addEventListener("hashchange",async e=>{await J()}),"serviceWorker"in navigator&&navigator.serviceWorker.register(`${k}/service-worker.js`,{scope:`${k}/`}).then(function(e){console.log("Registration successful, scope is:",e.scope)}).catch(function(e){console.log("Service worker registration failed, error:",e)});const t=window.matchMedia("(prefers-color-scheme: dark)").matches;n.theme===void 0&&Q(t?"dark":"light"),w.subscribe(({theme:e,isDark:i})=>{e&&(document.getElementsByTagName("html")[0].setAttribute("data-theme",e),K(i))})}),r.$$set=t=>{"$$scope"in t&&a(1,o=t.$$scope)},[l,o,c]}class ie extends A{constructor(s){super(),V(this,s,Z,Y,C,{})}}export{ie as default};