3 lines
3.7 KiB
JavaScript
3 lines
3.7 KiB
JavaScript
var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function a(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function u(t,e){t.appendChild(e)}function c(t){t.parentNode.removeChild(t)}function i(t){return document.createElement(t)}function s(t){return document.createTextNode(t)}function l(){return s(" ")}function f(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function d(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}let p;function h(t){p=t}function m(t){(function(){if(!p)throw new Error("Function called outside component initialization");return p})().$$.on_mount.push(t)}const $=[],g=[],b=[],y=[],_=Promise.resolve();let x=!1;function w(t){b.push(t)}let v=!1;const k=new Set;function E(){if(!v){v=!0;do{for(let t=0;t<$.length;t+=1){const e=$[t];h(e),S(e.$$)}for(h(null),$.length=0;g.length;)g.pop()();for(let t=0;t<b.length;t+=1){const e=b[t];k.has(e)||(k.add(e),e())}b.length=0}while($.length);for(;y.length;)y.pop()();x=!1,v=!1,k.clear()}}function S(t){if(null!==t.fragment){t.update(),o(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(w)}}const A=new Set;function j(t,e){-1===t.$$.dirty[0]&&($.push(t),x||(x=!0,_.then(E)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function C(a,u,i,s,l,f,d=[-1]){const m=p;h(a);const $=u.props||{},g=a.$$={fragment:null,ctx:null,props:f,update:t,not_equal:l,bound:n(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(m?m.$$.context:[]),callbacks:n(),dirty:d,skip_bound:!1};let b=!1;if(g.ctx=i?i(a,$,(t,e,...n)=>{const o=n.length?n[0]:e;return g.ctx&&l(g.ctx[t],g.ctx[t]=o)&&(!g.skip_bound&&g.bound[t]&&g.bound[t](o),b&&j(a,t)),e}):[],g.update(),b=!0,o(g.before_update),g.fragment=!!s&&s(g.ctx),u.target){if(u.hydrate){const t=function(t){return Array.from(t.childNodes)}(u.target);g.fragment&&g.fragment.l(t),t.forEach(c)}else g.fragment&&g.fragment.c();u.intro&&((y=a.$$.fragment)&&y.i&&(A.delete(y),y.i(_))),function(t,n,a){const{fragment:u,on_mount:c,on_destroy:i,after_update:s}=t.$$;u&&u.m(n,a),w(()=>{const n=c.map(e).filter(r);i?i.push(...n):o(n),t.$$.on_mount=[]}),s.forEach(w)}(a,u.target,u.anchor),E()}var y,_;h(m)}function M(e){let n,o,r,a,p,h,m,$,g,b,y,_;return{c(){n=i("main"),o=i("h1"),r=s("Hello "),a=s(e[1]),p=s("!"),h=l(),m=i("h2"),$=s(e[0]),g=l(),b=i("h3"),b.textContent="Change me!",y=l(),_=i("p"),_.innerHTML='Visit the <a href="https://svelte.dev/tutorial">Svelte tutorial</a> to learn how to build Svelte apps.',f(o,"class","svelte-1e9puaw"),f(n,"class","svelte-1e9puaw")},m(t,e){!function(t,e,n){t.insertBefore(e,n||null)}(t,n,e),u(n,o),u(o,r),u(o,a),u(o,p),u(n,h),u(n,m),u(m,$),u(n,g),u(n,b),u(n,y),u(n,_)},p(t,[e]){2&e&&d(a,t[1]),1&e&&d($,t[0])},i:t,o:t,d(t){t&&c(n)}}}function N(t,e,n){let{name:o}=e,{message:r}=e;return m(async()=>{let t=await(await fetch("/api")).json();n(0,r=t.msg),console.log("MESSAGE: ",r)}),t.$$set=t=>{"name"in t&&n(1,o=t.name),"message"in t&&n(0,r=t.message)},[r,o]}return new class extends class{$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}{constructor(t){super(),C(this,t,N,M,a,{name:1,message:0})}}({target:document.body,props:{name:"world",message:"...loading"}})}();
|
|
//# sourceMappingURL=bundle.js.map
|