diff --git a/.gitignore b/.gitignore index c284ca24b..6f8bafc5f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ /lib/ /bin/ /.shards/ -.vscode \ No newline at end of file +.vscode +node_modules +coverage diff --git a/.tool-versions b/.tool-versions index 1868f63d6..7b43fac36 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,4 @@ -crystal 1.9.1 +crystal 1.10.1 mint 0.19.0 +nodejs 20.10.0 +yarn 1.22.19 diff --git a/Makefile b/Makefile index e04ddb5ef..a559599c7 100644 --- a/Makefile +++ b/Makefile @@ -37,6 +37,17 @@ local: build documentation: rm -rf docs && crystal docs -# This builds the binary and depends on files in "src" and "core" directories. -bin/mint: $(shell find src -type f) $(shell find core/source -type f) +src/assets/runtime.js: $(shell find runtime/src -type f) + cd runtime && make index + +src/assets/runtime_test.js: $(shell find runtime/src -type f) + cd runtime && make index_testing + +# This builds the binary and depends on files in some directories. +bin/mint: \ + $(shell find core/source -type f) \ + $(shell find runtime/src -type f) \ + $(shell find src -type f) \ + src/assets/runtime_test.js \ + src/assets/runtime.js shards build --error-on-warnings --error-trace --progress diff --git a/core/source/Array.mint b/core/source/Array.mint index 3d44fbd7d..b8e7078df 100644 --- a/core/source/Array.mint +++ b/core/source/Array.mint @@ -8,10 +8,7 @@ module Array { Array.any([1, 3], (number : Number) : Bool { number % 2 == 0 }) == false */ fun any (array : Array(item), function : Function(item, Bool)) : Bool { - case Array.find(array, function) { - Maybe.Nothing => false - Maybe.Just => true - } + Array.find(array, function) != Maybe.Nothing } /* @@ -20,7 +17,7 @@ module Array { Array.append([1, 1, 2] [3, 5, 8]) == [1, 1, 2, 3, 5, 8] */ fun append (array1 : Array(item), array2 : Array(item)) : Array(item) { - `[].concat(#{array1}).concat(#{array2})` + `[...#{array1}, ...#{array2}]` } /* @@ -70,7 +67,7 @@ module Array { ` (() => { for (let item of #{array}) { - if (_compare(#{other}, item)) { + if (#{%compare%}(#{other}, item)) { return true } } @@ -98,7 +95,7 @@ module Array { ` (() => { if (#{index} < 0 || #{index} >= #{array}.length) { return #{array} } - const result = Array.from(#{array}) + const result = [...#{array}] result.splice(#{index}, 1) return result })() @@ -273,7 +270,7 @@ module Array { ` (() => { for (let index = 0; index < #{array}.length; index++) { - if (_compare(#{value}, #{method}(#{array}[index]))) { + if (#{%compare%}(#{value}, #{method}(#{array}[index]))) { return index } } diff --git a/core/source/Html.Portals.Body.mint b/core/source/Html.Portals.Body.mint index 0ce197ad6..65399eaa2 100644 --- a/core/source/Html.Portals.Body.mint +++ b/core/source/Html.Portals.Body.mint @@ -5,6 +5,6 @@ component Html.Portals.Body { /* Renders the children into the document's body. */ fun render : Html { - `_createPortal(#{children}, document.body)` + `#{%createPortal%}(#{children}, document.body)` } } diff --git a/core/source/Html.Portals.Head.mint b/core/source/Html.Portals.Head.mint index 478bfdedb..c3e427a05 100644 --- a/core/source/Html.Portals.Head.mint +++ b/core/source/Html.Portals.Head.mint @@ -5,6 +5,6 @@ component Html.Portals.Head { /* Renders the children into the document's head. */ fun render : Html { - `_createPortal(#{children}, document.head)` + `#{%createPortal%}(#{children}, document.head)` } } diff --git a/core/source/Http.mint b/core/source/Http.mint index 45a23cf80..471b3cf11 100644 --- a/core/source/Http.mint +++ b/core/source/Http.mint @@ -72,6 +72,8 @@ case (request) { ``` */ module Http { + const REQUESTS = `{}` + /* Aborts all running requests. @@ -79,9 +81,9 @@ module Http { */ fun abortAll : Void { ` - this._requests && Object.keys(this._requests).forEach((uid) => { - this._requests[uid].abort() - delete this._requests[uid] + #{REQUESTS} && Object.keys(#{REQUESTS}).forEach((uid) => { + #{REQUESTS}[uid].abort() + delete #{REQUESTS}[uid] }) ` } @@ -245,11 +247,6 @@ module Http { |> url(urlValue) } - /* Returns all running requests. */ - fun requests : Map(String, Http.NativeRequest) { - `this._requests` - } - /* Sends the request with a unique ID (generated by default) so it could be aborted later. @@ -263,11 +260,9 @@ module Http { ) : Promise(Result(Http.ErrorResponse, Http.Response)) { ` new Promise((resolve, reject) => { - if (!this._requests) { this._requests = {} } - let xhr = new XMLHttpRequest() - this._requests[#{uid}] = xhr + #{REQUESTS}[#{uid}] = xhr xhr.withCredentials = #{request.withCredentials} xhr.responseType = "blob" @@ -286,7 +281,7 @@ module Http { try { xhr.open(#{request.method}.toUpperCase(), #{request.url}, true) } catch (error) { - delete this._requests[#{uid}] + delete #{REQUESTS}[#{uid}] resolve(#{Result::Err({ headers: `getResponseHeaders()`, @@ -301,7 +296,7 @@ module Http { }) xhr.addEventListener('error', (event) => { - delete this._requests[#{uid}] + delete #{REQUESTS}[#{uid}] resolve(#{Result::Err({ headers: `getResponseHeaders()`, @@ -312,7 +307,7 @@ module Http { }) xhr.addEventListener('timeout', (event) => { - delete this._requests[#{uid}] + delete #{REQUESTS}[#{uid}] resolve(#{Result::Err({ headers: `getResponseHeaders()`, @@ -323,7 +318,7 @@ module Http { }) xhr.addEventListener('load', async (event) => { - delete this._requests[#{uid}] + delete #{REQUESTS}[#{uid}] let contentType = xhr.getResponseHeader("Content-Type"); let responseText = await xhr.response.text(); @@ -377,7 +372,7 @@ module Http { }) xhr.addEventListener('abort', (event) => { - delete this._requests[#{uid}] + delete #{REQUESTS}[#{uid}] resolve(#{Result::Err({ headers: `getResponseHeaders()`, diff --git a/core/source/Locale.mint b/core/source/Locale.mint index 4942067ab..82763baed 100644 --- a/core/source/Locale.mint +++ b/core/source/Locale.mint @@ -1,15 +1,15 @@ module Locale { /* Sets the current locale. */ fun set (locale : String) : Bool { - `_L.set(#{locale})` + `#{%setLocale%}(#{locale})` } /* Returns the current locale. */ fun get : Maybe(String) { ` (() => { - if (_L.locale) { - return #{Maybe::Just(`_L.locale`)} + if (#{%locale%}) { + return #{Maybe::Just(`#{%locale%}`)} } else { return #{Maybe::Nothing} } diff --git a/core/source/Map.mint b/core/source/Map.mint index b036341b2..d6fa374e2 100644 --- a/core/source/Map.mint +++ b/core/source/Map.mint @@ -248,7 +248,7 @@ module Map { let set = false for (let item of #{map}) { - if (_compare(item[0], #{key})) { + if (#{%compare%}(item[0], #{key})) { set = true result.push([#{key}, #{value}]) } else { diff --git a/core/source/Object/Decode.mint b/core/source/Object/Decode.mint index 85649fcf2..3657f3c5c 100644 --- a/core/source/Object/Decode.mint +++ b/core/source/Object/Decode.mint @@ -9,7 +9,7 @@ module Object.Decode { input : Object, decoder : Function(Object, Result(Object.Error, a)) ) : Result(Object.Error, Array(a)) { - `Decoder.array(#{decoder})(#{input})` + `#{%decodeArray%}(#{decoder}, #{%ok%}, #{%err%})(#{input})` } /* @@ -18,7 +18,7 @@ module Object.Decode { Object.Decode.boolean(`true`) == Result::Ok(true) */ fun boolean (input : Object) : Result(Object.Error, Bool) { - `Decoder.boolean(#{input})` + `#{%decodeBoolean%}(#{%ok%}, #{%err%})(#{input})` } /* @@ -32,7 +32,7 @@ module Object.Decode { key : String, decoder : Function(Object, Result(Object.Error, a)) ) : Result(Object.Error, a) { - `Decoder.field(#{key}, #{decoder})(#{input})` + `#{%decodeField%}(#{key}, #{decoder}, #{%err%})(#{input})` } /* @@ -45,7 +45,7 @@ module Object.Decode { input : Object, decoder : Function(Object, Result(Object.Error, a)) ) : Result(Object.Error, Maybe(a)) { - `Decoder.maybe(#{decoder})(#{input})` + `#{%decodeMaybe%}(#{decoder}, #{%ok%}, #{%err%}, #{%just%}, #{%nothing%})(#{input})` } /* @@ -54,7 +54,7 @@ module Object.Decode { Object.Decode.number(`0`) == Result::Ok(0) */ fun number (input : Object) : Result(Object.Error, Number) { - `Decoder.number(#{input})` + `#{%decodeNumber%}(#{%ok%}, #{%err%})(#{input})` } /* @@ -63,7 +63,7 @@ module Object.Decode { Object.Decode.string(`"A"`) == Result::Ok("A") */ fun string (input : Object) : Result(Object.Error, String) { - `Decoder.string(#{input})` + `#{%decodeString%}(#{%ok%}, #{%err%})(#{input})` } /* @@ -72,6 +72,6 @@ module Object.Decode { Object.Decode.time(`"new Date()"`) */ fun time (input : Object) : Result(Object.Error, Time) { - `Decoder.time(#{input})` + `#{%decodeTime%}(#{%ok%}, #{%err%})(#{input})` } } diff --git a/core/source/Set.mint b/core/source/Set.mint index b450435c4..d18e02285 100644 --- a/core/source/Set.mint +++ b/core/source/Set.mint @@ -32,7 +32,7 @@ module Set { const newSet = [] #{set}.forEach((item) => { - if (_compare(item, #{value})) { return } + if (#{%compare%}(item, #{value})) { return } newSet.push(item) }) @@ -67,7 +67,7 @@ module Set { ` (() => { for (let item of #{set}) { - if (_compare(item, #{value})) { + if (#{%compare%}(item, #{value})) { return true } } diff --git a/core/source/Test/Context.mint b/core/source/Test/Context.mint index 9be664d8e..d6371fdd5 100644 --- a/core/source/Test/Context.mint +++ b/core/source/Test/Context.mint @@ -11,7 +11,7 @@ module Test.Context { fun assertEqual (context : Test.Context(a), value : a) : Test.Context(a) { ` #{context}.step((subject) => { - if (!_compare(#{value}, subject)) { + if (!#{%compare%}(#{value}, subject)) { throw \`Assertion failed: ${#{value}} === ${subject}\` } return subject @@ -61,7 +61,7 @@ module Test.Context { #{context}.step((subject) => { const actual = #{method}(subject) - if (!_compare(#{value}, actual)) { + if (!#{%compare%}(#{value}, actual)) { throw \`Assertion failed: ${actual} === ${#{value}}\` } return subject @@ -69,6 +69,29 @@ module Test.Context { ` } + /* + Asserts if the given value equals of the returned value from the given + function. + + test { + Test.Context.of(5) + |> Test.Context.assertOf("5", Number.toString) + } + */ + fun assert ( + context : Test.Context(a), + method : Function(a, bool) + ) : Test.Context(a) { + ` + #{context}.step((subject) => { + if (!#{method}(subject)) { + throw \`Assertion failed!\` + } + return subject + }) + ` + } + /* Maps the given subject to a new subject. @@ -90,7 +113,7 @@ module Test.Context { } */ fun of (a : a) : Test.Context(a) { - `new TestContext(#{a})` + `new #{%testContext%}(#{a})` } /* Spies on the given entity if it's a function. */ diff --git a/core/source/Test/Html.mint b/core/source/Test/Html.mint index 6dff3b299..8e23eeca4 100644 --- a/core/source/Test/Html.mint +++ b/core/source/Test/Html.mint @@ -6,17 +6,17 @@ module Test.Html { Test.Html.start(
<{ "Content" }>
) */ fun start (node : Html) : Test.Context(Dom.Element) { - ` + (` (() => { const root = document.createElement("div") document.body.appendChild(root) - ReactDOM.render(#{node}, root) - return new TestContext(root, () => { - ReactDOM.unmountComponentAtNode(root) + #{%testRender%}(#{node}, root) + return new #{%testContext%}(root, () => { document.body.removeChild(root) }) })() - ` + ` as Test.Context(Dom.Element)) + |> Test.Context.timeout(0) } fun find ( diff --git a/core/source/Url.mint b/core/source/Url.mint index d0fdb2bad..edc225c99 100644 --- a/core/source/Url.mint +++ b/core/source/Url.mint @@ -38,6 +38,8 @@ module Url { ` } + const ANCHOR = Dom.createElement("a") + /* Parses the given string as an `Url`. @@ -46,21 +48,17 @@ module Url { fun parse (url : String) : Url { ` (() => { - if (!this._a) { - this._a = document.createElement('a') - } - - this._a.href = #{url} + #{ANCHOR}.href = #{url} return #{{ - hostname: `this._a.hostname || ""`, - protocol: `this._a.protocol || ""`, - origin: `this._a.origin || ""`, - path: `this._a.pathname || ""`, - search: `this._a.search || ""`, - hash: `this._a.hash || ""`, - host: `this._a.host || ""`, - port: `this._a.port || ""` + hostname: `#{ANCHOR}.hostname || ""`, + protocol: `#{ANCHOR}.protocol || ""`, + origin: `#{ANCHOR}.origin || ""`, + path: `#{ANCHOR}.pathname || ""`, + search: `#{ANCHOR}.search || ""`, + hash: `#{ANCHOR}.hash || ""`, + host: `#{ANCHOR}.host || ""`, + port: `#{ANCHOR}.port || ""` }} })() ` diff --git a/core/source/Window.mint b/core/source/Window.mint index 5b2870e22..b7e798309 100644 --- a/core/source/Window.mint +++ b/core/source/Window.mint @@ -16,7 +16,7 @@ module Window { ` (() => { const listener = (event) => { - #{listener}(_normalizeEvent(event)) + #{listener}(#{%normalizeEvent%}(event)) } window.addEventListener(#{type}, listener, #{capture}); @@ -170,7 +170,7 @@ module Window { Window.jump("/new-url") */ fun jump (url : String) : Promise(Void) { - `_navigate( + `#{%navigate%}( #{url}, /* dispatch */ true, /* triggerJump */ true, @@ -194,7 +194,7 @@ module Window { Window.navigate("/new-url") */ fun navigate (url : String) : Promise(Void) { - `_navigate( + `#{%navigate%}( #{url}, /* dispatch */ true, /* triggerJump */ false, @@ -329,7 +329,7 @@ module Window { Window.setUrl("/new-url") */ fun setUrl (url : String) : Promise(Void) { - `_navigate( + `#{%navigate%}( #{url}, /* dispatch */ false, /* triggerJump */ false, diff --git a/core/tests/tests/Http.mint b/core/tests/tests/Http.mint index d46a6061a..3effdf145 100644 --- a/core/tests/tests/Http.mint +++ b/core/tests/tests/Http.mint @@ -238,7 +238,7 @@ suite "Http.send" { Http.get("/blah") |> Http.send("A") - `#{Http.requests()}["A"] != undefined` + `#{Http:REQUESTS}["A"] != undefined` } } @@ -269,7 +269,7 @@ component Test.Http { |> wrap( ` (async (promise) => { - let _requests = #{Http.requests()} + let _requests = #{Http:REQUESTS} if (#{shouldError}) { _requests["test"].dispatchEvent(new CustomEvent("error")) diff --git a/core/tests/tests/Locale.mint b/core/tests/tests/Locale.mint new file mode 100644 index 000000000..0abc5fc92 --- /dev/null +++ b/core/tests/tests/Locale.mint @@ -0,0 +1,25 @@ +locale en { + key: "Hello World!" +} + +locale hu { + key: "Szia Világ!" +} + +component Test.Locale { + fun render : Html { +
+ :key +
+ } +} + +suite "Locale" { + test "BadUrl" { + + |> Test.Html.start() + |> Test.Html.assertTextOf("div", "Hello World!") + |> Test.Html.triggerClick("div") + |> Test.Html.assertTextOf("div", "Szia Világ!") + } +} diff --git a/core/tests/tests/Provider/AnimationFrame.mint b/core/tests/tests/Provider/AnimationFrame.mint index e657cc915..4bc9b0936 100644 --- a/core/tests/tests/Provider/AnimationFrame.mint +++ b/core/tests/tests/Provider/AnimationFrame.mint @@ -23,8 +23,10 @@ suite "Provider.AnimationFrame.frames" { test "called on an animation frame" { |> Test.Html.start() - |> Test.Html.assertTextOf("div", "1") - |> Test.Html.assertTextOf("div", "2") - |> Test.Html.assertTextOf("div", "3") + |> Test.Context.timeout(10) + |> Test.Context.assert( + (element : Dom.Element) { + Dom.getTextContent(element) != "0" + }) } } diff --git a/core/tests/tests/Window.mint b/core/tests/tests/Window.mint index 797536f66..212dc6863 100644 --- a/core/tests/tests/Window.mint +++ b/core/tests/tests/Window.mint @@ -1,31 +1,55 @@ component ScrollTest { - use Provider.Scroll { scrolls: (event : Html.Event) : Promise(Void) { `this.forceUpdate()` } } + state scrollWidth = 0 + state scrollLeft = 0 + state scrollTop = 0 + + use Provider.Scroll { + scrolls: + (event : Html.Event) : Promise(Void) { + update() + } + } style base { height: 3000px; width: 3000px; } - fun componentDidMount : Void { - `this.forceUpdate()` + fun componentDidMount : Promise(Void) { + update() + } + + fun update { + next + { + scrollWidth: Window.scrollWidth(), + scrollLeft: Window.scrollLeft(), + scrollTop: Window.scrollTop() + } } fun render : Html { - <{ Number.toString(Window.scrollWidth()) }> + <{ Number.toString(scrollWidth) }> + "|" + <{ Number.toString(Window.scrollHeight()) }> + "|" + - <{ Number.toString(Window.scrollLeft()) }> + <{ Number.toString(scrollLeft) }> + "|" + - <{ Number.toString(Window.scrollTop()) }> + <{ Number.toString(scrollTop) }> } @@ -37,7 +61,6 @@ suite "Window.navigate" { Window.url() Window.navigate("/blah") - Window.href() == "http://127.0.0.1:#{url.port}/blah" } } @@ -87,11 +110,6 @@ suite "Window.scrollWidth" { test "returns the scrollable width when overflown" { |> Test.Html.start() - |> Test.Context.then( - (subject : Dom.Element) : Promise(Dom.Element) { - await Timer.nextFrame() - subject - }) |> Test.Html.assertTextOf("scroll-width", "3008") } } diff --git a/runtime/Makefile b/runtime/Makefile new file mode 100644 index 000000000..f85f6cbf7 --- /dev/null +++ b/runtime/Makefile @@ -0,0 +1,25 @@ +.PHONY: index +index: + yarn esbuild index.js \ + --outfile=../src/assets/runtime.js \ + --log-override:equals-nan=silent \ + --format=esm \ + --minify \ + --bundle + +.PHONY: index_testing +index_testing: + yarn esbuild index_testing.js \ + --outfile=../src/assets/runtime_test.js \ + --log-override:equals-nan=silent \ + --format=esm \ + --minify \ + --bundle + +.PHONY: format +format: + yarn prettier --write *.js **/*.js + +.PHONY: test +test: + yarn vitest --coverage diff --git a/runtime/index.js b/runtime/index.js new file mode 100644 index 000000000..fe5a3ef09 --- /dev/null +++ b/runtime/index.js @@ -0,0 +1,16 @@ +export { useComputed, computed, signal, effect, batch } from "@preact/signals"; +export { createElement, Fragment as fragment } from "preact"; +export { useEffect, useMemo, useRef } from "preact/hooks"; + +export * from "./src/pattern_matching"; +export * from "./src/normalize_event"; +export * from "./src/utilities"; +export * from "./src/translate"; +export * from "./src/equality"; +export * from "./src/provider"; +export * from "./src/decoders"; +export * from "./src/encoders"; +export * from "./src/program"; +export * from "./src/portals"; +export * from "./src/variant"; +export * from "./src/styles"; diff --git a/runtime/index_testing.js b/runtime/index_testing.js new file mode 100644 index 000000000..a0f50ab46 --- /dev/null +++ b/runtime/index_testing.js @@ -0,0 +1,3 @@ +export { render as testRender } from "preact"; +export * from "./src/testing"; +export * from "./index"; diff --git a/runtime/package.json b/runtime/package.json new file mode 100644 index 000000000..e85cd0685 --- /dev/null +++ b/runtime/package.json @@ -0,0 +1,19 @@ +{ + "private": true, + "dependencies": { + "route-parser": "mint-lang/mint-route-parser", + "@preact/signals": "^1.2.2", + "indent-string": "^5.0.0", + "fast-equals": "^5.0.1", + "uuid-random": "^1.3.2", + "preact": "^10.19.3" + }, + "devDependencies": { + "@testing-library/preact": "^3.2.3", + "@vitest/coverage-v8": "^1.2.1", + "esbuild": "^0.19.11", + "prettier": "^3.1.0", + "vitest": "^1.2.1", + "jsdom": "^23.2.0" + } +} diff --git a/runtime/src/decoders.js b/runtime/src/decoders.js new file mode 100644 index 000000000..9e2e67cdb --- /dev/null +++ b/runtime/src/decoders.js @@ -0,0 +1,344 @@ +import indentString from "indent-string"; + +// Formats the given value as JSON with extra indentation. +const format = (value) => { + let string = JSON.stringify(value, "", 2); + + if (typeof string === "undefined") { + string = "undefined"; + } + + return indentString(string); +}; + +// A class to keep the errors when decoding. It keeps track of the path +// to the nested objects for reporting purpuses. +export class Error { + constructor(message, path = []) { + this.message = message; + this.object = null; + this.path = path; + } + + push(input) { + this.path.unshift(input); + } + + toString() { + const message = this.message.trim(); + + const path = this.path.reduce((memo, item) => { + if (memo.length) { + switch (item.type) { + case "FIELD": + return `${memo}.${item.value}`; + case "ARRAY": + return `${memo}[${item.value}]`; + } + } else { + switch (item.type) { + case "FIELD": + return item.value; + case "ARRAY": + return `[$(item.value)]`; + } + } + }, ""); + + if (path.length && this.object) { + return ( + message + + "\n\n" + + IN_OBJECT.trim() + .replace("{value}", format(this.object)) + .replace("{path}", path) + ); + } else { + return message; + } + } +} + +const IN_OBJECT = ` +The input is in this object: + +{value} + +at: {path} +`; + +const NOT_A_STRING = ` +I was trying to decode the value: + +{value} + +as a String, but could not. +`; + +const NOT_A_TIME = ` +I was trying to decode the value: + +{value} + +as a Time, but could not. +`; + +const NOT_A_NUMBER = ` +I was trying to decode the value: + +{value} + +as a Number, but could not. +`; + +const NOT_A_BOOLEAN = ` +I was trying to decode the value: + +{value} + +as a Bool, but could not. +`; + +const NOT_AN_OBJECT = ` +I was trying to decode the field "{field}" from the object: + +{value} + +but I could not because it's not an object. +`; + +const NOT_AN_ARRAY = ` +I was trying to decode the value: + +{value} + +as an Array, but could not. +`; + +const NOT_A_TUPLE = ` +I was trying to decode the value: + +{value} + +as an Tuple, but could not. +`; + +const TUPLE_ITEM_MISSING = ` +I was trying to decode one of the values of a tuple: + +{value} + +but could not. +`; + +const NOT_A_MAP = ` +I was trying to decode the value: + +{value} + +as a Map, but could not. +`; + +// Decodes `String` (by checking for the type equality). +export const decodeString = (ok, err) => (input) => { + if (typeof input != "string") { + return new err(new Error(NOT_A_STRING.replace("{value}", format(input)))); + } else { + return new ok(input); + } +}; + +// Decodes `Time` either a UNIX timestamp or any values that the +// environment can parse with the `Date` construtor. +export const decodeTime = (ok, err) => (input) => { + let parsed = NaN; + + if (typeof input === "number") { + parsed = new Date(input); + } else { + parsed = Date.parse(input); + } + + if (Number.isNaN(parsed)) { + return new err(new Error(NOT_A_TIME.replace("{value}", format(input)))); + } else { + return new ok(new Date(parsed)); + } +}; + +// Decodes `Number` using `parseFloat`. +export const decodeNumber = (ok, err) => (input) => { + let value = parseFloat(input); + + if (isNaN(value)) { + return new err(new Error(NOT_A_NUMBER.replace("{value}", format(input)))); + } else { + return new ok(value); + } +}; + +// Decodes `Bool` (by checking for type) +export const decodeBoolean = (ok, err) => (input) => { + if (typeof input != "boolean") { + return new err(new Error(NOT_A_BOOLEAN.replace("{value}", format(input)))); + } else { + return new ok(input); + } +}; + +// Decodes an object field using the decoder (only works on "object" types +// except arrays) +export const decodeField = (key, decoder, err) => (input) => { + if ( + typeof input !== "object" || + Array.isArray(input) || + input == undefined || + input == null + ) { + const message = NOT_AN_OBJECT.replace("{field}", key).replace( + "{value}", + format(input), + ); + + return new err(new Error(message)); + } else { + const decoded = decoder(input[key]); + + if (decoded instanceof err) { + decoded._0.push({ type: "FIELD", value: key }); + decoded._0.object = input; + } + + return decoded; + } +}; + +// Decodes `Array` with the decoder. +export const decodeArray = (decoder, ok, err) => (input) => { + if (!Array.isArray(input)) { + return new err(new Error(NOT_AN_ARRAY.replace("{value}", format(input)))); + } + + let results = []; + let index = 0; + + for (let item of input) { + let result = decoder(item); + + if (result instanceof err) { + result._0.push({ type: "ARRAY", value: index }); + result._0.object = input; + return result; + } else { + results.push(result._0); + } + + index++; + } + + return new ok(results); +}; + +// Decodes `Maybe`. `null` and `undefined` becomes `Nothing` otherwise +// the decoded value is returned as a `Just`. +export const decodeMaybe = (decoder, ok, err, just, nothing) => (input) => { + if (input === null || input === undefined) { + return new ok(new nothing()); + } else { + const result = decoder(input); + + if (result instanceof err) { + return result; + } else { + return new ok(new just(result._0)); + } + } +}; + +// Decodes `Tuple(...)` with the decoders. +export const decodeTuple = (decoders, ok, err) => (input) => { + if (!Array.isArray(input)) { + return new err(new Error(NOT_A_TUPLE.replace("{value}", format(input)))); + } + + let results = []; + let index = 0; + + for (let decoder of decoders) { + if (input[index] === undefined || input[index] === null) { + return new err( + new Error(TUPLE_ITEM_MISSING.replace("{value}", format(input[index]))), + ); + } else { + let result = decoder(input[index]); + + if (result instanceof err) { + result._0.push({ type: "ARRAY", value: index }); + result._0.object = input; + return result; + } else { + results.push(result._0); + } + } + + index++; + } + + return new ok(results); +}; + +// Decodes an object as a `Map(key, value)` (it only works on objects with +// string keys so normal objects). +export const decodeMap = (decoder, ok, err) => (input) => { + if ( + typeof input !== "object" || + Array.isArray(input) || + input == undefined || + input == null + ) { + const message = NOT_A_MAP.replace("{value}", format(input)); + + return new err(new Error(message)); + } else { + const map = []; + + for (let key in input) { + const result = decoder(input[key]); + + if (result instanceof err) { + return result; + } else { + map.push([key, result._0]); + } + } + + return new ok(map); + } +}; + +// Decodes a record, using the mappings. +export const decoder = (mappings, ok, err) => (input) => { + const object = {}; + + for (let key in mappings) { + let decoder = mappings[key]; + + if (Array.isArray(decoder)) { + decoder = mappings[key][0]; + key = mappings[key][1]; + } + + const result = decodeField(key, decoder, err)(input); + + if (result instanceof err) { + return result; + } + + object[key] = result._0; + } + + return new ok(object); +}; + +// Decodes an `object` by wrapping in an `Ok`. +export const decodeObject = (ok) => (value) => new ok(value); diff --git a/runtime/src/encoders.js b/runtime/src/encoders.js new file mode 100644 index 000000000..d97a1ac30 --- /dev/null +++ b/runtime/src/encoders.js @@ -0,0 +1,61 @@ +import { identity } from "./utilities"; + +// Encodes `Time` +export const encodeTime = (value) => value.toISOString(); + +// Encodes `Array(item)` +export const encodeArray = (encoder) => (value) => { + return value.map((item) => { + return encoder ? encoder(item) : item; + }); +}; + +// Encodes `Map(String, value)` as a JS object. `Map` internally is just +// an array of key, value pairs which is an array as well. +export const encodeMap = (encoder) => (value) => { + const result = {}; + + for (let item of value) { + result[item[0]] = encoder ? encoder(item[1]) : item[1]; + } + + return result; +}; + +// Encodes `Maybe`. `Nothing` becomes `null`, `Just` is unwrapped. +export const encodeMaybe = (encoder, just) => (value) => { + if (value instanceof just) { + return encoder(value._0); + } else { + return null; + } +}; + +// Encodes `Tuple(...)` +export const encodeTuple = (encoders) => (value) => { + return value.map((item, index) => { + const encoder = encoders[index]; + return encoder ? encoder(item) : item; + }); +}; + +// Encode a record with the encoders. An encoder can be a function or +// an array where the first item is the function the second is the key +// to use. +export const encoder = (encoders) => (value) => { + const result = {}; + + for (let key in encoders) { + let encoder = encoders[key]; + let field = key; + + if (Array.isArray(encoder)) { + encoder = encoders[key][0]; + field = encoders[key][1]; + } + + result[field] = (encoder || identity)(value[key]); + } + + return result; +}; diff --git a/runtime/src/equality.js b/runtime/src/equality.js new file mode 100644 index 000000000..cbdb5b054 --- /dev/null +++ b/runtime/src/equality.js @@ -0,0 +1,169 @@ +// This file contains code to have value equality instead of reference equality. +// We use a `Symbol` to have a custom equality functions and then use these +// functions when comparing two values. +export const Equals = Symbol("Equals"); + +// We use regular functions instead of arrow functions because they have +// binding (this, arguments, etc...). +Boolean.prototype[Equals] = + Symbol.prototype[Equals] = + Number.prototype[Equals] = + String.prototype[Equals] = + function (other) { + return this.valueOf() === other; + }; + +Date.prototype[Equals] = function (other) { + return +this === +other; +}; + +Function.prototype[Equals] = Node.prototype[Equals] = function (other) { + return this === other; +}; + +// Search parameters need to be the same string to be equal. +URLSearchParams.prototype[Equals] = function (other) { + if (other === null || other === undefined) { + return false; + } + + return this.toString() === other.toString(); +}; + +// Sets need to have the same elements to be equal. +Set.prototype[Equals] = function (other) { + if (other === null || other === undefined) { + return false; + } + + return compare(Array.from(this).sort(), Array.from(other).sort()); +}; + +// Arrays need to have the same elements to be equal. +Array.prototype[Equals] = function (other) { + if (other === null || other === undefined) { + return false; + } + + if (this.length !== other.length) { + return false; + } + + if (this.length == 0) { + return true; + } + + for (let index in this) { + if (!compare(this[index], other[index])) { + return false; + } + } + + return true; +}; + +// Form data need to have the same elements to be equal. +FormData.prototype[Equals] = function (other) { + if (other === null || other === undefined) { + return false; + } + + const bKeys = Array.from(other.keys()).sort(); + const aKeys = Array.from(this.keys()).sort(); + + if (compare(aKeys, bKeys)) { + if (aKeys.length == 0) { + return true; + } + + for (let key of aKeys) { + const bValue = Array.from(other.getAll(key).sort()); + const aValue = Array.from(this.getAll(key).sort()); + + if (!compare(aValue, bValue)) { + return false; + } + } + + return true; + } else { + return false; + } +}; + +// Maps need to have the same keys and values to be equal. +Map.prototype[Equals] = function (other) { + if (other === null || other === undefined) { + return false; + } + + const aKeys = Array.from(this.keys()).sort(); + const bKeys = Array.from(other.keys()).sort(); + + if (compare(aKeys, bKeys)) { + if (aKeys.length == 0) { + return true; + } + + for (let key of aKeys) { + if (!compare(this.get(key), other.get(key))) { + return false; + } + } + + return true; + } else { + return false; + } +}; + +// If the object has a specific set of keys it's a Preact virtual DOM node. +const isVnode = (object) => + typeof object == "object" && + "constructor" in object && + "props" in object && + "type" in object && + "ref" in object && + "key" in object && + "__" in object + +// This is the custom comparison function. +export const compare = (a, b) => { + if ((a === undefined && b === undefined) || (a === null && b === null)) { + return true; + } else if (a != null && a != undefined && a[Equals]) { + return a[Equals](b); + } else if (b != null && b != undefined && b[Equals]) { + return b[Equals](a); + } else if (isVnode(a) || isVnode(b)) { + return a === b + } else { + return compareObjects(a, b); + } +}; + +// This is the custom comparison function for plain objects. +export const compareObjects = (a, b) => { + if (a instanceof Object && b instanceof Object) { + const aKeys = Object.keys(a); + const bKeys = Object.keys(b); + + if (aKeys.length !== bKeys.length) { + return false; + } + + const keys = new Set(aKeys.concat(bKeys)); + + for (let key of keys) { + if (!compare(a[key], b[key])) { + return false; + } + } + + return true; + } else { + // We fall back to strict equality if there is something we don't know + // how to compare. + return a === b; + } +}; diff --git a/runtime/src/normalize_event.js b/runtime/src/normalize_event.js new file mode 100644 index 000000000..3f37003c1 --- /dev/null +++ b/runtime/src/normalize_event.js @@ -0,0 +1,141 @@ +import { options } from "preact"; + +// Polyfill DataTransfer +if (!("DataTransfer" in window)) { + window.DataTransfer = class { + constructor() { + this.effectAllowed = "none"; + this.dropEffect = "none"; + this.files = []; + this.types = []; + this.cache = {}; + } + + getData(format) { + return this.cache[format] || ""; + } + + setData(format, data) { + this.cache[format] = data; + return null; + } + + clearData() { + this.cache = {}; + return null; + } + }; +} + +// Set the event option hook to normalize the event so we can use one type +// for events (`Html.Event``) instead of multiple event types like in +// JavaScript (`MouseEvent`, `KeyboardEvent`, etc...). Basically we make sure +// that there are values for all fields using a proxy (which makes it lazy). +export const normalizeEvent = (event) => { + return new Proxy(event, { + get: function (obj, prop) { + if (prop === "event") { + return event; + } else if (prop in obj) { + const value = obj[prop]; + + if (value instanceof Function) { + return () => obj[prop](); + } else { + return value; + } + } else { + switch (prop) { + // onCopy onCut onPaste + case "clipboardData": + return (obj.clipboardData = new DataTransfer()); + + // drag events + case "dataTransfer": + return (obj.dataTransfer = new DataTransfer()); + + // onCompositionEnd onCompositionStart onCompositionUpdate + case "data": + return ""; + + // onKeyDown onKeyPress onKeyUp + case "altKey": + return false; + case "charCode": + return -1; + case "ctrlKey": + return false; + case "key": + return ""; + case "keyCode": + return -1; + case "locale": + return ""; + case "location": + return -1; + case "metaKey": + return false; + case "repeat": + return false; + case "shiftKey": + return false; + case "which": + return -1; + + // onClick onContextMenu onDoubleClick onDrag onDragStart onDragEnd + // onDragEnter onDragExit onDragLeave onDragOver onDrop onMouseDown + // onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver + // onMouseUp + case "button": + return -1; + case "buttons": + return -1; + case "clientX": + return -1; + case "clientY": + return -1; + case "pageX": + return -1; + case "pageY": + return -1; + case "screenX": + return -1; + case "screenY": + return -1; + + // onScroll + case "detail": + return -1; + + // onWheel + case "deltaMode": + return -1; + case "deltaX": + return -1; + case "deltaY": + return -1; + case "deltaZ": + return -1; + + // onAnimationStart onAnimationEnd onAnimationIteration + case "animationName": + return ""; + case "pseudoElement": + return ""; + case "elapsedTime": + return -1; + + // onTransitionEnd + case "propertyName": + return ""; + + default: + return undefined; + } + } + }, + }); +}; + +// Set the event preact hook. +options.event = normalizeEvent; diff --git a/runtime/src/pattern_matching.js b/runtime/src/pattern_matching.js new file mode 100644 index 000000000..ab430faf7 --- /dev/null +++ b/runtime/src/pattern_matching.js @@ -0,0 +1,152 @@ +import { compare } from "./equality"; + +// This is a pattern for destructuring records. +class PatternRecord { + constructor(patterns) { + this.patterns = patterns; + } +} + +// This is a pattern for destructuring types. +class Pattern { + constructor(variant, pattern) { + this.pattern = pattern; + this.variant = variant; + } +} + +// Export functions for creating various patterns. +export const pattern = (variant, pattern) => new Pattern(variant, pattern); +export const patternRecord = (patterns) => new PatternRecord(patterns); + +// Symbols to use during pattern matching. +export const patternVariable = Symbol("Variable"); +export const patternSpread = Symbol("Spread"); + +// Destructures the value using the pattern and returns the matched values of +// the pattern as an array. If the value cannot be destructured it returns +// `false`. This is a recursive function. +export const destructure = (value, pattern, values = []) => { + // If the pattern is null it means that we skip this value. + if (pattern === null) { + // This branch matches a variable in the pattern + } else if (pattern === patternVariable) { + values.push(value); + // This branch covers tuples and arrays (they are the same) + } else if (Array.isArray(pattern)) { + const hasSpread = pattern.some((item) => item === patternSpread); + + // If we have spreads and the arrays length is bigger then the patterns + // length that means that there will be values in the spread. + if (hasSpread && value.length >= pattern.length - 1) { + let startIndex = 0; + let endValues = []; + let endIndex = 1; + + // This destructures the head patterns until a spread (if any). + while ( + pattern[startIndex] !== patternSpread && + startIndex < pattern.length + ) { + if (!destructure(value[startIndex], pattern[startIndex], values)) { + return false; + } + startIndex++; + } + + // This destructures the tail patterns backwards until a spread (if any). + while ( + pattern[pattern.length - endIndex] !== patternSpread && + endIndex < pattern.length + ) { + if ( + !destructure( + value[value.length - endIndex], + pattern[pattern.length - endIndex], + endValues, + ) + ) { + return false; + } + endIndex++; + } + + // Add in the spread + values.push(value.slice(startIndex, value.length - (endIndex - 1))); + + // Add in the end values + for (let item of endValues) { + values.push(item); + } + // This branch is for without spreads. We can only destructure patterns + // which have the same length. + } else { + if (pattern.length !== value.length) { + return false; + } else { + for (let index in pattern) { + if (!destructure(value[index], pattern[index], values)) { + return false; + } + } + } + } + // This branch covers type variants. + } else if (pattern instanceof Pattern) { + if (value instanceof pattern.variant) { + if (pattern.pattern instanceof PatternRecord) { + if (!destructure(value, pattern.pattern, values)) { + return false; + } + } else { + for (let index in pattern.pattern) { + if ( + !destructure(value[`_${index}`], pattern.pattern[index], values) + ) { + return false; + } + } + } + } else { + return false; + } + // This branch covers type variants as records. + } else if (pattern instanceof PatternRecord) { + for (let index in pattern.patterns) { + const item = pattern.patterns[index]; + + if (!destructure(value[item[0]], item[1], values)) { + return false; + } + } + // We compare anything else. + } else { + if (!compare(value, pattern)) { + return false; + } + } + + return values; +}; + +// Matches a value with different patterns and calls the function of the first +// matching pattern. +// +// match("Hello", [ +// ["World", () => "It's world"], +// [patternVariable, (value) => value] // This is matched +// ]) +// +export const match = (value, branches) => { + for (let branch of branches) { + if (branch[0] === null) { + return branch[1](); + } else { + const values = destructure(value, branch[0]); + + if (values) { + return branch[1].apply(null, values); + } + } + } +}; diff --git a/runtime/src/portals.js b/runtime/src/portals.js new file mode 100644 index 000000000..a828c428b --- /dev/null +++ b/runtime/src/portals.js @@ -0,0 +1,87 @@ +/* +================================================================================ + +DO NOT EDIT THIS FILE! IT IS COPIED FROM: + +https://github.com/preactjs/preact/blob/main/compat/src/portals.js +(commit e16b520eadac9f91a32c645a2447036b73ac98f4) + +THIS IS BECAUSE `preact/compat` IS NOT TREE SHAKEABLE AND THIS WAY THE BUNDLE +SIZE IS 5KB SMALLER. + +================================================================================ +*/ + +import { createElement, render } from "preact"; + +/** + * @param {import('../../src/index').RenderableProps<{ context: any }>} props + */ +function ContextProvider(props) { + this.getChildContext = () => props.context; + return props.children; +} + +/** + * Portal component + * @this {import('./internal').Component} + * @param {object | null | undefined} props + * + * TODO: use createRoot() instead of fake root + */ +function Portal(props) { + const _this = this; + let container = props._container; + + _this.componentWillUnmount = function () { + render(null, _this._temp); + _this._temp = null; + _this._container = null; + }; + + // When we change container we should clear our old container and + // indicate a new mount. + if (_this._container && _this._container !== container) { + _this.componentWillUnmount(); + } + + if (!_this._temp) { + _this._container = container; + + // Create a fake DOM parent node that manages a subset of `container`'s children: + _this._temp = { + nodeType: 1, + parentNode: container, + childNodes: [], + appendChild(child) { + this.childNodes.push(child); + _this._container.appendChild(child); + }, + insertBefore(child, before) { + this.childNodes.push(child); + _this._container.appendChild(child); + }, + removeChild(child) { + this.childNodes.splice(this.childNodes.indexOf(child) >>> 1, 1); + _this._container.removeChild(child); + }, + }; + } + + // Render our wrapping element into temp. + render( + createElement(ContextProvider, { context: _this.context }, props._vnode), + _this._temp, + ); +} + +/** + * Create a `Portal` to continue rendering the vnode tree at a different DOM node + * @param {import('./internal').VNode} vnode The vnode to render + * @param {import('./internal').PreactElement} container The DOM node to continue rendering in to. + */ +export function createPortal(vnode, container) { + const el = createElement(Portal, { _vnode: vnode, _container: container }); + el.containerInfo = container; + return el; +} diff --git a/runtime/src/program.js b/runtime/src/program.js new file mode 100644 index 000000000..c9bfcbd76 --- /dev/null +++ b/runtime/src/program.js @@ -0,0 +1,237 @@ +import { deepEqual } from "fast-equals"; +import RouteParser from "route-parser"; +import { h, render } from "preact"; + +// An internally used error when we can't decode route parameters. +class DecodingError extends Error {} + +// Comparison function for route variables later on. +const equals = (a, b) => { + if (a instanceof Object) { + return b instanceof Object && deepEqual(a, b); + } else { + return !(b instanceof Object) && a === b; + } +}; + +// `queueMicrotask` polyfill. +const queueTask = (callback) => { + if (typeof window.queueMicrotask !== "function") { + Promise.resolve() + .then(callback) + .catch((e) => + setTimeout(() => { + throw e; + }), + ); + } else { + window.queueMicrotask(callback); + } +}; + +// Returns the route information by parsing the route. +const getRouteInfo = (url, routes) => { + for (let route of routes) { + if (route.path === "*") { + return { route: route, vars: false, url: url }; + } else { + let vars = new RouteParser(route.path).match(url); + + if (vars) { + return { route: route, vars: vars, url: url }; + } + } + } + + return null; +}; + +class Program { + constructor(ok, routes) { + this.root = document.createElement("div"); + this.routeInfo = null; + this.routes = routes; + this.ok = ok; + + document.body.appendChild(this.root); + + window.addEventListener("popstate", this.handlePopState.bind(this)); + window.addEventListener("click", this.handleClick.bind(this), true); + } + + handleClick(event) { + // If someone prevented default we honor that. + if (event.defaultPrevented) { + return; + } + + // If the control is pressed it means that the user wants + // to open it a new tab so we honor that. + if (event.ctrlKey) { + return; + } + + for (let element of event.composedPath()) { + if (element.tagName === "A") { + // If the target is not empty then it's probably `_blank` or + // an other window or frame so we skip. + if (element.target.trim() !== "") { + return; + } + + // We only handle same origin URLs. + if (element.origin === window.location.origin) { + const fullPath = element.pathname + element.search + element.hash; + const routeInfo = getRouteInfo(fullPath, this.routes); + + // If we found a matchin route, we prevent default and navigate to + // that route. + if (routeInfo) { + event.preventDefault(); + + navigate( + fullPath, + /* dispatch */ true, + /* triggerJump */ true, + routeInfo, + ); + return; + } + } + } + } + } + + // Handles resolving the page position after a navigation event. + resolvePagePosition(triggerJump) { + // Queue a microTask, this will run after Preact does a render. + queueTask(() => { + // On the next frame, the DOM should be updated already. + requestAnimationFrame(() => { + const hash = window.location.hash; + + if (hash) { + let elem = null; + + try { + elem = + this.root.querySelector(hash) || // ID + this.root.querySelector(`a[name="${hash.slice(1)}"]`); // Anchor + } catch {} + + if (elem) { + if (triggerJump) { + elem.scrollIntoView(); + } + } else { + console.warn( + `MINT: ${hash} matches no element with an id and no link with a name`, + ); + } + } else if (triggerJump) { + window.scrollTo(0, 0); + } + }); + }); + } + + // Handles navigation events. + handlePopState(event) { + const url = + window.location.pathname + window.location.search + window.location.hash; + + const routeInfo = event?.routeInfo || getRouteInfo(url, this.routes); + + if (routeInfo) { + if ( + this.routeInfo === null || + routeInfo.url !== this.routeInfo.url || + !equals(routeInfo.vars, this.routeInfo.vars) + ) { + this.runRouteHandler(routeInfo); + } + + this.resolvePagePosition(!!event?.triggerJump); + } + + this.routeInfo = routeInfo; + } + + // Helper function for above. + runRouteHandler(routeInfo) { + const { route } = routeInfo; + + if (route.path === "*") { + route.handler(); + } else { + const { vars } = routeInfo; + try { + let args = route.mapping.map((name, index) => { + const value = vars[name]; + const result = route.decoders[index](value); + + if (result instanceof this.ok) { + return result._0; + } else { + throw new DecodingError(); + } + }); + + route.handler.apply(null, args); + } catch (error) { + if (error.constructor !== DecodingError) { + throw error; + } + } + } + } + + // Renders the program and runs current route handlers. + render(main, globals) { + if (typeof main !== "undefined") { + const components = []; + + for (let key in globals) { + components.push(h(globals[key], { key: key })); + } + + render([...components, h(main, { key: "MINT_MAIN" })], this.root); + + this.handlePopState(); + } + } +} + +// Function to navigate to a different url. +export const navigate = ( + url, + dispatch = true, + triggerJump = true, + routeInfo = null, +) => { + let pathname = window.location.pathname; + let search = window.location.search; + let hash = window.location.hash; + + let fullPath = pathname + search + hash; + + if (fullPath !== url) { + if (dispatch) { + window.history.pushState({}, "", url); + } else { + window.history.replaceState({}, "", url); + } + } + + if (dispatch) { + let event = new PopStateEvent("popstate"); + event.triggerJump = triggerJump; + event.routeInfo = routeInfo; + dispatchEvent(event); + } +}; + +// Creates a program. +export const program = (main, globals, ok, routes = []) => { + new Program(ok, routes).render(main, globals); +}; diff --git a/runtime/src/provider.js b/runtime/src/provider.js new file mode 100644 index 000000000..b1218db4a --- /dev/null +++ b/runtime/src/provider.js @@ -0,0 +1,47 @@ +import { useEffect, useMemo } from "preact/hooks"; +import { untracked } from "@preact/signals"; +import { compare } from "./equality"; +import uuid from "uuid-random"; + +// This creates a function which is used for subscribing to a provider. We use +// `untracked` to not to subscribe to any outside signals. +export const createProvider = (subscriptions, update) => { + // This is the subscription function. + return (owner, object) => { + const unsubscribe = () => { + if (subscriptions.has(owner)) { + subscriptions.delete(owner); + untracked(update); + } + }; + + // This will only run when the component unmounts. + useEffect(() => { + return unsubscribe; + }, []); + + // This runs on every update so we don't return a cleanup function. + useEffect(() => { + const data = object(); + + // If the object is null that means we need to unsubscribe. + if (data === null) { + unsubscribe(); + } else { + const current = subscriptions.get(owner); + + if (!compare(current, data)) { + subscriptions.set(owner, data); + untracked(update); + } + } + }); + }; +}; + +// Returns the subscriptions as an array. +export const subscriptions = (items) => Array.from(items.values()); + +// Returns a unique ID for a component which doesn't change. +export const useId = () => useMemo(uuid, []); +export { uuid }; diff --git a/runtime/src/styles.js b/runtime/src/styles.js new file mode 100644 index 000000000..68a983896 --- /dev/null +++ b/runtime/src/styles.js @@ -0,0 +1,42 @@ +// Inserts styles into the document (used in tests). +export const insertStyles = (styles) => { + let style = document.createElement("style"); + document.head.appendChild(style); + style.innerHTML = styles; +}; + +// Parses style data for an HTML element which can come in multiple forms: +// +// style="color: red" - A CSS string (we need to parse this) +// style={Map.set(Map.empty(), "color", "red")} - A Mint `Map` +// style=[{"color", "red"}] - A Mint Array of tuples +// style={`{color: "red"}`} - A JavaScript object +export const style = (items) => { + const result = {}; + + const setKeyValue = (key, value) => { + result[key.toString().trim()] = value.toString().trim(); + }; + + for (let item of items) { + if (typeof item === "string") { + item.split(";").forEach((prop) => { + const [key, value] = prop.split(":"); + + if (key && value) { + setKeyValue(key, value); + } + }); + } else if (item instanceof Map || item instanceof Array) { + for (let [key, value] of item) { + setKeyValue(key, value); + } + } else { + for (let key in item) { + setKeyValue(key, item[key]); + } + } + } + + return result; +}; diff --git a/runtime/src/testing.js b/runtime/src/testing.js new file mode 100644 index 000000000..ae08c2d8a --- /dev/null +++ b/runtime/src/testing.js @@ -0,0 +1,211 @@ +import { compare } from "./equality"; + +// This is a class for tests. It allows to have multiple steps which are +// evaluated asynchronously. +class TestContext { + constructor(subject, teardown) { + this.teardown = teardown; + this.subject = subject; + this.steps = []; + } + + async run() { + let result; + + try { + result = await new Promise(this.next.bind(this)); + } finally { + this.teardown && this.teardown(); + } + + return result; + } + + async next(resolve, reject) { + requestAnimationFrame(async () => { + let step = this.steps.shift(); + + if (step) { + try { + this.subject = await step(this.subject); + } catch (error) { + return reject(error); + } + } + + if (this.steps.length) { + this.next(resolve, reject); + } else { + resolve(this.subject); + } + }); + } + + step(proc) { + this.steps.push(proc); + return this; + } +} + +// This is the test runner which runs the tests and sends reports to +// the CLI using websockets. +class TestRunner { + constructor(suites, url, id) { + this.socket = new WebSocket(url); + this.suites = suites; + this.url = url; + this.id = id; + + // Catch debug messages. + window.DEBUG = { + log: (value) => { + let result = ""; + + if (value === undefined) { + result = "undefined"; + } else if (value === null) { + result = "null"; + } else { + result = value.toString(); + } + + this.log(result); + }, + }; + + let error = null; + + window.onerror = (message) => { + if (this.socket.readyState === 1) { + this.crash(message); + } else { + error = error || message; + } + }; + + this.socket.onopen = () => { + if (error != null) { + this.crash(error); + } + }; + + this.start(); + } + + start() { + if (this.socket.readyState === 1) { + this.run(); + } else { + this.socket.addEventListener("open", () => this.run()); + } + } + + run() { + return new Promise((resolve, reject) => { + this.next(resolve, reject); + }) + .catch((e) => this.log(e.reason)) + .finally(() => this.socket.send("DONE")); + } + + report(type, suite, name, message, location) { + if (message && message.toString) { + message = message.toString(); + } + this.socket.send( + JSON.stringify({ + location: location, + result: message, + suite: suite, + id: this.id, + type: type, + name: name, + }), + ); + } + + reportTested(test, type, message) { + this.report(type, this.suite.name, test.name, message, test.location); + } + + crash(message) { + this.report("CRASHED", null, null, message); + } + + log(message) { + this.report("LOG", null, null, message); + } + + next(resolve, reject) { + requestAnimationFrame(async () => { + if (!this.suite || this.suite.tests.length === 0) { + this.suite = this.suites.shift(); + + if (this.suite) { + this.report("SUITE", this.suite.name); + } else { + return resolve(); + } + } + + const currentHistory = window.history.length; + + const test = this.suite.tests.shift(); + + try { + const result = await test.proc.call(this.suite.context); + + // Go back to the beginning + if (window.history.length - currentHistory) { + window.history.go(-(window.history.length - currentHistory)); + } + + // Clear storages + sessionStorage.clear(); + localStorage.clear(); + + // TODO: Reset Stores + + if (result instanceof TestContext) { + try { + await result.run(); + this.reportTested(test, "SUCCEEDED", result.subject); + } catch (error) { + this.reportTested(test, "FAILED", error); + } + } else { + if (result) { + this.reportTested(test, "SUCCEEDED"); + } else { + this.reportTested(test, "FAILED"); + } + } + } catch (error) { + // An error occurred while trying to run a test; this is different from the test itself failing. + this.reportTested(test, "ERRORED", error); + } + + this.next(resolve, reject); + }); + } +} + +// This function creates a test for an equality operation (either == or !=). +export const testOperation = (left, right, operator) => { + return new TestContext(left).step((subject) => { + let result = compare(subject, right); + + if (operator === "==") { + result = !result; + } + + if (result) { + throw `Assertion failed: ${right} ${operator} ${subject}`; + } + + return true; + }); +}; + +export const testContext = TestContext; +export const testRunner = TestRunner; diff --git a/runtime/src/translate.js b/runtime/src/translate.js new file mode 100644 index 000000000..1e2dca85a --- /dev/null +++ b/runtime/src/translate.js @@ -0,0 +1,11 @@ +import { signal } from "@preact/signals"; + +// We have global signals for translations. +export const translations = signal({}); +export const locale = signal({}); + +// Global functions to set the locale and translate a key +// with the current locale. +export const setLocale = (value) => (locale.value = value); +export const translate = (key) => + (translations.value[locale.value] || {})[key] || ""; diff --git a/runtime/src/utilities.js b/runtime/src/utilities.js new file mode 100644 index 000000000..3325b547d --- /dev/null +++ b/runtime/src/utilities.js @@ -0,0 +1,97 @@ +import { createRef as createRefOriginal, Component, createElement } from "preact"; +import { useEffect, useRef, useMemo } from "preact/hooks"; +import { signal } from "@preact/signals"; + +// We need to have a different function for accessing array items because there +// is no concept of `null` in Mint so we return `Just(a)` or `Nothing`. +export const arrayAccess = (array, index, just, nothing) => { + if (array.length >= index + 1 && index >= 0) { + return new just(array[index]); + } else { + return new nothing(); + } +}; + +// This sets the references to an element or component. The current +// value is always a `Maybe` +export const setRef = (value, just) => (element) => { + if (value.current._0 !== element) { + value.current = new just(element); + } +}; + +// A version of `useSignal`` which subscribes to the signal by default (like a +// state) since we want to re-render every time the signal changes. +export const useSignal = (value) => { + const item = useMemo(() => signal(value), []); + item.value; + return item; +}; + +// A version of `createRef` with a default value. +export const createRef = (value) => { + const ref = createRefOriginal(); + ref.current = value; + return ref; +}; + +// A hook to replace the `componentDidUpdate` function. +export const useDidUpdate = (callback) => { + const hasMount = useRef(false); + + useEffect(() => { + if (hasMount.current) { + callback(); + } else { + hasMount.current = true; + } + }); +}; + +// Function for the `or` operator. +export const or = (item, value) => { + if (item !== undefined && item !== null) { + return item; + } else { + return value; + } +}; + +// Converts the arguments into an array. +export const toArray = (...args) => { + let items = Array.from(args); + + if (Array.isArray(items[0]) && items.length === 1) { + return items[0]; + } else { + return items; + } +}; + +// Function for member access. +export const access = (field) => (value) => value[field]; + +// Identity function, used in encoders. +export const identity = (a) => a; + +export class lazyComponent extends Component { + async componentDidMount() { + let x = await this.props.x(); + this.setState({ x: x }) + } + + render() { + if (this.state.x) { + return createElement(this.state.x, this.props.p, this.props.c) + } else { + return null + } + } +} + +export const lazy = (path) => async () => load(path) + +export const load = async (path) => { + const x = await import(path) + return x.default +} diff --git a/runtime/src/variant.js b/runtime/src/variant.js new file mode 100644 index 000000000..b90f9282c --- /dev/null +++ b/runtime/src/variant.js @@ -0,0 +1,56 @@ +import { Equals, compareObjects, compare } from "./equality"; + +// The base class for variants. +class Variant { + [Equals](other) { + if (!(other instanceof this.constructor)) { + return false; + } + + if (other.length !== this.length) { + return false; + } + + if (this.record) { + return compareObjects(this, other); + } + + for (let index = 0; index < this.length; index++) { + if (!compare(this["_" + index], other["_" + index])) { + return false; + } + } + + return true; + } +} + +// Creates an type variant class, this is needed so we can do proper +// comparisons and pattern matching / destructuring. +export const variant = (input) => { + return class extends Variant { + constructor(...args) { + super(); + if (Array.isArray(input)) { + this.length = input.length; + this.record = true; + + for (let index = 0; index < input.length; index++) { + this[input[index]] = args[index]; + } + } else { + this.length = input; + + for (let index = 0; index < input; index++) { + this[`_${index}`] = args[index]; + } + } + } + }; +}; + +// Creates a new variant from variable arguments. +export const newVariant = + (item) => + (...args) => + new item(...args); diff --git a/runtime/tests/equality.test.js b/runtime/tests/equality.test.js new file mode 100644 index 000000000..d6b7998be --- /dev/null +++ b/runtime/tests/equality.test.js @@ -0,0 +1,278 @@ +import { expect, test, describe } from "vitest"; +import { compare } from "../index_testing"; + +test("comparing nulls", () => { + expect(compare(null, null)).toBe(true); + expect(compare(null, undefined)).toBe(false); + expect(compare(undefined, "")).toBe(false); +}); + +test("comparing nodes", () => { + expect(compare(document.body, document.body)).toBe(true); + expect(compare(document.body, document.head)).toBe(false); +}); + +test("comparing same symbols", () => { + expect(compare(Symbol("A"), Symbol("A"))).toBe(false); +}); + +test("comparing same arrays", () => { + expect(["A"] == ["A"]).toBe(false); + expect(compare(["A"], ["A"])).toBe(true); +}); + +test("comparing functions", () => { + expect( + compare( + () => {}, + () => {}, + ), + ).toBe(false); +}); + +test("comparing empty arrays", () => { + expect([] == []).toBe(false); + expect(compare([], [])).toBe(true); +}); + +test("comparing arrays with null", () => { + expect(compare([], null)).toBe(false); +}); + +test("comparing arrays with undefined", () => { + expect(compare([], undefined)).toBe(false); +}); + +test("comparing different length arrays", () => { + expect(["A"] == ["A"]).toBe(false); + expect(compare(["A", "B"], ["A"])).toBe(false); +}); + +test("comparing different arrays", () => { + expect(compare(["A"], ["B"])).toBe(false); +}); + +test("comparing same dates", () => { + expect(new Date() == new Date()).toBe(false); + expect(compare(new Date(), new Date())).toBe(true); +}); + +test("comparing different dates", () => { + expect(compare(new Date(2018, 1, 1), new Date(2018, 1, 2))).toBe(false); +}); + +test("comparing same strings", () => { + expect(compare("A", "A")).toBe(true); +}); + +test("comparing same numbers", () => { + expect(compare(0, 0.0)).toBe(true); +}); + +test("comparing booleans", () => { + expect(compare(true, true)).toBe(true); +}); + +test("comparing objects", () => { + expect(compare({ a: "a" }, { a: "a" })).toBe(true); + expect(compare({ a: "a" }, { a: "b" })).toBe(false); + expect(compare({ a: "a" }, { a: "a", b: "c" })).toBe(false); +}); + +describe("URLSearchParams", () => { + test("false for null", () => { + const a = new URLSearchParams("a=b&c=d"); + + expect(compare(a, null)).toBe(false); + }); + + test("false for undefined", () => { + const a = new URLSearchParams("a=b&c=d"); + + expect(compare(a, undefined)).toBe(false); + }); + + test("same data are equal", () => { + const a = new URLSearchParams("a=b&c=d"); + const b = new URLSearchParams("a=b&c=d"); + + expect(compare(a, b)).toBe(true); + }); +}); + +describe("Map", () => { + test("false for undefined", () => { + const a = new Map(); + + expect(compare(a, undefined)).toBe(false); + }); + + test("false for null", () => { + const a = new Map(); + + expect(compare(a, null)).toBe(false); + }); + + test("same data are equal", () => { + const a = new Map([ + ["A", "B"], + ["X", "Y"], + ]); + const b = new Map([ + ["A", "B"], + ["X", "Y"], + ]); + + expect(compare(a, b)).toBe(true); + }); + + test("same data with different order are equal", () => { + const a = new Map([ + ["X", "Y"], + ["A", "B"], + ]); + const b = new Map([ + ["A", "B"], + ["X", "Y"], + ]); + + expect(compare(a, b)).toBe(true); + }); + + test("empty maps are equal", () => { + const a = new Map(); + const b = new Map(); + + expect(compare(a, b)).toBe(true); + }); + + test("different data are not equal", () => { + const a = new Map([ + ["A", "B"], + ["X", "Z"], + ]); + const b = new Map([ + ["A", "B"], + ["X", "Y"], + ]); + + expect(compare(a, b)).toBe(false); + }); + + test("data with different number of keys are not equal", () => { + const a = new Map([["A", "B"]]); + const b = new Map([ + ["A", "B"], + ["X", "Y"], + ]); + + expect(compare(a, b)).toBe(false); + }); +}); + +describe("Set", () => { + test("false for undefined", () => { + const a = new Set([]); + + expect(compare(a, undefined)).toBe(false); + }); + + test("false for null", () => { + const a = new Set([]); + + expect(compare(a, null)).toBe(false); + }); + + test("same data are equal", () => { + const a = new Set(["A", "B", "B"]); + const b = new Set(["A", "B", "B"]); + + expect(compare(a, b)).toBe(true); + }); + + test("same data not in order are equal", () => { + const a = new Set(["B", "A", "A"]); + const b = new Set(["A", "B", "B"]); + + expect(compare(a, b)).toBe(true); + }); + + test("different data does not equal", () => { + const a = new Set(["B", "C", "A"]); + const b = new Set(["A", "B", "B"]); + + expect(compare(a, b)).toBe(false); + }); +}); + +describe("FormData", () => { + test("false for undefined", () => { + const a = new FormData(); + + expect(compare(a, undefined)).toBe(false); + }); + + test("false for null", () => { + const a = new FormData(); + + expect(compare(a, null)).toBe(false); + }); + + test("empty form datas are equal", () => { + expect(compare(new FormData(), new FormData())).toBe(true); + }); + + test("same data form datas are equal", () => { + const a = new FormData(); + a.append("a", "a"); + + const b = new FormData(); + b.append("a", "a"); + + expect(compare(a, b)).toBe(true); + }); + + test("different datas are not equal", () => { + const a = new FormData(); + a.append("a", "a"); + + const b = new FormData(); + b.append("b", "a"); + + expect(compare(a, b)).toBe(false); + }); + + test("different datas are not equal", () => { + const a = new FormData(); + a.append("a", "b"); + + const b = new FormData(); + b.append("a", "a"); + + expect(compare(a, b)).toBe(false); + }); + + test("same multiple data form datas are equal", () => { + const a = new FormData(); + a.append("a", "a"); + a.append("a", "b"); + + const b = new FormData(); + b.append("a", "b"); + b.append("a", "a"); + + expect(compare(a, b)).toBe(true); + }); + + test("same multiple data form datas with different order are equal", () => { + const a = new FormData(); + a.append("a", "b"); + a.append("x", "y"); + + const b = new FormData(); + b.append("x", "y"); + b.append("a", "b"); + + expect(compare(a, b)).toBe(true); + }); +}); diff --git a/runtime/tests/normalize_event.test.js b/runtime/tests/normalize_event.test.js new file mode 100644 index 000000000..6651d7384 --- /dev/null +++ b/runtime/tests/normalize_event.test.js @@ -0,0 +1,49 @@ +import { expect, test, describe } from "vitest"; +import { normalizeEvent } from "../index"; + +describe("normalizeEvent", () => { + test("returns default values if they are not defined", () => { + const event = normalizeEvent({ test: "X", preventDefault: () => "P" }); + + expect(event.dataTransfer).not.toBe(undefined); + + expect(event.dataTransfer.setData("test", "test")).toBe(null); + expect(event.dataTransfer.getData("not present")).toBe(""); + expect(event.dataTransfer.getData("test")).toBe("test"); + expect(event.dataTransfer.clearData()).toBe(null); + + expect(event.clipboardData).not.toBe(undefined); + expect(event.preventDefault()).toBe("P"); + expect(event.data).toBe(""); + expect(event.altKey).toBe(false); + expect(event.charCode).toBe(-1); + expect(event.ctrlKey).toBe(false); + expect(event.key).toBe(""); + expect(event.keyCode).toBe(-1); + expect(event.locale).toBe(""); + expect(event.location).toBe(-1); + expect(event.metaKey).toBe(false); + expect(event.repeat).toBe(false); + expect(event.shiftKey).toBe(false); + expect(event.which).toBe(-1); + expect(event.button).toBe(-1); + expect(event.buttons).toBe(-1); + expect(event.clientX).toBe(-1); + expect(event.clientY).toBe(-1); + expect(event.pageX).toBe(-1); + expect(event.pageY).toBe(-1); + expect(event.screenY).toBe(-1); + expect(event.screenX).toBe(-1); + expect(event.detail).toBe(-1); + expect(event.deltaMode).toBe(-1); + expect(event.deltaX).toBe(-1); + expect(event.deltaY).toBe(-1); + expect(event.deltaZ).toBe(-1); + expect(event.animationName).toBe(""); + expect(event.pseudoElement).toBe(""); + expect(event.elapsedTime).toBe(-1); + expect(event.propertyName).toBe(""); + expect(event.blah).toBe(undefined); + expect(event.test).toBe("X"); + }); +}); diff --git a/runtime/tests/provider.test.js b/runtime/tests/provider.test.js new file mode 100644 index 000000000..fd34acebd --- /dev/null +++ b/runtime/tests/provider.test.js @@ -0,0 +1,29 @@ +import { render, fireEvent } from "@testing-library/preact"; +import { expect, test, describe } from "vitest"; +import { useState } from "preact/hooks"; +import { h } from "preact"; + +import { createProvider, useProviders, useId, subscriptions } from "../index"; + +const map = new Map(); +const provider = createProvider(map, () => {}); + +describe("providers", () => { + test("works correctly", () => { + /* + const item = h(() => { + const [count, setCount] = useState(0); + const id = useId(); + + useProviders([() => provider(id, count == 1 ? {} : null)]); + + return h("div", { onClick: () => setCount(1) }, "TEST"); + }); + + const items = subscriptions(map); + const container = render(item); + + fireEvent.click(container.getByText("TEST")); + */ + }); +}); diff --git a/runtime/tests/styles.test.js b/runtime/tests/styles.test.js new file mode 100644 index 000000000..d92dd27e0 --- /dev/null +++ b/runtime/tests/styles.test.js @@ -0,0 +1,32 @@ +import { expect, test, describe } from "vitest"; +import { insertStyles, style } from "../index"; + +describe("insertStyles", () => { + test("adds styles to the document", () => { + insertStyles("test"); + expect(document.head.querySelector("style").textContent).toBe("test"); + }); +}); + +describe("style", () => { + test("it creates an object from objects and maps", () => { + expect( + style([ + "opacity:0; z-index: 100 ; ", + new Map([["a", "b"]]), + new Map([[101, "d"]]), + [["x", "y"]], + { c: "d" }, + { z: 123 }, + ]), + ).toEqual({ + "z-index": "100", + opacity: "0", + a: "b", + 101: "d", + x: "y", + c: "d", + z: "123", + }); + }); +}); diff --git a/runtime/tests/translate.test.js b/runtime/tests/translate.test.js new file mode 100644 index 000000000..9dd24f128 --- /dev/null +++ b/runtime/tests/translate.test.js @@ -0,0 +1,15 @@ +import { expect, test, describe } from "vitest"; +import { setLocale, translate, locale } from "../index"; + +describe("setLocale", () => { + test("setting locale", () => { + setLocale("en"); + expect(locale.value).toEqual("en"); + }); +}); + +describe("translate", () => { + test("translates a key", () => { + expect(translate("test")).toEqual(""); + }); +}); diff --git a/runtime/tests/utilities.test.js b/runtime/tests/utilities.test.js new file mode 100644 index 000000000..b6e5c5812 --- /dev/null +++ b/runtime/tests/utilities.test.js @@ -0,0 +1,84 @@ +import { render, fireEvent } from "@testing-library/preact"; +import { expect, test, describe } from "vitest"; +import { useState } from "preact/hooks"; +import { h } from "preact"; + +import { + useDidUpdate, + arrayAccess, + useFunction, + identity, + variant, + toArray, + access, + or, +} from "../index"; + +const Nothing = variant(); +const Just = variant(1); + +describe("arrayAccess", () => { + test("it returns a just for an element", () => { + let result = arrayAccess([0], 0, Just, Nothing); + + expect(result).toBeInstanceOf(Just); + expect(result._0).toBe(0); + }); + + test("it returns nothing for an element", () => { + let result = arrayAccess([0], 1, Just, Nothing); + + expect(result).toBeInstanceOf(Nothing); + }); + + test("it returns nothing if index is negative", () => { + let result = arrayAccess([0], -1, Just, Nothing); + + expect(result).toBeInstanceOf(Nothing); + }); +}); + +describe("or", () => { + test("it returns the given item", () => { + expect(or("a", "b")).toEqual("a"); + }); + + test("it returns the given item", () => { + expect(or(null, "b")).toEqual("b"); + }); +}); + +describe("access", () => { + test("it returns the field", () => { + expect(access("a")({ a: "b" })).toEqual("b"); + }); +}); + +describe("identity", () => { + test("it returns the value", () => { + expect(identity("a")).toEqual("a"); + }); +}); + +describe("toArray", () => { + test("it returns an array for not arrays", () => { + expect(toArray(0)).toEqual([0]); + }); + + test("returns the input array for an arrays", () => { + expect(toArray([0])).toEqual([0]); + }); +}); + +describe("useDidUpdate", () => { + test("calls on changes", () => { + const item = h(() => { + useDidUpdate(() => {}); + const [count, setCount] = useState(0); + return h("div", { onClick: () => setCount(1) }, "TEST"); + }); + + const container = render(item); + fireEvent.click(container.getByText("TEST")); + }); +}); diff --git a/runtime/tests/variant.test.js b/runtime/tests/variant.test.js new file mode 100644 index 000000000..b85f5c23d --- /dev/null +++ b/runtime/tests/variant.test.js @@ -0,0 +1,54 @@ +import { variant, compare, newVariant } from "../index"; +import { expect, test, describe } from "vitest"; + +const RecordEnum = variant(["a", "b"]); +const TestEnum2 = variant(2); +const TestEnum = variant(0); + +describe("equality", () => { + test("same intance equals true", () => { + expect(compare(new TestEnum(), new TestEnum())).toEqual(true); + }); + + test("same parameters equals true", () => { + expect(compare(new TestEnum2("0", "1"), new TestEnum2("0", "1"))).toEqual( + true, + ); + }); + + test("different instances equals false", () => { + expect(compare(new TestEnum2("0", "2"), new TestEnum())).toEqual(false); + }); + + test("different lengths equals false", () => { + const a = new TestEnum2("0", "2"); + const b = new TestEnum2("0", "2"); + b.length = 10; + + expect(compare(a, b)).toEqual(false); + }); + + test("different parameters equals false", () => { + expect(compare(new TestEnum2("0", "2"), new TestEnum2("0", "1"))).toEqual( + false, + ); + }); + + test("same enum equals true", () => { + expect( + compare( + newVariant(RecordEnum)("a", "b"), + newVariant(RecordEnum)("a", "b"), + ), + ).toEqual(true); + }); + + test("different enum equals false", () => { + expect( + compare( + newVariant(RecordEnum)("a", "b"), + newVariant(RecordEnum)("a", "c"), + ), + ).toEqual(false); + }); +}); diff --git a/runtime/vite.config.js b/runtime/vite.config.js new file mode 100644 index 000000000..bfd0ef485 --- /dev/null +++ b/runtime/vite.config.js @@ -0,0 +1,10 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + environment: "jsdom", + coverage: { + provider: "v8", + }, + }, +}); diff --git a/runtime/yarn-error.log b/runtime/yarn-error.log new file mode 100644 index 000000000..19ec79c1b --- /dev/null +++ b/runtime/yarn-error.log @@ -0,0 +1,2009 @@ +Arguments: + /home/gus/.asdf/installs/nodejs/20.10.0/bin/node /home/gus/.asdf/installs/yarn/1.22.19/bin/yarn.js + +PATH: + /home/gus/.asdf/plugins/nodejs/shims:/home/gus/.asdf/installs/nodejs/20.10.0/.npm/bin:/home/gus/.asdf/installs/nodejs/20.10.0/bin:/home/gus/.asdf/installs/yarn/1.22.19/bin:/home/gus/.fly/bin:/home/gus/.asdf/shims:/home/gus/.asdf/bin:/home/gus/.cache/rebar3/bin:/home/gus/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-17-oracle/bin:/usr/lib/jvm/java-17-oracle/db/bin + +Yarn version: + 1.22.19 + +Node version: + 20.10.0 + +Platform: + linux x64 + +Trace: + SyntaxError: /home/gus/Projects/mint-lang/mint/runtime/package.json: Expected double-quoted property name in JSON at position 242 + at JSON.parse () + at /home/gus/.asdf/installs/yarn/1.22.19/lib/cli.js:1629:59 + at Generator.next () + at step (/home/gus/.asdf/installs/yarn/1.22.19/lib/cli.js:310:30) + at /home/gus/.asdf/installs/yarn/1.22.19/lib/cli.js:321:13 + +npm manifest: + { + "private": true, + "dependencies": { + "@preact/signals": "^1.2.2", + "fast-equals": "^5.0.1", + "indent-string": "^5.0.0", + "preact": "^10.19.3", + "route-parser": "mint-lang/mint-route-parser", + "uuid-random": "^1.3.2", + }, + "devDependencies": { + "@testing-library/preact": "^3.2.3", + "@vitest/coverage-v8": "^1.2.1", + "esbuild": "^0.19.11", + "prettier": "^3.1.0", + "vitest": "^1.2.1", + "jsdom": "^23.2.0", + } + } + +yarn manifest: + No manifest + +Lockfile: + # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. + # yarn lockfile v1 + + + "@ampproject/remapping@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + + "@babel/code-frame@^7.10.4": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" + integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== + dependencies: + "@babel/highlight" "^7.23.4" + chalk "^2.4.2" + + "@babel/helper-string-parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" + integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== + + "@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + + "@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + + "@babel/parser@^7.23.3": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" + integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== + + "@babel/runtime@^7.12.5": + version "7.23.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.7.tgz#dd7c88deeb218a0f8bd34d5db1aa242e0f203193" + integrity sha512-w06OXVOFso7LcbzMiDGt+3X7Rh7Ho8MmgPoWU3rarH+8upf+wSU/grlGbWzQyr3DkdN6ZeuMFjpdwW0Q+HxobA== + dependencies: + regenerator-runtime "^0.14.0" + + "@babel/types@^7.23.3": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" + integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== + dependencies: + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + + "@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + + "@esbuild/aix-ppc64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz#2acd20be6d4f0458bc8c784103495ff24f13b1d3" + integrity sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g== + + "@esbuild/android-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz#b45d000017385c9051a4f03e17078abb935be220" + integrity sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q== + + "@esbuild/android-arm64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.8.tgz#fb7130103835b6d43ea499c3f30cfb2b2ed58456" + integrity sha512-B8JbS61bEunhfx8kasogFENgQfr/dIp+ggYXwTqdbMAgGDhRa3AaPpQMuQU0rNxDLECj6FhDzk1cF9WHMVwrtA== + + "@esbuild/android-arm@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.11.tgz#f46f55414e1c3614ac682b29977792131238164c" + integrity sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw== + + "@esbuild/android-arm@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.8.tgz#b46e4d9e984e6d6db6c4224d72c86b7757e35bcb" + integrity sha512-31E2lxlGM1KEfivQl8Yf5aYU/mflz9g06H6S15ITUFQueMFtFjESRMoDSkvMo8thYvLBax+VKTPlpnx+sPicOA== + + "@esbuild/android-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.11.tgz#bfc01e91740b82011ef503c48f548950824922b2" + integrity sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg== + + "@esbuild/android-x64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.8.tgz#a13db9441b5a4f4e4fec4a6f8ffacfea07888db7" + integrity sha512-rdqqYfRIn4jWOp+lzQttYMa2Xar3OK9Yt2fhOhzFXqg0rVWEfSclJvZq5fZslnz6ypHvVf3CT7qyf0A5pM682A== + + "@esbuild/darwin-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz#533fb7f5a08c37121d82c66198263dcc1bed29bf" + integrity sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ== + + "@esbuild/darwin-arm64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.8.tgz#49f5718d36541f40dd62bfdf84da9c65168a0fc2" + integrity sha512-RQw9DemMbIq35Bprbboyf8SmOr4UXsRVxJ97LgB55VKKeJOOdvsIPy0nFyF2l8U+h4PtBx/1kRf0BelOYCiQcw== + + "@esbuild/darwin-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz#62f3819eff7e4ddc656b7c6815a31cf9a1e7d98e" + integrity sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g== + + "@esbuild/darwin-x64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.8.tgz#75c5c88371eea4bfc1f9ecfd0e75104c74a481ac" + integrity sha512-3sur80OT9YdeZwIVgERAysAbwncom7b4bCI2XKLjMfPymTud7e/oY4y+ci1XVp5TfQp/bppn7xLw1n/oSQY3/Q== + + "@esbuild/freebsd-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz#d478b4195aa3ca44160272dab85ef8baf4175b4a" + integrity sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA== + + "@esbuild/freebsd-arm64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.8.tgz#9d7259fea4fd2b5f7437b52b542816e89d7c8575" + integrity sha512-WAnPJSDattvS/XtPCTj1tPoTxERjcTpH6HsMr6ujTT+X6rylVe8ggxk8pVxzf5U1wh5sPODpawNicF5ta/9Tmw== + + "@esbuild/freebsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz#7bdcc1917409178257ca6a1a27fe06e797ec18a2" + integrity sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw== + + "@esbuild/freebsd-x64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.8.tgz#abac03e1c4c7c75ee8add6d76ec592f46dbb39e3" + integrity sha512-ICvZyOplIjmmhjd6mxi+zxSdpPTKFfyPPQMQTK/w+8eNK6WV01AjIztJALDtwNNfFhfZLux0tZLC+U9nSyA5Zg== + + "@esbuild/linux-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz#58ad4ff11685fcc735d7ff4ca759ab18fcfe4545" + integrity sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg== + + "@esbuild/linux-arm64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.8.tgz#c577932cf4feeaa43cb9cec27b89cbe0df7d9098" + integrity sha512-z1zMZivxDLHWnyGOctT9JP70h0beY54xDDDJt4VpTX+iwA77IFsE1vCXWmprajJGa+ZYSqkSbRQ4eyLCpCmiCQ== + + "@esbuild/linux-arm@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz#ce82246d873b5534d34de1e5c1b33026f35e60e3" + integrity sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q== + + "@esbuild/linux-arm@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.8.tgz#d6014d8b98b5cbc96b95dad3d14d75bb364fdc0f" + integrity sha512-H4vmI5PYqSvosPaTJuEppU9oz1dq2A7Mr2vyg5TF9Ga+3+MGgBdGzcyBP7qK9MrwFQZlvNyJrvz6GuCaj3OukQ== + + "@esbuild/linux-ia32@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz#cbae1f313209affc74b80f4390c4c35c6ab83fa4" + integrity sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA== + + "@esbuild/linux-ia32@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.8.tgz#2379a0554307d19ac4a6cdc15b08f0ea28e7a40d" + integrity sha512-1a8suQiFJmZz1khm/rDglOc8lavtzEMRo0v6WhPgxkrjcU0LkHj+TwBrALwoz/OtMExvsqbbMI0ChyelKabSvQ== + + "@esbuild/linux-loong64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz#5f32aead1c3ec8f4cccdb7ed08b166224d4e9121" + integrity sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg== + + "@esbuild/linux-loong64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.8.tgz#e2a5bbffe15748b49356a6cd7b2d5bf60c5a7123" + integrity sha512-fHZWS2JJxnXt1uYJsDv9+b60WCc2RlvVAy1F76qOLtXRO+H4mjt3Tr6MJ5l7Q78X8KgCFudnTuiQRBhULUyBKQ== + + "@esbuild/linux-mips64el@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz#38eecf1cbb8c36a616261de858b3c10d03419af9" + integrity sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg== + + "@esbuild/linux-mips64el@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.8.tgz#1359331e6f6214f26f4b08db9b9df661c57cfa24" + integrity sha512-Wy/z0EL5qZYLX66dVnEg9riiwls5IYnziwuju2oUiuxVc+/edvqXa04qNtbrs0Ukatg5HEzqT94Zs7J207dN5Q== + + "@esbuild/linux-ppc64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz#9c5725a94e6ec15b93195e5a6afb821628afd912" + integrity sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA== + + "@esbuild/linux-ppc64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.8.tgz#9ba436addc1646dc89dae48c62d3e951ffe70951" + integrity sha512-ETaW6245wK23YIEufhMQ3HSeHO7NgsLx8gygBVldRHKhOlD1oNeNy/P67mIh1zPn2Hr2HLieQrt6tWrVwuqrxg== + + "@esbuild/linux-riscv64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz#2dc4486d474a2a62bbe5870522a9a600e2acb916" + integrity sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ== + + "@esbuild/linux-riscv64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.8.tgz#fbcf0c3a0b20f40b5fc31c3b7695f0769f9de66b" + integrity sha512-T2DRQk55SgoleTP+DtPlMrxi/5r9AeFgkhkZ/B0ap99zmxtxdOixOMI570VjdRCs9pE4Wdkz7JYrsPvsl7eESg== + + "@esbuild/linux-s390x@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz#4ad8567df48f7dd4c71ec5b1753b6f37561a65a8" + integrity sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q== + + "@esbuild/linux-s390x@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.8.tgz#989e8a05f7792d139d5564ffa7ff898ac6f20a4a" + integrity sha512-NPxbdmmo3Bk7mbNeHmcCd7R7fptJaczPYBaELk6NcXxy7HLNyWwCyDJ/Xx+/YcNH7Im5dHdx9gZ5xIwyliQCbg== + + "@esbuild/linux-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz#b7390c4d5184f203ebe7ddaedf073df82a658766" + integrity sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA== + + "@esbuild/linux-x64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.8.tgz#b187295393a59323397fe5ff51e769ec4e72212b" + integrity sha512-lytMAVOM3b1gPypL2TRmZ5rnXl7+6IIk8uB3eLsV1JwcizuolblXRrc5ShPrO9ls/b+RTp+E6gbsuLWHWi2zGg== + + "@esbuild/netbsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz#d633c09492a1721377f3bccedb2d821b911e813d" + integrity sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ== + + "@esbuild/netbsd-x64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.8.tgz#c1ec0e24ea82313cb1c7bae176bd5acd5bde7137" + integrity sha512-hvWVo2VsXz/8NVt1UhLzxwAfo5sioj92uo0bCfLibB0xlOmimU/DeAEsQILlBQvkhrGjamP0/el5HU76HAitGw== + + "@esbuild/openbsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz#17388c76e2f01125bf831a68c03a7ffccb65d1a2" + integrity sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw== + + "@esbuild/openbsd-x64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.8.tgz#0c5b696ac66c6d70cf9ee17073a581a28af9e18d" + integrity sha512-/7Y7u77rdvmGTxR83PgaSvSBJCC2L3Kb1M/+dmSIvRvQPXXCuC97QAwMugBNG0yGcbEGfFBH7ojPzAOxfGNkwQ== + + "@esbuild/sunos-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz#e320636f00bb9f4fdf3a80e548cb743370d41767" + integrity sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ== + + "@esbuild/sunos-x64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.8.tgz#2a697e1f77926ff09fcc457d8f29916d6cd48fb1" + integrity sha512-9Lc4s7Oi98GqFA4HzA/W2JHIYfnXbUYgekUP/Sm4BG9sfLjyv6GKKHKKVs83SMicBF2JwAX6A1PuOLMqpD001w== + + "@esbuild/win32-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz#c778b45a496e90b6fc373e2a2bb072f1441fe0ee" + integrity sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ== + + "@esbuild/win32-arm64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.8.tgz#ec029e62a2fca8c071842ecb1bc5c2dd20b066f1" + integrity sha512-rq6WzBGjSzihI9deW3fC2Gqiak68+b7qo5/3kmB6Gvbh/NYPA0sJhrnp7wgV4bNwjqM+R2AApXGxMO7ZoGhIJg== + + "@esbuild/win32-ia32@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz#481a65fee2e5cce74ec44823e6b09ecedcc5194c" + integrity sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg== + + "@esbuild/win32-ia32@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.8.tgz#cbb9a3146bde64dc15543e48afe418c7a3214851" + integrity sha512-AIAbverbg5jMvJznYiGhrd3sumfwWs8572mIJL5NQjJa06P8KfCPWZQ0NwZbPQnbQi9OWSZhFVSUWjjIrn4hSw== + + "@esbuild/win32-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz#a5d300008960bb39677c46bf16f53ec70d8dee04" + integrity sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw== + + "@esbuild/win32-x64@0.19.8": + version "0.19.8" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.8.tgz#c8285183dbdb17008578dbacb6e22748709b4822" + integrity sha512-bfZ0cQ1uZs2PqpulNL5j/3w+GDhP36k1K5c38QdQg+Swy51jFZWWeIkteNsufkQxp986wnqRRsb/bHbY1WQ7TA== + + "@istanbuljs/schema@^0.1.2": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + + "@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + + "@jridgewell/gen-mapping@^0.3.0": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + + "@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + + "@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + + "@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + + "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + + "@preact/signals-core@^1.4.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@preact/signals-core/-/signals-core-1.5.0.tgz#5d34db4d3c242c93e1cefb7ce8b2d10ecbdbfa79" + integrity sha512-U2diO1Z4i1n2IoFgMYmRdHWGObNrcuTRxyNEn7deSq2cru0vj0583HYQZHsAqcs7FE+hQyX3mjIV7LAfHCvy8w== + + "@preact/signals@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@preact/signals/-/signals-1.2.2.tgz#78df53b2d7e6cdda0bb32843f12eb0418a0d82b0" + integrity sha512-ColCqdo4cRP18bAuIR4Oik5rDpiyFtPIJIygaYPMEAwTnl4buWkBOflGBSzhYyPyJfKpkwlekrvK+1pzQ2ldWw== + dependencies: + "@preact/signals-core" "^1.4.0" + + "@rollup/rollup-android-arm-eabi@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.2.tgz#ccb02257556bacbc1e756ab9b0b973cea2c7a664" + integrity sha512-RKzxFxBHq9ysZ83fn8Iduv3A283K7zPPYuhL/z9CQuyFrjwpErJx0h4aeb/bnJ+q29GRLgJpY66ceQ/Wcsn3wA== + + "@rollup/rollup-android-arm64@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.2.tgz#21bd0fbafdf442c6a17645b840f6a94556b0e9bb" + integrity sha512-yZ+MUbnwf3SHNWQKJyWh88ii2HbuHCFQnAYTeeO1Nb8SyEiWASEi5dQUygt3ClHWtA9My9RQAYkjvrsZ0WK8Xg== + + "@rollup/rollup-darwin-arm64@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.2.tgz#9f2e5d5637677f9839dbe1622130d0592179136a" + integrity sha512-vqJ/pAUh95FLc/G/3+xPqlSBgilPnauVf2EXOQCZzhZJCXDXt/5A8mH/OzU6iWhb3CNk5hPJrh8pqJUPldN5zw== + + "@rollup/rollup-darwin-x64@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.2.tgz#1b06291ff1c41af94d2786cd167188c5bf7caec9" + integrity sha512-otPHsN5LlvedOprd3SdfrRNhOahhVBwJpepVKUN58L0RnC29vOAej1vMEaVU6DadnpjivVsNTM5eNt0CcwTahw== + + "@rollup/rollup-linux-arm-gnueabihf@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.2.tgz#147069948bba00f435122f411210624e72638ebf" + integrity sha512-ewG5yJSp+zYKBYQLbd1CUA7b1lSfIdo9zJShNTyc2ZP1rcPrqyZcNlsHgs7v1zhgfdS+kW0p5frc0aVqhZCiYQ== + + "@rollup/rollup-linux-arm64-gnu@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.2.tgz#3a50f0e7ae6e444d11c61fce12783196454a4efb" + integrity sha512-pL6QtV26W52aCWTG1IuFV3FMPL1m4wbsRG+qijIvgFO/VBsiXJjDPE/uiMdHBAO6YcpV4KvpKtd0v3WFbaxBtg== + + "@rollup/rollup-linux-arm64-musl@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.2.tgz#82b5e75484d91c25d4e649d018d9523e72d6dac2" + integrity sha512-On+cc5EpOaTwPSNetHXBuqylDW+765G/oqB9xGmWU3npEhCh8xu0xqHGUA+4xwZLqBbIZNcBlKSIYfkBm6ko7g== + + "@rollup/rollup-linux-riscv64-gnu@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.2.tgz#ca96f2d43a553d73aec736e991c07010561bc7a9" + integrity sha512-Wnx/IVMSZ31D/cO9HSsU46FjrPWHqtdF8+0eyZ1zIB5a6hXaZXghUKpRrC4D5DcRTZOjml2oBhXoqfGYyXKipw== + + "@rollup/rollup-linux-x64-gnu@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.2.tgz#db1cece244ea46706c0e1a522ec19ca0173abc55" + integrity sha512-ym5x1cj4mUAMBummxxRkI4pG5Vht1QMsJexwGP8547TZ0sox9fCLDHw9KCH9c1FO5d9GopvkaJsBIOkTKxksdw== + + "@rollup/rollup-linux-x64-musl@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.2.tgz#c15b26b86827f75977bf59ebd41ce5d788713936" + integrity sha512-m0hYELHGXdYx64D6IDDg/1vOJEaiV8f1G/iO+tejvRCJNSwK4jJ15e38JQy5Q6dGkn1M/9KcyEOwqmlZ2kqaZg== + + "@rollup/rollup-win32-arm64-msvc@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.2.tgz#60152948f9fb08e8c50c1555e334ca9f9f1f53aa" + integrity sha512-x1CWburlbN5JjG+juenuNa4KdedBdXLjZMp56nHFSHTOsb/MI2DYiGzLtRGHNMyydPGffGId+VgjOMrcltOksA== + + "@rollup/rollup-win32-ia32-msvc@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.2.tgz#657288cff10311f997d8dbd648590441760ae6d9" + integrity sha512-VVzCB5yXR1QlfsH1Xw1zdzQ4Pxuzv+CPr5qpElpKhVxlxD3CRdfubAG9mJROl6/dmj5gVYDDWk8sC+j9BI9/kQ== + + "@rollup/rollup-win32-x64-msvc@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.2.tgz#830f3a3fba67f6216a5884368431918029045afe" + integrity sha512-SYRedJi+mweatroB+6TTnJYLts0L0bosg531xnQWtklOI6dezEagx4Q0qDyvRdK+qgdA3YZpjjGuPFtxBmddBA== + + "@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + + "@testing-library/dom@^8.11.1": + version "8.20.1" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.20.1.tgz#2e52a32e46fc88369eef7eef634ac2a192decd9f" + integrity sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/runtime" "^7.12.5" + "@types/aria-query" "^5.0.1" + aria-query "5.1.3" + chalk "^4.1.0" + dom-accessibility-api "^0.5.9" + lz-string "^1.5.0" + pretty-format "^27.0.2" + + "@testing-library/preact@^3.2.3": + version "3.2.3" + resolved "https://registry.yarnpkg.com/@testing-library/preact/-/preact-3.2.3.tgz#0d331b7a7f934a4b0fc6c95ff3a9e1d6fa93094e" + integrity sha512-y6Kklp1XK3f1X2fWCbujmJyzkf+1BgLYXNgAx21j9+D4CoqMTz5qC4SQufb1L6q/jxLGACzrQ90ewVOTBvHOfg== + dependencies: + "@testing-library/dom" "^8.11.1" + + "@types/aria-query@^5.0.1": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.4.tgz#1a31c3d378850d2778dabb6374d036dcba4ba708" + integrity sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw== + + "@types/istanbul-lib-coverage@^2.0.1": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== + + "@vitest/coverage-v8@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@vitest/coverage-v8/-/coverage-v8-1.1.1.tgz#8cf41ef4c4e8bf979937452f5ab446e29e61aba1" + integrity sha512-TCXSh6sA92t7D5p7HJ64sPCi+szP8E3NiKTsR3YR8vVEVZB9yclQu2btktCthxahKBl7PwheP5OuejYg13xccg== + dependencies: + "@ampproject/remapping" "^2.2.1" + "@bcoe/v8-coverage" "^0.2.3" + debug "^4.3.4" + istanbul-lib-coverage "^3.2.2" + istanbul-lib-report "^3.0.1" + istanbul-lib-source-maps "^4.0.1" + istanbul-reports "^3.1.6" + magic-string "^0.30.5" + magicast "^0.3.2" + picocolors "^1.0.0" + std-env "^3.5.0" + test-exclude "^6.0.0" + v8-to-istanbul "^9.2.0" + + "@vitest/expect@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-1.1.1.tgz#6b00a5e9ecccdc9da112e89214693a857564e39c" + integrity sha512-Qpw01C2Hyb3085jBkOJLQ7HRX0Ncnh2qV4p+xWmmhcIUlMykUF69zsnZ1vPmAjZpomw9+5tWEGOQ0GTfR8U+kA== + dependencies: + "@vitest/spy" "1.1.1" + "@vitest/utils" "1.1.1" + chai "^4.3.10" + + "@vitest/runner@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-1.1.1.tgz#c2c2a6baa25f3964c3434e94628b324bc0f19587" + integrity sha512-8HokyJo1SnSi3uPFKfWm/Oq1qDwLC4QDcVsqpXIXwsRPAg3gIDh8EbZ1ri8cmQkBxdOu62aOF9B4xcqJhvt4xQ== + dependencies: + "@vitest/utils" "1.1.1" + p-limit "^5.0.0" + pathe "^1.1.1" + + "@vitest/snapshot@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-1.1.1.tgz#40261901102e131cb09f23034884ad2c1c5af317" + integrity sha512-WnMHjv4VdHLbFGgCdVVvyRkRPnOKN75JJg+LLTdr6ah7YnL75W+7CTIMdzPEPzaDxA8r5yvSVlc1d8lH3yE28w== + dependencies: + magic-string "^0.30.5" + pathe "^1.1.1" + pretty-format "^29.7.0" + + "@vitest/spy@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-1.1.1.tgz#49a9c3f9b86f07b86333fc14d1667691b9a77a5c" + integrity sha512-hDU2KkOTfFp4WFFPWwHFauddwcKuGQ7gF6Un/ZZkCogoAiTMN7/7YKvUDbywPZZ754iCQGjdUmXN3t4k0jm1IQ== + dependencies: + tinyspy "^2.2.0" + + "@vitest/utils@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-1.1.1.tgz#493d1963d917a3ac29fbd4c36c1c31cfd17a7b41" + integrity sha512-E9LedH093vST/JuBSyHLFMpxJKW3dLhe/flUSPFedoyj4wKiFX7Jm8gYLtOIiin59dgrssfmFv0BJ1u8P/LC/A== + dependencies: + diff-sequences "^29.6.3" + loupe "^2.3.7" + pretty-format "^29.7.0" + + acorn-walk@^8.3.0: + version "8.3.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.1.tgz#2f10f5b69329d90ae18c58bf1fa8fccd8b959a43" + integrity sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw== + + acorn@^8.10.0: + version "8.11.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" + integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== + + agent-base@^7.0.2, agent-base@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434" + integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg== + dependencies: + debug "^4.3.4" + + ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + + ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + + ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + + ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + + aria-query@5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" + integrity sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ== + dependencies: + deep-equal "^2.0.5" + + array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + + assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + + asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + + available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + + balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + + brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + + cac@^6.7.14: + version "6.7.14" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" + integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== + + call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.4, call-bind@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" + integrity sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ== + dependencies: + function-bind "^1.1.2" + get-intrinsic "^1.2.1" + set-function-length "^1.1.1" + + chai@^4.3.10: + version "4.3.10" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.10.tgz#d784cec635e3b7e2ffb66446a63b4e33bd390384" + integrity sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" + pathval "^1.1.1" + type-detect "^4.0.8" + + chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + + chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + + check-error@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" + integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== + dependencies: + get-func-name "^2.0.2" + + color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + + color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + + color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + + color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + + combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + + concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + + convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + + cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + + cssstyle@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-3.0.0.tgz#17ca9c87d26eac764bb8cfd00583cff21ce0277a" + integrity sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg== + dependencies: + rrweb-cssom "^0.6.0" + + data-urls@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-5.0.0.tgz#2f76906bce1824429ffecb6920f45a0b30f00dde" + integrity sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg== + dependencies: + whatwg-mimetype "^4.0.0" + whatwg-url "^14.0.0" + + debug@4, debug@^4.1.1, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + + decimal.js@^10.4.3: + version "10.4.3" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== + + deep-eql@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + + deep-equal@^2.0.5: + version "2.2.3" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.3.tgz#af89dafb23a396c7da3e862abc0be27cf51d56e1" + integrity sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.5" + es-get-iterator "^1.1.3" + get-intrinsic "^1.2.2" + is-arguments "^1.1.1" + is-array-buffer "^3.0.2" + is-date-object "^1.0.5" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + isarray "^2.0.5" + object-is "^1.1.5" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.1" + side-channel "^1.0.4" + which-boxed-primitive "^1.0.2" + which-collection "^1.0.1" + which-typed-array "^1.1.13" + + define-data-property@^1.0.1, define-data-property@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" + integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + + define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + + delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + + diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== + + dom-accessibility-api@^0.5.9: + version "0.5.16" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz#5a7429e6066eb3664d911e33fb0e45de8eb08453" + integrity sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg== + + entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + + es-get-iterator@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.3.tgz#3ef87523c5d464d41084b2c3c9c214f1199763d6" + integrity sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + has-symbols "^1.0.3" + is-arguments "^1.1.1" + is-map "^2.0.2" + is-set "^2.0.2" + is-string "^1.0.7" + isarray "^2.0.5" + stop-iteration-iterator "^1.0.0" + + esbuild@^0.19.3: + version "0.19.11" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.11.tgz#4a02dca031e768b5556606e1b468fe72e3325d96" + integrity sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA== + optionalDependencies: + "@esbuild/aix-ppc64" "0.19.11" + "@esbuild/android-arm" "0.19.11" + "@esbuild/android-arm64" "0.19.11" + "@esbuild/android-x64" "0.19.11" + "@esbuild/darwin-arm64" "0.19.11" + "@esbuild/darwin-x64" "0.19.11" + "@esbuild/freebsd-arm64" "0.19.11" + "@esbuild/freebsd-x64" "0.19.11" + "@esbuild/linux-arm" "0.19.11" + "@esbuild/linux-arm64" "0.19.11" + "@esbuild/linux-ia32" "0.19.11" + "@esbuild/linux-loong64" "0.19.11" + "@esbuild/linux-mips64el" "0.19.11" + "@esbuild/linux-ppc64" "0.19.11" + "@esbuild/linux-riscv64" "0.19.11" + "@esbuild/linux-s390x" "0.19.11" + "@esbuild/linux-x64" "0.19.11" + "@esbuild/netbsd-x64" "0.19.11" + "@esbuild/openbsd-x64" "0.19.11" + "@esbuild/sunos-x64" "0.19.11" + "@esbuild/win32-arm64" "0.19.11" + "@esbuild/win32-ia32" "0.19.11" + "@esbuild/win32-x64" "0.19.11" + + esbuild@^0.19.8: + version "0.19.8" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.8.tgz#ad05b72281d84483fa6b5345bd246c27a207b8f1" + integrity sha512-l7iffQpT2OrZfH2rXIp7/FkmaeZM0vxbxN9KfiCwGYuZqzMg/JdvX26R31Zxn/Pxvsrg3Y9N6XTcnknqDyyv4w== + optionalDependencies: + "@esbuild/android-arm" "0.19.8" + "@esbuild/android-arm64" "0.19.8" + "@esbuild/android-x64" "0.19.8" + "@esbuild/darwin-arm64" "0.19.8" + "@esbuild/darwin-x64" "0.19.8" + "@esbuild/freebsd-arm64" "0.19.8" + "@esbuild/freebsd-x64" "0.19.8" + "@esbuild/linux-arm" "0.19.8" + "@esbuild/linux-arm64" "0.19.8" + "@esbuild/linux-ia32" "0.19.8" + "@esbuild/linux-loong64" "0.19.8" + "@esbuild/linux-mips64el" "0.19.8" + "@esbuild/linux-ppc64" "0.19.8" + "@esbuild/linux-riscv64" "0.19.8" + "@esbuild/linux-s390x" "0.19.8" + "@esbuild/linux-x64" "0.19.8" + "@esbuild/netbsd-x64" "0.19.8" + "@esbuild/openbsd-x64" "0.19.8" + "@esbuild/sunos-x64" "0.19.8" + "@esbuild/win32-arm64" "0.19.8" + "@esbuild/win32-ia32" "0.19.8" + "@esbuild/win32-x64" "0.19.8" + + escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + + event-propagation-path@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/event-propagation-path/-/event-propagation-path-1.0.5.tgz#1eeffa9878c9043e314849cbfa275c7e6e8f15fc" + integrity sha512-1/UU/xRPq3h/7UrWejsYj3ZzJtEA3FdUxKZtWjQ26KLy6yDXxtD+z1wP5mdE+BrlZAIHk7W7cGyG1uaV/Cpstg== + + execa@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c" + integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^8.0.1" + human-signals "^5.0.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^4.1.0" + strip-final-newline "^3.0.0" + + fast-equals@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-5.0.1.tgz#a4eefe3c5d1c0d021aeed0bc10ba5e0c12ee405d" + integrity sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ== + + for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + + form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + + fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + + fsevents@~2.3.2, fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + + function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + + functions-have-names@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + + get-func-name@^2.0.1, get-func-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== + + get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz#281b7622971123e1ef4b3c90fd7539306da93f3b" + integrity sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA== + dependencies: + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + + get-stream@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2" + integrity sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA== + + glob@^7.1.4: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + + gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + + has-bigints@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + + has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + + has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + + has-property-descriptors@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz#52ba30b6c5ec87fd89fa574bc1c39125c6f65340" + integrity sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg== + dependencies: + get-intrinsic "^1.2.2" + + has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + + has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + + has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + + hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== + dependencies: + function-bind "^1.1.2" + + html-encoding-sniffer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz#696df529a7cfd82446369dc5193e590a3735b448" + integrity sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ== + dependencies: + whatwg-encoding "^3.1.1" + + html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + + http-proxy-agent@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz#e9096c5afd071a3fce56e6252bb321583c124673" + integrity sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ== + dependencies: + agent-base "^7.1.0" + debug "^4.3.4" + + https-proxy-agent@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz#e2645b846b90e96c6e6f347fb5b2e41f1590b09b" + integrity sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA== + dependencies: + agent-base "^7.0.2" + debug "4" + + human-signals@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" + integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== + + iconv-lite@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + + indent-string@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-5.0.0.tgz#4fd2980fccaf8622d14c64d694f4cf33c81951a5" + integrity sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg== + + inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + + inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + + internal-slot@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.6.tgz#37e756098c4911c5e912b8edbf71ed3aa116f930" + integrity sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg== + dependencies: + get-intrinsic "^1.2.2" + hasown "^2.0.0" + side-channel "^1.0.4" + + is-arguments@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + + is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + + is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + + is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + + is-callable@^1.1.3: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + + is-date-object@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + + is-map@^2.0.1, is-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" + integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== + + is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + + is-potential-custom-element-name@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== + + is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + + is-set@^2.0.1, is-set@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" + integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== + + is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + + is-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-3.0.0.tgz#e6bfd7aa6bef69f4f472ce9bb681e3e57b4319ac" + integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== + + is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + + is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + + is-typed-array@^1.1.10: + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + + is-weakmap@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" + integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== + + is-weakset@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.2.tgz#4569d67a747a1ce5a994dfd4ef6dcea76e7c0a1d" + integrity sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + + isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + + isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + + istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== + + istanbul-lib-report@^3.0.0, istanbul-lib-report@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^4.0.0" + supports-color "^7.1.0" + + istanbul-lib-source-maps@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + + istanbul-reports@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + + js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + + jsdom@^23.0.1: + version "23.0.1" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-23.0.1.tgz#ede7ff76e89ca035b11178d200710d8982ebfee0" + integrity sha512-2i27vgvlUsGEBO9+/kJQRbtqtm+191b5zAZrU/UezVmnC2dlDAFLgDYJvAEi94T4kjsRKkezEtLQTgsNEsW2lQ== + dependencies: + cssstyle "^3.0.0" + data-urls "^5.0.0" + decimal.js "^10.4.3" + form-data "^4.0.0" + html-encoding-sniffer "^4.0.0" + http-proxy-agent "^7.0.0" + https-proxy-agent "^7.0.2" + is-potential-custom-element-name "^1.0.1" + nwsapi "^2.2.7" + parse5 "^7.1.2" + rrweb-cssom "^0.6.0" + saxes "^6.0.0" + symbol-tree "^3.2.4" + tough-cookie "^4.1.3" + w3c-xmlserializer "^5.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^3.1.1" + whatwg-mimetype "^4.0.0" + whatwg-url "^14.0.0" + ws "^8.14.2" + xml-name-validator "^5.0.0" + + jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + + local-pkg@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.5.0.tgz#093d25a346bae59a99f80e75f6e9d36d7e8c925c" + integrity sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg== + dependencies: + mlly "^1.4.2" + pkg-types "^1.0.3" + + loupe@^2.3.6, loupe@^2.3.7: + version "2.3.7" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.7.tgz#6e69b7d4db7d3ab436328013d37d1c8c3540c697" + integrity sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== + dependencies: + get-func-name "^2.0.1" + + lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + + lz-string@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" + integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ== + + magic-string@^0.30.5: + version "0.30.5" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.5.tgz#1994d980bd1c8835dc6e78db7cbd4ae4f24746f9" + integrity sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.15" + + magicast@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/magicast/-/magicast-0.3.2.tgz#42dcade5573ed8f10f5540f9d04964e21dba9130" + integrity sha512-Fjwkl6a0syt9TFN0JSYpOybxiMCkYNEeOTnOTNRbjphirLakznZXAqrXgj/7GG3D1dvETONNwrBfinvAbpunDg== + dependencies: + "@babel/parser" "^7.23.3" + "@babel/types" "^7.23.3" + source-map-js "^1.0.2" + + make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + + merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + + mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + + mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + + mimic-fn@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" + integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== + + minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + + mlly@^1.2.0, mlly@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.4.2.tgz#7cf406aa319ff6563d25da6b36610a93f2a8007e" + integrity sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg== + dependencies: + acorn "^8.10.0" + pathe "^1.1.1" + pkg-types "^1.0.3" + ufo "^1.3.0" + + ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + + nanoid@^3.3.7: + version "3.3.7" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" + integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== + + npm-run-path@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.2.0.tgz#224cdd22c755560253dd71b83a1ef2f758b2e955" + integrity sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg== + dependencies: + path-key "^4.0.0" + + nwsapi@^2.2.7: + version "2.2.7" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.7.tgz#738e0707d3128cb750dddcfe90e4610482df0f30" + integrity sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ== + + object-inspect@^1.9.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" + integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== + + object-is@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" + integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + + object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + + object.assign@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" + integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== + dependencies: + call-bind "^1.0.5" + define-properties "^1.2.1" + has-symbols "^1.0.3" + object-keys "^1.1.1" + + once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + + onetime@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-6.0.0.tgz#7c24c18ed1fd2e9bca4bd26806a33613c77d34b4" + integrity sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== + dependencies: + mimic-fn "^4.0.0" + + p-limit@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-5.0.0.tgz#6946d5b7140b649b7a33a027d89b4c625b3a5985" + integrity sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ== + dependencies: + yocto-queue "^1.0.0" + + parse5@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" + + path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + + path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + + path-key@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" + integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== + + pathe@^1.1.0, pathe@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.1.tgz#1dd31d382b974ba69809adc9a7a347e65d84829a" + integrity sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q== + + pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + + picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + + pkg-types@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.3.tgz#988b42ab19254c01614d13f4f65a2cfc7880f868" + integrity sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A== + dependencies: + jsonc-parser "^3.2.0" + mlly "^1.2.0" + pathe "^1.1.0" + + postcss@^8.4.32: + version "8.4.32" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.32.tgz#1dac6ac51ab19adb21b8b34fd2d93a86440ef6c9" + integrity sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw== + dependencies: + nanoid "^3.3.7" + picocolors "^1.0.0" + source-map-js "^1.0.2" + + preact@^10.19.2: + version "10.19.2" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.19.2.tgz#841797620dba649aaac1f8be42d37c3202dcea8b" + integrity sha512-UA9DX/OJwv6YwP9Vn7Ti/vF80XL+YA5H2l7BpCtUr3ya8LWHFzpiO5R+N7dN16ujpIxhekRFuOOF82bXX7K/lg== + + prettier@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.0.tgz#c6d16474a5f764ea1a4a373c593b779697744d5e" + integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== + + pretty-format@^27.0.2: + version "27.5.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" + integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== + dependencies: + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + + pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + + psl@^1.1.33: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + + punycode@^2.1.1, punycode@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + + querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + + react-is@^17.0.1: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" + integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== + + react-is@^18.0.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + + regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + + regexp.prototype.flags@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + set-function-name "^2.0.0" + + requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== + + rollup@^4.2.0: + version "4.9.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.9.2.tgz#19d730219b7ec5f51372c6cf15cfb841990489fe" + integrity sha512-66RB8OtFKUTozmVEh3qyNfH+b+z2RXBVloqO2KCC/pjFaGaHtxP9fVfOQKPSGXg2mElmjmxjW/fZ7iKrEpMH5Q== + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.9.2" + "@rollup/rollup-android-arm64" "4.9.2" + "@rollup/rollup-darwin-arm64" "4.9.2" + "@rollup/rollup-darwin-x64" "4.9.2" + "@rollup/rollup-linux-arm-gnueabihf" "4.9.2" + "@rollup/rollup-linux-arm64-gnu" "4.9.2" + "@rollup/rollup-linux-arm64-musl" "4.9.2" + "@rollup/rollup-linux-riscv64-gnu" "4.9.2" + "@rollup/rollup-linux-x64-gnu" "4.9.2" + "@rollup/rollup-linux-x64-musl" "4.9.2" + "@rollup/rollup-win32-arm64-msvc" "4.9.2" + "@rollup/rollup-win32-ia32-msvc" "4.9.2" + "@rollup/rollup-win32-x64-msvc" "4.9.2" + fsevents "~2.3.2" + + route-parser@mint-lang/mint-route-parser: + version "0.0.5" + resolved "https://codeload.github.com/mint-lang/mint-route-parser/tar.gz/903d07a62fe7649fccb6be6694445ee4217c933e" + + rrweb-cssom@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1" + integrity sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw== + + "safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + + saxes@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== + dependencies: + xmlchars "^2.2.0" + + semver@^7.5.3: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + + set-function-length@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.1.1.tgz#4bc39fafb0307224a33e106a7d35ca1218d659ed" + integrity sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ== + dependencies: + define-data-property "^1.1.1" + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + + set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + + shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + + shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + + side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + + siginfo@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30" + integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== + + signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + + source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + + source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + + stackback@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b" + integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== + + std-env@^3.5.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" + integrity sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg== + + stop-iteration-iterator@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz#6a60be0b4ee757d1ed5254858ec66b10c49285e4" + integrity sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ== + dependencies: + internal-slot "^1.0.4" + + strip-final-newline@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" + integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== + + strip-literal@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/strip-literal/-/strip-literal-1.3.0.tgz#db3942c2ec1699e6836ad230090b84bb458e3a07" + integrity sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg== + dependencies: + acorn "^8.10.0" + + supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + + supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + + symbol-tree@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + + test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + + tinybench@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.5.1.tgz#3408f6552125e53a5a48adee31261686fd71587e" + integrity sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg== + + tinypool@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.8.1.tgz#b6c4e4972ede3e3e5cda74a3da1679303d386b03" + integrity sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg== + + tinyspy@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-2.2.0.tgz#9dc04b072746520b432f77ea2c2d17933de5d6ce" + integrity sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg== + + to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + + tough-cookie@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" + integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== + dependencies: + psl "^1.1.33" + punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" + + tr46@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-5.0.0.tgz#3b46d583613ec7283020d79019f1335723801cec" + integrity sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g== + dependencies: + punycode "^2.3.1" + + type-detect@^4.0.0, type-detect@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + + ufo@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.3.2.tgz#c7d719d0628a1c80c006d2240e0d169f6e3c0496" + integrity sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA== + + universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== + + url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + + uuid-random@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/uuid-random/-/uuid-random-1.3.2.tgz#96715edbaef4e84b1dcf5024b00d16f30220e2d0" + integrity sha512-UOzej0Le/UgkbWEO8flm+0y+G+ljUon1QWTEZOq1rnMAsxo2+SckbiZdKzAHHlVh6gJqI1TjC/xwgR50MuCrBQ== + + v8-to-istanbul@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz#2ed7644a245cddd83d4e087b9b33b3e62dfd10ad" + integrity sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^2.0.0" + + vite-node@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-1.1.1.tgz#8cf16d5f841898de919653462c56dc99bb7d2b94" + integrity sha512-2bGE5w4jvym5v8llF6Gu1oBrmImoNSs4WmRVcavnG2me6+8UQntTqLiAMFyiAobp+ZXhj5ZFhI7SmLiFr/jrow== + dependencies: + cac "^6.7.14" + debug "^4.3.4" + pathe "^1.1.1" + picocolors "^1.0.0" + vite "^5.0.0" + + vite@^5.0.0: + version "5.0.10" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.0.10.tgz#1e13ef5c3cf5aa4eed81f5df6d107b3c3f1f6356" + integrity sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw== + dependencies: + esbuild "^0.19.3" + postcss "^8.4.32" + rollup "^4.2.0" + optionalDependencies: + fsevents "~2.3.3" + + vitest@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-1.1.1.tgz#8ebd1a3cdca05da6e589b7d1f504ae952fecbeef" + integrity sha512-Ry2qs4UOu/KjpXVfOCfQkTnwSXYGrqTbBZxw6reIYEFjSy1QUARRg5pxiI5BEXy+kBVntxUYNMlq4Co+2vD3fQ== + dependencies: + "@vitest/expect" "1.1.1" + "@vitest/runner" "1.1.1" + "@vitest/snapshot" "1.1.1" + "@vitest/spy" "1.1.1" + "@vitest/utils" "1.1.1" + acorn-walk "^8.3.0" + cac "^6.7.14" + chai "^4.3.10" + debug "^4.3.4" + execa "^8.0.1" + local-pkg "^0.5.0" + magic-string "^0.30.5" + pathe "^1.1.1" + picocolors "^1.0.0" + std-env "^3.5.0" + strip-literal "^1.3.0" + tinybench "^2.5.1" + tinypool "^0.8.1" + vite "^5.0.0" + vite-node "1.1.1" + why-is-node-running "^2.2.2" + + w3c-xmlserializer@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz#f925ba26855158594d907313cedd1476c5967f6c" + integrity sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA== + dependencies: + xml-name-validator "^5.0.0" + + webidl-conversions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== + + whatwg-encoding@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz#d0f4ef769905d426e1688f3e34381a99b60b76e5" + integrity sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ== + dependencies: + iconv-lite "0.6.3" + + whatwg-mimetype@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz#bc1bf94a985dc50388d54a9258ac405c3ca2fc0a" + integrity sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg== + + whatwg-url@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-14.0.0.tgz#00baaa7fd198744910c4b1ef68378f2200e4ceb6" + integrity sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw== + dependencies: + tr46 "^5.0.0" + webidl-conversions "^7.0.0" + + which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + + which-collection@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" + integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== + dependencies: + is-map "^2.0.1" + is-set "^2.0.1" + is-weakmap "^2.0.1" + is-weakset "^2.0.1" + + which-typed-array@^1.1.11, which-typed-array@^1.1.13: + version "1.1.13" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.13.tgz#870cd5be06ddb616f504e7b039c4c24898184d36" + integrity sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.4" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + + which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + + why-is-node-running@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.2.2.tgz#4185b2b4699117819e7154594271e7e344c9973e" + integrity sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA== + dependencies: + siginfo "^2.0.0" + stackback "0.0.2" + + wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + + ws@^8.14.2: + version "8.16.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" + integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== + + xml-name-validator@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-5.0.0.tgz#82be9b957f7afdacf961e5980f1bf227c0bf7673" + integrity sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg== + + xmlchars@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + + yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + + yocto-queue@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" + integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== diff --git a/runtime/yarn.lock b/runtime/yarn.lock new file mode 100644 index 000000000..170c2b76b --- /dev/null +++ b/runtime/yarn.lock @@ -0,0 +1,1860 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ampproject/remapping@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== + dependencies: + "@jridgewell/gen-mapping" "^0.3.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@asamuzakjp/dom-selector@^2.0.1": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@asamuzakjp/dom-selector/-/dom-selector-2.0.2.tgz#160f601d9a465bbdf641410afdc527f37325506e" + integrity sha512-x1KXOatwofR6ZAYzXRBL5wrdV0vwNxlTCK9NCuLqAzQYARqGcvFwiJA6A1ERuh+dgeA4Dxm3JBYictIes+SqUQ== + dependencies: + bidi-js "^1.0.3" + css-tree "^2.3.1" + is-potential-custom-element-name "^1.0.1" + +"@babel/code-frame@^7.10.4": + version "7.23.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" + integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== + dependencies: + "@babel/highlight" "^7.23.4" + chalk "^2.4.2" + +"@babel/helper-string-parser@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" + integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== + +"@babel/helper-validator-identifier@^7.22.20": + version "7.22.20" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== + +"@babel/highlight@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" + integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== + dependencies: + "@babel/helper-validator-identifier" "^7.22.20" + chalk "^2.4.2" + js-tokens "^4.0.0" + +"@babel/parser@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" + integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== + +"@babel/runtime@^7.12.5": + version "7.23.7" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.23.7.tgz#dd7c88deeb218a0f8bd34d5db1aa242e0f203193" + integrity sha512-w06OXVOFso7LcbzMiDGt+3X7Rh7Ho8MmgPoWU3rarH+8upf+wSU/grlGbWzQyr3DkdN6ZeuMFjpdwW0Q+HxobA== + dependencies: + regenerator-runtime "^0.14.0" + +"@babel/types@^7.23.6": + version "7.23.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" + integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== + dependencies: + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + +"@bcoe/v8-coverage@^0.2.3": + version "0.2.3" + resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" + integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== + +"@esbuild/aix-ppc64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz#2acd20be6d4f0458bc8c784103495ff24f13b1d3" + integrity sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g== + +"@esbuild/android-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz#b45d000017385c9051a4f03e17078abb935be220" + integrity sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q== + +"@esbuild/android-arm@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.19.11.tgz#f46f55414e1c3614ac682b29977792131238164c" + integrity sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw== + +"@esbuild/android-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.19.11.tgz#bfc01e91740b82011ef503c48f548950824922b2" + integrity sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg== + +"@esbuild/darwin-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz#533fb7f5a08c37121d82c66198263dcc1bed29bf" + integrity sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ== + +"@esbuild/darwin-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz#62f3819eff7e4ddc656b7c6815a31cf9a1e7d98e" + integrity sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g== + +"@esbuild/freebsd-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz#d478b4195aa3ca44160272dab85ef8baf4175b4a" + integrity sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA== + +"@esbuild/freebsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz#7bdcc1917409178257ca6a1a27fe06e797ec18a2" + integrity sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw== + +"@esbuild/linux-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz#58ad4ff11685fcc735d7ff4ca759ab18fcfe4545" + integrity sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg== + +"@esbuild/linux-arm@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz#ce82246d873b5534d34de1e5c1b33026f35e60e3" + integrity sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q== + +"@esbuild/linux-ia32@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz#cbae1f313209affc74b80f4390c4c35c6ab83fa4" + integrity sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA== + +"@esbuild/linux-loong64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz#5f32aead1c3ec8f4cccdb7ed08b166224d4e9121" + integrity sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg== + +"@esbuild/linux-mips64el@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz#38eecf1cbb8c36a616261de858b3c10d03419af9" + integrity sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg== + +"@esbuild/linux-ppc64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz#9c5725a94e6ec15b93195e5a6afb821628afd912" + integrity sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA== + +"@esbuild/linux-riscv64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz#2dc4486d474a2a62bbe5870522a9a600e2acb916" + integrity sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ== + +"@esbuild/linux-s390x@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz#4ad8567df48f7dd4c71ec5b1753b6f37561a65a8" + integrity sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q== + +"@esbuild/linux-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz#b7390c4d5184f203ebe7ddaedf073df82a658766" + integrity sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA== + +"@esbuild/netbsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz#d633c09492a1721377f3bccedb2d821b911e813d" + integrity sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ== + +"@esbuild/openbsd-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz#17388c76e2f01125bf831a68c03a7ffccb65d1a2" + integrity sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw== + +"@esbuild/sunos-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz#e320636f00bb9f4fdf3a80e548cb743370d41767" + integrity sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ== + +"@esbuild/win32-arm64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz#c778b45a496e90b6fc373e2a2bb072f1441fe0ee" + integrity sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ== + +"@esbuild/win32-ia32@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz#481a65fee2e5cce74ec44823e6b09ecedcc5194c" + integrity sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg== + +"@esbuild/win32-x64@0.19.11": + version "0.19.11" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz#a5d300008960bb39677c46bf16f53ec70d8dee04" + integrity sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw== + +"@istanbuljs/schema@^0.1.2": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@jest/schemas@^29.6.3": + version "29.6.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.6.3.tgz#430b5ce8a4e0044a7e3819663305a7b3091c8e03" + integrity sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA== + dependencies: + "@sinclair/typebox" "^0.27.8" + +"@jridgewell/gen-mapping@^0.3.0": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" + integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== + +"@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14", "@jridgewell/sourcemap-codec@^1.4.15": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.20" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" + integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + +"@preact/signals-core@^1.4.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@preact/signals-core/-/signals-core-1.5.0.tgz#5d34db4d3c242c93e1cefb7ce8b2d10ecbdbfa79" + integrity sha512-U2diO1Z4i1n2IoFgMYmRdHWGObNrcuTRxyNEn7deSq2cru0vj0583HYQZHsAqcs7FE+hQyX3mjIV7LAfHCvy8w== + +"@preact/signals@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@preact/signals/-/signals-1.2.2.tgz#78df53b2d7e6cdda0bb32843f12eb0418a0d82b0" + integrity sha512-ColCqdo4cRP18bAuIR4Oik5rDpiyFtPIJIygaYPMEAwTnl4buWkBOflGBSzhYyPyJfKpkwlekrvK+1pzQ2ldWw== + dependencies: + "@preact/signals-core" "^1.4.0" + +"@rollup/rollup-android-arm-eabi@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.9.2.tgz#ccb02257556bacbc1e756ab9b0b973cea2c7a664" + integrity sha512-RKzxFxBHq9ysZ83fn8Iduv3A283K7zPPYuhL/z9CQuyFrjwpErJx0h4aeb/bnJ+q29GRLgJpY66ceQ/Wcsn3wA== + +"@rollup/rollup-android-arm64@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.9.2.tgz#21bd0fbafdf442c6a17645b840f6a94556b0e9bb" + integrity sha512-yZ+MUbnwf3SHNWQKJyWh88ii2HbuHCFQnAYTeeO1Nb8SyEiWASEi5dQUygt3ClHWtA9My9RQAYkjvrsZ0WK8Xg== + +"@rollup/rollup-darwin-arm64@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.9.2.tgz#9f2e5d5637677f9839dbe1622130d0592179136a" + integrity sha512-vqJ/pAUh95FLc/G/3+xPqlSBgilPnauVf2EXOQCZzhZJCXDXt/5A8mH/OzU6iWhb3CNk5hPJrh8pqJUPldN5zw== + +"@rollup/rollup-darwin-x64@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.9.2.tgz#1b06291ff1c41af94d2786cd167188c5bf7caec9" + integrity sha512-otPHsN5LlvedOprd3SdfrRNhOahhVBwJpepVKUN58L0RnC29vOAej1vMEaVU6DadnpjivVsNTM5eNt0CcwTahw== + +"@rollup/rollup-linux-arm-gnueabihf@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.9.2.tgz#147069948bba00f435122f411210624e72638ebf" + integrity sha512-ewG5yJSp+zYKBYQLbd1CUA7b1lSfIdo9zJShNTyc2ZP1rcPrqyZcNlsHgs7v1zhgfdS+kW0p5frc0aVqhZCiYQ== + +"@rollup/rollup-linux-arm64-gnu@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.9.2.tgz#3a50f0e7ae6e444d11c61fce12783196454a4efb" + integrity sha512-pL6QtV26W52aCWTG1IuFV3FMPL1m4wbsRG+qijIvgFO/VBsiXJjDPE/uiMdHBAO6YcpV4KvpKtd0v3WFbaxBtg== + +"@rollup/rollup-linux-arm64-musl@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.9.2.tgz#82b5e75484d91c25d4e649d018d9523e72d6dac2" + integrity sha512-On+cc5EpOaTwPSNetHXBuqylDW+765G/oqB9xGmWU3npEhCh8xu0xqHGUA+4xwZLqBbIZNcBlKSIYfkBm6ko7g== + +"@rollup/rollup-linux-riscv64-gnu@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.9.2.tgz#ca96f2d43a553d73aec736e991c07010561bc7a9" + integrity sha512-Wnx/IVMSZ31D/cO9HSsU46FjrPWHqtdF8+0eyZ1zIB5a6hXaZXghUKpRrC4D5DcRTZOjml2oBhXoqfGYyXKipw== + +"@rollup/rollup-linux-x64-gnu@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.9.2.tgz#db1cece244ea46706c0e1a522ec19ca0173abc55" + integrity sha512-ym5x1cj4mUAMBummxxRkI4pG5Vht1QMsJexwGP8547TZ0sox9fCLDHw9KCH9c1FO5d9GopvkaJsBIOkTKxksdw== + +"@rollup/rollup-linux-x64-musl@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.9.2.tgz#c15b26b86827f75977bf59ebd41ce5d788713936" + integrity sha512-m0hYELHGXdYx64D6IDDg/1vOJEaiV8f1G/iO+tejvRCJNSwK4jJ15e38JQy5Q6dGkn1M/9KcyEOwqmlZ2kqaZg== + +"@rollup/rollup-win32-arm64-msvc@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.9.2.tgz#60152948f9fb08e8c50c1555e334ca9f9f1f53aa" + integrity sha512-x1CWburlbN5JjG+juenuNa4KdedBdXLjZMp56nHFSHTOsb/MI2DYiGzLtRGHNMyydPGffGId+VgjOMrcltOksA== + +"@rollup/rollup-win32-ia32-msvc@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.9.2.tgz#657288cff10311f997d8dbd648590441760ae6d9" + integrity sha512-VVzCB5yXR1QlfsH1Xw1zdzQ4Pxuzv+CPr5qpElpKhVxlxD3CRdfubAG9mJROl6/dmj5gVYDDWk8sC+j9BI9/kQ== + +"@rollup/rollup-win32-x64-msvc@4.9.2": + version "4.9.2" + resolved "https://registry.yarnpkg.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.9.2.tgz#830f3a3fba67f6216a5884368431918029045afe" + integrity sha512-SYRedJi+mweatroB+6TTnJYLts0L0bosg531xnQWtklOI6dezEagx4Q0qDyvRdK+qgdA3YZpjjGuPFtxBmddBA== + +"@sinclair/typebox@^0.27.8": + version "0.27.8" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" + integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + +"@testing-library/dom@^8.11.1": + version "8.20.1" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.20.1.tgz#2e52a32e46fc88369eef7eef634ac2a192decd9f" + integrity sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g== + dependencies: + "@babel/code-frame" "^7.10.4" + "@babel/runtime" "^7.12.5" + "@types/aria-query" "^5.0.1" + aria-query "5.1.3" + chalk "^4.1.0" + dom-accessibility-api "^0.5.9" + lz-string "^1.5.0" + pretty-format "^27.0.2" + +"@testing-library/preact@^3.2.3": + version "3.2.3" + resolved "https://registry.yarnpkg.com/@testing-library/preact/-/preact-3.2.3.tgz#0d331b7a7f934a4b0fc6c95ff3a9e1d6fa93094e" + integrity sha512-y6Kklp1XK3f1X2fWCbujmJyzkf+1BgLYXNgAx21j9+D4CoqMTz5qC4SQufb1L6q/jxLGACzrQ90ewVOTBvHOfg== + dependencies: + "@testing-library/dom" "^8.11.1" + +"@types/aria-query@^5.0.1": + version "5.0.4" + resolved "https://registry.yarnpkg.com/@types/aria-query/-/aria-query-5.0.4.tgz#1a31c3d378850d2778dabb6374d036dcba4ba708" + integrity sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw== + +"@types/estree@^1.0.0": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + +"@types/istanbul-lib-coverage@^2.0.1": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz#7739c232a1fee9b4d3ce8985f314c0c6d33549d7" + integrity sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w== + +"@vitest/coverage-v8@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@vitest/coverage-v8/-/coverage-v8-1.2.1.tgz#e76d64c8f0a8cb882543f12f7a2bc7615b84cbee" + integrity sha512-fJEhKaDwGMZtJUX7BRcGxooGwg1Hl0qt53mVup/ZJeznhvL5EodteVnb/mcByhEcvVWbK83ZF31c7nPEDi4LOQ== + dependencies: + "@ampproject/remapping" "^2.2.1" + "@bcoe/v8-coverage" "^0.2.3" + debug "^4.3.4" + istanbul-lib-coverage "^3.2.2" + istanbul-lib-report "^3.0.1" + istanbul-lib-source-maps "^4.0.1" + istanbul-reports "^3.1.6" + magic-string "^0.30.5" + magicast "^0.3.3" + picocolors "^1.0.0" + std-env "^3.5.0" + test-exclude "^6.0.0" + v8-to-istanbul "^9.2.0" + +"@vitest/expect@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@vitest/expect/-/expect-1.2.1.tgz#574c0ac138a9e34522da202ea4c48a3adfe7240e" + integrity sha512-/bqGXcHfyKgFWYwIgFr1QYDaR9e64pRKxgBNWNXPefPFRhgm+K3+a/dS0cUGEreWngets3dlr8w8SBRw2fCfFQ== + dependencies: + "@vitest/spy" "1.2.1" + "@vitest/utils" "1.2.1" + chai "^4.3.10" + +"@vitest/runner@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@vitest/runner/-/runner-1.2.1.tgz#13e65b47eb04e572b99757e55f063f8f025822b2" + integrity sha512-zc2dP5LQpzNzbpaBt7OeYAvmIsRS1KpZQw4G3WM/yqSV1cQKNKwLGmnm79GyZZjMhQGlRcSFMImLjZaUQvNVZQ== + dependencies: + "@vitest/utils" "1.2.1" + p-limit "^5.0.0" + pathe "^1.1.1" + +"@vitest/snapshot@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@vitest/snapshot/-/snapshot-1.2.1.tgz#bd2dcae2322b90bab1660421ff9dae73fc84ecc0" + integrity sha512-Tmp/IcYEemKaqAYCS08sh0vORLJkMr0NRV76Gl8sHGxXT5151cITJCET20063wk0Yr/1koQ6dnmP6eEqezmd/Q== + dependencies: + magic-string "^0.30.5" + pathe "^1.1.1" + pretty-format "^29.7.0" + +"@vitest/spy@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@vitest/spy/-/spy-1.2.1.tgz#2777444890de9d32e55e600e34a13b2074cabc18" + integrity sha512-vG3a/b7INKH7L49Lbp0IWrG6sw9j4waWAucwnksPB1r1FTJgV7nkBByd9ufzu6VWya/QTvQW4V9FShZbZIB2UQ== + dependencies: + tinyspy "^2.2.0" + +"@vitest/utils@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@vitest/utils/-/utils-1.2.1.tgz#ad798cb13ec9e9e97b13be65d135e9e8e3c586aa" + integrity sha512-bsH6WVZYe/J2v3+81M5LDU8kW76xWObKIURpPrOXm2pjBniBu2MERI/XP60GpS4PHU3jyK50LUutOwrx4CyHUg== + dependencies: + diff-sequences "^29.6.3" + estree-walker "^3.0.3" + loupe "^2.3.7" + pretty-format "^29.7.0" + +acorn-walk@^8.3.2: + version "8.3.2" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa" + integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A== + +acorn@^8.10.0: + version "8.11.3" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a" + integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== + +agent-base@^7.0.2, agent-base@^7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.0.tgz#536802b76bc0b34aa50195eb2442276d613e3434" + integrity sha512-o/zjMZRhJxny7OyEF+Op8X+efiELC7k7yOjMzgfzVqOzXqkBkWI79YoTdOtsuWd5BWhAGAuOY/Xa6xpiaWXiNg== + dependencies: + debug "^4.3.4" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +ansi-styles@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" + integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== + +aria-query@5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" + integrity sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ== + dependencies: + deep-equal "^2.0.5" + +array-buffer-byte-length@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz#fabe8bc193fea865f317fe7807085ee0dee5aead" + integrity sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A== + dependencies: + call-bind "^1.0.2" + is-array-buffer "^3.0.1" + +assertion-error@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" + integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +bidi-js@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/bidi-js/-/bidi-js-1.0.3.tgz#6f8bcf3c877c4d9220ddf49b9bb6930c88f877d2" + integrity sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw== + dependencies: + require-from-string "^2.0.2" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +cac@^6.7.14: + version "6.7.14" + resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" + integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== + +call-bind@^1.0.0, call-bind@^1.0.2, call-bind@^1.0.4, call-bind@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.5.tgz#6fa2b7845ce0ea49bf4d8b9ef64727a2c2e2e513" + integrity sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ== + dependencies: + function-bind "^1.1.2" + get-intrinsic "^1.2.1" + set-function-length "^1.1.1" + +chai@^4.3.10: + version "4.3.10" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.10.tgz#d784cec635e3b7e2ffb66446a63b4e33bd390384" + integrity sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g== + dependencies: + assertion-error "^1.1.0" + check-error "^1.0.3" + deep-eql "^4.1.3" + get-func-name "^2.0.2" + loupe "^2.3.6" + pathval "^1.1.1" + type-detect "^4.0.8" + +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^4.1.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +check-error@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.3.tgz#a6502e4312a7ee969f646e83bb3ddd56281bd694" + integrity sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg== + dependencies: + get-func-name "^2.0.2" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +convert-source-map@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" + integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== + +cross-spawn@^7.0.3: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +css-tree@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-2.3.1.tgz#10264ce1e5442e8572fc82fbe490644ff54b5c20" + integrity sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw== + dependencies: + mdn-data "2.0.30" + source-map-js "^1.0.1" + +cssstyle@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-4.0.1.tgz#ef29c598a1e90125c870525490ea4f354db0660a" + integrity sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ== + dependencies: + rrweb-cssom "^0.6.0" + +data-urls@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-5.0.0.tgz#2f76906bce1824429ffecb6920f45a0b30f00dde" + integrity sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg== + dependencies: + whatwg-mimetype "^4.0.0" + whatwg-url "^14.0.0" + +debug@4, debug@^4.1.1, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +decimal.js@^10.4.3: + version "10.4.3" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== + +deep-eql@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-4.1.3.tgz#7c7775513092f7df98d8df9996dd085eb668cc6d" + integrity sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw== + dependencies: + type-detect "^4.0.0" + +deep-equal@^2.0.5: + version "2.2.3" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.3.tgz#af89dafb23a396c7da3e862abc0be27cf51d56e1" + integrity sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA== + dependencies: + array-buffer-byte-length "^1.0.0" + call-bind "^1.0.5" + es-get-iterator "^1.1.3" + get-intrinsic "^1.2.2" + is-arguments "^1.1.1" + is-array-buffer "^3.0.2" + is-date-object "^1.0.5" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + isarray "^2.0.5" + object-is "^1.1.5" + object-keys "^1.1.1" + object.assign "^4.1.4" + regexp.prototype.flags "^1.5.1" + side-channel "^1.0.4" + which-boxed-primitive "^1.0.2" + which-collection "^1.0.1" + which-typed-array "^1.1.13" + +define-data-property@^1.0.1, define-data-property@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.1.tgz#c35f7cd0ab09883480d12ac5cb213715587800b3" + integrity sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ== + dependencies: + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + +define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" + integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== + dependencies: + define-data-property "^1.0.1" + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +diff-sequences@^29.6.3: + version "29.6.3" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" + integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== + +dom-accessibility-api@^0.5.9: + version "0.5.16" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz#5a7429e6066eb3664d911e33fb0e45de8eb08453" + integrity sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg== + +entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + +es-get-iterator@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.3.tgz#3ef87523c5d464d41084b2c3c9c214f1199763d6" + integrity sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.3" + has-symbols "^1.0.3" + is-arguments "^1.1.1" + is-map "^2.0.2" + is-set "^2.0.2" + is-string "^1.0.7" + isarray "^2.0.5" + stop-iteration-iterator "^1.0.0" + +esbuild@^0.19.11, esbuild@^0.19.3: + version "0.19.11" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.19.11.tgz#4a02dca031e768b5556606e1b468fe72e3325d96" + integrity sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA== + optionalDependencies: + "@esbuild/aix-ppc64" "0.19.11" + "@esbuild/android-arm" "0.19.11" + "@esbuild/android-arm64" "0.19.11" + "@esbuild/android-x64" "0.19.11" + "@esbuild/darwin-arm64" "0.19.11" + "@esbuild/darwin-x64" "0.19.11" + "@esbuild/freebsd-arm64" "0.19.11" + "@esbuild/freebsd-x64" "0.19.11" + "@esbuild/linux-arm" "0.19.11" + "@esbuild/linux-arm64" "0.19.11" + "@esbuild/linux-ia32" "0.19.11" + "@esbuild/linux-loong64" "0.19.11" + "@esbuild/linux-mips64el" "0.19.11" + "@esbuild/linux-ppc64" "0.19.11" + "@esbuild/linux-riscv64" "0.19.11" + "@esbuild/linux-s390x" "0.19.11" + "@esbuild/linux-x64" "0.19.11" + "@esbuild/netbsd-x64" "0.19.11" + "@esbuild/openbsd-x64" "0.19.11" + "@esbuild/sunos-x64" "0.19.11" + "@esbuild/win32-arm64" "0.19.11" + "@esbuild/win32-ia32" "0.19.11" + "@esbuild/win32-x64" "0.19.11" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +estree-walker@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-3.0.3.tgz#67c3e549ec402a487b4fc193d1953a524752340d" + integrity sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g== + dependencies: + "@types/estree" "^1.0.0" + +execa@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/execa/-/execa-8.0.1.tgz#51f6a5943b580f963c3ca9c6321796db8cc39b8c" + integrity sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg== + dependencies: + cross-spawn "^7.0.3" + get-stream "^8.0.1" + human-signals "^5.0.0" + is-stream "^3.0.0" + merge-stream "^2.0.0" + npm-run-path "^5.1.0" + onetime "^6.0.0" + signal-exit "^4.1.0" + strip-final-newline "^3.0.0" + +fast-equals@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-5.0.1.tgz#a4eefe3c5d1c0d021aeed0bc10ba5e0c12ee405d" + integrity sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ== + +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@~2.3.2, fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + +functions-have-names@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + +get-func-name@^2.0.1, get-func-name@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.2.tgz#0d7cf20cd13fda808669ffa88f4ffc7a3943fc41" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@^1.2.0, get-intrinsic@^1.2.1, get-intrinsic@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.2.tgz#281b7622971123e1ef4b3c90fd7539306da93f3b" + integrity sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA== + dependencies: + function-bind "^1.1.2" + has-proto "^1.0.1" + has-symbols "^1.0.3" + hasown "^2.0.0" + +get-stream@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-8.0.1.tgz#def9dfd71742cd7754a7761ed43749a27d02eca2" + integrity sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA== + +glob@^7.1.4: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +gopd@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.0.1.tgz#29ff76de69dac7489b7c0918a5788e56477c332c" + integrity sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA== + dependencies: + get-intrinsic "^1.1.3" + +has-bigints@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-property-descriptors@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz#52ba30b6c5ec87fd89fa574bc1c39125c6f65340" + integrity sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg== + dependencies: + get-intrinsic "^1.2.2" + +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== + +has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +hasown@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" + integrity sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA== + dependencies: + function-bind "^1.1.2" + +html-encoding-sniffer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz#696df529a7cfd82446369dc5193e590a3735b448" + integrity sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ== + dependencies: + whatwg-encoding "^3.1.1" + +html-escaper@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" + integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== + +http-proxy-agent@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-7.0.0.tgz#e9096c5afd071a3fce56e6252bb321583c124673" + integrity sha512-+ZT+iBxVUQ1asugqnD6oWoRiS25AkjNfG085dKJGtGxkdwLQrMKU5wJr2bOOFAXzKcTuqq+7fZlTMgG3SRfIYQ== + dependencies: + agent-base "^7.1.0" + debug "^4.3.4" + +https-proxy-agent@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-7.0.2.tgz#e2645b846b90e96c6e6f347fb5b2e41f1590b09b" + integrity sha512-NmLNjm6ucYwtcUmL7JQC1ZQ57LmHP4lT15FQ8D61nak1rO6DH+fz5qNK2Ap5UN4ZapYICE3/0KodcLYSPsPbaA== + dependencies: + agent-base "^7.0.2" + debug "4" + +human-signals@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-5.0.0.tgz#42665a284f9ae0dade3ba41ebc37eb4b852f3a28" + integrity sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ== + +iconv-lite@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +indent-string@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-5.0.0.tgz#4fd2980fccaf8622d14c64d694f4cf33c81951a5" + integrity sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +internal-slot@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.6.tgz#37e756098c4911c5e912b8edbf71ed3aa116f930" + integrity sha512-Xj6dv+PsbtwyPpEflsejS+oIZxmMlV44zAhG479uYu89MsjcYOhCFnNyKrkJrihbsiasQyY0afoCl/9BLR65bg== + dependencies: + get-intrinsic "^1.2.2" + hasown "^2.0.0" + side-channel "^1.0.4" + +is-arguments@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-array-buffer@^3.0.1, is-array-buffer@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.2.tgz#f2653ced8412081638ecb0ebbd0c41c6e0aecbbe" + integrity sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.2.0" + is-typed-array "^1.1.10" + +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-callable@^1.1.3: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + +is-date-object@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-map@^2.0.1, is-map@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.2.tgz#00922db8c9bf73e81b7a335827bc2a43f2b91127" + integrity sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg== + +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + +is-potential-custom-element-name@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== + +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-set@^2.0.1, is-set@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.2.tgz#90755fa4c2562dc1c5d4024760d6119b94ca18ec" + integrity sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g== + +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + +is-stream@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-3.0.0.tgz#e6bfd7aa6bef69f4f472ce9bb681e3e57b4319ac" + integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== + +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-typed-array@^1.1.10: + version "1.1.12" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.12.tgz#d0bab5686ef4a76f7a73097b95470ab199c57d4a" + integrity sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg== + dependencies: + which-typed-array "^1.1.11" + +is-weakmap@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" + integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== + +is-weakset@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.2.tgz#4569d67a747a1ce5a994dfd4ef6dcea76e7c0a1d" + integrity sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" + integrity sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg== + +istanbul-lib-report@^3.0.0, istanbul-lib-report@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz#908305bac9a5bd175ac6a74489eafd0fc2445a7d" + integrity sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw== + dependencies: + istanbul-lib-coverage "^3.0.0" + make-dir "^4.0.0" + supports-color "^7.1.0" + +istanbul-lib-source-maps@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" + integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== + dependencies: + debug "^4.1.1" + istanbul-lib-coverage "^3.0.0" + source-map "^0.6.1" + +istanbul-reports@^3.1.6: + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== + dependencies: + html-escaper "^2.0.0" + istanbul-lib-report "^3.0.0" + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +jsdom@^23.2.0: + version "23.2.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-23.2.0.tgz#08083220146d41c467efa1c6969f02b525ba6c1d" + integrity sha512-L88oL7D/8ufIES+Zjz7v0aes+oBMh2Xnh3ygWvL0OaICOomKEPKuPnIfBJekiXr+BHbbMjrWn/xqrDQuxFTeyA== + dependencies: + "@asamuzakjp/dom-selector" "^2.0.1" + cssstyle "^4.0.1" + data-urls "^5.0.0" + decimal.js "^10.4.3" + form-data "^4.0.0" + html-encoding-sniffer "^4.0.0" + http-proxy-agent "^7.0.0" + https-proxy-agent "^7.0.2" + is-potential-custom-element-name "^1.0.1" + parse5 "^7.1.2" + rrweb-cssom "^0.6.0" + saxes "^6.0.0" + symbol-tree "^3.2.4" + tough-cookie "^4.1.3" + w3c-xmlserializer "^5.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^3.1.1" + whatwg-mimetype "^4.0.0" + whatwg-url "^14.0.0" + ws "^8.16.0" + xml-name-validator "^5.0.0" + +jsonc-parser@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== + +local-pkg@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.5.0.tgz#093d25a346bae59a99f80e75f6e9d36d7e8c925c" + integrity sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg== + dependencies: + mlly "^1.4.2" + pkg-types "^1.0.3" + +loupe@^2.3.6, loupe@^2.3.7: + version "2.3.7" + resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.7.tgz#6e69b7d4db7d3ab436328013d37d1c8c3540c697" + integrity sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA== + dependencies: + get-func-name "^2.0.1" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +lz-string@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/lz-string/-/lz-string-1.5.0.tgz#c1ab50f77887b712621201ba9fd4e3a6ed099941" + integrity sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ== + +magic-string@^0.30.5: + version "0.30.5" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.30.5.tgz#1994d980bd1c8835dc6e78db7cbd4ae4f24746f9" + integrity sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.4.15" + +magicast@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/magicast/-/magicast-0.3.3.tgz#a15760f982deec9dabc5f314e318d7c6bddcb27b" + integrity sha512-ZbrP1Qxnpoes8sz47AM0z08U+jW6TyRgZzcWy3Ma3vDhJttwMwAFDMMQFobwdBxByBD46JYmxRzeF7w2+wJEuw== + dependencies: + "@babel/parser" "^7.23.6" + "@babel/types" "^7.23.6" + source-map-js "^1.0.2" + +make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-4.0.0.tgz#c3c2307a771277cd9638305f915c29ae741b614e" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + +mdn-data@2.0.30: + version "2.0.30" + resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.30.tgz#ce4df6f80af6cfbe218ecd5c552ba13c4dfa08cc" + integrity sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA== + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mimic-fn@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" + integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== + +minimatch@^3.0.4, minimatch@^3.1.1: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +mlly@^1.2.0, mlly@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/mlly/-/mlly-1.4.2.tgz#7cf406aa319ff6563d25da6b36610a93f2a8007e" + integrity sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg== + dependencies: + acorn "^8.10.0" + pathe "^1.1.1" + pkg-types "^1.0.3" + ufo "^1.3.0" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nanoid@^3.3.7: + version "3.3.7" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.7.tgz#d0c301a691bc8d54efa0a2226ccf3fe2fd656bd8" + integrity sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g== + +npm-run-path@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-5.2.0.tgz#224cdd22c755560253dd71b83a1ef2f758b2e955" + integrity sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg== + dependencies: + path-key "^4.0.0" + +object-inspect@^1.9.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.1.tgz#b96c6109324ccfef6b12216a956ca4dc2ff94bc2" + integrity sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ== + +object-is@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" + integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.5.tgz#3a833f9ab7fdb80fc9e8d2300c803d216d8fdbb0" + integrity sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ== + dependencies: + call-bind "^1.0.5" + define-properties "^1.2.1" + has-symbols "^1.0.3" + object-keys "^1.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-6.0.0.tgz#7c24c18ed1fd2e9bca4bd26806a33613c77d34b4" + integrity sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ== + dependencies: + mimic-fn "^4.0.0" + +p-limit@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-5.0.0.tgz#6946d5b7140b649b7a33a027d89b4c625b3a5985" + integrity sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ== + dependencies: + yocto-queue "^1.0.0" + +parse5@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-key@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-4.0.0.tgz#295588dc3aee64154f877adb9d780b81c554bf18" + integrity sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ== + +pathe@^1.1.0, pathe@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathe/-/pathe-1.1.1.tgz#1dd31d382b974ba69809adc9a7a347e65d84829a" + integrity sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q== + +pathval@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" + integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +pkg-types@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/pkg-types/-/pkg-types-1.0.3.tgz#988b42ab19254c01614d13f4f65a2cfc7880f868" + integrity sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A== + dependencies: + jsonc-parser "^3.2.0" + mlly "^1.2.0" + pathe "^1.1.0" + +postcss@^8.4.32: + version "8.4.32" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.32.tgz#1dac6ac51ab19adb21b8b34fd2d93a86440ef6c9" + integrity sha512-D/kj5JNu6oo2EIy+XL/26JEDTlIbB8hw85G8StOE6L74RQAVVP5rej6wxCNqyMbR4RkPfqvezVbPw81Ngd6Kcw== + dependencies: + nanoid "^3.3.7" + picocolors "^1.0.0" + source-map-js "^1.0.2" + +preact@^10.19.3: + version "10.19.3" + resolved "https://registry.yarnpkg.com/preact/-/preact-10.19.3.tgz#7a7107ed2598a60676c943709ea3efb8aaafa899" + integrity sha512-nHHTeFVBTHRGxJXKkKu5hT8C/YWBkPso4/Gad6xuj5dbptt9iF9NZr9pHbPhBrnT2klheu7mHTxTZ/LjwJiEiQ== + +prettier@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.0.tgz#c6d16474a5f764ea1a4a373c593b779697744d5e" + integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== + +pretty-format@^27.0.2: + version "27.5.1" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-27.5.1.tgz#2181879fdea51a7a5851fb39d920faa63f01d88e" + integrity sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ== + dependencies: + ansi-regex "^5.0.1" + ansi-styles "^5.0.0" + react-is "^17.0.1" + +pretty-format@^29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" + integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== + dependencies: + "@jest/schemas" "^29.6.3" + ansi-styles "^5.0.0" + react-is "^18.0.0" + +psl@^1.1.33: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + +punycode@^2.1.1, punycode@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + +react-is@^17.0.1: + version "17.0.2" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" + integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== + +react-is@^18.0.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" + integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== + +regenerator-runtime@^0.14.0: + version "0.14.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" + integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== + +regexp.prototype.flags@^1.5.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e" + integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.2.0" + set-function-name "^2.0.0" + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== + +rollup@^4.2.0: + version "4.9.2" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-4.9.2.tgz#19d730219b7ec5f51372c6cf15cfb841990489fe" + integrity sha512-66RB8OtFKUTozmVEh3qyNfH+b+z2RXBVloqO2KCC/pjFaGaHtxP9fVfOQKPSGXg2mElmjmxjW/fZ7iKrEpMH5Q== + optionalDependencies: + "@rollup/rollup-android-arm-eabi" "4.9.2" + "@rollup/rollup-android-arm64" "4.9.2" + "@rollup/rollup-darwin-arm64" "4.9.2" + "@rollup/rollup-darwin-x64" "4.9.2" + "@rollup/rollup-linux-arm-gnueabihf" "4.9.2" + "@rollup/rollup-linux-arm64-gnu" "4.9.2" + "@rollup/rollup-linux-arm64-musl" "4.9.2" + "@rollup/rollup-linux-riscv64-gnu" "4.9.2" + "@rollup/rollup-linux-x64-gnu" "4.9.2" + "@rollup/rollup-linux-x64-musl" "4.9.2" + "@rollup/rollup-win32-arm64-msvc" "4.9.2" + "@rollup/rollup-win32-ia32-msvc" "4.9.2" + "@rollup/rollup-win32-x64-msvc" "4.9.2" + fsevents "~2.3.2" + +route-parser@mint-lang/mint-route-parser: + version "0.0.5" + resolved "https://codeload.github.com/mint-lang/mint-route-parser/tar.gz/903d07a62fe7649fccb6be6694445ee4217c933e" + +rrweb-cssom@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz#ed298055b97cbddcdeb278f904857629dec5e0e1" + integrity sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw== + +"safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +saxes@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== + dependencies: + xmlchars "^2.2.0" + +semver@^7.5.3: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + +set-function-length@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.1.1.tgz#4bc39fafb0307224a33e106a7d35ca1218d659ed" + integrity sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ== + dependencies: + define-data-property "^1.1.1" + get-intrinsic "^1.2.1" + gopd "^1.0.1" + has-property-descriptors "^1.0.0" + +set-function-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== + dependencies: + define-data-property "^1.0.1" + functions-have-names "^1.2.3" + has-property-descriptors "^1.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +siginfo@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30" + integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== + +signal-exit@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + +source-map-js@^1.0.1, source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + +source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + +stackback@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/stackback/-/stackback-0.0.2.tgz#1ac8a0d9483848d1695e418b6d031a3c3ce68e3b" + integrity sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw== + +std-env@^3.5.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.7.0.tgz#c9f7386ced6ecf13360b6c6c55b8aaa4ef7481d2" + integrity sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg== + +stop-iteration-iterator@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.0.0.tgz#6a60be0b4ee757d1ed5254858ec66b10c49285e4" + integrity sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ== + dependencies: + internal-slot "^1.0.4" + +strip-final-newline@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-3.0.0.tgz#52894c313fbff318835280aed60ff71ebf12b8fd" + integrity sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw== + +strip-literal@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/strip-literal/-/strip-literal-1.3.0.tgz#db3942c2ec1699e6836ad230090b84bb458e3a07" + integrity sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg== + dependencies: + acorn "^8.10.0" + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +symbol-tree@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +tinybench@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/tinybench/-/tinybench-2.5.1.tgz#3408f6552125e53a5a48adee31261686fd71587e" + integrity sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg== + +tinypool@^0.8.1: + version "0.8.1" + resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.8.1.tgz#b6c4e4972ede3e3e5cda74a3da1679303d386b03" + integrity sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg== + +tinyspy@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-2.2.0.tgz#9dc04b072746520b432f77ea2c2d17933de5d6ce" + integrity sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg== + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + +tough-cookie@^4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.3.tgz#97b9adb0728b42280aa3d814b6b999b2ff0318bf" + integrity sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw== + dependencies: + psl "^1.1.33" + punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" + +tr46@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-5.0.0.tgz#3b46d583613ec7283020d79019f1335723801cec" + integrity sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g== + dependencies: + punycode "^2.3.1" + +type-detect@^4.0.0, type-detect@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" + integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== + +ufo@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-1.3.2.tgz#c7d719d0628a1c80c006d2240e0d169f6e3c0496" + integrity sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA== + +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== + +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + +uuid-random@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/uuid-random/-/uuid-random-1.3.2.tgz#96715edbaef4e84b1dcf5024b00d16f30220e2d0" + integrity sha512-UOzej0Le/UgkbWEO8flm+0y+G+ljUon1QWTEZOq1rnMAsxo2+SckbiZdKzAHHlVh6gJqI1TjC/xwgR50MuCrBQ== + +v8-to-istanbul@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz#2ed7644a245cddd83d4e087b9b33b3e62dfd10ad" + integrity sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.12" + "@types/istanbul-lib-coverage" "^2.0.1" + convert-source-map "^2.0.0" + +vite-node@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/vite-node/-/vite-node-1.2.1.tgz#bca96ae91b2b1ee9a7aa73685908362d70ce26a8" + integrity sha512-fNzHmQUSOY+y30naohBvSW7pPn/xn3Ib/uqm+5wAJQJiqQsU0NBR78XdRJb04l4bOFKjpTWld0XAfkKlrDbySg== + dependencies: + cac "^6.7.14" + debug "^4.3.4" + pathe "^1.1.1" + picocolors "^1.0.0" + vite "^5.0.0" + +vite@^5.0.0: + version "5.0.10" + resolved "https://registry.yarnpkg.com/vite/-/vite-5.0.10.tgz#1e13ef5c3cf5aa4eed81f5df6d107b3c3f1f6356" + integrity sha512-2P8J7WWgmc355HUMlFrwofacvr98DAjoE52BfdbwQtyLH06XKwaL/FMnmKM2crF0iX4MpmMKoDlNCB1ok7zHCw== + dependencies: + esbuild "^0.19.3" + postcss "^8.4.32" + rollup "^4.2.0" + optionalDependencies: + fsevents "~2.3.3" + +vitest@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/vitest/-/vitest-1.2.1.tgz#9afb705826a2c6260a71b625d28b49117833dce6" + integrity sha512-TRph8N8rnSDa5M2wKWJCMnztCZS9cDcgVTQ6tsTFTG/odHJ4l5yNVqvbeDJYJRZ6is3uxaEpFs8LL6QM+YFSdA== + dependencies: + "@vitest/expect" "1.2.1" + "@vitest/runner" "1.2.1" + "@vitest/snapshot" "1.2.1" + "@vitest/spy" "1.2.1" + "@vitest/utils" "1.2.1" + acorn-walk "^8.3.2" + cac "^6.7.14" + chai "^4.3.10" + debug "^4.3.4" + execa "^8.0.1" + local-pkg "^0.5.0" + magic-string "^0.30.5" + pathe "^1.1.1" + picocolors "^1.0.0" + std-env "^3.5.0" + strip-literal "^1.3.0" + tinybench "^2.5.1" + tinypool "^0.8.1" + vite "^5.0.0" + vite-node "1.2.1" + why-is-node-running "^2.2.2" + +w3c-xmlserializer@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz#f925ba26855158594d907313cedd1476c5967f6c" + integrity sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA== + dependencies: + xml-name-validator "^5.0.0" + +webidl-conversions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== + +whatwg-encoding@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz#d0f4ef769905d426e1688f3e34381a99b60b76e5" + integrity sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ== + dependencies: + iconv-lite "0.6.3" + +whatwg-mimetype@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz#bc1bf94a985dc50388d54a9258ac405c3ca2fc0a" + integrity sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg== + +whatwg-url@^14.0.0: + version "14.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-14.0.0.tgz#00baaa7fd198744910c4b1ef68378f2200e4ceb6" + integrity sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw== + dependencies: + tr46 "^5.0.0" + webidl-conversions "^7.0.0" + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which-collection@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" + integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== + dependencies: + is-map "^2.0.1" + is-set "^2.0.1" + is-weakmap "^2.0.1" + is-weakset "^2.0.1" + +which-typed-array@^1.1.11, which-typed-array@^1.1.13: + version "1.1.13" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.13.tgz#870cd5be06ddb616f504e7b039c4c24898184d36" + integrity sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.4" + for-each "^0.3.3" + gopd "^1.0.1" + has-tostringtag "^1.0.0" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +why-is-node-running@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/why-is-node-running/-/why-is-node-running-2.2.2.tgz#4185b2b4699117819e7154594271e7e344c9973e" + integrity sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA== + dependencies: + siginfo "^2.0.0" + stackback "0.0.2" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +ws@^8.16.0: + version "8.16.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.16.0.tgz#d1cd774f36fbc07165066a60e40323eab6446fd4" + integrity sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ== + +xml-name-validator@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-5.0.0.tgz#82be9b957f7afdacf961e5980f1bf227c0bf7673" + integrity sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg== + +xmlchars@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yocto-queue@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-1.0.0.tgz#7f816433fb2cbc511ec8bf7d263c3b58a1a3c251" + integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g== diff --git a/spec/compilers/case_with_nested_tuple_destructuring b/spec/compilers/case_with_nested_tuple_destructuring index 556ea4b71..436d7f072 100644 --- a/spec/compilers/case_with_nested_tuple_destructuring +++ b/spec/compilers/case_with_nested_tuple_destructuring @@ -1,10 +1,10 @@ component Main { fun render : String { - case ({"A", {"B"}}) { - {"A", {"C"}} => + case ({"A", {"B", ""}}) { + {"A", {"C", ""}} => "B" - {"A", {"B"}} => + {"A", {"B", ""}} => "A" {a, b} => @@ -18,12 +18,13 @@ component Main { -------------------------------------------------------------------------------- class A extends _C { render() { - return _match([`A`, [`B`]],[ + return _match([`A`, [`B`, ``]],[ [ [ `A`, [ - `C` + `C`, + `` ] ], () => { @@ -34,7 +35,8 @@ class A extends _C { [ `A`, [ - `B` + `B`, + `` ] ], () => { diff --git a/spec/compilers/constant_store_exposed b/spec/compilers/constant_store_exposed index 386310f21..080dd5e4d 100644 --- a/spec/compilers/constant_store_exposed +++ b/spec/compilers/constant_store_exposed @@ -13,8 +13,8 @@ component Main { } -------------------------------------------------------------------------------- class A extends _C { - get a() { - return B.b; + get b() { + return B.a; } componentWillUnmount() { @@ -40,7 +40,7 @@ const B = new(class extends _S { this.state = {}; this._d({ - b: () => { + a: () => { return `ASD` } }); diff --git a/spec/compilers/if_let_await b/spec/compilers/if_let_await index f04a7da60..bba9f6c12 100644 --- a/spec/compilers/if_let_await +++ b/spec/compilers/if_let_await @@ -5,11 +5,15 @@ enum T { component Main { fun render : String { - if (let T::A(a) = await T::A("")) { - a - } else { - "b" + { + if (let T::A(a) = await T::A("")) { + a + } else { + "b" + } } + + "" } } -------------------------------------------------------------------------------- @@ -30,7 +34,7 @@ class B extends _E { class C extends _C { render() { - return (async () => { + (async () => { let b = await _n(A)(``); return _match(b,[ @@ -50,6 +54,8 @@ class C extends _C { ] ]); })(); + + return ``; } }; diff --git a/spec/compilers/store b/spec/compilers/store index f24b8a744..a19d8a621 100644 --- a/spec/compilers/store +++ b/spec/compilers/store @@ -15,8 +15,8 @@ component Main { } -------------------------------------------------------------------------------- class A extends _C { - get a() { - return B.b; + get b() { + return B.a; } componentWillUnmount() { @@ -39,12 +39,12 @@ const B = new(class extends _S { super(); this.state = { - b: `` + a: `` }; } - get b() { - return this.state.b; + get a() { + return this.state.a; } c() { diff --git a/spec/compilers/store_with_get b/spec/compilers/store_with_get index d09d51cd7..f875102f5 100644 --- a/spec/compilers/store_with_get +++ b/spec/compilers/store_with_get @@ -15,8 +15,8 @@ component Main { } -------------------------------------------------------------------------------- class A extends _C { - get a() { - return B.b; + get b() { + return B.a; } componentWillUnmount() { @@ -39,12 +39,12 @@ const B = new(class extends _S { super(); this.state = { - b: `` + a: `` }; } - get b() { - return this.state.b; + get a() { + return this.state.a; } get c() { diff --git a/spec/compilers2/access b/spec/compilers2/access new file mode 100644 index 000000000..52c19f469 --- /dev/null +++ b/spec/compilers2/access @@ -0,0 +1,15 @@ +type X { + name : String +} + +component Main { + fun render : String { + { name: "test" }.name + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return { + name: `test` + }.name +}; diff --git a/spec/compilers2/access_deep b/spec/compilers2/access_deep new file mode 100644 index 000000000..dd7eb3008 --- /dev/null +++ b/spec/compilers2/access_deep @@ -0,0 +1,35 @@ +type Locale { + level1: Level1 +} + +type Level1 { + level2: Level2 +} + +type Level2 { + name : String +} + +store Settings { + state locale : Locale = { level1: { level2: { name: "Test" }} } +} + +component Main { + fun render : String { + Settings.locale.level1.level2.name + } +} +-------------------------------------------------------------------------------- +import { signal as A } from "runtime"; + +export const + a = A({ + level1: { + level2: { + name: `Test` + } + } + }), + B = () => { + return a.value.level1.level2.name + }; diff --git a/spec/compilers2/argument b/spec/compilers2/argument new file mode 100644 index 000000000..e38d7c8a5 --- /dev/null +++ b/spec/compilers2/argument @@ -0,0 +1,19 @@ +component Main { + fun test (a : String, b : Number) : Number { + b + } + + fun render : String { + test("", 0) + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = (b, c) => { + return c + }; + a(``, 0); + return `` +}; diff --git a/spec/compilers2/argument_with_default b/spec/compilers2/argument_with_default new file mode 100644 index 000000000..a8433d8b6 --- /dev/null +++ b/spec/compilers2/argument_with_default @@ -0,0 +1,19 @@ +component Main { + fun test (a : String, b : Number = 0) : Number { + b + } + + fun render : String { + test("") + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = (b, c = 0) => { + return c + }; + a(``); + return `` +}; diff --git a/spec/compilers2/argument_with_default_inline_function b/spec/compilers2/argument_with_default_inline_function new file mode 100644 index 000000000..ef98ddc90 --- /dev/null +++ b/spec/compilers2/argument_with_default_inline_function @@ -0,0 +1,20 @@ +component Main { + fun render : String { + let test = + (a : String, b : Number = 0) : Number { + b + } + + test("") + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = (b, c = 0) => { + return c + }; + a(``); + return `` +}; diff --git a/spec/compilers2/array_access b/spec/compilers2/array_access new file mode 100644 index 000000000..0e9118709 --- /dev/null +++ b/spec/compilers2/array_access @@ -0,0 +1,36 @@ +type Maybe(a) { + Nothing + Just(a) +} + +component Main { + fun render : String { + [ + "Hello", + "Blah", + "Joe" + ][1] + + [][1] + + "" + } +} +-------------------------------------------------------------------------------- +import { + arrayAccess as E, + variant as B +} from "runtime"; + +export const + A = B(0), + C = B(1), + D = () => { + E([ + `Hello`, + `Blah`, + `Joe` + ], 1, C, A); + E([], 1, C, A); + return `` + }; diff --git a/spec/compilers2/array_literal b/spec/compilers2/array_literal new file mode 100644 index 000000000..c2e86a127 --- /dev/null +++ b/spec/compilers2/array_literal @@ -0,0 +1,20 @@ +component Main { + fun render : String { + [ + "Hello", + "Blah", + "Joe" + ] + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + [ + `Hello`, + `Blah`, + `Joe` + ]; + return `` +}; diff --git a/spec/compilers2/block b/spec/compilers2/block new file mode 100644 index 000000000..07661b944 --- /dev/null +++ b/spec/compilers2/block @@ -0,0 +1,12 @@ +component Main { + fun render : String { + let a = "Some string..." + + a + ", other string..." + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = `Some string...`; + return a + `, other string...` +}; diff --git a/spec/compilers2/block_with_await b/spec/compilers2/block_with_await new file mode 100644 index 000000000..97dfafca4 --- /dev/null +++ b/spec/compilers2/block_with_await @@ -0,0 +1,27 @@ +component Main { + fun promise : Promise(String) { + `` as Promise(String) + } + + fun promiseTest : Promise(String) { + await promise() + } + + fun render : String { + promiseTest() + + "Hello" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const + a = () => { + return undefined + }, + b = async () => { + return await a() + }; + b(); + return `Hello` +}; diff --git a/spec/compilers2/block_with_early_return b/spec/compilers2/block_with_early_return new file mode 100644 index 000000000..da0242f99 --- /dev/null +++ b/spec/compilers2/block_with_early_return @@ -0,0 +1,33 @@ +enum Test { + A(String) + B(String) +} + +component Main { + fun render : String { + let Test::A(a) = + Test::A("Some string...") or return "RETURN" + + a + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as H, + destructure as E, + newVariant as F, + pattern as G, + variant as B +} from "runtime"; + +export const + A = B(1), + C = B(1), + D = () => { + const a = E(F(C)(`Some string...`), G(C, [H])); + if (a === false) { + return `RETURN` + }; + const [b] = a; + return b + }; diff --git a/spec/compilers2/block_with_early_return_2 b/spec/compilers2/block_with_early_return_2 new file mode 100644 index 000000000..022607659 --- /dev/null +++ b/spec/compilers2/block_with_early_return_2 @@ -0,0 +1,11 @@ +component Main { + fun render : String { + return "YES" + "NO" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `YES`; + return `NO` +}; diff --git a/spec/compilers2/block_with_early_return_await b/spec/compilers2/block_with_early_return_await new file mode 100644 index 000000000..0b504f2e6 --- /dev/null +++ b/spec/compilers2/block_with_early_return_await @@ -0,0 +1,40 @@ +enum Test { + A(String) + B(String) +} + +component Main { + fun render : String { + { + let Test::A(a) = + await Test::A("Some string...") or return "RETURN" + + a + } + + "" + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as H, + destructure as E, + newVariant as F, + pattern as G, + variant as B +} from "runtime"; + +export const + A = B(1), + C = B(1), + D = () => { + (async () => { + const a = E(await F(C)(`Some string...`), G(C, [H])); + if (a === false) { + return `RETURN` + }; + const [b] = a; + return b + })(); + return `` + }; diff --git a/spec/compilers2/block_with_tuple_destructuring b/spec/compilers2/block_with_tuple_destructuring new file mode 100644 index 000000000..c625e9694 --- /dev/null +++ b/spec/compilers2/block_with_tuple_destructuring @@ -0,0 +1,18 @@ +component Main { + fun render : String { + let {a, b} = {"Some string...", "B"} + + a + ", other string..." + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const [ + a, + b + ] = [ + `Some string...`, + `B` + ]; + return a + `, other string...` +}; diff --git a/spec/compilers2/bool_literal_false b/spec/compilers2/bool_literal_false new file mode 100644 index 000000000..f602b7803 --- /dev/null +++ b/spec/compilers2/bool_literal_false @@ -0,0 +1,12 @@ +component Main { + fun render : String { + false + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + false; + return `` +}; diff --git a/spec/compilers2/bool_literal_true b/spec/compilers2/bool_literal_true new file mode 100644 index 000000000..67d0b3639 --- /dev/null +++ b/spec/compilers2/bool_literal_true @@ -0,0 +1,12 @@ +component Main { + fun render : String { + true + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + true; + return `` +}; diff --git a/spec/compilers2/call_labelled b/spec/compilers2/call_labelled new file mode 100644 index 000000000..d3a9a60aa --- /dev/null +++ b/spec/compilers2/call_labelled @@ -0,0 +1,16 @@ +component Main { + fun test (argument1 : String, argument2: Number) : String { + "" + } + + fun render : String { + test(argument2: 0, argument1: "") + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = (b, c) => { + return `` + }; + return a(``, 0) +}; diff --git a/spec/compilers2/case b/spec/compilers2/case new file mode 100644 index 000000000..3ad6df678 --- /dev/null +++ b/spec/compilers2/case @@ -0,0 +1,37 @@ +component Main { + fun render : String { + case ("Hello") { + "test" => true + "Hello" => false + => false + } + + "" + } +} +-------------------------------------------------------------------------------- +import { match as B } from "runtime"; + +export const A = () => { + B(`Hello`, [ + [ + `test`, + () => { + return true + } + ], + [ + `Hello`, + () => { + return false + } + ], + [ + null, + () => { + return false + } + ] + ]); + return `` +}; diff --git a/spec/compilers2/case_await b/spec/compilers2/case_await new file mode 100644 index 000000000..94409b5d0 --- /dev/null +++ b/spec/compilers2/case_await @@ -0,0 +1,40 @@ +component Main { + fun render : String { + case await "Hello" { + "test" => true + "Hello" => false + => false + } + + "" + } +} +-------------------------------------------------------------------------------- +import { match as B } from "runtime"; + +export const A = () => { + (async () => { + let a = await `Hello`; + return B(a, [ + [ + `test`, + () => { + return true + } + ], + [ + `Hello`, + () => { + return false + } + ], + [ + null, + () => { + return false + } + ] + ]) + })(); + return `` +}; diff --git a/spec/compilers2/case_empty b/spec/compilers2/case_empty new file mode 100644 index 000000000..aa8d7544a --- /dev/null +++ b/spec/compilers2/case_empty @@ -0,0 +1,18 @@ +component Main { + fun render : String { + case ("Hello") { + => "false" + } + } +} +-------------------------------------------------------------------------------- +import { match as B } from "runtime"; + +export const A = () => { + return B(`Hello`, [[ + null, + () => { + return `false` + } + ]]) +}; diff --git a/spec/compilers2/case_with_array_destructuring b/spec/compilers2/case_with_array_destructuring new file mode 100644 index 000000000..cef7e8153 --- /dev/null +++ b/spec/compilers2/case_with_array_destructuring @@ -0,0 +1,62 @@ +component Main { + fun render : Array(String) { + case ([]) { + [] => [""] + ["a"] => ["a"] + [a] => [a] + [a, b] => [a, b] + [a, ...middle, b] => middle + } + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as C, + patternSpread as D, + match as B +} from "runtime"; + +export const A = () => { + return B([], [ + [ + [], + () => { + return [``] + } + ], + [ + [`a`], + () => { + return [`a`] + } + ], + [ + [C], + (a) => { + return [a] + } + ], + [ + [ + C, + C + ], + (b, c) => { + return [ + b, + c + ] + } + ], + [ + [ + C, + D, + C + ], + (d, e, f) => { + return e + } + ] + ]) +}; diff --git a/spec/compilers2/case_with_nested_tuple_destructuring b/spec/compilers2/case_with_nested_tuple_destructuring new file mode 100644 index 000000000..22a047387 --- /dev/null +++ b/spec/compilers2/case_with_nested_tuple_destructuring @@ -0,0 +1,78 @@ +component Main { + fun render : String { + case ({"A", {"B", "C"}}) { + {"A", {"C", "D"}} => + "B" + + {"A", {"B", "C"}} => + "A" + + {a, b} => + a + + {a, {b, c}} => + b + } + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as C, + match as B +} from "runtime"; + +export const A = () => { + return B([ + `A`, + [ + `B`, + `C` + ] + ], [ + [ + [ + `A`, + [ + `C`, + `D` + ] + ], + () => { + return `B` + } + ], + [ + [ + `A`, + [ + `B`, + `C` + ] + ], + () => { + return `A` + } + ], + [ + [ + C, + C + ], + (a, b) => { + return a + } + ], + [ + [ + C, + [ + C, + C + ] + ], + (c, d, e) => { + return d + } + ] + ]) +}; diff --git a/spec/compilers2/case_with_tuple_destructuring b/spec/compilers2/case_with_tuple_destructuring new file mode 100644 index 000000000..f6aafec87 --- /dev/null +++ b/spec/compilers2/case_with_tuple_destructuring @@ -0,0 +1,58 @@ +component Main { + fun render : String { + case ({"A", 0, true}) { + {"A", 0, false} => + "B" + + {"A", 0, true} => + "A" + + {a, b, c} => + a + } + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as C, + match as B +} from "runtime"; + +export const A = () => { + return B([ + `A`, + 0, + true + ], [ + [ + [ + `A`, + 0, + false + ], + () => { + return `B` + } + ], + [ + [ + `A`, + 0, + true + ], + () => { + return `A` + } + ], + [ + [ + C, + C, + C + ], + (a, b, c) => { + return a + } + ] + ]) +}; diff --git a/spec/compilers2/case_with_tuple_destructuring_bool b/spec/compilers2/case_with_tuple_destructuring_bool new file mode 100644 index 000000000..56c0eac41 --- /dev/null +++ b/spec/compilers2/case_with_tuple_destructuring_bool @@ -0,0 +1,47 @@ +component Main { + fun render : String { + case ({false, true}) { + {true, false} => + "B" + + {false, true} => + "A" + + => "C" + } + } +} +-------------------------------------------------------------------------------- +import { match as B } from "runtime"; + +export const A = () => { + return B([ + false, + true + ], [ + [ + [ + true, + false + ], + () => { + return `B` + } + ], + [ + [ + false, + true + ], + () => { + return `A` + } + ], + [ + null, + () => { + return `C` + } + ] + ]) +}; diff --git a/spec/compilers2/case_with_type_destructuring b/spec/compilers2/case_with_type_destructuring new file mode 100644 index 000000000..14441b717 --- /dev/null +++ b/spec/compilers2/case_with_type_destructuring @@ -0,0 +1,58 @@ +enum A(a) { + B(a) +} + +enum C(a) { + D(A(a)) + X +} + +component Main { + fun render : String { + case (C::D(A::B(""))) { + C::X => "" + C::D(a) => + case (a) { + A::B(c) => + c + } + } + + "" + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as I, + newVariant as G, + pattern as H, + variant as B, + match as F +} from "runtime"; + +export const + A = B(0), + C = B(1), + D = B(1), + E = () => { + F(G(C)(G(D)(``)), [ + [ + H(A, []), + () => { + return `` + } + ], + [ + H(C, [I]), + (a) => { + return F(a, [[ + H(D, [I]), + (b) => { + return b + } + ]]) + } + ] + ]); + return `` + }; diff --git a/spec/compilers2/component b/spec/compilers2/component new file mode 100644 index 000000000..49d297c64 --- /dev/null +++ b/spec/compilers2/component @@ -0,0 +1,9 @@ +component Main { + fun render : String { + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `` +}; diff --git a/spec/compilers2/component_async b/spec/compilers2/component_async new file mode 100644 index 000000000..b0733c87b --- /dev/null +++ b/spec/compilers2/component_async @@ -0,0 +1,81 @@ +async component Test { + fun render : Html { +
+ Greeter.greet("async") + Greeter.both() +
+ } +} + +module Greeter { + // Only used in Test so it should be compiled with it. + fun greet (name : String) { + "I'm #{name}!" + } + + // Only used in Main so it should be compiled with it. + fun main { + "I'm in Main!" + } + + // Only used in both so it should be compiled with Main. + fun both { + "I'm in both!" + } +} + +component Main { + fun render : Html { +
+ Greeter.main() + Greeter.both() + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + lazyComponent as E, + createElement as D, + lazy as B +} from "runtime"; + +export const + a = () => { + return `I'm in Main!` + }, + b = () => { + return `I'm in both!` + }, + A = B('/__mint__/test.js'), + C = () => { + return D(`div`, {}, [ + a(), + b(), + D(E, { + key: `Test`, + x: A, + p: {}, + c: [] + }) + ]) + }; + +---=== /__mint__/test.js ===--- +import { createElement as B } from "runtime"; + +import { b as c } from "/index.js"; + +export const + a = (b) => { + return `I'm ${b}!` + }, + A = () => { + return B(`div`, {}, [ + a(`async`), + c() + ]) + }; + +export default A; diff --git a/spec/compilers2/component_async_2 b/spec/compilers2/component_async_2 new file mode 100644 index 000000000..f605b6747 --- /dev/null +++ b/spec/compilers2/component_async_2 @@ -0,0 +1,83 @@ +async component First { + fun render : Html { +
+ "First" +
+ } +} + +async component Second { + fun render : Html { +
+ + "Second" +
+ } +} + +component Main { + fun render : Html { +
+ + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + lazyComponent as F, + createElement as E, + lazy as B +} from "runtime"; + +export const + A = B('/__mint__/first.js'), + C = B('/__mint__/second.js'), + D = () => { + return E(`div`, {}, [ + E(F, { + key: `First`, + x: A, + p: {}, + c: [] + }), + E(F, { + key: `Second`, + x: C, + p: {}, + c: [] + }) + ]) + }; + +---=== /__mint__/first.js ===--- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, {}, [`First`]) +}; + +export default A; + +---=== /__mint__/second.js ===--- +import { + lazyComponent as C, + createElement as B +} from "runtime"; + +import { A as D } from "/index.js"; + +export const A = () => { + return B(`div`, {}, [ + B(C, { + key: `First`, + x: D, + p: {}, + c: [] + }), + `Second` + ]) +}; + +export default A; diff --git a/spec/compilers2/component_async_3 b/spec/compilers2/component_async_3 new file mode 100644 index 000000000..ed9efc6b4 --- /dev/null +++ b/spec/compilers2/component_async_3 @@ -0,0 +1,99 @@ +module Test { + fun blah { + halb() + } + + fun halb() { + "" + } +} + +async component First { + fun render : Html { +
+ "First" + Test.blah() +
+ } +} + +async component Second { + fun render : Html { +
+ "Second" + Test.blah() +
+ } +} + +component Main { + fun render : Html { +
+ + + Test.blah() +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + lazyComponent as F, + createElement as E, + lazy as B +} from "runtime"; + +export const + a = () => { + return `` + }, + b = () => { + return a() + }, + A = B('/__mint__/first.js'), + C = B('/__mint__/second.js'), + D = () => { + return E(`div`, {}, [ + E(F, { + key: `First`, + x: A, + p: {}, + c: [] + }), + E(F, { + key: `Second`, + x: C, + p: {}, + c: [] + }), + b() + ]) + }; + +---=== /__mint__/first.js ===--- +import { createElement as B } from "runtime"; + +import { b as a } from "/index.js"; + +export const A = () => { + return B(`div`, {}, [ + `First`, + a() + ]) +}; + +export default A; + +---=== /__mint__/second.js ===--- +import { createElement as B } from "runtime"; + +import { b as a } from "/index.js"; + +export const A = () => { + return B(`div`, {}, [ + `Second`, + a() + ]) +}; + +export default A; diff --git a/spec/compilers2/component_children b/spec/compilers2/component_children new file mode 100644 index 000000000..95d7c6e87 --- /dev/null +++ b/spec/compilers2/component_children @@ -0,0 +1,28 @@ +component Test { + property children : Array(Html) = [] + + fun render : Array(Html) { + children + } +} + +component Main { + fun render : Html { + "" + } +} +-------------------------------------------------------------------------------- +import { + createElement as C, + toArray as D +} from "runtime"; + +export const + A = ({ + children: a = [] + }) => { + return a + }, + B = () => { + return C(A, {}, D(``)) + }; diff --git a/spec/compilers2/component_global b/spec/compilers2/component_global new file mode 100644 index 000000000..d147d4cdc --- /dev/null +++ b/spec/compilers2/component_global @@ -0,0 +1,45 @@ +global component Notifications { + state test : String = "" + + get value : String { + test + } + + fun notify (value : String) : String { + value + } + + fun render : Html { +
+ value +
+ } +} + +component Main { + fun render : Html { +
+ <{ Notifications.notify("Hello") }> +
+ } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + signal as D +} from "runtime"; + +export const + A = () => { + return B(`div`, {}, [a()]) + }, + b = (c) => { + return c + }, + C = () => { + return B(`div`, {}, [b(`Hello`)]) + }, + d = D(``), + a = () => { + return d.value + }; diff --git a/spec/compilers2/component_instance_access b/spec/compilers2/component_instance_access new file mode 100644 index 000000000..7e98c80e8 --- /dev/null +++ b/spec/compilers2/component_instance_access @@ -0,0 +1,83 @@ +enum Maybe(value) { + Just(value) + Nothing +} + +component Instance { + get name : String { + "Instance" + } + + fun render : Html { +
+ } +} + +component Main { + fun handleClick : String { + case (instance) { + Maybe::Just(component) => component.name + Maybe::Nothing => "" + } + } + + fun render : Html { +
+ +
+ } +} +-------------------------------------------------------------------------------- +import { + patternVariable as K, + createElement as F, + pattern as J, + useMemo as E, + variant as B, + setRef as L, + useRef as H, + match as I +} from "runtime"; + +export const + A = B(1), + C = B(0), + D = ({ + _ + }) => { + const a = () => { + return `Instance` + }; + const b = E(() => { + return { + a + } + }, []); + (_ ? _(b) : null); + return F(`div`, {}) + }, + G = () => { + const + c = H(new C()), + d = () => { + return I(c.current, [ + [ + J(A, [K]), + (e) => { + return e.a() + } + ], + [ + J(C, []), + () => { + return `` + } + ] + ]) + }; + return F(`div`, { + "onClick": d + }, [F(D, { + _: L(c, A) + })]) + }; diff --git a/spec/compilers2/component_instance_access_ref b/spec/compilers2/component_instance_access_ref new file mode 100644 index 000000000..48aa999a4 --- /dev/null +++ b/spec/compilers2/component_instance_access_ref @@ -0,0 +1,79 @@ +enum Maybe(value) { + Just(value) + Nothing +} + +component Instance { + fun render : Html { +
+ } +} + +component Main { + fun handleClick { + case (instance) { + Maybe::Just(component) => component.base + Maybe::Nothing => Maybe::Nothing + } + } + + fun render : Html { +
+ +
+ } +} +-------------------------------------------------------------------------------- +import { + patternVariable as L, + createElement as G, + pattern as K, + useMemo as F, + variant as B, + setRef as H, + useRef as E, + match as J +} from "runtime"; + +export const + A = B(0), + C = B(1), + D = ({ + _ + }) => { + const a = E(new A()); + const b = F(() => { + return { + a + } + }, []); + (_ ? _(b) : null); + return G(`div`, { + ref: H(a, C) + }) + }, + I = () => { + const + c = E(new A()), + d = () => { + return J(c.current, [ + [ + K(C, [L]), + (e) => { + return e.a.current + } + ], + [ + K(A, []), + () => { + return new A() + } + ] + ]) + }; + return G(`div`, { + "onClick": d + }, [G(D, { + _: H(c, C) + })]) + }; diff --git a/spec/compilers2/component_namespaced b/spec/compilers2/component_namespaced new file mode 100644 index 000000000..86aeb18c9 --- /dev/null +++ b/spec/compilers2/component_namespaced @@ -0,0 +1,21 @@ +component Ui.Dropdown { + fun render : String { + "test" + } +} + +component Main { + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +import { createElement as C } from "runtime"; + +export const + A = () => { + return `test` + }, + B = () => { + return C(A, {}) + }; diff --git a/spec/compilers2/component_namespaced_with_style b/spec/compilers2/component_namespaced_with_style new file mode 100644 index 000000000..2de48b257 --- /dev/null +++ b/spec/compilers2/component_namespaced_with_style @@ -0,0 +1,35 @@ +component Ui.Dropdown { + style base { + background: red; + } + + fun render : Html { + + "test" + + } +} + +component Main { + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { createElement as B } from "runtime"; + +export const + A = () => { + return B(`div`, { + className: `Ui·Dropdown_base` + }, [`test`]) + }, + C = () => { + return B(A, {}) + }; + +---=== /index.css ===--- +.Ui·Dropdown_base { + background: red; +} diff --git a/spec/compilers2/component_readonly b/spec/compilers2/component_readonly new file mode 100644 index 000000000..0512da641 --- /dev/null +++ b/spec/compilers2/component_readonly @@ -0,0 +1,27 @@ +component Test { + property readonly : Bool = false + + fun render : Html { +
+ } +} + +component Main { + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const + A = ({ + a = false + }) => { + return B(`div`, {}) + }, + C = () => { + return B(A, { + a: true + }) + }; diff --git a/spec/compilers2/component_with_provider b/spec/compilers2/component_with_provider new file mode 100644 index 000000000..377f88997 --- /dev/null +++ b/spec/compilers2/component_with_provider @@ -0,0 +1,50 @@ +record MouseProvider.Data { + moves : Function(Position, Void), + ups : Function(Position, Void) +} + +provider MouseProvider : MouseProvider.Data { + fun update : Void { + void + } +} + +component Main { + use MouseProvider { + moves: (data : Position) : Void { void }, + ups: (data : Position) : Void { void } + } when { + false + } + + fun render : Html { +
+ } +} +-------------------------------------------------------------------------------- +import { + createProvider as B, + createElement as E, + useId as D +} from "runtime"; + +export const + a = new Map(), + A = B(a, () => { + return null + }), + C = () => { + const b = D(); + A(b, () => { + return (false ? { + moves: (c) => { + return null + }, + ups: (d) => { + return null + } + } : null) + }); + return E(`div`, {}) + }; + diff --git a/spec/compilers2/component_with_provider_and_lifecycle_functions b/spec/compilers2/component_with_provider_and_lifecycle_functions new file mode 100644 index 000000000..6e718c4c0 --- /dev/null +++ b/spec/compilers2/component_with_provider_and_lifecycle_functions @@ -0,0 +1,74 @@ +record MouseProvider.Data { + moves : Function(Position, Void), + ups : Function(Position, Void) +} + +provider MouseProvider : MouseProvider.Data { + fun update : Void { + void + } +} + +component Main { + use MouseProvider { + moves: (data : Position) : Void { void }, + ups: (data : Position) : Void { void } + } when { + false + } + + fun componentWillUnmount : Void { + void + } + + fun componentDidUpdate : Void { + void + } + + fun componentDidMount : Void { + void + } + + fun render : Html { +
+ } +} +-------------------------------------------------------------------------------- +import { + createProvider as B, + createElement as G, + useDidUpdate as F, + useEffect as E, + useId as D +} from "runtime"; + +export const + a = new Map(), + A = B(a, () => { + return null + }), + C = () => { + const b = D(); + E(() => { + (() => { + return null + })(); + return () => { + return null + } + }, []); + F(() => { + return null + }); + A(b, () => { + return (false ? { + moves: (c) => { + return null + }, + ups: (d) => { + return null + } + } : null) + }); + return G(`div`, {}) + }; diff --git a/spec/compilers2/component_with_provider_and_store b/spec/compilers2/component_with_provider_and_store new file mode 100644 index 000000000..916a36c6e --- /dev/null +++ b/spec/compilers2/component_with_provider_and_store @@ -0,0 +1,64 @@ +record MouseProvider.Data { + moves : Function(Position, Void), + ups : Function(Position, Void) +} + +provider MouseProvider : MouseProvider.Data { + fun update : Void { + void + } +} + +store Blah { + state test : String = "" + + fun x : String { + "hello" + } +} + +component Main { + use MouseProvider { + moves: (data : Position) : Void { void }, + ups: (data : Position) : Void { void } + } when { + false + } + + connect Blah exposing { test, x } + + fun render : Html { +
+ } +} +-------------------------------------------------------------------------------- +import { + createProvider as C, + createElement as F, + signal as A, + useId as E +} from "runtime"; + +export const + a = new Map(), + b = () => { + return `hello` + }, + c = A(``), + B = C(a, () => { + return null + }), + D = () => { + const d = E(); + B(d, () => { + return (false ? { + moves: (e) => { + return null + }, + ups: (f) => { + return null + } + } : null) + }); + return F(`div`, {}) + }; diff --git a/spec/compilers2/constant_component b/spec/compilers2/constant_component new file mode 100644 index 000000000..22be68c2f --- /dev/null +++ b/spec/compilers2/constant_component @@ -0,0 +1,12 @@ +component Main { + const NAME = "ASD" + + fun render : String { + NAME + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = `ASD`; + return a +}; diff --git a/spec/compilers2/constant_global_component b/spec/compilers2/constant_global_component new file mode 100644 index 000000000..ab6ceeb77 --- /dev/null +++ b/spec/compilers2/constant_global_component @@ -0,0 +1,26 @@ +global component Test { + const NAME = "ASD" + + fun render : String { + NAME + } +} + +component Main { + fun render : Html { +
+ <{ Test:NAME }> +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as C } from "runtime"; + +export const + A = () => { + return a + }, + a = `ASD`, + B = () => { + return C(`div`, {}, [a]) + }; diff --git a/spec/compilers2/constant_module b/spec/compilers2/constant_module new file mode 100644 index 000000000..c9b757655 --- /dev/null +++ b/spec/compilers2/constant_module @@ -0,0 +1,20 @@ +module Test { + const NAME = "ASD" +} + +component Main { + fun render : Html { +
+ <{ Test:NAME }> +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const + a = `ASD`, + A = () => { + return B(`div`, {}, [a]) + }; + diff --git a/spec/compilers2/constant_store b/spec/compilers2/constant_store new file mode 100644 index 000000000..9d7123561 --- /dev/null +++ b/spec/compilers2/constant_store @@ -0,0 +1,20 @@ +store Test { + const NAME = "ASD" +} + +component Main { + fun render : Html { +
+ <{ Test:NAME }> +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const + a = `ASD`, + A = () => { + return B(`div`, {}, [a]) + }; + diff --git a/spec/compilers2/constant_store_exposed b/spec/compilers2/constant_store_exposed new file mode 100644 index 000000000..0a74765f7 --- /dev/null +++ b/spec/compilers2/constant_store_exposed @@ -0,0 +1,21 @@ +store Test { + const NAME = "ASD" +} + +component Main { + connect Test exposing { NAME } + + fun render : Html { +
+ <{ NAME }> +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const + a = `ASD`, + A = () => { + return B(`div`, {}, [a]) + }; diff --git a/spec/compilers2/css_definition b/spec/compilers2/css_definition new file mode 100644 index 000000000..3006a5bf0 --- /dev/null +++ b/spec/compilers2/css_definition @@ -0,0 +1,41 @@ +component Main { + style test { + margin: #{margin}px 0px; + } + + get margin : Number { + 10 + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const + a = () => { + return 10 + }, + b = () => { + const _ = { + [`--a-a`]: a() + `px 0px` + }; + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([b()]) + }) +}; + +---=== /index.css ===--- +.Main_test { + margin: var(--a-a); +} diff --git a/spec/compilers2/css_font_face b/spec/compilers2/css_font_face new file mode 100644 index 000000000..0550231bf --- /dev/null +++ b/spec/compilers2/css_font_face @@ -0,0 +1,39 @@ +component Main { + style test { + @font-face { + src: url(sansation_light.woff); + font-family: myFirstFont; + } + + @font-face { + src: url(sansation_light2.woff); + font-family: myFirstFont; + font-weight: bold; + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, { + className: `Main_test` + }) +}; + +---=== /index.css ===--- +@font-face { + src: url(sansation_light.woff); + font-family: myFirstFont; +} + +@font-face { + src: url(sansation_light2.woff); + font-family: myFirstFont; + font-weight: bold; +} diff --git a/spec/compilers2/css_font_face_with_quotes b/spec/compilers2/css_font_face_with_quotes new file mode 100644 index 000000000..ce9c36851 --- /dev/null +++ b/spec/compilers2/css_font_face_with_quotes @@ -0,0 +1,33 @@ +component Main { + style test { + @font-face { + src: url(sansation_light.woff); + font-family: myFirstFont; + } + + font-family: "myFirstFont"; + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, { + className: `Main_test` + }) +}; + +---=== /index.css ===--- +.Main_test { + font-family: "myFirstFont"; +} + +@font-face { + src: url(sansation_light.woff); + font-family: myFirstFont; +} diff --git a/spec/compilers2/css_keyframes b/spec/compilers2/css_keyframes new file mode 100644 index 000000000..85ab9073e --- /dev/null +++ b/spec/compilers2/css_keyframes @@ -0,0 +1,72 @@ +component Main { + state opacity : Number = 1 + + style test { + @keyframes animation { + from { + opacity: 0; + } + + to { + opacity: #{opacity}; + } + } + + @keyframes animation { + from { + opacity: 0; + } + + to { + opacity: 1; + } + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as C, + useSignal as B, + style as D +} from "runtime"; + +export const A = () => { + const + a = B(1), + b = () => { + const _ = { + [`--a-a`]: a.value + }; + return _ + }; + return C(`div`, { + className: `Main_test`, + style: D([b()]) + }) +}; + +---=== /index.css ===--- +@keyframes animation { + from { + opacity: 0; + } + + to { + opacity: var(--a-a); + } +} + +@keyframes animation { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} diff --git a/spec/compilers2/css_media b/spec/compilers2/css_media new file mode 100644 index 000000000..917190c9b --- /dev/null +++ b/spec/compilers2/css_media @@ -0,0 +1,54 @@ +component Main { + style test { + div { + color: #{color}; + } + + @media (screen) { + color: #{color}; + } + } + + get color : String { + "blue" + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const + a = () => { + return `blue` + }, + b = () => { + const _ = { + [`--a-a`]: a(), + [`--b-a`]: a() + }; + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([b()]) + }) +}; + +---=== /index.css ===--- +.Main_test div { + color: var(--a-a); +} + +@media (screen) { + .Main_test { + color: var(--b-a); + } +} diff --git a/spec/compilers2/css_media_with_if b/spec/compilers2/css_media_with_if new file mode 100644 index 000000000..c458704cb --- /dev/null +++ b/spec/compilers2/css_media_with_if @@ -0,0 +1,46 @@ +component Main { + style test { + color: yellow; + + @media (max-width: 300px) { + if (true) { + color: red; + } + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const a = () => { + const _ = {}; + (true ? Object.assign(_, { + [`--a-a`]: `red` + }) : null); + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([a()]) + }) +}; + +---=== /index.css ===--- +.Main_test { + color: yellow; +} + +@media (max-width: 300px) { + .Main_test { + color: var(--a-a); + } +} diff --git a/spec/compilers2/css_selector b/spec/compilers2/css_selector new file mode 100644 index 000000000..16e697543 --- /dev/null +++ b/spec/compilers2/css_selector @@ -0,0 +1,51 @@ +component Main { + style test { + div { + color: #{color}; + } + + &:focus { + color: red; + } + } + + get color : String { + "blue" + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const + a = () => { + return `blue` + }, + b = () => { + const _ = { + [`--a-a`]: a() + }; + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([b()]) + }) +}; + +---=== /index.css ===--- +.Main_test div { + color: var(--a-a); +} + +.Main_test:focus { + color: red; +} diff --git a/spec/compilers2/css_selector_multiple b/spec/compilers2/css_selector_multiple new file mode 100644 index 000000000..4f6f0f2b3 --- /dev/null +++ b/spec/compilers2/css_selector_multiple @@ -0,0 +1,56 @@ +component Main { + style test { + div { + color: #{color}; + } + + &:focus, + &:hover { + color: red; + } + } + + get color : String { + "blue" + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const + a = () => { + return `blue` + }, + b = () => { + const _ = { + [`--a-a`]: a() + }; + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([b()]) + }) +}; + +---=== /index.css ===--- +.Main_test div { + color: var(--a-a); +} + +.Main_test:focus { + color: red; +} + +.Main_test:hover { + color: red; +} diff --git a/spec/compilers2/css_string b/spec/compilers2/css_string new file mode 100644 index 000000000..e25e9d948 --- /dev/null +++ b/spec/compilers2/css_string @@ -0,0 +1,42 @@ +component Main { + state name : String = "Joe" + + style unicode { + span::after { + content: "Hi" blah #{name} "Here is some content; Thanks #{name}"; + } + } + + fun render { + + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as C, + useSignal as B, + style as D +} from "runtime"; + +export const A = () => { + const + a = B(`Joe`), + b = () => { + const _ = { + [`--a-a`]: `"Hi"` + ` blah ` + a.value + ` ` + `"Here is some content; Thanks ${a.value}"` + }; + return _ + }; + return C(`div`, { + className: `Main_unicode`, + style: D([b()]) + }, [C(`span`, {})]) +}; + +---=== /index.css ===--- +.Main_unicode span::after { + content: var(--a-a); +} diff --git a/spec/compilers2/css_supports b/spec/compilers2/css_supports new file mode 100644 index 000000000..1a6353b51 --- /dev/null +++ b/spec/compilers2/css_supports @@ -0,0 +1,42 @@ +component Main { + state color : String = "blue" + + style test { + @supports (screen) { + color: #{color}; + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as C, + useSignal as B, + style as D +} from "runtime"; + +export const A = () => { + const + a = B(`blue`), + b = () => { + const _ = { + [`--a-a`]: a.value + }; + return _ + }; + return C(`div`, { + className: `Main_test`, + style: D([b()]) + }) +}; + +---=== /index.css ===--- +@supports (screen) { + .Main_test { + color: var(--a-a); + } +} diff --git a/spec/compilers2/css_with_ands b/spec/compilers2/css_with_ands new file mode 100644 index 000000000..814229ebc --- /dev/null +++ b/spec/compilers2/css_with_ands @@ -0,0 +1,41 @@ +component Main { + style test { + &:focus { + color: red; + } + + &[someattribute] { + color: red; + } + + &.someclass { + color: red; + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, { + className: `Main_test` + }) +}; + +---=== /index.css ===--- +.Main_test:focus { + color: red; +} + +.Main_test[someattribute] { + color: red; +} + +.Main_test.someclass { + color: red; +} diff --git a/spec/compilers2/css_with_arguments b/spec/compilers2/css_with_arguments new file mode 100644 index 000000000..e93e6dbce --- /dev/null +++ b/spec/compilers2/css_with_arguments @@ -0,0 +1,33 @@ +component Main { + style test(color : String) { + color: #{color}; + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const a = (b) => { + const _ = { + [`--a-a`]: b + }; + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([a(`red`)]) + }) +}; + +---=== /index.css ===--- +.Main_test { + color: var(--a-a); +} diff --git a/spec/compilers2/css_with_case b/spec/compilers2/css_with_case new file mode 100644 index 000000000..05798a814 --- /dev/null +++ b/spec/compilers2/css_with_case @@ -0,0 +1,58 @@ +component Main { + style test { + color: yellow; + + case ("a") { + "a" => + color: red; + + => + color: blue; + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as C, + style as D, + match as B +} from "runtime"; + +export const A = () => { + const a = () => { + const _ = {}; + B(`a`, [ + [ + `a`, + () => { + return Object.assign(_, { + [`--a-a`]: `red` + }) + } + ], + [ + null, + () => { + return Object.assign(_, { + [`--a-a`]: `blue` + }) + } + ] + ]); + return _ + }; + return C(`div`, { + className: `Main_test`, + style: D([a()]) + }) +}; + +---=== /index.css ===--- +.Main_test { + color: var(--a-a, yellow); +} diff --git a/spec/compilers2/css_with_else_if b/spec/compilers2/css_with_else_if new file mode 100644 index 000000000..073255d44 --- /dev/null +++ b/spec/compilers2/css_with_else_if @@ -0,0 +1,47 @@ +component Main { + style base(color : String) { + height: 20px; + + if (color == "red") { + background: red; + } else if (color == "blue") { + background: blue; + } + } + + + fun render : Html { +
+ +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as C, + compare as B, + style as D +} from "runtime"; + +export const A = () => { + const a = (b) => { + const _ = {}; + (B(b, `red`) ? Object.assign(_, { + [`--a-a`]: `red` + }) : (B(b, `blue`) ? Object.assign(_, { + [`--a-a`]: `blue` + }) : null)); + return _ + }; + return C(`div`, {}, [C(`div`, { + className: `Main_base`, + style: D([a(`blue`)]) + })]) +}; + +---=== /index.css ===--- +.Main_base { + height: 20px; + background: var(--a-a); +} diff --git a/spec/compilers2/css_with_if b/spec/compilers2/css_with_if new file mode 100644 index 000000000..eb124a0e9 --- /dev/null +++ b/spec/compilers2/css_with_if @@ -0,0 +1,42 @@ +component Main { + style test { + color: yellow; + + if (true) { + color: red; + } else { + color: blue; + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const a = () => { + const _ = {}; + (true ? Object.assign(_, { + [`--a-a`]: `red` + }) : Object.assign(_, { + [`--a-a`]: `blue` + })); + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([a()]) + }) +}; + +---=== /index.css ===--- +.Main_test { + color: var(--a-a, yellow); +} diff --git a/spec/compilers2/css_with_if_and_case b/spec/compilers2/css_with_if_and_case new file mode 100644 index 000000000..03c03faf9 --- /dev/null +++ b/spec/compilers2/css_with_if_and_case @@ -0,0 +1,66 @@ +component Main { + style test { + color: yellow; + + case (true) { + true => color: yellow; + => color: cyan; + } + + if (true) { + color: red; + } else { + color: blue; + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as C, + style as D, + match as B +} from "runtime"; + +export const A = () => { + const a = () => { + const _ = {}; + B(true, [ + [ + true, + () => { + return Object.assign(_, { + [`--a-a`]: `yellow` + }) + } + ], + [ + null, + () => { + return Object.assign(_, { + [`--a-a`]: `cyan` + }) + } + ] + ]); + (true ? Object.assign(_, { + [`--a-a`]: `red` + }) : Object.assign(_, { + [`--a-a`]: `blue` + })); + return _ + }; + return C(`div`, { + className: `Main_test`, + style: D([a()]) + }) +}; + +---=== /index.css ===--- +.Main_test { + color: var(--a-a, yellow); +} diff --git a/spec/compilers2/css_with_if_same_condition b/spec/compilers2/css_with_if_same_condition new file mode 100644 index 000000000..a76dc7e4e --- /dev/null +++ b/spec/compilers2/css_with_if_same_condition @@ -0,0 +1,59 @@ +component Main { + style test { + .tag { + if (true) { + color: red; + } else { + color: blue; + } + } + + .string { + if (true) { + color: yellow; + } else { + color: cyan; + } + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const a = () => { + const _ = {}; + (true ? Object.assign(_, { + [`--a-a`]: `red` + }) : Object.assign(_, { + [`--a-a`]: `blue` + })); + (true ? Object.assign(_, { + [`--b-a`]: `yellow` + }) : Object.assign(_, { + [`--b-a`]: `cyan` + })); + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([a()]) + }) +}; + +---=== /index.css ===--- +.Main_test .tag { + color: var(--a-a); +} + +.Main_test .string { + color: var(--b-a); +} diff --git a/spec/compilers2/css_with_if_with_interpolation b/spec/compilers2/css_with_if_with_interpolation new file mode 100644 index 000000000..f97486d78 --- /dev/null +++ b/spec/compilers2/css_with_if_with_interpolation @@ -0,0 +1,42 @@ +component Main { + style test { + color: yellow; + + if (true) { + color: #{"red"}; + } else { + color: blue; + } + } + + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const a = () => { + const _ = {}; + (true ? Object.assign(_, { + [`--a-a`]: `red` + }) : Object.assign(_, { + [`--a-a`]: `blue` + })); + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([a()]) + }) +}; + +---=== /index.css ===--- +.Main_test { + color: var(--a-a, yellow); +} diff --git a/spec/compilers2/dce_remove_component b/spec/compilers2/dce_remove_component new file mode 100644 index 000000000..bf8074864 --- /dev/null +++ b/spec/compilers2/dce_remove_component @@ -0,0 +1,6 @@ +component Test { + fun render : Html { +
+ } +} +-------------------------------------------------------------------------------- diff --git a/spec/compilers2/dce_remove_component_computed_property b/spec/compilers2/dce_remove_component_computed_property new file mode 100644 index 000000000..789edc727 --- /dev/null +++ b/spec/compilers2/dce_remove_component_computed_property @@ -0,0 +1,15 @@ +component Main { + get test : String { + "" + } + + fun render : Html { +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, {}) +}; diff --git a/spec/compilers2/dce_remove_component_function b/spec/compilers2/dce_remove_component_function new file mode 100644 index 000000000..7c6b96bd2 --- /dev/null +++ b/spec/compilers2/dce_remove_component_function @@ -0,0 +1,15 @@ +component Main { + fun test : String { + "" + } + + fun render : Html { +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, {}) +}; diff --git a/spec/compilers2/dce_remove_enum b/spec/compilers2/dce_remove_enum new file mode 100644 index 000000000..7b9580bc0 --- /dev/null +++ b/spec/compilers2/dce_remove_enum @@ -0,0 +1,6 @@ +enum Test { + X + Y + Z +} +-------------------------------------------------------------------------------- diff --git a/spec/compilers2/dce_remove_module b/spec/compilers2/dce_remove_module new file mode 100644 index 000000000..ffd83a5f9 --- /dev/null +++ b/spec/compilers2/dce_remove_module @@ -0,0 +1,6 @@ +module Test { + fun test : String { + "" + } +} +-------------------------------------------------------------------------------- diff --git a/spec/compilers2/dce_remove_module_function b/spec/compilers2/dce_remove_module_function new file mode 100644 index 000000000..1660281fc --- /dev/null +++ b/spec/compilers2/dce_remove_module_function @@ -0,0 +1,23 @@ +module Test { + fun test : String { + "" + } + + fun x : String { + "" + } +} + +component Main { + fun render : String { + Test.test() + } +} +-------------------------------------------------------------------------------- +export const + a = () => { + return `` + }, + A = () => { + return a() + }; diff --git a/spec/compilers2/dce_remove_provider b/spec/compilers2/dce_remove_provider new file mode 100644 index 000000000..8811ff795 --- /dev/null +++ b/spec/compilers2/dce_remove_provider @@ -0,0 +1,10 @@ +provider MouseProvider : Unit { + fun update : Void { + void + } + + fun attach : Void { + void + } +} +-------------------------------------------------------------------------------- diff --git a/spec/compilers2/dce_remove_store b/spec/compilers2/dce_remove_store new file mode 100644 index 000000000..da746ab3e --- /dev/null +++ b/spec/compilers2/dce_remove_store @@ -0,0 +1,6 @@ +store Test { + fun test : String { + "" + } +} +-------------------------------------------------------------------------------- diff --git a/spec/compilers2/dce_style b/spec/compilers2/dce_style new file mode 100644 index 000000000..a92e80daa --- /dev/null +++ b/spec/compilers2/dce_style @@ -0,0 +1,15 @@ +component Main { + style test { + color: red; + } + + fun render : Html { +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, {}) +}; diff --git a/spec/compilers2/decode b/spec/compilers2/decode new file mode 100644 index 000000000..f677fdb1f --- /dev/null +++ b/spec/compilers2/decode @@ -0,0 +1,42 @@ +type Result(error, value) { + Err(error) + Ok(value) +} + +record X.Y { + blah : String +} + +record X { + name : String, + y: X.Y +} + +component Main { + fun render : String { + decode `null` as Object as X + + "" + } +} +-------------------------------------------------------------------------------- +import { + decodeString as E, + decoder as D, + variant as B +} from "runtime"; + +export const + A = B(1), + C = B(1), + a = D({ + blah: E(C, A) + }, C, A), + b = D({ + name: E(C, A), + y: a + }, C, A), + F = () => { + b((null)); + return `` + }; diff --git a/spec/compilers2/decode_function b/spec/compilers2/decode_function new file mode 100644 index 000000000..6e717a7f0 --- /dev/null +++ b/spec/compilers2/decode_function @@ -0,0 +1,42 @@ +type Result(error, value) { + Err(error) + Ok(value) +} + +record X.Y { + blah : String +} + +record X { + name : String, + y: X.Y +} + +component Main { + fun render : String { + (decode as X)(`null`) + + "" + } +} +-------------------------------------------------------------------------------- +import { + decodeString as E, + decoder as D, + variant as B +} from "runtime"; + +export const + A = B(1), + C = B(1), + a = D({ + blah: E(C, A) + }, C, A), + b = D({ + name: E(C, A), + y: a + }, C, A), + F = () => { + (b)((null)); + return `` + }; diff --git a/spec/compilers2/decode_map b/spec/compilers2/decode_map new file mode 100644 index 000000000..19962e432 --- /dev/null +++ b/spec/compilers2/decode_map @@ -0,0 +1,26 @@ +type Result(error, value) { + Err(error) + Ok(value) +} + +component Main { + fun render : String { + decode (`[]`) as Map(String, Number) + + "" + } +} +-------------------------------------------------------------------------------- +import { + decodeNumber as F, + decodeMap as E, + variant as B +} from "runtime"; + +export const + A = B(1), + C = B(1), + D = () => { + E(F(C, A), C, A)((([]))); + return `` + }; diff --git a/spec/compilers2/decode_tuple b/spec/compilers2/decode_tuple new file mode 100644 index 000000000..753da0846 --- /dev/null +++ b/spec/compilers2/decode_tuple @@ -0,0 +1,31 @@ +type Result(error, value) { + Err(error) + Ok(value) +} + +component Main { + fun render : String { + decode (`[]`) as Tuple(String, Number, String) + + "" + } +} +-------------------------------------------------------------------------------- +import { + decodeNumber as G, + decodeString as F, + decodeTuple as E, + variant as B +} from "runtime"; + +export const + A = B(1), + C = B(1), + D = () => { + E([ + F(C, A), + G(C, A), + F(C, A) + ], C, A)((([]))); + return `` + }; diff --git a/spec/compilers2/decoder b/spec/compilers2/decoder new file mode 100644 index 000000000..fe34d2910 --- /dev/null +++ b/spec/compilers2/decoder @@ -0,0 +1,66 @@ +type Result(error, value) { + Err(error) + Ok(value) +} + +type Maybe(a) { + Just(a) + Nothing +} + +record Y { + size : Number using "SIIIZEEE" +} + +record X { + maybe : Maybe(String), + array : Array(String), + string : String, + number : Number, + bool : Bool, + time : Time, + y : Y +} + +component Main { + fun render : String { + decode `` as Object as X + "" + } +} +-------------------------------------------------------------------------------- +import { + decodeBoolean as K, + decodeString as I, + decodeNumber as G, + decodeArray as J, + decodeMaybe as H, + decodeTime as L, + decoder as F, + variant as B +} from "runtime"; + +export const + A = B(1), + C = B(1), + D = B(1), + E = B(0), + a = F({ + size: [ + G(C, A), + "SIIIZEEE" + ] + }, C, A), + b = F({ + maybe: H(I(C, A), C, A, D, E), + array: J(I(C, A), C, A), + string: I(C, A), + number: G(C, A), + bool: K(C, A), + time: L(C, A), + y: a + }, C, A), + M = () => { + b(undefined); + return `` + }; diff --git a/spec/compilers2/defer b/spec/compilers2/defer new file mode 100644 index 000000000..566bb5083 --- /dev/null +++ b/spec/compilers2/defer @@ -0,0 +1,60 @@ +module Test { + const TEST = defer { test() + B.c() } + + fun test { + "Hello!" + } +} + +module B { + fun c { + "Blah" + } +} + +component Main { + fun componentDidMount : Promise(String) { + let a = await Test.TEST + + a + } + + fun render : Html { +
+ B.c() +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as D, + useEffect as B, + load as C +} from "runtime"; + +export const + a = () => { + return `Blah` + }, + b = `/__mint__/d35d0e81d757e8f90c0687897aad44d12fb193211.js`, + A = () => { + B(() => { + (async () => { + const c = await C(b); + return c + })() + }, []); + return D(`div`, {}, [a()]) + }; + +---=== /__mint__/d35d0e81d757e8f90c0687897aad44d12fb193211.js ===--- +import { a as c } from "/index.js"; + +export const + a = () => { + return `Hello!` + }, + b = a() + c(); + +export default b; diff --git a/spec/compilers2/defer_2 b/spec/compilers2/defer_2 new file mode 100644 index 000000000..6c22dcc1b --- /dev/null +++ b/spec/compilers2/defer_2 @@ -0,0 +1,53 @@ +module Data { + const ITEMS = defer [ defer ITEM_1 ] + const ITEM_1 = "Hello" +} + +component Main { + fun componentDidMount : Promise(String) { + let [item] = await Data.ITEMS or return "" + await item + } + + fun render : Html { +
""
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + patternVariable as E, + createElement as F, + destructure as C, + useEffect as B, + load as D +} from "runtime"; + +export const + a = `/__mint__/d5f8d9aa357303a4ba78b554c55d598bd238f679b.js`, + A = () => { + B(() => { + (async () => { + const b = C(await D(a), [E]); + if (b === false) { + return `` + }; + const [c] = b; + return await D(c) + })() + }, []); + return F(`div`, {}, [``]) + }; + +---=== /__mint__/d96571c631d11ed793b887a131e80107a65e05223.js ===--- +export const + a = `Hello`, + b = a; + +export default b; + +---=== /__mint__/d5f8d9aa357303a4ba78b554c55d598bd238f679b.js ===--- +export const a = [`/__mint__/d96571c631d11ed793b887a131e80107a65e05223.js`]; + +export default a; + diff --git a/spec/compilers2/destructuring b/spec/compilers2/destructuring new file mode 100644 index 000000000..2e35db8a0 --- /dev/null +++ b/spec/compilers2/destructuring @@ -0,0 +1,59 @@ +enum Test { + Item( + matchString : String, + content : String, + key : String) + None +} + +component Main { + fun render : String { + let item = + Test::Item( + matchString: "MATCHSTRING", + content: "CONTENT", + key: "KEY") + + case item { + Test::Item(content) => content + Test::None => "" + } + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as I, + patternRecord as H, + newVariant as E, + pattern as G, + variant as B, + match as F +} from "runtime"; + +export const + A = B(0), + C = B([ + "matchString", + "content", + "key" + ]), + D = () => { + const a = E(C)(`MATCHSTRING`, `CONTENT`, `KEY`); + return F(a, [ + [ + G(C, H([[ + `content`, + I + ]])), + (b) => { + return b + } + ], + [ + G(A, []), + () => { + return `` + } + ] + ]) + }; diff --git a/spec/compilers2/directives/asset b/spec/compilers2/directives/asset new file mode 100644 index 000000000..bb4e2ec0c --- /dev/null +++ b/spec/compilers2/directives/asset @@ -0,0 +1,9 @@ +component Main { + fun render : String { + @asset(../../fixtures/icon.svg) + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `/assets/icon_c97b81630bc53286dadc8996727d348e.svg` +}; diff --git a/spec/compilers2/directives/documentation b/spec/compilers2/directives/documentation new file mode 100644 index 000000000..e0f781118 --- /dev/null +++ b/spec/compilers2/directives/documentation @@ -0,0 +1,12 @@ +component Main { + fun render : String { + @documentation(Main) + + "Hello There" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + {"description":null,"name":"Main","connects":[],"computed-properties":[],"properties":[],"functions":[{"type":"String","description":null,"name":"render","source":"fun render : String {\n @documentation(Main)\n\n \"Hello There\"\n}","arguments":[]}],"providers":[],"states":[]}; + return `Hello There` +}; diff --git a/spec/compilers2/directives/format b/spec/compilers2/directives/format new file mode 100644 index 000000000..9d06e114b --- /dev/null +++ b/spec/compilers2/directives/format @@ -0,0 +1,23 @@ +component Main { + fun render : String { + let {result, formatted} = + @format { + "HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloH" \ + "Bello" + } + + result + formatted + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const [ + a, + b + ] = [ + `HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHBello`, + `"HelloHelloHelloHelloHelloHelloHelloHelloHelloHelloHelloH" \\ +"Bello"` + ]; + return a + b +}; diff --git a/spec/compilers2/directives/highlight b/spec/compilers2/directives/highlight new file mode 100644 index 000000000..a5c9896bc --- /dev/null +++ b/spec/compilers2/directives/highlight @@ -0,0 +1,23 @@ +component Main { + fun render : Html { + @highlight { + "Test" + }[1] + } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + return [ + `Test`, + B(C, {}, [B("span", { + className: "line" + }, [B("span", { + className: "string" + }, [`"Test"`])])]) + ][1] +}; diff --git a/spec/compilers2/directives/highlight-file b/spec/compilers2/directives/highlight-file new file mode 100644 index 000000000..158bae7bd --- /dev/null +++ b/spec/compilers2/directives/highlight-file @@ -0,0 +1,63 @@ +component Main { + fun render : Html { + @highlight-file(../../fixtures/Test.mint) + } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + return B(C, {}, [ + B("span", { + className: "line" + }, [ + B("span", { + className: "keyword" + }, [`component`]), + ` `, + B("span", { + className: "type" + }, [`Main`]), + ` { +` + ]), + B("span", { + className: "line" + }, [ + ` `, + B("span", { + className: "keyword" + }, [`fun`]), + ` render : `, + B("span", { + className: "type" + }, [`Html`]), + ` { +` + ]), + B("span", { + className: "line" + }, [ + ` <`, + B("span", { + className: "namespace" + }, [`div`]), + `> +` + ]), + B("span", { + className: "line" + }, [` } +`]), + B("span", { + className: "line" + }, [`}`]) + ]) +}; diff --git a/spec/compilers2/directives/svg b/spec/compilers2/directives/svg new file mode 100644 index 000000000..28c9b3dc0 --- /dev/null +++ b/spec/compilers2/directives/svg @@ -0,0 +1,18 @@ +component Main { + fun render : Html { + @svg(../../fixtures/icon.svg) + } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`svg`, { + dangerouslySetInnerHTML: { + __html: `` + }, + viewBox: `0 0 24 24`, + height: `24`, + width: `24` + }) +}; diff --git a/spec/compilers2/encode b/spec/compilers2/encode new file mode 100644 index 000000000..0b2ea5858 --- /dev/null +++ b/spec/compilers2/encode @@ -0,0 +1,30 @@ +record Test { + name : String, + age : Number +} + +component Main { + fun render : String { + encode { name: "Hello", age: 20 } + + "" + } +} +-------------------------------------------------------------------------------- +import { + identity as B, + encoder as A +} from "runtime"; + +export const + a = A({ + name: B, + age: B + }), + C = () => { + a({ + name: `Hello`, + age: 20 + }); + return `` + }; diff --git a/spec/compilers2/encode_nested b/spec/compilers2/encode_nested new file mode 100644 index 000000000..d478d8f3c --- /dev/null +++ b/spec/compilers2/encode_nested @@ -0,0 +1,39 @@ +record Test { + nested : Nested, + name : String +} + +type Nested { + name : String +} + +component Main { + fun render : String { + encode { name: "Hello", nested: { name: "Test" } } + + "" + } +} +-------------------------------------------------------------------------------- +import { + identity as B, + encoder as A +} from "runtime"; + +export const + a = A({ + name: B + }), + b = A({ + nested: a, + name: B + }), + C = () => { + b({ + name: `Hello`, + nested: { + name: `Test` + } + }); + return `` + }; diff --git a/spec/compilers2/encode_with_mapping b/spec/compilers2/encode_with_mapping new file mode 100644 index 000000000..6409d531a --- /dev/null +++ b/spec/compilers2/encode_with_mapping @@ -0,0 +1,33 @@ +record Test { + name : String using "test_name", + age : Number +} + +component Main { + fun render : String { + encode { name: "Hello", age: 20 } + + "" + } +} +-------------------------------------------------------------------------------- +import { + identity as B, + encoder as A +} from "runtime"; + +export const + a = A({ + name: [ + B, + "test_name" + ], + age: B + }), + C = () => { + a({ + name: `Hello`, + age: 20 + }); + return `` + }; diff --git a/spec/compilers2/env b/spec/compilers2/env new file mode 100644 index 000000000..ed8ec9192 --- /dev/null +++ b/spec/compilers2/env @@ -0,0 +1,9 @@ +component Main { + fun render : String { + @TEST + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `TRUE` +}; diff --git a/spec/compilers2/field b/spec/compilers2/field new file mode 100644 index 000000000..ae7b07631 --- /dev/null +++ b/spec/compilers2/field @@ -0,0 +1,25 @@ +record Test { + a : String, + b : Number +} + +component Main { + fun render : Html { + { + a: "Hello", + b: 0 + } + +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + { + a: `Hello`, + b: 0 + }; + return B(`div`, {}) +}; diff --git a/spec/compilers2/for b/spec/compilers2/for new file mode 100644 index 000000000..f2a33ef28 --- /dev/null +++ b/spec/compilers2/for @@ -0,0 +1,27 @@ +component Main { + fun render : Array(Html) { + for (item of ["A", "B"]) { +
+ <{ item }> +
+ } + } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return (() => { + const _0 = []; + const _1 = [ + `A`, + `B` + ]; + let _i = -1; + for (let a of _1) { + _i++; + _0.push(B(`div`, {}, [a])) + }; + return _0 + })() +}; diff --git a/spec/compilers2/for_with_index b/spec/compilers2/for_with_index new file mode 100644 index 000000000..527e1e375 --- /dev/null +++ b/spec/compilers2/for_with_index @@ -0,0 +1,37 @@ +component Main { + fun render : Array(Html) { + for (item, index of ["A", "B"]) { +
+ <{ item }> +
+ } when { + index == 10 + } + } +} +-------------------------------------------------------------------------------- +import { + createElement as C, + compare as B +} from "runtime"; + +export const A = () => { + return (() => { + const _0 = []; + const _1 = [ + `A`, + `B` + ]; + let _i = -1; + for (let a of _1) { + _i++; + const b = _i; + const _2 = B(b, 10); + if (!_2) { + continue + }; + _0.push(C(`div`, {}, [a])) + }; + return _0 + })() +}; diff --git a/spec/compilers2/for_with_index_2 b/spec/compilers2/for_with_index_2 new file mode 100644 index 000000000..ec9fbac8f --- /dev/null +++ b/spec/compilers2/for_with_index_2 @@ -0,0 +1,28 @@ +component Main { + fun render : Array(Html) { + for (item, index of ["A", "B"]) { +
+ <{ item }> +
+ } + } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return (() => { + const _0 = []; + const _1 = [ + `A`, + `B` + ]; + let _i = -1; + for (let a of _1) { + _i++; + const b = _i; + _0.push(B(`div`, {}, [a])) + }; + return _0 + })() +}; diff --git a/spec/compilers2/function b/spec/compilers2/function new file mode 100644 index 000000000..818cf7f9b --- /dev/null +++ b/spec/compilers2/function @@ -0,0 +1,19 @@ +component Main { + fun test : Bool { + true + } + + fun render : String { + test() + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = () => { + return true + }; + a(); + return `` +}; diff --git a/spec/compilers2/function_call_simple b/spec/compilers2/function_call_simple new file mode 100644 index 000000000..bd1275c9c --- /dev/null +++ b/spec/compilers2/function_call_simple @@ -0,0 +1,27 @@ +component Main { + fun a : String { + "test" + } + + fun test : String { + a() + } + + fun render : String { + test() + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const + a = () => { + return `test` + }, + b = () => { + return a() + }; + b(); + return `` +}; diff --git a/spec/compilers2/function_call_with_arguments b/spec/compilers2/function_call_with_arguments new file mode 100644 index 000000000..9188dc239 --- /dev/null +++ b/spec/compilers2/function_call_with_arguments @@ -0,0 +1,28 @@ +component Main { + fun call (a : String, b : Bool) : Bool { + b + } + + fun test : Bool { + call("Hello", true) + } + + fun render : String { + test() + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const + a = (b, c) => { + return c + }, + d = () => { + return a(`Hello`, true) + }; + d(); + return `` +}; + diff --git a/spec/compilers2/get b/spec/compilers2/get new file mode 100644 index 000000000..54aa99bc6 --- /dev/null +++ b/spec/compilers2/get @@ -0,0 +1,16 @@ +component Main { + get test : String { + "" + } + + fun render : String { + test + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = () => { + return `` + }; + return a() +}; diff --git a/spec/compilers2/here_doc_markdown b/spec/compilers2/here_doc_markdown new file mode 100644 index 000000000..a1ea4d5a5 --- /dev/null +++ b/spec/compilers2/here_doc_markdown @@ -0,0 +1,21 @@ +component Main { + fun render : Html { + <<#MARKDOWN + ## Hello There + + WTF + MARKDOWN + } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + return B(C, {}, [ + B('h2', {}, [`Hello There`]), + B('p', {}, [`WTF`]) + ]) +}; diff --git a/spec/compilers2/here_doc_markdown_escape b/spec/compilers2/here_doc_markdown_escape new file mode 100644 index 000000000..3cf29eb3a --- /dev/null +++ b/spec/compilers2/here_doc_markdown_escape @@ -0,0 +1,77 @@ +component Main { + fun render : Html { + <<#MARKDOWN(highlight) + \#{name} + ```mint + `Something` + "\#{name}" + "First line" \ + "Second line" \ + "Third line" + ``` + MARKDOWN + } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + return B(C, {}, [ + B('p', {}, [`#{name}`]), + B('pre', {}, [B('code', { + class: "language-mint" + }, [ + B('span', { + className: "line" + }, [`\`Something\` +`]), + B('span', { + className: "line" + }, [ + ``, + B('span', { + className: "string" + }, [`"#{`]), + B('span', { + className: "variable" + }, [`name`]), + B('span', { + className: "string" + }, [`}"`]), + ` +` + ]), + B('span', { + className: "line" + }, [ + ``, + B('span', { + className: "string" + }, [`"First line" \`]), + ` +` + ]), + B('span', { + className: "line" + }, [ + ``, + B('span', { + className: "string" + }, [`"Second line" \`]), + ` +` + ]), + B('span', { + className: "line" + }, [ + ``, + B('span', { + className: "string" + }, [`"Third line"`]) + ]) + ])]) + ]) +}; diff --git a/spec/compilers2/here_doc_markdown_with_code_block b/spec/compilers2/here_doc_markdown_with_code_block new file mode 100644 index 000000000..c99f48923 --- /dev/null +++ b/spec/compilers2/here_doc_markdown_with_code_block @@ -0,0 +1,39 @@ +component Main { + fun render : Html { + <<#MARKDOWN(highlight) + Text + + ```mint + module Time {} + ``` + + Text + MARKDOWN + } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + return B(C, {}, [ + B('p', {}, [`Text`]), + B('pre', {}, [B('code', { + class: "language-mint" + }, [B('span', { + className: "line" + }, [ + B('span', { + className: "keyword" + }, [`module`]), + ` `, + B('span', { + className: "type" + }, [`Time`]), + ` {}` + ])])]), + B('p', {}, [`Text`]) + ]) +}; diff --git a/spec/compilers2/here_doc_markdown_with_code_block_multiline b/spec/compilers2/here_doc_markdown_with_code_block_multiline new file mode 100644 index 000000000..213689456 --- /dev/null +++ b/spec/compilers2/here_doc_markdown_with_code_block_multiline @@ -0,0 +1,65 @@ +component Main { + fun render : Html { + <<#MARKDOWN(highlight) + Text + + ```mint + module Time { + const NOW = "" + } + ``` + + Text + MARKDOWN + } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + return B(C, {}, [ + B('p', {}, [`Text`]), + B('pre', {}, [B('code', { + class: "language-mint" + }, [ + B('span', { + className: "line" + }, [ + B('span', { + className: "keyword" + }, [`module`]), + ` `, + B('span', { + className: "type" + }, [`Time`]), + ` { +` + ]), + B('span', { + className: "line" + }, [ + ` `, + B('span', { + className: "keyword" + }, [`const`]), + ` `, + B('span', { + className: "type" + }, [`NOW`]), + ` = `, + B('span', { + className: "string" + }, [`""`]), + ` +` + ]), + B('span', { + className: "line" + }, [`}`]) + ])]), + B('p', {}, [`Text`]) + ]) +}; diff --git a/spec/compilers2/here_doc_markdown_with_html_interpolation b/spec/compilers2/here_doc_markdown_with_html_interpolation new file mode 100644 index 000000000..6af563022 --- /dev/null +++ b/spec/compilers2/here_doc_markdown_with_html_interpolation @@ -0,0 +1,23 @@ +component Main { + const HTML =
+ + fun render : Html { + <<#MARKDOWN + #{HTML} Some text... + MARKDOWN + } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + const a = B(`div`, {}); + return B(C, {}, [B('p', {}, [ + ``, + a, + ` Some text...` + ])]) +}; diff --git a/spec/compilers2/here_doc_markdown_with_inline_code b/spec/compilers2/here_doc_markdown_with_inline_code new file mode 100644 index 000000000..0c6fa1023 --- /dev/null +++ b/spec/compilers2/here_doc_markdown_with_inline_code @@ -0,0 +1,20 @@ +component Main { + fun render : Html { + <<#MARKDOWN + * When open pressing `Esc` closes it. + MARKDOWN + } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + return B(C, {}, [B('ul', {}, [B('li', {}, [ + `When open pressing `, + B('code', {}, [`Esc`]), + ` closes it.` + ])])]) +}; diff --git a/spec/compilers2/here_doc_markdown_with_interpolation b/spec/compilers2/here_doc_markdown_with_interpolation new file mode 100644 index 000000000..34a9bb2b4 --- /dev/null +++ b/spec/compilers2/here_doc_markdown_with_interpolation @@ -0,0 +1,29 @@ +component Main { + fun render : Html { + <<#MARKDOWN + ## Hello There + #{
"Hello"
} + World! + MARKDOWN + } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + return B(C, {}, [ + B('h2', {}, [`Hello There`]), + B('p', {}, [ + ``, + B(`div`, {}, [`Hello`]), + ``, + ` +`, + `World`, + `!` + ]) + ]) +}; diff --git a/spec/compilers2/here_doc_with_interpolation b/spec/compilers2/here_doc_with_interpolation new file mode 100644 index 000000000..96d8db68c --- /dev/null +++ b/spec/compilers2/here_doc_with_interpolation @@ -0,0 +1,17 @@ +component Main { + fun render : String { + <<-TEXT + Hello There! + #{"interpolation"} + This line should be indented by 2 spaces. + This line should be indented by 4 spaces. + TEXT + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return ` Hello There! + ${`interpolation`} + This line should be indented by 2 spaces. + This line should be indented by 4 spaces.` +}; diff --git a/spec/compilers2/here_doc_without_indentation b/spec/compilers2/here_doc_without_indentation new file mode 100644 index 000000000..52cc1dde9 --- /dev/null +++ b/spec/compilers2/here_doc_without_indentation @@ -0,0 +1,15 @@ +component Main { + fun render : String { + <<~TEXT + Hello There! + This line should be indented by 2 spaces. + This line should be indented by 4 spaces. + TEXT + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `Hello There! + This line should be indented by 2 spaces. + This line should be indented by 4 spaces.` +}; diff --git a/spec/compilers2/html_attribute_class b/spec/compilers2/html_attribute_class new file mode 100644 index 000000000..519e241fc --- /dev/null +++ b/spec/compilers2/html_attribute_class @@ -0,0 +1,14 @@ +component Main { + fun render : Html { +
+
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, { + className: `something` + }) +}; diff --git a/spec/compilers2/html_attribute_class_with_style b/spec/compilers2/html_attribute_class_with_style new file mode 100644 index 000000000..2685d207d --- /dev/null +++ b/spec/compilers2/html_attribute_class_with_style @@ -0,0 +1,24 @@ +component Main { + style base { + width: 100%; + } + + fun render : Html { + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, { + className: `something` + ` Main_base` + }) +}; + +---=== /index.css ===--- +.Main_base { + width: 100%; +} diff --git a/spec/compilers2/html_attribute_html_expression b/spec/compilers2/html_attribute_html_expression new file mode 100644 index 000000000..a542c1fe0 --- /dev/null +++ b/spec/compilers2/html_attribute_html_expression @@ -0,0 +1,27 @@ +component Thing { + property things : Html = <> + + fun render : Html { +
+ } +} + +component Main { + fun render { + /> + } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const + A = ({ + a = null + }) => { + return B(`div`, {}) + }, + C = () => { + return B(A, { + a: `x` + }) + }; diff --git a/spec/compilers2/html_attribute_readonly b/spec/compilers2/html_attribute_readonly new file mode 100644 index 000000000..92595174e --- /dev/null +++ b/spec/compilers2/html_attribute_readonly @@ -0,0 +1,13 @@ +component Main { + fun render : Html { +
+
+ } +} +--------------------------------------------------------------------------------import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, { + readOnly: true + }) +}; diff --git a/spec/compilers2/html_attribute_ref b/spec/compilers2/html_attribute_ref new file mode 100644 index 000000000..ddfd8bb45 --- /dev/null +++ b/spec/compilers2/html_attribute_ref @@ -0,0 +1,29 @@ +enum Maybe(value) { + Just(value) + Nothing +} + +component Main { + fun render : Html { +
+
+ } +} +-------------------------------------------------------------------------------- +import { + createElement as F, + variant as B, + setRef as G, + useRef as E +} from "runtime"; + +export const + A = B(1), + C = B(0), + D = () => { + const a = E(new C()); + return F(`div`, { + ref: G(a, A) + }) + }; + diff --git a/spec/compilers2/html_attribute_simple b/spec/compilers2/html_attribute_simple new file mode 100644 index 000000000..f4c3e3b44 --- /dev/null +++ b/spec/compilers2/html_attribute_simple @@ -0,0 +1,14 @@ +component Main { + fun render : Html { +
+
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, { + "title": `Hello` + }) +}; diff --git a/spec/compilers2/html_attribute_with_expression b/spec/compilers2/html_attribute_with_expression new file mode 100644 index 000000000..d7032bb6f --- /dev/null +++ b/spec/compilers2/html_attribute_with_expression @@ -0,0 +1,14 @@ +component Main { + fun render : Html { +
+
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, { + "title": `Hello ` + `there!` + }) +}; diff --git a/spec/compilers2/html_component b/spec/compilers2/html_component new file mode 100644 index 000000000..466e355a9 --- /dev/null +++ b/spec/compilers2/html_component @@ -0,0 +1,21 @@ +component Test { + fun render : Html { +
+ } +} + +component Main { + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const + A = () => { + return B(`div`, {}) + }, + C = () => { + return B(A, {}) + }; diff --git a/spec/compilers2/html_expression b/spec/compilers2/html_expression new file mode 100644 index 000000000..090a63a62 --- /dev/null +++ b/spec/compilers2/html_expression @@ -0,0 +1,11 @@ +component Main { + fun render : Html { +
<{ "Hello" }>
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, {}, [`Hello`]) +}; diff --git a/spec/compilers2/html_fragment b/spec/compilers2/html_fragment new file mode 100644 index 000000000..357ab866b --- /dev/null +++ b/spec/compilers2/html_fragment @@ -0,0 +1,22 @@ +component Main { + fun render : Html { +
+ <> + <{ "A" }> + "B" + +
+ } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + fragment as C +} from "runtime"; + +export const A = () => { + return B(`div`, {}, [B(C, {}, [ + `A`, + `B` + ])]) +}; diff --git a/spec/compilers2/html_fragment_empty b/spec/compilers2/html_fragment_empty new file mode 100644 index 000000000..b8538d67b --- /dev/null +++ b/spec/compilers2/html_fragment_empty @@ -0,0 +1,14 @@ +component Main { + fun render : Html { +
+ <> + +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, {}, [null]) +}; diff --git a/spec/compilers2/html_with_custom_style b/spec/compilers2/html_with_custom_style new file mode 100644 index 000000000..8ae077222 --- /dev/null +++ b/spec/compilers2/html_with_custom_style @@ -0,0 +1,24 @@ +component Main { + get styles : Map(String, String) { + `` + } + + fun render : Html { +
+
+ } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const a = () => { + return undefined + }; + return B(`div`, { + style: C([a()]) + }) +}; diff --git a/spec/compilers2/html_with_multiple_styles b/spec/compilers2/html_with_multiple_styles new file mode 100644 index 000000000..7e193145c --- /dev/null +++ b/spec/compilers2/html_with_multiple_styles @@ -0,0 +1,32 @@ +component Main { + style one { + color: red; + } + + style two { + color: blue; + } + + fun render : Html { + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, { + className: `Main_one Main_two` + }) +}; + +---=== /index.css ===--- +.Main_one { + color: red; +} + +.Main_two { + color: blue; +} diff --git a/spec/compilers2/html_with_multiple_styles_and_parameters b/spec/compilers2/html_with_multiple_styles_and_parameters new file mode 100644 index 000000000..373d02728 --- /dev/null +++ b/spec/compilers2/html_with_multiple_styles_and_parameters @@ -0,0 +1,42 @@ +component Main { + style one { + color: red; + } + + style two(color : String) { + color: #{color}; + } + + fun render : Html { + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const a = (b) => { + const _ = { + [`--a-a`]: b + }; + return _ + }; + return B(`div`, { + className: `Main_one Main_two`, + style: C([a(`blue`)]) + }) +}; + +---=== /index.css ===--- +.Main_one { + color: red; +} + +.Main_two { + color: var(--a-a); +} diff --git a/spec/compilers2/html_with_multiple_styles_and_parameters_2 b/spec/compilers2/html_with_multiple_styles_and_parameters_2 new file mode 100644 index 000000000..a06d81605 --- /dev/null +++ b/spec/compilers2/html_with_multiple_styles_and_parameters_2 @@ -0,0 +1,52 @@ +component Main { + style one(color: String) { + color: #{color}; + } + + style two(color : String) { + color: #{color}; + } + + fun render : Html { + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const + a = (b) => { + const _ = { + [`--a-a`]: b + }; + return _ + }, + c = (d) => { + const _ = { + [`--b-a`]: d + }; + return _ + }; + return B(`div`, { + className: `Main_one Main_two`, + style: C([ + a(`red`), + c(`blue`) + ]) + }) +}; + +---=== /index.css ===--- +.Main_one { + color: var(--a-a); +} + +.Main_two { + color: var(--b-a); +} diff --git a/spec/compilers2/html_with_pseudos b/spec/compilers2/html_with_pseudos new file mode 100644 index 000000000..2c4061e18 --- /dev/null +++ b/spec/compilers2/html_with_pseudos @@ -0,0 +1,73 @@ +component Main { + state hoverBackground : String = "yellow" + state background : String = "blue" + + style test { + background: #{background}; + color: red; + + &:hover { + background: #{hoverBackground}; + color: cyan; + } + + &::first-line { + text-transform: uppercase; + } + + div { + font-family: #{"Hello"}; + color: blue; + } + } + + fun render : Html { + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as C, + useSignal as B, + style as D +} from "runtime"; + +export const A = () => { + const + a = B(`yellow`), + b = B(`blue`), + c = () => { + const _ = { + [`--a-a`]: b.value, + [`--b-a`]: a.value, + [`--c-a`]: `Hello` + }; + return _ + }; + return C(`div`, { + className: `Main_test`, + style: D([c()]) + }) +}; + +---=== /index.css ===--- +.Main_test { + background: var(--a-a); + color: red; +} + +.Main_test:hover { + background: var(--b-a); + color: cyan; +} + +.Main_test::first-line { + text-transform: uppercase; +} + +.Main_test div { + font-family: var(--c-a); + color: blue; +} diff --git a/spec/compilers2/html_with_string_style b/spec/compilers2/html_with_string_style new file mode 100644 index 000000000..9db1acead --- /dev/null +++ b/spec/compilers2/html_with_string_style @@ -0,0 +1,16 @@ +component Main { + fun render : Html { +
+ } +} +-------------------------------------------------------------------------------- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + return B(`div`, { + style: C([`opacity:0;`]) + }) +}; diff --git a/spec/compilers2/html_with_style b/spec/compilers2/html_with_style new file mode 100644 index 000000000..e6f79f6cb --- /dev/null +++ b/spec/compilers2/html_with_style @@ -0,0 +1,87 @@ +component Main { + state background : String = "blue" + state color : String = "yellow" + + style test { + -webkit-tap-highlight-color: rgba(0,0,0,0); + -webkit-touch-callout: none; + + border-color: #{background}; + background: #{background}; + border: #{background}; + color: #{color}; + + & { + font-size: 1em; + } + + &.big { + font-size: 1.5em; + } + + &[data-foo="bar"] { + font-size: 3em; + } + + > span { + font-size: .8em; + } + } + + fun render : Html { + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as C, + useSignal as B, + style as D +} from "runtime"; + +export const A = () => { + const + a = B(`blue`), + b = B(`yellow`), + c = () => { + const _ = { + [`--a-a`]: a.value, + [`--a-b`]: a.value, + [`--a-c`]: a.value, + [`--a-d`]: b.value + }; + return _ + }; + return C(`div`, { + className: `Main_test`, + style: D([c()]) + }) +}; + +---=== /index.css ===--- +.Main_test { + -webkit-tap-highlight-color: rgba(0,0,0,0); + -webkit-touch-callout: none; + border-color: var(--a-a); + background: var(--a-b); + border: var(--a-c); + color: var(--a-d); +} + +.Main_test { + font-size: 1em; +} + +.Main_test.big { + font-size: 1.5em; +} + +.Main_test[data-foo="bar"] { + font-size: 3em; +} + +.Main_test > span { + font-size: .8em; +} diff --git a/spec/compilers2/html_with_style_and_custom_style b/spec/compilers2/html_with_style_and_custom_style new file mode 100644 index 000000000..6e34cf75b --- /dev/null +++ b/spec/compilers2/html_with_style_and_custom_style @@ -0,0 +1,51 @@ +component Main { + state background : String = "blue" + + get styles : Map(String, String) { + `` + } + + style test { + background: #{background}; + color: red; + } + + fun render : Html { + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as C, + useSignal as B, + style as D +} from "runtime"; + +export const A = () => { + const + a = B(`blue`), + b = () => { + return undefined + }, + c = () => { + const _ = { + [`--a-a`]: a.value + }; + return _ + }; + return C(`div`, { + className: `Main_test`, + style: D([ + c(), + b() + ]) + }) +}; + +---=== /index.css ===--- +.Main_test { + background: var(--a-a); + color: red; +} diff --git a/spec/compilers2/if b/spec/compilers2/if new file mode 100644 index 000000000..289e867a6 --- /dev/null +++ b/spec/compilers2/if @@ -0,0 +1,18 @@ +component Main { + fun render : String { + if ("asd" == "asd2") { + true + } else { + false + } + + "" + } +} +-------------------------------------------------------------------------------- +import { compare as B } from "runtime"; + +export const A = () => { + (B(`asd`, `asd2`) ? true : false); + return `` +}; diff --git a/spec/compilers2/if_let b/spec/compilers2/if_let new file mode 100644 index 000000000..8b24d071c --- /dev/null +++ b/spec/compilers2/if_let @@ -0,0 +1,42 @@ +enum T { + A(String) + B +} + +component Main { + fun render : String { + if (let T::A(a) = T::A("")) { + a + } else { + "b" + } + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as H, + newVariant as F, + pattern as G, + variant as B, + match as E +} from "runtime"; + +export const + A = B(0), + C = B(1), + D = () => { + return E(F(C)(``), [ + [ + G(C, [H]), + (a) => { + return a + } + ], + [ + null, + () => { + return `b` + } + ] + ]) + }; diff --git a/spec/compilers2/if_let_await b/spec/compilers2/if_let_await new file mode 100644 index 000000000..2d9cfa126 --- /dev/null +++ b/spec/compilers2/if_let_await @@ -0,0 +1,50 @@ +enum T { + A(String) + B +} + +component Main { + fun render : String { + { + if (let T::A(a) = await T::A("")) { + a + } else { + "b" + } + } + + "" + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as H, + newVariant as E, + pattern as G, + variant as B, + match as F +} from "runtime"; + +export const + A = B(0), + C = B(1), + D = () => { + (async () => { + let a = await E(C)(``); + return F(a, [ + [ + G(C, [H]), + (b) => { + return b + } + ], + [ + null, + () => { + return `b` + } + ] + ]) + })(); + return `` + }; diff --git a/spec/compilers2/if_without_else_array b/spec/compilers2/if_without_else_array new file mode 100644 index 000000000..bfe041aa5 --- /dev/null +++ b/spec/compilers2/if_without_else_array @@ -0,0 +1,13 @@ +component Main { + fun render : Array(String) { + if ("asd" == "asd2") { + ["ARRAY"] + } + } +} +-------------------------------------------------------------------------------- +import { compare as B } from "runtime"; + +export const A = () => { + return (B(`asd`, `asd2`) ? [`ARRAY`] : []) +}; diff --git a/spec/compilers2/if_without_else_promise b/spec/compilers2/if_without_else_promise new file mode 100644 index 000000000..5eda37343 --- /dev/null +++ b/spec/compilers2/if_without_else_promise @@ -0,0 +1,16 @@ +component Main { + fun render : String { + if ("asd" == "asd2") { + next {} + } + + "" + } +} +-------------------------------------------------------------------------------- +import { compare as B } from "runtime"; + +export const A = () => { + (B(`asd`, `asd2`) ? null : null); + return `` +}; diff --git a/spec/compilers2/if_without_else_string b/spec/compilers2/if_without_else_string new file mode 100644 index 000000000..e4d06eac2 --- /dev/null +++ b/spec/compilers2/if_without_else_string @@ -0,0 +1,13 @@ +component Main { + fun render : String { + if ("asd" == "asd2") { + "TRUE" + } + } +} +-------------------------------------------------------------------------------- +import { compare as B } from "runtime"; + +export const A = () => { + return (B(`asd`, `asd2`) ? `TRUE` : "") +}; diff --git a/spec/compilers2/indirect_connect b/spec/compilers2/indirect_connect new file mode 100644 index 000000000..4bd06e1bc --- /dev/null +++ b/spec/compilers2/indirect_connect @@ -0,0 +1,32 @@ +store Test { + state a : String = "" + + fun b : String { + "hello" + } +} + +store A { + state test : Array(String) = [""] + state other : String = "" +} + +component Main { + connect Test exposing { a } + + fun render : String { + A.other + } +} +-------------------------------------------------------------------------------- +import { signal as A } from "runtime"; + +export const + a = () => { + return `hello` + }, + b = A(``), + c = A(``), + B = () => { + return c.value + }; diff --git a/spec/compilers2/inline_function b/spec/compilers2/inline_function new file mode 100644 index 000000000..0f55720b5 --- /dev/null +++ b/spec/compilers2/inline_function @@ -0,0 +1,15 @@ +component Main { + fun render : String { + let a = + () : String { "Hello" } + + a() + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = () => { + return `Hello` + }; + return a() +}; diff --git a/spec/compilers2/inline_function_recursive b/spec/compilers2/inline_function_recursive new file mode 100644 index 000000000..31ad0068b --- /dev/null +++ b/spec/compilers2/inline_function_recursive @@ -0,0 +1,35 @@ +module Test { + fun factorial(n : Number) : Number { + let helper = (n : Number, acc : Number) : Number { + if (n == 0) { + acc + } else { + helper(n - 1, acc * n) + } + } + + helper(n, 1) + } +} + +component Main { + fun render : String { + Test.factorial(3) + + "" + } +} +-------------------------------------------------------------------------------- +import { compare as A } from "runtime"; + +export const + a = (b) => { + const c = (d, e) => { + return (A(d, 0) ? e : c(d - 1, e * d)) + }; + return c(b, 1) + }, + B = () => { + a(3); + return `` + }; diff --git a/spec/compilers2/inline_function_with_arguments b/spec/compilers2/inline_function_with_arguments new file mode 100644 index 000000000..2038ed326 --- /dev/null +++ b/spec/compilers2/inline_function_with_arguments @@ -0,0 +1,25 @@ +component Main { + fun test : String { + let getName = + (name : String) : String { name } + + getName("Joe") + } + + fun render : String { + test() + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = () => { + const b = (c) => { + return c + }; + return b(`Joe`) + }; + a(); + return `` +}; diff --git a/spec/compilers2/js b/spec/compilers2/js new file mode 100644 index 000000000..7639d253d --- /dev/null +++ b/spec/compilers2/js @@ -0,0 +1,9 @@ +component Main { + fun render : String { + ` "Hello" ` + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return ("Hello") +}; diff --git a/spec/compilers2/js_with_double_interpolation b/spec/compilers2/js_with_double_interpolation new file mode 100644 index 000000000..aa012544b --- /dev/null +++ b/spec/compilers2/js_with_double_interpolation @@ -0,0 +1,9 @@ +component Main { + fun render : String { + ` "Hello" + #{`"World!"`} ` + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return ("Hello" + ("World!")) +}; diff --git a/spec/compilers2/js_with_interpolation b/spec/compilers2/js_with_interpolation new file mode 100644 index 000000000..169797cdd --- /dev/null +++ b/spec/compilers2/js_with_interpolation @@ -0,0 +1,9 @@ +component Main { + fun render : String { + ` "Hello" + #{"World!"} ` + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return ("Hello" + `World!`) +}; diff --git a/spec/compilers2/locale_key b/spec/compilers2/locale_key new file mode 100644 index 000000000..50ca436fb --- /dev/null +++ b/spec/compilers2/locale_key @@ -0,0 +1,27 @@ +locale en { + test: "Hello" +} + +component Main { + fun render : String { + :test + } +} +-------------------------------------------------------------------------------- +import { + translations as C, + translate as B, + locale as D +} from "runtime"; + +export const A = () => { + return B(`test`) +}; + +C.value = { + en: { + 'test': `Hello` + } +}; + +D.value = `en`; diff --git a/spec/compilers2/member_access b/spec/compilers2/member_access new file mode 100644 index 000000000..e4e597a1a --- /dev/null +++ b/spec/compilers2/member_access @@ -0,0 +1,43 @@ +record X { + name : String +} + +module Array { + fun map (array : Array(a), method : Function(a, b)) : Array(b) { + `` + } +} + +component Main { + fun render : String { + [ + { + name: "Joe" + }, + { + name: "Doe" + } + ] + |> Array.map(.name) + + "asd" + } +} +-------------------------------------------------------------------------------- +import { access as B } from "runtime"; + +export const + a = (b, c) => { + return undefined + }, + A = () => { + a([ + { + name: `Joe` + }, + { + name: `Doe` + } + ], B(`name`)); + return `asd` + }; diff --git a/spec/compilers2/module b/spec/compilers2/module new file mode 100644 index 000000000..42cafa5a2 --- /dev/null +++ b/spec/compilers2/module @@ -0,0 +1,23 @@ +module Html.Testing { + fun renderAll : Html { +

+ <{ "It should work" }> +

+ } +} + +component Main { + fun render : Html { + Html.Testing.renderAll() + } +} +-------------------------------------------------------------------------------- +import { createElement as A } from "runtime"; + +export const + a = () => { + return A(`p`, {}, [`It should work`]) + }, + B = () => { + return a() + }; diff --git a/spec/compilers2/module_access b/spec/compilers2/module_access new file mode 100644 index 000000000..25926594f --- /dev/null +++ b/spec/compilers2/module_access @@ -0,0 +1,30 @@ +module Test { + fun a : String { + "Hello" + } + + fun b : Function(String) { + Test.a + } +} + +component Main { + fun render : String { + let x = + Test.b() + + x() + } +} +-------------------------------------------------------------------------------- +export const + a = () => { + return `Hello` + }, + b = () => { + return a + }, + A = () => { + const c = b(); + return c() + }; diff --git a/spec/compilers2/module_access_get b/spec/compilers2/module_access_get new file mode 100644 index 000000000..9ae01c00a --- /dev/null +++ b/spec/compilers2/module_access_get @@ -0,0 +1,26 @@ +store Test { + get a : String { + "Hello" + } + + fun b : String { + Test.a + } +} + +component Main { + fun render : String { + Test.b() + } +} +-------------------------------------------------------------------------------- +export const + a = () => { + return `Hello` + }, + b = () => { + return a() + }, + A = () => { + return b() + }; diff --git a/spec/compilers2/module_access_subscriptions b/spec/compilers2/module_access_subscriptions new file mode 100644 index 000000000..37a938ae9 --- /dev/null +++ b/spec/compilers2/module_access_subscriptions @@ -0,0 +1,51 @@ +record Test { + test : String +} + +provider Test : Test { + fun update : Promise(Void) { + subscriptions + await void + } + + fun print (a : String) : String { + a + } +} + +component Main { + use Test { + test: "" + } + + fun render : String { + Test.subscriptions + Test.print("a") + } +} +-------------------------------------------------------------------------------- +import { + createProvider as B, + subscriptions as C, + useId as E +} from "runtime"; + +export const + a = new Map(), + b = (c) => { + return c + }, + A = B(a, async () => { + C(a); + return await null + }), + D = () => { + const d = E(); + A(d, () => { + return { + test: `` + } + }); + C(a); + return b(`a`) + }; diff --git a/spec/compilers2/module_call b/spec/compilers2/module_call new file mode 100644 index 000000000..e8690f524 --- /dev/null +++ b/spec/compilers2/module_call @@ -0,0 +1,26 @@ +module Test { + fun a (value : String) : String { + value + } + + fun b : String { + Test.a("Lorem ipsum dolor sit amet") + } +} + +component Main { + fun render : String { + Test.b() + } +} +-------------------------------------------------------------------------------- +export const + a = (b) => { + return b + }, + c = () => { + return a(`Lorem ipsum dolor sit amet`) + }, + A = () => { + return c() + }; diff --git a/spec/compilers2/module_call_piped b/spec/compilers2/module_call_piped new file mode 100644 index 000000000..21ba67372 --- /dev/null +++ b/spec/compilers2/module_call_piped @@ -0,0 +1,27 @@ +module Test { + fun a (x : Bool, value : String) : String { + value + } + + fun b : String { + true + |> Test.a("Lorem ipsum dolor sit amet") + } +} + +component Main { + fun render : String { + Test.b() + } +} +-------------------------------------------------------------------------------- +export const + a = (b, c) => { + return c + }, + d = () => { + return a(true, `Lorem ipsum dolor sit amet`) + }, + A = () => { + return d() + }; diff --git a/spec/compilers2/next_call b/spec/compilers2/next_call new file mode 100644 index 000000000..ffd98b9d9 --- /dev/null +++ b/spec/compilers2/next_call @@ -0,0 +1,37 @@ +component Main { + state name : String = "Joe" + state age : Number = 24 + + fun test : Promise(Void) { + next + { + name: "Hello", + age: 30 + } + } + + fun render : String { + test() + + "" + } +} +-------------------------------------------------------------------------------- +import { + useSignal as B, + batch as C +} from "runtime"; + +export const A = () => { + const + a = B(`Joe`), + b = B(24), + c = () => { + return C(() => { + a.value = `Hello`; + b.value = 30 + }) + }; + c(); + return `` +}; diff --git a/spec/compilers2/next_call_empty b/spec/compilers2/next_call_empty new file mode 100644 index 000000000..dc991181f --- /dev/null +++ b/spec/compilers2/next_call_empty @@ -0,0 +1,11 @@ +component Main { + fun render : String { + next {} + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + null; + return `` +}; diff --git a/spec/compilers2/number_literal_negative b/spec/compilers2/number_literal_negative new file mode 100644 index 000000000..a348075c2 --- /dev/null +++ b/spec/compilers2/number_literal_negative @@ -0,0 +1,11 @@ +component Main { + fun render : String { + -42 + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + -42; + return `` +}; diff --git a/spec/compilers2/number_literal_simple b/spec/compilers2/number_literal_simple new file mode 100644 index 000000000..efcc15473 --- /dev/null +++ b/spec/compilers2/number_literal_simple @@ -0,0 +1,11 @@ +component Main { + fun render : String { + 10 + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + 10; + return `` +}; diff --git a/spec/compilers2/number_literal_with_decimal b/spec/compilers2/number_literal_with_decimal new file mode 100644 index 000000000..70c37398a --- /dev/null +++ b/spec/compilers2/number_literal_with_decimal @@ -0,0 +1,11 @@ +component Main { + fun render : String { + 10.120 + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + 10.120; + return `` +}; diff --git a/spec/compilers2/operation_chained b/spec/compilers2/operation_chained new file mode 100644 index 000000000..c43a8147b --- /dev/null +++ b/spec/compilers2/operation_chained @@ -0,0 +1,13 @@ +component Main { + fun render : String { + "a" == "b" && true != false + "" + } +} +-------------------------------------------------------------------------------- +import { compare as B } from "runtime"; + +export const A = () => { + B(`a`, `b`) && !B(true, false); + return `` +}; diff --git a/spec/compilers2/operation_or b/spec/compilers2/operation_or new file mode 100644 index 000000000..16ad0c78c --- /dev/null +++ b/spec/compilers2/operation_or @@ -0,0 +1,24 @@ +enum Maybe(a) { + Nothing + Just(a) +} + +component Main { + fun render : String { + Maybe::Nothing or "Hello" + "" + } +} +-------------------------------------------------------------------------------- +import { + variant as B, + or as E +} from "runtime"; + +export const + A = B(0), + C = B(1), + D = () => { + E(new A()._0, `Hello`); + return `` + }; diff --git a/spec/compilers2/operation_simple b/spec/compilers2/operation_simple new file mode 100644 index 000000000..6df75f44b --- /dev/null +++ b/spec/compilers2/operation_simple @@ -0,0 +1,13 @@ +component Main { + fun render : String { + "a" == "b" + "" + } +} +-------------------------------------------------------------------------------- +import { compare as B } from "runtime"; + +export const A = () => { + B(`a`, `b`); + return `` +}; diff --git a/spec/compilers2/parenthesized_expression b/spec/compilers2/parenthesized_expression new file mode 100644 index 000000000..b9352f3c8 --- /dev/null +++ b/spec/compilers2/parenthesized_expression @@ -0,0 +1,11 @@ +component Main { + fun render : String { + (true) + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + (true); + return `` +}; diff --git a/spec/compilers2/pipe b/spec/compilers2/pipe new file mode 100644 index 000000000..c734a2cbe --- /dev/null +++ b/spec/compilers2/pipe @@ -0,0 +1,21 @@ +component Main { + fun render : Html { +
+ <{ (n : String) : String { n }("3") }> + <{ "3" |> (n : String) : String { n } }> +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + return B(`div`, {}, [ + ((a) => { + return a + })(`3`), + ((b) => { + return b + })(`3`) + ]) +}; diff --git a/spec/compilers2/property b/spec/compilers2/property new file mode 100644 index 000000000..e7cf65290 --- /dev/null +++ b/spec/compilers2/property @@ -0,0 +1,25 @@ +component Test { + property name : String = "Joe" + + fun render : Html { +
+ } +} + +component Main { + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const + A = ({ + a = `Joe` + }) => { + return B(`div`, {}) + }, + C = () => { + return B(A, {}) + }; diff --git a/spec/compilers2/property_without_default b/spec/compilers2/property_without_default new file mode 100644 index 000000000..1ce21dd14 --- /dev/null +++ b/spec/compilers2/property_without_default @@ -0,0 +1,28 @@ +component Test { + property name : String + + fun render : Html { +
+ } +} + +component Main { + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const + A = ({ + a + }) => { + return B(`div`, {}) + }, + C = () => { + return B(A, { + a: `HELLO` + }) + }; + diff --git a/spec/compilers2/provider_with_items b/spec/compilers2/provider_with_items new file mode 100644 index 000000000..1b285c6bc --- /dev/null +++ b/spec/compilers2/provider_with_items @@ -0,0 +1,64 @@ +record Subscription { + a : Bool, + b : Bool +} + +provider Provider : Subscription { + const NAME = "hello" + + state a : String = "" + + get b : String { + a + } + + fun update : Promise(Void) { + await void + } + + fun name : String { + NAME + } +} + +component Main { + use Provider { + a: true, + b: false + } + + fun render { +
+ } +} +-------------------------------------------------------------------------------- +import { + createProvider as C, + createElement as F, + signal as A, + useId as E +} from "runtime"; + +export const + a = new Map(), + b = `hello`, + c = () => { + return b + }, + d = A(``), + e = () => { + return d.value + }, + B = C(a, async () => { + return await null + }), + D = () => { + const f = E(); + B(f, () => { + return { + a: true, + b: false + } + }); + return F(`div`, {}) + }; diff --git a/spec/compilers2/record b/spec/compilers2/record new file mode 100644 index 000000000..ae7b07631 --- /dev/null +++ b/spec/compilers2/record @@ -0,0 +1,25 @@ +record Test { + a : String, + b : Number +} + +component Main { + fun render : Html { + { + a: "Hello", + b: 0 + } + +
+ } +} +-------------------------------------------------------------------------------- +import { createElement as B } from "runtime"; + +export const A = () => { + { + a: `Hello`, + b: 0 + }; + return B(`div`, {}) +}; diff --git a/spec/compilers2/record_update b/spec/compilers2/record_update new file mode 100644 index 000000000..d7a4a08fc --- /dev/null +++ b/spec/compilers2/record_update @@ -0,0 +1,28 @@ +record Record { + name: String +} + +component Main { + state record : Record = { name: "Doe" } + + fun render : Html { + { record | name: "John" } +
+ } +} +-------------------------------------------------------------------------------- +import { + createElement as C, + useSignal as B +} from "runtime"; + +export const A = () => { + const a = B({ + name: `Doe` + }); + { + ...a.value, + name: `John` + }; + return C(`div`, {}) +}; diff --git a/spec/compilers2/regexp_literal b/spec/compilers2/regexp_literal new file mode 100644 index 000000000..e9d582296 --- /dev/null +++ b/spec/compilers2/regexp_literal @@ -0,0 +1,11 @@ +component Main { + fun render : String { + /.*/gm + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + /.*/gm; + return `` +}; diff --git a/spec/compilers2/state b/spec/compilers2/state new file mode 100644 index 000000000..fe617c373 --- /dev/null +++ b/spec/compilers2/state @@ -0,0 +1,25 @@ +component Main { + state test : String = "Hello" + state blah : String = "0" + + fun asd : String { + test + blah + } + + fun render : String { + asd() + } +} +-------------------------------------------------------------------------------- +import { useSignal as B } from "runtime"; + +export const A = () => { + const + a = B(`Hello`), + b = B(`0`), + c = () => { + return a.value + b.value + }; + return c() +}; + diff --git a/spec/compilers2/statement b/spec/compilers2/statement new file mode 100644 index 000000000..d473aff79 --- /dev/null +++ b/spec/compilers2/statement @@ -0,0 +1,13 @@ +component Main { + fun render : String { + let x = + "hello" + + x + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = `hello`; + return a +}; diff --git a/spec/compilers2/static_component b/spec/compilers2/static_component new file mode 100644 index 000000000..55ee1c682 --- /dev/null +++ b/spec/compilers2/static_component @@ -0,0 +1,150 @@ +component Test { + property text : String = "" + + fun render : Html { +
<{ text }>
+ } +} + +component Test2 { + property text : String = "" + + fun render : Html { +
<{ text }>
+ } +} + +component TestWithChildren { + property children : Array(Html) = [] + property text : String = "" + + fun render : Html { +
<{ text }>
+ } +} + +component Main { + fun render : Html { + <> + + + + + + + + "Hello" + + + + "Hello" + + + + + + + + + + + } +} +-------------------------------------------------------------------------------- +const A = () => { + constructor(props) { + super(props); + + this._d({ + a: [ + null, + `` + ] + }); + } + + render() { + return _h("div", {}, [ + this.a + ]); + } +}; + +A.displayName = "Test"; + +class B extends _C { + constructor(props) { + super(props); + + this._d({ + b: [ + null, + `` + ] + }); + } + + render() { + return _h("div", {}, [ + this.b + ]); + } +}; + +B.displayName = "Test2"; + +class C extends _C { + constructor(props) { + super(props); + + this._d({ + d: [ + "children", + [] + ], + c: [ + null, + `` + ] + }); + } + + render() { + return _h("div", {}, [ + this.c + ]); + } +}; + +C.displayName = "TestWithChildren"; + +class D extends _C { + render() { + return _h(React.Fragment, {}, [ + $a(), + $a(), + $b(), + $b(), + $c(), + $c(), + $d(), + $e() + ]); + } +}; + +D.displayName = "Main"; + +const $a = _m(() => _h(A, {})); + +const $b = _m(() => _h(A, { + a: `Hello` +})); + +const $c = _m(() => _h(C, {}, _array(_h("span", {}, [ + `Hello` +])))); + +const $d = _m(() => _h(C, {}, _array($a()))); +const $f = _m(() => _h(B, {})); +const $e = _m(() => _h(C, {}, _array($f()))); diff --git a/spec/compilers2/store b/spec/compilers2/store new file mode 100644 index 000000000..bf4497b2a --- /dev/null +++ b/spec/compilers2/store @@ -0,0 +1,26 @@ +store Test { + state test : String = "" + + fun hello : String { + "hello" + } +} + +component Main { + connect Test exposing { test } + + fun render : String { + test + } +} +-------------------------------------------------------------------------------- +import { signal as A } from "runtime"; + +export const + a = () => { + return `hello` + }, + b = A(``), + B = () => { + return b.value + }; diff --git a/spec/compilers2/store_with_get b/spec/compilers2/store_with_get new file mode 100644 index 000000000..ae643d762 --- /dev/null +++ b/spec/compilers2/store_with_get @@ -0,0 +1,29 @@ +store Test { + state test : String = "" + + get hello : String { + "hello" + } +} + +component Main { + connect Test exposing { test as xxx } + + fun render : String { + xxx + Test.hello + } +} +-------------------------------------------------------------------------------- +import { signal as A } from "runtime"; + +export const + a = A(``), + b = () => { + return `hello` + }, + B = () => { + a.value; + return b() + }; + diff --git a/spec/compilers2/string_literal_broken b/spec/compilers2/string_literal_broken new file mode 100644 index 000000000..fdcdcd7c2 --- /dev/null +++ b/spec/compilers2/string_literal_broken @@ -0,0 +1,11 @@ +component Main { + fun render : String { + "First line" \ + "Second line" \ + "Third line" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `First lineSecond lineThird line` +}; diff --git a/spec/compilers2/string_literal_escaped b/spec/compilers2/string_literal_escaped new file mode 100644 index 000000000..5df330860 --- /dev/null +++ b/spec/compilers2/string_literal_escaped @@ -0,0 +1,9 @@ +component Main { + fun render : String { + "Hello There \"Joe\"" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `Hello There "Joe"` +}; diff --git a/spec/compilers2/string_literal_simple b/spec/compilers2/string_literal_simple new file mode 100644 index 000000000..50db540f9 --- /dev/null +++ b/spec/compilers2/string_literal_simple @@ -0,0 +1,9 @@ +component Main { + fun render : String { + "Hello There" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `Hello There` +}; diff --git a/spec/compilers2/string_literal_with_backtick b/spec/compilers2/string_literal_with_backtick new file mode 100644 index 000000000..936a625db --- /dev/null +++ b/spec/compilers2/string_literal_with_backtick @@ -0,0 +1,9 @@ +component Main { + fun render : String { + "Hello There `Joe`" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `Hello There \`Joe\`` +}; diff --git a/spec/compilers2/string_literal_with_escaped_interpolation b/spec/compilers2/string_literal_with_escaped_interpolation new file mode 100644 index 000000000..f05bee66c --- /dev/null +++ b/spec/compilers2/string_literal_with_escaped_interpolation @@ -0,0 +1,9 @@ +component Main { + fun render : String { + "Hello There \#{name}" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `Hello There #{name}` +}; diff --git a/spec/compilers2/string_literal_with_interpolation b/spec/compilers2/string_literal_with_interpolation new file mode 100644 index 000000000..7ebcebb6f --- /dev/null +++ b/spec/compilers2/string_literal_with_interpolation @@ -0,0 +1,9 @@ +component Main { + fun render : String { + "Hello There #{"Hello"}" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `Hello There ${`Hello`}` +}; diff --git a/spec/compilers2/string_literal_with_interpolation_and_js_iterpolation b/spec/compilers2/string_literal_with_interpolation_and_js_iterpolation new file mode 100644 index 000000000..7ebcebb6f --- /dev/null +++ b/spec/compilers2/string_literal_with_interpolation_and_js_iterpolation @@ -0,0 +1,9 @@ +component Main { + fun render : String { + "Hello There #{"Hello"}" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `Hello There ${`Hello`}` +}; diff --git a/spec/compilers2/string_literal_with_interpolation_of_number b/spec/compilers2/string_literal_with_interpolation_of_number new file mode 100644 index 000000000..797598e2c --- /dev/null +++ b/spec/compilers2/string_literal_with_interpolation_of_number @@ -0,0 +1,9 @@ +component Main { + fun render : String { + "Hello There #{0}" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `Hello There ${0}` +}; diff --git a/spec/compilers2/string_literal_with_js_iterpolation b/spec/compilers2/string_literal_with_js_iterpolation new file mode 100644 index 000000000..f6baea1bd --- /dev/null +++ b/spec/compilers2/string_literal_with_js_iterpolation @@ -0,0 +1,9 @@ +component Main { + fun render : String { + "Hello There ${a}" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + return `Hello There \${a}` +}; diff --git a/spec/compilers2/style_with_argument b/spec/compilers2/style_with_argument new file mode 100644 index 000000000..3b00b35e7 --- /dev/null +++ b/spec/compilers2/style_with_argument @@ -0,0 +1,34 @@ +component Main { + style test (color : String) { + color: #{color}; + } + + fun render : Html { + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const a = (b) => { + const _ = { + [`--a-a`]: b + }; + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([a(`red`)]) + }) +}; + +---=== /index.css ===--- +.Main_test { + color: var(--a-a); +} diff --git a/spec/compilers2/style_with_default_argument b/spec/compilers2/style_with_default_argument new file mode 100644 index 000000000..77cf26ae9 --- /dev/null +++ b/spec/compilers2/style_with_default_argument @@ -0,0 +1,34 @@ +component Main { + style test (color : String = "red") { + color: #{color}; + } + + fun render : Html { + +
+ } +} +-------------------------------------------------------------------------------- +---=== /index.js ===--- +import { + createElement as B, + style as C +} from "runtime"; + +export const A = () => { + const a = (b = `red`) => { + const _ = { + [`--a-a`]: b + }; + return _ + }; + return B(`div`, { + className: `Main_test`, + style: C([a()]) + }) +}; + +---=== /index.css ===--- +.Main_test { + color: var(--a-a); +} diff --git a/spec/compilers2/tuple_literal b/spec/compilers2/tuple_literal new file mode 100644 index 000000000..3ba53ea10 --- /dev/null +++ b/spec/compilers2/tuple_literal @@ -0,0 +1,19 @@ +component Main { + fun render : String { + { + "Hello", + "Blah", + "Joe" + } + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + [ + `Hello`, + `Blah`, + `Joe` + ]; + return `` +}; diff --git a/spec/compilers2/type b/spec/compilers2/type new file mode 100644 index 000000000..109b0fe92 --- /dev/null +++ b/spec/compilers2/type @@ -0,0 +1,39 @@ +enum Test(a) { + X + Y + Z(Res(a, Number)) +} + +enum Res(error, value) { + Error(error) + Ok(value) + Other(error, value) +} + +component Main { + fun render : String { + Test::X + Res::Other("", "") + Test::Z(Res::Error("")) + "" + } +} +-------------------------------------------------------------------------------- +import { + newVariant as I, + variant as B +} from "runtime"; + +export const + A = B(1), + C = B(0), + D = B(0), + E = B(2), + F = B(1), + G = B(1), + H = () => { + new D(); + I(E)(``, ``); + I(F)(I(G)(``)); + return `` + }; diff --git a/spec/compilers2/type_with_variants b/spec/compilers2/type_with_variants new file mode 100644 index 000000000..70cd3730a --- /dev/null +++ b/spec/compilers2/type_with_variants @@ -0,0 +1,54 @@ +enum A { + B(name : String, color : String) + C +} + +component Main { + fun render : String { + case (A::B(name: "Joe", color: "Blue")) { + A::B(color, name) => color + A::C => "" + } + } +} +-------------------------------------------------------------------------------- +import { + patternVariable as I, + patternRecord as H, + newVariant as F, + pattern as G, + variant as B, + match as E +} from "runtime"; + +export const + A = B(0), + C = B([ + "name", + "color" + ]), + D = () => { + return E(F(C)(`Joe`, `Blue`), [ + [ + G(C, H([ + [ + `color`, + I + ], + [ + `name`, + I + ] + ])), + (a, b) => { + return a + } + ], + [ + G(A, []), + () => { + return `` + } + ] + ]) + }; diff --git a/spec/compilers2/unary_minus b/spec/compilers2/unary_minus new file mode 100644 index 000000000..b99bff095 --- /dev/null +++ b/spec/compilers2/unary_minus @@ -0,0 +1,12 @@ +component Main { + fun render : String { + -(42) + + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + -((42)); + return `` +}; diff --git a/spec/compilers2/variable_argument b/spec/compilers2/variable_argument new file mode 100644 index 000000000..149c82824 --- /dev/null +++ b/spec/compilers2/variable_argument @@ -0,0 +1,16 @@ +component Main { + fun test (a : String) : String { + a + } + + fun render : String { + test("X") + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = (b) => { + return b + }; + return a(`X`) +}; diff --git a/spec/compilers2/variable_component_function b/spec/compilers2/variable_component_function new file mode 100644 index 000000000..bdc82ee57 --- /dev/null +++ b/spec/compilers2/variable_component_function @@ -0,0 +1,16 @@ +component Main { + fun test : String { + "Hello" + } + + fun render : String { + test() + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = () => { + return `Hello` + }; + return a() +}; diff --git a/spec/compilers2/variable_component_get b/spec/compilers2/variable_component_get new file mode 100644 index 000000000..c1c323fcf --- /dev/null +++ b/spec/compilers2/variable_component_get @@ -0,0 +1,16 @@ +component Main { + get test : String { + "Hello" + } + + fun render : String { + test + } +} +-------------------------------------------------------------------------------- +export const A = () => { + const a = () => { + return `Hello` + }; + return a() +}; diff --git a/spec/compilers2/variable_component_property b/spec/compilers2/variable_component_property new file mode 100644 index 000000000..a222d1c79 --- /dev/null +++ b/spec/compilers2/variable_component_property @@ -0,0 +1,25 @@ +component Test { + property test : String = "Hello" + + fun render : String { + test + } +} + +component Main { + fun render : Html { + + } +} +-------------------------------------------------------------------------------- +import { createElement as C } from "runtime"; + +export const + A = ({ + a = `Hello` + }) => { + return a + }, + B = () => { + return C(A, {}) + }; diff --git a/spec/compilers2/variable_module_function b/spec/compilers2/variable_module_function new file mode 100644 index 000000000..a4ef29b14 --- /dev/null +++ b/spec/compilers2/variable_module_function @@ -0,0 +1,30 @@ +module A { + fun a : String { + "Hello" + } + + fun b : Function(String) { + a + } +} + +component Main { + fun render : String { + let a = + A.b() + + a() + } +} +-------------------------------------------------------------------------------- +export const + a = () => { + return `Hello` + }, + b = () => { + return a + }, + A = () => { + const c = b(); + return c() + }; diff --git a/spec/compilers2/void b/spec/compilers2/void new file mode 100644 index 000000000..6365978da --- /dev/null +++ b/spec/compilers2/void @@ -0,0 +1,11 @@ +component Main { + fun render : String { + void + "" + } +} +-------------------------------------------------------------------------------- +export const A = () => { + null; + return `` +}; diff --git a/spec/compilers2_spec.cr b/spec/compilers2_spec.cr new file mode 100644 index 000000000..05837ff00 --- /dev/null +++ b/spec/compilers2_spec.cr @@ -0,0 +1,56 @@ +require "./spec_helper" + +Dir + .glob("./spec/compilers2/**/*") + .select! { |file| File.file?(file) } + .sort! + .each do |file| + next if File.basename(file).starts_with?("static_component") + + it file do + begin + # Read and separate sample from expected + sample, expected = File.read(file).split("-" * 80) + + # Parse the sample + ast = Mint::Parser.parse(sample, file) + ast.class.should eq(Mint::Ast) + + artifacts = + Mint::TypeChecker.check(ast) + + config = + Mint::Compiler2::Config.new( + runtime_path: "runtime", + include_program: false, + css_prefix: nil, + relative: false, + optimize: false, + build: true, + test: nil) + + files = + Mint::Compiler2 + .program(artifacts, config) + .reject! { |_, contents| contents.blank? } + + result = + case files.size + when 1 + files["/index.js"]?.to_s + else + files + .map { |path, contents| "---=== #{path} ===---\n#{contents}" } + .join("\n\n").strip + end + + begin + result.should eq(expected.strip) + rescue error + fail diff(expected, result) + end + rescue error : Mint::Error + fail error.to_terminal.to_s + end + end + end diff --git a/spec/errors/array_access_invalid_tuple b/spec/errors/array_access_invalid_tuple index 1ad006344..74dfef517 100644 --- a/spec/errors/array_access_invalid_tuple +++ b/spec/errors/array_access_invalid_tuple @@ -1,6 +1,6 @@ component Main { fun test : Maybe(String) { - {"Hello"}[1] + {"Hello", ""}[2] } fun render : Html { @@ -12,10 +12,12 @@ component Main { -------------------------------------------------------------------------------- ░ ERROR (ARRAY_ACCESS_INVALID_TUPLE) ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ -The tuple have only 1 members, but you wanted to access the 2nd. The exact type +The tuple have only 2 members, but you wanted to access the 3rd. The exact type of the tuple is: - Tuple(String) + Tuple( + String, + String) The tuple in question is here: @@ -23,8 +25,8 @@ The tuple in question is here: ├───────────────────────────────────────────── 1│ component Main { 2│ fun test : Maybe(String) { - 3│ {"Hello"}[1] - │ ⌃⌃⌃⌃⌃⌃⌃⌃⌃ + 3│ {"Hello", ""}[2] + │ ⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃⌃ 4│ } 5│ 6│ fun render : Html { diff --git a/spec/errors/tuple_literal_expected_closing_parenthesis b/spec/errors/tuple_literal_expected_closing_parenthesis index 04ba5cbaf..b8e333f53 100644 --- a/spec/errors/tuple_literal_expected_closing_parenthesis +++ b/spec/errors/tuple_literal_expected_closing_parenthesis @@ -1,6 +1,6 @@ component Main { fun render : String { - {""}[0] + {"", ""}[0] } } --------------------------------------------------------------------------------- \ No newline at end of file +-------------------------------------------------------------------------------- diff --git a/spec/examples/array_access b/spec/examples/array_access index 300379e51..f152266ca 100644 --- a/spec/examples/array_access +++ b/spec/examples/array_access @@ -37,7 +37,7 @@ component Main { -----------------------------------------------------array_access_invalid_tuple component Main { fun test : Maybe(String) { - {"Hello"}[1] + {"Hello", ""}[2] } fun render : Html { @@ -63,7 +63,7 @@ component Main { -------------------------------------------------------------------------------- component Main { fun test : String { - {"Hello"}[0] + {"Hello", ""}[0] } fun render : Html { diff --git a/spec/examples/tuple b/spec/examples/tuple index 02b7aae8c..8909c1d49 100644 --- a/spec/examples/tuple +++ b/spec/examples/tuple @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------- component Main { fun render : String { - {""}[0] + {"", ""}[0] } } ------------------------------------------------------------------------------- @@ -13,7 +13,7 @@ component Main { fun render : String { let x = "" - { x |> pipe }[0] + { x |> pipe, "" }[0] } } -------------------------------------tuple_literal_expected_closing_parenthesis diff --git a/spec/formatters/tuple_single b/spec/formatters/tuple_single deleted file mode 100644 index cb4b26616..000000000 --- a/spec/formatters/tuple_single +++ /dev/null @@ -1,13 +0,0 @@ -module Test { - fun test : Tuple(String) { - { - "Hello" - } - } -} --------------------------------------------------------------------------------- -module Test { - fun test : Tuple(String) { - #("Hello") - } -} diff --git a/spec/utils/markd_vdom_renderer2_spec.cr b/spec/utils/markd_vdom_renderer2_spec.cr new file mode 100644 index 000000000..2716d2026 --- /dev/null +++ b/spec/utils/markd_vdom_renderer2_spec.cr @@ -0,0 +1,134 @@ +require "../spec_helper" + +describe Mint::Compiler2::VDOMRenderer2 do + html_block = + <<-HTML + + + + +
+ hi +
+ HTML + + [ + {"**strong**", "A('p', {}, [A('strong', {}, [`strong`])])"}, + {"> quote", "A('blockquote', {}, [A('p', {}, [`quote`])])"}, + {"`code`", "A('p', {}, [A('code', {}, [`code`])])"}, + {"", "``"}, + {"###### Heading 6", "A('h6', {}, [`Heading 6`])"}, + {"##### Heading 5", "A('h5', {}, [`Heading 5`])"}, + {"#### Heading 4", "A('h4', {}, [`Heading 4`])"}, + {"### Heading 3", "A('h3', {}, [`Heading 3`])"}, + {"## Heading 2", "A('h2', {}, [`Heading 2`])"}, + {"# Heading 1", "A('h1', {}, [`Heading 1`])"}, + {"_em_", "A('p', {}, [A('em', {}, [`em`])])"}, + {"Paragraph", "A('p', {}, [`Paragraph`])"}, + {html_block, %(`#{html_block}`)}, + {"-----", "A('hr', {}, [])"}, + { + "foo\nbaz", + <<-TEXT + A('p', {}, [ + `foo`, + `\n`, + `baz` + ]) + TEXT + }, + { + "foo\\\nbar", + <<-TEXT + A('p', {}, [ + `foo`, + A('br', {}, []), + `bar` + ]) + TEXT + }, + { + "```html\ncode\n```", + <<-TEXT + A('pre', {}, [A('code', { + class: "language-html" + }, [`code`])]) + TEXT + }, + { + "* item 1\n* item 2", + <<-TEXT + A('ul', {}, [ + A('li', {}, [`item 1`]), + A('li', {}, [`item 2`]) + ]) + TEXT + }, + { + "[link](url)", + <<-TEXT + A('p', {}, [A('a', { + href: "url" + }, [`link`])]) + TEXT + }, + { + "![alt](url)", + <<-TEXT + A('p', {}, [A('img', { + src: "url", + alt: "alt" + }, [])]) + TEXT + }, + { + "*foo*", + <<-TEXT + A('p', {}, [ + ``, + A('em', {}, [`foo`]), + `` + ]) + TEXT + }, + ].each do |(markdown, expected)| + context markdown do + it "renders correctly" do + document = + Markd::Parser.parse(markdown, Markd::Options.new) + + renderer = + Mint::Compiler2::VDOMRenderer2.new + + js = + Mint::Compiler2::Js.new(false) + + class_pool = + Mint::NamePool(Mint::Ast::Node | Mint::Compiler2::Builtin, Mint::Ast::Node | Nil).new('A'.pred.to_s) + + pool = + Mint::NamePool(Mint::Ast::Node | Mint::Compiler2::Variable | String, Mint::Ast::Node | Nil).new + + js_renderer = + Mint::Compiler2::Renderer.new(base: nil, class_pool: class_pool, pool: pool) + + node = + Mint::Compiler2::VDOMRenderer2 + .render( + node: renderer.render(document, "___SEPARATOR___", false).children.first, + replacements: [] of Mint::Compiler2::Compiled, + separator: "", + js: js) + + result = + js_renderer.render(node) + + begin + result.should eq(expected.strip) + rescue error + fail diff(expected, result) + end + end + end + end +end diff --git a/src/all.cr b/src/all.cr index 93e7bbf4b..424e7743e 100644 --- a/src/all.cr +++ b/src/all.cr @@ -42,6 +42,10 @@ require "./type_checker" require "./formatters/**" require "./formatter" +require "./compilers2/**" +require "./compiler2/**" +require "./compiler2" + require "./compilers/**" require "./compiler" diff --git a/src/assets/runtime.js b/src/assets/runtime.js index c2340a738..3b733be64 100644 --- a/src/assets/runtime.js +++ b/src/assets/runtime.js @@ -1 +1,68 @@ -var Mint=function(){"use strict";var t,e,n,r,o,i,a={},s=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function l(t,e){for(var n in e)t[n]=e[n];return t}function c(t){var e=t.parentNode;e&&e.removeChild(t)}function h(t,e,n){var r,o=arguments,i={};for(r in e)"key"!==r&&"ref"!==r&&(i[r]=e[r]);if(arguments.length>3)for(n=[n],r=3;r3;)n.pop()();if(n[1]t.original)),r.component=t,r.props=n,customElements.define(e,r)}function ot(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function it(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function at(t){it(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}function st(t,e){it(2,arguments);var n=at(t),r=ot(e);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());i.setMonth(n.getMonth()+r+1,0);var a=i.getDate();return o>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}function ut(t,e){it(2,arguments);var n=at(t).getTime(),r=ot(e);return new Date(n+r)}var lt={};function ct(){return lt}function ht(t,e){var n,r,o,i,a,s,u,l;it(1,arguments);var c=ct(),h=ot(null!==(n=null!==(r=null!==(o=null!==(i=null==e?void 0:e.weekStartsOn)&&void 0!==i?i:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:c.weekStartsOn)&&void 0!==r?r:null===(u=c.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==n?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=at(t),d=f.getDay(),p=(d0?1:o}function mt(t){return it(1,arguments),t instanceof Date||"object"==typeof t&&"[object Date]"===Object.prototype.toString.call(t)}function vt(t){if(it(1,arguments),!mt(t)&&"number"!=typeof t)return!1;var e=at(t);return!isNaN(Number(e))}function yt(t){it(1,arguments);var e=at(t);return e.setHours(23,59,59,999),e}function _t(t){it(1,arguments);var e=at(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function gt(t,e){var n;it(1,arguments);var r=t||{},o=at(r.start),i=at(r.end),a=i.getTime();if(!(o.getTime()<=a))throw new RangeError("Invalid interval");var s=[],u=o;u.setHours(0,0,0,0);var l=Number(null!==(n=null==e?void 0:e.step)&&void 0!==n?n:1);if(l<1||isNaN(l))throw new RangeError("`options.step` must be a number greater than 1");for(;u.getTime()<=a;)s.push(at(u)),u.setDate(u.getDate()+l),u.setHours(0,0,0,0);return s}function wt(t){it(1,arguments);var e=at(t);return e.setDate(1),e.setHours(0,0,0,0),e}function bt(t,e){var n,r,o,i,a,s,u,l;it(1,arguments);var c=ct(),h=ot(null!==(n=null!==(r=null!==(o=null!==(i=null==e?void 0:e.weekStartsOn)&&void 0!==i?i:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:c.weekStartsOn)&&void 0!==r?r:null===(u=c.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==n?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=at(t),d=f.getDay(),p=6+(d=o.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function Tt(t){it(1,arguments);var e=xt(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=Et(n);return r}var Ct=6048e5;function Dt(t,e){var n,r,o,i,a,s,u,l;it(1,arguments);var c=ct(),h=ot(null!==(n=null!==(r=null!==(o=null!==(i=null==e?void 0:e.weekStartsOn)&&void 0!==i?i:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:c.weekStartsOn)&&void 0!==r?r:null===(u=c.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==n?n:0);if(!(h>=0&&h<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=at(t),d=f.getUTCDay(),p=(d=1&&d<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=new Date(0);p.setUTCFullYear(h+1,0,d),p.setUTCHours(0,0,0,0);var m=Dt(p,e),v=new Date(0);v.setUTCFullYear(h,0,d),v.setUTCHours(0,0,0,0);var y=Dt(v,e);return c.getTime()>=m.getTime()?h+1:c.getTime()>=y.getTime()?h:h-1}function Mt(t,e){var n,r,o,i,a,s,u,l;it(1,arguments);var c=ct(),h=ot(null!==(n=null!==(r=null!==(o=null!==(i=null==e?void 0:e.firstWeekContainsDate)&&void 0!==i?i:null==e||null===(a=e.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:c.firstWeekContainsDate)&&void 0!==r?r:null===(u=c.locale)||void 0===u||null===(l=u.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==n?n:1),f=Pt(t,e),d=new Date(0);d.setUTCFullYear(f,0,h),d.setUTCHours(0,0,0,0);var p=Dt(d,e);return p}var Ot=6048e5;function At(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?n:1-n;return At("yy"===e?r%100:r,e.length)},Nt=function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):At(n+1,2)},Ut=function(t,e){return At(t.getUTCDate(),e.length)},qt=function(t,e){return At(t.getUTCHours()%12||12,e.length)},Wt=function(t,e){return At(t.getUTCHours(),e.length)},Rt=function(t,e){return At(t.getUTCMinutes(),e.length)},It=function(t,e){return At(t.getUTCSeconds(),e.length)},Lt=function(t,e){var n=e.length,r=t.getUTCMilliseconds();return At(Math.floor(r*Math.pow(10,n-3)),e.length)},Yt={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return jt(t,e)},Y:function(t,e,n,r){var o=Pt(t,r),i=o>0?o:1-o;return"YY"===e?At(i%100,2):"Yo"===e?n.ordinalNumber(i,{unit:"year"}):At(i,e.length)},R:function(t,e){return At(xt(t),e.length)},u:function(t,e){return At(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return At(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return At(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return Nt(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return At(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var o=function(t,e){it(1,arguments);var n=at(t),r=Dt(n,e).getTime()-Mt(n,e).getTime();return Math.round(r/Ot)+1}(t,r);return"wo"===e?n.ordinalNumber(o,{unit:"week"}):At(o,e.length)},I:function(t,e,n){var r=function(t){it(1,arguments);var e=at(t),n=Et(e).getTime()-Tt(e).getTime();return Math.round(n/Ct)+1}(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):At(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):Ut(t,e)},D:function(t,e,n){var r=function(t){it(1,arguments);var e=at(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),o=n-r;return Math.floor(o/St)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):At(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var o=t.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return At(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var o=t.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return At(i,e.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),o=0===r?7:r;switch(e){case"i":return String(o);case"ii":return At(o,e.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,o=t.getUTCHours();switch(r=12===o?"noon":0===o?"midnight":o/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,o=t.getUTCHours();switch(r=o>=17?"evening":o>=12?"afternoon":o>=4?"morning":"night",e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return qt(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):Wt(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):At(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):At(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):Rt(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):It(t,e)},S:function(t,e){return Lt(t,e)},X:function(t,e,n,r){var o=(r._originalDate||t).getTimezoneOffset();if(0===o)return"Z";switch(e){case"X":return Ft(o);case"XXXX":case"XX":return Ht(o);default:return Ht(o,":")}},x:function(t,e,n,r){var o=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return Ft(o);case"xxxx":case"xx":return Ht(o);default:return Ht(o,":")}},O:function(t,e,n,r){var o=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+$t(o,":");default:return"GMT"+Ht(o,":")}},z:function(t,e,n,r){var o=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+$t(o,":");default:return"GMT"+Ht(o,":")}},t:function(t,e,n,r){var o=r._originalDate||t;return At(Math.floor(o.getTime()/1e3),e.length)},T:function(t,e,n,r){return At((r._originalDate||t).getTime(),e.length)}};function $t(t,e){var n=t>0?"-":"+",r=Math.abs(t),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=e||"";return n+String(o)+a+At(i,2)}function Ft(t,e){return t%60==0?(t>0?"-":"+")+At(Math.abs(t)/60,2):Ht(t,e)}function Ht(t,e){var n=e||"",r=t>0?"-":"+",o=Math.abs(t);return r+At(Math.floor(o/60),2)+n+At(o%60,2)}var zt=Yt,Bt=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},Xt=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},Gt={p:Xt,P:function(t,e){var n,r=t.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return Bt(t,e);switch(o){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",Bt(o,e)).replace("{{time}}",Xt(i,e))}},Qt=["D","DD"],Jt=["YY","YYYY"];function Vt(t){return-1!==Qt.indexOf(t)}function Kt(t){return-1!==Jt.indexOf(t)}function Zt(t,e,n){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var te={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function ee(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var ne={date:ee({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:ee({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:ee({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},re={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function oe(t){return function(e,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=t.formattingValues[i]||t.formattingValues[o]}else{var a=t.defaultWidth,s=null!=n&&n.width?String(n.width):t.defaultWidth;r=t.values[s]||t.values[a]}return r[t.argumentCallback?t.argumentCallback(e):e]}}var ie={ordinalNumber:function(t,e){var n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:oe({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:oe({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:oe({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:oe({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:oe({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},ae=ie;function se(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],i=e.match(o);if(!i)return null;var a,s=i[0],u=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(u)?le(u,(function(t){return t.test(s)})):ue(u,(function(t){return t.test(s)}));a=t.valueCallback?t.valueCallback(l):l,a=n.valueCallback?n.valueCallback(a):a;var c=e.slice(s.length);return{value:a,rest:c}}}function ue(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function le(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(ce.matchPattern);if(!n)return null;var r=n[0],o=t.match(ce.parsePattern);if(!o)return null;var i=ce.valueCallback?ce.valueCallback(o[0]):o[0];i=e.valueCallback?e.valueCallback(i):i;var a=t.slice(r.length);return{value:i,rest:a}}),era:se({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:se({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:se({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:se({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:se({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},fe={code:"en-US",formatDistance:function(t,e,n){var r,o=te[t];return r="string"==typeof o?o:1===e?o.one:o.other.replace("{{count}}",e.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:ne,formatRelative:function(t,e,n,r){return re[t]},localize:ae,match:he,options:{weekStartsOn:0,firstWeekContainsDate:1}},de=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,pe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,me=/^'([^]*?)'?$/,ve=/''/g,ye=/[a-zA-Z]/;function _e(t,e,n){var r,o,i,a,s,u,l,c,h,f,d,p,m,v,y,_,g,w;it(2,arguments);var b=String(e),k=ct(),S=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:k.locale)&&void 0!==r?r:fe,E=ot(null!==(i=null!==(a=null!==(s=null!==(u=null==n?void 0:n.firstWeekContainsDate)&&void 0!==u?u:null==n||null===(l=n.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==s?s:k.firstWeekContainsDate)&&void 0!==a?a:null===(h=k.locale)||void 0===h||null===(f=h.options)||void 0===f?void 0:f.firstWeekContainsDate)&&void 0!==i?i:1);if(!(E>=1&&E<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var x=ot(null!==(d=null!==(p=null!==(m=null!==(v=null==n?void 0:n.weekStartsOn)&&void 0!==v?v:null==n||null===(y=n.locale)||void 0===y||null===(_=y.options)||void 0===_?void 0:_.weekStartsOn)&&void 0!==m?m:k.weekStartsOn)&&void 0!==p?p:null===(g=k.locale)||void 0===g||null===(w=g.options)||void 0===w?void 0:w.weekStartsOn)&&void 0!==d?d:0);if(!(x>=0&&x<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!S.localize)throw new RangeError("locale must contain localize property");if(!S.formatLong)throw new RangeError("locale must contain formatLong property");var T=at(t);if(!vt(T))throw new RangeError("Invalid time value");var C=ft(T),D=kt(T,C),P={firstWeekContainsDate:E,weekStartsOn:x,locale:S,_originalDate:T},M=b.match(pe).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,Gt[e])(t,S.formatLong):t})).join("").match(de).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return ge(r);var i=zt[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||!Kt(r)||Zt(r,e,String(t)),null!=n&&n.useAdditionalDayOfYearTokens||!Vt(r)||Zt(r,e,String(t)),i(D,r,S.localize,P);if(o.match(ye))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("");return M}function ge(t){var e=t.match(me);return e?e[1].replace(ve,"'"):t}function we(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function be(t){return we({},t)}var ke=6e4,Se=1440,Ee=43200,xe=525600;function Te(t,e,n){var r,o,i;it(2,arguments);var a=ct(),s=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:a.locale)&&void 0!==r?r:fe;if(!s.formatDistance)throw new RangeError("locale must contain localize.formatDistance property");var u=pt(t,e);if(isNaN(u))throw new RangeError("Invalid time value");var l,c,h=we(be(n),{addSuffix:Boolean(null==n?void 0:n.addSuffix),comparison:u});u>0?(l=at(e),c=at(t)):(l=at(t),c=at(e));var f,d=String(null!==(i=null==n?void 0:n.roundingMethod)&&void 0!==i?i:"round");if("floor"===d)f=Math.floor;else if("ceil"===d)f=Math.ceil;else{if("round"!==d)throw new RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");f=Math.round}var p,m=c.getTime()-l.getTime(),v=m/ke,y=ft(c)-ft(l),_=(m-y)/ke,g=null==n?void 0:n.unit;if("second"===(p=g?String(g):v<1?"second":v<60?"minute":vvoid 0===t&&void 0===e||null===t&&null===e||(null!=t&&null!=t&&t[Ce]?t[Ce](e):null!=e&&null!=e&&e[Ce]?e[Ce](t):(t&&t.$$typeof===De||e&&e.$$typeof===De||console.warn("Comparing entites with === because there is no comparison function defined:",t,e),t===e));class Record{constructor(t){for(let e in t)this[e]=t[e]}[Ce](t){if(!(t instanceof Record))return!1;if(Object.keys(this).length!==Object.keys(t).length)return!1;for(let e in this)if(!Pe(t[e],this[e]))return!1;return!0}}const Me=(t,e)=>n=>{const r=class extends Record{};return r.mappings=n,r.encode=t=>{const e={};for(let r in n){const[o,i,a]=n[r];e[o]=a?a(t[r]):t[r]}return e},r.decode=o=>{const{ok:i,err:a}=e,s={};for(let e in n){const[r,i]=n[e],u=t.field(r,i)(o);if(u instanceof a)return u;s[e]=u._0}return new i(new r(s))},r},Oe=(t,e)=>{const n=Object.assign(Object.create(null),t,e);return t instanceof Record?new t.constructor(n):new Record(n)},Ae=(t,e=!0,n=!0,r=null)=>{if(window.location.pathname+window.location.search+window.location.hash!==t&&(e?window.history.pushState({},"",t):window.history.replaceState({},"",t)),e){let t=new PopStateEvent("popstate");t.triggerJump=n,t.routeInfo=r,dispatchEvent(t)}},je=t=>{let e=document.createElement("style");document.head.appendChild(e),e.innerHTML=t},Ne=t=>(e,n)=>{const{just:r,nothing:o}=t;return e.length>=n+1&&n>=0?new r(e[n]):new o};class Ue{constructor(){this.effectAllowed="none",this.dropEffect="none",this.files=[],this.types=[],this.cache={}}getData(t){return this.cache[t]||""}setData(t,e){return this.cache[t]=e,null}clearData(){return this.cache={},null}}const qe=t=>new Proxy(t,{get:function(t,e){if(e in t){const n=t[e];return n instanceof Function?()=>t[e]():n}switch(e){case"clipboardData":return t.clipboardData=new Ue;case"dataTransfer":return t.dataTransfer=new Ue;case"data":case"key":case"locale":case"animationName":case"pseudoElement":case"propertyName":return"";case"altKey":case"ctrlKey":case"metaKey":case"repeat":case"shiftKey":return!1;case"charCode":case"keyCode":case"location":case"which":case"button":case"buttons":case"clientX":case"clientY":case"pageX":case"pageY":case"screenX":case"screenY":case"detail":case"deltaMode":case"deltaX":case"deltaY":case"deltaZ":case"elapsedTime":return-1;default:return}}}),We=(t,e)=>{const n=Object.getOwnPropertyDescriptors(Reflect.getPrototypeOf(t));for(let r in n){if(e&&e[r])continue;const o=n[r].value;"function"==typeof o&&(t[r]=o.bind(t))}},Re=(t,e)=>{if(!e)return;const n={};Object.keys(e).forEach((t=>{let r=null;n[t]={get:()=>(r||(r=e[t]()),r)}})),Object.defineProperties(t,n)},Ie=function(){let t=Array.from(arguments);return Array.isArray(t[0])&&1===t.length?t[0]:t},Le=function(t){const e={},n=(t,n)=>{e[t.toString().trim()]=n.toString().trim()};for(let e of t)if("string"==typeof e)e.split(";").forEach((t=>{const[e,r]=t.split(":");e&&r&&n(e,r)}));else if(e instanceof Map)for(let[t,r]of e)n(t,r);else if(e instanceof Array)for(let[t,r]of e)n(t,r);else for(let t in e)n(t,e[t]);return e};class Ye extends p{render(){const t=[];for(let e in this.props.globals)t.push(h(this.props.globals[e],{ref:t=>t._persist(),key:e}));return h("div",{},[...t,...this.props.children])}}Ye.displayName="Mint.Root";class $e{constructor(t){t&&t instanceof Node&&t!==document.body?this.root=t:(this.root=document.createElement("div"),document.body.appendChild(this.root))}render(t,e){void 0!==t&&P(h(Ye,{globals:e},[h(t,{key:"$MAIN"})]),this.root)}}class Fe{constructor(t,e){this.teardown=e,this.subject=t,this.steps=[]}async run(){let t;try{t=await new Promise(this.next.bind(this))}finally{this.teardown&&this.teardown()}return t}async next(t,e){requestAnimationFrame((async()=>{let n=this.steps.shift();if(n)try{this.subject=await n(this.subject)}catch(t){return e(t)}this.steps.length?this.next(t,e):t(this.subject)}))}step(t){return this.steps.push(t),this}}const He=["componentWillMount","render","getSnapshotBeforeUpdate","componentDidMount","componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","componentDidUpdate","componentWillUnmount","componentDidCatch","setState","forceUpdate","constructor"];class ze extends p{constructor(t){super(t),We(this,He)}_d(t,e){Re(this,e);const n={};Object.keys(t).forEach((e=>{const[r,o]=t[e],i=r||e;n[e]={get:()=>i in this.props?this.props[i]:o}})),Object.defineProperties(this,n)}}class Be{constructor(){We(this),this.subscriptions=new Map,this.state={}}setState(t,e){this.state=Object.assign({},this.state,t),e()}_d(t){Re(this,t)}_subscribe(t,e){const n=this.subscriptions.get(t);null==e||null!=n&&((t,e)=>{if(t instanceof Object&&e instanceof Object){const n=new Set(Object.keys(t).concat(Object.keys(e)));for(let r of n)if(!Pe(t[r],e[r]))return!1;return!0}return console.warn("Comparing entites with === because there is no comparison function defined:",t,e),t===e})(n,e)||(this.subscriptions.set(t,e),this._update())}_unsubscribe(t){this.subscriptions.has(t)&&(this.subscriptions.delete(t),this._update())}_update(){this.update()}get _subscriptions(){return Array.from(this.subscriptions.values())}update(){}}var Xe,Ge,Qe=(Xe=function(t,e){var n=function(){var t=function(t,e,n,r){for(n=n||{},r=t.length;r--;n[t[r]]=e);return n},e=[1,9],n=[1,10],r=[1,11],o=[1,12],i=[5,11,12,13,14,15],a={trace:function(){},yy:{},symbols_:{error:2,root:3,expressions:4,EOF:5,expression:6,optional:7,literal:8,splat:9,param:10,"(":11,")":12,LITERAL:13,SPLAT:14,PARAM:15,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",11:"(",12:")",13:"LITERAL",14:"SPLAT",15:"PARAM"},productions_:[0,[3,2],[3,1],[4,2],[4,1],[6,1],[6,1],[6,1],[6,1],[7,3],[8,1],[9,1],[10,1]],performAction:function(t,e,n,r,o,i,a){var s=i.length-1;switch(o){case 1:return new r.Root({},[i[s-1]]);case 2:return new r.Root({},[new r.Literal({value:""})]);case 3:this.$=new r.Concat({},[i[s-1],i[s]]);break;case 4:case 5:this.$=i[s];break;case 6:this.$=new r.Literal({value:i[s]});break;case 7:this.$=new r.Splat({name:i[s]});break;case 8:this.$=new r.Param({name:i[s]});break;case 9:this.$=new r.Optional({},[i[s-1]]);break;case 10:this.$=t;break;case 11:case 12:this.$=t.slice(1)}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:7,10:8,11:e,13:n,14:r,15:o},{1:[3]},{5:[1,13],6:14,7:5,8:6,9:7,10:8,11:e,13:n,14:r,15:o},{1:[2,2]},t(i,[2,4]),t(i,[2,5]),t(i,[2,6]),t(i,[2,7]),t(i,[2,8]),{4:15,6:4,7:5,8:6,9:7,10:8,11:e,13:n,14:r,15:o},t(i,[2,10]),t(i,[2,11]),t(i,[2,12]),{1:[2,1]},t(i,[2,3]),{6:14,7:5,8:6,9:7,10:8,11:e,12:[1,16],13:n,14:r,15:o},t(i,[2,9])],defaultActions:{3:[2,2],13:[2,1]},parseError:function(t,e){if(!e.recoverable){function n(t,e){this.message=t,this.hash=e}throw n.prototype=Error,new n(t,e)}this.trace(t)},parse:function(t){var e=this,n=[0],r=[null],o=[],i=this.table,a="",s=0,u=0,l=2,c=1,h=o.slice.call(arguments,1),f=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);f.setInput(t,d.yy),d.yy.lexer=f,d.yy.parser=this,void 0===f.yylloc&&(f.yylloc={});var m=f.yylloc;o.push(m);var v=f.options&&f.options.ranges;"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var y,_,g,w,b,k,S,E,x=function(){var t;return"number"!=typeof(t=f.lex()||c)&&(t=e.symbols_[t]||t),t},T={};;){if(_=n[n.length-1],this.defaultActions[_]?g=this.defaultActions[_]:(null==y&&(y=x()),g=i[_]&&i[_][y]),void 0===g||!g.length||!g[0]){var C="";for(b in E=[],i[_])this.terminals_[b]&&b>l&&E.push("'"+this.terminals_[b]+"'");C=f.showPosition?"Parse error on line "+(s+1)+":\n"+f.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[y]||y)+"'":"Parse error on line "+(s+1)+": Unexpected "+(y==c?"end of input":"'"+(this.terminals_[y]||y)+"'"),this.parseError(C,{text:f.match,token:this.terminals_[y]||y,line:f.yylineno,loc:m,expected:E})}if(g[0]instanceof Array&&g.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+y);switch(g[0]){case 1:n.push(y),r.push(f.yytext),o.push(f.yylloc),n.push(g[1]),y=null,u=f.yyleng,a=f.yytext,s=f.yylineno,m=f.yylloc;break;case 2:if(k=this.productions_[g[1]][1],T.$=r[r.length-k],T._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},v&&(T._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),void 0!==(w=this.performAction.apply(T,[a,u,s,d.yy,g[1],r,o].concat(h))))return w;k&&(n=n.slice(0,-1*k*2),r=r.slice(0,-1*k),o=o.slice(0,-1*k)),n.push(this.productions_[g[1]][0]),r.push(T.$),o.push(T._$),S=i[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0}},s=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var o=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[o[0],o[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var n,r,o;if(this.options.backtrack_lexer&&(o={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(o.yylloc.range=this.yylloc.range.slice(0))),(r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var i in o)this[i]=o[i];return!1}return!1},next:function(){if(this.done)return this.EOF;var t,e,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o=this._currentRules(),i=0;ie[0].length)){if(e=n,r=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,o[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,o[r]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(t,e,n,r){switch(n){case 0:return"(";case 1:return")";case 2:return"SPLAT";case 3:return"PARAM";case 4:case 5:return"LITERAL";case 6:return"EOF"}},rules:[/^(?:\()/,/^(?:\))/,/^(?:\*+\w+)/,/^(?::+\w+)/,/^(?:[\w%\-~\n]+)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return t}();function u(){this.yy={}}return a.lexer=s,u.prototype=a,a.Parser=u,new u}();e.parser=n,e.Parser=n.Parser,e.parse=function(){return n.parse.apply(n,arguments)}},Xe(Ge={path:undefined,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&Ge.path)}},Ge.exports),Ge.exports);function Je(t){return function(e,n){return{displayName:t,props:e,children:n||[]}}}var Ve={Root:Je("Root"),Concat:Je("Concat"),Literal:Je("Literal"),Splat:Je("Splat"),Param:Je("Param"),Optional:Je("Optional")},Ke=Qe.parser;Ke.yy=Ve;var Ze=Ke,tn=Object.keys(Ve),en=function(t){return tn.forEach((function(e){if(void 0===t[e])throw new Error("No handler defined for "+e.displayName)})),{visit:function(t,e){return this.handlers[t.displayName].call(this,t,e)},handlers:t}},nn=/[\-{}\[\]+?.,\\\^$|#\s]/g;function rn(t){this.captures=t.captures,this.re=t.re}rn.prototype.match=function(t){var e=this.re.exec(t),n={};return!!e&&(this.captures.forEach((function(t,r){void 0===e[r+1]?n[t]=void 0:n[t]=decodeURIComponent(e[r+1])})),n)};var on=en({Concat:function(t){return t.children.reduce(function(t,e){var n=this.visit(e);return{re:t.re+n.re,captures:t.captures.concat(n.captures)}}.bind(this),{re:"",captures:[]})},Literal:function(t){return{re:t.props.value.replace(nn,"\\$&"),captures:[]}},Splat:function(t){return{re:"([^?#]*?)",captures:[t.props.name]}},Param:function(t){return{re:"([^\\/\\?#]+)",captures:[t.props.name]}},Optional:function(t){var e=this.visit(t.children[0]);return{re:"(?:"+e.re+")?",captures:e.captures}},Root:function(t){var e=this.visit(t.children[0]);return new rn({re:new RegExp("^"+e.re+"(?=\\?|#|$)"),captures:e.captures})}}),an=en({Concat:function(t,e){var n=t.children.map(function(t){return this.visit(t,e)}.bind(this));return!n.some((function(t){return!1===t}))&&n.join("")},Literal:function(t){return decodeURI(t.props.value)},Splat:function(t,e){return void 0!==e[t.props.name]&&e[t.props.name]},Param:function(t,e){return void 0!==e[t.props.name]&&e[t.props.name]},Optional:function(t,e){return this.visit(t.children[0],e)||""},Root:function(t,e){e=e||{};var n=this.visit(t.children[0],e);return!1!==n&&void 0!==n&&encodeURI(n)}}),sn=an;function un(t){var e;if(e=this?this:Object.create(un.prototype),void 0===t)throw new Error("A route spec is required");return e.spec=t,e.ast=Ze.parse(t),e}un.prototype=Object.create(null),un.prototype.match=function(t){var e=on.visit(this.ast).match(t);return null!==e&&e},un.prototype.reverse=function(t){return sn.visit(this.ast,t)};var ln=un,cn=Object.getOwnPropertyNames,hn=Object.getOwnPropertySymbols,fn=Object.prototype.hasOwnProperty;function dn(t,e){return function(n,r,o){return t(n,r,o)&&e(n,r,o)}}function pn(t){return function(e,n,r){if(!e||!n||"object"!=typeof e||"object"!=typeof n)return t(e,n,r);var o=r.cache,i=o.get(e),a=o.get(n);if(i&&a)return i===n&&a===e;o.set(e,n),o.set(n,e);var s=t(e,n,r);return o.delete(e),o.delete(n),s}}function mn(t){return cn(t).concat(hn(t))}var vn=Object.hasOwn||function(t,e){return fn.call(t,e)};function yn(t,e){return t||e?t===e:t===e||t!=t&&e!=e}var _n="_owner",gn=Object.getOwnPropertyDescriptor,wn=Object.keys;function bn(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function kn(t,e){return yn(t.getTime(),e.getTime())}function Sn(t,e,n){if(t.size!==e.size)return!1;for(var r,o,i={},a=t.entries(),s=0;(r=a.next())&&!r.done;){for(var u=e.entries(),l=!1,c=0;(o=u.next())&&!o.done;){var h=r.value,f=h[0],d=h[1],p=o.value,m=p[0],v=p[1];l||i[c]||!(l=n.equals(f,m,s,c,t,e,n)&&n.equals(d,v,f,m,t,e,n))||(i[c]=!0),c++}if(!l)return!1;s++}return!0}function En(t,e,n){var r,o=wn(t),i=o.length;if(wn(e).length!==i)return!1;for(;i-- >0;){if((r=o[i])===_n&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof)return!1;if(!vn(e,r)||!n.equals(t[r],e[r],r,r,t,e,n))return!1}return!0}function xn(t,e,n){var r,o,i,a=mn(t),s=a.length;if(mn(e).length!==s)return!1;for(;s-- >0;){if((r=a[s])===_n&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof)return!1;if(!vn(e,r))return!1;if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;if(o=gn(t,r),i=gn(e,r),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function Tn(t,e){return yn(t.valueOf(),e.valueOf())}function Cn(t,e){return t.source===e.source&&t.flags===e.flags}function Dn(t,e,n){if(t.size!==e.size)return!1;for(var r,o,i={},a=t.values();(r=a.next())&&!r.done;){for(var s=e.values(),u=!1,l=0;(o=s.next())&&!o.done;)u||i[l]||!(u=n.equals(r.value,o.value,r.value,o.value,t,e,n))||(i[l]=!0),l++;if(!u)return!1}return!0}function Pn(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var Mn=Array.isArray,On="function"==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView:null,An=Object.assign,jn=Object.prototype.toString.call.bind(Object.prototype.toString),Nn=Un();function Un(t){void 0===t&&(t={});var e=t.circular,n=void 0!==e&&e,r=t.createInternalComparator,o=t.createState,i=t.strict,a=void 0!==i&&i,s=function(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,o={areArraysEqual:r?xn:bn,areDatesEqual:kn,areMapsEqual:r?dn(Sn,xn):Sn,areObjectsEqual:r?xn:En,arePrimitiveWrappersEqual:Tn,areRegExpsEqual:Cn,areSetsEqual:r?dn(Dn,xn):Dn,areTypedArraysEqual:r?xn:Pn};if(n&&(o=An({},o,n(o))),e){var i=pn(o.areArraysEqual),a=pn(o.areMapsEqual),s=pn(o.areObjectsEqual),u=pn(o.areSetsEqual);o=An({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:u})}return o}(t),u=function(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,o=t.areObjectsEqual,i=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,s=t.areSetsEqual,u=t.areTypedArraysEqual;return function(t,l,c){if(t===l)return!0;if(null==t||null==l||"object"!=typeof t||"object"!=typeof l)return t!=t&&l!=l;var h=t.constructor;if(h!==l.constructor)return!1;if(h===Object)return o(t,l,c);if(Mn(t))return e(t,l,c);if(null!=On&&On(t))return u(t,l,c);if(h===Date)return n(t,l,c);if(h===RegExp)return a(t,l,c);if(h===Map)return r(t,l,c);if(h===Set)return s(t,l,c);var f=jn(t);return"[object Date]"===f?n(t,l,c):"[object RegExp]"===f?a(t,l,c):"[object Map]"===f?r(t,l,c):"[object Set]"===f?s(t,l,c):"[object Object]"===f?"function"!=typeof t.then&&"function"!=typeof l.then&&o(t,l,c):"[object Arguments]"===f?o(t,l,c):("[object Boolean]"===f||"[object Number]"===f||"[object String]"===f)&&i(t,l,c)}}(s),l=r?r(u):function(t){return function(e,n,r,o,i,a,s){return t(e,n,s)}}(u);return function(t){var e=t.circular,n=t.comparator,r=t.createState,o=t.equals,i=t.strict;if(r)return function(t,a){var s=r(),u=s.cache,l=void 0===u?e?new WeakMap:void 0:u,c=s.meta;return n(t,a,{cache:l,equals:o,meta:c,strict:i})};if(e)return function(t,e){return n(t,e,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(t,e){return n(t,e,a)}}({circular:n,comparator:u,createState:o,equals:l,strict:a})}Un({strict:!0}),Un({circular:!0}),Un({circular:!0,strict:!0}),Un({createInternalComparator:function(){return yn}}),Un({strict:!0,createInternalComparator:function(){return yn}}),Un({circular:!0,createInternalComparator:function(){return yn}}),Un({circular:!0,createInternalComparator:function(){return yn},strict:!0}),Event.prototype.propagationPath=function(){var t=function(){var t=this.target||null,e=[t];if(!t||!t.parentElement)return[];for(;t.parentElement;)t=t.parentElement,e.unshift(t);return e}.bind(this);return this.path||this.composedPath&&this.composedPath()||t()};class qn extends Error{}const Wn=(t,e)=>{for(let n of e){if("*"===n.path)return{route:n,vars:!1};{let e=new ln(n.path).match(t);if(e)return{route:n,vars:e}}}return null};class Rn extends p{handleClick(t){if(!t.defaultPrevented&&!t.ctrlKey)for(let e of t.propagationPath())if("A"===e.tagName){if(""!==e.target.trim())return;if(e.origin===window.location.origin){const n=e.pathname+e.search+e.hash,r=this.props.routes,o=Wn(n,r);if(o)return t.preventDefault(),void Ae(n,!0,!0,o)}}}render(){const t=[];for(let e in this.props.globals)t.push(h(this.props.globals[e],{ref:t=>t._persist(),key:e}));return h("div",{onClick:this.handleClick.bind(this)},[...t,...this.props.children])}}Rn.displayName="Mint.Root";var In=t=>class{constructor(){this.root=document.createElement("div"),document.body.appendChild(this.root),this.routes=[],this.routeInfo=null,window.addEventListener("popstate",(t=>{this.handlePopState(t)}))}resolvePagePosition(t){var e;e=()=>{requestAnimationFrame((()=>{const e=window.location.hash;if(e){let n=null;try{n=this.root.querySelector(e)||this.root.querySelector(`a[name="${e.slice(1)}"]`)}finally{}n?t&&n.scrollIntoView():console.warn(`${e} matches no element with an id and no link with a name`)}else t&&window.scrollTo(0,0)}))},"function"!=typeof window.queueMicrotask?Promise.resolve().then(e).catch((t=>setTimeout((()=>{throw t})))):window.queueMicrotask(e)}handlePopState(t){const e=window.location.pathname+window.location.search+window.location.hash,n=t?.routeInfo||Wn(e,this.routes);n&&(null!==this.routeInfo&&n.route.path===this.routeInfo.route.path&&((t,e)=>t instanceof Object?e instanceof Object&&Nn(t,e):!e instanceof Object&&t===e)(n.vars,this.routeInfo.vars)||this.runRouteHandler(n),this.resolvePagePosition(!!t?.triggerJump)),this.routeInfo=n}runRouteHandler(e){const{route:n}=e;if("*"===n.path)n.handler();else{const{vars:r}=e;try{let e=n.mapping.map(((e,o)=>{const i=r[e],a=n.decoders[o](i);if(a instanceof t.ok)return a._0;throw new qn}));n.handler.apply(null,e)}catch(t){if(t.constructor!==qn)throw t}}}render(t,e){void 0!==t&&(P(h(Rn,{routes:this.routes,globals:e},[h(t,{key:"$MAIN"})]),this.root),this.handlePopState())}addRoutes(t){this.routes=this.routes.concat(t)}};const Ln=t=>{let e=JSON.stringify(t,"",2);return void 0===e&&(e="undefined"),((t,e=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},"string"!=typeof t)throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if("number"!=typeof e)throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if("string"!=typeof n.indent)throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(0===e)return t;const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return t.replace(r,n.indent.repeat(e))})(e)};class Yn{constructor(t,e=[]){this.message=t,this.object=null,this.path=e}push(t){this.path.unshift(t)}toString(){const t=this.message.trim(),e=this.path.reduce(((t,e)=>{if(t.length)switch(e.type){case"FIELD":return`${t}.${e.value}`;case"ARRAY":return`${t}[${e.value}]`}else switch(e.type){case"FIELD":return e.value;case"ARRAY":return"[$(item.value)]"}}),"");return e.length&&this.object?t+"\n\n"+$n.trim().replace("{value}",Ln(this.object)).replace("{path}",e):t}}const $n="\nThe input is in this object:\n\n{value}\n\nat: {path}\n",Fn=t=>e=>{const{ok:n,err:r}=t;return"string"!=typeof e?new r(new Yn("\nI was trying to decode the value:\n\n{value}\n\nas a String, but could not.\n".replace("{value}",Ln(e)))):new n(e)},Hn=t=>e=>{const{ok:n,err:r}=t;let o=NaN;return o="number"==typeof e?new Date(e):Date.parse(e),Number.isNaN(o)?new r(new Yn("\nI was trying to decode the value:\n\n{value}\n\nas a Time, but could not.\n".replace("{value}",Ln(e)))):new n(new Date(o))},zn=t=>e=>{const{ok:n,err:r}=t;let o=parseFloat(e);return isNaN(o)?new r(new Yn("\nI was trying to decode the value:\n\n{value}\n\nas a Number, but could not.\n".replace("{value}",Ln(e)))):new n(o)},Bn=t=>e=>{const{ok:n,err:r}=t;return"boolean"!=typeof e?new r(new Yn("\nI was trying to decode the value:\n\n{value}\n\nas a Bool, but could not.\n".replace("{value}",Ln(e)))):new n(e)},Xn=t=>(e,n)=>{const{err:r,nothing:o}=t;return t=>{if(null==t||null==t||"object"!=typeof t||Array.isArray(t)){const n='\nI was trying to decode the field "{field}" from the object:\n\n{value}\n\nbut I could not because it\'s not an object.\n'.replace("{field}",e).replace("{value}",Ln(t));return new r(new Yn(n))}{const o=t[e],i=n(o);return i instanceof r&&(i._0.push({type:"FIELD",value:e}),i._0.object=t),i}}},Gn=t=>e=>n=>{const{ok:r,err:o}=t;if(!Array.isArray(n))return new o(new Yn("\nI was trying to decode the value:\n\n{value}\n\nas an Array, but could not.\n".replace("{value}",Ln(n))));let i=[],a=0;for(let t of n){let r=e(t);if(r instanceof o)return r._0.push({type:"ARRAY",value:a}),r._0.object=n,r;i.push(r._0),a++}return new r(i)},Qn=t=>e=>n=>{const{ok:r,just:o,nothing:i,err:a}=t;if(null==n||null==n)return new r(new i);{const t=e(n);return t instanceof a?t:new r(new o(t._0))}},Jn=t=>e=>n=>{const{ok:r,err:o}=t;if(!Array.isArray(n))return new o(new Yn("\nI was trying to decode the value:\n\n{value}\n\nas an Tuple, but could not.\n".replace("{value}",Ln(n))));let i=[],a=0;for(let t of e){if(void 0===n[a]||null===n[a])return new o(new Yn("\nI was trying to decode one of the values of a tuple:\n\n{value}\n\nbut could not.\n".replace("{value}",Ln(n[a]))));{let e=t(n[a]);if(e instanceof o)return e._0.push({type:"ARRAY",value:a}),e._0.object=n,e;i.push(e._0)}a++}return new r(i)},Vn=t=>e=>n=>{const{ok:r,err:o}=t;if(null==n||null==n||"object"!=typeof n||Array.isArray(n)){const t="\nI was trying to decode the value:\n\n{value}\n\nas a Map, but could not.\n".replace("{value}",Ln(n));return new o(new Yn(t))}{const t=[];for(let r in n){const i=e(n[r]);if(i instanceof o)return i;t.push([r,i._0])}return new r(t)}},Kn=t=>e=>new t.ok(e),Zn=t=>t,tr=t=>t.toISOString(),er=t=>e=>e.map((e=>t?t(e):e)),nr=t=>e=>{const n={};for(let r of e)n[r[0]]=t?t(r[1]):r[1];return n},rr=t=>e=>n=>n instanceof t.just?e?e(n._0):n._0:null,or=t=>e=>e.map(((e,n)=>{const r=t[n];return r?r(e):e}));var ir=t=>({maybe:rr(t),identity:Zn,tuple:or,array:er,time:tr,map:nr});class ar{constructor(){We(this)}_d(t){Re(this,t)}}class sr{constructor(){We(this),this.listeners=new Set,this.state={}}setState(t,e){this.state=Object.assign({},this.state,t);for(let t of this.listeners)t.forceUpdate();e()}_d(t){Re(this,t)}_subscribe(t){this.listeners.add(t)}_unsubscribe(t){this.listeners.delete(t)}}class ur{[Ce](t){if(!(t instanceof this.constructor))return!1;if(t.length!==this.length)return!1;for(let e=0;e{const e=(t=>({boolean:Bn(t),object:Kn(t),number:zn(t),string:Fn(t),field:Xn(t),array:Gn(t),maybe:Qn(t),tuple:Jn(t),time:Hn(t),map:Vn(t)}))(t);return{program:new(In(t)),normalizeEvent:qe,insertStyles:je,navigate:Ae,compare:Pe,update:Oe,array:Ie,style:Le,at:Ne(t),EmbeddedProgram:$e,TestContext:Fe,Component:ze,Provider:Be,Module:ar,Store:sr,Decoder:e,Encoder:ir(t),DateFNS:{format:_e,startOfMonth:wt,startOfWeek:ht,startOfDay:dt,endOfMonth:_t,endOfWeek:bt,endOfDay:yt,addMonths:st,eachDay:gt,distanceInWordsStrict:Te},Record:Record,Enum:ur,Nothing:t.nothing,Just:t.just,Err:t.err,Ok:t.ok,createRecord:Me(e,t),createPortal:Q,register:rt,createElement:h,React:{Fragment:d},ReactDOM:{unmountComponentAtNode:t=>P(null,t),render:P},Symbols:{Equals:Ce}}}}(); +var br=Object.create;var at=Object.defineProperty;var kr=Object.getOwnPropertyDescriptor;var Sr=Object.getOwnPropertyNames;var Ar=Object.getPrototypeOf,qr=Object.prototype.hasOwnProperty;var ve=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var C=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Or=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Sr(t))!qr.call(e,i)&&i!==r&&at(e,i,{get:()=>t[i],enumerable:!(n=kr(t,i))||n.enumerable});return e};var ut=(e,t,r)=>(r=e!=null?br(Ar(e)):{},Or(t||!e||!e.__esModule?at(r,"default",{value:e,enumerable:!0}):r,e));var Ht=C(()=>{});var Wt=C((Pi,et)=>{"use strict";(function(){var e,t=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);c.BUFFER_SIZE=4096,c.bin=a,c.clearBuffer=function(){e=null,t=0},c.test=function(l){return typeof l=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(l):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof et<"u"&&typeof ve=="function"?(i=i||Ht(),et.exports=c):typeof window<"u"&&(window.uuid=c),c.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(l){var _=new Uint8Array(l);return i.getRandomValues(_),Array.from(_)}:function(l){var _=new Uint8Array(l);return i.getRandomValues(_),_}}return function(l){var _,u=[];for(_=0;_c.BUFFER_SIZE)&&(t=0,e=c.randomBytes(c.BUFFER_SIZE)),e.slice(t,t+=l)}function a(){var l=o(16);return l[6]=l[6]&15|64,l[8]=l[8]&63|128,l}function c(){var l=a();return r[l[0]]+r[l[1]]+r[l[2]]+r[l[3]]+"-"+r[l[4]]+r[l[5]]+"-"+r[l[6]]+r[l[7]]+"-"+r[l[8]]+r[l[9]]+"-"+r[l[10]]+r[l[11]]+r[l[12]]+r[l[13]]+r[l[14]]+r[l[15]]}})()});var ir=C(he=>{var Ie=function(){var e=function(_,u,s,h){for(s=s||{},h=_.length;h--;s[_[h]]=u);return s},t=[1,9],r=[1,10],n=[1,11],i=[1,12],o=[5,11,12,13,14,15],a={trace:function(){},yy:{},symbols_:{error:2,root:3,expressions:4,EOF:5,expression:6,optional:7,literal:8,splat:9,param:10,"(":11,")":12,LITERAL:13,SPLAT:14,PARAM:15,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",11:"(",12:")",13:"LITERAL",14:"SPLAT",15:"PARAM"},productions_:[0,[3,2],[3,1],[4,2],[4,1],[6,1],[6,1],[6,1],[6,1],[7,3],[8,1],[9,1],[10,1]],performAction:function(u,s,h,f,p,d,m){var v=d.length-1;switch(p){case 1:return new f.Root({},[d[v-1]]);case 2:return new f.Root({},[new f.Literal({value:""})]);case 3:this.$=new f.Concat({},[d[v-1],d[v]]);break;case 4:case 5:this.$=d[v];break;case 6:this.$=new f.Literal({value:d[v]});break;case 7:this.$=new f.Splat({name:d[v]});break;case 8:this.$=new f.Param({name:d[v]});break;case 9:this.$=new f.Optional({},[d[v-1]]);break;case 10:this.$=u;break;case 11:case 12:this.$=u.slice(1);break}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[3]},{5:[1,13],6:14,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},{1:[2,2]},e(o,[2,4]),e(o,[2,5]),e(o,[2,6]),e(o,[2,7]),e(o,[2,8]),{4:15,6:4,7:5,8:6,9:7,10:8,11:t,13:r,14:n,15:i},e(o,[2,10]),e(o,[2,11]),e(o,[2,12]),{1:[2,1]},e(o,[2,3]),{6:14,7:5,8:6,9:7,10:8,11:t,12:[1,16],13:r,14:n,15:i},e(o,[2,9])],defaultActions:{3:[2,2],13:[2,1]},parseError:function(u,s){if(s.recoverable)this.trace(u);else{let f=function(p,d){this.message=p,this.hash=d};var h=f;throw f.prototype=Error,new f(u,s)}},parse:function(u){var s=this,h=[0],f=[],p=[null],d=[],m=this.table,v="",w=0,T=0,H=0,W=2,ne=1,J=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var D in this.yy)Object.prototype.hasOwnProperty.call(this.yy,D)&&(E.yy[D]=this.yy[D]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var $e=x.yylloc;d.push($e);var xr=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Hn(R){h.length=h.length-2*R,p.length=p.length-R,d.length=d.length-R}for(var Er=function(){var R;return R=x.lex()||ne,typeof R!="number"&&(R=s.symbols_[R]||R),R},S,je,G,O,Wn,Me,X={},de,M,st,ye;;){if(G=h[h.length-1],this.defaultActions[G]?O=this.defaultActions[G]:((S===null||typeof S>"u")&&(S=Er()),O=m[G]&&m[G][S]),typeof O>"u"||!O.length||!O[0]){var De="";ye=[];for(de in m[G])this.terminals_[de]&&de>W&&ye.push("'"+this.terminals_[de]+"'");x.showPosition?De="Parse error on line "+(w+1)+`: +`+x.showPosition()+` +Expecting `+ye.join(", ")+", got '"+(this.terminals_[S]||S)+"'":De="Parse error on line "+(w+1)+": Unexpected "+(S==ne?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(De,{text:x.match,token:this.terminals_[S]||S,line:x.yylineno,loc:$e,expected:ye})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+S);switch(O[0]){case 1:h.push(S),p.push(x.yytext),d.push(x.yylloc),h.push(O[1]),S=null,je?(S=je,je=null):(T=x.yyleng,v=x.yytext,w=x.yylineno,$e=x.yylloc,H>0&&H--);break;case 2:if(M=this.productions_[O[1]][1],X.$=p[p.length-M],X._$={first_line:d[d.length-(M||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(M||1)].first_column,last_column:d[d.length-1].last_column},xr&&(X._$.range=[d[d.length-(M||1)].range[0],d[d.length-1].range[1]]),Me=this.performAction.apply(X,[v,T,w,E.yy,O[1],p,d].concat(J)),typeof Me<"u")return Me;M&&(h=h.slice(0,-1*M*2),p=p.slice(0,-1*M),d=d.slice(0,-1*M)),h.push(this.productions_[O[1]][0]),p.push(X.$),d.push(X._$),st=m[h[h.length-2]][h[h.length-1]],h.push(st);break;case 3:return!0}}return!0}},c=function(){var _={EOF:1,parseError:function(s,h){if(this.yy.parser)this.yy.parser.parseError(s,h);else throw new Error(s)},setInput:function(u,s){return this.yy=s||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var s=u.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var s=u.length,h=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),h.length-1&&(this.yylineno-=h.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:h?(h.length===f.length?this.yylloc.first_column:0)+f[f.length-h.length].length-h[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(u){this.unput(this.match.slice(u))},pastInput:function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var u=this.pastInput(),s=new Array(u.length+1).join("-");return u+this.upcomingInput()+` +`+s+"^"},test_match:function(u,s){var h,f,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),f=u[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],h=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),h)return h;if(this._backtrack){for(var d in p)this[d]=p[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,s,h,f;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),d=0;ds[0].length)){if(s=h,f=d,this.options.backtrack_lexer){if(u=this.test_match(h,p[d]),u!==!1)return u;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(u=this.test_match(s,p[f]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,h,f,p){var d=p;switch(f){case 0:return"(";case 1:return")";case 2:return"SPLAT";case 3:return"PARAM";case 4:return"LITERAL";case 5:return"LITERAL";case 6:return"EOF"}},rules:[/^(?:\()/,/^(?:\))/,/^(?:\*+\w+)/,/^(?::+\w+)/,/^(?:[\w%\-~\n]+)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return _}();a.lexer=c;function l(){this.yy={}}return l.prototype=a,a.Parser=l,new l}();typeof ve<"u"&&typeof he<"u"&&(he.parser=Ie,he.Parser=Ie.Parser,he.parse=function(){return Ie.parse.apply(Ie,arguments)})});var rt=C((vo,or)=>{"use strict";function re(e){return function(t,r){return{displayName:e,props:t,children:r||[]}}}or.exports={Root:re("Root"),Concat:re("Concat"),Literal:re("Literal"),Splat:re("Splat"),Param:re("Param"),Optional:re("Optional")}});var ur=C((mo,ar)=>{"use strict";var sr=ir().parser;sr.yy=rt();ar.exports=sr});var nt=C((go,lr)=>{"use strict";var On=Object.keys(rt());function Tn(e){return On.forEach(function(t){if(typeof e[t]>"u")throw new Error("No handler defined for "+t.displayName)}),{visit:function(t,r){return this.handlers[t.displayName].call(this,t,r)},handlers:e}}lr.exports=Tn});var _r=C((wo,fr)=>{"use strict";var Pn=nt(),Rn=/[\-{}\[\]+?.,\\\^$|#\s]/g;function cr(e){this.captures=e.captures,this.re=e.re}cr.prototype.match=function(e){var t=this.re.exec(e),r={};return t?(this.captures.forEach(function(n,i){typeof t[i+1]>"u"?r[n]=void 0:r[n]=decodeURIComponent(t[i+1])}),r):!1};var Cn=Pn({Concat:function(e){return e.children.reduce(function(t,r){var n=this.visit(r);return{re:t.re+n.re,captures:t.captures.concat(n.captures)}}.bind(this),{re:"",captures:[]})},Literal:function(e){return{re:e.props.value.replace(Rn,"\\$&"),captures:[]}},Splat:function(e){return{re:"([^?#]*?)",captures:[e.props.name]}},Param:function(e){return{re:"([^\\/\\?#]+)",captures:[e.props.name]}},Optional:function(e){var t=this.visit(e.children[0]);return{re:"(?:"+t.re+")?",captures:t.captures}},Root:function(e){var t=this.visit(e.children[0]);return new cr({re:new RegExp("^"+t.re+"(?=\\?|#|$)"),captures:t.captures})}});fr.exports=Cn});var pr=C((xo,hr)=>{"use strict";var In=nt(),Nn=In({Concat:function(e,t){var r=e.children.map(function(n){return this.visit(n,t)}.bind(this));return r.some(function(n){return n===!1})?!1:r.join("")},Literal:function(e){return decodeURI(e.props.value)},Splat:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Param:function(e,t){return typeof t[e.props.name]>"u"?!1:t[e.props.name]},Optional:function(e,t){var r=this.visit(e.children[0],t);return r||""},Root:function(e,t){t=t||{};var r=this.visit(e.children[0],t);return r===!1||typeof r>"u"?!1:encodeURI(r)}});hr.exports=Nn});var yr=C((Eo,dr)=>{"use strict";var $n=ur(),jn=_r(),Mn=pr();function pe(e){var t;if(this?t=this:t=Object.create(pe.prototype),typeof e>"u")throw new Error("A route spec is required");return t.spec=e,t.ast=$n.parse(e),t}pe.prototype=Object.create(null);pe.prototype.match=function(e){var t=jn.visit(this.ast),r=t.match(e);return r!==null?r:!1};pe.prototype.reverse=function(e){return Mn.visit(this.ast,e)};dr.exports=pe});var mr=C((bo,vr)=>{"use strict";var Dn=yr();vr.exports=Dn});var xe,y,pt,Ve,K,lt,dt,Ue,Tr,ie={},yt=[],Pr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Be=Array.isArray;function U(e,t){for(var r in t)e[r]=t[r];return e}function vt(e){var t=e.parentNode;t&&t.removeChild(e)}function I(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?xe.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return ge(e,a,n,i,null)}function ge(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++pt,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function mt(){return{current:null}}function oe(e){return e.children}function L(e,t){this.props=e,this.context=t}function Z(e,t){if(t==null)return e.__?Z(e.__,e.__i+1):null;for(var r;tt&&K.sort(Ue));we.__r=0}function wt(e,t,r,n,i,o,a,c,l,_,u){var s,h,f,p,d,m=n&&n.__k||yt,v=t.length;for(r.__d=l,Rr(r,t,m),l=r.__d,s=0;s0?ge(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,c=Cr(i,r,a=n+s,u),i.__i=c,o=null,c!==-1&&(u--,(o=r[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):c!==a&&(c===a+1?s++:c>a?u>l-a?s+=c-a:s--:s=c(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||c=0){if((l=t[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a--}if(c=r.__.length&&r.__.push({__V:Ee}),r.__[e]}function Y(e,t){var r=Rt(ke++,3);!y.__s&&Ct(r.__H,t)&&(r.__=e,r.i=t,A.__H.__h.push(r))}function ae(e){return Ge=5,N(function(){return{current:e}},[])}function N(e,t){var r=Rt(ke++,7);return Ct(r.__H,t)?(r.__V=e(),r.i=t,r.__h=e,r.__V):r.__}function $r(){for(var e;e=Pt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(be),e.__H.__h.forEach(Ke),e.__H.__h=[]}catch(t){e.__H.__h=[],y.__e(t,e.__v)}}y.__b=function(e){A=null,kt&&kt(e)},y.__r=function(e){St&&St(e),ke=0;var t=(A=e.__c).__H;t&&(We===A?(t.__h=[],A.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Ee,r.__N=r.i=void 0})):(t.__h.forEach(be),t.__h.forEach(Ke),t.__h=[],ke=0)),We=A},y.diffed=function(e){At&&At(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pt.push(t)!==1&&bt===y.requestAnimationFrame||((bt=y.requestAnimationFrame)||jr)($r)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Ee&&(r.__=r.__V),r.i=void 0,r.__V=Ee})),We=A=null},y.__c=function(e,t){t.some(function(r){try{r.__h.forEach(be),r.__h=r.__h.filter(function(n){return!n.__||Ke(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],y.__e(n,r.__v)}}),qt&&qt(e,t)},y.unmount=function(e){Ot&&Ot(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{be(n)}catch(i){t=i}}),r.__H=void 0,t&&y.__e(t,r.__v))};var Tt=typeof requestAnimationFrame=="function";function jr(e){var t,r=function(){clearTimeout(n),Tt&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Tt&&(t=requestAnimationFrame(r))}function be(e){var t=A,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),A=t}function Ke(e){var t=A;e.__c=e.__(),A=t}function Ct(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ae(){throw new Error("Cycle detected")}var Mr=Symbol.for("preact-signals");function qe(){if(V>1)V--;else{for(var e,t=!1;ue!==void 0;){var r=ue;for(ue=void 0,ze++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&$t(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(ze=0,V--,t)throw e}}function It(e){if(V>0)return e();V++;try{return e()}finally{qe()}}var g=void 0,Ye=0;function Oe(e){if(Ye>0)return e();var t=g;g=void 0,Ye++;try{return e()}finally{Ye--,g=t}}var ue=void 0,V=0,ze=0,Se=0;function Nt(e){if(g!==void 0){var t=e.n;if(t===void 0||t.t!==g)return t={i:0,S:e,p:g.s,n:void 0,t:g,e:void 0,x:void 0,r:t},g.s!==void 0&&(g.s.n=t),g.s=t,e.n=t,32&g.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=g.s,t.n=void 0,g.s.n=t,g.s=t),t}}function b(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}b.prototype.brand=Mr;b.prototype.h=function(){return!0};b.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};b.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};b.prototype.subscribe=function(e){var t=this;return Q(function(){var r=t.value,n=32&this.f;this.f&=-33;try{e(r)}finally{this.f|=n}})};b.prototype.valueOf=function(){return this.value};b.prototype.toString=function(){return this.value+""};b.prototype.toJSON=function(){return this.value};b.prototype.peek=function(){return this.v};Object.defineProperty(b.prototype,"value",{get:function(){var e=Nt(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(g instanceof B&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){ze>100&&Ae(),this.v=e,this.i++,Se++,V++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{qe()}}}});function $(e){return new b(e)}function $t(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function jt(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Mt(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function B(e){b.call(this,void 0),this.x=e,this.s=void 0,this.g=Se-1,this.f=4}(B.prototype=new b).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Se))return!0;if(this.g=Se,this.f|=1,this.i>0&&!$t(this))return this.f&=-2,!0;var e=g;try{jt(this),g=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return g=e,Mt(this),this.f&=-2,!0};B.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}b.prototype.S.call(this,e)};B.prototype.U=function(e){if(this.t!==void 0&&(b.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};B.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};B.prototype.peek=function(){if(this.h()||Ae(),16&this.f)throw this.v;return this.v};Object.defineProperty(B.prototype,"value",{get:function(){1&this.f&&Ae();var e=Nt(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function le(e){return new B(e)}function Dt(e){var t=e.u;if(e.u=void 0,typeof t=="function"){V++;var r=g;g=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Je(e),n}finally{g=r,qe()}}}function Je(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Dt(e)}function Dr(e){if(g!==this)throw new Error("Out-of-order effect");Mt(this),g=e,this.f&=-2,8&this.f&&Je(this),qe()}function ce(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ce.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};ce.prototype.S=function(){1&this.f&&Ae(),this.f|=1,this.f&=-9,Dt(this),jt(this),V++;var e=g;return g=this,Dr.bind(this,e)};ce.prototype.N=function(){2&this.f||(this.f|=2,this.o=ue,ue=this)};ce.prototype.d=function(){this.f|=8,1&this.f||Je(this)};function Q(e){var t=new ce(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Pe,Xe;function ee(e,t){y[e]=t.bind(null,y[e]||function(){})}function Te(e){Xe&&Xe(),Xe=e&&e.S()}function Ut(e){var t=this,r=e.data,n=Lr(r);n.value=r;var i=N(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var a;!Ve(i.peek())&&((a=t.base)==null?void 0:a.nodeType)===3?t.base.data=i.peek():(t.__$f|=1,t.setState({}))},le(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Ut.displayName="_st";Object.defineProperties(b.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ut},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});ee("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof b&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});ee("__r",function(e,t){Te();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return Q(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Pe=n,Te(r),e(t)});ee("__e",function(e,t,r,n){Te(),Pe=void 0,e(t,r,n)});ee("diffed",function(e,t){Te(),Pe=void 0;var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var c=o[a];c!==void 0&&!(a in n)&&(c.d(),o[a]=void 0)}else r.U=o={};for(var l in n){var _=o[l],u=n[l];_===void 0?(_=Ur(r,l,u,i),o[l]=_):_.o(u,i)}}}e(t)});function Ur(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=$(r);return{o:function(a,c){o.value=a,n=c},d:Q(function(){var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}ee("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}e(t)});ee("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});L.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in t)return!0;for(var i in e)if(i!=="__source"&&e[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};function Lr(e){return N(function(){return $(e)},[])}function Vr(e){var t=ae(e);return t.current=e,Pe.__$f|=4,N(function(){return le(function(){return t.current()})},[])}var k=Symbol("Equals");Boolean.prototype[k]=Symbol.prototype[k]=Number.prototype[k]=String.prototype[k]=function(e){return this.valueOf()===e};Date.prototype[k]=function(e){return+this==+e};Function.prototype[k]=Node.prototype[k]=function(e){return this===e};URLSearchParams.prototype[k]=function(e){return e==null?!1:this.toString()===e.toString()};Set.prototype[k]=function(e){return e==null?!1:q(Array.from(this).sort(),Array.from(e).sort())};Array.prototype[k]=function(e){if(e==null||this.length!==e.length)return!1;if(this.length==0)return!0;for(let t in this)if(!q(this[t],e[t]))return!1;return!0};FormData.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(e.keys()).sort(),r=Array.from(this.keys()).sort();if(q(r,t)){if(r.length==0)return!0;for(let n of r){let i=Array.from(e.getAll(n).sort()),o=Array.from(this.getAll(n).sort());if(!q(o,i))return!1}return!0}else return!1};Map.prototype[k]=function(e){if(e==null)return!1;let t=Array.from(this.keys()).sort(),r=Array.from(e.keys()).sort();if(q(t,r)){if(t.length==0)return!0;for(let n of t)if(!q(this.get(n),e.get(n)))return!1;return!0}else return!1};var Lt=e=>typeof e=="object"&&"constructor"in e&&"props"in e&&"type"in e&&"ref"in e&&"key"in e&&"__"in e,q=(e,t)=>e===void 0&&t===void 0||e===null&&t===null?!0:e!=null&&e!=null&&e[k]?e[k](t):t!=null&&t!=null&&t[k]?t[k](e):Lt(e)||Lt(t)?e===t:Ze(e,t),Ze=(e,t)=>{if(e instanceof Object&&t instanceof Object){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;let i=new Set(r.concat(n));for(let o of i)if(!q(e[o],t[o]))return!1;return!0}else return e===t};var fe=class{constructor(t){this.patterns=t}},Re=class{constructor(t,r){this.pattern=r,this.variant=t}},ii=(e,t)=>new Re(e,t),oi=e=>new fe(e),Br=Symbol("Variable"),Qe=Symbol("Spread"),z=(e,t,r=[])=>{if(t!==null){if(t===Br)r.push(e);else if(Array.isArray(t))if(t.some(i=>i===Qe)&&e.length>=t.length-1){let i=0,o=[],a=1;for(;t[i]!==Qe&&i{for(let r of t){if(r[0]===null)return r[1]();{let n=z(e,r[0]);if(n)return r[1].apply(null,n)}}};"DataTransfer"in window||(window.DataTransfer=class{constructor(){this.effectAllowed="none",this.dropEffect="none",this.files=[],this.types=[],this.cache={}}getData(e){return this.cache[e]||""}setData(e,t){return this.cache[e]=t,null}clearData(){return this.cache={},null}});var Fr=e=>new Proxy(e,{get:function(t,r){if(r==="event")return e;if(r in t){let n=t[r];return n instanceof Function?()=>t[r]():n}else switch(r){case"clipboardData":return t.clipboardData=new DataTransfer;case"dataTransfer":return t.dataTransfer=new DataTransfer;case"data":return"";case"altKey":return!1;case"charCode":return-1;case"ctrlKey":return!1;case"key":return"";case"keyCode":return-1;case"locale":return"";case"location":return-1;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return-1;case"button":return-1;case"buttons":return-1;case"clientX":return-1;case"clientY":return-1;case"pageX":return-1;case"pageY":return-1;case"screenX":return-1;case"screenY":return-1;case"detail":return-1;case"deltaMode":return-1;case"deltaX":return-1;case"deltaY":return-1;case"deltaZ":return-1;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return-1;case"propertyName":return"";default:return}}});y.event=Fr;var pi=(e,t,r,n)=>e.length>=t+1&&t>=0?new r(e[t]):new n,di=(e,t)=>r=>{e.current._0!==r&&(e.current=new t(r))},yi=e=>{let t=N(()=>$(e),[]);return t.value,t},vi=e=>{let t=mt();return t.current=e,t},mi=e=>{let t=ae(!1);Y(()=>{t.current?e():t.current=!0})},gi=(e,t)=>e??t,wi=(...e)=>{let t=Array.from(e);return Array.isArray(t[0])&&t.length===1?t[0]:t},xi=e=>t=>t[e],Bt=e=>e,Vt=class extends L{async componentDidMount(){let t=await this.props.x();this.setState({x:t})}render(){return this.state.x?I(this.state.x,this.props.p,this.props.c):null}},Ei=e=>async()=>Hr(e),Hr=async e=>(await import(e)).default;var Wr=$({}),Ft=$({}),Si=e=>Ft.value=e,Ai=e=>(Wr.value[Ft.value]||{})[e]||"";var Gt=ut(Wt()),$i=(e,t)=>(r,n)=>{let i=()=>{e.has(r)&&(e.delete(r),Oe(t))};Y(()=>i,[]),Y(()=>{let o=n();if(o===null)i();else{let a=e.get(r);q(a,o)||(e.set(r,o),Oe(t))}})},ji=e=>Array.from(e.values()),Mi=()=>N(Gt.default,[]);function tt(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:i=!1}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(t===0)return e;let o=i?/^/gm:/^(?!\s*$)/gm;return e.replace(o,n.repeat(t))}var j=e=>{let t=JSON.stringify(e,"",2);return typeof t>"u"&&(t="undefined"),tt(t)},P=class{constructor(t,r=[]){this.message=t,this.object=null,this.path=r}push(t){this.path.unshift(t)}toString(){let t=this.message.trim(),r=this.path.reduce((n,i)=>{if(n.length)switch(i.type){case"FIELD":return`${n}.${i.value}`;case"ARRAY":return`${n}[${i.value}]`}else switch(i.type){case"FIELD":return i.value;case"ARRAY":return"[$(item.value)]"}},"");return r.length&&this.object?t+` + +`+Gr.trim().replace("{value}",j(this.object)).replace("{path}",r):t}},Gr=` +The input is in this object: + +{value} + +at: {path} +`,Kr=` +I was trying to decode the value: + +{value} + +as a String, but could not. +`,Yr=` +I was trying to decode the value: + +{value} + +as a Time, but could not. +`,zr=` +I was trying to decode the value: + +{value} + +as a Number, but could not. +`,Jr=` +I was trying to decode the value: + +{value} + +as a Bool, but could not. +`,Xr=` +I was trying to decode the field "{field}" from the object: + +{value} + +but I could not because it's not an object. +`,Zr=` +I was trying to decode the value: + +{value} + +as an Array, but could not. +`,Qr=` +I was trying to decode the value: + +{value} + +as an Tuple, but could not. +`,en=` +I was trying to decode one of the values of a tuple: + +{value} + +but could not. +`,tn=` +I was trying to decode the value: + +{value} + +as a Map, but could not. +`,Vi=(e,t)=>r=>typeof r!="string"?new t(new P(Kr.replace("{value}",j(r)))):new e(r),Bi=(e,t)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new t(new P(Yr.replace("{value}",j(r)))):new e(new Date(n))},Fi=(e,t)=>r=>{let n=parseFloat(r);return isNaN(n)?new t(new P(zr.replace("{value}",j(r)))):new e(n)},Hi=(e,t)=>r=>typeof r!="boolean"?new t(new P(Jr.replace("{value}",j(r)))):new e(r),rn=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=Xr.replace("{field}",e).replace("{value}",j(n));return new r(new P(i))}else{let i=t(n[e]);return i instanceof r&&(i._0.push({type:"FIELD",value:e}),i._0.object=n),i}},Wi=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new P(Zr.replace("{value}",j(n))));let i=[],o=0;for(let a of n){let c=e(a);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0),o++}return new t(i)},Gi=(e,t,r,n,i)=>o=>{if(o==null)return new t(new i);{let a=e(o);return a instanceof r?a:new t(new n(a._0))}},Ki=(e,t,r)=>n=>{if(!Array.isArray(n))return new r(new P(Qr.replace("{value}",j(n))));let i=[],o=0;for(let a of e){if(n[o]===void 0||n[o]===null)return new r(new P(en.replace("{value}",j(n[o]))));{let c=a(n[o]);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0)}o++}return new t(i)},Yi=(e,t,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=tn.replace("{value}",j(n));return new r(new P(i))}else{let i=[];for(let o in n){let a=e(n[o]);if(a instanceof r)return a;i.push([o,a._0])}return new t(i)}},zi=(e,t,r)=>n=>{let i={};for(let o in e){let a=e[o];Array.isArray(a)&&(a=e[o][0],o=e[o][1]);let c=rn(o,a,r)(n);if(c instanceof r)return c;i[o]=c._0}return new t(i)},Ji=e=>t=>new e(t);var Qi=e=>e.toISOString(),eo=e=>t=>t.map(r=>e?e(r):r),to=e=>t=>{let r={};for(let n of t)r[n[0]]=e?e(n[1]):n[1];return r},ro=(e,t)=>r=>r instanceof t?e(r._0):null,no=e=>t=>t.map((r,n)=>{let i=e[n];return i?i(r):r}),io=e=>t=>{let r={};for(let n in e){let i=e[n],o=n;Array.isArray(i)&&(i=e[n][0],o=e[n][1]),r[o]=(i||Bt)(t[n])}return r};var nn=Object.getOwnPropertyNames,on=Object.getOwnPropertySymbols,sn=Object.prototype.hasOwnProperty;function Kt(e,t){return function(n,i,o){return e(n,i,o)&&t(n,i,o)}}function Ce(e){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return e(r,n,i);var o=i.cache,a=o.get(r),c=o.get(n);if(a&&c)return a===n&&c===r;o.set(r,n),o.set(n,r);var l=e(r,n,i);return o.delete(r),o.delete(n),l}}function Yt(e){return nn(e).concat(on(e))}var tr=Object.hasOwn||function(e,t){return sn.call(e,t)};function te(e,t){return e||t?e===t:e===t||e!==e&&t!==t}var rr="_owner",zt=Object.getOwnPropertyDescriptor,Jt=Object.keys;function an(e,t,r){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function un(e,t){return te(e.getTime(),t.getTime())}function Xt(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.entries(),o=0,a,c;(a=i.next())&&!a.done;){for(var l=t.entries(),_=!1,u=0;(c=l.next())&&!c.done;){var s=a.value,h=s[0],f=s[1],p=c.value,d=p[0],m=p[1];!_&&!n[u]&&(_=r.equals(h,d,o,u,e,t,r)&&r.equals(f,m,h,d,e,t,r))&&(n[u]=!0),u++}if(!_)return!1;o++}return!0}function ln(e,t,r){var n=Jt(e),i=n.length;if(Jt(t).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===rr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!tr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r))return!1;return!0}function _e(e,t,r){var n=Yt(e),i=n.length;if(Yt(t).length!==i)return!1;for(var o,a,c;i-- >0;)if(o=n[i],o===rr&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!tr(t,o)||!r.equals(e[o],t[o],o,o,e,t,r)||(a=zt(e,o),c=zt(t,o),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function cn(e,t){return te(e.valueOf(),t.valueOf())}function fn(e,t){return e.source===t.source&&e.flags===t.flags}function Zt(e,t,r){if(e.size!==t.size)return!1;for(var n={},i=e.values(),o,a;(o=i.next())&&!o.done;){for(var c=t.values(),l=!1,_=0;(a=c.next())&&!a.done;)!l&&!n[_]&&(l=r.equals(o.value,a.value,o.value,a.value,e,t,r))&&(n[_]=!0),_++;if(!l)return!1}return!0}function _n(e,t){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}var hn="[object Arguments]",pn="[object Boolean]",dn="[object Date]",yn="[object Map]",vn="[object Number]",mn="[object Object]",gn="[object RegExp]",wn="[object Set]",xn="[object String]",En=Array.isArray,Qt=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,er=Object.assign,bn=Object.prototype.toString.call.bind(Object.prototype.toString);function kn(e){var t=e.areArraysEqual,r=e.areDatesEqual,n=e.areMapsEqual,i=e.areObjectsEqual,o=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,c=e.areSetsEqual,l=e.areTypedArraysEqual;return function(u,s,h){if(u===s)return!0;if(u==null||s==null||typeof u!="object"||typeof s!="object")return u!==u&&s!==s;var f=u.constructor;if(f!==s.constructor)return!1;if(f===Object)return i(u,s,h);if(En(u))return t(u,s,h);if(Qt!=null&&Qt(u))return l(u,s,h);if(f===Date)return r(u,s,h);if(f===RegExp)return a(u,s,h);if(f===Map)return n(u,s,h);if(f===Set)return c(u,s,h);var p=bn(u);return p===dn?r(u,s,h):p===gn?a(u,s,h):p===yn?n(u,s,h):p===wn?c(u,s,h):p===mn?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,h):p===hn?i(u,s,h):p===pn||p===vn||p===xn?o(u,s,h):!1}}function Sn(e){var t=e.circular,r=e.createCustomConfig,n=e.strict,i={areArraysEqual:n?_e:an,areDatesEqual:un,areMapsEqual:n?Kt(Xt,_e):Xt,areObjectsEqual:n?_e:ln,arePrimitiveWrappersEqual:cn,areRegExpsEqual:fn,areSetsEqual:n?Kt(Zt,_e):Zt,areTypedArraysEqual:n?_e:_n};if(r&&(i=er({},i,r(i))),t){var o=Ce(i.areArraysEqual),a=Ce(i.areMapsEqual),c=Ce(i.areObjectsEqual),l=Ce(i.areSetsEqual);i=er({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:c,areSetsEqual:l})}return i}function An(e){return function(t,r,n,i,o,a,c){return e(t,r,c)}}function qn(e){var t=e.circular,r=e.comparator,n=e.createState,i=e.equals,o=e.strict;if(n)return function(l,_){var u=n(),s=u.cache,h=s===void 0?t?new WeakMap:void 0:s,f=u.meta;return r(l,_,{cache:h,equals:i,meta:f,strict:o})};if(t)return function(l,_){return r(l,_,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,_){return r(l,_,a)}}var nr=F(),so=F({strict:!0}),ao=F({circular:!0}),uo=F({circular:!0,strict:!0}),lo=F({createInternalComparator:function(){return te}}),co=F({strict:!0,createInternalComparator:function(){return te}}),fo=F({circular:!0,createInternalComparator:function(){return te}}),_o=F({circular:!0,createInternalComparator:function(){return te},strict:!0});function F(e){e===void 0&&(e={});var t=e.circular,r=t===void 0?!1:t,n=e.createInternalComparator,i=e.createState,o=e.strict,a=o===void 0?!1:o,c=Sn(e),l=kn(c),_=n?n(l):An(l);return qn({circular:r,comparator:l,createState:i,equals:_,strict:a})}var wr=ut(mr());var Ne=class extends Error{},Un=(e,t)=>e instanceof Object?t instanceof Object&&nr(e,t):!(t instanceof Object)&&e===t,Ln=e=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t})):window.queueMicrotask(e)},gr=(e,t)=>{for(let r of t){if(r.path==="*")return{route:r,vars:!1,url:e};{let n=new wr.default(r.path).match(e);if(n)return{route:r,vars:n,url:e}}}return null},it=class{constructor(t,r){this.root=document.createElement("div"),this.routeInfo=null,this.routes=r,this.ok=t,document.body.appendChild(this.root),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleClick(t){if(!t.defaultPrevented&&!t.ctrlKey){for(let r of t.composedPath())if(r.tagName==="A"){if(r.target.trim()!=="")return;if(r.origin===window.location.origin){let n=r.pathname+r.search+r.hash,i=gr(n,this.routes);if(i){t.preventDefault(),Vn(n,!0,!0,i);return}}}}}resolvePagePosition(t){Ln(()=>{requestAnimationFrame(()=>{let r=window.location.hash;if(r){let n=null;try{n=this.root.querySelector(r)||this.root.querySelector(`a[name="${r.slice(1)}"]`)}catch{}n?t&&n.scrollIntoView():console.warn(`MINT: ${r} matches no element with an id and no link with a name`)}else t&&window.scrollTo(0,0)})})}handlePopState(t){let r=window.location.pathname+window.location.search+window.location.hash,n=t?.routeInfo||gr(r,this.routes);n&&((this.routeInfo===null||n.url!==this.routeInfo.url||!Un(n.vars,this.routeInfo.vars))&&this.runRouteHandler(n),this.resolvePagePosition(!!t?.triggerJump)),this.routeInfo=n}runRouteHandler(t){let{route:r}=t;if(r.path==="*")r.handler();else{let{vars:n}=t;try{let i=r.mapping.map((o,a)=>{let c=n[o],l=r.decoders[a](c);if(l instanceof this.ok)return l._0;throw new Ne});r.handler.apply(null,i)}catch(i){if(i.constructor!==Ne)throw i}}}render(t,r){if(typeof t<"u"){let n=[];for(let i in r)n.push(I(r[i],{key:i}));se([...n,I(t,{key:"MINT_MAIN"})],this.root),this.handlePopState()}}},Vn=(e,t=!0,r=!0,n=null)=>{let i=window.location.pathname,o=window.location.search,a=window.location.hash;if(i+o+a!==e&&(t?window.history.pushState({},"",e):window.history.replaceState({},"",e)),t){let l=new PopStateEvent("popstate");l.triggerJump=r,l.routeInfo=n,dispatchEvent(l)}},Ao=(e,t,r,n=[])=>{new it(r,n).render(e,t)};function Bn(e){return this.getChildContext=()=>e.context,e.children}function Fn(e){let t=this,r=e._container;t.componentWillUnmount=function(){se(null,t._temp),t._temp=null,t._container=null},t._container&&t._container!==r&&t.componentWillUnmount(),t._temp||(t._container=r,t._temp={nodeType:1,parentNode:r,childNodes:[],appendChild(n){this.childNodes.push(n),t._container.appendChild(n)},insertBefore(n,i){this.childNodes.push(n),t._container.appendChild(n)},removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),t._container.removeChild(n)}}),se(I(Bn,{context:t.context},e._vnode),t._temp)}function To(e,t){let r=I(Fn,{_vnode:e,_container:t});return r.containerInfo=t,r}var ot=class{[k](t){if(!(t instanceof this.constructor)||t.length!==this.length)return!1;if(this.record)return Ze(this,t);for(let r=0;rclass extends ot{constructor(...t){if(super(),Array.isArray(e)){this.length=e.length,this.record=!0;for(let r=0;r(...t)=>new e(...t);var jo=e=>{let t=document.createElement("style");document.head.appendChild(t),t.innerHTML=e},Mo=e=>{let t={},r=(n,i)=>{t[n.toString().trim()]=i.toString().trim()};for(let n of e)if(typeof n=="string")n.split(";").forEach(i=>{let[o,a]=i.split(":");o&&a&&r(o,a)});else if(n instanceof Map||n instanceof Array)for(let[i,o]of n)r(i,o);else for(let i in n)r(i,n[i]);return t};var export_uuid=Gt.default;export{k as Equals,P as Error,xi as access,pi as arrayAccess,It as batch,q as compare,Ze as compareObjects,le as computed,I as createElement,To as createPortal,$i as createProvider,vi as createRef,Wi as decodeArray,Hi as decodeBoolean,rn as decodeField,Yi as decodeMap,Gi as decodeMaybe,Fi as decodeNumber,Ji as decodeObject,Vi as decodeString,Bi as decodeTime,Ki as decodeTuple,zi as decoder,z as destructure,Q as effect,eo as encodeArray,to as encodeMap,ro as encodeMaybe,Qi as encodeTime,no as encodeTuple,io as encoder,oe as fragment,Bt as identity,jo as insertStyles,Ei as lazy,Vt as lazyComponent,Hr as load,Ft as locale,si as match,Vn as navigate,Io as newVariant,Fr as normalizeEvent,gi as or,ii as pattern,oi as patternRecord,Qe as patternSpread,Br as patternVariable,Ao as program,Si as setLocale,di as setRef,$ as signal,Mo as style,ji as subscriptions,wi as toArray,Ai as translate,Wr as translations,Vr as useComputed,mi as useDidUpdate,Y as useEffect,Mi as useId,N as useMemo,ae as useRef,yi as useSignal,export_uuid as uuid,Co as variant}; diff --git a/src/assets/runtime_test.js b/src/assets/runtime_test.js new file mode 100644 index 000000000..cbbe65d4d --- /dev/null +++ b/src/assets/runtime_test.js @@ -0,0 +1,68 @@ +var Sr=Object.create;var lt=Object.defineProperty;var Ar=Object.getOwnPropertyDescriptor;var qr=Object.getOwnPropertyNames;var Or=Object.getPrototypeOf,Tr=Object.prototype.hasOwnProperty;var me=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var C=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Pr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of qr(e))!Tr.call(t,i)&&i!==r&<(t,i,{get:()=>e[i],enumerable:!(n=Ar(e,i))||n.enumerable});return t};var ct=(t,e,r)=>(r=t!=null?Sr(Or(t)):{},Pr(e||!t||!t.__esModule?lt(r,"default",{value:t,enumerable:!0}):r,t));var Gt=C(()=>{});var Kt=C((Di,rt)=>{"use strict";(function(){var t,e=0,r=[],n;for(n=0;n<256;n++)r[n]=(n+256).toString(16).substr(1);c.BUFFER_SIZE=4096,c.bin=a,c.clearBuffer=function(){t=null,e=0},c.test=function(l){return typeof l=="string"?/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(l):!1};var i;typeof crypto<"u"?i=crypto:typeof window<"u"&&typeof window.msCrypto<"u"&&(i=window.msCrypto),typeof rt<"u"&&typeof me=="function"?(i=i||Gt(),rt.exports=c):typeof window<"u"&&(window.uuid=c),c.randomBytes=function(){if(i){if(i.randomBytes)return i.randomBytes;if(i.getRandomValues)return typeof Uint8Array.prototype.slice!="function"?function(l){var h=new Uint8Array(l);return i.getRandomValues(h),Array.from(h)}:function(l){var h=new Uint8Array(l);return i.getRandomValues(h),h}}return function(l){var h,u=[];for(h=0;hc.BUFFER_SIZE)&&(e=0,t=c.randomBytes(c.BUFFER_SIZE)),t.slice(e,e+=l)}function a(){var l=o(16);return l[6]=l[6]&15|64,l[8]=l[8]&63|128,l}function c(){var l=a();return r[l[0]]+r[l[1]]+r[l[2]]+r[l[3]]+"-"+r[l[4]]+r[l[5]]+"-"+r[l[6]]+r[l[7]]+"-"+r[l[8]]+r[l[9]]+"-"+r[l[10]]+r[l[11]]+r[l[12]]+r[l[13]]+r[l[14]]+r[l[15]]}})()});var sr=C(pe=>{var Ne=function(){var t=function(h,u,s,_){for(s=s||{},_=h.length;_--;s[h[_]]=u);return s},e=[1,9],r=[1,10],n=[1,11],i=[1,12],o=[5,11,12,13,14,15],a={trace:function(){},yy:{},symbols_:{error:2,root:3,expressions:4,EOF:5,expression:6,optional:7,literal:8,splat:9,param:10,"(":11,")":12,LITERAL:13,SPLAT:14,PARAM:15,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",11:"(",12:")",13:"LITERAL",14:"SPLAT",15:"PARAM"},productions_:[0,[3,2],[3,1],[4,2],[4,1],[6,1],[6,1],[6,1],[6,1],[7,3],[8,1],[9,1],[10,1]],performAction:function(u,s,_,f,p,d,m){var v=d.length-1;switch(p){case 1:return new f.Root({},[d[v-1]]);case 2:return new f.Root({},[new f.Literal({value:""})]);case 3:this.$=new f.Concat({},[d[v-1],d[v]]);break;case 4:case 5:this.$=d[v];break;case 6:this.$=new f.Literal({value:d[v]});break;case 7:this.$=new f.Splat({name:d[v]});break;case 8:this.$=new f.Param({name:d[v]});break;case 9:this.$=new f.Optional({},[d[v-1]]);break;case 10:this.$=u;break;case 11:case 12:this.$=u.slice(1);break}},table:[{3:1,4:2,5:[1,3],6:4,7:5,8:6,9:7,10:8,11:e,13:r,14:n,15:i},{1:[3]},{5:[1,13],6:14,7:5,8:6,9:7,10:8,11:e,13:r,14:n,15:i},{1:[2,2]},t(o,[2,4]),t(o,[2,5]),t(o,[2,6]),t(o,[2,7]),t(o,[2,8]),{4:15,6:4,7:5,8:6,9:7,10:8,11:e,13:r,14:n,15:i},t(o,[2,10]),t(o,[2,11]),t(o,[2,12]),{1:[2,1]},t(o,[2,3]),{6:14,7:5,8:6,9:7,10:8,11:e,12:[1,16],13:r,14:n,15:i},t(o,[2,9])],defaultActions:{3:[2,2],13:[2,1]},parseError:function(u,s){if(s.recoverable)this.trace(u);else{let f=function(p,d){this.message=p,this.hash=d};var _=f;throw f.prototype=Error,new f(u,s)}},parse:function(u){var s=this,_=[0],f=[],p=[null],d=[],m=this.table,v="",w=0,T=0,H=0,W=2,ie=1,J=d.slice.call(arguments,1),x=Object.create(this.lexer),E={yy:{}};for(var M in this.yy)Object.prototype.hasOwnProperty.call(this.yy,M)&&(E.yy[M]=this.yy[M]);x.setInput(u,E.yy),E.yy.lexer=x,E.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var je=x.yylloc;d.push(je);var br=x.options&&x.options.ranges;typeof E.yy.parseError=="function"?this.parseError=E.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Gn(R){_.length=_.length-2*R,p.length=p.length-R,d.length=d.length-R}for(var kr=function(){var R;return R=x.lex()||ie,typeof R!="number"&&(R=s.symbols_[R]||R),R},S,De,G,O,Kn,Me,X={},ye,D,ut,ve;;){if(G=_[_.length-1],this.defaultActions[G]?O=this.defaultActions[G]:((S===null||typeof S>"u")&&(S=kr()),O=m[G]&&m[G][S]),typeof O>"u"||!O.length||!O[0]){var Ue="";ve=[];for(ye in m[G])this.terminals_[ye]&&ye>W&&ve.push("'"+this.terminals_[ye]+"'");x.showPosition?Ue="Parse error on line "+(w+1)+`: +`+x.showPosition()+` +Expecting `+ve.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Ue="Parse error on line "+(w+1)+": Unexpected "+(S==ie?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(Ue,{text:x.match,token:this.terminals_[S]||S,line:x.yylineno,loc:je,expected:ve})}if(O[0]instanceof Array&&O.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+S);switch(O[0]){case 1:_.push(S),p.push(x.yytext),d.push(x.yylloc),_.push(O[1]),S=null,De?(S=De,De=null):(T=x.yyleng,v=x.yytext,w=x.yylineno,je=x.yylloc,H>0&&H--);break;case 2:if(D=this.productions_[O[1]][1],X.$=p[p.length-D],X._$={first_line:d[d.length-(D||1)].first_line,last_line:d[d.length-1].last_line,first_column:d[d.length-(D||1)].first_column,last_column:d[d.length-1].last_column},br&&(X._$.range=[d[d.length-(D||1)].range[0],d[d.length-1].range[1]]),Me=this.performAction.apply(X,[v,T,w,E.yy,O[1],p,d].concat(J)),typeof Me<"u")return Me;D&&(_=_.slice(0,-1*D*2),p=p.slice(0,-1*D),d=d.slice(0,-1*D)),_.push(this.productions_[O[1]][0]),p.push(X.$),d.push(X._$),ut=m[_[_.length-2]][_[_.length-1]],_.push(ut);break;case 3:return!0}}return!0}},c=function(){var h={EOF:1,parseError:function(s,_){if(this.yy.parser)this.yy.parser.parseError(s,_);else throw new Error(s)},setInput:function(u,s){return this.yy=s||this.yy||{},this._input=u,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var u=this._input[0];this.yytext+=u,this.yyleng++,this.offset++,this.match+=u,this.matched+=u;var s=u.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),u},unput:function(u){var s=u.length,_=u.split(/(?:\r\n?|\n)/g);this._input=u+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),_.length-1&&(this.yylineno-=_.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_?(_.length===f.length?this.yylloc.first_column:0)+f[f.length-_.length].length-_[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true). +`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(u){this.unput(this.match.slice(u))},pastInput:function(){var u=this.matched.substr(0,this.matched.length-this.match.length);return(u.length>20?"...":"")+u.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var u=this.match;return u.length<20&&(u+=this._input.substr(0,20-u.length)),(u.substr(0,20)+(u.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var u=this.pastInput(),s=new Array(u.length+1).join("-");return u+this.upcomingInput()+` +`+s+"^"},test_match:function(u,s){var _,f,p;if(this.options.backtrack_lexer&&(p={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(p.yylloc.range=this.yylloc.range.slice(0))),f=u[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+u[0].length},this.yytext+=u[0],this.match+=u[0],this.matches=u,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(u[0].length),this.matched+=u[0],_=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),_)return _;if(this._backtrack){for(var d in p)this[d]=p[d];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var u,s,_,f;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),d=0;ds[0].length)){if(s=_,f=d,this.options.backtrack_lexer){if(u=this.test_match(_,p[d]),u!==!1)return u;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(u=this.test_match(s,p[f]),u!==!1?u:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text. +`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var s=this.next();return s||this.lex()},begin:function(s){this.conditionStack.push(s)},popState:function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},pushState:function(s){this.begin(s)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(s,_,f,p){var d=p;switch(f){case 0:return"(";case 1:return")";case 2:return"SPLAT";case 3:return"PARAM";case 4:return"LITERAL";case 5:return"LITERAL";case 6:return"EOF"}},rules:[/^(?:\()/,/^(?:\))/,/^(?:\*+\w+)/,/^(?::+\w+)/,/^(?:[\w%\-~\n]+)/,/^(?:.)/,/^(?:$)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6],inclusive:!0}}};return h}();a.lexer=c;function l(){this.yy={}}return l.prototype=a,a.Parser=l,new l}();typeof me<"u"&&typeof pe<"u"&&(pe.parser=Ne,pe.Parser=Ne.Parser,pe.parse=function(){return Ne.parse.apply(Ne,arguments)})});var it=C((ko,ar)=>{"use strict";function ne(t){return function(e,r){return{displayName:t,props:e,children:r||[]}}}ar.exports={Root:ne("Root"),Concat:ne("Concat"),Literal:ne("Literal"),Splat:ne("Splat"),Param:ne("Param"),Optional:ne("Optional")}});var cr=C((So,lr)=>{"use strict";var ur=sr().parser;ur.yy=it();lr.exports=ur});var ot=C((Ao,fr)=>{"use strict";var Pn=Object.keys(it());function Rn(t){return Pn.forEach(function(e){if(typeof t[e]>"u")throw new Error("No handler defined for "+e.displayName)}),{visit:function(e,r){return this.handlers[e.displayName].call(this,e,r)},handlers:t}}fr.exports=Rn});var pr=C((qo,_r)=>{"use strict";var Cn=ot(),In=/[\-{}\[\]+?.,\\\^$|#\s]/g;function hr(t){this.captures=t.captures,this.re=t.re}hr.prototype.match=function(t){var e=this.re.exec(t),r={};return e?(this.captures.forEach(function(n,i){typeof e[i+1]>"u"?r[n]=void 0:r[n]=decodeURIComponent(e[i+1])}),r):!1};var Nn=Cn({Concat:function(t){return t.children.reduce(function(e,r){var n=this.visit(r);return{re:e.re+n.re,captures:e.captures.concat(n.captures)}}.bind(this),{re:"",captures:[]})},Literal:function(t){return{re:t.props.value.replace(In,"\\$&"),captures:[]}},Splat:function(t){return{re:"([^?#]*?)",captures:[t.props.name]}},Param:function(t){return{re:"([^\\/\\?#]+)",captures:[t.props.name]}},Optional:function(t){var e=this.visit(t.children[0]);return{re:"(?:"+e.re+")?",captures:e.captures}},Root:function(t){var e=this.visit(t.children[0]);return new hr({re:new RegExp("^"+e.re+"(?=\\?|#|$)"),captures:e.captures})}});_r.exports=Nn});var yr=C((Oo,dr)=>{"use strict";var $n=ot(),jn=$n({Concat:function(t,e){var r=t.children.map(function(n){return this.visit(n,e)}.bind(this));return r.some(function(n){return n===!1})?!1:r.join("")},Literal:function(t){return decodeURI(t.props.value)},Splat:function(t,e){return typeof e[t.props.name]>"u"?!1:e[t.props.name]},Param:function(t,e){return typeof e[t.props.name]>"u"?!1:e[t.props.name]},Optional:function(t,e){var r=this.visit(t.children[0],e);return r||""},Root:function(t,e){e=e||{};var r=this.visit(t.children[0],e);return r===!1||typeof r>"u"?!1:encodeURI(r)}});dr.exports=jn});var mr=C((To,vr)=>{"use strict";var Dn=cr(),Mn=pr(),Un=yr();function de(t){var e;if(this?e=this:e=Object.create(de.prototype),typeof t>"u")throw new Error("A route spec is required");return e.spec=t,e.ast=Dn.parse(t),e}de.prototype=Object.create(null);de.prototype.match=function(t){var e=Mn.visit(this.ast),r=e.match(t);return r!==null?r:!1};de.prototype.reverse=function(t){return Un.visit(this.ast,t)};vr.exports=de});var wr=C((Po,gr)=>{"use strict";var Ln=mr();gr.exports=Ln});var Ee,y,yt,Fe,K,ft,vt,Le,Rr,oe={},mt=[],Cr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Be=Array.isArray;function U(t,e){for(var r in e)t[r]=e[r];return t}function gt(t){var e=t.parentNode;e&&e.removeChild(t)}function I(t,e,r){var n,i,o,a={};for(o in e)o=="key"?n=e[o]:o=="ref"?i=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?Ee.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(o in t.defaultProps)a[o]===void 0&&(a[o]=t.defaultProps[o]);return we(t,a,n,i,null)}function we(t,e,r,n,i){var o={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++yt,__i:-1,__u:0};return i==null&&y.vnode!=null&&y.vnode(o),o}function wt(){return{current:null}}function se(t){return t.children}function L(t,e){this.props=t,this.context=e}function Z(t,e){if(e==null)return t.__?Z(t.__,t.__i+1):null;for(var r;ee&&K.sort(Le));xe.__r=0}function Et(t,e,r,n,i,o,a,c,l,h,u){var s,_,f,p,d,m=n&&n.__k||mt,v=e.length;for(r.__d=l,Ir(r,e,m),l=r.__d,s=0;s0?we(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,c=Nr(i,r,a=n+s,u),i.__i=c,o=null,c!==-1&&(u--,(o=r[c])&&(o.__u|=131072)),o==null||o.__v===null?(c==-1&&s--,typeof i.type!="function"&&(i.__u|=65536)):c!==a&&(c===a+1?s++:c>a?u>l-a?s+=c-a:s--:s=c(l!=null&&!(131072&l.__u)?1:0))for(;a>=0||c=0){if((l=e[a])&&!(131072&l.__u)&&i==l.key&&o===l.type)return a;a--}if(ctypeof t=="object"&&"constructor"in t&&"props"in t&&"type"in t&&"ref"in t&&"key"in t&&"__"in t,A=(t,e)=>t===void 0&&e===void 0||t===null&&e===null?!0:t!=null&&t!=null&&t[k]?t[k](e):e!=null&&e!=null&&e[k]?e[k](t):St(t)||St(e)?t===e:Ge(t,e),Ge=(t,e)=>{if(t instanceof Object&&e instanceof Object){let r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;let i=new Set(r.concat(n));for(let o of i)if(!A(t[o],e[o]))return!1;return!0}else return t===e};var ae=class{constructor(e,r){this.teardown=r,this.subject=e,this.steps=[]}async run(){let e;try{e=await new Promise(this.next.bind(this))}finally{this.teardown&&this.teardown()}return e}async next(e,r){requestAnimationFrame(async()=>{let n=this.steps.shift();if(n)try{this.subject=await n(this.subject)}catch(i){return r(i)}this.steps.length?this.next(e,r):e(this.subject)})}step(e){return this.steps.push(e),this}},Ke=class{constructor(e,r,n){this.socket=new WebSocket(r),this.suites=e,this.url=r,this.id=n,window.DEBUG={log:o=>{let a="";o===void 0?a="undefined":o===null?a="null":a=o.toString(),this.log(a)}};let i=null;window.onerror=o=>{this.socket.readyState===1?this.crash(o):i=i||o},this.socket.onopen=()=>{i!=null&&this.crash(i)},this.start()}start(){this.socket.readyState===1?this.run():this.socket.addEventListener("open",()=>this.run())}run(){return new Promise((e,r)=>{this.next(e,r)}).catch(e=>this.log(e.reason)).finally(()=>this.socket.send("DONE"))}report(e,r,n,i,o){i&&i.toString&&(i=i.toString()),this.socket.send(JSON.stringify({location:o,result:i,suite:r,id:this.id,type:e,name:n}))}reportTested(e,r,n){this.report(r,this.suite.name,e.name,n,e.location)}crash(e){this.report("CRASHED",null,null,e)}log(e){this.report("LOG",null,null,e)}next(e,r){requestAnimationFrame(async()=>{if(!this.suite||this.suite.tests.length===0)if(this.suite=this.suites.shift(),this.suite)this.report("SUITE",this.suite.name);else return e();let n=window.history.length,i=this.suite.tests.shift();try{let o=await i.proc.call(this.suite.context);if(window.history.length-n&&window.history.go(-(window.history.length-n)),sessionStorage.clear(),localStorage.clear(),o instanceof ae)try{await o.run(),this.reportTested(i,"SUCCEEDED",o.subject)}catch(a){this.reportTested(i,"FAILED",a)}else o?this.reportTested(i,"SUCCEEDED"):this.reportTested(i,"FAILED")}catch(o){this.reportTested(i,"ERRORED",o)}this.next(e,r)})}},Zn=(t,e,r)=>new ae(t).step(n=>{let i=A(n,e);if(r==="=="&&(i=!i),i)throw`Assertion failed: ${e} ${r} ${n}`;return!0}),Qn=ae,ei=Ke;var Se,q,Ye,At,ze=0,It=[],be=[],qt=y.__b,Ot=y.__r,Tt=y.diffed,Pt=y.__c,Rt=y.unmount;function Nt(t,e){y.__h&&y.__h(q,t,ze||e),ze=0;var r=q.__H||(q.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:be}),r.__[t]}function Y(t,e){var r=Nt(Se++,3);!y.__s&&$t(r.__H,e)&&(r.__=t,r.i=e,q.__H.__h.push(r))}function ue(t){return ze=5,N(function(){return{current:t}},[])}function N(t,e){var r=Nt(Se++,7);return $t(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function Dr(){for(var t;t=It.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(ke),t.__H.__h.forEach(Je),t.__H.__h=[]}catch(e){t.__H.__h=[],y.__e(e,t.__v)}}y.__b=function(t){q=null,qt&&qt(t)},y.__r=function(t){Ot&&Ot(t),Se=0;var e=(q=t.__c).__H;e&&(Ye===q?(e.__h=[],q.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=be,r.__N=r.i=void 0})):(e.__h.forEach(ke),e.__h.forEach(Je),e.__h=[],Se=0)),Ye=q},y.diffed=function(t){Tt&&Tt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(It.push(e)!==1&&At===y.requestAnimationFrame||((At=y.requestAnimationFrame)||Mr)(Dr)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==be&&(r.__=r.__V),r.i=void 0,r.__V=be})),Ye=q=null},y.__c=function(t,e){e.some(function(r){try{r.__h.forEach(ke),r.__h=r.__h.filter(function(n){return!n.__||Je(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],y.__e(n,r.__v)}}),Pt&&Pt(t,e)},y.unmount=function(t){Rt&&Rt(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ke(n)}catch(i){e=i}}),r.__H=void 0,e&&y.__e(e,r.__v))};var Ct=typeof requestAnimationFrame=="function";function Mr(t){var e,r=function(){clearTimeout(n),Ct&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);Ct&&(e=requestAnimationFrame(r))}function ke(t){var e=q,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),q=e}function Je(t){var e=q;t.__c=t.__(),q=e}function $t(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function qe(){throw new Error("Cycle detected")}var Ur=Symbol.for("preact-signals");function Oe(){if(V>1)V--;else{for(var t,e=!1;le!==void 0;){var r=le;for(le=void 0,Ze++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Mt(r))try{r.c()}catch(i){e||(t=i,e=!0)}r=n}}if(Ze=0,V--,e)throw t}}function jt(t){if(V>0)return t();V++;try{return t()}finally{Oe()}}var g=void 0,Xe=0;function Te(t){if(Xe>0)return t();var e=g;g=void 0,Xe++;try{return t()}finally{Xe--,g=e}}var le=void 0,V=0,Ze=0,Ae=0;function Dt(t){if(g!==void 0){var e=t.n;if(e===void 0||e.t!==g)return e={i:0,S:t,p:g.s,n:void 0,t:g,e:void 0,x:void 0,r:e},g.s!==void 0&&(g.s.n=e),g.s=e,t.n=e,32&g.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=g.s,e.n=void 0,g.s.n=e,g.s=e),e}}function b(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}b.prototype.brand=Ur;b.prototype.h=function(){return!0};b.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};b.prototype.U=function(t){if(this.t!==void 0){var e=t.e,r=t.x;e!==void 0&&(e.x=r,t.e=void 0),r!==void 0&&(r.e=e,t.x=void 0),t===this.t&&(this.t=r)}};b.prototype.subscribe=function(t){var e=this;return ee(function(){var r=e.value,n=32&this.f;this.f&=-33;try{t(r)}finally{this.f|=n}})};b.prototype.valueOf=function(){return this.value};b.prototype.toString=function(){return this.value+""};b.prototype.toJSON=function(){return this.value};b.prototype.peek=function(){return this.v};Object.defineProperty(b.prototype,"value",{get:function(){var t=Dt(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(g instanceof F&&function(){throw new Error("Computed cannot have side-effects")}(),t!==this.v){Ze>100&&qe(),this.v=t,this.i++,Ae++,V++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Oe()}}}});function $(t){return new b(t)}function Mt(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Ut(t){for(var e=t.s;e!==void 0;e=e.n){var r=e.S.n;if(r!==void 0&&(e.r=r),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Lt(t){for(var e=t.s,r=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):r=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=r}function F(t){b.call(this,void 0),this.x=t,this.s=void 0,this.g=Ae-1,this.f=4}(F.prototype=new b).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ae))return!0;if(this.g=Ae,this.f|=1,this.i>0&&!Mt(this))return this.f&=-2,!0;var t=g;try{Ut(this),g=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return g=t,Lt(this),this.f&=-2,!0};F.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}b.prototype.S.call(this,t)};F.prototype.U=function(t){if(this.t!==void 0&&(b.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};F.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};F.prototype.peek=function(){if(this.h()||qe(),16&this.f)throw this.v;return this.v};Object.defineProperty(F.prototype,"value",{get:function(){1&this.f&&qe();var t=Dt(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function ce(t){return new F(t)}function Vt(t){var e=t.u;if(t.u=void 0,typeof e=="function"){V++;var r=g;g=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Qe(t),n}finally{g=r,Oe()}}}function Qe(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Vt(t)}function Lr(t){if(g!==this)throw new Error("Out-of-order effect");Lt(this),g=t,this.f&=-2,8&this.f&&Qe(this),Oe()}function fe(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}fe.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};fe.prototype.S=function(){1&this.f&&qe(),this.f|=1,this.f&=-9,Vt(this),Ut(this),V++;var t=g;return g=this,Lr.bind(this,t)};fe.prototype.N=function(){2&this.f||(this.f|=2,this.o=le,le=this)};fe.prototype.d=function(){this.f|=8,1&this.f||Qe(this)};function ee(t){var e=new fe(t);try{e.c()}catch(r){throw e.d(),r}return e.d.bind(e)}var Re,et;function te(t,e){y[t]=e.bind(null,y[t]||function(){})}function Pe(t){et&&et(),et=t&&t.S()}function Ft(t){var e=this,r=t.data,n=Fr(r);n.value=r;var i=N(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var a;!Fe(i.peek())&&((a=e.base)==null?void 0:a.nodeType)===3?e.base.data=i.peek():(e.__$f|=1,e.setState({}))},ce(function(){var a=n.value.value;return a===0?0:a===!0?"":a||""})},[]);return i.value}Ft.displayName="_st";Object.defineProperties(b.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ft},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});te("__b",function(t,e){if(typeof e.type=="string"){var r,n=e.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof b&&(r||(e.__np=r={}),r[i]=o,n[i]=o.peek())}}t(e)});te("__r",function(t,e){Pe();var r,n=e.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return ee(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Re=n,Pe(r),t(e)});te("__e",function(t,e,r,n){Pe(),Re=void 0,t(e,r,n)});te("diffed",function(t,e){Pe(),Re=void 0;var r;if(typeof e.type=="string"&&(r=e.__e)){var n=e.__np,i=e.props;if(n){var o=r.U;if(o)for(var a in o){var c=o[a];c!==void 0&&!(a in n)&&(c.d(),o[a]=void 0)}else r.U=o={};for(var l in n){var h=o[l],u=n[l];h===void 0?(h=Vr(r,l,u,i),o[l]=h):h.o(u,i)}}}t(e)});function Vr(t,e,r,n){var i=e in t&&t.ownerSVGElement===void 0,o=$(r);return{o:function(a,c){o.value=a,n=c},d:ee(function(){var a=o.value.value;n[e]!==a&&(n[e]=a,i?t[e]=a:a?t.setAttribute(e,a):t.removeAttribute(e))})}}te("unmount",function(t,e){if(typeof e.type=="string"){var r=e.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var o=n[i];o&&o.d()}}}}else{var a=e.__c;if(a){var c=a.__$u;c&&(a.__$u=void 0,c.d())}}t(e)});te("__h",function(t,e,r,n){(n<3||n===9)&&(e.__$f|=2),t(e,r,n)});L.prototype.shouldComponentUpdate=function(t,e){var r=this.__$u;if(!(r&&r.s!==void 0||4&this.__$f)||3&this.__$f)return!0;for(var n in e)return!0;for(var i in t)if(i!=="__source"&&t[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in t))return!0;return!1};function Fr(t){return N(function(){return $(t)},[])}function Br(t){var e=ue(t);return e.current=t,Re.__$f|=4,N(function(){return ce(function(){return e.current()})},[])}var he=class{constructor(e){this.patterns=e}},Ce=class{constructor(e,r){this.pattern=r,this.variant=e}},fi=(t,e)=>new Ce(t,e),hi=t=>new he(t),Hr=Symbol("Variable"),tt=Symbol("Spread"),z=(t,e,r=[])=>{if(e!==null){if(e===Hr)r.push(t);else if(Array.isArray(e))if(e.some(i=>i===tt)&&t.length>=e.length-1){let i=0,o=[],a=1;for(;e[i]!==tt&&i{for(let r of e){if(r[0]===null)return r[1]();{let n=z(t,r[0]);if(n)return r[1].apply(null,n)}}};"DataTransfer"in window||(window.DataTransfer=class{constructor(){this.effectAllowed="none",this.dropEffect="none",this.files=[],this.types=[],this.cache={}}getData(t){return this.cache[t]||""}setData(t,e){return this.cache[t]=e,null}clearData(){return this.cache={},null}});var Wr=t=>new Proxy(t,{get:function(e,r){if(r==="event")return t;if(r in e){let n=e[r];return n instanceof Function?()=>e[r]():n}else switch(r){case"clipboardData":return e.clipboardData=new DataTransfer;case"dataTransfer":return e.dataTransfer=new DataTransfer;case"data":return"";case"altKey":return!1;case"charCode":return-1;case"ctrlKey":return!1;case"key":return"";case"keyCode":return-1;case"locale":return"";case"location":return-1;case"metaKey":return!1;case"repeat":return!1;case"shiftKey":return!1;case"which":return-1;case"button":return-1;case"buttons":return-1;case"clientX":return-1;case"clientY":return-1;case"pageX":return-1;case"pageY":return-1;case"screenX":return-1;case"screenY":return-1;case"detail":return-1;case"deltaMode":return-1;case"deltaX":return-1;case"deltaY":return-1;case"deltaZ":return-1;case"animationName":return"";case"pseudoElement":return"";case"elapsedTime":return-1;case"propertyName":return"";default:return}}});y.event=Wr;var xi=(t,e,r,n)=>t.length>=e+1&&e>=0?new r(t[e]):new n,Ei=(t,e)=>r=>{t.current._0!==r&&(t.current=new e(r))},bi=t=>{let e=N(()=>$(t),[]);return e.value,e},ki=t=>{let e=wt();return e.current=t,e},Si=t=>{let e=ue(!1);Y(()=>{e.current?t():e.current=!0})},Ai=(t,e)=>t??e,qi=(...t)=>{let e=Array.from(t);return Array.isArray(e[0])&&e.length===1?e[0]:e},Oi=t=>e=>e[t],Ht=t=>t,Bt=class extends L{async componentDidMount(){let e=await this.props.x();this.setState({x:e})}render(){return this.state.x?I(this.state.x,this.props.p,this.props.c):null}},Ti=t=>async()=>Gr(t),Gr=async t=>(await import(t)).default;var Kr=$({}),Wt=$({}),Ci=t=>Wt.value=t,Ii=t=>(Kr.value[Wt.value]||{})[t]||"";var Yt=ct(Kt()),Fi=(t,e)=>(r,n)=>{let i=()=>{t.has(r)&&(t.delete(r),Te(e))};Y(()=>i,[]),Y(()=>{let o=n();if(o===null)i();else{let a=t.get(r);A(a,o)||(t.set(r,o),Te(e))}})},Bi=t=>Array.from(t.values()),Hi=()=>N(Yt.default,[]);function nt(t,e=1,r={}){let{indent:n=" ",includeEmptyLines:i=!1}=r;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(e===0)return t;let o=i?/^/gm:/^(?!\s*$)/gm;return t.replace(o,n.repeat(e))}var j=t=>{let e=JSON.stringify(t,"",2);return typeof e>"u"&&(e="undefined"),nt(e)},P=class{constructor(e,r=[]){this.message=e,this.object=null,this.path=r}push(e){this.path.unshift(e)}toString(){let e=this.message.trim(),r=this.path.reduce((n,i)=>{if(n.length)switch(i.type){case"FIELD":return`${n}.${i.value}`;case"ARRAY":return`${n}[${i.value}]`}else switch(i.type){case"FIELD":return i.value;case"ARRAY":return"[$(item.value)]"}},"");return r.length&&this.object?e+` + +`+Yr.trim().replace("{value}",j(this.object)).replace("{path}",r):e}},Yr=` +The input is in this object: + +{value} + +at: {path} +`,zr=` +I was trying to decode the value: + +{value} + +as a String, but could not. +`,Jr=` +I was trying to decode the value: + +{value} + +as a Time, but could not. +`,Xr=` +I was trying to decode the value: + +{value} + +as a Number, but could not. +`,Zr=` +I was trying to decode the value: + +{value} + +as a Bool, but could not. +`,Qr=` +I was trying to decode the field "{field}" from the object: + +{value} + +but I could not because it's not an object. +`,en=` +I was trying to decode the value: + +{value} + +as an Array, but could not. +`,tn=` +I was trying to decode the value: + +{value} + +as an Tuple, but could not. +`,rn=` +I was trying to decode one of the values of a tuple: + +{value} + +but could not. +`,nn=` +I was trying to decode the value: + +{value} + +as a Map, but could not. +`,Yi=(t,e)=>r=>typeof r!="string"?new e(new P(zr.replace("{value}",j(r)))):new t(r),zi=(t,e)=>r=>{let n=NaN;return typeof r=="number"?n=new Date(r):n=Date.parse(r),Number.isNaN(n)?new e(new P(Jr.replace("{value}",j(r)))):new t(new Date(n))},Ji=(t,e)=>r=>{let n=parseFloat(r);return isNaN(n)?new e(new P(Xr.replace("{value}",j(r)))):new t(n)},Xi=(t,e)=>r=>typeof r!="boolean"?new e(new P(Zr.replace("{value}",j(r)))):new t(r),on=(t,e,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=Qr.replace("{field}",t).replace("{value}",j(n));return new r(new P(i))}else{let i=e(n[t]);return i instanceof r&&(i._0.push({type:"FIELD",value:t}),i._0.object=n),i}},Zi=(t,e,r)=>n=>{if(!Array.isArray(n))return new r(new P(en.replace("{value}",j(n))));let i=[],o=0;for(let a of n){let c=t(a);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0),o++}return new e(i)},Qi=(t,e,r,n,i)=>o=>{if(o==null)return new e(new i);{let a=t(o);return a instanceof r?a:new e(new n(a._0))}},eo=(t,e,r)=>n=>{if(!Array.isArray(n))return new r(new P(tn.replace("{value}",j(n))));let i=[],o=0;for(let a of t){if(n[o]===void 0||n[o]===null)return new r(new P(rn.replace("{value}",j(n[o]))));{let c=a(n[o]);if(c instanceof r)return c._0.push({type:"ARRAY",value:o}),c._0.object=n,c;i.push(c._0)}o++}return new e(i)},to=(t,e,r)=>n=>{if(typeof n!="object"||Array.isArray(n)||n==null||n==null){let i=nn.replace("{value}",j(n));return new r(new P(i))}else{let i=[];for(let o in n){let a=t(n[o]);if(a instanceof r)return a;i.push([o,a._0])}return new e(i)}},ro=(t,e,r)=>n=>{let i={};for(let o in t){let a=t[o];Array.isArray(a)&&(a=t[o][0],o=t[o][1]);let c=on(o,a,r)(n);if(c instanceof r)return c;i[o]=c._0}return new e(i)},no=t=>e=>new t(e);var so=t=>t.toISOString(),ao=t=>e=>e.map(r=>t?t(r):r),uo=t=>e=>{let r={};for(let n of e)r[n[0]]=t?t(n[1]):n[1];return r},lo=(t,e)=>r=>r instanceof e?t(r._0):null,co=t=>e=>e.map((r,n)=>{let i=t[n];return i?i(r):r}),fo=t=>e=>{let r={};for(let n in t){let i=t[n],o=n;Array.isArray(i)&&(i=t[n][0],o=t[n][1]),r[o]=(i||Ht)(e[n])}return r};var sn=Object.getOwnPropertyNames,an=Object.getOwnPropertySymbols,un=Object.prototype.hasOwnProperty;function zt(t,e){return function(n,i,o){return t(n,i,o)&&e(n,i,o)}}function Ie(t){return function(r,n,i){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,i);var o=i.cache,a=o.get(r),c=o.get(n);if(a&&c)return a===n&&c===r;o.set(r,n),o.set(n,r);var l=t(r,n,i);return o.delete(r),o.delete(n),l}}function Jt(t){return sn(t).concat(an(t))}var nr=Object.hasOwn||function(t,e){return un.call(t,e)};function re(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var ir="_owner",Xt=Object.getOwnPropertyDescriptor,Zt=Object.keys;function ln(t,e,r){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function cn(t,e){return re(t.getTime(),e.getTime())}function Qt(t,e,r){if(t.size!==e.size)return!1;for(var n={},i=t.entries(),o=0,a,c;(a=i.next())&&!a.done;){for(var l=e.entries(),h=!1,u=0;(c=l.next())&&!c.done;){var s=a.value,_=s[0],f=s[1],p=c.value,d=p[0],m=p[1];!h&&!n[u]&&(h=r.equals(_,d,o,u,t,e,r)&&r.equals(f,m,_,d,t,e,r))&&(n[u]=!0),u++}if(!h)return!1;o++}return!0}function fn(t,e,r){var n=Zt(t),i=n.length;if(Zt(e).length!==i)return!1;for(var o;i-- >0;)if(o=n[i],o===ir&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!nr(e,o)||!r.equals(t[o],e[o],o,o,t,e,r))return!1;return!0}function _e(t,e,r){var n=Jt(t),i=n.length;if(Jt(e).length!==i)return!1;for(var o,a,c;i-- >0;)if(o=n[i],o===ir&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!nr(e,o)||!r.equals(t[o],e[o],o,o,t,e,r)||(a=Xt(t,o),c=Xt(e,o),(a||c)&&(!a||!c||a.configurable!==c.configurable||a.enumerable!==c.enumerable||a.writable!==c.writable)))return!1;return!0}function hn(t,e){return re(t.valueOf(),e.valueOf())}function _n(t,e){return t.source===e.source&&t.flags===e.flags}function er(t,e,r){if(t.size!==e.size)return!1;for(var n={},i=t.values(),o,a;(o=i.next())&&!o.done;){for(var c=e.values(),l=!1,h=0;(a=c.next())&&!a.done;)!l&&!n[h]&&(l=r.equals(o.value,a.value,o.value,a.value,t,e,r))&&(n[h]=!0),h++;if(!l)return!1}return!0}function pn(t,e){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}var dn="[object Arguments]",yn="[object Boolean]",vn="[object Date]",mn="[object Map]",gn="[object Number]",wn="[object Object]",xn="[object RegExp]",En="[object Set]",bn="[object String]",kn=Array.isArray,tr=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,rr=Object.assign,Sn=Object.prototype.toString.call.bind(Object.prototype.toString);function An(t){var e=t.areArraysEqual,r=t.areDatesEqual,n=t.areMapsEqual,i=t.areObjectsEqual,o=t.arePrimitiveWrappersEqual,a=t.areRegExpsEqual,c=t.areSetsEqual,l=t.areTypedArraysEqual;return function(u,s,_){if(u===s)return!0;if(u==null||s==null||typeof u!="object"||typeof s!="object")return u!==u&&s!==s;var f=u.constructor;if(f!==s.constructor)return!1;if(f===Object)return i(u,s,_);if(kn(u))return e(u,s,_);if(tr!=null&&tr(u))return l(u,s,_);if(f===Date)return r(u,s,_);if(f===RegExp)return a(u,s,_);if(f===Map)return n(u,s,_);if(f===Set)return c(u,s,_);var p=Sn(u);return p===vn?r(u,s,_):p===xn?a(u,s,_):p===mn?n(u,s,_):p===En?c(u,s,_):p===wn?typeof u.then!="function"&&typeof s.then!="function"&&i(u,s,_):p===dn?i(u,s,_):p===yn||p===gn||p===bn?o(u,s,_):!1}}function qn(t){var e=t.circular,r=t.createCustomConfig,n=t.strict,i={areArraysEqual:n?_e:ln,areDatesEqual:cn,areMapsEqual:n?zt(Qt,_e):Qt,areObjectsEqual:n?_e:fn,arePrimitiveWrappersEqual:hn,areRegExpsEqual:_n,areSetsEqual:n?zt(er,_e):er,areTypedArraysEqual:n?_e:pn};if(r&&(i=rr({},i,r(i))),e){var o=Ie(i.areArraysEqual),a=Ie(i.areMapsEqual),c=Ie(i.areObjectsEqual),l=Ie(i.areSetsEqual);i=rr({},i,{areArraysEqual:o,areMapsEqual:a,areObjectsEqual:c,areSetsEqual:l})}return i}function On(t){return function(e,r,n,i,o,a,c){return t(e,r,c)}}function Tn(t){var e=t.circular,r=t.comparator,n=t.createState,i=t.equals,o=t.strict;if(n)return function(l,h){var u=n(),s=u.cache,_=s===void 0?e?new WeakMap:void 0:s,f=u.meta;return r(l,h,{cache:_,equals:i,meta:f,strict:o})};if(e)return function(l,h){return r(l,h,{cache:new WeakMap,equals:i,meta:void 0,strict:o})};var a={cache:void 0,equals:i,meta:void 0,strict:o};return function(l,h){return r(l,h,a)}}var or=B(),_o=B({strict:!0}),po=B({circular:!0}),yo=B({circular:!0,strict:!0}),vo=B({createInternalComparator:function(){return re}}),mo=B({strict:!0,createInternalComparator:function(){return re}}),go=B({circular:!0,createInternalComparator:function(){return re}}),wo=B({circular:!0,createInternalComparator:function(){return re},strict:!0});function B(t){t===void 0&&(t={});var e=t.circular,r=e===void 0?!1:e,n=t.createInternalComparator,i=t.createState,o=t.strict,a=o===void 0?!1:o,c=qn(t),l=An(c),h=n?n(l):On(l);return Tn({circular:r,comparator:l,createState:i,equals:h,strict:a})}var Er=ct(wr());var $e=class extends Error{},Vn=(t,e)=>t instanceof Object?e instanceof Object&&or(t,e):!(e instanceof Object)&&t===e,Fn=t=>{typeof window.queueMicrotask!="function"?Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e})):window.queueMicrotask(t)},xr=(t,e)=>{for(let r of e){if(r.path==="*")return{route:r,vars:!1,url:t};{let n=new Er.default(r.path).match(t);if(n)return{route:r,vars:n,url:t}}}return null},st=class{constructor(e,r){this.root=document.createElement("div"),this.routeInfo=null,this.routes=r,this.ok=e,document.body.appendChild(this.root),window.addEventListener("popstate",this.handlePopState.bind(this)),window.addEventListener("click",this.handleClick.bind(this),!0)}handleClick(e){if(!e.defaultPrevented&&!e.ctrlKey){for(let r of e.composedPath())if(r.tagName==="A"){if(r.target.trim()!=="")return;if(r.origin===window.location.origin){let n=r.pathname+r.search+r.hash,i=xr(n,this.routes);if(i){e.preventDefault(),Bn(n,!0,!0,i);return}}}}}resolvePagePosition(e){Fn(()=>{requestAnimationFrame(()=>{let r=window.location.hash;if(r){let n=null;try{n=this.root.querySelector(r)||this.root.querySelector(`a[name="${r.slice(1)}"]`)}catch{}n?e&&n.scrollIntoView():console.warn(`MINT: ${r} matches no element with an id and no link with a name`)}else e&&window.scrollTo(0,0)})})}handlePopState(e){let r=window.location.pathname+window.location.search+window.location.hash,n=e?.routeInfo||xr(r,this.routes);n&&((this.routeInfo===null||n.url!==this.routeInfo.url||!Vn(n.vars,this.routeInfo.vars))&&this.runRouteHandler(n),this.resolvePagePosition(!!e?.triggerJump)),this.routeInfo=n}runRouteHandler(e){let{route:r}=e;if(r.path==="*")r.handler();else{let{vars:n}=e;try{let i=r.mapping.map((o,a)=>{let c=n[o],l=r.decoders[a](c);if(l instanceof this.ok)return l._0;throw new $e});r.handler.apply(null,i)}catch(i){if(i.constructor!==$e)throw i}}}render(e,r){if(typeof e<"u"){let n=[];for(let i in r)n.push(I(r[i],{key:i}));Q([...n,I(e,{key:"MINT_MAIN"})],this.root),this.handlePopState()}}},Bn=(t,e=!0,r=!0,n=null)=>{let i=window.location.pathname,o=window.location.search,a=window.location.hash;if(i+o+a!==t&&(e?window.history.pushState({},"",t):window.history.replaceState({},"",t)),e){let l=new PopStateEvent("popstate");l.triggerJump=r,l.routeInfo=n,dispatchEvent(l)}},Io=(t,e,r,n=[])=>{new st(r,n).render(t,e)};function Hn(t){return this.getChildContext=()=>t.context,t.children}function Wn(t){let e=this,r=t._container;e.componentWillUnmount=function(){Q(null,e._temp),e._temp=null,e._container=null},e._container&&e._container!==r&&e.componentWillUnmount(),e._temp||(e._container=r,e._temp={nodeType:1,parentNode:r,childNodes:[],appendChild(n){this.childNodes.push(n),e._container.appendChild(n)},insertBefore(n,i){this.childNodes.push(n),e._container.appendChild(n)},removeChild(n){this.childNodes.splice(this.childNodes.indexOf(n)>>>1,1),e._container.removeChild(n)}}),Q(I(Hn,{context:e.context},t._vnode),e._temp)}function jo(t,e){let r=I(Wn,{_vnode:t,_container:e});return r.containerInfo=e,r}var at=class{[k](e){if(!(e instanceof this.constructor)||e.length!==this.length)return!1;if(this.record)return Ge(this,e);for(let r=0;rclass extends at{constructor(...e){if(super(),Array.isArray(t)){this.length=t.length,this.record=!0;for(let r=0;r(...e)=>new t(...e);var Bo=t=>{let e=document.createElement("style");document.head.appendChild(e),e.innerHTML=t},Ho=t=>{let e={},r=(n,i)=>{e[n.toString().trim()]=i.toString().trim()};for(let n of t)if(typeof n=="string")n.split(";").forEach(i=>{let[o,a]=i.split(":");o&&a&&r(o,a)});else if(n instanceof Map||n instanceof Array)for(let[i,o]of n)r(i,o);else for(let i in n)r(i,n[i]);return e};var export_uuid=Yt.default;export{k as Equals,P as Error,Oi as access,xi as arrayAccess,jt as batch,A as compare,Ge as compareObjects,ce as computed,I as createElement,jo as createPortal,Fi as createProvider,ki as createRef,Zi as decodeArray,Xi as decodeBoolean,on as decodeField,to as decodeMap,Qi as decodeMaybe,Ji as decodeNumber,no as decodeObject,Yi as decodeString,zi as decodeTime,eo as decodeTuple,ro as decoder,z as destructure,ee as effect,ao as encodeArray,uo as encodeMap,lo as encodeMaybe,so as encodeTime,co as encodeTuple,fo as encoder,se as fragment,Ht as identity,Bo as insertStyles,Ti as lazy,Bt as lazyComponent,Gr as load,Wt as locale,_i as match,Bn as navigate,Lo as newVariant,Wr as normalizeEvent,Ai as or,fi as pattern,hi as patternRecord,tt as patternSpread,Hr as patternVariable,Io as program,Ci as setLocale,Ei as setRef,$ as signal,Ho as style,Bi as subscriptions,Qn as testContext,Zn as testOperation,Q as testRender,ei as testRunner,qi as toArray,Ii as translate,Kr as translations,Br as useComputed,Si as useDidUpdate,Y as useEffect,Hi as useId,N as useMemo,ue as useRef,bi as useSignal,export_uuid as uuid,Uo as variant}; diff --git a/src/ast/builtin.cr b/src/ast/builtin.cr new file mode 100644 index 000000000..ed20be41b --- /dev/null +++ b/src/ast/builtin.cr @@ -0,0 +1,13 @@ +module Mint + class Ast + class Builtin < Node + getter value + + def initialize(@file : Parser::File, + @value : String, + @from : Int64, + @to : Int64) + end + end + end +end diff --git a/src/ast/component.cr b/src/ast/component.cr index d89d172b3..bb80c210f 100644 --- a/src/ast/component.cr +++ b/src/ast/component.cr @@ -4,7 +4,7 @@ module Mint getter functions, gets, uses, name, comment, refs, constants getter properties, connects, styles, states, comments - getter? global, locales + getter? global, locales, async def initialize(@refs : Array(Tuple(Variable, Node)), @properties : Array(Property), @@ -20,6 +20,7 @@ module Mint @uses : Array(Use), @locales : Bool, @global : Bool, + @async : Bool, @from : Int64, @to : Int64, @name : Id) diff --git a/src/ast/defer.cr b/src/ast/defer.cr new file mode 100644 index 000000000..3b055c669 --- /dev/null +++ b/src/ast/defer.cr @@ -0,0 +1,16 @@ +require "digest/sha1" + +module Mint + class Ast + class Defer < Node + getter body, id + + def initialize(@file : Parser::File, + @from : Int64, + @body : Node, + @to : Int64) + @id = Digest::SHA1.hexdigest(source) + end + end + end +end diff --git a/src/ast/here_document.cr b/src/ast/here_document.cr index b7a7772cf..b23b37c70 100644 --- a/src/ast/here_document.cr +++ b/src/ast/here_document.cr @@ -1,10 +1,11 @@ module Mint class Ast class HereDocument < Node - getter value, token, modifier + getter value, token, modifier, highlight def initialize(@value : Array(String | Interpolation), @file : Parser::File, + @highlight : Bool?, @modifier : Char, @token : String, @from : Int64, diff --git a/src/ast/node.cr b/src/ast/node.cr index 58c8945ce..253614f04 100644 --- a/src/ast/node.cr +++ b/src/ast/node.cr @@ -41,7 +41,7 @@ module Mint end getter file : Parser::File - + property parent : Node? property from : Int64 getter to : Int64 diff --git a/src/builder.cr b/src/builder.cr index cbb190e20..8f86a222d 100644 --- a/src/builder.cr +++ b/src/builder.cr @@ -1,14 +1,47 @@ module Mint class Builder - def initialize(relative, skip_manifest, skip_service_worker, skip_icons, optimize, inline, runtime_path, watch) - build(relative, skip_manifest, skip_service_worker, skip_icons, optimize, inline, runtime_path) + def initialize( + *, + skip_service_worker : Bool, + runtime_path : String?, + skip_manifest : Bool, + skip_icons : Bool, + relative : Bool, + optimize : Bool, + inline : Bool, + watch : Bool + ) + build( + skip_service_worker: skip_service_worker, + skip_manifest: skip_manifest, + runtime_path: runtime_path, + skip_icons: skip_icons, + relative: relative, + optimize: optimize, + inline: inline) if watch - watch_workspace(relative, skip_manifest, skip_service_worker, skip_icons, optimize, inline, runtime_path) + watch_workspace( + skip_service_worker: skip_service_worker, + skip_manifest: skip_manifest, + runtime_path: runtime_path, + skip_icons: skip_icons, + relative: relative, + optimize: optimize, + inline: inline) end end - def build(relative, skip_manifest, skip_service_worker, skip_icons, optimize, inline, runtime_path) + def build( + *, + skip_service_worker : Bool, + runtime_path : String?, + skip_manifest : Bool, + skip_icons : Bool, + relative : Bool, + optimize : Bool, + inline : Bool + ) json = MintJson.parse_current if !skip_icons && !Process.find_executable("convert") @@ -32,11 +65,25 @@ module Mint terminal.puts "#{COG} Compiling your application:" - index_js, artifacts = - index(json.application.css_prefix, relative, optimize, runtime_path, json.web_components) + index_js, index_css, artifacts = + index(json.application.css_prefix, relative, optimize, json.web_components) unless inline - File.write Path[DIST_DIR, "index.js"], index_js + terminal.measure "#{COG} Writing index.js..." do + File.write Path[DIST_DIR, "index.js"], index_js + end + + terminal.measure "#{COG} Writing index.css..." do + File.write Path[DIST_DIR, "index.css"], index_css + end + + terminal.measure "#{COG} Writing runtime.js..." do + if runtime_path + FileUtils.cp runtime_path, Path[DIST_DIR, "runtime.js"] + else + File.write Path[DIST_DIR, "runtime.js"], Assets.read("runtime.js") + end + end if SourceFiles.external_javascripts? terminal.measure "#{COG} Writing external javascripts..." do @@ -79,7 +126,13 @@ module Mint terminal.measure "#{COG} Writing index.html..." do File.write Path[DIST_DIR, "index.html"], - IndexHtml.render(:build, relative, skip_manifest, skip_service_worker, skip_icons, inline, index_js) + IndexHtml.render(:build, relative, + skip_manifest, + skip_service_worker, + skip_icons, + inline, + index_js, + index_css) end unless skip_manifest @@ -141,15 +194,7 @@ module Mint end end - def index(css_prefix, relative, optimize, runtime_path, web_components) - runtime = - if runtime_path - Cli.runtime_file_not_found(runtime_path) unless File.exists?(runtime_path) - File.read(runtime_path) - else - Assets.read("runtime.js") - end - + def index(css_prefix, relative, optimize, web_components) sources = Dir.glob(SourceFiles.all) @@ -170,22 +215,38 @@ module Mint type_checker.check end - compiled = nil + compiled = {"", ""} terminal.measure " #{ARROW} Compiling..." do - compiled = Compiler.compile type_checker.artifacts, { - web_components: web_components, - css_prefix: css_prefix, - relative: relative, - optimize: optimize, - build: true, - } + config = + Compiler2::Config.new( + runtime_path: "./runtime.js", + css_prefix: css_prefix, + include_program: true, + relative: relative, + optimize: optimize, + build: true, + test: nil) + + program = + Compiler2.program(type_checker.artifacts, config) + + compiled = + {program["./index.js"], program["./index.css"]} end - {runtime + compiled.to_s, type_checker.artifacts} + {compiled[0], compiled[1], type_checker.artifacts} end - def watch_workspace(relative, skip_manifest, skip_service_worker, skip_icons, optimize, inline, runtime_path) + def watch_workspace( + skip_service_worker : Bool, + runtime_path : String?, + skip_manifest : Bool, + skip_icons : Bool, + relative : Bool, + optimize : Bool, + inline : Bool + ) workspace = Workspace.current workspace.on "change" do |result| @@ -194,7 +255,16 @@ module Mint terminal.reset terminal.puts "Rebuilding for production" terminal.divider - build(relative, skip_manifest, skip_service_worker, skip_icons, optimize, inline, runtime_path) + + build( + skip_service_worker: skip_service_worker, + skip_manifest: skip_manifest, + runtime_path: runtime_path, + skip_icons: skip_icons, + optimize: optimize, + relative: relative, + inline: inline) + terminal.divider when Error end diff --git a/src/commands/build.cr b/src/commands/build.cr index 3b925b80c..816c0bb58 100644 --- a/src/commands/build.cr +++ b/src/commands/build.cr @@ -44,15 +44,14 @@ module Mint def run execute "Building for production" do Builder.new( - flags.relative, - flags.skip_manifest, - flags.skip_service_worker, - flags.skip_icons, - flags.minify, - flags.inline, - flags.runtime, - flags.watch - ) + skip_service_worker: flags.skip_service_worker, + skip_manifest: flags.skip_manifest, + skip_icons: flags.skip_icons, + runtime_path: flags.runtime, + relative: flags.relative, + optimize: flags.minify, + inline: flags.inline, + watch: flags.watch) if flags.watch sleep diff --git a/src/compiler2.cr b/src/compiler2.cr new file mode 100644 index 000000000..12f51a5bc --- /dev/null +++ b/src/compiler2.cr @@ -0,0 +1,333 @@ +module Mint + class Compiler2 + include Helpers + + # Represents a compiled item + alias Item = Ast::Node | Builtin | String | Signal | Indent | Raw | Variable | Ref | Encoder | Decoder + + # Represents an generated idetifier from the parts of the union type. + alias Id = Ast::Node | Variable | Encoder | Decoder + + # Represents compiled code. + alias Compiled = Array(Item) + + # Represents a Preact signal (https://preactjs.com/guide/v10/signals/). Signals are treated + # differently from vaiables because we will need to access them using the `.value` accessor. + record Signal, value : Ast::Node + + # Represents a reference to an HTML element or other component. They are treated differently + # because they have a `.current` accessor. + record Ref, value : Ast::Node + + record Encoder, value : String + record Decoder, value : String + + # Represents code which needs to be indented. + record Indent, items : Compiled + + # Represents raw code (which does not get modified or indented). + record Raw, value : String + + # Represents a variable. + class Variable; end + + # Builtin functions in the runtime. + enum Builtin + # Pattern matching. + PatternVariable + PatternSpread + PatternRecord + Destructure + Pattern + Match + + # Type variants. + NewVariant + Variant + + # Rendering. + CreateElement + LazyComponent + CreatePortal + Fragment + Lazy + + # Effects. + UseDidUpdate + UseComputed + UseFunction + UseEffect + CreateRef + UseSignal + Computed + UseMemo + UseRef + Signal + Batch + + # Providers. + CreateProvider + Subscriptions + UseId + Uuid + + # Encoders. + EncodeTuple + EncodeArray + EncodeMaybe + EncodeTime + EncodeMap + Encoder + + # Decoders. + DecodeBoolean + DecodeObject + DecodeString + DecodeNumber + DecodeField + DecodeMaybe + DecodeArray + DecodeTuple + DecodeTime + DecodeMap + Decoder + + # Navigation and program. + Navigate + Program + + # Utilities. + NormalizeEvent + ArrayAccess + Identity + ToArray + Compare + Define + SetRef + Access + Curry + Load + Or + + # Styles and CSS. + InsertStyles + Style + + # Test + TestOperation + TestContext + TestRender + TestRunner + + # Translations + Translations + Translate + SetLocale + Locale + end + + delegate record_field_lookup, ast, components_touched, to: artifacts + delegate resolve_order, variables, cache, lookups, to: artifacts + + # Contains the generated encoders. + getter encoders = Hash(TypeChecker::Checkable, Compiled).new + + # Contains the generated decoders. + getter decoders = Hash(TypeChecker::Checkable, Compiled).new + + # A set to track already rendered nodes. + getter touched : Set(Ast::Node) = Set(Ast::Node).new + + # Contains the compiled JavaScript tree. + getter compiled = [] of Tuple(Ast::Node, Id, Compiled) + + # The type checker artifacts. + getter artifacts : TypeChecker::Artifacts + + # The style builder instance. + getter style_builder : StyleBuilder + + # The compiler config. + getter config : Config + + # The JavaScript builder instance. + getter js : Js + + def initialize(@artifacts, @config) + @js = + Js.new(optimize: config.optimize) + + @style_builder = + StyleBuilder.new( + css_prefix: config.css_prefix, + optimize: config.optimize) + end + + # Adds a compiled entity. + def add(node : Ast::Node, id : Id, value : Compiled) + compiled << {node, id, value} + end + + # Adds multiple compiled entities. + def add(items : Array(Tuple(Ast::Node, Id, Compiled) | Nil)) + items.compact.each { |(node, id, compiled)| add(node, id, compiled) } + end + + # Compiles a node. If the node is already compiled or not checked it + # returns an empty compiled node. + def compile(node : Ast::Node, &) : Compiled + if touched.includes?(node) || !node.in?(artifacts.checked) + [] of Item + else + touched.add(node) + yield + end + end + + # Compiles multiple nodes and joins them with the separator. + def compile(nodes : Array(Ast::Node), separator : String) : Compiled + compile(nodes).intersperse([separator]).flatten + end + + # Compiles multiple nodes. + def compile(nodes : Array(Ast::Node)) : Array(Compiled) + nodes.map { |node| compile(node) } + end + + # Fallback for compiling a node. + def compile(node : Ast::Node) : Compiled + raise "Missing compiler for: #{node.class.to_s.upcase}" + end + + # Resolves a top-level node. + def resolve(node : Ast::Node, &) + return unless node.in?(artifacts.checked) + return if touched.includes?(node) + touched.add(node) + yield + end + + # Resolves top-level nodes. + def resolve(nodes : Array(Ast::Node)) + nodes.map { |node| resolve(node) } + end + + # Fallback resolving nodes. + def resolve(node : Ast::Node) + puts "Missing resolver for: #{node.class.to_s.upcase}" + nil + end + + # Translations + def translations + mapped = + artifacts + .locales + .each_with_object({} of String => Hash(String, Compiled)) do |(key, data), memo| + data.each do |language, node| + if node.in?(artifacts.checked) + memo[language] ||= {} of String => Compiled + memo[language]["'#{key}'"] = compile(node) + end + end + end + + object = + mapped.each_with_object({} of String => Compiled) do |(language, tokens), memo| + memo[language] = js.object(tokens) + end + + if object.empty? + [[] of Item] + else + [ + js.assign([Builtin::Translations, ".value"] of Item, js.object(object)), + js.assign([Builtin::Locale, ".value"] of Item, js.string(object.keys.first)), + ] + end + end + + # Compiles the program call. + def program + routes = + compile(ast.routes.flat_map(&.routes)) + + globals = + ast + .components + .select(&.global?) + .each_with_object({} of Item => Compiled) do |item, memo| + memo[item.as(Item)] = [item] of Item + end + + js.call(Builtin::Program, [main, js.object(globals), ok, js.array(routes)]) + end + + def inject_css(css : String) + js.call(Builtin::InsertStyles, [[%(`#{css}`)] of Item]) + end + + # Compile test runner. + def test(url, id) + suites = + compile(ast.suites) + + js.new(Builtin::TestRunner, [ + js.array(suites), + js.string(url), + js.string(id), + ]) + end + + # These functions are for looking up entities that the runtime uses + # (Just, Nothing, Err, Ok, Main). + + def main + [ast.components.find!(&.name.value.==("Main"))] of Item + end + + def maybe + ast.type_definitions.find!(&.name.value.==("Maybe")).tap { |a| resolve a } + end + + def result + ast.type_definitions.find!(&.name.value.==("Result")).tap { |a| resolve a } + end + + def just + [ + maybe + .fields + .as(Array(Ast::TypeVariant)) + .find!(&.value.value.==("Just")), + ] of Item + end + + def nothing + [ + maybe + .fields + .as(Array(Ast::TypeVariant)) + .find!(&.value.value.==("Nothing")), + ] of Item + end + + def ok + [ + result + .fields + .as(Array(Ast::TypeVariant)) + .find!(&.value.value.==("Ok")), + ] of Item + end + + def err + [ + result + .fields + .as(Array(Ast::TypeVariant)) + .find!(&.value.value.==("Err")), + ] of Item + end + end +end diff --git a/src/compiler2/config.cr b/src/compiler2/config.cr new file mode 100644 index 000000000..c6f4617f1 --- /dev/null +++ b/src/compiler2/config.cr @@ -0,0 +1,12 @@ +module Mint + class Compiler2 + record Config, + test : Tuple(String, String)?, + include_program : Bool, + runtime_path : String, + css_prefix : String?, + relative : Bool, + optimize : Bool, + build : Bool + end +end diff --git a/src/compiler2/decoder.cr b/src/compiler2/decoder.cr new file mode 100644 index 000000000..e794bfed4 --- /dev/null +++ b/src/compiler2/decoder.cr @@ -0,0 +1,64 @@ +module Mint + class Compiler2 + def decoder(type : TypeChecker::Record) + @decoders[type] ||= begin + node = + ast.type_definitions.find!(&.name.value.==(type.name)) + + item = + type + .fields + .each_with_object({} of String => Compiled) do |(key, value), memo| + decoder = + self.decoder value + + if mapping = type.mappings[key]? + decoder = js.array([decoder, [%("#{mapping}")] of Item]) + end + + memo[key] = decoder + end + + [ + Decoder.new(type.name).tap do |id| + add node, id, js.call(Builtin::Decoder, [js.object(item), ok, err]) + end, + ] of Item + end + end + + def decoder(type : TypeChecker::Type) : Compiled + case type.name + when "Array" + js.call(Builtin::DecodeArray, [decoder(type.parameters.first), ok, err]) + when "Map" + js.call(Builtin::DecodeMap, [decoder(type.parameters.last), ok, err]) + when "Bool" + js.call(Builtin::DecodeBoolean, [ok, err]) + when "Number" + js.call(Builtin::DecodeNumber, [ok, err]) + when "String" + js.call(Builtin::DecodeString, [ok, err]) + when "Time" + js.call(Builtin::DecodeTime, [ok, err]) + when "Object" + js.call(Builtin::DecodeObject, [ok]) + when "Maybe" + js.call( + Builtin::DecodeMaybe, + [decoder(type.parameters.first), ok, err, just, nothing]) + when "Tuple" + decoders = + type.parameters.map { |item| decoder(item) } + + js.call(Builtin::DecodeTuple, [js.array(decoders), ok, err]) + else + raise "Cannot generate a decoder for #{type}!" + end + end + + def decoder(node : TypeChecker::Variable) + raise "Cannot generate a decoder for a type variable!" + end + end +end diff --git a/src/compiler2/encoder.cr b/src/compiler2/encoder.cr new file mode 100644 index 000000000..614d3c593 --- /dev/null +++ b/src/compiler2/encoder.cr @@ -0,0 +1,54 @@ +module Mint + class Compiler2 + def encoder(type : TypeChecker::Record) : Compiled + @encoders[type] ||= begin + node = + ast.type_definitions.find!(&.name.value.==(type.name)) + + item = + type + .fields + .each_with_object({} of String => Compiled) do |(key, value), memo| + encoder = + self.encoder value + + if mapping = type.mappings[key]? + encoder = js.array([encoder, [%("#{mapping}")] of Item]) + end + + memo[key] = encoder + end + + [ + Encoder.new(type.name).tap do |id| + add node, id, js.call(Builtin::Encoder, [js.object(item)]) + end, + ] of Item + end + end + + def encoder(type : TypeChecker::Type) : Compiled + case type.name + when "Maybe" + js.call(Builtin::EncodeMaybe, [encoder(type.parameters.first), just]) + when "Array" + js.call(Builtin::EncodeArray, [encoder(type.parameters.first)]) + when "Map" + js.call(Builtin::EncodeMap, [encoder(type.parameters.last)]) + when "Time" + [Builtin::EncodeTime] of Item + when "Tuple" + encoders = + type.parameters.map { |item| encoder(item) } + + js.call(Builtin::EncodeTuple, [js.array(encoders)]) + else + [Builtin::Identity] of Item + end + end + + def encoder(node : TypeChecker::Variable) + raise "Cannot generate an encoder for a type variable!" + end + end +end diff --git a/src/compiler2/js.cr b/src/compiler2/js.cr new file mode 100644 index 000000000..7007127f8 --- /dev/null +++ b/src/compiler2/js.cr @@ -0,0 +1,217 @@ +module Mint + class Compiler2 + # This class is resposible for creating a tree of JS code + class Js + # Whether or not to optimize the output. + getter? optimize : Bool = false + + def initialize(@optimize) + end + + # Renders an object. The key can be any item but it's usually a string + # or an identifier. + def object(items : Hash(Item, Compiled)) : Compiled + return ["{}"] of Item if items.empty? + + fields = + join( + items.map { |key, value| [key, optimize? ? ":" : ": "] + value }, + optimize? ? "," : ",\n") + + block(fields) + end + + def null : Compiled + ["null"] of Item + end + + def string(value : String) : Compiled + ["`", Raw.new(value.gsub('`', "\\`").gsub("${", "\\${`")), "`"] of Item + end + + # Renders an object destructuring. + def object_destructuring(items : Array(Compiled)) : Compiled + return ["{}"] of Item if items.empty? + + block(join(items, optimize? ? "," : ",\n")) + end + + # Renders a call. + def call(name : Item | Compiled, arguments : Array(Compiled)) : Compiled + case name + in Compiled + name + ["("] + list(arguments) + [")"] + in Item + [name, "("] + list(arguments) + [")"] + end + end + + # Renders an array. + def array(items : Array(Compiled)) : Compiled + if optimize? || items.size <= 1 + ["["] + list(items) + ["]"] + else + ["[", Indent.new(["\n"] + list(items, multiline: true)), "\n]"] of Item + end + end + + # Renders statements. + def statements(items : Array(Compiled)) : Compiled + join(items.reject(&.empty?), optimize? ? ";" : ";\n") + end + + # Renders a const assignment. + def const(name : Item | Compiled, value : Compiled) : Compiled + ["const "] + assign(name, value) + end + + # Renders multiple const assignments (as one). + def consts(items : Array(Tuple(Ast::Node, Id, Compiled))) : Compiled + if items.size == 1 + _, id, value = + items[0] + + const id, value + else + assigns = + items.map { |(_, id, compiled)| assign(id, compiled) } + + if optimize? + ["const "] + list(assigns, multiline: false) + else + ["const"] + [Indent.new(["\n"] + list(assigns, multiline: true))] of Item + end + end + end + + # Renders an initializer. + def new(name : Item | Compiled, items : Array(Compiled) = [] of Compiled) : Compiled + ["new "] + call(name, items) + end + + # Renders a let assignment with multiple variables. + def let(variables : Array(Variable)) : Compiled + ["let "] + variables.map(&.as(Item)).intersperse(optimize? ? "," : ", ") + end + + # Renders a let assignment. + def let(name : Item | Compiled, value : Compiled) : Compiled + ["let "] + assign(name, value) + end + + # Renders an assignment. + def assign(name : Item | Compiled, value : Compiled) : Compiled + case name + in Compiled + name + [optimize? ? "=" : " = "] + value + in Item + ([name, optimize? ? "=" : " = "] of Item) + value + end + end + + # Renders an if statement. + def if(condition : Compiled, body : Compiled) : Compiled + ["if", optimize? ? "(" : " ("] + condition + [optimize? ? ")" : ") "] + + block(body) + end + + # Renders an tenary operator. + def tenary(condition : Compiled, truthy : Compiled, falsy : Compiled) + ["("] + + condition + + [optimize? ? "?" : " ? "] + + truthy + + [optimize? ? ":" : " : "] + + falsy + + [")"] + end + + # Renders a for statement. + def for(variables : Compiled, subject : Compiled, &) : Compiled + ["for", optimize? ? "(" : " ("] + + variables + + [" of "] + + subject + + [optimize? ? ")" : ") "] + + block(yield) + end + + # Renders a return statement. + def return(item : Compiled) : Compiled + ["return "] + item + end + + # Renders an async immediately invoked function. + def asynciif(&) : Compiled + function([] of Compiled, async: true, invoke: true) { yield } + end + + # Renders an async immediately invoked function. + def iif(&) : Compiled + function([] of Compiled, async: false, invoke: true) { yield } + end + + # Renders an async arrow function. + def async_arrow_function(arguments : Array(Compiled) = [] of Compiled, &) : Compiled + function(arguments, async: true, invoke: false) { yield } + end + + # Renders an arrow function. + def arrow_function(arguments : Array(Compiled) = [] of Compiled, &) : Compiled + function(arguments, async: false, invoke: false) { yield } + end + + # Renders an list (separated by commas). + private def list(arguments : Array(Compiled), *, multiline : Bool = false) : Compiled + if multiline + join(arguments, ",\n") + else + join(arguments, optimize? ? "," : ", ") + end + end + + # Renders a function. + private def function( + arguments : Array(Compiled) = [] of Compiled, *, + async : Bool, invoke : Bool, & + ) + keyword = + if async + "async " + else + "" + end + + items = + block(yield) + + head, tail, parens = + if invoke + ["(", ")", "()"] + else + ["", "", ""] + end + + [head, keyword, "("] + + list(arguments) + + [optimize? ? ")=>" : ") => "] + + items + + [tail, parens] + end + + # Renders a block ({...}). + private def block(items : Compiled) : Compiled + if optimize? + ["{"] + items + ["}"] + else + [Indent.new(["{\n"] + items), "\n}"] of Item + end + end + + # Joins the items with the given separator. + private def join(items : Array(Compiled), separator : String) : Compiled + items.reject(&.empty?).intersperse([separator]).flatten + end + end + end +end diff --git a/src/compiler2/program.cr b/src/compiler2/program.cr new file mode 100644 index 000000000..9dfbb0201 --- /dev/null +++ b/src/compiler2/program.cr @@ -0,0 +1,278 @@ +module Mint + class Compiler2 + def self.bundle_name(node : Ast::Node | Nil) + case node + when Ast::Component + "/__mint__/#{node.name.value.underscore}.js" + when Ast::Defer + "/__mint__/d#{node.id}.js" + when Nil + "/index.js" + else + raise "Should not happen!" + end + end + + def self.dbg_name(node) + case x = node + when Ast::Component + "<#{x.name.value}>" + when Ast::Module, Ast::Store, Ast::Provider + x.name.value + when Ast::Function, Ast::Constant, Ast::Get, Ast::State + "#{dbg_name(x.parent)}.#{x.name.value}" + when Ast::Block + "{block}" + when Ast::Access + "{access .#{x.field.value}}" + when Ast::Statement + name = + case target = x.target + when Ast::Variable + " #{target.value}" + end + + "{statement#{name}}" + when Ast::Route + "{route #{x.url}}" + else + x.class.name + end + end + + def self.program( + artifacts : TypeChecker::Artifacts, + config : Config + ) : Hash(String, String) + compiler = + new(artifacts, config) + + # Gather all top level entities and resolve them, this will populate the + # `compiled` instance variable of the compiler. + entities = + artifacts.ast.type_definitions + + artifacts.ast.unified_modules + + artifacts.ast.components + + artifacts.ast.providers + + artifacts.ast.stores + + compiler.resolve(entities) + + # Compile the CSS. + css = + compiler.style_builder.compile + + # Compile tests if there is configration for it. + tests = + config.test.try do |(url, id)| + [ + compiler.test(url, id), + compiler.inject_css(css), + ] + end + + # This holds the to be compiled constants per bundle. `nil` holds + # the ones meant for the main bundle. + bundles = + { + nil => [] of Tuple(Ast::Node, Id, Compiled), + } of Ast::Node | Nil => Array(Tuple(Ast::Node, Id, Compiled)) + + # This holds which node belongs to which bundle. + scopes = + {} of Ast::Node => Ast::Node + + # Gather all of the IDs so we can use it to filter out imports later on. + ids = + compiler.compiled.map { |(_, id, _)| id } + + # We iterate through all references and decide in which bundle they + # belong. All nodes that needs to be compiled should be in the references + # map. + artifacts.references.map do |node, set| + # Gather all related nodes. + nodes = + compiler.compiled.select { |item| item[1] == node } + + # Delete the nodes so we know after which was not used so we can + # add it to the main bundle. + nodes.each { |item| compiler.compiled.delete(item) } + + case node + when Ast::Defer + bundles[node] ||= [] of Tuple(Ast::Node, Id, Compiled) + bundles[node].concat(nodes) + when Ast::Component + # We put async components into their own bundle. + if node.async? + bundles[node] ||= [] of Tuple(Ast::Node, Id, Compiled) + bundles[node].concat(nodes) + + # Add the lazy component definition to the main bundle. + bundles[nil] << { + node, + node, + compiler.js.call( + Builtin::Lazy, + [["'", bundle_name(node), "'"] of Item]), + } + end + end || + # If a node used in the main bundle or it two or more bundles then + # it will go into the main bundle. Otherwise it will go to the + # the bundle it's used from. + if set.includes?(nil) || (!set.includes?(nil) && set.size >= 2) + bundles[nil].concat(nodes) + elsif first = set.first + bundles[first] ||= [] of Tuple(Ast::Node, Id, Compiled) + bundles[first].concat(nodes) + + # Assign the scope to the node + scopes[node] = first + end + end + + # bundles.each do |node, items| + # entities = + # items.compact_map do |item| + # if item[0] == node + # next if node.is_a?(Ast::Defer) + # else + # next if item[0].is_a?(Ast::Component) && + # item[0].as(Ast::Component).async? + # end + + # dbg_name(item[0]) + # end + + # puts bundle_name(node) + # entities.sort.each do |item| + # puts " > #{item}" + # end + # end + + # Add not already added items to the main bundle. + bundles[nil].concat(compiler.compiled) + + pool = + NamePool(Ast::Node | Variable | String, Ast::Node | Nil).new + + class_pool = + NamePool(Ast::Node | Builtin, Ast::Node | Nil).new('A'.pred.to_s) + + rendered_bundles = + {} of Ast::Node | Nil => Tuple(Renderer, Array(String)) + + # We render the bundles so we can know after what we need to import. + bundles.each do |node, contents| + renderer = + Renderer.new(base: node, class_pool: class_pool, pool: pool) + + # Built the singe `const` with multiple assignments so we can add + # things later to the array. + items = + if contents.empty? + [] of Compiled + else + # Here we sort the compiled node by the order they are resovled, which + # will prevent issues of one entity depending on others (like a const + # depending on a function from a module). + contents.sort_by! do |(node, id, _)| + case node + when Ast::TypeVariant + -2 if node.value.value.in?("Just", "Nothing", "Err", "Ok") + end || artifacts.resolve_order.index(node) || -1 + end + + [["export "] + compiler.js.consts(contents)] + end + + # If we are building the main bundle we add the translations, tests + # and the program. + case node + when Nil + # Add translations and tests + items.concat compiler.translations + items.concat tests if tests + + # Add the program if needed. + items << compiler.program if config.include_program + end + + # Render the final JavaScript. + items = + items.reject(&.empty?).map { |item| renderer.render(item) } + + rendered_bundles[node] = {renderer, items} + end + + modules = + rendered_bundles.map do |node, (renderer, items)| + # Main doesn't import from other nodes. + if node + # This holds the imports for each other bundle. + imports = + {} of Ast::Node | Nil => Hash(String, String) + + renderer.used.map do |item| + # We only need to import things that are actually exported (all + # other entities show up here like function arguments statement + # variables, etc...) + next unless ids.includes?(item) + + # Get where the entity should be. + target = + scopes[item]? + + # If the target is not this bundle and it's not the same bundle + # then we need to import. + if target != node && item != node + exported_name = + rendered_bundles[target][0].render(item).to_s + + imported_name = + renderer.render(item).to_s + + imports[target] ||= {} of String => String + imports[target][exported_name] = imported_name + end + end + + # For each import we insert an import statment. + imports.each do |target, data| + items.unshift(renderer.import(data, config.optimize, bundle_name(target))) + end + + items << "export default #{renderer.render(node)}" if node + end + + # Gather what builtins need to be imported and add it's statement + # as well. + builtins = + renderer + .builtins + .each_with_object({} of String => String) do |item, memo| + memo[item.to_s.camelcase(lower: true)] = renderer.class_pool.of(item, node) + end + + items + .unshift(renderer.import(builtins, config.optimize, config.runtime_path)) + .reject!(&.blank?) + + js = + if items.empty? + "" + elsif config.optimize + items.join(";") + else + items.join(";\n\n") + ";" + end + + {bundle_name(node), js} + end + + modules << {"/index.css", css} + modules.to_h + end + end +end diff --git a/src/compiler2/renderer.cr b/src/compiler2/renderer.cr new file mode 100644 index 000000000..e4a7dd62d --- /dev/null +++ b/src/compiler2/renderer.cr @@ -0,0 +1,115 @@ +module Mint + class Compiler2 + # This class is responsible to render `Compiled` code. + class Renderer + # The pool for variables (lowercase). + getter pool : NamePool(Ast::Node | Variable | String, Ast::Node | Nil) + + # The pool for class variables (uppercase). + getter class_pool : NamePool(Ast::Node | Builtin, Ast::Node | Nil) + + # A set to track nodes which we rendered. + getter used = Set(Ast::Node | Encoder | Decoder).new + + # A set to track used builtins which will be imported. + getter builtins = Set(Builtin).new + + getter base : Ast::Node | Nil + + # The current indentation depth. + property depth : Int32 = 0 + + def initialize(*, @base, @pool, @class_pool) + end + + def import(imports : Hash(String, String), optimize : Bool, path : String) + return "" if imports.empty? + + items = + imports + .map do |(key, value)| + if key == value + key + else + "#{key} as #{value}" + end + end + .sort_by!(&.size).reverse! + + if items.size > 1 && !optimize + %(import {\n#{items.join(",\n").indent}\n} from "#{path}") + else + %(import { #{items.join(",")} } from "#{path}") + end + end + + def render(items : Compiled) : String + String.build do |io| + render(items, io) + end + end + + def render(items : Compiled, io : IO) + items.each do |item| + render(item, io) + end + end + + # We are using a string builder to build the final compiled code. + def render(item : Item, io : IO = IO::Memory.new) + case item + in Signal + used.add(item.value) + + # Signals are special becuse we need to use the `.value` accessor. + io << "#{pool.of(item.value, base)}.value" + in Ref + # Signals are special becuse we need to use the `.current` accessor. + io << "#{pool.of(item.value, base)}.current" + in Ast::Node + scope = + case parent = item.parent + when Ast::Component + parent if parent.async? + end || base + + used.add(item) + + # Nodes are compiled into variables. + case item + when Ast::TypeVariant, + Ast::Component, + Ast::Provider + io << class_pool.of(item, scope) + else + io << pool.of(item, scope) + end + in Encoder, Decoder + used.add(item) + + io << pool.of(item.value, base) + in Variable + io << pool.of(item, base) + in Builtin + io << class_pool.of(item, base) + + # We track the builtins here. + builtins.add(item) + in Raw + io << item.value + in String + # Only strings need to be indented, and we copy everything and when + # there is a new line we add the indentation after. + item.each_char do |char| + io << char + io << (" " * depth * 2) if char == '\n' + end + in Indent + self.depth += 1 + render(item.items, io) + self.depth -= 1 + end + end + end + end +end diff --git a/src/compiler2/utils.cr b/src/compiler2/utils.cr new file mode 100644 index 000000000..485234b64 --- /dev/null +++ b/src/compiler2/utils.cr @@ -0,0 +1,103 @@ +module Mint + class Compiler2 + def self.tokens_to_lines(ast : Ast) + parts = + SemanticTokenizer.tokenize(ast) + + lines = + [ + [] of String | Tuple(SemanticTokenizer::TokenType, String), + ] + + index = 0 + + processor = + ->(str : String, item : String | Tuple(SemanticTokenizer::TokenType, String)) { + if str.includes?("\n") + parts = + str.split("\n") + + parts.each_with_index do |part, part_index| + not_last = + part_index < (parts.size - 1) + + case item + in String + lines[index].push(not_last ? part.as(String) + "\n" : part) + in Tuple(SemanticTokenizer::TokenType, String) + lines[index].push({item[0], part.as(String)}) + end + + if not_last + index += 1 + lines << [] of String | Tuple(SemanticTokenizer::TokenType, String) + end + end + else + lines[index].push(item) + end + } + + parts.each do |item| + case item + in String + processor.call(item, item) + in Tuple(SemanticTokenizer::TokenType, String) + processor.call(item[1], item) + end + end + + lines + end + + def tokenize(ast : Ast) + mapped = + Compiler2 + .tokens_to_lines(ast) + .map do |parts| + items = + parts.map do |item| + case item + in String + js.string(item) + in Tuple(SemanticTokenizer::TokenType, String) + js.call(Builtin::CreateElement, [ + [%("span")] of Item, + js.object({"className".as(Item) => [ + %("#{item[0].to_s.underscore}"), + ] of Item}), + js.array([js.string(item[1])]), + ]) + end + end + + js.call(Builtin::CreateElement, [ + [%("span")] of Item, + js.object({"className".as(Item) => [%("line")] of Item}), + js.array(items), + ]) + end + + js.call(Builtin::CreateElement, [ + [Builtin::Fragment] of Item, + ["{}"] of Item, + js.array(mapped), + ]) + end + + def parse_svg(contents) + document = + XML.parse(contents) + + svg = + document.first_element_child + + if svg + data = + svg.children.join.strip + + {svg["width"]?, svg["height"]?, svg["viewBox"]?, data} + end + end + end +end diff --git a/src/compilers/call.cr b/src/compilers/call.cr index 318473fcb..742f6009c 100644 --- a/src/compilers/call.cr +++ b/src/compilers/call.cr @@ -5,7 +5,7 @@ module Mint compile node.expression arguments = - compile node.arguments.sort_by { |item| argument_order.index(item) || -1 }, ", " + compile node.arguments.sort_by { |item| resolve_order.index(item) || -1 }, ", " case when node.expression.is_a?(Ast::InlineFunction) diff --git a/src/compilers/directives/highlight.cr b/src/compilers/directives/highlight.cr index 3a007045f..dc8a45f77 100644 --- a/src/compilers/directives/highlight.cr +++ b/src/compilers/directives/highlight.cr @@ -17,20 +17,13 @@ module Mint parts.map do |item| case item in String - "`#{skip { escape_for_javascript(item) }}`" + "`#{skip { item.escape_for_javascript }}`" in Tuple(SemanticTokenizer::TokenType, String) - "_h('span', { className: '#{item[0].to_s.underscore}' }, [`#{skip { escape_for_javascript(item[1]) }}`])" + "_h('span', { className: '#{item[0].to_s.underscore}' }, [`#{skip { item[1].escape_for_javascript }}`])" end end "[#{content}, _h(React.Fragment, {}, [#{mapped.join(",\n")}])]" end - - def escape_for_javascript(value : String) - value - .gsub('\\', "\\\\") - .gsub('`', "\\`") - .gsub("${", "\\${") - end end end diff --git a/src/compilers/directives/highlight_file.cr b/src/compilers/directives/highlight_file.cr index ab3f0c09e..c25ff050e 100644 --- a/src/compilers/directives/highlight_file.cr +++ b/src/compilers/directives/highlight_file.cr @@ -14,9 +14,9 @@ module Mint parts.map do |item| case item in String - "`#{skip { escape_for_javascript(item) }}`" + "`#{skip { item.escape_for_javascript }}`" in Tuple(SemanticTokenizer::TokenType, String) - "_h('span', { className: '#{item[0].to_s.underscore}' }, [`#{skip { escape_for_javascript(item[1]) }}`])" + "_h('span', { className: '#{item[0].to_s.underscore}' }, [`#{skip { item[1].escape_for_javascript }}`])" end end diff --git a/src/compilers2/access.cr b/src/compilers2/access.cr new file mode 100644 index 000000000..f134ed49a --- /dev/null +++ b/src/compilers2/access.cr @@ -0,0 +1,61 @@ +module Mint + class Compiler2 + def compile(node : Ast::Access) : Compiled + compile node do + if items = variables[node]? + case items[0] + when Ast::TypeVariant + case type = cache[node]? + when nil + [] of Item + else + if type.name == "Function" + js.call(Builtin::NewVariant, [[items[0]] of Item] of Compiled) + else + js.new(items[0], [] of Compiled) + end + end + else + # `subscriptions` is a special case: both the parent and the entity + # is the provider. + case parent = items[1] + when Ast::Provider + case items[0] + when Ast::Provider + return js.call(Builtin::Subscriptions, [[parent.subscription] of Item]) + end + end + + case item = items[0] + when Ast::Get + js.call(item, [] of Compiled) + when Ast::State + [Signal.new(item)] of Item + else + [item] of Item + end + end + elsif item = record_field_lookup[node.field]? + compile(node.expression) + ["."] + [node.field.value] of Item + else + lookup = + lookups[node.field] + + item = + case field = lookup[0] + when Ast::Variable + [Ref.new(lookup[0])] of Item + when Ast::Get + js.call(field, [] of Compiled) + when Ast::State + [Signal.new(field)] of Item + else + [field] of Item + end + + compile(node.expression) + ["."] + item + end + end + end + end +end diff --git a/src/compilers2/argument.cr b/src/compilers2/argument.cr new file mode 100644 index 000000000..eda71dffc --- /dev/null +++ b/src/compilers2/argument.cr @@ -0,0 +1,13 @@ +module Mint + class Compiler2 + def compile(node : Ast::Argument) : Compiled + compile node do + if default = node.default + js.assign(node, compile(default)) + else + [node] of Item + end + end + end + end +end diff --git a/src/compilers2/array_access.cr b/src/compilers2/array_access.cr new file mode 100644 index 000000000..970ae985d --- /dev/null +++ b/src/compilers2/array_access.cr @@ -0,0 +1,22 @@ +module Mint + class Compiler2 + def compile(node : Ast::ArrayAccess) : Compiled + compile node do + expression = + compile node.expression + + type = + cache[node.expression] + + index = + compile node.index + + if type.name == "Tuple" && node.index.is_a?(Ast::NumberLiteral) + expression + js.array([index]) + else + js.call(Builtin::ArrayAccess, [expression, index, just, nothing]) + end + end + end + end +end diff --git a/src/compilers2/array_literal.cr b/src/compilers2/array_literal.cr new file mode 100644 index 000000000..b972c2059 --- /dev/null +++ b/src/compilers2/array_literal.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::ArrayLiteral) : Compiled + compile node do + js.array(compile(node.items)) + end + end + end +end diff --git a/src/compilers2/block.cr b/src/compilers2/block.cr new file mode 100644 index 000000000..4b3f4623d --- /dev/null +++ b/src/compilers2/block.cr @@ -0,0 +1,31 @@ +module Mint + class Compiler2 + def compile(node : Ast::Block, for_function = false) : Compiled + compile node do + expressions = + compile node.expressions.select(Ast::Statement) + + last = + expressions.pop + + if expressions.empty? && !async?(node) + if for_function + js.return(last) + else + last + end + elsif for_function + js.statements(expressions + [js.return(last)]) + elsif async?(node) + js.asynciif do + js.statements(expressions + [js.return(last)]) + end + else + js.iif do + js.statements(expressions + [js.return(last)]) + end + end + end + end + end +end diff --git a/src/compilers2/bool_literal.cr b/src/compilers2/bool_literal.cr new file mode 100644 index 000000000..05863e00c --- /dev/null +++ b/src/compilers2/bool_literal.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::BoolLiteral) : Compiled + compile node do + [node.value.to_s] of Item + end + end + end +end diff --git a/src/compilers2/builtin.cr b/src/compilers2/builtin.cr new file mode 100644 index 000000000..f654d2e5c --- /dev/null +++ b/src/compilers2/builtin.cr @@ -0,0 +1,50 @@ +module Mint + class Compiler2 + def compile(node : Ast::Builtin) : Compiled + compile node do + case node.value + when "normalizeEvent" + [Builtin::NormalizeEvent] of Item + when "decodeBoolean" + [Builtin::DecodeBoolean] of Item + when "decodeNumber" + [Builtin::DecodeNumber] of Item + when "decodeString" + [Builtin::DecodeString] of Item + when "decodeArray" + [Builtin::DecodeArray] of Item + when "decodeField" + [Builtin::DecodeField] of Item + when "decodeMaybe" + [Builtin::DecodeMaybe] of Item + when "decodeTime" + [Builtin::DecodeTime] of Item + when "testContext" + [Builtin::TestContext] of Item + when "testRender" + [Builtin::TestRender] of Item + when "createPortal" + [Builtin::CreatePortal] of Item + when "navigate" + [Builtin::Navigate] of Item + when "compare" + [Builtin::Compare] of Item + when "setLocale" + [Builtin::SetLocale] of Item + when "locale" + [Builtin::Locale, ".value"] of Item + when "nothing" + nothing + when "just" + just + when "err" + err + when "ok" + ok + else + raise "Unkown builtin: #{node.value}!" + end + end + end + end +end diff --git a/src/compilers2/call.cr b/src/compilers2/call.cr new file mode 100644 index 000000000..e1716ddf0 --- /dev/null +++ b/src/compilers2/call.cr @@ -0,0 +1,26 @@ +module Mint + class Compiler2 + def compile(node : Ast::Call) : Compiled + compile node do + expression = + compile node.expression + + arguments = + node + .arguments + .sort_by { |item| resolve_order.index(item) || -1 } + .map { |item| compile item } + + receiver = + case + when node.expression.is_a?(Ast::InlineFunction) + ["("] + expression + [")"] + else + expression + end + + js.call(receiver, arguments) + end + end + end +end diff --git a/src/compilers2/case.cr b/src/compilers2/case.cr new file mode 100644 index 000000000..86bba746a --- /dev/null +++ b/src/compilers2/case.cr @@ -0,0 +1,36 @@ +module Mint + class Compiler2 + def compile( + node : Ast::Case, + block : Proc(String, String)? = nil + ) : Compiled + compile node do + condition = + compile node.condition + + branches = + node + .branches + .sort_by(&.pattern.nil?.to_s) + .map { |branch| compile branch, block } + + if node.await + variable = + Variable.new + + js.asynciif do + js.statements([ + js.let(variable, ["await "] + defer(node.condition, condition)), + js.return(js.call(Builtin::Match, [ + [variable] of Item, + js.array(branches), + ])), + ]) + end + else + js.call(Builtin::Match, [condition, js.array(branches)]) + end + end + end + end +end diff --git a/src/compilers2/case_branch.cr b/src/compilers2/case_branch.cr new file mode 100644 index 000000000..82bae6087 --- /dev/null +++ b/src/compilers2/case_branch.cr @@ -0,0 +1,33 @@ +module Mint + class Compiler2 + def compile( + node : Ast::CaseBranch, + block : Proc(String, String)? = nil + ) : Compiled + compile node do + expression = + case item = node.expression + when Array(Ast::CssDefinition) + compile item, block if block + when Ast::Node + compile(item) + end || [] of Item + + if pattern = node.pattern + variables = + [] of Compiled + + matcher = + destructuring(pattern, variables) + + js.array([ + matcher, + js.arrow_function(variables) { js.return(expression) }, + ]) + else + js.array([js.null, js.arrow_function { js.return(expression) }]) + end + end + end + end +end diff --git a/src/compilers2/component.cr b/src/compilers2/component.cr new file mode 100644 index 000000000..ef4fd65b0 --- /dev/null +++ b/src/compilers2/component.cr @@ -0,0 +1,215 @@ +module Mint + class Compiler2 + def resolve(node : Ast::Component) + resolve node do + node.styles.each do |style| + next unless style.in?(@artifacts.checked) + style_builder.process(style, node.name.value.gsub('.', '·')) + end + + styles = + node.styles.compact_map do |style_node| + next unless style_node.in?(@artifacts.checked) + style_builder.compile_style(style_node, self) + end + + did_update = nil + unmount = nil + render = nil + mount = nil + + functions = + node.functions.compact_map do |function| + case function.name.value + when "componentDidUpdate" + did_update = function + nil + when "componentWillUnmount" + unmount = function + nil + when "componentDidMount" + mount = function + nil + when "render" + render = function + nil + else + resolve function + end + end + + constants = + resolve node.constants + + states = + resolve node.states + + gets = + resolve node.gets + + refs = + node.refs.to_h.keys.map do |ref| + method = + if node.global? + Builtin::CreateRef + else + Builtin::UseRef + end + + {ref, ref, js.call(method, [js.new(nothing, [] of Compiled)])} + end + + properties = + node.properties.map do |prop| + name = + if prop.name.value == "children" + ["children: ", prop] of Item + else + [prop] of Item + end + + if default = prop.default + js.assign(name, compile(default)) + else + name + end + end + + exposed = + if components_touched.includes?(node) + items = + (refs + states + gets + functions + constants) + .compact + .map do |item| + [item[0]] of Item + end + + unless items.empty? + variable = + Variable.new + + properties << ["_"] of Item + [ + js.const(variable, js.call(Builtin::UseMemo, [ + js.arrow_function { js.return(js.object_destructuring(items)) }, + js.array([] of Compiled), + ])), + js.tenary( + ["_"] of Item, + js.call(["_"] of Item, [[variable] of Item]), + js.null), + ] + end + end || [] of Compiled + + arguments = + unless properties.empty? + [js.object_destructuring(properties)] + end + + provider_effects = + if node.uses.empty? + [] of Compiled + else + id = Variable.new + + node.uses.map do |use| + data = + if condition = use.condition + js.tenary(compile(condition), compile(use.data), js.null) + else + compile(use.data) + end + + js.call(lookups[use][0], [ + [id] of Item, + js.arrow_function { js.return(data) }, + ]) + end + end + + id = + if id + method = + if node.global? + Builtin::Uuid + else + Builtin::UseId + end + + [{ + node.as(Ast::Node), + id.as(Id), + js.call(method, [] of Compiled), + }] + else + [] of Tuple(Ast::Node, Id, Compiled) + end + + effect = + if mount || unmount + body = [] of Compiled + body << ["("] + compile(mount, skip_const: true) + [")()"] if mount + body << js.return(compile(unmount, skip_const: true)) if unmount + + [ + js.call(Builtin::UseEffect, [ + js.arrow_function([] of Compiled) { js.statements(body) }, + ["[]"] of Item, + ]), + ] + else + [] of Compiled + end + + update_effect = + if did_update + [ + js.call(Builtin::UseDidUpdate, [ + compile(did_update, skip_const: true), + ]), + ] + else + [] of Compiled + end + + items = + if node.global? + refs + states + gets + functions + styles + constants + id + [ + {node, + node, + compile( + render.not_nil!, + skip_const: true, + contents: js.statements( + exposed + effect + update_effect + provider_effects))}, + ] + else + entities = + (refs + states + gets + functions + styles + constants + id).compact + + consts = + if entities.empty? + [] of Compiled + else + [js.consts(entities)] + end + + [{ + node, + node, + compile( + render.not_nil!, + args: arguments, + skip_const: true, + contents: js.statements( + consts + exposed + effect + update_effect + provider_effects + )), + }] + end + + add(items) + end + end + end +end diff --git a/src/compilers2/constant.cr b/src/compilers2/constant.cr new file mode 100644 index 000000000..ba9cdf7ce --- /dev/null +++ b/src/compilers2/constant.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def resolve(node : Ast::Constant) + resolve node do + {node, node, compile(node.expression)} + end + end + end +end diff --git a/src/compilers2/decode.cr b/src/compilers2/decode.cr new file mode 100644 index 000000000..20b7e2644 --- /dev/null +++ b/src/compilers2/decode.cr @@ -0,0 +1,29 @@ +module Mint + class Compiler2 + def compile(node : Ast::Decode) : Compiled + compile node do + type = + cache[node] + + object = + case type.name + when "Function" + type.parameters.last.parameters.last + when "Result" + type.parameters.last + else + raise "Unkown decoder for type: #{type.name}!" + end + + code = + decoder object + + if item = node.expression + js.call(code, [compile(item)]) + else + code + end + end + end + end +end diff --git a/src/compilers2/defer.cr b/src/compilers2/defer.cr new file mode 100644 index 000000000..d9cdea02a --- /dev/null +++ b/src/compilers2/defer.cr @@ -0,0 +1,20 @@ +module Mint + class Compiler2 + def compile(node : Ast::Defer) : Compiled + compile node do + add(node, node, compile(node.body)) + + js.string(self.class.bundle_name(node)) + end + end + + def defer(node : Ast::Node, compiled : Compiled) + case type = cache[node] + when TypeChecker::Type + if type.name == "Deferred" + js.call(Builtin::Load, [compiled]) + end + end || compiled + end + end +end diff --git a/src/compilers2/destructuring.cr b/src/compilers2/destructuring.cr new file mode 100644 index 000000000..a0f064a38 --- /dev/null +++ b/src/compilers2/destructuring.cr @@ -0,0 +1,95 @@ +module Mint + class Compiler2 + def destructuring(node : Ast::ArrayDestructuring, variables : Array(Compiled)) : Compiled + js.array(node.items.map { |item| destructuring(item, variables) }) + end + + def destructuring(node : Ast::TupleDestructuring, variables : Array(Compiled)) : Compiled + js.array(node.items.map { |item| destructuring(item, variables) }) + end + + def destructuring(node : Ast::Variable, variables : Array(Compiled)) : Compiled + variables << [node] of Item + [Builtin::PatternVariable] of Item + end + + def destructuring(node : Ast::Spread, variables : Array(Compiled)) : Compiled + variables << [node] of Item + [Builtin::PatternSpread] of Item + end + + def destructuring(node : Ast::Node, variables : Array(Compiled)) : Compiled + compile(node) + end + + def destructuring(node : Nil, variables : Array(Compiled)) : Compiled + js.null # This means to skip this value when destructuring. + end + + def destructuring( + node : Ast::TypeDestructuring, + variables : Array(Compiled) + ) : Compiled + items = + if lookups[node][0].as(Ast::TypeVariant).fields + params = node.items.select(Ast::Variable) + + if !params.empty? + fields = + params.map do |param| + js.array([ + js.string(param.value), + destructuring(param, variables), + ]) + end + + js.call(Builtin::PatternRecord, [js.array(fields)]) + end + end || js.array(node.items.map do |param| + destructuring(param, variables) + end) + + js.call(Builtin::Pattern, [[lookups[node][0]], items]) + end + + def match( + condition : Ast::Node, + branches : Array(Tuple(Ast::Node?, Compiled)), + await : Bool + ) : Compiled + items = + branches.map do |(pattern, expression)| + variables = + [] of Compiled + + matcher = + destructuring(pattern, variables) + + result = + js.arrow_function(variables) { js.return(expression) } + + js.array([matcher, result]) + end + + compiled = + compile(condition) + + if await + variable = + Variable.new + + js.asynciif do + js.statements([ + js.let(variable, ["await "] + defer(condition, compiled)), + js.return(js.call(Builtin::Match, [ + [variable] of Item, + js.array(items), + ])), + ]) + end + else + js.call(Builtin::Match, [compiled, js.array(items)]) + end + end + end +end diff --git a/src/compilers2/directives/asset.cr b/src/compilers2/directives/asset.cr new file mode 100644 index 000000000..bae02ec45 --- /dev/null +++ b/src/compilers2/directives/asset.cr @@ -0,0 +1,15 @@ +module Mint + class Compiler2 + def compile(node : Ast::Directives::Asset) : Compiled + compile node do + prefix = + config.relative ? "" : "/" + + filename = + node.filename(build: config.build) + + js.string("#{prefix}#{ASSET_DIR}/#{filename}") + end + end + end +end diff --git a/src/compilers2/directives/documentation.cr b/src/compilers2/directives/documentation.cr new file mode 100644 index 000000000..1edb4526f --- /dev/null +++ b/src/compilers2/directives/documentation.cr @@ -0,0 +1,13 @@ +module Mint + class Compiler2 + def compile(node : Ast::Directives::Documentation) : Compiled + compile node do + [ + JSON.build do |json| + DocumentationGenerator.new.generate(lookups[node][0], json) + end, + ] of Item + end + end + end +end diff --git a/src/compilers2/directives/format.cr b/src/compilers2/directives/format.cr new file mode 100644 index 000000000..54349ce0f --- /dev/null +++ b/src/compilers2/directives/format.cr @@ -0,0 +1,17 @@ +module Mint + class Compiler2 + def compile(node : Ast::Directives::Format) : Compiled + compile node do + content = + compile node.content + + formatted = + Formatter.new + .format(node.content, Formatter::BlockFormat::Naked) + .gsub('\\', "\\\\") + + js.array([content, js.string(formatted)]) + end + end + end +end diff --git a/src/compilers2/directives/highlight.cr b/src/compilers2/directives/highlight.cr new file mode 100644 index 000000000..b3f69dff2 --- /dev/null +++ b/src/compilers2/directives/highlight.cr @@ -0,0 +1,18 @@ +module Mint + class Compiler2 + def compile(node : Ast::Directives::Highlight) : Compiled + compile node do + content = + compile node.content + + formatted = + Formatter.new.format(node.content, Formatter::BlockFormat::Naked) + + parser = Parser.new(formatted, "source.mint") + parser.many { parser.comment || parser.statement } + + js.array([content, tokenize(parser.ast)]) + end + end + end +end diff --git a/src/compilers2/directives/highlight_file.cr b/src/compilers2/directives/highlight_file.cr new file mode 100644 index 000000000..f3703a241 --- /dev/null +++ b/src/compilers2/directives/highlight_file.cr @@ -0,0 +1,15 @@ +module Mint + class Compiler2 + def compile(node : Ast::Directives::HighlightFile) : Compiled + compile node do + contents = + File.read(node.real_path) + + parser = Parser.new(contents.strip, node.real_path.to_s) + parser.parse + + tokenize(parser.ast) + end + end + end +end diff --git a/src/compilers2/directives/inline.cr b/src/compilers2/directives/inline.cr new file mode 100644 index 000000000..688c7be3e --- /dev/null +++ b/src/compilers2/directives/inline.cr @@ -0,0 +1,7 @@ +module Mint + class Compiler2 + def compile(node : Ast::Directives::Inline) : Compiled + ["`", Raw.new(node.file_contents), "`"] of Item + end + end +end diff --git a/src/compilers2/directives/svg.cr b/src/compilers2/directives/svg.cr new file mode 100644 index 000000000..a293b2729 --- /dev/null +++ b/src/compilers2/directives/svg.cr @@ -0,0 +1,25 @@ +module Mint + class Compiler2 + def compile(node : Ast::Directives::Svg) : Compiled + compile node do + parsed = + parse_svg(node.file_contents) + + return [] of Item unless parsed + + width, height, view_box, data = + parsed + + attributes = + js.object({ + "dangerouslySetInnerHTML" => js.object({"__html" => js.string(data)}), + "viewBox" => js.string(view_box.to_s), + "height" => js.string(height.to_s), + "width" => js.string(width.to_s), + } of Item => Compiled) + + js.call(Builtin::CreateElement, [js.string("svg"), attributes]) + end + end + end +end diff --git a/src/compilers2/encode.cr b/src/compilers2/encode.cr new file mode 100644 index 000000000..cfd015c21 --- /dev/null +++ b/src/compilers2/encode.cr @@ -0,0 +1,12 @@ +module Mint + class Compiler2 + def compile(node : Ast::Encode) : Compiled + compile node do + code = + encoder cache[node.expression] + + js.call(code, [compile(node.expression)]) + end + end + end +end diff --git a/src/compilers2/env.cr b/src/compilers2/env.cr new file mode 100644 index 000000000..852b28023 --- /dev/null +++ b/src/compilers2/env.cr @@ -0,0 +1,12 @@ +module Mint + class Compiler2 + def compile(node : Ast::Env) : Compiled + compile node do + value = + MINT_ENV[node.name].to_s + + js.string(value) + end + end + end +end diff --git a/src/compilers2/field.cr b/src/compilers2/field.cr new file mode 100644 index 000000000..159c4b6e0 --- /dev/null +++ b/src/compilers2/field.cr @@ -0,0 +1,21 @@ +module Mint + class Compiler2 + def compile(node : Ast::Field) + compile node do + compile node.value + end + end + + def resolve(node : Ast::Field) : Hash(Item, Compiled) + return {} of Item => Compiled unless key = node.key + + value = + compile node.value + + name = + key.value + + {name.as(Item) => value} + end + end +end diff --git a/src/compilers2/for_expression.cr b/src/compilers2/for_expression.cr new file mode 100644 index 000000000..ca569870c --- /dev/null +++ b/src/compilers2/for_expression.cr @@ -0,0 +1,85 @@ +module Mint + class Compiler2 + def compile(node : Ast::For) : Compiled + compile node do + subject = + compile node.subject + + subject_type = + cache[node.subject] + + body = + compile node.body + + arguments, index_arg = + if (subject_type.name == "Array" && node.arguments.size == 1) || + (subject_type.name == "Set" && node.arguments.size == 1) || + (subject_type.name == "Map" && node.arguments.size == 2) + if node.arguments.size == 1 + { + [node.arguments[0].as(Item)], + nil, + } + else + { + js.array(node.arguments.map { |item| [item] of Item }), + nil, + } + end + else + if node.arguments.size == 2 + { + [node.arguments[0].as(Item)], + node.arguments[1], + } + else + { + js.array(node.arguments[0..1].map { |item| [item] of Item }), + node.arguments[2], + } + end + end + + condition = + node.condition.try do |item| + js.statements([ + js.const("_2".as(Item), compile(item)), + js.if(["!_2"] of Item, ["continue"] of Item), + ]) + end + + index = + if index_arg + js.const(index_arg, ["_i"] of Item) + end + + contents = + if condition + [ + ["_i++"] of Item, + index, + condition, js.call("_0.push", [body]), + ] + else + [ + ["_i++"] of Item, + index, + js.call("_0.push", [body]), + ] + end + + js.iif do + js.statements([ + js.const("_0".as(Item), js.array([] of Compiled)), + js.const("_1".as(Item), subject), + js.let("_i".as(Item), ["-1"] of Item), + js.for(["let "] + arguments, ["_1"] of Item) do + js.statements(contents.compact) + end, + js.return(["_0"] of Item), + ]) + end + end + end + end +end diff --git a/src/compilers2/function.cr b/src/compilers2/function.cr new file mode 100644 index 000000000..5db5afaa5 --- /dev/null +++ b/src/compilers2/function.cr @@ -0,0 +1,44 @@ +module Mint + class Compiler2 + def resolve(node : Ast::Function) + resolve node do + {node, node, compile(node, contents: nil, args: nil, skip_const: true)} + end + end + + def compile(node : Ast::Function) + compile node do + compile(node, contents: nil, args: nil) + end + end + + def compile( + node : Ast::Function, *, + contents : Compiled | Nil = nil, + args : Array(Compiled) | Nil = nil, + skip_const : Bool = false + ) : Compiled + items = + [] of Compiled + + arguments = + args || compile(node.arguments) + + items << contents if contents + items << compile(node.body, for_function: true) + + body = + if async?(node.body) + js.async_arrow_function(arguments) { js.statements(items) } + else + js.arrow_function(arguments) { js.statements(items) } + end + + if skip_const + body + else + js.const(node, body) + end + end + end +end diff --git a/src/compilers2/get.cr b/src/compilers2/get.cr new file mode 100644 index 000000000..d4bd0ce69 --- /dev/null +++ b/src/compilers2/get.cr @@ -0,0 +1,19 @@ +module Mint + class Compiler2 + def resolve(node : Ast::Get) + resolve node do + body = + compile node.body, for_function: true + + body = + if async?(node.body) + js.async_arrow_function([] of Compiled) { body } + else + js.arrow_function([] of Compiled) { body } + end + + {node, node, body} + end + end + end +end diff --git a/src/compilers2/here_doc.cr b/src/compilers2/here_doc.cr new file mode 100644 index 000000000..20c464819 --- /dev/null +++ b/src/compilers2/here_doc.cr @@ -0,0 +1,73 @@ +module Mint + class Compiler2 + def compile(node : Ast::HereDocument) : Compiled + compile node do + # We generate a hexdigest of the source code, but this still can + # conflict, so if you find a better solution in the future let me + # (or yourself) know. + separator = + Digest::MD5.hexdigest(node.source) + + interpolations = + [] of Compiled + + value = + node + .value + .join do |item| + case item + in Ast::Node + interpolations << compile(item) + separator + in String + item + end + end + .lchop('\n') + .lchop('\r') + .lchop("\n\r") + .rstrip + .gsub("\\\#{", "\#{") + + if node.modifier == '#' + document = + Markd::Parser.parse( + value.shrink_to_minimum_leading_whitespace, + Markd::Options.new) + + VDOMRenderer2.render( + replacements: interpolations, + highlight: node.highlight, + separator: separator, + document: document, + js: js, + ) + else + if node.modifier == '~' + value = value.shrink_to_minimum_leading_whitespace + end + + # Compile the non interpolation parts and the + # interpolation parts together into a string. + value = + value + .split(separator) + .map do |item| + raw = + item + .gsub('`', "\\`") + .gsub("${", "\\${") + [ + Raw.new(raw), + ] of Item + end + + interpolations = + interpolations.map { |item| ["${"] + item + ["}"] } + + ["`"] + value.zip2(interpolations) + ["`"] + end + end + end + end +end diff --git a/src/compilers2/html_attribute.cr b/src/compilers2/html_attribute.cr new file mode 100644 index 000000000..26167f35f --- /dev/null +++ b/src/compilers2/html_attribute.cr @@ -0,0 +1,22 @@ +module Mint + class Compiler2 + def resolve( + node : Ast::HtmlAttribute, *, + is_element = true + ) : Hash(Item, Compiled) + value = + compile node.value + + downcase_name = + node.name.value.downcase + + if downcase_name == "readonly" && is_element + {"readOnly".as(Item) => value} + elsif lookups[node]?.try(&.first?) + {lookups[node][0].as(Item) => value} + else + { %("#{node.name.value}").as(Item) => value } + end + end + end +end diff --git a/src/compilers2/html_component.cr b/src/compilers2/html_component.cr new file mode 100644 index 000000000..7945f285a --- /dev/null +++ b/src/compilers2/html_component.cr @@ -0,0 +1,61 @@ +module Mint + class Compiler2 + # TODO: + # def _compile(node : Ast::HtmlComponent) : String + # if hash = static_value(node) + # name = + # static_components_pool.of(hash, nil) + + # static_components[name] ||= compile_html_component(node) + + # "$#{name}()" + # else + # compile_html_component(node) + # end + # end + + def compile(node : Ast::HtmlComponent) : Compiled + compile node do + component = + node.component_node.not_nil! + + children = + unless node.children.empty? + items = + compile node.children + + js.call(Builtin::ToArray, items) + end + + attributes = + node + .attributes + .map { |item| resolve(item, is_element: false) } + .reduce({} of Item => Compiled) { |memo, item| memo.merge(item) } + + node.ref.try do |ref| + attributes["_"] = + js.call(Builtin::SetRef, [[ref] of Item, just]) + end + + if component.async? + js.call(Builtin::CreateElement, [ + [Builtin::LazyComponent] of Item, + js.object({ + "key" => js.string(component.name.value), + "x" => [component] of Item, + "p" => js.object(attributes), + "c" => children || js.array([] of Compiled), + }), + ]) + else + js.call(Builtin::CreateElement, [ + [component] of Item, + js.object(attributes), + children || [] of Item, + ]) + end + end + end + end +end diff --git a/src/compilers2/html_element.cr b/src/compilers2/html_element.cr new file mode 100644 index 000000000..291a7d881 --- /dev/null +++ b/src/compilers2/html_element.cr @@ -0,0 +1,89 @@ +module Mint + class Compiler2 + def compile(node : Ast::HtmlElement) : Compiled + compile node do + children = + if node.children.empty? + [] of Item + else + items = + compile node.children + + js.array(items) + end + + attributes = + node + .attributes + .reject(&.name.value.in?("class", "style")) + .map { |item| resolve(item, is_element: true) } + .reduce({} of Item => Compiled) { |memo, item| memo.merge(item) } + + style_nodes = + node.styles.compact_map(&.style_node) + + class_name = + unless style_nodes.empty? + style_nodes.join(' ') do |style_node| + style_builder.prefixed_class_name(style_node) + end + end + + class_name_attribute = + node + .attributes + .find(&.name.value.==("class")) + .try { |attribute| compile(attribute.value) } + + classes = + case + when class_name && class_name_attribute + class_name_attribute + [" + ` #{class_name}`"] + when class_name_attribute + class_name_attribute + when class_name + js.string(class_name) + end + + custom_styles = + node + .attributes + .find(&.name.value.==("style")) + .try { |attribute| compile(attribute.value) } + + styles = [] of Compiled + + node.styles.each do |item| + next unless style = item.style_node + next unless style_builder.any?(style) + + arguments = + compile item.arguments + + styles << js.call(style, arguments) + end + + styles << custom_styles if custom_styles + + if classes + attributes["className"] = classes + end + + unless styles.empty? + attributes["style"] = js.call(Builtin::Style, [js.array(styles)]) + end + + node.ref.try do |ref| + attributes["ref"] = + js.call(Builtin::SetRef, [[ref] of Item, just]) + end + + js.call(Builtin::CreateElement, [ + js.string(node.tag.value), + js.object(attributes), + children, + ]) + end + end + end +end diff --git a/src/compilers2/html_expression.cr b/src/compilers2/html_expression.cr new file mode 100644 index 000000000..20a16523b --- /dev/null +++ b/src/compilers2/html_expression.cr @@ -0,0 +1,23 @@ +module Mint + class Compiler2 + def compile(node : Ast::HtmlExpression) : Compiled + compile node do + case node.expressions.size + when 0 + ["null"] of Item + when 1 + compile node.expressions.first + else + children = + compile node.expressions + + js.call(Builtin::CreateElement, [ + [Builtin::Fragment] of Item, + ["{}"] of Item, + js.array(children), + ]) + end + end + end + end +end diff --git a/src/compilers2/html_fragment.cr b/src/compilers2/html_fragment.cr new file mode 100644 index 000000000..771c64b23 --- /dev/null +++ b/src/compilers2/html_fragment.cr @@ -0,0 +1,23 @@ +module Mint + class Compiler2 + def compile(node : Ast::HtmlFragment) : Compiled + compile node do + case node.children.size + when 0 + js.null + when 1 + compile node.children.first + else + items = + compile node.children + + js.call(Builtin::CreateElement, [ + [Builtin::Fragment] of Item, + ["{}"] of Item, + js.array(items), + ]) + end + end + end + end +end diff --git a/src/compilers2/if.cr b/src/compilers2/if.cr new file mode 100644 index 000000000..e9cc2f51c --- /dev/null +++ b/src/compilers2/if.cr @@ -0,0 +1,82 @@ +module Mint + class Compiler2 + def compile( + items : Array(Ast::CssDefinition), + block : Proc(String, String)? + ) : Compiled + compiled = + items.each_with_object({} of String => Compiled) do |definition, memo| + variable = + if block + block.call(definition.name) + else + "" + end + + value = + compile definition.value + + memo["[`#{variable}`]"] = value + end + + js.call("Object.assign", [["_"] of Item, js.object(compiled)]) + end + + def compile( + node : Ast::If, + block : Proc(String, String)? = nil + ) : Compiled + compile node do + truthy_item, falsy_item = + node.branches + + truthy = + if truthy_item.expressions.all?(Ast::CssDefinition) + compile( + truthy_item.expressions.select(Ast::CssDefinition), block: block) + else + compile truthy_item + end + + falsy = + case item = falsy_item + when Ast::If + compile item, block: block + when Ast::Block + if item.expressions.all?(Ast::CssDefinition) + compile( + item.expressions.select(Ast::CssDefinition), block: block) + else + compile item + end + else + if truthy_item + case cache[truthy_item].name + when "Array" + ["[]"] of Item + when "String" + ["\"\""] of Item + when "Maybe" + js.new(nothing) + end + end + end || js.null + + case statement = node.condition + when Ast::Statement + case target = statement.target + when Ast::Node + match(statement.expression, [ + {target, truthy}, + {nil, falsy}, + ], statement.await) + else + js.tenary(compile(statement.expression), truthy, falsy) + end + else + js.tenary(compile(node.condition), truthy, falsy) + end + end + end + end +end diff --git a/src/compilers2/inline_function.cr b/src/compilers2/inline_function.cr new file mode 100644 index 000000000..3e804a01d --- /dev/null +++ b/src/compilers2/inline_function.cr @@ -0,0 +1,24 @@ +module Mint + class Compiler2 + def compile(node : Ast::InlineFunction) : Compiled + compile node do + body = + case item = node.body + when Ast::Block + compile item, for_function: true + else + compile item + end + + arguments = + compile node.arguments + + if async?(node.body) + js.async_arrow_function(arguments) { body } + else + js.arrow_function(arguments) { body } + end + end + end + end +end diff --git a/src/compilers2/interpolation.cr b/src/compilers2/interpolation.cr new file mode 100644 index 000000000..5bb765b90 --- /dev/null +++ b/src/compilers2/interpolation.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::Interpolation) : Compiled + compile node do + compile node.expression + end + end + end +end diff --git a/src/compilers2/js.cr b/src/compilers2/js.cr new file mode 100644 index 000000000..cabf68c58 --- /dev/null +++ b/src/compilers2/js.cr @@ -0,0 +1,33 @@ +module Mint + class Compiler2 + def compile(node : Ast::Js) : Compiled + compile node do + case item = node.value.first? + when String + node.value[0] = item.lstrip + end + + case item = node.value.last? + when String + node.value[node.value.size - 1] = item.rstrip + end + + value = + node.value.flat_map do |entity| + case entity + in Ast::Node + compile entity + in String + entity.gsub("\\`", '`') + end + end + + if value.empty? + ["undefined"] of Item + else + ["("] + value + [")"] + end + end + end + end +end diff --git a/src/compilers2/locale_key.cr b/src/compilers2/locale_key.cr new file mode 100644 index 000000000..949019d69 --- /dev/null +++ b/src/compilers2/locale_key.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::LocaleKey) : Compiled + compile node do + js.call(Builtin::Translate, [js.string(node.value)]) + end + end + end +end diff --git a/src/compilers2/member_access.cr b/src/compilers2/member_access.cr new file mode 100644 index 000000000..d94dd2cdc --- /dev/null +++ b/src/compilers2/member_access.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::MemberAccess) : Compiled + compile node do + js.call(Builtin::Access, [js.string(node.name.value)]) + end + end + end +end diff --git a/src/compilers2/module.cr b/src/compilers2/module.cr new file mode 100644 index 000000000..ad2aab7a4 --- /dev/null +++ b/src/compilers2/module.cr @@ -0,0 +1,15 @@ +module Mint + class Compiler2 + def resolve(node : Ast::Module) + resolve node do + functions = + resolve node.functions + + constants = + resolve node.constants + + add functions + constants + end + end + end +end diff --git a/src/compilers2/negated_expression.cr b/src/compilers2/negated_expression.cr new file mode 100644 index 000000000..9164fdf27 --- /dev/null +++ b/src/compilers2/negated_expression.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::NegatedExpression) : Compiled + compile node do + [node.negations] + compile(node.expression) + end + end + end +end diff --git a/src/compilers2/next_call.cr b/src/compilers2/next_call.cr new file mode 100644 index 000000000..cf29edf79 --- /dev/null +++ b/src/compilers2/next_call.cr @@ -0,0 +1,37 @@ +module Mint + class Compiler2 + def compile(node : Ast::NextCall) : Compiled + compile node do + entity = + lookups[node]?.try(&.first?) + + if node.data.fields.empty? + js.null + else + assigns = + node.data.fields.compact_map do |item| + next unless key = item.key + + field = + case entity + when Ast::Component, Ast::Store, Ast::Provider + entity.states.find(&.name.value.==(key.value)) + end + + next unless field + + js.assign(Signal.new(field), compile(item.value)) + end + + if assigns.size > 1 + js.call(Builtin::Batch, [ + js.arrow_function { js.statements(assigns) }, + ]) + else + js.iif { assigns[0] } + end + end + end + end + end +end diff --git a/src/compilers2/number_literal.cr b/src/compilers2/number_literal.cr new file mode 100644 index 000000000..059df4518 --- /dev/null +++ b/src/compilers2/number_literal.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::NumberLiteral) : Compiled + compile node do + [static_value(node).to_s] of Item + end + end + end +end diff --git a/src/compilers2/operation.cr b/src/compilers2/operation.cr new file mode 100644 index 000000000..f1e345402 --- /dev/null +++ b/src/compilers2/operation.cr @@ -0,0 +1,24 @@ +module Mint + class Compiler2 + def compile(node : Ast::Operation) : Compiled + compile node do + left = + compile node.left + + right = + compile node.right + + case node.operator + when "or" + js.call(Builtin::Or, [left + ["._0"], right]) + when "==" + js.call(Builtin::Compare, [left, right]) + when "!=" + ["!"] + js.call(Builtin::Compare, [left, right]) + else + left + [" #{node.operator} "] + right + end + end + end + end +end diff --git a/src/compilers2/parenthesized_expression.cr b/src/compilers2/parenthesized_expression.cr new file mode 100644 index 000000000..a06837154 --- /dev/null +++ b/src/compilers2/parenthesized_expression.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::ParenthesizedExpression) : Compiled + compile node do + ["("] + compile(node.expression) + [")"] + end + end + end +end diff --git a/src/compilers2/pipe.cr b/src/compilers2/pipe.cr new file mode 100644 index 000000000..becb88a0d --- /dev/null +++ b/src/compilers2/pipe.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::Pipe) : Compiled + compile node do + compile node.call + end + end + end +end diff --git a/src/compilers2/provider.cr b/src/compilers2/provider.cr new file mode 100644 index 000000000..ec37dcb6e --- /dev/null +++ b/src/compilers2/provider.cr @@ -0,0 +1,41 @@ +module Mint + class Compiler2 + def resolve(node : Ast::Provider) + resolve node do + update = + node.functions.find!(&.name.value.==("update")) + + functions = + resolve(node.functions - [update]) + + constants = + resolve node.constants + + states = + resolve node.states + + gets = + resolve node.gets + + update = + { + node, + node, + js.call(Builtin::CreateProvider, [ + [node.subscription] of Item, + compile(update, skip_const: true), + ]), + } + + subscriptions = + { + node.subscription, + node.subscription, + js.new("Map".as(Item)), + } + + add functions + states + gets + constants + [subscriptions, update] + end + end + end +end diff --git a/src/compilers2/record.cr b/src/compilers2/record.cr new file mode 100644 index 000000000..6f5f25ea2 --- /dev/null +++ b/src/compilers2/record.cr @@ -0,0 +1,14 @@ +module Mint + class Compiler2 + def compile(node : Ast::Record) : Compiled + compile node do + fields = + node.fields + .map { |item| resolve(item) } + .reduce({} of Item => Compiled) { |memo, item| memo.merge(item) } + + js.object(fields) + end + end + end +end diff --git a/src/compilers2/record_update.cr b/src/compilers2/record_update.cr new file mode 100644 index 000000000..e691d4686 --- /dev/null +++ b/src/compilers2/record_update.cr @@ -0,0 +1,20 @@ +module Mint + class Compiler2 + def compile(node : Ast::RecordUpdate) : Compiled + compile node do + expression = + compile node.expression + + fields = + node.fields + .map { |item| resolve(item) } + .reduce({} of String => Compiled) { |memo, item| memo.merge(item) } + .map { |key, value| [key, ": "] + value } + + fields.unshift(["..."] + expression) + + js.object_destructuring(fields) + end + end + end +end diff --git a/src/compilers2/regexp_literal.cr b/src/compilers2/regexp_literal.cr new file mode 100644 index 000000000..ccd5b2bd5 --- /dev/null +++ b/src/compilers2/regexp_literal.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::RegexpLiteral) : Compiled + compile node do + [static_value(node).to_s] of Item + end + end + end +end diff --git a/src/compilers2/return_call.cr b/src/compilers2/return_call.cr new file mode 100644 index 000000000..a7a348081 --- /dev/null +++ b/src/compilers2/return_call.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::ReturnCall) : Compiled + compile node do + js.return compile(node.expression) + end + end + end +end diff --git a/src/compilers2/route.cr b/src/compilers2/route.cr new file mode 100644 index 000000000..65c46730a --- /dev/null +++ b/src/compilers2/route.cr @@ -0,0 +1,37 @@ +module Mint + class Compiler2 + def compile(node : Ast::Route) : Compiled + compile node do + expression = + compile node.expression + + arguments = + compile node.arguments + + mapping = + node + .arguments + .map { |argument| js.string(argument.name.value) } + + decoders = + node + .arguments + .map { |argument| decoder(cache[argument]) } + + handler = + if async?(node.expression) + js.async_arrow_function(arguments) { expression } + else + js.arrow_function(arguments) { expression } + end + + js.object({ + "path" => js.string(node.url), + "decoders" => js.array(decoders), + "mapping" => js.array(mapping), + "handler" => handler, + }) + end + end + end +end diff --git a/src/compilers2/state.cr b/src/compilers2/state.cr new file mode 100644 index 000000000..05dad4622 --- /dev/null +++ b/src/compilers2/state.cr @@ -0,0 +1,19 @@ +module Mint + class Compiler2 + def resolve(node : Ast::State) + resolve node do + default = + compile node.default + + method = + if (parent = node.parent).is_a?(Ast::Component) && !parent.global? + Builtin::UseSignal + else + Builtin::Signal + end + + {node, node, js.call(method, [default])} + end + end + end +end diff --git a/src/compilers2/statement.cr b/src/compilers2/statement.cr new file mode 100644 index 000000000..2a6ac0a02 --- /dev/null +++ b/src/compilers2/statement.cr @@ -0,0 +1,59 @@ +module Mint + class Compiler2 + def compile(node : Ast::Statement) : Compiled + compile node do + right, return_call = + case expression = node.expression + when Ast::Operation + case item = expression.right + when Ast::ReturnCall + { + compile(expression.left), + compile(item.expression), + } + end + end || {compile(node.expression), nil} + + right = ["await "] + defer(node.expression, right) if node.await + + if target = node.target + case target + when Ast::Variable + js.const(target, right) + when Ast::TupleDestructuring, + Ast::ArrayDestructuring, + Ast::TypeDestructuring + variables = [] of Compiled + + pattern = + destructuring(target, variables) + + case target + when Ast::TupleDestructuring + if target.items.all?(Ast::Variable) + js.const(js.array(variables), right) + end + end || begin + var = + Variable.new + + const = + js.const(var, js.call(Builtin::Destructure, [right, pattern])) + + return_if = + if return_call + js.if([var, " === false"], js.return(return_call)) + end + + js.statements([ + const, + return_if, + js.const(js.array(variables), [var]), + ].compact) + end + end + end || right + end + end + end +end diff --git a/src/compilers2/store.cr b/src/compilers2/store.cr new file mode 100644 index 000000000..6241e7fc8 --- /dev/null +++ b/src/compilers2/store.cr @@ -0,0 +1,21 @@ +module Mint + class Compiler2 + def resolve(node : Ast::Store) + resolve node do + constants = + resolve node.constants + + functions = + resolve node.functions + + states = + resolve node.states + + gets = + resolve node.gets + + add states + gets + functions + constants + end + end + end +end diff --git a/src/compilers2/string.cr b/src/compilers2/string.cr new file mode 100644 index 000000000..85e6946fc --- /dev/null +++ b/src/compilers2/string.cr @@ -0,0 +1,28 @@ +module Mint + class Compiler2 + def compile( + value : Array(Ast::Node | String), *, + quote_string : Bool = false + ) : Compiled + if value.any?(Ast::Node) + value.map do |part| + case part + when Ast::StringLiteral + compile part, quote: quote_string + else + compile part + end + end.intersperse([" + "]).flatten + else + result = + value.select(String).join(' ') + + compile result + end + end + + def compile(value : String) : Compiled + js.string(value) + end + end +end diff --git a/src/compilers2/string_literal.cr b/src/compilers2/string_literal.cr new file mode 100644 index 000000000..5a82cae50 --- /dev/null +++ b/src/compilers2/string_literal.cr @@ -0,0 +1,27 @@ +module Mint + class Compiler2 + def compile(node : Ast::StringLiteral, quote : Bool = false) : Compiled + value = + node.value.flat_map do |item| + case item + in Ast::Node + ["${"] + compile(item) + ["}"] + in String + [ + item + .gsub('`', "\\`") + .gsub("${", "\\${") + .gsub("\\\"", "\"") + .gsub("\\\#{", "\#{"), + ] + end + end + + if quote + [%(`")] + value + [%("`)] + else + ["`"] + value + ["`"] + end + end + end +end diff --git a/src/compilers2/suite.cr b/src/compilers2/suite.cr new file mode 100644 index 000000000..e514f406a --- /dev/null +++ b/src/compilers2/suite.cr @@ -0,0 +1,30 @@ +module Mint + class Compiler2 + def compile(node : Ast::Suite) : Compiled + compile node do + location = + [Raw.new(node.location.to_json)] + + constants = + resolve node.constants + + functions = + resolve node.functions + + tests = + compile node.tests + + name = + compile node.name + + add(functions + constants) + + js.object({ + "tests" => js.array(tests), + "location" => location, + "name" => name, + }) + end + end + end +end diff --git a/src/compilers2/test.cr b/src/compilers2/test.cr new file mode 100644 index 000000000..a09ffb853 --- /dev/null +++ b/src/compilers2/test.cr @@ -0,0 +1,35 @@ +module Mint + class Compiler2 + def compile(node : Ast::Test) : Compiled + compile node do + location = + [Raw.new(node.location.to_json)] + + name = + compile node.name + + expression = + case operation = node.expression + when Ast::Operation + if (operator = operation.operator).in?("==", "!=") + right = + compile operation.right + + left = + compile operation.left + + js.call( + Builtin::TestOperation, + [left, right, [operator] of (Item)]) + end + end || compile(node.expression) + + js.object({ + "proc" => js.async_arrow_function { js.return(expression) }, + "location" => location, + "name" => name, + }) + end + end + end +end diff --git a/src/compilers2/tuple_literal.cr b/src/compilers2/tuple_literal.cr new file mode 100644 index 000000000..f1bec1ebc --- /dev/null +++ b/src/compilers2/tuple_literal.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::TupleLiteral) : Compiled + compile node do + js.array(compile(node.items)) + end + end + end +end diff --git a/src/compilers2/type_definition.cr b/src/compilers2/type_definition.cr new file mode 100644 index 000000000..81055b6ba --- /dev/null +++ b/src/compilers2/type_definition.cr @@ -0,0 +1,21 @@ +module Mint + class Compiler2 + def resolve(node : Ast::TypeDefinition) + resolve node do + case fields = node.fields + when Array(Ast::TypeVariant) + fields.map do |option| + args = + if (fields = option.fields) && !option.parameters.empty? + [js.array(fields.map { |item| [%("#{item.key.value}")] of Item })] + else + [[option.parameters.size.to_s] of Item] + end + + add option, option, js.call(Builtin::Variant, args) + end + end + end + end + end +end diff --git a/src/compilers2/unary_minus.cr b/src/compilers2/unary_minus.cr new file mode 100644 index 000000000..d60ef459a --- /dev/null +++ b/src/compilers2/unary_minus.cr @@ -0,0 +1,9 @@ +module Mint + class Compiler2 + def compile(node : Ast::UnaryMinus) : Compiled + compile node do + ["-("] + compile(node.expression) + [")"] + end + end + end +end diff --git a/src/compilers2/variable.cr b/src/compilers2/variable.cr new file mode 100644 index 000000000..d9bae1d33 --- /dev/null +++ b/src/compilers2/variable.cr @@ -0,0 +1,44 @@ +module Mint + class Compiler2 + def compile(node : Ast::Variable) : Compiled + compile node do + if node.value == "void" + ["null"] of Item + else + entity, parent = + variables[node] + + # Subscriptions for providers are handled here + if node.value == "subscriptions" && parent.is_a?(Ast::Provider) + return js.call(Builtin::Subscriptions, [[parent.subscription] of Item]) + end + + case {entity, parent} + when {Ast::Component, Ast::Component}, + {Ast::HtmlElement, Ast::Component} + case parent + when Ast::Component + ref = + parent + .refs + .find! { |(ref, _)| ref.value == node.value }[0] + + [Ref.new(ref)] of Item + else + raise "SHOULD NOT HAPPEN" + end + else + case entity + when Ast::Get + js.call(entity, [] of Compiled) + when Ast::State + [Signal.new(entity)] of Item + else + [entity] of Item + end + end + end + end + end + end +end diff --git a/src/ext/array.cr b/src/ext/array.cr index 8fa943582..0fe439fd6 100644 --- a/src/ext/array.cr +++ b/src/ext/array.cr @@ -6,4 +6,14 @@ class Array(T) def &+(other : Nil) : self self end + + def zip2(other : Array(T)) + map_with_index do |item, index| + [item, other[index]?].compact + end.flatten + end + + def intersperse(separator : T) + flat_map { |item| [item, separator] }.tap(&.pop?) + end end diff --git a/src/ext/string.cr b/src/ext/string.cr index 82cad06cc..81589338f 100644 --- a/src/ext/string.cr +++ b/src/ext/string.cr @@ -6,6 +6,13 @@ class String .rstrip end + def escape_for_javascript + self + .gsub('\\', "\\\\") + .gsub('`', "\\`") + .gsub("${", "\\${") + end + def last? : Char? self[-1]? end diff --git a/src/formatters/component.cr b/src/formatters/component.cr index 33d8ae5d7..1d5be7fbe 100644 --- a/src/formatters/component.cr +++ b/src/formatters/component.cr @@ -21,10 +21,13 @@ module Mint global = node.global? ? "global " : "" + async = + node.async? ? "async " : "" + comment = node.comment.try { |item| "#{format item}\n" } - "#{comment}#{global}component #{name} {\n#{indent(body)}\n}" + "#{comment}#{async}#{global}component #{name} {\n#{indent(body)}\n}" end end end diff --git a/src/formatters/defer.cr b/src/formatters/defer.cr new file mode 100644 index 000000000..5276d3f22 --- /dev/null +++ b/src/formatters/defer.cr @@ -0,0 +1,10 @@ +module Mint + class Formatter + def format(node : Ast::Defer) : String + body = + format node.body + + "defer #{body}" + end + end +end diff --git a/src/formatters/here_doc.cr b/src/formatters/here_doc.cr index c71072ce2..73a4a94fd 100644 --- a/src/formatters/here_doc.cr +++ b/src/formatters/here_doc.cr @@ -13,7 +13,12 @@ module Mint end end - "<<#{node.modifier}#{node.token}#{value}#{node.token}" + flags = + if node.highlight + "(highlight)" + end + + "<<#{node.modifier}#{node.token}#{flags}#{value}#{node.token}" end end end diff --git a/src/formatters/js.cr b/src/formatters/js.cr index 321ef593e..2f234bdee 100644 --- a/src/formatters/js.cr +++ b/src/formatters/js.cr @@ -7,7 +7,7 @@ module Mint when Ast::Interpolation item.source else - format(item).gsub('`', "\\`") + format(item) end end diff --git a/src/parser.cr b/src/parser.cr index fb42bf360..6b858dbfa 100644 --- a/src/parser.cr +++ b/src/parser.cr @@ -35,6 +35,7 @@ module Mint (yield position, nodes_size, @errors.size).tap do |node| case node when Ast::Node + ast.nodes[nodes_size..-1].each { |child| child.parent ||= node unless child == node } ast.nodes << node if track when Nil ast.operators.delete_at(operators_size...) diff --git a/src/parser/top_level.cr b/src/parser/top_level.cr index 3844ca073..e9052e66e 100644 --- a/src/parser/top_level.cr +++ b/src/parser/top_level.cr @@ -50,5 +50,42 @@ module Mint end end end + + def parse_any : Nil + many do + oneof do + module_definition || + type_definition || + html_attribute || + interpolation || + css_font_face || + css_keyframes || + component || + constant || + property || + operator || + provider || + function || + comment || + connect || + locale || + routes || + route || + state || + style || + store || + suite || + test || + type || + get || + use || + statement || + case_branch || + destructuring || + css_node || + expression + end + end + end end end diff --git a/src/parsers/base_expression.cr b/src/parsers/base_expression.cr index 7139db1d3..5365fa192 100644 --- a/src/parsers/base_expression.cr +++ b/src/parsers/base_expression.cr @@ -29,6 +29,8 @@ module Mint locale_key when '`' js + when '%' + builtin when '@' highlight_file_directive || documentation_directive || @@ -67,6 +69,8 @@ module Mint decode when "encode" encode + when "defer" + defer else value end diff --git a/src/parsers/builtin.cr b/src/parsers/builtin.cr new file mode 100644 index 000000000..a489b3d76 --- /dev/null +++ b/src/parsers/builtin.cr @@ -0,0 +1,17 @@ +module Mint + class Parser + def builtin : Ast::Builtin? + parse do |start_position| + next unless char! '%' + next unless value = identifier_variable + next unless char! '%' + + Ast::Builtin.new( + from: start_position, + value: value, + to: position, + file: file) + end + end + end +end diff --git a/src/parsers/component.cr b/src/parsers/component.cr index 44b675b20..ea99ad377 100644 --- a/src/parsers/component.cr +++ b/src/parsers/component.cr @@ -7,6 +7,9 @@ module Mint global = word! "global" whitespace + async = word! "async" + whitespace + next unless word! "component" whitespace @@ -133,6 +136,7 @@ module Mint locales: locales, styles: styles, states: states, + async: async, to: position, file: file, refs: refs, diff --git a/src/parsers/defer.cr b/src/parsers/defer.cr new file mode 100644 index 000000000..fad990698 --- /dev/null +++ b/src/parsers/defer.cr @@ -0,0 +1,34 @@ +module Mint + class Parser + def defer : Ast::Defer? + parse do |start_position| + next unless word! "defer" + whitespace + + body = + expression + # block( + # ->{ error :defer_expected_opening_bracket do + # expected "the opening bracket of a deferred block", word + # snippet self + # end }, + # ->{ error :defer_expected_closing_bracket do + # expected "the closing bracket of a deferred block", word + # snippet self + # end }, + # ->{ error :defer_expected_expression do + # expected "the body of a defererred block", word + # snippet self + # end }) + + next unless body + + Ast::Defer.new( + from: start_position, + to: position, + file: file, + body: body) + end + end + end +end diff --git a/src/parsers/here_document.cr b/src/parsers/here_document.cr index 161a044a5..35953ea21 100644 --- a/src/parsers/here_document.cr +++ b/src/parsers/here_document.cr @@ -11,6 +11,17 @@ module Mint token = identifier_constant + if char!('(') + whitespace + highlight = word!("highlight") + whitespace + + next error :here_doc_expected_closing_parenthesis do + expected "the closing parenthesis of here document flags", word + snippet self + end unless char!(')') + end + next error :here_document_expected_start do expected "the start tag of a here document", word snippet self @@ -25,6 +36,7 @@ module Mint Ast::HereDocument.new( from: start_position, + highlight: highlight, modifier: modifier, token: token, value: value, diff --git a/src/parsers/html_attribute.cr b/src/parsers/html_attribute.cr index 553c4e798..b260f8b9c 100644 --- a/src/parsers/html_attribute.cr +++ b/src/parsers/html_attribute.cr @@ -2,6 +2,9 @@ module Mint class Parser def html_attribute(with_dashes : Bool = true) : Ast::HtmlAttribute? parse do |start_position| + # Dash (-) is for custom elements, colon (`:`) is for namespaces + # (xlink:actuate) and we only parse them for HTML attributes not + # component attributes (`with_dashes)`. name = variable track: false, extra_chars: with_dashes ? ['-', ':'] : [] of Char next unless name diff --git a/src/parsers/html_body.cr b/src/parsers/html_body.cr index 7cf7c1b68..ccdcc7ff9 100644 --- a/src/parsers/html_body.cr +++ b/src/parsers/html_body.cr @@ -15,7 +15,7 @@ module Mint children = [] of Ast::Node unless self_closing - items = many { expression || comment } + items = many { comment || expression } whitespace closing_tag = diff --git a/src/parsers/js.cr b/src/parsers/js.cr index 61599c07d..fe63db6c9 100644 --- a/src/parsers/js.cr +++ b/src/parsers/js.cr @@ -6,7 +6,7 @@ module Mint value = many(parse_whitespace: false) do - raw('`').try(&.gsub("\\`", '`')) || interpolation + raw('`') || interpolation end next error :js_expected_closing_tick do diff --git a/src/parsers/operator.cr b/src/parsers/operator.cr index e71d44314..37b303a59 100644 --- a/src/parsers/operator.cr +++ b/src/parsers/operator.cr @@ -52,9 +52,14 @@ module Mint next unless operator next if operator != "|>" && !whitespace? - ast.operators << {saved_position, saved_position + operator.size} - whitespace + case operator + when "or" + ast.keywords << {saved_position, saved_position + operator.size} + else + ast.operators << {saved_position, saved_position + operator.size} + end + whitespace operator end end diff --git a/src/parsers/string_literal.cr b/src/parsers/string_literal.cr index f2868d437..56d93b939 100644 --- a/src/parsers/string_literal.cr +++ b/src/parsers/string_literal.cr @@ -27,6 +27,9 @@ module Mint true end || false + to = + position + # If it's separated try to parse an other part. if broken whitespace @@ -58,8 +61,8 @@ module Mint from: start_position, broken: broken, value: value, - to: position, - file: file) + file: file, + to: to) end end end diff --git a/src/parsers/tuple_literal.cr b/src/parsers/tuple_literal.cr index 779f6f288..3965c0105 100644 --- a/src/parsers/tuple_literal.cr +++ b/src/parsers/tuple_literal.cr @@ -5,13 +5,23 @@ module Mint # TODO: Remove this branch in 0.21.0 when deprecation ends. if char! '{' whitespace + next unless head = expression + whitespace - items = list(terminator: '}', separator: ',') { expression } + next unless char! ',' + + items = + list(terminator: '}', separator: ',') { expression } whitespace next unless char! '}' elsif word!("#(") whitespace + next unless head = expression + whitespace + + next unless char! ',' + items = list(terminator: '}', separator: ',') { expression } whitespace @@ -23,6 +33,8 @@ module Mint next end + items.unshift(head) + Ast::TupleLiteral.new( from: start_position, to: position, diff --git a/src/reactor.cr b/src/reactor.cr index 121bbed9b..fdb8183f2 100644 --- a/src/reactor.cr +++ b/src/reactor.cr @@ -18,7 +18,7 @@ module Mint @sockets = [] of HTTP::WebSocket - getter script : String? + getter files : Hash(String, String) = {} of String => String def self.start(host : String, port : Int32, auto_format : Bool, live_reload : Bool) new host, port, auto_format, live_reload @@ -35,21 +35,33 @@ module Mint workspace.on "change" do |result| case result when Ast + config = + Compiler2::Config.new( + css_prefix: workspace.json.application.css_prefix, + runtime_path: "/runtime.js", + include_program: true, + relative: false, + optimize: false, + build: false, + test: nil) + # Compile. - @script = Compiler.compile workspace.type_checker.artifacts, { - css_prefix: workspace.json.application.css_prefix, - web_components: workspace.json.web_components, - relative: false, - optimize: false, - build: false, - } + @files = + Compiler2.program(workspace.type_checker.artifacts, config) + # Compiler.compile workspace.type_checker.artifacts, { + # css_prefix: workspace.json.application.css_prefix, + # web_components: workspace.json.web_components, + # relative: false, + # optimize: false, + # build: false, + # } @artifacts = workspace.type_checker.artifacts @error = nil when Error @error = result.to_html @artifacts = nil - @script = nil + @files = {} of String => String end # Notifies all connected sockets to reload the page. @@ -96,7 +108,19 @@ module Mint get "/index.js" do |env| env.response.content_type = "application/javascript" - script + files["/index.js"].to_s + end + + get "/index.css" do |env| + env.response.content_type = "text/css" + + files["/index.css"].to_s + end + + get "/__mint__/:name" do |env| + env.response.content_type = "application/javascript" + + files["/__mint__/#{env.params.url["name"]}"].to_s end get "/external-javascripts.js" do |env| diff --git a/src/scope.cr b/src/scope.cr index b2cf5aec0..2d250a300 100644 --- a/src/scope.cr +++ b/src/scope.cr @@ -80,7 +80,7 @@ module Mint when Ast::Store connect.keys.each do |key| @scopes[store][1].items[key.name.value]?.try do |value| - stack[1].items[key.target.try(&.value) || key.name.value] = Target.new(key, value.node) + stack[1].items[key.target.try(&.value) || key.name.value] = value end end end @@ -229,6 +229,7 @@ module Mint Ast::MemberAccess, Ast::BoolLiteral, Ast::LocaleKey, + Ast::Builtin, Ast::Comment, Ast::Env when Ast::StringLiteral, @@ -256,7 +257,8 @@ module Mint Ast::Property build(node.default, node) when Ast::CssSelector, - Ast::CssNestedAt + Ast::CssNestedAt, + Ast::Defer build(node.body, node) when Ast::Statement build(node.expression, node) diff --git a/src/semantic_tokenizer.cr b/src/semantic_tokenizer.cr index 96e5eee6a..042f760be 100644 --- a/src/semantic_tokenizer.cr +++ b/src/semantic_tokenizer.cr @@ -23,7 +23,6 @@ module Mint TOKEN_MAP = { Ast::TypeVariable => TokenType::TypeParameter, Ast::Comment => TokenType::Comment, - Ast::StringLiteral => TokenType::String, Ast::RegexpLiteral => TokenType::Regexp, Ast::NumberLiteral => TokenType::Number, Ast::Id => TokenType::Type, @@ -43,11 +42,16 @@ module Mint getter tokens = [] of Token def self.tokenize(ast : Ast) - tokenizer = self.new - tokenizer.tokenize(ast) - parts = [] of String | Tuple(SemanticTokenizer::TokenType, String) - contents = ast.nodes.first.file.contents + + return parts if ast.nodes.empty? + + tokenizer = + self.new.tap(&.tokenize(ast)) + + contents = + ast.nodes.first.file.contents + position = 0 tokenizer.tokens.sort_by(&.from).each do |token| @@ -149,6 +153,46 @@ module Mint add(node.tag, TokenType::Namespace) end + def tokenize(node : Ast::StringLiteral) + if node.value.size == 0 + add(node, TokenType::String) + else + position = + node.from + + node.value.each_with_index do |item, index| + last = + index == (node.value.size - 1) + + case item + in Ast::Interpolation + # We skip interpolations because they will be process separately + # but we need to proceed the position to it's end, also we need + # to add `#{` as a string which is everything up to the boxed + # expressions start. + add(position, item.expression.from, TokenType::String) + position = item.expression.to + + if last + add(position, node.to, TokenType::String) + end + in String + from = + position + + position = + if last + node.to + else + position + item.size + end + + add(from, position, TokenType::String) + end + end + end + end + def tokenize(node : Ast::HtmlComponent) node.closing_tag_position.try do |position| add(position, position + node.component.value.size, :type) diff --git a/src/style_builder.cr b/src/style_builder.cr index 6d838bf71..97631626a 100644 --- a/src/style_builder.cr +++ b/src/style_builder.cr @@ -1,22 +1,4 @@ module Mint - # This is a name pool. It returns a unique identifier for a given item of a - # given base item. - # - # In Mint it's used to get variable names for blocks of selectors - # and CSS properties. - class NamePool(T, B) - INITIAL = 'a'.pred.to_s - - @cache = {} of Tuple(B, T) => String - @current = {} of B => String - - def of(subject : T, base : B) - @cache[{base, subject}] ||= begin - @current[base] = (@current[base]? || INITIAL).succ - end - end - end - class StylePool @pool = NamePool(Ast::Style, Nil).new @cache = {} of Ast::Style => String @@ -136,6 +118,82 @@ module Mint end end + class VariableCompiler2 + delegate ifs, variables, variable_name, any?, style_pool, cases, to: @builder + delegate js, compile, to: @compiler + + getter compiler : Compiler2 + getter builder : StyleBuilder + + def initialize(@builder, @compiler) + end + + def compile(node : Ast::Style) + return unless any?(node) + + static = + variables[node]? + .try do |hash| + items = + hash + .each_with_object({} of String => Compiler2::Compiled) do |(key, value), memo| + memo["[`#{key}`]"] = compile value, quote_string: true + end + + js.object(items) unless items.empty? + end || ["{}"] of Compiler2::Item + + compiled_conditions = + begin + all_ifs = + ifs.select(&.first.==(node)) + + all_cases = + cases.select(&.first.==(node)) + + (all_ifs.keys | all_cases.keys).flat_map do |_, selector| + conditions = + all_ifs.select(&.last.==(selector)).values + + all_cases.select(&.last.==(selector)).values + + conditions + .flatten + .sort_by!(&.from) + .map do |item| + proc = + (Proc(String, String).new { |name| + variable = + variable_name name, selector + + selector[name] ||= PropertyValue.new + selector[name].variable = variable + + variable + }).as(Proc(String, String)?) + + case item + when Ast::If, Ast::Case + compile item, proc + else + [] of Compiler2::Item + end + end + end + end + + arguments = + compile node.arguments + + {node, node, js.arrow_function(arguments) do + js.statements([ + js.const("_", static), + js.statements(compiled_conditions), + js.return(["_"] of Compiler2::Item), + ]) + end} + end + end + # This class is responsible to build the CSS of "style" tags by resolving # nested nested at queries and selectors, handling cases of the same rules in # different places. @@ -204,6 +262,12 @@ module Mint .compile(node) end + def compile_style(node : Ast::Style, compiler : Compiler2) + VariableCompiler2 + .new(self, compiler) + .compile(node) + end + def any?(node : Ast::Node) variables[node]? || ifs.any?(&.first.first.==(node)) || diff --git a/src/test_runner.cr b/src/test_runner.cr index f3029e133..4a47f3643 100644 --- a/src/test_runner.cr +++ b/src/test_runner.cr @@ -127,7 +127,22 @@ module Mint @artifacts = type_checker.artifacts - Compiler.compile_with_tests(type_checker.artifacts) + config = + Compiler2::Config.new( + test: {"ws://#{@flags.browser_host}:#{@flags.browser_port}/", @test_id}, + runtime_path: "/runtime.js", + include_program: false, + css_prefix: nil, + optimize: false, + relative: false, + build: false) + + program = + Compiler2.program(type_checker.artifacts, config) + + program["/index.js"] + rescue error : Error + error.to_html end def resolve_reporter : Reporter @@ -233,16 +248,12 @@ module Mint end def setup_kemal - # ameba:disable Lint/UselessAssign - ws_url = - "ws://#{@flags.browser_host}:#{@flags.browser_port}/" - runtime = if runtime_path = @flags.runtime Cli.runtime_file_not_found(runtime_path) unless File.exists?(runtime_path) ::File.read(runtime_path) else - Assets.read("runtime.js") + Assets.read("runtime_test.js") end get "/" do @@ -281,11 +292,13 @@ module Mint asset.file_contents end - get "/runtime.js" do + get "/runtime.js" do |env| + env.response.content_type = "application/javascript" runtime end - get "/tests" do + get "/tests" do |env| + env.response.content_type = "application/javascript" script end diff --git a/src/test_runner.ecr b/src/test_runner.ecr index 45f7d4ef7..a0421dbec 100644 --- a/src/test_runner.ecr +++ b/src/test_runner.ecr @@ -6,148 +6,10 @@ - - - - +
diff --git a/src/type_checker.cr b/src/type_checker.cr index 25bf72f3b..e43ae2aa9 100644 --- a/src/type_checker.cr +++ b/src/type_checker.cr @@ -52,11 +52,12 @@ module Mint getter records, artifacts, formatter, web_components getter? check_everything + property component_stack = [] of Ast::Node property? checking = true delegate checked, record_field_lookup, component_records, to: artifacts - delegate variables, ast, lookups, cache, scope, to: artifacts - delegate assets, resolve_order, locales, argument_order, to: artifacts + delegate variables, ast, lookups, cache, scope, references, to: artifacts + delegate assets, resolve_order, locales, components_touched, to: artifacts delegate format, to: formatter @@ -70,6 +71,9 @@ module Mint @record_name_char : String = 'A'.pred.to_s + @ref_stack = {} of Ast::Node => Array(Ast::Node) + @refs = [] of Ast::Node + @stack = [] of Ast::Node def initialize(ast : Ast, @check_env = true, @web_components = [] of String, @check_everything = true) @@ -85,13 +89,7 @@ module Mint def print_stack @stack.each_with_index do |i, index| - x = case i - when Ast::Component then i.name - when Ast::Function then i.name.value - when Ast::Call then "" - else - i - end + x = Compiler2.dbg_name(i) if index == 0 puts x @@ -169,6 +167,8 @@ module Mint if node && node.fields.is_a?(Array(Ast::TypeDefinitionField)) record = check(node) + cache[node] = record + check!(node) add_record record, node record end @@ -216,7 +216,7 @@ module Mint # scope.scopes[node].each_with_index do |item, index| # puts scope.debug_name(item.node).indent(index * 2) # item.items.each do |key, value| - # puts "#{" " * (index * 2)}#{key} -> #{value.class.name}" + # puts "#{" " * (index * 2)}#{key} -> #{value.node.class.name}" # end # end @@ -228,7 +228,62 @@ module Mint # Helpers for checking things # -------------------------------------------------------------------------- + def track_references(node) + return unless checking? + + # Already tracked + if cache[node]? + @ref_stack[node]?.try(&.each do |child| + # If we hit a defer we break out of the loop + # since it will always be in a different file. + case child + when Ast::Defer + break + else + track_references(child) + end + end) + end + + references[node] ||= Set(Ast::Node | Nil).new + + # case node + # when Ast::Constant + # if node.name.value == "INDEX" + # puts "TRACK STACK #{Compiler2.dbg_name(node)}" + # print_stack + # @ref_stack[node]?.try(&.each { |child| Compiler2.dbg_name(child) }) + # puts component_stack.size + # pp caller.reverse + # end + # end + + if component_stack.empty? + references[node].add(nil) + else + component_stack.reverse_each do |component| + references[node].add(component) + + # If we hit a defer we break out of the loop + # since it will always be that defers file ( + # which we added above) + case component + when Ast::Defer + break + end + end + end + end + def check!(node) + case node + when Ast::Function, Ast::Component + if index = @refs.index(node) + @ref_stack[node] = @refs[(index + 1)..] + end + end + + resolve_order << node checked.add(node) if checking? end @@ -252,6 +307,7 @@ module Mint node: node) if @stack.none? { |item| item.is_a?(Ast::Function) || item.is_a?(Ast::InlineFunction) } && @top_level_entity.try { |item| owns?(node, item) } + track_references(node) cached else if @stack.includes?(node) @@ -273,12 +329,13 @@ module Mint node: node) if @top_level_entity.try { |item| owns?(node, item) } @stack.push node + @refs.push node result = check(node, *args).as(Checkable) - cache[node] = result - resolve_order << node + track_references(node) + cache[node] = result check! node @stack.delete node diff --git a/src/type_checker/artifacts.cr b/src/type_checker/artifacts.cr index a6cffae97..d7f6cde83 100644 --- a/src/type_checker/artifacts.cr +++ b/src/type_checker/artifacts.cr @@ -3,17 +3,18 @@ module Mint class Artifacts getter ast, lookups, cache, checked, record_field_lookup, assets getter types, variables, component_records, resolve_order, locales - getter argument_order, scope + getter scope, components_touched, references def initialize(@ast : Ast, + @references = {} of Ast::Node => Set(Ast::Node | Nil), @component_records = {} of Ast::Component => Record, + @components_touched = Set(Ast::Component).new, @record_field_lookup = {} of Ast::Node => String, @variables = {} of Ast::Node => Tuple(Ast::Node, Ast::Node), @lookups = {} of Ast::Node => Tuple(Ast::Node, Ast::Node?), @assets = [] of Ast::Directives::Asset, @cache = {} of Ast::Node => Checkable, @locales = {} of String => Hash(String, Ast::Node), - @argument_order = [] of Ast::Node, @resolve_order = [] of Ast::Node, @checked = Set(Ast::Node).new) @scope = Scope.new(@ast) diff --git a/src/type_checkers/access.cr b/src/type_checkers/access.cr index cbf6e9502..71c104039 100644 --- a/src/type_checkers/access.cr +++ b/src/type_checkers/access.cr @@ -74,6 +74,7 @@ module Mint when Array(Ast::TypeVariant) if option = fields.find(&.value.value.==(node.field.value)) variables[node] = {option, parent} + check!(parent) return to_function_type(option, parent) end end @@ -81,9 +82,9 @@ module Mint if entity = scope.resolve(possibility, node).try(&.node) if entity && possibility[0].ascii_uppercase? - variables[node.expression] = {entity, entity} - check!(entity) if target_node = scope.resolve(node.field.value, entity).try(&.node) + variables[node.expression] = {entity, entity} + check!(entity) variables[node] = {target_node, entity} variables[node.field] = {target_node, entity} return resolve target_node @@ -121,6 +122,7 @@ module Mint component.refs.reduce({} of String => Ast::Node) do |memo, (variable, ref)| case ref when Ast::HtmlComponent + components_touched.add(component) component_records .find(&.first.name.value.==(ref.component.value)) .try do |record| diff --git a/src/type_checkers/array_access.cr b/src/type_checkers/array_access.cr index e73e4846c..2c6afc9e8 100644 --- a/src/type_checkers/array_access.cr +++ b/src/type_checkers/array_access.cr @@ -10,6 +10,9 @@ module Mint type = resolve expression + index_type = + resolve index + case index when Ast::NumberLiteral if type.name == "Tuple" @@ -29,9 +32,6 @@ module Mint check_array_access(expression, type) end end || begin - index_type = - resolve index - error! :array_access_index_not_number do block "The type of the index of an array access is not a number." expected NUMBER, index_type diff --git a/src/type_checkers/builtin.cr b/src/type_checkers/builtin.cr new file mode 100644 index 000000000..2d15f16eb --- /dev/null +++ b/src/type_checkers/builtin.cr @@ -0,0 +1,7 @@ +module Mint + class TypeChecker + def check(node : Ast::Builtin) : Checkable + STRING + end + end +end diff --git a/src/type_checkers/call.cr b/src/type_checkers/call.cr index 19ba15cd1..e074a4b67 100644 --- a/src/type_checkers/call.cr +++ b/src/type_checkers/call.cr @@ -71,8 +71,6 @@ module Mint end end - argument_order.concat args - args.each_with_index do |argument, index| argument_type = resolve argument @@ -111,6 +109,9 @@ module Mint error! :impossible_error do block "You have run into an impossible error. Please file an issue " \ "with a reproducible example in the GithubRepository." + + snippet "Call type:", call_type + snippet node end unless result resolve_type(result.parameters.last) diff --git a/src/type_checkers/component.cr b/src/type_checkers/component.cr index d47026667..b279eb785 100644 --- a/src/type_checkers/component.cr +++ b/src/type_checkers/component.cr @@ -4,14 +4,20 @@ module Mint def check_all(node : Ast::Component) : Checkable resolve node + component_stack.push(node) if node.async? + resolve node.gets resolve node.constants resolve node.functions + component_stack.delete(node) if node.async? + VOID end def check(node : Ast::Component) : Checkable + component_stack.push(node) if node.async? + # Checking for global naming conflict check_global_names node.name.value, node @@ -206,6 +212,7 @@ module Mint end end + component_stack.delete(node) if node.async? VOID end end diff --git a/src/type_checkers/defer.cr b/src/type_checkers/defer.cr new file mode 100644 index 000000000..a9da87a71 --- /dev/null +++ b/src/type_checkers/defer.cr @@ -0,0 +1,14 @@ +module Mint + class TypeChecker + def check(node : Ast::Defer) : Checkable + component_stack.push(node) + + type = + resolve node.body + + component_stack.delete(node) + + Type.new("Deferred", [type] of Checkable) + end + end +end diff --git a/src/type_checkers/encode.cr b/src/type_checkers/encode.cr index 326eb845c..d2d4a1396 100644 --- a/src/type_checkers/encode.cr +++ b/src/type_checkers/encode.cr @@ -2,13 +2,11 @@ module Mint class TypeChecker def check(node : Ast::Encode) : Checkable expression = - node.expression.try do |item| - case item - when Ast::Record - resolve item, true - else - resolve item - end + case item = node.expression + when Ast::Record + resolve item, true + else + resolve item end error! :encode_complex_type do diff --git a/src/type_checkers/if.cr b/src/type_checkers/if.cr index d2ccb331c..bb19f11b8 100644 --- a/src/type_checkers/if.cr +++ b/src/type_checkers/if.cr @@ -4,13 +4,16 @@ module Mint condition = resolve node.condition - variables = + variables, await = case item = node.condition when Ast::Statement - if item.target.is_a?(Ast::TypeDestructuring) - destructure(item.target.as(Ast::TypeDestructuring), condition) + case item.target + when Ast::TupleDestructuring, + Ast::ArrayDestructuring, + Ast::TypeDestructuring + {destructure(item.target, condition), item.await} end - end || [] of VariableScope + end || {[] of VariableScope, false} error! :if_condition_type_mismatch do block do @@ -75,7 +78,11 @@ module Mint end unless Comparer.matches_any?(truthy, VALID_IF_TYPES) end - truthy + if await && truthy.name != "Promise" + Type.new("Promise", [truthy] of Checkable) + else + truthy + end end end end diff --git a/src/type_checkers/statement.cr b/src/type_checkers/statement.cr index a9fd2d91e..4fb97fb04 100644 --- a/src/type_checkers/statement.cr +++ b/src/type_checkers/statement.cr @@ -29,10 +29,12 @@ module Mint type = resolve node.expression - type = - type.parameters.first if node.await && type.name == "Promise" - - type + if (node.await && type.name == "Promise") || + (node.await && type.name == "Deferred") + type.parameters.first + else + type + end end end end diff --git a/src/type_checkers/variable.cr b/src/type_checkers/variable.cr index 357f7292c..78fab41db 100644 --- a/src/type_checkers/variable.cr +++ b/src/type_checkers/variable.cr @@ -3,7 +3,7 @@ module Mint RESERVED = %w(break case class const continue debugger default delete do else export extends for if import in instanceof new return super - switch this throw typeof var while yield state) + switch throw typeof var while yield state) def check(node : Ast::Variable) : Checkable if node.value == "void" @@ -36,6 +36,7 @@ module Mint when item[0].is_a?(Ast::HtmlElement) && item[1].is_a?(Ast::Component) Type.new("Maybe", [Type.new("Dom.Element")] of Checkable) when item[0].is_a?(Ast::Component) && item[1].is_a?(Ast::Component) + components_touched.add(item[0].as(Ast::Component)) Type.new("Maybe", [component_records[item[0]]] of Checkable) else case value = item[0] diff --git a/src/utils/index_html.cr b/src/utils/index_html.cr index 4bfc7cf1f..dd88e817a 100644 --- a/src/utils/index_html.cr +++ b/src/utils/index_html.cr @@ -7,16 +7,39 @@ module Mint @no_icons : Bool @inline : Bool @index_js : String + @index_css : String @live_reload : Bool getter env : Environment getter json : MintJson - def self.render(env : Environment, relative = false, no_manifest = false, no_service_worker = false, no_icons = false, inline = false, index_js = "", live_reload = true) : String - new(env, relative, no_manifest, no_service_worker, no_icons, inline, index_js, live_reload).to_s + def self.render( + env : Environment, + relative = false, + no_manifest = false, + no_service_worker = false, + no_icons = false, + inline = false, + index_js = "", + index_css = "", + live_reload = true + ) : String + new( + env, relative, no_manifest, no_service_worker, no_icons, inline, + index_js, index_css, live_reload).to_s end - def initialize(@env : Environment, @relative, @no_manifest, @no_service_worker, @no_icons, @inline, @index_js, @live_reload) + def initialize( + @env : Environment, + @relative, + @no_manifest, + @no_service_worker, + @no_icons, + @inline, + @index_js, + @index_css, + @live_reload + ) @json = MintJson.parse_current end diff --git a/src/utils/index_html.ecr b/src/utils/index_html.ecr index e40b5ad81..516a0f55d 100644 --- a/src/utils/index_html.ecr +++ b/src/utils/index_html.ecr @@ -27,16 +27,18 @@ + + <% else %> "> <% end %> <% end %> - <%# In development runtime comes separately and %> - <%# the live reload script necessary. %> + <%# In development the live reload script necessary. %> <% if env.development? %> - <% if @live_reload %> <% end %> @@ -67,7 +69,8 @@ <%= @index_js %> <% else %> - + + "/> <% end %>