Buckets:

download
raw
29 kB
import{a$ as xe,o as Ve,q as A,i as U,m as T,af as ae,b2 as bt,b3 as kt}from"./CNc7KuUZ.js";const Et="1783406415745",L=globalThis.__sveltekit_1ga773w?.base??"/docs/diffusers/pr_13881/ko",St=globalThis.__sveltekit_1ga773w?.assets??L??"";new URL("sveltekit-internal://");function Rt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function xt(e){return e.split("%25").map(decodeURI).join("%25")}function Lt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function ve({href:e}){return e.split("#")[0]}function At(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...u)=>(n(c),s[o](c,...u));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}const Ut=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/,Tt=/^\/\((?:[^)]+)\)$/;function Pt(e){const t=[];return{pattern:e==="/"||Tt.test(e)?/^\/$/:new RegExp(`^${Ot(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return we(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return we(String.fromCharCode(...l.slice(2).split("-").map(_=>parseInt(_,16))));const u=Ut.exec(l),[,g,f,d,h]=u;return t.push({name:d,matcher:h,optional:!!g,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":g?"([^/]*)?":"([^/]+?)"}return we(l)}).join("")}).join("")}/?$`),params:t}}function It(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Ot(e){return e.slice(1).split("/").filter(It)}function $t(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(u=>u).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const u=t[o+1],g=a[o+1];u&&!u.rest&&u.optional&&g&&l.chained&&(s=0),!u&&!g&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function we(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}class Le{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Ae{constructor(t,n){try{new Headers({location:n})}catch{throw new Error(`Invalid redirect location ${JSON.stringify(n)}: this string contains characters that cannot be used in HTTP headers`)}this.status=t,this.location=n}}class Ue extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}function I(){}function Ct(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;function Nt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const jt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&z.delete(Te(e)),jt(e,t));const z=new Map;function qt(e,t){const n=Te(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);r.getAttribute("data-b64")!==null&&(a=Nt(a));const o=r.getAttribute("data-ttl");return o&&z.set(n,{body:a,init:i,ttl:1e3*Number(o)}),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Dt(e,t,n){if(z.size>0){const r=Te(e,n),a=z.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);z.delete(r)}}return window.fetch(t,n)}function Te(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${Ct(...a)}"]`}return r}function Mt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,u]])=>{const{pattern:g,params:f}=Pt(o),d={id:o,exec:h=>{const _=g.exec(h);if(_)return $t(_,f,r)},errors:[1,...u||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Xe(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function He(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const Qe="sveltekit:snapshot",Ze="sveltekit:scroll",et="sveltekit:states",Vt="sveltekit:pageurl",H="sveltekit:history",X="sveltekit:navigation",q={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Pe=location.origin;function tt(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function D(){return{x:pageXOffset,y:pageYOffset}}function M(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Be={...q,"":q.hover};function nt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function rt(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=nt(e)}}function ke(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||pe(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===Pe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function oe(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=M(o,"preload-code")),a===null&&(a=M(o,"preload-data")),t===null&&(t=M(o,"keepfocus")),n===null&&(n=M(o,"noscroll")),i===null&&(i=M(o,"reload")),s===null&&(s=M(o,"replacestate")),o=nt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Be[r??"off"],preload_data:Be[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function Fe(e){const t=xe(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const at={v:I};function Ht(){const{set:e,subscribe:t}=xe(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${St}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==Et;return s&&(e(!0),at.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function pe(e,t,n){return e.origin!==Pe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function _n(e){}const ot=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...ot];const Bt=new Set([...ot]);[...Bt];function Ft(e){return e.filter(t=>t!=null)}function ne(e,t){return e+"/"+t}function Ie(e){return e instanceof Le||e instanceof Ue?e.status:500}function Kt(e){return e instanceof Ue?e.text:"Internal Error"}let S,Q,ye;const Gt=Ve.toString().includes("$$")||/function \w+\(\) \{\}/.test(Ve.toString()),Ke="a:";Gt?(S={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL(Ke)},Q={current:null},ye={current:!1}):(S=new class{#e=A({});get data(){return U(this.#e)}set data(t){T(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){T(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){T(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){T(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){T(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){T(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){T(this.#s,t)}#i=A(new URL(Ke));get url(){return U(this.#i)}set url(t){T(this.#i,t)}},Q=new class{#e=A(null);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},ye=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){T(this.#e,t)}},at.v=()=>ye.current=!0);function st(e){Object.assign(S,e)}const Ge={spanContext(){return Jt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Jt={traceId:"",spanId:"",traceFlags:0},{onMount:Wt}=bt,Yt=new Set(["icon","shortcut icon","apple-touch-icon"]);let W=null;const j=Xe(Ze)??{},Z=Xe(Qe)??{},N={url:Fe({}),page:Fe({}),navigating:xe(null),updated:Ht()};function Oe(e){j[e]=D()}function zt(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;Z[n];)delete Z[n],n+=1}function ee(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(I)}async function it(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(L||"/");e&&await e.update()}}let $e,Ee,se,P,Se,w;const ie=[],le=[];let R=null;function ce(){R?.fork?.then(e=>e?.discard()),R=null,V={element:void 0,href:void 0}}const re=new Map,lt=new Set,Xt=new Set,B=new Set;let v={branch:[],error:null,url:null},ct=!1,ue=!1,Je=!0,te=!1,Y=!1,ut=!1,Ce=!1,ft,y,x,C;const fe=new Set,We=new Map,Ye=new Map;async function bn(e,t,n){if(globalThis.__sveltekit_1ga773w.data){const{q:i={},p:s={},l:o={},f:l={}}=globalThis.__sveltekit_1ga773w.data;for(const c in i)i[c];for(const c in o)o[c];for(const c in l)l[c];for(const c in s)s[c]}document.URL!==location.href&&(location.href=location.href),w=e,await e.hooks.init?.(),$e=Mt(e),P=document.documentElement,Se=t,Ee=e.nodes[0],se=e.nodes[1],Ee(),se(),y=history.state?.[H],x=history.state?.[X],y||(y=x=Date.now(),history.replaceState({...history.state,[H]:y,[X]:x},""));const r=j[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await dn(Se,n)):(await F({type:"enter",url:tt(w.hash?gn(new URL(location.href)):location.href),replace_state:!0}),a()),fn()}function Qt(){ie.length=0,Ce=!1}function dt(e){le.some(t=>t?.snapshot)&&(Z[e]=le.map(t=>t?.snapshot?.capture()))}function ht(e){Z[e]?.forEach((t,n)=>{le[n]?.snapshot?.restore(t)})}function ze(){Oe(y),He(Ze,j),dt(x),He(Qe,Z)}async function Zt(e,t,n,r){let a,i;t.invalidateAll&&ce(),await F({type:"goto",url:tt(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{if(t.invalidateAll){Ce=!0,a=new Set;for(const[s,o]of We)for(const[l,c]of o)c.resource?.reset(),a.add(ne(s,l));i=new Set;for(const[s,o]of Ye)for(const l of o.keys())i.add(ne(s,l))}t.invalidate&&t.invalidate.forEach(un)}}),t.invalidateAll&&ae().then(ae).then(()=>{for(const[s,o]of We)for(const[l,{resource:c}]of o)a?.has(ne(s,l))&&c.start();for(const[s,o]of Ye)for(const[l,{resource:c}]of o)i?.has(ne(s,l))&&c.reconnect()})}async function en(e){if(e.id!==R?.id){ce();const t={};fe.add(t),R={id:e.id,token:t,promise:mt({...e,preload:t}).then(n=>(fe.delete(t),n.type==="loaded"&&n.state.error&&ce(),n)),fork:null}}return R.promise}async function be(e){const t=(await ge(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function pt(e,t,n){const r={params:v.params,route:{id:v.route?.id??null},url:new URL(location.href)};if(v={...e.state,nav:r},st(e.props.page),ft=new w.root({target:t,props:{...e.props,stores:N,components:le},hydrate:n,sync:!1,transformError:void 0}),await Promise.resolve(),n){const a={from:null,to:{...r,scroll:j[y]??D()},willUnload:!1,type:"enter",complete:Promise.resolve()};B.forEach(i=>i(a))}ht(x),ue=!0}async function de({url:e,params:t,branch:n,errors:r,status:a,error:i,route:s,form:o}){let l="never";if(L&&(e.pathname===L||e.pathname===L+"/"))l="always";else for(const h of n)h?.slash!==void 0&&(l=h.slash);e.pathname=Rt(e.pathname,l),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:i,route:s},props:{constructors:Ft(n).map(h=>h.node.component),page:Me(S)}};o!==void 0&&(c.props.form=o);let u={},g=!S,f=0;for(let h=0;h<Math.max(n.length,v.branch.length);h+=1){const _=n[h],m=v.branch[h];_?.data!==m?.data&&(g=!0),_&&(u={...u,..._.data},g&&(c.props[`data_${f}`]=u),f+=1)}return(!v.url||e.href!==v.url.href||v.error!==i||o!==void 0&&o!==S.form||g)&&(c.props.page={error:i,params:t,route:{id:s?.id??null},state:{},status:a,url:new URL(e),form:o??null,data:g?u:S.data}),c}async function Ne({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let u=function(...f){for(const d of f){const{href:h}=new URL(d,n);l.dependencies.add(h)}};const g={tracing:{enabled:!1,root:Ge,current:Ge},route:new Proxy(a,{get:(f,d)=>(o&&(l.route=!0),f[d])}),params:new Proxy(r,{get:(f,d)=>(o&&l.params.add(d),f[d])}),data:i?.data??null,url:At(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},w.hash),async fetch(f,d){f instanceof Request&&(d={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...d});const{resolved:h,promise:_}=gt(f,d,n);return o&&u(h.href),_},setHeaders:I,depends:u,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,g)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=ue?Dt(r,a.href,t):qt(r,t);return{resolved:a,promise:i}}function tn(e,t,n,r,a,i){if(Ce)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==v.params[s])return!0;for(const s of a.dependencies)if(ie.some(o=>o(new URL(s))))return!0;return!1}function je(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function nn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function rn({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Me(S),constructors:[]}}}async function mt({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(R?.id===e)return fe.delete(R.token),R.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(m=>m?.().catch(I)),c.forEach(m=>m?.[1]().catch(I));const u=v.url?e!==he(v.url):!1,g=v.route?a.id!==v.route.id:!1,f=nn(v.url,n);let d=!1;const h=c.map(async(m,p)=>{if(!m)return;const b=v.branch[p];return m[1]===b?.loader&&!tn(d,g,u,f,b.universal?.uses,r)?b:(d=!0,Ne({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let $=0;$<p;$+=1)Object.assign(O,(await h[$])?.data);return O},server_data_node:je(m[0]?{type:"skip"}:null,m[0]?b?.server:void 0)}))});for(const m of h)m.catch(I);const _=[];for(let m=0;m<c.length;m+=1)if(c[m])try{_.push(await h[m])}catch(p){if(p instanceof Ae)return{type:"redirect",location:p.location};if(i&&fe.has(i))return rn({error:await K(p,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let b=Ie(p),E;if(p instanceof Le)E=p.body;else{if(await N.updated.check())return await it(),await ee(n);E=await K(p,{params:r,url:n,route:{id:a.id}})}const O=await an(m,_,s);return O?de({url:n,params:r,branch:_.slice(0,O.idx).concat(O.node),errors:s,status:b,error:E,route:a}):await vt(n,{id:a.id},E,b)}else _.push(void 0);return de({url:n,params:r,branch:_,errors:s,status:200,error:null,route:a,form:t?void 0:null})}async function an(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function qe({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await Ne({loader:Ee,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:je(i)}),o={node:await se(),loader:se,universal:null,server:null,data:null};return de({url:n,params:a,branch:[s,o],status:e,error:t,errors:[],route:null})}catch(s){if(s instanceof Ae){await Zt(new URL(s.location,location.href),{},0);return}const o=await w.get_error_template(),l=await K(s,{url:n,params:a,route:r}),c=String(l?.message??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),u=o({status:e,message:c}),g=new DOMParser().parseFromString(u,"text/html");throw document.documentElement.replaceChild(document.adoptNode(g.head),document.head),document.documentElement.replaceChild(document.adoptNode(g.body),document.body),s}}async function on(e){const t=e.href;if(re.has(t))return re.get(t);let n;try{const r=(async()=>{let a=await w.hooks.reroute({url:new URL(e),fetch:async(i,s)=>gt(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);w.hash?i.hash=a:i.pathname=a,a=i}return a})();re.set(t,r),n=await r}catch{re.delete(t);return}return n}async function ge(e,t){if(e&&!pe(e,L,w.hash)){const n=await on(e);if(!n)return;const r=sn(n);for(const a of $e){const i=a.exec(r);if(i)return{id:he(e),invalidating:t,route:a,params:Lt(i),url:e}}}}function sn(e){return xt(w.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(L.length))||"/"}function he(e){return(w.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function _t({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=De(v,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return te||lt.forEach(c=>c(l)),s?null:o}async function F({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=I,block:u=I,event:g}){const f=C;C=l;const d=await ge(t,!1),h=e==="enter"?De(v,d,t,e):_t({url:t,type:e,delta:n?.delta,intent:d,scroll:n?.scroll,event:g});if(!h){u(),C===l&&(C=f);return}const _=y,m=x;c(),te=!0,ue&&h.navigation.type!=="enter"&&N.navigating.set(Q.current=h.navigation);let p=d&&await mt(d);if(!p){if(pe(t,L,w.hash))return await ee(t,i);p=await vt(t,{id:null},await K(new Ue(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=d?.url||t,C!==l){h.reject(new Error("navigation aborted"));return}if(!p)return;if(p.type==="redirect"){if(o<20){await F({type:e,url:new URL(p.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}if(p=await qe({status:500,error:await K(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}}),!p)return}else if(p.props.page.status>=400&&await N.updated.check())return await it(),await ee(t,i);if(Qt(),Oe(_),dt(m),p.props.page.url.pathname!==t.pathname&&(t.pathname=p.props.page.url.pathname),s=n?n.state:s,!n){const k=i?0:1,G={[H]:y+=k,[X]:x+=k,[et]:s};(i?history.replaceState:history.pushState).call(history,G,"",t),i||zt(y,x)}const b=d&&R?.id===d.id?R.fork:null;R?.fork&&!b?ce():(R=null,V={element:void 0,href:void 0}),p.props.page.state=s;let E;if(ue){const k=(await Promise.all(Array.from(Xt,J=>J(h.navigation)))).filter(J=>typeof J=="function");if(k.length>0){let J=function(){k.forEach(_e=>{B.delete(_e)})};k.push(J),k.forEach(_e=>{B.add(_e)})}const G=h.navigation.to;v={...p.state,nav:{params:G.params,route:G.route,url:G.url}},p.props.page&&(p.props.page.url=t),!r&&document.activeElement instanceof HTMLElement&&document.activeElement!==document.body&&document.activeElement.blur();const me=b&&await b;me?E=me.commit():(W=null,ft.$set(p.props),W&&Object.assign(p.props.page,W),st(p.props.page),E=kt?.()),ut=!0}else await pt(p,Se,!1);const{activeElement:O}=document;if(await E,await ae(),await ae(),C!==l){h.reject(new Error("navigation aborted"));return}p.props.page&&W&&Object.assign(p.props.page,W);let $=null;if(Je){const k=n?n.scroll:a?D():null;k?scrollTo(k.x,k.y):($=t.hash&&document.getElementById(wt(t)))?$.scrollIntoView():scrollTo(0,0)}const yt=document.activeElement!==O&&document.activeElement!==document.body;!r&&!yt&&pn(t,!$),Je=!0,te=!1,h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=D()),B.forEach(k=>k(h.navigation)),e==="popstate"&&ht(x),N.navigating.set(Q.current=null)}async function vt(e,t,n,r,a){return e.origin===Pe&&e.pathname===location.pathname&&!ct?await qe({status:r,error:n,url:e,route:t}):await ee(e,a)}let V={element:void 0,href:void 0};function ln(){let e,t;P.addEventListener("mousemove",s=>{const o=s.target;clearTimeout(e),e=setTimeout(()=>{a(o,q.hover)},20)});function n(s){s.defaultPrevented||a(s.composedPath()[0],q.tap)}P.addEventListener("mousedown",n),P.addEventListener("touchstart",n,{passive:!0});const r=new IntersectionObserver(s=>{for(const o of s)o.isIntersecting&&(be(new URL(o.target.href)),r.unobserve(o.target))},{threshold:0});async function a(s,o){const l=rt(s,P),c=l===V.element&&l?.href===V.href&&o>=t;if(!l||c)return;const{url:u,external:g,download:f}=ke(l,L,w.hash);if(g||f)return;const d=oe(l),h=u&&he(v.url)===he(u);if(!(d.reload||h))if(o<=d.preload_data){V={element:l,href:l.href},t=q.tap;const _=await ge(u,!1);if(!_)return;en(_)}else o<=d.preload_code&&(V={element:l,href:l.href},t=o,be(u))}function i(){r.disconnect();for(const s of P.querySelectorAll("a")){const{url:o,external:l,download:c}=ke(s,L,w.hash);if(l||c)continue;const u=oe(s);u.reload||(u.preload_code===q.viewport&&r.observe(s),u.preload_code===q.eager&&be(o))}}B.add(i),i()}function K(e,t){if(e instanceof Le)return e.body;const n=Ie(e),r=Kt(e);return w.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function cn(e,t){Wt(()=>(e.add(t),()=>{e.delete(t)}))}function kn(e){cn(B,e)}function un(e){if(typeof e=="function")ie.push(e);else{const{href:t}=new URL(e,location.href);ie.push(n=>n.href===t)}}function fn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(ze(),!te){const r=De(v,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};lt.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ze()}),navigator.connection?.saveData||ln(),P.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=rt(t.composedPath()[0],P);if(!n)return;const{url:r,external:a,target:i,download:s}=ke(n,L,w.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=oe(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,u]=(w.hash?r.hash.replace(/^#/,""):r.href).split("#"),g=c===ve(location);if(a||o.reload&&(!g||!u)){_t({url:r,type:"link",event:t})?te=!0:t.preventDefault();return}if(u!==void 0&&g){const[,f]=v.url.href.split("#");if(f===u){if(t.preventDefault(),u===""||u==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const d=n.ownerDocument.getElementById(decodeURIComponent(u));d&&(d.scrollIntoView(),d.focus())}return}if(Y=!0,Oe(y),e(r),!o.replace_state)return;Y=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await F({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),P.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(pe(s,L,!1))return;const o=t.target,l=oe(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),F({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Re){if(t.state?.[H]){const n=t.state[H];if(C={},n===y)return;const r=j[n],a=t.state[et]??{},i=new URL(t.state[Vt]??location.href),s=t.state[X],o=v.url?ve(location)===ve(v.url):!1;if(s===x&&(ut||o)){a!==S.state&&(S.state=a),e(i),j[y]=D(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await F({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,x=s},block:()=>{history.go(-c)},nav_token:C,event:t})}else if(!Y){const n=new URL(location.href);e(n),w.hash&&location.reload()}}}),addEventListener("hashchange",()=>{Y&&(Y=!1,history.replaceState({...history.state,[H]:++y,[X]:x},"",location.href))});for(const t of document.querySelectorAll("link"))Yt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&N.navigating.set(Q.current=null)});function e(t){v.url=S.url=t,N.page.set(Me(S)),N.page.notify()}}async function dn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){ct=!0;const c=new URL(location.href);let u;({params:a={},route:i={id:null}}=await ge(c,!1)||{}),u=$e.find(({id:d})=>d===i.id);let g,f=!0;try{const d=r.map(async(_,m)=>{const p=o[m];return p?.uses&&(p.uses=hn(p.uses)),Ne({loader:w.nodes[_],url:c,params:a,route:i,parent:async()=>{const b={};for(let E=0;E<m;E+=1)Object.assign(b,(await d[E]).data);return b},server_data_node:je(p)})}),h=await Promise.all(d);if(u){const _=u.layouts;for(let m=0;m<_.length;m++)_[m]||h.splice(m,0,void 0)}g=await de({url:c,params:a,branch:h,status:t,error:n,errors:u?.errors,form:l,route:u??null})}catch(d){if(d instanceof Ae)return await ee(new URL(d.location,location.href));g=await qe({status:Ie(d),error:await K(d,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}g&&(g.props.page&&(g.props.page.state={}),await pt(g,e,f))}function hn(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Re=!1;function pn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=wt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=D();setTimeout(()=>{const o=history.state;Re=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),Re=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function De(e,t,n,r,a=null){let i,s;const o=new Promise((c,u)=>{i=c,s=u});return o.catch(I),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:D()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function Me(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function gn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function wt(e){let t;if(w.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{kn as a,bn as b,_n as l,S as p,N as s};

Xet Storage Details

Size:
29 kB
·
Xet hash:
33f8d2de9197de38a3c85a920277e7a408a8ca0cfdecb0922328ce66ad3532ef

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.