Skip to content

Instantly share code, notes, and snippets.

@curran
Last active April 24, 2019 13:54
Show Gist options
  • Save curran/71dfa9cf182473fd2cb2f2d027f3828e to your computer and use it in GitHub Desktop.
Save curran/71dfa9cf182473fd2cb2f2d027f3828e to your computer and use it in GitHub Desktop.
Hello Svelte
license: mit
.DS_Store
node_modules
public/bundle.*
package-lock.json
yarn.lock

A first experiment getting to know Svelte 3.

Bootstrapped from Svelte Template.

Strongly considering adding Svelte support to VizHub.

Seeing huge potential for Svelte with interactive data visualization!

<script>
export let width;
export let height;
export let n = 50;
let numbers = [];
const f = (x, t) => Math.sin(x * t + t) * 200;
const setNumbers = t => {
for(let i = 0; i < n; i++){
const x = i / n;
numbers[i] = f(x, t);
}
};
const animate = timestamp => {
setNumbers(timestamp / 1000);
requestAnimationFrame(animate);
};
requestAnimationFrame(animate);
</script>
<svg width={width} height={height}>
{#each numbers as y, i}
<circle
cx={i / n * width}
cy={y + height / 2}
r="10"
/>
{#if i < n - 1}
<line
x1={i / n * width}
y1={y + height / 2}
x2={(i + 1) / n * width}
y2={numbers[i + 1] + height / 2}
/>
{/if}
{/each}
</svg>
var app = (function () {
'use strict';
function noop() {}
function add_location(element, file, line, column, char) {
element.__svelte_meta = {
loc: { file, line, column, char }
};
}
function run(fn) {
return fn();
}
function blank_object() {
return Object.create(null);
}
function run_all(fns) {
fns.forEach(run);
}
function is_function(thing) {
return typeof thing === 'function';
}
function safe_not_equal(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function insert(target, node, anchor) {
target.insertBefore(node, anchor);
}
function detach(node) {
node.parentNode.removeChild(node);
}
function destroy_each(iterations, detaching) {
for (let i = 0; i < iterations.length; i += 1) {
if (iterations[i]) iterations[i].d(detaching);
}
}
function svg_element(name) {
return document.createElementNS('http://www.w3.org/2000/svg', name);
}
function text(data) {
return document.createTextNode(data);
}
function empty() {
return text('');
}
function attr(node, attribute, value) {
if (value == null) node.removeAttribute(attribute);
else node.setAttribute(attribute, value);
}
function children(element) {
return Array.from(element.childNodes);
}
let current_component;
function set_current_component(component) {
current_component = component;
}
const dirty_components = [];
let update_promise;
const binding_callbacks = [];
const render_callbacks = [];
const flush_callbacks = [];
function schedule_update() {
if (!update_promise) {
update_promise = Promise.resolve();
update_promise.then(flush);
}
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
function flush() {
const seen_callbacks = new Set();
do {
// first, call beforeUpdate functions
// and update components
while (dirty_components.length) {
const component = dirty_components.shift();
set_current_component(component);
update(component.$$);
}
while (binding_callbacks.length) binding_callbacks.shift()();
// then, once components are updated, call
// afterUpdate functions. This may cause
// subsequent updates...
while (render_callbacks.length) {
const callback = render_callbacks.pop();
if (!seen_callbacks.has(callback)) {
callback();
// ...so guard against infinite loops
seen_callbacks.add(callback);
}
}
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_promise = null;
}
function update($$) {
if ($$.fragment) {
$$.update($$.dirty);
run_all($$.before_render);
$$.fragment.p($$.dirty, $$.ctx);
$$.dirty = null;
$$.after_render.forEach(add_render_callback);
}
}
function mount_component(component, target, anchor) {
const { fragment, on_mount, on_destroy, after_render } = component.$$;
fragment.m(target, anchor);
// onMount happens after the initial afterUpdate. Because
// afterUpdate callbacks happen in reverse order (inner first)
// we schedule onMount callbacks before afterUpdate callbacks
add_render_callback(() => {
const new_on_destroy = on_mount.map(run).filter(is_function);
if (on_destroy) {
on_destroy.push(...new_on_destroy);
} else {
// Edge case - component was destroyed immediately,
// most likely as a result of a binding initialising
run_all(new_on_destroy);
}
component.$$.on_mount = [];
});
after_render.forEach(add_render_callback);
}
function destroy(component, detaching) {
if (component.$$) {
run_all(component.$$.on_destroy);
component.$$.fragment.d(detaching);
// TODO null out other refs, including component.$$ (but need to
// preserve final state?)
component.$$.on_destroy = component.$$.fragment = null;
component.$$.ctx = {};
}
}
function make_dirty(component, key) {
if (!component.$$.dirty) {
dirty_components.push(component);
schedule_update();
component.$$.dirty = {};
}
component.$$.dirty[key] = true;
}
function init(component, options, instance, create_fragment, not_equal$$1, prop_names) {
const parent_component = current_component;
set_current_component(component);
const props = options.props || {};
const $$ = component.$$ = {
fragment: null,
ctx: null,
// state
props: prop_names,
update: noop,
not_equal: not_equal$$1,
bound: blank_object(),
// lifecycle
on_mount: [],
on_destroy: [],
before_render: [],
after_render: [],
context: new Map(parent_component ? parent_component.$$.context : []),
// everything else
callbacks: blank_object(),
dirty: null
};
let ready = false;
$$.ctx = instance
? instance(component, props, (key, value) => {
if ($$.ctx && not_equal$$1($$.ctx[key], $$.ctx[key] = value)) {
if ($$.bound[key]) $$.bound[key](value);
if (ready) make_dirty(component, key);
}
})
: props;
$$.update();
ready = true;
run_all($$.before_render);
$$.fragment = create_fragment($$.ctx);
if (options.target) {
if (options.hydrate) {
$$.fragment.l(children(options.target));
} else {
$$.fragment.c();
}
if (options.intro && component.$$.fragment.i) component.$$.fragment.i();
mount_component(component, options.target, options.anchor);
flush();
}
set_current_component(parent_component);
}
class SvelteComponent {
$destroy() {
destroy(this, true);
this.$destroy = noop;
}
$on(type, callback) {
const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));
callbacks.push(callback);
return () => {
const index = callbacks.indexOf(callback);
if (index !== -1) callbacks.splice(index, 1);
};
}
$set() {
// overridden by instance, if it has props
}
}
class SvelteComponentDev extends SvelteComponent {
constructor(options) {
if (!options || (!options.target && !options.$$inline)) {
throw new Error(`'target' is a required option`);
}
super();
}
$destroy() {
super.$destroy();
this.$destroy = () => {
console.warn(`Component was already destroyed`); // eslint-disable-line no-console
};
}
}
/* App.svelte generated by Svelte v3.0.0 */
const file = "App.svelte";
function get_each_context(ctx, list, i) {
const child_ctx = Object.create(ctx);
child_ctx.y = list[i];
child_ctx.i = i;
return child_ctx;
}
// (31:4) {#if i < n - 1}
function create_if_block(ctx) {
var line, line_x__value, line_y__value, line_x__value_1, line_y__value_1;
return {
c: function create() {
line = svg_element("line");
attr(line, "x1", line_x__value = ctx.i / ctx.n * ctx.width);
attr(line, "y1", line_y__value = ctx.y + ctx.height / 2);
attr(line, "x2", line_x__value_1 = (ctx.i + 1) / ctx.n * ctx.width);
attr(line, "y2", line_y__value_1 = ctx.numbers[ctx.i + 1] + ctx.height / 2);
add_location(line, file, 31, 6, 587);
},
m: function mount(target, anchor) {
insert(target, line, anchor);
},
p: function update(changed, ctx) {
if ((changed.n || changed.width) && line_x__value !== (line_x__value = ctx.i / ctx.n * ctx.width)) {
attr(line, "x1", line_x__value);
}
if ((changed.numbers || changed.height) && line_y__value !== (line_y__value = ctx.y + ctx.height / 2)) {
attr(line, "y1", line_y__value);
}
if ((changed.n || changed.width) && line_x__value_1 !== (line_x__value_1 = (ctx.i + 1) / ctx.n * ctx.width)) {
attr(line, "x2", line_x__value_1);
}
if ((changed.numbers || changed.height) && line_y__value_1 !== (line_y__value_1 = ctx.numbers[ctx.i + 1] + ctx.height / 2)) {
attr(line, "y2", line_y__value_1);
}
},
d: function destroy(detaching) {
if (detaching) {
detach(line);
}
}
};
}
// (25:2) {#each numbers as y, i}
function create_each_block(ctx) {
var circle, circle_cx_value, circle_cy_value, if_block_anchor;
var if_block = (ctx.i < ctx.n - 1) && create_if_block(ctx);
return {
c: function create() {
circle = svg_element("circle");
if (if_block) if_block.c();
if_block_anchor = empty();
attr(circle, "cx", circle_cx_value = ctx.i / ctx.n * ctx.width);
attr(circle, "cy", circle_cy_value = ctx.y + ctx.height / 2);
attr(circle, "r", "10");
add_location(circle, file, 25, 4, 482);
},
m: function mount(target, anchor) {
insert(target, circle, anchor);
if (if_block) if_block.m(target, anchor);
insert(target, if_block_anchor, anchor);
},
p: function update(changed, ctx) {
if ((changed.n || changed.width) && circle_cx_value !== (circle_cx_value = ctx.i / ctx.n * ctx.width)) {
attr(circle, "cx", circle_cx_value);
}
if ((changed.numbers || changed.height) && circle_cy_value !== (circle_cy_value = ctx.y + ctx.height / 2)) {
attr(circle, "cy", circle_cy_value);
}
if (ctx.i < ctx.n - 1) {
if (if_block) {
if_block.p(changed, ctx);
} else {
if_block = create_if_block(ctx);
if_block.c();
if_block.m(if_block_anchor.parentNode, if_block_anchor);
}
} else if (if_block) {
if_block.d(1);
if_block = null;
}
},
d: function destroy(detaching) {
if (detaching) {
detach(circle);
}
if (if_block) if_block.d(detaching);
if (detaching) {
detach(if_block_anchor);
}
}
};
}
function create_fragment(ctx) {
var svg;
var each_value = ctx.numbers;
var each_blocks = [];
for (var i = 0; i < each_value.length; i += 1) {
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
}
return {
c: function create() {
svg = svg_element("svg");
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].c();
}
attr(svg, "width", ctx.width);
attr(svg, "height", ctx.height);
add_location(svg, file, 23, 0, 416);
},
l: function claim(nodes) {
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
},
m: function mount(target, anchor) {
insert(target, svg, anchor);
for (var i = 0; i < each_blocks.length; i += 1) {
each_blocks[i].m(svg, null);
}
},
p: function update(changed, ctx) {
if (changed.n || changed.width || changed.numbers || changed.height) {
each_value = ctx.numbers;
for (var 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(changed, child_ctx);
} else {
each_blocks[i] = create_each_block(child_ctx);
each_blocks[i].c();
each_blocks[i].m(svg, null);
}
}
for (; i < each_blocks.length; i += 1) {
each_blocks[i].d(1);
}
each_blocks.length = each_value.length;
}
if (changed.width) {
attr(svg, "width", ctx.width);
}
if (changed.height) {
attr(svg, "height", ctx.height);
}
},
i: noop,
o: noop,
d: function destroy(detaching) {
if (detaching) {
detach(svg);
}
destroy_each(each_blocks, detaching);
}
};
}
function instance($$self, $$props, $$invalidate) {
let { width, height, n = 50 } = $$props;
let numbers = [];
const f = (x, t) => Math.sin(x * t + t) * 200;
const setNumbers = t => {
for(let i = 0; i < n; i++){
const x = i / n;
numbers[i] = f(x, t); $$invalidate('numbers', numbers);
}
};
const animate = timestamp => {
setNumbers(timestamp / 1000);
requestAnimationFrame(animate);
};
requestAnimationFrame(animate);
$$self.$set = $$props => {
if ('width' in $$props) $$invalidate('width', width = $$props.width);
if ('height' in $$props) $$invalidate('height', height = $$props.height);
if ('n' in $$props) $$invalidate('n', n = $$props.n);
};
return { width, height, n, numbers };
}
class App extends SvelteComponentDev {
constructor(options) {
super(options);
init(this, options, instance, create_fragment, safe_not_equal, ["width", "height", "n"]);
const { ctx } = this.$$;
const props = options.props || {};
if (ctx.width === undefined && !('width' in props)) {
console.warn("<App> was created without expected prop 'width'");
}
if (ctx.height === undefined && !('height' in props)) {
console.warn("<App> was created without expected prop 'height'");
}
if (ctx.n === undefined && !('n' in props)) {
console.warn("<App> was created without expected prop 'n'");
}
}
get width() {
throw new Error("<App>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
}
set width(value) {
throw new Error("<App>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
}
get height() {
throw new Error("<App>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
}
set height(value) {
throw new Error("<App>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
}
get n() {
throw new Error("<App>: Props cannot be read directly from the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
}
set n(value) {
throw new Error("<App>: Props cannot be set directly on the component instance unless compiling with 'accessors: true' or '<svelte:options accessors/>'");
}
}
var main = new App({
target: document.body,
props: {
width: 960,
height: 500
}
});
return main;
}());
//# sourceMappingURL=bundle.js.map
{"version":3,"file":"bundle.js","sources":["node_modules/svelte/internal.mjs","App.svelte","main.js"],"sourcesContent":["function noop() {}\n\nconst identity = x => x;\n\nfunction assign(tar, src) {\n\tfor (const k in src) tar[k] = src[k];\n\treturn tar;\n}\n\nfunction is_promise(value) {\n\treturn value && typeof value.then === 'function';\n}\n\nfunction add_location(element, file, line, column, char) {\n\telement.__svelte_meta = {\n\t\tloc: { file, line, column, char }\n\t};\n}\n\nfunction run(fn) {\n\treturn fn();\n}\n\nfunction blank_object() {\n\treturn Object.create(null);\n}\n\nfunction run_all(fns) {\n\tfns.forEach(run);\n}\n\nfunction is_function(thing) {\n\treturn typeof thing === 'function';\n}\n\nfunction safe_not_equal(a, b) {\n\treturn a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\n\nfunction not_equal(a, b) {\n\treturn a != a ? b == b : a !== b;\n}\n\nfunction validate_store(store, name) {\n\tif (!store || typeof store.subscribe !== 'function') {\n\t\tthrow new Error(`'${name}' is not a store with a 'subscribe' method`);\n\t}\n}\n\nfunction subscribe(component, store, callback) {\n\tcomponent.$$.on_destroy.push(store.subscribe(callback));\n}\n\nfunction create_slot(definition, ctx, fn) {\n\tif (definition) {\n\t\tconst slot_ctx = get_slot_context(definition, ctx, fn);\n\t\treturn definition[0](slot_ctx);\n\t}\n}\n\nfunction get_slot_context(definition, ctx, fn) {\n\treturn definition[1]\n\t\t? assign({}, assign(ctx.$$scope.ctx, definition[1](fn ? fn(ctx) : {})))\n\t\t: ctx.$$scope.ctx;\n}\n\nfunction get_slot_changes(definition, ctx, changed, fn) {\n\treturn definition[1]\n\t\t? assign({}, assign(ctx.$$scope.changed || {}, definition[1](fn ? fn(changed) : {})))\n\t\t: ctx.$$scope.changed || {};\n}\n\nfunction exclude_internal_props(props) {\n\tconst result = {};\n\tfor (const k in props) if (k[0] !== '$') result[k] = props[k];\n\treturn result;\n}\n\nconst tasks = new Set();\nlet running = false;\n\nfunction run_tasks() {\n\ttasks.forEach(task => {\n\t\tif (!task[0](window.performance.now())) {\n\t\t\ttasks.delete(task);\n\t\t\ttask[1]();\n\t\t}\n\t});\n\n\trunning = tasks.size > 0;\n\tif (running) requestAnimationFrame(run_tasks);\n}\n\nfunction clear_loops() {\n\t// for testing...\n\ttasks.forEach(task => tasks.delete(task));\n\trunning = false;\n}\n\nfunction loop(fn) {\n\tlet task;\n\n\tif (!running) {\n\t\trunning = true;\n\t\trequestAnimationFrame(run_tasks);\n\t}\n\n\treturn {\n\t\tpromise: new Promise(fulfil => {\n\t\t\ttasks.add(task = [fn, fulfil]);\n\t\t}),\n\t\tabort() {\n\t\t\ttasks.delete(task);\n\t\t}\n\t};\n}\n\nfunction append(target, node) {\n\ttarget.appendChild(node);\n}\n\nfunction insert(target, node, anchor) {\n\ttarget.insertBefore(node, anchor);\n}\n\nfunction detach(node) {\n\tnode.parentNode.removeChild(node);\n}\n\nfunction detach_between(before, after) {\n\twhile (before.nextSibling && before.nextSibling !== after) {\n\t\tbefore.parentNode.removeChild(before.nextSibling);\n\t}\n}\n\nfunction detach_before(after) {\n\twhile (after.previousSibling) {\n\t\tafter.parentNode.removeChild(after.previousSibling);\n\t}\n}\n\nfunction detach_after(before) {\n\twhile (before.nextSibling) {\n\t\tbefore.parentNode.removeChild(before.nextSibling);\n\t}\n}\n\nfunction destroy_each(iterations, detaching) {\n\tfor (let i = 0; i < iterations.length; i += 1) {\n\t\tif (iterations[i]) iterations[i].d(detaching);\n\t}\n}\n\nfunction element(name) {\n\treturn document.createElement(name);\n}\n\nfunction svg_element(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\nfunction text(data) {\n\treturn document.createTextNode(data);\n}\n\nfunction space() {\n\treturn text(' ');\n}\n\nfunction empty() {\n\treturn text('');\n}\n\nfunction listen(node, event, handler, options) {\n\tnode.addEventListener(event, handler, options);\n\treturn () => node.removeEventListener(event, handler, options);\n}\n\nfunction prevent_default(fn) {\n\treturn function(event) {\n\t\tevent.preventDefault();\n\t\treturn fn.call(this, event);\n\t};\n}\n\nfunction stop_propagation(fn) {\n\treturn function(event) {\n\t\tevent.stopPropagation();\n\t\treturn fn.call(this, event);\n\t};\n}\n\nfunction attr(node, attribute, value) {\n\tif (value == null) node.removeAttribute(attribute);\n\telse node.setAttribute(attribute, value);\n}\n\nfunction set_attributes(node, attributes) {\n\tfor (const key in attributes) {\n\t\tif (key === 'style') {\n\t\t\tnode.style.cssText = attributes[key];\n\t\t} else if (key in node) {\n\t\t\tnode[key] = attributes[key];\n\t\t} else {\n\t\t\tattr(node, key, attributes[key]);\n\t\t}\n\t}\n}\n\nfunction set_custom_element_data(node, prop, value) {\n\tif (prop in node) {\n\t\tnode[prop] = value;\n\t} else {\n\t\tattr(node, prop, value);\n\t}\n}\n\nfunction xlink_attr(node, attribute, value) {\n\tnode.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\n\nfunction get_binding_group_value(group) {\n\tconst value = [];\n\tfor (let i = 0; i < group.length; i += 1) {\n\t\tif (group[i].checked) value.push(group[i].__value);\n\t}\n\treturn value;\n}\n\nfunction to_number(value) {\n\treturn value === '' ? undefined : +value;\n}\n\nfunction time_ranges_to_array(ranges) {\n\tconst array = [];\n\tfor (let i = 0; i < ranges.length; i += 1) {\n\t\tarray.push({ start: ranges.start(i), end: ranges.end(i) });\n\t}\n\treturn array;\n}\n\nfunction children(element) {\n\treturn Array.from(element.childNodes);\n}\n\nfunction claim_element(nodes, name, attributes, svg) {\n\tfor (let i = 0; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeName === name) {\n\t\t\tfor (let j = 0; j < node.attributes.length; j += 1) {\n\t\t\t\tconst attribute = node.attributes[j];\n\t\t\t\tif (!attributes[attribute.name]) node.removeAttribute(attribute.name);\n\t\t\t}\n\t\t\treturn nodes.splice(i, 1)[0]; // TODO strip unwanted attributes\n\t\t}\n\t}\n\n\treturn svg ? svg_element(name) : element(name);\n}\n\nfunction claim_text(nodes, data) {\n\tfor (let i = 0; i < nodes.length; i += 1) {\n\t\tconst node = nodes[i];\n\t\tif (node.nodeType === 3) {\n\t\t\tnode.data = data;\n\t\t\treturn nodes.splice(i, 1)[0];\n\t\t}\n\t}\n\n\treturn text(data);\n}\n\nfunction set_data(text, data) {\n\tdata = '' + data;\n\tif (text.data !== data) text.data = data;\n}\n\nfunction set_input_type(input, type) {\n\ttry {\n\t\tinput.type = type;\n\t} catch (e) {\n\t\t// do nothing\n\t}\n}\n\nfunction set_style(node, key, value) {\n\tnode.style.setProperty(key, value);\n}\n\nfunction select_option(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\n\t\tif (option.__value === value) {\n\t\t\toption.selected = true;\n\t\t\treturn;\n\t\t}\n\t}\n}\n\nfunction select_options(select, value) {\n\tfor (let i = 0; i < select.options.length; i += 1) {\n\t\tconst option = select.options[i];\n\t\toption.selected = ~value.indexOf(option.__value);\n\t}\n}\n\nfunction select_value(select) {\n\tconst selected_option = select.querySelector(':checked') || select.options[0];\n\treturn selected_option && selected_option.__value;\n}\n\nfunction select_multiple_value(select) {\n\treturn [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n\nfunction add_resize_listener(element, fn) {\n\tif (getComputedStyle(element).position === 'static') {\n\t\telement.style.position = 'relative';\n\t}\n\n\tconst object = document.createElement('object');\n\tobject.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; pointer-events: none; z-index: -1;');\n\tobject.type = 'text/html';\n\n\tlet win;\n\n\tobject.onload = () => {\n\t\twin = object.contentDocument.defaultView;\n\t\twin.addEventListener('resize', fn);\n\t};\n\n\tif (/Trident/.test(navigator.userAgent)) {\n\t\telement.appendChild(object);\n\t\tobject.data = 'about:blank';\n\t} else {\n\t\tobject.data = 'about:blank';\n\t\telement.appendChild(object);\n\t}\n\n\treturn {\n\t\tcancel: () => {\n\t\t\twin && win.removeEventListener && win.removeEventListener('resize', fn);\n\t\t\telement.removeChild(object);\n\t\t}\n\t};\n}\n\nfunction toggle_class(element, name, toggle) {\n\telement.classList[toggle ? 'add' : 'remove'](name);\n}\n\nfunction custom_event(type, detail) {\n\tconst e = document.createEvent('CustomEvent');\n\te.initCustomEvent(type, false, false, detail);\n\treturn e;\n}\n\nlet stylesheet;\nlet active = 0;\nlet current_rules = {};\n\n// https://github.com/darkskyapp/string-hash/blob/master/index.js\nfunction hash(str) {\n\tlet hash = 5381;\n\tlet i = str.length;\n\n\twhile (i--) hash = ((hash << 5) - hash) ^ str.charCodeAt(i);\n\treturn hash >>> 0;\n}\n\nfunction create_rule(node, a, b, duration, delay, ease, fn, uid = 0) {\n\tconst step = 16.666 / duration;\n\tlet keyframes = '{\\n';\n\n\tfor (let p = 0; p <= 1; p += step) {\n\t\tconst t = a + (b - a) * ease(p);\n\t\tkeyframes += p * 100 + `%{${fn(t, 1 - t)}}\\n`;\n\t}\n\n\tconst rule = keyframes + `100% {${fn(b, 1 - b)}}\\n}`;\n\tconst name = `__svelte_${hash(rule)}_${uid}`;\n\n\tif (!current_rules[name]) {\n\t\tif (!stylesheet) {\n\t\t\tconst style = element('style');\n\t\t\tdocument.head.appendChild(style);\n\t\t\tstylesheet = style.sheet;\n\t\t}\n\n\t\tcurrent_rules[name] = true;\n\t\tstylesheet.insertRule(`@keyframes ${name} ${rule}`, stylesheet.cssRules.length);\n\t}\n\n\tconst animation = node.style.animation || '';\n\tnode.style.animation = `${animation ? `${animation}, ` : ``}${name} ${duration}ms linear ${delay}ms 1 both`;\n\n\tactive += 1;\n\treturn name;\n}\n\nfunction delete_rule(node, name) {\n\tnode.style.animation = (node.style.animation || '')\n\t\t.split(', ')\n\t\t.filter(name\n\t\t\t? anim => anim.indexOf(name) < 0 // remove specific animation\n\t\t\t: anim => anim.indexOf('__svelte') === -1 // remove all Svelte animations\n\t\t)\n\t\t.join(', ');\n\n\tif (name && !--active) clear_rules();\n}\n\nfunction clear_rules() {\n\trequestAnimationFrame(() => {\n\t\tif (active) return;\n\t\tlet i = stylesheet.cssRules.length;\n\t\twhile (i--) stylesheet.deleteRule(i);\n\t\tcurrent_rules = {};\n\t});\n}\n\nfunction create_animation(node, from, fn, params) {\n\tif (!from) return noop;\n\n\tconst to = node.getBoundingClientRect();\n\tif (from.left === to.left && from.right === to.right && from.top === to.top && from.bottom === to.bottom) return noop;\n\n\tconst {\n\t\tdelay = 0,\n\t\tduration = 300,\n\t\teasing = identity,\n\t\tstart: start_time = window.performance.now() + delay,\n\t\tend = start_time + duration,\n\t\ttick = noop,\n\t\tcss\n\t} = fn(node, { from, to }, params);\n\n\tlet running = true;\n\tlet started = false;\n\tlet name;\n\n\tconst css_text = node.style.cssText;\n\n\tfunction start() {\n\t\tif (css) {\n\t\t\tif (delay) node.style.cssText = css_text; // TODO create delayed animation instead?\n\t\t\tname = create_rule(node, 0, 1, duration, 0, easing, css);\n\t\t}\n\n\t\tstarted = true;\n\t}\n\n\tfunction stop() {\n\t\tif (css) delete_rule(node, name);\n\t\trunning = false;\n\t}\n\n\tloop(now => {\n\t\tif (!started && now >= start_time) {\n\t\t\tstart();\n\t\t}\n\n\t\tif (started && now >= end) {\n\t\t\ttick(1, 0);\n\t\t\tstop();\n\t\t}\n\n\t\tif (!running) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (started) {\n\t\t\tconst p = now - start_time;\n\t\t\tconst t = 0 + 1 * easing(p / duration);\n\t\t\ttick(t, 1 - t);\n\t\t}\n\n\t\treturn true;\n\t});\n\n\tif (delay) {\n\t\tif (css) node.style.cssText += css(0, 1);\n\t} else {\n\t\tstart();\n\t}\n\n\ttick(0, 1);\n\n\treturn stop;\n}\n\nfunction fix_position(node) {\n\tconst style = getComputedStyle(node);\n\n\tif (style.position !== 'absolute' && style.position !== 'fixed') {\n\t\tconst { width, height } = style;\n\t\tconst a = node.getBoundingClientRect();\n\t\tnode.style.position = 'absolute';\n\t\tnode.style.width = width;\n\t\tnode.style.height = height;\n\t\tconst b = node.getBoundingClientRect();\n\n\t\tif (a.left !== b.left || a.top !== b.top) {\n\t\t\tconst style = getComputedStyle(node);\n\t\t\tconst transform = style.transform === 'none' ? '' : style.transform;\n\n\t\t\tnode.style.transform = `${transform} translate(${a.left - b.left}px, ${a.top - b.top}px)`;\n\t\t}\n\t}\n}\n\nlet current_component;\n\nfunction set_current_component(component) {\n\tcurrent_component = component;\n}\n\nfunction get_current_component() {\n\tif (!current_component) throw new Error(`Function called outside component initialization`);\n\treturn current_component;\n}\n\nfunction beforeUpdate(fn) {\n\tget_current_component().$$.before_render.push(fn);\n}\n\nfunction onMount(fn) {\n\tget_current_component().$$.on_mount.push(fn);\n}\n\nfunction afterUpdate(fn) {\n\tget_current_component().$$.after_render.push(fn);\n}\n\nfunction onDestroy(fn) {\n\tget_current_component().$$.on_destroy.push(fn);\n}\n\nfunction createEventDispatcher() {\n\tconst component = current_component;\n\n\treturn (type, detail) => {\n\t\tconst callbacks = component.$$.callbacks[type];\n\n\t\tif (callbacks) {\n\t\t\t// TODO are there situations where events could be dispatched\n\t\t\t// in a server (non-DOM) environment?\n\t\t\tconst event = custom_event(type, detail);\n\t\t\tcallbacks.slice().forEach(fn => {\n\t\t\t\tfn.call(component, event);\n\t\t\t});\n\t\t}\n\t};\n}\n\nfunction setContext(key, context) {\n\tget_current_component().$$.context.set(key, context);\n}\n\nfunction getContext(key) {\n\treturn get_current_component().$$.context.get(key);\n}\n\n// TODO figure out if we still want to support\n// shorthand events, or if we want to implement\n// a real bubbling mechanism\nfunction bubble(component, event) {\n\tconst callbacks = component.$$.callbacks[event.type];\n\n\tif (callbacks) {\n\t\tcallbacks.slice().forEach(fn => fn(event));\n\t}\n}\n\nconst dirty_components = [];\nconst intros = { enabled: false };\n\nlet update_promise;\nconst binding_callbacks = [];\nconst render_callbacks = [];\nconst flush_callbacks = [];\n\nfunction schedule_update() {\n\tif (!update_promise) {\n\t\tupdate_promise = Promise.resolve();\n\t\tupdate_promise.then(flush);\n\t}\n}\n\nfunction tick() {\n\tschedule_update();\n\treturn update_promise;\n}\n\nfunction add_binding_callback(fn) {\n\tbinding_callbacks.push(fn);\n}\n\nfunction add_render_callback(fn) {\n\trender_callbacks.push(fn);\n}\n\nfunction add_flush_callback(fn) {\n\tflush_callbacks.push(fn);\n}\n\nfunction flush() {\n\tconst seen_callbacks = new Set();\n\n\tdo {\n\t\t// first, call beforeUpdate functions\n\t\t// and update components\n\t\twhile (dirty_components.length) {\n\t\t\tconst component = dirty_components.shift();\n\t\t\tset_current_component(component);\n\t\t\tupdate(component.$$);\n\t\t}\n\n\t\twhile (binding_callbacks.length) binding_callbacks.shift()();\n\n\t\t// then, once components are updated, call\n\t\t// afterUpdate functions. This may cause\n\t\t// subsequent updates...\n\t\twhile (render_callbacks.length) {\n\t\t\tconst callback = render_callbacks.pop();\n\t\t\tif (!seen_callbacks.has(callback)) {\n\t\t\t\tcallback();\n\n\t\t\t\t// ...so guard against infinite loops\n\t\t\t\tseen_callbacks.add(callback);\n\t\t\t}\n\t\t}\n\t} while (dirty_components.length);\n\n\twhile (flush_callbacks.length) {\n\t\tflush_callbacks.pop()();\n\t}\n\n\tupdate_promise = null;\n}\n\nfunction update($$) {\n\tif ($$.fragment) {\n\t\t$$.update($$.dirty);\n\t\trun_all($$.before_render);\n\t\t$$.fragment.p($$.dirty, $$.ctx);\n\t\t$$.dirty = null;\n\n\t\t$$.after_render.forEach(add_render_callback);\n\t}\n}\n\nlet promise;\n\nfunction wait() {\n\tif (!promise) {\n\t\tpromise = Promise.resolve();\n\t\tpromise.then(() => {\n\t\t\tpromise = null;\n\t\t});\n\t}\n\n\treturn promise;\n}\n\nfunction dispatch(node, direction, kind) {\n\tnode.dispatchEvent(custom_event(`${direction ? 'intro' : 'outro'}${kind}`));\n}\n\nlet outros;\n\nfunction group_outros() {\n\toutros = {\n\t\tremaining: 0,\n\t\tcallbacks: []\n\t};\n}\n\nfunction check_outros() {\n\tif (!outros.remaining) {\n\t\trun_all(outros.callbacks);\n\t}\n}\n\nfunction on_outro(callback) {\n\toutros.callbacks.push(callback);\n}\n\nfunction create_in_transition(node, fn, params) {\n\tlet config = fn(node, params);\n\tlet running = false;\n\tlet animation_name;\n\tlet task;\n\tlet uid = 0;\n\n\tfunction cleanup() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = identity,\n\t\t\ttick: tick$$1 = noop,\n\t\t\tcss\n\t\t} = config;\n\n\t\tif (css) animation_name = create_rule(node, 0, 1, duration, delay, easing, css, uid++);\n\t\ttick$$1(0, 1);\n\n\t\tconst start_time = window.performance.now() + delay;\n\t\tconst end_time = start_time + duration;\n\n\t\tif (task) task.abort();\n\t\trunning = true;\n\n\t\ttask = loop(now => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick$$1(1, 0);\n\t\t\t\t\tcleanup();\n\t\t\t\t\treturn running = false;\n\t\t\t\t}\n\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick$$1(t, 1 - t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn running;\n\t\t});\n\t}\n\n\tlet started = false;\n\n\treturn {\n\t\tstart() {\n\t\t\tif (started) return;\n\n\t\t\tdelete_rule(node);\n\n\t\t\tif (typeof config === 'function') {\n\t\t\t\tconfig = config();\n\t\t\t\twait().then(go);\n\t\t\t} else {\n\t\t\t\tgo();\n\t\t\t}\n\t\t},\n\n\t\tinvalidate() {\n\t\t\tstarted = false;\n\t\t},\n\n\t\tend() {\n\t\t\tif (running) {\n\t\t\t\tcleanup();\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\nfunction create_out_transition(node, fn, params) {\n\tlet config = fn(node, params);\n\tlet running = true;\n\tlet animation_name;\n\n\tconst group = outros;\n\n\tgroup.remaining += 1;\n\n\tfunction go() {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = identity,\n\t\t\ttick: tick$$1 = noop,\n\t\t\tcss\n\t\t} = config;\n\n\t\tif (css) animation_name = create_rule(node, 1, 0, duration, delay, easing, css);\n\n\t\tconst start_time = window.performance.now() + delay;\n\t\tconst end_time = start_time + duration;\n\n\t\tloop(now => {\n\t\t\tif (running) {\n\t\t\t\tif (now >= end_time) {\n\t\t\t\t\ttick$$1(0, 1);\n\n\t\t\t\t\tif (!--group.remaining) {\n\t\t\t\t\t\t// this will result in `end()` being called,\n\t\t\t\t\t\t// so we don't need to clean up here\n\t\t\t\t\t\trun_all(group.callbacks);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (now >= start_time) {\n\t\t\t\t\tconst t = easing((now - start_time) / duration);\n\t\t\t\t\ttick$$1(1 - t, t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn running;\n\t\t});\n\t}\n\n\tif (typeof config === 'function') {\n\t\twait().then(() => {\n\t\t\tconfig = config();\n\t\t\tgo();\n\t\t});\n\t} else {\n\t\tgo();\n\t}\n\n\treturn {\n\t\tend(reset) {\n\t\t\tif (reset && config.tick) {\n\t\t\t\tconfig.tick(1, 0);\n\t\t\t}\n\n\t\t\tif (running) {\n\t\t\t\tif (animation_name) delete_rule(node, animation_name);\n\t\t\t\trunning = false;\n\t\t\t}\n\t\t}\n\t};\n}\n\nfunction create_bidirectional_transition(node, fn, params, intro) {\n\tlet config = fn(node, params);\n\n\tlet t = intro ? 0 : 1;\n\n\tlet running_program = null;\n\tlet pending_program = null;\n\tlet animation_name = null;\n\n\tfunction clear_animation() {\n\t\tif (animation_name) delete_rule(node, animation_name);\n\t}\n\n\tfunction init(program, duration) {\n\t\tconst d = program.b - t;\n\t\tduration *= Math.abs(d);\n\n\t\treturn {\n\t\t\ta: t,\n\t\t\tb: program.b,\n\t\t\td,\n\t\t\tduration,\n\t\t\tstart: program.start,\n\t\t\tend: program.start + duration,\n\t\t\tgroup: program.group\n\t\t};\n\t}\n\n\tfunction go(b) {\n\t\tconst {\n\t\t\tdelay = 0,\n\t\t\tduration = 300,\n\t\t\teasing = identity,\n\t\t\ttick: tick$$1 = noop,\n\t\t\tcss\n\t\t} = config;\n\n\t\tconst program = {\n\t\t\tstart: window.performance.now() + delay,\n\t\t\tb\n\t\t};\n\n\t\tif (!b) {\n\t\t\tprogram.group = outros;\n\t\t\toutros.remaining += 1;\n\t\t}\n\n\t\tif (running_program) {\n\t\t\tpending_program = program;\n\t\t} else {\n\t\t\t// if this is an intro, and there's a delay, we need to do\n\t\t\t// an initial tick and/or apply CSS animation immediately\n\t\t\tif (css) {\n\t\t\t\tclear_animation();\n\t\t\t\tanimation_name = create_rule(node, t, b, duration, delay, easing, css);\n\t\t\t}\n\n\t\t\tif (b) tick$$1(0, 1);\n\n\t\t\trunning_program = init(program, duration);\n\t\t\tadd_render_callback(() => dispatch(node, b, 'start'));\n\n\t\t\tloop(now => {\n\t\t\t\tif (pending_program && now > pending_program.start) {\n\t\t\t\t\trunning_program = init(pending_program, duration);\n\t\t\t\t\tpending_program = null;\n\n\t\t\t\t\tdispatch(node, running_program.b, 'start');\n\n\t\t\t\t\tif (css) {\n\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\tanimation_name = create_rule(node, t, running_program.b, running_program.duration, 0, easing, config.css);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (running_program) {\n\t\t\t\t\tif (now >= running_program.end) {\n\t\t\t\t\t\ttick$$1(t = running_program.b, 1 - t);\n\t\t\t\t\t\tdispatch(node, running_program.b, 'end');\n\n\t\t\t\t\t\tif (!pending_program) {\n\t\t\t\t\t\t\t// we're done\n\t\t\t\t\t\t\tif (running_program.b) {\n\t\t\t\t\t\t\t\t// intro — we can tidy up immediately\n\t\t\t\t\t\t\t\tclear_animation();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// outro — needs to be coordinated\n\t\t\t\t\t\t\t\tif (!--running_program.group.remaining) run_all(running_program.group.callbacks);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\trunning_program = null;\n\t\t\t\t\t}\n\n\t\t\t\t\telse if (now >= running_program.start) {\n\t\t\t\t\t\tconst p = now - running_program.start;\n\t\t\t\t\t\tt = running_program.a + running_program.d * easing(p / running_program.duration);\n\t\t\t\t\t\ttick$$1(t, 1 - t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn !!(running_program || pending_program);\n\t\t\t});\n\t\t}\n\t}\n\n\treturn {\n\t\trun(b) {\n\t\t\tif (typeof config === 'function') {\n\t\t\t\twait().then(() => {\n\t\t\t\t\tconfig = config();\n\t\t\t\t\tgo(b);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tgo(b);\n\t\t\t}\n\t\t},\n\n\t\tend() {\n\t\t\tclear_animation();\n\t\t\trunning_program = pending_program = null;\n\t\t}\n\t};\n}\n\nfunction handle_promise(promise, info) {\n\tconst token = info.token = {};\n\n\tfunction update(type, index, key, value) {\n\t\tif (info.token !== token) return;\n\n\t\tinfo.resolved = key && { [key]: value };\n\n\t\tconst child_ctx = assign(assign({}, info.ctx), info.resolved);\n\t\tconst block = type && (info.current = type)(child_ctx);\n\n\t\tif (info.block) {\n\t\t\tif (info.blocks) {\n\t\t\t\tinfo.blocks.forEach((block, i) => {\n\t\t\t\t\tif (i !== index && block) {\n\t\t\t\t\t\tgroup_outros();\n\t\t\t\t\t\ton_outro(() => {\n\t\t\t\t\t\t\tblock.d(1);\n\t\t\t\t\t\t\tinfo.blocks[i] = null;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tblock.o(1);\n\t\t\t\t\t\tcheck_outros();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tinfo.block.d(1);\n\t\t\t}\n\n\t\t\tblock.c();\n\t\t\tif (block.i) block.i(1);\n\t\t\tblock.m(info.mount(), info.anchor);\n\n\t\t\tflush();\n\t\t}\n\n\t\tinfo.block = block;\n\t\tif (info.blocks) info.blocks[index] = block;\n\t}\n\n\tif (is_promise(promise)) {\n\t\tpromise.then(value => {\n\t\t\tupdate(info.then, 1, info.value, value);\n\t\t}, error => {\n\t\t\tupdate(info.catch, 2, info.error, error);\n\t\t});\n\n\t\t// if we previously had a then/catch block, destroy it\n\t\tif (info.current !== info.pending) {\n\t\t\tupdate(info.pending, 0);\n\t\t\treturn true;\n\t\t}\n\t} else {\n\t\tif (info.current !== info.then) {\n\t\t\tupdate(info.then, 1, info.value, promise);\n\t\t\treturn true;\n\t\t}\n\n\t\tinfo.resolved = { [info.value]: promise };\n\t}\n}\n\nfunction destroy_block(block, lookup) {\n\tblock.d(1);\n\tlookup.delete(block.key);\n}\n\nfunction outro_and_destroy_block(block, lookup) {\n\ton_outro(() => {\n\t\tdestroy_block(block, lookup);\n\t});\n\n\tblock.o(1);\n}\n\nfunction fix_and_outro_and_destroy_block(block, lookup) {\n\tblock.f();\n\toutro_and_destroy_block(block, lookup);\n}\n\nfunction update_keyed_each(old_blocks, changed, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) {\n\tlet o = old_blocks.length;\n\tlet n = list.length;\n\n\tlet i = o;\n\tconst old_indexes = {};\n\twhile (i--) old_indexes[old_blocks[i].key] = i;\n\n\tconst new_blocks = [];\n\tconst new_lookup = new Map();\n\tconst deltas = new Map();\n\n\ti = n;\n\twhile (i--) {\n\t\tconst child_ctx = get_context(ctx, list, i);\n\t\tconst key = get_key(child_ctx);\n\t\tlet block = lookup.get(key);\n\n\t\tif (!block) {\n\t\t\tblock = create_each_block(key, child_ctx);\n\t\t\tblock.c();\n\t\t} else if (dynamic) {\n\t\t\tblock.p(changed, child_ctx);\n\t\t}\n\n\t\tnew_lookup.set(key, new_blocks[i] = block);\n\n\t\tif (key in old_indexes) deltas.set(key, Math.abs(i - old_indexes[key]));\n\t}\n\n\tconst will_move = new Set();\n\tconst did_move = new Set();\n\n\tfunction insert(block) {\n\t\tif (block.i) block.i(1);\n\t\tblock.m(node, next);\n\t\tlookup.set(block.key, block);\n\t\tnext = block.first;\n\t\tn--;\n\t}\n\n\twhile (o && n) {\n\t\tconst new_block = new_blocks[n - 1];\n\t\tconst old_block = old_blocks[o - 1];\n\t\tconst new_key = new_block.key;\n\t\tconst old_key = old_block.key;\n\n\t\tif (new_block === old_block) {\n\t\t\t// do nothing\n\t\t\tnext = new_block.first;\n\t\t\to--;\n\t\t\tn--;\n\t\t}\n\n\t\telse if (!new_lookup.has(old_key)) {\n\t\t\t// remove old block\n\t\t\tdestroy(old_block, lookup);\n\t\t\to--;\n\t\t}\n\n\t\telse if (!lookup.has(new_key) || will_move.has(new_key)) {\n\t\t\tinsert(new_block);\n\t\t}\n\n\t\telse if (did_move.has(old_key)) {\n\t\t\to--;\n\n\t\t} else if (deltas.get(new_key) > deltas.get(old_key)) {\n\t\t\tdid_move.add(new_key);\n\t\t\tinsert(new_block);\n\n\t\t} else {\n\t\t\twill_move.add(old_key);\n\t\t\to--;\n\t\t}\n\t}\n\n\twhile (o--) {\n\t\tconst old_block = old_blocks[o];\n\t\tif (!new_lookup.has(old_block.key)) destroy(old_block, lookup);\n\t}\n\n\twhile (n) insert(new_blocks[n - 1]);\n\n\treturn new_blocks;\n}\n\nfunction measure(blocks) {\n\tconst rects = {};\n\tlet i = blocks.length;\n\twhile (i--) rects[blocks[i].key] = blocks[i].node.getBoundingClientRect();\n\treturn rects;\n}\n\nfunction get_spread_update(levels, updates) {\n\tconst update = {};\n\n\tconst to_null_out = {};\n\tconst accounted_for = {};\n\n\tlet i = levels.length;\n\twhile (i--) {\n\t\tconst o = levels[i];\n\t\tconst n = updates[i];\n\n\t\tif (n) {\n\t\t\tfor (const key in o) {\n\t\t\t\tif (!(key in n)) to_null_out[key] = 1;\n\t\t\t}\n\n\t\t\tfor (const key in n) {\n\t\t\t\tif (!accounted_for[key]) {\n\t\t\t\t\tupdate[key] = n[key];\n\t\t\t\t\taccounted_for[key] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlevels[i] = n;\n\t\t} else {\n\t\t\tfor (const key in o) {\n\t\t\t\taccounted_for[key] = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tfor (const key in to_null_out) {\n\t\tif (!(key in update)) update[key] = undefined;\n\t}\n\n\treturn update;\n}\n\nconst invalid_attribute_name_character = /[\\s'\">/=\\u{FDD0}-\\u{FDEF}\\u{FFFE}\\u{FFFF}\\u{1FFFE}\\u{1FFFF}\\u{2FFFE}\\u{2FFFF}\\u{3FFFE}\\u{3FFFF}\\u{4FFFE}\\u{4FFFF}\\u{5FFFE}\\u{5FFFF}\\u{6FFFE}\\u{6FFFF}\\u{7FFFE}\\u{7FFFF}\\u{8FFFE}\\u{8FFFF}\\u{9FFFE}\\u{9FFFF}\\u{AFFFE}\\u{AFFFF}\\u{BFFFE}\\u{BFFFF}\\u{CFFFE}\\u{CFFFF}\\u{DFFFE}\\u{DFFFF}\\u{EFFFE}\\u{EFFFF}\\u{FFFFE}\\u{FFFFF}\\u{10FFFE}\\u{10FFFF}]/u;\n// https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n// https://infra.spec.whatwg.org/#noncharacter\n\nfunction spread(args) {\n\tconst attributes = Object.assign({}, ...args);\n\tlet str = '';\n\n\tObject.keys(attributes).forEach(name => {\n\t\tif (invalid_attribute_name_character.test(name)) return;\n\n\t\tconst value = attributes[name];\n\t\tif (value === undefined) return;\n\t\tif (value === true) str += \" \" + name;\n\n\t\tconst escaped = String(value)\n\t\t\t.replace(/\"/g, '&#34;')\n\t\t\t.replace(/'/g, '&#39;');\n\n\t\tstr += \" \" + name + \"=\" + JSON.stringify(escaped);\n\t});\n\n\treturn str;\n}\n\nconst escaped = {\n\t'\"': '&quot;',\n\t\"'\": '&#39;',\n\t'&': '&amp;',\n\t'<': '&lt;',\n\t'>': '&gt;'\n};\n\nfunction escape(html) {\n\treturn String(html).replace(/[\"'&<>]/g, match => escaped[match]);\n}\n\nfunction each(items, fn) {\n\tlet str = '';\n\tfor (let i = 0; i < items.length; i += 1) {\n\t\tstr += fn(items[i], i);\n\t}\n\treturn str;\n}\n\nconst missing_component = {\n\t$$render: () => ''\n};\n\nfunction validate_component(component, name) {\n\tif (!component || !component.$$render) {\n\t\tif (name === 'svelte:component') name += ' this={...}';\n\t\tthrow new Error(`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules`);\n\t}\n\n\treturn component;\n}\n\nfunction debug(file, line, column, values) {\n\tconsole.log(`{@debug} ${file ? file + ' ' : ''}(${line}:${column})`); // eslint-disable-line no-console\n\tconsole.log(values); // eslint-disable-line no-console\n\treturn '';\n}\n\nlet on_destroy;\n\nfunction create_ssr_component(fn) {\n\tfunction $$render(result, props, bindings, slots) {\n\t\tconst parent_component = current_component;\n\n\t\tconst $$ = {\n\t\t\ton_destroy,\n\t\t\tcontext: new Map(parent_component ? parent_component.$$.context : []),\n\n\t\t\t// these will be immediately discarded\n\t\t\ton_mount: [],\n\t\t\tbefore_render: [],\n\t\t\tafter_render: [],\n\t\t\tcallbacks: blank_object()\n\t\t};\n\n\t\tset_current_component({ $$ });\n\n\t\tconst html = fn(result, props, bindings, slots);\n\n\t\tset_current_component(parent_component);\n\t\treturn html;\n\t}\n\n\treturn {\n\t\trender: (props = {}, options = {}) => {\n\t\t\ton_destroy = [];\n\n\t\t\tconst result = { head: '', css: new Set() };\n\t\t\tconst html = $$render(result, props, {}, options);\n\n\t\t\trun_all(on_destroy);\n\n\t\t\treturn {\n\t\t\t\thtml,\n\t\t\t\tcss: {\n\t\t\t\t\tcode: Array.from(result.css).map(css => css.code).join('\\n'),\n\t\t\t\t\tmap: null // TODO\n\t\t\t\t},\n\t\t\t\thead: result.head\n\t\t\t};\n\t\t},\n\n\t\t$$render\n\t};\n}\n\nfunction get_store_value(store) {\n\tlet value;\n\tstore.subscribe(_ => value = _)();\n\treturn value;\n}\n\nfunction bind(component, name, callback) {\n\tif (component.$$.props.indexOf(name) === -1) return;\n\tcomponent.$$.bound[name] = callback;\n\tcallback(component.$$.ctx[name]);\n}\n\nfunction mount_component(component, target, anchor) {\n\tconst { fragment, on_mount, on_destroy, after_render } = component.$$;\n\n\tfragment.m(target, anchor);\n\n\t// onMount happens after the initial afterUpdate. Because\n\t// afterUpdate callbacks happen in reverse order (inner first)\n\t// we schedule onMount callbacks before afterUpdate callbacks\n\tadd_render_callback(() => {\n\t\tconst new_on_destroy = on_mount.map(run).filter(is_function);\n\t\tif (on_destroy) {\n\t\t\ton_destroy.push(...new_on_destroy);\n\t\t} else {\n\t\t\t// Edge case - component was destroyed immediately,\n\t\t\t// most likely as a result of a binding initialising\n\t\t\trun_all(new_on_destroy);\n\t\t}\n\t\tcomponent.$$.on_mount = [];\n\t});\n\n\tafter_render.forEach(add_render_callback);\n}\n\nfunction destroy(component, detaching) {\n\tif (component.$$) {\n\t\trun_all(component.$$.on_destroy);\n\t\tcomponent.$$.fragment.d(detaching);\n\n\t\t// TODO null out other refs, including component.$$ (but need to\n\t\t// preserve final state?)\n\t\tcomponent.$$.on_destroy = component.$$.fragment = null;\n\t\tcomponent.$$.ctx = {};\n\t}\n}\n\nfunction make_dirty(component, key) {\n\tif (!component.$$.dirty) {\n\t\tdirty_components.push(component);\n\t\tschedule_update();\n\t\tcomponent.$$.dirty = {};\n\t}\n\tcomponent.$$.dirty[key] = true;\n}\n\nfunction init(component, options, instance, create_fragment, not_equal$$1, prop_names) {\n\tconst parent_component = current_component;\n\tset_current_component(component);\n\n\tconst props = options.props || {};\n\n\tconst $$ = component.$$ = {\n\t\tfragment: null,\n\t\tctx: null,\n\n\t\t// state\n\t\tprops: prop_names,\n\t\tupdate: noop,\n\t\tnot_equal: not_equal$$1,\n\t\tbound: blank_object(),\n\n\t\t// lifecycle\n\t\ton_mount: [],\n\t\ton_destroy: [],\n\t\tbefore_render: [],\n\t\tafter_render: [],\n\t\tcontext: new Map(parent_component ? parent_component.$$.context : []),\n\n\t\t// everything else\n\t\tcallbacks: blank_object(),\n\t\tdirty: null\n\t};\n\n\tlet ready = false;\n\n\t$$.ctx = instance\n\t\t? instance(component, props, (key, value) => {\n\t\t\tif ($$.ctx && not_equal$$1($$.ctx[key], $$.ctx[key] = value)) {\n\t\t\t\tif ($$.bound[key]) $$.bound[key](value);\n\t\t\t\tif (ready) make_dirty(component, key);\n\t\t\t}\n\t\t})\n\t\t: props;\n\n\t$$.update();\n\tready = true;\n\trun_all($$.before_render);\n\t$$.fragment = create_fragment($$.ctx);\n\n\tif (options.target) {\n\t\tif (options.hydrate) {\n\t\t\t$$.fragment.l(children(options.target));\n\t\t} else {\n\t\t\t$$.fragment.c();\n\t\t}\n\n\t\tif (options.intro && component.$$.fragment.i) component.$$.fragment.i();\n\t\tmount_component(component, options.target, options.anchor);\n\t\tflush();\n\t}\n\n\tset_current_component(parent_component);\n}\n\nlet SvelteElement;\nif (typeof HTMLElement !== 'undefined') {\n\tSvelteElement = class extends HTMLElement {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.attachShadow({ mode: 'open' });\n\t\t}\n\n\t\tconnectedCallback() {\n\t\t\tfor (const key in this.$$.slotted) {\n\t\t\t\tthis.appendChild(this.$$.slotted[key]);\n\t\t\t}\n\t\t}\n\n\t\tattributeChangedCallback(attr$$1, oldValue, newValue) {\n\t\t\tthis[attr$$1] = newValue;\n\t\t}\n\n\t\t$destroy() {\n\t\t\tdestroy(this, true);\n\t\t\tthis.$destroy = noop;\n\t\t}\n\n\t\t$on(type, callback) {\n\t\t\t// TODO should this delegate to addEventListener?\n\t\t\tconst callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n\t\t\tcallbacks.push(callback);\n\n\t\t\treturn () => {\n\t\t\t\tconst index = callbacks.indexOf(callback);\n\t\t\t\tif (index !== -1) callbacks.splice(index, 1);\n\t\t\t};\n\t\t}\n\n\t\t$set() {\n\t\t\t// overridden by instance, if it has props\n\t\t}\n\t};\n}\n\nclass SvelteComponent {\n\t$destroy() {\n\t\tdestroy(this, true);\n\t\tthis.$destroy = noop;\n\t}\n\n\t$on(type, callback) {\n\t\tconst callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = []));\n\t\tcallbacks.push(callback);\n\n\t\treturn () => {\n\t\t\tconst index = callbacks.indexOf(callback);\n\t\t\tif (index !== -1) callbacks.splice(index, 1);\n\t\t};\n\t}\n\n\t$set() {\n\t\t// overridden by instance, if it has props\n\t}\n}\n\nclass SvelteComponentDev extends SvelteComponent {\n\tconstructor(options) {\n\t\tif (!options || (!options.target && !options.$$inline)) {\n\t\t\tthrow new Error(`'target' is a required option`);\n\t\t}\n\n\t\tsuper();\n\t}\n\n\t$destroy() {\n\t\tsuper.$destroy();\n\t\tthis.$destroy = () => {\n\t\t\tconsole.warn(`Component was already destroyed`); // eslint-disable-line no-console\n\t\t};\n\t}\n}\n\nexport { create_animation, fix_position, handle_promise, append, insert, detach, detach_between, detach_before, detach_after, destroy_each, element, svg_element, text, space, empty, listen, prevent_default, stop_propagation, attr, set_attributes, set_custom_element_data, xlink_attr, get_binding_group_value, to_number, time_ranges_to_array, children, claim_element, claim_text, set_data, set_input_type, set_style, select_option, select_options, select_value, select_multiple_value, add_resize_listener, toggle_class, custom_event, destroy_block, outro_and_destroy_block, fix_and_outro_and_destroy_block, update_keyed_each, measure, current_component, set_current_component, beforeUpdate, onMount, afterUpdate, onDestroy, createEventDispatcher, setContext, getContext, bubble, clear_loops, loop, dirty_components, intros, schedule_update, tick, add_binding_callback, add_render_callback, add_flush_callback, flush, get_spread_update, invalid_attribute_name_character, spread, escaped, escape, each, missing_component, validate_component, debug, create_ssr_component, get_store_value, group_outros, check_outros, on_outro, create_in_transition, create_out_transition, create_bidirectional_transition, noop, identity, assign, is_promise, add_location, run, blank_object, run_all, is_function, safe_not_equal, not_equal, validate_store, subscribe, create_slot, get_slot_context, get_slot_changes, exclude_internal_props, bind, mount_component, init, SvelteElement, SvelteComponent, SvelteComponentDev };\n","<script>\n\texport let width;\n\texport let height;\n export let n = 50;\n\n\tlet numbers = [];\n\n const f = (x, t) => Math.sin(x * t + t) * 200;\n\n const setNumbers = t => {\n for(let i = 0; i < n; i++){\n const x = i / n;\n numbers[i] = f(x, t);\n }\n };\n\n const animate = timestamp => {\n setNumbers(timestamp / 1000);\n requestAnimationFrame(animate);\n };\n requestAnimationFrame(animate);\n</script>\n\n<svg width={width} height={height}>\n {#each numbers as y, i}\n <circle\n cx={i / n * width}\n cy={y + height / 2}\n r=\"10\"\n />\n {#if i < n - 1}\n <line\n x1={i / n * width}\n y1={y + height / 2}\n x2={(i + 1) / n * width}\n y2={numbers[i + 1] + height / 2}\n />\n {/if}\n {/each}\n</svg>\n","import App from './App.svelte';\n\nexport default new App({\n\ttarget: document.body,\n props: {\n width: 960,\n height: 500\n }\n});\n"],"names":[],"mappings":";;;CAAA,SAAS,IAAI,GAAG,EAAE;AAClB,AAWA;CACA,SAAS,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;CACzD,CAAC,OAAO,CAAC,aAAa,GAAG;CACzB,EAAE,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE;CACnC,EAAE,CAAC;CACH,CAAC;;CAED,SAAS,GAAG,CAAC,EAAE,EAAE;CACjB,CAAC,OAAO,EAAE,EAAE,CAAC;CACb,CAAC;;CAED,SAAS,YAAY,GAAG;CACxB,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;;CAED,SAAS,OAAO,CAAC,GAAG,EAAE;CACtB,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;CAClB,CAAC;;CAED,SAAS,WAAW,CAAC,KAAK,EAAE;CAC5B,CAAC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;CACpC,CAAC;;CAED,SAAS,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE;CAC9B,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,KAAK,OAAO,CAAC,KAAK,UAAU,CAAC,CAAC;CAC/F,CAAC;AACD,AAkFA;CACA,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE;CACtC,CAAC,MAAM,CAAC,YAAY,CA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;;;;;;;;;;;;;;;;;;;AClBjC,YAAe,IAAI,GAAG,CAAC;CACvB,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI;CACtB,EAAE,KAAK,EAAE;CACT,IAAI,KAAK,EAAE,GAAG;CACd,IAAI,MAAM,EAAE,GAAG;CACf,GAAG;CACH,CAAC,CAAC,CAAC;;;;;;;;"}
body {
margin: 0;
}
line {
stroke: gray;
stroke-width: 2px;
}
<!doctype html>
<html>
<head>
<meta charset='utf8'>
<meta name='viewport' content='width=device-width'>
<title>Svelte app</title>
<link rel='stylesheet' href='global.css'>
</head>
<body>
<script src='bundle.js'></script>
</body>
</html>
import App from './App.svelte';
export default new App({
target: document.body,
props: {
width: 960,
height: 500
}
});
{
"name": "svelte-app",
"version": "1.0.0",
"devDependencies": {
"npm-run-all": "^4.1.5",
"rollup": "^1.10.1",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-node-resolve": "^4.2.3",
"rollup-plugin-svelte": "^5.0.3",
"rollup-plugin-terser": "^4.0.4",
"sirv-cli": "^0.3.1",
"svelte": "^3.0.0"
},
"scripts": {
"build": "rollup -c",
"autobuild": "rollup -c -w",
"dev": "run-p start:dev autobuild",
"start": "sirv .",
"start:dev": "sirv . --dev"
}
}
import svelte from 'rollup-plugin-svelte';
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import { terser } from 'rollup-plugin-terser';
const production = !process.env.ROLLUP_WATCH;
export default {
input: 'main.js',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'bundle.js'
},
plugins: [
svelte({
// enable run-time checks when not in production
dev: !production,
// we'll extract any component CSS out into
// a separate file — better for performance
css: css => {
css.write('public/bundle.css');
}
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration —
// consult the documentation for details:
// https://github.com/rollup/rollup-plugin-commonjs
resolve(),
commonjs(),
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser()
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment