webbutv-m2/build/client/_app/immutable/entry/start.72dab473.js

4 lines
24 KiB
JavaScript
Raw Normal View History

2023-09-20 11:03:37 +00:00
import{o as we,t as ye}from"../chunks/scheduler.e108d1fd.js";import{S as Ge,a as Je,I as M,g as Ce,f as Me,b as _e,c as le,s as ee,i as ve,d as F,e as J,P as Ve,h as Xe}from"../chunks/singletons.c5f6caef.js";function Ze(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function Qe(t){return t.split("%25").map(decodeURI).join("%25")}function et(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const tt=["href","pathname","search","searchParams","toString","toJSON"];function nt(t,r){const u=new URL(t);for(const s of tt)Object.defineProperty(u,s,{get(){return r(),t[s]},enumerable:!0,configurable:!0});return at(u),u}function at(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const rt="/__data.json";function ot(t){return t.replace(/\/$/,"")+rt}function it(...t){let r=5381;for(const u of t)if(typeof u=="string"){let s=u.length;for(;s;)r=r*33^u.charCodeAt(--s)}else if(ArrayBuffer.isView(u)){const s=new Uint8Array(u.buffer,u.byteOffset,u.byteLength);let d=s.length;for(;d;)r=r*33^s[--d]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const fe=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ne.delete(ke(t)),fe(t,r));const ne=new Map;function st(t,r){const u=ke(t,r),s=document.querySelector(u);if(s!=null&&s.textContent){const{body:d,...f}=JSON.parse(s.textContent),E=s.getAttribute("data-ttl");return E&&ne.set(u,{body:d,init:f,ttl:1e3*Number(E)}),Promise.resolve(new Response(d,f))}return fe(t,r)}function ct(t,r,u){if(ne.size>0){const s=ke(t,u),d=ne.get(s);if(d){if(performance.now()<d.ttl&&["default","force-cache","only-if-cached",void 0].includes(u==null?void 0:u.cache))return new Response(d.body,d.init);ne.delete(s)}}return fe(r,u)}function ke(t,r){let s=`script[data-sveltekit-fetched][data-url=${JSON.stringify(t instanceof Request?t.url:t)}]`;if(r!=null&&r.headers||r!=null&&r.body){const d=[];r.headers&&d.push([...new Headers(r.headers)].join(",")),r.body&&(typeof r.body=="string"||ArrayBuffer.isView(r.body))&&d.push(r.body),s+=`[data-hash="${it(...d)}"]`}return s}const lt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function ft(t){const r=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${dt(t).map(s=>{const d=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(s);if(d)return r.push({name:d[1],matcher:d[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const f=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(s);if(f)return r.push({name:f[1],matcher:f[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!s)return;const E=s.split(/\[(.+?)\](?!\])/);return"/"+E.map((w,p)=>{if(p%2){if(w.startsWith("x+"))return be(String.fromCharCode(parseInt(w.slice(2),16)));if(w.startsWith("u+"))return be(String.fromCharCode(...w.slice(2).split("-").map(U=>parseInt(U,16))));const g=lt.exec(w);if(!g)throw new Error(`Invalid param: ${w}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,D,x,k,N]=g;return r.push({name:k,matcher:N,optional:!!D,rest:!!x,chained:x?p===1&&E[0]==="":!1}),x?"(.*?)":D?"([^/]*)?":"([^/]+?)"}return be(w)}).join("")}).join("")}/?$`),params:r}}function ut(t){return!/^\([^)]+\)$/.test(t)}function dt(t){return t.slice(1).split("/").filter(ut)}function pt(t,r,u){const s={},d=t.slice(1);let f=0;for(let E=0;E<r.length;E+=1){const l=r[E];let w=d[E-f];if(l.chained&&l.rest&&f&&(w=d.slice(E-f,E+1).filter(p=>p).join("/"),f=0),w===void 0){l.rest&&(s[l.name]="");continue}if(!l.matcher||u[l.matcher](w)){s[l.name]=w;const p=r[E+1],g=d[E+1];p&&!p.rest&&p.optional&&g&&l.chained&&(f=0);continue}if(l.optional&&l.chained){f++;continue}return}if(!f)return s}function be(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function ht({nodes:t,server_loads:r,dictionary:u,matchers:s}){const d=new Set(r);return Object.entries(u).map(([l,[w,p,g]])=>{const
`:l.decode(x);;){const k=p.indexOf(`
`);if(k===-1)break;const N=JSON.parse(p.slice(0,k));if(p=p.slice(k+1),N.type==="redirect")return d(N);if(N.type==="data")(g=N.nodes)==null||g.forEach(U=>{(U==null?void 0:U.type)==="data"&&(U.uses=We(U.uses),U.data=w(U.data))}),d(N);else if(N.type==="chunk"){const{id:U,data:H,error:B}=N,V=f.get(U);f.delete(U),B?V.reject(w(B)):V.fulfil(w(H))}}}})}function We(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url)}}function Se(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const r=document.body,u=r.getAttribute("tabindex");r.tabIndex=-1,r.focus({preventScroll:!0,focusVisible:!1}),u!==null?r.setAttribute("tabindex",u):r.removeAttribute("tabindex");const s=getSelection();if(s&&s.type!=="None"){const d=[];for(let f=0;f<s.rangeCount;f+=1)d.push(s.getRangeAt(f));setTimeout(()=>{if(s.rangeCount===d.length){for(let f=0;f<s.rangeCount;f+=1){const E=d[f],l=s.getRangeAt(f);if(E.commonAncestorContainer!==l.commonAncestorContainer||E.startContainer!==l.startContainer||E.endContainer!==l.endContainer||E.startOffset!==l.startOffset||E.endOffset!==l.endOffset)return}s.removeAllRanges()}})}}}function Be(t,r,u,s){var w,p;let d,f;const E=new Promise((g,D)=>{d=g,f=D});return E.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((w=t.route)==null?void 0:w.id)??null},url:t.url},to:u&&{params:(r==null?void 0:r.params)??null,route:{id:((p=r==null?void 0:r.route)==null?void 0:p.id)??null},url:u},willUnload:!r,type:s,complete:E},fulfil:d,reject:f}}async function Ot(t,r,u){const s=It(t,r);Xe({client:s}),u?await s._hydrate(u):s.goto(location.href,{replaceState:!0}),s._start_router()}export{Ot as start};