init
This commit is contained in:
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
../acorn/bin/acorn
|
||||
+1
@@ -0,0 +1 @@
|
||||
../@esbuild/darwin-arm64/bin/esbuild
|
||||
+1
@@ -0,0 +1 @@
|
||||
../nanoid/bin/nanoid.cjs
|
||||
+1
@@ -0,0 +1 @@
|
||||
../rollup/dist/bin/rollup
|
||||
+1
@@ -0,0 +1 @@
|
||||
../svelte-check/bin/svelte-check
|
||||
+1
@@ -0,0 +1 @@
|
||||
../@sveltejs/kit/svelte-kit.js
|
||||
+1
@@ -0,0 +1 @@
|
||||
../typescript/bin/tsc
|
||||
+1
@@ -0,0 +1 @@
|
||||
../typescript/bin/tsserver
|
||||
+1
@@ -0,0 +1 @@
|
||||
../vite/bin/vite.js
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"compilerOptions":{"css":"external","dev":true,"hmr":true},"configFile":false,"extensions":[".svelte"],"preprocess":{"script":"({ content, filename }) => {\n\t\tif (!filename) return;\n\n\t\tconst basename = path.basename(filename);\n\t\tif (basename.startsWith('+page.') || basename.startsWith('+layout.')) {\n\t\t\tconst match = content.match(options_regex);\n\t\t\tif (match && match.index !== undefined && !should_ignore(content, match.index)) {\n\t\t\t\tconst fixed = basename.replace('.svelte', '(.server).js/ts');\n\n\t\t\t\tconst message =\n\t\t\t\t\t`\\n${colors.bold().red(path.relative('.', filename))}\\n` +\n\t\t\t\t\t`\\`${match[1]}\\` will be ignored — move it to ${fixed} instead. See https://svelte.dev/docs/kit/page-options for more information.`;\n\n\t\t\t\tif (!warned.has(message)) {\n\t\t\t\t\tconsole.log(message);\n\t\t\t\t\twarned.add(message);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}","markup":"({ content, filename }) => {\n\t\tif (!filename) return;\n\n\t\tconst basename = path.basename(filename);\n\t\tconst has_children =\n\t\t\tcontent.includes('<slot') || (isSvelte5Plus() && content.includes('{@render'));\n\n\t\tif (basename.startsWith('+layout.') && !has_children) {\n\t\t\tconst message =\n\t\t\t\t`\\n${colors.bold().red(path.relative('.', filename))}\\n` +\n\t\t\t\t`\\`<slot />\\`${isSvelte5Plus() ? ' or `{@render ...}` tag' : ''}` +\n\t\t\t\t' missing — inner content will not be rendered';\n\n\t\t\tif (!warned.has(message)) {\n\t\t\t\tconsole.log(message);\n\t\t\t\twarned.add(message);\n\t\t\t}\n\t\t}\n\t}"}}
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
{
|
||||
"hash": "cbe4a0e7",
|
||||
"configHash": "3b483436",
|
||||
"lockfileHash": "860b5073",
|
||||
"browserHash": "c4c1bfc5",
|
||||
"optimized": {
|
||||
"svelte": {
|
||||
"src": "../../svelte/src/index-client.js",
|
||||
"file": "svelte.js",
|
||||
"fileHash": "6b39986c",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/animate": {
|
||||
"src": "../../svelte/src/animate/index.js",
|
||||
"file": "svelte_animate.js",
|
||||
"fileHash": "0416d1f7",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/attachments": {
|
||||
"src": "../../svelte/src/attachments/index.js",
|
||||
"file": "svelte_attachments.js",
|
||||
"fileHash": "c2251f9d",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/easing": {
|
||||
"src": "../../svelte/src/easing/index.js",
|
||||
"file": "svelte_easing.js",
|
||||
"fileHash": "30f3ede1",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/internal": {
|
||||
"src": "../../svelte/src/internal/index.js",
|
||||
"file": "svelte_internal.js",
|
||||
"fileHash": "1428c667",
|
||||
"needsInterop": true
|
||||
},
|
||||
"svelte/internal/client": {
|
||||
"src": "../../svelte/src/internal/client/index.js",
|
||||
"file": "svelte_internal_client.js",
|
||||
"fileHash": "5b15f757",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/internal/disclose-version": {
|
||||
"src": "../../svelte/src/internal/disclose-version.js",
|
||||
"file": "svelte_internal_disclose-version.js",
|
||||
"fileHash": "a0d83d36",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/internal/flags/async": {
|
||||
"src": "../../svelte/src/internal/flags/async.js",
|
||||
"file": "svelte_internal_flags_async.js",
|
||||
"fileHash": "2c3a7cbd",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/internal/flags/legacy": {
|
||||
"src": "../../svelte/src/internal/flags/legacy.js",
|
||||
"file": "svelte_internal_flags_legacy.js",
|
||||
"fileHash": "bce59abf",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/internal/flags/tracing": {
|
||||
"src": "../../svelte/src/internal/flags/tracing.js",
|
||||
"file": "svelte_internal_flags_tracing.js",
|
||||
"fileHash": "6ebefe43",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/legacy": {
|
||||
"src": "../../svelte/src/legacy/legacy-client.js",
|
||||
"file": "svelte_legacy.js",
|
||||
"fileHash": "9e0df5c4",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/motion": {
|
||||
"src": "../../svelte/src/motion/index.js",
|
||||
"file": "svelte_motion.js",
|
||||
"fileHash": "390b6479",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/reactivity": {
|
||||
"src": "../../svelte/src/reactivity/index-client.js",
|
||||
"file": "svelte_reactivity.js",
|
||||
"fileHash": "a867d2bb",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/reactivity/window": {
|
||||
"src": "../../svelte/src/reactivity/window/index.js",
|
||||
"file": "svelte_reactivity_window.js",
|
||||
"fileHash": "2876dc7f",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/store": {
|
||||
"src": "../../svelte/src/store/index-client.js",
|
||||
"file": "svelte_store.js",
|
||||
"fileHash": "15fd40a6",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/transition": {
|
||||
"src": "../../svelte/src/transition/index.js",
|
||||
"file": "svelte_transition.js",
|
||||
"fileHash": "51d7dc98",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte/events": {
|
||||
"src": "../../svelte/src/events/index.js",
|
||||
"file": "svelte_events.js",
|
||||
"fileHash": "ae03a2ea",
|
||||
"needsInterop": false
|
||||
},
|
||||
"svelte > clsx": {
|
||||
"src": "../../clsx/dist/clsx.mjs",
|
||||
"file": "svelte___clsx.js",
|
||||
"fileHash": "65a1710c",
|
||||
"needsInterop": false
|
||||
}
|
||||
},
|
||||
"chunks": {
|
||||
"chunk-GOC6LLKR": {
|
||||
"file": "chunk-GOC6LLKR.js"
|
||||
},
|
||||
"chunk-6VYHLW26": {
|
||||
"file": "chunk-6VYHLW26.js"
|
||||
},
|
||||
"chunk-7RQDXF5S": {
|
||||
"file": "chunk-7RQDXF5S.js"
|
||||
},
|
||||
"chunk-YERFD2CZ": {
|
||||
"file": "chunk-YERFD2CZ.js"
|
||||
},
|
||||
"chunk-UW3ABHAC": {
|
||||
"file": "chunk-UW3ABHAC.js"
|
||||
},
|
||||
"chunk-U7P2NEEE": {
|
||||
"file": "chunk-U7P2NEEE.js"
|
||||
},
|
||||
"chunk-DL7TWQ45": {
|
||||
"file": "chunk-DL7TWQ45.js"
|
||||
},
|
||||
"chunk-5MWODAS5": {
|
||||
"file": "chunk-5MWODAS5.js"
|
||||
},
|
||||
"chunk-VZQZA5WB": {
|
||||
"file": "chunk-VZQZA5WB.js"
|
||||
},
|
||||
"chunk-OHYQYV5R": {
|
||||
"file": "chunk-OHYQYV5R.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
+4669
File diff suppressed because it is too large
Load Diff
+7
File diff suppressed because one or more lines are too long
+27
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
createSubscriber
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
|
||||
// node_modules/svelte/src/reactivity/reactive-value.js
|
||||
var ReactiveValue = class {
|
||||
#fn;
|
||||
#subscribe;
|
||||
/**
|
||||
*
|
||||
* @param {() => T} fn
|
||||
* @param {(update: () => void) => void} onsubscribe
|
||||
*/
|
||||
constructor(fn, onsubscribe) {
|
||||
this.#fn = fn;
|
||||
this.#subscribe = createSubscriber(onsubscribe);
|
||||
}
|
||||
get current() {
|
||||
this.#subscribe();
|
||||
return this.#fn();
|
||||
}
|
||||
};
|
||||
|
||||
export {
|
||||
ReactiveValue
|
||||
};
|
||||
//# sourceMappingURL=chunk-6VYHLW26.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/reactivity/reactive-value.js"],
|
||||
"sourcesContent": ["import { createSubscriber } from './create-subscriber.js';\n\n/**\n * @template T\n */\nexport class ReactiveValue {\n\t#fn;\n\t#subscribe;\n\n\t/**\n\t *\n\t * @param {() => T} fn\n\t * @param {(update: () => void) => void} onsubscribe\n\t */\n\tconstructor(fn, onsubscribe) {\n\t\tthis.#fn = fn;\n\t\tthis.#subscribe = createSubscriber(onsubscribe);\n\t}\n\n\tget current() {\n\t\tthis.#subscribe();\n\t\treturn this.#fn();\n\t}\n}\n"],
|
||||
"mappings": ";;;;;AAKO,IAAM,gBAAN,MAAoB;AAAA,EAC1B;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,YAAY,IAAI,aAAa;AAC5B,SAAK,MAAM;AACX,SAAK,aAAa,iBAAiB,WAAW;AAAA,EAC/C;AAAA,EAEA,IAAI,UAAU;AACb,SAAK,WAAW;AAChB,WAAO,KAAK,IAAI;AAAA,EACjB;AACD;",
|
||||
"names": []
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
+966
@@ -0,0 +1,966 @@
|
||||
import {
|
||||
COMMENT_NODE,
|
||||
DIRTY,
|
||||
DOCUMENT_FRAGMENT_NODE,
|
||||
EFFECT_RAN,
|
||||
FILENAME,
|
||||
HYDRATION_END,
|
||||
HYDRATION_ERROR,
|
||||
HYDRATION_START,
|
||||
LEGACY_PROPS,
|
||||
MAYBE_DIRTY,
|
||||
NAMESPACE_MATHML,
|
||||
NAMESPACE_SVG,
|
||||
STATE_SYMBOL,
|
||||
TEMPLATE_FRAGMENT,
|
||||
TEMPLATE_USE_IMPORT_NODE,
|
||||
TEMPLATE_USE_MATHML,
|
||||
TEMPLATE_USE_SVG,
|
||||
TEXT_NODE,
|
||||
active_effect,
|
||||
all_registered_events,
|
||||
array_from,
|
||||
boundary,
|
||||
clear_text_content,
|
||||
component_context,
|
||||
component_root,
|
||||
create_comment,
|
||||
create_element,
|
||||
create_fragment,
|
||||
create_text,
|
||||
define_property,
|
||||
dev_current_component_function,
|
||||
flushSync,
|
||||
get,
|
||||
get_first_child,
|
||||
get_next_sibling,
|
||||
handle_event_propagation,
|
||||
hydrate_next,
|
||||
hydrate_node,
|
||||
hydrating,
|
||||
hydration_failed,
|
||||
init_operations,
|
||||
is_array,
|
||||
is_firefox,
|
||||
lifecycle_outside_component,
|
||||
mutable_source,
|
||||
noop,
|
||||
on,
|
||||
pop,
|
||||
push,
|
||||
root_event_handles,
|
||||
set,
|
||||
set_attribute,
|
||||
set_hydrate_node,
|
||||
set_hydrating,
|
||||
set_signal_status,
|
||||
user_pre_effect
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
import {
|
||||
hydration_mismatch,
|
||||
legacy_recursive_reactive_block,
|
||||
lifecycle_double_unmount,
|
||||
state_proxy_unmount,
|
||||
true_default
|
||||
} from "./chunk-VZQZA5WB.js";
|
||||
import {
|
||||
async_mode_flag
|
||||
} from "./chunk-OHYQYV5R.js";
|
||||
|
||||
// node_modules/svelte/src/internal/client/dom/reconciler.js
|
||||
function create_fragment_from_html(html) {
|
||||
var elem = document.createElement("template");
|
||||
elem.innerHTML = html.replaceAll("<!>", "<!---->");
|
||||
return elem.content;
|
||||
}
|
||||
|
||||
// node_modules/svelte/src/internal/client/dom/template.js
|
||||
function assign_nodes(start, end) {
|
||||
var effect = (
|
||||
/** @type {Effect} */
|
||||
active_effect
|
||||
);
|
||||
if (effect.nodes === null) {
|
||||
effect.nodes = { start, end, a: null, t: null };
|
||||
}
|
||||
}
|
||||
function from_html(content, flags) {
|
||||
var is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;
|
||||
var use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;
|
||||
var node;
|
||||
var has_start = !content.startsWith("<!>");
|
||||
return () => {
|
||||
if (hydrating) {
|
||||
assign_nodes(hydrate_node, null);
|
||||
return hydrate_node;
|
||||
}
|
||||
if (node === void 0) {
|
||||
node = create_fragment_from_html(has_start ? content : "<!>" + content);
|
||||
if (!is_fragment) node = /** @type {TemplateNode} */
|
||||
get_first_child(node);
|
||||
}
|
||||
var clone = (
|
||||
/** @type {TemplateNode} */
|
||||
use_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)
|
||||
);
|
||||
if (is_fragment) {
|
||||
var start = (
|
||||
/** @type {TemplateNode} */
|
||||
get_first_child(clone)
|
||||
);
|
||||
var end = (
|
||||
/** @type {TemplateNode} */
|
||||
clone.lastChild
|
||||
);
|
||||
assign_nodes(start, end);
|
||||
} else {
|
||||
assign_nodes(clone, clone);
|
||||
}
|
||||
return clone;
|
||||
};
|
||||
}
|
||||
function from_namespace(content, flags, ns = "svg") {
|
||||
var has_start = !content.startsWith("<!>");
|
||||
var is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;
|
||||
var wrapped = `<${ns}>${has_start ? content : "<!>" + content}</${ns}>`;
|
||||
var node;
|
||||
return () => {
|
||||
if (hydrating) {
|
||||
assign_nodes(hydrate_node, null);
|
||||
return hydrate_node;
|
||||
}
|
||||
if (!node) {
|
||||
var fragment = (
|
||||
/** @type {DocumentFragment} */
|
||||
create_fragment_from_html(wrapped)
|
||||
);
|
||||
var root = (
|
||||
/** @type {Element} */
|
||||
get_first_child(fragment)
|
||||
);
|
||||
if (is_fragment) {
|
||||
node = document.createDocumentFragment();
|
||||
while (get_first_child(root)) {
|
||||
node.appendChild(
|
||||
/** @type {TemplateNode} */
|
||||
get_first_child(root)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
node = /** @type {Element} */
|
||||
get_first_child(root);
|
||||
}
|
||||
}
|
||||
var clone = (
|
||||
/** @type {TemplateNode} */
|
||||
node.cloneNode(true)
|
||||
);
|
||||
if (is_fragment) {
|
||||
var start = (
|
||||
/** @type {TemplateNode} */
|
||||
get_first_child(clone)
|
||||
);
|
||||
var end = (
|
||||
/** @type {TemplateNode} */
|
||||
clone.lastChild
|
||||
);
|
||||
assign_nodes(start, end);
|
||||
} else {
|
||||
assign_nodes(clone, clone);
|
||||
}
|
||||
return clone;
|
||||
};
|
||||
}
|
||||
function from_svg(content, flags) {
|
||||
return from_namespace(content, flags, "svg");
|
||||
}
|
||||
function from_mathml(content, flags) {
|
||||
return from_namespace(content, flags, "math");
|
||||
}
|
||||
function fragment_from_tree(structure, ns) {
|
||||
var fragment = create_fragment();
|
||||
for (var item of structure) {
|
||||
if (typeof item === "string") {
|
||||
fragment.append(create_text(item));
|
||||
continue;
|
||||
}
|
||||
if (item === void 0 || item[0][0] === "/") {
|
||||
fragment.append(create_comment(item ? item[0].slice(3) : ""));
|
||||
continue;
|
||||
}
|
||||
const [name, attributes, ...children] = item;
|
||||
const namespace = name === "svg" ? NAMESPACE_SVG : name === "math" ? NAMESPACE_MATHML : ns;
|
||||
var element = create_element(name, namespace, attributes?.is);
|
||||
for (var key in attributes) {
|
||||
set_attribute(element, key, attributes[key]);
|
||||
}
|
||||
if (children.length > 0) {
|
||||
var target = element.tagName === "TEMPLATE" ? (
|
||||
/** @type {HTMLTemplateElement} */
|
||||
element.content
|
||||
) : element;
|
||||
target.append(
|
||||
fragment_from_tree(children, element.tagName === "foreignObject" ? void 0 : namespace)
|
||||
);
|
||||
}
|
||||
fragment.append(element);
|
||||
}
|
||||
return fragment;
|
||||
}
|
||||
function from_tree(structure, flags) {
|
||||
var is_fragment = (flags & TEMPLATE_FRAGMENT) !== 0;
|
||||
var use_import_node = (flags & TEMPLATE_USE_IMPORT_NODE) !== 0;
|
||||
var node;
|
||||
return () => {
|
||||
if (hydrating) {
|
||||
assign_nodes(hydrate_node, null);
|
||||
return hydrate_node;
|
||||
}
|
||||
if (node === void 0) {
|
||||
const ns = (flags & TEMPLATE_USE_SVG) !== 0 ? NAMESPACE_SVG : (flags & TEMPLATE_USE_MATHML) !== 0 ? NAMESPACE_MATHML : void 0;
|
||||
node = fragment_from_tree(structure, ns);
|
||||
if (!is_fragment) node = /** @type {TemplateNode} */
|
||||
get_first_child(node);
|
||||
}
|
||||
var clone = (
|
||||
/** @type {TemplateNode} */
|
||||
use_import_node || is_firefox ? document.importNode(node, true) : node.cloneNode(true)
|
||||
);
|
||||
if (is_fragment) {
|
||||
var start = (
|
||||
/** @type {TemplateNode} */
|
||||
get_first_child(clone)
|
||||
);
|
||||
var end = (
|
||||
/** @type {TemplateNode} */
|
||||
clone.lastChild
|
||||
);
|
||||
assign_nodes(start, end);
|
||||
} else {
|
||||
assign_nodes(clone, clone);
|
||||
}
|
||||
return clone;
|
||||
};
|
||||
}
|
||||
function with_script(fn) {
|
||||
return () => run_scripts(fn());
|
||||
}
|
||||
function run_scripts(node) {
|
||||
if (hydrating) return node;
|
||||
const is_fragment = node.nodeType === DOCUMENT_FRAGMENT_NODE;
|
||||
const scripts = (
|
||||
/** @type {HTMLElement} */
|
||||
node.tagName === "SCRIPT" ? [
|
||||
/** @type {HTMLScriptElement} */
|
||||
node
|
||||
] : node.querySelectorAll("script")
|
||||
);
|
||||
const effect = (
|
||||
/** @type {Effect & { nodes: EffectNodes }} */
|
||||
active_effect
|
||||
);
|
||||
for (const script of scripts) {
|
||||
const clone = document.createElement("script");
|
||||
for (var attribute of script.attributes) {
|
||||
clone.setAttribute(attribute.name, attribute.value);
|
||||
}
|
||||
clone.textContent = script.textContent;
|
||||
if (is_fragment ? node.firstChild === script : node === script) {
|
||||
effect.nodes.start = clone;
|
||||
}
|
||||
if (is_fragment ? node.lastChild === script : node === script) {
|
||||
effect.nodes.end = clone;
|
||||
}
|
||||
script.replaceWith(clone);
|
||||
}
|
||||
return node;
|
||||
}
|
||||
function text(value = "") {
|
||||
if (!hydrating) {
|
||||
var t = create_text(value + "");
|
||||
assign_nodes(t, t);
|
||||
return t;
|
||||
}
|
||||
var node = hydrate_node;
|
||||
if (node.nodeType !== TEXT_NODE) {
|
||||
node.before(node = create_text());
|
||||
set_hydrate_node(node);
|
||||
}
|
||||
assign_nodes(node, node);
|
||||
return node;
|
||||
}
|
||||
function comment() {
|
||||
if (hydrating) {
|
||||
assign_nodes(hydrate_node, null);
|
||||
return hydrate_node;
|
||||
}
|
||||
var frag = document.createDocumentFragment();
|
||||
var start = document.createComment("");
|
||||
var anchor = create_text();
|
||||
frag.append(start, anchor);
|
||||
assign_nodes(start, anchor);
|
||||
return frag;
|
||||
}
|
||||
function append(anchor, dom) {
|
||||
if (hydrating) {
|
||||
var effect = (
|
||||
/** @type {Effect & { nodes: EffectNodes }} */
|
||||
active_effect
|
||||
);
|
||||
if ((effect.f & EFFECT_RAN) === 0 || effect.nodes.end === null) {
|
||||
effect.nodes.end = hydrate_node;
|
||||
}
|
||||
hydrate_next();
|
||||
return;
|
||||
}
|
||||
if (anchor === null) {
|
||||
return;
|
||||
}
|
||||
anchor.before(
|
||||
/** @type {Node} */
|
||||
dom
|
||||
);
|
||||
}
|
||||
function props_id() {
|
||||
if (hydrating && hydrate_node && hydrate_node.nodeType === COMMENT_NODE && hydrate_node.textContent?.startsWith(`$`)) {
|
||||
const id = hydrate_node.textContent.substring(1);
|
||||
hydrate_next();
|
||||
return id;
|
||||
}
|
||||
(window.__svelte ??= {}).uid ??= 1;
|
||||
return `c${window.__svelte.uid++}`;
|
||||
}
|
||||
|
||||
// node_modules/svelte/src/utils.js
|
||||
var regex_return_characters = /\r/g;
|
||||
function hash(str) {
|
||||
str = str.replace(regex_return_characters, "");
|
||||
let hash2 = 5381;
|
||||
let i = str.length;
|
||||
while (i--) hash2 = (hash2 << 5) - hash2 ^ str.charCodeAt(i);
|
||||
return (hash2 >>> 0).toString(36);
|
||||
}
|
||||
var VOID_ELEMENT_NAMES = [
|
||||
"area",
|
||||
"base",
|
||||
"br",
|
||||
"col",
|
||||
"command",
|
||||
"embed",
|
||||
"hr",
|
||||
"img",
|
||||
"input",
|
||||
"keygen",
|
||||
"link",
|
||||
"meta",
|
||||
"param",
|
||||
"source",
|
||||
"track",
|
||||
"wbr"
|
||||
];
|
||||
function is_void(name) {
|
||||
return VOID_ELEMENT_NAMES.includes(name) || name.toLowerCase() === "!doctype";
|
||||
}
|
||||
function is_capture_event(name) {
|
||||
return name.endsWith("capture") && name !== "gotpointercapture" && name !== "lostpointercapture";
|
||||
}
|
||||
var DELEGATED_EVENTS = [
|
||||
"beforeinput",
|
||||
"click",
|
||||
"change",
|
||||
"dblclick",
|
||||
"contextmenu",
|
||||
"focusin",
|
||||
"focusout",
|
||||
"input",
|
||||
"keydown",
|
||||
"keyup",
|
||||
"mousedown",
|
||||
"mousemove",
|
||||
"mouseout",
|
||||
"mouseover",
|
||||
"mouseup",
|
||||
"pointerdown",
|
||||
"pointermove",
|
||||
"pointerout",
|
||||
"pointerover",
|
||||
"pointerup",
|
||||
"touchend",
|
||||
"touchmove",
|
||||
"touchstart"
|
||||
];
|
||||
function can_delegate_event(event_name) {
|
||||
return DELEGATED_EVENTS.includes(event_name);
|
||||
}
|
||||
var DOM_BOOLEAN_ATTRIBUTES = [
|
||||
"allowfullscreen",
|
||||
"async",
|
||||
"autofocus",
|
||||
"autoplay",
|
||||
"checked",
|
||||
"controls",
|
||||
"default",
|
||||
"disabled",
|
||||
"formnovalidate",
|
||||
"indeterminate",
|
||||
"inert",
|
||||
"ismap",
|
||||
"loop",
|
||||
"multiple",
|
||||
"muted",
|
||||
"nomodule",
|
||||
"novalidate",
|
||||
"open",
|
||||
"playsinline",
|
||||
"readonly",
|
||||
"required",
|
||||
"reversed",
|
||||
"seamless",
|
||||
"selected",
|
||||
"webkitdirectory",
|
||||
"defer",
|
||||
"disablepictureinpicture",
|
||||
"disableremoteplayback"
|
||||
];
|
||||
var ATTRIBUTE_ALIASES = {
|
||||
// no `class: 'className'` because we handle that separately
|
||||
formnovalidate: "formNoValidate",
|
||||
ismap: "isMap",
|
||||
nomodule: "noModule",
|
||||
playsinline: "playsInline",
|
||||
readonly: "readOnly",
|
||||
defaultvalue: "defaultValue",
|
||||
defaultchecked: "defaultChecked",
|
||||
srcobject: "srcObject",
|
||||
novalidate: "noValidate",
|
||||
allowfullscreen: "allowFullscreen",
|
||||
disablepictureinpicture: "disablePictureInPicture",
|
||||
disableremoteplayback: "disableRemotePlayback"
|
||||
};
|
||||
function normalize_attribute(name) {
|
||||
name = name.toLowerCase();
|
||||
return ATTRIBUTE_ALIASES[name] ?? name;
|
||||
}
|
||||
var DOM_PROPERTIES = [
|
||||
...DOM_BOOLEAN_ATTRIBUTES,
|
||||
"formNoValidate",
|
||||
"isMap",
|
||||
"noModule",
|
||||
"playsInline",
|
||||
"readOnly",
|
||||
"value",
|
||||
"volume",
|
||||
"defaultValue",
|
||||
"defaultChecked",
|
||||
"srcObject",
|
||||
"noValidate",
|
||||
"allowFullscreen",
|
||||
"disablePictureInPicture",
|
||||
"disableRemotePlayback"
|
||||
];
|
||||
var PASSIVE_EVENTS = ["touchstart", "touchmove"];
|
||||
function is_passive_event(name) {
|
||||
return PASSIVE_EVENTS.includes(name);
|
||||
}
|
||||
var STATE_CREATION_RUNES = (
|
||||
/** @type {const} */
|
||||
[
|
||||
"$state",
|
||||
"$state.raw",
|
||||
"$derived",
|
||||
"$derived.by"
|
||||
]
|
||||
);
|
||||
var RUNES = (
|
||||
/** @type {const} */
|
||||
[
|
||||
...STATE_CREATION_RUNES,
|
||||
"$state.eager",
|
||||
"$state.snapshot",
|
||||
"$props",
|
||||
"$props.id",
|
||||
"$bindable",
|
||||
"$effect",
|
||||
"$effect.pre",
|
||||
"$effect.tracking",
|
||||
"$effect.root",
|
||||
"$effect.pending",
|
||||
"$inspect",
|
||||
"$inspect().with",
|
||||
"$inspect.trace",
|
||||
"$host"
|
||||
]
|
||||
);
|
||||
var RAW_TEXT_ELEMENTS = (
|
||||
/** @type {const} */
|
||||
["textarea", "script", "style", "title"]
|
||||
);
|
||||
function is_raw_text_element(name) {
|
||||
return RAW_TEXT_ELEMENTS.includes(
|
||||
/** @type {typeof RAW_TEXT_ELEMENTS[number]} */
|
||||
name
|
||||
);
|
||||
}
|
||||
function sanitize_location(location) {
|
||||
return (
|
||||
/** @type {T} */
|
||||
location?.replace(/\//g, "/")
|
||||
);
|
||||
}
|
||||
|
||||
// node_modules/svelte/src/internal/client/render.js
|
||||
var should_intro = true;
|
||||
function set_should_intro(value) {
|
||||
should_intro = value;
|
||||
}
|
||||
function set_text(text2, value) {
|
||||
var str = value == null ? "" : typeof value === "object" ? value + "" : value;
|
||||
if (str !== (text2.__t ??= text2.nodeValue)) {
|
||||
text2.__t = str;
|
||||
text2.nodeValue = str + "";
|
||||
}
|
||||
}
|
||||
function mount(component, options) {
|
||||
return _mount(component, options);
|
||||
}
|
||||
function hydrate(component, options) {
|
||||
init_operations();
|
||||
options.intro = options.intro ?? false;
|
||||
const target = options.target;
|
||||
const was_hydrating = hydrating;
|
||||
const previous_hydrate_node = hydrate_node;
|
||||
try {
|
||||
var anchor = get_first_child(target);
|
||||
while (anchor && (anchor.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
||||
anchor.data !== HYDRATION_START)) {
|
||||
anchor = get_next_sibling(anchor);
|
||||
}
|
||||
if (!anchor) {
|
||||
throw HYDRATION_ERROR;
|
||||
}
|
||||
set_hydrating(true);
|
||||
set_hydrate_node(
|
||||
/** @type {Comment} */
|
||||
anchor
|
||||
);
|
||||
const instance = _mount(component, { ...options, anchor });
|
||||
set_hydrating(false);
|
||||
return (
|
||||
/** @type {Exports} */
|
||||
instance
|
||||
);
|
||||
} catch (error) {
|
||||
if (error instanceof Error && error.message.split("\n").some((line) => line.startsWith("https://svelte.dev/e/"))) {
|
||||
throw error;
|
||||
}
|
||||
if (error !== HYDRATION_ERROR) {
|
||||
console.warn("Failed to hydrate: ", error);
|
||||
}
|
||||
if (options.recover === false) {
|
||||
hydration_failed();
|
||||
}
|
||||
init_operations();
|
||||
clear_text_content(target);
|
||||
set_hydrating(false);
|
||||
return mount(component, options);
|
||||
} finally {
|
||||
set_hydrating(was_hydrating);
|
||||
set_hydrate_node(previous_hydrate_node);
|
||||
}
|
||||
}
|
||||
var document_listeners = /* @__PURE__ */ new Map();
|
||||
function _mount(Component, { target, anchor, props = {}, events, context, intro = true }) {
|
||||
init_operations();
|
||||
var registered_events = /* @__PURE__ */ new Set();
|
||||
var event_handle = (events2) => {
|
||||
for (var i = 0; i < events2.length; i++) {
|
||||
var event_name = events2[i];
|
||||
if (registered_events.has(event_name)) continue;
|
||||
registered_events.add(event_name);
|
||||
var passive2 = is_passive_event(event_name);
|
||||
target.addEventListener(event_name, handle_event_propagation, { passive: passive2 });
|
||||
var n = document_listeners.get(event_name);
|
||||
if (n === void 0) {
|
||||
document.addEventListener(event_name, handle_event_propagation, { passive: passive2 });
|
||||
document_listeners.set(event_name, 1);
|
||||
} else {
|
||||
document_listeners.set(event_name, n + 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
event_handle(array_from(all_registered_events));
|
||||
root_event_handles.add(event_handle);
|
||||
var component = void 0;
|
||||
var unmount2 = component_root(() => {
|
||||
var anchor_node = anchor ?? target.appendChild(create_text());
|
||||
boundary(
|
||||
/** @type {TemplateNode} */
|
||||
anchor_node,
|
||||
{
|
||||
pending: () => {
|
||||
}
|
||||
},
|
||||
(anchor_node2) => {
|
||||
if (context) {
|
||||
push({});
|
||||
var ctx = (
|
||||
/** @type {ComponentContext} */
|
||||
component_context
|
||||
);
|
||||
ctx.c = context;
|
||||
}
|
||||
if (events) {
|
||||
props.$$events = events;
|
||||
}
|
||||
if (hydrating) {
|
||||
assign_nodes(
|
||||
/** @type {TemplateNode} */
|
||||
anchor_node2,
|
||||
null
|
||||
);
|
||||
}
|
||||
should_intro = intro;
|
||||
component = Component(anchor_node2, props) || {};
|
||||
should_intro = true;
|
||||
if (hydrating) {
|
||||
active_effect.nodes.end = hydrate_node;
|
||||
if (hydrate_node === null || hydrate_node.nodeType !== COMMENT_NODE || /** @type {Comment} */
|
||||
hydrate_node.data !== HYDRATION_END) {
|
||||
hydration_mismatch();
|
||||
throw HYDRATION_ERROR;
|
||||
}
|
||||
}
|
||||
if (context) {
|
||||
pop();
|
||||
}
|
||||
}
|
||||
);
|
||||
return () => {
|
||||
for (var event_name of registered_events) {
|
||||
target.removeEventListener(event_name, handle_event_propagation);
|
||||
var n = (
|
||||
/** @type {number} */
|
||||
document_listeners.get(event_name)
|
||||
);
|
||||
if (--n === 0) {
|
||||
document.removeEventListener(event_name, handle_event_propagation);
|
||||
document_listeners.delete(event_name);
|
||||
} else {
|
||||
document_listeners.set(event_name, n);
|
||||
}
|
||||
}
|
||||
root_event_handles.delete(event_handle);
|
||||
if (anchor_node !== anchor) {
|
||||
anchor_node.parentNode?.removeChild(anchor_node);
|
||||
}
|
||||
};
|
||||
});
|
||||
mounted_components.set(component, unmount2);
|
||||
return component;
|
||||
}
|
||||
var mounted_components = /* @__PURE__ */ new WeakMap();
|
||||
function unmount(component, options) {
|
||||
const fn = mounted_components.get(component);
|
||||
if (fn) {
|
||||
mounted_components.delete(component);
|
||||
return fn(options);
|
||||
}
|
||||
if (true_default) {
|
||||
if (STATE_SYMBOL in component) {
|
||||
state_proxy_unmount();
|
||||
} else {
|
||||
lifecycle_double_unmount();
|
||||
}
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
// node_modules/svelte/src/internal/client/dom/legacy/event-modifiers.js
|
||||
function trusted(fn) {
|
||||
return function(...args) {
|
||||
var event = (
|
||||
/** @type {Event} */
|
||||
args[0]
|
||||
);
|
||||
if (event.isTrusted) {
|
||||
fn?.apply(this, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
function self(fn) {
|
||||
return function(...args) {
|
||||
var event = (
|
||||
/** @type {Event} */
|
||||
args[0]
|
||||
);
|
||||
if (event.target === this) {
|
||||
fn?.apply(this, args);
|
||||
}
|
||||
};
|
||||
}
|
||||
function stopPropagation(fn) {
|
||||
return function(...args) {
|
||||
var event = (
|
||||
/** @type {Event} */
|
||||
args[0]
|
||||
);
|
||||
event.stopPropagation();
|
||||
return fn?.apply(this, args);
|
||||
};
|
||||
}
|
||||
function once(fn) {
|
||||
var ran = false;
|
||||
return function(...args) {
|
||||
if (ran) return;
|
||||
ran = true;
|
||||
return fn?.apply(this, args);
|
||||
};
|
||||
}
|
||||
function stopImmediatePropagation(fn) {
|
||||
return function(...args) {
|
||||
var event = (
|
||||
/** @type {Event} */
|
||||
args[0]
|
||||
);
|
||||
event.stopImmediatePropagation();
|
||||
return fn?.apply(this, args);
|
||||
};
|
||||
}
|
||||
function preventDefault(fn) {
|
||||
return function(...args) {
|
||||
var event = (
|
||||
/** @type {Event} */
|
||||
args[0]
|
||||
);
|
||||
event.preventDefault();
|
||||
return fn?.apply(this, args);
|
||||
};
|
||||
}
|
||||
function passive(node, [event, handler]) {
|
||||
user_pre_effect(() => {
|
||||
return on(node, event, handler() ?? noop, {
|
||||
passive: true
|
||||
});
|
||||
});
|
||||
}
|
||||
function nonpassive(node, [event, handler]) {
|
||||
user_pre_effect(() => {
|
||||
return on(node, event, handler() ?? noop, {
|
||||
passive: false
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// node_modules/svelte/src/legacy/legacy-client.js
|
||||
function createClassComponent(options) {
|
||||
return new Svelte4Component(options);
|
||||
}
|
||||
function asClassComponent(component) {
|
||||
return class extends Svelte4Component {
|
||||
/** @param {any} options */
|
||||
constructor(options) {
|
||||
super({
|
||||
component,
|
||||
...options
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
var Svelte4Component = class {
|
||||
/** @type {any} */
|
||||
#events;
|
||||
/** @type {Record<string, any>} */
|
||||
#instance;
|
||||
/**
|
||||
* @param {ComponentConstructorOptions & {
|
||||
* component: any;
|
||||
* }} options
|
||||
*/
|
||||
constructor(options) {
|
||||
var sources = /* @__PURE__ */ new Map();
|
||||
var add_source = (key, value) => {
|
||||
var s = mutable_source(value, false, false);
|
||||
sources.set(key, s);
|
||||
return s;
|
||||
};
|
||||
const props = new Proxy(
|
||||
{ ...options.props || {}, $$events: {} },
|
||||
{
|
||||
get(target, prop) {
|
||||
return get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
||||
},
|
||||
has(target, prop) {
|
||||
if (prop === LEGACY_PROPS) return true;
|
||||
get(sources.get(prop) ?? add_source(prop, Reflect.get(target, prop)));
|
||||
return Reflect.has(target, prop);
|
||||
},
|
||||
set(target, prop, value) {
|
||||
set(sources.get(prop) ?? add_source(prop, value), value);
|
||||
return Reflect.set(target, prop, value);
|
||||
}
|
||||
}
|
||||
);
|
||||
this.#instance = (options.hydrate ? hydrate : mount)(options.component, {
|
||||
target: options.target,
|
||||
anchor: options.anchor,
|
||||
props,
|
||||
context: options.context,
|
||||
intro: options.intro ?? false,
|
||||
recover: options.recover
|
||||
});
|
||||
if (!async_mode_flag && (!options?.props?.$$host || options.sync === false)) {
|
||||
flushSync();
|
||||
}
|
||||
this.#events = props.$$events;
|
||||
for (const key of Object.keys(this.#instance)) {
|
||||
if (key === "$set" || key === "$destroy" || key === "$on") continue;
|
||||
define_property(this, key, {
|
||||
get() {
|
||||
return this.#instance[key];
|
||||
},
|
||||
/** @param {any} value */
|
||||
set(value) {
|
||||
this.#instance[key] = value;
|
||||
},
|
||||
enumerable: true
|
||||
});
|
||||
}
|
||||
this.#instance.$set = /** @param {Record<string, any>} next */
|
||||
(next) => {
|
||||
Object.assign(props, next);
|
||||
};
|
||||
this.#instance.$destroy = () => {
|
||||
unmount(this.#instance);
|
||||
};
|
||||
}
|
||||
/** @param {Record<string, any>} props */
|
||||
$set(props) {
|
||||
this.#instance.$set(props);
|
||||
}
|
||||
/**
|
||||
* @param {string} event
|
||||
* @param {(...args: any[]) => any} callback
|
||||
* @returns {any}
|
||||
*/
|
||||
$on(event, callback) {
|
||||
this.#events[event] = this.#events[event] || [];
|
||||
const cb = (...args) => callback.call(this, ...args);
|
||||
this.#events[event].push(cb);
|
||||
return () => {
|
||||
this.#events[event] = this.#events[event].filter(
|
||||
/** @param {any} fn */
|
||||
(fn) => fn !== cb
|
||||
);
|
||||
};
|
||||
}
|
||||
$destroy() {
|
||||
this.#instance.$destroy();
|
||||
}
|
||||
};
|
||||
function run(fn) {
|
||||
user_pre_effect(() => {
|
||||
fn();
|
||||
var effect = (
|
||||
/** @type {import('#client').Effect} */
|
||||
active_effect
|
||||
);
|
||||
if ((effect.f & DIRTY) !== 0) {
|
||||
let filename = "a file (we can't know which one)";
|
||||
if (true_default) {
|
||||
filename = dev_current_component_function?.[FILENAME] ?? filename;
|
||||
}
|
||||
legacy_recursive_reactive_block(filename);
|
||||
set_signal_status(effect, MAYBE_DIRTY);
|
||||
}
|
||||
});
|
||||
}
|
||||
function handlers(...handlers2) {
|
||||
return function(event) {
|
||||
const { stopImmediatePropagation: stopImmediatePropagation2 } = event;
|
||||
let stopped = false;
|
||||
event.stopImmediatePropagation = () => {
|
||||
stopped = true;
|
||||
stopImmediatePropagation2.call(event);
|
||||
};
|
||||
const errors = [];
|
||||
for (const handler of handlers2) {
|
||||
try {
|
||||
handler?.call(this, event);
|
||||
} catch (e) {
|
||||
errors.push(e);
|
||||
}
|
||||
if (stopped) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let error of errors) {
|
||||
queueMicrotask(() => {
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
function createBubbler() {
|
||||
const active_component_context = component_context;
|
||||
if (active_component_context === null) {
|
||||
lifecycle_outside_component("createBubbler");
|
||||
}
|
||||
return (type) => (event) => {
|
||||
const events = (
|
||||
/** @type {Record<string, Function | Function[]>} */
|
||||
active_component_context.s.$$events?.[
|
||||
/** @type {any} */
|
||||
type
|
||||
]
|
||||
);
|
||||
if (events) {
|
||||
const callbacks = is_array(events) ? events.slice() : [events];
|
||||
for (const fn of callbacks) {
|
||||
fn.call(active_component_context.x, event);
|
||||
}
|
||||
return !event.defaultPrevented;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
}
|
||||
|
||||
export {
|
||||
hash,
|
||||
is_void,
|
||||
is_capture_event,
|
||||
can_delegate_event,
|
||||
normalize_attribute,
|
||||
is_raw_text_element,
|
||||
sanitize_location,
|
||||
create_fragment_from_html,
|
||||
assign_nodes,
|
||||
from_html,
|
||||
from_svg,
|
||||
from_mathml,
|
||||
from_tree,
|
||||
with_script,
|
||||
text,
|
||||
comment,
|
||||
append,
|
||||
props_id,
|
||||
should_intro,
|
||||
set_should_intro,
|
||||
set_text,
|
||||
mount,
|
||||
hydrate,
|
||||
unmount,
|
||||
trusted,
|
||||
self,
|
||||
stopPropagation,
|
||||
once,
|
||||
stopImmediatePropagation,
|
||||
preventDefault,
|
||||
passive,
|
||||
nonpassive,
|
||||
createClassComponent,
|
||||
asClassComponent,
|
||||
run,
|
||||
handlers,
|
||||
createBubbler
|
||||
};
|
||||
//# sourceMappingURL=chunk-DL7TWQ45.js.map
|
||||
+7
File diff suppressed because one or more lines are too long
+686
@@ -0,0 +1,686 @@
|
||||
import {
|
||||
ReactiveValue
|
||||
} from "./chunk-6VYHLW26.js";
|
||||
import {
|
||||
active_reaction,
|
||||
get,
|
||||
increment,
|
||||
label,
|
||||
on,
|
||||
set,
|
||||
set_active_reaction,
|
||||
source,
|
||||
state,
|
||||
tag,
|
||||
update_version,
|
||||
user_derived
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
import {
|
||||
true_default
|
||||
} from "./chunk-VZQZA5WB.js";
|
||||
|
||||
// node_modules/svelte/src/reactivity/date.js
|
||||
var inited = false;
|
||||
var SvelteDate = class _SvelteDate extends Date {
|
||||
#time = state(super.getTime());
|
||||
/** @type {Map<keyof Date, Source<unknown>>} */
|
||||
#deriveds = /* @__PURE__ */ new Map();
|
||||
#reaction = active_reaction;
|
||||
/** @param {any[]} params */
|
||||
constructor(...params) {
|
||||
super(...params);
|
||||
if (true_default) {
|
||||
tag(this.#time, "SvelteDate.#time");
|
||||
}
|
||||
if (!inited) this.#init();
|
||||
}
|
||||
#init() {
|
||||
inited = true;
|
||||
var proto = _SvelteDate.prototype;
|
||||
var date_proto = Date.prototype;
|
||||
var methods = (
|
||||
/** @type {Array<keyof Date & string>} */
|
||||
Object.getOwnPropertyNames(date_proto)
|
||||
);
|
||||
for (const method of methods) {
|
||||
if (method.startsWith("get") || method.startsWith("to") || method === "valueOf") {
|
||||
proto[method] = function(...args) {
|
||||
if (args.length > 0) {
|
||||
get(this.#time);
|
||||
return date_proto[method].apply(this, args);
|
||||
}
|
||||
var d = this.#deriveds.get(method);
|
||||
if (d === void 0) {
|
||||
const reaction = active_reaction;
|
||||
set_active_reaction(this.#reaction);
|
||||
d = user_derived(() => {
|
||||
get(this.#time);
|
||||
return date_proto[method].apply(this, args);
|
||||
});
|
||||
this.#deriveds.set(method, d);
|
||||
set_active_reaction(reaction);
|
||||
}
|
||||
return get(d);
|
||||
};
|
||||
}
|
||||
if (method.startsWith("set")) {
|
||||
proto[method] = function(...args) {
|
||||
var result = date_proto[method].apply(this, args);
|
||||
set(this.#time, date_proto.getTime.call(this));
|
||||
return result;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// node_modules/svelte/src/reactivity/set.js
|
||||
var read_methods = ["forEach", "isDisjointFrom", "isSubsetOf", "isSupersetOf"];
|
||||
var set_like_methods = ["difference", "intersection", "symmetricDifference", "union"];
|
||||
var inited2 = false;
|
||||
var SvelteSet = class _SvelteSet extends Set {
|
||||
/** @type {Map<T, Source<boolean>>} */
|
||||
#sources = /* @__PURE__ */ new Map();
|
||||
#version = state(0);
|
||||
#size = state(0);
|
||||
#update_version = update_version || -1;
|
||||
/**
|
||||
* @param {Iterable<T> | null | undefined} [value]
|
||||
*/
|
||||
constructor(value) {
|
||||
super();
|
||||
if (true_default) {
|
||||
value = new Set(value);
|
||||
tag(this.#version, "SvelteSet version");
|
||||
tag(this.#size, "SvelteSet.size");
|
||||
}
|
||||
if (value) {
|
||||
for (var element of value) {
|
||||
super.add(element);
|
||||
}
|
||||
this.#size.v = super.size;
|
||||
}
|
||||
if (!inited2) this.#init();
|
||||
}
|
||||
/**
|
||||
* If the source is being created inside the same reaction as the SvelteSet instance,
|
||||
* we use `state` so that it will not be a dependency of the reaction. Otherwise we
|
||||
* use `source` so it will be.
|
||||
*
|
||||
* @template T
|
||||
* @param {T} value
|
||||
* @returns {Source<T>}
|
||||
*/
|
||||
#source(value) {
|
||||
return update_version === this.#update_version ? state(value) : source(value);
|
||||
}
|
||||
// We init as part of the first instance so that we can treeshake this class
|
||||
#init() {
|
||||
inited2 = true;
|
||||
var proto = _SvelteSet.prototype;
|
||||
var set_proto = Set.prototype;
|
||||
for (const method of read_methods) {
|
||||
proto[method] = function(...v) {
|
||||
get(this.#version);
|
||||
return set_proto[method].apply(this, v);
|
||||
};
|
||||
}
|
||||
for (const method of set_like_methods) {
|
||||
proto[method] = function(...v) {
|
||||
get(this.#version);
|
||||
var set2 = (
|
||||
/** @type {Set<T>} */
|
||||
set_proto[method].apply(this, v)
|
||||
);
|
||||
return new _SvelteSet(set2);
|
||||
};
|
||||
}
|
||||
}
|
||||
/** @param {T} value */
|
||||
has(value) {
|
||||
var has = super.has(value);
|
||||
var sources = this.#sources;
|
||||
var s = sources.get(value);
|
||||
if (s === void 0) {
|
||||
if (!has) {
|
||||
get(this.#version);
|
||||
return false;
|
||||
}
|
||||
s = this.#source(true);
|
||||
if (true_default) {
|
||||
tag(s, `SvelteSet has(${label(value)})`);
|
||||
}
|
||||
sources.set(value, s);
|
||||
}
|
||||
get(s);
|
||||
return has;
|
||||
}
|
||||
/** @param {T} value */
|
||||
add(value) {
|
||||
if (!super.has(value)) {
|
||||
super.add(value);
|
||||
set(this.#size, super.size);
|
||||
increment(this.#version);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
/** @param {T} value */
|
||||
delete(value) {
|
||||
var deleted = super.delete(value);
|
||||
var sources = this.#sources;
|
||||
var s = sources.get(value);
|
||||
if (s !== void 0) {
|
||||
sources.delete(value);
|
||||
set(s, false);
|
||||
}
|
||||
if (deleted) {
|
||||
set(this.#size, super.size);
|
||||
increment(this.#version);
|
||||
}
|
||||
return deleted;
|
||||
}
|
||||
clear() {
|
||||
if (super.size === 0) {
|
||||
return;
|
||||
}
|
||||
super.clear();
|
||||
var sources = this.#sources;
|
||||
for (var s of sources.values()) {
|
||||
set(s, false);
|
||||
}
|
||||
sources.clear();
|
||||
set(this.#size, 0);
|
||||
increment(this.#version);
|
||||
}
|
||||
keys() {
|
||||
return this.values();
|
||||
}
|
||||
values() {
|
||||
get(this.#version);
|
||||
return super.values();
|
||||
}
|
||||
entries() {
|
||||
get(this.#version);
|
||||
return super.entries();
|
||||
}
|
||||
[Symbol.iterator]() {
|
||||
return this.keys();
|
||||
}
|
||||
get size() {
|
||||
return get(this.#size);
|
||||
}
|
||||
};
|
||||
|
||||
// node_modules/svelte/src/reactivity/map.js
|
||||
var SvelteMap = class extends Map {
|
||||
/** @type {Map<K, Source<number>>} */
|
||||
#sources = /* @__PURE__ */ new Map();
|
||||
#version = state(0);
|
||||
#size = state(0);
|
||||
#update_version = update_version || -1;
|
||||
/**
|
||||
* @param {Iterable<readonly [K, V]> | null | undefined} [value]
|
||||
*/
|
||||
constructor(value) {
|
||||
super();
|
||||
if (true_default) {
|
||||
value = new Map(value);
|
||||
tag(this.#version, "SvelteMap version");
|
||||
tag(this.#size, "SvelteMap.size");
|
||||
}
|
||||
if (value) {
|
||||
for (var [key, v] of value) {
|
||||
super.set(key, v);
|
||||
}
|
||||
this.#size.v = super.size;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* If the source is being created inside the same reaction as the SvelteMap instance,
|
||||
* we use `state` so that it will not be a dependency of the reaction. Otherwise we
|
||||
* use `source` so it will be.
|
||||
*
|
||||
* @template T
|
||||
* @param {T} value
|
||||
* @returns {Source<T>}
|
||||
*/
|
||||
#source(value) {
|
||||
return update_version === this.#update_version ? state(value) : source(value);
|
||||
}
|
||||
/** @param {K} key */
|
||||
has(key) {
|
||||
var sources = this.#sources;
|
||||
var s = sources.get(key);
|
||||
if (s === void 0) {
|
||||
var ret = super.get(key);
|
||||
if (ret !== void 0) {
|
||||
s = this.#source(0);
|
||||
if (true_default) {
|
||||
tag(s, `SvelteMap get(${label(key)})`);
|
||||
}
|
||||
sources.set(key, s);
|
||||
} else {
|
||||
get(this.#version);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
get(s);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* @param {(value: V, key: K, map: Map<K, V>) => void} callbackfn
|
||||
* @param {any} [this_arg]
|
||||
*/
|
||||
forEach(callbackfn, this_arg) {
|
||||
this.#read_all();
|
||||
super.forEach(callbackfn, this_arg);
|
||||
}
|
||||
/** @param {K} key */
|
||||
get(key) {
|
||||
var sources = this.#sources;
|
||||
var s = sources.get(key);
|
||||
if (s === void 0) {
|
||||
var ret = super.get(key);
|
||||
if (ret !== void 0) {
|
||||
s = this.#source(0);
|
||||
if (true_default) {
|
||||
tag(s, `SvelteMap get(${label(key)})`);
|
||||
}
|
||||
sources.set(key, s);
|
||||
} else {
|
||||
get(this.#version);
|
||||
return void 0;
|
||||
}
|
||||
}
|
||||
get(s);
|
||||
return super.get(key);
|
||||
}
|
||||
/**
|
||||
* @param {K} key
|
||||
* @param {V} value
|
||||
* */
|
||||
set(key, value) {
|
||||
var sources = this.#sources;
|
||||
var s = sources.get(key);
|
||||
var prev_res = super.get(key);
|
||||
var res = super.set(key, value);
|
||||
var version = this.#version;
|
||||
if (s === void 0) {
|
||||
s = this.#source(0);
|
||||
if (true_default) {
|
||||
tag(s, `SvelteMap get(${label(key)})`);
|
||||
}
|
||||
sources.set(key, s);
|
||||
set(this.#size, super.size);
|
||||
increment(version);
|
||||
} else if (prev_res !== value) {
|
||||
increment(s);
|
||||
var v_reactions = version.reactions === null ? null : new Set(version.reactions);
|
||||
var needs_version_increase = v_reactions === null || !s.reactions?.every(
|
||||
(r) => (
|
||||
/** @type {NonNullable<typeof v_reactions>} */
|
||||
v_reactions.has(r)
|
||||
)
|
||||
);
|
||||
if (needs_version_increase) {
|
||||
increment(version);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
/** @param {K} key */
|
||||
delete(key) {
|
||||
var sources = this.#sources;
|
||||
var s = sources.get(key);
|
||||
var res = super.delete(key);
|
||||
if (s !== void 0) {
|
||||
sources.delete(key);
|
||||
set(this.#size, super.size);
|
||||
set(s, -1);
|
||||
increment(this.#version);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
clear() {
|
||||
if (super.size === 0) {
|
||||
return;
|
||||
}
|
||||
super.clear();
|
||||
var sources = this.#sources;
|
||||
set(this.#size, 0);
|
||||
for (var s of sources.values()) {
|
||||
set(s, -1);
|
||||
}
|
||||
increment(this.#version);
|
||||
sources.clear();
|
||||
}
|
||||
#read_all() {
|
||||
get(this.#version);
|
||||
var sources = this.#sources;
|
||||
if (this.#size.v !== sources.size) {
|
||||
for (var key of super.keys()) {
|
||||
if (!sources.has(key)) {
|
||||
var s = this.#source(0);
|
||||
if (true_default) {
|
||||
tag(s, `SvelteMap get(${label(key)})`);
|
||||
}
|
||||
sources.set(key, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
for ([, s] of this.#sources) {
|
||||
get(s);
|
||||
}
|
||||
}
|
||||
keys() {
|
||||
get(this.#version);
|
||||
return super.keys();
|
||||
}
|
||||
values() {
|
||||
this.#read_all();
|
||||
return super.values();
|
||||
}
|
||||
entries() {
|
||||
this.#read_all();
|
||||
return super.entries();
|
||||
}
|
||||
[Symbol.iterator]() {
|
||||
return this.entries();
|
||||
}
|
||||
get size() {
|
||||
get(this.#size);
|
||||
return super.size;
|
||||
}
|
||||
};
|
||||
|
||||
// node_modules/svelte/src/reactivity/url-search-params.js
|
||||
var REPLACE = /* @__PURE__ */ Symbol();
|
||||
var SvelteURLSearchParams = class extends URLSearchParams {
|
||||
#version = true_default ? tag(state(0), "SvelteURLSearchParams version") : state(0);
|
||||
#url = get_current_url();
|
||||
#updating = false;
|
||||
#update_url() {
|
||||
if (!this.#url || this.#updating) return;
|
||||
this.#updating = true;
|
||||
const search = this.toString();
|
||||
this.#url.search = search && `?${search}`;
|
||||
this.#updating = false;
|
||||
}
|
||||
/**
|
||||
* @param {URLSearchParams} params
|
||||
* @internal
|
||||
*/
|
||||
[REPLACE](params) {
|
||||
if (this.#updating) return;
|
||||
this.#updating = true;
|
||||
for (const key of [...super.keys()]) {
|
||||
super.delete(key);
|
||||
}
|
||||
for (const [key, value] of params) {
|
||||
super.append(key, value);
|
||||
}
|
||||
increment(this.#version);
|
||||
this.#updating = false;
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {string} value
|
||||
* @returns {void}
|
||||
*/
|
||||
append(name, value) {
|
||||
super.append(name, value);
|
||||
this.#update_url();
|
||||
increment(this.#version);
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {string=} value
|
||||
* @returns {void}
|
||||
*/
|
||||
delete(name, value) {
|
||||
var has_value = super.has(name, value);
|
||||
super.delete(name, value);
|
||||
if (has_value) {
|
||||
this.#update_url();
|
||||
increment(this.#version);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {string|null}
|
||||
*/
|
||||
get(name) {
|
||||
get(this.#version);
|
||||
return super.get(name);
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @returns {string[]}
|
||||
*/
|
||||
getAll(name) {
|
||||
get(this.#version);
|
||||
return super.getAll(name);
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {string=} value
|
||||
* @returns {boolean}
|
||||
*/
|
||||
has(name, value) {
|
||||
get(this.#version);
|
||||
return super.has(name, value);
|
||||
}
|
||||
keys() {
|
||||
get(this.#version);
|
||||
return super.keys();
|
||||
}
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {string} value
|
||||
* @returns {void}
|
||||
*/
|
||||
set(name, value) {
|
||||
var previous = super.getAll(name).join("");
|
||||
super.set(name, value);
|
||||
if (previous !== super.getAll(name).join("")) {
|
||||
this.#update_url();
|
||||
increment(this.#version);
|
||||
}
|
||||
}
|
||||
sort() {
|
||||
super.sort();
|
||||
this.#update_url();
|
||||
increment(this.#version);
|
||||
}
|
||||
toString() {
|
||||
get(this.#version);
|
||||
return super.toString();
|
||||
}
|
||||
values() {
|
||||
get(this.#version);
|
||||
return super.values();
|
||||
}
|
||||
entries() {
|
||||
get(this.#version);
|
||||
return super.entries();
|
||||
}
|
||||
[Symbol.iterator]() {
|
||||
return this.entries();
|
||||
}
|
||||
get size() {
|
||||
get(this.#version);
|
||||
return super.size;
|
||||
}
|
||||
};
|
||||
|
||||
// node_modules/svelte/src/reactivity/url.js
|
||||
var current_url = null;
|
||||
function get_current_url() {
|
||||
return current_url;
|
||||
}
|
||||
var SvelteURL = class extends URL {
|
||||
#protocol = state(super.protocol);
|
||||
#username = state(super.username);
|
||||
#password = state(super.password);
|
||||
#hostname = state(super.hostname);
|
||||
#port = state(super.port);
|
||||
#pathname = state(super.pathname);
|
||||
#hash = state(super.hash);
|
||||
#search = state(super.search);
|
||||
#searchParams;
|
||||
/**
|
||||
* @param {string | URL} url
|
||||
* @param {string | URL} [base]
|
||||
*/
|
||||
constructor(url, base) {
|
||||
url = new URL(url, base);
|
||||
super(url);
|
||||
if (true_default) {
|
||||
tag(this.#protocol, "SvelteURL.protocol");
|
||||
tag(this.#username, "SvelteURL.username");
|
||||
tag(this.#password, "SvelteURL.password");
|
||||
tag(this.#hostname, "SvelteURL.hostname");
|
||||
tag(this.#port, "SvelteURL.port");
|
||||
tag(this.#pathname, "SvelteURL.pathname");
|
||||
tag(this.#hash, "SvelteURL.hash");
|
||||
tag(this.#search, "SvelteURL.search");
|
||||
}
|
||||
current_url = this;
|
||||
this.#searchParams = new SvelteURLSearchParams(url.searchParams);
|
||||
current_url = null;
|
||||
}
|
||||
get hash() {
|
||||
return get(this.#hash);
|
||||
}
|
||||
set hash(value) {
|
||||
super.hash = value;
|
||||
set(this.#hash, super.hash);
|
||||
}
|
||||
get host() {
|
||||
get(this.#hostname);
|
||||
get(this.#port);
|
||||
return super.host;
|
||||
}
|
||||
set host(value) {
|
||||
super.host = value;
|
||||
set(this.#hostname, super.hostname);
|
||||
set(this.#port, super.port);
|
||||
}
|
||||
get hostname() {
|
||||
return get(this.#hostname);
|
||||
}
|
||||
set hostname(value) {
|
||||
super.hostname = value;
|
||||
set(this.#hostname, super.hostname);
|
||||
}
|
||||
get href() {
|
||||
get(this.#protocol);
|
||||
get(this.#username);
|
||||
get(this.#password);
|
||||
get(this.#hostname);
|
||||
get(this.#port);
|
||||
get(this.#pathname);
|
||||
get(this.#hash);
|
||||
get(this.#search);
|
||||
return super.href;
|
||||
}
|
||||
set href(value) {
|
||||
super.href = value;
|
||||
set(this.#protocol, super.protocol);
|
||||
set(this.#username, super.username);
|
||||
set(this.#password, super.password);
|
||||
set(this.#hostname, super.hostname);
|
||||
set(this.#port, super.port);
|
||||
set(this.#pathname, super.pathname);
|
||||
set(this.#hash, super.hash);
|
||||
set(this.#search, super.search);
|
||||
this.#searchParams[REPLACE](super.searchParams);
|
||||
}
|
||||
get password() {
|
||||
return get(this.#password);
|
||||
}
|
||||
set password(value) {
|
||||
super.password = value;
|
||||
set(this.#password, super.password);
|
||||
}
|
||||
get pathname() {
|
||||
return get(this.#pathname);
|
||||
}
|
||||
set pathname(value) {
|
||||
super.pathname = value;
|
||||
set(this.#pathname, super.pathname);
|
||||
}
|
||||
get port() {
|
||||
return get(this.#port);
|
||||
}
|
||||
set port(value) {
|
||||
super.port = value;
|
||||
set(this.#port, super.port);
|
||||
}
|
||||
get protocol() {
|
||||
return get(this.#protocol);
|
||||
}
|
||||
set protocol(value) {
|
||||
super.protocol = value;
|
||||
set(this.#protocol, super.protocol);
|
||||
}
|
||||
get search() {
|
||||
return get(this.#search);
|
||||
}
|
||||
set search(value) {
|
||||
super.search = value;
|
||||
set(this.#search, value);
|
||||
this.#searchParams[REPLACE](super.searchParams);
|
||||
}
|
||||
get username() {
|
||||
return get(this.#username);
|
||||
}
|
||||
set username(value) {
|
||||
super.username = value;
|
||||
set(this.#username, super.username);
|
||||
}
|
||||
get origin() {
|
||||
get(this.#protocol);
|
||||
get(this.#hostname);
|
||||
get(this.#port);
|
||||
return super.origin;
|
||||
}
|
||||
get searchParams() {
|
||||
return this.#searchParams;
|
||||
}
|
||||
toString() {
|
||||
return this.href;
|
||||
}
|
||||
toJSON() {
|
||||
return this.href;
|
||||
}
|
||||
};
|
||||
|
||||
// node_modules/svelte/src/reactivity/media-query.js
|
||||
var parenthesis_regex = /\(.+\)/;
|
||||
var non_parenthesized_keywords = /* @__PURE__ */ new Set(["all", "print", "screen", "and", "or", "not", "only"]);
|
||||
var MediaQuery = class extends ReactiveValue {
|
||||
/**
|
||||
* @param {string} query A media query string
|
||||
* @param {boolean} [fallback] Fallback value for the server
|
||||
*/
|
||||
constructor(query, fallback) {
|
||||
let final_query = parenthesis_regex.test(query) || // we need to use `some` here because technically this `window.matchMedia('random,screen')` still returns true
|
||||
query.split(/[\s,]+/).some((keyword) => non_parenthesized_keywords.has(keyword.trim())) ? query : `(${query})`;
|
||||
const q = window.matchMedia(final_query);
|
||||
super(
|
||||
() => q.matches,
|
||||
(update) => on(q, "change", update)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export {
|
||||
SvelteDate,
|
||||
SvelteSet,
|
||||
SvelteMap,
|
||||
SvelteURLSearchParams,
|
||||
SvelteURL,
|
||||
MediaQuery
|
||||
};
|
||||
//# sourceMappingURL=chunk-GOC6LLKR.js.map
|
||||
+7
File diff suppressed because one or more lines are too long
+23
@@ -0,0 +1,23 @@
|
||||
// node_modules/svelte/src/internal/flags/index.js
|
||||
var async_mode_flag = false;
|
||||
var legacy_mode_flag = false;
|
||||
var tracing_mode_flag = false;
|
||||
function enable_async_mode_flag() {
|
||||
async_mode_flag = true;
|
||||
}
|
||||
function enable_legacy_mode_flag() {
|
||||
legacy_mode_flag = true;
|
||||
}
|
||||
function enable_tracing_mode_flag() {
|
||||
tracing_mode_flag = true;
|
||||
}
|
||||
|
||||
export {
|
||||
async_mode_flag,
|
||||
legacy_mode_flag,
|
||||
tracing_mode_flag,
|
||||
enable_async_mode_flag,
|
||||
enable_legacy_mode_flag,
|
||||
enable_tracing_mode_flag
|
||||
};
|
||||
//# sourceMappingURL=chunk-OHYQYV5R.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/internal/flags/index.js"],
|
||||
"sourcesContent": ["/** True if experimental.async=true */\nexport let async_mode_flag = false;\n/** True if we're not certain that we only have Svelte 5 code in the compilation */\nexport let legacy_mode_flag = false;\n/** True if $inspect.trace is used */\nexport let tracing_mode_flag = false;\n\nexport function enable_async_mode_flag() {\n\tasync_mode_flag = true;\n}\n\n/** ONLY USE THIS DURING TESTING */\nexport function disable_async_mode_flag() {\n\tasync_mode_flag = false;\n}\n\nexport function enable_legacy_mode_flag() {\n\tlegacy_mode_flag = true;\n}\n\nexport function enable_tracing_mode_flag() {\n\ttracing_mode_flag = true;\n}\n"],
|
||||
"mappings": ";AACO,IAAI,kBAAkB;AAEtB,IAAI,mBAAmB;AAEvB,IAAI,oBAAoB;AAExB,SAAS,yBAAyB;AACxC,oBAAkB;AACnB;AAOO,SAAS,0BAA0B;AACzC,qBAAmB;AACpB;AAEO,SAAS,2BAA2B;AAC1C,sBAAoB;AACrB;",
|
||||
"names": []
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// node_modules/clsx/dist/clsx.mjs
|
||||
function r(e) {
|
||||
var t, f, n = "";
|
||||
if ("string" == typeof e || "number" == typeof e) n += e;
|
||||
else if ("object" == typeof e) if (Array.isArray(e)) {
|
||||
var o = e.length;
|
||||
for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
||||
} else for (f in e) e[f] && (n && (n += " "), n += f);
|
||||
return n;
|
||||
}
|
||||
function clsx() {
|
||||
for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
|
||||
return n;
|
||||
}
|
||||
var clsx_default = clsx;
|
||||
|
||||
export {
|
||||
clsx,
|
||||
clsx_default
|
||||
};
|
||||
//# sourceMappingURL=chunk-U7P2NEEE.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../clsx/dist/clsx.mjs"],
|
||||
"sourcesContent": ["function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;"],
|
||||
"mappings": ";AAAA,SAAS,EAAE,GAAE;AAAC,MAAI,GAAE,GAAE,IAAE;AAAG,MAAG,YAAU,OAAO,KAAG,YAAU,OAAO,EAAE,MAAG;AAAA,WAAU,YAAU,OAAO,EAAE,KAAG,MAAM,QAAQ,CAAC,GAAE;AAAC,QAAI,IAAE,EAAE;AAAO,SAAI,IAAE,GAAE,IAAE,GAAE,IAAI,GAAE,CAAC,MAAI,IAAE,EAAE,EAAE,CAAC,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAA,EAAE,MAAM,MAAI,KAAK,EAAE,GAAE,CAAC,MAAI,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAQ,SAAS,OAAM;AAAC,WAAQ,GAAE,GAAE,IAAE,GAAE,IAAE,IAAG,IAAE,UAAU,QAAO,IAAE,GAAE,IAAI,EAAC,IAAE,UAAU,CAAC,OAAK,IAAE,EAAE,CAAC,OAAK,MAAI,KAAG,MAAK,KAAG;AAAG,SAAO;AAAC;AAAC,IAAO,eAAQ;",
|
||||
"names": []
|
||||
}
|
||||
+4487
File diff suppressed because it is too large
Load Diff
+7
File diff suppressed because one or more lines are too long
+213
@@ -0,0 +1,213 @@
|
||||
// node_modules/esm-env/true.js
|
||||
var true_default = true;
|
||||
|
||||
// node_modules/svelte/src/internal/client/warnings.js
|
||||
var bold = "font-weight: bold";
|
||||
var normal = "font-weight: normal";
|
||||
function assignment_value_stale(property, location) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] assignment_value_stale
|
||||
%cAssignment to \`${property}\` property (${location}) will evaluate to the right-hand side, not the value of \`${property}\` following the assignment. This may result in unexpected behaviour.
|
||||
https://svelte.dev/e/assignment_value_stale`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/assignment_value_stale`);
|
||||
}
|
||||
}
|
||||
function await_waterfall(name, location) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] await_waterfall
|
||||
%cAn async derived, \`${name}\` (${location}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
|
||||
https://svelte.dev/e/await_waterfall`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/await_waterfall`);
|
||||
}
|
||||
}
|
||||
function binding_property_non_reactive(binding, location) {
|
||||
if (true_default) {
|
||||
console.warn(
|
||||
`%c[svelte] binding_property_non_reactive
|
||||
%c${location ? `\`${binding}\` (${location}) is binding to a non-reactive property` : `\`${binding}\` is binding to a non-reactive property`}
|
||||
https://svelte.dev/e/binding_property_non_reactive`,
|
||||
bold,
|
||||
normal
|
||||
);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/binding_property_non_reactive`);
|
||||
}
|
||||
}
|
||||
function console_log_state(method) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] console_log_state
|
||||
%cYour \`console.${method}\` contained \`$state\` proxies. Consider using \`$inspect(...)\` or \`$state.snapshot(...)\` instead
|
||||
https://svelte.dev/e/console_log_state`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/console_log_state`);
|
||||
}
|
||||
}
|
||||
function event_handler_invalid(handler, suggestion) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] event_handler_invalid
|
||||
%c${handler} should be a function. Did you mean to ${suggestion}?
|
||||
https://svelte.dev/e/event_handler_invalid`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/event_handler_invalid`);
|
||||
}
|
||||
}
|
||||
function hydratable_missing_but_expected(key) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] hydratable_missing_but_expected
|
||||
%cExpected to find a hydratable with key \`${key}\` during hydration, but did not.
|
||||
https://svelte.dev/e/hydratable_missing_but_expected`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/hydratable_missing_but_expected`);
|
||||
}
|
||||
}
|
||||
function hydration_attribute_changed(attribute, html, value) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] hydration_attribute_changed
|
||||
%cThe \`${attribute}\` attribute on \`${html}\` changed its value between server and client renders. The client value, \`${value}\`, will be ignored in favour of the server value
|
||||
https://svelte.dev/e/hydration_attribute_changed`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/hydration_attribute_changed`);
|
||||
}
|
||||
}
|
||||
function hydration_html_changed(location) {
|
||||
if (true_default) {
|
||||
console.warn(
|
||||
`%c[svelte] hydration_html_changed
|
||||
%c${location ? `The value of an \`{@html ...}\` block ${location} changed between server and client renders. The client value will be ignored in favour of the server value` : "The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}
|
||||
https://svelte.dev/e/hydration_html_changed`,
|
||||
bold,
|
||||
normal
|
||||
);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/hydration_html_changed`);
|
||||
}
|
||||
}
|
||||
function hydration_mismatch(location) {
|
||||
if (true_default) {
|
||||
console.warn(
|
||||
`%c[svelte] hydration_mismatch
|
||||
%c${location ? `Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${location}` : "Hydration failed because the initial UI does not match what was rendered on the server"}
|
||||
https://svelte.dev/e/hydration_mismatch`,
|
||||
bold,
|
||||
normal
|
||||
);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/hydration_mismatch`);
|
||||
}
|
||||
}
|
||||
function invalid_raw_snippet_render() {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] invalid_raw_snippet_render
|
||||
%cThe \`render\` function passed to \`createRawSnippet\` should return HTML for a single element
|
||||
https://svelte.dev/e/invalid_raw_snippet_render`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/invalid_raw_snippet_render`);
|
||||
}
|
||||
}
|
||||
function legacy_recursive_reactive_block(filename) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] legacy_recursive_reactive_block
|
||||
%cDetected a migrated \`$:\` reactive block in \`${filename}\` that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \`$effect\`.
|
||||
https://svelte.dev/e/legacy_recursive_reactive_block`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/legacy_recursive_reactive_block`);
|
||||
}
|
||||
}
|
||||
function lifecycle_double_unmount() {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] lifecycle_double_unmount
|
||||
%cTried to unmount a component that was not mounted
|
||||
https://svelte.dev/e/lifecycle_double_unmount`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/lifecycle_double_unmount`);
|
||||
}
|
||||
}
|
||||
function ownership_invalid_binding(parent, prop, child, owner) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] ownership_invalid_binding
|
||||
%c${parent} passed property \`${prop}\` to ${child} with \`bind:\`, but its parent component ${owner} did not declare \`${prop}\` as a binding. Consider creating a binding between ${owner} and ${parent} (e.g. \`bind:${prop}={...}\` instead of \`${prop}={...}\`)
|
||||
https://svelte.dev/e/ownership_invalid_binding`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/ownership_invalid_binding`);
|
||||
}
|
||||
}
|
||||
function ownership_invalid_mutation(name, location, prop, parent) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] ownership_invalid_mutation
|
||||
%cMutating unbound props (\`${name}\`, at ${location}) is strongly discouraged. Consider using \`bind:${prop}={...}\` in ${parent} (or using a callback) instead
|
||||
https://svelte.dev/e/ownership_invalid_mutation`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/ownership_invalid_mutation`);
|
||||
}
|
||||
}
|
||||
function select_multiple_invalid_value() {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] select_multiple_invalid_value
|
||||
%cThe \`value\` property of a \`<select multiple>\` element should be an array, but it received a non-array value. The selection will be kept as is.
|
||||
https://svelte.dev/e/select_multiple_invalid_value`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/select_multiple_invalid_value`);
|
||||
}
|
||||
}
|
||||
function state_proxy_equality_mismatch(operator) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] state_proxy_equality_mismatch
|
||||
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${operator}\` will produce unexpected results
|
||||
https://svelte.dev/e/state_proxy_equality_mismatch`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/state_proxy_equality_mismatch`);
|
||||
}
|
||||
}
|
||||
function state_proxy_unmount() {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] state_proxy_unmount
|
||||
%cTried to unmount a state proxy, rather than a component
|
||||
https://svelte.dev/e/state_proxy_unmount`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/state_proxy_unmount`);
|
||||
}
|
||||
}
|
||||
function svelte_boundary_reset_noop() {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] svelte_boundary_reset_noop
|
||||
%cA \`<svelte:boundary>\` \`reset\` function only resets the boundary the first time it is called
|
||||
https://svelte.dev/e/svelte_boundary_reset_noop`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`);
|
||||
}
|
||||
}
|
||||
function transition_slide_display(value) {
|
||||
if (true_default) {
|
||||
console.warn(`%c[svelte] transition_slide_display
|
||||
%cThe \`slide\` transition does not work correctly for elements with \`display: ${value}\`
|
||||
https://svelte.dev/e/transition_slide_display`, bold, normal);
|
||||
} else {
|
||||
console.warn(`https://svelte.dev/e/transition_slide_display`);
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
true_default,
|
||||
assignment_value_stale,
|
||||
await_waterfall,
|
||||
binding_property_non_reactive,
|
||||
console_log_state,
|
||||
event_handler_invalid,
|
||||
hydratable_missing_but_expected,
|
||||
hydration_attribute_changed,
|
||||
hydration_html_changed,
|
||||
hydration_mismatch,
|
||||
invalid_raw_snippet_render,
|
||||
legacy_recursive_reactive_block,
|
||||
lifecycle_double_unmount,
|
||||
ownership_invalid_binding,
|
||||
ownership_invalid_mutation,
|
||||
select_multiple_invalid_value,
|
||||
state_proxy_equality_mismatch,
|
||||
state_proxy_unmount,
|
||||
svelte_boundary_reset_noop,
|
||||
transition_slide_display
|
||||
};
|
||||
//# sourceMappingURL=chunk-VZQZA5WB.js.map
|
||||
+7
File diff suppressed because one or more lines are too long
+148
@@ -0,0 +1,148 @@
|
||||
// node_modules/svelte/src/easing/index.js
|
||||
function linear(t) {
|
||||
return t;
|
||||
}
|
||||
function backInOut(t) {
|
||||
const s = 1.70158 * 1.525;
|
||||
if ((t *= 2) < 1) return 0.5 * (t * t * ((s + 1) * t - s));
|
||||
return 0.5 * ((t -= 2) * t * ((s + 1) * t + s) + 2);
|
||||
}
|
||||
function backIn(t) {
|
||||
const s = 1.70158;
|
||||
return t * t * ((s + 1) * t - s);
|
||||
}
|
||||
function backOut(t) {
|
||||
const s = 1.70158;
|
||||
return --t * t * ((s + 1) * t + s) + 1;
|
||||
}
|
||||
function bounceOut(t) {
|
||||
const a = 4 / 11;
|
||||
const b = 8 / 11;
|
||||
const c = 9 / 10;
|
||||
const ca = 4356 / 361;
|
||||
const cb = 35442 / 1805;
|
||||
const cc = 16061 / 1805;
|
||||
const t2 = t * t;
|
||||
return t < a ? 7.5625 * t2 : t < b ? 9.075 * t2 - 9.9 * t + 3.4 : t < c ? ca * t2 - cb * t + cc : 10.8 * t * t - 20.52 * t + 10.72;
|
||||
}
|
||||
function bounceInOut(t) {
|
||||
return t < 0.5 ? 0.5 * (1 - bounceOut(1 - t * 2)) : 0.5 * bounceOut(t * 2 - 1) + 0.5;
|
||||
}
|
||||
function bounceIn(t) {
|
||||
return 1 - bounceOut(1 - t);
|
||||
}
|
||||
function circInOut(t) {
|
||||
if ((t *= 2) < 1) return -0.5 * (Math.sqrt(1 - t * t) - 1);
|
||||
return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);
|
||||
}
|
||||
function circIn(t) {
|
||||
return 1 - Math.sqrt(1 - t * t);
|
||||
}
|
||||
function circOut(t) {
|
||||
return Math.sqrt(1 - --t * t);
|
||||
}
|
||||
function cubicInOut(t) {
|
||||
return t < 0.5 ? 4 * t * t * t : 0.5 * Math.pow(2 * t - 2, 3) + 1;
|
||||
}
|
||||
function cubicIn(t) {
|
||||
return t * t * t;
|
||||
}
|
||||
function cubicOut(t) {
|
||||
const f = t - 1;
|
||||
return f * f * f + 1;
|
||||
}
|
||||
function elasticInOut(t) {
|
||||
return t < 0.5 ? 0.5 * Math.sin(13 * Math.PI / 2 * 2 * t) * Math.pow(2, 10 * (2 * t - 1)) : 0.5 * Math.sin(-13 * Math.PI / 2 * (2 * t - 1 + 1)) * Math.pow(2, -10 * (2 * t - 1)) + 1;
|
||||
}
|
||||
function elasticIn(t) {
|
||||
return Math.sin(13 * t * Math.PI / 2) * Math.pow(2, 10 * (t - 1));
|
||||
}
|
||||
function elasticOut(t) {
|
||||
return Math.sin(-13 * (t + 1) * Math.PI / 2) * Math.pow(2, -10 * t) + 1;
|
||||
}
|
||||
function expoInOut(t) {
|
||||
return t === 0 || t === 1 ? t : t < 0.5 ? 0.5 * Math.pow(2, 20 * t - 10) : -0.5 * Math.pow(2, 10 - t * 20) + 1;
|
||||
}
|
||||
function expoIn(t) {
|
||||
return t === 0 ? t : Math.pow(2, 10 * (t - 1));
|
||||
}
|
||||
function expoOut(t) {
|
||||
return t === 1 ? t : 1 - Math.pow(2, -10 * t);
|
||||
}
|
||||
function quadInOut(t) {
|
||||
t /= 0.5;
|
||||
if (t < 1) return 0.5 * t * t;
|
||||
t--;
|
||||
return -0.5 * (t * (t - 2) - 1);
|
||||
}
|
||||
function quadIn(t) {
|
||||
return t * t;
|
||||
}
|
||||
function quadOut(t) {
|
||||
return -t * (t - 2);
|
||||
}
|
||||
function quartInOut(t) {
|
||||
return t < 0.5 ? 8 * Math.pow(t, 4) : -8 * Math.pow(t - 1, 4) + 1;
|
||||
}
|
||||
function quartIn(t) {
|
||||
return Math.pow(t, 4);
|
||||
}
|
||||
function quartOut(t) {
|
||||
return Math.pow(t - 1, 3) * (1 - t) + 1;
|
||||
}
|
||||
function quintInOut(t) {
|
||||
if ((t *= 2) < 1) return 0.5 * t * t * t * t * t;
|
||||
return 0.5 * ((t -= 2) * t * t * t * t + 2);
|
||||
}
|
||||
function quintIn(t) {
|
||||
return t * t * t * t * t;
|
||||
}
|
||||
function quintOut(t) {
|
||||
return --t * t * t * t * t + 1;
|
||||
}
|
||||
function sineInOut(t) {
|
||||
return -0.5 * (Math.cos(Math.PI * t) - 1);
|
||||
}
|
||||
function sineIn(t) {
|
||||
const v = Math.cos(t * Math.PI * 0.5);
|
||||
if (Math.abs(v) < 1e-14) return 1;
|
||||
else return 1 - v;
|
||||
}
|
||||
function sineOut(t) {
|
||||
return Math.sin(t * Math.PI / 2);
|
||||
}
|
||||
|
||||
export {
|
||||
linear,
|
||||
backInOut,
|
||||
backIn,
|
||||
backOut,
|
||||
bounceOut,
|
||||
bounceInOut,
|
||||
bounceIn,
|
||||
circInOut,
|
||||
circIn,
|
||||
circOut,
|
||||
cubicInOut,
|
||||
cubicIn,
|
||||
cubicOut,
|
||||
elasticInOut,
|
||||
elasticIn,
|
||||
elasticOut,
|
||||
expoInOut,
|
||||
expoIn,
|
||||
expoOut,
|
||||
quadInOut,
|
||||
quadIn,
|
||||
quadOut,
|
||||
quartInOut,
|
||||
quartIn,
|
||||
quartOut,
|
||||
quintInOut,
|
||||
quintIn,
|
||||
quintOut,
|
||||
sineInOut,
|
||||
sineIn,
|
||||
sineOut
|
||||
};
|
||||
//# sourceMappingURL=chunk-YERFD2CZ.js.map
|
||||
+7
File diff suppressed because one or more lines are too long
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"type": "module"
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
import {
|
||||
afterUpdate,
|
||||
beforeUpdate,
|
||||
createEventDispatcher,
|
||||
createRawSnippet,
|
||||
getAbortSignal,
|
||||
hydratable,
|
||||
onDestroy,
|
||||
onMount
|
||||
} from "./chunk-UW3ABHAC.js";
|
||||
import "./chunk-U7P2NEEE.js";
|
||||
import {
|
||||
hydrate,
|
||||
mount,
|
||||
unmount
|
||||
} from "./chunk-DL7TWQ45.js";
|
||||
import {
|
||||
createContext,
|
||||
flushSync,
|
||||
fork,
|
||||
getAllContexts,
|
||||
getContext,
|
||||
hasContext,
|
||||
setContext,
|
||||
settled,
|
||||
tick,
|
||||
untrack
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
import "./chunk-VZQZA5WB.js";
|
||||
import "./chunk-OHYQYV5R.js";
|
||||
export {
|
||||
afterUpdate,
|
||||
beforeUpdate,
|
||||
createContext,
|
||||
createEventDispatcher,
|
||||
createRawSnippet,
|
||||
flushSync,
|
||||
fork,
|
||||
getAbortSignal,
|
||||
getAllContexts,
|
||||
getContext,
|
||||
hasContext,
|
||||
hydratable,
|
||||
hydrate,
|
||||
mount,
|
||||
onDestroy,
|
||||
onMount,
|
||||
setContext,
|
||||
settled,
|
||||
tick,
|
||||
unmount,
|
||||
untrack
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import {
|
||||
clsx,
|
||||
clsx_default
|
||||
} from "./chunk-U7P2NEEE.js";
|
||||
export {
|
||||
clsx,
|
||||
clsx_default as default
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
import {
|
||||
cubicOut
|
||||
} from "./chunk-YERFD2CZ.js";
|
||||
|
||||
// node_modules/svelte/src/animate/index.js
|
||||
function flip(node, { from, to }, params = {}) {
|
||||
var { delay = 0, duration = (d) => Math.sqrt(d) * 120, easing = cubicOut } = params;
|
||||
var style = getComputedStyle(node);
|
||||
var transform = style.transform === "none" ? "" : style.transform;
|
||||
var [ox, oy] = style.transformOrigin.split(" ").map(parseFloat);
|
||||
ox /= node.clientWidth;
|
||||
oy /= node.clientHeight;
|
||||
var zoom = get_zoom(node);
|
||||
var sx = node.clientWidth / to.width / zoom;
|
||||
var sy = node.clientHeight / to.height / zoom;
|
||||
var fx = from.left + from.width * ox;
|
||||
var fy = from.top + from.height * oy;
|
||||
var tx = to.left + to.width * ox;
|
||||
var ty = to.top + to.height * oy;
|
||||
var dx = (fx - tx) * sx;
|
||||
var dy = (fy - ty) * sy;
|
||||
var dsx = from.width / to.width;
|
||||
var dsy = from.height / to.height;
|
||||
return {
|
||||
delay,
|
||||
duration: typeof duration === "function" ? duration(Math.sqrt(dx * dx + dy * dy)) : duration,
|
||||
easing,
|
||||
css: (t, u) => {
|
||||
var x = u * dx;
|
||||
var y = u * dy;
|
||||
var sx2 = t + u * dsx;
|
||||
var sy2 = t + u * dsy;
|
||||
return `transform: ${transform} translate(${x}px, ${y}px) scale(${sx2}, ${sy2});`;
|
||||
}
|
||||
};
|
||||
}
|
||||
function get_zoom(element) {
|
||||
if ("currentCSSZoom" in element) {
|
||||
return (
|
||||
/** @type {number} */
|
||||
element.currentCSSZoom
|
||||
);
|
||||
}
|
||||
var current = element;
|
||||
var zoom = 1;
|
||||
while (current !== null) {
|
||||
zoom *= +getComputedStyle(current).zoom;
|
||||
current = /** @type {Element | null} */
|
||||
current.parentElement;
|
||||
}
|
||||
return zoom;
|
||||
}
|
||||
export {
|
||||
flip
|
||||
};
|
||||
//# sourceMappingURL=svelte_animate.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/animate/index.js"],
|
||||
"sourcesContent": ["/** @import { FlipParams, AnimationConfig } from './public.js' */\nimport { cubicOut } from '../easing/index.js';\n\n/**\n * The flip function calculates the start and end position of an element and animates between them, translating the x and y values.\n * `flip` stands for [First, Last, Invert, Play](https://aerotwist.com/blog/flip-your-animations/).\n *\n * @param {Element} node\n * @param {{ from: DOMRect; to: DOMRect }} fromTo\n * @param {FlipParams} params\n * @returns {AnimationConfig}\n */\nexport function flip(node, { from, to }, params = {}) {\n\tvar { delay = 0, duration = (d) => Math.sqrt(d) * 120, easing = cubicOut } = params;\n\n\tvar style = getComputedStyle(node);\n\n\t// find the transform origin, expressed as a pair of values between 0 and 1\n\tvar transform = style.transform === 'none' ? '' : style.transform;\n\tvar [ox, oy] = style.transformOrigin.split(' ').map(parseFloat);\n\tox /= node.clientWidth;\n\toy /= node.clientHeight;\n\n\t// calculate effect of parent transforms and zoom\n\tvar zoom = get_zoom(node); // https://drafts.csswg.org/css-viewport/#effective-zoom\n\tvar sx = node.clientWidth / to.width / zoom;\n\tvar sy = node.clientHeight / to.height / zoom;\n\n\t// find the starting position of the transform origin\n\tvar fx = from.left + from.width * ox;\n\tvar fy = from.top + from.height * oy;\n\n\t// find the ending position of the transform origin\n\tvar tx = to.left + to.width * ox;\n\tvar ty = to.top + to.height * oy;\n\n\t// find the translation at the start of the transform\n\tvar dx = (fx - tx) * sx;\n\tvar dy = (fy - ty) * sy;\n\n\t// find the relative scale at the start of the transform\n\tvar dsx = from.width / to.width;\n\tvar dsy = from.height / to.height;\n\n\treturn {\n\t\tdelay,\n\t\tduration: typeof duration === 'function' ? duration(Math.sqrt(dx * dx + dy * dy)) : duration,\n\t\teasing,\n\t\tcss: (t, u) => {\n\t\t\tvar x = u * dx;\n\t\t\tvar y = u * dy;\n\t\t\tvar sx = t + u * dsx;\n\t\t\tvar sy = t + u * dsy;\n\n\t\t\treturn `transform: ${transform} translate(${x}px, ${y}px) scale(${sx}, ${sy});`;\n\t\t}\n\t};\n}\n\n/**\n * @param {Element} element\n */\nfunction get_zoom(element) {\n\tif ('currentCSSZoom' in element) {\n\t\treturn /** @type {number} */ (element.currentCSSZoom);\n\t}\n\n\t/** @type {Element | null} */\n\tvar current = element;\n\tvar zoom = 1;\n\n\twhile (current !== null) {\n\t\tzoom *= +getComputedStyle(current).zoom;\n\t\tcurrent = /** @type {Element | null} */ (current.parentElement);\n\t}\n\n\treturn zoom;\n}\n"],
|
||||
"mappings": ";;;;;AAYO,SAAS,KAAK,MAAM,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG;AACrD,MAAI,EAAE,QAAQ,GAAG,WAAW,CAAC,MAAM,KAAK,KAAK,CAAC,IAAI,KAAK,SAAS,SAAS,IAAI;AAE7E,MAAI,QAAQ,iBAAiB,IAAI;AAGjC,MAAI,YAAY,MAAM,cAAc,SAAS,KAAK,MAAM;AACxD,MAAI,CAAC,IAAI,EAAE,IAAI,MAAM,gBAAgB,MAAM,GAAG,EAAE,IAAI,UAAU;AAC9D,QAAM,KAAK;AACX,QAAM,KAAK;AAGX,MAAI,OAAO,SAAS,IAAI;AACxB,MAAI,KAAK,KAAK,cAAc,GAAG,QAAQ;AACvC,MAAI,KAAK,KAAK,eAAe,GAAG,SAAS;AAGzC,MAAI,KAAK,KAAK,OAAO,KAAK,QAAQ;AAClC,MAAI,KAAK,KAAK,MAAM,KAAK,SAAS;AAGlC,MAAI,KAAK,GAAG,OAAO,GAAG,QAAQ;AAC9B,MAAI,KAAK,GAAG,MAAM,GAAG,SAAS;AAG9B,MAAI,MAAM,KAAK,MAAM;AACrB,MAAI,MAAM,KAAK,MAAM;AAGrB,MAAI,MAAM,KAAK,QAAQ,GAAG;AAC1B,MAAI,MAAM,KAAK,SAAS,GAAG;AAE3B,SAAO;AAAA,IACN;AAAA,IACA,UAAU,OAAO,aAAa,aAAa,SAAS,KAAK,KAAK,KAAK,KAAK,KAAK,EAAE,CAAC,IAAI;AAAA,IACpF;AAAA,IACA,KAAK,CAAC,GAAG,MAAM;AACd,UAAI,IAAI,IAAI;AACZ,UAAI,IAAI,IAAI;AACZ,UAAIA,MAAK,IAAI,IAAI;AACjB,UAAIC,MAAK,IAAI,IAAI;AAEjB,aAAO,cAAc,SAAS,cAAc,CAAC,OAAO,CAAC,aAAaD,GAAE,KAAKC,GAAE;AAAA,IAC5E;AAAA,EACD;AACD;AAKA,SAAS,SAAS,SAAS;AAC1B,MAAI,oBAAoB,SAAS;AAChC;AAAA;AAAA,MAA8B,QAAQ;AAAA;AAAA,EACvC;AAGA,MAAI,UAAU;AACd,MAAI,OAAO;AAEX,SAAO,YAAY,MAAM;AACxB,YAAQ,CAAC,iBAAiB,OAAO,EAAE;AACnC;AAAA,IAAyC,QAAQ;AAAA,EAClD;AAEA,SAAO;AACR;",
|
||||
"names": ["sx", "sy"]
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import {
|
||||
createAttachmentKey,
|
||||
fromAction
|
||||
} from "./chunk-UW3ABHAC.js";
|
||||
import "./chunk-U7P2NEEE.js";
|
||||
import "./chunk-DL7TWQ45.js";
|
||||
import "./chunk-5MWODAS5.js";
|
||||
import "./chunk-VZQZA5WB.js";
|
||||
import "./chunk-OHYQYV5R.js";
|
||||
export {
|
||||
createAttachmentKey,
|
||||
fromAction
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
import {
|
||||
backIn,
|
||||
backInOut,
|
||||
backOut,
|
||||
bounceIn,
|
||||
bounceInOut,
|
||||
bounceOut,
|
||||
circIn,
|
||||
circInOut,
|
||||
circOut,
|
||||
cubicIn,
|
||||
cubicInOut,
|
||||
cubicOut,
|
||||
elasticIn,
|
||||
elasticInOut,
|
||||
elasticOut,
|
||||
expoIn,
|
||||
expoInOut,
|
||||
expoOut,
|
||||
linear,
|
||||
quadIn,
|
||||
quadInOut,
|
||||
quadOut,
|
||||
quartIn,
|
||||
quartInOut,
|
||||
quartOut,
|
||||
quintIn,
|
||||
quintInOut,
|
||||
quintOut,
|
||||
sineIn,
|
||||
sineInOut,
|
||||
sineOut
|
||||
} from "./chunk-YERFD2CZ.js";
|
||||
export {
|
||||
backIn,
|
||||
backInOut,
|
||||
backOut,
|
||||
bounceIn,
|
||||
bounceInOut,
|
||||
bounceOut,
|
||||
circIn,
|
||||
circInOut,
|
||||
circOut,
|
||||
cubicIn,
|
||||
cubicInOut,
|
||||
cubicOut,
|
||||
elasticIn,
|
||||
elasticInOut,
|
||||
elasticOut,
|
||||
expoIn,
|
||||
expoInOut,
|
||||
expoOut,
|
||||
linear,
|
||||
quadIn,
|
||||
quadInOut,
|
||||
quadOut,
|
||||
quartIn,
|
||||
quartInOut,
|
||||
quartOut,
|
||||
quintIn,
|
||||
quintInOut,
|
||||
quintOut,
|
||||
sineIn,
|
||||
sineInOut,
|
||||
sineOut
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import "./chunk-7RQDXF5S.js";
|
||||
import {
|
||||
on
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
import "./chunk-VZQZA5WB.js";
|
||||
import "./chunk-OHYQYV5R.js";
|
||||
export {
|
||||
on
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// node_modules/svelte/src/internal/index.js
|
||||
throw new Error(
|
||||
`Your application, or one of its dependencies, imported from 'svelte/internal', which was a private module used by Svelte 4 components that no longer exists in Svelte 5. It is not intended to be public API. If you're a library author and you used 'svelte/internal' deliberately, please raise an issue on https://github.com/sveltejs/svelte/issues detailing your use case.`
|
||||
);
|
||||
//# sourceMappingURL=svelte_internal.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/internal/index.js"],
|
||||
"sourcesContent": ["// TODO we may, on a best-effort basis, reimplement some of the legacy private APIs here so that certain libraries continue to work. Those APIs will be marked as deprecated (and should noisily warn the user) and will be removed in a future version of Svelte.\n\nthrow new Error(\n\t`Your application, or one of its dependencies, imported from 'svelte/internal', which was a private module used by Svelte 4 components that no longer exists in Svelte 5. It is not intended to be public API. If you're a library author and you used 'svelte/internal' deliberately, please raise an issue on https://github.com/sveltejs/svelte/issues detailing your use case.`\n);\n"],
|
||||
"mappings": ";AAEA,MAAM,IAAI;AAAA,EACT;AACD;",
|
||||
"names": []
|
||||
}
|
||||
+401
@@ -0,0 +1,401 @@
|
||||
import {
|
||||
CLASS,
|
||||
STYLE,
|
||||
action,
|
||||
add_legacy_event_listener,
|
||||
add_locations,
|
||||
animation,
|
||||
append_styles,
|
||||
assign,
|
||||
assign_and,
|
||||
assign_nullish,
|
||||
assign_or,
|
||||
async,
|
||||
attach,
|
||||
attr,
|
||||
attribute_effect,
|
||||
await_block,
|
||||
bind_active_element,
|
||||
bind_buffered,
|
||||
bind_checked,
|
||||
bind_content_editable,
|
||||
bind_current_time,
|
||||
bind_element_size,
|
||||
bind_ended,
|
||||
bind_files,
|
||||
bind_focused,
|
||||
bind_group,
|
||||
bind_muted,
|
||||
bind_online,
|
||||
bind_paused,
|
||||
bind_playback_rate,
|
||||
bind_played,
|
||||
bind_prop,
|
||||
bind_property,
|
||||
bind_ready_state,
|
||||
bind_resize_observer,
|
||||
bind_seekable,
|
||||
bind_seeking,
|
||||
bind_select_value,
|
||||
bind_this,
|
||||
bind_value,
|
||||
bind_volume,
|
||||
bind_window_scroll,
|
||||
bind_window_size,
|
||||
bubble_event,
|
||||
check_target,
|
||||
cleanup_styles,
|
||||
clsx,
|
||||
component,
|
||||
createAttachmentKey,
|
||||
create_custom_element,
|
||||
create_ownership_validator,
|
||||
css_props,
|
||||
customizable_select,
|
||||
each,
|
||||
element,
|
||||
head,
|
||||
hmr,
|
||||
html,
|
||||
if_block,
|
||||
index,
|
||||
init,
|
||||
init_select,
|
||||
inspect,
|
||||
invalidate_store,
|
||||
key,
|
||||
legacy_api,
|
||||
legacy_rest_props,
|
||||
log_if_contains_state,
|
||||
mark_store_binding,
|
||||
prevent_snippet_stringification,
|
||||
prop,
|
||||
raf,
|
||||
reactive_import,
|
||||
remove_input_defaults,
|
||||
rest_props,
|
||||
sanitize_slots,
|
||||
select_option,
|
||||
selectedcontent,
|
||||
set_attribute,
|
||||
set_checked,
|
||||
set_class,
|
||||
set_custom_element_data,
|
||||
set_default_checked,
|
||||
set_default_value,
|
||||
set_selected,
|
||||
set_style,
|
||||
set_value,
|
||||
set_xlink_attribute,
|
||||
setup_stores,
|
||||
slot,
|
||||
snippet,
|
||||
spread_props,
|
||||
store_get,
|
||||
store_mutate,
|
||||
store_set,
|
||||
store_unsub,
|
||||
transition,
|
||||
update_legacy_props,
|
||||
update_pre_prop,
|
||||
update_pre_store,
|
||||
update_prop,
|
||||
update_store,
|
||||
validate_binding,
|
||||
validate_dynamic_element_tag,
|
||||
validate_each_keys,
|
||||
validate_snippet_args,
|
||||
validate_store,
|
||||
validate_void_dynamic_element,
|
||||
wrap_snippet
|
||||
} from "./chunk-UW3ABHAC.js";
|
||||
import "./chunk-U7P2NEEE.js";
|
||||
import {
|
||||
append,
|
||||
comment,
|
||||
from_html,
|
||||
from_mathml,
|
||||
from_svg,
|
||||
from_tree,
|
||||
once,
|
||||
preventDefault,
|
||||
props_id,
|
||||
self,
|
||||
set_text,
|
||||
stopImmediatePropagation,
|
||||
stopPropagation,
|
||||
text,
|
||||
trusted,
|
||||
with_script
|
||||
} from "./chunk-DL7TWQ45.js";
|
||||
import {
|
||||
$document,
|
||||
$window,
|
||||
FILENAME,
|
||||
HMR,
|
||||
NAMESPACE_SVG,
|
||||
aborted,
|
||||
active_effect,
|
||||
add_svelte_meta,
|
||||
apply,
|
||||
async_derived,
|
||||
autofocus,
|
||||
boundary,
|
||||
child,
|
||||
deep_read,
|
||||
deep_read_state,
|
||||
deferred_template_effect,
|
||||
delegate,
|
||||
derived_safe_equal,
|
||||
eager,
|
||||
effect,
|
||||
effect_root,
|
||||
effect_tracking,
|
||||
equals,
|
||||
event,
|
||||
exclude_from_object,
|
||||
fallback,
|
||||
first_child,
|
||||
flushSync,
|
||||
for_await_track_reactivity_loss,
|
||||
get,
|
||||
hydrate_template,
|
||||
invalid_default_snippet,
|
||||
invalidate_inner_signals,
|
||||
invoke_error_boundary,
|
||||
legacy_pre_effect,
|
||||
legacy_pre_effect_reset,
|
||||
mutable_source,
|
||||
mutate,
|
||||
next,
|
||||
noop,
|
||||
pending,
|
||||
pop,
|
||||
proxy,
|
||||
push,
|
||||
remove_textarea_child,
|
||||
render_effect,
|
||||
replay_events,
|
||||
reset,
|
||||
run2 as run,
|
||||
run_after_blockers,
|
||||
safe_get,
|
||||
save,
|
||||
set,
|
||||
sibling,
|
||||
snapshot,
|
||||
state,
|
||||
strict_equals,
|
||||
tag,
|
||||
tag_proxy,
|
||||
template_effect,
|
||||
tick,
|
||||
to_array,
|
||||
trace,
|
||||
track_reactivity_loss,
|
||||
untrack,
|
||||
update,
|
||||
update_pre,
|
||||
user_derived,
|
||||
user_effect,
|
||||
user_pre_effect
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
import "./chunk-VZQZA5WB.js";
|
||||
import "./chunk-OHYQYV5R.js";
|
||||
export {
|
||||
CLASS,
|
||||
FILENAME,
|
||||
HMR,
|
||||
NAMESPACE_SVG,
|
||||
STYLE,
|
||||
aborted,
|
||||
action,
|
||||
active_effect,
|
||||
add_legacy_event_listener,
|
||||
add_locations,
|
||||
add_svelte_meta,
|
||||
animation,
|
||||
append,
|
||||
append_styles,
|
||||
apply,
|
||||
assign,
|
||||
assign_and,
|
||||
assign_nullish,
|
||||
assign_or,
|
||||
async,
|
||||
async_derived,
|
||||
attach,
|
||||
createAttachmentKey as attachment,
|
||||
attr,
|
||||
attribute_effect,
|
||||
autofocus,
|
||||
await_block as await,
|
||||
bind_active_element,
|
||||
bind_buffered,
|
||||
bind_checked,
|
||||
bind_content_editable,
|
||||
bind_current_time,
|
||||
bind_element_size,
|
||||
bind_ended,
|
||||
bind_files,
|
||||
bind_focused,
|
||||
bind_group,
|
||||
bind_muted,
|
||||
bind_online,
|
||||
bind_paused,
|
||||
bind_playback_rate,
|
||||
bind_played,
|
||||
bind_prop,
|
||||
bind_property,
|
||||
bind_ready_state,
|
||||
bind_resize_observer,
|
||||
bind_seekable,
|
||||
bind_seeking,
|
||||
bind_select_value,
|
||||
bind_this,
|
||||
bind_value,
|
||||
bind_volume,
|
||||
bind_window_scroll,
|
||||
bind_window_size,
|
||||
boundary,
|
||||
bubble_event,
|
||||
check_target,
|
||||
child,
|
||||
cleanup_styles,
|
||||
clsx,
|
||||
comment,
|
||||
component,
|
||||
create_custom_element,
|
||||
create_ownership_validator,
|
||||
css_props,
|
||||
customizable_select,
|
||||
deep_read,
|
||||
deep_read_state,
|
||||
deferred_template_effect,
|
||||
delegate,
|
||||
user_derived as derived,
|
||||
derived_safe_equal,
|
||||
$document as document,
|
||||
each,
|
||||
eager,
|
||||
effect,
|
||||
effect_root,
|
||||
effect_tracking,
|
||||
element,
|
||||
equals,
|
||||
event,
|
||||
exclude_from_object,
|
||||
fallback,
|
||||
first_child,
|
||||
flushSync as flush,
|
||||
for_await_track_reactivity_loss,
|
||||
from_html,
|
||||
from_mathml,
|
||||
from_svg,
|
||||
from_tree,
|
||||
get,
|
||||
head,
|
||||
hmr,
|
||||
html,
|
||||
hydrate_template,
|
||||
if_block as if,
|
||||
index,
|
||||
init,
|
||||
init_select,
|
||||
inspect,
|
||||
invalid_default_snippet,
|
||||
invalidate_inner_signals,
|
||||
invalidate_store,
|
||||
invoke_error_boundary,
|
||||
key,
|
||||
legacy_api,
|
||||
legacy_pre_effect,
|
||||
legacy_pre_effect_reset,
|
||||
legacy_rest_props,
|
||||
log_if_contains_state,
|
||||
mark_store_binding,
|
||||
mutable_source,
|
||||
mutate,
|
||||
next,
|
||||
noop,
|
||||
once,
|
||||
pending,
|
||||
pop,
|
||||
preventDefault,
|
||||
prevent_snippet_stringification,
|
||||
prop,
|
||||
props_id,
|
||||
proxy,
|
||||
push,
|
||||
raf,
|
||||
reactive_import,
|
||||
remove_input_defaults,
|
||||
remove_textarea_child,
|
||||
render_effect,
|
||||
replay_events,
|
||||
reset,
|
||||
rest_props,
|
||||
run,
|
||||
run_after_blockers,
|
||||
safe_get,
|
||||
sanitize_slots,
|
||||
save,
|
||||
select_option,
|
||||
selectedcontent,
|
||||
self,
|
||||
set,
|
||||
set_attribute,
|
||||
set_checked,
|
||||
set_class,
|
||||
set_custom_element_data,
|
||||
set_default_checked,
|
||||
set_default_value,
|
||||
set_selected,
|
||||
set_style,
|
||||
set_text,
|
||||
set_value,
|
||||
set_xlink_attribute,
|
||||
setup_stores,
|
||||
sibling,
|
||||
slot,
|
||||
snapshot,
|
||||
snippet,
|
||||
spread_props,
|
||||
state,
|
||||
stopImmediatePropagation,
|
||||
stopPropagation,
|
||||
store_get,
|
||||
store_mutate,
|
||||
store_set,
|
||||
store_unsub,
|
||||
strict_equals,
|
||||
tag,
|
||||
tag_proxy,
|
||||
template_effect,
|
||||
text,
|
||||
tick,
|
||||
to_array,
|
||||
trace,
|
||||
track_reactivity_loss,
|
||||
transition,
|
||||
trusted,
|
||||
untrack,
|
||||
update,
|
||||
update_legacy_props,
|
||||
update_pre,
|
||||
update_pre_prop,
|
||||
update_pre_store,
|
||||
update_prop,
|
||||
update_store,
|
||||
user_effect,
|
||||
user_pre_effect,
|
||||
validate_binding,
|
||||
validate_dynamic_element_tag,
|
||||
validate_each_keys,
|
||||
validate_snippet_args,
|
||||
validate_store,
|
||||
validate_void_dynamic_element,
|
||||
$window as window,
|
||||
with_script,
|
||||
wrap_snippet
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// node_modules/svelte/src/version.js
|
||||
var PUBLIC_VERSION = "5";
|
||||
|
||||
// node_modules/svelte/src/internal/disclose-version.js
|
||||
if (typeof window !== "undefined") {
|
||||
((window.__svelte ??= {}).v ??= /* @__PURE__ */ new Set()).add(PUBLIC_VERSION);
|
||||
}
|
||||
//# sourceMappingURL=svelte_internal_disclose-version.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/version.js", "../../svelte/src/internal/disclose-version.js"],
|
||||
"sourcesContent": ["// generated during release, do not modify\n\n/**\n * The current version, as set in package.json.\n * @type {string}\n */\nexport const VERSION = '5.48.0';\nexport const PUBLIC_VERSION = '5';\n", "import { PUBLIC_VERSION } from '../version.js';\n\nif (typeof window !== 'undefined') {\n\t// @ts-expect-error\n\t((window.__svelte ??= {}).v ??= new Set()).add(PUBLIC_VERSION);\n}\n"],
|
||||
"mappings": ";AAOO,IAAM,iBAAiB;;;ACL9B,IAAI,OAAO,WAAW,aAAa;AAElC,IAAE,OAAO,aAAa,CAAC,GAAG,MAAM,oBAAI,IAAI,GAAG,IAAI,cAAc;AAC9D;",
|
||||
"names": []
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import {
|
||||
enable_async_mode_flag
|
||||
} from "./chunk-OHYQYV5R.js";
|
||||
|
||||
// node_modules/svelte/src/internal/flags/async.js
|
||||
enable_async_mode_flag();
|
||||
//# sourceMappingURL=svelte_internal_flags_async.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/internal/flags/async.js"],
|
||||
"sourcesContent": ["import { enable_async_mode_flag } from './index.js';\n\nenable_async_mode_flag();\n"],
|
||||
"mappings": ";;;;;AAEA,uBAAuB;",
|
||||
"names": []
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import {
|
||||
enable_legacy_mode_flag
|
||||
} from "./chunk-OHYQYV5R.js";
|
||||
|
||||
// node_modules/svelte/src/internal/flags/legacy.js
|
||||
enable_legacy_mode_flag();
|
||||
//# sourceMappingURL=svelte_internal_flags_legacy.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/internal/flags/legacy.js"],
|
||||
"sourcesContent": ["import { enable_legacy_mode_flag } from './index.js';\n\nenable_legacy_mode_flag();\n"],
|
||||
"mappings": ";;;;;AAEA,wBAAwB;",
|
||||
"names": []
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import {
|
||||
enable_tracing_mode_flag
|
||||
} from "./chunk-OHYQYV5R.js";
|
||||
|
||||
// node_modules/svelte/src/internal/flags/tracing.js
|
||||
enable_tracing_mode_flag();
|
||||
//# sourceMappingURL=svelte_internal_flags_tracing.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/internal/flags/tracing.js"],
|
||||
"sourcesContent": ["import { enable_tracing_mode_flag } from './index.js';\n\nenable_tracing_mode_flag();\n"],
|
||||
"mappings": ";;;;;AAEA,yBAAyB;",
|
||||
"names": []
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import {
|
||||
asClassComponent,
|
||||
createBubbler,
|
||||
createClassComponent,
|
||||
handlers,
|
||||
nonpassive,
|
||||
once,
|
||||
passive,
|
||||
preventDefault,
|
||||
run,
|
||||
self,
|
||||
stopImmediatePropagation,
|
||||
stopPropagation,
|
||||
trusted
|
||||
} from "./chunk-DL7TWQ45.js";
|
||||
import "./chunk-5MWODAS5.js";
|
||||
import "./chunk-VZQZA5WB.js";
|
||||
import "./chunk-OHYQYV5R.js";
|
||||
export {
|
||||
asClassComponent,
|
||||
createBubbler,
|
||||
createClassComponent,
|
||||
handlers,
|
||||
nonpassive,
|
||||
once,
|
||||
passive,
|
||||
preventDefault,
|
||||
run,
|
||||
self,
|
||||
stopImmediatePropagation,
|
||||
stopPropagation,
|
||||
trusted
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
+543
@@ -0,0 +1,543 @@
|
||||
import {
|
||||
MediaQuery
|
||||
} from "./chunk-GOC6LLKR.js";
|
||||
import "./chunk-6VYHLW26.js";
|
||||
import "./chunk-7RQDXF5S.js";
|
||||
import {
|
||||
linear
|
||||
} from "./chunk-YERFD2CZ.js";
|
||||
import {
|
||||
loop,
|
||||
raf,
|
||||
writable
|
||||
} from "./chunk-UW3ABHAC.js";
|
||||
import "./chunk-U7P2NEEE.js";
|
||||
import "./chunk-DL7TWQ45.js";
|
||||
import {
|
||||
deferred,
|
||||
get,
|
||||
noop,
|
||||
render_effect,
|
||||
set,
|
||||
state,
|
||||
tag
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
import {
|
||||
true_default
|
||||
} from "./chunk-VZQZA5WB.js";
|
||||
import "./chunk-OHYQYV5R.js";
|
||||
|
||||
// node_modules/svelte/src/motion/utils.js
|
||||
function is_date(obj) {
|
||||
return Object.prototype.toString.call(obj) === "[object Date]";
|
||||
}
|
||||
|
||||
// node_modules/svelte/src/motion/spring.js
|
||||
function tick_spring(ctx, last_value, current_value, target_value) {
|
||||
if (typeof current_value === "number" || is_date(current_value)) {
|
||||
const delta = target_value - current_value;
|
||||
const velocity = (current_value - last_value) / (ctx.dt || 1 / 60);
|
||||
const spring2 = ctx.opts.stiffness * delta;
|
||||
const damper = ctx.opts.damping * velocity;
|
||||
const acceleration = (spring2 - damper) * ctx.inv_mass;
|
||||
const d = (velocity + acceleration) * ctx.dt;
|
||||
if (Math.abs(d) < ctx.opts.precision && Math.abs(delta) < ctx.opts.precision) {
|
||||
return target_value;
|
||||
} else {
|
||||
ctx.settled = false;
|
||||
return is_date(current_value) ? new Date(current_value.getTime() + d) : current_value + d;
|
||||
}
|
||||
} else if (Array.isArray(current_value)) {
|
||||
return current_value.map(
|
||||
(_, i) => (
|
||||
// @ts-ignore
|
||||
tick_spring(ctx, last_value[i], current_value[i], target_value[i])
|
||||
)
|
||||
);
|
||||
} else if (typeof current_value === "object") {
|
||||
const next_value = {};
|
||||
for (const k in current_value) {
|
||||
next_value[k] = tick_spring(ctx, last_value[k], current_value[k], target_value[k]);
|
||||
}
|
||||
return next_value;
|
||||
} else {
|
||||
throw new Error(`Cannot spring ${typeof current_value} values`);
|
||||
}
|
||||
}
|
||||
function spring(value, opts = {}) {
|
||||
const store = writable(value);
|
||||
const { stiffness = 0.15, damping = 0.8, precision = 0.01 } = opts;
|
||||
let last_time;
|
||||
let task;
|
||||
let current_token;
|
||||
let last_value = (
|
||||
/** @type {T} */
|
||||
value
|
||||
);
|
||||
let target_value = (
|
||||
/** @type {T | undefined} */
|
||||
value
|
||||
);
|
||||
let inv_mass = 1;
|
||||
let inv_mass_recovery_rate = 0;
|
||||
let cancel_task = false;
|
||||
function set2(new_value, opts2 = {}) {
|
||||
target_value = new_value;
|
||||
const token = current_token = {};
|
||||
if (value == null || opts2.hard || spring2.stiffness >= 1 && spring2.damping >= 1) {
|
||||
cancel_task = true;
|
||||
last_time = raf.now();
|
||||
last_value = new_value;
|
||||
store.set(value = target_value);
|
||||
return Promise.resolve();
|
||||
} else if (opts2.soft) {
|
||||
const rate = opts2.soft === true ? 0.5 : +opts2.soft;
|
||||
inv_mass_recovery_rate = 1 / (rate * 60);
|
||||
inv_mass = 0;
|
||||
}
|
||||
if (!task) {
|
||||
last_time = raf.now();
|
||||
cancel_task = false;
|
||||
task = loop((now) => {
|
||||
if (cancel_task) {
|
||||
cancel_task = false;
|
||||
task = null;
|
||||
return false;
|
||||
}
|
||||
inv_mass = Math.min(inv_mass + inv_mass_recovery_rate, 1);
|
||||
const elapsed = Math.min(now - last_time, 1e3 / 30);
|
||||
const ctx = {
|
||||
inv_mass,
|
||||
opts: spring2,
|
||||
settled: true,
|
||||
dt: elapsed * 60 / 1e3
|
||||
};
|
||||
const next_value = tick_spring(ctx, last_value, value, target_value);
|
||||
last_time = now;
|
||||
last_value = /** @type {T} */
|
||||
value;
|
||||
store.set(value = /** @type {T} */
|
||||
next_value);
|
||||
if (ctx.settled) {
|
||||
task = null;
|
||||
}
|
||||
return !ctx.settled;
|
||||
});
|
||||
}
|
||||
return new Promise((fulfil) => {
|
||||
task.promise.then(() => {
|
||||
if (token === current_token) fulfil();
|
||||
});
|
||||
});
|
||||
}
|
||||
const spring2 = {
|
||||
set: set2,
|
||||
update: (fn, opts2) => set2(fn(
|
||||
/** @type {T} */
|
||||
target_value,
|
||||
/** @type {T} */
|
||||
value
|
||||
), opts2),
|
||||
subscribe: store.subscribe,
|
||||
stiffness,
|
||||
damping,
|
||||
precision
|
||||
};
|
||||
return spring2;
|
||||
}
|
||||
var Spring = class _Spring {
|
||||
#stiffness = state(0.15);
|
||||
#damping = state(0.8);
|
||||
#precision = state(0.01);
|
||||
#current;
|
||||
#target;
|
||||
#last_value = (
|
||||
/** @type {T} */
|
||||
void 0
|
||||
);
|
||||
#last_time = 0;
|
||||
#inverse_mass = 1;
|
||||
#momentum = 0;
|
||||
/** @type {import('../internal/client/types').Task | null} */
|
||||
#task = null;
|
||||
/** @type {ReturnType<typeof deferred> | null} */
|
||||
#deferred = null;
|
||||
/**
|
||||
* @param {T} value
|
||||
* @param {SpringOpts} [options]
|
||||
*/
|
||||
constructor(value, options = {}) {
|
||||
this.#current = true_default ? tag(state(value), "Spring.current") : state(value);
|
||||
this.#target = true_default ? tag(state(value), "Spring.target") : state(value);
|
||||
if (typeof options.stiffness === "number") this.#stiffness.v = clamp(options.stiffness, 0, 1);
|
||||
if (typeof options.damping === "number") this.#damping.v = clamp(options.damping, 0, 1);
|
||||
if (typeof options.precision === "number") this.#precision.v = options.precision;
|
||||
if (true_default) {
|
||||
tag(this.#stiffness, "Spring.stiffness");
|
||||
tag(this.#damping, "Spring.damping");
|
||||
tag(this.#precision, "Spring.precision");
|
||||
tag(this.#current, "Spring.current");
|
||||
tag(this.#target, "Spring.target");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Create a spring whose value is bound to the return value of `fn`. This must be called
|
||||
* inside an effect root (for example, during component initialisation).
|
||||
*
|
||||
* ```svelte
|
||||
* <script>
|
||||
* import { Spring } from 'svelte/motion';
|
||||
*
|
||||
* let { number } = $props();
|
||||
*
|
||||
* const spring = Spring.of(() => number);
|
||||
* <\/script>
|
||||
* ```
|
||||
* @template U
|
||||
* @param {() => U} fn
|
||||
* @param {SpringOpts} [options]
|
||||
*/
|
||||
static of(fn, options) {
|
||||
const spring2 = new _Spring(fn(), options);
|
||||
render_effect(() => {
|
||||
spring2.set(fn());
|
||||
});
|
||||
return spring2;
|
||||
}
|
||||
/** @param {T} value */
|
||||
#update(value) {
|
||||
set(this.#target, value);
|
||||
this.#current.v ??= value;
|
||||
this.#last_value ??= this.#current.v;
|
||||
if (!this.#task) {
|
||||
this.#last_time = raf.now();
|
||||
var inv_mass_recovery_rate = 1e3 / (this.#momentum * 60);
|
||||
this.#task ??= loop((now) => {
|
||||
this.#inverse_mass = Math.min(this.#inverse_mass + inv_mass_recovery_rate, 1);
|
||||
const elapsed = Math.min(now - this.#last_time, 1e3 / 30);
|
||||
const ctx = {
|
||||
inv_mass: this.#inverse_mass,
|
||||
opts: {
|
||||
stiffness: this.#stiffness.v,
|
||||
damping: this.#damping.v,
|
||||
precision: this.#precision.v
|
||||
},
|
||||
settled: true,
|
||||
dt: elapsed * 60 / 1e3
|
||||
};
|
||||
var next = tick_spring(ctx, this.#last_value, this.#current.v, this.#target.v);
|
||||
this.#last_value = this.#current.v;
|
||||
this.#last_time = now;
|
||||
set(this.#current, next);
|
||||
if (ctx.settled) {
|
||||
this.#task = null;
|
||||
}
|
||||
return !ctx.settled;
|
||||
});
|
||||
}
|
||||
return this.#task.promise;
|
||||
}
|
||||
/**
|
||||
* Sets `spring.target` to `value` and returns a `Promise` that resolves if and when `spring.current` catches up to it.
|
||||
*
|
||||
* If `options.instant` is `true`, `spring.current` immediately matches `spring.target`.
|
||||
*
|
||||
* If `options.preserveMomentum` is provided, the spring will continue on its current trajectory for
|
||||
* the specified number of milliseconds. This is useful for things like 'fling' gestures.
|
||||
*
|
||||
* @param {T} value
|
||||
* @param {SpringUpdateOpts} [options]
|
||||
*/
|
||||
set(value, options) {
|
||||
this.#deferred?.reject(new Error("Aborted"));
|
||||
if (options?.instant || this.#current.v === void 0) {
|
||||
this.#task?.abort();
|
||||
this.#task = null;
|
||||
set(this.#current, set(this.#target, value));
|
||||
this.#last_value = value;
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (options?.preserveMomentum) {
|
||||
this.#inverse_mass = 0;
|
||||
this.#momentum = options.preserveMomentum;
|
||||
}
|
||||
var d = this.#deferred = deferred();
|
||||
d.promise.catch(noop);
|
||||
this.#update(value).then(() => {
|
||||
if (d !== this.#deferred) return;
|
||||
d.resolve(void 0);
|
||||
});
|
||||
return d.promise;
|
||||
}
|
||||
get current() {
|
||||
return get(this.#current);
|
||||
}
|
||||
get damping() {
|
||||
return get(this.#damping);
|
||||
}
|
||||
set damping(v) {
|
||||
set(this.#damping, clamp(v, 0, 1));
|
||||
}
|
||||
get precision() {
|
||||
return get(this.#precision);
|
||||
}
|
||||
set precision(v) {
|
||||
set(this.#precision, v);
|
||||
}
|
||||
get stiffness() {
|
||||
return get(this.#stiffness);
|
||||
}
|
||||
set stiffness(v) {
|
||||
set(this.#stiffness, clamp(v, 0, 1));
|
||||
}
|
||||
get target() {
|
||||
return get(this.#target);
|
||||
}
|
||||
set target(v) {
|
||||
this.set(v);
|
||||
}
|
||||
};
|
||||
function clamp(n, min, max) {
|
||||
return Math.max(min, Math.min(max, n));
|
||||
}
|
||||
|
||||
// node_modules/svelte/src/motion/tweened.js
|
||||
function get_interpolator(a, b) {
|
||||
if (a === b || a !== a) return () => a;
|
||||
const type = typeof a;
|
||||
if (type !== typeof b || Array.isArray(a) !== Array.isArray(b)) {
|
||||
throw new Error("Cannot interpolate values of different type");
|
||||
}
|
||||
if (Array.isArray(a)) {
|
||||
const arr = (
|
||||
/** @type {Array<any>} */
|
||||
b.map((bi, i) => {
|
||||
return get_interpolator(
|
||||
/** @type {Array<any>} */
|
||||
a[i],
|
||||
bi
|
||||
);
|
||||
})
|
||||
);
|
||||
return (t) => arr.map((fn) => fn(t));
|
||||
}
|
||||
if (type === "object") {
|
||||
if (!a || !b) {
|
||||
throw new Error("Object cannot be null");
|
||||
}
|
||||
if (is_date(a) && is_date(b)) {
|
||||
const an = a.getTime();
|
||||
const bn = b.getTime();
|
||||
const delta = bn - an;
|
||||
return (t) => new Date(an + t * delta);
|
||||
}
|
||||
const keys = Object.keys(b);
|
||||
const interpolators = {};
|
||||
keys.forEach((key) => {
|
||||
interpolators[key] = get_interpolator(a[key], b[key]);
|
||||
});
|
||||
return (t) => {
|
||||
const result = {};
|
||||
keys.forEach((key) => {
|
||||
result[key] = interpolators[key](t);
|
||||
});
|
||||
return result;
|
||||
};
|
||||
}
|
||||
if (type === "number") {
|
||||
const delta = (
|
||||
/** @type {number} */
|
||||
b - /** @type {number} */
|
||||
a
|
||||
);
|
||||
return (t) => a + t * delta;
|
||||
}
|
||||
return () => b;
|
||||
}
|
||||
function tweened(value, defaults = {}) {
|
||||
const store = writable(value);
|
||||
let task;
|
||||
let target_value = value;
|
||||
function set2(new_value, opts) {
|
||||
target_value = new_value;
|
||||
if (value == null) {
|
||||
store.set(value = new_value);
|
||||
return Promise.resolve();
|
||||
}
|
||||
let previous_task = task;
|
||||
let started = false;
|
||||
let {
|
||||
delay = 0,
|
||||
duration = 400,
|
||||
easing = linear,
|
||||
interpolate = get_interpolator
|
||||
} = { ...defaults, ...opts };
|
||||
if (duration === 0) {
|
||||
if (previous_task) {
|
||||
previous_task.abort();
|
||||
previous_task = null;
|
||||
}
|
||||
store.set(value = target_value);
|
||||
return Promise.resolve();
|
||||
}
|
||||
const start = raf.now() + delay;
|
||||
let fn;
|
||||
task = loop((now) => {
|
||||
if (now < start) return true;
|
||||
if (!started) {
|
||||
fn = interpolate(
|
||||
/** @type {any} */
|
||||
value,
|
||||
new_value
|
||||
);
|
||||
if (typeof duration === "function")
|
||||
duration = duration(
|
||||
/** @type {any} */
|
||||
value,
|
||||
new_value
|
||||
);
|
||||
started = true;
|
||||
}
|
||||
if (previous_task) {
|
||||
previous_task.abort();
|
||||
previous_task = null;
|
||||
}
|
||||
const elapsed = now - start;
|
||||
if (elapsed > /** @type {number} */
|
||||
duration) {
|
||||
store.set(value = new_value);
|
||||
return false;
|
||||
}
|
||||
store.set(value = fn(easing(elapsed / duration)));
|
||||
return true;
|
||||
});
|
||||
return task.promise;
|
||||
}
|
||||
return {
|
||||
set: set2,
|
||||
update: (fn, opts) => set2(fn(
|
||||
/** @type {any} */
|
||||
target_value,
|
||||
/** @type {any} */
|
||||
value
|
||||
), opts),
|
||||
subscribe: store.subscribe
|
||||
};
|
||||
}
|
||||
var Tween = class _Tween {
|
||||
#current;
|
||||
#target;
|
||||
/** @type {TweenedOptions<T>} */
|
||||
#defaults;
|
||||
/** @type {import('../internal/client/types').Task | null} */
|
||||
#task = null;
|
||||
/**
|
||||
* @param {T} value
|
||||
* @param {TweenedOptions<T>} options
|
||||
*/
|
||||
constructor(value, options = {}) {
|
||||
this.#current = state(value);
|
||||
this.#target = state(value);
|
||||
this.#defaults = options;
|
||||
if (true_default) {
|
||||
tag(this.#current, "Tween.current");
|
||||
tag(this.#target, "Tween.target");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Create a tween whose value is bound to the return value of `fn`. This must be called
|
||||
* inside an effect root (for example, during component initialisation).
|
||||
*
|
||||
* ```svelte
|
||||
* <script>
|
||||
* import { Tween } from 'svelte/motion';
|
||||
*
|
||||
* let { number } = $props();
|
||||
*
|
||||
* const tween = Tween.of(() => number);
|
||||
* <\/script>
|
||||
* ```
|
||||
* @template U
|
||||
* @param {() => U} fn
|
||||
* @param {TweenedOptions<U>} [options]
|
||||
*/
|
||||
static of(fn, options) {
|
||||
const tween = new _Tween(fn(), options);
|
||||
render_effect(() => {
|
||||
tween.set(fn());
|
||||
});
|
||||
return tween;
|
||||
}
|
||||
/**
|
||||
* Sets `tween.target` to `value` and returns a `Promise` that resolves if and when `tween.current` catches up to it.
|
||||
*
|
||||
* If `options` are provided, they will override the tween's defaults.
|
||||
* @param {T} value
|
||||
* @param {TweenedOptions<T>} [options]
|
||||
* @returns
|
||||
*/
|
||||
set(value, options) {
|
||||
set(this.#target, value);
|
||||
let {
|
||||
delay = 0,
|
||||
duration = 400,
|
||||
easing = linear,
|
||||
interpolate = get_interpolator
|
||||
} = { ...this.#defaults, ...options };
|
||||
if (duration === 0) {
|
||||
this.#task?.abort();
|
||||
set(this.#current, value);
|
||||
return Promise.resolve();
|
||||
}
|
||||
const start = raf.now() + delay;
|
||||
let fn;
|
||||
let started = false;
|
||||
let previous_task = this.#task;
|
||||
this.#task = loop((now) => {
|
||||
if (now < start) {
|
||||
return true;
|
||||
}
|
||||
if (!started) {
|
||||
started = true;
|
||||
const prev = this.#current.v;
|
||||
fn = interpolate(prev, value);
|
||||
if (typeof duration === "function") {
|
||||
duration = duration(prev, value);
|
||||
}
|
||||
previous_task?.abort();
|
||||
}
|
||||
const elapsed = now - start;
|
||||
if (elapsed > /** @type {number} */
|
||||
duration) {
|
||||
set(this.#current, value);
|
||||
return false;
|
||||
}
|
||||
set(this.#current, fn(easing(elapsed / /** @type {number} */
|
||||
duration)));
|
||||
return true;
|
||||
});
|
||||
return this.#task.promise;
|
||||
}
|
||||
get current() {
|
||||
return get(this.#current);
|
||||
}
|
||||
get target() {
|
||||
return get(this.#target);
|
||||
}
|
||||
set target(v) {
|
||||
this.set(v);
|
||||
}
|
||||
};
|
||||
|
||||
// node_modules/svelte/src/motion/index.js
|
||||
var prefersReducedMotion = new MediaQuery(
|
||||
"(prefers-reduced-motion: reduce)"
|
||||
);
|
||||
export {
|
||||
Spring,
|
||||
Tween,
|
||||
prefersReducedMotion,
|
||||
spring,
|
||||
tweened
|
||||
};
|
||||
//# sourceMappingURL=svelte_motion.js.map
|
||||
+7
File diff suppressed because one or more lines are too long
+27
@@ -0,0 +1,27 @@
|
||||
import {
|
||||
MediaQuery,
|
||||
SvelteDate,
|
||||
SvelteMap,
|
||||
SvelteSet,
|
||||
SvelteURL,
|
||||
SvelteURLSearchParams
|
||||
} from "./chunk-GOC6LLKR.js";
|
||||
import "./chunk-6VYHLW26.js";
|
||||
import "./chunk-7RQDXF5S.js";
|
||||
import "./chunk-UW3ABHAC.js";
|
||||
import "./chunk-U7P2NEEE.js";
|
||||
import "./chunk-DL7TWQ45.js";
|
||||
import {
|
||||
createSubscriber
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
import "./chunk-VZQZA5WB.js";
|
||||
import "./chunk-OHYQYV5R.js";
|
||||
export {
|
||||
MediaQuery,
|
||||
SvelteDate,
|
||||
SvelteMap,
|
||||
SvelteSet,
|
||||
SvelteURL,
|
||||
SvelteURLSearchParams,
|
||||
createSubscriber
|
||||
};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": [],
|
||||
"sourcesContent": [],
|
||||
"mappings": "",
|
||||
"names": []
|
||||
}
|
||||
+124
@@ -0,0 +1,124 @@
|
||||
import {
|
||||
ReactiveValue
|
||||
} from "./chunk-6VYHLW26.js";
|
||||
import "./chunk-7RQDXF5S.js";
|
||||
import "./chunk-UW3ABHAC.js";
|
||||
import "./chunk-U7P2NEEE.js";
|
||||
import "./chunk-DL7TWQ45.js";
|
||||
import {
|
||||
get,
|
||||
on,
|
||||
set,
|
||||
source,
|
||||
tag
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
import {
|
||||
true_default
|
||||
} from "./chunk-VZQZA5WB.js";
|
||||
import "./chunk-OHYQYV5R.js";
|
||||
|
||||
// node_modules/svelte/src/reactivity/window/index.js
|
||||
var scrollX = new ReactiveValue(
|
||||
true_default ? () => window.scrollX : () => void 0,
|
||||
(update) => on(window, "scroll", update)
|
||||
);
|
||||
var scrollY = new ReactiveValue(
|
||||
true_default ? () => window.scrollY : () => void 0,
|
||||
(update) => on(window, "scroll", update)
|
||||
);
|
||||
var innerWidth = new ReactiveValue(
|
||||
true_default ? () => window.innerWidth : () => void 0,
|
||||
(update) => on(window, "resize", update)
|
||||
);
|
||||
var innerHeight = new ReactiveValue(
|
||||
true_default ? () => window.innerHeight : () => void 0,
|
||||
(update) => on(window, "resize", update)
|
||||
);
|
||||
var outerWidth = new ReactiveValue(
|
||||
true_default ? () => window.outerWidth : () => void 0,
|
||||
(update) => on(window, "resize", update)
|
||||
);
|
||||
var outerHeight = new ReactiveValue(
|
||||
true_default ? () => window.outerHeight : () => void 0,
|
||||
(update) => on(window, "resize", update)
|
||||
);
|
||||
var screenLeft = new ReactiveValue(
|
||||
true_default ? () => window.screenLeft : () => void 0,
|
||||
(update) => {
|
||||
let value = window.screenLeft;
|
||||
let frame = requestAnimationFrame(function check() {
|
||||
frame = requestAnimationFrame(check);
|
||||
if (value !== (value = window.screenLeft)) {
|
||||
update();
|
||||
}
|
||||
});
|
||||
return () => {
|
||||
cancelAnimationFrame(frame);
|
||||
};
|
||||
}
|
||||
);
|
||||
var screenTop = new ReactiveValue(
|
||||
true_default ? () => window.screenTop : () => void 0,
|
||||
(update) => {
|
||||
let value = window.screenTop;
|
||||
let frame = requestAnimationFrame(function check() {
|
||||
frame = requestAnimationFrame(check);
|
||||
if (value !== (value = window.screenTop)) {
|
||||
update();
|
||||
}
|
||||
});
|
||||
return () => {
|
||||
cancelAnimationFrame(frame);
|
||||
};
|
||||
}
|
||||
);
|
||||
var online = new ReactiveValue(
|
||||
true_default ? () => navigator.onLine : () => void 0,
|
||||
(update) => {
|
||||
const unsub_online = on(window, "online", update);
|
||||
const unsub_offline = on(window, "offline", update);
|
||||
return () => {
|
||||
unsub_online();
|
||||
unsub_offline();
|
||||
};
|
||||
}
|
||||
);
|
||||
var devicePixelRatio = new class DevicePixelRatio {
|
||||
#dpr = source(true_default ? window.devicePixelRatio : void 0);
|
||||
#update() {
|
||||
const off = on(
|
||||
window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),
|
||||
"change",
|
||||
() => {
|
||||
set(this.#dpr, window.devicePixelRatio);
|
||||
off();
|
||||
this.#update();
|
||||
}
|
||||
);
|
||||
}
|
||||
constructor() {
|
||||
if (true_default) {
|
||||
this.#update();
|
||||
}
|
||||
if (true_default) {
|
||||
tag(this.#dpr, "window.devicePixelRatio");
|
||||
}
|
||||
}
|
||||
get current() {
|
||||
get(this.#dpr);
|
||||
return true_default ? window.devicePixelRatio : void 0;
|
||||
}
|
||||
}();
|
||||
export {
|
||||
devicePixelRatio,
|
||||
innerHeight,
|
||||
innerWidth,
|
||||
online,
|
||||
outerHeight,
|
||||
outerWidth,
|
||||
screenLeft,
|
||||
screenTop,
|
||||
scrollX,
|
||||
scrollY
|
||||
};
|
||||
//# sourceMappingURL=svelte_reactivity_window.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/reactivity/window/index.js"],
|
||||
"sourcesContent": ["import { BROWSER, DEV } from 'esm-env';\nimport { on } from '../../events/index.js';\nimport { ReactiveValue } from '../reactive-value.js';\nimport { get } from '../../internal/client/index.js';\nimport { set, source } from '../../internal/client/reactivity/sources.js';\nimport { tag } from '../../internal/client/dev/tracing.js';\n\n/**\n * `scrollX.current` is a reactive view of `window.scrollX`. On the server it is `undefined`.\n * @since 5.11.0\n */\nexport const scrollX = new ReactiveValue(\n\tBROWSER ? () => window.scrollX : () => undefined,\n\t(update) => on(window, 'scroll', update)\n);\n\n/**\n * `scrollY.current` is a reactive view of `window.scrollY`. On the server it is `undefined`.\n * @since 5.11.0\n */\nexport const scrollY = new ReactiveValue(\n\tBROWSER ? () => window.scrollY : () => undefined,\n\t(update) => on(window, 'scroll', update)\n);\n\n/**\n * `innerWidth.current` is a reactive view of `window.innerWidth`. On the server it is `undefined`.\n * @since 5.11.0\n */\nexport const innerWidth = new ReactiveValue(\n\tBROWSER ? () => window.innerWidth : () => undefined,\n\t(update) => on(window, 'resize', update)\n);\n\n/**\n * `innerHeight.current` is a reactive view of `window.innerHeight`. On the server it is `undefined`.\n * @since 5.11.0\n */\nexport const innerHeight = new ReactiveValue(\n\tBROWSER ? () => window.innerHeight : () => undefined,\n\t(update) => on(window, 'resize', update)\n);\n\n/**\n * `outerWidth.current` is a reactive view of `window.outerWidth`. On the server it is `undefined`.\n * @since 5.11.0\n */\nexport const outerWidth = new ReactiveValue(\n\tBROWSER ? () => window.outerWidth : () => undefined,\n\t(update) => on(window, 'resize', update)\n);\n\n/**\n * `outerHeight.current` is a reactive view of `window.outerHeight`. On the server it is `undefined`.\n * @since 5.11.0\n */\nexport const outerHeight = new ReactiveValue(\n\tBROWSER ? () => window.outerHeight : () => undefined,\n\t(update) => on(window, 'resize', update)\n);\n\n/**\n * `screenLeft.current` is a reactive view of `window.screenLeft`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`.\n * @since 5.11.0\n */\nexport const screenLeft = new ReactiveValue(\n\tBROWSER ? () => window.screenLeft : () => undefined,\n\t(update) => {\n\t\tlet value = window.screenLeft;\n\n\t\tlet frame = requestAnimationFrame(function check() {\n\t\t\tframe = requestAnimationFrame(check);\n\n\t\t\tif (value !== (value = window.screenLeft)) {\n\t\t\t\tupdate();\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(frame);\n\t\t};\n\t}\n);\n\n/**\n * `screenTop.current` is a reactive view of `window.screenTop`. It is updated inside a `requestAnimationFrame` callback. On the server it is `undefined`.\n * @since 5.11.0\n */\nexport const screenTop = new ReactiveValue(\n\tBROWSER ? () => window.screenTop : () => undefined,\n\t(update) => {\n\t\tlet value = window.screenTop;\n\n\t\tlet frame = requestAnimationFrame(function check() {\n\t\t\tframe = requestAnimationFrame(check);\n\n\t\t\tif (value !== (value = window.screenTop)) {\n\t\t\t\tupdate();\n\t\t\t}\n\t\t});\n\n\t\treturn () => {\n\t\t\tcancelAnimationFrame(frame);\n\t\t};\n\t}\n);\n\n/**\n * `online.current` is a reactive view of `navigator.onLine`. On the server it is `undefined`.\n * @since 5.11.0\n */\nexport const online = new ReactiveValue(\n\tBROWSER ? () => navigator.onLine : () => undefined,\n\t(update) => {\n\t\tconst unsub_online = on(window, 'online', update);\n\t\tconst unsub_offline = on(window, 'offline', update);\n\t\treturn () => {\n\t\t\tunsub_online();\n\t\t\tunsub_offline();\n\t\t};\n\t}\n);\n\n/**\n * `devicePixelRatio.current` is a reactive view of `window.devicePixelRatio`. On the server it is `undefined`.\n * Note that behaviour differs between browsers — on Chrome it will respond to the current zoom level,\n * on Firefox and Safari it won't.\n * @type {{ get current(): number | undefined }}\n * @since 5.11.0\n */\nexport const devicePixelRatio = /* @__PURE__ */ new (class DevicePixelRatio {\n\t#dpr = source(BROWSER ? window.devicePixelRatio : undefined);\n\n\t#update() {\n\t\tconst off = on(\n\t\t\twindow.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),\n\t\t\t'change',\n\t\t\t() => {\n\t\t\t\tset(this.#dpr, window.devicePixelRatio);\n\n\t\t\t\toff();\n\t\t\t\tthis.#update();\n\t\t\t}\n\t\t);\n\t}\n\n\tconstructor() {\n\t\tif (BROWSER) {\n\t\t\tthis.#update();\n\t\t}\n\n\t\tif (DEV) {\n\t\t\ttag(this.#dpr, 'window.devicePixelRatio');\n\t\t}\n\t}\n\n\tget current() {\n\t\tget(this.#dpr);\n\t\treturn BROWSER ? window.devicePixelRatio : undefined;\n\t}\n})();\n"],
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;;;AAWO,IAAM,UAAU,IAAI;AAAA,EAC1B,eAAU,MAAM,OAAO,UAAU,MAAM;AAAA,EACvC,CAAC,WAAW,GAAG,QAAQ,UAAU,MAAM;AACxC;AAMO,IAAM,UAAU,IAAI;AAAA,EAC1B,eAAU,MAAM,OAAO,UAAU,MAAM;AAAA,EACvC,CAAC,WAAW,GAAG,QAAQ,UAAU,MAAM;AACxC;AAMO,IAAM,aAAa,IAAI;AAAA,EAC7B,eAAU,MAAM,OAAO,aAAa,MAAM;AAAA,EAC1C,CAAC,WAAW,GAAG,QAAQ,UAAU,MAAM;AACxC;AAMO,IAAM,cAAc,IAAI;AAAA,EAC9B,eAAU,MAAM,OAAO,cAAc,MAAM;AAAA,EAC3C,CAAC,WAAW,GAAG,QAAQ,UAAU,MAAM;AACxC;AAMO,IAAM,aAAa,IAAI;AAAA,EAC7B,eAAU,MAAM,OAAO,aAAa,MAAM;AAAA,EAC1C,CAAC,WAAW,GAAG,QAAQ,UAAU,MAAM;AACxC;AAMO,IAAM,cAAc,IAAI;AAAA,EAC9B,eAAU,MAAM,OAAO,cAAc,MAAM;AAAA,EAC3C,CAAC,WAAW,GAAG,QAAQ,UAAU,MAAM;AACxC;AAMO,IAAM,aAAa,IAAI;AAAA,EAC7B,eAAU,MAAM,OAAO,aAAa,MAAM;AAAA,EAC1C,CAAC,WAAW;AACX,QAAI,QAAQ,OAAO;AAEnB,QAAI,QAAQ,sBAAsB,SAAS,QAAQ;AAClD,cAAQ,sBAAsB,KAAK;AAEnC,UAAI,WAAW,QAAQ,OAAO,aAAa;AAC1C,eAAO;AAAA,MACR;AAAA,IACD,CAAC;AAED,WAAO,MAAM;AACZ,2BAAqB,KAAK;AAAA,IAC3B;AAAA,EACD;AACD;AAMO,IAAM,YAAY,IAAI;AAAA,EAC5B,eAAU,MAAM,OAAO,YAAY,MAAM;AAAA,EACzC,CAAC,WAAW;AACX,QAAI,QAAQ,OAAO;AAEnB,QAAI,QAAQ,sBAAsB,SAAS,QAAQ;AAClD,cAAQ,sBAAsB,KAAK;AAEnC,UAAI,WAAW,QAAQ,OAAO,YAAY;AACzC,eAAO;AAAA,MACR;AAAA,IACD,CAAC;AAED,WAAO,MAAM;AACZ,2BAAqB,KAAK;AAAA,IAC3B;AAAA,EACD;AACD;AAMO,IAAM,SAAS,IAAI;AAAA,EACzB,eAAU,MAAM,UAAU,SAAS,MAAM;AAAA,EACzC,CAAC,WAAW;AACX,UAAM,eAAe,GAAG,QAAQ,UAAU,MAAM;AAChD,UAAM,gBAAgB,GAAG,QAAQ,WAAW,MAAM;AAClD,WAAO,MAAM;AACZ,mBAAa;AACb,oBAAc;AAAA,IACf;AAAA,EACD;AACD;AASO,IAAM,mBAAmC,IAAK,MAAM,iBAAiB;AAAA,EAC3E,OAAO,OAAO,eAAU,OAAO,mBAAmB,MAAS;AAAA,EAE3D,UAAU;AACT,UAAM,MAAM;AAAA,MACX,OAAO,WAAW,gBAAgB,OAAO,gBAAgB,OAAO;AAAA,MAChE;AAAA,MACA,MAAM;AACL,YAAI,KAAK,MAAM,OAAO,gBAAgB;AAEtC,YAAI;AACJ,aAAK,QAAQ;AAAA,MACd;AAAA,IACD;AAAA,EACD;AAAA,EAEA,cAAc;AACb,QAAI,cAAS;AACZ,WAAK,QAAQ;AAAA,IACd;AAEA,QAAI,cAAK;AACR,UAAI,KAAK,MAAM,yBAAyB;AAAA,IACzC;AAAA,EACD;AAAA,EAEA,IAAI,UAAU;AACb,QAAI,KAAK,IAAI;AACb,WAAO,eAAU,OAAO,mBAAmB;AAAA,EAC5C;AACD,EAAG;",
|
||||
"names": []
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
import {
|
||||
derived,
|
||||
get,
|
||||
readable,
|
||||
readonly,
|
||||
writable
|
||||
} from "./chunk-UW3ABHAC.js";
|
||||
import "./chunk-U7P2NEEE.js";
|
||||
import "./chunk-DL7TWQ45.js";
|
||||
import {
|
||||
active_effect,
|
||||
active_reaction,
|
||||
createSubscriber,
|
||||
effect_root,
|
||||
effect_tracking,
|
||||
render_effect,
|
||||
set_active_effect,
|
||||
set_active_reaction
|
||||
} from "./chunk-5MWODAS5.js";
|
||||
import "./chunk-VZQZA5WB.js";
|
||||
import "./chunk-OHYQYV5R.js";
|
||||
|
||||
// node_modules/svelte/src/store/index-client.js
|
||||
function toStore(get2, set) {
|
||||
var effect = active_effect;
|
||||
var reaction = active_reaction;
|
||||
var init_value = get2();
|
||||
const store = writable(init_value, (set2) => {
|
||||
var ran = init_value !== get2();
|
||||
var teardown;
|
||||
var previous_reaction = active_reaction;
|
||||
var previous_effect = active_effect;
|
||||
set_active_reaction(reaction);
|
||||
set_active_effect(effect);
|
||||
try {
|
||||
teardown = effect_root(() => {
|
||||
render_effect(() => {
|
||||
const value = get2();
|
||||
if (ran) set2(value);
|
||||
});
|
||||
});
|
||||
} finally {
|
||||
set_active_reaction(previous_reaction);
|
||||
set_active_effect(previous_effect);
|
||||
}
|
||||
ran = true;
|
||||
return teardown;
|
||||
});
|
||||
if (set) {
|
||||
return {
|
||||
set,
|
||||
update: (fn) => set(fn(get2())),
|
||||
subscribe: store.subscribe
|
||||
};
|
||||
}
|
||||
return {
|
||||
subscribe: store.subscribe
|
||||
};
|
||||
}
|
||||
function fromStore(store) {
|
||||
let value = (
|
||||
/** @type {V} */
|
||||
void 0
|
||||
);
|
||||
const subscribe = createSubscriber((update) => {
|
||||
let ran = false;
|
||||
const unsubscribe = store.subscribe((v) => {
|
||||
value = v;
|
||||
if (ran) update();
|
||||
});
|
||||
ran = true;
|
||||
return unsubscribe;
|
||||
});
|
||||
function current() {
|
||||
if (effect_tracking()) {
|
||||
subscribe();
|
||||
return value;
|
||||
}
|
||||
return get(store);
|
||||
}
|
||||
if ("set" in store) {
|
||||
return {
|
||||
get current() {
|
||||
return current();
|
||||
},
|
||||
set current(v) {
|
||||
store.set(v);
|
||||
}
|
||||
};
|
||||
}
|
||||
return {
|
||||
get current() {
|
||||
return current();
|
||||
}
|
||||
};
|
||||
}
|
||||
export {
|
||||
derived,
|
||||
fromStore,
|
||||
get,
|
||||
readable,
|
||||
readonly,
|
||||
toStore,
|
||||
writable
|
||||
};
|
||||
//# sourceMappingURL=svelte_store.js.map
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"version": 3,
|
||||
"sources": ["../../svelte/src/store/index-client.js"],
|
||||
"sourcesContent": ["/** @import { Readable, Writable } from './public.js' */\nimport {\n\teffect_root,\n\teffect_tracking,\n\trender_effect\n} from '../internal/client/reactivity/effects.js';\nimport { get, writable } from './shared/index.js';\nimport { createSubscriber } from '../reactivity/create-subscriber.js';\nimport {\n\tactive_effect,\n\tactive_reaction,\n\tset_active_effect,\n\tset_active_reaction\n} from '../internal/client/runtime.js';\n\nexport { derived, get, readable, readonly, writable } from './shared/index.js';\n\n/**\n * @template V\n * @overload\n * @param {() => V} get\n * @param {(v: V) => void} set\n * @returns {Writable<V>}\n */\n/**\n * @template V\n * @overload\n * @param {() => V} get\n * @returns {Readable<V>}\n */\n/**\n * Create a store from a function that returns state, and (to make a writable store), an\n * optional second function that sets state.\n *\n * ```ts\n * import { toStore } from 'svelte/store';\n *\n * let count = $state(0);\n *\n * const store = toStore(() => count, (v) => (count = v));\n * ```\n * @template V\n * @param {() => V} get\n * @param {(v: V) => void} [set]\n * @returns {Writable<V> | Readable<V>}\n */\nexport function toStore(get, set) {\n\tvar effect = active_effect;\n\tvar reaction = active_reaction;\n\tvar init_value = get();\n\n\tconst store = writable(init_value, (set) => {\n\t\t// If the value has changed before we call subscribe, then\n\t\t// we need to treat the value as already having run\n\t\tvar ran = init_value !== get();\n\n\t\t// TODO do we need a different implementation on the server?\n\t\tvar teardown;\n\t\t// Apply the reaction and effect at the time of toStore being called\n\t\tvar previous_reaction = active_reaction;\n\t\tvar previous_effect = active_effect;\n\t\tset_active_reaction(reaction);\n\t\tset_active_effect(effect);\n\n\t\ttry {\n\t\t\tteardown = effect_root(() => {\n\t\t\t\trender_effect(() => {\n\t\t\t\t\tconst value = get();\n\t\t\t\t\tif (ran) set(value);\n\t\t\t\t});\n\t\t\t});\n\t\t} finally {\n\t\t\tset_active_reaction(previous_reaction);\n\t\t\tset_active_effect(previous_effect);\n\t\t}\n\n\t\tran = true;\n\n\t\treturn teardown;\n\t});\n\n\tif (set) {\n\t\treturn {\n\t\t\tset,\n\t\t\tupdate: (fn) => set(fn(get())),\n\t\t\tsubscribe: store.subscribe\n\t\t};\n\t}\n\n\treturn {\n\t\tsubscribe: store.subscribe\n\t};\n}\n\n/**\n * @template V\n * @overload\n * @param {Writable<V>} store\n * @returns {{ current: V }}\n */\n/**\n * @template V\n * @overload\n * @param {Readable<V>} store\n * @returns {{ readonly current: V }}\n */\n/**\n * Convert a store to an object with a reactive `current` property. If `store`\n * is a readable store, `current` will be a readonly property.\n *\n * ```ts\n * import { fromStore, get, writable } from 'svelte/store';\n *\n * const store = writable(0);\n *\n * const count = fromStore(store);\n *\n * count.current; // 0;\n * store.set(1);\n * count.current; // 1\n *\n * count.current += 1;\n * get(store); // 2\n * ```\n * @template V\n * @param {Writable<V> | Readable<V>} store\n */\nexport function fromStore(store) {\n\tlet value = /** @type {V} */ (undefined);\n\n\tconst subscribe = createSubscriber((update) => {\n\t\tlet ran = false;\n\n\t\tconst unsubscribe = store.subscribe((v) => {\n\t\t\tvalue = v;\n\t\t\tif (ran) update();\n\t\t});\n\n\t\tran = true;\n\n\t\treturn unsubscribe;\n\t});\n\n\tfunction current() {\n\t\tif (effect_tracking()) {\n\t\t\tsubscribe();\n\t\t\treturn value;\n\t\t}\n\n\t\treturn get(store);\n\t}\n\n\tif ('set' in store) {\n\t\treturn {\n\t\t\tget current() {\n\t\t\t\treturn current();\n\t\t\t},\n\t\t\tset current(v) {\n\t\t\t\tstore.set(v);\n\t\t\t}\n\t\t};\n\t}\n\n\treturn {\n\t\tget current() {\n\t\t\treturn current();\n\t\t}\n\t};\n}\n"],
|
||||
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AA8CO,SAAS,QAAQA,MAAK,KAAK;AACjC,MAAI,SAAS;AACb,MAAI,WAAW;AACf,MAAI,aAAaA,KAAI;AAErB,QAAM,QAAQ,SAAS,YAAY,CAACC,SAAQ;AAG3C,QAAI,MAAM,eAAeD,KAAI;AAG7B,QAAI;AAEJ,QAAI,oBAAoB;AACxB,QAAI,kBAAkB;AACtB,wBAAoB,QAAQ;AAC5B,sBAAkB,MAAM;AAExB,QAAI;AACH,iBAAW,YAAY,MAAM;AAC5B,sBAAc,MAAM;AACnB,gBAAM,QAAQA,KAAI;AAClB,cAAI,IAAK,CAAAC,KAAI,KAAK;AAAA,QACnB,CAAC;AAAA,MACF,CAAC;AAAA,IACF,UAAE;AACD,0BAAoB,iBAAiB;AACrC,wBAAkB,eAAe;AAAA,IAClC;AAEA,UAAM;AAEN,WAAO;AAAA,EACR,CAAC;AAED,MAAI,KAAK;AACR,WAAO;AAAA,MACN;AAAA,MACA,QAAQ,CAAC,OAAO,IAAI,GAAGD,KAAI,CAAC,CAAC;AAAA,MAC7B,WAAW,MAAM;AAAA,IAClB;AAAA,EACD;AAEA,SAAO;AAAA,IACN,WAAW,MAAM;AAAA,EAClB;AACD;AAmCO,SAAS,UAAU,OAAO;AAChC,MAAI;AAAA;AAAA,IAA0B;AAAA;AAE9B,QAAM,YAAY,iBAAiB,CAAC,WAAW;AAC9C,QAAI,MAAM;AAEV,UAAM,cAAc,MAAM,UAAU,CAAC,MAAM;AAC1C,cAAQ;AACR,UAAI,IAAK,QAAO;AAAA,IACjB,CAAC;AAED,UAAM;AAEN,WAAO;AAAA,EACR,CAAC;AAED,WAAS,UAAU;AAClB,QAAI,gBAAgB,GAAG;AACtB,gBAAU;AACV,aAAO;AAAA,IACR;AAEA,WAAO,IAAI,KAAK;AAAA,EACjB;AAEA,MAAI,SAAS,OAAO;AACnB,WAAO;AAAA,MACN,IAAI,UAAU;AACb,eAAO,QAAQ;AAAA,MAChB;AAAA,MACA,IAAI,QAAQ,GAAG;AACd,cAAM,IAAI,CAAC;AAAA,MACZ;AAAA,IACD;AAAA,EACD;AAEA,SAAO;AAAA,IACN,IAAI,UAAU;AACb,aAAO,QAAQ;AAAA,IAChB;AAAA,EACD;AACD;",
|
||||
"names": ["get", "set"]
|
||||
}
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
import {
|
||||
transition_slide_display,
|
||||
true_default
|
||||
} from "./chunk-VZQZA5WB.js";
|
||||
|
||||
// node_modules/svelte/src/transition/index.js
|
||||
var linear = (x) => x;
|
||||
function cubic_out(t) {
|
||||
const f = t - 1;
|
||||
return f * f * f + 1;
|
||||
}
|
||||
function cubic_in_out(t) {
|
||||
return t < 0.5 ? 4 * t * t * t : 0.5 * Math.pow(2 * t - 2, 3) + 1;
|
||||
}
|
||||
function split_css_unit(value) {
|
||||
const split = typeof value === "string" && value.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);
|
||||
return split ? [parseFloat(split[1]), split[2] || "px"] : [
|
||||
/** @type {number} */
|
||||
value,
|
||||
"px"
|
||||
];
|
||||
}
|
||||
function blur(node, { delay = 0, duration = 400, easing = cubic_in_out, amount = 5, opacity = 0 } = {}) {
|
||||
const style = getComputedStyle(node);
|
||||
const target_opacity = +style.opacity;
|
||||
const f = style.filter === "none" ? "" : style.filter;
|
||||
const od = target_opacity * (1 - opacity);
|
||||
const [value, unit] = split_css_unit(amount);
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (_t, u) => `opacity: ${target_opacity - od * u}; filter: ${f} blur(${u * value}${unit});`
|
||||
};
|
||||
}
|
||||
function fade(node, { delay = 0, duration = 400, easing = linear } = {}) {
|
||||
const o = +getComputedStyle(node).opacity;
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (t) => `opacity: ${t * o}`
|
||||
};
|
||||
}
|
||||
function fly(node, { delay = 0, duration = 400, easing = cubic_out, x = 0, y = 0, opacity = 0 } = {}) {
|
||||
const style = getComputedStyle(node);
|
||||
const target_opacity = +style.opacity;
|
||||
const transform = style.transform === "none" ? "" : style.transform;
|
||||
const od = target_opacity * (1 - opacity);
|
||||
const [x_value, x_unit] = split_css_unit(x);
|
||||
const [y_value, y_unit] = split_css_unit(y);
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (t, u) => `
|
||||
transform: ${transform} translate(${(1 - t) * x_value}${x_unit}, ${(1 - t) * y_value}${y_unit});
|
||||
opacity: ${target_opacity - od * u}`
|
||||
};
|
||||
}
|
||||
var slide_warning = false;
|
||||
function slide(node, { delay = 0, duration = 400, easing = cubic_out, axis = "y" } = {}) {
|
||||
const style = getComputedStyle(node);
|
||||
if (true_default && !slide_warning && /(contents|inline|table)/.test(style.display)) {
|
||||
slide_warning = true;
|
||||
Promise.resolve().then(() => slide_warning = false);
|
||||
transition_slide_display(style.display);
|
||||
}
|
||||
const opacity = +style.opacity;
|
||||
const primary_property = axis === "y" ? "height" : "width";
|
||||
const primary_property_value = parseFloat(style[primary_property]);
|
||||
const secondary_properties = axis === "y" ? ["top", "bottom"] : ["left", "right"];
|
||||
const capitalized_secondary_properties = secondary_properties.map(
|
||||
(e) => (
|
||||
/** @type {'Left' | 'Right' | 'Top' | 'Bottom'} */
|
||||
`${e[0].toUpperCase()}${e.slice(1)}`
|
||||
)
|
||||
);
|
||||
const padding_start_value = parseFloat(style[`padding${capitalized_secondary_properties[0]}`]);
|
||||
const padding_end_value = parseFloat(style[`padding${capitalized_secondary_properties[1]}`]);
|
||||
const margin_start_value = parseFloat(style[`margin${capitalized_secondary_properties[0]}`]);
|
||||
const margin_end_value = parseFloat(style[`margin${capitalized_secondary_properties[1]}`]);
|
||||
const border_width_start_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[0]}Width`]
|
||||
);
|
||||
const border_width_end_value = parseFloat(
|
||||
style[`border${capitalized_secondary_properties[1]}Width`]
|
||||
);
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (t) => `overflow: hidden;opacity: ${Math.min(t * 20, 1) * opacity};${primary_property}: ${t * primary_property_value}px;padding-${secondary_properties[0]}: ${t * padding_start_value}px;padding-${secondary_properties[1]}: ${t * padding_end_value}px;margin-${secondary_properties[0]}: ${t * margin_start_value}px;margin-${secondary_properties[1]}: ${t * margin_end_value}px;border-${secondary_properties[0]}-width: ${t * border_width_start_value}px;border-${secondary_properties[1]}-width: ${t * border_width_end_value}px;min-${primary_property}: 0`
|
||||
};
|
||||
}
|
||||
function scale(node, { delay = 0, duration = 400, easing = cubic_out, start = 0, opacity = 0 } = {}) {
|
||||
const style = getComputedStyle(node);
|
||||
const target_opacity = +style.opacity;
|
||||
const transform = style.transform === "none" ? "" : style.transform;
|
||||
const sd = 1 - start;
|
||||
const od = target_opacity * (1 - opacity);
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (_t, u) => `
|
||||
transform: ${transform} scale(${1 - sd * u});
|
||||
opacity: ${target_opacity - od * u}
|
||||
`
|
||||
};
|
||||
}
|
||||
function draw(node, { delay = 0, speed, duration, easing = cubic_in_out } = {}) {
|
||||
let len = node.getTotalLength();
|
||||
const style = getComputedStyle(node);
|
||||
if (style.strokeLinecap !== "butt") {
|
||||
len += parseInt(style.strokeWidth);
|
||||
}
|
||||
if (duration === void 0) {
|
||||
if (speed === void 0) {
|
||||
duration = 800;
|
||||
} else {
|
||||
duration = len / speed;
|
||||
}
|
||||
} else if (typeof duration === "function") {
|
||||
duration = duration(len);
|
||||
}
|
||||
return {
|
||||
delay,
|
||||
duration,
|
||||
easing,
|
||||
css: (_, u) => `
|
||||
stroke-dasharray: ${len};
|
||||
stroke-dashoffset: ${u * len};
|
||||
`
|
||||
};
|
||||
}
|
||||
function assign(tar, src) {
|
||||
for (const k in src) tar[k] = src[k];
|
||||
return (
|
||||
/** @type {T & S} */
|
||||
tar
|
||||
);
|
||||
}
|
||||
function crossfade({ fallback, ...defaults }) {
|
||||
const to_receive = /* @__PURE__ */ new Map();
|
||||
const to_send = /* @__PURE__ */ new Map();
|
||||
function crossfade2(from_node, node, params) {
|
||||
const {
|
||||
delay = 0,
|
||||
duration = (
|
||||
/** @param {number} d */
|
||||
(d2) => Math.sqrt(d2) * 30
|
||||
),
|
||||
easing = cubic_out
|
||||
} = assign(assign({}, defaults), params);
|
||||
const from = from_node.getBoundingClientRect();
|
||||
const to = node.getBoundingClientRect();
|
||||
const dx = from.left - to.left;
|
||||
const dy = from.top - to.top;
|
||||
const dw = from.width / to.width;
|
||||
const dh = from.height / to.height;
|
||||
const d = Math.sqrt(dx * dx + dy * dy);
|
||||
const style = getComputedStyle(node);
|
||||
const transform = style.transform === "none" ? "" : style.transform;
|
||||
const opacity = +style.opacity;
|
||||
return {
|
||||
delay,
|
||||
duration: typeof duration === "function" ? duration(d) : duration,
|
||||
easing,
|
||||
css: (t, u) => `
|
||||
opacity: ${t * opacity};
|
||||
transform-origin: top left;
|
||||
transform: ${transform} translate(${u * dx}px,${u * dy}px) scale(${t + (1 - t) * dw}, ${t + (1 - t) * dh});
|
||||
`
|
||||
};
|
||||
}
|
||||
function transition(items, counterparts, intro) {
|
||||
return (node, params) => {
|
||||
items.set(params.key, node);
|
||||
return () => {
|
||||
if (counterparts.has(params.key)) {
|
||||
const other_node = counterparts.get(params.key);
|
||||
counterparts.delete(params.key);
|
||||
return crossfade2(
|
||||
/** @type {Element} */
|
||||
other_node,
|
||||
node,
|
||||
params
|
||||
);
|
||||
}
|
||||
items.delete(params.key);
|
||||
return fallback && fallback(node, params, intro);
|
||||
};
|
||||
};
|
||||
}
|
||||
return [transition(to_send, to_receive, false), transition(to_receive, to_send, true)];
|
||||
}
|
||||
export {
|
||||
blur,
|
||||
crossfade,
|
||||
draw,
|
||||
fade,
|
||||
fly,
|
||||
scale,
|
||||
slide
|
||||
};
|
||||
//# sourceMappingURL=svelte_transition.js.map
|
||||
+7
File diff suppressed because one or more lines are too long
+3
@@ -0,0 +1,3 @@
|
||||
# esbuild
|
||||
|
||||
This is the macOS ARM 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details.
|
||||
BIN
Binary file not shown.
+20
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@esbuild/darwin-arm64",
|
||||
"version": "0.27.2",
|
||||
"description": "The macOS ARM 64-bit binary for esbuild, a JavaScript bundler.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/evanw/esbuild.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"preferUnplugged": true,
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"cpu": [
|
||||
"arm64"
|
||||
]
|
||||
}
|
||||
BIN
Binary file not shown.
+19
@@ -0,0 +1,19 @@
|
||||
Copyright 2024 Justin Ridgewell <justin@ridgewell.name>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
# @jridgewell/gen-mapping
|
||||
|
||||
> Generate source maps
|
||||
|
||||
`gen-mapping` allows you to generate a source map during transpilation or minification.
|
||||
With a source map, you're able to trace the original location in the source file, either in Chrome's
|
||||
DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping].
|
||||
|
||||
You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This
|
||||
provides the same `addMapping` and `setSourceContent` API.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install @jridgewell/gen-mapping
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```typescript
|
||||
import { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping';
|
||||
|
||||
const map = new GenMapping({
|
||||
file: 'output.js',
|
||||
sourceRoot: 'https://example.com/',
|
||||
});
|
||||
|
||||
setSourceContent(map, 'input.js', `function foo() {}`);
|
||||
|
||||
addMapping(map, {
|
||||
// Lines start at line 1, columns at column 0.
|
||||
generated: { line: 1, column: 0 },
|
||||
source: 'input.js',
|
||||
original: { line: 1, column: 0 },
|
||||
});
|
||||
|
||||
addMapping(map, {
|
||||
generated: { line: 1, column: 9 },
|
||||
source: 'input.js',
|
||||
original: { line: 1, column: 9 },
|
||||
name: 'foo',
|
||||
});
|
||||
|
||||
assert.deepEqual(toDecodedMap(map), {
|
||||
version: 3,
|
||||
file: 'output.js',
|
||||
names: ['foo'],
|
||||
sourceRoot: 'https://example.com/',
|
||||
sources: ['input.js'],
|
||||
sourcesContent: ['function foo() {}'],
|
||||
mappings: [
|
||||
[ [0, 0, 0, 0], [9, 0, 0, 9, 0] ]
|
||||
],
|
||||
});
|
||||
|
||||
assert.deepEqual(toEncodedMap(map), {
|
||||
version: 3,
|
||||
file: 'output.js',
|
||||
names: ['foo'],
|
||||
sourceRoot: 'https://example.com/',
|
||||
sources: ['input.js'],
|
||||
sourcesContent: ['function foo() {}'],
|
||||
mappings: 'AAAA,SAASA',
|
||||
});
|
||||
```
|
||||
|
||||
### Smaller Sourcemaps
|
||||
|
||||
Not everything needs to be added to a sourcemap, and needless markings can cause signficantly
|
||||
larger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will
|
||||
intelligently determine if this marking adds useful information. If not, the marking will be
|
||||
skipped.
|
||||
|
||||
```typescript
|
||||
import { maybeAddMapping } from '@jridgewell/gen-mapping';
|
||||
|
||||
const map = new GenMapping();
|
||||
|
||||
// Adding a sourceless marking at the beginning of a line isn't useful.
|
||||
maybeAddMapping(map, {
|
||||
generated: { line: 1, column: 0 },
|
||||
});
|
||||
|
||||
// Adding a new source marking is useful.
|
||||
maybeAddMapping(map, {
|
||||
generated: { line: 1, column: 0 },
|
||||
source: 'input.js',
|
||||
original: { line: 1, column: 0 },
|
||||
});
|
||||
|
||||
// But adding another marking pointing to the exact same original location isn't, even if the
|
||||
// generated column changed.
|
||||
maybeAddMapping(map, {
|
||||
generated: { line: 1, column: 9 },
|
||||
source: 'input.js',
|
||||
original: { line: 1, column: 0 },
|
||||
});
|
||||
|
||||
assert.deepEqual(toEncodedMap(map), {
|
||||
version: 3,
|
||||
names: [],
|
||||
sources: ['input.js'],
|
||||
sourcesContent: [null],
|
||||
mappings: 'AAAA',
|
||||
});
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
```
|
||||
node v18.0.0
|
||||
|
||||
amp.js.map
|
||||
Memory Usage:
|
||||
gen-mapping: addSegment 5852872 bytes
|
||||
gen-mapping: addMapping 7716042 bytes
|
||||
source-map-js 6143250 bytes
|
||||
source-map-0.6.1 6124102 bytes
|
||||
source-map-0.8.0 6121173 bytes
|
||||
Smallest memory usage is gen-mapping: addSegment
|
||||
|
||||
Adding speed:
|
||||
gen-mapping: addSegment x 441 ops/sec ±2.07% (90 runs sampled)
|
||||
gen-mapping: addMapping x 350 ops/sec ±2.40% (86 runs sampled)
|
||||
source-map-js: addMapping x 169 ops/sec ±2.42% (80 runs sampled)
|
||||
source-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled)
|
||||
source-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled)
|
||||
Fastest is gen-mapping: addSegment
|
||||
|
||||
Generate speed:
|
||||
gen-mapping: decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled)
|
||||
gen-mapping: encoded output x 663 ops/sec ±0.22% (98 runs sampled)
|
||||
source-map-js: encoded output x 197 ops/sec ±0.45% (84 runs sampled)
|
||||
source-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled)
|
||||
source-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled)
|
||||
Fastest is gen-mapping: decoded output
|
||||
|
||||
|
||||
***
|
||||
|
||||
|
||||
babel.min.js.map
|
||||
Memory Usage:
|
||||
gen-mapping: addSegment 37578063 bytes
|
||||
gen-mapping: addMapping 37212897 bytes
|
||||
source-map-js 47638527 bytes
|
||||
source-map-0.6.1 47690503 bytes
|
||||
source-map-0.8.0 47470188 bytes
|
||||
Smallest memory usage is gen-mapping: addMapping
|
||||
|
||||
Adding speed:
|
||||
gen-mapping: addSegment x 31.05 ops/sec ±8.31% (43 runs sampled)
|
||||
gen-mapping: addMapping x 29.83 ops/sec ±7.36% (51 runs sampled)
|
||||
source-map-js: addMapping x 20.73 ops/sec ±6.22% (38 runs sampled)
|
||||
source-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled)
|
||||
source-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled)
|
||||
Fastest is gen-mapping: addSegment
|
||||
|
||||
Generate speed:
|
||||
gen-mapping: decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled)
|
||||
gen-mapping: encoded output x 95.15 ops/sec ±2.98% (72 runs sampled)
|
||||
source-map-js: encoded output x 15.20 ops/sec ±7.41% (33 runs sampled)
|
||||
source-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled)
|
||||
source-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled)
|
||||
Fastest is gen-mapping: decoded output
|
||||
|
||||
|
||||
***
|
||||
|
||||
|
||||
preact.js.map
|
||||
Memory Usage:
|
||||
gen-mapping: addSegment 416247 bytes
|
||||
gen-mapping: addMapping 419824 bytes
|
||||
source-map-js 1024619 bytes
|
||||
source-map-0.6.1 1146004 bytes
|
||||
source-map-0.8.0 1113250 bytes
|
||||
Smallest memory usage is gen-mapping: addSegment
|
||||
|
||||
Adding speed:
|
||||
gen-mapping: addSegment x 13,755 ops/sec ±0.15% (98 runs sampled)
|
||||
gen-mapping: addMapping x 13,013 ops/sec ±0.11% (101 runs sampled)
|
||||
source-map-js: addMapping x 4,564 ops/sec ±0.21% (98 runs sampled)
|
||||
source-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled)
|
||||
source-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled)
|
||||
Fastest is gen-mapping: addSegment
|
||||
|
||||
Generate speed:
|
||||
gen-mapping: decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled)
|
||||
gen-mapping: encoded output x 14,368 ops/sec ±4.07% (82 runs sampled)
|
||||
source-map-js: encoded output x 5,261 ops/sec ±0.21% (99 runs sampled)
|
||||
source-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled)
|
||||
source-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled)
|
||||
Fastest is gen-mapping: decoded output
|
||||
|
||||
|
||||
***
|
||||
|
||||
|
||||
react.js.map
|
||||
Memory Usage:
|
||||
gen-mapping: addSegment 975096 bytes
|
||||
gen-mapping: addMapping 1102981 bytes
|
||||
source-map-js 2918836 bytes
|
||||
source-map-0.6.1 2885435 bytes
|
||||
source-map-0.8.0 2874336 bytes
|
||||
Smallest memory usage is gen-mapping: addSegment
|
||||
|
||||
Adding speed:
|
||||
gen-mapping: addSegment x 4,772 ops/sec ±0.15% (100 runs sampled)
|
||||
gen-mapping: addMapping x 4,456 ops/sec ±0.13% (97 runs sampled)
|
||||
source-map-js: addMapping x 1,618 ops/sec ±0.24% (97 runs sampled)
|
||||
source-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled)
|
||||
source-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled)
|
||||
Fastest is gen-mapping: addSegment
|
||||
|
||||
Generate speed:
|
||||
gen-mapping: decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled)
|
||||
gen-mapping: encoded output x 5,421 ops/sec ±1.60% (89 runs sampled)
|
||||
source-map-js: encoded output x 2,113 ops/sec ±1.81% (98 runs sampled)
|
||||
source-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled)
|
||||
source-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled)
|
||||
Fastest is gen-mapping: decoded output
|
||||
```
|
||||
|
||||
[source-map]: https://www.npmjs.com/package/source-map
|
||||
[trace-mapping]: https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping
|
||||
+292
@@ -0,0 +1,292 @@
|
||||
// src/set-array.ts
|
||||
var SetArray = class {
|
||||
constructor() {
|
||||
this._indexes = { __proto__: null };
|
||||
this.array = [];
|
||||
}
|
||||
};
|
||||
function cast(set) {
|
||||
return set;
|
||||
}
|
||||
function get(setarr, key) {
|
||||
return cast(setarr)._indexes[key];
|
||||
}
|
||||
function put(setarr, key) {
|
||||
const index = get(setarr, key);
|
||||
if (index !== void 0) return index;
|
||||
const { array, _indexes: indexes } = cast(setarr);
|
||||
const length = array.push(key);
|
||||
return indexes[key] = length - 1;
|
||||
}
|
||||
function remove(setarr, key) {
|
||||
const index = get(setarr, key);
|
||||
if (index === void 0) return;
|
||||
const { array, _indexes: indexes } = cast(setarr);
|
||||
for (let i = index + 1; i < array.length; i++) {
|
||||
const k = array[i];
|
||||
array[i - 1] = k;
|
||||
indexes[k]--;
|
||||
}
|
||||
indexes[key] = void 0;
|
||||
array.pop();
|
||||
}
|
||||
|
||||
// src/gen-mapping.ts
|
||||
import {
|
||||
encode
|
||||
} from "@jridgewell/sourcemap-codec";
|
||||
import { TraceMap, decodedMappings } from "@jridgewell/trace-mapping";
|
||||
|
||||
// src/sourcemap-segment.ts
|
||||
var COLUMN = 0;
|
||||
var SOURCES_INDEX = 1;
|
||||
var SOURCE_LINE = 2;
|
||||
var SOURCE_COLUMN = 3;
|
||||
var NAMES_INDEX = 4;
|
||||
|
||||
// src/gen-mapping.ts
|
||||
var NO_NAME = -1;
|
||||
var GenMapping = class {
|
||||
constructor({ file, sourceRoot } = {}) {
|
||||
this._names = new SetArray();
|
||||
this._sources = new SetArray();
|
||||
this._sourcesContent = [];
|
||||
this._mappings = [];
|
||||
this.file = file;
|
||||
this.sourceRoot = sourceRoot;
|
||||
this._ignoreList = new SetArray();
|
||||
}
|
||||
};
|
||||
function cast2(map) {
|
||||
return map;
|
||||
}
|
||||
function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
|
||||
return addSegmentInternal(
|
||||
false,
|
||||
map,
|
||||
genLine,
|
||||
genColumn,
|
||||
source,
|
||||
sourceLine,
|
||||
sourceColumn,
|
||||
name,
|
||||
content
|
||||
);
|
||||
}
|
||||
function addMapping(map, mapping) {
|
||||
return addMappingInternal(false, map, mapping);
|
||||
}
|
||||
var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
|
||||
return addSegmentInternal(
|
||||
true,
|
||||
map,
|
||||
genLine,
|
||||
genColumn,
|
||||
source,
|
||||
sourceLine,
|
||||
sourceColumn,
|
||||
name,
|
||||
content
|
||||
);
|
||||
};
|
||||
var maybeAddMapping = (map, mapping) => {
|
||||
return addMappingInternal(true, map, mapping);
|
||||
};
|
||||
function setSourceContent(map, source, content) {
|
||||
const {
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent
|
||||
// _originalScopes: originalScopes,
|
||||
} = cast2(map);
|
||||
const index = put(sources, source);
|
||||
sourcesContent[index] = content;
|
||||
}
|
||||
function setIgnore(map, source, ignore = true) {
|
||||
const {
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_ignoreList: ignoreList
|
||||
// _originalScopes: originalScopes,
|
||||
} = cast2(map);
|
||||
const index = put(sources, source);
|
||||
if (index === sourcesContent.length) sourcesContent[index] = null;
|
||||
if (ignore) put(ignoreList, index);
|
||||
else remove(ignoreList, index);
|
||||
}
|
||||
function toDecodedMap(map) {
|
||||
const {
|
||||
_mappings: mappings,
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_names: names,
|
||||
_ignoreList: ignoreList
|
||||
// _originalScopes: originalScopes,
|
||||
// _generatedRanges: generatedRanges,
|
||||
} = cast2(map);
|
||||
removeEmptyFinalLines(mappings);
|
||||
return {
|
||||
version: 3,
|
||||
file: map.file || void 0,
|
||||
names: names.array,
|
||||
sourceRoot: map.sourceRoot || void 0,
|
||||
sources: sources.array,
|
||||
sourcesContent,
|
||||
mappings,
|
||||
// originalScopes,
|
||||
// generatedRanges,
|
||||
ignoreList: ignoreList.array
|
||||
};
|
||||
}
|
||||
function toEncodedMap(map) {
|
||||
const decoded = toDecodedMap(map);
|
||||
return Object.assign({}, decoded, {
|
||||
// originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)),
|
||||
// generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]),
|
||||
mappings: encode(decoded.mappings)
|
||||
});
|
||||
}
|
||||
function fromMap(input) {
|
||||
const map = new TraceMap(input);
|
||||
const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
|
||||
putAll(cast2(gen)._names, map.names);
|
||||
putAll(cast2(gen)._sources, map.sources);
|
||||
cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
|
||||
cast2(gen)._mappings = decodedMappings(map);
|
||||
if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList);
|
||||
return gen;
|
||||
}
|
||||
function allMappings(map) {
|
||||
const out = [];
|
||||
const { _mappings: mappings, _sources: sources, _names: names } = cast2(map);
|
||||
for (let i = 0; i < mappings.length; i++) {
|
||||
const line = mappings[i];
|
||||
for (let j = 0; j < line.length; j++) {
|
||||
const seg = line[j];
|
||||
const generated = { line: i + 1, column: seg[COLUMN] };
|
||||
let source = void 0;
|
||||
let original = void 0;
|
||||
let name = void 0;
|
||||
if (seg.length !== 1) {
|
||||
source = sources.array[seg[SOURCES_INDEX]];
|
||||
original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };
|
||||
if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];
|
||||
}
|
||||
out.push({ generated, source, original, name });
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
|
||||
const {
|
||||
_mappings: mappings,
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_names: names
|
||||
// _originalScopes: originalScopes,
|
||||
} = cast2(map);
|
||||
const line = getIndex(mappings, genLine);
|
||||
const index = getColumnIndex(line, genColumn);
|
||||
if (!source) {
|
||||
if (skipable && skipSourceless(line, index)) return;
|
||||
return insert(line, index, [genColumn]);
|
||||
}
|
||||
assert(sourceLine);
|
||||
assert(sourceColumn);
|
||||
const sourcesIndex = put(sources, source);
|
||||
const namesIndex = name ? put(names, name) : NO_NAME;
|
||||
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
|
||||
if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
||||
return;
|
||||
}
|
||||
return insert(
|
||||
line,
|
||||
index,
|
||||
name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]
|
||||
);
|
||||
}
|
||||
function assert(_val) {
|
||||
}
|
||||
function getIndex(arr, index) {
|
||||
for (let i = arr.length; i <= index; i++) {
|
||||
arr[i] = [];
|
||||
}
|
||||
return arr[index];
|
||||
}
|
||||
function getColumnIndex(line, genColumn) {
|
||||
let index = line.length;
|
||||
for (let i = index - 1; i >= 0; index = i--) {
|
||||
const current = line[i];
|
||||
if (genColumn >= current[COLUMN]) break;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
function insert(array, index, value) {
|
||||
for (let i = array.length; i > index; i--) {
|
||||
array[i] = array[i - 1];
|
||||
}
|
||||
array[index] = value;
|
||||
}
|
||||
function removeEmptyFinalLines(mappings) {
|
||||
const { length } = mappings;
|
||||
let len = length;
|
||||
for (let i = len - 1; i >= 0; len = i, i--) {
|
||||
if (mappings[i].length > 0) break;
|
||||
}
|
||||
if (len < length) mappings.length = len;
|
||||
}
|
||||
function putAll(setarr, array) {
|
||||
for (let i = 0; i < array.length; i++) put(setarr, array[i]);
|
||||
}
|
||||
function skipSourceless(line, index) {
|
||||
if (index === 0) return true;
|
||||
const prev = line[index - 1];
|
||||
return prev.length === 1;
|
||||
}
|
||||
function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
|
||||
if (index === 0) return false;
|
||||
const prev = line[index - 1];
|
||||
if (prev.length === 1) return false;
|
||||
return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
|
||||
}
|
||||
function addMappingInternal(skipable, map, mapping) {
|
||||
const { generated, source, original, name, content } = mapping;
|
||||
if (!source) {
|
||||
return addSegmentInternal(
|
||||
skipable,
|
||||
map,
|
||||
generated.line - 1,
|
||||
generated.column,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
assert(original);
|
||||
return addSegmentInternal(
|
||||
skipable,
|
||||
map,
|
||||
generated.line - 1,
|
||||
generated.column,
|
||||
source,
|
||||
original.line - 1,
|
||||
original.column,
|
||||
name,
|
||||
content
|
||||
);
|
||||
}
|
||||
export {
|
||||
GenMapping,
|
||||
addMapping,
|
||||
addSegment,
|
||||
allMappings,
|
||||
fromMap,
|
||||
maybeAddMapping,
|
||||
maybeAddSegment,
|
||||
setIgnore,
|
||||
setSourceContent,
|
||||
toDecodedMap,
|
||||
toEncodedMap
|
||||
};
|
||||
//# sourceMappingURL=gen-mapping.mjs.map
|
||||
+6
File diff suppressed because one or more lines are too long
+358
@@ -0,0 +1,358 @@
|
||||
(function (global, factory) {
|
||||
if (typeof exports === 'object' && typeof module !== 'undefined') {
|
||||
factory(module, require('@jridgewell/sourcemap-codec'), require('@jridgewell/trace-mapping'));
|
||||
module.exports = def(module);
|
||||
} else if (typeof define === 'function' && define.amd) {
|
||||
define(['module', '@jridgewell/sourcemap-codec', '@jridgewell/trace-mapping'], function(mod) {
|
||||
factory.apply(this, arguments);
|
||||
mod.exports = def(mod);
|
||||
});
|
||||
} else {
|
||||
const mod = { exports: {} };
|
||||
factory(mod, global.sourcemapCodec, global.traceMapping);
|
||||
global = typeof globalThis !== 'undefined' ? globalThis : global || self;
|
||||
global.genMapping = def(mod);
|
||||
}
|
||||
function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; }
|
||||
})(this, (function (module, require_sourcemapCodec, require_traceMapping) {
|
||||
"use strict";
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJS = (cb, mod) => function __require() {
|
||||
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
||||
};
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// umd:@jridgewell/sourcemap-codec
|
||||
var require_sourcemap_codec = __commonJS({
|
||||
"umd:@jridgewell/sourcemap-codec"(exports, module2) {
|
||||
module2.exports = require_sourcemapCodec;
|
||||
}
|
||||
});
|
||||
|
||||
// umd:@jridgewell/trace-mapping
|
||||
var require_trace_mapping = __commonJS({
|
||||
"umd:@jridgewell/trace-mapping"(exports, module2) {
|
||||
module2.exports = require_traceMapping;
|
||||
}
|
||||
});
|
||||
|
||||
// src/gen-mapping.ts
|
||||
var gen_mapping_exports = {};
|
||||
__export(gen_mapping_exports, {
|
||||
GenMapping: () => GenMapping,
|
||||
addMapping: () => addMapping,
|
||||
addSegment: () => addSegment,
|
||||
allMappings: () => allMappings,
|
||||
fromMap: () => fromMap,
|
||||
maybeAddMapping: () => maybeAddMapping,
|
||||
maybeAddSegment: () => maybeAddSegment,
|
||||
setIgnore: () => setIgnore,
|
||||
setSourceContent: () => setSourceContent,
|
||||
toDecodedMap: () => toDecodedMap,
|
||||
toEncodedMap: () => toEncodedMap
|
||||
});
|
||||
module.exports = __toCommonJS(gen_mapping_exports);
|
||||
|
||||
// src/set-array.ts
|
||||
var SetArray = class {
|
||||
constructor() {
|
||||
this._indexes = { __proto__: null };
|
||||
this.array = [];
|
||||
}
|
||||
};
|
||||
function cast(set) {
|
||||
return set;
|
||||
}
|
||||
function get(setarr, key) {
|
||||
return cast(setarr)._indexes[key];
|
||||
}
|
||||
function put(setarr, key) {
|
||||
const index = get(setarr, key);
|
||||
if (index !== void 0) return index;
|
||||
const { array, _indexes: indexes } = cast(setarr);
|
||||
const length = array.push(key);
|
||||
return indexes[key] = length - 1;
|
||||
}
|
||||
function remove(setarr, key) {
|
||||
const index = get(setarr, key);
|
||||
if (index === void 0) return;
|
||||
const { array, _indexes: indexes } = cast(setarr);
|
||||
for (let i = index + 1; i < array.length; i++) {
|
||||
const k = array[i];
|
||||
array[i - 1] = k;
|
||||
indexes[k]--;
|
||||
}
|
||||
indexes[key] = void 0;
|
||||
array.pop();
|
||||
}
|
||||
|
||||
// src/gen-mapping.ts
|
||||
var import_sourcemap_codec = __toESM(require_sourcemap_codec());
|
||||
var import_trace_mapping = __toESM(require_trace_mapping());
|
||||
|
||||
// src/sourcemap-segment.ts
|
||||
var COLUMN = 0;
|
||||
var SOURCES_INDEX = 1;
|
||||
var SOURCE_LINE = 2;
|
||||
var SOURCE_COLUMN = 3;
|
||||
var NAMES_INDEX = 4;
|
||||
|
||||
// src/gen-mapping.ts
|
||||
var NO_NAME = -1;
|
||||
var GenMapping = class {
|
||||
constructor({ file, sourceRoot } = {}) {
|
||||
this._names = new SetArray();
|
||||
this._sources = new SetArray();
|
||||
this._sourcesContent = [];
|
||||
this._mappings = [];
|
||||
this.file = file;
|
||||
this.sourceRoot = sourceRoot;
|
||||
this._ignoreList = new SetArray();
|
||||
}
|
||||
};
|
||||
function cast2(map) {
|
||||
return map;
|
||||
}
|
||||
function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
|
||||
return addSegmentInternal(
|
||||
false,
|
||||
map,
|
||||
genLine,
|
||||
genColumn,
|
||||
source,
|
||||
sourceLine,
|
||||
sourceColumn,
|
||||
name,
|
||||
content
|
||||
);
|
||||
}
|
||||
function addMapping(map, mapping) {
|
||||
return addMappingInternal(false, map, mapping);
|
||||
}
|
||||
var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
|
||||
return addSegmentInternal(
|
||||
true,
|
||||
map,
|
||||
genLine,
|
||||
genColumn,
|
||||
source,
|
||||
sourceLine,
|
||||
sourceColumn,
|
||||
name,
|
||||
content
|
||||
);
|
||||
};
|
||||
var maybeAddMapping = (map, mapping) => {
|
||||
return addMappingInternal(true, map, mapping);
|
||||
};
|
||||
function setSourceContent(map, source, content) {
|
||||
const {
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent
|
||||
// _originalScopes: originalScopes,
|
||||
} = cast2(map);
|
||||
const index = put(sources, source);
|
||||
sourcesContent[index] = content;
|
||||
}
|
||||
function setIgnore(map, source, ignore = true) {
|
||||
const {
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_ignoreList: ignoreList
|
||||
// _originalScopes: originalScopes,
|
||||
} = cast2(map);
|
||||
const index = put(sources, source);
|
||||
if (index === sourcesContent.length) sourcesContent[index] = null;
|
||||
if (ignore) put(ignoreList, index);
|
||||
else remove(ignoreList, index);
|
||||
}
|
||||
function toDecodedMap(map) {
|
||||
const {
|
||||
_mappings: mappings,
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_names: names,
|
||||
_ignoreList: ignoreList
|
||||
// _originalScopes: originalScopes,
|
||||
// _generatedRanges: generatedRanges,
|
||||
} = cast2(map);
|
||||
removeEmptyFinalLines(mappings);
|
||||
return {
|
||||
version: 3,
|
||||
file: map.file || void 0,
|
||||
names: names.array,
|
||||
sourceRoot: map.sourceRoot || void 0,
|
||||
sources: sources.array,
|
||||
sourcesContent,
|
||||
mappings,
|
||||
// originalScopes,
|
||||
// generatedRanges,
|
||||
ignoreList: ignoreList.array
|
||||
};
|
||||
}
|
||||
function toEncodedMap(map) {
|
||||
const decoded = toDecodedMap(map);
|
||||
return Object.assign({}, decoded, {
|
||||
// originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)),
|
||||
// generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]),
|
||||
mappings: (0, import_sourcemap_codec.encode)(decoded.mappings)
|
||||
});
|
||||
}
|
||||
function fromMap(input) {
|
||||
const map = new import_trace_mapping.TraceMap(input);
|
||||
const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
|
||||
putAll(cast2(gen)._names, map.names);
|
||||
putAll(cast2(gen)._sources, map.sources);
|
||||
cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
|
||||
cast2(gen)._mappings = (0, import_trace_mapping.decodedMappings)(map);
|
||||
if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList);
|
||||
return gen;
|
||||
}
|
||||
function allMappings(map) {
|
||||
const out = [];
|
||||
const { _mappings: mappings, _sources: sources, _names: names } = cast2(map);
|
||||
for (let i = 0; i < mappings.length; i++) {
|
||||
const line = mappings[i];
|
||||
for (let j = 0; j < line.length; j++) {
|
||||
const seg = line[j];
|
||||
const generated = { line: i + 1, column: seg[COLUMN] };
|
||||
let source = void 0;
|
||||
let original = void 0;
|
||||
let name = void 0;
|
||||
if (seg.length !== 1) {
|
||||
source = sources.array[seg[SOURCES_INDEX]];
|
||||
original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };
|
||||
if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];
|
||||
}
|
||||
out.push({ generated, source, original, name });
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
|
||||
const {
|
||||
_mappings: mappings,
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_names: names
|
||||
// _originalScopes: originalScopes,
|
||||
} = cast2(map);
|
||||
const line = getIndex(mappings, genLine);
|
||||
const index = getColumnIndex(line, genColumn);
|
||||
if (!source) {
|
||||
if (skipable && skipSourceless(line, index)) return;
|
||||
return insert(line, index, [genColumn]);
|
||||
}
|
||||
assert(sourceLine);
|
||||
assert(sourceColumn);
|
||||
const sourcesIndex = put(sources, source);
|
||||
const namesIndex = name ? put(names, name) : NO_NAME;
|
||||
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
|
||||
if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
||||
return;
|
||||
}
|
||||
return insert(
|
||||
line,
|
||||
index,
|
||||
name ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] : [genColumn, sourcesIndex, sourceLine, sourceColumn]
|
||||
);
|
||||
}
|
||||
function assert(_val) {
|
||||
}
|
||||
function getIndex(arr, index) {
|
||||
for (let i = arr.length; i <= index; i++) {
|
||||
arr[i] = [];
|
||||
}
|
||||
return arr[index];
|
||||
}
|
||||
function getColumnIndex(line, genColumn) {
|
||||
let index = line.length;
|
||||
for (let i = index - 1; i >= 0; index = i--) {
|
||||
const current = line[i];
|
||||
if (genColumn >= current[COLUMN]) break;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
function insert(array, index, value) {
|
||||
for (let i = array.length; i > index; i--) {
|
||||
array[i] = array[i - 1];
|
||||
}
|
||||
array[index] = value;
|
||||
}
|
||||
function removeEmptyFinalLines(mappings) {
|
||||
const { length } = mappings;
|
||||
let len = length;
|
||||
for (let i = len - 1; i >= 0; len = i, i--) {
|
||||
if (mappings[i].length > 0) break;
|
||||
}
|
||||
if (len < length) mappings.length = len;
|
||||
}
|
||||
function putAll(setarr, array) {
|
||||
for (let i = 0; i < array.length; i++) put(setarr, array[i]);
|
||||
}
|
||||
function skipSourceless(line, index) {
|
||||
if (index === 0) return true;
|
||||
const prev = line[index - 1];
|
||||
return prev.length === 1;
|
||||
}
|
||||
function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
|
||||
if (index === 0) return false;
|
||||
const prev = line[index - 1];
|
||||
if (prev.length === 1) return false;
|
||||
return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
|
||||
}
|
||||
function addMappingInternal(skipable, map, mapping) {
|
||||
const { generated, source, original, name, content } = mapping;
|
||||
if (!source) {
|
||||
return addSegmentInternal(
|
||||
skipable,
|
||||
map,
|
||||
generated.line - 1,
|
||||
generated.column,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
}
|
||||
assert(original);
|
||||
return addSegmentInternal(
|
||||
skipable,
|
||||
map,
|
||||
generated.line - 1,
|
||||
generated.column,
|
||||
source,
|
||||
original.line - 1,
|
||||
original.column,
|
||||
name,
|
||||
content
|
||||
);
|
||||
}
|
||||
}));
|
||||
//# sourceMappingURL=gen-mapping.umd.js.map
|
||||
+6
File diff suppressed because one or more lines are too long
+88
@@ -0,0 +1,88 @@
|
||||
import type { SourceMapInput } from '@jridgewell/trace-mapping';
|
||||
import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types';
|
||||
export type { DecodedSourceMap, EncodedSourceMap, Mapping };
|
||||
export type Options = {
|
||||
file?: string | null;
|
||||
sourceRoot?: string | null;
|
||||
};
|
||||
/**
|
||||
* Provides the state to generate a sourcemap.
|
||||
*/
|
||||
export declare class GenMapping {
|
||||
private _names;
|
||||
private _sources;
|
||||
private _sourcesContent;
|
||||
private _mappings;
|
||||
private _ignoreList;
|
||||
file: string | null | undefined;
|
||||
sourceRoot: string | null | undefined;
|
||||
constructor({ file, sourceRoot }?: Options);
|
||||
}
|
||||
/**
|
||||
* A low-level API to associate a generated position with an original source position. Line and
|
||||
* column here are 0-based, unlike `addMapping`.
|
||||
*/
|
||||
export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void;
|
||||
export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void;
|
||||
export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void;
|
||||
/**
|
||||
* A high-level API to associate a generated position with an original source position. Line is
|
||||
* 1-based, but column is 0-based, due to legacy behavior in `source-map` library.
|
||||
*/
|
||||
export declare function addMapping(map: GenMapping, mapping: {
|
||||
generated: Pos;
|
||||
source?: null;
|
||||
original?: null;
|
||||
name?: null;
|
||||
content?: null;
|
||||
}): void;
|
||||
export declare function addMapping(map: GenMapping, mapping: {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name?: null;
|
||||
content?: string | null;
|
||||
}): void;
|
||||
export declare function addMapping(map: GenMapping, mapping: {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name: string;
|
||||
content?: string | null;
|
||||
}): void;
|
||||
/**
|
||||
* Same as `addSegment`, but will only add the segment if it generates useful information in the
|
||||
* resulting map. This only works correctly if segments are added **in order**, meaning you should
|
||||
* not add a segment with a lower generated line/column than one that came before.
|
||||
*/
|
||||
export declare const maybeAddSegment: typeof addSegment;
|
||||
/**
|
||||
* Same as `addMapping`, but will only add the mapping if it generates useful information in the
|
||||
* resulting map. This only works correctly if mappings are added **in order**, meaning you should
|
||||
* not add a mapping with a lower generated line/column than one that came before.
|
||||
*/
|
||||
export declare const maybeAddMapping: typeof addMapping;
|
||||
/**
|
||||
* Adds/removes the content of the source file to the source map.
|
||||
*/
|
||||
export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void;
|
||||
export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void;
|
||||
/**
|
||||
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
|
||||
* a sourcemap, or to JSON.stringify.
|
||||
*/
|
||||
export declare function toDecodedMap(map: GenMapping): DecodedSourceMap;
|
||||
/**
|
||||
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
|
||||
* a sourcemap, or to JSON.stringify.
|
||||
*/
|
||||
export declare function toEncodedMap(map: GenMapping): EncodedSourceMap;
|
||||
/**
|
||||
* Constructs a new GenMapping, using the already present mappings of the input.
|
||||
*/
|
||||
export declare function fromMap(input: SourceMapInput): GenMapping;
|
||||
/**
|
||||
* Returns an array of high-level mapping objects for every recorded segment, which could then be
|
||||
* passed to the `source-map` library.
|
||||
*/
|
||||
export declare function allMappings(map: GenMapping): Mapping[];
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
type Key = string | number | symbol;
|
||||
/**
|
||||
* SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
|
||||
* index of the `key` in the backing array.
|
||||
*
|
||||
* This is designed to allow synchronizing a second array with the contents of the backing array,
|
||||
* like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
|
||||
* and there are never duplicates.
|
||||
*/
|
||||
export declare class SetArray<T extends Key = Key> {
|
||||
private _indexes;
|
||||
array: readonly T[];
|
||||
constructor();
|
||||
}
|
||||
/**
|
||||
* Gets the index associated with `key` in the backing array, if it is already present.
|
||||
*/
|
||||
export declare function get<T extends Key>(setarr: SetArray<T>, key: T): number | undefined;
|
||||
/**
|
||||
* Puts `key` into the backing array, if it is not already present. Returns
|
||||
* the index of the `key` in the backing array.
|
||||
*/
|
||||
export declare function put<T extends Key>(setarr: SetArray<T>, key: T): number;
|
||||
/**
|
||||
* Pops the last added item out of the SetArray.
|
||||
*/
|
||||
export declare function pop<T extends Key>(setarr: SetArray<T>): void;
|
||||
/**
|
||||
* Removes the key, if it exists in the set.
|
||||
*/
|
||||
export declare function remove<T extends Key>(setarr: SetArray<T>, key: T): void;
|
||||
export {};
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
type GeneratedColumn = number;
|
||||
type SourcesIndex = number;
|
||||
type SourceLine = number;
|
||||
type SourceColumn = number;
|
||||
type NamesIndex = number;
|
||||
export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];
|
||||
export declare const COLUMN = 0;
|
||||
export declare const SOURCES_INDEX = 1;
|
||||
export declare const SOURCE_LINE = 2;
|
||||
export declare const SOURCE_COLUMN = 3;
|
||||
export declare const NAMES_INDEX = 4;
|
||||
export {};
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
import type { SourceMapSegment } from './sourcemap-segment';
|
||||
export interface SourceMapV3 {
|
||||
file?: string | null;
|
||||
names: readonly string[];
|
||||
sourceRoot?: string;
|
||||
sources: readonly (string | null)[];
|
||||
sourcesContent?: readonly (string | null)[];
|
||||
version: 3;
|
||||
ignoreList?: readonly number[];
|
||||
}
|
||||
export interface EncodedSourceMap extends SourceMapV3 {
|
||||
mappings: string;
|
||||
}
|
||||
export interface DecodedSourceMap extends SourceMapV3 {
|
||||
mappings: readonly SourceMapSegment[][];
|
||||
}
|
||||
export interface Pos {
|
||||
line: number;
|
||||
column: number;
|
||||
}
|
||||
export interface OriginalPos extends Pos {
|
||||
source: string;
|
||||
}
|
||||
export interface BindingExpressionRange {
|
||||
start: Pos;
|
||||
expression: string;
|
||||
}
|
||||
export type Mapping = {
|
||||
generated: Pos;
|
||||
source: undefined;
|
||||
original: undefined;
|
||||
name: undefined;
|
||||
} | {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name: string;
|
||||
} | {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name: undefined;
|
||||
};
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"name": "@jridgewell/gen-mapping",
|
||||
"version": "0.3.13",
|
||||
"description": "Generate source maps",
|
||||
"keywords": [
|
||||
"source",
|
||||
"map"
|
||||
],
|
||||
"main": "dist/gen-mapping.umd.js",
|
||||
"module": "dist/gen-mapping.mjs",
|
||||
"types": "types/gen-mapping.d.cts",
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
"types"
|
||||
],
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"import": {
|
||||
"types": "./types/gen-mapping.d.mts",
|
||||
"default": "./dist/gen-mapping.mjs"
|
||||
},
|
||||
"default": {
|
||||
"types": "./types/gen-mapping.d.cts",
|
||||
"default": "./dist/gen-mapping.umd.js"
|
||||
}
|
||||
},
|
||||
"./dist/gen-mapping.umd.js"
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
"benchmark": "run-s build:code benchmark:*",
|
||||
"benchmark:install": "cd benchmark && npm install",
|
||||
"benchmark:only": "node --expose-gc benchmark/index.js",
|
||||
"build": "run-s -n build:code build:types",
|
||||
"build:code": "node ../../esbuild.mjs gen-mapping.ts",
|
||||
"build:types": "run-s build:types:force build:types:emit build:types:mts",
|
||||
"build:types:force": "rimraf tsconfig.build.tsbuildinfo",
|
||||
"build:types:emit": "tsc --project tsconfig.build.json",
|
||||
"build:types:mts": "node ../../mts-types.mjs",
|
||||
"clean": "run-s -n clean:code clean:types",
|
||||
"clean:code": "tsc --build --clean tsconfig.build.json",
|
||||
"clean:types": "rimraf dist types",
|
||||
"test": "run-s -n test:types test:only test:format",
|
||||
"test:format": "prettier --check '{src,test}/**/*.ts'",
|
||||
"test:only": "mocha",
|
||||
"test:types": "eslint '{src,test}/**/*.ts'",
|
||||
"lint": "run-s -n lint:types lint:format",
|
||||
"lint:format": "npm run test:format -- --write",
|
||||
"lint:types": "npm run test:types -- --fix",
|
||||
"prepublishOnly": "npm run-s -n build test"
|
||||
},
|
||||
"homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/gen-mapping",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/jridgewell/sourcemaps.git",
|
||||
"directory": "packages/gen-mapping"
|
||||
},
|
||||
"author": "Justin Ridgewell <justin@ridgewell.name>",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/sourcemap-codec": "^1.5.0",
|
||||
"@jridgewell/trace-mapping": "^0.3.24"
|
||||
}
|
||||
}
|
||||
+614
@@ -0,0 +1,614 @@
|
||||
import { SetArray, put, remove } from './set-array';
|
||||
import {
|
||||
encode,
|
||||
// encodeGeneratedRanges,
|
||||
// encodeOriginalScopes
|
||||
} from '@jridgewell/sourcemap-codec';
|
||||
import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping';
|
||||
|
||||
import {
|
||||
COLUMN,
|
||||
SOURCES_INDEX,
|
||||
SOURCE_LINE,
|
||||
SOURCE_COLUMN,
|
||||
NAMES_INDEX,
|
||||
} from './sourcemap-segment';
|
||||
|
||||
import type { SourceMapInput } from '@jridgewell/trace-mapping';
|
||||
// import type { OriginalScope, GeneratedRange } from '@jridgewell/sourcemap-codec';
|
||||
import type { SourceMapSegment } from './sourcemap-segment';
|
||||
import type {
|
||||
DecodedSourceMap,
|
||||
EncodedSourceMap,
|
||||
Pos,
|
||||
Mapping,
|
||||
// BindingExpressionRange,
|
||||
// OriginalPos,
|
||||
// OriginalScopeInfo,
|
||||
// GeneratedRangeInfo,
|
||||
} from './types';
|
||||
|
||||
export type { DecodedSourceMap, EncodedSourceMap, Mapping };
|
||||
|
||||
export type Options = {
|
||||
file?: string | null;
|
||||
sourceRoot?: string | null;
|
||||
};
|
||||
|
||||
const NO_NAME = -1;
|
||||
|
||||
/**
|
||||
* Provides the state to generate a sourcemap.
|
||||
*/
|
||||
export class GenMapping {
|
||||
declare private _names: SetArray<string>;
|
||||
declare private _sources: SetArray<string>;
|
||||
declare private _sourcesContent: (string | null)[];
|
||||
declare private _mappings: SourceMapSegment[][];
|
||||
// private declare _originalScopes: OriginalScope[][];
|
||||
// private declare _generatedRanges: GeneratedRange[];
|
||||
declare private _ignoreList: SetArray<number>;
|
||||
declare file: string | null | undefined;
|
||||
declare sourceRoot: string | null | undefined;
|
||||
|
||||
constructor({ file, sourceRoot }: Options = {}) {
|
||||
this._names = new SetArray();
|
||||
this._sources = new SetArray();
|
||||
this._sourcesContent = [];
|
||||
this._mappings = [];
|
||||
// this._originalScopes = [];
|
||||
// this._generatedRanges = [];
|
||||
this.file = file;
|
||||
this.sourceRoot = sourceRoot;
|
||||
this._ignoreList = new SetArray();
|
||||
}
|
||||
}
|
||||
|
||||
interface PublicMap {
|
||||
_names: GenMapping['_names'];
|
||||
_sources: GenMapping['_sources'];
|
||||
_sourcesContent: GenMapping['_sourcesContent'];
|
||||
_mappings: GenMapping['_mappings'];
|
||||
// _originalScopes: GenMapping['_originalScopes'];
|
||||
// _generatedRanges: GenMapping['_generatedRanges'];
|
||||
_ignoreList: GenMapping['_ignoreList'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Typescript doesn't allow friend access to private fields, so this just casts the map into a type
|
||||
* with public access modifiers.
|
||||
*/
|
||||
function cast(map: unknown): PublicMap {
|
||||
return map as any;
|
||||
}
|
||||
|
||||
/**
|
||||
* A low-level API to associate a generated position with an original source position. Line and
|
||||
* column here are 0-based, unlike `addMapping`.
|
||||
*/
|
||||
export function addSegment(
|
||||
map: GenMapping,
|
||||
genLine: number,
|
||||
genColumn: number,
|
||||
source?: null,
|
||||
sourceLine?: null,
|
||||
sourceColumn?: null,
|
||||
name?: null,
|
||||
content?: null,
|
||||
): void;
|
||||
export function addSegment(
|
||||
map: GenMapping,
|
||||
genLine: number,
|
||||
genColumn: number,
|
||||
source: string,
|
||||
sourceLine: number,
|
||||
sourceColumn: number,
|
||||
name?: null,
|
||||
content?: string | null,
|
||||
): void;
|
||||
export function addSegment(
|
||||
map: GenMapping,
|
||||
genLine: number,
|
||||
genColumn: number,
|
||||
source: string,
|
||||
sourceLine: number,
|
||||
sourceColumn: number,
|
||||
name: string,
|
||||
content?: string | null,
|
||||
): void;
|
||||
export function addSegment(
|
||||
map: GenMapping,
|
||||
genLine: number,
|
||||
genColumn: number,
|
||||
source?: string | null,
|
||||
sourceLine?: number | null,
|
||||
sourceColumn?: number | null,
|
||||
name?: string | null,
|
||||
content?: string | null,
|
||||
): void {
|
||||
return addSegmentInternal(
|
||||
false,
|
||||
map,
|
||||
genLine,
|
||||
genColumn,
|
||||
source,
|
||||
sourceLine,
|
||||
sourceColumn,
|
||||
name,
|
||||
content,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* A high-level API to associate a generated position with an original source position. Line is
|
||||
* 1-based, but column is 0-based, due to legacy behavior in `source-map` library.
|
||||
*/
|
||||
export function addMapping(
|
||||
map: GenMapping,
|
||||
mapping: {
|
||||
generated: Pos;
|
||||
source?: null;
|
||||
original?: null;
|
||||
name?: null;
|
||||
content?: null;
|
||||
},
|
||||
): void;
|
||||
export function addMapping(
|
||||
map: GenMapping,
|
||||
mapping: {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name?: null;
|
||||
content?: string | null;
|
||||
},
|
||||
): void;
|
||||
export function addMapping(
|
||||
map: GenMapping,
|
||||
mapping: {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name: string;
|
||||
content?: string | null;
|
||||
},
|
||||
): void;
|
||||
export function addMapping(
|
||||
map: GenMapping,
|
||||
mapping: {
|
||||
generated: Pos;
|
||||
source?: string | null;
|
||||
original?: Pos | null;
|
||||
name?: string | null;
|
||||
content?: string | null;
|
||||
},
|
||||
): void {
|
||||
return addMappingInternal(false, map, mapping as Parameters<typeof addMappingInternal>[2]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as `addSegment`, but will only add the segment if it generates useful information in the
|
||||
* resulting map. This only works correctly if segments are added **in order**, meaning you should
|
||||
* not add a segment with a lower generated line/column than one that came before.
|
||||
*/
|
||||
export const maybeAddSegment: typeof addSegment = (
|
||||
map,
|
||||
genLine,
|
||||
genColumn,
|
||||
source,
|
||||
sourceLine,
|
||||
sourceColumn,
|
||||
name,
|
||||
content,
|
||||
) => {
|
||||
return addSegmentInternal(
|
||||
true,
|
||||
map,
|
||||
genLine,
|
||||
genColumn,
|
||||
source,
|
||||
sourceLine,
|
||||
sourceColumn,
|
||||
name,
|
||||
content,
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Same as `addMapping`, but will only add the mapping if it generates useful information in the
|
||||
* resulting map. This only works correctly if mappings are added **in order**, meaning you should
|
||||
* not add a mapping with a lower generated line/column than one that came before.
|
||||
*/
|
||||
export const maybeAddMapping: typeof addMapping = (map, mapping) => {
|
||||
return addMappingInternal(true, map, mapping as Parameters<typeof addMappingInternal>[2]);
|
||||
};
|
||||
|
||||
/**
|
||||
* Adds/removes the content of the source file to the source map.
|
||||
*/
|
||||
export function setSourceContent(map: GenMapping, source: string, content: string | null): void {
|
||||
const {
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
// _originalScopes: originalScopes,
|
||||
} = cast(map);
|
||||
const index = put(sources, source);
|
||||
sourcesContent[index] = content;
|
||||
// if (index === originalScopes.length) originalScopes[index] = [];
|
||||
}
|
||||
|
||||
export function setIgnore(map: GenMapping, source: string, ignore = true) {
|
||||
const {
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_ignoreList: ignoreList,
|
||||
// _originalScopes: originalScopes,
|
||||
} = cast(map);
|
||||
const index = put(sources, source);
|
||||
if (index === sourcesContent.length) sourcesContent[index] = null;
|
||||
// if (index === originalScopes.length) originalScopes[index] = [];
|
||||
if (ignore) put(ignoreList, index);
|
||||
else remove(ignoreList, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
|
||||
* a sourcemap, or to JSON.stringify.
|
||||
*/
|
||||
export function toDecodedMap(map: GenMapping): DecodedSourceMap {
|
||||
const {
|
||||
_mappings: mappings,
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_names: names,
|
||||
_ignoreList: ignoreList,
|
||||
// _originalScopes: originalScopes,
|
||||
// _generatedRanges: generatedRanges,
|
||||
} = cast(map);
|
||||
removeEmptyFinalLines(mappings);
|
||||
|
||||
return {
|
||||
version: 3,
|
||||
file: map.file || undefined,
|
||||
names: names.array,
|
||||
sourceRoot: map.sourceRoot || undefined,
|
||||
sources: sources.array,
|
||||
sourcesContent,
|
||||
mappings,
|
||||
// originalScopes,
|
||||
// generatedRanges,
|
||||
ignoreList: ignoreList.array,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
|
||||
* a sourcemap, or to JSON.stringify.
|
||||
*/
|
||||
export function toEncodedMap(map: GenMapping): EncodedSourceMap {
|
||||
const decoded = toDecodedMap(map);
|
||||
return Object.assign({}, decoded, {
|
||||
// originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)),
|
||||
// generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]),
|
||||
mappings: encode(decoded.mappings as SourceMapSegment[][]),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new GenMapping, using the already present mappings of the input.
|
||||
*/
|
||||
export function fromMap(input: SourceMapInput): GenMapping {
|
||||
const map = new TraceMap(input);
|
||||
const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot });
|
||||
|
||||
putAll(cast(gen)._names, map.names);
|
||||
putAll(cast(gen)._sources, map.sources as string[]);
|
||||
cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null);
|
||||
cast(gen)._mappings = decodedMappings(map) as GenMapping['_mappings'];
|
||||
// TODO: implement originalScopes/generatedRanges
|
||||
if (map.ignoreList) putAll(cast(gen)._ignoreList, map.ignoreList);
|
||||
|
||||
return gen;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of high-level mapping objects for every recorded segment, which could then be
|
||||
* passed to the `source-map` library.
|
||||
*/
|
||||
export function allMappings(map: GenMapping): Mapping[] {
|
||||
const out: Mapping[] = [];
|
||||
const { _mappings: mappings, _sources: sources, _names: names } = cast(map);
|
||||
|
||||
for (let i = 0; i < mappings.length; i++) {
|
||||
const line = mappings[i];
|
||||
for (let j = 0; j < line.length; j++) {
|
||||
const seg = line[j];
|
||||
|
||||
const generated = { line: i + 1, column: seg[COLUMN] };
|
||||
let source: string | undefined = undefined;
|
||||
let original: Pos | undefined = undefined;
|
||||
let name: string | undefined = undefined;
|
||||
|
||||
if (seg.length !== 1) {
|
||||
source = sources.array[seg[SOURCES_INDEX]];
|
||||
original = { line: seg[SOURCE_LINE] + 1, column: seg[SOURCE_COLUMN] };
|
||||
|
||||
if (seg.length === 5) name = names.array[seg[NAMES_INDEX]];
|
||||
}
|
||||
|
||||
out.push({ generated, source, original, name } as Mapping);
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
// This split declaration is only so that terser can elminiate the static initialization block.
|
||||
function addSegmentInternal<S extends string | null | undefined>(
|
||||
skipable: boolean,
|
||||
map: GenMapping,
|
||||
genLine: number,
|
||||
genColumn: number,
|
||||
source: S,
|
||||
sourceLine: S extends string ? number : null | undefined,
|
||||
sourceColumn: S extends string ? number : null | undefined,
|
||||
name: S extends string ? string | null | undefined : null | undefined,
|
||||
content: S extends string ? string | null | undefined : null | undefined,
|
||||
): void {
|
||||
const {
|
||||
_mappings: mappings,
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_names: names,
|
||||
// _originalScopes: originalScopes,
|
||||
} = cast(map);
|
||||
const line = getIndex(mappings, genLine);
|
||||
const index = getColumnIndex(line, genColumn);
|
||||
|
||||
if (!source) {
|
||||
if (skipable && skipSourceless(line, index)) return;
|
||||
return insert(line, index, [genColumn]);
|
||||
}
|
||||
|
||||
// Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source
|
||||
// isn't nullish.
|
||||
assert<number>(sourceLine);
|
||||
assert<number>(sourceColumn);
|
||||
|
||||
const sourcesIndex = put(sources, source);
|
||||
const namesIndex = name ? put(names, name) : NO_NAME;
|
||||
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null;
|
||||
// if (sourcesIndex === originalScopes.length) originalScopes[sourcesIndex] = [];
|
||||
|
||||
if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
|
||||
return;
|
||||
}
|
||||
|
||||
return insert(
|
||||
line,
|
||||
index,
|
||||
name
|
||||
? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
|
||||
: [genColumn, sourcesIndex, sourceLine, sourceColumn],
|
||||
);
|
||||
}
|
||||
|
||||
function assert<T>(_val: unknown): asserts _val is T {
|
||||
// noop.
|
||||
}
|
||||
|
||||
function getIndex<T>(arr: T[][], index: number): T[] {
|
||||
for (let i = arr.length; i <= index; i++) {
|
||||
arr[i] = [];
|
||||
}
|
||||
return arr[index];
|
||||
}
|
||||
|
||||
function getColumnIndex(line: SourceMapSegment[], genColumn: number): number {
|
||||
let index = line.length;
|
||||
for (let i = index - 1; i >= 0; index = i--) {
|
||||
const current = line[i];
|
||||
if (genColumn >= current[COLUMN]) break;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
function insert<T>(array: T[], index: number, value: T) {
|
||||
for (let i = array.length; i > index; i--) {
|
||||
array[i] = array[i - 1];
|
||||
}
|
||||
array[index] = value;
|
||||
}
|
||||
|
||||
function removeEmptyFinalLines(mappings: SourceMapSegment[][]) {
|
||||
const { length } = mappings;
|
||||
let len = length;
|
||||
for (let i = len - 1; i >= 0; len = i, i--) {
|
||||
if (mappings[i].length > 0) break;
|
||||
}
|
||||
if (len < length) mappings.length = len;
|
||||
}
|
||||
|
||||
function putAll<T extends string | number>(setarr: SetArray<T>, array: T[]) {
|
||||
for (let i = 0; i < array.length; i++) put(setarr, array[i]);
|
||||
}
|
||||
|
||||
function skipSourceless(line: SourceMapSegment[], index: number): boolean {
|
||||
// The start of a line is already sourceless, so adding a sourceless segment to the beginning
|
||||
// doesn't generate any useful information.
|
||||
if (index === 0) return true;
|
||||
|
||||
const prev = line[index - 1];
|
||||
// If the previous segment is also sourceless, then adding another sourceless segment doesn't
|
||||
// genrate any new information. Else, this segment will end the source/named segment and point to
|
||||
// a sourceless position, which is useful.
|
||||
return prev.length === 1;
|
||||
}
|
||||
|
||||
function skipSource(
|
||||
line: SourceMapSegment[],
|
||||
index: number,
|
||||
sourcesIndex: number,
|
||||
sourceLine: number,
|
||||
sourceColumn: number,
|
||||
namesIndex: number,
|
||||
): boolean {
|
||||
// A source/named segment at the start of a line gives position at that genColumn
|
||||
if (index === 0) return false;
|
||||
|
||||
const prev = line[index - 1];
|
||||
|
||||
// If the previous segment is sourceless, then we're transitioning to a source.
|
||||
if (prev.length === 1) return false;
|
||||
|
||||
// If the previous segment maps to the exact same source position, then this segment doesn't
|
||||
// provide any new position information.
|
||||
return (
|
||||
sourcesIndex === prev[SOURCES_INDEX] &&
|
||||
sourceLine === prev[SOURCE_LINE] &&
|
||||
sourceColumn === prev[SOURCE_COLUMN] &&
|
||||
namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME)
|
||||
);
|
||||
}
|
||||
|
||||
function addMappingInternal<S extends string | null | undefined>(
|
||||
skipable: boolean,
|
||||
map: GenMapping,
|
||||
mapping: {
|
||||
generated: Pos;
|
||||
source: S;
|
||||
original: S extends string ? Pos : null | undefined;
|
||||
name: S extends string ? string | null | undefined : null | undefined;
|
||||
content: S extends string ? string | null | undefined : null | undefined;
|
||||
},
|
||||
) {
|
||||
const { generated, source, original, name, content } = mapping;
|
||||
if (!source) {
|
||||
return addSegmentInternal(
|
||||
skipable,
|
||||
map,
|
||||
generated.line - 1,
|
||||
generated.column,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
);
|
||||
}
|
||||
assert<Pos>(original);
|
||||
return addSegmentInternal(
|
||||
skipable,
|
||||
map,
|
||||
generated.line - 1,
|
||||
generated.column,
|
||||
source as string,
|
||||
original.line - 1,
|
||||
original.column,
|
||||
name,
|
||||
content,
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
export function addOriginalScope(
|
||||
map: GenMapping,
|
||||
data: {
|
||||
start: Pos;
|
||||
end: Pos;
|
||||
source: string;
|
||||
kind: string;
|
||||
name?: string;
|
||||
variables?: string[];
|
||||
},
|
||||
): OriginalScopeInfo {
|
||||
const { start, end, source, kind, name, variables } = data;
|
||||
const {
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_originalScopes: originalScopes,
|
||||
_names: names,
|
||||
} = cast(map);
|
||||
const index = put(sources, source);
|
||||
if (index === sourcesContent.length) sourcesContent[index] = null;
|
||||
if (index === originalScopes.length) originalScopes[index] = [];
|
||||
|
||||
const kindIndex = put(names, kind);
|
||||
const scope: OriginalScope = name
|
||||
? [start.line - 1, start.column, end.line - 1, end.column, kindIndex, put(names, name)]
|
||||
: [start.line - 1, start.column, end.line - 1, end.column, kindIndex];
|
||||
if (variables) {
|
||||
scope.vars = variables.map((v) => put(names, v));
|
||||
}
|
||||
const len = originalScopes[index].push(scope);
|
||||
return [index, len - 1, variables];
|
||||
}
|
||||
*/
|
||||
|
||||
// Generated Ranges
|
||||
/*
|
||||
export function addGeneratedRange(
|
||||
map: GenMapping,
|
||||
data: {
|
||||
start: Pos;
|
||||
isScope: boolean;
|
||||
originalScope?: OriginalScopeInfo;
|
||||
callsite?: OriginalPos;
|
||||
},
|
||||
): GeneratedRangeInfo {
|
||||
const { start, isScope, originalScope, callsite } = data;
|
||||
const {
|
||||
_originalScopes: originalScopes,
|
||||
_sources: sources,
|
||||
_sourcesContent: sourcesContent,
|
||||
_generatedRanges: generatedRanges,
|
||||
} = cast(map);
|
||||
|
||||
const range: GeneratedRange = [
|
||||
start.line - 1,
|
||||
start.column,
|
||||
0,
|
||||
0,
|
||||
originalScope ? originalScope[0] : -1,
|
||||
originalScope ? originalScope[1] : -1,
|
||||
];
|
||||
if (originalScope?.[2]) {
|
||||
range.bindings = originalScope[2].map(() => [[-1]]);
|
||||
}
|
||||
if (callsite) {
|
||||
const index = put(sources, callsite.source);
|
||||
if (index === sourcesContent.length) sourcesContent[index] = null;
|
||||
if (index === originalScopes.length) originalScopes[index] = [];
|
||||
range.callsite = [index, callsite.line - 1, callsite.column];
|
||||
}
|
||||
if (isScope) range.isScope = true;
|
||||
generatedRanges.push(range);
|
||||
|
||||
return [range, originalScope?.[2]];
|
||||
}
|
||||
|
||||
export function setEndPosition(range: GeneratedRangeInfo, pos: Pos) {
|
||||
range[0][2] = pos.line - 1;
|
||||
range[0][3] = pos.column;
|
||||
}
|
||||
|
||||
export function addBinding(
|
||||
map: GenMapping,
|
||||
range: GeneratedRangeInfo,
|
||||
variable: string,
|
||||
expression: string | BindingExpressionRange,
|
||||
) {
|
||||
const { _names: names } = cast(map);
|
||||
const bindings = (range[0].bindings ||= []);
|
||||
const vars = range[1];
|
||||
|
||||
const index = vars!.indexOf(variable);
|
||||
const binding = getIndex(bindings, index);
|
||||
|
||||
if (typeof expression === 'string') binding[0] = [put(names, expression)];
|
||||
else {
|
||||
const { start } = expression;
|
||||
binding.push([put(names, expression.expression), start.line - 1, start.column]);
|
||||
}
|
||||
}
|
||||
*/
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
type Key = string | number | symbol;
|
||||
|
||||
/**
|
||||
* SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
|
||||
* index of the `key` in the backing array.
|
||||
*
|
||||
* This is designed to allow synchronizing a second array with the contents of the backing array,
|
||||
* like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
|
||||
* and there are never duplicates.
|
||||
*/
|
||||
export class SetArray<T extends Key = Key> {
|
||||
declare private _indexes: Record<T, number | undefined>;
|
||||
declare array: readonly T[];
|
||||
|
||||
constructor() {
|
||||
this._indexes = { __proto__: null } as any;
|
||||
this.array = [];
|
||||
}
|
||||
}
|
||||
|
||||
interface PublicSet<T extends Key> {
|
||||
array: T[];
|
||||
_indexes: SetArray<T>['_indexes'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Typescript doesn't allow friend access to private fields, so this just casts the set into a type
|
||||
* with public access modifiers.
|
||||
*/
|
||||
function cast<T extends Key>(set: SetArray<T>): PublicSet<T> {
|
||||
return set as any;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the index associated with `key` in the backing array, if it is already present.
|
||||
*/
|
||||
export function get<T extends Key>(setarr: SetArray<T>, key: T): number | undefined {
|
||||
return cast(setarr)._indexes[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Puts `key` into the backing array, if it is not already present. Returns
|
||||
* the index of the `key` in the backing array.
|
||||
*/
|
||||
export function put<T extends Key>(setarr: SetArray<T>, key: T): number {
|
||||
// The key may or may not be present. If it is present, it's a number.
|
||||
const index = get(setarr, key);
|
||||
if (index !== undefined) return index;
|
||||
|
||||
const { array, _indexes: indexes } = cast(setarr);
|
||||
|
||||
const length = array.push(key);
|
||||
return (indexes[key] = length - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Pops the last added item out of the SetArray.
|
||||
*/
|
||||
export function pop<T extends Key>(setarr: SetArray<T>): void {
|
||||
const { array, _indexes: indexes } = cast(setarr);
|
||||
if (array.length === 0) return;
|
||||
|
||||
const last = array.pop()!;
|
||||
indexes[last] = undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes the key, if it exists in the set.
|
||||
*/
|
||||
export function remove<T extends Key>(setarr: SetArray<T>, key: T): void {
|
||||
const index = get(setarr, key);
|
||||
if (index === undefined) return;
|
||||
|
||||
const { array, _indexes: indexes } = cast(setarr);
|
||||
for (let i = index + 1; i < array.length; i++) {
|
||||
const k = array[i];
|
||||
array[i - 1] = k;
|
||||
indexes[k]!--;
|
||||
}
|
||||
indexes[key] = undefined;
|
||||
array.pop();
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
type GeneratedColumn = number;
|
||||
type SourcesIndex = number;
|
||||
type SourceLine = number;
|
||||
type SourceColumn = number;
|
||||
type NamesIndex = number;
|
||||
|
||||
export type SourceMapSegment =
|
||||
| [GeneratedColumn]
|
||||
| [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn]
|
||||
| [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];
|
||||
|
||||
export const COLUMN = 0;
|
||||
export const SOURCES_INDEX = 1;
|
||||
export const SOURCE_LINE = 2;
|
||||
export const SOURCE_COLUMN = 3;
|
||||
export const NAMES_INDEX = 4;
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
// import type { GeneratedRange, OriginalScope } from '@jridgewell/sourcemap-codec';
|
||||
import type { SourceMapSegment } from './sourcemap-segment';
|
||||
|
||||
export interface SourceMapV3 {
|
||||
file?: string | null;
|
||||
names: readonly string[];
|
||||
sourceRoot?: string;
|
||||
sources: readonly (string | null)[];
|
||||
sourcesContent?: readonly (string | null)[];
|
||||
version: 3;
|
||||
ignoreList?: readonly number[];
|
||||
}
|
||||
|
||||
export interface EncodedSourceMap extends SourceMapV3 {
|
||||
mappings: string;
|
||||
// originalScopes: string[];
|
||||
// generatedRanges: string;
|
||||
}
|
||||
|
||||
export interface DecodedSourceMap extends SourceMapV3 {
|
||||
mappings: readonly SourceMapSegment[][];
|
||||
// originalScopes: readonly OriginalScope[][];
|
||||
// generatedRanges: readonly GeneratedRange[];
|
||||
}
|
||||
|
||||
export interface Pos {
|
||||
line: number; // 1-based
|
||||
column: number; // 0-based
|
||||
}
|
||||
|
||||
export interface OriginalPos extends Pos {
|
||||
source: string;
|
||||
}
|
||||
|
||||
export interface BindingExpressionRange {
|
||||
start: Pos;
|
||||
expression: string;
|
||||
}
|
||||
|
||||
// export type OriginalScopeInfo = [number, number, string[] | undefined];
|
||||
// export type GeneratedRangeInfo = [GeneratedRange, string[] | undefined];
|
||||
|
||||
export type Mapping =
|
||||
| {
|
||||
generated: Pos;
|
||||
source: undefined;
|
||||
original: undefined;
|
||||
name: undefined;
|
||||
}
|
||||
| {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name: string;
|
||||
}
|
||||
| {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name: undefined;
|
||||
};
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
import type { SourceMapInput } from '@jridgewell/trace-mapping';
|
||||
import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.cts';
|
||||
export type { DecodedSourceMap, EncodedSourceMap, Mapping };
|
||||
export type Options = {
|
||||
file?: string | null;
|
||||
sourceRoot?: string | null;
|
||||
};
|
||||
/**
|
||||
* Provides the state to generate a sourcemap.
|
||||
*/
|
||||
export declare class GenMapping {
|
||||
private _names;
|
||||
private _sources;
|
||||
private _sourcesContent;
|
||||
private _mappings;
|
||||
private _ignoreList;
|
||||
file: string | null | undefined;
|
||||
sourceRoot: string | null | undefined;
|
||||
constructor({ file, sourceRoot }?: Options);
|
||||
}
|
||||
/**
|
||||
* A low-level API to associate a generated position with an original source position. Line and
|
||||
* column here are 0-based, unlike `addMapping`.
|
||||
*/
|
||||
export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void;
|
||||
export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void;
|
||||
export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void;
|
||||
/**
|
||||
* A high-level API to associate a generated position with an original source position. Line is
|
||||
* 1-based, but column is 0-based, due to legacy behavior in `source-map` library.
|
||||
*/
|
||||
export declare function addMapping(map: GenMapping, mapping: {
|
||||
generated: Pos;
|
||||
source?: null;
|
||||
original?: null;
|
||||
name?: null;
|
||||
content?: null;
|
||||
}): void;
|
||||
export declare function addMapping(map: GenMapping, mapping: {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name?: null;
|
||||
content?: string | null;
|
||||
}): void;
|
||||
export declare function addMapping(map: GenMapping, mapping: {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name: string;
|
||||
content?: string | null;
|
||||
}): void;
|
||||
/**
|
||||
* Same as `addSegment`, but will only add the segment if it generates useful information in the
|
||||
* resulting map. This only works correctly if segments are added **in order**, meaning you should
|
||||
* not add a segment with a lower generated line/column than one that came before.
|
||||
*/
|
||||
export declare const maybeAddSegment: typeof addSegment;
|
||||
/**
|
||||
* Same as `addMapping`, but will only add the mapping if it generates useful information in the
|
||||
* resulting map. This only works correctly if mappings are added **in order**, meaning you should
|
||||
* not add a mapping with a lower generated line/column than one that came before.
|
||||
*/
|
||||
export declare const maybeAddMapping: typeof addMapping;
|
||||
/**
|
||||
* Adds/removes the content of the source file to the source map.
|
||||
*/
|
||||
export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void;
|
||||
export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void;
|
||||
/**
|
||||
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
|
||||
* a sourcemap, or to JSON.stringify.
|
||||
*/
|
||||
export declare function toDecodedMap(map: GenMapping): DecodedSourceMap;
|
||||
/**
|
||||
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
|
||||
* a sourcemap, or to JSON.stringify.
|
||||
*/
|
||||
export declare function toEncodedMap(map: GenMapping): EncodedSourceMap;
|
||||
/**
|
||||
* Constructs a new GenMapping, using the already present mappings of the input.
|
||||
*/
|
||||
export declare function fromMap(input: SourceMapInput): GenMapping;
|
||||
/**
|
||||
* Returns an array of high-level mapping objects for every recorded segment, which could then be
|
||||
* passed to the `source-map` library.
|
||||
*/
|
||||
export declare function allMappings(map: GenMapping): Mapping[];
|
||||
//# sourceMappingURL=gen-mapping.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AAwBR;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AAcR;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAqBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
import type { SourceMapInput } from '@jridgewell/trace-mapping';
|
||||
import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.mts';
|
||||
export type { DecodedSourceMap, EncodedSourceMap, Mapping };
|
||||
export type Options = {
|
||||
file?: string | null;
|
||||
sourceRoot?: string | null;
|
||||
};
|
||||
/**
|
||||
* Provides the state to generate a sourcemap.
|
||||
*/
|
||||
export declare class GenMapping {
|
||||
private _names;
|
||||
private _sources;
|
||||
private _sourcesContent;
|
||||
private _mappings;
|
||||
private _ignoreList;
|
||||
file: string | null | undefined;
|
||||
sourceRoot: string | null | undefined;
|
||||
constructor({ file, sourceRoot }?: Options);
|
||||
}
|
||||
/**
|
||||
* A low-level API to associate a generated position with an original source position. Line and
|
||||
* column here are 0-based, unlike `addMapping`.
|
||||
*/
|
||||
export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void;
|
||||
export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void;
|
||||
export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name: string, content?: string | null): void;
|
||||
/**
|
||||
* A high-level API to associate a generated position with an original source position. Line is
|
||||
* 1-based, but column is 0-based, due to legacy behavior in `source-map` library.
|
||||
*/
|
||||
export declare function addMapping(map: GenMapping, mapping: {
|
||||
generated: Pos;
|
||||
source?: null;
|
||||
original?: null;
|
||||
name?: null;
|
||||
content?: null;
|
||||
}): void;
|
||||
export declare function addMapping(map: GenMapping, mapping: {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name?: null;
|
||||
content?: string | null;
|
||||
}): void;
|
||||
export declare function addMapping(map: GenMapping, mapping: {
|
||||
generated: Pos;
|
||||
source: string;
|
||||
original: Pos;
|
||||
name: string;
|
||||
content?: string | null;
|
||||
}): void;
|
||||
/**
|
||||
* Same as `addSegment`, but will only add the segment if it generates useful information in the
|
||||
* resulting map. This only works correctly if segments are added **in order**, meaning you should
|
||||
* not add a segment with a lower generated line/column than one that came before.
|
||||
*/
|
||||
export declare const maybeAddSegment: typeof addSegment;
|
||||
/**
|
||||
* Same as `addMapping`, but will only add the mapping if it generates useful information in the
|
||||
* resulting map. This only works correctly if mappings are added **in order**, meaning you should
|
||||
* not add a mapping with a lower generated line/column than one that came before.
|
||||
*/
|
||||
export declare const maybeAddMapping: typeof addMapping;
|
||||
/**
|
||||
* Adds/removes the content of the source file to the source map.
|
||||
*/
|
||||
export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void;
|
||||
export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void;
|
||||
/**
|
||||
* Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
|
||||
* a sourcemap, or to JSON.stringify.
|
||||
*/
|
||||
export declare function toDecodedMap(map: GenMapping): DecodedSourceMap;
|
||||
/**
|
||||
* Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
|
||||
* a sourcemap, or to JSON.stringify.
|
||||
*/
|
||||
export declare function toEncodedMap(map: GenMapping): EncodedSourceMap;
|
||||
/**
|
||||
* Constructs a new GenMapping, using the already present mappings of the input.
|
||||
*/
|
||||
export declare function fromMap(input: SourceMapInput): GenMapping;
|
||||
/**
|
||||
* Returns an array of high-level mapping objects for every recorded segment, which could then be
|
||||
* passed to the `source-map` library.
|
||||
*/
|
||||
export declare function allMappings(map: GenMapping): Mapping[];
|
||||
//# sourceMappingURL=gen-mapping.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AAwBR;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AAcR;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAqBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
type Key = string | number | symbol;
|
||||
/**
|
||||
* SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
|
||||
* index of the `key` in the backing array.
|
||||
*
|
||||
* This is designed to allow synchronizing a second array with the contents of the backing array,
|
||||
* like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
|
||||
* and there are never duplicates.
|
||||
*/
|
||||
export declare class SetArray<T extends Key = Key> {
|
||||
private _indexes;
|
||||
array: readonly T[];
|
||||
constructor();
|
||||
}
|
||||
/**
|
||||
* Gets the index associated with `key` in the backing array, if it is already present.
|
||||
*/
|
||||
export declare function get<T extends Key>(setarr: SetArray<T>, key: T): number | undefined;
|
||||
/**
|
||||
* Puts `key` into the backing array, if it is not already present. Returns
|
||||
* the index of the `key` in the backing array.
|
||||
*/
|
||||
export declare function put<T extends Key>(setarr: SetArray<T>, key: T): number;
|
||||
/**
|
||||
* Pops the last added item out of the SetArray.
|
||||
*/
|
||||
export declare function pop<T extends Key>(setarr: SetArray<T>): void;
|
||||
/**
|
||||
* Removes the key, if it exists in the set.
|
||||
*/
|
||||
export declare function remove<T extends Key>(setarr: SetArray<T>, key: T): void;
|
||||
export {};
|
||||
//# sourceMappingURL=set-array.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
type Key = string | number | symbol;
|
||||
/**
|
||||
* SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
|
||||
* index of the `key` in the backing array.
|
||||
*
|
||||
* This is designed to allow synchronizing a second array with the contents of the backing array,
|
||||
* like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
|
||||
* and there are never duplicates.
|
||||
*/
|
||||
export declare class SetArray<T extends Key = Key> {
|
||||
private _indexes;
|
||||
array: readonly T[];
|
||||
constructor();
|
||||
}
|
||||
/**
|
||||
* Gets the index associated with `key` in the backing array, if it is already present.
|
||||
*/
|
||||
export declare function get<T extends Key>(setarr: SetArray<T>, key: T): number | undefined;
|
||||
/**
|
||||
* Puts `key` into the backing array, if it is not already present. Returns
|
||||
* the index of the `key` in the backing array.
|
||||
*/
|
||||
export declare function put<T extends Key>(setarr: SetArray<T>, key: T): number;
|
||||
/**
|
||||
* Pops the last added item out of the SetArray.
|
||||
*/
|
||||
export declare function pop<T extends Key>(setarr: SetArray<T>): void;
|
||||
/**
|
||||
* Removes the key, if it exists in the set.
|
||||
*/
|
||||
export declare function remove<T extends Key>(setarr: SetArray<T>, key: T): void;
|
||||
export {};
|
||||
//# sourceMappingURL=set-array.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
type GeneratedColumn = number;
|
||||
type SourcesIndex = number;
|
||||
type SourceLine = number;
|
||||
type SourceColumn = number;
|
||||
type NamesIndex = number;
|
||||
export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];
|
||||
export declare const COLUMN = 0;
|
||||
export declare const SOURCES_INDEX = 1;
|
||||
export declare const SOURCE_LINE = 2;
|
||||
export declare const SOURCE_COLUMN = 3;
|
||||
export declare const NAMES_INDEX = 4;
|
||||
export {};
|
||||
//# sourceMappingURL=sourcemap-segment.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
type GeneratedColumn = number;
|
||||
type SourcesIndex = number;
|
||||
type SourceLine = number;
|
||||
type SourceColumn = number;
|
||||
type NamesIndex = number;
|
||||
export type SourceMapSegment = [GeneratedColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex];
|
||||
export declare const COLUMN = 0;
|
||||
export declare const SOURCES_INDEX = 1;
|
||||
export declare const SOURCE_LINE = 2;
|
||||
export declare const SOURCE_COLUMN = 3;
|
||||
export declare const NAMES_INDEX = 4;
|
||||
export {};
|
||||
//# sourceMappingURL=sourcemap-segment.d.ts.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user