diff --git a/playground/static/main.wasm b/playground/static/main.wasm index a68d48f..b06a11e 100644 Binary files a/playground/static/main.wasm and b/playground/static/main.wasm differ diff --git a/server/playground/_app/immutable/chunks/BsPC8ki2.js b/server/playground/_app/immutable/chunks/BsPC8ki2.js deleted file mode 100644 index a06781b..0000000 --- a/server/playground/_app/immutable/chunks/BsPC8ki2.js +++ /dev/null @@ -1,3 +0,0 @@ -import{w as Ae,o as je,c as _t}from"./B1lAeocp.js";import{aZ as U,g as L,W as P,aY as $e}from"./bc36GTfJ.js";class ce{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 Se{constructor(t,n){this.status=t,this.location=n}}class Re extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function yt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function wt(e){return e.split("%25").map(decodeURI).join("%25")}function vt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function bt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return f=>(n(f),i[o](f));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function kt(...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;const Et=new TextDecoder;function At(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&Y.delete(Te(e)),St(e,t));const Y=new Map;function Rt(e,t){const n=Te(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&Y.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=At(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Tt(e,t,n){if(Y.size>0){const r=Te(e,n),a=Y.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(w=>parseInt(w,16))));const d=It.exec(c),[,p,u,l,h]=d;return t.push({name:l,matcher:h,optional:!!p,rest:!!u,chained:u?f===1&&i[0]==="":!1}),u?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function Lt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Pt(e){return e.slice(1).split("/").filter(Lt)}function xt(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;od).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](f)){r[c.name]=f;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&c.chained&&(i=0),!d&&!p&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ct({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,f,d]])=>{const{pattern:p,params:u}=Ut(o),l={id:o,exec:h=>{const w=p.exec(h);if(w)return xt(w,u,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...f||[]].map(i),leaf:s(c)};return l.errors.length=l.layouts.length=Math.max(l.errors.length,l.layouts.length),l});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function We(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function De(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const I=globalThis.__sveltekit_ahim6y?.base??"/_playground",Nt=globalThis.__sveltekit_ahim6y?.assets??I??"",Ot="1759702763367",Je="sveltekit:snapshot",ze="sveltekit:scroll",Xe="sveltekit:states",jt="sveltekit:pageurl",B="sveltekit:history",W="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},le=location.origin;function Ze(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 fe(){return{x:pageXOffset,y:pageYOffset}}function F(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Fe={...j,"":j.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function et(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function ve(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,s=!r||!!a||ue(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=r?.origin===le&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function ee(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),s===null&&(s=F(o,"reload")),i===null&&(i=F(o,"replacestate")),o=Qe(o);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Fe[r??"off"],preload_data:Fe[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Be(e){const t=Ae(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const tt={v:()=>{}};function $t(){const{set:e,subscribe:t}=Ae(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Nt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Ot;return i&&(e(!0),tt.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function ue(e,t,n){return e.origin!==le||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function Sn(e){}function Dt(e){const t=Bt(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const Vt=-1,Mt=-2,qt=-3,Gt=-4,Yt=-5,Ht=-6;function Kt(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===Vt)return;if(s===qt)return NaN;if(s===Gt)return 1/0;if(s===Yt)return-1/0;if(s===Ht)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],f=t?.[c];if(f)return r[s]=f(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let l=1;lt!=null)}const zt="x-sveltekit-invalidated",Xt="x-sveltekit-trailing-slash";function te(e){return e instanceof ce||e instanceof Re?e.status:500}function Zt(e){return e instanceof Re?e.text:"Internal Error"}let S,J,ye;const Qt=je.toString().includes("$$")||/function \w+\(\) \{\}/.test(je.toString());Qt?(S={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},ye={current:!1}):(S=new class{#e=U({});get data(){return L(this.#e)}set data(t){P(this.#e,t)}#t=U(null);get form(){return L(this.#t)}set form(t){P(this.#t,t)}#n=U(null);get error(){return L(this.#n)}set error(t){P(this.#n,t)}#r=U({});get params(){return L(this.#r)}set params(t){P(this.#r,t)}#a=U({id:null});get route(){return L(this.#a)}set route(t){P(this.#a,t)}#o=U({});get state(){return L(this.#o)}set state(t){P(this.#o,t)}#s=U(-1);get status(){return L(this.#s)}set status(t){P(this.#s,t)}#i=U(new URL("https://example.com"));get url(){return L(this.#i)}set url(t){P(this.#i,t)}},J=new class{#e=U(null);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},ye=new class{#e=U(!1);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},tt.v=()=>ye.current=!0);function en(e){Object.assign(S,e)}const tn="/__data.json",nn=".html__data.json";function rn(e){return e.endsWith(".html")?e.replace(/\.html$/,nn):e.replace(/\/$/,"")+tn}const Ve={spanContext(){return an},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}},an={traceId:"",spanId:"",traceFlags:0},{tick:on}=_t,sn=new Set(["icon","shortcut icon","apple-touch-icon"]),D=We(ze)??{},z=We(Je)??{},O={url:Be({}),page:Be({}),navigating:Ae(null),updated:$t()};function Ie(e){D[e]=fe()}function cn(e,t){let n=e+1;for(;D[n];)delete D[n],n+=1;for(n=t+1;z[n];)delete z[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function rt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(I||"/");e&&await e.update()}}function Me(){}let Ue,be,ne,x,ke,v;const re=[],ae=[];let C=null;const Q=new Map,at=new Set,ln=new Set,H=new Set;let y={branch:[],error:null,url:null},Le=!1,oe=!1,qe=!0,X=!1,G=!1,ot=!1,Pe=!1,st,A,T,$;const K=new Set,Ge=new Map;async function Un(e,t,n){globalThis.__sveltekit_ahim6y?.data&&globalThis.__sveltekit_ahim6y.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Ue=Ct(e),x=document.documentElement,ke=t,be=e.nodes[0],ne=e.nodes[1],be(),ne(),A=history.state?.[B],T=history.state?.[W],A||(A=T=Date.now(),history.replaceState({...history.state,[B]:A,[W]:T},""));const r=D[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await vn(ke,n)):(await V({type:"enter",url:Ze(v.hash?kn(new URL(location.href)):location.href),replace_state:!0}),a()),wn()}function fn(){re.length=0,Pe=!1}function it(e){ae.some(t=>t?.snapshot)&&(z[e]=ae.map(t=>t?.snapshot?.capture()))}function ct(e){z[e]?.forEach((t,n)=>{ae[n]?.snapshot?.restore(t)})}function Ye(){Ie(A),De(ze,D),it(T),De(Je,z)}async function un(e,t,n,r){let a;t.invalidateAll&&(C=null),await V({type:"goto",url:Ze(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Pe=!0,a=[...Ge.keys()]),t.invalidate&&t.invalidate.forEach(yn)}}),t.invalidateAll&&$e().then($e).then(()=>{Ge.forEach(({resource:s},i)=>{a?.includes(i)&&s.refresh?.()})})}async function dn(e){if(e.id!==C?.id){const t={};K.add(t),C={id:e.id,token:t,promise:ut({...e,preload:t}).then(n=>(K.delete(t),n.type==="loaded"&&n.state.error&&(C=null),n))}}return C.promise}async function we(e){const t=(await he(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}function lt(e,t,n){y=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(S,e.props.page),st=new v.root({target:t,props:{...e.props,stores:O,components:ae},hydrate:n,sync:!1}),ct(T),n){const a={from:null,to:{params:y.params,route:{id:y.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};H.forEach(s=>s(a))}oe=!0}function se({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if(I&&(e.pathname===I||e.pathname===I+"/"))o="always";else for(const l of n)l?.slash!==void 0&&(o=l.slash);e.pathname=yt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:Jt(n).map(l=>l.node.component),page:Oe(S)}};i!==void 0&&(c.props.form=i);let f={},d=!S,p=0;for(let l=0;l(o&&(c.route=!0),u[l])}),params:new Proxy(r,{get:(u,l)=>(o&&c.params.add(l),u[l])}),data:s?.data??null,url:bt(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},v.hash),async fetch(u,l){u instanceof Request&&(l={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u?.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...l});const{resolved:h,promise:w}=ft(u,l,n);return o&&d(h.href),w},setHeaders:()=>{},depends:d,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await f.universal.load.call(null,p)??null}return{node:f,loader:e,server:s,universal:f.universal?.load?{type:"data",data:i,uses:c}:null,data:i??s?.data??null,slash:f.universal?.trailingSlash??s?.slash}}function ft(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 s=oe?Tt(r,a.href,t):Rt(r,t);return{resolved:a,promise:s}}function He(e,t,n,r,a,s){if(Pe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==y.params[i])return!0;for(const i of a.dependencies)if(re.some(o=>o(new URL(i))))return!0;return!1}function Ce(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function hn(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),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function Ke({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Oe(S),constructors:[]}}}async function ut({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if(C?.id===e)return K.delete(C.token),C.promise;const{errors:i,layouts:o,leaf:c}=a,f=[...o,c];i.forEach(_=>_?.().catch(()=>{})),f.forEach(_=>_?.[1]().catch(()=>{}));let d=null;const p=y.url?e!==ie(y.url):!1,u=y.route?a.id!==y.route.id:!1,l=hn(y.url,n);let h=!1;const w=f.map((_,g)=>{const b=y.branch[g],k=!!_?.[0]&&(b?.loader!==_[1]||He(h,u,p,l,b.server?.uses,r));return k&&(h=!0),k});if(w.some(Boolean)){try{d=await pt(n,w)}catch(_){const g=await M(_,{url:n,params:r,route:{id:e}});return K.has(s)?Ke({error:g,url:n,params:r,route:a}):de({status:te(_),error:g,url:n,route:a})}if(d.type==="redirect")return d}const E=d?.nodes;let m=!1;const N=f.map(async(_,g)=>{if(!_)return;const b=y.branch[g],k=E?.[g];if((!k||k.type==="skip")&&_[1]===b?.loader&&!He(m,u,p,l,b.universal?.uses,r))return b;if(m=!0,k?.type==="error")throw k;return xe({loader:_[1],url:n,params:r,route:a,parent:async()=>{const pe={};for(let ge=0;ge{});const R=[];for(let _=0;_Promise.resolve({}),server_data_node:Ce(s)}),c={node:await ne(),loader:ne,universal:null,server:null,data:null};return se({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Se)return un(new URL(o.location,location.href),{},0);throw o}}async function gn(e){const t=e.href;if(Q.has(t))return Q.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(s,i)=>ft(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);v.hash?s.hash=a:s.pathname=a,a=s}return a})();Q.set(t,r),n=await r}catch{Q.delete(t);return}return n}async function he(e,t){if(e&&!ue(e,I,v.hash)){const n=await gn(e);if(!n)return;const r=mn(n);for(const a of Ue){const s=a.exec(r);if(s)return{id:ie(e),invalidating:t,route:a,params:vt(s),url:e}}}}function mn(e){return wt(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(I.length))||"/"}function ie(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function dt({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=Ne(y,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||at.forEach(c=>c(o)),s?null:i}async function V({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:f=Me,block:d=Me,event:p}){const u=$;$=c;const l=await he(t,!1),h=e==="enter"?Ne(y,l,t,e):dt({url:t,type:e,delta:n?.delta,intent:l,event:p});if(!h){d(),$===c&&($=u);return}const w=A,E=T;f(),X=!0,oe&&h.navigation.type!=="enter"&&O.navigating.set(J.current=h.navigation);let m=l&&await ut(l);if(!m){if(ue(t,I,v.hash))return await q(t,s);m=await ht(t,{id:null},await M(new Re(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=l?.url||t,$!==c)return h.reject(new Error("navigation aborted")),!1;if(m.type==="redirect"){if(o<20){await V({type:e,url:new URL(m.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),h.fulfil(void 0);return}m=await de({status:500,error:await M(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else m.props.page.status>=400&&await O.updated.check()&&(await rt(),await q(t,s));if(fn(),Ie(w),it(E),m.props.page.url.pathname!==t.pathname&&(t.pathname=m.props.page.url.pathname),i=n?n.state:i,!n){const g=s?0:1,b={[B]:A+=g,[W]:T+=g,[Xe]:i};(s?history.replaceState:history.pushState).call(history,b,"",t),s||cn(A,T)}if(C=null,m.props.page.state=i,oe){const g=(await Promise.all(Array.from(ln,b=>b(h.navigation)))).filter(b=>typeof b=="function");if(g.length>0){let b=function(){g.forEach(k=>{H.delete(k)})};g.push(b),g.forEach(k=>{H.add(k)})}y=m.state,m.props.page&&(m.props.page.url=t),st.$set(m.props),en(m.props.page),ot=!0}else lt(m,ke,!1);const{activeElement:N}=document;await on();const R=n?n.scroll:a?fe():null;if(qe){const g=t.hash&&document.getElementById(mt(t));R?scrollTo(R.x,R.y):g?g.scrollIntoView():scrollTo(0,0)}const _=document.activeElement!==N&&document.activeElement!==document.body;!r&&!_&&bn(t),qe=!0,m.props.page&&Object.assign(S,m.props.page),X=!1,e==="popstate"&&ct(T),h.fulfil(void 0),H.forEach(g=>g(h.navigation)),O.navigating.set(J.current=null)}async function ht(e,t,n,r,a){return e.origin===le&&e.pathname===location.pathname&&!Le?await de({status:r,error:n,url:e,route:t}):await q(e,a)}function _n(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,j.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],j.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(we(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const f=et(o,x),d=f===t&&c>=n;if(!f||d)return;const{url:p,external:u,download:l}=ve(f,I,v.hash);if(u||l)return;const h=ee(f),w=p&&ie(y.url)===ie(p);if(!(h.reload||w))if(c<=h.preload_data){t=f,n=j.tap;const E=await he(p,!1);if(!E)return;dn(E)}else c<=h.preload_code&&(t=f,n=c,we(p))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:f,download:d}=ve(o,I,v.hash);if(f||d)continue;const p=ee(o);p.reload||(p.preload_code===j.viewport&&a.observe(o),p.preload_code===j.eager&&we(c))}}H.add(i),i()}function M(e,t){if(e instanceof ce)return e.body;const n=te(e),r=Zt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function yn(e){if(typeof e=="function")re.push(e);else{const{href:t}=new URL(e,location.href);re.push(n=>n.href===t)}}function wn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Ye(),!X){const r=Ne(y,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};at.forEach(s=>s(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ye()}),navigator.connection?.saveData||_n(),x.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=et(t.composedPath()[0],x);if(!n)return;const{url:r,external:a,target:s,download:i}=ve(n,I,v.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const o=ee(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||i)return;const[f,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=f===me(location);if(a||o.reload&&(!p||!d)){dt({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,u]=y.url.href.split("#");if(u===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const l=n.ownerDocument.getElementById(decodeURIComponent(d));l&&(l.scrollIntoView(),l.focus())}return}if(G=!0,Ie(A),e(r),!o.replace_state)return;G=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await V({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),x.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 i=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ue(i,I,!1))return;const o=t.target,c=ee(o);if(c.reload)return;t.preventDefault(),t.stopPropagation();const f=new FormData(o,r);i.search=new URLSearchParams(f).toString(),V({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ee){if(t.state?.[B]){const n=t.state[B];if($={},n===A)return;const r=D[n],a=t.state[Xe]??{},s=new URL(t.state[jt]??location.href),i=t.state[W],o=y.url?me(location)===me(y.url):!1;if(i===T&&(ot||o)){a!==S.state&&(S.state=a),e(s),D[A]=fe(),r&&scrollTo(r.x,r.y),A=n;return}const f=n-A;await V({type:"popstate",url:s,popped:{state:a,scroll:r,delta:f},accept:()=>{A=n,T=i},block:()=>{history.go(-f)},nav_token:$,event:t})}else if(!G){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++A,[W]:T},"",location.href))});for(const t of document.querySelectorAll("link"))sn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&O.navigating.set(J.current=null)});function e(t){y.url=S.url=t,O.page.set(Oe(S)),O.page.notify()}}async function vn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){Le=!0;const f=new URL(location.href);let d;({params:a={},route:s={id:null}}=await he(f,!1)||{}),d=Ue.find(({id:l})=>l===s.id);let p,u=!0;try{const l=r.map(async(w,E)=>{const m=o[E];return m?.uses&&(m.uses=gt(m.uses)),xe({loader:v.nodes[w],url:f,params:a,route:s,parent:async()=>{const N={};for(let R=0;Rs?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let s;throw a.headers.get("content-type")?.includes("application/json")?s=await a.json():a.status===404?s="Not Found":a.status===500&&(s="Internal Error"),new ce(a.status,s)}return new Promise(async s=>{const i=new Map,o=a.body.getReader();function c(d){return Kt(d,{...v.decoders,Promise:p=>new Promise((u,l)=>{i.set(p,{fulfil:u,reject:l})})})}let f="";for(;;){const{done:d,value:p}=await o.read();if(d&&!f)break;for(f+=!p&&f?` -`:Et.decode(p,{stream:!0});;){const u=f.indexOf(` -`);if(u===-1)break;const l=JSON.parse(f.slice(0,u));if(f=f.slice(u+1),l.type==="redirect")return s(l);if(l.type==="data")l.nodes?.forEach(h=>{h?.type==="data"&&(h.uses=gt(h.uses),h.data=c(h.data))}),s(l);else if(l.type==="chunk"){const{id:h,data:w,error:E}=l,m=i.get(h);i.delete(h),E?m.reject(c(E)):m.fulfil(c(w))}}}})}function gt(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 Ee=!1;function bn(e){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=mt(e);if(n&&document.getElementById(n)){const{x:a,y:s}=fe();setTimeout(()=>{const i=history.state;Ee=!0,location.replace(`#${n}`),v.hash&&location.replace(e.hash),history.replaceState(i,"",e.hash),scrollTo(a,s),Ee=!1})}else{const a=document.body,s=a.getAttribute("tabindex");a.tabIndex=-1,a.focus({preventScroll:!0,focusVisible:!1}),s!==null?a.setAttribute("tabindex",s):a.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s{if(r.rangeCount===a.length){for(let s=0;s{a=c,s=f});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function Oe(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 kn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function mt(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Un as a,Sn as l,S as p,O as s}; diff --git a/server/playground/_app/immutable/chunks/Dft7nOuB.js b/server/playground/_app/immutable/chunks/Dft7nOuB.js new file mode 100644 index 0000000..8fd95c0 --- /dev/null +++ b/server/playground/_app/immutable/chunks/Dft7nOuB.js @@ -0,0 +1,3 @@ +import{w as Ae,o as je,c as mt}from"./B1lAeocp.js";import{aZ as U,g as L,W as P,aY as $e}from"./bc36GTfJ.js";class ce{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 Se{constructor(t,n){this.status=t,this.location=n}}class Re extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function yt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function wt(e){return e.split("%25").map(decodeURI).join("%25")}function vt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function _e({href:e}){return e.split("#")[0]}function bt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return f=>(n(f),i[o](f));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function kt(...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;const Et=new TextDecoder;function At(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&Y.delete(Te(e)),St(e,t));const Y=new Map;function Rt(e,t){const n=Te(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&Y.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=At(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function Tt(e,t,n){if(Y.size>0){const r=Te(e,n),a=Y.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return me(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return me(String.fromCharCode(...c.slice(2).split("-").map(w=>parseInt(w,16))));const d=It.exec(c),[,p,u,l,h]=d;return t.push({name:l,matcher:h,optional:!!p,rest:!!u,chained:u?f===1&&i[0]==="":!1}),u?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return me(c)}).join("")}).join("")}/?$`),params:t}}function Lt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function Pt(e){return e.slice(1).split("/").filter(Lt)}function xt(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;od).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](f)){r[c.name]=f;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&c.chained&&(i=0),!d&&!p&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function me(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ct({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,f,d]])=>{const{pattern:p,params:u}=Ut(o),l={id:o,exec:h=>{const w=p.exec(h);if(w)return xt(w,u,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...f||[]].map(i),leaf:s(c)};return l.errors.length=l.layouts.length=Math.max(l.errors.length,l.layouts.length),l});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function We(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function De(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const I=globalThis.__sveltekit_1dy0hle?.base??"/_playground",Nt=globalThis.__sveltekit_1dy0hle?.assets??I??"",Ot="1760177694904",Je="sveltekit:snapshot",ze="sveltekit:scroll",Xe="sveltekit:states",jt="sveltekit:pageurl",B="sveltekit:history",W="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},le=location.origin;function Ze(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 fe(){return{x:pageXOffset,y:pageYOffset}}function F(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Fe={...j,"":j.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function et(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function ve(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,s=!r||!!a||ue(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=r?.origin===le&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function ee(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),s===null&&(s=F(o,"reload")),i===null&&(i=F(o,"replacestate")),o=Qe(o);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Fe[r??"off"],preload_data:Fe[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Be(e){const t=Ae(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const tt={v:()=>{}};function $t(){const{set:e,subscribe:t}=Ae(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Nt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Ot;return i&&(e(!0),tt.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function ue(e,t,n){return e.origin!==le||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function Sn(e){}function Dt(e){const t=Bt(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const Vt=-1,Mt=-2,qt=-3,Gt=-4,Yt=-5,Ht=-6;function Kt(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===Vt)return;if(s===qt)return NaN;if(s===Gt)return 1/0;if(s===Yt)return-1/0;if(s===Ht)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],f=t?.[c];if(f)return r[s]=f(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let l=1;lt!=null)}const zt="x-sveltekit-invalidated",Xt="x-sveltekit-trailing-slash";function te(e){return e instanceof ce||e instanceof Re?e.status:500}function Zt(e){return e instanceof Re?e.text:"Internal Error"}let S,J,ye;const Qt=je.toString().includes("$$")||/function \w+\(\) \{\}/.test(je.toString());Qt?(S={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},J={current:null},ye={current:!1}):(S=new class{#e=U({});get data(){return L(this.#e)}set data(t){P(this.#e,t)}#t=U(null);get form(){return L(this.#t)}set form(t){P(this.#t,t)}#n=U(null);get error(){return L(this.#n)}set error(t){P(this.#n,t)}#r=U({});get params(){return L(this.#r)}set params(t){P(this.#r,t)}#a=U({id:null});get route(){return L(this.#a)}set route(t){P(this.#a,t)}#o=U({});get state(){return L(this.#o)}set state(t){P(this.#o,t)}#s=U(-1);get status(){return L(this.#s)}set status(t){P(this.#s,t)}#i=U(new URL("https://example.com"));get url(){return L(this.#i)}set url(t){P(this.#i,t)}},J=new class{#e=U(null);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},ye=new class{#e=U(!1);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},tt.v=()=>ye.current=!0);function en(e){Object.assign(S,e)}const tn="/__data.json",nn=".html__data.json";function rn(e){return e.endsWith(".html")?e.replace(/\.html$/,nn):e.replace(/\/$/,"")+tn}const Ve={spanContext(){return an},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}},an={traceId:"",spanId:"",traceFlags:0},{tick:on}=mt,sn=new Set(["icon","shortcut icon","apple-touch-icon"]),D=We(ze)??{},z=We(Je)??{},O={url:Be({}),page:Be({}),navigating:Ae(null),updated:$t()};function Ie(e){D[e]=fe()}function cn(e,t){let n=e+1;for(;D[n];)delete D[n],n+=1;for(n=t+1;z[n];)delete z[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function rt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(I||"/");e&&await e.update()}}function Me(){}let Ue,be,ne,x,ke,v;const re=[],ae=[];let C=null;const Q=new Map,at=new Set,ln=new Set,H=new Set;let y={branch:[],error:null,url:null},Le=!1,oe=!1,qe=!0,X=!1,G=!1,ot=!1,Pe=!1,st,A,T,$;const K=new Set,Ge=new Map;async function Un(e,t,n){globalThis.__sveltekit_1dy0hle?.data&&globalThis.__sveltekit_1dy0hle.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Ue=Ct(e),x=document.documentElement,ke=t,be=e.nodes[0],ne=e.nodes[1],be(),ne(),A=history.state?.[B],T=history.state?.[W],A||(A=T=Date.now(),history.replaceState({...history.state,[B]:A,[W]:T},""));const r=D[A];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await vn(ke,n)):(await V({type:"enter",url:Ze(v.hash?kn(new URL(location.href)):location.href),replace_state:!0}),a()),wn()}function fn(){re.length=0,Pe=!1}function it(e){ae.some(t=>t?.snapshot)&&(z[e]=ae.map(t=>t?.snapshot?.capture()))}function ct(e){z[e]?.forEach((t,n)=>{ae[n]?.snapshot?.restore(t)})}function Ye(){Ie(A),De(ze,D),it(T),De(Je,z)}async function un(e,t,n,r){let a;t.invalidateAll&&(C=null),await V({type:"goto",url:Ze(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Pe=!0,a=[...Ge.keys()]),t.invalidate&&t.invalidate.forEach(yn)}}),t.invalidateAll&&$e().then($e).then(()=>{Ge.forEach(({resource:s},i)=>{a?.includes(i)&&s.refresh?.()})})}async function dn(e){if(e.id!==C?.id){const t={};K.add(t),C={id:e.id,token:t,promise:ut({...e,preload:t}).then(n=>(K.delete(t),n.type==="loaded"&&n.state.error&&(C=null),n))}}return C.promise}async function we(e){const t=(await he(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}function lt(e,t,n){y=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(S,e.props.page),st=new v.root({target:t,props:{...e.props,stores:O,components:ae},hydrate:n,sync:!1}),ct(T),n){const a={from:null,to:{params:y.params,route:{id:y.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};H.forEach(s=>s(a))}oe=!0}function se({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if(I&&(e.pathname===I||e.pathname===I+"/"))o="always";else for(const l of n)l?.slash!==void 0&&(o=l.slash);e.pathname=yt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:Jt(n).map(l=>l.node.component),page:Oe(S)}};i!==void 0&&(c.props.form=i);let f={},d=!S,p=0;for(let l=0;l(o&&(c.route=!0),u[l])}),params:new Proxy(r,{get:(u,l)=>(o&&c.params.add(l),u[l])}),data:s?.data??null,url:bt(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},v.hash),async fetch(u,l){u instanceof Request&&(l={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u?.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...l});const{resolved:h,promise:w}=ft(u,l,n);return o&&d(h.href),w},setHeaders:()=>{},depends:d,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await f.universal.load.call(null,p)??null}return{node:f,loader:e,server:s,universal:f.universal?.load?{type:"data",data:i,uses:c}:null,data:i??s?.data??null,slash:f.universal?.trailingSlash??s?.slash}}function ft(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 s=oe?Tt(r,a.href,t):Rt(r,t);return{resolved:a,promise:s}}function He(e,t,n,r,a,s){if(Pe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==y.params[i])return!0;for(const i of a.dependencies)if(re.some(o=>o(new URL(i))))return!0;return!1}function Ce(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function hn(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),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function Ke({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Oe(S),constructors:[]}}}async function ut({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if(C?.id===e)return K.delete(C.token),C.promise;const{errors:i,layouts:o,leaf:c}=a,f=[...o,c];i.forEach(m=>m?.().catch(()=>{})),f.forEach(m=>m?.[1]().catch(()=>{}));let d=null;const p=y.url?e!==ie(y.url):!1,u=y.route?a.id!==y.route.id:!1,l=hn(y.url,n);let h=!1;const w=f.map((m,g)=>{const b=y.branch[g],k=!!m?.[0]&&(b?.loader!==m[1]||He(h,u,p,l,b.server?.uses,r));return k&&(h=!0),k});if(w.some(Boolean)){try{d=await pt(n,w)}catch(m){const g=await M(m,{url:n,params:r,route:{id:e}});return K.has(s)?Ke({error:g,url:n,params:r,route:a}):de({status:te(m),error:g,url:n,route:a})}if(d.type==="redirect")return d}const E=d?.nodes;let _=!1;const N=f.map(async(m,g)=>{if(!m)return;const b=y.branch[g],k=E?.[g];if((!k||k.type==="skip")&&m[1]===b?.loader&&!He(_,u,p,l,b.universal?.uses,r))return b;if(_=!0,k?.type==="error")throw k;return xe({loader:m[1],url:n,params:r,route:a,parent:async()=>{const pe={};for(let ge=0;ge{});const R=[];for(let m=0;mPromise.resolve({}),server_data_node:Ce(s)}),c={node:await ne(),loader:ne,universal:null,server:null,data:null};return se({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Se)return un(new URL(o.location,location.href),{},0);throw o}}async function gn(e){const t=e.href;if(Q.has(t))return Q.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(s,i)=>ft(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);v.hash?s.hash=a:s.pathname=a,a=s}return a})();Q.set(t,r),n=await r}catch{Q.delete(t);return}return n}async function he(e,t){if(e&&!ue(e,I,v.hash)){const n=await gn(e);if(!n)return;const r=_n(n);for(const a of Ue){const s=a.exec(r);if(s)return{id:ie(e),invalidating:t,route:a,params:vt(s),url:e}}}}function _n(e){return wt(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(I.length))||"/"}function ie(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function dt({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=Ne(y,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||at.forEach(c=>c(o)),s?null:i}async function V({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:f=Me,block:d=Me,event:p}){const u=$;$=c;const l=await he(t,!1),h=e==="enter"?Ne(y,l,t,e):dt({url:t,type:e,delta:n?.delta,intent:l,event:p});if(!h){d(),$===c&&($=u);return}const w=A,E=T;f(),X=!0,oe&&h.navigation.type!=="enter"&&O.navigating.set(J.current=h.navigation);let _=l&&await ut(l);if(!_){if(ue(t,I,v.hash))return await q(t,s);_=await ht(t,{id:null},await M(new Re(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=l?.url||t,$!==c)return h.reject(new Error("navigation aborted")),!1;if(_.type==="redirect"){if(o<20){await V({type:e,url:new URL(_.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),h.fulfil(void 0);return}_=await de({status:500,error:await M(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else _.props.page.status>=400&&await O.updated.check()&&(await rt(),await q(t,s));if(fn(),Ie(w),it(E),_.props.page.url.pathname!==t.pathname&&(t.pathname=_.props.page.url.pathname),i=n?n.state:i,!n){const g=s?0:1,b={[B]:A+=g,[W]:T+=g,[Xe]:i};(s?history.replaceState:history.pushState).call(history,b,"",t),s||cn(A,T)}if(C=null,_.props.page.state=i,oe){const g=(await Promise.all(Array.from(ln,b=>b(h.navigation)))).filter(b=>typeof b=="function");if(g.length>0){let b=function(){g.forEach(k=>{H.delete(k)})};g.push(b),g.forEach(k=>{H.add(k)})}y=_.state,_.props.page&&(_.props.page.url=t),st.$set(_.props),en(_.props.page),ot=!0}else lt(_,ke,!1);const{activeElement:N}=document;await on();const R=n?n.scroll:a?fe():null;if(qe){const g=t.hash&&document.getElementById(_t(t));R?scrollTo(R.x,R.y):g?g.scrollIntoView():scrollTo(0,0)}const m=document.activeElement!==N&&document.activeElement!==document.body;!r&&!m&&bn(t),qe=!0,_.props.page&&Object.assign(S,_.props.page),X=!1,e==="popstate"&&ct(T),h.fulfil(void 0),H.forEach(g=>g(h.navigation)),O.navigating.set(J.current=null)}async function ht(e,t,n,r,a){return e.origin===le&&e.pathname===location.pathname&&!Le?await de({status:r,error:n,url:e,route:t}):await q(e,a)}function mn(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,j.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],j.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(we(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const f=et(o,x),d=f===t&&c>=n;if(!f||d)return;const{url:p,external:u,download:l}=ve(f,I,v.hash);if(u||l)return;const h=ee(f),w=p&&ie(y.url)===ie(p);if(!(h.reload||w))if(c<=h.preload_data){t=f,n=j.tap;const E=await he(p,!1);if(!E)return;dn(E)}else c<=h.preload_code&&(t=f,n=c,we(p))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:f,download:d}=ve(o,I,v.hash);if(f||d)continue;const p=ee(o);p.reload||(p.preload_code===j.viewport&&a.observe(o),p.preload_code===j.eager&&we(c))}}H.add(i),i()}function M(e,t){if(e instanceof ce)return e.body;const n=te(e),r=Zt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function yn(e){if(typeof e=="function")re.push(e);else{const{href:t}=new URL(e,location.href);re.push(n=>n.href===t)}}function wn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Ye(),!X){const r=Ne(y,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};at.forEach(s=>s(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ye()}),navigator.connection?.saveData||mn(),x.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=et(t.composedPath()[0],x);if(!n)return;const{url:r,external:a,target:s,download:i}=ve(n,I,v.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const o=ee(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||i)return;const[f,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=f===_e(location);if(a||o.reload&&(!p||!d)){dt({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,u]=y.url.href.split("#");if(u===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const l=n.ownerDocument.getElementById(decodeURIComponent(d));l&&(l.scrollIntoView(),l.focus())}return}if(G=!0,Ie(A),e(r),!o.replace_state)return;G=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await V({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),x.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 i=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ue(i,I,!1))return;const o=t.target,c=ee(o);if(c.reload)return;t.preventDefault(),t.stopPropagation();const f=new FormData(o,r);i.search=new URLSearchParams(f).toString(),V({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ee){if(t.state?.[B]){const n=t.state[B];if($={},n===A)return;const r=D[n],a=t.state[Xe]??{},s=new URL(t.state[jt]??location.href),i=t.state[W],o=y.url?_e(location)===_e(y.url):!1;if(i===T&&(ot||o)){a!==S.state&&(S.state=a),e(s),D[A]=fe(),r&&scrollTo(r.x,r.y),A=n;return}const f=n-A;await V({type:"popstate",url:s,popped:{state:a,scroll:r,delta:f},accept:()=>{A=n,T=i},block:()=>{history.go(-f)},nav_token:$,event:t})}else if(!G){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++A,[W]:T},"",location.href))});for(const t of document.querySelectorAll("link"))sn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&O.navigating.set(J.current=null)});function e(t){y.url=S.url=t,O.page.set(Oe(S)),O.page.notify()}}async function vn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){Le=!0;const f=new URL(location.href);let d;({params:a={},route:s={id:null}}=await he(f,!1)||{}),d=Ue.find(({id:l})=>l===s.id);let p,u=!0;try{const l=r.map(async(w,E)=>{const _=o[E];return _?.uses&&(_.uses=gt(_.uses)),xe({loader:v.nodes[w],url:f,params:a,route:s,parent:async()=>{const N={};for(let R=0;Rs?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let s;throw a.headers.get("content-type")?.includes("application/json")?s=await a.json():a.status===404?s="Not Found":a.status===500&&(s="Internal Error"),new ce(a.status,s)}return new Promise(async s=>{const i=new Map,o=a.body.getReader();function c(d){return Kt(d,{...v.decoders,Promise:p=>new Promise((u,l)=>{i.set(p,{fulfil:u,reject:l})})})}let f="";for(;;){const{done:d,value:p}=await o.read();if(d&&!f)break;for(f+=!p&&f?` +`:Et.decode(p,{stream:!0});;){const u=f.indexOf(` +`);if(u===-1)break;const l=JSON.parse(f.slice(0,u));if(f=f.slice(u+1),l.type==="redirect")return s(l);if(l.type==="data")l.nodes?.forEach(h=>{h?.type==="data"&&(h.uses=gt(h.uses),h.data=c(h.data))}),s(l);else if(l.type==="chunk"){const{id:h,data:w,error:E}=l,_=i.get(h);i.delete(h),E?_.reject(c(E)):_.fulfil(c(w))}}}})}function gt(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 Ee=!1;function bn(e){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=_t(e);if(n&&document.getElementById(n)){const{x:a,y:s}=fe();setTimeout(()=>{const i=history.state;Ee=!0,location.replace(`#${n}`),v.hash&&location.replace(e.hash),history.replaceState(i,"",e.hash),scrollTo(a,s),Ee=!1})}else{const a=document.body,s=a.getAttribute("tabindex");a.tabIndex=-1,a.focus({preventScroll:!0,focusVisible:!1}),s!==null?a.setAttribute("tabindex",s):a.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s{if(r.rangeCount===a.length){for(let s=0;s{a=c,s=f});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function Oe(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 kn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function _t(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{Un as a,Sn as l,S as p,O as s}; diff --git a/server/playground/_app/immutable/entry/app.TBE8HBpz.js b/server/playground/_app/immutable/entry/app.BUDVPTHl.js similarity index 94% rename from server/playground/_app/immutable/entry/app.TBE8HBpz.js rename to server/playground/_app/immutable/entry/app.BUDVPTHl.js index b8510cd..3cfb63b 100644 --- a/server/playground/_app/immutable/entry/app.TBE8HBpz.js +++ b/server/playground/_app/immutable/entry/app.BUDVPTHl.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BxuPCyXV.js","../chunks/DsnmJJEf.js","../chunks/bc36GTfJ.js","../chunks/DyOAiIET.js","../assets/0.z6k2NkFs.css","../nodes/1.D9DCRrr8.js","../chunks/kadZwC1X.js","../chunks/B1lAeocp.js","../chunks/BsPC8ki2.js","../nodes/2.BEtOseUT.js","../chunks/DyoUZ9Ht.js","../assets/2.DQ5mJGGf.css"])))=>i.map(i=>d[i]); -import{A as D,B as W,z as Y,E as z,I as G,J,K as I,L as K,O as X,N as Z,W as w,ac as H,g as d,aS as Q,X as $,T as ee,p as te,u as re,a as se,aZ as x,aY as ae,o as F,k as R,y as ne,l as P,q as oe,i as S,v as ce,x as ie,a_ as O,a$ as le,t as ue}from"../chunks/bc36GTfJ.js";import{h as fe,m as de,u as me,o as he,s as _e}from"../chunks/B1lAeocp.js";import"../chunks/DsnmJJEf.js";import{p as A,i as C,b as L}from"../chunks/DyoUZ9Ht.js";function T(l,e,a){D&&W();var o=l,n,r,t=null,s=null;function m(){r&&(Z(r),r=null),t&&(t.lastChild.remove(),o.before(t),t=null),r=s,s=null}Y(()=>{if(n!==(n=e())){var h=K();if(n){var c=o;h&&(t=document.createDocumentFragment(),t.append(c=G()),r&&I.skipped_effects.add(r)),s=J(()=>a(c,n))}h?I.add_callback(m):m()}},z),D&&(o=X)}function ve(l){return class extends ge{constructor(e){super({component:l,...e})}}}class ge{#t;#e;constructor(e){var a=new Map,o=(r,t)=>{var s=ee(t,!1,!1);return a.set(r,s),s};const n=new Proxy({...e.props||{},$$events:{}},{get(r,t){return d(a.get(t)??o(t,Reflect.get(r,t)))},has(r,t){return t===H?!0:(d(a.get(t)??o(t,Reflect.get(r,t))),Reflect.has(r,t))},set(r,t,s){return w(a.get(t)??o(t,s),s),Reflect.set(r,t,s)}});this.#e=(e.hydrate?fe:de)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&Q(),this.#t=n.$$events;for(const r of Object.keys(this.#e))r==="$set"||r==="$destroy"||r==="$on"||$(this,r,{get(){return this.#e[r]},set(t){this.#e[r]=t},enumerable:!0});this.#e.$set=r=>{Object.assign(n,r)},this.#e.$destroy=()=>{me(this.#e)}}$set(e){this.#e.$set(e)}$on(e,a){this.#t[e]=this.#t[e]||[];const o=(...n)=>a.call(this,...n);return this.#t[e].push(o),()=>{this.#t[e]=this.#t[e].filter(n=>n!==o)}}$destroy(){this.#e.$destroy()}}const ye="modulepreload",be=function(l,e){return new URL(l,e).href},q={},j=function(e,a,o){let n=Promise.resolve();if(a&&a.length>0){let h=function(c){return Promise.all(c.map(f=>Promise.resolve(f).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),m=s?.nonce||s?.getAttribute("nonce");n=h(a.map(c=>{if(c=be(c,o),c in q)return;q[c]=!0;const f=c.endsWith(".css"),_=f?'[rel="stylesheet"]':"";if(o)for(let v=t.length-1;v>=0;v--){const i=t[v];if(i.href===c&&(!f||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${_}`))return;const u=document.createElement("link");if(u.rel=f?"stylesheet":ye,f||(u.as="script"),u.crossOrigin="",u.href=c,m&&u.setAttribute("nonce",m),document.head.appendChild(u),f)return new Promise((v,i)=>{u.addEventListener("load",v),u.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return n.then(t=>{for(const s of t||[])s.status==="rejected"&&r(s.reason);return e().catch(r)})},Ce={};var Ee=F('
'),Pe=F(" ",1);function pe(l,e){te(e,!0);let a=A(e,"components",23,()=>[]),o=A(e,"data_0",3,null),n=A(e,"data_1",3,null);re(()=>e.stores.page.set(e.page)),se(()=>{e.stores,e.page,e.constructors,a(),e.form,o(),n(),e.stores.page.notify()});let r=x(!1),t=x(!1),s=x(null);he(()=>{const i=e.stores.page.subscribe(()=>{d(r)&&(w(t,!0),ae().then(()=>{w(s,document.title||"untitled page",!0)}))});return w(r,!0),i});const m=O(()=>e.constructors[1]);var h=Pe(),c=R(h);{var f=i=>{const g=O(()=>e.constructors[0]);var y=S(),p=R(y);T(p,()=>d(g),(b,E)=>{L(E(b,{get data(){return o()},get form(){return e.form},get params(){return e.page.params},children:(k,we)=>{var N=S(),M=R(N);T(M,()=>d(m),(V,B)=>{L(B(V,{get data(){return n()},get form(){return e.form},get params(){return e.page.params}}),U=>a()[1]=U,()=>a()?.[1])}),P(k,N)},$$slots:{default:!0}}),k=>a()[0]=k,()=>a()?.[0])}),P(i,y)},_=i=>{const g=O(()=>e.constructors[0]);var y=S(),p=R(y);T(p,()=>d(g),(b,E)=>{L(E(b,{get data(){return o()},get form(){return e.form},get params(){return e.page.params}}),k=>a()[0]=k,()=>a()?.[0])}),P(i,y)};C(c,i=>{e.constructors[1]?i(f):i(_,!1)})}var u=ne(c,2);{var v=i=>{var g=Ee(),y=ce(g);{var p=b=>{var E=le();ue(()=>_e(E,d(s))),P(b,E)};C(y,b=>{d(t)&&b(p)})}ie(g),P(i,g)};C(u,i=>{d(r)&&i(v)})}P(l,h),oe()}const Le=ve(pe),Te=[()=>j(()=>import("../nodes/0.BxuPCyXV.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),()=>j(()=>import("../nodes/1.D9DCRrr8.js"),__vite__mapDeps([5,1,6,2,7,8]),import.meta.url),()=>j(()=>import("../nodes/2.BEtOseUT.js"),__vite__mapDeps([9,1,6,2,3,10,7,11]),import.meta.url)],je=[],Ne={"/":[2]},ke={handleError:(({error:l})=>{console.error(l)}),reroute:(()=>{}),transport:{}},Re=Object.fromEntries(Object.entries(ke.transport).map(([l,e])=>[l,e.decode])),De=!1,Ie=(l,e)=>Re[l](e);export{Ie as decode,Re as decoders,Ne as dictionary,De as hash,ke as hooks,Ce as matchers,Te as nodes,Le as root,je as server_loads}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.BxuPCyXV.js","../chunks/DsnmJJEf.js","../chunks/bc36GTfJ.js","../chunks/DyOAiIET.js","../assets/0.z6k2NkFs.css","../nodes/1.B3SpEh7a.js","../chunks/kadZwC1X.js","../chunks/B1lAeocp.js","../chunks/Dft7nOuB.js","../nodes/2.42-dS2Hb.js","../chunks/DyoUZ9Ht.js","../assets/2.DQ5mJGGf.css"])))=>i.map(i=>d[i]); +import{A as D,B as W,z as Y,E as z,I as G,J,K as I,L as K,O as X,N as Z,W as w,ac as H,g as d,aS as Q,X as $,T as ee,p as te,u as re,a as se,aZ as x,aY as ae,o as F,k as R,y as ne,l as P,q as oe,i as S,v as ce,x as ie,a_ as O,a$ as le,t as ue}from"../chunks/bc36GTfJ.js";import{h as fe,m as de,u as me,o as he,s as _e}from"../chunks/B1lAeocp.js";import"../chunks/DsnmJJEf.js";import{p as A,i as C,b as L}from"../chunks/DyoUZ9Ht.js";function T(l,e,a){D&&W();var o=l,n,r,t=null,s=null;function m(){r&&(Z(r),r=null),t&&(t.lastChild.remove(),o.before(t),t=null),r=s,s=null}Y(()=>{if(n!==(n=e())){var h=K();if(n){var c=o;h&&(t=document.createDocumentFragment(),t.append(c=G()),r&&I.skipped_effects.add(r)),s=J(()=>a(c,n))}h?I.add_callback(m):m()}},z),D&&(o=X)}function ve(l){return class extends ge{constructor(e){super({component:l,...e})}}}class ge{#t;#e;constructor(e){var a=new Map,o=(r,t)=>{var s=ee(t,!1,!1);return a.set(r,s),s};const n=new Proxy({...e.props||{},$$events:{}},{get(r,t){return d(a.get(t)??o(t,Reflect.get(r,t)))},has(r,t){return t===H?!0:(d(a.get(t)??o(t,Reflect.get(r,t))),Reflect.has(r,t))},set(r,t,s){return w(a.get(t)??o(t,s),s),Reflect.set(r,t,s)}});this.#e=(e.hydrate?fe:de)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:e.intro??!1,recover:e.recover}),(!e?.props?.$$host||e.sync===!1)&&Q(),this.#t=n.$$events;for(const r of Object.keys(this.#e))r==="$set"||r==="$destroy"||r==="$on"||$(this,r,{get(){return this.#e[r]},set(t){this.#e[r]=t},enumerable:!0});this.#e.$set=r=>{Object.assign(n,r)},this.#e.$destroy=()=>{me(this.#e)}}$set(e){this.#e.$set(e)}$on(e,a){this.#t[e]=this.#t[e]||[];const o=(...n)=>a.call(this,...n);return this.#t[e].push(o),()=>{this.#t[e]=this.#t[e].filter(n=>n!==o)}}$destroy(){this.#e.$destroy()}}const ye="modulepreload",be=function(l,e){return new URL(l,e).href},q={},j=function(e,a,o){let n=Promise.resolve();if(a&&a.length>0){let h=function(c){return Promise.all(c.map(f=>Promise.resolve(f).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};const t=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),m=s?.nonce||s?.getAttribute("nonce");n=h(a.map(c=>{if(c=be(c,o),c in q)return;q[c]=!0;const f=c.endsWith(".css"),_=f?'[rel="stylesheet"]':"";if(o)for(let v=t.length-1;v>=0;v--){const i=t[v];if(i.href===c&&(!f||i.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${_}`))return;const u=document.createElement("link");if(u.rel=f?"stylesheet":ye,f||(u.as="script"),u.crossOrigin="",u.href=c,m&&u.setAttribute("nonce",m),document.head.appendChild(u),f)return new Promise((v,i)=>{u.addEventListener("load",v),u.addEventListener("error",()=>i(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(t){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=t,window.dispatchEvent(s),!s.defaultPrevented)throw t}return n.then(t=>{for(const s of t||[])s.status==="rejected"&&r(s.reason);return e().catch(r)})},Ce={};var Ee=F('
'),Pe=F(" ",1);function pe(l,e){te(e,!0);let a=A(e,"components",23,()=>[]),o=A(e,"data_0",3,null),n=A(e,"data_1",3,null);re(()=>e.stores.page.set(e.page)),se(()=>{e.stores,e.page,e.constructors,a(),e.form,o(),n(),e.stores.page.notify()});let r=x(!1),t=x(!1),s=x(null);he(()=>{const i=e.stores.page.subscribe(()=>{d(r)&&(w(t,!0),ae().then(()=>{w(s,document.title||"untitled page",!0)}))});return w(r,!0),i});const m=O(()=>e.constructors[1]);var h=Pe(),c=R(h);{var f=i=>{const g=O(()=>e.constructors[0]);var y=S(),p=R(y);T(p,()=>d(g),(b,E)=>{L(E(b,{get data(){return o()},get form(){return e.form},get params(){return e.page.params},children:(k,we)=>{var N=S(),M=R(N);T(M,()=>d(m),(V,B)=>{L(B(V,{get data(){return n()},get form(){return e.form},get params(){return e.page.params}}),U=>a()[1]=U,()=>a()?.[1])}),P(k,N)},$$slots:{default:!0}}),k=>a()[0]=k,()=>a()?.[0])}),P(i,y)},_=i=>{const g=O(()=>e.constructors[0]);var y=S(),p=R(y);T(p,()=>d(g),(b,E)=>{L(E(b,{get data(){return o()},get form(){return e.form},get params(){return e.page.params}}),k=>a()[0]=k,()=>a()?.[0])}),P(i,y)};C(c,i=>{e.constructors[1]?i(f):i(_,!1)})}var u=ne(c,2);{var v=i=>{var g=Ee(),y=ce(g);{var p=b=>{var E=le();ue(()=>_e(E,d(s))),P(b,E)};C(y,b=>{d(t)&&b(p)})}ie(g),P(i,g)};C(u,i=>{d(r)&&i(v)})}P(l,h),oe()}const Le=ve(pe),Te=[()=>j(()=>import("../nodes/0.BxuPCyXV.js"),__vite__mapDeps([0,1,2,3,4]),import.meta.url),()=>j(()=>import("../nodes/1.B3SpEh7a.js"),__vite__mapDeps([5,1,6,2,7,8]),import.meta.url),()=>j(()=>import("../nodes/2.42-dS2Hb.js"),__vite__mapDeps([9,1,6,2,3,10,7,11]),import.meta.url)],je=[],Ne={"/":[2]},ke={handleError:(({error:l})=>{console.error(l)}),reroute:(()=>{}),transport:{}},Re=Object.fromEntries(Object.entries(ke.transport).map(([l,e])=>[l,e.decode])),De=!1,Ie=(l,e)=>Re[l](e);export{Ie as decode,Re as decoders,Ne as dictionary,De as hash,ke as hooks,Ce as matchers,Te as nodes,Le as root,je as server_loads}; diff --git a/server/playground/_app/immutable/entry/start.BFWm42P_.js b/server/playground/_app/immutable/entry/start.BFWm42P_.js new file mode 100644 index 0000000..ca95af0 --- /dev/null +++ b/server/playground/_app/immutable/entry/start.BFWm42P_.js @@ -0,0 +1 @@ +import{l as o,a as r}from"../chunks/Dft7nOuB.js";export{o as load_css,r as start}; diff --git a/server/playground/_app/immutable/entry/start.DAIBqtaT.js b/server/playground/_app/immutable/entry/start.DAIBqtaT.js deleted file mode 100644 index 0b32865..0000000 --- a/server/playground/_app/immutable/entry/start.DAIBqtaT.js +++ /dev/null @@ -1 +0,0 @@ -import{l as o,a as r}from"../chunks/BsPC8ki2.js";export{o as load_css,r as start}; diff --git a/server/playground/_app/immutable/nodes/1.D9DCRrr8.js b/server/playground/_app/immutable/nodes/1.B3SpEh7a.js similarity index 88% rename from server/playground/_app/immutable/nodes/1.D9DCRrr8.js rename to server/playground/_app/immutable/nodes/1.B3SpEh7a.js index c10ac22..9df1a11 100644 --- a/server/playground/_app/immutable/nodes/1.D9DCRrr8.js +++ b/server/playground/_app/immutable/nodes/1.B3SpEh7a.js @@ -1 +1 @@ -import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/kadZwC1X.js";import{p as h,o as g,k as l,t as v,l as d,q as x,v as e,x as a,y as _}from"../chunks/bc36GTfJ.js";import{s as o}from"../chunks/B1lAeocp.js";import{s as k,p}from"../chunks/BsPC8ki2.js";const $={get error(){return p.error},get status(){return p.status}};k.updated.check;const m=$;var b=g("

",1);function z(i,n){h(n,!1),u();var r=b(),t=l(r),c=e(t,!0);a(t);var s=_(t,2),f=e(s,!0);a(s),v(()=>{o(c,m.status),o(f,m.error?.message)}),d(i,r),x()}export{z as component}; +import"../chunks/DsnmJJEf.js";import{i as u}from"../chunks/kadZwC1X.js";import{p as h,o as g,k as l,t as v,l as d,q as x,v as e,x as a,y as _}from"../chunks/bc36GTfJ.js";import{s as o}from"../chunks/B1lAeocp.js";import{s as k,p}from"../chunks/Dft7nOuB.js";const $={get error(){return p.error},get status(){return p.status}};k.updated.check;const m=$;var b=g("

",1);function z(i,n){h(n,!1),u();var r=b(),t=l(r),c=e(t,!0);a(t);var s=_(t,2),f=e(s,!0);a(s),v(()=>{o(c,m.status),o(f,m.error?.message)}),d(i,r),x()}export{z as component}; diff --git a/server/playground/_app/immutable/nodes/2.BEtOseUT.js b/server/playground/_app/immutable/nodes/2.42-dS2Hb.js similarity index 99% rename from server/playground/_app/immutable/nodes/2.BEtOseUT.js rename to server/playground/_app/immutable/nodes/2.42-dS2Hb.js index 5e76a2d..41706e3 100644 --- a/server/playground/_app/immutable/nodes/2.BEtOseUT.js +++ b/server/playground/_app/immutable/nodes/2.42-dS2Hb.js @@ -112,7 +112,7 @@ import"../chunks/DsnmJJEf.js";import{i as Hm}from"../chunks/kadZwC1X.js";import{ \${} } }`,{label:"class",detail:"definition",type:"keyword"}),Ee('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Ee('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],Ok=Tp.concat([Ee("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Ee("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Ee("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),_f=new vu,Cp=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function yr(r){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,r),!0}}const pk=["FunctionDeclaration"],mk={FunctionDeclaration:yr("function"),ClassDeclaration:yr("class"),ClassExpression:()=>!0,EnumDeclaration:yr("constant"),TypeAliasDeclaration:yr("type"),NamespaceDeclaration:yr("namespace"),VariableDefinition(r,e){r.matchContext(pk)||e(r,"variable")},TypeDefinition(r,e){e(r,"type")},__proto__:null};function Ap(r,e){let t=_f.get(e);if(t)return t;let i=[],n=!0;function s(o,l){let a=r.sliceString(o.from,o.to);i.push({label:a,type:l})}return e.cursor(ie.IncludeAnonymous).iterate(o=>{if(n)n=!1;else if(o.name){let l=mk[o.name];if(l&&l(o,s)||Cp.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of Ap(r,o.node))i.push(l);return!1}}),_f.set(e,i),i}const Ef=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Zp=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function gk(r){let e=re(r.state).resolveInner(r.pos,-1);if(Zp.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Ef.test(r.state.sliceDoc(e.from,e.to));if(!t&&!r.explicit)return null;let i=[];for(let n=e;n;n=n.parent)Cp.has(n.name)&&(i=i.concat(Ap(r.state.doc,n)));return{options:i,from:t?e.from:r.pos,validFor:Ef}}const At=vi.define({name:"javascript",parser:dk.configure({props:[cr.add({IfStatement:Ni({except:/^\s*({|else\b)/}),TryStatement:Ni({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:kS,SwitchBody:r=>{let e=r.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return r.baseIndent+(t?0:i?1:2)*r.unit},Block:xS({closing:"}"}),ArrowFunction:r=>r.baseIndent+r.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ni({except:/^\s*{/}),JSXElement(r){let e=/^\s*<\//.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},JSXEscape(r){let e=/\s*\}/.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},"JSXOpenTag JSXSelfClosingTag"(r){return r.column(r.node.from)+r.unit}}),Ti.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Na,BlockComment(r){return{from:r.from+2,to:r.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Xp={test:r=>/^JSX/.test(r.name),facet:qa({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Mp=At.configure({dialect:"ts"},"typescript"),Rp=At.configure({dialect:"jsx",props:[Wa.add(r=>r.isTop?[Xp]:void 0)]}),Lp=At.configure({dialect:"jsx ts",props:[Wa.add(r=>r.isTop?[Xp]:void 0)]},"typescript");let _p=r=>({label:r,type:"keyword"});const Ep="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(_p),bk=Ep.concat(["declare","implements","private","protected","public"].map(_p));function Sk(r={}){let e=r.jsx?r.typescript?Lp:Rp:r.typescript?Mp:At,t=r.typescript?Ok.concat(bk):Tp.concat(Ep);return new ir(e,[At.data.of({autocomplete:KS(Zp,ZO(t))}),At.data.of({autocomplete:gk}),r.jsx?xk:[]])}function Qk(r){for(;;){if(r.name=="JSXOpenTag"||r.name=="JSXSelfClosingTag"||r.name=="JSXFragmentTag")return r;if(r.name=="JSXEscape"||!r.parent)return null;r=r.parent}}function zf(r,e,t=r.length){for(let i=e?.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return r.sliceString(i.from,Math.min(i.to,t));return""}const yk=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),xk=Z.inputHandler.of((r,e,t,i,n)=>{if((yk?r.composing:r.compositionStarted)||r.state.readOnly||e!=t||i!=">"&&i!="/"||!At.isActiveAt(r.state,e,-1))return!1;let s=n(),{state:o}=s,l=o.changeByRange(a=>{var h;let{head:c}=a,f=re(o).resolveInner(c-1,-1),u;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.doc.sliceString(c-1,c)!=i||f.name=="JSXAttributeValue"&&f.to>c)){if(i==">"&&f.name=="JSXFragmentTag")return{range:a,changes:{from:c,insert:""}};if(i=="/"&&f.name=="JSXStartCloseTag"){let d=f.parent,O=d.parent;if(O&&d.from==c-2&&((u=zf(o.doc,O.firstChild,c))||((h=O.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let p=`${u}>`;return{range:x.cursor(c+p.length,-1),changes:{from:c,insert:p}}}}else if(i==">"){let d=Qk(f);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(c,c+2))&&(u=zf(o.doc,d,c)))return{range:a,changes:{from:c,insert:``}}}}return{range:a}});return l.changes.empty?!1:(r.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),xr=["_blank","_self","_top","_parent"],Wo=["ascii","utf-8","utf-16","latin1","latin1"],Io=["get","post","put","delete"],jo=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],je=["true","false"],L={},kk={a:{attrs:{href:null,ping:null,type:null,media:null,target:xr,hreflang:null}},abbr:L,address:L,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:L,aside:L,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:L,base:{attrs:{href:null,target:xr}},bdi:L,bdo:L,blockquote:{attrs:{cite:null}},body:L,br:L,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:jo,formmethod:Io,formnovalidate:["novalidate"],formtarget:xr,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:L,center:L,cite:L,code:L,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:L,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:L,div:L,dl:L,dt:L,em:L,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:L,figure:L,footer:L,form:{attrs:{action:null,name:null,"accept-charset":Wo,autocomplete:["on","off"],enctype:jo,method:Io,novalidate:["novalidate"],target:xr}},h1:L,h2:L,h3:L,h4:L,h5:L,h6:L,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:L,hgroup:L,hr:L,html:{attrs:{manifest:null}},i:L,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:jo,formmethod:Io,formnovalidate:["novalidate"],formtarget:xr,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:L,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:L,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:L,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Wo,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:L,noscript:L,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:L,param:{attrs:{name:null,value:null}},pre:L,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:L,rt:L,ruby:L,samp:L,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Wo}},section:L,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:L,source:{attrs:{src:null,type:null,media:null}},span:L,strong:L,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:L,summary:L,sup:L,table:L,tbody:L,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:L,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:L,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:L,time:{attrs:{datetime:null}},title:L,tr:L,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:L,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:L},zp={accesskey:null,class:null,contenteditable:je,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:je,autocorrect:je,autocapitalize:je,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":je,"aria-autocomplete":["inline","list","both","none"],"aria-busy":je,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":je,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":je,"aria-hidden":je,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":je,"aria-multiselectable":je,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":je,"aria-relevant":null,"aria-required":je,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Dp="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(r=>"on"+r);for(let r of Dp)zp[r]=null;class fn{constructor(e,t){this.tags={...kk,...e},this.globalAttrs={...zp,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}fn.default=new fn;function nr(r,e,t=r.length){if(!e)return"";let i=e.firstChild,n=i&&i.getChild("TagName");return n?r.sliceString(n.from,Math.min(n.to,t)):""}function sr(r,e=!1){for(;r;r=r.parent)if(r.name=="Element")if(e)e=!1;else return r;return null}function Yp(r,e,t){let i=t.tags[nr(r,sr(e))];return i?.children||t.allTags}function ch(r,e){let t=[];for(let i=sr(e);i&&!i.type.isTop;i=sr(i.parent)){let n=nr(r,i);if(n&&i.lastChild.name=="CloseTag")break;n&&t.indexOf(n)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(n)}return t}const Vp=/^[:\-\.\w\u00b7-\uffff]*$/;function Df(r,e,t,i,n){let s=/\s*>/.test(r.sliceDoc(n,n+5))?"":">",o=sr(t,!0);return{from:i,to:n,options:Yp(r.doc,o,e).map(l=>({label:l,type:"type"})).concat(ch(r.doc,t).map((l,a)=>({label:"/"+l,apply:"/"+l+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Yf(r,e,t,i){let n=/\s*>/.test(r.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:ch(r.doc,e).map((s,o)=>({label:s,apply:s+n,type:"type",boost:99-o})),validFor:Vp}}function wk(r,e,t,i){let n=[],s=0;for(let o of Yp(r.doc,t,e))n.push({label:"<"+o,type:"type"});for(let o of ch(r.doc,t))n.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:n,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function vk(r,e,t,i,n){let s=sr(t),o=s?e.tags[nr(r.doc,s)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:n,options:a.map(h=>({label:h,type:"property"})),validFor:Vp}}function Pk(r,e,t,i,n){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),l=[],a;if(o){let h=r.sliceDoc(o.from,o.to),c=e.globalAttrs[h];if(!c){let f=sr(t),u=f?e.tags[nr(r.doc,f)]:null;c=u?.attrs&&u.attrs[h]}if(c){let f=r.sliceDoc(i,n).toLowerCase(),u='"',d='"';/^['"]/.test(f)?(a=f[0]=='"'?/^[^"]*$/:/^[^']*$/,u="",d=r.sliceDoc(n,n+1)==f[0]?"":f[0],f=f.slice(1),i++):a=/^[^\s<>='"]*$/;for(let O of c)l.push({label:O,apply:u+O+d,type:"constant"})}}return{from:i,to:n,options:l,validFor:a}}function Bp(r,e){let{state:t,pos:i}=e,n=re(t).resolveInner(i,-1),s=n.resolve(i);for(let o=i,l;s==n&&(l=n.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.fromBp(i,n)}const Ck=At.parser.configure({top:"SingleExpression"}),qp=[{tag:"script",attrs:r=>r.type=="text/typescript"||r.lang=="ts",parser:Mp.parser},{tag:"script",attrs:r=>r.type=="text/babel"||r.type=="text/jsx",parser:Rp.parser},{tag:"script",attrs:r=>r.type=="text/typescript-jsx",parser:Lp.parser},{tag:"script",attrs(r){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(r.type)},parser:Ck},{tag:"script",attrs(r){return!r.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(r.type)},parser:At.parser},{tag:"style",attrs(r){return(!r.lang||r.lang=="css")&&(!r.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(r.type))},parser:zs.parser}],Wp=[{name:"style",parser:zs.parser.configure({top:"Styles"})}].concat(Dp.map(r=>({name:r,parser:At.parser}))),Ip=vi.define({name:"html",parser:ex.configure({props:[cr.add({Element(r){let e=/^(\s*)(<\/)?/.exec(r.textAfter);return r.node.to<=r.pos+e[0].length?r.continue():r.lineIndent(r.node.from)+(e[2]?0:r.unit)},"OpenTag CloseTag SelfClosingTag"(r){return r.column(r.node.from)+r.unit},Document(r){if(r.pos+/\s*/.exec(r.textAfter)[0].lengthr.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),fs=Ip.configure({wrap:yp(qp,Wp)});function Ak(r={}){let e="",t;r.matchClosingTags===!1&&(e="noMatch"),r.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(r.nestedLanguages&&r.nestedLanguages.length||r.nestedAttributes&&r.nestedAttributes.length)&&(t=yp((r.nestedLanguages||[]).concat(qp),(r.nestedAttributes||[]).concat(Wp)));let i=t?Ip.configure({wrap:t,dialect:e}):e?fs.configure({dialect:e}):fs;return new ir(i,[fs.data.of({autocomplete:Tk(r)}),r.autoCloseTags!==!1?Zk:[],Sk().support,_x().support])}const Vf=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Zk=Z.inputHandler.of((r,e,t,i,n)=>{if(r.composing||r.state.readOnly||e!=t||i!=">"&&i!="/"||!fs.isActiveAt(r.state,e,-1))return!1;let s=n(),{state:o}=s,l=o.changeByRange(a=>{var h,c,f;let u=o.doc.sliceString(a.from-1,a.to)==i,{head:d}=a,O=re(o).resolveInner(d,-1),p;if(u&&i==">"&&O.name=="EndTag"){let g=O.parent;if(((c=(h=g.parent)===null||h===void 0?void 0:h.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(p=nr(o.doc,g.parent,d))&&!Vf.has(p)){let b=d+(o.doc.sliceString(d,d+1)===">"?1:0),S=``;return{range:a,changes:{from:d,to:b,insert:S}}}}else if(u&&i=="/"&&O.name=="IncompleteCloseTag"){let g=O.parent;if(O.from==d-2&&((f=g.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(p=nr(o.doc,g,d))&&!Vf.has(p)){let b=d+(o.doc.sliceString(d,d+1)===">"?1:0),S=`${p}>`;return{range:x.cursor(d+S.length,-1),changes:{from:d,to:b,insert:S}}}}return{range:a}});return l.changes.empty?!1:(r.dispatch([s,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),jp=qa({commentTokens:{block:{open:""}}}),Np=new V,Gp=iy.configure({props:[Ti.add(r=>!r.is("Block")||r.is("Document")||fa(r)!=null||Xk(r)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Np.add(fa),cr.add({Document:()=>null}),mi.add({Document:jp})]});function fa(r){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(r.name);return e?+e[1]:void 0}function Xk(r){return r.name=="OrderedList"||r.name=="BulletList"}function Mk(r,e){let t=r;for(;;){let i=t.nextSibling,n;if(!i||(n=fa(i.type))!=null&&n<=e)break;t=i}return t.to}const Rk=mO.of((r,e,t)=>{for(let i=re(r).resolveInner(t,-1);i&&!(i.fromt)return{from:t,to:s}}return null});function fh(r){return new nt(jp,r,[],"markdown")}const Lk=fh(Gp),_k=Gp.configure([dy,py,Oy,my,{props:[Ti.add({Table:(r,e)=>({from:e.doc.lineAt(r.from).to,to:r.to})})]}]),ua=fh(_k);function Ek(r,e){return t=>{if(t&&r){let i=null;if(t=/\S*/.exec(t)[0],typeof r=="function"?i=r(t):i=Cs.matchLanguageName(r,t,!0),i instanceof Cs)return i.support?i.support.language.parser:rn.getSkippingParser(i.load());if(i)return i.parser}return e?e.parser:null}}class No{constructor(e,t,i,n,s,o,l){this.node=e,this.from=t,this.to=i,this.spaceBefore=n,this.spaceAfter=s,this.type=o,this.item=l}blank(e,t=!0){let i=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;i.length0;n--)i+=" ";return i+(t?this.spaceAfter:"")}}marker(e,t){let i=this.node.name=="OrderedList"?String(+Fp(this.item,e)[2]+t):"";return this.spaceBefore+i+this.type+this.spaceAfter}}function Up(r,e){let t=[],i=[];for(let n=r;n;n=n.parent){if(n.name=="FencedCode")return i;(n.name=="ListItem"||n.name=="Blockquote")&&t.push(n)}for(let n=t.length-1;n>=0;n--){let s=t[n],o,l=e.lineAt(s.from),a=s.from-l.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(a))))i.push(new No(s,a,a+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(a)))){let h=o[3],c=o[0].length;h.length>=4&&(h=h.slice(0,h.length-4),c-=4),i.push(new No(s.parent,a,a+c,o[1],h,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(a)))){let h=o[4],c=o[0].length;h.length>4&&(h=h.slice(0,h.length-4),c-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),i.push(new No(s.parent,a,a+c,o[1],h,f,s))}}return i}function Fp(r,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(r.from,r.from+10))}function Go(r,e,t,i=0){for(let n=-1,s=r;;){if(s.name=="ListItem"){let l=Fp(s,e),a=+l[2];if(n>=0){if(a!=n+1)return;t.push({from:s.from+l[1].length,to:s.from+l[0].length,insert:String(n+2+i)})}n=a}let o=s.nextSibling;if(!o)break;s=o}}function uh(r,e){let t=/^[ \t]*/.exec(r)[0].length;if(!t||e.facet(hr)!=" ")return r;let i=ut(r,4,t),n="";for(let s=i;s>0;)s>=4?(n+=" ",s-=4):(n+=" ",s--);return n+r.slice(t)}const zk=({state:r,dispatch:e})=>{let t=re(r),{doc:i}=r,n=null,s=r.changeByRange(o=>{if(!o.empty||!ua.isActiveAt(r,o.from,-1)&&!ua.isActiveAt(r,o.from,1))return n={range:o};let l=o.from,a=i.lineAt(l),h=Up(t.resolveInner(l,-1),i);for(;h.length&&h[h.length-1].from>l-a.from;)h.pop();if(!h.length)return n={range:o};let c=h[h.length-1];if(c.to-c.spaceAfter.length>l-a.from)return n={range:o};let f=l>=c.to-c.spaceAfter.length&&!/\S/.test(a.text.slice(c.to));if(c.item&&f){let g=c.node.firstChild,b=c.node.getChild("ListItem","ListItem");if(g.to>=l||b&&b.to0&&!/[^\s>]/.test(i.lineAt(a.from-1).text)){let S=h.length>1?h[h.length-2]:null,w,v="";S&&S.item?(w=a.from+S.from,v=S.marker(i,1)):w=a.from+(S?S.to:0);let y=[{from:w,to:l,insert:v}];return c.node.name=="OrderedList"&&Go(c.item,i,y,-2),S&&S.node.name=="OrderedList"&&Go(S.item,i,y),{range:x.cursor(w+v.length),changes:y}}else{let S=qf(h,r,a);return{range:x.cursor(l+S.length+1),changes:{from:a.from,insert:S+r.lineBreak}}}}if(c.node.name=="Blockquote"&&f&&a.from){let g=i.lineAt(a.from-1),b=/>\s*$/.exec(g.text);if(b&&b.index==c.from){let S=r.changes([{from:g.from+b.index,to:g.to},{from:a.from+c.from,to:a.to}]);return{range:o.map(S),changes:S}}}let u=[];c.node.name=="OrderedList"&&Go(c.item,i,u);let d=c.item&&c.item.from]*/.exec(a.text)[0].length>=c.to)for(let g=0,b=h.length-1;g<=b;g++)O+=g==b&&!d?h[g].marker(i,1):h[g].blank(ga.from&&/\s/.test(a.text.charAt(p-a.from-1));)p--;return O=uh(O,r),Dk(c.node,r.doc)&&(O=qf(h,r,a)+r.lineBreak+O),u.push({from:p,to:l,insert:r.lineBreak+O}),{range:x.cursor(p+O.length+1),changes:u}});return n?!1:(e(r.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)};function Bf(r){return r.name=="QuoteMark"||r.name=="ListMark"}function Dk(r,e){if(r.name!="OrderedList"&&r.name!="BulletList")return!1;let t=r.firstChild,i=r.getChild("ListItem","ListItem");if(!i)return!1;let n=e.lineAt(t.to),s=e.lineAt(i.from),o=/^[\s>]*$/.test(n.text);return n.number+(o?0:1){let t=re(r),i=null,n=r.changeByRange(s=>{let o=s.from,{doc:l}=r;if(s.empty&&ua.isActiveAt(r,s.from)){let a=l.lineAt(o),h=Up(Yk(t,o),l);if(h.length){let c=h[h.length-1],f=c.to-c.spaceAfter.length+(c.spaceAfter?1:0);if(o-a.from>f&&!/\S/.test(a.text.slice(f,o-a.from)))return{range:x.cursor(a.from+f),changes:{from:a.from+f,to:o}};if(o-a.from==f&&(!c.item||a.from<=c.item.from||!/\S/.test(a.text.slice(0,c.to)))){let u=a.from+c.from;if(c.item&&c.node.from{if(typeof window>"u")return;const e=async()=>{const t=new globalThis.Go;try{const i=await WebAssembly.instantiateStreaming(fetch("/_playground/main.wasm"),t.importObject);t.run(i.instance),r(!0)}catch(i){console.error("Error loading wasm module:",i)}};document.readyState==="complete"?e():globalThis.addEventListener("load",e)});function jk(r){if(typeof globalThis.marka?.parseFile!="function")throw new Error("Wasm module not ready");const e=globalThis.marka.parseFile(r);return JSON.parse(e)}function Nk(r){if(typeof globalThis.marka?.compileTemplate!="function")throw new Error("Wasm module not ready");const e=globalThis.marka.compileTemplate(r),t=JSON.parse(e);return console.log({result:t}),t}function Gk(r,e){if(typeof globalThis.marka?.parseFileWithTemplate!="function")throw new Error("Wasm module not ready");const t=globalThis.marka.parseFileWithTemplate(r,e);return JSON.parse(t)}function Uk(){if(typeof globalThis.marka?.listTemplates!="function")throw new Error("Wasm module not ready");const r=globalThis.marka.listTemplates();return JSON.parse(r)}function Fk(r){if(typeof globalThis.marka?.getTemplate!="function")throw new Error("Wasm module not ready");return globalThis.marka.getTemplate(r)}var Hk=Gs('');function Kk(r,e){let t=N(e,"class",3,"");var i=Hk();it(()=>qr(i,0,Wr(t()))),se(r,i)}var Jk=Gs('');function ew(r,e){let t=N(e,"class",3,"");var i=Jk();it(()=>qr(i,0,Wr(t()))),se(r,i)}var tw=Gs('');function iw(r,e){let t=N(e,"class",3,"");var i=tw();it(()=>qr(i,0,Wr(t()))),se(r,i)}const Fo={fontSize:"14px",fontFamily:"JetBrains Mono, Consolas, monospace",lineHeight:"1.6"},rw={borderLeftWidth:"2px"},et={insertedTextDecoration:"none",deletedTextDecoration:"line-through",insertedLinePadding:"1px 3px",borderRadious:"3px"},kr={border:"none",paddingRight:"8px",fontSize:"0.9em",fontWeight:"500"},Ho={border:"none",borderRadius:"4px",padding:"2px 10px"},nw={borderRadius:"2px"},Ko={borderRadius:"2px"},Jo={borderRadius:"4px",padding:"0 5px",margin:"0 2px"},el={width:"12px",height:"12px",borderRadius:"6px"},Gn={borderRadius:"4px",padding:"2px 6px"},Xi={borderRadius:"4px",borderRadiusSelected:"3px",lineHeight:"1.3",padding:"4px 8px",paddingRight:"8px"},Mi="#ffffff",ze="#24292e",Kp="#BBDFFF",Ri="#6e7781",If="#f6f8fa",sw="#116329",yt="#6a737d",tl="#6f42c1",Nt="#005cc5",wr="#d73a49",il="#032f62",jf="#22863a",ci="#e36209",ow="#f1f8ff",fi="#e1e4e8",lw="#f8f9fa",bi="#cb2431",aw="#BBDFFF20",Un=lw,rl=ze,hw=Kp,cw="#e8f0fe",fw="#0366d6",Nf="#b08800",Gf="#79b8ff40",da="#0969da",uw="#8250df",Uf="#e6ffec80",Ff="#ffebe980",nl="#0f6d31",sl="#cf222e",dw=Z.theme({"&":{color:ze,backgroundColor:Mi,fontSize:Fo.fontSize,fontFamily:Fo.fontFamily},".cm-content":{caretColor:rl,lineHeight:Fo.lineHeight},".cm-cursor, .cm-dropCursor":{borderLeftColor:rl,borderLeftWidth:rw.borderLeftWidth},".cm-fat-cursor":{backgroundColor:`${rl}99`,color:Mi},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:hw,color:ze},".cm-selectionLayer":{zIndex:100},".cm-searchMatch":{backgroundColor:"#daebff",outline:`1px solid ${Nt}`,color:ze,borderRadius:Gn.borderRadius,"& span":{color:ze}},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#79b8ff",color:Mi,padding:Gn.padding,"& span":{color:Mi}},".cm-search.cm-panel.cm-textfield":{color:ze,borderRadius:Gn.borderRadius,padding:Gn.padding},".cm-panels":{backgroundColor:If,color:Ri,borderRadius:"0 0 4px 4px"},".cm-panels.cm-panels-top":{borderBottom:`1px solid ${fi}`},".cm-panels.cm-panels-bottom":{borderTop:`1px solid ${fi}`},".cm-panel button":{backgroundColor:Mi,color:ze,border:Ho.border,borderRadius:Ho.borderRadius,padding:Ho.padding},".cm-panel button:hover":{backgroundColor:"#f5f5f5"},".cm-activeLine":{backgroundColor:aw,borderRadius:nw.borderRadius,zIndex:1},".cm-gutters":{backgroundColor:If,color:Ri,border:kr.border,borderRight:`1px solid ${fi}`,paddingRight:kr.paddingRight},".cm-activeLineGutter":{backgroundColor:ow,color:ze,fontWeight:kr.fontWeight},".cm-lineNumbers":{fontSize:kr.fontSize},".cm-foldGutter":{fontSize:kr.fontSize},".cm-foldGutter .cm-gutterElement":{color:Ri,cursor:"pointer"},".cm-foldGutter .cm-gutterElement:hover":{color:ze},".cm-insertedLine":{textDecoration:et.insertedTextDecoration,backgroundColor:Uf,color:nl,padding:et.insertedLinePadding,borderRadius:et.borderRadious},"ins.cm-insertedLine, ins.cm-insertedLine:not(:has(.cm-changedText))":{textDecoration:et.insertedTextDecoration,backgroundColor:`${Uf} !important`,color:nl,padding:et.insertedLinePadding,borderRadius:et.borderRadious,border:`1px solid ${nl}30`},"ins.cm-insertedLine .cm-changedText":{background:"transparent !important"},".cm-deletedLine":{textDecoration:et.deletedTextDecoration,backgroundColor:Ff,color:sl,padding:et.insertedLinePadding,borderRadius:et.borderRadious},"del.cm-deletedLine, del, del:not(:has(.cm-deletedText))":{textDecoration:et.deletedTextDecoration,backgroundColor:`${Ff} !important`,color:sl,padding:et.insertedLinePadding,borderRadius:et.borderRadious,border:`1px solid ${sl}30`},"del .cm-deletedText, del .cm-changedText":{background:"transparent !important"},".cm-tooltip":{backgroundColor:Un,border:`1px solid ${fi}`,borderRadius:Xi.borderRadius,padding:Xi.padding,boxShadow:"0 1px 5px rgba(0, 0, 0, 0.1)"},".cm-tooltip-autocomplete":{"& > ul":{backgroundColor:Un,border:"none"},"& > ul > li":{padding:Xi.padding,lineHeight:Xi.lineHeight},"& > ul > li[aria-selected]":{backgroundColor:"#0366d630",color:ze,borderRadius:Xi.borderRadiusSelected},"& > ul > li:hover":{backgroundColor:"#0366d615"},"& > ul > li > span.cm-completionIcon":{color:Ri,paddingRight:Xi.paddingRight},"& > ul > li > span.cm-completionDetail":{color:Ri,fontStyle:"italic"}},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Un,borderBottomColor:Un},".cm-diagnostic":{"&-error":{borderLeft:`3px solid ${bi}`},"&-warning":{borderLeft:`3px solid ${Nf}`},"&-info":{borderLeft:`3px solid ${da}`}},".cm-lintPoint-error":{borderBottom:`2px wavy ${bi}`},".cm-lintPoint-warning":{borderBottom:`2px wavy ${Nf}`},".cm-matchingBracket":{backgroundColor:cw,outline:`1px solid ${fw}80`,borderRadius:Ko.borderRadius},".cm-nonmatchingBracket":{backgroundColor:"#ffeef080",outline:`1px solid ${bi}`,borderRadius:Ko.borderRadius},".cm-selectionMatch":{backgroundColor:Gf,outline:`1px solid ${Kp}50`,borderRadius:Ko.borderRadius},".cm-foldPlaceholder":{backgroundColor:Gf,color:Ri,border:`1px dotted ${fi}70`,borderRadius:Jo.borderRadius,padding:Jo.padding,margin:Jo.margin},"&.cm-focused":{outline:"none",boxShadow:`0 0 0 2px ${Mi}, 0 0 0 3px ${da}40`},"& .cm-scroller::-webkit-scrollbar":{width:el.width,height:el.height},"& .cm-scroller::-webkit-scrollbar-track":{background:fi},"& .cm-scroller::-webkit-scrollbar-thumb":{backgroundColor:ze,borderRadius:el.borderRadius,border:`3px solid ${fi}`},"& .cm-scroller::-webkit-scrollbar-thumb:hover":{backgroundColor:yt},".cm-ghostText":{opacity:"0.5",color:"#959da5"}},{dark:!1}),Ow=xn.define([{tag:m.keyword,color:wr,fontWeight:"bold"},{tag:m.controlKeyword,color:wr,fontWeight:"bold"},{tag:m.moduleKeyword,color:wr,fontWeight:"bold"},{tag:[m.name,m.deleted,m.character,m.macroName],color:Nt},{tag:[m.variableName],color:Nt},{tag:[m.propertyName],color:tl,fontStyle:"normal"},{tag:[m.typeName],color:wr},{tag:[m.className],color:tl,fontStyle:"italic"},{tag:[m.namespace],color:Nt,fontStyle:"italic"},{tag:[m.operator,m.operatorKeyword],color:ze},{tag:[m.bracket],color:yt},{tag:[m.brace],color:yt},{tag:[m.punctuation],color:yt},{tag:[m.function(m.variableName),m.labelName],color:jf},{tag:[m.definition(m.variableName)],color:Nt},{tag:m.number,color:ci},{tag:m.changed,color:ci},{tag:m.annotation,color:bi,fontStyle:"italic"},{tag:m.modifier,color:ci,fontStyle:"italic"},{tag:m.self,color:ci},{tag:[m.color,m.constant(m.name),m.standard(m.name)],color:ci},{tag:[m.atom,m.bool,m.special(m.variableName)],color:ci},{tag:[m.processingInstruction,m.inserted],color:jf},{tag:[m.special(m.string),m.regexp],color:il},{tag:m.string,color:il},{tag:m.definition(m.typeName),color:wr,fontWeight:"bold"},{tag:m.meta,color:yt},{tag:m.comment,fontStyle:"italic",color:yt},{tag:m.docComment,fontStyle:"italic",color:yt},{tag:[m.tagName],color:sw},{tag:[m.attributeName],color:tl},{tag:[m.heading],fontWeight:"bold",color:Nt},{tag:[m.strong],fontWeight:"bold",color:Nt},{tag:[m.emphasis],fontStyle:"italic",color:il},{tag:[m.link],color:uw,fontWeight:"500",textDecoration:"underline",textUnderlinePosition:"under"},{tag:[m.url],color:da,textDecoration:"underline",textUnderlineOffset:"2px"},{tag:[m.invalid],color:ze,textDecoration:"underline wavy",borderBottom:`1px wavy ${bi}`},{tag:[m.strikethrough],color:bi,textDecoration:"line-through"},{tag:m.constant(m.name),color:ci},{tag:m.deleted,color:bi},{tag:m.squareBracket,color:yt},{tag:m.angleBracket,color:yt},{tag:m.monospace,color:ze},{tag:[m.contentSeparator],color:Nt},{tag:m.quote,color:yt}]),pw=[dw,Ms(Ow)],mw=r=>{let{state:e}=r,t=e.doc.lineAt(e.selection.main.from),i=Oh(r.state,t.from);return i.line?gw(r):i.block?Sw(r):!1};function dh(r,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=r(e,t);return n?(i(t.update(n)),!0):!1}}const gw=dh(xw,0),bw=dh(Jp,0),Sw=dh((r,e)=>Jp(r,e,yw(e)),0);function Oh(r,e){let t=r.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const vr=50;function Qw(r,{open:e,close:t},i,n){let s=r.sliceDoc(i-vr,i),o=r.sliceDoc(n,n+vr),l=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(o)[0].length,h=s.length-l;if(s.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:n+a,margin:a&&1}};let c,f;n-i<=2*vr?c=f=r.sliceDoc(i,n):(c=r.sliceDoc(i,i+vr),f=r.sliceDoc(n-vr,n));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,O=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(O,O+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:n-d-t.length,margin:/\s/.test(f.charAt(O-1))?1:0}}:null}function yw(r){let e=[];for(let t of r.selection.ranges){let i=r.doc.lineAt(t.from),n=t.to<=i.to?i:r.doc.lineAt(t.to);n.from>i.from&&n.from==t.to&&(n=t.to==i.to+1?i:r.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=n.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return e}function Jp(r,e,t=e.selection.ranges){let i=t.map(s=>Oh(e,s.from).block);if(!i.every(s=>s))return null;let n=t.map((s,o)=>Qw(e,i[o],s.from,s.to));if(r!=2&&!n.every(s=>s))return{changes:e.changes(t.map((s,o)=>n[o]?[]:[{from:s.from,insert:i[o].open+" "},{from:s.to,insert:" "+i[o].close}]))};if(r!=1&&n.some(s=>s)){let s=[];for(let o=0,l;on&&(s==o||o>f.from)){n=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,O=f.text.slice(u,u+h.length)==h?u:-1;us.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&s.push({from:l.from+h,insert:a+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(r!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,s.push({from:h,to:c})}return{changes:s}}return null}const Oa=jt.define(),kw=jt.define(),ww=M.define(),em=M.define({combine(r){return Xt(r,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}}),tm=Se.define({create(){return Tt.empty},update(r,e){let t=e.state.facet(em),i=e.annotation(Oa);if(i){let a=We.fromTransaction(e,i.selection),h=i.side,c=h==0?r.undone:r.done;return a?c=Ds(c,c.length,t.minDepth,a):c=nm(c,e.startState.selection),new Tt(h==0?i.rest:c,h==0?c:i.rest)}let n=e.annotation(kw);if((n=="full"||n=="before")&&(r=r.isolate()),e.annotation(pe.addToHistory)===!1)return e.changes.empty?r:r.addMapping(e.changes.desc);let s=We.fromTransaction(e),o=e.annotation(pe.time),l=e.annotation(pe.userEvent);return s?r=r.addChanges(s,o,l,t,e):e.selection&&(r=r.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(n=="full"||n=="after")&&(r=r.isolate()),r},toJSON(r){return{done:r.done.map(e=>e.toJSON()),undone:r.undone.map(e=>e.toJSON())}},fromJSON(r){return new Tt(r.done.map(We.fromJSON),r.undone.map(We.fromJSON))}});function pa(r={}){return[tm,em.of(r),Z.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?im:e.inputType=="historyRedo"?ma:null;return i?(e.preventDefault(),i(t)):!1}})]}function no(r,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let n=t.field(tm,!1);if(!n)return!1;let s=n.pop(r,t,e);return s?(i(s),!0):!1}}const im=no(0,!1),ma=no(1,!1),vw=no(0,!0),Pw=no(1,!0);class We{constructor(e,t,i,n,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=s}setSelAfter(e){return new We(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(e){return new We(e.changes&&me.fromJSON(e.changes),[],e.mapped&&Ct.fromJSON(e.mapped),e.startSelection&&x.fromJSON(e.startSelection),e.selectionsAfter.map(x.fromJSON))}static fromTransaction(e,t){let i=ot;for(let n of e.startState.facet(ww)){let s=n(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new We(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,ot)}static selection(e){return new We(void 0,ot,void 0,void 0,e)}}function Ds(r,e,t,i){let n=e+1>t+20?e-t-1:0,s=r.slice(n,e);return s.push(i),s}function $w(r,e){let t=[],i=!1;return r.iterChangedRanges((n,s)=>t.push(n,s)),e.iterChangedRanges((n,s,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function Tw(r,e){return r.ranges.length==e.ranges.length&&r.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function rm(r,e){return r.length?e.length?r.concat(e):r:e}const ot=[],Cw=200;function nm(r,e){if(r.length){let t=r[r.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-Cw));return i.length&&i[i.length-1].eq(e)?r:(i.push(e),Ds(r,r.length-1,1e9,t.setSelAfter(i)))}else return[We.selection([e])]}function Aw(r){let e=r[r.length-1],t=r.slice();return t[r.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function ol(r,e){if(!r.length)return r;let t=r.length,i=ot;for(;t;){let n=Zw(r[t-1],e,i);if(n.changes&&!n.changes.empty||n.effects.length){let s=r.slice(0,t);return s[t-1]=n,s}else e=n.mapped,t--,i=n.selectionsAfter}return i.length?[We.selection(i)]:ot}function Zw(r,e,t){let i=rm(r.selectionsAfter.length?r.selectionsAfter.map(l=>l.map(e)):ot,t);if(!r.changes)return We.selection(i);let n=r.changes.map(e),s=e.mapDesc(r.changes,!0),o=r.mapped?r.mapped.composeDesc(s):s;return new We(n,B.mapEffects(r.effects,e),o,r.startSelection.map(s),i)}const Xw=/^(input\.type|delete)($|\.)/;class Tt{constructor(e,t,i=0,n=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Tt(this.done,this.undone):this}addChanges(e,t,i,n,s){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||Xw.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?r.moveByChar(t,e):so(t,e))}function Ce(r){return r.textDirectionAt(r.state.selection.main.head)==oe.LTR}const lm=r=>om(r,!Ce(r)),am=r=>om(r,Ce(r));function hm(r,e){return pt(r,t=>t.empty?r.moveByGroup(t,e):so(t,e))}const Mw=r=>hm(r,!Ce(r)),Rw=r=>hm(r,Ce(r));function Lw(r,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(r.sliceDoc(e.from,e.to)))||e.firstChild}function oo(r,e,t){let i=re(r).resolveInner(e.head),n=t?V.closedBy:V.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;Lw(r,h,n)?i=h:a=t?h.to:h.from}let s=i.type.prop(n),o,l;return s&&(o=t?$t(r,i.from,1):$t(r,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,x.cursor(l,t?-1:1)}const _w=r=>pt(r,e=>oo(r.state,e,!Ce(r))),Ew=r=>pt(r,e=>oo(r.state,e,Ce(r)));function cm(r,e){return pt(r,t=>{if(!t.empty)return so(t,e);let i=r.moveVertically(t,e);return i.head!=t.head?i:r.moveToLineBoundary(t,e)})}const fm=r=>cm(r,!1),um=r=>cm(r,!0);function dm(r){let e=r.scrollDOM.clientHeighto.empty?r.moveVertically(o,e,t.height):so(o,e));if(n.eq(i.selection))return!1;let s;if(t.selfScroll){let o=r.coordsAtPos(i.selection.main.head),l=r.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomOm(r,!1),ga=r=>Om(r,!0);function li(r,e,t){let i=r.lineBlockAt(e.head),n=r.moveToLineBoundary(e,t);if(n.head==e.head&&n.head!=(t?i.to:i.from)&&(n=r.moveToLineBoundary(e,t,!1)),!t&&n.head==i.from&&i.length){let s=/^\s*/.exec(r.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(n=x.cursor(i.from+s))}return n}const zw=r=>pt(r,e=>li(r,e,!0)),Dw=r=>pt(r,e=>li(r,e,!1)),Yw=r=>pt(r,e=>li(r,e,!Ce(r))),Vw=r=>pt(r,e=>li(r,e,Ce(r))),Bw=r=>pt(r,e=>x.cursor(r.lineBlockAt(e.head).from,1)),qw=r=>pt(r,e=>x.cursor(r.lineBlockAt(e.head).to,-1));function Ww(r,e,t){let i=!1,n=ur(r.selection,s=>{let o=$t(r,s.head,-1)||$t(r,s.head,1)||s.head>0&&$t(r,s.head-1,1)||s.headWw(r,e);function ct(r,e){let t=ur(r.state.selection,i=>{let n=e(i);return x.range(i.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return t.eq(r.state.selection)?!1:(r.dispatch(Rt(r.state,t)),!0)}function pm(r,e){return ct(r,t=>r.moveByChar(t,e))}const mm=r=>pm(r,!Ce(r)),gm=r=>pm(r,Ce(r));function bm(r,e){return ct(r,t=>r.moveByGroup(t,e))}const jw=r=>bm(r,!Ce(r)),Nw=r=>bm(r,Ce(r)),Gw=r=>ct(r,e=>oo(r.state,e,!Ce(r))),Uw=r=>ct(r,e=>oo(r.state,e,Ce(r)));function Sm(r,e){return ct(r,t=>r.moveVertically(t,e))}const Qm=r=>Sm(r,!1),ym=r=>Sm(r,!0);function xm(r,e){return ct(r,t=>r.moveVertically(t,e,dm(r).height))}const Kf=r=>xm(r,!1),Jf=r=>xm(r,!0),Fw=r=>ct(r,e=>li(r,e,!0)),Hw=r=>ct(r,e=>li(r,e,!1)),Kw=r=>ct(r,e=>li(r,e,!Ce(r))),Jw=r=>ct(r,e=>li(r,e,Ce(r))),ev=r=>ct(r,e=>x.cursor(r.lineBlockAt(e.head).from)),tv=r=>ct(r,e=>x.cursor(r.lineBlockAt(e.head).to)),eu=({state:r,dispatch:e})=>(e(Rt(r,{anchor:0})),!0),tu=({state:r,dispatch:e})=>(e(Rt(r,{anchor:r.doc.length})),!0),iu=({state:r,dispatch:e})=>(e(Rt(r,{anchor:r.selection.main.anchor,head:0})),!0),ru=({state:r,dispatch:e})=>(e(Rt(r,{anchor:r.selection.main.anchor,head:r.doc.length})),!0),iv=({state:r,dispatch:e})=>(e(r.update({selection:{anchor:0,head:r.doc.length},userEvent:"select"})),!0),rv=({state:r,dispatch:e})=>{let t=lo(r).map(({from:i,to:n})=>x.range(i,Math.min(n+1,r.doc.length)));return e(r.update({selection:x.create(t),userEvent:"select"})),!0},nv=({state:r,dispatch:e})=>{let t=ur(r.selection,i=>{let n=re(r),s=n.resolveStack(i.from,1);if(i.empty){let o=n.resolveStack(i.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return x.range(l.to,l.from)}return i});return t.eq(r.selection)?!1:(e(Rt(r,t)),!0)},sv=({state:r,dispatch:e})=>{let t=r.selection,i=null;return t.ranges.length>1?i=x.create([t.main]):t.main.empty||(i=x.create([x.cursor(t.main.head)])),i?(e(Rt(r,i)),!0):!1};function wn(r,e){if(r.state.readOnly)return!1;let t="delete.selection",{state:i}=r,n=i.changeByRange(s=>{let{from:o,to:l}=s;if(o==l){let a=e(s);ao&&(t="delete.forward",a=Fn(r,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Fn(r,o,!1),l=Fn(r,l,!0);return o==l?{range:s}:{changes:{from:o,to:l},range:x.cursor(o,on(r)))i.between(e,e,(n,s)=>{ne&&(e=t?s:n)});return e}const km=(r,e,t)=>wn(r,i=>{let n=i.from,{state:s}=r,o=s.doc.lineAt(n),l,a;if(t&&!e&&n>o.from&&nkm(r,!1,!0),wm=r=>km(r,!0,!1),vm=(r,e)=>wn(r,t=>{let i=t.head,{state:n}=r,s=n.doc.lineAt(i),o=n.charCategorizer(i);for(let l=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?n.doc.lines:1)&&(i+=e?1:-1);break}let a=ke(s.text,i-s.from,e)+s.from,h=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),Pm=r=>vm(r,!1),ov=r=>vm(r,!0),lv=r=>wn(r,e=>{let t=r.lineBlockAt(e.head).to;return e.headwn(r,e=>{let t=r.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),hv=r=>wn(r,e=>{let t=r.moveToLineBoundary(e,!0).head;return e.head{if(r.readOnly)return!1;let t=r.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:F.of(["",""])},range:x.cursor(i.from)}));return e(r.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},fv=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=r.changeByRange(i=>{if(!i.empty||i.from==0||i.from==r.doc.length)return{range:i};let n=i.from,s=r.doc.lineAt(n),o=n==s.from?n-1:ke(s.text,n-s.from,!1)+s.from,l=n==s.to?n+1:ke(s.text,n-s.from,!0)+s.from;return{changes:{from:o,to:l,insert:r.doc.slice(n,l).append(r.doc.slice(o,n))},range:x.cursor(l)}});return t.changes.empty?!1:(e(r.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function lo(r){let e=[],t=-1;for(let i of r.selection.ranges){let n=r.doc.lineAt(i.from),s=r.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=r.doc.lineAt(i.to-1)),t>=n.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(i)}else e.push({from:n.from,to:s.to,ranges:[i]});t=s.number+1}return e}function $m(r,e,t){if(r.readOnly)return!1;let i=[],n=[];for(let s of lo(r)){if(t?s.to==r.doc.length:s.from==0)continue;let o=r.doc.lineAt(t?s.to+1:s.from-1),l=o.length+1;if(t){i.push({from:s.to,to:o.to},{from:s.from,insert:o.text+r.lineBreak});for(let a of s.ranges)n.push(x.range(Math.min(r.doc.length,a.anchor+l),Math.min(r.doc.length,a.head+l)))}else{i.push({from:o.from,to:s.from},{from:s.to,insert:r.lineBreak+o.text});for(let a of s.ranges)n.push(x.range(a.anchor-l,a.head-l))}}return i.length?(e(r.update({changes:i,scrollIntoView:!0,selection:x.create(n,r.selection.mainIndex),userEvent:"move.line"})),!0):!1}const uv=({state:r,dispatch:e})=>$m(r,e,!1),dv=({state:r,dispatch:e})=>$m(r,e,!0);function Tm(r,e,t){if(r.readOnly)return!1;let i=[];for(let n of lo(r))t?i.push({from:n.from,insert:r.doc.slice(n.from,n.to)+r.lineBreak}):i.push({from:n.to,insert:r.lineBreak+r.doc.slice(n.from,n.to)});return e(r.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Ov=({state:r,dispatch:e})=>Tm(r,e,!1),pv=({state:r,dispatch:e})=>Tm(r,e,!0),mv=r=>{if(r.state.readOnly)return!1;let{state:e}=r,t=e.changes(lo(e).map(({from:n,to:s})=>(n>0?n--:s{let s;if(r.lineWrapping){let o=r.lineBlockAt(n.head),l=r.coordsAtPos(n.head,n.assoc||1);l&&(s=o.bottom+r.documentTop-l.bottom+r.defaultLineHeight/2)}return r.moveVertically(n,!0,s)}).map(t);return r.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function gv(r,e){if(/\(\)|\[\]|\{\}/.test(r.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=re(r).resolveInner(e),i=t.childBefore(e),n=t.childAfter(e),s;return i&&n&&i.to<=e&&n.from>=e&&(s=i.type.prop(V.closedBy))&&s.indexOf(n.name)>-1&&r.doc.lineAt(i.to).from==r.doc.lineAt(n.from).from&&!/\S/.test(r.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}const nu=Cm(!1),bv=Cm(!0);function Cm(r){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(n=>{let{from:s,to:o}=n,l=e.doc.lineAt(s),a=!r&&s==o&&gv(e,s);r&&(s=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new eo(e,{simulateBreak:s,simulateDoubleBreak:!!a}),c=Ia(h,s);for(c==null&&(c=ut(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));ol.from&&s{let n=[];for(let o=i.from;o<=i.to;){let l=r.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,n,i),t=l.number),o=l.to+1}let s=r.changes(n);return{changes:n,range:x.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const Sv=({state:r,dispatch:e})=>{if(r.readOnly)return!1;let t=Object.create(null),i=new eo(r,{overrideIndentation:s=>{let o=t[s];return o??-1}}),n=ph(r,(s,o,l)=>{let a=Ia(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let h=/^\s*/.exec(s.text)[0],c=nn(r,a);(h!=c||l.fromr.readOnly?!1:(e(r.update(ph(r,(t,i)=>{i.push({from:t.from,insert:r.facet(hr)})}),{userEvent:"input.indent"})),!0),Zm=({state:r,dispatch:e})=>r.readOnly?!1:(e(r.update(ph(r,(t,i)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let s=ut(n,r.tabSize),o=0,l=nn(r,Math.max(0,s-As(r)));for(;o(r.setTabFocusMode(),!0),yv=[{key:"Ctrl-b",run:lm,shift:mm,preventDefault:!0},{key:"Ctrl-f",run:am,shift:gm},{key:"Ctrl-p",run:fm,shift:Qm},{key:"Ctrl-n",run:um,shift:ym},{key:"Ctrl-a",run:Bw,shift:ev},{key:"Ctrl-e",run:qw,shift:tv},{key:"Ctrl-d",run:wm},{key:"Ctrl-h",run:ba},{key:"Ctrl-k",run:lv},{key:"Ctrl-Alt-h",run:Pm},{key:"Ctrl-o",run:cv},{key:"Ctrl-t",run:fv},{key:"Ctrl-v",run:ga}],xv=[{key:"ArrowLeft",run:lm,shift:mm,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Mw,shift:jw,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Yw,shift:Kw,preventDefault:!0},{key:"ArrowRight",run:am,shift:gm,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Rw,shift:Nw,preventDefault:!0},{mac:"Cmd-ArrowRight",run:Vw,shift:Jw,preventDefault:!0},{key:"ArrowUp",run:fm,shift:Qm,preventDefault:!0},{mac:"Cmd-ArrowUp",run:eu,shift:iu},{mac:"Ctrl-ArrowUp",run:Hf,shift:Kf},{key:"ArrowDown",run:um,shift:ym,preventDefault:!0},{mac:"Cmd-ArrowDown",run:tu,shift:ru},{mac:"Ctrl-ArrowDown",run:ga,shift:Jf},{key:"PageUp",run:Hf,shift:Kf},{key:"PageDown",run:ga,shift:Jf},{key:"Home",run:Dw,shift:Hw,preventDefault:!0},{key:"Mod-Home",run:eu,shift:iu},{key:"End",run:zw,shift:Fw,preventDefault:!0},{key:"Mod-End",run:tu,shift:ru},{key:"Enter",run:nu,shift:nu},{key:"Mod-a",run:iv},{key:"Backspace",run:ba,shift:ba},{key:"Delete",run:wm},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Pm},{key:"Mod-Delete",mac:"Alt-Delete",run:ov},{mac:"Mod-Backspace",run:av},{mac:"Mod-Delete",run:hv}].concat(yv.map(r=>({mac:r.key,run:r.run,shift:r.shift}))),Xm=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:_w,shift:Gw},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Ew,shift:Uw},{key:"Alt-ArrowUp",run:uv},{key:"Shift-Alt-ArrowUp",run:Ov},{key:"Alt-ArrowDown",run:dv},{key:"Shift-Alt-ArrowDown",run:pv},{key:"Escape",run:sv},{key:"Mod-Enter",run:bv},{key:"Alt-l",mac:"Ctrl-l",run:rv},{key:"Mod-i",run:nv,preventDefault:!0},{key:"Mod-[",run:Zm},{key:"Mod-]",run:Am},{key:"Mod-Alt-\\",run:Sv},{key:"Shift-Mod-k",run:mv},{key:"Shift-Mod-\\",run:Iw},{key:"Mod-/",run:mw},{key:"Alt-A",run:bw},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Qv}].concat(xv),kv={key:"Tab",run:Am,shift:Zm},su=typeof String.prototype.normalize=="function"?r=>r.normalize("NFKD"):r=>r;class or{constructor(e,t,i=0,n=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,n),this.bufferStart=i,this.normalize=s?l=>s(su(l)):su,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ye(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Ta(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=wt(e);let n=this.normalize(t);if(n.length)for(let s=0,o=i;;s++){let l=n.charCodeAt(s),a=this.match(l,o,this.bufferPos+this.bufferStart);if(s==n.length-1){if(a)return this.value=a,this;break}o==i&&sthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,n=i+t[0].length;if(this.matchPos=Ys(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||n.to<=t){let l=new Ui(t,e.sliceString(t,i));return ll.set(e,l),l}if(n.from==t&&n.to==i)return n;let{text:s,from:o}=n;return o>t&&(s=e.sliceString(t,o)+s,o=t),n.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,n=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,match:t},this.matchPos=Ys(this.text,n+(i==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Ui.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Rm.prototype[Symbol.iterator]=Lm.prototype[Symbol.iterator]=function(){return this});function wv(r){try{return new RegExp(r,mh),!0}catch{return!1}}function Ys(r,e){if(e>=r.length)return e;let t=r.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function Sa(r){let e=String(r.state.doc.lineAt(r.state.selection.main.head).number),t=J("input",{class:"cm-textfield",name:"line",value:e}),i=J("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),r.dispatch({effects:Br.of(!1)}),r.focus()):s.keyCode==13&&(s.preventDefault(),n())},onsubmit:s=>{s.preventDefault(),n()}},J("label",r.state.phrase("Go to line"),": ",t)," ",J("button",{class:"cm-button",type:"submit"},r.state.phrase("go")),J("button",{name:"close",onclick:()=>{r.dispatch({effects:Br.of(!1)}),r.focus()},"aria-label":r.state.phrase("close"),type:"button"},["×"]));function n(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=r,l=o.doc.lineAt(o.selection.main.head),[,a,h,c,f]=s,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let g=d/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*g)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let O=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),p=x.cursor(O.from+Math.max(0,Math.min(u,O.length)));r.dispatch({effects:[Br.of(!1),Z.scrollIntoView(p.from,{y:"center"})],selection:p}),r.focus()}return{dom:i}}const Br=B.define(),ou=Se.define({create(){return!0},update(r,e){for(let t of e.effects)t.is(Br)&&(r=t.value);return r},provide:r=>tn.from(r,e=>e?Sa:null)}),vv=r=>{let e=en(r,Sa);if(!e){let t=[Br.of(!0)];r.state.field(ou,!1)==null&&t.push(B.appendConfig.of([ou,Pv])),r.dispatch({effects:t}),e=en(r,Sa)}return e&&e.dom.querySelector("input").select(),!0},Pv=Z.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),$v={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},_m=M.define({combine(r){return Xt(r,$v,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function Em(r){let e=[Xv,Zv];return r&&e.push(_m.of(r)),e}const Tv=_.mark({class:"cm-selectionMatch"}),Cv=_.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function lu(r,e,t,i){return(t==0||r(e.sliceDoc(t-1,t))!=he.Word)&&(i==e.doc.length||r(e.sliceDoc(i,i+1))!=he.Word)}function Av(r,e,t,i){return r(e.sliceDoc(t,t+1))==he.Word&&r(e.sliceDoc(i-1,i))==he.Word}const Zv=de.fromClass(class{constructor(r){this.decorations=this.getDeco(r)}update(r){(r.selectionSet||r.docChanged||r.viewportChanged)&&(this.decorations=this.getDeco(r.view))}getDeco(r){let e=r.state.facet(_m),{state:t}=r,i=t.selection;if(i.ranges.length>1)return _.none;let n=i.main,s,o=null;if(n.empty){if(!e.highlightWordAroundCursor)return _.none;let a=t.wordAt(n.head);if(!a)return _.none;o=t.charCategorizer(n.head),s=t.sliceDoc(a.from,a.to)}else{let a=n.to-n.from;if(a200)return _.none;if(e.wholeWords){if(s=t.sliceDoc(n.from,n.to),o=t.charCategorizer(n.head),!(lu(o,t,n.from,n.to)&&Av(o,t,n.from,n.to)))return _.none}else if(s=t.sliceDoc(n.from,n.to),!s)return _.none}let l=[];for(let a of r.visibleRanges){let h=new or(t.doc,s,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||lu(o,t,c,f))&&(n.empty&&c<=n.from&&f>=n.to?l.push(Cv.range(c,f)):(c>=n.to||f<=n.from)&&l.push(Tv.range(c,f)),l.length>e.maxMatches))return _.none}}return _.set(l)}},{decorations:r=>r.decorations}),Xv=Z.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Mv=({state:r,dispatch:e})=>{let{selection:t}=r,i=x.create(t.ranges.map(n=>r.wordAt(n.head)||x.cursor(n.head)),t.mainIndex);return i.eq(t)?!1:(e(r.update({selection:i})),!0)};function Rv(r,e){let{main:t,ranges:i}=r.selection,n=r.wordAt(t.head),s=n&&n.from==t.from&&n.to==t.to;for(let o=!1,l=new or(r.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new or(r.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(s){let a=r.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Lv=({state:r,dispatch:e})=>{let{ranges:t}=r.selection;if(t.some(s=>s.from===s.to))return Mv({state:r,dispatch:e});let i=r.sliceDoc(t[0].from,t[0].to);if(r.selection.ranges.some(s=>r.sliceDoc(s.from,s.to)!=i))return!1;let n=Rv(r,i);return n?(e(r.update({selection:r.selection.addRange(x.range(n.from,n.to),!1),effects:Z.scrollIntoView(n.to)})),!0):!1},dr=M.define({combine(r){return Xt(r,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new jv(e),scrollToMatch:e=>Z.scrollIntoView(e)})}});class zm{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||wv(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Dv(this):new Ev(this)}getCursor(e,t=0,i){let n=e.doc?e:I.create({doc:e});return i==null&&(i=n.doc.length),this.regexp?Ei(this,n,t,i):_i(this,n,t,i)}}class Dm{constructor(e){this.spec=e}}function _i(r,e,t,i){return new or(e.doc,r.unquoted,t,i,r.caseSensitive?void 0:n=>n.toLowerCase(),r.wholeWord?_v(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function _v(r,e){return(t,i,n,s)=>((s>t||s+n.length=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=_i(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}}function Ei(r,e,t,i){return new Rm(e.doc,r.search,{ignoreCase:!r.caseSensitive,test:r.wholeWord?zv(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Vs(r,e){return r.slice(ke(r,e,!1),e)}function Bs(r,e){return r.slice(e,ke(r,e))}function zv(r){return(e,t,i)=>!i[0].length||(r(Vs(i.input,i.index))!=he.Word||r(Bs(i.input,i.index))!=he.Word)&&(r(Bs(i.input,i.index+i[0].length))!=he.Word||r(Vs(i.input,i.index+i[0].length))!=he.Word)}class Dv extends Dm{nextMatch(e,t,i){let n=Ei(this.spec,e,i,e.doc.length).next();return n.done&&(n=Ei(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let s=Math.max(t,i-n*1e4),o=Ei(this.spec,e,s,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let n=i.length;n>0;n--){let s=+i.slice(0,n);if(s>0&&s=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=Ei(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}}const un=B.define(),gh=B.define(),ti=Se.define({create(r){return new al(Qa(r).create(),null)},update(r,e){for(let t of e.effects)t.is(un)?r=new al(t.value.create(),r.panel):t.is(gh)&&(r=new al(r.query,t.value?bh:null));return r},provide:r=>tn.from(r,e=>e.panel)});class al{constructor(e,t){this.query=e,this.panel=t}}const Yv=_.mark({class:"cm-searchMatch"}),Vv=_.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Bv=de.fromClass(class{constructor(r){this.view=r,this.decorations=this.highlight(r.state.field(ti))}update(r){let e=r.state.field(ti);(e!=r.startState.field(ti)||r.docChanged||r.selectionSet||r.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:r,panel:e}){if(!e||!r.spec.valid)return _.none;let{view:t}=this,i=new Bt;for(let n=0,s=t.visibleRanges,o=s.length;ns[n+1].from-500;)a=s[++n].to;r.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Vv:Yv)})}return i.finish()}},{decorations:r=>r.decorations});function vn(r){return e=>{let t=e.state.field(ti,!1);return t&&t.query.spec.valid?r(e,t):Bm(e)}}const qs=vn((r,{query:e})=>{let{to:t}=r.state.selection.main,i=e.nextMatch(r.state,t,t);if(!i)return!1;let n=x.single(i.from,i.to),s=r.state.facet(dr);return r.dispatch({selection:n,effects:[Sh(r,i),s.scrollToMatch(n.main,r)],userEvent:"select.search"}),Vm(r),!0}),Ws=vn((r,{query:e})=>{let{state:t}=r,{from:i}=t.selection.main,n=e.prevMatch(t,i,i);if(!n)return!1;let s=x.single(n.from,n.to),o=r.state.facet(dr);return r.dispatch({selection:s,effects:[Sh(r,n),o.scrollToMatch(s.main,r)],userEvent:"select.search"}),Vm(r),!0}),qv=vn((r,{query:e})=>{let t=e.matchAll(r.state,1e3);return!t||!t.length?!1:(r.dispatch({selection:x.create(t.map(i=>x.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Wv=({state:r,dispatch:e})=>{let t=r.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:n}=t.main,s=[],o=0;for(let l=new or(r.doc,r.sliceDoc(i,n));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(x.range(l.value.from,l.value.to))}return e(r.update({selection:x.create(s,o),userEvent:"select.search.matches"})),!0},au=vn((r,{query:e})=>{let{state:t}=r,{from:i,to:n}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,i,i);if(!s)return!1;let o=s,l=[],a,h,c=[];o.from==i&&o.to==n&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(Z.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+".")));let f=r.state.changes(l);return o&&(a=x.single(o.from,o.to).map(f),c.push(Sh(r,o)),c.push(t.facet(dr).scrollToMatch(a.main,r))),r.dispatch({changes:f,selection:a,effects:c,userEvent:"input.replace"}),!0}),Iv=vn((r,{query:e})=>{if(r.state.readOnly)return!1;let t=e.matchAll(r.state,1e9).map(n=>{let{from:s,to:o}=n;return{from:s,to:o,insert:e.getReplacement(n)}});if(!t.length)return!1;let i=r.state.phrase("replaced $ matches",t.length)+".";return r.dispatch({changes:t,effects:Z.announce.of(i),userEvent:"input.replace.all"}),!0});function bh(r){return r.state.facet(dr).createPanel(r)}function Qa(r,e){var t,i,n,s,o;let l=r.selection.main,a=l.empty||l.to>l.from+100?"":r.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=r.facet(dr);return new zm({search:((t=e?.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e?.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(n=e?.literal)!==null&&n!==void 0?n:h.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Ym(r){let e=en(r,bh);return e&&e.dom.querySelector("[main-field]")}function Vm(r){let e=Ym(r);e&&e==r.root.activeElement&&e.select()}const Bm=r=>{let e=r.state.field(ti,!1);if(e&&e.panel){let t=Ym(r);if(t&&t!=r.root.activeElement){let i=Qa(r.state,e.query.spec);i.valid&&r.dispatch({effects:un.of(i)}),t.focus(),t.select()}}else r.dispatch({effects:[gh.of(!0),e?un.of(Qa(r.state,e.query.spec)):B.appendConfig.of(Gv)]});return!0},qm=r=>{let e=r.state.field(ti,!1);if(!e||!e.panel)return!1;let t=en(r,bh);return t&&t.dom.contains(r.root.activeElement)&&r.focus(),r.dispatch({effects:gh.of(!1)}),!0},Wm=[{key:"Mod-f",run:Bm,scope:"editor search-panel"},{key:"F3",run:qs,shift:Ws,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:qs,shift:Ws,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:qm,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Wv},{key:"Mod-Alt-g",run:vv},{key:"Mod-d",run:Lv,preventDefault:!0}];class jv{constructor(e){this.view=e;let t=this.query=e.state.field(ti).query.spec;this.commit=this.commit.bind(this),this.searchField=J("input",{value:t.search,placeholder:Ne(e,"Find"),"aria-label":Ne(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=J("input",{value:t.replace,placeholder:Ne(e,"Replace"),"aria-label":Ne(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=J("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=J("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=J("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(n,s,o){return J("button",{class:"cm-button",name:n,onclick:s,type:"button"},o)}this.dom=J("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>qs(e),[Ne(e,"next")]),i("prev",()=>Ws(e),[Ne(e,"previous")]),i("select",()=>qv(e),[Ne(e,"all")]),J("label",null,[this.caseField,Ne(e,"match case")]),J("label",null,[this.reField,Ne(e,"regexp")]),J("label",null,[this.wordField,Ne(e,"by word")]),...e.state.readOnly?[]:[J("br"),this.replaceField,i("replace",()=>au(e),[Ne(e,"replace")]),i("replaceAll",()=>Iv(e),[Ne(e,"replace all")])],J("button",{name:"close",onclick:()=>qm(e),"aria-label":Ne(e,"close"),type:"button"},["×"])])}commit(){let e=new zm({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:un.of(e)}))}keydown(e){bb(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ws:qs)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),au(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(un)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(dr).top}}function Ne(r,e){return r.state.phrase(e)}const Hn=30,Kn=/[\s\.,:;?!]/;function Sh(r,{from:e,to:t}){let i=r.state.doc.lineAt(e),n=r.state.doc.lineAt(t).to,s=Math.max(i.from,e-Hn),o=Math.min(n,t+Hn),l=r.state.sliceDoc(s,o);if(s!=i.from){for(let a=0;al.length-Hn;a--)if(!Kn.test(l[a-1])&&Kn.test(l[a])){l=l.slice(0,a);break}}return Z.announce.of(`${r.state.phrase("current match")}. ${l} ${r.state.phrase("on line")} ${i.number}.`)}const Nv=Z.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Gv=[ti,It.low(Bv),Nv];class hu{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Oi{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let n=i.facet(dn).markerFilter;n&&(e=n(e,i));let s=e.slice().sort((c,f)=>c.from-f.from||c.to-f.to),o=new Bt,l=[],a=0;for(let c=0;;){let f=c==s.length?null:s[c];if(!f&&!l.length)break;let u,d;for(l.length?(u=a,d=l.reduce((p,g)=>Math.min(p,g.to),f&&f.from>u?f.from:1e8)):(u=f.from,d=f.to,l.push(f),c++);cp.from||p.to==u))l.push(p),c++,d=Math.min(p.to,d);else{d=Math.min(p.from,d);break}}let O=oP(l);if(l.some(p=>p.from==p.to||p.from==p.to-1&&i.doc.lineAt(p.from).to==p.from))o.add(u,u,_.widget({widget:new iP(O),diagnostics:l.slice()}));else{let p=l.reduce((g,b)=>b.markClass?g+" "+b.markClass:g,"");o.add(u,d,_.mark({class:"cm-lintRange cm-lintRange-"+O+p,diagnostics:l.slice(),inclusiveEnd:l.some(g=>g.to>d)}))}a=d;for(let p=0;p{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new hu(n,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new hu(i.from,s,i.diagnostic)}}),i}function Uv(r,e){let t=e.pos,i=e.end||t,n=r.state.facet(dn).hideOn(r,t,i);if(n!=null)return n;let s=r.startState.doc.lineAt(e.pos);return!!(r.effects.some(o=>o.is(Im))||r.changes.touchesRange(s.from,Math.max(s.to,i)))}function Fv(r,e){return r.field(Fe,!1)?e:e.concat(B.appendConfig.of(lP))}const Im=B.define(),Qh=B.define(),jm=B.define(),Fe=Se.define({create(){return new Oi(_.none,null,null)},update(r,e){if(e.docChanged&&r.diagnostics.size){let t=r.diagnostics.map(e.changes),i=null,n=r.panel;if(r.selected){let s=e.changes.mapPos(r.selected.from,1);i=lr(t,r.selected.diagnostic,s)||lr(t,null,s)}!t.size&&n&&e.state.facet(dn).autoPanel&&(n=null),r=new Oi(t,n,i)}for(let t of e.effects)if(t.is(Im)){let i=e.state.facet(dn).autoPanel?t.value.length?On.open:null:r.panel;r=Oi.init(t.value,i,e.state)}else t.is(Qh)?r=new Oi(r.diagnostics,t.value?On.open:null,r.selected):t.is(jm)&&(r=new Oi(r.diagnostics,r.panel,t.value));return r},provide:r=>[tn.from(r,e=>e.panel),Z.decorations.from(r,e=>e.diagnostics)]}),Hv=_.mark({class:"cm-lintRange cm-lintRange-active"});function Kv(r,e,t){let{diagnostics:i}=r.state.field(Fe),n,s=-1,o=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{if(e>=a&&e<=h&&(a==h||(e>a||t>0)&&(eUm(r,t,!1)))}const eP=r=>{let e=r.state.field(Fe,!1);(!e||!e.panel)&&r.dispatch({effects:Fv(r.state,[Qh.of(!0)])});let t=en(r,On.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},cu=r=>{let e=r.state.field(Fe,!1);return!e||!e.panel?!1:(r.dispatch({effects:Qh.of(!1)}),!0)},tP=r=>{let e=r.state.field(Fe,!1);if(!e)return!1;let t=r.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(r.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},Nm=[{key:"Mod-Shift-m",run:eP,preventDefault:!0},{key:"F8",run:tP}],dn=M.define({combine(r){return Object.assign({sources:r.map(e=>e.source).filter(e=>e!=null)},Xt(r.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function Gm(r){let e=[];if(r)e:for(let{name:t}of r){for(let i=0;is.toLowerCase()==n.toLowerCase())){e.push(n);continue e}}e.push("")}return e}function Um(r,e,t){var i;let n=t?Gm(e.actions):[];return J("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},J("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(r):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,a=u=>{if(u.preventDefault(),l)return;l=!0;let d=lr(r.state.field(Fe).diagnostics,e);d&&s.apply(r,d.from,d.to)},{name:h}=s,c=n[o]?h.indexOf(n[o]):-1,f=c<0?h:[h.slice(0,c),J("u",h.slice(c,c+1)),h.slice(c+1)];return J("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${h}${c<0?"":` (access key "${n[o]})"`}.`},f)}),e.source&&J("div",{class:"cm-diagnosticSource"},e.source))}class iP extends Mt{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return J("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class fu{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Um(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class On{constructor(e){this.view=e,this.items=[];let t=n=>{if(n.keyCode==27)cu(this.view),this.view.focus();else if(n.keyCode==38||n.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(n.keyCode==40||n.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(n.keyCode==36)this.moveSelection(0);else if(n.keyCode==35)this.moveSelection(this.items.length-1);else if(n.keyCode==13)this.view.focus();else if(n.keyCode>=65&&n.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Gm(s.actions);for(let l=0;l{for(let s=0;scu(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Fe).selected;if(!e)return-1;for(let t=0;t{for(let c of h.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,u;for(let d=i;di&&(this.items.splice(i,f-i),n=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),s=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let h=a.height/this.list.offsetHeight;l.topa.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),n&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Fe),i=lr(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:jm.of(i)})}static open(e){return new On(e)}}function rP(r,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(r)}')`}function Jn(r){return rP(``,'width="6" height="3"')}const nP=Z.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Jn("#d11")},".cm-lintRange-warning":{backgroundImage:Jn("orange")},".cm-lintRange-info":{backgroundImage:Jn("#999")},".cm-lintRange-hint":{backgroundImage:Jn("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function sP(r){return r=="error"?4:r=="warning"?3:r=="info"?2:1}function oP(r){let e="hint",t=1;for(let i of r){let n=sP(i.severity);n>t&&(t=n,e=i.severity)}return e}const lP=[Fe,Z.decorations.compute([Fe],r=>{let{selected:e,panel:t}=r.field(Fe);return!e||!t||e.from==e.to?_.none:_.set([Hv.range(e.from,e.to)])}),eS(Kv,{hideOn:Uv}),nP],aP=[cO(),fO(),tO(),pa(),Hl(),Nl(),eO(),I.allowMultipleSelections.of(!0),pO(),Ms(Jl,{fallback:!0}),CO(),zO(),qO(),rO(),nO(),iO(),Em(),ar.of([...VO,...Xm,...Wm,...sm,...yO,...ih,...Nm])];function hP(r,e,t=!1){let i;return function(...s){const o=this;i?clearTimeout(i):t&&r.apply(o,s),i=setTimeout(l,e);function l(){t||r.apply(o,s),i=null}}}var cP=Le("
"),fP=Le('

Loading editor...

 
');function uP(r,e){Ns(e,!0);let t=N(e,"value",15,""),i=N(e,"extensions",19,()=>[]),n=N(e,"allowMultiSelect",3,!0),s=N(e,"useTab",3,!0),o=N(e,"tabSize",3,2),l=N(e,"lineWrapping",3,!1),a=N(e,"lineNumbers",3,!0),h=N(e,"highlight",19,()=>({activeLine:!0,activeLineGutter:!0,specialChars:!0,selectionMatches:!0})),c=N(e,"history",3,!0),f=N(e,"foldGutter",3,!0),u=N(e,"drawSelection",3,!0),d=N(e,"dropCursor",3,!0),O=N(e,"indentOnInput",3,!0),p=N(e,"syntaxHighlighting",3,!0),g=N(e,"bracketMatching",3,!0),b=N(e,"closeBrackets",3,!0),S=N(e,"autocompletion",3,!0),w=N(e,"rectangularSelection",3,!0),v=N(e,"crosshairCursor",3,!0),y=N(e,"editable",3,!0),Q=N(e,"readonly",3,!1),k=N(e,"nodebounce",3,!1),R=N(e,"class",3,"");const z=typeof window<"u";let A=De(void 0),P=De(void 0),T=De(!1),Y=De(!1),q=De(!0),D=De(!0),K=ft(()=>[...Je(),...Lt(),...i()]);Mr(()=>{t(),E(P)&&Os(()=>_e(t()))}),Mr(()=>{E(P)&&E(K)&&Os(ce)});let fe=ft(()=>k()?Ke:hP(Ke,300));Cg(()=>{j(P,we(),!0),e.onready?.(E(P))}),Ag(()=>E(P)?.destroy());function we(){return new Z({parent:E(A),state:Ae(t()),dispatch(W){E(P)&&(E(P).update([W]),!E(T)&&W.docChanged&&E(fe)())}})}function ce(){if(E(q)){j(q,!1);return}E(P)&&(E(P).dispatch({effects:B.reconfigure.of(E(K))}),e.onreconfigure?.(E(P)))}function _e(W){if(E(D)){j(D,!1);return}if(E(Y)){j(Y,!1);return}j(T,!0),E(P).setState(Ae(W)),j(T,!1)}function Ke(){if(E(P)){const W=E(P).state.doc.toString();if(W===t())return;j(Y,!0),t(W),e.onchange?.(t())}}function Ae(W){return I.create({doc:W??void 0,extensions:E(K)})}function Je(){const W=[hr.of(" ".repeat(o())),Z.editable.of(y()),I.readOnly.of(Q()),I.allowMultipleSelections.of(n())],Ze=[...Xm,...Wm,...Nm];if(s()&&Ze.push(kv),a()&&W.push(cO(a()===!0?void 0:a())),h().activeLine&&W.push(iO()),h().activeLineGutter&&W.push(fO()),d()&&W.push(eO()),O()&&W.push(pO()),e.placeholder&&W.push(Vb(e.placeholder)),e.lang&&W.push(e.lang),l()&&W.push(Z.lineWrapping),h().specialChars&&W.push(tO(h().specialChars===!0?void 0:h().specialChars)),h().selectionMatches&&W.push(Em(h().selectionMatches===!0?void 0:h().selectionMatches)),c()&&(W.push(c()===!0?pa():pa(c())),Ze.push(...sm)),f()&&(W.push(f()===!0?Hl():Hl(f())),Ze.push(...yO)),u()&&W.push(u()===!0?Nl():Nl(u())),p())if(p()===!0)W.push(Ms(Jl,{fallback:!0}));else{const{highlighter:Ai=Jl,fallback:ao=!0}=p();W.push(Ms(Ai,{fallback:ao}))}return g()&&W.push(CO(g()===!0?void 0:g())),b()&&(W.push(zO()),Ze.push(...VO)),S()&&(W.push(qO(S()===!0?void 0:S())),Ze.push(...ih)),w()&&W.push(rO(w()===!0?void 0:w())),v()&&W.push(nO(v()===!0?void 0:v())),W.push(ar.of(Ze)),W}function Lt(){const W=[];return e.styles&&W.push(Z.theme(e.styles)),e.theme&&W.push(e.theme),W}var _t=Vi(),Ci=Bi(_t);{var Pn=W=>{var Ze=cP();vg(Ze,Ai=>j(A,Ai),()=>E(A)),it(()=>qr(Ze,1,Wr(["codemirror-wrapper",R()]),"svelte-3fyul5")),se(W,Ze)},Fm=W=>{var Ze=fP(),Ai=Xe(le(Ze),2),ao=le(Ai,!0);ae(Ai),ae(Ze),it(()=>{qr(Ze,1,Wr(["scm-waiting",R()]),"svelte-3fyul5"),ui(ao,t())}),se(W,Ze)};St(Ci,W=>{z?W(Pn):W(Fm,!1)})}se(r,_t),Us()}var dP=Le(' '),OP=Le('

'),pP=Le('
'),mP=Le('
'),gP=Le('
 
'),bP=Le('

');function hl(r,e){Ns(e,!0);let t=N(e,"value",15),i=N(e,"placeholder",3,""),n=N(e,"readonly",3,!1);var s=bP(),o=le(s),l=le(o);{var a=A=>{Kk(A,{class:"mr-2 h-5 w-5 text-green-500"})},h=A=>{var P=Vi(),T=Bi(P);{var Y=D=>{iw(D,{class:"mr-2 h-5 w-5 text-red-500"})},q=D=>{var K=Vi(),fe=Bi(K);{var we=ce=>{ew(ce,{class:"mr-2 h-5 w-5 text-gray-400"})};St(fe,ce=>{e.status==="indeterminate"&&ce(we)},!0)}se(D,K)};St(T,D=>{e.status==="error"?D(Y):D(q,!1)},!0)}se(A,P)};St(l,A=>{e.status==="success"?A(a):A(h,!1)})}var c=Xe(l,2),f=le(c),u=le(f),d=Xe(u);{var O=A=>{var P=dP(),T=le(P,!0);ae(P),it(()=>ui(T,e.pillText)),se(A,P)};St(d,A=>{e.pillText&&A(O)})}ae(f);var p=Xe(f,2);{var g=A=>{var P=OP(),T=le(P,!0);ae(P),it(()=>ui(T,e.subtitle)),se(A,P)};St(p,A=>{e.subtitle&&A(g)})}ae(c);var b=Xe(c,2);{var S=A=>{var P=pP(),T=le(P);wh(T,()=>e.headerActions),ae(P),se(A,P)};St(b,A=>{e.headerActions&&A(S)})}var w=Xe(b,2);{var v=A=>{var P=mP(),T=le(P);ae(P),it(()=>ui(T,`${e.timing??""}ms`)),se(A,P)};St(w,A=>{e.timing!==void 0&&A(v)})}ae(o);var y=Xe(o,2);{var Q=A=>{var P=gP(),T=le(P),Y=le(T,!0);ae(T),ae(P),it(()=>ui(Y,e.error)),se(A,P)};St(y,A=>{e.error&&A(Q)})}var k=Xe(y,2);{let A=ft(()=>[aP,e.langExtension].filter(Boolean));uP(k,{get extensions(){return E(A)},get theme(){return pw},get placeholder(){return i()},get readonly(){return n()},class:"text-sm",get value(){return t()},set value(P){t(P)}})}var R=Xe(k,2);{var z=A=>{var P=Vi(),T=Bi(P);wh(T,()=>e.children),se(A,P)};St(R,A=>{e.children&&A(z)})}ae(s),it(()=>ui(u,`${e.title??""} `)),se(r,s),Us()}function SP(r,e,t){j(e,t)}var QP=(r,e)=>e(r.currentTarget.value),yP=Le(""),xP=Le(''),kP=Le(''),wP=Le('
');function vP(r,e){Ns(e,!0);const t=()=>Pg(Ik,"$wasmReady",i),[i,n]=$g();let s=De(co([]));const o=`--- +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Dv(this):new Ev(this)}getCursor(e,t=0,i){let n=e.doc?e:I.create({doc:e});return i==null&&(i=n.doc.length),this.regexp?Ei(this,n,t,i):_i(this,n,t,i)}}class Dm{constructor(e){this.spec=e}}function _i(r,e,t,i){return new or(e.doc,r.unquoted,t,i,r.caseSensitive?void 0:n=>n.toLowerCase(),r.wholeWord?_v(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function _v(r,e){return(t,i,n,s)=>((s>t||s+n.length=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=_i(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}}function Ei(r,e,t,i){return new Rm(e.doc,r.search,{ignoreCase:!r.caseSensitive,test:r.wholeWord?zv(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Vs(r,e){return r.slice(ke(r,e,!1),e)}function Bs(r,e){return r.slice(e,ke(r,e))}function zv(r){return(e,t,i)=>!i[0].length||(r(Vs(i.input,i.index))!=he.Word||r(Bs(i.input,i.index))!=he.Word)&&(r(Bs(i.input,i.index+i[0].length))!=he.Word||r(Vs(i.input,i.index+i[0].length))!=he.Word)}class Dv extends Dm{nextMatch(e,t,i){let n=Ei(this.spec,e,i,e.doc.length).next();return n.done&&(n=Ei(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let s=Math.max(t,i-n*1e4),o=Ei(this.spec,e,s,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(s==t||l.from>s+10))return l;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let n=i.length;n>0;n--){let s=+i.slice(0,n);if(s>0&&s=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let s=Ei(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}}const un=B.define(),gh=B.define(),ti=Se.define({create(r){return new al(Qa(r).create(),null)},update(r,e){for(let t of e.effects)t.is(un)?r=new al(t.value.create(),r.panel):t.is(gh)&&(r=new al(r.query,t.value?bh:null));return r},provide:r=>tn.from(r,e=>e.panel)});class al{constructor(e,t){this.query=e,this.panel=t}}const Yv=_.mark({class:"cm-searchMatch"}),Vv=_.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Bv=de.fromClass(class{constructor(r){this.view=r,this.decorations=this.highlight(r.state.field(ti))}update(r){let e=r.state.field(ti);(e!=r.startState.field(ti)||r.docChanged||r.selectionSet||r.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:r,panel:e}){if(!e||!r.spec.valid)return _.none;let{view:t}=this,i=new Bt;for(let n=0,s=t.visibleRanges,o=s.length;ns[n+1].from-500;)a=s[++n].to;r.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Vv:Yv)})}return i.finish()}},{decorations:r=>r.decorations});function vn(r){return e=>{let t=e.state.field(ti,!1);return t&&t.query.spec.valid?r(e,t):Bm(e)}}const qs=vn((r,{query:e})=>{let{to:t}=r.state.selection.main,i=e.nextMatch(r.state,t,t);if(!i)return!1;let n=x.single(i.from,i.to),s=r.state.facet(dr);return r.dispatch({selection:n,effects:[Sh(r,i),s.scrollToMatch(n.main,r)],userEvent:"select.search"}),Vm(r),!0}),Ws=vn((r,{query:e})=>{let{state:t}=r,{from:i}=t.selection.main,n=e.prevMatch(t,i,i);if(!n)return!1;let s=x.single(n.from,n.to),o=r.state.facet(dr);return r.dispatch({selection:s,effects:[Sh(r,n),o.scrollToMatch(s.main,r)],userEvent:"select.search"}),Vm(r),!0}),qv=vn((r,{query:e})=>{let t=e.matchAll(r.state,1e3);return!t||!t.length?!1:(r.dispatch({selection:x.create(t.map(i=>x.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Wv=({state:r,dispatch:e})=>{let t=r.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:n}=t.main,s=[],o=0;for(let l=new or(r.doc,r.sliceDoc(i,n));!l.next().done;){if(s.length>1e3)return!1;l.value.from==i&&(o=s.length),s.push(x.range(l.value.from,l.value.to))}return e(r.update({selection:x.create(s,o),userEvent:"select.search.matches"})),!0},au=vn((r,{query:e})=>{let{state:t}=r,{from:i,to:n}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,i,i);if(!s)return!1;let o=s,l=[],a,h,c=[];o.from==i&&o.to==n&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(Z.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+".")));let f=r.state.changes(l);return o&&(a=x.single(o.from,o.to).map(f),c.push(Sh(r,o)),c.push(t.facet(dr).scrollToMatch(a.main,r))),r.dispatch({changes:f,selection:a,effects:c,userEvent:"input.replace"}),!0}),Iv=vn((r,{query:e})=>{if(r.state.readOnly)return!1;let t=e.matchAll(r.state,1e9).map(n=>{let{from:s,to:o}=n;return{from:s,to:o,insert:e.getReplacement(n)}});if(!t.length)return!1;let i=r.state.phrase("replaced $ matches",t.length)+".";return r.dispatch({changes:t,effects:Z.announce.of(i),userEvent:"input.replace.all"}),!0});function bh(r){return r.state.facet(dr).createPanel(r)}function Qa(r,e){var t,i,n,s,o;let l=r.selection.main,a=l.empty||l.to>l.from+100?"":r.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=r.facet(dr);return new zm({search:((t=e?.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e?.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(n=e?.literal)!==null&&n!==void 0?n:h.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function Ym(r){let e=en(r,bh);return e&&e.dom.querySelector("[main-field]")}function Vm(r){let e=Ym(r);e&&e==r.root.activeElement&&e.select()}const Bm=r=>{let e=r.state.field(ti,!1);if(e&&e.panel){let t=Ym(r);if(t&&t!=r.root.activeElement){let i=Qa(r.state,e.query.spec);i.valid&&r.dispatch({effects:un.of(i)}),t.focus(),t.select()}}else r.dispatch({effects:[gh.of(!0),e?un.of(Qa(r.state,e.query.spec)):B.appendConfig.of(Gv)]});return!0},qm=r=>{let e=r.state.field(ti,!1);if(!e||!e.panel)return!1;let t=en(r,bh);return t&&t.dom.contains(r.root.activeElement)&&r.focus(),r.dispatch({effects:gh.of(!1)}),!0},Wm=[{key:"Mod-f",run:Bm,scope:"editor search-panel"},{key:"F3",run:qs,shift:Ws,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:qs,shift:Ws,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:qm,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Wv},{key:"Mod-Alt-g",run:vv},{key:"Mod-d",run:Lv,preventDefault:!0}];class jv{constructor(e){this.view=e;let t=this.query=e.state.field(ti).query.spec;this.commit=this.commit.bind(this),this.searchField=J("input",{value:t.search,placeholder:Ne(e,"Find"),"aria-label":Ne(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=J("input",{value:t.replace,placeholder:Ne(e,"Replace"),"aria-label":Ne(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=J("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=J("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=J("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(n,s,o){return J("button",{class:"cm-button",name:n,onclick:s,type:"button"},o)}this.dom=J("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>qs(e),[Ne(e,"next")]),i("prev",()=>Ws(e),[Ne(e,"previous")]),i("select",()=>qv(e),[Ne(e,"all")]),J("label",null,[this.caseField,Ne(e,"match case")]),J("label",null,[this.reField,Ne(e,"regexp")]),J("label",null,[this.wordField,Ne(e,"by word")]),...e.state.readOnly?[]:[J("br"),this.replaceField,i("replace",()=>au(e),[Ne(e,"replace")]),i("replaceAll",()=>Iv(e),[Ne(e,"replace all")])],J("button",{name:"close",onclick:()=>qm(e),"aria-label":Ne(e,"close"),type:"button"},["×"])])}commit(){let e=new zm({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:un.of(e)}))}keydown(e){bb(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ws:qs)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),au(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(un)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(dr).top}}function Ne(r,e){return r.state.phrase(e)}const Hn=30,Kn=/[\s\.,:;?!]/;function Sh(r,{from:e,to:t}){let i=r.state.doc.lineAt(e),n=r.state.doc.lineAt(t).to,s=Math.max(i.from,e-Hn),o=Math.min(n,t+Hn),l=r.state.sliceDoc(s,o);if(s!=i.from){for(let a=0;al.length-Hn;a--)if(!Kn.test(l[a-1])&&Kn.test(l[a])){l=l.slice(0,a);break}}return Z.announce.of(`${r.state.phrase("current match")}. ${l} ${r.state.phrase("on line")} ${i.number}.`)}const Nv=Z.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Gv=[ti,It.low(Bv),Nv];class hu{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Oi{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let n=i.facet(dn).markerFilter;n&&(e=n(e,i));let s=e.slice().sort((c,f)=>c.from-f.from||c.to-f.to),o=new Bt,l=[],a=0;for(let c=0;;){let f=c==s.length?null:s[c];if(!f&&!l.length)break;let u,d;for(l.length?(u=a,d=l.reduce((p,g)=>Math.min(p,g.to),f&&f.from>u?f.from:1e8)):(u=f.from,d=f.to,l.push(f),c++);cp.from||p.to==u))l.push(p),c++,d=Math.min(p.to,d);else{d=Math.min(p.from,d);break}}let O=oP(l);if(l.some(p=>p.from==p.to||p.from==p.to-1&&i.doc.lineAt(p.from).to==p.from))o.add(u,u,_.widget({widget:new iP(O),diagnostics:l.slice()}));else{let p=l.reduce((g,b)=>b.markClass?g+" "+b.markClass:g,"");o.add(u,d,_.mark({class:"cm-lintRange cm-lintRange-"+O+p,diagnostics:l.slice(),inclusiveEnd:l.some(g=>g.to>d)}))}a=d;for(let p=0;p{if(!(e&&o.diagnostics.indexOf(e)<0))if(!i)i=new hu(n,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new hu(i.from,s,i.diagnostic)}}),i}function Uv(r,e){let t=e.pos,i=e.end||t,n=r.state.facet(dn).hideOn(r,t,i);if(n!=null)return n;let s=r.startState.doc.lineAt(e.pos);return!!(r.effects.some(o=>o.is(Im))||r.changes.touchesRange(s.from,Math.max(s.to,i)))}function Fv(r,e){return r.field(Fe,!1)?e:e.concat(B.appendConfig.of(lP))}const Im=B.define(),Qh=B.define(),jm=B.define(),Fe=Se.define({create(){return new Oi(_.none,null,null)},update(r,e){if(e.docChanged&&r.diagnostics.size){let t=r.diagnostics.map(e.changes),i=null,n=r.panel;if(r.selected){let s=e.changes.mapPos(r.selected.from,1);i=lr(t,r.selected.diagnostic,s)||lr(t,null,s)}!t.size&&n&&e.state.facet(dn).autoPanel&&(n=null),r=new Oi(t,n,i)}for(let t of e.effects)if(t.is(Im)){let i=e.state.facet(dn).autoPanel?t.value.length?On.open:null:r.panel;r=Oi.init(t.value,i,e.state)}else t.is(Qh)?r=new Oi(r.diagnostics,t.value?On.open:null,r.selected):t.is(jm)&&(r=new Oi(r.diagnostics,r.panel,t.value));return r},provide:r=>[tn.from(r,e=>e.panel),Z.decorations.from(r,e=>e.diagnostics)]}),Hv=_.mark({class:"cm-lintRange cm-lintRange-active"});function Kv(r,e,t){let{diagnostics:i}=r.state.field(Fe),n,s=-1,o=-1;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,h,{spec:c})=>{if(e>=a&&e<=h&&(a==h||(e>a||t>0)&&(eUm(r,t,!1)))}const eP=r=>{let e=r.state.field(Fe,!1);(!e||!e.panel)&&r.dispatch({effects:Fv(r.state,[Qh.of(!0)])});let t=en(r,On.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},cu=r=>{let e=r.state.field(Fe,!1);return!e||!e.panel?!1:(r.dispatch({effects:Qh.of(!1)}),!0)},tP=r=>{let e=r.state.field(Fe,!1);if(!e)return!1;let t=r.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(r.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},Nm=[{key:"Mod-Shift-m",run:eP,preventDefault:!0},{key:"F8",run:tP}],dn=M.define({combine(r){return Object.assign({sources:r.map(e=>e.source).filter(e=>e!=null)},Xt(r.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function Gm(r){let e=[];if(r)e:for(let{name:t}of r){for(let i=0;is.toLowerCase()==n.toLowerCase())){e.push(n);continue e}}e.push("")}return e}function Um(r,e,t){var i;let n=t?Gm(e.actions):[];return J("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},J("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(r):e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,o)=>{let l=!1,a=u=>{if(u.preventDefault(),l)return;l=!0;let d=lr(r.state.field(Fe).diagnostics,e);d&&s.apply(r,d.from,d.to)},{name:h}=s,c=n[o]?h.indexOf(n[o]):-1,f=c<0?h:[h.slice(0,c),J("u",h.slice(c,c+1)),h.slice(c+1)];return J("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${h}${c<0?"":` (access key "${n[o]})"`}.`},f)}),e.source&&J("div",{class:"cm-diagnosticSource"},e.source))}class iP extends Mt{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return J("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class fu{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Um(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class On{constructor(e){this.view=e,this.items=[];let t=n=>{if(n.keyCode==27)cu(this.view),this.view.focus();else if(n.keyCode==38||n.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(n.keyCode==40||n.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(n.keyCode==36)this.moveSelection(0);else if(n.keyCode==35)this.moveSelection(this.items.length-1);else if(n.keyCode==13)this.view.focus();else if(n.keyCode>=65&&n.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=Gm(s.actions);for(let l=0;l{for(let s=0;scu(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Fe).selected;if(!e)return-1;for(let t=0;t{for(let c of h.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,u;for(let d=i;di&&(this.items.splice(i,f-i),n=!0)),t&&u.diagnostic==t.diagnostic?u.dom.hasAttribute("aria-selected")||(u.dom.setAttribute("aria-selected","true"),s=u):u.dom.hasAttribute("aria-selected")&&u.dom.removeAttribute("aria-selected"),i++}});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let h=a.height/this.list.offsetHeight;l.topa.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),n&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Fe),i=lr(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:jm.of(i)})}static open(e){return new On(e)}}function rP(r,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(r)}')`}function Jn(r){return rP(``,'width="6" height="3"')}const nP=Z.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Jn("#d11")},".cm-lintRange-warning":{backgroundImage:Jn("orange")},".cm-lintRange-info":{backgroundImage:Jn("#999")},".cm-lintRange-hint":{backgroundImage:Jn("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function sP(r){return r=="error"?4:r=="warning"?3:r=="info"?2:1}function oP(r){let e="hint",t=1;for(let i of r){let n=sP(i.severity);n>t&&(t=n,e=i.severity)}return e}const lP=[Fe,Z.decorations.compute([Fe],r=>{let{selected:e,panel:t}=r.field(Fe);return!e||!t||e.from==e.to?_.none:_.set([Hv.range(e.from,e.to)])}),eS(Kv,{hideOn:Uv}),nP],aP=[cO(),fO(),tO(),pa(),Hl(),Nl(),eO(),I.allowMultipleSelections.of(!0),pO(),Ms(Jl,{fallback:!0}),CO(),zO(),qO(),rO(),nO(),iO(),Em(),ar.of([...VO,...Xm,...Wm,...sm,...yO,...ih,...Nm])];function hP(r,e,t=!1){let i;return function(...s){const o=this;i?clearTimeout(i):t&&r.apply(o,s),i=setTimeout(l,e);function l(){t||r.apply(o,s),i=null}}}var cP=Le("
"),fP=Le('

Loading editor...

 
');function uP(r,e){Ns(e,!0);let t=N(e,"value",15,""),i=N(e,"extensions",19,()=>[]),n=N(e,"allowMultiSelect",3,!0),s=N(e,"useTab",3,!0),o=N(e,"tabSize",3,2),l=N(e,"lineWrapping",3,!1),a=N(e,"lineNumbers",3,!0),h=N(e,"highlight",19,()=>({activeLine:!0,activeLineGutter:!0,specialChars:!0,selectionMatches:!0})),c=N(e,"history",3,!0),f=N(e,"foldGutter",3,!0),u=N(e,"drawSelection",3,!0),d=N(e,"dropCursor",3,!0),O=N(e,"indentOnInput",3,!0),p=N(e,"syntaxHighlighting",3,!0),g=N(e,"bracketMatching",3,!0),b=N(e,"closeBrackets",3,!0),S=N(e,"autocompletion",3,!0),w=N(e,"rectangularSelection",3,!0),v=N(e,"crosshairCursor",3,!0),y=N(e,"editable",3,!0),Q=N(e,"readonly",3,!1),k=N(e,"nodebounce",3,!1),R=N(e,"class",3,"");const z=typeof window<"u";let A=De(void 0),P=De(void 0),T=De(!1),Y=De(!1),q=De(!0),D=De(!0),K=ft(()=>[...Je(),...Lt(),...i()]);Mr(()=>{t(),E(P)&&Os(()=>_e(t()))}),Mr(()=>{E(P)&&E(K)&&Os(ce)});let fe=ft(()=>k()?Ke:hP(Ke,300));Cg(()=>{j(P,we(),!0),e.onready?.(E(P))}),Ag(()=>E(P)?.destroy());function we(){return new Z({parent:E(A),state:Ae(t()),dispatch(W){E(P)&&(E(P).update([W]),!E(T)&&W.docChanged&&E(fe)())}})}function ce(){if(E(q)){j(q,!1);return}E(P)&&(E(P).dispatch({effects:B.reconfigure.of(E(K))}),e.onreconfigure?.(E(P)))}function _e(W){if(E(D)){j(D,!1);return}if(E(Y)){j(Y,!1);return}j(T,!0),E(P).setState(Ae(W)),j(T,!1)}function Ke(){if(E(P)){const W=E(P).state.doc.toString();if(W===t())return;j(Y,!0),t(W),e.onchange?.(t())}}function Ae(W){return I.create({doc:W??void 0,extensions:E(K)})}function Je(){const W=[hr.of(" ".repeat(o())),Z.editable.of(y()),I.readOnly.of(Q()),I.allowMultipleSelections.of(n())],Ze=[...Xm,...Wm,...Nm];if(s()&&Ze.push(kv),a()&&W.push(cO(a()===!0?void 0:a())),h().activeLine&&W.push(iO()),h().activeLineGutter&&W.push(fO()),d()&&W.push(eO()),O()&&W.push(pO()),e.placeholder&&W.push(Vb(e.placeholder)),e.lang&&W.push(e.lang),l()&&W.push(Z.lineWrapping),h().specialChars&&W.push(tO(h().specialChars===!0?void 0:h().specialChars)),h().selectionMatches&&W.push(Em(h().selectionMatches===!0?void 0:h().selectionMatches)),c()&&(W.push(c()===!0?pa():pa(c())),Ze.push(...sm)),f()&&(W.push(f()===!0?Hl():Hl(f())),Ze.push(...yO)),u()&&W.push(u()===!0?Nl():Nl(u())),p())if(p()===!0)W.push(Ms(Jl,{fallback:!0}));else{const{highlighter:Ai=Jl,fallback:ao=!0}=p();W.push(Ms(Ai,{fallback:ao}))}return g()&&W.push(CO(g()===!0?void 0:g())),b()&&(W.push(zO()),Ze.push(...VO)),S()&&(W.push(qO(S()===!0?void 0:S())),Ze.push(...ih)),w()&&W.push(rO(w()===!0?void 0:w())),v()&&W.push(nO(v()===!0?void 0:v())),W.push(ar.of(Ze)),W}function Lt(){const W=[];return e.styles&&W.push(Z.theme(e.styles)),e.theme&&W.push(e.theme),W}var _t=Vi(),Ci=Bi(_t);{var Pn=W=>{var Ze=cP();vg(Ze,Ai=>j(A,Ai),()=>E(A)),it(()=>qr(Ze,1,Wr(["codemirror-wrapper",R()]),"svelte-3fyul5")),se(W,Ze)},Fm=W=>{var Ze=fP(),Ai=Xe(le(Ze),2),ao=le(Ai,!0);ae(Ai),ae(Ze),it(()=>{qr(Ze,1,Wr(["scm-waiting",R()]),"svelte-3fyul5"),ui(ao,t())}),se(W,Ze)};St(Ci,W=>{z?W(Pn):W(Fm,!1)})}se(r,_t),Us()}var dP=Le(' '),OP=Le('

'),pP=Le('
'),mP=Le('
'),gP=Le('
 
'),bP=Le('

');function hl(r,e){Ns(e,!0);let t=N(e,"value",15),i=N(e,"placeholder",3,""),n=N(e,"readonly",3,!1);var s=bP(),o=le(s),l=le(o);{var a=A=>{Kk(A,{class:"mr-2 h-5 w-5 text-green-500"})},h=A=>{var P=Vi(),T=Bi(P);{var Y=D=>{iw(D,{class:"mr-2 h-5 w-5 text-red-500"})},q=D=>{var K=Vi(),fe=Bi(K);{var we=ce=>{ew(ce,{class:"mr-2 h-5 w-5 text-gray-400"})};St(fe,ce=>{e.status==="indeterminate"&&ce(we)},!0)}se(D,K)};St(T,D=>{e.status==="error"?D(Y):D(q,!1)},!0)}se(A,P)};St(l,A=>{e.status==="success"?A(a):A(h,!1)})}var c=Xe(l,2),f=le(c),u=le(f),d=Xe(u);{var O=A=>{var P=dP(),T=le(P,!0);ae(P),it(()=>ui(T,e.pillText)),se(A,P)};St(d,A=>{e.pillText&&A(O)})}ae(f);var p=Xe(f,2);{var g=A=>{var P=OP(),T=le(P,!0);ae(P),it(()=>ui(T,e.subtitle)),se(A,P)};St(p,A=>{e.subtitle&&A(g)})}ae(c);var b=Xe(c,2);{var S=A=>{var P=pP(),T=le(P);wh(T,()=>e.headerActions),ae(P),se(A,P)};St(b,A=>{e.headerActions&&A(S)})}var w=Xe(b,2);{var v=A=>{var P=mP(),T=le(P);ae(P),it(()=>ui(T,`${e.timing??""}ms`)),se(A,P)};St(w,A=>{e.timing!==void 0&&A(v)})}ae(o);var y=Xe(o,2);{var Q=A=>{var P=gP(),T=le(P),Y=le(T,!0);ae(T),ae(P),it(()=>ui(Y,e.error)),se(A,P)};St(y,A=>{e.error&&A(Q)})}var k=Xe(y,2);{let A=ft(()=>[aP,e.langExtension].filter(Boolean));uP(k,{get extensions(){return E(A)},get theme(){return pw},get placeholder(){return i()},get readonly(){return n()},class:"text-sm",get value(){return t()},set value(P){t(P)}})}var R=Xe(k,2);{var z=A=>{var P=Vi(),T=Bi(P);wh(T,()=>e.children),se(A,P)};St(R,A=>{e.children&&A(z)})}ae(s),it(()=>ui(u,`${e.title??""} `)),se(r,s),Us()}function SP(r,e,t){j(e,t)}var QP=Le(''),yP=(r,e)=>e(r.currentTarget.value),xP=Le(""),kP=Le(''),wP=Le('
');function vP(r,e){Ns(e,!0);const t=()=>Pg(Ik,"$wasmReady",i),[i,n]=$g();let s=De(co([]));const o=`--- _type: Recipe author.name: Max Richter --- @@ -129,4 +129,4 @@ My favourite baguette recipe ## Steps 1. Mix Flour Water and Salt 2. Bake the bread`,l="";let a=De(co(typeof window<"u"&&localStorage.getItem("templateValue")||l)),h=De(co(typeof window<"u"&&localStorage.getItem("markdownValue")||o)),c=De(""),f=ft(()=>{try{return JSON.parse(E(c))._schema}catch{return}}),u=De(null),d=De(void 0),O=De(void 0),p=De(void 0);Mr(()=>{typeof window<"u"&&localStorage.setItem("templateValue",E(a))}),Mr(()=>{typeof window<"u"&&localStorage.setItem("markdownValue",E(h))}),Mr(()=>{if(t())try{j(s,Uk(),!0)}catch(Q){console.error(Q)}if(!t()){j(c,"Loading wasm..."),j(u,null),j(d,void 0),j(O,void 0);return}try{Nk(E(a));const Q=E(a)?Gk(E(h),E(a)):jk(E(h));"error"in Q?(j(c,""),Q.error.startsWith("failed to compile template")?(j(p,Q.error.replaceAll(" -> ",` - ⟶ `),!0),j(d,"error"),j(O,"indeterminate")):(j(p,void 0),j(d,void 0),j(O,"error"))):(j(p,void 0),j(c,JSON.stringify(Q,null,2),!0),j(u,Q.timings,!0),j(d,"success"),j(O,"success"))}catch(Q){console.log({e:Q}),j(c,Q.message,!0),j(u,null),E(c).startsWith("failed to compile template")?(j(d,"error"),j(O,"indeterminate")):(j(d,void 0),j(O,"error"))}});function g(Q){if(Q)try{j(a,Fk(Q),!0)}catch(k){console.error(k)}}var b=wP(),S=le(b),w=le(S);{const Q=z=>{var A=xP();A.__change=[QP,g];var P=le(A);P.value=P.__value="";var T=Xe(P);bu(T,16,()=>E(s),Y=>Y,(Y,q)=>{var D=yP(),K=le(D,!0);ae(D);var fe={};it(()=>{ui(K,q),fe!==(fe=q)&&(D.value=(D.__value=q)??"")}),se(Y,D)}),ae(A),se(z,A)};let k=ft(()=>E(u)?.template_compilation),R=ft(Wf);hl(w,{title:"Template",placeholder:"Enter your Marka template here...",get error(){return E(p)},get status(){return E(d)},get timing(){return E(k)},subtitle:"Define your mapping schema",get langExtension(){return E(R)},get value(){return E(a)},set value(z){j(a,z,!0)},headerActions:Q,$$slots:{headerActions:!0}})}var v=Xe(w,2);{const Q=z=>{var A=kP();A.__click=[SP,h,o],se(z,A)};let k=ft(()=>E(u)?.markdown_parsing),R=ft(Wf);hl(v,{title:"Markdown",placeholder:"Enter your markdown content here...",get timing(){return E(k)},subtitle:"Your source content",get langExtension(){return E(R)},get value(){return E(h)},set value(z){j(h,z,!0)},headerActions:Q,$$slots:{headerActions:!0}})}var y=Xe(v,2);{let Q=ft(()=>!E(a)&&E(f)?`Detected Template: ${E(f)}`:void 0),k=ft(FS);hl(y,{title:"Data",get value(){return E(c)},readonly:!0,get status(){return E(O)},subtitle:"Parsed JSON output",get pillText(){return E(Q)},get langExtension(){return E(k)}})}ae(S),ae(b),se(r,b),Us(),n()}yg(["change","click"]);var PP=Le('
');function YP(r){var e=PP(),t=le(e);Bg(t);var i=Xe(t,2),n=le(i);vP(n,{}),ae(i),ae(e),se(r,e)}export{YP as component}; + ⟶ `),!0),j(d,"error"),j(O,"indeterminate")):(j(p,void 0),j(d,void 0),j(O,"error"))):(j(p,void 0),j(c,JSON.stringify(Q,null,2),!0),j(u,Q.timings,!0),j(d,"success"),j(O,"success"))}catch(Q){console.log({e:Q}),j(c,Q.message,!0),j(u,null),E(c).startsWith("failed to compile template")?(j(d,"error"),j(O,"indeterminate")):(j(d,void 0),j(O,"error"))}});function g(Q){if(Q)try{j(a,Fk(Q),!0)}catch(k){console.error(k)}}var b=wP(),S=le(b),w=le(S);{const Q=z=>{var A=QP();A.__click=[SP,h,o],se(z,A)};let k=ft(()=>E(u)?.markdown_parsing),R=ft(Wf);hl(w,{title:"Markdown",placeholder:"Enter your markdown content here...",get timing(){return E(k)},subtitle:"Your source content",get langExtension(){return E(R)},get value(){return E(h)},set value(z){j(h,z,!0)},headerActions:Q,$$slots:{headerActions:!0}})}var v=Xe(w,2);{const Q=z=>{var A=kP();A.__change=[yP,g];var P=le(A);P.value=P.__value="";var T=Xe(P);bu(T,16,()=>E(s),Y=>Y,(Y,q)=>{var D=xP(),K=le(D,!0);ae(D);var fe={};it(()=>{ui(K,q),fe!==(fe=q)&&(D.value=(D.__value=q)??"")}),se(Y,D)}),ae(A),se(z,A)};let k=ft(()=>E(u)?.template_compilation),R=ft(Wf);hl(v,{title:"Template",placeholder:"Enter your Marka template here...",get error(){return E(p)},get status(){return E(d)},get timing(){return E(k)},subtitle:"Define your mapping schema",get langExtension(){return E(R)},get value(){return E(a)},set value(z){j(a,z,!0)},headerActions:Q,$$slots:{headerActions:!0}})}var y=Xe(v,2);{let Q=ft(()=>!E(a)&&E(f)?`Detected Template: ${E(f)}`:void 0),k=ft(FS);hl(y,{title:"Data",get value(){return E(c)},readonly:!0,get status(){return E(O)},subtitle:"Parsed JSON output",get pillText(){return E(Q)},get langExtension(){return E(k)}})}ae(S),ae(b),se(r,b),Us(),n()}yg(["click","change"]);var PP=Le('
');function YP(r){var e=PP(),t=le(e);Bg(t);var i=Xe(t,2),n=le(i);vP(n,{}),ae(i),ae(e),se(r,e)}export{YP as component}; diff --git a/server/playground/_app/version.json b/server/playground/_app/version.json index 3be5268..2650626 100644 --- a/server/playground/_app/version.json +++ b/server/playground/_app/version.json @@ -1 +1 @@ -{"version":"1759702763367"} \ No newline at end of file +{"version":"1760177694904"} \ No newline at end of file diff --git a/server/playground/index.html b/server/playground/index.html index e22a37b..b6f8439 100644 --- a/server/playground/index.html +++ b/server/playground/index.html @@ -6,20 +6,20 @@ - - + + - + - + Marka Playground -
logo

Marka

Bidirectional Markdown ↔ JSON Parser

Template

Define your mapping schema

Loading editor...

Markdown

Your source content

Loading editor...

---
+		
logo

Marka

Bidirectional Markdown ↔ JSON Parser

Markdown

Your source content

Loading editor...

---
 _type: Recipe
 author.name: Max Richter
 ---
@@ -35,11 +35,11 @@ My favourite baguette recipe
 
 ## Steps
 1. Mix Flour Water and Salt
-2. Bake the bread

Data

Parsed JSON output

Loading editor...

+2. Bake the bread

Template

Define your mapping schema

Loading editor...

Data

Parsed JSON output

Loading editor...