text: import { S as SvelteComponentDev, i as init, s as safe_not_equal, d as dispatch_dev, p as validate_each_argument, v as validate_slots, e as element, t as text, g as claim_element, h as children, j as claim_text, c as detach_dev, k as attr_dev, l as add_location, m as insert_dev, n as append_dev, r as set_data_dev, a as space, q as query_selector_all, f as claim_space, o as noop, u as destroy_each } from './client.0b153c21.js';
  
  /* src/routes/blog/index.svelte generated by Svelte v3.31.2 */
  
  const file = "src/routes/blog/index.svelte";
  
  function get_each_context(ctx, list, i) {
  	const child_ctx = ctx.slice();
  	child_ctx[1] = list[i];
  	return child_ctx;
  }
  
  // (26:1) {#each posts as post}
  function create_each_block(ctx) {
  	let li;
  	let a;
  	let t_value = /*post*/ ctx[1].title + "";
  	let t;
  	let a_href_value;
  
  	const block = {
  		c: function create() {
  			li = element("li");
  			a = element("a");
  			t = text(t_value);
  			this.h();
  		},
  		l: function claim(nodes) {
  			li = claim_element(nodes, "LI", {});
  			var li_nodes = children(li);
  			a = claim_element(li_nodes, "A", { rel: true, href: true });
  			var a_nodes = children(a);
  			t = claim_text(a_nodes, t_value);
  			a_nodes.forEach(detach_dev);
  			li_nodes.forEach(detach_dev);
  			this.h();
  		},
  		h: function hydrate() {
  			attr_dev(a, "rel", "prefetch");
  			attr_dev(a, "href", a_href_value = "blog/" + /*post*/ ctx[1].slug);
  			add_location(a, file, 30, 6, 666);
  			add_location(li, file, 30, 2, 662);
  		},
  		m: function mount(target, anchor) {
  			insert_dev(target, li, anchor);
  			append_dev(li, a);
  			append_dev(a, t);
  		},
  		p: function update(ctx, dirty) {
  			if (dirty & /*posts*/ 1 && t_value !== (t_value = /*post*/ ctx[1].title + "")) set_data_dev(t, t_value);
  
  			if (dirty & /*posts*/ 1 && a_href_value !== (a_href_value = "blog/" + /*post*/ ctx[1].slug)) {
  				attr_dev(a, "href", a_href_value);
  			}
  		},
  		d: function destroy(detaching) {
  			if (detaching) detach_dev(li);
  		}
  	};
  
  	dispatch_dev("SvelteRegisterBlock", {
  		block,
  		id: create_each_block.name,
  		type: "each",
  		source: "(26:1) {#each posts as post}",
  		ctx
  	});
  
  	return block;
  }
  
  function create_fragment(ctx) {
  	let t0;
  	let h1;
  	let t1;
  	let t2;
  	let ul;
  	let each_value = /*posts*/ ctx[0];
  	validate_each_argument(each_value);
  	let each_blocks = [];
  
  	for (let i = 0; i < each_value.length; i += 1) {
  		each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
  	}
  
  	const block = {
  		c: function create() {
  			t0 = space();
  			h1 = element("h1");
  			t1 = text("Recent posts");
  			t2 = space();
  			ul = element("ul");
  
  			for (let i = 0; i < each_blocks.length; i += 1) {
  				each_blocks[i].c();
  			}
  
  			this.h();
  		},
  		l: function claim(nodes) {
  			const head_nodes = query_selector_all("[data-svelte=\"svelte-hfp9t8\"]", document.head);
  			head_nodes.forEach(detach_dev);
  			t0 = claim_space(nodes);
  			h1 = claim_element(nodes, "H1", {});
  			var h1_nodes = children(h1);
  			t1 = claim_text(h1_nodes, "Recent posts");
  			h1_nodes.forEach(detach_dev);
  			t2 = claim_space(nodes);
  			ul = claim_element(nodes, "UL", { class: true });
  			var ul_nodes = children(ul);
  
  			for (let i = 0; i < each_blocks.length; i += 1) {
  				each_blocks[i].l(ul_nodes);
  			}
  
  			ul_nodes.forEach(detach_dev);
  			this.h();
  		},
  		h: function hydrate() {
  			document.title = "Blog";
  			add_location(h1, file, 22, 0, 393);
  			attr_dev(ul, "class", "svelte-p9mw1v");
  			add_location(ul, file, 24, 0, 416);
  		},
  		m: function mount(target, anchor) {
  			insert_dev(target, t0, anchor);
  			insert_dev(target, h1, anchor);
  			append_dev(h1, t1);
  			insert_dev(target, t2, anchor);
  			insert_dev(target, ul, anchor);
  
  			for (let i = 0; i < each_blocks.length; i += 1) {
  				each_blocks[i].m(ul, null);
  			}
  		},
  		p: function update(ctx, [dirty]) {
  			if (dirty & /*posts*/ 1) {
  				each_value = /*posts*/ ctx[0];
  				validate_each_argument(each_value);
  				let i;
  
  				for (i = 0; i < each_value.length; i += 1) {
  					const child_ctx = get_each_context(ctx, each_value, i);
  
  					if (each_blocks[i]) {
  						each_blocks[i].p(child_ctx, dirty);
  					} else {
  						each_blocks[i] = create_each_block(child_ctx);
  						each_blocks[i].c();
  						each_blocks[i].m(ul, null);
  					}
  				}
  
  				for (; i < each_blocks.length; i += 1) {
  					each_blocks[i].d(1);
  				}
  
  				each_blocks.length = each_value.length;
  			}
  		},
  		i: noop,
  		o: noop,
  		d: function destroy(detaching) {
  			if (detaching) detach_dev(t0);
  			if (detaching) detach_dev(h1);
  			if (detaching) detach_dev(t2);
  			if (detaching) detach_dev(ul);
  			destroy_each(each_blocks, detaching);
  		}
  	};
  
  	dispatch_dev("SvelteRegisterBlock", {
  		block,
  		id: create_fragment.name,
  		type: "component",
  		source: "",
  		ctx
  	});
  
  	return block;
  }
  
  function preload({ params, query }) {
  	return this.fetch(`blog.json`).then(r => r.json()).then(posts => {
  		return { posts };
  	});
  }
  
  function instance($$self, $$props, $$invalidate) {
  	let { $$slots: slots = {}, $$scope } = $$props;
  	validate_slots("Blog", slots, []);
  	let { posts } = $$props;
  	const writable_props = ["posts"];
  
  	Object.keys($$props).forEach(key => {
  		if (!~writable_props.indexOf(key) && key.slice(0, 2) !== "$$") console.warn(`<Blog> was created with unknown prop '${key}'`);
  	});
  
  	$$self.$$set = $$props => {
  		if ("posts" in $$props) $$invalidate(0, posts = $$props.posts);
  	};
  
  	$$self.$capture_state = () => ({ preload, posts });
  
  	$$self.$inject_state = $$props => {
  		if ("posts" in $$props) $$invalidate(0, posts = $$props.posts);
  	};
  
  	if ($$props && "$$inject" in $$props) {
  		$$self.$inject_state($$props.$$inject);
  	}
  
  	return [posts];
  }
  
  class Blog extends SvelteComponentDev {
  	constructor(options) {
  		super(options);
  		init(this, options, instance, create_fragment, safe_not_equal, { posts: 0 });
  
  		dispatch_dev("SvelteRegisterComponent", {
  			component: this,
  			tagName: "Blog",
  			options,
  			id: create_fragment.name
  		});
  
  		const { ctx } = this.$$;
  		const props = options.props || {};
  
  		if (/*posts*/ ctx[0] === undefined && !("posts" in props)) {
  			console.warn("<Blog> was created without expected prop 'posts'");
  		}
  	}
  
  	get posts() {
  		throw new Error("<Blog>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
  	}
  
  	set posts(value) {
  		throw new Error("<Blog>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
  	}
  }
  
  export default Blog;
  export { preload };
  //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguMDY1OGRjYzEuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9yb3V0ZXMvYmxvZy9pbmRleC5zdmVsdGUiXSwic291cmNlc0NvbnRlbnQiOlsiPHNjcmlwdCBjb250ZXh0PVwibW9kdWxlXCI+XG5cdGV4cG9ydCBmdW5jdGlvbiBwcmVsb2FkKHsgcGFyYW1zLCBxdWVyeSB9KSB7XG5cdFx0cmV0dXJuIHRoaXMuZmV0Y2goYGJsb2cuanNvbmApLnRoZW4ociA9PiByLmpzb24oKSkudGhlbihwb3N0cyA9PiB7XG5cdFx0XHRyZXR1cm4geyBwb3N0cyB9O1xuXHRcdH0pO1xuXHR9XG48L3NjcmlwdD5cblxuPHNjcmlwdD5cblx0ZXhwb3J0IGxldCBwb3N0cztcbjwvc2NyaXB0PlxuXG48c3R5bGU+XG5cdHVsIHtcblx0XHRtYXJnaW46IDAgMCAxZW0gMDtcblx0XHRsaW5lLWhlaWdodDogMS41O1xuXHR9XG48L3N0eWxlPlxuXG48c3ZlbHRlOmhlYWQ+XG5cdDx0aXRsZT5CbG9nPC90aXRsZT5cbjwvc3ZlbHRlOmhlYWQ+XG5cbjxoMT5SZWNlbnQgcG9zdHM8L2gxPlxuXG48dWw+XG5cdHsjZWFjaCBwb3N0cyBhcyBwb3N0fVxuXHRcdDwhLS0gd2UncmUgdXNpbmcgdGhlIG5vbi1zdGFuZGFyZC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